mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-15 10:47:04 +01:00
2 lines
109 KiB
JavaScript
2 lines
109 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[519],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(6137),s=n(4399),i=n(3657),o=n(6202),l=n(692),c=n(706),d=n(7799);const u={large:160,medium:128,small:104},m=({sticker:e,size:t="medium",observeIntersection:n,lastSyncTime:m,forceLoadPreview:h})=>{var f;const v=(0,a.sO)(null),[p,g]=(0,c.Z)(),Z=`sticker${e.id}`,E=(0,i.Op)(v,n),P=null===(f=e.thumbnail)||void 0===f?void 0:f.dataUri,y=(0,o.Z)(`${Z}?size=m`,!E&&!h,r.IU.BlobUrl,m),C=(0,l.Z)(y),b=(0,o.Z)(Z,!E,r.IU.Lottie,m),N=Boolean(b),[w,k]=(0,a.eJ)(String(Math.random())),I=(0,a.I4)((()=>{k(String(Math.random()))}),[]),T=u[t],M=`width: ${T}px; height: ${T}px;`;return a.ZP.createElement("div",{ref:v,className:"AnimatedEmoji media-inner",style:M,onClick:I},!p&&P&&a.ZP.createElement("img",{src:P,className:e.id===s.wB?"like-sticker-thumb":void 0,alt:""}),!p&&y&&a.ZP.createElement("img",{src:y,className:C,alt:""}),N&&a.ZP.createElement(d.Z,{key:Z,id:Z,animationData:b,size:T,quality:1,play:E&&w,noLoop:!0,onLoad:g}))}},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),l=n(790),c=n(2858),d=n(6752),u=n(2340),m=n(5376),h=n(2566),f=n(1212),v=n(2019),p=n(3186),g=n(9107),Z=n(1174),E=n(6202),P=n(396),y=n(663),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:M,date:S,lastSyncTime:x,className:L,isSelectable:$,isSelected:F,isDownloading:A,onPlay:O,onReadMedia:R,onCancelUpload:D,onDateClick:U})=>{const{content:{audio:B,voice:V,video:X},isMediaUnread:K}=t,z=Boolean(V||X),Y=(0,a.sO)(!1),j=(0,a.sO)(!1),H=(0,a.sO)(null),q=(0,g.Z)(),{isRtl:W}=q,J=(0,r.uC)(),[_,G]=(0,a.eJ)(!1),Q=x,ee=(0,c.Ti)(t,"pictogram"),te=(0,E.Z)(ee,!1,s.IU.BlobUrl),ne=(0,E.Z)((0,c.Ti)(t,"inline"),!Q,(0,c.kG)(t,"inline")),{loadProgress:ae}=(0,h.Z)((0,c.Ti)(t,"download"),!A),re=(0,a.I4)((()=>{G(!0),O(t.id,t.chatId)}),[t,O]),se=(0,a.I4)((()=>{G(!1)}),[]),{isBuffered:ie,bufferedProgress:oe,bufferingHandlers:le,checkBuffering:ce}=(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,c.XV)(t),z?"voice":"audio",ne,le,void 0,ce,_,re,se,(0,c.CI)(t)),ge=(0,c.B4)(t),Ze=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,l,c;const t=Math.floor(d*r),u=((null!==(o=e[t-1])&&void 0!==o?o:s)+(null!==(l=e[t])&&void 0!==l?l:s)+(null!==(c=e[t+1])&&void 0!==c?c: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 l=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,l,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,V,K&&!ge?1:ue,ge),Ee=de||ue>0&&ue<1;(0,a.d4)((()=>{G(de)}),[de]);const Pe=_&&!ie,{isUploading:ye,isTransferring:Ce,transferProgress:be}=(0,c.Sc)(t,T||ae,Pe||A),{shouldRender:Ne,transitionClassNames:we}=(0,f.Z)(Ce),ke=Ne&&(Pe||ye),Ie=(0,a.I4)((()=>{ye?null==D||D():(de||O(t.id,t.chatId),(0,r.uC)().setAudioPlayerOrigin({origin:M}),G(!_),me())}),[ye,de,_,me,D,O,t.id,t.chatId,M]);(0,a.d4)((()=>{R&&K&&(de||A)&&R()}),[de,K,R,A]);const Te=(0,a.I4)((()=>{A?J.cancelMessageMediaDownload({message:t}):J.downloadMessageMedia({message:t})}),[J,A,t]),Me=(0,a.I4)((e=>{if(Y.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]),Se=(0,a.I4)((e=>{e instanceof MouseEvent&&2===e.button||(Y.current=!0,j.current=de,fe(),Me(e))}),[Me,fe,de]),xe=(0,a.I4)((()=>{Y.current=!1,j.current&&he()}),[he]),Le=(0,a.I4)((()=>{U(t.id,t.chatId)}),[U,t.id,t.chatId]);function $e(){if(z)return n||"Voice";const{title:e,fileName:t}=B;return e||t}(0,a.d4)((()=>{if(H.current&&Ee)return(0,Z.s)(H.current,{onCapture:Se,onRelease:xe,onClick:xe,onDrag:Me})}),[Ee,Se,Me,xe]);const Fe=(0,d.Z)("Audio",L,ge&&M===i.Cr.Inline&&"own",(M===i.Cr.Search||M===i.Cr.SharedMedia)&&"bigger",F&&"audio-is-selected"),Ae=["toggle-play"];ke?Ae.push("loading"):de?Ae.push("pause"):de||Ae.push("play");const Oe=(0,d.Z)("content",Ee&&"with-seekline");function Re(){return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:Oe},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"},S&&a.ZP.createElement(N.Z,{className:"date",onClick:Le},(0,l.VX)(q,1e3*S)))),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,l.k9)(pe*ue,pe)}`),I(ue,oe,H)),!Ee&&function(){if(z)return a.ZP.createElement("div",{className:"meta",dir:W?"rtl":void 0},(0,l.k9)((V||X).duration));const{performer:e}=B;return a.ZP.createElement("div",{className:"meta",dir:W?"rtl":void 0},(0,l.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:Fe,dir:q.isRtl?"rtl":"ltr"},$&&a.ZP.createElement("div",{className:"message-select-control"},F&&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:Ae.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:A?"Cancel download":"Download",onClick:Te},a.ZP.createElement("i",{className:A?"icon-close":"icon-arrow-down"})),M===i.Cr.Search&&Re(),M!==i.Cr.Search&&B&&function(e,t,n,r,s,i,o,c,d,h,f){const{title:v,performer:p,fileName:g}=t,Z=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||g)),Z&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,l.k9)(n*s,n)),I(s,i,o)),!Z&&c&&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)),!Z&&!c&&a.ZP.createElement("div",{className:"meta",dir:E?"rtl":void 0},a.ZP.createElement("span",{className:"duration",dir:"auto"},(0,l.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,l.ZK)(e,1e3*d,!0)))))}(q,B,pe,de,ue,oe,H,A||ye,S,be,U?Le:void 0),M===i.Cr.SharedMedia&&(V||X)&&Re(),M===i.Cr.Inline&&V&&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,l.k9)(e.duration):(0,l.k9)(e.duration*r)))}(V,H,Ze,ue,K))}))},180:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(2340),l=n(782),c=n(4319),d=n(6272),u=n(9107),m=n(1876),h=n(3321);const f=(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,l=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:l}}),((e,t)=>(0,l.ei)(t,["loadFullUser","updateChatMutedState","showNotification"])))((({lastSyncTime:e,user:t,chat:n,forceShowSelf:r,canInviteUsers:s,isMuted:l,phoneCodeList:f,loadFullUser:v,showNotification:p,updateChatMutedState:g})=>{const{id:Z,fullInfo:E,username:P,phoneNumber:y,isSelf:C}=t||{},{id:b}=n||{},N=(0,u.Z)();(0,a.d4)((()=>{e&&Z&&v({userId:Z})}),[v,Z,e]);const w=(0,a.I4)((()=>{g({chatId:b,isMuted:!l})}),[b,l,g]);if(!n||n.isRestricted||C&&!r)return;function k(e,t){(0,c.TE)(e),p({message:`${t} was copied`})}const I=y&&(0,d.WZ)(f,y),T=(0,i.hu)(n),M=(null==E?void 0:E.bio)||(0,i.GM)(n);return a.ZP.createElement("div",{className:"ChatExtra"},I&&!!I.length&&a.ZP.createElement(m.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>k(I,N("Phone"))},a.ZP.createElement("span",{className:"title",dir:"auto"},I),a.ZP.createElement("span",{className:"subtitle"},N("Phone"))),P&&a.ZP.createElement(m.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>k(`@${P}`,N("Username"))},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,o.Z)(P)),a.ZP.createElement("span",{className:"subtitle"},N("Username"))),M&&!!M.length&&a.ZP.createElement(m.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"},N(Z?"UserBio":"Info"))),(s||!P)&&T&&a.ZP.createElement(m.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>k(T,N("SetUrlPlaceholder"))},a.ZP.createElement("div",{className:"title"},T),a.ZP.createElement("span",{className:"subtitle"},N("SetUrlPlaceholder"))),!r&&a.ZP.createElement(m.Z,{icon:"unmute",ripple:!0,onClick:w},a.ZP.createElement("span",null,N("Notifications")),a.ZP.createElement(h.Z,{id:"group-notifications",label:Z?"Toggle User Notifications":"Toggle Chat Notifications",checked:!l,inactive:!0})))})))},329:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(782),l=n(9107),c=n(2340),d=n(172),u=n(3103),m=n(231);const h=(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,l=n&&!a&&!o,c=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:l,contactName:c}}),((e,t)=>(0,o.ei)(t,["leaveChannel","deleteHistory","deleteChannel","deleteChatUser","blockContact"])))((({isOpen:e,chat:t,isChannel:n,isPrivateChat:r,isChatWithSelf:s,isBot:o,isBasicGroup:h,isSuperGroup:f,currentUserId:v,canDeleteForAll:p,contactName:g,onClose:Z,onCloseAnimationEnd:E,leaveChannel:P,deleteHistory:y,deleteChannel:C,deleteChatUser:b,blockContact:N})=>{const w=(0,l.Z)(),k=(0,i.U)(w,t),I=(0,a.I4)((()=>{y({chatId:t.id,shouldDeleteForAll:!0}),Z()}),[y,t.id,Z]),T=(0,a.I4)((()=>{y({chatId:t.id,shouldDeleteForAll:!0}),N({contactId:t.id,accessHash:t.accessHash}),Z()}),[y,t.id,t.accessHash,N,Z]),M=(0,a.I4)((()=>{r?y({chatId:t.id,shouldDeleteForAll:!1}):h?(b({chatId:t.id,userId:v}),y({chatId:t.id,shouldDeleteForAll:!1})):!n&&!f||t.isCreator?(n||f)&&t.isCreator&&C({chatId:t.id}):P({chatId:t.id}),Z()}),[r,h,n,f,v,t.isCreator,t.id,Z,y,b,P,C]);return a.ZP.createElement(u.Z,{isOpen:e,className:"DeleteChatModal",header:a.ZP.createElement("div",{className:"modal-header",dir:w.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{size:"tiny",chat:t,isSavedMessages:s}),a.ZP.createElement("h3",{className:"modal-title"},w(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"ChannelDelete":h||f?"Group.LeaveGroup":"DeleteChatUser"))),onClose:Z,onCloseAnimationEnd:E},n&&t.isCreator?a.ZP.createElement("p",null,(0,c.Z)(w("ChatList.DeleteAndLeaveGroupConfirmation",k),["simple_markdown"])):n&&!t.isCreator||h||f?a.ZP.createElement("p",null,(0,c.Z)(w("ChannelLeaveAlertWithName",k),["simple_markdown"])):a.ZP.createElement("p",null,(0,c.Z)(w("ChatList.DeleteChatConfirmation",g),["simple_markdown"])),o&&a.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},w("DeleteAndStop")),p&&a.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:I},g?(0,c.Z)(w("ChatList.DeleteForEveryone",g)):w("DeleteForAll")),a.ZP.createElement(m.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},w(n&&!t.isCreator?"LeaveChannel":n&&t.isCreator?"Chat.Input.Delete":h||f?"Group.LeaveGroup":p?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(m.Z,{className:"confirm-dialog-button",isText:!0,onClick:Z},w("Cancel")))})))},2535:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(5116),s=n(5376),i=n(2858),o=n(3657),l=n(2566),c=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:g,sender:Z,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:M,timestamp:S}=I,x=(0,s.K2)(I)||"",L=(0,o.Op)(k,t),[$,F]=(0,d.Z)();(0,a.d4)((()=>{L&&F()}),[L,F]);const[A,O]=(0,a.eJ)(m&&(!h||M<=1048576*h)),R=Boolean(N||A&&$),D=(0,i.Ti)(e,"download"),{loadProgress:U,mediaData:B}=(0,l.Z)(D,!R,void 0,void 0,void 0,!0),V=Boolean(B),{isUploading:X,isTransferring:K,transferProgress:z}=(0,i.Sc)(e,f||U,R&&!V),Y=(0,s.v6)(I),j=Y?(0,i.DH)(e):void 0,H=Y?I.previewBlobUrl:void 0,q=(0,c.Z)((0,i.Ti)(e,"pictogram"),!L),W=C&&Boolean(I.mediaType),J=(0,a.I4)((()=>{X?y&&y():N?w.cancelMessageMediaDownload({message:e}):K?O(!1):W?C():w.downloadMessageMedia({message:e})}),[X,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:x,size:M,timestamp:v?p||S:void 0,thumbnailDataUri:j,previewData:H||q,smaller:n,isTransferring:K,isUploading:X,transferProgress:z,className:g,sender:Z,isSelectable:P,isSelected:E,actionIcon:W?(0,i.hC)(e)?"icon-play":"icon-eye":"icon-download",onClick:J,onDateClick:b?_:void 0})}))},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),l=n(5376),c=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:g,previewData:Z,className:E,smaller:P,isTransferring:y,isUploading:C,isSelectable:b,isSelected:N,transferProgress:w,actionIcon:k,onClick:I,onDateClick:T})=>{const M=(0,u.Z)();let S=(0,a.sO)(null);e&&(S=e);const x=(0,s.Z)(Z),{shouldRender:L,transitionClassNames:$}=(0,r.Z)(y,void 0,!0),F=(0,l.Oh)(f),A=(0,l.yW)(n),{width:O,height:R}=(0,c.lE)(P),D=(0,i.Z)("File",E,P&&"smaller",I&&!C&&"interactive",N&&"file-is-selected");return a.ZP.createElement("div",{ref:S,className:D,dir:M.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},g||Z?a.ZP.createElement("div",{className:"file-preview media-inner"},a.ZP.createElement("img",{src:g,width:O,height:R,className:"thumbnail",alt:""}),a.ZP.createElement("img",{src:Z,className:(0,i.Z)("full-media",x),width:O,height:R,alt:""})):a.ZP.createElement("div",{className:`file-icon ${F}`},f.length<=4&&a.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),L&&a.ZP.createElement("div",{className:(0,i.Z)("file-progress",F,$)},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",L&&"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)}%`:A),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)(M,1e3*v,!0))))),p&&v&&a.ZP.createElement(h.Z,{onClick:T},(0,o.VX)(M,1e3*v)))}))},8799:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(5116),s=n(1713),i=n(2858),o=n(1638),l=n(2340),c=n(782),d=n(9107),u=n(172),m=n(9411),h=n(8729);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))}}),((e,t)=>(0,c.ei)(t,["loadFullChat","openMediaViewer"])))((({typingStatus:e,avatarSize:t="medium",withMediaViewer:n,withUsername:r,withFullInfo:o,withUpdatingStatus:c,withChatType:f,noRtl:v,chat:p,onlineCount:g,areMessagesLoaded:Z,lastSyncTime:E,loadFullChat:P,openMediaViewer:y})=>{const C=p&&(0,i.ZV)(p),{id:b,isMin:N,isRestricted:w}=p||{};(0,a.d4)((()=>{b&&!N&&o&&E&&P({chatId:b})}),[b,N,E,o,P,C]);const k=(0,a.I4)(((e,n)=>{p&&n&&(e.stopPropagation(),y({avatarOwnerId:p.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[p,t,y]),I=(0,d.Z)();if(p)return a.ZP.createElement("div",{className:"ChatInfo",dir:!v&&I.isRtl?"rtl":void 0},a.ZP.createElement(u.Z,{key:p.id,size:t,chat:p,onClick:n?k:void 0}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},(0,l.Z)((0,i.U)(I,p))),p.isVerified&&a.ZP.createElement(m.Z,null)),function(){if(c&&!Z&&!w)return a.ZP.createElement("span",{className:"status",dir:"auto"},I("Updating"));if(!p)return;if(e)return a.ZP.createElement(h.Z,{typingStatus:e});if(f)return a.ZP.createElement("div",{className:"status",dir:"auto"},I((0,i.l6)(p)));const t=r?p.username:void 0,n=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}(I,p),s=g?`, ${I("OnlineCount",g,"i")}`:void 0;return a.ZP.createElement("div",{className:"status"},t&&a.ZP.createElement("span",{className:"handle"},t),a.ZP.createElement("span",{className:"group-status"},n),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:()=>c});var a=n(4050),r=n(790),s=n(2858),i=n(6752),o=n(6202),l=n(692);const c=(0,a.X$)((({message:e,idPrefix:t="shared-media",onClick:n})=>{const c=(0,a.I4)((()=>{n(e.id,e.chatId)}),[e.id,e.chatId,n]),d=(0,s.DH)(e),u=(0,o.Z)((0,s.Ti)(e,"pictogram")),m=(0,l.Z)(u),h=(0,s.b7)(e);return a.ZP.createElement("div",{id:`${t}${e.id}`,className:"Media scroll-item",onClick:n?c:void 0},a.ZP.createElement("img",{src:d,alt:""}),a.ZP.createElement("img",{src:u,className:(0,i.Z)("full-media",m),alt:""}),h&&a.ZP.createElement("span",{className:"video-duration"},h.isGif?"GIF":(0,r.k9)(h.duration)))}))},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:()=>l});var a=n(4050),r=n(6752),s=n(1212),i=n(2340),o=n(9107);const l=(0,a.X$)((({text:e="Nothing found.",description:t})=>{const n=(0,o.Z)(),{transitionClassNames:l}=(0,s.Z)(!0);return a.ZP.createElement("div",{className:(0,r.Z)("NothingFound",l,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(2858),s=n(1273),i=n(4605),o=n(7687),l=n(1876),c=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:g,isLoading:Z,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)),M=(0,h.Z)();return a.ZP.createElement("div",{className:"Picker"},a.ZP.createElement("div",{className:"picker-header custom-scroll",dir:M.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:g,ref:b,value:n,onChange:k,placeholder:v||M("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(l.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(c.Z,{userId:e}):a.ZP.createElement(d.Z,{chatId:e}))))):Z||!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(2858),o=n(2340),l=n(6752),c=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,c.Z)();let p,g;if(e&&t)p=a.ZP.createElement("div",{className:"item-icon"},a.ZP.createElement("i",{className:`icon-${e}`})),g=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);g=e?(0,o.Z)(e):void 0}const Z=(0,l.Z)("PickerSelectedItem",f,n&&"minimized",r&&"closeable");return a.ZP.createElement("div",{className:Z,onClick:()=>s(u),title:n?g:void 0,dir:v.isRtl?"rtl":void 0},p,!n&&a.ZP.createElement("div",{className:"item-name",dir:"auto"},g),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(2858),l=n(2340),c=n(782),d=n(9107),u=n(172),m=n(9411),h=n(8729);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}}),((e,t)=>(0,c.ei)(t,["loadFullUser","openMediaViewer"])))((({typingStatus:e,avatarSize:t="medium",status:n,withMediaViewer:r,withUsername:i,withFullInfo:c,withUpdatingStatus:f,noStatusOrTyping:v,noRtl:p,user:g,userStatus:Z,isSavedMessages:E,areMessagesLoaded:P,lastSyncTime:y,serverTimeOffset:C,loadFullUser:b,openMediaViewer:N})=>{const{id:w}=g||{},k=(0,o.Js)(g);(0,a.d4)((()=>{c&&y&&w&&b({userId:w})}),[w,b,y,c]);const I=(0,a.I4)(((e,n)=>{g&&n&&(e.stopPropagation(),N({avatarOwnerId:g.id,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))}),[g,t,N]),T=(0,d.Z)();if(g)return a.ZP.createElement("div",{className:"ChatInfo",dir:!p&&T.isRtl?"rtl":void 0},a.ZP.createElement(u.Z,{key:g.id,size:t,user:g,isSavedMessages:E,onClick:r?I:void 0}),a.ZP.createElement("div",{className:"info"},E?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,T("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},k&&(0,l.Z)(k)),(null==g?void 0:g.isVerified)&&a.ZP.createElement(m.Z,null)),(n||!E&&!v)&&(n?a.ZP.createElement("span",{className:"status",dir:"auto"},n):f&&!P?a.ZP.createElement("span",{className:"status",dir:"auto"},T("Updating")):g?e?a.ZP.createElement(h.Z,{typingStatus:e}):a.ZP.createElement("div",{className:"status "+((0,o.kM)(g,Z)?"online":"")},i&&g.username&&a.ZP.createElement("span",{className:"handle"},g.username),a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,o.Tq)(T,g,Z,C))):void 0)))})))},787:(e,t,n)=>{n.d(t,{Z:()=>N});var a=n(4050),r=n(5116),s=n(1713),i=n(7361),o=n(1638),l=n(2858),c=n(2340),d=n(782),u=n(1174),m=n(6752),h=n(6137),f=n(647),v=n(9107),p=n(9411),g=n(2155),Z=n(6202),E=n(2937),P=n(7204),y=n(9204);const C=(0,a.X$)((({chat:e,user:t,photo:n,isFirstPhoto:r,isSavedMessages:s,lastSyncTime:i,onClick:o})=>{const d=(0,v.Z)(),u=t&&(0,l.NB)(t),f=e&&(0,l.pK)(e.id);function p(a,r){if(n&&!r)return`photo${n.id}?size=c`;let i;return s||u||f||(t?i=(0,l.RT)(t,a):e&&(i=(0,l.RT)(e,a))),i}const C=(0,Z.Z)(p("big"),!1,h.IU.BlobUrl,i),b=r&&!C?p("normal",!0):void 0,N=(0,Z.Z)(b,!1,h.IU.BlobUrl,i),w=(0,E.Z)(!C&&n&&n.thumbnail&&n.thumbnail.dataUri),k=C||N||w,I=(0,P.Z)(k);let T="";if(s)T=a.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(u)T=a.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(f)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,l.Js)(t);T=e?(0,g.Xv)(e,2):void 0}else if(!k&&e){const t=(0,l.U)(d,e);T=t&&(0,g.Xv)(t,(0,l.YC)(e.id)?2:1)}else T=a.ZP.createElement("div",{className:"spinner-wrapper"},a.ZP.createElement(y.Z,{color:"white"}));const M=(0,m.Z)("ProfilePhoto",`color-bg-${(0,l.Rs)(t||e)}`,s&&"saved-messages",u&&"deleted-account",f&&"replies-bot-account",!s&&!k&&"no-photo");return a.ZP.createElement("div",{className:M,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,c.Z)(T,["hq_emoji"]):T)}));var b=n(2255);const N=(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),l=(0,o.Z1)(e,t),c=!n&&s&&s.isSelf,{animationLevel:d}=e.settings.byKey;return{connectionState:a,user:s,userStatus:i,chat:l,isSavedMessages:c,animationLevel:d,serverTimeOffset:r}}),((e,t)=>(0,d.ei)(t,["loadFullUser","openMediaViewer"])))((({forceShowSelf:e,user:t,userStatus:n,chat:r,isSavedMessages:o,connectionState:d,animationLevel:g,serverTimeOffset:Z,loadFullUser:E,openMediaViewer:P})=>{var y;const N=(0,v.Z)(),{id:w}=t||{},{id:k}=r||{},I=t?(0,l.Js)(t):r?r.title:"",T=(null==t?void 0:t.photos)||(null==r?void 0:r.photos)||[],M=g>=1?N.isRtl?"slide-optimized-rtl":"slide-optimized":"none",[S,x]=(0,a.eJ)(0),L=o||T.length<=1||0===S,$=o||T.length<=1||S===T.length-1;(0,a.d4)((()=>{S>T.length&&x(Math.max(0,T.length-1))}),[S,T.length]),(0,a.d4)((()=>{"connectionStateReady"===d&&w&&!e&&E({userId:w})}),[w,E,d,e]),function(e,t,n){(0,a.d4)((()=>{t.slice(n,n+4).forEach((e=>{f.UV(`photo${e.id}?size=c`)||f.he(`photo${e.id}?size=c`,h.IU.BlobUrl)}))}),[n,t])}(0,T,S);const F=(0,a.I4)((()=>{P({avatarOwnerId:w||k,profilePhotoIndex:S,origin:e?s.bZ.SettingsAvatar:s.bZ.ProfileAvatar})}),[P,w,k,S,e]),A=(0,a.I4)((()=>{L||x(S-1)}),[S,L]),O=(0,a.I4)((()=>{$||x(S+1)}),[S,$]);if((0,a.d4)((()=>{const e=document.querySelector(".photo-wrapper");if(e)return(0,u.s)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:i.$b?(e,t)=>t===u.e.Right?(A(),!0):t===u.e.Left&&(O(),!0):void 0})}),[O,A]),!t&&!r)return;function R(){const e=!o&&T&&T.length>0?T[S]:void 0;return a.ZP.createElement(C,{key:S,user:t,chat:r,photo:e,isSavedMessages:o,isFirstPhoto:L,onClick:F})}const D=null===(y=t||r)||void 0===y?void 0:y.isVerified;return a.ZP.createElement("div",{className:(0,m.Z)("ProfileInfo",e&&"self"),dir:N.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:"photo-wrapper"},function(){if(!(o||!T||T.length<=1))return a.ZP.createElement("div",{className:"photo-dashes"},T.map(((e,t)=>a.ZP.createElement("span",{className:"photo-dash "+(t===S?"current":"")}))))}(),a.ZP.createElement(b.Z,{activeKey:S,name:M,className:"profile-slide-container"},R),!L&&a.ZP.createElement("button",{type:"button",className:"navigation prev","aria-label":N("AccDescrPrevious"),onClick:A}),!$&&a.ZP.createElement("button",{type:"button",className:"navigation next","aria-label":N("Next"),onClick:O})),a.ZP.createElement("div",{className:"info",dir:N.isRtl?"rtl":"auto"},o?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},N("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},I&&(0,c.Z)(I)),D&&a.ZP.createElement(p.Z,null)),!o&&(t?a.ZP.createElement("div",{className:"status "+((0,l.kM)(t,n)?"online":"")},a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,l.Tq)(N,t,n,Z))):a.ZP.createElement("span",{className:"status",dir:"auto"},(0,l.eA)(r)?N("Subscribers",null!==(U=r.membersCount)&&void 0!==U?U:0,"i"):N("Members",null!==(B=r.membersCount)&&void 0!==B?B:0,"i")))));var U,B})))},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),l=n(706),c=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:g,onUnfaveClick:Z})=>{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,M]=(0,l.Z)(Boolean(k)),S=I&&w,{transitionClassNames:x}=(0,o.Z)(Boolean(N||S),void 0,void 0,"slow");(0,a.d4)((()=>{w||M()}),[M,w]);const L=(0,c.Z)("StickerButton",p&&"interactive",e.isAnimated&&"animated",y,v),$=b&&!S?`background-image: url('${b}');`:"";return a.ZP.createElement("div",{ref:E,className:L,title:f||(null==e?void 0:e.emoji),style:$,"data-sticker-id":e.id,onMouseDown:d.b,onClick:function(){p&&p(g)}},!S&&a.ZP.createElement("img",{src:N,className:x}),w&&k&&a.ZP.createElement(u.Z,{id:P,animationData:k,play:!0,size:t,isLowPriority:!0,onLoad:T}),Z&&a.ZP.createElement(m.Z,{className:"sticker-unfave-button",color:"dark",round:!0,onClick:function(t){t.stopPropagation(),t.preventDefault(),Z(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:()=>c});var a=n(4050),r=n(5116),s=n(1638),i=n(2858),o=n(2340),l=n(9107);const c=(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,l.Z)(),r=t&&!t.isSelf&&(0,i.Vl)(t);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)),n(e.action).replace("{user}","").trim(),a.ZP.createElement("span",{className:"ellipsis"}))})))},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:()=>h});var a=n(4050),r=n(2858),s=n(6752),i=n(8035),o=n(2340),l=n(790),c=n(9107),d=n(3709),u=n(8033),m=n(88);const h=(0,a.X$)((({message:e,senderTitle:t,onMessageClick:n})=>{const h=(0,c.Z)();let f=(0,r.s1)(e);if(!f){const t=(0,r.T7)(e);if(t){const{url:n,domain:a}=t,s=(0,r.MK)(h,e);f={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,description:s!==n?s:void 0}}}const v=(0,a.I4)((()=>{n(e.id,e.chatId)}),[n,e.id,e.chatId]);if(!f)return;const{siteName:p,url:g,displayUrl:Z,title:E,description:P,photo:y,video:C}=f,b=!t&&(0,i.Z)(P,170),N=(0,s.Z)("WebLink scroll-item",!y&&!C&&"without-media");return a.ZP.createElement("div",{className:N,"data-initial":(p||Z)[0],dir:h.isRtl?"rtl":void 0},y&&a.ZP.createElement(d.Z,{message:e}),a.ZP.createElement("div",{className:"content"},a.ZP.createElement(u.Z,{isRtl:h.isRtl,className:"site-title",onClick:v},(0,o.Z)(E||p||Z)),b&&a.ZP.createElement(u.Z,{isRtl:h.isRtl,className:"site-description",onClick:v},(0,o.Z)(b)),a.ZP.createElement(m.Z,{url:g,className:"site-name",text:"",isRtl:h.isRtl},g.replace("mailto:","")||Z),t&&a.ZP.createElement("div",{className:"sender-name"},(0,o.Z)(t))),t&&a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(u.Z,{className:"date",onClick:v,isRtl:h.isRtl},(0,l.VX)(h,1e3*e.date))))}))},4399:(e,t,n)=>{n.d(t,{L6:()=>o,Gw:()=>l,Rj:()=>c,vY:()=>d,wB:()=>u,kc:()=>p,fM:()=>Z,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(2858);const o="(max-height: 640px)",l=parseInt(getComputedStyle(document.documentElement).fontSize,10),c=240,d={width:640,height:640},u="1258816259753933",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/l-4.5)),f||(f=Math.min(29,a/l-7)),v||(v=Math.min(29,a/l-4.5)),e?h:t?v:f}(e,a)-i)*l}function g({width:e,height:t,fromOwnMessage:n,isForwarded:a,isWebPagePhoto:r,isGif:s,noAvatars:i}){const o=t/e,c=p(n,a,r,i),d=function(e,t){return e&&t&&t>=.75&&t<=1.25?20*l:27*l}(s,o),u=s?Math.max(300,e):e;return w(c,d,u,s?t*(u/e):t)}function Z(e,t){const n=window.matchMedia(o),{width:a,height:r}=s.Z.get();let i=t&&n.matches?10:8.25;return e&&(i=n.matches?10:15),{width:a,height:r-i*l}}function E(e,t,n,a,r){const{width:s,height:o}=(0,i.HV)(e)||m;return g({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 g({width:r,height:s,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:a})}function y(){return{width:2*l,height:2*l}}function C(e){return e?{width:3*l,height:3*l}:{width:3.375*l,height:3.375*l}}function b(e){const{width:t}=e;let{height:n}=e;e.id===u&&(n=t);const s=n&&t&&n/t,i=l*(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}=Z(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)}}},935:(e,t,n)=>{n.d(t,{X:()=>d,H:()=>h});var a=n(4050),r=n(5116),s=n(6137),i=n(2858),o=n(2340),l=n(7373),c=n(88);function d(e,t,n){const a=e.content.text;if(!a||!a.text){const t=(0,i.UD)(e);return t?[t]:void 0}const{text:r,entities:s}=a;return h(r,s,t,n)}function u(e,t,n,a){const{offset:r,length:s}=e,i=new Set([t]);if(a.has(t))return;const o=[];return n.filter(((e,n)=>n>t&&e.offset>=r&&e.offset<r+s)).map((e=>u(e,n.indexOf(e),n,a))).filter(Boolean).forEach((e=>{let t=!1;e.organizedIndexes.forEach((e=>{t||i.has(e)||(t=!0),i.add(e)})),t&&o.push(e)})),{entity:e,organizedIndexes:i,nestedEntities:o}}function m(e){const t=new Set,n=[];return e.forEach(((a,r)=>{if(t.has(r))return;const s=u(a,r,e,t);s&&(s.organizedIndexes.forEach((e=>{t.add(e)})),n.push(s))})),n}function h(e,t,n,r,i){if(!t||!t.length)return f(e,n,r,i);const d=[];let u=!1;const h=m(t);function Z(t,d,m,h){const E=[],{entity:P,nestedEntities:y}=m,{offset:C,length:b,type:N}=P;let w=e.substring(t,C);const k=w.length;w&&(u&&w.length>0&&"\n"===w[0]&&(w=w.substr(1),u=!1),w&&E.push(...f(w,n,r,i)));const I=t+k,T=I+b;let M=e.substring(C,C+b);const S=[];if(u&&M.length>0&&"\n"===M[0]&&(M=M.substr(1),u=!1),N===s.Vv.Pre&&(u=!0),y.length){let e=I;y.forEach(((t,n)=>{const{renderResult:a,entityEndIndex:r}=Z(e,T,t,n===y.length-1);S.push(...a),e=r}))}const x=i?function(e,t,n){const a="string"==typeof t&&t,r=n.length?n.join(""):(0,o.Z)(t,["escape_html","emoji_html","br_html"]).join("");if(!a)return r;switch(e.type){case s.Vv.Bold:return`<b>${r}</b>`;case s.Vv.Italic:return`<i>${r}</i>`;case s.Vv.Underline:return`<u>${r}</u>`;case s.Vv.Code:return`<code class="text-entity-code">${r}</code>`;case s.Vv.Pre:return`\`\`\`<br/>${r}<br/>\`\`\``;case s.Vv.Strike:return`<del>${r}</del>`;case s.Vv.MentionName:return`<a\n class="text-entity-link"\n data-entity-type="${s.Vv.MentionName}"\n data-user-id="${e.userId}"\n contenteditable="false"\n dir="auto"\n >${r}</a>`;case s.Vv.Url:case s.Vv.TextUrl:return`<a\n class="text-entity-link"\n href=${v(a,e)}\n data-entity-type="${e.type}"\n dir="auto"\n >${r}</a>`;default:return r}}(P,M,S):function(e,t,n){const r="string"==typeof t&&t,i=n.length?n:t;if(!r)return f(i);switch(e.type){case s.Vv.Bold:return a.ZP.createElement("strong",null,f(i));case s.Vv.Blockquote:return a.ZP.createElement("blockquote",null,f(i));case s.Vv.BotCommand:return a.ZP.createElement("a",{onClick:p,className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Hashtag:case s.Vv.Cashtag:return a.ZP.createElement("a",{onClick:g,className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Code:return a.ZP.createElement("code",{className:"text-entity-code"},f(i));case s.Vv.Email:return a.ZP.createElement("a",{href:`mailto:${r}`,target:"_blank",rel:"noopener noreferrer",className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Italic:return a.ZP.createElement("em",null,f(i));case s.Vv.MentionName:return a.ZP.createElement(l.Z,{userId:e.userId},f(i));case s.Vv.Mention:return a.ZP.createElement(l.Z,{username:r},f(i));case s.Vv.Phone:return a.ZP.createElement("a",{href:`tel:${r}`,className:"text-entity-link",dir:"auto"},f(i));case s.Vv.Pre:return a.ZP.createElement("pre",{className:"text-entity-pre"},f(i));case s.Vv.Strike:return a.ZP.createElement("del",null,f(i));case s.Vv.TextUrl:case s.Vv.Url:return a.ZP.createElement(c.Z,{url:v(r,e),text:r},f(i));case s.Vv.Underline:return a.ZP.createElement("ins",null,f(i));default:return f(i)}}(P,M,S);if(Array.isArray(x)?E.push(...x):E.push(x),h&&T<d){let t=e.substring(T,d);u&&t.length>0&&"\n"===t[0]&&(t=t.substring(1)),t&&E.push(...f(t,n,r,i))}return{renderResult:E,entityEndIndex:T}}let E=0;return h.forEach(((t,n)=>{const{renderResult:a,entityEndIndex:r}=Z(E,e.length,t,n===h.length-1);d.push(...a),E=r})),d}function f(e,t,n,a){if(Array.isArray(e)){const r=[];return e.forEach((e=>{r.push(...f(e,t,n,a))})),r}if(a)return(0,o.Z)(e,["escape_html","emoji_html","br_html"]);const r=n?"hq_emoji":"emoji";return t?(0,o.Z)(e,[r,"br","highlight"],{highlight:t}):(0,o.Z)(e,[r,"br"])}function v(e,t){const{type:n,url:a}=t;return n===s.Vv.TextUrl&&a?a:e}function p(e){(0,r.uC)().sendBotCommand({command:e.currentTarget.innerText})}function g(e){(0,r.uC)().setLocalTextSearchQuery({query:e.currentTarget.innerText}),(0,r.uC)().searchTextMessagesLocal()}},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:()=>X});var a=n(4050),r=n(5116),s=n(3716),i=n(7361),o=n(7204),l=n(782),c=n(2858),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),g=n(8005),Z=n(2340),E=n(9118),P=n(6752),y=n(5790),C=n(1470),b=n(706),N=n(6202),w=n(172),k=n(9411),I=n(8729),T=n(6844),M=n(329),S=n(1876),x=n(2155),L=n(126);const $=(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(L.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))))),O=(0,a.X$)((0,r.c$)(((e,{chatId:t})=>{const n=(0,d.Z1)(e,t);if(!n||!n.lastMessage)return{};const{senderId:a,replyToMessageId:r,isOutgoing:s}=n.lastMessage,i=a?(0,d.dy)(e,a):void 0,o=(0,c.N5)(n.lastMessage),l=o&&r?(0,d.hj)(e,n.id,r):void 0,{targetUserIds:u,targetChatId:m}=o||{},h=(0,c.zX)(n),{byId:f}=e.users,{chatId:v,threadId:g,type:Z}=(0,d.Bt)(e)||{},E=t===v&&g===p._f;return{chat:n,isMuted:(0,c.i4)(n,(0,d.dZ)(e),(0,d.NJ)(e)),lastMessageSender:i,actionTargetUserIds:u,actionTargetChatId:m,actionTargetMessage:l,draft:(0,d.Ms)(e,t,p._f),animationLevel:e.settings.byKey.animationLevel,isSelected:E,canScrollDown:E&&"thread"===Z,lastSyncTime:e.lastSyncTime,...s&&{lastMessageOutgoingStatus:(0,d.dT)(e,n.lastMessage)},...h&&{user:(0,d.dy)(e,h),userStatus:(0,d.ss)(e,h)},...u&&{usersById:f}}}),((e,t)=>(0,l.ei)(t,["openChat","focusLastMessage"])))((({style:e,chatId:t,folderId:n,orderDiff:r,animationType:o,isPinned:l,chat:d,isMuted:u,user:h,userStatus:f,actionTargetUserIds:p,usersById:x,lastMessageSender:L,lastMessageOutgoingStatus:O,actionTargetMessage:R,actionTargetChatId:D,draft:U,animationLevel:B,isSelected:V,canScrollDown:X,lastSyncTime:K,openChat:z,focusLastMessage:Y})=>{const j=(0,a.sO)(null),[H,q,W]=(0,b.Z)(),[J,_,G]=(0,b.Z)(),[Q,ee,te]=(0,b.Z)(),[ne,ae,re]=(0,b.Z)(),{lastMessage:se,typingStatus:ie}=d||{},oe=se&&(0,c.Lo)(se);(0,y.Z)(t,oe?se.replyToMessageId:void 0,R);const le=se&&!(0,c.bf)(se)?(0,c.DH)(se):void 0,ce=(0,N.Z)(se?(0,c.Ti)(se,"micro"):void 0),de=Boolean(se&&(0,c.Y5)(se)),ue=(0,a.Ye)((()=>p?p.map((e=>null==x?void 0:x[e])).filter(Boolean):void 0),[p,x]);(0,a.bt)((()=>{const e=j.current;if(0!==B&&e){if(o===m.Opacity)e.style.opacity="0",(0,E.T2)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(o!==m.Move)return;e.style.transform=`translate3d(0, ${100*-r}%, 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)}}),[B,r,o]);const me=(0,a.I4)((()=>{z({id:t,shouldReplaceHistory:!0}),V&&X&&Y()}),[V,X,z,t,Y]),he=(0,C.Z)({chat:d,user:h,handleDelete:function(){ee(),q()},handleChatFolderChange:function(){ae(),_()},folderId:n,isPinned:l,isMuted:u}),fe=(0,v.Z)();if(!d)return;const ve=(0,P.Z)("Chat chat-item-clickable",(0,c.YC)(t)?"private":"group",V&&"selected");return a.ZP.createElement(S.Z,{ref:j,className:ve,style:e,ripple:!i.wB,contextActions:he,onClick:me},a.ZP.createElement("div",{className:"status"},a.ZP.createElement(w.Z,{chat:d,user:h,userStatus:f,isSavedMessages:null==h?void 0:h.isSelf,lastSyncTime:K}),d.isCallActive&&d.isCallNotEmpty&&a.ZP.createElement(A,{isSelected:V,isActive:0!==B})),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,(0,Z.Z)((0,c.U)(fe,d,h))),d.isVerified&&a.ZP.createElement(k.Z,null),u&&a.ZP.createElement("i",{className:"icon-muted"}),d.lastMessage&&a.ZP.createElement(T.Z,{message:d.lastMessage,outgoingStatus:O})),a.ZP.createElement("div",{className:"subtitle"},function(){if(ie&&se&&ie.timestamp>1e3*se.date)return a.ZP.createElement(I.Z,{typingStatus:ie});if(null!=U&&U.text.length)return a.ZP.createElement("p",{className:"last-message",dir:fe.isRtl?"auto":"ltr"},a.ZP.createElement("span",{className:"draft"},fe("Draft")),(0,Z.Z)(U.text));if(!se)return;if(oe){const e=d&&((0,c.eA)(d)||se.senderId===se.chatId)?d:L;return a.ZP.createElement("p",{className:"last-message",dir:fe.isRtl?"auto":"ltr"},(0,Z.Z)((0,g.D)(fe,se,e,ue,R,D,{asPlain:!0})))}const e=(0,c.zF)(fe,t,L);return a.ZP.createElement("p",{className:"last-message",dir:fe.isRtl?"auto":"ltr"},e&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"sender-name"},(0,Z.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,c.b7)(t)&&a.ZP.createElement("i",{className:"icon-play"}),(0,Z.Z)((0,c.MK)(e,t,!0))):(0,Z.Z)((0,c.MK)(e,t))}(fe,se,ce||le,de))}(),a.ZP.createElement($,{chat:d,isPinned:l,isMuted:u}))),Q&&a.ZP.createElement(M.Z,{isOpen:H,onClose:W,onCloseAnimationEnd:te,chat:d}),ne&&a.ZP.createElement(F.Z,{isOpen:J,onClose:G,onCloseAnimationEnd:re,chatId:t}))})));var R=n(1713),D=n(231),U=n(7854);const B=(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(U.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(D.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 V;!function(e){e.all="active",e.archived="archived"}(V||(V={}));const X=(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,l="folder"!==t?V[t]:void 0,c=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),...l?{listIds:a[l],orderedPinnedIds:s[l]}:{chatFolder:c}}}),((e,t)=>(0,l.ei)(t,["loadMoreChats","preloadTopChatMessages","preloadArchivedChats","openChat","openNextChat"])))((({folderType:e,folderId:t,isActive:n,allListIds:r,chatsById:d,usersById:v,listIds:p,orderedPinnedIds:g,chatFolder:Z,lastSyncTime:E,notifySettings:P,notifyExceptions:y,foldersDispatch:C,onScreenSelect:b,loadMoreChats:N,preloadTopChatMessages:w,preloadArchivedChats:k,openChat:I,openNextChat:T})=>{const[M,S]=(0,a.Ye)((()=>"folder"===e&&Z?(0,c.P4)(r,d,v,Z,P,y):[p,g]),[e,Z,r,d,v,P,y,p,g]),[x,L,$]=(0,a.Ye)((()=>{if(!M||"folder"===e&&!Z)return[];const t=(0,c.O)(d,M,S,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,S,e,Z,d]),F=(0,o.Z)(x),A=(0,a.Ye)((()=>x&&F?(0,l.Q8)(x,((e,t)=>void 0!==F[t]?e-F[t]:-1/0)):{}),[x,F]),R=(0,a.I4)((()=>{N({listType:"archived"===e?"archived":"active"})}),[N,e]),[D,U]=(0,u.Z)(E?R:void 0,L,void 0,s.t_,"all"===e&&!s.NM),V=(0,a.Ye)((()=>{if(D&&$)return(0,c.wG)($,D)}),[$,D]);(0,a.d4)((()=>{E&&"all"===e&&(w(),k())}),[E,e,w,k]),(0,a.d4)((()=>{if(n&&L)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>L.length-1)return;I({id:L[n],shouldReplaceHistory:!0})}if(e.altKey){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(!t)return;e.preventDefault(),T({targetIndexDelta:t,orderedIds:L})}}}),[n,I,T,L]);const X=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:D,onLoadMore:U,preloadBackwards:s.t_,noFastList:!0,noScrollRestore:!0},null!=D&&D.length&&V?function(){const e=L.indexOf(D[0]),n=e+V.pinnedChats.length;return a.ZP.createElement("div",{className:"scroll-container",style:i.wZ?`height: ${L.length*s.rS}px`:void 0,teactFastList:!0},V.pinnedChats.map((({id:n},r)=>a.ZP.createElement(O,{key:n,teactOrderKey:r,chatId:n,isPinned:!0,folderId:t,animationType:X(n),orderDiff:A[n],style:`top: ${(e+r)*s.rS}px;`}))),V.otherChats.map(((e,r)=>a.ZP.createElement(O,{key:e.id,teactOrderKey:(0,c.OE)(e),chatId:e.id,folderId:t,animationType:X(e.id),orderDiff:A[e.id],style:`top: ${(n+r)*s.rS}px;`}))))}():D&&!D.length?a.ZP.createElement(B,{folderId:t,folderType:e,foldersDispatch:C,onScreenSelect:b}):a.ZP.createElement(f.Z,{key:"loading"}))})))},91:(e,t,n)=>{n.d(t,{F:()=>r});var a=n(2858);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 l=n[t.chatId];return l&&((0,a.YC)(s)&&i.isSelf?o=`${e("FromYou")} → ${(0,a.U)(e,l)}`:(0,a.Bf)(l)&&(o+=` → ${(0,a.U)(e,l)}`)),o}},2420:(e,t,n)=>{n.d(t,{t:()=>d,Z:()=>u});var a=n(4050),r=n(1212),s=n(6752),i=n(3989),o=n(7204),l=n(706);const c=(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 d;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(d||(d={}));const u=(0,a.X$)((({isOpen:e,withQuick:t,onHide:n,onFileSelect:l})=>{const d=(0,a.sO)(null),u=(0,o.Z)(t),{shouldRender:m,transitionClassNames:h}=(0,r.Z)(e);(0,a.d4)((()=>e?(0,i.Z)(n):void 0),[e,n]);const f=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),l(Array.from(t.files),!1))}),[l,n]),v=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),l(Array.from(t.files),!0))}),[l,n]),p=(0,a.I4)((e=>{e.stopPropagation();const{target:t,relatedTarget:a}=e;t.matches(".DropTarget, .DropArea")&&!a&&(d.current=window.setTimeout((()=>{n()}),150))}),[n]);if(!m)return;const g=(0,s.Z)("DropArea",h);return a.ZP.createElement("div",{className:g,onDragLeave:p,onDragOver:()=>{d.current&&window.clearTimeout(d.current)},onDrop:n},a.ZP.createElement(c,{onFileSelect:f}),(t||u)&&a.ZP.createElement(c,{onFileSelect:v,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),l=n(5723),c=n(6752),d=n(782),u=n(7361),m=n(517),h=n(2645),f=n(706),v=n(8674),p=n(4784),g=n(6391),Z=n(9107),E=n(2340),P=n(3283);const y=u.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}}),((e,t)=>(0,d.ei)(t,["editLastMessage","replyToNextMessage"])))((({id:e,chatId:t,isAttachmentModalInput:n,editableInputId:r,html:i,placeholder:d,forcedPlaceholder:C,canAutoFocus:b,shouldSuppressFocus:N,shouldSuppressTextFormatter:w,onUpdate:k,onSuppressedFocus:I,onSend:T,replyingToId:M,noTabCapture:S,messageSendKeyCombo:x,editLastMessage:L,replyToNextMessage:$})=>{const F=(0,a.sO)(null),A=(0,a.sO)(null),O=(0,Z.Z)(),R=(0,a.sO)(!1),[D,U,B]=(0,f.Z)(),[V,X]=(0,a.eJ)(),[K,z]=(0,a.eJ)();(0,a.d4)((()=>{n&&W(!1)}),[n]),(0,h.Z)((([e])=>{i!==F.current.innerHTML&&(F.current.innerHTML=i),i!==A.current.innerHTML&&(A.current.innerHTML=i),void 0!==e&&e!==i&&W(!i.length)}),[i]),(0,a.sO)(t).current=t;const Y=(0,a.I4)((()=>{(0,v.zG)()?setTimeout(Y,350):(0,l.Z)(F.current)}),[]),j=(0,a.I4)((()=>{B(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}),[B]);function H(){if(u.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||R.current)return B(),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(w||!(0,g.R)(t,r||s.R2)||!n||(0,p.Z)(n)||!t.START_TO_END)||(B(),!1)}function q(){if(!H())return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=F.current.getBoundingClientRect();let a=t.left+t.width/2-n.left;a<90?a=90:a>n.width-90&&(a=n.width-90),X({x:a,y:t.top-n.top}),z(e),U()}function W(e=!1){const t=F.current,n=A.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)((()=>{u.$b||b&&Y()}),[t,Y,M,b]),(0,a.d4)((()=>{if(S)return;const e=(0,o.Ds)((e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(Y))}),2e3,!0,!1);return(0,m.Z)({onTab:e})}),[Y,S]),(0,a.d4)((()=>{const e=F.current;function t(){e.blur()}return N&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[N]);const J=(0,c.Z)("form-control custom-scroll",i.length>0&&"touched",N&&"focus-disabled");return a.ZP.createElement("div",{id:e,onClick:N?I:void 0,dir:O.isRtl?"rtl":void 0},a.ZP.createElement("div",{ref:F,id:r||s.R2,className:J,contentEditable:!0,dir:"auto",onClick:Y,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(k("<br>"===t?"":t),!u.$b&&(!n||!n.length)&&(u.op||!t.includes("emoji-small"))){const e=window.getSelection();e&&(F.current.blur(),e.removeAllRanges(),(0,l.Z)(F.current,!0))}},onKeyDown:function(e){if(!i.length&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void $({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||i.length||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",(function t(){q(),e.target.removeEventListener("keyup",t)})):(e.preventDefault(),L()):u.cj||u.wZ||!("enter"===x&&!e.shiftKey||"ctrl-enter"===x&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),B(),T())},onMouseDown:function(e){2===e.button?!0!==R.current&&(R.current=!0,document.addEventListener("mousedown",(function e(){setTimeout((()=>{R.current=!1}),100),window.removeEventListener("mouseup",e)})),document.addEventListener("keydown",(function e(t){"Esc"!==t.key&&"Escape"!==t.key||(setTimeout((()=>{R.current=!1}),100),window.removeEventListener("keydown",e))}))):e.target.addEventListener("mouseup",(function t(){q(),e.target.removeEventListener("mouseup",t)}))},onContextMenu:u.wZ?function(e){H()&&(e.preventDefault(),e.stopPropagation())}:void 0,onTouchCancel:u.wZ?q:void 0}),a.ZP.createElement("div",{ref:A,className:(0,c.Z)(J,"clone"),dir:"auto"}),!C&&a.ZP.createElement("span",{className:"placeholder-text",dir:"auto"},d),a.ZP.createElement(P.Z,{isOpen:D,anchorPosition:V,selectedRange:K,setSelectedRange:z,onClose:j}),C&&a.ZP.createElement("span",{className:"forced-placeholder"},(0,E.Z)(C)))})))},3283:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(3716),s=n(6752),i=n(1396),o=n(3989),l=n(1212),c=n(8758),d=n(706),u=n(9107),m=n(231);const h={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace"},f=document.createElement("div"),v=(0,a.X$)((({isOpen:e,anchorPosition:t,selectedRange:n,setSelectedRange:v,onClose:p})=>{const g=(0,a.sO)(null),Z=(0,a.sO)(null),{shouldRender:E,transitionClassNames:P}=(0,l.Z)(e),[y,C,b]=(0,d.Z)(),[N,w]=(0,a.eJ)(""),[k,I]=(0,a.eJ)(!1),[T,M]=(0,a.eJ)(),[S,x]=(0,a.eJ)({});(0,a.d4)((()=>e?(0,o.Z)(p):void 0),[e,p]),(0,c.Z)(e,g,p),(0,a.d4)((()=>{y?Z.current.focus():(w(""),I(!1))}),[y]),(0,a.d4)((()=>{E||(b(),x({}),M(void 0))}),[b,E]),(0,a.d4)((()=>{if(!e||!n)return;const t={};let{parentElement:a}=n.commonAncestorContainer;for(;a&&a.id!==r.R2;){const e=h[a.tagName];e&&(t[e]=!0),a=a.parentElement}x(t)}),[e,n,C]);const L=(0,a.I4)((()=>{const e=window.getSelection();e&&v(e.getRangeAt(0))}),[v]),$=(0,a.I4)((()=>{if(n)return f.innerText=n.toString(),f.innerHTML}),[n]),F=(0,a.I4)((()=>{if(n)return n.commonAncestorContainer.parentElement}),[n]);function A(){const e=Z.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void M(void 0);let r="";a<n-t&&(r="mask-right"),a>0&&(r+=" mask-left"),M(r)}function O(e){if(S[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(S).some((t=>t!==e&&!!S[t])))return"disabled"}else if(S.monospace||S.strikethrough)return"disabled"}const R=(0,a.I4)((()=>{x((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!e[t]||document.execCommand(t)})),L(),{...e,bold:!e.bold})))}),[L]),D=(0,a.I4)((()=>{document.execCommand("italic"),L(),x((e=>({...e,italic:!e.italic})))}),[L]),U=(0,a.I4)((()=>{document.execCommand("underline"),L(),x((e=>({...e,underline:!e.underline})))}),[L]),B=(0,a.I4)((()=>{if(S.strikethrough){const e=F();if(!n||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void x((e=>({...e,strikethrough:!1})))}const e=$();document.execCommand("insertHTML",!1,`<del>${e}</del>`),p()}),[F,$,p,n,S.strikethrough]),V=(0,a.I4)((()=>{if(S.monospace){const e=F();if(!n||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void x((e=>({...e,monospace:!1})))}const e=$();document.execCommand("insertHTML",!1,`<code class="text-entity-code" dir="auto">${e}</code>`),p()}),[F,$,p,n,S.monospace]);function X(){const e=encodeURI((0,i.X)(N)||"");if(k){const t=F();if(!t||"A"!==t.tagName)return;return t.href=e,void p()}const t=$();!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>`),p()}const K=(0,a.I4)((e=>{const t={KeyK:C,KeyB:R,KeyU:U,KeyI:D,KeyM:V,KeyS:B}[e.code];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}),[R,D,U,V,B,C]);(0,a.d4)((()=>(e&&document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K))),[e,K]);const z=(0,u.Z)();if(!E)return;const Y=(0,s.Z)("TextFormatter",P,y&&"link-control-shown"),j=(0,s.Z)("TextFormatter-link-url-confirm",!!N.length&&"shown"),H=t?`left: ${t.x}px; top: ${t.y}px;--text-formatter-left: ${t.x}px;`:"";return a.ZP.createElement("div",{ref:g,className:Y,style:H,onKeyDown:function(e){"Enter"===e.key&&y&&(X(),e.preventDefault())}},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(m.Z,{color:"translucent",ariaLabel:"Bold text",className:O("bold"),onClick:R},a.ZP.createElement("i",{className:"icon-bold"})),a.ZP.createElement(m.Z,{color:"translucent",ariaLabel:"Italic text",className:O("italic"),onClick:D},a.ZP.createElement("i",{className:"icon-italic"})),a.ZP.createElement(m.Z,{color:"translucent",ariaLabel:"Underlined text",className:O("underline"),onClick:U},a.ZP.createElement("i",{className:"icon-underlined"})),a.ZP.createElement(m.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:O("strikethrough"),onClick:B},a.ZP.createElement("i",{className:"icon-strikethrough"})),a.ZP.createElement(m.Z,{color:"translucent",ariaLabel:"Monospace text",className:O("monospace"),onClick:V},a.ZP.createElement("i",{className:"icon-monospace"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(m.Z,{color:"translucent",ariaLabel:z("TextFormat.AddLinkTitle"),onClick:C},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(m.Z,{color:"translucent",ariaLabel:z("Cancel"),onClick:b},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement("div",{className:(0,s.Z)("TextFormatter-link-url-input-wrapper",T)},a.ZP.createElement("input",{ref:Z,className:"TextFormatter-link-url-input",type:"text",value:N,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){w(e.target.value),A()},onScroll:A})),a.ZP.createElement("div",{className:j},a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(m.Z,{color:"translucent",ariaLabel:z("Save"),className:"color-primary",onClick:X},a.ZP.createElement("i",{className:"icon-check"}))))))}))},2400:(e,t,n)=>{n.d(t,{_:()=>o});const a=/(<br>|<br\s?\/>)/g,r=/( |\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})},3575:(e,t,n)=>{n.d(t,{Z:()=>P});var a=n(4050),r=n(3716),s=n(735),i=n(2400),o=n(4284),l=n(5723),c=n(782);const d=new WeakMap;function u(e){return(...t)=>{const n=d.get(e);if(n&&(0,c.et)(n.lastArgs,t))return n.lastResult;const a=e(...t);return d.set(e,{lastArgs:t,lastResult:a}),a}}var m=n(706);let h,f,v,p;const g=u((function(e,t,n){return e&&t.length?Object.values((0,c.q0)(e,t)).slice(0,n):s.D})),Z=u((function(e,t,n){const a=Object.values(e),r=(0,c.ee)(a,"native"),s=t?(0,c.Q8)(t,(e=>Object.values((0,c.q0)(r,e)))):{},i=n?(0,c.Q8)(n,(e=>Object.values((0,c.q0)(r,e)))):{},o={...s,...i},l=[].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:l,byName:d,names:Object.keys(d)}})),E=u((function(e,t,n){const{byKeyword:a,keywords:r,byName:i,names:o}=e;let l=s.D;const d=r.filter((e=>e.startsWith(t))).sort();l=l.concat((0,c.xH)(Object.values((0,c.q0)(a,d))));const u=o.filter((e=>e.startsWith(t)));return l=l.concat((0,c.xH)(Object.values((0,c.q0)(i,u)))),l=(0,c.Tw)(l),l.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,c,d=r.R2,u,P,y,C=!1){const[b,N,w]=(0,m.Z)(),[k,I]=(0,a.eJ)(),[T,M]=(0,a.eJ)(!1),[S,x]=(0,a.eJ)(s.D);(0,a.d4)((()=>{if(C)return;const e=()=>{I(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)}),[C]),(0,a.d4)((()=>{if(!e||!t||!k||C)return void w();const n=t.includes(":")&&function(e){const t=(0,i._)(e).match(p);return t?t[0].trim():void 0}(t);if(!n)return x(s.D),void w();const a=n.length>2&&n.endsWith(":"),r=n.substr(1,a?n.length-2:void 0);let o=s.D;if(M(a),r){if(r.length>=2){const e=Z(k,P,y);o=E(e,r,36)}}else o=g(k,c,36);o.length?(a||N(),x(o)):w()}),[k,t,e,N,c,w,M,C,P,y]);const L=(0,a.I4)(((e,n)=>{const a=t.lastIndexOf(":",n?t.lastIndexOf(":")-1:void 0);if(-1!==a){u(`${t.substr(0,a)}${e}`);const n=document.getElementById(d);requestAnimationFrame((()=>{(0,l.Z)(n,!0)}))}w()}),[t,d,u,w]);return(0,a.d4)((()=>{b&&T&&S.length&&L(S[0].native,!0)}),[S,L,b,T]),{isEmojiTooltipOpen:b,closeEmojiTooltip:w,filteredEmojis:S,insertEmoji:L}}},2365:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(4050),r=n(6137),s=n(3716),i=n(2858),o=n(5765);function l(e,t){const n=t.username.toLowerCase(),a=(0,i.Js)(t),r=a&&a.toLowerCase(),s=e.toLowerCase();return n.startsWith(s)||r&&(0,o.Z)(r,s)}var c=n(2400),d=n(5723),u=n(706),m=n(782);const h=(0,n(9118).P2)((e=>e()),500,!0);let f;try{f=new RegExp("(^|\\s)@[-_\\p{L}\\p{M}\\p{N}]*$","gui")}catch(e){f=new RegExp("(^|\\s)@[-_\\d\\wа-яё]*$","gi")}function v(e,t,n,o=s.R2,v,p,g,Z){const[E,P,y]=(0,u.Z)(),[C,b]=(0,a.eJ)(),N=(0,a.Ye)((()=>(p||[]).map((e=>null==Z?void 0:Z[e])).filter(Boolean)),[p,Z]),w=(0,a.I4)(((e,t)=>{(v||p)&&Z?h((()=>{const n=(t?N:[]).filter((t=>!e||l(e,t))),a=(v||[]).map((({userId:e})=>Z[e])).filter((t=>!(!t||t.id===g)&&(!e||l(e,t))));b((0,m.Tw)(n.concat(a)))})):b(void 0)}),[g,v,p,N,Z]);(0,a.d4)((()=>{if(!e||!t.length)return void y();const n=t.includes("@")&&function(e){const t=(0,c._)(e).match(f);return t?t[0].trim():void 0}(t);if(n){const e=n?n.substr(1):"";w(e,function(e){return e.startsWith("@")}(t))}else y()}),[e,t,w,P,y]),(0,a.d4)((()=>{null!=C&&C.length?P():y()}),[P,y,C]);const k=(0,a.I4)(((e,a=!1)=>{if(!e.username&&!(0,i.Vl)(e))return;const s=e.username?`@${e.username}`:`<a\n class="text-entity-link"\n data-entity-type="${r.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${(0,i.Vl)(e)}</a>`,l=t.lastIndexOf("@");if(-1!==l){n(`${t.substr(0,l)}${s} `);const e=document.getElementById(o);requestAnimationFrame((()=>{(0,d.Z)(e,a)}))}y()}),[t,o,n,y]);return{isMentionTooltipOpen:E,closeMentionTooltip:y,insertMention:k,mentionFilteredUsers:C}}},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)(),l=(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,l()};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:l})=>{const[c,d]=(0,a.eJ)(n||[]),u=(0,a.I4)((e=>{const{value:t,checked:n}=e.currentTarget;let a;a=n?[...c,t]:c.filter((e=>e!==t)),d(a),l(a)}),[l,c]);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:l,children:c})=>{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?l:void 0,ariaLabel:i,tabIndex:-1},c)}},1876:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(4050),r=n(7361),s=n(9118),i=n(6752),o=n(7240),l=n(3394),c=n(706),d=n(9107),u=n(8512),m=n(2328),h=n(8964);const f=e=>{const{ref:t,buttonRef:n,icon:f,className:v,style:p,children:g,disabled:Z,ripple:E,narrow:P,inactive:y,focus:C,destructive:b,multiline:N,isStatic:w,contextActions:k,onMouseDown:I,onClick:T}=e;let M=(0,a.sO)(null);t&&(M=t);const[S,x,L]=(0,c.Z)(),{isContextMenuOpen:$,contextMenuPosition:F,handleBeforeContextMenu:A,handleContextMenu:O,handleContextMenuClose:R,handleContextMenuHide:D}=(0,o.Z)(M,!k),U=(0,a.I4)((()=>M.current),[]),B=(0,a.I4)((()=>M.current.closest(".custom-scroll")),[]),V=(0,a.I4)((()=>M.current.querySelector(".ListItem-context-menu .bubble")),[]),{positionX:X,positionY:K,style:z}=(0,l.Z)(F,U,B,V),Y=(0,a.I4)((e=>{!Z&&T&&(T(e),r.$b&&!E&&(x(),(0,s.T2)(L)))}),[Z,x,T,E,L]),j=(0,a.I4)((e=>{y||r.$b||(!k||2!==e.button&&T||A(e),0===e.button&&(T?Y(e):O(e)))}),[y,k,T,A,O,Y]),H=(0,d.Z)(),q=(0,i.Z)("ListItem",v,!w&&"no-selection",E&&"has-ripple",P&&"narrow",Z&&"disabled",y&&"inactive",F&&"has-menu-open",C&&"focus",b&&"destructive",N&&"multiline",w&&"is-static");return a.ZP.createElement("div",{ref:M,className:q,dir:H.isRtl?"rtl":void 0,style:p,onMouseDown:I},a.ZP.createElement("div",{className:(0,i.Z)("ListItem-button",S&&"active"),role:"button",ref:n,tabIndex:0,onClick:!y&&r.$b?Y:void 0,onMouseDown:j,onContextMenu:!y&&k?O:void 0},f&&a.ZP.createElement("i",{className:`icon-${f}`}),N&&a.ZP.createElement("div",{className:"multiline-item"},g),!N&&g,!Z&&!y&&E&&a.ZP.createElement(u.Z,null)),k&&void 0!==F&&a.ZP.createElement(m.Z,{isOpen:$,positionX:X,positionY:K,style:z,className:"ListItem-context-menu",autoClose:!0,onClose:R,onCloseAnimationEnd:D},k.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:()=>c});var a=n(4050),r=n(3716),s=n(1212),i=n(6752),o=n(3989),l=n(2898);const c=({message:e,duration:t=3e3,containerId:n,onDismiss:c})=>{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(c,150+r.fK)}),[c]);(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(l.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:l})=>{const c=s[t],d=c-4,u=c-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:l})}))},4434:(e,t,n)=>{n.d(t,{Z:()=>l});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:l,checked:c,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:l,value:o,id:e,checked:c,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))})),l=(0,a.X$)((({id:e,name:t,options:n,selected:r,disabled:s,loadingOption:i,onChange:l})=>{const c=(0,a.I4)((e=>{const{value:t}=e.currentTarget;l(t)}),[l]);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:c}))))}))},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:l,renderValue:c,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?l/(e.length-1)*100:(l-t)/((n-t)/i)*100),[e,l,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"},c?c(l):l)),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:l,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===l&&"active"),onClick:()=>u(t)},e))))))}))},9589:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(4050),r=n(6752),s=n(706),i=n(9107),o=n(2515),l=n(4288),c=n(231);const d=(0,a.X$)((({ref:e,children:t,parentContainerClassName:n,value:d,inputId:u,className:m,focused:h,isLoading:f,placeholder:v,disabled:p,autoComplete:g,canClose:Z,autoFocusSearch:E,onChange:P,onReset:y,onFocus:C,onBlur:b})=>{let N=(0,a.sO)(null);e&&(N=e);const[w,k,I]=(0,s.Z)(h);(0,o.Z)(N,E,I),(0,a.d4)((()=>{N.current&&(h?N.current.focus():N.current.blur())}),[h,v]);const T=(0,i.Z)(),M=(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",m,w&&"has-focus"),dir:T.isRtl?"rtl":void 0},t,a.ZP.createElement("input",{ref:N,id:u,type:"text",dir:"auto",placeholder:v||T("Search"),className:"form-control",value:d,disabled:p,autoComplete:g,onChange:function(e){const{currentTarget:t}=e;P(t.value)},onFocus:function(){k(),C&&C()},onBlur:function(){I(),b&&b()},onKeyDown:M}),a.ZP.createElement("i",{className:"icon-search"}),f&&a.ZP.createElement(l.Z,null),!f&&(d||Z)&&y&&a.ZP.createElement(c.Z,{round:!0,size:"tiny",color:"translucent",onClick:y},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:l,children:c})=>{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)(c),f=(0,a.sO)();return m&&!e&&(f.current=h),d&&a.ZP.createElement("div",{id:n,className:(0,i.Z)(o,u),onClick:l},e?c():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:l,noAnimation:c,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",l&&"inactive",c&&"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),l=n(9107),c=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:l})=>{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,c.Z)("Tab",e),onClick:()=>o(l),ref:h},a.ZP.createElement("span",null,(0,u.Z)(t),!!r&&a.ZP.createElement("span",{className:(0,c.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 c=(0,a.sO)(null),d=(0,i.Z)(t);(0,o.Z)(c.current),(0,a.d4)((()=>{const e=c.current,{scrollWidth:n,offsetWidth:a,scrollLeft:r}=e;if(n<=a)return;const i=e.childNodes[t];if(!i)return;const o=i.offsetLeft-a/2+i.offsetWidth/2;Math.abs(o-r)<16||(0,s.Z)(e,o,f)}),[t]);const u=(0,l.Z)();return a.ZP.createElement("div",{className:"TabList no-selection no-scrollbar "+(n?"big":""),ref:c,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:()=>h});var a=n(4050),r=n(5116),s=n(6752),i=n(2972),o=n(1279),l=n(5326),c=n(7204),d=n(8674);const u=Symbol("CLEANED_UP"),m="Transition__slide--active",h=({ref:e,activeKey:t,name:n,direction:h="auto",renderCount:f,shouldRestoreHeight:v,shouldCleanup:p,cleanupExceptionKey:g,id:Z,className:E,onStart:P,onStop:y,children:C})=>{const{animationLevel:b}=(0,r.Rd)().settings.byKey,N=(0,a.sO)();let w=(0,a.sO)(null);e&&(w=e);const k=(0,a.sO)({}),I=(0,c.Z)(t),T=(0,l.Z)(),M=void 0!==I&&t!==I;!f&&M&&(k.current={[I]:k.current[I]}),k.current[t]=C,(0,a.bt)((()=>{function e(){!p||void 0!==g&&g===I||(k.current={[I]:u},T())}const a=w.current,r=a.children;if(1===r.length&&!M)return n.startsWith("slide-optimized")&&(r[0].style.transform="translate3d(0, 0, 0)"),void r[0].classList.add(m);const s=Array.from(a.childNodes);if(!M||!s.length)return;N.current=t;const l=-1===h||"auto"===h&&I>t||"inverse"===h&&I<t,c=Object.keys(k.current).map(Number),Z=f?I:c.indexOf(I),E=f?t:c.indexOf(t);if("slide-optimized"===n||"slide-optimized-rtl"===n)return void function(e,t,n,a,r,s,l,c,u,h,f){if(!f||!h)return;"slide-optimized-rtl"===e&&(t=!t);const v=(0,d.YW)();requestAnimationFrame((()=>{null==c||c(),f.style.transition="none",f.style.transform="translate3d(0, 0, 0)",h.style.transition="none",h.style.transform=`translate3d(${t?"-":""}100%, 0, 0)`,(0,i.Z)(h),f.style.transition="",f.style.transform=`translate3d(${t?"":"-"}100%, 0, 0)`,h.style.transition="",h.style.transform="translate3d(0, 0, 0)",f.classList.remove(m),h.classList.add(m),(0,o.L)(f,(()=>{a===r.current&&(f.style.transition="none",f.style.transform="",l&&(h.style.height="auto",s.style.height=`${h.clientHeight}px`),null==u||u(),v(),n())}))}))}(n,l,e,t,N,a,v,P,y,s[E],s[Z]);if(a.classList.remove("animating"),a.classList.toggle("backwards",l),"none"===n||0===b)return s.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle(m,t===E))})),void e();s.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove(m),e.classList.toggle("from",t===Z),e.classList.toggle("through",t>Z&&t<E||t<Z&&t>E),e.classList.toggle("to",t===E))}));const C=(0,d.YW)();requestAnimationFrame((()=>{var r;function i(){requestAnimationFrame((()=>{if(t===N.current){if(a.classList.remove("animating","backwards"),s.forEach(((e,t)=>{e instanceof HTMLElement&&(e.classList.remove("from","through","to"),e.classList.toggle(m,t===E))})),v){const e=a.querySelector(`.${m}`);e&&(e.style.height="auto",a.style.height=`${e.clientHeight}px`)}null==y||y(),C(),e()}}))}a.classList.add("animating"),null==P||P();const c="mv-slide"===n?null===(r=s[E])||void 0===r?void 0:r.firstChild:"reveal"===n&&l?s[Z]:s[E];c?(0,o.f)(c,i):i()}))}),[t,I,M,h,n,P,y,f,v,p,g,b,T]),(0,a.bt)((()=>{if(v){const e=w.current,t=e.querySelector(`.${m}`)||e.querySelector(".from");t&&(t.style.height="auto",e.style.height=`${t.clientHeight}px`,e.style.flexBasis=`${t.clientHeight}px`)}}),[v,C]);const S=k.current,x=Object.keys(f?new Array(f).fill(void 0):S).map(Number).map((e=>{const n=S[e];return"function"==typeof n?a.ZP.createElement("div",{key:e,teactOrderKey:e},n(e===t,e===I,t)):void 0}));return a.ZP.createElement("div",{ref:w,id:Z,className:(0,s.Z)("Transition",E,n),teactFastList:!f&&!p},x)}},3455:(e,t,n)=>{n.d(t,{fi:()=>s,Yy:()=>i,vb:()=>c,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"],l=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function c(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,l);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,l)};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,l),...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),l=n(9290),c=n(4532);const d=(e,t,n,d,u,m,h,f=!1,v,p,g=!1,Z=!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,l.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,c.N)(m,function(e){let t={};if(e&&e.current){const{play:n,pause:a,setCurrentTime:s,proxy:i,requestNextTrack:o,requestPreviousTrack:l,isFirst:c,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()}),c()||(t.previoustrack=()=>{l()})}return t}(E)),(0,c.pC)("playing"),e((0,r.Rd)().audioPlayer.volume),a(!!(0,r.Rd)().audioPlayer.isMuted),"voice"===n&&t((0,r.Rd)().audioPlayer.playbackRate),(0,c.NS)({duration:s.duration||0,playbackRate:s.playbackRate,position:s.currentTime});break}case"onRateChange":{const{proxy:e}=E.current;(0,c.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":y(!1),(0,c.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=E.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;Z||N(e.currentTime/n);break}case"onEnded":(0,c.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,c.Ym)(m)}),[m,P]);const{play:k,pause:I,setCurrentTime:T,proxy:M,destroy:S,setVolume:x,stop:L,isFirst:$,isLast:F,requestNextTrack:A,requestPreviousTrack:O,setPlaybackRate:R,toggleMuted:D}=E.current,U=M.duration&&Number.isFinite(M.duration)?M.duration:t;(0,a.d4)((()=>{!U||(0,o.z)(M)||Z||N(M.currentTime/U)}),[U,b,M,Z]),(0,a.d4)((()=>()=>{S(g)}),[S,g]),(0,i.Z)((([e,t])=>{e===f&&d===t||M.src&&M.paused||f&&d&&!P&&k(d)}),[f,d,P,k,M.src,M.paused]);const B=(0,a.I4)((()=>{d&&k(d)}),[d,k]),V=(0,a.I4)((()=>{P?I():B()}),[I,B,P]),X=(0,a.I4)((e=>{T(e),U&&N(M.currentTime/U)}),[U,M,T]);return{isPlaying:C,playProgress:b,playPause:V,pause:I,play:B,stop:L,setCurrentTime:X,setVolume:x,audioProxy:M,duration:U,requestNextTrack:A,requestPreviousTrack:O,isFirst:$,isLast:F,setPlaybackRate:R,toggleMuted:D}}},2937:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(4050),r=n(6264),s=n(9290),i=n(1394),o=n(5326);const l=new Map;function c(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 c=function(e,t=!1,n){const s=(0,a.sO)(e?l.get(e):void 0),c=(0,a.sO)(),d=(0,o.Z)();return c.current&&t&&(clearTimeout(c.current),c.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(),l.size>=1e3&&l.clear(),l.set(e,n)},n?c.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&&c||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),l=(0,a.Ye)((()=>(0,r.Ds)(n,200,!1,!0)),[]),c=(0,a.I4)((e=>{const t=e.currentTarget;(0,s.z)(t)||(t.buffered.length&&o(t.buffered.end(0)/t.duration),l(t.readyState>=3||t.currentTime>0))}),[l]);return{isBuffered:t,bufferedProgress:i,bufferingHandlers:{onLoadedData:c,onPlaying:c,onLoadStart:c,onPause:c,onTimeUpdate:c,onProgress:c},checkBuffering(e){l(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),l=(0,s.Z)();return(0,a.d4)((()=>{const a=o.current;if(!e||!a||t)return;const s=new Image,l=()=>{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(l):l()},s.src=e}),[o,e,l,t,n]),o}},1470:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(4050),r=n(5116),s=n(2858),i=n(782),o=n(9107);const l=({chat:e,user:t,handleDelete:n,handleChatFolderChange:l,folderId:c,isPinned:d,isMuted:u},m=!1)=>{const h=(0,o.Z)(),{isSelf:f}=t||{};return(0,a.Ye)((()=>{if(!e)return;const{toggleChatPinned:t,updateChatMutedState:a,toggleChatArchived:o,toggleChatUnread:v}=(0,r.uC)(),p={title:h("ChatList.Filter.AddToFolder"),icon:"folder",handler:l},g=d?{title:h("UnpinFromTop"),icon:"unpin",handler:()=>t({id:e.id,folderId:c})}:{title:h("PinToTop"),icon:"pin",handler:()=>t({id:e.id,folderId:c})};if(m)return[g,p];const Z=e.unreadCount||e.hasUnreadMark?{title:h("MarkAsRead"),icon:"readchats",handler:()=>v({id:e.id})}:{title:h("MarkAsUnread"),icon:"unread",handler:()=>v({id:e.id})},E=u?{title:h("ChatList.Unmute"),icon:"unmute",handler:()=>a({chatId:e.id,isMuted:!1})}:{title:h("ChatList.Mute"),icon:"mute",handler:()=>a({chatId:e.id,isMuted:!0})},P=(0,s.pE)(e)?{title:h("Unarchive"),icon:"unarchive",handler:()=>o({id:e.id})}:{title:h("Archive"),icon:"archive",handler:()=>o({id:e.id})},y={title:(0,s.YC)(e.id)?h("Delete"):h((0,s.cc)(e)?"DeleteChat":(0,s.eA)(e)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:n},C=void 0!==c;return(0,i.oA)([p,Z,g,!f&&E,!f&&!C&&P,y])}),[e,h,l,d,m,u,n,c,f])}},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,l]=(0,a.eJ)(!1),[c,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(),c||(l(!0),d({x:e.clientX,y:e.clientY})))}),[t,n,c]),h=(0,a.I4)((()=>{l(!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];c||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"),l(!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)}}),[c,t,i,e,n]),{isContextMenuOpen:o,contextMenuPosition:c,handleBeforeContextMenu:u,handleContextMenu:m,handleContextMenuClose:h,handleContextMenuHide:f}}},3394:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=(e,t,n,r,s=0,i=0)=>{const[o,l]=(0,a.eJ)("right"),[c,d]=(0,a.eJ)("bottom"),[u,m]=(0,a.eJ)(!1),[h,f]=(0,a.eJ)(""),[v,p]=(0,a.eJ)("");return(0,a.d4)((()=>{const a=t();if(!e||!a)return;let{x:o,y:c}=e;const u={width:0,left:0,height:0,top:0},h=r(),v=n(),g=a.getBoundingClientRect(),Z=h?{width:h.offsetWidth,height:h.offsetHeight}:u,E=v?v.getBoundingClientRect():u;let P;o+Z.width+s<E.width+E.left?(o+=3,P="left"):o-Z.width>0?(P="right",o-=3):(P="left",o=16),l(P),c+Z.height<E.height+E.top?d("top"):(d("bottom"),c-Z.height<E.top+i&&(c=E.top+E.height));const y="left"===P?Math.min(o-g.left,E.width-Z.width-16):Math.max(o-g.left,Z.width+16),C=Math.min(E.height-g.top+g.height-12,c-g.top),b=E.height-12;m(b<Z.height),p(`max-height: ${b}px;`),f(`left: ${y}px; top: ${C}px`)}),[e,s,i,r,n,t]),{positionX:o,positionY:c,style:h,menuStyle:v,withScroll:u}}},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)(),l=(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&&l()}))}},8781:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(4050);const r=(e,t)=>{(0,a.d4)((()=>{if(e)return e.addEventListener("wheel",t,{passive:!0}),()=>{e.removeEventListener("wheel",t)};function t(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:()=>l});var a=n(4050),r=n(9118),s=n(8674);function i({rootRef:e,throttleMs:t,debounceMs:n,shouldSkipFirst:i,margin:o,threshold:l,isDisabled:c},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(!c)return()=>{u.current&&(u.current.observer.disconnect(),u.current.callbacks.clear(),u.current=void 0)}}),[c]),{observe:(0,a.I4)(((a,s)=>{u.current||function(){const a=new Map,s=new Map,c=()=>{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(c,t||n,!i):c,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:l});u.current={observer:p,callbacks:a}}();const c=u.current;return c.observer.observe(a),s&&c.callbacks.set(a,s),()=>{s&&c.callbacks.delete(a),c.observer.unobserve(a)}}),[c]),freeze:v,unfreeze:p}}function o(e,t,n){(0,a.d4)((()=>t?t(e.current,n):void 0),[])}function l(e,t,n){const[r,s]=(0,a.eJ)(!t);return o(e,t,(e=>{s(e.isIntersecting),n&&n(e)})),r}},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),l=n(5326),c=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,l.Z)(),g=(()=>{const e=(0,a.sO)();return e.current||(e.current=(0,c.Z)(d),d[e.current]=!0),e.current})(),[Z,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,g).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,g]),(0,a.d4)((()=>{t&&P.current&&(o.cC(y),E(0),P.current=void 0)}),[y,t]),(0,a.d4)((()=>()=>{e&&o.Iq(e,g)}),[g,e]),{mediaData:f,loadProgress:Z}}},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);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])]}},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)(),l=(0,s.Z)(),c=null!=e,d=null!=n;return c&&o.current&&(clearTimeout(o.current),o.current=void 0),(0,i.Z)((()=>{t&&!c&&d&&!o.current&&(o.current=window.setTimeout((()=>{o.current=void 0,l()}),t))}),[e]),o.current&&t&&!c?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)))}),[])]}},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,l){if(Number.isNaN(o)||o<1)return;o|=0,Number.isNaN(l)&&(l=1),(l|=0)>3&&(l=3),l<1&&(l=1);const c=e.getImageData(t,n,s,i),d=c.data;let u,m,h,f,v,p,g,Z,E,P,y,C,b=s-1,N=i-1,w=o+1,k=[],I=[],T=[],M=a[o],S=r[o],x=[],L=[];for(;l-- >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++)g=C+((p>b?b:p)<<2),u+=d[g++],m+=d[g++],h+=d[g++];for(f=0;f<s;f++)k[y]=u,I[y]=m,T[y]=h,0==v&&(x[f]=((g=f+w)<b?g:b)<<2,L[f]=(g=f-o)>0?g<<2:0),Z=C+x[f],E=C+L[f],u+=d[Z++]-d[E++],m+=d[Z++]-d[E++],h+=d[Z++]-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*M>>>S,d[y+1]=m*M>>>S,d[y+2]=h*M>>>S,0==f&&(x[v]=((g=v+w)<N?g:N)*s,L[v]=(g=v-o)>0?g*s:0),Z=f+x[v],E=f+L[v],u+=k[Z]-k[E],m+=I[Z]-I[E],h+=T[Z]-T[E],y+=s<<2}}e.putImageData(c,t,n)}},396:(e,t,n)=>{n.d(t,{Es:()=>p,z2:()=>g,An:()=>E});var a=n(5116),r=n(1713),s=n(7361),i=n(4753),o=n(5266),l=n(2858),c=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=Z(e,(0,a.Rd)().audioPlayer.origin||r.Cr.Inline,t);if(!s)return;if(!u.has(s))return void(0,a.uC)().openAudioPlayer((0,l.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 g(e,t,n,p,g){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,g);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 c=m&&u.get(m);c&&m!==e&&(c.audio.pause(),c.audio.currentTime=0,(0,o.z)(c.audio)&&(c.audio.dataset.preventPlayAfterPatch="true"),c.onTrackChange&&c.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,l.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,c.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:()=>!Z(e,(0,a.Rd)().audioPlayer.origin),isFirst:()=>!Z(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 Z(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,l.Ak)(P(e).messageKey),i=a.filter((e=>e.startsWith(`msg${s}`))),o=i.indexOf(e);if(o<0)return;let c=t===r.Cr.Inline?-1:1;return n&&(c*=-1),i[o+c]}function E(e){return`${(0,l.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,{e:()=>r,s:()=>l});var a=n(7361);let r;function s(e,t){return t?Math.sqrt((t.pageX-e.pageX)**2+(t.pageY-e.pageY)**2):0}function i(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(r||(r={}));let o=0;function l(e,t){let n,l,c=!1,d=!1,u=0,m={x:window.innerWidth/2,y:window.innerHeight/2};function h(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(n=e,"mousedown"===e.type)document.addEventListener("mousemove",v),document.addEventListener("mouseup",f),t.onDoubleClick&&Date.now()-o<300&&t.onDoubleClick(e,{centerX:e.pageX,centerY:e.pageY}),o=Date.now();else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",v,{passive:!0}),t.addEventListener("touchend",f),t.addEventListener("touchcancel",f),"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&&(u=s(e.touches[0],e.touches[1]),m=i(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 f(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.body.classList.remove("no-selection"),document.removeEventListener("mouseup",f),document.removeEventListener("mousemove",v),n.target.removeEventListener("touchcancel",f),n.target.removeEventListener("touchend",f),n.target.removeEventListener("touchmove",v),n=void 0,a.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),c?t.onRelease&&t.onRelease(e):!t.onClick||"button"in e&&0!==e.button||t.onClick(e)),c=!1,d=!1,u=0,l=void 0,m={x:window.innerWidth/2,y:window.innerHeight/2}}function v(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&&u>0&&2===e.touches.length)){const n=s(e.touches[0],e.touches[1]),a=i(e.touches[0],e.touches[1]),r=a.x-m.x,o=a.y-m.y,l=n/u;t.onZoom(e,{zoomFactor:l,initialCenterX:m.x,initialCenterY:m.y,dragOffsetX:r,dragOffsetY:o,currentCenterX:a.x,currentCenterY:a.y}),1!==l&&(c=!0)}const o=e.pageX-n.pageX,h=e.pageY-n.pageY;(Math.abs(o)>=15||Math.abs(h)>=15)&&(c=!0);let f=!1;t.onDrag&&(t.onDrag(e,n,{dragOffsetX:o,dragOffsetY:h}),f=!0),t.onSwipe&&!d&&(d=function(e,n,s){if(a.cj){const t=e.touches[0].pageX;if(t<=20||t>=window.innerWidth-20)return!1}const i=Math.abs(n),o=Math.abs(s);if(n&&s&&Math.max(i,o)/Math.min(i,o)<2)return!1;let c;if(i>=50?c="x":o>=50&&(c="y"),!c)return!1;if(l){if(l!==c)return!1}else l=c;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,c,n,s,t.onSwipe)}(e,o,h),f=d),a.cj&&f&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}return e.addEventListener("mousedown",h),e.addEventListener("touchstart",h,{passive:!t.isNotPassive}),()=>{e.removeEventListener("mousedown",h),e.removeEventListener("touchstart",h)}}},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:()=>c,N:()=>d});var a=n(5116),r=n(1713),s=n(3716),i=n(8674),o=n(9933);let l=!1;function c(e,t,n,i=0,o=s.V$,l,c,d){const m=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,l);l!==r.fo.Static?((0,a.Rd)().settings.byKey.animationLevel===s.oB&&(c=0),u(e,t,m,n,i,c,d)):u(e,t,m,n,i,0)}function d(){return l}function u(e,t,n,a,r=0,c,d){const{offsetTop:u,offsetHeight:f}=t,{scrollTop:v,offsetHeight:p,scrollHeight:g}=e,Z=d&&e.dataset.normalHeight?Number(e.dataset.normalHeight):p;let E;switch(v!==n&&(e.scrollTop=n),a){case"start":E=u-r-n;break;case"end":E=u+f+r-(n+Z);break;case"nearest":case"center":case"centerOrTop":E=f<Z?u+f/2-(n+Z/2):u-r-n}if(E<0){const e=-n;E=Math.max(E,e)}else if(E>0){const e=g-(n+Z);E=Math.min(E,e)}if(0===E)return;const P=n+E;if(0===c)return void(e.scrollTop=P);l=!0;const y=Math.abs(E),C=y<s.xn?h:m,b=c||s.bK+y/s.V$*(s.ck-s.bK),N=Date.now(),w=(0,i.YW)();(0,o.cK)((()=>{const t=Math.min((Date.now()-N)/b,1),n=E*(1-C(t));return e.scrollTop=Math.round(P-n),l=t<1,l||w(),l}))}function m(e){return 1-(1-e)**5}function h(e){return 1-(1-e)**3.5}},1367:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(5116),r=n(3716),s=n(9933);function i(e,t,n=300){(0,a.Rd)().settings.byKey.animationLevel===r.oB&&(n=0),function(e,t,n){const{scrollLeft:a,offsetWidth:r,scrollWidth:i}=e;let o=t-a;if(o<0){const e=-a;o=Math.max(o,e)}else if(o>0){const e=i-(a+r);o=Math.min(o,e)}if(0===o)return;const l=a+o;if(0===n)return void(e.scrollLeft=l);const c=Date.now();(0,s.jt)((()=>{const t=Math.min((Date.now()-c)/n,1),a=o*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(l-a),t<1}))}(e,t,n)}},5723:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(7361);function r(e,t){if(!t&&e===document.activeElement)return;const n=window.getSelection(),r=document.createRange(),s=e.lastChild||e;a.$b||s&&s.nodeValue?(r.selectNodeContents(s),r.collapse(!1),n.removeAllRanges(),n.addRange(r)):e.focus()}},2972:(e,t,n)=>{function a(e){e.offsetWidth}n.d(t,{Z:()=>a})},4532:(e,t,n)=>{n.d(t,{N:()=>r,Ym:()=>s,Ay:()=>o,pC:()=>l,NS:()=>c,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 l(e="none"){const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function c(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(/<\/?span([^>]*)?>/g,""),t=t.replace(/ /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}(e);const n=t.innerText.trim().replace(/\u200b+/g,"");let i=0,o=0;const l=[];function c(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,l=t.substring(0,o).length,{length:c}=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:l,length:c,...d&&{url:d},...u&&{userId:u}}}}(e,n,i);r?(i=t,l.push(r)):e.textContent&&(i+=e.textContent.length),e.hasChildNodes()&&o<=3&&(o+=1,Array.from(e.childNodes).forEach(c))}return Array.from(t.childNodes).forEach((e=>{o=1,c(e)})),{text:n,entities:l.length?l: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})}}]);
|
||
//# sourceMappingURL=519.fa7aa4ba0de60a4347b8.js.map
|