import{eM as b,c as d,q as w,b as e,bV as M,v as P,J as _}from"./index-6Jqoo2rk.js";import{u as k,S as y}from"./saveButton-BN9ptO_C.js";import{a0 as D,ap as g}from"./appDialogsManager-DnVhdlim.js";import{S as R}from"./starsRangeInput-BLe-6A9X.js";import{u as T}from"./useStarsCommissionAndWithdrawalPrice-KvJ0lze6.js";import{S as A}from"./staticSwitch-DQBt4NKu.js";import{T as L}from"./transition-DuxZkCEv.js";import"./iconTsx-Cr8T7ZIv.js";import"./emailSetup-CFcJlzt-.js";import"./bootstrapIm-BS8HLnlI.js";import"./mediaHeader-B5k-4_FU.js";import"./animations-O3syBkMX.js";import"./accumulate-BydAFozl.js";import"./browser-BlRx6CLO.js";import"./_commonjsHelpers-DsqdWQfm.js";import"./putPreloader-WBjcuDFX.js";import"./htmlToSpan-DhAls8qz.js";import"./anchorCallback-DsA1XczG.js";import"./toast-B3QB1-N7.js";import"./paintQrCode-u2FNs0A8.js";import"./fastBlur-Co-79rP4.js";import"./space-DBcSn32d.js";import"./telInputField-Fj4gE689.js";import"./readBlobAsDataURL-DL2tTmc_.js";import"./tracking-CIK7NCFD.js";import"./getInputPasskeyResponse-RiY9Fe0r.js";import"./base64ToBytes-B7rMxzcy.js";import"./sha256-BMgYLqDy.js";import"./bytesCmp-DgkPox5J.js";import"./useAppConfig-C30L41Bx.js";const ce=()=>{const[r]=D(),{apiManagerProxy:h,rootScope:u,Row:i}=b(),n=r.payload.chat;if(!n)return[];const o=n.linked_monoforum_id?h.getChat(n.linked_monoforum_id):void 0,c=!!o,m=o?._==="channel"&&+o.send_paid_messages_stars||0,[t,S]=d(c),[a,C]=d(m),l=w(()=>c!==t()||t()&&m!==a()),{commissionPercents:f,willReceiveDollars:v}=T(a);let s=!1;async function p(){if(!s){s=!0;try{await u.managers.appChatsManager.updateChannelPaidMessagesPrice(n.id,t()?a():0,t()),r.close()}finally{s=!1}}}return r.isConfirmationNeededOnClose=k({saveAllSettings:p,hasChanges:l,descriptionLangKey:"UnsavedChangesDescription.Channel"}),[e(M,{get mount(){return r.header},get children(){return e(y,{get hasChanges(){return l()},onClick:()=>{p()}})}}),e(g,{caption:"ChannelDirectMessages.Settings.SwitchLabelCaption",get children(){return e(i,{clickable:()=>{S(!t())},get children(){return[e(i.Title,{get children(){return P("ChannelDirectMessages.Settings.SwitchLabel")}}),e(i.RightContent,{get children(){return e(A,{get checked(){return t()}})}})]}})}}),e(L,{name:"fade",get children(){return e(_,{get when(){return t()},get children(){return e(g,{name:"PaidMessages.SetPrice",class:"overflow-hidden",caption:"PaidMessages.SetPriceChannelDescription",get captionArgs(){return[f(),v()]},get children(){return e(R,{get value(){return a()},onChange:C,startFromZero:!0})}})}})}})]};export{ce as default};
//# sourceMappingURL=channelDirectMessages-BE-BHMRM.js.map
