TelegramPWA/dist/7377.d48dd0ca726e44faecb6.js
Alexander Zinchuk fb277d2411 [Build]
2023-09-28 01:58:39 +02:00

2 lines
250 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

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

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

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[7377],{4794:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(60748),a=n(33555),i=n(7054),r=n(42431),s=n(46752),c=n(18360),l=n(59107),d=n(31212),u=n(70172),m=n(231);const h=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n}=t;const o=(0,i.Z1J)(e,n),a=(0,r.Bj)(e,n);return{groupCall:a,isActive:((0,i.jUK)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==a?.id&&Boolean(a?a.participantsCount>0&&a.isLoaded:o&&o.isCallNotEmpty&&o.isCallActive)}}))((e=>{let{chatId:t,isActive:n,className:i,groupCall:r,hasPinnedOffset:h}=e;const{requestMasterAndJoinGroupCall:p,subscribeToGroupCallUpdates:g}=(0,a.Sv)(),Z=(0,l.Z)(),f=(0,o.I4)((()=>{p({chatId:t})}),[p,t]),v=r?.participants,P=(0,o.Ye)((()=>{if(!v)return[];const e=(0,a.Rd)().users.byId,t=(0,a.Rd)().chats.byId;return Object.values(v).slice(0,3).map((n=>{let{id:o}=n;return e[o]||t[o]})).filter(Boolean)}),[v]);(0,o.d4)((()=>{if(r?.id&&(n||!r.isLoaded))return g({id:r.id,subscribed:!0}),()=>{g({id:r.id,subscribed:!1})}}),[r?.id,r?.isLoaded,n,g]);const{shouldRender:E,transitionClassNames:y}=(0,d.Z)(Boolean(r&&n)),b=(0,c.Z)(r?.participantsCount,!0),C=(0,c.Z)(P,!0);if(E)return o.ZP.createElement("div",{className:(0,s.Z)("GroupCallTopPane",h&&"has-pinned-offset",i,y),onClick:f},o.ZP.createElement("div",{className:"info"},o.ZP.createElement("span",{className:"title"},Z("VoipGroupVoiceChat")),o.ZP.createElement("span",{className:"participants"},Z("Participants",null!=b?b:0,"i"))),o.ZP.createElement("div",{className:"avatars"},C?.map((e=>o.ZP.createElement(u.Z,{key:e.id,peer:e})))),o.ZP.createElement(m.Z,{round:!0,className:"join"},Z("VoipChatJoin")))})))},34076:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(60748),a=n(33555),i=n(7054),r=n(46752),s=n(60706),c=n(59107);const l=e=>{let{text:t,className:n}=e;const l=(0,c.Z)(),d=(0,o.sO)(),[u,m,h]=(0,s.Z)(!1),p=(0,i.FOo)((0,a.Rd)()),g=(0,o.Ye)((()=>{if(!p)return t;if(!u)return d.current||t;const e=d.current,n=[];for(let a=0;a<t.length;a++)e&&t[a]!==e[a]?n.push(o.ZP.createElement("div",{className:"LTqDt1MFKRDBjNZxKii4"},o.ZP.createElement("div",{className:"o1u1ctUWtWa2FWlC_BuT"},t[a]),o.ZP.createElement("div",{className:"tzggk5evL9EPqVAtvWEu",onAnimationEnd:h},e[a]),o.ZP.createElement("div",{className:"q6poDASGW35qQiXsD99c",onAnimationEnd:h},t[a]))):n.push(o.ZP.createElement("span",null,t[a]));return d.current=t,n}),[p,u,t]);return(0,o.d4)((()=>{m()}),[t]),o.ZP.createElement("span",{className:(0,r.Z)("Tx2CpCmpZZrHnCMUksg2",n),dir:l.isRtl?"rtl":void 0},g)}},45601:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(60748),a=n(6137),i=n(4463),r=n(6202),s=n(21179);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},c.apply(this,arguments)}const l=(0,o.X$)((function(e){const{sticker:t,noLoad:n,forcePreview:l,...d}=e,u=t?.thumbnail?.dataUri,m=t&&`sticker${t.id}`,h=(0,r.Z)(t?(0,i.RK)(t.id):void 0,n&&!l,a.IU.BlobUrl),p=(0,r.Z)(m,n);return o.ZP.createElement(s.Z,c({tgsUrl:p,previewUrl:h,thumbDataUri:u},d))}))},21179:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(60748),a=n(46752),i=n(80036),r=n(60706),s=n(25190),c=n(70692),l=n(58912);const d="gp5OwinzPeHwkesmaEIR";function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},u.apply(this,arguments)}const m=new Set,h=(0,o.X$)((function(e){const{previewUrl:t,thumbDataUri:n,className:h,...p}=e,[g,,Z]=(0,r.Z)(Boolean(n)),f=(0,c.Z)(g),[v,P,E]=(0,r.Z)(m.has(t)),y=(0,c.Z)(v),[b,C]=(0,r.Z)(!1),w=(0,s.Z)((()=>{P(),m.add(t)})),S=(0,s.Z)((()=>{Z(),E(),setTimeout(C,300)})),{size:N}=e;return o.ZP.createElement("div",{className:(0,a.Z)(h,"oGmd77AsTbJeJk8CV6gl"),style:(0,i.Z)(void 0!==N&&`width: ${N}px; height: ${N}px;`)},n&&!b&&o.ZP.createElement("img",{src:n,className:(0,a.Z)(d,f),draggable:!1}),t&&!b&&o.ZP.createElement("img",{src:t,className:(0,a.Z)(d,y),draggable:!1,onLoad:w}),o.ZP.createElement(l.Z,u({},p,{onLoad:S})))}))},54752:(e,t,n)=>{n.d(t,{ZP:()=>A});var o=n(60748),a=n(33555),i=n(6137),r=n(91713),s=n(4463),c=n(10396),l=n(46752),d=n(64963),u=n(790);function m(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const o=Array(n),a=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),i=a[t]+(a[t+1]<<8);o[e]=i>>n&31}const i=Math.floor(5*(n-1)/8),r=Math.floor(5*(n-1)%8),s=a[i]+(a[i+1]<<8);return o[n-1]=s>>r&31,o}function h(e,t){let n=0;const o=new Array(t),a=e.length/t,i=e[0],r=e[e.length-1];for(let d=0;d<t;d++){var s,c,l;const t=Math.floor(d*a),u=((null!==(s=e[t-1])&&void 0!==s?s:i)+(null!==(c=e[t])&&void 0!==c?c:i)+(null!==(l=e[t+1])&&void 0!==l?l:r))/3;o[d]=u,n<u&&(n=u)}return{data:o,peak:n}}var p=n(15376),g=n(32340);function Z(e,t,n,o){let{peak:a,fillStyle:i,progressFillStyle:r}=o;const s=4*t.length;e.width=2*s,e.height=46,e.style.width=`${s}px`,e.style.height="23px";const c=e.getContext("2d");c.scale(2,2),t.forEach(((e,o)=>{c.globalAlpha=o/t.length>=n?.5:1,c.fillStyle=n>o/t.length?r:i;const s=Math.max(2,e/Math.max(1,a)*23);!function(e,t,n,o,a,i){2<2*i&&(i=1),a<2*i&&(i=a/2),e.beginPath(),e.moveTo(t+i,n),e.arcTo(t+2,n,t+2,n-a,i),e.arcTo(t+2,n-a,t,n-a,i),e.arcTo(t,n-a,t,n,i),e.arcTo(t,n,t+2,n,i),e.closePath()}(c,4*o,(23+s)/2,0,s,1),c.fill()}))}var f=n(42797),v=n(23186),P=n(12019),E=n(59107),y=n(25190),b=n(6202),C=n(6701),w=n(31212),S=n(231),N=n(8337),I=n(39196);const M=window.matchMedia("(max-width: 375px)"),k=window.matchMedia("(max-width: 410px)");function x(e,t){return{MIN_SPIKES:e?M.matches?16:20:25,MAX_SPIKES:e?M.matches?35:t&&k.matches?40:45:75}}function T(e,t,n){return o.ZP.createElement("div",{className:"seekline",ref:n},t.map((e=>{let{start:t,end:n}=e;return o.ZP.createElement("div",{className:"seekline-buffered-progress",style:`left: ${100*t}%; right: ${100-100*n}%`})})),o.ZP.createElement("span",{className:"seekline-play-progress"},o.ZP.createElement("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})),o.ZP.createElement("span",{className:"seekline-thumb"},o.ZP.createElement("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})))}const A=(0,o.X$)((e=>{let{theme:t,message:n,senderTitle:M,uploadProgress:k,origin:A,date:R,noAvatars:O,className:L,isSelectable:D,isSelected:F,isDownloading:B,isTranscribing:U,isTranscriptionHidden:$,isTranscribed:j,isTranscriptionError:H,canDownload:_,canTranscribe:z,onHideTranscription:Y,onPlay:V,onReadMedia:X,onCancelUpload:q,onDateClick:W}=e;const{cancelMessageMediaDownload:G,downloadMessageMedia:K,transcribeAudio:J}=(0,a.Sv)(),{content:{audio:Q,voice:ee,video:te},isMediaUnread:ne}=n,oe=Boolean(ee||te),ae=(0,o.sO)(!1),ie=(0,o.sO)(null),re=(0,E.Z)(),{isRtl:se}=re,{isMobile:ce}=(0,f.ZP)(),[le,de]=(0,o.eJ)(!1),ue=le||!0,me=(0,s.Ti)(n,"pictogram"),he=(0,b.Z)(me,!1,i.IU.BlobUrl),pe=(0,b.Z)((0,s.Ti)(n,"inline"),!ue,(0,s.kG)(n,"inline")),{loadProgress:ge}=(0,C.Z)((0,s.Ti)(n,"download"),!B,(0,s.kG)(n,"download")),Ze=(0,y.Z)((()=>{de(!0),V(n.id,n.chatId)})),fe=(0,y.Z)((()=>{de(!1)})),{isBuffered:ve,bufferedRanges:Pe,bufferingHandlers:Ee,checkBuffering:ye}=(0,P.Z)(),{isPlaying:be,playProgress:Ce,playPause:we,setCurrentTime:Se,duration:Ne}=(0,v.Z)((0,c.An)(n),(0,s.XV)(n),oe?"voice":"audio",pe,Ee,void 0,ye,le,Ze,fe,(0,s.CI)(n)),Ie=(0,s.B4)(n),Me=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const s=(0,o.sO)(null),{data:c,peak:l}=(0,o.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{MIN_SPIKES:o,MAX_SPIKES:a}=x(r,i),s=Math.min(n/10,1),c=Math.round(o+(a-o)*s);return h(m(new Uint8Array(e)),c)}),[r,t,i])||{};return(0,o.bt)((()=>{const t=s.current;t&&c&&void 0!==l&&Z(t,c,n,{peak:l,fillStyle:a?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:a?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[a,l,n,c,e]),s}(t,ee,ne&&!Ie?1:Ce,Ie,!O,ce),ke=be||Ce>0&&Ce<1;(0,o.d4)((()=>{de(be)}),[be]);const xe=le&&!ve,{isUploading:Te,isTransferring:Ae,transferProgress:Re}=(0,s.Sc)(n,k||ge,xe||B),{shouldRender:Oe,transitionClassNames:Le}=(0,w.Z)(Ae),De=Oe&&(xe||Te),Fe=(0,y.Z)((()=>{Te?q?.():(be||V(n.id,n.chatId),(0,a.Sv)().setAudioPlayerOrigin({origin:A}),de(!le),we())}));(0,o.d4)((()=>{X&&ne&&(be||B)&&X()}),[be,ne,X,B]);const Be=(0,y.Z)((()=>{B?G({message:n}):K({message:n})})),Ue=(0,y.Z)((e=>{if(ae.current&&ie.current){const{width:t,left:n}=ie.current.getBoundingClientRect(),o=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Se(Math.max(Math.min(Ne*((o-n)/t),Ne-.1),.001))}})),$e=(0,y.Z)((e=>{e instanceof MouseEvent&&2===e.button||(ae.current=!0,Ue(e))})),je=(0,y.Z)((()=>{ae.current=!1})),He=(0,y.Z)((()=>{W(n.id,n.chatId)})),_e=(0,y.Z)((()=>{J({chatId:n.chatId,messageId:n.id})}));function ze(){if(oe)return M||"Voice";const{title:e,fileName:t}=Q;return e||t}(0,o.d4)((()=>{if(ie.current&&ke)return(0,d.sf)(ie.current,{onCapture:$e,onRelease:je,onClick:je,onDrag:Ue})}),[ke,$e,Ue,je]);const Ye=(0,l.Z)("Audio",L,A===r.Cr.Inline&&"inline",Ie&&A===r.Cr.Inline&&"own",(A===r.Cr.Search||A===r.Cr.SharedMedia)&&"bigger",F&&"audio-is-selected"),Ve=["toggle-play"];De?Ve.push("loading"):Ve.push(be?"pause":"play");const Xe=(0,l.Z)("content",ke&&"with-seekline");function qe(){return o.ZP.createElement("div",{className:Xe},o.ZP.createElement("div",{className:"content-row"},o.ZP.createElement("p",{className:"title",dir:"auto",title:ze()},(0,g.Z)(ze())),o.ZP.createElement("div",{className:"message-date"},Boolean(R)&&o.ZP.createElement(N.Z,{className:"date",onClick:He},(0,u.VX)(re,1e3*R)))),ke&&o.ZP.createElement("div",{className:"meta search-result",dir:se?"rtl":void 0},o.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},Ce<1&&`${(0,u.k9)(Ne*Ce,Ne)}`),T(Ce,Pe,ie)),!ke&&function(){if(oe)return o.ZP.createElement("div",{className:"meta",dir:se?"rtl":void 0},(0,u.k9)((ee||te).duration));const{performer:e}=Q;return o.ZP.createElement("div",{className:"meta",dir:se?"rtl":void 0},(0,u.k9)(Ne),o.ZP.createElement("span",{className:"bullet"},"•"),e&&o.ZP.createElement("span",{className:"performer",title:e},(0,g.Z)(e)),e&&M&&o.ZP.createElement("span",{className:"bullet"},"•"),M&&o.ZP.createElement("span",{title:M},(0,g.Z)(M)))}())}return o.ZP.createElement("div",{className:Ye,dir:re.isRtl?"rtl":"ltr"},D&&o.ZP.createElement("div",{className:"message-select-control"},F&&o.ZP.createElement("i",{className:"icon icon-select"})),o.ZP.createElement(S.Z,{round:!0,ripple:!ce,size:"smaller",color:he?"translucent-white":"primary",className:Ve.join(" "),ariaLabel:be?"Pause audio":"Play audio",onClick:Fe,isRtl:re.isRtl,backgroundImage:he},o.ZP.createElement("i",{className:"icon icon-play"}),o.ZP.createElement("i",{className:"icon icon-pause"})),Oe&&o.ZP.createElement("div",{className:(0,l.Z)("media-loading",Le,De&&"interactive")},o.ZP.createElement(I.Z,{progress:Re,transparent:!0,size:"m",onClick:De?Fe:void 0,noCross:!De})),Q&&_&&!Te&&o.ZP.createElement(S.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:B?"Cancel download":"Download",onClick:Be},o.ZP.createElement("i",{className:(0,l.Z)("icon",B?"icon-close":"icon-arrow-down")})),A===r.Cr.Search&&qe(),A!==r.Cr.Search&&Q&&function(e,t,n,a,i,r,s,c,l,d,m){const{title:h,performer:Z,fileName:f}=t,v=a||i>0&&i<1,{isRtl:P}=e;return o.ZP.createElement("div",{className:"content"},o.ZP.createElement("p",{className:"title",dir:"auto",title:h},(0,g.Z)(h||f)),v&&o.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},o.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,u.k9)(n*i,n)),T(i,r,s)),!v&&c&&o.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},d?`${(0,p.yW)(t.size*d)} / `:void 0,(0,p.yW)(t.size)),!v&&!c&&o.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},o.ZP.createElement("span",{className:"duration",dir:"auto"},(0,u.k9)(n)),Z&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"bullet"},"•"),o.ZP.createElement("span",{className:"performer",dir:"auto",title:Z},(0,g.Z)(Z))),Boolean(l)&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"bullet"},"•"),o.ZP.createElement(N.Z,{className:"date",onClick:m},(0,u.ZK)(e,1e3*l,!0)))))}(re,Q,Ne,be,Ce,Pe,ie,B||Te,R,Re,W?He:void 0),A===r.Cr.SharedMedia&&(ee||te)&&qe(),A===r.Cr.Inline&&ee&&function(e,t,n,a,i,r,s,c,d,m,h){return o.ZP.createElement("div",{className:"content"},o.ZP.createElement("div",{className:"waveform-wrapper"},o.ZP.createElement("div",{className:"waveform",draggable:!1,ref:t},o.ZP.createElement("canvas",{ref:n})),m&&o.ZP.createElement(S.Z,{onClick:()=>{(c||d)&&h?h(!s):r||m()}},o.ZP.createElement("i",{className:(0,l.Z)("transcribe-icon","icon",c||d?"icon-down":"icon-transcribe",(c||d)&&!s&&"transcribe-shown")}),r&&o.ZP.createElement("svg",{viewBox:"0 0 32 24",className:"loading-svg"},o.ZP.createElement("rect",{className:"loading-rect",fill:"transparent",width:"32",height:"24","stroke-width":"3","stroke-linejoin":"round",rx:"6",ry:"6",stroke:"var(--accent-color)","stroke-dashoffset":"1","stroke-dasharray":"32,68"})))),o.ZP.createElement("p",{className:(0,l.Z)("voice-duration",i&&"unread"),dir:"auto"},0===a?(0,u.k9)(e.duration):(0,u.k9)(e.duration*a)))}(ee,ie,Me,Ce,ne,U,$,j,H,z?_e:void 0,Y))}))},65351:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(46752),i=n(59107),r=n(70172);const s={root:"ahi3up0oMwlFJTE6hkxG","size-micro":"DOhAE8mniLY2g2i7rkfz",sizeMicro:"DOhAE8mniLY2g2i7rkfz","size-mini":"gF82cRdQRxqmTN8fLb9i",sizeMini:"gF82cRdQRxqmTN8fLb9i","size-tiny":"ecJbjvbrCkoUdtVrdBYi",sizeTiny:"ecJbjvbrCkoUdtVrdBYi","size-small":"iaKZOfQnH3hROD8QK_fq",sizeSmall:"iaKZOfQnH3hROD8QK_fq","size-small-mobile":"YP90v9JGup97HOcD2duf",sizeSmallMobile:"YP90v9JGup97HOcD2duf","size-medium":"TmYXjEqVbt0gwaoWlRHv",sizeMedium:"TmYXjEqVbt0gwaoWlRHv","size-large":"YIuShtdEPpbCXrGgmeFv",sizeLarge:"YIuShtdEPpbCXrGgmeFv","size-jumbo":"D9X7fMnC8YtoUm_wjoSA",sizeJumbo:"D9X7fMnC8YtoUm_wjoSA",avatar:"PTpUqAuoZL9Uou6MqJXX"},c=(0,o.X$)((e=>{let{peers:t,size:n,className:c}=e;const l=(0,i.Z)();return o.ZP.createElement("div",{className:(0,a.Z)(c,s.root,s[`size-${n}`]),dir:l.isRtl?"rtl":"ltr"},t?.map((e=>o.ZP.createElement(r.Z,{size:n,peer:e,className:s.avatar}))))}))},70180:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(33555),i=n(6137),r=n(83716),s=n(4463),c=n(7054),l=n(64319),d=n(6272),u=n(69118),m=n(3858),h=n(32340),p=n(59107),g=n(25190),Z=n(31876),f=n(83321);const v=(0,u.Ds)((e=>e()),500,!1),P=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatOrUserId:n}=t;const{countryList:{phoneCodes:o}}=e,a=n?(0,c.Z1J)(e,n):void 0,i=(0,s.YC)(n)?(0,c.dyD)(e,n):void 0,r=a?.isForum,l=a&&(0,s.i4)(a,(0,c.dZI)(e),(0,c.NJL)(e)),{threadId:d}=(0,c.Btg)(e)||{},u=r?d:void 0,m=a?(0,c.x67)(e,a.id)?.inviteLink:void 0;let h=i?(0,c.ccz)(e,i.id)?.bio:void 0;return!h&&a&&(h=(0,c.x67)(e,a.id)?.about),{phoneCodeList:o,chat:a,user:i,canInviteUsers:a&&!i&&(!(0,s.eA)(a)&&!(0,s.Mg)(a,"inviteUsers")||(0,s.VE)(a,"inviteUsers")),isMuted:l,topicId:u,chatInviteLink:m,description:h,topicLink:u?(0,c.Pn)(e,n,u):void 0}}))((e=>{let{user:t,chat:n,forceShowSelf:c,canInviteUsers:u,isMuted:P,phoneCodeList:E,topicId:y,description:b,chatInviteLink:C,topicLink:w}=e;const{loadFullUser:S,showNotification:N,updateChatMutedState:I,updateTopicMutedState:M,loadUserStories:k}=(0,a.Sv)(),{id:x,usernames:T,phoneNumber:A,isSelf:R}=t||{},{id:O,usernames:L}=n||{},D=(0,p.Z)(),[F,B]=(0,o.eJ)(!P);(0,o.d4)((()=>{B(!P)}),[P]),(0,o.d4)((()=>{x&&(S({userId:x}),k({userId:x}))}),[x]);const U=Boolean(y&&y!==i._f),$=(0,o.Ye)((()=>{const e=T?.filter((e=>e.isActive));return e?.length?e:void 0}),[T]),j=(0,o.Ye)((()=>{const e=t?void 0:L?.filter((e=>e.isActive));return e?.length?e:void 0}),[L,t]),H=(0,o.Ye)((()=>{if(n)return U?w:(0,s.hu)(n)||C}),[n,U,w,C]),_=(0,g.Z)((()=>{B((e=>{const t=!e;return v((()=>{U?M({chatId:O,topicId:y,isMuted:!t}):I({chatId:O,isMuted:!t})})),t}))}));if(!n||n.isRestricted||R&&!c)return;function z(e,t){(0,l.TE)(e),N({message:`${t} was copied`})}const Y=A&&(0,d.WZ)(E,A);function V(e,t){const[n,...a]=e,i=a.length?D("UsernameAlso","%USERNAMES%").split("%").map((e=>"USERNAMES"===e?o.ZP.createElement(o.ZP.Fragment,null,a.map(((e,n)=>{let{username:a}=e;const i=t?`${r.zHP}${a}`:`@${a}`;return o.ZP.createElement(o.ZP.Fragment,null,n>0?", ":"",o.ZP.createElement("a",{key:a,href:`${r.zHP}${a}`,onClick:e=>{(0,m.Z)(e),z(i,D(t?"Link":"Username"))},className:"text-entity-link username-link"},`@${a}`))}))):e)):void 0,s=t?`t.me/${n.username}`:n.username,c=t?`${r.zHP}${n.username}`:`@${n.username}`;return o.ZP.createElement(Z.Z,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>z(c,D(t?"Link":"Username"))},o.ZP.createElement("span",{className:"title",dir:"auto"},s),o.ZP.createElement("span",{className:"subtitle"},i&&o.ZP.createElement("span",{className:"other-usernames"},i),D(t?"Link":"Username")))}return o.ZP.createElement("div",{className:"ChatExtra"},Y&&Boolean(Y.length)&&o.ZP.createElement(Z.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>z(Y,D("Phone"))},o.ZP.createElement("span",{className:"title",dir:"auto"},Y),o.ZP.createElement("span",{className:"subtitle"},D("Phone"))),$&&V($),b&&Boolean(b.length)&&o.ZP.createElement(Z.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},o.ZP.createElement("span",{className:"title word-break allow-selection",dir:"auto"},(0,h.Z)(b,["br","links","emoji"])),o.ZP.createElement("span",{className:"subtitle"},D(x?"UserBio":"Info"))),j&&!U&&V(j,!0),(!j&&u||U)&&H&&o.ZP.createElement(Z.Z,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>z(H,D("SetUrlPlaceholder"))},o.ZP.createElement("div",{className:"title"},H),o.ZP.createElement("span",{className:"subtitle"},D("SetUrlPlaceholder"))),!c&&o.ZP.createElement(Z.Z,{icon:"unmute",ripple:!0,onClick:_},o.ZP.createElement("span",null,D("Notifications")),o.ZP.createElement(f.Z,{id:"group-notifications",label:x?"Toggle User Notifications":"Toggle Chat Notifications",checked:F,inactive:!0})))})))},73165:(e,t,n)=>{n.d(t,{Z:()=>Tt});var o=n(60748),a=n(33555),i=n(83716),r=n(57710),s=n(4463),c=n(7054),l=n(9211),d=n(46752),u=n(74288),m=n(790);function h(e){const t=document.createElement("div");t.contentEditable="true",t.style.position="absolute",t.style.left="-10000px",t.style.top="-10000px",t.innerHTML=e,t.className="allow-selection",document.body.appendChild(t);let n=t.lastChild;if(n.lastChild)for(;n.lastChild;)n=n.lastChild;const o=n.textContent.length,a=document.createRange(),i=window.getSelection();a.setStart(n,o),a.setEnd(n,o),i.removeAllRanges(),i.addRange(a),document.execCommand("delete",!1);const r=t.innerHTML;return document.body.removeChild(t),r}var p=n(65723),g=n(70735),Z=n(83099),f=n(41098),v=n(82267),P=n(97184),E=n(43858);let y;function b(e){y.focus(),e.focus()}P.cj&&(y=document.createElement("input"),y.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(y));var C=n(71394),w=n(93447);const S=/\.[^/.]+$/;async function N(e,t,o){const a=URL.createObjectURL(t),{type:r,size:s}=t;let c,l,d,u;if(i.oGt.has(r)){const n=await(0,C.pt)(a),{width:s,height:l}=n;u=!M(s,l);const m=Math.max(s,l)>1280,h=r===i.s11;if(!u){if(!o?.compressedBlobUrl&&!h&&(m||"image/jpeg"!==r)){const n=await(0,w.j)(a,m?1280/Math.max(s,l):1,"image/jpeg");return URL.revokeObjectURL(a),N(e,t,{compressedBlobUrl:n})}"image/jpeg"===r&&(e=e.replace(S,".jpg")),c={width:s,height:l}}d=Math.max(s,l)>40?await(0,w.j)(a,40/Math.max(s,l),"image/jpeg"):a}else if(i.wGh.has(r)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,C.jj)(a);u=!M(e,t),u||(c={width:e,height:t,duration:n})}catch(e){u=!0}d=await(0,C.ud)(a)}else if(i.e74.has(r)){const{duration:e,title:t,performer:o,coverUrl:i}=await async function(e){const{fetchFromUrl:t,selectCover:o}=await n.e(8505).then(n.t.bind(n,38505,23)),a=await t(e),{common:{title:i,artist:r,picture:s},format:{duration:c}}=a,l=o(s);return{title:i,performer:r,duration:c,coverUrl:l?`data:${l.format};base64,${l.data.toString("base64")}`:void 0}}(a);l={duration:e||0,title:t,performer:o},d=i}return{blobUrl:a,filename:e,mimeType:r,size:s,quick:c,audio:l,previewBlobUrl:d,shouldSendAsFile:u||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...o}}function I(e,t){return e.map((e=>t?e.compressedBlobUrl?{...e,blobUrl:e.compressedBlobUrl}:e:{...e,shouldSendAsFile:!e.voice||void 0,shouldSendAsSpoiler:void 0}))}function M(e,t){return Math.max(e,t)/Math.min(e,t)<=20}var k=n(44139),x=n(96391),T=n(32340),A=n(20230),R=n(17240),O=n(86203),L=n(274),D=n(60706),F=n(69156),B=n(62357),U=n(59107),$=n(25190),j=n(87204),H=n(33057),_=n(56389),z=n(31212),Y=n(33799),V=n(70971),X=n(34446),q=n(28183);function W(e){return e.shouldSendAsFile?"file":i.oGt.has(e.mimeType)?"image":i.wGh.has(e.mimeType)?"video":i.e74.has(e.mimeType)?"audio":"file"}var G=n(52400),K=n(11309),J=n(71790);const Q=/^\/([\w@]{1,32})?$/i;var ee=n(6137);const te=/id="docs-internal-guid/i,ne=["H1","H2","H3","H4","H5","H6"];function oe(e){return(new DOMParser).parseFromString(e,"text/html").body}function ae(e,t){const n=document.createElement("a");return n.href=t,n.appendChild(e.cloneNode(!0)),n}function ie(e,t){const n=document.createElement(t);return n.appendChild(e.cloneNode(!0)),n}function re(e,t){let n=t.cloneNode(!0);return e?(e.style&&"700"===e.style.fontWeight&&(n=ie(n,"strong")),e.style&&"italic"===e.style.fontStyle&&(n=ie(n,"em")),e.style&&"underline"===e.style.textDecoration&&(n=ie(n,"u")),e.style&&"line-through"===e.style.textDecoration&&(n=ie(n,"del")),e.style&&"super"===e.style.verticalAlign&&(n=ie(n,"sup")),e.style&&"sub"===e.style.verticalAlign&&(n=ie(n,"sub")),n):n}function se(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=t;return"A"===t.nodeName&&(n=ae(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0])),n=re(o,n),n}function ce(e){if(e.childNodes&&(e.childNodes.length<=1||"OL"===e.nodeName||"UL"===e.nodeName)){let t,n=document.createTextNode(e.textContent||"");if("UL"===e.nodeName||"OL"===e.nodeName||"LI"===e.nodeName){t=document.createElement(e.nodeName),n=document.createDocumentFragment();const o=[];for(let t=0;t<e.childNodes.length;t++)o.push(...ce(e.childNodes[t]));o.map((e=>n.appendChild(e)))}else-1!==ne.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=se(e.childNodes[0])):"P"===e.nodeName?(t=document.createElement("p"),n=function(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=document.createTextNode("");return"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0]),t.childNodes[0]&&"A"===t.childNodes[0].nodeName&&(n=ae(n.cloneNode(!0),t.childNodes[0].href),o=t.childNodes[0].childNodes[0]),n=re(o,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=se(e));return t?(t.appendChild(n),[t]):[e.cloneNode(!0)]}if(e.childNodes){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(...ce(e.childNodes[n]));return t}return[e]}function le(e){return 8!==e.nodeType}var de=n(56266),ue=n(21262);const me=/<style>(.*?)<\/style>/gs,he=(e,t,n,a,r,s,c)=>{(0,o.d4)((()=>{if(e)return document.addEventListener("paste",o,!1),()=>{document.removeEventListener("paste",o,!1)};async function o(e){if(!e.clipboardData)return;const o=document.activeElement;if(o&&![i.R2F,i.nYf,i.Cic].includes(o.id))return;const l=e.clipboardData.getData("text").substring(0,4096),d=e.clipboardData.getData("text/html");let u=d?(0,Z.ZP)(function(e){let t=document.createElement("div");try{e=(n=e).match(te)?function(e){const t=document.createElement("body"),n=e.childNodes,o=Array.from(n).filter(le),a=[];for(const e of o)a.push(...ce(e));for(let e=0;e<a.length;e++)t.appendChild(a[e].cloneNode(!0));return t}(oe(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:oe(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){i.eMD&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(me,"");const o=t.querySelectorAll(".text-content");return o.length&&(t=o[o.length-1]),Array.from(t.getElementsByTagName("*")).forEach((e=>{if(e instanceof HTMLElement)switch(e.removeAttribute("style"),"BR"===e.tagName&&e.replaceWith("\n"),"P"===e.tagName&&e.appendChild(document.createTextNode("\n")),"IMG"!==e.tagName||e.dataset.entityType||e.replaceWith(e.getAttribute("alt")||""),e.dataset.ignoreOnPaste&&e.remove(),Z.xe[e.tagName]&&e.setAttribute("data-entity-type",Z.xe[e.tagName]),e.dataset.entityType||e.textContent!==e.innerText||e.replaceWith(e.textContent),e.dataset.alt&&e.setAttribute("alt",e.dataset.alt),e.dataset.entityType){case ee.Vv.MentionName:e.replaceWith(e.textContent||"");break;case ee.Vv.CustomEmoji:e.textContent=e.dataset.alt||""}})),t.innerHTML.trimEnd()}(d),void 0,!0):void 0;u&&(0,de.Lo)(u)&&s&&(u=(0,de.If)(u),c?.());const{items:m}=e.clipboardData;let h=[];if(e.preventDefault(),m.length>0&&(h=await(0,ue.Z)(m)),!h?.length&&!l)return;const p=u?.entities?.length?u:{text:l};let g=!1;try{g="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(d,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const f=p&&p.text,v=h?.length&&!r&&!g;if(v){const e=await Promise.all(h.map((e=>N(e.name,e))));n((t=>t.concat(e)))}f&&(v?a(p):t(p,o?.id))}}),[t,r,n,e,s,c,a])};var pe=n(60130),ge=n(45332),Ze=n(58637),fe=n(72645),ve=n(88957);let Pe=!1;const Ee=new Set([ee.Vv.TextUrl,ee.Vv.Url]);var ye=n(28353),be=n(16580);const Ce=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/i,we=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,Se={username:"",query:"",canShowHelp:!1,usernameLowered:""},Ne=document.createElement("div");const Ie=(0,be.Z)(((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})));var Me=n(29295),ke=n(33681),xe=n(94462);const Te=new RegExp(`^${i.t8f.source}$`,"g");var Ae=n(23989);const Re={encoderPath:new URL(n(68973),n.b).href,reuseWorker:!0},Oe={type:"audio/ogg"};let Le,De,Fe;async function Be(){return Le||(Le=n.e(1161).then(n.t.bind(n,1161,23)),De=(await Le).default,Fe=new De(Re)),Le}async function Ue(e){await async function(){await Be(),await Fe.start()}();const t=Date.now();let n;const o=[],a=[];Fe.ondataavailable=e=>{o.push(e)};const i=function(t,n){const o=t.sourceNode,i=o.context.createAnalyser();i.fftSize=64,o.connect(i);const s=i.frequencyBinCount,c=new Uint8Array(s);let l=!1;return function t(){if(l)return;i.getByteFrequencyData(c);const n=c.reduce(((e,t)=>e+t),0)/s/255;(t=>{a.push(255*t),e(t)})(n<.1?0:n),(0,r.i$)(t)}(),()=>{l=!0}}(Fe);return{stop:()=>new Promise(((e,r)=>{Fe.onstop=()=>{e({blob:new Blob(o,Oe),duration:Math.round(((n||Date.now())-t)/1e3),waveform:a})},Fe.onerror=r;const s=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Fe.stop(),i()}),s)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Fe.pause(),n=Date.now(),i()}),e)}}}var $e=n(99203),je=n(48778);const He=e=>{const{attachments:t}=e,n=(0,je.Z)($e.gl.Extra,"AttachmentModal",!t.length);return n?o.ZP.createElement(n,e):void 0};var _e=n(30879),ze=n(85655),Ye=n(56503),Ve=n(52328),Xe=n(58964),qe=n(43521),We=n(43159);const Ge=(0,o.X$)((e=>{let{chatId:t,threadId:n,isButtonVisible:a,canAttachMedia:r,canAttachPolls:s,canSendPhotos:c,canSendVideos:l,canSendDocuments:d,canSendAudios:u,attachBots:m,peerType:h,isScheduled:p,theme:g,shouldCollectDebugLogs:Z,onFileSelect:f,onMenuOpen:v,onMenuClose:E,onPollCreate:y}=e;const[b,w,S]=(0,D.Z)(),[N,I,M]=(0,Ye.Z)(b,S),k=c&&l,x=c||l,[T,A,R]=(0,D.Z)(),O=b||T;(0,o.d4)((()=>{b&&M()}),[b,M]),(0,o.d4)((()=>{O?v():E()}),[O,E,v]);const L=(0,$.Z)((()=>{b?S():w()})),F=(0,$.Z)(((e,t)=>{const{files:n}=e.target,o=(0,C.ox)(n);o?.length&&f(o,t)})),B=(0,$.Z)((()=>{(0,ze.g)(Array.from(k?i.dII:c?i.oGt:i.wGh).join(","),(e=>F(e,!0)))})),j=(0,$.Z)((()=>{(0,ze.g)(!d&&u?Array.from(i.e74).join(","):"*",(e=>F(e,!1)))})),H=(0,$.Z)((()=>{const e=new File([(0,_e.aZ)()],i.Wpe,{type:"text/plain"});f([e])})),_=(0,o.Ye)((()=>m?Object.values(m).filter((e=>!(!h||!e.isForAttachMenu)&&(!("bots"!==h||e.id!==t||!e.attachMenuPeerTypes.includes("self"))||e.attachMenuPeerTypes.includes(h)))):void 0),[m,t,h]),z=(0,U.Z)();if(a)return o.ZP.createElement("div",{className:"AttachMenu"},o.ZP.createElement(qe.Z,{id:"attach-menu-button",className:b?"AttachMenu--button activated":"AttachMenu--button",round:!0,color:"translucent",onActivate:L,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0},o.ZP.createElement("i",{className:"icon icon-attach"})),o.ZP.createElement(Ve.Z,{id:"attach-menu-controls",isOpen:O,autoClose:!0,positionX:"right",positionY:"bottom",onClose:S,className:"AttachMenu--menu fluid",onCloseAnimationEnd:S,onMouseEnter:P.$b?void 0:N,onMouseLeave:P.$b?void 0:I,noCloseOnBackdrop:!P.$b,ariaLabelledBy:"attach-menu-button"},!r&&o.ZP.createElement(Xe.Z,{className:"media-disabled",disabled:!0},"Posting media content is not allowed in this group."),r&&o.ZP.createElement(o.ZP.Fragment,null,x&&o.ZP.createElement(Xe.Z,{icon:"photo",onClick:B},z(k?"AttachmentMenu.PhotoOrVideo":c?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")),(d||u)&&o.ZP.createElement(Xe.Z,{icon:"document",onClick:j},z(!d&&u?"InputAttach.Popover.Music":"AttachDocument")),d&&Z&&o.ZP.createElement(Xe.Z,{icon:"bug",onClick:H},z("DebugSendLogs"))),s&&o.ZP.createElement(Xe.Z,{icon:"poll",onClick:y},z("Poll")),r&&!p&&_?.map((e=>o.ZP.createElement(We.Z,{bot:e,chatId:t,threadId:n,theme:g,onMenuOpened:A,onMenuClosed:R})))))})),Ke=e=>{const{isOpen:t}=e,n=(0,je.Z)($e.gl.Extra,"BotCommandMenu",!t);return n?o.ZP.createElement(n,e):void 0},Je=e=>{const{isOpen:t}=e,n=(0,je.Z)($e.gl.Extra,"BotCommandTooltip",!t);return n?o.ZP.createElement(n,e):void 0};var Qe=n(231);const et=(0,o.X$)((0,a.c$)(((e,t)=>{let{messageId:n}=t;const{chatId:o}=(0,c.Btg)(e)||{};return o?{message:(0,c.hjO)(e,o,n)}:{}}))((e=>{let{isOpen:t,message:n,onClose:i}=e;const{clickBotInlineButton:r}=(0,a.Sv)(),[s,c]=(0,Ye.Z)(t,i),{isKeyboardSingleUse:l}=n||{};if(n&&n.keyboardButtons)return o.ZP.createElement(Ve.Z,{isOpen:t,autoClose:l,positionX:"right",positionY:"bottom",onClose:i,className:"BotKeyboardMenu",onCloseAnimationEnd:i,onMouseEnter:P.$b?void 0:s,onMouseLeave:P.$b?void 0:c,noCompact:!0},o.ZP.createElement("div",{className:"content custom-scroll"},n.keyboardButtons.map((e=>o.ZP.createElement("div",{className:"row"},e.map((e=>o.ZP.createElement(Qe.Z,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>r({messageId:n.id,button:e})},e.text))))))))}))),tt=(0,o.X$)((e=>{let{isOpen:t,onClick:n,text:a,isDisabled:i}=e;const r=(0,o.sO)(null);return(0,o.d4)((()=>{const e=r.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)}),[t,a]),(0,o.d4)((()=>{const e=r.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}}),[]),o.ZP.createElement(Qe.Z,{className:(0,d.Z)("bot-menu",t&&"open"),round:!0,color:"translucent",disabled:i,onClick:n,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:(0,d.Z)("bot-menu-icon","icon","icon-webapp",t&&"open")}),o.ZP.createElement("span",{ref:r,className:"bot-menu-text"},a))}));var nt=n(12644),ot=n(17891),at=n(84441),it=n(66902);const rt=(0,o.X$)((0,a.c$)(((e,t)=>{let{shouldForceShowEditing:n}=t;const{chatId:o,threadId:a,type:i}=(0,c.Btg)(e)||{};if(!o||!a||!i)return{};const{forwardMessages:{fromChatId:r,toChatId:l,messageIds:d,noAuthors:u,noCaptions:m}}=(0,c.jUK)(e),h=(0,c.Yyv)(e,o,a),p="scheduled"===i?(0,c.nBP)(e,o):(0,c._$9)(e,o,a),g=(0,c.FOo)(e),Z=l===o,f=d?.map((t=>(0,c.hjO)(e,r,t)));let v,P;if(h&&!n?v=(0,c.hjO)(e,o,h):p?v=(0,c.kKD)(e,o,a,i):Z&&1===d.length&&(v=f?.[0]),h&&v&&!n){const{forwardInfo:t}=v,n=(0,c.FM1)(e,o);t&&(t.isChannelPost||n)&&(P=(0,c.cve)(e,v)),P||t?.hiddenUserName||(P=(0,c.Urc)(e,v))}else Z&&(v&&(P=(0,c.cve)(e,v),P||(P=(0,c.Urc)(e,v))),P||(P=(0,s.YC)(r)?(0,c.dyD)(e,r):(0,c.Z1J)(e,r)));const E=f?.some((e=>e?.content.text&&Object.keys(e.content).length>1)),y=Z&&1===d.length&&Boolean(v?.content.storyData);return{replyingToId:h,editingId:p,message:v,sender:P,shouldAnimate:g,forwardedMessagesCount:Z?d.length:void 0,noAuthors:u,noCaptions:m,forwardsHaveCaptions:E,isCurrentUserPremium:(0,c.wVz)(e),isContextMenuDisabled:y}}))((e=>{let{replyingToId:t,editingId:n,message:i,sender:r,shouldAnimate:c,forwardedMessagesCount:l,noAuthors:u,noCaptions:m,forwardsHaveCaptions:h,shouldForceShowEditing:p,isCurrentUserPremium:g,isContextMenuDisabled:Z,onClear:f}=e;const{setReplyingToId:v,setEditingId:P,focusMessage:E,changeForwardRecipient:y,setForwardNoAuthors:b,setForwardNoCaptions:C,exitForwardMode:w}=(0,a.Sv)(),S=(0,o.sO)(null),N=(0,U.Z)(),I=Boolean(l),M=Boolean((t||n)&&i||r&&l),k=(0,ot.Z)([l],l?300:void 0),{shouldRender:x,transitionClassNames:T}=(0,z.Z)(k&&M,void 0,!c,void 0,!c),A=(0,$.Z)((()=>{t&&!p?v({messageId:void 0}):n?P({messageId:void 0}):l&&w(),f?.()}));(0,o.d4)((()=>M?(0,Ae.Z)(A):void 0),[M,A]);const O=(0,$.Z)((()=>{I||E({chatId:i.chatId,messageId:i.id,noForumTopicPanel:!0})})),L=(0,$.Z)((e=>{e.stopPropagation(),A()})),D=(0,$.Z)((()=>{y()})),{isContextMenuOpen:F,contextMenuPosition:B,handleContextMenu:j,handleContextMenuClose:H,handleContextMenuHide:_}=(0,R.Z)(S),Y=(0,$.Z)((()=>S.current)),V=(0,$.Z)((()=>S.current)),X=(0,$.Z)((()=>S.current.querySelector(".forward-context-menu .bubble"))),{positionX:q,positionY:W,transformOriginX:G,transformOriginY:K,style:J}=(0,nt.Z)(B,Y,V,X);(0,o.d4)((()=>{x||H()}),[H,x]);const Q=(0,d.Z)("ComposerEmbeddedMessage",T),ee=(0,o.Ye)((()=>t&&!p?"icon-reply":n?"icon-edit":I?"icon-forward":void 0),[n,I,t,p]),te=l&&l>1?N("ForwardedMessageCount",l):void 0,ne=(0,o.Ye)((()=>{if(!i||!I||!i.content.text||!u||g)return i;const e=(0,s.If)(i.content.text);return{...i,content:{...i.content,text:e}}}),[g,I,i,u]);if(x)return o.ZP.createElement("div",{className:Q,ref:S,onContextMenu:j,onClick:j},o.ZP.createElement("div",{className:"ComposerEmbeddedMessage_inner"},o.ZP.createElement("div",{className:"embedded-left-icon"},o.ZP.createElement("i",{className:(0,d.Z)("icon",ee)})),o.ZP.createElement(at.Z,{className:"inside-input",message:ne,sender:u?void 0:r,customText:te,title:n?N("EditMessage"):u?N("HiddenSendersNameDescription"):void 0,onClick:O,hasContextMenu:I&&!Z}),o.ZP.createElement(Qe.Z,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:N("Cancel"),onClick:L},o.ZP.createElement("i",{className:"icon icon-close"})),I&&!Z&&o.ZP.createElement(Ve.Z,{isOpen:F,transformOriginX:G,transformOriginY:K,positionX:q,positionY:W,style:J,className:"forward-context-menu",onClose:H,onCloseAnimationEnd:_},o.ZP.createElement(Xe.Z,{icon:u?void 0:"message-succeeded",customIcon:u?o.ZP.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>b({noAuthors:!1})},N(l>1?"ShowSenderNames":"ShowSendersName")),o.ZP.createElement(Xe.Z,{icon:u?"message-succeeded":void 0,customIcon:u?void 0:o.ZP.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>b({noAuthors:!0})},N(l>1?"HideSenderNames":"HideSendersName")),h&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(it.Z,null),o.ZP.createElement(Xe.Z,{icon:m?void 0:"message-succeeded",customIcon:m?o.ZP.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>C({noCaptions:!1})},N(l>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")),o.ZP.createElement(Xe.Z,{icon:m?"message-succeeded":void 0,customIcon:m?void 0:o.ZP.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>C({noCaptions:!0})},N(l>1?"Conversation.ForwardOptions.HideCaption":"HideCaption"))),o.ZP.createElement(it.Z,null),o.ZP.createElement(Xe.Z,{icon:"replace",onClick:D},N("ChangeRecipient")))))})));var st=n(93219),ct=n(67146),lt=n(12420);const dt=e=>{const{isOpen:t}=e,n=(0,je.Z)($e.gl.Extra,"DropArea",!t);return n?o.ZP.createElement(n,e):void 0};var ut=n(19830);const mt=e=>{const{isOpen:t}=e,n=(0,je.Z)($e.gl.Extra,"InlineBotTooltip",!t);return n?o.ZP.createElement(n,e):void 0},ht=e=>{const{isOpen:t}=e,n=(0,je.Z)($e.gl.Extra,"MentionTooltip",!t);return n?o.ZP.createElement(n,e):void 0};var pt=n(49841);const gt=e=>{const{isOpen:t}=e,n=(0,je.Z)($e.gl.Extra,"PollModal",!t);return n?o.ZP.createElement(n,e):void 0},Zt=e=>{const{isOpen:t}=e,n=(0,je.Z)($e.gl.Extra,"SendAsMenu",!t);return n?o.ZP.createElement(n,e):void 0},ft=e=>{const{isOpen:t}=e,n=(0,je.Z)($e.gl.Extra,"StickerTooltip",!t);return n?o.ZP.createElement(n,e):void 0};var vt=n(23522),Pt=n(18360),Et=n(54659);const yt=new RegExp(i.FM6,"i"),bt=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,threadId:o}=t;const a=(0,c.tVX)(e,n,o);return{theme:(0,c.Puy)(e),webPagePreview:(0,c.jUK)(e).webPagePreview,noWebPage:a}}))((e=>{let{chatId:t,threadId:n,getHtml:i,isDisabled:r,webPagePreview:s,noWebPage:c,theme:l}=e;const{loadWebPagePreview:u,clearWebPagePreview:m,toggleMessageWebPage:h}=(0,a.Sv)(),p=(0,o.sO)(),g=(0,K.iD)((()=>{const e=(0,Z.ZP)(i()),t=e.entities?.find((e=>e.type===ee.Vv.TextUrl));return p.current=e,t?.url||e.text.match(yt)?.[0]}),[i],300,!0),f=(0,J.Z)(g,[g,i],!0);(0,o.d4)((()=>{const e=f(),o=p.current;e?u({text:o}):(m(),h({chatId:t,threadId:n}))}),[f,t,n]),(0,X.Z)((()=>{m(),h({chatId:t,threadId:n})}),[t,m,n,h]);const v=(0,O.Z)((()=>Boolean(s&&i()&&!c&&!r)),[r,i,c,s]),{shouldRender:P,transitionClassNames:E}=(0,z.Z)(v),y=(0,Pt.Z)(s,!0),b=(0,$.Z)((()=>{h({chatId:t,threadId:n,noWebPage:!0})}));if(!P||!y)return;const{photo:C,...w}=y,S={content:{webPage:w}};return o.ZP.createElement("div",{className:(0,d.Z)("WebPagePreview",E)},o.ZP.createElement("div",{className:"WebPagePreview_inner"},o.ZP.createElement("div",{className:"WebPagePreview-left-icon"},o.ZP.createElement("i",{className:"icon icon-link"})),o.ZP.createElement(Et.Z,{message:S,inPreview:!0,theme:l}),o.ZP.createElement(Qe.Z,{className:"WebPagePreview-clear",round:!0,faded:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:b},o.ZP.createElement("i",{className:"icon icon-close"}))))})));var Ct=n(472),wt=n(49204),St=n(70172);const Nt=e=>{const{isOpen:t}=e,n=(0,je.Z)($e.gl.Extra,"DeleteMessageModal",!t);return n?o.ZP.createElement(n,e):void 0};var It=n(36368),Mt=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e}(Mt||{});const kt="wonderful-voice-message.ogg",xt={emoticon:""},Tt=(0,o.X$)((0,a.c$)(((e,t)=>{var n;let{chatId:o,threadId:a,storyId:r,messageListType:d,isMobile:u,type:m}=t;const h=(0,c.Z1J)(e,o),p=o!==i.FVh?(0,c.kBx)(e,o):void 0,g=Boolean(p),Z=(0,c.FM1)(e,o),f=(0,s.YC)(o),v=g?(0,c.ccz)(e,p.id):void 0,P=f?void 0:(0,c.x67)(e,o),E=(g||!f)&&(0,c.FTG)(e,o,a),y=(0,c.qyA)(e,o,a),{language:b,shouldSuggestStickers:C,shouldSuggestCustomEmoji:w,shouldUpdateStickerSetOrder:S}=e.settings.byKey,N=e.emojiKeywords[i.pRL],I=b!==i.pRL?e.emojiKeywords[b]:void 0,M=E?E.id:void 0,k=M?(0,c.hjO)(e,o,M):void 0,{currentUserId:x}=e,T=P?P?.sendAsId||x:void 0,A=h?.sendAsPeerIds&&T&&(h.sendAsPeerIds.some((e=>e.id===T))?T:h?.adminRights?.anonymous?h?.id:void 0),R=A?(0,c.dyD)(e,A):void 0,O=!R&&A?(0,c.Z1J)(e,A):void 0,L=(0,c.uHr)(e,o),D=(0,c.nAc)(e,o),F=(0,c.jUK)(e),B=Boolean(F.storyViewer.storyId),U=(0,c.Btg)(e),$=o===U?.chatId&&a===U?.threadId&&d===U?.type&&!B,j=(0,c.dyD)(e,o),H=null===(n=j&&!(0,c.ccz)(e,j.id)?.noVoiceMessages)||void 0===n||n,_=P?.slowMode,z=(0,c.wVz)(e),Y="scheduled"===d?(0,c.hI0)(e,o):(0,c.saH)(e,o,a),V=(0,c.Yyv)(e,o,a),X=r&&(0,c.o9F)(e,o,r),q=X&&"sentReaction"in X?X.sentReaction:void 0;return{availableReactions:"story"===m?e.availableReactions:void 0,topReactions:"story"===m?e.topReactions:void 0,isOnActiveTab:!F.isBlurred,editingMessage:(0,c.kKD)(e,o,a,d),replyingToId:V,draft:(0,c.Mst)(e,o,a),chat:h,isChatWithBot:g,isChatWithSelf:Z,isForCurrentMessageList:$,canScheduleUntilOnline:(0,c.Eh5)(e,o),isChannel:h?(0,s.eA)(h):void 0,isRightColumnShown:(0,c.Jf5)(e,u),isSelectModeActive:(0,c.CAb)(e),withScheduledButton:"thread"===d&&Boolean(y?.length),shouldSchedule:"scheduled"===d,botKeyboardMessageId:M,botKeyboardPlaceholder:k?.keyboardPlaceholder,isForwarding:o===F.forwardMessages.toChatId,pollModal:F.pollModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,groupChatMembers:P?.members,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:x,contentToBeScheduled:F.contentToBeScheduled,shouldSuggestStickers:C,shouldSuggestCustomEmoji:w,shouldUpdateStickerSetOrder:S,recentEmojis:e.recentEmojis,baseEmojiKeywords:N?.keywords,emojiKeywords:I?.keywords,inlineBots:F.inlineBots.byUsername,isInlineBotLoading:F.inlineBots.isLoading,chatBotCommands:P?.botCommands,botCommands:v?v.botInfo?.commands||!1:void 0,botMenuButton:v?.botInfo?.menuButton,sendAsUser:R,sendAsChat:O,sendAsId:A,editingDraft:Y,requestedDraftText:L,requestedDraftFiles:D,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,c.taM)(e,o),theme:(0,c.Puy)(e),fileSizeLimit:(0,l.M)(e,"uploadMaxFileparts")*i.pJM,captionLimit:(0,l.M)(e,"captionLength"),isCurrentUserPremium:z,canSendVoiceByPrivacy:H,attachmentSettings:e.attachmentSettings,slowMode:_,currentMessageList:U,isReactionPickerOpen:(0,c.Io8)(e),canBuyPremium:!z&&!(0,c.oe5)(e),canPlayAnimatedEmojis:(0,c.W9H)(e),shouldCollectDebugLogs:e.settings.byKey.shouldCollectDebugLogs,sentStoryReaction:q,stealthMode:e.stories.stealthMode}}))((e=>{let{type:t,isOnActiveTab:n,dropAreaState:c,shouldSchedule:l,canScheduleUntilOnline:y,isReady:C,isMobile:w,onDropHide:S,onFocus:M,onBlur:te,editingMessage:ne,chatId:oe,threadId:ae,storyId:ie,currentMessageList:re,messageListType:se,draft:ce,chat:le,isForCurrentMessageList:de,isCurrentUserPremium:ue,canSendVoiceByPrivacy:me,isChatWithBot:be,isChatWithSelf:Re,isChannel:Oe,fileSizeLimit:Le,isRightColumnShown:De,isSelectModeActive:Fe,isReactionPickerOpen:$e,isForwarding:je,pollModal:_e,botKeyboardMessageId:ze,botKeyboardPlaceholder:Ye,inputPlaceholder:Ve,withScheduledButton:Xe,stickersForEmoji:We,customEmojiForEmoji:nt,groupChatMembers:ot,topInlineBotIds:at,currentUserId:it,captionLimit:Pt,contentToBeScheduled:Et,shouldSuggestStickers:yt,shouldSuggestCustomEmoji:Tt,baseEmojiKeywords:At,emojiKeywords:Rt,recentEmojis:Ot,inlineBots:Lt,isInlineBotLoading:Dt,botCommands:Ft,chatBotCommands:Bt,sendAsUser:Ut,sendAsChat:$t,sendAsId:jt,editingDraft:Ht,replyingToId:_t,requestedDraftText:zt,requestedDraftFiles:Yt,botMenuButton:Vt,attachBots:Xt,attachMenuPeerType:qt,attachmentSettings:Wt,theme:Gt,slowMode:Kt,shouldUpdateStickerSetOrder:Jt,editableInputCssSelector:Qt,editableInputId:en,inputId:tn,className:nn,availableReactions:on,topReactions:an,canBuyPremium:rn,canPlayAnimatedEmojis:sn,shouldCollectDebugLogs:cn,sentStoryReaction:ln,stealthMode:dn,onForward:un}=e;const{sendMessage:mn,clearDraft:hn,showDialog:pn,forwardMessages:gn,openPollModal:Zn,closePollModal:fn,loadScheduledHistory:vn,openChat:Pn,addRecentEmoji:En,sendInlineBotResult:yn,loadSendAs:bn,resetOpenChatWithDraft:Cn,callAttachBot:wn,addRecentCustomEmoji:Sn,showNotification:Nn,showAllowedMessageTypesNotification:In,openStoryReactionPicker:Mn,closeReactionPicker:kn,sendStoryReaction:xn}=(0,a.Sv)(),Tn=(0,U.Z)(),An=(0,o.sO)(null),Rn=(0,o.sO)(null),[On,Ln]=(0,Y.Z)(""),[Dn,Fn]=(0,o.eJ)(!1),Bn=(0,F.Z)(Qt),Un=(0,o.sO)(),$n=(0,j.Z)(c),{width:jn}=E.Z.get(),Hn="messageList"===t,_n="story"===t,zn=Hn?le?.sendAsPeerIds:void 0,Yn=zn&&(zn.length>1||!zn.some((e=>e.id===it))),[Vn,Xn,qn]=(0,D.Z)(),Wn=(0,_.Z)(oe,ae),[Gn,Kn,Jn]=(0,D.Z)(),[Qn,eo,to]=(0,D.Z)(),no=!(!ln||!("emoticon"in ln))&&ln.emoticon===xt.emoticon;(0,o.d4)(u.AU,[On]);const oo=(0,o.sO)(0),[ao,io]=(0,H.Z)(Hn&&y,qn);(0,q.Z)((()=>{Fn(!0)}),430),(0,o.d4)((()=>{Hn||kn()}),[Hn,ie]),(0,o.d4)((()=>{Un.current=void 0}),[oe]),(0,o.d4)((()=>{oe&&C&&!_n&&vn({chatId:oe})}),[C,oe,ae,_n]),(0,o.d4)((()=>{oe&&le&&!zn&&C&&(0,s.ZV)(le)&&bn({chatId:oe})}),[le,oe,C,bn,zn]);const ro=(0,o.sO)(!1);(0,X.Z)((e=>{let[t,n]=e;ro.current=Boolean(oe===t&&zn&&!n)}),[oe,zn]);const[so,co]=(0,o.eJ)([]),lo=Boolean(so.length),[uo,mo]=(0,o.eJ)(void 0),{canSendStickers:ho,canSendGifs:po,canAttachMedia:go,canAttachPolls:Zo,canAttachEmbedLinks:fo,canSendVoices:vo,canSendPlainText:Po,canSendAudios:Eo,canSendVideos:yo,canSendPhotos:bo,canSendDocuments:Co}=(0,o.Ye)((()=>(0,s.H5)(le,be,_n)),[le,be,_n]),wo=!Po&&!ne,So=(0,$.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en;if(t===en&&wo)return;const n=window.getSelection();let o;if(o=t===en?document.querySelector(Qt):document.getElementById(t),n.rangeCount){const a=n.getRangeAt(0);if((0,x.R)(a,t))return(0,f.tx)(e),void o.dispatchEvent(new Event("input",{bubbles:!0}))}Ln(`${On()}${e}`),(0,r.Yq)((()=>{(0,p.Z)(o)}))})),No=(0,$.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en;const n=(0,T.Z)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");So(n,t)})),Io=(0,$.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en;const n=(0,A.z)(e);So(n,t)})),Mo=(0,$.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en;So((0,k.yR)(e),t)})),ko=(0,$.Z)((()=>{uo&&(Io(uo,en),mo(void 0))})),{shouldSuggestCompression:xo,shouldForceCompression:To,shouldForceAsFile:Ao,handleAppendFiles:Ro,handleFileSelect:Oo,onCaptionUpdate:Lo,handleClearAttachments:Do,handleSetAttachments:Fo}=function(e){let{attachments:t,fileSizeLimit:n,setHtml:i,setAttachments:r,chatId:s,canSendAudios:c,canSendVideos:l,canSendPhotos:d,canSendDocuments:u,insertNextText:m}=e;const{openLimitReachedModal:h,showAllowedMessageTypesNotification:p}=(0,a.Sv)(),[Z,f]=(0,o.eJ)(!1),[v,P]=(0,o.eJ)(!1),[E,y]=(0,o.eJ)(void 0),b=(0,$.Z)((()=>{r(g.D),m()})),C=(0,$.Z)((e=>{const o="function"==typeof e?e(t):e;if(o.length)if(o.some((e=>{const t=W(e);return"audio"===t&&!c&&!u||"video"===t&&!l&&!u||"image"===t&&!d&&!u||"file"===t&&!u})))p({chatId:s});else if(o.some((e=>{let{size:t}=e;return t>n})))h({limit:"uploadMaxFileparts"});else{r(o);const e=o.some((e=>{const t=W(e);return"audio"===t&&!c||"video"===t&&!l||"image"===t&&!d}));f(Boolean(e&&u)),P(!u),y(void 0)}else b()}));return{shouldSuggestCompression:E,handleAppendFiles:(0,$.Z)((async(e,n)=>{C([...t,...await Promise.all(e.map((e=>N(e.name,e,{shouldSendAsSpoiler:n||void 0}))))])})),handleFileSelect:(0,$.Z)((async(e,t)=>{C(await Promise.all(e.map((e=>N(e.name,e))))),y(t)})),onCaptionUpdate:i,handleClearAttachments:b,handleSetAttachments:C,shouldForceCompression:v,shouldForceAsFile:Z}}({attachments:so,setHtml:Ln,setAttachments:co,fileSizeLimit:Le,chatId:oe,canSendAudios:Eo,canSendVideos:yo,canSendPhotos:bo,canSendDocuments:Co,insertNextText:ko}),[Bo,Uo,$o]=(0,D.Z)(),[jo,Ho,_o]=(0,D.Z)(),[zo,Yo,Vo]=(0,D.Z)(),[Xo,qo,Wo]=(0,D.Z)(),[Go,Ko,Jo]=(0,D.Z)(),[Qo,ea,ta]=(0,D.Z)(),{startRecordingVoice:na,stopRecordingVoice:oa,pauseRecordingVoice:aa,activeVoiceRecording:ia,currentRecordTime:ra,recordButtonRef:sa,startRecordTimeRef:ca}=(()=>{const e=(0,o.sO)(null),[t,n]=(0,o.eJ)(),a=(0,o.sO)(),[i,s]=(0,o.eJ)();(0,o.d4)((()=>{P.s$&&P.mh&&Be()}),[]);const c=(0,$.Z)((async()=>{try{const{stop:t,pause:o}=await Ue((t=>{e.current&&(a.current&&Date.now()%4==0&&(0,r.WM)((()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)})),s(Date.now()))}));a.current=Date.now(),s(Date.now()),n({stop:t,pause:o})}catch(e){console.error(e)}})),l=(0,$.Z)((()=>{if(t){(0,r.WM)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.pause()}catch(e){return void console.error(e)}}})),d=(0,$.Z)((()=>{if(t){n(void 0),a.current=void 0,s(void 0),(0,r.WM)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.stop()}catch(e){return void console.error(e)}}}));return(0,o.d4)((()=>t?(0,Ae.Z)(d):void 0),[t,d]),{startRecordingVoice:c,pauseRecordingVoice:l,stopRecordingVoice:d,activeVoiceRecording:t,currentRecordTime:i,recordButtonRef:e,startRecordTimeRef:a}})(),la=de&&!_n;(0,B.Z)((()=>{Wn({type:"recordAudio"})}),la?ia&&i.o_S:void 0),(0,o.d4)((()=>{de&&!_n&&(ia||Wn({type:"cancel"}))}),[ia,de,_n,Wn]);const da=(0,V.Y)(Boolean(ne));(0,o.d4)((()=>{de&&!_n&&On()&&!da.current&&Wn({type:"typing"})}),[On,da,de,_n,Wn]);const ua=le&&(0,s.Nl)(le),{isEmojiTooltipOpen:ma,closeEmojiTooltip:ha,filteredEmojis:pa,filteredCustomEmojis:ga,insertEmoji:Za}=(0,ye.Z)(Boolean(C&&n&&(_n||de)&&yt&&!lo),On,Ln,void 0,Ot,At,Rt),{isCustomEmojiTooltipOpen:fa,closeCustomEmojiTooltip:va,insertCustomEmoji:Pa}=(0,pe.Z)(Boolean(C&&n&&(_n||de)&&Tt&&!lo),On,Ln,Bn,An,nt),{isStickerTooltipOpen:Ea,closeStickerTooltip:ya}=function(e,t,n){const{loadStickersForEmoji:r,clearStickersForEmoji:s}=(0,a.Sv)(),[c,l,d]=(0,D.Z)(!1),u=(0,J.Z)((()=>{const n=t();if(!e||!n||P.op&&n.length>8)return;if(!n.match(P.op?ke.Z:i.t8f))return;const o=(0,G._)(n);return o&&(P.op&&1===(0,xe.Z)(o)||!P.op&&Boolean(n.match(Te)))?P.op?o:o.match(/alt="(.+)"/)?.[1]:void 0}),[t,e]),m=(0,O.Z)((()=>Boolean(u())),[u]),h=Boolean(n?.length);return(0,o.d4)((()=>{if(!e||!m)return;const t=u();t?h||r({emoji:t}):s()}),[e,m,u,h,r,s]),(0,o.d4)(d,[d,t]),{isStickerTooltipOpen:Boolean(m&&h&&!c),closeStickerTooltip:l}}(Boolean(C&&n&&(_n||de)&&yt&&ho&&!lo),On,We),{isMentionTooltipOpen:ba,closeMentionTooltip:Ca,insertMention:wa,mentionFilteredUsers:Sa}=(0,Me.Z)(Boolean(Hn&&C&&de&&!lo),On,Ln,Bn,An,ot,at,it),{isOpen:Na,botId:Ia,isGallery:Ma,switchPm:ka,switchWebview:xa,results:Ta,closeTooltip:Aa,help:Ra,loadMore:Oa}=function(e,t,n,i){const{queryInlineBot:r,resetInlineBot:s,resetAllInlineBots:c}=(0,a.Sv)(),[l,d,u]=(0,D.Z)(!1),m=(0,K.CH)((()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return Se;const t=function(e){return Ne.innerHTML=e.replace(/<br>/g,"\n"),Ne.querySelectorAll("[alt]").forEach((e=>{e.innerText||(e.innerText=e.getAttribute("alt"))})),Ne.innerText}(e),n=t.match(Ce);return n?Ie(n[1],n[2],""===n[2]&&!t.match(we)):Se}(t):Se}),[n,e],300),{username:h,query:p,canShowHelp:g,usernameLowered:Z}=(0,O.Z)(m,[m,n],!0);(0,X.Z)((e=>{let[t]=e;t&&s({username:t})}),[h,s]),(0,o.d4)((()=>{Z&&r({chatId:t,username:Z,query:p})}),[t,p,r,Z]),(0,o.d4)(u,[u,n]);const{id:f,switchPm:v,switchWebview:P,offset:E,results:y,isGallery:b,help:C}=Z&&i?.[Z]||{},w=Boolean((y?.length||v)&&!l);(0,o.d4)((()=>{w||h||c()}),[w,c,h]);const S=(0,$.Z)((()=>{Z&&r({chatId:t,username:Z,query:p,offset:E})}));return{isOpen:w,botId:f,isGallery:b,switchPm:v,switchWebview:P,results:y,closeTooltip:d,help:g&&C?`@${h} ${C}`:void 0,loadMore:S}}(Boolean(Hn&&C&&de&&!lo),oe,On,Lt),{isOpen:La,close:Da,filteredBotCommands:Fa}=function(e,t,n,a){const[i,r]=(0,o.eJ)(),[s,c,l]=(0,D.Z)(!1),d=(0,K.CH)((()=>{const n=t();return e&&n.startsWith("/")?(0,G._)(n).match(Q)?.[0].trim():void 0}),[t,e],300),u=(0,J.Z)(d,[d,t],!0);return(0,o.d4)((()=>{const e=u(),t=n||a;if(!e||!t)return void r(void 0);const o=e.substring(1),i=t.filter((e=>!o||e.command.startsWith(o)));r(i?.length?i:void 0)}),[u,n,a]),(0,o.d4)(l,[l,t]),{isOpen:Boolean(i?.length&&!s),close:c,filteredBotCommands:i}}(Boolean(Hn&&C&&de&&(Ft&&Ft?.length||Bt?.length)),On,Ft,Bt);(e=>{let{draft:t,chatId:n,threadId:s,getHtml:c,setHtml:l,editedMessage:d,isDisabled:u}=e;const{saveDraft:m,clearDraft:h,loadCustomEmojis:g}=(0,a.Sv)(),f=(0,o.sO)(!1);(0,o.d4)((()=>{const e=c(),n=void 0!==t?.isLocal;(0,A.z)(t)!==e||n?f.current=!0:f.current=!1}),[t,c]),(0,o.d4)((()=>{f.current=!1}),[n,s]);const v=Boolean(d),E=(0,$.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(u||v||!f.current)return;const t=c();var o,a,i,r;t?m({chatId:null!==(o=e.chatId)&&void 0!==o?o:n,threadId:null!==(a=e.threadId)&&void 0!==a?a:s,draft:(0,Z.ZP)(t)}):h({chatId:null!==(i=e.chatId)&&void 0!==i?i:n,threadId:null!==(r=e.threadId)&&void 0!==r?r:s})})),y=(0,ve.Z)(i.r_R,!0,void 0,[n,s]);(0,fe.Z)((e=>{let[o,a,c]=e;if(u)return;const m=f.current;if(n===o&&s===a){if(m&&!t)return;if(!t&&c&&l(""),m)return}if(d||!t)return;l((0,A.z)(t));const h=t.entities?.map((e=>e.type===ee.Vv.CustomEmoji&&e.documentId)).filter(Boolean)||[];h.length&&g({ids:h}),P.$b||(0,r.Yq)((()=>{const e=document.querySelector(i.Edp);e&&(0,p.Z)(e,!0)}))}),[n,s,t,c,l,d,u]),(0,o.d4)((()=>{if(!u)return()=>{v||E({chatId:n,threadId:s}),Pe=!0,(0,r.i$)((()=>{Pe=!1}))}}),[n,s,v,E,u]);const b=(0,V.Y)(n),C=(0,V.Y)(s);(0,o.d4)((()=>{if(u||Pe)return;if(!c())return void E();const e=b.current,t=C.current;y((()=>{b.current===e&&C.current===t&&E()}))}),[b,c,u,y,C,E]),(0,ge.Z)(E),(0,Ze.Z)(E)})({draft:ce,chatId:oe,threadId:ae,getHtml:On,setHtml:Ln,editedMessage:ne,isDisabled:_n});const Ba=(0,$.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e||Ln(""),co(g.D),mo(void 0),ha(),va(),ya(),Ca(),w?setTimeout((()=>Vo()),350):Vo()})),[Ua,$a,ja]=((e,t,n,c,l,d,u,m,h,g,f)=>{const{editMessage:v,setEditingDraft:P,toggleMessageWebPage:E}=(0,a.Sv)(),[y,b]=(0,o.eJ)(!1);(0,L.Z)((e=>{let[o,a]=e;if(!n)return;if(f&&a!==f)return t(""),void b(!1);if(o?.id===n.id&&f===a)return;const s=!o&&g?.text.length?g:n.content.text,c=(0,A.z)(s);t(c),b(!0),(0,r.Yq)((()=>{const e=document.querySelector(i.Edp);e&&(0,p.Z)(e,!0)}))}),[n,f,g,t]),(0,o.d4)((()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some((e=>Ee.has(e.type)));E({chatId:d,threadId:u,noWebPage:e})}),[d,u,n]),(0,o.d4)((()=>{if(n)return()=>{const t=(0,Z.ZP)(e()),n=t.text.length?t:void 0;P({chatId:d,threadId:u,type:m,text:n})}}),[d,n,e,P,u,m]);const C=(0,K.iD)((()=>{if(!n)return!1;const t=(0,Z.ZP)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some((e=>Ee.has(e.type)))&&!t.entities?.some((e=>Ee.has(e.type)))}),[n,e],300,!0),w=(0,J.Z)(C,[C,e],!0);(0,L.Z)((e=>{let[t]=e;n&&t?.id===n.id&&w()&&E({chatId:d,threadId:u,noWebPage:!1})}),[n,d,e,u,w]);const S=(0,$.Z)((()=>{h&&(0,r.i$)((()=>{t((0,A.z)(h)),(0,r.Yq)((()=>{const e=document.querySelector(i.Edp);e&&(0,p.Z)(e,!0)}))}))})),N=(0,$.Z)((()=>{c(),S()})),I=(0,$.Z)((()=>{const{text:t,entities:o}=(0,Z.ZP)(e());n&&(t||(0,s.u8)(n)?(v({messageList:{chatId:d,threadId:u,type:m},text:t,entities:o}),c(),S()):l())})),M=(0,$.Z)((()=>{if(!n)return;const t=(0,Z.ZP)(e()),o=t.text.length?t:void 0;P({chatId:d,threadId:u,type:m,text:o})}));return(0,ge.Z)(M),(0,Ze.Z)(M),[I,N,y]})(On,Ln,ne,Ba,Ko,oe,ae,se,ce,Ht,_t),Ha=(0,V.Y)(Ba),_a=(0,V.Y)(oa);(0,o.d4)((()=>()=>{_a.current(),Ha.current()}),[oe,ae,Ha,_a]);const za=(0,$.Z)((()=>{const e=oo.current;Nn(e?{message:Tn("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:it,shouldReplaceHistory:!0}},actionText:Tn("Open")}:{message:Tn("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:Tn("PremiumMore")}),oo.current=Number(!e)})),Ya=(0,O.Z)((()=>Gn||!un||On()&&!lo?ne&&ja?Mt.Edit:!P.mh||ia||je||On()&&!lo?l?Mt.Schedule:Mt.Send:Mt.Record:Mt.Forward),[ia,ne,On,lo,je,Gn,un,ja,l]),Va=!l,{isContextMenuOpen:Xa,handleContextMenu:qa,handleContextMenuClose:Wa,handleContextMenuHide:Ga}=(0,R.Z)(sa,!(Ya===Mt.Send&&Va)),{contextMenuPosition:Ka,handleContextMenu:Ja,handleBeforeContextMenu:Qa,handleContextMenuHide:ei}=(0,R.Z)(Rn,!_n);(0,o.d4)((()=>{$e||Ka&&(Mn({storyUserId:oe,storyId:ie,position:Ka}),ei())}),[oe,ei,$e,ie,Ka]),he(de||_n,Io,Fo,mo,ne,!ue&&!Re,za);const ti=(0,$.Z)((()=>{ne&&$a()})),ni=(0,$.Z)(((e,t)=>{const n=t?Pt:4096;if(e?.length>n){const t=e.length-n;return pn({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0})),oi=(0,$.Z)((()=>{if(Kt&&!ua){const e=document.querySelector(Qt),t=(0,v.bp)(),n=Un.current&&Math.floor(t-Un.current),o=Kt.nextSendDate&&Kt.nextSendDate>t;if(n&&n<Kt.seconds||o){const a=o?Kt.nextSendDate-t:Kt.seconds-n;return pn({data:{message:Tn("SlowModeHint",(0,m.k9)(a)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0})),ai=(0,$.Z)((e=>{let{attachments:t,sendCompressed:n=Wt.shouldCompress,sendGrouped:o=Wt.shouldSendGrouped,isSilent:a,scheduledAt:i}=e;if(!re&&!ie)return;const{text:s,entities:c}=(0,Z.ZP)(On());(s||t.length)&&ni(s,!0)&&oi()&&(mn({messageList:re,text:s,entities:c,scheduledAt:i,isSilent:a,shouldUpdateStickerSetOrder:Jt,attachments:I(t,n),shouldGroupMessages:o}),Un.current=(0,v.bp)(),hn({chatId:oe,localOnly:!0}),(0,r.i$)((()=>{Ba()})))})),ii=(0,$.Z)(((e,t,n,o)=>{ai({attachments:so,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:o})})),ri=(0,$.Z)((async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;if(!re&&!ie)return;let n=so;if(ia){const e=await oa();if(e){const{blob:t,duration:o,waveform:a}=e;n=[await N(kt,t,{voice:{duration:o,waveform:a}})]}}const{text:o,entities:a}=(0,Z.ZP)(On());if(n.length)return void ai({attachments:n});if(!o&&!je)return;if(!ni(o))return;const i=document.querySelector(Qt);if(o){if(!oi())return;mn({messageList:re,text:o,entities:a,scheduledAt:t,isSilent:e,shouldUpdateStickerSetOrder:Jt})}je&&gn({scheduledAt:t,isSilent:e}),Un.current=(0,v.bp)(),hn({chatId:oe,localOnly:!0}),P.cj&&i&&i===document.activeElement&&b(i),(0,r.i$)((()=>{Ba()}))})),si=(0,$.Z)((()=>{"webApp"===Vt?.type&&wn({chatId:oe,url:Vt.url,threadId:ae})})),ci=(0,$.Z)((()=>{Vo(),Ho()})),li=(0,$.Z)(((e,t,n)=>{if(e&&"queryId"in e){const{id:o,queryId:a,isSilent:i}=e;return void yn({id:o,queryId:a,scheduledAt:t,isSilent:i,messageList:n})}const{isSilent:o,...a}=e||{};if(e&&0!==Object.keys(a).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:n=!1,sendGrouped:a=!1}=e;ii(n,a,o,t)}else mn({...e,messageList:n,scheduledAt:t});else ri(Boolean(o),t)}));(0,L.Z)((e=>{let[t]=e;re&&Et&&Et!==t&&ao((e=>{li(Et,e,re)}))}),[Et,re,li,ao]),(0,o.d4)((()=>{zt&&(Ln(zt),Cn(),(0,r.Yq)((()=>{const e=document.getElementById(en);(0,p.Z)(e,!0)})))}),[en,zt,Cn,Ln]),(0,o.d4)((()=>{Yt?.length&&(Oo(Yt),Cn())}),[Oo,Yt,Cn]);const di=(0,$.Z)(((e,t)=>{e.isFree||ue||Re?Mo(e,t):za()})),ui=(0,$.Z)((e=>{di(e,i.nYf)})),mi=(0,$.Z)(((e,t,n)=>{(re||ie)&&(l||n?(Xn(),ao((n=>{qn(),li({gif:e,isSilent:t},n,re),(0,r.i$)((()=>{Ba(!0)}))}))):(mn({messageList:re,gif:e,isSilent:t}),(0,r.i$)((()=>{Ba(!0)}))))})),hi=(0,$.Z)((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4?arguments[4]:void 0;(re||ie)&&(e={...e,isPreloadedGlobally:!0},l||n?(Xn(),ao((n=>{qn(),li({sticker:e,isSilent:t},n,re),(0,r.i$)((()=>{Ba(o)}))}))):(mn({messageList:re,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:Jt&&a}),(0,r.i$)((()=>{Ba(o)}))))})),pi=(0,$.Z)(((e,t,n)=>{if(!re&&!ie)return;l||n?ao((n=>{li({id:e.id,queryId:e.queryId,isSilent:t},n,re)})):yn({id:e.id,queryId:e.queryId,isSilent:t,messageList:re});const o=document.querySelector(Qt);P.cj&&o&&o===document.activeElement&&b(o),hn({chatId:oe,localOnly:!0}),(0,r.i$)((()=>{Ba()}))})),gi=(0,$.Z)((()=>{hn({chatId:oe,localOnly:!0}),(0,r.i$)((()=>{Ba()}))})),Zi=(0,$.Z)((e=>{re&&(l?(ao((t=>{li({poll:e},t,re)})),fn()):(mn({messageList:re,poll:e}),fn()))})),fi=(0,$.Z)((e=>{if(l)ao((t=>{li({...e,isSilent:!0},t,re)}));else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1}=e;ii(t,n,!0)}else ri(!0)})),vi=(0,$.Z)((()=>{const e=document.querySelector(Qt);if(!w||e!==document.activeElement)return _o(),Vo(),void qo();e?.blur(),setTimeout((()=>{_o(),Vo(),qo()}),100)}));(0,o.d4)((()=>{wo&&Ln("")}),[wo,Ln,so]);const Pi=(0,$.Z)((e=>{No(e,i.nYf)})),Ei=(0,$.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:en;const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,x.R)(n,e))return void document.execCommand("delete",!1)}Ln(h(On()))})),yi=(0,$.Z)((()=>{Ei(i.nYf)})),bi=(0,$.Z)((()=>{Pn({id:oe,threadId:ae,type:"scheduled",noForumTopicPanel:!0})}));(0,o.d4)((()=>{De&&w&&Vo()}),[De,Vo,w]),(0,o.d4)((()=>{C&&(Fe?ea():setTimeout((()=>{ta()}),200))}),[Fe,ta,ea,C]);const Ci=be&&"webApp"===Vt?.type&&!ne,wi=(0,O.Z)((()=>Ci&&!On()&&!ia),[Ci,On,ia]),[Si,Ni]=(0,o.Ye)((()=>Kt?.nextSendDate?["SlowModeWait",Kt.nextSendDate]:dn?.activeUntil&&_n?["StealthModeActiveHint",dn.activeUntil]:[]),[_n,Kt?.nextSendDate,dn?.activeUntil]),Ii=Bo||zo||ma||Xo||ba||Na||Go||jo||Qn||Ea||La||fa||wi||Xa||Boolean(ia)||so.length>0||Gn,Mi=Ii&&!$e&&_n&&!Qn&&!zo;(0,o.d4)((()=>{Ii?M?.():te?.()}),[Ii,te,M]);const{shouldRender:ki,transitionClassNames:xi}=(0,z.Z)(Mi),Ti=!(Ya!==Mt.Record||go&&me&&vo),Ai=(0,$.Z)((()=>{switch(Ya){case Mt.Forward:un?.();break;case Mt.Send:ri();break;case Mt.Record:Ti?me?vo||In({chatId:oe}):Nn({message:Tn("VoiceMessagesRestrictedByPrivacy",le?.title)}):na();break;case Mt.Edit:Ua();break;case Mt.Schedule:if(ia&&aa(),!re)return;ao((e=>{li({},e,re)}))}})),Ri=(0,j.Z)(ne,!0),Oi=ne||Ri,Li=new Date;Li.setSeconds(0),Li.setMilliseconds(0);const Di=new Date;Di.setFullYear(Di.getFullYear()+1);let Fi="SendMessage";switch(Ya){case Mt.Forward:Fi="Forward";break;case Mt.Edit:Fi="Save edited message";break;case Mt.Record:Fi=go?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const Bi=(0,d.Z)("Composer",!Fe&&"shown",Qo&&"hover-disabled",Dn&&"mounted",nn),Ui=(0,$.Z)((e=>{let t,n;if("emoticon"in e)t=e.emoticon;else{const o=(0,a.Rd)().customEmojis.byId[e.documentId];if(!o)return;if(!o.isFree&&!ue&&!Re)return void za();const i=(0,Z.ZP)((0,k.yR)(o));t=i.text,n=i.entities}mn({text:t,entities:n,isReaction:!0}),kn()})),$i=(0,$.Z)((e=>{Mn({storyUserId:oe,storyId:ie,position:e,sendAsMessage:!0})})),ji=(0,$.Z)((()=>{xn({userId:oe,storyId:ie,reaction:ln?void 0:xt})})),Hi=(0,$.Z)((()=>{ao((e=>{li({},e,re)}))})),_i=(0,$.Z)((()=>{fi()})),zi=(0,$.Z)((()=>{li({},i.t4X,re)})),Yi=(0,$.Z)(((e,t)=>{ao((n=>{li({sendCompressed:e,sendGrouped:t},n,re)}))})),Vi=(0,$.Z)(((e,t)=>{fi({sendCompressed:e,sendGrouped:t})})),Xi=Ya===Mt.Edit?Ua:Ya===Mt.Schedule?Hi:ri,qi=be&&"commands"===Vt?.type&&!ne&&!1!==Ft&&!ia;return o.ZP.createElement("div",{className:Bi},Hn&&go&&C&&o.ZP.createElement(dt,{isOpen:c!==lt.t.None,withQuick:c===lt.t.QuickFile||$n===lt.t.QuickFile,onHide:S,onFileSelect:Oo}),ki&&o.ZP.createElement(Ct.Z,{topReactions:an,allAvailableReactions:on,onToggleReaction:Ui,isPrivate:!0,isReady:C,canBuyPremium:rn,isCurrentUserPremium:ue,canPlayAnimatedEmojis:sn,onShowMore:$i,className:xi}),o.ZP.createElement(He,{chatId:oe,threadId:ae,canShowCustomSendMenu:Va,attachments:so,getHtml:On,isReady:C,shouldSuggestCompression:xo,shouldForceCompression:To,shouldForceAsFile:Ao,isForCurrentMessageList:de,isForMessage:Hn,shouldSchedule:l,forceDarkTheme:_n,onCaptionUpdate:Lo,onSendSilent:Vi,onSend:ii,onSendScheduled:Yi,onFileAppend:Ro,onClear:Do,onAttachmentsUpdate:Fo,onCustomEmojiSelect:ui,onRemoveSymbol:yi,onEmojiSelect:Pi}),o.ZP.createElement(gt,{isOpen:_e.isOpen,isQuiz:_e.isQuiz,shouldBeAnonymous:Oe,onClear:fn,onSend:Zi}),Oi&&o.ZP.createElement(Nt,{isOpen:Go,isSchedule:"scheduled"===se,onClose:Jo,message:Oi}),o.ZP.createElement(Zt,{isOpen:Xo,onClose:Wo,chatId:oe,selectedSendAsId:jt,sendAsPeerIds:zn,isCurrentUserPremium:ue}),o.ZP.createElement(ht,{isOpen:ba,filteredUsers:Sa,onInsertUserName:wa,onClose:Ca}),o.ZP.createElement(Je,{isOpen:La,withUsername:Boolean(Bt),botCommands:Fa,getHtml:On,onClick:gi,onClose:Da}),o.ZP.createElement("div",{className:(0,d.Z)("composer-wrapper",_n&&"with-story-tweaks")},o.ZP.createElement("svg",{className:"svg-appendix",width:"9",height:"20"},o.ZP.createElement("defs",null,o.ZP.createElement("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix"},o.ZP.createElement("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),o.ZP.createElement("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),o.ZP.createElement("feColorMatrix",{values:"0 0 0 0 0.0621962482 0 0 0 0 0.138574144 0 0 0 0 0.185037364 0 0 0 0.15 0",in:"shadowBlurOuter1"}))),o.ZP.createElement("g",{fill:"none","fill-rule":"evenodd"},o.ZP.createElement("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#000",filter:"url(#composerAppendix)"}),o.ZP.createElement("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#FFF",className:"corner"}))),Hn&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(mt,{isOpen:Na,botId:Ia,isGallery:Ma,inlineBotResults:Ta,switchPm:ka,switchWebview:xa,loadMore:Oa,isSavedMessages:Re,canSendGifs:po,isCurrentUserPremium:ue,onSelectResult:pi,onClose:Aa}),o.ZP.createElement(rt,{onClear:ti,shouldForceShowEditing:Boolean(ja&&ne)}),o.ZP.createElement(bt,{chatId:oe,threadId:ae,getHtml:On,isDisabled:!fo||lo})),o.ZP.createElement("div",{className:"message-input-wrapper"},Hn&&o.ZP.createElement(o.ZP.Fragment,null,Ci&&o.ZP.createElement(tt,{isOpen:wi,text:Vt.text,isDisabled:Boolean(ia),onClick:si}),qi&&o.ZP.createElement(qe.Z,{className:(0,d.Z)("bot-commands",jo&&"activated"),round:!0,disabled:void 0===Ft,color:"translucent",onActivate:ci,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon icon-bot-commands-filled"})),Yn&&(Ut||$t)&&o.ZP.createElement(Qe.Z,{round:!0,color:"translucent",onClick:Xo?Wo:vi,ariaLabel:Tn("SendMessageAsTitle"),className:(0,d.Z)("send-as-button",ro.current&&"appear-animation")},o.ZP.createElement(St.Z,{peer:Ut||$t,size:"tiny"}))),(!wo||po||ho)&&o.ZP.createElement(vt.Z,{chatId:oe,threadId:ae,isMobile:w,isReady:C,isSymbolMenuOpen:zo,openSymbolMenu:Yo,closeSymbolMenu:Vo,canSendStickers:ho,canSendGifs:po,isMessageComposer:Hn,onGifSelect:mi,onStickerSelect:hi,onCustomEmojiSelect:di,onRemoveSymbol:Ei,onEmojiSelect:No,closeBotCommandMenu:_o,closeSendAsMenu:Wo,isSymbolMenuForced:Vn,canSendPlainText:!wo,inputCssSelector:Qt,idPrefix:t,forceDarkTheme:_n}),o.ZP.createElement(pt.Z,{ref:An,id:tn,editableInputId:en,customEmojiPrefix:t,isStoryInput:_n,chatId:oe,canSendPlainText:!wo,threadId:ae,isReady:C,isActive:!lo,getHtml:On,placeholder:ia&&jn<=600?"":wo?Tn("Chat.PlaceholderTextNotAllowed"):Ye||Ve||Tn("Message"),timedPlaceholderDate:Ni,timedPlaceholderLangKey:Si,forcedPlaceholder:Ra,canAutoFocus:C&&de&&!lo&&Hn,noFocusInterception:lo,shouldSuppressFocus:w&&zo,shouldSuppressTextFormatter:ma||ba||Na,onUpdate:Ln,onSend:Xi,onSuppressedFocus:Vo,onFocus:Kn,onBlur:Jn}),Hn&&o.ZP.createElement(o.ZP.Fragment,null,Dt&&Boolean(Ia)&&o.ZP.createElement(wt.Z,{color:"gray"}),Xe&&o.ZP.createElement(Qe.Z,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:bi,ariaLabel:"Open scheduled messages"},o.ZP.createElement("i",{className:"icon icon-schedule"})),Boolean(ze)&&!ia&&!ne&&o.ZP.createElement(qe.Z,{className:Bo?"activated":"",round:!0,color:"translucent",onActivate:Uo,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon icon-bot-command"}))),ia&&Boolean(ra)&&o.ZP.createElement("span",{className:"recording-state"},(0,m.rM)(ra-ca.current)),o.ZP.createElement(Ge,{chatId:oe,threadId:ae,isButtonVisible:!ia&&!ne,canAttachMedia:go,canAttachPolls:Zo,canSendPhotos:bo,canSendVideos:yo,canSendDocuments:Co,canSendAudios:Eo,onFileSelect:Oo,onPollCreate:Zn,isScheduled:l,attachBots:Hn?Xt:void 0,peerType:qt,shouldCollectDebugLogs:cn,theme:Gt,onMenuOpen:eo,onMenuClose:to}),Hn&&Boolean(ze)&&o.ZP.createElement(et,{messageId:ze,isOpen:Bo,onClose:$o}),Hn&&Ft&&o.ZP.createElement(Ke,{isOpen:jo,botCommands:Ft,onClose:_o}),o.ZP.createElement(st.Z,{key:`custom-emoji-tooltip-${en}`,chatId:oe,isOpen:fa,onCustomEmojiSelect:Pa,addRecentCustomEmoji:Sn,onClose:va}),o.ZP.createElement(ft,{key:`sticker-tooltip-${en}`,chatId:oe,threadId:ae,isOpen:Ea,onStickerSelect:hi,onClose:ya}),o.ZP.createElement(ut.Z,{key:`emoji-tooltip-${en}`,isOpen:ma,emojis:pa,customEmojis:ga,addRecentEmoji:En,addRecentCustomEmoji:Sn,onEmojiSelect:Za,onCustomEmojiSelect:Za,onClose:ha}))),ia&&o.ZP.createElement(Qe.Z,{round:!0,color:"danger",className:"cancel",onClick:oa,ariaLabel:"Cancel voice recording"},o.ZP.createElement("i",{className:"icon icon-delete"})),_n&&!ia&&o.ZP.createElement(Qe.Z,{round:!0,className:"story-reaction-button",color:"secondary",onClick:ji,onContextMenu:Ja,onMouseDown:Qa,ariaLabel:Tn("AccDescrLike"),ref:Rn},ln&&o.ZP.createElement(It.Z,{containerId:(0,s.hl)(oe,ie),reaction:ln,withEffectOnly:no}),(!ln||no)&&o.ZP.createElement("i",{className:(0,d.Z)("icon","icon-heart",no&&"story-reaction-heart"),"aria-hidden":!0})),o.ZP.createElement(Qe.Z,{ref:sa,round:!0,color:"secondary",className:(0,d.Z)(Ya,"main-button",!C&&"not-ready",ia&&"recording"),disabled:Ti,allowDisabledClick:!0,noFastClick:!0,ariaLabel:Tn(Fi),onClick:Ai,onContextMenu:Ya===Mt.Send&&Va?qa:void 0},o.ZP.createElement("i",{className:"icon icon-send"}),o.ZP.createElement("i",{className:"icon icon-microphone-alt"}),un&&o.ZP.createElement("i",{className:"icon icon-forward"}),Hn&&o.ZP.createElement("i",{className:"icon icon-schedule"}),Hn&&o.ZP.createElement("i",{className:"icon icon-check"})),Va&&o.ZP.createElement(ct.Z,{isOpen:Xa,canSchedule:Hn,canScheduleUntilOnline:y,onSendSilent:Re?void 0:_i,onSendSchedule:l?void 0:Hi,onSendWhenOnline:zi,onClose:Wa,onCloseAnimationEnd:Ga,isSavedMessages:Re}),io)})))},40329:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(33555),i=n(4463),r=n(7054),s=n(32340),c=n(59107),l=n(231),d=n(34563),u=n(70172);const m=(0,o.X$)((0,a.c$)(((e,t)=>{let{chat:n}=t;const o=(0,i.YC)(n.id),a=(0,r.FM1)(e,n.id),s=o&&(0,r.dyD)(e,(0,i.zX)(n)),c=s&&(0,i.cS)(s)&&!n.isSupport,l=o&&!a&&!c,d=o?(0,i.Vl)((0,r.dyD)(e,(0,i.zX)(n))):void 0;return{isPrivateChat:o,isChatWithSelf:a,isBot:c,isChannel:(0,i.eA)(n),isBasicGroup:(0,i.G9)(n),isSuperGroup:(0,i.ZV)(n),currentUserId:e.currentUserId,canDeleteForAll:l,contactName:d}}))((e=>{let{isOpen:t,chat:n,isChannel:r,isPrivateChat:m,isChatWithSelf:h,isBot:p,isBasicGroup:g,isSuperGroup:Z,currentUserId:f,canDeleteForAll:v,contactName:P,onClose:E,onCloseAnimationEnd:y}=e;const{leaveChannel:b,deleteHistory:C,deleteChannel:w,deleteChatUser:S,blockUser:N}=(0,a.Sv)(),I=(0,c.Z)(),M=(0,i.U)(I,n),k=(0,o.I4)((()=>{C({chatId:n.id,shouldDeleteForAll:!0}),E()}),[C,n.id,E]),x=(0,o.I4)((()=>{C({chatId:n.id,shouldDeleteForAll:!0}),N({userId:n.id}),E()}),[n.id,E]),T=(0,o.I4)((()=>{m?C({chatId:n.id,shouldDeleteForAll:!1}):g?(S({chatId:n.id,userId:f}),C({chatId:n.id,shouldDeleteForAll:!1})):!r&&!Z||n.isCreator?(r||Z)&&n.isCreator&&w({chatId:n.id}):b({chatId:n.id}),E()}),[m,g,r,Z,f,n.isCreator,n.id,E,C,S,b,w]),A=(0,o.I4)((()=>{r||Z?(b({chatId:n.id}),E()):T()}),[n.id,T,r,Z,b,E]);return o.ZP.createElement(d.Z,{isOpen:t,className:"DeleteChatModal",header:o.ZP.createElement("div",{className:"modal-header",dir:I.isRtl?"rtl":void 0},o.ZP.createElement(u.Z,{size:"tiny",peer:n,isSavedMessages:h}),o.ZP.createElement("h3",{className:"modal-title"},I(r&&!n.isCreator?"LeaveChannel":r&&n.isCreator?"ChannelDelete":g||Z?"Group.LeaveGroup":"DeleteChatUser"))),onClose:E,onCloseAnimationEnd:y},r&&n.isCreator?o.ZP.createElement("p",null,(0,s.Z)(I("ChatList.DeleteAndLeaveGroupConfirmation",M),["simple_markdown","emoji"])):r&&!n.isCreator||g||Z?o.ZP.createElement("p",null,(0,s.Z)(I("ChannelLeaveAlertWithName",M),["simple_markdown","emoji"])):o.ZP.createElement("p",null,(0,s.Z)(I("ChatList.DeleteChatConfirmation",P),["simple_markdown","emoji"])),o.ZP.createElement("div",{className:"dialog-buttons-column"},p&&o.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:x},I("DeleteAndStop")),v&&o.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:k},P?(0,s.Z)(I("ChatList.DeleteForEveryone",P)):I("DeleteForAll")),!m&&n.isCreator&&o.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},I("DeleteForAll")),o.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:m?T:A},I(r&&!n.isCreator?"LeaveChannel":r&&n.isCreator?"Chat.Input.Delete":g||Z?"Group.LeaveGroup":v?"ChatList.DeleteForCurrentUser":"Delete")),o.ZP.createElement(l.Z,{className:"confirm-dialog-button",isText:!0,onClick:E},I("Cancel"))))})))},82535:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(60748),a=n(33555),i=n(83716),r=n(4463),s=n(15376),c=n(60706),l=n(3657),d=n(59107),u=n(25190),m=n(6202),h=n(6701),p=n(14605),g=n(17551),Z=n(47002);const f=new Set(["svg","svgz"]),v=(0,o.X$)((e=>{let{message:t,observeIntersection:n,smaller:v,canAutoLoad:P,autoLoadFileMaxSizeMb:E,uploadProgress:y,withDate:b,datetime:C,className:w,sender:S,isSelected:N,isSelectable:I,shouldWarnAboutSvg:M,isDownloading:k,onCancelUpload:x,onMediaClick:T,onDateClick:A}=e;const{cancelMessageMediaDownload:R,downloadMessageMedia:O,setSettingOption:L}=(0,a.Sv)(),D=(0,o.sO)(null),F=(0,d.Z)(),[B,U,$]=(0,c.Z)(),[j,H]=(0,o.eJ)(!1),_=t.content.document,{fileName:z,size:Y,timestamp:V}=_,X=(0,s.K2)(_)||"",q=(0,l.Op)(D,n),[W,G]=(0,c.Z)();(0,o.d4)((()=>{q&&G()}),[q,G]);const[K,J]=(0,o.eJ)(P&&(!E||Y<=1048576*E)),Q=Boolean(k||K&&W),ee=(0,r.Ti)(t,"download"),{loadProgress:te,mediaData:ne}=(0,h.Z)(ee,!Q,(0,r.kG)(t,"download"),void 0,!0),oe=Boolean(ne),{isUploading:ae,isTransferring:ie,transferProgress:re}=(0,r.Sc)(t,y||te,Q&&!oe),se=(0,s.v6)(_),ce=se?(0,r.DH)(t):void 0,le=se?_.previewBlobUrl:void 0,de=(0,m.Z)((0,r.Ti)(t,"pictogram"),!q),ue=T&&Boolean(_.mediaType)&&(i.wGh.has(_.mimeType)||i.oGt.has(_.mimeType)),me=(0,u.Z)((()=>{O({message:t})})),he=(0,u.Z)((()=>{ae?x&&x():k?R({message:t}):ie?J(!1):ue?T():f.has(X)&&M?U():me()})),pe=(0,u.Z)((()=>{L({shouldWarnAboutSvg:!j}),$(),me()})),ge=(0,u.Z)((()=>{A(t.id,t.chatId)}));return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(Z.Z,{ref:D,name:z,extension:X,size:Y,timestamp:b?C||V:void 0,thumbnailDataUri:ce,previewData:le||de,smaller:v,isTransferring:ie,isUploading:ae,transferProgress:re,className:w,sender:S,isSelectable:I,isSelected:N,actionIcon:ue?(0,r.hC)(t)?"play":"eye":"download",onClick:he,onDateClick:A?ge:void 0}),o.ZP.createElement(g.Z,{isOpen:B,onClose:$,confirmHandler:pe},F("lng_launch_svg_warning"),o.ZP.createElement(p.Z,{className:"dialog-checkbox",checked:j,label:F("lng_launch_exe_dont_ask"),onCheck:H})))}))},78780:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(46752),i=n(32340),r=n(59107);const s=e=>{let{content:t,className:n}=e;const s=(0,r.Z)();return o.ZP.createElement("span",{className:(0,a.Z)("DotAnimation",n),dir:s.isRtl?"rtl":"auto"},(0,i.Z)(t),o.ZP.createElement("span",{className:"ellipsis"}))}},84441:(e,t,n)=>{n.d(t,{Z:()=>f});var o=n(60748),a=n(4463),i=n(46752),r=n(74399),s=n(32340),c=n(39415),l=n(3657),d=n(59107),u=n(6202),m=n(2903),h=n(75368),p=n(78323),g=n(62230),Z=n(45370);const f=e=>{let{className:t,message:n,sender:f,title:v,customText:P,isProtected:E,noUserColors:y,hasContextMenu:b,chatTranslations:C,requestedChatTranslationLanguage:w,observeIntersectionForLoading:S,observeIntersectionForPlaying:N,onClick:I}=e;const M=(0,o.sO)(null),k=(0,l.Op)(M,S),x=(0,u.Z)(n&&(0,a.Ti)(n,"pictogram"),!k),T=(0,m.Z)(n),A=Boolean(n&&(0,a.Y5)(n)),R=Boolean(n&&(0,a.NE)(n)),O=n&&(0,a.cT)(n),{translatedText:L}=(0,h.Z)(C,n?.chatId,O?n?.id:void 0,w),D=(0,d.Z)(),F=f?(0,a.OU)(D,f):n?.forwardInfo?.hiddenUserName,{handleClick:B,handleMouseDown:U}=(0,c.m)(I);return o.ZP.createElement("div",{ref:M,className:(0,i.Z)("EmbeddedMessage",t,f&&!y&&`color-${(0,a.kj)(f)}`),onClick:n&&B,onMouseDown:n&&U},T&&function(e,t,n,a,s){const{width:c,height:l}=(0,r.W7)(),d=t||e;return o.ZP.createElement("div",{className:(0,i.Z)("embedded-thumb",n&&"round")},!s&&o.ZP.createElement("img",{src:d,width:c,height:l,alt:"",className:"pictogram",draggable:!1}),o.ZP.createElement(g.Z,{thumbDataUri:d,isVisible:Boolean(s),width:c,height:l}),a&&o.ZP.createElement("span",{className:"protector"}))}(T,x,A,E,R),o.ZP.createElement("div",{className:"message-text"},o.ZP.createElement("p",{dir:"auto"},n?(0,a.FT)(n)?o.ZP.createElement(p.Z,{message:n,isEmbedded:!0,observeIntersectionForLoading:S,observeIntersectionForPlaying:N}):o.ZP.createElement(Z.Z,{lang:D,message:n,noEmoji:Boolean(T),translatedText:L,observeIntersectionForLoading:S,observeIntersectionForPlaying:N}):P||" "),o.ZP.createElement("div",{className:"message-title",dir:"auto"},(0,s.Z)(F||v||" "))),b&&o.ZP.createElement("i",{className:"embedded-more icon icon-more"}))}},47002:(e,t,n)=>{n.d(t,{Z:()=>f});var o=n(60748),a=n(46752),i=n(790),r=n(97184),s=n(15376),c=n(74399),l=n(32340),d=n(42797),u=n(15866),m=n(59107),h=n(70692),p=n(31212),g=n(8337),Z=n(39196);const f=(0,o.X$)((e=>{let{ref:t,name:n,size:f,extension:v="",timestamp:P,sender:E,thumbnailDataUri:y,previewData:b,className:C,smaller:w,isTransferring:S,isUploading:N,isSelectable:I,isSelected:M,transferProgress:k,actionIcon:x,onClick:T,onDateClick:A}=e;const R=(0,m.Z)();let O=(0,o.sO)(null);t&&(O=t);const{isMobile:L}=(0,d.ZP)(),[D]=(0,o.eJ)(!b),F=Boolean(b),B=(0,u.Z)(y,F,L&&!r.vX),U=(0,h.Z)(!F),{shouldRender:$,transitionClassNames:j}=(0,p.Z)(S,void 0,!0),H=(0,s.Oh)(v),_=(0,s.yW)(f),z=(0,o.Ye)((()=>S&&k?`${(0,s.yW)(f*k)} / ${_}`:_),[S,f,_,k]),{width:Y,height:V}=(0,c.lE)(w),X=(0,a.Z)("File",C,w&&"smaller",T&&!N&&"interactive",M&&"file-is-selected");return o.ZP.createElement("div",{ref:O,className:X,dir:R.isRtl?"rtl":void 0},I&&o.ZP.createElement("div",{className:"message-select-control"},M&&o.ZP.createElement("i",{className:"icon icon-select"})),o.ZP.createElement("div",{className:"file-icon-container",onClick:N?void 0:T},y||b?o.ZP.createElement("div",{className:"file-preview media-inner"},o.ZP.createElement("img",{src:b,className:"full-media",width:Y,height:V,draggable:!1,alt:""}),D&&o.ZP.createElement("canvas",{ref:B,className:(0,a.Z)("thumbnail",U)})):o.ZP.createElement("div",{className:`file-icon ${H}`},v.length<=4&&o.ZP.createElement("span",{className:"file-ext",dir:"auto"},v)),$&&o.ZP.createElement("div",{className:(0,a.Z)("file-progress",H,j)},o.ZP.createElement(Z.Z,{progress:k,size:w?"s":"m",onClick:N?T:void 0})),T&&o.ZP.createElement("i",{className:(0,a.Z)("action-icon","icon",x?`icon-${x}`:"icon-download",$&&"hidden")})),o.ZP.createElement("div",{className:"file-info"},o.ZP.createElement("div",{className:"file-title",dir:"auto",title:n},(0,l.Z)(n)),o.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},o.ZP.createElement("span",null,z),E&&o.ZP.createElement("span",{className:"file-sender"},(0,l.Z)(E)),!E&&Boolean(P)&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"bullet"}),o.ZP.createElement(g.Z,{onClick:A},(0,i.ZK)(R,1e3*P,!0))))),E&&Boolean(P)&&o.ZP.createElement(g.Z,{onClick:A},(0,i.VX)(R,1e3*P)))}))},98799:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(33555),i=n(91713),r=n(4463),s=n(7054),c=n(46752),l=n(74399),d=n(32340),u=n(59107),m=n(25190),h=n(70172),p=n(78780),g=n(2153),Z=n(2995),f=n(68729);const v=2.5*l.Gw,P=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,threadId:o}=t;const a=(0,s.Z1J)(e,n),i=o?(0,s.tZg)(e,n,o):void 0,r=a?(0,s.YK0)(e,a):void 0,c=Boolean((0,s.Zwk)(e,n)),l=o?a?.topics?.[o]:void 0;return{chat:a,threadInfo:i,onlineCount:r,topic:l,areMessagesLoaded:c,messagesCount:l&&(0,s.xxG)(e,n,o)}}))((e=>{let{typingStatus:t,className:n,avatarSize:s="medium",noAvatar:l,status:P,withDots:E,withMediaViewer:y,withUsername:b,withFullInfo:C,withUpdatingStatus:w,withChatType:S,threadInfo:N,noRtl:I,chat:M,onlineCount:k,areMessagesLoaded:x,topic:T,messagesCount:A,noStatusOrTyping:R,onClick:O}=e;const{loadFullChat:L,openMediaViewer:D,loadProfilePhotos:F}=(0,a.Sv)(),B=(0,u.Z)(),U=M&&(0,r.ZV)(M),$=Boolean(M?.isForum&&N&&T),{id:j,isMin:H,isRestricted:_}=M||{};(0,o.d4)((()=>{j&&!H&&(C&&L({chatId:j}),y&&F({profileId:j}))}),[j,H,C,L,F,U,y]);const z=(0,m.Z)(((e,t)=>{M&&t&&(e.stopPropagation(),D({avatarOwnerId:M.id,mediaId:0,origin:"jumbo"===s?i.bZ.ProfileAvatar:i.bZ.MiddleHeaderAvatar}))})),Y=(0,o.Ye)((()=>M&&b&&(0,r.WS)(M)),[M,b]);if(M)return o.ZP.createElement("div",{className:(0,c.Z)("ChatInfo",n),dir:!I&&B.isRtl?"rtl":void 0,onClick:O},!l&&!$&&o.ZP.createElement(h.Z,{key:M.id,size:s,peer:M,onClick:y?z:void 0}),$&&o.ZP.createElement(Z.Z,{topic:T,className:"topic-header-icon",size:v}),o.ZP.createElement("div",{className:"info"},T?o.ZP.createElement("h3",{dir:"auto",className:"fullName"},(0,d.Z)(T.title)):o.ZP.createElement(g.Z,{peer:M}),!R&&function(){if(P)return E?o.ZP.createElement(p.Z,{className:"status",content:P}):o.ZP.createElement("span",{className:"status",dir:"auto"},P);if(w&&!x&&!_)return o.ZP.createElement(p.Z,{className:"status",content:B("Updating")});if(!M)return;if(t)return o.ZP.createElement(f.Z,{typingStatus:t});if($)return o.ZP.createElement("span",{className:"status",dir:"auto"},A?B("messages",A,"i"):(0,d.Z)(M.title));if(S)return o.ZP.createElement("span",{className:"status",dir:"auto"},B((0,r.l6)(M)));const e=function(e,t){const n=e((0,r.l6)(t)),{membersCount:o}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":o?e("Channel"===n?"Subscribers":"Members",o,"i"):n}(B,M),n=k?`, ${B("OnlineCount",k,"i")}`:void 0;return o.ZP.createElement("span",{className:"status"},Y&&o.ZP.createElement("span",{className:"handle"},Y),o.ZP.createElement("span",{className:"group-status"},e),n&&o.ZP.createElement("span",{className:"online-status"},n))}()))})))},76844:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(790),i=n(59107),r=n(8018);const s=(0,o.X$)((e=>{let{message:t,outgoingStatus:n}=e;const s=(0,i.Z)();return o.ZP.createElement("div",{className:"LastMessageMeta"},n&&o.ZP.createElement(r.Z,{status:n}),o.ZP.createElement("span",{className:"time"},(0,a.VX)(s,1e3*t.date)))}))},13709:(e,t,n)=>{n.d(t,{Z:()=>p});var o=n(60748),a=n(4463),i=n(46752),r=n(790),s=n(3858),c=n(60706),l=n(3657),d=n(25190),u=n(6202),m=n(70692),h=n(62230);const p=(0,o.X$)((e=>{let{message:t,idPrefix:n="shared-media",isProtected:p,observeIntersection:g,onClick:Z}=e;const f=(0,o.sO)(null),v=(0,l.Op)(f,g),P=(0,a.DH)(t),E=(0,u.Z)((0,a.Ti)(t,"pictogram"),!v),y=(0,m.Z)(E),b=(0,a.b7)(t),C=(0,a.NE)(t),[w,,S]=(0,c.Z)(C),N=(0,d.Z)((()=>{S(),Z(t.id,t.chatId)}));return o.ZP.createElement("div",{ref:f,id:`${n}${(0,a.d0)(t.id)}`,className:"Media scroll-item",onClick:Z?N:void 0},o.ZP.createElement("img",{src:P,className:"media-miniature",alt:"",draggable:!p,decoding:"async",onContextMenu:p?s.Z:void 0}),o.ZP.createElement("img",{src:E,className:(0,i.Z)("full-media","media-miniature",y),alt:"",draggable:!p,decoding:"async",onContextMenu:p?s.Z:void 0}),C&&o.ZP.createElement(h.Z,{thumbDataUri:E||P,isVisible:w,className:"media-spoiler"}),b&&o.ZP.createElement("span",{className:"video-duration"},b.isGif?"GIF":(0,r.k9)(b.duration)),p&&o.ZP.createElement("span",{className:"protector"}))}))},62230:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(46752),i=n(15866),r=n(25190),s=n(31212);const c=(0,o.X$)((e=>{let{isVisible:t,withAnimation:n,thumbDataUri:c,className:l,width:d,height:u}=e;const m=(0,o.sO)(null),{shouldRender:h,transitionClassNames:p}=(0,s.Z)(t,void 0,!0,!n&&void 0,void 0,500),g=(0,i.Z)(c,!h,void 0,25,d,u),Z=(0,r.Z)((e=>{if(!m.current)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,a=n-t.width/2,i=o-t.height/2;m.current.setAttribute("style",`--click-shift-x: ${a}px; --click-shift-y: ${i}px`)}));if(h)return o.ZP.createElement("div",{className:(0,a.Z)("MbgQHglBDZLEAHDebnxc",p,l,n&&"zFmCa6knHOC8UhmcYHq8"),ref:m,onClick:n?Z:void 0},o.ZP.createElement("canvas",{ref:g,className:"oQmroREXWSylQXgjAdIB",width:d,height:u}),o.ZP.createElement("div",{className:"leAfUrALDfdpl4i8VEmv"}))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(2255),i=function(e){return e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read",e}(i||{});const r=(0,o.X$)((e=>{let{status:t}=e;return o.ZP.createElement("div",{className:"MessageOutgoingStatus"},o.ZP.createElement(a.Z,{name:"reveal",activeKey:i[t]},"failed"===t?o.ZP.createElement("div",{className:"MessageOutgoingStatus--failed"},o.ZP.createElement("i",{className:"icon icon-message-failed"})):o.ZP.createElement("i",{className:`icon icon-message-${t}`})))}))},47262:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(60748),a=n(46752),i=n(32340),r=n(59107),s=n(31212);const c="Nothing found.",l=(0,o.X$)((e=>{let{text:t=c,description:n}=e;const l=(0,r.Z)(),{transitionClassNames:d}=(0,s.Z)(!0);return o.ZP.createElement("div",{className:(0,a.Z)("NothingFound",d,n&&"with-description")},t,n&&o.ZP.createElement("p",{className:"description"},(0,i.Z)(l(n),["br"])))}))},99364:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(60748),a=n(83716),i=n(57710),r=n(46752),s=n(3858),c=n(97184),l=n(42797),d=n(59107),u=n(28183),m=n(231);const h=(0,o.X$)((e=>{let{isLoading:t=!1,isPasswordVisible:n,error:h,hint:p,placeholder:g="Password",submitLabel:Z="Next",description:f,shouldShowSubmit:v,shouldResetValue:P,shouldDisablePasswordManager:E=!1,noRipple:y=!1,clearError:b,onChangePasswordVisibility:C,onInputChange:w,onSubmit:S}=e;const N=(0,o.sO)(null),I=(0,d.Z)(),{isMobile:M}=(0,l.ZP)(),[k,x]=(0,o.eJ)(""),[T,A]=(0,o.eJ)(!1),R=M?550:400;return(0,o.d4)((()=>{P&&x("")}),[P]),(0,u.Z)((()=>{c.$b||N.current.focus()}),R),(0,o.d4)((()=>{h&&(0,i.WM)((()=>{N.current.focus(),N.current.select()}))}),[h]),o.ZP.createElement("form",{action:"",onSubmit:S?function(e){e.preventDefault(),t||T&&S(k)}:s.Z,autoComplete:"off"},o.ZP.createElement("div",{className:(0,r.Z)("input-group password-input",k&&"touched",h&&"error"),dir:I.isRtl?"rtl":void 0},E&&o.ZP.createElement("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),o.ZP.createElement("input",{ref:N,className:"form-control",type:n?"text":"password",id:"sign-in-password",value:k||"",autoComplete:E?"one-time-code":"current-password",onChange:function(e){h&&b();const{target:t}=e;x(t.value),A(t.value.length>=a.loe),w&&w(t.value)},maxLength:256,dir:"auto"}),o.ZP.createElement("label",null,h||p||g),o.ZP.createElement("div",{className:"div-button toggle-password",onClick:function(){C(!n)},role:"button",tabIndex:0,title:"Toggle password visibility"},o.ZP.createElement("i",{className:(0,r.Z)("icon",n?"icon-eye":"icon-eye-closed")}))),f&&o.ZP.createElement("p",{className:"description"},f),S&&(T||v)&&o.ZP.createElement(m.Z,{type:"submit",ripple:!y,isLoading:t,disabled:!T},Z))}))},11820:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(57710),i=n(4463),r=n(46752),s=n(70735),c=n(27407),l=n(59107),d=n(25190),u=n(14605),m=n(21273),h=n(97687),p=n(31876),g=n(34288),Z=n(98799),f=n(49187),v=n(6058);const P=(0,o.X$)((e=>{let{itemIds:t,selectedIds:n,filterValue:P,filterPlaceholder:E,notFoundText:y,searchInputId:b,isLoading:C,noScrollRestore:w,isSearchable:S,isRoundCheckbox:N,lockedIds:I,forceShowSelf:M,onSelectedIdsChange:k,onFilterChange:x,onDisabledClick:T,onLoadMore:A}=e;const R=(0,o.sO)(null),O=n.length>10;(0,o.d4)((()=>{S&&setTimeout((()=>{(0,a.WM)((()=>{R.current.focus()}))}),500)}),[S]);const[L,D]=(0,o.Ye)((()=>{if(!I?.length)return[s.D,n];const e=n.filter((e=>!I.includes(e)));return[I,e]}),[n,I]),F=(0,o.Ye)((()=>new Set(I)),[I]),B=(0,o.Ye)((()=>t.sort(((e,t)=>{const n=F.has(e),o=F.has(t);return n&&!o?-1:!n&&o?1:0}))),[t,F]),U=(0,d.Z)((e=>{if(F.has(e))return void T?.(e);const t=n.slice();t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),k?.(t),x?.("")})),$=(0,d.Z)((e=>{const{value:t}=e.currentTarget;x?.(t)})),[j,H]=(0,c.Z)(A,B,Boolean(P)),_=(0,l.Z)();return o.ZP.createElement("div",{className:"Picker"},S&&o.ZP.createElement("div",{className:"picker-header custom-scroll",dir:_.isRtl?"rtl":void 0},L.map(((e,t)=>o.ZP.createElement(f.Z,{chatOrUserId:e,isMinimized:O&&t<n.length-5,forceShowSelf:M,onClick:U,clickArg:e}))),D.map(((e,t)=>o.ZP.createElement(f.Z,{chatOrUserId:e,isMinimized:O&&t+L.length<n.length-5,canClose:!0,onClick:U,clickArg:e}))),o.ZP.createElement(h.Z,{id:b,ref:R,value:P,onChange:$,placeholder:E||_("SelectChat")})),j?.length?o.ZP.createElement(m.Z,{className:"picker-list custom-scroll",items:j,onLoadMore:H,noScrollRestore:w},j.map((e=>{const t=()=>o.ZP.createElement(u.Z,{label:"",disabled:F.has(e),checked:n.includes(e),round:N});return o.ZP.createElement(p.Z,{key:e,className:(0,r.Z)("chat-item-clickable picker-list-item",N&&"chat-item"),disabled:F.has(e),allowDisabledClick:Boolean(T),onClick:()=>U(e),ripple:!0},N?void 0:t(),(0,i.YC)(e)?o.ZP.createElement(v.Z,{forceShowSelf:M,userId:e}):o.ZP.createElement(Z.Z,{chatId:e}),N?t():void 0)}))):C||!j||j.length?o.ZP.createElement(g.Z,null):o.ZP.createElement("p",{className:"no-results"},y||"Sorry, nothing found."))}))},49187:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(60748),a=n(33555),i=n(4463),r=n(7054),s=n(46752),c=n(32340),l=n(59107),d=n(70172);const u=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatOrUserId:n,forceShowSelf:o}=t;if(!n)return{};const a=n?(0,r.Z1J)(e,n):void 0,s=(0,i.YC)(n)?(0,r.dyD)(e,n):void 0;return{chat:a,user:s,isSavedMessages:!o&&s&&s.isSelf}}))((e=>{let{icon:t,title:n,isMinimized:a,canClose:r,clickArg:u,chat:m,user:h,className:p,isSavedMessages:g,onClick:Z}=e;const f=(0,l.Z)();let v,P;if(t&&n)v=o.ZP.createElement("div",{className:"item-icon"},o.ZP.createElement("i",{className:(0,s.Z)("icon",`icon-${t}`)})),P=n;else if(h||m){v=o.ZP.createElement(d.Z,{peer:h||m,size:"small",isSavedMessages:g});const e=!m||h&&!g?(0,i.Vl)(h):(0,i.U)(f,m,g);P=e?(0,c.Z)(e):void 0}const E=(0,s.Z)("PickerSelectedItem",p,m?.isForum&&"forum-avatar",a&&"minimized",r&&"closeable");return o.ZP.createElement("div",{className:E,onClick:()=>Z(u),title:a?P:void 0,dir:f.isRtl?"rtl":void 0},v,!a&&o.ZP.createElement("div",{className:"item-name",dir:"auto"},P),r&&o.ZP.createElement("div",{className:"item-remove"},o.ZP.createElement("i",{className:"icon icon-close"})))})))},6058:(e,t,n)=>{n.d(t,{Z:()=>f});var o=n(60748),a=n(33555),i=n(91713),r=n(4463),s=n(7054),c=n(46752),l=n(32340),d=n(59107),u=n(25190),m=n(68512),h=n(70172),p=n(78780),g=n(2153),Z=n(68729);const f=(0,o.X$)((0,a.c$)(((e,t)=>{let{userId:n,forceShowSelf:o}=t;const a=(0,s.dyD)(e,n);return{user:a,userStatus:(0,s.ssc)(e,n),isSavedMessages:!o&&a&&a.isSelf,areMessagesLoaded:Boolean((0,s.Zwk)(e,n))}}))((e=>{let{typingStatus:t,avatarSize:n="medium",status:s,statusIcon:f,withDots:v,withMediaViewer:P,withUsername:E,withStory:y,withFullInfo:b,withUpdatingStatus:C,emojiStatusSize:w,noStatusOrTyping:S,noEmojiStatus:N,noRtl:I,user:M,userStatus:k,isSavedMessages:x,areMessagesLoaded:T,adminMember:A,ripple:R,onEmojiStatusClick:O,storyViewerOrigin:L}=e;const{loadFullUser:D,openMediaViewer:F,loadProfilePhotos:B}=(0,a.Sv)(),U=(0,d.Z)(),{id:$}=M||{};(0,o.d4)((()=>{$&&(b&&D({userId:$}),P&&B({profileId:$}))}),[$,b,P]);const j=(0,u.Z)(((e,t)=>{M&&t&&(e.stopPropagation(),F({avatarOwnerId:M.id,mediaId:0,origin:"jumbo"===n?i.bZ.ProfileAvatar:i.bZ.MiddleHeaderAvatar}))})),H=(0,o.Ye)((()=>M&&E&&(0,r.WS)(M)),[M,E]);if(!M)return;const _=A?A.customTitle||U(A.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return o.ZP.createElement("div",{className:"ChatInfo",dir:!I&&U.isRtl?"rtl":void 0},o.ZP.createElement(h.Z,{key:M.id,size:n,peer:M,isSavedMessages:x,withStory:y,storyViewerOrigin:L,storyViewerMode:"single-user",onClick:P?j:void 0}),o.ZP.createElement("div",{className:"info"},_?o.ZP.createElement("div",{className:"info-name-title"},o.ZP.createElement(g.Z,{peer:M,withEmojiStatus:!N,emojiStatusSize:w,isSavedMessages:x,onEmojiStatusClick:O}),_&&o.ZP.createElement("span",{className:"custom-title"},_)):o.ZP.createElement(g.Z,{peer:M,withEmojiStatus:!N,emojiStatusSize:w,isSavedMessages:x,onEmojiStatusClick:O}),(s||!x&&!S)&&(s?v?o.ZP.createElement(p.Z,{className:"status",content:s}):o.ZP.createElement("span",{className:"status",dir:"auto"},f&&o.ZP.createElement("i",{className:`icon icon-${f} status-icon`}),(0,l.Z)(s)):C&&!T?o.ZP.createElement(p.Z,{className:"status",content:U("Updating")}):M?t?o.ZP.createElement(Z.Z,{typingStatus:t}):o.ZP.createElement("span",{className:(0,c.Z)("status",(0,r.kM)(M,k)&&"online")},H&&o.ZP.createElement("span",{className:"handle"},H),o.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,r.Tq)(U,M,k))):void 0)),R&&o.ZP.createElement(m.Z,null))})))},16568:(e,t,n)=>{n.d(t,{Z:()=>B});var o=n(60748),a=n(33555),i=n(91713),r=n(4463),s=n(7054),c=n(46752),l=n(64963),d=n(70735),u=n(97184),m=n(32340),h=n(59107),p=n(25190),g=n(87204),Z=n(70971),f=n(6137),v=n(40647),P=n(2255),E=n(70172),y=n(2153),b=n(2155),C=n(42797),w=n(15866),S=n(60706),N=n(6202),I=n(70692),M=n(57080),k=n(49204);const x=(0,o.X$)((e=>{let{chat:t,user:n,photo:a,isSavedMessages:i,canPlayVideo:s,onClick:l}=e;const d=(0,o.sO)(null),p=(0,h.Z)(),{isMobile:g}=(0,C.ZP)(),Z=n&&(0,r.NB)(n),f=t&&(0,r.pK)(t.id),v=n||t,P=v&&!i&&!Z&&!f,{isVideo:E}=a||{},y=P&&(0,r.RT)(v,"normal"),x=(0,N.Z)(y),T=P&&a&&!E&&`photo${a.id}?size=c`,A=(0,N.Z)(T),R=P&&a&&E&&(0,r.Dk)(a),O=(0,N.Z)(R)||A,[L,D]=(0,S.Z)(),F=Boolean(O&&(!E||L)),B=(0,I.Z)(F),U=P&&!F&&!x&&a?.thumbnail?.dataUri,$=(0,w.Z)(a?.thumbnail?.dataUri,!U,g&&!u.vX),j=a||x||U;let H;if((0,o.d4)((()=>{d.current&&!s&&(d.current.currentTime=0)}),[s]),i)H=o.ZP.createElement("i",{className:"icon icon-avatar-saved-messages"});else if(Z)H=o.ZP.createElement("i",{className:"icon icon-avatar-deleted-account"});else if(f)H=o.ZP.createElement("i",{className:"icon icon-reply-filled"});else if(j)H=o.ZP.createElement(o.ZP.Fragment,null,U?o.ZP.createElement("canvas",{ref:$,className:"thumb"}):o.ZP.createElement("img",{src:x,draggable:!1,className:"thumb",alt:""}),a&&(E?o.ZP.createElement(M.Z,{canPlay:s,ref:d,src:O,className:(0,c.Z)("avatar-media",B),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:D}):o.ZP.createElement("img",{src:O,className:(0,c.Z)("avatar-media",B),alt:""})));else if(n){const e=(0,r.Js)(n);H=e?(0,b.Xv)(e,2):void 0}else if(t){const e=(0,r.U)(p,t);H=e&&(0,b.Xv)(e,(0,r.YC)(t.id)?2:1)}else H=o.ZP.createElement("div",{className:"spinner-wrapper"},o.ZP.createElement(k.Z,{color:"white"}));const _=(0,c.Z)("ProfilePhoto",`color-bg-${(0,r.kj)(n||t)}`,i&&"saved-messages",Z&&"deleted-account",f&&"replies-bot-account",!i&&!j&&"no-photo");return o.ZP.createElement("div",{className:_,onClick:j?l:void 0},"string"==typeof H?(0,m.Z)(H,["hq_emoji"]):H)}));var T=n(2995);const A="DwTvYuXwYiyH8P8HGyEw",R="a_azkhZzdtjRO5pWnNno",O="NVXGZpj7iFHkn7HaGsey",L="zPvRR0bFn0HFuXDjj1wU",D="YvztuUsksHhhNiXGWWbN",F="rcKy8wQruH_z84yRjAry",B=(0,o.X$)((0,a.c$)(((e,t)=>{let{userId:n,forceShowSelf:o}=t;const{connectionState:a}=e,i=(0,s.dyD)(e,n),c=(0,r.YC)(n),l=(0,s.ssc)(e,n),d=(0,s.Z1J)(e,n),u=!o&&i&&i.isSelf,{mediaId:m,avatarOwnerId:h}=(0,s.jUK)(e).mediaViewer,p=d?.isForum,{threadId:g}=(0,s.Btg)(e)||{},Z=p&&g?d?.topics?.[g]:void 0,f=c?(0,s.ccz)(e,n):void 0,v=c?void 0:(0,s.x67)(e,n);return{connectionState:a,user:i,userStatus:l,chat:d,userPersonalPhoto:f?.personalPhoto,userProfilePhoto:f?.profilePhoto,userFallbackPhoto:f?.fallbackPhoto,chatProfilePhoto:v?.profilePhoto,isSavedMessages:u,mediaId:m,avatarOwnerId:h,...Z&&{topic:Z,messagesCount:(0,s.xxG)(e,n,g)}}}))((e=>{let{forceShowSelf:t,canPlayVideo:n,user:s,userStatus:b,chat:C,isSavedMessages:w,connectionState:S,mediaId:N,avatarOwnerId:I,topic:M,messagesCount:k,userPersonalPhoto:B,userProfilePhoto:U,userFallbackPhoto:$,chatProfilePhoto:j}=e;const{loadFullUser:H,openMediaViewer:_,openPremiumModal:z}=(0,a.Sv)(),Y=(0,h.Z)(),{id:V}=s||{},{id:X}=C||{},q=s?.photos||C?.photos||d.D,W=(0,g.Z)(N),G=(0,g.Z)(I),K=(0,Z.Y)(N),[J,Q]=(0,o.eJ)(!0),ee=J?Y.isRtl?"slideRtl":"slide":"none",[te,ne]=(0,o.eJ)(0),oe=w||q.length<=1||0===te,ae=w||q.length<=1||te===q.length-1;(0,o.d4)((()=>{G&&void 0!==W&&void 0===N&&(Q(!1),ne(W))}),[N,W,G]),(0,o.d4)((()=>{Q(!1),ne(K.current||0)}),[K,q]),(0,o.d4)((()=>{te>q.length&&(Q(!1),ne(Math.max(0,q.length-1)))}),[te,q.length]),(0,o.d4)((()=>{"connectionStateReady"===S&&V&&!t&&H({userId:V})}),[V,H,S,t]),function(e,t){(0,o.d4)((()=>{e.slice(t,t+4).forEach((e=>{v.UV(`photo${e.id}?size=c`)||v.he(`photo${e.id}?size=c`,f.IU.BlobUrl)}))}),[t,e])}(q,te);const ie=(0,p.Z)((()=>{_({avatarOwnerId:V||X,mediaId:te,origin:t?i.bZ.SettingsAvatar:i.bZ.ProfileAvatar})})),re=(0,p.Z)((()=>{V&&z({fromUserId:V})})),se=(0,p.Z)((()=>{oe||(Q(!0),ne(te-1))})),ce=(0,p.Z)((()=>{ae||(Q(!0),ne(te+1))}));var le,de;if((0,o.d4)((()=>{const e=document.querySelector(".YvztuUsksHhhNiXGWWbN");if(e)return(0,l.sf)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:u.$b?(e,t)=>t===l.eM.Right?(se(),!0):t===l.eM.Left&&(ce(),!0):void 0})}),[ce,se]),s||C)return M?o.ZP.createElement("div",{className:"Dlmqly7y8H7bCtaGNFIO"},o.ZP.createElement(T.Z,{topic:M,size:120,className:"Bv321I_wzF0fdNw63dxB",letterClassName:"MwfYq2acbtWIp8pGf9kI",noLoopLimit:!0}),o.ZP.createElement("h3",{className:"eMDgnAzVXSNlBUAgdBPK",dir:Y.isRtl?"rtl":void 0},(0,m.Z)(M.title)),o.ZP.createElement("p",{className:"YrvPEuAvDVR3BLU68aIN"},k?Y("Chat.Title.Topic",k,"i"):Y("lng_forum_no_messages"))):o.ZP.createElement("div",{className:(0,c.Z)("ProfileInfo",t&&"M4GWpBd7i7ViA2xNTvH4"),dir:Y.isRtl?"rtl":void 0},o.ZP.createElement("div",{className:D},function(){if(!(w||!q||q.length<=1))return o.ZP.createElement("div",{className:"UXIlP1uQpXVG_DNB26iC"},q.map(((e,t)=>o.ZP.createElement("span",{className:(0,c.Z)("Ay_dhoiSuGWjH2hVOy7i",t===te&&"xWzV6TAYO756R70Pzfmb")}))))}(),!t&&B&&o.ZP.createElement("div",{className:(0,c.Z)(R,oe&&L)},o.ZP.createElement("div",{className:O},Y(B.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto"))),t&&$&&o.ZP.createElement("div",{className:(0,c.Z)(R,(oe||ae)&&L)},o.ZP.createElement("div",{className:O,onClick:function(){oe&&(Q(!0),ne(q.length-1))}},!ae&&o.ZP.createElement(E.Z,{photo:$,className:"IG9hcS9__jiZjU59BA1U",size:"mini"}),Y($.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto"))),o.ZP.createElement(P.Z,{activeKey:te,name:ee},ue),!oe&&o.ZP.createElement("button",{type:"button",dir:Y.isRtl?"rtl":void 0,className:(0,c.Z)(F,"IrGNErqISNgGY687XP5I"),"aria-label":Y("AccDescrPrevious"),onClick:se}),!ae&&o.ZP.createElement("button",{type:"button",dir:Y.isRtl?"rtl":void 0,className:(0,c.Z)(F,"mERrfFjC7wKBhpVCjGgg"),"aria-label":Y("Next"),onClick:ce})),o.ZP.createElement("div",{className:"uHKuP7J67YWxko9FiDo9",dir:Y.isRtl?"rtl":"auto"},(s||C)&&o.ZP.createElement(y.Z,{peer:s||C,withEmojiStatus:!0,emojiStatusSize:24,isSavedMessages:w,onEmojiStatusClick:re,noLoopLimit:!0,canCopyTitle:!0}),!w&&(s?o.ZP.createElement("div",{className:(0,c.Z)(A,"status",(0,r.kM)(s,b)&&"online")},o.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,r.Tq)(Y,s,b))):o.ZP.createElement("span",{className:(0,c.Z)(A,"status"),dir:"auto"},(0,r.eA)(C)?Y("Subscribers",null!==(le=C.membersCount)&&void 0!==le?le:0,"i"):Y("Members",null!==(de=C.membersCount)&&void 0!==de?de:0,"i")))));function ue(e){const t=(!w&&q.length>0?q[te]:void 0)||B||U||j||$;return o.ZP.createElement(x,{key:te,user:s,chat:C,photo:t,isSavedMessages:w,canPlayVideo:Boolean(e&&n),onClick:ie})}})))},48198:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(60748),a=n(6137),i=n(4463),r=n(46752),s=n(6202),c=n(70692),l=n(96459),d=n(69123);const u=(0,o.X$)((e=>{let{reaction:t,availableReactions:n,className:u,size:m,withIconHeart:h,observeIntersection:p}=e;const g="documentId"in t,Z=(0,o.Ye)((()=>n?.find((e=>(0,i.Hl)(e.reaction,t)))),[n,t]),f=Z?.staticIcon?.id,v=(0,s.Z)(`document${f}`,!f,a.IU.BlobUrl),P=(0,c.Z)(v),E="emoticon"in t&&"🦄"===t.emoticon,y=h&&"emoticon"in t&&""===t.emoticon;return g?o.ZP.createElement(l.Z,{documentId:t.documentId,className:(0,r.Z)("ReactionStaticEmoji",u),size:m,observeIntersectionForPlaying:p}):y?o.ZP.createElement("i",{className:"ReactionStaticEmoji icon icon-heart",style:`font-size: ${m}px; width: ${m}px`}):o.ZP.createElement("img",{className:(0,r.Z)("ReactionStaticEmoji",E&&"with-unicorn-fix",P,u),style:m?`width: ${m}px; height: ${m}px`:void 0,src:v||d,alt:Z?.title,draggable:!1})}))},66534:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(33555),i=n(46752),r=n(59107),s=n(25190),c=n(231),l=n(97687),d=n(34563),u=n(14434);const m=(0,o.X$)((e=>{let{isOpen:t,subject:n="messages",chatId:m,userId:h,photo:p,messageIds:g,storyId:Z,onClose:f,onCloseAnimationEnd:v}=e;const{reportMessages:P,reportPeer:E,reportProfilePhoto:y,reportStory:b,exitMessageSelectMode:C}=(0,a.Sv)(),[w,S]=(0,o.eJ)("spam"),[N,I]=(0,o.eJ)(""),M=(0,s.Z)((()=>{switch(n){case"messages":P({messageIds:g,reason:w,description:N}),C();break;case"peer":E({chatId:m,reason:w,description:N});break;case"media":y({chatId:m,photo:p,reason:w,description:N});break;case"story":b({userId:h,storyId:Z,reason:w,description:N})}f()})),k=(0,s.Z)((e=>{S(e)})),x=(0,s.Z)((e=>{I(e.target.value)})),T=(0,r.Z)(),A=(0,o.Ye)((()=>[{value:"spam",label:T("lng_report_reason_spam")},{value:"violence",label:T("lng_report_reason_violence")},{value:"pornography",label:T("lng_report_reason_pornography")},{value:"childAbuse",label:T("lng_report_reason_child_abuse")},{value:"copyright",label:T("ReportPeer.ReasonCopyright")},{value:"illegalDrugs",label:"Illegal Drugs"},{value:"personalDetails",label:"Personal Details"},{value:"other",label:T("lng_report_reason_other")}]),[T]);if("messages"===n&&!g||"peer"===n&&!m||"media"===n&&(!m||!p)||"story"===n&&(!Z||!h))return;const R=T("messages"===n?"lng_report_message_title":"ReportPeer.Report");return o.ZP.createElement(d.Z,{isOpen:t,onClose:f,onEnter:t?M:void 0,onCloseAnimationEnd:v,className:(0,i.Z)("narrow","story"===n&&"component-theme-dark"),title:R},o.ZP.createElement(u.Z,{name:"report-message",options:A,onChange:k,selected:w}),o.ZP.createElement(l.Z,{label:T("lng_report_reason_description"),value:N,onChange:x}),o.ZP.createElement("div",{className:"dialog-buttons"},o.ZP.createElement(c.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},T("lng_report_button")),o.ZP.createElement(c.Z,{className:"confirm-dialog-button",isText:!0,onClick:f},T("Cancel"))))}))},2995:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(96459),i=n(58987);const r=(0,o.X$)((e=>{let{topic:t,className:n,letterClassName:r,size:s,noLoopLimit:c,observeIntersection:l,onClick:d}=e;return t.iconEmojiId&&"0"!==t.iconEmojiId?o.ZP.createElement(a.Z,{documentId:t.iconEmojiId,className:n,size:s,observeIntersectionForPlaying:l,loopLimit:c?void 0:2,onClick:d}):o.ZP.createElement(i.Z,{iconColor:t.iconColor,title:t.title,topicId:t.id,className:n,letterClassName:r,onClick:d})}))},68729:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(60748),a=n(33555),i=n(4463),r=n(7054),s=n(32340),c=n(59107),l=n(78780);const d=(0,o.X$)((0,a.c$)(((e,t)=>{let{typingStatus:n}=t;return n.userId?{typingUser:(0,r.dyD)(e,n.userId)}:{}}))((e=>{let{typingStatus:t,typingUser:n}=e;const a=(0,c.Z)(),r=n&&!n.isSelf&&(0,i.Vl)(n),d=a(t.action).replace("{user}","").replace("{emoji}",t.emoji||"").trim();return o.ZP.createElement("p",{className:"typing-status",dir:a.isRtl?"rtl":"auto"},r&&o.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,s.Z)(r)),o.ZP.createElement(l.Z,{content:d}))})))},45418:(e,t,n)=>{n.d(t,{Z:()=>g});var o=n(60748),a=n(4463),i=n(46752),r=n(790),s=n(48035),c=n(996),l=n(32340),d=n(59107),u=n(25190),m=n(8337),h=n(13709),p=n(10088);const g=(0,o.X$)((e=>{let{message:t,senderTitle:n,isProtected:g,observeIntersection:Z,onMessageClick:f}=e;const v=(0,d.Z)();let P=(0,a.s1)(t);if(!P){const e=(0,a.T7)(t);if(e){const{url:n,domain:o}=e;P={siteName:o.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,a.UD)(t)!==n?(0,c.e)(v,t,void 0,void 0,170):void 0}}}const E=(0,u.Z)((()=>{f(t.id,t.chatId)}));if(!P)return;const{siteName:y,url:b,displayUrl:C,title:w,description:S,formattedDescription:N,photo:I,video:M}=P,k=!n&&S&&(0,s.Z)(S,170),x=(0,i.Z)("WebLink scroll-item",!I&&!M&&"without-media"),T=b.replace("mailto:","")||C;return o.ZP.createElement("div",{className:x,"data-initial":(y||C)[0],dir:v.isRtl?"rtl":void 0},I&&o.ZP.createElement(h.Z,{message:t,isProtected:g,observeIntersection:Z}),o.ZP.createElement("div",{className:"content"},o.ZP.createElement(m.Z,{isRtl:v.isRtl,className:"site-title",onClick:E},(0,l.Z)(w||y||C)),(k||N)&&o.ZP.createElement(m.Z,{isRtl:v.isRtl,className:"site-description",onClick:E},N||k&&(0,l.Z)(k)),o.ZP.createElement(p.Z,{url:b,className:"site-name",text:T,isRtl:v.isRtl}),n&&o.ZP.createElement("div",{className:"sender-name"},(0,l.Z)(n))),n&&o.ZP.createElement("div",{className:"message-date"},o.ZP.createElement(m.Z,{className:"date",onClick:E,isRtl:v.isRtl},(0,r.VX)(v,1e3*t.date))))}))},996:(e,t,n)=>{n.d(t,{X:()=>c,e:()=>l});var o=n(6137),a=n(4463),i=n(48035),r=n(32340),s=n(20230);function c(e){let{message:t,highlight:n,emojiSize:o,isSimple:r,truncateLength:c,isProtected:l,forcePlayback:d,shouldRenderAsHtml:u,isForMediaViewer:m}=e;const{text:h,entities:p}=t.content.text||{};if(!h){const e=(0,a.UD)(t);return e?[(0,i.Z)(e,c)]:void 0}const g=(0,a.Tp)(t);return(0,s.H)({text:(0,i.Z)(h,c),entities:p,highlight:n,emojiSize:o,shouldRenderAsHtml:u,containerId:`${m?"mv-":""}${g}`,isSimple:r,isProtected:l,forcePlayback:d})}function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3?arguments[3]:void 0,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:a.lN;const{entities:d}=t.content.text||{},u=d?.some((e=>e.type===o.Vv.Spoiler)),m=d?.some((e=>e.type===o.Vv.CustomEmoji));if(!u&&!m){const o=(0,i.Z)((0,a.MK)(e,t,n),l);return s?(0,r.Z)(o,["emoji","highlight"],{highlight:s}):(0,r.Z)(o)}const h=!n&&(0,a.Eb)(t),p=h?`${h} `:"",g=c({message:t,highlight:s,isSimple:!0,truncateLength:l}),Z=(0,a.Kk)(e,t,g);return[...(0,r.Z)(p),...Array.isArray(Z)?Z:[Z]].filter(Boolean)}},67427:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(60748),a=n(4463),i=n(46752),r=n(97184),s=n(6202),c=n(96459);const l="zSAQoiw2P8dHog4GGC6Y",d=(0,o.X$)((e=>{let{reaction:t,isLottie:n,className:d}=e;const u=(0,a.RK)(t.documentId),m=(0,s.Z)(n?void 0:u),h=(0,o.Ye)((()=>r._G?Array.from({length:7}).map((()=>function(){const e=(10+60*Math.random())*(Math.random()>.5?1:-1),t=20+80*Math.random();return`M 0 0 C 0 0 ${e} ${-t-20} ${e} ${t}`}())):[]),[]);if(m||n)return o.ZP.createElement("div",{className:(0,i.Z)("CBuciapCXTFHGIT8QJjp",d)},h.map((e=>{const a=`--offset-path: path('${e}');`;return n?o.ZP.createElement(c.Z,{documentId:t.documentId,className:l,style:a,withSharedAnimation:!0}):o.ZP.createElement("img",{src:m,alt:"",className:l,style:a,draggable:!1})})))}))},36368:(e,t,n)=>{n.d(t,{Z:()=>C});var o=n(60748),a=n(33555),i=n(4463),r=n(7054),s=n(46752),c=n(28712),l=n(74399),d=n(60706),u=n(3657),m=n(25190),h=n(6202),p=n(31212),g=n(60422),Z=n(97799),f=n(96459),v=n(48198),P=n(67427);const E={root:"UoQ7Ahl_08BYJER7dkXg","animated-icon":"m6I0yrKxFYZrVajqEjYY",animatedIcon:"m6I0yrKxFYZrVajqEjYY",effect:"DUYRztiKh76RsdbcJpu8",animating:"_sWZKdctR4GWBAZk5LvT",withEffectOnly:"bcQvAAQmccIErVUj7YDo"},y=1.5*l.Gw,b=6.5*l.Gw,C=(0,o.X$)((0,a.c$)(((e,t)=>{let{containerId:n}=t;const{availableReactions:o,genericEmojiEffects:a}=e,{activeReactions:i}=(0,r.jUK)(e),s=(0,r.$Yd)(e,"reactionEffects");return{activeReactions:i?.[n],availableReactions:o,genericEffects:a,withEffects:s}}))((e=>{let{containerId:t,reaction:n,className:r,size:l=y,effectSize:C=b,activeReactions:w,availableReactions:S,genericEffects:N,withEffects:I,withEffectOnly:M,observeIntersection:k}=e;const{stopActiveReaction:x}=(0,a.Sv)(),T=(0,o.sO)(null),A="documentId"in n,R=(0,o.Ye)((()=>S?.find((e=>(0,i.Hl)(e.reaction,n)))),[S,n]),O=R?.centerIcon?.id,{customEmoji:L}=(0,g.Z)(A?n.documentId:void 0),D=(0,o.Ye)((()=>{if(!A)return R?.aroundAnimation?.id;if(!L)return;const e=S?.find((e=>e.reaction.emoticon===L.emoji))?.aroundAnimation?.id;return e}),[R,S,L,A]),F=(0,o.Ye)((()=>{if(D)return D;if(!N?.stickers)return;const{stickers:e}=N;return e[Math.floor(Math.random()*e.length)].id}),[D,N]),B=(0,u.Op)(T,k),U=O&&`sticker${O}`,$=F&&`sticker${F}`,j=(0,h.Z)(U,!O),H=(0,h.Z)($,!F),_=(0,o.Ye)((()=>w?.find((e=>(0,i.Hl)(e,n)))),[w,n]),z=Boolean(I&&_&&(A||j)&&H),{shouldRender:Y,transitionClassNames:V}=(0,p.Z)(z,void 0,!0,"slow"),X=(0,m.Z)((()=>{x({containerId:t,reaction:n})})),[q,W,G]=(0,d.Z)(),K=!(A||z&&q),{shouldRender:J,transitionClassNames:Q}=(0,p.Z)(K,void 0,!0),ee=(0,s.Z)(E.root,Y&&E.animating,M&&E.withEffectOnly,r);return o.ZP.createElement("div",{className:ee,ref:T},!M&&J&&o.ZP.createElement(v.Z,{className:Q,reaction:n,availableReactions:S,size:l,observeIntersection:k}),!M&&A&&o.ZP.createElement(f.Z,{documentId:n.documentId,className:E.customEmoji,size:l,observeIntersectionForPlaying:k}),Y&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(Z.Z,{key:F,className:(0,s.Z)(E.effect,V),size:C,tgsUrl:H,play:B,noLoop:!0,forceAlways:!0,onEnded:X}),A&&!D&&B&&o.ZP.createElement(P.Z,{reaction:n}),!A&&!M&&o.ZP.createElement(Z.Z,{key:O,className:(0,s.Z)(E.animatedIcon,V),size:(0,c.gO)(1.9*l),tgsUrl:j,play:B,noLoop:!0,forceAlways:!0,onLoad:W,onEnded:G})))})))},50742:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"ChatFolderModal",!t);return n?o.ZP.createElement(n,e):void 0}},79347:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"MuteChatModal",!t);return n?o.ZP.createElement(n,e):void 0}},77699:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(60748),a=n(46752),i=n(19369),r=n(2155),s=n(86203),c=n(34076),l=n(40126);const d=(0,o.X$)((e=>{let{topic:t,chat:n,isPinned:d,isMuted:u,shouldShowOnlyMostImportant:m,wasTopicOpened:h,forceHidden:p}=e;const{unreadMentionsCount:g=0,unreadReactionsCount:Z=0}=n.isForum?{}:n,f=!d&&t&&!h,v=n.isForum&&!t,P=(0,o.Ye)((()=>v&&n?.topics?Object.values(n.topics).filter((e=>{let{unreadCount:t}=e;return t})):void 0),[n,v]),E=(0,o.Ye)((()=>v?u&&P?.filter((e=>!1===e.isMuted)).length||P?.length:(t||n).unreadCount),[n,t,P,v,u]),y=(0,o.Ye)((()=>{const e=n.topics&&Object.values(n.topics).some((e=>!e.isMuted&&e.unreadCount));return u||n.topics&&!e}),[n,u]),b=!t&&n.hasUnreadMark,C=!(0,s.Z)((()=>(0,i.$Z)(p)?p():p),[p])&&Boolean(E||g||b||d||Z||f),w=Boolean(E||b),S=(0,a.Z)("ChatBadge",y&&"muted",!w&&d&&"pinned",w&&"unread");return o.ZP.createElement(l.Z,{isCustom:!0,className:"ChatBadge-transition",isOpen:C},function(){const e=Z&&o.ZP.createElement("div",{className:(0,a.Z)("ChatBadge reaction",y&&"muted")},o.ZP.createElement("i",{className:"icon icon-heart"})),t=g&&o.ZP.createElement("div",{className:"ChatBadge mention"},o.ZP.createElement("i",{className:"icon icon-mention"})),n=f&&o.ZP.createElement("div",{className:(0,a.Z)("ChatBadge unopened",y&&"muted")}),i=b||E?o.ZP.createElement("div",{className:S},!b&&o.ZP.createElement(c.Z,{text:(0,r.bi)(E)})):void 0,s=d&&!i&&!t&&!e&&o.ZP.createElement("div",{className:S},o.ZP.createElement("i",{className:"icon icon-pinned-chat"})),l=[n,e,t,i,s].filter(Boolean);if(0!==l.length)return 1===l.length?l[0]:m?[t,i,e,s].filter(Boolean)[0]:o.ZP.createElement("div",{className:"ChatBadge-wrapper"},l)}())}))},59148:(e,t,n)=>{n.d(t,{Z:()=>ae});var o=n(60748),a=n(33555),i=n(91713),r=n(83716),s=n(46752),c=n(16974),l=n(97184),d=n(47783),u=n(57710),m=n(87675),h=n(67360),p=n(25190),g=n(95616),Z=n(73541),f=n(27407),v=n(3657),P=n(61204),E=n(21273),y=n(34288),b=n(4463),C=n(60782),w=n(2155),S=n(32340),N=n(59107),I=n(95481),M=n(31876);const k={root:"QNEU55wdWY0UBHKcohz_",minimized:"HJvl22k3BH70ntnjhIP0",button:"RF4n_8QOkb5FMXcpbmBW",title:"XFFMu4VlEHKxRihwcGTm","unread-count":"jYYtPy1W31sqUc_gw9RW",unreadCount:"jYYtPy1W31sqUc_gw9RW",info:"fvlwjR3heR1XQKFT_jiv",name:"Njj0lF4z1QQ96mlTyHt_",icon:"EKj05B3RNFnEMtMNttAq",avatarWrapper:"qx5qdiOt16oub2O9sYeg",avatar:"n8grGxKGGUr4oa8NVGFW",chatsPreview:"m7P0WNHzg_kxle3rxniA",unread:"mee_ERQMDxZsfb47JEBb"},x=(0,o.X$)((e=>{let{archiveSettings:t,onDragEnter:n,onClick:i}=e;const{updateArchiveSettings:c}=(0,a.Sv)(),l=(0,N.Z)(),d=(0,g.d7)(r.WSp),u=(0,g.yi)()[r.WSp]?.chatsCount,m=(0,o.Ye)((()=>{if(!d?.length)return l("Loading");const e=(0,a.Rd)().chats.byId;return d.slice(0,5).map(((t,n,a)=>{const i=n===a.length-1,r=e[t];if(!r)return;const c=(0,b.U)(l,r);return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:(0,s.Z)(k.chat,u&&r.unreadCount&&k.unread)},(0,S.Z)(c)),i?"":", ")}))}),[d,l,u]),h=(0,o.Ye)((()=>{const e=!t.isMinimized&&{title:l("lng_context_archive_collapse"),icon:"collapse",handler:()=>{c({isMinimized:!0})}},n=t.isMinimized&&{title:l("lng_context_archive_expand"),icon:"expand",handler:()=>{c({isMinimized:!1})}},o={title:l("lng_context_archive_to_menu"),icon:"archive-to-main",handler:()=>{c({isHidden:!0})}};return(0,C.oA)([e,n,o])}),[t.isMinimized,l,c]),p=(0,o.I4)((e=>{e.preventDefault(),n?.()}),[n]);return o.ZP.createElement(M.Z,{onClick:i,onDragEnter:p,className:(0,s.Z)(k.root,t.isMinimized&&k.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:k.button,contextActions:h,withPortalForMenu:!0},t.isMinimized?o.ZP.createElement("div",{className:(0,s.Z)(k.info,"info")},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement("div",{className:(0,s.Z)("title",k.title)},o.ZP.createElement("h3",{dir:"auto",className:(0,s.Z)(k.name,"fullName")},o.ZP.createElement("i",{className:(0,s.Z)(k.icon,"icon","icon-archive-filled")}),l("ArchivedChats"))),o.ZP.createElement(I.Z,{className:k.unreadCount,text:u?(0,w.bi)(u):void 0}))):o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:(0,s.Z)("status",k.avatarWrapper)},o.ZP.createElement("div",{className:(0,s.Z)("Avatar",k.avatar)},o.ZP.createElement("i",{className:"icon icon-archive-filled"}))),o.ZP.createElement("div",{className:(0,s.Z)(k.info,"info")},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement("div",{className:(0,s.Z)("title",k.title)},o.ZP.createElement("h3",{dir:"auto",className:(0,s.Z)(k.name,"fullName")},l("ArchivedChats")))),o.ZP.createElement("div",{className:"subtitle"},o.ZP.createElement("div",{className:(0,s.Z)("status",k.chatsPreview)},m),o.ZP.createElement(I.Z,{className:k.unreadCount,text:u?(0,w.bi)(u):void 0})))))}));var T=n(6137),A=n(7054),R=n(15780),O=n(42797),L=n(41470),D=n(60706),F=n(65116),B=n(19369),U=n(7792);const $=new Map;(0,F.ll)((e=>{for(const[t,{setter:n}]of $)n(t(e))}));var j=n(31212),H=n(44499),_=n(70172),z=n(40329),Y=n(2153),V=n(76844),X=n(66534),q=n(50742),W=n(79347),G=n(77699);const K="mem3FdA38CqQltSSxUwi",J=(0,o.X$)((e=>{let{isSelected:t,isActive:n,isMobile:a}=e;return o.ZP.createElement("div",{className:(0,s.Z)("wYxzEPxIxq51N_1Jvb22",n&&"AtRfJ5hbKIb7giL05RZz",t&&!a&&"J83lhIRMV9uenQVCQJpB")},o.ZP.createElement("div",{className:"GjqQzJt4PhbEBMchbPMg"},o.ZP.createElement("div",{className:K}),o.ZP.createElement("div",{className:K}),o.ZP.createElement("div",{className:K})))})),Q=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n}=t;const o=(0,A.Z1J)(e,n);if(!o)return{};const{senderId:a,replyToMessageId:i,isOutgoing:r}=o.lastMessage||{},s=a?(0,A.dyD)(e,a)||(0,A.Z1J)(e,a):void 0,c=o.lastMessage?(0,b.N5)(o.lastMessage):void 0,l=c&&i?(0,A.hjO)(e,o.id,i):void 0,{targetUserIds:d,targetChatId:u}=c||{},m=(0,b.zX)(o),{chatId:h,threadId:p,type:g}=(0,A.Btg)(e)||{},Z=n===h&&p===T._f,f=o.isForum&&n===h||n===(0,A.jUK)(e).forumPanelChatId,v=m?(0,A.dyD)(e,m):void 0,P=m?(0,A.ssc)(e,m):void 0,E=o.lastMessage&&(0,A.p$s)(e,o.lastMessage),y=(0,A.WPz)(e,n,T._f,"typingStatus");return{chat:o,isMuted:(0,b.i4)(o,(0,A.dZI)(e),(0,A.NJL)(e)),lastMessageSender:s,actionTargetUserIds:d,actionTargetChatId:u,actionTargetMessage:l,draft:(0,A.Mst)(e,n,T._f),isSelected:Z,isSelectedForum:f,isForumPanelOpen:(0,A.nd)(e),canScrollDown:Z&&"thread"===g,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,...r&&o.lastMessage&&{lastMessageOutgoingStatus:(0,A.dTW)(e,o.lastMessage)},user:v,userStatus:P,lastMessageTopic:E,typingStatus:y,withInterfaceAnimations:(0,A.FOo)(e)}}))((e=>{let{chatId:t,folderId:n,orderDiff:r,animationType:c,isPinned:d,observeIntersection:u,chat:m,isMuted:h,user:g,userStatus:Z,actionTargetUserIds:f,lastMessageSender:P,lastMessageOutgoingStatus:E,actionTargetMessage:y,actionTargetChatId:C,offsetTop:w,draft:S,withInterfaceAnimations:N,isSelected:I,isSelectedForum:k,isForumPanelOpen:x,canScrollDown:F,canChangeFolder:K,lastMessageTopic:Q,typingStatus:ee,onDragEnter:te}=e;const{openChat:ne,focusLastMessage:oe,loadTopics:ae,openForumPanel:ie,closeForumPanel:re}=(0,a.Sv)(),{isMobile:se}=(0,O.ZP)(),[ce,le,de]=(0,D.Z)(),[ue,me,he]=(0,D.Z)(),[pe,ge,Ze]=(0,D.Z)(),[fe,ve,Pe]=(0,D.Z)(),[Ee,ye,be]=(0,D.Z)(),[Ce,we,Se]=(0,D.Z)(),[Ne,Ie,Me]=(0,D.Z)(),[ke,xe,Te]=(0,D.Z)(),{lastMessage:Ae,isForum:Re}=m||{},{renderSubtitle:Oe,ref:Le}=(0,H.Z)({chat:m,chatId:t,lastMessage:Ae,typingStatus:ee,draft:S,actionTargetMessage:y,actionTargetUserIds:f,actionTargetChatId:C,lastMessageTopic:Q,lastMessageSender:P,observeIntersection:u,animationType:c,withInterfaceAnimations:N,orderDiff:r}),De=function(e){let t=$.get(e);if(!t){const[n,o]=(0,B.gQ)(e((0,a.Rd)()));t={clientsCount:0,getter:n,setter:o},$.set(e,t)}return(0,U.Z)((()=>(t.clientsCount++,()=>{t.clientsCount--,t.clientsCount||$.delete(e)}))),t.getter}(A.hqL),Fe=(0,p.Z)((()=>{Re?x?re(void 0,{forceOnHeavyAnimation:!0}):ie({chatId:t},{forceOnHeavyAnimation:!0}):(ne({id:t,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),I&&F&&oe())})),Be=(0,p.Z)((e=>{e.preventDefault(),te?.(t)})),Ue=(0,p.Z)((()=>{ye(),le()})),$e=(0,p.Z)((()=>{we(),me()})),je=(0,p.Z)((()=>{Ie(),ge()})),He=(0,p.Z)((()=>{xe(),ve()})),_e=(0,L.Z)({chat:m,user:g,handleDelete:Ue,handleMute:$e,handleChatFolderChange:je,handleReport:He,folderId:n,isPinned:d,isMuted:h,canChangeFolder:K}),ze=(0,v.Op)(Le,m?u:void 0);(0,o.d4)((()=>{ze&&Re&&m&&void 0===m.listedTopicIds&&ae({chatId:t})}),[m,t,Re,ze]);const Ye=g&&Z&&(0,b.kM)(g,Z),{hasShownClass:Ve}=(0,j.Z)(Ye);if(!m)return;const Xe=g||m,qe=(0,s.Z)("Chat chat-item-clickable",(0,b.YC)(t)?"private":"group",Re&&"forum",I&&"selected",k&&"selected-forum");return o.ZP.createElement(M.Z,{ref:Le,className:qe,href:l.IT?`#${(0,R.tB)(t,"thread",T._f)}`:void 0,style:`top: ${w}px`,ripple:!Re&&!se,contextActions:_e,onClick:Fe,onDragEnter:Be,withPortalForMenu:!0},o.ZP.createElement("div",{className:(0,s.Z)("status","status-clickable")},o.ZP.createElement(_.Z,{peer:Xe,isSavedMessages:g?.isSelf,withStory:g&&!g?.isSelf,withStoryGap:Ve,storyViewerOrigin:i.ze.ChatList,storyViewerMode:"single-user"}),o.ZP.createElement("div",{className:"avatar-badge-wrapper"},o.ZP.createElement("div",{className:(0,s.Z)("avatar-online",Ve&&"avatar-online-shown")}),o.ZP.createElement(G.Z,{chat:m,isMuted:h,shouldShowOnlyMostImportant:!0,forceHidden:De})),m.isCallActive&&m.isCallNotEmpty&&o.ZP.createElement(J,{isMobile:se,isSelected:I,isActive:N})),o.ZP.createElement("div",{className:"info"},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement(Y.Z,{peer:Xe,withEmojiStatus:!0,isSavedMessages:t===g?.id&&g?.isSelf,observeIntersection:u}),h&&o.ZP.createElement("i",{className:"icon icon-muted"}),o.ZP.createElement("div",{className:"separator"}),m.lastMessage&&o.ZP.createElement(V.Z,{message:m.lastMessage,outgoingStatus:E})),o.ZP.createElement("div",{className:"subtitle"},Oe(),o.ZP.createElement(G.Z,{chat:m,isPinned:d,isMuted:h}))),Ee&&o.ZP.createElement(z.Z,{isOpen:ce,onClose:de,onCloseAnimationEnd:be,chat:m}),Ce&&o.ZP.createElement(W.Z,{isOpen:ue,onClose:he,onCloseAnimationEnd:Se,chatId:t}),Ne&&o.ZP.createElement(q.Z,{isOpen:pe,onClose:Ze,onCloseAnimationEnd:Me,chatId:t}),ke&&o.ZP.createElement(X.Z,{isOpen:fe,onClose:Pe,onCloseAnimationEnd:Te,chatId:t,subject:"peer"}))})));var ee=n(45601),te=n(231);const ne=(0,o.X$)((0,a.c$)(((e,t)=>{let{folderId:n,folderType:o}=t;return{chatFolder:n&&"folder"===o?(0,A.MwT)(e,n):void 0,animatedEmoji:(0,A.zB_)(e,"📂")}}))((e=>{let{chatFolder:t,animatedEmoji:n,foldersDispatch:a,onSettingsScreenSelect:r}=e;const s=(0,N.Z)(),{isMobile:c}=(0,O.ZP)(),l=(0,o.I4)((()=>{a({type:"editFolder",payload:t}),r(i.MT.FoldersEditFolderFromChatList)}),[t,a,r]);return o.ZP.createElement("div",{className:"SQg81XcAI_8yUrDTZsuO"},o.ZP.createElement("div",{className:"wJbYOMkKbFvBF3ETHcTe"},n&&o.ZP.createElement(ee.Z,{sticker:n,size:96})),o.ZP.createElement("h3",{className:"aAjnCIjqnZ5azP_wg1ax",dir:"auto"},s("FilterNoChatsToDisplay")),o.ZP.createElement("p",{className:"xkUox6hbodMU0tsgwbai",dir:"auto"},s(t?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),t&&o.ZP.createElement(te.Z,{ripple:!c,fluid:!0,pill:!0,onClick:l,size:"smaller",isRtl:s.isRtl},o.ZP.createElement("i",{className:"icon icon-settings"}),o.ZP.createElement("div",{className:"avAW55GP937eCr8UmpfS"},s("ChatList.EmptyChatListEditFilter"))))}))),oe=new Set(["9","0"]),ae=(0,o.X$)((e=>{let{folderType:t,folderId:n,isActive:b,isForumPanelOpen:C,canDisplayArchive:w,archiveSettings:S,foldersDispatch:N,onSettingsScreenSelect:I,onLeftColumnContentChange:M}=e;const{openChat:k,openNextChat:T,closeForumPanel:A,toggleStoryRibbon:R}=(0,a.Sv)(),O=(0,o.sO)(null),L=(0,o.sO)(!1),D="archived"===t,F="all"===t?r.NfV:D?r.WSp:n,B="all"===t&&w,U=(0,g.d7)(F);(0,d.Z)(U);const $=(U?.length||0)*r.rSj,j=B?S.isMinimized?r.RBO:r.rSj:0,{orderDiffById:H,getAnimationType:_}=(0,P.Z)(U),[z,Y]=(0,f.Z)(void 0,U,void 0,r.t_F);(0,Z.y)(b&&U?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),T({targetIndexDelta:-1,orderedIds:U})},"Alt+ArrowDown":e=>{e.preventDefault(),T({targetIndexDelta:1,orderedIds:U})}}:void 0),(0,o.d4)((()=>{if(b&&U&&l.RM)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((l.jm&&e.metaKey||!l.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||oe.has(t))return;const n=B&&!S.isMinimized,o=n?-1:0,a=Number(t)+o-1;if(n&&-1===a)return void M(i.du.Archived);if(a>U.length-1)return;k({id:U[a],shouldReplaceHistory:!0})}}}),[S,b,M,k,T,U,B]);const{observe:V}=(0,v.S1)({rootRef:O,throttleMs:200}),X=(0,p.Z)((()=>{M(i.du.Archived),A()})),q=(0,p.Z)((()=>{L.current?L.current=!1:X()})),W=(0,h.Z)((e=>{L.current?L.current=!1:k({id:e,shouldReplaceHistory:!0})}),[k],500,!0),G=(0,p.Z)((e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top;n<t.width||o<t.y||(L.current=!0)})),K=function(e,t,n){const a=(0,o.sO)(null),i=(0,o.sO)(!1),r=(0,o.sO)(0),s=(0,o.sO)(!1),c=(0,o.sO)(!0),d=(0,o.sO)(0),g=(0,o.sO)(!1),Z=(0,p.Z)((function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];s.current||a.current&&e.current&&(a.current.style.display="block",e.current.scrollTop=1,l.s$||t||(0,m.n)(e.current),i.current=!0,r.current=1,s.current=!0,c.current=!0)})),f=(0,p.Z)((()=>{s.current&&a.current&&(a.current.style.display="none",s.current=!1)})),v=(0,p.Z)((()=>{if(!e.current)return;if(i.current)return void(i.current=!1);const o=e.current.scrollTop,l=o>r.current,m=o<r.current,h=0===o,p=Date.now()-d.current;if(a.current){if(h&&!s.current)return void(0,u.x4)(Z,[e.current,a.current]);(0,u.x4)(f,a.current)}m&&(c.current&&p>100||o<0&&g.current)?t?.():l&&o>0&&n?.(),r.current=o,c.current=h,d.current=Date.now(),g.current=l&&o<0})),P=(0,h.Z)((o=>{if(!e.current)return;const a=e.current;a.scrollHeight>a.offsetHeight||0===o.deltaY||(o.deltaY<0?t?.():n?.())}),[e,t,n],250);return(0,o.d4)((()=>{const t=e.current;if(t)return 0===t.scrollTop&&(0,u.WM)((()=>{Z(!0)})),t.addEventListener("scroll",v,{passive:!0}),t.addEventListener("wheel",P,{passive:!0}),()=>{t.removeEventListener("scroll",v),t.removeEventListener("wheel",P)}}),[e,P]),l.cj?void 0:o.ZP.createElement("div",{ref:a,className:"overscroll-trigger",key:"overscroll-trigger"})}(O,(0,p.Z)((()=>{R({isShown:!0,isArchived:D})})),(0,p.Z)((()=>{R({isShown:!1,isArchived:D})})));return o.ZP.createElement(E.Z,{className:(0,s.Z)("chat-list custom-scroll",C&&"forum-panel-open"),ref:O,items:z,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:r.t_F,withAbsolutePositioning:!0,beforeChildren:K,maxHeight:$+j,onLoadMore:Y,onDragLeave:G},B&&o.ZP.createElement(x,{key:"archive",archiveSettings:S,onClick:X,onDragEnter:q}),z?.length?function(){const e=U.indexOf(z[0]),t=(0,c.aE)(F)||0;return z.map(((a,i)=>{const s=e+i<t,l=j+(e+i)*r.rSj;return o.ZP.createElement(Q,{key:a,teactOrderKey:s?i:(0,c.jK)(a),chatId:a,isPinned:s,folderId:n,animationType:_(a),orderDiff:H[a],offsetTop:l,observeIntersection:V,onDragEnter:W})}))}():z&&!z.length?o.ZP.createElement(ne,{folderId:n,folderType:t,foldersDispatch:N,onSettingsScreenSelect:I}):o.ZP.createElement(y.Z,{key:"loading"}))}))},59690:(e,t,n)=>{n.d(t,{Z:()=>X});var o=n(60748),a=n(33555),i=n(6137),r=n(83716),s=n(57710),c=n(4463),l=n(7054),d=n(46752),u=n(23989),m=n(64963),h=n(1279),p=n(15780),g=n(97184),Z=n(42797),f=n(18674),v=n(46590),P=n(27407),E=n(3657),y=n(59107),b=n(25190),C=n(87204),w=n(61204),S=n(4794),N=n(98799),I=n(59188),M=n(231),k=n(21273),x=n(34288),T=n(74399),A=n(45601);const R={root:"ZyX_vkPmR8lkPavXpJ8t","button-text":"eyTT7Nz45S4tsccfs60O",buttonText:"eyTT7Nz45S4tsccfs60O",sticker:"qtGErqZ1CIiAYG3E4UcJ",title:"xpDHtODGvlK2Esrg3kFa",description:"xqeZm45hTFw3abdn8dYe","is-ios":"G5wtv6cwHgiIpRWtvIvu",isIos:"G5wtv6cwHgiIpRWtvIvu","is-macos":"H92rL6BfAuzokrWOXdQr",isMacos:"H92rL6BfAuzokrWOXdQr"},O=7*T.Gw,L=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n}=t;const o=(0,l.Z1J)(e,n),a=o&&(o.isCreator||(0,c.VE)(o,"manageTopics"));return{animatedEmoji:(0,l.zB_)(e,"🐣"),canManageTopics:a}}))((e=>{let{chatId:t,animatedEmoji:n,canManageTopics:i}=e;const{openCreateTopicPanel:r}=(0,a.Sv)(),s=(0,y.Z)(),{isMobile:c}=(0,Z.ZP)(),l=(0,o.I4)((()=>{r({chatId:t})}),[t,r]);return o.ZP.createElement("div",{className:R.root},o.ZP.createElement("div",{className:R.sticker},n&&o.ZP.createElement(A.Z,{sticker:n,size:O})),o.ZP.createElement("h3",{className:R.title,dir:"auto"},s("ChatList.EmptyTopicsTitle")),o.ZP.createElement("p",{className:(0,d.Z)(R.description,R.centered),dir:"auto"},s("ChatList.EmptyTopicsDescription")),i&&o.ZP.createElement(M.Z,{ripple:!c,fluid:!0,onClick:l,size:"smaller",isRtl:s.isRtl},o.ZP.createElement("div",{className:R.buttonText},s("ChatList.EmptyTopicsCreate"))))})));var D=n(32340),F=n(60706),B=n(44499),U=n(60782),$=n(76844),j=n(2995),H=n(17551),_=n(31876),z=n(79347),Y=n(77699);const V=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,topic:o,isSelected:a}=t;const i=(0,l.Z1J)(e,n),r=(0,l.hjO)(e,n,o.lastMessageId),{senderId:s,replyToMessageId:d,isOutgoing:u}=r||{},m=s?(0,l.dyD)(e,s)||(0,l.Z1J)(e,s):void 0,h=r?(0,c.N5)(r):void 0,p=h&&d?(0,l.hjO)(e,n,d):void 0,{targetUserIds:g,targetChatId:Z}=h||{},f=(0,l.WPz)(e,n,o.id,"typingStatus"),v=(0,l.Mst)(e,n,o.id),P=(0,l.tZg)(e,n,o.id),E=Boolean(P?.lastReadInboxMessageId),{chatId:y,threadId:b}=(0,l.Btg)(e)||{};return{chat:i,lastMessage:r,actionTargetUserIds:g,actionTargetChatId:Z,actionTargetMessage:p,lastMessageSender:m,typingStatus:f,canDelete:(0,l.nt7)(e,n,o.id),withInterfaceAnimations:(0,l.FOo)(e),draft:v,...u&&r&&{lastMessageOutgoingStatus:(0,l.dTW)(e,r)},canScrollDown:a&&i?.id===y&&b===o.id,wasTopicOpened:E}}))((e=>{let{topic:t,isSelected:n,chatId:i,chat:r,style:s,lastMessage:l,canScrollDown:u,lastMessageOutgoingStatus:m,observeIntersection:h,canDelete:Z,actionTargetMessage:f,actionTargetUserIds:v,actionTargetChatId:P,lastMessageSender:E,animationType:C,withInterfaceAnimations:w,orderDiff:S,typingStatus:N,draft:I,wasTopicOpened:M}=e;const{openChat:k,deleteTopic:x,focusLastMessage:T}=(0,a.Sv)(),A=(0,y.Z)(),[R,O,L]=(0,F.Z)(),[V,X,q]=(0,F.Z)(),[W,G,K]=(0,F.Z)(),[J,Q,ee]=(0,F.Z)(),{isPinned:te,isClosed:ne}=t,oe=t.isMuted||void 0===t.isMuted&&r.isMuted,ae=(0,b.Z)((()=>{G(),O()})),ie=(0,b.Z)((()=>{x({chatId:r.id,topicId:t.id})})),re=(0,b.Z)((()=>{Q(),X()})),{renderSubtitle:se,ref:ce}=(0,B.Z)({chat:r,chatId:i,lastMessage:l,draft:I,actionTargetMessage:f,actionTargetUserIds:v,actionTargetChatId:P,lastMessageSender:E,lastMessageTopic:t,observeIntersection:h,isTopic:!0,typingStatus:N,animationType:C,withInterfaceAnimations:w,orderDiff:S}),le=(0,b.Z)((()=>{k({id:i,threadId:t.id,shouldReplaceHistory:!0}),u&&T()})),de=function(e){let{topic:t,chat:n,wasOpened:i,canDelete:r,handleDelete:s,handleMute:l}=e;const d=(0,y.Z)();return(0,o.Ye)((()=>{const{isPinned:e,isMuted:o,isClosed:u,id:m}=t,h=n.id,{editTopic:p,toggleTopicPinned:Z,markTopicRead:f,updateTopicMutedState:v,openChatInNewTab:P}=(0,a.Sv)(),E=(0,c.GU)(n,t),y=n.isCreator||(0,c.VE)(n,"manageTopics"),b=g.IT&&{title:"Open in new tab",icon:"open-in-new-tab",handler:()=>{P({chatId:n.id,threadId:m})}},C=t.unreadCount||!i?{title:d("MarkAsRead"),icon:"readchats",handler:()=>{f({chatId:h,topicId:m})}}:void 0,w=y?e?{title:d("UnpinFromTop"),icon:"unpin",handler:()=>Z({chatId:h,topicId:m,isPinned:!1})}:{title:d("PinToTop"),icon:"pin",handler:()=>Z({chatId:h,topicId:m,isPinned:!0})}:void 0,S=n.isMuted&&!1!==o||!0===o?{title:d("ChatList.Unmute"),icon:"unmute",handler:()=>v({chatId:h,topicId:m,isMuted:!1})}:{title:`${d("ChatList.Mute")}...`,icon:"mute",handler:l},N=E?u?{title:d("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>p({chatId:h,topicId:m,isClosed:!1})}:{title:d("lng_forum_topic_close"),icon:"close-topic",handler:()=>p({chatId:h,topicId:m,isClosed:!0})}:void 0,I=r?{title:d("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:s}:void 0;return(0,U.oA)([b,w,C,S,N,I])}),[t,n,i,d,r,s,l])}({topic:t,chat:r,wasOpened:M,canDelete:Z,handleDelete:ae,handleMute:re});return o.ZP.createElement(_.Z,{className:(0,d.Z)("YmRS2ZiwKMtqCF87Nsw8","Chat",n&&"selected","chat-item-clickable"),onClick:le,style:s,href:g.IT?`#${(0,p.tB)(i,"thread",t.id)}`:void 0,contextActions:de,withPortalForMenu:!0,ref:ce},o.ZP.createElement("div",{className:"info"},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement("div",{className:(0,d.Z)("title")},o.ZP.createElement(j.Z,{topic:t,className:"TB99wQ9nHBumZ6E9ByUz",observeIntersection:h}),o.ZP.createElement("h3",{dir:"auto",className:"fullName"},(0,D.Z)(t.title))),t.isMuted&&o.ZP.createElement("i",{className:"icon icon-muted"}),o.ZP.createElement("div",{className:"separator"}),ne&&o.ZP.createElement("i",{className:(0,d.Z)("icon","icon-lock-badge","K6QDMKEV2GXbuOQWOS73")}),l&&o.ZP.createElement($.Z,{message:l,outgoingStatus:m})),o.ZP.createElement("div",{className:"subtitle"},se(),o.ZP.createElement(Y.Z,{chat:r,isPinned:te,isMuted:oe,topic:t,wasTopicOpened:M}))),W&&o.ZP.createElement(H.Z,{isOpen:R,onClose:L,onCloseAnimationEnd:K,confirmIsDestructive:!0,confirmHandler:ie,text:A("lng_forum_topic_delete_sure"),confirmLabel:A("Delete")}),J&&o.ZP.createElement(z.Z,{isOpen:V,onClose:q,onCloseAnimationEnd:ee,chatId:i,topicId:t.id}))}))),X=(0,o.X$)((0,a.c$)((e=>{const t=(0,l.jUK)(e).forumPanelChatId,n=t?(0,l.Z1J)(e,t):void 0,{chatId:o,threadId:a}=(0,l.Btg)(e)||{};return{chat:n,currentTopicId:t===o?a:void 0,withInterfaceAnimations:(0,l.FOo)(e)}}),(e=>(0,l.nd)(e)))((e=>{let{chat:t,currentTopicId:n,isOpen:l,isHidden:T,onTopicSearch:A,onCloseAnimationEnd:R,onOpenAnimationStart:O,withInterfaceAnimations:D}=e;const{closeForumPanel:F,openChatWithInfo:B,loadTopics:U}=(0,a.Sv)(),$=(0,o.sO)(null),j=(0,o.sO)(null),H=(0,o.sO)(null),{isMobile:_}=(0,Z.ZP)();(0,o.d4)((()=>{t&&!t.topics&&U({chatId:t.id})}),[t,U]);const[z,Y]=(0,o.eJ)(!1),X=(0,y.Z)(),q=(0,b.Z)((()=>{F()}));(0,o.d4)((()=>{D||l||R?.()}),[D,l,R]);const W=(0,b.Z)((()=>{t&&B({id:t.id,shouldReplaceHistory:!0})})),{observe:G}=(0,E.S1)({rootRef:j,throttleMs:200});(0,E._N)(H,G,(e=>{let{isIntersecting:t}=e;Y(!t)}));const K=(0,o.Ye)((()=>t?.topics?(0,c.AY)(Object.values(t.topics),t.orderedPinnedTopicIds).map((e=>{let{id:t}=e;return t})):[]),[t]),{orderDiffById:J,getAnimationType:Q}=(0,w.Z)(K,t?.id),[ee,te]=(0,P.Z)((()=>{t&&U({chatId:t.id})}),K,!t?.topicsCount||K.length>=t.topicsCount,r.C1M),ne=(0,o.sO)(!1),oe=l&&!T,ae=(0,C.Z)(oe);ae!==oe&&(ne.current=!1),(0,v.Z)({isActive:oe,onBack:q,hash:t?(0,p.tB)(t.id,"thread",i._f):void 0}),(0,o.d4)((()=>oe?(0,u.Z)(q):void 0),[q,oe]),(0,o.d4)((()=>{ae!==oe&&(0,s.Yq)((()=>{if(!$.current)return;const e=(0,f.YW)();(0,h.L)($.current,e),O?.(),oe?(ne.current=!0,$.current.style.transform="none"):(ne.current=!1,$.current.style.transform="")}))}),[oe,O,ae]),(0,o.d4)((()=>{if(g.$b)return(0,m.sf)($.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(X.isRtl?m.eM.Left:m.eM.Right)&&(F(),!0)})}),[F,X.isRtl]);const ie=void 0===t?.topics;return o.ZP.createElement("div",{ref:$,className:(0,d.Z)("GUOX6Q0XzHRhNZvBwjQ9",z&&"h_YBka1L8eRICjrO5dF5",X.isRtl&&"_1XehUpS3aX91hWXDmcu",!D&&"mPOFnJvncopcVbbyZrzs"),onTransitionEnd:l?void 0:R},o.ZP.createElement("div",{id:"TopicListHeader",className:"left-header"},o.ZP.createElement(M.Z,{round:!0,size:"smaller",color:"translucent",onClick:q,ariaLabel:X("Close")},o.ZP.createElement("i",{className:"icon icon-close"})),t&&o.ZP.createElement(N.Z,{noAvatar:!0,className:"mzucaTAH77gNB1V006lS",chatId:t.id,onClick:W}),t&&o.ZP.createElement(I.Z,{chatId:t.id,threadId:i._f,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:_,onTopicSearch:A})),t&&o.ZP.createElement(S.Z,{chatId:t.id,hasPinnedOffset:!1,className:"OH0LaRqoNDIvvHsCtEte"}),o.ZP.createElement("div",{className:"UhjDQykjZBYhiVclJl16"}),o.ZP.createElement(k.Z,{className:"chat-list custom-scroll",ref:j,items:ee,preloadBackwards:r.C1M,withAbsolutePositioning:!0,maxHeight:(K?.length||0)*r.oDu,onLoadMore:te,sensitiveArea:r.BtI,beforeChildren:o.ZP.createElement("div",{ref:H,className:"cO3iiLSh70tyWuNCUFtX"})},Boolean(ee?.length)&&function(){const e=K.indexOf(ee[0]);return ee?.map(((a,i)=>o.ZP.createElement(V,{key:a,chatId:t.id,topic:t.topics[a],style:`top: ${(e+i)*r.oDu}px;`,isSelected:n===a,observeIntersection:G,animationType:Q(a),orderDiff:J[a]})))}(),ie&&!ee?.length&&o.ZP.createElement(x.Z,{key:"loading"})),!ie&&1===ee?.length&&ee[0]===r.OxA&&o.ZP.createElement(L,{chatId:t.id}))})))},9950:(e,t,n)=>{n.d(t,{b:()=>a,w:()=>i});var o=n(60748);let a=function(e){return e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None",e}({});function i(e){return(0,o.Ye)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,o=t.filter((e=>e>0)).length;return t=>{const i=e[t];return 0===i?a.None:i===1/0||i===-1/0||n<=o&&i<0||o<n&&i>0?a.Opacity:a.Move}}),[e])}},44499:(e,t,n)=>{n.d(t,{Z:()=>M});var o=n(60748),a=n(33555),i=n(83716),r=n(57710),s=n(4463),c=n(46752),l=n(18005),d=n(32340),u=n(20230),m=n(9950),h=n(75790),p=n(59107),g=n(6202),Z=n(74399),f=n(42797),v=n(39415),P=n(2995);const E="GrFgsvT5YSYldl56Hnzu",y="yHnVWii5hDMte2XGiGio",b="H4WbKWl7lQI8hw8ryOgF",C="DGAWy9KRwAZqof7Bt1nx",w=Number(Z.Gw),S=(0,o.X$)((e=>{let{chat:t,renderLastMessage:n,observeIntersection:i}=e;const{openChat:r}=(0,a.Sv)(),l=(0,o.sO)(null),u=(0,o.sO)(null),m=(0,p.Z)(),[h,...g]=(0,o.Ye)((()=>t.topics?(0,s.AY)(Object.values(t.topics),void 0,!0).slice(0,3):[]),[t.topics]),[Z,S]=(0,o.eJ)(!1),[N,I]=(0,o.eJ)(void 0),{handleClick:M,handleMouseDown:k}=(0,v.m)((e=>{0!==h.unreadCount&&(e.stopPropagation(),e.preventDefault(),r({id:t.id,threadId:h.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,f.W7)()}))}));return(0,o.d4)((()=>{const e=l.current,t=u.current;if(!e||!t)return;const n=e.offsetWidth,o=t.offsetWidth;Math.abs(n-o)<w?I(Math.max(n,o)):I(void 0),S(n>o)}),[h,n]),o.ZP.createElement("div",{className:(0,c.Z)("gljGvMdlFlsKhrMPQ_xa",Z&&"RJ0NXk_lx9qewdoGgJsT",N&&"e4cE7B51DN3MrEY9WuKx"),dir:m.isRtl?"rtl":void 0,style:N?`--overwritten-width: ${N}px`:void 0},h&&o.ZP.createElement("div",{className:E},o.ZP.createElement("div",{className:(0,c.Z)("VUe4FFBCwClvaU9aiXG1",h.unreadCount&&y),ref:u,onClick:M,onMouseDown:k},o.ZP.createElement(P.Z,{topic:h,observeIntersection:i}),o.ZP.createElement("div",{className:"WeBppBs2KkOXzHRzQ2_W"},(0,d.Z)(h.title)),!N&&Z&&o.ZP.createElement("div",{className:b},o.ZP.createElement("div",{className:C}))),o.ZP.createElement("div",{className:"FJt1oTIn6WgfvH9iKMg3"},g.map((e=>o.ZP.createElement("div",{className:(0,c.Z)("RhuR5wto63HGEeY1NdXg",e.unreadCount&&y),key:e.id},o.ZP.createElement(P.Z,{topic:e,className:"mrAD_CKmksSYVhfxgz_w",observeIntersection:i}),o.ZP.createElement("span",{className:"Ub9bpPYaMAw0qMouq5_O"},(0,d.Z)(e.title)))))),o.ZP.createElement("div",{className:"RL7lx7aP0Fg2LakRlxHp"})),!h&&o.ZP.createElement("div",{className:(0,c.Z)(E,"bYI9fzK27IbEWGTzvRGf")},m("Loading")),o.ZP.createElement("div",{className:(0,c.Z)("OyHxp9apV7oixvvxGFDx",h?.unreadCount&&y),ref:l,onClick:M,onMouseDown:k},n(),!N&&!Z&&o.ZP.createElement("div",{className:b},o.ZP.createElement("div",{className:C}))))}));var N=n(45370),I=n(68729);function M(e){let{chat:t,lastMessage:n,chatId:Z,typingStatus:f,draft:v,actionTargetMessage:P,actionTargetUserIds:E,lastMessageTopic:y,lastMessageSender:b,actionTargetChatId:C,observeIntersection:w,animationType:M,orderDiff:k,withInterfaceAnimations:x,isTopic:T}=e;const A=(0,p.Z)(),R=(0,o.sO)(null),O=n&&(0,s.FT)(n);(0,h.Z)(Z,O?n.replyToMessageId:void 0,P);const L=n&&!(0,s.bf)(n)?(0,s.DH)(n):void 0,D=(0,g.Z)(n?(0,s.Ti)(n,"micro"):void 0),F=Boolean(n&&(0,s.Y5)(n)),B=(0,o.Ye)((()=>{if(!E)return;const e=(0,a.Rd)().users.byId;return E.map((t=>e[t])).filter(Boolean)}),[E]),U=(0,o.I4)((()=>{if(f&&n&&f.timestamp>1e3*n.date)return o.ZP.createElement(I.Z,{typingStatus:f});if(v?.text.length&&(!t?.isForum||T))return o.ZP.createElement("p",{className:"last-message",dir:A.isRtl?"auto":"ltr"},o.ZP.createElement("span",{className:"draft"},A("Draft")),(0,u.H)({text:v.text,entities:v.entities,isSimple:!0,withTranslucentThumbs:!0}));if(!n)return;if(O){const e=t&&((0,s.eA)(t)||n.senderId===n.chatId);return o.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:A.isRtl?"auto":"ltr"},(0,l.D)(A,n,e?void 0:b,e?t:void 0,B,P,C,y,{isEmbedded:!0},void 0,void 0))}const e=(0,s.zF)(A,Z,b);return o.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:A.isRtl?"auto":"ltr"},e&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"sender-name"},(0,d.Z)(e)),o.ZP.createElement("span",{className:"colon"},":")),n.forwardInfo&&o.ZP.createElement("i",{className:"icon icon-share-filled chat-prefix-icon"}),Boolean(n.replyToStoryId)&&o.ZP.createElement("i",{className:"icon icon-story-reply chat-prefix-icon"}),function(e,t,n,a,i){const r=o.ZP.createElement(N.Z,{lang:e,message:t,noEmoji:Boolean(a),observeIntersectionForLoading:n,inChatList:!0});if(!a)return r;const l=(0,s.NE)(t);return o.ZP.createElement("span",{className:"media-preview"},o.ZP.createElement("img",{src:a,alt:"",className:(0,c.Z)("media-preview--image",i&&"round",l&&"media-preview-spoiler"),draggable:!1}),(0,s.b7)(t)&&o.ZP.createElement("i",{className:"icon icon-play"}),r)}(A,n,w,D||L,F))}),[C,P,B,t,Z,v,O,F,T,A,n,b,y,D,L,w,f]);return(0,o.bt)((()=>{const e=R.current;if(x&&e){if(M===m.b.Opacity)e.style.opacity="0",(0,r.WM)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(M!==m.b.Move)return;e.style.transform=`translate3d(0, ${-k*i.rSj}px, 0)`,(0,r.WM)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,r.WM)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),200+i.fK3)}}),[x,k,M]),{renderSubtitle:function(){return t?.isForum&&!T?o.ZP.createElement(S,{chat:t,renderLastMessage:U,observeIntersection:w}):U()},ref:R}}},73217:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(65326),i=n(87204);function r(e){const t=(0,a.Z)(),n=(0,o.sO)(e),r=(0,i.Z)(e);return!1===e&&r!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},61204:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(60782),i=n(9950),r=n(87204);function s(e,t){const n=(0,o.Ye)((()=>{if(e)return e.reduce(((e,t,n)=>(e[t]=n,e)),{})}),[e]),s=(0,r.Z)(n),c=(0,r.Z)(t),l=(0,o.Ye)((()=>n&&s&&t===c?(0,a.Q8)(n,((e,t)=>void 0!==s[t]?e-s[t]:-1/0)):{}),[t,n,c,s]);return{orderDiffById:l,getAnimationType:(0,i.w)(l)}}},91:(e,t,n)=>{n.d(t,{F:()=>a});var o=n(4463);function a(e,t,n,a){const{senderId:i}=t;if(!i)return;const r=(0,o.YC)(i)?a[i]:n[i];let s=(0,o.OU)(e,r);const c=n[t.chatId];return c&&((0,o.YC)(i)&&r.isSelf?s=`${e("FromYou")} ${(0,o.U)(e,c)}`:(0,o.Bf)(c)&&(s+=` ${(0,o.U)(e,c)}`)),s}},78323:(e,t,n)=>{n.d(t,{Z:()=>M});var o=n(60748),a=n(33555),i=n(4463),r=n(7054),s=n(46752),c=n(18005),l=n(30386),d=n(17240),u=n(75790),m=n(60706),h=n(3657),p=n(59107),g=n(31212),Z=n(45277),f=n(45601),v=n(6137),P=n(91713),E=n(40647),y=n(25190),b=n(6202),C=n(70172),w=n(17551),S=n(66735);const N=(0,o.X$)((e=>{let{message:t,renderContent:n}=e;const{openMediaViewer:r,uploadProfilePhoto:s,showNotification:c}=(0,a.Sv)(),{isOutgoing:l}=t,d=(0,p.Z)(),[u,h]=(0,o.eJ)(),[g,Z,f]=(0,m.Z)(!1),N=(0,b.Z)((0,i.Ti)(t,"full")),I=t.content.action.photo?.isVideo,M=(0,y.Z)((()=>{c({title:d("ApplyAvatarHintTitle"),message:d("ApplyAvatarHint"),action:{action:"requestNextSettingsScreen",payload:{screen:P.MT.Main}},actionText:d("Open")})})),k=(0,y.Z)((e=>{h(void 0),s({file:e}),M()})),x=(0,y.Z)((()=>{h(void 0)})),T=(0,y.Z)((async()=>{f(),M();const e=t.content.action.photo,n=await E.he(`videoAvatar${e.id}?size=u`,v.IU.BlobUrl),o=await fetch(n).then((e=>e.blob()));s({file:new File([o],"avatar.mp4"),isVideo:!0,videoTs:e.videoSizes?.find((e=>void 0!==e.videoStartTs))?.videoStartTs})}));return o.ZP.createElement("span",{className:"action-message-suggested-avatar",tabIndex:0,role:"button",onClick:async()=>{!l&&N?I?Z():h(await fetch(N).then((e=>e.blob()))):r({chatId:t.chatId,mediaId:t.id,threadId:v._f,origin:P.bZ.SuggestedAvatar})}},o.ZP.createElement(C.Z,{photo:t.content.action.photo,loopIndefinitely:!0,withVideo:I,size:"jumbo"}),o.ZP.createElement("span",null,n()),o.ZP.createElement("span",{className:"action-message-button"},d(I?"ViewVideoAction":"ViewPhotoAction")),o.ZP.createElement(S.Z,{file:u,onClose:x,onChange:k}),o.ZP.createElement(w.Z,{isOpen:g,title:d("SuggestedVideo"),confirmHandler:T,onClose:f,textParts:n()}))}));var I=n(97182);const M=(0,o.X$)((0,a.c$)(((e,t)=>{let{message:n,threadId:o}=t;const{chatId:a,senderId:s,replyToMessageId:c,content:l}=n,d=s,{targetUserIds:u,targetChatId:m}=l.action||{},h=c,p=h?(0,r.hjO)(e,a,h):void 0,g=!!o&&(0,r._XY)(e,n,o),{direction:Z,noHighlight:f}=g&&(0,r.jUK)(e).focusedMessage||{},v=(0,r.Z1J)(e,a),P=v&&((0,i.eA)(v)||d===a),E=!P&&d?(0,r.dyD)(e,d):void 0,y=P?v:void 0,b=e.premiumGifts?.stickers?.[0];return{senderUser:E,senderChat:y,targetChatId:m,targetUserIds:u,targetMessage:p,isFocused:g,premiumGiftSticker:b,topic:(0,r.p$s)(e,n),canPlayAnimatedEmojis:(0,r.W9H)(e),...g&&{focusDirection:Z,noFocusHighlight:f}}}))((e=>{let{message:t,isEmbedded:n,appearanceOrder:r=0,isJustAdded:v,isLastInList:P,senderUser:E,senderChat:y,targetUserIds:b,targetMessage:C,targetChatId:w,isFocused:S,focusDirection:M,noFocusHighlight:k,premiumGiftSticker:x,isInsideTopic:T,topic:A,memoFirstUnreadIdRef:R,canPlayAnimatedEmojis:O,observeIntersectionForReading:L,observeIntersectionForLoading:D,observeIntersectionForPlaying:F,onPinnedIntersectionChange:B}=e;const{openPremiumModal:U,requestConfetti:$}=(0,a.Sv)(),j=(0,p.Z)(),H=(0,o.sO)(null);(0,h._N)(H,L),(0,u.Z)(t.chatId,t.replyToMessageId,C),(0,Z.Z)(H,t.chatId,S,M,k,v),(0,o.d4)((()=>{if(t.isPinned)return()=>{B?.({viewportPinnedIdsToRemove:[t.id],isUnmount:!0})}}),[B,t.isPinned,t.id]);const _=r<=0,[z,Y]=(0,m.Z)(_),V=Boolean(t.content.action?.text.startsWith("ActionGift")),X="suggestProfilePhoto"===t.content.action?.type&&t.content.action.photo;(0,o.d4)((()=>{_||setTimeout(Y,10*r)}),[r,Y,_]);const q=(0,h.Op)(H,F),W=(0,o.sO)((()=>{const e=R?.current&&t.id>=R.current;return V&&!t.isOutgoing&&e})());(0,o.d4)((()=>{q&&W.current&&(W.current=!1,$())}),[q,$]);const{transitionClassNames:G}=(0,g.Z)(z,void 0,_,!1),K=(0,a.Rd)().users.byId,J=(0,o.Ye)((()=>b?b.map((e=>K?.[e])).filter(Boolean):void 0),[b,K]),Q=(0,o.I4)((()=>(0,c.D)(j,t,E,y,J,C,w,A,{isEmbedded:n},D,F)),[n,j,t,D,F,y,E,w,C,J,A]),{isContextMenuOpen:ee,contextMenuPosition:te,handleBeforeContextMenu:ne,handleContextMenu:oe,handleContextMenuClose:ae,handleContextMenuHide:ie}=(0,d.Z)(H),re=void 0!==te;if(T&&"TopicWasCreatedAction"===t.content.action?.text)return o.ZP.createElement("span",{ref:H});if(n)return o.ZP.createElement("span",{ref:H,className:"embedded-action-message"},Q());const se=(0,s.Z)("ActionMessage message-list-item",S&&!k&&"focused",(V||X)&&"centered-action",re&&"has-menu-open",P&&"last-in-list",!V&&!X&&"in-one-row",G);return o.ZP.createElement("div",{ref:H,id:(0,i.d0)(t.id),className:se,"data-message-id":t.id,"data-is-pinned":t.isPinned||void 0,onMouseDown:e=>{(0,l.q)(e),ne(e)},onContextMenu:oe},!X&&o.ZP.createElement("span",{className:"action-message-content"},Q()),V&&o.ZP.createElement("span",{className:"action-message-gift",tabIndex:0,role:"button",onClick:()=>{U({isGift:!0,fromUserId:E?.id,toUserId:b?.[0],monthsAmount:t.content.action?.months||0})}},o.ZP.createElement(f.Z,{key:t.id,sticker:x,play:O,noLoop:!0,nonInteractive:!0}),o.ZP.createElement("strong",null,j("ActionGiftPremiumTitle")),o.ZP.createElement("span",null,j("ActionGiftPremiumSubtitle",j("Months",t.content.action?.months,"i"))),o.ZP.createElement("span",{className:"action-message-button"},j("ActionGiftPremiumView"))),X&&o.ZP.createElement(N,{message:t,renderContent:Q}),te&&o.ZP.createElement(I.Z,{isOpen:ee,anchor:te,message:t,messageListType:"thread",onClose:ae,onCloseAnimationEnd:ie}))})))},59188:(e,t,n)=>{n.d(t,{Z:()=>y});var o=n(60748),a=n(33555),i=n(6137),r=n(91713),s=n(57710),c=n(4463),l=n(7054),d=n(97184),u=n(73541),m=n(59107),h=n(25190),p=n(231),g=n(53106),Z=n(58964),f=n(66902),v=n(99203),P=n(48778);const E=e=>{const{isOpen:t}=e,n=(0,P.Z)(v.gl.Extra,"HeaderMenuContainer",!t);return n?o.ZP.createElement(n,e):void 0},y=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,threadId:o,messageListType:a,isMobile:r}=t;const s=(0,l.Z1J)(e,n),u=Boolean(s&&(0,c.eA)(s)),m=(0,l.rB0)(e),h=(0,l.Mc4)(e),p=(0,c.YC)(n),{doNotTranslate:g}=e.settings.byKey;if(!s||s.isRestricted||(0,l.CAb)(e))return{noMenu:!0,language:m,translationLanguage:h,doNotTranslate:g};const Z=(0,l.kBx)(e,n),f=p?void 0:(0,l.x67)(e,n),v=p?(0,l.ccz)(e,n):void 0,P=f||v,E=(0,l.FM1)(e,n),y="thread"===a&&o===i._f,b="thread"===a&&o!==i._f,C=(0,l.Jf5)(e,r),w=!!p&&(0,l.s4q)(e,n),S=Boolean(Z&&w),N=!S&&Boolean((0,l.pkN)(e,n)),I=w&&!Z,M=Boolean((y||s.isForum)&&(u||(0,c.ZV)(s))&&s.isNotJoined),k=y||b,x=d.Bi&&(0,c.YC)(s.id)&&!E&&!Z,T=y&&!E&&!M,A=y&&!M,R=d.Bi&&y&&s.isCallActive,O=d.Bi&&y&&!s.isCallActive&&(s.adminRights?.manageCall||s.isCreator&&(0,c.G9)(s)),L=y&&f?.canViewStatistics,D=y?f?.requestsPending:void 0,F=Boolean(s?.isNotJoined&&s.isJoinToSend),B=Boolean(s?.isNotJoined&&s.isJoinRequest),U=!(0,l.FOo)(e),$=Boolean((0,l.lpX)(e,n));return{noMenu:!1,isChannel:u,isRightColumnShown:C,canStartBot:N,canRestartBot:S,canSubscribe:M,canSearch:k,canCall:x,canMute:T,canViewStatistics:L,canLeave:A,canEnterVoiceChat:R,canCreateVoiceChat:O,pendingJoinRequests:D,shouldJoinToSend:F,shouldSendJoinRequest:B,noAnimation:U,canTranslate:(0,l.GDM)(e,n)&&!P?.isTranslationDisabled,isTranslating:$,translationLanguage:h,language:m,doNotTranslate:g,detectedChatLanguage:s.detectedLanguage,canUnblock:I}}))((e=>{let{chatId:t,threadId:n,noMenu:c,isMobile:l,isChannel:v,canStartBot:P,canRestartBot:y,canUnblock:C,canSubscribe:w,canSearch:S,canCall:N,canMute:I,canViewStatistics:M,canLeave:k,canEnterVoiceChat:x,canCreateVoiceChat:T,pendingJoinRequests:A,isRightColumnShown:R,isForForum:O,canExpandActions:L,shouldJoinToSend:D,shouldSendJoinRequest:F,noAnimation:B,canTranslate:U,isTranslating:$,translationLanguage:j,language:H,detectedChatLanguage:_,doNotTranslate:z,onTopicSearch:Y}=e;const{joinChannel:V,sendBotCommand:X,openLocalTextSearch:q,restartBot:W,requestMasterAndRequestCall:G,requestNextManagementScreen:K,showNotification:J,openChat:Q,requestChatTranslation:ee,togglePeerTranslations:te,openChatLanguageModal:ne,setSettingOption:oe,unblockUser:ae}=(0,a.Sv)(),ie=(0,o.sO)(null),re=(0,m.Z)(),[se,ce]=(0,o.eJ)(!1),[le,de]=(0,o.eJ)(void 0),ue=(0,h.Z)((()=>{ce(!0);const e=ie.current.getBoundingClientRect();de({x:e.right,y:e.bottom})})),me=(0,h.Z)((()=>{ce(!1)})),he=(0,h.Z)((()=>{de(void 0)})),pe=(0,h.Z)((()=>{V({chatId:t}),F&&J({message:re(v?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})})),ge=(0,h.Z)((()=>{X({command:"/start"})})),Ze=(0,h.Z)((()=>{W({chatId:t})})),fe=(0,h.Z)((()=>{ae({userId:t})})),ve=(0,h.Z)((()=>{ee($?{chatId:t,toLanguageCode:void 0}:{chatId:t,toLanguageCode:j})})),Pe=(0,h.Z)((()=>{K({screen:r.u1.JoinRequests})})),Ee=(0,h.Z)((()=>{O?Y?.():(q(),l?document.querySelector("#MobileSearch input").focus():B?(0,s.i$)((()=>{(0,s.Yq)(b)})):setTimeout(b,320))})),ye=(0,h.Z)((()=>{Q({id:t,threadId:i._f})})),be=(0,h.Z)((e=>{S&&d.RM&&!e.shiftKey&&(e.preventDefault(),Ee())})),Ce=(0,h.Z)(((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,o=re(n);if(o!==n)return re(e,o);const a=new Intl.DisplayNames([H],{type:"language"}).of(t);return re(`${e}Other`,a)})),we=(0,o.Ye)((()=>$?re("ShowOriginalButton"):Ce("TranslateToButton",j)),[j,Ce,$,re]),Se=(0,o.Ye)((()=>{if(_)return Ce("DoNotTranslateLanguage",_)}),[Ce,_]),Ne=(0,h.Z)((()=>{te({chatId:t,isEnabled:!1}),ee({chatId:t,toLanguageCode:void 0})})),Ie=(0,h.Z)((()=>{ne({chatId:t})})),Me=(0,h.Z)((()=>{_&&(oe({doNotTranslate:[...z,_]}),ee({chatId:t,toLanguageCode:void 0}),J({message:Ce("AddedToDoNotTranslate",_)}))}));(0,u.y)({"Mod+F":be});const ke=(0,o.Ye)((()=>e=>{let{onTrigger:t,isOpen:n}=e;return o.ZP.createElement(p.Z,{round:!0,ripple:R,color:"translucent",size:"smaller",className:n?"active":"",onClick:t,ariaLabel:re("TranslateMessage")},o.ZP.createElement("i",{className:"icon icon-language","aria-hidden":!0}))}),[R,re]);return o.ZP.createElement("div",{className:"HeaderActions"},!O&&U&&o.ZP.createElement(g.Z,{className:"stickers-more-menu with-menu-transitions",trigger:ke,positionX:"right"},o.ZP.createElement(Z.Z,{icon:"language",onClick:ve},we),o.ZP.createElement(Z.Z,{icon:"replace",onClick:Ie},re("Chat.Translate.Menu.To")),o.ZP.createElement(f.Z,null),_&&o.ZP.createElement(Z.Z,{icon:"hand-stop",onClick:Me},Se),o.ZP.createElement(Z.Z,{icon:"close-circle",onClick:Ne},re("Hide"))),!l&&o.ZP.createElement(o.ZP.Fragment,null,L&&!F&&(w||D)&&o.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:pe},re(v?"ProfileJoinChannel":"ProfileJoinGroup")),L&&F&&o.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:pe},re("ChannelJoinRequest")),L&&P&&o.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:ge},re("BotStart")),L&&y&&o.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:Ze},re("BotRestart")),L&&C&&o.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:fe},re("Unblock")),S&&o.ZP.createElement(p.Z,{round:!0,ripple:R,color:"translucent",size:"smaller",onClick:Ee,ariaLabel:re("Conversation.SearchPlaceholder")},o.ZP.createElement("i",{className:"icon icon-search","aria-hidden":!0})),N&&o.ZP.createElement(p.Z,{round:!0,color:"translucent",size:"smaller",onClick:function(){G({userId:t})},ariaLabel:"Call"},o.ZP.createElement("i",{className:"icon icon-phone","aria-hidden":!0}))),!O&&Boolean(A)&&o.ZP.createElement(p.Z,{round:!0,className:"badge-button",ripple:R,color:"translucent",size:"smaller",onClick:Pe,ariaLabel:re(v?"SubscribeRequests":"MemberRequests")},o.ZP.createElement("i",{className:"icon icon-user","aria-hidden":!0}),o.ZP.createElement("div",{className:"badge"},A)),o.ZP.createElement(p.Z,{ref:ie,className:se?"active":"",round:!0,ripple:!l,size:"smaller",color:"translucent",disabled:c,ariaLabel:"More actions",onClick:ue},o.ZP.createElement("i",{className:"icon icon-more","aria-hidden":!0})),le&&o.ZP.createElement(E,{chatId:t,threadId:n,isOpen:se,anchor:le,withExtraActions:l||!L,isChannel:v,canStartBot:P,canSubscribe:w,canSearch:S,canCall:N,canMute:I,canViewStatistics:M,canLeave:k,canEnterVoiceChat:x,canCreateVoiceChat:T,pendingJoinRequests:A,onJoinRequestsClick:Pe,withForumActions:O,onSubscribeChannel:pe,onSearchClick:Ee,onAsMessagesClick:ye,onClose:me,onCloseAnimationEnd:he}))})));function b(){document.querySelector(".RightHeader .SearchInput input")?.focus()}},43159:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(60748),a=n(33555),i=n(60706),r=n(59107),s=n(25190),c=n(52328),l=n(58964),d=n(6137),u=n(4463),m=n(46752),h=n(42797),p=n(6202);const g="N3E1geoPu1vesCKf545F",Z=/#fff/gi,f=(0,o.X$)((e=>{let{icon:t,theme:n}=e;const{isTouchScreen:a}=(0,h.ZP)(),i=(0,p.Z)((0,u.ym)(t),!1,d.IU.Text),r=(0,o.Ye)((()=>{if(!i)return"";const e="dark"===n?"rgb(170, 170, 170)":"rgb(112, 117, 121)",t=i.replace(Z,e),o=(new DOMParser).parseFromString(t,"image/svg+xml");return o.querySelectorAll("path").forEach((t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"})),`data:image/svg+xml;utf8,${o.documentElement.outerHTML}`}),[i,n]);return o.ZP.createElement("i",{className:(0,m.Z)("vL8HfVVnjTeFmp1ECFj8","icon",!a&&g)},o.ZP.createElement("img",{src:r,alt:"",className:(0,m.Z)("Fb4aIyDYEwOlaqY8oZkV",!a&&g),draggable:!1}))})),v=(0,o.X$)((e=>{let{bot:t,theme:n,chatId:d,threadId:u,isInSideMenu:m,onMenuOpened:h,onMenuClosed:p}=e;const{callAttachBot:g,toggleAttachBot:Z}=(0,a.Sv)(),v=(0,r.Z)(),P=(0,o.Ye)((()=>t.icons.find((e=>{let{name:t}=e;return"default_static"===t}))?.document),[t.icons]),[E,y,b]=(0,i.Z)(),[C,w]=(0,o.eJ)(void 0),S=(0,s.Z)((e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();w({x:t.right,y:t.bottom}),h(),y()})),N=(0,s.Z)((()=>{g(m?{bot:t,isFromSideMenu:!0}:{bot:t,chatId:d,threadId:u})})),I=(0,s.Z)((()=>{b(),p()})),M=(0,s.Z)((()=>{w(void 0)})),k=(0,s.Z)((()=>{Z({botId:t.id,isEnabled:!1})}));return o.ZP.createElement(l.Z,{key:t.id,customIcon:P&&o.ZP.createElement(f,{icon:P,theme:n}),icon:P?void 0:"bots",onClick:N,onContextMenu:S},t.shortName,C&&o.ZP.createElement(c.Z,{isOpen:E,positionX:"right",style:`left: ${C.x}px;top: ${C.y}px;`,className:"bot-attach-context-menu",autoClose:!0,withPortal:!0,onClose:I,onCloseAnimationEnd:M},o.ZP.createElement(l.Z,{icon:"stop",destructive:!0,onClick:k},v("WebApp.RemoveBot"))))}))},93219:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"CustomEmojiTooltip",!t);return n?o.ZP.createElement(n,e):void 0}},67146:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"CustomSendMenu",!t);return n?o.ZP.createElement(n,e):void 0}},12420:(e,t,n)=>{n.d(t,{t:()=>h,Z:()=>p});var o=n(60748),a=n(46752),i=n(23989),r=n(21262),s=n(25190),c=n(87204),l=n(31212),d=n(62898),u=n(60706);const m=(0,o.X$)((e=>{let{isQuick:t,isGeneric:n,onFileSelect:i}=e;const[r,s,c]=(0,u.Z)(),l=(0,a.Z)("DropTarget",r&&"hovered");return o.ZP.createElement("div",{className:l,onDrop:i,onDragEnter:s,onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),c()},"data-dropzone":!0},o.ZP.createElement("div",{className:"target-content"},o.ZP.createElement("div",{className:"icon icon-"+(t?"photo":"document")}),o.ZP.createElement("div",{className:"title"},"Drop files here to send them"),!n&&o.ZP.createElement("div",{className:"description"},t?"in a quick way":"without compression")))}));let h=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const p=(0,o.X$)((e=>{let{isOpen:t,withQuick:n,onHide:u,onFileSelect:h}=e;const p=(0,o.sO)(null),g=(0,c.Z)(n),{shouldRender:Z,transitionClassNames:f}=(0,l.Z)(t);(0,o.d4)((()=>t?(0,i.Z)(u):void 0),[t,u]);const v=(0,s.Z)((async e=>{const{dataTransfer:t}=e;let o=[];if(!(t.files&&t.files.length>0)||t.items&&t.items.length){if(t.items&&t.items.length>0){const e=await(0,r.Z)(t.items);e?.length&&(o=o.concat(e))}}else o=o.concat(Array.from(t.files));u(),h(o,!n&&void 0)})),P=(0,s.Z)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(u(),h(Array.from(t.files),!0))})),E=(0,s.Z)((e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;t.matches(".DropTarget, .DropArea")&&!n&&(p.current=window.setTimeout((()=>{u()}),150))}));if(!Z)return;const y=n||g,b=(0,a.Z)("DropArea",f);return o.ZP.createElement(d.Z,{containerId:"#middle-column-portals"},o.ZP.createElement("div",{className:b,onDragLeave:E,onDragOver:()=>{p.current&&window.clearTimeout(p.current)},onDrop:u,onClick:u},o.ZP.createElement(m,{onFileSelect:v,isGeneric:!y}),y&&o.ZP.createElement(m,{onFileSelect:P,isQuick:!0})))}))},19830:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"EmojiTooltip",!t);return n?o.ZP.createElement(n,e):void 0}},49841:(e,t,n)=>{n.d(t,{Z:()=>_});var o=n(60748),a=n(33555),i=n(83716),r=n(57710),s=n(7054),c=n(46752),l=n(517),d=n(98069),u=n(65723),m=n(94462),h=n(69118),p=n(97184),g=n(32340),Z=n(96391),f=n(42797),v=n(86203),P=n(60706),E=n(18674),y=n(59107),b=n(25190),C=n(84089),w=n(74753);function S(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class N{constructor(e,t,n){this.container=t,this.options=n,S(this,"video",void 0),S(this,"isPlaying",!1),this.video=document.createElement("video"),this.video.src=e,this.video.disablePictureInPicture=!0,this.video.muted=!0,n.style&&this.video.setAttribute("style",n.style),this.video.style.position="absolute",this.video.load(),this.options.noLoop||(this.video.loop=!0),(0,r.WM)((()=>{this.container.appendChild(this.video),this.recalculatePositionAndSize()}))}play(){!this.isPlaying&&this.video&&(this.recalculatePositionAndSize(),this.video.paused&&(0,w.Z)(this.video),this.isPlaying=!0)}pause(){this.isPlaying&&this.video&&(this.video.paused||this.video.pause(),this.isPlaying=!1)}destroy(){this.pause(),this.video?.remove(),this.video=void 0}updatePosition(e){this.options.position=e,this.recalculatePositionAndSize()}recalculatePositionAndSize(){const{size:e,position:{x:t,y:n}}=this.options;(0,r.i$)((()=>{if(!this.video)return;const o=this.video,{width:a,height:i}=this.container.getBoundingClientRect();(0,r.WM)((()=>{o.style.left=`${Math.round(t*a)}px`,o.style.top=`${Math.round(n*i)}px`,o.style.width=`${e}px`,o.style.height=`${e}px`}))}))}}var I=n(74288),M=n(28712),k=n(27370),x=n(74399),T=n(22268),A=n(92085),R=n(45332),O=n(274),L=n(78722),D=n(3927);const F=1.25*x.Gw;var B=n(4292),U=n(72087);const $="input-scroller",j=140,H=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],_=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,threadId:o}=t;const{messageSendKeyCombo:a}=e.settings.byKey;return{messageSendKeyCombo:a,replyingToId:n&&o?(0,s.Yyv)(e,n,o):void 0,isSelectModeActive:(0,s.CAb)(e),canPlayAnimatedEmojis:(0,s.W9H)(e)}}))((e=>{let{ref:t,id:n,chatId:w,captionLimit:S,isAttachmentModalInput:x,isStoryInput:_,customEmojiPrefix:z,editableInputId:Y,isReady:V,isActive:X,getHtml:q,placeholder:W,timedPlaceholderLangKey:G,timedPlaceholderDate:K,forcedPlaceholder:J,canSendPlainText:Q,canAutoFocus:ee,noFocusInterception:te,shouldSuppressFocus:ne,shouldSuppressTextFormatter:oe,replyingToId:ae,isSelectModeActive:ie,canPlayAnimatedEmojis:re,messageSendKeyCombo:se,onUpdate:ce,onSuppressedFocus:le,onSend:de,onScroll:ue,onFocus:me,onBlur:he}=e;const{editLastMessage:pe,replyToNextMessage:ge,showAllowedMessageTypesNotification:Ze}=(0,a.Sv)();let fe=(0,o.sO)(null);t&&(fe=t);const ve=(0,o.sO)(null),Pe=(0,o.sO)(null),Ee=(0,o.sO)(null),ye=(0,o.sO)(null),be=(0,o.sO)(null),Ce=(0,o.sO)(null),we=(0,y.Z)(),Se=(0,o.sO)(!1),[Ne,Ie,Me]=(0,P.Z)(),[ke,xe]=(0,o.eJ)(),[Te,Ae]=(0,o.eJ)(),[Re,Oe]=(0,o.eJ)(!1),{isMobile:Le}=(0,f.ZP)(),De=Le&&(p.cj||p.wZ),[Fe,Be]=(0,o.eJ)(!1);(0,o.d4)((()=>{Be(Boolean(G&&K))}),[K,G]);const Ue=(0,b.Z)((()=>{Be(!1)}));!function(e,t,n,i,c,l,d,u,m){const h=(0,A.Z)(t,!u),p=(0,T.Z)(h,!0),g=(0,o.sO)(new Map),Z=(0,b.Z)((e=>{e.forEach((e=>{const t=g.current.get(e);t&&(t.destroy(),g.current.delete(e))}))})),f=(0,b.Z)((()=>{if(!(u&&t.current&&n.current&&i.current))return;const e=(0,a.Rd)(),o=new Set(g.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach((t=>{if(!t.dataset.uniqueId)return;const a=`${l}${t.dataset.uniqueId}${h||""}`,r=t.dataset.documentId;o.delete(a);const u=(0,I.XH)(r);if(!u)return;const m=n.current.getBoundingClientRect(),Z=t.getBoundingClientRect(),f=(0,M.NM)((Z.left-m.left)/m.width,4),v=(0,M.NM)((Z.top-m.top)/m.height,4);if(g.current.has(a))return void g.current.get(a).updatePosition(f,v);const P=e.customEmojis.byId[r];if(!P)return;const E=P?.stickerSetInfo&&(0,s.Si0)(e,P.stickerSetInfo),y=[l,r,h].filter(Boolean).join("_");(async function(e){let{customEmoji:t,sharedCanvasRef:n,sharedCanvasHqRef:o,absoluteContainerRef:a,renderId:i,viewId:r,mediaUrl:s,position:c,isHq:l,textColor:d,colorFilter:u}=e;if(t.isLottie){const e=t.shouldUseTextColor&&d?(0,k.oo)(d):void 0,a=(await(0,C.t)()).init(s,l?o.current:n.current,i,{size:F,coords:c,isLowPriority:!l},r,e?[e.r,e.g,e.b]:void 0);return{play:()=>a.play(),pause:()=>a.pause(),destroy:()=>a.removeView(r),updatePosition:(e,t)=>a.setSharedCanvasCoords(r,{x:e,y:t})}}if(t.isVideo){const e=t.shouldUseTextColor&&u?`filter: ${u};`:void 0,n=new N(s,a.current,{size:F,position:c,style:e});return{play:()=>n.play(),pause:()=>n.pause(),destroy:()=>n.destroy(),updatePosition:(e,t)=>n.updatePosition({x:e,y:t})}}throw new Error("Unsupported custom emoji type")})({customEmoji:P,sharedCanvasRef:n,sharedCanvasHqRef:i,absoluteContainerRef:c,renderId:y,viewId:a,mediaUrl:u,isHq:E,position:{x:f,y:v},textColor:h,colorFilter:p}).then((e=>{d&&e.play(),g.current.set(a,e)}))})),Z(Array.from(o))}));(0,o.d4)((()=>(0,I.bn)(f)),[f]),(0,o.d4)((()=>{e()&&t.current&&n.current&&m&&u?(0,r.i$)((()=>{f()})):Z(Array.from(g.current.keys()))}),[e,f,t,Z,n,m,u]),(0,o.bt)((()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")}),[p]),(0,O.Z)((e=>{let[t]=e;void 0!==t&&h!==t&&f()}),[h,f]);const v=(0,D.Z)(f,[f],300,!1);(0,L.Z)(n,v);const P=(0,b.Z)((()=>{g.current.forEach((e=>{e.pause()}))})),E=(0,b.Z)((()=>{d&&g.current?.forEach((e=>{e.play()}))})),y=(0,b.Z)((()=>{(0,r.i$)(E)}));(0,R.Z)(P,y)}(q,fe,ye,be,Ce,z,re,V,X);const $e=x?160:_?128:Le?256:416,je=(0,b.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,r.lT)((()=>{const t=fe.current.closest(".input-scroller"),n=Number(t.style.height.replace("px","")),o=Ee.current,{scrollHeight:a}=o,i=Math.min(a,$e);if(i===n)return;const s=a>$e;function c(){const e=Math.round(50*Math.log(Math.abs(i-n)));t.style.height=`${i}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",s)}return e?void(0,r.WM)(c):c}))}));(0,o.bt)((()=>{x&&je(!1)}),[x,je]);const He=(0,o.sO)(q());(0,o.bt)((()=>{const e=X?q():"";e!==fe.current.innerHTML&&(fe.current.innerHTML=e),e!==Pe.current.innerHTML&&(Pe.current.innerHTML=e),e!==He.current&&(He.current=e,je(!e))}),[q,X,je]),(0,o.sO)(w).current=w;const _e=(0,b.Z)((()=>{fe.current&&((0,E.zG)()?setTimeout(_e,350):(0,u.Z)(fe.current))})),ze=(0,b.Z)((()=>{Me(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}));function Ye(){if(p.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||Se.current)return Me(),p.wZ&&Oe(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(oe||!(0,Z.R)(t,Y||i.R2F)||!n||(0,m.Z)(n)||!t.START_TO_END)||(Me(),!1)}function Ve(){if(!Ye())return;if(Re)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=fe.current.closest(".input-scroller").getBoundingClientRect();let o=t.left+t.width/2-n.left;o<j?o=j:o>n.width-j&&(o=n.width-j),xe({x:o,y:t.top-n.top}),Ae(e),Ie()}function Xe(){ve.current&&window.clearTimeout(ve.current),ve.current=window.setTimeout(Ve,260)}(0,o.d4)((()=>{p.$b||ee&&_e()}),[w,_e,ae,ee]),(0,o.d4)((()=>{if(!w||Y!==i.R2F||te||De||ie)return;const e=e=>{if((0,d.wT)())return;const{key:t}=e,n=e.target;if(!n||H.includes(t))return;const o=fe.current,a=document.getSelection()?.isCollapsed;if(!((t.startsWith("Arrow")||e.shiftKey&&"Shift"===t)&&!a||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==n.tagName)&&o&&n!==o&&"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable){(0,u.Z)(o,!0,!0);const t=new KeyboardEvent(e.type,e);o.dispatchEvent(t)}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}}),[w,Y,De,ie,te]),(0,o.d4)((()=>{const e=(0,h.Ds)((e=>{"Tab"!==e.key||(0,d.wT)()||(e.preventDefault(),(0,r.WM)(_e))}),2e3,!0,!1);return(0,l.Z)({onTab:e})}),[_e]),(0,o.d4)((()=>{const e=fe.current;function t(){e.blur()}return ne&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[ne]);const qe=(0,v.Z)((()=>Boolean(X&&q())),[X,q]),We=(0,c.Z)("form-control allow-selection",qe&&"touched",ne&&"focus-disabled");return o.ZP.createElement("div",{id:n,onClick:ne?le:void 0,dir:we.isRtl?"rtl":void 0},o.ZP.createElement("div",{className:(0,c.Z)("custom-scroll",$),onScroll:ue,onClick:x||Q?void 0:function(){x||Q||Ze({chatId:w})}},o.ZP.createElement("div",{className:"input-scroller-content"},o.ZP.createElement("div",{ref:fe,id:Y||i.R2F,className:We,contentEditable:x||Q,role:"textbox",dir:"auto",tabIndex:0,onClick:_e,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(ce("<br>"===t?"":t),!p.$b&&(!n||!n.length)&&(p.op||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(fe.current.blur(),e.removeAllRanges(),(0,u.Z)(fe.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=q();if(!t&&!n&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void ge({targetIndexDelta:t})}t||"Enter"!==e.key||e.shiftKey?t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",Xe,{once:!0}):(e.preventDefault(),pe()):!De&&("enter"===se&&!e.shiftKey||"ctrl-enter"===se&&(e.ctrlKey||e.metaKey))&&(e.preventDefault(),Me(),de())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout((()=>{Se.current=!1}),100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?Se.current||(Se.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",Xe,{once:!0})},onContextMenu:p.wZ?function(e){Ye()&&(Oe(!Re),Re?Me():(e.preventDefault(),e.stopPropagation(),Ve()))}:void 0,onTouchCancel:p.wZ?Xe:void 0,"aria-label":W,onFocus:me,onBlur:he}),!J&&o.ZP.createElement("span",{className:(0,c.Z)("placeholder-text",!x&&!Q&&"with-icon"),dir:"auto"},!x&&!Q&&o.ZP.createElement("i",{className:"icon icon-lock-badge placeholder-icon"}),Fe?o.ZP.createElement(B.Z,{langKey:G,endsAt:K,onEnd:Ue}):W),o.ZP.createElement("canvas",{ref:ye,className:"shared-canvas"}),o.ZP.createElement("canvas",{ref:be,className:"shared-canvas"}),o.ZP.createElement("div",{ref:Ce,className:"absolute-video-container"}))),o.ZP.createElement("div",{ref:Ee,className:(0,c.Z)("custom-scroll",$,"clone")},o.ZP.createElement("div",{className:"input-scroller-content"},o.ZP.createElement("div",{ref:Pe,className:(0,c.Z)(We,"clone"),dir:"auto"}))),void 0!==S&&o.ZP.createElement("div",{className:"max-length-indicator",dir:"auto"},S),o.ZP.createElement(U.Z,{isOpen:Ne,anchorPosition:ke,selectedRange:Te,setSelectedRange:Ae,onClose:ze}),J&&o.ZP.createElement("span",{className:"forced-placeholder"},(0,g.Z)(J)))})))},23522:(e,t,n)=>{n.d(t,{Z:()=>Z});var o=n(60748),a=n(33555),i=n(83716),r=n(46752),s=n(60706),c=n(25190),l=n(12644),d=n(231),u=n(43521),m=n(49204),h=n(99203),p=n(48778);const g=e=>{const{isOpen:t}=e,n=(0,p.Z)(h.gl.Extra,"SymbolMenu",!t);return n?o.ZP.createElement(n,e):void 0},Z=(0,o.X$)((e=>{let{chatId:t,threadId:n,isMobile:h,canSendGifs:p,canSendStickers:Z,isMessageComposer:f,isReady:v,isSymbolMenuOpen:P,idPrefix:E,isAttachmentModal:y,canSendPlainText:b,isSymbolMenuForced:C,className:w,forceDarkTheme:S,inputCssSelector:N=i.Edp,openSymbolMenu:I,closeSymbolMenu:M,onCustomEmojiSelect:k,onStickerSelect:x,onGifSelect:T,onRemoveSymbol:A,onEmojiSelect:R,closeBotCommandMenu:O,closeSendAsMenu:L}=e;const{setStickerSearchQuery:D,setGifSearchQuery:F,addRecentEmoji:B,addRecentCustomEmoji:U}=(0,a.Sv)(),$=(0,o.sO)(null),[j,H]=(0,s.Z)(),[_,z]=(0,o.eJ)(void 0),Y=(0,r.Z)("mobile-symbol-menu-button",!v&&"not-ready",j?P&&"menu-opened":P&&"is-loading"),V=(0,c.Z)((()=>{O?.(),L?.(),I();const e=$.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();z({x:t,y:n})})),X=(0,c.Z)((e=>{"stickers"===e?(D({query:""}),F({query:void 0})):(F({query:""}),D({query:void 0}))})),q=(0,c.Z)((()=>{const e=document.querySelector(y?i.VEm:N);h&&e===document.activeElement?(e?.blur(),setTimeout((()=>{O?.(),I()}),100)):I()})),W=(0,c.Z)((()=>$.current)),G=(0,c.Z)((()=>$.current?.closest(".custom-scroll, .no-scrollbar"))),K=(0,c.Z)((()=>document.querySelector("#portals .SymbolMenu .bubble"))),J=(0,c.Z)((()=>({withPortal:!0}))),{positionX:Q,positionY:ee,transformOriginX:te,transformOriginY:ne,style:oe}=(0,l.Z)(_,W,G,K,J);return o.ZP.createElement(o.ZP.Fragment,null,h?o.ZP.createElement(d.Z,{className:Y,round:!0,color:"translucent",onClick:P?M:q,ariaLabel:"Choose emoji, sticker or GIF"},o.ZP.createElement("i",{className:"icon icon-smile"}),o.ZP.createElement("i",{className:"icon icon-keyboard"}),P&&!j&&o.ZP.createElement(m.Z,{color:"gray"})):o.ZP.createElement(u.Z,{className:(0,r.Z)("symbol-menu-button",P&&"activated"),round:!0,color:"translucent",onActivate:V,ariaLabel:"Choose emoji, sticker or GIF"},o.ZP.createElement("div",{ref:$,className:"symbol-menu-trigger"}),o.ZP.createElement("i",{className:"icon icon-smile"})),o.ZP.createElement(g,{chatId:t,threadId:n,isOpen:P||Boolean(C),canSendGifs:p,canSendStickers:Z,isMessageComposer:f,idPrefix:E,onLoad:H,onClose:M,onEmojiSelect:R,onStickerSelect:x,onCustomEmojiSelect:k,onGifSelect:T,onRemoveSymbol:A,onSearchOpen:X,addRecentEmoji:B,addRecentCustomEmoji:U,isAttachmentModal:y,canSendPlainText:b,className:(0,r.Z)(w,S&&"component-theme-dark"),positionX:y?Q:void 0,positionY:y?ee:void 0,transformOriginX:y?te:void 0,transformOriginY:y?ne:void 0,style:y?oe:void 0}))}))},72087:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(6137),i=n(83716),r=n(46752),s=n(23989),c=n(81396),l=n(3858),d=n(44139),u=n(60706),m=n(59107),h=n(25190),p=n(31212),g=n(58758),Z=n(231);const f={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace",SPAN:"spoiler"},v=document.createElement("div"),P=(0,o.X$)((e=>{let{isOpen:t,anchorPosition:n,selectedRange:P,setSelectedRange:E,onClose:y}=e;const b=(0,o.sO)(null),C=(0,o.sO)(null),{shouldRender:w,transitionClassNames:S}=(0,p.Z)(t),[N,I,M]=(0,u.Z)(),[k,x]=(0,o.eJ)(""),[T,A]=(0,o.eJ)(!1),[R,O]=(0,o.eJ)(),[L,D]=(0,o.eJ)({});(0,o.d4)((()=>t?(0,s.Z)(y):void 0),[t,y]),(0,g.Z)(t,b,y,!0),(0,o.d4)((()=>{N?C.current.focus():(x(""),A(!1))}),[N]),(0,o.d4)((()=>{w||(M(),D({}),O(void 0))}),[M,w]),(0,o.d4)((()=>{if(!t||!P)return;const e={};let{parentElement:n}=P.commonAncestorContainer;for(;n&&n.id!==i.R2F;){const t=f[n.tagName];t&&(e[t]=!0),n=n.parentElement}D(e)}),[t,P,I]);const F=(0,h.Z)((()=>{if(!P)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(P))})),B=(0,h.Z)((()=>{const e=window.getSelection();e&&E(e.getRangeAt(0))})),U=(0,h.Z)((e=>{if(P)return v.replaceChildren(P.cloneContents()),e&&v.querySelectorAll(d.fJ).forEach((e=>{e.replaceWith(e.getAttribute("alt"))})),v.innerHTML})),$=(0,h.Z)((()=>{if(P)return P.commonAncestorContainer.parentElement}));function j(){const e=C.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:o}=e;if(n<=t)return void O(void 0);let a="";o<n-t&&(a="mask-right"),o>0&&(a+=" mask-left"),O(a)}function H(e){if(L[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(L).some((t=>t!==e&&Boolean(L[t]))))return"disabled"}else if(L.monospace||L.strikethrough)return"disabled"}const _=(0,h.Z)((()=>{if(L.spoiler){const e=$();if(!P||!e||e.dataset.entityType!==a.Vv.Spoiler||!e.textContent)return;return e.replaceWith(e.textContent),void D((e=>({...e,spoiler:!1})))}const e=U();document.execCommand("insertHTML",!1,`<span class="spoiler" data-entity-type="${a.Vv.Spoiler}">${e}</span>`),y()})),z=(0,h.Z)((()=>{D((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!Boolean(e[t])||document.execCommand(t)})),B(),{...e,bold:!e.bold})))})),Y=(0,h.Z)((()=>{document.execCommand("italic"),B(),D((e=>({...e,italic:!e.italic})))})),V=(0,h.Z)((()=>{document.execCommand("underline"),B(),D((e=>({...e,underline:!e.underline})))})),X=(0,h.Z)((()=>{if(L.strikethrough){const e=$();if(!P||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void D((e=>({...e,strikethrough:!1})))}const e=U();document.execCommand("insertHTML",!1,`<del>${e}</del>`),y()})),q=(0,h.Z)((()=>{if(L.monospace){const e=$();if(!P||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void D((e=>({...e,monospace:!1})))}const e=U(!0);document.execCommand("insertHTML",!1,`<code class="text-entity-code" dir="auto">${e}</code>`),y()})),W=(0,h.Z)((()=>{const e=((0,c.X)(k)||"").split("%").map(encodeURI).join("%");if(T){const t=$();if(!t||"A"!==t.tagName)return;return t.href=e,void y()}const t=U(!0);F(),document.execCommand("insertHTML",!1,`<a href=${e} class="text-entity-link" dir="auto">${t}</a>`),y()})),G=(0,h.Z)((e=>{const t={k:I,b:z,u:V,i:Y,m:q,s:X,p:_}[function(e){const t=e.key||e.code;return t.startsWith("Key")?t.slice(3).toLowerCase():t}(e)];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}));(0,o.d4)((()=>(t&&document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G))),[t,G]);const K=(0,m.Z)();if(!w)return;const J=(0,r.Z)("TextFormatter",S,N&&"link-control-shown"),Q=(0,r.Z)("TextFormatter-link-url-confirm",Boolean(k.length)&&"shown"),ee=n?`left: ${n.x}px; top: ${n.y}px;--text-formatter-left: ${n.x}px;`:"";return o.ZP.createElement("div",{ref:b,className:J,style:ee,onKeyDown:function(e){"Enter"===e.key&&N&&(W(),e.preventDefault())},onMouseDown:l.Z},o.ZP.createElement("div",{className:"TextFormatter-buttons"},o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Spoiler text",className:H("spoiler"),onClick:_},o.ZP.createElement("i",{className:"icon icon-eye-closed"})),o.ZP.createElement("div",{className:"TextFormatter-divider"}),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Bold text",className:H("bold"),onClick:z},o.ZP.createElement("i",{className:"icon icon-bold"})),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Italic text",className:H("italic"),onClick:Y},o.ZP.createElement("i",{className:"icon icon-italic"})),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Underlined text",className:H("underline"),onClick:V},o.ZP.createElement("i",{className:"icon icon-underlined"})),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:H("strikethrough"),onClick:X},o.ZP.createElement("i",{className:"icon icon-strikethrough"})),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:"Monospace text",className:H("monospace"),onClick:q},o.ZP.createElement("i",{className:"icon icon-monospace"})),o.ZP.createElement("div",{className:"TextFormatter-divider"}),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:K("TextFormat.AddLinkTitle"),onClick:I},o.ZP.createElement("i",{className:"icon icon-link"}))),o.ZP.createElement("div",{className:"TextFormatter-link-control"},o.ZP.createElement("div",{className:"TextFormatter-buttons"},o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:K("Cancel"),onClick:M},o.ZP.createElement("i",{className:"icon icon-arrow-left"})),o.ZP.createElement("div",{className:"TextFormatter-divider"}),o.ZP.createElement("div",{className:(0,r.Z)("TextFormatter-link-url-input-wrapper",R)},o.ZP.createElement("input",{ref:C,className:"TextFormatter-link-url-input",type:"text",value:k,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){x(e.target.value),j()},onScroll:j})),o.ZP.createElement("div",{className:Q},o.ZP.createElement("div",{className:"TextFormatter-divider"}),o.ZP.createElement(Z.Z,{color:"translucent",ariaLabel:K("Save"),className:"color-primary",onClick:W},o.ZP.createElement("i",{className:"icon icon-check"}))))))}))},21262:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(71394);async function a(e){const t=[];function n(e,o){return new Promise((a=>{if(e instanceof File)t.push(e),a(e);else if(e.isFile){const n=o.getAsFile();e.file((e=>{t.push(e),a(e)}),(()=>{n&&t.push(n),a(n)}))}else e.isDirectory&&e.createReader().readEntries((e=>{const t=[];for(let a=0;a<e.length;a++)t.push(n(e[a],o));a(Promise.all(t))}))}))}const a=[];for(let t=0;t<e.length;t++){const o=e[t];if("file"===o.kind){const e=o.webkitGetAsEntry()||o.getAsFile();e&&a.push(n(e,o))}}return await Promise.all(a),(0,o.ox)(t)}},52400:(e,t,n)=>{n.d(t,{_:()=>s});const o=/(<br>|<br\s?\/>)/g,a=/(&nbsp;|\u00A0)/g,i=/(<div>|<\/div>)/gi,r=/\n$/i;function s(e){return e.replace(a," ").replace(o,"\n").replace(i,"").replace(r,"")}},96391:(e,t,n)=>{function o(e,t){const{commonAncestorContainer:n}=e;let o=n,a=1;for(;o&&o.id!==t&&a<5;)o=o.parentElement,a++;return Boolean(o&&o.id===t)}n.d(t,{R:()=>o})},60130:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(33555),i=n(83716),r=n(57710),s=n(33681),c=n(65723),l=n(41098),d=n(97184),u=n(44139),m=n(11309),h=n(71790),p=n(86203),g=n(60706),Z=n(25190);const f=new RegExp(`(${s.Z.source})$`,"g"),v=new RegExp(`${i.t8f.source}$`,"g");function P(e,t,n,P,E,y){const{loadCustomEmojiForEmoji:b,clearCustomEmojiForEmoji:C}=(0,a.Sv)(),[w,S,N]=(0,g.Z)(!1),I=(0,m.CH)((()=>{const n=t();if(e&&n&&P()?.collapsed&&n.match(d.op?s.Z:i.t8f))return(0,l.gJ)(E.current).match(d.op?f:v)?.[0]}),[t,P,E,e],300),M=(0,h.Z)(I,[I,t,P],!0),k=(0,p.Z)((()=>Boolean(M())),[M]),x=Boolean(y?.length);(0,o.d4)((()=>{if(!e||!k)return;const t=M();t?x||b({emoji:d.op?t:t.match(/.+alt="(.+)"/)?.[1]}):C()}),[e,k,M,x,C,b]);const T=(0,Z.Z)((t=>{const o=M();if(!e||!o)return;const a=E.current,i=(0,l.gJ)(a),s=d.op?o:o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),m=new RegExp(`(${s})\\1*$`,""),h=i.match(m)[0].length/o.length,p=i.replace(m,(0,u.yR)(t).repeat(h)),g=a.innerHTML.substring(i.length);n(`${p}${g}`),(0,r.Yq)((()=>{(0,c.Z)(a,!0,!0)}))}));return(0,o.d4)(N,[N,t]),{isCustomEmojiTooltipOpen:Boolean(k&&x&&!w),closeCustomEmojiTooltip:S,insertCustomEmoji:T}}},28353:(e,t,n)=>{n.d(t,{Z:()=>M});var o=n(60748),a=n(33555),i=n(83716),r=n(57710),s=n(7054),c=n(34284),l=n(65723),d=n(60782),u=n(70735),m=n(16580),h=n(32340),p=n(44139),g=n(52400),Z=n(11309),f=n(71790),v=n(60706),P=n(25190);let E,y,b,C,w;const S=(0,m.Z)((function(e,t,n){return e&&t.length?Object.values((0,d.q0)(e,t)).slice(0,n):u.D})),N=(0,m.Z)((function(e,t,n){const o=Object.values(e),a=(0,d.ee)(o,"native"),i=t?(0,d.Q8)(t,(e=>Object.values((0,d.q0)(a,e)))):{},r=n?(0,d.Q8)(n,(e=>Object.values((0,d.q0)(a,e)))):{},s={...i,...r},c=[].concat(Object.keys(i),Object.keys(r)),l=o.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{}),u=Object.keys(l),m=c.reduce(((e,t)=>Math.max(e,t.length)),0);return{byKeyword:s,keywords:c,byName:l,names:u,maxKeyLength:m}})),I=(0,m.Z)((function(e,t,n){const{byKeyword:o,keywords:a,byName:i,names:r,maxKeyLength:s}=e;let c=[];if(t.length>s)return u.D;const l=a.filter((e=>e.startsWith(t))).sort();c=c.concat(Object.values((0,d.q0)(o,l)).flat());const m=r.filter((e=>e.startsWith(t)));return c=c.concat(Object.values((0,d.q0)(i,m)).flat()),c=(0,d.Tw)(c),c.length?c.slice(0,n):u.D}));try{C=/(^|\s):(?!\s)[-+_:'\s\p{L}\p{N}]*$/giu,w=/\p{Ll}/u}catch(e){C=/(^|\s):(?!\s)[-+_:'\s\d\wа-яёґєії]*$/gi,w=/[a-zяёґєії]/}function M(e,t,n){let c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.R2F,m=arguments.length>4?arguments[4]:void 0,E=arguments.length>5?arguments[5]:void 0,y=arguments.length>6?arguments[6]:void 0;const[M,x,T]=(0,v.Z)(!1),[A,R]=(0,o.eJ)(),[O,L]=(0,o.eJ)(u.D),[D,F]=(0,o.eJ)(u.D);(0,o.d4)((()=>{function t(){R(b.emojis)}e&&(b?t():k().then(t))}),[e]);const B=(0,Z.CH)((()=>{const n=t();return e&&n.includes(":")?(0,g._)(n).match(C)?.[0].trim():void 0}),[t,e],300),U=(0,f.Z)(B,[B,t],!0),$=(0,P.Z)((e=>{if(L(e),e===u.D)return void F(u.D);const t=e.map((e=>e.native)),n=(0,d.od)((0,s.iXW)((0,a.Rd)(),t),"id");F(n)})),j=(0,P.Z)((function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const a=t();if(!a)return;const s=a.lastIndexOf(":",o?a.lastIndexOf(":")-1:void 0);if(-1!==s){const t="string"==typeof e?(0,h.Z)(e,["emoji_html"]):(0,p.yR)(e);n(`${a.substring(0,s)}${t}`);const o=c===i.R2F?document.querySelector(i.Edp):document.getElementById(c);(0,r.Yq)((()=>{(0,l.Z)(o,!0,!0)}))}$(u.D)}));return(0,o.d4)((()=>{const e=U();if(!e||!A)return void $(u.D);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let o=u.D;if(n){if(1===n.length&&w.test(n)||n.length>=2){const e=N(A,E,y);o=I(e,n.toLowerCase(),36)}}else o=S(A,m,36);o.length?t?j(o[0].native,!0):$(o):$(u.D)}),[E,A,U,y,j,m,$]),(0,o.d4)(T,[T,t]),{isEmojiTooltipOpen:Boolean(O.length||D.length)&&!M,closeEmojiTooltip:x,filteredEmojis:O,filteredCustomEmojis:D,insertEmoji:j}}async function k(){return E||(E=n.e(7501).then(n.t.bind(n,47501,19)),y=(await E).default,b=(0,c.NM)(y)),E}},29295:(e,t,n)=>{n.d(t,{Z:()=>f});var o=n(60748),a=n(33555),i=n(6137),r=n(57710),s=n(4463),c=n(65723),l=n(60782),d=n(41098),u=n(52400),m=n(11309),h=n(71790),p=n(60706),g=n(25190);let Z;try{Z=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){Z=/(^|\s)@[-_\d\wа-яёґєії]*$/gi}function f(e,t,n,f,P,E,y,b){const[C,w]=(0,o.eJ)(),[S,N,I]=(0,p.Z)(!1),M=(0,m.CH)((()=>{const n=t();if(!e||!f()?.collapsed||!n.includes("@"))return;const o=(0,d.gJ)(P.current);return(0,u._)(o).match(Z)?.[0].trim()}),[e,t,f,P],300),k=(0,h.Z)(M,[M,t,f],!0),x=(0,h.Z)((()=>e&&t().startsWith("@")),[t,e]);(0,o.d4)((()=>{const e=k();if(!e||!E&&!y)return void w(void 0);const t=(0,a.Rd)().users.byId;if(!t)return void w(void 0);const n=E?.reduce(((e,t)=>(t.userId!==b&&e.push(t.userId),e)),[]),o=e.substring(1),i=(0,s.kK)((0,l.Tw)([...x()&&y||[],...n||[]]),t,o);w(Object.values((0,l.q0)(t,i)))}),[b,E,y,k,x]);const T=(0,g.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.usernames&&!(0,s.Vl)(e))return;const o=(0,s.WS)(e),a=(0,s.Vl)(e)||"",l=o?`@${o}`:`<a\n class="text-entity-link"\n data-entity-type="${i.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${a}</a>`,u=P.current,m=(0,d.gJ)(u),h=v(m),p=h.lastIndexOf("@"),g=(o?o.length+1:a.length)-(h.length-p);if(-1!==p){const e=`${h.substr(0,p)}${l}&nbsp;`,o=v(u.innerHTML).substring(h.length),a=(0,d.qK)(u);n(`${e}${o}`),(0,r.Yq)((()=>{const e=a+g+1;(0,c.Z)(u,t),e>=0&&(0,d.Mq)(u,e)}))}w(void 0)}));return(0,o.d4)(I,[I,t]),{isMentionTooltipOpen:Boolean(C?.length&&!S),closeMentionTooltip:N,insertMention:T,mentionFilteredUsers:C}}function v(e){return e.replace(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},93609:(e,t,n)=>{n.d(t,{Z:()=>Z});var o=n(60748),a=n(33555),i=n(4463),r=n(46752),s=n(790),c=n(97184),l=n(42797),d=n(15866),u=n(18360),m=n(59107),h=n(25190),p=n(6202),g=n(31212);const Z=(0,o.X$)((function(e){let{story:t,isPreview:n,isProtected:Z,isConnected:f}=e;const{openStoryViewer:v,loadUserStoriesByIds:P,showNotification:E}=(0,a.Sv)(),y=(0,m.Z)(),{isMobile:b}=(0,l.ZP)(),C=t&&"isDeleted"in t,w=t&&"content"in t,S=w?t.content.video:void 0,N=w?(0,i.Cc)(t):void 0,I=(0,p.Z)(N),M=w?S?S.thumbnail?.dataUri:t.content.photo?.thumbnail?.dataUri:void 0,k=(0,u.Z)(I,!0),{shouldRender:x,transitionClassNames:T}=(0,g.Z)(Boolean(k)),A=(0,d.Z)(M,C&&!n,b&&!c.vX),R=(0,r.Z)("u1iXUR7f9a1fJ3oKj6UR","media-inner",(!f||C)&&"sM8Yb5GJn63Lqe7WGyxs",C&&"GU6ftk8mOSKG68G3clJz",n&&"PdT0BgaOGO3KQ6uAMywg");(0,o.d4)((()=>{!t||w||C||P({userId:t.userId,storyIds:[t.id]})}),[t,C,w]);const O=(0,h.Z)((()=>{C?E({message:y("StoryNotFound")}):v({userId:t.userId,storyId:t.id,isSingleUser:!0,isSingleStory:!0})}));return o.ZP.createElement("div",{className:R,onClick:f?O:void 0},!C&&n&&o.ZP.createElement("canvas",{ref:A,className:"thumbnail blurred-bg"}),x&&o.ZP.createElement("img",{src:k,alt:"",className:(0,r.Z)("bCVEWkiPlJ2vOFKdsOZn",n&&"VjvrVyctay2XnrWkF6Pm",T),draggable:!1}),C&&o.ZP.createElement("span",null,o.ZP.createElement("i",{className:(0,r.Z)("C6JcJFH05QLPlgncYbFX","icon icon-story-expired"),"aria-hidden":!0}),y("StoryExpiredSubtitle")),Boolean(S?.duration)&&o.ZP.createElement("div",{className:"message-media-duration"},(0,s.k9)(S.duration)),Z&&o.ZP.createElement("span",{className:"protector"}))}))},97182:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(99203),i=n(48778);const r=e=>{const{isOpen:t}=e,n=(0,i.Z)(a.gl.Extra,"ContextMenuContainer",!t);return n?o.ZP.createElement(n,e):void 0}},95822:(e,t,n)=>{n.d(t,{Z:()=>b});var o=n(60748),a=n(83716),i=n(57710),r=n(4463),s=n(46752),c=n(26593),l=n(83967),d=n(42797),u=n(60706),m=n(3657),h=n(25190),p=n(72645),g=n(70692),Z=n(6701),f=n(87204),v=n(31212),P=n(41280),E=n(62230),y=n(39196);const b=e=>{let{id:t,message:n,observeIntersection:b,noAvatars:C,canAutoLoad:w,isInSelectMode:S,isSelected:N,uploadProgress:I,forcedWidth:M,size:k="inline",dimensions:x,asForwarded:T,nonInteractive:A,shouldAffectAppendix:R,isDownloading:O,isProtected:L,theme:D,onClick:F,onCancelUpload:B}=e;const U=(0,o.sO)(null),$=(0,r.O$)(n)||(0,r.F$)(n),j=$.blobUrl,H=(0,m.Op)(U,b),{isMobile:_}=(0,d.ZP)(),[z,Y]=(0,o.eJ)(w),V=z&&H,{mediaData:X,loadProgress:q}=(0,Z.Z)((0,r.Ti)(n,k),!V),W=j||X,G=Boolean(M),[K]=(0,o.eJ)(!W),J=Boolean(W),Q=(0,P.Z)(n,J),ee=(0,P.Z)(n,!G),te=(0,g.Z)(!J),ne=(0,r.DH)(n),[oe,,ae]=(0,u.Z)($.isSpoiler),{loadProgress:ie}=(0,Z.Z)((0,r.Ti)(n,"download"),!O,(0,r.kG)(n,"download")),{isUploading:re,isTransferring:se,transferProgress:ce}=(0,r.Sc)(n,I||(O?ie:q),V&&!W),le=!1===(0,f.Z)(z),{shouldRender:de,transitionClassNames:ue}=(0,v.Z)(se,void 0,le,"slow"),{shouldRender:me,transitionClassNames:he}=(0,v.Z)(!W&&!z),pe=(0,h.Z)((()=>{re?B?.(n):W?oe?ae():F?.(n.id):Y((e=>!e))})),ge=(0,r.B4)(n);(0,p.Z)((e=>{let[t]=e;if(!R)return void(t&&U.current.closest(a.be_).removeAttribute(a.s22));const n=U.current.closest(a.be_);W?(0,c.Z)(W,ge,N,D).then((e=>{(0,i.WM)((()=>{n.style.setProperty("--appendix-bg",e),n.setAttribute(a.s22,"")}))})):n.classList.add("has-appendix-thumb")}),[R,W,ge,S,N,D]);const{width:Ze,height:fe,isSmall:ve}=x||(0,l.GH)(n,T,C,_),Pe=(0,s.Z)("media-inner",!re&&!A&&"interactive",ve&&"small-image",Ze===fe&&"square-image",fe<l.Xo&&"fix-min-height"),Ee=x?` width: ${Ze}px; left: ${x.x}px; top: ${x.y}px;`:"",ye="inline"===k?`height: ${fe}px;${Ee}`:void 0;return o.ZP.createElement("div",{id:t,ref:U,className:Pe,style:ye,onClick:re?void 0:pe},G&&o.ZP.createElement("canvas",{ref:ee,className:"thumbnail blurred-bg"}),o.ZP.createElement("img",{src:W,className:(0,s.Z)("full-media",G&&"with-blurred-bg"),alt:"",style:M?`width: ${M}px`:void 0,draggable:!L}),K&&o.ZP.createElement("canvas",{ref:Q,className:(0,s.Z)("thumbnail",te)}),L&&o.ZP.createElement("span",{className:"protector"}),de&&!me&&o.ZP.createElement("div",{className:`media-loading ${ue}`},o.ZP.createElement(y.Z,{progress:ce,onClick:re?pe:void 0})),me&&o.ZP.createElement("i",{className:(0,s.Z)("icon","icon-download",he)}),o.ZP.createElement(E.Z,{isVisible:oe,withAnimation:!0,thumbDataUri:ne,width:Ze,height:fe,className:"media-spoiler"}),se&&o.ZP.createElement("span",{className:"message-transfer-progress"},Math.round(100*ce),"%"))}},472:(e,t,n)=>{n.d(t,{Z:()=>f});var o=n(60748),a=n(4463),i=n(46752),r=n(59107),s=n(25190),c=n(231),l=n(74399),d=n(60706),u=n(6202),m=n(97799);const h=2*l.Gw,p=(0,i.y)("ReactionSelectorReaction"),g=(0,o.X$)((e=>{let{reaction:t,isReady:n,noAppearAnimation:a,chosen:i,onToggleReaction:r}=e;const s=(0,u.Z)(`sticker${t.appearAnimation?.id}`,!n||a),c=(0,u.Z)(`document${t.selectAnimation?.id}`,!n||a),l=(0,u.Z)(`document${t.staticIcon?.id}`,!a),[g,Z]=(0,d.Z)(),[f,,v]=(0,d.Z)(!0),[P,E,y]=(0,d.Z)();return o.ZP.createElement("div",{className:p("&",i&&"chosen"),onClick:function(){r(t.reaction)},onMouseEnter:n&&!f?E:void 0},a&&o.ZP.createElement("img",{className:p("static-icon"),src:l,alt:"",draggable:!1}),!g&&!a&&o.ZP.createElement(m.Z,{key:t.appearAnimation?.id,tgsUrl:s,play:f,noLoop:!0,size:h,onEnded:v,forceAlways:!0}),!f&&!a&&o.ZP.createElement(m.Z,{key:t.selectAnimation?.id,tgsUrl:c,play:P,noLoop:!0,size:h,onLoad:Z,onEnded:y,forceAlways:!0}))})),Z=(0,i.y)("ReactionSelector"),f=(0,o.X$)((e=>{let{allAvailableReactions:t,topReactions:n,enabledReactions:l,currentReactions:d,maxUniqueReactions:u,isPrivate:m,isReady:h,canPlayAnimatedEmojis:p,onToggleReaction:f,onShowMore:v,className:P}=e;const E=(0,o.sO)(null),y=(0,r.Z)(),b=(0,o.Ye)((()=>{const e=t?.map((e=>{if(!e.isInactive&&(m||l&&(0,a.XU)(e.reaction,l))&&(!(u&&d&&d.length>=u)||d.some((t=>{let{reaction:n}=t;return(0,a.Hl)(n,e.reaction)}))))return e})).filter(Boolean)||[];return(0,a.PO)(e,n)}),[t,d,l,m,u,n]),C=(0,o.Ye)((()=>7===b.length?b:b.slice(0,6)),[b]),w=C.length<b.length,S=(0,o.Ye)((()=>{const e=d?.filter((e=>{let{chosenOrder:t}=e;return void 0!==t}))||[];return new Set(e.map((e=>{let{reaction:t}=e;return C.findIndex((e=>e&&(0,a.Hl)(e.reaction,t)))})))}),[d,C]),N=(0,s.Z)((()=>{const e=E.current?.getBoundingClientRect()||{x:0,y:0};v({x:e.x,y:e.y})}));if(C.length)return o.ZP.createElement("div",{className:(0,i.Z)(Z("&",y.isRtl&&"isRtl"),P),ref:E},o.ZP.createElement("div",{className:Z("bubble-small",y.isRtl&&"isRtl")}),o.ZP.createElement("div",{className:Z("items-wrapper")},o.ZP.createElement("div",{className:Z("bubble-big",y.isRtl&&"isRtl")}),o.ZP.createElement("div",{className:Z("items"),dir:y.isRtl?"rtl":void 0},C.map(((e,t)=>o.ZP.createElement(g,{key:(0,a.$d)(e.reaction),isReady:h,onToggleReaction:f,reaction:e,noAppearAnimation:!p,chosen:S.has(t)}))),w&&o.ZP.createElement(c.Z,{color:"translucent",className:Z("show-more"),onClick:N},o.ZP.createElement("i",{className:"icon icon-down"})))))}))},35269:(e,t,n)=>{n.d(t,{Z:()=>S});var o=n(60748),a=n(33555),i=n(4463),r=n(46752),s=n(790),c=n(40647),l=n(74399),d=n(83967),u=n(13617),m=n(42797),h=n(60706),p=n(3657),g=n(25190),Z=n(6202),f=n(70692),v=n(6701),P=n(87204),E=n(31212),y=n(41280),b=n(62230),C=n(57080),w=n(39196);const S=e=>{let{id:t,message:n,observeIntersectionForLoading:S,observeIntersectionForPlaying:N,noAvatars:I,canAutoLoad:M,canAutoPlay:k,uploadProgress:x,forcedWidth:T,dimensions:A,asForwarded:R,isDownloading:O,isProtected:L,onClick:D,onCancelUpload:F}=e;const B=(0,o.sO)(null),U=(0,o.sO)(null),$=(0,i.b7)(n)||(0,i.Cg)(n),j=$.blobUrl,[H,,_]=(0,h.Z)($.isSpoiler),z=(0,p.Op)(B,S),Y=(0,p.Op)(B,N)&&z,V=(0,o.sO)(z);Y&&!V.current&&(V.current=!0);const{isMobile:X}=(0,m.ZP)(),[q,W]=(0,o.eJ)(M),G=Boolean(q&&z),[K,J]=(0,o.eJ)(Boolean(k&&!H)),Q=(0,i.Ti)(n,"inline"),[ee]=(0,o.eJ)(Boolean(Q&&c.UV(Q))),{mediaData:te,loadProgress:ne}=(0,v.Z)(Q,!G,(0,i.kG)(n,"inline")),oe=j||te,[ae,ie]=(0,h.Z)(),re=(0,i.DH)(n),se=Boolean(re),ce=Boolean(T),le=(0,i.Ti)(n,"preview"),[de]=(0,o.eJ)(Boolean(le&&c.UV(le))),ue=z,me=(0,Z.Z)(le,!ue),he=(0,f.Z)((se||me)&&!ae),pe=!se||me||ae,ge=(0,y.Z)(n,pe),Ze=(0,y.Z)(n,!ce),fe=(0,f.Z)(!pe),ve=oe&&V.current,Pe=(0,u.Z)(U,!0,!ve),{loadProgress:Ee}=(0,v.Z)((0,i.Ti)(n,"download"),!O,(0,i.kG)(n,"download")),{isUploading:ye,isTransferring:be,transferProgress:Ce}=(0,i.Sc)(n,x||(O?Ee:ne),G&&!ae&&!ee||O),we=!1===(0,P.Z)(q),{shouldRender:Se,transitionClassNames:Ne}=(0,E.Z)(be&&!Pe,void 0,we),{transitionClassNames:Ie}=(0,E.Z)(Boolean((q||oe)&&!K&&!Se)),[Me,ke]=(0,o.eJ)(0),xe=(0,g.Z)((e=>{ke(Math.max(0,e.currentTarget.currentTime-1))})),Te=(Number.isFinite(U.current?.duration)?U.current?.duration:$.duration)||0,Ae=(0,i.B4)(n),Re=Boolean((0,i.Cg)(n)),{width:Oe,height:Le}=A||(0,l.GC)($,Ae,R,Re,I,X),De=(0,g.Z)((()=>{ye?F?.(n):O?(0,a.Sv)().cancelMessageMediaDownload({message:n}):oe?(oe&&!K&&J(!0),H?_():D?.(n.id)):W((e=>!e))})),Fe=(0,r.Z)("media-inner dark",!ye&&"interactive",Le<d.Xo&&"fix-min-height"),Be=`height: ${Le}px;${A?` width: ${Oe}px; left: ${A.x}px; top: ${A.y}px;`:""}`;return o.ZP.createElement("div",{ref:B,id:t,className:Fe,style:Be,onClick:ye?void 0:De},ce&&o.ZP.createElement("canvas",{ref:Ze,className:"thumbnail blurred-bg"}),ve&&o.ZP.createElement(C.Z,{ref:U,src:oe,className:(0,r.Z)("full-media",ce&&"with-blurred-bg"),canPlay:K&&Y&&!Pe,muted:!0,loop:!0,playsInline:!0,draggable:!L,onTimeUpdate:xe,onReady:ie,style:T?`width: ${T}px`:void 0}),o.ZP.createElement("img",{src:me,className:(0,r.Z)("thumbnail",he,ce&&"with-blurred-bg"),alt:"",style:T?`width: ${T}px;`:void 0,draggable:!L}),se&&!de&&o.ZP.createElement("canvas",{ref:ge,className:(0,r.Z)("thumbnail",fe)}),L&&o.ZP.createElement("span",{className:"protector"}),o.ZP.createElement("i",{className:(0,r.Z)("icon","icon-large-play",Ie)}),o.ZP.createElement(b.Z,{isVisible:H,withAnimation:!0,thumbDataUri:re,width:Oe,height:Le,className:"media-spoiler"}),Se&&o.ZP.createElement("div",{className:(0,r.Z)("media-loading",Ne)},o.ZP.createElement(w.Z,{progress:Ce,onClick:De})),!q&&!oe&&o.ZP.createElement("i",{className:"icon icon-download"}),!be||Pe&&!O?o.ZP.createElement("div",{className:"message-media-duration"},$.isGif?"GIF":(0,s.k9)(Math.max(Te-Me,0)),Pe&&o.ZP.createElement("i",{className:"icon icon-message-failed playback-failed"})):o.ZP.createElement("span",{className:"message-transfer-progress"},ye||O?`${Math.round(100*Ce)}%`:"..."))}},54659:(e,t,n)=>{n.d(t,{Z:()=>P});var o=n(60748),a=n(33555),i=n(4463),r=n(46752),s=n(48035),c=n(32340),l=n(83967),d=n(42797),u=n(31526),m=n(59107),h=n(25190),p=n(10088),g=n(231),Z=n(93609),f=n(95822),v=n(35269);const P=(0,o.X$)((e=>{let{message:t,observeIntersection:n,noAvatars:P,canAutoLoad:E,canAutoPlay:y,inPreview:b,asForwarded:C,isDownloading:w=!1,isProtected:S,isConnected:N,story:I,theme:M,onMediaClick:k,onCancelMediaTransfer:x}=e;const{openTelegramLink:T}=(0,a.Sv)(),A=(0,i.s1)(t),{isMobile:R}=(0,d.ZP)(),O=(0,m.Z)(),L=(0,h.Z)((()=>{k()})),D=(0,h.Z)((()=>{A&&T({url:A.url})})),{story:F}=A||{};if((0,u.Z)(F?.userId,F?.id,I),!A)return;const{siteName:B,url:U,displayUrl:$,title:j,description:H,photo:_,video:z,type:Y}=A,V="telegram_story"===Y,X=b||I&&"isDeleted"in I?void 0:function(e){switch(e){case"telegram_channel_request":case"telegram_megagroup_request":case"telegram_chat_request":return"lng_view_button_request_join";case"telegram_message":return"lng_view_button_message";case"telegram_bot":return"lng_view_button_bot";case"telegram_voicechat":return"lng_view_button_voice_chat";case"telegram_livestream":return"lng_view_button_voice_chat_channel";case"telegram_megagroup":case"telegram_chat":return"lng_view_button_group";case"telegram_channel":return"lng_view_button_channel";case"telegram_user":return"lng_view_button_user";case"telegram_botapp":return"lng_view_button_bot_app";case"telegram_chatlist":return"ViewChatList";case"telegram_story":return"ViewStory";default:return}}(Y),q=(0,s.Z)(H,170),W=Boolean(q||j||B);let G=!1;if(W&&A?.photo&&!A.video){const{width:e,height:n}=(0,l.GH)(t,void 0,void 0,R);G=e===n}const K=(_||z)&&k&&!G,J=(0,r.Z)("WebPage",b&&"in-preview",G&&"with-square-photo",!_&&!z&&!b&&"without-media",z&&"with-video",!W&&"no-article",X&&"with-quick-button");return o.ZP.createElement("div",{className:J,"data-initial":(B||$)[0],dir:"auto"},o.ZP.createElement("div",{className:(0,r.Z)("WebPage--content",V&&"is-story")},V&&o.ZP.createElement(Z.Z,{story:I,isProtected:S,isConnected:N,isPreview:!0}),_&&!z&&o.ZP.createElement(f.Z,{message:t,observeIntersection:n,noAvatars:P,canAutoLoad:E,size:G?"pictogram":"inline",asForwarded:C,nonInteractive:!K,isDownloading:w,isProtected:S,theme:M,onClick:K?L:void 0,onCancelUpload:x}),W&&o.ZP.createElement("div",{className:"WebPage-text"},o.ZP.createElement(p.Z,{className:"site-name",url:U,text:B||$}),!b&&j&&o.ZP.createElement("p",{className:"site-title"},(0,c.Z)(j)),q&&o.ZP.createElement("p",{className:"site-description"},(0,c.Z)(q,["emoji","br"]))),!b&&z&&o.ZP.createElement(v.Z,{message:t,observeIntersectionForLoading:n,noAvatars:P,canAutoLoad:E,canAutoPlay:y,asForwarded:C,isDownloading:w,isProtected:S,onClick:K?L:void 0,onCancelUpload:x})),X&&(Q=X,o.ZP.createElement(g.Z,{className:"WebPage--quick-button",size:"tiny",color:"translucent-bordered",onClick:D},O(Q))));var Q}))},26593:(e,t,n)=>{n.d(t,{Z:()=>a});const o={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function a(e,t,n,a){return n?Promise.resolve(o[a||"light"][t?"outgoing":"incoming"]):async function(e,t){const n=new Image;n.src=e,n.crossOrigin="anonymous",n.width||await new Promise((e=>{n.onload=e}));const o=document.createElement("canvas"),a=o.getContext("2d");o.width=n.width,o.height=n.height,a.drawImage(n,0,0,n.width,n.height);const i=t?n.width-1:0,r=n.height-1;return`rgba(${Array.from(a.getImageData(i,r,1,1).data).join(",")})`}(e,t)}},83967:(e,t,n)=>{n.d(t,{GH:()=>l,Pw:()=>c,Vx:()=>i,Xo:()=>s});var o=n(4463),a=n(74399);const i=20*a.Gw,r=12*a.Gw,s=5*a.Gw;function c(e,t){var n;return(null!==(n=e?.length)&&void 0!==n?n:0)>40||t?i:r}function l(e,t,n,i){const r=(0,o.B4)(e),l=(0,o.O$)(e)||(0,o.F$)(e),d=(0,o.b7)(e),u=Boolean((0,o.F$)(e)),m=Boolean((0,o.Cg)(e)),{width:h,height:p}=l?(0,a.Eh)(l,r,t,u,n,i):(0,a.GC)(d,r,t,m,n,i),g=c((0,o.UD)(e));let Z=1;h<g&&g-h<12&&(Z=g/h),p*Z<s&&s-p*Z<12&&(Z=s/p);const f=Math.round(h*Z),v=Math.round(p*Z);return{width:f,height:v,isSmall:f<g||v<s}}},41280:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(4463),a=n(97184),i=n(42797),r=n(15866);function s(e,t,n){const{isMobile:s}=(0,i.ZP)(),c=n||(0,o.DH)(e);return(0,r.Z)(c,Boolean(t),s&&!a.vX)}},45277:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(57710),i=n(81740);function r(e,t,n,r,s,c,l){const d=(0,o.sO)(!l);(0,o.bt)((()=>{const t=d.current;if(d.current=!1,n&&e.current){const n=e.current.closest(".MessageList"),o=s,l=()=>(0,i.ZP)(n,e.current,o?"end":"centerOrTop",20,void 0!==r?o?500:750:void 0,r,void 0,c,!0);t?(0,a.lT)(l):(0,a.i$)((()=>{(0,a.WM)(l())}))}}),[e,t,n,r,s,c])}},75368:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(33555),i=n(69118);const r=new Map;function s(e,t,n,i){const s=i&&n?e?.byLangCode[i]?.[n]:void 0,{isPending:l,text:d}=s||{};return(0,o.d4)((()=>{t&&n&&!d&&void 0===l&&i&&function(e,t,n){const o=r.get(n)||new Map,i=o.get(e)||[];i.includes(t)||(i.push(t),o.set(e,i),r.set(n,o),(0,a.Sv)().markMessagesTranslationPending({chatId:e,messageIds:i,toLanguageCode:n})),c()}(t,n,i)}),[t,d,l,n,i]),t&&n?{isPending:l,translatedText:d}:{isPending:!1,translatedText:void 0}}const c=(0,i.P2)((function(){const{translateMessages:e}=(0,a.Sv)();let t=!1;r.forEach(((n,o)=>{n.forEach(((n,a)=>{const i=n.slice(0,20);i.length<n.length&&(t=!0),e({chatId:a,messageIds:i,toLanguageCode:o}),function(e,t,n){const o=r.get(n);if(!o?.size)return void r.delete(n);const a=o.get(e);if(!a?.length)return void o.delete(e);const i=a.filter((e=>!t.includes(e)));if(!i?.length)return o.delete(e),void(o.size||r.delete(n));o.set(e,i)}(a,i,o)}))})),t&&c()}),500)},17891:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(65326),i=n(34446);function r(e,t){const n=void 0===t,r=(0,o.sO)(n),s=(0,o.sO)(),c=(0,a.Z)();return(0,i.Z)((()=>{n||(r.current=!1,s.current&&(clearTimeout(s.current),s.current=void 0))}),e),(0,o.d4)((()=>{if(n||r.current)return;const e=()=>{r.current=!0,c()};t>0?s.current=window.setTimeout(e,t):e()}),e),r.current}},47505:(e,t,n)=>{n.d(t,{Z:()=>y});var o=n(60748),a=n(33555),i=n(46752),r=n(42797),s=n(78781),c=n(59107),l=n(91713),d=n(4463),u=n(30386),m=n(17240),h=n(25190),p=n(12644),g=n(19156),Z=n(70172),f=n(52328),v=n(58964),P=n(41372);const E=(0,o.X$)((function(e){let{user:t,isArchived:n}=e;const{openChat:r,openChatWithInfo:s,openStoryViewer:E,toggleStoriesHidden:y}=(0,a.Sv)(),b=(0,c.Z)(),C=(0,o.sO)(null);(0,g.Z)(t.id);const{isContextMenuOpen:w,contextMenuPosition:S,handleBeforeContextMenu:N,handleContextMenu:I,handleContextMenuClose:M,handleContextMenuHide:k}=(0,m.Z)(C),x=(0,h.Z)((()=>C.current)),T=(0,h.Z)((()=>document.body)),A=(0,h.Z)((()=>C.current.querySelector(".story-user-context-menu .bubble"))),R=(0,h.Z)((()=>({withPortal:!0,isDense:!0}))),{positionX:O,positionY:L,transformOriginX:D,transformOriginY:F,style:B}=(0,p.Z)(S,x,T,A,R),U=(0,h.Z)((()=>{w||E({userId:t.id,origin:l.ze.StoryRibbon})})),$=(0,h.Z)((e=>{(0,u.b)(e),N(e)})),j=(0,h.Z)((()=>{s({id:t.id,shouldReplaceHistory:!0,profileTab:"stories"})})),H=(0,h.Z)((()=>{s({id:t.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})})),_=(0,h.Z)((()=>{r({id:t.id,shouldReplaceHistory:!0})})),z=(0,h.Z)((()=>{s({id:t.id,shouldReplaceHistory:!0})})),Y=(0,h.Z)((()=>{y({userId:t.id,isHidden:!n})}));return o.ZP.createElement("div",{ref:C,role:"button","data-peer-id":t.id,tabIndex:0,className:P.Z.user,onMouseDown:$,onClick:U,onContextMenu:I},o.ZP.createElement(Z.Z,{peer:t,withStory:!0,storyViewerOrigin:l.ze.StoryRibbon,storyViewerMode:"full"}),o.ZP.createElement("div",{className:(0,i.Z)(P.Z.name,t.hasUnreadStories&&P.Z.name_hasUnreadStory)},t.isSelf?b("MyStory"):(0,d.Vl)(t)),void 0!==S&&o.ZP.createElement(f.Z,{isOpen:w,transformOriginX:D,transformOriginY:F,positionX:O,positionY:L,style:B,className:(0,i.Z)("story-user-context-menu",P.Z.contextMenu),autoClose:!0,withPortal:!0,onClose:M,onCloseAnimationEnd:k},t.isSelf?o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(v.Z,{onClick:j,icon:"play-story"},b("StoryList.Context.SavedStories")),o.ZP.createElement(v.Z,{onClick:H,icon:"archive"},b("StoryList.Context.ArchivedStories"))):o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(v.Z,{onClick:_,icon:"message"},b("SendMessageTitle")),o.ZP.createElement(v.Z,{onClick:z,icon:"user"},b("StoryList.Context.ViewProfile")),o.ZP.createElement(v.Z,{onClick:Y,icon:n?"unarchive":"archive"},b(n?"StoryList.Context.Unarchive":"StoryList.Context.Archive")))))})),y=(0,o.X$)((0,a.c$)(((e,t)=>{let{isArchived:n}=t;const{orderedUserIds:{active:o,archived:a}}=e.stories;return{orderedUserIds:n?a:o,usersById:e.users.byId}}))((function(e){let{isArchived:t,className:n,orderedUserIds:a,usersById:l,isClosing:d}=e;const u=(0,c.Z)(),m=(0,i.Z)(P.Z.root,!a.length&&P.Z.hidden,d&&P.Z.closing,n,"no-scrollbar"),h=(0,o.sO)(null);return(0,s.Z)(h,(0,r.W7)()),o.ZP.createElement("div",{ref:h,id:"StoryRibbon",className:m,dir:u.isRtl?"rtl":void 0},a.map((e=>{const n=l[e];if(n)return o.ZP.createElement(E,{key:e,user:n,isArchived:t})})))})))},85194:(e,t,n)=>{n.d(t,{Z:()=>g});var o=n(60748),a=n(33555),i=n(83716),r=n(7054),s=n(46752),c=n(32136),l=n(18674),d=n(59107),u=n(31212),m=n(19156),h=n(70172),p=n(4710);const g=(0,o.X$)((0,a.c$)(((e,t)=>{let{isArchived:n}=t;const{orderedUserIds:{archived:o,active:a}}=e.stories,{storyViewer:{isRibbonShown:i,isArchivedRibbonShown:s}}=(0,r.jUK)(e),c=(0,r.$Yd)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedUserIds:n?o:a,isShown:n?!s:!i,withAnimation:c,usersById:e.users.byId}}))((function(e){let{currentUserId:t,orderedUserIds:n,usersById:r,canShow:g,isShown:Z,isArchived:f,withAnimation:v}=e;const{toggleStoryRibbon:P}=(0,a.Sv)(),E=(0,d.Z)(),y=(0,o.Ye)((()=>1===n.length?[r[n[0]]]:n.map((e=>r[e])).filter((e=>e&&e.id!==t)).slice(0,i.Ob7).reverse()),[t,n,r]),b=(0,o.Ye)((()=>n.slice(0,5)),[n]);(0,m.Z)(b);const C=g&&Z,{shouldRender:w,transitionClassNames:S}=(0,u.Z)(C,void 0,void 0,"slow");if((0,o.d4)((()=>{v&&(C?((0,l.YW)(c.zn+i.fK3),(0,c.V$)(f)):((0,l.YW)(c.zn+i.fK3),(0,c.DO)(f)))}),[f,C,v]),w)return o.ZP.createElement("button",{type:"button",id:"StoryToggler",className:(0,s.Z)(p.Z.root,S),"aria-label":E("Chat.Context.Peer.OpenStory"),onClick:()=>P({isShown:!0,isArchived:f}),dir:E.isRtl?"rtl":void 0},y.map((e=>o.ZP.createElement(h.Z,{key:e.id,peer:e,size:"tiny",className:p.Z.avatar,withStorySolid:!0}))))})))},32136:(e,t,n)=>{n.d(t,{DO:()=>Z,V$:()=>f,zn:()=>d});var o=n(83716),a=n(57710),i=n(9933),r=n(3858),s=n(74399),c=n(41372),l=n(4710);const d=250,u=.25*s.Gw,m=11,h=.1875*s.Gw,p=.1*s.Gw,g=new Set;function Z(e){C();const{container:t,toggler:n,leftMainHeader:r,ribbonUsers:s,toggleAvatars:c}=v(e);if(!(n&&c&&s&&t&&r))return;const{bottom:Z,right:f}=r.getBoundingClientRect(),w=Z+u,S=c[0],N=c[c.length-1],I=E(S);Array.from(s).reverse().forEach(((e,r,s)=>{let{length:c}=s;const u=E(e);if(!u)return;const Z=u===I;let v=y(n,u),C=m+r+1;if(v||(v=r===c-1?N:S,C=m),!v)return;let{top:M,left:k,width:x}=v.getBoundingClientRect();const{left:T,width:A}=e.getBoundingClientRect();if(T>f)return;k-=h,x+=2*h;const R=k-T,O=M-w,L=x/A;M-=h;const D=T-k,F=w-M-p,B=A/x;(0,a.WM)((()=>{if(!v)return;const n=P(e);let r;C>m?(r=P(v),Z&&r.classList.add(l.Z.ghostLast)):n.classList.add(l.Z.ghostAnimateName),(0,i.Zs)(n,{top:`${w}px`,left:`${T}px`,zIndex:`${C}`,opacity:r?"0":"",transform:`translate3d(${R}px, ${O}px, 0) scale(${L})`}),r&&(0,i.Zs)(r,{top:`${M}px`,left:`${k}px`,zIndex:`${C}`}),t.appendChild(n),r&&t.appendChild(r),v.classList.add("animating"),e.classList.add("animating"),(0,a.WM)((()=>{(0,i.Zs)(n,{opacity:"",transform:""}),r?(0,i.Zs)(r,{opacity:"0",transform:`translate3d(${D}px, ${F}px, 0) scale(${B})`}):n.classList.add(l.Z.ghostRevealName);const s=b((()=>{(0,a.WM)((()=>{t.contains(n)&&t.removeChild(n),r&&t.contains(r)&&t.removeChild(r),v?.classList.remove("animating"),e.classList.remove("animating")}))}),d+o.fK3);g.add(s)}))}))}))}function f(e){C();const{container:t,toggler:n,toggleAvatars:r,ribbonUsers:s,leftMainHeader:c}=v(e);if(!(n&&r&&s&&t&&c))return;const{right:u}=c.getBoundingClientRect(),Z=r[0],f=r[r.length-1],w=E(Z);Array.from(s).reverse().forEach(((e,r,s)=>{let{length:c}=s;const v=E(e);if(!v)return;const C=v===w;let S=y(n,v),N=m+r+1;if(S||(S=r===c-1?f:Z,N=m),!S)return;const{top:I,left:M,width:k}=e.getBoundingClientRect();let{left:x,width:T,top:A}=S.getBoundingClientRect();if(M>u)return;x-=h,T+=2*h;const R=x-M,O=A-I-p,L=T/k;A-=h;const D=M-x,F=I-A,B=k/T;(0,a.WM)((()=>{const n=P(e);let r;N>m?(r=P(S),C&&r.classList.add(l.Z.ghostLast)):n.classList.add(l.Z.ghostAnimateName,l.Z.ghostRevealName),(0,i.Zs)(n,{top:`${I}px`,left:`${M}px`,width:`${k}px`,zIndex:`${N}`}),r&&(0,i.Zs)(r,{top:`${A}px`,left:`${x}px`,zIndex:`${N}`,opacity:"0",transform:`translate3d(${D}px, ${F}px, 0) scale(${B})`}),e.classList.add("animating"),S.classList.add("animating"),t.appendChild(n),r&&t.appendChild(r),(0,a.WM)((()=>{(0,i.Zs)(n,{opacity:r?"0":"",transform:`translate3d(${R}px, ${O}px, 0) scale(${L})`}),r?(0,i.Zs)(r,{opacity:"",transform:""}):n.classList.remove(l.Z.ghostRevealName);const s=b((()=>{(0,a.WM)((()=>{t.contains(n)&&t.removeChild(n),r&&t.contains(r)&&t.removeChild(r),e.classList.remove("animating"),S.classList.remove("animating")}))}),d+o.fK3);g.add(s)}))}))}))}function v(e){let t=document.getElementById("LeftColumn");if(t&&e&&(t=t.querySelector(".ArchivedChats")),!t)return{};const n=t.querySelector("#StoryToggler"),o=t.querySelector("#StoryRibbon"),a=t.querySelector(".left-header"),i=o?.querySelectorAll(`.${c.Z.user}`),r=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:a,ribbonUsers:i,toggleAvatars:r}}function P(e){const t=e.cloneNode(!0);t.classList.add(l.Z.ghost),t.classList.remove("animating"),t.draggable=!1,t.oncontextmenu=r.Z;const n=e.querySelector("canvas");return n&&t.querySelector("canvas")?.getContext("2d")?.drawImage(n,0,0),t}function E(e){return e.getAttribute("data-peer-id")}function y(e,t){return e.querySelector(`[data-peer-id="${t}"]`)}function b(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n),e()}}function C(){g.forEach((e=>e())),g.clear()}},19156:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(33555),i=n(6137),r=n(4463),s=n(7054),c=n(40647),l=n(69118);const d={},u=(0,l.wO)(1e3),m=function(e,t){(0,o.d4)((()=>{(Array.isArray(e)?e:[e]).forEach((e=>{const n=t||(0,a.Rd)().stories.byUserId[e]?.orderedIds?.[0];n&&(async e=>{await u,e.forEach((e=>{let{hash:t,format:n}=e;c.he(t,n).then((e=>{n===i.IU.Progressive&&function(e){const t=document.head,n=document.createElement("video");n.preload="auto",n.src=e,n.muted=!0,n.autoplay=!0,n.style.display="none",t.appendChild(n),setTimeout((()=>{t.removeChild(n)}),1e3)}(e)}))}))})(function(e,t){const n=(0,s.GZu)((0,a.Rd)(),e);if(!n||!n.orderedIds?.length)return[];const o=function(e,t,n){const o=e.indexOf(t);return e.slice(o-5,o+5)}(n.orderedIds,t),c=[];return o.forEach((t=>{if(d[e]?.has(t))return;const o=n.byId[t];o&&"content"in o&&(c.push({hash:(0,r.Cc)(o,"full"),format:o.content.video?i.IU.Progressive:i.IU.BlobUrl}),c.push({hash:(0,r.Cc)(o),format:i.IU.BlobUrl}),o.content.altVideo&&c.push({hash:(0,r.Cc)(o,"full",!0),format:i.IU.Progressive}),d[e]=(d[e]||new Set).add(t))})),c}(e,n))}))}),[t,e])}},13617:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(33555),i=n(97184),r=n(59107),s=n(25190);function c(e,t,n){const{showNotification:c}=(0,a.Sv)(),l=(0,r.Z)(),[d,u]=(0,o.eJ)(!1),m=(0,s.Z)((()=>{u(!0),t||c({message:i.q$?l("Video.Unsupported.Mobile"):l("Video.Unsupported.Desktop"),duration:8e3})})),h=(0,s.Z)((e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||m())})),p=(0,s.Z)((e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||m()}));return(0,o.d4)((()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",h),t.addEventListener("canplay",p),()=>{t.removeEventListener("error",h),t.removeEventListener("canplay",p)}):void 0}),[n,e]),d}},47783:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(60748),a=n(33555),i=n(4463),r=n(7054),s=n(69118);const c=new Map;let l=new Set;const d=(0,s.P2)((()=>{const e=Array.from(l),t=e.slice(0,100),n=e.slice(101);(0,a.Sv)().loadStoriesMaxIds({userIds:t}),t.forEach((e=>c.set(e,Date.now()))),l=new Set(n),l.size&&d()}),500);function u(e){const t=(0,o.Ye)((()=>e?.map((e=>(0,a.Rd)().users.byId[e])).filter(Boolean)),[e]),n=(0,o.Ye)((()=>{const e=(0,a.Rd)();return t?.filter((t=>{const n=c.get(t.id)||0;if(Date.now()-n<36e5)return!1;const o=(0,r.ssc)(e,t.id),a=o&&"userStatusEmpty"!==o.type;return!t.isContact&&!t.isSelf&&!(0,i.cS)(t)&&!t.isSupport&&a})).map((e=>e.id))}),[t]);(0,o.d4)((()=>{n?.length&&(n.forEach((e=>l.add(e))),d())}),[n])}},53455:(e,t,n)=>{n.d(t,{Yy:()=>r,ZP:()=>h,fi:()=>i,vb:()=>l});var o=n(60782),a=n(91090);const i=[{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"}],r=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],s=["includedChatIds","bots","channels","groups","contacts","nonContacts"],c=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let a=[],i=[];if("included"===t){const{includedChatIds:t,...r}=n?e.includeFilters||{}:(0,o.ei)(e.folder,s);a=t||[],i=Object.keys(r).filter((e=>Boolean(r[e])))}else{const{excludedChatIds:t,...r}=n?e.excludeFilters||{}:(0,o.ei)(e.folder,c);a=t||[],i=Object.keys(r).filter((e=>Boolean(r[e])))}return{selectedChatIds:a,selectedChatTypes:i}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||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"setFolderId":return{...e,folderId:t.payload,mode:"edit"};case"editIncludeFilters":return{...e,includeFilters:(0,o.ei)(e.folder,s)};case"editExcludeFilters":return{...e,excludeFilters:(0,o.ei)(e.folder,c)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,o.CE)(e.folder,s),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,o.CE)(e.folder,c),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...o}=t.payload;return{mode:"edit",folderId:e,folder:o,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsTouched":return{...e,isTouched:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,isLoading:!1,error:t.payload};case"setIsChatlist":return{...e,folder:{...e.folder,isChatList:t.payload}};case"reset":return u;default:return e}},h=()=>(0,a.Z)(m,u)},11309:(e,t,n)=>{n.d(t,{CH:()=>r,Vr:()=>l,WR:()=>s,iD:()=>c});var o=n(67360),a=n(71790),i=n(3927);function r(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,i.Z)((t=>{t(e())}),t,n,o)}function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=r((()=>e()),[e],t,n);return(0,a.Z)(o,[o,e],!0)}function c(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return(0,o.Z)((t=>{t(e())}),t,n,a,i)}function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=c((()=>e()),[e],t,n,o);return(0,a.Z)(i,[i,e],!0)}},23186:(e,t,n)=>{n.d(t,{Z:()=>p});var o=n(60748),a=n(33555),i=n(83716),r=n(7054),s=n(10396),c=n(64532),l=n(85266),d=n(274),u=n(25190),m=n(34446);function h(e){let t={};if(e&&e.current){const{play:n,pause:o,setCurrentTime:i,proxy:r,requestNextTrack:s,requestPreviousTrack:c,isFirst:l,isLast:d}=e.current;t={play:()=>{n(r.src)},pause:()=>{o()},stop:()=>{o(),i(0),(0,a.Sv)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;i(Math.max(r.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;i(Math.min(r.currentTime+t,r.duration))},seekTo:e=>{e.seekTime&&i(e.seekTime)}},d()||(t.nexttrack=()=>{s()}),l()||(t.previoustrack=()=>{c()})}return t}const p=function(e,t,n,p,g,Z,f){let v=arguments.length>7&&void 0!==arguments[7]&&arguments[7],P=arguments.length>8?arguments[8]:void 0,E=arguments.length>9?arguments[9]:void 0,y=arguments.length>10&&void 0!==arguments[10]&&arguments[10],b=arguments.length>11&&void 0!==arguments[11]&&arguments[11];const C=(0,o.sO)(null),[w,S]=(0,o.eJ)(!1);let N=w;const[I,M]=(0,o.eJ)(0),k=(0,u.Z)((()=>{S(!1),E&&E()}));(0,m.Z)((()=>{C.current=(0,s.z2)(e,n,((e,o)=>{switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:o,toggleMuted:s,proxy:l}=C.current;S(!0),(0,c.N)(Z,h(C)),(0,c.pC)("playing");const{audioPlayer:d}=(0,r.jUK)((0,a.Rd)());e(d.volume),s(Boolean(d.isMuted));const u=l.duration&&Number.isFinite(l.duration)?l.duration:t;("voice"===n||u>i.J0S)&&o(d.playbackRate),(0,c.NS)({duration:l.duration||0,playbackRate:l.playbackRate,position:l.currentTime});break}case"onRateChange":{const{proxy:e}=C.current;(0,c.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":S(!1),(0,c.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=C.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;b||M(e.currentTime/n);break}case"onEnded":(0,c.pC)("paused")}g?.[e]?.(o)}),P,k);const{proxy:o}=C.current;w||o.paused||(S(!0),N=!0),f&&f(o)}),[e]),(0,o.d4)((()=>{w&&Z&&(0,c.Ym)(Z)}),[Z,w]);const{play:x,pause:T,setCurrentTime:A,proxy:R,destroy:O,setVolume:L,stop:D,isFirst:F,isLast:B,requestNextTrack:U,requestPreviousTrack:$,setPlaybackRate:j,toggleMuted:H}=C.current,_=R.duration&&Number.isFinite(R.duration)?R.duration:t;(0,o.d4)((()=>{!_||(0,l.z)(R)||b||M(R.currentTime/_)}),[_,I,R,b]),(0,o.d4)((()=>()=>{O(y)}),[O,y]),(0,d.Z)((e=>{let[t,n]=e;t===v&&p===n||R.src&&R.paused||v&&p&&!w&&x(p)}),[v,p,w,x,R.src,R.paused]);const z=(0,u.Z)((()=>{p&&x(p)})),Y=(0,u.Z)((()=>{w?T():z()})),V=(0,u.Z)((e=>{A(e),_&&M(R.currentTime/_)}));return{isPlaying:N,playProgress:I,playPause:Y,pause:T,play:z,stop:D,setCurrentTime:V,setVolume:L,audioProxy:R,duration:_,requestNextTrack:U,requestPreviousTrack:$,isFirst:F,isLast:B,setPlaybackRate:j,toggleMuted:H}}},58637:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(69118),i=n(25190);function r(e){const t=(0,i.Z)(e);(0,o.d4)((()=>(0,a.Gq)(t)),[t])}},15866:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(96264),i=n(57710),r=n(97184),s=n(34446);function c(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,l=arguments.length>4?arguments[4]:void 0,d=arguments.length>5?arguments[5]:void 0;const u=(0,o.sO)(null),m=(0,o.sO)();return(0,s.Z)((()=>{t||(m.current=!1)}),[e,t]),(0,o.d4)((()=>{const o=u.current;if(!e||!o||t||m.current)return;m.current=!0;const s=new Image,h=()=>{const e=l||s.width,t=d||s.height,n=o.getContext("2d",{alpha:!1});(0,i.WM)((()=>{o.width=e,o.height=t,r.vX&&(n.filter=`blur(${c}px)`),n.drawImage(s,2*-c,2*-c,e+4*c,t+4*c),r.vX||(0,a.Z)(n,0,0,e,t,c,2)}))};s.onload=()=>{n?(0,i.i$)(h):h()},s.src=e}),[e,t,d,l,c,n]),u}},41470:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(60748),a=n(33555),i=n(83716),r=n(4463),s=n(60782),c=n(97184),l=n(59107);const d=function(e){let{chat:t,user:n,folderId:d,isPinned:u,isMuted:m,canChangeFolder:h,handleDelete:p,handleMute:g,handleChatFolderChange:Z,handleReport:f}=e,v=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const P=(0,l.Z)(),{isSelf:E}=n||{},y=n?.id===i.awM;return(0,o.Ye)((()=>{if(!t)return;const{toggleChatPinned:e,updateChatMutedState:o,toggleChatArchived:i,toggleChatUnread:l,openChatInNewTab:b}=(0,a.Sv)(),C=c.IT&&{title:c.D$?"Open in new window":"Open in new tab",icon:"open-in-new-tab",handler:()=>{b({chatId:t.id})}},w=h?{title:P("ChatList.Filter.AddToFolder"),icon:"folder",handler:Z}:void 0,S=u?{title:P("UnpinFromTop"),icon:"unpin",handler:()=>e({id:t.id,folderId:d})}:{title:P("PinToTop"),icon:"pin",handler:()=>e({id:t.id,folderId:d})},N=m?{title:P("ChatList.Unmute"),icon:"unmute",handler:()=>o({chatId:t.id,isMuted:!1})}:{title:`${P("ChatList.Mute")}...`,icon:"mute",handler:g};if(v)return(0,s.oA)([C,S,w,N]);const I=t.unreadCount||t.hasUnreadMark?{title:P("MarkAsRead"),icon:"readchats",handler:()=>l({id:t.id})}:void 0,M=t.unreadCount||t.hasUnreadMark||t.isForum?void 0:{title:P("MarkAsUnread"),icon:"unread",handler:()=>l({id:t.id})},k=(0,r.pE)(t)?{title:P("Unarchive"),icon:"unarchive",handler:()=>i({id:t.id})}:{title:P("Archive"),icon:"archive",handler:()=>i({id:t.id})},x=f&&((0,r.eA)(t)||(0,r.Bf)(t)||n&&!n.isSelf)?{title:P("ReportPeer.Report"),icon:"flag",handler:f}:void 0,T={title:(0,r.YC)(t.id)?P("Delete"):P((0,r.cc)(t)?"DeleteChat":(0,r.eA)(t)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:p},A=void 0!==d;return(0,s.oA)([C,w,I,M,S,!E&&N,!E&&!y&&!A&&k,x,T])}),[t,n,h,P,Z,u,v,m,p,g,f,d,E,y])}},71790:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(33799),a=n(93862),i=n(70971),r=n(34446);const s=function(e,t){var n;let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const c=t?e:()=>e;null!==(n=t)&&void 0!==n||(t=[e]);const[l,d]=(0,o.Z)(),u=(0,i.Y)(c);function m(){const e=u.current;s?e(d):d(e())}return(0,r.Z)(m,t),(0,a.b)(m,t),l}},86203:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(65326),i=n(93862),r=n(70971),s=n(34446);const c=function(e,t){var n;let c=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const l=t?e:()=>e();null!==(n=t)&&void 0!==n||(t=[e]);const d=(0,o.sO)(),u=(0,a.Z)(),m=(0,r.Y)(l);function h(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=m.current;if(c)t((e=>{d.current!==e&&(d.current=e,u())}));else{const n=t();d.current!==n&&(d.current=n,e||u())}}return(0,s.Z)((()=>{h(!0)}),t),(0,i.b)(h,t),d.current}},75790:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(60748),a=n(33555);function i(e,t,n,i){const{loadMessage:r}=(0,a.Sv)();(0,o.d4)((()=>{t&&!n&&r({chatId:e,messageId:t,replyOriginForId:i})}),[e,n,t,i])}},31526:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(33555),i=n(69118);const r=function(e,t,n){const{loadUserStoriesByIds:r}=(0,a.Sv)(),s=(0,o.Ye)((()=>{const n=(0,i.P2)(r,200,!0);return()=>{n({userId:e,storyIds:[t]})}}),[t,e]);(0,o.d4)((()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&s()}),[s,n,t,e])}},95616:(e,t,n)=>{n.d(t,{d7:()=>r,mE:()=>c,yi:()=>s});var o=n(60748),a=n(16974),i=n(65326);function r(e){const t=(0,i.Z)();return(0,o.d4)((()=>(0,a.M2)(e,t)),[e,t]),(0,a.gO)(e)}function s(){const e=(0,i.Z)();return(0,o.d4)((()=>(0,a.O6)(e)),[e]),(0,a.wC)()}function c(){const e=(0,i.Z)();return(0,o.d4)((()=>(0,a.r_)(e)),[e]),(0,a.Yz)()}},54416:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(65326),i=n(25190),r=n(34446);function s(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,o.sO)(e),n=(0,o.sO)(!1),s=(0,a.Z)();(0,r.Z)((()=>{e&&(t.current=!0)}),[e]);const c=(0,i.Z)((()=>{t.current=!1,n.current=!1,s()})),l=(0,i.Z)((()=>{n.current=!0,s()}));return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:c,handleForumPanelAnimationStart:l}}},69156:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(60748),a=n(33799);function i(e){const[t,n]=(0,a.Z)();return(0,o.d4)((()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const o=t.getRangeAt(0);if(!o)return;if(!document.querySelector(e))return;const{commonAncestorContainer:a}=o;(a instanceof Element?a:a.parentElement).closest(e)&&n(o)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)}),[e,n]),t}},78781:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(60748);const a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,o.d4)((()=>{if(t)return;const o=e.current;function a(e){e.deltaX||(o.scrollLeft+=e.deltaY/4,n&&e.preventDefault())}return o.addEventListener("wheel",a,{passive:!n}),()=>{o.removeEventListener("wheel",a)}}),[e,t,n])}},73541:(e,t,n)=>{n.d(t,{y:()=>s});var o=n(60748),a=n(16063);const i=new Set(["INPUT","TEXTAREA","SELECT"]),r=(0,a._)();function s(e){(0,o.d4)((()=>{if(!e)return;const t=Object.entries(e);return r.addCallback((function(e){(function(e){return!(e.target instanceof HTMLElement)||!i.has(e.target.tagName)})(e)&&t.forEach((t=>{let[n,o]=t;(function(e){return t=>function(e,t){const{alt:n,ctrl:o,meta:a,mod:i,shift:r,key:s}=e,{altKey:c,ctrlKey:l,metaKey:d,shiftKey:u,key:m}=t;if(n!==c)return!1;if(i){if(!l&&!d)return!1}else{if(o!==l)return!1;if(a!==d)return!1}return r===u&&Boolean(s&&(m.toLowerCase()===s.toLowerCase()||t.code.replace("Key","").toLowerCase()===s.toLowerCase()))}(function(e){const t=e.toLowerCase().split("+").map((e=>e.trim())),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift")},o=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find((e=>!o.includes(e)))}}(e),t)})(n)(e)&&o(e)}))}))}),[e])}document.documentElement.addEventListener("keydown",r.runCallbacks)},12515:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(60748),a=n(57710),i=n(42797);function r(e,t,n){const{isMobile:r}=(0,i.ZP)();(0,o.d4)((()=>{t?r||setTimeout((()=>{(0,a.WM)((()=>{e.current?.isConnected&&e.current.focus()}))}),500):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,300))}),[e,r,t,n])}},6701:(e,t,n)=>{n.d(t,{Z:()=>d});var o=n(60748),a=n(6137),i=n(40647),r=n(69118),s=n(97184),c=n(65326),l=n(27704);function d(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.IU.BlobUrl,d=arguments.length>3?arguments[3]:void 0,u=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const m=e?i.UV(e):void 0,h=s.I_&&n===a.IU.Progressive,p=(0,c.Z)(),g=(0,l.Z)(),[Z,f]=(0,o.eJ)(m&&!h?1:0),v=(0,o.sO)(),P=(0,o.Ye)((()=>(0,r.P2)((e=>{v.current&&(!d||Date.now()-v.current>d)&&f(e)}),500,!0)),[d]);return(0,o.d4)((()=>{!t&&e&&(m?h&&setTimeout((()=>{f(.75)}),1500):(f(0),v.current&&i.cC(P),v.current=Date.now(),i.he(e,n,u,P,g).then((()=>{const e=Date.now()-v.current;v.current=void 0,!d||e>=d?p():setTimeout(p,d-e)}))))}),[t,e,m,n,p,h,d,P,u,g]),(0,o.d4)((()=>{t&&v.current&&(i.cC(P),f(0),v.current=void 0)}),[P,t]),(0,o.d4)((()=>()=>{e&&i.Iq(e,g)}),[g,e]),{mediaData:m,loadProgress:Z}}},56503:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(97184),i=n(25190);let r;function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const c=(0,o.sO)(!1),l=(0,i.Z)((()=>{c.current=!0}));(0,o.d4)((()=>{r&&(clearTimeout(r),r=void 0),!e||a.$b||s||(r=window.setTimeout((()=>{c.current||t()}),2*n))}),[s,e,n,t]);const d=(0,i.Z)((()=>{c.current=!0})),u=(0,i.Z)((()=>{c.current=!1,r&&(clearTimeout(r),r=void 0),r=window.setTimeout((()=>{c.current||t()}),n)}));return[d,u,l]}},52678:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(65326),i=n(87204),r=n(34446);function s(e,t){const n=(0,i.Z)(e,!0),s=(0,o.sO)(),c=(0,a.Z)(),l=null!=e,d=null!=n;return l&&s.current&&(clearTimeout(s.current),s.current=void 0),(0,r.Z)((()=>{t&&!l&&d&&!s.current&&(s.current=window.setTimeout((()=>{s.current=void 0,c()}),t))}),[t,c,l,d]),s.current&&t&&!l?n:e}},91090:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(60748),a=n(65326);function i(e,t){const n=(0,a.Z)(),i=(0,o.sO)(e),r=(0,o.sO)(t),s=(0,o.I4)((e=>(r.current=i.current(r.current,e),n(),r.current)),[]);return[r.current,s]}},88957:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(67360);function a(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,o.Z)((e=>{e()}),a,e,t,n)}},33057:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(83716),i=n(790),r=n(82267),s=n(59107),c=n(25190),l=n(99203),d=n(48778);const u=e=>{const{isOpen:t}=e,n=(0,d.Z)(l.gl.Extra,"CalendarModal",!t);return n?o.ZP.createElement(n,e):void 0},m=(e,t,n)=>{const l=(0,s.Z)(),[d,m]=(0,o.eJ)(),h=(0,c.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:(0,r.Qj)());d?.(n),m(void 0)})),p=(0,c.Z)((()=>{h(new Date(1e3*a.t4X),!0)})),g=(0,c.Z)((()=>{m(void 0),t?.()})),Z=(0,c.Z)((e=>{m((()=>e))})),f=n?new Date(1e3*n):new Date;f.setSeconds(0),f.setMilliseconds(0);const v=new Date;return v.setFullYear(v.getFullYear()+1),[Z,o.ZP.createElement(u,{isOpen:Boolean(d),withTimePicker:!0,selectedAt:f.getTime(),maxAt:(0,i._F)(v),isFutureMode:!0,secondButtonLabel:e?l("Schedule.SendWhenOnline"):void 0,onClose:g,onSubmit:h,onSecondButtonClick:e?p:void 0})]}},56389:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(60748),a=n(33555),i=n(83716),r=n(69118);const s=(e,t)=>(0,o.Ye)((()=>(0,r.P2)((n=>{e&&t&&(0,a.Sv)().sendMessageAction({chatId:e,threadId:t,action:n})}),i.o_S)),[e,t])},33799:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(60748),a=n(19369);function i(e){var t;const n=(0,o.sO)();return null!==(t=n.current)&&void 0!==t||(n.current=(0,a.gQ)(e)),n.current}},93862:(e,t,n)=>{n.d(t,{b:()=>r});var o=n(60748),a=n(19369),i=n(7792);function r(e,t){const n=(0,o.sO)(!0);n.current&&(n.current=!1,t?.forEach((t=>{(0,a.$Z)(t)&&t.subscribe(e)}))),(0,i.Z)((()=>()=>{(0,a.Dc)(e)}))}},28183:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(60748);const a=function(e,t){const n=(0,o.sO)(e);(0,o.bt)((()=>{n.current=e}),[e]),(0,o.d4)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>n.current()),t);return()=>clearTimeout(e)}),[t])}},74095:(e,t,n)=>{n.d(t,{K:()=>r});var o=n(69995);function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class i{constructor(e,t,n){this.target=e,this.onUpdate=t,this.channel=n,a(this,"requestStates",new Map),a(this,"requestStatesByCallback",new Map)}destroy(){}init(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.postMessage({type:"init",args:t})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,a=(0,o.Z)(),i={type:"callMethod",messageId:a,...e},r={messageId:a},s=new Promise(((e,t)=>{Object.assign(r,{resolve:e,reject:t})}));if("function"==typeof i.args[i.args.length-1]){i.withCallback=!0;const e=i.args.pop();r.callback=e,n.set(e,r)}return t.set(a,r),s.catch((()=>{})).finally((()=>{t.delete(a),r.callback&&n.delete(r.callback)})),this.postMessage(i),s}cancelCallback(e){e.isCanceled=!0;const{messageId:t}=this.requestStatesByCallback.get(e)||{};t&&this.postMessage({type:"cancelProgress",messageId:t})}onMessage(e){const{requestStates:t,channel:n}=this;if(e.channel===n)if("update"===e.type&&this.onUpdate&&this.onUpdate(e.update),"methodResponse"===e.type){const n=t.get(e.messageId);n&&(e.error?n.reject(e.error):n.resolve(e.response))}else if("methodCallback"===e.type)t.get(e.messageId)?.callback?.(...e.callbackArgs);else if("unhandledError"===e.type)throw new Error(e.error?.message)}postMessage(e){e.channel=this.channel,this.target.postMessage(e)}}function r(e,t,n){const o=new i(e,t,n);function a(e){let{data:t}=e;o.onMessage(t)}return e.addEventListener("message",a),o.destroy=()=>{e.removeEventListener("message",a)},o}},8582:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(33555),a=n(57710),i=n(7054),r=n(9933);const s=new Map;function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300;(0,i.FOo)((0,o.Rd)())||(n=0);const c="rtl"===e.getAttribute("dir"),{scrollLeft:d,offsetWidth:u,scrollWidth:m,dataset:{scrollId:h}}=e;let p=t-d;if(p<0){const e=-d*(c?-1:1);p=Math.max(p,e)}else if(p>0){const e=m-(d+u);p=Math.min(p,e)}if(0===p)return Promise.resolve();h&&s.has(h)&&s.get(h)();const g=d+p;return new Promise((t=>{(0,a.WM)((()=>{if(0===n)return e.scrollLeft=g,void t();let o=!1;const i=Math.random().toString();e.dataset.scrollId=i,s.set(i,(()=>{o=!0})),e.style.scrollSnapType="none";const c=Date.now();(0,r.jt)((()=>{if(o)return!1;const a=Math.min((Date.now()-c)/n,1),r=p*(1-l(a));return e.scrollLeft=Math.round(g-r),a>=1&&(e.style.scrollSnapType="",delete e.dataset.scrollId,s.delete(i),t()),a<1}),a.WM)}))}))}function l(e){return 1-(1-e)**3.5}},81740:(e,t,n)=>{n.d(t,{Ni:()=>Z,ZP:()=>h,wA:()=>p});var o=n(33555),a=n(91713),i=n(83716),r=n(57710),s=n(7054),c=n(9933),l=n(97184),d=n(18674);let u,m=!1;function h(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];u=t.slice(0,8);const o=g(...u),a=t[8];if(a)return o;(0,r.WM)(o)}function p(){m&&((0,c.vR)(),(0,r.i$)((()=>{(0,r.WM)(g(...u))})))}function g(e,t,n){let h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,p=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i.V$q,g=arguments.length>5?arguments[5]:void 0,Z=arguments.length>6?arguments[6]:void 0,E=arguments.length>7?arguments[7]:void 0;g!==a.fo.Static&&(0,s.FOo)((0,o.Rd)())||(Z=0);const{offsetTop:y,offsetHeight:b}=t,{scrollTop:C,offsetHeight:w,scrollHeight:S}=e,N=E&&e.dataset.normalHeight?Number(e.dataset.normalHeight):w;let I;switch(n){case"start":I=y-h+(l.wZ?1:0);break;case"end":I=y+b+h-N;break;case"nearest":case"center":case"centerOrTop":I=b<N?y+b/2-N/2:y-h}const M=f(e,I,p,g);let k=I-M;if(k<0){const e=-M;k=Math.max(k,e)}else if(k>0){const e=S-(M+N);k=Math.min(k,e)}const x=Math.abs(k);return()=>{if(x<1)return void(C!==M&&(e.scrollTop=M));const t=M+k;if(0===Z)return void(e.scrollTop=t);m=!0;const n=x<=i.xnK?v:P,o=Z||i.bKs+x/i.V$q*(i.ckE-i.bKs),a=Date.now(),s=(0,d.YW)();(0,c.cK)((()=>{const i=Math.min((Date.now()-a)/o,1),r=k*(1-n(i)),c=Math.round(t-r);return e.scrollTop=c,m=i<1&&c!==t,m||(u=void 0,s()),m}),r.WM)}}function Z(){return m}function f(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.V$q,o=arguments.length>3?arguments[3]:void 0;const{scrollTop:r}=e;if(void 0===o){const e=t-r;if(e<-n)return r+(e+n);if(e>n)return r+(e-n)}else{if(o===a.fo.Up)return t+n;if(o===a.fo.Down)return Math.max(0,t-n)}return r}function v(e){return 1-(1-e)**3.5}function P(e){return 1-(1-e)**6.5}},10396:(e,t,n)=>{n.d(t,{An:()=>E,Es:()=>Z,z2:()=>f});var o=n(33555),a=n(91713),i=n(57710),r=n(4463),s=n(7054),c=n(85266),l=n(74753),d=n(97184);const u=new Map;let m,h=[],p=[];function g(e,t){const n=m&&u.get(m);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const i=P(e,(0,s.jUK)((0,o.Rd)()).audioPlayer.origin||a.Cr.Inline,t);if(!i)return;if(!u.has(i))return void(0,o.Sv)().openAudioPlayer((0,r.Ak)(y(i).messageKey));const c=u.get(i);c.onForcePlay&&c.onForcePlay(),m=i,c.audio.src&&(0,l.Z)(c.audio)}function Z(){const e=m&&u.get(m);e&&e.audio.pause()}function f(e,t,n,Z,f){if(!u.has(e)){const n=function(e,t,n,o){const a=new Audio;function i(t){return n=>{u.has(e)&&((0,c.z)(a)||u.get(e).handlers.forEach((e=>{e(t,n)})))}}return a.addEventListener("timeupdate",i("onTimeUpdate")),a.addEventListener("play",i("onPlay")),a.addEventListener("pause",i("onPause")),a.addEventListener("loadstart",i("onLoadStart")),a.addEventListener("loadeddata",i("onLoadedData")),a.addEventListener("playing",i("onPlaying")),a.addEventListener("ended",(()=>{u.has(e)&&((0,c.z)(a)||g(e))})),{audio:a,type:t,proxy:new Proxy(a,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:o}}(e,t,Z,f);u.set(e,n),function(e,t){"audio"!==e.type||p.includes(t)||(p.push(t),p.sort(b)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(b))}(n,e)}const{audio:v,proxy:E,handlers:C}=u.get(e);return C.push(n),{play(n){if(!v.paused)return;const i=m&&u.get(m);i&&m!==e&&(i.audio.pause(),i.audio.currentTime=0,(0,c.z)(i.audio)&&(i.audio.dataset.preventPlayAfterPatch="true"),i.onTrackChange&&i.onTrackChange()),m=e,v.src||(v.src=n,v.preload="auto",n.includes("/progressive/")&&d.s$&&(delete v.dataset.preventPlayAfterPatch,(0,c.B)(v))),(0,l.Z)(v),function(e,t){if((0,s.jUK)((0,o.Rd)()).globalSearch.currentContent===a.nJ.Music)return;const{chatId:n}=(0,r.Ak)(y(t).messageKey),i=(0,s.Btg)((0,o.Rd)())?.chatId,c=e=>e.startsWith(`msg${n}`)||i&&e.startsWith(`msg${i}`);"audio"===e&&(p=p.filter(c)),"voice"===e&&(h=h.filter(c))}(t,e)},pause(){m===e&&v.pause()},stop(){if(m===e){const e=v.src;v.pause(),(0,i.Yq)((()=>{v.src="",v.src=e}))}},setCurrentTime(t){m===e&&(v.fastSeek?v.fastSeek(t):v.currentTime=t)},setVolume(t){m===e&&(v.volume=t,v.muted=!1)},setPlaybackRate(t){m===e&&(v.playbackRate=t)},toggleMuted(e){v.muted=void 0===e?!v.muted:e},proxy:E,requestNextTrack(){g(e)},isLast:()=>!P(e,(0,s.jUK)((0,o.Rd)()).audioPlayer.origin),isFirst:()=>!P(e,(0,s.jUK)((0,o.Rd)()).audioPlayer.origin,!0),requestPreviousTrack(){g(e,!0)},destroy(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const o=u.get(e);o&&(o.handlers=o.handlers.filter((e=>e!==n)),o.handlers.length||(o.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(p=p.filter(n)),"voice"===e.type&&(h=h.filter(n))}(o,e),e===m&&(m=void 0)))}}}function v(e){switch(e.type){case"audio":return p;case"voice":return h;default:return}}function P(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.Cr.Inline,n=arguments.length>2?arguments[2]:void 0;const o=u.get(e),i=v(o);if(!i)return;if(t===a.Cr.Search){const t=i.indexOf(e);if(t<0)return;return i[t+(n?-1:1)]}const{chatId:s}=(0,r.Ak)(y(e).messageKey),c=i.filter((e=>e.startsWith(`msg${s}`))),l=c.indexOf(e);if(l<0)return;let d=t===a.Cr.Inline?-1:1;return n&&(d*=-1),c[l+d]}function E(e){return`${(0,r.Tp)(e)}-${e.date}`}function y(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function b(e,t){if(!e||!t)return 0;const{date:n,messageKey:o}=y(e),{date:a,messageKey:i}=y(t),r=a-n;return 0===r?i.localeCompare(o):r}},64963:(e,t,n)=>{function o(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{vJ:()=>l,eM:()=>c,sf:()=>p});var a=n(28712),i=n(69118),r=n(97184),s=n(43858);let c=function(e){return e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right",e}({});const l=20;function d(e,t){return t?Math.hypot(t.pageX-e.pageX,t.pageY-e.pageY):0}function u(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}let m=0;const h=new class{constructor(){let{stability:e=8,sensitivity:t=100,tolerance:n=1.1,delay:a=150}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,"stability",void 0),o(this,"sensitivity",void 0),o(this,"tolerance",void 0),o(this,"delay",void 0),o(this,"lastUpDeltas",void 0),o(this,"lastDownDeltas",void 0),o(this,"deltasTimestamp",void 0),this.stability=e,this.sensitivity=t,this.tolerance=n,this.delay=a,this.lastUpDeltas=new Array(2*this.stability).fill(0),this.lastDownDeltas=new Array(2*this.stability).fill(0),this.deltasTimestamp=new Array(2*this.stability).fill(0)}check(e){let t;return void 0!==(e=e.originalEvent||e).wheelDelta?t=e.wheelDelta:void 0!==e.deltaY?t=-40*e.deltaY:void 0===e.detail&&0!==e.detail||(t=-40*e.detail),this.deltasTimestamp.push(Date.now()),this.deltasTimestamp.shift(),t>0?(this.lastUpDeltas.push(t),this.lastUpDeltas.shift(),this.isInertia(1)):(this.lastDownDeltas.push(t),this.lastDownDeltas.shift(),this.isInertia(-1))}isInertia(e){const t=-1===e?this.lastDownDeltas:this.lastUpDeltas;if(void 0===t[0])return e;if(this.deltasTimestamp[2*this.stability-2]+this.delay>Date.now()&&t[0]===t[2*this.stability-1])return!1;const n=t.slice(0,this.stability),o=t.slice(this.stability,2*this.stability),a=n.reduce(((e,t)=>e+t)),i=o.reduce(((e,t)=>e+t)),r=a/n.length,s=i/o.length;return Math.abs(r)<Math.abs(s*this.tolerance)&&this.sensitivity<Math.abs(s)}}({stability:5,sensitivity:25,tolerance:.6,delay:150});function p(e,t){var n,o,p;let g,Z=!1,f=!1,v=!1,P=0,E=null!==(n=t.initialZoom)&&void 0!==n?n:1,y={x:0,y:0},b={x:!1,y:!1};const C=s.Z.get();let w,S={x:C.width/2,y:C.height/2};const N=null!==(o=t.minZoom)&&void 0!==o?o:1,I=null!==(p=t.maxZoom)&&void 0!==p?p:4;function M(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(g=e,"mousedown"===e.type)!t.withNativeDrag&&t.onDrag&&e.preventDefault(),document.addEventListener("mousemove",x),document.addEventListener("mouseup",k);else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",x,{passive:!0}),t.addEventListener("touchend",k),t.addEventListener("touchcancel",k),"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&&(P=d(e.touches[0],e.touches[1]),S=u(e.touches[0],e.touches[1])))}t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function k(e){g&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.removeEventListener("mouseup",k),document.removeEventListener("mousemove",x),g.target.removeEventListener("touchcancel",k),g.target.removeEventListener("touchend",k),g.target.removeEventListener("touchmove",x),r.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),e&&(Z?t.onRelease&&t.onRelease(e):"mouseup"===e.type&&(t.onDoubleClick&&Date.now()-m<300?t.onDoubleClick(e,{centerX:g.pageX,centerY:g.pageY}):!t.onClick||"button"in e&&0!==e.button||t.onClick(e),m=Date.now()))),Z=!1,f=!1,v=!1,P=0,E=(0,a.uZ)(E,N,I),w=void 0,y={x:0,y:0},b={x:!1,y:!1};const n=s.Z.get();S={x:n.width/2,y:n.height/2},g=void 0}function x(e){if(g){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&&P>0&&2===e.touches.length)){const n=d(e.touches[0],e.touches[1]),o=u(e.touches[0],e.touches[1]),a=o.x-S.x,i=o.y-S.y,r=n/P;t.onZoom(e,{zoomFactor:r,initialCenterX:S.x,initialCenterY:S.y,dragOffsetX:a,dragOffsetY:i,currentCenterX:o.x,currentCenterY:o.y}),1!==r&&(Z=!0)}const n=e.pageX-g.pageX,o=e.pageY-g.pageY;(Math.abs(n)>=15||Math.abs(o)>=15)&&(Z=!0);let a=!1;t.onDrag&&(t.onDrag(e,g,{dragOffsetX:n,dragOffsetY:o}),a=!0),t.onSwipe&&!f&&(f=function(e,n,o){if(r.cj){const t=e.touches[0].pageX;if(t<=l||t>=s.Z.get().width-l)return!1}const a=Math.abs(n),i=Math.abs(o);if(n&&o&&Math.max(a,i)/Math.min(a,i)<2)return!1;let d;if(a>=50?d="x":i>=50&&(d="y"),!d)return!1;if(w){if(w!==d)return!1}else w=d;return function(e,t,n,o,a){return"x"===t?a(e,n<0?c.Left:c.Right):"y"===t&&a(e,o<0?c.Up:c.Down)}(e,d,n,o,t.onSwipe)}(e,n,o),a=f),r.cj&&a&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}const T=(0,i.Ds)(k,150,!1),A=(0,i.Ds)(k,150,!1);function R(e){Z||(M(e),Z=!0,S={x:e.x,y:e.y})}function O(e){if(!t.onZoom&&!t.onDrag)return;if(t.excludedClosestSelector&&(e.target.matches(t.excludedClosestSelector)||e.target.closest(t.excludedClosestSelector)))return;e.preventDefault(),e.stopPropagation();const{doubleTapZoom:n=3}=t;if(t.onDoubleClick&&Object.is(e.deltaX,-0)&&Object.is(e.deltaY,-0)&&e.ctrlKey)return R(e),E=E>1?1:n,t.onDoubleClick(e,{centerX:e.pageX,centerY:e.pageY}),void(Z=!1);const o=e.metaKey||e.ctrlKey||e.shiftKey;if(o&&function(e){if(!t.onZoom)return;R(e);const n=e.x-S.x,o=e.y-S.y,i=(0,a.uZ)(e.deltaY,-25,25);E-=.01*i,E=(0,a.uZ)(E,.5*N,3*I),v=!0,t.onZoom(e,{zoom:(0,a.NM)(E,2),initialCenterX:S.x,initialCenterY:S.y,dragOffsetX:n,dragOffsetY:o,currentCenterX:e.x,currentCenterY:e.y}),A(e)}(e),!o&&!v){const n=h.check(e);(1!==E||n)&&function(e){if(!t.onDrag)return;R(e),b.x&&Math.sign(y.x)!==Math.sign(e.deltaX)||(y.x-=e.deltaX),b.y&&Math.sign(y.y)!==Math.sign(e.deltaY)||(y.y-=e.deltaY);const{x:n,y:o}=y;t.onDrag(e,g,{dragOffsetX:n,dragOffsetY:o},((e,t)=>{b={x:e,y:t}})),T(e)}(e)}}return e.addEventListener("wheel",O),e.addEventListener("mousedown",M),e.addEventListener("touchstart",M,{passive:!t.isNotPassive}),()=>{k(),e.removeEventListener("wheel",O),e.removeEventListener("touchstart",M),e.removeEventListener("mousedown",M)}}},75851:(e,t,n)=>{n.d(t,{CO:()=>i,eb:()=>s,ix:()=>c,rZ:()=>l,uR:()=>d,wK:()=>a,xP:()=>r});var o=n(71394);function a(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function i(e){const t=e[0].toString(16),n=e[1].toString(16),o=e[2].toString(16);return(1==t.length?"0"+t:t)+(1==n.length?"0"+n:n)+(1==o.length?"0"+o:o)}function r(e){let[t,n,o]=e;t/=255,n/=255,o/=255;let a,i,r=Math.max(t,n,o),s=Math.min(t,n,o),c=r,l=r-s;if(i=0==r?0:l/r,r==s)a=0;else{switch(r){case t:a=(n-o)/l+(n<o?6:0);break;case n:a=(o-t)/l+2;break;case o:a=(t-n)/l+4}a/=6}return[a,i,c]}function s(e){let t,n,o,[a,i,r]=e,s=Math.floor(6*a),c=6*a-s,l=r*(1-i),d=r*(1-c*i),u=r*(1-(1-c)*i);switch(s%6){case 0:t=r,n=u,o=l;break;case 1:t=d,n=r,o=l;break;case 2:t=l,n=r,o=u;break;case 3:t=l,n=d,o=r;break;case 4:t=u,n=l,o=r;break;case 5:t=r,n=l,o=d}return[Math.round(255*t),Math.round(255*n),Math.round(255*o)]}async function c(e){const t=[0,0,0];let n,a,i,r,s=-4,c=[0,0,0],l=0;const d=document.createElement("canvas"),u=d.getContext&&d.getContext("2d");if(!u)return t;const m=await(0,o.pt)(e);i=m.naturalHeight||m.offsetHeight||m.height,a=m.naturalWidth||m.offsetWidth||m.width,d.height=i,d.width=a,u.drawImage(m,0,0);try{n=u.getImageData(0,0,a,i)}catch(e){return t}for(r=n.data.length;(s+=20)<r;)0!==n.data[s+3]&&(++l,c[0]+=n.data[s],c[1]+=n.data[s+1],c[2]+=n.data[s+2]);return c[0]=Math.floor(c[0]/l),c[1]=Math.floor(c[1]/l),c[2]=Math.floor(c[2]/l),c}function l(e){const[t,n,o]=e;return.2126*t+.7152*n+.0722*o}function d(e){let[t,n,o]=r(e);return n=Math.min(1,n+.05+.1*(1-n)),o=o>.5?Math.max(0,.65*o):Math.max(0,Math.min(1,1-.65*o)),`hsla(${360*t}, ${100*n}%, ${100*o}%, .4)`}},3570:(e,t,n)=>{function o(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>o})},6562:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(69118);let a=[],i=!1;function r(e,t){a.push({url:e,filename:t}),i||(i=!0,setTimeout((async()=>{await async function(){let e=0;for(const t of a)s(t),e++,10===e&&(await(0,o.wO)(1e3),e=0);a=[]}(),i=!1}),1e3))}function s(e){let{url:t,filename:n}=e;const o=document.createElement("a");o.href=t,o.download=n;try{o.click()}catch(e){console.error(e)}}},65723:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(57710),a=n(97184);function i(e,t,n){if(!t&&e===document.activeElement)return;const i=window.getSelection(),r=document.createRange(),s=e.lastChild||e;a.$b||n||s&&s.nodeValue?(r.selectNodeContents(n?e:s),r.collapse(!1),i.removeAllRanges(),i.addRange(r)):(0,o.i$)((()=>e.focus()))}},60998:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(83716);function a(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&i(e.focusNode,o.gnl);if(!t||0===t.childElementCount)return;const a=Array.from(t.children).reduce(((e,t)=>1===t.nodeType&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce(((e,t)=>e.concat(Number(t.dataset.messageId))),e):1===t.nodeType&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e),[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n||a.pop(),a}function i(e,t){return!(1!==e.nodeType||!e.classList.contains(t))||!!e.parentNode&&i(e.parentNode,t)}},93447:(e,t,n)=>{n.d(t,{j:()=>i,t:()=>r});var o=n(75851);const a=240;function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/png";const o=e instanceof Blob?URL.createObjectURL(e):e,a=new Image;return new Promise((i=>{a.onload=()=>{s(a,a.width*t,a.height*t,n).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(i).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(o)}))},a.src=o}))}function r(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";const a=e instanceof Blob?URL.createObjectURL(e):e,i=new Image;return new Promise((r=>{i.onload=()=>{s(i,t,n,o).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(r).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(a)}))},i.src=a}))}async function s(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";if(!("createImageBitmap"in window))return c(e,t,n,void 0,i);try{const r=await window.createImageBitmap(e,{resizeWidth:t,resizeHeight:n,resizeQuality:"high"});if(r.height!==n||r.width!==t)throw new Error("Image bitmap resize not supported!");const s=await(0,o.ix)(e.src),c=(0,o.rZ)(s)<a?"#fff":"#000";return await new Promise((e=>{const t=document.createElement("canvas");t.width=r.width,t.height=r.height;const n=t.getContext("2d");n.fillStyle=c,n.fillRect(0,0,t.width,t.height);const o=t.getContext("bitmaprenderer");o?o.transferFromImageBitmap(r):n.drawImage(r,0,0),t.toBlob(e,i)}))}catch(o){return c(e,t,n,void 0,i)}}async function c(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"image/png";const s=document.createElement("canvas"),c=s.getContext("2d"),l=document.createElement("canvas"),d=l.getContext("2d");if(s.width=t,s.height=n,e.width*i>t){const n=1/i;let o={width:Math.floor(e.width*i),height:Math.floor(e.height*i)};for(l.width=o.width,l.height=o.height,d.drawImage(e,0,0,o.width,o.height);o.width*i>t;)o={width:Math.floor(o.width*i),height:Math.floor(o.height*i)},d.drawImage(l,0,0,o.width*n,o.height*n,0,0,o.width,o.height);c.drawImage(l,0,0,o.width,o.height,0,0,s.width,s.height)}else c.drawImage(e,0,0,s.width,s.height);const u=await(0,o.ix)(e.src),m=(0,o.rZ)(u)<a?"#fff":"#000";return c.fillStyle=m,c.globalCompositeOperation="destination-over",c.fillRect(0,0,s.width,s.height),new Promise((e=>{s.toBlob(e,r)}))}},55254:(e,t,n)=>{n.d(t,{P:()=>a});var o=n(43858);function a(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=o.Z.get();return t.top<=n&&t.top+t.height>=0}},91489:(e,t,n)=>{n.d(t,{Qw:()=>s,k4:()=>l,lZ:()=>c,zY:()=>r});const o={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},a=new Map(Object.entries({"building/medical":"#43b3f4","building/gym":"#43b3f4","education/cafeteria":"#f7943f","travel/bedandbreakfast":"#9987ff","travel/hotel":"#9987ff","travel/hostel":"#9987ff","travel/resort":"#9987ff","travel/hotel_bar":"#e56dd6",arts_entertainment:"#e56dd6",building:"#6e81b2",education:"#a57348",event:"#959595",food:"#f7943f",home:"#00aeef",nightlife:"#e56dd6",parks_outdoors:"#6cc039",shops:"#ffb300",travel:"#1c9fff",work:"#ad7854"})),i=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15;const{lat:a,long:i}=t,r=o[e];switch(e){case"google":return`${r}/place/${a}+${i}/@${a},${i},${n}z`;case"bing":return`${r}?cp=${a}~${i}&lvl=${n}&sp=point.${a}_${i}`;case"apple":return`${r}?q=${a},${i}`;default:return`${r}/?mlat=${a}&mlon=${i}&zoom=${n}`}}function s(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function c(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function l(e){return e?a.get(e)||a.get(e.split("/")[0])||i[(t=e,t.split("").reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)|0),0)%i.length)]:"#008df2";var t}},64532:(e,t,n)=>{n.d(t,{Ay:()=>s,N:()=>a,NS:()=>l,Of:()=>d,Ym:()=>i,pC:()=>c});const o={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 a(e,t){const{mediaSession:n}=window.navigator;n?(e&&i(e),t&&r(t)):console.warn("MediaSession API not supported in this browser")}function i(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=null!=e?e:null)}function r(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...o,...e}).forEach((e=>{let[n,o]=e;try{t.setActionHandler(n,o)}catch(e){}}))}function s(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,r(o),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function l(e){if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:t}=window.navigator;t?.setPositionState?.(e)}function d(e){let{title:t,artist:n,album:o,artwork:a}=e;if("MediaMetadata"in window)return new window.MediaMetadata({title:t,artist:n,album:o,artwork:a})}},16580:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(60782);const a=new WeakMap;function i(e){return function(){const t=a.get(e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];if(t&&(0,o.et)(t.lastArgs,i))return t.lastResult;const s=e(...i);return a.set(e,{lastArgs:i,lastResult:s}),s}}},94462:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(33681);const a=new RegExp(`^(?:${o.Z.source})+$`,""),i=e=>{const t=e.split("\n"),n=t.join("");if(n.length>800)return!1;if(!Boolean(n.match(a)))return!1;const i=t.map((e=>{let t=0;for(;o.Z.exec(e);)if(t++,t>100)return o.Z.lastIndex=0,-1;return t}));let r=t.length;for(let e=0;e<i.length;e++){if(-1===i[e])return!1;i[e]>r&&(r=i[e])}return r}},83099:(e,t,n)=>{n.d(t,{ZP:()=>s,fu:()=>c,xe:()=>r});var o=n(6137),a=n(83716),i=n(97184);const r={B:o.Vv.Bold,STRONG:o.Vv.Bold,I:o.Vv.Italic,EM:o.Vv.Italic,INS:o.Vv.Underline,U:o.Vv.Underline,S:o.Vv.Strike,STRIKE:o.Vv.Strike,DEL:o.Vv.Strike,CODE:o.Vv.Code,PRE:o.Vv.Pre,BLOCKQUOTE:o.Vv.Blockquote};function s(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=document.createElement("div");o.innerHTML=n?e:l(t?d(e):e),c(o);const a=o.innerText.trim().replace(/\u200b+/g,""),i=o.innerText.indexOf(a[0]);let r=-i,s=0;const m=[];function h(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=u(e,a,r);if(n)r=t,m.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;r+=e.textContent.length}e.hasChildNodes()&&s<=3&&(s+=1,Array.from(e.childNodes).forEach(h))}return Array.from(o.childNodes).forEach((e=>{s=1,h(e)})),{text:a,entities:m.length?m:void 0}}function c(e){e.querySelectorAll("img").forEach((e=>{e.dataset.documentId?e.textContent=e.alt||"":e.replaceWith(e.alt||"")}))}function l(e){let t=e.slice(0);return t=t.replace(/&nbsp;/g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[`]{1}([^`\n]+)[`]{1}(?![^<]*<\/(code|pre)>)/g,"<code>$2</code>"),i.op||(t=t.replace(/\[<img[^>]+alt="([^"]+)"[^>]*>]/gm,"[$1]")),t=t.replace(/(?!<(?:code|pre)[^<]*|<\/)\[([^\]\n]+)\]\(customEmoji:(\d+)\)(?![^<]*<\/(?:code|pre)>)/g,'<img alt="$1" data-document-id="$2">'),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/(code|pre)>)/g,"<b>$2</b>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/(code|pre)>)/g,"<i>$2</i>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/(code|pre)>)/g,"<s>$2</s>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[|]{2}([^|\n]+)[|]{2}(?![^<]*<\/(code|pre)>)/g,`<span data-entity-type="${o.Vv.Spoiler}">$2</span>`),t}function d(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${a.FM6}+?)\\)`,"g"),((e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`https://${n}`}">${t}</a>`))}function u(e,t,n){const a=function(e){if(e instanceof HTMLElement&&e.dataset.entityType)return e.dataset.entityType;if(r[e.nodeName])return r[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===o.Vv.MentionName?o.Vv.MentionName:t.dataset.entityType===o.Vv.Url?o.Vv.Url:t.href.startsWith("mailto:")?o.Vv.Email:t.href.startsWith("tel:")?o.Vv.Phone:t.href!==t.textContent?o.Vv.TextUrl:o.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:"IMG"===e.nodeName&&e.dataset.documentId?o.Vv.CustomEmoji:void 0}(e);if(!a||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),s=i>=0?i:n,c=t.substring(0,s).length,{length:l}=t.substring(s,s+e.textContent.length);return a===o.Vv.TextUrl?{index:s,entity:{type:a,offset:c,length:l,url:e.href}}:a===o.Vv.MentionName?{index:s,entity:{type:a,offset:c,length:l,userId:e.dataset.userId}}:a===o.Vv.Pre?{index:s,entity:{type:a,offset:c,length:l,language:e.dataset.language}}:a===o.Vv.CustomEmoji?{index:s,entity:{type:a,offset:c,length:l,documentId:e.dataset.documentId}}:{index:s,entity:{type:a,offset:c,length:l}}}},41098:(e,t,n)=>{n.d(t,{Mq:()=>s,dG:()=>c,gJ:()=>i,qK:()=>r,tx:()=>a});const o=document.createElement("div");function a(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const o=n.createContextualFragment(e),a=o.lastChild;n.insertNode(o),a?(n.setStartAfter(a),n.setEndAfter(a)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}function i(e,t){if(!e)return"";const n=window.getSelection();if(!n||!n.rangeCount)return e.innerHTML;const a=n.getRangeAt(0).cloneRange();return a.intersectsNode(e)?t||e.contains(a.commonAncestorContainer)?(a.collapse(!0),a.setStart(e,0),o.innerHTML="",o.appendChild(a.cloneContents()),o.innerHTML):"":e.innerHTML}function r(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const o=n.getRangeAt(0),a=o.cloneRange();return a.selectNodeContents(e),a.setEnd(o.endContainer,o.endOffset),t=a.toString().length,t}function s(e,t){for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE){if(n.length>=t){const e=document.createRange(),o=window.getSelection();return e.setStart(n,t),e.collapse(!0),o.removeAllRanges(),o.addRange(e),-1}t-="length"in n?n.length:0}else if(-1===(t=s(n,t)))return-1;return t}function c(){window.getSelection()?.removeAllRanges()}},85655:(e,t,n)=>{let o;function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o||(o=document.createElement("input"),o.setAttribute("type","file")),o.setAttribute("accept",e),n?o.removeAttribute("multiple"):o.setAttribute("multiple","multiple"),o.onchange=null,o.value="",o.onchange=t,o.click()}n.d(t,{g:()=>a})},41372:(e,t,n)=>{n.d(t,{Z:()=>o});const o={root:"J2OUAM1NNJzVPwPvfhkE",fadeIn:"M0CnDOPqsqgp07DpRE7u",closing:"U1ngPxxXOIuHX2rXUTdq",user:"vEyOaK0611BDq1vciUK5",name:"M4TMTYSSXa3H49Go9t9g",name_hasUnreadStory:"kUi0jmHQpokhzBJI5FJA",nameHasUnreadStory:"kUi0jmHQpokhzBJI5FJA",hidden:"c5X6suR_qxO1W64dH2j3",contextMenu:"nAc8FkZyj9PHGgGm0BO7"}},4710:(e,t,n)=>{n.d(t,{Z:()=>o});const o={name:"M4TMTYSSXa3H49Go9t9g",root:"laLpjZnhOwW8cdBN3mEv",avatar:"ewhbkm9F8nGqLpj_toQg",avatarHidden:"aPEbisewADPmseTVcQxO",ghost:"bVo8M4JDvB9c6gUvnHTE",ghostAnimateName:"DuJzmNpO8VBweCzETZQJ",ghostRevealName:"ghy_xXQVvFUwJrNg9uhA",ghostLast:"_mqUJoir6gIYUJWb0zFw"}},68973:(e,t,n)=>{e.exports=n.p+"encoderWorker.min.8ea62f6317fbac7d4558.js"}}]);
//# sourceMappingURL=7377.d48dd0ca726e44faecb6.js.map