TelegramPWA/dist/1862.4470e79ddfa92320d6aa.js
Alexander Zinchuk 560a29b619 [Build]
2026-06-01 02:06:10 +02:00

2 lines
668 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{"use strict";var e,t,s={11862(e,t,s){var n={};s.r(n),s.d(n,{Type:()=>Jc,cleanup:()=>tu,clear:()=>eu,fetch:()=>Xc,isCacheApiSupported:()=>$c,purgeClearableCache:()=>su,remove:()=>Zc,save:()=>Yc});var a={};s.r(a),s.d(a,{abortChatRequests:()=>Cu,abortRequestGroup:()=>Mu,acceptBotUrlAuth:()=>vm,acceptCall:()=>iy,acceptLinkUrlAuth:()=>Cm,acceptPhoneCall:()=>e_,activateStealthMode:()=>I_,addChatMembers:()=>ef,allowBotSendMessages:()=>km,answerCallbackButton:()=>dm,appendPollAnswer:()=>fg,appendTodoList:()=>Ff,applyBoost:()=>U_,applyGiftCode:()=>F_,blockUser:()=>Ph,broadcastLocalDbUpdateFull:()=>Qs,buildApiAccountDays:()=>Hu,buildApiAccountDaysTTL:()=>Lu,changeSessionSettings:()=>Gu,changeSessionTtl:()=>Fu,changeStarsSubscription:()=>eb,checkBotDownloadFileParams:()=>Dm,checkChatInvite:()=>Zl,checkChatUsername:()=>Zp,checkChatlistInvite:()=>lf,checkGiftCode:()=>G_,checkPassword:()=>Zu,checkSearchPostsFlood:()=>cg,checkUrlAuthMatchCode:()=>Mm,checkUsername:()=>ph,clearPassword:()=>el,clearRecentReactions:()=>Sy,clearRecentStickers:()=>Tp,clickSponsoredMessage:()=>kg,closePoll:()=>pg,composeMessageWithAI:()=>$g,confirmCall:()=>oy,confirmPhoneCall:()=>Zy,convertStarGift:()=>$_,craftStarGift:()=>yb,createAiTone:()=>Qg,createChalistInvite:()=>hf,createChannel:()=>ml,createGroupCall:()=>Qm,createGroupChat:()=>Cl,createPhoneCallState:()=>Ky,createTopic:()=>bb,deactivateAllUsernames:()=>th,declineUrlAuth:()=>Am,decodePhoneCallData:()=>Xy,deleteAiTone:()=>Xg,deleteChannel:()=>Pl,deleteChat:()=>bl,deleteChatFolder:()=>El,deleteChatMember:()=>tf,deleteChatUser:()=>_l,deleteChatlistInvite:()=>mf,deleteContact:()=>up,deleteExportedChatInvite:()=>oh,deleteHistory:()=>Kf,deleteMessages:()=>Of,deleteParticipantHistory:()=>jf,deletePasskey:()=>rm,deleteProfilePhotos:()=>Sh,deleteRevokedExportedChatInvites:()=>rh,deleteSavedHistory:()=>$f,deleteScheduledMessages:()=>zf,deleteStory:()=>u_,deleteTopic:()=>Ib,destroy:()=>mu,destroyPhoneCallState:()=>Jy,discardCall:()=>ty,discardGroupCall:()=>Om,disconnect:()=>yu,dismissSuggestion:()=>Db,downloadMedia:()=>Iu,drainPhoneCallSignalingData:()=>Yy,editChatCreator:()=>vl,editChatFolder:()=>Ul,editChatParticipantRank:()=>Wf,editChatPhoto:()=>Ml,editChatlistInvite:()=>yf,editExportedChatInvite:()=>ah,editGroupCallParticipant:()=>jm,editGroupCallTitle:()=>Wm,editMessage:()=>Vf,editStoryPrivacy:()=>y_,editTodo:()=>Gf,editTopic:()=>Pb,encodePhoneCallData:()=>Qy,exportChatInvite:()=>ih,exportGroupCallInvite:()=>zm,exportMessageLink:()=>Wg,faveSticker:()=>Rp,fetchAccountTTL:()=>Ou,fetchAiComposeTones:()=>Jg,fetchAiTone:()=>Zg,fetchAiToneExample:()=>ep,fetchAlbumStories:()=>P_,fetchAlbums:()=>v_,fetchAllStories:()=>s_,fetchAnimatedEmojiEffects:()=>Ep,fetchAnimatedEmojis:()=>Up,fetchAppConfig:()=>kb,fetchAuthorizations:()=>Mh,fetchAvailableEffects:()=>fy,fetchAvailableReactions:()=>ly,fetchBlockedUsers:()=>vh,fetchBoostList:()=>x_,fetchBoostStatus:()=>E_,fetchBotApp:()=>hm,fetchBotCanSendMessage:()=>Rm,fetchBotsRecommendations:()=>Vm,fetchCallConfig:()=>dy,fetchChannelMonetizationStatistics:()=>Cy,fetchChannelRecommendations:()=>wf,fetchChannelStatistics:()=>Py,fetchChat:()=>ll,fetchChatFolders:()=>Tl,fetchChatInviteImporters:()=>dh,fetchChatlistInvites:()=>_f,fetchChats:()=>il,fetchCheckCanSendGift:()=>L_,fetchCollectibleEmojiStatuses:()=>Hp,fetchCollectionInfo:()=>H_,fetchCommonChats:()=>np,fetchConfig:()=>Tb,fetchContactList:()=>op,fetchContactSignUpSetting:()=>Uh,fetchContentSettings:()=>$h,fetchCountryList:()=>Zh,fetchCraftStarGifts:()=>mb,fetchCurrentUser:()=>Au,fetchCustomEmoji:()=>Dp,fetchCustomEmojiSets:()=>Ip,fetchDefaultStatusEmojis:()=>qp,fetchDefaultTagReactions:()=>wy,fetchDefaultTopicIcons:()=>Np,fetchDiceStickers:()=>Gp,fetchDiscussionMessage:()=>ig,fetchEmojiKeywords:()=>Qp,fetchExportedChatInvites:()=>nh,fetchExtendedMedia:()=>mg,fetchFactChecks:()=>sg,fetchFavoriteStickers:()=>Cp,fetchFeaturedEmojiStickers:()=>Ap,fetchFeaturedStickers:()=>Mp,fetchFullChat:()=>dl,fetchFullUser:()=>sp,fetchFutureCreatorAfterLeave:()=>wl,fetchGenericEmojiEffects:()=>xp,fetchGiveawayInfo:()=>V_,fetchGlobalPrivacySettings:()=>em,fetchGroupCallParticipants:()=>Km,fetchGroupStatistics:()=>My,fetchGroupsForDiscussion:()=>Ql,fetchInlineBotResults:()=>cm,fetchLangDifference:()=>Fh,fetchLangPack:()=>Gh,fetchLangStrings:()=>Hh,fetchLanguage:()=>qh,fetchLanguages:()=>Nh,fetchLeaveChatlistSuggestions:()=>gf,fetchMember:()=>Jl,fetchMembers:()=>$l,fetchMessage:()=>kf,fetchMessagePublicForwards:()=>Ry,fetchMessageReactions:()=>hy,fetchMessageReactionsList:()=>my,fetchMessageStatistics:()=>Ay,fetchMessageSummary:()=>Ng,fetchMessageViews:()=>tg,fetchMessages:()=>Rf,fetchMessagesById:()=>Tf,fetchMonetizationRevenueWithdrawalUrl:()=>Dy,fetchMyBoosts:()=>D_,fetchNearestCountry:()=>ip,fetchNotificationExceptions:()=>Dh,fetchNotifyDefaultSettings:()=>Eh,fetchOutboxReadDate:()=>Lg,fetchPaidMessagesRevenue:()=>fp,fetchPaidMessagesStarsAmount:()=>ap,fetchPaidReactionPrivacy:()=>ng,fetchPasskeys:()=>am,fetchPeerColors:()=>Qh,fetchPeerProfileColors:()=>Xh,fetchPeerProfileStories:()=>a_,fetchPeerSettings:()=>cl,fetchPeerStories:()=>n_,fetchPeerStoriesByIds:()=>o_,fetchPinnedDialogs:()=>Bl,fetchPinnedMessages:()=>vg,fetchPopularAppBots:()=>xm,fetchPremiumGifts:()=>Vp,fetchPremiumPromo:()=>T_,fetchPreparedInlineMessage:()=>zg,fetchPreviewMedias:()=>Bm,fetchPrivacySettings:()=>Oh,fetchProfilePhotos:()=>gp,fetchPromoData:()=>Bb,fetchQuickReplies:()=>Og,fetchRecentEmojiStatuses:()=>Xp,fetchRecentReactions:()=>by,fetchRecentStickers:()=>Pp,fetchRecommendedChatFolders:()=>Dl,fetchResaleGifts:()=>W_,fetchSavedChats:()=>ol,fetchSavedGifs:()=>Op,fetchSavedReactionTags:()=>Iy,fetchSavedStarGifts:()=>z_,fetchScheduledHistory:()=>wg,fetchSeenBy:()=>Pg,fetchSendAs:()=>Cg,fetchSponsoredMessages:()=>Ag,fetchSponsoredPeer:()=>vf,fetchStarGiftActiveAuctions:()=>rb,fetchStarGiftAuctionAcquiredGifts:()=>ob,fetchStarGiftAuctionState:()=>ib,fetchStarGiftCollections:()=>pb,fetchStarGiftUpgradeAttributes:()=>_b,fetchStarGiftUpgradePreview:()=>ab,fetchStarGiftWithdrawalUrl:()=>gb,fetchStarGifts:()=>j_,fetchStarsGiftOptions:()=>J_,fetchStarsGiveawayOptions:()=>O_,fetchStarsStatus:()=>Q_,fetchStarsSubscriptions:()=>Z_,fetchStarsTopupOptions:()=>sb,fetchStarsTransactionById:()=>Y_,fetchStarsTransactions:()=>X_,fetchStatisticsAsyncGraph:()=>ky,fetchStickerSets:()=>vp,fetchStickers:()=>Bp,fetchStickersForEmoji:()=>Jp,fetchStoriesArchive:()=>i_,fetchStoriesMaxIds:()=>b_,fetchStoriesViews:()=>p_,fetchStoryLink:()=>h_,fetchStoryPublicForwards:()=>By,fetchStoryStatistics:()=>Ty,fetchStoryViewList:()=>g_,fetchTemporaryPaymentPassword:()=>B_,fetchTimezones:()=>Yh,fetchTonGifts:()=>Fp,fetchTopPeers:()=>bp,fetchTopReactions:()=>_y,fetchTopicById:()=>wb,fetchTopics:()=>Sb,fetchUniqueStarGift:()=>nb,fetchUniqueStarGiftValueInfo:()=>fb,fetchUnreadMentions:()=>Eg,fetchUnreadPollVotes:()=>Vg,fetchUnreadReactions:()=>xg,fetchUsers:()=>rp,fetchWallpapers:()=>wh,fetchWebAuthorizations:()=>kh,fetchWebPagePreview:()=>ug,findFirstMessageIdAfterDate:()=>Sg,forwardApiMessages:()=>_g,forwardMessages:()=>bg,forwardMessagesLocal:()=>yg,fulfillStarsSubscription:()=>tb,getChatByPhoneNumber:()=>Fl,getChatByUsername:()=>Nl,getDhConfig:()=>ey,getGroupCall:()=>Lm,getPassword:()=>Yu,getPasswordInfo:()=>Ju,getPaymentForm:()=>R_,getPremiumGiftCodeOptions:()=>N_,getReceipt:()=>k_,getTemporaryPaymentPassword:()=>Xu,hideAllChatJoinRequests:()=>uh,hideChatJoinRequest:()=>ch,hidePeerSettingsBar:()=>lh,importChatInvite:()=>of,importContact:()=>dp,incrementLocalMessagesCounter:()=>Kg,initPasskeyRegistration:()=>im,installStickerSet:()=>Wp,invokeWebViewCustomMethod:()=>Tm,joinChannel:()=>yl,joinChatlistInvite:()=>ff,joinGroupCall:()=>Jm,joinGroupCallPresentation:()=>Xm,launchPrepaidGiveaway:()=>q_,leaveChannel:()=>Sl,leaveChatlist:()=>pf,leaveGroupCall:()=>$m,leaveGroupCallPresentation:()=>Zm,loadAttachBot:()=>Sm,loadAttachBots:()=>bm,loadPollOptionResults:()=>hg,markMessageListRead:()=>Zf,markMessagesRead:()=>eg,markStoryRead:()=>c_,migrateChat:()=>Yl,oldFetchLangPack:()=>Lh,pinMessage:()=>Hf,prolongWebView:()=>ym,provideAuthCode:()=>Gc,provideAuthPassword:()=>Fc,provideAuthPhoneNumber:()=>Vc,provideAuthRegistration:()=>Nc,provideRecoveryEmailCode:()=>nl,readAllMentions:()=>Bg,readAllPollVotes:()=>Ug,readAllReactions:()=>Dg,receivedCall:()=>ay,registerDevice:()=>jh,registerPasskey:()=>om,removeRecentSticker:()=>kp,reorderUsernames:()=>nm,repairFileReference:()=>ku,reportChannelSpam:()=>Xf,reportMessages:()=>Qf,reportMessagesDelivery:()=>ag,reportPeer:()=>xu,reportProfilePhoto:()=>Vu,reportSpam:()=>pp,reportSponsoredMessage:()=>Tg,reportStory:()=>m_,requestAppWebView:()=>mm,requestBotUrlAuth:()=>Im,requestCall:()=>sy,requestChannelDifference:()=>Uu,requestChatUpdate:()=>fl,requestLinkUrlAuth:()=>Pm,requestMainWebView:()=>gm,requestPhoneCall:()=>t_,requestSimpleWebView:()=>pm,requestWebView:()=>fm,rescheduleMessage:()=>Nf,resetTopPeerRating:()=>Sp,resolveBusinessChatLink:()=>Nu,resolveStarGiftOffer:()=>hb,restartAuth:()=>qc,restartAuthWithPasskey:()=>Lc,restartAuthWithQr:()=>Hc,saveAiTone:()=>tp,saveCloseFriends:()=>mp,saveDefaultSendAs:()=>Mg,saveDraft:()=>gl,saveGif:()=>jp,saveStarGift:()=>K_,searchChats:()=>ul,searchGifs:()=>$p,searchMessagesGlobal:()=>rg,searchMessagesInChat:()=>og,searchPublicPosts:()=>dg,searchStickers:()=>Lp,sendApiMessage:()=>Uf,sendEmojiInteraction:()=>uy,sendInlineBotResult:()=>um,sendMessage:()=>Ef,sendMessageAction:()=>Yf,sendMessageLocal:()=>Df,sendPaidReaction:()=>py,sendPaymentForm:()=>M_,sendPollVote:()=>lg,sendQuickReply:()=>jg,sendReaction:()=>gy,sendScheduledMessages:()=>Ig,sendSignalingData:()=>ry,sendStarPaymentForm:()=>A_,sendStoryReaction:()=>w_,sendWatchingEmojiInteraction:()=>cy,sendWebViewData:()=>_m,setAccountMainProfileTab:()=>Wu,setAccountTTL:()=>ju,setAllowHttpTransport:()=>Bu,setBotInfo:()=>Em,setCallRating:()=>ny,setChannelMainProfileTab:()=>Cf,setChatEnabledReactions:()=>rf,setChatUsername:()=>eh,setDefaultReaction:()=>yy,setDiscussionGroup:()=>Xl,setForceHttpTransport:()=>Tu,setOpenedChannelIds:()=>Eu,setPhoneCallSctpEnabled:()=>$y,setPrivacySettings:()=>zh,setShouldDebugExportedSenders:()=>Du,setViewForumAsMessages:()=>Sf,sortChatFolders:()=>xl,startBot:()=>lm,terminateAllAuthorizations:()=>Rh,terminateAllWebAuthorizations:()=>Bh,terminateAuthorization:()=>Ah,terminateWebAuthorization:()=>Th,toggleAttachBot:()=>wm,toggleAutoTranslation:()=>Pf,toggleChatArchived:()=>kl,toggleChatPinned:()=>Al,toggleDialogFilterTags:()=>Vl,toggleDialogUnread:()=>Gl,toggleForum:()=>uf,toggleGroupCallStartSubscription:()=>Ym,toggleIsProtected:()=>df,toggleJoinRequest:()=>nf,toggleJoinToSend:()=>sf,toggleNoForwards:()=>_p,toggleNoPaidMessagesException:()=>lp,toggleParticipantsHidden:()=>cf,togglePeerTranslations:()=>bf,togglePinnedTopic:()=>vb,togglePreHistoryHidden:()=>Hl,toggleSavedDialogPinned:()=>Rl,toggleSavedGiftPinned:()=>ub,toggleSignatures:()=>Kl,toggleSponsoredMessages:()=>qu,toggleStoriesHidden:()=>__,toggleStoryInProfile:()=>l_,toggleStoryPinnedToTop:()=>f_,toggleSuggestedPostApproval:()=>Jf,toggleTodoCompleted:()=>gg,toggleUserEmojiStatusPermission:()=>Um,toggleUsername:()=>sm,transcribeAudio:()=>Gg,transferStarGift:()=>cb,translateText:()=>Fg,unblockUser:()=>Ch,uninstallStickerSet:()=>zp,unpinAllMessages:()=>Lf,unregisterDevice:()=>Wh,updateAiTone:()=>Yg,updateBirthday:()=>mh,updateChatAbout:()=>zl,updateChatAdmin:()=>jl,updateChatDefaultBannedRights:()=>Ll,updateChatMemberBannedRights:()=>Ol,updateChatNotifySettings:()=>pl,updateChatTitle:()=>Wl,updateContact:()=>cp,updateContactNote:()=>yp,updateContactSignUpNotification:()=>xh,updateContentSettings:()=>Jh,updateEmojiStatus:()=>hp,updateGlobalPrivacySettings:()=>tm,updateIsOnline:()=>Kh,updateNotificationSettings:()=>Vh,updatePaidMessagesPrice:()=>If,updatePassword:()=>tl,updatePrivateLink:()=>sh,updateProfile:()=>gh,updateProfilePhoto:()=>yh,updateRecoveryEmail:()=>sl,updateSavedReactionTag:()=>vy,updateStarGiftPrice:()=>lb,updateTopicMutedState:()=>hl,updateUsername:()=>hh,upgradeStarGift:()=>db,uploadContactProfilePhoto:()=>bh,uploadProfilePhoto:()=>_h,uploadWallpaper:()=>Ih,validateRequestedInfo:()=>C_,verifyTransferOwnership:()=>Il,viewSponsoredMessage:()=>Rg,viewStory:()=>d_});const i="account",o="tt-media",r="tt-media-avatars",d=("undefined"!=typeof window&&window.innerHeight,2**31-1),c=d,u=Math.round(450),l=new Set(["newMessage","newScheduledMessage","deleteMessages","deleteScheduledMessages","deleteHistory","deleteParticipantHistory"]),f=(new Set(["svg","svgz"]),"video/webm"),g="image/gif",p=f,h=new Set(["image/png","image/jpeg",g]),m=new Set(["video/mp4","video/quicktime"]),y=new Set(["audio/mp3","audio/ogg","audio/wav","audio/mpeg","audio/flac","audio/aac","audio/m4a","audio/mp4","audio/x-m4a"]),_=(new Set([...h,...m]),"application/x-tgstoryboard"),b="MESSAGE_ID_REQUIRED",S=new Set(["USERNAME_PURCHASE_AVAILABLE","USERNAME_INVALID"]),w=(new Set(["t.me","web.t.me","a.t.me","k.t.me","z.t.me"]),"weba"),I="weba",v=(new Set(["AU","BD","CA","CO","EG","HN","IE","IN","JO","MX","MY","NI","NZ","PH","PK","SA","SV","US"]),"777000"),P=10n**12n,C=(-1000000000777n).toString(),M=["13.0.0"],A=(new Set(["USER_CANCELED"]),["log","error","warn","info","debug"]);function R(e,t,s=!0){let n,a,i;return(...o)=>{a=!0,i=o,n||(s&&(a=!1,e(...i)),n=self.setInterval(()=>{if(!a)return self.clearInterval(n),void(n=void 0);a=!1,e(...i)},t))}}function k(e){return function(e,t){let s,n=!1;return(...a)=>{s=a,n||(n=!0,e(()=>{n=!1,t(...s)}))}}(B,e)}let T;function B(e){T?T.push(e):(T=[e],Promise.resolve().then(()=>{const e=T;T=void 0,e.forEach(e=>e())}))}A.reduce((e,t)=>(e[t]=console[t],e),{});var D=s(7692),U=s(48287).hp;class E{constructor(e){this.counter=U.from(e)}increment(){for(let e=15;e>=0;e--){if(255!==this.counter[e]){this.counter[e]++;break}this.counter[e]=0}}}class x{constructor(e,t){t instanceof E||(t=new E(t)),this._counter=t,this._carryBlock=void 0,this._carryOffset=0,this._aes=new D.Ay(e)}update(e){return this.encrypt(e)}encrypt(e){const t=this._aes,s=this._counter,n=e,a=n.length,i=U.allocUnsafe(a);let o=0;if(this._carryBlock){const e=Math.min(16-this._carryOffset,a);for(let t=0;t<e;t++)i[o+t]=n[o+t]^this._carryBlock[this._carryOffset+t];o+=e,this._carryOffset+=e,16===this._carryOffset&&(this._carryBlock=void 0,this._carryOffset=0)}const r=U.allocUnsafe(16);for(;o+16<=a;){N(t.encrypt(s.counter),r),s.increment();for(let e=0;e<16;e++)i[o+e]=n[o+e]^r[e];o+=16}if(o<a){N(t.encrypt(s.counter),r),s.increment();let e=0;for(;o<a;o++,e++)i[o]=n[o]^r[e];this._carryBlock=r,this._carryOffset=e}return i}}function V(e){const t=new Uint8Array(e);return crypto.getRandomValues(t),t}class G{data=new Uint8Array(0);constructor(e){this.algorithm=e}update(e){this.data=new Uint8Array(e)}async digest(){return"sha1"===this.algorithm?U.from(await self.crypto.subtle.digest("SHA-1",this.data)):U.from(await self.crypto.subtle.digest("SHA-256",this.data))}}function F(e){return new G(e)}function N(e,t){for(let s=0;s<e.length;s++)t.writeUInt32BE(e[s],4*s)}var q=s(48287).hp;function H(e,t=!0,s=!1){const n=e.length;if(0===n)return 0n;if(8===n)return s?t?e.readBigInt64LE(0):e.readBigInt64BE(0):t?e.readBigUInt64LE(0):e.readBigUInt64BE(0);let a=0n;if(t)for(let t=n-1;t>=0;t--)a=a<<8n|BigInt(e[t]);else for(let t=0;t<n;t++)a=a<<8n|BigInt(e[t]);return s&&0n!=(a&1n<<BigInt(8*n-1))&&(a-=1n<<BigInt(8*n)),a}function L(e,t=8){const s=q.allocUnsafe(t);if(8===t)return s.writeBigInt64LE(e),s;for(let n=0;n<t;n++)s[n]=Number(e>>BigInt(8*n)&0xFFn);return s}function O(e,t,s=!0,n=!1){if(!Number.isInteger(t)||t<=0)throw new RangeError("bytesNumber must be a positive integer");if(!n&&e<0n)throw new RangeError("Cannot convert negative to unsigned");const a=8n*BigInt(t);if(e<(n?-(1n<<a-1n):0n)||e>(n?(1n<<a-1n)-1n:(1n<<a)-1n))throw new RangeError(`Value ${e} does not fit in ${t} ${n?"signed":"unsigned"} bytes`);let i=n&&e<0n?(1n<<a)+e:e;const o=q.allocUnsafe(t);if(s)for(let e=0;e<t;e++)o[e]=Number(0xFFn&i),i>>=8n;else for(let e=t-1;e>=0;e--)o[e]=Number(0xFFn&i),i>>=8n;return o}function j(e,t){return(e%t+t)%t}function W(e){return q.from(V(e))}function z(e=8){return H(W(e),!0,!0)}function K(){return Number(H(W(4),!0,!0))}function $(e){const t=q.allocUnsafe(4*e.length);for(let s=0;s<e.length;s++)t.writeUInt32BE(e[s],4*s);return t}function J(e){const t=F("sha1");return t.update(e),t.digest()}function Q(e){const t=F("sha256");return t.update(e),t.digest()}function X(e,t,s){let n=1n,a=e%=s;for(;t>0n;){const e=t%2n;t/=2n,1n===e&&(n*=a,n%=s),a*=a,a%=s}return n}function Y(e,t=!1){if(!t&&e<0n)throw new RangeError("Cannot convert negative to unsigned");let s;if(t)if(e>=0n){const t=ce(e)+1;s=Math.max(1,Math.ceil(t/8))}else{const t=ce(-e-1n)+1;s=Math.max(1,Math.ceil(t/8))}else{const t=ce(e);s=Math.max(1,Math.ceil(t/8))}return O(e,s,!1,t)}function Z(e){if(e<=0)return 0n;const t=V(Math.ceil(e/8));let s=0n;for(let e=0;e<t.length;e++)s=s<<8n|BigInt(t[e]);return s&(1n<<BigInt(e))-1n}function ee(e,t){const s=e<t?e:t,n=(e<t?t:e)-s+1n;if(n<=1n)return s;const a=ce(n-1n),i=(1n<<BigInt(a))/n*n;for(;;){const e=Z(a);if(e<i)return s+e%n}}function te(e){return new Promise(t=>{setTimeout(t,e)})}function se(e,t){const s=[];for(let n=0;n<e.length;n++)s.push(e[n]^t[n]);return q.from(s)}const ne=(()=>{let e;const t=[];for(let s=0;s<256;s++){e=s;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;t[s]=e}return t})();function ae(e){q.isBuffer(e)||(e=q.from(e));let t=-1;for(let s=0;s<e.length;s++){const n=e[s];t=ne[255&(t^n)]^t>>>8}return(-1^t)>>>0}const ie=[],oe=[],re=[];let de=0;function ce(e){let t=0;for(;de===t&&(ie.push(32<<de),oe.push(BigInt(ie[de])),re.push(1n<<oe[de]),de++),!(e<re[t]);)t++;if(!t)return 32-Math.clz32(Number(e));t--;let s=ie[t],n=e>>oe[t];for(;t--;){const e=n>>oe[t];e&&(s+=ie[t],n=e)}return s+32-Math.clz32(Number(n))}const ue={abs:e=>e<0n?-e:e,sign:e=>0n===e?0n:e<0n?-1n:1n,pow:(e,t)=>e**t,min(e,...t){for(const s of t)s<e&&(e=s);return e},max(e,...t){for(const s of t)s>e&&(e=s);return e}};var le=s(48287).hp;const fe=e=>e.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_","")),ge=new Set([3162085175,2574415285,1072550713,3300522427,1450380236]),pe=new Set([85337187,2211011308,2851430293,1013613780,1459478408,3504867164,3045658042,1715713620,3608339646,4110704415,812830625]),he=(e,t,s=[])=>{e.flags.includes("g")||(e=new RegExp(e.source,"g"));const n=e.exec(t);return n&&(s.push(n.slice(1)),he(e,t,s)),s},me=(e,t)=>{const s=e.match(/([\w.]+)(?:#([0-9a-fA-F]+))?(?:\s{?\w+:[\w\d<>#.?!]+}?)*\s=\s([\w\d<>#.?]+);$/);if(!s)throw new Error(`Cannot parse TLObject ${e}`);const n=he(/({)?(\w+):([\w\d<>#.?!]+)}?/,e),a={name:s[1],constructorId:parseInt(s[2],16),argsConfig:{},subclassOfId:ae(s[3]),result:s[3],isFunction:t,namespace:void 0};if(!a.constructorId){const e="";let t;t=Object.values(a.argsConfig).length?` ${Object.keys(a.argsConfig).map(e=>e.toString()).join(" ")}`:"";const s=`${a.name}${e}${t} = ${a.result}`.replace(/(:|\?)bytes /g,"$1string ").replace(/</g," ").replace(/>|{|}/g,"").replace(/ \w+:flags\d*\.\d+\?true/g,"");"inputMediaInvoice"===a.name&&a.name,a.constructorId=ae(le.from(s,"utf8"))}for(const[e,t,s]of n)void 0===e&&(a.argsConfig[fe(t)]=ye(t,s));return a.name.includes(".")&&([a.namespace,a.name]=a.name.split(/\.(.+)/)),a.name=a.name.replace(/(?:^|_)([a-z])/g,(e,t)=>t.toUpperCase()).replace(/_/g,""),a};function ye(e,t){e="self"===e?"is_self":e;const s={isVector:!1,isFlag:!1,skipConstructorId:!1,flagGroup:0,flagIndex:-1,flagIndicator:!0,type:"",useVectorId:void 0};if("#"!==t){s.flagIndicator=!1,s.type=t.replace(/^!+/,"");const e=s.type.match(/flags(\d*)\.(\d+)\?([\w<>.]+)/);e&&(s.isFlag=!0,s.flagGroup=Number(e[1]||1),s.flagIndex=Number(e[2]),[,,,s.type]=e);const n=s.type.match(/[Vv]ector<([\w\d.]+)>/);n&&(s.isVector=!0,s.useVectorId="V"===s.type.charAt(0),[,s.type]=n),/^[a-z]$/.test(s.type.split(".").pop().charAt(0))&&(s.skipConstructorId=!0)}return s}function _e(e){if(!(e instanceof le)){if("string"!=typeof e)throw Error(`Bytes or str expected, not ${e.constructor.name}`);e=le.from(e)}const t=[];let s;return e.length<254?(s=(e.length+1)%4,0!==s&&(s=4-s),t.push(le.from([e.length])),t.push(e)):(s=e.length%4,0!==s&&(s=4-s),t.push(le.from([254,e.length%256,(e.length>>8)%256,(e.length>>16)%256])),t.push(e)),t.push(le.alloc(s).fill(0)),le.concat(t)}var be=s(48287).hp;const Se="undefined"!=typeof self&&void 0!==self.localStorage,we="GramJs:apiCache";function Ie(e){const t=function*(e,t=[],s=ge){(t||[]).reduce((e,t)=>({...e,[t.name]:t}),{});const n=[],a={},i={},o=e;let r=!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;r="functions"===e;continue}try{const t=me(e,r);if(s.has(t.constructorId))continue;n.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 n)if(pe.has(e.constructorId))for(const t in e.argsConfig)"string"===e.argsConfig[t].type&&(e.argsConfig[t].type="bytes");for(const e of n)yield e}(e),s=[],n=[];for(const e of t)e.isFunction?n.push(e):s.push(e);return[s,n]}function ve(e,t){switch(t){case"int":{const t=be.alloc(4);return t.writeInt32LE(e,0),t}case"long":return L(e,8);case"int128":return L(e,16);case"int256":return L(e,32);case"double":{const t=be.alloc(8);return t.writeDoubleLE(e,0),t}case"string":case"bytes":return _e(e);case"Bool":return e?be.from("b5757299","hex"):be.from("379779bc","hex");case"true":return be.alloc(0);case"date":return function(e){if(!e)return le.alloc(4).fill(0);if(e instanceof Date&&(e=Math.floor((Date.now()-e.getTime())/1e3)),"number"==typeof e){const t=le.alloc(4);return t.writeInt32LE(e,0),t}throw Error(`Cannot interpret "${e}" as a date`)}(e);default:return e.getBytes()}}function Pe(e,t){if(t.isVector){t.useVectorId&&e.readInt();const s=[],n=e.readInt();t.isVector=!1;for(let a=0;a<n;a++)s.push(Pe(e,t));return t.isVector=!0,s}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 Ce(e,t){const s={};for(const n of t){const{name:t,constructorId:a,subclassOfId:i,argsConfig:o,namespace:r,result:d}=n,c=[r,t].join(".").replace(/^\./,"");class u{static CONSTRUCTOR_ID=a;static SUBCLASS_OF_ID=i;static className=c;static classType=e;CONSTRUCTOR_ID=a;SUBCLASS_OF_ID=i;className=c;classType=e;constructor(e){e=e||{},Object.keys(e).forEach(t=>{this[t]=e[t]})}static fromReader(e){const t={};for(const s in o)if(o.hasOwnProperty(s)){const n=o[s];if(n.isFlag){const a=t[`flags${n.flagGroup>1?n.flagGroup:""}`]&1<<n.flagIndex;if("true"===n.type){t[s]=!!a||void 0;continue}t[s]=a?Pe(e,n):void 0}else t[s]=Pe(e,n)}return new u(t)}getBytes(){const e=this.CONSTRUCTOR_ID,t=be.alloc(4);t.writeUInt32LE(e,0);const s=[t];for(const e in o)if(o.hasOwnProperty(e)){if(o[e].isFlag&&(!1===this[e]&&"true"===o[e].type||void 0===this[e]))continue;if(o[e].isVector){o[e].useVectorId&&s.push(be.from("15c4b51c","hex"));const t=be.alloc(4);t.writeInt32LE(this[e].length,0),s.push(t,be.concat(this[e].map(t=>ve(t,o[e].type))))}else if(o[e].flagIndicator)if(Object.values(o).some(e=>e.isFlag)){let e=0;for(const t in o)o[t].isFlag&&(!1===this[t]&&"true"===o[t].type||void 0===this[t]?e|=0:e|=1<<o[t].flagIndex);const t=be.alloc(4);t.writeUInt32LE(e,0),s.push(t)}else s.push(be.alloc(4));else if(s.push(ve(this[e],o[e].type)),this[e]&&"function"==typeof this[e].getBytes){const t=o[e].type.charAt(o[e].type.indexOf(".")+1);t===t.toUpperCase()||s.shift()}}return be.concat(s)}readResult(t){if("request"!==e)throw new Error("`readResult()` called for non-request instance");const s=d.match(/Vector<(int|long)>/);if(s){t.readInt();const e=[],n=t.readInt();if("int"===s[1])for(let s=0;s<n;s++)e.push(t.readInt());else for(let s=0;s<n;s++)e.push(t.readLong());return e}return t.tgReadObject()}}r?(s[r]||(s[r]={}),s[r][t]=u):s[t]=u}return s}const Me=function(){let e;const t=Se&&function(){const e=localStorage.getItem(we);return e&&JSON.parse(e)}();return t?e=t:(e=function(){const[e,t]=Ie("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#6a1dc4be flags:# client_id:long phone:string first_name:string last_name:string note:flags.0?TextWithEntities = InputContact;\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\ninputFileStoryDocument#62dc8b48 id:InputDocument = InputFile;\ninputMediaEmpty#9664f57f = InputMedia;\ninputMediaUploadedPhoto#7d8375da flags:# spoiler:flags.2?true live_photo:flags.3?true file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int video:flags.3?InputDocument = InputMedia;\ninputMediaPhoto#e3af4434 flags:# spoiler:flags.1?true live_photo:flags.2?true id:InputPhoto ttl_seconds:flags.0?int video:flags.2?InputDocument = InputMedia;\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\ninputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;\ninputMediaUploadedDocument#37c9330 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> video_cover:flags.6?InputPhoto video_timestamp:flags.7?int ttl_seconds:flags.1?int = InputMedia;\ninputMediaDocument#a8763ab5 flags:# spoiler:flags.2?true id:InputDocument video_cover:flags.3?InputPhoto video_timestamp:flags.4?int 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#779600f9 flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int video_cover:flags.2?InputPhoto video_timestamp:flags.3?int = InputMedia;\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\ninputMediaInvoice#405fef0d flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:flags.3?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#883a4108 flags:# poll:Poll correct_answers:flags.0?Vector<int> attached_media:flags.3?InputMedia solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> solution_media:flags.2?InputMedia = InputMedia;\ninputMediaDice#e66fbf7b emoticon:string = InputMedia;\ninputMediaStory#89fdd778 peer:InputPeer id:int = InputMedia;\ninputMediaWebPage#c21b8849 flags:# force_large_media:flags.0?true force_small_media:flags.1?true optional:flags.2?true url:string = InputMedia;\ninputMediaPaidMedia#c4103386 flags:# stars_amount:long extended_media:Vector<InputMedia> payload:flags.0?string = InputMedia;\ninputMediaTodo#9fc55fde todo:TodoList = InputMedia;\ninputMediaStakeDice#f3a9244a game_hash:string ton_amount:long client_seed:bytes = 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#31774388 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 contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true bot_forum_view:flags2.16?true bot_forum_can_manage_topics:flags2.17?true bot_can_manage_bots:flags2.18?true bot_guestchat:flags2.19?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?RecentStory color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = 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#7b197dc8 flags:# by_me:flags.0?true = UserStatus;\nuserStatusLastWeek#541a1d1a flags:# by_me:flags.0?true = UserStatus;\nuserStatusLastMonth#65899777 flags:# by_me:flags.0?true = 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#1c32b11c 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 signature_profiles:flags2.12?true autotranslation:flags2.15?true broadcast_messages_allowed:flags2.16?true monoforum:flags2.17?true forum_tabs:flags2.19?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?RecentStory color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long linked_monoforum_id:flags2.18?long = Chat;\nchannelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true monoforum:flags.10?true id:long access_hash:long title:string until_date:flags.16?int = Chat;\nchatFull#2633421b 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 reactions_limit:flags.20?int = ChatFull;\nchannelFull#e4e0b29d 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 view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true stargifts_available:flags2.19?true paid_messages_available:flags2.20?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 reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification stargifts_count:flags2.18?int send_paid_messages_stars:flags2.21?long main_tab:flags2.22?ProfileTab = ChatFull;\nchatParticipant#38e79fde flags:# user_id:long inviter_id:long date:int rank:flags.0?string = ChatParticipant;\nchatParticipantCreator#e1f867b8 flags:# user_id:long rank:flags.0?string = ChatParticipant;\nchatParticipantAdmin#360d5d2 flags:# user_id:long inviter_id:long date:int rank:flags.0?string = 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#95ef6f2b 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 invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int from_rank:flags2.12?string peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long guestchat_via_from:flags2.19?Peer 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 quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost schedule_repeat_period:flags2.10?int summary_from_language:flags2.11?string = Message;\nmessageService#7a800e0a flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true reactions_are_possible:flags.9?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer saved_peer_id:flags.28?Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction reactions:flags.20?MessageReactions ttl_period:flags.25?int = Message;\nmessageMediaEmpty#3ded6320 = MessageMedia;\nmessageMediaPhoto#e216eb63 flags:# spoiler:flags.3?true live_photo:flags.4?true photo:flags.0?Photo ttl_seconds:flags.2?int video:flags.4?Document = 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#52d8ccd9 flags:# nopremium:flags.3?true spoiler:flags.4?true video:flags.6?true round:flags.7?true voice:flags.8?true document:flags.0?Document alt_documents:flags.5?Vector<Document> video_cover:flags.9?Photo video_timestamp:flags.10?int ttl_seconds:flags.2?int = MessageMedia;\nmessageMediaWebPage#ddf10c3b flags:# force_large_media:flags.0?true force_small_media:flags.1?true manual:flags.3?true safe:flags.4?true 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#773f4e66 flags:# poll:Poll results:PollResults attached_media:flags.0?MessageMedia = MessageMedia;\nmessageMediaDice#8cbec07 flags:# value:int emoticon:string game_outcome:flags.0?messages.EmojiGameOutcome = MessageMedia;\nmessageMediaStory#68cb6283 flags:# via_mention:flags.1?true peer:Peer id:int story:flags.0?StoryItem = MessageMedia;\nmessageMediaGiveaway#aa073beb flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.2?true channels:Vector<long> countries_iso2:flags.1?Vector<string> prize_description:flags.3?string quantity:int months:flags.4?int stars:flags.5?long until_date:int = MessageMedia;\nmessageMediaGiveawayResults#ceaa3ea1 flags:# only_new_subscribers:flags.0?true refunded:flags.2?true channel_id:long additional_peers_count:flags.3?int launch_msg_id:int winners_count:int unclaimed_count:int winners:Vector<long> months:flags.4?int stars:flags.5?long prize_description:flags.1?string until_date:int = MessageMedia;\nmessageMediaPaidMedia#a8852491 stars_amount:long extended_media:Vector<MessageExtendedMedia> = MessageMedia;\nmessageMediaToDo#8a53b014 flags:# todo:TodoList completions:flags.0?Vector<TodoCompletion> = MessageMedia;\nmessageMediaVideoStream#ca5cab89 flags:# rtmp_stream:flags.0?true call:InputGroupCall = 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#ffa00ccc 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 subscription_until_date:flags.4?int = MessageAction;\nmessageActionPaymentSent#c624b16e flags:# recurring_init:flags.2?true recurring_used:flags.3?true currency:string total_amount:long invoice_slug:flags.0?string subscription_until_date:flags.4?int = 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#b91bbd3a theme:ChatTheme = MessageAction;\nmessageActionChatJoinedByRequest#ebbca3cb = MessageAction;\nmessageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction;\nmessageActionWebViewDataSent#b4c38cb5 text:string = MessageAction;\nmessageActionGiftPremium#48e91302 flags:# currency:string amount:long days:int crypto_currency:flags.0?string crypto_amount:flags.0?long message:flags.1?TextWithEntities = MessageAction;\nmessageActionTopicCreate#d999256 flags:# title_missing:flags.1?true 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#31518e9b button_id:int peers:Vector<Peer> = MessageAction;\nmessageActionSetChatWallPaper#5060a3f4 flags:# same:flags.0?true for_both:flags.1?true wallpaper:WallPaper = MessageAction;\nmessageActionGiftCode#31c48347 flags:# via_giveaway:flags.0?true unclaimed:flags.5?true boost_peer:flags.1?Peer days:int slug:string currency:flags.2?string amount:flags.2?long crypto_currency:flags.3?string crypto_amount:flags.3?long message:flags.4?TextWithEntities = MessageAction;\nmessageActionGiveawayLaunch#a80f51e4 flags:# stars:flags.0?long = MessageAction;\nmessageActionGiveawayResults#87e2f155 flags:# stars:flags.0?true winners_count:int unclaimed_count:int = MessageAction;\nmessageActionBoostApply#cc02aa6d boosts:int = MessageAction;\nmessageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector<RequestedPeer> = MessageAction;\nmessageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_amount:long payload:flags.0?bytes charge:PaymentCharge = MessageAction;\nmessageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long crypto_currency:flags.0?string crypto_amount:flags.0?long transaction_id:flags.1?string = MessageAction;\nmessageActionPrizeStars#b00c47a2 flags:# unclaimed:flags.0?true stars:long transaction_id:string boost_peer:Peer giveaway_msg_id:int = MessageAction;\nmessageActionStarGift#ea2c31d3 flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true prepaid_upgrade:flags.13?true upgrade_separate:flags.16?true auction_acquired:flags.17?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long prepaid_upgrade_hash:flags.14?string gift_msg_id:flags.15?int to_id:flags.18?Peer gift_num:flags.19?int = MessageAction;\nmessageActionStarGiftUnique#e6c31522 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true prepaid_upgrade:flags.11?true assigned:flags.13?true from_offer:flags.14?true craft:flags.16?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_amount:flags.8?StarsAmount can_transfer_at:flags.9?int can_resell_at:flags.10?int drop_original_details_stars:flags.12?long can_craft_at:flags.15?int = MessageAction;\nmessageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction;\nmessageActionPaidMessagesPrice#84b88578 flags:# broadcast_messages_allowed:flags.0?true stars:long = MessageAction;\nmessageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector<Peer> = MessageAction;\nmessageActionTodoCompletions#cc7c5c89 completed:Vector<int> incompleted:Vector<int> = MessageAction;\nmessageActionTodoAppendTasks#c7edbc83 list:Vector<TodoItem> = MessageAction;\nmessageActionSuggestedPostApproval#ee7a1596 flags:# rejected:flags.0?true balance_too_low:flags.1?true reject_comment:flags.2?string schedule_date:flags.3?int price:flags.4?StarsAmount = MessageAction;\nmessageActionSuggestedPostSuccess#95ddcf69 price:StarsAmount = MessageAction;\nmessageActionSuggestedPostRefund#69f916f8 flags:# payer_initiated:flags.0?true = MessageAction;\nmessageActionGiftTon#a8a3c699 flags:# currency:string amount:long crypto_currency:string crypto_amount:long transaction_id:flags.0?string = MessageAction;\nmessageActionSuggestBirthday#2c8f2a25 birthday:Birthday = MessageAction;\nmessageActionStarGiftPurchaseOffer#774278d4 flags:# accepted:flags.0?true declined:flags.1?true gift:StarGift price:StarsAmount expires_at:int = MessageAction;\nmessageActionStarGiftPurchaseOfferDeclined#73ada76b flags:# expired:flags.0?true gift:StarGift price:StarsAmount = MessageAction;\nmessageActionNewCreatorPending#b07ed085 new_creator_id:long = MessageAction;\nmessageActionChangeCreator#e188503b new_creator_id:long = MessageAction;\nmessageActionNoForwardsToggle#bf7d6572 prev_value:Bool new_value:Bool = MessageAction;\nmessageActionNoForwardsRequest#3e2793ba flags:# expired:flags.0?true prev_value:Bool new_value:Bool = MessageAction;\nmessageActionPollAppendAnswer#9da1cd6c answer:PollAnswer = MessageAction;\nmessageActionPollDeleteAnswer#399674dc answer:PollAnswer = MessageAction;\nmessageActionManagedBotCreated#16605e3e bot_id:long = MessageAction;\ndialog#fc89f7f3 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?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 unread_poll_votes_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.sentCodePaymentRequired#f8827ebf store_product:string phone_code_hash:string support_email_address:string support_email_subject:string premium_days:int currency:string amount:long = 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#f47741f7 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 business_bot_paused:flags.11?true business_bot_can_reply:flags.12?true geo_distance:flags.6?int request_chat_title:flags.9?string request_chat_date:flags.9?int business_bot_id:flags.13?long business_bot_manage_url:flags.13?string charge_paid_message_stars:flags.14?long registration_month:flags.15?string phone_country:flags.16?string name_change_date:flags.17?int photo_change_date:flags.18?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#6cbe645 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 wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true noforwards_my_enabled:flags2.23?true noforwards_peer_enabled:flags2.24?true unofficial_security_risk:flags2.26?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:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document note:flags2.22?TextWithEntities bot_manager_id:flags2.25?long = 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#1d73e7ea messages:Vector<Message> topics:Vector<ForumTopic> chats:Vector<Chat> users:Vector<User> = messages.Messages;\nmessages.messagesSlice#5f206716 flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int search_flood:flags.3?SearchPostsFlood messages:Vector<Message> topics:Vector<ForumTopic> 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;\ninputMessagesFilterPoll#fa2bc90a = 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#2a17bf5c flags:# user_id:long top_msg_id:flags.0?int 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 invert_media:flags.2?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#9e84bc99 flags:# folder_id:flags.0?int peer:Peer top_msg_id:flags.1?int 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#edfc111e flags:# peer:Peer top_msg_id:flags.0?int saved_peer_id:flags.1?Peer 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#25f324f7 flags:# channel_id:long top_msg_id:flags.0?int saved_peer_id:flags.1?Peer messages:Vector<int> = Update;\nupdateContactsReset#7084a7be = Update;\nupdateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update;\nupdateDialogUnreadMark#b658f23e flags:# unread:flags.0?true peer:DialogPeer saved_peer_id:flags.1?Peer = Update;\nupdateMessagePoll#d64c522b flags:# peer:flags.1?Peer msg_id:flags.1?int top_msg_id:flags.2?int 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#f2a71983 flags:# peer:Peer messages:Vector<int> sent_messages:flags.0?Vector<int> = Update;\nupdateTheme#8216fba3 theme:Theme = Update;\nupdateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;\nupdateLoginToken#564fe691 = Update;\nupdateMessagePollVote#7699f014 poll_id:long peer:Peer options:Vector<bytes> positions:Vector<int> 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#9d2216e0 flags:# live_story:flags.2?true peer:flags.1?Peer 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#1e297bfa flags:# peer:Peer msg_id:int top_msg_id:flags.0?int saved_peer_id:flags.1?Peer 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#d5a41724 peer:Peer msg_id:int extended_media:Vector<MessageExtendedMedia> = Update;\nupdateUser#20529438 user_id:long = Update;\nupdateAutoSaveSettings#ec05b097 = 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;\nupdateBotChatBoost#904dd49c peer:Peer boost:Boost qts:int = Update;\nupdateChannelViewForumAsMessages#7b68920 channel_id:long enabled:Bool = Update;\nupdatePeerWallpaper#ae3f101d flags:# wallpaper_overridden:flags.1?true peer:Peer wallpaper:flags.0?WallPaper = Update;\nupdateBotMessageReaction#ac21d3ce peer:Peer msg_id:int date:int actor:Peer old_reactions:Vector<Reaction> new_reactions:Vector<Reaction> qts:int = Update;\nupdateBotMessageReactions#9cb7759 peer:Peer msg_id:int date:int reactions:Vector<ReactionCount> qts:int = Update;\nupdateSavedDialogPinned#aeaf9e74 flags:# pinned:flags.0?true peer:DialogPeer = Update;\nupdatePinnedSavedDialogs#686c85a6 flags:# order:flags.0?Vector<DialogPeer> = Update;\nupdateSavedReactionTags#39c67432 = Update;\nupdateSmsJob#f16269d4 job_id:string = Update;\nupdateQuickReplies#f9470ab2 quick_replies:Vector<QuickReply> = Update;\nupdateNewQuickReply#f53da717 quick_reply:QuickReply = Update;\nupdateDeleteQuickReply#53e6f1ec shortcut_id:int = Update;\nupdateQuickReplyMessage#3e050d0f message:Message = Update;\nupdateDeleteQuickReplyMessages#566fe7cd shortcut_id:int messages:Vector<int> = Update;\nupdateBotBusinessConnect#8ae5c97a connection:BotBusinessConnection qts:int = Update;\nupdateBotNewBusinessMessage#9ddb347c flags:# connection_id:string message:Message reply_to_message:flags.0?Message qts:int = Update;\nupdateBotEditBusinessMessage#7df587c flags:# connection_id:string message:Message reply_to_message:flags.0?Message qts:int = Update;\nupdateBotDeleteBusinessMessage#a02a982e connection_id:string peer:Peer messages:Vector<int> qts:int = Update;\nupdateNewStoryReaction#1824e40b story_id:int peer:Peer reaction:Reaction = Update;\nupdateStarsBalance#4e80a379 balance:StarsAmount = Update;\nupdateBusinessBotCallbackQuery#1ea2fda7 flags:# query_id:long user_id:long connection_id:string message:Message reply_to_message:flags.2?Message chat_instance:long data:flags.0?bytes = Update;\nupdateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update;\nupdateBotPurchasedPaidMedia#283bd312 user_id:long payload:string qts:int = Update;\nupdatePaidReactionPrivacy#8b725fce private:PaidReactionPrivacy = Update;\nupdateSentPhoneCode#504aa18f sent_code:auth.SentCode = Update;\nupdateGroupCallChainBlocks#a477288f call:InputGroupCall sub_chain_id:int blocks:Vector<bytes> next_offset:int = Update;\nupdateReadMonoForumInbox#77b0e372 channel_id:long saved_peer_id:Peer read_max_id:int = Update;\nupdateReadMonoForumOutbox#a4a79376 channel_id:long saved_peer_id:Peer read_max_id:int = Update;\nupdateMonoForumNoPaidException#9f812b08 flags:# exception:flags.0?true channel_id:long saved_peer_id:Peer = Update;\nupdateGroupCallMessage#d8326f0d call:InputGroupCall message:GroupCallMessage = Update;\nupdateGroupCallEncryptedMessage#c957a766 call:InputGroupCall from_id:Peer encrypted_message:bytes = Update;\nupdatePinnedForumTopic#683b2c52 flags:# pinned:flags.0?true peer:Peer topic_id:int = Update;\nupdatePinnedForumTopics#def143d0 flags:# peer:Peer order:flags.0?Vector<int> = Update;\nupdateDeleteGroupCallMessages#3e85e92c call:InputGroupCall messages:Vector<int> = Update;\nupdateStarGiftAuctionState#48e246c2 gift_id:long state:StarGiftAuctionState = Update;\nupdateStarGiftAuctionUserState#dc58f31e gift_id:long user_state:StarGiftAuctionUserState = Update;\nupdateEmojiGameInfo#fb9c547a info:messages.EmojiGameInfo = Update;\nupdateStarGiftCraftFail#ac072444 = Update;\nupdateChatParticipantRank#bd8367b9 chat_id:long user_id:long rank:string version:int = Update;\nupdateManagedBot#4880ed9a user_id:long bot_id:long qts:int = Update;\nupdateBotGuestChatQuery#cdd4093d flags:# query_id:long message:Message reference_messages:flags.0?Vector<Message> qts:int = Update;\nupdateAiComposeTones#8c0f91fb = 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;\nsendMessageTextDraftAction#376d975c random_id:long text:TextWithEntities = 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;\ninputPrivacyKeyBirthday#d65a11cc = InputPrivacyKey;\ninputPrivacyKeyStarGiftsAutoSave#e1732341 = InputPrivacyKey;\ninputPrivacyKeyNoPaidMessages#bdc597b4 = InputPrivacyKey;\ninputPrivacyKeySavedMusic#4dbe9226 = 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;\nprivacyKeyBirthday#2000a518 = PrivacyKey;\nprivacyKeyStarGiftsAutoSave#2ca4fdf8 = PrivacyKey;\nprivacyKeyNoPaidMessages#17d348d2 = PrivacyKey;\nprivacyKeySavedMusic#ff7a571b = 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;\ninputPrivacyValueAllowPremium#77cdc9f1 = InputPrivacyRule;\ninputPrivacyValueAllowBots#5a4fcce5 = InputPrivacyRule;\ninputPrivacyValueDisallowBots#c4e57915 = 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;\nprivacyValueAllowPremium#ece9814b = PrivacyRule;\nprivacyValueAllowBots#21461b5d = PrivacyRule;\nprivacyValueDisallowBots#f6a5f82f = 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#43c57c48 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 video_start_ts:flags.4?double video_codec:flags.5?string = 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#211a1788 flags:# id:long url:flags.0?string = WebPage;\nwebPagePending#b0d13e47 flags:# id:long url:flags.0?string date:int = WebPage;\nwebPage#e89c45b2 flags:# has_large_media:flags.13?true video_cover_photo:flags.14?true 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#a22cbd96 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 subscription_expired:flags.10?int title:flags.8?string subscription_pricing:flags.9?StarsSubscriptionPricing = ExportedChatInvite;\nchatInvitePublicJoinRequests#ed107ab7 = ExportedChatInvite;\nchatInviteAlready#5a686d7c chat:Chat = ChatInvite;\nchatInvite#5c9d3702 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 can_refulfill_subscription:flags.11?true title:string about:flags.5?string photo:Photo participants_count:int participants:flags.4?Vector<User> color:int subscription_pricing:flags.10?StarsSubscriptionPricing subscription_form_id:flags.12?long bot_verification:flags.13?BotVerification = 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;\ninputStickerSetEmojiChannelDefaultStatuses#49748553 = InputStickerSet;\ninputStickerSetTonGifts#1cf671a0 = InputStickerSet;\nstickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true emojis:flags.7?true text_color:flags.9?true channel_emoji_status:flags.10?true creator:flags.11?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#4d8a0299 flags:# has_preview_medias:flags.6?true 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 privacy_policy_url:flags.7?string app_settings:flags.8?BotAppSettings verifier_settings:flags.9?BotVerifierSettings = BotInfo;\nkeyboardButton#7d170cff flags:# style:flags.10?KeyboardButtonStyle text:string = KeyboardButton;\nkeyboardButtonUrl#d80c25ec flags:# style:flags.10?KeyboardButtonStyle text:string url:string = KeyboardButton;\nkeyboardButtonCallback#e62bc960 flags:# requires_password:flags.0?true style:flags.10?KeyboardButtonStyle text:string data:bytes = KeyboardButton;\nkeyboardButtonRequestPhone#417efd8f flags:# style:flags.10?KeyboardButtonStyle text:string = KeyboardButton;\nkeyboardButtonRequestGeoLocation#aa40f94d flags:# style:flags.10?KeyboardButtonStyle text:string = KeyboardButton;\nkeyboardButtonSwitchInline#991399fc flags:# same_peer:flags.0?true style:flags.10?KeyboardButtonStyle text:string query:string peer_types:flags.1?Vector<InlineQueryPeerType> = KeyboardButton;\nkeyboardButtonGame#89c590f9 flags:# style:flags.10?KeyboardButtonStyle text:string = KeyboardButton;\nkeyboardButtonBuy#3fa53905 flags:# style:flags.10?KeyboardButtonStyle text:string = KeyboardButton;\nkeyboardButtonUrlAuth#f51006f9 flags:# style:flags.10?KeyboardButtonStyle text:string fwd_text:flags.0?string url:string button_id:int = KeyboardButton;\ninputKeyboardButtonUrlAuth#68013e72 flags:# request_write_access:flags.0?true style:flags.10?KeyboardButtonStyle text:string fwd_text:flags.1?string url:string bot:InputUser = KeyboardButton;\nkeyboardButtonRequestPoll#7a11d782 flags:# style:flags.10?KeyboardButtonStyle quiz:flags.0?Bool text:string = KeyboardButton;\ninputKeyboardButtonUserProfile#7d5e07c7 flags:# style:flags.10?KeyboardButtonStyle text:string user_id:InputUser = KeyboardButton;\nkeyboardButtonUserProfile#c0fd5d09 flags:# style:flags.10?KeyboardButtonStyle text:string user_id:long = KeyboardButton;\nkeyboardButtonWebView#e846b1a0 flags:# style:flags.10?KeyboardButtonStyle text:string url:string = KeyboardButton;\nkeyboardButtonSimpleWebView#e15c4370 flags:# style:flags.10?KeyboardButtonStyle text:string url:string = KeyboardButton;\nkeyboardButtonRequestPeer#5b0f15f5 flags:# style:flags.10?KeyboardButtonStyle text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton;\ninputKeyboardButtonRequestPeer#2b78156 flags:# name_requested:flags.0?true username_requested:flags.1?true photo_requested:flags.2?true style:flags.10?KeyboardButtonStyle text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton;\nkeyboardButtonCopy#bcc4af10 flags:# style:flags.10?KeyboardButtonStyle text:string copy_text:string = 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;\nmessageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;\nmessageEntitySpoiler#32ca960f offset:int length:int = MessageEntity;\nmessageEntityCustomEmoji#c8cf05f8 offset:int length:int document_id:long = MessageEntity;\nmessageEntityBlockquote#f1ccaaac flags:# collapsed:flags.0?true offset:int length:int = MessageEntity;\nmessageEntityFormattedDate#904ac7c7 flags:# relative:flags.0?true short_time:flags.1?true long_time:flags.2?true short_date:flags.3?true long_date:flags.4?true day_of_week:flags.5?true offset:int length:int date:int = MessageEntity;\nmessageEntityDiffInsert#71777116 offset:int length:int = MessageEntity;\nmessageEntityDiffReplace#c6c1e5a7 offset:int length:int old_text:string = MessageEntity;\nmessageEntityDiffDelete#652c1c5 offset:int length:int = 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#1bd54456 flags:# user_id:long date:int subscription_until_date:flags.0?int rank:flags.2?string = ChannelParticipant;\nchannelParticipantSelf#a9478a1a flags:# via_request:flags.0?true user_id:long inviter_id:long date:int subscription_until_date:flags.1?int rank:flags.2?string = 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#d5f0ad91 flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights rank:flags.2?string = 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:# invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;\ninputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true invert_media:flags.3?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;\ninputBotInlineMessageMediaWebPage#bddcc510 flags:# invert_media:flags.3?true force_large_media:flags.4?true force_small_media:flags.5?true optional:flags.6?true message:string entities:flags.1?Vector<MessageEntity> url:string 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:# invert_media:flags.3?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = BotInlineMessage;\nbotInlineMessageText#8c7f65e2 flags:# no_webpage:flags.0?true invert_media:flags.3?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;\nbotInlineMessageMediaWebPage#809ad9a6 flags:# invert_media:flags.3?true force_large_media:flags.4?true force_small_media:flags.5?true manual:flags.7?true safe:flags.8?true message:string entities:flags.1?Vector<MessageEntity> url:string 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#4e4df4bb flags:# imported:flags.7?true saved_out:flags.11?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 saved_from_id:flags.8?Peer saved_from_name:flags.9?string saved_date:flags.10?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#9fd736 flags:# nonce:flags.0?bytes play_integrity_project_id:flags.2?long play_integrity_nonce:flags.2?bytes receipt:flags.1?string push_timeout:flags.1?int length:int = auth.SentCodeType;\nauth.sentCodeTypeSmsWord#a416ac81 flags:# beginning:flags.0?string = auth.SentCodeType;\nauth.sentCodeTypeSmsPhrase#b37794af flags:# beginning:flags.0?string = 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;\ntopPeerCategoryBotsApp#fd9e7bec = TopPeerCategory;\ntopPeerCategoryBotsGuestChat#6c24f3dd = 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#96eaa5eb flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia date:int effect:flags.7?long suggested_post:flags.8?SuggestedPost = 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;\nphoneCallDiscardReasonMigrateConferenceCall#9fbbf1f7 slug:string = PhoneCallDiscardReason;\ndataJSON#7d748d04 data:string = DataJSON;\nlabeledPrice#cb296bf8 label:string amount:long = LabeledPrice;\ninvoice#49ee584 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 subscription_period:flags.11?int = 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.paymentFormStars#7bf6b15c flags:# form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice users:Vector<User> = payments.PaymentForm;\npayments.paymentFormStarGift#b425cfe1 form_id:long invoice:Invoice = 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.paymentReceiptStars#dabbf83a flags:# date:int bot_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice currency:string total_amount:long transaction_id: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#30535af5 flags:# p2p_allowed:flags.5?true video:flags.6?true conference_supported:flags.8?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 custom_parameters:flags.7?DataJSON = 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;\nchannelAdminLogEventActionChangePeerColor#5796e780 prev_value:PeerColor new_value:PeerColor = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeProfilePeerColor#5e477b25 prev_value:PeerColor new_value:PeerColor = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeWallpaper#31bb5d52 prev_value:WallPaper new_value:WallPaper = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeEmojiStatus#3ea9feb1 prev_value:EmojiStatus new_value:EmojiStatus = ChannelAdminLogEventAction;\nchannelAdminLogEventActionChangeEmojiStickerSet#46d840ab prev_stickerset:InputStickerSet new_stickerset:InputStickerSet = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleSignatureProfiles#60a79c79 new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantSubExtend#64642db3 prev_participant:ChannelParticipant new_participant:ChannelParticipant = ChannelAdminLogEventAction;\nchannelAdminLogEventActionToggleAutotranslation#c517f77e new_value:Bool = ChannelAdminLogEventAction;\nchannelAdminLogEventActionParticipantEditRank#5806b4ec user_id:long prev_rank:string new_rank:string = 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 sub_extend:flags.18?true edit_rank:flags.19?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#4b7d786a flags:# text:TextWithEntities option:bytes media:flags.0?MessageMedia added_by:flags.1?Peer date:flags.1?int = PollAnswer;\ninputPollAnswer#199fed96 flags:# text:TextWithEntities media:flags.0?InputMedia = PollAnswer;\npoll#966e2dbf id:long flags:# closed:flags.0?true public_voters:flags.1?true multiple_choice:flags.2?true quiz:flags.3?true open_answers:flags.6?true revoting_disabled:flags.7?true shuffle_answers:flags.8?true hide_results_until_close:flags.9?true creator:flags.10?true subscribers_only:flags.11?true question:TextWithEntities answers:Vector<PollAnswer> close_period:flags.4?int close_date:flags.5?int countries_iso2:flags.12?Vector<string> hash:long = Poll;\npollAnswerVoters#3645230a flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:flags.2?int recent_voters:flags.2?Vector<Peer> = PollAnswerVoters;\npollResults#ba7bb15e flags:# min:flags.0?true has_unread_votes:flags.6?true can_view_stats:flags.7?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> solution_media:flags.5?MessageMedia = 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 manage_direct_messages:flags.17?true manage_ranks:flags.18?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 edit_rank:flags.26?true send_reactions:flags.27?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 unknown_number:flags.9?true logout_tokens:flags.6?Vector<bytes> token:flags.8?string app_sandbox:flags.8?Bool = CodeSettings;\nwallPaperSettings#372efcd0 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 emoticon:flags.7?string = 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#3cd623ec flags:# request_write_access:flags.0?true request_phone_number:flags.1?true match_codes_first:flags.5?true is_app:flags.6?true bot:User domain:string browser:flags.2?string platform:flags.2?string ip:flags.2?string region:flags.2?string match_codes:flags.3?Vector<string> user_id_hint:flags.4?long verified_app_name:flags.7?string = UrlAuthResult;\nurlAuthResultAccepted#623a8fa0 flags:# url:flags.0?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;\nwebPageAttributeStickerSet#50cc03d3 flags:# emojis:flags.0?true text_color:flags.1?true stickers:Vector<Document> = WebPageAttribute;\nwebPageAttributeUniqueStarGift#cf6f6db8 gift:StarGift = WebPageAttribute;\nwebPageAttributeStarGiftCollection#31cad303 icons:Vector<Document> = WebPageAttribute;\nwebPageAttributeStarGiftAuction#1c641c2 gift:StarGift end_date:int = WebPageAttribute;\nwebPageAttributeAiComposeTone#7781fe18 emoji_id:long = 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#aa472651 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 title_noanimate:flags.28?true id:int title:TextWithEntities emoticon:flags.25?string color:flags.27?int pinned_peers:Vector<InputPeer> include_peers:Vector<InputPeer> exclude_peers:Vector<InputPeer> = DialogFilter;\ndialogFilterDefault#363293ae = DialogFilter;\ndialogFilterChatlist#96537bd7 flags:# has_my_invites:flags.26?true title_noanimate:flags.28?true id:int title:TextWithEntities emoticon:flags.25?string color:flags.27?int 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;\nstats.broadcastStats#396ca5fc period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev reactions_per_post:StatsAbsValueAndPrev views_per_story:StatsAbsValueAndPrev shares_per_story:StatsAbsValueAndPrev reactions_per_story: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 reactions_by_emotion_graph:StatsGraph story_interactions_graph:StatsGraph story_reactions_by_emotion_graph:StatsGraph recent_posts_interactions:Vector<PostInteractionCounters> = stats.BroadcastStats;\nhelp.promoDataEmpty#98f6ac75 expires:int = help.PromoData;\nhelp.promoData#8a4d87a flags:# proxy:flags.0?true expires:int peer:flags.3?Peer psa_type:flags.1?string psa_message:flags.2?string pending_suggestions:Vector<string> dismissed_suggestions:Vector<string> custom_pending_suggestion:flags.4?PendingSuggestion chats:Vector<Chat> users:Vector<User> = 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#fe41b34f flags:# archive_and_mute_new_noncontact_peers:flags.0?true keep_archived_unmuted:flags.1?true keep_archived_folders:flags.2?true hide_read_marks:flags.3?true new_noncontact_peers_require_premium:flags.4?true display_gifts_button:flags.7?true noncontact_peers_paid_stars:flags.5?long disallowed_gifts:flags.6?DisallowedGiftsSettings = 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#1b97dd66 flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int todo_item_id:flags.11?int poll_option:flags.12?bytes = MessageReplyHeader;\nmessageReplyStoryHeader#e5af939 peer:Peer 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#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats;\ngroupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;\ngroupCall#efb2b617 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 conference:flags.14?true creator:flags.15?true messages_enabled:flags.17?true can_change_messages_enabled:flags.18?true min:flags.19?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 invite_link:flags.16?string send_paid_messages_stars:flags.20?long default_send_as:flags.21?Peer = GroupCall;\ninputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;\ninputGroupCallSlug#fe06823f slug:string = InputGroupCall;\ninputGroupCallInviteMessage#8c10603f msg_id:int = InputGroupCall;\ngroupCallParticipant#2a3dc7ac 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 paid_stars_total:flags.16?long = 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;\nchatTheme#c3dffc04 emoticon:string = ChatTheme;\nchatThemeUniqueGift#3458f9c8 gift:StarGift theme_settings:Vector<ThemeSettings> = ChatTheme;\naccount.chatThemesNotModified#e011e1c4 = account.ChatThemes;\naccount.chatThemes#be098173 flags:# hash:long themes:Vector<ChatTheme> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = account.ChatThemes;\nsponsoredMessage#7dbf8673 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector<MessageEntity> photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string min_display_duration:flags.15?int max_display_duration:flags.15?int = SponsoredMessage;\nmessages.sponsoredMessages#ffda656d flags:# posts_between:flags.0?int start_delay:flags.1?int between_delay:flags.2?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#a339f0b flags:# min:flags.0?true can_see_list:flags.2?true reactions_as_tags:flags.3?true results:Vector<ReactionCount> recent_reactions:flags.1?Vector<MessagePeerReaction> top_reactors:flags.4?Vector<MessageReactor> = 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#4d22ff98 flags:# fullsize:flags.1?true fullscreen:flags.2?true query_id:flags.0?long url:string = WebViewResult;\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;\ninputInvoicePremiumGiftCode#98986c0d purpose:InputStorePaymentPurpose option:PremiumGiftCodeOption = InputInvoice;\ninputInvoiceStars#65f00ce3 purpose:InputStorePaymentPurpose = InputInvoice;\ninputInvoiceChatInviteSubscription#34e793f1 hash:string = InputInvoice;\ninputInvoiceStarGift#e8625e92 flags:# hide_name:flags.0?true include_upgrade:flags.2?true peer:InputPeer gift_id:long message:flags.1?TextWithEntities = InputInvoice;\ninputInvoiceStarGiftUpgrade#4d818d5d flags:# keep_original_details:flags.0?true stargift:InputSavedStarGift = InputInvoice;\ninputInvoiceStarGiftTransfer#4a5f5bd9 stargift:InputSavedStarGift to_id:InputPeer = InputInvoice;\ninputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int message:flags.0?TextWithEntities = InputInvoice;\ninputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice;\ninputInvoiceStarGiftResale#c39f5324 flags:# ton:flags.0?true slug:string to_id:InputPeer = InputInvoice;\ninputInvoiceStarGiftPrepaidUpgrade#9a0b48b8 peer:InputPeer hash:string = InputInvoice;\ninputInvoicePremiumAuthCode#3e77f614 purpose:InputStorePaymentPurpose = InputInvoice;\ninputInvoiceStarGiftDropOriginalDetails#923d8d1 stargift:InputSavedStarGift = InputInvoice;\ninputInvoiceStarGiftAuctionBid#1ecafa10 flags:# hide_name:flags.0?true update_bid:flags.2?true peer:flags.3?InputPeer gift_id:long bid_amount:long message:flags.1?TextWithEntities = InputInvoice;\npayments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;\nmessages.transcribedAudio#cfb9d957 flags:# pending:flags.0?true transcription_id:long text:string trial_remains_num:flags.1?int trial_remains_until_date:flags.1?int = 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;\ninputStorePaymentPremiumGiftCode#fb790393 flags:# users:Vector<InputUser> boost_peer:flags.0?InputPeer currency:string amount:long message:flags.1?TextWithEntities = InputStorePaymentPurpose;\ninputStorePaymentPremiumGiveaway#160544ca flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long = InputStorePaymentPurpose;\ninputStorePaymentStarsTopup#f9a2a6cb flags:# stars:long currency:string amount:long spend_purpose_peer:flags.0?InputPeer = InputStorePaymentPurpose;\ninputStorePaymentStarsGift#1d741ef7 user_id:InputUser stars:long currency:string amount:long = InputStorePaymentPurpose;\ninputStorePaymentStarsGiveaway#751f08fa flags:# only_new_subscribers:flags.0?true winners_are_visible:flags.3?true stars:long boost_peer:InputPeer additional_peers:flags.1?Vector<InputPeer> countries_iso2:flags.2?Vector<string> prize_description:flags.4?string random_id:long until_date:int currency:string amount:long users:int = InputStorePaymentPurpose;\ninputStorePaymentAuthCode#3fc18057 flags:# restore:flags.0?true phone_number:string phone_code_hash:string premium_days:int currency:string amount:long = InputStorePaymentPurpose;\npaymentFormMethod#88f8f21b url:string title:string = PaymentFormMethod;\nemojiStatusEmpty#2de11aae = EmojiStatus;\nemojiStatus#e7ff068a flags:# document_id:long until:flags.0?int = EmojiStatus;\nemojiStatusCollectible#7184603b flags:# collectible_id:long document_id:long title:string slug:string pattern_document_id:long center_color:int edge_color:int pattern_color:int text_color:int until:flags.0?int = EmojiStatus;\ninputEmojiStatusCollectible#7141dbf flags:# collectible_id:long until:flags.0?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;\nreactionPaid#523da4eb = 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#fcdad815 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true title_missing:flags.7?true id:int date:int peer:Peer 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 unread_poll_votes_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;\nrequestPeerTypeCreateBot#3e81e078 flags:# bot_managed:flags.0?true suggested_name:flags.1?string suggested_username:flags.2?string = 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;\nemojiGroupGreeting#80d26cc7 title:string icon_emoji_id:long emoticons:Vector<string> = EmojiGroup;\nemojiGroupPremium#93bcf34 title:string icon_emoji_id:long = 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;\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#f10ece2f flags:# title_noanimate:flags.1?true title:TextWithEntities 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;\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 live:flags.9?true id:int date:int expire_date:int = StoryItem;\nstoryItem#16a4b93c 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 from_id:flags.18?Peer fwd_from:flags.17?StoryFwdHeader 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 albums:flags.19?Vector<int> music:flags.20?Document = 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#63c3dd0a flags:# count:int stories:Vector<StoryItem> pinned_to_top:flags.0?Vector<int> 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;\nstoryViewPublicForward#9083670b flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true message:Message = StoryView;\nstoryViewPublicRepost#bd74cf49 flags:# blocked:flags.0?true blocked_my_stories_from:flags.1?true peer_id:Peer story:StoryItem = StoryView;\nstories.storyViewsList#59d78fc5 flags:# count:int views_count:int forwards_count:int reactions_count:int views:Vector<StoryView> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = stories.StoryViewsList;\nstories.storyViews#de9eed1d views:Vector<StoryViews> users:Vector<User> = stories.StoryViews;\ninputReplyToMessage#3bd4b7c2 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer todo_item_id:flags.6?int poll_option:flags.7?bytes = InputReplyTo;\ninputReplyToStory#5881323a peer:InputPeer story_id:int = InputReplyTo;\ninputReplyToMonoForum#69d66c45 monoforum_peer_id:InputPeer = InputReplyTo;\nexportedStoryLink#3fc9053b link:string = ExportedStoryLink;\nstoriesStealthMode#712e27fd flags:# active_until_date:flags.0?int cooldown_until_date:flags.1?int = StoriesStealthMode;\nmediaAreaCoordinates#cfc9e002 flags:# x:double y:double w:double h:double rotation:double radius:flags.0?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#cad5452d flags:# coordinates:MediaAreaCoordinates geo:GeoPoint address:flags.0?GeoPointAddress = MediaArea;\nmediaAreaSuggestedReaction#14455871 flags:# dark:flags.0?true flipped:flags.1?true coordinates:MediaAreaCoordinates reaction:Reaction = MediaArea;\nmediaAreaChannelPost#770416af coordinates:MediaAreaCoordinates channel_id:long msg_id:int = MediaArea;\ninputMediaAreaChannelPost#2271f2bf coordinates:MediaAreaCoordinates channel:InputChannel msg_id:int = MediaArea;\nmediaAreaUrl#37381085 coordinates:MediaAreaCoordinates url:string = MediaArea;\nmediaAreaWeather#49a6549c coordinates:MediaAreaCoordinates emoji:string temperature_c:double color:int = MediaArea;\nmediaAreaStarGift#5787686d coordinates:MediaAreaCoordinates slug:string = 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;\nmessages.webPage#fd5e12bd webpage:WebPage chats:Vector<Chat> users:Vector<User> = messages.WebPage;\npremiumGiftCodeOption#257e962b flags:# users:int months:int store_product:flags.0?string store_quantity:flags.1?int currency:string amount:long = PremiumGiftCodeOption;\npayments.checkedGiftCode#eb983f8f flags:# via_giveaway:flags.2?true from_id:flags.4?Peer giveaway_msg_id:flags.3?int to_id:flags.0?long date:int days:int used_date:flags.1?int chats:Vector<Chat> users:Vector<User> = payments.CheckedGiftCode;\npayments.giveawayInfo#4367daa0 flags:# participating:flags.0?true preparing_results:flags.3?true start_date:int joined_too_early_date:flags.1?int admin_disallowed_chat_id:flags.2?long disallowed_country:flags.4?string = payments.GiveawayInfo;\npayments.giveawayInfoResults#e175e66f flags:# winner:flags.0?true refunded:flags.1?true start_date:int gift_code_slug:flags.3?string stars_prize:flags.4?long finish_date:int winners_count:int activated_count:flags.2?int = payments.GiveawayInfo;\nprepaidGiveaway#b2539d54 id:long months:int quantity:int date:int = PrepaidGiveaway;\nprepaidStarsGiveaway#9a9d77e0 id:long stars:long quantity:int boosts:int date:int = PrepaidGiveaway;\nboost#4b3e14d6 flags:# gift:flags.1?true giveaway:flags.2?true unclaimed:flags.3?true id:string user_id:flags.0?long giveaway_msg_id:flags.2?int date:int expires:int used_gift_slug:flags.4?string multiplier:flags.5?int stars:flags.6?long = Boost;\npremium.boostsList#86f8613c flags:# count:int boosts:Vector<Boost> next_offset:flags.0?string users:Vector<User> = premium.BoostsList;\nmyBoost#c448415c flags:# slot:int peer:flags.0?Peer date:int expires:int cooldown_until_date:flags.1?int = MyBoost;\npremium.myBoosts#9ae228e2 my_boosts:Vector<MyBoost> chats:Vector<Chat> users:Vector<User> = premium.MyBoosts;\npremium.boostsStatus#4959427a flags:# my_boost:flags.2?true level:int current_level_boosts:int boosts:int gift_boosts:flags.4?int next_level_boosts:flags.0?int premium_audience:flags.1?StatsPercentValue boost_url:string prepaid_giveaways:flags.3?Vector<PrepaidGiveaway> my_boost_slots:flags.2?Vector<int> = premium.BoostsStatus;\nstoryFwdHeader#b826e150 flags:# modified:flags.3?true from:flags.0?Peer from_name:flags.1?string story_id:flags.2?int = StoryFwdHeader;\npostInteractionCountersMessage#e7058e7f msg_id:int views:int forwards:int reactions:int = PostInteractionCounters;\npostInteractionCountersStory#8a480e27 story_id:int views:int forwards:int reactions:int = PostInteractionCounters;\nstats.storyStats#50cd067c views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.StoryStats;\npublicForwardMessage#1f2bf4a message:Message = PublicForward;\npublicForwardStory#edf3add0 peer:Peer story:StoryItem = PublicForward;\nstats.publicForwards#93037e20 flags:# count:int forwards:Vector<PublicForward> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = stats.PublicForwards;\npeerColor#b54b5acf flags:# color:flags.0?int background_emoji_id:flags.1?long = PeerColor;\npeerColorCollectible#b9c0639a flags:# collectible_id:long gift_emoji_id:long background_emoji_id:long accent_color:int colors:Vector<int> dark_accent_color:flags.0?int dark_colors:flags.1?Vector<int> = PeerColor;\ninputPeerColorCollectible#b8ea86a9 collectible_id:long = PeerColor;\nhelp.peerColorSet#26219a58 colors:Vector<int> = help.PeerColorSet;\nhelp.peerColorProfileSet#767d61eb palette_colors:Vector<int> bg_colors:Vector<int> story_colors:Vector<int> = help.PeerColorSet;\nhelp.peerColorOption#adec6ebe flags:# hidden:flags.0?true color_id:int colors:flags.1?help.PeerColorSet dark_colors:flags.2?help.PeerColorSet channel_min_level:flags.3?int group_min_level:flags.4?int = help.PeerColorOption;\nhelp.peerColorsNotModified#2ba1f5ce = help.PeerColors;\nhelp.peerColors#f8ed08 hash:int colors:Vector<help.PeerColorOption> = help.PeerColors;\nstoryReaction#6090d6d5 peer_id:Peer date:int reaction:Reaction = StoryReaction;\nstoryReactionPublicForward#bbab2643 message:Message = StoryReaction;\nstoryReactionPublicRepost#cfcd0f13 peer_id:Peer story:StoryItem = StoryReaction;\nstories.storyReactionsList#aa5f789c flags:# count:int reactions:Vector<StoryReaction> chats:Vector<Chat> users:Vector<User> next_offset:flags.0?string = stories.StoryReactionsList;\nsavedDialog#bd87cb6c flags:# pinned:flags.2?true peer:Peer top_message:int = SavedDialog;\nmonoForumDialog#64407ea7 flags:# unread_mark:flags.3?true nopaid_messages_exception:flags.4?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_reactions_count:int draft:flags.1?DraftMessage = SavedDialog;\nmessages.savedDialogs#f83ae221 dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;\nmessages.savedDialogsSlice#44ba9dd9 count:int dialogs:Vector<SavedDialog> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.SavedDialogs;\nmessages.savedDialogsNotModified#c01f6fe8 count:int = messages.SavedDialogs;\nsavedReactionTag#cb6ff828 flags:# reaction:Reaction title:flags.0?string count:int = SavedReactionTag;\nmessages.savedReactionTagsNotModified#889b59ef = messages.SavedReactionTags;\nmessages.savedReactionTags#3259950a tags:Vector<SavedReactionTag> hash:long = messages.SavedReactionTags;\noutboxReadDate#3bb842ac date:int = OutboxReadDate;\nsmsjobs.eligibleToJoin#dc8b44cf terms_url:string monthly_sent_sms:int = smsjobs.EligibilityToJoin;\nsmsjobs.status#2aee9191 flags:# allow_international:flags.0?true recent_sent:int recent_since:int recent_remains:int total_sent:int total_since:int last_gift_slug:flags.1?string terms_url:string = smsjobs.Status;\nsmsJob#e6a1eeb8 job_id:string phone_number:string text:string = SmsJob;\nbusinessWeeklyOpen#120b1ab9 start_minute:int end_minute:int = BusinessWeeklyOpen;\nbusinessWorkHours#8c92b098 flags:# open_now:flags.0?true timezone_id:string weekly_open:Vector<BusinessWeeklyOpen> = BusinessWorkHours;\nbusinessLocation#ac5c1af7 flags:# geo_point:flags.0?GeoPoint address:string = BusinessLocation;\ninputBusinessRecipients#6f8b32aa flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<InputUser> = InputBusinessRecipients;\nbusinessRecipients#21108ff7 flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<long> = BusinessRecipients;\nbusinessAwayMessageScheduleAlways#c9b9e2b9 = BusinessAwayMessageSchedule;\nbusinessAwayMessageScheduleOutsideWorkHours#c3f2f501 = BusinessAwayMessageSchedule;\nbusinessAwayMessageScheduleCustom#cc4d9ecc start_date:int end_date:int = BusinessAwayMessageSchedule;\ninputBusinessGreetingMessage#194cb3b shortcut_id:int recipients:InputBusinessRecipients no_activity_days:int = InputBusinessGreetingMessage;\nbusinessGreetingMessage#e519abab shortcut_id:int recipients:BusinessRecipients no_activity_days:int = BusinessGreetingMessage;\ninputBusinessAwayMessage#832175e0 flags:# offline_only:flags.0?true shortcut_id:int schedule:BusinessAwayMessageSchedule recipients:InputBusinessRecipients = InputBusinessAwayMessage;\nbusinessAwayMessage#ef156a5c flags:# offline_only:flags.0?true shortcut_id:int schedule:BusinessAwayMessageSchedule recipients:BusinessRecipients = BusinessAwayMessage;\ntimezone#ff9289f5 id:string name:string utc_offset:int = Timezone;\nhelp.timezonesListNotModified#970708cc = help.TimezonesList;\nhelp.timezonesList#7b74ed71 timezones:Vector<Timezone> hash:int = help.TimezonesList;\nquickReply#697102b shortcut_id:int shortcut:string top_message:int count:int = QuickReply;\ninputQuickReplyShortcut#24596d41 shortcut:string = InputQuickReplyShortcut;\ninputQuickReplyShortcutId#1190cf1 shortcut_id:int = InputQuickReplyShortcut;\nmessages.quickReplies#c68d6695 quick_replies:Vector<QuickReply> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.QuickReplies;\nmessages.quickRepliesNotModified#5f91eb5b = messages.QuickReplies;\nconnectedBot#cd64636c flags:# bot_id:long recipients:BusinessBotRecipients rights:BusinessBotRights = ConnectedBot;\naccount.connectedBots#17d7f87b connected_bots:Vector<ConnectedBot> users:Vector<User> = account.ConnectedBots;\nmessages.dialogFilters#2ad93719 flags:# tags_enabled:flags.0?true filters:Vector<DialogFilter> = messages.DialogFilters;\nbirthday#6c8e1e06 flags:# day:int month:int year:flags.0?int = Birthday;\nbotBusinessConnection#8f34b2f5 flags:# disabled:flags.1?true connection_id:string user_id:long dc_id:int date:int rights:flags.2?BusinessBotRights = BotBusinessConnection;\ninputBusinessIntro#9c469cd flags:# title:string description:string sticker:flags.0?InputDocument = InputBusinessIntro;\nbusinessIntro#5a0a066d flags:# title:string description:string sticker:flags.0?Document = BusinessIntro;\nmessages.myStickers#faff629d count:int sets:Vector<StickerSetCovered> = messages.MyStickers;\ninputCollectibleUsername#e39460a9 username:string = InputCollectible;\ninputCollectiblePhone#a2e214a4 phone:string = InputCollectible;\nfragment.collectibleInfo#6ebdff91 purchase_date:int currency:string amount:long crypto_currency:string crypto_amount:long url:string = fragment.CollectibleInfo;\ninputBusinessBotRecipients#c4e5921e flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<InputUser> exclude_users:flags.6?Vector<InputUser> = InputBusinessBotRecipients;\nbusinessBotRecipients#b88cf373 flags:# existing_chats:flags.0?true new_chats:flags.1?true contacts:flags.2?true non_contacts:flags.3?true exclude_selected:flags.5?true users:flags.4?Vector<long> exclude_users:flags.6?Vector<long> = BusinessBotRecipients;\ncontactBirthday#1d998733 contact_id:long birthday:Birthday = ContactBirthday;\ncontacts.contactBirthdays#114ff30d contacts:Vector<ContactBirthday> users:Vector<User> = contacts.ContactBirthdays;\nmissingInvitee#628c9224 flags:# premium_would_allow_invite:flags.0?true premium_required_for_pm:flags.1?true user_id:long = MissingInvitee;\nmessages.invitedUsers#7f5defa6 updates:Updates missing_invitees:Vector<MissingInvitee> = messages.InvitedUsers;\ninputBusinessChatLink#11679fa7 flags:# message:string entities:flags.0?Vector<MessageEntity> title:flags.1?string = InputBusinessChatLink;\nbusinessChatLink#b4ae666f flags:# link:string message:string entities:flags.0?Vector<MessageEntity> title:flags.1?string views:int = BusinessChatLink;\naccount.businessChatLinks#ec43a2d1 links:Vector<BusinessChatLink> chats:Vector<Chat> users:Vector<User> = account.BusinessChatLinks;\naccount.resolvedBusinessChatLinks#9a23af21 flags:# peer:Peer message:string entities:flags.0?Vector<MessageEntity> chats:Vector<Chat> users:Vector<User> = account.ResolvedBusinessChatLinks;\nrequestedPeerUser#d62ff46a flags:# user_id:long first_name:flags.0?string last_name:flags.0?string username:flags.1?string photo:flags.2?Photo = RequestedPeer;\nrequestedPeerChat#7307544f flags:# chat_id:long title:flags.0?string photo:flags.2?Photo = RequestedPeer;\nrequestedPeerChannel#8ba403e4 flags:# channel_id:long title:flags.0?string username:flags.1?string photo:flags.2?Photo = RequestedPeer;\nsponsoredMessageReportOption#430d3150 text:string option:bytes = SponsoredMessageReportOption;\nchannels.sponsoredMessageReportResultChooseOption#846f9e42 title:string options:Vector<SponsoredMessageReportOption> = channels.SponsoredMessageReportResult;\nchannels.sponsoredMessageReportResultAdsHidden#3e3bcf2f = channels.SponsoredMessageReportResult;\nchannels.sponsoredMessageReportResultReported#ad798849 = channels.SponsoredMessageReportResult;\nreactionNotificationsFromContacts#bac3a61a = ReactionNotificationsFrom;\nreactionNotificationsFromAll#4b9e22a0 = ReactionNotificationsFrom;\nreactionsNotifySettings#71e4ea58 flags:# messages_notify_from:flags.0?ReactionNotificationsFrom stories_notify_from:flags.1?ReactionNotificationsFrom poll_votes_notify_from:flags.2?ReactionNotificationsFrom sound:NotificationSound show_previews:Bool = ReactionsNotifySettings;\navailableEffect#93c3e27e flags:# premium_required:flags.2?true id:long emoticon:string static_icon_id:flags.0?long effect_sticker_id:long effect_animation_id:flags.1?long = AvailableEffect;\nmessages.availableEffectsNotModified#d1ed9a5b = messages.AvailableEffects;\nmessages.availableEffects#bddb616e hash:int effects:Vector<AvailableEffect> documents:Vector<Document> = messages.AvailableEffects;\nfactCheck#b89bfccf flags:# need_check:flags.0?true country:flags.1?string text:flags.1?TextWithEntities hash:long = FactCheck;\nstarsTransactionPeerUnsupported#95f2bfe4 = StarsTransactionPeer;\nstarsTransactionPeerAppStore#b457b375 = StarsTransactionPeer;\nstarsTransactionPeerPlayMarket#7b560a0b = StarsTransactionPeer;\nstarsTransactionPeerPremiumBot#250dbaf8 = StarsTransactionPeer;\nstarsTransactionPeerFragment#e92fd902 = StarsTransactionPeer;\nstarsTransactionPeer#d80da15d peer:Peer = StarsTransactionPeer;\nstarsTransactionPeerAds#60682812 = StarsTransactionPeer;\nstarsTransactionPeerAPI#f9677aad = StarsTransactionPeer;\nstarsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;\nstarsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true stargift_drop_original_details:flags.26?true phonegroup_message:flags.27?true stargift_auction_bid:flags.28?true offer:flags.29?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector<MessageMedia> subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction;\npayments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector<StarsSubscription> subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector<StarsTransaction> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.StarsStatus;\nfoundStory#e87acbc0 peer:Peer story:StoryItem = FoundStory;\nstories.foundStories#e2de7737 flags:# count:int stories:Vector<FoundStory> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = stories.FoundStories;\ngeoPointAddress#de4c5d93 flags:# country_iso2:string state:flags.0?string city:flags.1?string street:flags.2?string = GeoPointAddress;\nstarsRevenueStatus#febe5491 flags:# withdrawal_enabled:flags.0?true current_balance:StarsAmount available_balance:StarsAmount overall_revenue:StarsAmount next_withdrawal_at:flags.1?int = StarsRevenueStatus;\npayments.starsRevenueStats#6c207376 flags:# top_hours_graph:flags.0?StatsGraph revenue_graph:StatsGraph status:StarsRevenueStatus usd_rate:double = payments.StarsRevenueStats;\npayments.starsRevenueWithdrawalUrl#1dab80b7 url:string = payments.StarsRevenueWithdrawalUrl;\npayments.starsRevenueAdsAccountUrl#394e7f21 url:string = payments.StarsRevenueAdsAccountUrl;\ninputStarsTransaction#206ae6d1 flags:# refund:flags.0?true id:string = InputStarsTransaction;\nstarsGiftOption#5e0589f1 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsGiftOption;\nbots.popularAppBots#1991b13b flags:# next_offset:flags.0?string users:Vector<User> = bots.PopularAppBots;\nbotPreviewMedia#23e91ba3 date:int media:MessageMedia = BotPreviewMedia;\nbots.previewInfo#ca71d64 media:Vector<BotPreviewMedia> lang_codes:Vector<string> = bots.PreviewInfo;\nstarsSubscriptionPricing#5416d58 period:int amount:long = StarsSubscriptionPricing;\nstarsSubscription#2e6eab1a flags:# canceled:flags.0?true can_refulfill:flags.1?true missing_balance:flags.2?true bot_canceled:flags.7?true id:string peer:Peer until_date:int pricing:StarsSubscriptionPricing chat_invite_hash:flags.3?string title:flags.4?string photo:flags.5?WebDocument invoice_slug:flags.6?string = StarsSubscription;\nmessageReactor#4ba3a95a flags:# top:flags.0?true my:flags.1?true anonymous:flags.2?true peer_id:flags.3?Peer count:int = MessageReactor;\nstarsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true stars:long yearly_boosts:int store_product:flags.2?string currency:string amount:long winners:Vector<StarsGiveawayWinnersOption> = StarsGiveawayOption;\nstarsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption;\nstarGift#313a9547 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true peer_color_available:flags.10?true auction:flags.11?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int locked_until_date:flags.9?int auction_slug:flags.11?string gifts_per_round:flags.11?int auction_start_date:flags.11?int upgrade_variants:flags.12?int background:flags.13?StarGiftBackground = StarGift;\nstarGiftUnique#85f0a9cd flags:# require_premium:flags.6?true resale_ton_only:flags.7?true theme_available:flags.9?true burned:flags.14?true crafted:flags.15?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector<StarGiftAttribute> availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector<StarsAmount> released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string value_usd_amount:flags.8?long theme_peer:flags.10?Peer peer_color:flags.11?PeerColor host_id:flags.12?Peer offer_min_stars:flags.13?int craft_chance_permille:flags.16?int = StarGift;\npayments.starGiftsNotModified#a388a368 = payments.StarGifts;\npayments.starGifts#2ed82995 hash:int gifts:Vector<StarGift> chats:Vector<Chat> users:Vector<User> = payments.StarGifts;\nmessageReportOption#7903e3d9 text:string option:bytes = MessageReportOption;\nreportResultChooseOption#f0e4e0b6 title:string options:Vector<MessageReportOption> = ReportResult;\nreportResultAddComment#6f09ac31 flags:# optional:flags.0?true option:bytes = ReportResult;\nreportResultReported#8db33c4b = ReportResult;\nmessages.botPreparedInlineMessage#8ecf0511 id:string expire_date:int = messages.BotPreparedInlineMessage;\nmessages.preparedInlineMessage#ff57708d query_id:long result:BotInlineResult peer_types:Vector<InlineQueryPeerType> cache_time:int users:Vector<User> = messages.PreparedInlineMessage;\nbotAppSettings#c99b1950 flags:# placeholder_path:flags.0?bytes background_color:flags.1?int background_dark_color:flags.2?int header_color:flags.3?int header_dark_color:flags.4?int = BotAppSettings;\nstarRefProgram#dd0c66f2 flags:# bot_id:long commission_permille:int duration_months:flags.0?int end_date:flags.1?int daily_revenue_per_user:flags.2?StarsAmount = StarRefProgram;\nconnectedBotStarRef#19a13f71 flags:# revoked:flags.1?true url:string date:int bot_id:long commission_permille:int duration_months:flags.0?int participants:long revenue:long = ConnectedBotStarRef;\npayments.connectedStarRefBots#98d5ea1d count:int connected_bots:Vector<ConnectedBotStarRef> users:Vector<User> = payments.ConnectedStarRefBots;\npayments.suggestedStarRefBots#b4d5d859 flags:# count:int suggested_bots:Vector<StarRefProgram> users:Vector<User> next_offset:flags.0?string = payments.SuggestedStarRefBots;\nstarsAmount#bbb6b4a3 amount:long nanos:int = StarsAmount;\nstarsTonAmount#74aee3e0 amount:long = StarsAmount;\nmessages.foundStickersNotModified#6010c534 flags:# next_offset:flags.0?int = messages.FoundStickers;\nmessages.foundStickers#82c9e290 flags:# next_offset:flags.0?int hash:long stickers:Vector<Document> = messages.FoundStickers;\nbotVerifierSettings#b0cd6617 flags:# can_modify_custom_description:flags.1?true icon:long company:string custom_description:flags.0?string = BotVerifierSettings;\nbotVerification#f93cd45c bot_id:long icon:long description:string = BotVerification;\nstarGiftAttributeModel#565251e2 flags:# crafted:flags.0?true name:string document:Document rarity:StarGiftAttributeRarity = StarGiftAttribute;\nstarGiftAttributePattern#4e7085ea name:string document:Document rarity:StarGiftAttributeRarity = StarGiftAttribute;\nstarGiftAttributeBackdrop#9f2504e4 name:string backdrop_id:int center_color:int edge_color:int pattern_color:int text_color:int rarity:StarGiftAttributeRarity = StarGiftAttribute;\nstarGiftAttributeOriginalDetails#e0bff26c flags:# sender_id:flags.0?Peer recipient_id:Peer date:int message:flags.1?TextWithEntities = StarGiftAttribute;\npayments.starGiftUpgradePreview#3de1dfed sample_attributes:Vector<StarGiftAttribute> prices:Vector<StarGiftUpgradePrice> next_prices:Vector<StarGiftUpgradePrice> = payments.StarGiftUpgradePreview;\nusers.users#62d706b8 users:Vector<User> = users.Users;\nusers.usersSlice#315a4974 count:int users:Vector<User> = users.Users;\npayments.uniqueStarGift#416c56e8 gift:StarGift chats:Vector<Chat> users:Vector<User> = payments.UniqueStarGift;\nmessages.webPagePreview#8c9a88ac media:MessageMedia chats:Vector<Chat> users:Vector<User> = messages.WebPagePreview;\nsavedStarGift#41df43fc flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true upgrade_separate:flags.17?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector<int> prepaid_upgrade_hash:flags.16?string drop_original_details_stars:flags.18?long gift_num:flags.19?int can_craft_at:flags.20?int = SavedStarGift;\npayments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector<SavedStarGift> next_offset:flags.0?string chats:Vector<Chat> users:Vector<User> = payments.SavedStarGifts;\ninputSavedStarGiftUser#69279795 msg_id:int = InputSavedStarGift;\ninputSavedStarGiftChat#f101aa7f peer:InputPeer saved_id:long = InputSavedStarGift;\ninputSavedStarGiftSlug#2085c238 slug:string = InputSavedStarGift;\npayments.starGiftWithdrawalUrl#84aa3a9c url:string = payments.StarGiftWithdrawalUrl;\npaidReactionPrivacyDefault#206ad49e = PaidReactionPrivacy;\npaidReactionPrivacyAnonymous#1f0c1ad9 = PaidReactionPrivacy;\npaidReactionPrivacyPeer#dc6cfcf0 peer:InputPeer = PaidReactionPrivacy;\naccount.paidMessagesRevenue#1e109708 stars_amount:long = account.PaidMessagesRevenue;\nrequirementToContactEmpty#50a9839 = RequirementToContact;\nrequirementToContactPremium#e581e4e9 = RequirementToContact;\nrequirementToContactPaidMessages#b4f67e93 stars_amount:long = RequirementToContact;\nbusinessBotRights#a0624cf7 flags:# reply:flags.0?true read_messages:flags.1?true delete_sent_messages:flags.2?true delete_received_messages:flags.3?true edit_name:flags.4?true edit_bio:flags.5?true edit_profile_photo:flags.6?true edit_username:flags.7?true view_gifts:flags.8?true sell_gifts:flags.9?true change_gift_settings:flags.10?true transfer_and_upgrade_gifts:flags.11?true transfer_stars:flags.12?true manage_stories:flags.13?true = BusinessBotRights;\ndisallowedGiftsSettings#71f276c4 flags:# disallow_unlimited_stargifts:flags.0?true disallow_limited_stargifts:flags.1?true disallow_unique_stargifts:flags.2?true disallow_premium_gifts:flags.3?true disallow_stargifts_from_channels:flags.4?true = DisallowedGiftsSettings;\nsponsoredPeer#c69708d3 flags:# random_id:bytes peer:Peer sponsor_info:flags.0?string additional_info:flags.1?string = SponsoredPeer;\ncontacts.sponsoredPeersEmpty#ea32b4b1 = contacts.SponsoredPeers;\ncontacts.sponsoredPeers#eb032884 peers:Vector<SponsoredPeer> chats:Vector<Chat> users:Vector<User> = contacts.SponsoredPeers;\nstarGiftAttributeIdModel#48aaae3c document_id:long = StarGiftAttributeId;\nstarGiftAttributeIdPattern#4a162433 document_id:long = StarGiftAttributeId;\nstarGiftAttributeIdBackdrop#1f01c757 backdrop_id:int = StarGiftAttributeId;\nstarGiftAttributeCounter#2eb1b658 attribute:StarGiftAttributeId count:int = StarGiftAttributeCounter;\npayments.resaleStarGifts#947a12df flags:# count:int gifts:Vector<StarGift> next_offset:flags.0?string attributes:flags.1?Vector<StarGiftAttribute> attributes_hash:flags.1?long chats:Vector<Chat> counters:flags.2?Vector<StarGiftAttributeCounter> users:Vector<User> = payments.ResaleStarGifts;\nstories.canSendStoryCount#c387c04e count_remains:int = stories.CanSendStoryCount;\npendingSuggestion#e7e82e12 suggestion:string title:TextWithEntities description:TextWithEntities url:string = PendingSuggestion;\ntodoItem#cba9a52f id:int title:TextWithEntities = TodoItem;\ntodoList#49b92a26 flags:# others_can_append:flags.0?true others_can_complete:flags.1?true title:TextWithEntities list:Vector<TodoItem> = TodoList;\ntodoCompletion#221bb5e4 id:int completed_by:Peer date:int = TodoCompletion;\nsuggestedPost#e8e37e5 flags:# accepted:flags.1?true rejected:flags.2?true price:flags.3?StarsAmount schedule_date:flags.0?int = SuggestedPost;\nstarsRating#1b0e4f07 flags:# level:int current_level_stars:long stars:long next_level_stars:flags.0?long = StarsRating;\nstarGiftCollection#9d6b13b0 flags:# collection_id:int title:string icon:flags.0?Document gifts_count:int hash:long = StarGiftCollection;\npayments.starGiftCollectionsNotModified#a0ba4f17 = payments.StarGiftCollections;\npayments.starGiftCollections#8a2932f3 collections:Vector<StarGiftCollection> = payments.StarGiftCollections;\nstoryAlbum#9325705a flags:# album_id:int title:string icon_photo:flags.0?Photo icon_video:flags.1?Document = StoryAlbum;\nstories.albumsNotModified#564edaeb = stories.Albums;\nstories.albums#c3987a3a hash:long albums:Vector<StoryAlbum> = stories.Albums;\nsearchPostsFlood#3e0b5b6a flags:# query_is_free:flags.0?true total_daily:int remains:int wait_till:flags.1?int stars_amount:long = SearchPostsFlood;\npayments.uniqueStarGiftValueInfo#512fe446 flags:# last_sale_on_fragment:flags.1?true value_is_average:flags.6?true currency:string value:long initial_sale_date:int initial_sale_stars:long initial_sale_price:long last_sale_date:flags.0?int last_sale_price:flags.0?long floor_price:flags.2?long average_price:flags.3?long listed_count:flags.4?int fragment_listed_count:flags.5?int fragment_listed_url:flags.5?string = payments.UniqueStarGiftValueInfo;\nprofileTabPosts#b98cd696 = ProfileTab;\nprofileTabGifts#4d4bd46a = ProfileTab;\nprofileTabMedia#72c64955 = ProfileTab;\nprofileTabFiles#ab339c00 = ProfileTab;\nprofileTabMusic#9f27d26e = ProfileTab;\nprofileTabVoice#e477092e = ProfileTab;\nprofileTabLinks#d3656499 = ProfileTab;\nprofileTabGifs#a2c0f695 = ProfileTab;\nusers.savedMusicNotModified#e3878aa4 count:int = users.SavedMusic;\nusers.savedMusic#34a2f297 count:int documents:Vector<Document> = users.SavedMusic;\naccount.savedMusicIdsNotModified#4fc81d6e = account.SavedMusicIds;\naccount.savedMusicIds#998d6636 ids:Vector<long> = account.SavedMusicIds;\npayments.checkCanSendGiftResultOk#374fa7ad = payments.CheckCanSendGiftResult;\npayments.checkCanSendGiftResultFail#d5e58274 reason:TextWithEntities = payments.CheckCanSendGiftResult;\ninputChatThemeEmpty#83268483 = InputChatTheme;\ninputChatTheme#c93de95c emoticon:string = InputChatTheme;\ninputChatThemeUniqueGift#87e5dfe4 slug:string = InputChatTheme;\nstarGiftUpgradePrice#99ea331d date:int upgrade_stars:long = StarGiftUpgradePrice;\ngroupCallMessage#1a8afc7e flags:# from_admin:flags.1?true id:int from_id:Peer date:int message:TextWithEntities paid_message_stars:flags.0?long = GroupCallMessage;\ngroupCallDonor#ee430c85 flags:# top:flags.0?true my:flags.1?true peer_id:flags.3?Peer stars:long = GroupCallDonor;\nphone.groupCallStars#9d1dbd26 total_stars:long top_donors:Vector<GroupCallDonor> chats:Vector<Chat> users:Vector<User> = phone.GroupCallStars;\nrecentStory#711d692d flags:# live:flags.0?true max_id:flags.1?int = RecentStory;\nauctionBidLevel#310240cc pos:int amount:long date:int = AuctionBidLevel;\nstarGiftAuctionStateNotModified#fe333952 = StarGiftAuctionState;\nstarGiftAuctionState#771a4e66 version:int start_date:int end_date:int min_bid_amount:long bid_levels:Vector<AuctionBidLevel> top_bidders:Vector<long> next_round_at:int last_gift_num:int gifts_left:int current_round:int total_rounds:int rounds:Vector<StarGiftAuctionRound> = StarGiftAuctionState;\nstarGiftAuctionStateFinished#972dabbf flags:# start_date:int end_date:int average_price:long listed_count:flags.0?int fragment_listed_count:flags.1?int fragment_listed_url:flags.1?string = StarGiftAuctionState;\nstarGiftAuctionUserState#2eeed1c4 flags:# returned:flags.1?true bid_amount:flags.0?long bid_date:flags.0?int min_bid_amount:flags.0?long bid_peer:flags.0?Peer acquired_count:int = StarGiftAuctionUserState;\npayments.starGiftAuctionState#6b39f4ec gift:StarGift state:StarGiftAuctionState user_state:StarGiftAuctionUserState timeout:int users:Vector<User> chats:Vector<Chat> = payments.StarGiftAuctionState;\nstarGiftAuctionAcquiredGift#42b00348 flags:# name_hidden:flags.0?true peer:Peer date:int bid_amount:long round:int pos:int message:flags.1?TextWithEntities gift_num:flags.2?int = StarGiftAuctionAcquiredGift;\npayments.starGiftAuctionAcquiredGifts#7d5bd1f0 gifts:Vector<StarGiftAuctionAcquiredGift> users:Vector<User> chats:Vector<Chat> = payments.StarGiftAuctionAcquiredGifts;\nstarGiftActiveAuctionState#d31bc45d gift:StarGift state:StarGiftAuctionState user_state:StarGiftAuctionUserState = StarGiftActiveAuctionState;\npayments.starGiftActiveAuctionsNotModified#db33dad0 = payments.StarGiftActiveAuctions;\npayments.starGiftActiveAuctions#aef6abbc auctions:Vector<StarGiftActiveAuctionState> users:Vector<User> chats:Vector<Chat> = payments.StarGiftActiveAuctions;\ninputStarGiftAuction#2e16c98 gift_id:long = InputStarGiftAuction;\ninputStarGiftAuctionSlug#7ab58308 slug:string = InputStarGiftAuction;\npasskey#98613ebf flags:# id:string name:string date:int software_emoji_id:flags.0?long last_usage_date:flags.1?int = Passkey;\naccount.passkeys#f8e0aa1c passkeys:Vector<Passkey> = account.Passkeys;\naccount.passkeyRegistrationOptions#e16b5ce1 options:DataJSON = account.PasskeyRegistrationOptions;\nauth.passkeyLoginOptions#e2037789 options:DataJSON = auth.PasskeyLoginOptions;\ninputPasskeyResponseRegister#3e63935c client_data:DataJSON attestation_data:bytes = InputPasskeyResponse;\ninputPasskeyResponseLogin#c31fc14a client_data:DataJSON authenticator_data:bytes signature:bytes user_handle:string = InputPasskeyResponse;\ninputPasskeyCredentialPublicKey#3c27b78f id:string raw_id:string response:InputPasskeyResponse = InputPasskeyCredential;\ninputPasskeyCredentialFirebasePNV#5b1ccb28 pnv_token:string = InputPasskeyCredential;\nstarGiftBackground#aff56398 center_color:int edge_color:int text_color:int = StarGiftBackground;\nstarGiftAuctionRound#3aae0528 num:int duration:int = StarGiftAuctionRound;\nstarGiftAuctionRoundExtendable#aa021e5 num:int duration:int extend_top:int extend_window:int = StarGiftAuctionRound;\npayments.starGiftUpgradeAttributes#46c6e36f attributes:Vector<StarGiftAttribute> = payments.StarGiftUpgradeAttributes;\nmessages.emojiGameOutcome#da2ad647 seed:bytes stake_ton_amount:long ton_amount:long = messages.EmojiGameOutcome;\nmessages.emojiGameUnavailable#59e65335 = messages.EmojiGameInfo;\nmessages.emojiGameDiceInfo#44e56023 flags:# game_hash:string prev_stake:long current_streak:int params:Vector<int> plays_left:flags.0?int = messages.EmojiGameInfo;\nstarGiftAttributeRarity#36437737 permille:int = StarGiftAttributeRarity;\nstarGiftAttributeRarityUncommon#dbce6389 = StarGiftAttributeRarity;\nstarGiftAttributeRarityRare#f08d516b = StarGiftAttributeRarity;\nstarGiftAttributeRarityEpic#78fbf3a8 = StarGiftAttributeRarity;\nstarGiftAttributeRarityLegendary#cef7e7a8 = StarGiftAttributeRarity;\nkeyboardButtonStyle#4fdd3430 flags:# bg_primary:flags.0?true bg_danger:flags.1?true bg_success:flags.2?true icon:flags.3?long = KeyboardButtonStyle;\ninputMessageReadMetric#402b4495 msg_id:int view_id:long time_in_view_ms:int active_time_in_view_ms:int height_to_viewport_ratio_permille:int seen_range_ratio_permille:int = InputMessageReadMetric;\nbots.exportedBotToken#3c60b621 token:string = bots.ExportedBotToken;\nbots.requestedButton#f13bbcd7 webapp_req_id:string = bots.RequestedButton;\nmessages.composedMessageWithAI#90d7adfa flags:# result_text:TextWithEntities diff_text:flags.0?TextWithEntities = messages.ComposedMessageWithAI;\nstats.pollStats#2999beed votes_graph:StatsGraph = stats.PollStats;\ninputAiComposeToneDefault#1fe9a9bf tone:string = InputAiComposeTone;\ninputAiComposeToneID#773c080 id:long access_hash:long = InputAiComposeTone;\ninputAiComposeToneSlug#1fa01357 slug:string = InputAiComposeTone;\naiComposeTone#cff63ea9 flags:# creator:flags.0?true id:long access_hash:long slug:string title:string emoji_id:flags.1?long prompt:flags.4?string installs_count:flags.2?int author_id:flags.3?long example_english:flags.5?AiComposeToneExample = AiComposeTone;\naiComposeToneDefault#9bad6414 tone:string emoji_id:long title:string = AiComposeTone;\naicompose.tonesNotModified#c1f46103 = aicompose.Tones;\naicompose.tones#6c9d0efe hash:long tones:Vector<AiComposeTone> users:Vector<User> = aicompose.Tones;\naiComposeToneExample#f1d628ec from:TextWithEntities to:TextWithEntities = AiComposeToneExample;\nbots.accessSettings#dd1fbf93 flags:# restricted:flags.0?true add_users:flags.1?Vector<User> = bots.AccessSettings;\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#aac7b717 flags:# no_joined_notifications:flags.0?true 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#cae47523 flags:# phone_number:string phone_code_hash:string reason:flags.0?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;\nauth.initPasskeyLogin#518ad0b7 api_id:int api_hash:string = auth.PasskeyLoginOptions;\nauth.finishPasskeyLogin#9857ad07 flags:# credential:InputPasskeyCredential from_dc_id:flags.0?int from_auth_key_id:flags.0?long = 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.getAccountTTL#8fc711d = AccountDaysTTL;\naccount.setAccountTTL#2442485e ttl:AccountDaysTTL = Bool;\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;\naccount.updateBirthday#cc6e0c11 flags:# birthday:flags.0?Birthday = Bool;\naccount.resolveBusinessChatLink#5492e5ee slug:string = account.ResolvedBusinessChatLinks;\naccount.toggleSponsoredMessages#b9d9a38d enabled:Bool = Bool;\naccount.getCollectibleEmojiStatuses#2e7b4543 hash:long = account.EmojiStatuses;\naccount.getPaidMessagesRevenue#19ba4a67 flags:# parent_peer:flags.0?InputPeer user_id:InputUser = account.PaidMessagesRevenue;\naccount.toggleNoPaidMessagesException#fe2eda76 flags:# refund_charged:flags.0?true require_payment:flags.2?true parent_peer:flags.1?InputPeer user_id:InputUser = Bool;\naccount.setMainProfileTab#5dee78b0 tab:ProfileTab = Bool;\naccount.initPasskeyRegistration#429547e8 = account.PasskeyRegistrationOptions;\naccount.registerPasskey#55b41fd6 credential:InputPasskeyCredential = Passkey;\naccount.getPasskeys#ea1f0c52 = account.Passkeys;\naccount.deletePasskey#f5b5563f id:string = 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#725afbbc flags:# username:string referer:flags.0?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 bots_app:flags.16?true bots_guestchat:flags.17?true offset:int limit:int hash:long = contacts.TopPeers;\ncontacts.addContact#d9ba2e54 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string note:flags.1?TextWithEntities = Updates;\ncontacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer;\ncontacts.editCloseFriends#ba6705f0 id:Vector<long> = Bool;\ncontacts.getSponsoredPeers#b6c8c393 q:string = contacts.SponsoredPeers;\ncontacts.updateContactNote#139f63fb id:InputUser note:TextWithEntities = 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#29ee847a flags:# peer:InputPeer q:string from_id:flags.0?InputPeer saved_peer_id:flags.2?InputPeer saved_reaction:flags.3?Vector<Reaction> 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#545cd15a 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 invert_media:flags.16?true allow_paid_floodskip:flags.19?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 schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;\nmessages.sendMedia#330e77f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?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 schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long suggested_post:flags.22?SuggestedPost = Updates;\nmessages.forwardMessages#13704a7c 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 allow_paid_floodskip:flags.19?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer top_msg_id:flags.9?int reply_to:flags.22?InputReplyTo schedule_date:flags.10?int schedule_repeat_period:flags.24?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long video_timestamp:flags.20?int allow_paid_stars:flags.21?long suggested_post:flags.23?SuggestedPost = Updates;\nmessages.reportSpam#cf1592db peer:InputPeer = Bool;\nmessages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings;\nmessages.report#fc78af9b peer:InputPeer id:Vector<int> option:bytes message:string = ReportResult;\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#cbc6d107 chat_id:long user_id:InputUser fwd_limit:int = messages.InvitedUsers;\nmessages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates;\nmessages.createChat#92ceddd4 flags:# users:Vector<InputUser> title:string ttl_period:flags.0?int = messages.InvitedUsers;\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#570d6f6f flags:# message:string entities:flags.3?Vector<MessageEntity> = messages.WebPagePreview;\nmessages.exportChatInvite#a455de90 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 subscription_pricing:flags.5?StarsSubscriptionPricing = 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:# broadcasts_only:flags.1?true groups_only:flags.2?true users_only:flags.3?true 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#c0cf7646 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 quick_reply_shortcut:flags.17?InputQuickReplyShortcut allow_paid_stars:flags.21?long = Updates;\nmessages.editMessage#51e842e1 flags:# no_webpage:flags.1?true invert_media:flags.16?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 schedule_repeat_period:flags.18?int quick_reply_shortcut_id:flags.17?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#54ae308e flags:# no_webpage:flags.1?true invert_media:flags.6?true reply_to:flags.4?InputReplyTo peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> media:flags.5?InputMedia effect:flags.7?long suggested_post:flags.8?SuggestedPost = 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#14967978 flags:# business_connection_id:flags.0?string 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#1bf89d74 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true invert_media:flags.16?true allow_paid_floodskip:flags.19?true peer:InputPeer reply_to:flags.0?InputReplyTo multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut effect:flags.18?long allow_paid_stars:flags.21?long = Updates;\nmessages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets;\nmessages.markDialogUnread#8c5006f8 flags:# unread:flags.0?true parent_peer:flags.1?InputPeer 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#894cc99c flags:# peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string in_app_origin:flags.3?string = UrlAuthResult;\nmessages.acceptUrlAuth#67a3f0de flags:# write_allowed:flags.0?true share_phone_number:flags.3?true peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string match_code:flags.4?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#efd48c89 = messages.DialogFilters;\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#62dd747 flags:# peer:InputPeer top_msg_id:flags.0?int saved_peer_id:flags.1?InputPeer = 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 subscription_expired:flags.3?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#b2081a35 flags:# peer:InputPeer enabled:Bool request_msg_id:flags.0?int = 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#864b2581 flags:# peer:InputPeer available_reactions:ChatReactions reactions_limit:flags.0?int paid_enabled:flags.1?Bool = Updates;\nmessages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions;\nmessages.setDefaultReaction#4f47a016 reaction:Reaction = Bool;\nmessages.translateText#a5eec345 flags:# peer:flags.0?InputPeer id:flags.0?Vector<int> text:flags.1?Vector<TextWithEntities> to_lang:string tone:flags.2?string = messages.TranslatedText;\nmessages.getUnreadReactions#bd7f90ac flags:# peer:InputPeer top_msg_id:flags.0?int saved_peer_id:flags.1?InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;\nmessages.readReactions#9ec44f93 flags:# peer:InputPeer top_msg_id:flags.0?int saved_peer_id:flags.1?InputPeer = 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 compact:flags.7?true fullscreen:flags.8?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#413a3e73 flags:# from_switch_webview:flags.1?true from_side_menu:flags.2?true compact:flags.7?true fullscreen:flags.8?true bot:InputUser url:flags.3?string start_param:flags.4?string theme_params:flags.0?DataJSON platform:string = WebViewResult;\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#53618bce flags:# write_allowed:flags.0?true compact:flags.7?true fullscreen:flags.8?true peer:InputPeer app:InputBotApp start_param:flags.1?string theme_params:flags.2?DataJSON platform:string = WebViewResult;\nmessages.getSavedDialogs#1e91fc99 flags:# exclude_pinned:flags.0?true parent_peer:flags.1?InputPeer offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.SavedDialogs;\nmessages.getSavedHistory#998ab009 flags:# parent_peer:flags.0?InputPeer peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;\nmessages.deleteSavedHistory#4dc5085f flags:# parent_peer:flags.0?InputPeer peer:InputPeer max_id:int min_date:flags.2?int max_date:flags.3?int = messages.AffectedHistory;\nmessages.getPinnedSavedDialogs#d63d94e0 = messages.SavedDialogs;\nmessages.toggleSavedDialogPin#ac81bbde flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;\nmessages.getSavedReactionTags#3637e05b flags:# peer:flags.0?InputPeer hash:long = messages.SavedReactionTags;\nmessages.updateSavedReactionTag#60297dec flags:# reaction:Reaction title:flags.0?string = Bool;\nmessages.getDefaultTagReactions#bdf93428 hash:long = messages.Reactions;\nmessages.getOutboxReadDate#8c4bfe5d peer:InputPeer msg_id:int = OutboxReadDate;\nmessages.getQuickReplies#d483f2a8 hash:long = messages.QuickReplies;\nmessages.getQuickReplyMessages#94a495c3 flags:# shortcut_id:int id:flags.0?Vector<int> hash:long = messages.Messages;\nmessages.sendQuickReplyMessages#6c750de1 peer:InputPeer shortcut_id:int id:Vector<int> random_id:Vector<long> = Updates;\nmessages.toggleDialogFilterTags#fd2dda49 enabled:Bool = Bool;\nmessages.getAvailableEffects#dea20a39 hash:int = messages.AvailableEffects;\nmessages.getFactCheck#b9cdc5ee peer:InputPeer msg_id:Vector<int> = Vector<FactCheck>;\nmessages.requestMainWebView#c9e01e7b flags:# compact:flags.7?true fullscreen:flags.8?true peer:InputPeer bot:InputUser start_param:flags.1?string theme_params:flags.0?DataJSON platform:string = WebViewResult;\nmessages.sendPaidReaction#58bbcb50 flags:# peer:InputPeer msg_id:int count:int random_id:long private:flags.0?PaidReactionPrivacy = Updates;\nmessages.getPaidReactionPrivacy#472455aa = Updates;\nmessages.viewSponsoredMessage#269e3643 random_id:bytes = Bool;\nmessages.clickSponsoredMessage#8235057e flags:# media:flags.0?true fullscreen:flags.1?true random_id:bytes = Bool;\nmessages.reportSponsoredMessage#12cbf0c4 random_id:bytes option:bytes = channels.SponsoredMessageReportResult;\nmessages.getSponsoredMessages#3d6ce850 flags:# peer:InputPeer msg_id:flags.0?int = messages.SponsoredMessages;\nmessages.getPreparedInlineMessage#857ebdb8 bot:InputUser id:string = messages.PreparedInlineMessage;\nmessages.reportMessagesDelivery#5a6d7395 flags:# push:flags.0?true peer:InputPeer id:Vector<int> = Bool;\nmessages.toggleTodoCompleted#d3e03124 peer:InputPeer msg_id:int completed:Vector<int> incompleted:Vector<int> = Updates;\nmessages.appendTodoList#21a61057 peer:InputPeer msg_id:int list:Vector<TodoItem> = Updates;\nmessages.toggleSuggestedPostApproval#8107455c flags:# reject:flags.1?true peer:InputPeer msg_id:int schedule_date:flags.0?int reject_comment:flags.2?string = Updates;\nmessages.getForumTopics#3ba47bff flags:# peer:InputPeer q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics;\nmessages.getForumTopicsByID#af0a4a08 peer:InputPeer topics:Vector<int> = messages.ForumTopics;\nmessages.editForumTopic#cecc1134 flags:# peer:InputPeer topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates;\nmessages.updatePinnedForumTopic#175df251 peer:InputPeer topic_id:int pinned:Bool = Updates;\nmessages.createForumTopic#2f98c3d5 flags:# title_missing:flags.4?true peer:InputPeer title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates;\nmessages.deleteTopicHistory#d2816f10 peer:InputPeer top_msg_id:int = messages.AffectedHistory;\nmessages.summarizeText#abbbd346 flags:# peer:InputPeer id:int to_lang:flags.0?string tone:flags.2?string = TextWithEntities;\nmessages.editChatCreator#f743b857 peer:InputPeer user_id:InputUser password:InputCheckPasswordSRP = Updates;\nmessages.getFutureChatCreatorAfterLeave#3b7d0ea6 peer:InputPeer = User;\nmessages.editChatParticipantRank#a00f32b0 peer:InputPeer participant:InputPeer rank:string = Updates;\nmessages.declineUrlAuth#35436bbc url:string = Bool;\nmessages.checkUrlAuthMatchCode#c9a47b0b url:string match_code:string = Bool;\nmessages.composeMessageWithAI#daecc589 flags:# proofread:flags.0?true emojify:flags.3?true text:TextWithEntities translate_to_lang:flags.1?string tone:flags.2?InputAiComposeTone = messages.ComposedMessageWithAI;\nmessages.addPollAnswer#19bc4b6d peer:InputPeer msg_id:int answer:PollAnswer = Updates;\nmessages.getUnreadPollVotes#43286cf2 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.readPollVotes#1720b4d8 flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory;\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.getPromoData#c0977421 = help.PromoData;\nhelp.dismissSuggestion#f50dbaa1 peer:InputPeer suggestion:string = Bool;\nhelp.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;\nhelp.getPremiumPromo#b81b93d4 = help.PremiumPromo;\nhelp.getPeerColors#da80f42f hash:int = help.PeerColors;\nhelp.getPeerProfileColors#abcfa9fd hash:int = help.PeerColors;\nhelp.getTimezonesList#49b30240 hash:int = help.TimezonesList;\nchannels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;\nchannels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.AffectedMessages;\nchannels.reportSpam#f44a8315 channel:InputChannel participant:InputPeer id:Vector<int> = Bool;\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#9a98ad68 flags:# channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:flags.0?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#c9e33d54 channel:InputChannel users:Vector<InputUser> = messages.InvitedUsers;\nchannels.deleteChannel#c0111fe3 channel:InputChannel = Updates;\nchannels.exportMessageLink#e63fadeb flags:# grouped:flags.0?true thread:flags.1?true channel:InputChannel id:int = ExportedMessageLink;\nchannels.toggleSignatures#418d549c flags:# signatures_enabled:flags.0?true profiles_enabled:flags.1?true channel:InputChannel = 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.getSendAs#e785a43f flags:# for_paid_reactions:flags.0?true for_live_stories:flags.1?true peer:InputPeer = channels.SendAsPeers;\nchannels.deleteParticipantHistory#367544db channel:InputChannel participant:InputPeer = messages.AffectedHistory;\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#3ff75734 channel:InputChannel enabled:Bool tabs:Bool = Updates;\nchannels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates;\nchannels.toggleViewForumAsMessages#9738bb15 channel:InputChannel enabled:Bool = Updates;\nchannels.getChannelRecommendations#25a71742 flags:# channel:flags.0?InputChannel = messages.Chats;\nchannels.searchPosts#f2c4f24d flags:# hashtag:flags.0?string query:flags.1?string offset_rate:int offset_peer:InputPeer offset_id:int limit:int allow_paid_stars:flags.2?long = messages.Messages;\nchannels.updatePaidMessagesPrice#4b12327b flags:# broadcast_messages_allowed:flags.0?true channel:InputChannel send_paid_messages_stars:long = Updates;\nchannels.toggleAutotranslation#167fc0a1 channel:InputChannel enabled:Bool = Updates;\nchannels.checkSearchPostsFlood#22567115 flags:# query:flags.0?string = SearchPostsFlood;\nchannels.setMainProfileTab#3583fcb1 channel:InputChannel tab:ProfileTab = Bool;\nbots.setBotInfo#10cf3123 flags:# bot:flags.2?InputUser lang_code:string name:flags.3?string about:flags.0?string description:flags.1?string = Bool;\nbots.canSendMessage#1359f4e6 bot:InputUser = Bool;\nbots.allowSendMessage#f132e3ef bot:InputUser = Updates;\nbots.invokeWebViewCustomMethod#87fc5e7 bot:InputUser custom_method:string params:DataJSON = DataJSON;\nbots.getPopularAppBots#c2510192 offset:string limit:int = bots.PopularAppBots;\nbots.getPreviewMedias#a2a5594d bot:InputUser = Vector<BotPreviewMedia>;\nbots.toggleUserEmojiStatusPermission#6de6392 bot:InputUser enabled:Bool = Bool;\nbots.checkDownloadFileParams#50077589 bot:InputUser file_name:string url:string = Bool;\nbots.getBotRecommendations#a1b70815 bot:InputUser = users.Users;\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;\npayments.getPremiumGiftCodeOptions#2757ba54 flags:# boost_peer:flags.0?InputPeer = Vector<PremiumGiftCodeOption>;\npayments.checkGiftCode#8e51b4c1 slug:string = payments.CheckedGiftCode;\npayments.applyGiftCode#f6e26854 slug:string = Updates;\npayments.getGiveawayInfo#f4239425 peer:InputPeer msg_id:int = payments.GiveawayInfo;\npayments.launchPrepaidGiveaway#5ff58f20 peer:InputPeer giveaway_id:long purpose:InputStorePaymentPurpose = Updates;\npayments.getStarsTopupOptions#c00ec7d3 = Vector<StarsTopupOption>;\npayments.getStarsStatus#4ea9b3bf flags:# ton:flags.0?true peer:InputPeer = payments.StarsStatus;\npayments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true ton:flags.4?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;\npayments.sendStarsForm#7998c914 form_id:long invoice:InputInvoice = payments.PaymentResult;\npayments.refundStarsCharge#25ae8f4a user_id:InputUser charge_id:string = Updates;\npayments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true ton:flags.1?true peer:InputPeer = payments.StarsRevenueStats;\npayments.getStarsTransactionsByID#2dca16b8 flags:# ton:flags.0?true peer:InputPeer id:Vector<InputStarsTransaction> = payments.StarsStatus;\npayments.getStarsGiftOptions#d3c96bc8 flags:# user_id:flags.0?InputUser = Vector<StarsGiftOption>;\npayments.getStarsSubscriptions#32512c5 flags:# missing_balance:flags.0?true peer:InputPeer offset:string = payments.StarsStatus;\npayments.changeStarsSubscription#c7770878 flags:# peer:InputPeer subscription_id:string canceled:flags.0?Bool = Bool;\npayments.fulfillStarsSubscription#cc5bebb3 peer:InputPeer subscription_id:string = Bool;\npayments.getStarsGiveawayOptions#bd1efd3e = Vector<StarsGiveawayOption>;\npayments.getStarGifts#c4563590 hash:int = payments.StarGifts;\npayments.saveStarGift#2a2a697c flags:# unsave:flags.0?true stargift:InputSavedStarGift = Bool;\npayments.convertStarGift#74bf076b stargift:InputSavedStarGift = Bool;\npayments.getStarGiftUpgradePreview#9c9abcb1 gift_id:long = payments.StarGiftUpgradePreview;\npayments.upgradeStarGift#aed6e4f5 flags:# keep_original_details:flags.0?true stargift:InputSavedStarGift = Updates;\npayments.transferStarGift#7f18176a stargift:InputSavedStarGift to_id:InputPeer = Updates;\npayments.getUniqueStarGift#a1974d72 slug:string = payments.UniqueStarGift;\npayments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer_color_available:flags.9?true exclude_hosted:flags.10?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts;\npayments.getStarGiftWithdrawalUrl#d06e93a8 stargift:InputSavedStarGift password:InputCheckPasswordSRP = payments.StarGiftWithdrawalUrl;\npayments.toggleStarGiftsPinnedToTop#1513e7b0 peer:InputPeer stargift:Vector<InputSavedStarGift> = Bool;\npayments.getResaleStarGifts#7a5fa236 flags:# sort_by_price:flags.1?true sort_by_num:flags.2?true for_craft:flags.4?true stars_only:flags.5?true attributes_hash:flags.0?long gift_id:long attributes:flags.3?Vector<StarGiftAttributeId> offset:string limit:int = payments.ResaleStarGifts;\npayments.updateStarGiftPrice#edbe6ccb stargift:InputSavedStarGift resell_amount:StarsAmount = Updates;\npayments.getStarGiftCollections#981b91dd peer:InputPeer hash:long = payments.StarGiftCollections;\npayments.getUniqueStarGiftValueInfo#4365af6b slug:string = payments.UniqueStarGiftValueInfo;\npayments.checkCanSendGift#c0c4edc9 gift_id:long = payments.CheckCanSendGiftResult;\npayments.getStarGiftAuctionState#5c9ff4d6 auction:InputStarGiftAuction version:int = payments.StarGiftAuctionState;\npayments.getStarGiftAuctionAcquiredGifts#6ba2cbec gift_id:long = payments.StarGiftAuctionAcquiredGifts;\npayments.getStarGiftActiveAuctions#a5d0514d hash:long = payments.StarGiftActiveAuctions;\npayments.resolveStarGiftOffer#e9ce781c flags:# decline:flags.0?true offer_msg_id:int = Updates;\npayments.getStarGiftUpgradeAttributes#6d038b58 gift_id:long = payments.StarGiftUpgradeAttributes;\npayments.getCraftStarGifts#fd05dd00 gift_id:long offset:string limit:int = payments.SavedStarGifts;\npayments.craftStarGift#b0f9684f stargift:Vector<InputSavedStarGift> = Updates;\nphone.getCallConfig#55451fa9 = DataJSON;\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#8fb53057 flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string public_key:flags.3?int256 block:flags.3?bytes 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.getDifference#cd984aa5 lang_pack:string lang_code:string from_version:int = LangPackDifference;\nlangpack.getLanguages#42c6978f lang_pack:string = Vector<LangPackLanguage>;\nlangpack.getLanguage#6a596502 lang_pack:string lang_code:string = 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#5f150144 channel:InputChannel msg_id:int offset:string limit:int = stats.PublicForwards;\nstats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;\nstats.getStoryStats#374fef40 flags:# dark:flags.0?true peer:InputPeer id:int = stats.StoryStats;\nstats.getStoryPublicForwards#a6437ef6 peer:InputPeer id:int offset:string limit:int = stats.PublicForwards;\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#2c63a72b 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> music:flags.4?InputDocument = 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 forwards_first:flags.3?true peer:InputPeer q:flags.1?string id:int offset:string limit:int = stories.StoryViewsList;\nstories.getStoriesViews#28e16cc8 peer:InputPeer id:Vector<int> = stories.StoryViews;\nstories.exportStoryLink#7b8def20 peer:InputPeer id:int = ExportedStoryLink;\nstories.report#19d8eb45 peer:InputPeer id:Vector<int> option:bytes message:string = ReportResult;\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#78499170 id:Vector<InputPeer> = Vector<RecentStory>;\nstories.togglePeerStoriesHidden#bd0415c4 peer:InputPeer hidden:Bool = Bool;\nstories.togglePinnedToTop#b297e9b peer:InputPeer id:Vector<int> = Bool;\nstories.getAlbums#25b3eac7 peer:InputPeer hash:long = stories.Albums;\nstories.getAlbumStories#ac806d61 peer:InputPeer album_id:int offset:int limit:int = stories.Stories;\npremium.getBoostsList#60f67660 flags:# gifts:flags.0?true peer:InputPeer offset:string limit:int = premium.BoostsList;\npremium.getMyBoosts#be77b4a = premium.MyBoosts;\npremium.applyBoost#6b7da746 flags:# slots:flags.0?Vector<int> peer:InputPeer = premium.MyBoosts;\npremium.getBoostsStatus#42f1f61 peer:InputPeer = premium.BoostsStatus;\nfragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo;\naicompose.createTone#4aa83913 flags:# display_author:flags.0?true emoji_id:long title:string prompt:string = AiComposeTone;\naicompose.updateTone#903bcf59 flags:# tone:InputAiComposeTone display_author:flags.0?Bool emoji_id:flags.1?long title:flags.2?string prompt:flags.3?string = AiComposeTone;\naicompose.saveTone#1782cbb1 tone:InputAiComposeTone unsave:Bool = Bool;\naicompose.deleteTone#dd39316a tone:InputAiComposeTone = Bool;\naicompose.getTone#b2e8ba03 tone:InputAiComposeTone = aicompose.Tones;\naicompose.getTones#abd59201 hash:long = aicompose.Tones;\naicompose.getToneExample#d1b4ab14 tone:InputAiComposeTone num:int = AiComposeToneExample;"),[s,n]=Ie("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<FutureSalt> = 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;");return{constructors:[].concat(e,s),requests:[].concat(t,n)}}(),Se&&localStorage.setItem(we,JSON.stringify(e))),function(e,t){const s={...e};return Object.keys(t).forEach(e=>{"function"!=typeof t[e]&&s[e]?Object.assign(s[e],t[e]):s[e]=t[e]}),s}(Ce("constructor",e.constructors),Ce("request",e.requests))}();class Ae extends Error{constructor(e,t,s){super("RPCError {0}: {1}{2}".replace("{0}",s.toString()).replace("{1}",e).replace("{2}",Ae._fmtRequest(t))),this.code=s,this.errorMessage=e}static _fmtRequest(e){return e?` (caused by ${e.className})`:""}}class Re extends Ae{}class ke extends Ae{}class Te extends Ae{}class Be extends Ae{}class De extends Ae{constructor(e){super("Timeout",e.request,e.code)}}class Ue extends Re{constructor(e){const t=Number(e.capture||0);super(e.errorMessage,e.request,e.code),this.newDc=t}}class Ee extends Re{constructor(e){const t=Number(e.capture||0);super(e.errorMessage,e.request,e.code),this.newDc=t}}class xe extends Te{constructor(e){const t=Number(e.capture||0);super(e.errorMessage,e.request,e.code),this.seconds=t}}class Ve extends xe{constructor(e){const t=Number(e.capture||0);super(e),this.seconds=t}}class Ge extends Te{constructor(e){super(e.errorMessage,e.request,e.code)}}class Fe extends Te{constructor(e){const t=Number(e.capture||0);super(e.errorMessage,e.request,e.code),this.seconds=t}}class Ne extends Re{constructor(e){const t=Number(e.capture||0);super(e.errorMessage,e.request,e.code),this.newDc=t}}class qe extends ke{constructor(e){const t=Number(e.capture||0);super(e.errorMessage,e.request,e.code),this.codeLength=t}}class He extends ke{constructor(e){const t=Number(e.capture||0);super(e.errorMessage,e.request,e.code),this.seconds=t}}class Le extends ke{constructor(e){const t=Number(e.capture||0);super(e.errorMessage,e.request,e.code),this.seconds=t}}class Oe extends Error{constructor(e){super("Passkey login requested"),this.message="RESTART_AUTH_WITH_PASSKEY",this.credentialJson=e}}class je extends Error{constructor(e){super("User already authorized"),this.message="USER_ALREADY_AUTHORIZED",this.userId=e}}class We extends Ae{constructor(e){super(e.errorMessage,e.request,e.code)}}const ze=new Map([[/FILE_MIGRATE_(\d+)/,class extends Re{constructor(e){const t=Number(e.capture||0);super(e.errorMessage,e.request,e.code),this.newDc=t}}],[/FLOOD_TEST_PHONE_WAIT_(\d+)/,Fe],[/FLOOD_WAIT_(\d+)/,xe],[/FLOOD_PREMIUM_WAIT_(\d+)/,Ve],[/MSG_WAIT_(.*)/,Ge],[/PHONE_MIGRATE_(\d+)/,Ee],[/SLOWMODE_WAIT_(\d+)/,class extends Te{constructor(e){const t=Number(e.capture||0);super(e.errorMessage,e.request,e.code),this.seconds=t}}],[/USER_MIGRATE_(\d+)/,Ue],[/NETWORK_MIGRATE_(\d+)/,Ne],[/EMAIL_UNCONFIRMED_(\d+)/,qe],[/PASSWORD_TOO_FRESH_(\d+)/,He],[/SESSION_TOO_FRESH_(\d+)/,Le],[/^Timeout$/,De],[/PASSKEY_CREDENTIAL_NOT_FOUND/,We]]);Error;class Ke 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}}Error;class $e 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.toString()})`),this.code=t,this.payload=e}}class Je extends Error{constructor(...e){e.length||(e=["A security check failed."]),super(...e)}}class Qe extends Error{static ErrorMessages={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."};constructor(e,t){let s=Qe.ErrorMessages[t]||`Unknown error code (this should not happen): ${t}.`;s+=` Caused by ${e.className}`,super(s),this.errorMessage=s,this.code=t}}class Xe{constructor(){this._queue=[],this.resolvePush=()=>{},this.resolveGet=()=>{},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}}var Ye=s(69861),Ze=s(48287).hp;class et{static CONSTRUCTOR_ID=812830625;static classType="constructor";constructor(e){this.data=e,this.CONSTRUCTOR_ID=812830625,this.classType="constructor"}static gzipIfNeeded(e,t){if(e&&t.length>512){const e=new et(t).toBytes();if(e.length<t.length)return e}return t}static gzip(e){return Ze.from((0,Ye.u3)(e))}static ungzip(e){return Ze.from((0,Ye.Wt)(e))}toBytes(){const e=Ze.alloc(4);return e.writeUInt32LE(et.CONSTRUCTOR_ID,0),Ze.concat([e,_e(et.gzip(this.data))])}static async fromReader(e){const t=e.tgReadBytes();return new et(et.ungzip(t))}}class tt{static SIZE_OVERHEAD=12;static classType="constructor";constructor(e,t,s){this.msgId=e,this.seqNo=t,this.obj=s}}class st{static CONSTRUCTOR_ID=1945237724;static classType="constructor";static MAXIMUM_SIZE=1044448;static MAXIMUM_LENGTH=100;constructor(e){this.CONSTRUCTOR_ID=1945237724,this.messages=e,this.classType="constructor"}static fromReader(e){const t=[],s=e.readInt();for(let n=0;n<s;n++){const s=e.readLong(),n=e.readInt(),a=e.readInt(),i=e.tellPosition(),o=e.tgReadObject();e.setPosition(i+a);const r=new tt(s,n,o);t.push(r)}return new st(t)}}class nt{static CONSTRUCTOR_ID=4082920705;static classType="constructor";constructor(e,t,s){this.CONSTRUCTOR_ID=4082920705,this.reqMsgId=e,this.body=t,this.error=s,this.classType="constructor"}static async fromReader(e){const t=e.readLong(),s=e.readInt(!1);return s===Me.RpcError.CONSTRUCTOR_ID?new nt(t,void 0,Me.RpcError.fromReader(e)):s===et.CONSTRUCTOR_ID?new nt(t,(await et.fromReader(e)).data):(e.seek(-4),new nt(t,e.read(),void 0))}}const at=new Map([[nt.CONSTRUCTOR_ID,nt],[et.CONSTRUCTOR_ID,et],[st.CONSTRUCTOR_ID,st]]),it={};for(const e of Object.values(Me))if("CONSTRUCTOR_ID"in e)it[e.CONSTRUCTOR_ID]=e;else for(const t of Object.values(e))it[t.CONSTRUCTOR_ID]=t;class ot{constructor(e){this.stream=e,this._last=void 0,this.offset=0}readByte(){return this.read(1)[0]}readInt(e=!0){let t;return t=e?this.stream.readInt32LE(this.offset):this.stream.readUInt32LE(this.offset),this.offset+=4,t}readLong(e=!0){return this.readLargeInt(64,e)}readFloat(){return this.read(4).readFloatLE(0)}readDouble(){return this.read(8).readDoubleLE(0)}readLargeInt(e,t=!0){return H(this.read(Math.floor(e/8)),!0,t)}read(e=-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.toString()}); last read ${this._last?.toString()}`);return this._last=t,t}getBuffer(){return this.stream}tgReadBytes(){const e=this.readByte();let t,s;254===e?(s=this.readByte()|this.readByte()<<8|this.readByte()<<16,t=s%4):(s=e,t=(s+1)%4);const n=this.read(s);return t>0&&(t=4-t,this.read(t)),n}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=it[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 s=0;s<t;s++)e.push(this.tgReadObject());return e}if(t=at.get(e),void 0===t){this.seek(-4);const t=this.tellPosition(),s=new Ke(e,this.read());throw this.setPosition(t),s}}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 s=0;s<e;s++)t.push(this.tgReadObject());return t}tellPosition(){return this.offset}setPosition(e){this.offset=e}seek(e){this.offset+=e}}var rt=s(48287).hp;class dt{constructor(e){this._buffers=[e]}write(e){this._buffers.push(e)}getValue(){return rt.concat(this._buffers)}}var ct=s(48287).hp;const ut=new Error("HttpStream was closed");AbortSignal.timeout??=function(e){const t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};class lt{stream=[];canRead=Promise.resolve();constructor(e){this.isClosed=!0,this.disconnectedCallback=e}async readExactly(e){let t=ct.alloc(0);for(;;){const s=await this.read();if(t=ct.concat([t,s]),(e-=s.length)<=0)return t}}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}static getURL(e,t,s,n){return 443===t?`https://${e}:${t}/apiw1${s?"_test":""}${n?"_premium":""}`:`http://${e}:${t}/apiw1${s?"_test":""}${n?"_premium":""}`}async connect(e,t,s=!1,n=!1){this.stream=[],this.canRead=new Promise((e,t)=>{this.resolveRead=e,this.rejectRead=t}),this.url=lt.getURL(t,e,s,n),await fetch(this.url,{method:"POST",body:ct.from([]),mode:"cors",signal:AbortSignal.timeout(1e4)}),this.isClosed=!1}write(e){if(this.isClosed||!this.url)throw this.handleDisconnect(),ut;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 ut;const t=await e.arrayBuffer();this.stream=this.stream.concat(ct.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}}let ft;class gt{static LEVEL_MAP=new Map([["error",new Set(["error"])],["warn",new Set(["error","warn"])],["info",new Set(["error","warn","info"])],["debug",new Set(["error","warn","info","debug"])]]);constructor(e){ft||(ft=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){ft=e}canSend(e){return!!ft&&gt.LEVEL_MAP.get(ft).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,t,s){ft&&this.canSend(e)&&console.log(this.colors.start+this.format(t,e),s)}}var pt=s(48287).hp;const ht=new Set(["messages.SendMessage","messages.SendMedia","messages.SendMultiMedia","messages.ForwardMessages","messages.SendInlineBotResult"]);class mt{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,t=!0,s=!1){if(e&&ht.has(e.request.className))if(s){for(let t=0;t<this._queue.length;t++)if(ht.has(this._queue[t]?.request.className)){this._queue[t].after=e;break}}else for(let t=this._queue.length-1;t>=0;t--)if(ht.has(this._queue[t]?.request.className)){e.after=this._queue[t];break}s?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)}getBeacon(e){const t=new dt(pt.alloc(0));if(e.data.length+tt.SIZE_OVERHEAD<=st.MAXIMUM_SIZE){let s;return e.after&&(s=e.after.msgId),e.msgId=this._state.writeDataAsMessage(t,e.data,"request"===e.request.classType,s),this._log.debug(`Assigned msgId = ${e.msgId.toString()} 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?.(new Error("Request Payload is too big"))}async wait(){this._queue.length||(this._ready=new Promise(e=>{this.setReady=e}),await this._ready)}get(){if(!this._queue[this._queue.length-1])return void(this._queue=this._queue.filter(Boolean));let e,t=new dt(pt.alloc(0));const s=[];let n=0;for(;this._queue.length&&s.length<=st.MAXIMUM_LENGTH;){const e=this._queue.shift();if(e)if(e.abortSignal?.aborted)e.reject?.(new Error("Request aborted"));else{if(n+=e.data.length+tt.SIZE_OVERHEAD,n<=st.MAXIMUM_SIZE){let n;e.after&&(n=e.after.msgId),e.msgId=this._state.writeDataAsMessage(t,e.data,"request"===e.request.classType,n),this._log.debug(`Assigned msgId = ${e.msgId.toString()} to ${e.request.className||e.request.constructor.name}`),s.push(e);continue}if(s.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?.(new Error("Request Payload is too big")),n=0}}if(s.length){if(s.length>1){const n=pt.alloc(8);n.writeUInt32LE(st.CONSTRUCTOR_ID,0),n.writeInt32LE(s.length,4),e=pt.concat([n,t.getValue()]),t=new dt(pt.alloc(0));const a=this._state.writeDataAsMessage(t,e,!1);for(const e of s)e.containerId=a}return e=t.getValue(),{batch:s,data:e}}}}var yt=s(80129),_t=s(48287).hp;const bt=new Error("WebSocket was closed");class St{mutex=new yt.eu;constructor(e){this.client=void 0,this.closed=!0,this.stream=_t.alloc(0),this.disconnectedCallback=e,this.timeout=3e3}async readExactly(e){let t=_t.alloc(0);for(;;){const s=await this.read(e);if(t=_t.concat([t,s]),!(e-=s.length))return t}}async read(e){if(this.closed)throw bt;if(await this.canRead,this.closed)throw bt;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 bt;const e=this.stream;return this.stream=_t.alloc(0),this.canRead=new Promise(e=>{this.resolveRead=e}),e}getWebSocketLink(e,t,s,n){return 443===t?`wss://${e}:${t}/apiws${s?"_test":""}${n?"_premium":""}`:`ws://${e}:${t}/apiws${s?"_test":""}${n?"_premium":""}`}connect(e,t,s=!1,n=!1){return this.stream=_t.alloc(0),this.canRead=new Promise(e=>{this.resolveRead=e}),this.closed=!1,this.website=this.getWebSocketLink(t,e,s,n),this.client=new WebSocket(this.website,"binary"),this.client.binaryType="arraybuffer",new Promise((e,s)=>{if(!this.client)return;let n,a=!1;this.client.onopen=()=>{this.receive(),e(this),a=!0,n&&clearTimeout(n)},this.client.onerror=e=>{console.error("WebSocket error",e),s(e),a=!0,n&&clearTimeout(n)},this.client.onclose=e=>{const{code:s,reason:i,wasClean:o}=e;1e3!==s&&console.error(`Socket ${t} closed. Code: ${s}, reason: ${i}, was clean: ${o}`),this.resolveRead?.(!1),this.closed=!0,this.disconnectedCallback&&this.disconnectedCallback(),a=!0,n&&clearTimeout(n)},n=setTimeout(()=>{a||(s(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),n=void 0)},this.timeout),self.addEventListener("offline",()=>{this.close(),this.resolveRead?.(!1)})})}write(e){if(this.closed)throw bt;this.client?.send(e)}close(){this.client?.close(),this.closed=!0}receive(){this.client&&(this.client.onmessage=async e=>{await this.mutex.runExclusive(async()=>{const t=e.data instanceof ArrayBuffer?_t.from(e.data):_t.from(await new Response(e.data).arrayBuffer());this.stream=_t.concat([this.stream,t]),this.resolveRead?.(!0)})})}}class wt{constructor({ip:e,port:t,dcId:s,loggers:n,isPremium:a,isTestServer:i}){this._ip=e,this._port=t,this._dcId=s,this._log=n,this._isTestServer=i,this._isPremium=a,this._connected=!1,this._sendTask=void 0,this._recvTask=void 0,this._codec=void 0,this._obfuscation=void 0,this._sendArray=new Xe,this._recvArray=new Xe,this.shouldLongPoll=!1,this.socket=new St(this.disconnectCallback.bind(this))}isConnected(){return this._connected}disconnectCallback(){this.disconnect(!0)}async _connect(){this._log.debug("Connecting"),this._codec=new this.PacketCodecClass(this),await this.socket.connect(this._port,this._ip,this._isTestServer,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()}disconnect(e=!1){this._connected&&(this._connected=!1,this._recvArray.push(void 0),e||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);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","")}`}}class It extends wt{ObfuscatedIO=void 0;async _initConn(){this._obfuscation=new this.ObfuscatedIO(this),await this.socket.write(this._obfuscation.header)}_send(e){this._obfuscation.write(this._codec.encodePacket(e))}_recv(){return this._codec.readPacket(this._obfuscation)}}class vt{constructor(e){this._conn=e}encodePacket(e){throw new Error("Not Implemented")}readPacket(e){throw new Error("Not Implemented")}}class Pt extends wt{constructor(e){super(e),this.shouldLongPoll=!0,this.socket=new lt(this.disconnectCallback.bind(this)),this.href=lt.getURL(this._ip,this._port,this._isTestServer,this._isPremium)}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._isTestServer,this._isPremium),this._log.debug("Finished connecting")}async connect(){await this._connect(),this._connected=!0}}var Ct=s(48287).hp;class Mt extends vt{static tag=Ct.from("ef","hex");static obfuscateTag=Ct.from("efefefef","hex");constructor(e){super(e),this.tag=Mt.tag,this.obfuscateTag=Mt.obfuscateTag}encodePacket(e){const t=e.length>>2;let s;if(t<127){const e=Ct.alloc(1);e.writeUInt8(t,0),s=e}else s=Ct.concat([Ct.from("7f","hex"),O(BigInt(t),3)]);return Ct.concat([s,e])}async readPacket(e){let t=(await e.read(1))[0];return t>=127&&(t=Ct.concat([await e.read(3),Ct.alloc(1)]).readInt32LE(0)),e.read(t<<2)}}var At=s(48287).hp;class Rt{constructor(e,t){if(!At.isBuffer(e)||!At.isBuffer(t)||16!==t.length)throw new Error("Key and iv need to be a buffer");this.cipher=function(e,t,s){if("AES-256-CTR".includes("ECB"))throw new Error("Not supported");return new x(t,s)}(0,e,t),this.decipher=function(e,t,s){if("AES-256-CTR".includes("ECB"))throw new Error("Not supported");return new x(t,s)}(0,e,t)}encrypt(e){return At.from(this.cipher.update(e))}decrypt(e){return At.from(this.decipher.update(e))}}var kt=s(48287).hp;class Tt{header=void 0;constructor(e){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=[kt.from("50567247","hex"),kt.from("474554","hex"),kt.from("504f5354","hex"),kt.from("eeeeeeee","hex")];let s;for(;;)if(s=W(64),239!==s[0]&&!s.slice(4,8).equals(kt.alloc(4))){let e=!0;for(const n of t)if(n.equals(s.slice(0,4))){e=!1;break}if(e)break}s=s.toJSON().data;const n=kt.from(s.slice(8,56)).reverse(),a=kt.from(s.slice(8,40)),i=kt.from(s.slice(40,56)),o=kt.from(n.slice(0,32)),r=kt.from(n.slice(32,48)),d=new Rt(a,i),c=new Rt(o,r);return s=kt.concat([kt.from(s.slice(0,56)),e.obfuscateTag,kt.from(s.slice(60))]),s=kt.concat([kt.from(s.slice(0,56)),kt.from(d.encrypt(s).slice(56,64)),kt.from(s.slice(64))]),{random:s,encryptor:d,decryptor:c}}async read(e){const t=await this.connection.readExactly(e);return this._decrypt.encrypt(t)}write(e){this.connection.write(this._encrypt.encrypt(e))}}class Bt extends It{ObfuscatedIO=Tt;PacketCodecClass=Mt}class Dt{static disconnected=-1;static connected=1;static broken=0;constructor(e){this.state=e}}class Ut{constructor(e){this.timeOffset=e}}var Et=s(48287).hp;class xt{constructor(e,t){this.ige=new D.gj(e,t)}decryptIge(e){return $(this.ige.decrypt(e))}encryptIge(e){const t=e.length%16;return t&&(e=Et.concat([e,W(16-t)])),$(this.ige.encrypt(e))}}var Vt=s(48287).hp;class Gt{constructor(e,t,s=!1,n=!1){this.authKey=e,this._log=t,this._isCall=s,this._isOutgoing=n,this.timeOffset=0,this.salt=0n,this.id=0n,this._sequence=0,this._lastMsgId=0n,this.msgIds=[],this.reset()}reset(){this.id=function(e=!0){return H(W(8),!0,e)}(!0),this._sequence=0,this._lastMsgId=0n,this.msgIds=[]}updateMessageId(e){e.msgId=this._getNewMsgId()}async _calcKey(e,t,s){const n=this._isCall?128+(this._isOutgoing!==s?8:0):s?0:8,[a,i]=await Promise.all([Q(Vt.concat([t,e.slice(n,n+36)])),Q(Vt.concat([e.slice(n+40,n+76),t]))]),o=Vt.concat([a.slice(0,8),i.slice(8,24),a.slice(24,32)]);return this._isCall?{key:o,iv:Vt.concat([i.slice(0,4),a.slice(8,16),i.slice(24,28)])}:{key:o,iv:Vt.concat([i.slice(0,8),a.slice(8,24),i.slice(24,32)])}}writeDataAsMessage(e,t,s,n){const a=this._getNewMsgId(),i=this._getSeqNo(s);let o;o=void 0===n?et.gzipIfNeeded(s,t):et.gzipIfNeeded(s,new Me.InvokeAfterMsg({msgId:n,query:{getBytes:()=>t}}).getBytes());const r=Vt.alloc(4);r.writeInt32LE(i,0);const d=Vt.alloc(4);d.writeInt32LE(o.length,0);const c=L(a,8);return e.write(Vt.concat([c,r,d])),e.write(o),a}async encryptMessageData(e){if(!this.authKey)throw new Error("Auth key unset");await this.authKey.waitForKey();const t=this.authKey.getKey();if(!t)throw new Error("Auth key unset");if(void 0===this.salt||void 0===this.authKey.keyId)throw new Error("Unset params");if(this._isCall){const s=128+(this._isOutgoing?0:8),n=e.length;e=Vt.from(e),n%4!=0&&(e=Vt.concat([e,Vt.from(new Array(4-n%4).fill(32))]));const a=(await Q(Vt.concat([t.slice(88+s,88+s+32),Vt.from(e)]))).slice(8,24),{iv:i,key:o}=await this._calcKey(t,a,!0);return e=new Rt(o,i).encrypt(e),Vt.concat([a,e])}{const s=L(this.salt,8),n=L(this.id,8),a=W((-((e=Vt.concat([Vt.concat([s,n]),e])).length+12)%16+16)%16+12),i=(await Q(Vt.concat([t.slice(88,120),e,a]))).slice(8,24),{iv:o,key:r}=await this._calcKey(t,i,!0),d=O(this.authKey.keyId,8);return Vt.concat([d,i,new xt(r,o).encryptIge(Vt.concat([e,a]))])}}async decryptMessageData(e){if(!this.authKey)throw new Error("Auth key unset");if(e.length<8)throw new $e(e);if(e.length<0)throw new Je("Server replied with negative length");if(e.length%4!=0&&!this._isCall)throw new Je("Server replied with length not divisible by 4");if(!this._isCall&&H(e.slice(0,8))!==this.authKey.keyId)throw new Je("Server replied with an invalid auth key");const t=this.authKey.getKey();if(!t)throw new Je("Unset AuthKey");const s=this._isCall?e.slice(0,16):e.slice(8,24),n=this._isCall?128+(this._isOutgoing?8:0):0,{iv:a,key:i}=await this._calcKey(t,s,!1);if(this._isCall){const t=(e=e.slice(16)).length;e=Vt.concat([e,Vt.from(new Array(4-t%4).fill(0))]),e=(e=new Rt(i,a).decrypt(e)).slice(0,t)}else e=new xt(i,a).decryptIge(this._isCall?e.slice(16):e.slice(24));const o=this._isCall?await Q(Vt.concat([t.slice(88+n,88+n+32),e])):await Q(Vt.concat([t.slice(96,128),e]));if(!this._isCall&&!s.equals(o.slice(8,24)))throw new Je("Received msg_key doesn't match with expected one");const r=new ot(e);if(this._isCall)return r.readInt(!1),r.read(e.length-4);{if(r.readLong(),r.readLong()!==this.id)throw new Je("Server replied with a wrong session ID");const t=r.readLong();if(this.msgIds.includes(t.toString()))throw new Je("Duplicate msgIds");this.msgIds.length>500&&this.msgIds.shift();const s=r.readInt(),n=r.readInt(),a=e.length-n;if(a<12||a>1024)throw new Je("Server replied with the wrong message padding");const i=await r.tgReadObject();if(i?.className?.startsWith("Update")){const e=Math.floor(Date.now()/1e3),s=this.getMsgIdTimeLocal(t);if(s&&(s-e>30||e-s>300))throw new Je("The message time is incorrect.")}return i&&!("errorCode"in i)&&this.msgIds.push(t.toString()),new tt(t,s,i)}}_getNewMsgId(){const e=Date.now()/1e3+this.timeOffset,t=Math.floor(1e9*(e-Math.floor(e)));let s=BigInt(Math.floor(e))<<32n|BigInt(t)<<2n;return this._lastMsgId>=s&&(s=this._lastMsgId+4n),this._lastMsgId=s,s}getMsgIdTimeLocal(e){if(0n!==this._lastMsgId)return Number(e>>32n)-this.timeOffset}updateTimeOffset(e){const t=this._getNewMsgId(),s=this.timeOffset,n=Math.floor(Date.now()/1e3),a=Number(e>>32n);return this.timeOffset=a-n,this.timeOffset!==s&&(this._lastMsgId=0n,this._log.debug(`Updated time offset (old offset ${s}, bad ${t.toString()}, good ${e.toString()}, new ${this.timeOffset})`)),this.timeOffset}_getSeqNo(e){if(e){const e=2*this._sequence+1;return this._sequence+=1,e}return 2*this._sequence}}var Ft=s(48287).hp;class Nt{constructor(e,t){this._state=new Gt(void 0,t),this._connection=e}async send(e){let t=e.getBytes(),s=this._state._getNewMsgId();const n=L(s,8),a=Ft.alloc(4);a.writeInt32LE(t.length,0);const i=Ft.concat([Ft.concat([Ft.alloc(8),n,a]),t]);if(await this._connection.send(i),t=await this._connection.recv(),t.length<8)throw new $e(t);const o=new ot(t);if(0n!==o.readLong())throw new Error("Bad authKeyId");if(s=o.readLong(),0n===s)throw new Error("Bad msgId");if(o.readInt()<=0)throw new Error("Bad length");return o.tgReadObject()}}var qt=s(48287).hp;class Ht{constructor(e,t){if(!t||!e)return;this._key=e,this._hash=t;const s=new ot(t);this.auxHash=s.readLong(!1),s.read(4),this.keyId=s.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 Ht)return this._key=e._key,this.auxHash=e.auxHash,this.keyId=e.keyId,void(this._hash=e._hash);this._key=e,this._hash=await J(this._key);const t=new ot(this._hash);this.auxHash=t.readLong(!1),t.read(4),this.keyId=t.readLong(!1)}async waitForKey(){for(;void 0===this.keyId;)await te(20)}getKey(){return this._key}async calcNewNonceHash(e,t){if(void 0===this.auxHash)throw new Error("Auth key not set");const s=L(e,32),n=qt.alloc(1);n.writeUInt8(t,0);const a=qt.concat([s,qt.concat([n,O(this.auxHash,8,!0)])]);return H((await J(a)).slice(4,20),!0,!0)}equals(e){return e instanceof this.constructor&&this._key&&qt.isBuffer(e.getKey())&&e.getKey()?.equals(this._key)}}class Lt{constructor(){this._pending=new Map}set(e,t){this._pending.set(e,t)}get(e){return this._pending.get(e)}getAndDelete(e){const t=this.get(e);return this.delete(e),t}values(){return Array.from(this._pending.values())}delete(e){return this._pending.delete(e)}clear(){this._pending.clear()}}s(48287).hp;const Ot=[{fingerprint:BigInt("-3414540481677951611"),n:BigInt("29379598170669337022986177149456128565388431120058863768162556424047512191330847455146576344487764408661701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531316010870401287642763009136156734339538042419388722777357134487746169093539093850251243897188928735903389451772730245253062963384108812842079887538976360465290946139638691491496062099570836476454855996319192747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323"),e:65537},{fingerprint:BigInt("-5595554452916591101"),n:BigInt("25342889448840415564971689590713473206898847759084779052582026594546022463853940585885215951168491965708222649399180603818074200620463776135424884632162512403163793083921641631564740959529419359595852941166848940585952337613333022396096584117954892216031229237302943701877588456738335398602461675225081791820393153757504952636234951323237820036543581047826906120927972487366805292115792231423684261262330394324750785450942589751755390156647751460719351439969059949569615302809050721500330239005077889855323917509948255722081644689442127297605422579707142646660768825302832201908302295573257427896031830742328565032949"),e:65537}].reduce((e,{fingerprint:t,...s})=>(e.set(t,s),e),new Map);class jt{static gcd(e,t){for(;0n!==t;){const s=t;t=e%t,e=s}return e}static factorize(e){if(e%2n==0n)return{p:2n,q:e/2n};let t=ee(1n,e-1n);const s=ee(1n,e-1n),n=ee(1n,e-1n);let a,i=1n,o=1n,r=1n,d=0n,c=0n;for(;1n===i;){d=t;for(let n=0n;n<o;n++)t=(X(t,2n,e)+s)%e;for(a=0n;a<o&&1n===i;){c=t;const u=ue.min(n,o-a);for(let n=0n;n<u;n++)t=(X(t,2n,e)+s)%e,r=r*ue.abs(d-t)%e;i=jt.gcd(r,e),a+=n}o*=2n}if(i===e)for(;c=(X(c,2n,e)+s)%e,i=jt.gcd(ue.abs(d-c),e),!(i>1n););return r=e/i,i<r?{p:i,q:r}:{p:r,q:i}}}var Wt=s(48287).hp;class zt{constructor(){this.promise=new Promise((e,t)=>{this.reject=t,this.resolve=e})}static resolved(e){const t=new zt;return t.resolve(e),t}}class Kt{constructor(e,t){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 zt,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})}}var $t=s(48287).hp;class Jt{static 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};_isReconnectingToMain=!1;isConnecting=!1;_authenticated=!1;constructor(e,t){const s={...Jt.DEFAULT_OPTIONS,...t};this._connection=void 0,this._fallbackConnection=void 0,this._shouldForceHttpTransport=s.shouldForceHttpTransport,this._shouldAllowHttpTransport=s.shouldAllowHttpTransport,this._log=s.logger,this._dcId=s.dcId,this._senderIndex=s.senderIndex||0,this._retries=s.retries,this._retriesToFallback=s.retriesToFallback,this._delay=s.delay,this._retryMainConnectionDelay=s.retryMainConnectionDelay,this._authKeyCallback=s.authKeyCallback,this._updateCallback=s.updateCallback,this._autoReconnectCallback=s.autoReconnectCallback,this._isMainSender=Boolean(s.isMainSender),this._isExported=Boolean(s.isExported),this._onConnectionBreak=s.onConnectionBreak,this._isFallback=!1,this._getShouldDebugExportedSenders=s.getShouldDebugExportedSenders,this.userDisconnected=!1,this._userConnected=!1,this.isReconnecting=!1,this._disconnected=!0,this._sendLoopHandle=void 0,this._longPollLoopHandle=void 0,this._recvLoopHandle=void 0,this.authKey=e||new Ht,this._state=new Gt(this.authKey,this._log),this._sendQueue=new mt(this._state,this._log),this._sendQueueLongPoll=new mt(this._state,this._log),this._pendingState=new Lt,this._pendingAck=new Set,this._lastAcks=[],this._handlers={[nt.CONSTRUCTOR_ID]:this._handleRPCResult.bind(this),[st.CONSTRUCTOR_ID]:this._handleContainer.bind(this),[et.CONSTRUCTOR_ID]:this._handleGzipPacked.bind(this),[Me.Pong.CONSTRUCTOR_ID]:this._handlePong.bind(this),[Me.BadServerSalt.CONSTRUCTOR_ID]:this._handleBadServerSalt.bind(this),[Me.BadMsgNotification.CONSTRUCTOR_ID]:this._handleBadNotification.bind(this),[Me.MsgDetailedInfo.CONSTRUCTOR_ID]:this._handleDetailedInfo.bind(this),[Me.MsgNewDetailedInfo.CONSTRUCTOR_ID]:this._handleNewDetailedInfo.bind(this),[Me.NewSessionCreated.CONSTRUCTOR_ID]:this._handleNewSessionCreated.bind(this),[Me.MsgsAck.CONSTRUCTOR_ID]:this._handleAck.bind(this),[Me.FutureSalts.CONSTRUCTOR_ID]:this._handleFutureSalts.bind(this),[Me.MsgsStateReq.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[Me.MsgResendReq.CONSTRUCTOR_ID]:this._handleStateForgotten.bind(this),[Me.MsgsAllInfo.CONSTRUCTOR_ID]:this._handleMsgAll.bind(this)}}logWithIndexCallback(e){return(...t)=>{this._getShouldDebugExportedSenders&&this._getShouldDebugExportedSenders()&&console[e](`[${this._isExported?`idx=${this._senderIndex} `:"M "}dcId=${this._dcId}]`,...t)}}logWithIndex={debug:this.logWithIndexCallback("debug"),log:this.logWithIndexCallback("log"),warn:this.logWithIndexCallback("warn"),error:this.logWithIndexCallback("error")};getConnection(){return this._isFallback?this._fallbackConnection:this._connection}async connect(e,t,s){if(this.userDisconnected=!1,this._userConnected&&!t)return this._log.info("User is already connected!"),!1;this.isConnecting=!0,this._isFallback=this._shouldForceHttpTransport&&this._shouldAllowHttpTransport,this._connection=e,this._fallbackConnection=s;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._isExported||this._updateCallback?.(new Dt(Dt.connected));break}catch(t){this._isExported||0!==e||this._updateCallback?.(new Dt(Dt.disconnected)),this._log.error(`${this._isFallback?"HTTP":"WebSocket"} connection failed attempt: ${e+1}`),console.error(t),await te(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 te(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,this._fallbackConnection&&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 te(this._retryMainConnectionDelay),this.tryReconnectToMain()}}}isConnected(){return this._userConnected}disconnect(){this.userDisconnected=!0,this.logWithIndex.warn("Disconnecting...");const e=this.getConnection();e&&this._disconnect(e)}destroy(){this._sendQueue.clear()}send(e,t,s=!1){const n=new Kt(e,t);return s?this._sendQueueLongPoll.append(n):(this.logWithIndex.debug(`Send ${e.className}`),this._sendQueue.append(n)),n.promise}addStateToQueue(e){this._sendQueue.append(e)}async sendBeacon(e){if(!(this._userConnected&&this._fallbackConnection instanceof Pt))throw new Error("Cannot send requests while disconnected");const t=new Kt(e,void 0),s=this._sendQueue.getBeacon(t);if(!s)return;const n=await this._state.encryptMessageData(s);postMessage({payloads:[{type:"sendBeacon",data:n,url:this._fallbackConnection.href}]})}async _connect(e){const t=this.isReconnecting;if(e.isConnected()||(this._log.info("Connecting to {0}...".replace("{0}",e._ip)),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 Nt(e,this._log);this._log.debug("New auth_key attempt ...");const s=await async function(e,t){let s=W(16);const n=H(s,!1,!0),a=await e.send(new Me.ReqPqMulti({nonce:n}));if(t.debug("Starting authKey generation step 1"),!(a instanceof Me.ResPQ))throw new Je(`Step 1 answer was ${a}`);if(a.nonce!==n)throw new Je("Step 1 invalid nonce from server");const i=H(a.pq,!1,!0);t.debug("Finished authKey generation step 1");const{p:o,q:r}=jt.factorize(i),d=Y(o),c=Y(r);s=W(32);const u=H(s,!0,!0),l=new Me.PQInnerData({pq:Y(i),p:d,q:c,nonce:a.nonce,serverNonce:a.serverNonce,newNonce:u}).getBytes();if(l.length>144)throw new Je("Step 1 invalid nonce from server");let f,g;for(const e of a.serverPublicKeyFingerprints)if(g=Ot.get(e),void 0!==g){f=e;break}if(void 0===f||void 0===g)throw new Je("Step 2 could not find a valid key for fingerprints");const p=W(192-l.length),h=Wt.concat([l,p]),m=Wt.from(h).reverse();let y;for(let e=0;e<20;e++){const e=W(32),s=await Q(Wt.concat([e,h])),n=Wt.concat([m,s]),a=new xt(e,Wt.alloc(32)).encryptIge(n),i=se(e,await Q(a)),o=H(Wt.concat([i,a]),!1,!1);if(!(o>=g.n)){y=O(X(o,BigInt(g.e),g.n),256,!1,!1);break}t.debug("Aes key greater than RSA. retrying")}if(void 0===y)throw new Je("Step 2 could create a secure encrypted key");t.debug("Step 2 : Generated a secure aes encrypted data");const _=await e.send(new Me.ReqDHParams({nonce:a.nonce,serverNonce:a.serverNonce,p:d,q:c,publicKeyFingerprint:f,encryptedData:y}));if(!(_ instanceof Me.ServerDHParamsOk||_ instanceof Me.ServerDHParamsFail))throw new Error(`Step 2.1 answer was ${_}`);if(_.nonce!==a.nonce)throw new Je("Step 2 invalid nonce from server");if(_.serverNonce!==a.serverNonce)throw new Je("Step 2 invalid server nonce from server");if(_ instanceof Me.ServerDHParamsFail){const e=H(await J(L(u,32).slice(4,20)),!0,!0);if(_.newNonceHash!==e)throw new Je("Step 2 invalid DH fail nonce from server")}if(!(_ instanceof Me.ServerDHParamsOk))throw new Error(`Step 2.2 answer was ${_.className}`);t.debug("Finished authKey generation step 2"),t.debug("Starting authKey generation step 3");const{key:b,iv:S}=await async function(e,t){const s=L(e,16),n=L(t,32),[a,i,o]=await Promise.all([J(q.concat([n,s])),J(q.concat([s,n])),J(q.concat([n,n]))]);return{key:q.concat([a,i.slice(0,12)]),iv:q.concat([i.slice(12,20),o,n.slice(0,4)])}}(a.serverNonce,u);if(_.encryptedAnswer.length%16!=0)throw new Je("Step 3 AES block size mismatch");const w=new xt(b,S),I=w.decryptIge(_.encryptedAnswer),v=new ot(I),P=v.read(20),C=v.tgReadObject();if(!(C instanceof Me.ServerDHInnerData))throw new Error(`Step 3 answer was ${C}`);const M=await J(C.getBytes());if(!P.equals(M))throw new Je("Step 3 Invalid hash answer");if(C.nonce!==a.nonce)throw new Je("Step 3 Invalid nonce in encrypted answer");if(C.serverNonce!==a.serverNonce)throw new Je("Step 3 Invalid server nonce in encrypted answer");if(3!==C.g||"c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b"!==C.dhPrime.toString("hex"))throw new Je("Step 3 invalid dhPrime or g");const A=H(C.dhPrime,!1,!1),R=H(C.gA,!1,!1),k=C.serverTime-Math.floor(Date.now()/1e3),T=H(W(256),!1,!1),B=X(BigInt(C.g),T,A),D=X(R,T,A);if(R<=1n)throw new Je("Step 3 failed ga > 1 check");if(B<=1n)throw new Je("Step 3 failed gb > 1 check");if(R>=A-1n)throw new Je("Step 3 failed ga < dh_prime - 1 check");const U=2n**1984n;if(!(R>U&&R<A-U))throw new Je("Step 3 failed dh_prime - 2^{2048-64} < ga < 2^{2048-64} check");if(!(B>U&&B<A-U))throw new Je("Step 3 failed dh_prime - 2^{2048-64} < gb < 2^{2048-64} check");const E=new Me.ClientDHInnerData({nonce:a.nonce,serverNonce:a.serverNonce,retryId:0n,gB:Y(B,!1)}).getBytes(),x=Wt.concat([await J(E),E]),V=w.encryptIge(x),G=await e.send(new Me.SetClientDHParams({nonce:a.nonce,serverNonce:a.serverNonce,encryptedData:V})),F=[Me.DhGenOk,Me.DhGenRetry,Me.DhGenFail];if(!(G instanceof F[0]||G instanceof F[1]||G instanceof F[2]))throw new Error(`Step 3.1 answer was ${G}`);const{name:N}=G.constructor;if(G.nonce!==a.nonce)throw new Je(`Step 3 invalid ${N} nonce from server`);if(G.serverNonce!==a.serverNonce)throw new Je(`Step 3 invalid ${N} server nonce from server`);const j=new Ht;await j.setKey(Y(D));const z=1+["DhGenOk","DhGenRetry","DhGenFail"].indexOf(G.className),K=await j.calcNewNonceHash(u,z);if(G[`newNonceHash${z}`]!==K)throw new Je("Step 3 invalid new nonce hash");if(!(G instanceof Me.DhGenOk))throw new Error(`Step 3.2 answer was ${G.className}`);return t.debug("Finished authKey generation step 3"),{authKey:j,timeOffset:k}}(t,this._log);this._log.debug("Generated new auth_key successfully"),await this.authKey.setKey(s.authKey),this._state.timeOffset=s.timeOffset,this._isExported||this._updateCallback?.(new Ut(this._state.timeOffset)),this._authKeyCallback&&await this._authKeyCallback(this.authKey,this._dcId)}this._userConnected=!0,this.isReconnecting=!1,this._sendLoopHandle?t&&this.retryPendingStates():(this._log.debug("Starting send loop"),this._sendLoopHandle=this._sendLoop()),this._recvLoopHandle||(this._log.debug("Starting receive loop"),this._recvLoopHandle=this._recvLoop()),!this._longPollLoopHandle&&e.shouldLongPoll&&(this._log.debug("Starting long-poll loop"),this._longPollLoopHandle=this._longPollLoop()),this._log.info("Connection to %s complete!".replace("%s",e.toString()))}_disconnect(e){this._isExported||this._updateCallback?.(new Dt(Dt.disconnected)),void 0!==e?(this._log.info("Disconnecting from %s...".replace("%s",e.toString())),this._userConnected=!1,this._log.debug("Closing current connection..."),this.logWithIndex.warn("Disconnecting"),e.disconnect()):this._log.info("Not disconnecting (already have no connection)")}async _longPollLoop(){for(;this._userConnected&&!this.isReconnecting&&this._isFallback&&this.getConnection().shouldLongPoll;){await this._sendQueueLongPoll.wait();const e=this._sendQueueLongPoll.get();if(this.isReconnecting||!this._isFallback)return void(this._longPollLoopHandle=void 0);if(!e)continue;let{data:t}=e;const{batch:s}=e;this._log.debug(`Encrypting ${s.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.info("Connection closed while sending data"),console.error(e),this._longPollLoopHandle=void 0,this.isSendingLongPoll=!1,void(this.userDisconnected||this.reconnect())}this.isSendingLongPoll=!1,this.checkLongPoll()}this._longPollLoopHandle=void 0}async _sendLoop(){for(this.retryPendingStates();this._userConnected&&!this.isReconnecting;){const e=()=>{if(this._pendingAck.size){const e=new Kt(new Me.MsgsAck({msgIds:Array(...this._pendingAck)}));this._sendQueue.append(e),this._lastAcks.push(e),this._lastAcks.length>=10&&this._lastAcks.shift(),this._pendingAck.clear()}};e(),this.logWithIndex.debug(`Waiting for messages to send... ${this.isReconnecting}`),this._log.debug(`Waiting for messages to send... ${this.isReconnecting}`),await this._sendQueue.wait(),this._isFallback&&this.send(new Me.HttpWait({maxDelay:0,waitAfter:0,maxWait:0})),e();const t=this._sendQueue.get();if(this.logWithIndex.debug(`Got ${t?.batch.length} message(s) to send`),!t)continue;let{data:s}=t;const{batch:n}=t;for(const e of n)if(Array.isArray(e))for(const t of e)"request"===t.request.classType&&"HttpWait"!==t.request.className&&this._pendingState.set(t.msgId,t);else"request"===e.request.classType&&"HttpWait"!==e.request.className&&this._pendingState.set(e.msgId,e);if(this.isReconnecting)return this.logWithIndex.debug("Reconnecting :("),void(this._sendLoopHandle=void 0);this._log.debug(`Encrypting ${n.length} message(s) in ${s.length} bytes for sending`),this.logWithIndex.debug("Sending",n.map(e=>e.request.className));const a=this.getConnection();if(s=await this._state.encryptMessageData(s),this.isReconnecting)return this.logWithIndex.debug("Reconnecting :("),void(this._sendLoopHandle=void 0);if(a&&a===this.getConnection())try{await a.send(s)}catch(e){return this.logWithIndex.debug(`Connection closed while sending data ${e}`),this._log.info("Connection closed while sending data"),console.error(e),this._sendLoopHandle=void 0,void(this.userDisconnected||this.reconnect())}finally{for(const e of n)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")}else this.retryPendingStates()}this._sendLoopHandle=void 0}async _recvLoop(){let e,t;for(;this._userConnected&&!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.warn("Connection closed while receiving data"),console.error(e),this.reconnect()),void(this._recvLoopHandle=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 Ke){this._log.info(`Type ${e.invalidConstructorId} not found, remaining data ${e.remaining.length} bytes`);continue}if(e instanceof Je){this._log.warn(`Security error while unpacking a received message: ${e.message}`);continue}return e instanceof $e?(404===e.code?this._handleBadAuthKey():(this._log.warn(`Invalid buffer ${e.code} for dc ${this._dcId}`),this.reconnect()),void(this._recvLoopHandle=void 0)):(this._log.error("Unhandled error while receiving data"),console.error(e),this.reconnect(),void(this._recvLoopHandle=void 0))}try{await this._processMessage(t)}catch(e){e instanceof Ae?"AUTH_KEY_UNREGISTERED"!==e.errorMessage&&"SESSION_REVOKED"!==e.errorMessage&&"USER_DEACTIVATED"!==e.errorMessage||this._handleBadAuthKey(!0):(this._log.error("Unhandled error while receiving data"),console.error(e))}this.checkLongPoll()}this._recvLoopHandle=void 0}checkLongPoll(){!this.isSendingLongPoll&&this._isFallback&&(this.isSendingLongPoll=!0,this.send(new Me.HttpWait({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._isExported?this._updateCallback?.(new Dt(Dt.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._pendingAck.add(e.msgId),this.getConnection().shouldLongPoll&&this._sendQueue.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._pendingState.getAndDelete(e);if(t)return[t];const s=[];for(const t of this._pendingState.values())t.containerId===e&&s.push(t.msgId);if(s.length){const e=[];for(const t of s)e.push(this._pendingState.getAndDelete(t));return e}for(const t of this._lastAcks)if(t.msgId===e)return[t];return[]}_handleRPCResult(e){const t=e.obj,s=this._pendingState.getAndDelete(t.reqMsgId);if(this._log.debug(`Handling RPC result for message ${t.reqMsgId}`),s){if(t.error){const e=function(e,t){for(const[s,n]of ze){const a=e.errorMessage.match(s);if(a)return new n({request:t,capture:2===a.length?parseInt(a[1],10):void 0,code:e.errorCode,errorMessage:e.errorMessage})}return new Ae(e.errorMessage,t,e.errorCode)}(t.error,s.request);throw this._sendQueue.append(new Kt(new Me.MsgsAck({msgIds:[s.msgId]}))),s.reject?.(e),e}try{const e=new ot(t.body),n=s.request.readResult(e);this.logWithIndex.debug("Handling RPC result",n),s.resolve?.(n)}catch(e){throw s.reject?.(e),e}}else try{if(!(new ot(t.body).tgReadObject()instanceof Me.upload.File))throw new Ke(0,$t.alloc(0))}catch(e){if(e instanceof Ke)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 ot(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._isExported||this._updateCallback?.(e.obj)):this._log.warn(`Note: ${e.obj.className} is not an update, not dispatching it`)}_handlePong(e){const t=e.obj,s=this._state.updateTimeOffset(e.msgId);this._isExported||this._updateCallback?.(new Ut(s)),this._log.debug(`Handling pong for message ${t.msgId}`);const n=this._pendingState.getAndDelete(t.msgId);n&&n.resolve?.(t)}_handleBadServerSalt(e){const t=e.obj;this._log.debug(`Handling bad salt for message ${t.badMsgId}`),this._state.salt=t.newServerSalt;const s=this._popStates(t.badMsgId);this._sendQueue.extend(s),this._log.debug(`${s.length} message(s) will be resent`)}_handleBadNotification(e){const t=e.obj,s=this._popStates(t.badMsgId);var n;if(this._log.debug(`Handling bad msg ${n=t,JSON.stringify(n,(e,t)=>"bigint"==typeof t?t.toString():t)}`),[16,17].includes(t.errorCode)){const t=this._state.updateTimeOffset(e.msgId);this._isExported||this._updateCallback?.(new Ut(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 s)e.reject(new Qe(e.request,t.errorCode));return}this._state._sequence-=16}this._sendQueue.extend(s),this._log.debug(`${s.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._pendingAck.add(t)}_handleNewDetailedInfo(e){const t=e.obj.answerMsgId;this._log.debug(`Handling new detailed info for message ${t}`),this._pendingAck.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.toString()}`);const t=this._pendingState.getAndDelete(e.msgId);t&&t.resolve?.(e.obj)}_handleStateForgotten(e){this._sendQueue.append(new Kt(new Me.MsgsStateInfo({reqMsgId:e.msgId,info:String.fromCharCode(1).repeat(e.obj.msgIds)})))}_handleMsgAll(e){}reconnect(){this._userConnected&&!this.isReconnecting&&(this.isReconnecting=!0,te(1e3).then(()=>{this.logWithIndex.log("Reconnecting..."),this._log.info("Started reconnecting"),this._reconnect()}))}async _reconnect(){const e=this._connection,t=this._fallbackConnection;this._log.debug("Closing current connection...");try{this.logWithIndex.warn("[Reconnect] Closing current connection..."),e&&this._disconnect(e),t&&this._disconnect(t)}catch(e){this._log.warn(e)}this._sendQueue.append(void 0),this._state.reset();const s=new e.constructor({ip:e._ip,port:e._port,dcId:e._dcId,loggers:e._log,isTestServer:e._isTestServer,isPremium:e._isPremium}),n=new this._fallbackConnection.constructor({ip:e._ip,port:e._port,dcId:e._dcId,loggers:e._log,isTestServer:e._isTestServer,isPremium:e._isPremium});await this.connect(s,!0,n),this.isReconnecting=!1,this._autoReconnectCallback&&await this._autoReconnectCallback()}retryPendingStates(){const e=this._pendingState.values();e.length&&(this._sendQueue.prepend(e),this._pendingState.clear())}}var Qt=s(48287).hp;const Xt=Qt.from("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00","hex"),Yt=Qt.from("ffd9","hex");function Zt(e,t=!0,s=!0){if(e instanceof Me.User){if(e.self&&t)return new Me.InputPeerSelf;if(void 0===e.accessHash&&s)throw new Error("User without accessHash or min info cannot be input");return new Me.InputPeerUser({userId:e.id,accessHash:e.accessHash})}if(e instanceof Me.Chat||e instanceof Me.ChatEmpty||e instanceof Me.ChatForbidden)return new Me.InputPeerChat({chatId:e.id});if(e instanceof Me.Channel){if(void 0===e.accessHash&&s)throw new TypeError("Channel without accessHash or min info cannot be input");return new Me.InputPeerChannel({channelId:e.id,accessHash:e.accessHash})}return e instanceof Me.ChannelForbidden?new Me.InputPeerChannel({channelId:e.id,accessHash:e.accessHash}):(e instanceof Me.UserEmpty||function(e){throw new Error(`Cannot cast ${e.className} to any kind of InputPeer`)}(e),new Me.InputPeerEmpty)}function es(e){if(e.length<3||1!==e[0])return e;const t=Qt.from(Xt);return t[164]=e[1],t[166]=e[2],Qt.concat([t,e.slice(3),Yt])}function ts(e,t=!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}`)}}class ss{}class ns extends ss{constructor(){super(),this._serverAddress=void 0,this._dcId=0,this._port=void 0,this._takeoutId=void 0,this._isTestServer=!1,this._entities=new Set}get dcId(){return this._dcId}get serverAddress(){return this._serverAddress}get port(){return this._port}get isTestServer(){return this._isTestServer}setDC(e,t,s,n){this._dcId=0|e,this._serverAddress=t,this._port=s,this._isTestServer=n}getAuthKey(e){return new Ht}setAuthKey(e,t){}async load(){}save(){}delete(){}}var as=s(48287).hp;class is extends ns{constructor(e,t){super(),this._sessionData=e,this._callback=t,this._authKeys={}}async load(){if(!this._sessionData)return;const{mainDcId:e,keys:t,isTest:s}=this._sessionData,{ipAddress:n,port:a}=ts(e);this.setDC(e,n,a,s,!0),await Promise.all(Object.keys(t).map(async e=>{const s=Number(e),n=as.from(t[s],"hex");this._authKeys[s]=new Ht,await this._authKeys[s].setKey(n)}))}setDC(e,t,s,n,a=!1){this._dcId=e,this._serverAddress=t,this._port=s,this._isTestServer=n,delete this._authKeys[e],a||this._onUpdate()}getAuthKey(e=this._dcId){return this._authKeys[e]}setAuthKey(e,t=this._dcId){this._authKeys[t]=e,this._onUpdate()}getSessionData(){const e={mainDcId:this._dcId,keys:{},isTest:this._isTestServer||void 0};return Object.keys(this._authKeys).forEach(t=>{const s=Number(t),n=this._authKeys[s];n?._key&&(e.keys[s]=n._key.toString("hex"))}),e}_onUpdate(){this._callback(this.getSessionData())}delete(){this._callback(void 0)}}var os=s(51072);function rs(e){if(void 0!==e)return Number(e)}var ds=s(48287).hp;function cs(e,t){if(!ds.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 us(e){return ds.concat([ds.alloc(256-e.length),e])}function ls(e){return O(e,256,!1)}function fs(e,t){const s=t-e;return!(s<0n||ce(s)<1984||ce(e)<1984||Math.floor((ce(e)+7)/8)>256)}function gs(e,t){const s=Math.min(e.length,t.length);for(let n=0;n<s;n++)e[n]^=t[n];return e}async function ps(e,t){const s=await Q(ds.concat([e.salt1,ds.from(t,"utf-8"),e.salt1])),n=await Q(ds.concat([e.salt2,s,e.salt2])),a=await function(e,t,s){return async function(e,t,s){const n=await crypto.subtle.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]);return U.from(await crypto.subtle.deriveBits({name:"PBKDF2",hash:"SHA-512",salt:t,iterations:s},n,512))}(e,t,s)}(n,e.salt1,1e5);return Q(ds.concat([e.salt2,a,e.salt2]))}async function hs(e,t){try{cs(e.p,e.g)}catch(e){throw new Error("bad p/g in password",{cause:e})}return ls(X(BigInt(e.g),H(await ps(e,t),!1),H(e.p,!1)))}async function ms(e,t){const s=e.currentAlgo;if(!(s instanceof Me.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow))throw new Error(`Unsupported password algorithm ${s?.className}`);const n=e.srp_B,a=e.srpId;if(!n||!a)throw new Error(`Undefined srp_b ${e.className}`);const i=await ps(s,t),o=H(s.p,!1),{g:r}=s,d=H(n,!1);try{cs(s.p,r)}catch(e){throw new Error("bad p/g in password",{cause:e})}if(!function(e,t){return e>0n&&e<t}(d,o))throw new Error("bad b in check");const c=H(i,!1),u=us(s.p),l=ls(BigInt(r)),f=us(n),g=X(BigInt(r),c,o),p=j(H(await Q(ds.concat([u,l])),!1)*g,o),{a:h,aForHash:m,u:y}=await(async()=>{for(;;){const e=H(W(256),!1),t=X(BigInt(r),e,o);if(fs(t,o)){const s=ls(t),n=H(await Q(ds.concat([s,f])),!1);if(n>0n)return{a:e,aForHash:s,u:n}}}})(),_=j(d-p,o);if(!fs(_,o))throw new Error("bad gB");const b=X(_,h+y*c,o),[S,w,I,v,P]=await Promise.all([Q(ls(b)),Q(u),Q(l),Q(s.salt1),Q(s.salt2)]),C=await Q(ds.concat([gs(w,I),v,P,m,f,S]));return new Me.InputCheckPasswordSRP({srpId:a,A:m,M1:C})}var ys=s(48287).hp,_s=s(48287).hp;function bs(e){const t=function(e){return e.replace(/-/g,"+").replace(/_/g,"/")+(e.length%4==0?"":"=".repeat(4-e.length%4))}(e);return _s.from(t,"base64")}function Ss(e){return bs(e).toString("utf-8")}let ws=0;function Is(){return Math.floor(Date.now()/1e3)+ws}let vs=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.Timestamp="MessageEntityTimestamp",e.QuoteFocus="MessageEntityQuoteFocus",e.FormattedDate="MessageEntityFormattedDate",e.Unknown="MessageEntityUnknown",e.DiffInsert="MessageEntityDiffInsert",e.DiffReplace="MessageEntityDiffReplace",e.DiffDelete="MessageEntityDiffDelete",e}({});const Ps=-1;let Cs=function(e){return e[e.BlobUrl=0]="BlobUrl",e[e.Progressive=1]="Progressive",e[e.DownloadUrl=2]="DownloadUrl",e[e.Text=3]="Text",e}({});function Ms(e,t){return e.reduce((e,s)=>(e[s[t]]=s,e),{})}function As(e,t){return e.reduce((e,s)=>{const[n,a]=t(s);return e[n]=a,e},{})}function Rs(e,t){return t.reduce((t,s)=>(t[s]=e[s],t),{})}function ks(e,t){return t.reduce((t,s)=>(e[s]&&(t[s]=e[s]),t),{})}function Ts(e,t){const s=new Set(t.map(String));return Rs(e,Object.keys(e).filter(e=>!s.has(e)))}function Bs(e){return Object.keys(e).reduce((t,s)=>{const n=s;return void 0!==e[n]&&(t[n]=e[n]),t},{})}function Ds(e){return e.filter(Boolean)}function Us(e,t){const s=[];for(let n=0;n<e.length;n+=t)s.push(e.slice(n,n+t));return s}var Es=s(55962);const xs="SharedWorker"in globalThis;Intl,new URL("tg://host").host,(0,Es.isTauri)(),Boolean(globalThis.electron);const Vs="undefined"!=typeof WorkerGlobalScope&&globalThis.self instanceof WorkerGlobalScope?globalThis.self.name:void 0,Gs=(Vs?Number(new URLSearchParams(Vs).get(i)):void 0)||(xs?function(e){const t=new URL(e).searchParams.get(i),s=t?Number(t):1;return!s||Number.isNaN(s)||1===s?void 0:s}(globalThis.location.href):void 0),Fs=`tt-global_${Gs||1}`;if("object"==typeof window){const e=new BroadcastChannel("tt-version");e.postMessage({version:"12.0.29"}),e.addEventListener("message",t=>{const{version:s}=t.data;s&&(-1===Ns("12.0.29",s)&&window.location.reload(),1===Ns("12.0.29",s)&&e.postMessage({version:"12.0.29"}))})}function Ns(e,t){return e.startsWith(`${t}-`)?-1:t.startsWith(`${e}-`)?1:e.localeCompare(t,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"})}function qs(e,t=!1,s="image/jpeg"){return`${t?"":`data:${s};base64,`}${btoa(String.fromCharCode(...e))}`}function Hs(e){const{flags:t,CONSTRUCTOR_ID:s,SUBCLASS_OF_ID:n,className:a,classType:i,getBytes:o,...r}=e;return r}var Ls=s(48287).hp;const Os=new BroadcastChannel(Fs);let js=[];const Ws=R(()=>{Os.postMessage({type:"localDbUpdate",batchedUpdates:js}),js=[]},100);function zs(e){if(e instanceof Uint8Array)return Ls.from(e);if("object"==typeof e&&1===Object.keys(e).length&&"value"===Object.keys(e)[0])return BigInt(e.value);if(Array.isArray(e))return e.map(zs);if("object"!=typeof e||!("CONSTRUCTOR_ID"in e))return e;const t=e.className.split(".").reduce((e,t)=>e[t],Me),s=Hs(e);return new t(Object.keys(s).reduce((e,t)=>(e[t]=zs(s[t]),e),{}))}function Ks(e){return["localMessages","chats","users","messages","documents","stickerSets","photos","webDocuments","stories","commonBoxState","channelPtsById"].reduce((t,s)=>{const n=e?.[s]??{},a=Object.keys(n).reduce((e,t)=>{if("commonBoxState"===s||"channelPtsById"===s){const s=n;return e[t]=s[t],e}return e[t]=zs(n[t]),e},{});var i;return t[s]=(i=s,new Proxy(a,{get:(e,t,s)=>Reflect.get(e,t,s),set:(e,t,s)=>(js.push({name:i,prop:t,value:s}),Ws(),Reflect.set(e,t,s))})),t},{})}const $s=Ks(),Js=$s;function Qs(){Os&&Os.postMessage({type:"localDbUpdateFull",localDb:Object.keys($s).reduce((e,t)=>(e[t]={...$s[t]},e),{})})}var Xs=s(48287).hp;const Ys="";function Zs(e){const t=BigInt(e);return t>0n?"user":t<-1000000000000n?"channel":"chat"}function en(e){const t=Zs(e);return"user"===t?new Me.PeerUser({userId:Cn(e,"user")}):"channel"===t?new Me.PeerChannel({channelId:Cn(e,"channel")}):new Me.PeerChat({chatId:Cn(e,"chat")})}function tn(e,t){const s=Zs(e);return"user"===s?new Me.InputPeerUser({userId:Cn(e,"user"),accessHash:BigInt(t)}):"channel"===s?new Me.InputPeerChannel({channelId:Cn(e,"channel"),accessHash:BigInt(t)}):new Me.InputPeerChat({chatId:Cn(e,"chat")})}function sn(e,t){return t?new Me.InputUser({userId:Cn(e,"user"),accessHash:BigInt(t)}):new Me.InputUserEmpty}function nn(e,t){return t?new Me.InputChannel({channelId:Cn(e,"channel"),accessHash:BigInt(t)}):new Me.InputChannelEmpty}function an(e){return BigInt(e.slice(1))}function on(e,t){if(e)return new Me.PaidReactionPrivacyAnonymous;if(t){const e=rn(t);if(e)return new Me.PaidReactionPrivacyPeer({peer:e})}return new Me.PaidReactionPrivacyDefault}function rn(e){const t=Zs(e);let s;if("user"===t){if(s=Js.users[e]?.accessHash,!s)return}else if("channel"===t&&(s=Js.chats[e]?.accessHash,!s))return;return tn(e,String(s))}function dn(e,t){return new Me.InputStickerSetID({id:BigInt(e),accessHash:BigInt(t)})}function cn(e){if(!e.id)return;const t=Js.documents[e.id];return t?new Me.InputDocument(Rs(t,["id","accessHash","fileReference"])):void 0}function un(e,t){const s=cn(e);if(s)return new Me.InputMediaDocument({id:s,spoiler:t})}function ln(e,t=!1){return new Me.InputMediaPoll({poll:new Me.Poll({id:BigInt(e.summary.id),publicVoters:e.summary.isPublic,question:En(e.summary.question),answers:e.summary.answers.map(({text:e,option:t})=>new Me.PollAnswer({text:En(e),option:Fa(t)})),quiz:e.summary.isQuiz,multipleChoice:e.summary.isMultipleChoice,closeDate:e.summary.closeDate,closePeriod:e.summary.closePeriod,closed:!!t||e.summary.isClosed,creator:e.summary.isCreator,revotingDisabled:e.summary.isRevoteDisabled,shuffleAnswers:e.summary.shouldShuffleAnswers,hideResultsUntilClose:e.summary.shouldHideResultsUntilClose,openAnswers:e.summary.canAddAnswers,hash:BigInt(e.summary.hash)}),correctAnswers:e.summary.answers.map((t,s)=>{const n=e.results.resultByOption?.[t.option];return n?.isCorrect?s:-1}).filter(e=>-1!==e),attachedMedia:fn(e.attachedMedia),solution:e.results.solution,solutionEntities:e.results.solutionEntities?.map(mn),solutionMedia:fn(e.results.solutionMedia)})}function fn(e){if(e){if(e.photo){const t=yn(e.photo);return t?new Me.InputMediaPhoto({id:t,spoiler:e.photo.isSpoiler||void 0}):void 0}return e.video?un(e.video,e.video.isSpoiler||void 0):e.document?un(e.document):e.location?function(e){const t=(s=e.geo,new Me.InputGeoPoint({lat:s.lat,long:s.long,accuracyRadius:s.accuracyRadius}));var s;if(t)return"venue"===e.mediaType?new Me.InputMediaVenue({geoPoint:t,title:e.title,address:e.address,provider:e.provider,venueId:e.venueId,venueType:e.venueType}):"geoLive"===e.mediaType?new Me.InputMediaGeoLive({geoPoint:t,heading:e.heading,period:e.period}):new Me.InputMediaGeoPoint({geoPoint:t})}(e.location):e.sticker?un(e.sticker):void 0}}function gn(e){const{title:t,items:s}=e.todo,n=s.map(e=>new Me.TodoItem({id:e.id,title:En(e.title)})),a=new Me.TodoList({title:En(t),list:n,othersCanAppend:e.todo.othersCanAppend||void 0,othersCanComplete:e.todo.othersCanComplete||void 0});return new Me.InputMediaTodo({todo:a})}function pn(){const e=W(8),t=Xs.allocUnsafe(4);return t.writeUInt32LE(Math.floor(Date.now()/1e3),0),e.set(t,4),H(e,!0,!0)}function hn(e,t,s){return new Me.Message({id:e,peerId:en(t),fromId:en(t),media:s.media})}function mn(e){const{type:t,offset:s,length:n}=e,a="userId"in e?Js.users[e.userId]:void 0;switch(t){case vs.Bold:return new Me.MessageEntityBold({offset:s,length:n});case vs.Italic:return new Me.MessageEntityItalic({offset:s,length:n});case vs.Underline:return new Me.MessageEntityUnderline({offset:s,length:n});case vs.Strike:return new Me.MessageEntityStrike({offset:s,length:n});case vs.Code:return new Me.MessageEntityCode({offset:s,length:n});case vs.Pre:return new Me.MessageEntityPre({offset:s,length:n,language:e.language||""});case vs.Blockquote:return new Me.MessageEntityBlockquote({offset:s,length:n});case vs.TextUrl:return new Me.MessageEntityTextUrl({offset:s,length:n,url:e.url});case vs.Url:return new Me.MessageEntityUrl({offset:s,length:n});case vs.Hashtag:return new Me.MessageEntityHashtag({offset:s,length:n});case vs.MentionName:return new Me.InputMessageEntityMentionName({offset:s,length:n,userId:new Me.InputUser({userId:BigInt(a.id),accessHash:a.accessHash})});case vs.Spoiler:return new Me.MessageEntitySpoiler({offset:s,length:n});case vs.CustomEmoji:return new Me.MessageEntityCustomEmoji({offset:s,length:n,documentId:BigInt(e.documentId)});case vs.FormattedDate:return new Me.MessageEntityFormattedDate({offset:s,length:n,date:e.date,relative:e.relative,shortTime:e.shortTime,longTime:e.longTime,shortDate:e.shortDate,longDate:e.longDate,dayOfWeek:e.dayOfWeek});default:return new Me.MessageEntityUnknown({offset:s,length:n})}}function yn(e){const t=Js.photos[e?.id];if(t)return new Me.InputPhoto(Rs(t,["id","accessHash","fileReference"]))}function _n({phone:e,firstName:t,lastName:s}){return new Me.InputPhoneContact({clientId:1n,phone:e,firstName:t,lastName:s})}function bn(e,t=0){return new Me.ChatBannedRights({...e,untilDate:t})}function Sn(e){return new Me.ChatAdminRights(e)}function wn(e){const{shippingAddress:t}=e;return new Me.PaymentRequestedInfo({...e,shippingAddress:t?new Me.PostAddress(t):void 0})}function In(e){switch(e){case"phoneNumber":return new Me.InputPrivacyKeyPhoneNumber;case"addByPhone":return new Me.InputPrivacyKeyAddedByPhone;case"lastSeen":return new Me.InputPrivacyKeyStatusTimestamp;case"profilePhoto":return new Me.InputPrivacyKeyProfilePhoto;case"forwards":return new Me.InputPrivacyKeyForwards;case"chatInvite":return new Me.InputPrivacyKeyChatInvite;case"phoneCall":return new Me.InputPrivacyKeyPhoneCall;case"phoneP2P":return new Me.InputPrivacyKeyPhoneP2P;case"voiceMessages":return new Me.InputPrivacyKeyVoiceMessages;case"bio":return new Me.InputPrivacyKeyAbout;case"birthday":return new Me.InputPrivacyKeyBirthday;case"gifts":return new Me.InputPrivacyKeyStarGiftsAutoSave;case"noPaidMessages":return new Me.InputPrivacyKeyNoPaidMessages}}function vn(e){switch(e){case"spam":return new Me.InputReportReasonSpam;case"violence":return new Me.InputReportReasonViolence;case"childAbuse":return new Me.InputReportReasonChildAbuse;case"pornography":return new Me.InputReportReasonPornography;case"copyright":return new Me.InputReportReasonCopyright;case"fake":return new Me.InputReportReasonFake;case"geoIrrelevant":return new Me.InputReportReasonGeoIrrelevant;case"illegalDrugs":return new Me.InputReportReasonIllegalDrugs;case"personalDetails":return new Me.InputReportReasonPersonalDetails;default:return new Me.InputReportReasonOther}}function Pn(e){return new Me.DataJSON({data:JSON.stringify(e)})}function Cn(e,t){const s=BigInt(e);return"user"===t?s:"channel"===t?-s-P:-1n*s}function Mn(e){return new Me.InputGroupCall({id:BigInt(e.id),accessHash:BigInt(e.accessHash)})}function An({id:e,accessHash:t}){return new Me.InputPhoneCall({id:BigInt(e),accessHash:BigInt(t)})}function Rn(e){if("stars"===e.type)return new Me.InputStorePaymentStarsTopup({stars:BigInt(e.stars),currency:e.currency,amount:BigInt(e.amount),spendPurposePeer:e.spendPurposePeer?tn(e.spendPurposePeer.id,e.spendPurposePeer.accessHash):void 0});if("starsgift"===e.type)return new Me.InputStorePaymentStarsGift({userId:sn(e.user.id,e.user.accessHash),stars:BigInt(e.stars),currency:e.currency,amount:BigInt(e.amount)});if("giftcode"===e.type)return new Me.InputStorePaymentPremiumGiftCode({users:e.users.map(e=>sn(e.id,e.accessHash)),boostPeer:e.boostChannel?tn(e.boostChannel.id,e.boostChannel.accessHash):void 0,currency:e.currency,amount:BigInt(e.amount),message:e.message&&En(e.message)});const t=z();return"starsgiveaway"===e.type?new Me.InputStorePaymentStarsGiveaway({boostPeer:tn(e.chat.id,e.chat.accessHash),additionalPeers:e.additionalChannels?.map(e=>tn(e.id,e.accessHash)),stars:BigInt(e.stars),countriesIso2:e.countries,prizeDescription:e.prizeDescription,onlyNewSubscribers:e.isOnlyForNewSubscribers||void 0,winnersAreVisible:e.areWinnersVisible||void 0,untilDate:e.untilDate,currency:e.currency,amount:BigInt(e.amount),users:e.users,randomId:t}):new Me.InputStorePaymentPremiumGiveaway({boostPeer:tn(e.chat.id,e.chat.accessHash),additionalPeers:e.additionalChannels?.map(e=>tn(e.id,e.accessHash)),countriesIso2:e.countries,prizeDescription:e.prizeDescription,onlyNewSubscribers:e.isOnlyForNewSubscribers||void 0,winnersAreVisible:e.areWinnersVisible||void 0,untilDate:e.untilDate,currency:e.currency,amount:BigInt(e.amount),randomId:t})}function kn(e){return new Me.DisallowedGiftsSettings({disallowUnlimitedStargifts:e.shouldDisallowLimitedStarGifts,disallowLimitedStargifts:e.shouldDisallowUnlimitedStarGifts,disallowUniqueStargifts:e.shouldDisallowUniqueStarGifts,disallowPremiumGifts:e.shouldDisallowPremiumGifts})}function Tn(e){switch(e.type){case"message":return new Me.InputInvoiceMessage({peer:tn(e.chat.id,e.chat.accessHash),msgId:e.messageId});case"slug":return new Me.InputInvoiceSlug({slug:e.slug});case"stargiftResale":{const{peer:t,slug:s}=e;return new Me.InputInvoiceStarGiftResale({toId:tn(t.id,t.accessHash),slug:s,ton:"TON"===e.currency||void 0})}case"stargift":{const{peer:t,shouldHideName:s,giftId:n,message:a,shouldUpgrade:i}=e;return new Me.InputInvoiceStarGift({peer:tn(t.id,t.accessHash),hideName:s||void 0,giftId:BigInt(n),message:a&&En(a),includeUpgrade:i})}case"stars":{const t=Rn(e.purpose);return new Me.InputInvoiceStars({purpose:t})}case"premiumGiftStars":{const{user:t,message:s,months:n}=e;return new Me.InputInvoicePremiumGiftStars({months:n,userId:sn(t.id,t.accessHash),message:s&&En(s)})}case"starsgiveaway":{const t=Rn(e.purpose);return new Me.InputInvoiceStars({purpose:t})}case"chatInviteSubscription":return new Me.InputInvoiceChatInviteSubscription({hash:e.hash});case"stargiftUpgrade":return new Me.InputInvoiceStarGiftUpgrade({stargift:qn(e.inputSavedGift),keepOriginalDetails:e.shouldKeepOriginalDetails});case"stargiftTransfer":return new Me.InputInvoiceStarGiftTransfer({stargift:qn(e.inputSavedGift),toId:tn(e.recipient.id,e.recipient.accessHash)});case"stargiftDropOriginalDetails":return new Me.InputInvoiceStarGiftDropOriginalDetails({stargift:qn(e.inputSavedGift)});case"stargiftPrepaidUpgrade":return new Me.InputInvoiceStarGiftPrepaidUpgrade({peer:tn(e.peer.id,e.peer.accessHash),hash:e.hash});case"stargiftAuctionBid":{const{giftId:t,bidAmount:s,peer:n,message:a,shouldHideName:i,isUpdateBid:o}=e;return new Me.InputInvoiceStarGiftAuctionBid({giftId:BigInt(t),bidAmount:BigInt(s),peer:n&&tn(n.id,n.accessHash||""),message:a&&En(a),hideName:i||void 0,updateBid:o||void 0})}default:{const s=Rn(e.purpose),n=(t=e.option,new Me.PremiumGiftCodeOption({users:t.users,months:t.months,currency:t.currency,amount:BigInt(t.amount)}));return new Me.InputInvoicePremiumGiftCode({purpose:s,option:n})}}var t}function Bn(e){switch(e?.type){case"emoji":return new Me.ReactionEmoji({emoticon:e.emoticon});case"custom":return new Me.ReactionCustomEmoji({documentId:BigInt(e.documentId)});case"paid":return new Me.ReactionPaid;default:return new Me.ReactionEmpty}}function Dn(e){return"collectible"===e.type?new Me.InputEmojiStatusCollectible({collectibleId:BigInt(e.collectibleId),until:e.until}):"status-default-icon"===e.documentId?new Me.EmojiStatusEmpty:new Me.EmojiStatus({documentId:BigInt(e.documentId),until:e.until})}function Un(e){switch(e.type){case"default":return new Me.InputAiComposeToneDefault({tone:e.tone});case"id":return new Me.InputAiComposeToneID({id:BigInt(e.id),accessHash:BigInt(e.accessHash)});case"slug":return new Me.InputAiComposeToneSlug({slug:e.slug})}}function En(e){return new Me.TextWithEntities({text:e.text,entities:e.entities?.map(mn)||[]})}function xn(e){return new Me.InputBotAppID({id:BigInt(e.id),accessHash:BigInt(e.accessHash)})}function Vn(e){if("story"===e.type)return new Me.InputReplyToStory({peer:rn(e.peerId),storyId:e.storyId});if("message"===e.type){const{replyToMsgId:t,replyToTopId:s,replyToPeerId:n,quoteText:a,quoteOffset:i,monoforumPeerId:o}=e;return new Me.InputReplyToMessage({replyToMsgId:t,topMsgId:s,replyToPeerId:n?rn(n):void 0,monoforumPeerId:o?rn(o):void 0,quoteText:a?.text,quoteEntities:a?.entities?.map(mn),quoteOffset:i})}}function Gn(e){return"XTR"===e.currency?new Me.StarsAmount({amount:BigInt(e.amount),nanos:e.nanos}):new Me.StarsTonAmount({amount:BigInt(e.amount)})}function Fn(e){return new Me.SuggestedPost({price:e.price&&Gn(e.price),scheduleDate:e.scheduleDate})}function Nn(e){const t=[];if(e.allowedUsers?.length&&t.push(new Me.InputPrivacyValueAllowUsers({users:e.allowedUsers.map(({id:e,accessHash:t})=>sn(e,t))})),e.allowedChats?.length&&t.push(new Me.InputPrivacyValueAllowChatParticipants({chats:e.allowedChats.map(({id:e,type:t})=>Cn(e,"chatTypeBasicGroup"===t?"chat":"channel"))})),e.blockedUsers?.length&&t.push(new Me.InputPrivacyValueDisallowUsers({users:e.blockedUsers.map(({id:e,accessHash:t})=>sn(e,t))})),e.blockedChats?.length&&t.push(new Me.InputPrivacyValueDisallowChatParticipants({chats:e.blockedChats.map(({id:e,type:t})=>Cn(e,"chatTypeBasicGroup"===t?"chat":"channel"))})),e.shouldAllowPremium&&t.push(new Me.InputPrivacyValueAllowPremium),"allow"===e.botsPrivacy&&t.push(new Me.InputPrivacyValueAllowBots),"disallow"===e.botsPrivacy&&t.push(new Me.InputPrivacyValueDisallowBots),!e.isUnspecified)switch(e.visibility){case"everybody":t.push(new Me.InputPrivacyValueAllowAll);break;case"contacts":t.push(new Me.InputPrivacyValueAllowContacts);break;case"nonContacts":t.push(new Me.InputPrivacyValueDisallowContacts);break;case"nobody":t.push(new Me.InputPrivacyValueDisallowAll)}return t}function qn(e){return"user"===e.type?new Me.InputSavedStarGiftUser({msgId:e.messageId}):new Me.InputSavedStarGiftChat({peer:tn(e.chat.id,e.chat.accessHash),savedId:BigInt(e.savedId)})}function Hn(e){switch(e){case"stories":return new Me.ProfileTabPosts;case"gifts":return new Me.ProfileTabGifts;case"media":return new Me.ProfileTabMedia;case"documents":return new Me.ProfileTabFiles;case"audio":return new Me.ProfileTabMusic;case"voice":return new Me.ProfileTabVoice;case"links":return new Me.ProfileTabLinks;case"gif":return new Me.ProfileTabGifs;default:return e}}function Ln(e){let t;const s=Ss(e.response.clientDataJSON);if("attestationObject"in e.response)t=new Me.InputPasskeyResponseRegister({clientData:new Me.DataJSON({data:s}),attestationData:bs(e.response.attestationObject)});else{const n=Ss(e.response.userHandle);t=new Me.InputPasskeyResponseLogin({clientData:new Me.DataJSON({data:s}),authenticatorData:bs(e.response.authenticatorData),signature:bs(e.response.signature),userHandle:n})}return new Me.InputPasskeyCredentialPublicKey({id:e.id,rawId:e.rawId,response:t})}const On="phoneNumber";let jn=On;function Wn(e,t,s){const{initialMethod:n=On}=s;return zn(e,t,s),"phoneNumber"===n?$n(e,t,s):Jn(e,t,s)}function zn(e,t,s){s.hasPasskeySupport&&async function(e,t){const{apiId:s,apiHash:n}=t,a=await e.invoke(new Me.auth.InitPasskeyLogin({apiId:s,apiHash:n}));if(a)try{return JSON.parse(a.options.data)}catch(e){}}(e,t).then(e=>{e&&s.onPasskeyOption(e)}).catch(e=>{})}async function Kn(e,t=!1){try{return await e.invoke(new Me.updates.GetState),!0}catch(e){if(e instanceof Error&&"Disconnect"===e.message||t)throw e;return!1}}async function $n(e,t,s){let n,a,i,o,r,d;for(jn="phoneNumber";;)try{if("function"==typeof s.phoneNumber)try{n=await s.phoneNumber()}catch(n){if(n instanceof Error&&"RESTART_AUTH_WITH_QR"===n.message)return await Jn(e,t,s);if(n instanceof Oe)return await Qn(e,t,s,n.credentialJson);throw n}else n=s.phoneNumber;const o=await Xn(e,t,n,s.forceSMS);if(a=o.phoneCodeHash,i=o.isCodeViaApp,"string"!=typeof a)throw new Error("Failed to retrieve phone code hash");break}catch(e){if("function"!=typeof s.phoneNumber)throw e;s.onError(e)}for(;;)try{try{o=await s.phoneCode(i)}catch(n){if(n instanceof Error&&"RESTART_AUTH"===n.message)return $n(e,t,s)}if(!o)throw new Error("Code is empty");const c=await e.invoke(new Me.auth.SignIn({phoneNumber:n,phoneCodeHash:a,phoneCode:o}));if(c instanceof Me.auth.AuthorizationSignUpRequired){r=!0,d=c.termsOfService;break}return c.user}catch(t){if(t instanceof Ae&&"SESSION_PASSWORD_NEEDED"===t.errorMessage)return Yn(e,0,s);t instanceof Error?s.onError(t):console.warn("Unexpected error:",t)}if(r)for(;;)try{const[t,i]=await s.firstAndLastNames();if(!t)throw new Error("First name is required");const{user:o}=await e.invoke(new Me.auth.SignUp({phoneNumber:n,phoneCodeHash:a,firstName:t,lastName:i||Ys}));return d&&await e.invoke(new Me.help.AcceptTermsOfService({id:d.id})),o}catch(e){s.onError(e)}return s.onError(new Error("Auth failed")),$n(e,t,s)}async function Jn(e,t,s){let n=!1;const{apiId:a,apiHash:i}=t,o=s.accountIds?.map(e=>function(e){try{return BigInt(e)}catch(e){return}}(e)).filter(Boolean)||[];jn="qrCode";const r=(async()=>{for(;!n;){const t=await e.invoke(new Me.auth.ExportLoginToken({apiId:a,apiHash:i,exceptIds:o}));if(!(t instanceof Me.auth.LoginToken))throw new Error("Unexpected");const{token:n,expires:r}=t;await Promise.race([s.qrCode({token:n,expires:r}),te(1e3*(r-Is()))])}})(),d=new Promise(t=>{e.addEventHandler(e=>{e instanceof Me.UpdateLoginToken&&t()},{build:e=>e})});try{await Promise.race([d,r])}catch(n){if(n instanceof Error&&"RESTART_AUTH"===n.message)return await $n(e,t,s);if(n instanceof Oe)return await Qn(e,t,s,n.credentialJson);throw n}finally{n=!0}try{const t=await e.invoke(new Me.auth.ExportLoginToken({apiId:a,apiHash:i,exceptIds:o}));if(t instanceof Me.auth.LoginTokenSuccess&&t.authorization instanceof Me.auth.Authorization)return t.authorization.user;if(t instanceof Me.auth.LoginTokenMigrateTo){await e._switchDC(t.dcId);const s=await e.invoke(new Me.auth.ImportLoginToken({token:t.token}));if(s instanceof Me.auth.LoginTokenSuccess&&s.authorization instanceof Me.auth.Authorization)return s.authorization.user}}catch(t){if(t instanceof Ae&&"SESSION_PASSWORD_NEEDED"===t.errorMessage)return Yn(e,0,s);throw t}throw void 0}async function Qn(e,t,s,n){try{if(!n.response.userHandle)throw new Error("User handle is empty");const t=Ss(n.response.userHandle),[a,i]=t.split(":");if(!a||!i||isNaN(Number(a)))throw new Error("Unexpected user handle format");const o=Number(a);if(s.accountIds?.includes(i))throw new je(i);const r=e.session.dcId,d=e.session.getAuthKey(r).keyId,c=d?BigInt.asIntN(64,d):void 0,u=r!==o;u&&await e._switchDC(o);const l=await e.invoke(new Me.auth.FinishPasskeyLogin({credential:Ln(n),fromDcId:u?r:void 0,fromAuthKeyId:u?c:void 0}));if(l instanceof Me.auth.Authorization)return l.user;throw new Error("Unexpected sign up in passkey login")}catch(n){zn(e,t,s);const a=n instanceof We;if(a&&s.onError(n),n instanceof Error){if("RESTART_AUTH"===n.message||a&&"phoneNumber"===jn)return $n(e,t,s);if("RESTART_AUTH_WITH_QR"===n.message||a&&"qrCode"===jn)return Jn(e,t,s)}if(n instanceof Ae&&"SESSION_PASSWORD_NEEDED"===n.errorMessage)return Yn(e,0,s);throw n instanceof Error&&s.onError(n),n}}async function Xn(e,t,s,n=!1){try{const{apiId:a,apiHash:i}=t,o=await e.invoke(new Me.auth.SendCode({phoneNumber:s,apiId:a,apiHash:i,settings:new Me.CodeSettings}));if(!(o instanceof Me.auth.SentCode))throw Error("Unexpected SentCodeSuccess");if(!n||o.type instanceof Me.auth.SentCodeTypeSms)return{phoneCodeHash:o.phoneCodeHash,isCodeViaApp:o.type instanceof Me.auth.SentCodeTypeApp};const r=await e.invoke(new Me.auth.ResendCode({phoneNumber:s,phoneCodeHash:o.phoneCodeHash}));if(!(r instanceof Me.auth.SentCode))throw Error("Unexpected SentCodeSuccess");return{phoneCodeHash:r.phoneCodeHash,isCodeViaApp:r.type instanceof Me.auth.SentCodeTypeApp}}catch(a){if(a instanceof Ae&&"AUTH_RESTART"===a.errorMessage)return Xn(e,t,s,n);throw a}}async function Yn(e,t,s,n=!1){for(;;)try{const t=await e.invoke(new Me.account.GetPassword),a=await s.password(t.hint,n);if(!a)throw new Error("Password is empty");const i=await ms(t,a),{user:o}=await e.invoke(new Me.auth.CheckPassword({password:i}));return o}catch(e){s.onError(e)}}const Zn=9437184,ea={};function ta(e,t){ea[e]||(ea[e]=new na);const s=ea[e];return s.updateIsPremium(t),s}class sa{queuedRequests=[];priorityQueuedRequests=[];activeRequestHeapSize=0;queuedRequestHeapSize=0;constructor(e){this.maxRequestHeapSize=e}requestWorker(e,t){if(this.activeRequestHeapSize+e>this.maxRequestHeapSize){const s=new zt,n={deferred:s,requestSize:e};return t?this.priorityQueuedRequests.push(n):this.queuedRequests.push(n),this.queuedRequestHeapSize+=e,s.promise}return this.activeRequestHeapSize+=e,Promise.resolve()}releaseWorker(e){for(this.activeRequestHeapSize-=e;this.queueLength>0;){const e=this.priorityQueuedRequests[0]||this.queuedRequests[0];if(!e)break;if(!(this.activeRequestHeapSize+e.requestSize<=this.maxRequestHeapSize))break;{const e=this.priorityQueuedRequests.shift()||this.queuedRequests.shift();this.queuedRequestHeapSize-=e.requestSize,this.activeRequestHeapSize+=e.requestSize,e.deferred.resolve()}}}canAccept(e){return this.activeRequestHeapSize+e<=this.maxRequestHeapSize}get queueLength(){return this.queuedRequests.length+this.priorityQueuedRequests.length}}class na{foremans=[];maxConnections=3;maxActiveSize=Zn;queuedRequests=[];priorityQueuedRequests=[];activeRequestSize=0;constructor(){const e=Math.max(3,6);this.foremans=Array(e).fill(void 0).map(()=>new sa(3495253.3333333335))}updateIsPremium(e){this.maxConnections=e?6:3,this.maxActiveSize=e?20971520:Zn}async requestWorker(e,t){if(this.activeRequestSize+t>this.maxActiveSize){const s=new zt,n={deferred:s,requestSize:t};e?this.priorityQueuedRequests.push(n):this.queuedRequests.push(n),await s.promise;const a=this.getFreeForemanIndex(t),i=this.foremans[a];return await i.requestWorker(t,e),a}const s=this.getFreeForemanIndex(t),n=this.foremans[s];return await n.requestWorker(t,e),this.activeRequestSize+=t,s}releaseWorker(e,t){this.activeRequestSize-=t,this.foremans[e].releaseWorker(t),this.processQueue()}processQueue(){for(;;){const e=this.priorityQueuedRequests[0]||this.queuedRequests[0];if(!e)return;if(this.activeRequestSize+e.requestSize>this.maxActiveSize)return;const t=this.priorityQueuedRequests.shift()||this.queuedRequests.shift();this.activeRequestSize+=t.requestSize,t.deferred.resolve()}}getFreeForemanIndex(e){let t=1/0,s=0;for(let n=0;n<this.maxConnections;n++){const a=this.foremans[n];if(a.canAccept(e))return n;const i=a.activeRequestHeapSize+a.queuedRequestHeapSize;i<t&&(t=i,s=n)}return s}getForeman(e){return this.foremans[e]}get queueLength(){return this.queuedRequests.length+this.priorityQueuedRequests.length}}class aa{constructor(e){this.isUpload=e}}var ia=s(48287).hp;const oa=4096,ra=1048576;class da{constructor(e){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?ia.alloc(this.size):ia.alloc(0)}write(e,t){if("opfs"!==this.type){if(this.size){if(t+e.length>this.buffer.length){if(t>=this.buffer.length)return;const s=this.buffer.length-t;return void this.buffer.set(e.subarray(0,s),t)}return void this.buffer.set(e,t)}this.buffer=ia.concat([this.buffer,e])}else this.largeFileAccessHandle.write(e,{at:t})}async getData(){return"opfs"===this.type?this.largeFile.getFile():Promise.resolve(this.buffer)}}async function ca(e,t,s,n){let{partSizeKb:a,end:i=0}=s;const{fileSize:o,dcId:r,progressCallback:d,isPriority:c,start:u=0}=s,l="id"in t?t.id:void 0,f=(...e)=>{n&&console.log(`⬇️ [${l?.toString()}/${s.dcId}]`,...e)};f("Downloading file...");const g=Boolean(e.isPremium);o&&(i=i&&i<o?i:o-1);const p=i?i-u+1:void 0;a||(a=o?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")}(p||o):64);const h=1024*a,m=p?Math.ceil(p/h):1,y=!i;let _;if(h%oa!==0)throw new Error("The part size must be evenly divisible by 4096");e._log.info(`Downloading file in chunks of ${h} bytes`);const b=new da(p),S=[];let w=u,I=!1,v=0;d?.(v);let P=!1;await b.init();const C=ta(r,g);for(;;){let s=h,a=!1;if(Math.floor(w/ra)!==Math.floor((w+s-1)/ra)&&(s=ra-w%ra,a=!0),w%oa===0&&s%oa===0||(a=!0),_&&await _.promise,y&&(_=new zt),I)break;const o=await C.requestWorker(Boolean(c),s),l=(...e)=>{f(`[${o}/${r}]`,...e)};if(d?.isCanceled){C.releaseWorker(o,s),_?.resolve();break}if(S.push((async(s,o,c)=>{for(;;){let f;try{let p=!1;n&&setTimeout(()=>{p||l(`❗️️ getSender took too long ${s}`)},8e3),f=await e.getSender(r,c,g),p=!0;let h=!1;n&&setTimeout(()=>{h||l(`❗️️ sender.send took too long ${s}`)},6e3);const y=await Promise.race([f.send(new Me.upload.GetFile({location:t,offset:BigInt(s),limit:o,precise:a||void 0})),te(6e4).then(()=>r===e.session.dcId?(l(`Download timed out ${s}`),Promise.reject(new Error("USER_CANCELED"))):(l(`Download timed out [not main] ${s}`),Promise.reject(new Error("SESSION_REVOKED"))))]);if(e.releaseExportedSender(f),y instanceof Me.upload.FileCdnRedirect)throw new Error("CDN download not supported");if(h=!0,d){if(d.isCanceled)throw new Error("USER_CANCELED");v+=1/m,l(`⬇️️ ${100*v}%`),d(v)}return!i&&y.bytes.length<o&&(I=!0),C.releaseWorker(c,o),_&&_.resolve(),void b.write(y.bytes,s-u)}catch(t){if(f&&!f.isConnected()){await te(1e3);continue}if(t instanceof xe){t instanceof Ve&&!P&&(f?._updateCallback(new aa(!1)),P=!0),await te(1e3*t.seconds);continue}throw l(`Ended not gracefully ${s}`),C.releaseWorker(c,o),_&&_.resolve(),I=!0,f&&e.releaseExportedSender(f),t}}})(w,s,o)),w+=s,i&&w>i)break}return await Promise.all(S),b.getData()}var ua=s(48287).hp;var la=s(48287).hp;const fa=131072,ga=["u","v","w","y","d","x","c","m","b","a","s","f","i","j"];class pa{static DEFAULT_OPTIONS={connection:Bt,fallbackConnection:Pt,useIPV6:!1,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",langPack:"weba",systemLangCode:"en",baseLogger:"gramjs",useWSS:!1,additionalDcsDisabled:!1,dcId:2,isTestServerRequested:!1,shouldAllowHttpTransport:!1,shouldForceHttpTransport:!1,shouldDebugExportedSenders:!1};_exportedSenderPromises={};_exportedSenderRefCounter={};_waitingForAuthKey={};_exportedSenderReleaseTimeouts={};_loopStarted=!1;_isSwitchingDc=!1;_destroyed=!1;_connectedDeferred=new zt;isPremium=!1;_lastRequest=Date.now();constructor(e,t,s,n=pa.DEFAULT_OPTIONS){if(!t||!s||!Number.isFinite(t))throw Error('Your API ID or Hash are invalid. Please read "Requirements" on README.md');const a={...pa.DEFAULT_OPTIONS,...n};if(this.apiId=t,this.apiHash=s,this.defaultDcId=a.dcId||2,this._useIPV6=a.useIPV6,this._shouldForceHttpTransport=a.shouldForceHttpTransport,this._shouldAllowHttpTransport=a.shouldAllowHttpTransport,this._shouldDebugExportedSenders=a.shouldDebugExportedSenders,"string"==typeof a.baseLogger?this._log=new gt:this._log=a.baseLogger,"string"!=typeof e&&e){if(!(e instanceof ss))throw new Error("The given session must be str or a session instance")}else try{throw new Error("not implemented")}catch(t){e=new ns}this.session=e,this.floodSleepLimit=a.floodSleepLimit,this._eventBuilders=[],this._requestRetries=a.requestRetries,this._connectionRetries=a.connectionRetries,this._connectionRetriesToFallback=a.connectionRetriesToFallback,this._retryDelay=a.retryDelay||0,this._retryMainConnectionDelay=a.retryMainConnectionDelay||0,this._timeout=a.timeout,this._autoReconnect=a.autoReconnect,this._connection=a.connection,this._fallbackConnection=a.fallbackConnection,this._initWith=e=>new Me.InvokeWithLayer({layer:225,query:new Me.InitConnection({apiId:this.apiId,deviceModel:a.deviceModel||os.type().toString()||"Unknown",systemVersion:a.systemVersion||os.release().toString()||"1.0",appVersion:a.appVersion||"1.0",langCode:a.langCode,langPack:a.langPack,systemLangCode:a.systemLangCode,query:e,proxy:void 0})}),this._args=a}async connect(){await this._initSession(),void 0===this._sender&&(this._sender=new Jt(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}));const e=new this._connection({ip:this.session.serverAddress,port:this.session.port,dcId:this.session.dcId,loggers:this._log,isTestServer:this.session.isTestServer}),t=new this._fallbackConnection({ip:this.session.serverAddress,port:this.session.port,dcId:this.session.dcId,loggers:this._log,isTestServer:this.session.isTestServer});if(!await this._sender.connect(e,!1,t))return void(this._loopStarted||(this._updateLoop(),this._loopStarted=!0));this.session.setAuthKey(this._sender.authKey),await this._sender.send(this._initWith(new Me.help.GetConfig)),this._loopStarted||(this._updateLoop(),this._loopStarted=!0),this._connectedDeferred.resolve(),this._isSwitchingDc=!1;const s=await this._borrowExportedSender(this.session.dcId,!1,void 0,0,this.isPremium);s&&this.releaseExportedSender(s)}async _initSession(){if(await this.session.load(),!this.session.serverAddress||this.session.serverAddress.includes(":")!==this._useIPV6){const e=ts(this.defaultDcId);this.session.setDC(this.defaultDcId,e.ipAddress,this._args.useWSS?443:80,this._args.isTestServerRequested)}}setPingCallback(e){this.pingCallback=e}async setForceHttpTransport(e){this._shouldForceHttpTransport=e,this.disconnect(),this._sender=void 0,await this.connect()}async setAllowHttpTransport(e){this._shouldAllowHttpTransport=e,this.disconnect(),this._sender=void 0,await this.connect()}setShouldDebugExportedSenders(e){this._shouldDebugExportedSenders=e}getShouldDebugExportedSenders(){return this._shouldDebugExportedSenders}async _updateLoop(){let e;const t=this._sender;if(!t)throw new Error("Sender is not initialized");for(;!this._destroyed;)if(await te(3e3),t.isReconnecting||this._isSwitchingDc)e=void 0;else{try{const s=()=>{if(!this._destroyed)return t.send(new Me.PingDelayDisconnect({pingId:z(),disconnectDelay:6e4}))},n=Date.now(),a=e?n-e:void 0;if(!a||a<5e3)await ma(()=>ha(s,5e3),3,100);else{let e=setTimeout(()=>{this._handleUpdate(new Dt(Dt.disconnected)),e=void 0},1e3);await ha(s,3e3),e&&(clearTimeout(e),e=void 0),this._handleUpdate(new Dt(Dt.connected))}e=Date.now()}catch(s){if(console.warn(s),e=void 0,t.isReconnecting||this._isSwitchingDc)continue;if(this._destroyed)break;t.reconnect()}if(Date.now()-this._lastRequest>18e5){try{await(this.pingCallback?.())}catch(e){}e=void 0}}this.disconnect()}disconnect(){this._sender?.disconnect(),Object.values(this._exportedSenderPromises).forEach(e=>{Object.values(e).forEach(e=>{e?.then(e=>e?.disconnect())})}),Object.values(this._exportedSenderReleaseTimeouts).forEach(e=>{Object.values(e).forEach(e=>{clearTimeout(e)})}),this._exportedSenderRefCounter={},this._exportedSenderPromises={},this._waitingForAuthKey={}}destroy(){this._destroyed=!0;try{this.disconnect(),this._sender?.destroy()}catch(e){}this.session.delete(),this._eventBuilders=[]}async _switchDC(e){if(!this._sender)throw new Error("Sender is not initialized");this._log.info(`Reconnecting to new data center ${e}`);const t=ts(e),s=this.session.isTestServer||this._args.isTestServerRequested;return this.session.setDC(e,t.ipAddress,t.port,s),await this._sender.authKey.setKey(void 0),this.session.setAuthKey(void 0),this._isSwitchingDc=!0,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 s=await this._exportedSenderPromises[e][t];delete this._exportedSenderPromises[e][t],delete this._exportedSenderRefCounter[e][t],s?.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;t?.disconnect()})))}async _connectSender(e,t,s,n=!1){let a,i=Boolean(e.authKey.getKey());if(!i)if(this._waitingForAuthKey[t]){await this._waitingForAuthKey[t];const s=this.session.getAuthKey(t);i=Boolean(e.authKey?.getKey()),i&&await e.authKey.setKey(s.getKey())}else this._waitingForAuthKey[t]=new Promise(e=>{a=e});const o=ts(t,i);for(;;)try{return await e.connect(new this._connection({ip:o.ipAddress,port:o.port,dcId:t,loggers:this._log,isTestServer:this.session.isTestServer,isPremium:!!i&&n}),!1,new this._fallbackConnection({ip:o.ipAddress,port:o.port,dcId:t,loggers:this._log,isTestServer:this.session.isTestServer,isPremium:!!i&&n})),this.session.dcId===t||e._authenticated||await navigator.locks.request("GRAMJS_AUTH_EXPORT",async()=>{this._log.info(`Exporting authorization for data center ${o.ipAddress}`);const s=await this.invoke(new Me.auth.ExportAuthorization({dcId:t})),n=this._initWith(new Me.auth.ImportAuthorization({id:s.id,bytes:s.bytes}));await e.send(n),e._authenticated=!0}),e._dcId=t,e.userDisconnected=!1,a&&(a(),delete this._waitingForAuthKey[t]),this._shouldDebugExportedSenders&&console.warn(`✅ Connected to exported sender idx=${s} dc=${t}`),e}catch(n){this._shouldDebugExportedSenders&&console.error(`☠️ ERROR! idx=${s} dcId=${t} ${n.message}`),console.error(n),await te(1e3),e.disconnect()}}releaseExportedSender(e){const t=e._dcId,s=e._senderIndex;this._exportedSenderRefCounter[t]&&this._exportedSenderRefCounter[t][s]&&(this._exportedSenderRefCounter[t][s]-=1,this._exportedSenderRefCounter[t][s]<=0&&(this._exportedSenderReleaseTimeouts[t]||(this._exportedSenderReleaseTimeouts[t]={}),this._exportedSenderReleaseTimeouts[t][s]=setTimeout(()=>{this._shouldDebugExportedSenders&&console.log(`[CC] [idx=${s} dcId=${t}] 🚪 Release`),e.disconnect(),this._exportedSenderReleaseTimeouts[t][s]=void 0,this._exportedSenderPromises[t][s]=void 0},3e4)))}async _borrowExportedSender(e,t,s,n,a){const i=n||0;let o,r=!1;this._exportedSenderPromises[e]||(this._exportedSenderPromises[e]={},r=!0),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(s||this._createExportedSender(e,i),e,n,a));try{if(o=await this._exportedSenderPromises[e][i],!o?.isConnected())return o?.isConnecting?(await te(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),r&&o.send(this._initWith(new Me.help.GetConfig)),o}_createExportedSender(e,t){return new Jt(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,updateCallback:this._handleUpdate.bind(this),getShouldDebugExportedSenders:this.getShouldDebugExportedSenders.bind(this),onConnectionBreak:()=>this._cleanupExportedSender(e,t)})}getSender(e,t,s){return e?this._borrowExportedSender(e,void 0,void 0,t,s):Promise.resolve(this._sender)}downloadFile(e,t){return async function(e,t,s,n){const{dcId:a}=s;for(let i=0;i<5;i++)try{return await ca(e,t,s,n)}catch(t){if(!(t instanceof Ae&&(t.errorMessage.startsWith("SESSION_REVOKED")||t.errorMessage.startsWith("CONNECTION_NOT_INITED"))&&i<4))throw t;await e._cleanupExportedSenders(a)}}(this,e,t,this._shouldDebugExportedSenders)}downloadMedia(e,t){let s;if(e instanceof Me.Message||e instanceof Me.StoryItem)s=e.media;else if(e instanceof Me.MessageService){const t=e.action;"photo"in t&&(s=t.photo)}else s=e;return s instanceof Me.MessageMediaWebPage&&s.webpage instanceof Me.WebPage&&(s=s.webpage.document||s.webpage.photo),s instanceof Me.MessageMediaPhoto||s instanceof Me.Photo?this._downloadPhoto(s,t):s instanceof Me.MessageMediaDocument||s instanceof Me.Document?this._downloadDocument(s,t):s instanceof Me.WebDocument||s instanceof Me.WebDocumentNoProxy?this._downloadWebDocument(s):void 0}downloadProfilePhoto(e,t=!1){const s=e.photo;if(!(s instanceof Me.UserProfilePhoto||s instanceof Me.ChatPhoto))return;const n=s.dcId,a=new Me.InputPeerPhotoFileLocation({peer:Zt(e),photoId:s.photoId,big:t||void 0});return this.downloadFile(a,{dcId:n,isPriority:!0})}downloadStickerSetThumb(e){if(!e.thumbs?.length&&!e.thumbDocumentId)return;const t=e.thumbVersion;return e.thumbDocumentId?this.invoke(new Me.messages.GetCustomEmojiDocuments({documentId:[e.thumbDocumentId]})).then(e=>{const t=e[0];if(t&&!(t instanceof Me.DocumentEmpty))return this.downloadFile(new Me.InputDocumentFileLocation({id:t.id,accessHash:t.accessHash,fileReference:t.fileReference,thumbSize:""}),{fileSize:rs(t.size),dcId:t.dcId})}):this.downloadFile(new Me.InputStickerSetThumb({stickerset:new Me.InputStickerSetID({id:e.id,accessHash:e.accessHash}),thumbVersion:t}),{dcId:e.thumbDcId})}pickFileSize(e,t){if(!e?.length)return;if(!t)return e.reduce((e,t)=>"w"in t?e&&"w"in e&&e.w>t.w?e:t:e,void 0);let s;for(let n=ga.indexOf(t);n<ga.length;n++)if(s=e.find(e=>"type"in e&&e.type===ga[n]),s)return s}_downloadCachedPhotoSize(e){let t;return t=e instanceof Me.PhotoStrippedSize?es(e.bytes):e.bytes,t}_downloadPhoto(e,t){let s=e;if(e instanceof Me.MessageMediaPhoto&&e.photo instanceof Me.Photo&&(s=e.photo),!(s instanceof Me.Photo))return;const n="u"===t.sizeType||"v"===t.sizeType?s.videoSizes:[],a=this.pickFileSize([...n,...s.sizes],t.sizeType);if(!a||a instanceof Me.PhotoSizeEmpty||a instanceof Me.VideoSizeEmojiMarkup||a instanceof Me.VideoSizeStickerMarkup)return;if(a instanceof Me.PhotoCachedSize||a instanceof Me.PhotoStrippedSize)return this._downloadCachedPhotoSize(a);let i;return i=a instanceof Me.PhotoSizeProgressive?Math.max(...a.sizes):"size"in a?a.size:512,this.downloadFile(new Me.InputPhotoFileLocation({id:s.id,accessHash:s.accessHash,fileReference:s.fileReference,thumbSize:a.type}),{dcId:s.dcId,fileSize:i,progressCallback:t.progressCallback})}_downloadDocument(e,t){let s,n=e;if(n instanceof Me.MessageMediaDocument&&n.document instanceof Me.Document&&(n=n.document),n instanceof Me.Document){if(t.sizeType){if(s=this.pickFileSize([...n.thumbs||[],...n.videoThumbs||[]],t.sizeType),!s&&n.mimeType.startsWith("video/"))return;if(s&&(s instanceof Me.PhotoCachedSize||s instanceof Me.PhotoStrippedSize))return this._downloadCachedPhotoSize(s)}return this.downloadFile(new Me.InputDocumentFileLocation({id:n.id,accessHash:n.accessHash,fileReference:n.fileReference,thumbSize:s&&"type"in s?s.type:""}),{fileSize:s&&"size"in s?s.size:rs(n.size),progressCallback:t.progressCallback,start:t.start,end:t.end,dcId:n.dcId,workers:t.workers})}}async _downloadWebDocument(e){if(e instanceof Me.WebDocumentNoProxy){const t=await fetch(e.url).then(e=>e.arrayBuffer());return la.from(t)}try{const t=[];let s=0;for(;;){const n=new Me.upload.GetWebFile({location:new Me.InputWebFileLocation({url:e.url,accessHash:e.accessHash}),offset:s,limit:fa}),a=await this._borrowExportedSender(this._config?.webfileDcId||4);if(!a)throw new Error("Failed to obtain sender");const i=await a.send(n);if(this.releaseExportedSender(a),s+=fa,!i.bytes.length)break;if(t.push(i.bytes),i.bytes.length<fa)break}return la.concat(t)}catch(e){if(e instanceof Ae&&"WEBFILE_NOT_AVAILABLE"===e.errorMessage)return la.alloc(0);throw e}}async downloadStaticMap(e,t,s,n,a,i,o,r){try{const d=[];let c=0;for(;;)try{const u=new Me.upload.GetWebFile({location:new Me.InputWebFileGeoPointLocation({geoPoint:new Me.InputGeoPoint({lat:s,long:t,accuracyRadius:r}),accessHash:e,w:n,h:a,zoom:i,scale:o}),offset:c,limit:fa}),l=await this._borrowExportedSender(4);if(!l)throw new Error("Failed to obtain sender");const f=await l.send(u);if(this.releaseExportedSender(l),c+=fa,!f.bytes.length)break;if(d.push(f.bytes),f.bytes.length<fa)break}catch(e){if(e instanceof xe){console.warn(`getWebFile: sleeping for ${e.seconds}s on flood wait`),await te(1e3*e.seconds);continue}}return la.concat(d)}catch(e){if(e instanceof Ae&&"WEBFILE_NOT_AVAILABLE"===e.errorMessage)return la.alloc(0);throw e}}async invoke(e,t,s,n){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 o=new Kt(e,s);let r;for(r=0;r<this._requestRetries;r++){i.addStateToQueue(o);try{const e=await o.promise;return o.finished.resolve(),a&&this.releaseExportedSender(i),e}catch(e){if(e instanceof Be||e instanceof Ae&&("RPC_CALL_FAIL"===e.errorMessage||"RPC_MCGET_FAIL"===e.errorMessage||e.errorMessage.match(/INTERDC_\d_CALL(_RICH)?_ERROR/)))this._log.warn(`Telegram is having internal issues ${e.constructor.name}`),await te(2e3);else if(e instanceof xe||e instanceof Fe){if(!(e.seconds<=this.floodSleepLimit))throw o.finished.resolve(),a&&this.releaseExportedSender(i),e;this._log.info(`Sleeping for ${e.seconds}s on flood wait`),await te(1e3*e.seconds)}else if(e instanceof Ee||e instanceof Ne||e instanceof Ue){if(this._log.info(`Phone migrated to ${e.newDc}`),(e instanceof Ee||e instanceof Ne)&&await Kn(this))throw o.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 Ge)await o.isReady(),o.after=void 0;else if(e instanceof Ae&&"CONNECTION_NOT_INITED"===e.errorMessage)this.disconnect(),await te(2e3),await this.connect();else{if(!(e instanceof De))throw o.finished.resolve(),a&&this.releaseExportedSender(i),e;if(!n)throw o.finished.resolve(),a&&this.releaseExportedSender(i),e}}o.resetPromise()}throw a&&this.releaseExportedSender(i),new Error(`Request was unsuccessful ${r} time(s)`)}async invokeBeacon(e,t){if("request"!==e.classType)throw new Error("You can only invoke MTProtoRequests");const s=void 0!==t,n=s?await this.getSender(t):this._sender;n.sendBeacon(e),s&&this.releaseExportedSender(n)}setIsPremium(e){this.isPremium=e}async getMe(){try{return(await this.invoke(new Me.users.GetUsers({id:[new Me.InputUserSelf]})))[0]}catch(e){this._log.warn("error while getting me"),this._log.warn(e)}}async loadConfig(){this._config||(this._config=await this.invoke(new Me.help.GetConfig))}async start(e,t){if(this.isConnected()||await this.connect(),t?.(),this.loadConfig(),await Kn(this,e.shouldThrowIfUnauthorized))return;const s={apiId:this.apiId,apiHash:this.apiHash};await async function(e,t,s){let n;var a;n="botAuthToken"in s?await async function(e,t,s){const{apiId:n,apiHash:a}=t,{botAuthToken:i}=s,{user:o}=await e.invoke(new Me.auth.ImportBotAuthorization({apiId:n,apiHash:a,botAuthToken:i}));return o}(e,t,s):"webAuthToken"in s&&s.webAuthToken?await async function(e,t,s){try{const{apiId:n,apiHash:a}=t,i=await e.invoke(new Me.auth.ImportWebTokenAuthorization({webAuthToken:s.webAuthToken,apiId:n,apiHash:a}));if(i instanceof Me.auth.Authorization)return i.user;throw new Error("SIGN_UP_REQUIRED")}catch(n){return n instanceof Ae&&"SESSION_PASSWORD_NEEDED"===n.errorMessage?Yn(e,0,s,!0):(e._log.error(`Failed to login with web token: ${String(n)}`),s.webAuthTokenFailed(),Wn(e,t,{...s,webAuthToken:void 0}))}}(e,t,s):await Wn(e,t,s),e._log.info(`Signed in successfully as ${a=n,a instanceof Me.User?a.lastName&&a.firstName?`${a.firstName} ${a.lastName}`:a.firstName?a.firstName:a.lastName?a.lastName:"":a instanceof Me.Chat||a instanceof Me.Channel?a.title:""}`)}(this,s,e)}uploadFile(e){return async function(e,t,s){const{file:n,onProgress:a}=t,i=Boolean(e.isPremium),{name:o,size:r}=n,d=H(W(8),!0,!0),c=r>10485760,u=(...e)=>{s&&console.log(`⬆️ [${d.toString()}]`,...e)};u("Uploading file...");const l=1024*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")}(r),f=Math.floor((r+l-1)/l),g=ta(e.session.dcId,i);let p=0;a&&a(p);let h=!1;const m=[];for(let t=0;t<f;t++){const o=await g.requestWorker(!1,l);if(a?.isCanceled){g.releaseWorker(o,l);break}const r=(...e)=>{u(`[${o}]`,...e)},y=n.slice(t*l,(t+1)*l);m.push((async(t,n)=>{for(;;){let u;try{let a=!1;s&&setTimeout(()=>{a||r(`❗️️ getSender took too long j=${t}`)},8e3),u=await e.getSender(e.session.dcId,o,i),a=!0;let l=!1;const g=await n.arrayBuffer();s&&setTimeout(()=>{l||r(`❗️️ sender.send took too long j=${t}`)},6e3),await u.send(c?new Me.upload.SaveBigFilePart({fileId:d,filePart:t,fileTotalParts:f,bytes:ua.from(g)}):new Me.upload.SaveFilePart({fileId:d,filePart:t,bytes:ua.from(g)})),e.releaseExportedSender(u),l=!0}catch(s){if(r(`Upload part failed ${s?.toString()} j=${t}`),u&&!u.isConnected()){await te(1e3);continue}if(s instanceof xe){s instanceof Ve&&!h&&(u?._updateCallback(new aa(!0)),h=!0),await te(1e3*s.seconds);continue}throw g.releaseWorker(o,l),u&&e.releaseExportedSender(u),s}if(g.releaseWorker(o,l),a){if(a.isCanceled)throw new Error("USER_CANCELED");p+=1/f,r(100*p+"%"),a(p)}break}})(t,y))}return await Promise.all(m),c?new Me.InputFileBig({id:d,parts:f,name:o}):new Me.InputFile({id:d,parts:f,name:o,md5Checksum:""})}(this,e,this._shouldDebugExportedSenders)}updateTwoFaSettings(e){return async function(e,{isCheckPassword:t,currentPassword:s,newPassword:n,hint:a="",email:i,emailCodeCallback:o,onEmailCodeError:r}){if(!n&&!s)throw new Error("Neither `currentPassword` nor `newPassword` is present");if(i&&(!o||!r))throw new Error("`email` present without `emailCodeCallback` and `onEmailCodeError`");const d=await e.invoke(new Me.account.GetPassword),c=d.newAlgo;if(c instanceof Me.PasswordKdfAlgoUnknown)throw new Error("Password algorithm is unknown");c.salt1=ys.concat([c.salt1,W(32)]),!d.hasPassword&&s&&(s=void 0);const u=s?await ms(d,s):new Me.InputCheckPasswordEmpty;if(t)await e.invoke(new Me.auth.CheckPassword({password:u}));else try{await e.invoke(new Me.account.UpdatePasswordSettings({password:u,newSettings:new Me.account.PasswordInputSettings({newAlgo:c,newPasswordHash:n?await hs(c,n):ys.alloc(0),hint:a,email:i,newSecureSettings:void 0})}))}catch(t){if(!(t instanceof qe))throw t;for(;;)try{const s=await o(t.codeLength);if(!s)throw new Error("Code is empty",{cause:t});await e.invoke(new Me.account.ConfirmPasswordEmail({code:s}));break}catch(e){r(e)}}}(this,e)}getTmpPassword(e,t){return async function(e,t,s=60){const n=await e.invoke(new Me.account.GetPassword);if(!n)return;const a=await ms(n,t);return await e.invoke(new Me.account.GetTmpPassword({password:a,period:s}))}(this,e,t)}getCurrentPassword(e){return async function(e,t){const s=await e.invoke(new Me.account.GetPassword);if(s)return t?await ms(s,t):new Me.InputCheckPasswordEmpty}(this,e)}addEventHandler(e,t){this._eventBuilders.push([t,e])}_handleUpdate(e){if(e instanceof Me.Updates||e instanceof Me.UpdatesCombined){const t=[];for(const s of[...e.users,...e.chats])t.push(s);this._processUpdate(e,t)}else e instanceof Me.UpdateShort?this._processUpdate(e.update,void 0):this._processUpdate(e,void 0)}_processUpdate(e,t){e._entities=t||[];const s={update:e};this._dispatchUpdate(s)}async _dispatchUpdate(e){for(const[t,s]of this._eventBuilders){const n=t.build(e.update);n&&await s(n)}}isConnected(){return!(!this._sender||!this._sender.isConnected())}}function ha(e,t){let s=!1;return Promise.race([e(),te(t).then(()=>s?void 0:Promise.reject(new Error("TIMEOUT")))]).finally(()=>{s=!0})}async function ma(e,t,s){for(let n=0;n<t;n++)try{return await e()}catch(e){if(n===t-1)throw e;await te(s)}}const ya=pa,_a=3600;function ba(e,t,s){return e*_a+60*t+s}function Sa(e){return`#${e.toString(16).padStart(6,"0")}`}function wa(e){return e.hasOwnProperty("userId")}function Ia(e){return e.hasOwnProperty("chatId")}function va(e,t){return"user"===t?e.toString():"channel"===t?(-1n*(e+P)).toString():(-1n*e).toString()}function Pa(e){return wa(e)?va(e.userId,"user"):Ia(e)?va(e.chatId,"chat"):va(e.channelId,"channel")}function Ca(e){if(e instanceof Me.PeerColor){const{color:t,backgroundEmojiId:s}=e;return{type:"regular",color:t,backgroundEmojiId:s?.toString()}}if(e instanceof Me.PeerColorCollectible){const{collectibleId:t,giftEmojiId:s,backgroundEmojiId:n,accentColor:a,colors:i,darkAccentColor:o,darkColors:r}=e;return{type:"collectible",giftEmojiId:s.toString(),collectibleId:t.toString(),backgroundEmojiId:n.toString(),accentColor:Sa(a),colors:i.map(e=>Sa(e)),darkAccentColor:o?Sa(o):void 0,darkColors:r?.map(e=>Sa(e))}}}function Ma(e){return e.colors.map(e=>Sa(e))}function Aa(e){return{paletteColors:e.paletteColors.map(e=>Sa(e)),bgColors:e.bgColors.map(e=>Sa(e)),storyColors:e.storyColors.map(e=>Sa(e))}}function Ra(e){return e instanceof Me.EmojiStatus?{type:"regular",documentId:e.documentId.toString(),until:e.until}:e instanceof Me.EmojiStatusCollectible?{type:"collectible",collectibleId:e.collectibleId.toString(),documentId:e.documentId.toString(),title:e.title,slug:e.slug,patternDocumentId:e.patternDocumentId.toString(),centerColor:Sa(e.centerColor),edgeColor:Sa(e.edgeColor),patternColor:Sa(e.patternColor),textColor:Sa(e.textColor),until:e.until}:void 0}function ka(e){if("photoId"in e)return e.photoId.toString()}function Ta(e){return{botId:va(e.botId,"user"),iconId:e.icon.toString(),description:e.description}}function Ba(e){const{silent:t,muteUntil:s,showPreviews:n,otherSound:a}=e;return{hasSound:!(a instanceof Me.NotificationSoundNone),isSilentPosting:t,mutedUntil:s,shouldShowPreviews:n}}function Da(e){switch(e.className){case"ProfileTabPosts":return"stories";case"ProfileTabGifts":return"gifts";case"ProfileTabMedia":return"media";case"ProfileTabFiles":return"documents";case"ProfileTabMusic":return"audio";case"ProfileTabVoice":return"voice";case"ProfileTabLinks":return"links";case"ProfileTabGifs":return"gif";default:return e}}"undefined"==typeof File&&(self.File=class extends Blob{constructor(e,t,s){if(s){const{type:t,...n}=s;super(e,{type:t}),Object.assign(this,n)}else super(e);this.name=t}});var Ua=s(48287).hp;const Ea={PHONE_NUMBER_INVALID:"ErrorPhoneNumberInvalid",PHONE_CODE_INVALID:"ErrorCodeInvalid",PASSWORD_HASH_INVALID:"ErrorIncorrectPassword",PHONE_PASSWORD_FLOOD:"ErrorPasswordFlood",PHONE_NUMBER_BANNED:"ErrorPhoneBanned",EMAIL_UNCONFIRMED:"ErrorEmailUnconfirmed",EMAIL_HASH_EXPIRED:"ErrorEmailHashExpired",NEW_SALT_INVALID:"ErrorNewSaltInvalid",SRP_PASSWORD_CHANGED:"ErrorPasswordChanged",CODE_INVALID:"ErrorEmailCodeInvalid",PASSWORD_MISSING:"ErrorPasswordMissing",PASSKEY_CREDENTIAL_NOT_FOUND:"ErrorPasskeyUnknown"};function xa(e){if(e instanceof Me.Message||e instanceof Me.MessageService)return Pa(e.peerId)}function Va(e){return e instanceof Me.DialogFilter||e instanceof Me.DialogFilterChatlist}function Ga(e){return String.fromCharCode(...e)}function Fa(e){return Ua.from(e,"binary")}function Na(e){return e instanceof Error}function qa(e){return e instanceof Ae?{message:e.errorMessage,code:e.code,hasErrorKey:!0}:{message:e.message}}function Ha(e){let t;const s=e instanceof Ae?e.errorMessage:void 0;if(e instanceof xe)t={key:"ErrorFloodTime",variables:{time:La(e.seconds)}};else if(e instanceof He)t={key:"ErrorPasswordFresh",variables:{time:La(e.seconds)}};else if(e instanceof Le)t={key:"ErrorSessionFresh",variables:{time:La(e.seconds)}};else if(e instanceof Ae){const s=function(e){return Ea[e]||Ea[e.replace(/_\d+$/,"")]}(e.errorMessage);s&&(t={key:s})}return t||(t=e.message?{key:"ErrorUnexpectedMessage",variables:{error:e.message}}:{key:"ErrorUnexpected"}),{messageKey:t,errorMessage:s,error:e}}function La(e){if(e<60)return{key:"Seconds",variables:{count:e},options:{pluralValue:e}};if(e<_a){const t=function(e){return(0,Math.ceil)(e/60)}(e);return{key:"Minutes",variables:{count:t},options:{pluralValue:t}}}if(e<86400){const t=function(e){return(0,Math.ceil)(e/_a)}(e);return{key:"Hours",variables:{count:t},options:{pluralValue:t}}}const t=function(e){return(0,Math.ceil)(e/86400)}(e);return{key:"Days",variables:{count:t},options:{pluralValue:t}}}let Oa;function ja(e){!function(e){Ja?Ja.push(e):Ja=[e],Ka&&!l.has(e["@type"])||(Ka=R(za,u,!0),$a=Math.random()),Ka($a)}(e)}function Wa(e){Oa(e)}const za=k(function(e){if(!Ja||e!==$a)return;const t=Ja;Ja=void 0,t.forEach(Oa)});let Ka,$a,Ja;const Qa=/\b(?:(\d{1,2}):)?([0-5]?\d):([0-5]\d)\b/g;function Xa(e){const t={...e,text:e.text,entities:e.entities?.filter(e=>e.type!==vs.Timestamp)||[]},s=t.text;for(const e of s.matchAll(Qa)){const s=e[0],n=e[1],a=e[2],i=e[3],o=e.index??0,r=s.length,d=parseInt(a,10),c=parseInt(i,10);if(d>59||c>59)continue;let u;u=ba(void 0!==n?parseInt(n,10):0,d,c);let l=!1;for(const e of t.entities)if(o<e.offset+e.length&&o+r>e.offset){l=!0;break}if(l)continue;const f={type:vs.Timestamp,offset:o,length:r,timestamp:u};let g=!1;for(let e=0;e<t.entities.length;e++)if(o<t.entities[e].offset){t.entities.splice(e,0,f),g=!0;break}g||t.entities.push(f)}return t}function Ya(e){e instanceof Me.Message&&(e.media&&ei(e.media,e),e.replyTo instanceof Me.MessageReplyHeader&&e.replyTo.replyMedia&&ei(e.replyTo.replyMedia,e)),e instanceof Me.MessageService&&"photo"in e.action&&si(ii(e.action.photo,e)),e instanceof Me.SponsoredMessage&&e.photo&&si(e.photo)}function Za(e){e instanceof Me.WebPage&&(e.document&&ni(oi(e.document,e)),e.photo&&si(oi(e.photo,e)))}function ei(e,t){if(e instanceof Me.MessageMediaDocument&&e.document&&(ni(ii(e.document,t)),e.altDocuments))for(const s of e.altDocuments)ni(ii(s,t));e instanceof Me.MessageMediaGame&&(e.game.document&&ni(ii(e.game.document,t)),si(ii(e.game.photo,t))),e instanceof Me.MessageMediaPhoto&&e.photo&&si(ii(e.photo,t)),e instanceof Me.MessageMediaInvoice&&(e.photo&&ci(ii(e.photo,t)),e.extendedMedia instanceof Me.MessageExtendedMedia&&ei(e.extendedMedia.media,t)),e instanceof Me.MessageMediaPaidMedia&&e.extendedMedia.forEach(e=>{e instanceof Me.MessageExtendedMedia&&ei(e.media,t)}),e instanceof Me.MessageMediaPoll&&e.attachedMedia&&ei(e.attachedMedia,t)}function ti(e,t){if(e instanceof Me.StoryItem&&(e.media instanceof Me.MessageMediaPhoto&&e.media.photo&&si(ai(e.media.photo,t,e)),e.media instanceof Me.MessageMediaDocument&&(e.media.document instanceof Me.Document&&ni(ai(e.media.document,t,e)),e.media.altDocuments)))for(const s of e.media.altDocuments)ni(ai(s,t,e))}function si(e){e instanceof Me.Photo&&(Js.photos[String(e.id)]=e)}function ni(e){if(e instanceof Me.Document){const t=String(e.id),s=Js.documents[t];if(s&&e.accessHash===s.accessHash&&e.fileReference===s.fileReference&&!e.localRepairInfo)return;Js.documents[t]=e}}function ai(e,t,s){if(!(e instanceof Me.Document||e instanceof Me.Photo))return e;const n=e;return n.localRepairInfo={type:"story",peerId:t,id:s.id},n}function ii(e,t){if(!t?.peerId)return e;if(!(e instanceof Me.Document||e instanceof Me.Photo||e instanceof Me.WebDocument))return e;const s=e;return s.localRepairInfo={type:"message",peerId:Pa(t.peerId),id:t.id},s}function oi(e,t){if(!(t instanceof Me.WebPage))return e;if(!(e instanceof Me.Document||e instanceof Me.Photo||e instanceof Me.WebDocument))return e;const s=e;return s.localRepairInfo={type:"webPage",url:t.url},s}function ri(e){const t=va(e.id,e instanceof Me.Chat?"chat":"channel"),s=Js.chats[t],n=s&&"min"in s&&s.min,a="min"in e&&e.min;s&&!n&&a||(Js.chats[t]=e)}function di(e){if(e instanceof Me.UserEmpty)return;const t=va(e.id,"user"),s=Js.users[t];e.photo instanceof Me.Photo&&si(e.photo),s&&!s.min&&e.min||(Js.users[t]=e)}function ci(e){Js.webDocuments[e.url]=e}function ui(e){let t="M";const s=e.length;for(let n=0;n<s;n++){const s=e[n];s>=192?t+="AACAAAAHAAALMAAAQASTAVAAAZaacaaaahaaalmaaaqastava.az0123456789-,"[s-128-64]:(s>=128?t+=",":s>=64&&(t+="-"),t+=String(63&s))}return t+="z",t}const li={w:100,h:100};function fi(e,t){if(!e||!e.length)return;const s=e.find(e=>e instanceof Me.PhotoStrippedSize);if(!s)return;const n=e.filter(e=>e instanceof Me.PhotoSize),{w:a,h:i}=n.length?n[n.length-1]:li,{bytes:o}=s;return{dataUri:qs(t&&"image/jpeg"!==t?o:es(o),void 0,t),width:a,height:i}}function gi(e,t){const{w:s,h:n}=t;var a,i,o;return{dataUri:`data:image/svg+xml;utf8,${a=e.bytes,i=s,o=n,'<?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>'.replace("{{path}}",ui(a)).replace("{{width}}",String(i)).replace("{{height}}",String(o))}`,width:s,height:n}}function pi(e,t){const s=e.sizes.filter(e=>e instanceof Me.PhotoSize||e instanceof Me.PhotoSizeProgressive).map(yi);return{mediaType:"photo",id:String(e.id),thumbnail:fi(e.sizes),sizes:s,isSpoiler:t,date:e.date,...e.videoSizes&&{videoSizes:Ds(e.videoSizes.map(mi)),isVideo:!0}}}function hi(e){return e.filter(e=>e instanceof Me.PhotoSize||e instanceof Me.PhotoSizeProgressive).map(yi)}function mi(e){if(!(e instanceof Me.VideoSize))return;const{videoStartTs:t,size:s,h:n,w:a,type:i}=e;return{videoStartTs:t,size:s,height:n,width:a,type:i}}function yi(e){const{w:t,h:s,type:n}=e;return{width:t,height:s,type:n}}function _i(e){if(!("usernames"in e&&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(({username:e,active:s,editable:n})=>{t.push({username:e,...s&&{isActive:!0},...n&&{isEditable:!0}})}),t}function bi(e){let t,s,n,a,i,o,r,d="none";const c=Js.chats;return e.forEach(e=>{e instanceof Me.PrivacyValueAllowAll?t||="everybody":e instanceof Me.PrivacyValueAllowContacts?t||="contacts":e instanceof Me.PrivacyValueAllowCloseFriends?t||="closeFriends":e instanceof Me.PrivacyValueDisallowContacts?t||="nonContacts":e instanceof Me.PrivacyValueDisallowAll?t||="nobody":e instanceof Me.PrivacyValueAllowUsers?n=e.users.map(e=>va(e,"user")):e instanceof Me.PrivacyValueDisallowUsers?i=e.users.map(e=>va(e,"user")):e instanceof Me.PrivacyValueAllowChatParticipants?a=e.chats.map(e=>{const t=va(e,"chat"),s=va(e,"channel");return c[t]?t:s}):e instanceof Me.PrivacyValueDisallowChatParticipants?o=e.chats.map(e=>{const t=va(e,"chat"),s=va(e,"channel");return c[t]?t:s}):e instanceof Me.PrivacyValueAllowPremium?r=!0:e instanceof Me.PrivacyValueAllowBots?d="allow":e instanceof Me.PrivacyValueDisallowBots&&(d="disallow")}),t||(t="nobody",s=!0),{visibility:t,isUnspecified:s,allowUserIds:n||[],allowChatIds:a||[],blockUserIds:i||[],blockChatIds:o||[],shouldAllowPremium:r,botsPrivacy:d}}function Si(e){const{text:t,entities:s}=e;return{text:t,entities:s.map(wi)}}function wi(e){const{className:t,offset:s,length:n}=e;return e instanceof Me.MessageEntityMentionName?{type:vs.MentionName,offset:s,length:n,userId:va(e.userId,"user")}:e instanceof Me.MessageEntityTextUrl?{type:vs.TextUrl,offset:s,length:n,url:e.url}:e instanceof Me.MessageEntityPre?{type:vs.Pre,offset:s,length:n,language:e.language}:e instanceof Me.MessageEntityCustomEmoji?{type:vs.CustomEmoji,offset:s,length:n,documentId:e.documentId.toString()}:e instanceof Me.MessageEntityBlockquote?{type:vs.Blockquote,canCollapse:e.collapsed,offset:s,length:n}:e instanceof Me.MessageEntityFormattedDate?{type:vs.FormattedDate,offset:s,length:n,date:e.date,relative:e.relative,shortTime:e.shortTime,longTime:e.longTime,shortDate:e.shortDate,longDate:e.longDate,dayOfWeek:e.dayOfWeek}:e instanceof Me.MessageEntityDiffInsert?{type:vs.DiffInsert,offset:s,length:n}:e instanceof Me.MessageEntityDiffReplace?{type:vs.DiffReplace,offset:s,length:n,oldText:e.oldText}:e instanceof Me.MessageEntityDiffDelete?{type:vs.DiffDelete,offset:s,length:n}:{type:t,offset:s,length:n}}function Ii(e){return{from:Si(e.from),to:Si(e.to)}}function vi(e){return e instanceof Me.AiComposeToneDefault?{tone:e.tone,emojiId:e.emojiId.toString(),title:e.title}:{id:e.id.toString(),accessHash:e.accessHash.toString(),slug:e.slug,title:e.title,isCreator:e.creator||void 0,emojiId:e.emojiId?.toString(),prompt:e.prompt,installsCount:e.installsCount,authorId:e.authorId?.toString(),exampleEnglish:e.exampleEnglish?Ii(e.exampleEnglish):void 0}}function Pi(e){return{resultText:Si(e.resultText),diffText:e.diffText?Si(e.diffText):void 0}}function Ci(e){const{recentReactions:t,results:s,canSeeList:n,reactionsAsTags:a,topReactors:i}=e;return{areTags:a,canSeeList:n,results:s.map(Ai).filter(Boolean).sort(Mi),recentReactions:t?.map(ki).filter(Boolean),topReactors:i?.map(Ri).filter(Boolean)}}function Mi(e,t){if("paid"===e.reaction.type)return-1;if("paid"===t.reaction.type)return 1;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 Ai(e){const{chosenOrder:t,count:s,reaction:n}=e,a=Ti(n,!0);if(a)return{chosenOrder:t,count:s,reaction:a}}function Ri(e){const{count:t,my:s,top:n,anonymous:a,peerId:i}=e;return{peerId:i&&Pa(i),count:t,isMy:s,isTop:n,isAnonymous:a}}function ki(e){const{peerId:t,reaction:s,big:n,unread:a,date:i,my:o}=e,r=Ti(s);if(r)return{peerId:Pa(t),reaction:r,addedDate:i,isUnread:a,isBig:n,isOwn:o}}function Ti(e,t){return e instanceof Me.ReactionEmoji?{type:"emoji",emoticon:e.emoticon}:e instanceof Me.ReactionCustomEmoji?{type:"custom",documentId:e.documentId.toString()}:t&&e instanceof Me.ReactionPaid?{type:"paid"}:void 0}function Bi(e){const{reaction:t,title:s,count:n}=e,a=Ti(t);if(a)return{reaction:a,title:s,count:n}}function Di(e){const{selectAnimation:t,staticIcon:s,reaction:n,title:a,appearAnimation:i,inactive:o,aroundAnimation:r,centerIcon:d,effectAnimation:c,activateAnimation:u,premium:l}=e;return{selectAnimation:Vr(t),appearAnimation:Vr(i),activateAnimation:Vr(u),effectAnimation:Vr(c),staticIcon:Vr(s),aroundAnimation:r?Vr(r):void 0,centerIcon:d?Vr(d):void 0,reaction:{type:"emoji",emoticon:n},title:a,isInactive:o,isPremium:l}}function Ui(e){const{id:t,emoticon:s,premiumRequired:n,staticIconId:a,effectStickerId:i,effectAnimationId:o}=e;return{id:t.toString(),emoticon:s,isPremium:n,staticIconId:a?.toString(),effectStickerId:i.toString(),effectAnimationId:o?.toString()}}function Ei(e,t,s){if(e instanceof Me.DocumentEmpty)return;ni(e);const{mimeType:n,videoThumbs:a}=e,i=e.attributes.find(e=>e instanceof Me.DocumentAttributeSticker),o=e.attributes.find(e=>e instanceof Me.DocumentAttributeCustomEmoji);if(!i&&!o)return;const r="application/x-tgsticker"===n,d=n===p,c=Boolean(o),u=c&&o.textColor,l=e.attributes.find(e=>e instanceof Me.DocumentAttributeImageSize),f=e.attributes.find(e=>e instanceof Me.DocumentAttributeVideo),g=l||f,h=i||o,m=(S=h?.stickerset,S instanceof Me.InputStickerSetID?{id:String(S.id),accessHash:String(S.accessHash)}:S instanceof Me.InputStickerSetShortName?{shortName:S.shortName}:{isMissing:!0}),y=h?.alt,_=Boolean(o?.free??!0)&&!s,b=e.thumbs&&e.thumbs.find(e=>e instanceof Me.PhotoCachedSize);var S;if(!(n!==p||self.isWebmSupported||b||e.thumbs&&e.thumbs.find(e=>e instanceof Me.PhotoSize)))return;const w=e.thumbs&&e.thumbs.find(e=>e instanceof Me.PhotoPathSize),I=b?function(e){const{w:t,h:s,bytes:n}=e;return{dataUri:qs(n,void 0,"image/webp"),width:t,height:s}}(b):w&&g?gi(w,g):void 0,v=e.thumbs&&hi(e.thumbs),{w:P,h:C}=b||g||{},M=!t&&a&&Ds(a?.filter(e=>e instanceof Me.VideoSize)).some(({type:e})=>"f"===e);return{mediaType:"sticker",id:String(e.id),stickerSetInfo:m,emoji:y,isCustomEmoji:c,isLottie:r,isVideo:d,width:P,height:C,thumbnail:I,hasEffect:M,isFree:_,shouldUseTextColor:u,previewPhotoSizes:v}}function xi(e){const{archived:t,installedDate:s,id:n,accessHash:a,title:i,thumbs:o,count:r,shortName:d,emojis:c,thumbDocumentId:u}=e,l=o?.some(e=>"s"===e.type),f=o?.some(e=>"a"===e.type),g=o?.some(e=>"v"===e.type),p=void 0!==u?String(u):void 0,h=l||f||g||Boolean(p);return{isArchived:t,isEmoji:c,installedDate:s,id:String(n),accessHash:String(a),title:i,hasStaticThumb:l,hasAnimatedThumb:f,hasVideoThumb:g,hasThumbnail:h,thumbCustomEmojiId:p,count:r,shortName:d}}function Vi(e){const t=xi(e.set);if(e instanceof Me.StickerSetNoCovered)return t;const s=Fi(e instanceof Me.StickerSetCovered?[e.cover]:e instanceof Me.StickerSetMultiCovered?e.covers:e.documents);return e instanceof Me.StickerSetFullCovered?{...t,stickers:s,packs:Gi(e.packs)}:{...t,covers:s}}function Gi(e){return e.reduce((e,{emoticon:t,documents:s})=>(e[t]=s.map(e=>{const t=Js.documents[String(e)];if(t)return Ei(t)}).filter(Boolean),e),{})}function Fi(e){return e.map(e=>{if(e instanceof Me.Document)return Ei(e)}).filter(Boolean)}function Ni(e,t){if(!(e instanceof Me.ReplyKeyboardMarkup||e instanceof Me.ReplyInlineMarkup))return;const s=e.rows.map(({buttons:e})=>e.map(e=>{const{text:s,style:n}=e,a=Bs({style:n&&qi(n)});return e instanceof Me.KeyboardButton?{...a,type:"command",text:s}:e instanceof Me.KeyboardButtonUrl?e.url.includes("?startgroup=")?{...a,type:"unsupported",text:s}:{...a,type:"url",text:s,url:e.url}:e instanceof Me.KeyboardButtonCallback?e.requiresPassword?{...a,type:"unsupported",text:s}:{...a,type:"callback",text:s,data:Ga(e.data)}:e instanceof Me.KeyboardButtonRequestPoll?{...a,type:"requestPoll",text:s,isQuiz:e.quiz}:e instanceof Me.KeyboardButtonRequestPhone?{...a,type:"requestPhone",text:s}:e instanceof Me.KeyboardButtonBuy?t?{...a,type:"receipt",receiptMessageId:t}:{...a,type:"buy",text:s}:e instanceof Me.KeyboardButtonGame?{...a,type:"game",text:s}:e instanceof Me.KeyboardButtonSwitchInline?{...a,type:"switchBotInline",text:s,query:e.query,isSamePeer:e.samePeer}:e instanceof Me.KeyboardButtonUserProfile?{...a,type:"userProfile",text:s,userId:e.userId.toString()}:e instanceof Me.KeyboardButtonSimpleWebView?{...a,type:"simpleWebView",text:s,url:e.url}:e instanceof Me.KeyboardButtonWebView?{...a,type:"webView",text:s,url:e.url}:e instanceof Me.KeyboardButtonUrlAuth?{...a,type:"urlAuth",text:s,url:e.url,buttonId:e.buttonId}:e instanceof Me.KeyboardButtonCopy?{...a,type:"copy",text:s,copyText:e.copyText}:{...a,type:"unsupported",text:s}}).filter(Boolean));return s.every(e=>!e.length)?void 0:{[e instanceof Me.ReplyKeyboardMarkup?"keyboardButtons":"inlineButtons"]:s,...e instanceof Me.ReplyKeyboardMarkup&&{keyboardPlaceholder:e.placeholder,isKeyboardSingleUse:e.singleUse,isKeyboardSelective:e.selective}}}function qi(e){const{bgPrimary:t,bgDanger:s,bgSuccess:n,icon:a}=e;return{type:t?"primary":s?"destructive":n?"success":void 0,iconId:a?.toString()}}function Hi(e,t,s,n){const a={};return e instanceof Me.BotInlineMessageText?a.text={text:e.message,entities:e.entities?.map(wi)}:e instanceof Me.BotInlineMessageMediaAuto?"photo"===t&&n instanceof Me.Photo?a.photo=pi(n):"audio"===t&&s instanceof Me.Document?a.audio=Er(s):"video"===t&&s instanceof Me.Document?a.video=Ur(s):"sticker"===t&&s instanceof Me.Document?a.sticker=Ei(s):"file"===t&&s instanceof Me.Document?a.document=Vr(s):"gif"===t&&s instanceof Me.Document?a.video=Ur(s):a.text={text:e.message,entities:e.entities?.map(wi)}:e instanceof Me.BotInlineMessageMediaGeo?a.location={mediaType:"geo",geo:Fr(e.geo)}:e instanceof Me.BotInlineMessageMediaVenue?a.location={mediaType:"venue",geo:Fr(e.geo),title:e.title,address:e.address,provider:e.provider,venueId:e.venueId,venueType:e.venueType}:e instanceof Me.BotInlineMessageMediaContact?a.contact={mediaType:"contact",phoneNumber:e.phoneNumber,firstName:e.firstName,lastName:e.lastName,userId:"0"}:e instanceof Me.BotInlineMessageMediaInvoice&&(a.invoice={mediaType:"invoice",isTest:e.test,title:e.title,description:e.description,photo:Kr(e.photo),currency:e.currency,amount:rs(e.totalAmount)}),{content:a,replyMarkup:Ni(e.replyMarkup)||void 0}}function Li(e,t){const{id:s,type:n,title:a,description:i,url:o,thumb:r,content:d,sendMessage:c}=e;return{id:s,queryId:t,type:n,sendMessage:Hi(c,n),title:a,description:i,url:o,content:Kr(d),webThumbnail:Kr(r)}}function Oi(e,t){const{id:s,type:n,title:a,description:i,sendMessage:o,photo:r,document:d}=e;return{id:s,queryId:t,type:n,title:a,description:i,..."sticker"===n&&d instanceof Me.Document&&{sticker:Ei(d)},...r instanceof Me.Photo&&{photo:pi(r)},..."gif"===n&&d instanceof Me.Document&&{gif:Ur(d)},..."file"===n&&d instanceof Me.Document&&{document:Vr(d)},..."audio"===n&&d instanceof Me.Document&&{audio:Er(d)},..."video"===n&&d instanceof Me.Document&&{video:Ur(d)},sendMessage:Hi(o,n,d,r)}}function ji(e){return{id:e.botId.toString(),shouldRequestWriteAccess:e.requestWriteAccess,shortName:e.shortName,isForAttachMenu:e.showInAttachMenu,isForSideMenu:e.showInSideMenu,attachMenuPeerTypes:e.peerTypes&&(t=e.peerTypes,t.flatMap(e=>e instanceof Me.AttachMenuPeerTypeBotPM?["bots"]:e instanceof Me.AttachMenuPeerTypePM?["users"]:e instanceof Me.AttachMenuPeerTypeChat?["chats","groups"]:e instanceof Me.AttachMenuPeerTypeBroadcast?["channels"]:e instanceof Me.AttachMenuPeerTypeSameBotPM?["self"]:[])),icons:e.icons.map(Wi).filter(Boolean),isInactive:e.inactive,isDisclaimerNeeded:e.sideMenuDisclaimerNeeded};var t}function Wi(e){if(!(e.icon instanceof Me.Document))return;const t=Vr(e.icon);return t?(ni(e.icon),{name:e.name,document:t}):void 0}function zi(e,t){const{description:s,descriptionPhoto:n,descriptionDocument:a,userId:i,commands:o,menuButton:r,privacyPolicyUrl:d,hasPreviewMedias:c,appSettings:u}=e,l=i&&va(i,"user"),f=n instanceof Me.Photo?pi(n):void 0,g=a instanceof Me.Document?Ur(a):void 0,p=o?.map(e=>$i(l||t,e));return{botId:l||t,description:s,gif:g,photo:f,menuButton:Ji(r),privacyPolicyUrl:d,commands:p?.length?p:void 0,hasPreviewMedia:c,appSettings:u&&Ki(u)}}function Ki(e){const t=e.placeholderPath&&ui(e.placeholderPath);return{backgroundColor:e.backgroundColor?Sa(e.backgroundColor):void 0,backgroundDarkColor:e.backgroundDarkColor?Sa(e.backgroundDarkColor):void 0,headerColor:e.headerColor?Sa(e.headerColor):void 0,headerDarkColor:e.headerDarkColor?Sa(e.headerDarkColor):void 0,placeholderPath:t}}function $i(e,t){return{botId:e,...Hs(t)}}function Ji(e){return e instanceof Me.BotMenuButton?{type:"webApp",text:e.text,url:e.url}:{type:"commands"}}function Qi(e){if(e instanceof Me.BotAppNotModified)return;const{id:t,accessHash:s,title:n,description:a,shortName:i,photo:o,document:r}=e,d=o instanceof Me.Photo?pi(o):void 0,c=r instanceof Me.Document?Vr(r):void 0;return{id:t.toString(),accessHash:s.toString(),title:n,description:a,shortName:i,photo:d,document:c}}function Xi(e){return e instanceof Me.InlineQueryPeerTypeBotPM?"bots":e instanceof Me.InlineQueryPeerTypePM?"users":e instanceof Me.InlineQueryPeerTypeChat?"chats":e instanceof Me.InlineQueryPeerTypeMegagroup?"supergroups":e instanceof Me.InlineQueryPeerTypeBroadcast?"channels":e instanceof Me.InlineQueryPeerTypeSameBotPM?"self":void 0}function Yi(e){const{address:t,geoPoint:s}=e;return{address:t,geo:s&&Fr(s)}}function Zi(e){const{timezoneId:t,weeklyOpen:s}=e;return{timezoneId:t,workHours:s.map(({startMinute:e,endMinute:t})=>({startMinute:e,endMinute:t}))}}function eo(e){const{title:t,description:s,sticker:n}=e;return{title:t,description:s,sticker:n&&Ei(n)}}function to(e){const{fullUser:{about:t,commonChatsCount:s,pinnedMsgId:n,botInfo:a,blocked:i,profilePhoto:o,voiceMessagesForbidden:r,hasScheduled:d,fallbackPhoto:c,personalPhoto:u,translationsDisabled:l,storiesPinnedAvailable:f,contactRequirePremium:g,businessWorkHours:p,businessLocation:h,businessIntro:m,birthday:y,personalChannelId:_,personalChannelMessage:b,sponsoredEnabled:S,stargiftsCount:w,botVerification:I,botCanManageEmojiStatus:v,settings:P,sendPaidMessagesStars:C,displayGiftsButton:M,disallowedGifts:A,starsRating:R,starsMyPendingRating:k,starsMyPendingRatingDate:T,mainTab:B,note:D,noforwardsMyEnabled:U,noforwardsPeerEnabled:E,unofficialSecurityRisk:x},users:V}=e,G=va(V[0].id,"user");return{bio:t,commonChatsCount:s,pinnedMessageId:n,isBlocked:Boolean(i),noVoiceMessages:r,hasPinnedStories:Boolean(f),isTranslationDisabled:l,profilePhoto:o instanceof Me.Photo?pi(o):void 0,fallbackPhoto:c instanceof Me.Photo?pi(c):void 0,personalPhoto:u instanceof Me.Photo?pi(u):void 0,botInfo:a&&zi(a,G),isContactRequirePremium:g,shouldDisplayGiftsButton:M,disallowedGifts:A&&wr(A),birthday:y&&oo(y),businessLocation:h&&Yi(h),businessWorkHours:p&&Zi(p),businessIntro:m&&eo(m),personalChannelId:void 0!==_?va(_,"channel"):void 0,personalChannelMessageId:b,botVerification:I&&Ta(I),areAdsEnabled:S,starGiftCount:w,starsRating:R&&ro(R),starsMyPendingRating:k&&ro(k),starsMyPendingRatingDate:T,isBotCanManageEmojiStatus:v,hasScheduledMessages:d,paidMessagesStars:rs(C),settings:so(P),mainTab:B&&Da(B),note:D&&Si(D),noForwardsMyEnabled:U,noForwardsPeerEnabled:E,isUnofficialSecurityRisk:x}}function so({autoarchived:e,reportSpam:t,addContact:s,blockContact:n,registrationMonth:a,phoneCountry:i,nameChangeDate:o,photoChangeDate:r,chargePaidMessageStars:d}){return{isAutoArchived:Boolean(e),canReportSpam:Boolean(t),canAddContact:Boolean(s),canBlockContact:Boolean(n),registrationMonth:a,phoneCountry:i,nameChangeDate:o,photoChangeDate:r,chargedPaidMessageStars:rs(d)}}function no(e){if(!(e instanceof Me.User))return;const{id:t,firstName:s,lastName:n,fake:a,scam:i,support:o,closeFriend:r,storiesUnavailable:d,bot:c,botActiveUsers:u,botVerificationIcon:l,botInlinePlaceholder:f,botAttachMenu:g,botCanEdit:p,sendPaidMessagesStars:h,profileColor:m,botForumView:y,botForumCanManageTopics:_,botGuestchat:b}=e,S=e.storiesMaxId?.maxId,w=e.photo instanceof Me.UserProfilePhoto?Boolean(e.photo.hasVideo):void 0,I=e.photo&&ka(e.photo),v=(A=e).bot?"userTypeBot":A.deleted?"userTypeDeleted":"userTypeRegular",P=_i(e),C=P?.some(e=>e.isActive),M=e.emojiStatus?Ra(e.emojiStatus):void 0;var A;return{id:va(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:v,firstName:s,lastName:n,hasMainMiniApp:Boolean(e.botHasMainApp),canEditBot:p,..."userTypeBot"===v&&{canBeInvitedToGroup:!e.botNochats},usernames:P,hasUsername:C,phoneNumber:e.phone||"",noStatus:!e.status,...e.accessHash&&{accessHash:String(e.accessHash)},avatarPhotoId:I,emojiStatus:M,hasVideoAvatar:w,areStoriesHidden:Boolean(e.storiesHidden),maxStoryId:S,hasStories:Boolean(S)&&!d,...c&&f&&{botPlaceholder:f},...c&&g&&{isAttachBot:g},botActiveUsers:u,botVerificationIconId:l?.toString(),color:e.color&&Ca(e.color),profileColor:m&&Ca(m),paidMessagesStars:rs(h),isBotForum:y,canManageBotForumTopics:_,isGuestChatBot:b}}function ao(e){return!e||e instanceof Me.UserStatusEmpty?{type:"userStatusEmpty"}:e instanceof Me.UserStatusOnline?{type:"userStatusOnline",expires:e.expires}:e instanceof Me.UserStatusOffline?{type:"userStatusOffline",wasOnline:e.wasOnline}:e instanceof Me.UserStatusRecently?{type:"userStatusRecently",isReadDateRestrictedByMe:e.byMe}:e instanceof Me.UserStatusLastWeek?{type:"userStatusLastWeek",isReadDateRestrictedByMe:e.byMe}:{type:"userStatusLastMonth",isReadDateRestrictedByMe:e.byMe}}function io(e){const t={};return e.forEach(e=>{if("status"in e){const s=va(e.id,"user");t[s]=ao(e.status)}}),t}function oo(e){return Hs(e)}function ro(e){return{level:e.level,currentLevelStars:rs(e.currentLevelStars),stars:rs(e.stars),nextLevelStars:rs(e.nextLevelStars)}}function co(e){if(e instanceof Me.WallPaperNoFile)return;const{slug:t}=e,s=Vr(e.document);return s?{slug:t,document:s}:void 0}function uo(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,...Rs(e,["deviceModel","platform","systemVersion","appName","appVersion","dateCreated","dateActive","ip","country","region"])}}function lo(e){return{hash:String(e.hash),botId:va(e.botId,"user"),...Rs(e,["platform","browser","dateCreated","dateActive","ip","region","domain"])}}function fo(e,t){const{hidden:s,iso2:n,defaultName:a,name:i}=e,{countryCode:o,prefixes:r,patterns:d}=t||{};return{isHidden:s,iso2:n,defaultName:a,name:i,countryCode:o,prefixes:r,patterns:d}}function go(e){if(!(e instanceof Me.JsonNull))return e instanceof Me.JsonString||e instanceof Me.JsonBool||e instanceof Me.JsonNumber?e.value:e instanceof Me.JsonArray?e.value.map(go):e.value.reduce((e,t)=>(e[t.key]=go(t.value),e),{})}function po(e){const{suggestion:t,title:s,description:n,url:a}=e;return{suggestion:t,title:Si(s),description:Si(n),url:a}}function ho(e){return e.strings.reduce((e,t)=>(e[t.key]=function(e){return e instanceof Me.LangPackString?e.value:e instanceof Me.LangPackStringPluralized?Ts(Hs(e),["key"]):void 0}(t),e),{})}function mo(e){const t=[],s=e.reduce((e,s)=>(s instanceof Me.LangPackStringDeleted&&t.push(s.key),s instanceof Me.LangPackString&&(e[s.key]=s.value),s instanceof Me.LangPackStringPluralized&&(e[s.key]=Bs({zero:s.zeroValue,one:s.oneValue,two:s.twoValue,few:s.fewValue,many:s.manyValue,other:s.otherValue})),e),{});return{keysToRemove:t,strings:s}}function yo(e){const{name:t,nativeName:s,langCode:n,pluralCode:a,rtl:i,stringsCount:o,translatedCount:r,translationsUrl:d,beta:c,official:u}=e;return{name:t,nativeName:s,langCode:n,pluralCode:a,isRtl:i,isBeta:c,isOfficial:u,stringsCount:o,translatedCount:r,translationsUrl:d}}function _o(e){const{id:t,name:s,utcOffset:n}=e;return{id:t,name:s,utcOffset:n}}function bo(e){if(e)return e.map(({reason:e,text:t,platform:s})=>({reason:e,text:t,platform:s}))}function So(e){const{id:t,name:s,date:n,softwareEmojiId:a,lastUsageDate:i}=e;return{id:t,name:s,date:n,softwareEmojiId:a?.toString(),lastUsageDate:i}}function wo(e,t=!1){const s=e instanceof Me.User?e:void 0,n=e instanceof Me.Channel?e:void 0,a=s||n,i=Boolean("min"in e&&e.min),o="accessHash"in e?String(e.accessHash):void 0,r="photo"in e&&e.photo&&"hasVideo"in e.photo&&e.photo.hasVideo,d="photo"in e&&e.photo?ka(e.photo):void 0,c=_i(e),u=c?.some(e=>e.isActive),l="callActive"in e&&e.callActive,f="callNotEmpty"in e&&e.callNotEmpty,g="date"in e?e.date:void 0,p="participantsCount"in e?e.participantsCount:void 0,h="noforwards"in e&&e.noforwards,m="creator"in e&&e.creator,y=a?.scam,_=a?.fake,b=a?.storiesHidden,S=a?.storiesMaxId?.maxId,w=a?.botVerificationIcon?.toString(),I=a?.storiesUnavailable,v=a?.color?Ca(a.color):void 0,P=a?.profileColor?Ca(a.profileColor):void 0,C=a?.emojiStatus?Ra(a.emojiStatus):void 0,M=a?.sendPaidMessagesStars,A=a?.verified,R=n?.forum||s?.botForumView;return{isMin:i,isLinkedInDiscussion:n?.hasLink,areSignaturesShown:n?.signatures,areProfilesShown:n?.signatureProfiles,usernames:c,accessHash:o,hasVideoAvatar:r,avatarPhotoId:d,isVerified:A,isCallActive:l,isCallNotEmpty:f,creationDate:g,hasUsername:u,...void 0!==p&&{membersCount:p},isProtected:h,isSupport:t||void 0,isCreator:m,fakeType:y?"scam":_?"fake":void 0,color:v,profileColor:P,isJoinToSend:n?.joinToSend,isJoinRequest:n?.joinRequest,isForum:R,isBotForum:s?.botForumView,isMonoforum:n?.monoforum,linkedMonoforumId:void 0!==n?.linkedMonoforumId?va(n.linkedMonoforumId,"channel"):void 0,areChannelMessagesAllowed:n?.broadcastMessagesAllowed,areStoriesHidden:b,maxStoryId:S,hasStories:Boolean(S)&&!I,emojiStatus:C,boostLevel:n?.level,botVerificationIconId:w,hasGeo:n?.hasGeo,subscriptionUntil:n?.subscriptionUntilDate,paidMessagesStars:rs(M),level:n?.level,hasAutoTranslation:n?.autotranslation,withForumTabs:n?.forumTabs,...vo(e),...Po(e),...Co(e)}}function Io(e,t){const{peer:s,folderId:n,viewForumAsMessages:a}=e;return{id:Pa(s),folderId:n,type:Ao(t),title:ko(s,t),isForumAsMessages:a,...wo(t)}}function vo(e){return e instanceof Me.Chat||e instanceof Me.Channel?{adminRights:e.adminRights?Hs(e.adminRights):void 0,currentUserBannedRights:"bannedRights"in e&&e.bannedRights?Hs(e.bannedRights):void 0,defaultBannedRights:e.defaultBannedRights?Hs(e.defaultBannedRights):void 0}:{}}function Po(e){if(e instanceof Me.ChatForbidden)return{isForbidden:!0};if(e instanceof Me.ChannelForbidden)return{isRestricted:!0};const t={},s="min"in e&&e.min,n="restricted"in e;if(s||Object.assign(t,{isForbidden:void 0,isRestricted:void 0}),n&&!s){const s=bo(e.restrictionReason);Object.assign(t,{restrictionReasons:s})}return e instanceof Me.Chat&&Object.assign(t,{isNotJoined:e.left}),e instanceof Me.Channel&&Object.assign(t,{isNotJoined:e.left}),t}function Co(e){return!("migratedTo"in e)||!e.migratedTo||e.migratedTo instanceof Me.InputChannelEmpty?{}:{migratedTo:{chatId:Pa(e.migratedTo),...e.migratedTo instanceof Me.InputChannel&&{accessHash:String(e.migratedTo.accessHash)}}}}function Mo(e,t=!1){if(!(e instanceof Me.ChatEmpty||e instanceof Me.UserEmpty))return{id:va(e.id,e instanceof Me.User?"user":e instanceof Me.Chat||e instanceof Me.ChatForbidden?"chat":"channel"),type:Ao(e),title:e instanceof Me.User?To(e):e.title,...wo(e,t)}}function Ao(e){return e instanceof Me.User||e instanceof Me.UserEmpty?"chatTypePrivate":e instanceof Me.Chat||e instanceof Me.ChatForbidden||e instanceof Me.ChatEmpty?"chatTypeBasicGroup":e.megagroup?"chatTypeSuperGroup":"chatTypeChannel"}function Ro(e){return wa(e)?`user${e.userId.toString()}`:Ia(e)?`chat${e.chatId.toString()}`:`chat${e.channelId.toString()}`}function ko(e,t){return wa(e)?To(t):t.title}function To(e){return e.firstName?`${e.firstName}${e.lastName?` ${e.lastName}`:""}`:e.lastName||""}function Bo(e){return{userId:e instanceof Me.ChannelParticipantBanned||e instanceof Me.ChannelParticipantLeft?Pa(e.peer):va(e.userId,"user"),rank:"rank"in e?e.rank:void 0,inviterId:"inviterId"in e&&e.inviterId?va(e.inviterId,"user"):void 0,joinedDate:"date"in e?e.date:void 0,kickedByUserId:"kickedBy"in e&&e.kickedBy?va(e.kickedBy,"user"):void 0,promotedByUserId:"promotedBy"in e&&e.promotedBy?va(e.promotedBy,"user"):void 0,bannedRights:"bannedRights"in e?Hs(e.bannedRights):void 0,adminRights:"adminRights"in e?Hs(e.adminRights):void 0,isViaRequest:"viaRequest"in e?e.viaRequest:void 0,...(e instanceof Me.ChannelParticipantAdmin||e instanceof Me.ChatParticipantAdmin)&&{isAdmin:!0},...(e instanceof Me.ChannelParticipantCreator||e instanceof Me.ChatParticipantCreator)&&{isOwner:!0}}}function Do(e){return e instanceof Me.ChatParticipants||e instanceof Me.channels.ChannelParticipants?e.participants.map(Bo).filter(Boolean):void 0}function Uo(e){const t=e.action,s=Is(),n=e=>({timestamp:s,type:e});if(!(t instanceof Me.SendMessageCancelAction)){if(t instanceof Me.SendMessageTypingAction)return n("typing");if(t instanceof Me.SendMessageRecordVideoAction)return n("recordVideo");if(t instanceof Me.SendMessageUploadVideoAction)return n("uploadVideo");if(t instanceof Me.SendMessageRecordAudioAction)return n("recordAudio");if(t instanceof Me.SendMessageUploadAudioAction)return n("uploadAudio");if(t instanceof Me.SendMessageUploadPhotoAction)return n("uploadPhoto");if(t instanceof Me.SendMessageUploadDocumentAction)return n("uploadFile");if(t instanceof Me.SendMessageGeoLocationAction)return n("chooseLocation");if(t instanceof Me.SendMessageChooseContactAction)return n("chooseContact");if(t instanceof Me.SendMessageGamePlayAction)return n("playingGame");if(t instanceof Me.SendMessageRecordRoundAction)return n("recordRound");if(t instanceof Me.SendMessageUploadRoundAction)return n("uploadRound");if(t instanceof Me.SendMessageChooseStickerAction)return n("chooseSticker");if(!(t instanceof Me.SpeakingInGroupCallAction))return t instanceof Me.SendMessageEmojiInteractionSeen?{timestamp:s,type:"watchingAnimations",emoji:t.emoticon}:void Me.SendMessageEmojiInteraction}}function Eo(e){return e instanceof Me.DialogFilterChatlist?{...ks(e,["id","emoticon"]),excludedChatIds:[],includedChatIds:e.includePeers.map(Pa).filter(Boolean),pinnedChatIds:e.pinnedPeers.map(Pa).filter(Boolean),hasMyInvites:e.hasMyInvites,isChatList:!0,noTitleAnimations:e.titleNoanimate,color:e.color,title:Si(e.title)}:{...ks(e,["id","emoticon","contacts","nonContacts","groups","bots","excludeMuted","excludeRead","excludeArchived"]),channels:e.broadcasts,pinnedChatIds:e.pinnedPeers.map(Pa).filter(Boolean),includedChatIds:e.includePeers.map(Pa).filter(Boolean),excludedChatIds:e.excludePeers.map(Pa).filter(Boolean),color:e.color,title:Si(e.title),noTitleAnimations:e.titleNoanimate}}function xo({filter:e,description:t}){if(e instanceof Me.DialogFilter||e instanceof Me.DialogFilterChatlist)return{...Eo(e),description:t}}function Vo(e){return e.reduce((e,t)=>{const s=va(t.userId,"user");return t.commands&&(e=e.concat(t.commands.map(e=>({botId:s,...Hs(e)})))),e},[])}function Go(e){const{revoked:t,date:s,expireDate:n,link:a,permanent:i,startDate:o,usage:r,usageLimit:d,requested:c,requestNeeded:u,title:l,adminId:f}=e;return{isRevoked:t,date:s,expireDate:n,link:a,isPermanent:i,startDate:o,usage:r,usageLimit:d,isRequestNeeded:u,requested:c,title:l,adminId:va(f,"user")}}function Fo(e){return e instanceof Me.ChatReactionsAll?{type:"all",areCustomAllowed:e.allowCustom}:e instanceof Me.ChatReactionsSome?{type:"some",allowed:e.reactions.map(e=>Ti(e)).filter(Boolean)}:void 0}function No(e){return{id:Pa(e.peer),isPremium:e.premiumRequired}}function qo(e){if(!(e instanceof Me.ExportedChatlistInvite))return;const{title:t,url:s,peers:n}=e;return{title:t,url:s,peerIds:n.map(Pa).filter(Boolean)}}function Ho(e){return{id:e.userId.toString(),isRequiringPremiumToMessage:e.premiumRequiredForPm,isRequiringPremiumToInvite:e.premiumWouldAllowInvite}}function Lo(e){const{color:t,participants:s,participantsCount:n,photo:a,title:i,about:o,scam:r,fake:d,verified:c,megagroup:u,channel:l,broadcast:f,requestNeeded:g,subscriptionFormId:p,subscriptionPricing:h,canRefulfillSubscription:m,botVerification:y}=e;let _;return a instanceof Me.Photo&&(si(a),_=pi(a)),s?.forEach(di),{title:i,about:o,isFake:d,isScam:r,isVerified:c,isSuperGroup:u,isPublic:e.public,participantsCount:n,color:t,isChannel:l,isBroadcast:f,isRequestNeeded:g,photo:_,subscriptionFormId:p?.toString(),subscriptionPricing:h&&Oo(h),canRefulfillSubscription:m,participantIds:s?.map(e=>va(e.id,"user")).filter(Boolean),botVerification:y&&Ta(y)}}function Oo(e){return{period:e.period,amount:rs(e.amount)}}function jo(e){const{unreadCount:t,readInboxMaxId:s,readOutboxMaxId:n}=e,a=e instanceof Me.Dialog?e:void 0,i=e instanceof Me.MonoForumDialog?e:void 0,o=e instanceof Me.ForumTopic?e:void 0,{unreadReactionsCount:r}=a||i||o||{},{unreadMentionsCount:d,unreadPollVotesCount:c}=a||o||{},{unreadMark:u}=a||i||{};return Bs({unreadCount:t,lastReadInboxMessageId:s,lastReadOutboxMessageId:n,unreadReactionsCount:r,unreadPollVotesCount:c,unreadMentionsCount:d,hasUnreadMark:u})}function Wo(e,t){const s=t instanceof Me.SavedDialog,{topMessage:n}=t;return{isCommentsInfo:!1,chatId:e,threadId:s?Pa(t.peer):Ps,lastMessageId:n}}function zo(e){return e instanceof Me.PostInteractionCountersMessage?{type:"message",msgId:e.msgId,forwardsCount:e.forwards,viewsCount:e.views,reactionsCount:e.reactions}:e instanceof Me.PostInteractionCountersStory?{type:"story",storyId:e.storyId,reactionsCount:e.reactions,viewsCount:e.views,forwardsCount:e.forwards}:void 0}function Ko(e){return{viewsGraph:Qo(e.viewsGraph),reactionsGraph:Qo(e.reactionsByEmotionGraph)}}function $o(e){if(e)return e.forwards.map(t=>{if(!(t instanceof Me.PublicForwardStory))return er(t.message,e.chats)}).filter(Boolean)}function Jo(e){if(e&&"forwards"in e)return e.forwards.map(t=>{if(t instanceof Me.PublicForwardMessage)return er(t.message,e.chats);const{peer:s,story:n}=t;return{peerId:Pa(s),storyId:n.id,viewsCount:n.views?.viewsCount||0,reactionsCount:n.views?.reactionsCount||0}})}function Qo(e,t,s){if(e instanceof Me.StatsGraphError)return{graphType:"error",error:e.error};if(e instanceof Me.StatsGraphAsync)return{graphType:"async",token:e.token};const n=JSON.parse(e.json.data),[a,...i]=n.columns,o=n.y_scaled;return{graphType:"graph",type:t?"area":n.types.y0,zoomToken:e.zoomToken,labelFormatter:n.xTickFormatter,tooltipFormatter:n.xTooltipFormatter,labels:a.slice(1),hideCaption:!n.subchart.show,hasSecondYAxis:o,isStacked:n.stacked&&!o,isPercentage:t,secondaryYAxis:s,datasets:i.map(e=>{const t=e[0],a=e.slice(1);return{name:n.names[t],color:(i=n.colors[t],i.substring(i.indexOf("#"))),values:s?a.map(e=>e/1e9):a};var i}),...Xo(n.subchart.defaultZoom,a.slice(1))}}function Xo(e,t){const[s,n]=e;let a=0,i=t.length-1;return t.forEach((e,t)=>{!a&&e>=s&&(a=t),!i&&e>=n&&(i=t)}),{minimapRange:{begin:Math.max(0,a/(t.length-1)),end:Math.min(1,i/(t.length-1))},labelFromIndex:a,labelToIndex:i}}function Yo({current:e,previous:t}){const s=e-t;return{current:e,change:s,percentage:(s?Math.abs(s)/t*100:0).toFixed(2)}}function Zo(e){return{part:e.part,total:e.total,percentage:(e.part/e.total*100).toFixed(2)}}function er(e,t){const s=Pa(e.peerId),n=t.find(e=>va(e.id,"channel")===s),a=n&&"photo"in n&&n.photo instanceof Me.ChatPhoto?n.photo:void 0;return{messageId:e.id,views:e.views,title:n.title,chat:{id:s,type:"chatTypeChannel",title:n.title,usernames:_i(n),avatarPhotoId:a&&ka(a),hasVideoAvatar:Boolean(a?.hasVideo)}}}function tr(e){if(e)return e.map(e=>({id:e.id,title:e.title,amount:e.prices.reduce((e,t)=>e+rs(t.amount),0),prices:e.prices.map(({label:e,amount:t})=>({label:e,amount:rs(t)}))}))}function sr(e){const{photo:t}=e;if(t&&ci(t),e instanceof Me.payments.PaymentReceiptStars){const{botId:s,currency:n,date:a,description:i,title:o,totalAmount:r,transactionId:d,invoice:c}=e;return{type:"stars",currency:n,date:a,botId:va(s,"user"),description:i,title:o,totalAmount:-rs(r),transactionId:d,photo:Kr(t),invoice:nr(c)}}const{invoice:s,info:n,shipping:a,totalAmount:i,credentialsTitle:o,tipAmount:r,title:d,description:c,botId:u,currency:l,date:f,providerId:g}=e,{shippingAddress:p,phone:h,name:m}=n||{};let y,_;return a&&(y=a.prices.map(({label:e,amount:t})=>({label:e,amount:rs(t)})),_=a.title),{type:"regular",info:{shippingAddress:p,phone:h,name:m},totalAmount:rs(i),currency:l,date:f,credentialsTitle:o,shippingPrices:y,shippingMethod:_,tipAmount:rs(r)||0,title:d,description:c,botId:va(u,"user"),providerId:g.toString(),photo:t&&Kr(t),invoice:nr(s)}}function nr(e){const{test:t,currency:s,prices:n,recurring:a,termsUrl:i,maxTipAmount:o,suggestedTipAmounts:r,emailRequested:d,emailToProvider:c,nameRequested:u,phoneRequested:l,phoneToProvider:f,shippingAddressRequested:g,flexible:p,subscriptionPeriod:h}=e,m=n.map(({label:e,amount:t})=>({label:e,amount:rs(t)}));return{totalAmount:n.reduce((e,t)=>e+rs(t.amount),0),currency:s,isTest:t,isRecurring:a,termsUrl:i,prices:m,maxTipAmount:rs(o),suggestedTipAmounts:r?.map(e=>rs(e)),isEmailRequested:d,isEmailSentToProvider:c,isNameRequested:u,isPhoneRequested:l,isPhoneSentToProvider:f,isShippingAddressRequested:g,isFlexible:p,subscriptionPeriod:h}}function ar(e){const{statusText:t,statusEntities:s,videos:n,videoSections:a,periodOptions:i}=e;return{statusText:t,statusEntities:s.map(wi),videoSections:a,videos:n.map(Vr).filter(Boolean),options:i.map(ir)}}function ir(e){const{current:t,canPurchaseUpgrade:s,currency:n,amount:a,botUrl:i,months:o}=e;return{isCurrent:t,canPurchaseUpgrade:s,currency:n,amount:rs(a),botUrl:i,months:o}}function or(e){const{userId:t,multiplier:s,expires:n,giveaway:a,gift:i,stars:o}=e;return{userId:void 0!==t?va(t,"user"):void 0,multiplier:s,expires:n,isFromGiveaway:a,isGift:i,stars:rs(o)}}function rr(e){const{date:t,expires:s,slot:n,cooldownUntilDate:a,peer:i}=e;return{date:t,expires:s,slot:n,cooldownUntil:a,chatId:i&&Pa(i)}}function dr(e){const{date:t,fromId:s,days:n,giveawayMsgId:a,toId:i,usedDate:o,viaGiveaway:r}=e;return{date:t,days:n,toId:void 0!==i?va(i,"user"):void 0,fromId:s&&Pa(s),usedAt:o,isFromGiveaway:r,giveawayMessageId:a}}function cr(e){const{amount:t,currency:s,months:n,users:a}=e;return{amount:rs(t),currency:s,months:n,users:a}}function ur(e){const{extended:t,stars:s,amount:n,currency:a}=e;return{isExtended:t,stars:rs(s),amount:rs(n),currency:a}}function lr(e){return e instanceof Me.StarsAmount?{currency:"XTR",amount:rs(e.amount),nanos:e.nanos}:e instanceof Me.StarsTonAmount?{currency:"TON",amount:rs(e.amount)}:e}function fr(e){const{extended:t,default:s,stars:n,yearlyBoosts:a,amount:i,winners:o,currency:r}=e,d=o?.map(e=>function(e){const{default:t,users:s,perUserStars:n}=e;return{isDefault:t,users:s,perUserStars:rs(n)}}(e)).filter(Boolean);return{isExtended:t,isDefault:s,yearlyBoosts:a,stars:rs(n),amount:rs(i),currency:r,winners:d}}function gr(e){return e instanceof Me.StarsTransactionPeerAppStore?{type:"appStore"}:e instanceof Me.StarsTransactionPeerPlayMarket?{type:"playMarket"}:e instanceof Me.StarsTransactionPeerPremiumBot?{type:"premiumBot"}:e instanceof Me.StarsTransactionPeerFragment?{type:"fragment"}:e instanceof Me.StarsTransactionPeerAds?{type:"ads"}:e instanceof Me.StarsTransactionPeerAPI?{type:"api"}:e instanceof Me.StarsTransactionPeer?{type:"peer",id:Pa(e.peer)}:{type:"unsupported"}}function pr(e){const{date:t,id:s,peer:n,amount:a,description:i,photo:o,title:r,refund:d,extendedMedia:c,failed:u,msgId:l,pending:f,gift:g,reaction:p,subscriptionPeriod:h,stargift:m,giveawayPostId:y,starrefCommissionPermille:_,stargiftUpgrade:b,paidMessages:S,stargiftResale:w,postsSearch:I,stargiftPrepaidUpgrade:v,stargiftDropOriginalDetails:P,stargiftAuctionBid:C}=e;o&&ci(o);const M=c?.map(e=>Dr(e)).filter(Boolean),A=_?_/10:void 0,R=lr(a);if(R)return{id:s,date:t,peer:gr(n),amount:R,title:r,description:i,photo:o&&Kr(o),isRefund:d,hasFailed:u,isPending:f,messageId:l,isGift:g,extendedMedia:M,subscriptionPeriod:h,isReaction:p,starGift:m&&yr(m),giveawayPostId:y,starRefCommision:A,isGiftUpgrade:b,isGiftResale:w,paidMessages:S,isPostsSearch:I,isDropOriginalDetails:P,isPrepaidUpgrade:v,isStarGiftAuctionBid:C}}function hr(e){const{id:t,peer:s,pricing:n,untilDate:a,canRefulfill:i,canceled:o,chatInviteHash:r,missingBalance:d,botCanceled:c,photo:u,title:l,invoiceSlug:f}=e;return u&&ci(u),{id:t,peerId:Pa(s),until:a,pricing:Oo(n),isCancelled:o,canRefulfill:i,hasMissingBalance:d,chatInviteHash:r,hasBotCancelled:c,title:l,photo:u&&Kr(u),invoiceSlug:f}}function mr(e){const{amount:t,currency:s,stars:n,extended:a}=e;return{amount:rs(t),currency:s,stars:rs(n),isExtended:a}}function yr(e){if(e instanceof Me.StarGiftUnique){const{id:t,num:s,ownerId:n,ownerName:a,title:i,attributes:o,availabilityIssued:r,availabilityTotal:d,slug:c,ownerAddress:u,giftAddress:l,resellAmount:f,releasedBy:g,resaleTonOnly:p,requirePremium:h,valueCurrency:m,valueAmount:y,giftId:_,valueUsdAmount:b,burned:S,crafted:w,craftChancePermille:I}=e;return{type:"starGiftUnique",id:t.toString(),number:s,ownerId:n&&Pa(n),ownerName:a,ownerAddress:u,attributes:o.map(br).filter(Boolean),title:i,totalCount:d,issuedCount:r,slug:c,giftAddress:l,resellPrice:f&&f.map(e=>lr(e)).filter(Boolean),releasedByPeerId:g&&Pa(g),requirePremium:h,resaleTonOnly:p,valueCurrency:m,valueAmount:rs(y),valueUsdAmount:rs(b),regularGiftId:_.toString(),offerMinStars:e.offerMinStars,isBurned:S,isCrafted:w,craftChancePermille:I}}const{id:t,limited:s,stars:n,availabilityRemains:a,availabilityTotal:i,convertStars:o,firstSaleDate:r,lastSaleDate:d,soldOut:c,birthday:u,upgradeStars:l,resellMinStars:f,title:g,availabilityResale:p,releasedBy:h,requirePremium:m,limitedPerUser:y,perUserTotal:_,perUserRemains:b,lockedUntilDate:S,auction:w,auctionSlug:I,giftsPerRound:v,background:P}=e,C=Ei(e.sticker);return{type:"starGift",id:t.toString(),isLimited:s,sticker:C,stars:rs(n),availabilityRemains:a,availabilityTotal:i,starsToConvert:rs(o),firstSaleDate:r,lastSaleDate:d,isSoldOut:c,isBirthday:u,upgradeStars:void 0!==l?rs(l):void 0,title:g,resellMinStars:void 0!==f?rs(f):void 0,releasedByPeerId:h&&Pa(h),availabilityResale:void 0!==p?rs(p):void 0,requirePremium:m,limitedPerUser:y,perUserTotal:_,perUserRemains:b,lockedUntilDate:S,isAuction:w,auctionSlug:I,giftsPerRound:v,background:P?{centerColor:Sa(P.centerColor),edgeColor:Sa(P.edgeColor),textColor:Sa(P.textColor)}:void 0}}function _r(e){return e instanceof Me.StarGiftAttributeRarityUncommon?{type:"uncommon"}:e instanceof Me.StarGiftAttributeRarityRare?{type:"rare"}:e instanceof Me.StarGiftAttributeRarityEpic?{type:"epic"}:e instanceof Me.StarGiftAttributeRarityLegendary?{type:"legendary"}:{type:"regular",rarityPercent:e.permille/10}}function br(e){if(e instanceof Me.StarGiftAttributeModel){const t=Ei(e.document);if(!t)return;return{type:"model",name:e.name,sticker:t,rarity:_r(e.rarity)}}if(e instanceof Me.StarGiftAttributePattern){const t=Ei(e.document);if(!t)return;return{type:"pattern",name:e.name,sticker:t,rarity:_r(e.rarity)}}if(e instanceof Me.StarGiftAttributeBackdrop){const{name:t,rarity:s,centerColor:n,edgeColor:a,patternColor:i,textColor:o,backdropId:r}=e;return{type:"backdrop",backdropId:r,name:t,centerColor:Sa(n),edgeColor:Sa(a),patternColor:Sa(i),textColor:Sa(o),rarity:_r(s)}}if(e instanceof Me.StarGiftAttributeOriginalDetails){const{date:t,recipientId:s,message:n,senderId:a}=e;return{type:"originalDetails",date:t,recipientId:s&&Pa(s),message:n&&Si(n),senderId:a&&Pa(a)}}}function Sr(e,t){const{gift:s,date:n,convertStars:a,fromId:i,message:o,msgId:r,nameHidden:d,unsaved:c,refunded:u,upgradeStars:l,transferStars:f,canUpgrade:g,savedId:p,canExportAt:h,pinnedToTop:m,canResellAt:y,canTransferAt:_,prepaidUpgradeHash:b,dropOriginalDetailsStars:S,canCraftAt:w}=e,I=p&&t?{type:"chat",chatId:t,savedId:p.toString()}:r?{type:"user",messageId:r}:void 0;return{gift:yr(s),date:n,starsToConvert:rs(a),fromId:i&&Pa(i),message:o&&Si(o),messageId:r,isNameHidden:d,isUnsaved:c,isRefunded:u,canUpgrade:g,alreadyPaidUpgradeStars:rs(l),transferStars:rs(f),inputGift:I,savedId:p?.toString(),canExportAt:h,canResellAt:y,canTransferAt:_,isPinned:m,dropOriginalDetailsStars:void 0!==S?rs(S):void 0,prepaidUpgradeHash:b,canCraftAt:w}}function wr(e){const{disallowUnlimitedStargifts:t,disallowLimitedStargifts:s,disallowUniqueStargifts:n,disallowPremiumGifts:a}=e;return{shouldDisallowUnlimitedStarGifts:t,shouldDisallowLimitedStarGifts:s,shouldDisallowUniqueStarGifts:n,shouldDisallowPremiumGifts:a}}function Ir(e){return e.map(e=>{switch(e.type){case"model":return new Me.StarGiftAttributeIdModel({documentId:BigInt(e.documentId)});case"pattern":return new Me.StarGiftAttributeIdPattern({documentId:BigInt(e.documentId)});case"backdrop":return new Me.StarGiftAttributeIdBackdrop({backdropId:e.backdropId});default:return e}})}function vr(e){if(!e)return;const{collectionId:t,title:s,icon:n,giftsCount:a,hash:i}=e;return{collectionId:t,title:s,icon:n&&Ei(n),giftsCount:a,hash:i.toString()}}function Pr(e){return{date:e.date,upgradeStars:rs(e.upgradeStars)}}function Cr(e){return{pos:e.pos,amount:rs(e.amount)??0,date:e.date}}function Mr(e){if(e instanceof Me.StarGiftAuctionStateNotModified)return;if(e instanceof Me.StarGiftAuctionStateFinished){const{startDate:t,endDate:s,averagePrice:n,listedCount:a,fragmentListedCount:i,fragmentListedUrl:o}=e;return{type:"finished",startDate:t,endDate:s,averagePrice:rs(n),listedCount:a,fragmentListedCount:i,fragmentListedUrl:o}}const{version:t,startDate:s,endDate:n,minBidAmount:a,bidLevels:i,topBidders:o,nextRoundAt:r,lastGiftNum:d,giftsLeft:c,currentRound:u,totalRounds:l}=e;return{type:"active",version:t,startDate:s,endDate:n,minBidAmount:rs(a),bidLevels:i.map(Cr),topBidders:o.map(e=>va(e,"user")),nextRoundAt:r,lastGiftNum:d,giftsLeft:c,currentRound:u,totalRounds:l}}function Ar(e){const{returned:t,bidAmount:s,bidDate:n,minBidAmount:a,bidPeer:i,acquiredCount:o}=e;return{isReturned:t||void 0,bidAmount:void 0!==s?rs(s):void 0,bidDate:n,minBidAmount:void 0!==a?rs(a):void 0,bidPeerId:i&&Pa(i),acquiredCount:o}}function Rr(e){const t=yr(e.gift);if("starGift"!==t.type)return;const s=Mr(e.state);return s?{gift:t,state:s,userState:Ar(e.userState),timeout:"timeout"in e?e.timeout:void 0}:void 0}function kr(e){return{peerId:Pa(e.peer),date:e.date,bidAmount:rs(e.bidAmount),round:e.round,position:e.pos,message:e.message?Si(e.message):void 0,giftNumber:e.giftNum,isNameHidden:e.nameHidden||void 0}}function Tr(e){let t={};if(e.media){const s="peerId"in e?e:void 0;t={...Dr(e.media,s)}}const s=e.media instanceof Me.MessageMediaUnsupported;if(e.message&&!s&&!t.sticker&&!t.todo&&!t.contact&&!t.video?.isRound){const s=Xa(Br(e.message,e.entities));t={...t,text:s}}return t}function Br(e,t){return{text:e,...t&&{entities:t.map(wi)}}}function Dr(e,t){ei(e,t);const s="ttlSeconds"in e?e.ttlSeconds:void 0,n=function(e){return e instanceof Me.MessageMediaDocument&&Boolean(!e.document&&e.voice)}(e);if(n)return{action:{mediaType:"action",type:"expired",isVoice:!0}};const a=function(e){return e instanceof Me.MessageMediaDocument&&Boolean(!e.document&&e.round)}(e);if(a)return{action:{mediaType:"action",type:"expired",isRoundVideo:!0}};const i=function(e){if(!(e instanceof Me.MessageMediaDocument&&e.document&&e.document instanceof Me.Document))return;const t=e.document.attributes.find(e=>e instanceof Me.DocumentAttributeAudio);if(!t||!t.voice)return;const{duration:s,waveform:n}=t;return{mediaType:"voice",id:String(e.document.id),size:rs(e.document.size),duration:s,waveform:n?Array.from(n):void 0}}(e);if(i)return{voice:i,ttlSeconds:s};if("round"in e&&e.round){const t=xr(e);if(t)return{video:t,ttlSeconds:s}}if(void 0!==s)return;if(e instanceof Me.MessageMediaInvoice&&e.extendedMedia instanceof Me.MessageExtendedMedia)return Dr(e.extendedMedia.media,t);const o=function(e){if(e instanceof Me.MessageMediaDocument&&e.document&&e.document instanceof Me.Document)return Ei(e.document,e.nopremium)}(e);if(o)return{sticker:o};const r=function(e){if(e instanceof Me.MessageMediaPhoto&&e.photo&&e.photo instanceof Me.Photo)return pi(e.photo,e.spoiler)}(e);if(r)return{photo:r};const d=xr(e);if(d)return{video:d};const c=function(e){if(!(e instanceof Me.MessageMediaDocument&&e.document&&e.document instanceof Me.Document))return;const t=e.document.attributes.find(e=>e instanceof Me.DocumentAttributeAudio);if(!t||t.voice)return;const s=e.document.thumbs&&e.document.thumbs.filter(e=>e instanceof Me.PhotoSize).map(e=>yi(e));return{mediaType:"audio",id:String(e.document.id),fileName:Wr(e.document,"audio"),thumbnailSizes:s,size:rs(e.document.size),...Rs(e.document,["mimeType"]),...Rs(t,["duration","performer","title"])}}(e);if(c)return{audio:c};const u=function(e){if(e instanceof Me.MessageMediaDocument&&e.document)return Vr(e.document)}(e);if(u)return{document:u};const l=function(e){if(!(e instanceof Me.MessageMediaContact))return;const{firstName:t,lastName:s,phoneNumber:n,userId:a}=e;return{mediaType:"contact",firstName:t,lastName:s,phoneNumber:n,userId:va(a,"user")}}(e);if(l)return{contact:l};const f=function(e){if(e instanceof Me.MessageMediaPoll)return e.poll.id.toString()}(e);if(f)return{pollId:f};const g=function(e){if(e instanceof Me.MessageMediaToDo)return function(e,t){const{title:s,list:n}=e,a=n.map(Hr),i=t?.map(e=>({itemId:e.id,completedBy:Pa(e.completedBy),completedAt:e.date}));return{mediaType:"todo",todo:{title:Si(s),items:a,othersCanAppend:e.othersCanAppend,othersCanComplete:e.othersCanComplete},completions:i}}(e.todo,e.completions)}(e);if(g)return{todo:g};const p=function(e){if(!(e instanceof Me.MessageMediaWebPage)||e.webpage instanceof Me.WebPageNotModified)return;const{webpage:t,forceLargeMedia:s,forceSmallMedia:n,safe:a}=e;return{id:t.id.toString(),isSafe:a,mediaSize:n?"small":s?"large":void 0}}(e);if(p)return{webPage:p};const h=function(e){if(e instanceof Me.MessageMediaInvoice)return function(e){const{description:t,title:s,photo:n,test:a,totalAmount:i,currency:o,receiptMsgId:r,extendedMedia:d}=e,c=d instanceof Me.MessageExtendedMediaPreview?zr(d):void 0;return{mediaType:"invoice",title:s,description:t,photo:Kr(n),receiptMessageId:r,amount:rs(i),currency:o,isTest:a,extendedMedia:c}}(e)}(e);if(h)return{invoice:h};const m=function(e){return e instanceof Me.MessageMediaGeo?function(e){const t=Fr(e.geo);return t&&{mediaType:"geo",geo:t}}(e):e instanceof Me.MessageMediaVenue?function(e){const{geo:t,title:s,provider:n,address:a,venueId:i,venueType:o}=e,r=Fr(t);return r&&{mediaType:"venue",geo:r,title:s,provider:n,address:a,venueId:i,venueType:o}}(e):e instanceof Me.MessageMediaGeoLive?function(e){const{geo:t,period:s,heading:n}=e,a=Fr(t);return a&&{mediaType:"geoLive",geo:a,period:s,heading:n}}(e):void 0}(e);if(m)return{location:m};const y=function(e){if(e instanceof Me.MessageMediaGame)return function(e){const{id:t,accessHash:s,shortName:n,title:a,description:i,photo:o,document:r}=e.game,d=o instanceof Me.Photo?pi(o):void 0,c=r instanceof Me.Document?Vr(r):void 0;return{mediaType:"game",id:t.toString(),accessHash:s.toString(),shortName:n,title:a,description:i,photo:d,document:c}}(e)}(e);if(y)return{game:y};const _=function(e){if(e instanceof Me.MessageMediaDice)return function(e){const{value:t,emoticon:s}=e;return{mediaType:"dice",value:t,emoticon:s}}(e)}(e);if(_)return{dice:_};const b=function(e){if(!(e instanceof Me.MessageMediaStory))return;const t=Pa(e.peer);return{mediaType:"storyData",id:e.id,peerId:t,...e.viaMention&&{isMention:!0}}}(e);if(b)return{storyData:b};const S=function(e){if(e instanceof Me.MessageMediaGiveaway)return function(e){const{channels:t,months:s,stars:n,quantity:a,untilDate:i,countriesIso2:o,onlyNewSubscribers:r,prizeDescription:d}=e,c=t.map(e=>va(e,"channel"));return{mediaType:"giveaway",channelIds:c,months:s,stars:rs(n),quantity:a,untilDate:i,countries:o,isOnlyForNewSubscribers:r,prizeDescription:d}}(e)}(e);if(S)return{giveaway:S};const w=function(e){if(e instanceof Me.MessageMediaGiveawayResults)return function(e){const{months:t,untilDate:s,onlyNewSubscribers:n,launchMsgId:a,unclaimedCount:i,winners:o,winnersCount:r,additionalPeersCount:d,prizeDescription:c,refunded:u,channelId:l}=e,f=o.map(e=>va(e,"user"));return{mediaType:"giveawayResults",months:t,untilDate:s,isOnlyForNewSubscribers:n,launchMessageId:a,channelId:va(l,"channel"),unclaimedCount:i,additionalPeersCount:d,isRefunded:u,prizeDescription:c,winnerIds:f,winnersCount:r}}(e)}(e);if(w)return{giveawayResults:w};const I=function(e){if(!(e instanceof Me.MessageMediaPaidMedia))return;const{starsAmount:t,extendedMedia:s}=e,n=s[0]instanceof Me.MessageExtendedMedia;return n?{mediaType:"paidMedia",starsAmount:rs(t),isBought:n,extendedMedia:$r(s)}:{mediaType:"paidMedia",starsAmount:rs(t),extendedMedia:s.filter(e=>e instanceof Me.MessageExtendedMediaPreview).map(e=>zr(e))}}(e);return I?{paidMedia:I}:void 0}function Ur(e,t,s){if(e instanceof Me.DocumentEmpty)return;const n=t&&function(e){const t=e.filter(e=>e instanceof Me.Document&&e.mimeType.startsWith("video")).map(e=>Ur(e,void 0,void 0)).filter(Boolean);if(t.length)return t}(t),{isSpoiler:a,timestamp:i}=s||{},{id:o,mimeType:r,thumbs:d,size:c,videoThumbs:u,attributes:l}=e;if(r===f&&!self.isWebmSupported)return;const g=l.find(e=>e instanceof Me.DocumentAttributeVideo);if(!g)return;const p=l.find(e=>e instanceof Me.DocumentAttributeAnimated),h=u?.some(e=>e instanceof Me.VideoSize&&"v"===e.type),m=d&&hi(d),{duration:y,w:b,h:S,supportsStreaming:w=!1,roundMessage:I=!1,nosound:v}=g,P=I?function(e){const t=Math.min(Math.round(e),30);return Array.from({length:t},()=>Math.floor(256*Math.random()))}(y):void 0,C=t&&function(e){const t=e.find(e=>e instanceof Me.Document&&e.mimeType===_),s=e.find(e=>e instanceof Me.Document&&"application/x-tgstoryboardmap"===e.mimeType),n=t&&Vr(t),a=s&&Vr(s),i=s?.attributes.find(e=>e instanceof Me.DocumentAttributeImageSize),o=i&&{width:i.w,height:i.h};if(n&&a&&o)return{storyboardFile:n,storyboardMapFile:a,frameSize:o}}(t);return{mediaType:"video",id:String(o),mimeType:r,duration:y,fileName:Wr(e,"video"),width:b,height:S,supportsStreaming:w,isRound:I,isGif:Boolean(p),thumbnail:fi(d),size:rs(c),isSpoiler:a,timestamp:i,hasVideoPreview:h,previewPhotoSizes:m,waveform:P,noSound:v,altVideos:n,storyboardInfo:C}}function Er(e){if(e instanceof Me.DocumentEmpty)return;const{id:t,mimeType:s,size:n,attributes:a}=e,i=a.find(e=>e instanceof Me.DocumentAttributeAudio);if(!i)return;const{duration:o,title:r,performer:d}=i;return{mediaType:"audio",id:String(t),mimeType:s,duration:o,fileName:Wr(e,"audio"),title:r,performer:d,size:rs(n)}}function xr(e){if(e instanceof Me.MessageMediaDocument&&e.document instanceof Me.Document&&e.document.mimeType.startsWith("video"))return Ur(e.document,e.altDocuments,{isSpoiler:e.spoiler,timestamp:e.videoTimestamp})}function Vr(e){if(!(e instanceof Me.Document))return;const{id:t,size:s,mimeType:n,date:a,thumbs:i,attributes:o}=e,r=i&&i.find(e=>e instanceof Me.PhotoSize);let d=i&&fi(i);if(!d&&i&&r){const e=i.find(e=>e instanceof Me.PhotoPathSize);e&&(d=gi(e,r))}const c=i&&hi(i);let u,l;if(r)if(l={width:r.w,height:r.h},h.has(n)){u="photo";const e=o.find(e=>e instanceof Me.DocumentAttributeImageSize);if(e){const{w:t,h:s}=e;l={width:t,height:s,fromDocumentAttribute:!0}}}else if(m.has(n)){u="video";const e=o.find(e=>e instanceof Me.DocumentAttributeVideo);if(e){const{w:t,h:s}=e;l={width:t,height:s}}}return{mediaType:"document",id:String(t),size:rs(s),mimeType:n,timestamp:a,fileName:Wr(e),thumbnail:d,innerMediaType:u,mediaSize:l,previewPhotoSizes:c}}function Gr(e){if(e instanceof Me.MessageMediaPoll)return function(e){const{poll:t,results:s,attachedMedia:n}=e;return{mediaType:"poll",summary:qr(t),results:Lr(s),attachedMedia:n?Dr(n):void 0}}(e)}function Fr(e){if(e instanceof Me.GeoPointEmpty)return;const{long:t,lat:s,accuracyRadius:n,accessHash:a}=e;return{long:t,lat:s,accessHash:a.toString(),accuracyRadius:n}}function Nr(e){if(!(e instanceof Me.PollAnswer))return;const{text:t,option:s,media:n,addedBy:a,date:i}=e;return{text:Si(t),option:Ga(s),media:n?Dr(n):void 0,addedByPeerId:a?Pa(a):void 0,date:i}}function qr(e){const{id:t,closed:s,publicVoters:n,multipleChoice:a,quiz:i,closePeriod:o,closeDate:r,answers:d,question:c,creator:u,hideResultsUntilClose:l,revotingDisabled:f,shuffleAnswers:g,openAnswers:p,hash:h}=e,m=d.map(Nr).filter(Boolean);return{id:t.toString(),isClosed:s,isPublic:n,isMultipleChoice:a,isQuiz:i,closePeriod:o,closeDate:r,isCreator:u,shouldHideResultsUntilClose:l,isRevoteDisabled:f,shouldShuffleAnswers:g,question:Si(c),answers:m,hash:h.toString(),canAddAnswers:p}}function Hr(e){return{id:e.id,title:Si(e.title)}}function Lr(e){const{results:t,totalVoters:s,recentVoters:n,solution:a,solutionEntities:i,min:o,solutionMedia:r}=e,d=t?.map(({option:e,chosen:t,correct:s,voters:n,recentVoters:a})=>({isChosen:t,isCorrect:s,option:Ga(e),votersCount:n??0,recentVoterIds:a?.map(e=>Pa(e))}));return r&&ei(r),{isMin:o,totalVoters:s,recentVoterIds:n?.map(e=>Pa(e)),resultByOption:d&&Ms(d,"option"),solution:a,solutionEntities:i?.map(wi),solutionMedia:r?Dr(r):void 0}}function Or(e){if(!(e instanceof Me.MessageMediaWebPage))return;const{webpage:t}=e;return jr(t)}function jr(e){if(Za(e),e instanceof Me.WebPageEmpty)return{mediaType:"webpage",webpageType:"empty",id:e.id.toString(),url:e.url};if(e instanceof Me.WebPagePending)return{mediaType:"webpage",webpageType:"pending",id:e.id.toString(),url:e.url};if(e instanceof Me.WebPage){const{id:t,photo:s,document:n,attributes:a}=e;let i,o,r,d,c,u;n instanceof Me.Document&&n.mimeType.startsWith("video/")&&(i=Ur(n)),n instanceof Me.Document&&n.mimeType.startsWith("audio/")&&(o=Er(n));const l=a?.find(e=>e instanceof Me.WebPageAttributeStory),f=a?.find(e=>e instanceof Me.WebPageAttributeUniqueStarGift),g=a?.find(e=>e instanceof Me.WebPageAttributeStarGiftAuction);if(l){const e=Pa(l.peer);r={id:l.id,peerId:e},l.story instanceof Me.StoryItem&&ti(l.story,e)}if(f){const e=yr(f.gift);d="starGiftUnique"===e.type?e:void 0}if(g){const e=yr(g.gift);"starGift"===e.type&&(c={gift:e,endDate:g.endDate})}const p=a?.find(e=>e instanceof Me.WebPageAttributeStickerSet);p&&(u={documents:Fi(p.stickers),isEmoji:p.emojis,isWithTextColor:p.textColor});const h=a?.find(e=>e instanceof Me.WebPageAttributeAiComposeTone);return{mediaType:"webpage",webpageType:"full",id:t.toString(),...Rs(e,["url","displayUrl","type","siteName","title","description","duration","hasLargeMedia"]),photo:s instanceof Me.Photo?pi(s):void 0,document:i||o||!n?void 0:Vr(n),video:i,audio:o,story:r,gift:d,auction:c,stickers:u,aiComposeToneEmojiId:h?.emojiId.toString()}}}function Wr(e,t="file"){const{mimeType:s,attributes:n}=e,a=n.find(e=>e instanceof Me.DocumentAttributeFilename);if(a)return a.fileName;const i=s.split("/")[1];return`${t}${String(e.id)}.${i}`}function zr(e){const{w:t,h:s,thumb:n,videoDuration:a}=e;return{mediaType:"extendedMediaPreview",width:t,height:s,duration:a,thumbnail:n?fi([n]):void 0}}function Kr(e){if(!e)return;const{url:t,size:s,mimeType:n}=e,a=e instanceof Me.WebDocument?e.accessHash.toString():void 0,i=e.attributes.find(e=>e instanceof Me.DocumentAttributeImageSize);return{mediaType:"webDocument",url:t,accessHash:a,size:s,mimeType:n,dimensions:i&&{width:i.w,height:i.h}}}function $r(e){const t=e.filter(e=>e instanceof Me.MessageExtendedMedia).map(e=>Dr(e.media)).filter(Boolean);if(t.length)return t}String.fromCharCode(8205);const Jr=/(?:\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\ud83d\udc30\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udeef\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83d\udc30\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udeef\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\ud83d\udc30\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udeef\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\ud83d\udc30\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udeef\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\ud83d\udc30\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udeef\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\ud83d\udc30\u200d\ud83d\udc69\ud83c[\udffc-\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\udffb\u200d\ud83e\udeef\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\ud83d\udc30\u200d\ud83d\udc69\ud83c[\udffb\udffd-\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\udffc\u200d\ud83e\udeef\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\ud83d\udc30\u200d\ud83d\udc69\ud83c[\udffb\udffc\udffe\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\udffd\u200d\ud83e\udeef\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\ud83d\udc30\u200d\ud83d\udc69\ud83c[\udffb-\udffd\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\udffe\u200d\ud83e\udeef\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\ud83d\udc30\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\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]|\ud83d\udc69\ud83c\udfff\u200d\ud83e\udeef\u200d\ud83d\udc69\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83d\udc30\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udeef\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83d\udc30\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udeef\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83d\udc30\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udeef\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83d\udc30\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udeef\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83d\udc30\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udeef\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83e\udef1\ud83c\udffb\u200d\ud83e\udef2\ud83c[\udffc-\udfff]|\ud83e\udef1\ud83c\udffc\u200d\ud83e\udef2\ud83c[\udffb\udffd-\udfff]|\ud83e\udef1\ud83c\udffd\u200d\ud83e\udef2\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\udef1\ud83c\udffe\u200d\ud83e\udef2\ud83c[\udffb-\udffd\udfff]|\ud83e\udef1\ud83c\udfff\u200d\ud83e\udef2\ud83c[\udffb-\udffe]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6f\ud83c\udffb\u200d\u2640\ufe0f|\ud83d\udc6f\ud83c\udffb\u200d\u2642\ufe0f|\ud83d\udc6f\ud83c\udffc\u200d\u2640\ufe0f|\ud83d\udc6f\ud83c\udffc\u200d\u2642\ufe0f|\ud83d\udc6f\ud83c\udffd\u200d\u2640\ufe0f|\ud83d\udc6f\ud83c\udffd\u200d\u2642\ufe0f|\ud83d\udc6f\ud83c\udffe\u200d\u2640\ufe0f|\ud83d\udc6f\ud83c\udffe\u200d\u2642\ufe0f|\ud83d\udc6f\ud83c\udfff\u200d\u2640\ufe0f|\ud83d\udc6f\ud83c\udfff\u200d\u2642\ufe0f|\ud83e\udd3c\ud83c\udffb\u200d\u2640\ufe0f|\ud83e\udd3c\ud83c\udffb\u200d\u2642\ufe0f|\ud83e\udd3c\ud83c\udffc\u200d\u2640\ufe0f|\ud83e\udd3c\ud83c\udffc\u200d\u2642\ufe0f|\ud83e\udd3c\ud83c\udffd\u200d\u2640\ufe0f|\ud83e\udd3c\ud83c\udffd\u200d\u2642\ufe0f|\ud83e\udd3c\ud83c\udffe\u200d\u2640\ufe0f|\ud83e\udd3c\ud83c\udffe\u200d\u2642\ufe0f|\ud83e\udd3c\ud83c\udfff\u200d\u2640\ufe0f|\ud83e\udd3c\ud83c\udfff\u200d\u2642\ufe0f|\ud83d\udc6f\u200d\u2640\ufe0f|\ud83d\udc6f\u200d\u2642\ufe0f|\ud83e\udd3c\u200d\u2640\ufe0f|\ud83e\udd3c\u200d\u2642\ufe0f|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc6f\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83e\udd1d\ud83c[\udffb-\udfff]|\ud83e\udd3c\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc6f\udc8f\udc91]|\ud83e[\udd1d\udd3c])|(?:\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\ude70])(?:\u200d\u27a1\ufe0f)?|(?:\ud83c[\udfcb\udfcc]|\ud83d[\udd74\udd75]|\u26f9)((?:\ud83c[\udffb-\udfff]|\ufe0f)\u200d[\u2640\u2642]\ufe0f(?:\u200d\u27a1\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(?:\u200d\u27a1\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]|\ud83e\uddd1\u200d\ud83e\uddd1\u200d\ud83e\uddd2\u200d\ud83e\uddd2|\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]|\ud83e\uddd1\u200d\ud83e\uddd1\u200d\ud83e\uddd2|\ud83e\uddd1\u200d\ud83e\uddd2\u200d\ud83e\uddd2|\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f|\ud83c\udff3\ufe0f\u200d\ud83c\udf08|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u26d3\ufe0f\u200d\ud83d\udca5|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\ud83c\udf44\u200d\ud83d\udfeb|\ud83c\udf4b\u200d\ud83d\udfe9|\ud83c\udff4\u200d\u2620\ufe0f|\ud83d\udc15\u200d\ud83e\uddba|\ud83d\udc26\u200d\ud83d\udd25|\ud83d\udc3b\u200d\u2744\ufe0f|\ud83d\udc41\u200d\ud83d\udde8|\ud83d\udc68\u200d\ud83d[\udc66\udc67]|\ud83d\udc69\u200d\ud83d[\udc66\udc67]|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\ud83d\ude42\u200d\u2194\ufe0f|\ud83d\ude42\u200d\u2195\ufe0f|\ud83e\uddd1\u200d\ud83e\uddd2|\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]|\ud83e\udef0|[\u261d\u26f7\u26f9\u270c\u270d])(?:\ufe0f|(?!\ufe0e))|(?:\ud83c\udfc3|\ud83d\udeb6|\ud83e\uddce)(?:\ud83c[\udffb-\udfff])?(?:\u200d\u27a1\ufe0f)?|(?:\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\udeb5\udec0\udecc]|\ud83e[\udd0c\udd0f\udd18-\udd1c\udd1e\udd1f\udd26\udd30-\udd39\udd3d\udd3e\udd77\uddb5\uddb6\uddb8\uddb9\uddbb\uddcd\uddcf\uddd1-\udddd\udec3-\udec5\udef1-\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-\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\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-\uded8\udedc-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude7c\ude80-\ude8a\ude8e-\udec2\udec6\udec8\udecd-\udedc\udedf-\udeea\udeef]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g,Qr=[[/\u{1f3f3}\u200d\u{1f308}/gu,"🏳️‍🌈"],[/\u{1f3f3}\u200d\u26a7\ufe0f?/gu,"🏳️‍⚧️"],[/\u26d3\u200d\u{1f4a5}/gu,"⛓️‍💥"],[/\u200d([\u2640\u2642])(?!\ufe0f)/gu,"$1"]];function Xr(e){const t=e.matchAll(Jr);let s=0,n=0;for(const e of t){if(e.index!==n)return!1;s++,n=e.index+e[0].length}return n===e.length&&s}function Yr(e,t){if(e.text)return!t&&1===Object.keys(e).length&&!e.text.entities?.some(e=>e.type!==vs.CustomEmoji)&&function(e){const t=function(e){if(!e.match(Jr))return e;for(const[t,s]of Qr)e=e.replace(t,s);return e}(e).split("\n"),s=t.join("");if(s.length>800)return!1;const n=Xr(s);if(!n||n>100)return!1;let a=t.length;for(const e of t){const t=Xr(e);if(!1===t)return!1;t>a&&(a=t)}return a}(e.text.text)||void 0}function Zr(e,t){let s=0;const n=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),d=((e[t-1]??i)+(e[t]??i)+(e[t+1]??o))/3;n[r]=d,s<d&&(s=d)}return{data:n,peak:s}}const ed={mediaType:"action",type:"unsupported"};function td(e){return e instanceof Me.PhoneCallDiscardReasonBusy?"busy":e instanceof Me.PhoneCallDiscardReasonHangup?"hangup":e instanceof Me.PhoneCallDiscardReasonMissed?"missed":"disconnect"}const sd="temp";let nd,ad=0;function id(e=0){return e+ ++ad/1e6}function od(e){const t=xa(e);if(t&&(e instanceof Me.Message||e instanceof Me.MessageService))return rd(t,e)}function rd(e,t){const s="user"===Zs(e),n=!t.fromId||s&&!t.guestchatViaFrom?void 0:Pa(t.fromId),a=!n&&e===nd,i=t.fwdFrom&&cd(t.fwdFrom,a),o=Boolean(!i||i.fromId===nd||i.isSavedOutgoing),r=a?o:Boolean(t.out&&!t.post),d=Tr(t),c=t.action&&function(e){if(e instanceof Me.MessageActionChatCreate){const{title:t,users:s}=e;return{mediaType:"action",type:"chatCreate",title:t,userIds:s.map(e=>va(e,"user"))}}if(e instanceof Me.MessageActionChatEditTitle){const{title:t}=e;return{mediaType:"action",type:"chatEditTitle",title:t}}if(e instanceof Me.MessageActionChatEditPhoto){const{photo:t}=e;return{mediaType:"action",type:"chatEditPhoto",photo:t instanceof Me.Photo?pi(t):void 0}}if(e instanceof Me.MessageActionChatDeletePhoto)return{mediaType:"action",type:"chatDeletePhoto"};if(e instanceof Me.MessageActionChatAddUser){const{users:t}=e;return{mediaType:"action",type:"chatAddUser",userIds:t.map(e=>va(e,"user"))}}if(e instanceof Me.MessageActionChatDeleteUser){const{userId:t}=e;return{mediaType:"action",type:"chatDeleteUser",userId:va(t,"user")}}if(e instanceof Me.MessageActionChatJoinedByLink){const{inviterId:t}=e;return{mediaType:"action",type:"chatJoinedByLink",inviterId:va(t,"user")}}if(e instanceof Me.MessageActionChannelCreate){const{title:t}=e;return{mediaType:"action",type:"channelCreate",title:t}}if(e instanceof Me.MessageActionChatMigrateTo){const{channelId:t}=e;return{mediaType:"action",type:"chatMigrateTo",channelId:va(t,"channel")}}if(e instanceof Me.MessageActionChannelMigrateFrom){const{title:t,chatId:s}=e;return{mediaType:"action",type:"channelMigrateFrom",title:t,chatId:va(s,"chat")}}if(e instanceof Me.MessageActionPinMessage)return{mediaType:"action",type:"pinMessage"};if(e instanceof Me.MessageActionHistoryClear)return{mediaType:"action",type:"historyClear"};if(e instanceof Me.MessageActionGameScore){const{gameId:t,score:s}=e;return{mediaType:"action",type:"gameScore",gameId:t.toString(),score:s}}if(e instanceof Me.MessageActionPaymentSent){const{recurringInit:t,recurringUsed:s,currency:n,totalAmount:a,invoiceSlug:i,subscriptionUntilDate:o}=e;return{mediaType:"action",type:"paymentSent",isRecurringInit:t,isRecurringUsed:s,currency:n,totalAmount:rs(a),invoiceSlug:i,subscriptionUntilDate:o}}if(e instanceof Me.MessageActionPhoneCall){const{video:t,callId:s,reason:n,duration:a}=e;return{mediaType:"action",type:"phoneCall",isVideo:t,callId:s.toString(),reason:n&&td(n),duration:a}}if(e instanceof Me.MessageActionScreenshotTaken)return{mediaType:"action",type:"screenshotTaken"};if(e instanceof Me.MessageActionCustomAction){const{message:t}=e;return{mediaType:"action",type:"customAction",message:t}}if(e instanceof Me.MessageActionBotAllowed){const{attachMenu:t,fromRequest:s,domain:n,app:a}=e;return{mediaType:"action",type:"botAllowed",isAttachMenu:t,isFromRequest:s,domain:n,app:a&&Qi(a)}}if(e instanceof Me.MessageActionBoostApply){const{boosts:t}=e;return{mediaType:"action",type:"boostApply",boosts:t}}if(e instanceof Me.MessageActionContactSignUp)return{mediaType:"action",type:"contactSignUp"};if(e instanceof Me.MessageActionGroupCall){const{call:t,duration:s}=e;return t instanceof Me.InputGroupCall?{mediaType:"action",type:"groupCall",call:{id:t.id.toString(),accessHash:t.accessHash.toString()},duration:s}:ed}if(e instanceof Me.MessageActionInviteToGroupCall){const{call:t,users:s}=e;return t instanceof Me.InputGroupCall?{mediaType:"action",type:"inviteToGroupCall",call:{id:t.id.toString(),accessHash:t.accessHash.toString()},userIds:s.map(e=>va(e,"user"))}:ed}if(e instanceof Me.MessageActionGroupCallScheduled){const{call:t,scheduleDate:s}=e;return t instanceof Me.InputGroupCall?{mediaType:"action",type:"groupCallScheduled",call:{id:t.id.toString(),accessHash:t.accessHash.toString()},scheduleDate:s}:ed}if(e instanceof Me.MessageActionChatJoinedByRequest)return{mediaType:"action",type:"chatJoinedByRequest"};if(e instanceof Me.MessageActionWebViewDataSent){const{text:t}=e;return{mediaType:"action",type:"webViewDataSent",text:t}}if(e instanceof Me.MessageActionGiftPremium){const{currency:t,amount:s,days:n,cryptoCurrency:a,cryptoAmount:i,message:o}=e;return{mediaType:"action",type:"giftPremium",currency:t,amount:rs(s),days:n,cryptoCurrency:a,cryptoAmount:rs(i),message:o&&Si(o)}}if(e instanceof Me.MessageActionTopicCreate){const{title:t,iconColor:s,iconEmojiId:n}=e;return{mediaType:"action",type:"topicCreate",title:t,iconColor:s,iconEmojiId:n?.toString()}}if(e instanceof Me.MessageActionTopicEdit){const{title:t,iconEmojiId:s,closed:n,hidden:a}=e;return{mediaType:"action",type:"topicEdit",title:t,iconEmojiId:s?.toString(),isClosed:n,isHidden:a}}if(e instanceof Me.MessageActionSuggestProfilePhoto){const{photo:t}=e;return t instanceof Me.Photo?{mediaType:"action",type:"suggestProfilePhoto",photo:pi(t)}:ed}if(e instanceof Me.MessageActionGiftCode){const{viaGiveaway:t,unclaimed:s,boostPeer:n,days:a,slug:i,currency:o,amount:r,cryptoCurrency:d,cryptoAmount:c,message:u}=e;return{mediaType:"action",type:"giftCode",isViaGiveaway:t,isUnclaimed:s,boostPeerId:n&&Pa(n),days:a,slug:i,currency:o,amount:rs(r),cryptoCurrency:d,cryptoAmount:rs(c),message:u&&Si(u)}}if(e instanceof Me.MessageActionGiveawayLaunch){const{stars:t}=e;return{mediaType:"action",type:"giveawayLaunch",stars:rs(t)}}if(e instanceof Me.MessageActionGiveawayResults){const{stars:t,winnersCount:s,unclaimedCount:n}=e;return{mediaType:"action",type:"giveawayResults",isStars:t,winnersCount:s,unclaimedCount:n}}if(e instanceof Me.MessageActionPaymentRefunded){const{peer:t,currency:s,totalAmount:n}=e;return{mediaType:"action",type:"paymentRefunded",peerId:Pa(t),currency:s,totalAmount:rs(n)}}if(e instanceof Me.MessageActionGiftStars){const{currency:t,amount:s,stars:n,cryptoCurrency:a,cryptoAmount:i,transactionId:o}=e;return{mediaType:"action",type:"giftStars",currency:t,amount:rs(s),stars:rs(n),cryptoCurrency:a,cryptoAmount:rs(i),transactionId:o}}if(e instanceof Me.MessageActionGiftTon){const{currency:t,amount:s,cryptoCurrency:n,cryptoAmount:a,transactionId:i}=e;return{mediaType:"action",type:"giftTon",currency:t,amount:rs(s),cryptoCurrency:n,cryptoAmount:rs(a),transactionId:i}}if(e instanceof Me.MessageActionPrizeStars){const{unclaimed:t,stars:s,transactionId:n,boostPeer:a,giveawayMsgId:i}=e;return{mediaType:"action",type:"prizeStars",isUnclaimed:t,stars:rs(s),transactionId:n,boostPeerId:Pa(a),giveawayMsgId:i}}if(e instanceof Me.MessageActionStarGift){const{nameHidden:t,saved:s,converted:n,upgraded:a,refunded:i,canUpgrade:o,prepaidUpgrade:r,auctionAcquired:d,gift:c,message:u,convertStars:l,upgradeMsgId:f,giftMsgId:g,upgradeStars:p,fromId:h,peer:m,savedId:y,prepaidUpgradeHash:_,toId:b,giftNum:S}=e,w=yr(c);return"starGift"!==w.type?ed:{mediaType:"action",type:"starGift",isNameHidden:t,isSaved:s,isConverted:n,isUpgraded:a,isRefunded:i,canUpgrade:o,isPrepaidUpgrade:r,isAuctionAcquired:d,gift:w,message:u&&Si(u),starsToConvert:rs(l),upgradeMsgId:f,giftMsgId:g,alreadyPaidUpgradeStars:rs(p),fromId:h&&Pa(h),peerId:m&&Pa(m),savedId:void 0!==y?va(y,"user"):void 0,prepaidUpgradeHash:_,toId:b&&Pa(b),giftNumber:S}}if(e instanceof Me.MessageActionStarGiftUnique){const{upgrade:t,transferred:s,saved:n,refunded:a,gift:i,canExportAt:o,transferStars:r,fromId:d,peer:c,savedId:u,resaleAmount:l,prepaidUpgrade:f,dropOriginalDetailsStars:g,fromOffer:p,canCraftAt:h}=e,m=yr(i);return"starGiftUnique"!==m.type?ed:{mediaType:"action",type:"starGiftUnique",isUpgrade:t,isTransferred:s,isSaved:n,isRefunded:a,isPrepaidUpgrade:f,isFromOffer:p,gift:m,canExportAt:o,transferStars:rs(r),fromId:d&&Pa(d),peerId:c&&Pa(c),savedId:void 0!==u?va(u,"user"):void 0,resaleAmount:l?lr(l):void 0,dropOriginalDetailsStars:void 0!==g?rs(g):void 0,canCraftAt:h}}if(e instanceof Me.MessageActionPaidMessagesPrice){const{stars:t,broadcastMessagesAllowed:s}=e;return{mediaType:"action",type:"paidMessagesPrice",isAllowedInChannel:s,stars:rs(t)}}if(e instanceof Me.MessageActionPaidMessagesRefunded){const{stars:t,count:s}=e;return{mediaType:"action",type:"paidMessagesRefunded",stars:rs(t),count:s}}if(e instanceof Me.MessageActionSuggestedPostApproval){const{rejected:t,balanceTooLow:s,rejectComment:n,scheduleDate:a,price:i}=e;return{mediaType:"action",type:"suggestedPostApproval",isRejected:Boolean(t),isBalanceTooLow:Boolean(s),rejectComment:n,scheduleDate:a,amount:i?lr(i):void 0}}if(e instanceof Me.MessageActionSuggestedPostSuccess){const{price:t}=e;return{mediaType:"action",type:"suggestedPostSuccess",amount:lr(t)}}if(e instanceof Me.MessageActionSuggestedPostRefund){const{payerInitiated:t}=e;return{mediaType:"action",type:"suggestedPostRefund",payerInitiated:Boolean(t)}}if(e instanceof Me.MessageActionTodoCompletions){const{completed:t,incompleted:s}=e;return{mediaType:"action",type:"todoCompletions",completedIds:t,incompletedIds:s}}if(e instanceof Me.MessageActionTodoAppendTasks){const{list:t}=e;return{mediaType:"action",type:"todoAppendTasks",items:t.map(Hr)}}if(e instanceof Me.MessageActionPollAppendAnswer){const t=Nr(e.answer);return t?{mediaType:"action",type:"pollAppendAnswer",answer:t}:ed}if(e instanceof Me.MessageActionPollDeleteAnswer){const t=Nr(e.answer);return t?{mediaType:"action",type:"pollDeleteAnswer",answer:t}:ed}if(e instanceof Me.MessageActionStarGiftPurchaseOffer){const{accepted:t,declined:s,gift:n,price:a,expiresAt:i}=e,o=yr(n);return"starGiftUnique"!==o.type?ed:{mediaType:"action",type:"starGiftPurchaseOffer",isAccepted:t,isDeclined:s,gift:o,price:lr(a),expiresAt:i}}if(e instanceof Me.MessageActionStarGiftPurchaseOfferDeclined){const{expired:t,gift:s,price:n}=e,a=yr(s);return"starGiftUnique"!==a.type?ed:{mediaType:"action",type:"starGiftPurchaseOfferDeclined",isExpired:t,gift:a,price:lr(n)}}if(e instanceof Me.MessageActionNewCreatorPending){const{newCreatorId:t}=e;return{mediaType:"action",type:"newCreatorPending",newCreatorId:va(t,"user")}}if(e instanceof Me.MessageActionChangeCreator){const{newCreatorId:t}=e;return{mediaType:"action",type:"changeCreator",newCreatorId:va(t,"user")}}if(e instanceof Me.MessageActionNoForwardsToggle){const{prevValue:t,newValue:s}=e;return{mediaType:"action",type:"noForwardsToggle",prevValue:Boolean(t),newValue:Boolean(s)}}if(e instanceof Me.MessageActionNoForwardsRequest){const{expired:t,prevValue:s,newValue:n}=e;return{mediaType:"action",type:"noForwardsRequest",isExpired:t,prevValue:Boolean(s),newValue:Boolean(n)}}return ed}(t.action);c&&(d.action=c);const u=t.date>Is()+10,l=t.media instanceof Me.MessageMediaInvoice&&Boolean(t.media.extendedMedia),f=Boolean(t.editDate)&&!t.editHide,{inlineButtons:g,keyboardButtons:p,keyboardPlaceholder:h,isKeyboardSingleUse:m,isKeyboardSelective:y}=Ni(t.replyMarkup,t.media instanceof Me.MessageMediaInvoice?t.media.receiptMsgId:void 0)||{},{mediaUnread:_,postAuthor:b}=t,S=void 0!==t.groupedId?String(t.groupedId):void 0,w=Boolean(S)&&!(d.document||d.audio||d.sticker),I=t.replyMarkup instanceof Me.ReplyKeyboardHide,v=t.replyMarkup instanceof Me.ReplyKeyboardHide&&t.replyMarkup.selective,P=t.noforwards||l,C=!t.noforwards,M=Yr(d,S);d.text&&M&&(d.text.emojiOnlyCount=M);const A=t.replies?.comments,R=t.fromBoostsApplied,k=t.factcheck&&ld(t.factcheck),T=t.videoProcessingPending,B=t.reactionsArePossible,D=t.invertMedia,U=t.savedPeerId&&Pa(t.savedPeerId),E=bo(t.restrictionReason);return{id:t.id,chatId:e,isOutgoing:r,content:d,date:t.date,senderId:n,viewsCount:t.views,forwardsCount:t.forwards,isScheduled:u,scheduleRepeatPeriod:t.scheduleRepeatPeriod,isFromScheduled:t.fromScheduled,isSilent:t.silent,isPinned:t.pinned,reactions:t.reactions&&Ci(t.reactions),...t.replyTo&&{replyInfo:ud(t.replyTo,t)},...t.suggestedPost&&{suggestedPostInfo:(x=t.suggestedPost,{isAccepted:x.accepted,isRejected:x.rejected,price:x.price?lr(x.price):void 0,scheduleDate:x.scheduleDate})},forwardInfo:i,isEdited:f,editDate:t.editDate,isMediaUnread:_,hasUnreadMention:t.mentioned&&_,areReactionsPossible:B,isMentioned:t.mentioned,...S&&{groupedId:S,isInAlbum:w},inlineButtons:g,...p&&{keyboardButtons:p,keyboardPlaceholder:h,isKeyboardSingleUse:m,isKeyboardSelective:y},...I&&{shouldHideKeyboardButtons:I,isHideKeyboardSelective:v},...t.viaBotId&&{viaBotId:va(t.viaBotId,"user")},postAuthorTitle:b,isProtected:P,isForwardingAllowed:C,hasComments:A,savedPeerId:U,senderBoosts:R,viaBusinessBotId:t.viaBusinessBotId?.toString(),factCheck:k,effectId:t.effect?.toString(),isInvertedMedia:D,isVideoProcessingPending:T,reportDeliveryUntilDate:t.reportDeliveryUntilDate,paidMessageStars:rs(t.paidMessageStars),restrictionReasons:E,summaryLanguageCode:t.summaryFromLanguage,fromRank:t.fromRank,guestChatViaId:t.guestchatViaFrom&&Pa(t.guestchatViaFrom)};var x}function dd(e){if(e instanceof Me.DraftMessageEmpty)return;const{message:t,entities:s,replyTo:n,date:a,effect:i,suggestedPost:o}=e,r=n instanceof Me.InputReplyToMessage?{type:"message",replyToMsgId:n.replyToMsgId,replyToTopId:n.topMsgId,replyToPeerId:n.replyToPeerId&&Pa(n.replyToPeerId),monoforumPeerId:n.monoforumPeerId&&Pa(n.monoforumPeerId),quoteText:n.quoteText?Br(n.quoteText,n.quoteEntities):void 0,quoteOffset:n.quoteOffset}:void 0,d=o instanceof Me.SuggestedPost?{isAccepted:o.accepted,isRejected:o.rejected,price:o.price?lr(o.price):void 0,scheduleDate:o.scheduleDate}:void 0;return{text:t?Br(t,s):void 0,replyInfo:r,suggestedPostInfo:d,date:a,effectId:i?.toString()}}function cd(e,t=!1){const s=e.savedFromPeer&&Pa(e.savedFromPeer),n=e.fromId&&Pa(e.fromId);return{date:e.date,savedDate:e.savedDate,isImported:e.imported,isChannelPost:Boolean(e.channelPost),channelPostId:e.channelPost,isLinkedChannelPost:Boolean(e.channelPost&&s===n&&e.savedFromMsgId===e.channelPost&&!t),savedFromPeerId:s,isSavedOutgoing:e.savedOut,fromId:n,fromChatId:n||s,fromMessageId:e.savedFromMsgId||e.channelPost,hiddenUserName:e.fromName,postAuthorTitle:e.postAuthor}}function ud(e,t){if(e instanceof Me.MessageReplyStoryHeader)return{type:"story",peerId:Pa(e.peer),storyId:e.storyId};if(e instanceof Me.MessageReplyHeader){const{replyFrom:s,replyToMsgId:n,replyToTopId:a,replyMedia:i,replyToPeerId:o,forumTopic:r,quote:d,quoteText:c,quoteEntities:u,quoteOffset:l}=e;return{type:"message",replyToMsgId:n,replyToTopId:a,isForumTopic:r,replyFrom:s&&cd(s),replyToPeerId:o&&Pa(o),replyMedia:i&&Dr(i,t),isQuote:d,quoteText:c?Br(c,u):void 0,quoteOffset:l}}}function ld(e){return{shouldFetch:e.needCheck,hash:e.hash.toString(),text:e.text&&Si(e.text),countryCode:e.country}}function fd(e){if(e.gif)return{video:e.gif};const{filename:t,blobUrl:s,previewBlobUrl:n,mimeType:a,size:i,audio:o,shouldSendAsFile:r,shouldSendAsSpoiler:d,ttlSeconds:c}=e;if(!r){if(e.quick){if(h.has(a)){const{width:t,height:a}=e.quick;return{photo:{mediaType:"photo",id:sd,sizes:[],thumbnail:{width:t,height:a,dataUri:n||s},blobUrl:s,date:Math.round(Date.now()/1e3),isSpoiler:d}}}if(m.has(a)){const{width:o,height:r,duration:c}=e.quick;return{video:{mediaType:"video",id:sd,mimeType:a,duration:c||0,fileName:t,width:o,height:r,blobUrl:s,...n&&{thumbnail:{width:o,height:r,dataUri:n}},size:i,isSpoiler:d}}}}if(e.voice){const{duration:t,waveform:s}=e.voice,{data:n}=Zr(s,63);return{voice:{mediaType:"voice",id:sd,duration:t,waveform:n,size:i},ttlSeconds:c}}if(y.has(a)){const{duration:e,performer:s,title:n}=o||{};return{audio:{mediaType:"audio",id:sd,mimeType:a,fileName:t,size:i,duration:e||0,title:n,performer:s}}}}return{document:{mediaType:"document",mimeType:a,fileName:t,size:i,...n&&{previewBlobUrl:n}}}}function gd(e){const t=xa(e);if(t&&e instanceof Me.Message&&e.replies)return pd(t,e.id,e.replies,e.fwdFrom)}function pd(e,t,s,n){const{channelId:a,replies:i,maxId:o=t,recentRepliers:r,comments:d,readMaxId:c}=s,{fromId:u,channelPost:l,savedFromPeer:f,savedFromMsgId:g}=n||{},p=f||u,h=g||l,m=a?va(a,"channel"):void 0;if(m===C)return;const y={messagesCount:i,lastMessageId:o,recentReplierIds:r?.map(Pa)};return Bs(d?{...y,isCommentsInfo:!0,chatId:m,originChannelId:e,originMessageId:t,hasUnread:Boolean(c&&o&&c<o)}:{...y,isCommentsInfo:!1,chatId:e,threadId:t,fromChannelId:p&&h?Pa(p):void 0,fromMessageId:h})}function hd(e){const{shortcutId:t,shortcut:s,topMessage:n}=e;return{id:t,shortcut:s,topMessageId:n}}function md(e){return e instanceof Me.ReportResultReported?{type:"reported"}:e instanceof Me.ReportResultAddComment?{type:"comment",isOptional:e.optional,option:Ga(e.option)}:{type:"selectOption",title:e.title,options:e.options.map(e=>({text:e.text,option:Ga(e.option)}))}}function yd(e,t){return t instanceof Me.BotInlineMediaResult?(t.document instanceof Me.Document&&ni(t.document),t.photo instanceof Me.Photo&&si(t.photo),Oi(t,e)):(t.thumb&&ci(t.thumb),Li(t,e))}function _d(e,t){return{query:t,queryIsFree:e.queryIsFree,totalDaily:e.totalDaily,remains:e.remains,waitTill:e.waitTill,starsAmount:rs(e.starsAmount)}}function bd(e,t){if(t instanceof Me.StoryItemDeleted)return{id:t.id,peerId:e,isDeleted:!0};if(t instanceof Me.StoryItemSkipped){const{id:s,date:n,expireDate:a,closeFriends:i}=t;return{id:s,peerId:e,...i&&{isForCloseFriends:!0},date:n,expireDate:a}}const{edited:s,pinned:n,expireDate:a,id:i,date:o,caption:r,entities:d,media:c,privacy:u,views:l,public:f,noforwards:g,closeFriends:p,contacts:h,selectedContacts:m,mediaAreas:y,sentReaction:_,out:b,fwdFrom:S,fromId:w}=t,I={...Dr(c)};r&&(I.text=Br(r,d));const v=_&&Ti(_);return Bs({id:i,peerId:e,date:o,expireDate:a,content:I,isPublic:f,isEdited:s,isInProfile:n,isForContacts:h,isForSelectedContacts:m,isForCloseFriends:p,noForwards:g,views:l&&Sd(l),isOut:b,visibility:u&&bi(u),mediaAreas:y?.map(vd).filter(Boolean),sentReaction:v,forwardInfo:S&&Pd(S),fromId:w&&Pa(w)})}function Sd(e){return Bs({hasViewers:e.hasViewers,viewsCount:e.viewsCount,forwardsCount:e.forwardsCount,reactionsCount:e.reactionsCount,reactions:e.reactions?.map(Ai).filter(Boolean),recentViewerIds:e.recentViewers?.map(e=>va(e,"user"))})}function wd(e){const{blockedMyStoriesFrom:t,blocked:s}=e;if(e instanceof Me.StoryView)return Bs({type:"user",peerId:va(e.userId,"user"),date:e.date,reaction:e.reaction&&Ti(e.reaction),areStoriesBlocked:s||t,isUserBlocked:s});if(e instanceof Me.StoryViewPublicForward){const n=od(e.message);if(!n)return;return{type:"forward",peerId:n.chatId,messageId:n.id,message:n,date:n.date,areStoriesBlocked:s||t,isUserBlocked:s}}if(e instanceof Me.StoryViewPublicRepost){const n=Pa(e.peerId),a=bd(n,e.story);if(!("content"in a))return;return{type:"repost",peerId:n,storyId:e.story.id,date:a.date,story:a,areStoriesBlocked:s||t,isUserBlocked:s}}}function Id(e){return{activeUntil:e.activeUntilDate,cooldownUntil:e.cooldownUntilDate}}function vd(e){const t=function(e){const{x:t,y:s,w:n,h:a,rotation:i,radius:o}=e;return{x:t,y:s,width:n,height:a,rotation:i,radius:o}}(e.coordinates);if(e instanceof Me.MediaAreaVenue){const{geo:s,title:n}=e,a=Fr(s);if(!a)return;return{type:"venue",coordinates:t,geo:a,title:n}}if(e instanceof Me.MediaAreaGeoPoint){const{geo:s}=e,n=Fr(s);if(!n)return;return{type:"geoPoint",coordinates:t,geo:n}}if(e instanceof Me.MediaAreaSuggestedReaction){const{reaction:s,dark:n,flipped:a}=e,i=Ti(s);if(!i)return;return{type:"suggestedReaction",coordinates:t,reaction:i,...n&&{isDark:!0},...a&&{isFlipped:!0}}}if(e instanceof Me.MediaAreaChannelPost){const{channelId:s,msgId:n}=e;return{type:"channelPost",coordinates:t,channelId:va(s,"channel"),messageId:n}}if(e instanceof Me.MediaAreaUrl){const{url:s}=e;return{type:"url",coordinates:t,url:s}}if(e instanceof Me.MediaAreaWeather){const{emoji:s,temperatureC:n,color:a}=e;return{type:"weather",coordinates:t,emoji:s,temperatureC:n,color:a}}if(e instanceof Me.MediaAreaStarGift){const{slug:s}=e;return{type:"uniqueGift",coordinates:t,slug:s}}}function Pd(e){const{from:t,fromName:s,storyId:n,modified:a}=e;return{storyId:n,fromPeerId:t&&Pa(t),fromName:s,isModified:a}}function Cd(e){const{albumId:t,title:s,iconPhoto:n,iconVideo:a}=e;return n&&si(n),a&&ni(a),{albumId:t,title:s,iconPhoto:n&&n instanceof Me.Photo?pi(n):void 0,iconVideo:a?Vr(a):void 0}}const Md=new Set(["User","UserEmpty"]),Ad=new Set(["ChatEmpty","Chat","ChatForbidden","Channel","ChannelForbidden"]),Rd=new Set(["Message","MessageEmpty","MessageService"]);function kd(e){if(!e||"object"!=typeof e)return;if(!("users"in e||"chats"in e||"messages"in e))return;let t,s;const n=[],a=[],i=[];"users"in e&&Array.isArray(e.users)&&Md.has(e.users[0]?.className)&&(t=Ms(e.users.map(e=>(e instanceof Me.User&&di(e),no(e))).filter(Boolean),"id")),"chats"in e&&Array.isArray(e.chats)&&Ad.has(e.chats[0]?.className)&&(s=Ms(e.chats.map(e=>((e instanceof Me.Chat||e instanceof Me.Channel)&&ri(e),Mo(e))).filter(Boolean),"id")),"messages"in e&&Array.isArray(e.messages)&&Rd.has(e.messages[0]?.className)&&e.messages.forEach(e=>{Ya(e);const t=gd(e);if(t&&n.push(t),"media"in e&&e.media){const t=Gr(e.media);t&&a.push(t);const s=Or(e.media);s&&i.push(s)}}),(t||s||n?.length)&&Wa({"@type":"updateEntities",users:t,chats:s,threadInfos:n?.length?n:void 0,polls:a?.length?a:void 0,webPages:i?.length?i:void 0})}function Td(e){Ya(e);const t=gd(e);t&&Wa({"@type":"updateThreadInfo",threadInfo:t})}class Bd{constructor(e){this.comparator=e,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,s=this.queue.length;for(;t<s;){const n=Math.floor((t+s)/2),a=this.comparator(e,this.queue[n]);if(0===a)return n;a>0?t=n+1:s=n}return t}}function Dd(e){if(e?.data)try{const t=JSON.parse(e.data);if(!t||"object"!=typeof t||Array.isArray(t))return;return function(e){const t={};return Object.entries(e||{}).forEach(([e,s])=>{"string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s||(t[e]=s)}),Object.keys(t).length?t:void 0}(t)}catch{return}}function Ud(e){const{self:t,min:s,about:n,date:a,versioned:i,canSelfUnmute:o,justJoined:r,left:d,muted:c,mutedByYou:u,source:l,volume:f,volumeByAdmin:g,videoJoined:p,peer:h,video:m,presentation:y,raiseHandRating:_}=e;return{isSelf:t,isMin:s,canSelfUnmute:o,isLeft:d,isMuted:c,isMutedByMe:u,hasJustJoined:r,isVolumeByAdmin:g,isVersioned:i,isVideoJoined:p,about:n,source:l,raiseHandRating:_?.toString(),volume:f,date:new Date(a),isUser:wa(h),id:Pa(h),video:m?Ed(m):void 0,presentation:y?Ed(y):void 0}}function Ed(e){const{audioSource:t,endpoint:s,paused:n,sourceGroups:a}=e;return{audioSource:t,endpoint:s,isPaused:n,sourceGroups:a.map(xd)}}function xd(e){return{semantics:e.semantics,sources:e.sources}}function Vd(e){const{id:t,accessHash:s}=e;if(e instanceof Me.GroupCallDiscarded)return{connectionState:"discarded",id:t.toString(),accessHash:s.toString(),participantsCount:0,version:0,participants:{}};const{version:n,participantsCount:a,streamDcId:i,scheduleDate:o,canChangeJoinMuted:r,joinMuted:d,canStartVideo:c,scheduleStartSubscribed:u}=e;return{connectionState:"disconnected",isLoaded:!0,id:t.toString(),accessHash:s.toString(),version:n,participantsCount:a,streamDcId:i,scheduleDate:o,canChangeJoinMuted:r,joinMuted:d,canStartVideo:c,scheduleStartSubscribed:u,participants:{}}}function Gd(e){const{id:t}=e;let s={id:t.toString()};if(e instanceof Me.PhoneCallAccepted||e instanceof Me.PhoneCallWaiting||e instanceof Me.PhoneCall||e instanceof Me.PhoneCallRequested){const{accessHash:t,adminId:n,date:a,video:i,participantId:o,protocol:r}=e;s={...s,accessHash:t.toString(),adminId:n.toString(),participantId:o.toString(),date:a,isVideo:i,protocol:Nd(r)}}if(e instanceof Me.PhoneCall){const{p2pAllowed:t,gAOrB:n,keyFingerprint:a,connections:i,startDate:o,customParameters:r}=e;s={...s,state:"active",gAOrB:Array.from(n),keyFingerprint:a.toString(),startDate:o,isP2pAllowed:Boolean(t),connections:i.map(Fd).filter(Boolean),customParameters:Dd(r)}}return e instanceof Me.PhoneCallDiscarded&&(s={...s,state:"discarded",duration:e.duration,reason:(n=e.reason,n instanceof Me.PhoneCallDiscardReasonMissed?"missed":n instanceof Me.PhoneCallDiscardReasonBusy?"busy":n instanceof Me.PhoneCallDiscardReasonHangup?"hangup":"disconnect"),needRating:e.needRating,needDebug:e.needDebug}),e instanceof Me.PhoneCallWaiting&&(s={...s,state:"waiting",receiveDate:e.receiveDate}),e instanceof Me.PhoneCallAccepted&&(s={...s,state:"accepted",gB:Array.from(e.gB)}),e instanceof Me.PhoneCallRequested&&(s={...s,state:"requested",gAHash:Array.from(e.gAHash)}),s;var n}function Fd(e){if(e instanceof Me.PhoneConnectionWebrtc){const{username:t,password:s,turn:n,stun:a,ip:i,ipv6:o,port:r}=e;return{username:t,password:s,isTurn:n,isStun:a,ip:i,ipv6:o,port:r}}}function Nd(e){const{libraryVersions:t,minLayer:s,maxLayer:n,udpP2p:a,udpReflector:i}=e;return{libraryVersions:t,minLayer:s,maxLayer:n,isUdpP2p:a,isUdpReflector:i}}function qd(){return new Me.PhoneCallProtocol({libraryVersions:M,minLayer:65,maxLayer:92,udpReflector:!0,udpP2p:!0})}const Hd=new Map,Ld=[],Od=(e,t)=>{const s=e.topicId?`${e.chatId}-${e.topicId}`:e.chatId;if(Hd.has(s)&&(clearTimeout(Hd.get(s)),Hd.delete(s)),e.mutedUntil===c||e.mutedUntil<=Is())return;if(Ld.push(e),Ld.sort((e,t)=>t.mutedUntil-e.mutedUntil),!Ld.pop())return;const n=setTimeout(()=>{if(t(),Ld.length){const e=Ld.pop();e&&Od(e,t)}},1e3*(e.mutedUntil-Is()));Hd.set(s,n)};function jd(e,t,s){Od({chatId:e,mutedUntil:t},()=>s({"@type":"updateChatNotifySettings",chatId:e,settings:{mutedUntil:void 0}}))}class Wd{constructor(e,t){this.pts=e,this.ptsCount=t}}class zd{constructor(e,t,s){this.channelId=e,this.pts=t,this.ptsCount=s}}function Kd(e){if(e instanceof Ut)a=e.timeOffset,ws=a,ja({"@type":"updateServerTimeOffset",serverTimeOffset:e.timeOffset});else if(e instanceof Dt){let t;switch(e.state){case Dt.disconnected:t="connectionStateConnecting";break;case Dt.broken:t="connectionStateBroken";break;default:t="connectionStateReady"}ja({"@type":"updateConnectionState",connectionState:t})}else if(e instanceof Me.UpdateNewMessage||e instanceof Me.UpdateNewScheduledMessage||e instanceof Me.UpdateNewChannelMessage||e instanceof Me.UpdateShortChatMessage||e instanceof Me.UpdateShortMessage){let t,s,a,i;if(e instanceof Me.UpdateShortChatMessage)t=rd(va((n=e).chatId,"chat"),{...n,fromId:en(va(n.fromId,"user")),peerId:en(va(n.chatId,"chat"))});else if(e instanceof Me.UpdateShortMessage)t=function(e){return rd(va(e.userId,"user"),{...e,peerId:en(e.out?va(e.userId,"user"):nd)})}(e);else{const n=e.message;if(n instanceof Me.MessageEmpty)return;Td(n),t=od(n),n instanceof Me.Message&&(s=n.media&&Gr(n.media),a=n.media&&Or(n.media)),i="replyMarkup"in e.message&&e.message?.replyMarkup instanceof Me.ReplyKeyboardForceReply&&(!e.message.replyMarkup.selective||t.isMentioned)}if(e instanceof Me.UpdateNewScheduledMessage?ja({"@type":"updateScheduledMessage",id:t.id,chatId:t.chatId,message:t,poll:s,webPage:a,isFromNew:!0,isFull:!0}):ja({"@type":"updateMessage",id:t.id,chatId:t.chatId,message:t,shouldForceReply:i,poll:s,webPage:a,isFromNew:!0,isFull:!0}),e.message instanceof Me.MessageService){const{action:s}=e.message;if(s instanceof Me.MessageActionChatEditTitle)ja({"@type":"updateChat",id:t.chatId,chat:{title:s.title}});else if(s instanceof Me.MessageActionChatEditPhoto){const n=s.photo instanceof Me.Photo&&pi(s.photo);if(!n)return;const a=function(e){if(e instanceof Me.PhotoEmpty)return new Me.ChatPhotoEmpty;const{dcId:t,id:s}=e;return new Me.ChatPhoto({dcId:t,photoId:s})}(s.photo),i=xa(e.message);Js.chats[i]&&(Js.chats[i].photo=a),si(s.photo),ja({"@type":"updateNewProfilePhoto",peerId:t.chatId,photo:n})}else if(s instanceof Me.MessageActionChatDeletePhoto){const s=xa(e.message);Js.chats[s]&&(Js.chats[s].photo=new Me.ChatPhotoEmpty),ja({"@type":"updateDeleteProfilePhoto",peerId:t.chatId})}else if(s instanceof Me.MessageActionChatDeleteUser)e._entities&&e._entities.some(e=>e instanceof Me.User&&Boolean(e.self)&&e.id===s.userId)&&ja({"@type":"updateChat",id:t.chatId,chat:{isForbidden:!0,isNotJoined:!0}});else if(s instanceof Me.MessageActionChatJoinedByLink){const{fromId:s}=e.message;s instanceof Me.PeerUser&&e._entities?.some(e=>e instanceof Me.User&&Boolean(e.self)&&e.id===s.userId)&&ja({"@type":"updateChatJoin",id:t.chatId})}else if(s instanceof Me.MessageActionChatAddUser)e._entities&&e._entities.some(e=>e instanceof Me.User&&Boolean(e.self)&&s.users.includes(e.id))&&ja({"@type":"updateChatJoin",id:t.chatId});else if(s instanceof Me.MessageActionGroupCall){const e=s.call instanceof Me.InputGroupCall?s.call:void 0;!s.duration&&e&&ja({"@type":"updateGroupCallChatId",chatId:t.chatId,call:{id:e.id.toString(),accessHash:e.accessHash.toString()}})}else if(s instanceof Me.MessageActionTopicEdit){const t=e.message.replyTo instanceof Me.MessageReplyHeader?e.message.replyTo:void 0,{replyToMsgId:s,replyToTopId:n,forumTopic:a}=t||{},i=a&&(n||s)||1;ja({"@type":"updateTopic",chatId:Pa(e.message.peerId),topicId:i})}else s instanceof Me.MessageActionTopicCreate&&ja({"@type":"updateTopics",chatId:Pa(e.message.peerId)})}}else if(e instanceof Me.UpdateQuickReplyMessage){const t=od(e.message);if(!t)return;const s=e.message instanceof Me.Message&&e.message.media?Gr(e.message.media):void 0,n=e.message instanceof Me.Message&&e.message.media?Or(e.message.media):void 0;ja({"@type":"updateQuickReplyMessage",id:t.id,message:t,poll:s,webPage:n})}else if(e instanceof Me.UpdateDeleteQuickReplyMessages)ja({"@type":"deleteQuickReplyMessages",quickReplyId:e.shortcutId,messageIds:e.messages});else if(e instanceof Me.UpdateQuickReplies)ja({"@type":"updateQuickReplies",quickReplies:e.quickReplies.map(hd)});else if(e instanceof Me.UpdateNewQuickReply)ja({"@type":"updateQuickReplies",quickReplies:[hd(e.quickReply)]});else if(e instanceof Me.UpdateDeleteQuickReply)ja({"@type":"deleteQuickReply",quickReplyId:e.shortcutId});else if(e instanceof Me.UpdateEditMessage||e instanceof Me.UpdateEditChannelMessage){const t=e.message;if(t instanceof Me.MessageEmpty)return;Td(t);const s=Ts(od(t),["isOutgoing"]),n=t instanceof Me.Message&&t.media?Gr(t.media):void 0,a=t instanceof Me.Message&&t.media?Or(t.media):void 0;ja({"@type":"updateMessage",id:s.id,chatId:s.chatId,message:s,poll:n,webPage:a,isFull:!0})}else if(e instanceof Me.UpdateMessageReactions)ja({"@type":"updateMessageReactions",id:e.msgId,threadId:e.topMsgId,chatId:Pa(e.peer),reactions:Ci(e.reactions)});else if(e instanceof Me.UpdateMessageExtendedMedia){const t=Pa(e.peer),s=e.extendedMedia[0]instanceof Me.MessageExtendedMedia;if(s){const n=$r(e.extendedMedia);if(!n?.length)return;return void ja({"@type":"updateMessageExtendedMedia",id:e.msgId,chatId:t,isBought:s,extendedMedia:n})}const n=s?void 0:e.extendedMedia.filter(e=>e instanceof Me.MessageExtendedMediaPreview).map(e=>zr(e)).filter(Boolean);if(!n?.length)return;ja({"@type":"updateMessageExtendedMedia",id:e.msgId,chatId:t,extendedMedia:n})}else if(e instanceof Me.UpdateDeleteMessages)ja({"@type":"deleteMessages",ids:e.messages});else if(e instanceof Me.UpdateDeleteScheduledMessages)ja({"@type":"deleteScheduledMessages",ids:e.messages,newIds:e.sentMessages,chatId:Pa(e.peer)});else if(e instanceof Me.UpdateDeleteChannelMessages){const t=va(e.channelId,"channel");ja({"@type":"deleteMessages",ids:e.messages,chatId:t})}else if(e instanceof Me.UpdateServiceNotification)if(e.popup)ja({"@type":"error",error:{message:e.message,entities:e.entities.map(wi)}});else{const t=function(e,t){const s=id(t),n=Tr(e);return{id:s,chatId:v,date:e.inboxDate||t,content:n,isInvertedMedia:e.invertMedia,isOutgoing:!1}}(e,Date.now()/1e3+ws);Td(hn(t.id,t.chatId,e)),ja({"@type":"updateServiceNotification",message:t})}else if(e instanceof Me.UpdateReadMessagesContents)ja({"@type":"updateCommonBoxMessages",ids:e.messages,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}});else if(e instanceof Me.UpdateChannelReadMessagesContents)ja({"@type":"updateChannelMessages",channelId:va(e.channelId,"channel"),ids:e.messages,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}});else if(e instanceof Me.UpdateMessagePoll){const{pollId:t,poll:s,results:n,peer:a,msgId:i,topMsgId:o}=e,r=s&&qr(s),d=Lr(n);ja({"@type":"updateMessagePoll",pollId:t.toString(),pollUpdate:Bs({summary:r,results:d})}),a&&i&&n.hasUnreadVotes&&!n.min&&ja({"@type":"updateMessagePollUnread",chatId:Pa(a),messageId:i,threadId:o||Ps,pollId:t.toString()})}else if(e instanceof Me.UpdateMessagePollVote)ja({"@type":"updateMessagePollVote",pollId:String(e.pollId),peerId:Pa(e.peer),options:e.options.map(Ga)});else if(e instanceof Me.UpdateChannelMessageViews)ja({"@type":"updateMessage",chatId:va(e.channelId,"channel"),id:e.id,message:{viewsCount:e.views}});else if(e instanceof Me.UpdateChannelMessageForwards)ja({"@type":"updateMessage",chatId:va(e.channelId,"channel"),id:e.id,message:{forwardsCount:e.forwards}});else if(e instanceof Me.UpdateReadHistoryInbox)ja({"@type":"updateThreadReadState",chatId:Pa(e.peer),threadId:e.topMsgId||Ps,readState:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount,hasUnreadMark:void 0}});else if(e instanceof Me.UpdateReadHistoryOutbox)ja({"@type":"updateThreadReadState",chatId:Pa(e.peer),threadId:Ps,readState:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof Me.UpdateReadChannelInbox)ja({"@type":"updateThreadReadState",chatId:va(e.channelId,"channel"),threadId:Ps,readState:{lastReadInboxMessageId:e.maxId,unreadCount:e.stillUnreadCount,hasUnreadMark:void 0}});else if(e instanceof Me.UpdateReadChannelOutbox)ja({"@type":"updateThreadReadState",chatId:va(e.channelId,"channel"),threadId:Ps,readState:{lastReadOutboxMessageId:e.maxId}});else if(e instanceof Me.UpdateReadChannelDiscussionInbox)ja({"@type":"updateThreadReadState",chatId:va(e.channelId,"channel"),threadId:e.topMsgId,readState:{lastReadInboxMessageId:e.readMaxId}});else if(e instanceof Me.UpdateReadChannelDiscussionOutbox)ja({"@type":"updateThreadReadState",chatId:va(e.channelId,"channel"),threadId:e.topMsgId,readState:{lastReadOutboxMessageId:e.readMaxId}});else if(e instanceof Me.UpdateDialogPinned&&e.peer instanceof Me.DialogPeer)ja({"@type":"updateChatPinned",id:Pa(e.peer.peer),isPinned:e.pinned||!1});else if(e instanceof Me.UpdatePinnedDialogs){const t=e.order?.filter(e=>e instanceof Me.DialogPeer).map(e=>Pa(e.peer));ja({"@type":"updatePinnedChatIds",ids:t,folderId:e.folderId||void 0})}else if(e instanceof Me.UpdateSavedDialogPinned&&e.peer instanceof Me.DialogPeer)ja({"@type":"updateSavedDialogPinned",id:Pa(e.peer.peer),isPinned:e.pinned||!1});else if(e instanceof Me.UpdatePinnedSavedDialogs)ja({"@type":"updatePinnedSavedDialogIds",ids:e.order?e.order.filter(e=>e instanceof Me.DialogPeer).map(e=>Pa(e.peer)):[]});else if(e instanceof Me.UpdateFolderPeers)e.folderPeers.forEach(e=>{const{folderId:t,peer:s}=e;ja({"@type":"updateChatListType",id:Pa(s),folderId:t})});else if(e instanceof Me.UpdateDialogFilter){const{id:t,filter:s}=e;ja({"@type":"updateChatFolder",id:t,folder:Va(s)?Eo(s):void 0})}else if(e instanceof Me.UpdateDialogFilterOrder)ja({"@type":"updateChatFoldersOrder",orderedIds:e.order});else if(e instanceof Me.UpdateChatParticipants){const t=Do(e.participants);ja({"@type":"updateChatMembers",id:va(e.participants.chatId,"chat"),replacedMembers:t})}else if(e instanceof Me.UpdateChatParticipantAdd){const t=Bo(Rs(e,["userId","inviterId","date"]));ja({"@type":"updateChatMembers",id:va(e.chatId,"chat"),addedMember:t})}else if(e instanceof Me.UpdateChatParticipantDelete)ja({"@type":"updateChatMembers",id:va(e.chatId,"chat"),deletedMemberId:va(e.userId,"user")});else if(e instanceof Me.UpdateChatParticipantRank)ja({"@type":"updateChatParticipantRank",id:va(e.chatId,"chat"),userId:va(e.userId,"user"),rank:e.rank});else if(e instanceof Me.UpdatePinnedMessages||e instanceof Me.UpdatePinnedChannelMessages)ja({"@type":"updatePinnedIds",chatId:e instanceof Me.UpdatePinnedMessages?Pa(e.peer):va(e.channelId,"channel"),messageIds:e.messages,isPinned:e.pinned});else if(e instanceof Me.UpdateUserTyping||e instanceof Me.UpdateChatUserTyping){const t=e instanceof Me.UpdateUserTyping?va(e.userId,"user"):va(e.chatId,"chat"),n=e instanceof Me.UpdateUserTyping?va(e.userId,"user"):Pa(e.fromId),a=e instanceof Me.UpdateUserTyping?e.topMsgId:void 0;e.action instanceof Me.SendMessageEmojiInteraction?ja({"@type":"updateStartEmojiInteraction",id:t,emoji:e.action.emoticon,messageId:e.action.msgId,interaction:(s=JSON.parse(e.action.interaction.data),{timestamps:s.a.map(({t:e})=>e)})}):e.action instanceof Me.SendMessageTextDraftAction?ja({"@type":"updateChatTypingDraft",chatId:t,id:e.action.randomId.toString(),threadId:a,text:Si(e.action.text)}):ja({"@type":"updateChatTypingStatus",id:t,peerId:n,threadId:a,typingStatus:Uo(e)})}else if(e instanceof Me.UpdateChannelUserTyping)ja({"@type":"updateChatTypingStatus",id:va(e.channelId,"channel"),peerId:Pa(e.fromId),threadId:e.topMsgId,typingStatus:Uo(e)});else if(e instanceof Me.UpdateChannel){const{_entities:t}=e;if(!t)return;const s=t.find(e=>e instanceof Me.Channel||e instanceof Me.ChannelForbidden);if(s instanceof Me.Channel){const t=Mo(s);t&&(ja({"@type":"updateChat",id:t.id,chat:t}),ja({"@type":t.isNotJoined?"updateChatLeave":"updateChatJoin",id:va(e.channelId,"channel")}))}else if(s instanceof Me.ChannelForbidden){const t=va(e.channelId,"channel");ja({"@type":"updateChat",id:t,chat:{isRestricted:!0}}),ja({"@type":"updateChatLeave",id:t})}else 0===t.length&&ja({"@type":"resetMessages",id:va(e.channelId,"channel")})}else if(e instanceof Me.UpdateDialogUnreadMark&&e.peer instanceof Me.DialogPeer)ja({"@type":"updateThreadReadState",chatId:Pa(e.peer.peer),threadId:Ps,readState:{hasUnreadMark:e.unread}});else if(e instanceof Me.UpdateChatDefaultBannedRights)ja({"@type":"updateChat",id:Pa(e.peer),chat:{defaultBannedRights:Hs(e.defaultBannedRights)}});else if(e instanceof Me.UpdateUserStatus)ja({"@type":"updateUserStatus",userId:va(e.userId,"user"),status:ao(e.status)});else if(e instanceof Me.UpdateUser)ja({"@type":"updateRequestUserUpdate",id:va(e.userId,"user")});else if(e instanceof Me.UpdateUserEmojiStatus){const t=Ra(e.emojiStatus);ja({"@type":"updateUserEmojiStatus",userId:va(e.userId,"user"),emojiStatus:t})}else if(e instanceof Me.UpdateUserName){const t=va(e.userId,"user"),s=Js.users[t];ja({"@type":"updateUser",id:t,user:{...s?.mutualContact&&!s.self?Rs(e,[]):Rs(e,["firstName","lastName"]),usernames:_i(e)}})}else if(e instanceof Me.UpdateUserPhone){const{userId:t,phone:s}=e;ja({"@type":"updateUser",id:va(t,"user"),user:{phoneNumber:s}})}else if(e instanceof Me.UpdatePeerSettings){const{peer:t,settings:s}=e;ja({"@type":"updatePeerSettings",id:Pa(t),settings:so(s)})}else if(e instanceof Me.UpdateNotifySettings){const{notifySettings:t,peer:s}=e,n=s.className,a=Ba(t);if(s instanceof Me.NotifyPeer){const e=Pa(s.peer);return a.mutedUntil&&jd(e,a.mutedUntil,ja),void ja({"@type":"updateChatNotifySettings",chatId:e,settings:a})}if(s instanceof Me.NotifyForumTopic){const e=Pa(s.peer);return a.mutedUntil&&function(e,t,s,n){Od({chatId:e,topicId:t,mutedUntil:s},()=>n({"@type":"updateTopicNotifySettings",chatId:e,topicId:t,settings:{mutedUntil:void 0}}))}(e,s.topMsgId,a.mutedUntil,ja),void ja({"@type":"updateTopicNotifySettings",chatId:e,topicId:s.topMsgId,settings:a})}const i="NotifyUsers"===n?"users":"NotifyChats"===n?"groups":"NotifyBroadcasts"===n?"channels":void 0;if(!i)return;ja({"@type":"updateDefaultNotifySettings",peerType:i,settings:a})}else if(e instanceof Me.UpdatePeerBlocked)ja({"@type":"updatePeerBlocked",id:Pa(e.peerId),isBlocked:e.blocked,isBlockedFromStories:e.blockedMyStoriesFrom});else if(e instanceof Me.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";case"PrivacyKeyAbout":return"bio";case"PrivacyKeyBirthday":return"birthday";case"PrivacyKeyStarGiftsAutoSave":return"gifts";case"PrivacyKeyNoPaidMessages":return"noPaidMessages"}}(e.key);t&&ja({"@type":"updatePrivacy",key:t,rules:bi(e.rules)})}else if(e instanceof Me.UpdateDraftMessage)ja({"@type":"draftMessage",chatId:Pa(e.peer),threadId:e.topMsgId,draft:dd(e.draft)});else if(e instanceof Me.UpdateContactsReset)ja({"@type":"updateResetContactList"});else if(e instanceof Me.UpdateFavedStickers)ja({"@type":"updateFavoriteStickers"});else if(e instanceof Me.UpdateRecentStickers)ja({"@type":"updateRecentStickers"});else if(e instanceof Me.UpdateRecentReactions)ja({"@type":"updateRecentReactions"});else if(e instanceof Me.UpdateSavedReactionTags)ja({"@type":"updateSavedReactionTags"});else if(e instanceof Me.UpdateMoveStickerSetToTop)e.masks||ja({"@type":"updateMoveStickerSetToTop",isCustomEmoji:e.emojis,id:e.stickerset.toString()});else if(e instanceof Me.UpdateStickerSets)ja({"@type":"updateStickerSets"});else if(e instanceof Me.UpdateStickerSetsOrder)e.masks||ja({"@type":"updateStickerSetsOrder",order:e.order.map(e=>e.toString()),isCustomEmoji:e.emojis});else if(e instanceof Me.UpdateNewStickerSet){if(e.stickerset instanceof Me.messages.StickerSet){const t=xi(e.stickerset.set);ja({"@type":"updateStickerSet",id:t.id,stickerSet:t})}}else if(e instanceof Me.UpdateSavedGifs)ja({"@type":"updateSavedGifs"});else if(e instanceof Me.UpdateGroupCall)ja({"@type":"updateGroupCall",call:Vd(e.call)});else if(e instanceof Me.UpdateGroupCallConnection)ja({"@type":"updateGroupCallConnection",data:JSON.parse(e.params.data),presentation:Boolean(e.presentation)});else if(e instanceof Me.UpdateGroupCallParticipants){const t=function(e){if(e instanceof Me.InputGroupCall)return e.id.toString()}(e.call);t&&ja({"@type":"updateGroupCallParticipants",groupCallId:t,participants:e.participants.map(Ud)})}else if(e instanceof Me.UpdatePendingJoinRequests)ja({"@type":"updatePendingJoinRequests",chatId:Pa(e.peer),recentRequesterIds:e.recentRequesters.map(e=>va(e,"user")),requestsPending:e.requestsPending});else if(e instanceof Me.UpdatePhoneCall)ja({"@type":"updatePhoneCall",call:Gd(e.phoneCall)});else if(e instanceof Me.UpdatePhoneCallSignalingData)ja({"@type":"updatePhoneCallSignalingData",callId:e.phoneCallId.toString(),data:Array.from(e.data)});else if(e instanceof Me.UpdateWebViewResultSent){const{queryId:t}=e;ja({"@type":"updateWebViewResultSent",queryId:t.toString()})}else if(e instanceof Me.UpdateWebPage||e instanceof Me.UpdateChannelWebPage){const t=jr(e.webpage);t&&ja({"@type":"updateWebPage",webPage:t})}else if(e instanceof Me.UpdateBotMenuButton){const{botId:t,button:s}=e;ja({"@type":"updateBotMenuButton",botId:va(t,"user"),button:Ji(s)})}else if(e instanceof Me.UpdateBotCommands){const{botId:t,commands:s}=e,n=va(t,"user"),a=s.map(e=>$i(n,e));ja({"@type":"updateBotCommands",botId:n,commands:a.length?a:void 0})}else if(e instanceof Me.UpdateTranscribedAudio)ja({"@type":"updateTranscribedAudio",transcriptionId:e.transcriptionId.toString(),text:e.text,isPending:e.pending});else if(e instanceof Me.UpdateConfig)ja({"@type":"updateConfig"});else if(e instanceof Me.UpdateAiComposeTones)ja({"@type":"updateAiComposeTones"});else if(e instanceof Me.UpdatePinnedForumTopic)ja({"@type":"updatePinnedTopic",chatId:Pa(e.peer),topicId:e.topicId,isPinned:Boolean(e.pinned)});else if(e instanceof Me.UpdatePinnedForumTopics)ja({"@type":"updatePinnedTopicsOrder",chatId:Pa(e.peer),order:e.order||[]});else if(e instanceof Me.UpdateRecentEmojiStatuses)ja({"@type":"updateRecentEmojiStatuses"});else if(e instanceof Me.UpdateStory){const{story:t}=e,s=Pa(e.peer),n=bd(s,t);ti(t,s),t instanceof Me.StoryItemDeleted?ja({"@type":"deleteStory",peerId:s,storyId:t.id}):ja({"@type":"updateStory",peerId:s,story:n})}else if(e instanceof Me.UpdateReadStories)ja({"@type":"updateReadStories",peerId:Pa(e.peer),lastReadId:e.maxId});else if(e instanceof Me.UpdateSentStoryReaction){const t=Ti(e.reaction);ja({"@type":"updateSentStoryReaction",peerId:Pa(e.peer),storyId:e.storyId,reaction:t})}else if(e instanceof Me.UpdateStoriesStealthMode)ja({"@type":"updateStealthMode",stealthMode:Id(e.stealthMode)});else if(e instanceof Me.UpdateAttachMenuBots)ja({"@type":"updateAttachMenuBots"});else if(e instanceof Me.UpdateNewAuthorization)ja({"@type":"updateNewAuthorization",hash:e.hash.toString(),date:e.date,device:e.device,location:e.location,isUnconfirmed:e.unconfirmed});else if(e instanceof Me.UpdateChannelViewForumAsMessages)ja({"@type":"updateViewForumAsMessages",chatId:va(e.channelId,"channel"),isEnabled:!!e.enabled||void 0});else if(e instanceof Me.UpdateStarsBalance){const t=lr(e.balance);if(!t)return;ja({"@type":"updateStarsBalance",balance:t})}else if(e instanceof Me.UpdateStarGiftAuctionState){const t=Mr(e.state);if(!t)return;ja({"@type":"updateStarGiftAuctionState",giftId:e.giftId.toString(),state:t})}else if(e instanceof Me.UpdateStarGiftAuctionUserState)ja({"@type":"updateStarGiftAuctionUserState",giftId:e.giftId.toString(),userState:Ar(e.userState)});else if(e instanceof Me.UpdateStarGiftCraftFail)ja({"@type":"updateStarGiftCraftFail"});else if(e instanceof Me.UpdatePaidReactionPrivacy)ja({"@type":"updatePaidReactionPrivacy",private:(t=e.private,t instanceof Me.PaidReactionPrivacyAnonymous?{type:"anonymous"}:t instanceof Me.PaidReactionPrivacyPeer?{type:"peer",peerId:Pa(t.peer)}:{type:"default"})});else if(e instanceof Me.UpdateLangPackTooLong)ja({"@type":"updateLangPackTooLong",langCode:e.langCode});else if(e instanceof Me.UpdateLangPack){const{strings:t,keysToRemove:s}=mo(e.difference.strings);ja({"@type":"updateLangPack",version:e.difference.version,strings:t,keysToRemove:s})}else e instanceof aa?ja({"@type":"updatePremiumFloodWait",isUpload:e.isUpload}):e instanceof Wd||e instanceof zd||e instanceof Me.UpdateMessageID||Me.UpdateShortSentMessage;var t,s,n,a}const $d="0",Jd=new Set(["CHANNEL_INVALID","CHANNEL_PRIVATE"]);let Qd,Xd,Yd=!1;const Zd=new Map,ec=new Set,tc=new Bd(function(e,t){return("seqStart"in e?e.seqStart:e.seq)-("seqStart"in t?t.seqStart:t.seq)}),sc=new Map;function nc(e){Js.commonBoxState.seq=e.seq,Js.commonBoxState.date=e.date,Js.commonBoxState.pts=e.pts,Js.commonBoxState.qts=e.qts}function ac(e,t,s){if(e instanceof Dt)return e.state===Dt.connected&&Yd&&pc(),void Kd(e);if(e instanceof Ut)Kd(e);else if(void 0!==Js.commonBoxState.seq)return e instanceof Me.Updates||e instanceof Me.UpdatesCombined?(t&&(e._isFromDifference=!0),void function(e,t){tc.add(e),t||rc()}(e,s)):"pts"in e?e instanceof Me.UpdateChannelTooLong?void lc(hc(e),"gapRecovery",0):(t&&(e._isFromDifference=!0),void function(e,t){const s=hc(e),n=sc.get(s)||new Bd(Cc);n.add(e),sc.set(s,n),t||dc(s)}(e,s)):void Kd(e)}function ic(e,t){if(!(Js.chats[e]instanceof Me.Channel))return;const s=Js.channelPtsById[e];s&&s<t?cc(e):Js.channelPtsById[e]=t}function oc(e){if("seq"in e&&e.seq&&(Js.commonBoxState.seq=e.seq,Js.commonBoxState.date=e.date),"qts"in e&&(Js.commonBoxState.qts=e.qts),"pts"in e){const t=hc(e);t!==$d?Js.channelPtsById[t]=e.pts:Js.commonBoxState.pts=e.pts}if(e instanceof Me.UpdatesCombined||e instanceof Me.Updates){kd(e);const t=e.users.concat(e.chats);e.updates.forEach(e=>{t&&(e._entities=t),ac(e)})}else Kd(e)}function rc(){if(!tc.size)return;const e=tc.pop(),t=Js.commonBoxState.seq,s="seqStart"in e?e.seqStart:e.seq;if(0===s||e._isFromDifference&&s>=t+1)oc(e);else if(s===t+1)clearTimeout(Xd),Xd=void 0,oc(e);else if(s>t+1)return tc.add(e),void pc();rc()}function dc(e){const t=sc.get(e);if(!t?.size)return;const s=t.pop(),n=e===$d?Js.commonBoxState.pts:Js.channelPtsById[e],a=s.pts,i=Pc(s);if(void 0!==n){if(s._isFromDifference&&a>=n+i)oc(s);else if(a===n+i)fc(e,"gapRecovery"),gc(e),oc(s);else if(a>n+i)return t.add(s),void(e===$d?pc():cc(e));dc(e)}}function cc(e){lc(e,"gapRecovery",500)}function uc(e){const t=Zd.get(e);if(t)return t;const s={isInFlight:!1};return Zd.set(e,s),s}function lc(e,t,s){const n=uc(e),a=Date.now()+s;void 0!==n.deadline&&n.deadline<=a||(fc(e),n.reason=t,n.deadline=a,n.timeout=setTimeout(()=>{n.timeout=void 0,n.deadline=void 0,n.isInFlight?lc(e,t,500):async function(e,t){const s=uc(e);if(!s.isInFlight){s.isInFlight=!0,s.reason=t;try{await yc(e,t)}finally{s.isInFlight=!1}}}(e,t)},s))}function fc(e,t){const s=Zd.get(e);!s?.timeout||t&&s.reason!==t||(clearTimeout(s.timeout),s.timeout=void 0,s.deadline=void 0,s.reason=void 0)}function gc(e){const t=Zd.get(e);t?.isShortpollEligible&&void 0!==t.shortpollTimeoutMs&&lc(e,"shortpoll",t.shortpollTimeoutMs)}function pc(){Xd||(Xd=setTimeout(async()=>{await mc(),Xd=void 0},500))}function hc(e){return"channelId"in e&&"pts"in e?va(e.channelId,"channel"):e instanceof Me.UpdateNewChannelMessage||e instanceof Me.UpdateEditChannelMessage?va(e.message.peerId.channelId,"channel"):$d}async function mc(){if(!Yd)throw new Error("UpdatesManager not initialized");if(!Js.commonBoxState?.date)return void bc();ja({"@type":"updateFetchingDifference",isFetching:!0});const e=await Qd(new Me.updates.GetDifference({pts:Js.commonBoxState.pts,date:Js.commonBoxState.date,qts:Js.commonBoxState.qts}));if(!e||e instanceof Me.updates.DifferenceTooLong)bc();else{if(e instanceof Me.updates.DifferenceEmpty)return Js.commonBoxState.seq=e.seq,Js.commonBoxState.date=e.date,void ja({"@type":"updateFetchingDifference",isFetching:!1});vc(e),nc(e instanceof Me.updates.DifferenceSlice?e.intermediateState:e.state),e instanceof Me.updates.DifferenceSlice?mc():ja({"@type":"updateFetchingDifference",isFetching:!1})}}async function yc(e,t){const s=Js.chats[e];if(!(s&&s instanceof Me.Channel&&s.accessHash&&void 0!==Js.channelPtsById[e]))return;const n="shortpoll"===t?100:1e3;let a;try{const t=await Qd(new Me.updates.GetChannelDifference({channel:nn(e,s.accessHash.toString()),pts:Js.channelPtsById[e],filter:new Me.ChannelMessagesFilterEmpty,limit:n}),{shouldThrow:!0});if(!t)return;a=t}catch(s){return void function(e,t,s){const n=uc(e),a=s instanceof Ae?s.errorMessage:void 0;if(a&&Jd.has(a))return n.isShortpollEligible=!1,void fc(e);lc(e,t,5e3)}(e,t,s)}if(a instanceof Me.updates.ChannelDifferenceTooLong)bc();else{if(Js.channelPtsById[e]=a.pts,function(e,t){uc(e).shortpollTimeoutMs="timeout"in t&&t.timeout?1e3*t.timeout:1e3}(e,a),a instanceof Me.updates.ChannelDifferenceEmpty)return a.final&&_c(e),void dc(e);vc(a,e),a.final?_c(e):await yc(e,"gapRecovery")}}function _c(e){uc(e).isShortpollEligible&&gc(e)}function bc(){Sc(),ja({"@type":"requestSync"}),Ic()}function Sc(){sc.clear(),tc.clear(),clearTimeout(Xd),Xd=void 0,Zd.forEach(({timeout:e})=>{e&&clearTimeout(e)}),Zd.clear(),ec.clear(),Js.commonBoxState={},Object.keys(Js.channelPtsById).forEach(e=>{Js.channelPtsById[e]=0}),Yd=!1}function wc(e,t){const s="chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type?Cn(e.id,"channel"):void 0;var n,a,i;ac((n=t.pts,a=t.ptsCount,(i=s)?new zd(i,n,a):new Wd(n,a)))}async function Ic(){const e=await Qd(new Me.updates.GetState);e&&(nc(e),Yd=!0)}function vc(e,t){e.newMessages.forEach(e=>{Kd(new Me.UpdateNewMessage({message:e,pts:0,ptsCount:0}))}),kd(e);const s=new Set;e.otherUpdates.forEach(e=>{const t=hc(e);e instanceof Me.UpdateChannelTooLong&&s.add(hc(e));const n=!s.has(t);ac(e,n,!n)}),t?dc(t):rc()}function Pc(e){return"ptsCount"in e?e.ptsCount:0}function Cc(e,t){const s=e.pts-t.pts;return 0!==s?s:Pc(t)-Pc(e)}const Mc={};function Ac(){ja({"@type":"updateWebAuthTokenFailed"})}function Rc(e){ja({"@type":"updatePasskeyOption",option:e})}function kc(){return ja(xc("authorizationStateWaitPhoneNumber")),new Promise((e,t)=>{Mc.resolve=e,Mc.reject=t})}function Tc(e=!1){return ja({...xc("authorizationStateWaitCode"),isCodeViaApp:e}),new Promise((e,t)=>{Mc.resolve=e,Mc.reject=t})}function Bc(e,t){return ja({...xc("authorizationStateWaitPassword"),hint:e,noReset:t}),new Promise(e=>{Mc.resolve=e})}function Dc(){return ja(xc("authorizationStateWaitRegistration")),new Promise(e=>{Mc.resolve=e})}function Uc(e){return ja({...xc("authorizationStateWaitQrCode"),qrCode:{token:btoa(String.fromCharCode(...e.token)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),expires:e.expires}}),new Promise((e,t)=>{Mc.reject=t})}function Ec(e){if(e instanceof je)return void ja({"@type":"updateUserAlreadyAuthorized",userId:e.userId});const{messageKey:t,errorMessage:s}=Ha(e);ja({"@type":"updateAuthorizationError",errorKey:t,errorCode:s})}function xc(e){return{"@type":"updateAuthorizationState",authorizationState:e}}function Vc(e){Mc.resolve&&Mc.resolve(e)}function Gc(e){Mc.resolve&&Mc.resolve(e)}function Fc(e){Mc.resolve&&Mc.resolve(e)}function Nc(e){const{firstName:t,lastName:s}=e;Mc.resolve&&Mc.resolve([t,s])}function qc(){Mc.reject&&Mc.reject(new Error("RESTART_AUTH"))}function Hc(){Mc.reject&&Mc.reject(new Error("RESTART_AUTH_WITH_QR"))}function Lc(e){Mc.reject&&Mc.reject(new Oe(e))}async function Oc(){const e=globalThis.scheduler;return e?.yield?e.yield():new Promise(e=>{setTimeout(e,0)})}const jc=self.caches,Wc="X-Last-Access",zc=[o,r,"tt-media-progressive"];let Kc;async function $c(){return!!jc&&(Kc=Kc??await jc.has("test").then(()=>!0).catch(()=>!1),Kc)}tu(zc),setInterval(()=>{tu(zc)},36e5);let Jc=function(e){return e[e.Text=0]="Text",e[e.Blob=1]="Blob",e[e.Json=2]="Json",e[e.ArrayBuffer=3]="ArrayBuffer",e}({});function Qc(e){return"tt-lang-packs-v52"===e?e:`${e}${Gs?`_${Gs}`:""}`}async function Xc(e,t,s,n=!1){if(jc)try{const a=new Request(t.replace(/:/g,"_")),i=await jc.open(Qc(e)),o=await i.match(a);if(!o)return;const r=Number(o.headers.get(Wc)),d=Date.now();(!r||d-r>864e5)&&async function(e,t,s){try{const n=new Headers(s.headers);n.set(Wc,Date.now().toString());const a=new Response(s.clone().body,{status:s.status,statusText:s.statusText,headers:n});await e.put(t,a)}catch(e){console.warn(e)}}(i,a,o);const c=o.headers.get("Content-Type");switch(s){case Jc.Text:return await o.text();case Jc.Blob:{if(t.startsWith("avatar")&&c&&c.startsWith("text"))return;const e=await o.blob(),s=!e.type||!n&&e.type.includes("html");let a=e.type||c;return s&&a?(n||(a=a.replace(/html/gi,"")),new Blob([e],{type:a})):e}case Jc.Json:return await o.json();case Jc.ArrayBuffer:return await o.arrayBuffer();default:return}}catch(e){return void console.warn(e)}}async function Yc(e,t,s){if(!jc)return!1;try{const n="string"==typeof s||s instanceof Blob||s instanceof ArrayBuffer?s:JSON.stringify(s),a=new Request(t.replace(/:/g,"_")),i=new Response(n);i.headers.set(Wc,Date.now().toString());const o=await jc.open(Qc(e));return await o.put(a,i),!0}catch(e){return console.warn(e),!1}}async function Zc(e,t){try{if(!jc)return;const s=await jc.open(Qc(e));return await s.delete(t)}catch(e){return void console.warn(e)}}async function eu(e){try{if(!jc)return;return await jc.delete(Qc(e))}catch(e){return void console.warn(e)}}async function tu(e){if(jc)try{for(const t of e){const e=await jc.open(Qc(t)),s=await e.keys(),n=Date.now();for(const t of s){await Oc();const s=await e.match(t);if(!s)continue;const a=Number(s.headers.get(Wc));a&&n-a>432e6&&await e.delete(t)}}}catch(e){console.warn(e)}}function su(){zc.forEach(e=>eu(e))}const nu=new Set(["sticker","wallpaper","photo","webDocument","document"]),au=new Set(["s","m","x","y","w","a","b","c","d"]),iu=new Set(["u","v"]);async function ou({url:e,mediaFormat:t,start:s,end:a,isHtmlAllowed:i},d,c){const{data:u,mimeType:l,fullSize:f}=await async function(e,t,s,n,a,i){const o=du(e);if(!o)return;const{entityType:r,entityId:d,sizeType:c,params:u,mediaMatchType:l}=o;if("staticMap"===r){const e=BigInt(d),s=new URLSearchParams(u),n=Number(s.get("long")),a=Number(s.get("lat")),i=Number(s.get("w")),o=Number(s.get("h")),r=Number(s.get("zoom")),c=Number(s.get("scale")),l=s.get("accuracy_radius"),f=l?Number(l):void 0;return{mimeType:"image/png",data:await t.downloadStaticMap(e,n,a,i,o,r,c,f)}}let f;switch(r){case"channel":case"chat":f=Js.chats[d];break;case"user":f=Js.users[d];break;case"sticker":case"wallpaper":case"document":f=Js.documents[d];break;case"photo":f=Js.photos[d];break;case"stickerSet":f=Js.stickerSets[d];break;case"webDocument":f=Js.webDocuments[d]}if(f){if(nu.has(r)){const e=f,o=await t.downloadMedia(e,{sizeType:c,start:n,end:a,progressCallback:s,workers:16});let r,d;return c&&au.has(c)?r="image/jpeg":c&&iu.has(c)?r="video/mp4":f instanceof Me.Photo?r="image/jpeg":f instanceof Me.WebDocument?(r=f.mimeType,d=f.size):f instanceof Me.Document&&(r=f.mimeType,d=rs(f.size)),!i&&r&&(r=r.replace(/html/gi,"")),{mimeType:r,data:o,fullSize:d}}if("stickerSet"===r){const e=await t.downloadStickerSetThumb(f);return{mimeType:e&&ru(e),data:e}}{const e=await t.downloadProfilePhoto(f,"profile"===l);return{mimeType:e&&ru(e),data:e}}}}(e,d,c,s,a,i)||{};if(!u)return;const g=function(e,t,s){if(e instanceof File)return e;switch(t){case Cs.BlobUrl:return new Blob([e],{type:s});case Cs.Text:return e.toString();case Cs.Progressive:case Cs.DownloadUrl:return e.buffer}}(u,t,l);if(!g)return;const p=t!==Cs.Progressive&&(t!==Cs.BlobUrl||g.size<=524288);return n&&p&&Yc(e.startsWith("avatar")?r:o,e,g),{dataBlob:t===Cs.Progressive?"":g,arrayBuffer:t===Cs.Progressive?g:void 0,mimeType:l,fullSize:f}}function ru(e,t="image/jpeg"){if(e.length<4)return t;let s=t;switch(e.subarray(0,4).reduce((e,t)=>e+t.toString(16),"")){case"89504e47":s="image/png";break;case"47494638":s="image/gif";break;case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":case"ffd8ffe3":case"ffd8ffe8":s="image/jpeg";break;case"52494646":s="image/webp"}return s}function du(e){const t=e.startsWith("staticMap")?e.match(/(staticMap):([0-9-]+)(\?.+)/):e.startsWith("webDocument")?e.match(/(webDocument):(.+)/):e.match(/(avatar|profile|photo|stickerSet|sticker|wallpaper|document)([-\d\w./]+)(?::\d+)?(\?size=\w+)?/);if(!t)return;const s=t[1],n=t[2];let a;const i=t[3],o=i?.replace("?size=","")||void 0;return a="avatar"===t[1]||"profile"===t[1]?Zs(n):t[1],{mediaMatchType:s,entityType:a,entityId:n,sizeType:o,params:i}}class cu extends AbortController{threads=new Map;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()}}gt.setLevel("warn");const uu={build:e=>e},lu=new Map,fu=new Map;let gu,pu;function hu({isPremium:e}){gu.setIsPremium(e)}async function mu(e=!1,t=!1){!e&&gu.isConnected()&&await Promise.race([Su(new Me.auth.LogOut),new Promise(e=>{setTimeout(()=>e(),2500)})]),t||(Object.assign($s,Ks()),Sc()),gu.destroy()}function yu(){gu.disconnect()}function _u(e){ja({"@type":"updateSession",sessionData:e})}function bu(e){ac(e),e instanceof Me.UpdatesTooLong?async function(){try{await Su(new Me.users.GetFullUser({id:new Me.InputUserSelf}),{shouldThrow:!0})}catch(e){"AUTH_KEY_UNREGISTERED"!==e.errorMessage&&"SESSION_REVOKED"!==e.errorMessage&&"USER_DEACTIVATED"!==e.errorMessage||ja({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}}():("updates"in e?e.updates:[e]).forEach(e=>{if(!(e instanceof Me.UpdateConfig))return;const t=e._entities?.find(e=>e instanceof Me.User&&va(e.id,"user")===pu);t instanceof Me.User&&hu({isPremium:Boolean(t.premium)})})}async function Su(e,t={}){const{shouldThrow:s,shouldIgnoreUpdates:n,dcId:a,shouldIgnoreErrors:i,abortControllerChatId:o,abortControllerThreadId:r,shouldRetryOnTimeout:d,abortControllerGroup:c}=t,u=Boolean(t.shouldReturnTrue);let l;if(o){let e=lu.get(o);e||(e=new cu,lu.set(o,e)),l=r?e.getThreadSignal(r):e.signal}if(c){let e=fu.get(c);e||(e=new AbortController,fu.set(c,e)),l=e.signal}try{const t=await gu.invoke(e,a,l,d);return kd(t),!n&&function(e){return e instanceof Me.UpdatesTooLong||e instanceof Me.UpdateShortMessage||e instanceof Me.UpdateShortChatMessage||e instanceof Me.UpdateShort||e instanceof Me.UpdatesCombined||e instanceof Me.Updates||e instanceof Me.UpdateShortSentMessage}(t)&&ac(t),u?t&&!0:t}catch(t){if(i)return;if((t instanceof Ae?t.errorMessage:t.message).includes("FROZEN_METHOD_INVALID")&&function(e,t){if(!(e instanceof Ae))return;const s=e.errorMessage;t instanceof Me.messages.GetPinnedDialogs||t instanceof Me.phone.GetGroupParticipants||t instanceof Me.channels.GetParticipant||t instanceof Me.channels.GetParticipants||t instanceof Me.messages.GetForumTopics||ja({"@type":"notSupportedInFrozenAccount",error:{message:s}})}(t,e),s)throw t;return void Ru(t,e)}}function wu(e,t){gu.invokeBeacon(e,t)}async function Iu(e,t){try{return await ou(e,gu,t)}catch(s){if(s instanceof Ae){if(s.errorMessage.startsWith("FILE_REFERENCE")&&await ku({url:e.url}))return ou(e,gu,t);if("FILE_ID_INVALID"===s.errorMessage&&e.url.includes("avatar"))return}throw s}}function vu(e,t){return gu.uploadFile({file:e,onProgress:t,workers:16})}function Pu(e){return gu.updateTwoFaSettings(e)}function Cu(e){const{chatId:t,threadId:s}=e,n=lu.get(t);if(!s)return n?.abort("Chat change"),void lu.delete(t);n?.abortThread(s,"Thread change")}function Mu(e){fu.get(e)?.abort(),fu.delete(e)}async function Au(){const e=await Su(new Me.users.GetFullUser({id:new Me.InputUserSelf}));if(!(e&&e.users[0]instanceof Me.User))return;const t=e.users[0];di(t);const s=to(e),n=no(t);var a;a=n.id,nd=a,function(e,t){ja({"@type":"updateCurrentUser",currentUser:e,currentUserFullInfo:t})}(n,s),pu=n.id,hu({isPremium:Boolean(n.isPremium)})}function Ru(e,t){const{message:s,code:n}=qa(e);ja({"@type":"error",error:{message:s,code:n,isSlowMode:e instanceof Te&&(t instanceof Me.messages.SendMessage||t instanceof Me.messages.SendMedia||t instanceof Me.messages.SendMultiMedia),hasErrorKey:!0}})}async function ku({url:e}){const t=du(e);if(!t)return;const{entityId:s,mediaMatchType:n}=t;if("document"===n||"photo"===n||"webDocument"===n){const e="document"===n?Js.documents[s]:"webDocument"===n?Js.webDocuments[s]:Js.photos[s];if(!e)return!1;const t=e;if(!t.localRepairInfo)return!1;const{localRepairInfo:a}=t;if("story"===a.type)return await async function(e,t){const s=rn(e);if(!s)return!1;const n=await Su(new Me.stories.GetStoriesByID({peer:s,id:[t]}),{shouldIgnoreErrors:!0});return!!n&&(n.stories.forEach(t=>{const s=bd(e,t);s&&!("isDeleted"in s)&&(ti(t,e),ja({"@type":"updateStory",peerId:e,story:s}))}),!0)}(a.peerId,a.id);if("message"===a.type){const e=await async function(e,t){const s=Zs(e),n=function(e){const t=Js.chats[e];if(t&&t instanceof Me.Channel)return nn(e,String(t.accessHash))}(e);let a;if(a="channel"===s&&n?await Su(new Me.channels.GetMessages({channel:n,id:[new Me.InputMessageID({id:t})]}),{shouldIgnoreErrors:!0}):await Su(new Me.messages.GetMessages({id:[new Me.InputMessageID({id:t})]}),{shouldIgnoreErrors:!0}),!a||a instanceof Me.messages.MessagesNotModified)return!1;n&&"pts"in a&&ic(e,a.pts);const i=a.messages[0];if(i instanceof Me.MessageEmpty)return!1;Td(i);const o=od(i);return o&&ja({"@type":"updateMessage",chatId:o.chatId,id:o.id,message:o}),!0}(a.peerId,a.id);return e}if("webPage"===a.type){const e=await async function(e){const t=await Su(new Me.messages.GetWebPage({url:e,hash:0}),{shouldIgnoreErrors:!0});if(!t?.webpage)return!1;const s=jr(t.webpage);return!!s&&(Za(t.webpage),ja({"@type":"updateWebPage",webPage:s}),"full"===s.webpageType)}(a.url);return e}}return!1}function Tu(e){gu.setForceHttpTransport(e)}function Bu(e){gu.setAllowHttpTransport(e)}function Du(e){gu.setShouldDebugExportedSenders(e)}function Uu(e){!function(e){lc(e,"gapRecovery",0)}(e)}function Eu(e){!function(e){const t=new Set(e);ec.forEach(e=>{t.has(e)||(uc(e).isShortpollEligible=!1,fc(e,"shortpoll"))}),e.forEach(e=>{const t=uc(e),s=ec.has(e);t.isShortpollEligible=!0,s||(void 0!==t.shortpollTimeoutMs?function(e){const t=Zd.get(e);t?.isShortpollEligible&&void 0!==t.shortpollTimeoutMs&&!t.isInFlight&&("shortpoll"===t.reason&&fc(e),lc(e,"shortpoll",t.shortpollTimeoutMs))}(e):lc(e,"shortpoll",1e4))}),ec.clear(),e.forEach(e=>{ec.add(e)})}(e)}async function xu({peer:e,reason:t,description:s=""}){return await Su(new Me.account.ReportPeer({peer:tn(e.id,e.accessHash),reason:vn(t),message:s}))}async function Vu({peer:e,photo:t,reason:s,description:n=""}){const a=yn(t);if(a)return await Su(new Me.account.ReportProfilePhoto({peer:tn(e.id,e.accessHash),photoId:a,reason:vn(s),message:n}))}async function Gu({hash:e,areCallsEnabled:t,areSecretChatsEnabled:s,isConfirmed:n}){return await Su(new Me.account.ChangeAuthorizationSettings({hash:BigInt(e),...void 0!==t?{callRequestsDisabled:!t}:void 0,...void 0!==s?{encryptedRequestsDisabled:!s}:void 0,...n&&{confirmed:n}}))}async function Fu({days:e}){return await Su(new Me.account.SetAuthorizationTTL({authorizationTtlDays:e}))}async function Nu({slug:e}){const t=await Su(new Me.account.ResolveBusinessChatLink({slug:e}),{shouldIgnoreErrors:!0});var s;if(t)return{chatLink:{chatId:Pa((s=t).peer),text:Br(s.message,s.entities)}}}function qu({enabled:e}){return Su(new Me.account.ToggleSponsoredMessages({enabled:e}),{shouldReturnTrue:!0})}function Hu(e){return{days:e.days}}function Lu(e){return new Me.AccountDaysTTL({days:e})}async function Ou(){const e=await Su(new Me.account.GetAccountTTL);if(e)return Hu(e)}function ju({days:e}){return Su(new Me.account.SetAccountTTL({ttl:Lu(e)}),{shouldReturnTrue:!0})}function Wu({tab:e}){return Su(new Me.account.SetMainProfileTab({tab:Hn(e)}),{shouldReturnTrue:!0})}const zu={uploadMaxFileparts:[4e3,8e3],stickersFaved:[5,10],savedGifs:[200,400],dialogFiltersChats:[100,200],dialogFilters:[10,20],dialogFolderPinned:[5,10],captionLength:[1024,4096],channels:[500,1e3],channelsPublic:[10,20],aboutLength:[70,140],chatlistInvites:[3,100],chatlistJoined:[2,20],recommendedChannels:[10,100],savedDialogsPinned:[5,100],maxReactions:[1,3],moreAccounts:[3,6],aiComposeToneSaved:[5,20]},Ku={hash:0,limits:{uploadMaxFileparts:zu.uploadMaxFileparts,stickersFaved:zu.stickersFaved,savedGifs:zu.savedGifs,dialogFiltersChats:zu.dialogFiltersChats,dialogFilters:zu.dialogFilters,dialogFolderPinned:zu.dialogFolderPinned,captionLength:zu.captionLength,channels:zu.channels,channelsPublic:zu.channelsPublic,aboutLength:zu.aboutLength,chatlistInvites:zu.chatlistInvites,chatlistJoined:zu.chatlistJoined,recommendedChannels:zu.recommendedChannels,savedDialogsPinned:zu.savedDialogsPinned,moreAccounts:zu.moreAccounts,maxReactions:zu.maxReactions,aiComposeToneSaved:zu.aiComposeToneSaved},autologinDomains:["instantview.telegram.org","translations.telegram.org","contest.dev","contest.com","bugs.telegram.org","suggestions.telegram.org","themes.telegram.org","promote.telegram.org","ads.telegram.org"],channelLevelMax:100,boostsPerSentGift:3,channelRestrictAdsLevelMin:50,seenByExpiresAt:604800,seenByMaxChatMembers:100,defaultEmojiStatusesStickerSetId:"773947703670341676",emojiSounds:{},giveawayAddPeersMax:10,giveawayBoostsPerPremium:4,giveawayCountriesMax:10,isGiveawayGiftsPurchaseAvailable:!1,groupTranscribeLevelMin:6,hiddenMembersMinCount:100,ignoreRestrictionReasons:[],canLimitNewMessagesWithoutPremium:!1,readDateExpiresAt:604800,premiumBotUsername:"PremiumBot",premiumPromoOrder:["stories","more_upload","double_limits","last_seen","voice_to_text","faster_download","translations","animated_emoji","emoji_status","saved_tags","profile_badge","message_privacy","advanced_chat_management","no_ads","infinite_reactions","animated_userpics","premium_stickers","effects","pm_noforwards"],isPremiumPurchaseBlocked:!1,maxUniqueReactions:11,starGiftMaxConvertPeriod:7776e3,starGiftMaxMessageLength:255,starRefStartPrefixes:["_tgr_"],isStarsGiftEnabled:!0,paidReactionMaxAmount:2500,starsUsdWithdrawRateX1000:1300,storyChangelogUserId:"777000",maxPinnedStoriesCount:3,starsSuggestedPostAmountMax:1e5,starsSuggestedPostAmountMin:5,starsSuggestedPostAgeMin:86400,starsSuggestedPostFutureMin:300,starsSuggestedPostFutureMax:2678400,starsSuggestedPostCommissionPermille:850,pollMaxAnswers:12,pollClosePeriodMax:2628e3,noForwardsRequestExpirePeriod:86400,tonSuggestedPostCommissionPermille:850,todoItemLengthMax:64,todoItemsMax:30,todoTitleLengthMax:32,tonSuggestedPostAmountMax:1e13,tonSuggestedPostAmountMin:1e7,tonTopupUrl:"https://fragment.com/ads/topup",storyViewersExpirePeriod:86400,topicsPinnedLimit:5,bandwidthPremiumDownloadSpeedup:10,bandwidthPremiumNotifyPeriod:3600,bandwidthPremiumUploadSpeedup:10,urlAuthDomains:["web.telegram.org","web.t.me","k.t.me","z.t.me","a.t.me"],webAppAllowedProtocols:["http","https"],whitelistedDomains:["telegram.dog","telegram.me","telegram.org","t.me","telesco.pe","fragment.com","translations.telegram.org"],typingDraftTtl:10,arePasskeysAvailable:!0,passkeysMaxCount:5,diceEmojies:[],diceEmojiesSuccess:{}},$u={};async function Ju(){const e=await Su(new Me.account.GetPassword);if(!e)return;const{hint:t,hasPassword:s}=e;return{hint:t,hasPassword:s}}function Qu(e){return ja({"@type":"updateTwoFaStateWaitCode",length:e}),new Promise((e,t)=>{$u.resolve=e,$u.reject=t})}function Xu(e,t){try{return function(e,t){return gu.getTmpPassword(e,t)}(e,t)}catch(e){if(!Na(e))return;return Promise.resolve(Ha(e))}}function Yu(e){try{return t=e,gu.getCurrentPassword(t)}catch(e){if(!Na(e))return;return Promise.resolve(Ha(e))}var t}async function Zu(e){try{return await Pu({isCheckPassword:!0,currentPassword:e}),!0}catch(e){return al(e),!1}}async function el(e){try{return await Pu({currentPassword:e}),!0}catch(e){return al(e),!1}}async function tl(e,t,s,n){try{return await Pu({currentPassword:e,newPassword:t,hint:s,email:n,emailCodeCallback:Qu,onEmailCodeError:al}),!0}catch(e){return al(e),!1}}async function sl(e,t){try{return await Pu({currentPassword:e,newPassword:e,email:t,emailCodeCallback:Qu,onEmailCodeError:al}),!0}catch(e){return al(e),!1}}function nl(e){$u.resolve(e)}function al(e){ja({"@type":"updateTwoFaError",messageKey:Ha(e).messageKey})}async function il({limit:e,offsetDate:t,offsetPeer:s,offsetId:n,archived:a,withPinned:i,lastLocalServiceMessageId:o}){const r=s&&tn(s.id,s.accessHash)||new Me.InputPeerEmpty,d=await Su(new Me.messages.GetDialogs({hash:0n,offsetPeer:r,offsetId:n??0,limit:e,offsetDate:t??0,folderId:a?1:void 0,...i&&{excludePinned:!0}})),c=i?await Su(new Me.messages.GetPinnedDialogs({folderId:a?1:0})):void 0;if(!d||d instanceof Me.messages.DialogsNotModified)return;const u=(c?c.messages:[]).concat(d.messages).map(od).filter(Boolean),l=af(d);c&&Object.assign(l,af(c,l));const f=[],g={},p={},h={},m=[],y=(c?.dialogs||[]).concat(d.dialogs),_=[],b={};y.forEach(e=>{if(!(e instanceof Me.Dialog)||!a&&1===e.folderId||a&&1!==e.folderId)return;const t=Io(e,l[Ro(e.peer)]);b[t.id]=e.topMessage;const s="channel"===Zs(t.id);e.pts&&s&&ic(t.id,e.pts),t.id===v&&o&&o>e.topMessage&&(b[t.id]=o),t.isListed=!0,f.push(t);const n=Ba(e.notifySettings);if(Object.values(Bs(n)).length&&(p[t.id]=n,n.mutedUntil&&jd(t.id,n.mutedUntil,ja)),i&&e.pinned&&_.push(t.id),e.draft){const s=dd(e.draft);s&&(g[t.id]=s)}const r=jo(e);h[t.id]=r;const d=Wo(t.id,e);m.push(d)});const S=f.map(e=>e.id),w=d.users.map(no).filter(Boolean),I=io((c?.users||[]).concat(d.users));let P;P=d instanceof Me.messages.DialogsSlice?d.count:S.length;const C=f[f.length-1],M=b[C?.id],A=M,R=C?.id,k=u.reverse().find(e=>e.chatId===C?.id&&e.id===M)?.date;return{chatIds:S,chats:f,users:w,userStatusesById:I,draftsById:g,orderedPinnedIds:i?_:void 0,totalChatCount:P,lastMessageByChatId:b,messages:u,notifyExceptionById:p,nextOffsetId:A,nextOffsetPeerId:R,nextOffsetDate:k,threadReadStatesById:h,threadInfos:m}}async function ol({parentPeer:e,limit:t,offsetDate:s,offsetPeer:n,offsetId:a,withPinned:i}){const o="title"in e?tn(e.id,e.accessHash):void 0,r=n&&tn(n.id,n.accessHash)||new Me.InputPeerEmpty,d=await Su(new Me.messages.GetSavedDialogs({offsetPeer:r,offsetId:a??0,parentPeer:o,limit:t,offsetDate:s??0,hash:0n,...i&&{excludePinned:!0}})),c=i?await Su(new Me.messages.GetPinnedSavedDialogs):void 0;if(!d||d instanceof Me.messages.SavedDialogsNotModified)return;const u=c&&!(c instanceof Me.messages.SavedDialogsNotModified),l=(u?c.messages:[]).concat(d.messages).map(od).filter(Boolean),f=af(d);u&&Object.assign(f,af(c,f));const g=(u?c.dialogs:[]).concat(d.dialogs),p=[],h=[],m={},y=[],_=[];g.forEach(t=>{if(t instanceof Me.MonoForumDialog)return;const s=function(e,t){const{peer:s}=e;return{id:Pa(s),type:Ao(t),title:ko(s,t),...wo(t)}}(t,f[Ro(t.peer)]),n=Pa(t.peer);p.push(n),i&&t.pinned&&h.push(n),m[n]=t.topMessage,_.push(s);const a=Wo(e.id,t);y.push(a)});const b=d.users.map(no).filter(Boolean),S=io((u?c.users:[]).concat(d.users));let w;w=d instanceof Me.messages.SavedDialogsSlice?d.count:p.length;const I=_[_.length-1],v=m[I?.id],P=v,C=I?.id,M=l.reverse().find(e=>e.chatId===I?.id&&e.id===v)?.date;return{chatIds:p,chats:_,users:b,userStatusesById:S,orderedPinnedIds:i?h:void 0,totalChatCount:w,lastMessageByChatId:m,messages:l,draftsById:{},notifyExceptionById:{},nextOffsetId:P,nextOffsetPeerId:C,nextOffsetDate:M,threadInfos:y}}const rl=new Map;async function dl(e){const{id:t}=e;if(rl.has(t))return rl.get(t);const s="channel"===Zs(e.id)?async function(e){const{id:t,adminRights:s,isMonoforum:n}=e,a=e.accessHash,i=await Su(new Me.channels.GetFullChannel({channel:nn(t,a)}));if(!(i&&i.fullChat instanceof Me.ChannelFull))return;const{about:o,onlineCount:r,exportedInvite:d,slowmodeSeconds:c,slowmodeNextSendDate:u,migratedFromChatId:l,migratedFromMaxId:f,canViewParticipants:g,canViewStats:p,linkedChatId:h,hiddenPrehistory:m,call:y,botInfo:_,availableReactions:b,reactionsLimit:S,defaultSendAs:w,requestsPending:I,recentRequesters:v,statsDc:P,participantsCount:C,stickerset:M,chatPhoto:A,participantsHidden:R,translationsDisabled:k,storiesPinnedAvailable:T,viewForumAsMessages:B,emojiset:D,boostsApplied:U,boostsUnrestrict:E,botVerification:x,canViewRevenue:V,paidReactionsAvailable:G,hasScheduled:F,stargiftsCount:N,stargiftsAvailable:q,paidMessagesAvailable:H,mainTab:L}=i.fullChat;A&&si(A);const O=d instanceof Me.ChatInviteExported?d.link:void 0,j=g&&!n,{members:W,userStatusesById:z}=j&&await $l({chat:e})||{},{members:K,userStatusesById:$}=j&&s&&await $l({chat:e,memberFilter:"kicked"})||{},{members:J,userStatusesById:Q}=j&&await $l({chat:e,memberFilter:"admin"})||{},X=_?Vo(_):void 0,Y=e.isNotJoined||"chatTypeChannel"!==e.type?void 0:await Jl({chat:e}),Z=Y?.member,ee=Z?.joinedDate?{joinedDate:Z.joinedDate,inviterId:Z.inviterId,isViaRequest:Z.isViaRequest}:void 0,te=i.chats.map(e=>Mo(e)).filter(Boolean);if(i?.chats?.length>1){const[,e]=i.chats,t=Mo(e);t&&ja({"@type":"updateChat",id:t.id,chat:t})}i.fullChat.pts&&ic(e.id,i.fullChat.pts);const se={...z,...$,...Q},ne=y instanceof Me.InputGroupCall?y:void 0;return{fullInfo:{...A instanceof Me.Photo&&{profilePhoto:pi(A)},about:o,onlineCount:r,inviteLink:O,slowMode:c?{seconds:c,nextSendDate:u}:void 0,migratedFrom:l?{chatId:va(l,"chat"),maxMessageId:f}:void 0,canViewMembers:j,canViewStatistics:p,canViewMonetization:V,isPreHistoryHidden:m,joinInfo:ee,members:W,kickedMembers:K,adminMembersById:J?Ms(J,"userId"):void 0,groupCallId:ne?String(ne.id):void 0,linkedChatId:h?va(h,"channel"):void 0,botCommands:X,enabledReactions:Fo(b),reactionsLimit:S,sendAsId:w?Pa(w):void 0,requestsPending:I,recentRequesterIds:v?.map(e=>va(e,"user")),statisticsDcId:P,stickerSet:M?xi(M):void 0,emojiSet:D?xi(D):void 0,areParticipantsHidden:R,isTranslationDisabled:k,hasPinnedStories:Boolean(T),boostsApplied:U,boostsToUnrestrict:E,botVerification:x&&Ta(x),isPaidReactionAvailable:G,hasScheduledMessages:F,starGiftCount:N,areStarGiftsAvailable:Boolean(q),arePaidMessagesAvailable:H,mainTab:L&&Da(L)},chats:te,userStatusesById:se,groupCall:ne?{chatId:t,isLoaded:!1,id:ne.id.toString(),accessHash:ne?.accessHash.toString(),participants:{},version:0,participantsCount:0,connectionState:"disconnected"}:void 0,membersCount:C,...B&&{isForumAsMessages:!0}}}(e):async function(e){const t=await Su(new Me.messages.GetFullChat({chatId:an(e)}));if(!(t&&t.fullChat instanceof Me.ChatFull))return;const{about:s,participants:n,exportedInvite:a,botInfo:i,call:o,availableReactions:r,recentRequesters:d,requestsPending:c,chatPhoto:u,translationsDisabled:l,reactionsLimit:f,hasScheduled:g}=t.fullChat;u&&si(u);const p=Do(n),h=p?p.filter(({isAdmin:e,isOwner:t})=>e||t):void 0,m=i?Vo(i):void 0,y=a instanceof Me.ChatInviteExported?a.link:void 0,_=io(t.users),b=t.chats.map(e=>Mo(e)).filter(Boolean),S=o instanceof Me.InputGroupCall?o:void 0;return{fullInfo:{...u instanceof Me.Photo&&{profilePhoto:pi(u)},about:s,members:p,adminMembersById:h?Ms(h,"userId"):void 0,canViewMembers:!0,botCommands:m,inviteLink:y,groupCallId:S?.id.toString(),enabledReactions:Fo(r),reactionsLimit:f,requestsPending:c,recentRequesterIds:d?.map(e=>va(e,"user")),isTranslationDisabled:l,isPreHistoryHidden:!0,hasScheduledMessages:g},chats:b,userStatusesById:_,groupCall:S?{chatId:e,isLoaded:!1,id:S.id.toString(),accessHash:S.accessHash.toString(),connectionState:"disconnected",participantsCount:0,version:0,participants:{}}:void 0,membersCount:p?.length}}(t);return rl.set(t,s),s.finally(()=>{rl.delete(t)}),s}async function cl(e){const{id:t,accessHash:s}=e,n=await Su(new Me.messages.GetPeerSettings({peer:tn(t,s)}),{abortControllerChatId:t});if(n)return{settings:so(n.settings)}}async function ul({query:e}){const t=await Su(new Me.contacts.Search({q:e,limit:20}));if(!t)return;const s=t.myResults.map(Pa),n=t.results.map(Pa).filter(e=>!s.includes(e));return{accountResultIds:s,globalResultIds:n}}async function ll({type:e,user:t}){let s;if("self"===e||"user"===e){const n=await Su(new Me.users.GetUsers({id:["user"===e&&t?sn(t.id,t.accessHash):new Me.InputUserSelf]}));if(!n||!n.length)return;[s]=n}else if("support"===e){const e=await Su(new Me.help.GetSupport);if(!e||!e.user)return;s=e.user}const n=Mo(s,"support"===e);if(n)return ja({"@type":"updateChat",id:n.id,chat:n}),{chatId:n.id}}async function fl({chat:e,lastLocalMessage:t,noLastMessage:s}){const{id:n,accessHash:a}=e,i=await Su(new Me.messages.GetPeerDialogs({peers:[new Me.InputDialogPeer({peer:tn(n,a)})]}));if(!i)return;const o=i.dialogs[0];if(!(o&&o instanceof Me.Dialog))return;const r=af(i)[Ro(o.peer)];if(!r)return;const d=od(i.messages[0]),c=t&&(!d||t.date>d.date)?t:d,u=Io(o,r),l="channel"===Zs(e.id);o.pts&&l&&ic(e.id,o.pts);const f=jo(o),g=Wo(e.id,o);ja({"@type":"updateThreadReadState",chatId:n,threadId:Ps,readState:f}),ja({"@type":"updateThreadInfo",threadInfo:g}),ja({"@type":"updateChat",id:n,chat:u}),!s&&c&&ja({"@type":"updateChatLastMessage",id:n,lastMessage:c}),nc(i.state);const p=Ba(o.notifySettings);p.mutedUntil&&jd(u.id,p.mutedUntil,ja)}function gl({chat:e,draft:t}){return Su(new Me.messages.SaveDraft({peer:tn(e.id,e.accessHash),message:t?.text?.text||Ys,entities:t?.text?.entities?.map(mn),replyTo:t?.replyInfo&&Vn(t.replyInfo),suggestedPost:t?.suggestedPostInfo&&Fn(t.suggestedPostInfo)}))}function pl({chat:e,settings:t}){Su(new Me.account.UpdateNotifySettings({peer:new Me.InputNotifyPeer({peer:tn(e.id,e.accessHash)}),settings:new Me.InputPeerNotifySettings({muteUntil:t.mutedUntil,showPreviews:t.shouldShowPreviews,silent:t.isSilentPosting})})),ja({"@type":"updateChatNotifySettings",chatId:e.id,settings:t}),fl({chat:e,noLastMessage:!0})}function hl({chat:e,topicId:t,mutedUntil:s}){Su(new Me.account.UpdateNotifySettings({peer:new Me.InputNotifyForumTopic({peer:tn(e.id,e.accessHash),topMsgId:t}),settings:new Me.InputPeerNotifySettings({muteUntil:s})})),ja({"@type":"updateTopicNotifySettings",chatId:e.id,topicId:t,settings:{mutedUntil:s}})}async function ml({title:e,about:t="",users:s,isBroadcast:n,isMegagroup:a}){const i=await Su(new Me.channels.CreateChannel({broadcast:n,title:e,about:t,megagroup:a}),{shouldThrow:!0});if(!(i instanceof Me.Updates))return;const o=i.chats[0];if(!(o&&o instanceof Me.Channel))return;const r=Mo(o);let d;if(s?.length){const e=await Su(new Me.channels.InviteToChannel({channel:nn(r.id,r.accessHash),users:s.map(({id:e,accessHash:t})=>sn(e,t))}));if(!e)return;bu(e.updates),d=e.missingInvitees.map(Ho)}return{channel:r,missingUsers:d}}function yl({channelId:e,accessHash:t}){return Su(new Me.channels.JoinChannel({channel:nn(e,t)}),{shouldReturnTrue:!0,shouldThrow:!0})}function _l({chat:e,user:t,shouldRevokeHistory:s}){if("chatTypeBasicGroup"===e.type)return Su(new Me.messages.DeleteChatUser({chatId:an(e.id),userId:sn(t.id,t.accessHash),revokeHistory:s||void 0}),{shouldReturnTrue:!0})}function bl({chatId:e}){return Su(new Me.messages.DeleteChat({chatId:an(e)}),{shouldReturnTrue:!0})}function Sl({chat:e}){return Su(new Me.channels.LeaveChannel({channel:nn(e.id,e.accessHash)}),{shouldReturnTrue:!0})}async function wl({chat:e}){const t=await Su(new Me.messages.GetFutureChatCreatorAfterLeave({peer:tn(e.id,e.accessHash)}));if(t)return no(t)}async function Il({chat:e,user:t}){try{return await Su(new Me.messages.EditChatCreator({peer:tn(e.id,e.accessHash),userId:sn(t.id,t.accessHash),password:new Me.InputCheckPasswordEmpty}),{shouldReturnTrue:!0,shouldThrow:!0}),{canTransfer:!0}}catch(e){if(!Na(e))return;return e instanceof Ae&&"PASSWORD_HASH_INVALID"===e.errorMessage?{canTransfer:!0}:e instanceof He?{errorMessage:"PASSWORD_TOO_FRESH"}:e instanceof Le?{errorMessage:"SESSION_TOO_FRESH"}:e instanceof Ae&&"PASSWORD_MISSING"===e.errorMessage?{errorMessage:"PASSWORD_MISSING"}:Ha(e)}}async function vl({chat:e,user:t,password:s}){try{const n=await Yu(s);if(!n)return;return"error"in n?n:Su(new Me.messages.EditChatCreator({peer:tn(e.id,e.accessHash),userId:sn(t.id,t.accessHash),password:n}),{shouldReturnTrue:!0,shouldThrow:!0})}catch(e){if(!Na(e))return;return Ha(e)}}function Pl({channelId:e,accessHash:t}){return Su(new Me.channels.DeleteChannel({channel:nn(e,t)}),{shouldReturnTrue:!0})}async function Cl({title:e,users:t}){const s=await Su(new Me.messages.CreateChat({title:e,users:t.map(({id:e,accessHash:t})=>sn(e,t))}));if(!s)return;bu(s.updates);const n=s.missingInvitees.map(Ho),a=s.updates.chats[0];return a&&a instanceof Me.Chat?{chat:Mo(a),missingUsers:n}:void 0}async function Ml({chatId:e,accessHash:t,photo:s}){const n=Zs(e);let a;if(s instanceof File){const e=await vu(s);a=new Me.InputChatUploadedPhoto({file:e})}else if(s){const e=yn(s);if(!e)return!1;a=new Me.InputChatPhoto({id:e})}else a=new Me.InputChatPhotoEmpty;return Su("channel"===n?new Me.channels.EditPhoto({channel:nn(e,t),photo:a}):new Me.messages.EditChatPhoto({chatId:an(e),photo:a}),{shouldReturnTrue:!0})}async function Al({chat:e,shouldBePinned:t}){const{id:s,accessHash:n}=e;await Su(new Me.messages.ToggleDialogPin({peer:new Me.InputDialogPeer({peer:tn(s,n)}),pinned:t||void 0}))&&ja({"@type":"updateChatPinned",id:e.id,isPinned:t})}async function Rl({chat:e,shouldBePinned:t}){const{id:s,accessHash:n}=e;await Su(new Me.messages.ToggleSavedDialogPin({peer:new Me.InputDialogPeer({peer:tn(s,n)}),pinned:t||void 0}))&&ja({"@type":"updateSavedDialogPinned",id:e.id,isPinned:t})}function kl({chat:e,folderId:t}){const{id:s,accessHash:n}=e;return Su(new Me.folders.EditPeerFolders({folderPeers:[new Me.InputFolderPeer({peer:tn(s,n),folderId:t})]}),{shouldReturnTrue:!0})}async function Tl(){const e=await Su(new Me.messages.GetDialogFilters);if(!e)return;const{filters:t,tagsEnabled:s}=e,n=t.findIndex(e=>e instanceof Me.DialogFilterDefault),a=t.filter(Va),i=a.map(({id:e})=>e);return-1!==n&&i.splice(n,0,0),{byId:Ms(a.map(Eo),"id"),orderedIds:i,areTagsEnabled:s}}async function Bl({listType:e}){const t=await Su(new Me.messages.GetPinnedDialogs({folderId:"archived"===e?1:0}));if(!t)return;const{dialogs:s,messages:n,chats:a,users:i}=t;return{dialogIds:s.map(e=>Pa(e.peer)),messages:n.map(e=>od(e)).filter(Boolean),chats:a.map(e=>Mo(e)).filter(Boolean),users:i.map(e=>no(e)).filter(Boolean)}}async function Dl(){const e=await Su(new Me.messages.GetSuggestedDialogFilters);if(e)return e.map(xo).filter(Boolean)}async function Ul({id:e,folderUpdate:t}){t.excludedChatIds=t.excludedChatIds.filter(e=>!t.includedChatIds.includes(e));const s=function(e){const{emoticon:t,contacts:s,nonContacts:n,groups:a,channels:i,bots:o,color:r,excludeArchived:d,excludeMuted:c,excludeRead:u,pinnedChatIds:l,includedChatIds:f,excludedChatIds:g,noTitleAnimations:p}=e,h=l?l.map(rn).filter(Boolean):[],m=f?f.map(rn).filter(Boolean):[],y=g?g.map(rn).filter(Boolean):[];return e.isChatList?new Me.DialogFilterChatlist({id:e.id,title:En(e.title),color:r,emoticon:t||void 0,pinnedPeers:h,includePeers:m,hasMyInvites:e.hasMyInvites,titleNoanimate:p}):new Me.DialogFilter({id:e.id,title:En(e.title),emoticon:t||void 0,contacts:s||void 0,nonContacts:n||void 0,groups:a||void 0,bots:o||void 0,color:r,excludeArchived:d||void 0,excludeMuted:c||void 0,excludeRead:u||void 0,broadcasts:i||void 0,pinnedPeers:h,includePeers:m,excludePeers:y,titleNoanimate:p})}(t);await Su(new Me.messages.UpdateDialogFilter({id:e,filter:s}))&&ja({"@type":"updateChatFolder",id:e,folder:t})}async function El(e){const t=await Su(new Me.messages.UpdateDialogFilter({id:e,filter:void 0})),s=await Dl();t&&ja({"@type":"updateChatFolder",id:e,folder:void 0}),s&&ja({"@type":"updateRecommendedChatFolders",folders:s})}function xl(e){return Su(new Me.messages.UpdateDialogFiltersOrder({order:e}))}function Vl(e){return Su(new Me.messages.ToggleDialogFilterTags({enabled:e}))}async function Gl({chat:e,hasUnreadMark:t}){const{id:s,accessHash:n}=e;await Su(new Me.messages.MarkDialogUnread({peer:new Me.InputDialogPeer({peer:tn(s,n)}),unread:t}))&&ja({"@type":"updateThreadReadState",chatId:e.id,threadId:Ps,readState:{hasUnreadMark:t}})}async function Fl(e){return ql(await Su(new Me.contacts.ResolvePhone({phone:e})))}async function Nl(e,t){return ql(await Su(new Me.contacts.ResolveUsername({username:e,referer:t})))}function ql(e){if(!e)return;const{users:t,chats:s}=e,n=s.length?Mo(s[0]):Mo(t[0]);return n?{chat:n,user:no(t[0])}:void 0}function Hl({chat:e,isEnabled:t}){const{id:s,accessHash:n}=e,a=nn(s,n);return Su(new Me.channels.TogglePreHistoryHidden({channel:a,enabled:t}),{shouldReturnTrue:!0})}function Ll({chat:e,bannedRights:t}){const{id:s,accessHash:n}=e,a=tn(s,n);return Su(new Me.messages.EditChatDefaultBannedRights({peer:a,bannedRights:bn(t)}),{shouldReturnTrue:!0})}function Ol({chat:e,user:t,bannedRights:s,untilDate:n}){const a=nn(e.id,e.accessHash),i=tn(t.id,t.accessHash);return Su(new Me.channels.EditBanned({channel:a,participant:i,bannedRights:bn(s,n)}),{shouldReturnTrue:!0})}function jl({chat:e,user:t,adminRights:s,rank:n}){const a=nn(e.id,e.accessHash),i=sn(t.id,t.accessHash);return Su(new Me.channels.EditAdmin({channel:a,userId:i,adminRights:Sn(s),rank:n}),{shouldReturnTrue:!0})}async function Wl(e,t){const s=Zs(e.id);await Su("channel"===s?new Me.channels.EditTitle({channel:nn(e.id,e.accessHash),title:t}):new Me.messages.EditChatTitle({chatId:an(e.id),title:t}),{shouldReturnTrue:!0})}async function zl(e,t){await Su(new Me.messages.EditChatAbout({peer:tn(e.id,e.accessHash),about:t}))&&ja({"@type":"updateChatFullInfo",id:e.id,fullInfo:{about:t}})}function Kl({chat:e,areSignaturesEnabled:t,areProfilesEnabled:s}){const{id:n,accessHash:a}=e,i=nn(n,a);return Su(new Me.channels.ToggleSignatures({channel:i,signaturesEnabled:t||void 0,profilesEnabled:s||void 0}),{shouldReturnTrue:!0})}async function $l({chat:e,memberFilter:t="recent",offset:s,query:n=""}){let a;switch(t){case"kicked":a=new Me.ChannelParticipantsKicked({q:n});break;case"admin":a=new Me.ChannelParticipantsAdmins;break;case"search":a=new Me.ChannelParticipantsSearch({q:n});break;default:a=new Me.ChannelParticipantsRecent}const i=await Su(new Me.channels.GetParticipants({channel:nn(e.id,e.accessHash),filter:a,offset:s??0,hash:0n,limit:200}),{abortControllerChatId:e.id});if(!i||i instanceof Me.channels.ChannelParticipantsNotModified)return;const o=io(i.users);return{members:Do(i),userStatusesById:o}}async function Jl({chat:e,peer:t}){const s=t?tn(t.id,t.accessHash):new Me.InputPeerSelf,n=await Su(new Me.channels.GetParticipant({channel:nn(e.id,e.accessHash),participant:s}),{abortControllerChatId:e.id});if(!n)return;const a=io(n.users),i=Bo(n.participant);return i?{member:i,userStatusesById:a}:void 0}async function Ql(){const e=await Su(new Me.channels.GetGroupsForDiscussion);if(e)return e.chats.map(e=>Mo(e))}function Xl({channel:e,chat:t}){return Su(new Me.channels.SetDiscussionGroup({broadcast:nn(e.id,e.accessHash),group:t?nn(t.id,t.accessHash):new Me.InputChannelEmpty}),{shouldReturnTrue:!0})}async function Yl(e){const t=await Su(new Me.messages.MigrateChat({chatId:an(e.id)}),{shouldThrow:!0});if(!(t&&t instanceof Me.Updates))return;const s=t.updates.find(e=>e instanceof Me.UpdateChannel).channelId;return Mo(t.chats.find(e=>e instanceof Me.Channel&&e.id.toString()===s.toString()))}async function Zl(e){const t=await Su(new Me.messages.CheckChatInvite({hash:e}));if(!t)return;if(t instanceof Me.ChatInvite)return{chat:void 0,invite:Lo(t),users:t.participants?.map(no).filter(Boolean)};const s=Mo(t.chat);return s?{chat:s,invite:void 0,users:void 0}:void 0}async function ef(e,t){try{if("chatTypeChannel"===e.type||"chatTypeSuperGroup"===e.type){const s=await Su(new Me.channels.InviteToChannel({channel:nn(e.id,e.accessHash),users:t.map(e=>sn(e.id,e.accessHash))}));if(!s)return;return bu(s.updates),s.missingInvitees.map(Ho)}const s=await Promise.all(t.map(async t=>{const s=await Su(new Me.messages.AddChatUser({chatId:an(e.id),userId:sn(t.id,t.accessHash),fwdLimit:0}));if(s)return bu(s.updates),s.missingInvitees.map(Ho)}));if(s)return s.flat().filter(Boolean)}catch(e){ja({"@type":"error",error:qa(e)})}}function tf(e,t){return Su(new Me.messages.DeleteChatUser({chatId:an(e.id),userId:sn(t.id,t.accessHash)}),{shouldReturnTrue:!0})}function sf(e,t){return Su(new Me.channels.ToggleJoinToSend({channel:nn(e.id,e.accessHash),enabled:t}),{shouldReturnTrue:!0})}function nf(e,t){return Su(new Me.channels.ToggleJoinRequest({channel:nn(e.id,e.accessHash),enabled:t}),{shouldReturnTrue:!0})}function af(e,t){const s={};return e.chats?.forEach(e=>{const n=`chat${e.id.toString()}`;t?.[n]&&"min"in e&&e.min||(s[n]=e)}),e.users?.forEach(e=>{const n=`user${e.id.toString()}`;t?.[n]&&"min"in e&&e.min||(s[n]=e)}),s}async function of({hash:e}){const t=await Su(new Me.messages.ImportChatInvite({hash:e}));if(t instanceof Me.Updates&&t.chats.length)return Mo(t.chats[0])}function rf({chat:e,enabledReactions:t,reactionsLimit:s}){return Su(new Me.messages.SetChatAvailableReactions({peer:tn(e.id,e.accessHash),availableReactions:(n=t,"all"===n?.type?new Me.ChatReactionsAll({allowCustom:n.areCustomAllowed}):"some"===n?.type?new Me.ChatReactionsSome({reactions:n.allowed.map(Bn)}):new Me.ChatReactionsNone),reactionsLimit:s}),{shouldReturnTrue:!0});var n}function df({chat:e,isProtected:t}){const{id:s,accessHash:n}=e;return Su(new Me.messages.ToggleNoForwards({peer:tn(s,n),enabled:t}),{shouldReturnTrue:!0})}function cf({chat:e,isEnabled:t}){const{id:s,accessHash:n}=e;return Su(new Me.channels.ToggleParticipantsHidden({channel:nn(s,n),enabled:t}),{shouldReturnTrue:!0})}function uf({chat:e,isEnabled:t}){const{id:s,accessHash:n}=e;return Su(new Me.channels.ToggleForum({channel:nn(s,n),enabled:t,tabs:Boolean(e.withForumTabs)}),{shouldReturnTrue:!0,shouldThrow:!0})}async function lf({slug:e}){const t=await Su(new Me.chatlists.CheckChatlistInvite({slug:e})),s=function(e,t){return e instanceof Me.chatlists.ChatlistInvite?{slug:t,title:Si(e.title),noTitleAnimations:e.titleNoanimate,emoticon:e.emoticon,peerIds:e.peers.map(Pa).filter(Boolean)}:e instanceof Me.chatlists.ChatlistInviteAlready?{slug:t,folderId:e.filterId,missingPeerIds:e.missingPeers.map(Pa).filter(Boolean),alreadyPeerIds:e.alreadyPeers.map(Pa).filter(Boolean)}:void 0}(t,e);if(t&&s)return{invite:s}}function ff({slug:e,peers:t}){return Su(new Me.chatlists.JoinChatlistInvite({slug:e,peers:t.map(e=>tn(e.id,e.accessHash))}),{shouldReturnTrue:!0,shouldThrow:!0})}async function gf({folderId:e}){const t=await Su(new Me.chatlists.GetLeaveChatlistSuggestions({chatlist:new Me.InputChatlistDialogFilter({filterId:e})}));if(t)return t.map(Pa)}function pf({folderId:e,peers:t}){return Su(new Me.chatlists.LeaveChatlist({chatlist:new Me.InputChatlistDialogFilter({filterId:e}),peers:t.map(e=>tn(e.id,e.accessHash))}),{shouldReturnTrue:!0})}async function hf({folderId:e,title:t="",peers:s}){const n=await Su(new Me.chatlists.ExportChatlistInvite({chatlist:new Me.InputChatlistDialogFilter({filterId:e}),title:t,peers:s.map(e=>tn(e.id,e.accessHash))}),{shouldThrow:!0});if(n&&!(n.filter instanceof Me.DialogFilterDefault))return{filter:Eo(n.filter),invite:qo(n.invite)}}function mf({folderId:e,slug:t}){return Su(new Me.chatlists.DeleteExportedInvite({chatlist:new Me.InputChatlistDialogFilter({filterId:e}),slug:t}))}async function yf({folderId:e,slug:t,title:s,peers:n}){const a=await Su(new Me.chatlists.EditExportedInvite({chatlist:new Me.InputChatlistDialogFilter({filterId:e}),slug:t,title:s,peers:n.map(e=>tn(e.id,e.accessHash))}),{shouldThrow:!0});if(a)return qo(a)}async function _f({folderId:e}){const t=await Su(new Me.chatlists.GetExportedInvites({chatlist:new Me.InputChatlistDialogFilter({filterId:e})}));if(t)return{invites:t.invites.map(qo).filter(Boolean)}}function bf({chat:e,isEnabled:t}){return Su(new Me.messages.TogglePeerTranslations({disabled:!t||void 0,peer:tn(e.id,e.accessHash)}))}function Sf({chat:e,isEnabled:t}){const{id:s,accessHash:n}=e,a=nn(s,n);return Su(new Me.channels.ToggleViewForumAsMessages({channel:a,enabled:Boolean(t)}),{shouldReturnTrue:!0})}async function wf({chat:e}){const t=await Su(new Me.channels.GetChannelRecommendations({channel:e&&nn(e.id,e.accessHash)}));if(!t)return;const s=t?.chats.map(e=>Mo(e)).filter(Boolean);return{similarChannels:s,count:t instanceof Me.messages.ChatsSlice?t.count:s.length}}function If({chat:e,paidMessagesStars:t}){return Su(new Me.channels.UpdatePaidMessagesPrice({channel:e?nn(e.id,e.accessHash):new Me.InputChannelEmpty,sendPaidMessagesStars:BigInt(t)}),{shouldReturnTrue:!0})}async function vf({query:e}){const t=await Su(new Me.contacts.GetSponsoredPeers({q:e}));if(t&&!(t instanceof Me.contacts.SponsoredPeersEmpty))return function(e){const{peer:t,randomId:s,additionalInfo:n,sponsorInfo:a}=e;return{peerId:Pa(t),randomId:Ga(s),additionalInfo:n,sponsorInfo:a}}(t.peers[0])}function Pf({chat:e,isEnabled:t}){return Su(new Me.channels.ToggleAutotranslation({channel:nn(e.id,e.accessHash),enabled:t}),{shouldReturnTrue:!0})}function Cf({chat:e,tab:t}){return Su(new Me.channels.SetMainProfileTab({channel:nn(e.id,e.accessHash),tab:Hn(t)}),{shouldReturnTrue:!0})}function Mf(e){if(e instanceof Me.ForumTopicDeleted)return;const t=function(e){if(e instanceof Me.ForumTopicDeleted)return;const{id:t,my:s,closed:n,pinned:a,hidden:i,short:o,date:r,title:d,iconColor:c,iconEmojiId:u,fromId:l,notifySettings:f,titleMissing:g}=e;return{id:t,isClosed:n,isPinned:a,isHidden:i,isOwner:s,isMin:o,date:r,title:d,iconColor:c,iconEmojiId:u?.toString(),fromId:Pa(l),notifySettings:Ba(f),isTitleMissing:g}}(e);if(!t)return;const s=t.isMin;return{topic:t,readState:s?void 0:jo(e),lastMessageId:s?void 0:e.topMessage}}var Af=s(48287).hp;async function Rf({chat:e,threadId:t,offsetId:s,isSavedDialog:n,addOffset:a,limit:i}){const o=t===Ps?Me.messages.GetHistory:n?Me.messages.GetSavedHistory:Me.messages.GetReplies,r="channel"===Zs(e.id);let c;try{c=await Su(new o({hash:0n,maxId:0,minId:0,offsetDate:0,peer:tn(e.id,e.accessHash),...t!==Ps&&!n&&{msgId:Number(t)},offsetId:s?Math.min(s,d):0,addOffset:a??0,limit:i}),{shouldThrow:!0,abortControllerChatId:e.id,abortControllerThreadId:t})}catch(t){"CHANNEL_PRIVATE"===t.errorMessage&&ja({"@type":"updateChat",id:e.id,chat:{isRestricted:!0}})}if(!c||c instanceof Me.messages.MessagesNotModified||!c.messages)return;r&&"pts"in c&&ic(e.id,c.pts);const u=c.messages.map(od).filter(Boolean);return{messages:u,users:c.users.map(no).filter(Boolean),chats:c.chats.map(e=>Mo(e)).filter(Boolean),count:"count"in c?c.count:u.length,topics:c.topics.map(Mf).filter(Boolean)}}async function kf({chat:e,messageId:t}){const s="channel"===Zs(e.id);let n;try{n=await Su(s?new Me.channels.GetMessages({channel:nn(e.id,e.accessHash),id:[new Me.InputMessageID({id:t})]}):new Me.messages.GetMessages({id:[new Me.InputMessageID({id:t})]}),{shouldThrow:!0,abortControllerChatId:e.id})}catch(e){const{message:t,code:s}=qa(e);"CHANNEL_PRIVATE"!==t&&ja({"@type":"error",error:{message:t,code:s,isSlowMode:!1,hasErrorKey:!0}})}if(!n||n instanceof Me.messages.MessagesNotModified)return;s&&"pts"in n&&ic(e.id,n.pts);const a=n.messages[0];if(!a)return;if(a instanceof Me.MessageEmpty)return"MESSAGE_DELETED";Td(a);const i=od(a);return i?{message:i}:void 0}async function Tf({chat:e,messageIds:t}){const s="channel"===Zs(e.id),n=await Su(s?new Me.channels.GetMessages({channel:nn(e.id,e.accessHash),id:t.map(e=>new Me.InputMessageID({id:e}))}):new Me.messages.GetMessages({id:t.map(e=>new Me.InputMessageID({id:e}))}),{shouldThrow:!0});if(n&&!(n instanceof Me.messages.MessagesNotModified))return n.messages.map(od).filter(Boolean)}let Bf=Promise.resolve();function Df(e){const{chat:t,lastMessageId:s,text:n,entities:a,replyInfo:i,suggestedPostInfo:o,attachment:r,sticker:d,story:c,gif:u,poll:l,todo:f,contact:g,scheduledAt:p,scheduleRepeatPeriod:h,groupedId:m,sendAs:y,wasDrafted:_,isInvertedMedia:b,effectId:S,isPending:w,messagePriceInStars:I,dice:v}=e;if(!t)return;const{message:P,poll:C}=function({chat:e,lastMessageId:t,text:s,entities:n,replyInfo:a,suggestedPostInfo:i,attachment:o,sticker:r,gif:d,poll:c,todo:u,contact:l,groupedId:f,scheduledAt:g,scheduleRepeatPeriod:p,sendAs:h,story:m,isInvertedMedia:y,effectId:_,isPending:b,messagePriceInStars:S,dice:w}){const I=id(t),v=o&&fd(o),P="chatTypeChannel"===e.type,C=a&&(D=a,U=e.isForum,"story"===D.type?{type:"story",peerId:D.peerId,storyId:D.storyId}:{type:"message",replyToMsgId:D.replyToMsgId,replyToTopId:D.replyToTopId,replyToPeerId:D.replyToPeerId,quoteText:D.quoteText,quoteOffset:D.quoteOffset,isForumTopic:!(!U||!D.replyToTopId)||void 0,...Boolean(D.quoteText)&&{isQuote:!0}}),M=c&&function(e){const t=e.correctAnswers?.length?e.summary.answers.reduce((t,s,n)=>{const a=e.correctAnswers?.includes(n);return t[s.option]={option:s.option,votersCount:0,isCorrect:!!a||void 0},t},{}):void 0;return{mediaType:"poll",summary:e.summary,results:{resultByOption:t,solution:e.solution,solutionEntities:e.solutionEntities,solutionMedia:e.solutionMedia?fd(e.solutionMedia):void 0},attachedMedia:e.attachedMedia?fd(e.attachedMedia):void 0}}(c),A=u&&function(e){return{mediaType:"todo",todo:e.todo}}(u),R=w?{mediaType:"dice",value:-1,emoticon:w}:void 0,k=s&&!w?Xa({text:s,entities:n,emojiOnlyCount:void 0}):void 0,T={id:I,chatId:e.id,content:Bs({text:k,...v,sticker:r,video:d||v?.video,contact:l,storyData:m&&{mediaType:"storyData",...m},pollId:M?.summary.id,todo:A,dice:R}),date:g||Is(),isOutgoing:!P,senderId:"chatTypePrivate"!==e.type?h?.id||nd:void 0,replyInfo:C,suggestedPostInfo:i,...f&&{groupedId:f,...v&&(v.photo||v.video)&&{isInAlbum:!0}},...g&&{isScheduled:!0},scheduleRepeatPeriod:p,isForwardingAllowed:!0,isInvertedMedia:y,effectId:_,...b&&{sendingState:"messageSendingStatePending"},...S&&{paidMessageStars:S}},B=Yr(T.content,T.groupedId);var D,U;return B&&T.content.text&&(T.content.text.emojiOnlyCount=B),{message:T,poll:M}}({chat:t,lastMessageId:s,text:n,entities:a,replyInfo:i,suggestedPostInfo:o,attachment:r,sticker:d,gif:u,poll:l,todo:f,contact:g,groupedId:m,scheduledAt:p,scheduleRepeatPeriod:h,sendAs:y,story:c,isInvertedMedia:b,effectId:S,isPending:w,messagePriceInStars:I,dice:v});return ja({"@type":P.isScheduled?"newScheduledMessage":"newMessage",id:P.id,chatId:t.id,message:P,poll:C,wasDrafted:_}),Promise.resolve(P)}function Uf(e,t,s){const{chat:n,text:a,entities:i,replyInfo:o,suggestedPostInfo:r,suggestedMedia:d,attachment:c,sticker:u,story:l,gif:f,poll:g,todo:p,contact:h,dice:m,isSilent:y,scheduledAt:_,scheduleRepeatPeriod:b,groupedId:S,noWebPage:w,sendAs:I,shouldUpdateStickerSetOrder:v,isInvertedMedia:P,effectId:C,webPageMediaSize:M,webPageUrl:A,messagePriceInStars:R}=e;if(!n)return;let k=!1;const T=setTimeout(()=>{k||ja({"@type":t.isScheduled?"updateScheduledMessage":"updateMessage",id:t.id,chatId:n.id,message:{sendingState:"messageSendingStatePending"},isFull:!1})},1e3),B=()=>{k=!0,clearTimeout(T)},D=z();if(S)return function({chat:e,text:t="",entities:s,replyInfo:n,suggestedPostInfo:a,attachment:i,groupedId:o,isSilent:r,scheduledAt:d,scheduleRepeatPeriod:c,sendAs:u,messagePriceInStars:l},f,g,p,h){let m=-1;xf[o]||(xf[o]={counter:0,singleMediaByIndex:{},localMessages:{},cancelSendingStatusTimeouts:{}}),m=xf[o].counter++;const y=Bf;return Bf=(async()=>{let _;if(i.gif)_=un(i.gif,i.shouldSendAsSpoiler);else{let t;try{t=await qf(g,i,p)}catch(e){return xf[o].counter--,void await y}_=await async function(e,t){const s=await Su(new Me.messages.UploadMedia({peer:e,media:t})),n=t.spoiler;if(s instanceof Me.MessageMediaPhoto&&s.photo&&s.photo instanceof Me.Photo){const{photo:{id:e,accessHash:t,fileReference:a}}=s;return new Me.InputMediaPhoto({id:new Me.InputPhoto({id:e,accessHash:t,fileReference:a}),spoiler:n})}if(s instanceof Me.MessageMediaDocument&&s.document&&s.document instanceof Me.Document){const{document:{id:e,accessHash:t,fileReference:a}}=s;return new Me.InputMediaDocument({id:new Me.InputDocument({id:e,accessHash:t,fileReference:a}),spoiler:n})}}(tn(e.id,e.accessHash),t)}if(await y,!_)return void xf[o].counter--;if(xf[o].singleMediaByIndex[m]=new Me.InputSingleMedia({media:_,randomId:f,message:t,entities:s?s.map(mn):void 0}),xf[o].localMessages[f.toString()]=g,xf[o].cancelSendingStatusTimeouts[f.toString()]=h,Object.keys(xf[o].singleMediaByIndex).length<xf[o].counter)return;const{singleMediaByIndex:b,localMessages:S,cancelSendingStatusTimeouts:w}=xf[o];delete xf[o];const I=Object.values(b).length,v=await Su(new Me.messages.SendMultiMedia({clearDraft:!0,peer:tn(e.id,e.accessHash),multiMedia:Object.values(b),replyTo:n&&Vn(n),...r&&{silent:r},...d&&{scheduleDate:d},...c&&{scheduleRepeatPeriod:c},...u&&{sendAs:tn(u.id,u.accessHash)},...l&&{allowPaidStars:BigInt(l*I)},...a&&{suggestedPost:Fn(a)}}),{shouldIgnoreUpdates:!0});v&&(Object.values(w).forEach(e=>e()),qg(S,v))})(),Bf}({chat:n,text:a,entities:i,replyInfo:o,suggestedPostInfo:r,attachment:c,groupedId:S,isSilent:y,scheduledAt:_,scheduleRepeatPeriod:b,messagePriceInStars:R},D,t,s,B);const U=(async()=>{let e;if(r&&d&&!c)if(d.photo){const t=yn(d.photo);t&&(e=new Me.InputMediaPhoto({id:t,spoiler:d.photo.isSpoiler||void 0}))}else if(d.video){const t=cn(d.video);t&&(e=new Me.InputMediaDocument({id:t,spoiler:d.video.isSpoiler||void 0}))}else if(d.document){const t=d.document;if(t.id){const s=Js.documents[t.id];if(s){const t=new Me.InputDocument({id:s.id,accessHash:s.accessHash,fileReference:s.fileReference});e=new Me.InputMediaDocument({id:t})}}}if(!e&&c?.gif&&(e=un(c.gif,c.shouldSendAsSpoiler)),!e&&c)try{e=await qf(t,c,s)}catch(e){return void await Bf}else if(u)e=un(u);else if(f)e=un(f);else if(g)try{const n=g.attachedMedia?await qf(t,g.attachedMedia,s):void 0,a=g.solutionMedia?await qf(t,g.solutionMedia,s):void 0;e=function(e,t,s){const{summary:n,correctAnswers:a,solution:i,solutionEntities:o}=e,r=new Me.Poll({id:t,publicVoters:n.isPublic,question:En(n.question),answers:n.answers.map(({text:e,option:t})=>new Me.PollAnswer({text:En(e),option:Fa(t)})),quiz:n.isQuiz,closeDate:n.closeDate,closePeriod:n.closePeriod,hideResultsUntilClose:n.shouldHideResultsUntilClose,revotingDisabled:n.isRevoteDisabled,shuffleAnswers:n.shouldShuffleAnswers,openAnswers:n.canAddAnswers,multipleChoice:n.isMultipleChoice,hash:0n}),d=o?.map(mn)||[];return new Me.InputMediaPoll({poll:r,correctAnswers:a,attachedMedia:s?.attachedMedia,solution:i,solutionEntities:i?d:void 0,solutionMedia:s?.solutionMedia})}(g,D,{attachedMedia:n,solutionMedia:a})}catch(e){return void await Bf}else p?e=gn(p):l?e=function(e){const t=rn(e.peerId);return new Me.InputMediaStory({peer:t,id:e.id})}(l):A&&M?e=new Me.InputMediaWebPage({url:A,forceLargeMedia:"large"===M||void 0,forceSmallMedia:"small"===M||void 0}):h?e=new Me.InputMediaContact({phoneNumber:h.phoneNumber,firstName:h.firstName,lastName:h.lastName,vcard:Ys}):m&&(e=new Me.InputMediaDice({emoticon:m}));const S={clearDraft:!0,message:a||Ys,entities:i?i.map(mn):void 0,peer:tn(n.id,n.accessHash),randomId:D,replyTo:o&&Vn(o),silent:y||void 0,scheduleDate:_,scheduleRepeatPeriod:b,sendAs:I&&tn(I.id,I.accessHash),updateStickersetsOrder:v||void 0,invertMedia:P||void 0,effect:C?BigInt(C):void 0,allowPaidStars:R?BigInt(R):void 0,suggestedPost:r&&Fn(r)};try{let s;s=e?await Su(new Me.messages.SendMedia({...S,media:e}),{shouldThrow:!0,shouldIgnoreUpdates:!0}):await Su(new Me.messages.SendMessage({...S,noWebpage:w||void 0}),{shouldThrow:!0,shouldIgnoreUpdates:!0}),B(),s&&Hg(t,s)}catch(e){B(),"PRIVACY_PREMIUM_REQUIRED"===e.errorMessage&&ja({"@type":"updateRequestUserUpdate",id:n.id}),ja({"@type":t.isScheduled?"updateScheduledMessageSendFailed":"updateMessageSendFailed",chatId:n.id,localId:t.id,error:e.errorMessage})}})();return U}async function Ef(e,t){const s=e.localMessage||await Df(e);return s?Uf(e,s,t):void 0}const xf={};async function Vf({chat:e,message:t,text:s,entities:n,attachment:a,noWebPage:i},o){const r=1e3*t.date>1e3*Is(),d=a&&fd(a),c=s&&!a?.shouldSendAsFile?t.isInvertedMedia:void 0,u={...d||t.content,...s&&{text:{text:s,entities:n}}},l={...t,content:u,isInvertedMedia:c};ja({"@type":r?"updateScheduledMessage":"updateMessage",id:t.id,chatId:e.id,message:l,isFull:!0});try{let d;a&&(d=await qf(t,a,o));const u=n&&n.map(mn);await Su(new Me.messages.EditMessage({message:s,entities:u,media:d,peer:tn(e.id,e.accessHash),id:t.id,...r&&{scheduleDate:t.date},...t.scheduleRepeatPeriod&&{scheduleRepeatPeriod:t.scheduleRepeatPeriod},...i&&{noWebpage:i},...c&&{invertMedia:c}}),{shouldThrow:!0})}catch(s){ja({"@type":"error",error:{...qa(s),hasErrorKey:!0}}),ja({"@type":r?"updateScheduledMessage":"updateMessage",id:t.id,chatId:e.id,message:t,isFull:!0})}}async function Gf({chat:e,message:t,todo:s}){const n=gn(s),a=1e3*t.date>1e3*Is(),i={...t.content,todo:{mediaType:"todo",todo:s.todo}},o={...t,content:i};ja({"@type":a?"updateScheduledMessage":"updateMessage",id:t.id,chatId:e.id,message:o,isFull:!0});try{await Su(new Me.messages.EditMessage({media:n,peer:tn(e.id,e.accessHash),id:t.id}),{shouldThrow:!0})}catch(s){ja({"@type":"error",error:{...qa(s),hasErrorKey:!0}}),ja({"@type":"updateMessage",id:t.id,chatId:e.id,message:t,isFull:!0})}}async function Ff({chat:e,message:t,items:s}){const n=s.map(e=>new Me.TodoItem({id:e.id,title:En(e.title)}));try{await Su(new Me.messages.AppendTodoList({peer:tn(e.id,e.accessHash),msgId:t.id,list:n}),{shouldThrow:!0})}catch(e){ja({"@type":"error",error:{...qa(e),hasErrorKey:!0}})}}async function Nf({chat:e,message:t,scheduledAt:s,scheduleRepeatPeriod:n}){await Su(new Me.messages.EditMessage({peer:tn(e.id,e.accessHash),id:t.id,scheduleDate:s,scheduleRepeatPeriod:n}))}async function qf(e,t,s){const{filename:n,blobUrl:a,mimeType:i,quick:o,voice:r,audio:d,previewBlobUrl:c,shouldSendAsFile:u,shouldSendAsSpoiler:l,ttlSeconds:f}=t,p=t=>{s.isCanceled?p.isCanceled=!0:s(t,function(e){const{chatId:t}=e;return function(e,t){return`msg${e}-${t}`}(t,"randomId"in e?Number(e.randomId):e.previousLocalId||e.id)}(e))},y=async(e,t)=>vu(await async function(e,t){const s=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})}(s,t)}(e,n),t),_=m.has(i),b=d||_||u,[S,w]=await Promise.all(Ds([y(a,p),b&&c&&y(c)])),I=[new Me.DocumentAttributeFilename({fileName:n})];if(!u){if(o){if(h.has(i)&&i!==g)return new Me.InputMediaUploadedPhoto({file:S,spoiler:l});if(_){const{width:e,height:t,duration:s}=o;void 0!==s&&I.push(new Me.DocumentAttributeVideo({duration:s,w:e,h:t,supportsStreaming:!0}))}}if(d){const{duration:e,title:t,performer:s}=d;I.push(new Me.DocumentAttributeAudio({duration:e,title:t,performer:s}))}if(r){const{duration:e,waveform:t}=r,{data:s}=Zr(t,63);I.push(new Me.DocumentAttributeAudio({voice:!0,duration:e,waveform:Af.from(s)}))}}return new Me.InputMediaUploadedDocument({file:S,mimeType:i,attributes:I,thumb:w,forceFile:u,spoiler:l,ttlSeconds:f})}async function Hf({chat:e,messageId:t,isUnpin:s,isOneSide:n,isSilent:a}){await Su(new Me.messages.UpdatePinnedMessage({peer:tn(e.id,e.accessHash),id:t,...s&&{unpin:!0},...n&&{pmOneside:!0},...a&&{silent:!0}}))}async function Lf({chat:e,threadId:t}){const s=await Su(new Me.messages.UnpinAllMessages({peer:tn(e.id,e.accessHash),...t&&{topMsgId:Number(t)}}));s&&(wc(e,s),s.offset&&await Lf({chat:e,threadId:t}))}async function Of({chat:e,messageIds:t,shouldDeleteForAll:s}){const n="channel"===Zs(e.id),a=await Su(n?new Me.channels.DeleteMessages({channel:nn(e.id,e.accessHash),id:t}):new Me.messages.DeleteMessages({id:t,...s&&{revoke:!0}}));a&&(wc(e,a),ja({"@type":"deleteMessages",ids:t,...n&&{chatId:e.id}}))}async function jf({chat:e,peer:t,isRepeat:s=!1}){const n=await Su(new Me.channels.DeleteParticipantHistory({channel:nn(e.id,e.accessHash),participant:tn(t.id,t.accessHash)}));n&&(wc(e,n),s||ja({"@type":"deleteParticipantHistory",chatId:e.id,peerId:t.id}),n.offset&&await jf({chat:e,peer:t,isRepeat:!0}))}function Wf({chat:e,peer:t,rank:s}){const n=tn(t.id,t.accessHash);return Su(new Me.messages.EditChatParticipantRank({peer:tn(e.id,e.accessHash),participant:n,rank:s}),{shouldReturnTrue:!0})}function zf({chat:e,messageIds:t}){Su(new Me.messages.DeleteScheduledMessages({peer:tn(e.id,e.accessHash),id:t}))}async function Kf({chat:e,shouldDeleteForAll:t,maxId:s}){const n="channel"===Zs(e.id),a=await Su(n?new Me.channels.DeleteHistory({channel:nn(e.id,e.accessHash),maxId:s??0}):new Me.messages.DeleteHistory({peer:tn(e.id,e.accessHash),maxId:s??0,...t&&{revoke:!0},...!t&&{just_clear:!0}}));a&&("offset"in a&&(wc(e,a),a.offset)?await Kf({chat:e,shouldDeleteForAll:t}):ja({"@type":"deleteHistory",chatId:e.id}))}async function $f({chat:e}){const t=await Su(new Me.messages.DeleteSavedHistory({peer:tn(e.id,e.accessHash),maxId:0}));t&&(wc(e,t),t.offset?await $f({chat:e}):ja({"@type":"deleteSavedHistory",chatId:e.id}))}async function Jf({chat:e,messageId:t,reject:s,scheduleDate:n,rejectComment:a}){return await Su(new Me.messages.ToggleSuggestedPostApproval({peer:tn(e.id,e.accessHash),msgId:t,reject:s||void 0,scheduleDate:n,rejectComment:a}))}async function Qf({peer:e,messageIds:t,description:s,option:n}){try{const a=await Su(new Me.messages.Report({peer:tn(e.id,e.accessHash),id:t,option:Fa(n),message:s}),{shouldThrow:!0});if(!a)return;return{result:md(a),error:void 0}}catch(e){const t=e.message;if(t===b)return{result:void 0,error:t};throw e}}function Xf({peer:e,chat:t,messageIds:s}){return Su(new Me.channels.ReportSpam({participant:tn(e.id,e.accessHash),channel:nn(t.id,t.accessHash),id:s}))}async function Yf({peer:e,threadId:t,action:s}){const n=function(e){switch(e.type){case"cancel":return new Me.SendMessageCancelAction;case"typing":return new Me.SendMessageTypingAction;case"recordAudio":return new Me.SendMessageRecordAudioAction;case"chooseSticker":return new Me.SendMessageChooseStickerAction;case"playingGame":return new Me.SendMessageGamePlayAction}}(s);if(n)try{return await Su(new Me.messages.SetTyping({peer:tn(e.id,e.accessHash),topMsgId:Number(t),action:n}),{shouldThrow:!0,abortControllerChatId:e.id,abortControllerThreadId:t})}catch(e){}}async function Zf({chat:e,threadId:t,maxId:s=0}){if("channel"===Zs(e.id)&&t===Ps)await Su(new Me.channels.ReadHistory({channel:nn(e.id,e.accessHash),maxId:s}));else if(t!==Ps)await Su(new Me.messages.ReadDiscussion({peer:tn(e.id,e.accessHash),msgId:Number(t),readMaxId:s}));else{const t=await Su(new Me.messages.ReadHistory({peer:tn(e.id,e.accessHash),maxId:s}));t&&wc(e,t)}t===Ps?fl({chat:e,noLastMessage:!0}):e.isForum?ja({"@type":"updateTopic",chatId:e.id,topicId:Number(t)}):ja({"@type":"updateDiscussion",chatId:e.id,threadId:Number(t)})}async function eg({chat:e,messageIds:t}){const s="channel"===Zs(e.id),n=await Su(s?new Me.channels.ReadMessageContents({channel:nn(e.id,e.accessHash),id:t}):new Me.messages.ReadMessageContents({id:t}));n&&(!0!==n&&wc(e,n),ja({...s?{"@type":"updateChannelMessages",channelId:e.id}:{"@type":"updateCommonBoxMessages"},ids:t,messageUpdate:{hasUnreadMention:!1,isMediaUnread:!1}}))}async function tg({chat:e,ids:t,shouldIncrement:s}){const n=Us(t,100),a=await Promise.all(n.map(t=>Su(new Me.messages.GetMessagesViews({peer:tn(e.id,e.accessHash),id:t,increment:Boolean(s)}))));if(!a||a.some(e=>!e))return;const i=a.flatMap(e=>e.views);return{viewsInfo:t.map((t,s)=>{const{views:n,forwards:a,replies:o}=i[s];return{id:t,views:n,forwards:a,threadInfo:o?pd(e.id,t,o):void 0}})}}async function sg({chat:e,ids:t}){const s=Us(t,100),n=await Promise.all(s.map(t=>Su(new Me.messages.GetFactCheck({peer:tn(e.id,e.accessHash),msgId:t}))));if(n&&!n.some(e=>!e))return n.flatMap(e=>e).map(ld)}function ng(){return Su(new Me.messages.GetPaidReactionPrivacy,{shouldReturnTrue:!0})}function ag({chat:e,messageIds:t}){return Su(new Me.messages.ReportMessagesDelivery({peer:tn(e.id,e.accessHash),id:t}))}async function ig({chat:e,messageId:t}){const[s,n]=await Promise.all([Su(new Me.messages.GetDiscussionMessage({peer:tn(e.id,e.accessHash),msgId:t}),{abortControllerChatId:e.id,abortControllerThreadId:t}),Rf({chat:e,threadId:t,offsetId:1,addOffset:-1,limit:1})]);if(!s||!n)return;const a=s.messages.map(od).filter(Boolean),i=a.concat(n.messages),o=s.messages[s.messages.length-1]?.id,r=a[0]?.chatId;if(!r||!o)return;const{maxId:d}=s;return{messages:i,topMessages:a,threadId:o,threadReadState:jo(s),threadInfo:gd(s.messages.find(e=>e instanceof Me.Message&&Boolean(e.replies))),lastMessageId:d,chatId:a[0]?.chatId,firstMessageId:n.messages[0]?.id}}async function og({peer:e,isSavedDialog:t,savedTag:s,type:n,query:a="",threadId:i,minDate:o,maxDate:r,offsetId:d,addOffset:c,limit:u,fromPeer:l}){let f;switch(n){case"media":f=new Me.InputMessagesFilterPhotoVideo;break;case"documents":f=new Me.InputMessagesFilterDocument;break;case"links":f=new Me.InputMessagesFilterUrl;break;case"audio":f=new Me.InputMessagesFilterMusic;break;case"voice":f=new Me.InputMessagesFilterRoundVoice;break;case"profilePhoto":f=new Me.InputMessagesFilterChatPhotos;break;case"gif":f=new Me.InputMessagesFilterGif;break;default:f=new Me.InputMessagesFilterEmpty}const g=tn(e.id,e.accessHash),p=l?tn(l.id,l.accessHash):void 0,h=await Su(new Me.messages.Search({peer:t?new Me.InputPeerSelf:g,savedPeerId:t?g:void 0,savedReaction:s&&[Bn(s)],topMsgId:i===Ps||t?void 0:Number(i),filter:f,q:a,fromId:p,minDate:o??0,maxDate:r??0,maxId:0,minId:0,hash:0n,offsetId:d??0,addOffset:c??0,limit:u}),{abortControllerChatId:e.id,abortControllerThreadId:i});if(!h||h instanceof Me.messages.MessagesNotModified||!h.messages)return;const m=io(h.users),y=h.messages.map(od).filter(Boolean),_=h.topics.map(Mf).filter(Boolean);let b,S=y.length;return(h instanceof Me.messages.MessagesSlice||h instanceof Me.messages.ChannelMessages)&&(S=h.count,y.length&&(b=y[y.length-1].id)),{userStatusesById:m,messages:y,topics:_,totalCount:S,nextOffsetId:b}}async function rg({query:e,offsetRate:t=0,offsetPeer:s,offsetId:n,limit:a,type:i="text",minDate:o,maxDate:r,context:d="all"}){if("publicPosts"===i)return dg({query:e,offsetRate:t,offsetPeer:s,offsetId:n,limit:a});let c;switch(i){case"media":c=new Me.InputMessagesFilterPhotoVideo;break;case"documents":c=new Me.InputMessagesFilterDocument;break;case"links":c=new Me.InputMessagesFilterUrl;break;case"audio":c=new Me.InputMessagesFilterMusic;break;case"voice":c=new Me.InputMessagesFilterRoundVoice;break;default:if(!(e||r&&o))return;c=new Me.InputMessagesFilterEmpty}const u=s&&tn(s.id,s.accessHash)||new Me.InputPeerEmpty,l=await Su(new Me.messages.SearchGlobal({q:e,offsetRate:t,offsetPeer:u,offsetId:n??0,broadcastsOnly:"channels"===i||"channels"===d||void 0,groupsOnly:"groups"===d||void 0,usersOnly:"users"===d||void 0,limit:a,filter:c,minDate:o??0,maxDate:r??0}));if(!l||l instanceof Me.messages.MessagesNotModified||!l.messages)return;const f=io(l.users),g=l.messages.map(od).filter(Boolean),p=l.topics.map(Mf).filter(Boolean);let h;h=l instanceof Me.messages.MessagesSlice||l instanceof Me.messages.ChannelMessages?l.count:l.messages.length;const m=l.messages[l.messages.length-1],y=xa(m),_="nextRate"in l&&l.nextRate?l.nextRate:void 0,b=m?.id;return{messages:g,topics:p,userStatusesById:f,totalCount:h,nextOffsetRate:_,nextOffsetPeerId:y,nextOffsetId:b}}async function dg({hashtag:e,query:t,offsetRate:s,offsetPeer:n,offsetId:a,limit:i}){const o=n&&tn(n.id,n.accessHash)||new Me.InputPeerEmpty,r=await cg(t);if(!r)return;const d=await Su(new Me.channels.SearchPosts({hashtag:e,query:t,offsetRate:s??0,offsetId:a??0,offsetPeer:o,limit:i??0,allowPaidStars:BigInt(r.starsAmount)}));if(!d||d instanceof Me.messages.MessagesNotModified)return;const c=io(d.users),u=d.messages.map(od).filter(Boolean),l=d.topics.map(Mf).filter(Boolean);let f;f=d instanceof Me.messages.MessagesSlice||d instanceof Me.messages.ChannelMessages?d.count:d.messages.length;const g=d.messages[d.messages.length-1],p=xa(g),h="nextRate"in d&&d.nextRate?d.nextRate:void 0,m=g?.id;return{messages:u,topics:l,userStatusesById:c,totalCount:f,nextOffsetRate:h,nextOffsetPeerId:p,nextOffsetId:m,searchFlood:d instanceof Me.messages.MessagesSlice&&d.searchFlood?_d(d.searchFlood,t):void 0}}async function cg(e){const t=await Su(new Me.channels.CheckSearchPostsFlood({query:e}));if(t)return _d(t,e)}async function ug({text:e}){const t=En(e),s=await Su(new Me.messages.GetWebPagePreview({message:t.text,entities:t.entities}));if(s)return Or(s.media)}async function lg({chat:e,messageId:t,options:s}){const{id:n,accessHash:a}=e;await Su(new Me.messages.SendVote({peer:tn(n,a),msgId:t,options:s.map(Fa)}))}async function fg({chat:e,messageId:t,text:s}){const{id:n,accessHash:a}=e;await Su(new Me.messages.AddPollAnswer({peer:tn(n,a),msgId:t,answer:new Me.InputPollAnswer({text:En({text:s})})}))}async function gg({chat:e,messageId:t,completedIds:s,incompletedIds:n}){const{id:a,accessHash:i}=e;await Su(new Me.messages.ToggleTodoCompleted({peer:tn(a,i),msgId:t,completed:s,incompleted:n}))}async function pg({chat:e,messageId:t,poll:s}){const{id:n,accessHash:a}=e;await Su(new Me.messages.EditMessage({peer:tn(n,a),id:t,media:ln(s,!0)}))}async function hg({chat:e,messageId:t,option:s,offset:n,limit:a,shouldResetVoters:i}){const{id:o,accessHash:r}=e,d=await Su(new Me.messages.GetPollVotes({peer:tn(o,r),id:t,limit:a??0,option:s?Fa(s):void 0,offset:n}));if(!d)return;const c=d.votes.map(e=>({peerId:Pa(e.peer),date:e.date}));return{count:d.count,votes:c,nextOffset:d.nextOffset,shouldResetVoters:i}}async function mg({chat:e,ids:t}){await Su(new Me.messages.GetExtendedMedia({peer:tn(e.id,e.accessHash),id:t}))}function yg(e){const{toChat:t,toThreadId:s,messages:n,scheduledAt:a,scheduleRepeatPeriod:i,sendAs:o,noAuthors:r,noCaptions:d,isCurrentUserPremium:c,wasDrafted:u,lastMessageId:l,effectId:f}=e,g=n.map(({id:e})=>e),p=[];return n.forEach((e,n)=>{const g=function({toChat:e,toThreadId:t,message:s,scheduledAt:n,scheduleRepeatPeriod:a,noAuthors:i,noCaptions:o,isCurrentUserPremium:r,lastMessageId:d,sendAs:c,effectId:u}){const l=id(d),{content:f,chatId:g,id:p,senderId:h,groupedId:m,isInAlbum:y,isInvertedMedia:_}=s,b=f.audio,S=e.id===nd&&(g!==e.id||s.forwardInfo)&&!b,w=Object.keys(f).length>1&&f.text&&o,I=!r,v=f.text?.entities&&I?{text:f.text.text,entities:f.text.entities.filter(e=>e.type!==vs.CustomEmoji)}:f.text,P=v&&Xa(v),C=Yr(f,m);C&&P&&(P.emojiOnlyCount=C);const M={...f,text:w?void 0:P},A=t&&t!==Ps?{type:"message",replyToMsgId:t,replyToTopId:t,isForumTopic:e.isForum||void 0}:void 0;return{id:l,chatId:e.id,content:M,date:n||Is(),scheduleRepeatPeriod:a,isOutgoing:!S&&"chatTypeChannel"!==e.type,senderId:"chatTypePrivate"!==e.type?c?.id||nd:void 0,sendingState:"messageSendingStatePending",groupedId:m,isInAlbum:y,isForwardingAllowed:!0,replyInfo:A,isInvertedMedia:_,effectId:u,...t&&e?.isForum&&{isTopicReply:!0},...s.chatId!==nd&&!b&&!i&&{forwardInfo:{date:s.forwardInfo?.date||s.date,savedDate:s.date,isChannelPost:!1,fromChatId:g,fromMessageId:p,fromId:h,savedFromPeerId:s.chatId}},...s.chatId===nd&&!i&&{forwardInfo:s.forwardInfo},...n&&{isScheduled:!0}}}({toChat:t,toThreadId:Number(s),message:e,scheduledAt:a,scheduleRepeatPeriod:i,noAuthors:r,noCaptions:d,isCurrentUserPremium:c,lastMessageId:l,sendAs:o,effectId:0===n?f:void 0});p.push(g),ja({"@type":g.isScheduled?"newScheduledMessage":"newMessage",id:g.id,chatId:t.id,message:g,wasDrafted:u})}),Promise.resolve({messageIds:g,localMessages:p})}async function _g(e){const{fromChat:t,toChat:s,toThreadId:n,isSilent:a,scheduledAt:i,scheduleRepeatPeriod:o,sendAs:r,withMyScore:d,noAuthors:c,noCaptions:u,forwardedLocalMessagesSlice:l,messagePriceInStars:f,effectId:g}=e;if(!l)return;const{messageIds:p,localMessages:h}=l,m=f?f*p.length:void 0,y=p.map(()=>z());try{const e=await Su(new Me.messages.ForwardMessages({fromPeer:tn(t.id,t.accessHash),toPeer:tn(s.id,s.accessHash),randomId:y,id:p,withMyScore:d||void 0,silent:a||void 0,dropAuthor:c||void 0,dropMediaCaptions:u||void 0,...n&&{topMsgId:Number(n)},...i&&{scheduleDate:i},...o&&{scheduleRepeatPeriod:o},...r&&{sendAs:tn(r.id,r.accessHash)},...m&&{allowPaidStars:BigInt(m)},effect:g?BigInt(g):void 0}),{shouldThrow:!0,shouldIgnoreUpdates:!0}),l={};h.forEach((e,t)=>{l[y[t].toString()]=e}),e&&qg(l,e)}catch(e){Object.values(h).forEach(t=>{ja({"@type":t.isScheduled?"updateScheduledMessageSendFailed":"updateMessageSendFailed",chatId:s.id,localId:t.id,error:e.errorMessage})})}}async function bg(e){if(e.forwardedLocalMessagesSlice)await _g(e);else{const t={...e,forwardedLocalMessagesSlice:await yg(e)};await _g(t)}}async function Sg({chat:e,timestamp:t}){const s=await Su(new Me.messages.GetHistory({peer:tn(e.id,e.accessHash),offsetDate:t,addOffset:-1,limit:1,offsetId:0,maxId:0,minId:0,hash:0n}));if(s&&!(s instanceof Me.messages.MessagesNotModified)&&s.messages&&s.messages.length)return s.messages[0].id}async function wg({chat:e}){const{id:t,accessHash:s}=e,n=await Su(new Me.messages.GetScheduledHistory({peer:tn(t,s),hash:0n}),{abortControllerChatId:t});if(n&&!(n instanceof Me.messages.MessagesNotModified)&&n.messages)return{messages:n.messages.map(od).filter(Boolean)}}async function Ig({chat:e,ids:t}){const{id:s,accessHash:n}=e;await Su(new Me.messages.SendScheduledMessages({peer:tn(s,n),id:t}))}async function vg({chat:e,threadId:t}){const s=await Su(new Me.messages.Search({peer:tn(e.id,e.accessHash),filter:new Me.InputMessagesFilterPinned,q:Ys,limit:50,topMsgId:Number(t),minDate:0,maxDate:0,offsetId:0,addOffset:0,maxId:0,minId:0,hash:0n}),{abortControllerChatId:e.id,abortControllerThreadId:t});if(s&&!(s instanceof Me.messages.MessagesNotModified)&&s.messages)return{messages:s.messages.map(od).filter(Boolean)}}async function Pg({chat:e,messageId:t}){const s=await Su(new Me.messages.GetMessageReadParticipants({peer:tn(e.id,e.accessHash),msgId:t}));return s?s.reduce((e,t)=>(e[t.userId.toString()]=t.date,e),{}):void 0}async function Cg({chat:e,isForPaidReactions:t}){const s=await Su(new Me.channels.GetSendAs({forPaidReactions:t,peer:tn(e.id,e.accessHash)}),{shouldIgnoreErrors:!0,abortControllerChatId:e.id});if(s)return s.peers.map(No)}function Mg({sendAs:e,chat:t}){return Su(new Me.messages.SaveDefaultSendAs({peer:tn(t.id,t.accessHash),sendAs:tn(e.id,e.accessHash)}))}async function Ag({peer:e}){const t=await Su(new Me.messages.GetSponsoredMessages({peer:tn(e.id,e.accessHash)}));if(t&&!(t instanceof Me.messages.SponsoredMessagesEmpty)&&t.messages.length)return{messages:t.messages.map(t=>function(e,t){const{message:s,entities:n,randomId:a,recommended:i,sponsorInfo:o,additionalInfo:r,buttonText:d,canReport:c,title:u,url:l,color:f}=e;let g,p;return e.photo instanceof Me.Photo&&(si(e.photo),g=pi(e.photo)),e.media&&(p=Dr(e.media)),{chatId:t,randomId:Ga(a),expiresAt:Math.round(Date.now()/1e3)+3e5,isRecommended:i,sponsorInfo:o,additionalInfo:r,buttonText:d,canReport:c,title:u,url:l,peerColor:f&&Ca(f),photo:g,content:{...p,text:Br(s,n)}}}(t,e.id)).filter(Boolean)}}async function Rg({random:e}){await Su(new Me.messages.ViewSponsoredMessage({randomId:Fa(e)}))}function kg({random:e,isMedia:t,isFullscreen:s}){return Su(new Me.messages.ClickSponsoredMessage({media:t||void 0,fullscreen:s||void 0,randomId:Fa(e)}))}async function Tg({randomId:e,option:t}){try{const s=await Su(new Me.messages.ReportSponsoredMessage({randomId:Fa(e),option:Fa(t)}),{shouldThrow:!0});if(!s)return;return function(e){return e instanceof Me.channels.SponsoredMessageReportResultReported?{type:"reported"}:e instanceof Me.channels.SponsoredMessageReportResultAdsHidden?{type:"hidden"}:{type:"selectOption",title:e.title,options:e.options.map(e=>({text:e.text,option:Ga(e.option)}))}}(s)}catch(e){return e instanceof Ae&&"PREMIUM_ACCOUNT_REQUIRED"===e.errorMessage?{type:"premiumRequired"}:void 0}}async function Bg({chat:e,threadId:t}){const s=await Su(new Me.messages.ReadMentions({peer:tn(e.id,e.accessHash),topMsgId:t?Number(t):void 0}));s&&(wc(e,s),s.offset&&await Bg({chat:e,threadId:t}))}async function Dg({chat:e,threadId:t}){const s=await Su(new Me.messages.ReadReactions({peer:tn(e.id,e.accessHash),topMsgId:t?Number(t):void 0}));s&&(wc(e,s),s.offset&&await Dg({chat:e,threadId:t}))}async function Ug({chat:e,threadId:t}){const s=await Su(new Me.messages.ReadPollVotes({peer:tn(e.id,e.accessHash),topMsgId:t?Number(t):void 0}));s&&(wc(e,s),s.offset&&await Ug({chat:e,threadId:t}))}async function Eg({chat:e,threadId:t,offsetId:s,addOffset:n,maxId:a,minId:i}){const o=await Su(new Me.messages.GetUnreadMentions({peer:tn(e.id,e.accessHash),topMsgId:t?Number(t):void 0,limit:100,offsetId:s??0,addOffset:n??0,maxId:a??0,minId:i??0}));if(o&&!(o instanceof Me.messages.MessagesNotModified)&&o.messages)return{totalCount:"count"in o?o.count:o.messages.length,messages:o.messages.map(od).filter(Boolean),topics:o.topics.map(Mf).filter(Boolean)}}async function xg({chat:e,threadId:t,offsetId:s,addOffset:n,maxId:a,minId:i}){const o=await Su(new Me.messages.GetUnreadReactions({peer:tn(e.id,e.accessHash),topMsgId:t?Number(t):void 0,limit:100,offsetId:s??0,addOffset:n??0,maxId:a??0,minId:i??0}));if(o&&!(o instanceof Me.messages.MessagesNotModified)&&o.messages)return{totalCount:"count"in o?o.count:o.messages.length,messages:o.messages.map(od).filter(Boolean),topics:o.topics.map(Mf).filter(Boolean)}}async function Vg({chat:e,threadId:t,offsetId:s,addOffset:n,maxId:a,minId:i}){const o=await Su(new Me.messages.GetUnreadPollVotes({peer:tn(e.id,e.accessHash),topMsgId:t?Number(t):void 0,limit:100,offsetId:s??0,addOffset:n??0,maxId:a??0,minId:i??0}));if(o&&!(o instanceof Me.messages.MessagesNotModified)&&o.messages)return{totalCount:"count"in o?o.count:o.messages.length,messages:o.messages.map(od).filter(Boolean),topics:o.topics.map(Mf).filter(Boolean)}}async function Gg({chat:e,messageId:t}){const s=await Su(new Me.messages.TranscribeAudio({msgId:t,peer:tn(e.id,e.accessHash)}));if(s)return ja({"@type":"updateTranscribedAudio",isPending:s.pending,transcriptionId:s.transcriptionId.toString(),text:s.text}),s.transcriptionId.toString()}async function Fg(e){let t;const s="chat"in e,{toLanguageCode:n,tone:a}=e,i="neutral"===a?void 0:a;if(s){const{chat:s,messageIds:a}=e;t=await Su(new Me.messages.TranslateText({peer:tn(s.id,s.accessHash),id:a,toLang:n,tone:i}))}else{const{text:s}=e;t=await Su(new Me.messages.TranslateText({text:s.map(e=>En(e)),toLang:n,tone:i}))}if(!t)return void(s&&ja({"@type":"failedMessageTranslations",chatId:e.chat.id,messageIds:e.messageIds,toLanguageCode:e.toLanguageCode,tone:a}));const o=t.result.map(e=>Si(e));return s&&ja({"@type":"updateMessageTranslations",chatId:e.chat.id,messageIds:e.messageIds,translations:o,toLanguageCode:e.toLanguageCode,tone:a}),o}async function Ng({chat:e,id:t,toLanguageCode:s,tone:n}){const a=await Su(new Me.messages.SummarizeText({peer:tn(e.id,e.accessHash),id:t,toLang:s,tone:n}));if(a)return Si(a)}function qg(e,t){if(!("updates"in t))return void bu(t);t.updates.filter(e=>e instanceof Me.UpdateMessageID).forEach(s=>{const n=t.updates.find(e=>e instanceof Me.UpdateNewScheduledMessage&&e.message.id===s.id);Hg(e[s.randomId.toString()],s,n)});const s=t.updates.filter(e=>!(e instanceof Me.UpdateMessageID||e instanceof Me.UpdateNewScheduledMessage));t.updates=s,bu(t)}function Hg(e,t,s){let n,a,i,o;if(t instanceof Me.UpdateShortSentMessage||t instanceof Me.UpdateMessageID?n=t:"updates"in t&&(n=t.updates.find(e=>e instanceof Me.UpdateMessageID),s=t.updates.find(e=>e instanceof Me.UpdateNewScheduledMessage)),!n)return void bu(t);n instanceof Me.UpdateShortSentMessage&&(e.content.text&&n.entities&&(a={text:Br(e.content.text.text,n.entities)}),n.media&&(a={...a,...Dr(n.media,{peerId:en(e.chatId),id:n.id})},i=Gr(n.media),o=Or(n.media)),Td(hn(n.id,e.chatId,n)));const r=s?.message&&od(s.message),d="date"in n&&n.date<Is();if(r?.isVideoProcessingPending)ja({"@type":"updateVideoProcessingPending",chatId:e.chatId,localId:e.id,newScheduledMessageId:r?.id});else{const t={...e,...a&&{content:{...e.content,...a}},id:n.id,sendingState:void 0,..."date"in n&&{date:n.date}};ja({"@type":e.isScheduled&&!d?"updateScheduledMessageSendSucceeded":"updateMessageSendSucceeded",chatId:e.chatId,localId:e.id,message:t,poll:i,webPage:o})}bu(t)}async function Lg({chat:e,messageId:t}){const{id:s,accessHash:n}=e,a=tn(s,n),i=await Su(new Me.messages.GetOutboxReadDate({peer:a,msgId:t}),{shouldThrow:!0});if(i)return{date:i.date}}async function Og(){const e=await Su(new Me.messages.GetQuickReplies({hash:0n}));if(e&&!(e instanceof Me.messages.QuickRepliesNotModified))return{messages:e.messages.map(od).filter(Boolean),quickReplies:e.quickReplies.map(hd)}}async function jg({chat:e,shortcutId:t}){const s=await Su(new Me.messages.GetQuickReplyMessages({shortcutId:t,hash:0n}));if(!s||s instanceof Me.messages.MessagesNotModified)return;const n=s.messages.map(e=>e.id),a=n.map(()=>z()),i=await Su(new Me.messages.SendQuickReplyMessages({peer:tn(e.id,e.accessHash),shortcutId:t,id:n,randomId:a}),{shouldIgnoreUpdates:!0});if(i){if("updates"in i){const e=i.updates.filter(e=>!(e instanceof Me.UpdateMessageID));i.updates=e}bu(i)}}async function Wg({id:e,chat:t,shouldIncludeThread:s,shouldIncludeGrouped:n}){const a=await Su(new Me.channels.ExportMessageLink({channel:nn(t.id,t.accessHash),id:e,thread:s||void 0,grouped:n||void 0}));return a?.link}async function zg({bot:e,id:t}){const s=await Su(new Me.messages.GetPreparedInlineMessage({bot:sn(e.id,e.accessHash),id:t}));if(s)return function(e){const t=e.queryId.toString();return{queryId:t,result:yd(t,e.result),peerTypes:e.peerTypes?.map(Xi),cacheTime:e.cacheTime}}(s)}function Kg(){ad++}async function $g({text:e,shouldProofread:t,isEmojify:s,translateToLang:n,tone:a}){try{const i=await Su(new Me.messages.ComposeMessageWithAI({text:En(e),proofread:t||void 0,emojify:s||void 0,translateToLang:n,tone:a?Un(a):void 0}),{shouldThrow:!0});return i?{result:Pi(i)}:{error:"generic"}}catch(e){if(e instanceof Ae){if("AICOMPOSE_FLOOD_PREMIUM"===e.errorMessage)return{error:"floodPremium"};if("AICOMPOSE_ERROR_OCCURED"===e.errorMessage)return{error:"aiError"}}return{error:"generic"}}}async function Jg({hash:e}){const t=await Su(new Me.aicompose.GetTones({hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.aicompose.TonesNotModified))return{tones:t.tones.map(vi),hash:t.hash.toString()}}async function Qg({title:e,emojiId:t,prompt:s,shouldDisplayAuthor:n}){const a=await Su(new Me.aicompose.CreateTone({title:e,prompt:s,emojiId:BigInt(t),displayAuthor:n||void 0}));if(a)return vi(a)}async function Xg({tone:e}){return Su(new Me.aicompose.DeleteTone({tone:Un(e)}))}async function Yg({tone:e,title:t,emojiId:s,prompt:n,shouldDisplayAuthor:a}){const i=await Su(new Me.aicompose.UpdateTone({tone:Un(e),title:t,prompt:n,emojiId:s?BigInt(s):void 0,displayAuthor:a}));if(i)return vi(i)}async function Zg({tone:e}){const t=await Su(new Me.aicompose.GetTone({tone:Un(e)}));if(t&&"tones"in t)return{tones:t.tones.map(vi)}}async function ep({tone:e,num:t}){const s=await Su(new Me.aicompose.GetToneExample({tone:Un(e),num:t}));if(s)return Ii(s)}async function tp({tone:e,unsave:t}){return Su(new Me.aicompose.SaveTone({tone:Un(e),unsave:Boolean(t)}))}async function sp({id:e,accessHash:t}){const s=sn(e,t);if(!(s instanceof Me.InputUser))return;const n=await Su(new Me.users.GetFullUser({id:s}));if(!n)return;n.fullUser.profilePhoto&&si(n.fullUser.profilePhoto),n.fullUser.personalPhoto&&si(n.fullUser.personalPhoto),n.fullUser.fallbackPhoto&&si(n.fullUser.fallbackPhoto);const a=n.fullUser.botInfo;a?.descriptionPhoto&&si(a.descriptionPhoto),a?.descriptionDocument instanceof Me.Document&&(Js.documents[a.descriptionDocument.id.toString()]=a.descriptionDocument),n.fullUser.businessIntro?.sticker instanceof Me.Document&&(Js.documents[n.fullUser.businessIntro.sticker.id.toString()]=n.fullUser.businessIntro.sticker);const i=to(n),o=n.users.map(no).filter(Boolean),r=io(n.users),d=n.chats.map(e=>Mo(e)).filter(Boolean),c=o.find(({id:t})=>t===e);return ja({"@type":"updateUser",id:e,user:c,fullInfo:i}),{user:c,fullInfo:i,users:o,chats:d,userStatusesById:r}}async function np({user:e,maxId:t}){const s=await Su(new Me.messages.GetCommonChats({userId:sn(e.id,e.accessHash),maxId:t?Cn(t,Zs(t)):0n,limit:0}));if(!s)return;const n=s.chats.map(e=>Mo(e)).filter(Boolean).map(({id:e})=>e);return{chatIds:n,count:"count"in s?s.count:n.length}}async function ap(e){const t=await Su(new Me.users.GetRequirementsToContact({id:[sn(e.id,e.accessHash)]}));if(!t?.[0])return;const s=t[0];return s instanceof Me.RequirementToContactPaidMessages?rs(s.starsAmount):void 0}async function ip(){const e=await Su(new Me.help.GetNearestDc);return e?.country}async function op(){const e=await Su(new Me.contacts.GetContacts({hash:0n}));if(e&&!(e instanceof Me.contacts.ContactsNotModified))return{users:e.users.map(no).filter(Boolean),userStatusesById:io(e.users)}}async function rp({users:e}){const t=await Su(new Me.users.GetUsers({id:e.map(({id:e,accessHash:t})=>sn(e,t))}));if(t&&t.length)return{users:t.map(no).filter(Boolean),userStatusesById:io(t)}}async function dp({phone:e="",firstName:t="",lastName:s=""}){const n=await Su(new Me.contacts.ImportContacts({contacts:[_n({phone:e,firstName:t,lastName:s})]}));return n instanceof Me.contacts.ImportedContacts&&n.users.length&&di(n.users[0]),n?.imported.length?va(n.imported[0].userId,"user"):void 0}function cp({id:e,accessHash:t,phoneNumber:s="",firstName:n="",lastName:a="",shouldSharePhoneNumber:i=!1,note:o}){return Su(new Me.contacts.AddContact({id:sn(e,t),firstName:n,lastName:a,phone:s,addPhonePrivacyException:i||void 0,note:o?En(o):void 0}),{shouldReturnTrue:!0})}async function up({id:e,accessHash:t}){const s=sn(e,t);s instanceof Me.InputUser&&await Su(new Me.contacts.DeleteContacts({id:[s]}))&&ja({"@type":"deleteContact",id:e})}async function lp({user:e,shouldRefundCharged:t}){return await Su(new Me.account.ToggleNoPaidMessagesException({refundCharged:!!t||void 0,userId:sn(e.id,e.accessHash)}))}async function fp({user:e}){const t=await Su(new Me.account.GetPaidMessagesRevenue({userId:sn(e.id,e.accessHash)}));if(t)return rs(t.starsAmount)}async function gp({peer:e,offset:t=0,limit:s=0}){const n=("title"in e?e:void 0)?void 0:e;if(n){const{id:e,accessHash:a}=n,i=await Su(new Me.photos.GetUserPhotos({userId:sn(e,a),limit:s,offset:t,maxId:0n}));if(!i)return;i.photos.forEach(si);const o=i instanceof Me.photos.PhotosSlice?i.count:i.photos.length,r=t+i.photos.length,d=r<o?r:void 0;return{count:o,photos:i.photos.filter(e=>e instanceof Me.Photo).map(e=>pi(e)),nextOffsetId:d}}const a=await og({peer:e,type:"profilePhoto",limit:s});if(!a)return;const{messages:i,totalCount:o,nextOffsetId:r}=a;return{count:o,photos:i.map(e=>"chatEditPhoto"===e.content.action?.type&&e.content.action.photo).filter(Boolean),nextOffsetId:r}}function pp(e){const{id:t,accessHash:s}=e;return Su(new Me.messages.ReportSpam({peer:tn(t,s)}),{shouldReturnTrue:!0})}function hp(e){return Su(new Me.account.UpdateEmojiStatus({emojiStatus:Dn(e)}),{shouldReturnTrue:!0})}function mp(e){const t=e.map(e=>Cn(e,"user"));return Su(new Me.contacts.EditCloseFriends({id:t}),{shouldReturnTrue:!0})}function yp(e,t){const{id:s,accessHash:n}=e;return Su(new Me.contacts.UpdateContactNote({id:sn(s,n),note:En(t)}),{shouldReturnTrue:!0})}function _p({user:e,isEnabled:t,requestMsgId:s}){return Su(new Me.messages.ToggleNoForwards({peer:tn(e.id,e.accessHash),enabled:t,requestMsgId:s}),{shouldReturnTrue:!0})}async function bp({category:e}){const t=await Su(new Me.contacts.GetTopPeers({correspondents:"correspondents"===e||void 0,botsInline:"botsInline"===e||void 0,botsApp:"botsApp"===e||void 0,botsGuestchat:"botsGuestChat"===e||void 0,offset:0,limit:50,hash:0n}));if(t instanceof Me.contacts.TopPeersNotModified)return{type:"unchanged"};if(t instanceof Me.contacts.TopPeersDisabled)return{type:"disabled"};if(!(t instanceof Me.contacts.TopPeers))return;t.users.forEach(di),t.chats.forEach(e=>{(e instanceof Me.Chat||e instanceof Me.Channel)&&ri(e)});const s=t.categories.find(({category:t})=>function(e){return e instanceof Me.TopPeerCategoryCorrespondents?"correspondents":e instanceof Me.TopPeerCategoryBotsInline?"botsInline":e instanceof Me.TopPeerCategoryBotsApp?"botsApp":e instanceof Me.TopPeerCategoryBotsGuestChat?"botsGuestChat":void 0}(t)===e),n=s?s.peers.map(({peer:e,rating:t})=>({peerId:Pa(e),rating:t})):[];return{type:"topPeers",category:e,topPeers:n}}function Sp({category:e,peer:t}){return Su(new Me.contacts.ResetTopPeerRating({category:wp(e),peer:tn(t.id,t.accessHash)}))}function wp(e){switch(e){case"correspondents":return new Me.TopPeerCategoryCorrespondents;case"botsInline":return new Me.TopPeerCategoryBotsInline;case"botsApp":return new Me.TopPeerCategoryBotsApp;case"botsGuestChat":return new Me.TopPeerCategoryBotsGuestChat}}async function Ip({hash:e}){const t=await Su(new Me.messages.GetEmojiStickers({hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.AllStickersNotModified))return t.sets.forEach(e=>{(e.thumbs?.length||e.thumbDocumentId)&&(Js.stickerSets[String(e.id)]=e)}),{hash:String(t.hash),sets:t.sets.map(xi)}}async function vp({hash:e}){const t=await Su(new Me.messages.GetAllStickers({hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.AllStickersNotModified))return t.sets.forEach(e=>{e.thumbs?.length&&(Js.stickerSets[String(e.id)]=e)}),{hash:String(t.hash),sets:t.sets.map(xi)}}async function Pp({hash:e}){const t=await Su(new Me.messages.GetRecentStickers({hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.RecentStickersNotModified))return{hash:String(t.hash),stickers:Fi(t.stickers.slice(0,20))}}async function Cp({hash:e}){const t=await Su(new Me.messages.GetFavedStickers({hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.FavedStickersNotModified))return{hash:String(t.hash),stickers:Fi(t.stickers)}}async function Mp({hash:e}){const t=await Su(new Me.messages.GetFeaturedStickers({hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.FeaturedStickersNotModified))return{hash:String(t.hash),isPremium:Boolean(t.premium),sets:t.sets.map(Vi)}}async function Ap({hash:e}){const t=await Su(new Me.messages.GetFeaturedEmojiStickers({hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.FeaturedStickersNotModified))return t.sets.forEach(({set:e})=>{e.thumbDocumentId&&(Js.stickerSets[String(e.id)]=e)}),{isPremium:Boolean(t.premium),sets:t.sets.map(Vi)}}async function Rp({sticker:e,unfave:t}){const s=cn(e);if(!s)return;const n=new Me.messages.FaveSticker({id:s,unfave:Boolean(t)});await Su(n)&&ja({"@type":"updateFavoriteStickers"})}function kp({sticker:e}){const t=cn(e);if(t)return Su(new Me.messages.SaveRecentSticker({id:t,unsave:!0}))}function Tp(){return Su(new Me.messages.ClearRecentStickers)}async function Bp({stickerSetInfo:e}){if("isMissing"in e)return;const t="id"in e?dn(e.id,e.accessHash):(s=e.shortName,new Me.InputStickerSetShortName({shortName:s}));var s;const n=await Su(new Me.messages.GetStickerSet({stickerset:t,hash:0}),{shouldThrow:!0});return n instanceof Me.messages.StickerSet?(Js.stickerSets[String(n.set.id)]=n.set,{set:xi(n.set),stickers:Fi(n.documents),packs:Gi(n.packs)}):void 0}async function Dp({documentId:e}){if(!e.length)return;const t=await Su(new Me.messages.GetCustomEmojiDocuments({documentId:e.map(e=>BigInt(e))}));return t?Fi(t):void 0}async function Up(){const e=await Su(new Me.messages.GetStickerSet({stickerset:new Me.InputStickerSetAnimatedEmoji,hash:0}));if(e instanceof Me.messages.StickerSet)return{set:xi(e.set),stickers:Fi(e.documents)}}async function Ep(){const e=await Su(new Me.messages.GetStickerSet({stickerset:new Me.InputStickerSetAnimatedEmojiAnimations,hash:0}));if(e instanceof Me.messages.StickerSet)return{set:xi(e.set),stickers:Fi(e.documents)}}async function xp(){const e=await Su(new Me.messages.GetStickerSet({stickerset:new Me.InputStickerSetEmojiGenericAnimations,hash:0}));if(e instanceof Me.messages.StickerSet)return{set:xi(e.set),stickers:Fi(e.documents)}}async function Vp(){const e=await Su(new Me.messages.GetStickerSet({stickerset:new Me.InputStickerSetPremiumGifts,hash:0}));if(e instanceof Me.messages.StickerSet)return{set:xi(e.set),stickers:Fi(e.documents)}}async function Gp({emoji:e}){const t=await Su(new Me.messages.GetStickerSet({stickerset:new Me.InputStickerSetDice({emoticon:e}),hash:0}));if(t instanceof Me.messages.StickerSet)return Js.stickerSets[String(t.set.id)]=t.set,{set:xi(t.set),stickers:Fi(t.documents),packs:Gi(t.packs)}}async function Fp(){const e=await Su(new Me.messages.GetStickerSet({stickerset:new Me.InputStickerSetTonGifts,hash:0}));if(e instanceof Me.messages.StickerSet)return{set:xi(e.set),stickers:Fi(e.documents)}}async function Np(){const e=await Su(new Me.messages.GetStickerSet({stickerset:new Me.InputStickerSetEmojiDefaultTopicIcons,hash:0}));if(e instanceof Me.messages.StickerSet)return{set:xi(e.set),stickers:Fi(e.documents)}}async function qp(){const e=await Su(new Me.messages.GetStickerSet({stickerset:new Me.InputStickerSetEmojiDefaultStatuses,hash:0}));if(e instanceof Me.messages.StickerSet)return{set:xi(e.set),stickers:Fi(e.documents)}}async function Hp({hash:e}){const t=await Su(new Me.account.GetCollectibleEmojiStatuses({hash:e?BigInt(e):0n}));if(t instanceof Me.account.EmojiStatuses)return{statuses:t.statuses.map(Ra).filter(Boolean),hash:String(t.hash)}}async function Lp({query:e,hash:t}){const s=await Su(new Me.messages.SearchStickerSets({q:e,hash:t?BigInt(t):0n}));if(s&&!(s instanceof Me.messages.FoundStickerSetsNotModified))return{hash:String(s.hash),sets:s.sets.map(Vi)}}async function Op({hash:e}){const t=await Su(new Me.messages.GetSavedGifs({hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.SavedGifsNotModified))return{hash:String(t.hash),gifs:Yp(t.gifs)}}function jp({gif:e,shouldUnsave:t}){const s=cn(e);if(s)return Su(new Me.messages.SaveGif({id:s,unsave:Boolean(t)}),{shouldReturnTrue:!0})}async function Wp({stickerSetId:e,accessHash:t}){await Su(new Me.messages.InstallStickerSet({stickerset:dn(e,t),archived:!1}))&&ja({"@type":"updateStickerSet",id:e,stickerSet:{installedDate:Date.now()}})}async function zp({stickerSetId:e,accessHash:t}){await Su(new Me.messages.UninstallStickerSet({stickerset:dn(e,t)}))&&ja({"@type":"updateStickerSet",id:e,stickerSet:{installedDate:void 0}})}let Kp;async function $p({query:e,offset:t="",username:s="gif"}){if(!Kp){const e=await Su(new Me.contacts.ResolveUsername({username:s}));if(!(e&&e.users[0]instanceof Me.User))return;Kp=new Me.InputUser({userId:e.peer.userId,accessHash:e.users[0].accessHash})}const n=await Su(new Me.messages.GetInlineBotResults({bot:Kp,peer:new Me.InputPeerEmpty,query:e,offset:t}));if(!n)return;const a=n.results.map(e=>{if(e instanceof Me.BotInlineMediaResult)return e.document}).filter(Boolean);return{nextOffset:n.nextOffset,gifs:Yp(a)}}async function Jp({emoji:e,hash:t}){const s=await Su(new Me.messages.GetStickers({emoticon:e,hash:t?BigInt(t):0n}));if(s&&!(s instanceof Me.messages.StickersNotModified))return{stickers:Fi(s.stickers),hash:String(s.hash)}}async function Qp({language:e,fromVersion:t=0}){const s=await Su(new Me.messages.GetEmojiKeywordsDifference({langCode:e,fromVersion:t}));if(s)return{language:s.langCode,version:s.version,keywords:s.keywords.reduce((e,t)=>(e[t.keyword]=t.emoticons,e),{})}}async function Xp(e){const t=await Su(new Me.account.GetRecentEmojiStatuses({hash:e?BigInt(e):0n}));if(!t||t instanceof Me.account.EmojiStatusesNotModified)return;const s=t.statuses.slice(0,20).map(Ra).filter(Boolean).map(({documentId:e})=>e),n=await Dp({documentId:s});return{hash:String(t.hash),emojiStatuses:n}}function Yp(e){return e.map(e=>{if(e instanceof Me.Document){const t=Ur(e);if(t)return Js.documents[String(e.id)]=e,t}}).filter(Boolean)}async function Zp({username:e}){try{return{result:await Su(new Me.channels.CheckUsername({channel:new Me.InputChannelEmpty,username:e}),{shouldThrow:!0}),error:void 0}}catch(e){const t=e.message;if(S.has(t))return{result:!1,error:t};throw e}}async function eh({chat:e,username:t}){const s=await Su(new Me.channels.UpdateUsername({channel:nn(e.id,e.accessHash),username:t}));let n=t?[{username:t,isEditable:!0,isActive:!0}]:[];return e.usernames&&(n=n.concat(e.usernames.filter(e=>e.username&&!e.isEditable))),s&&ja({"@type":"updateChat",id:e.id,chat:{usernames:n.length?n:void 0}}),s}async function th({chat:e}){const t=await Su(new Me.channels.DeactivateAllUsernames({channel:nn(e.id,e.accessHash)}));if(t){const t=e.usernames?e.usernames.map(e=>({...e,isActive:!1})).filter(e=>e.username):void 0;ja({"@type":"updateChat",id:e.id,chat:{usernames:t}})}return t}async function sh({chat:e,usageLimit:t,expireDate:s}){const n=await Su(new Me.messages.ExportChatInvite({peer:tn(e.id,e.accessHash),usageLimit:t,expireDate:s}));if(n instanceof Me.ChatInviteExported)return ja({"@type":"updateChatFullInfo",id:e.id,fullInfo:{inviteLink:n.link}}),n.link}async function nh({peer:e,admin:t,limit:s=0,isRevoked:n}){const a=await Su(new Me.messages.GetExportedChatInvites({peer:tn(e.id,e.accessHash),adminId:sn(t.id,t.accessHash),limit:s,revoked:n||void 0}),{abortControllerChatId:e.id});if(a)return{invites:a.invites.filter(e=>e instanceof Me.ChatInviteExported).map(Go)}}async function ah({peer:e,isRevoked:t,link:s,expireDate:n,usageLimit:a,isRequestNeeded:i,title:o}){const r=await Su(new Me.messages.EditExportedChatInvite({link:s,peer:tn(e.id,e.accessHash),expireDate:n,usageLimit:i?void 0:a,requestNeeded:i,title:o,revoked:t||void 0}));if(r){if(r instanceof Me.messages.ExportedChatInvite&&r.invite instanceof Me.ChatInviteExported){const e=Go(r.invite);return{oldInvite:e,newInvite:e}}if(r instanceof Me.messages.ExportedChatInviteReplaced&&r.invite instanceof Me.ChatInviteExported&&r.newInvite instanceof Me.ChatInviteExported)return{oldInvite:Go(r.invite),newInvite:Go(r.newInvite)}}}async function ih({peer:e,expireDate:t,usageLimit:s,isRequestNeeded:n,title:a}){const i=await Su(new Me.messages.ExportChatInvite({peer:tn(e.id,e.accessHash),expireDate:t,usageLimit:n?void 0:s,requestNeeded:n||void 0,title:a}));if(i instanceof Me.ChatInviteExported)return Go(i)}async function oh({peer:e,link:t}){return await Su(new Me.messages.DeleteExportedChatInvite({peer:tn(e.id,e.accessHash),link:t}))}async function rh({peer:e,admin:t}){return await Su(new Me.messages.DeleteRevokedExportedChatInvites({peer:tn(e.id,e.accessHash),adminId:sn(t.id,t.accessHash)}))}async function dh({peer:e,link:t,offsetDate:s=0,offsetUser:n,limit:a=0,isRequested:i}){const o=await Su(new Me.messages.GetChatInviteImporters({peer:tn(e.id,e.accessHash),link:t,offsetDate:s,offsetUser:n?sn(n.id,n.accessHash):new Me.InputUserEmpty,limit:a,requested:i||void 0}),{abortControllerChatId:e.id});if(o)return{importers:o.importers.map(e=>function(e){const{userId:t,date:s,about:n,requested:a,viaChatlist:i}=e;return{userId:va(t,"user"),date:s,about:n,isRequested:a,isFromChatList:i}}(e))}}function ch({peer:e,user:t,isApproved:s}){return Su(new Me.messages.HideChatJoinRequest({peer:tn(e.id,e.accessHash),userId:sn(t.id,t.accessHash),approved:s||void 0}),{shouldReturnTrue:!0})}function uh({peer:e,isApproved:t,link:s}){return Su(new Me.messages.HideAllChatJoinRequests({peer:tn(e.id,e.accessHash),approved:t||void 0,link:s}),{shouldReturnTrue:!0})}function lh(e){const{id:t,accessHash:s}=e;return Su(new Me.messages.HidePeerSettingsBar({peer:tn(t,s)}))}const fh=["ar","fa","id","ko","uz","en"];function gh({firstName:e,lastName:t,about:s}){return Su(new Me.account.UpdateProfile({firstName:e,lastName:t,about:s}),{shouldReturnTrue:!0})}async function ph(e){try{return{result:await Su(new Me.account.CheckUsername({username:e}),{shouldThrow:!0}),error:void 0}}catch(e){if(e instanceof Ae&&S.has(e.errorMessage))return{result:!1,error:e.errorMessage};throw e}}function hh(e){return Su(new Me.account.UpdateUsername({username:e}),{shouldReturnTrue:!0})}function mh(e){return Su(new Me.account.UpdateBirthday({birthday:e?new Me.Birthday({day:e.day,month:e.month,year:e.year}):void 0}),{shouldReturnTrue:!0})}async function yh(e,t){const s=e&&yn(e),n=await Su(new Me.photos.UpdateProfilePhoto({id:s||new Me.InputPhotoEmpty,...t?{fallback:!0}:void 0}));if(n)return n.photo instanceof Me.Photo?(si(n.photo),{photo:pi(n.photo)}):void 0}async function _h(e,t,s=!1,n=0,a){const i=await vu(e),o=await Su(new Me.photos.UploadProfilePhoto({...a?{bot:sn(a.id,a.accessHash)}:void 0,...s?{video:i,videoStartTs:n}:{file:i},...t?{fallback:!0}:void 0}));if(o)return o.photo instanceof Me.Photo?(si(o.photo),{photo:pi(o.photo)}):void 0}async function bh({file:e,isSuggest:t,user:s}){const n=e?await vu(e):void 0,a=await Su(new Me.photos.UploadContactProfilePhoto({userId:sn(s.id,s.accessHash),file:n,...t?{suggest:!0}:{save:!0}}));if(a)return a.photo instanceof Me.Photo?(si(a.photo),{photo:pi(a.photo)}):{photo:void 0}}async function Sh(e){const t=e.map(yn).filter(Boolean),s=await Su(new Me.photos.DeletePhotos({id:t}),{shouldReturnTrue:!0});return s&&e.forEach(e=>{delete Js.photos[e.id]}),s}async function wh(){const e=await Su(new Me.account.GetWallPapers({hash:BigInt("0")}));if(!e||e instanceof Me.account.WallPapersNotModified)return;const t=e.wallpapers.filter(e=>e instanceof Me.WallPaper&&e.document instanceof Me.Document&&!e.pattern&&"application/x-tgwallpattern"!==e.document.mimeType);return t.forEach(e=>{Js.documents[String(e.document.id)]=e.document}),{wallpapers:t.map(co).filter(Boolean)}}async function Ih(e){const t=await vu(e),s=await Su(new Me.account.UploadWallPaper({file:t,mimeType:e.type,settings:new Me.WallPaperSettings}));if(!(s&&s instanceof Me.WallPaper))return;const n=co(s);return n?(Js.documents[String(s.document.id)]=s.document,{wallpaper:n}):void 0}async function vh({isOnlyStories:e}){const t=await Su(new Me.contacts.GetBlocked({myStoriesFrom:e,offset:0,limit:100}));if(t)return{blockedIds:t.blocked.map(e=>Pa(e.peerId)),totalCount:t instanceof Me.contacts.BlockedSlice?t.count:t.blocked.length}}function Ph({user:e,isOnlyStories:t}){return Su(new Me.contacts.Block({id:tn(e.id,e.accessHash),myStoriesFrom:t}))}function Ch({user:e,isOnlyStories:t}){return Su(new Me.contacts.Unblock({id:tn(e.id,e.accessHash),myStoriesFrom:t}))}async function Mh(){const e=await Su(new Me.account.GetAuthorizations);if(e)return{authorizations:Ms(e.authorizations.map(uo),"hash"),ttlDays:e.authorizationTtlDays}}function Ah(e){return Su(new Me.account.ResetAuthorization({hash:BigInt(e)}))}function Rh(){return Su(new Me.auth.ResetAuthorizations)}async function kh(){const e=await Su(new Me.account.GetWebAuthorizations);if(e)return{webAuthorizations:Ms(e.authorizations.map(lo),"hash")}}function Th(e){return Su(new Me.account.ResetWebAuthorization({hash:BigInt(e)}))}function Bh(){return Su(new Me.account.ResetWebAuthorizations)}async function Dh(){const e=await Su(new Me.account.GetNotifyExceptions({compareSound:!0}),{shouldIgnoreUpdates:!0});if(e instanceof Me.Updates||e instanceof Me.UpdatesCombined)return e.updates.reduce((e,t)=>t instanceof Me.UpdateNotifySettings&&t.peer instanceof Me.NotifyPeer?(e[Pa(t.peer.peer)]=Ba(t.notifySettings),e):e,{})}async function Uh(){return await Su(new Me.account.GetContactSignUpNotification)}async function Eh(){const[e,t,s]=await Promise.all([Su(new Me.account.GetNotifySettings({peer:new Me.InputNotifyUsers})),Su(new Me.account.GetNotifySettings({peer:new Me.InputNotifyChats})),Su(new Me.account.GetNotifySettings({peer:new Me.InputNotifyBroadcasts}))]);if(e&&t&&s)return{users:Ba(e),groups:Ba(t),channels:Ba(s)}}function xh(e){return Su(new Me.account.SetContactSignUpNotification({silent:e}))}function Vh(e,{isMuted:t,shouldShowPreviews:s}){let n;n="users"===e?new Me.InputNotifyUsers:"groups"===e?new Me.InputNotifyChats:new Me.InputNotifyBroadcasts;const a={showPreviews:s,muteUntil:t?c:0};return Su(new Me.account.UpdateNotifySettings({peer:n,settings:new Me.InputPeerNotifySettings(a)}))}async function Gh({langPack:e,langCode:t}){const s=await Su(new Me.langpack.GetLangPack({langPack:e,langCode:t}));if(!s)return;const{strings:n,keysToRemove:a}=mo(s.strings);return{version:s.version,strings:n,keysToRemove:a}}async function Fh({langPack:e,langCode:t,fromVersion:s}){const n=await Su(new Me.langpack.GetDifference({langPack:e,langCode:t,fromVersion:s}));if(!n)return;const{strings:a,keysToRemove:i}=mo(n.strings);return{version:n.version,strings:a,keysToRemove:i}}async function Nh(){const e=await Su(new Me.langpack.GetLanguages({langPack:I}));if(e)return e.map(yo)}async function qh({langPack:e,langCode:t}){const s=await Su(new Me.langpack.GetLanguage({langPack:e,langCode:t}));if(s)return yo(s)}async function Hh({langPack:e,langCode:t,keys:s}){const n=await Su(new Me.langpack.GetStrings({langPack:e,langCode:t,keys:s}));if(n)return mo(n)}async function Lh({sourceLangPacks:e,langCode:t}){const s=(await Promise.all(e.map(e=>Su(new Me.langpack.GetLangPack({langPack:e,langCode:fh.includes(t)?`${t}-raw`:t}))))).filter(Boolean).map(ho);if(s.length)return{langPack:Object.assign({},...s.reverse())}}async function Oh(e){const t=In(e);if(!t)return;const s=await Su(new Me.account.GetPrivacy({key:t}));return s?{rules:bi(s.rules)}:void 0}function jh(e){const t=gu.session.getAuthKey().getKey();return Su(new Me.account.RegisterDevice({tokenType:10,secret:t,appSandbox:!1,otherUids:[],token:e}))}function Wh(e){return Su(new Me.account.UnregisterDevice({tokenType:10,otherUids:[],token:e}))}async function zh(e,t){const s=In(e),n=Nn(t);if(!s)return;const a=await Su(new Me.account.SetPrivacy({key:s,rules:n}));return a?{rules:bi(a.rules)}:void 0}async function Kh(e){await Su(new Me.account.UpdateStatus({offline:!e}))}async function $h(){const e=await Su(new Me.account.GetContentSettings);if(e)return{isSensitiveEnabled:Boolean(e.sensitiveEnabled),canChangeSensitive:Boolean(e.sensitiveCanChange)}}function Jh(e){return Su(new Me.account.SetContentSettings({sensitiveEnabled:e||void 0}))}async function Qh(e){const t=await Su(new Me.help.GetPeerColors({hash:e??0}));if(!t)return;const s=function(e){if(e instanceof Me.help.PeerColors)return As(e.colors,e=>[e.colorId,{isHidden:e.hidden,colors:e.colors instanceof Me.help.PeerColorSet?Ma(e.colors):void 0,darkColors:e.darkColors instanceof Me.help.PeerColorSet?Ma(e.darkColors):void 0}])}(t);return s?{colors:s,hash:t instanceof Me.help.PeerColors?t.hash:void 0}:void 0}async function Xh(e){const t=await Su(new Me.help.GetPeerProfileColors({hash:e??0}));if(!t)return;const s=function(e){if(e instanceof Me.help.PeerColors)return As(e.colors,e=>[e.colorId,{isHidden:e.hidden,colors:e.colors instanceof Me.help.PeerColorProfileSet?Aa(e.colors):void 0,darkColors:e.darkColors instanceof Me.help.PeerColorProfileSet?Aa(e.darkColors):void 0}])}(t);return s?{colors:s,hash:t instanceof Me.help.PeerColors?t.hash:void 0}:void 0}async function Yh(e){const t=await Su(new Me.help.GetTimezonesList({hash:e??0}));if(t&&!(t instanceof Me.help.TimezonesListNotModified))return{timezones:t.timezones.map(_o),hash:t.hash}}async function Zh({langCode:e="en"}){const t=await Su(new Me.help.GetCountriesList({langCode:e,hash:0}));if(t instanceof Me.help.CountriesList)return function(e){const t=e.filter(({hidden:e})=>!e);return{phoneCodes:t.map(e=>e.countryCodes.map(t=>fo(e,t))).flat().sort((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName)),general:t.map(e=>fo(e,e.countryCodes[0])).sort((e,t)=>e.name?e.name.localeCompare(t.name):e.defaultName.localeCompare(t.defaultName))}}(t.countries)}async function em(){const e=await Su(new Me.account.GetGlobalPrivacySettings);if(e)return{shouldArchiveAndMuteNewNonContact:Boolean(e.archiveAndMuteNewNoncontactPeers),shouldHideReadMarks:Boolean(e.hideReadMarks),shouldNewNonContactPeersRequirePremium:Boolean(e.newNoncontactPeersRequirePremium),nonContactPeersPaidStars:rs(e.noncontactPeersPaidStars),shouldDisplayGiftsButton:Boolean(e.displayGiftsButton),disallowedGifts:e.disallowedGifts&&wr(e.disallowedGifts)}}async function tm({shouldArchiveAndMuteNewNonContact:e,shouldHideReadMarks:t,shouldNewNonContactPeersRequirePremium:s,nonContactPeersPaidStars:n,shouldDisplayGiftsButton:a,disallowedGifts:i}){const o=await Su(new Me.account.SetGlobalPrivacySettings({settings:new Me.GlobalPrivacySettings({...e&&{archiveAndMuteNewNoncontactPeers:!0},...t&&{hideReadMarks:!0},...s&&{newNoncontactPeersRequirePremium:!0},displayGiftsButton:a||void 0,noncontactPeersPaidStars:BigInt(n||0),disallowedGifts:i&&kn(i)})}));if(o)return{shouldArchiveAndMuteNewNonContact:Boolean(o.archiveAndMuteNewNoncontactPeers),shouldHideReadMarks:Boolean(o.hideReadMarks),shouldNewNonContactPeersRequirePremium:Boolean(o.newNoncontactPeersRequirePremium),nonContactPeersPaidStars:rs(o.noncontactPeersPaidStars),shouldDisplayGiftsButton:a,disallowedGifts:i}}function sm({chatId:e,accessHash:t,username:s,isActive:n}){return Su(e?new Me.channels.ToggleUsername({channel:nn(e,t),username:s,active:n}):new Me.account.ToggleUsername({username:s,active:n}))}function nm({chatId:e,accessHash:t,usernames:s}){return Su(e?new Me.channels.ReorderUsernames({channel:nn(e,t),order:s}):new Me.account.ReorderUsernames({order:s}))}async function am(){const e=await Su(new Me.account.GetPasskeys);if(e)return{passkeys:e.passkeys.map(So)}}async function im(){const e=await Su(new Me.account.InitPasskeyRegistration);if(e)try{return JSON.parse(e.options.data)}catch(e){}}async function om(e){const t=await Su(new Me.account.RegisterPasskey({credential:Ln(e)}));if(t)return So(t)}function rm({id:e}){return Su(new Me.account.DeletePasskey({id:e}),{shouldReturnTrue:!0})}async function dm({chatId:e,accessHash:t,messageId:s,data:n,isGame:a}){const i=await Su(new Me.messages.GetBotCallbackAnswer({peer:tn(e,t),msgId:s,data:n?Fa(n):void 0,game:a||void 0}));return i?Hs(i):void 0}async function cm({bot:e,chat:t,query:s,offset:n=""}){const a=await Su(new Me.messages.GetInlineBotResults({bot:sn(e.id,e.accessHash),peer:tn(t.id,t.accessHash),query:s,offset:n}));var i,o,r,d,c,u;if(a)return{isGallery:Boolean(a.gallery),help:e.botPlaceholder,nextOffset:(c=e.usernames[0].username,u=a.nextOffset,"gif"===c&&"0"===u?"":u),switchPm:(d=a.switchPm,d?Rs(d,["text","startParam"]):void 0),switchWebview:(r=a.switchWebview,r?Rs(r,["text","url"]):void 0),results:(i=String(a.queryId),o=a.results,o.map(e=>e instanceof Me.BotInlineMediaResult?(e.document instanceof Me.Document&&ni(e.document),e.photo instanceof Me.Photo&&si(e.photo),Oi(e,i)):(e.thumb&&ci(e.thumb),Li(e,i)))),cacheTime:a.cacheTime}}async function um({chat:e,replyInfo:t,resultId:s,queryId:n,sendAs:a,isSilent:i,scheduleDate:o,allowPaidStars:r}){const d=z();await Su(new Me.messages.SendInlineBotResult({clearDraft:!0,randomId:d,queryId:BigInt(n),peer:tn(e.id,e.accessHash),id:s,scheduleDate:o,replyTo:t&&Vn(t),...i&&{silent:!0},...a&&{sendAs:tn(a.id,a.accessHash)},...r&&{allowPaidStars:BigInt(r)}}))}async function lm({bot:e,startParam:t}){const s=z();await Su(new Me.messages.StartBot({bot:sn(e.id,e.accessHash),peer:tn(e.id,e.accessHash),randomId:s,startParam:t??Ys}))}async function fm({isSilent:e,peer:t,bot:s,url:n,startParam:a,replyInfo:i,theme:o,sendAs:r,isFromBotMenu:d,isFullscreen:c}){const u=await Su(new Me.messages.RequestWebView({silent:e||void 0,peer:tn(t.id,t.accessHash),bot:sn(s.id,s.accessHash),url:n,startParam:a,themeParams:o?Pn(o):void 0,fromBotMenu:d||void 0,platform:w,replyTo:i&&Vn(i),fullscreen:!!c||void 0,...r&&{sendAs:tn(r.id,r.accessHash)}}));if(u instanceof Me.WebViewResultUrl)return{url:u.url,queryId:u.queryId?.toString(),isFullScreen:Boolean(u.fullscreen)}}async function gm({peer:e,bot:t,startParam:s,mode:n,theme:a}){const i=await Su(new Me.messages.RequestMainWebView({peer:tn(e.id,e.accessHash),bot:sn(t.id,t.accessHash),startParam:s,fullscreen:"fullscreen"===n||void 0,themeParams:a?Pn(a):void 0,platform:w}));if(i instanceof Me.WebViewResultUrl)return{url:i.url,queryId:i.queryId?.toString(),isFullscreen:Boolean(i.fullscreen)}}async function pm({bot:e,url:t,theme:s,startParam:n,isFromSwitchWebView:a,isFromSideMenu:i}){const o=await Su(new Me.messages.RequestSimpleWebView({url:t,bot:sn(e.id,e.accessHash),themeParams:s?Pn(s):void 0,platform:w,startParam:n,fromSwitchWebview:a||void 0,fromSideMenu:i||void 0}));return o?.url}async function hm({bot:e,appName:t}){const s=await Su(new Me.messages.GetBotApp({app:new Me.InputBotAppShortName({botId:sn(e.id,e.accessHash),shortName:t}),hash:0n}));if(s&&!(s instanceof Me.BotAppNotModified))return function(e){const{app:t,inactive:s,requestWriteAccess:n}=e,a=Qi(t);if(a)return{...a,isInactive:s,shouldRequestWriteAccess:n}}(s)}async function mm({peer:e,app:t,startParam:s,mode:n,theme:a,isWriteAllowed:i}){const o=await Su(new Me.messages.RequestAppWebView({peer:tn(e.id,e.accessHash),app:xn(t),startParam:s,themeParams:a?Pn(a):void 0,platform:w,writeAllowed:i||void 0,fullscreen:"fullscreen"===n||void 0}));return{url:o?.url,isFullscreen:Boolean(o?.fullscreen)}}function ym({isSilent:e,peer:t,bot:s,queryId:n,replyInfo:a,sendAs:i}){return Su(new Me.messages.ProlongWebView({silent:e||void 0,peer:tn(t.id,t.accessHash),bot:sn(s.id,s.accessHash),queryId:BigInt(n),replyTo:a&&Vn(a),...i&&{sendAs:tn(i.id,i.accessHash)}}))}async function _m({bot:e,buttonText:t,data:s}){const n=z();await Su(new Me.messages.SendWebViewData({bot:sn(e.id,e.accessHash),buttonText:t,data:s,randomId:n}))}async function bm({hash:e}){const t=await Su(new Me.messages.GetAttachMenuBots({hash:e?BigInt(e):0n}));if(t instanceof Me.AttachMenuBots)return{hash:t.hash.toString(),bots:Ms(t.bots.map(ji),"id")}}async function Sm({bot:e}){const t=await Su(new Me.messages.GetAttachMenuBot({bot:sn(e.id,e.accessHash)}));if(t instanceof Me.AttachMenuBotsBot)return{bot:ji(t.bot)}}function wm({bot:e,isWriteAllowed:t,isEnabled:s}){return Su(new Me.messages.ToggleBotInAttachMenu({bot:sn(e.id,e.accessHash),writeAllowed:t||void 0,enabled:s}))}async function Im({chat:e,buttonId:t,messageId:s}){return Gm(new Me.messages.RequestUrlAuth({peer:tn(e.id,e.accessHash),buttonId:t,msgId:s}))}async function vm({chat:e,messageId:t,buttonId:s,isWriteAllowed:n,wasPhoneShared:a,matchCode:i}){return Gm(new Me.messages.AcceptUrlAuth({peer:tn(e.id,e.accessHash),msgId:t,buttonId:s,writeAllowed:n||void 0,sharePhoneNumber:a||void 0,matchCode:i||void 0}))}async function Pm({url:e}){return Gm(new Me.messages.RequestUrlAuth({url:e}))}async function Cm({url:e,isWriteAllowed:t,wasPhoneShared:s,matchCode:n}){return Gm(new Me.messages.AcceptUrlAuth({url:e,writeAllowed:t||void 0,sharePhoneNumber:s||void 0,matchCode:n||void 0}))}async function Mm({url:e,matchCode:t}){try{return await Su(new Me.messages.CheckUrlAuthMatchCode({url:e,matchCode:t}),{shouldThrow:!0})?{type:"matched"}:{type:"unmatched"}}catch(e){if(e instanceof Ae&&"URL_EXPIRED"===e.errorMessage)return{type:"expired"};throw e}}async function Am({url:e}){return Su(new Me.messages.DeclineUrlAuth({url:e}),{shouldReturnTrue:!0})}function Rm({bot:e}){return Su(new Me.bots.CanSendMessage({bot:sn(e.id,e.accessHash)}))}function km({bot:e}){return Su(new Me.bots.AllowSendMessage({bot:sn(e.id,e.accessHash)}),{shouldReturnTrue:!0})}async function Tm({bot:e,customMethod:t,parameters:s}){try{const n=await Su(new Me.bots.InvokeWebViewCustomMethod({bot:sn(e.id,e.accessHash),params:new Me.DataJSON({data:s}),customMethod:t}),{shouldThrow:!0});return{result:JSON.parse(n.data)}}catch(e){return{error:e.message}}}async function Bm({bot:e}){const t=await Su(new Me.bots.GetPreviewMedias({bot:sn(e.id,e.accessHash)}));if(t)return t.map(e=>({content:Dr(e.media),date:e.date}))}function Dm({bot:e,fileName:t,url:s}){return Su(new Me.bots.CheckDownloadFileParams({bot:sn(e.id,e.accessHash),fileName:t,url:s}),{shouldReturnTrue:!0})}function Um({bot:e,isEnabled:t}){return Su(new Me.bots.ToggleUserEmojiStatusPermission({bot:sn(e.id,e.accessHash),enabled:t}),{shouldReturnTrue:!0})}function Em({bot:e,langCode:t,name:s,about:n,description:a}){return Su(new Me.bots.SetBotInfo({bot:sn(e.id,e.accessHash),langCode:t,name:s,about:n,description:a}),{shouldReturnTrue:!0})}async function xm({offset:e="",limit:t}){const s=await Su(new Me.bots.GetPopularAppBots({offset:e,limit:t??0}));if(s)return{peerIds:s.users.map(no).filter(Boolean).map(({id:e})=>e),nextOffset:s.nextOffset}}async function Vm({user:e}){if(!e)return;const t=sn(e.id,e.accessHash),s=await Su(new Me.bots.GetBotRecommendations({bot:t}));if(!s)return;const n=s?.users.map(no).filter(Boolean);return{similarBots:n,count:s instanceof Me.users.UsersSlice?s.count:n.length}}async function Gm(e){try{const t=await Su(e,{shouldThrow:!0});if(!t)return;const s=function(e){if(e instanceof Me.UrlAuthResultRequest){const{bot:t,domain:s,requestWriteAccess:n,requestPhoneNumber:a,browser:i,platform:o,ip:r,region:d,matchCodes:c,matchCodesFirst:u,userIdHint:l,isApp:f,verifiedAppName:g}=e,p=no(t);if(!p)return;return di(t),{type:"request",domain:s,isApp:f,shouldRequestWriteAccess:n,bot:p,shouldRequestPhoneNumber:a,browser:i,platform:o,ip:r,region:d,matchCodes:c,matchCodesFirst:u,userIdHint:l?.toString(),verifiedAppName:g}}return e instanceof Me.UrlAuthResultAccepted?{type:"accepted",url:e.url}:e instanceof Me.UrlAuthResultDefault?{type:"default"}:void 0}(t);return"request"===s?.type&&ja({"@type":"updateUser",id:s.bot.id,user:s.bot}),s}catch(e){if(e instanceof Ae&&"URL_EXPIRED"===e.errorMessage)return{type:"expired"};throw e}}var Fm=s(48287).hp;const Nm=(1n<<63n)-1n,qm=1n<<64n;function Hm(e){const t=BigInt(e);return t>Nm?t-qm:t}async function Lm({call:e}){const t=await Su(new Me.phone.GetGroupCall({call:Mn(e),limit:0}));if(t)return{groupCall:Vd(t.call)}}function Om({call:e}){return Su(new Me.phone.DiscardGroupCall({call:Mn(e)}),{shouldReturnTrue:!0})}function jm({call:e,participant:t,muted:s,presentationPaused:n,videoStopped:a,videoPaused:i,volume:o,raiseHand:r}){return Su(new Me.phone.EditGroupCallParticipant({call:Mn(e),participant:tn(t.id,t.accessHash),...void 0!==a&&{videoStopped:a},...void 0!==i&&{videoPaused:i},...void 0!==s&&{muted:s},...void 0!==n&&{presentationPaused:n},...void 0!==r&&{raiseHand:r},...void 0!==o&&{volume:o}}),{shouldReturnTrue:!0})}function Wm({groupCall:e,title:t}){return Su(new Me.phone.EditGroupCallTitle({title:t,call:Mn(e)}),{shouldReturnTrue:!0})}async function zm({call:e,canSelfUnmute:t}){const s=await Su(new Me.phone.ExportGroupCallInvite({canSelfUnmute:t||void 0,call:Mn(e)}));if(s)return s.link}async function Km({call:e,offset:t=""}){const s=await Su(new Me.phone.GetGroupParticipants({call:Mn(e),ids:[],sources:[],offset:t,limit:100}));s&&ja({"@type":"updateGroupCallParticipants",groupCallId:e.id,participants:s.participants.map(Ud),nextOffset:s.nextOffset})}function $m({call:e,isPageUnload:t,source:s}){const n=new Me.phone.LeaveGroupCall({call:Mn(e),source:s??0});if(!t)return Su(n,{shouldReturnTrue:!0});wu(n)}async function Jm({call:e,inviteHash:t,params:s,joinAs:n}){const a=await Su(new Me.phone.JoinGroupCall({call:Mn(e),joinAs:n?tn(n.id,n.accessHash):new Me.InputPeerSelf,muted:!0,videoStopped:!0,params:new Me.DataJSON({data:JSON.stringify(s)}),inviteHash:t}),{shouldRetryOnTimeout:!0,abortControllerGroup:"call"});if(a&&a instanceof Me.Updates){const e=a.updates.find(e=>e instanceof Me.UpdateGroupCall);if(!(e instanceof Me.UpdateGroupCall))return;return Vd(e.call)}}async function Qm({peer:e}){const t=K(),s=await Su(new Me.phone.CreateGroupCall({peer:tn(e.id,e.accessHash),randomId:t}));if(s&&s instanceof Me.Updates){const e=s.updates[0];if(e instanceof Me.UpdateGroupCall)return Vd(e.call)}}function Xm({call:e,params:t}){return Su(new Me.phone.JoinGroupCallPresentation({call:Mn(e),params:new Me.DataJSON({data:JSON.stringify(t)})}),{shouldReturnTrue:!0})}function Ym({call:e,subscribed:t}){return Su(new Me.phone.ToggleGroupCallStartSubscription({call:Mn(e),subscribed:t}),{shouldReturnTrue:!0,shouldIgnoreErrors:!0})}function Zm({call:e}){return Su(new Me.phone.LeaveGroupCallPresentation({call:Mn(e)}),{shouldReturnTrue:!0})}async function ey(){const e=await Su(new Me.messages.GetDhConfig({version:0,randomLength:0}));if(e&&!(e instanceof Me.messages.DhConfigNotModified))return{g:e.g,p:Array.from(e.p),random:Array.from(e.random)}}function ty({call:e,isBusy:t,isPageUnload:s}){const n=new Me.phone.DiscardCall({peer:An(e),reason:t?new Me.PhoneCallDiscardReasonBusy:new Me.PhoneCallDiscardReasonHangup,duration:0,connectionId:0n});s?wu(n):Su(n,{shouldReturnTrue:!0})}async function sy({user:e,gAHash:t,isVideo:s}){const n=await Su(new Me.phone.RequestCall({randomId:K(),userId:sn(e.id,e.accessHash),gAHash:Fm.from(t),video:!!s||void 0,protocol:qd()}));if(n)return ja({"@type":"updatePhoneCall",call:Gd(n.phoneCall)}),!0}function ny({call:e,rating:t,comment:s}){return Su(new Me.phone.SetCallRating({rating:t,peer:An(e),comment:s}),{shouldReturnTrue:!0})}function ay({call:e}){return Su(new Me.phone.ReceivedCall({peer:An(e)}))}async function iy({call:e,gB:t}){const s=await Su(new Me.phone.AcceptCall({peer:An(e),gB:Fm.from(t),protocol:qd()}));if(s)return ja({"@type":"updatePhoneCall",call:e=Gd(s.phoneCall)}),!0}async function oy({call:e,gA:t,keyFingerprint:s}){const n=await Su(new Me.phone.ConfirmCall({peer:An(e),gA:Fm.from(t),keyFingerprint:Hm(s),protocol:qd()}));if(n)return ja({"@type":"updatePhoneCall",call:e=Gd(n.phoneCall)}),!0}function ry({data:e,call:t}){return Su(new Me.phone.SendSignalingData({data:Fm.from(e),peer:An(t)}))}async function dy(){const e=await Su(new Me.phone.GetCallConfig);if(e)try{const t=JSON.parse(e.data);return t&&"object"==typeof t&&!Array.isArray(t)?t:void 0}catch{return}}function cy({chat:e,emoticon:t}){return Su(new Me.messages.SetTyping({peer:tn(e.id,e.accessHash),action:new Me.SendMessageEmojiInteractionSeen({emoticon:t})}),{abortControllerChatId:e.id})}function uy({chat:e,emoticon:t,messageId:s,timestamps:n}){return Su(new Me.messages.SetTyping({peer:tn(e.id,e.accessHash),action:new Me.SendMessageEmojiInteraction({emoticon:t,msgId:s,interaction:new Me.DataJSON({data:JSON.stringify({v:1,a:n.map(e=>({t:e,i:1}))})})})}),{abortControllerChatId:e.id})}async function ly(){const e=await Su(new Me.messages.GetAvailableReactions({hash:0}));if(e&&!(e instanceof Me.messages.AvailableReactionsNotModified))return e.reactions.forEach(e=>{e.staticIcon instanceof Me.Document&&(Js.documents[String(e.staticIcon.id)]=e.staticIcon),e.selectAnimation instanceof Me.Document&&(Js.documents[String(e.selectAnimation.id)]=e.selectAnimation),e.aroundAnimation instanceof Me.Document&&(Js.documents[String(e.aroundAnimation.id)]=e.aroundAnimation),e.appearAnimation instanceof Me.Document&&(Js.documents[String(e.appearAnimation.id)]=e.appearAnimation),e.centerIcon instanceof Me.Document&&(Js.documents[String(e.centerIcon.id)]=e.centerIcon)}),e.reactions.map(Di)}async function fy(){const e=await Su(new Me.messages.GetAvailableEffects({hash:0}));if(!e||e instanceof Me.messages.AvailableEffectsNotModified)return;const t=new Map(e.documents.map(e=>[String(e.id),e])),s=e.effects.map(Ui),n=[],a=[];for(const e of s)if(e.effectAnimationId){const s=t.get(e.effectAnimationId),n=s&&Ei(s,!1,e.isPremium);n&&a.push(n)}else{const s=t.get(e.effectStickerId),a=s&&Ei(s);a&&n.push(a)}return{effects:s,emojis:a,stickers:n}}function gy({chat:e,messageId:t,reactions:s,shouldAddToRecent:n}){return Su(new Me.messages.SendReaction({reaction:s?.map(e=>Bn(e)),peer:tn(e.id,e.accessHash),msgId:t,...n&&{addToRecent:!0}}),{shouldReturnTrue:!0,shouldThrow:!0})}function py({chat:e,messageId:t,count:s,isPrivate:n,peerId:a}){return Su(new Me.messages.SendPaidReaction({peer:tn(e.id,e.accessHash),msgId:t,randomId:pn(),count:s,private:on(n,a)}),{shouldReturnTrue:!0,shouldThrow:!0})}function hy({ids:e,chat:t}){Us(e,100).forEach(e=>{Su(new Me.messages.GetMessagesReactions({id:e,peer:tn(t.id,t.accessHash)}),{shouldReturnTrue:!0,abortControllerChatId:t.id})})}async function my({chat:e,messageId:t,reaction:s,offset:n}){const a=await Su(new Me.messages.GetMessageReactionsList({peer:tn(e.id,e.accessHash),id:t,...s&&{reaction:Bn(s)},limit:100,...n&&{offset:n}}));if(!a)return;const{nextOffset:i,reactions:o,count:r}=a;return{nextOffset:i,reactions:o.map(ki).filter(Boolean),count:r}}function yy({reaction:e}){return Su(new Me.messages.SetDefaultReaction({reaction:Bn(e)}))}async function _y({hash:e}){const t=await Su(new Me.messages.GetTopReactions({limit:100,hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.ReactionsNotModified))return{hash:String(t.hash),reactions:t.reactions.map(e=>Ti(e)).filter(Boolean)}}async function by({hash:e}){const t=await Su(new Me.messages.GetRecentReactions({limit:50,hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.ReactionsNotModified))return{hash:String(t.hash),reactions:t.reactions.map(e=>Ti(e)).filter(Boolean)}}function Sy(){return Su(new Me.messages.ClearRecentReactions)}async function wy({hash:e}){const t=await Su(new Me.messages.GetDefaultTagReactions({hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.ReactionsNotModified))return{hash:String(t.hash),reactions:t.reactions.map(e=>Ti(e)).filter(Boolean)}}async function Iy({hash:e}){const t=await Su(new Me.messages.GetSavedReactionTags({hash:e?BigInt(e):0n}));if(t&&!(t instanceof Me.messages.SavedReactionTagsNotModified))return{hash:String(t.hash),tags:t.tags.map(Bi).filter(Boolean)}}function vy({reaction:e,title:t}){return Su(new Me.messages.UpdateSavedReactionTag({reaction:Bn(e),title:t}),{shouldReturnTrue:!0})}async function Py({chat:e,dcId:t}){const s=await Su(new Me.stats.GetBroadcastStats({channel:nn(e.id,e.accessHash)}),{dcId:t});var n;if(s)return{stats:(n=s,{type:"channel",growthGraph:Qo(n.growthGraph),followersGraph:Qo(n.followersGraph),muteGraph:Qo(n.muteGraph),topHoursGraph:Qo(n.topHoursGraph),languagesGraph:Qo(n.languagesGraph),viewsBySourceGraph:Qo(n.viewsBySourceGraph),newFollowersBySourceGraph:Qo(n.newFollowersBySourceGraph),interactionsGraph:Qo(n.interactionsGraph),reactionsByEmotionGraph:Qo(n.reactionsByEmotionGraph),storyInteractionsGraph:Qo(n.storyInteractionsGraph),storyReactionsByEmotionGraph:Qo(n.storyReactionsByEmotionGraph),followers:Yo(n.followers),viewsPerPost:Yo(n.viewsPerPost),sharesPerPost:Yo(n.sharesPerPost),enabledNotifications:Zo(n.enabledNotifications),reactionsPerPost:Yo(n.reactionsPerPost),viewsPerStory:Yo(n.viewsPerStory),sharesPerStory:Yo(n.sharesPerStory),reactionsPerStory:Yo(n.reactionsPerStory),recentPosts:n.recentPostsInteractions.map(zo).filter(Boolean)}),users:[]}}async function Cy({peer:e,dcId:t}){const s=await Su(new Me.payments.GetStarsRevenueStats({peer:tn(e.id,e.accessHash)}),{dcId:t});var n,a;if(s)return{topHoursGraph:(n=s).topHoursGraph?Qo(n.topHoursGraph):void 0,revenueGraph:Qo(n.revenueGraph,void 0,{label:"USD ≈",multiplier:n.usdRate,prefix:"$"}),balances:(a=n.status,{currentBalance:lr(a.currentBalance),availableBalance:lr(a.availableBalance),overallRevenue:lr(a.overallRevenue),isWithdrawalEnabled:a.withdrawalEnabled}),usdRate:n.usdRate}}async function My({chat:e,dcId:t}){const s=await Su(new Me.stats.GetMegagroupStats({channel:nn(e.id,e.accessHash)}),{dcId:t});var n,a;if(s)return{stats:(n=s,{type:"group",growthGraph:Qo(n.growthGraph),membersGraph:Qo(n.membersGraph),topHoursGraph:Qo(n.topHoursGraph),languagesGraph:Qo(n.languagesGraph),messagesGraph:Qo(n.messagesGraph),actionsGraph:Qo(n.actionsGraph),period:(a=n.period,{maxDate:a.maxDate,minDate:a.minDate}),members:Yo(n.members),viewers:Yo(n.viewers),messages:Yo(n.messages),posters:Yo(n.posters)})}}async function Ay({chat:e,messageId:t,dcId:s}){const n=await Su(new Me.stats.GetMessageStats({channel:nn(e.id,e.accessHash),msgId:t}),{dcId:s});if(n)return Ko(n)}async function Ry({chat:e,messageId:t,dcId:s,offset:n="",limit:a=0}){const i=await Su(new Me.stats.GetMessagePublicForwards({channel:nn(e.id,e.accessHash),msgId:t,offset:n,limit:a}),{dcId:s});if(i)return{forwards:$o(i),count:i.count,nextOffset:i.nextOffset}}async function ky({token:e,x:t,isPercentage:s,dcId:n}){const a=await Su(new Me.stats.LoadAsyncGraph({token:e,...t&&{x:BigInt(t)}}),{dcId:n});if(!a)return;const i=Qo(a,s);return"graph"===i.graphType?i:void 0}async function Ty({chat:e,storyId:t,dcId:s}){const n=await Su(new Me.stats.GetStoryStats({peer:tn(e.id,e.accessHash),id:t}),{dcId:s});if(n)return Ko(n)}async function By({chat:e,storyId:t,dcId:s,offset:n="",limit:a=0}){const i=await Su(new Me.stats.GetStoryPublicForwards({peer:tn(e.id,e.accessHash),id:t,offset:n,limit:a}),{dcId:s});if(i)return{publicForwards:Jo(i),count:i.count,nextOffset:i.nextOffset}}async function Dy({peer:e,currentPassword:t}){try{const s=await Yu(t);if(!s)return;if("error"in s)return s;const n=await Su(new Me.payments.GetStarsRevenueWithdrawalUrl({peer:tn(e.id,e.accessHash),password:s}),{shouldThrow:!0});if(!n)return;return{url:n.url}}catch(e){if(!Na(e))return;return Ha(e)}}var Uy=s(48287).hp;const Ey=5e3,xy=5242880,Vy=function(){const e=[];for(let t=0;t<256;t++){let s=t;for(let e=0;e<8;e++)s=1&s?2197175160^s>>>1:s>>>1;e[t]=s>>>0}return e}();class Gy{localTag=Hy();localTsn=Hy();localSsn=0;initSent=!1;initSentAt=0;initRetryCount=0;isEstablished=!1;cookie=Uy.alloc(0);pendingPayloads=[];pendingPackets=[];pendingPeerData=new Map;pendingPeerDataSize=0;wrapPayload(e){return this.isEstablished&&void 0!==this.peerTag?Array.from(this.createDataPacket(e)):(this.pendingPayloads.push(e),this.initSent?this.shouldRetryInit()?(this.initRetryCount,this.pendingPayloads.length,this.createInitRetryPacket()):void 0:this.createInitRetryPacket())}shouldRetryInit(){return!(!this.initSentAt||void 0!==this.peerTag)&&Date.now()-this.initSentAt>=this.getInitRetryDelay()}getInitRetryDelay(){return this.initRetryCount?Math.min(1e3*2**(this.initRetryCount-1),8e3):1e3}createInitRetryPacket(){return this.initSent=!0,this.initSentAt=Date.now(),this.initRetryCount++,Array.from(this.createInitPacket())}drainPackets(){const e=this.pendingPackets;return this.pendingPackets=[],e}receive(e){const t=[];if(e.length<12)return e.length,t;if(!function(e){return Ny(e)&&e.readUInt32LE(8)===Ly(e)}(e))return e.length,e.readUInt16BE(0),e.readUInt16BE(2),e.readUInt32BE(4),t;const s=function(e){const t=[];let s=12;for(;s+4<=e.length;){const n=e[s],a=e[s+1],i=e.readUInt16BE(s+2);if(i<4||s+i>e.length)break;t.push({type:n,flags:a,body:e.slice(s+4,s+i)}),s+=qy(i)}return t}(e);return s.forEach(s=>{if(this.validateVerificationTag(e,s.type))if(1===s.type)this.handleInit(s.body);else if(2===s.type)this.handleInitAck(s.body);else if(10===s.type){if(!this.validateCookieEcho(s.body))return s.body.length,void this.cookie.length;this.pendingPackets.push(Array.from(this.createPacket(11,0,Uy.alloc(0)))),this.markEstablished()}else 11===s.type?this.markEstablished():0===s.type?t.push(...this.handleData(s.flags,s.body)):3===s.type?this.handleSack(s.body):4===s.type?this.pendingPackets.push(Array.from(this.createPacket(5,0,s.body))):5===s.type||(6===s.type?(s.body.length,this.resetAssociation()):(s.type,s.flags,s.body.length));else s.type,e.readUInt32BE(4),1===s.type||this.localTag}),t}validateCookieEcho(e){return Boolean(this.cookie.length&&e.length===this.cookie.length&&e.equals(this.cookie))}validateVerificationTag(e,t){const s=e.readUInt32BE(4);return 1===t?0===s:s===this.localTag}handleInit(e){e.length<16?e.length:(this.peerTag=e.readUInt32BE(0),this.peerInitialTsn=e.readUInt32BE(12),this.peerCumulativeTsn=this.peerInitialTsn-1>>>0,this.initSent=!0,this.cookie=this.createCookie(),this.pendingPackets.push(Array.from(this.createInitAckPacket())))}handleInitAck(e){if(e.length<16)return void e.length;this.peerTag=e.readUInt32BE(0),this.peerInitialTsn=e.readUInt32BE(12),this.peerCumulativeTsn=this.peerInitialTsn-1>>>0;const t=function(e){let t=0;for(;t+4<=e.length;){const s=e.readUInt16BE(t),n=e.readUInt16BE(t+2);if(n<4||t+n>e.length)return;if(7===s)return e.slice(t+4,t+n);t+=qy(n)}}(e.slice(16));t?this.pendingPackets.push(Array.from(this.createPacket(10,0,t))):e.length}handleData(e,t){if(t.length<12)return t.length,[];const s=t.readUInt32BE(0),n=t.readUInt16BE(4),a=t.readUInt32BE(8);if(0!==n||53!==a)return[];const i=this.getNextPeerTsn();return void 0!==i&&s!==i?(function(e,t){return e-t>>>0<2147483648}(s,i)?this.bufferPendingPeerData(s,e,t,i):this.peerCumulativeTsn,this.pendingPackets.push(Array.from(this.createSackPacket())),[]):this.acceptData(s,e,t)}acceptData(e,t,s){const n=[];let a=e,i=t,o=s;for(;;){const e=this.readDataPayload(a,i,o);e&&n.push(e);const t=this.getNextPeerTsn(),s=void 0===t?void 0:this.pendingPeerData.get(t);if(void 0===t||!s)break;this.deletePendingPeerData(t),a=t,i=s.flags,o=s.body}return this.pendingPackets.push(Array.from(this.createSackPacket())),n}readDataPayload(e,t,s){this.markEstablished(),this.peerCumulativeTsn=e;const n=s.slice(12),a=Boolean(2&t),i=Boolean(1&t);if(a&&i)return n;if(a)return void(this.reassembly=[n]);if(!this.reassembly)return;if(this.reassembly.push(n),!i)return;const o=Uy.concat(this.reassembly);return this.reassembly=void 0,o}handleSack(e){e.length<12?e.length:this.markEstablished()}getNextPeerTsn(){if(void 0!==this.peerCumulativeTsn)return this.peerCumulativeTsn+1>>>0}bufferPendingPeerData(e,t,s,n){if(this.pendingPeerData.has(e))return this.pendingPeerData.size,void this.pendingPeerDataSize;const a=function(e,t){return e-t>>>0}(e,n);a>1024||this.pendingPeerData.size>=256||this.pendingPeerDataSize+s.length>1048576?(this.peerCumulativeTsn,this.pendingPeerData.size,this.pendingPeerDataSize):(this.pendingPeerData.set(e,{flags:t,body:s}),this.pendingPeerDataSize+=s.length,this.peerCumulativeTsn,this.pendingPeerData.size,this.pendingPeerDataSize)}deletePendingPeerData(e){const t=this.pendingPeerData.get(e);t&&(this.pendingPeerDataSize-=t.body.length,this.pendingPeerData.delete(e))}clearPendingPeerData(){this.pendingPeerData.clear(),this.pendingPeerDataSize=0}flushPendingPayloads(){if(void 0===this.peerTag)return;const e=this.pendingPayloads;this.pendingPayloads=[],e.forEach(e=>{this.pendingPackets.push(Array.from(this.createDataPacket(e)))})}markEstablished(){this.isEstablished||(this.isEstablished=!0,this.flushPendingPayloads())}resetAssociation(){this.localTag=Hy(),this.localTsn=Hy(),this.localSsn=0,this.peerTag=void 0,this.peerInitialTsn=void 0,this.peerCumulativeTsn=void 0,this.initSent=!1,this.initSentAt=0,this.initRetryCount=0,this.isEstablished=!1,this.cookie=Uy.alloc(0),this.pendingPayloads=[],this.pendingPackets=[],this.clearPendingPeerData(),this.reassembly=void 0}createInitPacket(){const e=Uy.alloc(16);return e.writeUInt32BE(this.localTag,0),e.writeUInt32BE(xy,4),e.writeUInt16BE(65535,8),e.writeUInt16BE(65535,10),e.writeUInt32BE(this.localTsn,12),this.createPacket(1,0,e,0)}createInitAckPacket(){const e=Uy.alloc(16);return e.writeUInt32BE(this.localTag,0),e.writeUInt32BE(xy,4),e.writeUInt16BE(65535,8),e.writeUInt16BE(65535,10),e.writeUInt32BE(this.localTsn,12),this.createPacket(2,0,Uy.concat([e,Fy(7,this.cookie)]))}createDataPacket(e){const t=Uy.alloc(12+e.length);return t.writeUInt32BE(this.localTsn,0),this.localTsn=this.localTsn+1>>>0,t.writeUInt16BE(0,4),t.writeUInt16BE(this.localSsn,6),this.localSsn=this.localSsn+1&65535,t.writeUInt32BE(53,8),e.copy(t,12),this.createPacket(0,3,t)}createSackPacket(){const e=Uy.alloc(12);return e.writeUInt32BE(this.peerCumulativeTsn||0,0),e.writeUInt32BE(xy,4),e.writeUInt16BE(0,8),e.writeUInt16BE(0,10),this.createPacket(3,0,e)}createPacket(e,t,s,n=this.peerTag||0){const a=function(e,t,s){const n=4+s.length,a=qy(n),i=Uy.alloc(a);return i[0]=e,i[1]=t,i.writeUInt16BE(n,2),s.copy(i,4),i}(e,t,s),i=Uy.alloc(12+a.length);return i.writeUInt16BE(Ey,0),i.writeUInt16BE(Ey,2),i.writeUInt32BE(n,4),a.copy(i,12),i.writeUInt32LE(Ly(i),8),i}createCookie(){const e=Uy.alloc(16);return e.writeUInt32BE(this.localTag,0),e.writeUInt32BE(this.peerTag||0,4),e.writeUInt32BE(this.localTsn,8),e.writeUInt32BE(this.peerInitialTsn||0,12),e}}function Fy(e,t){const s=4+t.length,n=Uy.alloc(qy(s));return n.writeUInt16BE(e,0),n.writeUInt16BE(s,2),t.copy(n,4),n}function Ny(e){return e.length>=12&&e.readUInt16BE(0)===Ey&&e.readUInt16BE(2)===Ey}function qy(e){return e+3&-4}function Hy(){const e=new Uint32Array(1);return crypto.getRandomValues(e),e[0]>>>0}function Ly(e){const t=Uy.from(e);t.writeUInt32LE(0,8);let s=4294967295;for(let e=0;e<t.length;e++)s=Vy[255&(s^t[e])]^s>>>8;return~s>>>0}var Oy=s(48287).hp;let jy;class Wy{sctp=new Gy;seq=0;maxInboundSeq=0;inboundSeqs=new Set;isDestroyed=!1;constructor(e,t=!0){this.isOutgoing=e,this.shouldUseSctp=t,this.waitForState=new Promise(e=>{this.resolveState=e})}destroy(){this.isDestroyed=!0,this.resolveState?.(),this.resolveState=void 0}setShouldUseSctp(e){this.shouldUseSctp=e}async requestCall({p:e,g:t,random:s}){const n=H(Oy.from(e),!1),a=H(Oy.from(s),!1),i=X(BigInt(t),a,n);this.gA=i,this.p=n,this.random=a;const o=await Q(Y(i));return Array.from(o)}acceptCall({p:e,g:t,random:s}){const n=H(Oy.from(e),!1),a=H(Oy.from(s),!1),i=X(BigInt(t),a,n);return this.gB=i,this.p=n,this.random=a,Array.from(Y(i))}async confirmCall(e,t,s){if(!this.random||!this.p)throw new Error("Values not set");this.isOutgoing?this.gB=H(Oy.from(e),!1):this.gA=H(Oy.from(e),!1);const n=X(this.isOutgoing?this.gB:this.gA,this.random,this.p),a=H((await J(Y(n))).slice(-8),!0,!0),i=await async function(e,t,s,n){const a=await Q(Oy.concat([new Uint8Array(e),new Uint8Array(t)])),i=[],o=n.length-1;for(let e=0;e!==a.byteLength;e+=8){const t=zy(a.subarray(e,e+8)),r=Number(t%BigInt(o)),d=n[r],c=n[r+1]-d;i.push(String.fromCharCode(...s.subarray(d,d+c)))}return i.join("")}(Y(n),Y(this.gA),t,s);return this.authKey=O(n,256,!1),this.resolveState?.(),this.resolveState=void 0,{gA:Array.from(Y(this.gA)),keyFingerprint:a.toString(),emojis:i}}async calcKey(e,t){if(!this.authKey)throw new Error("Auth key unset");const s=128+(this.isOutgoing!==t?8:0),[n,a]=await Promise.all([Q(Oy.concat([e,this.authKey.slice(s,s+36)])),Q(Oy.concat([this.authKey.slice(s+40,s+76),e]))]);return{key:Oy.concat([n.slice(0,8),a.slice(8,24),n.slice(24,32)]),iv:Oy.concat([a.slice(0,4),n.slice(8,16),a.slice(24,28)])}}async encode(e){if(!this.authKey)return;const t=Oy.from((0,Ye.u3)(Oy.from(JSON.stringify(e)))),s=Oy.alloc(4+t.length);s.writeUInt32BE(++this.seq,0),t.copy(s,4);const n=128+(this.isOutgoing?0:8),a=(await Q(Oy.concat([this.authKey.slice(88+n,88+n+32),s]))).slice(8,24),{key:i,iv:o}=await this.calcKey(a,!0),r=new Rt(i,o).encrypt(s),d=Oy.concat([a,r]);return this.shouldUseSctp?this.sctp.wrapPayload(d):Array.from(d)}async decode(e){if(this.isDestroyed)return;if(!this.authKey){if(await this.waitForState,this.isDestroyed||!this.authKey)return;return this.decode(e)}const t=Oy.from(e),s=Ny(t)?this.sctp.receive(t):[],n=s.length?s:[t],a=[];for(const e of n){const t=await this.decodeBody(e);t&&a.push(t)}return a.length>1?a:a[0]}async decodeBody(e){if(e.length<21)return;const t=this.authKey;if(!t)return;const s=e.slice(0,16),n=e.slice(16),{key:a,iv:i}=await this.calcKey(s,!1),o=new Rt(a,i).decrypt(n),r=128+(this.isOutgoing?8:0),d=await Q(Oy.concat([t.slice(88+r,88+r+32),o]));if(!s.equals(d.slice(8,24)))return;if(o.length<4)return;const c=o.readUInt32BE(0);if(!this.shouldAcceptInboundSeq(c))return;const u=o.slice(4);try{const e=31===u[0]&&139===u[1]?Oy.from((0,Ye.Wt)(u)):u;return this.markInboundSeq(c),JSON.parse(e.toString())}catch{return}}shouldAcceptInboundSeq(e){return Boolean(e&&e>this.maxInboundSeq-64&&!this.inboundSeqs.has(e))}markInboundSeq(e){this.inboundSeqs.add(e),e>this.maxInboundSeq&&(this.maxInboundSeq=e);const t=this.maxInboundSeq-64;this.inboundSeqs.forEach(e=>{e<=t&&this.inboundSeqs.delete(e)})}drainSignalingData(){return this.shouldUseSctp?this.sctp.drainPackets():[]}}function zy(e){return(0x7Fn&BigInt(e[0]))<<56n|BigInt(e[1])<<48n|BigInt(e[2])<<40n|BigInt(e[3])<<32n|BigInt(e[4])<<24n|BigInt(e[5])<<16n|BigInt(e[6])<<8n|BigInt(e[7])}function Ky({isOutgoing:e,shouldUseSctp:t=!0}){jy=new Wy(e,t)}function $y(e){jy?.setShouldUseSctp(e)}function Jy(){jy?.destroy(),jy=void 0}function Qy(e){return jy.encode(...e)}async function Xy(e){if(jy)return await jy.decode(...e)}function Yy(){return jy?.drainSignalingData()||[]}function Zy(e){return jy.confirmCall(...e)}function e_(e){return jy.acceptCall(...e)}function t_(e){return jy.requestCall(...e)}async function s_({stateHash:e,isFirstRequest:t=!1,isHidden:s=!1}){const n=t?s?{hidden:!0}:{}:{state:e,next:!0,...s&&{hidden:!0}},a=await Su(new Me.stories.GetAllStories(n));if(!a)return;if(a instanceof Me.stories.AllStoriesNotModified)return{state:a.state,stealthMode:Id(a.stealthMode)};const i=a.peerStories.reduce((e,t)=>{const s=Pa(t.peer),n=function(e){const t=Pa(e.peer);return As(e.stories,e=>[e.id,bd(t,e)])}(t),{profileIds:a,orderedIds:i,lastUpdatedAt:o}=Object.values(n).reduce((e,t)=>("isInProfile"in t&&t.isInProfile&&e.profileIds.push(t.id),"isDeleted"in t||(e.orderedIds.push(t.id),e.lastUpdatedAt=Math.max(t.date,e.lastUpdatedAt||0)),e),{profileIds:[],orderedIds:[],lastUpdatedAt:void 0});return 0===i.length||(e[s]={byId:n,orderedIds:i,profileIds:a,lastUpdatedAt:o,lastReadId:t.maxReadId}),e},{});return a.peerStories.forEach(e=>e.stories.forEach(t=>ti(t,Pa(e.peer)))),{peerStories:i,hasMore:a.hasMore,state:a.state,stealthMode:Id(a.stealthMode)}}async function n_({peer:e}){const t=await Su(new Me.stories.GetPeerStories({peer:tn(e.id,e.accessHash)}));if(!t)return;const s=As(t.stories.stories,t=>[t.id,bd(e.id,t)]);return t.stories.stories.forEach(t=>ti(t,e.id)),{stories:s,lastReadStoryId:t.stories.maxReadId}}function a_({peer:e,offsetId:t=0}){return S_({method:new Me.stories.GetPinnedStories({peer:tn(e.id,e.accessHash),offsetId:t,limit:100}),peerId:e.id})}function i_({peer:e,offsetId:t=0}){return S_({method:new Me.stories.GetStoriesArchive({peer:e&&tn(e.id,e.accessHash),offsetId:t,limit:100}),peerId:e.id})}async function o_({peer:e,ids:t}){const s=new Me.stories.GetStoriesByID({peer:tn(e.id,e.accessHash),id:t});let n;try{n=await Su(s,{shouldThrow:!0})}catch(n){return n instanceof Ae&&"CHANNEL_PRIVATE"===n.errorMessage?{stories:r_(e.id,t)}:void Ru(n,s)}if(!n)return;const a=t.reduce((t,s)=>{const a=n.stories.find(({id:e})=>e===s);return t[s]=a?bd(e.id,a):{id:s,peerId:e.id,isDeleted:!0},t},{});return n.stories.forEach(t=>ti(t,e.id)),{pinnedIds:n.pinnedToTop,stories:a}}function r_(e,t){return t.reduce((t,s)=>(t[s]={id:s,peerId:e,isDeleted:!0},t),{})}function d_({peer:e,storyId:t}){return Su(new Me.stories.IncrementStoryViews({peer:tn(e.id,e.accessHash),id:[t]}))}function c_({peer:e,storyId:t}){return Su(new Me.stories.ReadStories({peer:tn(e.id,e.accessHash),maxId:t}))}function u_({peer:e,storyId:t}){return Su(new Me.stories.DeleteStories({peer:tn(e.id,e.accessHash),id:[t]}))}function l_({peer:e,storyId:t,isInProfile:s}){return Su(new Me.stories.TogglePinned({peer:tn(e.id,e.accessHash),id:[t],pinned:Boolean(s)}))}function f_({peer:e,storyIds:t}){return Su(new Me.stories.TogglePinnedToTop({peer:tn(e.id,e.accessHash),id:t}))}async function g_({peer:e,storyId:t,areJustContacts:s,query:n,areReactionsFirst:a,limit:i=100,offset:o=""}){const r=await Su(new Me.stories.GetStoryViewsList({peer:tn(e.id,e.accessHash),id:t,justContacts:s,q:n,reactionsFirst:a,limit:i,offset:o}));if(r)return{views:r.views.map(wd).filter(Boolean),nextOffset:r.nextOffset,reactionsCount:r.reactionsCount,viewsCount:r.count}}async function p_({peer:e,storyIds:t}){const s=await Su(new Me.stories.GetStoriesViews({peer:tn(e.id,e.accessHash),id:t}));if(s?.views[0])return{views:Sd(s.views[0])}}async function h_({peer:e,storyId:t}){const s=await Su(new Me.stories.ExportStoryLink({peer:tn(e.id,e.accessHash),id:t}));if(s)return s.link}async function m_({peer:e,storyId:t,description:s,option:n}){try{const a=await Su(new Me.stories.Report({peer:tn(e.id,e.accessHash),id:[t],option:Fa(n),message:s}),{shouldThrow:!0});if(!a)return;return{result:md(a),error:void 0}}catch(e){const t=e.message;if(t===b)return{result:void 0,error:t};throw e}}function y_({peer:e,id:t,privacy:s}){return Su(new Me.stories.EditStory({peer:tn(e.id,e.accessHash),id:t,privacyRules:Nn(s)}),{shouldReturnTrue:!0})}function __({peer:e,isHidden:t}){return Su(new Me.stories.TogglePeerStoriesHidden({peer:tn(e.id,e.accessHash),hidden:t}))}function b_({peers:e}){return Su(new Me.stories.GetPeerMaxIDs({id:e.map(e=>tn(e.id,e.accessHash))}),{shouldIgnoreErrors:!0})}async function S_({method:e,peerId:t}){const s=await Su(e);if(!s)return;const n=As(s.stories,e=>[e.id,bd(t,e)]);return s.stories.forEach(e=>ti(e,t)),{count:s.count,stories:n,pinnedIds:s.pinnedToTop}}function w_({peer:e,storyId:t,reaction:s,shouldAddToRecent:n}){return Su(new Me.stories.SendReaction({reaction:s?Bn(s):new Me.ReactionEmpty,peer:tn(e.id,e.accessHash),storyId:t,...n&&{addToRecent:!0}}),{shouldReturnTrue:!0})}function I_({isForPast:e,isForFuture:t}){return Su(new Me.stories.ActivateStealthMode({past:e,future:t}),{shouldReturnTrue:!0})}async function v_({peer:e}){const t=await Su(new Me.stories.GetAlbums({peer:tn(e.id,e.accessHash),hash:0n}));if(t&&!(t instanceof Me.stories.AlbumsNotModified))return t.albums.map(Cd)}async function P_({peer:e,albumId:t,offset:s=0,limit:n=100}){const a=await Su(new Me.stories.GetAlbumStories({peer:tn(e.id,e.accessHash),albumId:t,offset:s,limit:n}));if(!a)return;const i=As(a.stories,t=>[t.id,bd(e.id,t)]);return a.stories.forEach(t=>{t&&t instanceof Me.StoryItem&&ti(t,e.id)}),{stories:i,pinnedIds:a.pinnedToTop,count:a.count}}async function C_({inputInvoice:e,requestInfo:t,shouldSave:s}){const n=await Su(new Me.payments.ValidateRequestedInfo({invoice:Tn(e),save:s||void 0,info:wn(t)}));if(!n)return;const{id:a,shippingOptions:i}=n;return a?{id:a,shippingOptions:tr(i)}:void 0}async function M_({inputInvoice:e,formId:t,requestedInfoId:s,shippingOptionId:n,credentials:a,savedCredentialId:i,temporaryPassword:o,tipAmount:r}){const d=o&&i?new Me.InputPaymentCredentialsSaved({id:i,tmpPassword:Fa(o)}):new Me.InputPaymentCredentials({save:a.save,data:new Me.DataJSON({data:JSON.stringify(a.data)})}),c=await Su(new Me.payments.SendPaymentForm({formId:BigInt(t),invoice:Tn(e),requestedInfoId:s,shippingOptionId:n,credentials:d,...r&&{tipAmount:BigInt(r)}}));if(c)return c instanceof Me.payments.PaymentVerificationNeeded?{verificationUrl:c.url}:(bu(c.updates),{completed:!0})}async function A_({formId:e,inputInvoice:t}){const s=await Su(new Me.payments.SendStarsForm({formId:BigInt(e),invoice:Tn(t)}));if(s&&!(s instanceof Me.payments.PaymentVerificationNeeded)){if(bu(s.updates),"chatInviteSubscription"===t.type){const e="updates"in s.updates?s.updates.updates:void 0,t=e?.find(e=>e instanceof Me.UpdateChannel)?.channelId;if(!t)return;return{channelId:va(t,"channel")}}return{completed:!0}}}async function R_(e,t){try{const s=await Su(new Me.payments.GetPaymentForm({invoice:Tn(e),themeParams:t?Pn(t):void 0}),{shouldThrow:!0});if(!s)return;return function(e){if(e instanceof Me.payments.PaymentFormStarGift){const{formId:t}=e;return{type:"stargift",formId:String(t),invoice:nr(e.invoice)}}if(e instanceof Me.payments.PaymentFormStars){const{botId:t,formId:s,title:n,description:a,photo:i}=e;return i&&ci(i),{type:"stars",botId:va(t,"user"),formId:String(s),title:n,description:a,photo:Kr(i),invoice:nr(e.invoice)}}const{formId:t,canSaveCredentials:s,passwordMissing:n,providerId:a,nativeProvider:i,nativeParams:o,savedInfo:r,invoice:d,savedCredentials:c,url:u,botId:l,description:f,title:g,photo:p}=e;p&&ci(p);const{shippingAddress:h}=r||{},m=r?Hs(r):void 0;m&&h&&(m.shippingAddress=Hs(h));const y=o?JSON.parse(o.data):{};return{type:"regular",title:g,description:f,photo:Kr(p),url:u,botId:va(l,"user"),canSaveCredentials:s,isPasswordMissing:n,formId:String(t),providerId:String(a),nativeProvider:i,savedInfo:m,invoice:nr(d),nativeParams:{needCardholderName:Boolean(y?.need_cardholder_name),needCountry:Boolean(y?.need_country),needZip:Boolean(y?.need_zip),publishableKey:y?.publishable_key,publicToken:y?.public_token,tokenizeUrl:y?.tokenize_url},savedCredentials:c&&(_=c,_.map(({id:e,title:t})=>({id:e,title:t})))};var _}(s)}catch(e){if(e instanceof Ae)return{error:e.errorMessage};throw e}}async function k_(e,t){const s=await Su(new Me.payments.GetPaymentReceipt({peer:tn(e.id,e.accessHash),msgId:t}));if(s)return{receipt:sr(s)}}async function T_(){const e=await Su(new Me.help.GetPremiumPromo);if(e)return e.videos.forEach(e=>{e instanceof Me.Document&&(Js.documents[e.id.toString()]=e)}),{promo:ar(e)}}async function B_(e){const t=await Xu(e);if(t)return"error"in t?t:{value:Ga(t.tmpPassword),validUntil:t.validUntil}}async function D_(){const e=await Su(new Me.premium.GetMyBoosts);if(e)return{boosts:e.myBoosts.map(rr)}}async function U_({chat:e,slots:t}){const s=await Su(new Me.premium.ApplyBoost({peer:tn(e.id,e.accessHash),slots:t}));if(s)return{boosts:s.myBoosts.map(rr)}}async function E_({chat:e}){const t=await Su(new Me.premium.GetBoostsStatus({peer:tn(e.id,e.accessHash)}));if(t)return function(e){const{level:t,boostUrl:s,boosts:n,giftBoosts:a,myBoost:i,currentLevelBoosts:o,nextLevelBoosts:r,premiumAudience:d,prepaidGiveaways:c}=e;return{level:t,currentLevelBoosts:o,boosts:n,hasMyBoost:Boolean(i),boostUrl:s,giftBoosts:a,nextLevelBoosts:r,premiumSubscribers:d&&Zo(d),prepaidGiveaways:c?.map(e=>{return(t=e)instanceof Me.PrepaidGiveaway?{type:"giveaway",id:t.id.toString(),date:t.date,months:t.months,quantity:t.quantity}:{type:"starsGiveaway",id:t.id.toString(),stars:rs(t.stars),quantity:t.quantity,boosts:t.boosts,date:t.date};var t})}}(t)}async function x_({chat:e,isGifts:t,offset:s="",limit:n=0}){const a=await Su(new Me.premium.GetBoostsList({peer:tn(e.id,e.accessHash),gifts:t||void 0,offset:s,limit:n}));if(!a)return;const i=a.boosts.map(or);return{count:a.count,boostList:i,nextOffset:a.nextOffset}}async function V_({peer:e,messageId:t}){const s=await Su(new Me.payments.GetGiveawayInfo({peer:tn(e.id,e.accessHash),msgId:t}));if(s)return function(e){if(e instanceof Me.payments.GiveawayInfo){const{startDate:t,adminDisallowedChatId:s,disallowedCountry:n,joinedTooEarlyDate:a,participating:i,preparingResults:o}=e;return{type:"active",startDate:t,isParticipating:i,adminDisallowedChatId:void 0!==s?va(s,"channel"):void 0,disallowedCountry:n,joinedTooEarlyDate:a,isPreparingResults:o}}{const{activatedCount:t,finishDate:s,giftCodeSlug:n,winner:a,refunded:i,startDate:o,winnersCount:r,starsPrize:d}=e;return{type:"results",startDate:o,activatedCount:t,finishDate:s,winnersCount:r,giftCodeSlug:n,isRefunded:i,isWinner:a,starsPrize:rs(d)}}}(s)}async function G_({slug:e}){const t=await Su(new Me.payments.CheckGiftCode({slug:e}));if(t)return{code:dr(t)}}function F_({slug:e}){return Su(new Me.payments.ApplyGiftCode({slug:e}),{shouldReturnTrue:!0})}async function N_({chat:e}){const t=await Su(new Me.payments.GetPremiumGiftCodeOptions({boostPeer:e&&tn(e.id,e.accessHash)}));if(t)return t.map(cr)}function q_({chat:e,giveawayId:t,paymentPurpose:s}){return Su(new Me.payments.LaunchPrepaidGiveaway({peer:tn(e.id,e.accessHash),giveawayId:BigInt(t),purpose:Rn(s)}),{shouldReturnTrue:!0})}async function H_(e){const t="username"in e?new Me.InputCollectibleUsername({username:e.username}):new Me.InputCollectiblePhone({phone:e.phone}),s=await Su(new Me.fragment.GetCollectibleInfo({collectible:t}));if(s)return function(e){const{amount:t,currency:s,cryptoAmount:n,cryptoCurrency:a,purchaseDate:i,url:o}=e;return{amount:rs(t),currency:s,cryptoAmount:rs(n),cryptoCurrency:a,purchaseDate:i,url:o}}(s)}async function L_({giftId:e}){const t=await Su(new Me.payments.CheckCanSendGift({giftId:BigInt(e)}));if(t)return t instanceof Me.payments.CheckCanSendGiftResultOk?{canSend:!0}:t instanceof Me.payments.CheckCanSendGiftResultFail?{canSend:!1,reason:Si(t.reason)}:void 0}async function O_(){const e=await Su(new Me.payments.GetStarsGiveawayOptions);if(e)return e.map(fr)}async function j_(){const e=await Su(new Me.payments.GetStarGifts({hash:0}));if(!e||e instanceof Me.payments.StarGiftsNotModified)return;const t=e.chats?.map(e=>Mo(e)).filter(Boolean),s=e.users?.map(no).filter(Boolean);return{gifts:e.gifts.map(yr).filter(e=>"starGift"===e.type),chats:t,users:s}}async function W_({giftId:e,offset:t="",limit:s=0,attributesHash:n,filter:a,forCraft:i}){const o=[...a?.backdropAttributes??[],...a?.modelAttributes??[],...a?.patternAttributes??[]],r={giftId:BigInt(e),offset:t,limit:s,attributesHash:n?BigInt(n):0n,attributes:Ir(o),forCraft:i||void 0,sortByPrice:"byPrice"===a?.sortType||void 0,sortByNum:"byNumber"===a?.sortType||void 0,starsOnly:a?.starsOnly||void 0},d=await Su(new Me.payments.GetResaleStarGifts(r));if(d)return function(e){const{count:t,nextOffset:s,attributesHash:n}=e,a=e.gifts.map(e=>yr(e)),i=e.attributes?.map(e=>br(e)).filter(Boolean),o=e.users.map(e=>no(e)).filter(Boolean),r=e.chats.map(e=>Mo(e)).filter(Boolean),d=e.counters?.map(e=>function(e){const{count:t}=e,s=function(e){return e instanceof Me.StarGiftAttributeIdModel?{type:"model",documentId:e.documentId.toString()}:e instanceof Me.StarGiftAttributeIdPattern?{type:"pattern",documentId:e.documentId.toString()}:e instanceof Me.StarGiftAttributeIdBackdrop?{type:"backdrop",backdropId:e.backdropId}:void 0}(e.attribute);if(s)return{count:t,attribute:s}}(e)).filter(Boolean);return{count:t,gifts:a,nextOffset:s,attributes:i,attributesHash:n?.toString(),chats:r,counters:d,users:o}}(d)}async function z_({peer:e,offset:t="",limit:s=0,filter:n,collectionId:a}){const i={peer:tn(e.id,e.accessHash),offset:t,limit:s,collectionId:a,...n&&{sortByValue:"byValue"===n.sortType||void 0,excludeUnlimited:!n.shouldIncludeUnlimited||void 0,excludeUpgradable:!n.shouldIncludeUpgradable||void 0,excludeUnupgradable:!n.shouldIncludeLimited||void 0,excludeUnique:!n.shouldIncludeUnique||void 0,excludeSaved:!n.shouldIncludeDisplayed||void 0,excludeUnsaved:!n.shouldIncludeHidden||void 0}},o=await Su(new Me.payments.GetSavedStarGifts(i));if(o)return{gifts:o.gifts.map(t=>Sr(t,e.id)),nextOffset:o.nextOffset}}function K_({inputGift:e,shouldUnsave:t}){return Su(new Me.payments.SaveStarGift({stargift:qn(e),unsave:t||void 0}))}function $_({inputSavedGift:e}){return Su(new Me.payments.ConvertStarGift({stargift:qn(e)}))}async function J_({chat:e}){const t=await Su(new Me.payments.GetStarsGiftOptions({userId:e&&sn(e.id,e.accessHash)}));if(t)return t.map(ur)}async function Q_({isTon:e}={}){const t=await Su(new Me.payments.GetStarsStatus({peer:new Me.InputPeerSelf,ton:e||void 0}));if(!t)return;const s=lr(t.balance);return s?{nextHistoryOffset:t.nextOffset,history:t.history?.map(pr).filter(Boolean),nextSubscriptionOffset:t.subscriptionsNextOffset,subscriptions:t.subscriptions?.map(hr),balance:s}:void 0}async function X_({peer:e,offset:t="",limit:s=0,isInbound:n,isOutbound:a,isTon:i}){const o=e?tn(e.id,e.accessHash):new Me.InputPeerSelf,r=await Su(new Me.payments.GetStarsTransactions({peer:o,offset:t,limit:s,inbound:n||void 0,outbound:a||void 0,ton:i||void 0}));if(!r)return;const d=lr(r.balance);return d?{nextOffset:r.nextOffset,history:r.history?.map(pr).filter(Boolean),balance:d}:void 0}async function Y_({id:e,peer:t,ton:s}){const n=t?tn(t.id,t.accessHash):new Me.InputPeerSelf,a=await Su(new Me.payments.GetStarsTransactionsByID({peer:n,ton:s,id:[new Me.InputStarsTransaction({id:e})]}));if(a?.history?.[0])return{transaction:pr(a?.history[0])}}async function Z_({offset:e="",peer:t}){const s=t?tn(t.id,t.accessHash):new Me.InputPeerSelf,n=await Su(new Me.payments.GetStarsSubscriptions({peer:s,offset:e}));if(!n?.subscriptions)return;const a=lr(n.balance);return a?{nextOffset:n.subscriptionsNextOffset,subscriptions:n.subscriptions.map(hr),balance:a}:void 0}async function eb({peer:e,subscriptionId:t,isCancelled:s}){return await Su(new Me.payments.ChangeStarsSubscription({peer:e?tn(e.id,e.accessHash):new Me.InputPeerSelf,subscriptionId:t,canceled:s}))}async function tb({peer:e,subscriptionId:t}){return await Su(new Me.payments.FulfillStarsSubscription({peer:e?tn(e.id,e.accessHash):new Me.InputPeerSelf,subscriptionId:t}))}async function sb(){const e=await Su(new Me.payments.GetStarsTopupOptions);if(e)return e.map(mr)}async function nb({slug:e}){try{const t=await Su(new Me.payments.GetUniqueStarGift({slug:e}),{shouldThrow:!0});if(!t)return;const s=yr(t.gift);if("starGiftUnique"!==s.type)return;return s}catch(e){return e instanceof Ae?Ha(e):void 0}}async function ab({giftId:e}){const t=await Su(new Me.payments.GetStarGiftUpgradePreview({giftId:BigInt(e)}));if(t)return function(e){return{sampleAttributes:e.sampleAttributes.map(br).filter(Boolean),prices:e.prices?.map(Pr)||[],nextPrices:e.nextPrices?.map(Pr)||[]}}(t)}async function ib({giftId:e,slug:t,version:s=0}){if(!e&&!t)return;const n=t?new Me.InputStarGiftAuctionSlug({slug:t}):new Me.InputStarGiftAuction({giftId:BigInt(e)}),a=await Su(new Me.payments.GetStarGiftAuctionState({auction:n,version:s}));return a?Rr(a):void 0}async function ob({giftId:e}){const t=await Su(new Me.payments.GetStarGiftAuctionAcquiredGifts({giftId:BigInt(e)}));if(t)return{gifts:t.gifts.map(kr)}}async function rb(){const e=await Su(new Me.payments.GetStarGiftActiveAuctions({hash:0n}));if(e&&!(e instanceof Me.payments.StarGiftActiveAuctionsNotModified))return{auctions:e.auctions.map(Rr).filter(Boolean)}}function db({inputSavedGift:e,shouldKeepOriginalDetails:t}){return Su(new Me.payments.UpgradeStarGift({stargift:qn(e),keepOriginalDetails:t}),{shouldReturnTrue:!0})}function cb({inputSavedGift:e,toPeer:t}){return Su(new Me.payments.TransferStarGift({stargift:qn(e),toId:tn(t.id,t.accessHash)}),{shouldReturnTrue:!0})}function ub({inputSavedGifts:e,peer:t}){return Su(new Me.payments.ToggleStarGiftsPinnedToTop({stargift:e.map(qn),peer:tn(t.id,t.accessHash)}),{shouldReturnTrue:!0})}function lb({inputSavedGift:e,price:t}){return Su(new Me.payments.UpdateStarGiftPrice({stargift:qn(e),resellAmount:Gn(t)}),{shouldReturnTrue:!0})}async function fb({slug:e}){const t=await Su(new Me.payments.GetUniqueStarGiftValueInfo({slug:e}));if(t)return function(e){const{lastSaleOnFragment:t,currency:s,value:n,initialSaleDate:a,initialSaleStars:i,initialSalePrice:o,lastSaleDate:r,lastSalePrice:d,floorPrice:c,averagePrice:u,listedCount:l,fragmentListedCount:f,fragmentListedUrl:g,valueIsAverage:p}=e;return{isLastSaleOnFragment:t,isValueAverage:p,currency:s,value:rs(n),initialSaleDate:a,initialSaleStars:rs(i),initialSalePrice:rs(o),lastSaleDate:r,lastSalePrice:rs(d),floorPrice:rs(c),averagePrice:rs(u),listedCount:l,fragmentListedCount:f,fragmentListedUrl:g}}(t)}async function gb({inputGift:e,password:t}){try{const s=await Yu(t);if(!s)return;if("error"in s)return s;const n=await Su(new Me.payments.GetStarGiftWithdrawalUrl({stargift:qn(e),password:s}),{shouldThrow:!0});if(!n)return;return{url:n.url}}catch(e){if(!Na(e))return;return Ha(e)}}async function pb({peer:e,hash:t}){const s=await Su(new Me.payments.GetStarGiftCollections({peer:tn(e.id,e.accessHash),hash:t?BigInt(t):0n}));if(s&&!(s instanceof Me.payments.StarGiftCollectionsNotModified))return{collections:s.collections.map(vr).filter(Boolean)}}function hb({offerMsgId:e,shouldDecline:t}){return Su(new Me.payments.ResolveStarGiftOffer({offerMsgId:e,decline:t||void 0}),{shouldReturnTrue:!0})}async function mb({giftId:e,peerId:t,offset:s="",limit:n=0}){const a=await Su(new Me.payments.GetCraftStarGifts({giftId:BigInt(e),offset:s,limit:n}));if(a)return{gifts:a.gifts.map(e=>Sr(e,t)),nextOffset:a.nextOffset,count:a.count}}async function yb({inputSavedGifts:e}){try{return void await Su(new Me.payments.CraftStarGift({stargift:e.map(qn)}),{shouldThrow:!0})}catch(e){if(e instanceof Ae)return{error:e.errorMessage};throw e}}async function _b({giftId:e}){const t=await Su(new Me.payments.GetStarGiftUpgradeAttributes({giftId:BigInt(e)}));if(t)return{attributes:t.attributes.map(br).filter(Boolean)}}async function bb({chat:e,title:t,iconColor:s,iconEmojiId:n,sendAs:a,isTitleMissing:i}){const{id:o,accessHash:r}=e,d=await Su(new Me.messages.CreateForumTopic({peer:tn(o,r),title:t,iconColor:s,iconEmojiId:n?BigInt(n):void 0,sendAs:a?tn(a.id,a.accessHash):void 0,randomId:z(),titleMissing:i}));if(d instanceof Me.Updates&&d.updates.length)return d.updates?.find(e=>e instanceof Me.UpdateMessageID)?.id}async function Sb({chat:e,query:t,offsetTopicId:s,offsetId:n,offsetDate:a,limit:i=20}){const{id:o,accessHash:r}=e,d=await Su(new Me.messages.GetForumTopics({peer:tn(o,r),limit:i,q:t,offsetTopic:s??0,offsetId:n??0,offsetDate:a??0}));if(!d)return;const{orderByCreateDate:c}=d,u=d.topics.map(Mf).filter(Boolean),l=0===d.count?u.length:d.count;return{topics:u,messages:d.messages.map(od).filter(Boolean),count:l+1,shouldOrderByCreateDate:c,draftsById:d.topics.reduce((e,t)=>(t instanceof Me.ForumTopic&&t.draft&&(e[t.id]=dd(t.draft)),e),{})}}async function wb({chat:e,topicId:t}){const{id:s,accessHash:n}=e,a=await Su(new Me.messages.GetForumTopicsByID({peer:tn(s,n),topics:[t]}));if(!(a?.topics.length&&a.topics[0]instanceof Me.ForumTopic))return;const i=a.messages.map(od).filter(Boolean);return{topic:Mf(a.topics[0]),messages:i}}async function Ib({chat:e,topicId:t}){const{id:s,accessHash:n}=e,a=await Su(new Me.messages.DeleteTopicHistory({peer:tn(s,n),topMsgId:t}));a&&(wc(e,a),a.offset&&await Ib({chat:e,topicId:t}))}function vb({chat:e,topicId:t,isPinned:s}){const{id:n,accessHash:a}=e;return Su(new Me.messages.UpdatePinnedForumTopic({peer:tn(n,a),topicId:t,pinned:s}),{shouldReturnTrue:!0})}function Pb({chat:e,topicId:t,title:s,iconEmojiId:n,isClosed:a,isHidden:i}){const{id:o,accessHash:r}=e;return Su(new Me.messages.EditForumTopic({peer:tn(o,r),topicId:t,title:s,iconEmojiId:1!==t&&n?BigInt(n):void 0,closed:a,hidden:i}),{shouldReturnTrue:!0})}var Cb=s(48287).hp;function Mb(e){const{emojies_sounds:t}=e;return t?Object.keys(t).reduce((e,s)=>{const n=t[s];return Js.documents[n.id]=new Me.Document({id:BigInt(n.id),accessHash:BigInt(n.access_hash),dcId:1,mimeType:"audio/ogg",fileReference:Cb.alloc(0),size:0n}),e[s]=n.id,e},{}):{}}function Ab(e){const{emojies_send_dice_success:t}=e;return t?Object.entries(t).reduce((e,[t,s])=>(e[t]={value:s.value,frameStart:s.frame_start},e),{}):{}}function Rb(e,t,s){return[e[`${t}_default`]||zu[s][0],e[`${t}_premium`]||zu[s][1]]}async function kb({hash:e}){const t=await Su(new Me.help.GetAppConfig({hash:e??0}));if(!t||t instanceof Me.help.AppConfigNotModified)return;const{config:s,hash:n}=t;return function(e,t){const s=go(e),n={emojiSounds:Mb(s),seenByMaxChatMembers:s.chat_read_mark_size_threshold,seenByExpiresAt:s.chat_read_mark_expire_period,readDateExpiresAt:s.pm_read_date_expire_period,autologinDomains:s.autologin_domains||[],urlAuthDomains:s.url_auth_domains||[],whitelistedDomains:s.whitelisted_domains||[],webAppAllowedProtocols:s.web_app_allowed_protocols,maxUniqueReactions:s.reactions_uniq_max,premiumBotUsername:s.premium_bot_username,premiumInvoiceSlug:s.premium_invoice_slug,premiumPromoOrder:s.premium_promo_order,isPremiumPurchaseBlocked:s.premium_purchase_blocked,isGiveawayGiftsPurchaseAvailable:s.giveaway_gifts_purchase_available,defaultEmojiStatusesStickerSetId:s.default_emoji_statuses_stickerset_id,topicsPinnedLimit:s.topics_pinned_limit,hiddenMembersMinCount:s.hidden_members_group_size_min,giveawayAddPeersMax:s.giveaway_add_peers_max,giveawayBoostsPerPremium:s.giveaway_boosts_per_premium,giveawayCountriesMax:s.giveaway_countries_max,boostsPerSentGift:s.boosts_per_sent_gift,canDisplayAutoarchiveSetting:s.autoarchive_setting_available,limits:{uploadMaxFileparts:Rb(s,"upload_max_fileparts","uploadMaxFileparts"),stickersFaved:Rb(s,"stickers_faved_limit","stickersFaved"),savedGifs:Rb(s,"saved_gifs_limit","savedGifs"),dialogFiltersChats:Rb(s,"dialog_filters_chats_limit","dialogFiltersChats"),dialogFilters:Rb(s,"dialog_filters_limit","dialogFilters"),dialogFolderPinned:Rb(s,"dialogs_pinned_limit","dialogFolderPinned"),captionLength:Rb(s,"caption_length_limit","captionLength"),channels:Rb(s,"channels_limit","channels"),channelsPublic:Rb(s,"channels_public_limit","channelsPublic"),aboutLength:Rb(s,"about_length_limit","aboutLength"),chatlistInvites:Rb(s,"chatlist_invites_limit","chatlistInvites"),chatlistJoined:Rb(s,"chatlist_joined_limit","chatlistJoined"),recommendedChannels:Rb(s,"recommended_channels_limit","recommendedChannels"),savedDialogsPinned:Rb(s,"saved_dialogs_pinned_limit","savedDialogsPinned"),maxReactions:Rb(s,"reactions_user_max","maxReactions"),moreAccounts:zu.moreAccounts,aiComposeToneSaved:Rb(s,"aicompose_tone_saved_limit","aiComposeToneSaved")},contactNoteLimit:s.contact_note_length_limit,hash:t,storyViewersExpirePeriod:s.story_viewers_expire_period,storyChangelogUserId:s.stories_changelog_user_id?.toString(),maxPinnedStoriesCount:s.stories_pinned_to_top_count_max,groupTranscribeLevelMin:s.group_transcribe_level_min,canLimitNewMessagesWithoutPremium:s.new_noncontact_peers_require_premium_without_ownpremium,starsPaidMessagesAvailable:s.stars_paid_messages_available,starsPaidMessageCommissionPermille:s.stars_paid_message_commission_permille,starsPaidMessageAmountMax:s.stars_paid_message_amount_max,starsUsdWithdrawRateX1000:s.stars_usd_withdraw_rate_x1000,starsUsdSellRateX1000:s.stars_usd_sell_rate_x1000,bandwidthPremiumNotifyPeriod:s.upload_premium_speedup_notify_period,bandwidthPremiumUploadSpeedup:s.upload_premium_speedup_upload,bandwidthPremiumDownloadSpeedup:s.upload_premium_speedup_download,channelRestrictAdsLevelMin:s.channel_restrict_sponsored_level_min,channelAutoTranslationLevelMin:s.channel_autotranslation_level_min,paidReactionMaxAmount:s.stars_paid_reaction_amount_max,isChannelRevenueWithdrawalEnabled:s.channel_revenue_withdrawal_enabled,isStarsGiftEnabled:s.stars_gifts_enabled,starGiftMaxMessageLength:s.stargifts_message_length_max,starGiftMaxConvertPeriod:s.stargifts_convert_period_max,starRefStartPrefixes:s.starref_start_param_prefixes,tonExplorerUrl:s.ton_blockchain_explorer_url,savedGiftPinLimit:s.stargifts_pinned_to_top_limit,freezeSinceDate:s.freeze_since_date,freezeUntilDate:s.freeze_until_date,freezeAppealUrl:s.freeze_appeal_url,starsStargiftResaleAmountMin:s.stars_stargift_resale_amount_min,starsStargiftResaleAmountMax:s.stars_stargift_resale_amount_max,starsStargiftResaleCommissionPermille:s.stars_stargift_resale_commission_permille,stargiftsCraftAttributePermilles:s.stargifts_craft_attribute_permilles,tonStargiftResaleAmountMin:s.ton_stargift_resale_amount_min,tonStargiftResaleAmountMax:s.ton_stargift_resale_amount_max,tonStargiftResaleCommissionPermille:s.ton_stargift_resale_commission_permille,starsSuggestedPostAmountMax:s.stars_suggested_post_amount_max,starsSuggestedPostAmountMin:s.stars_suggested_post_amount_min,starsSuggestedPostCommissionPermille:s.stars_suggested_post_commission_permille,starsSuggestedPostAgeMin:s.stars_suggested_post_age_min,starsSuggestedPostFutureMax:s.stars_suggested_post_future_max,starsSuggestedPostFutureMin:s.stars_suggested_post_future_min,noForwardsRequestExpirePeriod:s.no_forwards_request_expire_period,tonSuggestedPostCommissionPermille:s.ton_suggested_post_commission_permille,tonSuggestedPostAmountMax:s.ton_suggested_post_amount_max,tonSuggestedPostAmountMin:s.ton_suggested_post_amount_min,tonUsdRate:s.ton_usd_rate,tonTopupUrl:s.ton_topup_url,pollMaxAnswers:s.poll_answers_max,pollClosePeriodMax:s.poll_close_period_max,todoItemsMax:s.todo_items_max,todoTitleLengthMax:s.todo_title_length_max,todoItemLengthMax:s.todo_item_length_max,ignoreRestrictionReasons:s.ignore_restriction_reasons,needAgeVideoVerification:s.need_age_video_verification,verifyAgeBotUsername:s.verify_age_bot_username,verifyAgeCountry:s.verify_age_country,verifyAgeMin:s.verify_age_min,typingDraftTtl:s.message_typing_draft_ttl,whitelistedBotIds:s.whitelisted_bots,arePasskeysAvailable:s.settings_display_passkeys,passkeysMaxCount:s.passkeys_account_passkeys_max,diceEmojies:s.emojies_send_dice,diceEmojiesSuccess:Ab(s),aiComposeToneExamplesNum:s.aicompose_tone_examples_num,aiComposeToneTitleLengthMax:s.aicompose_tone_title_length_max,aiComposeTonePromptLengthMax:s.aicompose_tone_prompt_length_max};return{...Ku,...Bs(n)}}(s,n)}async function Tb(){const e=await Su(new Me.help.GetConfig);if(e)return function(e){const{testMode:t,expires:s,gifSearchUsername:n,chatSizeMax:a,autologinToken:i,reactionsDefault:o,messageLengthMax:r,editTimeLimit:d,forwardedCountMax:c,ratingEDecay:u}=e;return{isTestServer:t,expiresAt:s,gifSearchUsername:n,defaultReaction:o&&Ti(o),maxGroupSize:a,autologinToken:i,maxMessageLength:r,editTimeLimit:d,maxForwardedCount:c,ratingEDecay:u}}(e)}async function Bb(){const e=await Su(new Me.help.GetPromoData);if(e&&!(e instanceof Me.help.PromoDataEmpty))return function(e){const{expires:t,pendingSuggestions:s,dismissedSuggestions:n,customPendingSuggestion:a}=e;return{expires:t,pendingSuggestions:s,dismissedSuggestions:n,customPendingSuggestion:a?po(a):void 0}}(e)}async function Db(e){await Su(new Me.help.DismissSuggestion({peer:new Me.InputPeerEmpty,suggestion:e}))}function Ub(e,t,s){var n;!function(e){Oa=e}(e),s&&(n=s,Object.assign($s,Ks(n)));const a=new zt;return async function(e,t){const{userAgent:s,platform:n,sessionData:a,isWebmSupported:i,maxBufferSize:o,webAuthToken:r,dcId:d,mockScenario:c,shouldForceHttpTransport:u,shouldAllowHttpTransport:l,shouldDebugExportedSenders:f,langCode:g,isTestServerRequested:p,accountIds:h,hasPasskeySupport:m}=e,y=new is(a,_u);self.isWebmSupported=i,self.maxBufferSize=o,gu=new ya(y,Number("2496"),"8da85b0d5bfe62527e5b244c209159c3",{deviceModel:navigator.userAgent||s||"Unknown UserAgent",systemVersion:n||"Unknown platform",appVersion:"12.0.29 A",useWSS:!0,additionalDcsDisabled:!1,shouldDebugExportedSenders:f,shouldForceHttpTransport:u,shouldAllowHttpTransport:l,dcId:d,langPack:I,langCode:g,systemLangCode:navigator.language,isTestServerRequested:p}),gu.addEventHandler(bu,uu);try{try{gu.setPingCallback(mc),await gu.start({phoneNumber:kc,phoneCode:Tc,password:Bc,firstAndLastNames:Dc,onPasskeyOption:Rc,qrCode:Uc,onError:Ec,initialMethod:"iOS"===n||"Android"===n?"phoneNumber":"qrCode",shouldThrowIfUnauthorized:Object.values(a?.keys||{}).length>0,webAuthToken:r,webAuthTokenFailed:Ac,mockScenario:c,accountIds:h,hasPasskeySupport:m},t)}catch(e){if(console.error(e),"Disconnect"!==e.message&&"Cannot send requests while disconnected"!==e.message)return void ja({"@type":"updateConnectionState",connectionState:"connectionStateBroken"})}ja(xc("authorizationStateReady")),_u(y.getSessionData()),ja({"@type":"updateApiReady"}),async function(e){Qd=e,await Ic(),Yd=!0,pc()}(Su),Au()}catch(e){throw e}}(t,()=>a.resolve()),a.promise}const Eb=A.reduce((e,t)=>(e[t]=console[t],e),{});self.onerror=e=>{console.error(e),qb({type:"unhandledError",error:{message:e.error.message||"Uncaught exception in worker"}})},self.addEventListener("unhandledrejection",e=>{console.error(e),qb({type:"unhandledError",error:{message:e.reason.message||"Uncaught rejection in worker"}})});let xb=[],Vb=[],Gb=[];const Fb=new Map;onmessage=({data:e})=>{e.payloads.forEach(async e=>{switch(e.type){case"initApi":{const{messageId:t,args:s}=e;Ub(Hb,s[0],s[1]).then(()=>{t&&qb({type:"methodResponse",messageId:t,response:!0})});break}case"callMethod":{const{messageId:t,name:s,args:n,withCallback:i}=e;try{if(t&&i){const e=(...e)=>{const s=e[e.length-1];qb({type:"methodCallback",messageId:t,callbackArgs:e},s instanceof ArrayBuffer?s:void 0)};Fb.set(t,e),n.push(e)}const e=await function(e,...t){return a[e](...t)}(s,...n),{arrayBuffer:o}="object"==typeof e&&"arrayBuffer"in e&&e||{};t&&qb({type:"methodResponse",messageId:t,response:e},o)}catch(e){t&&qb({type:"methodResponse",messageId:t,error:qa(e)})}t&&Fb.delete(t);break}case"cancelProgress":{const t=Fb.get(e.messageId);t&&(t.isCanceled=!0);break}case"ping":qb({type:"methodResponse",messageId:e.messageId});break;case"toggleDebugMode":e.isEnabled?A.forEach(e=>{console[e]=(...t)=>{postMessage({type:"debugLog",level:e,args:JSON.parse(JSON.stringify(t,(e,t)=>"bigint"==typeof t?t.toString():t))})}}):A.forEach(e=>{console[e]=Eb[e]})}})};const Nb=k(()=>{Gb.length&&xb.unshift({type:"updates",updates:Gb});const e={payloads:xb},t=Vb;Gb=[],xb=[],Vb=[],t.length?postMessage(e,t):postMessage(e)});function qb(e,t){xb.push(e),t&&Vb.push(t),Nb()}function Hb(e){Gb.push(e),Nb()}}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return s[e](i,i.exports,a),i.exports}a.m=s,a.x=()=>{var e=a.O(void 0,[8287,2066],()=>a(11862));return a.O(e)},e=[],a.O=(t,s,n,i)=>{if(!s){var o=1/0;for(u=0;u<e.length;u++){for(var[s,n,i]=e[u],r=!0,d=0;d<s.length;d++)(!1&i||o>=i)&&Object.keys(a.O).every(e=>a.O[e](s[d]))?s.splice(d--,1):(r=!1,i<o&&(o=i));if(r){e.splice(u--,1);var c=n();void 0!==c&&(t=c)}}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]=[s,n,i]},a.d=(e,t)=>{for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,s)=>(a.f[s](e,t),t),[])),a.u=e=>e+"."+{2066:"04ac25fc5e97d7d2f8ef",8287:"9a6d0c2e5b4dda234a6f"}[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})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var s=t.getElementsByTagName("script");if(s.length)for(var n=s.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=s[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={1862:1};a.f.i=(t,s)=>{e[t]||importScripts(a.p+a.u(t))};var t=self.webpackChunktelegram_t=self.webpackChunktelegram_t||[],s=t.push.bind(t);t.push=t=>{var[n,i,o]=t;for(var r in i)a.o(i,r)&&(a.m[r]=i[r]);for(o&&o(a);n.length;)e[n.pop()]=1;s(t)}})(),t=a.x,a.x=()=>Promise.all([a.e(8287),a.e(2066)]).then(t),a.x()})();
//# sourceMappingURL=1862.4470e79ddfa92320d6aa.js.map