telegram-tt/dist/409.8ade632d34e500adc543.js
Alexander Zinchuk e5062ef42c [Build]
2022-01-28 21:02:07 +01:00

2 lines
110 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[409],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(6137),s=n(6752),i=n(3657),o=n(6202),c=n(692),l=n(5296),d=n(4399),u=n(7799);const m=(0,a.X$)((({sticker:e,effect:t,isOwn:n,soundId:m,size:h="medium",observeIntersection:f,lastSyncTime:v,forceLoadPreview:p,messageId:Z,chatId:g,activeEmojiInteraction:E})=>{var P;const{markAnimationLoaded:y,isAnimationLoaded:C,ref:b,width:N,style:w,handleClick:k,playKey:I}=(0,l.Z)(h,g,Z,m,E,n,void 0,null==t?void 0:t.emoji),T=`sticker${e.id}`,S=(0,i.Op)(b,f),M=null===(P=e.thumbnail)||void 0===P?void 0:P.dataUri,L=(0,o.Z)(`${T}?size=m`,!S&&!p,r.IU.BlobUrl,v),x=(0,c.Z)(L),$=(0,o.Z)(T,!S,r.IU.Lottie,v),O=Boolean($);return a.ZP.createElement("div",{ref:b,className:(0,s.Z)("AnimatedEmoji media-inner",e.id===d.wB&&"like-sticker-thumb"),style:w,onClick:k},!C&&M&&a.ZP.createElement("img",{src:M,alt:""}),!C&&L&&a.ZP.createElement("img",{src:L,className:x,alt:""}),O&&T&&a.ZP.createElement(u.Z,{key:T,id:T,animationData:$,size:N,quality:1,play:S&&I,forceOnHeavyAnimation:!0,noLoop:!0,onLoad:y}))}))},4752:(e,t,n)=>{n.d(t,{Z:()=>T});var a=n(4050),r=n(5116),s=n(6137),i=n(1713),o=n(7361),c=n(790),l=n(8415),d=n(6752),u=n(2340),m=n(5376),h=n(2566),f=n(1212),v=n(2019),p=n(3186),Z=n(9107),g=n(1174),E=n(6202),P=n(396),y=n(711),C=n(231),b=n(9196),N=n(8033);const w=o.wB?20:25,k=o.wB?50:75;function I(e,t,n){return a.ZP.createElement("div",{className:"seekline no-selection",ref:n},a.ZP.createElement("span",{className:"seekline-buffered-progress"},a.ZP.createElement("i",{style:`transform: translateX(${100*t}%)`})),a.ZP.createElement("span",{className:"seekline-play-progress"},a.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})),a.ZP.createElement("span",{className:"seekline-thumb"},a.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})))}const T=(0,a.X$)((({theme:e,message:t,senderTitle:n,uploadProgress:T,origin:S,date:M,lastSyncTime:L,className:x,isSelectable:$,isSelected:O,isDownloading:F,onPlay:A,onReadMedia:D,onCancelUpload:R,onDateClick:U})=>{const{content:{audio:B,voice:X,video:Y},isMediaUnread:K}=t,V=Boolean(X||Y),j=(0,a.sO)(!1),z=(0,a.sO)(!1),H=(0,a.sO)(null),q=(0,Z.Z)(),{isRtl:W}=q,J=(0,r.uC)(),[_,G]=(0,a.eJ)(!1),Q=L,ee=(0,l.Ti)(t,"pictogram"),te=(0,E.Z)(ee,!1,s.IU.BlobUrl),ne=(0,E.Z)((0,l.Ti)(t,"inline"),!Q,(0,l.kG)(t,"inline")),{loadProgress:ae}=(0,h.Z)((0,l.Ti)(t,"download"),!F),re=(0,a.I4)((()=>{G(!0),A(t.id,t.chatId)}),[t,A]),se=(0,a.I4)((()=>{G(!1)}),[]),{isBuffered:ie,bufferedProgress:oe,bufferingHandlers:ce,checkBuffering:le}=(0,v.Z)(),{isPlaying:de,playProgress:ue,playPause:me,play:he,pause:fe,setCurrentTime:ve,duration:pe}=(0,p.Z)((0,P.An)(t),(0,l.XV)(t),V?"voice":"audio",ne,ce,void 0,le,_,re,se,(0,l.CI)(t)),Ze=(0,l.B4)(t),ge=function(e,t,n=0,r=!1){const s=(0,a.sO)(null),{data:i,peak:o}=(0,a.Ye)((()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const a=Math.min(n/10,1),r=Math.round(w+(k-w)*a);return function(e,t){let n=0;const a=new Array(t),r=e.length/t,s=e[0],i=e[e.length-1];for(let d=0;d<t;d++){var o,c,l;const t=Math.floor(d*r),u=((null!==(o=e[t-1])&&void 0!==o?o:s)+(null!==(c=e[t])&&void 0!==c?c:s)+(null!==(l=e[t+1])&&void 0!==l?l:i))/3;a[d]=u,n<u&&(n=u)}return{data:a,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const a=Array(n),r=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=r[t]+(r[t+1]<<8);a[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),i=Math.floor(5*(n-1)%8),o=r[s]+(r[s+1]<<8);return a[n-1]=o>>i&31,a}(new Uint8Array(e)),r)}),[t])||{};return(0,a.bt)((()=>{const t=s.current;t&&i&&void 0!==o&&function(e,t,n,{peak:a,fillStyle:r,progressFillStyle:s}){const i=4*t.length;e.width=2*i,e.height=46,e.style.width=`${i}px`,e.style.height="23px";const o=e.getContext("2d");o.scale(2,2),t.forEach(((e,i)=>{o.globalAlpha=i/t.length>=n?.5:1,o.fillStyle=n>i/t.length?s:r;const c=Math.max(2,e/Math.max(1,a)*23);!function(e,t,n,a,r,s){2<2*s&&(s=1),r<2*s&&(s=r/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-r,s),e.arcTo(t+2,n-r,t,n-r,s),e.arcTo(t,n-r,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(o,4*i,23,0,c,1),o.fill()}))}(t,i,n,{peak:o,fillStyle:r?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:r?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[r,o,n,i,e]),s}(e,X,K&&!Ze?1:ue,Ze),Ee=de||ue>0&&ue<1;(0,a.d4)((()=>{G(de)}),[de]);const Pe=_&&!ie,{isUploading:ye,isTransferring:Ce,transferProgress:be}=(0,l.Sc)(t,T||ae,Pe||F),{shouldRender:Ne,transitionClassNames:we}=(0,f.Z)(Ce),ke=Ne&&(Pe||ye),Ie=(0,a.I4)((()=>{ye?null==R||R():(de||A(t.id,t.chatId),(0,r.uC)().setAudioPlayerOrigin({origin:S}),G(!_),me())}),[ye,de,_,me,R,A,t.id,t.chatId,S]);(0,a.d4)((()=>{D&&K&&(de||F)&&D()}),[de,K,D,F]);const Te=(0,a.I4)((()=>{F?J.cancelMessageMediaDownload({message:t}):J.downloadMessageMedia({message:t})}),[J,F,t]),Se=(0,a.I4)((e=>{if(j.current&&H.current){const{width:t,left:n}=H.current.getBoundingClientRect(),a=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),ve(Math.max(Math.min(pe*((a-n)/t),pe-.1),.001))}}),[pe,ve]),Me=(0,a.I4)((e=>{e instanceof MouseEvent&&2===e.button||(j.current=!0,z.current=de,fe(),Se(e))}),[Se,fe,de]),Le=(0,a.I4)((()=>{j.current=!1,z.current&&he()}),[he]),xe=(0,a.I4)((()=>{U(t.id,t.chatId)}),[U,t.id,t.chatId]);function $e(){if(V)return n||"Voice";const{title:e,fileName:t}=B;return e||t}(0,a.d4)((()=>{if(H.current&&Ee)return(0,g.sf)(H.current,{onCapture:Me,onRelease:Le,onClick:Le,onDrag:Se})}),[Ee,Me,Se,Le]);const Oe=(0,d.Z)("Audio",x,Ze&&S===i.Cr.Inline&&"own",(S===i.Cr.Search||S===i.Cr.SharedMedia)&&"bigger",O&&"audio-is-selected"),Fe=["toggle-play"];ke?Fe.push("loading"):de?Fe.push("pause"):de||Fe.push("play");const Ae=(0,d.Z)("content",Ee&&"with-seekline");function De(){return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:Ae},a.ZP.createElement("div",{className:"content-row"},a.ZP.createElement("p",{className:"title",dir:"auto",title:$e()},(0,u.Z)($e())),a.ZP.createElement("div",{className:"message-date"},M&&a.ZP.createElement(N.Z,{className:"date",onClick:xe},(0,c.VX)(q,1e3*M)))),Ee&&a.ZP.createElement("div",{className:"meta search-result",dir:W?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},ue<1&&`${(0,c.k9)(pe*ue,pe)}`),I(ue,oe,H)),!Ee&&function(){if(V)return a.ZP.createElement("div",{className:"meta",dir:W?"rtl":void 0},(0,c.k9)((X||Y).duration));const{performer:e}=B;return a.ZP.createElement("div",{className:"meta",dir:W?"rtl":void 0},(0,c.k9)(pe),a.ZP.createElement("span",{className:"bullet"},"•"),e&&a.ZP.createElement("span",{className:"performer",title:e},(0,u.Z)(e)),e&&n&&a.ZP.createElement("span",{className:"bullet"},"•"),n&&a.ZP.createElement("span",{title:n},(0,u.Z)(n)))}()))}return a.ZP.createElement("div",{className:Oe,dir:q.isRtl?"rtl":"ltr"},$&&a.ZP.createElement("div",{className:"message-select-control"},O&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement(C.Z,{round:!0,ripple:!o.wB,size:"smaller",color:te?"translucent-white":"primary",className:Fe.join(" "),ariaLabel:de?"Pause audio":"Play audio",onClick:Ie,isRtl:q.isRtl,backgroundImage:te},a.ZP.createElement("i",{className:"icon-play"}),a.ZP.createElement("i",{className:"icon-pause"})),Ne&&a.ZP.createElement("div",{className:(0,d.Z)("media-loading",we,ke&&"interactive")},a.ZP.createElement(b.Z,{progress:be,transparent:!0,size:"m",onClick:ke?Ie:void 0,noCross:!ke})),B&&!ye&&a.ZP.createElement(C.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:F?"Cancel download":"Download",onClick:Te},a.ZP.createElement("i",{className:F?"icon-close":"icon-arrow-down"})),S===i.Cr.Search&&De(),S!==i.Cr.Search&&B&&function(e,t,n,r,s,i,o,l,d,h,f){const{title:v,performer:p,fileName:Z}=t,g=r||s>0&&s<1,{isRtl:E}=y.i0;return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("p",{className:"title",dir:"auto",title:v},(0,u.Z)(v||Z)),g&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,c.k9)(n*s,n)),I(s,i,o)),!g&&l&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},h?`${(0,m.yW)(t.size*h)} / `:void 0,(0,m.yW)(t.size)),!g&&!l&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},a.ZP.createElement("span",{className:"duration",dir:"auto"},(0,c.k9)(n)),a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement("span",{className:"performer",dir:"auto",title:p},(0,u.Z)(p||"Unknown")),d&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement(N.Z,{className:"date",onClick:f},(0,c.ZK)(e,1e3*d,!0)))))}(q,B,pe,de,ue,oe,H,F||ye,M,be,U?xe:void 0),S===i.Cr.SharedMedia&&(X||Y)&&De(),S===i.Cr.Inline&&X&&function(e,t,n,r,s){return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("div",{className:"waveform",draggable:!1,ref:t},a.ZP.createElement("canvas",{ref:n})),a.ZP.createElement("p",{className:(0,d.Z)("voice-duration",s&&"unread"),dir:"auto"},0===r?(0,c.k9)(e.duration):(0,c.k9)(e.duration*r)))}(X,H,ge,ue,K))}))},180:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(5116),s=n(1638),i=n(8415),o=n(2340),c=n(4319),l=n(6272),d=n(9107),u=n(1876),m=n(3321);const h=(0,a.X$)((0,r.c$)(((e,{chatOrUserId:t})=>{const{lastSyncTime:n,countryList:{phoneCodes:a}}=e,r=t?(0,s.Z1)(e,t):void 0,o=(0,i.YC)(t)?(0,s.dy)(e,t):void 0,c=r&&(0,i.i4)(r,(0,s.dZ)(e),(0,s.NJ)(e));return{lastSyncTime:n,phoneCodeList:a,chat:r,user:o,canInviteUsers:r&&!o&&(!(0,i.eA)(r)&&!(0,i.Mg)(r,"inviteUsers")||(0,i.VE)(r,"inviteUsers")),isMuted:c}}))((({lastSyncTime:e,user:t,chat:n,forceShowSelf:s,canInviteUsers:h,isMuted:f,phoneCodeList:v})=>{const{loadFullUser:p,showNotification:Z,updateChatMutedState:g}=(0,r.uC)(),{id:E,fullInfo:P,username:y,phoneNumber:C,isSelf:b}=t||{},{id:N}=n||{},w=(0,d.Z)();(0,a.d4)((()=>{e&&E&&p({userId:E})}),[p,E,e]);const k=(0,a.I4)((()=>{g({chatId:N,isMuted:!f})}),[N,f,g]);if(!n||n.isRestricted||b&&!s)return;function I(e,t){(0,c.TE)(e),Z({message:`${t} was copied`})}const T=C&&(0,l.WZ)(v,C),S=(0,i.hu)(n),M=(null==P?void 0:P.bio)||(0,i.GM)(n);return a.ZP.createElement("div",{className:"ChatExtra"},T&&!!T.length&&a.ZP.createElement(u.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(T,w("Phone"))},a.ZP.createElement("span",{className:"title",dir:"auto"},T),a.ZP.createElement("span",{className:"subtitle"},w("Phone"))),y&&a.ZP.createElement(u.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(`@${y}`,w("Username"))},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,o.Z)(y)),a.ZP.createElement("span",{className:"subtitle"},w("Username"))),M&&!!M.length&&a.ZP.createElement(u.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,o.Z)(M,["br","links","emoji"])),a.ZP.createElement("span",{className:"subtitle"},w(E?"UserBio":"Info"))),(h||!y)&&S&&a.ZP.createElement(u.Z,{icon:n.username?"mention":"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>I(S,w("SetUrlPlaceholder"))},a.ZP.createElement("div",{className:"title"},S),a.ZP.createElement("span",{className:"subtitle"},w("SetUrlPlaceholder"))),!s&&a.ZP.createElement(u.Z,{icon:"unmute",ripple:!0,onClick:k},a.ZP.createElement("span",null,w("Notifications")),a.ZP.createElement(m.Z,{id:"group-notifications",label:E?"Toggle User Notifications":"Toggle Chat Notifications",checked:!f,inactive:!0})))})))},329:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(5116),s=n(1638),i=n(8415),o=n(9107),c=n(2340),l=n(172),d=n(3103),u=n(231);const m=(0,a.X$)((0,r.c$)(((e,{chat:t})=>{const n=(0,i.YC)(t.id),a=(0,s.FM)(e,t.id),r=n&&(0,s.dy)(e,(0,i.zX)(t)),o=r&&(0,i.cS)(r)&&!t.isSupport,c=n&&!a&&!o,l=n?(0,i.Vl)((0,s.dy)(e,(0,i.zX)(t))):void 0;return{isPrivateChat:n,isChatWithSelf:a,isBot:o,isChannel:(0,i.eA)(t),isBasicGroup:(0,i.G9)(t),isSuperGroup:(0,i.ZV)(t),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:l}}))((({isOpen:e,chat:t,isChannel:n,isPrivateChat:s,isChatWithSelf:m,isBot:h,isBasicGroup:f,isSuperGroup:v,currentUserId:p,canDeleteForAll:Z,contactName:g,onClose:E,onCloseAnimationEnd:P})=>{const{leaveChannel:y,deleteHistory:C,deleteChannel:b,deleteChatUser:N,blockContact:w}=(0,r.uC)(),k=(0,o.Z)(),I=(0,i.U)(k,t),T=(0,a.I4)((()=>{C({chatId:t.id,shouldDeleteForAll:!0}),E()}),[C,t.id,E]),S=(0,a.I4)((()=>{C({chatId:t.id,shouldDeleteForAll:!0}),w({contactId:t.id,accessHash:t.accessHash}),E()}),[C,t.id,t.accessHash,w,E]),M=(0,a.I4)((()=>{s?C({chatId:t.id,shouldDeleteForAll:!1}):f?(N({chatId:t.id,userId:p}),C({chatId:t.id,shouldDeleteForAll:!1})):!n&&!v||t.isCreator?(n||v)&&t.isCreator&&b({chatId:t.id}):y({chatId:t.id}),E()}),[s,f,n,v,p,t.isCreator,t.id,E,C,N,y,b]);return a.ZP.createElement(d.Z,{isOpen:e,className:"DeleteChatModal",header:a.ZP.createElement("div",{className:"modal-header",dir:k.isRtl?"rtl":void 0},a.ZP.createElement(l.Z,{size:"tiny",chat:t,isSavedMessages:m}),a.ZP.createElement("h3",{className:"modal-title"},k(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"ChannelDelete":f||v?"Group.LeaveGroup":"DeleteChatUser"))),onClose:E,onCloseAnimationEnd:P},n&&t.isCreator?a.ZP.createElement("p",null,(0,c.Z)(k("ChatList.DeleteAndLeaveGroupConfirmation",I),["simple_markdown"])):n&&!t.isCreator||f||v?a.ZP.createElement("p",null,(0,c.Z)(k("ChannelLeaveAlertWithName",I),["simple_markdown"])):a.ZP.createElement("p",null,(0,c.Z)(k("ChatList.DeleteChatConfirmation",g),["simple_markdown"])),h&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:S},k("DeleteAndStop")),Z&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},g?(0,c.Z)(k("ChatList.DeleteForEveryone",g)):k("DeleteForAll")),a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},k(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"Chat.Input.Delete":f||v?"Group.LeaveGroup":Z?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(u.Z,{className:"confirm-dialog-button",isText:!0,onClick:E},k("Cancel")))})))},2535:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(5116),s=n(5376),i=n(8415),o=n(3657),c=n(2566),l=n(6202),d=n(706),u=n(7002);const m=(0,a.X$)((({message:e,observeIntersection:t,smaller:n,canAutoLoad:m,autoLoadFileMaxSizeMb:h,uploadProgress:f,withDate:v,datetime:p,className:Z,sender:g,isSelected:E,isSelectable:P,onCancelUpload:y,onMediaClick:C,onDateClick:b,isDownloading:N})=>{const w=(0,r.uC)(),k=(0,a.sO)(null),I=e.content.document,{fileName:T,size:S,timestamp:M}=I,L=(0,s.K2)(I)||"",x=(0,o.Op)(k,t),[$,O]=(0,d.Z)();(0,a.d4)((()=>{x&&O()}),[x,O]);const[F,A]=(0,a.eJ)(m&&(!h||S<=1048576*h)),D=Boolean(N||F&&$),R=(0,i.Ti)(e,"download"),{loadProgress:U,mediaData:B}=(0,c.Z)(R,!D,void 0,void 0,void 0,!0),X=Boolean(B),{isUploading:Y,isTransferring:K,transferProgress:V}=(0,i.Sc)(e,f||U,D&&!X),j=(0,s.v6)(I),z=j?(0,i.DH)(e):void 0,H=j?I.previewBlobUrl:void 0,q=(0,l.Z)((0,i.Ti)(e,"pictogram"),!x),W=C&&Boolean(I.mediaType),J=(0,a.I4)((()=>{Y?y&&y():N?w.cancelMessageMediaDownload({message:e}):K?A(!1):W?C():w.downloadMessageMedia({message:e})}),[Y,N,K,W,y,w,e,C]),_=(0,a.I4)((()=>{b(e.id,e.chatId)}),[b,e.id,e.chatId]);return a.ZP.createElement(u.Z,{ref:k,name:T,extension:L,size:S,timestamp:v?p||M:void 0,thumbnailDataUri:z,previewData:H||q,smaller:n,isTransferring:K,isUploading:Y,transferProgress:V,className:Z,sender:g,isSelectable:P,isSelected:E,actionIcon:W?(0,i.hC)(e)?"icon-play":"icon-eye":"icon-download",onClick:J,onDateClick:b?_:void 0})}))},8780:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9107),s=n(6752);const i=({content:e,className:t})=>{const n=(0,r.Z)();return a.ZP.createElement("span",{className:(0,s.Z)("DotAnimation",t),dir:n.isRtl?"rtl":"auto"},e,a.ZP.createElement("span",{className:"ellipsis"}))}},7002:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(1212),s=n(692),i=n(6752),o=n(790),c=n(5376),l=n(4399),d=n(2340),u=n(9107),m=n(9196),h=n(8033);const f=(0,a.X$)((({ref:e,name:t,size:n,extension:f="",timestamp:v,sender:p,thumbnailDataUri:Z,previewData:g,className:E,smaller:P,isTransferring:y,isUploading:C,isSelectable:b,isSelected:N,transferProgress:w,actionIcon:k,onClick:I,onDateClick:T})=>{const S=(0,u.Z)();let M=(0,a.sO)(null);e&&(M=e);const L=(0,s.Z)(g),{shouldRender:x,transitionClassNames:$}=(0,r.Z)(y,void 0,!0),O=(0,c.Oh)(f),F=(0,c.yW)(n),{width:A,height:D}=(0,l.lE)(P),R=(0,i.Z)("File",E,P&&"smaller",I&&!C&&"interactive",N&&"file-is-selected");return a.ZP.createElement("div",{ref:M,className:R,dir:S.isRtl?"rtl":void 0},b&&a.ZP.createElement("div",{className:"message-select-control"},N&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement("div",{className:"file-icon-container",onClick:C?void 0:I},Z||g?a.ZP.createElement("div",{className:"file-preview media-inner"},a.ZP.createElement("img",{src:Z,width:A,height:D,className:"thumbnail",alt:""}),a.ZP.createElement("img",{src:g,className:(0,i.Z)("full-media",L),width:A,height:D,alt:""})):a.ZP.createElement("div",{className:`file-icon ${O}`},f.length<=4&&a.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),x&&a.ZP.createElement("div",{className:(0,i.Z)("file-progress",O,$)},a.ZP.createElement(m.Z,{progress:w,size:P?"s":"m",onClick:C?I:void 0})),I&&a.ZP.createElement("i",{className:(0,i.Z)("action-icon",k||"icon-download",x&&"hidden")})),a.ZP.createElement("div",{className:"file-info"},a.ZP.createElement("div",{className:"file-title",dir:"auto"},(0,d.Z)(t)),a.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},a.ZP.createElement("span",null,y&&w?`${Math.round(100*w)}%`:F),p&&a.ZP.createElement("span",{className:"file-sender"},(0,d.Z)(p)),!p&&v&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"}),a.ZP.createElement(h.Z,{onClick:T},(0,o.ZK)(S,1e3*v,!0))))),p&&v&&a.ZP.createElement(h.Z,{onClick:T},(0,o.VX)(S,1e3*v)))}))},8799:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(5116),s=n(1713),i=n(8415),o=n(1638),c=n(2340),l=n(9107),d=n(172),u=n(9411),m=n(8729),h=n(8780);const f=(0,a.X$)((0,r.c$)(((e,{chatId:t})=>{const{lastSyncTime:n}=e,a=(0,o.Z1)(e,t);return{lastSyncTime:n,chat:a,onlineCount:a?(0,o.YK)(e,a):void 0,areMessagesLoaded:Boolean((0,o.Zw)(e,t))}}))((({typingStatus:e,avatarSize:t="medium",status:n,withDots:o,withMediaViewer:f,withUsername:v,withFullInfo:p,withUpdatingStatus:Z,withChatType:g,noRtl:E,chat:P,onlineCount:y,areMessagesLoaded:C,lastSyncTime:b})=>{const{loadFullChat:N,openMediaViewer:w}=(0,r.uC)(),k=P&&(0,i.ZV)(P),{id:I,isMin:T,isRestricted:S}=P||{};(0,a.d4)((()=>{I&&!T&&p&&b&&N({chatId:I})}),[I,T,b,p,N,k]);const M=(0,a.I4)(((e,n)=>{P&&n&&(e.stopPropagation(),w({avatarOwnerId:P.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[P,t,w]),L=(0,l.Z)();if(P)return a.ZP.createElement("div",{className:"ChatInfo",dir:!E&&L.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:P.id,size:t,chat:P,onClick:f?M:void 0}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},(0,c.Z)((0,i.U)(L,P))),P.isVerified&&a.ZP.createElement(u.Z,null)),function(){if(n)return o?a.ZP.createElement(h.Z,{className:"status",content:n}):a.ZP.createElement("span",{className:"status",dir:"auto"},n);if(Z&&!C&&!S)return a.ZP.createElement(h.Z,{className:"status",content:L("Updating")});if(!P)return;if(e)return a.ZP.createElement(m.Z,{typingStatus:e});if(g)return a.ZP.createElement("span",{className:"status",dir:"auto"},L((0,i.l6)(P)));const t=v?P.username:void 0,r=function(e,t){const n=e((0,i.l6)(t)),{membersCount:a}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":a?e("Channel"===n?"Subscribers":"Members",a,"i"):n}(L,P),s=y?`, ${L("OnlineCount",y,"i")}`:void 0;return a.ZP.createElement("span",{className:"status"},t&&a.ZP.createElement("span",{className:"handle"},t),a.ZP.createElement("span",{className:"group-status"},r),s&&a.ZP.createElement("span",{className:"online-status"},s))}()))})))},6844:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(790),s=n(9107),i=n(8018);const o=(0,a.X$)((({message:e,outgoingStatus:t})=>{const n=(0,s.Z)();return a.ZP.createElement("div",{className:"LastMessageMeta"},t&&a.ZP.createElement(i.Z,{status:t}),a.ZP.createElement("span",{className:"time"},(0,r.VX)(n,1e3*e.date)))}))},3709:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(790),s=n(3227),i=n(8415),o=n(6752),c=n(6202),l=n(692);const d=(0,a.X$)((({message:e,idPrefix:t="shared-media",isProtected:n,onClick:d})=>{const u=(0,a.I4)((()=>{d(e.id,e.chatId)}),[e.id,e.chatId,d]),m=(0,i.DH)(e),h=(0,c.Z)((0,i.Ti)(e,"pictogram")),f=(0,l.Z)(h),v=(0,i.b7)(e);return a.ZP.createElement("div",{id:`${t}${e.id}`,className:"Media scroll-item",onClick:d?u:void 0},a.ZP.createElement("img",{src:m,alt:"",draggable:!n,onContextMenu:n?s.Z:void 0}),a.ZP.createElement("img",{src:h,className:(0,o.Z)("full-media",f),alt:"",draggable:!n,onContextMenu:n?s.Z:void 0}),v&&a.ZP.createElement("span",{className:"video-duration"},v.isGif?"GIF":(0,r.k9)(v.duration)),n&&a.ZP.createElement("span",{className:"protector"}))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>i});var a,r=n(4050),s=n(2255);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(a||(a={}));const i=(0,r.X$)((({status:e})=>r.ZP.createElement("div",{className:"MessageOutgoingStatus"},r.ZP.createElement(s.Z,{name:"reveal",activeKey:a[e]},(()=>r.ZP.createElement("i",{className:`icon-message-${e}`}))))))},7262:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(6752),s=n(1212),i=n(2340),o=n(9107);const c=(0,a.X$)((({text:e="Nothing found.",description:t})=>{const n=(0,o.Z)(),{transitionClassNames:c}=(0,s.Z)(!0);return a.ZP.createElement("div",{className:(0,r.Z)("NothingFound",c,t&&"with-description")},e,t&&a.ZP.createElement("p",{className:"description"},(0,i.Z)(n(t),["br"])))}))},1820:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(8415),s=n(1273),i=n(4605),o=n(7687),c=n(1876),l=n(6058),d=n(8799),u=n(9187),m=n(7407),h=n(9107),f=n(4288);const v=(0,a.X$)((({itemIds:e,selectedIds:t,filterValue:n,filterPlaceholder:v,notFoundText:p,searchInputId:Z,isLoading:g,noScrollRestore:E,onSelectedIdsChange:P,onFilterChange:y,onLoadMore:C})=>{const b=(0,a.sO)(null),N=t.length>10;(0,a.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{b.current.focus()}))}),500)}),[]);const w=(0,a.I4)((e=>{const n=[...t];n.includes(e)?n.splice(n.indexOf(e),1):n.push(e),P(n),y("")}),[t,P,y]),k=(0,a.I4)((e=>{const{value:t}=e.currentTarget;y(t)}),[y]),[I,T]=(0,m.Z)(C,e,Boolean(n)),S=(0,h.Z)();return a.ZP.createElement("div",{className:"Picker"},a.ZP.createElement("div",{className:"picker-header custom-scroll",dir:S.isRtl?"rtl":void 0},t.map(((e,n)=>a.ZP.createElement(u.Z,{chatOrUserId:e,isMinimized:N&&n<t.length-5,canClose:!0,onClick:w,clickArg:e}))),a.ZP.createElement(o.Z,{id:Z,ref:b,value:n,onChange:k,placeholder:v||S("SelectChat")})),null!=I&&I.length?a.ZP.createElement(s.Z,{className:"picker-list custom-scroll",items:I,onLoadMore:T,noScrollRestore:E},I.map((e=>a.ZP.createElement(c.Z,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>w(e),ripple:!0},a.ZP.createElement(i.Z,{label:"",checked:t.includes(e)}),(0,r.YC)(e)?a.ZP.createElement(l.Z,{userId:e}):a.ZP.createElement(d.Z,{chatId:e}))))):g||!I||I.length?a.ZP.createElement(f.Z,null):a.ZP.createElement("p",{className:"no-results"},p||"Sorry, nothing found."))}))},9187:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(5116),s=n(1638),i=n(8415),o=n(2340),c=n(6752),l=n(9107),d=n(172);const u=(0,a.X$)((0,r.c$)(((e,{chatOrUserId:t})=>t?{chat:t?(0,s.Z1)(e,t):void 0,user:(0,i.YC)(t)?(0,s.dy)(e,t):void 0}:{}))((({icon:e,title:t,isMinimized:n,canClose:r,onClick:s,clickArg:u,chat:m,user:h,className:f})=>{const v=(0,l.Z)();let p,Z;if(e&&t)p=a.ZP.createElement("div",{className:"item-icon"},a.ZP.createElement("i",{className:`icon-${e}`})),Z=t;else if(m||h){p=a.ZP.createElement(d.Z,{chat:m,user:h,size:"small",isSavedMessages:null==h?void 0:h.isSelf});const e=!m||h&&!h.isSelf?(0,i.Vl)(h):(0,i.U)(v,m,h);Z=e?(0,o.Z)(e):void 0}const g=(0,c.Z)("PickerSelectedItem",f,n&&"minimized",r&&"closeable");return a.ZP.createElement("div",{className:g,onClick:()=>s(u),title:n?Z:void 0,dir:v.isRtl?"rtl":void 0},p,!n&&a.ZP.createElement("div",{className:"item-name",dir:"auto"},Z),r&&a.ZP.createElement("div",{className:"item-remove"},a.ZP.createElement("i",{className:"icon-close"})))})))},6058:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(5116),s=n(1713),i=n(1638),o=n(8415),c=n(2340),l=n(9107),d=n(172),u=n(9411),m=n(8729),h=n(8780);const f=(0,a.X$)((0,r.c$)(((e,{userId:t,forceShowSelf:n})=>{const{lastSyncTime:a,serverTimeOffset:r}=e,s=(0,i.dy)(e,t);return{lastSyncTime:a,user:s,userStatus:(0,i.ss)(e,t),isSavedMessages:!n&&s&&s.isSelf,areMessagesLoaded:Boolean((0,i.Zw)(e,t)),serverTimeOffset:r}}))((({typingStatus:e,avatarSize:t="medium",status:n,withDots:i,withMediaViewer:f,withUsername:v,withFullInfo:p,withUpdatingStatus:Z,noStatusOrTyping:g,noRtl:E,user:P,userStatus:y,isSavedMessages:C,areMessagesLoaded:b,lastSyncTime:N,serverTimeOffset:w})=>{const{loadFullUser:k,openMediaViewer:I}=(0,r.uC)(),{id:T}=P||{},S=(0,o.Js)(P);(0,a.d4)((()=>{p&&N&&T&&k({userId:T})}),[T,k,N,p]);const M=(0,a.I4)(((e,n)=>{P&&n&&(e.stopPropagation(),I({avatarOwnerId:P.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[P,t,I]),L=(0,l.Z)();if(P)return a.ZP.createElement("div",{className:"ChatInfo",dir:!E&&L.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:P.id,size:t,user:P,isSavedMessages:C,onClick:f?M:void 0}),a.ZP.createElement("div",{className:"info"},C?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,L("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},S&&(0,c.Z)(S)),(null==P?void 0:P.isVerified)&&a.ZP.createElement(u.Z,null)),(n||!C&&!g)&&(n?i?a.ZP.createElement(h.Z,{className:"status",content:n}):a.ZP.createElement("span",{className:"status",dir:"auto"},n):Z&&!b?a.ZP.createElement(h.Z,{className:"status",content:L("Updating")}):P?e?a.ZP.createElement(m.Z,{typingStatus:e}):a.ZP.createElement("span",{className:"status "+((0,o.kM)(P,y)?"online":"")},v&&P.username&&a.ZP.createElement("span",{className:"handle"},P.username),a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,o.Tq)(L,P,y,w))):void 0)))})))},787:(e,t,n)=>{n.d(t,{Z:()=>b});var a=n(4050),r=n(5116),s=n(1713),i=n(7361),o=n(1638),c=n(8415),l=n(2340),d=n(1174),u=n(6752),m=n(6137),h=n(647),f=n(9107),v=n(9411),p=n(2155),Z=n(6202),g=n(2937),E=n(7204),P=n(9204);const y=(0,a.X$)((({chat:e,user:t,photo:n,isFirstPhoto:r,isSavedMessages:s,lastSyncTime:i,onClick:o})=>{const d=(0,f.Z)(),h=t&&(0,c.NB)(t),v=e&&(0,c.pK)(e.id);function y(a,r){if(n&&!r)return`photo${n.id}?size=c`;let i;return s||h||v||(t?i=(0,c.RT)(t,a):e&&(i=(0,c.RT)(e,a))),i}const C=(0,Z.Z)(y("big"),!1,m.IU.BlobUrl,i),b=r&&!C?y("normal",!0):void 0,N=(0,Z.Z)(b,!1,m.IU.BlobUrl,i),w=(0,g.Z)(!C&&n&&n.thumbnail&&n.thumbnail.dataUri),k=C||N||w,I=(0,E.Z)(k);let T="";if(s)T=a.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(h)T=a.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(v)T=a.ZP.createElement("i",{className:"icon-reply-filled"});else if(k)T=a.ZP.createElement("img",{src:k,className:"avatar-media",alt:"",decoding:"async"});else if(!k&&t){const e=(0,c.Js)(t);T=e?(0,p.Xv)(e,2):void 0}else if(!k&&e){const t=(0,c.U)(d,e);T=t&&(0,p.Xv)(t,(0,c.YC)(e.id)?2:1)}else T=a.ZP.createElement("div",{className:"spinner-wrapper"},a.ZP.createElement(P.Z,{color:"white"}));const S=(0,u.Z)("ProfilePhoto",`color-bg-${(0,c.Rs)(t||e)}`,s&&"saved-messages",h&&"deleted-account",v&&"replies-bot-account",!s&&!k&&"no-photo");return a.ZP.createElement("div",{className:S,onClick:k?o:void 0},I&&k&&I!==k&&a.ZP.createElement("img",{src:I,className:"prev-avatar-media",alt:"",decoding:"async"}),"string"==typeof T?(0,l.Z)(T,["hq_emoji"]):T)}));var C=n(2255);const b=(0,a.X$)((0,r.c$)(((e,{userId:t,forceShowSelf:n})=>{const{connectionState:a,serverTimeOffset:r}=e,s=(0,o.dy)(e,t),i=(0,o.ss)(e,t),c=(0,o.Z1)(e,t),l=!n&&s&&s.isSelf,{animationLevel:d}=e.settings.byKey;return{connectionState:a,user:s,userStatus:i,chat:c,isSavedMessages:l,animationLevel:d,serverTimeOffset:r}}))((({forceShowSelf:e,user:t,userStatus:n,chat:o,isSavedMessages:p,connectionState:Z,animationLevel:g,serverTimeOffset:E})=>{var P;const{loadFullUser:b,openMediaViewer:N}=(0,r.uC)(),w=(0,f.Z)(),{id:k}=t||{},{id:I}=o||{},T=t?(0,c.Js)(t):o?o.title:"",S=(null==t?void 0:t.photos)||(null==o?void 0:o.photos)||[],M=g>=1?w.isRtl?"slide-optimized-rtl":"slide-optimized":"none",[L,x]=(0,a.eJ)(0),$=p||S.length<=1||0===L,O=p||S.length<=1||L===S.length-1;(0,a.d4)((()=>{L>S.length&&x(Math.max(0,S.length-1))}),[L,S.length]),(0,a.d4)((()=>{"connectionStateReady"===Z&&k&&!e&&b({userId:k})}),[k,b,Z,e]),function(e,t,n){(0,a.d4)((()=>{t.slice(n,n+4).forEach((e=>{h.UV(`photo${e.id}?size=c`)||h.he(`photo${e.id}?size=c`,m.IU.BlobUrl)}))}),[n,t])}(0,S,L);const F=(0,a.I4)((()=>{N({avatarOwnerId:k||I,profilePhotoIndex:L,origin:e?s.bZ.SettingsAvatar:s.bZ.ProfileAvatar})}),[N,k,I,L,e]),A=(0,a.I4)((()=>{$||x(L-1)}),[L,$]),D=(0,a.I4)((()=>{O||x(L+1)}),[L,O]);if((0,a.d4)((()=>{const e=document.querySelector(".photo-wrapper");if(e)return(0,d.sf)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:i.$b?(e,t)=>t===d.eM.Right?(A(),!0):t===d.eM.Left&&(D(),!0):void 0})}),[D,A]),!t&&!o)return;function R(){const e=!p&&S&&S.length>0?S[L]:void 0;return a.ZP.createElement(y,{key:L,user:t,chat:o,photo:e,isSavedMessages:p,isFirstPhoto:$,onClick:F})}const U=null===(P=t||o)||void 0===P?void 0:P.isVerified;return a.ZP.createElement("div",{className:(0,u.Z)("ProfileInfo",e&&"self"),dir:w.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:"photo-wrapper"},function(){if(!(p||!S||S.length<=1))return a.ZP.createElement("div",{className:"photo-dashes"},S.map(((e,t)=>a.ZP.createElement("span",{className:"photo-dash "+(t===L?"current":"")}))))}(),a.ZP.createElement(C.Z,{activeKey:L,name:M,className:"profile-slide-container"},R),!$&&a.ZP.createElement("button",{type:"button",className:"navigation prev","aria-label":w("AccDescrPrevious"),onClick:A}),!O&&a.ZP.createElement("button",{type:"button",className:"navigation next","aria-label":w("Next"),onClick:D})),a.ZP.createElement("div",{className:"info",dir:w.isRtl?"rtl":"auto"},p?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},w("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},T&&(0,l.Z)(T)),U&&a.ZP.createElement(v.Z,null)),!p&&(t?a.ZP.createElement("div",{className:"status "+((0,c.kM)(t,n)?"online":"")},a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,c.Tq)(w,t,n,E))):a.ZP.createElement("span",{className:"status",dir:"auto"},(0,c.eA)(o)?w("Subscribers",null!==(B=o.membersCount)&&void 0!==B?B:0,"i"):w("Members",null!==(X=o.membersCount)&&void 0!==X?X:0,"i")))));var B,X})))},8198:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(5116),s=n(6137),i=n(6202),o=n(6752);const c=(0,a.X$)((({reaction:e,ref:t,className:n})=>{var c,l,d;const u=null===(c=(0,r.Rd)().availableReactions)||void 0===c||null===(l=c.find((t=>t.reaction===e)))||void 0===l||null===(d=l.staticIcon)||void 0===d?void 0:d.id,m=(0,i.Z)(`document${u}`,!u,s.IU.BlobUrl);return a.ZP.createElement("img",{className:(0,o.Z)("ReactionStaticEmoji",n),ref:t,src:m,alt:""})}))},3547:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(6137),s=n(3657),i=n(6202),o=n(1212),c=n(706),l=n(6752),d=n(386),u=n(7799),m=n(231);const h=(0,a.X$)((({sticker:e,size:t,observeIntersection:n,noAnimate:h,title:f,className:v,onClick:p,clickArg:Z,onUnfaveClick:g})=>{const E=(0,a.sO)(null),P=`sticker${e.id}`,y=`sticker-button-${e.id}`,C=(0,s.Op)(E,n),b=e.thumbnail?e.thumbnail.dataUri:void 0,N=(0,i.Z)(`${P}?size=m`,!C,r.IU.BlobUrl),w=C&&!h,k=(0,i.Z)(e.isAnimated&&P,!w,r.IU.Lottie),[I,T,S]=(0,c.Z)(Boolean(k)),M=I&&w,{transitionClassNames:L}=(0,o.Z)(Boolean(N||M),void 0,void 0,"slow");(0,a.d4)((()=>{w||S()}),[S,w]);const x=(0,l.Z)("StickerButton",p&&"interactive",e.isAnimated&&"animated",y,v),$=b&&!M?`background-image: url('${b}');`:"";return a.ZP.createElement("div",{ref:E,className:x,title:f||(null==e?void 0:e.emoji),style:$,"data-sticker-id":e.id,onMouseDown:d.b,onClick:function(){p&&p(Z)}},!M&&a.ZP.createElement("img",{src:N,className:L}),w&&k&&a.ZP.createElement(u.Z,{id:P,animationData:k,play:!0,size:t,isLowPriority:!0,onLoad:T}),g&&a.ZP.createElement(m.Z,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(t){t.stopPropagation(),t.preventDefault(),g(e)}},a.ZP.createElement("i",{className:"icon-close"})))}))},4851:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9203),s=n(8778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(r.gl.Extra,"StickerSetModal",!t);return n?a.ZP.createElement(n,e):void 0}))},8729:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(5116),s=n(1638),i=n(8415),o=n(2340),c=n(9107),l=n(8780);const d=(0,a.X$)((0,r.c$)(((e,{typingStatus:t})=>t.userId?{typingUser:(0,s.dy)(e,t.userId)}:{}))((({typingStatus:e,typingUser:t})=>{const n=(0,c.Z)(),r=t&&!t.isSelf&&(0,i.Vl)(t),s=n(e.action).replace("{user}","").replace("{emoji}",e.emoji).trim();return a.ZP.createElement("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto"},r&&a.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,o.Z)(r)),a.ZP.createElement(l.Z,{content:s}))})))},9411:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=()=>a.ZP.createElement("span",{className:"VerifiedIcon"})},5418:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(8415),s=n(6752),i=n(8035),o=n(2340),c=n(790),l=n(9107),d=n(1265),u=n(3709),m=n(8033),h=n(88);const f=(0,a.X$)((({message:e,senderTitle:t,isProtected:n,onMessageClick:f})=>{const v=(0,l.Z)();let p=(0,r.s1)(e);if(!p){const t=(0,r.T7)(e);if(t){const{url:n,domain:a}=t;p={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,r.UD)(e)!==n?(0,d.eK)(v,e,void 0,void 0,170,!0):void 0}}}const Z=(0,a.I4)((()=>{f(e.id,e.chatId)}),[f,e.id,e.chatId]);if(!p)return;const{siteName:g,url:E,displayUrl:P,title:y,description:C,formattedDescription:b,photo:N,video:w}=p,k=!t&&C&&(0,i.Z)(C,170),I=(0,s.Z)("WebLink scroll-item",!N&&!w&&"without-media");return a.ZP.createElement("div",{className:I,"data-initial":(g||P)[0],dir:v.isRtl?"rtl":void 0},N&&a.ZP.createElement(u.Z,{message:e,isProtected:n}),a.ZP.createElement("div",{className:"content"},a.ZP.createElement(m.Z,{isRtl:v.isRtl,className:"site-title",onClick:Z},(0,o.Z)(y||g||P)),(k||b)&&a.ZP.createElement(m.Z,{isRtl:v.isRtl,className:"site-description",onClick:Z},b||k&&(0,o.Z)(k)),a.ZP.createElement(h.Z,{url:E,className:"site-name",text:"",isRtl:v.isRtl},E.replace("mailto:","")||P),t&&a.ZP.createElement("div",{className:"sender-name"},(0,o.Z)(t))),t&&a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(m.Z,{className:"date",onClick:Z,isRtl:v.isRtl},(0,c.VX)(v,1e3*e.date))))}))},4399:(e,t,n)=>{n.d(t,{L6:()=>o,Gw:()=>c,Rj:()=>l,vY:()=>d,wB:()=>u,kc:()=>p,fM:()=>g,Eh:()=>E,GC:()=>P,W7:()=>y,lE:()=>C,Wr:()=>b,PA:()=>N,jg:()=>w});var a=n(3716),r=n(7361),s=n(3858),i=n(8415);const o="(max-height: 640px)",c=parseInt(getComputedStyle(document.documentElement).fontSize,10),l=240,d={width:640,height:640},u="4986041492570112461",m={width:100,height:100};let h,f,v;function p(e,t,n,a){const i=t||n?1.625:0;return(function(e,t){const n=e?30:29;if(!r.wB)return n;const{width:a}=s.Z.get();return h||(h=Math.min(30,a/c-4.5)),f||(f=Math.min(29,a/c-7)),v||(v=Math.min(29,a/c-4.5)),e?h:t?v:f}(e,a)-i)*c}function Z({width:e,height:t,fromOwnMessage:n,isForwarded:a,isWebPagePhoto:r,isGif:s,noAvatars:i}){const o=t/e,l=p(n,a,r,i),d=function(e,t){return e&&t&&t>=.75&&t<=1.25?20*c:27*c}(s,o),u=s?Math.max(300,e):e;return w(l,d,u,s?t*(u/e):t)}function g(e,t){const n=window.matchMedia(o),{width:a,height:i}=s.Z.get();let l=t&&n.matches?10:8.25;return e&&!r.$b&&(l=n.matches?10:12.5),{width:a,height:i-l*c}}function E(e,t,n,a,r){const{width:s,height:o}=(0,i.HV)(e)||m;return Z({width:s,height:o,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:a,noAvatars:r})}function P(e,t,n,a){const{width:r,height:s}=(0,i.jC)(e)||m;return Z({width:r,height:s,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:a})}function y(){return{width:2*c,height:2*c}}function C(e){return e?{width:3*c,height:3*c}:{width:3.375*c,height:3.375*c}}function b(e){const{width:t}=e;let{height:n}=e;e.id===u&&(n=t);const s=n&&t&&n/t,i=c*(r.wB?a.w7:a.K7),o=s?i*s:i;return s&&o>i?{width:Math.round(i/s),height:i}:{width:i,height:o}}function N({width:e,height:t},n,a=!1){const{width:r,height:s}=g(n,a);return w(r,s,e,t)}function w(e,t,n,a){const r=a/n,s=Math.min(n,e);return Math.round(s*r)>t?{width:Math.round(t/r),height:t}:{width:s,height:Math.round(s*r)}}},5296:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(4753),s=n(5116),i=n(6202),o=n(706),c=n(1638);const l={large:160,medium:128,small:104};function d(e,t,n,d,u,m,h,f){const{interactWithAnimatedEmoji:v,sendEmojiInteraction:p,sendWatchingEmojiInteraction:Z}=(0,s.uC)(),g=h||f,[E,P]=(0,o.Z)(),y=(0,a.sO)(null),C=(0,a.sO)(null),b=(0,i.Z)(d?`document${d}`:void 0,!d),N=l[e],w=`width: ${N}px; height: ${N}px;`,[k,I]=(0,a.eJ)(String(Math.random())),T=(0,a.sO)(void 0),S=(0,a.sO)(void 0),M=(0,a.I4)((()=>{y.current&&(p({chatId:t,messageId:n,localEffect:h,emoji:f,interactions:T.current}),S.current=void 0,T.current=void 0)}),[p,t,n,h,f]),L=(0,a.I4)((()=>{I(String(Math.random()));const e=C.current;b&&(e&&(e.pause(),e.remove()),C.current=new Audio,C.current.src=b,(0,r.Z)(C.current),C.current.addEventListener("ended",(()=>{C.current=void 0}),{once:!0}))}),[b]),x=(0,a.I4)((()=>{L();const e=y.current;if(!(g&&e&&n&&t))return;const{x:a,y:r}=e.getBoundingClientRect();v({localEffect:h,emoji:f,x:a,y:r,startSize:N,isReversed:!m}),T.current||(T.current=[],S.current=performance.now(),setTimeout(M,1e3)),T.current.push(S.current?(performance.now()-S.current)/1e3:0)}),[t,f,g,v,m,h,n,L,M,N]);return(0,a.d4)((()=>{const e=y.current;if(!e||!u)return;const{messageId:a,endX:r,endY:s}=u;if(!r&&!s&&a===n){const{x:n,y:a}=e.getBoundingClientRect();Z({chatId:t,emoticon:h?(0,c.ji)(h):f,startSize:N,x:n,y:a,isReversed:!m}),L()}}),[u,t,f,m,h,n,L,Z,N]),{playKey:k,ref:y,style:w,width:N,handleClick:x,markAnimationLoaded:P,isAnimationLoaded:E}}},742:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9203),s=n(8778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(r.gl.Extra,"ChatFolderModal",!t);return n?a.ZP.createElement(n,e):void 0}))},1080:(e,t,n)=>{n.d(t,{Z:()=>K});var a=n(4050),r=n(5116),s=n(3716),i=n(7361),o=n(7204),c=n(782),l=n(8415),d=n(1638),u=n(7407);let m;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(m||(m={}));var h=n(1273),f=n(4288),v=n(9107),p=n(6137),Z=n(8005),g=n(2340),E=n(9118),P=n(6752),y=n(5790),C=n(1470),b=n(706),N=n(6202),w=n(1265),k=n(172),I=n(9411),T=n(8729),S=n(6844),M=n(329),L=n(1876),x=n(2155),$=n(126);const O=(0,a.X$)((({chat:e,isPinned:t,isMuted:n})=>{const r=Boolean(e.unreadCount||e.hasUnreadMark||t),s=(0,P.Z)("Badge",n&&"muted",t&&"pinned",Boolean(e.unreadCount||e.hasUnreadMark)&&"unread");function i(){return e.unreadCount?e.unreadMentionsCount?a.ZP.createElement("div",{className:"Badge-wrapper"},a.ZP.createElement("div",{className:"Badge mention"},a.ZP.createElement("i",{className:"icon-mention"})),a.ZP.createElement("div",{className:s},(0,x.bi)(e.unreadCount))):a.ZP.createElement("div",{className:s},(0,x.bi)(e.unreadCount)):e.hasUnreadMark?a.ZP.createElement("div",{className:s}):t?a.ZP.createElement("div",{className:s},a.ZP.createElement("i",{className:"icon-pinned-chat"})):void 0}return a.ZP.createElement($.Z,{isCustom:!0,className:"Badge-transition",isOpen:r},i)}));var F=n(742);const A=(0,a.X$)((({isSelected:e,isActive:t})=>a.ZP.createElement("div",{className:(0,P.Z)("ChatCallStatus",t&&"active",e&&!i.wB&&"selected")},a.ZP.createElement("div",{className:"indicator"},a.ZP.createElement("div",null),a.ZP.createElement("div",null),a.ZP.createElement("div",null))))),D=(0,a.X$)((0,r.c$)(((e,{chatId:t})=>{var n;const a=(0,d.Z1)(e,t);if(!a||!a.lastMessage)return{};const{senderId:r,replyToMessageId:s,isOutgoing:i}=a.lastMessage,o=r?(0,d.dy)(e,r):void 0,c=(0,l.N5)(a.lastMessage),u=c&&s?(0,d.hj)(e,a.id,s):void 0,{targetUserIds:m,targetChatId:h}=c||{},f=(0,l.zX)(a),{chatId:v,threadId:Z,type:g}=(0,d.Bt)(e)||{},E=t===v&&Z===p._f;return{chat:a,isMuted:(0,l.i4)(a,(0,d.dZ)(e),(0,d.NJ)(e)),lastMessageSender:o,actionTargetUserIds:m,actionTargetChatId:h,actionTargetMessage:u,draft:(0,d.Ms)(e,t,p._f),animationLevel:e.settings.byKey.animationLevel,isSelected:E,canScrollDown:E&&"thread"===g,canChangeFolder:Boolean(null===(n=e.chatFolders.orderedIds)||void 0===n?void 0:n.length),lastSyncTime:e.lastSyncTime,...i&&{lastMessageOutgoingStatus:(0,d.dT)(e,a.lastMessage)},...f&&{user:(0,d.dy)(e,f),userStatus:(0,d.ss)(e,f)}}}))((({style:e,chatId:t,folderId:n,orderDiff:o,animationType:c,isPinned:d,chat:u,isMuted:h,user:f,userStatus:p,actionTargetUserIds:x,lastMessageSender:$,lastMessageOutgoingStatus:D,actionTargetMessage:R,actionTargetChatId:U,draft:B,animationLevel:X,isSelected:Y,canScrollDown:K,canChangeFolder:V,lastSyncTime:j})=>{const{openChat:z,focusLastMessage:H}=(0,r.uC)(),q=(0,a.sO)(null),[W,J,_]=(0,b.Z)(),[G,Q,ee]=(0,b.Z)(),[te,ne,ae]=(0,b.Z)(),[re,se,ie]=(0,b.Z)(),{lastMessage:oe,typingStatus:ce}=u||{},le=oe&&(0,l.Lo)(oe);(0,y.Z)(t,le?oe.replyToMessageId:void 0,R);const de=oe&&!(0,l.bf)(oe)?(0,l.DH)(oe):void 0,ue=(0,N.Z)(oe?(0,l.Ti)(oe,"micro"):void 0),me=Boolean(oe&&(0,l.Y5)(oe)),he=(0,a.Ye)((()=>{if(!x)return;const e=(0,r.Rd)().users.byId;return x.map((t=>e[t])).filter(Boolean)}),[x]);(0,a.bt)((()=>{const e=q.current;if(0!==X&&e){if(c===m.Opacity)e.style.opacity="0",(0,E.T2)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(c!==m.Move)return;e.style.transform=`translate3d(0, ${100*-o}%, 0)`,(0,E.T2)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,E.T2)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),200+s.fK)}}),[X,o,c]);const fe=(0,a.I4)((()=>{z({id:t,shouldReplaceHistory:!0}),Y&&K&&H()}),[Y,K,z,t,H]),ve=(0,C.Z)({chat:u,user:f,handleDelete:function(){ne(),J()},handleChatFolderChange:function(){se(),Q()},folderId:n,isPinned:d,isMuted:h,canChangeFolder:V}),pe=(0,v.Z)();if(!u)return;const Ze=(0,P.Z)("Chat chat-item-clickable",(0,l.YC)(t)?"private":"group",Y&&"selected");return a.ZP.createElement(L.Z,{ref:q,className:Ze,style:e,ripple:!i.wB,contextActions:ve,onClick:fe},a.ZP.createElement("div",{className:"status"},a.ZP.createElement(k.Z,{chat:u,user:f,userStatus:p,isSavedMessages:null==f?void 0:f.isSelf,lastSyncTime:j}),u.isCallActive&&u.isCallNotEmpty&&a.ZP.createElement(A,{isSelected:Y,isActive:0!==X})),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,(0,g.Z)((0,l.U)(pe,u,f))),u.isVerified&&a.ZP.createElement(I.Z,null),h&&a.ZP.createElement("i",{className:"icon-muted"}),u.lastMessage&&a.ZP.createElement(S.Z,{message:u.lastMessage,outgoingStatus:D})),a.ZP.createElement("div",{className:"subtitle"},function(){if(ce&&oe&&ce.timestamp>1e3*oe.date)return a.ZP.createElement(T.Z,{typingStatus:ce});if(null!=B&&B.text.length)return a.ZP.createElement("p",{className:"last-message",dir:pe.isRtl?"auto":"ltr"},a.ZP.createElement("span",{className:"draft"},pe("Draft")),(0,g.Z)(B.text));if(!oe)return;if(le){const e=u&&((0,l.eA)(u)||oe.senderId===oe.chatId);return a.ZP.createElement("p",{className:"last-message",dir:pe.isRtl?"auto":"ltr"},(0,Z.D)(pe,oe,e?void 0:$,e?u:void 0,he,R,U))}const e=(0,l.zF)(pe,t,$);return a.ZP.createElement("p",{className:"last-message",dir:pe.isRtl?"auto":"ltr"},e&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"sender-name"},(0,g.Z)(e)),a.ZP.createElement("span",{className:"colon"},":")),function(e,t,n,r){return n?a.ZP.createElement("span",{className:"media-preview"},a.ZP.createElement("img",{src:n,alt:"",className:r?"round":void 0}),(0,l.b7)(t)&&a.ZP.createElement("i",{className:"icon-play"}),(0,w.eK)(e,t,!0)):(0,w.eK)(e,t)}(pe,oe,ue||de,me))}(),a.ZP.createElement(O,{chat:u,isPinned:d,isMuted:h}))),te&&a.ZP.createElement(M.Z,{isOpen:W,onClose:_,onCloseAnimationEnd:ae,chat:u}),re&&a.ZP.createElement(F.Z,{isOpen:G,onClose:ee,onCloseAnimationEnd:ie,chatId:t}))})));var R=n(1713),U=n(231),B=n(7854);const X=(0,a.X$)((0,r.c$)(((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,d.Mw)(e,t):void 0,animatedEmoji:(0,d.zB)(e,"📂")})))((({chatFolder:e,animatedEmoji:t,foldersDispatch:n,onScreenSelect:r})=>{const s=(0,v.Z)(),o=(0,a.I4)((()=>{n({type:"editFolder",payload:e}),r(R.MT.FoldersEditFolderFromChatList)}),[e,n,r]);return a.ZP.createElement("div",{className:"EmptyFolder"},a.ZP.createElement("div",{className:"sticker"},t&&a.ZP.createElement(B.Z,{sticker:t})),a.ZP.createElement("h3",{className:"title",dir:"auto"},s("FilterNoChatsToDisplay")),a.ZP.createElement("p",{className:"description",dir:"auto"},s(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),e&&n&&r&&a.ZP.createElement(U.Z,{ripple:!i.wB,fluid:!0,pill:!0,onClick:o,size:"smaller",isRtl:s.isRtl},a.ZP.createElement("i",{className:"icon-settings"}),s("ChatList.EmptyChatListEditFilter")))})));var Y;!function(e){e.all="active",e.archived="archived"}(Y||(Y={}));const K=(0,a.X$)((0,r.c$)(((e,{folderType:t,folderId:n})=>{const{chats:{listIds:a,byId:r,orderedPinnedIds:s},users:{byId:i},lastSyncTime:o}=e,c="folder"!==t?Y[t]:void 0,l=n?(0,d.Mw)(e,n):void 0;return{allListIds:a,chatsById:r,usersById:i,lastSyncTime:o,notifySettings:(0,d.dZ)(e),notifyExceptions:(0,d.NJ)(e),...c?{listIds:a[c],orderedPinnedIds:s[c]}:{chatFolder:l}}}))((({folderType:e,folderId:t,isActive:n,allListIds:d,chatsById:v,usersById:p,listIds:Z,orderedPinnedIds:g,chatFolder:E,lastSyncTime:P,notifySettings:y,notifyExceptions:C,foldersDispatch:b,onScreenSelect:N})=>{const{loadMoreChats:w,preloadTopChatMessages:k,preloadArchivedChats:I,openChat:T,openNextChat:S}=(0,r.uC)(),[M,L]=(0,a.Ye)((()=>"folder"===e&&E?(0,l.P4)(d,v,p,E,y,C):[Z,g]),[e,E,d,v,p,y,C,Z,g]),[x,$,O]=(0,a.Ye)((()=>{if(!M||"folder"===e&&!E)return[];const t=(0,l.O)(v,M,L,e),n=[].concat(t.pinnedChats,t.otherChats),a=n.map((({id:e})=>e));return[n.reduce(((e,t,n)=>(e[t.id]=n,e)),{}),a,t]}),[M,L,e,E,v]),F=(0,o.Z)(x),A=(0,a.Ye)((()=>x&&F?(0,c.Q8)(x,((e,t)=>void 0!==F[t]?e-F[t]:-1/0)):{}),[x,F]),R=(0,a.I4)((()=>{w({listType:"archived"===e?"archived":"active"})}),[w,e]),[U,B]=(0,u.Z)(P?R:void 0,$,void 0,s.t_,"all"===e&&!s.NM),Y=(0,a.Ye)((()=>{if(U&&O)return(0,l.wG)(O,U)}),[O,U]);(0,a.d4)((()=>{P&&"all"===e&&(k(),I())}),[P,e,k,I]),(0,a.d4)((()=>{if(n&&$)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if(i.fl&&(i.jm&&e.metaKey||!i.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>$.length-1)return;T({id:$[n],shouldReplaceHistory:!0})}if(e.altKey){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(!t)return;e.preventDefault(),S({targetIndexDelta:t,orderedIds:$})}}}),[n,T,S,$]);const K=function(e){return(0,a.Ye)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,a=t.filter((e=>e>0)).length;return t=>{const r=e[t];return 0===r?m.None:r===1/0||r===-1/0||n<=a&&r<0||a<n&&r>0?m.Opacity:m.Move}}),[e])}(A);return a.ZP.createElement(h.Z,{className:"chat-list custom-scroll",items:U,onLoadMore:B,preloadBackwards:s.t_,noFastList:!0,noScrollRestore:!0},null!=U&&U.length&&Y?function(){const e=$.indexOf(U[0]),n=e+Y.pinnedChats.length;return a.ZP.createElement("div",{className:"scroll-container",style:i.wZ?`height: ${$.length*s.rS}px`:void 0,teactFastList:!0},Y.pinnedChats.map((({id:n},r)=>a.ZP.createElement(D,{key:n,teactOrderKey:r,chatId:n,isPinned:!0,folderId:t,animationType:K(n),orderDiff:A[n],style:`top: ${(e+r)*s.rS}px;`}))),Y.otherChats.map(((e,r)=>a.ZP.createElement(D,{key:e.id,teactOrderKey:(0,l.OE)(e),chatId:e.id,folderId:t,animationType:K(e.id),orderDiff:A[e.id],style:`top: ${(n+r)*s.rS}px;`}))))}():U&&!U.length?a.ZP.createElement(X,{folderId:t,folderType:e,foldersDispatch:b,onScreenSelect:N}):a.ZP.createElement(f.Z,{key:"loading"}))})))},91:(e,t,n)=>{n.d(t,{F:()=>r});var a=n(8415);function r(e,t,n,r){const{senderId:s}=t;if(!s)return;const i=(0,a.YC)(s)?r[s]:n[s];let o=(0,a.OU)(e,i);const c=n[t.chatId];return c&&((0,a.YC)(s)&&i.isSelf?o=`${e("FromYou")}${(0,a.U)(e,c)}`:(0,a.Bf)(c)&&(o+=`${(0,a.U)(e,c)}`)),o}},2420:(e,t,n)=>{n.d(t,{t:()=>u,Z:()=>m});var a=n(4050),r=n(1212),s=n(6752),i=n(3989),o=n(7204),c=n(2898),l=n(706);const d=(0,a.X$)((({isQuick:e,onFileSelect:t})=>{const[n,r,i]=(0,l.Z)(),o=(0,s.Z)("DropTarget",n&&"hovered");return a.ZP.createElement("div",{className:o,onDrop:t,onDragEnter:()=>{r()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),i()}},a.ZP.createElement("div",{className:"target-content"},a.ZP.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),a.ZP.createElement("div",{className:"title"},"Drop files here to send them"),a.ZP.createElement("div",{className:"description"},e?"in a quick way":"without compression")))}));let u;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(u||(u={}));const m=(0,a.X$)((({isOpen:e,withQuick:t,onHide:n,onFileSelect:l})=>{const u=(0,a.sO)(null),m=(0,o.Z)(t),{shouldRender:h,transitionClassNames:f}=(0,r.Z)(e);(0,a.d4)((()=>e?(0,i.Z)(n):void 0),[e,n]);const v=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),l(Array.from(t.files),!1))}),[l,n]),p=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),l(Array.from(t.files),!0))}),[l,n]),Z=(0,a.I4)((e=>{e.stopPropagation();const{target:t,relatedTarget:a}=e;t.matches(".DropTarget, .DropArea")&&!a&&(u.current=window.setTimeout((()=>{n()}),150))}),[n]);if(!h)return;const g=(0,s.Z)("DropArea",f);return a.ZP.createElement(c.Z,{containerId:"#middle-column-portals"},a.ZP.createElement("div",{className:g,onDragLeave:Z,onDragOver:()=>{u.current&&window.clearTimeout(u.current)},onDrop:n},a.ZP.createElement(d,{onFileSelect:v}),(t||m)&&a.ZP.createElement(d,{onFileSelect:p,isQuick:!0})))}))},9830:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9203),s=n(8778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,s.Z)(r.gl.Extra,"EmojiTooltip",!t);return n?a.ZP.createElement(n,e):void 0}))},3616:(e,t,n)=>{n.d(t,{Z:()=>C});var a=n(4050),r=n(5116),s=n(3716),i=n(1638),o=n(9118),c=n(5723),l=n(6752),d=n(7361),u=n(517),m=n(2645),h=n(706),f=n(8674),v=n(6389),p=n(9107),Z=n(4784),g=n(6391),E=n(2340),P=n(3283);const y=d.wB?256:416,C=(0,a.X$)((0,r.c$)(((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:a}=e.settings.byKey;return{messageSendKeyCombo:a,replyingToId:t&&n?(0,i.Yy)(e,t,n):void 0,noTabCapture:e.isPollModalOpen||e.payment.isPaymentModalOpen}}))((({id:e,chatId:t,threadId:n,isAttachmentModalInput:i,editableInputId:C,html:b,placeholder:N,forcedPlaceholder:w,canAutoFocus:k,shouldSuppressFocus:I,shouldSuppressTextFormatter:T,replyingToId:S,noTabCapture:M,messageSendKeyCombo:L,onUpdate:x,onSuppressedFocus:$,onSend:O})=>{const{editLastMessage:F,replyToNextMessage:A}=(0,r.uC)(),D=(0,a.sO)(null),R=(0,a.sO)(null),U=(0,p.Z)(),B=(0,a.sO)(!1),[X,Y,K]=(0,h.Z)(),[V,j]=(0,a.eJ)(),[z,H]=(0,a.eJ)(),q=(0,v.Z)(t,n);(0,a.d4)((()=>{i&&Q(!1)}),[i]),(0,m.Z)((([e])=>{b!==D.current.innerHTML&&(D.current.innerHTML=b),b!==R.current.innerHTML&&(R.current.innerHTML=b),void 0!==e&&e!==b&&Q(!b.length)}),[b]),(0,a.sO)(t).current=t;const W=(0,a.I4)((()=>{(0,f.zG)()?setTimeout(W,350):(0,c.Z)(D.current)}),[]),J=(0,a.I4)((()=>{K(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}),[K]);function _(){if(d.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||B.current)return K(),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(T||!(0,g.R)(t,C||s.R2)||!n||(0,Z.Z)(n)||!t.START_TO_END)||(K(),!1)}function G(){if(!_())return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=D.current.getBoundingClientRect();let a=t.left+t.width/2-n.left;a<90?a=90:a>n.width-90&&(a=n.width-90),j({x:a,y:t.top-n.top}),H(e),Y()}function Q(e=!1){const t=D.current,n=R.current,a=Number(t.style.height.replace("px","")),r=Math.min(n.scrollHeight,y);if(r===a)return;const s=Math.round(50*Math.log(Math.abs(r-a))),i=()=>{t.style.height=`${r}px`,t.style.transitionDuration=`${s}ms`,t.classList.toggle("overflown",n.scrollHeight>y)};e?requestAnimationFrame(i):i()}(0,a.d4)((()=>{d.$b||k&&W()}),[t,W,S,k]),(0,a.d4)((()=>{if(M)return;const e=(0,o.Ds)((e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(W))}),2e3,!0,!1);return(0,u.Z)({onTab:e})}),[W,M]),(0,a.d4)((()=>{const e=D.current;function t(){e.blur()}return I&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[I]);const ee=(0,l.Z)("form-control custom-scroll",b.length>0&&"touched",I&&"focus-disabled");return a.ZP.createElement("div",{id:e,onClick:I?$:void 0,dir:U.isRtl?"rtl":void 0},a.ZP.createElement("div",{ref:D,id:C||s.R2,className:ee,contentEditable:!0,dir:"auto",onClick:W,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(x("<br>"===t?"":t),q({type:"typing"}),!d.$b&&(!n||!n.length)&&(d.op||!t.includes("emoji-small"))){const e=window.getSelection();e&&(D.current.blur(),e.removeAllRanges(),(0,c.Z)(D.current,!0))}},onKeyDown:function(e){if(!b.length&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void A({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||b.length||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",(function t(){G(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),F()):d.cj||d.wZ||!("enter"===L&&!e.shiftKey||"ctrl-enter"===L&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),K(),O())},onMouseDown:function(e){2===e.button?!0!==B.current&&(B.current=!0,document.addEventListener("mousedown",(function e(){setTimeout((()=>{B.current=!1}),100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout((()=>{B.current=!1}),100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){G(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:d.wZ?function(e){_()&&(e.preventDefault(),e.stopPropagation())}:void 0,onTouchCancel:d.wZ?G:void 0}),a.ZP.createElement("div",{ref:R,className:(0,l.Z)(ee,"clone"),dir:"auto"}),!w&&a.ZP.createElement("span",{className:"placeholder-text",dir:"auto"},N),a.ZP.createElement(P.Z,{isOpen:X,anchorPosition:V,selectedRange:z,setSelectedRange:H,onClose:J}),w&&a.ZP.createElement("span",{className:"forced-placeholder"},(0,E.Z)(w)))})))},3283:(e,t,n)=>{n.d(t,{Z:()=>Z});var a=n(4050),r=n(6137),s=n(3716),i=n(6752),o=n(1396),c=n(3989),l=n(7529),d=n(1212),u=n(8758),m=n(706),h=n(9107),f=n(231);const v={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace",SPAN:"spoiler"},p=document.createElement("div"),Z=(0,a.X$)((({isOpen:e,anchorPosition:t,selectedRange:n,setSelectedRange:Z,onClose:g})=>{const E=(0,a.sO)(null),P=(0,a.sO)(null),{shouldRender:y,transitionClassNames:C}=(0,d.Z)(e),[b,N,w]=(0,m.Z)(),[k,I]=(0,a.eJ)(""),[T,S]=(0,a.eJ)(!1),[M,L]=(0,a.eJ)(),[x,$]=(0,a.eJ)({});(0,a.d4)((()=>e?(0,c.Z)(g):void 0),[e,g]),(0,u.Z)(e,E,g),(0,a.d4)((()=>{b?P.current.focus():(I(""),S(!1))}),[b]),(0,a.d4)((()=>{y||(w(),$({}),L(void 0))}),[w,y]),(0,a.d4)((()=>{if(!e||!n)return;const t={};let{parentElement:a}=n.commonAncestorContainer;for(;a&&a.id!==s.R2;){const e=v[a.tagName];e&&(t[e]=!0),a=a.parentElement}$(t)}),[e,n,N]);const O=(0,a.I4)((()=>{const e=window.getSelection();e&&Z(e.getRangeAt(0))}),[Z]),F=(0,a.I4)((()=>{if(n)return p.innerText=n.toString(),p.innerHTML}),[n]),A=(0,a.I4)((()=>{if(n)return n.commonAncestorContainer.parentElement}),[n]);function D(){const e=P.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void L(void 0);let r="";a<n-t&&(r="mask-right"),a>0&&(r+=" mask-left"),L(r)}function R(e){if(x[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(x).some((t=>t!==e&&!!x[t])))return"disabled"}else if(x.monospace||x.strikethrough)return"disabled"}const U=(0,a.I4)((()=>{if(x.spoiler){const e=A();if(!n||!e||e.dataset.entityType!==r.Vv.Spoiler||!e.textContent)return;return e.replaceWith(e.textContent),void $((e=>({...e,spoiler:!1})))}const e=F();document.execCommand("insertHTML",!1,`<span class="spoiler" data-entity-type="${r.Vv.Spoiler}">${e}</span>`),g()}),[A,F,g,n,x.spoiler]),B=(0,a.I4)((()=>{$((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!e[t]||document.execCommand(t)})),O(),{...e,bold:!e.bold})))}),[O]),X=(0,a.I4)((()=>{document.execCommand("italic"),O(),$((e=>({...e,italic:!e.italic})))}),[O]),Y=(0,a.I4)((()=>{document.execCommand("underline"),O(),$((e=>({...e,underline:!e.underline})))}),[O]),K=(0,a.I4)((()=>{if(x.strikethrough){const e=A();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void $((e=>({...e,strikethrough:!1})))}const e=F();document.execCommand("insertHTML",!1,`<del>${e}</del>`),g()}),[A,F,g,n,x.strikethrough]),V=(0,a.I4)((()=>{if(x.monospace){const e=A();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void $((e=>({...e,monospace:!1})))}const e=F();document.execCommand("insertHTML",!1,`<code class="text-entity-code" dir="auto">${e}</code>`),g()}),[A,F,g,n,x.monospace]);function j(){const e=encodeURI((0,o.X)(k)||"");if(T){const t=A();if(!t||"A"!==t.tagName)return;return t.href=e,void g()}const t=F();!function(){if(!n)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(n))}(),document.execCommand("insertHTML",!1,`<a href=${e} class="text-entity-link" dir="auto">${t}</a>`),g()}const z=(0,a.I4)((e=>{const t={k:N,b:B,u:Y,i:X,m:V,s:K,p:U}[(0,l.Z)(e)];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}),[N,B,Y,X,V,K,U]);(0,a.d4)((()=>(e&&document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z))),[e,z]);const H=(0,h.Z)();if(!y)return;const q=(0,i.Z)("TextFormatter",C,b&&"link-control-shown"),W=(0,i.Z)("TextFormatter-link-url-confirm",!!k.length&&"shown"),J=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return a.ZP.createElement("div",{ref:E,className:q,style:J,onKeyDown:function(e){"Enter"===e.key&&b&&(j(),e.preventDefault())}},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(f.Z,{color:"translucent",ariaLabel:"Spoiler text",className:R("spoiler"),onClick:U},a.ZP.createElement("i",{className:"icon-eye-closed"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(f.Z,{color:"translucent",ariaLabel:"Bold text",className:R("bold"),onClick:B},a.ZP.createElement("i",{className:"icon-bold"})),a.ZP.createElement(f.Z,{color:"translucent",ariaLabel:"Italic text",className:R("italic"),onClick:X},a.ZP.createElement("i",{className:"icon-italic"})),a.ZP.createElement(f.Z,{color:"translucent",ariaLabel:"Underlined text",className:R("underline"),onClick:Y},a.ZP.createElement("i",{className:"icon-underlined"})),a.ZP.createElement(f.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:R("strikethrough"),onClick:K},a.ZP.createElement("i",{className:"icon-strikethrough"})),a.ZP.createElement(f.Z,{color:"translucent",ariaLabel:"Monospace text",className:R("monospace"),onClick:V},a.ZP.createElement("i",{className:"icon-monospace"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(f.Z,{color:"translucent",ariaLabel:H("TextFormat.AddLinkTitle"),onClick:N},a.ZP.createElement("i",{className:"icon-link"}))),a.ZP.createElement("div",{className:"TextFormatter-link-control"},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(f.Z,{color:"translucent",ariaLabel:H("Cancel"),onClick:w},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement("div",{className:(0,i.Z)("TextFormatter-link-url-input-wrapper",M)},a.ZP.createElement("input",{ref:P,className:"TextFormatter-link-url-input",type:"text",value:k,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){I(e.target.value),D()},onScroll:D})),a.ZP.createElement("div",{className:W},a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(f.Z,{color:"translucent",ariaLabel:H("Save"),className:"color-primary",onClick:j},a.ZP.createElement("i",{className:"icon-check"}))))))}))},2400:(e,t,n)=>{n.d(t,{_:()=>o});const a=/(<br>|<br\s?\/>)/g,r=/(&nbsp;|\u00A0)/g,s=/(<div>|<\/div>)/gi,i=/\n$/i;function o(e){return e.replace(r," ").replace(a,"\n").replace(s,"").replace(i,"")}},6391:(e,t,n)=>{function a(e,t){const{commonAncestorContainer:n}=e;let a=n,r=1;for(;a&&a.id!==t&&r<5;)a=a.parentElement,r++;return Boolean(a&&a.id===t)}n.d(t,{R:()=>a})},8353:(e,t,n)=>{n.d(t,{Z:()=>P});var a=n(4050),r=n(3716),s=n(735),i=n(2400),o=n(4284),c=n(5723),l=n(782),d=n(6580),u=n(706),m=n(2340);let h,f,v,p;const Z=(0,d.Z)((function(e,t,n){return e&&t.length?Object.values((0,l.q0)(e,t)).slice(0,n):s.D})),g=(0,d.Z)((function(e,t,n){const a=Object.values(e),r=(0,l.ee)(a,"native"),s=t?(0,l.Q8)(t,(e=>Object.values((0,l.q0)(r,e)))):{},i=n?(0,l.Q8)(n,(e=>Object.values((0,l.q0)(r,e)))):{},o={...s,...i},c=[].concat(Object.keys(s),Object.keys(i)),d=a.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{});return{byKeyword:o,keywords:c,byName:d,names:Object.keys(d)}})),E=(0,d.Z)((function(e,t,n){const{byKeyword:a,keywords:r,byName:i,names:o}=e;let c=s.D;const d=r.filter((e=>e.startsWith(t))).sort();c=c.concat((0,l.xH)(Object.values((0,l.q0)(a,d))));const u=o.filter((e=>e.startsWith(t)));return c=c.concat((0,l.xH)(Object.values((0,l.q0)(i,u)))),c=(0,l.Tw)(c),c.slice(0,n)}));try{p=new RegExp("(^|\\s):[-+_:\\p{L}\\p{N}]*$","gui")}catch(e){p=new RegExp("(^|\\s):[-+_:\\d\\wа-яё]*$","gi")}function P(e,t,l,d=r.R2,P,y,C,b=!1){const[N,w,k]=(0,u.Z)(),[I,T]=(0,a.eJ)(),[S,M]=(0,a.eJ)(!1),[L,x]=(0,a.eJ)(s.D);(0,a.d4)((()=>{if(b)return;const e=()=>{T(v.emojis)};v?e():async function(){return h||(h=n.e(501).then(n.t.bind(n,7501,19)),f=(await h).default,v=(0,o.NM)(f)),h}().then(e)}),[b]);const $=t.current;(0,a.d4)((()=>{if(!e||!$||!I||b)return void k();const t=$.includes(":")&&function(e){const t=(0,i._)(e).match(p);return t?t[0].trim():void 0}($);if(!t)return x(s.D),void k();const n=t.length>2&&t.endsWith(":"),a=t.substr(1,n?t.length-2:void 0);let r=s.D;if(M(n),a){if(a.length>=2){const e=g(I,y,C);r=E(e,a,36)}}else r=Z(I,l,36);r.length?(n||w(),x(r)):k()}),[I,$,e,w,l,k,M,b,y,C]);const O=(0,a.I4)(((e,n)=>{const a=t.current,r=a.lastIndexOf(":",n?a.lastIndexOf(":")-1:void 0);if(-1!==r){P(`${a.substr(0,r)}${(0,m.Z)(e,["emoji_html"])}`);const t=document.getElementById(d);requestAnimationFrame((()=>{(0,c.Z)(t,!0,!0)}))}k()}),[t,d,P,k]);return(0,a.d4)((()=>{N&&S&&L.length&&O(L[0].native,!0)}),[L,O,N,S]),{isEmojiTooltipOpen:N,closeEmojiTooltip:k,filteredEmojis:L,insertEmoji:O}}},9295:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(5116),s=n(6137),i=n(3716),o=n(8415),c=n(2400),l=n(5723),d=n(706),u=n(782);const m=(0,n(9118).P2)((e=>e()),500,!0);let h;try{h=new RegExp("(^|\\s)@[-_\\p{L}\\p{M}\\p{N}]*$","gui")}catch(e){h=new RegExp("(^|\\s)@[-_\\d\\wа-яё]*$","gi")}function f(e,t,n,f=i.R2,v,p,Z){const[g,E,P]=(0,d.Z)(),[y,C]=(0,a.eJ)(),b=(0,a.I4)(((e,t)=>{const n=(0,r.Rd)().users.byId;(v||p)&&n?m((()=>{const a=null==v?void 0:v.reduce(((e,t)=>(t.userId!==Z&&e.push(t.userId),e)),[]),r=(0,o.kK)((0,u.Tw)([...t&&p||[],...a||[]]),n,e);C(Object.values((0,u.q0)(n,r)))})):C(void 0)}),[Z,v,p]),N=t.current;(0,a.d4)((()=>{if(!e||!N.length)return void P();const t=N.includes("@")&&function(e){const t=(0,c._)(e).match(h);return t?t[0].trim():void 0}(N);if(t){const e=t?t.substr(1):"";b(e,function(e){return e.startsWith("@")}(N))}else P()}),[e,b,E,P,N]),(0,a.d4)((()=>{null!=y&&y.length?E():P()}),[E,P,y]);const w=(0,a.I4)(((e,a=!1)=>{if(!e.username&&!(0,o.Vl)(e))return;const r=e.username?`@${e.username}`:`<a\n class="text-entity-link"\n data-entity-type="${s.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${(0,o.Vl)(e)}</a>`,i=t.current,c=i.lastIndexOf("@");if(-1!==c){n(`${i.substr(0,c)}${r}&nbsp;`);const e=document.getElementById(f);requestAnimationFrame((()=>{(0,l.Z)(e,a)}))}P()}),[t,f,n,P]);return{isMentionTooltipOpen:g,closeMentionTooltip:P,insertMention:w,mentionFilteredUsers:y}}},7891:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9290),s=n(5326);function i(e,t){const n=void 0===t,i=(0,a.sO)(n),o=(0,a.sO)(),c=(0,s.Z)();return(0,r.Z)((()=>{n||(i.current=!1,o.current&&(clearTimeout(o.current),o.current=void 0))}),e),(0,a.d4)((()=>{if(n||i.current)return;const e=()=>{i.current=!0,c()};t>0?o.current=window.setTimeout(e,t):e()}),e),i.current}},1218:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(4605);const s=(0,a.X$)((({id:e,options:t,selected:n=[],disabled:s,round:i,loadingOptions:o,onChange:c})=>{const[l,d]=(0,a.eJ)(n||[]),u=(0,a.I4)((e=>{const{value:t,checked:n}=e.currentTarget;let a;a=n?[...l,t]:l.filter((e=>e!==t)),d(a),c(a)}),[c,l]);return a.ZP.createElement("div",{id:e,className:"radio-group"},t.map((e=>a.ZP.createElement(r.Z,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==n.indexOf(e.value),disabled:s,round:i,isLoading:o?-1!==o.indexOf(e.value):void 0,onChange:u}))))}))},1151:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(6752),s=n(231);const i=({isShown:e,className:t,color:n="primary",ariaLabel:i,disabled:o,onClick:c,children:l})=>{const d=(0,r.Z)("FloatingActionButton",e&&"revealed",t);return a.ZP.createElement(s.Z,{className:d,color:n,round:!0,disabled:o,onClick:e&&!o?c:void 0,ariaLabel:i,tabIndex:-1},l)}},1876:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(7361),s=n(9118),i=n(6752),o=n(7240),c=n(3394),l=n(706),d=n(9107),u=n(8512),m=n(2328),h=n(8964),f=n(231);const v=({ref:e,buttonRef:t,icon:n,secondaryIcon:v,className:p,style:Z,children:g,disabled:E,ripple:P,narrow:y,inactive:C,focus:b,destructive:N,multiline:w,isStatic:k,contextActions:I,onMouseDown:T,onClick:S,onSecondaryIconClick:M})=>{let L=(0,a.sO)(null);e&&(L=e);const[x,$,O]=(0,l.Z)(),{isContextMenuOpen:F,contextMenuPosition:A,handleBeforeContextMenu:D,handleContextMenu:R,handleContextMenuClose:U,handleContextMenuHide:B}=(0,o.Z)(L,!I),X=(0,a.I4)((()=>L.current),[]),Y=(0,a.I4)((()=>L.current.closest(".custom-scroll")),[]),K=(0,a.I4)((()=>L.current.querySelector(".ListItem-context-menu .bubble")),[]),{positionX:V,positionY:j,transformOriginX:z,transformOriginY:H,style:q}=(0,c.Z)(A,X,Y,K),W=(0,a.I4)((e=>{!E&&S&&(S(e),r.$b&&!P&&($(),(0,s.T2)(O)))}),[E,$,S,P,O]),J=(0,a.I4)((e=>{C||r.$b||(!I||2!==e.button&&S||D(e),0===e.button&&(S?W(e):R(e)))}),[C,I,S,D,R,W]),_=(0,d.Z)(),G=(0,i.Z)("ListItem",p,!k&&"no-selection",P&&"has-ripple",y&&"narrow",E&&"disabled",C&&"inactive",A&&"has-menu-open",b&&"focus",N&&"destructive",w&&"multiline",k&&"is-static");return a.ZP.createElement("div",{ref:L,className:G,dir:_.isRtl?"rtl":void 0,style:Z,onMouseDown:T},a.ZP.createElement("div",{className:(0,i.Z)("ListItem-button",x&&"active"),role:"button",ref:t,tabIndex:0,onClick:!C&&r.$b?W:void 0,onMouseDown:J,onContextMenu:!C&&I?R:void 0},n&&a.ZP.createElement("i",{className:`icon-${n}`}),w&&a.ZP.createElement("div",{className:"multiline-item"},g),!w&&g,!E&&!C&&P&&a.ZP.createElement(u.Z,null),v&&a.ZP.createElement(f.Z,{className:"secondary-icon",round:!0,color:"translucent",size:"smaller",onMouseDown:e=>{E||0!==e.button||!M&&!I||(e.stopPropagation(),M?M(e):R(e))}},a.ZP.createElement("i",{className:`icon-${v}`}))),I&&void 0!==A&&a.ZP.createElement(m.Z,{isOpen:F,transformOriginX:z,transformOriginY:H,positionX:V,positionY:j,style:q,className:"ListItem-context-menu",autoClose:!0,onClose:U,onCloseAnimationEnd:B},I.map((e=>a.ZP.createElement(h.Z,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title)))))}},6937:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(3716),s=n(1212),i=n(6752),o=n(3989),c=n(2898);const l=({message:e,duration:t=3e3,containerId:n,onDismiss:l})=>{const[d,u]=(0,a.eJ)(!0),m=(0,a.sO)(null),{transitionClassNames:h}=(0,s.Z)(d),f=(0,a.I4)((()=>{u(!1),setTimeout(l,150+r.fK)}),[l]);(0,a.d4)((()=>d?(0,o.Z)(f):void 0),[d,f]),(0,a.d4)((()=>(m.current=window.setTimeout(f,t),()=>{m.current&&(clearTimeout(m.current),m.current=void 0)})),[t,f]);const v=(0,a.I4)((()=>{m.current&&(clearTimeout(m.current),m.current=void 0)}),[]),p=(0,a.I4)((()=>{m.current=window.setTimeout(f,t)}),[t,f]);return a.ZP.createElement(c.Z,{className:"Notification-container",containerId:n},a.ZP.createElement("div",{className:(0,i.Z)("Notification",h),onClick:f,onMouseEnter:v,onMouseLeave:p},a.ZP.createElement("div",{className:"content"},e)))}},9196:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(6752);const s={s:22,m:25,l:28,xl:20},i=(0,a.X$)((({progress:e=0,size:t="l",square:n,transparent:i,noCross:o,onClick:c})=>{const l=s[t],d=l-4,u=l-1,m=2*d*Math.PI,h=(0,a.sO)(null);(0,a.d4)((()=>{if(!h.current)return;const t=h.current.firstElementChild,n=m-Math.min(Math.max(.05,e),1)*m;t?t.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):h.current.innerHTML=`<svg\n viewBox="0 0 ${2*u} ${2*u}"\n height="${2*u}"\n width="${2*u}"\n >\n <circle\n stroke="white"\n fill="transparent"\n stroke-width=2\n stroke-dasharray="${m} ${m}"}\n stroke-dashoffset="${n}"\n stroke-linecap="round"\n r=${d}\n cx=${u}\n cy=${u}\n />\n </svg>`}),[h,m,u,d,e]);const f=(0,r.Z)(`ProgressSpinner size-${t}`,i&&"transparent",n&&"square",o&&"no-cross");return a.ZP.createElement("div",{ref:h,className:f,onClick:c})}))},4434:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(6752),s=n(9107),i=n(9204);const o=(0,a.X$)((({id:e,label:t,subLabel:n,value:o,name:c,checked:l,disabled:d,hidden:u,isLoading:m,onChange:h})=>{const f=(0,s.Z)(),v=(0,r.Z)("Radio",d&&"disabled",u&&"hidden-widget",m&&"loading");return a.ZP.createElement("label",{className:v,dir:f.isRtl?"rtl":void 0},a.ZP.createElement("input",{type:"radio",name:c,value:o,id:e,checked:l,onChange:h,disabled:d||u}),a.ZP.createElement("div",{className:"Radio-main"},a.ZP.createElement("span",{className:"label",dir:f.isRtl?"auto":void 0},t),n&&a.ZP.createElement("span",{className:"subLabel",dir:f.isRtl?"auto":void 0},n)),m&&a.ZP.createElement(i.Z,null))})),c=(0,a.X$)((({id:e,name:t,options:n,selected:r,disabled:s,loadingOption:i,onChange:c})=>{const l=(0,a.I4)((e=>{const{value:t}=e.currentTarget;c(t)}),[c]);return a.ZP.createElement("div",{id:e,className:"radio-group"},n.map((e=>a.ZP.createElement(o,{name:t,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===r,hidden:e.hidden,disabled:s,isLoading:i?i===e.value:void 0,onChange:l}))))}))},8051:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(6752),s=n(9107);const i=(0,a.X$)((({options:e,min:t=0,max:n=(e?e.length-1:100),step:i=1,label:o,value:c,renderValue:l,disabled:d,onChange:u})=>{const m=(0,s.Z)(),h=(0,a.I4)((e=>{u(Number(e.currentTarget.value))}),[u]),f=(0,r.Z)("RangeSlider",d&&"disabled"),v=(0,a.Ye)((()=>e?c/(e.length-1)*100:(c-t)/((n-t)/i)*100),[e,c,n,t,i]);return a.ZP.createElement("div",{className:f},o&&a.ZP.createElement("div",{className:"slider-top-row",dir:m.isRtl?"rtl":void 0},a.ZP.createElement("span",{className:"label",dir:"auto"},o),!e&&a.ZP.createElement("span",{className:"value",dir:"auto"},l?l(c):c)),a.ZP.createElement("div",{className:"slider-main"},a.ZP.createElement("div",{className:"slider-fill-track",style:`width: ${v}%`}),a.ZP.createElement("input",{min:t,max:n,value:c,step:i,type:"range",onChange:h}),e&&a.ZP.createElement("div",{className:"slider-options"},e.map(((e,t)=>a.ZP.createElement("div",{className:(0,r.Z)("slider-option no-selection",t===c&&"active"),onClick:()=>u(t)},e))))))}))},9589:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(6752),s=n(706),i=n(9107),o=n(2515),c=n(4288),l=n(231),d=n(126);const u=(0,a.X$)((({ref:e,children:t,parentContainerClassName:n,value:u,inputId:m,className:h,focused:f,isLoading:v,spinnerColor:p,spinnerBackgroundColor:Z,placeholder:g,disabled:E,autoComplete:P,canClose:y,autoFocusSearch:C,onChange:b,onReset:N,onFocus:w,onBlur:k,onSpinnerClick:I})=>{let T=(0,a.sO)(null);e&&(T=e);const[S,M,L]=(0,s.Z)(f);(0,o.Z)(T,C,L),(0,a.d4)((()=>{T.current&&(f?T.current.focus():T.current.blur())}),[f,g]);const x=(0,i.Z)(),$=(0,a.I4)((e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${n} .ListItem-button`);e&&e.focus()}}),[n]);return a.ZP.createElement("div",{className:(0,r.Z)("SearchInput",h,S&&"has-focus"),dir:x.isRtl?"rtl":void 0},t,a.ZP.createElement("input",{ref:T,id:m,type:"text",dir:"auto",placeholder:g||x("Search"),className:"form-control",value:u,disabled:E,autoComplete:P,onChange:function(e){const{currentTarget:t}=e;b(t.value)},onFocus:function(){M(),w&&w()},onBlur:function(){L(),k&&k()},onKeyDown:$}),a.ZP.createElement("i",{className:"icon-search"}),a.ZP.createElement(d.Z,{isOpen:Boolean(v),className:"slow"},(()=>a.ZP.createElement(c.Z,{color:p,backgroundColor:Z,onClick:I}))),!v&&(u||y)&&N&&a.ZP.createElement(l.Z,{round:!0,size:"tiny",color:"translucent",onClick:N},a.ZP.createElement("span",{className:"icon-close"})))}))},126:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(1212),s=n(7204),i=n(6752);const o=({isOpen:e,isCustom:t,id:n,className:o,onClick:c,children:l})=>{const{shouldRender:d,transitionClassNames:u}=(0,r.Z)(e,void 0,void 0,!t&&void 0),m=(0,s.Z)(e),h=(0,s.Z)(l),f=(0,a.sO)();return m&&!e&&(f.current=h),d&&a.ZP.createElement("div",{id:n,className:(0,i.Z)(o,u),onClick:c},e?l():f.current())}},3321:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(6752);const s=(0,a.X$)((({id:e,name:t,value:n,label:s,checked:i=!1,disabled:o,inactive:c,noAnimation:l,onChange:d,onCheck:u})=>{const m=(0,a.I4)((e=>{d&&d(e),u&&u(e.currentTarget.checked)}),[d,u]),h=(0,r.Z)("Switcher",o&&"disabled",c&&"inactive",l&&"no-animation");return a.ZP.createElement("label",{className:h,title:s},a.ZP.createElement("input",{type:"checkbox",id:e,name:t,value:n,checked:i,disabled:o,onChange:m}),a.ZP.createElement("span",{className:"widget"}))}))},3133:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(7361),s=n(1367),i=n(7204),o=n(8781),c=n(9107),l=n(6752),d=n(2972),u=n(2340);const m="Tab--active",h=(0,a.X$)((({className:e,title:t,isActive:n,badgeCount:r,isBadgeActive:s,previousActiveTab:i,onClick:o,clickArg:c})=>{const h=(0,a.sO)(null);return(0,a.d4)((()=>{if(n&&void 0===i&&h.current&&h.current.classList.add(m),!n||void 0===i)return;const e=h.current,t=e.parentElement.children[i];if(!t)return;const a=e.querySelector("i"),r=t.querySelector("i"),s=r.parentElement.offsetLeft-a.parentElement.offsetLeft,o=r.clientWidth/a.clientWidth;r.classList.remove("animate"),a.classList.remove("animate"),a.style.transform=`translate3d(${s}px, 0, 0) scale3d(${o}, 1, 1)`,(0,d.Z)(a),a.classList.add("animate"),a.style.transform="none",t.classList.remove(m),e.classList.add(m)}),[n,i]),a.ZP.createElement("div",{className:(0,l.Z)("Tab",e),onClick:()=>o(c),ref:h},a.ZP.createElement("span",null,(0,u.Z)(t),!!r&&a.ZP.createElement("span",{className:(0,l.Z)("badge",s&&"Tab__badge--active")},r),a.ZP.createElement("i",null)))})),f=r.cj?450:r.wZ?400:300,v=(0,a.X$)((({tabs:e,activeTab:t,big:n,onSwitchTab:r})=>{const l=(0,a.sO)(null),d=(0,i.Z)(t);(0,o.Z)(l.current),(0,a.d4)((()=>{const e=l.current,{scrollWidth:n,offsetWidth:a,scrollLeft:r}=e;if(n<=a)return;const i=e.childNodes[t];if(!i)return;const{offsetLeft:o,offsetWidth:c}=i,d=o-a/2+c/2;Math.abs(d-r)<16||(0,s.Z)(e,d,f)}),[t]);const u=(0,c.Z)();return a.ZP.createElement("div",{className:"TabList no-selection no-scrollbar "+(n?"big":""),ref:l,dir:u.isRtl?"rtl":void 0},e.map(((e,n)=>a.ZP.createElement(h,{key:e.title,title:u(e.title),isActive:n===t,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:d,onClick:r,clickArg:n}))))}))},2255:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(5116),s=n(3716),i=n(6752),o=n(2972),c=n(1279),l=n(5326),d=n(7204),u=n(8674);const m=Symbol("CLEANED_UP"),h="Transition__slide--active",f=({ref:e,activeKey:t,name:n,direction:f="auto",renderCount:v,shouldRestoreHeight:p,shouldCleanup:Z,cleanupExceptionKey:g,id:E,className:P,onStart:y,onStop:C,children:b})=>{const{animationLevel:N}=(0,r.Rd)().settings.byKey,w=(0,a.sO)();let k=(0,a.sO)(null);e&&(k=e);const I=(0,a.sO)({}),T=(0,d.Z)(t),S=(0,l.Z)(),M=void 0!==T&&t!==T;!v&&M&&(I.current={[T]:I.current[T]}),I.current[t]=b,(0,a.bt)((()=>{function e(){!Z||void 0!==g&&g===T||(I.current={[T]:m},S())}const a=k.current,r=a.children;if(1===r.length&&!M)return n.startsWith("slide-optimized")&&(r[0].style.transition="none",r[0].style.transform="translate3d(0, 0, 0)"),void r[0].classList.add(h);const i=Array.from(a.childNodes);if(!M||!i.length)return;w.current=t;const l=-1===f||"auto"===f&&T>t||"inverse"===f&&T<t,d=Object.keys(I.current).map(Number),E=v?T:d.indexOf(T),P=v?t:d.indexOf(t);if("slide-optimized"===n||"slide-optimized-rtl"===n)return void function(e,t,n,a,r,i,l,d,m,f,v,p){if(!p||!v)return;if(e===s.oB)return p.style.transition="none",p.style.transform="",p.classList.remove(h),v.style.transition="none",v.style.transform="translate3d(0, 0, 0)",v.classList.add(h),void a();"slide-optimized-rtl"===t&&(n=!n);const Z=(0,u.YW)();requestAnimationFrame((()=>{null==m||m(),p.style.transition="none",p.style.transform="translate3d(0, 0, 0)",v.style.transition="none",v.style.transform=`translate3d(${n?"-":""}100%, 0, 0)`,(0,o.Z)(v),p.style.transition="",p.style.transform=`translate3d(${n?"":"-"}100%, 0, 0)`,v.style.transition="",v.style.transform="translate3d(0, 0, 0)",p.classList.remove(h),v.classList.add(h),(0,c.L)(p,(()=>{r===i.current&&(p.style.transition="none",p.style.transform="",d&&(v.style.height="auto",l.style.height=`${v.clientHeight}px`),null==f||f(),Z(),a())}))}))}(N,n,l,e,t,w,a,p,y,C,i[P],i[E]);if(a.classList.remove("animating"),a.classList.toggle("backwards",l),"none"===n||N===s.oB)return i.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle(h,t===P))})),void e();i.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove(h),e.classList.toggle("from",t===E),e.classList.toggle("through",t>E&&t<P||t<E&&t>P),e.classList.toggle("to",t===P))}));const b=(0,u.YW)();requestAnimationFrame((()=>{var r;function s(){requestAnimationFrame((()=>{if(t===w.current){if(a.classList.remove("animating","backwards"),i.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle(h,t===P))})),p){const e=a.querySelector(`.${h}`);e&&(e.style.height="auto",a.style.height=`${e.clientHeight}px`)}null==C||C(),b(),e()}}))}a.classList.add("animating"),null==y||y();const o="mv-slide"===n?null===(r=i[P])||void 0===r?void 0:r.firstChild:"reveal"===n&&l?i[E]:i[P];o?(0,c.f)(o,s):s()}))}),[t,T,M,f,n,y,C,v,p,Z,g,N,S]),(0,a.bt)((()=>{if(p){const e=k.current,t=e.querySelector(`.${h}`)||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=`${t.clientHeight}px`,e.style.flexBasis=`${t.clientHeight}px`)}}),[p,b]);const L=I.current,x=Object.keys(v?new Array(v).fill(void 0):L).map(Number).map((e=>{const n=L[e];return"function"==typeof n?a.ZP.createElement("div",{key:e,teactOrderKey:e},n(e===t,e===T,t)):void 0}));return a.ZP.createElement("div",{ref:k,id:E,className:(0,i.Z)("Transition",P,n),teactFastList:!v&&!Z},x)}},3455:(e,t,n)=>{n.d(t,{fi:()=>s,Yy:()=>i,vb:()=>l,ZP:()=>h});var a=n(1090),r=n(782);const s=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],i=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],o=["includedChatIds","bots","channels","groups","contacts","nonContacts"],c=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let a=[],s=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:(0,r.ei)(e.folder,o);a=t||[],s=Object.keys(i).filter((e=>Boolean(i[e])))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:(0,r.ei)(e.folder,c);a=t||[],s=Object.keys(i).filter((e=>Boolean(i[e])))}return{selectedChatIds:a,selectedChatTypes:s}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||null!=t&&t.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:"",includedChatIds:[],excludedChatIds:[]}},m=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:t.payload},isTouched:!0};case"editIncludeFilters":return{...e,includeFilters:(0,r.ei)(e.folder,o)};case"editExcludeFilters":return{...e,excludeFilters:(0,r.ei)(e.folder,c)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,r.CE)(e.folder,o),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,r.CE)(e.folder,c),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...a}=t.payload;return{mode:"edit",folderId:e,folder:a,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,error:t.payload};case"reset":return u;default:return e}},h=()=>(0,a.Z)(m,u)},3186:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(5116),s=n(396),i=n(274),o=n(5266),c=n(9290),l=n(4532);const d=(e,t,n,d,u,m,h,f=!1,v,p,Z=!1,g=!1)=>{const E=(0,a.sO)(null),[P,y]=(0,a.eJ)(!1);let C=P;const[b,N]=(0,a.eJ)(0),w=(0,a.I4)((()=>{y(!1),p&&p()}),[p]);(0,c.Z)((()=>{E.current=(0,s.z2)(e,n,((e,a)=>{var s;switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:t,toggleMuted:a,proxy:s}=E.current;y(!0),(0,l.N)(m,function(e){let t={};if(e&&e.current){const{play:n,pause:a,setCurrentTime:s,proxy:i,requestNextTrack:o,requestPreviousTrack:c,isFirst:l,isLast:d}=e.current;t={play:()=>{n(i.src)},pause:()=>{a()},stop:()=>{a(),s(0),(0,r.uC)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(i.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(i.currentTime+t,i.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},d()||(t.nexttrack=()=>{o()}),l()||(t.previoustrack=()=>{c()})}return t}(E)),(0,l.pC)("playing"),e((0,r.Rd)().audioPlayer.volume),a(!!(0,r.Rd)().audioPlayer.isMuted),"voice"===n&&t((0,r.Rd)().audioPlayer.playbackRate),(0,l.NS)({duration:s.duration||0,playbackRate:s.playbackRate,position:s.currentTime});break}case"onRateChange":{const{proxy:e}=E.current;(0,l.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":y(!1),(0,l.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=E.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;g||N(e.currentTime/n);break}case"onEnded":(0,l.pC)("paused")}null==u||null===(s=u[e])||void 0===s||s.call(u,a)}),v,w);const{proxy:a}=E.current;P||a.paused||(y(!0),C=!0),h&&h(a)}),[e]),(0,a.d4)((()=>{P&&m&&(0,l.Ym)(m)}),[m,P]);const{play:k,pause:I,setCurrentTime:T,proxy:S,destroy:M,setVolume:L,stop:x,isFirst:$,isLast:O,requestNextTrack:F,requestPreviousTrack:A,setPlaybackRate:D,toggleMuted:R}=E.current,U=S.duration&&Number.isFinite(S.duration)?S.duration:t;(0,a.d4)((()=>{!U||(0,o.z)(S)||g||N(S.currentTime/U)}),[U,b,S,g]),(0,a.d4)((()=>()=>{M(Z)}),[M,Z]),(0,i.Z)((([e,t])=>{e===f&&d===t||S.src&&S.paused||f&&d&&!P&&k(d)}),[f,d,P,k,S.src,S.paused]);const B=(0,a.I4)((()=>{d&&k(d)}),[d,k]),X=(0,a.I4)((()=>{P?I():B()}),[I,B,P]),Y=(0,a.I4)((e=>{T(e),U&&N(S.currentTime/U)}),[U,S,T]);return{isPlaying:C,playProgress:b,playPause:X,pause:I,play:B,stop:x,setCurrentTime:Y,setVolume:L,audioProxy:S,duration:U,requestNextTrack:F,requestPreviousTrack:A,isFirst:$,isLast:O,setPlaybackRate:D,toggleMuted:R}}},2937:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(6264),s=n(9290),i=n(1394),o=n(5326);const c=new Map;function l(e){const t=(0,a.sO)();let n=!1;(0,s.Z)((()=>{if(n=!0,t.current=void 0,!e)return;const a=new Image;if(a.src=e,!a.width)return;const s=(0,i.ao)(a);(0,r.Z)(s.getContext("2d"),0,0,s.width,s.height,2,2),t.current=s.toDataURL()}),[e]);const l=function(e,t=!1,n){const s=(0,a.sO)(e?c.get(e):void 0),l=(0,a.sO)(),d=(0,o.Z)();return l.current&&t&&(clearTimeout(l.current),l.current=void 0),(0,a.d4)((()=>{if(!e||s.current||t)return;const a=new Image;a.onload=()=>{const t=(0,i.ao)(a);(0,r.Z)(t.getContext("2d"),0,0,t.width,t.height,2,2);const n=t.toDataURL();s.current=n,d(),c.size>=1e3&&c.clear(),c.set(e,n)},n?l.current=window.setTimeout((()=>{a.src=e}),n):a.src=e}),[e,n,d,t]),s.current}(e||void 0,Boolean(t.current));return t.current||!n&&l||e||void 0}},2019:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(9118),s=n(5266);const i=(e=!1)=>{const[t,n]=(0,a.eJ)(!e),[i,o]=(0,a.eJ)(0),c=(0,a.Ye)((()=>(0,r.Ds)(n,200,!1,!0)),[]),l=(0,a.I4)((e=>{const t=e.currentTarget;(0,s.z)(t)||(t.buffered.length&&o(t.buffered.end(0)/t.duration),c(t.readyState>=3||t.currentTime>0))}),[c]);return{isBuffered:t,bufferedProgress:i,bufferingHandlers:{onLoadedData:l,onPlaying:l,onLoadStart:l,onPause:l,onTimeUpdate:l,onProgress:l},checkBuffering(e){c(e.readyState>=3)}}}},5866:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(6264),s=n(5326),i=n(7361);function o(e,t=!1,n){const o=(0,a.sO)(null),c=(0,s.Z)();return(0,a.d4)((()=>{const a=o.current;if(!e||!a||t)return;const s=new Image,c=()=>{a.width=s.width,a.height=s.height;const e=a.getContext("2d",{alpha:!1});i.vX&&(e.filter="blur(2px)"),e.drawImage(s,-4,-4,a.width+8,a.height+8),i.vX||(0,r.Z)(e,0,0,a.width,a.height,2,2)};s.onload=()=>{n?requestAnimationFrame(c):c()},s.src=e}),[o,e,c,t,n]),o}},1470:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(5116),s=n(8415),i=n(782),o=n(9107);const c=({chat:e,user:t,handleDelete:n,handleChatFolderChange:c,folderId:l,isPinned:d,isMuted:u,canChangeFolder:m},h=!1)=>{const f=(0,o.Z)(),{isSelf:v}=t||{};return(0,a.Ye)((()=>{if(!e)return;const{toggleChatPinned:t,updateChatMutedState:a,toggleChatArchived:o,toggleChatUnread:p}=(0,r.uC)(),Z=m?{title:f("ChatList.Filter.AddToFolder"),icon:"folder",handler:c}:void 0,g=d?{title:f("UnpinFromTop"),icon:"unpin",handler:()=>t({id:e.id,folderId:l})}:{title:f("PinToTop"),icon:"pin",handler:()=>t({id:e.id,folderId:l})};if(h)return(0,i.oA)([g,Z]);const E=e.unreadCount||e.hasUnreadMark?{title:f("MarkAsRead"),icon:"readchats",handler:()=>p({id:e.id})}:{title:f("MarkAsUnread"),icon:"unread",handler:()=>p({id:e.id})},P=u?{title:f("ChatList.Unmute"),icon:"unmute",handler:()=>a({chatId:e.id,isMuted:!1})}:{title:f("ChatList.Mute"),icon:"mute",handler:()=>a({chatId:e.id,isMuted:!0})},y=(0,s.pE)(e)?{title:f("Unarchive"),icon:"unarchive",handler:()=>o({id:e.id})}:{title:f("Archive"),icon:"archive",handler:()=>o({id:e.id})},C={title:(0,s.YC)(e.id)?f("Delete"):f((0,s.cc)(e)?"DeleteChat":(0,s.eA)(e)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:n},b=void 0!==l;return(0,i.oA)([Z,E,g,!v&&P,!v&&!b&&y,C])}),[e,m,f,c,d,h,u,n,l,v])}},7240:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(7361);function s(e){e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation()}const i=(e,t,n,i)=>{const[o,c]=(0,a.eJ)(!1),[l,d]=(0,a.eJ)(void 0),u=(0,a.I4)((e=>{t||2!==e.button||e.target.classList.add("no-selection")}),[t]),m=(0,a.I4)((e=>{e.target.classList.remove("no-selection"),t||n&&e.target.matches("a[href]")||(e.preventDefault(),l||(c(!0),d({x:e.clientX,y:e.clientY})))}),[t,n,l]),h=(0,a.I4)((()=>{c(!1)}),[]),f=(0,a.I4)((()=>{d(void 0),document.body.classList.remove("no-selection")}),[]);return(0,a.d4)((()=>{if(t||!r.$b||i)return;const a=e.current;if(!a)return;let o;const u=()=>{o&&(clearTimeout(o),o=void 0)},m=e=>{t||r.wB&&window.document.body.classList.contains("enable-symbol-menu-transforms")||(u(),o=window.setTimeout((()=>(e=>{u();const{clientX:t,clientY:i,target:o}=e.touches[0];l||n&&o.matches("a[href]")||(a.addEventListener("touchend",(function e(t){a.removeEventListener("touchend",e,!0),s(t)}),!0),r.fl&&r.cj&&a.addEventListener("mousedown",(function e(t){a.removeEventListener("mousedown",e,!0),s(t)}),!0),document.body.classList.add("no-selection"),c(!0),d({x:t,y:i}))})(e)),200))};return a.addEventListener("touchstart",m,{passive:!0}),a.addEventListener("touchcancel",u,!0),a.addEventListener("touchend",u,!0),a.addEventListener("touchmove",u,{passive:!0}),()=>{u(),a.removeEventListener("touchstart",m),a.removeEventListener("touchcancel",u,!0),a.removeEventListener("touchend",u,!0),a.removeEventListener("touchmove",u)}}),[l,t,i,e,n]),{isContextMenuOpen:o,contextMenuPosition:l,handleBeforeContextMenu:u,handleContextMenu:m,handleContextMenuClose:h,handleContextMenuHide:f}}},3394:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050);const r={width:0,left:0,height:0,top:0};function s(e,t,n,s,i){const[o,c]=(0,a.eJ)("right"),[l,d]=(0,a.eJ)("bottom"),[u,m]=(0,a.eJ)(),[h,f]=(0,a.eJ)(),[v,p]=(0,a.eJ)(!1),[Z,g]=(0,a.eJ)(""),[E,P]=(0,a.eJ)("opacity: 0;");return(0,a.d4)((()=>{const a=t();if(!e||!a)return;let{x:o,y:l}=e;const u=o,h=l,v=s(),Z=n(),{extraPaddingX:E=0,extraTopPadding:y=0,marginSides:C=0,extraMarginTop:b=0}=(null==i?void 0:i())||{},N=v?parseInt(getComputedStyle(v).marginTop,10)+b:void 0,w=v?{width:v.offsetWidth,height:v.offsetHeight+N}:r,k=Z?Z.getBoundingClientRect():r;let I,T;o+w.width+E<k.width+k.left?(o+=3,I="left"):o-w.width>0?(I="right",o-=3):(I="left",o=16),c(I),C&&"right"===I&&o+E+C>=k.width+k.left&&(o-=C),C&&"left"===I&&(o+E+C+w.width>=k.width+k.left?o-=C:o-C<=0&&(o+=C)),l+w.height<k.height+k.top?T="top":(T="bottom",l-w.height<k.top+y&&(l=k.top+k.height)),d(T);const S=a.getBoundingClientRect(),M="left"===I?Math.min(o-S.left,k.width-w.width-16):Math.max(o-S.left,w.width+16),L=Math.min(k.height-S.top+S.height-12+(N||0),l-S.top),x=k.height-12-(N||0);p(x<w.height),P(`max-height: ${x}px;`),g(`left: ${M}px; top: ${L}px`);const $=u-S.left-M,O=h-S.top-L-(N||0);m("left"===I?$:w.width+$),f("bottom"===T?w.height+O:O)}),[e,s,n,t,i]),{positionX:o,positionY:l,transformOriginX:u,transformOriginY:h,style:Z,menuStyle:E,withScroll:v}}},2202:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9118);function s(e,t,n){return(0,a.Ye)((()=>(0,r.Ds)((e=>e()),e,!t,!n)),[e,t,n])}},5790:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(5116),s=n(9118);const i=(e,t,n,i)=>{const{loadMessage:o}=(0,r.uC)(),c=(0,a.Ye)((()=>{const n=(0,s.P2)(o,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:i})}}),[o,e,t,i]);(0,a.d4)((()=>{t&&!n&&c()}))}},8781:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=(e,t)=>{(0,a.d4)((()=>{if(e&&!t)return e.addEventListener("wheel",n,{passive:!0}),()=>{e.removeEventListener("wheel",n)};function n(t){t.deltaX||(e.scrollLeft+=t.deltaY/4)}}),[e,t])}},2515:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(7361);function s(e,t,n){(0,a.d4)((()=>{t?r.wB||setTimeout((()=>{requestAnimationFrame((()=>{e.current&&e.current.focus()}))}),500):(e.current&&e.current.blur(),n&&setTimeout(n,300))}),[e,t,n])}},3657:(e,t,n)=>{n.d(t,{S1:()=>i,_N:()=>o,Op:()=>c});var a=n(4050),r=n(9118),s=n(8674);function i({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:i,margin:o,threshold:c,isDisabled:l},d){const u=(0,a.sO)(),m=(0,a.sO)(),h=(0,a.sO)(0),f=(0,a.sO)();m.current=d;const v=(0,a.I4)((()=>{h.current++}),[]),p=(0,a.I4)((()=>{h.current&&(h.current--,!h.current&&f.current&&(f.current(),f.current=void 0))}),[]);return(0,s.ZP)(v,p),(0,a.d4)((()=>{if(!l)return()=>{u.current&&(u.current.observer.disconnect(),u.current.callbacks.clear(),u.current=void 0)}}),[l]),{observe:(0,a.I4)(((a,s)=>{u.current||function(){const a=new Map,s=new Map,l=()=>{const e=Array.from(s.values());e.forEach((t=>{const n=a.get(t.target);n&&n(t,e)})),m.current&&m.current(e),s.clear()},d=t?r.P2:n?r.Ds:void 0,v=d?d(l,t||n,!i):l,p=new IntersectionObserver((e=>{e.forEach((e=>{s.set(e.target,e)})),h.current?f.current=()=>{v()}:v()}),{root:e.current,rootMargin:o?`${o}px`:void 0,threshold:c});u.current={observer:p,callbacks:a}}();const l=u.current;return l.observer.observe(a),s&&l.callbacks.set(a,s),()=>{s&&l.callbacks.delete(a),l.observer.unobserve(a)}}),[l]),freeze:v,unfreeze:p}}function o(e,t,n){(0,a.d4)((()=>t?t(e.current,n):void 0),[])}function c(e,t,n){const[r,s]=(0,a.eJ)(!t);return o(e,t,(e=>{s(e.isIntersecting),n&&n(e)})),r}},2357:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=function(e,t,n=!1){const r=(0,a.sO)(e);(0,a.bt)((()=>{r.current=e}),[e]),(0,a.d4)((()=>{if(void 0===t)return;const e=setInterval((()=>r.current()),t);return n||r.current(),()=>clearInterval(e)}),[t,n])}},2645:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(7204);const s=(e,t,n)=>{const s=(0,r.Z)(t);return(0,a.bt)((()=>e(s||[])),t,n)}},692:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(1212);function r(e){const t=Boolean(e),{transitionClassNames:n}=(0,a.Z)(t,void 0,t,"slow");return n}},2566:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(4050),r=n(7361),s=n(6137),i=n(9118),o=n(647),c=n(5326),l=n(6926);const d={};function u(e,t=!1,n=s.IU.BlobUrl,u,m,h=!1){const f=e?o.UV(e):void 0,v=n===s.IU.Stream||r.I_&&n===s.IU.Progressive,p=(0,c.Z)(),Z=(()=>{const e=(0,a.sO)();return e.current||(e.current=(0,l.Z)(d),d[e.current]=!0),e.current})(),[g,E]=(0,a.eJ)(f&&!v?1:0),P=(0,a.sO)(),y=(0,a.Ye)((()=>(0,i.P2)((e=>{P.current&&(!m||Date.now()-P.current>m)&&E(e)}),500,!0)),[m]);return(0,a.d4)((()=>{!t&&e&&(f?v&&setTimeout((()=>{E(.75)}),1500):(E(0),P.current&&o.cC(y),P.current=Date.now(),o.he(e,n,h,y,Z).then((()=>{const e=Date.now()-P.current;P.current=void 0,!m||e>=m?p():setTimeout(p,m-e)}))))}),[t,e,f,n,u,p,v,m,y,h,Z]),(0,a.d4)((()=>{t&&P.current&&(o.cC(y),E(0),P.current=void 0)}),[y,t]),(0,a.d4)((()=>()=>{e&&o.Iq(e,Z)}),[Z,e]),{mediaData:f,loadProgress:g}}},6503:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(4050),r=n(7361);let s;function i(e,t,n=250,i=!1){const o=(0,a.sO)(!1),c=(0,a.I4)((()=>{o.current=!0}),[]);return(0,a.d4)((()=>{s&&(clearTimeout(s),s=void 0),!e||r.$b||i||(s=window.setTimeout((()=>{o.current||t()}),2*n))}),[i,e,n,t]),[(0,a.I4)((()=>{o.current=!0}),[]),(0,a.I4)((()=>{o.current=!1,s&&(clearTimeout(s),s=void 0),s=window.setTimeout((()=>{o.current||t()}),n)}),[n,t]),c]}},2678:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(7204),s=n(5326),i=n(9290);function o(e,t){const n=(0,r.Z)(e,!0),o=(0,a.sO)(),c=(0,s.Z)(),l=null!=e,d=null!=n;return l&&o.current&&(clearTimeout(o.current),o.current=void 0),(0,i.Z)((()=>{t&&!l&&d&&!o.current&&(o.current=window.setTimeout((()=>{o.current=void 0,c()}),t))}),[e]),o.current&&t&&!l?n:e}},1090:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);function r(e,t){const n=(0,a.sO)(e),[r,s]=(0,a.eJ)(t);return[r,(0,a.I4)((e=>{s((t=>n.current(t,e)))}),[])]}},6389:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(4050),r=n(5116),s=n(3716),i=n(9118);const o=(e,t)=>(0,a.Ye)((()=>(0,i.P2)((n=>{(0,r.uC)().sendMessageAction({chatId:e,threadId:t,action:n})}),s.o_)),[e,t])},971:(e,t,n)=>{n.d(t,{Y:()=>s});var a=n(4050),r=n(9290);function s(e){const t=(0,a.sO)(e);return(0,r.Z)((()=>{t.current=e}),[e]),t}},6898:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(4050),r=n(9118);function s(e,t){(0,a.d4)((()=>{const t=e.current;return()=>{t&&(0,r.T2)((()=>{t.pause(),t.src="",t.load()}))}}),t)}},6264:(e,t,n)=>{n.d(t,{Z:()=>s});const a=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],r=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];function s(e,t,n,s,i,o,c){if(Number.isNaN(o)||o<1)return;o|=0,Number.isNaN(c)&&(c=1),(c|=0)>3&&(c=3),c<1&&(c=1);const l=e.getImageData(t,n,s,i),d=l.data;let u,m,h,f,v,p,Z,g,E,P,y,C,b=s-1,N=i-1,w=o+1,k=[],I=[],T=[],S=a[o],M=r[o],L=[],x=[];for(;c-- >0;){for(C=y=0,v=0;v<i;v++){for(u=d[C]*w,m=d[C+1]*w,h=d[C+2]*w,p=1;p<=o;p++)Z=C+((p>b?b:p)<<2),u+=d[Z++],m+=d[Z++],h+=d[Z++];for(f=0;f<s;f++)k[y]=u,I[y]=m,T[y]=h,0==v&&(L[f]=((Z=f+w)<b?Z:b)<<2,x[f]=(Z=f-o)>0?Z<<2:0),g=C+L[f],E=C+x[f],u+=d[g++]-d[E++],m+=d[g++]-d[E++],h+=d[g++]-d[E++],y++;C+=s<<2}for(f=0;f<s;f++){for(P=f,u=k[P]*w,m=I[P]*w,h=T[P]*w,p=1;p<=o;p++)P+=p>N?0:s,u+=k[P],m+=I[P],h+=T[P];for(y=f<<2,v=0;v<i;v++)d[y]=u*S>>>M,d[y+1]=m*S>>>M,d[y+2]=h*S>>>M,0==f&&(L[v]=((Z=v+w)<N?Z:N)*s,x[v]=(Z=v-o)>0?Z*s:0),g=f+L[v],E=f+x[v],u+=k[g]-k[E],m+=I[g]-I[E],h+=T[g]-T[E],y+=s<<2}}e.putImageData(l,t,n)}},396:(e,t,n)=>{n.d(t,{Es:()=>p,z2:()=>Z,An:()=>E});var a=n(5116),r=n(1713),s=n(7361),i=n(4753),o=n(5266),c=n(8415),l=n(9118),d=n(1638);const u=new Map;let m,h=[],f=[];function v(e,t){const n=m&&u.get(m);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const s=g(e,(0,a.Rd)().audioPlayer.origin||r.Cr.Inline,t);if(!s)return;if(!u.has(s))return void(0,a.uC)().openAudioPlayer((0,c.Ak)(P(s).messageKey));const o=u.get(s);o.onForcePlay&&o.onForcePlay(),m=s,o.audio.src&&(0,i.Z)(o.audio)}function p(){const e=m&&u.get(m);e&&e.audio.pause()}function Z(e,t,n,p,Z){if(!u.has(e)){const n=function(e,t,n,a){const r=new Audio;function s(t){return n=>{u.has(e)&&((0,o.z)(r)||u.get(e).handlers.forEach((e=>{e(t,n)})))}}return r.addEventListener("timeupdate",s("onTimeUpdate")),r.addEventListener("play",s("onPlay")),r.addEventListener("pause",s("onPause")),r.addEventListener("loadstart",s("onLoadStart")),r.addEventListener("loadeddata",s("onLoadedData")),r.addEventListener("playing",s("onPlaying")),r.addEventListener("ended",(()=>{u.has(e)&&((0,o.z)(r)||v(e))})),{audio:r,type:t,proxy:new Proxy(r,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:a}}(e,t,p,Z);u.set(e,n),function(e,t){"audio"!==e.type||f.includes(t)||(f.push(t),f.sort(y)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(y))}(n,e)}const{audio:E,proxy:C,handlers:b}=u.get(e);return b.push(n),{play(n){if(!E.paused)return;const l=m&&u.get(m);l&&m!==e&&(l.audio.pause(),l.audio.currentTime=0,(0,o.z)(l.audio)&&(l.audio.dataset.preventPlayAfterPatch="true"),l.onTrackChange&&l.onTrackChange()),m=e,E.src||(E.src=n,E.preload="auto",n.includes("/progressive/")&&s.s$&&(delete E.dataset.preventPlayAfterPatch,(0,o.B)(E))),(0,i.Z)(E),function(e,t){var n;if((0,a.Rd)().globalSearch.currentContent===r.nJ.Music)return;const{chatId:s}=(0,c.Ak)(P(t).messageKey),i=null===(n=(0,d.Bt)((0,a.Rd)()))||void 0===n?void 0:n.chatId,o=e=>e.startsWith(`msg${s}`)||i&&e.startsWith(`msg${i}`);"audio"===e&&(f=f.filter(o)),"voice"===e&&(h=h.filter(o))}(t,e)},pause(){m===e&&E.pause()},stop(){if(m===e){const e=E.src;E.pause(),(0,l.T2)((()=>{E.src="",E.src=e}))}},setCurrentTime(t){m===e&&(E.fastSeek?E.fastSeek(t):E.currentTime=t)},setVolume(t){m===e&&(E.volume=t,E.muted=!1)},setPlaybackRate(t){m===e&&(E.playbackRate=t)},toggleMuted(e){E.muted=void 0===e?!E.muted:e},proxy:C,requestNextTrack(){v(e)},isLast:()=>!g(e,(0,a.Rd)().audioPlayer.origin),isFirst:()=>!g(e,(0,a.Rd)().audioPlayer.origin,!0),requestPreviousTrack(){v(e,!0)},destroy(t=!1){const a=u.get(e);a&&(a.handlers=a.handlers.filter((e=>e!==n)),a.handlers.length||(a.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(f=f.filter(n)),"voice"===e.type&&(h=h.filter(n))}(a,e),e===m&&(m=void 0)))}}}function g(e,t=r.Cr.Inline,n){const a=function(e){switch(e.type){case"audio":return f;case"voice":return h;default:return}}(u.get(e));if(!a)return;if(t===r.Cr.Search){const t=a.indexOf(e);if(t<0)return;return a[t+(n?-1:1)]}const{chatId:s}=(0,c.Ak)(P(e).messageKey),i=a.filter((e=>e.startsWith(`msg${s}`))),o=i.indexOf(e);if(o<0)return;let l=t===r.Cr.Inline?-1:1;return n&&(l*=-1),i[o+l]}function E(e){return`${(0,c.Tp)(e)}-${e.date}`}function P(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function y(e,t){if(!e||!t)return 0;const{date:n,messageKey:a}=P(e),{date:r,messageKey:s}=P(t),i=r-n;return 0===i?s.localeCompare(a):i}},1174:(e,t,n)=>{n.d(t,{eM:()=>r,vJ:()=>s,sf:()=>l});var a=n(7361);let r;!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(r||(r={}));const s=20;function i(e,t){return t?Math.sqrt((t.pageX-e.pageX)**2+(t.pageY-e.pageY)**2):0}function o(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}let c=0;function l(e,t){let n,l,d=!1,u=!1,m=0,h={x:window.innerWidth/2,y:window.innerHeight/2};function f(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(n=e,"mousedown"===e.type)document.addEventListener("mousemove",p),document.addEventListener("mouseup",v);else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",p,{passive:!0}),t.addEventListener("touchend",v),t.addEventListener("touchcancel",v),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),2===e.touches.length&&(m=i(e.touches[0],e.touches[1]),h=o(e.touches[0],e.touches[1])))}document.body.classList.add("no-selection"),t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function v(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",v),document.removeEventListener("mousemove",p),n.target.removeEventListener("touchcancel",v),n.target.removeEventListener("touchend",v),n.target.removeEventListener("touchmove",p),a.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),d?t.onRelease&&t.onRelease(e):"mouseup"===e.type&&(t.onDoubleClick&&Date.now()-c<300?t.onDoubleClick(e,{centerX:n.pageX,centerY:n.pageY}):!t.onClick||"button"in e&&0!==e.button||t.onClick(e),c=Date.now())),d=!1,u=!1,m=0,l=void 0,h={x:window.innerWidth/2,y:window.innerHeight/2},n=void 0}function p(e){if(n){if("touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),t.onZoom&&m>0&&2===e.touches.length)){const n=i(e.touches[0],e.touches[1]),a=o(e.touches[0],e.touches[1]),r=a.x-h.x,s=a.y-h.y,c=n/m;t.onZoom(e,{zoomFactor:c,initialCenterX:h.x,initialCenterY:h.y,dragOffsetX:r,dragOffsetY:s,currentCenterX:a.x,currentCenterY:a.y}),1!==c&&(d=!0)}const c=e.pageX-n.pageX,f=e.pageY-n.pageY;(Math.abs(c)>=15||Math.abs(f)>=15)&&(d=!0);let v=!1;t.onDrag&&(t.onDrag(e,n,{dragOffsetX:c,dragOffsetY:f}),v=!0),t.onSwipe&&!u&&(u=function(e,n,i){if(a.cj){const t=e.touches[0].pageX;if(t<=s||t>=window.innerWidth-s)return!1}const o=Math.abs(n),c=Math.abs(i);if(n&&i&&Math.max(o,c)/Math.min(o,c)<2)return!1;let d;if(o>=50?d="x":c>=50&&(d="y"),!d)return!1;if(l){if(l!==d)return!1}else l=d;return function(e,t,n,a,s){return"x"===t?s(e,n<0?r.Left:r.Right):"y"===t&&s(e,a<0?r.Up:r.Down)}(e,d,n,i,t.onSwipe)}(e,c,f),v=u),a.cj&&v&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}return e.addEventListener("mousedown",f),e.addEventListener("touchstart",f,{passive:!t.isNotPassive}),()=>{e.removeEventListener("mousedown",f),e.removeEventListener("touchstart",f)}}},1279:(e,t,n)=>{function a(e,t,n){s("transitionend",e,t,n)}function r(e,t,n){s("animationend",e,t,n)}function s(e,t,n,a){let r=!1;t.addEventListener(e,(function s(i){r||i.target!==i.currentTarget||a&&(i instanceof TransitionEvent&&i.propertyName===a||i instanceof AnimationEvent&&i.animationName===a)||(r=!0,t.removeEventListener(e,s),setTimeout((()=>{n()}),50))}))}n.d(t,{L:()=>a,f:()=>r})},3570:(e,t,n)=>{function a(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>a})},539:(e,t,n)=>{n.d(t,{Z:()=>u,N:()=>m});var a=n(5116),r=n(1713),s=n(3716),i=n(7361),o=n(8674),c=n(9933),l=n(9118);let d=!1;function u(e,t,n,i=0,o=s.V$,c,l,d){const u=function(e,t,n=s.V$,a){const{offsetTop:i}=t,{scrollTop:o}=e;if(void 0===a){const t=i-e.scrollTop;if(t<-n)return o+(t+n);if(t>n)return o+(t-n)}else{if(a===r.fo.Up)return i+n;if(a===r.fo.Down)return Math.max(0,i-n)}return o}(e,t,o,c);c!==r.fo.Static?((0,a.Rd)().settings.byKey.animationLevel===s.oB&&(l=0),h(e,t,u,n,i,l,d)):h(e,t,u,n,i,0)}function m(){return d}function h(e,t,n,a,r=0,u,m){const{offsetTop:h,offsetHeight:p}=t,{scrollTop:Z,offsetHeight:g,scrollHeight:E}=e,P=m&&e.dataset.normalHeight?Number(e.dataset.normalHeight):g;let y;switch(Z!==n&&(e.scrollTop=n),a){case"start":y=h-r-n+(i.wZ?1:0);break;case"end":y=h+p+r-(n+P);break;case"nearest":case"center":case"centerOrTop":y=p<P?h+p/2-(n+P/2):h-r-n}if(y<0){const e=-n;y=Math.max(y,e)}else if(y>0){const e=E-(n+P);y=Math.min(y,e)}if(0===y)return;const C=n+y;if(0===u)return void(e.scrollTop=C);d=!0;const b=Math.abs(y),N=b<s.xn?v:f,w=u||s.bK+b/s.V$*(s.ck-s.bK),k=Date.now(),I=(0,o.YW)();(0,l.T2)((()=>{(0,c.cK)((()=>{const t=Math.min((Date.now()-k)/w,1),n=y*(1-N(t));return e.scrollTop=Math.round(C-n),d=t<1,d||I(),d}))}))}function f(e){return 1-(1-e)**5}function v(e){return 1-(1-e)**3.5}},1367:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(5116),r=n(3716),s=n(9933),i=n(9118);function o(e,t,n=300){(0,a.Rd)().settings.byKey.animationLevel===r.oB&&(n=0),function(e,t,n){const a="rtl"===e.getAttribute("dir"),{scrollLeft:r,offsetWidth:o,scrollWidth:c}=e;let l=t-r;if(l<0){const e=-r*(a?-1:1);l=Math.max(l,e)}else if(l>0){const e=c-(r+o);l=Math.min(l,e)}if(0===l)return;const d=r+l;if(0===n)return void(e.scrollLeft=d);const u=Date.now();(0,i.T2)((()=>{(0,s.jt)((()=>{const t=Math.min((Date.now()-u)/n,1),a=l*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(d-a),t<1}))}))}(e,t,n)}},5723:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(7361);function r(e,t,n){if(!t&&e===document.activeElement)return;const r=window.getSelection(),s=document.createRange(),i=e.lastChild||e;a.$b||n||i&&i.nodeValue?(s.selectNodeContents(n?e:i),s.collapse(!1),r.removeAllRanges(),r.addRange(s)):e.focus()}},7529:(e,t,n)=>{function a(e){const t="key"in e?e.key:e.code;return t.startsWith("Key")?t.slice(3).toLowerCase():t}n.d(t,{Z:()=>a})},4532:(e,t,n)=>{n.d(t,{N:()=>r,Ym:()=>s,Ay:()=>o,pC:()=>c,NS:()=>l,Of:()=>d});const a={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function r(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&i(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=null!=e?e:null)}function i(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...a,...e}).forEach((([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}}))}function o(){const{mediaSession:e}=window.navigator;var t;e&&(e.metadata=null,i(a),e.playbackState&&(e.playbackState="none"),null===(t=e.setPositionState)||void 0===t||t.call(e))}function c(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function l(e){var t;if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:n}=window.navigator;null==n||null===(t=n.setPositionState)||void 0===t||t.call(n,e)}function d({title:e,artist:t,album:n,artwork:a}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:a})}},3099:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(6137),r=n(7361);const s={B:a.Vv.Bold,STRONG:a.Vv.Bold,I:a.Vv.Italic,EM:a.Vv.Italic,U:a.Vv.Underline,S:a.Vv.Strike,STRIKE:a.Vv.Strike,DEL:a.Vv.Strike,CODE:a.Vv.Code,PRE:a.Vv.Pre,BLOCKQUOTE:a.Vv.Blockquote};function i(e){const t=document.createElement("div");t.innerHTML=function(e){let t=e.slice(0);return r.op||(t=t.replace(/<img[^>]+alt="([^"]+)"[^>]*>/gm,"$1")),t=t.replace(/&nbsp;/g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*[\n\r][^]*?^)`{3}/gm,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/[`]{1}([^`\n]+)[`]{1}/g,"<code>$1</code>"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<b>$2</b>$3"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<i>$2</i>$3"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<s>$2</s>$3"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[|]{2}([^|\n]+)[|]{2}(?![^<]*<\/code>)(\s|$)/g,`$1<span data-entity-type="${a.Vv.Spoiler}">$2</span>$3`),t}(e);const n=t.innerText.trim().replace(/\u200b+/g,"");let i=0,o=0;const c=[];function l(e){const{index:t,entity:r}=function(e,t,n){const r=function(e){if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.Vv.MentionName?a.Vv.MentionName:t.dataset.entityType===a.Vv.Url?a.Vv.Url:t.href.startsWith("mailto:")?a.Vv.Email:t.href.startsWith("tel:")?a.Vv.Phone:t.href!==t.textContent?a.Vv.TextUrl:a.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:void 0}(e);if(!r||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),o=i>=0?i:n,c=t.substring(0,o).length,{length:l}=t.substring(o,o+e.textContent.length);let d,u;return r===a.Vv.TextUrl&&(d=e.href),r===a.Vv.MentionName&&(u=e.dataset.userId),{index:o,entity:{type:r,offset:c,length:l,...d&&{url:d},...u&&{userId:u}}}}(e,n,i);r?(i=t,c.push(r)):e.textContent&&(i+=e.textContent.length),e.hasChildNodes()&&o<=3&&(o+=1,Array.from(e.childNodes).forEach(l))}return Array.from(t.childNodes).forEach((e=>{o=1,l(e)})),{text:n,entities:c.length?c:void 0}}},5266:(e,t,n)=>{function a(e){e.dataset.patchedForSafari||(e.addEventListener("play",(()=>{const t=e.currentTime;e.dataset.patchForSafariInProgress="true",e.addEventListener("progress",(function n(){e.buffered.length&&(e.currentTime=e.duration-1,e.addEventListener("progress",(()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&!e.dataset.preventPlayAfterPatch&&e.play()}),{once:!0}),e.removeEventListener("progress",n))}))}),{once:!0}),e.dataset.patchedForSafari="true")}function r(e){return Boolean(e.dataset.patchForSafariInProgress)}n.d(t,{B:()=>a,z:()=>r})},3227:(e,t,n)=>{n.d(t,{Z:()=>a});const a=e=>{e.stopPropagation(),e.preventDefault()}}}]);
//# sourceMappingURL=409.8ade632d34e500adc543.js.map