2 lines
255 KiB
JavaScript
2 lines
255 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[9170],{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",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:I}=e;return o.ZP.createElement("div",{className:(0,a.Z)(h,"oGmd77AsTbJeJk8CV6gl"),style:(0,i.Z)(void 0!==I&&`width: ${I}px; height: ${I}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:()=>M});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),m=n(15376),h=n(32340);var p=n(42797),g=n(23186),Z=n(12019),f=n(59107),v=n(25190),P=n(6202),E=n(6701),y=n(31212),b=n(231),C=n(8337),w=n(39196);const S=window.matchMedia("(max-width: 375px)"),I=window.matchMedia("(max-width: 410px)");function N(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 M=(0,o.X$)((e=>{let{theme:t,message:n,senderTitle:M,uploadProgress:k,origin:x,date:T,noAvatars:A,className:R,isSelectable:O,isSelected:L,isDownloading:D,isTranscribing:F,isTranscriptionHidden:B,isTranscribed:$,isTranscriptionError:U,canDownload:j,canTranscribe:H,onHideTranscription:z,onPlay:_,onReadMedia:Y,onCancelUpload:V,onDateClick:X}=e;const{cancelMessageMediaDownload:q,downloadMessageMedia:W,transcribeAudio:G}=(0,a.Sv)(),{content:{audio:K,voice:J,video:Q},isMediaUnread:ee}=n,te=Boolean(J||Q),ne=(0,o.sO)(!1),oe=(0,o.sO)(null),ae=(0,f.Z)(),{isRtl:ie}=ae,{isMobile:re}=(0,p.ZP)(),[se,ce]=(0,o.eJ)(!1),le=se||!0,de=(0,s.Ti)(n,"pictogram"),ue=(0,P.Z)(de,!1,i.IU.BlobUrl),me=(0,P.Z)((0,s.Ti)(n,"inline"),!le,(0,s.kG)(n,"inline")),{loadProgress:he}=(0,E.Z)((0,s.Ti)(n,"download"),!D,(0,s.kG)(n,"download")),pe=(0,v.Z)((()=>{ce(!0),_(n.id,n.chatId)})),ge=(0,v.Z)((()=>{ce(!1)})),{isBuffered:Ze,bufferedRanges:fe,bufferingHandlers:ve,checkBuffering:Pe}=(0,Z.Z)(),{isPlaying:Ee,playProgress:ye,playPause:be,setCurrentTime:Ce,duration:we}=(0,g.Z)((0,c.An)(n),(0,s.XV)(n),te?"voice":"audio",me,ve,void 0,Pe,se,pe,ge,(0,s.CI)(n)),Se=(0,s.B4)(n),Ie=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}=function(e,t){return{MIN_SPIKES:e?S.matches?16:20:25,MAX_SPIKES:e?S.matches?35:t&&I.matches?40:45:75}}(r,i),s=Math.min(n/10,1),c=Math.round(o+(a-o)*s);return function(e,t){let n=0;const o=new Array(t),a=e.length/t,i=e[0],r=e[e.length-1];for(let s=0;s<t;s++){const t=Math.floor(s*a),c=((e[t-1]??i)+(e[t]??i)+(e[t+1]??r))/3;o[s]=c,n<c&&(n=c)}return{data:o,peak:n}}(function(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}(new Uint8Array(e)),c)}),[r,t,i])||{};return(0,o.bt)((()=>{const t=s.current;t&&c&&void 0!==l&&function(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()}))}(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,J,ee&&!Se?1:ye,Se,!A,re),Ne=Ee||ye>0&&ye<1;(0,o.d4)((()=>{ce(Ee)}),[Ee]);const Me=se&&!Ze,{isUploading:ke,isTransferring:xe,transferProgress:Te}=(0,s.Sc)(n,k||he,Me||D),{shouldRender:Ae,transitionClassNames:Re}=(0,y.Z)(xe),Oe=Ae&&(Me||ke),Le=(0,v.Z)((()=>{ke?V?.():(Ee||_(n.id,n.chatId),(0,a.Sv)().setAudioPlayerOrigin({origin:x}),ce(!se),be())}));(0,o.d4)((()=>{Y&&ee&&(Ee||D)&&Y()}),[Ee,ee,Y,D]);const De=(0,v.Z)((()=>{D?q({message:n}):W({message:n})})),Fe=(0,v.Z)((e=>{if(ne.current&&oe.current){const{width:t,left:n}=oe.current.getBoundingClientRect(),o=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Ce(Math.max(Math.min(we*((o-n)/t),we-.1),.001))}})),Be=(0,v.Z)((e=>{e instanceof MouseEvent&&2===e.button||(ne.current=!0,Fe(e))})),$e=(0,v.Z)((()=>{ne.current=!1})),Ue=(0,v.Z)((()=>{X(n.id,n.chatId)})),je=(0,v.Z)((()=>{G({chatId:n.chatId,messageId:n.id})}));function He(){if(te)return M||"Voice";const{title:e,fileName:t}=K;return e||t}(0,o.d4)((()=>{if(oe.current&&Ne)return(0,d.sf)(oe.current,{onCapture:Be,onRelease:$e,onClick:$e,onDrag:Fe})}),[Ne,Be,Fe,$e]);const ze=(0,l.Z)("Audio",R,x===r.Cr.Inline&&"inline",Se&&x===r.Cr.Inline&&"own",(x===r.Cr.Search||x===r.Cr.SharedMedia)&&"bigger",L&&"audio-is-selected"),_e=["toggle-play"];Oe?_e.push("loading"):_e.push(Ee?"pause":"play");const Ye=(0,l.Z)("content",Ne&&"with-seekline");function Ve(){return o.ZP.createElement("div",{className:Ye},o.ZP.createElement("div",{className:"content-row"},o.ZP.createElement("p",{className:"title",dir:"auto",title:He()},(0,h.Z)(He())),o.ZP.createElement("div",{className:"message-date"},Boolean(T)&&o.ZP.createElement(C.Z,{className:"date",onClick:Ue},(0,u.VX)(ae,1e3*T)))),Ne&&o.ZP.createElement("div",{className:"meta search-result",dir:ie?"rtl":void 0},o.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},ye<1&&`${(0,u.k9)(we*ye,we)}`),N(ye,fe,oe)),!Ne&&function(){if(te)return o.ZP.createElement("div",{className:"meta",dir:ie?"rtl":void 0},(0,u.k9)((J||Q).duration));const{performer:e}=K;return o.ZP.createElement("div",{className:"meta",dir:ie?"rtl":void 0},(0,u.k9)(we),o.ZP.createElement("span",{className:"bullet"},"•"),e&&o.ZP.createElement("span",{className:"performer",title:e},(0,h.Z)(e)),e&&M&&o.ZP.createElement("span",{className:"bullet"},"•"),M&&o.ZP.createElement("span",{title:M},(0,h.Z)(M)))}())}return o.ZP.createElement("div",{className:ze,dir:ae.isRtl?"rtl":"ltr"},O&&o.ZP.createElement("div",{className:"message-select-control"},L&&o.ZP.createElement("i",{className:"icon icon-select"})),o.ZP.createElement(b.Z,{round:!0,ripple:!re,size:"smaller",color:ue?"translucent-white":"primary",className:_e.join(" "),ariaLabel:Ee?"Pause audio":"Play audio",onClick:Le,isRtl:ae.isRtl,backgroundImage:ue},o.ZP.createElement("i",{className:"icon icon-play"}),o.ZP.createElement("i",{className:"icon icon-pause"})),Ae&&o.ZP.createElement("div",{className:(0,l.Z)("media-loading",Re,Oe&&"interactive")},o.ZP.createElement(w.Z,{progress:Te,transparent:!0,size:"m",onClick:Oe?Le:void 0,noCross:!Oe})),K&&j&&!ke&&o.ZP.createElement(b.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:D?"Cancel download":"Download",onClick:De},o.ZP.createElement("i",{className:(0,l.Z)("icon",D?"icon-close":"icon-arrow-down")})),x===r.Cr.Search&&Ve(),x!==r.Cr.Search&&K&&function(e,t,n,a,i,r,s,c,l,d,p){const{title:g,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:g},(0,h.Z)(g||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)),N(i,r,s)),!v&&c&&o.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},d?`${(0,m.yW)(t.size*d)} / `:void 0,(0,m.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,h.Z)(Z))),Boolean(l)&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:"bullet"},"•"),o.ZP.createElement(C.Z,{className:"date",onClick:p},(0,u.ZK)(e,1e3*l,!0)))))}(ae,K,we,Ee,ye,fe,oe,D||ke,T,Te,X?Ue:void 0),x===r.Cr.SharedMedia&&(J||Q)&&Ve(),x===r.Cr.Inline&&J&&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(b.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)))}(J,oe,Ie,ye,ee,F,B,$,U,H?je:void 0,z))}))},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:()=>E});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(274),g=n(59107),Z=n(25190),f=n(31876),v=n(83321);const P=(0,u.Ds)((e=>e()),500,!1),E=(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:E,phoneCodeList:y,topicId:b,description:C,chatInviteLink:w,topicLink:S}=e;const{loadFullUser:I,showNotification:N,updateChatMutedState:M,updateTopicMutedState:k,loadPeerStories:x}=(0,a.Sv)(),{id:T,usernames:A,phoneNumber:R,isSelf:O}=t||{},{id:L,usernames:D}=n||{},F=T||L,B=(0,g.Z)(),[$,U]=(0,o.eJ)(!E);(0,o.d4)((()=>{U(!E)}),[E]),(0,o.d4)((()=>{T&&I({userId:T})}),[T]),(0,p.Z)((e=>{let[o]=e;F&&o!==F&&(t||n&&(0,s.eA)(n))&&x({peerId:F})}),[F,n,t]);const j=Boolean(b&&b!==i._f),H=(0,o.Ye)((()=>{const e=A?.filter((e=>e.isActive));return e?.length?e:void 0}),[A]),z=(0,o.Ye)((()=>{const e=t?void 0:D?.filter((e=>e.isActive));return e?.length?e:void 0}),[D,t]),_=(0,o.Ye)((()=>{if(n)return j?S:(0,s.hu)(n)||w}),[n,j,S,w]),Y=(0,Z.Z)((()=>{U((e=>{const t=!e;return P((()=>{j?k({chatId:L,topicId:b,isMuted:!t}):M({chatId:L,isMuted:!t})})),t}))}));if(!n||n.isRestricted||O&&!c)return;function V(e,t){(0,l.TE)(e),N({message:`${t} was copied`})}const X=R&&(0,d.WZ)(y,R);function q(e,t){const[n,...a]=e,i=a.length?B("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),V(i,B(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(f.Z,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>V(c,B(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),B(t?"Link":"Username")))}return o.ZP.createElement("div",{className:"ChatExtra"},X&&Boolean(X.length)&&o.ZP.createElement(f.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>V(X,B("Phone"))},o.ZP.createElement("span",{className:"title",dir:"auto"},X),o.ZP.createElement("span",{className:"subtitle"},B("Phone"))),H&&q(H),C&&Boolean(C.length)&&o.ZP.createElement(f.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},o.ZP.createElement("span",{className:"title word-break allow-selection",dir:"auto"},(0,h.Z)(C,["br","links","emoji"])),o.ZP.createElement("span",{className:"subtitle"},B(T?"UserBio":"Info"))),z&&!j&&q(z,!0),(!z&&u||j)&&_&&o.ZP.createElement(f.Z,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>V(_,B("SetUrlPlaceholder"))},o.ZP.createElement("div",{className:"title"},_),o.ZP.createElement("span",{className:"subtitle"},B("SetUrlPlaceholder"))),!c&&o.ZP.createElement(f.Z,{icon:"unmute",ripple:!0,onClick:Y},o.ZP.createElement("span",null,B("Notifications")),o.ZP.createElement(v.Z,{id:"group-notifications",label:T?"Toggle User Notifications":"Toggle Chat Notifications",checked:$,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),h=n(65723),p=n(70735),g=n(83099),Z=n(41098),f=n(82267),v=n(97184),P=n(43858);let E;function y(e){E.focus(),e.focus()}v.cj&&(E=document.createElement("input"),E.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(E));var b=n(71394),C=n(93447);const w=20,S=/\.[^/.]+$/;async function I(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,b.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,C.j)(a,m?1280/Math.max(s,l):1,"image/jpeg");return URL.revokeObjectURL(a),I(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,C.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,b.jj)(a);u=!M(e,t),u||(c={width:e,height:t,duration:n})}catch(e){u=!0}d=await(0,b.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 N(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)<=w}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),$=n(59107),U=n(25190),j=n(87204),H=n(33057),z=n(56389),_=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={BOLD:"700",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"line-through",SUPERSCRIPT:"super",SUBSCRIPT:"sub"},oe={ANCHOR:"a",BOLD:"strong",ITALIC:"em",UNDERLINE:"u",STRIKETHROUGH:"del",SUPERSCRIPT:"sup",SUBSCRIPT:"sub"},ae=["H1","H2","H3","H4","H5","H6"];function ie(e){return(new DOMParser).parseFromString(e,"text/html").body}function re(e,t){const n=document.createElement(oe.ANCHOR);return n.href=t,n.appendChild(e.cloneNode(!0)),n}function se(e,t){const n=document.createElement(t);return n.appendChild(e.cloneNode(!0)),n}function ce(e,t){let n=t.cloneNode(!0);return e?(e.style&&e.style.fontWeight===ne.BOLD&&(n=se(n,oe.BOLD)),e.style&&e.style.fontStyle===ne.ITALIC&&(n=se(n,oe.ITALIC)),e.style&&e.style.textDecoration===ne.UNDERLINE&&(n=se(n,oe.UNDERLINE)),e.style&&e.style.textDecoration===ne.STRIKETHROUGH&&(n=se(n,oe.STRIKETHROUGH)),e.style&&e.style.verticalAlign===ne.SUPERSCRIPT&&(n=se(n,oe.SUPERSCRIPT)),e.style&&e.style.verticalAlign===ne.SUBSCRIPT&&(n=se(n,oe.SUBSCRIPT)),n):n}function le(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),o=t;return"A"===t.nodeName&&(n=re(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(o=t.childNodes[0])),n=ce(o,n),n}function de(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(...de(e.childNodes[t]));o.map((e=>n.appendChild(e)))}else-1!==ae.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=le(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=re(n.cloneNode(!0),t.childNodes[0].href),o=t.childNodes[0].childNodes[0]),n=ce(o,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=le(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(...de(e.childNodes[n]));return t}return[e]}function ue(e){return 8!==e.nodeType}var me=n(56266),he=n(21262);const pe=/<style>(.*?)<\/style>/gs,ge=(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,g.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(ue),a=[];for(const e of o)a.push(...de(e));for(let e=0;e<a.length;e++)t.appendChild(a[e].cloneNode(!0));return t}(ie(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:ie(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){i.eMD&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(pe,"");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(),g.xe[e.tagName]&&e.setAttribute("data-entity-type",g.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,me.Lo)(u)&&s&&(u=(0,me.If)(u),c?.());const{items:m}=e.clipboardData;let h=[];if(e.preventDefault(),m.length>0&&(h=await(0,he.Z)(m)),!h?.length&&!l)return;const p=u?.entities?.length?u:{text:l};let Z=!1;try{Z="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&&!Z;if(v){const e=await Promise.all(h.map((e=>I(e.name,e))));n((t=>t.concat(e)))}f&&(v?a(p):t(p,o?.id))}}),[t,r,n,e,s,c,a])};var Ze=n(60130),fe=n(45332),ve=n(58637),Pe=n(72645),Ee=n(88957);let ye=!1;const be=new Set([ee.Vv.TextUrl,ee.Vv.Url]);var Ce=n(28353),we=n(16580);const Se=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/i,Ie=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,Ne={username:"",query:"",canShowHelp:!1,usernameLowered:""},Me=document.createElement("div");const ke=(0,we.Z)(((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})));var xe=n(29295),Te=n(33681),Ae=n(94462);const Re=new RegExp(`^${i.t8f.source}$`,"g");var Oe=n(23989);const Le={encoderPath:new URL(n(68973),n.b).href,reuseWorker:!0},De={type:"audio/ogg"};let Fe,Be,$e;async function Ue(){return Fe||(Fe=n.e(1161).then(n.t.bind(n,1161,23)),Be=(await Fe).default,$e=new Be(Le)),Fe}async function je(e){await async function(){await Ue(),await $e.start()}();const t=Date.now();let n;const o=[],a=[];$e.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}}($e);return{stop:()=>new Promise(((e,r)=>{$e.onstop=()=>{e({blob:new Blob(o,De),duration:Math.round(((n||Date.now())-t)/1e3),waveform:a})},$e.onerror=r;const s=Math.max(0,t+1e3-Date.now());setTimeout((()=>{$e.stop(),i()}),s)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{$e.pause(),n=Date.now(),i()}),e)}}}var He=n(99203),ze=n(48778);const _e=e=>{const{attachments:t}=e,n=(0,ze.Z)(He.gl.Extra,"AttachmentModal",!t.length);return n?o.ZP.createElement(n,e):void 0};var Ye=n(30879),Ve=n(85655),Xe=n(56503),qe=n(52328),We=n(58964),Ge=n(43521),Ke=n(43159);const Je=(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:P,onMenuClose:E,onPollCreate:y}=e;const[C,w,S]=(0,D.Z)(),[I,N,M]=(0,Xe.Z)(C,S),k=c&&l,x=c||l,[T,A,R]=(0,D.Z)(),O=C||T;(0,o.d4)((()=>{C&&M()}),[C,M]),(0,o.d4)((()=>{O?P():E()}),[O,E,P]);const L=(0,U.Z)((()=>{C?S():w()})),F=(0,U.Z)(((e,t)=>{const{files:n}=e.target,o=(0,b.ox)(n);o?.length&&f(o,t)})),B=(0,U.Z)((()=>{(0,Ve.g)(Array.from(k?i.dII:c?i.oGt:i.wGh).join(","),(e=>F(e,!0)))})),j=(0,U.Z)((()=>{(0,Ve.g)(!d&&u?Array.from(i.e74).join(","):"*",(e=>F(e,!1)))})),H=(0,U.Z)((()=>{const e=new File([(0,Ye.aZ)()],i.Wpe,{type:"text/plain"});f([e])})),z=(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]),_=(0,$.Z)();if(a)return o.ZP.createElement("div",{className:"AttachMenu"},o.ZP.createElement(Ge.Z,{id:"attach-menu-button",className:C?"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(qe.Z,{id:"attach-menu-controls",isOpen:O,autoClose:!0,positionX:"right",positionY:"bottom",onClose:S,className:"AttachMenu--menu fluid",onCloseAnimationEnd:S,onMouseEnter:v.$b?void 0:I,onMouseLeave:v.$b?void 0:N,noCloseOnBackdrop:!v.$b,ariaLabelledBy:"attach-menu-button"},!r&&o.ZP.createElement(We.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(We.Z,{icon:"photo",onClick:B},_(k?"AttachmentMenu.PhotoOrVideo":c?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")),(d||u)&&o.ZP.createElement(We.Z,{icon:"document",onClick:j},_(!d&&u?"InputAttach.Popover.Music":"AttachDocument")),d&&Z&&o.ZP.createElement(We.Z,{icon:"bug",onClick:H},_("DebugSendLogs"))),s&&o.ZP.createElement(We.Z,{icon:"poll",onClick:y},_("Poll")),r&&!p&&z?.map((e=>o.ZP.createElement(Ke.Z,{bot:e,chatId:t,threadId:n,theme:g,onMenuOpened:A,onMenuClosed:R})))))})),Qe=e=>{const{isOpen:t}=e,n=(0,ze.Z)(He.gl.Extra,"BotCommandMenu",!t);return n?o.ZP.createElement(n,e):void 0},et=e=>{const{isOpen:t}=e,n=(0,ze.Z)(He.gl.Extra,"BotCommandTooltip",!t);return n?o.ZP.createElement(n,e):void 0};var tt=n(231);const nt=(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,Xe.Z)(t,i),{isKeyboardSingleUse:l}=n||{};if(n&&n.keyboardButtons)return o.ZP.createElement(qe.Z,{isOpen:t,autoClose:l,positionX:"right",positionY:"bottom",onClose:i,className:"BotKeyboardMenu",onCloseAnimationEnd:i,onMouseEnter:v.$b?void 0:s,onMouseLeave:v.$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(tt.Z,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>r({messageId:n.id,button:e})},e.text))))))))}))),ot=(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(tt.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 at=n(12644),it=n(17891),rt=n(84441),st=n(66902);const ct=(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:s,messageIds:l,noAuthors:d,noCaptions:u}}=(0,c.jUK)(e),m=(0,c.Yyv)(e,o,a),h="scheduled"===i?(0,c.nBP)(e,o):(0,c._$9)(e,o,a),p=(0,c.FOo)(e),g=s===o,Z=l?.map((t=>(0,c.hjO)(e,r,t)));let f,v;if(m&&!n?f=(0,c.hjO)(e,o,m):h?f=(0,c.kKD)(e,o,a,i):g&&1===l.length&&(f=Z?.[0]),m&&f&&!n){const{forwardInfo:t}=f,n=(0,c.FM1)(e,o);t&&(t.isChannelPost||n)&&(v=(0,c.cve)(e,f)),v||t?.hiddenUserName||(v=(0,c.Urc)(e,f))}else g&&(f&&(v=(0,c.cve)(e,f),v||(v=(0,c.Urc)(e,f))),v||(v=(0,c.RGZ)(e,r)));const P=Z?.some((e=>e?.content.text&&Object.keys(e.content).length>1)),E=g&&1===l.length&&Boolean(f?.content.storyData);return{replyingToId:m,editingId:h,message:f,sender:v,shouldAnimate:p,forwardedMessagesCount:g?l.length:void 0,noAuthors:d,noCaptions:u,forwardsHaveCaptions:P,isCurrentUserPremium:(0,c.wVz)(e),isContextMenuDisabled:E}}))((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),I=(0,$.Z)(),N=Boolean(l),M=Boolean((t||n)&&i||r&&l),k=(0,it.Z)([l],l?300:void 0),{shouldRender:x,transitionClassNames:T}=(0,_.Z)(k&&M,void 0,!c,void 0,!c),A=(0,U.Z)((()=>{t&&!p?v({messageId:void 0}):n?P({messageId:void 0}):l&&w(),f?.()}));(0,o.d4)((()=>M?(0,Oe.Z)(A):void 0),[M,A]);const O=(0,U.Z)((()=>{N||E({chatId:i.chatId,messageId:i.id,noForumTopicPanel:!0})})),L=(0,U.Z)((e=>{e.stopPropagation(),A()})),D=(0,U.Z)((()=>{y()})),{isContextMenuOpen:F,contextMenuPosition:B,handleContextMenu:j,handleContextMenuClose:H,handleContextMenuHide:z}=(0,R.Z)(S),Y=(0,U.Z)((()=>S.current)),V=(0,U.Z)((()=>S.current)),X=(0,U.Z)((()=>S.current.querySelector(".forward-context-menu .bubble"))),{positionX:q,positionY:W,transformOriginX:G,transformOriginY:K,style:J}=(0,at.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":N?"icon-forward":void 0),[n,N,t,p]),te=l&&l>1?I("ForwardedMessageCount",l):void 0,ne=(0,o.Ye)((()=>{if(!i||!N||!i.content.text||!u||g)return i;const e=(0,s.If)(i.content.text);return{...i,content:{...i.content,text:e}}}),[g,N,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(rt.Z,{className:"inside-input",message:ne,sender:u?void 0:r,customText:te,title:n?I("EditMessage"):u?I("HiddenSendersNameDescription"):void 0,onClick:O,hasContextMenu:N&&!Z}),o.ZP.createElement(tt.Z,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:I("Cancel"),onClick:L},o.ZP.createElement("i",{className:"icon icon-close"})),N&&!Z&&o.ZP.createElement(qe.Z,{isOpen:F,transformOriginX:G,transformOriginY:K,positionX:q,positionY:W,style:J,className:"forward-context-menu",onClose:H,onCloseAnimationEnd:z},o.ZP.createElement(We.Z,{icon:u?void 0:"message-succeeded",customIcon:u?o.ZP.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>b({noAuthors:!1})},I(l>1?"ShowSenderNames":"ShowSendersName")),o.ZP.createElement(We.Z,{icon:u?"message-succeeded":void 0,customIcon:u?void 0:o.ZP.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>b({noAuthors:!0})},I(l>1?"HideSenderNames":"HideSendersName")),h&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(st.Z,null),o.ZP.createElement(We.Z,{icon:m?void 0:"message-succeeded",customIcon:m?o.ZP.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>C({noCaptions:!1})},I(l>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")),o.ZP.createElement(We.Z,{icon:m?"message-succeeded":void 0,customIcon:m?void 0:o.ZP.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>C({noCaptions:!0})},I(l>1?"Conversation.ForwardOptions.HideCaption":"HideCaption"))),o.ZP.createElement(st.Z,null),o.ZP.createElement(We.Z,{icon:"replace",onClick:D},I("ChangeRecipient")))))})));var lt=n(93219),dt=n(67146),ut=n(12420);const mt=e=>{const{isOpen:t}=e,n=(0,ze.Z)(He.gl.Extra,"DropArea",!t);return n?o.ZP.createElement(n,e):void 0};var ht=n(19830);const pt=e=>{const{isOpen:t}=e,n=(0,ze.Z)(He.gl.Extra,"InlineBotTooltip",!t);return n?o.ZP.createElement(n,e):void 0},gt=e=>{const{isOpen:t}=e,n=(0,ze.Z)(He.gl.Extra,"MentionTooltip",!t);return n?o.ZP.createElement(n,e):void 0};var Zt=n(49841);const ft=e=>{const{isOpen:t}=e,n=(0,ze.Z)(He.gl.Extra,"PollModal",!t);return n?o.ZP.createElement(n,e):void 0},vt=e=>{const{isOpen:t}=e,n=(0,ze.Z)(He.gl.Extra,"SendAsMenu",!t);return n?o.ZP.createElement(n,e):void 0},Pt=e=>{const{isOpen:t}=e,n=(0,ze.Z)(He.gl.Extra,"StickerTooltip",!t);return n?o.ZP.createElement(n,e):void 0};var Et=n(23522),yt=n(18360),bt=n(54659);const Ct=new RegExp(i.FM6,"i"),wt=(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)(),Z=(0,K.iD)((()=>{const e=(0,g.ZP)(i()),t=e.entities?.find((e=>e.type===ee.Vv.TextUrl));return p.current=e,t?.url||e.text.match(Ct)?.[0]}),[i],300,!0),f=(0,J.Z)(Z,[Z,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)(v),y=(0,yt.Z)(s,!0),b=(0,U.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(bt.Z,{message:S,inPreview:!0,theme:l}),o.ZP.createElement(tt.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 St=n(472),It=n(49204),Nt=n(70172);const Mt=e=>{const{isOpen:t}=e,n=(0,ze.Z)(He.gl.Extra,"DeleteMessageModal",!t);return n?o.ZP.createElement(n,e):void 0};var kt=n(36368),xt=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e}(xt||{});const Tt=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n,threadId:o,storyId:a,messageListType:r,isMobile:d,type:u}=t;const m=(0,c.Z1J)(e,n),h=n!==i.FVh?(0,c.kBx)(e,n):void 0,p=Boolean(h),g=(0,c.FM1)(e,n),Z=(0,s.YC)(n),f=p?(0,c.ccz)(e,h.id):void 0,v=Z?void 0:(0,c.x67)(e,n),P=(p||!Z)&&(0,c.FTG)(e,n,o),E=(0,c.qyA)(e,n,o),{language:y,shouldSuggestStickers:b,shouldSuggestCustomEmoji:C,shouldUpdateStickerSetOrder:w}=e.settings.byKey,S=e.emojiKeywords[i.pRL],I=y!==i.pRL?e.emojiKeywords[y]:void 0,N=P?P.id:void 0,M=N?(0,c.hjO)(e,n,N):void 0,{currentUserId:k}=e,x=v?v?.sendAsId||k:void 0,T=m?.sendAsPeerIds&&x&&(m.sendAsPeerIds.some((e=>e.id===x))?x:m?.adminRights?.anonymous?m?.id:void 0),A=T?(0,c.dyD)(e,T):void 0,R=!A&&T?(0,c.Z1J)(e,T):void 0,O=(0,c.uHr)(e,n),L=(0,c.nAc)(e,n),D=(0,c.jUK)(e),F=Boolean(D.storyViewer.storyId),B=(0,c.Btg)(e),$=n===B?.chatId&&o===B?.threadId&&r===B?.type&&!F,U=(0,c.dyD)(e,n),j=(U&&!(0,c.ccz)(e,U.id)?.noVoiceMessages)??!0,H=v?.slowMode,z=(0,c.wVz)(e),_="scheduled"===r?(0,c.hI0)(e,n):(0,c.saH)(e,n,o),Y=(0,c.Yyv)(e,n,o),V=a&&(0,c.JrV)(e,n,a),X=V&&"sentReaction"in V?V.sentReaction:void 0;return{availableReactions:"story"===u?e.availableReactions:void 0,topReactions:"story"===u?e.topReactions:void 0,isOnActiveTab:!D.isBlurred,editingMessage:(0,c.kKD)(e,n,o,r),replyingToId:Y,draft:(0,c.Mst)(e,n,o),chat:m,isChatWithBot:p,isChatWithSelf:g,isForCurrentMessageList:$,canScheduleUntilOnline:(0,c.Eh5)(e,n),isChannel:m?(0,s.eA)(m):void 0,isRightColumnShown:(0,c.Jf5)(e,d),isSelectModeActive:(0,c.CAb)(e),withScheduledButton:"thread"===r&&Boolean(E?.length),shouldSchedule:"scheduled"===r,botKeyboardMessageId:N,botKeyboardPlaceholder:M?.keyboardPlaceholder,isForwarding:n===D.forwardMessages.toChatId,pollModal:D.pollModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,groupChatMembers:v?.members,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:k,contentToBeScheduled:D.contentToBeScheduled,shouldSuggestStickers:b,shouldSuggestCustomEmoji:C,shouldUpdateStickerSetOrder:w,recentEmojis:e.recentEmojis,baseEmojiKeywords:S?.keywords,emojiKeywords:I?.keywords,inlineBots:D.inlineBots.byUsername,isInlineBotLoading:D.inlineBots.isLoading,chatBotCommands:v?.botCommands,botCommands:f?f.botInfo?.commands||!1:void 0,botMenuButton:f?.botInfo?.menuButton,sendAsUser:A,sendAsChat:R,sendAsId:T,editingDraft:_,requestedDraftText:O,requestedDraftFiles:L,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,c.taM)(e,n),theme:(0,c.Puy)(e),fileSizeLimit:(0,l.M)(e,"uploadMaxFileparts")*i.pJM,captionLimit:(0,l.M)(e,"captionLength"),isCurrentUserPremium:z,canSendVoiceByPrivacy:j,attachmentSettings:e.attachmentSettings,slowMode:H,currentMessageList:B,isReactionPickerOpen:(0,c.Io8)(e),canBuyPremium:!z&&!(0,c.oe5)(e),canPlayAnimatedEmojis:(0,c.W9H)(e),shouldCollectDebugLogs:e.settings.byKey.shouldCollectDebugLogs,sentStoryReaction:X,stealthMode:e.stories.stealthMode}}))((e=>{let{type:t,isOnActiveTab:n,dropAreaState:c,shouldSchedule:l,canScheduleUntilOnline:E,isReady:b,isMobile:C,onDropHide:w,onFocus:S,onBlur:M,editingMessage:te,chatId:ne,threadId:oe,storyId:ae,currentMessageList:ie,messageListType:re,draft:se,chat:ce,isForCurrentMessageList:le,isCurrentUserPremium:de,canSendVoiceByPrivacy:ue,isChatWithBot:me,isChatWithSelf:he,isChannel:pe,fileSizeLimit:we,isRightColumnShown:Le,isSelectModeActive:De,isReactionPickerOpen:Fe,isForwarding:Be,pollModal:$e,botKeyboardMessageId:He,botKeyboardPlaceholder:ze,inputPlaceholder:Ye,withScheduledButton:Ve,stickersForEmoji:Xe,customEmojiForEmoji:qe,groupChatMembers:We,topInlineBotIds:Ke,currentUserId:at,captionLimit:it,contentToBeScheduled:rt,shouldSuggestStickers:st,shouldSuggestCustomEmoji:yt,baseEmojiKeywords:bt,emojiKeywords:Ct,recentEmojis:Tt,inlineBots:At,isInlineBotLoading:Rt,botCommands:Ot,chatBotCommands:Lt,sendAsUser:Dt,sendAsChat:Ft,sendAsId:Bt,editingDraft:$t,replyingToId:Ut,requestedDraftText:jt,requestedDraftFiles:Ht,botMenuButton:zt,attachBots:_t,attachMenuPeerType:Yt,attachmentSettings:Vt,theme:Xt,slowMode:qt,shouldUpdateStickerSetOrder:Wt,editableInputCssSelector:Gt,editableInputId:Kt,inputId:Jt,className:Qt,availableReactions:en,topReactions:tn,canBuyPremium:nn,canPlayAnimatedEmojis:on,shouldCollectDebugLogs:an,sentStoryReaction:rn,stealthMode:sn,onForward:cn}=e;const{sendMessage:ln,clearDraft:dn,showDialog:un,forwardMessages:mn,openPollModal:hn,closePollModal:pn,loadScheduledHistory:gn,openChat:Zn,addRecentEmoji:fn,sendInlineBotResult:vn,loadSendAs:Pn,resetOpenChatWithDraft:En,callAttachBot:yn,addRecentCustomEmoji:bn,showNotification:Cn,showAllowedMessageTypesNotification:wn,openStoryReactionPicker:Sn,closeReactionPicker:In,sendStoryReaction:Nn}=(0,a.Sv)(),Mn=(0,$.Z)(),kn=(0,o.sO)(null),xn=(0,o.sO)(null),[Tn,An]=(0,Y.Z)(""),[Rn,On]=(0,o.eJ)(!1),Ln=(0,F.Z)(Gt),Dn=(0,o.sO)(),Fn=(0,j.Z)(c),{width:Bn}=P.Z.get(),$n="messageList"===t,Un="story"===t,jn=$n?ce?.sendAsPeerIds:void 0,Hn=jn&&(jn.length>1||!jn.some((e=>e.id===at))),[zn,_n,Yn]=(0,D.Z)(),Vn=(0,z.Z)(ne,oe),[Xn,qn,Wn]=(0,D.Z)(),[Gn,Kn,Jn]=(0,D.Z)(),Qn=!(!rn||!("emoticon"in rn))&&rn.emoticon===i.mzt.emoticon;(0,o.d4)(u.AU,[Tn]);const eo=(0,o.sO)(0),[to,no]=(0,H.Z)($n&&E,Yn);(0,q.Z)((()=>{On(!0)}),430),(0,o.d4)((()=>{$n||In()}),[$n,ae]),(0,o.d4)((()=>{Dn.current=void 0}),[ne]),(0,o.d4)((()=>{ne&&b&&!Un&&gn({chatId:ne})}),[b,ne,oe,Un]),(0,o.d4)((()=>{ne&&ce&&!jn&&b&&(0,s.ZV)(ce)&&Pn({chatId:ne})}),[ce,ne,b,Pn,jn]);const oo=(0,o.sO)(!1);(0,X.Z)((e=>{let[t,n]=e;oo.current=Boolean(ne===t&&jn&&!n)}),[ne,jn]);const[ao,io]=(0,o.eJ)([]),ro=Boolean(ao.length),[so,co]=(0,o.eJ)(void 0),{canSendStickers:lo,canSendGifs:uo,canAttachMedia:mo,canAttachPolls:ho,canAttachEmbedLinks:po,canSendVoices:go,canSendPlainText:Zo,canSendAudios:fo,canSendVideos:vo,canSendPhotos:Po,canSendDocuments:Eo}=(0,o.Ye)((()=>(0,s.H5)(ce,me,Un)),[ce,me,Un]),yo=!Zo&&!te,bo=(0,U.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kt;if(t===Kt&&yo)return;const n=window.getSelection();let o;if(o=t===Kt?document.querySelector(Gt):document.getElementById(t),n.rangeCount){const a=n.getRangeAt(0);if((0,x.R)(a,t))return(0,Z.tx)(e),void o.dispatchEvent(new Event("input",{bubbles:!0}))}An(`${Tn()}${e}`),(0,r.Yq)((()=>{(0,h.Z)(o)}))})),Co=(0,U.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kt;const n=(0,T.Z)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");bo(n,t)})),wo=(0,U.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kt;const n=(0,A.z)(e);bo(n,t)})),So=(0,U.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kt;bo((0,k.yR)(e),t)})),Io=(0,U.Z)((()=>{so&&(wo(so,Kt),co(void 0))})),{shouldSuggestCompression:No,shouldForceCompression:Mo,shouldForceAsFile:ko,handleAppendFiles:xo,handleFileSelect:To,onCaptionUpdate:Ao,handleClearAttachments:Ro,handleSetAttachments:Oo}=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:g}=(0,a.Sv)(),[Z,f]=(0,o.eJ)(!1),[v,P]=(0,o.eJ)(!1),[E,y]=(0,o.eJ)(void 0),b=(0,U.Z)((()=>{r(p.D),m()})),C=(0,U.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})))g({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,U.Z)((async(e,n)=>{C([...t,...await Promise.all(e.map((e=>I(e.name,e,{shouldSendAsSpoiler:n||void 0}))))])})),handleFileSelect:(0,U.Z)((async(e,t)=>{C(await Promise.all(e.map((e=>I(e.name,e))))),y(t)})),onCaptionUpdate:i,handleClearAttachments:b,handleSetAttachments:C,shouldForceCompression:v,shouldForceAsFile:Z}}({attachments:ao,setHtml:An,setAttachments:io,fileSizeLimit:we,chatId:ne,canSendAudios:fo,canSendVideos:vo,canSendPhotos:Po,canSendDocuments:Eo,insertNextText:Io}),[Lo,Do,Fo]=(0,D.Z)(),[Bo,$o,Uo]=(0,D.Z)(),[jo,Ho,zo]=(0,D.Z)(),[_o,Yo,Vo]=(0,D.Z)(),[Xo,qo,Wo]=(0,D.Z)(),[Go,Ko,Jo]=(0,D.Z)(),{startRecordingVoice:Qo,stopRecordingVoice:ea,pauseRecordingVoice:ta,activeVoiceRecording:na,currentRecordTime:oa,recordButtonRef:aa,startRecordTimeRef:ia}=(()=>{const e=(0,o.sO)(null),[t,n]=(0,o.eJ)(),a=(0,o.sO)(),[i,s]=(0,o.eJ)();(0,o.d4)((()=>{v.s$&&v.mh&&Ue()}),[]);const c=(0,U.Z)((async()=>{try{const{stop:t,pause:o}=await je((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,U.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,U.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,Oe.Z)(d):void 0),[t,d]),{startRecordingVoice:c,pauseRecordingVoice:l,stopRecordingVoice:d,activeVoiceRecording:t,currentRecordTime:i,recordButtonRef:e,startRecordTimeRef:a}})(),ra=le&&!Un;(0,B.Z)((()=>{Vn({type:"recordAudio"})}),ra?na&&i.o_S:void 0),(0,o.d4)((()=>{le&&!Un&&(na||Vn({type:"cancel"}))}),[na,le,Un,Vn]);const sa=(0,V.Y)(Boolean(te));(0,o.d4)((()=>{le&&!Un&&Tn()&&!sa.current&&Vn({type:"typing"})}),[Tn,sa,le,Un,Vn]);const ca=ce&&(0,s.Nl)(ce),{isEmojiTooltipOpen:la,closeEmojiTooltip:da,filteredEmojis:ua,filteredCustomEmojis:ma,insertEmoji:ha}=(0,Ce.Z)(Boolean(b&&n&&(Un||le)&&st&&!ro),Tn,An,void 0,Tt,bt,Ct),{isCustomEmojiTooltipOpen:pa,closeCustomEmojiTooltip:ga,insertCustomEmoji:Za}=(0,Ze.Z)(Boolean(b&&n&&(Un||le)&&yt&&!ro),Tn,An,Ln,kn,qe),{isStickerTooltipOpen:fa,closeStickerTooltip:va}=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||v.op&&n.length>8)return;if(!n.match(v.op?Te.Z:i.t8f))return;const o=(0,G._)(n);return o&&(v.op&&1===(0,Ae.Z)(o)||!v.op&&Boolean(n.match(Re)))?v.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(b&&n&&(Un||le)&&st&&lo&&!ro),Tn,Xe),{isMentionTooltipOpen:Pa,closeMentionTooltip:Ea,insertMention:ya,mentionFilteredUsers:ba}=(0,xe.Z)(Boolean($n&&b&&le&&!ro),Tn,An,Ln,kn,We,Ke,at),{isOpen:Ca,botId:wa,isGallery:Sa,switchPm:Ia,switchWebview:Na,results:Ma,closeTooltip:ka,help:xa,loadMore:Ta}=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 Ne;const t=function(e){return Me.innerHTML=e.replace(/<br>/g,"\n"),Me.querySelectorAll("[alt]").forEach((e=>{e.innerText||(e.innerText=e.getAttribute("alt"))})),Me.innerText}(e),n=t.match(Se);return n?ke(n[1],n[2],""===n[2]&&!t.match(Ie)):Ne}(t):Ne}),[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,U.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($n&&b&&le&&!ro),ne,Tn,At),{isOpen:Aa,close:Ra,filteredBotCommands:Oa}=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($n&&b&&le&&(Ot&&Ot?.length||Lt?.length)),Tn,Ot,Lt);(e=>{let{draft:t,chatId:n,threadId:s,getHtml:c,setHtml:l,editedMessage:d,isDisabled:u}=e;const{saveDraft:m,clearDraft:p,loadCustomEmojis:Z}=(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 P=Boolean(d),E=(0,U.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(u||P||!f.current)return;const t=c();t?m({chatId:e.chatId??n,threadId:e.threadId??s,draft:(0,g.ZP)(t)}):p({chatId:e.chatId??n,threadId:e.threadId??s})})),y=(0,Ee.Z)(i.r_R,!0,void 0,[n,s]);(0,Pe.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 p=t.entities?.map((e=>e.type===ee.Vv.CustomEmoji&&e.documentId)).filter(Boolean)||[];p.length&&Z({ids:p}),v.$b||(0,r.Yq)((()=>{const e=document.querySelector(i.Edp);e&&(0,h.Z)(e,!0)}))}),[n,s,t,c,l,d,u]),(0,o.d4)((()=>{if(!u)return()=>{P||E({chatId:n,threadId:s}),ye=!0,(0,r.i$)((()=>{ye=!1}))}}),[n,s,P,E,u]);const b=(0,V.Y)(n),C=(0,V.Y)(s);(0,o.d4)((()=>{if(u||ye)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,fe.Z)(E),(0,ve.Z)(E)})({draft:se,chatId:ne,threadId:oe,getHtml:Tn,setHtml:An,editedMessage:te,isDisabled:Un});const La=(0,U.Z)((function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||An(""),io(p.D),co(void 0),da(),ga(),va(),Ea(),C?setTimeout((()=>zo()),350):zo()})),[Da,Fa,Ba]=((e,t,n,c,l,d,u,m,p,Z,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&&Z?.text.length?Z:n.content.text,c=(0,A.z)(s);t(c),b(!0),(0,r.Yq)((()=>{const e=document.querySelector(i.Edp);e&&(0,h.Z)(e,!0)}))}),[n,f,Z,t]),(0,o.d4)((()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some((e=>be.has(e.type)));E({chatId:d,threadId:u,noWebPage:e})}),[d,u,n]),(0,o.d4)((()=>{if(n)return()=>{const t=(0,g.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,g.ZP)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some((e=>be.has(e.type)))&&!t.entities?.some((e=>be.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,U.Z)((()=>{p&&(0,r.i$)((()=>{t((0,A.z)(p)),(0,r.Yq)((()=>{const e=document.querySelector(i.Edp);e&&(0,h.Z)(e,!0)}))}))})),I=(0,U.Z)((()=>{c(),S()})),N=(0,U.Z)((()=>{const{text:t,entities:o}=(0,g.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,U.Z)((()=>{if(!n)return;const t=(0,g.ZP)(e()),o=t.text.length?t:void 0;P({chatId:d,threadId:u,type:m,text:o})}));return(0,fe.Z)(M),(0,ve.Z)(M),[N,I,y]})(Tn,An,te,La,qo,ne,oe,re,se,$t,Ut),$a=(0,V.Y)(La),Ua=(0,V.Y)(ea);(0,o.d4)((()=>()=>{Ua.current(),$a.current()}),[ne,oe,$a,Ua]);const ja=(0,U.Z)((()=>{const e=eo.current;Cn(e?{message:Mn("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:at,shouldReplaceHistory:!0}},actionText:Mn("Open")}:{message:Mn("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:Mn("PremiumMore")}),eo.current=Number(!e)})),Ha=(0,O.Z)((()=>Xn||!cn||Tn()&&!ro?te&&Ba?xt.Edit:!v.mh||na||Be||Tn()&&!ro?l?xt.Schedule:xt.Send:xt.Record:xt.Forward),[na,te,Tn,ro,Be,Xn,cn,Ba,l]),za=!l,{isContextMenuOpen:_a,handleContextMenu:Ya,handleContextMenuClose:Va,handleContextMenuHide:Xa}=(0,R.Z)(aa,!(Ha===xt.Send&&za)),{contextMenuPosition:qa,handleContextMenu:Wa,handleBeforeContextMenu:Ga,handleContextMenuHide:Ka}=(0,R.Z)(xn,!Un);(0,o.d4)((()=>{Fe||qa&&(Sn({peerId:ne,storyId:ae,position:qa}),Ka())}),[ne,Ka,Fe,ae,qa]),ge(le||Un,wo,Oo,co,te,!de&&!he,ja);const Ja=(0,U.Z)((()=>{te&&Fa()})),Qa=(0,U.Z)(((e,t)=>{const n=t?it:4096;if(e?.length>n){const t=e.length-n;return un({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0})),ei=(0,U.Z)((()=>{if(qt&&!ca){const e=document.querySelector(Gt),t=(0,f.bp)(),n=Dn.current&&Math.floor(t-Dn.current),o=qt.nextSendDate&&qt.nextSendDate>t;if(n&&n<qt.seconds||o){const a=o?qt.nextSendDate-t:qt.seconds-n;return un({data:{message:Mn("SlowModeHint",(0,m.k9)(a)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0})),ti=(0,U.Z)((e=>{let{attachments:t,sendCompressed:n=Vt.shouldCompress,sendGrouped:o=Vt.shouldSendGrouped,isSilent:a,scheduledAt:i}=e;if(!ie&&!ae)return;const{text:s,entities:c}=(0,g.ZP)(Tn());(s||t.length)&&Qa(s,!0)&&ei()&&(ln({messageList:ie,text:s,entities:c,scheduledAt:i,isSilent:a,shouldUpdateStickerSetOrder:Wt,attachments:N(t,n),shouldGroupMessages:o}),Dn.current=(0,f.bp)(),dn({chatId:ne,localOnly:!0}),(0,r.i$)((()=>{La()})))})),ni=(0,U.Z)(((e,t,n,o)=>{ti({attachments:ao,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:o})})),oi=(0,U.Z)((async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;if(!ie&&!ae)return;let n=ao;if(na){const e=await ea();if(e){const{blob:t,duration:o,waveform:a}=e;n=[await I("wonderful-voice-message.ogg",t,{voice:{duration:o,waveform:a}})]}}const{text:o,entities:a}=(0,g.ZP)(Tn());if(n.length)return void ti({attachments:n});if(!o&&!Be)return;if(!Qa(o))return;const i=document.querySelector(Gt);if(o){if(!ei())return;ln({messageList:ie,text:o,entities:a,scheduledAt:t,isSilent:e,shouldUpdateStickerSetOrder:Wt})}Be&&mn({scheduledAt:t,isSilent:e}),Dn.current=(0,f.bp)(),dn({chatId:ne,localOnly:!0}),v.cj&&i&&i===document.activeElement&&y(i),(0,r.i$)((()=>{La()}))})),ai=(0,U.Z)((()=>{"webApp"===zt?.type&&yn({chatId:ne,url:zt.url,threadId:oe})})),ii=(0,U.Z)((()=>{zo(),$o()})),ri=(0,U.Z)(((e,t,n)=>{if(e&&"queryId"in e){const{id:o,queryId:a,isSilent:i}=e;return void vn({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;ni(n,a,o,t)}else ln({...e,messageList:n,scheduledAt:t});else oi(Boolean(o),t)}));(0,L.Z)((e=>{let[t]=e;ie&&rt&&rt!==t&&to((e=>{ri(rt,e,ie)}))}),[rt,ie,ri,to]),(0,o.d4)((()=>{jt&&(An(jt),En(),(0,r.Yq)((()=>{const e=document.getElementById(Kt);(0,h.Z)(e,!0)})))}),[Kt,jt,En,An]),(0,o.d4)((()=>{Ht?.length&&(To(Ht),En())}),[To,Ht,En]);const si=(0,U.Z)(((e,t)=>{e.isFree||de||he?So(e,t):ja()})),ci=(0,U.Z)((e=>{si(e,i.nYf)})),li=(0,U.Z)(((e,t,n)=>{(ie||ae)&&(l||n?(_n(),to((n=>{Yn(),ri({gif:e,isSilent:t},n,ie),(0,r.i$)((()=>{La(!0)}))}))):(ln({messageList:ie,gif:e,isSilent:t}),(0,r.i$)((()=>{La(!0)}))))})),di=(0,U.Z)((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4?arguments[4]:void 0;(ie||ae)&&(e={...e,isPreloadedGlobally:!0},l||n?(_n(),to((n=>{Yn(),ri({sticker:e,isSilent:t},n,ie),(0,r.i$)((()=>{La(o)}))}))):(ln({messageList:ie,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:Wt&&a}),(0,r.i$)((()=>{La(o)}))))})),ui=(0,U.Z)(((e,t,n)=>{if(!ie&&!ae)return;l||n?to((n=>{ri({id:e.id,queryId:e.queryId,isSilent:t},n,ie)})):vn({id:e.id,queryId:e.queryId,isSilent:t,messageList:ie});const o=document.querySelector(Gt);v.cj&&o&&o===document.activeElement&&y(o),dn({chatId:ne,localOnly:!0}),(0,r.i$)((()=>{La()}))})),mi=(0,U.Z)((()=>{dn({chatId:ne,localOnly:!0}),(0,r.i$)((()=>{La()}))})),hi=(0,U.Z)((e=>{ie&&(l?(to((t=>{ri({poll:e},t,ie)})),pn()):(ln({messageList:ie,poll:e}),pn()))})),pi=(0,U.Z)((e=>{if(l)to((t=>{ri({...e,isSilent:!0},t,ie)}));else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1}=e;ni(t,n,!0)}else oi(!0)})),gi=(0,U.Z)((()=>{const e=document.querySelector(Gt);if(!C||e!==document.activeElement)return Uo(),zo(),void Yo();e?.blur(),setTimeout((()=>{Uo(),zo(),Yo()}),100)}));(0,o.d4)((()=>{yo&&An("")}),[yo,An,ao]);const Zi=(0,U.Z)((e=>{Co(e,i.nYf)})),fi=(0,U.Z)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Kt;const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,x.R)(n,e))return void document.execCommand("delete",!1)}An(function(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}(Tn()))})),vi=(0,U.Z)((()=>{fi(i.nYf)})),Pi=(0,U.Z)((()=>{Zn({id:ne,threadId:oe,type:"scheduled",noForumTopicPanel:!0})}));(0,o.d4)((()=>{Le&&C&&zo()}),[Le,zo,C]),(0,o.d4)((()=>{b&&(De?Ko():setTimeout((()=>{Jo()}),200))}),[De,Jo,Ko,b]);const Ei=me&&"webApp"===zt?.type&&!te,yi=(0,O.Z)((()=>Ei&&!Tn()&&!na),[Ei,Tn,na]),[bi,Ci]=(0,o.Ye)((()=>qt?.nextSendDate?["SlowModeWait",qt.nextSendDate]:sn?.activeUntil&&Un?["StealthModeActiveHint",sn.activeUntil]:[]),[Un,qt?.nextSendDate,sn?.activeUntil]),wi=Lo||jo||la||_o||Pa||Ca||Xo||Bo||Gn||fa||Aa||pa||yi||_a||Boolean(na)||ao.length>0||Xn,Si=wi&&!Fe&&Un&&!Gn&&!jo;(0,o.d4)((()=>{wi?S?.():M?.()}),[wi,M,S]);const{shouldRender:Ii,transitionClassNames:Ni}=(0,_.Z)(Si),Mi=!(Ha!==xt.Record||mo&&ue&&go),ki=(0,U.Z)((()=>{switch(Ha){case xt.Forward:cn?.();break;case xt.Send:oi();break;case xt.Record:Mi?ue?go||wn({chatId:ne}):Cn({message:Mn("VoiceMessagesRestrictedByPrivacy",ce?.title)}):Qo();break;case xt.Edit:Da();break;case xt.Schedule:if(na&&ta(),!ie)return;to((e=>{ri({},e,ie)}))}})),xi=(0,j.Z)(te,!0),Ti=te||xi,Ai=new Date;Ai.setSeconds(0),Ai.setMilliseconds(0);const Ri=new Date;Ri.setFullYear(Ri.getFullYear()+1);let Oi="SendMessage";switch(Ha){case xt.Forward:Oi="Forward";break;case xt.Edit:Oi="Save edited message";break;case xt.Record:Oi=mo?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const Li=(0,d.Z)("Composer",!De&&"shown",Go&&"hover-disabled",Rn&&"mounted",Qt),Di=(0,U.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&&!de&&!he)return void ja();const i=(0,g.ZP)((0,k.yR)(o));t=i.text,n=i.entities}ln({text:t,entities:n,isReaction:!0}),In()})),Fi=(0,U.Z)((e=>{Sn({peerId:ne,storyId:ae,position:e,sendAsMessage:!0})})),Bi=(0,U.Z)((()=>{const e=rn?void 0:i.mzt;Nn({peerId:ne,storyId:ae,containerId:(0,s.hl)(ne,ae),reaction:e})})),$i=(0,U.Z)((()=>{to((e=>{ri({},e,ie)}))})),Ui=(0,U.Z)((()=>{pi()})),ji=(0,U.Z)((()=>{ri({},i.t4X,ie)})),Hi=(0,U.Z)(((e,t)=>{to((n=>{ri({sendCompressed:e,sendGrouped:t},n,ie)}))})),zi=(0,U.Z)(((e,t)=>{pi({sendCompressed:e,sendGrouped:t})})),_i=Ha===xt.Edit?Da:Ha===xt.Schedule?$i:oi,Yi=me&&"commands"===zt?.type&&!te&&!1!==Ot&&!na;return o.ZP.createElement("div",{className:Li},$n&&mo&&b&&o.ZP.createElement(mt,{isOpen:c!==ut.t.None,withQuick:c===ut.t.QuickFile||Fn===ut.t.QuickFile,onHide:w,onFileSelect:To}),Ii&&o.ZP.createElement(St.Z,{topReactions:tn,allAvailableReactions:en,onToggleReaction:Di,isPrivate:!0,isReady:b,canBuyPremium:nn,isCurrentUserPremium:de,canPlayAnimatedEmojis:on,onShowMore:Fi,className:Ni}),o.ZP.createElement(_e,{chatId:ne,threadId:oe,canShowCustomSendMenu:za,attachments:ao,getHtml:Tn,isReady:b,shouldSuggestCompression:No,shouldForceCompression:Mo,shouldForceAsFile:ko,isForCurrentMessageList:le,isForMessage:$n,shouldSchedule:l,forceDarkTheme:Un,onCaptionUpdate:Ao,onSendSilent:zi,onSend:ni,onSendScheduled:Hi,onFileAppend:xo,onClear:Ro,onAttachmentsUpdate:Oo,onCustomEmojiSelect:ci,onRemoveSymbol:vi,onEmojiSelect:Zi}),o.ZP.createElement(ft,{isOpen:$e.isOpen,isQuiz:$e.isQuiz,shouldBeAnonymous:pe,onClear:pn,onSend:hi}),Ti&&o.ZP.createElement(Mt,{isOpen:Xo,isSchedule:"scheduled"===re,onClose:Wo,message:Ti}),o.ZP.createElement(vt,{isOpen:_o,onClose:Vo,chatId:ne,selectedSendAsId:Bt,sendAsPeerIds:jn,isCurrentUserPremium:de}),o.ZP.createElement(gt,{isOpen:Pa,filteredUsers:ba,onInsertUserName:ya,onClose:Ea}),o.ZP.createElement(et,{isOpen:Aa,withUsername:Boolean(Lt),botCommands:Oa,getHtml:Tn,onClick:mi,onClose:Ra}),o.ZP.createElement("div",{className:(0,d.Z)("composer-wrapper",Un&&"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"}))),$n&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(pt,{isOpen:Ca,botId:wa,isGallery:Sa,inlineBotResults:Ma,switchPm:Ia,switchWebview:Na,loadMore:Ta,isSavedMessages:he,canSendGifs:uo,isCurrentUserPremium:de,onSelectResult:ui,onClose:ka}),o.ZP.createElement(ct,{onClear:Ja,shouldForceShowEditing:Boolean(Ba&&te)}),o.ZP.createElement(wt,{chatId:ne,threadId:oe,getHtml:Tn,isDisabled:!po||ro})),o.ZP.createElement("div",{className:"message-input-wrapper"},$n&&o.ZP.createElement(o.ZP.Fragment,null,Ei&&o.ZP.createElement(ot,{isOpen:yi,text:zt.text,isDisabled:Boolean(na),onClick:ai}),Yi&&o.ZP.createElement(Ge.Z,{className:(0,d.Z)("bot-commands",Bo&&"activated"),round:!0,disabled:void 0===Ot,color:"translucent",onActivate:ii,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon icon-bot-commands-filled"})),Hn&&(Dt||Ft)&&o.ZP.createElement(tt.Z,{round:!0,color:"translucent",onClick:_o?Vo:gi,ariaLabel:Mn("SendMessageAsTitle"),className:(0,d.Z)("send-as-button",oo.current&&"appear-animation")},o.ZP.createElement(Nt.Z,{peer:Dt||Ft,size:"tiny"}))),(!yo||uo||lo)&&o.ZP.createElement(Et.Z,{chatId:ne,threadId:oe,isMobile:C,isReady:b,isSymbolMenuOpen:jo,openSymbolMenu:Ho,closeSymbolMenu:zo,canSendStickers:lo,canSendGifs:uo,isMessageComposer:$n,onGifSelect:li,onStickerSelect:di,onCustomEmojiSelect:si,onRemoveSymbol:fi,onEmojiSelect:Co,closeBotCommandMenu:Uo,closeSendAsMenu:Vo,isSymbolMenuForced:zn,canSendPlainText:!yo,inputCssSelector:Gt,idPrefix:t,forceDarkTheme:Un}),o.ZP.createElement(Zt.Z,{ref:kn,id:Jt,editableInputId:Kt,customEmojiPrefix:t,isStoryInput:Un,chatId:ne,canSendPlainText:!yo,threadId:oe,isReady:b,isActive:!ro,getHtml:Tn,placeholder:na&&Bn<=600?"":yo?Mn("Chat.PlaceholderTextNotAllowed"):ze||Ye||Mn("Message"),timedPlaceholderDate:Ci,timedPlaceholderLangKey:bi,forcedPlaceholder:xa,canAutoFocus:b&&le&&!ro&&$n,noFocusInterception:ro,shouldSuppressFocus:C&&jo,shouldSuppressTextFormatter:la||Pa||Ca,onUpdate:An,onSend:_i,onSuppressedFocus:zo,onFocus:qn,onBlur:Wn}),$n&&o.ZP.createElement(o.ZP.Fragment,null,Rt&&Boolean(wa)&&o.ZP.createElement(It.Z,{color:"gray"}),Ve&&o.ZP.createElement(tt.Z,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:Pi,ariaLabel:"Open scheduled messages"},o.ZP.createElement("i",{className:"icon icon-schedule"})),Boolean(He)&&!na&&!te&&o.ZP.createElement(Ge.Z,{className:Lo?"activated":"",round:!0,color:"translucent",onActivate:Do,ariaLabel:"Open bot command keyboard"},o.ZP.createElement("i",{className:"icon icon-bot-command"}))),na&&Boolean(oa)&&o.ZP.createElement("span",{className:"recording-state"},(0,m.rM)(oa-ia.current)),o.ZP.createElement(Je,{chatId:ne,threadId:oe,isButtonVisible:!na&&!te,canAttachMedia:mo,canAttachPolls:ho,canSendPhotos:Po,canSendVideos:vo,canSendDocuments:Eo,canSendAudios:fo,onFileSelect:To,onPollCreate:hn,isScheduled:l,attachBots:$n?_t:void 0,peerType:Yt,shouldCollectDebugLogs:an,theme:Xt,onMenuOpen:Kn,onMenuClose:Jn}),$n&&Boolean(He)&&o.ZP.createElement(nt,{messageId:He,isOpen:Lo,onClose:Fo}),$n&&Ot&&o.ZP.createElement(Qe,{isOpen:Bo,botCommands:Ot,onClose:Uo}),o.ZP.createElement(lt.Z,{key:`custom-emoji-tooltip-${Kt}`,chatId:ne,isOpen:pa,onCustomEmojiSelect:Za,addRecentCustomEmoji:bn,onClose:ga}),o.ZP.createElement(Pt,{key:`sticker-tooltip-${Kt}`,chatId:ne,threadId:oe,isOpen:fa,onStickerSelect:di,onClose:va}),o.ZP.createElement(ht.Z,{key:`emoji-tooltip-${Kt}`,isOpen:la,emojis:ua,customEmojis:ma,addRecentEmoji:fn,addRecentCustomEmoji:bn,onEmojiSelect:ha,onCustomEmojiSelect:ha,onClose:da}))),na&&o.ZP.createElement(tt.Z,{round:!0,color:"danger",className:"cancel",onClick:ea,ariaLabel:"Cancel voice recording"},o.ZP.createElement("i",{className:"icon icon-delete"})),Un&&!na&&o.ZP.createElement(tt.Z,{round:!0,className:"story-reaction-button",color:"secondary",onClick:Bi,onContextMenu:Wa,onMouseDown:Ga,ariaLabel:Mn("AccDescrLike"),ref:xn},rn&&o.ZP.createElement(kt.Z,{key:"documentId"in rn?rn.documentId:rn.emoticon,containerId:(0,s.hl)(ne,ae),reaction:rn,withEffectOnly:Qn}),(!rn||Qn)&&o.ZP.createElement("i",{className:(0,d.Z)("icon","icon-heart",Qn&&"story-reaction-heart"),"aria-hidden":!0})),o.ZP.createElement(tt.Z,{ref:aa,round:!0,color:"secondary",className:(0,d.Z)(Ha,"main-button",!b&&"not-ready",na&&"recording"),disabled:Mi,allowDisabledClick:!0,noFastClick:!0,ariaLabel:Mn(Oi),onClick:ki,onContextMenu:Ha===xt.Send&&za?Ya:void 0},o.ZP.createElement("i",{className:"icon icon-send"}),o.ZP.createElement("i",{className:"icon icon-microphone-alt"}),cn&&o.ZP.createElement("i",{className:"icon icon-forward"}),$n&&o.ZP.createElement("i",{className:"icon icon-schedule"}),$n&&o.ZP.createElement("i",{className:"icon icon-check"})),za&&o.ZP.createElement(dt.Z,{isOpen:_a,canSchedule:$n,canScheduleUntilOnline:E,onSendSilent:he?void 0:Ui,onSendSchedule:l?void 0:$i,onSendWhenOnline:ji,onClose:Va,onCloseAnimationEnd:Xa,isSavedMessages:he}),no)})))},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:I}=(0,a.Sv)(),N=(0,c.Z)(),M=(0,i.U)(N,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}),I({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:N.isRtl?"rtl":void 0},o.ZP.createElement(u.Z,{size:"tiny",peer:n,isSavedMessages:h}),o.ZP.createElement("h3",{className:"modal-title"},N(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)(N("ChatList.DeleteAndLeaveGroupConfirmation",M),["simple_markdown","emoji"])):r&&!n.isCreator||g||Z?o.ZP.createElement("p",null,(0,s.Z)(N("ChannelLeaveAlertWithName",M),["simple_markdown","emoji"])):o.ZP.createElement("p",null,(0,s.Z)(N("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},N("DeleteAndStop")),v&&o.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:k},P?(0,s.Z)(N("ChatList.DeleteForEveryone",P)):N("DeleteForAll")),!m&&n.isCreator&&o.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},N("DeleteForAll")),o.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:m?T:A},N(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},N("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:I,isSelectable:N,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),z=t.content.document,{fileName:_,size:Y,timestamp:V}=z,X=(0,s.K2)(z)||"",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)(z),ce=se?(0,r.DH)(t):void 0,le=se?z.previewBlobUrl:void 0,de=(0,m.Z)((0,r.Ti)(t,"pictogram"),!q),ue=T&&Boolean(z.mediaType)&&(i.wGh.has(z.mimeType)||i.oGt.has(z.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?$():me()})),pe=(0,u.Z)((()=>{L({shouldWarnAboutSvg:!j}),U(),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:_,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:N,isSelected:I,actionIcon:ue?(0,r.hC)(t)?"play":"eye":"download",onClick:he,onDateClick:A?ge:void 0}),o.ZP.createElement(g.Z,{isOpen:B,onClose:U,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:I,onClick:N}=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:$}=(0,c.m)(N);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&&$},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:I}):o.ZP.createElement(Z.Z,{lang:D,message:n,noEmoji:Boolean(T),translatedText:L,observeIntersectionForLoading:S,observeIntersectionForPlaying:I}):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:I,isSelectable:N,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),$=(0,h.Z)(!F),{shouldRender:U,transitionClassNames:j}=(0,p.Z)(S,void 0,!0),H=(0,s.Oh)(v),z=(0,s.yW)(f),_=(0,o.Ye)((()=>S&&k?`${(0,s.yW)(f*k)} / ${z}`:z),[S,f,z,k]),{width:Y,height:V}=(0,c.lE)(w),X=(0,a.Z)("File",C,w&&"smaller",T&&!I&&"interactive",M&&"file-is-selected");return o.ZP.createElement("div",{ref:O,className:X,dir:R.isRtl?"rtl":void 0},N&&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:I?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",$)})):o.ZP.createElement("div",{className:`file-icon ${H}`},v.length<=4&&o.ZP.createElement("span",{className:"file-ext",dir:"auto"},v)),U&&o.ZP.createElement("div",{className:(0,a.Z)("file-progress",H,j)},o.ZP.createElement(Z.Z,{progress:k,size:w?"s":"m",onClick:I?T:void 0})),T&&o.ZP.createElement("i",{className:(0,a.Z)("action-icon","icon",x?`icon-${x}`:"icon-download",U&&"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,_),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:I,noRtl:N,chat:M,onlineCount:k,areMessagesLoaded:x,topic:T,messagesCount:A,noStatusOrTyping:R,withStory:O,storyViewerOrigin:L,onClick:D}=e;const{loadFullChat:F,openMediaViewer:B,loadProfilePhotos:$}=(0,a.Sv)(),U=(0,u.Z)(),j=M&&(0,r.ZV)(M),H=Boolean(M?.isForum&&I&&T),{id:z,isMin:_,isRestricted:Y}=M||{};(0,o.d4)((()=>{z&&!_&&(C&&F({chatId:z}),y&&$({profileId:z}))}),[z,_,C,F,$,j,y]);const V=(0,m.Z)(((e,t)=>{M&&t&&(e.stopPropagation(),B({avatarOwnerId:M.id,mediaId:0,origin:"jumbo"===s?i.bZ.ProfileAvatar:i.bZ.MiddleHeaderAvatar}))})),X=(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:!N&&U.isRtl?"rtl":void 0,onClick:D},!l&&!H&&o.ZP.createElement(h.Z,{key:M.id,size:s,peer:M,withStory:O,storyViewerOrigin:L,storyViewerMode:"single-peer",onClick:y?V:void 0}),H&&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&&!Y)return o.ZP.createElement(p.Z,{className:"status",content:U("Updating")});if(!M)return;if(t)return o.ZP.createElement(f.Z,{typingStatus:t});if(H)return o.ZP.createElement("span",{className:"status",dir:"auto"},A?U("messages",A,"i"):(0,d.Z)(M.title));if(S)return o.ZP.createElement("span",{className:"status",dir:"auto"},U((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}(U,M),n=k?`, ${U("OnlineCount",k,"i")}`:void 0;return o.ZP.createElement("span",{className:"status"},X&&o.ZP.createElement("span",{className:"handle"},X),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),I=(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?I: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 I=(0,o.sO)(null),N=(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||I.current.focus()}),R),(0,o.d4)((()=>{h&&(0,i.WM)((()=>{I.current.focus(),I.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:N.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:I,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:I,lockedIds:N,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(!N?.length)return[s.D,n];const e=n.filter((e=>!N.includes(e)));return[N,e]}),[n,N]),F=(0,o.Ye)((()=>new Set(N)),[N]),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]),$=(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?.("")})),U=(0,d.Z)((e=>{const{value:t}=e.currentTarget;x?.(t)})),[j,H]=(0,c.Z)(A,B,Boolean(P)),z=(0,l.Z)();return o.ZP.createElement("div",{className:"Picker"},S&&o.ZP.createElement("div",{className:"picker-header custom-scroll",dir:z.isRtl?"rtl":void 0},L.map(((e,t)=>o.ZP.createElement(f.Z,{peerId:e,isMinimized:O&&t<n.length-5,forceShowSelf:M,onClick:$,clickArg:e}))),D.map(((e,t)=>o.ZP.createElement(f.Z,{peerId:e,isMinimized:O&&t+L.length<n.length-5,canClose:!0,onClick:$,clickArg:e}))),o.ZP.createElement(h.Z,{id:b,ref:R,value:P,onChange:U,placeholder:E||z("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:I});return o.ZP.createElement(p.Z,{key:e,className:(0,r.Z)("chat-item-clickable picker-list-item",I&&"chat-item"),disabled:F.has(e),allowDisabledClick:Boolean(T),onClick:()=>$(e),ripple:!0},I?void 0:t(),(0,i.YC)(e)?o.ZP.createElement(v.Z,{forceShowSelf:M,userId:e}):o.ZP.createElement(Z.Z,{chatId:e}),I?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{peerId:n,forceShowSelf:o}=t;if(!n)return{};const a=(0,r.Z1J)(e,n),i=(0,r.dyD)(e,n);return{chat:a,user:i,isSavedMessages:!o&&i&&i.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:I,noRtl:N,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)(),$=(0,d.Z)(),{id:U}=M||{};(0,o.d4)((()=>{U&&(b&&D({userId:U}),P&&B({profileId:U}))}),[U,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 z=A?A.customTitle||$(A.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return o.ZP.createElement("div",{className:"ChatInfo",dir:!N&&$.isRtl?"rtl":void 0},o.ZP.createElement(h.Z,{key:M.id,size:n,peer:M,isSavedMessages:x,withStory:y,storyViewerOrigin:L,storyViewerMode:"single-peer",onClick:P?j:void 0}),o.ZP.createElement("div",{className:"info"},z?o.ZP.createElement("div",{className:"info-name-title"},o.ZP.createElement(g.Z,{peer:M,withEmojiStatus:!I,emojiStatusSize:w,isSavedMessages:x,onEmojiStatusClick:O}),z&&o.ZP.createElement("span",{className:"custom-title"},z)):o.ZP.createElement(g.Z,{peer:M,withEmojiStatus:!I,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:$("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)($,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),I=n(6202),N=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,I.Z)(y),T=P&&a&&!E&&`photo${a.id}?size=c`,A=(0,I.Z)(T),R=P&&a&&E&&(0,r.Dk)(a),O=(0,I.Z)(R)||A,[L,D]=(0,S.Z)(),F=Boolean(O&&(!E||L)),B=(0,N.Z)(F),$=P&&!F&&!x&&a?.thumbnail?.dataUri,U=(0,w.Z)(a?.thumbnail?.dataUri,!$,g&&!u.vX),j=a||x||$;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,$?o.ZP.createElement("canvas",{ref:U,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 z=(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:z,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:I,avatarOwnerId:N,topic:M,messagesCount:k,userPersonalPhoto:B,userProfilePhoto:$,userFallbackPhoto:U,chatProfilePhoto:j}=e;const{loadFullUser:H,openMediaViewer:z,openPremiumModal:_}=(0,a.Sv)(),Y=(0,h.Z)(),{id:V}=s||{},{id:X}=C||{},q=s?.photos||C?.photos||d.D,W=(0,g.Z)(I),G=(0,g.Z)(N),K=(0,Z.Y)(I),[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===I&&(Q(!1),ne(W))}),[I,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)((()=>{z({avatarOwnerId:V||X,mediaId:te,origin:t?i.bZ.SettingsAvatar:i.bZ.ProfileAvatar})})),re=(0,p.Z)((()=>{V&&_({fromUserId:V})})),se=(0,p.Z)((()=>{oe||(Q(!0),ne(te-1))})),ce=(0,p.Z)((()=>{ae||(Q(!0),ne(te+1))}));if((0,o.d4)((()=>{const e=document.querySelector(`.${D}`);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&&U&&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:U,className:"IG9hcS9__jiZjU59BA1U",size:"mini"}),Y(U.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto"))),o.ZP.createElement(P.Z,{activeKey:te,name:ee},le),!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",C.membersCount??0,"i"):Y("Members",C.membersCount??0,"i")))));function le(e){const t=(!w&&q.length>0?q[te]:void 0)||B||$||j||U;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",peerId:m,photo:h,messageIds:p,storyId:g,onClose:Z,onCloseAnimationEnd:f}=e;const{reportMessages:v,reportPeer:P,reportProfilePhoto:E,reportStory:y,exitMessageSelectMode:b}=(0,a.Sv)(),[C,w]=(0,o.eJ)("spam"),[S,I]=(0,o.eJ)(""),N=(0,s.Z)((()=>{switch(n){case"messages":v({messageIds:p,reason:C,description:S}),b();break;case"peer":P({chatId:m,reason:C,description:S});break;case"media":E({chatId:m,photo:h,reason:C,description:S});break;case"story":y({peerId:m,storyId:g,reason:C,description:S})}Z()})),M=(0,s.Z)((e=>{w(e)})),k=(0,s.Z)((e=>{I(e.target.value)})),x=(0,r.Z)(),T=(0,o.Ye)((()=>[{value:"spam",label:x("lng_report_reason_spam")},{value:"violence",label:x("lng_report_reason_violence")},{value:"pornography",label:x("lng_report_reason_pornography")},{value:"childAbuse",label:x("lng_report_reason_child_abuse")},{value:"copyright",label:x("ReportPeer.ReasonCopyright")},{value:"illegalDrugs",label:"Illegal Drugs"},{value:"personalDetails",label:"Personal Details"},{value:"other",label:x("lng_report_reason_other")}]),[x]);if("messages"===n&&!p||"peer"===n&&!m||"media"===n&&(!m||!h)||"story"===n&&(!g||!m))return;const A=x("messages"===n?"lng_report_message_title":"ReportPeer.Report");return o.ZP.createElement(d.Z,{isOpen:t,onClose:Z,onEnter:t?N:void 0,onCloseAnimationEnd:f,className:(0,i.Z)("narrow","story"===n&&"component-theme-dark"),title:A},o.ZP.createElement(u.Z,{name:"report-message",options:T,onChange:M,selected:C}),o.ZP.createElement(l.Z,{label:x("lng_report_reason_description"),value:S,onChange:k}),o.ZP.createElement("div",{className:"dialog-buttons"},o.ZP.createElement(c.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:N},x("lng_report_button")),o.ZP.createElement(c.Z,{className:"confirm-dialog-button",isText:!0,onClick:Z},x("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:I,photo:N,video:M}=P,k=!n&&S&&(0,s.Z)(S,170),x=(0,i.Z)("WebLink scroll-item",!N&&!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},N&&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||I)&&o.ZP.createElement(m.Z,{isRtl:v.isRtl,className:"site-description",onClick:E},I||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:()=>u});var o=n(60748),a=n(4463),i=n(46752),r=n(80036),s=n(97184),c=n(6202),l=n(96459);const d="zSAQoiw2P8dHog4GGC6Y",u=(0,o.X$)((e=>{let{reaction:t,isLottie:n,className:u,particleSize:m,onEnded:h}=e;const p=(0,a.RK)(t.documentId),g=(0,c.Z)(n?void 0:p),Z=(0,o.Ye)((()=>s._G?Array.from({length:7}).map((()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;const t=(e/2+Math.random()*e*3)*(Math.random()>.5?1:-1),n=e+Math.random()*e*4;return`M 0 0 C 0 0 ${t} ${-n-e} ${t} ${n}`}(m))):[]),[m]);if(g||n)return o.ZP.createElement("div",{className:(0,i.Z)("CBuciapCXTFHGIT8QJjp",u),style:(0,r.Z)(Boolean(m)&&`--particle-size: ${m}px`)},Z.map(((e,a)=>{const i=`--offset-path: path('${e}');`;return n?o.ZP.createElement(l.Z,{documentId:t.documentId,className:d,style:i,withSharedAnimation:!0,size:m,onAnimationEnd:0===a?h:void 0}):o.ZP.createElement("img",{src:g,alt:"",className:d,style:i,draggable:!1,onAnimationEnd:0===a?h:void 0})})))}))},36368:(e,t,n)=>{n.d(t,{Z:()=>w});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",effect:"DUYRztiKh76RsdbcJpu8","animated-icon":"m6I0yrKxFYZrVajqEjYY",animatedIcon:"m6I0yrKxFYZrVajqEjYY",animating:"_sWZKdctR4GWBAZk5LvT",withEffectOnly:"bcQvAAQmccIErVUj7YDo"},y=1.5*l.Gw,b=6.5*l.Gw,C=l.Gw,w=(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:w=b,activeReactions:S,availableReactions:I,genericEffects:N,withEffects:M,withEffectOnly:k,shouldPause:x,shouldLoop:T,observeIntersection:A}=e;const{stopActiveReaction:R}=(0,a.Sv)(),O=(0,o.sO)(null),L="documentId"in n,D=(0,o.Ye)((()=>I?.find((e=>(0,i.Hl)(e.reaction,n)))),[I,n]),F=D?.centerIcon?.id,{customEmoji:B}=(0,g.Z)(L?n.documentId:void 0),$=(0,o.Ye)((()=>{if(!L)return D?.aroundAnimation?.id;if(!B)return;const e=I?.find((e=>e.reaction.emoticon===B.emoji))?.aroundAnimation?.id;return e}),[D,I,B,L]),U=(0,o.Ye)((()=>{if($)return $;if(!N?.stickers)return;const{stickers:e}=N;return e[Math.floor(Math.random()*e.length)].id}),[$,N]),j=(0,u.Op)(O,A),H=F&&`sticker${F}`,z=U&&`sticker${U}`,_=(0,h.Z)(H,!F),Y=(0,h.Z)(z,!U),V=(0,o.Ye)((()=>S?.find((e=>(0,i.Hl)(e,n)))),[S,n]),X=Boolean(M&&V&&(L||_)&&Y),q=j&&(X&&!k||T),{shouldRender:W,transitionClassNames:G}=(0,p.Z)(X,void 0,!0,"slow"),{shouldRender:K,transitionClassNames:J}=(0,p.Z)(q,void 0,!0,"slow"),Q=(0,m.Z)((()=>{R({containerId:t,reaction:n})})),[ee,te,ne]=(0,d.Z)(),oe=!(L||q&&ee),{shouldRender:ae,transitionClassNames:ie}=(0,p.Z)(oe,void 0,!0),re=(0,s.Z)(E.root,W&&E.animating,k&&E.withEffectOnly,r);return o.ZP.createElement("div",{className:re,ref:O},!k&&ae&&o.ZP.createElement(v.Z,{className:ie,reaction:n,availableReactions:I,size:l,observeIntersection:A}),!k&&L&&o.ZP.createElement(f.Z,{documentId:n.documentId,className:E.customEmoji,size:l,noPlay:x,forceAlways:!0,observeIntersectionForPlaying:A}),K&&!L&&o.ZP.createElement(Z.Z,{key:`${F}-${l}`,className:(0,s.Z)(E.animatedIcon,J),size:(0,c.gO)(1.9*l),tgsUrl:_,play:j&&!x,noLoop:!T,forceAlways:!0,onLoad:te,onEnded:ne}),W&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(Z.Z,{key:`${U}-${w}`,className:(0,s.Z)(E.effect,G),size:w,tgsUrl:Y,play:j,noLoop:!0,forceAlways:!0,onEnded:Q}),L&&!$&&j&&o.ZP.createElement(P.Z,{reaction:n,className:G,particleSize:Math.max(.5*l,C),onEnded:Q})))})))},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)}())}))},40340:(e,t,n)=>{n.d(t,{Z:()=>ce});var o=n(60748),a=n(33555),i=n(91713),r=n(83716),s=n(46752),c=n(16974),l=n(82267),d=n(97184),u=n(13995),m=n(57710),h=n(87675),p=n(67360),g=n(25190),Z=n(95616),f=n(73541),v=n(27407),P=n(3657),E=n(61204),y=n(21273),b=n(34288),C=n(4463),w=n(60782),S=n(2155),I=n(32340),N=n(59107),M=n(95481),k=n(31876);const x={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"},T=(0,o.X$)((e=>{let{archiveSettings:t,onDragEnter:n,onClick:i}=e;const{updateArchiveSettings:c}=(0,a.Sv)(),l=(0,N.Z)(),d=(0,Z.d7)(r.WSp),u=(0,Z.yi)(),m=u[r.WSp]?.chatsCount,h=(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,C.U)(l,r);return o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("span",{className:(0,s.Z)(x.chat,m&&r.unreadCount&&x.unread)},(0,I.Z)(c)),i?"":", ")}))}),[d,l,m]),p=(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,w.oA)([e,n,o])}),[t.isMinimized,l,c]),g=(0,o.I4)((e=>{e.preventDefault(),n?.()}),[n]);return o.ZP.createElement(k.Z,{onClick:i,onDragEnter:g,className:(0,s.Z)(x.root,t.isMinimized&&x.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:x.button,contextActions:p,withPortalForMenu:!0},t.isMinimized?o.ZP.createElement("div",{className:(0,s.Z)(x.info,"info")},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement("div",{className:(0,s.Z)("title",x.title)},o.ZP.createElement("h3",{dir:"auto",className:(0,s.Z)(x.name,"fullName")},o.ZP.createElement("i",{className:(0,s.Z)(x.icon,"icon","icon-archive-filled")}),l("ArchivedChats"))),o.ZP.createElement(M.Z,{className:x.unreadCount,text:m?(0,S.bi)(m):void 0}))):o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("div",{className:(0,s.Z)("status",x.avatarWrapper)},o.ZP.createElement("div",{className:(0,s.Z)("Avatar",x.avatar)},o.ZP.createElement("i",{className:"icon icon-archive-filled"}))),o.ZP.createElement("div",{className:(0,s.Z)(x.info,"info")},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement("div",{className:(0,s.Z)("title",x.title)},o.ZP.createElement("h3",{dir:"auto",className:(0,s.Z)(x.name,"fullName")},l("ArchivedChats")))),o.ZP.createElement("div",{className:"subtitle"},o.ZP.createElement("div",{className:(0,s.Z)("status",x.chatsPreview)},h),o.ZP.createElement(M.Z,{className:x.unreadCount,text:m?(0,S.bi)(m):void 0})))))}));var A=n(6137),R=n(7054),O=n(15780),L=n(42797),D=n(41470),F=n(60706),B=n(65116),$=n(19369),U=n(7792);const j=new Map;(0,B.ll)((e=>{for(const[t,{setter:n}]of j)n(t(e))}));var H=n(31212),z=n(44499),_=n(70172),Y=n(40329),V=n(2153),X=n(76844),q=n(66534),W=n(50742),G=n(79347),K=n(77699);const J="mem3FdA38CqQltSSxUwi",Q=(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:J}),o.ZP.createElement("div",{className:J}),o.ZP.createElement("div",{className:J})))})),ee=(0,o.X$)((0,a.c$)(((e,t)=>{let{chatId:n}=t;const o=(0,R.Z1J)(e,n);if(!o)return{};const{senderId:a,replyToMessageId:i,isOutgoing:r}=o.lastMessage||{},s=a?(0,R.dyD)(e,a)||(0,R.Z1J)(e,a):void 0,c=o.lastMessage?(0,C.N5)(o.lastMessage):void 0,l=c&&i?(0,R.hjO)(e,o.id,i):void 0,{targetUserIds:d,targetChatId:u}=c||{},m=(0,C.zX)(o),{chatId:h,threadId:p,type:g}=(0,R.Btg)(e)||{},Z=n===h&&p===A._f,f=o.isForum&&n===h||n===(0,R.jUK)(e).forumPanelChatId,v=m?(0,R.dyD)(e,m):void 0,P=m?(0,R.ssc)(e,m):void 0,E=o.lastMessage&&(0,R.p$s)(e,o.lastMessage),y=(0,R.WPz)(e,n,A._f,"typingStatus");return{chat:o,isMuted:(0,C.i4)(o,(0,R.dZI)(e),(0,R.NJL)(e)),lastMessageSender:s,actionTargetUserIds:d,actionTargetChatId:u,actionTargetMessage:l,draft:(0,R.Mst)(e,n,A._f),isSelected:Z,isSelectedForum:f,isForumPanelOpen:(0,R.nd)(e),canScrollDown:Z&&"thread"===g,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,...r&&o.lastMessage&&{lastMessageOutgoingStatus:(0,R.dTW)(e,o.lastMessage)},user:v,userStatus:P,lastMessageTopic:E,typingStatus:y,withInterfaceAnimations:(0,R.FOo)(e)}}))((e=>{let{chatId:t,folderId:n,orderDiff:r,animationType:c,isPinned:l,observeIntersection:u,chat:m,isMuted:h,user:p,userStatus:Z,actionTargetUserIds:f,lastMessageSender:v,lastMessageOutgoingStatus:E,actionTargetMessage:y,actionTargetChatId:b,offsetTop:w,draft:S,withInterfaceAnimations:I,isSelected:N,isSelectedForum:M,isForumPanelOpen:x,canScrollDown:T,canChangeFolder:B,lastMessageTopic:J,typingStatus:ee,onDragEnter:te}=e;const{openChat:ne,focusLastMessage:oe,loadTopics:ae,openForumPanel:ie,closeForumPanel:re}=(0,a.Sv)(),{isMobile:se}=(0,L.ZP)(),[ce,le,de]=(0,F.Z)(),[ue,me,he]=(0,F.Z)(),[pe,ge,Ze]=(0,F.Z)(),[fe,ve,Pe]=(0,F.Z)(),[Ee,ye,be]=(0,F.Z)(),[Ce,we,Se]=(0,F.Z)(),[Ie,Ne,Me]=(0,F.Z)(),[ke,xe,Te]=(0,F.Z)(),{lastMessage:Ae,isForum:Re}=m||{},{renderSubtitle:Oe,ref:Le}=(0,z.Z)({chat:m,chatId:t,lastMessage:Ae,typingStatus:ee,draft:S,actionTargetMessage:y,actionTargetUserIds:f,actionTargetChatId:b,lastMessageTopic:J,lastMessageSender:v,observeIntersection:u,animationType:c,withInterfaceAnimations:I,orderDiff:r}),De=function(e){let t=j.get(e);if(!t){const[n,o]=(0,$.gQ)(e((0,a.Rd)()));t={clientsCount:0,getter:n,setter:o},j.set(e,t)}return(0,U.Z)((()=>(t.clientsCount++,()=>{t.clientsCount--,t.clientsCount||j.delete(e)}))),t.getter}(R.hqL),Fe=(0,g.Z)((()=>{Re?x?re(void 0,{forceOnHeavyAnimation:!0}):ie({chatId:t},{forceOnHeavyAnimation:!0}):(ne({id:t,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),N&&T&&oe())})),Be=(0,g.Z)((e=>{e.preventDefault(),te?.(t)})),$e=(0,g.Z)((()=>{ye(),le()})),Ue=(0,g.Z)((()=>{we(),me()})),je=(0,g.Z)((()=>{Ne(),ge()})),He=(0,g.Z)((()=>{xe(),ve()})),ze=(0,D.Z)({chat:m,user:p,handleDelete:$e,handleMute:Ue,handleChatFolderChange:je,handleReport:He,folderId:n,isPinned:l,isMuted:h,canChangeFolder:B}),_e=(0,P.Op)(Le,m?u:void 0);(0,o.d4)((()=>{_e&&Re&&m&&void 0===m.listedTopicIds&&ae({chatId:t})}),[m,t,Re,_e]);const Ye=p&&Z&&(0,C.kM)(p,Z),{hasShownClass:Ve}=(0,H.Z)(Ye);if(!m)return;const Xe=p||m,qe=(0,s.Z)("Chat chat-item-clickable",(0,C.YC)(t)?"private":"group",Re&&"forum",N&&"selected",M&&"selected-forum");return o.ZP.createElement(k.Z,{ref:Le,className:qe,href:d.IT?`#${(0,O.tB)(t,"thread",A._f)}`:void 0,style:`top: ${w}px`,ripple:!Re&&!se,contextActions:ze,onClick:Fe,onDragEnter:Be,withPortalForMenu:!0},o.ZP.createElement("div",{className:(0,s.Z)("status","status-clickable")},o.ZP.createElement(_.Z,{peer:Xe,isSavedMessages:p?.isSelf,withStory:!p?.isSelf,withStoryGap:Ve,storyViewerOrigin:i.ze.ChatList,storyViewerMode:"single-peer"}),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(K.Z,{chat:m,isMuted:h,shouldShowOnlyMostImportant:!0,forceHidden:De})),m.isCallActive&&m.isCallNotEmpty&&o.ZP.createElement(Q,{isMobile:se,isSelected:N,isActive:I})),o.ZP.createElement("div",{className:"info"},o.ZP.createElement("div",{className:"info-row"},o.ZP.createElement(V.Z,{peer:Xe,withEmojiStatus:!0,isSavedMessages:t===p?.id&&p?.isSelf,observeIntersection:u}),h&&o.ZP.createElement("i",{className:"icon icon-muted"}),o.ZP.createElement("div",{className:"separator"}),m.lastMessage&&o.ZP.createElement(X.Z,{message:m.lastMessage,outgoingStatus:E})),o.ZP.createElement("div",{className:"subtitle"},Oe(),o.ZP.createElement(K.Z,{chat:m,isPinned:l,isMuted:h}))),Ee&&o.ZP.createElement(Y.Z,{isOpen:ce,onClose:de,onCloseAnimationEnd:be,chat:m}),Ce&&o.ZP.createElement(G.Z,{isOpen:ue,onClose:he,onCloseAnimationEnd:Se,chatId:t}),Ie&&o.ZP.createElement(W.Z,{isOpen:pe,onClose:Ze,onCloseAnimationEnd:Me,chatId:t}),ke&&o.ZP.createElement(q.Z,{isOpen:fe,onClose:Pe,onCloseAnimationEnd:Te,peerId:t,subject:"peer"}))})));var te=n(45601),ne=n(231);const oe=(0,o.X$)((0,a.c$)(((e,t)=>{let{folderId:n,folderType:o}=t;return{chatFolder:n&&"folder"===o?(0,R.MwT)(e,n):void 0,animatedEmoji:(0,R.zB_)(e,"📂")}}))((e=>{let{chatFolder:t,animatedEmoji:n,foldersDispatch:a,onSettingsScreenSelect:r}=e;const s=(0,N.Z)(),{isMobile:c}=(0,L.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(te.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(ne.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"))))})));var ae=n(78722);const ie="D0dko7sVnw0KDtqjY0bH",re=(0,o.X$)((e=>{let{sessions:t,onHeightChange:n}=e;const{changeSessionSettings:i,terminateAuthorization:r,showNotification:s}=(0,a.Sv)(),c=(0,o.sO)(null),l=(0,N.Z)();(0,ae.Z)(c,(e=>{const t=e.borderBoxSize?.[0]?.blockSize||e.contentRect.height;n(t)}));const d=(0,o.Ye)((()=>Object.values(t).sort(((e,t)=>t.dateCreated-e.dateCreated)).find((e=>e.isUnconfirmed))),[t]),u=(0,o.Ye)((()=>[d.deviceModel,d.region,d.country].filter(Boolean).join(", ")),[d]),m=(0,g.Z)((()=>{i({hash:d.hash,isConfirmed:!0})})),h=(0,g.Z)((()=>{r({hash:d.hash}),s({title:l("UnconfirmedAuthDeniedTitle",1),message:l("UnconfirmedAuthDeniedMessageSingle",u)})}));return o.ZP.createElement("div",{className:"auVVCT950ajs6Uf4jI_w",ref:c},o.ZP.createElement("h2",{className:"RrIwnolHiQkojIfDEmg3"},l("UnconfirmedAuthTitle")),o.ZP.createElement("p",{className:"W7svz8CjmnPmDhwiz6cJ"},l("UnconfirmedAuthSingle",u)),o.ZP.createElement("div",{className:"lV9Uc02uJwQff0VQsKTj"},o.ZP.createElement(ne.Z,{fluid:!0,isText:!0,size:"smaller",className:ie,onClick:m},l("UnconfirmedAuthConfirm")),o.ZP.createElement(ne.Z,{fluid:!0,isText:!0,size:"smaller",color:"danger",onClick:h,className:ie},l("UnconfirmedAuthDeny"))))})),se=new Set(["9","0"]),ce=(0,o.X$)((e=>{let{folderType:t,folderId:n,isActive:C,isForumPanelOpen:w,canDisplayArchive:S,archiveSettings:I,sessions:N,foldersDispatch:M,onSettingsScreenSelect:k,onLeftColumnContentChange:x}=e;const{openChat:A,openNextChat:R,closeForumPanel:O,toggleStoryRibbon:L}=(0,a.Sv)(),D=(0,o.sO)(null),F=(0,o.sO)(!1),[B,$]=(0,o.eJ)(0),U="archived"===t,j="all"===t,H=j?r.NfV:U?r.WSp:n,z=j&&S,_=(0,Z.d7)(H);(0,u.Z)(_);const Y=(_?.length||0)*r.rSj,V=z?I.isMinimized?r.RBO:r.rSj:0,{orderDiffById:X,getAnimationType:q}=(0,E.Z)(_),[W,G]=(0,v.Z)(void 0,_,void 0,r.t_F),K=(0,o.Ye)((()=>{const e=Object.values(N||{}),t=e.find((e=>e.isCurrent));return!(!t||(0,l.bp)()-t.dateCreated<r.I0B)&&j&&e.some((e=>e.isUnconfirmed))}),[j,N]);(0,o.d4)((()=>{K||$(0)}),[K]),(0,f.y)(C&&_?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),R({targetIndexDelta:-1,orderedIds:_})},"Alt+ArrowDown":e=>{e.preventDefault(),R({targetIndexDelta:1,orderedIds:_})}}:void 0),(0,o.d4)((()=>{if(C&&_&&d.RM)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((d.jm&&e.metaKey||!d.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||se.has(t))return;const n=z&&!I.isMinimized,o=n?-1:0,a=Number(t)+o-1;if(n&&-1===a)return void x(i.du.Archived);if(a>_.length-1)return;A({id:_[a],shouldReplaceHistory:!0})}}}),[I,C,x,A,R,_,z]);const{observe:J}=(0,P.S1)({rootRef:D,throttleMs:200}),Q=(0,g.Z)((()=>{x(i.du.Archived),O()})),te=(0,g.Z)((()=>{F.current?F.current=!1:Q()})),ne=(0,p.Z)((e=>{F.current?F.current=!1:A({id:e,shouldReplaceHistory:!0})}),[A],500,!0),ae=(0,g.Z)((e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top;n<t.width||o<t.y||(F.current=!0)})),ie=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),l=(0,o.sO)(0),u=(0,o.sO)(!1),Z=(0,g.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,d.s$||t||(0,h.n)(e.current),i.current=!0,r.current=1,s.current=!0,c.current=!0)})),f=(0,g.Z)((()=>{s.current&&a.current&&(a.current.style.display="none",s.current=!1)})),v=(0,g.Z)((()=>{if(!e.current)return;if(i.current)return void(i.current=!1);const o=e.current.scrollTop,d=o>r.current,h=o<r.current,p=0===o,g=Date.now()-l.current;if(a.current){if(p&&!s.current)return void(0,m.x4)(Z,[e.current,a.current]);(0,m.x4)(f,a.current)}h&&(c.current&&g>100||o<0&&u.current)?t?.():d&&o>0&&n?.(),r.current=o,c.current=p,l.current=Date.now(),u.current=d&&o<0})),P=(0,p.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,m.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]),d.cj?void 0:o.ZP.createElement("div",{ref:a,className:"overscroll-trigger",key:"overscroll-trigger"})}(D,(0,g.Z)((()=>{L({isShown:!0,isArchived:U})})),(0,g.Z)((()=>{L({isShown:!1,isArchived:U})})));return o.ZP.createElement(y.Z,{className:(0,s.Z)("chat-list custom-scroll",w&&"forum-panel-open"),ref:D,items:W,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:r.t_F,withAbsolutePositioning:!0,beforeChildren:ie,maxHeight:Y+V+B,onLoadMore:G,onDragLeave:ae},K&&o.ZP.createElement(re,{key:"unconfirmed",sessions:N,onHeightChange:$}),z&&o.ZP.createElement(T,{key:"archive",archiveSettings:I,onClick:Q,onDragEnter:te}),W?.length?function(){const e=_.indexOf(W[0]),t=(0,c.aE)(H)||0;return W.map(((a,i)=>{const s=e+i<t,l=B+V+(e+i)*r.rSj;return o.ZP.createElement(ee,{key:a,teactOrderKey:s?i:(0,c.jK)(a),chatId:a,isPinned:s,folderId:n,animationType:q(a),orderDiff:X[a],offsetTop:l,observeIntersection:J,onDragEnter:ne})}))}():W&&!W.length?o.ZP.createElement(oe,{folderId:n,folderType:t,foldersDispatch:M,onSettingsScreenSelect:k}):o.ZP.createElement(b.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),I=n(98799),N=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),$=n(60782),U=n(76844),j=n(2995),H=n(17551),z=n(31876),_=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:I,draft:N,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:N,actionTargetMessage:f,actionTargetUserIds:v,actionTargetChatId:P,lastMessageSender:E,lastMessageTopic:t,observeIntersection:h,isTopic:!0,typingStatus:I,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},I=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,N=r?{title:d("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:s}:void 0;return(0,$.oA)([b,w,C,S,I,N])}),[t,n,i,d,r,s,l])}({topic:t,chat:r,wasOpened:M,canDelete:Z,handleDelete:ae,handleMute:re});return o.ZP.createElement(z.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(U.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,{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:$}=(0,a.Sv)(),U=(0,o.sO)(null),j=(0,o.sO)(null),H=(0,o.sO)(null),{isMobile:z}=(0,Z.ZP)();(0,o.d4)((()=>{t&&!t.topics&&$({chatId:t.id})}),[t,$]);const[_,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&&$({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(!U.current)return;const e=(0,f.YW)();(0,h.L)(U.current,e),O?.(),oe?(ne.current=!0,U.current.style.transform="none"):(ne.current=!1,U.current.style.transform="")}))}),[oe,O,ae]),(0,o.d4)((()=>{if(g.$b)return(0,m.sf)(U.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:U,className:(0,d.Z)("GUOX6Q0XzHRhNZvBwjQ9",_&&"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(I.Z,{noAvatar:!0,className:"mzucaTAH77gNB1V006lS",chatId:t.id,onClick:W}),t&&o.ZP.createElement(N.Z,{chatId:t.id,threadId:i._f,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:z,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:()=>k});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),[I,N]=(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?N(Math.max(n,o)):N(void 0),S(n>o)}),[h,n]),o.ZP.createElement("div",{className:(0,c.Z)("gljGvMdlFlsKhrMPQ_xa",Z&&"RJ0NXk_lx9qewdoGgJsT",I&&"e4cE7B51DN3MrEY9WuKx"),dir:m.isRtl?"rtl":void 0,style:I?`--overwritten-width: ${I}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)),!I&&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(),!I&&!Z&&o.ZP.createElement("div",{className:b},o.ZP.createElement("div",{className:C}))))}));var I=n(45370),N=n(68729);const M=200;function k(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:k,orderDiff:x,withInterfaceAnimations:T,isTopic:A}=e;const R=(0,p.Z)(),O=(0,o.sO)(null),L=n&&(0,s.FT)(n);(0,h.Z)(Z,L?n.replyToMessageId:void 0,P);const D=n&&!(0,s.bf)(n)?(0,s.DH)(n):void 0,F=(0,g.Z)(n?(0,s.Ti)(n,"micro"):void 0),B=Boolean(n&&(0,s.Y5)(n)),$=(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(N.Z,{typingStatus:f});if(v?.text.length&&(!t?.isForum||A))return o.ZP.createElement("p",{className:"last-message",dir:R.isRtl?"auto":"ltr"},o.ZP.createElement("span",{className:"draft"},R("Draft")),(0,u.H)({text:v.text,entities:v.entities,isSimple:!0,withTranslucentThumbs:!0}));if(!n)return;if(L){const e=t&&((0,s.eA)(t)||n.senderId===n.chatId);return o.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:R.isRtl?"auto":"ltr"},(0,l.D)(R,n,e?void 0:b,e?t:void 0,$,P,C,y,{isEmbedded:!0},void 0,void 0))}const e=(0,s.zF)(R,Z,b);return o.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:R.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(I.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)}(R,n,w,F||D,B))}),[C,P,$,t,Z,v,L,B,A,R,n,b,y,F,D,w,f]);return(0,o.bt)((()=>{const e=O.current;if(T&&e){if(k===m.b.Opacity)e.style.opacity="0",(0,r.WM)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(k!==m.b.Move)return;e.style.transform=`translate3d(0, ${-x*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=""}))}),M+i.fK3)}}),[T,x,k]),{renderSubtitle:function(){return t?.isForum&&!A?o.ZP.createElement(S,{chat:t,renderLastMessage:U,observeIntersection:w}):U()},ref:O}}},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&&("isSelf"in r&&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 I=(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),I=(0,b.Z)((0,i.Ti)(t,"full")),N=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&&I?N?Z():h(await fetch(I).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:N,size:"jumbo"}),o.ZP.createElement("span",null,n()),o.ZP.createElement("span",{className:"action-message-button"},d(N?"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 N=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:$,requestConfetti:U}=(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 z=r<=0,[_,Y]=(0,m.Z)(z),V=Boolean(t.content.action?.text.startsWith("ActionGift")),X="suggestProfilePhoto"===t.content.action?.type&&t.content.action.photo;(0,o.d4)((()=>{z||setTimeout(Y,10*r)}),[r,Y,z]);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,U())}),[q,U]);const{transitionClassNames:G}=(0,g.Z)(_,void 0,z,!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:()=>{$({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(I,{message:t,renderContent:Q}),te&&o.ZP.createElement(N.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),I=!S&&Boolean((0,l.pkN)(e,n)),N=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),$=!(0,l.FOo)(e),U=Boolean((0,l.lpX)(e,n));return{noMenu:!1,isChannel:u,isRightColumnShown:C,canStartBot:I,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:$,canTranslate:(0,l.GDM)(e,n)&&!P?.isTranslationDisabled,isTranslating:U,translationLanguage:h,language:m,doNotTranslate:g,detectedChatLanguage:s.detectedLanguage,canUnblock:N}}))((e=>{let{chatId:t,threadId:n,noMenu:c,isMobile:l,isChannel:v,canStartBot:P,canRestartBot:y,canUnblock:C,canSubscribe:w,canSearch:S,canCall:I,canMute:N,canViewStatistics:M,canLeave:k,canEnterVoiceChat:x,canCreateVoiceChat:T,pendingJoinRequests:A,isRightColumnShown:R,isForForum:O,canExpandActions:L,shouldJoinToSend:D,shouldSendJoinRequest:F,noAnimation:B,canTranslate:$,isTranslating:U,translationLanguage:j,language:H,detectedChatLanguage:z,doNotTranslate:_,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(U?{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)((()=>U?re("ShowOriginalButton"):Ce("TranslateToButton",j)),[j,Ce,U,re]),Se=(0,o.Ye)((()=>{if(z)return Ce("DoNotTranslateLanguage",z)}),[Ce,z]),Ie=(0,h.Z)((()=>{te({chatId:t,isEnabled:!1}),ee({chatId:t,toLanguageCode:void 0})})),Ne=(0,h.Z)((()=>{ne({chatId:t})})),Me=(0,h.Z)((()=>{z&&(oe({doNotTranslate:[..._,z]}),ee({chatId:t,toLanguageCode:void 0}),J({message:Ce("AddedToDoNotTranslate",z)}))}));(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&&$&&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:Ne},re("Chat.Translate.Menu.To")),o.ZP.createElement(f.Z,null),z&&o.ZP.createElement(Z.Z,{icon:"hand-stop",onClick:Me},Se),o.ZP.createElement(Z.Z,{icon:"close-circle",onClick:Ie},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})),I&&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:I,canMute:N,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(){const e=document.querySelector(".RightHeader .SearchInput input");e?.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()})),I=(0,s.Z)((()=>{g(m?{bot:t,isFromSideMenu:!0}:{bot:t,chatId:d,threadId:u})})),N=(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:I,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:N,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:()=>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,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);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.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 N=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),$=n(72087);const U="input-scroller",j=140,H=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],z=(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:z,customEmojiPrefix:_,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),[Ie,Ne,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 $e=(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,N.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 I(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,N.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,_,re,V,X);const Ue=x?160:z?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(`.${U}`),n=Number(t.style.height.replace("px","")),o=Ee.current,{scrollHeight:a}=o,i=Math.min(a,Ue);if(i===n)return;const s=a>Ue;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 ze=(0,b.Z)((()=>{fe.current&&((0,E.zG)()?setTimeout(ze,350):(0,u.Z)(fe.current))})),_e=(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(`.${U}`).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),Ne()}function Xe(){ve.current&&window.clearTimeout(ve.current),ve.current=window.setTimeout(Ve,260)}(0,o.d4)((()=>{p.$b||ee&&ze()}),[w,ze,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)(ze))}),2e3,!0,!1);return(0,l.Z)({onTab:e})}),[ze]),(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",U),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:ze,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:$e}):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",U,"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($.Z,{isOpen:Ie,anchorPosition:ke,selectedRange:Te,setSelectedRange:Ae,onClose:_e}),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:I=i.Edp,openSymbolMenu:N,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:$}=(0,a.Sv)(),U=(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?.(),N();const e=U.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();_({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:I);h&&e===document.activeElement?(e?.blur(),setTimeout((()=>{O?.(),N()}),100)):N()})),W=(0,c.Z)((()=>U.current)),G=(0,c.Z)((()=>U.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)(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:U,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:$,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),[I,N,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)((()=>{I?C.current.focus():(x(""),A(!1))}),[I]),(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,N]);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))})),$=(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})),U=(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 z=(0,h.Z)((()=>{if(L.spoiler){const e=U();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=$();document.execCommand("insertHTML",!1,`<span class="spoiler" data-entity-type="${a.Vv.Spoiler}">${e}</span>`),y()})),_=(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=U();if(!P||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void D((e=>({...e,strikethrough:!1})))}const e=$();document.execCommand("insertHTML",!1,`<del>${e}</del>`),y()})),q=(0,h.Z)((()=>{if(L.monospace){const e=U();if(!P||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void D((e=>({...e,monospace:!1})))}const e=$(!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=U();if(!t||"A"!==t.tagName)return;return t.href=e,void y()}const t=$(!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:N,b:_,u:V,i:Y,m:q,s:X,p:z}[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,I&&"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&&I&&(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:z},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:_},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:N},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=/( |\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)=>{n.d(t,{R:()=>a});const o=5;function a(e,t){const{commonAncestorContainer:n}=e;let a=n,i=1;for(;a&&a.id!==t&&i<o;)a=a.parentElement,i++;return Boolean(a&&a.id===t)}},60130:(e,t,n)=>{n.d(t,{Z:()=>E});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=300,v=new RegExp(`(${s.Z.source})$`,"g"),P=new RegExp(`${i.t8f.source}$`,"g");function E(e,t,n,E,y,b){const{loadCustomEmojiForEmoji:C,clearCustomEmojiForEmoji:w}=(0,a.Sv)(),[S,I,N]=(0,g.Z)(!1),M=(0,m.CH)((()=>{const n=t();if(!e||!n||!E()?.collapsed)return;if(!n.match(d.op?s.Z:i.t8f))return;const o=(0,l.gJ)(y.current);return o.match(d.op?v:P)?.[0]}),[t,E,y,e],f),k=(0,h.Z)(M,[M,t,E],!0),x=(0,p.Z)((()=>Boolean(k())),[k]),T=Boolean(b?.length);(0,o.d4)((()=>{if(!e||!x)return;const t=k();t?T||C({emoji:d.op?t:t.match(/.+alt="(.+)"/)?.[1]}):w()}),[e,x,k,T,w,C]);const A=(0,Z.Z)((t=>{const o=k();if(!e||!o)return;const a=y.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(x&&T&&!S),closeCustomEmojiTooltip:I,insertCustomEmoji:A}}},28353:(e,t,n)=>{n.d(t,{Z:()=>T});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=36,I=2,N=300,M=(0,m.Z)((function(e,t,n){return e&&t.length?Object.values((0,d.q0)(e,t)).slice(0,n):u.D})),k=(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}})),x=(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 T(e,t,m){let T=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.R2F,A=arguments.length>4?arguments[4]:void 0,R=arguments.length>5?arguments[5]:void 0,O=arguments.length>6?arguments[6]:void 0;const[L,D,F]=(0,v.Z)(!1),[B,$]=(0,o.eJ)(),[U,j]=(0,o.eJ)(u.D),[H,z]=(0,o.eJ)(u.D);(0,o.d4)((()=>{function t(){$(b.emojis)}e&&(b?t():async function(){return E||(E=n.e(7501).then(n.t.bind(n,47501,19)),y=(await E).default,b=(0,c.NM)(y)),E}().then(t))}),[e]);const _=(0,Z.CH)((()=>{const n=t();return e&&n.includes(":")?(0,g._)(n).match(C)?.[0].trim():void 0}),[t,e],N),Y=(0,f.Z)(_,[_,t],!0),V=(0,P.Z)((e=>{if(j(e),e===u.D)return void z(u.D);const t=e.map((e=>e.native)),n=(0,d.od)((0,s.iXW)((0,a.Rd)(),t),"id");z(n)})),X=(0,P.Z)((function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const o=t();if(!o)return;const a=o.lastIndexOf(":",n?o.lastIndexOf(":")-1:void 0);if(-1!==a){const t="string"==typeof e?(0,h.Z)(e,["emoji_html"]):(0,p.yR)(e);m(`${o.substring(0,a)}${t}`);const n=T===i.R2F?document.querySelector(i.Edp):document.getElementById(T);(0,r.Yq)((()=>{(0,l.Z)(n,!0,!0)}))}V(u.D)}));return(0,o.d4)((()=>{const e=Y();if(!e||!B)return void V(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>=I){const e=k(B,R,O);o=x(e,n.toLowerCase(),S)}}else o=M(B,A,S);o.length?t?X(o[0].native,!0):V(o):V(u.D)}),[R,B,Y,O,X,A,V]),(0,o.d4)(F,[F,t]),{isEmojiTooltipOpen:Boolean(U.length||H.length)&&!L,closeEmojiTooltip:D,filteredEmojis:U,filteredCustomEmojis:H,insertEmoji:X}}},29295:(e,t,n)=>{n.d(t,{Z:()=>v});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);const Z=300;let f;try{f=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){f=/(^|\s)@[-_\d\wа-яёґєії]*$/gi}function v(e,t,n,v,E,y,b,C){const[w,S]=(0,o.eJ)(),[I,N,M]=(0,p.Z)(!1),k=(0,m.CH)((()=>{const n=t();if(!e||!v()?.collapsed||!n.includes("@"))return;const o=(0,d.gJ)(E.current);return(0,u._)(o).match(f)?.[0].trim()}),[e,t,v,E],Z),x=(0,h.Z)(k,[k,t,v],!0),T=(0,h.Z)((()=>e&&t().startsWith("@")),[t,e]);(0,o.d4)((()=>{const e=x();if(!e||!y&&!b)return void S(void 0);const t=(0,a.Rd)().users.byId;if(!t)return void S(void 0);const n=y?.reduce(((e,t)=>(t.userId!==C&&e.push(t.userId),e)),[]),o=e.substring(1),i=(0,s.kK)((0,l.Tw)([...T()&&b||[],...n||[]]),t,o);S(Object.values((0,l.q0)(t,i)))}),[C,y,b,x,T]);const A=(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=E.current,m=P((0,d.gJ)(u)),h=m.lastIndexOf("@"),p=(o?o.length+1:a.length)-(m.length-h);if(-1!==h){const e=`${m.substr(0,h)}${l} `,o=P(u.innerHTML).substring(m.length),a=(0,d.qK)(u);n(`${e}${o}`),(0,r.Yq)((()=>{const e=a+p+1;(0,c.Z)(u,t),e>=0&&(0,d.Mq)(u,e)}))}S(void 0)}));return(0,o.d4)(M,[M,t]),{isMentionTooltipOpen:Boolean(w?.length&&!I),closeMentionTooltip:N,insertMention:A,mentionFilteredUsers:w}}function P(e){return e.replace(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},93609:(e,t,n)=>{n.d(t,{Z:()=>f});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),Z=n(42175);const f=(0,o.X$)((function(e){let{story:t,isPreview:n,isProtected:f,isConnected:v}=e;const{openStoryViewer:P,loadPeerStoriesByIds:E,showNotification:y}=(0,a.Sv)(),b=(0,m.Z)(),{isMobile:C}=(0,l.ZP)(),w=t&&"isDeleted"in t,S=t&&"content"in t,I=S?t.content.video:void 0,N=S?(0,i.Cc)(t):void 0,M=(0,p.Z)(N),k=S?I?I.thumbnail?.dataUri:t.content.photo?.thumbnail?.dataUri:void 0,x=(0,u.Z)(M,!0),{shouldRender:T,transitionClassNames:A}=(0,g.Z)(Boolean(x)),R=(0,d.Z)(k,w&&!n,C&&!c.vX),O=(0,r.Z)("u1iXUR7f9a1fJ3oKj6UR","media-inner",(!v||w)&&"sM8Yb5GJn63Lqe7WGyxs",w&&"GU6ftk8mOSKG68G3clJz",n&&"PdT0BgaOGO3KQ6uAMywg");(0,o.d4)((()=>{!t||S||w||E({peerId:t.peerId,storyIds:[t.id]})}),[t,w,S]);const L=(0,h.Z)((()=>{w?y({message:b("StoryNotFound")}):P({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})}));return o.ZP.createElement("div",{className:O,onClick:v?L:void 0},!w&&n&&o.ZP.createElement("canvas",{ref:R,className:"thumbnail blurred-bg"}),T&&o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement("img",{src:x,alt:"",className:(0,r.Z)("bCVEWkiPlJ2vOFKdsOZn",n&&"VjvrVyctay2XnrWkF6Pm",A),draggable:!1}),S&&o.ZP.createElement(Z.Z,{story:t,className:A})),w&&o.ZP.createElement("span",null,o.ZP.createElement("i",{className:(0,r.Z)("C6JcJFH05QLPlgncYbFX","icon icon-story-expired"),"aria-hidden":!0}),b("StoryExpiredSubtitle")),Boolean(I?.duration)&&o.ZP.createElement("div",{className:"message-media-duration"},(0,s.k9)(I.duration)),f&&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:I,uploadProgress:N,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 $=(0,o.sO)(null),U=(0,r.O$)(n)||(0,r.F$)(n),j=U.blobUrl,H=(0,m.Op)($,b),{isMobile:z}=(0,d.ZP)(),[_,Y]=(0,o.eJ)(w),V=_&&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)(U.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,N||(O?ie:q),V&&!W),le=!1===(0,f.Z)(_),{shouldRender:de,transitionClassNames:ue}=(0,v.Z)(se,void 0,le,"slow"),{shouldRender:me,transitionClassNames:he}=(0,v.Z)(!W&&!_),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&&$.current.closest(a.be_).removeAttribute(a.s22));const n=$.current.closest(a.be_);W?(0,c.Z)(W,ge,I,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,I,D]);const{width:Ze,height:fe,isSmall:ve}=x||(0,l.GH)(n,T,C,z),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:$,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]),I=(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:I},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:I,noAvatars:N,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),$=(0,o.sO)(null),U=(0,i.b7)(n)||(0,i.Cg)(n),j=U.blobUrl,[H,,z]=(0,h.Z)(U.isSpoiler),_=(0,p.Op)(B,S),Y=(0,p.Op)(B,I)&&_,V=(0,o.sO)(_);Y&&!V.current&&(V.current=!0);const{isMobile:X}=(0,m.ZP)(),[q,W]=(0,o.eJ)(M),G=Boolean(q&&_),[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=_,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)($,!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:Ie}=(0,E.Z)(be&&!Pe,void 0,we),{transitionClassNames:Ne}=(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($.current?.duration)?$.current?.duration:U.duration)||0,Ae=(0,i.B4)(n),Re=Boolean((0,i.Cg)(n)),{width:Oe,height:Le}=A||(0,l.GC)(U,Ae,R,Re,N,X),De=(0,g.Z)((()=>{ye?F?.(n):O?(0,a.Sv)().cancelMessageMediaDownload({message:n}):oe?(oe&&!K&&J(!0),H?z():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:$,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",Ne)}),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",Ie)},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"},U.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:I,story:N,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?.peerId,F?.id,N),!A)return;const{siteName:B,url:$,displayUrl:U,title:j,description:H,photo:z,video:_,type:Y}=A,V="telegram_story"===Y,X=b||N&&"isDeleted"in N?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"lng_view_button_story";case"telegram_channel_boost":return"lng_view_button_boost";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",_&&"with-video",!W&&"no-article",X&&"with-quick-button");return o.ZP.createElement("div",{className:J,"data-initial":(B||U)[0],dir:"auto"},o.ZP.createElement("div",{className:(0,r.Z)("WebPage--content",V&&"is-story")},V&&o.ZP.createElement(Z.Z,{story:N,isProtected:S,isConnected:I,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:$,text:B||U}),!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&&_&&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:()=>u,Pw:()=>d,Vx:()=>s,Xo:()=>l});var o=n(4463),a=n(74399);const i=12,r=40,s=20*a.Gw,c=i*a.Gw,l=5*a.Gw;function d(e,t){return(e?.length??0)>r||t?s:c}function u(e,t,n,r){const s=(0,o.B4)(e),c=(0,o.O$)(e)||(0,o.F$)(e),u=(0,o.b7)(e),m=Boolean((0,o.F$)(e)),h=Boolean((0,o.Cg)(e)),{width:p,height:g}=c?(0,a.Eh)(c,s,t,m,n,r):(0,a.GC)(u,s,t,h,n,r),Z=d((0,o.UD)(e));let f=1;p<Z&&Z-p<i&&(f=Z/p),g*f<l&&l-g*f<i&&(f=l/g);const v=Math.round(p*f),P=Math.round(g*f);return{width:v,height:P,isSmall:v<Z||P<l}}},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:()=>l});var o=n(60748),a=n(57710),i=n(81740);const r=500,s=750,c=20;function l(e,t,n,l,d,u,m){const h=(0,o.sO)(!m);(0,o.bt)((()=>{const t=h.current;if(h.current=!1,n&&e.current){const n=e.current.closest(".MessageList"),o=d,m=()=>(0,i.ZP)(n,e.current,o?"end":"centerOrTop",c,void 0!==l?o?r:s:void 0,l,void 0,u,!0);t?(0,a.lT)(m):(0,a.i$)((()=>{(0,a.WM)(m())}))}}),[e,t,n,l,d,u])}},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{peer: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),w="isSelf"in t&&t.isSelf,S=!(0,d.YC)(t.id);(0,g.Z)(t.id);const{isContextMenuOpen:I,contextMenuPosition:N,handleBeforeContextMenu:M,handleContextMenu:k,handleContextMenuClose:x,handleContextMenuHide:T}=(0,m.Z)(C),A=(0,h.Z)((()=>C.current)),R=(0,h.Z)((()=>document.body)),O=(0,h.Z)((()=>C.current.querySelector(".story-peer-context-menu .bubble"))),L=(0,h.Z)((()=>({withPortal:!0,isDense:!0}))),{positionX:D,positionY:F,transformOriginX:B,transformOriginY:$,style:U}=(0,p.Z)(N,A,R,O,L),j=(0,h.Z)((()=>{I||E({peerId:t.id,origin:l.ze.StoryRibbon})})),H=(0,h.Z)((e=>{(0,u.b)(e),M(e)})),z=(0,h.Z)((()=>{s({id:t.id,shouldReplaceHistory:!0,profileTab:"stories"})})),_=(0,h.Z)((()=>{s({id:t.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})})),Y=(0,h.Z)((()=>{r({id:t.id,shouldReplaceHistory:!0})})),V=(0,h.Z)((()=>{s({id:t.id,shouldReplaceHistory:!0})})),X=(0,h.Z)((()=>{y({peerId:t.id,isHidden:!n})}));return o.ZP.createElement("div",{ref:C,role:"button","data-peer-id":t.id,tabIndex:0,className:P.Z.peer,onMouseDown:H,onClick:j,onContextMenu:k},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)},w?b("MyStory"):(0,d.OU)(b,t)),void 0!==N&&o.ZP.createElement(f.Z,{isOpen:I,transformOriginX:B,transformOriginY:$,positionX:D,positionY:F,style:U,className:(0,i.Z)("story-peer-context-menu",P.Z.contextMenu),autoClose:!0,withPortal:!0,onClose:x,onCloseAnimationEnd:T},w?o.ZP.createElement(o.ZP.Fragment,null,o.ZP.createElement(v.Z,{onClick:z,icon:"play-story"},b("StoryList.Context.SavedStories")),o.ZP.createElement(v.Z,{onClick:_,icon:"archive"},b("StoryList.Context.ArchivedStories"))):o.ZP.createElement(o.ZP.Fragment,null,!S&&o.ZP.createElement(v.Z,{onClick:Y,icon:"message"},b("SendMessageTitle")),S?o.ZP.createElement(v.Z,{onClick:V,icon:"channel"},b("ChatList.ContextOpenChannel")):o.ZP.createElement(v.Z,{onClick:V,icon:"user"},b("StoryList.Context.ViewProfile")),o.ZP.createElement(v.Z,{onClick:X,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{orderedPeerIds:{active:o,archived:a}}=e.stories;return{orderedPeerIds:n?a:o,usersById:e.users.byId,chatsById:e.chats.byId}}))((function(e){let{isArchived:t,className:n,orderedPeerIds:a,usersById:l,chatsById:d,isClosing:u}=e;const m=(0,c.Z)(),h=(0,i.Z)(P.Z.root,!a.length&&P.Z.hidden,u&&P.Z.closing,n,"no-scrollbar"),p=(0,o.sO)(null);return(0,s.Z)(p,(0,r.W7)()),o.ZP.createElement("div",{ref:p,id:"StoryRibbon",className:h,dir:m.isRtl?"rtl":void 0},a.map((e=>{const n=l[e]||d[e];if(n)return o.ZP.createElement(E,{key:e,peer: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{orderedPeerIds:{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,orderedPeerIds:n?o:a,isShown:n?!s:!i,withAnimation:c,usersById:e.users.byId,chatsById:e.chats.byId}}))((function(e){let{currentUserId:t,orderedPeerIds:n,usersById:r,chatsById:g,canShow:Z,isShown:f,isArchived:v,withAnimation:P}=e;const{toggleStoryRibbon:E}=(0,a.Sv)(),y=(0,d.Z)(),b=(0,o.Ye)((()=>1===n.length?[r[n[0]]||g[n[0]]]:n.map((e=>r[e]||g[e])).filter((e=>e&&e.id!==t)).slice(0,i.Ob7).reverse()),[t,n,r,g]),C=(0,o.Ye)((()=>n.slice(0,5)),[n]);(0,m.Z)(C);const w=Z&&f,{shouldRender:S,transitionClassNames:I}=(0,u.Z)(w,void 0,void 0,"slow");if((0,o.d4)((()=>{P&&(w?((0,l.YW)(c.zn+i.fK3),(0,c.V$)(v)):((0,l.YW)(c.zn+i.fK3),(0,c.DO)(v)))}),[v,w,P]),S)return o.ZP.createElement("button",{type:"button",id:"StoryToggler",className:(0,s.Z)(p.Z.root,I),"aria-label":y("Chat.Context.Peer.OpenStory"),onClick:()=>E({isShown:!0,isArchived:v}),dir:y.isRtl?"rtl":void 0},b.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=.125*s.Gw,g=new Set;function Z(e){C();const{container:t,toggler:n,leftMainHeader:r,ribbonPeers:s,toggleAvatars:c}=v(e);if(!(n&&c&&s&&t&&r))return;const{bottom:p,right:Z}=r.getBoundingClientRect(),f=p+u,w=c[0],S=c[c.length-1],I=E(w);Array.from(s).reverse().forEach(((e,r,s)=>{let{length:c}=s;const u=E(e);if(!u)return;const p=u===I;let v=y(n,u),C=m+r+1;if(v||(v=r===c-1?S:w,C=m),!v)return;let{top:N,left:M,width:k}=v.getBoundingClientRect();const{left:x,width:T}=e.getBoundingClientRect();if(x>Z)return;M-=h,k+=2*h;const A=M-x,R=N-f,O=k/T;N-=h;const L=x-M+2*h,D=f-N+h,F=T/(k+2*h);(0,a.WM)((()=>{if(!v)return;const n=P(e);let r;C>m?(r=P(v),p&&r.classList.add(l.Z.ghostLast)):n.classList.add(l.Z.ghostAnimateName),(0,i.Zs)(n,{top:`${f}px`,left:`${x}px`,zIndex:`${C}`,opacity:r?"0":"",transform:`translate3d(${A}px, ${R}px, 0) scale(${O})`}),r&&(0,i.Zs)(r,{top:`${N}px`,left:`${M}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(${L}px, ${D}px, 0) scale(${F})`}):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,ribbonPeers: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),I=m+r+1;if(S||(S=r===c-1?f:Z,I=m),!S)return;const{top:N,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-N-p,L=T/k;A-=h;const D=M-x+2*h,F=N-A+h,B=k/(T+2*h);(0,a.WM)((()=>{const n=P(e);let r;I>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:`${N}px`,left:`${M}px`,width:`${k}px`,zIndex:`${I}`}),r&&(0,i.Zs)(r,{top:`${A}px`,left:`${x}px`,zIndex:`${I}`,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.peer}`),r=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:a,ribbonPeers: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");if(n){const e=t.querySelector("canvas");e?.getContext("2d")?.drawImage(n,0,0)}return 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.byPeerId[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.nST)((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])}},42175:(e,t,n)=>{n.d(t,{Z:()=>y});var o=n(60748),a=n(33555),i=n(83716),r=n(57710),s=n(46752),c=n(80036),l=n(74399),d=n(12255),u=n(4463),m=n(274),h=n(25190),p=n(78722),g=n(36368);const Z="qF5NAjzN826sfFvUwCi1",f=(0,o.X$)((e=>{let{story:t,mediaArea:n,index:i,className:r,style:d,isPreview:Z}=e;const{sendStoryReaction:f}=(0,a.Sv)(),v=(0,o.sO)(null),[P,E]=(0,o.eJ)(1.5*l.Gw),{peerId:y,id:b,reactions:C}=t,{reaction:w,isDark:S,isFlipped:I}=n,N=!(0,u.YC)(y),M=`${(0,u.hl)(y,b)}-${i}-${Z?"preview":"viewer"}`,k=(0,o.Ye)((()=>C?.find((e=>(0,u.Hl)(e.reaction,w)))?.count),[w,C]),x=!Z&&Boolean(k)&&N,T=(0,h.Z)((()=>{if(!v.current)return;const e=v.current.clientHeight;E(Math.round(.6*e))}));(0,m.Z)((e=>{let[t]=e;Boolean(k)!==Boolean(t)&&T()}),[k]),(0,p.Z)(v,T);const A=(0,h.Z)((()=>{f({peerId:y,storyId:b,containerId:M,reaction:w})}));return o.ZP.createElement("div",{ref:v,className:(0,s.Z)("K8z7QedYZHumSrLQCrZq",S&&"cKzIdSabAL8MJ9G60u77",r),style:(0,c.Z)(d,`--custom-emoji-size: ${P}px`),onClick:A},o.ZP.createElement("div",{className:(0,s.Z)("QxSGHD_yTaeyLhKS2qqz",I&&"CiCfsJ1VaeHZ624tudjv")}),o.ZP.createElement(g.Z,{className:(0,s.Z)("Oi4FupikW1BQIPXxj9a7",x&&"dCSRvNsQTjKPeBul8iIX"),reaction:w,containerId:M,size:P,effectSize:2*P,shouldPause:Z,shouldLoop:!Z}),x&&o.ZP.createElement("span",{className:"WAKY7bjrmisH3k1XFQMZ"},k))})),v=9/16,P=4*l.Gw;function E(e){const{x:t,y:n,width:o,height:a,rotation:i}=e.coordinates;return(0,c.Z)(`left: ${t}%`,`top: ${n}%`,`width: ${o}%`,`height: ${a}%`,`transform: rotate(${i}deg) translate(-50%, -50%)`)}const y=(0,o.X$)((e=>{let{story:t,isActive:n,className:c}=e;const{openMapModal:l}=(0,a.Sv)(),u=(0,o.sO)(null),m=(0,d.Z)();(0,o.d4)((()=>{if(!u.current||!n)return;const e=u.current;if(m.width>i.l35)return void(0,r.WM)((()=>{e.style.removeProperty("--media-width")}));const t=m.height-P,o=m.width/t>v?t*v:m.width;(0,r.WM)((()=>{e.style.setProperty("--media-width",`${o}px`)}))}),[n,m]);const h=t.mediaAreas;return o.ZP.createElement("div",{className:(0,s.Z)("oWM0Zdb5uhUcOVtc99aS",!n&&"dDrvIyufIoAgicpd5jBf",c),ref:u},h?.map(((e,a)=>{switch(e.type){case"geoPoint":case"venue":return o.ZP.createElement("div",{className:(0,s.Z)(Z,n&&"mHQ5t7g14fbpeDSyTLcd"),style:E(e),onClick:()=>(e=>{"geoPoint"!==e.type&&"venue"!==e.type||l({geoPoint:e.geo})})(e)});case"suggestedReaction":return o.ZP.createElement(f,{key:`${e.type}-${a}`,story:t,mediaArea:e,index:a,isPreview:!n,className:Z,style:E(e)});default:return}})))}))},13617:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(60748),a=n(33555),i=n(97184),r=n(59107),s=n(25190);const c=8e3;function l(e,t,n){const{showNotification:l}=(0,a.Sv)(),d=(0,r.Z)(),[u,m]=(0,o.eJ)(!1),h=(0,s.Z)((()=>{m(!0),t||l({message:i.q$?d("Video.Unsupported.Mobile"):d("Video.Unsupported.Desktop"),duration:c})})),p=(0,s.Z)((e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||h())})),g=(0,s.Z)((e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||h()}));return(0,o.d4)((()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",p),t.addEventListener("canplay",g),()=>{t.removeEventListener("error",p),t.removeEventListener("canplay",g)}):void 0}),[n,e]),u}},13995:(e,t,n)=>{n.d(t,{Z:()=>m});var o=n(60748),a=n(33555),i=n(4463),r=n(7054),s=n(69118);const c=36e5,l=new Map;let d=new Set;const u=(0,s.P2)((()=>{const e=Array.from(d),t=e.slice(0,100),n=e.slice(101);(0,a.Sv)().loadStoriesMaxIds({peerIds:t}),t.forEach((e=>l.set(e,Date.now()))),d=new Set(n),d.size&&u()}),500);function m(e){const t=(0,o.Ye)((()=>{const t=(0,a.Rd)();return e?.map((e=>(0,r.RGZ)(t,e))).filter(Boolean)}),[e]),n=(0,o.Ye)((()=>{const e=(0,a.Rd)();return t?.filter((t=>{const n=l.get(t.id)||0;if(Date.now()-n<c)return!1;if((0,i.YC)(t.id)){const n=t,o=(0,r.ssc)(e,n.id),a=o&&"userStatusEmpty"!==o.type;return!n.isContact&&!n.isSelf&&!(0,i.cS)(n)&&!t.isSupport&&a}{const e=t;return(0,i.eA)(e)}})).map((e=>e.id))}),[t]);(0,o.d4)((()=>{n?.length&&(n.forEach((e=>d.add(e))),u())}),[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){const n=r((()=>e()),[e],t,arguments.length>2&&void 0!==arguments[2]&&arguments[2]);return(0,a.Z)(n,[n,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){const n=c((()=>e()),[e],t,arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]&&arguments[3]);return(0,a.Z)(n,[n,e],!0)}},23186:(e,t,n)=>{n.d(t,{Z:()=>h});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);const h=function(e,t,n,h,p,g,Z){let f=arguments.length>7&&void 0!==arguments[7]&&arguments[7],v=arguments.length>8?arguments[8]:void 0,P=arguments.length>9?arguments[9]:void 0,E=arguments.length>10&&void 0!==arguments[10]&&arguments[10],y=arguments.length>11&&void 0!==arguments[11]&&arguments[11];const b=(0,o.sO)(null),[C,w]=(0,o.eJ)(!1);let S=C;const[I,N]=(0,o.eJ)(0),M=(0,u.Z)((()=>{w(!1),P&&P()}));(0,m.Z)((()=>{b.current=(0,s.z2)(e,n,((e,o)=>{switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:o,toggleMuted:s,proxy:l}=b.current;w(!0),(0,c.N)(g,function(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}(b)),(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}=b.current;(0,c.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":w(!1),(0,c.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=b.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;y||N(e.currentTime/n);break}case"onEnded":(0,c.pC)("paused")}p?.[e]?.(o)}),v,M);const{proxy:o}=b.current;C||o.paused||(w(!0),S=!0),Z&&Z(o)}),[e]),(0,o.d4)((()=>{C&&g&&(0,c.Ym)(g)}),[g,C]);const{play:k,pause:x,setCurrentTime:T,proxy:A,destroy:R,setVolume:O,stop:L,isFirst:D,isLast:F,requestNextTrack:B,requestPreviousTrack:$,setPlaybackRate:U,toggleMuted:j}=b.current,H=A.duration&&Number.isFinite(A.duration)?A.duration:t;(0,o.d4)((()=>{!H||(0,l.z)(A)||y||N(A.currentTime/H)}),[H,I,A,y]),(0,o.d4)((()=>()=>{R(E)}),[R,E]),(0,d.Z)((e=>{let[t,n]=e;t===f&&h===n||A.src&&A.paused||f&&h&&!C&&k(h)}),[f,h,C,k,A.src,A.paused]);const z=(0,u.Z)((()=>{h&&k(h)})),_=(0,u.Z)((()=>{C?x():z()})),Y=(0,u.Z)((e=>{T(e),H&&N(A.currentTime/H)}));return{isPlaying:S,playProgress:I,playPause:_,pause:x,play:z,stop:L,setCurrentTime:Y,setVolume:O,audioProxy:A,duration:H,requestNextTrack:B,requestPreviousTrack:$,isFirst:D,isLast:F,setPlaybackRate:U,toggleMuted:j}}},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:()=>d});var o=n(60748),a=n(96264),i=n(57710),r=n(97184),s=n(34446);const c=2,l=2;function d(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c,u=arguments.length>4?arguments[4]:void 0,m=arguments.length>5?arguments[5]:void 0;const h=(0,o.sO)(null),p=(0,o.sO)();return(0,s.Z)((()=>{t||(p.current=!1)}),[e,t]),(0,o.d4)((()=>{const o=h.current;if(!e||!o||t||p.current)return;p.current=!0;const s=new Image,c=()=>{const e=u||s.width,t=m||s.height,n=o.getContext("2d",{alpha:!1});(0,i.WM)((()=>{o.width=e,o.height=t,r.vX&&(n.filter=`blur(${d}px)`),n.drawImage(s,2*-d,2*-d,e+4*d,t+4*d),r.vX||(0,a.Z)(n,0,0,e,t,d,l)}))};s.onload=()=>{n?(0,i.i$)(c):c()},s.src=e}),[e,t,m,u,d,n]),h}},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})},I=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,I]);const N=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,N,M,S,!E&&I,!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){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=t?e:()=>e;t??(t=[e]);const[c,l]=(0,o.Z)(),d=(0,i.Y)(s);function u(){const e=d.current;n?e(l):l(e())}return(0,r.Z)(u,t),(0,a.b)(u,t),c}},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){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const c=t?e:()=>e();t??(t=[e]);const l=(0,o.sO)(),d=(0,a.Z)(),u=(0,r.Y)(c);function m(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=u.current;if(n)t((e=>{l.current!==e&&(l.current=e,d())}));else{const n=t();l.current!==n&&(l.current=n,e||d())}}return(0,s.Z)((()=>{m(!0)}),t),(0,i.b)(m,t),l.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{loadPeerStoriesByIds:r}=(0,a.Sv)(),s=(0,o.Ye)((()=>{const n=(0,i.P2)(r,200,!0);return()=>{n({peerId: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:()=>c});var o=n(60748),a=n(57710),i=n(42797);const r=500,s=300;function c(e,t,n){const{isMobile:c}=(0,i.ZP)();(0,o.d4)((()=>{t?c||setTimeout((()=>{(0,a.WM)((()=>{e.current?.isConnected&&e.current.focus()}))}),r):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,s))}),[e,c,t,n])}},6701:(e,t,n)=>{n.d(t,{Z:()=>h});var o=n(60748),a=n(6137),i=n(40647),r=n(69118),s=n(97184),c=n(65326),l=n(27704);const d=.75,u=1500,m=500;function h(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,h=arguments.length>3?arguments[3]:void 0,p=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const g=e?i.UV(e):void 0,Z=s.I_&&n===a.IU.Progressive,f=(0,c.Z)(),v=(0,l.Z)(),[P,E]=(0,o.eJ)(g&&!Z?1:0),y=(0,o.sO)(),b=(0,o.Ye)((()=>(0,r.P2)((e=>{y.current&&(!h||Date.now()-y.current>h)&&E(e)}),m,!0)),[h]);return(0,o.d4)((()=>{!t&&e&&(g?Z&&setTimeout((()=>{E(d)}),u):(E(0),y.current&&i.cC(b),y.current=Date.now(),i.he(e,n,p,b,v).then((()=>{const e=Date.now()-y.current;y.current=void 0,!h||e>=h?f():setTimeout(f,h-e)}))))}),[t,e,g,n,f,Z,h,b,p,v]),(0,o.d4)((()=>{t&&y.current&&(i.cC(b),E(0),y.current=void 0)}),[b,t]),(0,o.d4)((()=>()=>{e&&i.Iq(e,v)}),[v,e]),{mediaData:g,loadProgress:P}}},56503:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(60748),a=n(97184),i=n(25190);const r=250;let s;function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const l=(0,o.sO)(!1),d=(0,i.Z)((()=>{l.current=!0}));return(0,o.d4)((()=>{s&&(clearTimeout(s),s=void 0),!e||a.$b||c||(s=window.setTimeout((()=>{l.current||t()}),2*n))}),[c,e,n,t]),[(0,i.Z)((()=>{l.current=!0})),(0,i.Z)((()=>{l.current=!1,s&&(clearTimeout(s),s=void 0),s=window.setTimeout((()=>{l.current||t()}),n)})),d]}},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){const t=(0,o.sO)();return t.current??(t.current=(0,a.gQ)(e)),t.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,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);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){const n=t.get(e.messageId);n?.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:()=>l});var o=n(33555),a=n(57710),i=n(7054),r=n(9933);const s=300,c=new Map;function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;(0,i.FOo)((0,o.Rd)())||(n=0);const l="rtl"===e.getAttribute("dir"),{scrollLeft:d,offsetWidth:u,scrollWidth:m,dataset:{scrollId:h}}=e;let p=t-d;if(p<0){const e=-d*(l?-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&&c.has(h)&&c.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,c.set(i,(()=>{o=!0})),e.style.scrollSnapType="none";const s=Date.now();(0,r.jt)((()=>{if(o)return!1;const a=Math.min((Date.now()-s)/n,1),r=p*(1-function(e){return 1-(1-e)**3.5}(a));return e.scrollLeft=Math.round(g-r),a>=1&&(e.style.scrollSnapType="",delete e.dataset.scrollId,c.delete(i),t()),a<1}),a.WM)}))}))}},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);if(t[8])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,P=arguments.length>7?arguments[7]:void 0;g!==a.fo.Static&&(0,s.FOo)((0,o.Rd)())||(Z=0);const{offsetTop:E,offsetHeight:y}=t,{scrollTop:b,offsetHeight:C,scrollHeight:w}=e,S=P&&e.dataset.normalHeight?Number(e.dataset.normalHeight):C;let I;switch(n){case"start":I=E-h+(l.wZ?1:0);break;case"end":I=E+y+h-S;break;case"nearest":case"center":case"centerOrTop":I=y<S?E+y/2-S/2:E-h}const N=function(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}(e,I,p,g);let M=I-N;if(M<0){const e=-N;M=Math.max(M,e)}else if(M>0){const e=w-(N+S);M=Math.min(M,e)}const k=Math.abs(M);return()=>{if(k<1)return void(b!==N&&(e.scrollTop=N));const t=N+M;if(0===Z)return void(e.scrollTop=t);m=!0;const n=k<=i.xnK?f:v,o=Z||i.bKs+k/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=M*(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){return 1-(1-e)**3.5}function v(e){return 1-(1-e)**6.5}},10396:(e,t,n)=>{n.d(t,{An:()=>P,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=v(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)(E(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(y)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(y))}(n,e)}const{audio:P,proxy:b,handlers:C}=u.get(e);return C.push(n),{play(n){if(!P.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,P.src||(P.src=n,P.preload="auto",n.includes("/progressive/")&&d.s$&&(delete P.dataset.preventPlayAfterPatch,(0,c.B)(P))),(0,l.Z)(P),function(e,t){if((0,s.jUK)((0,o.Rd)()).globalSearch.currentContent===a.nJ.Music)return;const{chatId:n}=(0,r.Ak)(E(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&&P.pause()},stop(){if(m===e){const e=P.src;P.pause(),(0,i.Yq)((()=>{P.src="",P.src=e}))}},setCurrentTime(t){m===e&&(P.fastSeek?P.fastSeek(t):P.currentTime=t)},setVolume(t){m===e&&(P.volume=t,P.muted=!1)},setPlaybackRate(t){m===e&&(P.playbackRate=t)},toggleMuted(e){P.muted=void 0===e?!P.muted:e},proxy:b,requestNextTrack(){g(e)},isLast:()=>!v(e,(0,s.jUK)((0,o.Rd)()).audioPlayer.origin),isFirst:()=>!v(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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.Cr.Inline,n=arguments.length>2?arguments[2]:void 0;const o=function(e){switch(e.type){case"audio":return p;case"voice":return h;default:return}}(u.get(e));if(!o)return;if(t===a.Cr.Search){const t=o.indexOf(e);if(t<0)return;return o[t+(n?-1:1)]}const{chatId:i}=(0,r.Ak)(E(e).messageKey),s=o.filter((e=>e.startsWith(`msg${i}`))),c=s.indexOf(e);if(c<0)return;let l=t===a.Cr.Inline?-1:1;return n&&(l*=-1),s[c+l]}function P(e){return`${(0,r.Tp)(e)}-${e.date}`}function E(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function y(e,t){if(!e||!t)return 0;const{date:n,messageKey:o}=E(e),{date:a,messageKey:i}=E(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,"string");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);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:()=>v});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,d=15,u=50,m=150,h=150;function p(e,t){return t?Math.hypot(t.pageX-e.pageX,t.pageY-e.pageY):0}function g(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}let Z=0;const f=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 v(e,t){let n,o=!1,v=!1,P=!1,E=0,y=t.initialZoom??1,b={x:0,y:0},C={x:!1,y:!1};const w=s.Z.get();let S,I={x:w.width/2,y:w.height/2};const N=t.minZoom??1,M=t.maxZoom??4;function k(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(n=e,"mousedown"===e.type)!t.withNativeDrag&&t.onDrag&&e.preventDefault(),document.addEventListener("mousemove",T),document.addEventListener("mouseup",x);else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",T,{passive:!0}),t.addEventListener("touchend",x),t.addEventListener("touchcancel",x),"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&&(E=p(e.touches[0],e.touches[1]),I=g(e.touches[0],e.touches[1])))}t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function x(e){n&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.removeEventListener("mouseup",x),document.removeEventListener("mousemove",T),n.target.removeEventListener("touchcancel",x),n.target.removeEventListener("touchend",x),n.target.removeEventListener("touchmove",T),r.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),e&&(o?t.onRelease&&t.onRelease(e):"mouseup"===e.type&&(t.onDoubleClick&&Date.now()-Z<300?t.onDoubleClick(e,{centerX:n.pageX,centerY:n.pageY}):!t.onClick||"button"in e&&0!==e.button||t.onClick(e),Z=Date.now()))),o=!1,v=!1,P=!1,E=0,y=(0,a.uZ)(y,N,M),S=void 0,b={x:0,y:0},C={x:!1,y:!1};const i=s.Z.get();I={x:i.width/2,y:i.height/2},n=void 0}function T(e){if(n){if("touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),t.onZoom&&E>0&&2===e.touches.length)){const n=p(e.touches[0],e.touches[1]),a=g(e.touches[0],e.touches[1]),i=a.x-I.x,r=a.y-I.y,s=n/E;t.onZoom(e,{zoomFactor:s,initialCenterX:I.x,initialCenterY:I.y,dragOffsetX:i,dragOffsetY:r,currentCenterX:a.x,currentCenterY:a.y}),1!==s&&(o=!0)}const a=e.pageX-n.pageX,i=e.pageY-n.pageY;(Math.abs(a)>=d||Math.abs(i)>=d)&&(o=!0);let m=!1;t.onDrag&&(t.onDrag(e,n,{dragOffsetX:a,dragOffsetY:i}),m=!0),t.onSwipe&&!v&&(v=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>=u?d="x":i>=u&&(d="y"),!d)return!1;if(S){if(S!==d)return!1}else S=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,a,i),m=v),r.cj&&m&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}const A=(0,i.Ds)(x,h,!1),R=(0,i.Ds)(x,m,!1);function O(e){o||(k(e),o=!0,I={x:e.x,y:e.y})}function L(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:i=3}=t;if(t.onDoubleClick&&Object.is(e.deltaX,-0)&&Object.is(e.deltaY,-0)&&e.ctrlKey)return O(e),y=y>1?1:i,t.onDoubleClick(e,{centerX:e.pageX,centerY:e.pageY}),void(o=!1);const r=e.metaKey||e.ctrlKey||e.shiftKey;if(r&&function(e){if(!t.onZoom)return;O(e);const n=e.x-I.x,o=e.y-I.y,i=(0,a.uZ)(e.deltaY,-25,25);y-=.01*i,y=(0,a.uZ)(y,.5*N,3*M),P=!0,t.onZoom(e,{zoom:(0,a.NM)(y,2),initialCenterX:I.x,initialCenterY:I.y,dragOffsetX:n,dragOffsetY:o,currentCenterX:e.x,currentCenterY:e.y}),R(e)}(e),!r&&!P){const o=f.check(e);(1!==y||o)&&function(e){if(!t.onDrag)return;O(e),C.x&&Math.sign(b.x)!==Math.sign(e.deltaX)||(b.x-=e.deltaX),C.y&&Math.sign(b.y)!==Math.sign(e.deltaY)||(b.y-=e.deltaY);const{x:o,y:a}=b;t.onDrag(e,n,{dragOffsetX:o,dragOffsetY:a},((e,t)=>{C={x:e,y:t}})),A(e)}(e)}}return e.addEventListener("wheel",L),e.addEventListener("mousedown",k),e.addEventListener("touchstart",k,{passive:!t.isNotPassive}),()=>{x(),e.removeEventListener("wheel",L),e.removeEventListener("touchstart",k),e.removeEventListener("mousedown",k)}}},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:()=>c});var o=n(69118);const a=10,i=1e3;let r=[],s=!1;function c(e,t){r.push({url:e,filename:t}),s||(s=!0,setTimeout((async()=>{await async function(){let e=0;for(const t of r)l(t),e++,e===a&&(await(0,o.wO)(i),e=0);r=[]}(),s=!1}),i))}function l(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:()=>i});var o=n(83716);const a=1;function i(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&r(e.focusNode,o.gnl);if(!t||0===t.childElementCount)return;const i=Array.from(t.children).reduce(((e,t)=>t.nodeType===a&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce(((e,t)=>e.concat(Number(t.dataset.messageId))),e):t.nodeType===a&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e),[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n||i.pop(),i}function r(e,t){return!(e.nodeType!==a||!e.classList.contains(t))||!!e.parentNode&&r(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=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:()=>c,fu:()=>l,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},s=3;function c(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const c=document.createElement("div");c.innerHTML=n?e:function(e){let t=e.slice(0);return t=t.replace(/ /g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\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}(t?function(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>`))}(e):e),l(c);const d=c.innerText.trim().replace(/\u200b+/g,"");let u=-c.innerText.indexOf(d[0]),m=0;const h=[];function p(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=function(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}}}(e,d,u);if(n)u=t,h.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;u+=e.textContent.length}e.hasChildNodes()&&m<=s&&(m+=1,Array.from(e.childNodes).forEach(p))}return Array.from(c.childNodes).forEach((e=>{m=1,p(e)})),{text:d,entities:h.length?h:void 0}}function l(e){e.querySelectorAll("img").forEach((e=>{e.dataset.documentId?e.textContent=e.alt||"":e.replaceWith(e.alt||"")}))}},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(){const e=window.getSelection();e?.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",peer:"N26JMlalq5jDriKQ7nFD",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=9170.a3ef0a36267f135a7051.js.map
|