2 lines
508 KiB
JavaScript
2 lines
508 KiB
JavaScript
(()=>{var e,t,n={97435:(e,t,n)=>{"use strict";n.r(t),n.d(t,{sendToOrigin:()=>hp});var s={};n.r(s),n.d(s,{Type:()=>Ja,clear:()=>Ya,fetch:()=>Qa,isCacheApiSupported:()=>$a,remove:()=>Za,save:()=>Xa});var a={};n.r(a),n.d(a,{abortChatRequests:()=>Ci,abortRequestGroup:()=>Pi,acceptBotUrlAuth:()=>Qi,acceptCall:()=>Ao,acceptLinkUrlAuth:()=>Zi,acceptPhoneCall:()=>xl,activateStealthMode:()=>ep,addChatMembers:()=>fr,allowBotSendMessages:()=>eo,answerCallbackButton:()=>Di,applyBoost:()=>np,blockUser:()=>au,broadcastLocalDbUpdateFull:()=>Ie,changeSessionSettings:()=>Or,changeSessionTtl:()=>Lr,checkChatUsername:()=>Ed,checkChatlistInvite:()=>Tr,checkPassword:()=>qu,checkUsername:()=>Jd,clearDraft:()=>Uo,clearPassword:()=>Ou,clearRecentReactions:()=>fl,clearRecentStickers:()=>ld,closePoll:()=>_c,confirmCall:()=>Io,confirmPhoneCall:()=>Dl,createChalistInvite:()=>Dr,createChannel:()=>Vo,createGroupCall:()=>go,createGroupChat:()=>Lo,createPhoneCallState:()=>Tl,createTopic:()=>Ir,deactivateAllUsernames:()=>Ud,decodePhoneCallData:()=>Ul,deleteChannel:()=>Oo,deleteChat:()=>Ho,deleteChatFolder:()=>Jo,deleteChatMember:()=>gr,deleteChatUser:()=>No,deleteChatlistInvite:()=>xr,deleteContact:()=>Xc,deleteExportedChatInvite:()=>Nd,deleteHistory:()=>oc,deleteMessages:()=>ac,deleteProfilePhotos:()=>eu,deleteRevokedExportedChatInvites:()=>Hd,deleteScheduledMessages:()=>ic,deleteStory:()=>jl,deleteTopic:()=>Mr,destroy:()=>mi,destroyPhoneCallState:()=>El,discardCall:()=>bo,discardGroupCall:()=>oo,disconnect:()=>_i,downloadMedia:()=>vi,editChatFolder:()=>$o,editChatPhoto:()=>Go,editChatlistInvite:()=>Vr,editExportedChatInvite:()=>Vd,editGroupCallParticipant:()=>ro,editGroupCallTitle:()=>co,editMessage:()=>Yr,editStoryPrivacy:()=>Jl,editTopic:()=>Rr,encodePhoneCallData:()=>Bl,exportChatInvite:()=>Fd,exportGroupCallInvite:()=>uo,faveSticker:()=>dd,fetchAllStories:()=>Fl,fetchAnimatedEmojiEffects:()=>hd,fetchAnimatedEmojis:()=>gd,fetchAppConfig:()=>Pu,fetchAuthorizations:()=>ou,fetchBlockedUsers:()=>su,fetchBoostsStatus:()=>sp,fetchBotApp:()=>Li,fetchBotCanSendMessage:()=>Yi,fetchCanApplyBoost:()=>tp,fetchChannelStatistics:()=>gl,fetchChat:()=>To,fetchChatFolders:()=>Ko,fetchChatInviteImporters:()=>qd,fetchChatSettings:()=>ko,fetchChatlistInvites:()=>Fr,fetchChats:()=>Po,fetchCommonChats:()=>jc,fetchConfig:()=>Mu,fetchContactList:()=>zc,fetchContentSettings:()=>Iu,fetchCountryList:()=>Ru,fetchCurrentUser:()=>Mi,fetchCustomEmoji:()=>fd,fetchCustomEmojiSets:()=>sd,fetchDefaultStatusEmojis:()=>bd,fetchDefaultTopicIcons:()=>yd,fetchEmojiKeywords:()=>Md,fetchExportedChatInvites:()=>xd,fetchExtendedMedia:()=>bc,fetchFavoriteStickers:()=>od,fetchFeaturedEmojiStickers:()=>cd,fetchFeaturedStickers:()=>rd,fetchFullChat:()=>Mo,fetchFullUser:()=>Gc,fetchGenericEmojiEffects:()=>md,fetchGlobalPrivacySettings:()=>Tu,fetchGroupCallParticipants:()=>lo,fetchGroupStatistics:()=>hl,fetchGroupsForDiscussion:()=>dr,fetchInlineBot:()=>Vi,fetchInlineBotResults:()=>Fi,fetchLangPack:()=>_u,fetchLangStrings:()=>yu,fetchLanguages:()=>mu,fetchLeaveChatlistSuggestions:()=>Br,fetchMembers:()=>cr,fetchMessage:()=>Jr,fetchMessagePublicForwards:()=>_l,fetchMessageReactions:()=>cl,fetchMessageReactionsList:()=>dl,fetchMessageStatistics:()=>ml,fetchMessageViews:()=>lc,fetchMessages:()=>$r,fetchNearestCountry:()=>Wc,fetchNotificationExceptions:()=>pu,fetchNotificationSettings:()=>fu,fetchPeerPinnedStories:()=>Hl,fetchPeerStories:()=>Nl,fetchPeerStoriesByIds:()=>Ol,fetchPinnedMessages:()=>Cc,fetchPremiumGifts:()=>_d,fetchPremiumPromo:()=>nl,fetchPrivacySettings:()=>bu,fetchProfilePhotos:()=>Zc,fetchRecentEmojiStatuses:()=>kd,fetchRecentReactions:()=>pl,fetchRecentStickers:()=>id,fetchRecommendedChatFolders:()=>zo,fetchSavedGifs:()=>Sd,fetchScheduledHistory:()=>vc,fetchSeenBy:()=>Pc,fetchSendAs:()=>Mc,fetchSponsoredMessages:()=>Rc,fetchStatisticsAsyncGraph:()=>yl,fetchStickerSets:()=>ad,fetchStickers:()=>pd,fetchStickersForEmoji:()=>Pd,fetchStoriesArchive:()=>ql,fetchStoriesMaxIds:()=>Xl,fetchStoryLink:()=>zl,fetchStoryViewList:()=>Kl,fetchTemporaryPaymentPassword:()=>sl,fetchTopInlineBots:()=>xi,fetchTopReactions:()=>ll,fetchTopUsers:()=>Kc,fetchTopicById:()=>Pr,fetchTopics:()=>Cr,fetchUnreadMentions:()=>Uc,fetchUnreadReactions:()=>Dc,fetchUsers:()=>$c,fetchWallpapers:()=>tu,fetchWebAuthorizations:()=>du,fetchWebPagePreview:()=>hc,findFirstMessageIdAfterDate:()=>Sc,forwardMessages:()=>wc,getAvailableReactions:()=>ol,getChatByPhoneNumber:()=>Zo,getChatByUsername:()=>Yo,getDhConfig:()=>yo,getGroupCall:()=>io,getPasswordInfo:()=>Nu,getPaymentForm:()=>el,getReceipt:()=>tl,hideAllChatJoinRequests:()=>Ld,hideChatJoinRequest:()=>Od,hideChatReportPanel:()=>Gd,importChatInvite:()=>br,importContact:()=>Jc,installStickerSet:()=>Ad,invokeWebViewCustomMethod:()=>to,joinChannel:()=>Fo,joinChatlistInvite:()=>Er,joinGroupCall:()=>fo,joinGroupCallPresentation:()=>ho,leaveChannel:()=>qo,leaveChatlist:()=>Ur,leaveGroupCall:()=>po,leaveGroupCallPresentation:()=>_o,loadAttachBot:()=>zi,loadAttachBots:()=>Ki,loadPollOptionResults:()=>yc,markMessageListRead:()=>dc,markMessagesRead:()=>uc,markStoryRead:()=>Gl,migrateChat:()=>lr,openChatByInvite:()=>pr,pinMessage:()=>nc,prolongWebView:()=>ji,provideAuthCode:()=>ua,provideAuthPassword:()=>la,provideAuthPhoneNumber:()=>da,provideAuthRegistration:()=>pa,provideRecoveryEmailCode:()=>ju,readAllMentions:()=>Ec,readAllReactions:()=>Bc,receivedCall:()=>vo,registerDevice:()=>wu,removeRecentSticker:()=>ud,reorderUsernames:()=>Uu,repairFileReference:()=>ki,reportMessages:()=>rc,reportPeer:()=>Hr,reportProfilePhoto:()=>qr,reportSpam:()=>Yc,reportStory:()=>$l,requestAppWebView:()=>Gi,requestBotUrlAuth:()=>Ji,requestCall:()=>wo,requestChannelDifference:()=>Bi,requestChatUpdate:()=>Eo,requestLinkUrlAuth:()=>Xi,requestPhoneCall:()=>Vl,requestSimpleWebView:()=>Oi,requestThreadInfoUpdate:()=>pc,requestWebView:()=>qi,rescheduleMessage:()=>ec,restartAuth:()=>fa,restartAuthWithQr:()=>ga,saveCloseFriends:()=>td,saveDefaultSendAs:()=>kc,saveDraft:()=>Bo,saveGif:()=>vd,searchChats:()=>Ro,searchGifs:()=>Cd,searchMessagesGlobal:()=>gc,searchMessagesLocal:()=>fc,searchStickers:()=>wd,sendEmojiInteraction:()=>il,sendInlineBotResult:()=>Ni,sendMessage:()=>Xr,sendMessageAction:()=>cc,sendPaymentForm:()=>Yu,sendPollVote:()=>mc,sendReaction:()=>rl,sendScheduledMessages:()=>Ac,sendSignalingData:()=>Co,sendStoryReaction:()=>Yl,sendWatchingEmojiInteraction:()=>al,sendWebViewData:()=>Wi,setAllowHttpTransport:()=>Ti,setCallRating:()=>So,setChatEnabledReactions:()=>wr,setChatUsername:()=>Bd,setDefaultReaction:()=>ul,setDiscussionGroup:()=>ur,setForceHttpTransport:()=>Ri,setPrivacySettings:()=>vu,setShouldDebugExportedSenders:()=>Ei,sortChatFolders:()=>Qo,startBot:()=>Hi,terminateAllAuthorizations:()=>cu,terminateAllWebAuthorizations:()=>lu,terminateAuthorization:()=>ru,terminateWebAuthorization:()=>uu,toggleAttachBot:()=>$i,toggleChatArchived:()=>Wo,toggleChatPinned:()=>jo,toggleDialogUnread:()=>Xo,toggleForum:()=>Ar,toggleGroupCallStartSubscription:()=>mo,toggleIsProtected:()=>Sr,toggleJoinRequest:()=>mr,toggleJoinToSend:()=>hr,toggleParticipantsHidden:()=>vr,togglePeerTranslations:()=>Nr,togglePinnedTopic:()=>kr,togglePreHistoryHidden:()=>tr,toggleSignatures:()=>rr,toggleStoriesHidden:()=>Ql,toggleStoryPinned:()=>Wl,toggleUsername:()=>Bu,transcribeAudio:()=>xc,translateText:()=>Vc,unblockUser:()=>iu,uninstallStickerSet:()=>Id,unpinAllMessages:()=>sc,unregisterDevice:()=>Su,updateChatAbout:()=>or,updateChatAdmin:()=>ar,updateChatDefaultBannedRights:()=>nr,updateChatMemberBannedRights:()=>sr,updateChatMutedState:()=>Do,updateChatTitle:()=>ir,updateContact:()=>Qc,updateContactSignUpNotification:()=>gu,updateContentSettings:()=>Cu,updateEmojiStatus:()=>ed,updateGlobalPrivacySettings:()=>Eu,updateIsOnline:()=>Au,updateNotificationSettings:()=>hu,updatePassword:()=>Lu,updatePrivateLink:()=>Dd,updateProfile:()=>$d,updateProfilePhoto:()=>Xd,updateRecoveryEmail:()=>Gu,updateTopicMutedState:()=>xo,updateUsername:()=>Qd,uploadContactProfilePhoto:()=>Yd,uploadProfilePhoto:()=>Zd,uploadWallpaper:()=>nu,validateRequestedInfo:()=>Zu,viewSponsoredMessage:()=>Tc,viewStory:()=>Ll});const i="A",o=!1,r=!1,c=!1,d="https://telegram-a-host",u=!1,l="tt-media",p="tt-media-avatars",f=524288,g=16,h=16,m=("undefined"!=typeof window&&window.innerHeight,200),_=50,y=100,b=40,w=100,S=100,v=100,A=100,I=50,C=100,P=100,M=100,k=20,R=3e5,T=2**31-1,E=Math.round(450),B=new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory"]),U=20,D=20,x="status-default-icon",V="video/webm",F="image/gif",N=new Set(["image/png","image/jpeg",F]),H=new Set(["video/mp4","video/quicktime"]),q=new Set(["audio/mp3","audio/ogg","audio/wav","audio/mpeg","audio/flac","audio/aac","audio/m4a","audio/mp4","audio/x-m4a"]),O=(new Set([...N,...H]),new Set(["t.me","web.t.me","a.t.me","k.t.me","z.t.me"]),"weba"),L=(new Set(["AU","BD","CA","CO","EG","HN","IE","IN","JO","MX","MY","NI","NZ","PH","PK","SA","SV","US"]),"777000"),G=14,j="gif",W=0,K=1,z="-100777",$="android",J=1,Q=86400,X=86400,Z={uploadMaxFileparts:[4e3,8e3],stickersFaved:[5,10],savedGifs:[200,400],dialogFiltersChats:[100,200],dialogFilters:[10,20],dialogFolderPinned:[5,10],captionLength:[1024,2048],channels:[500,1e3],channelsPublic:[10,20],aboutLength:[70,140],chatlistInvites:[3,100],chatlistJoined:[2,20]},Y=["log","error","warn","info","debug"];function ee(e,t){let n,s,a,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(){s=!0;for(var o=arguments.length,r=new Array(o),c=0;c<o;c++)r[c]=arguments[c];a=r,n||(i&&(s=!1,e(...a)),n=self.setInterval((()=>{if(!s)return self.clearInterval(n),void(n=void 0);s=!1,e(...a)}),t))}}function te(e){return function(e,t){let n,s=!1;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];n=i,s||(s=!0,e((()=>{s=!1,t(...n)})))}}(ae,e)}Y.reduce(((e,t)=>(e[t]=console[t],e)),{});const ne=e=>new Promise((t=>{setTimeout((()=>t()),e)}));let se;function ae(e){se?se.push(e):(se=[e],Promise.resolve().then((()=>{const e=se;se=void 0,e.forEach((e=>e()))})))}var ie=n(13522);function oe(e){return e.hasOwnProperty("userId")}function re(e){return e.hasOwnProperty("chatId")}function ce(e,t){return"user"===t?e.toString():"channel"===t?`-100${e}`:`-${e}`}function de(e){return oe(e)?ce(e.userId,"user"):re(e)?ce(e.chatId,"chat"):ce(e.channelId,"channel")}var ue=n(24736),le=n.n(ue),pe=n(57404);function fe(e){return`${arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"":`data:${arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/jpeg"};base64,`}${btoa(String.fromCharCode(...e))}`}function ge(e){const{flags:t,CONSTRUCTOR_ID:n,SUBCLASS_OF_ID:s,className:a,classType:i,getBytes:o,...r}=e;return r}var he=n(48764).lW;const me="BroadcastChannel"in self,_e=me?new BroadcastChannel("tt-global"):void 0;let ye=[];const be=ee((()=>{_e.postMessage({type:"localDbUpdate",batchedUpdates:ye}),ye=[]}),100);function we(e){if(e instanceof Uint8Array)return he.from(e);if("object"==typeof e&&1===Object.keys(e).length&&"value"===Object.keys(e)[0])return le()(e.value);if(Array.isArray(e))return e.map(we);if("object"!=typeof e||!("CONSTRUCTOR_ID"in e))return e;const t=e.className.split(".").reduce(((e,t)=>e[t]),pe.constructors),n=ge(e);return new t(Object.keys(n).reduce(((e,t)=>(e[t]=we(n[t]),e)),{}))}function Se(e){return["localMessages","chats","users","messages","documents","stickerSets","photos","webDocuments","stories","commonBoxState","channelPtsById"].reduce(((t,n)=>{const s=e?.[n]??{},a=Object.keys(s).reduce(((e,t)=>{if("commonBoxState"===n||"channelPtsById"===n){const n=s;return e[t]=n[t],e}return e[t]=we(s[t]),e}),{});var i;return t[n]=me?(i=n,new Proxy(a,{get:(e,t,n)=>Reflect.get(e,t,n),set:(e,t,n)=>(ye.push({name:i,prop:t,value:n}),be(),Reflect.set(e,t,n))})):a,t}),{})}const ve=Se(),Ae=ve;function Ie(){_e&&_e.postMessage({type:"localDbUpdateFull",localDb:Object.keys(ve).reduce(((e,t)=>(e[t]={...ve[t]},e)),{})})}var Ce=n(48764).lW;const Pe="#111111DD",Me="#E4D00A",ke={INVOKE:"#49DBF5",BEACON:"#F549DB",RESPONSE:"#6887F7",CONNECTING:"#E4D00A",CONNECTED:"#26D907","CONNECTING ERROR":"#D1191C","INVOKE ERROR":"#D1191C",UPDATE:"#0DD151","UNEXPECTED UPDATE":"#9C9C9C","UNEXPECTED RESPONSE":"#D1191C"};function Re(e){if(e instanceof ie.Api.Message||e instanceof ie.Api.MessageService)return de(e.peerId)}function Te(e){return e instanceof ie.Api.DialogFilter||e instanceof ie.Api.DialogFilterChatlist}function Ee(e){const t=`${Re(e)}-${e.id}`;let n=e;e instanceof ie.Api.Message&&e.media instanceof ie.Api.MessageMediaInvoice&&e.media.extendedMedia instanceof ie.Api.MessageExtendedMedia&&(n=new ie.Api.Message({...e,media:e.media.extendedMedia.media})),Ae.messages[t]=n,n instanceof ie.Api.Message&&(n.media instanceof ie.Api.MessageMediaDocument&&n.media.document instanceof ie.Api.Document&&(Ae.documents[String(n.media.document.id)]=n.media.document),n.media instanceof ie.Api.MessageMediaWebPage&&n.media.webpage instanceof ie.Api.WebPage&&n.media.webpage.document instanceof ie.Api.Document&&(Ae.documents[String(n.media.webpage.document.id)]=n.media.webpage.document),n.media instanceof ie.Api.MessageMediaGame&&(n.media.game.document instanceof ie.Api.Document&&(Ae.documents[String(n.media.game.document.id)]=n.media.game.document),Ue(n.media.game.photo)),n.media instanceof ie.Api.MessageMediaInvoice&&n.media.photo&&(Ae.webDocuments[String(n.media.photo.url)]=n.media.photo)),n instanceof ie.Api.MessageService&&"photo"in n.action&&Ue(n.action.photo)}function Be(e,t){if(!(e instanceof ie.Api.StoryItem))return;const n={id:e.id,peerId:t};if(e.media instanceof ie.Api.MessageMediaPhoto){const t=e.media.photo;t.storyData=n,Ue(t)}if(e.media instanceof ie.Api.MessageMediaDocument){if(e.media.document instanceof ie.Api.Document){const t=e.media.document;t.storyData=n,Ae.documents[String(e.media.document.id)]=t}if(e.media.altDocument instanceof ie.Api.Document){const t=e.media.altDocument;t.storyData=n,Ae.documents[String(e.media.altDocument.id)]=t}}}function Ue(e){e instanceof ie.Api.Photo&&(Ae.photos[String(e.id)]=e)}function De(e){const t=ce(e.id,"user"),n=Ae.users[t];n&&!n.min&&e.min||(Ae.users[t]=e)}function xe(e){e.forEach((e=>{e instanceof ie.Api.User?De(e):(e instanceof ie.Api.Chat||e instanceof ie.Api.Channel)&&function(e){const t=ce(e.id,e instanceof ie.Api.Chat?"chat":"channel"),n=Ae.chats[t],s=n&&"min"in n&&n.min,a="min"in e&&e.min;n&&!s&&a||(Ae.chats[t]=e)}(e)}))}function Ve(e){return String.fromCharCode(...e)}function Fe(e){return Ce.from(e,"binary")}function Ne(e){const t="UNEXPECTED RESPONSE"===e?console.error:"INVOKE ERROR"===e||"UNEXPECTED UPDATE"===e?console.warn:console.log;for(var n=arguments.length,s=new Array(n>1?n-1:0),a=1;a<n;a++)s[a-1]=arguments[a];t(`%cGramJS%c${e}`,`color: ${Me}; background: ${Pe}; padding: 0.25rem; border-radius: 0.25rem;`,`color: ${ke[e]}; background: ${Pe}; padding: 0.25rem; border-radius: 0.25rem; margin-left: 0.25rem;`,...s)}function He(e,t){return e.reduce(((e,n)=>(e[n[t]]=n,e)),{})}function qe(e,t){return e.reduce(((e,n)=>{const[s,a]=t(n);return e[s]=a,e}),{})}function Oe(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function Le(e,t){return t.reduce(((t,n)=>(e[n]&&(t[n]=e[n]),t)),{})}function Ge(e,t){const n=new Set(t.map(String));return Oe(e,Object.keys(e).filter((e=>!n.has(e))))}function je(e){return e.filter(Boolean)}let We=0;function Ke(){return We}function ze(){return Math.floor(Date.now()/1e3)+We}var $e=n(48960);let Je=function(e){return e.Bold="MessageEntityBold",e.Blockquote="MessageEntityBlockquote",e.BotCommand="MessageEntityBotCommand",e.Cashtag="MessageEntityCashtag",e.Code="MessageEntityCode",e.Email="MessageEntityEmail",e.Hashtag="MessageEntityHashtag",e.Italic="MessageEntityItalic",e.MentionName="MessageEntityMentionName",e.Mention="MessageEntityMention",e.Phone="MessageEntityPhone",e.Pre="MessageEntityPre",e.Strike="MessageEntityStrike",e.TextUrl="MessageEntityTextUrl",e.Url="MessageEntityUrl",e.Underline="MessageEntityUnderline",e.Spoiler="MessageEntitySpoiler",e.CustomEmoji="MessageEntityCustomEmoji",e.Unknown="MessageEntityUnknown",e}({});const Qe=-1,Xe="MESSAGE_DELETED";let Ze=function(e){return e[e.BlobUrl=0]="BlobUrl",e[e.Progressive=1]="Progressive",e[e.DownloadUrl=2]="DownloadUrl",e[e.Text=3]="Text",e}({});const Ye='<?xml version="1.0" encoding="utf-8"?><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 {{width}} {{height}}" xml:space="preserve"><path fill-opacity="0.1" d="{{path}}" /></svg>',et="AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,";const tt={w:100,h:100};function nt(e,t){if(!e||!e.length)return;const n=e.find((e=>e instanceof ie.Api.PhotoStrippedSize));if(!n)return;const s=e.filter((e=>e instanceof ie.Api.PhotoSize)),{w:a,h:i}=s.length?s[s.length-1]:tt,{bytes:o}=n;return{dataUri:fe(t&&"image/jpeg"!==t?o:(0,$e.strippedPhotoToJpg)(o),void 0,t),width:a,height:i}}function st(e,t){const{w:n,h:s}=t;return{dataUri:`data:image/svg+xml;utf8,${a=e.bytes,i=n,o=s,Ye.replace("{{path}}",function(e){let t="M";const n=e.length;for(let s=0;s<n;s++){const n=e[s];n>=192?t+=et[n-128-64]:(n>=128?t+=",":n>=64&&(t+="-"),t+=String(63&n))}return t+="z",t}(a)).replace("{{width}}",String(i)).replace("{{height}}",String(o))}`,width:n,height:s};var a,i,o}function at(e,t){const n=e.sizes.filter((e=>e instanceof ie.Api.PhotoSize||e instanceof ie.Api.PhotoSizeProgressive)).map(ot);return{id:String(e.id),thumbnail:nt(e.sizes),sizes:n,isSpoiler:t,...e.videoSizes&&{videoSizes:je(e.videoSizes.map(it)),isVideo:!0}}}function it(e){if(!(e instanceof ie.Api.VideoSize))return;const{videoStartTs:t,size:n,h:s,w:a,type:i}=e;return{videoStartTs:t,size:n,height:s,width:a,type:i}}function ot(e){const{w:t,h:n,type:s}=e;return{width:t,height:n,type:s}}function rt(e){if(!(e.usernames||"username"in e&&e.username))return;const t=[];return"username"in e&&e.username&&t.push({username:e.username,isActive:!0,isEditable:!0}),e.usernames&&e.usernames.forEach((e=>{let{username:n,active:s,editable:a}=e;t.push({username:n,...s&&{isActive:!0},...a&&{isEditable:!0}})})),t}function ct(e){let t,n,s,a,i,o;const r=Ae.chats;return e.forEach((e=>{e instanceof ie.Api.PrivacyValueAllowAll?t||(t="everybody"):e instanceof ie.Api.PrivacyValueAllowContacts?t||(t="contacts"):e instanceof ie.Api.PrivacyValueAllowCloseFriends?t||(t="closeFriends"):e instanceof ie.Api.PrivacyValueDisallowContacts?t||(t="nonContacts"):e instanceof ie.Api.PrivacyValueDisallowAll?t||(t="nobody"):e instanceof ie.Api.PrivacyValueAllowUsers?s=e.users.map((e=>ce(e,"user"))):e instanceof ie.Api.PrivacyValueDisallowUsers?i=e.users.map((e=>ce(e,"user"))):e instanceof ie.Api.PrivacyValueAllowChatParticipants?a=e.chats.map((e=>{const t=ce(e,"chat"),n=ce(e,"channel");return r[t]?t:n})):e instanceof ie.Api.PrivacyValueDisallowChatParticipants&&(o=e.chats.map((e=>{const t=ce(e,"chat"),n=ce(e,"channel");return r[t]?t:n})))})),t||(t="nobody",n=!0),{visibility:t,isUnspecified:n,allowUserIds:s||[],allowChatIds:a||[],blockUserIds:i||[],blockChatIds:o||[]}}function dt(e){const{className:t,offset:n,length:s}=e;return e instanceof ie.Api.MessageEntityMentionName?{type:Je.MentionName,offset:n,length:s,userId:ce(e.userId,"user")}:e instanceof ie.Api.MessageEntityTextUrl?{type:Je.TextUrl,offset:n,length:s,url:e.url}:e instanceof ie.Api.MessageEntityPre?{type:Je.Pre,offset:n,length:s,language:e.language}:e instanceof ie.Api.MessageEntityCustomEmoji?{type:Je.CustomEmoji,offset:n,length:s,documentId:e.documentId.toString()}:{type:t,offset:n,length:s}}const ut="application/x-tgsticker",lt="video/webm";function pt(e,t){if(e instanceof ie.Api.DocumentEmpty)return;const{mimeType:n,videoThumbs:s}=e,a=e.attributes.find((e=>e instanceof ie.Api.DocumentAttributeSticker)),i=e.attributes.find((e=>e instanceof ie.Api.DocumentAttributeCustomEmoji)),o=(n===ut||n===lt)&&e.attributes.find((e=>e instanceof ie.Api.DocumentAttributeFilename));if(!a&&!i&&!o)return;const r=n===ut,c=n===lt,d=Boolean(i),u=d&&i.textColor,l=e.attributes.find((e=>e instanceof ie.Api.DocumentAttributeImageSize)),p=e.attributes.find((e=>e instanceof ie.Api.DocumentAttributeVideo)),f=l||p,g=a||i,h=(b=g?.stickerset,b instanceof ie.Api.InputStickerSetID?{id:String(b.id),accessHash:String(b.accessHash)}:b instanceof ie.Api.InputStickerSetShortName?{shortName:b.shortName}:{isMissing:!0}),m=g?.alt,_=Boolean(i?.free??!0),y=e.thumbs&&e.thumbs.find((e=>e instanceof ie.Api.PhotoCachedSize));var b;if(!(n!==lt||self.isWebmSupported||y||e.thumbs&&e.thumbs.find((e=>e instanceof ie.Api.PhotoSize))))return;const w=e.thumbs&&e.thumbs.find((e=>e instanceof ie.Api.PhotoPathSize)),S=y?function(e){const{w:t,h:n,bytes:s}=e;return{dataUri:fe(s,void 0,"image/webp"),width:t,height:n}}(y):w&&f?st(w,f):void 0,{w:v,h:A}=y||f||{},I=!t&&s&&je(s?.filter((e=>e instanceof ie.Api.VideoSize))).some((e=>{let{type:t}=e;return"f"===t}));return{id:String(e.id),stickerSetInfo:h,emoji:m,isCustomEmoji:d,isLottie:r,isVideo:c,width:v,height:A,thumbnail:S,hasEffect:I,isFree:_,shouldUseTextColor:u}}function ft(e){const{archived:t,animated:n,installedDate:s,videos:a,id:i,accessHash:o,title:r,thumbs:c,count:d,shortName:u,emojis:l,thumbDocumentId:p}=e;return{isArchived:t,isLottie:n,isVideos:a,isEmoji:l,installedDate:s,id:String(i),accessHash:String(o),title:r,hasThumbnail:Boolean(c?.length||p),thumbCustomEmojiId:p?.toString(),count:d,shortName:u}}function gt(e){const t=ft(e.set);if(e instanceof ie.Api.StickerSetNoCovered)return t;const n=mt(e instanceof ie.Api.StickerSetCovered?[e.cover]:e instanceof ie.Api.StickerSetMultiCovered?e.covers:e.documents);return e instanceof ie.Api.StickerSetFullCovered?{...t,stickers:n,packs:ht(e.packs)}:{...t,covers:n}}function ht(e){return e.reduce(((e,t)=>{let{emoticon:n,documents:s}=t;return e[n]=s.map((e=>pt(Ae.documents[String(e)]))).filter(Boolean),e}),{})}function mt(e){return e.map((e=>{if(e instanceof ie.Api.Document){const t=pt(e);if(t)return Ae.documents[String(e.id)]=e,t}})).filter(Boolean)}function _t(e){let t={};e.media&&(t={...bt(e.media)});const n=e.media instanceof ie.Api.MessageMediaUnsupported;return!e.message||n||t.sticker||t.poll||t.contact||t.video?.isRound||(t={...t,text:yt(e.message,e.entities)}),t}function yt(e,t){return{text:e,...t&&{entities:t.map(dt)}}}function bt(e){if("ttlSeconds"in e&&e.ttlSeconds)return;if("extendedMedia"in e&&e.extendedMedia instanceof ie.Api.MessageExtendedMedia)return bt(e.extendedMedia.media);const t=function(e){if(e instanceof ie.Api.MessageMediaDocument&&e.document&&e.document instanceof ie.Api.Document)return pt(e.document,e.nopremium)}(e);if(t)return{sticker:t};const n=function(e){if(e instanceof ie.Api.MessageMediaPhoto&&e.photo&&e.photo instanceof ie.Api.Photo)return at(e.photo,e.spoiler)}(e);if(n)return{photo:n};const s=function(e){if(e instanceof ie.Api.MessageMediaDocument&&e.document instanceof ie.Api.Document&&e.document.mimeType.startsWith("video"))return wt(e.document,e.spoiler)}(e),a=function(e){if(e instanceof ie.Api.MessageMediaDocument&&e.altDocument instanceof ie.Api.Document&&e.altDocument.mimeType.startsWith("video"))return wt(e.altDocument,e.spoiler)}(e);if(s)return{video:s,altVideo:a};const i=function(e){if(!(e instanceof ie.Api.MessageMediaDocument&&e.document&&e.document instanceof ie.Api.Document))return;const t=e.document.attributes.find((e=>e instanceof ie.Api.DocumentAttributeAudio));if(!t||t.voice)return;const n=e.document.thumbs&&e.document.thumbs.filter((e=>e instanceof ie.Api.PhotoSize)).map((e=>ot(e)));return{id:String(e.document.id),fileName:Pt(e.document,"audio"),thumbnailSizes:n,size:e.document.size.toJSNumber(),...Oe(e.document,["mimeType"]),...Oe(t,["duration","performer","title"])}}(e);if(i)return{audio:i};const o=function(e){if(!(e instanceof ie.Api.MessageMediaDocument&&e.document&&e.document instanceof ie.Api.Document))return;const t=e.document.attributes.find((e=>e instanceof ie.Api.DocumentAttributeAudio));if(!t||!t.voice)return;const{duration:n,waveform:s}=t;return{id:String(e.document.id),duration:n,waveform:s?Array.from(s):void 0}}(e);if(o)return{voice:o};const r=function(e){if(e instanceof ie.Api.MessageMediaDocument&&e.document)return St(e.document)}(e);if(r)return{document:r};const c=function(e){if(!(e instanceof ie.Api.MessageMediaContact))return;const{firstName:t,lastName:n,phoneNumber:s,userId:a}=e;return{firstName:t,lastName:n,phoneNumber:s,userId:ce(a,"user")}}(e);if(c)return{contact:c};const d=function(e){if(e instanceof ie.Api.MessageMediaPoll)return At(e.poll,e.results)}(e);if(d)return{poll:d};const u=Ct(e);if(u)return{webPage:u};const l=function(e){if(e instanceof ie.Api.MessageMediaInvoice)return function(e){const{description:t,title:n,photo:s,test:a,totalAmount:i,currency:o,receiptMsgId:r,extendedMedia:c}=e,d=c instanceof ie.Api.MessageExtendedMediaPreview?Mt(c):void 0;return{title:n,text:t,photo:kt(s),receiptMsgId:r,amount:Number(i),currency:o,isTest:a,extendedMedia:d}}(e)}(e);if(l)return{invoice:l};const p=function(e){return e instanceof ie.Api.MessageMediaGeo?function(e){const t=vt(e.geo);return t&&{type:"geo",geo:t}}(e):e instanceof ie.Api.MessageMediaVenue?function(e){const{geo:t,title:n,provider:s,address:a,venueId:i,venueType:o}=e,r=vt(t);return r&&{type:"venue",geo:r,title:n,provider:s,address:a,venueId:i,venueType:o}}(e):e instanceof ie.Api.MessageMediaGeoLive?function(e){const{geo:t,period:n,heading:s}=e,a=vt(t);return a&&{type:"geoLive",geo:a,period:n,heading:s}}(e):void 0}(e);if(p)return{location:p};const f=function(e){if(e instanceof ie.Api.MessageMediaGame)return function(e){const{id:t,accessHash:n,shortName:s,title:a,description:i,photo:o,document:r}=e.game,c=o instanceof ie.Api.Photo?at(o):void 0,d=r instanceof ie.Api.Document?St(r):void 0;return{id:t.toString(),accessHash:n.toString(),shortName:s,title:a,description:i,photo:c,document:d}}(e)}(e);if(f)return{game:f};const g=function(e){if(!(e instanceof ie.Api.MessageMediaStory))return;const t=de(e.peer);return{id:e.id,peerId:t,...e.viaMention&&{isMention:!0}}}(e);return g?{storyData:g}:void 0}function wt(e,t){if(e instanceof ie.Api.DocumentEmpty)return;const{id:n,mimeType:s,thumbs:a,size:i,attributes:o}=e;if(s===V&&!self.isWebmSupported)return;const r=o.find((e=>e instanceof ie.Api.DocumentAttributeVideo));if(!r)return;const c=o.find((e=>e instanceof ie.Api.DocumentAttributeAnimated)),{duration:d,w:u,h:l,supportsStreaming:p=!1,roundMessage:f=!1,nosound:g}=r;return{id:String(n),mimeType:s,duration:d,fileName:Pt(e,"video"),width:u,height:l,supportsStreaming:p,isRound:f,isGif:Boolean(c),thumbnail:nt(a),size:i.toJSNumber(),isSpoiler:t,...g&&{noSound:!0}}}function St(e){if(!(e instanceof ie.Api.Document))return;const{id:t,size:n,mimeType:s,date:a,thumbs:i,attributes:o}=e,r=i&&i.find((e=>e instanceof ie.Api.PhotoSize));let c,d,u=i&&nt(i);if(!u&&i&&r){const e=i.find((e=>e instanceof ie.Api.PhotoPathSize));e&&(u=st(e,r))}if(r)if(d={width:r.w,height:r.h},N.has(s)){c="photo";const e=o.find((e=>e instanceof ie.Api.DocumentAttributeImageSize));if(e){const{w:t,h:n}=e;d={width:t,height:n}}}else if(H.has(s)){c="video";const e=o.find((e=>e instanceof ie.Api.DocumentAttributeVideo));if(e){const{w:t,h:n}=e;d={width:t,height:n}}}return{id:String(t),size:n.toJSNumber(),mimeType:s,timestamp:a,fileName:Pt(e),thumbnail:u,mediaType:c,mediaSize:d}}function vt(e){if(e instanceof ie.Api.GeoPointEmpty)return;const{long:t,lat:n,accuracyRadius:s,accessHash:a}=e;return{long:t,lat:n,accessHash:a.toString(),accuracyRadius:s}}function At(e,t){const{id:n,answers:s}=e,a=s.map((e=>({text:e.text,option:Ve(e.option)})));return{id:String(n),summary:{isPublic:e.publicVoters,...Oe(e,["closed","multipleChoice","quiz","question","closePeriod","closeDate"]),answers:a},results:It(t)}}function It(e){const{results:t,totalVoters:n,recentVoters:s,solution:a,solutionEntities:i,min:o}=e,r=t?.map((e=>{let{option:t,chosen:n,correct:s,voters:a}=e;return{isChosen:n,isCorrect:s,option:Ve(t),votersCount:a}}));return{isMin:o,totalVoters:n,recentVoterIds:s?.map((e=>de(e))),results:r,solution:a,...i&&{solutionEntities:i.map(dt)}}}function Ct(e){if(!(e instanceof ie.Api.MessageMediaWebPage&&e.webpage instanceof ie.Api.WebPage))return;const{id:t,photo:n,document:s,attributes:a}=e.webpage;let i,o;s instanceof ie.Api.Document&&s.mimeType.startsWith("video/")&&(i=wt(s));const r=a?.find((e=>e instanceof ie.Api.WebPageAttributeStory));if(r){const e=de(r.peer);o={id:r.id,peerId:e},r.story instanceof ie.Api.StoryItem&&Be(r.story,e)}return{id:Number(t),...Oe(e.webpage,["url","displayUrl","type","siteName","title","description","duration"]),photo:n instanceof ie.Api.Photo?at(n):void 0,document:!i&&s?St(s):void 0,video:i,story:o}}function Pt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file";const{mimeType:n,attributes:s}=e,a=s.find((e=>e instanceof ie.Api.DocumentAttributeFilename));if(a)return a.fileName;const i=n.split("/")[1];return`${t}${String(e.id)}.${i}`}function Mt(e){const{w:t,h:n,thumb:s,videoDuration:a}=e;return{width:t,height:n,duration:a,thumbnail:s?nt([s]):void 0}}function kt(e){if(!e)return;const{url:t,size:n,mimeType:s}=e,a=e instanceof ie.Api.WebDocument?e.accessHash.toString():void 0,i=e.attributes.find((e=>e instanceof ie.Api.DocumentAttributeImageSize));return{url:t,accessHash:a,size:n,mimeType:s,dimensions:i&&{width:i.w,height:i.h}}}function Rt(e){return{id:e.botId.toString(),hasSettings:e.hasSettings,shouldRequestWriteAccess:e.requestWriteAccess,shortName:e.shortName,isForAttachMenu:e.showInAttachMenu,isForSideMenu:e.showInSideMenu,attachMenuPeerTypes:e.peerTypes?.map(Tt),icons:e.icons.map(Et).filter(Boolean),isInactive:e.inactive,isDisclaimerNeeded:e.sideMenuDisclaimerNeeded}}function Tt(e){return e instanceof ie.Api.AttachMenuPeerTypeBotPM?"bots":e instanceof ie.Api.AttachMenuPeerTypePM?"users":e instanceof ie.Api.AttachMenuPeerTypeChat?"chats":e instanceof ie.Api.AttachMenuPeerTypeBroadcast?"channels":e instanceof ie.Api.AttachMenuPeerTypeSameBotPM?"self":void 0}function Et(e){if(!(e.icon instanceof ie.Api.Document))return;const t=St(e.icon);return t?(Ae.documents[String(e.icon.id)]=e.icon,{name:e.name,document:t}):void 0}function Bt(e,t){const{description:n,descriptionPhoto:s,descriptionDocument:a,userId:i,commands:o,menuButton:r}=e,c=i&&ce(i,"user"),d=s instanceof ie.Api.Photo?at(s):void 0,u=a instanceof ie.Api.Document?wt(a):void 0,l=o?.map((e=>function(e,t){return{botId:e,...ge(t)}}(c||t,e)));return{botId:c||t,description:n,gif:u,photo:d,menuButton:Ut(r),commands:l?.length?l:void 0}}function Ut(e){return e instanceof ie.Api.BotMenuButton?{type:"webApp",text:e.text,url:e.url}:{type:"commands"}}function Dt(e){const{self:t,min:n,about:s,date:a,versioned:i,canSelfUnmute:o,justJoined:r,left:c,muted:d,mutedByYou:u,source:l,volume:p,volumeByAdmin:f,videoJoined:g,peer:h,video:m,presentation:_,raiseHandRating:y}=e;return{isSelf:t,isMin:n,canSelfUnmute:o,isLeft:c,isMuted:d,isMutedByMe:u,hasJustJoined:r,isVolumeByAdmin:f,isVersioned:i,isVideoJoined:g,about:s,source:l,raiseHandRating:y?.toString(),volume:p,date:new Date(a),isUser:oe(h),id:de(h),video:m?xt(m):void 0,presentation:_?xt(_):void 0}}function xt(e){const{audioSource:t,endpoint:n,paused:s,sourceGroups:a}=e;return{audioSource:t,endpoint:n,isPaused:s,sourceGroups:a.map(Vt)}}function Vt(e){return{semantics:e.semantics,sources:e.sources}}function Ft(e){const{id:t,accessHash:n}=e;if(e instanceof ie.Api.GroupCallDiscarded)return{connectionState:"discarded",id:t.toString(),accessHash:n.toString(),participantsCount:0,version:0,participants:{}};const{version:s,participantsCount:a,streamDcId:i,scheduleDate:o,canChangeJoinMuted:r,joinMuted:c,canStartVideo:d,scheduleStartSubscribed:u}=e;return{connectionState:"disconnected",isLoaded:!0,id:t.toString(),accessHash:n.toString(),version:s,participantsCount:a,streamDcId:i,scheduleDate:o,canChangeJoinMuted:r,joinMuted:c,canStartVideo:d,scheduleStartSubscribed:u,participants:{}}}function Nt(e){const{id:t}=e;let n={id:t.toString()};if(e instanceof ie.Api.PhoneCallAccepted||e instanceof ie.Api.PhoneCallWaiting||e instanceof ie.Api.PhoneCall||e instanceof ie.Api.PhoneCallRequested){const{accessHash:t,adminId:s,date:a,video:i,participantId:o,protocol:r}=e;n={...n,accessHash:t.toString(),adminId:s.toString(),participantId:o.toString(),date:a,isVideo:i,protocol:Ot(r)}}if(e instanceof ie.Api.PhoneCall){const{p2pAllowed:t,gAOrB:s,keyFingerprint:a,connections:i,startDate:o}=e;n={...n,state:"active",gAOrB:Array.from(s),keyFingerprint:a.toString(),startDate:o,isP2pAllowed:Boolean(t),connections:i.map(qt).filter(Boolean)}}return e instanceof ie.Api.PhoneCallDiscarded&&(n={...n,state:"discarded",duration:e.duration,reason:Ht(e.reason),needRating:e.needRating,needDebug:e.needDebug}),e instanceof ie.Api.PhoneCallWaiting&&(n={...n,state:"waiting",receiveDate:e.receiveDate}),e instanceof ie.Api.PhoneCallAccepted&&(n={...n,state:"accepted",gB:Array.from(e.gB)}),e instanceof ie.Api.PhoneCallRequested&&(n={...n,state:"requested",gAHash:Array.from(e.gAHash)}),n}function Ht(e){return e instanceof ie.Api.PhoneCallDiscardReasonMissed?"missed":e instanceof ie.Api.PhoneCallDiscardReasonBusy?"busy":e instanceof ie.Api.PhoneCallDiscardReasonHangup?"hangup":"disconnect"}function qt(e){if(e instanceof ie.Api.PhoneConnectionWebrtc){const{username:t,password:n,turn:s,stun:a,ip:i,ipv6:o,port:r}=e;return{username:t,password:n,isTurn:s,isStun:a,ip:i,ipv6:o,port:r}}}function Ot(e){const{libraryVersions:t,minLayer:n,maxLayer:s,udpP2p:a,udpReflector:i}=e;return{libraryVersions:t,minLayer:n,maxLayer:s,isUdpP2p:a,isUdpReflector:i}}function Lt(){return new ie.Api.PhoneCallProtocol({libraryVersions:["4.0.0"],minLayer:92,maxLayer:92,udpReflector:!0,udpP2p:!0})}function Gt(e){const{recentReactions:t,results:n,canSeeList:s}=e;return{canSeeList:s,results:n.map(Wt).filter(Boolean).sort(jt),recentReactions:t?.map(Kt).filter(Boolean)}}function jt(e,t){return t.count-e.count||(void 0!==e.chosenOrder&&void 0!==t.chosenOrder?e.chosenOrder-t.chosenOrder:void 0!==e.chosenOrder?1:void 0!==t.chosenOrder?-1:0)}function Wt(e){const{chosenOrder:t,count:n,reaction:s}=e,a=zt(s);if(a)return{chosenOrder:t,count:n,reaction:a}}function Kt(e){const{peerId:t,reaction:n,big:s,unread:a,date:i,my:o}=e,r=zt(n);if(r)return{peerId:de(t),reaction:r,addedDate:i,isUnread:a,isBig:s,isOwn:o}}function zt(e){return e instanceof ie.Api.ReactionEmoji?{emoticon:e.emoticon}:e instanceof ie.Api.ReactionCustomEmoji?{documentId:e.documentId.toString()}:void 0}function $t(e){const{selectAnimation:t,staticIcon:n,reaction:s,title:a,appearAnimation:i,inactive:o,aroundAnimation:r,centerIcon:c,effectAnimation:d,activateAnimation:u,premium:l}=e;return{selectAnimation:St(t),appearAnimation:St(i),activateAnimation:St(u),effectAnimation:St(d),staticIcon:St(n),aroundAnimation:r?St(r):void 0,centerIcon:c?St(c):void 0,reaction:{emoticon:s},title:a,isInactive:o,isPremium:l}}function Jt(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Boolean("min"in e&&e.min),s="accessHash"in e&&String(e.accessHash),a="photo"in e&&e.photo&&"hasVideo"in e.photo&&e.photo.hasVideo,i="photo"in e&&e.photo&&on(e.photo),o=Boolean("signatures"in e&&e.signatures),r=Boolean("hasLink"in e&&e.hasLink),c=Boolean("scam"in e&&e.scam),d=Boolean("fake"in e&&e.fake),u=Boolean("joinToSend"in e&&e.joinToSend),l=Boolean("joinRequest"in e&&e.joinRequest),p=rt(e),f=Boolean("forum"in e&&e.forum),g=Boolean("storiesHidden"in e&&e.storiesHidden),h="storiesMaxId"in e?e.storiesMaxId:void 0,m=Boolean("storiesUnavailable"in e&&e.storiesUnavailable);return{isMin:n,hasPrivateLink:r,isSignaturesShown:o,usernames:p,...s&&{accessHash:s},hasVideoAvatar:a,...i&&{avatarHash:i},..."verified"in e&&{isVerified:e.verified},..."callActive"in e&&{isCallActive:e.callActive},..."callNotEmpty"in e&&{isCallNotEmpty:e.callNotEmpty},..."date"in e&&{joinDate:e.date},..."participantsCount"in e&&void 0!==e.participantsCount&&{membersCount:e.participantsCount},..."noforwards"in e&&{isProtected:Boolean(e.noforwards)},...t&&{isSupport:!0},...Xt(e),..."creator"in e&&{isCreator:e.creator},...Zt(e),...Yt(e),fakeType:c?"scam":d?"fake":void 0,isJoinToSend:u,isJoinRequest:l,isForum:f,areStoriesHidden:g,maxStoryId:h,hasStories:Boolean(h)&&!m}}function Qt(e,t){const{peer:n,folderId:s,unreadMark:a,unreadCount:i,unreadMentionsCount:o,unreadReactionsCount:r,notifySettings:{silent:c,muteUntil:d},readOutboxMaxId:u,readInboxMaxId:l,draft:p}=e,f=c||"number"==typeof d&&ze()<d;return{id:de(n),...s&&{folderId:s},type:tn(t),title:sn(n,t),lastReadOutboxMessageId:u,lastReadInboxMessageId:l,unreadCount:i,unreadMentionsCount:o,unreadReactionsCount:r,isMuted:f,muteUntil:d,...a&&{hasUnreadMark:!0},...p instanceof ie.Api.DraftMessage&&{draftDate:p.date},...Jt(t)}}function Xt(e){return e instanceof ie.Api.Chat||e instanceof ie.Api.Channel?{adminRights:e.adminRights?ge(e.adminRights):void 0,currentUserBannedRights:"bannedRights"in e&&e.bannedRights?ge(e.bannedRights):void 0,defaultBannedRights:e.defaultBannedRights?ge(e.defaultBannedRights):void 0}:{}}function Zt(e){if(e instanceof ie.Api.ChatForbidden)return{isForbidden:!0};if(e instanceof ie.Api.ChannelForbidden)return{isRestricted:!0};const t={};if("restricted"in e){const n=e.restricted?function(e){if(!e)return;const t=e.find((e=>{let{platform:t}=e;return"all"===t}));return t?Oe(t,["reason","text"]):void 0}(e.restrictionReason):void 0;n&&Object.assign(t,{isRestricted:!0,restrictionReason:n})}return e instanceof ie.Api.Chat&&Object.assign(t,{isNotJoined:e.left}),e instanceof ie.Api.Channel&&Object.assign(t,{isNotJoined:e.left}),t}function Yt(e){return!("migratedTo"in e)||!e.migratedTo||e.migratedTo instanceof ie.Api.InputChannelEmpty?{}:{migratedTo:{chatId:de(e.migratedTo),...e.migratedTo instanceof ie.Api.InputChannel&&{accessHash:String(e.migratedTo.accessHash)}}}}function en(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(e instanceof ie.Api.ChatEmpty||e instanceof ie.Api.UserEmpty))return{id:ce(e.id,e instanceof ie.Api.User?"user":e instanceof ie.Api.Chat||e instanceof ie.Api.ChatForbidden?"chat":"channel"),type:tn(e),title:e instanceof ie.Api.User?an(e):e.title,...Jt(e,t)}}function tn(e){return e instanceof ie.Api.User||e instanceof ie.Api.UserEmpty?"chatTypePrivate":e instanceof ie.Api.Chat||e instanceof ie.Api.ChatForbidden||e instanceof ie.Api.ChatEmpty?"chatTypeBasicGroup":e.megagroup?"chatTypeSuperGroup":"chatTypeChannel"}function nn(e){return oe(e)?`user${e.userId}`:re(e)?`chat${e.chatId}`:`chat${e.channelId}`}function sn(e,t){return oe(e)?an(t):t.title}function an(e){return e.firstName?`${e.firstName}${e.lastName?` ${e.lastName}`:""}`:e.lastName||""}function on(e){if("photoId"in e)return String(e.photoId)}function rn(e){return{userId:e instanceof ie.Api.ChannelParticipantBanned||e instanceof ie.Api.ChannelParticipantLeft?de(e.peer):ce(e.userId,"user"),inviterId:"inviterId"in e&&e.inviterId?ce(e.inviterId,"user"):void 0,joinedDate:"date"in e?e.date:void 0,kickedByUserId:"kickedBy"in e&&e.kickedBy?ce(e.kickedBy,"user"):void 0,promotedByUserId:"promotedBy"in e&&e.promotedBy?ce(e.promotedBy,"user"):void 0,bannedRights:"bannedRights"in e?ge(e.bannedRights):void 0,adminRights:"adminRights"in e?ge(e.adminRights):void 0,customTitle:"rank"in e?e.rank:void 0,...(e instanceof ie.Api.ChannelParticipantAdmin||e instanceof ie.Api.ChatParticipantAdmin)&&{isAdmin:!0},...(e instanceof ie.Api.ChannelParticipantCreator||e instanceof ie.Api.ChatParticipantCreator)&&{isOwner:!0}}}function cn(e){return e instanceof ie.Api.ChatParticipants||e instanceof ie.Api.channels.ChannelParticipants?e.participants.map(rn).filter(Boolean):void 0}function dn(e){let t,n="";if(!(e.action instanceof ie.Api.SendMessageCancelAction)){if(e.action instanceof ie.Api.SendMessageTypingAction)n="lng_user_typing";else if(e.action instanceof ie.Api.SendMessageRecordVideoAction)n="lng_send_action_record_video";else if(e.action instanceof ie.Api.SendMessageUploadVideoAction)n="lng_send_action_upload_video";else if(e.action instanceof ie.Api.SendMessageRecordAudioAction)n="lng_send_action_record_audio";else if(e.action instanceof ie.Api.SendMessageUploadAudioAction)n="lng_send_action_upload_audio";else if(e.action instanceof ie.Api.SendMessageUploadPhotoAction)n="lng_send_action_upload_photo";else if(e.action instanceof ie.Api.SendMessageUploadDocumentAction)n="lng_send_action_upload_file";else if(e.action instanceof ie.Api.SendMessageGeoLocationAction)n="selecting a location to share";else if(e.action instanceof ie.Api.SendMessageChooseContactAction)n="selecting a contact to share";else if(e.action instanceof ie.Api.SendMessageGamePlayAction)n="lng_playing_game";else if(e.action instanceof ie.Api.SendMessageRecordRoundAction)n="lng_send_action_record_round";else if(e.action instanceof ie.Api.SendMessageUploadRoundAction)n="lng_send_action_upload_round";else if(e.action instanceof ie.Api.SendMessageChooseStickerAction)n="lng_send_action_choose_sticker";else{if(e.action instanceof ie.Api.SpeakingInGroupCallAction)return;if(e.action instanceof ie.Api.SendMessageEmojiInteractionSeen)n="lng_user_action_watching_animations",t=e.action.emoticon;else if(e.action instanceof ie.Api.SendMessageEmojiInteraction)return}return{action:n,...t&&{emoji:t},...!(e instanceof ie.Api.UpdateUserTyping)&&{userId:de(e.fromId)},timestamp:Date.now()+1e3*Ke()}}}function un(e){return e instanceof ie.Api.DialogFilterChatlist?{...Le(e,["id","title","emoticon"]),excludedChatIds:[],includedChatIds:e.includePeers.map(de).filter(Boolean),pinnedChatIds:e.pinnedPeers.map(de).filter(Boolean),hasMyInvites:e.hasMyInvites,isChatList:!0}:{...Le(e,["id","title","emoticon","contacts","nonContacts","groups","bots","excludeMuted","excludeRead","excludeArchived"]),channels:e.broadcasts,pinnedChatIds:e.pinnedPeers.map(de).filter(Boolean),includedChatIds:e.includePeers.map(de).filter(Boolean),excludedChatIds:e.excludePeers.map(de).filter(Boolean)}}function ln(e){let{filter:t,description:n}=e;if(t instanceof ie.Api.DialogFilter||t instanceof ie.Api.DialogFilterChatlist)return{...un(t),description:n}}function pn(e){return e.reduce(((e,t)=>{const n=ce(t.userId,"user");return t.commands&&(e=e.concat(t.commands.map((e=>({botId:n,...ge(e)}))))),e}),[])}function fn(e){const{revoked:t,date:n,expireDate:s,link:a,permanent:i,startDate:o,usage:r,usageLimit:c,requested:d,requestNeeded:u,title:l,adminId:p}=e;return{isRevoked:t,date:n,expireDate:s,link:a,isPermanent:i,startDate:o,usage:r,usageLimit:c,isRequestNeeded:u,requested:d,title:l,adminId:ce(p,"user")}}function gn(e){let{autoarchived:t,reportSpam:n,addContact:s,blockContact:a}=e;return{isAutoArchived:Boolean(t),canReportSpam:Boolean(n),canAddContact:Boolean(s),canBlockContact:Boolean(a)}}function hn(e){return e instanceof ie.Api.ChatReactionsAll?{type:"all",areCustomAllowed:e.allowCustom}:e instanceof ie.Api.ChatReactionsSome?{type:"some",allowed:e.reactions.map(zt).filter(Boolean)}:void 0}function mn(e){return{id:de(e.peer),isPremium:e.premiumRequired}}function _n(e){if(e instanceof ie.Api.ForumTopicDeleted)return;const{id:t,my:n,closed:s,pinned:a,hidden:i,short:o,date:r,title:c,iconColor:d,iconEmojiId:u,topMessage:l,unreadCount:p,unreadMentionsCount:f,unreadReactionsCount:g,fromId:h,notifySettings:{silent:m,muteUntil:_}}=e;return{id:t,isClosed:s,isPinned:a,isHidden:i,isOwner:n,isMin:o,date:r,title:c,iconColor:d,iconEmojiId:u?.toString(),lastMessageId:l,unreadCount:p,unreadMentionsCount:f,unreadReactionsCount:g,fromId:de(h),isMuted:m||("number"==typeof _?ze()<_:void 0),muteUntil:_}}function yn(e){if(!(e instanceof ie.Api.ExportedChatlistInvite))return;const{title:t,url:n,peers:s}=e;return{title:t,url:n,peerIds:s.map(de).filter(Boolean)}}String.fromCharCode(8205);const bn=/(?:\ud83c[\udd70\udd71\udd7e\udd7f]\ufe0f)|(?:\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]|\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]|\ud83d[\udc6b-\udc6d\udc8f\udc91])|(?:\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|\ud83d\udc26\u200d\u2b1b)|[#*0-9]\ufe0f?\u20e3|(?:[©®\u2122\u265f]\ufe0f)|(?:\ud83c[\udc04\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-\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd-\uddcf\uddd1-\udddd\udec3-\udec5\udef0-\udef8]|[\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\udedc-\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-\ude7c\ude80-\ude88\ude90-\udebd\udebf-\udec2\udece-\udedb\udee0-\udee8]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,wn=new RegExp(`^(?:${bn.source})+$`,""),Sn=e=>{const t=e.split("\n"),n=t.join("");if(n.length>800)return!1;if(!Boolean(n.match(wn)))return!1;const s=t.map((e=>{let t=0;for(;bn.exec(e);)if(t++,t>100)return bn.lastIndex=0,-1;return t}));let a=t.length;for(let e=0;e<s.length;e++){if(-1===s[e])return!1;s[e]>a&&(a=s[e])}return a};function vn(e,t){if(e.text)return!t&&1===Object.keys(e).length&&!e.text.entities?.some((e=>e.type!==Je.CustomEmoji))&&Sn(e.text.text)||void 0}function An(e,t){let n=0;const s=new Array(t),a=e.length/t,i=e[0],o=e[e.length-1];for(let r=0;r<t;r++){const t=Math.floor(r*a),c=((e[t-1]??i)+(e[t]??i)+(e[t+1]??o))/3;s[r]=c,n<c&&(n=c)}return{data:s,peak:n}}var In=n(89618),Cn=n.n(In);const Pn=11;function Mn(e){return e.startsWith("-")?((t=e).length>=G?t.startsWith("-100"):(t.length!==Pn||!t.startsWith("-4"))&&t.length>=Pn)?"channel":"chat":"user";var t}function kn(e){const t=Mn(e);return"user"===t?new ie.Api.PeerUser({userId:Jn(e,"user")}):"channel"===t?new ie.Api.PeerChannel({channelId:Jn(e,"channel")}):new ie.Api.PeerChat({chatId:Jn(e,"chat")})}function Rn(e,t){const n=Mn(e);return"user"===n?new ie.Api.InputPeerUser({userId:Jn(e,"user"),accessHash:le()(t)}):"channel"===n?new ie.Api.InputPeerChannel({channelId:Jn(e,"channel"),accessHash:le()(t)}):new ie.Api.InputPeerChat({chatId:Jn(e,"chat")})}function Tn(e){const t=Mn(e);let n;if("user"===t){if(n=Ae.users[e]?.accessHash,!n)return}else if("channel"===t&&(n=Ae.chats[e]?.accessHash,!n))return;return Rn(e,String(n))}function En(e,t){const n=Mn(e);return"user"===n?new ie.Api.InputUser({userId:Jn(e,"user"),accessHash:le()(t)}):"channel"===n?new ie.Api.InputChannel({channelId:Jn(e,"channel"),accessHash:le()(t)}):Jn(e,"chat")}function Bn(e,t){return new ie.Api.InputStickerSetID({id:le()(e),accessHash:le()(t)})}function Un(e){const t=Ae.documents[e.id];if(t)return new ie.Api.InputDocument(Oe(t,["id","accessHash","fileReference"]))}function Dn(e){const t=Un(e);if(t)return new ie.Api.InputMediaDocument({id:t})}function xn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new ie.Api.InputMediaPoll({poll:new ie.Api.Poll({id:le()(e.id),publicVoters:e.summary.isPublic,question:e.summary.question,answers:e.summary.answers.map((e=>{let{text:t,option:n}=e;return new ie.Api.PollAnswer({text:t,option:Fe(n)})})),quiz:e.summary.quiz,multipleChoice:e.summary.multipleChoice,closeDate:e.summary.closeDate,closePeriod:e.summary.closePeriod,closed:!!t||e.summary.closed}),correctAnswers:e.results.results?.filter((e=>e.isCorrect)).map((e=>Fe(e.option))),solution:e.results.solution,solutionEntities:e.results.solutionEntities?.map(Hn)})}function Vn(){return(0,In.readBigIntFromBuffer)((0,In.generateRandomBytes)(8),!0,!0)}function Fn(){return(0,In.readBigIntFromBuffer)((0,In.generateRandomBytes)(4),!0,!0).toJSNumber()}function Nn(e,t,n){return new ie.Api.Message({id:e,peerId:kn(t),fromId:kn(t),media:n.media})}function Hn(e){const{type:t,offset:n,length:s}=e,a="userId"in e?Ae.users[e.userId]:void 0;switch(t){case Je.Bold:return new ie.Api.MessageEntityBold({offset:n,length:s});case Je.Italic:return new ie.Api.MessageEntityItalic({offset:n,length:s});case Je.Underline:return new ie.Api.MessageEntityUnderline({offset:n,length:s});case Je.Strike:return new ie.Api.MessageEntityStrike({offset:n,length:s});case Je.Code:return new ie.Api.MessageEntityCode({offset:n,length:s});case Je.Pre:return new ie.Api.MessageEntityPre({offset:n,length:s,language:e.language||""});case Je.Blockquote:return new ie.Api.MessageEntityBlockquote({offset:n,length:s});case Je.TextUrl:return new ie.Api.MessageEntityTextUrl({offset:n,length:s,url:e.url});case Je.Url:return new ie.Api.MessageEntityUrl({offset:n,length:s});case Je.Hashtag:return new ie.Api.MessageEntityHashtag({offset:n,length:s});case Je.MentionName:return new ie.Api.InputMessageEntityMentionName({offset:n,length:s,userId:new ie.Api.InputUser({userId:le()(a.id),accessHash:a.accessHash})});case Je.Spoiler:return new ie.Api.MessageEntitySpoiler({offset:n,length:s});case Je.CustomEmoji:return new ie.Api.MessageEntityCustomEmoji({offset:n,length:s,documentId:le()(e.documentId)});default:return new ie.Api.MessageEntityUnknown({offset:n,length:s})}}function qn(e){const{media:t}=e;return!!t&&(t instanceof ie.Api.MessageMediaPhoto||t instanceof ie.Api.MessageMediaDocument||t instanceof ie.Api.MessageMediaWebPage&&t.webpage instanceof ie.Api.WebPage&&(t.webpage.photo instanceof ie.Api.Photo||t.webpage.document instanceof ie.Api.Document&&t.webpage.document.mimeType.startsWith("video"))||t instanceof ie.Api.MessageMediaGame&&(t.game.document instanceof ie.Api.Document||t.game.photo instanceof ie.Api.Photo)||t instanceof ie.Api.MessageMediaInvoice&&(t.photo||t.extendedMedia))}function On(e){const t=Ae.photos[e?.id];if(t)return new ie.Api.InputPhoto(Oe(t,["id","accessHash","fileReference"]))}function Ln(e){let{phone:t,firstName:n,lastName:s}=e;return new ie.Api.InputPhoneContact({clientId:le()(1),phone:t,firstName:n,lastName:s})}function Gn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new ie.Api.ChatBannedRights({...e,untilDate:t})}function jn(e){return new ie.Api.ChatAdminRights(e)}function Wn(e){const{shippingAddress:t}=e;return new ie.Api.PaymentRequestedInfo({...e,shippingAddress:t?new ie.Api.PostAddress(t):void 0})}function Kn(e){switch(e){case"phoneNumber":return new ie.Api.InputPrivacyKeyPhoneNumber;case"addByPhone":return new ie.Api.InputPrivacyKeyAddedByPhone;case"lastSeen":return new ie.Api.InputPrivacyKeyStatusTimestamp;case"profilePhoto":return new ie.Api.InputPrivacyKeyProfilePhoto;case"forwards":return new ie.Api.InputPrivacyKeyForwards;case"chatInvite":return new ie.Api.InputPrivacyKeyChatInvite;case"phoneCall":return new ie.Api.InputPrivacyKeyPhoneCall;case"phoneP2P":return new ie.Api.InputPrivacyKeyPhoneP2P;case"voiceMessages":return new ie.Api.InputPrivacyKeyVoiceMessages;case"bio":return new ie.Api.InputPrivacyKeyAbout}}function zn(e){switch(e){case"spam":return new ie.Api.InputReportReasonSpam;case"violence":return new ie.Api.InputReportReasonViolence;case"childAbuse":return new ie.Api.InputReportReasonChildAbuse;case"pornography":return new ie.Api.InputReportReasonPornography;case"copyright":return new ie.Api.InputReportReasonCopyright;case"fake":return new ie.Api.InputReportReasonFake;case"geoIrrelevant":return new ie.Api.InputReportReasonGeoIrrelevant;case"illegalDrugs":return new ie.Api.InputReportReasonIllegalDrugs;case"personalDetails":return new ie.Api.InputReportReasonPersonalDetails;case"other":return new ie.Api.InputReportReasonOther}}function $n(e){return new ie.Api.DataJSON({data:JSON.stringify(e)})}function Jn(e,t){return"user"===t?le()(e):"channel"===t&&e.length===G?le()(e.slice(4)):le()(e.slice(1))}function Qn(e){return new ie.Api.InputGroupCall({id:le()(e.id),accessHash:le()(e.accessHash)})}function Xn(e){let{id:t,accessHash:n}=e;return new ie.Api.InputPhoneCall({id:le()(t),accessHash:le()(n)})}function Zn(e){return"slug"in e?new ie.Api.InputInvoiceSlug({slug:e.slug}):new ie.Api.InputInvoiceMessage({peer:Rn(e.chat.id,e.chat.accessHash),msgId:e.messageId})}function Yn(e){return e&&"emoticon"in e?new ie.Api.ReactionEmoji({emoticon:e.emoticon}):e&&"documentId"in e?new ie.Api.ReactionCustomEmoji({documentId:le()(e.documentId)}):new ie.Api.ReactionEmpty}function es(e,t){return e.id===x?new ie.Api.EmojiStatusEmpty:t?new ie.Api.EmojiStatusUntil({documentId:le()(e.id),until:t}):new ie.Api.EmojiStatus({documentId:le()(e.id)})}function ts(e){return new ie.Api.TextWithEntities({text:e.text,entities:e.entities?.map(Hn)||[]})}function ns(e){return new ie.Api.InputBotAppID({id:le()(e.id),accessHash:le()(e.accessHash)})}function ss(e,t){return new ie.Api.InputReplyToMessage({replyToMsgId:e,topMsgId:t})}function as(e){return"replyingTo"in e?ss(e.replyingTo,e.replyingToTopId):(t=e.userId,n=e.storyId,new ie.Api.InputReplyToStory({userId:Tn(t),storyId:n}));var t,n}function is(e){const t=[];if(e.allowedUsers?.length&&t.push(new ie.Api.InputPrivacyValueAllowUsers({users:e.allowedUsers.map((e=>{let{id:t,accessHash:n}=e;return En(t,n)}))})),e.allowedChats?.length&&t.push(new ie.Api.InputPrivacyValueAllowChatParticipants({chats:e.allowedChats.map((e=>{let{id:t,type:n}=e;return Jn(t,"chatTypeBasicGroup"===n?"chat":"channel")}))})),e.blockedUsers?.length&&t.push(new ie.Api.InputPrivacyValueDisallowUsers({users:e.blockedUsers.map((e=>{let{id:t,accessHash:n}=e;return En(t,n)}))})),e.blockedChats?.length&&t.push(new ie.Api.InputPrivacyValueDisallowChatParticipants({chats:e.blockedChats.map((e=>{let{id:t,type:n}=e;return Jn(t,"chatTypeBasicGroup"===n?"chat":"channel")}))})),!e.isUnspecified)switch(e.visibility){case"everybody":t.push(new ie.Api.InputPrivacyValueAllowAll);break;case"contacts":t.push(new ie.Api.InputPrivacyValueAllowContacts);break;case"nonContacts":t.push(new ie.Api.InputPrivacyValueDisallowContacts);break;case"nobody":t.push(new ie.Api.InputPrivacyValueDisallowAll)}return t}const os=1e6,rs="temp",cs=63,ds=10;let us,ls=0;function ps(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+ ++ls/os}function fs(e){const{fromId:t,message:n,entities:s,startParam:a,channelPost:i,chatInvite:o,chatInviteHash:r,randomId:c,recommended:d,sponsorInfo:u,additionalInfo:l}=e,p=t?de(t):void 0,f=o?o instanceof ie.Api.ChatInvite?o.title:o.chat instanceof ie.Api.ChatEmpty?void 0:o.chat.title:void 0;return{randomId:Ve(c),isBot:!!t&&oe(t),text:yt(n,s),expiresAt:Math.round(Date.now()/1e3)+R,isRecommended:Boolean(d),...p&&{chatId:p},...r&&{chatInviteHash:r},...o&&{chatInviteTitle:f},...a&&{startParam:a},...i&&{channelPostId:i},...u&&{sponsorInfo:u},...l&&{additionalInfo:l}}}function gs(e){const t=Re(e);if(t&&(e instanceof ie.Api.Message||e instanceof ie.Api.MessageService))return hs(t,e)}function hs(e,t){const n=t.fromId?de(t.fromId):void 0,s=t.peerId?de(t.peerId):void 0,a=!n&&e===us,i=t.out&&!t.post||a&&!t.fwdFrom,o=_t(t),r=t.action&&function(e,t,n,s,a){if(e instanceof ie.Api.MessageActionEmpty)return;let i,o,r,c,d,u;const l=[];let p,f,g,h,m,_="other";const y="users"in e?e.users&&e.users.map((e=>ce(e,"user"))):"userId"in e&&[ce(e.userId,"user")]||[];let b;if(e instanceof ie.Api.MessageActionChatCreate)u="Notification.CreatedChatWithTitle",l.push("%action_origin%",e.title),_="chatCreate";else if(e instanceof ie.Api.MessageActionChatEditTitle)s?(u="Channel.MessageTitleUpdated",l.push(e.title)):(u="Notification.ChangedGroupName",l.push("%action_origin%",e.title));else if(e instanceof ie.Api.MessageActionChatEditPhoto)s?u="Channel.MessagePhotoUpdated":(u="Notification.ChangedGroupPhoto",l.push("%action_origin%"));else if(e instanceof ie.Api.MessageActionChatDeletePhoto)u=s?"Channel.MessagePhotoRemoved":"Group.MessagePhotoRemoved";else if(e instanceof ie.Api.MessageActionChatAddUser)!t||y.includes(t)?(u="Notification.JoinedChat",l.push("%target_user%")):(u="Notification.Invited",l.push("%action_origin%","%target_user%"));else if(e instanceof ie.Api.MessageActionChatDeleteUser)!t||y.includes(t)?(u="Notification.LeftChat",l.push("%target_user%")):(u="Notification.Kicked",l.push("%action_origin%","%target_user%"));else if(e instanceof ie.Api.MessageActionChatJoinedByLink)u="Notification.JoinedGroupByLink",l.push("%action_origin%");else if(e instanceof ie.Api.MessageActionChannelCreate)u="Notification.CreatedChannel";else if(e instanceof ie.Api.MessageActionChatMigrateTo)b=de(e),u="Migrated to %target_chat%",l.push("%target_chat%");else if(e instanceof ie.Api.MessageActionChannelMigrateFrom)b=de(e),u="Migrated from %target_chat%",l.push("%target_chat%");else if(e instanceof ie.Api.MessageActionPinMessage)u="Chat.Service.Group.UpdatedPinnedMessage1",l.push("%action_origin%","%message%");else if(e instanceof ie.Api.MessageActionHistoryClear)u="HistoryCleared",_="historyClear";else if(e instanceof ie.Api.MessageActionPhoneCall){const t=Boolean(e.duration);if(u=[t?"ChatList.Service":"Chat",e.video?"VideoCall":"Call",a?t?"outgoing":"Outgoing":t?"incoming":"Incoming"].join("."),t){const t=Math.max(Math.round(e.duration/60),1);l.push(`${t} min${t>1?"s":""}`)}i={isOutgoing:a,isVideo:e.video,duration:e.duration,reason:Ht(e.reason)}}else if(e instanceof ie.Api.MessageActionInviteToGroupCall)u="Notification.VoiceChatInvitation",o={id:e.call.id.toString(),accessHash:e.call.accessHash.toString()},l.push("%action_origin%","%target_user%");else if(e instanceof ie.Api.MessageActionContactSignUp)u="Notification.Joined",l.push("%action_origin%"),_="contactSignUp";else if(e instanceof ie.Api.MessageActionPaymentSent)r=Number(e.totalAmount),c=e.currency,u="PaymentSuccessfullyPaid",n&&y.push(n),l.push("%payment_amount%","%target_user%","%product%");else if(e instanceof ie.Api.MessageActionGroupCall)if(e.duration){const t=Math.max(Math.round(e.duration/60),1);u="Notification.VoiceChatEnded",l.push(`${t} min${t>1?"s":""}`)}else u="Notification.VoiceChatStartedChannel",o={id:e.call.id.toString(),accessHash:e.call.accessHash.toString()};else if(e instanceof ie.Api.MessageActionBotAllowed)e.domain?(u="ActionBotAllowed",l.push(e.domain)):u=e.fromRequest?"lng_action_webapp_bot_allowed":"ActionAttachMenuBotAllowed";else if(e instanceof ie.Api.MessageActionCustomAction)u=e.message;else if(e instanceof ie.Api.MessageActionChatJoinedByRequest)u="ChatService.UserJoinedGroupByRequest",l.push("%action_origin%");else if(e instanceof ie.Api.MessageActionGameScore)u=t===us?"ActionYouScoredInGame":"ActionUserScoredInGame",l.push("%score%"),f=e.score;else if(e instanceof ie.Api.MessageActionWebViewDataSent)u="Notification.WebAppSentData",l.push(e.text);else if(e instanceof ie.Api.MessageActionGiftPremium){if(u=a?"ActionGiftOutbound":"ActionGiftInbound",a?l.push("%gift_payment_amount%"):l.push("%action_origin%","%gift_payment_amount%"),n&&y.push(n),c=e.currency,e.cryptoCurrency){const t=e.cryptoAmount.divide(1e7).toJSNumber()/100;d={currency:e.cryptoCurrency,amount:t.toFixed(2)}}r=e.amount.toJSNumber(),g=e.months}else if(e instanceof ie.Api.MessageActionTopicCreate)u="TopicWasCreatedAction",_="topicCreate",l.push(e.title);else if(e instanceof ie.Api.MessageActionTopicEdit)void 0!==e.closed?(u=e.closed?"TopicWasClosedAction":"TopicWasReopenedAction",l.push("%action_origin%","%action_topic%")):void 0!==e.hidden?u=e.hidden?"TopicHidden2":"TopicShown":e.title?(u="TopicRenamedTo",l.push("%action_origin%",e.title)):e.iconEmojiId?(u="TopicWasIconChangedToAction",l.push("%action_origin%","%action_topic_icon%"),h=e.iconEmojiId.toString()):u="ChatList.UnsupportedMessage",m=!0;else if(e instanceof ie.Api.MessageActionSuggestProfilePhoto){const s=e.photo instanceof ie.Api.Photo&&e.photo.videoSizes?.length;u=t===us?s?"ActionSuggestVideoFromYouDescription":"ActionSuggestPhotoFromYouDescription":s?"ActionSuggestVideoToYouDescription":"ActionSuggestPhotoToYouDescription",_="suggestProfilePhoto",l.push("%target_user%"),n&&y.push(n)}else u="ChatList.UnsupportedMessage";return"photo"in e&&e.photo instanceof ie.Api.Photo&&(Ue(e.photo),p=at(e.photo)),{text:u,type:_,targetUserIds:y,targetChatId:b,photo:p,amount:r,currency:c,giftCryptoInfo:d,translationValues:l,call:o,phoneCall:i,score:f,months:g,topicEmojiIconId:h,isTopicAction:m}}(t.action,n,s,Boolean(t.post),i);r&&(o.action=r);const c=t.date>ze()+ds,d=t.media instanceof ie.Api.MessageMediaInvoice&&Boolean(t.media.extendedMedia);let u,l,p,f,g,h;t.replyTo instanceof ie.Api.MessageReplyHeader&&(u=t.replyTo.replyToMsgId,l=t.replyTo.replyToTopId,g=t.replyTo.forumTopic,h=t.replyTo.replyToPeerId),t.replyTo instanceof ie.Api.MessageReplyStoryHeader&&(p=ce(t.replyTo.userId,"user"),f=t.replyTo.storyId);const m=t.editDate&&!t.editHide,{inlineButtons:_,keyboardButtons:y,keyboardPlaceholder:b,isKeyboardSingleUse:w,isKeyboardSelective:S}=function(e,t){const{replyMarkup:n,media:s}=e;if(!(n instanceof ie.Api.ReplyKeyboardMarkup||n instanceof ie.Api.ReplyInlineMarkup))return;const a=n.rows.map((e=>{let{buttons:n}=e;return n.map((e=>{const{text:n}=e;if(e instanceof ie.Api.KeyboardButton)return{type:"command",text:n};if(e instanceof ie.Api.KeyboardButtonUrl)return e.url.includes("?startgroup=")?{type:"unsupported",text:n}:{type:"url",text:n,url:e.url};if(e instanceof ie.Api.KeyboardButtonCallback)return e.requiresPassword?{type:"unsupported",text:n}:{type:"callback",text:n,data:Ve(e.data)};if(e instanceof ie.Api.KeyboardButtonRequestPoll)return{type:"requestPoll",text:n,isQuiz:e.quiz};if(e instanceof ie.Api.KeyboardButtonRequestPhone)return{type:"requestPhone",text:n};if(e instanceof ie.Api.KeyboardButtonBuy){if(s instanceof ie.Api.MessageMediaInvoice&&s.receiptMsgId)return{type:"receipt",text:"PaymentReceipt",receiptMessageId:s.receiptMsgId};if(t)return;return{type:"buy",text:n}}return e instanceof ie.Api.KeyboardButtonGame?{type:"game",text:n}:e instanceof ie.Api.KeyboardButtonSwitchInline?{type:"switchBotInline",text:n,query:e.query,isSamePeer:e.samePeer}:e instanceof ie.Api.KeyboardButtonUserProfile?{type:"userProfile",text:n,userId:e.userId.toString()}:e instanceof ie.Api.KeyboardButtonSimpleWebView?{type:"simpleWebView",text:n,url:e.url}:e instanceof ie.Api.KeyboardButtonWebView?{type:"webView",text:n,url:e.url}:e instanceof ie.Api.KeyboardButtonUrlAuth?{type:"urlAuth",text:n,url:e.url,buttonId:e.buttonId}:{type:"unsupported",text:n}})).filter(Boolean)}));return a.every((e=>!e.length))?void 0:{[n instanceof ie.Api.ReplyKeyboardMarkup?"keyboardButtons":"inlineButtons"]:a,...n instanceof ie.Api.ReplyKeyboardMarkup&&{keyboardPlaceholder:n.placeholder,isKeyboardSingleUse:n.singleUse,isKeyboardSelective:n.selective}}}(t,d)||{},v=t.fwdFrom&&function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.savedFromPeer&&de(e.savedFromPeer),s=e.fromId&&de(e.fromId);return{date:e.date,isImported:e.imported,isChannelPost:Boolean(e.channelPost),channelPostId:e.channelPost,isLinkedChannelPost:Boolean(e.channelPost&&n&&!t),fromChatId:n||s,fromMessageId:e.savedFromMsgId||e.channelPost,senderUserId:s,hiddenUserName:e.fromName,postAuthorTitle:e.postAuthor}}(t.fwdFrom,a),{replies:A,mediaUnread:I,postAuthor:C}=t,P=t.groupedId&&String(t.groupedId),M=Boolean(P)&&!(o.document||o.audio||o.sticker),k=t.replyMarkup instanceof ie.Api.ReplyKeyboardHide,R=t.replyMarkup instanceof ie.Api.ReplyKeyboardHide&&t.replyMarkup.selective,T=t.noforwards||d,E=!t.noforwards,B=vn(o,P);return{id:t.id,chatId:e,isOutgoing:i,content:o,date:t.date,senderId:n||t.out&&t.post&&us||e,views:t.views,forwards:t.forwards,isScheduled:c,isFromScheduled:t.fromScheduled,isSilent:t.silent,isPinned:t.pinned,reactions:t.reactions&&Gt(t.reactions),emojiOnlyCount:B,...u&&{replyToMessageId:u},...g&&{isTopicReply:!0},...h&&{replyToChatId:de(h)},...l&&{replyToTopMessageId:l},...v&&{forwardInfo:v},...p&&{replyToStoryUserId:p,replyToStoryId:f},...m&&{isEdited:m},...t.editDate&&{editDate:t.editDate},...I&&{isMediaUnread:I},...t.mentioned&&I&&{hasUnreadMention:!0},...t.mentioned&&{isMentioned:!0},...P&&{groupedId:P,isInAlbum:M},inlineButtons:_,...y&&{keyboardButtons:y,keyboardPlaceholder:b,isKeyboardSingleUse:w,isKeyboardSelective:S},...k&&{shouldHideKeyboardButtons:k,isHideKeyboardSelective:R},...t.viaBotId&&{viaBotId:ce(t.viaBotId,"user")},...A&&{repliesThreadInfo:ys(A,t.id,e)},...C&&{postAuthorTitle:C},isProtected:T,isForwardingAllowed:E}}function ms(e){if(e instanceof ie.Api.DraftMessageEmpty)return;const{message:t,entities:n,replyToMsgId:s,date:a}=e;return{formattedText:t?yt(t,n):void 0,replyingToId:s,date:a}}function _s(e,t){return{poll:{id:String(t),summary:Oe(e.summary,["question","answers"]),results:{}}}}function ys(e,t,n){const{channelId:s,replies:a,maxId:i,readMaxId:o,recentRepliers:r,comments:c}=e,d=s?ce(s,"channel"):void 0;if(d!==z)return{isComments:c,threadId:t,...d&&n!==d?{chatId:d,originChannelId:n}:{chatId:n},messagesCount:a,lastMessageId:i,lastReadInboxMessageId:o,...r&&{recentReplierIds:r.map(de)}}}function bs(e){const{fullUser:{about:t,commonChatsCount:n,pinnedMsgId:s,botInfo:a,blocked:i,profilePhoto:o,voiceMessagesForbidden:r,premiumGifts:c,fallbackPhoto:d,personalPhoto:u,translationsDisabled:l,storiesPinnedAvailable:p},users:f}=e,g=ce(f[0].id,"user");return{bio:t,commonChatsCount:n,pinnedMessageId:s,isBlocked:Boolean(i),noVoiceMessages:r,hasPinnedStories:Boolean(p),isTranslationDisabled:l,profilePhoto:o instanceof ie.Api.Photo?at(o):void 0,fallbackPhoto:d instanceof ie.Api.Photo?at(d):void 0,personalPhoto:u instanceof ie.Api.Photo?at(u):void 0,...c&&{premiumGifts:c.map((e=>function(e){const{months:t,currency:n,amount:s,botUrl:a}=e;return{months:t,currency:n,amount:s.toJSNumber(),botUrl:a}}(e)))},...a&&{botInfo:Bt(a,g)}}}function ws(e){if(!(e instanceof ie.Api.User))return;const{id:t,firstName:n,lastName:s,fake:a,scam:i,support:o,closeFriend:r,storiesUnavailable:c,storiesMaxId:d}=e,u=e.photo instanceof ie.Api.UserProfilePhoto?Boolean(e.photo.hasVideo):void 0,l=e.photo instanceof ie.Api.UserProfilePhoto?String(e.photo.photoId):void 0,p=(h=e).bot?"userTypeBot":h.deleted?"userTypeDeleted":"userTypeRegular",f=rt(e),g=e.emojiStatus?vs(e.emojiStatus):void 0;var h;return{id:ce(t,"user"),isMin:Boolean(e.min),fakeType:i?"scam":a?"fake":void 0,...e.self&&{isSelf:!0},isPremium:Boolean(e.premium),...e.verified&&{isVerified:!0},...r&&{isCloseFriend:!0},...o&&{isSupport:!0},...(e.contact||e.mutualContact)&&{isContact:!0},type:p,firstName:n,lastName:s,..."userTypeBot"===p&&{canBeInvitedToGroup:!e.botNochats},...f&&{usernames:f},phoneNumber:e.phone||"",noStatus:!e.status,...e.accessHash&&{accessHash:String(e.accessHash)},...l&&{avatarHash:l},emojiStatus:g,hasVideoAvatar:u,areStoriesHidden:Boolean(e.storiesHidden),maxStoryId:d,hasStories:Boolean(d)&&!c,...e.bot&&e.botInlinePlaceholder&&{botPlaceholder:e.botInlinePlaceholder},...e.bot&&e.botAttachMenu&&{isAttachBot:e.botAttachMenu}}}function Ss(e){return!e||e instanceof ie.Api.UserStatusEmpty?{type:"userStatusEmpty"}:e instanceof ie.Api.UserStatusOnline?{type:"userStatusOnline",expires:e.expires}:e instanceof ie.Api.UserStatusOffline?{type:"userStatusOffline",wasOnline:e.wasOnline}:e instanceof ie.Api.UserStatusRecently?{type:"userStatusRecently"}:e instanceof ie.Api.UserStatusLastWeek?{type:"userStatusLastWeek"}:{type:"userStatusLastMonth"}}function vs(e){return e instanceof ie.Api.EmojiStatus?{documentId:e.documentId.toString()}:e instanceof ie.Api.EmojiStatusUntil?{documentId:e.documentId.toString(),until:e.until}:void 0}function As(e){const t={},n={};return e.forEach((e=>{const s=ws(e);if(!s)return;const a=n[s.id];a&&!a.isMin||(n[s.id]=s),"status"in e&&(t[s.id]=Ss(e.status))})),{users:Object.values(n),userStatusesById:t}}function Is(e){if(e instanceof ie.Api.WallPaperNoFile)return;const{slug:t}=e,n=St(e.document);return n?{slug:t,document:n}:void 0}function Cs(e){return{isCurrent:Boolean(e.current),isOfficialApp:Boolean(e.officialApp),isPasswordPending:Boolean(e.passwordPending),hash:String(e.hash),areCallsEnabled:!e.callRequestsDisabled,areSecretChatsEnabled:!e.encryptedRequestsDisabled,isUnconfirmed:e.unconfirmed,...Oe(e,["deviceModel","platform","systemVersion","appName","appVersion","dateCreated","dateActive","ip","country","region"])}}function Ps(e){return{hash:String(e.hash),botId:ce(e.botId,"user"),...Oe(e,["platform","browser","dateCreated","dateActive","ip","region","domain"])}}function Ms(e,t){const{silent:n,muteUntil:s,showPreviews:a,otherSound:i}=e,o=Boolean(i&&!(i instanceof ie.Api.NotificationSoundNone));return{chatId:de(t),isMuted:n||"number"==typeof s&&ze()<s,...!o&&{isSilent:!0},...void 0!==a&&{shouldShowPreviews:Boolean(a)},muteUntil:s}}function ks(e,t){const{hidden:n,iso2:s,defaultName:a,name:i}=e,{countryCode:o,prefixes:r,patterns:c}=t||{};return{isHidden:n,iso2:s,defaultName:a,name:i,countryCode:o,prefixes:r,patterns:c}}function Rs(e){if(!(e instanceof ie.Api.JsonNull))return e instanceof ie.Api.JsonString||e instanceof ie.Api.JsonBool||e instanceof ie.Api.JsonNumber?e.value:e instanceof ie.Api.JsonArray?e.value.map(Rs):e.value.reduce(((e,t)=>(e[t.key]=Rs(t.value),e)),{})}function Ts(e){if(e instanceof ie.Api.UrlAuthResultRequest){const{bot:t,domain:n,requestWriteAccess:s}=e,a=ws(t);if(!a)return;return De(t),{type:"request",domain:n,shouldRequestWriteAccess:s,bot:a}}return e instanceof ie.Api.UrlAuthResultAccepted?{type:"accepted",url:e.url}:e instanceof ie.Api.UrlAuthResultDefault?{type:"default"}:void 0}function Es(e){return e.strings.reduce(((e,t)=>(e[t.key]=Bs(t),e)),{})}function Bs(e){return e instanceof ie.Api.LangPackString?e.value:e instanceof ie.Api.LangPackStringPluralized?Ge(ge(e),["key"]):void 0}function Us(e,t){if(e.error)return;const n=JSON.parse(e.json.data),[s,...a]=n.columns,i=n.y_scaled;return{type:t?"area":n.types.y0,zoomToken:e.zoomToken,labelFormatter:n.xTickFormatter,tooltipFormatter:n.xTooltipFormatter,labels:s.slice(1),hideCaption:!n.subchart.show,hasSecondYAxis:i,isStacked:n.stacked&&!i,isPercentage:t,datasets:a.map((e=>{const t=e[0];return{name:n.names[t],color:(s=n.colors[t],s.substring(s.indexOf("#"))),values:e.slice(1)};var s})),...Ds(n.subchart.defaultZoom,s.slice(1))}}function Ds(e,t){const[n,s]=e;let a=0,i=t.length-1;return t.forEach(((e,t)=>{!a&&e>=n&&(a=t),!i&&e>=s&&(i=t)})),{minimapRange:{begin:Math.max(0,a/(t.length-1)),end:Math.min(1,i/(t.length-1))},labelFromIndex:a,labelToIndex:i}}function xs(e){let{current:t,previous:n}=e;const s=t-n;return{current:t,change:s,...n&&{percentage:(s?Math.abs(s)/n*100:0).toFixed(2)}}}function Vs(e){return{percentage:(e.part/e.total*100).toFixed(2)}}function Fs(e,t){if(t instanceof ie.Api.StoryItemDeleted)return{id:t.id,peerId:e,isDeleted:!0};if(t instanceof ie.Api.StoryItemSkipped){const{id:n,date:s,expireDate:a,closeFriends:i}=t;return{id:n,peerId:e,...i&&{isForCloseFriends:!0},date:s,expireDate:a}}const{edited:n,pinned:s,expireDate:a,id:i,date:o,caption:r,entities:c,media:d,privacy:u,views:l,public:p,noforwards:f,closeFriends:g,contacts:h,selectedContacts:m,mediaAreas:_,sentReaction:y,out:b}=t,w={...bt(d)};return r&&(w.text=yt(r,c)),{id:i,peerId:e,date:o,expireDate:a,content:w,...p&&{isPublic:p},...n&&{isEdited:!0},...s&&{isPinned:!0},...h&&{isForContacts:!0},...m&&{isForSelectedContacts:!0},...g&&{isForCloseFriends:!0},...f&&{noForwards:!0},...l?.viewsCount&&{viewsCount:l.viewsCount},...l?.reactionsCount&&{reactionsCount:l.reactionsCount},...l?.reactions&&{reactions:l.reactions.map(Wt)},...l?.recentViewers&&{recentViewerIds:l.recentViewers.map((e=>ce(e,"user")))},...b&&{isOut:!0},...u&&{visibility:ct(u)},..._&&{mediaAreas:_.map(Os).filter(Boolean)},...y&&{sentReaction:zt(y)}}}function Ns(e){const{userId:t,date:n,reaction:s,blockedMyStoriesFrom:a,blocked:i}=e;return{userId:t.toString(),date:n,...s&&{reaction:zt(s)},areStoriesBlocked:i||a,isUserBlocked:i}}function Hs(e){return{activeUntil:e.activeUntilDate,cooldownUntil:e.cooldownUntilDate}}function qs(e){const{x:t,y:n,w:s,h:a,rotation:i}=e;return{x:t,y:n,width:s,height:a,rotation:i}}function Os(e){if(e instanceof ie.Api.MediaAreaVenue){const{geo:t,title:n,coordinates:s}=e,a=vt(t);if(!a)return;return{type:"venue",coordinates:qs(s),geo:a,title:n}}if(e instanceof ie.Api.MediaAreaGeoPoint){const{geo:t,coordinates:n}=e,s=vt(t);if(!s)return;return{type:"geoPoint",coordinates:qs(n),geo:s}}if(e instanceof ie.Api.MediaAreaSuggestedReaction){const{coordinates:t,reaction:n,dark:s,flipped:a}=e,i=zt(n);if(!i)return;return{type:"suggestedReaction",coordinates:qs(t),reaction:i,...s&&{isDark:!0},...a&&{isFlipped:!0}}}}const Ls=new Map,Gs=[],js=(e,t)=>{const n=e.topicId?`${e.chatId}-${e.topicId}`:e.chatId;if(Ls.has(n)&&(clearTimeout(Ls.get(n)),Ls.delete(n)),e.muteUntil===T||e.muteUntil<=ze())return;if(Gs.push(e),Gs.sort(((e,t)=>t.muteUntil-e.muteUntil)),!Gs.pop())return;const s=setTimeout((()=>{if(t(),Gs.length){const e=Gs.pop();e&&js(e,t)}}),1e3*(e.muteUntil-ze()));Ls.set(n,s)};function Ws(e){let t=arguments.length>2?arguments[2]:void 0;js({chatId:e,muteUntil:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0},(()=>t({"@type":"updateNotifyExceptions",chatId:e,isMuted:!1})))}const Ks=1e3;let zs;const $s=new Set;function Js(e){e.filter((e=>e instanceof ie.Api.User)).map(ws).forEach((e=>{e&&zs({"@type":"updateUser",id:e.id,user:e})})),e.filter((e=>e instanceof ie.Api.Chat||e instanceof ie.Api.ChatForbidden||e instanceof ie.Api.Channel||e instanceof ie.Api.ChannelForbidden)).map((e=>en(e))).forEach((e=>{e&&zs({"@type":"updateChat",id:e.id,chat:e})}))}function Qs(e){zs(e)}function Xs(e){if(e instanceof ie.connection.UpdateServerTimeOffset)a=e.timeOffset,We=a,zs({"@type":"updateServerTimeOffset",serverTimeOffset:e.timeOffset});else if(e instanceof ie.connection.UpdateConnectionState){let t;switch(e.state){case ie.connection.UpdateConnectionState.disconnected:t="connectionStateConnecting";break;case ie.connection.UpdateConnectionState.broken:t="connectionStateBroken";break;case ie.connection.UpdateConnectionState.connected:default:t="connectionStateReady"}zs({"@type":"updateConnectionState",connectionState:t})}else if(e instanceof ie.Api.UpdateNewMessage||e instanceof ie.Api.UpdateNewScheduledMessage||e instanceof ie.Api.UpdateNewChannelMessage||e instanceof ie.Api.UpdateShortChatMessage||e instanceof ie.Api.UpdateShortMessage){let t,n;const a=e._entities;if(a&&(xe(a),Js(a)),e instanceof ie.Api.UpdateShortChatMessage)t=hs(ce((s=e).chatId,"chat"),{...s,fromId:kn(ce(s.fromId,"user"))});else if(e instanceof ie.Api.UpdateShortMessage)t=function(e){return hs(ce(e.userId,"user"),{...e,fromId:kn(e.out?us:ce(e.userId,"user"))})}(e);else{if(e.message instanceof ie.Api.MessageEmpty)return void(c&&console.error("Unexpected update:",e.className,e));(e.message instanceof ie.Api.Message&&qn(e.message)||e.message instanceof ie.Api.MessageService&&e.message.action instanceof ie.Api.MessageActionSuggestProfilePhoto)&&Ee(e.message),t=gs(e.message),n="replyMarkup"in e.message&&e.message?.replyMarkup instanceof ie.Api.ReplyKeyboardForceReply&&(!e.message.replyMarkup.selective||t.isMentioned)}if(e instanceof ie.Api.UpdateNewScheduledMessage)zs({"@type":$s.has(t.id)?"updateScheduledMessage":"newScheduledMessage",id:t.id,chatId:t.chatId,message:t});else{const e=$s.has(t.id)&&!t.viaBotId&&!t.content.action;zs({"@type":e?"updateMessage":"newMessage",id:t.id,chatId:t.chatId,message:t,shouldForceReply:n})}if(e.message instanceof ie.Api.MessageService){const{action:n}=e.message;if(n instanceof ie.Api.MessageActionPaymentSent)zs({"@type":"updatePaymentStateCompleted",slug:n.invoiceSlug});else if(n instanceof ie.Api.MessageActionChatEditTitle)zs({"@type":"updateChat",id:t.chatId,chat:{title:n.title}});else if(n instanceof ie.Api.MessageActionChatEditPhoto){const s=function(e){if(e instanceof ie.Api.PhotoEmpty)return new ie.Api.ChatPhotoEmpty;const{dcId:t,id:n}=e;return new ie.Api.ChatPhoto({dcId:t,photoId:n})}(n.photo),a=on(s),i=Re(e.message);Ae.chats[i]&&(Ae.chats[i].photo=s),Ue(n.photo),a&&zs({"@type":"updateChat",id:t.chatId,chat:{avatarHash:a},...n.photo instanceof ie.Api.Photo&&{newProfilePhoto:at(n.photo)}})}else if(n instanceof ie.Api.MessageActionChatDeletePhoto){const n=Re(e.message);Ae.chats[n]&&(Ae.chats[n].photo=new ie.Api.ChatPhotoEmpty),zs({"@type":"updateChat",id:t.chatId,chat:{avatarHash:void 0}})}else if(n instanceof ie.Api.MessageActionChatDeleteUser)e._entities&&e._entities.some((e=>e instanceof ie.Api.User&&Boolean(e.self)&&e.id===n.userId))&&zs({"@type":"updateChat",id:t.chatId,chat:{isForbidden:!0,isNotJoined:!0}});else if(n instanceof ie.Api.MessageActionChatAddUser)e._entities&&e._entities.some((e=>e instanceof ie.Api.User&&Boolean(e.self)&&n.users.includes(e.id)))&&zs({"@type":"updateChatJoin",id:t.chatId});else if(n instanceof ie.Api.MessageActionGroupCall)!n.duration&&n.call&&zs({"@type":"updateGroupCallChatId",chatId:t.chatId,call:{id:n.call.id.toString(),accessHash:n.call.accessHash.toString()}});else if(n instanceof ie.Api.MessageActionTopicEdit){const t=e.message.replyTo instanceof ie.Api.MessageReplyHeader?e.message.replyTo:void 0,{replyToMsgId:n,replyToTopId:s,forumTopic:a}=t||{},i=a&&(s||n)||J;zs({"@type":"updateTopic",chatId:de(e.message.peerId),topicId:i})}else n instanceof ie.Api.MessageActionTopicCreate&&zs({"@type":"updateTopics",chatId:de(e.message.peerId)})}}else if(e instanceof ie.Api.UpdateEditMessage||e instanceof ie.Api.UpdateEditChannelMessage){if(e.message instanceof ie.Api.MessageEmpty)return void(c&&console.error("Unexpected update:",e.className,e));e.message instanceof ie.Api.Message&&qn(e.message)&&Ee(e.message);const t=Ge(gs(e.message),["isOutgoing"]);zs({"@type":"updateMessage",id:t.id,chatId:t.chatId,message:t})}else if(e instanceof ie.Api.UpdateMessageReactions)zs({"@type":"updateMessageReactions",id:e.msgId,chatId:de(e.peer),reactions:Gt(e.reactions)});else if(e instanceof ie.Api.UpdateMessageExtendedMedia){let t,n;if(e.extendedMedia instanceof ie.Api.MessageExtendedMedia&&(t=bt(e.extendedMedia.media)),e.extendedMedia instanceof ie.Api.MessageExtendedMediaPreview&&(n=Mt(e.extendedMedia)),!t&&!n)return;const s=de(e.peer);!function(e,t,n){const s=Ae.messages[`${e}-${t}`];if(s instanceof ie.Api.Message&&s.media){if(n instanceof ie.Api.MessageExtendedMediaPreview){if(!(s.media instanceof ie.Api.MessageMediaInvoice))return;s.media.extendedMedia=n}n instanceof ie.Api.MessageExtendedMedia&&(s.media=n.media)}}(s,e.msgId,e.extendedMedia),zs({"@type":"updateMessageExtendedMedia",id:e.msgId,chatId:s,media:t,preview:n})}else if(e instanceof ie.Api.UpdateDeleteMessages)zs({"@type":"deleteMessages",ids:e.messages});else if(e instanceof ie.Api.UpdateDeleteScheduledMessages)zs({"@type":"deleteScheduledMessages",ids:e.messages,chatId:de(e.peer)});else if(e instanceof ie.Api.UpdateDeleteChannelMessages){const t=ce(e.channelId,"channel"),n=e.messages,s=n.filter((e=>Ae.messages[`${t}-${e}`])),a=n.filter((e=>!Ae.messages[`${t}-${e}`])),i=n.map((e=>{const n=Ae.messages[`${t}-${e}`];return n&&n instanceof ie.Api.MessageService&&"photo"in n.action?String(n.action.photo.id):void 0})).filter(Boolean);s.length&&zs({"@type":"deleteMessages",ids:s,chatId:t}),i.length&&zs({"@type":"deleteProfilePhotos",ids:i,chatId:t}),a.length&&setTimeout((()=>{zs({"@type":"deleteMessages",ids:a,chatId:t})}),Ks)}else if(e instanceof ie.Api.UpdateServiceNotification)if(e.popup)zs({"@type":"error",error:{message:e.message}});else{const t=function(e,t){const n=ps(t),s=_t(e);return{id:n,chatId:L,date:e.inboxDate||t,content:s,isOutgoing:!1}}(e,Date.now()/1e3+Ke());qn(e)&&Ee(Nn(t.id,t.chatId,e)),zs({"@type":"updateServiceNotification",message:t})}else if(e instanceof ie.Api.UpdateMessageID||e instanceof ie.Api.UpdateShortSentMessage)$s.add(e.id);else if(e instanceof ie.Api.UpdateReadMessagesContents)zs({"@type":"updateCommonBoxMessages",ids:e.messages,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}});else if(e instanceof ie.Api.UpdateChannelReadMessagesContents)zs({"@type":"updateChannelMessages",channelId:ce(e.channelId,"channel"),ids:e.messages,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}});else if(e instanceof ie.Api.UpdateMessagePoll){const{pollId:t,poll:n,results:s}=e;if(n){const e=At(n,s);zs({"@type":"updateMessagePoll",pollId:String(t),pollUpdate:e})}else{const e=It(s);zs({"@type":"updateMessagePoll",pollId:String(t),pollUpdate:{results:e}})}}else if(e instanceof ie.Api.UpdateMessagePollVote)zs({"@type":"updateMessagePollVote",pollId:String(e.pollId),peerId:de(e.peer),options:e.options.map(Ve)});else if(e instanceof ie.Api.UpdateChannelMessageViews)zs({"@type":"updateMessage",chatId:ce(e.channelId,"channel"),id:e.id,message:{views:e.views}});else if(e instanceof ie.Api.UpdateReadHistoryInbox)zs({"@type":"updateChatInbox",id:de(e.peer),chat:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount}});else if(e instanceof ie.Api.UpdateReadHistoryOutbox)zs({"@type":"updateChat",id:de(e.peer),chat:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof ie.Api.UpdateReadChannelInbox)zs({"@type":"updateChat",id:ce(e.channelId,"channel"),chat:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount}});else if(e instanceof ie.Api.UpdateReadChannelOutbox)zs({"@type":"updateChat",id:ce(e.channelId,"channel"),chat:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof ie.Api.UpdateReadChannelDiscussionInbox)zs({"@type":"updateThreadInfo",chatId:ce(e.channelId,"channel"),threadId:e.topMsgId,threadInfo:{lastReadInboxMessageId:e.readMaxId}});else if(e instanceof ie.Api.UpdateReadChannelDiscussionOutbox)zs({"@type":"updateChat",id:ce(e.channelId,"channel"),chat:{lastReadOutboxMessageId:e.readMaxId}});else if(e instanceof ie.Api.UpdateDialogPinned&&e.peer instanceof ie.Api.DialogPeer)zs({"@type":"updateChatPinned",id:de(e.peer.peer),isPinned:e.pinned||!1});else if(e instanceof ie.Api.UpdatePinnedDialogs){const t=e.order?e.order.filter((e=>e instanceof ie.Api.DialogPeer)).map((e=>de(e.peer))):[];zs({"@type":"updatePinnedChatIds",ids:t,folderId:e.folderId||void 0})}else if(e instanceof ie.Api.UpdateFolderPeers)e.folderPeers.forEach((e=>{const{folderId:t,peer:n}=e;zs({"@type":"updateChatListType",id:de(n),folderId:t})}));else if(e instanceof ie.Api.UpdateDialogFilter){const{id:t,filter:n}=e,s=Te(n)?un(n):void 0;zs({"@type":"updateChatFolder",id:t,folder:s})}else if(e instanceof ie.Api.UpdateDialogFilterOrder)zs({"@type":"updateChatFoldersOrder",orderedIds:e.order});else if(e instanceof ie.Api.UpdateChatParticipants){const t=cn(e.participants);zs({"@type":"updateChatMembers",id:ce(e.participants.chatId,"chat"),replacedMembers:t})}else if(e instanceof ie.Api.UpdateChatParticipantAdd){const t=rn(Oe(e,["userId","inviterId","date"]));zs({"@type":"updateChatMembers",id:ce(e.chatId,"chat"),addedMember:t})}else if(e instanceof ie.Api.UpdateChatParticipantDelete)zs({"@type":"updateChatMembers",id:ce(e.chatId,"chat"),deletedMemberId:ce(e.userId,"user")});else if(e instanceof ie.Api.UpdatePinnedMessages||e instanceof ie.Api.UpdatePinnedChannelMessages){const t=e instanceof ie.Api.UpdatePinnedMessages?de(e.peer):ce(e.channelId,"channel");zs({"@type":"updatePinnedIds",chatId:t,messageIds:e.messages,isPinned:e.pinned})}else if(e instanceof ie.Api.UpdateNotifySettings&&e.peer instanceof ie.Api.NotifyPeer){const t=Ms(e.notifySettings,e.peer.peer);Ws(t.chatId,t.muteUntil,zs),zs({"@type":"updateNotifyExceptions",...t})}else if(e instanceof ie.Api.UpdateNotifySettings&&e.peer instanceof ie.Api.NotifyForumTopic){const t=function(e,t,n){const{silent:s,muteUntil:a,showPreviews:i,otherSound:o}=e,r=Boolean(o&&!(o instanceof ie.Api.NotificationSoundNone));return{chatId:de(t),topicId:n,isMuted:s||"number"==typeof a&&ze()<a,...!r&&{isSilent:!0},...void 0!==i&&{shouldShowPreviews:Boolean(i)},muteUntil:a}}(e.notifySettings,e.peer.peer,e.peer.topMsgId);!function(e,t){let n=arguments.length>3?arguments[3]:void 0;js({chatId:e,topicId:t,muteUntil:arguments.length>2&&void 0!==arguments[2]?arguments[2]:0},(()=>n({"@type":"updateTopicNotifyExceptions",chatId:e,topicId:t,isMuted:!1})))}(t.chatId,t.topicId,t.muteUntil,zs),zs({"@type":"updateTopicNotifyExceptions",...t})}else if(e instanceof ie.Api.UpdateUserTyping||e instanceof ie.Api.UpdateChatUserTyping){const t=e instanceof ie.Api.UpdateUserTyping?ce(e.userId,"user"):ce(e.chatId,"chat");e.action instanceof ie.Api.SendMessageEmojiInteraction?zs({"@type":"updateStartEmojiInteraction",id:t,emoji:e.action.emoticon,messageId:e.action.msgId,interaction:(n=JSON.parse(e.action.interaction.data),{timestamps:n.a.map((e=>{let{t}=e;return t}))})}):zs({"@type":"updateChatTypingStatus",id:t,typingStatus:dn(e)})}else if(e instanceof ie.Api.UpdateChannelUserTyping){const t=ce(e.channelId,"channel");zs({"@type":"updateChatTypingStatus",id:t,threadId:e.topMsgId,typingStatus:dn(e)})}else if(e instanceof ie.Api.UpdateChannel){const{_entities:t}=e;if(!t)return;const n=t.find((e=>e instanceof ie.Api.Channel||e instanceof ie.Api.ChannelForbidden));if(n instanceof ie.Api.Channel){const t=en(n);t&&(zs({"@type":"updateChat",id:t.id,chat:t}),zs({"@type":t.isNotJoined?"updateChatLeave":"updateChatJoin",id:ce(e.channelId,"channel")}))}else if(n instanceof ie.Api.ChannelForbidden){const t=ce(e.channelId,"channel");zs({"@type":"updateChat",id:t,chat:{isRestricted:!0}}),zs({"@type":"updateChatLeave",id:t})}else 0===t.length&&zs({"@type":"resetMessages",id:ce(e.channelId,"channel")})}else if(e instanceof ie.Api.UpdateDialogUnreadMark&&e.peer instanceof ie.Api.DialogPeer)zs({"@type":"updateChat",id:de(e.peer.peer),chat:{hasUnreadMark:e.unread}});else if(e instanceof ie.Api.UpdateChatDefaultBannedRights)zs({"@type":"updateChat",id:de(e.peer),chat:{defaultBannedRights:ge(e.defaultBannedRights)}});else if(e instanceof ie.Api.UpdateUserStatus)zs({"@type":"updateUserStatus",userId:ce(e.userId,"user"),status:Ss(e.status)});else if(e instanceof ie.Api.UpdateUser)zs({"@type":"updateRequestUserUpdate",id:ce(e.userId,"user")});else if(e instanceof ie.Api.UpdateUserEmojiStatus){const t=vs(e.emojiStatus);zs({"@type":"updateUserEmojiStatus",userId:ce(e.userId,"user"),emojiStatus:t})}else if(e instanceof ie.Api.UpdateUserName){const t=ce(e.userId,"user"),n=Ae.users[t],s=n?.mutualContact&&!n.self?Oe(e,[]):Oe(e,["firstName","lastName"]),a=rt(e);zs({"@type":"updateUser",id:t,user:{...s,usernames:a}})}else if(e instanceof ie.Api.UpdateUserPhone){const{userId:t,phone:n}=e;zs({"@type":"updateUser",id:ce(t,"user"),user:{phoneNumber:n}})}else if(e instanceof ie.Api.UpdatePeerSettings){const{_entities:t,settings:n}=e;if(!t)return;t?.length&&(t.filter((e=>e instanceof ie.Api.User&&!e.contact)).forEach((e=>{zs({"@type":"deleteContact",id:ce(e.id,"user")})})),t.filter((e=>e instanceof ie.Api.User&&e.contact)).map(ws).forEach((e=>{e&&zs({"@type":"updateUser",id:e.id,user:{...e,...n&&{settings:gn(n)}}})})))}else if(e instanceof ie.Api.UpdateNotifySettings){const{notifySettings:{showPreviews:t,silent:n,muteUntil:s},peer:{className:a}}=e,i="NotifyUsers"===a?"contact":"NotifyChats"===a?"group":"NotifyBroadcasts"===a?"broadcast":void 0;if(!i)return;zs({"@type":"updateNotifySettings",peerType:i,isSilent:Boolean(n||"number"==typeof s&&Date.now()+1e3*Ke()<1e3*s),shouldShowPreviews:Boolean(t)})}else if(e instanceof ie.Api.UpdatePeerBlocked)zs({"@type":"updatePeerBlocked",id:de(e.peerId),isBlocked:e.blocked,isBlockedFromStories:e.blockedMyStoriesFrom});else if(e instanceof ie.Api.UpdatePrivacy){const t=function(e){switch(e.className){case"PrivacyKeyPhoneNumber":return"phoneNumber";case"PrivacyKeyAddedByPhone":return"addByPhone";case"PrivacyKeyStatusTimestamp":return"lastSeen";case"PrivacyKeyProfilePhoto":return"profilePhoto";case"PrivacyKeyPhoneCall":return"phoneCall";case"PrivacyKeyPhoneP2P":return"phoneP2P";case"PrivacyKeyForwards":return"forwards";case"PrivacyKeyVoiceMessages":return"voiceMessages";case"PrivacyKeyChatInvite":return"chatInvite"}}(e.key);t&&zs({"@type":"updatePrivacy",key:t,rules:ct(e.rules)})}else if(e instanceof ie.Api.UpdateDraftMessage)zs({"@type":"draftMessage",chatId:de(e.peer),threadId:e.topMsgId,...ms(e.draft)});else if(e instanceof ie.Api.UpdateContactsReset)zs({"@type":"updateResetContactList"});else if(e instanceof ie.Api.UpdateFavedStickers)zs({"@type":"updateFavoriteStickers"});else if(e instanceof ie.Api.UpdateRecentStickers)zs({"@type":"updateRecentStickers"});else if(e instanceof ie.Api.UpdateRecentReactions)zs({"@type":"updateRecentReactions"});else if(e instanceof ie.Api.UpdateMoveStickerSetToTop)e.masks||zs({"@type":"updateMoveStickerSetToTop",isCustomEmoji:e.emojis,id:e.stickerset.toString()});else if(e instanceof ie.Api.UpdateStickerSets)zs({"@type":"updateStickerSets"});else if(e instanceof ie.Api.UpdateStickerSetsOrder)e.masks||zs({"@type":"updateStickerSetsOrder",order:e.order.map((e=>e.toString())),isCustomEmoji:e.emojis});else if(e instanceof ie.Api.UpdateNewStickerSet){if(e.stickerset instanceof ie.Api.messages.StickerSet){const t=ft(e.stickerset.set);zs({"@type":"updateStickerSet",id:t.id,stickerSet:t})}}else if(e instanceof ie.Api.UpdateSavedGifs)zs({"@type":"updateSavedGifs"});else if(e instanceof ie.Api.UpdateGroupCall){const t=e._entities;t&&(xe(t),Js(t)),zs({"@type":"updateGroupCall",call:Ft(e.call)})}else if(e instanceof ie.Api.UpdateGroupCallConnection)zs({"@type":"updateGroupCallConnection",data:JSON.parse(e.params.data),presentation:Boolean(e.presentation)});else if(e instanceof ie.Api.UpdateGroupCallParticipants){const n=e._entities;n&&(xe(n),Js(n)),zs({"@type":"updateGroupCallParticipants",groupCallId:(t=e.call,t.id.toString()),participants:e.participants.map(Dt)})}else if(e instanceof ie.Api.UpdatePendingJoinRequests){const t=e._entities;t&&(xe(t),Js(t)),zs({"@type":"updatePendingJoinRequests",chatId:de(e.peer),recentRequesterIds:e.recentRequesters.map((e=>ce(e,"user"))),requestsPending:e.requestsPending})}else if(e instanceof ie.Api.UpdatePhoneCall){const t=e._entities;t&&(xe(t),Js(t)),zs({"@type":"updatePhoneCall",call:Nt(e.phoneCall)})}else if(e instanceof ie.Api.UpdatePhoneCallSignalingData)zs({"@type":"updatePhoneCallSignalingData",callId:e.phoneCallId.toString(),data:Array.from(e.data)});else if(e instanceof ie.Api.UpdateWebViewResultSent){const{queryId:t}=e;zs({"@type":"updateWebViewResultSent",queryId:t.toString()})}else if(e instanceof ie.Api.UpdateBotMenuButton){const{botId:t,button:n}=e,s=ce(t,"user");zs({"@type":"updateBotMenuButton",botId:s,button:Ut(n)})}else if(e instanceof ie.Api.UpdateTranscribedAudio){const t=e._entities;t&&(xe(t),Js(t)),zs({"@type":"updateTranscribedAudio",transcriptionId:e.transcriptionId.toString(),text:e.text,isPending:e.pending})}else if(e instanceof ie.Api.UpdateConfig){const t=e._entities;t&&(xe(t),Js(t)),zs({"@type":"updateConfig"})}else if(e instanceof ie.Api.UpdateChannelPinnedTopic)zs({"@type":"updatePinnedTopic",chatId:ce(e.channelId,"channel"),topicId:e.topicId,isPinned:Boolean(e.pinned)});else if(e instanceof ie.Api.UpdateChannelPinnedTopics)zs({"@type":"updatePinnedTopicsOrder",chatId:ce(e.channelId,"channel"),order:e.order||[]});else if(e instanceof ie.Api.UpdateRecentEmojiStatuses)zs({"@type":"updateRecentEmojiStatuses"});else if(e instanceof ie.Api.UpdateStory){const t=e._entities;t&&(xe(t),Js(t));const{story:n}=e,s=de(e.peer);Be(n,s),n instanceof ie.Api.StoryItemDeleted?zs({"@type":"deleteStory",peerId:s,storyId:n.id}):zs({"@type":"updateStory",peerId:s,story:Fs(s,n)})}else e instanceof ie.Api.UpdateReadStories?zs({"@type":"updateReadStories",peerId:de(e.peer),lastReadId:e.maxId}):e instanceof ie.Api.UpdateSentStoryReaction?zs({"@type":"updateSentStoryReaction",peerId:de(e.peer),storyId:e.storyId,reaction:zt(e.reaction)}):e instanceof ie.Api.UpdateStoriesStealthMode?zs({"@type":"updateStealthMode",stealthMode:Hs(e.stealthMode)}):e instanceof ie.Api.UpdateAttachMenuBots?zs({"@type":"updateAttachMenuBots"}):e instanceof ie.Api.UpdateNewAuthorization?zs({"@type":"updateNewAuthorization",hash:e.hash.toString(),date:e.date,device:e.device,location:e.location,isUnconfirmed:e.unconfirmed}):c&&Ne("UNEXPECTED UPDATE","object"==typeof e&&"className"in e?e.className:e);var t,n,s,a}const Zs={PHONE_NUMBER_INVALID:"Invalid phone number.",PHONE_CODE_INVALID:"Invalid code.",PASSWORD_HASH_INVALID:"Incorrect password.",PHONE_PASSWORD_FLOOD:"Limit exceeded. Please try again later.",PHONE_NUMBER_BANNED:"This phone number is banned."},Ys={};let ea;function ta(){ea({"@type":"updateWebAuthTokenFailed"})}function na(){return ea(ca("authorizationStateWaitPhoneNumber")),new Promise(((e,t)=>{Ys.resolve=e,Ys.reject=t}))}function sa(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ea({...ca("authorizationStateWaitCode"),isCodeViaApp:e}),new Promise(((e,t)=>{Ys.resolve=e,Ys.reject=t}))}function aa(e,t){return ea({...ca("authorizationStateWaitPassword"),hint:e,noReset:t}),new Promise((e=>{Ys.resolve=e}))}function ia(){return ea(ca("authorizationStateWaitRegistration")),new Promise((e=>{Ys.resolve=e}))}function oa(e){return ea({...ca("authorizationStateWaitQrCode"),qrCode:{token:btoa(String.fromCharCode(...e.token)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),expires:e.expires}}),new Promise(((e,t)=>{Ys.reject=t}))}function ra(e){let t;if(e instanceof ie.errors.FloodWaitError){const n=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(n>1?`${n} hours`:"an hour")}else t=Zs[e.message];t||(t="Unexpected Error",c&&console.error(e)),ea({"@type":"updateAuthorizationError",message:t})}function ca(e){return{"@type":"updateAuthorizationState",authorizationState:e}}function da(e){Ys.resolve&&Ys.resolve(e)}function ua(e){Ys.resolve&&Ys.resolve(e)}function la(e){Ys.resolve&&Ys.resolve(e)}function pa(e){const{firstName:t,lastName:n}=e;Ys.resolve&&Ys.resolve([t,n])}function fa(){Ys.reject&&Ys.reject(new Error("RESTART_AUTH"))}function ga(){Ys.reject&&Ys.reject(new Error("RESTART_AUTH_WITH_QR"))}var ha=n(78742),ma=n.n(ha),_a=n(89832),ya=n(18415);class ba{constructor(e){var t,n,s;this.comparator=e,t=this,s=void 0,(n=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(n="queue"))in t?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,this.queue=[]}add(e){const t=this.binarySearch(e);this.queue.splice(t,0,e)}pop(){return this.queue.shift()}get size(){return this.queue.length}clear(){this.queue=[]}binarySearch(e){let t=0,n=this.queue.length;for(;t<n;){const s=Math.floor((t+n)/2),a=this.comparator(e,this.queue[s]);if(0===a)return s;a>0?t=s+1:n=s}return t}}const wa="0",Sa=1e3,va=500;let Aa,Ia,Ca=!1;const Pa=new Map,Ma=new ba((function(e,t){return("seqStart"in e?e.seqStart:e.seq)-("seqStart"in t?t.seqStart:t.seq)})),ka=new Map;function Ra(e){Ae.commonBoxState.seq=e.seq,Ae.commonBoxState.date=e.date,Ae.commonBoxState.pts=e.pts,Ae.commonBoxState.qts=e.qts}function Ta(e,t,n){if(e instanceof ya.UpdateConnectionState)return e.state===ya.UpdateConnectionState.connected&&Ca&&Va(),void Xs(e);if(e instanceof ya.UpdateServerTimeOffset)Xs(e);else if(void 0!==Ae.commonBoxState.seq)return e instanceof ie.Api.Updates||e instanceof ie.Api.UpdatesCombined?(t&&(e._isFromDifference=!0),void function(e,t){Ma.add(e),t||Ua()}(e,n)):"pts"in e?e instanceof ie.Api.UpdateChannelTooLong?void Ha(Fa(e)):(t&&(e._isFromDifference=!0),void function(e,t){const n=Fa(e),s=ka.get(n)||new ba(Wa);s.add(e),ka.set(n,s),t||Da(n)}(e,n)):void Xs(e)}function Ea(e,t){if(!(Ae.chats[e]instanceof ie.Api.Channel))return void(c&&console.error(`[UpdateManager] Channel ${e} not found in localDb`));const n=Ae.channelPtsById[e];n&&n<t?xa(e):Ae.channelPtsById[e]=t}function Ba(e){if("seq"in e&&e.seq&&(Ae.commonBoxState.seq=e.seq,Ae.commonBoxState.date=e.date),"qts"in e&&(Ae.commonBoxState.qts=e.qts),"pts"in e){const t=Fa(e);t!==wa?Ae.channelPtsById[t]=e.pts:Ae.commonBoxState.pts=e.pts}if(e instanceof ie.Api.UpdatesCombined||e instanceof ie.Api.Updates){const t=e.users.concat(e.chats);e.updates.forEach((e=>{t&&(e._entities=t),Ta(e)}))}else Xs(e)}function Ua(){if(!Ma.size)return;const e=Ma.pop(),t=Ae.commonBoxState.seq,n="seqStart"in e?e.seqStart:e.seq;if(0===n||e._isFromDifference&&n>=t+1)Ba(e);else if(n===t+1)clearTimeout(Ia),Ia=void 0,Ba(e);else if(n>t+1)return Ma.add(e),void Va();Ua()}function Da(e){const t=ka.get(e);if(!t?.size)return;const n=t.pop(),s=e===wa?Ae.commonBoxState.pts:Ae.channelPtsById[e],a=n.pts,i=ja(n);if(void 0!==s){if(n._isFromDifference&&a>=s+i)Ba(n);else if(a===s+i)clearTimeout(Pa.get(e)),Pa.delete(e),Ba(n);else if(a>s+i)return t.add(n),void(e===wa?Va():xa(e));Da(e)}else c&&console.error("[UpdateManager] Got pts update without local state",e)}function xa(e){if(Pa.has(e))return;const t=setTimeout((async()=>{await Ha(e),Pa.delete(e)}),va);Pa.set(e,t)}function Va(){Ia||(Ia=setTimeout((async()=>{await Na(),Ia=void 0}),va))}function Fa(e){return"channelId"in e&&"pts"in e?ce(e.channelId,"channel"):e instanceof ie.Api.UpdateNewChannelMessage||e instanceof ie.Api.UpdateEditChannelMessage?ce(e.message.peerId.channelId,"channel"):wa}async function Na(){if(!Ca)throw new Error("UpdatesManager not initialized");if(!Ae.commonBoxState?.date)return void qa();Qs({"@type":"updateFetchingDifference",isFetching:!0});const e=await Aa(new ie.Api.updates.GetDifference({pts:Ae.commonBoxState.pts,date:Ae.commonBoxState.date,qts:Ae.commonBoxState.qts}));if(!e||e instanceof ie.Api.updates.DifferenceTooLong)qa();else{if(e instanceof ie.Api.updates.DifferenceEmpty)return Ae.commonBoxState.seq=e.seq,Ae.commonBoxState.date=e.date,void Qs({"@type":"updateFetchingDifference",isFetching:!1});Ga(e),Ra(e instanceof ie.Api.updates.DifferenceSlice?e.intermediateState:e.state),e instanceof ie.Api.updates.DifferenceSlice?Na():Qs({"@type":"updateFetchingDifference",isFetching:!1})}}async function Ha(e){const t=Ae.chats[e];if(!(t&&t instanceof ie.Api.Channel&&t.accessHash&&Ae.channelPtsById[e]))return void(c&&console.error("[UpdateManager] Channel for difference not found",e,t));const n=await Aa(new ie.Api.updates.GetChannelDifference({channel:En(e,t.accessHash.toString()),pts:Ae.channelPtsById[e],filter:new ie.Api.ChannelMessagesFilterEmpty,limit:Sa}));n?n instanceof ie.Api.updates.ChannelDifferenceTooLong?qa():(Ae.channelPtsById[e]=n.pts,n instanceof ie.Api.updates.ChannelDifferenceEmpty?Da(e):(Ga(n,e),n.final||Ha(e))):c&&console.warn("[UpdatesManager] Failed to get ChannelDifference",e,t)}function qa(){Oa(),Qs({"@type":"requestSync"}),La()}function Oa(){ka.clear(),Ma.clear(),clearTimeout(Ia),Ia=void 0,Pa.forEach((e=>{clearTimeout(e)})),Pa.clear(),Ae.commonBoxState={},Object.keys(Ae.channelPtsById).forEach((e=>{Ae.channelPtsById[e]=0})),Ca=!1}async function La(){const e=await Aa(new ie.Api.updates.GetState);e&&(Ra(e),Ca=!0)}function Ga(e,t){e.newMessages.forEach((e=>{Xs(new ie.Api.UpdateNewMessage({message:e,pts:0,ptsCount:0}))})),xe(e.users),xe(e.chats),Js(e.users),Js(e.chats);const n=new Set;e.otherUpdates.forEach((e=>{const t=Fa(e);e instanceof ie.Api.UpdateChannelTooLong&&n.add(Fa(e));const s=!n.has(t);Ta(e,s,!s)})),t?Da(t):Ua()}function ja(e){return"ptsCount"in e?e.ptsCount:0}function Wa(e,t){const n=e.pts-t.pts;return 0!==n?n:ja(t)-ja(e)}const Ka=self.caches;let za;async function $a(){return!!Ka&&(za=za??await Ka.has("test").then((()=>!0)).catch((()=>!1)),za)}let Ja=function(e){return e[e.Text=0]="Text",e[e.Blob=1]="Blob",e[e.Json=2]="Json",e[e.ArrayBuffer=3]="ArrayBuffer",e}({});async function Qa(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(Ka)try{const a=r?`${d}/${t.replace(/:/g,"_")}`:new Request(t.replace(/:/g,"_")),i=await Ka.open(e),o=await i.match(a);if(!o)return;const c=o.headers.get("Content-Type");switch(n){case Ja.Text:return await o.text();case Ja.Blob:{if(t.startsWith("avatar")&&c&&c.startsWith("text"))return;const e=await o.blob(),n=!e.type||!s&&e.type.includes("html");let a=e.type||c;return n&&a?(s||(a=a.replace(/html/gi,"")),new Blob([e],{type:a})):e}case Ja.Json:return await o.json();case Ja.ArrayBuffer:return await o.arrayBuffer();default:return}}catch(e){return void console.warn(e)}}async function Xa(e,t,n){if(!Ka)return!1;try{const s="string"==typeof n||n instanceof Blob||n instanceof ArrayBuffer?n:JSON.stringify(n),a=r?`${d}/${t.replace(/:/g,"_")}`:new Request(t.replace(/:/g,"_")),i=new Response(s),o=await Ka.open(e);return await o.put(a,i),!0}catch(e){return console.warn(e),!1}}async function Za(e,t){try{if(!Ka)return;const n=await Ka.open(e);return await n.delete(t)}catch(e){return void console.warn(e)}}async function Ya(e){try{if(!Ka)return;return await Ka.delete(e)}catch(e){return void console.warn(e)}}const ei=new Set(["msg","sticker","gif","wallpaper","photo","webDocument","document","videoAvatar"]),ti=new Set(["s","m","x","y","w","a","b","c","d"]);async function ni(e,t,n){let{url:a,mediaFormat:i,start:o,end:r,isHtmlAllowed:c}=e;const{data:d,mimeType:h,fullSize:m}=await async function(e,t,n,s,a,i){const o=ai(e);if(!o)return;const{entityType:r,entityId:c,sizeType:d,params:u,mediaMatchType:l}=o;if("staticMap"===r){const e=c,n=new URLSearchParams(u),s=n.get("long"),a=n.get("lat"),i=n.get("w"),o=n.get("h"),r=n.get("zoom"),d=n.get("scale"),l=n.get("accuracy_radius");return{mimeType:"image/png",data:await t.downloadStaticMap(e,s,a,i,o,r,d,l)}}let p;switch(r){case"channel":case"chat":p=Ae.chats[c];break;case"user":p=Ae.users[c];break;case"msg":p=Ae.messages[c];break;case"sticker":case"gif":case"wallpaper":case"document":p=Ae.documents[c];break;case"videoAvatar":case"photo":p=Ae.photos[c];break;case"stickerSet":p=Ae.stickerSets[c];break;case"webDocument":p=Ae.webDocuments[c]}if(p){if(ei.has(r)){const e=await t.downloadMedia(p,{sizeType:d,start:s,end:a,progressCallback:n,workers:g});let o,c;return p instanceof ie.Api.MessageService&&p.action instanceof ie.Api.MessageActionSuggestProfilePhoto?o="image/jpeg":p instanceof ie.Api.Message?(o=function(e,t){if(e&&e.media){if(e.media instanceof ie.Api.MessageMediaPhoto)return"image/jpeg";if(e.media instanceof ie.Api.MessageMediaGeo||e.media instanceof ie.Api.MessageMediaVenue||e.media instanceof ie.Api.MessageMediaGeoLive)return"image/png";if(e.media instanceof ie.Api.MessageMediaDocument){const n=e.media.document;if(n instanceof ie.Api.Document)return t?n.attributes.some((e=>e instanceof ie.Api.DocumentAttributeSticker))?"image/webp":"image/jpeg":n.mimeType}return e.media instanceof ie.Api.MessageMediaWebPage&&e.media.webpage instanceof ie.Api.WebPage&&e.media.webpage.document instanceof ie.Api.Document?t?"image/jpeg":e.media.webpage.document.mimeType:void 0}}(p,d),p.media instanceof ie.Api.MessageMediaDocument&&p.media.document instanceof ie.Api.Document&&(c=p.media.document.size.toJSNumber()),p.media instanceof ie.Api.MessageMediaWebPage&&p.media.webpage instanceof ie.Api.WebPage&&p.media.webpage.document instanceof ie.Api.Document&&(c=p.media.webpage.document.size.toJSNumber())):p instanceof ie.Api.Photo?o="videoAvatar"===r?"video/mp4":"image/jpeg":"sticker"===r&&d?o="image/webp":"webDocument"===r?(o=p.mimeType,c=p.size):(o=ti.has(d||"")?"image/jpeg":p.mimeType,c=p.size.toJSNumber()),!i&&o&&(o=o.replace(/html/gi,"")),{mimeType:o,data:e,fullSize:c}}if("stickerSet"===r){const e=await t.downloadStickerSetThumb(p);return{mimeType:si(e),data:e}}{const e=await t.downloadProfilePhoto(p,"profile"===l);return{mimeType:si(e),data:e}}}}(a,t,n,o,r,c)||{};if(!d)return;const _=await async function(e,t,n){switch(t){case Ze.BlobUrl:return new Blob([e],{type:n});case Ze.Text:return e.toString();case Ze.Progressive:case Ze.DownloadUrl:return e.buffer}}(d,i,h);if(!_)return;const y=i!==Ze.Progressive&&(i!==Ze.BlobUrl||_.size<=f);return!u&&s&&y&&Xa(a.startsWith("avatar")?p:l,a,_),{dataBlob:i===Ze.Progressive?"":_,arrayBuffer:i===Ze.Progressive?_:void 0,mimeType:h,fullSize:m}}function si(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/jpeg";if(e.length<4)return t;let n=t;switch(e.subarray(0,4).reduce(((e,t)=>e+t.toString(16)),"")){case"89504e47":n="image/png";break;case"47494638":n="image/gif";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":n="image/jpeg";break;case"52494646":n="image/webp"}return n}function ai(e){const t=e.startsWith("staticMap")?e.match(/(staticMap):([0-9-]+)(\?.+)/):e.startsWith("webDocument")?e.match(/(webDocument):(.+)/):e.match(/(avatar|profile|photo|msg|stickerSet|sticker|wallpaper|gif|document|videoAvatar)([-\d\w./]+)(?::\d+)?(\?size=\w+)?/);if(!t)return;const n=t[1],s=t[2];let a;const i=t[3],o=i?.replace("?size=","")||void 0;return a="avatar"===t[1]||"profile"===t[1]?Mn(s):t[1],{mediaMatchType:n,entityType:a,entityId:s,sizeType:o,params:i}}class ii extends AbortController{constructor(){var e,t,n;super(...arguments),e=this,t="threads",n=new Map,(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}getThreadSignal(e){let t=this.threads.get(e);return t||(t=new AbortController,this.threads.set(e,t)),t.signal}abortThread(e,t){this.threads.get(e)?.abort(t),this.threads.delete(e)}abort(e){super.abort(e),this.threads.forEach((t=>t.abort(e))),this.threads.clear()}}const oi="Unknown UserAgent",ri="Unknown platform";_a.Logger.setLevel("warn");const ci={build:e=>e},di=new Map,ui=new Map;let li,pi,fi;function gi(e){let{isPremium:t}=e;pi.setIsPremium(t)}const hi=2500;async function mi(){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&pi.isConnected()&&await Promise.race([wi(new ie.Api.auth.LogOut),ne(hi)]),e||(Object.assign(ve,Se()),Oa()),await pi.destroy()}async function _i(){await pi.disconnect()}function yi(e){li({"@type":"updateSession",sessionData:e})}function bi(e){Ta(e),e instanceof ie.Api.UpdatesTooLong?async function(){try{await wi(new ie.Api.users.GetFullUser({id:new ie.Api.InputUserSelf}),{shouldThrow:!0})}catch(e){"AUTH_KEY_UNREGISTERED"!==e.message&&"SESSION_REVOKED"!==e.message||li({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}}():("updates"in e?e.updates:[e]).forEach((e=>{if(!(e instanceof ie.Api.UpdateConfig))return;const t=e._entities?.find((e=>e instanceof ie.Api.User&&ce(e.id,"user")===fi));t instanceof ie.Api.User&&gi({isPremium:Boolean(t.premium)})}))}async function wi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{shouldThrow:n,shouldIgnoreUpdates:s,dcId:a,shouldIgnoreErrors:i,abortControllerChatId:o,abortControllerThreadId:r,shouldRetryOnTimeout:d,abortControllerGroup:u}=t,l=Boolean(t.shouldReturnTrue);let p;if(o){let e=di.get(o);e||(e=new ii,di.set(o,e)),p=r?e.getThreadSignal(r):e.signal}if(u){let e=ui.get(u);e||(e=new AbortController,ui.set(u,e)),p=e.signal}try{c&&Ne("INVOKE",e.className);const t=await pi.invoke(e,a,p,d);return c&&Ne("RESPONSE",e.className,t),!s&&function(e){return e instanceof ie.Api.UpdatesTooLong||e instanceof ie.Api.UpdateShortMessage||e instanceof ie.Api.UpdateShortChatMessage||e instanceof ie.Api.UpdateShort||e instanceof ie.Api.UpdatesCombined||e instanceof ie.Api.Updates||e instanceof ie.Api.UpdateShortSentMessage}(t)&&Ta(t),l?t&&!0:t}catch(t){if(i)return;if(c&&(Ne("INVOKE ERROR",e.className),console.debug("invokeRequest failed with payload",e),console.error(t)),n)throw t;return void function(e,t){const n=e.message.startsWith("A wait of")&&(t instanceof ie.Api.messages.SendMessage||t instanceof ie.Api.messages.SendMedia||t instanceof ie.Api.messages.SendMultiMedia),{message:s}=e;li({"@type":"error",error:{message:s,isSlowMode:n,hasErrorKey:!0}})}(t,e)}}function Si(e,t){c&&Ne("BEACON",e.className),pi.invokeBeacon(e,t)}async function vi(e,t){try{return await ni(e,pi,t)}catch(n){if(n.message.startsWith("FILE_REFERENCE")){if(await ki({url:e.url}))return ni(e,pi,t);c&&console.error("Failed to repair file reference",e.url)}throw n}}function Ai(e,t){return pi.uploadFile({file:e,onProgress:t,workers:h})}function Ii(e){return pi.updateTwoFaSettings(e)}function Ci(e){const{chatId:t,threadId:n}=e,s=di.get(t);if(!n)return s?.abort("Chat change"),void di.delete(t);s?.abortThread(n,"Thread change")}function Pi(e){ui.get(e)?.abort(),ui.delete(e)}async function Mi(){const e=await wi(new ie.Api.users.GetFullUser({id:new ie.Api.InputUserSelf}));if(!(e&&e.users[0]instanceof ie.Api.User))return;const t=e.users[0];t.photo instanceof ie.Api.Photo&&(Ae.photos[t.photo.id.toString()]=t.photo),De(t);const n=bs(e),s=ws(t);var a;a=s.id,us=a,function(e,t){ea({"@type":"updateCurrentUser",currentUser:e,currentUserFullInfo:t})}(s,n),fi=s.id,gi({isPremium:Boolean(s.isPremium)})}async function ki(e){let{url:t}=e;const n=ai(t);if(!n)return;const{entityType:s,entityId:a,mediaMatchType:i}=n;if("document"===i||"photo"===i){const e="document"===i?Ae.documents[a]:Ae.photos[a];if(!e.storyData)return!1;const t=Tn(e.storyData.peerId);if(!t)return!1;const n=await wi(new ie.Api.stories.GetStoriesByID({peer:t,id:[e.storyData.id]}));return!!n&&(xe(n.users),n.stories.forEach((t=>Be(t,e.storyData.peerId))),!0)}if("msg"===s){const e=Ae.messages[a],t=e.id,n="channelId"in e.peerId?new ie.Api.InputChannel({channelId:e.peerId.channelId,accessHash:Ae.chats[ce(e.peerId.channelId,"channel")].accessHash}):void 0,s=await wi(n?new ie.Api.channels.GetMessages({channel:n,id:[new ie.Api.InputMessageID({id:t})]}):new ie.Api.messages.GetMessages({id:[new ie.Api.InputMessageID({id:t})]}));if(!s||s instanceof ie.Api.messages.MessagesNotModified)return!1;n&&"pts"in s&&Ea(ce(n.channelId,"channel"),s.pts);const i=s.messages[0];return!(i instanceof ie.Api.MessageEmpty||(xe(s.users),xe(s.chats),Ee(i),0))}return!1}function Ri(e){pi.setForceHttpTransport(e)}function Ti(e){pi.setAllowHttpTransport(e)}function Ei(e){pi.setShouldDebugExportedSenders(e)}function Bi(e){xa(e)}let Ui;async function Di(e){let{chatId:t,accessHash:n,messageId:s,data:a,isGame:i}=e;const o=await wi(new ie.Api.messages.GetBotCallbackAnswer({peer:Rn(t,n),msgId:s,data:a?Fe(a):void 0,game:i||void 0}));return o?ge(o):void 0}async function xi(){const e=await wi(new ie.Api.contacts.GetTopPeers({botsInline:!0}));if(!(e instanceof ie.Api.contacts.TopPeers))return;const t=e.users.map(ws).filter(Boolean);return{ids:t.map((e=>{let{id:t}=e;return t})),users:t}}async function Vi(e){let{username:t}=e;const n=await wi(new ie.Api.contacts.ResolveUsername({username:t}));if(n&&n.users[0]instanceof ie.Api.User&&n.users[0].bot&&n.users[0].botInlinePlaceholder)return De(n.users[0]),{user:ws(n.users[0]),chat:en(n.users[0])}}async function Fi(e){let{bot:t,chat:n,query:s,offset:a=""}=e;const i=await wi(new ie.Api.messages.GetInlineBotResults({bot:Rn(t.id,t.accessHash),peer:Rn(n.id,n.accessHash),query:s,offset:a}));var o,r,c,d,u,l;if(i)return xe(i.users),{isGallery:Boolean(i.gallery),help:t.botPlaceholder,nextOffset:(u=t.usernames[0].username,l=i.nextOffset,"gif"===u&&"0"===l?"":l),switchPm:(d=i.switchPm,d?Oe(d,["text","startParam"]):void 0),switchWebview:(c=i.switchWebview,c?Oe(c,["text","url"]):void 0),users:i.users.map(ws).filter(Boolean),results:(o=String(i.queryId),r=i.results,r.map((e=>{return e instanceof ie.Api.BotInlineMediaResult?(e.document instanceof ie.Api.Document&&(t=e.document,Ae.documents[String(t.id)]=t),e.photo instanceof ie.Api.Photo&&(n=e.photo,Ae.photos[String(n.id)]=n),function(e,t){const{id:n,type:s,title:a,description:i,photo:o,document:r}=e;return{id:n,queryId:t,type:s,title:a,description:i,..."sticker"===s&&r instanceof ie.Api.Document&&{sticker:pt(r)},...o instanceof ie.Api.Photo&&{photo:at(o)},..."gif"===s&&r instanceof ie.Api.Document&&{gif:wt(r)},..."video"===s&&r instanceof ie.Api.Document&&{thumbnail:nt(r.thumbs)}}}(e,o)):(e.thumb&&(s=e.thumb,Ae.webDocuments[s.url]=s),function(e,t){const{id:n,type:s,title:a,description:i,url:o,thumb:r}=e;return{id:n,queryId:t,type:s,title:a,description:i,url:o,webThumbnail:kt(r)}}(e,o));var t,n,s}))),cacheTime:i.cacheTime}}async function Ni(e){let{chat:t,replyingToTopId:n,resultId:s,queryId:a,replyingTo:i,sendAs:o,isSilent:r,scheduleDate:c}=e;const d=Vn();await wi(new ie.Api.messages.SendInlineBotResult({clearDraft:!0,randomId:d,queryId:le()(a),peer:Rn(t.id,t.accessHash),id:s,scheduleDate:c,...n&&{topMsgId:n},...r&&{silent:!0},...i&&{replyToMsgId:i},...o&&{sendAs:Rn(o.id,o.accessHash)}}))}async function Hi(e){let{bot:t,startParam:n}=e;const s=Vn();await wi(new ie.Api.messages.StartBot({bot:Rn(t.id,t.accessHash),peer:Rn(t.id,t.accessHash),randomId:s,startParam:n}))}async function qi(e){let{isSilent:t,peer:n,bot:s,url:a,startParam:i,replyToMessageId:o,threadId:r,theme:c,sendAs:d,isFromBotMenu:u}=e;const l=await wi(new ie.Api.messages.RequestWebView({silent:t||void 0,peer:Rn(n.id,n.accessHash),bot:Rn(s.id,s.accessHash),url:a,startParam:i,themeParams:c?$n(c):void 0,fromBotMenu:u||void 0,platform:O,...o&&{replyTo:ss(o,r)},...d&&{sendAs:Rn(d.id,d.accessHash)}}));if(l instanceof ie.Api.WebViewResultUrl)return{url:l.url,queryId:l.queryId.toString()}}async function Oi(e){let{bot:t,url:n,theme:s,startParam:a,isFromSwitchWebView:i,isFromSideMenu:o}=e;const r=await wi(new ie.Api.messages.RequestSimpleWebView({url:n,bot:Rn(t.id,t.accessHash),themeParams:s?$n(s):void 0,platform:O,startParam:a,fromSwitchWebview:i||void 0,fromSideMenu:o||void 0}));return r?.url}async function Li(e){let{bot:t,appName:n}=e;const s=await wi(new ie.Api.messages.GetBotApp({app:new ie.Api.InputBotAppShortName({botId:En(t.id,t.accessHash),shortName:n})}));if(s&&!(s instanceof ie.Api.BotAppNotModified))return function(e){const{app:t,inactive:n,requestWriteAccess:s}=e;if(t instanceof ie.Api.BotAppNotModified)return;const{id:a,accessHash:i,title:o,description:r,shortName:c,photo:d,document:u}=t,l=d instanceof ie.Api.Photo?at(d):void 0,p=u instanceof ie.Api.Document?St(u):void 0;return{id:a.toString(),accessHash:i.toString(),title:o,description:r,shortName:c,photo:l,document:p,isInactive:n,shouldRequestWriteAccess:s}}(s)}async function Gi(e){let{peer:t,app:n,startParam:s,theme:a,isWriteAllowed:i}=e;const o=await wi(new ie.Api.messages.RequestAppWebView({peer:Rn(t.id,t.accessHash),app:ns(n),startParam:s,themeParams:a?$n(a):void 0,platform:O,writeAllowed:i||void 0}));return o?.url}function ji(e){let{isSilent:t,peer:n,bot:s,queryId:a,replyToMessageId:i,threadId:o,sendAs:r}=e;return wi(new ie.Api.messages.ProlongWebView({silent:t||void 0,peer:Rn(n.id,n.accessHash),bot:Rn(s.id,s.accessHash),queryId:le()(a),...i&&{replyTo:ss(i,o)},...r&&{sendAs:Rn(r.id,r.accessHash)}}))}async function Wi(e){let{bot:t,buttonText:n,data:s}=e;const a=Vn();await wi(new ie.Api.messages.SendWebViewData({bot:Rn(t.id,t.accessHash),buttonText:n,data:s,randomId:a}))}async function Ki(e){let{hash:t}=e;const n=await wi(new ie.Api.messages.GetAttachMenuBots({hash:t?le()(t):void 0}));if(n instanceof ie.Api.AttachMenuBots)return xe(n.users),{hash:n.hash.toString(),bots:He(n.bots.map(Rt),"id"),users:n.users.map(ws).filter(Boolean)}}async function zi(e){let{bot:t}=e;const n=await wi(new ie.Api.messages.GetAttachMenuBot({bot:Rn(t.id,t.accessHash)}));if(n instanceof ie.Api.AttachMenuBotsBot)return xe(n.users),{bot:Rt(n.bot),users:n.users.map(ws).filter(Boolean)}}function $i(e){let{bot:t,isWriteAllowed:n,isEnabled:s}=e;return wi(new ie.Api.messages.ToggleBotInAttachMenu({bot:Rn(t.id,t.accessHash),writeAllowed:n||void 0,enabled:s}))}async function Ji(e){let{chat:t,buttonId:n,messageId:s}=e;const a=await wi(new ie.Api.messages.RequestUrlAuth({peer:Rn(t.id,t.accessHash),buttonId:n,msgId:s}));if(!a)return;const i=Ts(a);return"request"===i?.type&&Ui({"@type":"updateUser",id:i.bot.id,user:i.bot}),i}async function Qi(e){let{chat:t,messageId:n,buttonId:s,isWriteAllowed:a}=e;const i=await wi(new ie.Api.messages.AcceptUrlAuth({peer:Rn(t.id,t.accessHash),msgId:n,buttonId:s,writeAllowed:a||void 0}));if(!i)return;const o=Ts(i);return"request"===o?.type&&Ui({"@type":"updateUser",id:o.bot.id,user:o.bot}),o}async function Xi(e){let{url:t}=e;const n=await wi(new ie.Api.messages.RequestUrlAuth({url:t}));if(!n)return;const s=Ts(n);return"request"===s?.type&&Ui({"@type":"updateUser",id:s.bot.id,user:s.bot}),s}async function Zi(e){let{url:t,isWriteAllowed:n}=e;const s=await wi(new ie.Api.messages.AcceptUrlAuth({url:t,writeAllowed:n||void 0}));if(!s)return;const a=Ts(s);return"request"===a?.type&&Ui({"@type":"updateUser",id:a.bot.id,user:a.bot}),a}function Yi(e){let{bot:t}=e;return wi(new ie.Api.bots.CanSendMessage({bot:En(t.id,t.accessHash)}))}function eo(e){let{bot:t}=e;return wi(new ie.Api.bots.AllowSendMessage({bot:En(t.id,t.accessHash)}),{shouldReturnTrue:!0})}async function to(e){let{bot:t,customMethod:n,parameters:s}=e;try{const e=await wi(new ie.Api.bots.InvokeWebViewCustomMethod({bot:Rn(t.id,t.accessHash),params:new ie.Api.DataJSON({data:s}),customMethod:n}),{shouldThrow:!0});return{result:JSON.parse(e.data)}}catch(e){return{error:e.message}}}var no=n(48764).lW;let so,ao;async function io(e){let{call:t}=e;const n=await wi(new ie.Api.phone.GetGroupCall({call:Qn(t)}));if(!n)return;xe(n.users),xe(n.chats);const s=n.users.map(ws).filter(Boolean),a=n.chats.map((e=>en(e))).filter(Boolean);return{groupCall:Ft(n.call),users:s,chats:a}}function oo(e){let{call:t}=e;return wi(new ie.Api.phone.DiscardGroupCall({call:Qn(t)}),{shouldReturnTrue:!0})}function ro(e){let{call:t,participant:n,muted:s,presentationPaused:a,videoStopped:i,videoPaused:o,volume:r,raiseHand:c}=e;return wi(new ie.Api.phone.EditGroupCallParticipant({call:Qn(t),participant:Rn(n.id,n.accessHash),...void 0!==i&&{videoStopped:i},...void 0!==o&&{videoPaused:o},...void 0!==s&&{muted:s},...void 0!==a&&{presentationPaused:a},...void 0!==c&&{raiseHand:c},...void 0!==r&&{volume:r}}),{shouldReturnTrue:!0})}function co(e){let{groupCall:t,title:n}=e;return wi(new ie.Api.phone.EditGroupCallTitle({title:n,call:Qn(t)}),{shouldReturnTrue:!0})}async function uo(e){let{call:t,canSelfUnmute:n}=e;const s=await wi(new ie.Api.phone.ExportGroupCallInvite({canSelfUnmute:n||void 0,call:Qn(t)}));if(s)return s.link}async function lo(e){let{call:t,offset:n}=e;const s=await wi(new ie.Api.phone.GetGroupParticipants({call:Qn(t),ids:[],sources:[],offset:n||"",limit:S}));if(!s)return;xe(s.users),xe(s.chats);const a=s.users.map(ws).filter(Boolean),i=s.chats.map((e=>en(e))).filter(Boolean);return so({"@type":"updateGroupCallParticipants",groupCallId:t.id,participants:s.participants.map(Dt),nextOffset:s.nextOffset}),{users:a,chats:i}}function po(e){let{call:t,isPageUnload:n}=e;const s=new ie.Api.phone.LeaveGroupCall({call:Qn(t)});n?Si(s):wi(s,{shouldReturnTrue:!0})}async function fo(e){let{call:t,inviteHash:n,params:s}=e;const a=await wi(new ie.Api.phone.JoinGroupCall({call:Qn(t),joinAs:new ie.Api.InputPeerSelf,muted:!0,videoStopped:!0,params:new ie.Api.DataJSON({data:JSON.stringify(s)}),inviteHash:n}),{shouldRetryOnTimeout:!0,abortControllerGroup:"call"});if(a&&a instanceof ie.Api.Updates){const e=a.updates.find((e=>e instanceof ie.Api.UpdateGroupCall));if(!(e instanceof ie.Api.UpdateGroupCall))return;return Ft(e.call)}}async function go(e){let{peer:t}=e;const n=Fn(),s=await wi(new ie.Api.phone.CreateGroupCall({peer:Rn(t.id,t.accessHash),randomId:n}));if(s&&s instanceof ie.Api.Updates){const e=s.updates[0];if(e instanceof ie.Api.UpdateGroupCall)return Ft(e.call)}}function ho(e){let{call:t,params:n}=e;return wi(new ie.Api.phone.JoinGroupCallPresentation({call:Qn(t),params:new ie.Api.DataJSON({data:JSON.stringify(n)})}),{shouldReturnTrue:!0})}function mo(e){let{call:t,subscribed:n}=e;return wi(new ie.Api.phone.ToggleGroupCallStartSubscription({call:Qn(t),subscribed:n}),{shouldReturnTrue:!0,shouldIgnoreErrors:!0})}function _o(e){let{call:t}=e;return wi(new ie.Api.phone.LeaveGroupCallPresentation({call:Qn(t)}),{shouldReturnTrue:!0})}async function yo(){const e=await wi(new ie.Api.messages.GetDhConfig({}));if(e&&!(e instanceof ie.Api.messages.DhConfigNotModified))return{g:e.g,p:Array.from(e.p),random:Array.from(e.random)}}function bo(e){let{call:t,isBusy:n,isPageUnload:s}=e;const a=new ie.Api.phone.DiscardCall({peer:Xn(t),reason:n?new ie.Api.PhoneCallDiscardReasonBusy:new ie.Api.PhoneCallDiscardReasonHangup});s?Si(a):wi(a,{shouldReturnTrue:!0})}async function wo(e){let{user:t,gAHash:n,isVideo:s}=e;const a=await wi(new ie.Api.phone.RequestCall({randomId:Fn(),userId:Rn(t.id,t.accessHash),gAHash:no.from(n),...s&&{video:!0},protocol:Lt()}));if(!a)return;const i=Nt(a.phoneCall);return so({"@type":"updatePhoneCall",call:i}),xe(a.users),{users:a.users.map(ws).filter(Boolean)}}function So(e){let{call:t,rating:n,comment:s}=e;return wi(new ie.Api.phone.SetCallRating({rating:n,peer:Xn(t),comment:s}),{shouldReturnTrue:!0})}function vo(e){let{call:t}=e;return wi(new ie.Api.phone.ReceivedCall({peer:Xn(t)}))}async function Ao(e){let{call:t,gB:n}=e;const s=await wi(new ie.Api.phone.AcceptCall({peer:Xn(t),gB:no.from(n),protocol:Lt()}));if(s)return t=Nt(s.phoneCall),so({"@type":"updatePhoneCall",call:t}),xe(s.users),{users:s.users.map(ws).filter(Boolean)}}async function Io(e){let{call:t,gA:n,keyFingerprint:s}=e;const a=await wi(new ie.Api.phone.ConfirmCall({peer:Xn(t),gA:no.from(n),keyFingerprint:le()(s),protocol:Lt()}));if(a)return t=Nt(a.phoneCall),so({"@type":"updatePhoneCall",call:t}),xe(a.users),{users:a.users.map(ws).filter(Boolean)}}function Co(e){let{data:t,call:n}=e;return wi(new ie.Api.phone.SendSignalingData({data:no.from(t),peer:Xn(n)}))}async function Po(e){let{limit:t,offsetDate:n,archived:s,withPinned:a,lastLocalServiceMessage:i}=e;const o=await wi(new ie.Api.messages.GetDialogs({offsetPeer:new ie.Api.InputPeerEmpty,limit:t,offsetDate:n,folderId:s?K:void 0,...a&&{excludePinned:!0}})),r=a?await wi(new ie.Api.messages.GetPinnedDialogs({folderId:s?K:void 0})):void 0;if(!o||o instanceof ie.Api.messages.DialogsNotModified)return;r&&yr(r),yr(o);const c=He((r?r.messages:[]).concat(o.messages).map(gs).filter(Boolean),"chatId"),d=_r(o);r&&Object.assign(d,_r(r,d));const u=[],l={},p={},f=(r?r.dialogs:[]).concat(o.dialogs),g=[];f.forEach((e=>{if(!(e instanceof ie.Api.Dialog)||!s&&e.folderId===K||s&&e.folderId!==K)return;const t=Qt(e,d[nn(e.peer)]);if(e.pts&&Ea(t.id,e.pts),t.id===L&&i&&(!c[t.id]||i.date>c[t.id].date)?t.lastMessage=i:t.lastMessage=c[t.id],t.isListed=!0,u.push(t),Ws(t.id,t.muteUntil,ao),a&&e.pinned&&g.push(t.id),e.draft){const{formattedText:n,replyingToId:s}=ms(e.draft)||{};n&&(l[t.id]=n),s&&(p[t.id]=s)}}));const h=u.map((e=>e.id)),{users:m,userStatusesById:_}=As((r?.users||[]).concat(o.users));let y;return y=o instanceof ie.Api.messages.DialogsSlice?o.count:h.length,{chatIds:h,chats:u,users:m,userStatusesById:_,draftsById:l,replyingToById:p,orderedPinnedIds:a?g:void 0,totalChatCount:y}}function Mo(e){const{id:t,accessHash:n,adminRights:s}=e;return En(t,n)instanceof ie.Api.InputChannel?async function(e,t,n){const s=await wi(new ie.Api.channels.GetFullChannel({channel:En(e,t)}));if(!(s&&s.fullChat instanceof ie.Api.ChannelFull))return;const{about:a,onlineCount:i,exportedInvite:o,slowmodeSeconds:r,slowmodeNextSendDate:c,migratedFromChatId:d,migratedFromMaxId:u,canViewParticipants:l,canViewStats:p,linkedChatId:f,hiddenPrehistory:g,call:h,botInfo:m,availableReactions:_,defaultSendAs:y,requestsPending:b,recentRequesters:w,statsDc:S,participantsCount:v,stickerset:A,chatPhoto:I,participantsHidden:C,translationsDisabled:P,storiesPinnedAvailable:M}=s.fullChat;I instanceof ie.Api.Photo&&(Ae.photos[I.id.toString()]=I);const k=o instanceof ie.Api.ChatInviteExported?o.link:void 0,{members:R,users:T,userStatusesById:E}=l&&await cr(e,t)||{},{members:B,users:U,userStatusesById:D}=l&&n&&await cr(e,t,"kicked")||{},{members:x,users:V,userStatusesById:F}=l&&await cr(e,t,"admin")||{},N=m?pn(m):void 0;if(s?.chats?.length>1){yr(s);const[,e]=s.chats,t=en(e);t&&ao({"@type":"updateChat",id:t.id,chat:t})}s.fullChat.pts&&Ea(e,s.fullChat.pts);const H={...E,...D,...F};return{fullInfo:{...I instanceof ie.Api.Photo&&{profilePhoto:at(I)},about:a,onlineCount:i,inviteLink:k,slowMode:r?{seconds:r,nextSendDate:c}:void 0,migratedFrom:d?{chatId:ce(d,"chat"),maxMessageId:u}:void 0,canViewMembers:l,canViewStatistics:p,isPreHistoryHidden:g,members:R,kickedMembers:B,adminMembersById:x?He(x,"userId"):void 0,groupCallId:h?String(h.id):void 0,linkedChatId:f?ce(f,"chat"):void 0,botCommands:N,enabledReactions:hn(_),sendAsId:y?de(y):void 0,requestsPending:b,recentRequesterIds:w?.map((e=>ce(e,"user"))),statisticsDcId:S,stickerSet:A?ft(A):void 0,areParticipantsHidden:C,isTranslationDisabled:P,hasPinnedStories:Boolean(M)},users:[...T||[],...U||[],...V||[]],userStatusesById:H,groupCall:h?{chatId:e,isLoaded:!1,id:h.id.toString(),accessHash:h?.accessHash.toString(),participants:{},version:0,participantsCount:0,connectionState:"disconnected"}:void 0,membersCount:v}}(t,n,s):async function(e){const t=await wi(new ie.Api.messages.GetFullChat({chatId:En(e)}));if(!(t&&t.fullChat instanceof ie.Api.ChatFull))return;yr(t);const{about:n,participants:s,exportedInvite:a,botInfo:i,call:o,availableReactions:r,recentRequesters:c,requestsPending:d,chatPhoto:u,translationsDisabled:l}=t.fullChat;u instanceof ie.Api.Photo&&(Ae.photos[u.id.toString()]=u);const p=cn(s),f=p?p.filter((e=>{let{isAdmin:t,isOwner:n}=e;return t||n})):void 0,g=i?pn(i):void 0,h=a instanceof ie.Api.ChatInviteExported?a.link:void 0,{users:m,userStatusesById:_}=As(t.users);return{fullInfo:{...u instanceof ie.Api.Photo&&{profilePhoto:at(u)},about:n,members:p,adminMembersById:f?He(f,"userId"):void 0,canViewMembers:!0,botCommands:g,inviteLink:h,groupCallId:o?.id.toString(),enabledReactions:hn(r),requestsPending:d,recentRequesterIds:c?.map((e=>ce(e,"user"))),isTranslationDisabled:l},users:m,userStatusesById:_,groupCall:o?{chatId:e,isLoaded:!1,id:o.id.toString(),accessHash:o.accessHash.toString(),connectionState:"disconnected",participantsCount:0,version:0,participants:{}}:void 0,membersCount:p?.length}}(t)}async function ko(e){const{id:t,accessHash:n}=e,s=await wi(new ie.Api.messages.GetPeerSettings({peer:Rn(t,n)}),{abortControllerChatId:t});if(s)return xe(s.users),{users:s.users.map(ws).filter(Boolean),settings:gn(s.settings)}}async function Ro(e){let{query:t}=e;const n=await wi(new ie.Api.contacts.Search({q:t}));if(!n)return;yr(n);const s=n.myResults.map(de),a=n.chats.concat(n.users).map((e=>en(e))).filter(Boolean),i=n.users.map(ws).filter((e=>Boolean(e)&&!e.isSelf));return{localChats:a.filter((e=>s.includes(e.id))),localUsers:i.filter((e=>s.includes(e.id))),globalChats:a.filter((e=>!s.includes(e.id))),globalUsers:i.filter((e=>!s.includes(e.id)))}}async function To(e){let t,{type:n,user:s}=e;if("self"===n||"user"===n){const e=await wi(new ie.Api.users.GetUsers({id:["user"===n&&s?En(s.id,s.accessHash):new ie.Api.InputUserSelf]}));if(!e||!e.length)return;[t]=e}else if("support"===n){const e=await wi(new ie.Api.help.GetSupport);if(!e||!e.user)return;t=e.user}const a=en(t,"support"===n);if(a)return ao({"@type":"updateChat",id:a.id,chat:a}),{chatId:a.id}}async function Eo(e){let{chat:t,lastLocalMessage:n,noLastMessage:s}=e;const{id:a,accessHash:i}=t,o=await wi(new ie.Api.messages.GetPeerDialogs({peers:[new ie.Api.InputDialogPeer({peer:Rn(a,i)})]}));if(!o)return;const r=o.dialogs[0];if(!(r&&r instanceof ie.Api.Dialog))return;const c=_r(o)[nn(r.peer)];if(!c)return;yr(o);const d=gs(o.messages[0]),u=n&&(!d||n.date>d.date)?n:d,l={...Qt(r,c),...!s&&{lastMessage:u}};ao({"@type":"updateChat",id:a,chat:l}),Ra(o.state),Ws(l.id,l.muteUntil,ao)}function Bo(e){let{chat:t,text:n,entities:s,threadId:a,replyToMsgId:i}=e;return wi(new ie.Api.messages.SaveDraft({peer:Rn(t.id,t.accessHash),message:n,...s&&{entities:s.map(Hn)},replyToMsgId:i,topMsgId:a}))}function Uo(e,t){return wi(new ie.Api.messages.SaveDraft({peer:Rn(e.id,e.accessHash),message:"",...t&&{topMsgId:t}}))}async function Do(e){let{chat:t,isMuted:n,muteUntil:s=0}=e;n&&!s&&(s=T),await wi(new ie.Api.account.UpdateNotifySettings({peer:new ie.Api.InputNotifyPeer({peer:Rn(t.id,t.accessHash)}),settings:new ie.Api.InputPeerNotifySettings({muteUntil:s})})),ao({"@type":"updateNotifyExceptions",chatId:t.id,isMuted:n}),Eo({chat:t,noLastMessage:!0})}async function xo(e){let{chat:t,topicId:n,isMuted:s,muteUntil:a=0}=e;s&&!a&&(a=T),await wi(new ie.Api.account.UpdateNotifySettings({peer:new ie.Api.InputNotifyForumTopic({peer:Rn(t.id,t.accessHash),topMsgId:n}),settings:new ie.Api.InputPeerNotifySettings({muteUntil:a})})),ao({"@type":"updateTopicNotifyExceptions",chatId:t.id,topicId:n,isMuted:s})}async function Vo(e){let{title:t,about:n="",users:s}=e,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=await wi(new ie.Api.channels.CreateChannel({broadcast:!0,title:t,about:n}),{shouldThrow:!0});if(!(i instanceof ie.Api.Updates))return void(c&&console.error("Unexpected channel creation update",i));const o=i.chats[0];if(!(o&&o instanceof ie.Api.Channel))return void(c&&console.error("Created channel not found",i));const r=en(o);if(s?.length)try{await wi(new ie.Api.channels.InviteToChannel({channel:En(r.id,r.accessHash),users:s.map((e=>{let{id:t,accessHash:n}=e;return En(t,n)}))}),{shouldThrow:a})}catch(e){}return r}function Fo(e){let{channelId:t,accessHash:n}=e;return wi(new ie.Api.channels.JoinChannel({channel:En(t,n)}),{shouldReturnTrue:!0,shouldThrow:!0})}function No(e){let{chat:t,user:n}=e;if("chatTypeBasicGroup"===t.type)return wi(new ie.Api.messages.DeleteChatUser({chatId:En(t.id,t.accessHash),userId:En(n.id,n.accessHash)}),{shouldReturnTrue:!0})}function Ho(e){let{chatId:t}=e;return wi(new ie.Api.messages.DeleteChat({chatId:En(t)}),{shouldReturnTrue:!0})}function qo(e){let{channelId:t,accessHash:n}=e;return wi(new ie.Api.channels.LeaveChannel({channel:En(t,n)}),{shouldReturnTrue:!0})}function Oo(e){let{channelId:t,accessHash:n}=e;return wi(new ie.Api.channels.DeleteChannel({channel:En(t,n)}),{shouldReturnTrue:!0})}async function Lo(e){let{title:t,users:n}=e;const s=await wi(new ie.Api.messages.CreateChat({title:t,users:n.map((e=>{let{id:t,accessHash:n}=e;return En(t,n)}))}),{shouldThrow:!0});if(!(s instanceof ie.Api.Updates))return void(c&&console.error("Unexpected chat creation update",s));const a=s.chats[0];if(a&&a instanceof ie.Api.Chat)return en(a);c&&console.error("Created chat not found",s)}async function Go(e){let{chatId:t,accessHash:n,photo:s}=e;const a=En(t,n);let i;if(s instanceof File){const e=await Ai(s);i=new ie.Api.InputChatUploadedPhoto({file:e})}else if(s){const e=On(s);if(!e)return!1;i=new ie.Api.InputChatPhoto({id:e})}else i=new ie.Api.InputChatPhotoEmpty;return wi(a instanceof ie.Api.InputChannel?new ie.Api.channels.EditPhoto({channel:a,photo:i}):new ie.Api.messages.EditChatPhoto({chatId:a,photo:i}),{shouldReturnTrue:!0})}async function jo(e){let{chat:t,shouldBePinned:n}=e;const{id:s,accessHash:a}=t;await wi(new ie.Api.messages.ToggleDialogPin({peer:new ie.Api.InputDialogPeer({peer:Rn(s,a)}),pinned:n||void 0}))&&ao({"@type":"updateChatPinned",id:t.id,isPinned:n})}function Wo(e){let{chat:t,folderId:n}=e;const{id:s,accessHash:a}=t;return wi(new ie.Api.folders.EditPeerFolders({folderPeers:[new ie.Api.InputFolderPeer({peer:Rn(s,a),folderId:n})]}),{shouldReturnTrue:!0})}async function Ko(){const e=await wi(new ie.Api.messages.GetDialogFilters);if(!e)return;const t=e.findIndex((e=>e instanceof ie.Api.DialogFilterDefault)),n=e.filter(Te),s=n.map((e=>{let{id:t}=e;return t}));return-1!==t&&s.splice(t,0,W),{byId:He(n.map(un),"id"),orderedIds:s}}async function zo(){const e=await wi(new ie.Api.messages.GetSuggestedDialogFilters);if(e)return e.map(ln).filter(Boolean)}async function $o(e){let{id:t,folderUpdate:n}=e;n.excludedChatIds=n.excludedChatIds.filter((e=>!n.includedChatIds.includes(e)));const s=function(e){const{emoticon:t,contacts:n,nonContacts:s,groups:a,channels:i,bots:o,excludeArchived:r,excludeMuted:c,excludeRead:d,pinnedChatIds:u,includedChatIds:l,excludedChatIds:p}=e,f=u?u.map(Tn).filter(Boolean):[],g=l?l.map(Tn).filter(Boolean):[],h=p?p.map(Tn).filter(Boolean):[];return e.isChatList?new ie.Api.DialogFilterChatlist({id:e.id,title:e.title,emoticon:t||void 0,pinnedPeers:f,includePeers:g,hasMyInvites:e.hasMyInvites}):new ie.Api.DialogFilter({id:e.id,title:e.title,emoticon:t||void 0,contacts:n||void 0,nonContacts:s||void 0,groups:a||void 0,bots:o||void 0,excludeArchived:r||void 0,excludeMuted:c||void 0,excludeRead:d||void 0,broadcasts:i||void 0,pinnedPeers:f,includePeers:g,excludePeers:h})}(n);await wi(new ie.Api.messages.UpdateDialogFilter({id:t,filter:s}))&&ao({"@type":"updateChatFolder",id:t,folder:n})}async function Jo(e){const t=await wi(new ie.Api.messages.UpdateDialogFilter({id:e,filter:void 0})),n=await zo();t&&ao({"@type":"updateChatFolder",id:e,folder:void 0}),n&&ao({"@type":"updateRecommendedChatFolders",folders:n})}function Qo(e){return wi(new ie.Api.messages.UpdateDialogFiltersOrder({order:e}))}async function Xo(e){let{chat:t,hasUnreadMark:n}=e;const{id:s,accessHash:a}=t;await wi(new ie.Api.messages.MarkDialogUnread({peer:new ie.Api.InputDialogPeer({peer:Rn(s,a)}),unread:n||void 0}))&&ao({"@type":"updateChat",id:t.id,chat:{hasUnreadMark:n}})}async function Zo(e){return er(await wi(new ie.Api.contacts.ResolvePhone({phone:e})))}async function Yo(e){return er(await wi(new ie.Api.contacts.ResolveUsername({username:e})))}function er(e){if(!e)return;const{users:t,chats:n}=e,s=n.length?en(n[0]):en(t[0]);return s?(yr(e),{chat:s,user:ws(t[0])}):void 0}function tr(e){let{chat:t,isEnabled:n}=e;const{id:s,accessHash:a}=t,i=En(s,a);return wi(new ie.Api.channels.TogglePreHistoryHidden({channel:i,enabled:n}),{shouldReturnTrue:!0})}function nr(e){let{chat:t,bannedRights:n}=e;const{id:s,accessHash:a}=t,i=Rn(s,a);return wi(new ie.Api.messages.EditChatDefaultBannedRights({peer:i,bannedRights:Gn(n)}),{shouldReturnTrue:!0})}function sr(e){let{chat:t,user:n,bannedRights:s,untilDate:a}=e;const i=En(t.id,t.accessHash),o=Rn(n.id,n.accessHash);return wi(new ie.Api.channels.EditBanned({channel:i,participant:o,bannedRights:Gn(s,a)}),{shouldReturnTrue:!0})}function ar(e){let{chat:t,user:n,adminRights:s,customTitle:a=""}=e;const i=En(t.id,t.accessHash),o=En(n.id,n.accessHash);return wi(new ie.Api.channels.EditAdmin({channel:i,userId:o,adminRights:jn(s),rank:a}),{shouldReturnTrue:!0})}async function ir(e,t){const n=En(e.id,e.accessHash);await wi(n instanceof ie.Api.InputChannel?new ie.Api.channels.EditTitle({channel:n,title:t}):new ie.Api.messages.EditChatTitle({chatId:n,title:t}),{shouldReturnTrue:!0})}async function or(e,t){await wi(new ie.Api.messages.EditChatAbout({peer:Rn(e.id,e.accessHash),about:t}))&&ao({"@type":"updateChatFullInfo",id:e.id,fullInfo:{about:t}})}function rr(e){let{chat:t,isEnabled:n}=e;const{id:s,accessHash:a}=t,i=En(s,a);return wi(new ie.Api.channels.ToggleSignatures({channel:i,enabled:n}),{shouldReturnTrue:!0})}async function cr(e,t){let n,s=arguments.length>3?arguments[3]:void 0;switch(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"recent"){case"kicked":n=new ie.Api.ChannelParticipantsKicked({q:""});break;case"admin":n=new ie.Api.ChannelParticipantsAdmins;break;default:n=new ie.Api.ChannelParticipantsRecent}const a=await wi(new ie.Api.channels.GetParticipants({channel:En(e,t),filter:n,offset:s,limit:m}),{abortControllerChatId:e});if(!a||a instanceof ie.Api.channels.ChannelParticipantsNotModified)return;yr(a);const{users:i,userStatusesById:o}=As(a.users);return{members:cn(a),users:i,userStatusesById:o}}async function dr(){const e=await wi(new ie.Api.channels.GetGroupsForDiscussion);if(e)return yr(e),e.chats.map((e=>en(e)))}function ur(e){let{channel:t,chat:n}=e;return wi(new ie.Api.channels.SetDiscussionGroup({broadcast:Rn(t.id,t.accessHash),group:n?Rn(n.id,n.accessHash):new ie.Api.InputChannelEmpty}),{shouldReturnTrue:!0})}async function lr(e){const t=await wi(new ie.Api.messages.MigrateChat({chatId:En(e.id)}),{shouldThrow:!0});if(!(t&&t instanceof ie.Api.Updates))return void(c&&console.error("Unexpected channel creation update",t));yr(t);const n=t.updates.find((e=>e instanceof ie.Api.UpdateChannel)).channelId;return en(t.chats.find((e=>e instanceof ie.Api.Channel&&e.id.toString()===n.toString())))}async function pr(e){const t=await wi(new ie.Api.messages.CheckChatInvite({hash:e}));if(!t)return;let n;if(t instanceof ie.Api.ChatInvite){const{photo:n,participantsCount:s,title:a,channel:i,requestNeeded:o,about:r,megagroup:c}=t;n instanceof ie.Api.Photo&&Ue(t.photo),ao({"@type":"showInvite",data:{title:a,about:r,hash:e,participantsCount:s,isChannel:i&&!c,isRequestNeeded:o,...n instanceof ie.Api.Photo&&{photo:at(n)}}})}else n=en(t.chat),n&&ao({"@type":"updateChat",id:n.id,chat:n});return n?{chatId:n.id}:void 0}async function fr(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{return"chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?await wi(new ie.Api.channels.InviteToChannel({channel:En(e.id,e.accessHash),users:t.map((e=>En(e.id,e.accessHash)))}),{shouldReturnTrue:!0,shouldThrow:n}):await Promise.all(t.map((t=>wi(new ie.Api.messages.AddChatUser({chatId:En(e.id),userId:En(t.id,t.accessHash)}),{shouldReturnTrue:!0,shouldThrow:n}))))}catch(e){return}}function gr(e,t){return"chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?sr({chat:e,user:t,bannedRights:{viewMessages:!0,sendMessages:!0,sendMedia:!0,sendStickers:!0,sendGifs:!0,sendGames:!0,sendInline:!0,embedLinks:!0,sendPolls:!0,changeInfo:!0,inviteUsers:!0,pinMessages:!0,manageTopics:!0,sendPhotos:!0,sendVideos:!0,sendRoundvideos:!0,sendAudios:!0,sendVoices:!0,sendDocs:!0,sendPlain:!0},untilDate:T}):wi(new ie.Api.messages.DeleteChatUser({chatId:En(e.id),userId:En(t.id,t.accessHash)}),{shouldReturnTrue:!0})}function hr(e,t){return wi(new ie.Api.channels.ToggleJoinToSend({channel:En(e.id,e.accessHash),enabled:t}),{shouldReturnTrue:!0})}function mr(e,t){return wi(new ie.Api.channels.ToggleJoinRequest({channel:En(e.id,e.accessHash),enabled:t}),{shouldReturnTrue:!0})}function _r(e,t){const n={};return e.chats?.forEach((e=>{const s=`chat${e.id}`;t?.[s]&&"min"in e&&e.min||(n[s]=e)})),e.users?.forEach((e=>{const s=`user${e.id}`;t?.[s]&&"min"in e&&e.min||(n[s]=e)})),n}function yr(e){"users"in e&&xe(e.users),"chats"in e&&xe(e.chats),"messages"in e&&e.messages.forEach((e=>{e instanceof ie.Api.Message&&qn(e)&&Ee(e)}))}async function br(e){let{hash:t}=e;const n=await wi(new ie.Api.messages.ImportChatInvite({hash:t}));if(n instanceof ie.Api.Updates&&n.chats.length)return en(n.chats[0])}function wr(e){let{chat:t,enabledReactions:n}=e;return wi(new ie.Api.messages.SetChatAvailableReactions({peer:Rn(t.id,t.accessHash),availableReactions:(s=n,"all"===s?.type?new ie.Api.ChatReactionsAll({allowCustom:s.areCustomAllowed}):"some"===s?.type?new ie.Api.ChatReactionsSome({reactions:s.allowed.map(Yn)}):new ie.Api.ChatReactionsNone)}),{shouldReturnTrue:!0});var s}function Sr(e){let{chat:t,isProtected:n}=e;const{id:s,accessHash:a}=t;return wi(new ie.Api.messages.ToggleNoForwards({peer:Rn(s,a),enabled:n}),{shouldReturnTrue:!0})}function vr(e){let{chat:t,isEnabled:n}=e;const{id:s,accessHash:a}=t;return wi(new ie.Api.channels.ToggleParticipantsHidden({channel:Rn(s,a),enabled:n}),{shouldReturnTrue:!0})}function Ar(e){let{chat:t,isEnabled:n}=e;const{id:s,accessHash:a}=t;return wi(new ie.Api.channels.ToggleForum({channel:Rn(s,a),enabled:n}),{shouldReturnTrue:!0,shouldThrow:!0})}async function Ir(e){let{chat:t,title:n,iconColor:s,iconEmojiId:a,sendAs:i}=e;const{id:o,accessHash:r}=t,c=await wi(new ie.Api.channels.CreateForumTopic({channel:Rn(o,r),title:n,iconColor:s,iconEmojiId:a?le()(a):void 0,sendAs:i?Rn(i.id,i.accessHash):void 0,randomId:Vn()}));if(c instanceof ie.Api.Updates&&c.updates.length)return c.updates?.find((e=>e instanceof ie.Api.UpdateMessageID))?.id}async function Cr(e){let{chat:t,query:n,offsetTopicId:s,offsetId:a,offsetDate:i,limit:o=k}=e;const{id:r,accessHash:c}=t,d=await wi(new ie.Api.channels.GetForumTopics({channel:Rn(r,c),limit:o,q:n,offsetTopic:s,offsetId:a,offsetDate:i}));if(!d)return;yr(d);const{count:u,orderByCreateDate:l}=d;return{topics:d.topics.map(_n).filter(Boolean),messages:d.messages.map(gs).filter(Boolean),users:d.users.map(ws).filter(Boolean),chats:d.chats.map((e=>en(e))).filter(Boolean),count:u+1,shouldOrderByCreateDate:l,draftsById:d.topics.reduce(((e,t)=>(t instanceof ie.Api.ForumTopic&&t.draft&&(e[t.id]=ms(t.draft)),e)),{}),readInboxMessageIdByTopicId:d.topics.reduce(((e,t)=>(t instanceof ie.Api.ForumTopic&&t.readInboxMaxId&&(e[t.id]=t.readInboxMaxId),e)),{})}}async function Pr(e){let{chat:t,topicId:n}=e;const{id:s,accessHash:a}=t,i=await wi(new ie.Api.channels.GetForumTopicsByID({channel:Rn(s,a),topics:[n]}));if(!(i?.topics.length&&i.topics[0]instanceof ie.Api.ForumTopic))return;yr(i);const o=i.messages.map(gs).filter(Boolean),r=i.users.map(ws).filter(Boolean),c=i.chats.map((e=>en(e))).filter(Boolean);return{topic:_n(i.topics[0]),messages:o,users:r,chats:c}}function Mr(e){let{chat:t,topicId:n}=e;const{id:s,accessHash:a}=t;return wi(new ie.Api.channels.DeleteTopicHistory({channel:Rn(s,a),topMsgId:n}),{shouldReturnTrue:!0})}function kr(e){let{chat:t,topicId:n,isPinned:s}=e;const{id:a,accessHash:i}=t;return wi(new ie.Api.channels.UpdatePinnedForumTopic({channel:Rn(a,i),topicId:n,pinned:s}),{shouldReturnTrue:!0})}function Rr(e){let{chat:t,topicId:n,title:s,iconEmojiId:a,isClosed:i,isHidden:o}=e;const{id:r,accessHash:c}=t;return wi(new ie.Api.channels.EditForumTopic({channel:Rn(r,c),topicId:n,title:s,iconEmojiId:n!==J&&a?le()(a):void 0,closed:i,hidden:o}),{shouldReturnTrue:!0})}async function Tr(e){let{slug:t}=e;const n=await wi(new ie.Api.chatlists.CheckChatlistInvite({slug:t})),s=function(e,t){return e instanceof ie.Api.chatlists.ChatlistInvite?{slug:t,title:e.title,emoticon:e.emoticon,peerIds:e.peers.map(de).filter(Boolean)}:e instanceof ie.Api.chatlists.ChatlistInviteAlready?{slug:t,folderId:e.filterId,missingPeerIds:e.missingPeers.map(de).filter(Boolean),alreadyPeerIds:e.alreadyPeers.map(de).filter(Boolean)}:void 0}(n,t);if(n&&s)return yr(n),{invite:s,users:n.users.map(ws).filter(Boolean),chats:n.chats.map((e=>en(e))).filter(Boolean)}}function Er(e){let{slug:t,peers:n}=e;return wi(new ie.Api.chatlists.JoinChatlistInvite({slug:t,peers:n.map((e=>Rn(e.id,e.accessHash)))}),{shouldReturnTrue:!0,shouldThrow:!0})}async function Br(e){let{folderId:t}=e;const n=await wi(new ie.Api.chatlists.GetLeaveChatlistSuggestions({chatlist:new ie.Api.InputChatlistDialogFilter({filterId:t})}));if(n)return n.map(de)}function Ur(e){let{folderId:t,peers:n}=e;return wi(new ie.Api.chatlists.LeaveChatlist({chatlist:new ie.Api.InputChatlistDialogFilter({filterId:t}),peers:n.map((e=>Rn(e.id,e.accessHash)))}),{shouldReturnTrue:!0})}async function Dr(e){let{folderId:t,title:n,peers:s}=e;const a=await wi(new ie.Api.chatlists.ExportChatlistInvite({chatlist:new ie.Api.InputChatlistDialogFilter({filterId:t}),title:n||"",peers:s.map((e=>Rn(e.id,e.accessHash)))}),{shouldThrow:!0});if(a&&!(a.filter instanceof ie.Api.DialogFilterDefault))return{filter:un(a.filter),invite:yn(a.invite)}}function xr(e){let{folderId:t,slug:n}=e;return wi(new ie.Api.chatlists.DeleteExportedInvite({chatlist:new ie.Api.InputChatlistDialogFilter({filterId:t}),slug:n}))}async function Vr(e){let{folderId:t,slug:n,title:s,peers:a}=e;const i=await wi(new ie.Api.chatlists.EditExportedInvite({chatlist:new ie.Api.InputChatlistDialogFilter({filterId:t}),slug:n,title:s,peers:a.map((e=>Rn(e.id,e.accessHash)))}),{shouldThrow:!0});if(i)return yn(i)}async function Fr(e){let{folderId:t}=e;const n=await wi(new ie.Api.chatlists.GetExportedInvites({chatlist:new ie.Api.InputChatlistDialogFilter({filterId:t})}));if(n)return yr(n),{invites:n.invites.map(yn).filter(Boolean),users:n.users.map(ws).filter(Boolean),chats:n.chats.map((e=>en(e))).filter(Boolean)}}function Nr(e){let{chat:t,isEnabled:n}=e;return wi(new ie.Api.messages.TogglePeerTranslations({disabled:!n||void 0,peer:Rn(t.id,t.accessHash)}))}async function Hr(e){let{peer:t,reason:n,description:s}=e;return await wi(new ie.Api.account.ReportPeer({peer:Rn(t.id,t.accessHash),reason:zn(n),message:s}))}async function qr(e){let{peer:t,photo:n,reason:s,description:a}=e;const i=On(n);if(i)return await wi(new ie.Api.account.ReportProfilePhoto({peer:Rn(t.id,t.accessHash),photoId:i,reason:zn(s),message:a}))}async function Or(e){let{hash:t,areCallsEnabled:n,areSecretChatsEnabled:s,isConfirmed:a}=e;return await wi(new ie.Api.account.ChangeAuthorizationSettings({hash:le()(t),...void 0!==n?{callRequestsDisabled:!n}:void 0,...void 0!==s?{encryptedRequestsDisabled:!s}:void 0,...a&&{confirmed:a}}))}async function Lr(e){let{days:t}=e;return await wi(new ie.Api.account.SetAuthorizationTTL({authorizationTtlDays:t}))}function Gr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,n){if(n){const{type:t,...s}=n;super(e,{type:t}),Gr(this,"name",void 0),Object.assign(this,s)}else super(e),Gr(this,"name",void 0);this.name=t}});var jr=n(48764).lW;const Wr=1e3,Kr=63;let zr;async function $r(e){let{chat:t,threadId:n,offsetId:s,...a}=e;const i=n===Qe?ie.Api.messages.GetHistory:ie.Api.messages.GetReplies;let o;try{o=await wi(new i({peer:Rn(t.id,t.accessHash),...n!==Qe&&{msgId:Number(n)},...s&&{offsetId:Math.min(s,T)},...a}),{shouldThrow:!0,abortControllerChatId:t.id,abortControllerThreadId:n})}catch(e){"CHANNEL_PRIVATE"===e.message&&zr({"@type":"updateChat",id:t.id,chat:{isRestricted:!0}})}if(!o||o instanceof ie.Api.messages.MessagesNotModified||!o.messages)return;Ic(o);const r=o.messages.map(gs).filter(Boolean),c=o.users.map(ws).filter(Boolean),d=o.chats.map((e=>en(e))).filter(Boolean),u=r.map((e=>{let{repliesThreadInfo:t}=e;return t})).filter(Boolean);return{messages:r,users:c,chats:d,repliesThreadInfos:u}}async function Jr(e){let{chat:t,messageId:n}=e;const s="channel"===Mn(t.id);let a;try{a=await wi(s?new ie.Api.channels.GetMessages({channel:En(t.id,t.accessHash),id:[new ie.Api.InputMessageID({id:n})]}):new ie.Api.messages.GetMessages({id:[new ie.Api.InputMessageID({id:n})]}),{shouldThrow:!0,abortControllerChatId:t.id})}catch(e){const{message:t}=e;"CHANNEL_PRIVATE"!==t&&zr({"@type":"error",error:{message:t,isSlowMode:!1,hasErrorKey:!0}})}if(!a||a instanceof ie.Api.messages.MessagesNotModified)return;"pts"in a&&Ea(t.id,a.pts);const i=a.messages[0];if(!i)return;if(i instanceof ie.Api.MessageEmpty)return Xe;const o=i&&gs(i);return o?(i instanceof ie.Api.Message&&Ee(i),{message:o,users:a.users.map(ws).filter(Boolean)}):void 0}let Qr=Promise.resolve();function Xr(e,t){let{chat:n,text:s,entities:a,replyingTo:i,attachment:o,sticker:r,story:d,gif:u,poll:l,contact:p,isSilent:f,scheduledAt:g,groupedId:h,noWebPage:m,sendAs:_,shouldUpdateStickerSetOrder:y}=e;const b=function(e,t,n,s,a,i,o,r,c,d,u,l,p){const f=ps(e.lastMessage?.id),g=a&&function(e){const{filename:t,blobUrl:n,previewBlobUrl:s,mimeType:a,size:i,audio:o,shouldSendAsFile:r,shouldSendAsSpoiler:c}=e;if(!r){if(e.quick){if(N.has(a)){const{width:t,height:a}=e.quick;return{photo:{id:rs,sizes:[],thumbnail:{width:t,height:a,dataUri:s||n},blobUrl:n,isSpoiler:c}}}if(H.has(a)){const{width:o,height:r,duration:d}=e.quick;return{video:{id:rs,mimeType:a,duration:d||0,fileName:t,width:o,height:r,blobUrl:n,...s&&{thumbnail:{width:o,height:r,dataUri:s}},size:i,isSpoiler:c}}}}if(e.voice){const{duration:t,waveform:n}=e.voice,{data:s}=An(n,cs);return{voice:{id:rs,duration:t,waveform:s}}}if(q.has(a)){const{duration:e,performer:n,title:s}=o||{};return{audio:{id:rs,mimeType:a,fileName:t,size:i,duration:e||0,title:s,performer:n}}}}return{document:{mimeType:a,fileName:t,size:i,...s&&{previewBlobUrl:s}}}}(a),h="chatTypeChannel"===e.type,m=e.isForum;let _,y,b,w;s&&("replyingTo"in s?(_=s.replyingTo,y=s.replyingToTopId):(b=s.userId,w=s.storyId));const S={id:f,chatId:e.id,content:{...t&&{text:{text:t,entities:n}},...g,...i&&{sticker:i},...o&&{video:o},...r&&_s(r,f),...c&&{contact:c},...p&&{storyData:p}},date:u||Math.round(Date.now()/1e3)+Ke(),isOutgoing:!h,senderId:l?.id||us,..._&&{replyToMessageId:_},...y&&{replyToTopMessageId:y},...(_||y)&&m&&{isTopicReply:!0},...b&&{replyToStoryUserId:b,replyToStoryId:w},...d&&{groupedId:d,...g&&(g.photo||g.video)&&{isInAlbum:!0}},...u&&{isScheduled:!0},isForwardingAllowed:!0},v=vn(S.content,S.groupedId);return{...S,...v&&{emojiOnlyCount:v}}}(n,s,a,i,o,r,u,l,p,h,g,_,d);zr({"@type":b.isScheduled?"newScheduledMessage":"newMessage",id:b.id,chatId:n.id,message:b});const w=setTimeout((()=>{zr({"@type":b.isScheduled?"updateScheduledMessage":"updateMessage",id:b.id,chatId:n.id,message:{sendingState:"messageSendingStatePending"}})}),Wr),S=Vn();if(h)return function(e,t,n,s){let{chat:a,text:i,entities:o,replyingTo:r,attachment:d,groupedId:u,isSilent:l,scheduledAt:p,sendAs:f}=e,g=-1;Zr[u]||(Zr[u]={counter:0,singleMediaByIndex:{},localMessages:{}}),g=Zr[u].counter++;const h=Qr;return Qr=(async()=>{let e;try{e=await tc(n,d,s)}catch(e){return c&&console.warn(e),Zr[u].counter--,void await h}const m=await async function(e,t){const n=await wi(new ie.Api.messages.UploadMedia({peer:e,media:t})),s=t.spoiler;if(n instanceof ie.Api.MessageMediaPhoto&&n.photo&&n.photo instanceof ie.Api.Photo){const{photo:{id:e,accessHash:t,fileReference:a}}=n;return new ie.Api.InputMediaPhoto({id:new ie.Api.InputPhoto({id:e,accessHash:t,fileReference:a}),spoiler:s})}if(n instanceof ie.Api.MessageMediaDocument&&n.document&&n.document instanceof ie.Api.Document){const{document:{id:e,accessHash:t,fileReference:a}}=n;return new ie.Api.InputMediaDocument({id:new ie.Api.InputDocument({id:e,accessHash:t,fileReference:a}),spoiler:s})}}(Rn(a.id,a.accessHash),e);if(await h,!m)return Zr[u].counter--,void(c&&console.warn("Failed to upload grouped media"));if(Zr[u].singleMediaByIndex[g]=new ie.Api.InputSingleMedia({media:m,randomId:t,message:i||"",entities:o?o.map(Hn):void 0}),Zr[u].localMessages[t.toString()]=n,Object.keys(Zr[u].singleMediaByIndex).length<Zr[u].counter)return;const{singleMediaByIndex:_,localMessages:y}=Zr[u];delete Zr[u];const b=r?as(r):void 0,w=await wi(new ie.Api.messages.SendMultiMedia({clearDraft:!0,peer:Rn(a.id,a.accessHash),multiMedia:Object.values(_),...r&&{replyTo:b},...l&&{silent:l},...p&&{scheduleDate:p},...f&&{sendAs:Rn(f.id,f.accessHash)}}),{shouldIgnoreUpdates:!0});w&&Fc(y,w)})(),Qr}({chat:n,text:s,entities:a,replyingTo:i,attachment:o,groupedId:h,isSilent:f,scheduledAt:g},S,b,t);const v=(async()=>{let e;if(o)try{e=await tc(b,o,t)}catch(e){return c&&console.warn(e),void await Qr}else r?e=Dn(r):u?e=Dn(u):l?e=function(e,t){const{summary:n,quiz:s}=e,a=new ie.Api.Poll({id:t,publicVoters:n.isPublic,question:n.question,answers:n.answers.map((e=>{let{text:t,option:n}=e;return new ie.Api.PollAnswer({text:t,option:Fe(n)})})),quiz:n.quiz,multipleChoice:n.multipleChoice});if(!s)return new ie.Api.InputMediaPoll({poll:a});const i=s.correctAnswers.map(Fe),{solution:o}=s,r=s.solutionEntities?s.solutionEntities.map(Hn):[];return new ie.Api.InputMediaPoll({poll:a,correctAnswers:i,...o&&{solution:o,solutionEntities:r}})}(l,S):d?e=function(e){const t=Tn(e.peerId);return new ie.Api.InputMediaStory({peer:t,id:e.id})}(d):p&&(e=new ie.Api.InputMediaContact({phoneNumber:p.phoneNumber,firstName:p.firstName,lastName:p.lastName,vcard:""}));const h=e?ie.Api.messages.SendMedia:ie.Api.messages.SendMessage,v=i?as(i):void 0;try{const t=await wi(new h({clearDraft:!0,message:s||"",entities:a?a.map(Hn):void 0,peer:Rn(n.id,n.accessHash),randomId:S,...f&&{silent:f},...g&&{scheduleDate:g},...v&&{replyTo:v},...e&&{media:e},...m&&{noWebpage:m},..._&&{sendAs:Rn(_.id,_.accessHash)},...y&&{updateStickersetsOrder:y}}),{shouldThrow:!0,shouldIgnoreUpdates:!0});t&&Nc(b,t)}catch(e){zr({"@type":"updateMessageSendFailed",chatId:n.id,localId:b.id,error:e.message}),clearTimeout(w)}})();return v}const Zr={};async function Yr(e){let{chat:t,message:n,text:s,entities:a,noWebPage:i}=e;const o=1e3*n.date>Date.now()+1e3*Ke();let r={content:{...n.content,...s&&{text:{text:s,entities:a}}}};const c=vn(r.content,r.groupedId);r={...r,emojiOnlyCount:c},zr({"@type":o?"updateScheduledMessage":"updateMessage",id:n.id,chatId:t.id,message:r});const d=a&&a.map(Hn);await wi(new ie.Api.messages.EditMessage({message:s||"",entities:d,peer:Rn(t.id,t.accessHash),id:n.id,...o&&{scheduleDate:n.date},...i&&{noWebpage:i}}))}async function ec(e){let{chat:t,message:n,scheduledAt:s}=e;await wi(new ie.Api.messages.EditMessage({peer:Rn(t.id,t.accessHash),id:n.id,scheduleDate:s}))}async function tc(e,t,n){const{filename:s,blobUrl:a,mimeType:i,quick:o,voice:r,audio:c,previewBlobUrl:d,shouldSendAsFile:u,shouldSendAsSpoiler:l}=t,p=t=>{n.isCanceled?p.isCanceled=!0:n(t,e.id)},f=async(e,t)=>Ai(await async function(e,t){const n=await async function(e){return(await fetch(e)).blob()}(e);return function(e,t){return new File([e],t,{lastModified:Date.now(),type:e.type})}(n,t)}(e,s),t),g=H.has(i),h=c||g||u,[m,_]=await Promise.all(je([f(a,p),h&&d&&f(d)])),y=[new ie.Api.DocumentAttributeFilename({fileName:s})];if(!u){if(o){if(N.has(i)&&i!==F)return new ie.Api.InputMediaUploadedPhoto({file:m,spoiler:l});if(g){const{width:e,height:t,duration:n}=o;void 0!==n&&y.push(new ie.Api.DocumentAttributeVideo({duration:n,w:e,h:t,supportsStreaming:!0}))}}if(c){const{duration:e,title:t,performer:n}=c;y.push(new ie.Api.DocumentAttributeAudio({duration:e,title:t,performer:n}))}if(r){const{duration:e,waveform:t}=r,{data:n}=An(t,Kr);y.push(new ie.Api.DocumentAttributeAudio({voice:!0,duration:e,waveform:jr.from(n)}))}}return new ie.Api.InputMediaUploadedDocument({file:m,mimeType:i,attributes:y,thumb:_,forceFile:u,spoiler:l})}async function nc(e){let{chat:t,messageId:n,isUnpin:s,isOneSide:a,isSilent:i}=e;await wi(new ie.Api.messages.UpdatePinnedMessage({peer:Rn(t.id,t.accessHash),id:n,...s&&{unpin:!0},...a&&{pmOneside:!0},...i&&{silent:!0}}))}async function sc(e){let{chat:t,threadId:n}=e;await wi(new ie.Api.messages.UnpinAllMessages({peer:Rn(t.id,t.accessHash),...n&&{topMsgId:n}}))}async function ac(e){let{chat:t,messageIds:n,shouldDeleteForAll:s}=e;const a="channel"===Mn(t.id);await wi(a?new ie.Api.channels.DeleteMessages({channel:En(t.id,t.accessHash),id:n}):new ie.Api.messages.DeleteMessages({id:n,...s&&{revoke:!0}}))&&zr({"@type":"deleteMessages",ids:n,...a&&{chatId:t.id}})}function ic(e){let{chat:t,messageIds:n}=e;wi(new ie.Api.messages.DeleteScheduledMessages({peer:Rn(t.id,t.accessHash),id:n}))}async function oc(e){let{chat:t,shouldDeleteForAll:n}=e;const s="channel"===Mn(t.id),a=await wi(s?new ie.Api.channels.DeleteHistory({channel:En(t.id,t.accessHash)}):new ie.Api.messages.DeleteHistory({peer:Rn(t.id,t.accessHash),...n&&{revoke:!0},...!n&&{just_clear:!0}}));a&&("offset"in a&&a.offset?await oc({chat:t,shouldDeleteForAll:n}):zr({"@type":"deleteHistory",chatId:t.id}))}async function rc(e){let{peer:t,messageIds:n,reason:s,description:a}=e;return await wi(new ie.Api.messages.Report({peer:Rn(t.id,t.accessHash),id:n,reason:zn(s),message:a}))}async function cc(e){let{peer:t,threadId:n,action:s}=e;const a=function(e){switch(e.type){case"cancel":return new ie.Api.SendMessageCancelAction;case"typing":return new ie.Api.SendMessageTypingAction;case"recordAudio":return new ie.Api.SendMessageRecordAudioAction;case"chooseSticker":return new ie.Api.SendMessageChooseStickerAction;case"playingGame":return new ie.Api.SendMessageGamePlayAction}}(s);if(a)try{return await wi(new ie.Api.messages.SetTyping({peer:Rn(t.id,t.accessHash),topMsgId:n,action:a}),{shouldThrow:!0,abortControllerChatId:t.id,abortControllerThreadId:n})}catch(e){}else c&&console.warn("Unsupported message action",s)}async function dc(e){let{chat:t,threadId:n,maxId:s=0}=e;const a="channel"===Mn(t.id),i=Math.min(s,T);a&&n===Qe?await wi(new ie.Api.channels.ReadHistory({channel:En(t.id,t.accessHash),maxId:i})):a?await wi(new ie.Api.messages.ReadDiscussion({peer:Rn(t.id,t.accessHash),msgId:n,readMaxId:i})):await wi(new ie.Api.messages.ReadHistory({peer:Rn(t.id,t.accessHash),maxId:i})),n===Qe?Eo({chat:t,noLastMessage:!0}):pc({chat:t,threadId:n})}async function uc(e){let{chat:t,messageIds:n}=e;const s="channel"===Mn(t.id);await wi(s?new ie.Api.channels.ReadMessageContents({channel:En(t.id,t.accessHash),id:n}):new ie.Api.messages.ReadMessageContents({id:n})),zr({...s?{"@type":"updateChannelMessages",channelId:t.id}:{"@type":"updateCommonBoxMessages"},ids:n,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}})}async function lc(e){let{chat:t,ids:n,shouldIncrement:s}=e;const a=await wi(new ie.Api.messages.GetMessagesViews({peer:Rn(t.id,t.accessHash),id:n,increment:s}));if(a)return n.map(((e,t)=>{const{views:n,forwards:s,replies:i}=a.views[t];return{id:e,views:n,forwards:s,messagesCount:i?.replies,recentReplierIds:i?.recentRepliers?.map(de),maxId:i?.maxId,readMaxId:i?.readMaxId}}))}async function pc(e){let{chat:t,threadId:n,originChannelId:s}=e;if(n===Qe)return;const[a,i]=await Promise.all([wi(new ie.Api.messages.GetDiscussionMessage({peer:Rn(t.id,t.accessHash),msgId:Number(n)})),wi(new ie.Api.messages.GetReplies({peer:Rn(t.id,t.accessHash),msgId:Number(n),offsetId:1,addOffset:-1,limit:1}))]);if(!a||!a.messages.length)return;const o=Re(a.messages[0]);if(!o)return;const r=a.messages[a.messages.length-1].id;return zr({"@type":"updateThreadInfo",chatId:o,threadId:r,threadInfo:{threadId:r,topMessageId:r,lastReadInboxMessageId:a.readInboxMaxId,messagesCount:i instanceof ie.Api.messages.ChannelMessages?i.count:void 0,lastMessageId:a.maxId,...s?{originChannelId:s}:void 0},firstMessageId:i&&"messages"in i&&i.messages.length?i.messages[0].id:void 0}),a.chats.map((e=>en(e))).filter(Boolean).forEach((e=>{zr({"@type":"updateChat",id:e.id,chat:e,noTopChatsRequest:!0})})),t.isForum&&zr({"@type":"updateTopic",chatId:t.id,topicId:n}),xe(a.users),xe(a.chats),{topMessageId:r,discussionChatId:o,users:a.users.map(ws).filter(Boolean)}}async function fc(e){let t,{chat:n,type:s,query:a,topMessageId:i,minDate:o,maxDate:r,...c}=e;switch(s){case"media":t=new ie.Api.InputMessagesFilterPhotoVideo;break;case"documents":t=new ie.Api.InputMessagesFilterDocument;break;case"links":t=new ie.Api.InputMessagesFilterUrl;break;case"audio":t=new ie.Api.InputMessagesFilterMusic;break;case"voice":t=new ie.Api.InputMessagesFilterRoundVoice;break;case"profilePhoto":t=new ie.Api.InputMessagesFilterChatPhotos;break;default:t=new ie.Api.InputMessagesFilterEmpty}const d=await wi(new ie.Api.messages.Search({peer:Rn(n.id,n.accessHash),topMsgId:i,filter:t,q:a||"",minDate:o,maxDate:r,...c}),{abortControllerChatId:n.id,abortControllerThreadId:i});if(!d||d instanceof ie.Api.messages.MessagesNotModified||!d.messages)return;Ic(d);const u=d.chats.map((e=>en(e))).filter(Boolean),l=d.users.map(ws).filter(Boolean),p=d.messages.map(gs).filter(Boolean);let f,g=p.length;return(d instanceof ie.Api.messages.MessagesSlice||d instanceof ie.Api.messages.ChannelMessages)&&(g=d.count,p.length&&(f=p[p.length-1].id)),{chats:u,users:l,messages:p,totalCount:g,nextOffsetId:f}}async function gc(e){let t,{query:n,offsetRate:s=0,limit:a,type:i="text",minDate:o,maxDate:r}=e;switch(i){case"media":t=new ie.Api.InputMessagesFilterPhotoVideo;break;case"documents":t=new ie.Api.InputMessagesFilterDocument;break;case"links":t=new ie.Api.InputMessagesFilterUrl;break;case"audio":t=new ie.Api.InputMessagesFilterMusic;break;case"voice":t=new ie.Api.InputMessagesFilterRoundVoice;break;default:if(!(n||r&&o))return;t=new ie.Api.InputMessagesFilterEmpty}const c=await wi(new ie.Api.messages.SearchGlobal({q:n,offsetRate:s,offsetPeer:new ie.Api.InputPeerEmpty,limit:a,filter:t,folderId:W,minDate:o,maxDate:r}));if(!c||c instanceof ie.Api.messages.MessagesNotModified||!c.messages)return;Ic({chats:c.chats,users:c.users,messages:c.messages});const d=c.chats.map((e=>en(e))).filter(Boolean),u=c.users.map(ws).filter(Boolean),l=c.messages.map(gs).filter(Boolean);let p,f=l.length;return(c instanceof ie.Api.messages.MessagesSlice||c instanceof ie.Api.messages.ChannelMessages)&&(f=c.count,l.length&&(p=l[l.length-1].id)),{messages:l,users:u,chats:d,totalCount:f,nextRate:"nextRate"in c&&c.nextRate?c.nextRate:p}}async function hc(e){let{text:t}=e;const n=ts(t),s=await wi(new ie.Api.messages.GetWebPagePreview({message:n.text,entities:n.entities}));return s&&Ct(s)}async function mc(e){let{chat:t,messageId:n,options:s}=e;const{id:a,accessHash:i}=t;await wi(new ie.Api.messages.SendVote({peer:Rn(a,i),msgId:n,options:s.map(Fe)}))}async function _c(e){let{chat:t,messageId:n,poll:s}=e;const{id:a,accessHash:i}=t;await wi(new ie.Api.messages.EditMessage({peer:Rn(a,i),id:n,media:xn(s,!0)}))}async function yc(e){let{chat:t,messageId:n,option:s,offset:a,limit:i,shouldResetVoters:o}=e;const{id:r,accessHash:c}=t,d=await wi(new ie.Api.messages.GetPollVotes({peer:Rn(r,c),id:n,...s&&{option:Fe(s)},...a&&{offset:a},...i&&{limit:i}}));if(!d)return;Ic({chats:d.chats,users:d.users,messages:[]});const u=d.users.map(ws).filter(Boolean),l=d.chats.map((e=>en(e))).filter(Boolean),p=d.votes.map((e=>({peerId:de(e.peer),date:e.date})));return{count:d.count,votes:p,chats:l,users:u,nextOffset:d.nextOffset,shouldResetVoters:o}}async function bc(e){let{chat:t,ids:n}=e;await wi(new ie.Api.messages.GetExtendedMedia({peer:Rn(t.id,t.accessHash),id:n}))}async function wc(e){let{fromChat:t,toChat:n,toThreadId:s,messages:a,isSilent:i,scheduledAt:o,sendAs:r,withMyScore:c,noAuthors:d,noCaptions:u,isCurrentUserPremium:l}=e;const p=a.map((e=>{let{id:t}=e;return t})),f=a.map(Vn),g={};a.forEach(((e,t)=>{const a=function(e){let{toChat:t,toThreadId:n,message:s,scheduledAt:a,noAuthors:i,noCaptions:o,isCurrentUserPremium:r}=e;const c=ps(t?.lastMessage?.id),{content:d,chatId:u,id:l,senderId:p,groupedId:f,isInAlbum:g}=s,h=d.audio,m=t.id===us&&(u!==t.id||s.forwardInfo)&&!h,_=Object.keys(d).length>1&&d.text&&o,y=!r,b=d.text?.entities&&y?{text:d.text.text,entities:d.text.entities.filter((e=>e.type!==Je.CustomEmoji))}:d.text,w=vn(d,f),S={...d,text:_?void 0:b};return{id:c,chatId:t.id,content:S,date:a||Math.round(Date.now()/1e3)+Ke(),isOutgoing:!m&&"chatTypeChannel"!==t.type,senderId:us,sendingState:"messageSendingStatePending",groupedId:f,isInAlbum:g,isForwardingAllowed:!0,replyToTopMessageId:n,...n&&t?.isForum&&{isTopicReply:!0},...w&&{emojiOnlyCount:w},...s.chatId!==us&&!h&&!i&&{forwardInfo:{date:s.date,isChannelPost:!1,fromChatId:u,fromMessageId:l,senderUserId:p}},...s.chatId===us&&!i&&{forwardInfo:s.forwardInfo},...a&&{isScheduled:!0}}}({toChat:n,toThreadId:s,message:e,scheduledAt:o,noAuthors:d,noCaptions:u,isCurrentUserPremium:l});g[f[t].toString()]=a,zr({"@type":a.isScheduled?"newScheduledMessage":"newMessage",id:a.id,chatId:n.id,message:a})}));try{const e=await wi(new ie.Api.messages.ForwardMessages({fromPeer:Rn(t.id,t.accessHash),toPeer:Rn(n.id,n.accessHash),randomId:f,id:p,withMyScore:c||void 0,silent:i||void 0,dropAuthor:d||void 0,dropMediaCaptions:u||void 0,...s&&{topMsgId:s},...o&&{scheduleDate:o},...r&&{sendAs:Rn(r.id,r.accessHash)}}),{shouldThrow:!0,shouldIgnoreUpdates:!0});e&&Fc(g,e)}catch(e){Object.values(g).forEach((t=>{zr({"@type":"updateMessageSendFailed",chatId:n.id,localId:t.id,error:e.message})}))}}async function Sc(e){let{chat:t,timestamp:n}=e;const s=await wi(new ie.Api.messages.GetHistory({peer:Rn(t.id,t.accessHash),offsetDate:n,addOffset:-1,limit:1}));if(s&&!(s instanceof ie.Api.messages.MessagesNotModified)&&s.messages&&s.messages.length)return s.messages[0].id}async function vc(e){let{chat:t}=e;const{id:n,accessHash:s}=t,a=await wi(new ie.Api.messages.GetScheduledHistory({peer:Rn(n,s)}),{abortControllerChatId:n});if(a&&!(a instanceof ie.Api.messages.MessagesNotModified)&&a.messages)return Ic(a),{messages:a.messages.map(gs).filter(Boolean)}}async function Ac(e){let{chat:t,ids:n}=e;const{id:s,accessHash:a}=t;await wi(new ie.Api.messages.SendScheduledMessages({peer:Rn(s,a),id:n}))}function Ic(e){xe(e.users),xe(e.chats),e.messages.forEach((e=>{(e instanceof ie.Api.Message&&qn(e)||e instanceof ie.Api.MessageService&&function(e){return"photo"in e.action&&e.action.photo instanceof ie.Api.Photo}(e))&&Ee(e)}))}async function Cc(e){let{chat:t,threadId:n}=e;const s=await wi(new ie.Api.messages.Search({peer:Rn(t.id,t.accessHash),filter:new ie.Api.InputMessagesFilterPinned,q:"",limit:_,topMsgId:n}),{abortControllerChatId:t.id,abortControllerThreadId:n});if(!s||s instanceof ie.Api.messages.MessagesNotModified||!s.messages)return;Ic(s);const a=s.chats.map((e=>en(e))).filter(Boolean),i=s.users.map(ws).filter(Boolean);return{messages:s.messages.map(gs).filter(Boolean),users:i,chats:a}}async function Pc(e){let{chat:t,messageId:n}=e;const s=await wi(new ie.Api.messages.GetMessageReadParticipants({peer:Rn(t.id,t.accessHash),msgId:n}));return s?s.reduce(((e,t)=>(e[t.userId.toString()]=t.date,e)),{}):void 0}async function Mc(e){let{chat:t}=e;const n=await wi(new ie.Api.channels.GetSendAs({peer:Rn(t.id,t.accessHash)}),{shouldIgnoreErrors:!0,abortControllerChatId:t.id});if(n)return xe(n.users),xe(n.chats),{users:n.users.map(ws).filter(Boolean),chats:n.chats.map((e=>en(e))).filter(Boolean),sendAs:n.peers.map(mn)}}function kc(e){let{sendAs:t,chat:n}=e;return wi(new ie.Api.messages.SaveDefaultSendAs({peer:Rn(n.id,n.accessHash),sendAs:Rn(t.id,t.accessHash)}))}async function Rc(e){let{chat:t}=e;const n=await wi(new ie.Api.channels.GetSponsoredMessages({channel:Rn(t.id,t.accessHash)}));if(n&&!(n instanceof ie.Api.messages.SponsoredMessagesEmpty)&&n.messages.length)return Ic(n),{messages:n.messages.map(fs).filter(Boolean),users:n.users.map(ws).filter(Boolean),chats:n.chats.map((e=>en(e))).filter(Boolean)}}async function Tc(e){let{chat:t,random:n}=e;await wi(new ie.Api.channels.ViewSponsoredMessage({channel:Rn(t.id,t.accessHash),randomId:Fe(n)}))}function Ec(e){let{chat:t}=e;return wi(new ie.Api.messages.ReadMentions({peer:Rn(t.id,t.accessHash)}),{shouldReturnTrue:!0})}function Bc(e){let{chat:t}=e;return wi(new ie.Api.messages.ReadReactions({peer:Rn(t.id,t.accessHash)}),{shouldReturnTrue:!0})}async function Uc(e){let{chat:t,...n}=e;const s=await wi(new ie.Api.messages.GetUnreadMentions({peer:Rn(t.id,t.accessHash),limit:M,...n}));if(s&&!(s instanceof ie.Api.messages.MessagesNotModified)&&s.messages)return Ic(s),{messages:s.messages.map(gs).filter(Boolean),users:s.users.map(ws).filter(Boolean),chats:s.chats.map((e=>en(e))).filter(Boolean)}}async function Dc(e){let{chat:t,...n}=e;const s=await wi(new ie.Api.messages.GetUnreadReactions({peer:Rn(t.id,t.accessHash),limit:P,...n}));if(s&&!(s instanceof ie.Api.messages.MessagesNotModified)&&s.messages)return Ic(s),{messages:s.messages.map(gs).filter(Boolean),users:s.users.map(ws).filter(Boolean),chats:s.chats.map((e=>en(e))).filter(Boolean)}}async function xc(e){let{chat:t,messageId:n}=e;const s=await wi(new ie.Api.messages.TranscribeAudio({msgId:n,peer:Rn(t.id,t.accessHash)}));if(s)return zr({"@type":"updateTranscribedAudio",isPending:s.pending,transcriptionId:s.transcriptionId.toString(),text:s.text}),s.transcriptionId.toString()}async function Vc(e){let t;const n="chat"in e;if(n){const{chat:n,messageIds:s,toLanguageCode:a}=e;t=await wi(new ie.Api.messages.TranslateText({peer:Rn(n.id,n.accessHash),id:s,toLang:a}))}else{const{text:n,toLanguageCode:s}=e;t=await wi(new ie.Api.messages.TranslateText({text:n.map((e=>ts(e))),toLang:s}))}if(!t)return;const s=t.result.map((e=>function(e){const{text:t,entities:n}=e;return{text:t,entities:n.map(dt)}}(e)));return n&&zr({"@type":"updateMessageTranslations",chatId:e.chat.id,messageIds:e.messageIds,translations:s,toLanguageCode:e.toLanguageCode}),s}function Fc(e,t){"updates"in t?t.updates.forEach((t=>{t instanceof ie.Api.UpdateMessageID?Nc(e[t.randomId.toString()],t):bi(t)})):bi(t)}function Nc(e,t){let n,s;if(t instanceof ie.Api.UpdateShortSentMessage||t instanceof ie.Api.UpdateMessageID?n=t:"updates"in t&&(n=t.updates.find((e=>e instanceof ie.Api.UpdateMessageID))),!n)return void bi(t);if(n instanceof ie.Api.UpdateShortSentMessage){e.content.text&&n.entities&&(s={text:yt(e.content.text.text,n.entities)}),n.media&&(s={...s,...bt(n.media)});const t=Nn(n.id,e.chatId,n);qn(t)&&Ee(t)}const a="date"in n&&1e3*n.date<Date.now()+1e3*Ke();zr({"@type":e.isScheduled&&!a?"updateScheduledMessageSendSucceeded":"updateMessageSendSucceeded",chatId:e.chatId,localId:e.id,message:{...e,...s&&{content:{...e.content,...s}},id:n.id,sendingState:void 0,..."date"in n&&{date:n.date}}}),bi(t)}let Hc,qc,Oc,Lc;async function Gc(e){let{id:t,accessHash:n}=e;const s=En(t,n);if(!(s instanceof ie.Api.InputUser))return;const a=await wi(new ie.Api.users.GetFullUser({id:s}));if(!a)return;nd(a),xe(a.users),a.fullUser.profilePhoto instanceof ie.Api.Photo&&(Ae.photos[a.fullUser.profilePhoto.id.toString()]=a.fullUser.profilePhoto),a.fullUser.personalPhoto instanceof ie.Api.Photo&&(Ae.photos[a.fullUser.personalPhoto.id.toString()]=a.fullUser.personalPhoto),a.fullUser.fallbackPhoto instanceof ie.Api.Photo&&(Ae.photos[a.fullUser.fallbackPhoto.id.toString()]=a.fullUser.fallbackPhoto);const i=a.fullUser.botInfo;i?.descriptionPhoto instanceof ie.Api.Photo&&(Ae.photos[i.descriptionPhoto.id.toString()]=i.descriptionPhoto),i?.descriptionDocument instanceof ie.Api.Document&&(Ae.documents[i.descriptionDocument.id.toString()]=i.descriptionDocument);const o=bs(a),r=ws(a.users[0]);return Hc({"@type":"updateUser",id:t,user:{...r,avatarHash:r?.avatarHash||void 0},fullInfo:o}),{user:r,fullInfo:o}}async function jc(e,t,n){const s=await wi(new ie.Api.messages.GetCommonChats({userId:En(e,t),maxId:n?Jn(n,Mn(n)):void 0,limit:w}));if(!s)return;nd(s);const a=[],i=[];return s.chats.forEach((e=>{const t=en(e);t&&(i.push(t),a.push(t.id))})),{chats:i,chatIds:a,isFullyLoaded:a.length<w}}async function Wc(){const e=await wi(new ie.Api.help.GetNearestDc);return e?.country}async function Kc(){const e=await wi(new ie.Api.contacts.GetTopPeers({correspondents:!0}));if(!(e instanceof ie.Api.contacts.TopPeers))return;const t=e.users.map(ws).filter((e=>Boolean(e)&&!e.isSelf));return{ids:t.map((e=>{let{id:t}=e;return t})),users:t}}async function zc(){const e=await wi(new ie.Api.contacts.GetContacts({hash:le()("0")}));if(!e||e instanceof ie.Api.contacts.ContactsNotModified)return;xe(e.users);const{users:t,userStatusesById:n}=As(e.users);return{users:t,userStatusesById:n,chats:e.users.map((e=>en(e))).filter(Boolean)}}async function $c(e){let{users:t}=e;const n=await wi(new ie.Api.users.GetUsers({id:t.map((e=>{let{id:t,accessHash:n}=e;return Rn(t,n)}))}));if(n&&n.length)return xe(n),As(n)}async function Jc(e){let{phone:t,firstName:n,lastName:s}=e;const a=await wi(new ie.Api.contacts.ImportContacts({contacts:[Ln({phone:t||"",firstName:n||"",lastName:s||""})]}));return a instanceof ie.Api.contacts.ImportedContacts&&a.users.length&&De(a.users[0]),a?.imported.length?ce(a.imported[0].userId,"user"):void 0}function Qc(e){let{id:t,accessHash:n,phoneNumber:s="",firstName:a="",lastName:i="",shouldSharePhoneNumber:o=!1}=e;return wi(new ie.Api.contacts.AddContact({id:En(t,n),firstName:a,lastName:i,phone:s,...o&&{addPhonePrivacyException:o}}),{shouldReturnTrue:!0})}async function Xc(e){let{id:t,accessHash:n}=e;const s=En(t,n);s instanceof ie.Api.InputUser&&await wi(new ie.Api.contacts.DeleteContacts({id:[s]}))&&Hc({"@type":"deleteContact",id:t})}async function Zc(e,t){if(e){const{id:t,accessHash:n}=e,s=await wi(new ie.Api.photos.GetUserPhotos({userId:En(t,n),limit:b,offset:0,maxId:le()("0")}));if(!s)return;return nd(s),{photos:s.photos.filter((e=>e instanceof ie.Api.Photo)).map((e=>at(e))),users:s.users.map(ws).filter(Boolean)}}const n=await fc({chat:t,type:"profilePhoto",limit:b});if(!n)return;const{messages:s,users:a}=n;return{photos:s.map((e=>e.content.action.photo)).filter(Boolean),users:a}}function Yc(e){const{id:t,accessHash:n}=e;return wi(new ie.Api.messages.ReportSpam({peer:Rn(t,n)}),{shouldReturnTrue:!0})}function ed(e,t){return wi(new ie.Api.account.UpdateEmojiStatus({emojiStatus:es(e,t)}),{shouldReturnTrue:!0})}function td(e){const t=e.map((e=>Jn(e,"user")));return wi(new ie.Api.contacts.EditCloseFriends({id:t}),{shouldReturnTrue:!0})}function nd(e){"chats"in e&&xe(e.chats),"photos"in e&&e.photos.forEach(Ue),"users"in e&&xe(e.users)}async function sd(e){let{hash:t="0"}=e;const n=await wi(new ie.Api.messages.GetEmojiStickers({hash:le()(t)}));if(n&&!(n instanceof ie.Api.messages.AllStickersNotModified))return n.sets.forEach((e=>{(e.thumbs?.length||e.thumbDocumentId)&&(Ae.stickerSets[String(e.id)]=e)})),{hash:String(n.hash),sets:n.sets.map(ft)}}async function ad(e){let{hash:t="0"}=e;const n=await wi(new ie.Api.messages.GetAllStickers({hash:le()(t)}));if(n&&!(n instanceof ie.Api.messages.AllStickersNotModified))return n.sets.forEach((e=>{e.thumbs?.length&&(Ae.stickerSets[String(e.id)]=e)})),{hash:String(n.hash),sets:n.sets.map(ft)}}async function id(e){let{hash:t="0"}=e;const n=await wi(new ie.Api.messages.GetRecentStickers({hash:le()(t)}));if(n&&!(n instanceof ie.Api.messages.RecentStickersNotModified))return{hash:String(n.hash),stickers:mt(n.stickers.slice(0,U))}}async function od(e){let{hash:t="0"}=e;const n=await wi(new ie.Api.messages.GetFavedStickers({hash:le()(t)}));if(n&&!(n instanceof ie.Api.messages.FavedStickersNotModified))return{hash:String(n.hash),stickers:mt(n.stickers)}}async function rd(e){let{hash:t="0"}=e;const n=await wi(new ie.Api.messages.GetFeaturedStickers({hash:le()(t)}));if(n&&!(n instanceof ie.Api.messages.FeaturedStickersNotModified))return{hash:String(n.hash),isPremium:Boolean(n.premium),sets:n.sets.map(gt)}}async function cd(){const e=await wi(new ie.Api.messages.GetFeaturedEmojiStickers({hash:le()(0)}));if(e&&!(e instanceof ie.Api.messages.FeaturedStickersNotModified))return e.sets.forEach((e=>{let{set:t}=e;t.thumbDocumentId&&(Ae.stickerSets[String(t.id)]=t)})),{isPremium:Boolean(e.premium),sets:e.sets.map(gt)}}async function dd(e){let{sticker:t,unfave:n}=e;const s=new ie.Api.messages.FaveSticker({id:Un(t),unfave:n});await wi(s)&&qc({"@type":"updateFavoriteStickers"})}function ud(e){let{sticker:t}=e;return wi(new ie.Api.messages.SaveRecentSticker({id:Un(t),unsave:!0}))}function ld(){return wi(new ie.Api.messages.ClearRecentStickers)}async function pd(e){let{stickerSetInfo:t}=e;if("isMissing"in t)return;const n=await wi(new ie.Api.messages.GetStickerSet({stickerset:"id"in t?Bn(t.id,t.accessHash):(s=t.shortName,new ie.Api.InputStickerSetShortName({shortName:s}))}),{shouldThrow:!0});var s;return n instanceof ie.Api.messages.StickerSet?(Ae.stickerSets[String(n.set.id)]=n.set,{set:ft(n.set),stickers:mt(n.documents),packs:ht(n.packs)}):void 0}async function fd(e){let{documentId:t}=e;if(!t.length)return;const n=await wi(new ie.Api.messages.GetCustomEmojiDocuments({documentId:t.map((e=>le()(e)))}));return n?mt(n):void 0}async function gd(){const e=await wi(new ie.Api.messages.GetStickerSet({stickerset:new ie.Api.InputStickerSetAnimatedEmoji}));if(e instanceof ie.Api.messages.StickerSet)return{set:ft(e.set),stickers:mt(e.documents)}}async function hd(){const e=await wi(new ie.Api.messages.GetStickerSet({stickerset:new ie.Api.InputStickerSetAnimatedEmojiAnimations}));if(e instanceof ie.Api.messages.StickerSet)return{set:ft(e.set),stickers:mt(e.documents)}}async function md(){const e=await wi(new ie.Api.messages.GetStickerSet({stickerset:new ie.Api.InputStickerSetEmojiGenericAnimations}));if(e instanceof ie.Api.messages.StickerSet)return{set:ft(e.set),stickers:mt(e.documents)}}async function _d(){const e=await wi(new ie.Api.messages.GetStickerSet({stickerset:new ie.Api.InputStickerSetPremiumGifts}));if(e instanceof ie.Api.messages.StickerSet)return{set:ft(e.set),stickers:mt(e.documents)}}async function yd(){const e=await wi(new ie.Api.messages.GetStickerSet({stickerset:new ie.Api.InputStickerSetEmojiDefaultTopicIcons}));if(e instanceof ie.Api.messages.StickerSet)return{set:ft(e.set),stickers:mt(e.documents)}}async function bd(){const e=await wi(new ie.Api.messages.GetStickerSet({stickerset:new ie.Api.InputStickerSetEmojiDefaultStatuses}));if(e instanceof ie.Api.messages.StickerSet)return{set:ft(e.set),stickers:mt(e.documents)}}async function wd(e){let{query:t,hash:n="0"}=e;const s=await wi(new ie.Api.messages.SearchStickerSets({q:t,hash:le()(n)}));if(s&&!(s instanceof ie.Api.messages.FoundStickerSetsNotModified))return{hash:String(s.hash),sets:s.sets.map(gt)}}async function Sd(e){let{hash:t="0"}=e;const n=await wi(new ie.Api.messages.GetSavedGifs({hash:le()(t)}));if(n&&!(n instanceof ie.Api.messages.SavedGifsNotModified))return{hash:String(n.hash),gifs:Rd(n.gifs)}}function vd(e){let{gif:t,shouldUnsave:n}=e;return wi(new ie.Api.messages.SaveGif({id:Un(t),unsave:n}),{shouldReturnTrue:!0})}async function Ad(e){let{stickerSetId:t,accessHash:n}=e;await wi(new ie.Api.messages.InstallStickerSet({stickerset:Bn(t,n)}))&&qc({"@type":"updateStickerSet",id:t,stickerSet:{installedDate:Date.now()}})}async function Id(e){let{stickerSetId:t,accessHash:n}=e;await wi(new ie.Api.messages.UninstallStickerSet({stickerset:Bn(t,n)}))&&qc({"@type":"updateStickerSet",id:t,stickerSet:{installedDate:void 0}})}async function Cd(e){let{query:t,offset:n="",username:s=j}=e;if(!Oc){const e=await wi(new ie.Api.contacts.ResolveUsername({username:s}));if(!(e&&e.users[0]instanceof ie.Api.User))return;Oc=new ie.Api.InputUser({userId:e.peer.userId,accessHash:e.users[0].accessHash})}const a=await wi(new ie.Api.messages.GetInlineBotResults({bot:Oc,peer:new ie.Api.InputPeerEmpty,query:t,offset:n}));if(!a)return;const i=a.results.map((e=>{if(e instanceof ie.Api.BotInlineMediaResult)return e.document})).filter(Boolean);return{nextOffset:a.nextOffset,gifs:Rd(i)}}async function Pd(e){let{emoji:t,hash:n="0"}=e;const s=await wi(new ie.Api.messages.GetStickers({emoticon:t,hash:le()(n)}));if(s&&!(s instanceof ie.Api.messages.StickersNotModified))return{stickers:mt(s.stickers),hash:String(s.hash)}}async function Md(e){let{language:t,fromVersion:n}=e;const s=await wi(new ie.Api.messages.GetEmojiKeywordsDifference({langCode:t,fromVersion:n}));if(s)return{language:s.langCode,version:s.version,keywords:s.keywords.reduce(((e,t)=>(e[t.keyword]=t.emoticons,e)),{})}}async function kd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0";const t=await wi(new ie.Api.account.GetRecentEmojiStatuses({hash:le()(e)}));if(!t||t instanceof ie.Api.account.EmojiStatusesNotModified)return;const n=t.statuses.slice(0,D).map(vs).filter(Boolean).map((e=>{let{documentId:t}=e;return t})),s=await fd({documentId:n});return{hash:String(t.hash),emojiStatuses:s}}function Rd(e){return e.map((e=>{if(e instanceof ie.Api.Document){const t=wt(e);if(t)return Ae.documents[String(e.id)]=e,t}})).filter(Boolean)}const Td=new Set(["USERNAME_PURCHASE_AVAILABLE","USERNAME_INVALID"]);async function Ed(e){let{username:t}=e;try{return{result:await wi(new ie.Api.channels.CheckUsername({channel:new ie.Api.InputChannelEmpty,username:t}),{shouldThrow:!0}),error:void 0}}catch(e){const t=e.message;if(Td.has(t))return{result:!1,error:t};throw e}}async function Bd(e){let{chat:t,username:n}=e;const s=await wi(new ie.Api.channels.UpdateUsername({channel:En(t.id,t.accessHash),username:n}));let a=n?[{username:n,isEditable:!0,isActive:!0}]:[];return t.usernames&&(a=a.concat(t.usernames.filter((e=>e.username&&!e.isEditable)))),s&&Lc({"@type":"updateChat",id:t.id,chat:{usernames:a.length?a:void 0}}),s}async function Ud(e){let{chat:t}=e;const n=await wi(new ie.Api.channels.DeactivateAllUsernames({channel:En(t.id,t.accessHash)}));if(n){const e=t.usernames?t.usernames.map((e=>({...e,isActive:!1}))).filter((e=>e.username)):void 0;Lc({"@type":"updateChat",id:t.id,chat:{usernames:e}})}return n}async function Dd(e){let{chat:t,usageLimit:n,expireDate:s}=e;const a=await wi(new ie.Api.messages.ExportChatInvite({peer:Rn(t.id,t.accessHash),usageLimit:n,expireDate:s}));if(a instanceof ie.Api.ChatInviteExported)return Lc({"@type":"updateChatFullInfo",id:t.id,fullInfo:{inviteLink:a.link}}),a.link}async function xd(e){let{peer:t,admin:n,limit:s=0,isRevoked:a}=e;const i=await wi(new ie.Api.messages.GetExportedChatInvites({peer:Rn(t.id,t.accessHash),adminId:En(n.id,n.accessHash),limit:s,revoked:a||void 0}),{abortControllerChatId:t.id});if(i)return xe(i.users),{invites:i.invites.filter((e=>e instanceof ie.Api.ChatInviteExported)).map(fn),users:i.users.map(ws).filter(Boolean)}}async function Vd(e){let{peer:t,isRevoked:n,link:s,expireDate:a,usageLimit:i,isRequestNeeded:o,title:r}=e;const c=await wi(new ie.Api.messages.EditExportedChatInvite({link:s,peer:Rn(t.id,t.accessHash),expireDate:a,usageLimit:o?void 0:i,requestNeeded:o,title:r,revoked:n||void 0}));if(c){if(xe(c.users),c instanceof ie.Api.messages.ExportedChatInvite&&c.invite instanceof ie.Api.ChatInviteExported){const e=fn(c.invite);return{oldInvite:e,newInvite:e,users:c.users.map(ws).filter(Boolean)}}if(c instanceof ie.Api.messages.ExportedChatInviteReplaced&&c.invite instanceof ie.Api.ChatInviteExported&&c.newInvite instanceof ie.Api.ChatInviteExported)return{oldInvite:fn(c.invite),newInvite:fn(c.newInvite),users:c.users.map(ws).filter(Boolean)}}}async function Fd(e){let{peer:t,expireDate:n,usageLimit:s,isRequestNeeded:a,title:i}=e;const o=await wi(new ie.Api.messages.ExportChatInvite({peer:Rn(t.id,t.accessHash),expireDate:n,usageLimit:a?void 0:s,requestNeeded:a||void 0,title:i}));if(o instanceof ie.Api.ChatInviteExported)return fn(o)}async function Nd(e){let{peer:t,link:n}=e;return await wi(new ie.Api.messages.DeleteExportedChatInvite({peer:Rn(t.id,t.accessHash),link:n}))}async function Hd(e){let{peer:t,admin:n}=e;return await wi(new ie.Api.messages.DeleteRevokedExportedChatInvites({peer:Rn(t.id,t.accessHash),adminId:En(n.id,n.accessHash)}))}async function qd(e){let{peer:t,link:n,offsetDate:s=0,offsetUser:a,limit:i=0,isRequested:o}=e;const r=await wi(new ie.Api.messages.GetChatInviteImporters({peer:Rn(t.id,t.accessHash),link:n,offsetDate:s,offsetUser:a?En(a.id,a.accessHash):new ie.Api.InputUserEmpty,limit:i,requested:o||void 0}),{abortControllerChatId:t.id});if(!r)return;const c=r.users.map((e=>ws(e))).filter(Boolean);return xe(r.users),{importers:r.importers.map((e=>function(e){const{userId:t,date:n,about:s,requested:a,viaChatlist:i}=e;return{userId:ce(t,"user"),date:n,about:s,isRequested:a,isFromChatList:i}}(e))),users:He(c,"id")}}function Od(e){let{peer:t,user:n,isApproved:s}=e;return wi(new ie.Api.messages.HideChatJoinRequest({peer:Rn(t.id,t.accessHash),userId:En(n.id,n.accessHash),approved:s||void 0}),{shouldReturnTrue:!0})}function Ld(e){let{peer:t,isApproved:n,link:s}=e;return wi(new ie.Api.messages.HideAllChatJoinRequests({peer:Rn(t.id,t.accessHash),approved:n||void 0,link:s}),{shouldReturnTrue:!0})}function Gd(e){const{id:t,accessHash:n}=e;return wi(new ie.Api.messages.HidePeerSettingsBar({peer:Rn(t,n)}))}var jd=n(48764).lW;function Wd(e){const{emojies_sounds:t}=e;return t?Object.keys(t).reduce(((e,n)=>{const s=t[n];return Ae.documents[s.id]=new ie.Api.Document({id:le()(s.id),accessHash:le()(s.access_hash),dcId:1,mimeType:"audio/ogg",fileReference:jd.alloc(0),size:le()(0)}),e[n]=s.id,e}),{}):{}}function Kd(e,t,n){return[e[`${t}_default`]||Z[n][0],e[`${t}_premium`]||Z[n][1]]}const zd=["ar","fa","id","ko","uz","en"];function $d(e){let{firstName:t,lastName:n,about:s}=e;return wi(new ie.Api.account.UpdateProfile({firstName:t||"",lastName:n||"",about:s||""}),{shouldReturnTrue:!0})}async function Jd(e){try{return{result:await wi(new ie.Api.account.CheckUsername({username:e}),{shouldThrow:!0}),error:void 0}}catch(e){const t=e.message;if(Td.has(t))return{result:!1,error:t};throw e}}function Qd(e){return wi(new ie.Api.account.UpdateUsername({username:e}),{shouldReturnTrue:!0})}async function Xd(e,t){const n=e?On(e):new ie.Api.InputPhotoEmpty,s=await wi(new ie.Api.photos.UpdateProfilePhoto({id:n,...t?{fallback:!0}:void 0}));if(s)return xe(s.users),s.photo instanceof ie.Api.Photo?(Ue(s.photo),{users:s.users.map(ws).filter(Boolean),photo:at(s.photo)}):void 0}async function Zd(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const a=await Ai(e),i=await wi(new ie.Api.photos.UploadProfilePhoto({...n?{video:a,videoStartTs:s}:{file:a},...t?{fallback:!0}:void 0}));if(i)return xe(i.users),i.photo instanceof ie.Api.Photo?(Ue(i.photo),{users:i.users.map(ws).filter(Boolean),photo:at(i.photo)}):void 0}async function Yd(e){let{file:t,isSuggest:n,user:s}=e;const a=t?await Ai(t):void 0,i=await wi(new ie.Api.photos.UploadContactProfilePhoto({userId:En(s.id,s.accessHash),file:a,...n?{suggest:!0}:{save:!0}}));if(!i)return;xe(i.users);const o=i.users.map(ws).filter(Boolean);return i.photo instanceof ie.Api.Photo?(Ue(i.photo),{users:o,photo:at(i.photo)}):{users:o,photo:void 0}}async function eu(e){const t=e.map(On).filter(Boolean),n=await wi(new ie.Api.photos.DeletePhotos({id:t}),{shouldReturnTrue:!0});return n&&e.forEach((e=>{delete Ae.photos[e.id]})),n}async function tu(){const e=await wi(new ie.Api.account.GetWallPapers({hash:le()("0")}));if(!e||e instanceof ie.Api.account.WallPapersNotModified)return;const t=e.wallpapers.filter((e=>e instanceof ie.Api.WallPaper&&e.document instanceof ie.Api.Document&&!e.pattern&&"application/x-tgwallpattern"!==e.document.mimeType));return t.forEach((e=>{Ae.documents[String(e.document.id)]=e.document})),{wallpapers:t.map(Is).filter(Boolean)}}async function nu(e){const t=await Ai(e),n=await wi(new ie.Api.account.UploadWallPaper({file:t,mimeType:e.type,settings:new ie.Api.WallPaperSettings}));if(!(n&&n instanceof ie.Api.WallPaper))return;const s=Is(n);return s?(Ae.documents[String(n.document.id)]=n.document,{wallpaper:s}):void 0}async function su(e){let{isOnlyStories:t}=e;const n=await wi(new ie.Api.contacts.GetBlocked({myStoriesFrom:t,limit:y}));if(n)return ku(n),{users:n.users.map(ws).filter(Boolean),chats:n.chats.map((e=>en(e))).filter(Boolean),blockedIds:n.blocked.map((e=>de(e.peerId))),totalCount:n instanceof ie.Api.contacts.BlockedSlice?n.count:n.blocked.length}}function au(e){let{user:t,isOnlyStories:n}=e;return wi(new ie.Api.contacts.Block({id:Rn(t.id,t.accessHash),myStoriesFrom:n}))}function iu(e){let{user:t,isOnlyStories:n}=e;return wi(new ie.Api.contacts.Unblock({id:Rn(t.id,t.accessHash),myStoriesFrom:n}))}async function ou(){const e=await wi(new ie.Api.account.GetAuthorizations);if(e)return{authorizations:He(e.authorizations.map(Cs),"hash"),ttlDays:e.authorizationTtlDays}}function ru(e){return wi(new ie.Api.account.ResetAuthorization({hash:le()(e)}))}function cu(){return wi(new ie.Api.auth.ResetAuthorizations)}async function du(){const e=await wi(new ie.Api.account.GetWebAuthorizations);if(e)return xe(e.users),{users:e.users.map(ws).filter(Boolean),webAuthorizations:He(e.authorizations.map(Ps),"hash")}}function uu(e){return wi(new ie.Api.account.ResetWebAuthorization({hash:le()(e)}))}function lu(){return wi(new ie.Api.account.ResetWebAuthorizations)}async function pu(){const e=await wi(new ie.Api.account.GetNotifyExceptions({compareSound:!0}),{shouldIgnoreUpdates:!0});if(e instanceof ie.Api.Updates||e instanceof ie.Api.UpdatesCombined)return ku(e),e.updates.reduce(((e,t)=>t instanceof ie.Api.UpdateNotifySettings&&t.peer instanceof ie.Api.NotifyPeer?(e.push(Ms(t.notifySettings,t.peer.peer)),e):e),[])}async function fu(){const[e,t,n,s]=await Promise.all([wi(new ie.Api.account.GetContactSignUpNotification),wi(new ie.Api.account.GetNotifySettings({peer:new ie.Api.InputNotifyUsers})),wi(new ie.Api.account.GetNotifySettings({peer:new ie.Api.InputNotifyChats})),wi(new ie.Api.account.GetNotifySettings({peer:new ie.Api.InputNotifyBroadcasts}))]);if(!t||!n||!s)return!1;const{silent:a,muteUntil:i,showPreviews:o}=t,{silent:r,muteUntil:c,showPreviews:d}=n,{silent:u,muteUntil:l,showPreviews:p}=s;return{hasContactJoinedNotifications:!e,hasPrivateChatsNotifications:!(a||"number"==typeof i&&ze()<i),hasPrivateChatsMessagePreview:o,hasGroupNotifications:!(r||"number"==typeof c&&ze()<c),hasGroupMessagePreview:d,hasBroadcastNotifications:!(u||"number"==typeof l&&ze()<l),hasBroadcastMessagePreview:p}}function gu(e){return wi(new ie.Api.account.SetContactSignUpNotification({silent:e}))}function hu(e,t){let n,{isSilent:s,shouldShowPreviews:a}=t;n="contact"===e?new ie.Api.InputNotifyUsers:"group"===e?new ie.Api.InputNotifyChats:new ie.Api.InputNotifyBroadcasts;const i={showPreviews:a,silent:s,muteUntil:s?T:0};return wi(new ie.Api.account.UpdateNotifySettings({peer:n,settings:new ie.Api.InputPeerNotifySettings(i)}))}async function mu(){const e=await wi(new ie.Api.langpack.GetLanguages({langPack:$}));if(e)return e.map(ge)}async function _u(e){let{sourceLangPacks:t,langCode:n}=e;const s=(await Promise.all(t.map((e=>wi(new ie.Api.langpack.GetLangPack({langPack:e,langCode:zd.includes(n)?`${n}-raw`:n})))))).filter(Boolean).map(Es);if(s.length)return{langPack:Object.assign({},...s.reverse())}}async function yu(e){let{langPack:t,langCode:n,keys:s}=e;const a=await wi(new ie.Api.langpack.GetStrings({langPack:t,langCode:zd.includes(n)?`${n}-raw`:n,keys:s}));if(a)return a.map(Bs)}async function bu(e){const t=Kn(e),n=await wi(new ie.Api.account.GetPrivacy({key:t}));if(n)return ku(n),{users:n.users.map(ws).filter(Boolean),rules:ct(n.rules)}}function wu(e){const t=pi.session.getAuthKey().getKey();return wi(new ie.Api.account.RegisterDevice({tokenType:10,secret:t,appSandbox:!1,otherUids:[],token:e}))}function Su(e){return wi(new ie.Api.account.UnregisterDevice({tokenType:10,otherUids:[],token:e}))}async function vu(e,t){const n=Kn(e),s=is(t),a=await wi(new ie.Api.account.SetPrivacy({key:n,rules:s}));if(a)return ku(a),{users:a.users.map(ws).filter(Boolean),rules:ct(a.rules)}}async function Au(e){await wi(new ie.Api.account.UpdateStatus({offline:!e}))}async function Iu(){const e=await wi(new ie.Api.account.GetContentSettings);if(e)return{isSensitiveEnabled:Boolean(e.sensitiveEnabled),canChangeSensitive:Boolean(e.sensitiveCanChange)}}function Cu(e){return wi(new ie.Api.account.SetContentSettings({sensitiveEnabled:e||void 0}))}async function Pu(e){const t=await wi(new ie.Api.help.GetAppConfig({hash:e}));if(!t||t instanceof ie.Api.help.AppConfigNotModified)return;const{config:n,hash:s}=t;return function(e,t){const n=Rs(e);return{emojiSounds:Wd(n),seenByMaxChatMembers:n.chat_read_mark_size_threshold,seenByExpiresAt:n.chat_read_mark_expire_period,autologinDomains:n.autologin_domains||[],urlAuthDomains:n.url_auth_domains||[],maxUniqueReactions:n.reactions_uniq_max,premiumBotUsername:n.premium_bot_username,premiumInvoiceSlug:n.premium_invoice_slug,premiumPromoOrder:n.premium_promo_order,isPremiumPurchaseBlocked:n.premium_purchase_blocked,defaultEmojiStatusesStickerSetId:n.default_emoji_statuses_stickerset_id,topicsPinnedLimit:n.topics_pinned_limit,maxUserReactionsDefault:n.reactions_user_max_default,maxUserReactionsPremium:n.reactions_user_max_premium,hiddenMembersMinCount:n.hidden_members_group_size_min,canDisplayAutoarchiveSetting:n.autoarchive_setting_available,limits:{uploadMaxFileparts:Kd(n,"upload_max_fileparts","uploadMaxFileparts"),stickersFaved:Kd(n,"stickers_faved_limit","stickersFaved"),savedGifs:Kd(n,"saved_gifs_limit","savedGifs"),dialogFiltersChats:Kd(n,"dialog_filters_chats_limit","dialogFiltersChats"),dialogFilters:Kd(n,"dialog_filters_limit","dialogFilters"),dialogFolderPinned:Kd(n,"dialogs_pinned_limit","dialogFolderPinned"),captionLength:Kd(n,"caption_length_limit","captionLength"),channels:Kd(n,"channels_limit","channels"),channelsPublic:Kd(n,"channels_public_limit","channelsPublic"),aboutLength:Kd(n,"about_length_limit","aboutLength"),chatlistInvites:Kd(n,"chatlist_invites_limit","chatlistInvites"),chatlistJoined:Kd(n,"chatlist_joined_limit","chatlistJoined")},hash:t,areStoriesHidden:n.stories_all_hidden,storyExpirePeriod:n.story_expire_period??Q,storyViewersExpirePeriod:n.story_viewers_expire_period??X,storyChangelogUserId:n.stories_changelog_user_id?.toString()??L}}(n,s)}async function Mu(){const e=await wi(new ie.Api.help.GetConfig);if(e)return function(e){const t=e.reactionsDefault&&zt(e.reactionsDefault);return{expiresAt:e.expires,gifSearchUsername:e.gifSearchUsername,defaultReaction:t,maxGroupSize:e.chatSizeMax,autologinToken:e.autologinToken}}(e)}function ku(e){xe(e.users),xe(e.chats)}async function Ru(e){let{langCode:t="en"}=e;const n=await wi(new ie.Api.help.GetCountriesList({langCode:t}));if(n instanceof ie.Api.help.CountriesList)return function(e){const t=e.filter((e=>{let{hidden:t}=e;return!t}));return{phoneCodes:t.map((e=>e.countryCodes.map((t=>ks(e,t))))).flat().sort(((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName))),general:t.map((e=>ks(e,e.countryCodes[0]))).sort(((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName)))}}(n.countries)}async function Tu(){const e=await wi(new ie.Api.account.GetGlobalPrivacySettings);if(e)return{shouldArchiveAndMuteNewNonContact:Boolean(e.archiveAndMuteNewNoncontactPeers)}}async function Eu(e){let{shouldArchiveAndMuteNewNonContact:t}=e;const n=await wi(new ie.Api.account.SetGlobalPrivacySettings({settings:new ie.Api.GlobalPrivacySettings({...t&&{archiveAndMuteNewNoncontactPeers:!0}})}));if(n)return{shouldArchiveAndMuteNewNonContact:Boolean(n.archiveAndMuteNewNoncontactPeers)}}function Bu(e){let{chatId:t,accessHash:n,username:s,isActive:a}=e;return wi(t?new ie.Api.channels.ToggleUsername({channel:En(t,n),username:s,active:a}):new ie.Api.account.ToggleUsername({username:s,active:a}))}function Uu(e){let{chatId:t,accessHash:n,usernames:s}=e;return wi(t?new ie.Api.channels.ReorderUsernames({channel:En(t,n),order:s}):new ie.Api.account.ReorderUsernames({order:s}))}const Du={EMAIL_UNCONFIRMED:"Email unconfirmed",EMAIL_HASH_EXPIRED:"Email hash expired",NEW_SALT_INVALID:"The new salt is invalid",NEW_SETTINGS_INVALID:"The new password settings are invalid",CODE_INVALID:"Invalid Code",PASSWORD_HASH_INVALID:"Invalid Password"},xu={};let Vu,Fu;async function Nu(){const e=await wi(new ie.Api.account.GetPassword);if(!e)return;const{hint:t,hasPassword:n}=e;return{hint:t,hasPassword:n}}function Hu(e){return Vu({"@type":"updateTwoFaStateWaitCode",length:e}),new Promise(((e,t)=>{xu.resolve=e,xu.reject=t}))}async function qu(e){try{return await Ii({isCheckPassword:!0,currentPassword:e}),!0}catch(e){return Wu(e),!1}}async function Ou(e){try{return await Ii({currentPassword:e}),!0}catch(e){return Wu(e),!1}}async function Lu(e,t,n,s){try{return await Ii({currentPassword:e,newPassword:t,hint:n,email:s,emailCodeCallback:Hu,onEmailCodeError:Wu}),!0}catch(e){return Wu(e),!1}}async function Gu(e,t){try{return await Ii({currentPassword:e,newPassword:e,email:t,emailCodeCallback:Hu,onEmailCodeError:Wu}),!0}catch(e){return Wu(e),!1}}function ju(e){xu.resolve(e)}function Wu(e){let t;if(e instanceof ie.errors.FloodWaitError){const n=Math.ceil(Number(e.seconds)/60/60);t="Too many attempts. Try again in "+(n>1?`${n} hours`:"an hour")}else t=Du[e.message];t||(t="Unexpected Error",c&&console.error(e)),Vu({"@type":"updateTwoFaError",message:t})}function Ku(e){if(e)return Object.values(e).map((e=>({id:e.id,title:e.title,amount:e.prices.reduce(((e,t)=>e+t.amount.toJSNumber()),0),prices:e.prices.map((e=>{let{label:t,amount:n}=e;return{label:t,amount:n.toJSNumber()}}))})))}function zu(e){const{invoice:t,info:n,shipping:s,currency:a,totalAmount:i,credentialsTitle:o,tipAmount:r}=e,{shippingAddress:c,phone:d,name:u}=n||{},{prices:l}=t,p=l.map((e=>{let{label:t,amount:n}=e;return{label:t,amount:n.toJSNumber()}}));let f,g;return s&&(f=s.prices.map((e=>{let{label:t,amount:n}=e;return{label:t,amount:n.toJSNumber()}})),g=s.title),{currency:a,prices:p,info:{shippingAddress:c,phone:d,name:u},totalAmount:i.toJSNumber(),credentialsTitle:o,shippingPrices:f,shippingMethod:g,tipAmount:r?r.toJSNumber():0}}function $u(e){const{formId:t,canSaveCredentials:n,passwordMissing:s,providerId:a,nativeProvider:i,nativeParams:o,savedInfo:r,invoice:c,savedCredentials:d}=e,{test:u,nameRequested:l,phoneRequested:p,emailRequested:f,shippingAddressRequested:g,flexible:h,phoneToProvider:m,emailToProvider:_,currency:y,prices:b}=c,w=b.map((e=>{let{label:t,amount:n}=e;return{label:t,amount:n.toJSNumber()}})),{shippingAddress:S}=r||{},v=r?ge(r):void 0;v&&S&&(v.shippingAddress=ge(S));const A=o?JSON.parse(o.data):{};return{canSaveCredentials:n,isPasswordMissing:s,formId:String(t),providerId:String(a),nativeProvider:i,savedInfo:v,invoiceContainer:{isTest:u,isNameRequested:l,isPhoneRequested:p,isEmailRequested:f,isShippingAddressRequested:g,isFlexible:h,shouldSendPhoneToProvider:m,shouldSendEmailToProvider:_,currency:y,prices:w},nativeParams:{needCardholderName:Boolean(A?.need_cardholder_name),needCountry:Boolean(A?.need_country),needZip:Boolean(A?.need_zip),publishableKey:A?.publishable_key,publicToken:A?.public_token},...d&&{savedCredentials:(I=d,I.map((e=>{let{id:t,title:n}=e;return{id:t,title:n}})))}};var I}function Ju(e){const{invoice:t,description:n,title:s,photo:a}=e,{test:i,currency:o,prices:r,recurring:c,termsUrl:d,maxTipAmount:u,suggestedTipAmounts:l}=t,p=r.reduce(((e,t)=>e+t.amount.toJSNumber()),0);return{text:n,title:s,photo:kt(a),amount:p,currency:o,isTest:i,isRecurring:c,termsUrl:d,maxTipAmount:u?.toJSNumber(),...l&&{suggestedTipAmounts:l.map((e=>e.toJSNumber()))}}}function Qu(e){const{statusText:t,statusEntities:n,videos:s,videoSections:a,periodOptions:i}=e;return{statusText:t,statusEntities:n.map(dt),videoSections:a,videos:s.map(St).filter(Boolean),options:i.map(Xu)}}function Xu(e){const{current:t,canPurchaseUpgrade:n,currency:s,amount:a,botUrl:i,months:o}=e;return{isCurrent:t,canPurchaseUpgrade:n,currency:s,amount:a.toString(),botUrl:i,months:o}}async function Zu(e){let{inputInvoice:t,requestInfo:n,shouldSave:s}=e;const a=await wi(new ie.Api.payments.ValidateRequestedInfo({invoice:Zn(t),save:s||void 0,info:Wn(n)}));if(!a)return;const{id:i,shippingOptions:o}=a;return i?{id:i,shippingOptions:Ku(o)}:void 0}async function Yu(e){let{inputInvoice:t,formId:n,requestedInfoId:s,shippingOptionId:a,credentials:i,savedCredentialId:o,temporaryPassword:r,tipAmount:c}=e;const d=r&&o?new ie.Api.InputPaymentCredentialsSaved({id:o,tmpPassword:Fe(r)}):new ie.Api.InputPaymentCredentials({save:i.save,data:new ie.Api.DataJSON({data:JSON.stringify(i.data)})}),u=await wi(new ie.Api.payments.SendPaymentForm({formId:le()(n),invoice:Zn(t),requestedInfoId:s,shippingOptionId:a,credentials:d,...c&&{tipAmount:le()(c)}}));if(!(u instanceof ie.Api.payments.PaymentVerificationNeeded))return Boolean(u);Fu({"@type":"updatePaymentVerificationNeeded",url:u.url})}async function el(e){const t=await wi(new ie.Api.payments.GetPaymentForm({invoice:Zn(e)}));if(t)return t.photo&&(Ae.webDocuments[t.photo.url]=t.photo),xe(t.users),{form:$u(t),invoice:Ju(t),users:t.users.map(ws).filter(Boolean)}}async function tl(e,t){const n=await wi(new ie.Api.payments.GetPaymentReceipt({peer:Rn(e.id,e.accessHash),msgId:t}));if(n)return xe(n.users),{receipt:zu(n),users:n.users.map(ws).filter(Boolean)}}async function nl(){const e=await wi(new ie.Api.help.GetPremiumPromo);if(!e)return;xe(e.users);const t=e.users.map(ws).filter(Boolean);return e.videos.forEach((e=>{e instanceof ie.Api.Document&&(Ae.documents[e.id.toString()]=e)})),{promo:Qu(e),users:t}}async function sl(e){const t=await function(e,t){return function(e,t){return pi.getTmpPassword(e,t)}(e,t)}(e);if(t)return"error"in t?t:{value:Ve(t.tmpPassword),validUntil:t.validUntil}}function al(e){let{chat:t,emoticon:n}=e;return wi(new ie.Api.messages.SetTyping({peer:Rn(t.id,t.accessHash),action:new ie.Api.SendMessageEmojiInteractionSeen({emoticon:n})}),{abortControllerChatId:t.id})}function il(e){let{chat:t,emoticon:n,messageId:s,timestamps:a}=e;return wi(new ie.Api.messages.SetTyping({peer:Rn(t.id,t.accessHash),action:new ie.Api.SendMessageEmojiInteraction({emoticon:n,msgId:s,interaction:new ie.Api.DataJSON({data:JSON.stringify({v:1,a:a.map((e=>({t:e,i:1})))})})})}),{abortControllerChatId:t.id})}async function ol(){const e=await wi(new ie.Api.messages.GetAvailableReactions({}));if(e&&!(e instanceof ie.Api.messages.AvailableReactionsNotModified))return e.reactions.forEach((e=>{e.staticIcon instanceof ie.Api.Document&&(Ae.documents[String(e.staticIcon.id)]=e.staticIcon),e.selectAnimation instanceof ie.Api.Document&&(Ae.documents[String(e.selectAnimation.id)]=e.selectAnimation),e.aroundAnimation instanceof ie.Api.Document&&(Ae.documents[String(e.aroundAnimation.id)]=e.aroundAnimation),e.appearAnimation instanceof ie.Api.Document&&(Ae.documents[String(e.appearAnimation.id)]=e.appearAnimation),e.centerIcon instanceof ie.Api.Document&&(Ae.documents[String(e.centerIcon.id)]=e.centerIcon)})),e.reactions.map($t)}function rl(e){let{chat:t,messageId:n,reactions:s,shouldAddToRecent:a}=e;return wi(new ie.Api.messages.SendReaction({reaction:s?.map((e=>Yn(e))),peer:Rn(t.id,t.accessHash),msgId:n,...a&&{addToRecent:!0}}),{shouldReturnTrue:!0,shouldThrow:!0})}function cl(e){let{ids:t,chat:n}=e;return wi(new ie.Api.messages.GetMessagesReactions({id:t,peer:Rn(n.id,n.accessHash)}),{shouldReturnTrue:!0,abortControllerChatId:n.id})}async function dl(e){let{chat:t,messageId:n,reaction:s,offset:a}=e;const i=await wi(new ie.Api.messages.GetMessageReactionsList({peer:Rn(t.id,t.accessHash),id:n,...s&&{reaction:Yn(s)},limit:C,...a&&{offset:a}}));if(!i)return;xe(i.users),xe(i.chats);const{nextOffset:o,reactions:r,count:c}=i;return{users:i.users.map(ws).filter(Boolean),chats:i.chats.map((e=>en(e))).filter(Boolean),nextOffset:o,reactions:r.map(Kt).filter(Boolean),count:c}}function ul(e){let{reaction:t}=e;return wi(new ie.Api.messages.SetDefaultReaction({reaction:Yn(t)}))}async function ll(e){let{hash:t="0"}=e;const n=await wi(new ie.Api.messages.GetTopReactions({limit:A,hash:le()(t)}));if(n&&!(n instanceof ie.Api.messages.ReactionsNotModified))return{hash:String(n.hash),reactions:n.reactions.map(zt).filter(Boolean)}}async function pl(e){let{hash:t="0"}=e;const n=await wi(new ie.Api.messages.GetRecentReactions({limit:I,hash:le()(t)}));if(n&&!(n instanceof ie.Api.messages.ReactionsNotModified))return{hash:String(n.hash),reactions:n.reactions.map(zt).filter(Boolean)}}function fl(){return wi(new ie.Api.messages.ClearRecentReactions)}async function gl(e){let{chat:t,dcId:n}=e;const s=await wi(new ie.Api.stats.GetBroadcastStats({channel:En(t.id,t.accessHash)}),{dcId:n});var a;if(s)return{stats:(a=s,{growthGraph:Us(a.growthGraph),followersGraph:Us(a.followersGraph),muteGraph:Us(a.muteGraph),topHoursGraph:Us(a.topHoursGraph),languagesGraph:a.languagesGraph.token,viewsBySourceGraph:a.viewsBySourceGraph.token,newFollowersBySourceGraph:a.newFollowersBySourceGraph.token,interactionsGraph:a.interactionsGraph.token,followers:xs(a.followers),viewsPerPost:xs(a.viewsPerPost),sharesPerPost:xs(a.sharesPerPost),enabledNotifications:Vs(a.enabledNotifications),recentTopMessages:a.recentMessageInteractions}),users:[]}}async function hl(e){let{chat:t,dcId:n}=e;const s=await wi(new ie.Api.stats.GetMegagroupStats({channel:En(t.id,t.accessHash)}),{dcId:n});var a,i;if(s)return xe(s.users),{users:s.users.map(ws).filter(Boolean),stats:(a=s,{growthGraph:Us(a.growthGraph),membersGraph:Us(a.membersGraph),topHoursGraph:Us(a.topHoursGraph),languagesGraph:a.languagesGraph.token,messagesGraph:a.messagesGraph.token,actionsGraph:a.actionsGraph.token,period:(i=a.period,{maxDate:i.maxDate,minDate:i.minDate}),members:xs(a.members),viewers:xs(a.viewers),messages:xs(a.messages),posters:xs(a.posters)})}}async function ml(e){let{chat:t,messageId:n,dcId:s}=e;const a=await wi(new ie.Api.stats.GetMessageStats({channel:En(t.id,t.accessHash),msgId:n}),{dcId:s});if(a)return{viewsGraph:Us(a.viewsGraph)}}async function _l(e){let{chat:t,messageId:n,dcId:s}=e;const a=await wi(new ie.Api.stats.GetMessagePublicForwards({channel:En(t.id,t.accessHash),msgId:n,offsetPeer:new ie.Api.InputPeerEmpty}),{dcId:s});if(a)return"chats"in a&&xe(a.chats),function(e){if(e&&"messages"in e)return e.messages.map((t=>{const n=ce(t.peerId.channelId,"channel"),s=e.chats.find((e=>ce(e.id,"channel")===n));return{messageId:t.id,views:t.views,title:s.title,chat:{id:n,type:"chatTypeChannel",title:s.title,username:s.username,avatarHash:on(s.photo)}}}))}(a)}async function yl(e){let{token:t,x:n,isPercentage:s,dcId:a}=e;const i=await wi(new ie.Api.stats.LoadAsyncGraph({token:t,...n&&{x:le()(n)}}),{dcId:a});if(i)return Us(i,s)}var bl=n(13302),wl=n.n(bl),Sl=n(96748),vl=n.n(Sl),Al=n(59109),Il=n.n(Al),Cl=n(48764).lW;function Pl(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Ml,kl;class Rl{constructor(e){this.isOutgoing=e,Pl(this,"state",void 0),Pl(this,"seq",0),Pl(this,"gA",void 0),Pl(this,"gB",void 0),Pl(this,"p",void 0),Pl(this,"random",void 0),Pl(this,"waitForState",void 0),Pl(this,"resolveState",void 0),this.waitForState=new Promise((e=>{this.resolveState=e}))}async requestCall(e){let{p:t,g:n,random:s}=e;const a=Cn().readBigIntFromBuffer(Cl.from(t),!1),i=Cn().readBigIntFromBuffer(Cl.from(s),!1),o=Cn().modExp(le()(n),i,a);this.gA=o,this.p=a,this.random=i;const r=await Cn().sha256(Cn().getByteArray(o));return Array.from(r)}acceptCall(e){let{p:t,g:n,random:s}=e;const a=Cn().readBigIntFromBuffer(t,!1),i=Cn().readBigIntFromBuffer(s,!1),o=Cn().modExp(le()(n),i,a);return this.gB=o,this.p=a,this.random=i,Array.from(Cn().getByteArray(o))}async confirmCall(e,t,n){this.isOutgoing?this.gB=Cn().readBigIntFromBuffer(Cl.from(e),!1):this.gA=Cn().readBigIntFromBuffer(Cl.from(e),!1);const s=Cn().modExp(this.isOutgoing?this.gB:this.gA,this.random,this.p),a=await Cn().sha1(Cn().getByteArray(s)),i=Cn().readBigIntFromBuffer(a.slice(-8).reverse(),!1),o=await async function(e,t,n,s){const a=await Cn().sha256(Cl.concat([new Uint8Array(e),new Uint8Array(t)])),i=[],o=s.length-1;for(let e=0;e!==a.byteLength;e+=8){const t=(r=a.subarray(e,e+8),le()(r[0]).and(127).shiftLeft(56).or(le()(r[1]).shiftLeft(48)).or(le()(r[2]).shiftLeft(40)).or(le()(r[3]).shiftLeft(32)).or(le()(r[4]).shiftLeft(24)).or(le()(r[5]).shiftLeft(16)).or(le()(r[6]).shiftLeft(8)).or(le()(r[7]))).modPow(1,o).toJSNumber(),c=s[t],d=s[t+1]-c;i.push(String.fromCharCode(...n.subarray(c,c+d)))}var r;return i.join("")}(Cn().getByteArray(s),Cn().getByteArray(this.gA),t,n),r=new(wl());return await r.setKey(Cn().getByteArray(s)),this.state=new(Il())(r,new(vl()),!0,this.isOutgoing),this.resolveState(),{gA:Array.from(Cn().getByteArray(this.gA)),keyFingerprint:i.toString(),emojis:o}}async encode(e){if(!this.state)return;const t=new Uint32Array(1);t[0]=this.seq++;const n=await this.state.encryptMessageData(Cl.concat([Cn().convertToLittle(t),Cl.from(e)]));return Array.from(n)}async decode(e){if(!this.state)return this.waitForState.then((()=>this.decode(e)));const t=await this.state.decryptMessageData(Cl.from(e));return JSON.parse(t.toString())}}function Tl(e){Ml=new Rl(...e)}function El(){Ml=void 0}function Bl(e){return Ml.encode(...e)}function Ul(e){return Ml.decode(...e)}function Dl(e){return Ml.confirmCall(...e)}function xl(e){return Ml.acceptCall(...e)}function Vl(e){return Ml.requestCall(...e)}async function Fl(e){let{stateHash:t,isFirstRequest:n=!1,isHidden:s=!1}=e;const a=n?s?{hidden:!0}:{}:{state:t,next:!0,...s&&{hidden:!0}},i=await wi(new ie.Api.stories.GetAllStories(a));if(!i)return;if(i instanceof ie.Api.stories.AllStoriesNotModified)return{state:i.state,stealthMode:Hs(i.stealthMode)};xe(i.users),xe(i.chats),i.peerStories.forEach((e=>e.stories.forEach((t=>Be(t,de(e.peer))))));const o=i.peerStories.reduce(((e,t)=>{const n=de(t.peer),s=function(e){const t=de(e.peer);return qe(e.stories,(e=>[e.id,Fs(t,e)]))}(t),{pinnedIds:a,orderedIds:i,lastUpdatedAt:o}=Object.values(s).reduce(((e,t)=>("isPinned"in t&&t.isPinned&&e.pinnedIds.push(t.id),"isDeleted"in t||(e.orderedIds.push(t.id),e.lastUpdatedAt=Math.max(t.date,e.lastUpdatedAt||0)),e)),{pinnedIds:[],orderedIds:[],lastUpdatedAt:void 0});return 0===i.length||(e[n]={byId:s,orderedIds:i,pinnedIds:a,lastUpdatedAt:o,lastReadId:t.maxReadId}),e}),{});return{users:i.users.map(ws).filter(Boolean),chats:i.chats.map((e=>en(e))).filter(Boolean),peerStories:o,hasMore:i.hasMore,state:i.state,stealthMode:Hs(i.stealthMode)}}async function Nl(e){let{peer:t}=e;const n=await wi(new ie.Api.stories.GetPeerStories({peer:Rn(t.id,t.accessHash)}));if(!n)return;xe(n.users),n.stories.stories.forEach((e=>Be(e,t.id)));const s=n.users.map(ws).filter(Boolean);return{chats:n.chats.map((e=>en(e))).filter(Boolean),users:s,stories:qe(n.stories.stories,(e=>[e.id,Fs(t.id,e)])),lastReadStoryId:n.stories.maxReadId}}function Hl(e){let{peer:t,offsetId:n}=e;return Zl({method:new ie.Api.stories.GetPinnedStories({peer:Rn(t.id,t.accessHash),offsetId:n,limit:v}),peerId:t.id})}function ql(e){let{peer:t,offsetId:n}=e;return Zl({method:new ie.Api.stories.GetStoriesArchive({peer:t&&Rn(t.id,t.accessHash),offsetId:n,limit:v}),peerId:t.id})}async function Ol(e){let{peer:t,ids:n}=e;const s=await wi(new ie.Api.stories.GetStoriesByID({peer:Rn(t.id,t.accessHash),id:n}));if(!s)return;xe(s.users),xe(s.chats),s.stories.forEach((e=>Be(e,t.id)));const a=s.users.map(ws).filter(Boolean);return{chats:s.chats.map((e=>en(e))).filter(Boolean),users:a,stories:n.reduce(((e,n)=>{const a=s.stories.find((e=>{let{id:t}=e;return t===n}));return e[n]=a?Fs(t.id,a):{id:n,peerId:t.id,isDeleted:!0},e}),{})}}function Ll(e){let{peer:t,storyId:n}=e;return wi(new ie.Api.stories.IncrementStoryViews({peer:Rn(t.id,t.accessHash),id:[n]}))}function Gl(e){let{peer:t,storyId:n}=e;return wi(new ie.Api.stories.ReadStories({peer:Rn(t.id,t.accessHash),maxId:n}))}function jl(e){let{peer:t,storyId:n}=e;return wi(new ie.Api.stories.DeleteStories({peer:Rn(t.id,t.accessHash),id:[n]}))}function Wl(e){let{peer:t,storyId:n,isPinned:s}=e;return wi(new ie.Api.stories.TogglePinned({peer:Rn(t.id,t.accessHash),id:[n],pinned:s}))}async function Kl(e){let{peer:t,storyId:n,areJustContacts:s,query:a,areReactionsFirst:i,limit:o=v,offset:r=""}=e;const c=await wi(new ie.Api.stories.GetStoryViewsList({peer:Rn(t.id,t.accessHash),id:n,justContacts:s,q:a,reactionsFirst:i,limit:o,offset:r}));if(c)return xe(c.users),{users:c.users.map(ws).filter(Boolean),views:c.views.map(Ns),nextOffset:c.nextOffset,reactionsCount:c.reactionsCount,viewsCount:c.count}}async function zl(e){let{peer:t,storyId:n}=e;const s=await wi(new ie.Api.stories.ExportStoryLink({peer:Rn(t.id,t.accessHash),id:n}));if(s)return s.link}function $l(e){let{peer:t,storyId:n,reason:s,description:a}=e;return wi(new ie.Api.stories.Report({peer:Rn(t.id,t.accessHash),id:[n],reason:zn(s),message:a}))}function Jl(e){let{peer:t,id:n,privacy:s}=e;return wi(new ie.Api.stories.EditStory({peer:Rn(t.id,t.accessHash),id:n,privacyRules:is(s)}),{shouldReturnTrue:!0})}function Ql(e){let{peer:t,isHidden:n}=e;return wi(new ie.Api.stories.TogglePeerStoriesHidden({peer:Rn(t.id,t.accessHash),hidden:n}))}function Xl(e){let{peers:t}=e;return wi(new ie.Api.stories.GetPeerMaxIDs({id:t.map((e=>Rn(e.id,e.accessHash)))}))}async function Zl(e){let{method:t,peerId:n}=e;const s=await wi(t);if(s)return xe(s.users),xe(s.chats),s.stories.forEach((e=>Be(e,n))),{users:s.users.map(ws).filter(Boolean),chats:s.chats.map((e=>en(e))).filter(Boolean),stories:qe(s.stories,(e=>[e.id,Fs(n,e)]))}}function Yl(e){let{peer:t,storyId:n,reaction:s,shouldAddToRecent:a}=e;return wi(new ie.Api.stories.SendReaction({reaction:s?Yn(s):new ie.Api.ReactionEmpty,peer:Rn(t.id,t.accessHash),storyId:n,...a&&{addToRecent:!0}}),{shouldReturnTrue:!0})}function ep(e){let{isForPast:t,isForFuture:n}=e;return wi(new ie.Api.stories.ActivateStealthMode({past:t,future:n}),{shouldReturnTrue:!0})}async function tp(e){let t,{chat:n}=e;try{t=await wi(new ie.Api.stories.CanApplyBoost({peer:Rn(n.id,n.accessHash)}),{shouldThrow:!0})}catch(e){const t=function(e){return e instanceof ie.errors.FloodWaitError?{type:"wait",waitUntil:ze()+e.seconds}:e instanceof Error&&"BOOST_NOT_MODIFIED"===e.message?{type:"already"}:void 0}(e);if(!t)return;return{info:t,chats:[]}}if(!t)return;const s="chats"in t?t.chats:[];xe(s);const a=s.map((e=>en(e))).filter(Boolean);var i;return{info:(i=t)instanceof ie.Api.stories.CanApplyBoostOk?{type:"ok"}:i instanceof ie.Api.stories.CanApplyBoostReplace?{type:"replace",boostedChatId:de(i.currentBoost)}:void 0,chats:a}}function np(e){let{chat:t}=e;return wi(new ie.Api.stories.ApplyBoost({peer:Rn(t.id,t.accessHash)}),{shouldReturnTrue:!0})}async function sp(e){let{chat:t}=e;const n=await wi(new ie.Api.stories.GetBoostsStatus({peer:Rn(t.id,t.accessHash)}));if(n)return function(e){const{level:t,boostUrl:n,boosts:s,myBoost:a,currentLevelBoosts:i,nextLevelBoosts:o,premiumAudience:r}=e;return{level:t,currentLevelBoosts:i,boosts:s,hasMyBoost:Boolean(a),boostUrl:n,nextLevelBoosts:o,...r&&{premiumAudience:Vs(r)}}}(n)}function ap(e,t,n){var s;kl=e,function(e){zs=e}(dp),function(e){ea=e}(dp),function(e){ao=e}(dp),function(e){zr=e}(dp),function(e){Hc=e}(dp),function(e){qc=e}(dp),function(e){Lc=e}(dp),function(e){Vu=e}(dp),function(e){Ui=e}(dp),function(e){so=e}(dp),function(e){Fu=e}(dp),n&&(s=n,Object.assign(ve,Se(s))),async function(e,t){c&&console.log(">>> START INIT API"),li=e;const{userAgent:n,platform:s,sessionData:a,isTest:r,isWebmSupported:d,maxBufferSize:u,webAuthToken:l,dcId:p,mockScenario:f,shouldForceHttpTransport:g,shouldAllowHttpTransport:h,shouldDebugExportedSenders:m}=t,_=new ie.sessions.CallbackSession(a,yi);self.isWebmSupported=d,self.maxBufferSize=u,pi=new(ma())(_,"2496","8da85b0d5bfe62527e5b244c209159c3",{deviceModel:navigator.userAgent||n||oi,systemVersion:s||ri,appVersion:`10.0.12 ${i}`,useWSS:!0,additionalDcsDisabled:o,shouldDebugExportedSenders:m,shouldForceHttpTransport:g,shouldAllowHttpTransport:h,testServers:r,dcId:p}),pi.addEventHandler(bi,ci);try{c&&(Ne("CONNECTING"),self.invoke=wi,self.GramJs=ie.Api);try{pi.setPingCallback(Na),await pi.start({phoneNumber:na,phoneCode:sa,password:aa,firstAndLastNames:ia,qrCode:oa,onError:ra,initialMethod:"iOS"===s||"Android"===s?"phoneNumber":"qrCode",shouldThrowIfUnauthorized:Boolean(a),webAuthToken:l,webAuthTokenFailed:ta,mockScenario:f})}catch(e){if(console.error(e),"Disconnect"!==e.message&&"Cannot send requests while disconnected"!==e.message)return void li({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}c&&(console.log(">>> FINISH INIT API"),Ne("CONNECTED")),ea(ca("authorizationStateReady")),yi(_.getSessionData()),li({"@type":"updateApiReady"}),async function(e){Aa=e,await La(),Ca=!0,Va()}(wi),Mi()}catch(e){throw c&&Ne("CONNECTING ERROR",e),e}}(dp,t)}const ip=te((function(e){if(!cp||e!==rp)return;const t=cp;cp=void 0,t.forEach(kl)}));let op,rp,cp;function dp(e){cp?cp.push(e):cp=[e],op&&!B.has(e["@type"])||(op=ee(ip,E,!0),rp=Math.random()),op(rp)}const up=Y.reduce(((e,t)=>(e[t]=console[t],e)),{});self.onerror=e=>{console.error(e),hp({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",(e=>{console.error(e),hp({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})}));const lp=new Map;c&&console.log(">>> FINISH LOAD WORKER"),onmessage=async e=>{const{data:t}=e;switch(t.type){case"initApi":{const{messageId:e,args:n}=t;await ap(gp,n[0],n[1]),e&&hp({type:"methodResponse",messageId:e,response:!0});break}case"callMethod":{const{messageId:e,name:n,args:s,withCallback:i}=t;try{if(e&&i){const t=function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];const a=n[n.length-1];hp({type:"methodCallback",messageId:e,callbackArgs:n},a instanceof ArrayBuffer?a:void 0)};lp.set(e,t),s.push(t)}const t=await function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return a[e](...n)}(n,...s);c&&"object"==typeof t&&"CONSTRUCTOR_ID"in t&&Ne("UNEXPECTED RESPONSE",`${n}: ${t.className}`);const{arrayBuffer:o}="object"==typeof t&&"arrayBuffer"in t&&t||{};e&&hp({type:"methodResponse",messageId:e,response:t},o)}catch(t){c&&console.error(t),e&&hp({type:"methodResponse",messageId:e,error:{message:t.message}})}e&&lp.delete(e);break}case"cancelProgress":{const e=lp.get(t.messageId);e&&(e.isCanceled=!0);break}case"ping":hp({type:"methodResponse",messageId:t.messageId});break;case"toggleDebugMode":t.isEnabled?Y.forEach((e=>{console[e]=function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];postMessage({type:"debugLog",level:e,args:JSON.parse(JSON.stringify(n,((e,t)=>"bigint"==typeof t?t.toString():t)))})}})):Y.forEach((e=>{console[e]=up[e]}))}};let pp=[];const fp=te((()=>{const e=pp;pp=[],hp({type:"updates",updates:e})}));function gp(e){c&&"updateUserStatus"!==e["@type"]&&"updateServerTimeOffset"!==e["@type"]&&Ne("UPDATE",e["@type"],e),pp.push(e),fp()}function hp(e,t){t?postMessage(e,[t]):postMessage(e)}},89618:(e,t,n)=>{var s=n(48764).lW;const a=n(24736),i=n(66842);function o(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=s.from(e);const o=i.length;t&&(i=i.reverse());let r=a(i.toString("hex"),16);return n&&Math.floor(r.toString(2).length/8)>=o&&(r=r.subtract(a(2).pow(a(8*o)))),r}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const n=a(e),i=[];for(let e=0;e<t;e++)i[e]=n.shiftRight(8*e).and(255);return s.from(i)}function c(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=(e=a(e)).bitLength().toJSNumber();if(t<Math.ceil(o/8))throw new Error("OverflowError: int too big to convert");if(!i&&e.lesser(a(0)))throw new Error("Cannot convert to unsigned");let r=!1;e.lesser(a(0))&&(r=!0,e=e.abs());const c=e.toString(16).padStart(2*t,"0");let d=s.from(c,"hex");if(i&&r){d[d.length-1]=256-d[d.length-1];for(let e=0;e<d.length-1;e++)d[e]=255-d[e]}return n&&(d=d.reverse()),d}function d(e){return s.from(i.randomBytes(e))}function u(e){const t=i.createHash("sha1");return t.update(e),t.digest()}let l;e.exports={readBigIntFromBuffer:o,readBufferFromBigInt:c,generateRandomLong:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return o(d(8),!0,e)},mod:function(e,t){return(e%t+t)%t},crc32:function(e){l||(l=function(){let e;const t=[];for(let n=0;n<256;n++){e=n;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}()),s.isBuffer(e)||(e=s.from(e));let t=-1;for(let n=0;n<e.length;n++){const s=e[n];t=l[255&(t^s)]^t>>>8}return(-1^t)>>>0},generateRandomBytes:d,generateKeyDataFromNonce:async function(e,t){e=r(e,16),t=r(t,32);const[n,a,i]=await Promise.all([u(s.concat([t,e])),u(s.concat([e,t])),u(s.concat([t,t]))]);return{key:s.concat([n,a.slice(0,12)]),iv:s.concat([a.slice(12,20),i,t.slice(0,4)])}},sha1:u,sha256:function(e){const t=i.createHash("sha256");return t.update(e),t.digest()},bigIntMod:function(e,t){return e.remainder(t).add(t).remainder(t)},modExp:function(e,t,n){e=e.remainder(n);let s=a.one,i=e;for(;t.greater(a.zero);){const e=t.remainder(a(2));t=t.divide(a(2)),e.eq(a.one)&&(s=s.multiply(i),s=s.remainder(n)),i=i.multiply(i),i=i.remainder(n)}return s},getRandomInt:function(e,t){return e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e},sleep:e=>new Promise((t=>{setTimeout(t,e)})),getByteArray:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.toString(2).length,s=Math.floor((n+8-1)/8);return c(a(e),s,!1,t)},toSignedLittleBuffer:r,convertToLittle:function(e){const t=s.alloc(4*e.length);for(let n=0;n<e.length;n++)t.writeUInt32BE(e[n],4*n);return t},bufferXor:function(e,t){const n=[];for(let s=0;s<e.length;s++)n.push(e[s]^t[s]);return s.from(n)}}},59674:(e,t,n)=>{var s=n(48764).lW;const a=n(24736),{constructors:i}=n(57404),{readBigIntFromBuffer:o,readBufferFromBigInt:r,sha256:c,bigIntMod:d,modExp:u,generateRandomBytes:l}=n(89618),p=n(66842);function f(e,t){if(!s.from([199,28,174,185,198,177,201,4,142,108,82,47,112,241,63,115,152,13,64,35,142,62,33,193,73,52,208,55,86,61,147,15,72,25,138,10,167,193,64,88,34,148,147,210,37,48,244,219,250,51,111,110,10,201,37,19,149,67,174,212,76,206,124,55,32,253,81,246,148,88,112,90,198,140,212,254,107,107,19,171,220,151,70,81,41,105,50,132,84,241,143,175,140,89,95,100,36,119,254,150,187,42,148,29,91,205,29,74,200,204,73,136,7,8,250,155,55,142,60,79,58,144,96,190,230,124,249,164,164,166,149,129,16,81,144,126,22,39,83,181,107,15,107,65,13,186,116,216,168,75,42,20,179,20,78,14,241,40,71,84,253,23,237,149,13,89,101,180,185,221,70,88,45,177,23,141,22,156,107,196,101,176,214,255,156,163,146,143,239,91,154,228,228,24,252,21,232,62,190,160,248,127,169,255,94,237,112,5,13,237,40,73,244,123,249,89,217,86,133,12,233,41,133,31,13,129,21,246,53,177,5,238,46,78,21,208,75,36,84,191,111,79,173,240,52,177,4,3,17,156,216,227,185,47,204,91]).equals(e)||![3,4,5,7].includes(t))throw new Error("Changing passwords unsupported")}function g(e){return s.concat([s.alloc(256-e.length),e])}function h(e){return r(e,256,!1)}function m(e,t){const n=t.subtract(e);return!(n.lesser(a(0))||n.bitLength()<1984||e.bitLength()<1984||Math.floor((e.bitLength()+7)/8)>256)}function _(e,t){const n=Math.min(e.length,t.length);for(let s=0;s<n;s++)e[s]^=t[s];return e}async function y(e,t){const n=await c(s.concat([e.salt1,s.from(t,"utf-8"),e.salt1])),a=await c(s.concat([e.salt2,n,e.salt2])),i=await function(e,t,n){return p.pbkdf2(e,t,1e5,64,"sha512")}(a,e.salt1);return c(s.concat([e.salt2,i,e.salt2]))}e.exports={computeCheck:async function(e,t){const n=e.currentAlgo;if(!(n instanceof i.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow))throw new Error(`Unsupported password algorithm ${n.className}`);const r=await y(n,t),p=o(n.p,!1),{g:b}=n,w=o(e.srp_B,!1);try{f(n.p,b)}catch(e){throw new Error("bad /g in password")}if(!function(e,t){return e.greater(a(0))&&t.subtract(e).greater(a(0))}(w,p))throw new Error("bad b in check");const S=o(r,!1),v=g(n.p),A=h(b),I=g(e.srp_B),C=u(a(b),S,p),P=o(await c(s.concat([v,A])),!1),M=d(P.multiply(C),p),[k,R,T]=await(async()=>{for(;;){const e=l(256),t=o(e,!1),n=u(a(b),t,p);if(m(n,p)){const e=h(n),i=o(await c(s.concat([e,I])),!1);if(i.greater(a(0)))return[t,e,i]}}})(),E=d(w.subtract(M),p);if(!m(E,p))throw new Error("bad gB");const B=T.multiply(S),U=k.add(B),D=u(E,U,p),[x,V,F,N,H]=await Promise.all([c(h(D)),c(v),c(A),c(n.salt1),c(n.salt2)]),q=await c(s.concat([_(V,F),N,H,R,I,x]));return new i.InputCheckPasswordSRP({srpId:e.srpId,A:s.from(R),M1:q})},computeDigest:async function(e,t){try{f(e.p,e.g)}catch(e){throw new Error("bad p/g in password")}return h(u(a(e.g),o(await y(e,t),!1),o(e.p,!1)))}}},48960:(e,t,n)=>{var s=n(48764).lW;const{constructors:a}=n(57404),i=s.from("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00","hex"),o=s.from("ffd9","hex");function r(e,t){throw new Error(`Cannot cast ${e.className} to any kind of ${t}`)}e.exports={getMessageId:function(e){if(void 0!==e){if("number"==typeof e)return e;if(2030045667===e.SUBCLASS_OF_ID)return e.id;throw new Error(`Invalid message type: ${e.constructor.name}`)}},getInputPeer:function e(t){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0===t.SUBCLASS_OF_ID){if(n&&"inputEntity"in t)return t.inputEntity;if("entity"in t)return e(t.entity);r(t,"InputPeer")}if(3374092470===t.SUBCLASS_OF_ID)return t;if(t instanceof a.User){if(t.isSelf&&n)return new a.InputPeerSelf;if(void 0===t.accessHash&&s)throw new Error("User without accessHash or min info cannot be input");return new a.InputPeerUser({userId:t.id,accessHash:t.accessHash})}if(t instanceof a.Chat||t instanceof a.ChatEmpty||t instanceof a.ChatForbidden)return new a.InputPeerChat({chatId:t.id});if(t instanceof a.Channel){if(void 0===t.accessHash&&s)throw new TypeError("Channel without accessHash or min info cannot be input");return new a.InputPeerChannel({channelId:t.id,accessHash:t.accessHash})}return t instanceof a.ChannelForbidden?new a.InputPeerChannel({channelId:t.id,accessHash:t.accessHash}):t instanceof a.InputUser?new a.InputPeerUser({userId:t.userId,accessHash:t.accessHash}):t instanceof a.InputChannel?new a.InputPeerChannel({channelId:t.channelId,accessHash:t.accessHash}):t instanceof a.UserEmpty?new a.InputPeerEmpty:t instanceof a.UserFull?e(t.user):t instanceof a.ChatFull?new a.InputPeerChat({chatId:t.id}):t instanceof a.PeerChat?new a.InputPeerChat(t.chatId):void r(t,"InputPeer")},getDisplayName:function(e){return e instanceof a.User?e.lastName&&e.firstName?`${e.firstName} ${e.lastName}`:e.firstName?e.firstName:e.lastName?e.lastName:"":e instanceof a.Chat||e instanceof a.Channel?e.title:""},getDownloadPartSize:function(e){if(e<=65536)return 64;if(e<=104857600)return 128;if(e<=786432e3)return 256;if(e<=2097152e3)return 512;if(e<=4194304e3)return 1024;throw new Error("File size too large")},getUploadPartSize:function(e){if(e<=104857600)return 128;if(e<=786432e3)return 256;if(e<=2097152e3)return 512;if(e<=4194304e3)return 512;throw new Error("File size too large")},strippedPhotoToJpg:function(e){if(e.length<3||1!==e[0])return e;const t=s.from(i);return t[164]=e[1],t[166]=e[2],s.concat([t,e.slice(3),o])},getDC:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(e){case 1:return{id:1,ipAddress:`zws1${t?"-1":""}.web.telegram.org`,port:443};case 2:return{id:2,ipAddress:`zws2${t?"-1":""}.web.telegram.org`,port:443};case 3:return{id:3,ipAddress:`zws3${t?"-1":""}.web.telegram.org`,port:443};case 4:return{id:4,ipAddress:`zws4${t?"-1":""}.web.telegram.org`,port:443};case 5:return{id:5,ipAddress:`zws5${t?"-1":""}.web.telegram.org`,port:443};default:throw new Error(`Cannot find the DC with the ID of ${e}`)}}}},61472:e=>{e.exports="0.0.2"},70243:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getTmpPassword:()=>l,updateTwoFaSettings:()=>u});var s=n(77150),a=n.n(s),i=n(89618),o=n(59674),r=n(87873),c=n.n(r),d=n(48764).lW;async function u(e,t){let{isCheckPassword:n,currentPassword:s,newPassword:r,hint:u="",email:l,emailCodeCallback:p,onEmailCodeError:f}=t;if(!r&&!s)throw new Error("Neither `currentPassword` nor `newPassword` is present");if(l&&(!p||!f))throw new Error("`email` present without `emailCodeCallback` and `onEmailCodeError`");const g=await e.invoke(new(a().account.GetPassword));g.newAlgo instanceof a().PasswordKdfAlgoUnknown||(g.newAlgo.salt1=d.concat([g.newAlgo.salt1,(0,i.generateRandomBytes)(32)])),!g.hasPassword&&s&&(s=void 0);const h=s?await(0,o.computeCheck)(g,s):new(a().InputCheckPasswordEmpty);if(n)await e.invoke(new(a().auth.CheckPassword)({password:h}));else try{await e.invoke(new(a().account.UpdatePasswordSettings)({password:h,newSettings:new(a().account.PasswordInputSettings)({newAlgo:g.newAlgo,newPasswordHash:r?await(0,o.computeDigest)(g.newAlgo,r):d.alloc(0),hint:u,email:l,newSecureSettings:void 0})}))}catch(t){if(!(t instanceof c().EmailUnconfirmedError))throw t;for(;;)try{const n=await p(t.codeLength);if(!n)throw new Error("Code is empty");await e.invoke(new(a().account.ConfirmPasswordEmail)({code:n}));break}catch(e){f(e)}}}async function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60;const s=await e.invoke(new(a().account.GetPassword));if(!s)return;const i=await(0,o.computeCheck)(s,t);try{return await e.invoke(new(a().account.GetTmpPassword)({password:i,period:n}))}catch(e){if("PASSWORD_HASH_INVALID"===e.message)return{error:e.message};throw e}}},78742:(e,t,n)=>{var s=n(48764).lW;const a=n(67435),i=n(96748),{sleep:o}=n(89618),r=n(87873),c=n(33995),d=n(89618),u=n(48960),l=n(59270),{LAYER:p}=n(70845),{constructors:f,requests:g}=n(57404),{ConnectionTCPObfuscated:h,MTProtoSender:m,UpdateConnectionState:_,HttpConnection:y}=n(18415),{authFlow:b,checkAuthorization:w}=n(21545),{downloadFile:S}=n(52288),{uploadFile:v}=n(74766),{updateTwoFaSettings:A,getTmpPassword:I}=n(70243),C=n(44287),P=n(46586).Z,M=131072,k=["u","v","w","y","d","x","c","m","b","a","s","f"];class R{constructor(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:R.DEFAULT_OPTIONS;if(!t||!n)throw Error('Your API ID or Hash are invalid. Please read "Requirements" on README.md');const o={...R.DEFAULT_OPTIONS,...s};if(this.apiId=t,this.apiHash=n,this.defaultDcId=o.dcId||2,this._useIPV6=o.useIPV6,this._shouldForceHttpTransport=o.shouldForceHttpTransport,this._shouldAllowHttpTransport=o.shouldAllowHttpTransport,this._shouldDebugExportedSenders=o.shouldDebugExportedSenders,"string"==typeof o.baseLogger?this._log=new i:this._log=o.baseLogger,"string"!=typeof e&&e){if(!(e instanceof l))throw new Error("The given session must be str or a session instance")}else try{throw new Error("not implemented")}catch(t){e=new c}this.floodSleepLimit=o.floodSleepLimit,this._eventBuilders=[],this._phoneCodeHash={},this.session=e,this.apiId=parseInt(t,10),this.apiHash=n,this._requestRetries=o.requestRetries,this._connectionRetries=o.connectionRetries,this._connectionRetriesToFallback=o.connectionRetriesToFallback,this._retryDelay=o.retryDelay||0,this._retryMainConnectionDelay=o.retryMainConnectionDelay||0,o.proxy&&this._log.warn("proxies are not supported"),this._proxy=o.proxy,this._timeout=o.timeout,this._autoReconnect=o.autoReconnect,this._connection=o.connection,this._fallbackConnection=o.fallbackConnection,this._floodWaitedRequests={},this._initWith=e=>new g.InvokeWithLayer({layer:p,query:new g.InitConnection({apiId:this.apiId,deviceModel:o.deviceModel||a.type().toString()||"Unknown",systemVersion:o.systemVersion||a.release().toString()||"1.0",appVersion:o.appVersion||"1.0",langCode:o.langCode,langPack:"",systemLangCode:o.systemLangCode,query:e,proxy:void 0})}),this._args=o,this._config=void 0,this.phoneCodeHashes=[],this._exportedSenderPromises={},this._exportedSenderRefCounter={},this._waitingForAuthKey={},this._exportedSenderReleaseTimeouts={},this._additionalDcsDisabled=o.additionalDcsDisabled,this._loopStarted=!1,this._isSwitchingDc=!1,this._destroyed=!1,this._connectedDeferred=new P}async connect(){await this._initSession(),void 0===this._sender&&(this._sender=new m(this.session.getAuthKey(),{logger:this._log,dcId:this.session.dcId,retries:this._connectionRetries,retriesToFallback:this._connectionRetriesToFallback,shouldForceHttpTransport:this._shouldForceHttpTransport,shouldAllowHttpTransport:this._shouldAllowHttpTransport,delay:this._retryDelay,retryMainConnectionDelay:this._retryMainConnectionDelay,autoReconnect:this._autoReconnect,connectTimeout:this._timeout,authKeyCallback:this._authKeyCallback.bind(this),updateCallback:this._handleUpdate.bind(this),getShouldDebugExportedSenders:this.getShouldDebugExportedSenders.bind(this),isMainSender:!0})),this._sender.userDisconnected=!1,this._sender._user_connected=!1,this._sender.isReconnecting=!1,this._sender._disconnected=!0;const e=new this._connection(this.session.serverAddress,this.session.port,this.session.dcId,this._log,this._args.testServers),t=new this._fallbackConnection(this.session.serverAddress,this.session.port,this.session.dcId,this._log,this._args.testServers);await this._sender.connect(e,void 0,t)?(this.session.setAuthKey(this._sender.authKey),await this._sender.send(this._initWith(new g.help.GetConfig({}))),this._loopStarted||(this._updateLoop(),this._loopStarted=!0),this._connectedDeferred.resolve(),this._isSwitchingDc=!1):this._loopStarted||(this._updateLoop(),this._loopStarted=!0)}async _initSession(){if(await this.session.load(),!this.session.serverAddress||this.session.serverAddress.includes(":")!==this._useIPV6){const e=u.getDC(this.defaultDcId);this.session.setDC(this.defaultDcId,e.ipAddress,this._args.useWSS?443:80)}}setPingCallback(e){this.pingCallback=e}async setForceHttpTransport(e){this._shouldForceHttpTransport=e,await this.disconnect(),this._sender=void 0,await this.connect()}async setAllowHttpTransport(e){this._shouldAllowHttpTransport=e,await this.disconnect(),this._sender=void 0,await this.connect()}setShouldDebugExportedSenders(e){this._shouldDebugExportedSenders=e}getShouldDebugExportedSenders(){return this._shouldDebugExportedSenders}async _updateLoop(){let e;for(;!this._destroyed;)if(await d.sleep(3e3),this._sender.isReconnecting||this._isSwitchingDc)e=void 0;else{try{const t=()=>this._sender.send(new g.PingDelayDisconnect({pingId:d.getRandomInt(Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),disconnectDelay:6e4})),n=Date.now(),s=e?n-e:void 0;if(!s||s<5e3)await D((()=>U(t,5e3)),3,100);else{let e=setTimeout((()=>{this._handleUpdate(new _(_.disconnected)),e=void 0}),1e3);await U(t,3e3),e&&(clearTimeout(e),e=void 0),this._handleUpdate(new _(_.connected))}e=Date.now()}catch(t){if(console.warn(t),e=void 0,this._sender.isReconnecting||this._isSwitchingDc)continue;this._sender.reconnect()}if(Date.now()-this._lastRequest>18e5){try{await this.pingCallback()}catch(e){}e=void 0}}await this.disconnect()}async disconnect(){this._sender&&await this._sender.disconnect(),await Promise.all(Object.values(this._exportedSenderPromises).map((e=>Object.values(e).map((e=>e&&e.then((e=>{if(e)return e.disconnect()})))))).flat()),Object.values(this._exportedSenderReleaseTimeouts).forEach((e=>{Object.values(e).forEach((e=>{clearTimeout(e)}))})),this._exportedSenderRefCounter={},this._exportedSenderPromises={},this._waitingForAuthKey={}}async destroy(){this._destroyed=!0;try{await this.disconnect(),this._sender.destroy()}catch(e){}this.session.delete(),this._eventBuilders=[]}async _switchDC(e){this._log.info(`Reconnecting to new data center ${e}`);const t=u.getDC(e);return this.session.setDC(e,t.ipAddress,t.port),await this._sender.authKey.setKey(void 0),this.session.setAuthKey(void 0),this._isSwitchingDc=!0,await this.disconnect(),this._sender=void 0,this.connect()}_authKeyCallback(e,t){this.session.setAuthKey(e,t)}async _cleanupExportedSender(e,t){this.session.dcId!==e&&this.session.setAuthKey(void 0,e),this._shouldDebugExportedSenders&&console.log(`🧹 Cleanup idx=${t} dcId=${e}`);const n=await this._exportedSenderPromises[e][t];delete this._exportedSenderPromises[e][t],delete this._exportedSenderRefCounter[e][t],await n.disconnect()}async _cleanupExportedSenders(e){const t=Object.values(this._exportedSenderPromises[e]);t.length&&(this.session.dcId!==e&&this.session.setAuthKey(void 0,e),this._exportedSenderPromises[e]={},this._exportedSenderRefCounter[e]={},await Promise.all(t.map((async e=>{const t=await e;await t.disconnect()}))))}async _connectSender(e,t,n){let s,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=Boolean(e.authKey.getKey());if(!i)if(this._waitingForAuthKey[t]){await this._waitingForAuthKey[t];const n=this.session.getAuthKey(t);await e.authKey.setKey(n.getKey()),i=Boolean(e.authKey.getKey())}else this._waitingForAuthKey[t]=new Promise((e=>{s=e}));const o=u.getDC(t,i);for(;;)try{if(await e.connect(new this._connection(o.ipAddress,o.port,t,this._log,this._args.testServers,!!i&&a),void 0,new this._fallbackConnection(o.ipAddress,o.port,t,this._log,this._args.testServers,!!i&&a)),this.session.dcId!==t&&!e._authenticated){this._log.info(`Exporting authorization for data center ${o.ipAddress}`);const n=await this.invoke(new g.auth.ExportAuthorization({dcId:t})),s=this._initWith(new g.auth.ImportAuthorization({id:n.id,bytes:n.bytes}));await e.send(s),e._authenticated=!0}return e.dcId=t,e.userDisconnected=!1,s&&(s(),delete this._waitingForAuthKey[t]),this._shouldDebugExportedSenders&&console.warn(`✅ Connected to exported sender idx=${n} dc=${t}`),e}catch(s){this._shouldDebugExportedSenders&&console.error(`☠️ ERROR! idx=${n} dcId=${t} ${s.message}`),console.error(s),await d.sleep(1e3),await e.disconnect()}}releaseExportedSender(e){const t=e._dcId,n=e._senderIndex;this._exportedSenderRefCounter[t]&&this._exportedSenderRefCounter[t][n]&&(this._exportedSenderRefCounter[t][n]-=1,this._exportedSenderRefCounter[t][n]<=0&&(this._exportedSenderReleaseTimeouts[t]||(this._exportedSenderReleaseTimeouts[t]={}),this._exportedSenderReleaseTimeouts[t][n]=setTimeout((()=>{this._shouldDebugExportedSenders&&console.log(`[CC] [idx=${n} dcId=${t}] 🚪 Release`),e.disconnect(),this._exportedSenderReleaseTimeouts[t][n]=void 0,this._exportedSenderPromises[t][n]=void 0}),3e4)))}async _borrowExportedSender(e,t,n,s,a){if(this._additionalDcsDisabled)return;const i=s||0;let o;this._exportedSenderPromises[e]||(this._exportedSenderPromises[e]={}),this._exportedSenderRefCounter[e]||(this._exportedSenderRefCounter[e]={}),this._exportedSenderPromises[e][i]&&!t||(this._shouldDebugExportedSenders&&console.warn(`🕒 Connecting to exported sender idx=${i} dc=${e} `+(t?"(reconnect)":"")),this._exportedSenderRefCounter[e][i]=0,this._exportedSenderPromises[e][i]=this._connectSender(n||this._createExportedSender(e,i),e,s,a));try{if(o=await this._exportedSenderPromises[e][i],!o.isConnected())return o.isConnecting?(await d.sleep(1e3),this._borrowExportedSender(e,!1,o,i,a)):this._borrowExportedSender(e,!0,o,i,a)}catch(t){return console.error(t),this._borrowExportedSender(e,!0,void 0,i,a)}return this._exportedSenderRefCounter[e][i]+=1,this._exportedSenderReleaseTimeouts[e]||(this._exportedSenderReleaseTimeouts[e]={}),this._exportedSenderReleaseTimeouts[e][i]&&(clearTimeout(this._exportedSenderReleaseTimeouts[e][i]),this._exportedSenderReleaseTimeouts[e][i]=void 0),o}_createExportedSender(e,t){return new m(this.session.getAuthKey(e),{logger:this._log,dcId:e,senderIndex:t,retries:this._connectionRetries,retriesToFallback:this._connectionRetriesToFallback,delay:this._retryDelay,retryMainConnectionDelay:this._retryMainConnectionDelay,shouldForceHttpTransport:this._shouldForceHttpTransport,shouldAllowHttpTransport:this._shouldAllowHttpTransport,autoReconnect:this._autoReconnect,connectTimeout:this._timeout,authKeyCallback:this._authKeyCallback.bind(this),isMainSender:e===this.session.dcId,isExported:!0,getShouldDebugExportedSenders:this.getShouldDebugExportedSenders.bind(this),onConnectionBreak:()=>this._cleanupExportedSender(e,t)})}getSender(e,t,n){return e?this._borrowExportedSender(e,void 0,void 0,t,n):Promise.resolve(this._sender)}downloadFile(e){return S(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},this._shouldDebugExportedSenders)}downloadMedia(e,t){let n;if(n=e instanceof f.Message||e instanceof f.StoryItem?e.media:e instanceof f.MessageService?e.action.photo:e,"string"==typeof n)throw new Error("not implemented");return n instanceof f.MessageMediaWebPage&&n.webpage instanceof f.WebPage&&(n=n.webpage.document||n.webpage.photo),n instanceof f.MessageMediaPhoto||n instanceof f.Photo?this._downloadPhoto(n,t):n instanceof f.MessageMediaDocument||n instanceof f.Document?this._downloadDocument(n,t):n instanceof f.MessageMediaContact?this._downloadContact(n,t):n instanceof f.WebDocument||n instanceof f.WebDocumentNoProxy?this._downloadWebDocument(n,t):void 0}downloadProfilePhoto(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=t?"x":"m";let s,a,i;if([765557111,3316604308,524706233,3566872215].includes(e.SUBCLASS_OF_ID)){if(!e.photo){if(!e.chatPhoto)return;return this._downloadPhoto(e.chatPhoto,{sizeType:n})}s=e.photo}else s=e;if(s instanceof f.UserProfilePhoto||s instanceof f.ChatPhoto)return a=s.dcId,i=new f.InputPeerPhotoFileLocation({peer:u.getInputPeer(e),photoId:s.photoId,big:t}),this.downloadFile(i,{dcId:a})}downloadStickerSetThumb(e){if(!e.thumbs?.length&&!e.thumbDocumentId)return;const{thumbVersion:t}=e;return e.thumbDocumentId?this.invoke(new f.messages.GetCustomEmojiDocuments({documentId:[e.thumbDocumentId]})).then((e=>{const t=e[0];return this.downloadFile(new f.InputDocumentFileLocation({id:t.id,accessHash:t.accessHash,fileReference:t.fileReference,thumbSize:""}),{fileSize:t.size.toJSNumber(),dcId:t.dcId})})):this.downloadFile(new f.InputStickerSetThumb({stickerset:new f.InputStickerSetID({id:e.id,accessHash:e.accessHash}),thumbVersion:t}),{dcId:e.thumbDcId})}_pickFileSize(e,t){if(!t||!e||!e.length)return;let n;for(let s=k.indexOf(t);s<k.length;s++)if(n=e.find((e=>e.type===k[s])),n)return n}_downloadCachedPhotoSize(e){let t;return t=e instanceof f.PhotoStrippedSize?u.strippedPhotoToJpg(e.bytes):e.bytes,t}_downloadPhoto(e,t){if(e instanceof f.MessageMediaPhoto&&(e=e.photo),!(e instanceof f.Photo))return;const n="u"===t.sizeType||"v"===t.sizeType,s=this._pickFileSize(n?[...e.videoSizes,...e.sizes]:e.sizes,t.sizeType);return!s||s instanceof f.PhotoSizeEmpty?void 0:s instanceof f.PhotoCachedSize||s instanceof f.PhotoStrippedSize?this._downloadCachedPhotoSize(s):this.downloadFile(new f.InputPhotoFileLocation({id:e.id,accessHash:e.accessHash,fileReference:e.fileReference,thumbSize:s.type}),{dcId:e.dcId,fileSize:s.size||Math.max(...s.sizes||[]),progressCallback:t.progressCallback})}_downloadDocument(e,t){if(e instanceof f.MessageMediaDocument&&(e=e.document),!(e instanceof f.Document))return;let n;if(t.sizeType){if(n=e.thumbs?this._pickFileSize([...e.videoThumbs||[],...e.thumbs],t.sizeType):void 0,!n&&e.mimeType.startsWith("video/"))return;if(n&&(n instanceof f.PhotoCachedSize||n instanceof f.PhotoStrippedSize))return this._downloadCachedPhotoSize(n)}return this.downloadFile(new f.InputDocumentFileLocation({id:e.id,accessHash:e.accessHash,fileReference:e.fileReference,thumbSize:n?n.type:""}),{fileSize:n?n.size:e.size.toJSNumber(),progressCallback:t.progressCallback,start:t.start,end:t.end,dcId:e.dcId,workers:t.workers})}_downloadContact(e,t){throw new Error("not implemented")}async _downloadWebDocument(e){if(e.url&&!("accessHash"in e)){const t=await fetch(e.url).then((e=>e.arrayBuffer()));return s.from(t)}try{const t=[];let n=0;for(;;){const s=new g.upload.GetWebFile({location:new f.InputWebFileLocation({url:e.url,accessHash:e.accessHash}),offset:n,limit:M}),a=await this._borrowExportedSender(4),i=await a.send(s);if(this.releaseExportedSender(a),n+=131072,!i.bytes.length)break;if(t.push(i.bytes),i.bytes.length<M)break}return s.concat(t)}catch(e){if("WEBFILE_NOT_AVAILABLE"===e.message)return s.alloc(0);throw e}}async downloadStaticMap(e,t,n,a,i,c,d,u){try{const l=[];let p=0;for(;;)try{const s=new g.upload.GetWebFile({location:new f.InputWebFileGeoPointLocation({geoPoint:new f.InputGeoPoint({lat:n,long:t,accuracyRadius:u}),accessHash:e,w:a,h:i,zoom:c,scale:d}),offset:p,limit:M}),o=await this._borrowExportedSender(4),r=await o.send(s);if(this.releaseExportedSender(o),p+=131072,!r.bytes.length)break;if(l.push(r.bytes),r.bytes.length<M)break}catch(e){if(e instanceof r.FloodWaitError){console.warn(`getWebFile: sleeping for ${e.seconds}s on flood wait`),await o(1e3*e.seconds);continue}}return s.concat(l)}catch(e){if("WEBFILE_NOT_AVAILABLE"===e.message)return s.alloc(0);throw e}}async invoke(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("request"!==e.classType)throw new Error("You can only invoke MTProtoRequests");const a=void 0!==t;let i=a?await this.getSender(t):this._sender;this._lastRequest=Date.now(),await this._connectedDeferred.promise;const c=new C(e,n);let d=0;for(d=0;d<this._requestRetries;d++){i.addStateToQueue(c);try{const e=await c.promise;return c.finished.resolve(),a&&this.releaseExportedSender(i),e}catch(e){if(e instanceof r.ServerError||"RPC_CALL_FAIL"===e.message||"RPC_MCGET_FAIL"===e.message)this._log.warn(`Telegram is having internal issues ${e.constructor.name}`),await o(2e3);else if(e instanceof r.FloodWaitError||e instanceof r.FloodTestPhoneWaitError){if(!(e.seconds<=this.floodSleepLimit))throw c.finished.resolve(),a&&this.releaseExportedSender(i),e;this._log.info(`Sleeping for ${e.seconds}s on flood wait`),await o(1e3*e.seconds)}else if(e instanceof r.PhoneMigrateError||e instanceof r.NetworkMigrateError||e instanceof r.UserMigrateError){if(this._log.info(`Phone migrated to ${e.newDc}`),(e instanceof r.PhoneMigrateError||e instanceof r.NetworkMigrateError)&&await w(this))throw c.finished.resolve(),a&&this.releaseExportedSender(i),e;await this._switchDC(e.newDc),a&&this.releaseExportedSender(i),i=void 0===t?this._sender:await this.getSender(t)}else if(e instanceof r.MsgWaitError)await c.isReady(),c.after=void 0;else if("CONNECTION_NOT_INITED"===e.message)await this.disconnect(),await o(2e3),await this.connect();else{if(!(e instanceof r.TimedOutError))throw c.finished.resolve(),a&&this.releaseExportedSender(i),e;if(!s)throw c.finished.resolve(),a&&this.releaseExportedSender(i),e}}c.resetPromise()}throw a&&this.releaseExportedSender(i),new Error(`Request was unsuccessful ${d} time(s)`)}async invokeBeacon(e,t){if("request"!==e.classType)throw new Error("You can only invoke MTProtoRequests");const n=void 0!==t,s=n?await this.getSender(t):this._sender;s.sendBeacon(e),n&&this.releaseExportedSender(s)}setIsPremium(e){this.isPremium=e}async getMe(){try{return(await this.invoke(new g.users.GetUsers({id:[new f.InputUserSelf]})))[0]}catch(e){this._log.warn("error while getting me"),this._log.warn(e)}}async start(e){if(this.isConnected()||await this.connect(),await w(this,e.shouldThrowIfUnauthorized))return;const t={apiId:this.apiId,apiHash:this.apiHash};await b(this,t,e)}uploadFile(e){return v(this,e,this._shouldDebugExportedSenders)}updateTwoFaSettings(e){return A(this,e)}getTmpPassword(e,t){return I(this,e,t)}addEventHandler(e,t){this._eventBuilders.push([t,e])}_handleUpdate(e){if(e instanceof f.Updates||e instanceof f.UpdatesCombined){const t=[];for(const n of[...e.users,...e.chats])t.push(n);this._processUpdate(e,t)}else e instanceof f.UpdateShort?this._processUpdate(e.update,void 0):this._processUpdate(e,void 0)}_processUpdate(e,t){e._entities=t||[];const n={update:e};this._dispatchUpdate(n)}async _dispatchUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{update:void 0};for(const[t,n]of this._eventBuilders){const s=t.build(e.update);s&&await n(s)}}isConnected(){return!(!this._sender||!this._sender.isConnected())}}var T,E,B;function U(e,t){let n=!1;return Promise.race([e(),d.sleep(t).then((()=>n?void 0:Promise.reject(new Error("TIMEOUT"))))]).finally((()=>{n=!0}))}async function D(e,t,n){for(let s=0;s<t;s++)try{return await e()}catch(e){if(s===t-1)throw e;await d.sleep(n)}}T=R,B={connection:h,fallbackConnection:y,useIPV6:!1,proxy:void 0,timeout:10,requestRetries:5,connectionRetries:1/0,connectionRetriesToFallback:1,retryDelay:1e3,retryMainConnectionDelay:1e4,autoReconnect:!0,sequentialUpdates:!1,floodSleepLimit:60,deviceModel:void 0,systemVersion:void 0,appVersion:void 0,langCode:"en",systemLangCode:"en",baseLogger:"gramjs",useWSS:!1,additionalDcsDisabled:!1,testServers:!1,dcId:2,shouldAllowHttpTransport:!1,shouldForceHttpTransport:!1,shouldDebugExportedSenders:!1},(E=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(E="DEFAULT_OPTIONS"))in T?Object.defineProperty(T,E,{value:B,enumerable:!0,configurable:!0,writable:!0}):T[E]=B,e.exports=R},21545:(e,t,n)=>{"use strict";n.r(t),n.d(t,{authFlow:()=>l,checkAuthorization:()=>f,signInUserWithPreferredMethod:()=>p});var s=n(77150),a=n.n(s),i=n(48960),o=n.n(i),r=n(89618),c=n(59674);const d="phoneNumber",u=3e4;async function l(e,t,n){let s;s="botAuthToken"in n?await async function(e,t,n){const{apiId:s,apiHash:i}=t,{botAuthToken:o}=n,{user:r}=await e.invoke(new(a().auth.ImportBotAuthorization)({apiId:s,apiHash:i,botAuthToken:o}));return r}(e,t,n):"webAuthToken"in n&&n.webAuthToken?await async function(e,t,n){try{const{apiId:s,apiHash:i}=t,o=await e.invoke(new(a().auth.ImportWebTokenAuthorization)({webAuthToken:n.webAuthToken,apiId:s,apiHash:i}));if(o instanceof a().auth.Authorization)return o.user;throw new Error("SIGN_UP_REQUIRED")}catch(s){return"SESSION_PASSWORD_NEEDED"===s.message?_(e,t,n,!0):(e._log.error(`Failed to login with web token: ${s}`),n.webAuthTokenFailed(),p(e,t,{...n,webAuthToken:void 0}))}}(e,t,n):await p(e,t,n),e._log.info("Signed in successfully as",o().getDisplayName(s))}function p(e,t,n){const{initialMethod:s=d}=n;return"phoneNumber"===s?g(e,t,n):h(e,t,n)}async function f(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{return await e.invoke(new(a().updates.GetState)),!0}catch(e){if("Disconnect"===e.message||t)throw e;return!1}}async function g(e,t,n){let s,i,o,r=!1;for(;;)try{if("function"==typeof n.phoneNumber)try{s=await n.phoneNumber()}catch(s){if("RESTART_AUTH_WITH_QR"===s.message)return h(e,t,n);throw s}else s=n.phoneNumber;const a=await m(e,t,s,n.forceSMS);if(i=a.phoneCodeHash,r=a.isCodeViaApp,"string"!=typeof i)throw new Error("Failed to retrieve phone code hash");break}catch(e){if("function"!=typeof n.phoneNumber)throw e;n.onError(e)}let c,d=!1;for(;;)try{try{o=await n.phoneCode(r)}catch(s){if("RESTART_AUTH"===s.message)return g(e,t,n)}if(!o)throw new Error("Code is empty");const u=await e.invoke(new(a().auth.SignIn)({phoneNumber:s,phoneCodeHash:i,phoneCode:o}));if(u instanceof a().auth.AuthorizationSignUpRequired){d=!0,c=u.termsOfService;break}return u.user}catch(s){if("SESSION_PASSWORD_NEEDED"===s.message)return _(e,t,n);n.onError(s)}if(d)for(;;)try{const[t,o]=await n.firstAndLastNames();if(!t)throw new Error("First name is required");const{user:r}=await e.invoke(new(a().auth.SignUp)({phoneNumber:s,phoneCodeHash:i,firstName:t,lastName:o}));return c&&await e.invoke(new(a().help.AcceptTermsOfService)({id:c.id})),r}catch(e){n.onError(e)}return n.onError(new Error("Auth failed")),g(e,t,n)}async function h(e,t,n){let s=!1;const i=(async()=>{for(;!s;){const t=await e.invoke(new(a().auth.ExportLoginToken)({apiId:Number("2496"),apiHash:"8da85b0d5bfe62527e5b244c209159c3",exceptIds:[]}));if(!(t instanceof a().auth.LoginToken))throw new Error("Unexpected");const{token:s,expires:i}=t;await Promise.race([n.qrCode({token:s,expires:i}),(0,r.sleep)(u)])}})(),o=new Promise((t=>{e.addEventHandler((e=>{e instanceof a().UpdateLoginToken&&t()}),{build:e=>e})}));try{await Promise.race([o,i])}catch(s){if("RESTART_AUTH"===s.message)return await g(e,t,n);throw s}finally{s=!0}try{const t=await e.invoke(new(a().auth.ExportLoginToken)({apiId:Number("2496"),apiHash:"8da85b0d5bfe62527e5b244c209159c3",exceptIds:[]}));if(t instanceof a().auth.LoginTokenSuccess&&t.authorization instanceof a().auth.Authorization)return t.authorization.user;if(t instanceof a().auth.LoginTokenMigrateTo){await e._switchDC(t.dcId);const n=await e.invoke(new(a().auth.ImportLoginToken)({token:t.token}));if(n instanceof a().auth.LoginTokenSuccess&&n.authorization instanceof a().auth.Authorization)return n.authorization.user}}catch(s){if("SESSION_PASSWORD_NEEDED"===s.message)return _(e,t,n);throw s}throw void 0}async function m(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{const{apiId:i,apiHash:o}=t,r=await e.invoke(new(a().auth.SendCode)({phoneNumber:n,apiId:i,apiHash:o,settings:new(a().CodeSettings)}));if(!(r instanceof a().auth.SentCode))throw Error("Unexpected SentCodeSuccess");if(!s||r.type instanceof a().auth.SentCodeTypeSms)return{phoneCodeHash:r.phoneCodeHash,isCodeViaApp:r.type instanceof a().auth.SentCodeTypeApp};const c=await e.invoke(new(a().auth.ResendCode)({phoneNumber:n,phoneCodeHash:r.phoneCodeHash}));if(!(c instanceof a().auth.SentCode))throw Error("Unexpected SentCodeSuccess");return{phoneCodeHash:c.phoneCodeHash,isCodeViaApp:c.type instanceof a().auth.SentCodeTypeApp}}catch(a){if("AUTH_RESTART"===a.message)return m(e,t,n,s);throw a}}async function _(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(;;)try{const t=await e.invoke(new(a().account.GetPassword)),i=await n.password(t.hint,s);if(!i)throw new Error("Password is empty");const o=await(0,c.computeCheck)(t,i),{user:r}=await e.invoke(new(a().auth.CheckPassword)({password:o}));return r}catch(e){n.onError(e)}}},52288:(e,t,n)=>{"use strict";n.r(t),n.d(t,{downloadFile:()=>v});var s=n(24736),a=n.n(s),i=n(46586),o=n(16039),r=n(87873),c=n.n(r),d=n(77150),u=n.n(d),l=n(89618),p=n(48960),f=n(48764).lW;function g(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const h=4096,m=64,_=1048576,y=1e3,b=6e4,w=5;class S{constructor(e){g(this,"type",void 0),g(this,"size",void 0),g(this,"buffer",void 0),g(this,"largeFile",void 0),g(this,"largeFileAccessHandle",void 0),this.size=e,this.type=e&&e>self.maxBufferSize?"opfs":"memory"}async init(){if("opfs"===this.type){if(!FileSystemFileHandle?.prototype.createSyncAccessHandle)throw new Error("`createSyncAccessHandle` is not available. Cannot download files larger than 2GB.");const e=await navigator.storage.getDirectory(),t=await e.getDirectoryHandle("downloads",{create:!0});this.largeFile=await t.getFileHandle(Math.random().toString(),{create:!0}),this.largeFileAccessHandle=await this.largeFile.createSyncAccessHandle()}else this.buffer=this.size?f.alloc(this.size):f.alloc(0)}write(e,t){if("opfs"===this.type)this.largeFileAccessHandle.write(e,{at:t});else if(this.size)for(let n=0;n<e.length;n++){if(t+n>=this.buffer.length)return;this.buffer.writeUInt8(e[n],t+n)}else this.buffer=f.concat([this.buffer,e])}getData(){return"opfs"===this.type?this.largeFile.getFile():Promise.resolve(this.buffer)}}async function v(e,t,n,s){const{dcId:a}=n;for(let i=0;i<w;i++)try{return await M(e,t,n,s)}catch(t){if(!((t.message.startsWith("SESSION_REVOKED")||t.message.startsWith("CONNECTION_NOT_INITED"))&&i<w-1))throw t;await e._cleanupExportedSenders(a)}}const A=3,I=6,C=10485760,P=Array(I).fill(void 0).map((()=>new o.J(10)));async function M(e,t,n,s){let{partSizeKb:o,end:r}=n;const{fileSize:d}=n,f="id"in t?t.id:void 0,g=function(){if(s){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];console.log(`⬇️ [${f}/${n.dcId}]`,...t)}};g("Downloading file...");const w=Boolean(e.isPremium),{dcId:v,progressCallback:M,start:k=0}=n;r=r&&r<d?r:d-1,o||(o=d?(0,p.getDownloadPartSize)(k?r-k+1:d):m);const R=1024*o,T=r?Math.ceil((r+1-k+1)/R):1,E=!r,B=d&&d>=C&&!E;let U;if(R%h!=0)throw new Error(`The part size must be evenly divisible by ${h}`);e._log.info(`Downloading file in chunks of ${R} bytes`);const D=new S(r-k+1),x=[];let V=k;const F=P.map((e=>{let{activeWorkers:t}=e;return t}));let N=F.indexOf(Math.min(...F)),H=!1,q=0;for(M&&M(q),await D.init();;){let n=R,o=!1;Math.floor(V/_)!==Math.floor((V+n-1)/_)&&(n=_-V%_,o=!0),V%h==0&&n%h==0||(o=!0);const d=B?N%(w?I:A):0;if(await P[d].requestWorker(),U&&await U.promise,E&&(U=new i.Z),H){P[d].releaseWorker();break}const p=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];g(`[${d}/${v}]`,...t)};if(x.push((async i=>{for(;;){let f;try{let c=!1;s&&setTimeout((()=>{c||p(`❗️️ getSender took too long ${i}`)}),8e3),f=await e.getSender(v,d,w),c=!0;let g=!1;s&&setTimeout((()=>{g||p(`❗️️ sender.send took too long ${i}`)}),6e3);const h=await Promise.race([f.send(new(u().upload.GetFile)({location:t,offset:a()(i),limit:n,precise:o||void 0})),(0,l.sleep)(b).then((()=>v===e.session.dcId?(p(`Download timed out ${i}`),Promise.reject(new Error("USER_CANCELED"))):(p(`Download timed out [not main] ${i}`),Promise.reject(new Error("SESSION_REVOKED")))))]);if(e.releaseExportedSender(f),g=!0,M){if(M.isCanceled)throw new Error("USER_CANCELED");q+=1/T,p(`⬇️️ ${100*q}%`),M(q)}return!r&&h.bytes.length<n&&(H=!0),P[d].releaseWorker(),U&&U.resolve(),void D.write(h.bytes,i-k)}catch(t){if(f&&!f.isConnected()){await(0,l.sleep)(y);continue}if(t instanceof c().FloodWaitError){await(0,l.sleep)(1e3*t.seconds);continue}throw p(`Ended not gracefully ${i}`),P[d].releaseWorker(),U&&U.resolve(),H=!0,e.releaseExportedSender(f),t}}})(V)),V+=n,N++,r&&V>r)break}return await Promise.all(x),D.getData()}},74766:(e,t,n)=>{"use strict";n.r(t),n.d(t,{uploadFile:()=>_});var s=n(77150),a=n.n(s),i=n(89618),o=n(48960),r=n(87873),c=n.n(r),d=n(16039),u=n(48764).lW;const l=1024,p=10485760,f=1e3,g=3,h=6,m=Array(h).fill(void 0).map((()=>new d.J(10)));async function _(e,t,n){const{file:s,onProgress:r}=t,d=Boolean(e.isPremium),{name:_,size:y}=s,b=(0,i.readBigIntFromBuffer)((0,i.generateRandomBytes)(8),!0,!0),w=y>p,S=function(){if(n){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];console.log(`⬆️ [${b}]`,...t)}};S("Uploading file...");const v=(0,o.getUploadPartSize)(y)*l,A=Math.floor((y+v-1)/v),I=m.map((e=>{let{activeWorkers:t}=e;return t}));let C=I.indexOf(Math.min(...I)),P=0;r&&r(P);const M=[];for(let t=0;t<A;t++){const o=C%(d?h:g);if(await m[o].requestWorker(),r?.isCanceled){m[o].releaseWorker();break}const l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];S(`[${o}]`,...t)},p=s.slice(t*v,(t+1)*v);M.push((async(t,s)=>{for(;;){let p;try{let i=!1;n&&setTimeout((()=>{i||l(`❗️️ getSender took too long j=${t}`)}),8e3),p=await e.getSender(e.session.dcId,o,d),i=!0;let r=!1;const c=await s.arrayBuffer();n&&setTimeout((()=>{r||l(`❗️️ sender.send took too long j=${t}`)}),6e3),await p.send(w?new(a().upload.SaveBigFilePart)({fileId:b,filePart:t,fileTotalParts:A,bytes:u.from(c)}):new(a().upload.SaveFilePart)({fileId:b,filePart:t,bytes:u.from(c)})),e.releaseExportedSender(p),r=!0}catch(n){if(l(`❗️️️Upload part failed ${n?.toString()} j=${t}`),p&&!p.isConnected()){await(0,i.sleep)(f);continue}if(n instanceof c().FloodWaitError){await(0,i.sleep)(1e3*n.seconds);continue}throw m[o].releaseWorker(),e.releaseExportedSender(p),n}if(m[o].releaseWorker(),r){if(r.isCanceled)throw new Error("USER_CANCELED");P+=1/A,l(100*P+"%"),r(P)}break}})(t,p)),C++}return await Promise.all(M),w?new(a().InputFileBig)({id:b,parts:A,name:_}):new(a().InputFile)({id:b,parts:A,name:_,md5Checksum:""})}},13302:(e,t,n)=>{var s=n(48764).lW;const{sha1:a,toSignedLittleBuffer:i,readBufferFromBigInt:o,readBigIntFromBuffer:r}=n(89618),c=n(35544),{sleep:d}=n(89618);class u{constructor(e,t){if(!t||!e)return;this._key=e,this._hash=t;const n=new c(t);this.auxHash=n.readLong(!1),n.read(4),this.keyId=n.readLong(!1)}async setKey(e){if(!e)return this._key=void 0,this.auxHash=void 0,this.keyId=void 0,void(this._hash=void 0);if(e instanceof u)return this._key=e._key,this.auxHash=e.auxHash,this.keyId=e.keyId,void(this._hash=e._hash);this._key=e,this._hash=await a(this._key);const t=new c(this._hash);this.auxHash=t.readLong(!1),t.read(4),this.keyId=t.readLong(!1)}async waitForKey(){for(;!this.keyId;)await d(20)}getKey(){return this._key}async calcNewNonceHash(e,t){e=i(e,32);const n=s.alloc(1);n.writeUInt8(t,0);const c=s.concat([e,s.concat([n,o(this.auxHash,8,!0)])]),d=(await a(c)).slice(4,20);return r(d,!0,!0)}equals(e){return e instanceof this.constructor&&this._key&&e.getKey()&&e.getKey().equals(this._key)}}e.exports=u},55830:(e,t,n)=>{var s=n(48764).lW;const a=n(66842);e.exports=class{constructor(e,t){if(!s.isBuffer(e)||!s.isBuffer(t)||16!==t.length)throw new Error("Key and iv need to be a buffer");this.cipher=a.createCipheriv("AES-256-CTR",e,t)}encrypt(e){return s.from(this.cipher.update(e))}}},89636:(e,t,n)=>{const s=n(24736),{modExp:a}=n(89618);class i{static gcd(e,t){for(;t.neq(s.zero);){const n=t;t=e.remainder(t),e=n}return e}static factorize(e){if(e.remainder(2).equals(s.zero))return{p:s(2),q:e.divide(s(2))};let t=s.randBetween(s(1),e.minus(1));const n=s.randBetween(s(1),e.minus(1)),o=s.randBetween(s(1),e.minus(1));let r,c=s.one,d=s.one,u=s.one,l=s.zero,p=s.zero;for(;c.eq(s.one);){l=t;for(let i=0;s(i).lesser(d);i++)t=a(t,s(2),e).add(n).remainder(e);for(r=s.zero;r.lesser(d)&&c.eq(s.one);){p=t;const f=s.min(o,d.minus(r));for(let i=0;s(i).lesser(f);i++)t=a(t,s(2),e).add(n).remainder(e),u=u.multiply(l.minus(t).abs()).remainder(e);c=i.gcd(u,e),r=r.add(o)}d=d.multiply(2)}if(c.eq(e))for(;p=a(p,s(2),e).add(n).remainder(e),c=i.gcd(l.minus(p).abs(),e),!c.greater(1););const f=c;return u=e.divide(c),f<u?{p:f,q:u}:{p:u,q:f}}}e.exports=i},32608:(e,t,n)=>{var s=n(48764).lW;const{IGE:a}=n(28136),i=n(89618);e.exports=class{constructor(e,t){this.ige=new a(e,t)}decryptIge(e){return i.convertToLittle(this.ige.decrypt(e))}encryptIge(e){const t=e.length%16;return t&&(e=s.concat([e,i.generateRandomBytes(16-t)])),i.convertToLittle(this.ige.encrypt(e))}}},74121:(e,t,n)=>{"use strict";function s(e){const t=new Uint8Array(4*e.length);let n=0;for(let s=0;s<e.length;s++){const a=e[s];t[n++]=a>>>24,t[n++]=a>>16&255,t[n++]=a>>8&255,t[n++]=255&a}return t.buffer}function a(e){return e.buffer}function i(e){const t=new Uint8Array(e),n=new Uint32Array(t.length/4);for(let e=0;e<t.length;e+=4)n[e/4]=t[e]<<24^t[e+1]<<16^t[e+2]<<8^t[e+3];return n}function o(e){return new Uint32Array(e)}n.r(t),n.d(t,{ab2i:()=>d,ab2iBig:()=>o,ab2iLow:()=>i,i2ab:()=>c,i2abBig:()=>a,i2abLow:()=>s,isBigEndian:()=>r});const r=1===new Uint8Array(new Uint32Array([16909060]))[0],c=r?a:s,d=r?o:i},66842:(e,t,n)=>{var s=n(48764).lW;const a=n(28136).default,{i2ab:i,ab2i:o}=n(74121),{getWords:r}=n(77760);class c{constructor(e){this.setBytes(e)}setBytes(e){e=s.from(e),this._counter=e}increment(){for(let e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}}}class d{constructor(e,t){t instanceof c||(t=new c(t)),this._counter=t,this._remainingCounter=void 0,this._remainingCounterIndex=16,this._aes=new a(r(e))}update(e){return this.encrypt(e)}encrypt(e){const t=s.from(e);for(let e=0;e<t.length;e++)16===this._remainingCounterIndex&&(this._remainingCounter=s.from(i(this._aes.encrypt(o(this._counter._counter)))),this._remainingCounterIndex=0,this._counter.increment()),t[e]^=this._remainingCounter[this._remainingCounterIndex++];return t}}class u{constructor(e){this.algorithm=e}update(e){this.data=new Uint8Array(e)}async digest(){return"sha1"===this.algorithm?s.from(await self.crypto.subtle.digest("SHA-1",this.data)):"sha256"===this.algorithm?s.from(await self.crypto.subtle.digest("SHA-256",this.data)):void 0}}e.exports={createCipheriv:function(e,t,n){if(e.includes("ECB"))throw new Error("Not supported");return new d(t,n)},createDecipheriv:function(e,t,n){if(e.includes("ECB"))throw new Error("Not supported");return new d(t,n)},randomBytes:function(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),t},createHash:function(e){return new u(e)},pbkdf2:async function(e,t,n){const a=await crypto.subtle.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]);return s.from(await crypto.subtle.deriveBits({name:"PBKDF2",hash:"SHA-512",salt:t,iterations:n},a,512))}}},77760:(e,t,n)=>{"use strict";function s(e,t){return e.charCodeAt(t)<<24^e.charCodeAt(t+1)<<16^e.charCodeAt(t+2)<<8^e.charCodeAt(t+3)}function a(e){if(e instanceof Uint32Array)return e;if("string"==typeof e){if(e.length%4!=0)for(let t=e.length%4;t<=4;t++)e+="\0x00";const t=new Uint32Array(e.length/4);for(let n=0;n<e.length;n+=4)t[n/4]=s(e,n);return t}if(e instanceof Uint8Array){const t=new Uint32Array(e.length/4);for(let n=0;n<e.length;n+=4)t[n/4]=e[n]<<24^e[n+1]<<16^e[n+2]<<8^e[n+3];return t}throw new Error("Unable to create 32-bit words")}function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;for(let s=0;s<e.length;s++)n[s]=e[s]^t[s]}n.r(t),n.d(t,{getWords:()=>a,s2i:()=>s,xor:()=>i})},48187:e=>{class t extends Error{constructor(){super("The read operation was cancelled.")}}class n extends Error{constructor(e,t){super(`Could not find a matching Constructor ID for the TLObject that was supposed to be\n read with ID ${e}. Most likely, a TLObject was trying to be read when\n it should not be read. Remaining bytes: ${t.length}`),"undefined"!=typeof alert&&alert(`Missing MTProto Entity: Please, make sure to add TL definition for ID ${e}`),this.invalidConstructorId=e,this.remaining=t}}class s extends Error{constructor(e,t){super(`Invalid checksum (${e} when ${t} was expected). This packet should be skipped.`),this.checksum=e,this.validChecksum=t}}class a extends Error{constructor(e){let t;4===e.length?(t=-e.readInt32LE(0),super(`Invalid response buffer (HTTP code ${t})`)):super(`Invalid response buffer (too short ${e})`),this.code=t,this.payload=e}}class i extends Error{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length||(t=["A security check failed."]),super(...t)}}class o extends Error{constructor(e,t){let n=o.ErrorMessages[t]||`Unknown error code (this should not happen): ${t}.`;n+=` Caused by ${e.className}`,super(n),this.message=n,this.code=t}}var r,c,d;r=o,d={16:"msg_id too low (most likely, client time is wrong it would be worthwhile to synchronize it using msg_id notifications and re-send the original message with the “correct” msg_id or wrap it in a container with a new msg_id if the original message had waited too long on the client to be transmitted).",17:"msg_id too high (similar to the previous case, the client time has to be synchronized, and the message re-sent with the correct msg_id).",18:"Incorrect two lower order msg_id bits (the server expects client message msg_id to be divisible by 4).",19:"Container msg_id is the same as msg_id of a previously received message (this must never happen).",20:"Message too old, and it cannot be verified whether the server has received a message with this msg_id or not.",32:"msg_seqno too low (the server has already received a message with a lower msg_id but with either a higher or an equal and odd seqno).",33:"msg_seqno too high (similarly, there is a message with a higher msg_id but with either a lower or an equal and odd seqno).",34:"An even msg_seqno expected (irrelevant message), but odd received.",35:"Odd msg_seqno expected (relevant message), but even received.",48:"Incorrect server salt (in this case, the bad_server_salt response is received with the correct salt, and the message is to be re-sent with it).",64:"Invalid container."},(c=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(c="ErrorMessages"))in r?Object.defineProperty(r,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):r[c]=d,e.exports={ReadCancelledError:t,TypeNotFoundError:n,InvalidChecksumError:s,InvalidBufferError:a,SecurityError:i,CdnFileTamperedError:class extends i{constructor(){super("The CDN file has been altered and its download cancelled.")}},BadMessageError:o}},86952:e=>{function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class n extends Error{constructor(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;super("RPCError {0}: {1}{2}".replace("{0}",s).replace("{1}",e).replace("{2}",n._fmtRequest(t))),this.code=s,this.message=e}static _fmtRequest(e){return e?` (caused by ${e.className})`:""}}e.exports={RPCError:n,InvalidDCError:class extends n{constructor(e,t,n){super(t,e,n),this.code=n||303,this.message=t||"ERROR_SEE_OTHER"}},BadRequestError:class extends n{constructor(){super(...arguments),t(this,"code",400),t(this,"message","BAD_REQUEST")}},UnauthorizedError:class extends n{constructor(){super(...arguments),t(this,"code",401),t(this,"message","UNAUTHORIZED")}},ForbiddenError:class extends n{constructor(){super(...arguments),t(this,"code",403),t(this,"message","FORBIDDEN")}},NotFoundError:class extends n{constructor(){super(...arguments),t(this,"code",404),t(this,"message","NOT_FOUND")}},AuthKeyError:class extends n{constructor(){super(...arguments),t(this,"code",406),t(this,"message","AUTH_KEY")}},FloodError:class extends n{constructor(){super(...arguments),t(this,"code",420),t(this,"message","FLOOD")}},ServerError:class extends n{constructor(){super(...arguments),t(this,"code",500),t(this,"message","INTERNAL")}},TimedOutError:class extends n{constructor(){super(...arguments),t(this,"code",503),t(this,"message","Timeout")}}}},65651:(e,t,n)=>{const{RPCError:s,InvalidDCError:a,FloodError:i,BadRequestError:o,TimedOutError:r}=n(86952);class c extends a{constructor(e){const t=Number(e.capture||0);super(`The user whose identity is being used to execute queries is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The user whose identity is being used to execute queries is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class d extends a{constructor(e){const t=Number(e.capture||0);super(`The phone number a user is trying to use for authorization is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The phone number a user is trying to use for authorization is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class u extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required before sending another message in this chat${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required before sending another message in this chat${s._fmtRequest(e.request)}`,this.seconds=t}}class l extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required${s._fmtRequest(e.request)}`,this.seconds=t}}class p extends i{constructor(e){super(`Message failed to be sent.${s._fmtRequest(e.request)}`),this.message=`Message failed to be sent.${s._fmtRequest(e.request)}`}}class f extends i{constructor(e){const t=Number(e.capture||0);super(`A wait of ${t} seconds is required in the test servers${s._fmtRequest(e.request)}`),this.message=`A wait of ${t} seconds is required in the test servers${s._fmtRequest(e.request)}`,this.seconds=t}}class g extends a{constructor(e){const t=Number(e.capture||0);super(`The file to be accessed is currently stored in DC ${t}${s._fmtRequest(e.request)}`),this.message=`The file to be accessed is currently stored in DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class h extends a{constructor(e){const t=Number(e.capture||0);super(`The source IP address is associated with DC ${t}${s._fmtRequest(e.request)}`),this.message=`The source IP address is associated with DC ${t}${s._fmtRequest(e.request)}`,this.newDc=t}}class m extends o{constructor(e){const t=Number(e.capture||0);super(`Email unconfirmed, the length of the code must be ${t}${s._fmtRequest(e.request)}`),this.message=`Email unconfirmed, the length of the code must be ${t}${s._fmtRequest(e.request)}`,this.codeLength=t}}const _=[[/FILE_MIGRATE_(\d+)/,g],[/FLOOD_TEST_PHONE_WAIT_(\d+)/,f],[/FLOOD_WAIT_(\d+)/,l],[/MSG_WAIT_(.*)/,p],[/PHONE_MIGRATE_(\d+)/,d],[/SLOWMODE_WAIT_(\d+)/,u],[/USER_MIGRATE_(\d+)/,c],[/NETWORK_MIGRATE_(\d+)/,h],[/EMAIL_UNCONFIRMED_(\d+)/,m],[/^Timeout$/,r]];e.exports={rpcErrorRe:_,FileMigrateError:g,FloodTestPhoneWaitError:f,FloodWaitError:l,PhoneMigrateError:d,SlowModeWaitError:u,UserMigrateError:c,NetworkMigrateError:h,MsgWaitError:p,EmailUnconfirmedError:m}},87873:(e,t,n)=>{const{RPCError:s}=n(86952),{rpcErrorRe:a}=n(65651),i=n(48187),o=n(86952),r=n(65651);e.exports={RPCMessageToError:function(e,t){for(const[n,s]of a){const a=e.errorMessage.match(n);if(a)return new s({request:t,capture:2===a.length?parseInt(a[1],10):void 0})}return new s(e.errorMessage,t)},...i,...o,...r}},26316:()=>{},43903:(e,t,n)=>{const{EventBuilder:s}=n(80663);e.exports=class extends s{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{types:void 0,func:void 0};super(),e.types?this.types=e.types:this.types=!0}build(e){return e}}},80663:e=>{e.exports={EventBuilder:class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{chats:void 0,blacklistChats:void 0,func:void 0};this.chats=e.chats,this.blacklistChats=Boolean(e.blacklistChats),this.resolved=!1,this.func=e.func}build(e){}}}},33182:(e,t,n)=>{const s=n(26316),a=n(43903);class i extends Error{}e.exports={NewMessage:s,StopPropagation:i,Raw:a}},16151:e=>{e.exports=class{constructor(){this._queue=[],this.canGet=new Promise((e=>{this.resolveGet=e})),this.canPush=!0}async push(e){await this.canPush,this._queue.push(e),this.resolveGet(!0),this.canPush=new Promise((e=>{this.resolvePush=e}))}async pop(){await this.canGet;const e=this._queue.pop();return this.resolvePush(!0),this.canGet=new Promise((e=>{this.resolveGet=e})),e}}},35544:(e,t,n)=>{const{TypeNotFoundError:s}=n(48187),{coreObjects:a}=n(92058),{tlobjects:i}=n(70845),{readBigIntFromBuffer:o}=n(89618);e.exports=class{constructor(e){this.stream=e,this._last=void 0,this.offset=0}readByte(){return this.read(1)[0]}readInt(){let e;return e=arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?this.stream.readUInt32LE(this.offset):this.stream.readInt32LE(this.offset),this.offset+=4,e}readLong(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.readLargeInt(64,e)}readFloat(){return this.read(4).readFloatLE(0)}readDouble(){return this.read(8).readDoubleLE(0)}readLargeInt(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.read(Math.floor(e/8));return o(n,!0,t)}read(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1===e&&(e=this.stream.length-this.offset);const t=this.stream.slice(this.offset,this.offset+e);if(this.offset+=e,t.length!==e)throw Error(`No more data left to read (need ${e}, got ${t.length}: ${t}); last read ${this._last}`);return this._last=t,t}getBuffer(){return this.stream}tgReadBytes(){const e=this.readByte();let t,n;254===e?(n=this.readByte()|this.readByte()<<8|this.readByte()<<16,t=n%4):(n=e,t=(n+1)%4);const s=this.read(n);return t>0&&(t=4-t,this.read(t)),s}tgReadString(){return this.tgReadBytes().toString("utf-8")}tgReadBool(){const e=this.readInt(!1);if(2574415285===e)return!0;if(3162085175===e)return!1;throw new Error(`Invalid boolean code ${e.toString("16")}`)}tgReadDate(){const e=this.readInt();return new Date(1e3*e)}tgReadObject(){const e=this.readInt(!1);let t=i[e];if(void 0===t){if(2574415285===e)return!0;if(3162085175===e)return!1;if(481674261===e){const e=[],t=this.readInt();for(let n=0;n<t;n++)e.push(this.tgReadObject());return e}if(t=a[e],void 0===t){this.seek(-4);const t=this.tellPosition(),n=new s(e,this.read());throw this.setPosition(t),n}}return t.fromReader(this)}tgReadVector(){if(481674261!==this.readInt(!1))throw new Error("Invalid constructor code, vector was expected");const e=this.readInt(),t=[];for(let n=0;n<e;n++)t.push(this.tgReadObject());return t}close(){this.stream=void 0}tellPosition(){return this.offset}setPosition(e){this.offset=e}seek(e){this.offset+=e}}},96472:(e,t,n)=>{var s=n(48764).lW;e.exports=class{constructor(e){this._stream=e}write(e){this._stream=s.concat([this._stream,e])}getValue(){return this._stream}}},33673:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var s,a=n(48764).lW;function i(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const o=new Error("HttpStream was closed");(s=AbortSignal).timeout??(s.timeout=function(e){const t=new AbortController;return setTimeout((()=>t.abort()),e),t.signal});const r=class{constructor(e){i(this,"url",void 0),i(this,"isClosed",void 0),i(this,"stream",[]),i(this,"canRead",Promise.resolve()),i(this,"resolveRead",void 0),i(this,"rejectRead",void 0),i(this,"disconnectedCallback",void 0),this.isClosed=!0,this.disconnectedCallback=e}async read(){await this.canRead;const e=this.stream.shift();return 0===this.stream.length&&(this.canRead=new Promise(((e,t)=>{this.resolveRead=e,this.rejectRead=t}))),e}getURL(e,t,n,s){return 443===t?`https://${e}:${t}/apiw1${n?"_test":""}${s?"_premium":""}`:`http://${e}:${t}/apiw1${n?"_test":""}${s?"_premium":""}`}async connect(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.stream=[],this.canRead=new Promise(((e,t)=>{this.resolveRead=e,this.rejectRead=t})),this.url=this.getURL(t,e,n,s),await fetch(this.url,{method:"POST",body:a.from([]),mode:"cors",signal:AbortSignal.timeout(1e4)}),this.isClosed=!1}write(e){if(this.isClosed||!this.url)throw this.handleDisconnect(),o;return fetch(this.url,{method:"POST",body:e,mode:"cors",signal:AbortSignal.timeout(1e4)}).then((async e=>{if(this.isClosed)return void this.handleDisconnect();if(200!==e.status)throw o;const t=await e.arrayBuffer();this.stream=this.stream.concat(a.from(t)),this.resolveRead&&!this.isClosed&&this.resolveRead()})).catch((e=>{throw this.handleDisconnect(),e}))}handleDisconnect(){this.disconnectedCallback?.(),this.rejectRead&&this.rejectRead()}close(){this.isClosed=!0,this.handleDisconnect(),this.disconnectedCallback=void 0}}},96748:e=>{let t;class n{constructor(e){t||(t=e||"debug"),this.colors={start:"%c",warn:"color : #ff00ff",info:"color : #ffff00",debug:"color : #00ffff",error:"color : #ff0000",end:""},this.messageFormat="[%t] [%l] - [%m]"}static setLevel(e){t=e}canSend(e){return n.LEVEL_MAP.get(t).has(e)}warn(e){this._log("warn",e,this.colors.warn)}info(e){this._log("info",e,this.colors.info)}debug(e){this._log("debug",e,this.colors.debug)}error(e){this._log("error",e,this.colors.error)}format(e,t){return this.messageFormat.replace("%t",(new Date).toISOString()).replace("%l",t.toUpperCase()).replace("%m",e)}_log(e,n,s){t&&this.canSend(e)&&console.log(this.colors.start+this.format(n,e),s)}}var s,a,i;s=n,a="LEVEL_MAP",i=new Map([["error",new Set(["error"])],["warn",new Set(["error","warn"])],["info",new Set(["error","warn","info"])],["debug",new Set(["error","warn","info","debug"])]]),(a=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(a))in s?Object.defineProperty(s,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):s[a]=i,e.exports=n},36411:(e,t,n)=>{var s=n(48764).lW;const a=n(63254),i=n(40355),o=n(96472),r=new Set(["messages.SendMessage","messages.SendMedia","messages.SendMultiMedia","messages.ForwardMessages","messages.SendInlineBotResult"]);e.exports=class{constructor(e,t){this._state=e,this._queue=[],this._pendingStates=[],this._ready=new Promise((e=>{this.setReady=e})),this._log=t}values(){return this._queue}clear(){this._queue=[],this.append(void 0)}append(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e&&r.has(e.request.className))if(n){for(let t=0;t<this._queue.length;t++)if(r.has(this._queue[t]?.request.className)){this._queue[t].after=e;break}}else for(let t=this._queue.length-1;t>=0;t--)if(r.has(this._queue[t]?.request.className)){e.after=this._queue[t];break}n?this._queue.unshift(e):this._queue.push(e),t&&this.setReady(!0),e&&1658238041!==e.request.CONSTRUCTOR_ID&&(this._pendingStates.push(e),e.promise.catch((()=>{})).finally((()=>{this._pendingStates=this._pendingStates.filter((t=>t!==e))})))}prepend(e){e.reverse().forEach((e=>{this.append(e,!1,!0)})),this.setReady(!0)}extend(e){e.forEach((e=>{this.append(e,!1)})),this.setReady(!0)}async getBeacon(e){const t=new o(s.alloc(0));if(e.data.length+i.SIZE_OVERHEAD<=a.MAXIMUM_SIZE){let n;return e.after&&(n=e.after.msgId),e.msgId=await this._state.writeDataAsMessage(t,e.data,"request"===e.request.classType,n),this._log.debug(`Assigned msgId = ${e.msgId} to ${e.request.className||e.request.constructor.name}`),t.getValue()}this._log.warn(`Message payload for ${e.request.className||e.request.constructor.name} is too long ${e.data.length} and cannot be sent`),e.reject("Request Payload is too big")}async wait(){this._queue.length||(this._ready=new Promise((e=>{this.setReady=e})),await this._ready)}async get(){if(!this._queue[this._queue.length-1])return void(this._queue=this._queue.filter(Boolean));let e,t=new o(s.alloc(0));const n=[];let r=0;for(;this._queue.length&&n.length<=a.MAXIMUM_LENGTH;){const e=this._queue.shift();if(e)if(e.abortSignal?.aborted)e.reject(new Error("Request aborted"));else if(r+=e.data.length+i.SIZE_OVERHEAD,r<=a.MAXIMUM_SIZE){let s;e.after&&(s=e.after.msgId),e.msgId=await this._state.writeDataAsMessage(t,e.data,"request"===e.request.classType,s),this._log.debug(`Assigned msgId = ${e.msgId} to ${e.request.className||e.request.constructor.name}`),n.push(e)}else{if(n.length){this._queue.unshift(e);break}this._log.warn(`Message payload for ${e.request.className||e.request.constructor.name} is too long ${e.data.length} and cannot be sent`),e.reject("Request Payload is too big"),r=0}}if(n.length){if(n.length>1){const i=s.alloc(8);i.writeUInt32LE(a.CONSTRUCTOR_ID,0),i.writeInt32LE(n.length,4),e=s.concat([i,t.getValue()]),t=new o(s.alloc(0));const r=await this._state.writeDataAsMessage(t,e,!1);for(const e of n)e.containerId=r}return e=t.getValue(),{batch:n,data:e}}}}},71721:e=>{e.exports=class{constructor(){this._pending=new Map}set(e,t){this._pending.set(e.toString(),t)}get(e){return this._pending.get(e.toString())}getAndDelete(e){const t=this.get(e);return this.delete(e),t}values(){return Array.from(this._pending.values())}delete(e){this._pending.delete(e.toString())}clear(){this._pending.clear()}}},7214:(e,t,n)=>{var s=n(48764).lW;const{Mutex:a}=n(48125),i=new a,o=new Error("WebSocket was closed");e.exports=class{constructor(e){this.client=void 0,this.closed=!0,this.disconnectedCallback=e,this.timeout=3e3}async readExactly(e){let t=s.alloc(0);for(;;){const n=await this.read(e);if(t=s.concat([t,n]),!(e-=n.length))return t}}async read(e){if(this.closed)throw o;if(await this.canRead,this.closed)throw o;const t=this.stream.slice(0,e);return this.stream=this.stream.slice(e),0===this.stream.length&&(this.canRead=new Promise((e=>{this.resolveRead=e}))),t}async readAll(){if(this.closed||!await this.canRead)throw o;const e=this.stream;return this.stream=s.alloc(0),this.canRead=new Promise((e=>{this.resolveRead=e})),e}getWebSocketLink(e,t,n,s){return 443===t?`wss://${e}:${t}/apiws${n?"_test":""}${s?"_premium":""}`:`ws://${e}:${t}/apiws${n?"_test":""}${s?"_premium":""}`}connect(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.stream=s.alloc(0),this.canRead=new Promise((e=>{this.resolveRead=e})),this.closed=!1,this.website=this.getWebSocketLink(t,e,n,a),this.client=new WebSocket(this.website,"binary"),new Promise(((e,n)=>{let s,a=!1;this.client.onopen=()=>{this.receive(),e(this),a=!0,s&&clearTimeout(s)},this.client.onerror=e=>{console.error("WebSocket error",e),n(e),a=!0,s&&clearTimeout(s)},this.client.onclose=e=>{const{code:n,reason:i,wasClean:o}=e;1e3!==n&&console.error(`Socket ${t} closed. Code: ${n}, reason: ${i}, was clean: ${o}`),this.resolveRead(!1),this.closed=!0,this.disconnectedCallback&&this.disconnectedCallback(),a=!0,s&&clearTimeout(s)},s=setTimeout((()=>{a||(n(new Error("WebSocket connection timeout")),this.resolveRead(!1),this.closed=!0,this.disconnectedCallback&&this.disconnectedCallback(),this.client.close(),this.timeout*=2,this.timeout=Math.min(this.timeout,3e4),s=void 0)}),this.timeout),self.addEventListener("offline",(async()=>{await this.close(),this.resolveRead(!1)}))}))}write(e){if(this.closed)throw o;this.client.send(e)}async close(){await this.client.close(),this.closed=!0}receive(){this.client.onmessage=async e=>{await i.runExclusive((async()=>{const t=e.data instanceof ArrayBuffer?s.from(e.data):s.from(await new Response(e.data).arrayBuffer());this.stream=s.concat([this.stream,t]),this.resolveRead(!0)}))}}}},89832:(e,t,n)=>{const s=n(96748),a=n(96472),i=n(35544),o=n(7214),r=n(36411),c=n(16151);e.exports={BinaryWriter:a,BinaryReader:i,MessagePacker:r,AsyncQueue:c,Logger:s,PromisedWebSockets:o}},13522:(e,t,n)=>{const s=n(77150),a=n(78742),i=n(18415),o=n(57404),r=n(61472),c=n(33182),d=n(48960),u=n(87873),l=n(15886),p=n(89832),f=n(89618);e.exports={Api:s,TelegramClient:a,sessions:l,connection:i,extensions:p,tl:o,version:r,events:c,utils:d,errors:u,helpers:f}},59870:(e,t,n)=>{"use strict";n.r(t),n.d(t,{doAuthentication:()=>_});var s=n(77150),a=n.n(s),i=n(87873),o=n(24736),r=n.n(o);n(89618),n(48764).lW;const c=[{fingerprint:r()("-3414540481677951611"),n:r()("29379598170669337022986177149456128565388431120058863768162556424047512191330847455146576344487764408661701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531316010870401287642763009136156734339538042419388722777357134487746169093539093850251243897188928735903389451772730245253062963384108812842079887538976360465290946139638691491496062099570836476454855996319192747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323"),e:65537},{fingerprint:r()("-5595554452916591101"),n:r()("25342889448840415564971689590713473206898847759084779052582026594546022463853940585885215951168491965708222649399180603818074200620463776135424884632162512403163793083921641631564740959529419359595852941166848940585952337613333022396096584117954892216031229237302943701877588456738335398602461675225081791820393153757504952636234951323237820036543581047826906120927972487366805292115792231423684261262330394324750785450942589751755390156647751460719351439969059949569615302809050721500330239005077889855323917509948255722081644689442127297605422579707142646660768825302832201908302295573257427896031830742328565032949"),e:65537}].reduce(((e,t)=>{let{fingerprint:n,...s}=t;return e.set(n.toString(),s),e}),new Map);var d=n(48764).lW;const u=n(24736),l=n(32608),p=n(13302),f=n(89636),g=n(89618),h=n(35544),m=20;async function _(e,t){let n=g.generateRandomBytes(16);const s=g.readBigIntFromBuffer(n,!1,!0),o=await e.send(new(a().ReqPqMulti)({nonce:s}));if(t.debug("Starting authKey generation step 1"),!(o instanceof a().ResPQ))throw new i.SecurityError(`Step 1 answer was ${o}`);if(o.nonce.neq(s))throw new i.SecurityError("Step 1 invalid nonce from server");const r=g.readBigIntFromBuffer(o.pq,!1,!0);t.debug("Finished authKey generation step 1");const{p:_,q:y}=f.factorize(r),b=g.getByteArray(_),w=g.getByteArray(y);n=g.generateRandomBytes(32);const S=g.readBigIntFromBuffer(n,!0,!0),v=new(a().PQInnerData)({pq:g.getByteArray(r),p:b,q:w,nonce:o.nonce,serverNonce:o.serverNonce,newNonce:S}).getBytes();if(v.length>144)throw new i.SecurityError("Step 1 invalid nonce from server");let A,I;for(const e of o.serverPublicKeyFingerprints)if(I=c.get(e.toString()),void 0!==I){A=e;break}if(void 0===A||void 0===I)throw new i.SecurityError("Step 2 could not find a valid key for fingerprints");const C=g.generateRandomBytes(192-v.length),P=d.concat([v,C]),M=d.from(P).reverse();let k;for(let e=0;e<m;e++){const e=g.generateRandomBytes(32),n=await g.sha256(d.concat([e,P])),s=d.concat([M,n]),a=new l(e,d.alloc(32)).encryptIge(s),i=g.bufferXor(e,await g.sha256(a)),o=d.concat([i,a]),r=g.readBigIntFromBuffer(o,!1,!1);if(r.greaterOrEquals(I.n)){t.debug("Aes key greater than RSA. retrying");continue}const c=g.modExp(r,u(I.e),I.n);k=g.readBufferFromBigInt(c,256,!1,!1);break}if(void 0===k)throw new i.SecurityError("Step 2 could create a secure encrypted key");t.debug("Step 2 : Generated a secure aes encrypted data");const R=await e.send(new(a().ReqDHParams)({nonce:o.nonce,serverNonce:o.serverNonce,p:b,q:w,publicKeyFingerprint:A,encryptedData:k}));if(!(R instanceof a().ServerDHParamsOk||R instanceof a().ServerDHParamsFail))throw new Error(`Step 2.1 answer was ${R}`);if(R.nonce.neq(o.nonce))throw new i.SecurityError("Step 2 invalid nonce from server");if(R.serverNonce.neq(o.serverNonce))throw new i.SecurityError("Step 2 invalid server nonce from server");if(R instanceof a().ServerDHParamsFail){const e=await g.sha1(g.toSignedLittleBuffer(S,32).slice(4,20)),t=g.readBigIntFromBuffer(e,!0,!0);if(R.newNonceHash.neq(t))throw new i.SecurityError("Step 2 invalid DH fail nonce from server")}if(!(R instanceof a().ServerDHParamsOk))throw new Error(`Step 2.2 answer was ${R}`);t.debug("Finished authKey generation step 2"),t.debug("Starting authKey generation step 3");const{key:T,iv:E}=await g.generateKeyDataFromNonce(o.serverNonce,S);if(R.encryptedAnswer.length%16!=0)throw new i.SecurityError("Step 3 AES block size mismatch");const B=new l(T,E),U=B.decryptIge(R.encryptedAnswer),D=new h(U),x=D.read(20),V=D.tgReadObject();if(!(V instanceof a().ServerDHInnerData))throw new Error(`Step 3 answer was ${V}`);const F=await g.sha1(V.getBytes());if(!x.equals(F))throw new i.SecurityError("Step 3 Invalid hash answer");if(V.nonce.neq(o.nonce))throw new i.SecurityError("Step 3 Invalid nonce in encrypted answer");if(V.serverNonce.neq(o.serverNonce))throw new i.SecurityError("Step 3 Invalid server nonce in encrypted answer");if(3!==V.g||"c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b"!==V.dhPrime.toString("hex"))throw new i.SecurityError("Step 3 invalid dhPrime or g");const N=g.readBigIntFromBuffer(V.dhPrime,!1,!1),H=g.readBigIntFromBuffer(V.gA,!1,!1),q=V.serverTime-Math.floor(Date.now()/1e3),O=g.readBigIntFromBuffer(g.generateRandomBytes(256),!1,!1),L=g.modExp(u(V.g),O,N),G=g.modExp(H,O,N);if(H.lesserOrEquals(1))throw new i.SecurityError("Step 3 failed ga > 1 check");if(L.lesserOrEquals(1))throw new i.SecurityError("Step 3 failed gb > 1 check");if(H.greater(N.minus(1)))throw new i.SecurityError("Step 3 failed ga > dh_prime - 1 check");const j=u(2).pow(1984);if(!H.greaterOrEquals(j)||!H.lesserOrEquals(N.minus(j)))throw new i.SecurityError("Step 3 failed dh_prime - 2^{2048-64} < ga < 2^{2048-64} check");if(!L.greaterOrEquals(j)||!L.lesserOrEquals(N.minus(j)))throw new i.SecurityError("Step 3 failed dh_prime - 2^{2048-64} < gb < 2^{2048-64} check");const W=new(a().ClientDHInnerData)({nonce:o.nonce,serverNonce:o.serverNonce,retryId:u.zero,gB:g.getByteArray(L,!1)}).getBytes(),K=d.concat([await g.sha1(W),W]),z=B.encryptIge(K),$=await e.send(new(a().SetClientDHParams)({nonce:o.nonce,serverNonce:o.serverNonce,encryptedData:z})),J=[a().DhGenOk,a().DhGenRetry,a().DhGenFail];if(!($ instanceof J[0]||$ instanceof J[1]||$ instanceof J[2]))throw new Error(`Step 3.1 answer was ${$}`);const{name:Q}=$.constructor;if($.nonce.neq(o.nonce))throw new i.SecurityError(`Step 3 invalid ${Q} nonce from server`);if($.serverNonce.neq(o.serverNonce))throw new i.SecurityError(`Step 3 invalid ${Q} server nonce from server`);const X=new p;await X.setKey(g.getByteArray(G));const Z=1+["DhGenOk","DhGenRetry","DhGenFail"].indexOf($.className),Y=await X.calcNewNonceHash(S,Z);if($[`newNonceHash${Z}`].neq(Y))throw new i.SecurityError("Step 3 invalid new nonce hash");if(!($ instanceof a().DhGenOk))throw new Error(`Step 3.2 answer was ${$}`);return t.debug("Finished authKey generation step 3"),{authKey:X,timeOffset:q}}},45585:(e,t,n)=>{var s=n(48764).lW;const a=n(24736),i=n(59109),o=n(35544),{InvalidBufferError:r}=n(48187),{toSignedLittleBuffer:c}=n(89618);e.exports=class{constructor(e,t){this._state=new i(e,t),this._connection=e}async send(e){let t=e.getBytes(),n=this._state._getNewMsgId();const i=c(n,8),d=s.alloc(4);d.writeInt32LE(t.length,0);const u=s.concat([s.concat([s.alloc(8),i,d]),t]);if(await this._connection.send(u),t=await this._connection.recv(),t.length<8)throw new r(t);const l=new o(t);if(l.readLong().neq(a(0)))throw new Error("Bad authKeyId");if(n=l.readLong(),n.eq(a(0)))throw new Error("Bad msgId");if(l.readInt()<=0)throw new Error("Bad length");return l.tgReadObject()}}},74046:(e,t,n)=>{function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{RPCError:a}=n(87873),i=n(45585),o=n(59109),r=n(89618),c=n(13302),{doAuthentication:d}=n(59870),u=n(52301),l=n(63254),p=n(68963),f=n(44287),{MsgsAck:g,upload:h,MsgsStateInfo:m,Pong:_}=n(57404).constructors,y=n(36411),b=n(35544),w=n(71721),{UpdateConnectionState:S,UpdateServerTimeOffset:v}=n(68744),{BadMessageError:A}=n(48187),{BadServerSalt:I,BadMsgNotification:C,MsgDetailedInfo:P,MsgNewDetailedInfo:M,NewSessionCreated:k,FutureSalts:R,MsgsStateReq:T,MsgResendReq:E,MsgsAllInfo:B,HttpWait:U}=n(57404).constructors,{SecurityError:D}=n(48187),{InvalidBufferError:x}=n(48187),{RPCMessageToError:V}=n(87873),{TypeNotFoundError:F}=n(48187),{sendToOrigin:N}=n(97435);class H{constructor(e,t){s(this,"logWithIndex",{debug:this.logWithIndexCallback("debug"),log:this.logWithIndexCallback("log"),warn:this.logWithIndexCallback("warn"),error:this.logWithIndexCallback("error")});const n={...H.DEFAULT_OPTIONS,...t};this._connection=void 0,this._fallbackConnection=void 0,this._shouldForceHttpTransport=n.shouldForceHttpTransport,this._shouldAllowHttpTransport=n.shouldAllowHttpTransport,this._log=n.logger,this._dcId=n.dcId,this._senderIndex=n.senderIndex,this._retries=n.retries,this._retriesToFallback=n.retriesToFallback,this._delay=n.delay,this._retryMainConnectionDelay=n.retryMainConnectionDelay,this._autoReconnect=n.autoReconnect,this._connectTimeout=n.connectTimeout,this._authKeyCallback=n.authKeyCallback,this._updateCallback=n.updateCallback,this._autoReconnectCallback=n.autoReconnectCallback,this._isMainSender=n.isMainSender,this._isExported=n.isExported,this._onConnectionBreak=n.onConnectionBreak,this._isFallback=!1,this._getShouldDebugExportedSenders=n.getShouldDebugExportedSenders,this.userDisconnected=!1,this._user_connected=!1,this.isReconnecting=!1,this._disconnected=!0,this._send_loop_handle=void 0,this._long_poll_loop_handle=void 0,this._recv_loop_handle=void 0,this.authKey=e||new c,this._state=new o(this.authKey,this._log),this._send_queue=new y(this._state,this._log),this._send_queue_long_poll=new y(this._state,this._log),this._pending_state=new w,this._pending_ack=new Set,this._last_acks=[],this._handlers={[u.CONSTRUCTOR_ID]:this._handleRPCResult.bind(this),[l.CONSTRUCTOR_ID]:this._handleContainer.bind(this),[p.CONSTRUCTOR_ID]:this._handleGzipPacked.bind(this),[_.CONSTRUCTOR_ID]:this._handlePong.bind(this),[I.CONSTRUCTOR_ID]:this._handleBadServerSalt.bind(this),[C.CONSTRUCTOR_ID]:this._handleBadNotification.bind(this),[P.CONSTRUCTOR_ID]:this._handleDetailedInfo.bind(this),[M.CONSTRUCTOR_ID]:this._handleNewDetailedInfo.bind(this),[k.CONSTRUCTOR_ID]:this._handleNewSessionCreated.bind(this),[g.CONSTRUCTOR_ID]:this._handleAck.bind(this),[R.CONSTRUCTOR_ID]:this._handleFutureSalts.bind(this),[T.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[E.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[B.CONSTRUCTOR_ID]:this._handleMsgAll.bind(this)}}logWithIndexCallback(e){var t=this;return function(){if(t._getShouldDebugExportedSenders&&t._getShouldDebugExportedSenders()){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];console[e](`[${t._isExported?`idx=${t._senderIndex} `:"M "}dcId=${t._dcId}]`,...s)}}}getConnection(){return this._isFallback?this._fallbackConnection:this._connection}async connect(e,t,n){if(this.userDisconnected=!1,this._user_connected&&!t)return this._log.info("User is already connected!"),!1;this.isConnecting=!0,this._isFallback=this._shouldForceHttpTransport&&this._shouldAllowHttpTransport,this._connection=e,this._fallbackConnection=n;for(let e=0;e<this._retries+this._retriesToFallback;e++)try{e>=this._retriesToFallback&&this._shouldAllowHttpTransport&&(this._isFallback=!0,this.logWithIndex.warn("Using fallback connection"),this._log.warn("Using fallback connection")),this.logWithIndex.warn("Connecting..."),await this._connect(this.getConnection()),this.logWithIndex.warn("Connected!"),this._updateCallback&&this._updateCallback(new S(S.connected));break}catch(t){this._updateCallback&&0===e&&this._updateCallback(new S(S.disconnected)),this._log.error(`${this._isFallback?"HTTP":"WebSocket"} connection failed attempt: ${e+1}`),console.error(t),await r.sleep(this._delay)}return this.isConnecting=!1,this._isFallback&&!this._shouldForceHttpTransport&&this.tryReconnectToMain(),!0}async tryReconnectToMain(){if(this.isConnecting||!this._isFallback||this._isReconnectingToMain||this.isReconnecting||this._shouldForceHttpTransport||this._isExported)await r.sleep(this._retryMainConnectionDelay);else{this._log.debug("Trying to reconnect to main connection"),this._isReconnectingToMain=!0;try{await this._connection.connect(),this._log.info("Reconnected to main connection"),this.logWithIndex.warn("Reconnected to main connection"),this.isReconnecting=!0,await this._disconnect(this._fallbackConnection),await this.connect(this._connection,!0,this._fallbackConnection),this.isReconnecting=!1,this._isReconnectingToMain=!1}catch(e){this.isReconnecting=!1,this._isReconnectingToMain=!1,this._log.error(`Failed to reconnect to main connection, retrying in ${this._retryMainConnectionDelay}ms`),await r.sleep(this._retryMainConnectionDelay),this.tryReconnectToMain()}}}isConnected(){return this._user_connected}async disconnect(){this.userDisconnected=!0,this.logWithIndex.warn("Disconnecting..."),await this._disconnect(this.getConnection())}destroy(){this._send_queue.clear()}send(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=new f(e,t);return n?this._send_queue_long_poll.append(s):(this.logWithIndex.debug(`Send ${e.className}`),this._send_queue.append(s)),s.promise}addStateToQueue(e){this._send_queue.append(e)}async sendBeacon(e){if(!this._user_connected)throw new Error("Cannot send requests while disconnected");const t=new f(e,void 0),n=await this._send_queue.getBeacon(t),s=await this._state.encryptMessageData(n);N({type:"sendBeacon",data:s,url:this._fallbackConnection.socket.website})}async _connect(e){if(e.isConnected()||(this._log.info("Connecting to {0}...".replace("{0}",e)),await e.connect(),this._log.debug("Connection success!")),this.authKey.getKey())this._authenticated=!0,this._log.debug("Already have an auth key ...");else{const t=new i(e,this._log);this._log.debug("New auth_key attempt ...");const n=await d(t,this._log);this._log.debug("Generated new auth_key successfully"),await this.authKey.setKey(n.authKey),this._state.timeOffset=n.timeOffset,this._updateCallback&&this._updateCallback(new v(this._state.timeOffset)),this._authKeyCallback&&await this._authKeyCallback(this.authKey,this._dcId)}this._user_connected=!0,this.isReconnecting=!1,this._send_loop_handle||(this._log.debug("Starting send loop"),this._send_loop_handle=this._sendLoop()),this._recv_loop_handle||(this._log.debug("Starting receive loop"),this._recv_loop_handle=this._recvLoop()),!this._long_poll_loop_handle&&e.shouldLongPoll&&(this._log.debug("Starting long-poll loop"),this._long_poll_loop_handle=this._longPollLoop()),this._log.info("Connection to %s complete!".replace("%s",e.toString()))}async _disconnect(e){this._updateCallback&&this._updateCallback(new S(S.disconnected)),void 0!==e?(this._log.info("Disconnecting from %s...".replace("%s",e.toString())),this._user_connected=!1,this._log.debug("Closing current connection..."),this.logWithIndex.warn("Disconnecting"),await e.disconnect()):this._log.info("Not disconnecting (already have no connection)")}async _longPollLoop(){for(;this._user_connected&&!this.isReconnecting&&this._isFallback&&this.getConnection().shouldLongPoll;){await this._send_queue_long_poll.wait();const e=await this._send_queue_long_poll.get();if(this.isReconnecting||!this._isFallback)return void(this._long_poll_loop_handle=void 0);if(!e)continue;let{data:t}=e;const{batch:n}=e;this._log.debug(`Encrypting ${n.length} message(s) in ${t.length} bytes for sending`),t=await this._state.encryptMessageData(t);try{await this._fallbackConnection.send(t)}catch(e){return this._log.error(e),this._log.info("Connection closed while sending data"),this._long_poll_loop_handle=void 0,this.isSendingLongPoll=!1,void(this.userDisconnected||this.reconnect())}this.isSendingLongPoll=!1,this.checkLongPoll()}this._long_poll_loop_handle=void 0}async _sendLoop(){for(this._send_queue.prepend(this._pending_state.values()),this._pending_state.clear();this._user_connected&&!this.isReconnecting;){const e=()=>{if(this._pending_ack.size){const e=new f(new g({msgIds:Array(...this._pending_ack)}));this._send_queue.append(e),this._last_acks.push(e),this._last_acks.length>=10&&this._last_acks.shift(),this._pending_ack.clear()}};e(),this.logWithIndex.debug(`Waiting for messages to send... ${this.isReconnecting}`),this._log.debug(`Waiting for messages to send... ${this.isReconnecting}`),await this._send_queue.wait(),this._isFallback&&this.send(new U({maxDelay:0,waitAfter:0,maxWait:0})),e();const t=await this._send_queue.get();if(this.logWithIndex.debug(`Got ${t?.batch.length} message(s) to send`),!t)continue;let{data:n}=t;const{batch:s}=t;for(const e of s)if(Array.isArray(e))for(const t of e)"request"===t.request.classType&&"HttpWait"!==t.request.className&&this._pending_state.set(t.msgId,t);else"request"===e.request.classType&&"HttpWait"!==e.request.className&&this._pending_state.set(e.msgId,e);if(this.isReconnecting)return this.logWithIndex.debug("Reconnecting :("),void(this._send_loop_handle=void 0);this._log.debug(`Encrypting ${s.length} message(s) in ${n.length} bytes for sending`),this.logWithIndex.debug("Sending",s.map((e=>e.request.className))),n=await this._state.encryptMessageData(n);try{await this.getConnection().send(n)}catch(e){return this.logWithIndex.debug(`Connection closed while sending data ${e}`),this._log.error(e),this._log.info("Connection closed while sending data"),this._send_loop_handle=void 0,void(this.userDisconnected||this.reconnect())}finally{for(const e of s)if(Array.isArray(e))for(const t of e)"HttpWait"===t.request.className&&e.resolve();else"HttpWait"===e.request.className&&e.resolve();this.logWithIndex.debug("Encrypted messages put in a queue to be sent"),this._log.debug("Encrypted messages put in a queue to be sent")}}this._send_loop_handle=void 0}async _recvLoop(){let e,t;for(;this._user_connected&&!this.isReconnecting;){this._log.debug("Receiving items from the network..."),this.logWithIndex.debug("Receiving items from the network...");try{e=await this.getConnection().recv()}catch(e){return this.userDisconnected||(this._log.error(e),this._log.warn("Connection closed while receiving data"),this.reconnect()),void(this._recv_loop_handle=void 0)}try{t=await this._state.decryptMessageData(e)}catch(e){if(this.logWithIndex.debug(`Error while receiving items from the network ${e.toString()}`),e instanceof F){this._log.info(`Type ${e.invalidConstructorId} not found, remaining data ${e.remaining}`);continue}if(e instanceof D){this._log.warn(`Security error while unpacking a received message: ${e}`);continue}return e instanceof x?(404===e.code?this._handleBadAuthKey():(this._log.warn(`Invalid buffer ${e.code} for dc ${this._dcId}`),this.reconnect()),void(this._recv_loop_handle=void 0)):(this._log.error("Unhandled error while receiving data"),this._log.error(e),this.reconnect(),void(this._recv_loop_handle=void 0))}try{await this._processMessage(t)}catch(e){e instanceof a?"AUTH_KEY_UNREGISTERED"!==e.message&&"SESSION_REVOKED"!==e.message||this._handleBadAuthKey(!0):(this._log.error("Unhandled error while receiving data"),this._log.error(e))}this.checkLongPoll()}this._recv_loop_handle=void 0}checkLongPoll(){!this.isSendingLongPoll&&this._isFallback&&(this.isSendingLongPoll=!0,this.send(new U({maxDelay:500,waitAfter:150,maxWait:3e3}),void 0,!0))}_handleBadAuthKey(e){e&&this._isMainSender||(this._log.warn(`Broken authorization key for dc ${this._dcId}, resetting...`),this._isMainSender&&this._updateCallback?this._updateCallback(new S(S.broken)):!this._isMainSender&&this._onConnectionBreak&&this._onConnectionBreak(this._dcId))}async _processMessage(e){if("MsgsAck"===e.obj.className)return;this.logWithIndex.debug(`Process message ${e.obj.className}`),this._pending_ack.add(e.msgId),this.getConnection().shouldLongPoll&&this._send_queue.setReady(!0),e.obj=await e.obj;let t=this._handlers[e.obj.CONSTRUCTOR_ID];t||(t=this._handleUpdate.bind(this)),await t(e)}_popStates(e){const t=this._pending_state.getAndDelete(e);if(t)return[t];const n=[];for(const t of this._pending_state.values())t.containerId?.equals(e)&&n.push(t.msgId);if(n.length){const e=[];for(const t of n)e.push(this._pending_state.getAndDelete(t));return e}for(const t of this._last_acks)if(t.msgId===e)return[t];return[]}_handleRPCResult(e){const t=e.obj,n=this._pending_state.getAndDelete(t.reqMsgId);if(this._log.debug(`Handling RPC result for message ${t.reqMsgId}`),n){if(t.error){const e=V(t.error,n.request);throw this._send_queue.append(new f(new g({msgIds:[n.msgId]}))),n.reject(e),e}try{const e=new b(t.body),s=n.request.readResult(e);this.logWithIndex.debug("Handling RPC result",s),n.resolve(s)}catch(e){throw n.reject(e),e}}else try{if(!(new b(t.body).tgReadObject()instanceof h.File))throw new F("Not an upload.File")}catch(e){if(e instanceof F)return void this._log.info(`Received response without parent request: ${t.body}`);if(this._isFallback)return;throw e}}async _handleContainer(e){this._log.debug("Handling container");for(const t of e.obj.messages)await this._processMessage(t)}async _handleGzipPacked(e){this._log.debug("Handling gzipped data");const t=new b(e.obj.data);e.obj=t.tgReadObject(),await this._processMessage(e)}_handleUpdate(e){2331323052===e.obj.SUBCLASS_OF_ID?(this._log.debug(`Handling update ${e.obj.className}`),this._updateCallback&&this._updateCallback(e.obj)):this._log.warn(`Note: ${e.obj.className} is not an update, not dispatching it`)}_handlePong(e){const t=e.obj,n=this._state.updateTimeOffset(e.msgId);this._updateCallback&&this._updateCallback(new v(n)),this._log.debug(`Handling pong for message ${t.msgId}`);const s=this._pending_state.getAndDelete(t.msgId);s&&s.resolve(t)}_handleBadServerSalt(e){const t=e.obj;this._log.debug(`Handling bad salt for message ${t.badMsgId}`),this._state.salt=t.newServerSalt;const n=this._popStates(t.badMsgId);this._send_queue.extend(n),this._log.debug(`${n.length} message(s) will be resent`)}_handleBadNotification(e){const t=e.obj,n=this._popStates(t.badMsgId);if(this._log.debug(`Handling bad msg ${JSON.stringify(t)}`),[16,17].includes(t.errorCode)){const t=this._state.updateTimeOffset(e.msgId);this._updateCallback&&this._updateCallback(new v(t)),this._log.info(`System clock is wrong, set time offset to ${t}s`)}else if(32===t.errorCode)this._state._sequence+=64;else{if(33!==t.errorCode){for(const e of n)e.reject(new A(e.request,t.errorCode));return}this._state._sequence-=16}this._send_queue.extend(n),this._log.debug(`${n.length} messages will be resent due to bad msg`)}_handleDetailedInfo(e){const t=e.obj.answerMsgId;this._log.debug(`Handling detailed info for message ${t}`),this._pending_ack.add(t)}_handleNewDetailedInfo(e){const t=e.obj.answerMsgId;this._log.debug(`Handling new detailed info for message ${t}`),this._pending_ack.add(t)}_handleNewSessionCreated(e){this._log.debug("Handling new session created"),this._state.salt=e.obj.serverSalt}_handleAck(){}_handleFutureSalts(e){this._log.debug(`Handling future salts for message ${e.msgId}`);const t=this._pending_state.getAndDelete(e.msgId);t&&t.resolve(e.obj)}_handleStateForgotten(e){this._send_queue.append(new f(new m({msgId:e.msgId,query:String.fromCharCode(1).repeat(e.obj.msgIds)})))}_handleMsgAll(e){}reconnect(){this._user_connected&&!this.isReconnecting&&(this.isReconnecting=!0,r.sleep(1e3).then((()=>{this.logWithIndex.log("Reconnecting..."),this._log.info("Started reconnecting"),this._reconnect()})))}async _reconnect(){this._log.debug("Closing current connection...");try{this.logWithIndex.warn("[Reconnect] Closing current connection..."),await this._disconnect(this.getConnection())}catch(e){this._log.warn(e)}this._send_queue.append(void 0),this._state.reset();const e=new this._connection.constructor(this._connection._ip,this._connection._port,this._connection._dcId,this._connection._log,this._connection._testServers),t=new this._fallbackConnection.constructor(this._connection._ip,this._connection._port,this._connection._dcId,this._connection._log,this._connection._testServers);await this.connect(e,!0,t),this.isReconnecting=!1,this._send_queue.prepend(this._pending_state.values()),this._pending_state.clear(),this._autoReconnectCallback&&await this._autoReconnectCallback()}}s(H,"DEFAULT_OPTIONS",{logger:void 0,retries:1/0,retriesToFallback:1,delay:2e3,retryMainConnectionDelay:1e4,shouldForceHttpTransport:!1,shouldAllowHttpTransport:!1,autoReconnect:!0,connectTimeout:void 0,authKeyCallback:void 0,updateCallback:void 0,autoReconnectCallback:void 0,isMainSender:void 0,onConnectionBreak:void 0,isExported:void 0,getShouldDebugExportedSenders:void 0}),e.exports=H},59109:(e,t,n)=>{var s=n(48764).lW;const a=n(24736),i=n(28136),o=n(89618),r=n(32608),c=n(35544),d=n(68963),{TLMessage:u}=n(92058),{SecurityError:l,InvalidBufferError:p}=n(48187),{InvokeAfterMsg:f}=n(57404).requests,{toSignedLittleBuffer:g}=n(89618);e.exports=class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.authKey=e,this._log=t,this._isCall=n,this._isOutgoing=s,this.timeOffset=0,this.salt=0,this.id=void 0,this._sequence=void 0,this._lastMsgId=void 0,this.msgIds=[],this.reset()}reset(){this.id=o.generateRandomLong(!0),this._sequence=0,this._lastMsgId=a(0),this.msgIds=[]}updateMessageId(e){e.msgId=this._getNewMsgId()}async _calcKey(e,t,n){const a=this._isCall?128+(this._isOutgoing^n?8:0):!0===n?0:8,[i,r]=await Promise.all([o.sha256(s.concat([t,e.slice(a,a+36)])),o.sha256(s.concat([e.slice(a+40,a+76),t]))]),c=s.concat([i.slice(0,8),r.slice(8,24),i.slice(24,32)]);return this._isCall?{key:c,iv:s.concat([r.slice(0,4),i.slice(8,16),r.slice(24,28)])}:{key:c,iv:s.concat([r.slice(0,8),i.slice(8,24),r.slice(24,32)])}}async writeDataAsMessage(e,t,n,a){const i=this._getNewMsgId(),o=this._getSeqNo(n);let r;r=a?await d.gzipIfSmaller(n,new f({msgId:a,query:{getBytes:()=>t}}).getBytes()):await d.gzipIfSmaller(n,t);const c=s.alloc(4);c.writeInt32LE(o,0);const u=s.alloc(4);u.writeInt32LE(r.length,0);const l=g(i,8);return e.write(s.concat([l,c,u])),e.write(r),i}async encryptMessageData(e){if(await this.authKey.waitForKey(),this._isCall){const t=128+(this._isOutgoing?0:8),n=e.length;e=s.from(e),n%4!=0&&(e=s.concat([e,s.from(new Array(4-n%4).fill(32))]));const a=(await o.sha256(s.concat([this.authKey.getKey().slice(88+t,88+t+32),s.from(e)]))).slice(8,24),{iv:r,key:c}=await this._calcKey(this.authKey.getKey(),a,!0);return e=o.convertToLittle(new i.CTR(c,r).encrypt(e)),s.concat([a,e])}{const t=g(this.salt,8),n=g(this.id,8);e=s.concat([s.concat([t,n]),e]);const a=o.generateRandomBytes(o.mod(-(e.length+12),16)+12),i=(await o.sha256(s.concat([this.authKey.getKey().slice(88,120),e,a]))).slice(8,24),{iv:c,key:d}=await this._calcKey(this.authKey.getKey(),i,!0),u=o.readBufferFromBigInt(this.authKey.keyId,8);return s.concat([u,i,new r(d,c).encryptIge(s.concat([e,a]))])}}async decryptMessageData(e){if(e.length<8)throw new p(e);if(e.length<0)throw new l("Server replied with negative length");if(e.length%4!=0&&!this._isCall)throw new l("Server replied with length not divisible by 4");if(!this._isCall&&o.readBigIntFromBuffer(e.slice(0,8)).neq(this.authKey.keyId))throw new l("Server replied with an invalid auth key");const t=this._isCall?e.slice(0,16):e.slice(8,24),n=this._isCall?128+(this.isOutgoing?8:0):void 0,{iv:a,key:d}=await this._calcKey(this.authKey.getKey(),t,!1);if(this._isCall){const t=(e=e.slice(16)).length;e=s.concat([e,s.from(new Array(4-t%4).fill(0))]),e=(e=o.convertToLittle(new i.CTR(d,a).decrypt(e))).slice(0,t)}else e=new r(d,a).decryptIge(this._isCall?e.slice(16):e.slice(24));const f=this._isCall?await o.sha256(s.concat([this.authKey.getKey().slice(88+n,88+n+32),e])):await o.sha256(s.concat([this.authKey.getKey().slice(96,128),e]));if(!this._isCall&&!t.equals(f.slice(8,24)))throw new l("Received msg_key doesn't match with expected one");const g=new c(e);if(this._isCall)return g.readInt(!1),g.read(e.length-4);{if(g.readLong(),!g.readLong().eq(this.id))throw new l("Server replied with a wrong session ID");const t=g.readLong();if(this.msgIds.includes(t.toString()))throw new l("Duplicate msgIds");this.msgIds.length>500&&this.msgIds.shift();const n=g.readInt(),s=g.readInt(),a=e.length-s;if(a<12||a>1024)throw new l("Server replied with the wrong message padding");const i=await g.tgReadObject();if(i?.className?.startsWith("Update")){const e=Math.floor(Date.now()/1e3),n=this.getMsgIdTimeLocal(t);if(n&&(n-e>30||e-n>300))throw new l("The message time is incorrect.")}return i&&!("errorCode"in i)&&this.msgIds.push(t.toString()),new u(t,n,i)}}_getNewMsgId(){const e=Date.now()/1e3+this.timeOffset,t=Math.floor(1e9*(e-Math.floor(e)));let n=a(Math.floor(e)).shiftLeft(a(32)).or(a(t).shiftLeft(a(2)));return this._lastMsgId.greaterOrEquals(n)&&(n=this._lastMsgId.add(a(4))),this._lastMsgId=n,n}getMsgIdTimeLocal(e){return!this._lastMsgId.eq(0)&&e.shiftRight(a(32)).toJSNumber()-this.timeOffset}updateTimeOffset(e){const t=this._getNewMsgId(),n=this.timeOffset,s=Math.floor(Date.now()/1e3),i=e.shiftRight(a(32));return this.timeOffset=i-s,this.timeOffset!==n&&(this._lastMsgId=a(0),this._log.debug(`Updated time offset (old offset ${n}, bad ${t}, good ${e}, new ${this.timeOffset})`)),this.timeOffset}_getSeqNo(e){if(e){const e=2*this._sequence+1;return this._sequence+=1,e}return 2*this._sequence}}},44287:(e,t,n)=>{const s=n(46586).Z;e.exports=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;this.containerId=void 0,this.msgId=void 0,this.request=e,this.data=e.getBytes(),this.after=void 0,this.result=void 0,this.abortSignal=t,this.finished=new s,this.resetPromise()}isReady(){return!this.after||this.after.finished.promise}resetPromise(){this.reject?.(),this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}},34353:(e,t,n)=>{function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(7214),i=n(33673).Z,o=n(16151);class r{constructor(e,t,n,i,r,c){s(this,"PacketCodecClass",void 0),this._ip=e,this._port=t,this._dcId=n,this._log=i,this._testServers=r,this._isPremium=c,this._connected=!1,this._sendTask=void 0,this._recvTask=void 0,this._codec=void 0,this._obfuscation=void 0,this._sendArray=new o,this._recvArray=new o,this.shouldLongPoll=!1,this.socket=new a(this.disconnectCallback.bind(this))}isConnected(){return this._connected}async disconnectCallback(){await this.disconnect(!0)}async _connect(){this._log.debug("Connecting"),this._codec=new this.PacketCodecClass(this),await this.socket.connect(this._port,this._ip,this._testServers,this._isPremium),this._log.debug("Finished connecting"),await this._initConn()}async connect(){await this._connect(),this._connected=!0,this._sendTask||(this._sendTask=this._sendLoop()),this._recvTask=this._recvLoop()}async disconnect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._connected&&(this._connected=!1,this._recvArray.push(void 0),e||await this.socket.close())}async send(e){if(!this._connected)throw new Error("Not connected");await this._sendArray.push(e)}async recv(){for(;this._connected;){const e=await this._recvArray.pop();if(e)return e}throw new Error("Not connected")}async _sendLoop(){try{for(;this._connected;){const e=await this._sendArray.pop();if(!e)return void(this._sendTask=void 0);await this._send(e)}}catch(e){this._log.info("The server closed the connection while sending")}}async _recvLoop(){let e;for(;this._connected;){try{if(e=await this._recv(),!e)throw new Error("no data received")}catch(e){return this._log.info("connection closed"),void this.disconnect()}await this._recvArray.push(e)}}async _initConn(){this._codec.tag&&await this.socket.write(this._codec.tag)}_send(e){const t=this._codec.encodePacket(e);this.socket.write(t)}_recv(){return this._codec.readPacket(this.socket)}toString(){return`${this._ip}:${this._port}/${this.constructor.name.replace("Connection","")}`}}e.exports={Connection:r,PacketCodec:class{constructor(e){this._conn=e}encodePacket(e){throw new Error("Not Implemented")}readPacket(e){throw new Error("Not Implemented")}},ObfuscatedConnection:class extends r{constructor(){super(...arguments),s(this,"ObfuscatedIO",void 0)}_initConn(){this._obfuscation=new this.ObfuscatedIO(this),this.socket.write(this._obfuscation.header)}_send(e){this._obfuscation.write(this._codec.encodePacket(e))}_recv(){return this._codec.readPacket(this._obfuscation)}},HttpConnection:class extends r{constructor(e,t,n,s,a,o){super(e,t,n,s,a,o),this.shouldLongPoll=!0,this.socket=new i(this.disconnectCallback.bind(this))}send(e){return this.socket.write(e)}recv(){return this.socket.read()}async _connect(){this._log.debug("Connecting"),await this.socket.connect(this._port,this._ip,this._testServers,this._isPremium),this._log.debug("Finished connecting")}async connect(){await this._connect(),this._connected=!0}}}},26302:(e,t,n)=>{var s=n(48764).lW;function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const i=n(24736),{readBufferFromBigInt:o}=n(89618),{Connection:r,PacketCodec:c}=n(34353);class d extends c{constructor(e){super(e),this.tag=d.tag,this.obfuscateTag=d.obfuscateTag}encodePacket(e){let t=e.length>>2;if(t<127){const e=s.alloc(1);e.writeUInt8(t,0),t=e}else t=s.concat([s.from("7f","hex"),o(i(t),3)]);return s.concat([t,e])}async readPacket(e){let t=(await e.read(1))[0];return t>=127&&(t=s.concat([await e.read(3),s.alloc(1)]).readInt32LE(0)),e.read(t<<2)}}a(d,"tag",s.from("ef","hex")),a(d,"obfuscateTag",s.from("efefefef","hex")),e.exports={ConnectionTCPAbridged:class extends r{constructor(){super(...arguments),a(this,"PacketCodecClass",d)}},AbridgedPacketCodec:d}},5484:()=>{},72986:(e,t,n)=>{var s=n(48764).lW;function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{generateRandomBytes:i}=n(89618),{ObfuscatedConnection:o}=n(34353),{AbridgedPacketCodec:r}=n(26302),c=n(55830);class d{constructor(e){a(this,"header",void 0),this.connection=e.socket;const t=this.initHeader(e.PacketCodecClass);this.header=t.random,this._encrypt=t.encryptor,this._decrypt=t.decryptor}initHeader(e){const t=[s.from("50567247","hex"),s.from("474554","hex"),s.from("504f5354","hex"),s.from("eeeeeeee","hex")];let n;for(;;)if(n=i(64),239!==n[0]&&!n.slice(4,8).equals(s.alloc(4))){let e=!0;for(const s of t)if(s.equals(n.slice(0,4))){e=!1;break}if(e)break}n=n.toJSON().data;const a=s.from(n.slice(8,56)).reverse(),o=s.from(n.slice(8,40)),r=s.from(n.slice(40,56)),d=s.from(a.slice(0,32)),u=s.from(a.slice(32,48)),l=new c(o,r),p=new c(d,u);return n=s.concat([s.from(n.slice(0,56)),e.obfuscateTag,s.from(n.slice(60))]),n=s.concat([s.from(n.slice(0,56)),s.from(l.encrypt(n).slice(56,64)),s.from(n.slice(64))]),{random:n,encryptor:l,decryptor:p}}async read(e){const t=await this.connection.readExactly(e);return this._decrypt.encrypt(t)}write(e){this.connection.write(this._encrypt.encrypt(e))}}e.exports={ConnectionTCPObfuscated:class extends o{constructor(){super(...arguments),a(this,"ObfuscatedIO",d),a(this,"PacketCodecClass",r)}}}},30417:(e,t,n)=>{const{Connection:s,HttpConnection:a}=n(34353),{ConnectionTCPFull:i}=n(5484),{ConnectionTCPAbridged:o}=n(26302),{ConnectionTCPObfuscated:r}=n(72986);e.exports={Connection:s,HttpConnection:a,ConnectionTCPFull:i,ConnectionTCPAbridged:o,ConnectionTCPObfuscated:r}},18415:(e,t,n)=>{const s=n(45585),a=n(74046),{Connection:i,ConnectionTCPFull:o,ConnectionTCPAbridged:r,ConnectionTCPObfuscated:c,HttpConnection:d}=n(30417),{UpdateConnectionState:u,UpdateServerTimeOffset:l}=n(68744);e.exports={Connection:i,HttpConnection:d,ConnectionTCPFull:o,ConnectionTCPAbridged:r,ConnectionTCPObfuscated:c,MTProtoPlainSender:s,MTProtoSender:a,UpdateConnectionState:u,UpdateServerTimeOffset:l}},68744:e=>{function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class n{constructor(e,t){this.state=e,this.origin=t}}t(n,"disconnected",-1),t(n,"connected",1),t(n,"broken",0),e.exports={UpdateConnectionState:n,UpdateServerTimeOffset:class{constructor(e){this.timeOffset=e}}}},59270:e=>{e.exports=class{get dcId(){throw new Error("Not Implemented")}get serverAddress(){throw new Error("Not Implemented")}get port(){throw new Error("Not Implemented")}get authKey(){throw new Error("Not Implemented")}set authKey(e){throw new Error("Not Implemented")}setDC(e,t,n){throw new Error("Not implemented")}save(){throw new Error("Not Implemented")}delete(){throw new Error("Not Implemented")}}},926:(e,t,n)=>{const s=n(28753),a="GramJs";e.exports=class extends s{async _delete(){const e=new Request(this._storageKey);return(await self.caches.open(a)).delete(e)}async _fetchFromCache(){const e=new Request(this._storageKey),t=await self.caches.open(a),n=await t.match(e);return n?n.text():void 0}async _saveToCache(e){const t=new Request(this._storageKey),n=new Response(e);return(await self.caches.open(a)).put(t,n)}}},80007:(e,t,n)=>{var s=n(48764).lW;const a=n(33995),i=n(13302),o=n(48960);e.exports=class extends a{constructor(e,t){super(),this._sessionData=e,this._callback=t,this._authKeys={}}get authKey(){throw new Error("Not supported")}set authKey(e){throw new Error("Not supported")}async load(){if(!this._sessionData)return;const{mainDcId:e,keys:t,hashes:n}=this._sessionData,{ipAddress:a,port:r}=o.getDC(e);this.setDC(e,a,r,!0),await Promise.all(Object.keys(t).map((async e=>{const a="string"==typeof t[e]?s.from(t[e],"hex"):s.from(t[e]);if(n[e]){const t="string"==typeof n[e]?s.from(n[e],"hex"):s.from(n[e]);this._authKeys[e]=new i(a,t)}else this._authKeys[e]=new i,await this._authKeys[e].setKey(a,!0)})))}setDC(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._dcId=e,this._serverAddress=t,this._port=n,delete this._authKeys[e],s||this._onUpdate()}getAuthKey(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._dcId;return this._authKeys[e]}setAuthKey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._dcId;this._authKeys[t]=e,this._onUpdate()}getSessionData(){const e={mainDcId:this._dcId,keys:{},hashes:{}};return Object.keys(this._authKeys).forEach((t=>{const n=this._authKeys[t];n&&n._key&&(e.keys[t]=n._key.toString("hex"),e.hashes[t]=n._hash.toString("hex"))})),e}_onUpdate(){this._callback(this.getSessionData())}delete(){this._callback(void 0)}}},45945:(e,t,n)=>{const s=n(24678),a=n(28753),i="GramJs";e.exports=class extends a{_delete(){return s.del(`${i}:${this._storageKey}`)}_fetchFromCache(){return s.get(`${i}:${this._storageKey}`)}_saveToCache(e){return s.set(`${i}:${this._storageKey}`,e)}}},31753:(e,t,n)=>{const s=n(28753);e.exports=class extends s{_delete(){return localStorage.removeItem(this._storageKey)}_fetchFromCache(){return localStorage.getItem(this._storageKey)}_saveToCache(e){return localStorage.setItem(this._storageKey,e)}}},33995:(e,t,n)=>{const s=n(59270);e.exports=class extends s{constructor(){super(),this._serverAddress=void 0,this._dcId=0,this._port=void 0,this._takeoutId=void 0,this._entities=new Set,this._updateStates={}}get dcId(){return this._dcId}get serverAddress(){return this._serverAddress}get port(){return this._port}get authKey(){return this._authKey}set authKey(e){this._authKey=e}setDC(e,t,n){this._dcId=0|e,this._serverAddress=t,this._port=n}}},28753:(e,t,n)=>{var s=n(48764).lW;const a=n(33995),i=n(13302),o=n(48960);e.exports=class extends a{constructor(e){super(),this._authKeys={},e&&e.startsWith("session:")?this._sessionString=e:e&&(this._storageKey=e)}get authKey(){throw new Error("Not supported")}set authKey(e){throw new Error("Not supported")}async load(){if(this._sessionString)await this._loadFromSessionString();else if(this._storageKey)try{const e=await this._fetchFromCache(),{mainDcId:t,keys:n,hashes:a}=JSON.parse(e),{ipAddress:r,port:c}=o.getDC(t);this.setDC(t,r,c,!0),Object.keys(n).forEach((e=>{n[e]&&a[e]&&(this._authKeys[e]=new i(s.from(n[e].data),s.from(a[e].data)))}))}catch(e){console.warn("Failed to retrieve or parse session from storage"),console.warn(e)}}setDC(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._dcId=e,this._serverAddress=t,this._port=n,delete this._authKeys[e],s||this._updateStorage()}async save(){return this._storageKey||(this._storageKey=`GramJs-session-${Date.now()}`),await this._updateStorage(),this._storageKey}getAuthKey(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._dcId;return this._authKeys[e]}setAuthKey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._dcId;this._authKeys[t]=e,this._updateStorage()}getSessionData(e){const t={mainDcId:this._dcId,keys:{},hashes:{}};return Object.keys(this._authKeys).forEach((n=>{const s=this._authKeys[n];s._key&&(t.keys[n]=e?s._key.toString("hex"):s._key,t.hashes[n]=e?s._hash.toString("hex"):s._hash)})),t}async _loadFromSessionString(){const[,e,t]=this._sessionString.split(":"),n=Number(e),{ipAddress:a,port:r}=o.getDC(n);this.setDC(n,a,r);const c=new i;await c.setKey(s.from(t,"hex"),!0),this.setAuthKey(c,n)}async _updateStorage(){if(this._storageKey)try{await this._saveToCache(JSON.stringify(this.getSessionData()))}catch(e){console.warn("Failed to update session in storage"),console.warn(e)}}async delete(){try{return await this._delete()}catch(e){console.warn("Failed to delete session from storage"),console.warn(e)}}_delete(){throw new Error("Not Implemented")}_fetchFromCache(){throw new Error("Not Implemented")}_saveToCache(e){throw new Error("Not Implemented")}}},12433:(e,t,n)=>{var s=n(48764).lW;const a=n(33995),i=n(13302),o=n(35544);class r extends a{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(super(),e){if("1"!==e[0])throw new Error("Not a valid string");e=e.slice(1);const t=r.decode(e),n=new o(t);this._dcId=n.read(1).readUInt8(0);const s=n.read(2).readInt16BE(0);this._serverAddress=String(n.read(s)),this._port=n.read(2).readInt16BE(0),this._key=n.read(-1)}}static encode(e){return e.toString("base64")}static decode(e){return s.from(e,"base64")}async load(){this._key&&(this._authKey=new i,await this._authKey.setKey(this._key))}save(){if(!this.authKey)return"";const e=s.from([this.dcId]),t=s.from(this.serverAddress),n=s.alloc(2);n.writeInt16BE(t.length,0);const a=s.alloc(2);return a.writeInt16BE(this.port,0),"1"+r.encode(s.concat([e,n,t,a,this.authKey.getKey()]))}getAuthKey(e){if(!e||e===this.dcId)return this.authKey}setAuthKey(e,t){t&&t!==this.dcId||(this.authKey=e)}}e.exports=r},15886:(e,t,n)=>{const s=n(33995),a=n(12433),i=n(926),o=n(31753),r=n(45945),c=n(80007);e.exports={Memory:s,StringSession:a,CacheApiSession:i,LocalStorageSession:o,IdbSession:r,CallbackSession:c}},70845:(e,t,n)=>{const s=n(77150),a={};for(const e of Object.values(s))if(e.CONSTRUCTOR_ID)a[e.CONSTRUCTOR_ID]=e;else for(const t of Object.values(e))a[t.CONSTRUCTOR_ID]=t;e.exports={LAYER:165,tlobjects:a}},77150:(e,t,n)=>{var s=n(48764).lW;function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{parseTl:i,serializeBytes:o,serializeDate:r}=n(51436),{toSignedLittleBuffer:c}=n(89618),d=n(84779),u=n(48106),l="undefined"!=typeof self&&void 0!==self.localStorage,p="GramJs:apiCache";function f(e){const t=i(e),n=[],s=[];for(const e of t)e.isFunction?s.push(e):n.push(e);return[n,s]}function g(e,t){switch(t){case"int":{const t=s.alloc(4);return t.writeInt32LE(e,0),t}case"long":return c(e,8);case"int128":return c(e,16);case"int256":return c(e,32);case"double":{const t=s.alloc(8);return t.writeDoubleLE(e,0),t}case"string":case"bytes":return o(e);case"Bool":return e?s.from("b5757299","hex"):s.from("379779bc","hex");case"true":return s.alloc(0);case"date":return r(e);default:return e.getBytes()}}function h(e,t){if(t.isVector){t.useVectorId&&e.readInt();const n=[],s=e.readInt();t.isVector=!1;for(let a=0;a<s;a++)n.push(h(e,t));return t.isVector=!0,n}if(t.flagIndicator)return e.readInt();switch(t.type){case"int":return e.readInt();case"long":return e.readLong();case"int128":return e.readLargeInt(128);case"int256":return e.readLargeInt(256);case"double":return e.readDouble();case"string":return e.tgReadString();case"Bool":return e.tgReadBool();case"true":return!0;case"bytes":return e.tgReadBytes();case"date":return e.tgReadDate();default:if(t.skipConstructorId)throw new Error(`Unknown type ${t}`);return e.tgReadObject()}}function m(e,t){const n={};for(const i of t){const{name:t,constructorId:o,subclassOfId:r,argsConfig:c,namespace:d,result:u}=i,l=[d,t].join(".").replace(/^\./,"");class p{constructor(t){a(this,"CONSTRUCTOR_ID",o),a(this,"SUBCLASS_OF_ID",r),a(this,"className",l),a(this,"classType",e),t=t||{},Object.keys(t).forEach((e=>{this[e]=t[e]}))}static fromReader(e){const t={};for(const n in c)if(c.hasOwnProperty(n)){const s=c[n];if(s.isFlag){const a=t[`flags${s.flagGroup>1?s.flagGroup:""}`]&1<<s.flagIndex;if("true"===s.type){t[n]=Boolean(a);continue}t[n]=a?h(e,s):void 0}else t[n]=h(e,s)}return new p(t)}getBytes(){const e=this.CONSTRUCTOR_ID,t=s.alloc(4);t.writeUInt32LE(e,0);const n=[t];for(const e in c)if(c.hasOwnProperty(e)){if(c[e].isFlag&&(!1===this[e]&&"true"===c[e].type||void 0===this[e]))continue;if(c[e].isVector){c[e].useVectorId&&n.push(s.from("15c4b51c","hex"));const t=s.alloc(4);t.writeInt32LE(this[e].length,0),n.push(t,s.concat(this[e].map((t=>g(t,c[e].type)))))}else if(c[e].flagIndicator)if(Object.values(c).some((e=>e.isFlag))){let e=0;for(const t in c)c[t].isFlag&&(!1===this[t]&&"true"===c[t].type||void 0===this[t]?e|=0:e|=1<<c[t].flagIndex);const t=s.alloc(4);t.writeUInt32LE(e,0),n.push(t)}else n.push(s.alloc(4));else if(n.push(g(this[e],c[e].type)),this[e]&&"function"==typeof this[e].getBytes){let t=c[e].type.charAt(c[e].type.indexOf(".")+1);t=t===t.toUpperCase(),t||n.shift()}}return s.concat(n)}readResult(t){if("request"!==e)throw new Error("`readResult()` called for non-request instance");const n=u.match(/Vector<(int|long)>/);if(n){t.readInt();const e=[],s=t.readInt();if("int"===n[1])for(let n=0;n<s;n++)e.push(t.readInt());else for(let n=0;n<s;n++)e.push(t.readLong());return e}return t.tgReadObject()}}a(p,"CONSTRUCTOR_ID",o),a(p,"SUBCLASS_OF_ID",r),a(p,"className",l),a(p,"classType",e),d?(n[d]||(n[d]={}),n[d][t]=p):n[t]=p}return n}e.exports=function(){let e;const t=l&&function(){const e=localStorage.getItem(p);return e&&JSON.parse(e)}();return t?e=t:(e=function(){const[e,t]=f(d),[n,s]=f(u);return{constructors:[].concat(e,n),requests:[].concat(t,s)}}(),l&&localStorage.setItem(p,JSON.stringify(e))),function(e,t){const n={...e};return Object.keys(t).forEach((e=>{"function"!=typeof t[e]&&n[e]?Object.assign(n[e],t[e]):n[e]=t[e]})),n}(m("constructor",e.constructors),m("request",e.requests))}()},84779:e=>{e.exports="boolFalse#bc799737 = Bool;\nboolTrue#997275b5 = Bool;\ntrue#3fedd339 = True;\nvector#1cb5c415 {t:Type} # [ t ] = Vector t;\nerror#c4b9f9bb code:int text:string = Error;\nnull#56730bcc = Null;\ninputPeerEmpty#7f3b18ea = InputPeer;\ninputPeerSelf#7da07ec9 = InputPeer;\ninputPeerChat#35a95cb9 chat_id:long = InputPeer;\ninputPeerUser#dde8a54c user_id:long access_hash:long = InputPeer;\ninputPeerChannel#27bcbbfc channel_id:long access_hash:long = InputPeer;\ninputPeerUserFromMessage#a87b0a1c peer:InputPeer msg_id:int user_id:long = InputPeer;\ninputPeerChannelFromMessage#bd2a0840 peer:InputPeer msg_id:int channel_id:long = InputPeer;\ninputUserEmpty#b98886cf = InputUser;\ninputUserSelf#f7c1b13f = InputUser;\ninputUser#f21158c6 user_id:long access_hash:long = InputUser;\ninputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser;\ninputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\ninputMediaEmpty#9664f57f = InputMedia;\ninputMediaUploadedPhoto#1e287d04 flags:# spoiler:flags.2?true file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;\ninputMediaPhoto#b3ba0635 flags:# spoiler:flags.1?true id:InputPhoto ttl_seconds:flags.0?int = InputMedia;\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\ninputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;\ninputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true spoiler:flags.5?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;\ninputMediaDocument#33473058 flags:# spoiler:flags.2?true id:InputDocument ttl_seconds:flags.0?int query:flags.1?string = InputMedia;\ninputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;\ninputMediaPhotoExternal#e5bbfe1a flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaDocumentExternal#fb52dc99 flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\ninputMediaInvoice#8eb5a6d5 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string extended_media:flags.2?InputMedia = InputMedia;\ninputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;\ninputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia;\ninputMediaDice#e66fbf7b emoticon:string = InputMedia;\ninputMediaStory#89fdd778 peer:InputPeer id:int = InputMedia;\ninputChatPhotoEmpty#1ca48f57 = InputChatPhoto;\ninputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto;\ninputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;\ninputGeoPointEmpty#e4c123d6 = InputGeoPoint;\ninputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;\ninputPhotoEmpty#1cd7bf0d = InputPhoto;\ninputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;\ninputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;\ninputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;\ninputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocation;\ninputTakeoutFileLocation#29be5899 = InputFileLocation;\ninputPhotoFileLocation#40181ffe id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputPhotoLegacyFileLocation#d83466f3 id:long access_hash:long file_reference:bytes volume_id:long local_id:int secret:long = InputFileLocation;\ninputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer photo_id:long = InputFileLocation;\ninputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;\ninputGroupCallStream#598a92a flags:# call:InputGroupCall time_ms:long scale:int video_channel:flags.0?int video_quality:flags.0?int = InputFileLocation;\npeerUser#59511722 user_id:long = Peer;\npeerChat#36c6019a chat_id:long = Peer;\npeerChannel#a2a5371e channel_id:long = Peer;\nstorage.fileUnknown#aa963b05 = storage.FileType;\nstorage.filePartial#40bc6f52 = storage.FileType;\nstorage.fileJpeg#7efe0e = storage.FileType;\nstorage.fileGif#cae1aadf = storage.FileType;\nstorage.filePng#a4f63c0 = storage.FileType;\nstorage.filePdf#ae1e508d = storage.FileType;\nstorage.fileMp3#528a0677 = storage.FileType;\nstorage.fileMov#4b09ebbc = storage.FileType;\nstorage.fileMp4#b3cea0e4 = storage.FileType;\nstorage.fileWebp#1081464c = storage.FileType;\nuserEmpty#d3bc4b7a id:long = User;\nuser#abb5f120 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?int = User;\nuserProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;\nuserProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;\nuserStatusEmpty#9d05049 = UserStatus;\nuserStatusOnline#edb93949 expires:int = UserStatus;\nuserStatusOffline#8c703f was_online:int = UserStatus;\nuserStatusRecently#e26f42f1 = UserStatus;\nuserStatusLastWeek#7bf09fc = UserStatus;\nuserStatusLastMonth#77ebc742 = UserStatus;\nchatEmpty#29562865 id:long = Chat;\nchat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;\nchatForbidden#6592a1a7 id:long title:string = Chat;\nchannel#94f592db flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?int = Chat;\nchannelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat;\nchatFull#c9d31138 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector<long> available_reactions:flags.18?ChatReactions = ChatFull;\nchannelFull#723027bd flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions stories:flags2.4?PeerStories = ChatFull;\nchatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;\nchatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;\nchatParticipantAdmin#a0933f5b user_id:long inviter_id:long date:int = ChatParticipant;\nchatParticipantsForbidden#8763d3e1 flags:# chat_id:long self_participant:flags.0?ChatParticipant = ChatParticipants;\nchatParticipants#3cbc93f8 chat_id:long participants:Vector<ChatParticipant> version:int = ChatParticipants;\nchatPhotoEmpty#37c1011c = ChatPhoto;\nchatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;\nmessageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;\nmessage#38116ee0 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;\nmessageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message;\nmessageMediaEmpty#3ded6320 = MessageMedia;\nmessageMediaPhoto#695150d7 flags:# spoiler:flags.3?true photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;\nmessageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia;\nmessageMediaUnsupported#9f84f49e = MessageMedia;\nmessageMediaDocument#4cf4d72d flags:# nopremium:flags.3?true spoiler:flags.4?true document:flags.0?Document alt_document:flags.5?Document ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;\nmessageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;\nmessageMediaGame#fdb19008 game:Game = MessageMedia;\nmessageMediaInvoice#f6a548d3 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string extended_media:flags.4?MessageExtendedMedia = MessageMedia;\nmessageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia;\nmessageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;\nmessageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;\nmessageMediaStory#68cb6283 flags:# via_mention:flags.1?true peer:Peer id:int story:flags.0?StoryItem = MessageMedia;\nmessageActionEmpty#b6aef7b0 = MessageAction;\nmessageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction;\nmessageActionChatEditTitle#b5a1ce5a title:string = MessageAction;\nmessageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;\nmessageActionChatDeletePhoto#95e3fbef = MessageAction;\nmessageActionChatAddUser#15cefd00 users:Vector<long> = MessageAction;\nmessageActionChatDeleteUser#a43f30cc user_id:long = MessageAction;\nmessageActionChatJoinedByLink#31224c3 inviter_id:long = MessageAction;\nmessageActionChannelCreate#95d2ac92 title:string = MessageAction;\nmessageActionChatMigrateTo#e1037f92 channel_id:long = MessageAction;\nmessageActionChannelMigrateFrom#ea3948e9 title:string chat_id:long = MessageAction;\nmessageActionPinMessage#94bd38ed = MessageAction;\nmessageActionHistoryClear#9fbab604 = MessageAction;\nmessageActionGameScore#92a72876 game_id:long score:int = MessageAction;\nmessageActionPaymentSentMe#8f31b327 flags:# recurring_init:flags.2?true recurring_used:flags.3?true currency:string total_amount:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string charge:PaymentCharge = MessageAction;\nmessageActionPaymentSent#96163f56 flags:# recurring_init:flags.2?true recurring_used:flags.3?true currency:string total_amount:long invoice_slug:flags.0?string = MessageAction;\nmessageActionPhoneCall#80e11a7f flags:# video:flags.2?true call_id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = MessageAction;\nmessageActionScreenshotTaken#4792929b = MessageAction;\nmessageActionCustomAction#fae69f56 message:string = MessageAction;\nmessageActionBotAllowed#c516d679 flags:# attach_menu:flags.1?true from_request:flags.3?true domain:flags.0?string app:flags.2?BotApp = MessageAction;\nmessageActionSecureValuesSentMe#1b287353 values:Vector<SecureValue> credentials:SecureCredentialsEncrypted = MessageAction;\nmessageActionSecureValuesSent#d95c6154 types:Vector<SecureValueType> = MessageAction;\nmessageActionContactSignUp#f3f25f76 = MessageAction;\nmessageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;\nmessageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;\nmessageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector<long> = MessageAction;\nmessageActionSetMessagesTTL#3c134d7b flags:# period:int auto_setting_from:flags.0?long = MessageAction;\nmessageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;\nmessageActionSetChatTheme#aa786345 emoticon:string = MessageAction;\nmessageActionChatJoinedByRequest#ebbca3cb = MessageAction;\nmessageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;\nmessageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;\nmessageActionGiftPremium#c83d6aec flags:# currency:string amount:long months:int crypto_currency:flags.0?string crypto_amount:flags.0?long = MessageAction;\nmessageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction;\nmessageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction;\nmessageActionSuggestProfilePhoto#57de635e photo:Photo = MessageAction;\nmessageActionRequestedPeer#fe77345d button_id:int peer:Peer = MessageAction;\nmessageActionSetChatWallPaper#bc44a927 wallpaper:WallPaper = MessageAction;\nmessageActionSetSameChatWallPaper#c0787d6d wallpaper:WallPaper = MessageAction;\ndialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog;\ndialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;\nphotoEmpty#2331b22d id:long = Photo;\nphoto#fb197a65 flags:# has_stickers:flags.0?true id:long access_hash:long file_reference:bytes date:int sizes:Vector<PhotoSize> video_sizes:flags.1?Vector<VideoSize> dc_id:int = Photo;\nphotoSizeEmpty#e17e23c type:string = PhotoSize;\nphotoSize#75c78e60 type:string w:int h:int size:int = PhotoSize;\nphotoCachedSize#21e1ad6 type:string w:int h:int bytes:bytes = PhotoSize;\nphotoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;\nphotoSizeProgressive#fa3efb95 type:string w:int h:int sizes:Vector<int> = PhotoSize;\nphotoPathSize#d8214d41 type:string bytes:bytes = PhotoSize;\ngeoPointEmpty#1117dd5f = GeoPoint;\ngeoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint;\nauth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode;\nauth.sentCodeSuccess#2390fe44 authorization:auth.Authorization = auth.SentCode;\nauth.authorization#2ea2c0d4 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int future_auth_token:flags.2?bytes user:User = auth.Authorization;\nauth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;\nauth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization;\ninputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;\ninputNotifyUsers#193b4417 = InputNotifyPeer;\ninputNotifyChats#4a95e84e = InputNotifyPeer;\ninputNotifyBroadcasts#b1db7c7e = InputNotifyPeer;\ninputNotifyForumTopic#5c467992 peer:InputPeer top_msg_id:int = InputNotifyPeer;\ninputPeerNotifySettings#cacb6ae2 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?NotificationSound stories_muted:flags.6?Bool stories_hide_sender:flags.7?Bool stories_sound:flags.8?NotificationSound = InputPeerNotifySettings;\npeerNotifySettings#99622c0c flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int ios_sound:flags.3?NotificationSound android_sound:flags.4?NotificationSound other_sound:flags.5?NotificationSound stories_muted:flags.6?Bool stories_hide_sender:flags.7?Bool stories_ios_sound:flags.8?NotificationSound stories_android_sound:flags.9?NotificationSound stories_other_sound:flags.10?NotificationSound = PeerNotifySettings;\npeerSettings#a518110d flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true request_chat_broadcast:flags.10?true geo_distance:flags.6?int request_chat_title:flags.9?string request_chat_date:flags.9?int = PeerSettings;\nwallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;\nwallPaperNoFile#e0804116 id:long flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;\ninputReportReasonSpam#58dbcab8 = ReportReason;\ninputReportReasonViolence#1e22c78d = ReportReason;\ninputReportReasonPornography#2e59d922 = ReportReason;\ninputReportReasonChildAbuse#adf44ee3 = ReportReason;\ninputReportReasonOther#c1e4a2b1 = ReportReason;\ninputReportReasonCopyright#9b89f93a = ReportReason;\ninputReportReasonGeoIrrelevant#dbd4feed = ReportReason;\ninputReportReasonFake#f5ddd6e7 = ReportReason;\ninputReportReasonIllegalDrugs#a8eb2be = ReportReason;\ninputReportReasonPersonalDetails#9ec7863d = ReportReason;\nuserFull#b9b12c6c flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector<PremiumGiftOption> wallpaper:flags.24?WallPaper stories:flags.25?PeerStories = UserFull;\ncontact#145ade0b user_id:long mutual:Bool = Contact;\nimportedContact#c13e3c50 user_id:long client_id:long = ImportedContact;\ncontactStatus#16d9703b user_id:long status:UserStatus = ContactStatus;\ncontacts.contactsNotModified#b74ba9d2 = contacts.Contacts;\ncontacts.contacts#eae87e42 contacts:Vector<Contact> saved_count:int users:Vector<User> = contacts.Contacts;\ncontacts.importedContacts#77d01c3b imported:Vector<ImportedContact> popular_invites:Vector<PopularContact> retry_contacts:Vector<long> users:Vector<User> = contacts.ImportedContacts;\ncontacts.blocked#ade1591 blocked:Vector<PeerBlocked> chats:Vector<Chat> users:Vector<User> = contacts.Blocked;\ncontacts.blockedSlice#e1664194 count:int blocked:Vector<PeerBlocked> chats:Vector<Chat> users:Vector<User> = contacts.Blocked;\nmessages.dialogs#15ba6c40 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;\nmessages.dialogsSlice#71e094f3 count:int dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Dialogs;\nmessages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;\nmessages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;\nmessages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;\nmessages.channelMessages#c776ba4e flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;\nmessages.messagesNotModified#74535f21 count:int = messages.Messages;\nmessages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;\nmessages.chatsSlice#9cd81144 count:int chats:Vector<Chat> = messages.Chats;\nmessages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector<Chat> users:Vector<User> = messages.ChatFull;\nmessages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;\ninputMessagesFilterEmpty#57e2f66c = MessagesFilter;\ninputMessagesFilterPhotos#9609a51c = MessagesFilter;\ninputMessagesFilterVideo#9fc00e65 = MessagesFilter;\ninputMessagesFilterPhotoVideo#56e9f0e4 = MessagesFilter;\ninputMessagesFilterDocument#9eddf188 = MessagesFilter;\ninputMessagesFilterUrl#7ef0dd87 = MessagesFilter;\ninputMessagesFilterGif#ffc86587 = MessagesFilter;\ninputMessagesFilterVoice#50f5c392 = MessagesFilter;\ninputMessagesFilterMusic#3751b49e = MessagesFilter;\ninputMessagesFilterChatPhotos#3a20ecb8 = MessagesFilter;\ninputMessagesFilterPhoneCalls#80c99768 flags:# missed:flags.0?true = MessagesFilter;\ninputMessagesFilterRoundVoice#7a7c17a4 = MessagesFilter;\ninputMessagesFilterRoundVideo#b549da53 = MessagesFilter;\ninputMessagesFilterMyMentions#c1f8e69a = MessagesFilter;\ninputMessagesFilterGeo#e7026d0d = MessagesFilter;\ninputMessagesFilterContacts#e062db83 = MessagesFilter;\ninputMessagesFilterPinned#1bb00451 = MessagesFilter;\nupdateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;\nupdateMessageID#4e90bfd6 id:int random_id:long = Update;\nupdateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;\nupdateUserTyping#c01e857f user_id:long action:SendMessageAction = Update;\nupdateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update;\nupdateChatParticipants#7761198 participants:ChatParticipants = Update;\nupdateUserStatus#e5bdf8de user_id:long status:UserStatus = Update;\nupdateUserName#a7848924 user_id:long first_name:string last_name:string usernames:Vector<Username> = Update;\nupdateNewAuthorization#8951abef flags:# unconfirmed:flags.0?true hash:long date:flags.0?int device:flags.0?string location:flags.0?string = Update;\nupdateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;\nupdateEncryptedChatTyping#1710f156 chat_id:int = Update;\nupdateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;\nupdateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;\nupdateChatParticipantAdd#3dda5451 chat_id:long user_id:long inviter_id:long date:int version:int = Update;\nupdateChatParticipantDelete#e32f3d77 chat_id:long user_id:long version:int = Update;\nupdateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;\nupdateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;\nupdateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update;\nupdatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;\nupdateUserPhone#5492a13 user_id:long phone:string = Update;\nupdateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update;\nupdateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;\nupdateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;\nupdateReadMessagesContents#f8227181 flags:# messages:Vector<int> pts:int pts_count:int date:flags.0?int = Update;\nupdateChannelTooLong#108d941f flags:# channel_id:long pts:flags.0?int = Update;\nupdateChannel#635b4c09 channel_id:long = Update;\nupdateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;\nupdateReadChannelInbox#922e6e10 flags:# folder_id:flags.0?int channel_id:long max_id:int still_unread_count:int pts:int = Update;\nupdateDeleteChannelMessages#c32d5b12 channel_id:long messages:Vector<int> pts:int pts_count:int = Update;\nupdateChannelMessageViews#f226ac08 channel_id:long id:int views:int = Update;\nupdateChatParticipantAdmin#d7ca61a2 chat_id:long user_id:long is_admin:Bool version:int = Update;\nupdateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;\nupdateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true emojis:flags.1?true order:Vector<long> = Update;\nupdateStickerSets#31c24808 flags:# masks:flags.0?true emojis:flags.1?true = Update;\nupdateSavedGifs#9375341e = Update;\nupdateBotInlineQuery#496f379c flags:# query_id:long user_id:long query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;\nupdateBotInlineSend#12f12a07 flags:# user_id:long query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;\nupdateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;\nupdateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;\nupdateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;\nupdateReadChannelOutbox#b75f99a9 channel_id:long max_id:int = Update;\nupdateDraftMessage#1b49ec6d flags:# peer:Peer top_msg_id:flags.0?int draft:DraftMessage = Update;\nupdateReadFeaturedStickers#571d2742 = Update;\nupdateRecentStickers#9a422c20 = Update;\nupdateConfig#a229dd06 = Update;\nupdatePtsChanged#3354678f = Update;\nupdateChannelWebPage#2f2ba99f channel_id:long webpage:WebPage pts:int pts_count:int = Update;\nupdateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update;\nupdatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector<DialogPeer> = Update;\nupdateBotWebhookJSON#8317c0c3 data:DataJSON = Update;\nupdateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;\nupdateBotShippingQuery#b5aefd7d query_id:long user_id:long payload:bytes shipping_address:PostAddress = Update;\nupdateBotPrecheckoutQuery#8caa9a96 flags:# query_id:long user_id:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;\nupdatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;\nupdateLangPackTooLong#46560264 lang_code:string = Update;\nupdateLangPack#56022f4d difference:LangPackDifference = Update;\nupdateFavedStickers#e511996d = Update;\nupdateChannelReadMessagesContents#ea29055d flags:# channel_id:long top_msg_id:flags.0?int messages:Vector<int> = Update;\nupdateContactsReset#7084a7be = Update;\nupdateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update;\nupdateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update;\nupdateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;\nupdateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;\nupdateFolderPeers#19360dc0 folder_peers:Vector<FolderPeer> pts:int pts_count:int = Update;\nupdatePeerSettings#6a7e7366 peer:Peer settings:PeerSettings = Update;\nupdatePeerLocated#b4afcfb0 peers:Vector<PeerLocated> = Update;\nupdateNewScheduledMessage#39a51dfb message:Message = Update;\nupdateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;\nupdateTheme#8216fba3 theme:Theme = Update;\nupdateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;\nupdateLoginToken#564fe691 = Update;\nupdateMessagePollVote#24f40e77 poll_id:long peer:Peer options:Vector<bytes> qts:int = Update;\nupdateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;\nupdateDialogFilterOrder#a5d72105 order:Vector<int> = Update;\nupdateDialogFilters#3504914f = Update;\nupdatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;\nupdateChannelMessageForwards#d29a27f4 channel_id:long id:int forwards:int = Update;\nupdateReadChannelDiscussionInbox#d6b19546 flags:# channel_id:long top_msg_id:int read_max_id:int broadcast_id:flags.0?long broadcast_post:flags.0?int = Update;\nupdateReadChannelDiscussionOutbox#695c9e7c channel_id:long top_msg_id:int read_max_id:int = Update;\nupdatePeerBlocked#ebe07752 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true peer_id:Peer = Update;\nupdateChannelUserTyping#8c88c923 flags:# channel_id:long top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;\nupdatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector<int> pts:int pts_count:int = Update;\nupdatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector<int> pts:int pts_count:int = Update;\nupdateChat#f89a6a4e chat_id:long = Update;\nupdateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector<GroupCallParticipant> version:int = Update;\nupdateGroupCall#14b24500 chat_id:long call:GroupCall = Update;\nupdatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;\nupdateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateChannelParticipant#985d3abb flags:# via_chatlist:flags.3?true channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;\nupdateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update;\nupdateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;\nupdateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector<BotCommand> = Update;\nupdatePendingJoinRequests#7063c3db peer:Peer requests_pending:int recent_requesters:Vector<long> = Update;\nupdateBotChatInviteRequester#11dfa986 peer:Peer date:int user_id:long about:string invite:ExportedChatInvite qts:int = Update;\nupdateMessageReactions#5e1b3cb8 flags:# peer:Peer msg_id:int top_msg_id:flags.0?int reactions:MessageReactions = Update;\nupdateAttachMenuBots#17b7a20b = Update;\nupdateWebViewResultSent#1592b79d query_id:long = Update;\nupdateBotMenuButton#14b85813 bot_id:long button:BotMenuButton = Update;\nupdateSavedRingtones#74d8be99 = Update;\nupdateTranscribedAudio#84cd5a flags:# pending:flags.0?true peer:Peer msg_id:int transcription_id:long text:string = Update;\nupdateReadFeaturedEmojiStickers#fb4c496c = Update;\nupdateUserEmojiStatus#28373599 user_id:long emoji_status:EmojiStatus = Update;\nupdateRecentEmojiStatuses#30f443db = Update;\nupdateRecentReactions#6f7863f4 = Update;\nupdateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?true stickerset:long = Update;\nupdateMessageExtendedMedia#5a73a98c peer:Peer msg_id:int extended_media:MessageExtendedMedia = Update;\nupdateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update;\nupdateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector<int> = Update;\nupdateUser#20529438 user_id:long = Update;\nupdateAutoSaveSettings#ec05b097 = Update;\nupdateGroupInvitePrivacyForbidden#ccf08ad6 user_id:long = Update;\nupdateStory#75b3b798 peer:Peer story:StoryItem = Update;\nupdateReadStories#f74e932b peer:Peer max_id:int = Update;\nupdateStoryID#1bf335b9 id:int random_id:long = Update;\nupdateStoriesStealthMode#2c084dc1 stealth_mode:StoriesStealthMode = Update;\nupdateSentStoryReaction#7d627683 peer:Peer story_id:int reaction:Reaction = Update;\nupdates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;\nupdates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference;\nupdates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> state:updates.State = updates.Difference;\nupdates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;\nupdates.differenceTooLong#4afe8f6d pts:int = updates.Difference;\nupdatesTooLong#e317af7e = Updates;\nupdateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;\nupdateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;\nupdateShort#78d4dec1 update:Update date:int = Updates;\nupdatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;\nupdates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;\nupdateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;\nphotos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;\nphotos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;\nphotos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;\nupload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;\nupload.fileCdnRedirect#f18cda44 dc_id:int file_token:bytes encryption_key:bytes encryption_iv:bytes file_hashes:Vector<FileHash> = upload.File;\ndcOption#18b7a10d flags:# ipv6:flags.0?true media_only:flags.1?true tcpo_only:flags.2?true cdn:flags.3?true static:flags.4?true this_port_only:flags.5?true id:int ip_address:string port:int secret:flags.10?bytes = DcOption;\nconfig#cc1a241e flags:# default_p2p_contacts:flags.3?true preload_featured_stickers:flags.4?true revoke_pm_inbox:flags.6?true blocked_mode:flags.8?true force_try_ipv6:flags.14?true date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> dc_txt_domain_name:string chat_size_max:int megagroup_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int push_chat_period_ms:int push_chat_limit:int edit_time_limit:int revoke_time_limit:int revoke_pm_time_limit:int rating_e_decay:int stickers_recent_limit:int channels_read_media_period:int tmp_sessions:flags.0?int call_receive_timeout_ms:int call_ring_timeout_ms:int call_connect_timeout_ms:int call_packet_timeout_ms:int me_url_prefix:string autoupdate_url_prefix:flags.7?string gif_search_username:flags.9?string venue_search_username:flags.10?string img_search_username:flags.11?string static_maps_provider:flags.12?string caption_length_max:int message_length_max:int webfile_dc_id:int suggested_lang_code:flags.2?string lang_pack_version:flags.2?int base_lang_pack_version:flags.2?int reactions_default:flags.15?Reaction autologin_token:flags.16?string = Config;\nnearestDc#8e1a1775 country:string this_dc:int nearest_dc:int = NearestDc;\nhelp.appUpdate#ccbbce30 flags:# can_not_skip:flags.0?true id:int version:string text:string entities:Vector<MessageEntity> document:flags.1?Document url:flags.2?string sticker:flags.3?Document = help.AppUpdate;\nhelp.noAppUpdate#c45a6536 = help.AppUpdate;\nhelp.inviteText#18cb9f78 message:string = help.InviteText;\nencryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;\nencryptedChatWaiting#66b25953 id:int access_hash:long date:int admin_id:long participant_id:long = EncryptedChat;\nencryptedChatRequested#48f1d94c flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:long participant_id:long g_a:bytes = EncryptedChat;\nencryptedChat#61f0d4c7 id:int access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long = EncryptedChat;\nencryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;\ninputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;\nencryptedFileEmpty#c21f497e = EncryptedFile;\nencryptedFile#a8008cd8 id:long access_hash:long size:long dc_id:int key_fingerprint:int = EncryptedFile;\ninputEncryptedFileEmpty#1837c364 = InputEncryptedFile;\ninputEncryptedFileUploaded#64bd0306 id:long parts:int md5_checksum:string key_fingerprint:int = InputEncryptedFile;\ninputEncryptedFile#5a17b5e5 id:long access_hash:long = InputEncryptedFile;\ninputEncryptedFileBigUploaded#2dc173c8 id:long parts:int key_fingerprint:int = InputEncryptedFile;\nencryptedMessage#ed18c118 random_id:long chat_id:int date:int bytes:bytes file:EncryptedFile = EncryptedMessage;\nencryptedMessageService#23734b06 random_id:long chat_id:int date:int bytes:bytes = EncryptedMessage;\nmessages.dhConfigNotModified#c0e24635 random:bytes = messages.DhConfig;\nmessages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;\nmessages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;\nmessages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;\ninputDocumentEmpty#72f0eaae = InputDocument;\ninputDocument#1abfb575 id:long access_hash:long file_reference:bytes = InputDocument;\ndocumentEmpty#36f8c871 id:long = Document;\ndocument#8fd4c4d8 flags:# id:long access_hash:long file_reference:bytes date:int mime_type:string size:long thumbs:flags.0?Vector<PhotoSize> video_thumbs:flags.1?Vector<VideoSize> dc_id:int attributes:Vector<DocumentAttribute> = Document;\nhelp.support#17c6b5f6 phone_number:string user:User = help.Support;\nnotifyPeer#9fd40bd8 peer:Peer = NotifyPeer;\nnotifyUsers#b4c83b4c = NotifyPeer;\nnotifyChats#c007cec3 = NotifyPeer;\nnotifyBroadcasts#d612e8ef = NotifyPeer;\nnotifyForumTopic#226e6308 peer:Peer top_msg_id:int = NotifyPeer;\nsendMessageTypingAction#16bf744e = SendMessageAction;\nsendMessageCancelAction#fd5ec8f5 = SendMessageAction;\nsendMessageRecordVideoAction#a187d66f = SendMessageAction;\nsendMessageUploadVideoAction#e9763aec progress:int = SendMessageAction;\nsendMessageRecordAudioAction#d52f73f7 = SendMessageAction;\nsendMessageUploadAudioAction#f351d7ab progress:int = SendMessageAction;\nsendMessageUploadPhotoAction#d1d34a26 progress:int = SendMessageAction;\nsendMessageUploadDocumentAction#aa0cd9e4 progress:int = SendMessageAction;\nsendMessageGeoLocationAction#176f8ba1 = SendMessageAction;\nsendMessageChooseContactAction#628cbc6f = SendMessageAction;\nsendMessageGamePlayAction#dd6a8f48 = SendMessageAction;\nsendMessageRecordRoundAction#88f27fbc = SendMessageAction;\nsendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;\nspeakingInGroupCallAction#d92c2285 = SendMessageAction;\nsendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;\nsendMessageChooseStickerAction#b05ac6b1 = SendMessageAction;\nsendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:DataJSON = SendMessageAction;\nsendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction;\ncontacts.found#b3134d9d my_results:Vector<Peer> results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;\ninputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey;\ninputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey;\ninputPrivacyKeyPhoneCall#fabadc5f = InputPrivacyKey;\ninputPrivacyKeyPhoneP2P#db9e70d2 = InputPrivacyKey;\ninputPrivacyKeyForwards#a4dd4c08 = InputPrivacyKey;\ninputPrivacyKeyProfilePhoto#5719bacc = InputPrivacyKey;\ninputPrivacyKeyPhoneNumber#352dafa = InputPrivacyKey;\ninputPrivacyKeyAddedByPhone#d1219bdd = InputPrivacyKey;\ninputPrivacyKeyVoiceMessages#aee69d68 = InputPrivacyKey;\ninputPrivacyKeyAbout#3823cc40 = InputPrivacyKey;\nprivacyKeyStatusTimestamp#bc2eab30 = PrivacyKey;\nprivacyKeyChatInvite#500e6dfa = PrivacyKey;\nprivacyKeyPhoneCall#3d662b7b = PrivacyKey;\nprivacyKeyPhoneP2P#39491cc8 = PrivacyKey;\nprivacyKeyForwards#69ec56a3 = PrivacyKey;\nprivacyKeyProfilePhoto#96151fed = PrivacyKey;\nprivacyKeyPhoneNumber#d19ae46d = PrivacyKey;\nprivacyKeyAddedByPhone#42ffd42b = PrivacyKey;\nprivacyKeyVoiceMessages#697f414 = PrivacyKey;\nprivacyKeyAbout#a486b761 = PrivacyKey;\ninputPrivacyValueAllowContacts#d09e07b = InputPrivacyRule;\ninputPrivacyValueAllowAll#184b35ce = InputPrivacyRule;\ninputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;\ninputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;\ninputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;\ninputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;\ninputPrivacyValueAllowChatParticipants#840649cf chats:Vector<long> = InputPrivacyRule;\ninputPrivacyValueDisallowChatParticipants#e94f0f86 chats:Vector<long> = InputPrivacyRule;\ninputPrivacyValueAllowCloseFriends#2f453e49 = InputPrivacyRule;\nprivacyValueAllowContacts#fffe1bac = PrivacyRule;\nprivacyValueAllowAll#65427b82 = PrivacyRule;\nprivacyValueAllowUsers#b8905fb2 users:Vector<long> = PrivacyRule;\nprivacyValueDisallowContacts#f888fa1a = PrivacyRule;\nprivacyValueDisallowAll#8b73e763 = PrivacyRule;\nprivacyValueDisallowUsers#e4621141 users:Vector<long> = PrivacyRule;\nprivacyValueAllowChatParticipants#6b134e8e chats:Vector<long> = PrivacyRule;\nprivacyValueDisallowChatParticipants#41c87565 chats:Vector<long> = PrivacyRule;\nprivacyValueAllowCloseFriends#f7e8d89b = PrivacyRule;\naccount.privacyRules#50a04e45 rules:Vector<PrivacyRule> chats:Vector<Chat> users:Vector<User> = account.PrivacyRules;\naccountDaysTTL#b8d0afdf days:int = AccountDaysTTL;\ndocumentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;\ndocumentAttributeAnimated#11b58939 = DocumentAttribute;\ndocumentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;\ndocumentAttributeVideo#d38ff1c2 flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int = DocumentAttribute;\ndocumentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;\ndocumentAttributeFilename#15590068 file_name:string = DocumentAttribute;\ndocumentAttributeHasStickers#9801d2f7 = DocumentAttribute;\ndocumentAttributeCustomEmoji#fd149899 flags:# free:flags.0?true text_color:flags.1?true alt:string stickerset:InputStickerSet = DocumentAttribute;\nmessages.stickersNotModified#f1749a22 = messages.Stickers;\nmessages.stickers#30a6ec7e hash:long stickers:Vector<Document> = messages.Stickers;\nstickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;\nmessages.allStickersNotModified#e86602c3 = messages.AllStickers;\nmessages.allStickers#cdbbcebb hash:long sets:Vector<StickerSet> = messages.AllStickers;\nmessages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;\nwebPageEmpty#eb1477e8 id:long = WebPage;\nwebPagePending#c586da1c id:long date:int = WebPage;\nwebPage#e89c45b2 flags:# id:long url:string display_url:string hash:int type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document cached_page:flags.10?Page attributes:flags.12?Vector<WebPageAttribute> = WebPage;\nwebPageNotModified#7311ca11 flags:# cached_page_views:flags.0?int = WebPage;\nauthorization#ad01d61d flags:# current:flags.0?true official_app:flags.1?true password_pending:flags.2?true encrypted_requests_disabled:flags.3?true call_requests_disabled:flags.4?true unconfirmed:flags.5?true hash:long device_model:string platform:string system_version:string api_id:int app_name:string app_version:string date_created:int date_active:int ip:string country:string region:string = Authorization;\naccount.authorizations#4bff8ea0 authorization_ttl_days:int authorizations:Vector<Authorization> = account.Authorizations;\naccount.password#957b50fb flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes pending_reset_date:flags.5?int login_email_pattern:flags.6?string = account.Password;\naccount.passwordSettings#9a5c33e5 flags:# email:flags.0?string secure_settings:flags.1?SecureSecretSettings = account.PasswordSettings;\naccount.passwordInputSettings#c23727c9 flags:# new_algo:flags.0?PasswordKdfAlgo new_password_hash:flags.0?bytes hint:flags.0?string email:flags.1?string new_secure_settings:flags.2?SecureSecretSettings = account.PasswordInputSettings;\nauth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;\nreceivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;\nchatInviteExported#ab4a819 flags:# revoked:flags.0?true permanent:flags.5?true request_needed:flags.6?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int requested:flags.7?int title:flags.8?string = ExportedChatInvite;\nchatInvitePublicJoinRequests#ed107ab7 = ExportedChatInvite;\nchatInviteAlready#5a686d7c chat:Chat = ChatInvite;\nchatInvite#300c44c1 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true request_needed:flags.6?true verified:flags.7?true scam:flags.8?true fake:flags.9?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector<User> = ChatInvite;\nchatInvitePeek#61695cb0 chat:Chat expires:int = ChatInvite;\ninputStickerSetEmpty#ffb62b95 = InputStickerSet;\ninputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;\ninputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;\ninputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;\ninputStickerSetDice#e67f520e emoticon:string = InputStickerSet;\ninputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;\ninputStickerSetPremiumGifts#c88b3b02 = InputStickerSet;\ninputStickerSetEmojiGenericAnimations#4c4d4ce = InputStickerSet;\ninputStickerSetEmojiDefaultStatuses#29d0f5ee = InputStickerSet;\ninputStickerSetEmojiDefaultTopicIcons#44c1f8e9 = InputStickerSet;\nstickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true videos:flags.6?true emojis:flags.7?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int thumb_document_id:flags.8?long count:int hash:int = StickerSet;\nmessages.stickerSet#6e153f16 set:StickerSet packs:Vector<StickerPack> keywords:Vector<StickerKeyword> documents:Vector<Document> = messages.StickerSet;\nmessages.stickerSetNotModified#d3f924eb = messages.StickerSet;\nbotCommand#c27ac8c7 command:string description:string = BotCommand;\nbotInfo#8f300b57 flags:# user_id:flags.0?long description:flags.1?string description_photo:flags.4?Photo description_document:flags.5?Document commands:flags.2?Vector<BotCommand> menu_button:flags.3?BotMenuButton = BotInfo;\nkeyboardButton#a2fa4880 text:string = KeyboardButton;\nkeyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;\nkeyboardButtonCallback#35bbdb6b flags:# requires_password:flags.0?true text:string data:bytes = KeyboardButton;\nkeyboardButtonRequestPhone#b16a6c29 text:string = KeyboardButton;\nkeyboardButtonRequestGeoLocation#fc796b3f text:string = KeyboardButton;\nkeyboardButtonSwitchInline#93b9fbb5 flags:# same_peer:flags.0?true text:string query:string peer_types:flags.1?Vector<InlineQueryPeerType> = KeyboardButton;\nkeyboardButtonGame#50f41ccf text:string = KeyboardButton;\nkeyboardButtonBuy#afd93fbb text:string = KeyboardButton;\nkeyboardButtonUrlAuth#10b78d29 flags:# text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;\ninputKeyboardButtonUrlAuth#d02e7fd4 flags:# request_write_access:flags.0?true text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;\nkeyboardButtonRequestPoll#bbc7515d flags:# quiz:flags.0?Bool text:string = KeyboardButton;\ninputKeyboardButtonUserProfile#e988037b text:string user_id:InputUser = KeyboardButton;\nkeyboardButtonUserProfile#308660c1 text:string user_id:long = KeyboardButton;\nkeyboardButtonWebView#13767230 text:string url:string = KeyboardButton;\nkeyboardButtonSimpleWebView#a0c0505c text:string url:string = KeyboardButton;\nkeyboardButtonRequestPeer#d0b468c text:string button_id:int peer_type:RequestPeerType = KeyboardButton;\nkeyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;\nreplyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;\nreplyKeyboardForceReply#86b40b08 flags:# single_use:flags.1?true selective:flags.2?true placeholder:flags.3?string = ReplyMarkup;\nreplyKeyboardMarkup#85dd99d1 flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true persistent:flags.4?true rows:Vector<KeyboardButtonRow> placeholder:flags.3?string = ReplyMarkup;\nreplyInlineMarkup#48a30254 rows:Vector<KeyboardButtonRow> = ReplyMarkup;\nmessageEntityUnknown#bb92ba95 offset:int length:int = MessageEntity;\nmessageEntityMention#fa04579d offset:int length:int = MessageEntity;\nmessageEntityHashtag#6f635b0d offset:int length:int = MessageEntity;\nmessageEntityBotCommand#6cef8ac7 offset:int length:int = MessageEntity;\nmessageEntityUrl#6ed02538 offset:int length:int = MessageEntity;\nmessageEntityEmail#64e475c2 offset:int length:int = MessageEntity;\nmessageEntityBold#bd610bc9 offset:int length:int = MessageEntity;\nmessageEntityItalic#826f8b60 offset:int length:int = MessageEntity;\nmessageEntityCode#28a20571 offset:int length:int = MessageEntity;\nmessageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;\nmessageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;\nmessageEntityMentionName#dc7b1140 offset:int length:int user_id:long = MessageEntity;\ninputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;\nmessageEntityPhone#9b69e34b offset:int length:int = MessageEntity;\nmessageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;\nmessageEntityUnderline#9c4e7e8b offset:int length:int = MessageEntity;\nmessageEntityStrike#bf0693d4 offset:int length:int = MessageEntity;\nmessageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity;\nmessageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;\nmessageEntitySpoiler#32ca960f offset:int length:int = MessageEntity;\nmessageEntityCustomEmoji#c8cf05f8 offset:int length:int document_id:long = MessageEntity;\ninputChannelEmpty#ee8c1e86 = InputChannel;\ninputChannel#f35aec28 channel_id:long access_hash:long = InputChannel;\ninputChannelFromMessage#5b934f9d peer:InputPeer msg_id:int channel_id:long = InputChannel;\ncontacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector<Chat> users:Vector<User> = contacts.ResolvedPeer;\nmessageRange#ae30253 min_id:int max_id:int = MessageRange;\nupdates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;\nupdates.channelDifferenceTooLong#a4bcc6fe flags:# final:flags.0?true timeout:flags.1?int dialog:Dialog messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;\nupdates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;\nchannelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;\nchannelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter;\nchannelParticipant#c00c07c0 user_id:long date:int = ChannelParticipant;\nchannelParticipantSelf#35a8bfa7 flags:# via_request:flags.0?true user_id:long inviter_id:long date:int = ChannelParticipant;\nchannelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;\nchannelParticipantAdmin#34c3bb53 flags:# can_edit:flags.0?true self:flags.1?true user_id:long inviter_id:flags.1?long promoted_by:long date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;\nchannelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant;\nchannelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant;\nchannelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;\nchannelParticipantsAdmins#b4608969 = ChannelParticipantsFilter;\nchannelParticipantsKicked#a3b54985 q:string = ChannelParticipantsFilter;\nchannelParticipantsBots#b0d1865b = ChannelParticipantsFilter;\nchannelParticipantsBanned#1427a5e1 q:string = ChannelParticipantsFilter;\nchannelParticipantsSearch#656ac4b q:string = ChannelParticipantsFilter;\nchannelParticipantsContacts#bb6ae88d q:string = ChannelParticipantsFilter;\nchannelParticipantsMentions#e04b5ceb flags:# q:flags.0?string top_msg_id:flags.1?int = ChannelParticipantsFilter;\nchannels.channelParticipants#9ab0feaf count:int participants:Vector<ChannelParticipant> chats:Vector<Chat> users:Vector<User> = channels.ChannelParticipants;\nchannels.channelParticipantsNotModified#f0173fe9 = channels.ChannelParticipants;\nchannels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector<Chat> users:Vector<User> = channels.ChannelParticipant;\nhelp.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector<MessageEntity> min_age_confirm:flags.1?int = help.TermsOfService;\nmessages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;\nmessages.savedGifs#84a02a0d hash:long gifs:Vector<Document> = messages.SavedGifs;\ninputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaGeo#96929a85 flags:# geo_point:InputGeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaVenue#417bbf11 flags:# geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaContact#a6edbffd flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageGame#4b425864 flags:# reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageMediaInvoice#d7e78225 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineResult#88bf9319 flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?InputWebDocument content:flags.5?InputWebDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultPhoto#a8d864a7 id:string type:string photo:InputPhoto send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultDocument#fff8fdc4 flags:# id:string type:string title:flags.1?string description:flags.2?string document:InputDocument send_message:InputBotInlineMessage = InputBotInlineResult;\ninputBotInlineResultGame#4fa417f2 id:string short_name:string send_message:InputBotInlineMessage = InputBotInlineResult;\nbotInlineMessageMediaAuto#764cf810 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaGeo#51846fd flags:# geo:GeoPoint heading:flags.0?int period:flags.1?int proximity_notification_radius:flags.3?int reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaVenue#8a86659c flags:# geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaContact#18d1cdc2 flags:# phone_number:string first_name:string last_name:string vcard:string reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageMediaInvoice#354a9b09 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument currency:string total_amount:long reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineResult#11965f3a flags:# id:string type:string title:flags.1?string description:flags.2?string url:flags.3?string thumb:flags.4?WebDocument content:flags.5?WebDocument send_message:BotInlineMessage = BotInlineResult;\nbotInlineMediaResult#17db940b flags:# id:string type:string photo:flags.0?Photo document:flags.1?Document title:flags.2?string description:flags.3?string send_message:BotInlineMessage = BotInlineResult;\nmessages.botResults#e021f2f6 flags:# gallery:flags.0?true query_id:long next_offset:flags.1?string switch_pm:flags.2?InlineBotSwitchPM switch_webview:flags.3?InlineBotWebView results:Vector<BotInlineResult> cache_time:int users:Vector<User> = messages.BotResults;\nexportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;\nmessageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;\nauth.codeTypeSms#72a3158c = auth.CodeType;\nauth.codeTypeCall#741cd3e3 = auth.CodeType;\nauth.codeTypeFlashCall#226ccefb = auth.CodeType;\nauth.codeTypeMissedCall#d61ad6ee = auth.CodeType;\nauth.codeTypeFragmentSms#6ed998c = auth.CodeType;\nauth.sentCodeTypeApp#3dbb5986 length:int = auth.SentCodeType;\nauth.sentCodeTypeSms#c000bba2 length:int = auth.SentCodeType;\nauth.sentCodeTypeCall#5353e5a7 length:int = auth.SentCodeType;\nauth.sentCodeTypeFlashCall#ab03c6d9 pattern:string = auth.SentCodeType;\nauth.sentCodeTypeMissedCall#82006484 prefix:string length:int = auth.SentCodeType;\nauth.sentCodeTypeEmailCode#f450f59b flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true email_pattern:string length:int reset_available_period:flags.3?int reset_pending_date:flags.4?int = auth.SentCodeType;\nauth.sentCodeTypeSetUpEmailRequired#a5491dea flags:# apple_signin_allowed:flags.0?true google_signin_allowed:flags.1?true = auth.SentCodeType;\nauth.sentCodeTypeFragmentSms#d9565c39 url:string length:int = auth.SentCodeType;\nauth.sentCodeTypeFirebaseSms#e57b1432 flags:# nonce:flags.0?bytes receipt:flags.1?string push_timeout:flags.1?int length:int = auth.SentCodeType;\nmessages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?true native_ui:flags.4?true message:flags.0?string url:flags.2?string cache_time:int = messages.BotCallbackAnswer;\nmessages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;\ninputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;\ninputBotInlineMessageID64#b6d915d7 dc_id:int owner_id:long id:int access_hash:long = InputBotInlineMessageID;\ninlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;\nmessages.peerDialogs#3371c354 dialogs:Vector<Dialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> state:updates.State = messages.PeerDialogs;\ntopPeer#edcdc05b peer:Peer rating:double = TopPeer;\ntopPeerCategoryBotsPM#ab661b5b = TopPeerCategory;\ntopPeerCategoryBotsInline#148677e2 = TopPeerCategory;\ntopPeerCategoryCorrespondents#637b7ed = TopPeerCategory;\ntopPeerCategoryGroups#bd17a14a = TopPeerCategory;\ntopPeerCategoryChannels#161d9628 = TopPeerCategory;\ntopPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;\ntopPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;\ntopPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;\ntopPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<TopPeer> = TopPeerCategoryPeers;\ncontacts.topPeersNotModified#de266ef5 = contacts.TopPeers;\ncontacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector<Chat> users:Vector<User> = contacts.TopPeers;\ncontacts.topPeersDisabled#b52c939d = contacts.TopPeers;\ndraftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;\ndraftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector<MessageEntity> date:int = DraftMessage;\nmessages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;\nmessages.featuredStickers#be382906 flags:# premium:flags.0?true hash:long count:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers;\nmessages.recentStickersNotModified#b17f890 = messages.RecentStickers;\nmessages.recentStickers#88d37c56 hash:long packs:Vector<StickerPack> stickers:Vector<Document> dates:Vector<int> = messages.RecentStickers;\nmessages.archivedStickers#4fcba9c8 count:int sets:Vector<StickerSetCovered> = messages.ArchivedStickers;\nmessages.stickerSetInstallResultSuccess#38641628 = messages.StickerSetInstallResult;\nmessages.stickerSetInstallResultArchive#35e410a8 sets:Vector<StickerSetCovered> = messages.StickerSetInstallResult;\nstickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered;\nstickerSetMultiCovered#3407e51b set:StickerSet covers:Vector<Document> = StickerSetCovered;\nstickerSetFullCovered#40d13c0e set:StickerSet packs:Vector<StickerPack> keywords:Vector<StickerKeyword> documents:Vector<Document> = StickerSetCovered;\nstickerSetNoCovered#77b15d1c set:StickerSet = StickerSetCovered;\nmaskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords;\ninputStickeredMediaPhoto#4a992157 id:InputPhoto = InputStickeredMedia;\ninputStickeredMediaDocument#438865b id:InputDocument = InputStickeredMedia;\ngame#bdf9653b flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document = Game;\ninputGameID#32c3e77 id:long access_hash:long = InputGame;\ninputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;\nhighScore#73a379eb pos:int user_id:long score:int = HighScore;\nmessages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;\ntextEmpty#dc3d824f = RichText;\ntextPlain#744694e0 text:string = RichText;\ntextBold#6724abc4 text:RichText = RichText;\ntextItalic#d912a59c text:RichText = RichText;\ntextUnderline#c12622c4 text:RichText = RichText;\ntextStrike#9bf8bb95 text:RichText = RichText;\ntextFixed#6c3f19b9 text:RichText = RichText;\ntextUrl#3c2884c1 text:RichText url:string webpage_id:long = RichText;\ntextEmail#de5a0dd6 text:RichText email:string = RichText;\ntextConcat#7e6260d7 texts:Vector<RichText> = RichText;\ntextSubscript#ed6a8504 text:RichText = RichText;\ntextSuperscript#c7fb5e01 text:RichText = RichText;\ntextMarked#34b8621 text:RichText = RichText;\ntextPhone#1ccb966a text:RichText phone:string = RichText;\ntextImage#81ccf4f document_id:long w:int h:int = RichText;\ntextAnchor#35553762 text:RichText name:string = RichText;\npageBlockUnsupported#13567e8a = PageBlock;\npageBlockTitle#70abc3fd text:RichText = PageBlock;\npageBlockSubtitle#8ffa9a1f text:RichText = PageBlock;\npageBlockAuthorDate#baafe5e0 author:RichText published_date:int = PageBlock;\npageBlockHeader#bfd064ec text:RichText = PageBlock;\npageBlockSubheader#f12bb6e1 text:RichText = PageBlock;\npageBlockParagraph#467a0766 text:RichText = PageBlock;\npageBlockPreformatted#c070d93e text:RichText language:string = PageBlock;\npageBlockFooter#48870999 text:RichText = PageBlock;\npageBlockDivider#db20b188 = PageBlock;\npageBlockAnchor#ce0d37b0 name:string = PageBlock;\npageBlockList#e4e88011 items:Vector<PageListItem> = PageBlock;\npageBlockBlockquote#263d7c26 text:RichText caption:RichText = PageBlock;\npageBlockPullquote#4f4456d3 text:RichText caption:RichText = PageBlock;\npageBlockPhoto#1759c560 flags:# photo_id:long caption:PageCaption url:flags.0?string webpage_id:flags.0?long = PageBlock;\npageBlockVideo#7c8fe7b6 flags:# autoplay:flags.0?true loop:flags.1?true video_id:long caption:PageCaption = PageBlock;\npageBlockCover#39f23300 cover:PageBlock = PageBlock;\npageBlockEmbed#a8718dc5 flags:# full_width:flags.0?true allow_scrolling:flags.3?true url:flags.1?string html:flags.2?string poster_photo_id:flags.4?long w:flags.5?int h:flags.5?int caption:PageCaption = PageBlock;\npageBlockEmbedPost#f259a80b url:string webpage_id:long author_photo_id:long author:string date:int blocks:Vector<PageBlock> caption:PageCaption = PageBlock;\npageBlockCollage#65a0fa4d items:Vector<PageBlock> caption:PageCaption = PageBlock;\npageBlockSlideshow#31f9590 items:Vector<PageBlock> caption:PageCaption = PageBlock;\npageBlockChannel#ef1751b5 channel:Chat = PageBlock;\npageBlockAudio#804361ea audio_id:long caption:PageCaption = PageBlock;\npageBlockKicker#1e148390 text:RichText = PageBlock;\npageBlockTable#bf4dea82 flags:# bordered:flags.0?true striped:flags.1?true title:RichText rows:Vector<PageTableRow> = PageBlock;\npageBlockOrderedList#9a8ae1e1 items:Vector<PageListOrderedItem> = PageBlock;\npageBlockDetails#76768bed flags:# open:flags.0?true blocks:Vector<PageBlock> title:RichText = PageBlock;\npageBlockRelatedArticles#16115a96 title:RichText articles:Vector<PageRelatedArticle> = PageBlock;\npageBlockMap#a44f3ef6 geo:GeoPoint zoom:int w:int h:int caption:PageCaption = PageBlock;\nphoneCallDiscardReasonMissed#85e42301 = PhoneCallDiscardReason;\nphoneCallDiscardReasonDisconnect#e095c1a0 = PhoneCallDiscardReason;\nphoneCallDiscardReasonHangup#57adc690 = PhoneCallDiscardReason;\nphoneCallDiscardReasonBusy#faf7e8c9 = PhoneCallDiscardReason;\ndataJSON#7d748d04 data:string = DataJSON;\nlabeledPrice#cb296bf8 label:string amount:long = LabeledPrice;\ninvoice#5db95a15 flags:# test:flags.0?true name_requested:flags.1?true phone_requested:flags.2?true email_requested:flags.3?true shipping_address_requested:flags.4?true flexible:flags.5?true phone_to_provider:flags.6?true email_to_provider:flags.7?true recurring:flags.9?true currency:string prices:Vector<LabeledPrice> max_tip_amount:flags.8?long suggested_tip_amounts:flags.8?Vector<long> terms_url:flags.10?string = Invoice;\npaymentCharge#ea02c27e id:string provider_charge_id:string = PaymentCharge;\npostAddress#1e8caaeb street_line1:string street_line2:string city:string state:string country_iso2:string post_code:string = PostAddress;\npaymentRequestedInfo#909c3f94 flags:# name:flags.0?string phone:flags.1?string email:flags.2?string shipping_address:flags.3?PostAddress = PaymentRequestedInfo;\npaymentSavedCredentialsCard#cdc27a1f id:string title:string = PaymentSavedCredentials;\nwebDocument#1c570ed1 url:string access_hash:long size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;\nwebDocumentNoProxy#f9c8bcc6 url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = WebDocument;\ninputWebDocument#9bed434d url:string size:int mime_type:string attributes:Vector<DocumentAttribute> = InputWebDocument;\ninputWebFileLocation#c239d686 url:string access_hash:long = InputWebFileLocation;\ninputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w:int h:int zoom:int scale:int = InputWebFileLocation;\ninputWebFileAudioAlbumThumbLocation#f46fe924 flags:# small:flags.2?true document:flags.0?InputDocument title:flags.1?string performer:flags.1?string = InputWebFileLocation;\nupload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;\npayments.paymentForm#a0058751 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON additional_methods:flags.6?Vector<PaymentFormMethod> saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?Vector<PaymentSavedCredentials> users:Vector<User> = payments.PaymentForm;\npayments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo;\npayments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;\npayments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;\npayments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;\npayments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;\ninputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;\ninputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;\ninputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;\naccount.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;\nshippingOption#b6213cdf id:string title:string prices:Vector<LabeledPrice> = ShippingOption;\ninputStickerSetItem#32da9e9c flags:# document:InputDocument emoji:string mask_coords:flags.0?MaskCoords keywords:flags.1?string = InputStickerSetItem;\ninputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;\nphoneCallEmpty#5366c915 id:long = PhoneCall;\nphoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;\nphoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall;\nphoneCall#967f7c67 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int = PhoneCall;\nphoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;\nphoneConnection#9cc123c7 flags:# tcp:flags.0?true id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;\nphoneConnectionWebrtc#635fe375 flags:# turn:flags.0?true stun:flags.1?true id:long ip:string ipv6:string port:int username:string password:string = PhoneConnection;\nphoneCallProtocol#fc878fc8 flags:# udp_p2p:flags.0?true udp_reflector:flags.1?true min_layer:int max_layer:int library_versions:Vector<string> = PhoneCallProtocol;\nphone.phoneCall#ec82e140 phone_call:PhoneCall users:Vector<User> = phone.PhoneCall;\nupload.cdnFileReuploadNeeded#eea8e46e request_token:bytes = upload.CdnFile;\nupload.cdnFile#a99fca4f bytes:bytes = upload.CdnFile;\ncdnPublicKey#c982eaba dc_id:int public_key:string = CdnPublicKey;\ncdnConfig#5725e40a public_keys:Vector<CdnPublicKey> = CdnConfig;\nlangPackString#cad181f6 key:string value:string = LangPackString;\nlangPackStringPluralized#6c47ac9f flags:# key:string zero_value:flags.0?string one_value:flags.1?string two_value:flags.2?string few_value:flags.3?string many_value:flags.4?string other_value:string = LangPackString;\nlangPackStringDeleted#2979eeb2 key:string = LangPackString;\nlangPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector<LangPackString> = LangPackDifference;\nlangPackLanguage#eeca5ce3 flags:# official:flags.0?true rtl:flags.2?true beta:flags.3?true name:string native_name:string lang_code:string base_lang_code:flags.1?string plural_code:string strings_count:int translated_count:int translations_url:string = LangPackLanguage;\nchannelAdminLogEventActionChangeTitle#e6dfb825 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeAbout#55188a2e prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeUsername#6a4afc38 prev_value:string new_value:string = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangePhoto#434bd2af prev_photo:Photo new_photo:Photo = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleInvites#1b7907ae new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSignatures#26ae0971 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionUpdatePinned#e9e82c18 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionEditMessage#709b2405 prev_message:Message new_message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDeleteMessage#42e047bb message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoin#183040d3 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantLeave#f89777f2 = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantInvite#e31c34d8 participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleBan#e6d83d7e prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantToggleAdmin#d5676710 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\nchannelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLinkedChat#50c7ac8 prev_value:long new_value:long = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoinByInvite#fe9fc158 flags:# via_chatlist:flags.0?true invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantJoinByRequest#afb6144a invite:ExportedChatInvite approved_by:long = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleNoForwards#cb2ac766 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionSendMessage#278f2868 message:Message = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeAvailableReactions#be4e0ef8 prev_value:ChatReactions new_value:ChatReactions = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeUsernames#f04fb3a9 prev_value:Vector<string> new_value:Vector<string> = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleForum#2cc6383 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionCreateTopic#58707d28 topic:ForumTopic = ChannelAdminLogEventAction;\nchannelAdminLogEventActionEditTopic#f06fe208 prev_topic:ForumTopic new_topic:ForumTopic = ChannelAdminLogEventAction;\nchannelAdminLogEventActionDeleteTopic#ae168909 topic:ForumTopic = ChannelAdminLogEventAction;\nchannelAdminLogEventActionPinTopic#5d8d353b flags:# prev_topic:flags.0?ForumTopic new_topic:flags.1?ForumTopic = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleAntiSpam#64f36dfc new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;\nchannels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;\nchannelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true send:flags.16?true forums:flags.17?true = ChannelAdminLogEventsFilter;\npopularContact#5ce14175 client_id:long importers:int = PopularContact;\nmessages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;\nmessages.favedStickers#2cb51097 hash:long packs:Vector<StickerPack> stickers:Vector<Document> = messages.FavedStickers;\nrecentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;\nrecentMeUrlUser#b92c09e2 url:string user_id:long = RecentMeUrl;\nrecentMeUrlChat#b2da71d2 url:string chat_id:long = RecentMeUrl;\nrecentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;\nrecentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;\nhelp.recentMeUrls#e0310d7 urls:Vector<RecentMeUrl> chats:Vector<Chat> users:Vector<User> = help.RecentMeUrls;\ninputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector<MessageEntity> = InputSingleMedia;\nwebAuthorization#a6f8f452 hash:long bot_id:long domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;\naccount.webAuthorizations#ed56c9fc authorizations:Vector<WebAuthorization> users:Vector<User> = account.WebAuthorizations;\ninputMessageID#a676a322 id:int = InputMessage;\ninputMessageReplyTo#bad88395 id:int = InputMessage;\ninputMessagePinned#86872538 = InputMessage;\ninputMessageCallbackQuery#acfa1a7e id:int query_id:long = InputMessage;\ninputDialogPeer#fcaafeb7 peer:InputPeer = InputDialogPeer;\ninputDialogPeerFolder#64600527 folder_id:int = InputDialogPeer;\ndialogPeer#e56dbf05 peer:Peer = DialogPeer;\ndialogPeerFolder#514519e2 folder_id:int = DialogPeer;\nmessages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;\nmessages.foundStickerSets#8af09dd2 hash:long sets:Vector<StickerSetCovered> = messages.FoundStickerSets;\nfileHash#f39b035c offset:long limit:int hash:bytes = FileHash;\ninputClientProxy#75588b3f address:string port:int = InputClientProxy;\nhelp.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate;\nhelp.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate;\ninputSecureFileUploaded#3334b0f0 id:long parts:int md5_checksum:string file_hash:bytes secret:bytes = InputSecureFile;\ninputSecureFile#5367e5be id:long access_hash:long = InputSecureFile;\nsecureFileEmpty#64199744 = SecureFile;\nsecureFile#7d09c27e id:long access_hash:long size:long dc_id:int date:int file_hash:bytes secret:bytes = SecureFile;\nsecureData#8aeabec3 data:bytes data_hash:bytes secret:bytes = SecureData;\nsecurePlainPhone#7d6099dd phone:string = SecurePlainData;\nsecurePlainEmail#21ec5a5f email:string = SecurePlainData;\nsecureValueTypePersonalDetails#9d2a81e3 = SecureValueType;\nsecureValueTypePassport#3dac6a00 = SecureValueType;\nsecureValueTypeDriverLicense#6e425c4 = SecureValueType;\nsecureValueTypeIdentityCard#a0d0744b = SecureValueType;\nsecureValueTypeInternalPassport#99a48f23 = SecureValueType;\nsecureValueTypeAddress#cbe31e26 = SecureValueType;\nsecureValueTypeUtilityBill#fc36954e = SecureValueType;\nsecureValueTypeBankStatement#89137c0d = SecureValueType;\nsecureValueTypeRentalAgreement#8b883488 = SecureValueType;\nsecureValueTypePassportRegistration#99e3806a = SecureValueType;\nsecureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType;\nsecureValueTypePhone#b320aadb = SecureValueType;\nsecureValueTypeEmail#8e3ca7ee = SecureValueType;\nsecureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector<SecureFile> files:flags.4?Vector<SecureFile> plain_data:flags.5?SecurePlainData hash:bytes = SecureValue;\ninputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector<InputSecureFile> files:flags.4?Vector<InputSecureFile> plain_data:flags.5?SecurePlainData = InputSecureValue;\nsecureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash;\nsecureValueErrorData#e8a40bd9 type:SecureValueType data_hash:bytes field:string text:string = SecureValueError;\nsecureValueErrorFrontSide#be3dfa type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorReverseSide#868a2aa5 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorSelfie#e537ced6 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;\nsecureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFile#a1144770 type:SecureValueType file_hash:bytes text:string = SecureValueError;\nsecureValueErrorTranslationFiles#34636dd8 type:SecureValueType file_hash:Vector<bytes> text:string = SecureValueError;\nsecureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted;\naccount.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;\naccount.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode;\nhelp.deepLinkInfoEmpty#66afa166 = help.DeepLinkInfo;\nhelp.deepLinkInfo#6a4ee832 flags:# update_app:flags.0?true message:string entities:flags.1?Vector<MessageEntity> = help.DeepLinkInfo;\nsavedPhoneContact#1142bd56 phone:string first_name:string last_name:string date:int = SavedContact;\naccount.takeout#4dba4501 id:long = account.Takeout;\npasswordKdfAlgoUnknown#d45ab096 = PasswordKdfAlgo;\npasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow#3a912d4a salt1:bytes salt2:bytes g:int p:bytes = PasswordKdfAlgo;\nsecurePasswordKdfAlgoUnknown#4a8537 = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoPBKDF2HMACSHA512iter100000#bbf2dda0 salt:bytes = SecurePasswordKdfAlgo;\nsecurePasswordKdfAlgoSHA512#86471d92 salt:bytes = SecurePasswordKdfAlgo;\nsecureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:bytes secure_secret_id:long = SecureSecretSettings;\ninputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP;\ninputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP;\nsecureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType;\nsecureRequiredTypeOneOf#27477b4 types:Vector<SecureRequiredType> = SecureRequiredType;\nhelp.passportConfigNotModified#bfb9f457 = help.PassportConfig;\nhelp.passportConfig#a098d6af hash:int countries_langs:DataJSON = help.PassportConfig;\ninputAppEvent#1d1b1245 time:double type:string peer:long data:JSONValue = InputAppEvent;\njsonObjectValue#c0de1bd9 key:string value:JSONValue = JSONObjectValue;\njsonNull#3f6d7b68 = JSONValue;\njsonBool#c7345e6a value:Bool = JSONValue;\njsonNumber#2be0dfa4 value:double = JSONValue;\njsonString#b71e767a value:string = JSONValue;\njsonArray#f7444763 value:Vector<JSONValue> = JSONValue;\njsonObject#99c1d49d value:Vector<JSONObjectValue> = JSONValue;\npageTableCell#34566b6a flags:# header:flags.0?true align_center:flags.3?true align_right:flags.4?true valign_middle:flags.5?true valign_bottom:flags.6?true text:flags.7?RichText colspan:flags.1?int rowspan:flags.2?int = PageTableCell;\npageTableRow#e0c0c5e5 cells:Vector<PageTableCell> = PageTableRow;\npageCaption#6f747657 text:RichText credit:RichText = PageCaption;\npageListItemText#b92fb6cd text:RichText = PageListItem;\npageListItemBlocks#25e073fc blocks:Vector<PageBlock> = PageListItem;\npageListOrderedItemText#5e068047 num:string text:RichText = PageListOrderedItem;\npageListOrderedItemBlocks#98dd8936 num:string blocks:Vector<PageBlock> = PageListOrderedItem;\npageRelatedArticle#b390dc08 flags:# url:string webpage_id:long title:flags.0?string description:flags.1?string photo_id:flags.2?long author:flags.3?string published_date:flags.4?int = PageRelatedArticle;\npage#98657f0d flags:# part:flags.0?true rtl:flags.1?true v2:flags.2?true url:string blocks:Vector<PageBlock> photos:Vector<Photo> documents:Vector<Document> views:flags.3?int = Page;\nhelp.supportName#8c05f1c9 name:string = help.SupportName;\nhelp.userInfoEmpty#f3ae2eed = help.UserInfo;\nhelp.userInfo#1eb3758 message:string entities:Vector<MessageEntity> author:string date:int = help.UserInfo;\npollAnswer#6ca9c2e9 text:string option:bytes = PollAnswer;\npoll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true question:string answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int = Poll;\npollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;\npollResults#7adf2420 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<Peer> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;\nchatOnlines#f041e250 onlines:int = ChatOnlines;\nstatsURL#47a971e0 url:string = StatsURL;\nchatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true manage_topics:flags.13?true post_stories:flags.14?true edit_stories:flags.15?true delete_stories:flags.16?true = ChatAdminRights;\nchatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true manage_topics:flags.18?true send_photos:flags.19?true send_videos:flags.20?true send_roundvideos:flags.21?true send_audios:flags.22?true send_voices:flags.23?true send_docs:flags.24?true send_plain:flags.25?true until_date:int = ChatBannedRights;\ninputWallPaper#e630b979 id:long access_hash:long = InputWallPaper;\ninputWallPaperSlug#72091c80 slug:string = InputWallPaper;\ninputWallPaperNoFile#967a462e id:long = InputWallPaper;\naccount.wallPapersNotModified#1c199183 = account.WallPapers;\naccount.wallPapers#cdc3858c hash:long wallpapers:Vector<WallPaper> = account.WallPapers;\ncodeSettings#ad253d78 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true allow_missed_call:flags.5?true allow_firebase:flags.7?true logout_tokens:flags.6?Vector<bytes> token:flags.8?string app_sandbox:flags.8?Bool = CodeSettings;\nwallPaperSettings#1dc1bca4 flags:# blur:flags.1?true motion:flags.2?true background_color:flags.0?int second_background_color:flags.4?int third_background_color:flags.5?int fourth_background_color:flags.6?int intensity:flags.3?int rotation:flags.4?int = WallPaperSettings;\nautoDownloadSettings#baa57628 flags:# disabled:flags.0?true video_preload_large:flags.1?true audio_preload_next:flags.2?true phonecalls_less_data:flags.3?true stories_preload:flags.4?true photo_size_max:int video_size_max:long file_size_max:long video_upload_maxbitrate:int small_queue_active_operations_max:int large_queue_active_operations_max:int = AutoDownloadSettings;\naccount.autoDownloadSettings#63cacf26 low:AutoDownloadSettings medium:AutoDownloadSettings high:AutoDownloadSettings = account.AutoDownloadSettings;\nemojiKeyword#d5b3b9f9 keyword:string emoticons:Vector<string> = EmojiKeyword;\nemojiKeywordDeleted#236df622 keyword:string emoticons:Vector<string> = EmojiKeyword;\nemojiKeywordsDifference#5cc761bd lang_code:string from_version:int version:int keywords:Vector<EmojiKeyword> = EmojiKeywordsDifference;\nemojiURL#a575739d url:string = EmojiURL;\nemojiLanguage#b3fb5361 lang_code:string = EmojiLanguage;\nfolder#ff544e65 flags:# autofill_new_broadcasts:flags.0?true autofill_public_groups:flags.1?true autofill_new_correspondents:flags.2?true id:int title:string photo:flags.3?ChatPhoto = Folder;\ninputFolderPeer#fbd2c296 peer:InputPeer folder_id:int = InputFolderPeer;\nfolderPeer#e9baa668 peer:Peer folder_id:int = FolderPeer;\nmessages.searchCounter#e844ebff flags:# inexact:flags.1?true filter:MessagesFilter count:int = messages.SearchCounter;\nurlAuthResultRequest#92d33a0e flags:# request_write_access:flags.0?true bot:User domain:string = UrlAuthResult;\nurlAuthResultAccepted#8f8c0e4e url:string = UrlAuthResult;\nurlAuthResultDefault#a9d6db1f = UrlAuthResult;\nchannelLocationEmpty#bfb5ad8b = ChannelLocation;\nchannelLocation#209b82db geo_point:GeoPoint address:string = ChannelLocation;\npeerLocated#ca461b5d peer:Peer expires:int distance:int = PeerLocated;\npeerSelfLocated#f8ec284b expires:int = PeerLocated;\nrestrictionReason#d072acb4 platform:string reason:string text:string = RestrictionReason;\ninputTheme#3c5693e9 id:long access_hash:long = InputTheme;\ninputThemeSlug#f5890df1 slug:string = InputTheme;\ntheme#a00e67d6 flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?Vector<ThemeSettings> emoticon:flags.6?string installs_count:flags.4?int = Theme;\naccount.themesNotModified#f41eb622 = account.Themes;\naccount.themes#9a3d8c6d hash:long themes:Vector<Theme> = account.Themes;\nauth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;\nauth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;\nauth.loginTokenSuccess#390d5c5e authorization:auth.Authorization = auth.LoginToken;\naccount.contentSettings#57e28221 flags:# sensitive_enabled:flags.0?true sensitive_can_change:flags.1?true = account.ContentSettings;\nmessages.inactiveChats#a927fec5 dates:Vector<int> chats:Vector<Chat> users:Vector<User> = messages.InactiveChats;\nbaseThemeClassic#c3a12462 = BaseTheme;\nbaseThemeDay#fbd81688 = BaseTheme;\nbaseThemeNight#b7b31ea8 = BaseTheme;\nbaseThemeTinted#6d5f77ee = BaseTheme;\nbaseThemeArctic#5b11125a = BaseTheme;\ninputThemeSettings#8fde504f flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;\nthemeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?WallPaper = ThemeSettings;\nwebPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector<Document> settings:flags.1?ThemeSettings = WebPageAttribute;\nwebPageAttributeStory#2e94c3e7 flags:# peer:Peer id:int story:flags.0?StoryItem = WebPageAttribute;\nmessages.votesList#4899484e flags:# count:int votes:Vector<MessagePeerVote> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.VotesList;\nbankCardOpenUrl#f568028a url:string name:string = BankCardOpenUrl;\npayments.bankCardData#3e24e573 title:string open_urls:Vector<BankCardOpenUrl> = payments.BankCardData;\ndialogFilter#7438f7e8 flags:# contacts:flags.0?true non_contacts:flags.1?true groups:flags.2?true broadcasts:flags.3?true bots:flags.4?true exclude_muted:flags.11?true exclude_read:flags.12?true exclude_archived:flags.13?true id:int title:string emoticon:flags.25?string pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> exclude_peers:Vector<InputPeer> = DialogFilter;\ndialogFilterDefault#363293ae = DialogFilter;\ndialogFilterChatlist#d64a04a8 flags:# has_my_invites:flags.26?true id:int title:string emoticon:flags.25?string pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> = DialogFilter;\ndialogFilterSuggested#77744d4a filter:DialogFilter description:string = DialogFilterSuggested;\nstatsDateRangeDays#b637edaf min_date:int max_date:int = StatsDateRangeDays;\nstatsAbsValueAndPrev#cb43acde current:double previous:double = StatsAbsValueAndPrev;\nstatsPercentValue#cbce2fe0 part:double total:double = StatsPercentValue;\nstatsGraphAsync#4a27eb2d token:string = StatsGraph;\nstatsGraphError#bedc9822 error:string = StatsGraph;\nstatsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph;\nmessageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageInteractionCounters;\nstats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph recent_message_interactions:Vector<MessageInteractionCounters> = stats.BroadcastStats;\nhelp.promoDataEmpty#98f6ac75 expires:int = help.PromoData;\nhelp.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector<Chat> users:Vector<User> psa_type:flags.1?string psa_message:flags.2?string = help.PromoData;\nvideoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;\nvideoSizeEmojiMarkup#f85c413c emoji_id:long background_colors:Vector<int> = VideoSize;\nvideoSizeStickerMarkup#da082fe stickerset:InputStickerSet sticker_id:long background_colors:Vector<int> = VideoSize;\nstatsGroupTopPoster#9d04af9b user_id:long messages:int avg_chars:int = StatsGroupTopPoster;\nstatsGroupTopAdmin#d7584c87 user_id:long deleted:int kicked:int banned:int = StatsGroupTopAdmin;\nstatsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInviter;\nstats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector<StatsGroupTopPoster> top_admins:Vector<StatsGroupTopAdmin> top_inviters:Vector<StatsGroupTopInviter> users:Vector<User> = stats.MegagroupStats;\nglobalPrivacySettings#734c4ccb flags:# archive_and_mute_new_noncontact_peers:flags.0?true keep_archived_unmuted:flags.1?true keep_archived_folders:flags.2?true = GlobalPrivacySettings;\nhelp.countryCode#4203c5ef flags:# country_code:string prefixes:flags.0?Vector<string> patterns:flags.1?Vector<string> = help.CountryCode;\nhelp.country#c3878e23 flags:# hidden:flags.0?true iso2:string default_name:string name:flags.1?string country_codes:Vector<help.CountryCode> = help.Country;\nhelp.countriesListNotModified#93cc1f32 = help.CountriesList;\nhelp.countriesList#87d0759e countries:Vector<help.Country> hash:int = help.CountriesList;\nmessageViews#455b853d flags:# views:flags.0?int forwards:flags.1?int replies:flags.2?MessageReplies = MessageViews;\nmessages.messageViews#b6c4f543 views:Vector<MessageViews> chats:Vector<Chat> users:Vector<User> = messages.MessageViews;\nmessages.discussionMessage#a6341782 flags:# messages:Vector<Message> max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector<Chat> users:Vector<User> = messages.DiscussionMessage;\nmessageReplyHeader#a6d57763 flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;\nmessageReplyStoryHeader#9c98bfc1 user_id:long story_id:int = MessageReplyHeader;\nmessageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;\npeerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;\nstats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;\ngroupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;\ngroupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;\ninputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;\ngroupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;\nphone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;\nphone.groupParticipants#f47751b6 count:int participants:Vector<GroupCallParticipant> next_offset:string chats:Vector<Chat> users:Vector<User> version:int = phone.GroupParticipants;\ninlineQueryPeerTypeSameBotPM#3081ed9d = InlineQueryPeerType;\ninlineQueryPeerTypePM#833c0fac = InlineQueryPeerType;\ninlineQueryPeerTypeChat#d766c50a = InlineQueryPeerType;\ninlineQueryPeerTypeMegagroup#5ec4be43 = InlineQueryPeerType;\ninlineQueryPeerTypeBroadcast#6334ee9a = InlineQueryPeerType;\ninlineQueryPeerTypeBotPM#e3b2d0c = InlineQueryPeerType;\nmessages.historyImport#1662af0b id:long = messages.HistoryImport;\nmessages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true title:flags.2?string = messages.HistoryImportParsed;\nmessages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector<int> = messages.AffectedFoundMessages;\nchatInviteImporter#8c5adfd9 flags:# requested:flags.0?true via_chatlist:flags.3?true user_id:long date:int about:flags.2?string approved_by:flags.1?long = ChatInviteImporter;\nmessages.exportedChatInvites#bdc62dcc count:int invites:Vector<ExportedChatInvite> users:Vector<User> = messages.ExportedChatInvites;\nmessages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector<User> = messages.ExportedChatInvite;\nmessages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector<User> = messages.ExportedChatInvite;\nmessages.chatInviteImporters#81b6b00a count:int importers:Vector<ChatInviteImporter> users:Vector<User> = messages.ChatInviteImporters;\nchatAdminWithInvites#f2ecef23 admin_id:long invites_count:int revoked_invites_count:int = ChatAdminWithInvites;\nmessages.chatAdminsWithInvites#b69b72d7 admins:Vector<ChatAdminWithInvites> users:Vector<User> = messages.ChatAdminsWithInvites;\nmessages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer;\nphone.joinAsPeers#afe5623f peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = phone.JoinAsPeers;\nphone.exportedGroupCallInvite#204bd158 link:string = phone.ExportedGroupCallInvite;\ngroupCallParticipantVideoSourceGroup#dcb118b7 semantics:string sources:Vector<int> = GroupCallParticipantVideoSourceGroup;\ngroupCallParticipantVideo#67753ac8 flags:# paused:flags.0?true endpoint:string source_groups:Vector<GroupCallParticipantVideoSourceGroup> audio_source:flags.1?int = GroupCallParticipantVideo;\nstickers.suggestedShortName#85fea03f short_name:string = stickers.SuggestedShortName;\nbotCommandScopeDefault#2f6cb2ab = BotCommandScope;\nbotCommandScopeUsers#3c4f04d8 = BotCommandScope;\nbotCommandScopeChats#6fe1a881 = BotCommandScope;\nbotCommandScopeChatAdmins#b9aa606a = BotCommandScope;\nbotCommandScopePeer#db9d897d peer:InputPeer = BotCommandScope;\nbotCommandScopePeerAdmins#3fd863d1 peer:InputPeer = BotCommandScope;\nbotCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandScope;\naccount.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult;\naccount.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult;\naccount.resetPasswordOk#e926d63e = account.ResetPasswordResult;\nsponsoredMessage#daafff6b flags:# recommended:flags.5?true show_peer_photo:flags.6?true random_id:bytes from_id:flags.3?Peer chat_invite:flags.4?ChatInvite chat_invite_hash:flags.4?string channel_post:flags.2?int start_param:flags.0?string webpage:flags.9?SponsoredWebPage message:string entities:flags.1?Vector<MessageEntity> sponsor_info:flags.7?string additional_info:flags.8?string = SponsoredMessage;\nmessages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?int messages:Vector<SponsoredMessage> chats:Vector<Chat> users:Vector<User> = messages.SponsoredMessages;\nmessages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages;\nsearchResultsCalendarPeriod#c9b0539f date:int min_msg_id:int max_msg_id:int count:int = SearchResultsCalendarPeriod;\nmessages.searchResultsCalendar#147ee23c flags:# inexact:flags.0?true count:int min_date:int min_msg_id:int offset_id_offset:flags.1?int periods:Vector<SearchResultsCalendarPeriod> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SearchResultsCalendar;\nsearchResultPosition#7f648b67 msg_id:int date:int offset:int = SearchResultsPosition;\nmessages.searchResultsPositions#53b22baf count:int positions:Vector<SearchResultsPosition> = messages.SearchResultsPositions;\nchannels.sendAsPeers#f496b0c6 peers:Vector<SendAsPeer> chats:Vector<Chat> users:Vector<User> = channels.SendAsPeers;\nusers.userFull#3b6d152e full_user:UserFull chats:Vector<Chat> users:Vector<User> = users.UserFull;\nmessages.peerSettings#6880b94d settings:PeerSettings chats:Vector<Chat> users:Vector<User> = messages.PeerSettings;\nauth.loggedOut#c3a2835f flags:# future_auth_token:flags.0?bytes = auth.LoggedOut;\nreactionCount#a3d1cb80 flags:# chosen_order:flags.0?int reaction:Reaction count:int = ReactionCount;\nmessageReactions#4f2b9479 flags:# min:flags.0?true can_see_list:flags.2?true results:Vector<ReactionCount> recent_reactions:flags.1?Vector<MessagePeerReaction> = MessageReactions;\nmessages.messageReactionsList#31bd492d flags:# count:int reactions:Vector<MessagePeerReaction> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = messages.MessageReactionsList;\navailableReaction#c077ec01 flags:# inactive:flags.0?true premium:flags.2?true reaction:string title:string static_icon:Document appear_animation:Document select_animation:Document activate_animation:Document effect_animation:Document around_animation:flags.1?Document center_icon:flags.1?Document = AvailableReaction;\nmessages.availableReactionsNotModified#9f071957 = messages.AvailableReactions;\nmessages.availableReactions#768e3aad hash:int reactions:Vector<AvailableReaction> = messages.AvailableReactions;\nmessagePeerReaction#8c79b63c flags:# big:flags.0?true unread:flags.1?true my:flags.2?true peer_id:Peer date:int reaction:Reaction = MessagePeerReaction;\ngroupCallStreamChannel#80eb48af channel:int scale:int last_timestamp_ms:long = GroupCallStreamChannel;\nphone.groupCallStreamChannels#d0e482b2 channels:Vector<GroupCallStreamChannel> = phone.GroupCallStreamChannels;\nphone.groupCallStreamRtmpUrl#2dbf3432 url:string key:string = phone.GroupCallStreamRtmpUrl;\nattachMenuBotIconColor#4576f3f0 name:string color:int = AttachMenuBotIconColor;\nattachMenuBotIcon#b2a7386b flags:# name:string icon:Document colors:flags.0?Vector<AttachMenuBotIconColor> = AttachMenuBotIcon;\nattachMenuBot#d90d8dfe flags:# inactive:flags.0?true has_settings:flags.1?true request_write_access:flags.2?true show_in_attach_menu:flags.3?true show_in_side_menu:flags.4?true side_menu_disclaimer_needed:flags.5?true bot_id:long short_name:string peer_types:flags.3?Vector<AttachMenuPeerType> icons:Vector<AttachMenuBotIcon> = AttachMenuBot;\nattachMenuBotsNotModified#f1d88a5c = AttachMenuBots;\nattachMenuBots#3c4301c0 hash:long bots:Vector<AttachMenuBot> users:Vector<User> = AttachMenuBots;\nattachMenuBotsBot#93bf667f bot:AttachMenuBot users:Vector<User> = AttachMenuBotsBot;\nwebViewResultUrl#c14557c query_id:long url:string = WebViewResult;\nsimpleWebViewResultUrl#882f76bb url:string = SimpleWebViewResult;\nwebViewMessageSent#c94511c flags:# msg_id:flags.0?InputBotInlineMessageID = WebViewMessageSent;\nbotMenuButtonDefault#7533a588 = BotMenuButton;\nbotMenuButtonCommands#4258c205 = BotMenuButton;\nbotMenuButton#c7b57ce6 text:string url:string = BotMenuButton;\naccount.savedRingtonesNotModified#fbf6e8b1 = account.SavedRingtones;\naccount.savedRingtones#c1e92cc5 hash:long ringtones:Vector<Document> = account.SavedRingtones;\nnotificationSoundDefault#97e8bebe = NotificationSound;\nnotificationSoundNone#6f0c34df = NotificationSound;\nnotificationSoundLocal#830b9ae4 title:string data:string = NotificationSound;\nnotificationSoundRingtone#ff6c8049 id:long = NotificationSound;\naccount.savedRingtone#b7263f6d = account.SavedRingtone;\naccount.savedRingtoneConverted#1f307eb7 document:Document = account.SavedRingtone;\nattachMenuPeerTypeSameBotPM#7d6be90e = AttachMenuPeerType;\nattachMenuPeerTypeBotPM#c32bfa1a = AttachMenuPeerType;\nattachMenuPeerTypePM#f146d31f = AttachMenuPeerType;\nattachMenuPeerTypeChat#509113f = AttachMenuPeerType;\nattachMenuPeerTypeBroadcast#7bfbdefc = AttachMenuPeerType;\ninputInvoiceMessage#c5b56859 peer:InputPeer msg_id:int = InputInvoice;\ninputInvoiceSlug#c326caef slug:string = InputInvoice;\npayments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;\nmessages.transcribedAudio#93752c52 flags:# pending:flags.0?true transcription_id:long text:string = messages.TranscribedAudio;\nhelp.premiumPromo#5334759c status_text:string status_entities:Vector<MessageEntity> video_sections:Vector<string> videos:Vector<Document> period_options:Vector<PremiumSubscriptionOption> users:Vector<User> = help.PremiumPromo;\ninputStorePaymentPremiumSubscription#a6751e66 flags:# restore:flags.0?true upgrade:flags.1?true = InputStorePaymentPurpose;\ninputStorePaymentGiftPremium#616f7fe8 user_id:InputUser currency:string amount:long = InputStorePaymentPurpose;\npremiumGiftOption#74c34319 flags:# months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumGiftOption;\npaymentFormMethod#88f8f21b url:string title:string = PaymentFormMethod;\nemojiStatusEmpty#2de11aae = EmojiStatus;\nemojiStatus#929b619d document_id:long = EmojiStatus;\nemojiStatusUntil#fa30a8c7 document_id:long until:int = EmojiStatus;\naccount.emojiStatusesNotModified#d08ce645 = account.EmojiStatuses;\naccount.emojiStatuses#90c467d1 hash:long statuses:Vector<EmojiStatus> = account.EmojiStatuses;\nreactionEmpty#79f5d419 = Reaction;\nreactionEmoji#1b2286b8 emoticon:string = Reaction;\nreactionCustomEmoji#8935fc73 document_id:long = Reaction;\nchatReactionsNone#eafc32bc = ChatReactions;\nchatReactionsAll#52928bca flags:# allow_custom:flags.0?true = ChatReactions;\nchatReactionsSome#661d4037 reactions:Vector<Reaction> = ChatReactions;\nmessages.reactionsNotModified#b06fdbdf = messages.Reactions;\nmessages.reactions#eafdf716 hash:long reactions:Vector<Reaction> = messages.Reactions;\nemailVerifyPurposeLoginSetup#4345be73 phone_number:string phone_code_hash:string = EmailVerifyPurpose;\nemailVerifyPurposeLoginChange#527d22eb = EmailVerifyPurpose;\nemailVerifyPurposePassport#bbf51685 = EmailVerifyPurpose;\nemailVerificationCode#922e55a9 code:string = EmailVerification;\nemailVerificationGoogle#db909ec2 token:string = EmailVerification;\nemailVerificationApple#96d074fd token:string = EmailVerification;\naccount.emailVerified#2b96cd1b email:string = account.EmailVerified;\naccount.emailVerifiedLogin#e1bb0d61 email:string sent_code:auth.SentCode = account.EmailVerified;\npremiumSubscriptionOption#5f2d1df2 flags:# current:flags.1?true can_purchase_upgrade:flags.2?true transaction:flags.3?string months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumSubscriptionOption;\nsendAsPeer#b81c7034 flags:# premium_required:flags.0?true peer:Peer = SendAsPeer;\nmessageExtendedMediaPreview#ad628cc8 flags:# w:flags.0?int h:flags.0?int thumb:flags.1?PhotoSize video_duration:flags.2?int = MessageExtendedMedia;\nmessageExtendedMedia#ee479c64 media:MessageMedia = MessageExtendedMedia;\nstickerKeyword#fcfeb29c document_id:long keyword:Vector<string> = StickerKeyword;\nusername#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username;\nforumTopicDeleted#23f109b id:int = ForumTopic;\nforumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic;\nmessages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics;\ndefaultHistoryTTL#43b46b20 period:int = DefaultHistoryTTL;\nexportedContactToken#41bf109b url:string expires:int = ExportedContactToken;\nrequestPeerTypeUser#5f3b8a00 flags:# bot:flags.0?Bool premium:flags.1?Bool = RequestPeerType;\nrequestPeerTypeChat#c9f06e1b flags:# creator:flags.0?true bot_participant:flags.5?true has_username:flags.3?Bool forum:flags.4?Bool user_admin_rights:flags.1?ChatAdminRights bot_admin_rights:flags.2?ChatAdminRights = RequestPeerType;\nrequestPeerTypeBroadcast#339bef6c flags:# creator:flags.0?true has_username:flags.3?Bool user_admin_rights:flags.1?ChatAdminRights bot_admin_rights:flags.2?ChatAdminRights = RequestPeerType;\nemojiListNotModified#481eadfa = EmojiList;\nemojiList#7a1e11d1 hash:long document_id:Vector<long> = EmojiList;\nemojiGroup#7a9abda9 title:string icon_emoji_id:long emoticons:Vector<string> = EmojiGroup;\nmessages.emojiGroupsNotModified#6fb4ad87 = messages.EmojiGroups;\nmessages.emojiGroups#881fb94b hash:int groups:Vector<EmojiGroup> = messages.EmojiGroups;\ntextWithEntities#751f3146 text:string entities:Vector<MessageEntity> = TextWithEntities;\nmessages.translateResult#33db32f8 result:Vector<TextWithEntities> = messages.TranslatedText;\nautoSaveSettings#c84834ce flags:# photos:flags.0?true videos:flags.1?true video_max_size:flags.2?long = AutoSaveSettings;\nautoSaveException#81602d47 peer:Peer settings:AutoSaveSettings = AutoSaveException;\naccount.autoSaveSettings#4c3e069d users_settings:AutoSaveSettings chats_settings:AutoSaveSettings broadcasts_settings:AutoSaveSettings exceptions:Vector<AutoSaveException> chats:Vector<Chat> users:Vector<User> = account.AutoSaveSettings;\nhelp.appConfigNotModified#7cde641d = help.AppConfig;\nhelp.appConfig#dd18782e hash:int config:JSONValue = help.AppConfig;\ninputBotAppID#a920bd7a id:long access_hash:long = InputBotApp;\ninputBotAppShortName#908c0407 bot_id:InputUser short_name:string = InputBotApp;\nbotAppNotModified#5da674b7 = BotApp;\nbotApp#95fcd1d6 flags:# id:long access_hash:long short_name:string title:string description:string photo:Photo document:flags.0?Document hash:long = BotApp;\nmessages.botApp#eb50adf5 flags:# inactive:flags.0?true request_write_access:flags.1?true has_settings:flags.2?true app:BotApp = messages.BotApp;\nappWebViewResultUrl#3c1b4f0d url:string = AppWebViewResult;\ninlineBotWebView#b57295d5 text:string url:string = InlineBotWebView;\nreadParticipantDate#4a4ff172 user_id:long date:int = ReadParticipantDate;\ninputChatlistDialogFilter#f3e0da33 filter_id:int = InputChatlist;\nexportedChatlistInvite#c5181ac flags:# title:string url:string peers:Vector<Peer> = ExportedChatlistInvite;\nchatlists.exportedChatlistInvite#10e6e3a6 filter:DialogFilter invite:ExportedChatlistInvite = chatlists.ExportedChatlistInvite;\nchatlists.exportedInvites#10ab6dc7 invites:Vector<ExportedChatlistInvite> chats:Vector<Chat> users:Vector<User> = chatlists.ExportedInvites;\nchatlists.chatlistInviteAlready#fa87f659 filter_id:int missing_peers:Vector<Peer> already_peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistInvite;\nchatlists.chatlistInvite#1dcd839d flags:# title:string emoticon:flags.0?string peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistInvite;\nchatlists.chatlistUpdates#93bd878d missing_peers:Vector<Peer> chats:Vector<Chat> users:Vector<User> = chatlists.ChatlistUpdates;\nbots.botInfo#e8a775b0 name:string about:string description:string = bots.BotInfo;\nmessagePeerVote#b6cc2d5c peer:Peer option:bytes date:int = MessagePeerVote;\nmessagePeerVoteInputOption#74cda504 peer:Peer date:int = MessagePeerVote;\nmessagePeerVoteMultiple#4628f6e6 peer:Peer options:Vector<bytes> date:int = MessagePeerVote;\nsponsoredWebPage#3db8ec63 flags:# url:string site_name:string photo:flags.0?Photo = SponsoredWebPage;\nstoryViews#8d595cd6 flags:# has_viewers:flags.1?true views_count:int forwards_count:flags.2?int reactions:flags.3?Vector<ReactionCount> reactions_count:flags.4?int recent_viewers:flags.0?Vector<long> = StoryViews;\nstoryItemDeleted#51e6ee4f id:int = StoryItem;\nstoryItemSkipped#ffadc913 flags:# close_friends:flags.8?true id:int date:int expire_date:int = StoryItem;\nstoryItem#44c457ce flags:# pinned:flags.5?true public:flags.7?true close_friends:flags.8?true min:flags.9?true noforwards:flags.10?true edited:flags.11?true contacts:flags.12?true selected_contacts:flags.13?true out:flags.16?true id:int date:int expire_date:int caption:flags.0?string entities:flags.1?Vector<MessageEntity> media:MessageMedia media_areas:flags.14?Vector<MediaArea> privacy:flags.2?Vector<PrivacyRule> views:flags.3?StoryViews sent_reaction:flags.15?Reaction = StoryItem;\nstories.allStoriesNotModified#1158fe3e flags:# state:string stealth_mode:StoriesStealthMode = stories.AllStories;\nstories.allStories#6efc5e81 flags:# has_more:flags.0?true count:int state:string peer_stories:Vector<PeerStories> chats:Vector<Chat> users:Vector<User> stealth_mode:StoriesStealthMode = stories.AllStories;\nstories.stories#5dd8c3c8 count:int stories:Vector<StoryItem> chats:Vector<Chat> users:Vector<User> = stories.Stories;\nstoryView#b0bdeac5 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true user_id:long date:int reaction:flags.2?Reaction = StoryView;\nstories.storyViewsList#46e9b9ec flags:# count:int reactions_count:int views:Vector<StoryView> users:Vector<User> next_offset:flags.0?string = stories.StoryViewsList;\nstories.storyViews#de9eed1d views:Vector<StoryViews> users:Vector<User> = stories.StoryViews;\ninputReplyToMessage#9c5386e4 flags:# reply_to_msg_id:int top_msg_id:flags.0?int = InputReplyTo;\ninputReplyToStory#15b0f283 user_id:InputUser story_id:int = InputReplyTo;\nexportedStoryLink#3fc9053b link:string = ExportedStoryLink;\nstoriesStealthMode#712e27fd flags:# active_until_date:flags.0?int cooldown_until_date:flags.1?int = StoriesStealthMode;\nmediaAreaCoordinates#3d1ea4e x:double y:double w:double h:double rotation:double = MediaAreaCoordinates;\nmediaAreaVenue#be82db9c coordinates:MediaAreaCoordinates geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MediaArea;\ninputMediaAreaVenue#b282217f coordinates:MediaAreaCoordinates query_id:long result_id:string = MediaArea;\nmediaAreaGeoPoint#df8b3b22 coordinates:MediaAreaCoordinates geo:GeoPoint = MediaArea;\nmediaAreaSuggestedReaction#14455871 flags:# dark:flags.0?true flipped:flags.1?true coordinates:MediaAreaCoordinates reaction:Reaction = MediaArea;\npeerStories#9a35e999 flags:# peer:Peer max_read_id:flags.0?int stories:Vector<StoryItem> = PeerStories;\nstories.peerStories#cae68768 stories:PeerStories chats:Vector<Chat> users:Vector<User> = stories.PeerStories;\nstories.boostsStatus#e5c1aa5c flags:# my_boost:flags.2?true level:int current_level_boosts:int boosts:int next_level_boosts:flags.0?int premium_audience:flags.1?StatsPercentValue boost_url:string = stories.BoostsStatus;\nstories.canApplyBoostOk#c3173587 = stories.CanApplyBoostResult;\nstories.canApplyBoostReplace#712c4655 current_boost:Peer chats:Vector<Chat> = stories.CanApplyBoostResult;\nbooster#e9e6380 user_id:long expires:int = Booster;\nstories.boostersList#f3dd3d1d flags:# count:int boosters:Vector<Booster> next_offset:flags.0?string users:Vector<User> = stories.BoostersList;\nmessages.webPage#fd5e12bd webpage:WebPage chats:Vector<Chat> users:Vector<User> = messages.WebPage;\n---functions---\ninvokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;\ninitConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;\ninvokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;\nauth.sendCode#a677244f phone_number:string api_id:int api_hash:string settings:CodeSettings = auth.SentCode;\nauth.signUp#80eee427 phone_number:string phone_code_hash:string first_name:string last_name:string = auth.Authorization;\nauth.signIn#8d52a951 flags:# phone_number:string phone_code_hash:string phone_code:flags.0?string email_verification:flags.1?EmailVerification = auth.Authorization;\nauth.logOut#3e72ba19 = auth.LoggedOut;\nauth.resetAuthorizations#9fab0d1a = Bool;\nauth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;\nauth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization;\nauth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;\nauth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;\nauth.requestPasswordRecovery#d897bc66 = auth.PasswordRecovery;\nauth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;\nauth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;\nauth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool;\nauth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector<long> = auth.LoginToken;\nauth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;\nauth.importWebTokenAuthorization#2db873a9 api_id:int api_hash:string web_auth_token:string = auth.Authorization;\naccount.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;\naccount.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool;\naccount.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;\naccount.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;\naccount.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;\naccount.updateStatus#6628562c offline:Bool = Bool;\naccount.getWallPapers#7967d36 hash:long = account.WallPapers;\naccount.reportPeer#c5ba3d86 peer:InputPeer reason:ReportReason message:string = Bool;\naccount.checkUsername#2714d86c username:string = Bool;\naccount.updateUsername#3e0bdd7c username:string = User;\naccount.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;\naccount.setPrivacy#c9f81ce8 key:InputPrivacyKey rules:Vector<InputPrivacyRule> = account.PrivacyRules;\naccount.getAuthorizations#e320c158 = account.Authorizations;\naccount.resetAuthorization#df77f3bc hash:long = Bool;\naccount.getPassword#548a30f5 = account.Password;\naccount.getPasswordSettings#9cd4eaf9 password:InputCheckPasswordSRP = account.PasswordSettings;\naccount.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool;\naccount.sendConfirmPhoneCode#1b3faa88 hash:string settings:CodeSettings = auth.SentCode;\naccount.confirmPhone#5f2178c3 phone_code_hash:string phone_code:string = Bool;\naccount.getTmpPassword#449e0b51 password:InputCheckPasswordSRP period:int = account.TmpPassword;\naccount.getWebAuthorizations#182e6d6f = account.WebAuthorizations;\naccount.resetWebAuthorization#2d01b9ef hash:long = Bool;\naccount.resetWebAuthorizations#682d2594 = Bool;\naccount.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode;\naccount.confirmPasswordEmail#8fdf1920 code:string = Bool;\naccount.getContactSignUpNotification#9f07c728 = Bool;\naccount.setContactSignUpNotification#cff43f61 silent:Bool = Bool;\naccount.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true compare_stories:flags.2?true peer:flags.0?InputNotifyPeer = Updates;\naccount.uploadWallPaper#e39a8f03 flags:# for_chat:flags.0?true file:InputFile mime_type:string settings:WallPaperSettings = WallPaper;\naccount.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;\naccount.getContentSettings#8b9b4dae = account.ContentSettings;\naccount.getGlobalPrivacySettings#eb2b4cf6 = GlobalPrivacySettings;\naccount.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = GlobalPrivacySettings;\naccount.reportProfilePhoto#fa8cc6f5 peer:InputPeer photo_id:InputPhoto reason:ReportReason message:string = Bool;\naccount.setAuthorizationTTL#bf899aa0 authorization_ttl_days:int = Bool;\naccount.changeAuthorizationSettings#40f48462 flags:# confirmed:flags.3?true hash:long encrypted_requests_disabled:flags.0?Bool call_requests_disabled:flags.1?Bool = Bool;\naccount.updateEmojiStatus#fbd3de6b emoji_status:EmojiStatus = Bool;\naccount.getRecentEmojiStatuses#f578105 hash:long = account.EmojiStatuses;\naccount.reorderUsernames#ef500eab order:Vector<string> = Bool;\naccount.toggleUsername#58d6b376 username:string active:Bool = Bool;\nusers.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;\nusers.getFullUser#b60f5918 id:InputUser = users.UserFull;\ncontacts.getContacts#5dd69e12 hash:long = contacts.Contacts;\ncontacts.importContacts#2c800be5 contacts:Vector<InputContact> = contacts.ImportedContacts;\ncontacts.deleteContacts#96a0e00 id:Vector<InputUser> = Updates;\ncontacts.block#2e2e8734 flags:# my_stories_from:flags.0?true id:InputPeer = Bool;\ncontacts.unblock#b550d328 flags:# my_stories_from:flags.0?true id:InputPeer = Bool;\ncontacts.getBlocked#9a868f80 flags:# my_stories_from:flags.0?true offset:int limit:int = contacts.Blocked;\ncontacts.search#11f812d8 q:string limit:int = contacts.Found;\ncontacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;\ncontacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers;\ncontacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates;\ncontacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer;\ncontacts.editCloseFriends#ba6705f0 id:Vector<long> = Bool;\nmessages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;\nmessages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;\nmessages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;\nmessages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory;\nmessages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;\nmessages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;\nmessages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool;\nmessages.sendMessage#280d096f flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to:flags.0?InputReplyTo message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;\nmessages.sendMedia#72ccc23d flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to:flags.0?InputReplyTo media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;\nmessages.forwardMessages#c661bbc4 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;\nmessages.reportSpam#cf1592db peer:InputPeer = Bool;\nmessages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings;\nmessages.report#8953ab4e peer:InputPeer id:Vector<int> reason:ReportReason message:string = Bool;\nmessages.getChats#49e9528f id:Vector<long> = messages.Chats;\nmessages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull;\nmessages.editChatTitle#73783ffd chat_id:long title:string = Updates;\nmessages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates;\nmessages.addChatUser#f24753e3 chat_id:long user_id:InputUser fwd_limit:int = Updates;\nmessages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates;\nmessages.createChat#34a818 flags:# users:Vector<InputUser> title:string ttl_period:flags.0?int = Updates;\nmessages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;\nmessages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;\nmessages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers;\nmessages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers;\nmessages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector<MessageEntity> = MessageMedia;\nmessages.exportChatInvite#a02ce5d5 flags:# legacy_revoke_permanent:flags.2?true request_needed:flags.3?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int title:flags.4?string = ExportedChatInvite;\nmessages.checkChatInvite#3eadb1bb hash:string = ChatInvite;\nmessages.importChatInvite#6c50051c hash:string = Updates;\nmessages.getStickerSet#c8a0ec74 stickerset:InputStickerSet hash:int = messages.StickerSet;\nmessages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = messages.StickerSetInstallResult;\nmessages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;\nmessages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;\nmessages.getMessagesViews#5784d3e1 peer:InputPeer id:Vector<int> increment:Bool = messages.MessageViews;\nmessages.migrateChat#a2875319 chat_id:long = Updates;\nmessages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\nmessages.getDocumentByHash#b1f2061f sha256:bytes size:long mime_type:string = Document;\nmessages.getSavedGifs#5cf09635 hash:long = messages.SavedGifs;\nmessages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool;\nmessages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;\nmessages.sendInlineBotResult#f7bc68ba flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to:flags.0?InputReplyTo random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;\nmessages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> schedule_date:flags.15?int = Updates;\nmessages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer;\nmessages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs;\nmessages.saveDraft#b4331e3f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int top_msg_id:flags.2?int peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> = Bool;\nmessages.getFeaturedStickers#64780b14 hash:long = messages.FeaturedStickers;\nmessages.readFeaturedStickers#5b118126 id:Vector<long> = Bool;\nmessages.getRecentStickers#9da9403b flags:# attached:flags.0?true hash:long = messages.RecentStickers;\nmessages.saveRecentSticker#392718f8 flags:# attached:flags.0?true id:InputDocument unsave:Bool = Bool;\nmessages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool;\nmessages.getCommonChats#e40ca104 user_id:InputUser max_id:long limit:int = messages.Chats;\nmessages.getWebPage#8d9692a3 url:string hash:int = messages.WebPage;\nmessages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;\nmessages.getPinnedDialogs#d6b94df2 folder_id:int = messages.PeerDialogs;\nmessages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;\nmessages.getFavedStickers#4f1aaa9 hash:long = messages.FavedStickers;\nmessages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;\nmessages.getUnreadMentions#f107e790 flags:# peer:InputPeer top_msg_id:flags.0?int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;\nmessages.readMentions#36e5bf4d flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory;\nmessages.sendMultiMedia#456e8987 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to:flags.0?InputReplyTo multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates;\nmessages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets;\nmessages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool;\nmessages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?true pm_oneside:flags.2?true peer:InputPeer id:int = Updates;\nmessages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector<bytes> = Updates;\nmessages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;\nmessages.editChatAbout#def60797 peer:InputPeer about:string = Bool;\nmessages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;\nmessages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference;\nmessages.requestUrlAuth#198fb446 flags:# peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;\nmessages.acceptUrlAuth#b12c7125 flags:# write_allowed:flags.0?true peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;\nmessages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool;\nmessages.getScheduledHistory#f516760b peer:InputPeer hash:long = messages.Messages;\nmessages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector<int> = Updates;\nmessages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector<int> = Updates;\nmessages.getPollVotes#b86e380e flags:# peer:InputPeer id:int option:flags.0?bytes offset:flags.1?string limit:int = messages.VotesList;\nmessages.getDialogFilters#f19ed96d = Vector<DialogFilter>;\nmessages.getSuggestedDialogFilters#a29cd42c = Vector<DialogFilterSuggested>;\nmessages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;\nmessages.updateDialogFiltersOrder#c563c1e4 order:Vector<int> = Bool;\nmessages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage;\nmessages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool;\nmessages.unpinAllMessages#ee22b9a8 flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory;\nmessages.deleteChat#5bd0ee50 chat_id:long = Bool;\nmessages.getExportedChatInvites#a2b5a3f6 flags:# revoked:flags.3?true peer:InputPeer admin_id:InputUser offset_date:flags.2?int offset_link:flags.2?string limit:int = messages.ExportedChatInvites;\nmessages.editExportedChatInvite#bdca2f75 flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int request_needed:flags.3?Bool title:flags.4?string = messages.ExportedChatInvite;\nmessages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool;\nmessages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool;\nmessages.getChatInviteImporters#df04dd4e flags:# requested:flags.0?true peer:InputPeer link:flags.1?string q:flags.2?string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters;\nmessages.getMessageReadParticipants#31c1c44f peer:InputPeer msg_id:int = Vector<ReadParticipantDate>;\nmessages.hideChatJoinRequest#7fe7e815 flags:# approved:flags.0?true peer:InputPeer user_id:InputUser = Updates;\nmessages.hideAllChatJoinRequests#e085f4ea flags:# approved:flags.0?true peer:InputPeer link:flags.1?string = Updates;\nmessages.toggleNoForwards#b11eafa2 peer:InputPeer enabled:Bool = Updates;\nmessages.saveDefaultSendAs#ccfddf96 peer:InputPeer send_as:InputPeer = Bool;\nmessages.sendReaction#d30d78d4 flags:# big:flags.1?true add_to_recent:flags.2?true peer:InputPeer msg_id:int reaction:flags.0?Vector<Reaction> = Updates;\nmessages.getMessagesReactions#8bba90e6 peer:InputPeer id:Vector<int> = Updates;\nmessages.getMessageReactionsList#461b3f48 flags:# peer:InputPeer id:int reaction:flags.0?Reaction offset:flags.1?string limit:int = messages.MessageReactionsList;\nmessages.setChatAvailableReactions#feb16771 peer:InputPeer available_reactions:ChatReactions = Updates;\nmessages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions;\nmessages.setDefaultReaction#4f47a016 reaction:Reaction = Bool;\nmessages.translateText#63183030 flags:# peer:flags.0?InputPeer id:flags.0?Vector<int> text:flags.1?Vector<TextWithEntities> to_lang:string = messages.TranslatedText;\nmessages.getUnreadReactions#3223495b flags:# peer:InputPeer top_msg_id:flags.0?int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;\nmessages.readReactions#54aa7f8e flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory;\nmessages.getAttachMenuBots#16fcc2cb hash:long = AttachMenuBots;\nmessages.getAttachMenuBot#77216192 bot:InputUser = AttachMenuBotsBot;\nmessages.toggleBotInAttachMenu#69f59d69 flags:# write_allowed:flags.0?true bot:InputUser enabled:Bool = Bool;\nmessages.requestWebView#269dc2c1 flags:# from_bot_menu:flags.4?true silent:flags.5?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to:flags.0?InputReplyTo send_as:flags.13?InputPeer = WebViewResult;\nmessages.prolongWebView#b0d81a83 flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to:flags.0?InputReplyTo send_as:flags.13?InputPeer = Bool;\nmessages.requestSimpleWebView#1a46500a flags:# from_switch_webview:flags.1?true from_side_menu:flags.2?true bot:InputUser url:flags.3?string start_param:flags.4?string theme_params:flags.0?DataJSON platform:string = SimpleWebViewResult;\nmessages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent;\nmessages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates;\nmessages.transcribeAudio#269e9a49 peer:InputPeer msg_id:int = messages.TranscribedAudio;\nmessages.getCustomEmojiDocuments#d9ab0f54 document_id:Vector<long> = Vector<Document>;\nmessages.getEmojiStickers#fbfca18f hash:long = messages.AllStickers;\nmessages.getFeaturedEmojiStickers#ecf6736 hash:long = messages.FeaturedStickers;\nmessages.getTopReactions#bb8125ba limit:int hash:long = messages.Reactions;\nmessages.getRecentReactions#39461db2 limit:int hash:long = messages.Reactions;\nmessages.clearRecentReactions#9dfeefb4 = Bool;\nmessages.getExtendedMedia#84f80814 peer:InputPeer id:Vector<int> = Updates;\nmessages.togglePeerTranslations#e47cb579 flags:# disabled:flags.0?true peer:InputPeer = Bool;\nmessages.getBotApp#34fdc5c3 app:InputBotApp hash:long = messages.BotApp;\nmessages.requestAppWebView#8c5a3b3c flags:# write_allowed:flags.0?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = AppWebViewResult;\nupdates.getState#edd4882a = updates.State;\nupdates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference;\nupdates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference;\nphotos.updateProfilePhoto#9e82039 flags:# fallback:flags.0?true bot:flags.1?InputUser id:InputPhoto = photos.Photo;\nphotos.uploadProfilePhoto#388a3b5 flags:# fallback:flags.3?true bot:flags.5?InputUser file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.4?VideoSize = photos.Photo;\nphotos.deletePhotos#87cf7f2f id:Vector<InputPhoto> = Vector<long>;\nphotos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int = photos.Photos;\nphotos.uploadContactProfilePhoto#e14c4a71 flags:# suggest:flags.3?true save:flags.4?true user_id:InputUser file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.5?VideoSize = photos.Photo;\nupload.saveFilePart#b304a621 file_id:long file_part:int bytes:bytes = Bool;\nupload.getFile#be5335be flags:# precise:flags.0?true cdn_supported:flags.1?true location:InputFileLocation offset:long limit:int = upload.File;\nupload.saveBigFilePart#de7b673d file_id:long file_part:int file_total_parts:int bytes:bytes = Bool;\nupload.getWebFile#24e6818d location:InputWebFileLocation offset:int limit:int = upload.WebFile;\nhelp.getConfig#c4f9186b = Config;\nhelp.getNearestDc#1fb33026 = NearestDc;\nhelp.getSupport#9cdf08cd = help.Support;\nhelp.acceptTermsOfService#ee72f79a id:DataJSON = Bool;\nhelp.getAppConfig#61e3f854 hash:int = help.AppConfig;\nhelp.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;\nhelp.getPremiumPromo#b81b93d4 = help.PremiumPromo;\nchannels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;\nchannels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;\nchannels.getMessages#ad8c9a23 channel:InputChannel id:Vector<InputMessage> = messages.Messages;\nchannels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:long = channels.ChannelParticipants;\nchannels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;\nchannels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;\nchannels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;\nchannels.createChannel#91006707 flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true forum:flags.5?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string ttl_period:flags.4?int = Updates;\nchannels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;\nchannels.editTitle#566decd0 channel:InputChannel title:string = Updates;\nchannels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;\nchannels.checkUsername#10e6bd2c channel:InputChannel username:string = Bool;\nchannels.updateUsername#3514b3de channel:InputChannel username:string = Bool;\nchannels.joinChannel#24b524c5 channel:InputChannel = Updates;\nchannels.leaveChannel#f836aa95 channel:InputChannel = Updates;\nchannels.inviteToChannel#199f3a6c channel:InputChannel users:Vector<InputUser> = Updates;\nchannels.deleteChannel#c0111fe3 channel:InputChannel = Updates;\nchannels.toggleSignatures#1f69b606 channel:InputChannel enabled:Bool = Updates;\nchannels.editBanned#96e6cd81 channel:InputChannel participant:InputPeer banned_rights:ChatBannedRights = Updates;\nchannels.readMessageContents#eab5dc38 channel:InputChannel id:Vector<int> = Bool;\nchannels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;\nchannels.getGroupsForDiscussion#f5dad378 = messages.Chats;\nchannels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;\nchannels.viewSponsoredMessage#beaedb94 channel:InputChannel random_id:bytes = Bool;\nchannels.getSponsoredMessages#ec210fbf channel:InputChannel = messages.SponsoredMessages;\nchannels.getSendAs#dc770ee peer:InputPeer = channels.SendAsPeers;\nchannels.toggleJoinToSend#e4cb9580 channel:InputChannel enabled:Bool = Updates;\nchannels.toggleJoinRequest#4c2985b6 channel:InputChannel enabled:Bool = Updates;\nchannels.reorderUsernames#b45ced1d channel:InputChannel order:Vector<string> = Bool;\nchannels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool;\nchannels.deactivateAllUsernames#a245dd3 channel:InputChannel = Bool;\nchannels.toggleForum#a4298b29 channel:InputChannel enabled:Bool = Updates;\nchannels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;\nchannels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;\nchannels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics;\nchannels.editForumTopic#f4dfa185 flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;\nchannels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates;\nchannels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory;\nchannels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates;\nbots.canSendMessage#1359f4e6 bot:InputUser = Bool;\nbots.allowSendMessage#f132e3ef bot:InputUser = Updates;\nbots.invokeWebViewCustomMethod#87fc5e7 bot:InputUser custom_method:string params:DataJSON = DataJSON;\npayments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm;\npayments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt;\npayments.validateRequestedInfo#b6c8f12b flags:# save:flags.0?true invoice:InputInvoice info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;\npayments.sendPaymentForm#2d03522f flags:# form_id:long invoice:InputInvoice requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;\npayments.getSavedInfo#227d824b = payments.SavedInfo;\nphone.requestCall#42ff96ed flags:# video:flags.0?true user_id:InputUser random_id:int g_a_hash:bytes protocol:PhoneCallProtocol = phone.PhoneCall;\nphone.acceptCall#3bd2b4a0 peer:InputPhoneCall g_b:bytes protocol:PhoneCallProtocol = phone.PhoneCall;\nphone.confirmCall#2efe1722 peer:InputPhoneCall g_a:bytes key_fingerprint:long protocol:PhoneCallProtocol = phone.PhoneCall;\nphone.receivedCall#17d54f61 peer:InputPhoneCall = Bool;\nphone.discardCall#b2cbc1c0 flags:# video:flags.0?true peer:InputPhoneCall duration:int reason:PhoneCallDiscardReason connection_id:long = Updates;\nphone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhoneCall rating:int comment:string = Updates;\nphone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;\nphone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool;\nphone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;\nphone.joinGroupCall#b132ff7b flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates;\nphone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;\nphone.discardGroupCall#7a777135 call:InputGroupCall = Updates;\nphone.getGroupCall#41845db call:InputGroupCall limit:int = phone.GroupCall;\nphone.getGroupParticipants#c558d8ab call:InputGroupCall ids:Vector<InputPeer> sources:Vector<int> offset:string limit:int = phone.GroupParticipants;\nphone.editGroupCallParticipant#a5273abf flags:# call:InputGroupCall participant:InputPeer muted:flags.0?Bool volume:flags.1?int raise_hand:flags.2?Bool video_stopped:flags.3?Bool video_paused:flags.4?Bool presentation_paused:flags.5?Bool = Updates;\nphone.exportGroupCallInvite#e6aa647f flags:# can_self_unmute:flags.0?true call:InputGroupCall = phone.ExportedGroupCallInvite;\nphone.toggleGroupCallStartSubscription#219c34e6 call:InputGroupCall subscribed:Bool = Updates;\nphone.joinGroupCallPresentation#cbea6bc4 call:InputGroupCall params:DataJSON = Updates;\nphone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;\nlangpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;\nlangpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;\nlangpack.getLanguages#42c6978f lang_pack:string = Vector<LangPackLanguage>;\nfolders.editPeerFolders#6847d0ab folder_peers:Vector<InputFolderPeer> = Updates;\nstats.getBroadcastStats#ab42441a flags:# dark:flags.0?true channel:InputChannel = stats.BroadcastStats;\nstats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph;\nstats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel = stats.MegagroupStats;\nstats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;\nstats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;\nchatlists.exportChatlistInvite#8472478e chatlist:InputChatlist title:string peers:Vector<InputPeer> = chatlists.ExportedChatlistInvite;\nchatlists.deleteExportedInvite#719c5c5e chatlist:InputChatlist slug:string = Bool;\nchatlists.editExportedInvite#653db63d flags:# chatlist:InputChatlist slug:string title:flags.1?string peers:flags.2?Vector<InputPeer> = ExportedChatlistInvite;\nchatlists.getExportedInvites#ce03da83 chatlist:InputChatlist = chatlists.ExportedInvites;\nchatlists.checkChatlistInvite#41c10fff slug:string = chatlists.ChatlistInvite;\nchatlists.joinChatlistInvite#a6b1e39a slug:string peers:Vector<InputPeer> = Updates;\nchatlists.getLeaveChatlistSuggestions#fdbcd714 chatlist:InputChatlist = Vector<Peer>;\nchatlists.leaveChatlist#74fae13a chatlist:InputChatlist peers:Vector<InputPeer> = Updates;\nstories.editStory#b583ba46 flags:# peer:InputPeer id:int media:flags.0?InputMedia media_areas:flags.3?Vector<MediaArea> caption:flags.1?string entities:flags.1?Vector<MessageEntity> privacy_rules:flags.2?Vector<InputPrivacyRule> = Updates;\nstories.deleteStories#ae59db5f peer:InputPeer id:Vector<int> = Vector<int>;\nstories.togglePinned#9a75a1ef peer:InputPeer id:Vector<int> pinned:Bool = Vector<int>;\nstories.getAllStories#eeb0d625 flags:# next:flags.1?true hidden:flags.2?true state:flags.0?string = stories.AllStories;\nstories.getPinnedStories#5821a5dc peer:InputPeer offset_id:int limit:int = stories.Stories;\nstories.getStoriesArchive#b4352016 peer:InputPeer offset_id:int limit:int = stories.Stories;\nstories.getStoriesByID#5774ca74 peer:InputPeer id:Vector<int> = stories.Stories;\nstories.readStories#a556dac8 peer:InputPeer max_id:int = Vector<int>;\nstories.incrementStoryViews#b2028afb peer:InputPeer id:Vector<int> = Bool;\nstories.getStoryViewsList#7ed23c57 flags:# just_contacts:flags.0?true reactions_first:flags.2?true peer:InputPeer q:flags.1?string id:int offset:string limit:int = stories.StoryViewsList;\nstories.exportStoryLink#7b8def20 peer:InputPeer id:int = ExportedStoryLink;\nstories.report#1923fa8c peer:InputPeer id:Vector<int> reason:ReportReason message:string = Bool;\nstories.activateStealthMode#57bbd166 flags:# past:flags.0?true future:flags.1?true = Updates;\nstories.sendReaction#7fd736b2 flags:# add_to_recent:flags.0?true peer:InputPeer story_id:int reaction:Reaction = Updates;\nstories.getPeerStories#2c4ada50 peer:InputPeer = stories.PeerStories;\nstories.getPeerMaxIDs#535983c3 id:Vector<InputPeer> = Vector<int>;\nstories.togglePeerStoriesHidden#bd0415c4 peer:InputPeer hidden:Bool = Bool;\nstories.getBoostsStatus#4c449472 peer:InputPeer = stories.BoostsStatus;\nstories.getBoostersList#337ef980 peer:InputPeer offset:string limit:int = stories.BoostersList;\nstories.canApplyBoost#db05c1bd peer:InputPeer = stories.CanApplyBoostResult;\nstories.applyBoost#f29d7c2b peer:InputPeer = Bool;"},68963:(e,t,n)=>{var s=n(48764).lW;function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{inflate:i}=n(35802),{serializeBytes:o}=n(57404);class r{constructor(e){this.data=e,this.CONSTRUCTOR_ID=812830625,this.classType="constructor"}static async gzipIfSmaller(e,t){if(e&&t.length>512){const e=await new r(t).toBytes();if(e.length<t.length)return e}return t}static gzip(e){return s.from(e)}static ungzip(e){return s.from(i(e))}static read(e){if(e.readInt(!1)!==r.CONSTRUCTOR_ID)throw new Error("not equal");return r.gzip(e.tgReadBytes())}static async fromReader(e){return new r(await r.ungzip(e.tgReadBytes()))}async toBytes(){const e=s.alloc(4);return e.writeUInt32LE(r.CONSTRUCTOR_ID,0),s.concat([e,o(await r.gzip(this.data))])}}a(r,"CONSTRUCTOR_ID",812830625),a(r,"classType","constructor"),e.exports=r},63254:(e,t,n)=>{function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const a=n(40355);class i{constructor(e){this.CONSTRUCTOR_ID=1945237724,this.messages=e,this.classType="constructor"}static fromReader(e){const t=[],n=e.readInt();for(let s=0;s<n;s++){const n=e.readLong(),s=e.readInt(),i=e.readInt(),o=e.tellPosition(),r=e.tgReadObject();e.setPosition(o+i);const c=new a(n,s,r);t.push(c)}return new i(t)}}s(i,"CONSTRUCTOR_ID",1945237724),s(i,"classType","constructor"),s(i,"MAXIMUM_SIZE",1044448),s(i,"MAXIMUM_LENGTH",100),e.exports=i},52301:(e,t,n)=>{function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{RpcError:a}=n(57404).constructors,i=n(68963);class o{constructor(e,t,n){this.CONSTRUCTOR_ID=4082920705,this.reqMsgId=e,this.body=t,this.error=n,this.classType="constructor"}static async fromReader(e){const t=e.readLong(),n=e.readInt(!1);return n===a.CONSTRUCTOR_ID?new o(t,void 0,a.fromReader(e)):n===i.CONSTRUCTOR_ID?new o(t,(await i.fromReader(e)).data):(e.seek(-4),new o(t,e.read(),void 0))}}s(o,"CONSTRUCTOR_ID",4082920705),s(o,"classType","constructor"),e.exports=o},40355:e=>{function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class n{constructor(e,t,n){this.msgId=e,this.seqNo=t,this.obj=n,this.classType="constructor"}}t(n,"SIZE_OVERHEAD",12),t(n,"classType","constructor"),e.exports=n},92058:(e,t,n)=>{const s=n(40355),a=n(52301),i=n(63254),o=n(68963),r={[a.CONSTRUCTOR_ID]:a,[o.CONSTRUCTOR_ID]:o,[i.CONSTRUCTOR_ID]:i};e.exports={TLMessage:s,RPCResult:a,MessageContainer:i,GZIPPacked:o,coreObjects:r}},51436:(e,t,n)=>{var s=n(48764).lW;const a=e=>e.replace(/(?:^|_)([a-z])/g,((e,t)=>t.toUpperCase())).replace(/_/g,""),i=e=>e.replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_",""))),o=new Set([3162085175,2574415285,1072550713,3300522427,1450380236]),r=new Set([85337187,2211011308,2851430293,1013613780,1459478408,3504867164,3045658042,1715713620,3608339646,4110704415,812830625]);let c;function d(e){c||(c=function(){let e;const t=[];for(let n=0;n<256;n++){e=n;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}()),s.isBuffer(e)||(e=s.from(e));let t=-1;for(let n=0;n<e.length;n++){const s=e[n];t=c[255&(t^s)]^t>>>8}return(-1^t)>>>0}const u=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e.flags.includes("g")||(e=new RegExp(e.source,"g"));const s=e.exec(t);return s&&(n.push(s.slice(1)),u(e,t,n)),n},l=(e,t)=>{const n=e.match(/([\w.]+)(?:#([0-9a-fA-F]+))?(?:\s{?\w+:[\w\d<>#.?!]+}?)*\s=\s([\w\d<>#.?]+);$/);if(!n)throw new Error(`Cannot parse TLObject ${e}`);const o=u(/({)?(\w+):([\w\d<>#.?!]+)}?/,e),r={name:n[1],constructorId:parseInt(n[2],16),argsConfig:{},subclassOfId:d(n[3]),result:n[3],isFunction:t,namespace:void 0};if(!r.constructorId){const e="";let t;t=Object.values(r.argsConfig).length?` ${Object.keys(r.argsConfig).map((e=>e.toString())).join(" ")}`:"";const n=`${r.name}${e}${t} = ${r.result}`.replace(/(:|\?)bytes /g,"$1string ").replace(/</g," ").replace(/>|{|}/g,"").replace(/ \w+:flags\d*\.\d+\?true/g,"");"inputMediaInvoice"===r.name&&r.name,r.constructorId=d(s.from(n,"utf8"))}for(const[e,t,n]of o)void 0===e&&(r.argsConfig[i(t)]=p(t,n));return r.name.includes(".")&&([r.namespace,r.name]=r.name.split(/\.(.+)/)),r.name=a(r.name),r};function p(e,t){e="self"===e?"is_self":e;const n={isVector:!1,isFlag:!1,skipConstructorId:!1,flagGroup:0,flagIndex:-1,flagIndicator:!0,type:void 0,useVectorId:void 0};if("#"!==t){n.flagIndicator=!1,n.type=t.replace(/^!+/,"");const e=n.type.match(/flags(\d*)\.(\d+)\?([\w<>.]+)/);e&&(n.isFlag=!0,n.flagGroup=Number(e[1]||1),n.flagIndex=Number(e[2]),[,,,n.type]=e);const s=n.type.match(/[Vv]ector<([\w\d.]+)>/);s&&(n.isVector=!0,n.useVectorId="V"===n.type.charAt(0),[,n.type]=s),/^[a-z]$/.test(n.type.split(".").pop().charAt(0))&&(n.skipConstructorId=!0)}return n}e.exports={findAll:u,parseTl:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;return function*(){(t||[]).reduce(((e,t)=>({...e,[t.name]:t})),{});const s=[],a={},i={},o=e;let c=!1;for(let e of o.split("\n")){const t=e.indexOf("//");if(-1!==t&&(e=e.slice(0,t)),e=e.trim(),!e)continue;const o=e.match(/---(\w+)---/);if(o){const[,e]=o;c="functions"===e}else try{const t=l(e,c);if(n.has(t.constructorId))continue;s.push(t),t.isFunction||(i[t.result]||(i[t.result]=[]),a[t.name]=t,i[t.result].push(t))}catch(e){if(!e.toString().includes("vector#1cb5c415"))throw e}}for(const e of s)if(r.has(e.constructorId))for(const t in e.argsConfig)"string"===e.argsConfig[t].type&&(e.argsConfig[t].type="bytes");for(const e of s)yield e}()},buildArgConfig:p,fromLine:l,CORE_TYPES:o,serializeDate:function(e){if(!e)return s.alloc(4).fill(0);if(e instanceof Date&&(e=Math.floor((Date.now()-e.getTime())/1e3)),"number"==typeof e){const t=s.alloc(4);return t.writeInt32LE(e,0),t}throw Error(`Cannot interpret "${e}" as a date`)},serializeBytes:function(e){if(!(e instanceof s)){if("string"!=typeof e)throw Error(`Bytes or str expected, not ${e.constructor.name}`);e=s.from(e)}const t=[];let n;return e.length<254?(n=(e.length+1)%4,0!==n&&(n=4-n),t.push(s.from([e.length])),t.push(e)):(n=e.length%4,0!==n&&(n=4-n),t.push(s.from([254,e.length%256,(e.length>>8)%256,(e.length>>16)%256])),t.push(e)),t.push(s.alloc(n).fill(0)),s.concat(t)},snakeToCamelCase:a,variableSnakeToCamelCase:i}},57404:(e,t,n)=>{const s=n(77150),{serializeBytes:a,serializeDate:i}=n(51436);e.exports={constructors:s,requests:s,serializeBytes:a,serializeDate:i}},48106:e=>{e.exports="resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector<long> = ResPQ;\np_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;\np_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;\np_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;\np_q_inner_data_temp_dc#56fddf88 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data;\nserver_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;\nserver_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;\nserver_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;\nclient_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;\ndh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;\ndh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;\ndh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;\ndestroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes;\ndestroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes;\ndestroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;\n---functions---\nreq_pq#60469778 nonce:int128 = ResPQ;\nreq_pq_multi#be7e8ef1 nonce:int128 = ResPQ;\nreq_pq_multi_new#51b410fd nonce:int128 = ResPQ;\nreq_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;\nset_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;\ndestroy_auth_key#d1435160 = DestroyAuthKeyRes;\n---types---\nmsgs_ack#62d6b459 msg_ids:Vector<long> = MsgsAck;\nbad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;\nbad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;\nmsgs_state_req#da69fb52 msg_ids:Vector<long> = MsgsStateReq;\nmsgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;\nmsgs_all_info#8cc0d131 msg_ids:Vector<long> info:string = MsgsAllInfo;\nmsg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_resend_req#7d861a08 msg_ids:Vector<long> = MsgResendReq;\nrpc_error#2144ca19 error_code:int error_message:string = RpcError;\nrpc_answer_unknown#5e2ad36e = RpcDropAnswer;\nrpc_answer_dropped_running#cd78e586 = RpcDropAnswer;\nrpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer;\nfuture_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;\nfuture_salts#ae500895 req_msg_id:long now:int salts:vector<future_salt> = FutureSalts;\npong#347773c5 msg_id:long ping_id:long = Pong;\ndestroy_session_ok#e22045fc session_id:long = DestroySessionRes;\ndestroy_session_none#62d350c9 session_id:long = DestroySessionRes;\nnew_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;\nhttp_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait;\nipPort#d433ad73 ipv4:int port:int = IpPort;\nipPortSecret#37982646 ipv4:int port:int secret:bytes = IpPort;\naccessPointRule#4679b65f phone_prefix_rules:string dc_id:int ips:vector<IpPort> = AccessPointRule;\nhelp.configSimple#5a592a6c date:int expires:int rules:vector<AccessPointRule> = help.ConfigSimple;\ntlsClientHello blocks:vector<TlsBlock> = TlsClientHello;\ntlsBlockString data:string = TlsBlock;\ntlsBlockRandom length:int = TlsBlock;\ntlsBlockZero length:int = TlsBlock;\ntlsBlockDomain = TlsBlock;\ntlsBlockGrease seed:int = TlsBlock;\ntlsBlockScope entries:Vector<TlsBlock> = TlsBlock;\n---functions---\nping#7abe77ec ping_id:long = Pong;\nping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;"},46586:(e,t,n)=>{"use strict";function s(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{Z:()=>a});class a{constructor(){s(this,"promise",void 0),s(this,"reject",void 0),s(this,"resolve",void 0),this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}static resolved(e){const t=new a;return t.resolve(e),t}}},16039:(e,t,n)=>{"use strict";n.d(t,{J:()=>i});var s=n(46586);function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class i{constructor(e){this.maxWorkers=e,a(this,"deferreds",[]),a(this,"activeWorkers",0)}requestWorker(){if(this.activeWorkers===this.maxWorkers){const e=new s.Z;return this.deferreds.push(e),e.promise}return this.activeWorkers++,Promise.resolve()}releaseWorker(){this.deferreds.length&&this.activeWorkers===this.maxWorkers?this.deferreds.shift().resolve():this.activeWorkers--}}}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var i=s[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.m=n,a.x=()=>{var e=a.O(void 0,[5802,8764,1649],(()=>a(97435)));return a.O(e)},e=[],a.O=(t,n,s,i)=>{if(!n){var o=1/0;for(u=0;u<e.length;u++){for(var[n,s,i]=e[u],r=!0,c=0;c<n.length;c++)(!1&i||o>=i)&&Object.keys(a.O).every((e=>a.O[e](n[c])))?n.splice(c--,1):(r=!1,i<o&&(o=i));if(r){e.splice(u--,1);var d=s();void 0!==d&&(t=d)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,s,i]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},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=>e+"."+{1649:"23ef32650e96d33d6586",5802:"36a9971f58c808c4a974",8764:"58763b7a689318950e51"}[e]+".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),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{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");if(n.length)for(var s=n.length-1;s>-1&&!e;)e=n[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={8415:1};a.f.i=(t,n)=>{e[t]||importScripts(a.p+a.u(t))};var t=self.webpackChunktelegram_t=self.webpackChunktelegram_t||[],n=t.push.bind(t);t.push=t=>{var[s,i,o]=t;for(var r in i)a.o(i,r)&&(a.m[r]=i[r]);for(o&&o(a);s.length;)e[s.pop()]=1;n(t)}})(),t=a.x,a.x=()=>Promise.all([5802,8764,1649].map(a.e,a)).then(t),a.x()})();
|
||
//# sourceMappingURL=8415.9de18b051a23a4e59a16.js.map
|