import{eM as l,E as p,bX as g,b as _,i as c,k as u,a as h,J as f,t as A,cx as R}from"./index-6Jqoo2rk.js";import{a0 as S,a1 as U}from"./appDialogsManager-DnVhdlim.js";import{U as P}from"./accumulate-BydAFozl.js";import{t as y}from"./toast-B3QB1-N7.js";const I=e=>e?._==="channelParticipantBanned"&&e.pFlags?.left;function T(e,t){if(e.default_banned_rights&&t?.pFlags){t=structuredClone(t);const n=e.default_banned_rights.pFlags;for(const i in n){const s=i;n[s]&&delete t.pFlags[s]}}return t}const C={other:()=>"AdminRights.Other",manage_call:()=>"Channel.EditAdmin.ManageCalls",manage_direct_messages:()=>"Channel.EditAdmin.ManageDirectMessages",change_info:({isBroadcast:e})=>e?"EditAdminChangeChannelInfo":"EditAdminChangeGroupInfo",post_messages:()=>"EditAdminPostMessages",edit_messages:()=>"EditAdminEditMessages",delete_messages:({isBroadcast:e})=>e?"EditAdminDeleteMessages":"EditAdminGroupDeleteMessages",ban_users:()=>"EditAdminBanUsers",pin_messages:()=>"EditAdminPinMessages",add_admins:()=>"EditAdminAddAdmins",anonymous:()=>"EditAdminSendAnonymously",manage_topics:()=>"ManageTopicsPermission",manage_ranks:()=>"AdminRights.Other",invite_users:({isBroadcast:e})=>e?"Channel.EditAdmin.PermissionInviteSubscribers":"EditAdminAddUsersViaLink",post_stories:()=>"AdminRights.PostStories",edit_stories:()=>"AdminRights.EditStories",delete_stories:()=>"AdminRights.DeleteStories"};function N(e,t){const n=C[e];return n(t)}const O=e=>{if(!(e?._!=="message"||e?.media?._!=="messageMediaPhoto"||e?.media?.photo?._!=="photo"))return e.media.photo};function B(e,t){const n=e??{},i=t??{},s=[],a=[],m=new Set([...Object.keys(n),...Object.keys(i)]);for(const o of m){const r=n[o],d=i[o];!r&&d?s.push(o):r&&!d&&a.push(o)}return{new:s,old:a}}function x(e){const{rootScope:t}=l(),[n,i]=S();return U(async()=>{try{const s=await t.managers.appProfileManager.getParticipant(n.payload.channelId,e);i.AppUserPermissionsTab.openTab(n.slider,n.payload.channelId,s,P(s)),await p(200)}catch{y({langPackKey:"AdminRecentActions.UserNotMemberAnymore"})}})}const D={send_plain:"UserRestrictionsSend",send_media:"UserRestrictionsSendMedia",invite_users:"UserRestrictionsInviteUsers",pin_messages:"UserRestrictionsPinMessages",manage_topics:"CreateTopicsPermission",change_info:"UserRestrictionsChangeInfo",send_photos:"UserRestrictionsSendPhotos",send_videos:"UserRestrictionsSendVideos",send_stickers:"UserRestrictionsSendStickersOnly",send_gifs:"UserRestrictionsSendGIFsOnly",send_audios:"UserRestrictionsSendMusic",send_docs:"UserRestrictionsSendFiles",send_voices:"UserRestrictionsSendVoices",send_roundvideos:"UserRestrictionsSendRound",embed_links:"UserRestrictionsEmbedLinks",send_polls:"UserRestrictionsSendPolls",edit_rank:null,view_messages:null,send_messages:null,send_games:null,send_inline:null},E="_Container_1x7ne_1",M={Container:E},b=A("<div> "),G=e=>{const{wrapTopicIcon:t}=l(),n=()=>e.topic._==="forumTopic"?e.topic:null,[i]=g(n,s=>{if(!s)return null;const a=R().get();return t({topic:s,middleware:a})});return _(f,{get when(){return n()},get children(){const s=b(),a=s.firstChild;return c(s,i,a),c(s,()=>n().title,null),u(()=>h(s,M.Container)),s}})};export{G as T,T as a,B as d,O as g,I as i,D as p,N as r,x as u};
//# sourceMappingURL=topicName-B0x6qq-V.js.map
