TelegramPWA/dist/3442.0c99aec2d7cb850d5031.js
Alexander Zinchuk f1adb514ad [Build]
2024-05-03 15:18:24 +02:00

2 lines
281 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

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

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

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[3442],{4794:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(60748),o=n(33555),s=n(7054),i=n(42431),r=n(46752),c=n(18360),l=n(59107),d=n(31212),m=n(65351),u=n(231);const h=(0,a.X$)((0,o.c$)(((e,{chatId:t})=>{const n=(0,s.Z1J)(e,t),a=(0,i.Bj)(e,t);return{groupCall:a,isActive:((0,s.jUK)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==a?.id&&Boolean(a?a.participantsCount>0&&a.isLoaded:n&&n.isCallNotEmpty&&n.isCallActive)}}))((({chatId:e,isActive:t,className:n,groupCall:s,hasPinnedOffset:i})=>{const{requestMasterAndJoinGroupCall:h,subscribeToGroupCallUpdates:p}=(0,o.Sv)(),Z=(0,l.Z)(),g=(0,a.I4)((()=>{h({chatId:e})}),[h,e]),f=s?.participants,v=(0,a.Ye)((()=>{if(!f)return[];const e=(0,o.Rd)().users.byId,t=(0,o.Rd)().chats.byId;return Object.values(f).slice(0,3).map((({id:n})=>e[n]||t[n])).filter(Boolean)}),[f]);(0,a.d4)((()=>{if(s?.id&&(t||!s.isLoaded))return p({id:s.id,subscribed:!0}),()=>{p({id:s.id,subscribed:!1})}}),[s?.id,s?.isLoaded,t,p]);const{shouldRender:P,transitionClassNames:E}=(0,d.Z)(Boolean(s&&t)),y=(0,c.Z)(s?.participantsCount,!0),b=(0,c.Z)(v,!0);if(P)return a.ZP.createElement("div",{className:(0,r.Z)("GroupCallTopPane",i&&"has-pinned-offset",n,E),onClick:g},a.ZP.createElement("div",{className:"info"},a.ZP.createElement("span",{className:"title"},Z("VoipGroupVoiceChat")),a.ZP.createElement("span",{className:"participants"},Z("Participants",y??0,"i"))),Boolean(b?.length)&&a.ZP.createElement(m.Z,{size:"small",peers:b,className:"avatars"}),a.ZP.createElement(u.Z,{round:!0,className:"join"},Z("VoipChatJoin")))})))},34076:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(60748),o=n(33555),s=n(7054),i=n(46752),r=n(60706),c=n(59107);const l=({text:e,className:t})=>{const n=(0,c.Z)(),l=(0,a.sO)(),[d,m,u]=(0,r.Z)(!1),h=(0,s.FOo)((0,o.Rd)()),p=(0,a.Ye)((()=>{if(!h)return e;if(!d)return l.current||e;const t=l.current,n=[];for(let o=0;o<e.length;o++)t&&e[o]!==t[o]?n.push(a.ZP.createElement("div",{className:"IYTzbS8o"},a.ZP.createElement("div",{className:"Jw1oQFdk"},e[o]),a.ZP.createElement("div",{className:"TZfEz3sc",onAnimationEnd:u},t[o]),a.ZP.createElement("div",{className:"Y9ied8_t",onAnimationEnd:u},e[o]))):n.push(a.ZP.createElement("span",null,e[o]));return l.current=e,n}),[h,d,e]);return(0,a.d4)((()=>{m()}),[e]),a.ZP.createElement("span",{className:(0,i.Z)("tgKbsVmz",t),dir:n.isRtl?"rtl":void 0},p)}},45601:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(60748),o=n(59187),s=n(41765),i=n(6202),r=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 a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},c.apply(this,arguments)}const l=(0,a.X$)((function(e){const{sticker:t,noLoad:n,forcePreview:l,...d}=e,m=t?.thumbnail?.dataUri,u=t&&`sticker${t.id}`,h=(0,i.Z)(t?(0,s.RK)(t.id):void 0,n&&!l,o.IU.BlobUrl),p=(0,i.Z)(u,n);return a.ZP.createElement(r.Z,c({tgsUrl:p,previewUrl:h,thumbDataUri:m},d))}))},21179:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(60748),o=n(46752),s=n(80036),i=n(60706),r=n(25190),c=n(70692),l=n(58912);const d="lM2usrZU";function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},m.apply(this,arguments)}const u=new Set,h=(0,a.X$)((function(e){const{previewUrl:t,thumbDataUri:n,className:h,...p}=e,[Z,,g]=(0,i.Z)(Boolean(n)),f=(0,c.Z)(Z),[v,P,E]=(0,i.Z)(u.has(t)),y=(0,c.Z)(v),[b,C]=(0,i.Z)(!1),w=(0,r.Z)((()=>{P(),u.add(t)})),S=(0,r.Z)((()=>{g(),E(),setTimeout(C,300)})),{size:I}=e;return a.ZP.createElement("div",{className:(0,o.Z)(h,"xCi2f0YH"),style:(0,s.Z)(void 0!==I&&`width: ${I}px; height: ${I}px;`)},n&&!b&&a.ZP.createElement("img",{src:n,className:(0,o.Z)(d,f),draggable:!1}),t&&!b&&a.ZP.createElement("img",{src:t,className:(0,o.Z)(d,y),draggable:!1,onLoad:w}),a.ZP.createElement(l.Z,m({},p,{onLoad:S})))}))},73482:(e,t,n)=>{n.d(t,{ZP:()=>A});var a=n(60748),o=n(33555),s=n(59187),i=n(91713),r=n(41765),c=n(10396),l=n(46752),d=n(64963),m=n(33323),u=n(1735),h=n(47011),p=n(15376),Z=n(32340);var g=n(42797),f=n(23186),v=n(12019),P=n(59107),E=n(25190),y=n(6202),b=n(6701),C=n(31212),w=n(231),S=n(8337),I=n(39196),N=n(58912),M=n(65979);const k=window.matchMedia("(max-width: 375px)"),T=window.matchMedia("(max-width: 410px)");function x(e,t,n){return a.ZP.createElement("div",{className:"seekline",ref:n},t.map((({start:e,end:t})=>a.ZP.createElement("div",{className:"seekline-buffered-progress",style:`left: ${100*e}%; right: ${100-100*t}%`}))),a.ZP.createElement("span",{className:"seekline-play-progress"},a.ZP.createElement("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})),a.ZP.createElement("span",{className:"seekline-thumb"},a.ZP.createElement("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})))}const A=(0,a.X$)((({theme:e,message:t,senderTitle:n,uploadProgress:A,origin:R,date:O,noAvatars:L,className:B,isSelectable:D,isSelected:$,isDownloading:F,isTranscribing:U,isTranscriptionHidden:j,isTranscribed:_,isTranscriptionError:H,canDownload:z,canTranscribe:V,autoPlay:W,onHideTranscription:q,onPlay:Y,onPause:G,onReadMedia:X,onCancelUpload:J,onDateClick:K})=>{const{cancelMessageMediaDownload:Q,downloadMessageMedia:ee,transcribeAudio:te,openOneTimeMediaModal:ne}=(0,o.Sv)(),{content:{audio:ae,voice:oe,video:se},isMediaUnread:ie}=t,re=ae||(0,r.jR)(t),ce=Boolean(oe||se),le=(0,a.sO)(!1),de=(0,a.sO)(null),me=(0,P.Z)(),{isRtl:ue}=me,{isMobile:he}=(0,g.ZP)(),[pe,Ze]=(0,a.eJ)(!1),ge=pe||!0,fe=(0,r.Ti)(t,"pictogram"),ve=(0,y.Z)(fe,!1,s.IU.BlobUrl),Pe=(0,r.qR)(t),Ee=R===i.Cr.OneTimeModal,ye=ce?Pe?"oneTimeVoice":"voice":"audio",be=(0,y.Z)((0,r.Ti)(t,"inline"),!ge,(0,r.kG)(t,"inline")),{loadProgress:Ce}=(0,b.Z)((0,r.Ti)(t,"download"),!F,(0,r.kG)(t,"download")),we=(0,E.Z)((()=>{Ze(!0),Y?.(t.id,t.chatId)})),Se=(0,E.Z)((()=>{Ze(!1)})),{isBuffered:Ie,bufferedRanges:Ne,bufferingHandlers:Me,checkBuffering:ke}=(0,v.Z)(),Te=Ee,{isPlaying:xe,playProgress:Ae,playPause:Re,setCurrentTime:Oe,duration:Le}=(0,f.Z)((0,c.An)(t),(0,r.XV)(t),ye,be,Me,void 0,ke,Boolean(pe||W),we,Se,(0,r.CI)(t)||Pe,void 0,G,Te,Pe&&!Ee),Be=1-Ae,De=(0,r.B4)(t),$e=Pe&&Ee,Fe=function(e,t,n=0,o=!1,s=!1,i=!1,r=!1){const c=(0,a.sO)(null),{data:l,peak:d}=(0,a.Ye)((()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const{MIN_SPIKES:a,MAX_SPIKES:o}=function(e,t){return{MIN_SPIKES:e?k.matches?16:20:25,MAX_SPIKES:e?k.matches?35:t&&T.matches?40:45:75}}(i,s),r=Math.min(n/10,1),c=Math.round(a+(o-a)*r),l=(0,u.x)(new Uint8Array(e));return(0,u.C)(l,c)}),[i,t,s])||{};return(0,a.bt)((()=>{const t=c.current;t&&l&&void 0!==d&&function(e,t,n,{peak:a,fillStyle:o,progressFillStyle:s}){const i=4*t.length;e.width=2*i,e.height=46,e.style.width=`${i}px`,e.style.height="23px";const r=e.getContext("2d");r.scale(2,2),t.forEach(((e,i)=>{r.globalAlpha=i/t.length>=n?.5:1,r.fillStyle=n>i/t.length?s:o;const c=Math.max(2,e/Math.max(1,a)*23);!function(e,t,n,a,o,s){2<2*s&&(s=1),o<2*s&&(s=o/2),e.beginPath(),e.moveTo(t+s,n),e.arcTo(t+2,n,t+2,n-o,s),e.arcTo(t+2,n-o,t,n-o,s),e.arcTo(t,n-o,t,n,s),e.arcTo(t,n,t+2,n,s),e.closePath()}(r,4*i,(23+c)/2,0,c,1),r.fill()}))}(t,l,r?1-n:n,{peak:d,fillStyle:o?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:o?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[o,d,n,l,e,r]),c}(e,oe,!ie||De||$e?Ae:1,De,!L,he,$e),Ue=xe||Ae>0&&Ae<1;(0,a.d4)((()=>{Ze(xe)}),[xe]);const je=pe&&!Ie,{isUploading:_e,isTransferring:He,transferProgress:ze}=(0,r.Sc)(t,A||Ce,je||F,void 0!==A),{shouldRender:Ve,transitionClassNames:We}=(0,C.Z)(He),qe=Ve&&(je||_e),Ye=(0,E.Z)((()=>{if(_e)J?.();else{if(Pe)return ne({message:t}),void X?.();xe||Y?.(t.id,t.chatId),(0,o.Sv)().setAudioPlayerOrigin({origin:R}),Ze(!pe),Re()}}));(0,a.d4)((()=>{X&&ie&&(xe||F)&&X()}),[xe,ie,X,F]);const Ge=(0,E.Z)((()=>{F?Q({message:t}):ee({message:t})})),Xe=(0,E.Z)((e=>{if(le.current&&de.current){const{width:t,left:n}=de.current.getBoundingClientRect(),a=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Oe(Math.max(Math.min(Le*((a-n)/t),Le-.1),.001))}})),Je=(0,E.Z)((e=>{e instanceof MouseEvent&&2===e.button||(le.current=!0,Xe(e))})),Ke=(0,E.Z)((()=>{le.current=!1})),Qe=(0,E.Z)((()=>{K(t.id,t.chatId)})),et=(0,E.Z)((()=>{te({chatId:t.chatId,messageId:t.id})}));function tt(){if(ce)return n||"Voice";const{title:e,fileName:t}=re;return e||t}(0,a.d4)((()=>{if(de.current&&Ue&&!Ee)return(0,d.sf)(de.current,{onCapture:Je,onRelease:Ke,onClick:Ke,onDrag:Xe})}),[Ue,Je,Xe,Ke,Ee]);const nt=(0,l.Z)("Audio",B,Ee&&"non-interactive",R===i.Cr.Inline&&"inline",De&&R===i.Cr.Inline&&"own",(R===i.Cr.Search||R===i.Cr.SharedMedia)&&"bigger",$&&"audio-is-selected"),at=["toogle-play-wrapper"];qe?at.push("loading"):at.push(xe?"pause":"play");const ot=(0,l.Z)("content",Ue&&"with-seekline");function st(){return a.ZP.createElement("div",{className:ot},a.ZP.createElement("div",{className:"content-row"},a.ZP.createElement("p",{className:"title",dir:"auto",title:tt()},(0,Z.Z)(tt())),a.ZP.createElement("div",{className:"message-date"},Boolean(O)&&a.ZP.createElement(S.Z,{className:"date",onClick:Qe},(0,m.VX)(me,1e3*O)))),Ue&&a.ZP.createElement("div",{className:"meta search-result",dir:ue?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},Ae<1&&`${(0,m.k9)(Le*Ae,Le)}`),x(Ae,Ne,de)),!Ue&&function(){if(ce)return a.ZP.createElement("div",{className:"meta",dir:ue?"rtl":void 0},(0,m.k9)((oe||se).duration));const{performer:e}=re;return a.ZP.createElement("div",{className:"meta",dir:ue?"rtl":void 0},(0,m.k9)(Le),a.ZP.createElement("span",{className:"bullet"},"•"),e&&a.ZP.createElement("span",{className:"performer",title:e},(0,Z.Z)(e)),e&&n&&a.ZP.createElement("span",{className:"bullet"},"•"),n&&a.ZP.createElement("span",{title:n},(0,Z.Z)(n)))}())}return a.ZP.createElement("div",{className:nt,dir:me.isRtl?"rtl":"ltr"},D&&a.ZP.createElement("div",{className:"message-select-control"},$&&a.ZP.createElement("i",{className:"icon icon-select"})),a.ZP.createElement("div",{className:(0,l.Z)(...at)},a.ZP.createElement(w.Z,{round:!0,ripple:!he,size:"smaller",className:"toggle-play",color:ve?"translucent-white":"primary",ariaLabel:xe?"Pause audio":"Play audio",onClick:Ye,isRtl:me.isRtl,backgroundImage:ve,nonInteractive:Ee},!Ee&&a.ZP.createElement(M.Z,{name:"play"}),!Ee&&a.ZP.createElement(M.Z,{name:"pause"}),Ee&&a.ZP.createElement(N.Z,{className:"flame",tgsUrl:h.l.Flame,nonInteractive:!0,noLoop:!1,size:40})),Pe&&!Ee&&a.ZP.createElement(M.Z,{name:"view-once"})),Ve&&a.ZP.createElement("div",{className:(0,l.Z)("media-loading",We,qe&&"interactive")},a.ZP.createElement(I.Z,{progress:ze,transparent:!0,withColor:!0,size:"m",onClick:qe?Ye:void 0,noCross:!qe})),Ee&&!Ve&&a.ZP.createElement("div",{className:(0,l.Z)("media-loading")},a.ZP.createElement(I.Z,{progress:Ae,transparent:!0,size:"m",noCross:!0,rotationOffset:3/4})),re&&z&&!_e&&a.ZP.createElement(w.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:F?"Cancel download":"Download",onClick:Ge},a.ZP.createElement("i",{className:(0,l.Z)("icon",F?"icon-close":"icon-arrow-down")})),R===i.Cr.Search&&st(),R!==i.Cr.Search&&re&&function(e,t,n,o,s,i,r,c,l,d,u){const{title:h,performer:g,fileName:f}=t,v=o||s>0&&s<1,{isRtl:P}=e;return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("p",{className:"title",dir:"auto",title:h},(0,Z.Z)(h||f)),v&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,m.k9)(n*s,n)),x(s,i,r)),!v&&c&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},d?`${(0,p.yW)(t.size*d)} / `:void 0,(0,p.yW)(t.size)),!v&&!c&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},a.ZP.createElement("span",{className:"duration",dir:"auto"},(0,m.k9)(n)),g&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement("span",{className:"performer",dir:"auto",title:g},(0,Z.Z)(g))),Boolean(l)&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement(S.Z,{className:"date",onClick:u},(0,m.ZK)(e,1e3*l,!0)))))}(me,re,Le,xe,Ae,Ne,de,F||_e,O,ze,K?Qe:void 0),R===i.Cr.SharedMedia&&(oe||se)&&st(),(R===i.Cr.Inline||Ee)&&oe&&function(e,t,n,o,s,r,c,d,u,h,p,Z){return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("div",{className:"waveform-wrapper"},a.ZP.createElement("div",{className:"waveform",draggable:!1,ref:t},a.ZP.createElement("canvas",{ref:n})),h&&a.ZP.createElement(w.Z,{onClick:()=>{(d||u)&&p?p(!c):r||h()}},a.ZP.createElement("i",{className:(0,l.Z)("transcribe-icon","icon",d||u?"icon-down":"icon-transcribe",(d||u)&&!c&&"transcribe-shown")}),r&&a.ZP.createElement("svg",{viewBox:"0 0 32 24",className:"loading-svg"},a.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"})))),a.ZP.createElement("p",{className:(0,l.Z)("voice-duration",Z!==i.Cr.OneTimeModal&&s&&"unread"),dir:"auto"},0===o||1===o?(0,m.k9)(e.duration):(0,m.k9)(e.duration*o)))}(oe,de,Fe,Pe?Be:Ae,ie,U,j,_,H,V?et:void 0,q,R))}))},65351:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(46752),s=n(59107),i=n(70172);const r={root:"kXs18Nmi","size-micro":"bnYA0Wm9",sizeMicro:"bnYA0Wm9","size-mini":"ZGpPX4Wb",sizeMini:"ZGpPX4Wb","size-tiny":"ufyZRVf5",sizeTiny:"ufyZRVf5","size-small":"UA2exR6e",sizeSmall:"UA2exR6e","size-small-mobile":"PTbjjZjF",sizeSmallMobile:"PTbjjZjF","size-medium":"jncPG8PA",sizeMedium:"jncPG8PA","size-large":"pd70AQAO",sizeLarge:"pd70AQAO","size-jumbo":"KpwfP5mr",sizeJumbo:"KpwfP5mr",avatar:"XND8fhC1",badge:"SHyAyGFO"},c=(0,a.X$)((({peers:e,size:t,className:n,limit:c=3,badgeText:l})=>{const d=(0,s.Z)(),m=(0,a.Ye)((()=>l||(!e?.length||e.length<=c?void 0:"+"+(e.length-c))),[l,e,c]);return a.ZP.createElement("div",{className:(0,o.Z)(n,r.root,r[`size-${t}`]),dir:d.isRtl?"rtl":"ltr"},e?.slice(0,c).map((e=>a.ZP.createElement(i.Z,{size:t,peer:e,className:r.avatar}))),m&&a.ZP.createElement("div",{className:r.badge},m))}))},88007:(e,t,n)=>{n.d(t,{Z:()=>Nt});var a=n(60748),o=n(33555),s=n(59187),i=n(83716),r=n(57710),c=n(41765),l=n(7054),d=n(9211),m=n(46752),u=n(33323),h=n(82850),p=n(65723),Z=n(70735),g=n(89455),f=n(41098),v=n(82267),P=n(97184),E=n(43858);let y;function b(e){y.focus(),e.focus()}P.cj&&(y=document.createElement("input"),y.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(y));var C=n(76087),w=n(44139),S=n(96391),I=n(33780),N=n(32340),M=n(4809),k=n(96557),T=n(49488),x=n(17240),A=n(86203),R=n(274),O=n(60706),L=n(69156),B=n(59107),D=n(25190),$=n(87204),F=n(33057),U=n(56389),j=n(31212),_=n(33799),H=n(70971),z=n(34446),V=n(52400),W=n(11309),q=n(71790);const Y=/^\/([\w@]{1,32})?$/i;var G=n(56266);const X=/id="docs-internal-guid/i,J={BOLD:"700",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"line-through",SUPERSCRIPT:"super",SUBSCRIPT:"sub"},K={ANCHOR:"a",BOLD:"strong",ITALIC:"em",UNDERLINE:"u",BLOCKQUOTE:"blockquote",STRIKETHROUGH:"del",SUPERSCRIPT:"sup",SUBSCRIPT:"sub"},Q=["H1","H2","H3","H4","H5","H6"];function ee(e){return(new DOMParser).parseFromString(e,"text/html").body}function te(e,t){const n=document.createElement(K.ANCHOR);return n.href=t,n.appendChild(e.cloneNode(!0)),n}function ne(e,t){const n=document.createElement(t);return n.appendChild(e.cloneNode(!0)),n}function ae(e,t){let n=t.cloneNode(!0);return e?(e.style&&e.style.fontWeight===J.BOLD&&(n=ne(n,K.BOLD)),e.style&&e.style.fontStyle===J.ITALIC&&(n=ne(n,K.ITALIC)),e.style&&e.style.textDecoration===J.UNDERLINE&&(n=ne(n,K.UNDERLINE)),e.style&&e.style.textDecoration===J.STRIKETHROUGH&&(n=ne(n,K.STRIKETHROUGH)),e.style&&e.style.verticalAlign===J.SUPERSCRIPT&&(n=ne(n,K.SUPERSCRIPT)),e.style&&e.style.verticalAlign===J.SUBSCRIPT&&(n=ne(n,K.SUBSCRIPT)),n):n}function oe(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),a=t;return"A"===t.nodeName&&(n=te(n,t.href),"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(a=t.childNodes[0])),n=ae(a,n),n}function se(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 a=[];for(let t=0;t<e.childNodes.length;t++)a.push(...se(e.childNodes[t]));a.map((e=>n.appendChild(e)))}else-1!==Q.indexOf(e.nodeName)?(t=document.createElement(e.nodeName),n=oe(e.childNodes[0])):"P"===e.nodeName?(t=document.createElement("p"),n=function(e){const t=e.cloneNode(!0);let n=document.createTextNode(t.textContent||""),a=document.createTextNode("");return"style"in t.childNodes[0]&&Boolean(t.childNodes[0].style)&&(a=t.childNodes[0]),t.childNodes[0]&&"A"===t.childNodes[0].nodeName&&(n=te(n.cloneNode(!0),t.childNodes[0].href),a=t.childNodes[0].childNodes[0]),n=ae(a,n),n}(e)):"BR"===e.nodeName?n=e:(t=document.createElement("span"),n=oe(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(...se(e.childNodes[n]));return t}return[e]}function ie(e){return 8!==e.nodeType}const re=/<style>(.*?)<\/style>/gs;var ce=n(21262);const le=(e,t,n,r,l,d,m)=>{const{showNotification:u}=(0,o.Sv)(),h=(0,B.Z)();(0,a.d4)((()=>{if(e)return document.addEventListener("paste",a,!1),()=>{document.removeEventListener("paste",a,!1)};async function a(e){if(!e.clipboardData)return;const a=document.activeElement;if(a&&![i.R2F,i.nYf,i.Cic].includes(a.id))return;const o=e.clipboardData.getData("text").substring(0,4096),p=e.clipboardData.getData("text/html");let Z=p?(0,g.ZP)(function(e){let t=document.createElement("div");try{e=(n=e).match(X)?function(e){const t=document.createElement("body"),n=e.childNodes,a=Array.from(n).filter(ie),o=[];for(const e of a)o.push(...se(e));for(let e=0;e<o.length;e++)t.appendChild(o[e].cloneNode(!0));return t}(ee(n.replace(/(\r\n|\n|\r)/,""))).innerHTML:ee(n.replace(/(\r\n|\n|\r)/,"")).innerHTML}catch(e){i.eMD&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(re,"");const a=t.querySelectorAll(".text-content");return a.length&&(t=a[a.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 s.Vv.MentionName:e.replaceWith(e.textContent||"");break;case s.Vv.CustomEmoji:e.textContent=e.dataset.alt||""}else e.remove()})),t.innerHTML.trimEnd()}(p),void 0,!0):void 0;Z&&(0,G.Lo)(Z)&&d&&(Z=(0,G.If)(Z),m?.());const{items:f}=e.clipboardData;let v=[];if(e.preventDefault(),f.length>0&&(v=await(0,ce.Z)(f),l&&(v=v?.slice(0,1))),!v?.length&&!o)return;const P=Z?.entities?.length?Z:{text:o};let E=!1;try{E="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(p,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const y=P&&P.text;let b=v?.length&&!E;const w=v?await Promise.all(v.map((e=>(0,C.Z)(e.name,e)))):[],S=l&&w?.length&&(0,c.Gy)(l,w[0])||Boolean(y),I=(0,c.kT)(w[0]),N=l&&l?.groupedId;l&&I?u({message:h(N?"lng_edit_media_album_error":"lng_edit_media_invalid_file")}):!N||(b=S,b)?(b&&n(l?w:e=>e.concat(w)),y&&(b?r(P):t(P,a?.id))):u({message:h("lng_edit_media_album_error")})}}),[t,l,n,e,d,m,r,h])};var de=n(60130),me=n(72645),ue=n(88957),he=n(13819),pe=n(20797);let Ze=!1;const ge=new Set([s.Vv.TextUrl,s.Vv.Url]);var fe=n(28353),ve=n(16580);const Pe=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/is,Ee=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,ye={username:"",query:"",canShowHelp:!1,usernameLowered:""},be=document.createElement("div");const Ce=(0,ve.Z)(((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})));var we=n(29295),Se=n(33681),Ie=n(9668);const Ne=new RegExp(`^${i.t8f.source}$`,"g");var Me=n(23989);const ke={encoderPath:new URL(n(68973),n.b).href,reuseWorker:!0},Te={type:"audio/ogg"};let xe,Ae,Re;async function Oe(){return xe||(xe=n.e(1161).then(n.t.bind(n,1161,23)),Ae=(await xe).default,Re=new Ae(ke)),xe}async function Le(e){await async function(){await Oe(),await Re.start()}();const t=Date.now();let n;const a=[],o=[];Re.ondataavailable=e=>{a.push(e)};const s=function(t,n){const a=t.sourceNode,s=a.context.createAnalyser();s.fftSize=64,a.connect(s);const i=s.frequencyBinCount,c=new Uint8Array(i);let l=!1;return function t(){if(l)return;s.getByteFrequencyData(c);const n=c.reduce(((e,t)=>e+t),0)/i/255;(t=>{o.push(255*t),e(t)})(n<.1?0:n),(0,r.i$)(t)}(),()=>{l=!0}}(Re);return{stop:()=>new Promise(((e,i)=>{Re.onstop=()=>{e({blob:new Blob(a,Te),duration:Math.round(((n||Date.now())-t)/1e3),waveform:o})},Re.onerror=i;const r=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Re.stop(),s()}),r)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Re.pause(),n=Date.now(),s()}),e)}}}var Be=n(99203),De=n(48778);const $e=e=>{const{attachments:t}=e,n=(0,De.Z)(Be.gl.Extra,"AttachmentModal",!t.length);return n?a.ZP.createElement(n,e):void 0};var Fe=n(30879),Ue=n(71394),je=n(85655),_e=n(56503),He=n(65979),ze=n(52328),Ve=n(58964),We=n(43521),qe=n(43159);const Ye=(0,a.X$)((({chatId:e,threadId:t,isButtonVisible:n,canAttachMedia:o,canAttachPolls:s,canSendPhotos:r,canSendVideos:l,canSendDocuments:d,canSendAudios:m,attachBots:u,peerType:h,isScheduled:p,theme:Z,shouldCollectDebugLogs:g,onFileSelect:f,onMenuOpen:v,onMenuClose:E,onPollCreate:y,hasReplaceableMedia:b,editingMessage:C})=>{const[w,S,I]=(0,O.Z)(),[N,M,k]=(0,_e.Z)(w,I),T=r&&l,x=r||l,[A,R,L]=(0,O.Z)(),$=w||A,F=C&&C?.groupedId&&Boolean((0,c.O$)(C)||(0,c.F$)(C)||Boolean((0,c.b7)(C)||(0,c.Cg)(C))),U=C&&C?.groupedId&&Boolean((0,c.oP)(C)||(0,c.kd)(C)||(0,c.aE)(C));(0,a.d4)((()=>{w&&k()}),[w,k]),(0,a.d4)((()=>{$?v():E()}),[$,E,v]);const j=(0,D.Z)((()=>{w?I():S()})),_=(0,D.Z)(((e,t)=>{const{files:n}=e.target,a=(0,Ue.ox)(n);a?.length&&f(a,t)})),H=(0,D.Z)((()=>{(0,je.g)(Array.from(T?i.dII:r?i.oGt:i.wGh).join(","),(e=>_(e,!0)))})),z=(0,D.Z)((()=>{(0,je.g)(!d&&m?Array.from(i.e74).join(","):"*",(e=>_(e,!1)))})),V=(0,D.Z)((()=>{const e=new File([(0,Fe.aZ)()],i.Wpe,{type:"text/plain"});f([e])})),W=(0,a.Ye)((()=>u?Object.values(u).filter((t=>!(!h||!t.isForAttachMenu)&&(!("bots"!==h||t.id!==e||!t.attachMenuPeerTypes.includes("self"))||t.attachMenuPeerTypes.includes(h)))):void 0),[u,e,h]),q=(0,B.Z)();if(n)return a.ZP.createElement("div",{className:"AttachMenu"},C&&b?a.ZP.createElement(We.Z,{id:"replace-menu-button",className:w?"AttachMenu--button activated":"AttachMenu--button",round:!0,color:"translucent",onActivate:j,ariaLabel:"Replace an attachment",ariaControls:"replace-menu-controls",hasPopup:!0},a.ZP.createElement(He.Z,{name:"replace"})):a.ZP.createElement(We.Z,{id:"attach-menu-button",disabled:Boolean(C),className:w?"AttachMenu--button activated":"AttachMenu--button",round:!0,color:"translucent",onActivate:j,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0},a.ZP.createElement(He.Z,{name:"attach"})),a.ZP.createElement(ze.Z,{id:"attach-menu-controls",isOpen:$,autoClose:!0,positionX:"right",positionY:"bottom",onClose:I,className:"AttachMenu--menu fluid",onCloseAnimationEnd:I,onMouseEnter:P.$b?void 0:N,onMouseLeave:P.$b?void 0:M,noCloseOnBackdrop:!P.$b,ariaLabelledBy:"attach-menu-button"},!o&&a.ZP.createElement(Ve.Z,{className:"media-disabled",disabled:!0},"Posting media content is not allowed in this group."),o&&a.ZP.createElement(a.ZP.Fragment,null,x&&!U&&a.ZP.createElement(Ve.Z,{icon:"photo",onClick:H},q(T?"AttachmentMenu.PhotoOrVideo":r?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")),(d||m)&&!F&&a.ZP.createElement(Ve.Z,{icon:"document",onClick:z},q(!d&&m?"InputAttach.Popover.Music":"AttachDocument")),d&&g&&a.ZP.createElement(Ve.Z,{icon:"bug",onClick:V},q("DebugSendLogs"))),s&&!C&&a.ZP.createElement(Ve.Z,{icon:"poll",onClick:y},q("Poll")),!C&&!b&&!p&&W?.map((n=>a.ZP.createElement(qe.Z,{bot:n,chatId:e,threadId:t,theme:Z,onMenuOpened:R,onMenuClosed:L})))))})),Ge=e=>{const{isOpen:t}=e,n=(0,De.Z)(Be.gl.Extra,"BotCommandMenu",!t);return n?a.ZP.createElement(n,e):void 0};var Xe=n(231);const Je=(0,a.X$)((0,o.c$)(((e,{messageId:t})=>{const{chatId:n}=(0,l.Btg)(e)||{};return n?{message:(0,l.hjO)(e,n,t)}:{}}))((({isOpen:e,message:t,onClose:n})=>{const{clickBotInlineButton:s}=(0,o.Sv)(),[i,r]=(0,_e.Z)(e,n),{isKeyboardSingleUse:c}=t||{};if(t&&t.keyboardButtons)return a.ZP.createElement(ze.Z,{isOpen:e,autoClose:c,positionX:"right",positionY:"bottom",onClose:n,className:"BotKeyboardMenu",onCloseAnimationEnd:n,onMouseEnter:P.$b?void 0:i,onMouseLeave:P.$b?void 0:r,noCompact:!0},a.ZP.createElement("div",{className:"content custom-scroll"},t.keyboardButtons.map((e=>a.ZP.createElement("div",{className:"row"},e.map((e=>a.ZP.createElement(Xe.Z,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>s({messageId:t.id,button:e})},e.text))))))))}))),Ke=(0,a.X$)((({isOpen:e,onClick:t,text:n,isDisabled:o})=>{const s=(0,a.sO)(null);return(0,a.d4)((()=>{const e=s.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)}),[e,n]),(0,a.d4)((()=>{const e=s.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}}),[]),a.ZP.createElement(Xe.Z,{className:(0,m.Z)("bot-menu",e&&"open"),round:!0,color:"translucent",disabled:o,onClick:t,ariaLabel:"Open bot command keyboard"},a.ZP.createElement("i",{className:(0,m.Z)("bot-menu-icon","icon","icon-webapp",e&&"open")}),a.ZP.createElement("span",{ref:s,className:"bot-menu-text"},n))})),Qe=e=>{const{isOpen:t}=e,n=(0,De.Z)(Be.gl.Extra,"ChatCommandTooltip",!t);return n?a.ZP.createElement(n,e):void 0};var et=n(18360),tt=n(12644),nt=n(17891),at=n(32683),ot=n(66902);const st=(0,a.X$)((0,o.c$)(((e,{shouldForceShowEditing:t})=>{const{chatId:n,threadId:a,type:o}=(0,l.Btg)(e)||{};if(!n||!a||!o)return{};const{forwardMessages:{fromChatId:s,toChatId:i,messageIds:r,noAuthors:c,noCaptions:d}}=(0,l.jUK)(e),m="scheduled"===o?(0,l.nBP)(e,n):(0,l._$9)(e,n,a),u=(0,l.FOo)(e),h=i===n,p=r?.map((t=>(0,l.hjO)(e,s,t))),Z=(0,l.Mst)(e,n,a),g=Z?.replyInfo;let f,v;if(g&&!t?f=(0,l.hjO)(e,g.replyToPeerId||n,g.replyToMsgId):m?f=(0,l.kKD)(e,n,a,o):h&&1===r.length&&(f=p?.[0]),g&&f&&!t){const{forwardInfo:t}=f,a=(0,l.FM1)(e,n);t&&(t.isChannelPost||a)&&(v=(0,l.cve)(e,f)),v||t?.hiddenUserName&&!Boolean(g.quoteText)||(v=(0,l.Urc)(e,f))}else h?(f&&(v=(0,l.cve)(e,f),v||(v=(0,l.Urc)(e,f))),v||(v=(0,l.RGZ)(e,s))):m&&f&&(v=(0,l.Urc)(e,f));const P=p?.some((e=>e?.content.text&&Object.keys(e.content).length>1)),E=h&&1===r.length&&Boolean(f?.content.storyData),y=g?.replyToMsgId===a&&!g.replyToPeerId;return{replyInfo:g,editingId:m,message:f,sender:v,shouldAnimate:u,forwardedMessagesCount:h?r.length:void 0,noAuthors:c,noCaptions:d,forwardsHaveCaptions:P,isCurrentUserPremium:(0,l.wVz)(e),isContextMenuDisabled:E,isReplyToDiscussion:y}}))((({replyInfo:e,editingId:t,message:n,sender:s,shouldAnimate:i,forwardedMessagesCount:r,noAuthors:l,noCaptions:d,forwardsHaveCaptions:u,shouldForceShowEditing:h,isCurrentUserPremium:p,isContextMenuDisabled:Z,isReplyToDiscussion:g,onClear:f})=>{const{resetDraftReplyInfo:v,setEditingId:P,focusMessage:E,changeForwardRecipient:y,setForwardNoAuthors:b,setForwardNoCaptions:C,exitForwardMode:w}=(0,o.Sv)(),S=(0,a.sO)(null),N=(0,B.Z)(),M="topicCreate"===n?.content.action?.type,k=Boolean(r),T=Boolean((e||t)&&n||s&&r),A=(0,nt.Z)([T,k],T&&k?300:void 0),{shouldRender:R,transitionClassNames:O}=(0,j.Z)(A&&T&&!M&&!g,void 0,!i,void 0,!i),L=(0,D.Z)((()=>{e&&!h?v():t?P({messageId:void 0}):r&&w(),f?.()}));(0,a.d4)((()=>T?(0,Me.Z)(L):void 0),[T,L]);const $=(0,D.Z)((()=>{k||E({chatId:n.chatId,messageId:n.id,noForumTopicPanel:!0})})),F=(0,D.Z)((e=>{e.stopPropagation(),L()})),U=(0,D.Z)((()=>{y()})),{isContextMenuOpen:_,contextMenuPosition:H,handleContextMenu:z,handleContextMenuClose:V,handleContextMenuHide:W}=(0,x.Z)(S),q=(0,D.Z)((()=>S.current)),Y=(0,D.Z)((()=>S.current)),G=(0,D.Z)((()=>S.current.querySelector(".forward-context-menu .bubble"))),{positionX:X,positionY:J,transformOriginX:K,transformOriginY:Q,style:ee}=(0,tt.Z)(H,q,Y,G);(0,a.d4)((()=>{R||V()}),[V,R]);const te=(0,m.Z)("ComposerEmbeddedMessage",O),ne=(0,et.Z)(s,!0),ae=(0,m.Z)("ComposerEmbeddedMessage_inner",(0,I.D)(ne)),oe=e&&!h,se=(0,a.Ye)((()=>oe?"reply":t?"edit":k?"forward":void 0),[t,k,oe]),ie=r&&r>1?N("ForwardedMessageCount",r):void 0,re=(0,a.Ye)((()=>{if(!n||!k||!n.content.text||!l||p)return n;const e=(0,c.If)(n.content.text);return{...n,content:{...n.content,text:e}}}),[p,k,n,l]),ce=(0,et.Z)(se,!0);if(R)return a.ZP.createElement("div",{className:te,ref:S,onContextMenu:z,onClick:z},a.ZP.createElement("div",{className:ae},a.ZP.createElement("div",{className:"embedded-left-icon"},ce&&a.ZP.createElement(He.Z,{name:ce}),Boolean(e?.quoteText)&&a.ZP.createElement(He.Z,{name:"quote",className:"quote-reply"})),a.ZP.createElement(at.m,{isOpen:T,className:"inside-input",replyInfo:e,isInComposer:!0,message:re,sender:l?void 0:s,customText:ie,title:t&&!oe?N("EditMessage"):l?N("HiddenSendersNameDescription"):void 0,onClick:$}),a.ZP.createElement(Xe.Z,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:N("Cancel"),onClick:F},a.ZP.createElement("i",{className:"icon icon-close"})),k&&!Z&&a.ZP.createElement(ze.Z,{isOpen:_,transformOriginX:K,transformOriginY:Q,positionX:X,positionY:J,style:ee,className:"forward-context-menu",onClose:V,onCloseAnimationEnd:W},a.ZP.createElement(Ve.Z,{icon:l?void 0:"message-succeeded",customIcon:l?a.ZP.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>b({noAuthors:!1})},N(r>1?"ShowSenderNames":"ShowSendersName")),a.ZP.createElement(Ve.Z,{icon:l?"message-succeeded":void 0,customIcon:l?void 0:a.ZP.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>b({noAuthors:!0})},N(r>1?"HideSenderNames":"HideSendersName")),u&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(ot.Z,null),a.ZP.createElement(Ve.Z,{icon:d?void 0:"message-succeeded",customIcon:d?a.ZP.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>C({noCaptions:!1})},N(r>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")),a.ZP.createElement(Ve.Z,{icon:d?"message-succeeded":void 0,customIcon:d?void 0:a.ZP.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>C({noCaptions:!0})},N(r>1?"Conversation.ForwardOptions.HideCaption":"HideCaption"))),a.ZP.createElement(ot.Z,null),a.ZP.createElement(Ve.Z,{icon:"replace",onClick:U},N("ChangeRecipient")))))})));var it=n(93219),rt=n(67146),ct=n(12420);const lt=e=>{const{isOpen:t}=e,n=(0,De.Z)(Be.gl.Extra,"DropArea",!t);return n?a.ZP.createElement(n,e):void 0};var dt=n(19830);const mt=e=>{const{isOpen:t}=e,n=(0,De.Z)(Be.gl.Extra,"InlineBotTooltip",!t);return n?a.ZP.createElement(n,e):void 0},ut=e=>{const{isOpen:t}=e,n=(0,De.Z)(Be.gl.Extra,"MentionTooltip",!t);return n?a.ZP.createElement(n,e):void 0};var ht=n(76609);const pt=e=>{const{isOpen:t}=e,n=(0,De.Z)(Be.gl.Extra,"PollModal",!t);return n?a.ZP.createElement(n,e):void 0},Zt=e=>{const{isOpen:t}=e,n=(0,De.Z)(Be.gl.Extra,"SendAsMenu",!t);return n?a.ZP.createElement(n,e):void 0},gt=e=>{const{isOpen:t}=e,n=(0,De.Z)(Be.gl.Extra,"StickerTooltip",!t);return n?a.ZP.createElement(n,e):void 0};var ft=n(23522),vt=n(54659);const Pt=new RegExp(i.FM6,"i"),Et=(0,a.X$)((0,o.c$)(((e,{chatId:t,threadId:n})=>{const a=(0,l.tVX)(e,t,n);return{theme:(0,l.Puy)(e),webPagePreview:(0,l.jUK)(e).webPagePreview,noWebPage:a}}))((({chatId:e,threadId:t,getHtml:n,isDisabled:i,webPagePreview:r,noWebPage:c,theme:l})=>{const{loadWebPagePreview:d,clearWebPagePreview:u,toggleMessageWebPage:h}=(0,o.Sv)(),p=(0,a.sO)(),Z=(0,W.iD)((()=>{const e=(0,g.ZP)(n()),t=e.entities?.find((e=>e.type===s.Vv.TextUrl));return p.current=e,t?.url||e.text.match(Pt)?.[0]}),[n],300,!0),f=(0,q.Z)(Z,[Z,n],!0);(0,a.d4)((()=>{const n=f(),a=p.current;n?d({text:a}):(u(),h({chatId:e,threadId:t}))}),[f,e,t]),(0,z.Z)((()=>{u(),h({chatId:e,threadId:t})}),[e,u,t,h]);const v=(0,A.Z)((()=>Boolean(r&&n()&&!c&&!i)),[i,n,c,r]),{shouldRender:P,transitionClassNames:E}=(0,j.Z)(v),y=(0,et.Z)(r,!0),b=(0,D.Z)((()=>{h({chatId:e,threadId:t,noWebPage:!0})}));if(!P||!y)return;const{photo:C,...w}=y,S={content:{webPage:w}};return a.ZP.createElement("div",{className:(0,m.Z)("WebPagePreview",E)},a.ZP.createElement("div",{className:"WebPagePreview_inner"},a.ZP.createElement("div",{className:"WebPagePreview-left-icon"},a.ZP.createElement("i",{className:"icon icon-link"})),a.ZP.createElement(vt.Z,{message:S,inPreview:!0,theme:l}),a.ZP.createElement(Xe.Z,{className:"WebPagePreview-clear",round:!0,faded:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:b},a.ZP.createElement("i",{className:"icon icon-close"}))))})));var yt=n(96621),bt=n(49204),Ct=n(70172);const wt=e=>{const{isOpen:t}=e,n=(0,De.Z)(Be.gl.Extra,"DeleteMessageModal",!t);return n?a.ZP.createElement(n,e):void 0};var St=n(36368),It=function(e){return e.Send="send",e.Record="record",e.Edit="edit",e.Schedule="schedule",e.Forward="forward",e.SendOneTime="sendOneTime",e}(It||{});const Nt=(0,a.X$)((0,o.c$)(((e,{chatId:t,threadId:n,storyId:a,messageListType:o,isMobile:r,type:m})=>{const u=(0,l.Z1J)(e,t),h=t!==i.FVh?(0,l.kBx)(e,t):void 0,p=Boolean(h),Z=(0,l.FM1)(e,t),g=(0,c.YC)(t),f=p?(0,l.ccz)(e,h.id):void 0,v=g?void 0:(0,l.x67)(e,t),P=(p||!g)&&(0,l.FTG)(e,t,n),E=(0,l.qyA)(e,t,n),{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,l.hjO)(e,t,N):void 0,{currentUserId:k}=e,T=(0,l.dyD)(e,k),x=v?v?.sendAsId||k:void 0,A=u?.sendAsPeerIds&&x&&(u.sendAsPeerIds.some((e=>e.id===x))?x:u?.adminRights?.anonymous?u?.id:void 0),R=A?(0,l.dyD)(e,A):void 0,O=!R&&A?(0,l.Z1J)(e,A):void 0,L=(0,l.Rf5)(e,t),B=(0,l.nAc)(e,t),D=(0,l.jUK)(e),$=Boolean(D.storyViewer.storyId),F=(0,l.Btg)(e),U=t===F?.chatId&&n===F?.threadId&&o===F?.type&&!$,j=(0,l.dyD)(e,t),_=(j&&!(0,l.ccz)(e,j.id)?.noVoiceMessages)??!0,H=v?.slowMode,z=(0,l.wVz)(e),V="scheduled"===o?(0,l.hI0)(e,t):(0,l.saH)(e,t,n),W=a&&(0,l.JrV)(e,t,a),q=W&&"sentReaction"in W?W.sentReaction:void 0,Y=(0,l.Mst)(e,t,n),G=Y?.replyInfo?(0,l.hjO)(e,t,Y.replyInfo.replyToMsgId):void 0,X=u?.isForum&&u.isForumAsMessages&&n===s._f&&G?(0,l.p$s)(e,G):void 0,J="scheduled"===o,K=g&&!p&&!J&&!Z;return{availableReactions:"story"===m?e.reactions.availableReactions:void 0,topReactions:"story"===m?e.reactions.topReactions:void 0,isOnActiveTab:!D.isBlurred,editingMessage:(0,l.kKD)(e,t,n,o),draft:Y,chat:u,isChatWithBot:p,isChatWithSelf:Z,isForCurrentMessageList:U,canScheduleUntilOnline:(0,l.Eh5)(e,t),isChannel:u?(0,c.eA)(u):void 0,isRightColumnShown:(0,l.Jf5)(e,r),isSelectModeActive:(0,l.CAb)(e),withScheduledButton:"thread"===o&&Boolean(E?.length),isInScheduledList:J,botKeyboardMessageId:N,botKeyboardPlaceholder:M?.keyboardPlaceholder,isForwarding:t===D.forwardMessages.toChatId,pollModal:D.pollModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,chatFullInfo:v,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:k,currentUser:T,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,botCommands:f?f.botInfo?.commands||!1:void 0,botMenuButton:f?.botInfo?.menuButton,sendAsUser:R,sendAsChat:O,sendAsId:A,editingDraft:V,requestedDraft:L,requestedDraftFiles:B,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,l.taM)(e,t),theme:(0,l.Puy)(e),fileSizeLimit:(0,d.M)(e,"uploadMaxFileparts")*i.pJM,captionLimit:(0,d.M)(e,"captionLength"),isCurrentUserPremium:z,canSendVoiceByPrivacy:_,attachmentSettings:e.attachmentSettings,slowMode:H,currentMessageList:F,isReactionPickerOpen:(0,l.Io8)(e),canBuyPremium:!z&&!(0,l.oe5)(e),canPlayAnimatedEmojis:(0,l.W9H)(e),canSendOneTimeMedia:!Z&&g&&!p&&!J,shouldCollectDebugLogs:e.settings.byKey.shouldCollectDebugLogs,sentStoryReaction:q,stealthMode:e.stories.stealthMode,replyToTopic:X,quickReplyMessages:e.quickReplies.messagesById,quickReplies:e.quickReplies.byId,canSendQuickReplies:K}}))((({type:e,isOnActiveTab:t,dropAreaState:n,isInScheduledList:l,canScheduleUntilOnline:d,isReady:y,isMobile:G,onDropHide:X,onFocus:J,onBlur:K,editingMessage:Q,chatId:ee,threadId:te,storyId:ne,currentMessageList:ae,messageListType:oe,draft:se,chat:ie,chatFullInfo:re,replyToTopic:ce,isForCurrentMessageList:ve,isCurrentUserPremium:ke,canSendVoiceByPrivacy:Te,isChatWithBot:xe,isChatWithSelf:Ae,isChannel:Re,fileSizeLimit:Be,isRightColumnShown:De,isSelectModeActive:Fe,isReactionPickerOpen:Ue,isForwarding:je,pollModal:_e,botKeyboardMessageId:ze,botKeyboardPlaceholder:Ve,inputPlaceholder:qe,withScheduledButton:et,stickersForEmoji:tt,customEmojiForEmoji:nt,topInlineBotIds:at,currentUserId:ot,currentUser:vt,captionLimit:Pt,contentToBeScheduled:Nt,shouldSuggestStickers:Mt,shouldSuggestCustomEmoji:kt,baseEmojiKeywords:Tt,emojiKeywords:xt,recentEmojis:At,inlineBots:Rt,isInlineBotLoading:Ot,botCommands:Lt,sendAsUser:Bt,sendAsChat:Dt,sendAsId:$t,editingDraft:Ft,requestedDraft:Ut,requestedDraftFiles:jt,botMenuButton:_t,attachBots:Ht,attachMenuPeerType:zt,attachmentSettings:Vt,theme:Wt,slowMode:qt,shouldUpdateStickerSetOrder:Yt,editableInputCssSelector:Gt,editableInputId:Xt,inputId:Jt,className:Kt,availableReactions:Qt,topReactions:en,canBuyPremium:tn,canPlayAnimatedEmojis:nn,shouldCollectDebugLogs:an,sentStoryReaction:on,stealthMode:sn,canSendOneTimeMedia:rn,quickReplyMessages:cn,quickReplies:ln,canSendQuickReplies:dn,onForward:mn})=>{const{sendMessage:un,clearDraft:hn,showDialog:pn,forwardMessages:Zn,openPollModal:gn,closePollModal:fn,loadScheduledHistory:vn,openThread:Pn,addRecentEmoji:En,sendInlineBotResult:yn,loadSendAs:bn,resetOpenChatWithDraft:Cn,callAttachBot:wn,addRecentCustomEmoji:Sn,showNotification:In,showAllowedMessageTypesNotification:Nn,openStoryReactionPicker:Mn,closeReactionPicker:kn,sendStoryReaction:Tn,editMessage:xn}=(0,o.Sv)(),An=(0,B.Z)(),Rn=(0,a.sO)(null),On=(0,a.sO)(null),[Ln,Bn]=(0,_.Z)(""),[Dn,$n]=(0,a.eJ)(!1),Fn=(0,L.Z)(Gt),Un=(0,a.sO)(),jn=(0,$.Z)(n),{width:_n}=E.Z.get(),Hn="messageList"===e,zn="story"===e,Vn=Hn?ie?.sendAsPeerIds:void 0,Wn=Vn&&(Vn.length>1||!Vn.some((e=>e.id===ot))),[qn,Yn,Gn]=(0,O.Z)(),Xn=(0,U.Z)(ee,te),[Jn,Kn,Qn]=(0,O.Z)(),[ea,ta,na]=(0,O.Z)(),aa=Q&&(0,c.jL)(Q),{emojiSet:oa,members:sa,botCommands:ia}=re||{},ra=oa?.id,ca=!(!on||!("emoticon"in on))&&on.emoticon===i.mzt.emoticon;(0,a.d4)(h.AU,[Ln]);const la=(0,a.sO)(0),[da,ma]=(0,F.Z)(Hn&&d,Gn);(0,T.Z)((()=>{$n(!0)}),430),(0,a.d4)((()=>{Hn||kn()}),[Hn,ne]),(0,a.d4)((()=>{Un.current=void 0}),[ee]),(0,a.d4)((()=>{ee&&y&&!zn&&vn({chatId:ee})}),[y,ee,te,zn]),(0,a.d4)((()=>{ee&&ie&&!Vn&&y&&(0,c.ZV)(ie)&&bn({chatId:ee})}),[ie,ee,y,bn,Vn]);const ua=(0,a.sO)(!1);(0,z.Z)((([e,t])=>{ua.current=Boolean(ee===e&&Vn&&!t)}),[ee,Vn]);const[ha,pa]=(0,a.eJ)([]),Za=Boolean(ha.length),[ga,fa]=(0,a.eJ)(void 0),{canSendStickers:va,canSendGifs:Pa,canAttachMedia:Ea,canAttachPolls:ya,canAttachEmbedLinks:ba,canSendVoices:Ca,canSendPlainText:wa,canSendAudios:Sa,canSendVideos:Ia,canSendPhotos:Na,canSendDocuments:Ma}=(0,a.Ye)((()=>(0,c.H5)(ie,re,xe,zn)),[ie,re,xe,zn]),ka=!wa&&!Q,Ta=(0,D.Z)(((e,t=Xt)=>{if(t===Xt&&ka)return;const n=window.getSelection();let a;if(a=t===Xt?document.querySelector(Gt):document.getElementById(t),n.rangeCount){const o=n.getRangeAt(0);if((0,S.R)(o,t))return(0,f.tx)(e),void a.dispatchEvent(new Event("input",{bubbles:!0}))}Bn(`${Ln()}${e}`),(0,r.Yq)((()=>{(0,p.Z)(a)}))})),xa=(0,D.Z)(((e,t=Xt)=>{const n=(0,N.Z)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");Ta(n,t)})),Aa=(0,D.Z)(((e,t=Xt)=>{const n=(0,M.z)(e);Ta(n,t)})),Ra=(0,D.Z)(((e,t=Xt)=>{Ta((0,w.yR)(e),t)})),Oa=(0,D.Z)((()=>{ga&&(Aa(ga,Xt),fa(void 0))})),{shouldSuggestCompression:La,shouldForceCompression:Ba,shouldForceAsFile:Da,handleAppendFiles:$a,handleFileSelect:Fa,onCaptionUpdate:Ua,handleClearAttachments:ja,handleSetAttachments:_a}=function({attachments:e,fileSizeLimit:t,setHtml:n,setAttachments:s,chatId:i,canSendAudios:r,canSendVideos:l,canSendPhotos:d,canSendDocuments:m,insertNextText:u,editedMessage:h}){const p=(0,B.Z)(),{openLimitReachedModal:g,showAllowedMessageTypesNotification:f,showNotification:v}=(0,o.Sv)(),[P,E]=(0,a.eJ)(!1),[y,b]=(0,a.eJ)(!1),[w,S]=(0,a.eJ)(void 0),I=(0,D.Z)((()=>{s(Z.D),u()})),N=(0,D.Z)((n=>{const a="function"==typeof n?n(e):n;if(a.length)if(a.some((e=>{const t=(0,c.SA)(e);return"audio"===t&&!r&&!m||"video"===t&&!l&&!m||"image"===t&&!d&&!m||"file"===t&&!m})))f({chatId:i});else if(a.some((({size:e})=>e>t)))g({limit:"uploadMaxFileparts"});else{s(a);const e=a.some((e=>{const t=(0,c.SA)(e);return"audio"===t&&!r||"video"===t&&!l||"image"===t&&!d}));E(Boolean(e&&m)),b(!m),S(void 0)}else I()}));return{shouldSuggestCompression:w,handleAppendFiles:(0,D.Z)((async(t,n)=>{if(h){const e=await(0,C.Z)(t[0].name,t[0]),n=h&&(0,c.Gy)(h,e);h?.groupedId?n?N([e]):v({message:p("lng_edit_media_album_error")}):N([e])}else{const a=await Promise.all(t.map((e=>(0,C.Z)(e.name,e,{shouldSendAsSpoiler:n||void 0}))));N([...e,...a])}})),handleFileSelect:(0,D.Z)((async(e,t)=>{if(h){const t=await(0,C.Z)(e[0].name,e[0]),n=h&&(0,c.Gy)(h,t);h?.groupedId?n?N([t]):v({message:p("lng_edit_media_album_error")}):N([t])}else{const t=await Promise.all(e.map((e=>(0,C.Z)(e.name,e))));N(t)}S(t)})),onCaptionUpdate:n,handleClearAttachments:I,handleSetAttachments:N,shouldForceCompression:y,shouldForceAsFile:P}}({attachments:ha,setHtml:Bn,setAttachments:pa,fileSizeLimit:Be,chatId:ee,canSendAudios:Sa,canSendVideos:Ia,canSendPhotos:Na,canSendDocuments:Ma,insertNextText:Oa,editedMessage:Q}),[Ha,za,Va]=(0,O.Z)(),[Wa,qa,Ya]=(0,O.Z)(),[Ga,Xa,Ja]=(0,O.Z)(),[Ka,Qa,eo]=(0,O.Z)(),[to,no,ao]=(0,O.Z)(),[oo,so,io]=(0,O.Z)(),{startRecordingVoice:ro,stopRecordingVoice:co,pauseRecordingVoice:lo,activeVoiceRecording:mo,currentRecordTime:uo,recordButtonRef:ho,startRecordTimeRef:po,isViewOnceEnabled:Zo,setIsViewOnceEnabled:go,toogleViewOnceEnabled:fo}=(()=>{const e=(0,a.sO)(null),[t,n]=(0,a.eJ)(),o=(0,a.sO)(),[s,i]=(0,a.eJ)(),[c,l]=(0,a.eJ)(!1);(0,a.d4)((()=>{P.s$&&P.mh&&Oe()}),[]);const d=(0,D.Z)((async()=>{try{const{stop:t,pause:a}=await Le((t=>{e.current&&(o.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)`)})),i(Date.now()))}));o.current=Date.now(),i(Date.now()),n({stop:t,pause:a})}catch(e){console.error(e)}})),m=(0,D.Z)((()=>{if(t){(0,r.WM)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.pause()}catch(e){return void console.error(e)}}})),u=(0,D.Z)((()=>{if(t){n(void 0),o.current=void 0,i(void 0),(0,r.WM)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.stop()}catch(e){return void console.error(e)}}}));(0,a.d4)((()=>t?(0,Me.Z)(u):void 0),[t,u]);const h=(0,D.Z)((()=>{l(!c)}));return{startRecordingVoice:d,pauseRecordingVoice:m,stopRecordingVoice:u,activeVoiceRecording:t,currentRecordTime:s,recordButtonRef:e,startRecordTimeRef:o,isViewOnceEnabled:c,setIsViewOnceEnabled:l,toogleViewOnceEnabled:h}})(),vo=ve&&!zn;(0,k.Z)((()=>{Xn({type:"recordAudio"})}),vo?mo&&i.o_S:void 0),(0,a.d4)((()=>{ve&&!zn&&(mo||Xn({type:"cancel"}))}),[mo,ve,zn,Xn]);const Po=(0,H.Y)(Boolean(Q));(0,a.d4)((()=>{ve&&!zn&&Ln()&&!Po.current&&Xn({type:"typing"})}),[Ln,Po,ve,zn,Xn]);const Eo=ie&&(0,c.Nl)(ie),{isEmojiTooltipOpen:yo,closeEmojiTooltip:bo,filteredEmojis:Co,filteredCustomEmojis:wo,insertEmoji:So}=(0,fe.Z)(Boolean(y&&t&&(zn||ve)&&Mt&&!Za),Ln,Bn,void 0,At,Tt,xt),{isCustomEmojiTooltipOpen:Io,closeCustomEmojiTooltip:No,insertCustomEmoji:Mo}=(0,de.Z)(Boolean(y&&t&&(zn||ve)&&kt&&!Za),Ln,Bn,Fn,Rn,nt),{isStickerTooltipOpen:ko,closeStickerTooltip:To}=function(e,t,n){const{loadStickersForEmoji:s,clearStickersForEmoji:r}=(0,o.Sv)(),[c,l,d]=(0,O.Z)(!1),m=(0,q.Z)((()=>{const n=t();if(!e||!n||P.op&&n.length>8)return;if(!n.match(P.op?Se.Z:i.t8f))return;const a=(0,V._)(n);return a&&(P.op&&1===(0,Ie.Z)(a)||!P.op&&Boolean(n.match(Ne)))?P.op?a:a.match(/alt="(.+)"/)?.[1]:void 0}),[t,e]),u=(0,A.Z)((()=>Boolean(m())),[m]),h=Boolean(n?.length);return(0,a.d4)((()=>{if(!e||!u)return;const t=m();t?h||s({emoji:t}):r()}),[e,u,m,h,s,r]),(0,a.d4)(d,[d,t]),{isStickerTooltipOpen:Boolean(u&&h&&!c),closeStickerTooltip:l}}(Boolean(y&&t&&(zn||ve)&&Mt&&va&&!Za),Ln,tt),{isMentionTooltipOpen:xo,closeMentionTooltip:Ao,insertMention:Ro,mentionFilteredUsers:Oo}=(0,we.Z)(Boolean(Hn&&y&&ve&&!Za),Ln,Bn,Fn,Rn,sa,at,ot),{isOpen:Lo,botId:Bo,isGallery:Do,switchPm:$o,switchWebview:Fo,results:Uo,closeTooltip:jo,help:_o,loadMore:Ho}=function(e,t,n,s){const{queryInlineBot:i,resetInlineBot:r,resetAllInlineBots:c}=(0,o.Sv)(),[l,d,m]=(0,O.Z)(!1),u=(0,W.CH)((()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return ye;const t=function(e){return be.innerHTML=e.replace(/<br>/g,"\n"),be.querySelectorAll("[alt]").forEach((e=>{e.innerText||(e.innerText=e.getAttribute("alt"))})),be.innerText}(e),n=t.match(Pe);return n?Ce(n[1],n[2],""===n[2]&&!t.match(Ee)):ye}(t):ye}),[n,e],300),{username:h,query:p,canShowHelp:Z,usernameLowered:g}=(0,A.Z)(u,[u,n],!0);(0,z.Z)((([e])=>{e&&r({username:e})}),[h,r]),(0,a.d4)((()=>{g&&i({chatId:t,username:g,query:p})}),[t,p,i,g]),(0,a.d4)(m,[m,n]);const{id:f,switchPm:v,switchWebview:P,offset:E,results:y,isGallery:b,help:C}=g&&s?.[g]||{},w=Boolean((y?.length||v)&&!l);(0,a.d4)((()=>{w||h||c()}),[w,c,h]);const S=(0,D.Z)((()=>{g&&i({chatId:t,username:g,query:p,offset:E})}));return{isOpen:w,botId:f,isGallery:b,switchPm:v,switchWebview:P,results:y,closeTooltip:d,help:Z&&C?`@${h} ${C}`:void 0,loadMore:S}}(Boolean(Hn&&y&&ve&&!Za),ee,Ln,Rt),zo=Boolean(ln&&Object.keys(ln).length),{isOpen:Vo,close:Wo,filteredBotCommands:qo,filteredQuickReplies:Yo}=function(e,t,n,o,s){const[i,r]=(0,a.eJ)(),[c,l]=(0,a.eJ)(),[d,m,u]=(0,O.Z)(!1),h=(0,W.CH)((()=>{const n=t();return e&&n.startsWith("/")?(0,V._)(n).match(Y)?.[0].trim():void 0}),[t,e],300),p=(0,q.Z)(h,[h,t],!0);return(0,a.d4)((()=>{const e=p(),t=n||o;if(!e||!t&&!s)return r(void 0),void l(void 0);const a=e.substring(1),i=t?.filter((e=>!a||e.command.startsWith(a)));r(i?.length?i:void 0);const c=Object.values(s||{}).filter((e=>!a||e.shortcut.startsWith(a)));l(c?.length?c:void 0)}),[p,n,o,s]),(0,a.d4)(u,[u,t]),{isOpen:Boolean((i?.length||c?.length)&&!d),close:m,filteredBotCommands:i,filteredQuickReplies:c}}(Boolean(Hn&&y&&ve&&(Lt&&Lt?.length||ia?.length||zo&&dn)),Ln,Lt,ia,dn?ln:void 0);(({draft:e,chatId:t,threadId:n,getHtml:c,setHtml:l,editedMessage:d,isDisabled:m})=>{const{saveDraft:u,clearDraft:h,loadCustomEmojis:p}=(0,o.Sv)(),Z=(0,a.sO)(!1);(0,a.d4)((()=>{const t=c(),n=void 0!==e?.isLocal;(0,M.z)(e?.text)!==t||n?Z.current=!0:Z.current=!1}),[e,c]),(0,a.d4)((()=>{Z.current=!1}),[t,n]);const f=Boolean(d),v=(0,D.Z)(((e={})=>{if(m||f||!Z.current)return;const a=c();a?(0,r.i$)((()=>{u({chatId:e.chatId??t,threadId:e.threadId??n,text:(0,g.ZP)(a)})})):h({chatId:e.chatId??t,threadId:e.threadId??n,shouldKeepReply:!0})})),P=(0,ue.Z)(i.r_R,!0,void 0,[t,n]);(0,me.Z)((([a,o,i])=>{if(m)return;const r=Z.current;if(t===a&&n===o){if(r&&!e)return;if(!e&&i&&l(""),r)return}if(d||!e)return;l((0,M.z)(e.text));const c=e.text?.entities?.map((e=>e.type===s.Vv.CustomEmoji&&e.documentId)).filter(Boolean)||[];c.length&&p({ids:c})}),[t,n,e,c,l,d,m]),(0,a.bt)((()=>{if(!m)return()=>{f||v({chatId:t,threadId:n}),Ze=!0,(0,r.i$)((()=>{Ze=!1}))}}),[t,n,f,v,m]);const E=(0,H.Y)(t),y=(0,H.Y)(n);(0,a.d4)((()=>{if(m||Ze)return;if(!c())return void v();const e=E.current,t=y.current;P((()=>{E.current===e&&y.current===t&&v()}))}),[E,c,m,P,y,v]),(0,he.Z)(v),(0,pe.Z)(v)})({draft:se,chatId:ee,threadId:te,getHtml:Ln,setHtml:Bn,editedMessage:Q,isDisabled:zn||Boolean(Ut)});const Go=(0,D.Z)(((e=!1)=>{e||Bn(""),pa(Z.D),fa(void 0),bo(),No(),To(),Ao(),G?setTimeout((()=>Ja()),350):Ja()})),[Xo,Jo,Ko]=((e,t,n,s,l,d,m,u,h,Z)=>{const{editMessage:f,setEditingDraft:v,toggleMessageWebPage:P}=(0,o.Sv)(),[E,y]=(0,a.eJ)(!1),b=h?.replyInfo?.replyToMsgId;(0,R.Z)((([e,a])=>{if(!n)return;if(b&&a!==b)return t(""),void y(!1);if(e?.id===n.id&&b===a)return;const o=!e&&Z?.text.length?Z:n.content.text,s=(0,M.z)(o);t(s),y(!0),(0,r.Yq)((()=>{const e=document.querySelector(i.Edp);e&&(0,p.Z)(e,!0)}))}),[n,b,Z,t]),(0,a.d4)((()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some((e=>ge.has(e.type)));P({chatId:d,threadId:m,noWebPage:e})}),[d,m,n]),(0,a.d4)((()=>{if(n)return()=>{const t=(0,g.ZP)(e()),n=t.text.length?t:void 0;v({chatId:d,threadId:m,type:u,text:n})}}),[d,n,e,v,m,u]);const C=(0,W.iD)((()=>{if(!n)return!1;const t=(0,g.ZP)(e());return!("webPage"in n.content)&&n.content.text?.entities?.some((e=>ge.has(e.type)))&&!t.entities?.some((e=>ge.has(e.type)))}),[n,e],300,!0),w=(0,q.Z)(C,[C,e],!0);(0,R.Z)((([e])=>{n&&e?.id===n.id&&w()&&P({chatId:d,threadId:m,noWebPage:!1})}),[n,d,e,m,w]);const S=(0,D.Z)((()=>{h&&(0,r.i$)((()=>{t((0,M.z)(h.text)),(0,r.Yq)((()=>{const e=document.querySelector(i.Edp);e&&(0,p.Z)(e,!0)}))}))})),I=(0,D.Z)((()=>{s(),S()})),N=(0,D.Z)((()=>{const{text:t,entities:a}=(0,g.ZP)(e());n&&(t||(0,c.u8)(n)?(f({messageList:{chatId:d,threadId:m,type:u},text:t,entities:a}),s(),S()):l())})),k=(0,D.Z)((()=>{if(!n)return;const t=(0,g.ZP)(e()),a=t.text.length?t:void 0;v({chatId:d,threadId:m,type:u,text:a})}));return(0,he.Z)(k),(0,pe.Z)(k),[N,I,E]})(Ln,Bn,Q,Go,no,ee,te,oe,se,Ft),Qo=(0,H.Y)(Go),es=(0,H.Y)(co);(0,a.d4)((()=>()=>{es.current(),Qo.current()}),[ee,te,Qo,es]);const ts=(0,D.Z)((()=>{const e=la.current;In(e?{message:An("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:ot,shouldReplaceHistory:!0}},actionText:An("Open")}:{message:An("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:An("PremiumMore")}),la.current=Number(!e)})),ns=(0,A.Z)((()=>Jn||!mn||Ln()&&!Za?Q&&Ko?It.Edit:!P.mh||mo||je||Ln()&&!Za?l?It.Schedule:It.Send:It.Record:It.Forward),[mo,Q,Ln,Za,je,Jn,mn,Ko,l]),as=!l,{isContextMenuOpen:os,handleContextMenu:ss,handleContextMenuClose:is,handleContextMenuHide:rs}=(0,x.Z)(ho,!(ns===It.Send&&as)),{contextMenuPosition:cs,handleContextMenu:ls,handleBeforeContextMenu:ds,handleContextMenuHide:ms}=(0,x.Z)(On,!zn);(0,a.d4)((()=>{Ue||cs&&(Mn({peerId:ee,storyId:ne,position:cs}),ms())}),[ee,ms,Ue,ne,cs]),le(ve||zn,Aa,_a,fa,Q,!ke&&!Ae,ts);const us=(0,D.Z)((()=>{Q&&Jo()})),hs=(0,D.Z)(((e,t)=>{const n=t?Pt:4096;if(e?.length>n){const t=e.length-n;return pn({data:{message:"MESSAGE_TOO_LONG_PLEASE_REMOVE_CHARACTERS",textParams:{"{EXTRA_CHARS_COUNT}":t.toString(),"{PLURAL_S}":t>1?"s":""},hasErrorKey:!0}}),!1}return!0})),ps=(0,D.Z)((()=>{if(qt&&!Eo){const e=document.querySelector(Gt),t=(0,v.bp)(),n=Un.current&&Math.floor(t-Un.current),a=qt.nextSendDate&&qt.nextSendDate>t;if(n&&n<qt.seconds||a){const o=a?qt.nextSendDate-t:qt.seconds-n;return pn({data:{message:An("SlowModeHint",(0,u.k9)(o)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0})),Zs=(0,D.Z)((({attachments:e,sendCompressed:t=Vt.shouldCompress,sendGrouped:n=Vt.shouldSendGrouped,isSilent:a,scheduledAt:o})=>{if(!ae&&!ne)return;const{text:s,entities:i}=(0,g.ZP)(Ln());(s||e.length)&&hs(s,!0)&&ps()&&(Q?xn({messageList:ae,text:s,entities:i,attachments:(0,C.V)(e,t)}):un({messageList:ae,text:s,entities:i,scheduledAt:o,isSilent:a,shouldUpdateStickerSetOrder:Yt,attachments:(0,C.V)(e,t),shouldGroupMessages:n}),Un.current=(0,v.bp)(),hn({chatId:ee,isLocalOnly:!0}),(0,r.i$)((()=>{Go()})))})),gs=(0,D.Z)(((e,t,n,a)=>{Zs({attachments:ha,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:a})})),fs=(0,D.Z)((async(e=!1,t)=>{if(!ae&&!ne)return;let n=ha;if(mo){const e=await co(),t=Zo?i.jfZ:void 0;if(e){const{blob:a,duration:o,waveform:s}=e;n=[await(0,C.Z)("wonderful-voice-message.ogg",a,{voice:{duration:o,waveform:s},ttlSeconds:t})]}}const{text:a,entities:o}=(0,g.ZP)(Ln());if(n.length)return void Zs({attachments:n,scheduledAt:t,isSilent:e});if(!a&&!je)return;if(!hs(a))return;const s=document.querySelector(Gt);if(a){if(!ps())return;un({messageList:ae,text:a,entities:o,scheduledAt:t,isSilent:e,shouldUpdateStickerSetOrder:Yt})}je&&Zn({scheduledAt:t,isSilent:e}),Un.current=(0,v.bp)(),hn({chatId:ee,isLocalOnly:!0}),P.cj&&s&&s===document.activeElement&&b(s),(0,r.i$)((()=>{Go()}))})),vs=(0,D.Z)((()=>{"webApp"===_t?.type&&wn({chatId:ee,url:_t.url,threadId:te})})),Ps=(0,D.Z)((()=>{Ja(),qa()})),Es=(0,D.Z)(((e,t,n)=>{if(e&&"queryId"in e){const{id:a,queryId:o,isSilent:s}=e;return void yn({id:a,queryId:o,scheduledAt:t,isSilent:s,messageList:n})}const{isSilent:a,...o}=e||{};if(e&&0!==Object.keys(o).length)if(void 0!==e.sendCompressed||void 0!==e.sendGrouped){const{sendCompressed:n=!1,sendGrouped:o=!1}=e;gs(n,o,a,t)}else un({...e,messageList:n,scheduledAt:t});else fs(Boolean(a),t)}));(0,R.Z)((([e])=>{ae&&Nt&&Nt!==e&&da((e=>{Es(Nt,e,ae)}))}),[Nt,ae,Es,da]),(0,a.d4)((()=>{Ut&&(Aa(Ut),Cn(),(0,r.Yq)((()=>{const e=document.getElementById(Xt);(0,p.Z)(e,!0)})))}),[Xt,Ut,Cn,Bn]),(0,a.d4)((()=>{jt?.length&&(Fa(jt),Cn())}),[Fa,jt,Cn]);const ys=(0,D.Z)(((e,t)=>{const n="id"in e.stickerSetInfo&&e.stickerSetInfo.id;e.isFree||ke||Ae||n===ra?Ra(e,t):ts()})),bs=(0,D.Z)((e=>{ys(e,i.nYf)})),Cs=(0,D.Z)(((e,t,n)=>{(ae||ne)&&(l||n?(Yn(),da((n=>{Gn(),Es({gif:e,isSilent:t},n,ae),(0,r.i$)((()=>{Go(!0)}))}))):(un({messageList:ae,gif:e,isSilent:t}),(0,r.i$)((()=>{Go(!0)}))))})),ws=(0,D.Z)(((e,t,n,a=!1,o)=>{(ae||ne)&&(e={...e,isPreloadedGlobally:!0},l||n?(Yn(),da((n=>{Gn(),Es({sticker:e,isSilent:t},n,ae),(0,r.i$)((()=>{Go(a)}))}))):(un({messageList:ae,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:Yt&&o}),(0,r.i$)((()=>{Go(a)}))))})),Ss=(0,D.Z)(((e,t,n)=>{if(!ae&&!ne)return;l||n?da((n=>{Es({id:e.id,queryId:e.queryId,isSilent:t},n,ae)})):yn({id:e.id,queryId:e.queryId,isSilent:t,messageList:ae});const a=document.querySelector(Gt);P.cj&&a&&a===document.activeElement&&b(a),hn({chatId:ee,isLocalOnly:!0}),(0,r.i$)((()=>{Go()}))})),Is=(0,D.Z)((()=>{hn({chatId:ee,isLocalOnly:!0}),(0,r.i$)((()=>{Go()}))})),Ns=(0,D.Z)((e=>{ae&&(l?(da((t=>{Es({poll:e},t,ae)})),fn()):(un({messageList:ae,poll:e}),fn()))})),Ms=(0,D.Z)((e=>{if(l)da((t=>{Es({...e,isSilent:!0},t,ae)}));else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1}=e;gs(t,n,!0)}else fs(!0)})),ks=(0,D.Z)((()=>{const e=document.querySelector(Gt);if(!G||e!==document.activeElement)return Ya(),Ja(),void Qa();e?.blur(),setTimeout((()=>{Ya(),Ja(),Qa()}),100)}));(0,a.d4)((()=>{ka&&Bn("")}),[ka,Bn,ha]);const Ts=(0,D.Z)((e=>{xa(e,i.nYf)})),xs=(0,D.Z)(((e=Xt)=>{const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,S.R)(n,e))return void document.execCommand("delete",!1)}Bn(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 a=n.textContent.length,o=document.createRange(),s=window.getSelection();o.setStart(n,a),o.setEnd(n,a),s.removeAllRanges(),s.addRange(o),document.execCommand("delete",!1);const i=t.innerHTML;return document.body.removeChild(t),i}(Ln()))})),As=(0,D.Z)((()=>{xs(i.nYf)})),Rs=(0,D.Z)((()=>{Pn({chatId:ee,threadId:te,type:"scheduled",noForumTopicPanel:!0})}));(0,a.d4)((()=>{De&&G&&Ja()}),[De,Ja,G]),(0,a.d4)((()=>{y&&(Fe?so():setTimeout((()=>{io()}),200))}),[Fe,io,so,y]);const Os=xe&&"webApp"===_t?.type&&!Q,Ls=(0,A.Z)((()=>Os&&!Ln()&&!mo),[Os,Ln,mo]),[Bs,Ds]=(0,a.Ye)((()=>qt?.nextSendDate?["SlowModeWait",qt.nextSendDate]:sn?.activeUntil&&zn?["StealthModeActiveHint",sn.activeUntil]:[]),[zn,qt?.nextSendDate,sn?.activeUntil]),$s=Ha||Ga||yo||Ka||xo||Lo||to||Wa||ea||ko||Vo||Io||Ls||os||Boolean(mo)||ha.length>0||Jn,Fs=$s&&!Ue&&zn&&!ea&&!Ga,Us=ie?.isForum&&ie?.isForumAsMessages&&te===s._f?ce?An("Chat.InputPlaceholderReplyInTopic",ce.title):An("Message.Placeholder.MessageInGeneral"):void 0;(0,a.d4)((()=>{$s?J?.():K?.()}),[$s,K,J]);const{shouldRender:js,transitionClassNames:_s}=(0,j.Z)(Fs),Hs=!(ns!==It.Record||Ea&&Te&&Ca),zs=(0,D.Z)((()=>{switch(ns){case It.Forward:mn?.();break;case It.Send:fs();break;case It.Record:Hs?Te?Ca||Nn({chatId:ee}):In({message:An("VoiceMessagesRestrictedByPrivacy",ie?.title)}):(go(!1),ro());break;case It.Edit:Xo();break;case It.Schedule:if(mo&&lo(),!ae)return;da((e=>{Es({},e,ae)}))}})),Vs=(0,$.Z)(Q,!0),Ws=Q||Vs,qs=new Date;qs.setSeconds(0),qs.setMilliseconds(0);const Ys=new Date;Ys.setFullYear(Ys.getFullYear()+1);let Gs="SendMessage";switch(ns){case It.Forward:Gs="Forward";break;case It.Edit:Gs="Save edited message";break;case It.Record:Gs=Ea?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const Xs=(0,m.Z)("Composer",!Fe&&"shown",oo&&"hover-disabled",Dn&&"mounted",Kt),Js=(0,D.Z)((e=>{let t,n;if("emoticon"in e)t=e.emoticon;else{const a=(0,o.Rd)().customEmojis.byId[e.documentId];if(!a)return;if(!a.isFree&&!ke&&!Ae)return void ts();const s=(0,g.ZP)((0,w.yR)(a));t=s.text,n=s.entities}un({text:t,entities:n,isReaction:!0}),kn()})),Ks=(0,D.Z)((e=>{Mn({peerId:ee,storyId:ne,position:e,sendAsMessage:!0})})),Qs=(0,D.Z)((()=>{const e=on?void 0:i.mzt;Tn({peerId:ee,storyId:ne,containerId:(0,c.hl)(ee,ne),reaction:e})})),ei=(0,D.Z)((()=>{da((e=>{Es({},e,ae)}))})),ti=(0,D.Z)((()=>{Ms()})),ni=(0,D.Z)((()=>{Es({},i.t4X,ae)})),ai=(0,D.Z)(((e,t)=>{da((n=>{Es({sendCompressed:e,sendGrouped:t},n,ae)}))})),oi=(0,D.Z)(((e,t)=>{Ms({sendCompressed:e,sendGrouped:t})})),si=(0,a.Ye)((()=>{switch(ns){case It.Edit:return Xo;case It.Schedule:return ei;default:return fs}}),[ns,Xo]),ii=xe&&"commands"===_t?.type&&!Q&&!1!==Lt&&!mo;return a.ZP.createElement("div",{className:Xs},Hn&&Ea&&y&&a.ZP.createElement(lt,{isOpen:n!==ct.t.None,withQuick:n===ct.t.QuickFile||jn===ct.t.QuickFile,onHide:X,onFileSelect:Fa,editingMessage:Q}),js&&a.ZP.createElement(yt.Z,{topReactions:en,allAvailableReactions:Qt,onToggleReaction:Js,isPrivate:!0,isReady:y,canBuyPremium:tn,isCurrentUserPremium:ke,isInSavedMessages:Ae,isInStoryViewer:zn,canPlayAnimatedEmojis:nn,onShowMore:Ks,className:_s}),a.ZP.createElement($e,{chatId:ee,threadId:te,canShowCustomSendMenu:as,attachments:ha,getHtml:Ln,isReady:y,shouldSuggestCompression:La,shouldForceCompression:Ba,shouldForceAsFile:Da,isForCurrentMessageList:ve,isForMessage:Hn,shouldSchedule:l,forceDarkTheme:zn,onCaptionUpdate:Ua,onSendSilent:oi,onSend:gs,onSendScheduled:ai,onFileAppend:$a,onClear:ja,onAttachmentsUpdate:_a,onCustomEmojiSelect:bs,onRemoveSymbol:As,onEmojiSelect:Ts,editingMessage:Q}),a.ZP.createElement(pt,{isOpen:_e.isOpen,isQuiz:_e.isQuiz,shouldBeAnonymous:Re,onClear:fn,onSend:Ns}),Ws&&a.ZP.createElement(wt,{isOpen:to,isSchedule:"scheduled"===oe,onClose:ao,message:Ws}),a.ZP.createElement(Zt,{isOpen:Ka,onClose:eo,chatId:ee,selectedSendAsId:$t,sendAsPeerIds:Vn,isCurrentUserPremium:ke}),a.ZP.createElement(ut,{isOpen:xo,filteredUsers:Oo,onInsertUserName:Ro,onClose:Ao}),a.ZP.createElement(Qe,{isOpen:Vo,chatId:ee,withUsername:Boolean(ia),botCommands:qo,quickReplies:Yo,getHtml:Ln,self:vt,quickReplyMessages:cn,onClick:Is,onClose:Wo}),a.ZP.createElement("div",{className:(0,m.Z)("composer-wrapper",zn&&"with-story-tweaks")},a.ZP.createElement("svg",{className:"svg-appendix",width:"9",height:"20"},a.ZP.createElement("defs",null,a.ZP.createElement("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix"},a.ZP.createElement("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),a.ZP.createElement("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),a.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"}))),a.ZP.createElement("g",{fill:"none","fill-rule":"evenodd"},a.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)"}),a.ZP.createElement("path",{d:"M6 17H0V0c.193 2.84.876 5.767 2.05 8.782.904 2.325 2.446 4.485 4.625 6.48A1 1 0 016 17z",fill:"#FFF",className:"corner"}))),Hn&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(mt,{isOpen:Lo,botId:Bo,isGallery:Do,inlineBotResults:Uo,switchPm:$o,switchWebview:Fo,loadMore:Ho,isSavedMessages:Ae,canSendGifs:Pa,isCurrentUserPremium:ke,onSelectResult:Ss,onClose:jo}),a.ZP.createElement(st,{onClear:us,shouldForceShowEditing:Boolean(Ko&&Q)}),a.ZP.createElement(Et,{chatId:ee,threadId:te,getHtml:Ln,isDisabled:!ba||Za})),a.ZP.createElement("div",{className:(0,m.Z)("message-input-wrapper",(0,I.D)(vt))},Hn&&a.ZP.createElement(a.ZP.Fragment,null,Os&&a.ZP.createElement(Ke,{isOpen:Ls,text:_t.text,isDisabled:Boolean(mo),onClick:vs}),ii&&a.ZP.createElement(We.Z,{className:(0,m.Z)("bot-commands",Wa&&"activated"),round:!0,disabled:void 0===Lt,color:"translucent",onActivate:Ps,ariaLabel:"Open bot command keyboard"},a.ZP.createElement("i",{className:"icon icon-bot-commands-filled"})),Wn&&(Bt||Dt)&&a.ZP.createElement(Xe.Z,{round:!0,color:"translucent",onClick:Ka?eo:ks,ariaLabel:An("SendMessageAsTitle"),className:(0,m.Z)("send-as-button",ua.current&&"appear-animation")},a.ZP.createElement(Ct.Z,{peer:Bt||Dt,size:"tiny"}))),(!ka||Pa||va)&&a.ZP.createElement(ft.Z,{chatId:ee,threadId:te,isMobile:G,isReady:y,isSymbolMenuOpen:Ga,openSymbolMenu:Xa,closeSymbolMenu:Ja,canSendStickers:va,canSendGifs:Pa,isMessageComposer:Hn,onGifSelect:Cs,onStickerSelect:ws,onCustomEmojiSelect:ys,onRemoveSymbol:xs,onEmojiSelect:xa,closeBotCommandMenu:Ya,closeSendAsMenu:eo,isSymbolMenuForced:qn,canSendPlainText:!ka,inputCssSelector:Gt,idPrefix:e,forceDarkTheme:zn}),a.ZP.createElement(ht.Z,{ref:Rn,id:Jt,editableInputId:Xt,customEmojiPrefix:e,isStoryInput:zn,chatId:ee,canSendPlainText:!ka,threadId:te,isReady:y,isActive:!Za,getHtml:Ln,placeholder:mo&&_n<=600?"":ka?An("Chat.PlaceholderTextNotAllowed"):Ve||qe||An(Us||"Message"),timedPlaceholderDate:Ds,timedPlaceholderLangKey:Bs,forcedPlaceholder:_o,canAutoFocus:y&&ve&&!Za&&Hn,noFocusInterception:Za,shouldSuppressFocus:G&&Ga,shouldSuppressTextFormatter:yo||xo||Lo,onUpdate:Bn,onSend:si,onSuppressedFocus:Ja,onFocus:Kn,onBlur:Qn}),Hn&&a.ZP.createElement(a.ZP.Fragment,null,Ot&&Boolean(Bo)&&a.ZP.createElement(bt.Z,{color:"gray"}),et&&a.ZP.createElement(Xe.Z,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:Rs,ariaLabel:"Open scheduled messages"},a.ZP.createElement("i",{className:"icon icon-schedule"})),Boolean(ze)&&!mo&&!Q&&a.ZP.createElement(We.Z,{className:Ha?"activated":"",round:!0,color:"translucent",onActivate:za,ariaLabel:"Open bot command keyboard"},a.ZP.createElement("i",{className:"icon icon-bot-command"}))),mo&&Boolean(uo)&&a.ZP.createElement("span",{className:"recording-state"},(0,u.rM)(uo-po.current)),a.ZP.createElement(Ye,{chatId:ee,threadId:te,editingMessage:Q,hasReplaceableMedia:aa,isButtonVisible:!mo,canAttachMedia:Ea,canAttachPolls:ya,canSendPhotos:Na,canSendVideos:Ia,canSendDocuments:Ma,canSendAudios:Sa,onFileSelect:Fa,onPollCreate:gn,isScheduled:l,attachBots:Hn?Ht:void 0,peerType:zt,shouldCollectDebugLogs:an,theme:Wt,onMenuOpen:ta,onMenuClose:na}),Hn&&Boolean(ze)&&a.ZP.createElement(Je,{messageId:ze,isOpen:Ha,onClose:Va}),Hn&&Lt&&a.ZP.createElement(Ge,{isOpen:Wa,botCommands:Lt,onClose:Ya}),a.ZP.createElement(it.Z,{key:`custom-emoji-tooltip-${Xt}`,chatId:ee,isOpen:Io,onCustomEmojiSelect:Mo,addRecentCustomEmoji:Sn,onClose:No}),a.ZP.createElement(gt,{key:`sticker-tooltip-${Xt}`,chatId:ee,threadId:te,isOpen:ko,onStickerSelect:ws,onClose:To}),a.ZP.createElement(dt.Z,{key:`emoji-tooltip-${Xt}`,isOpen:yo,emojis:Co,customEmojis:wo,addRecentEmoji:En,addRecentCustomEmoji:Sn,onEmojiSelect:So,onCustomEmojiSelect:So,onClose:bo}))),rn&&mo&&a.ZP.createElement(Xe.Z,{className:(0,m.Z)("view-once",Zo&&"active"),round:!0,color:"secondary",ariaLabel:An("Chat.PlayOnceVoiceMessageTooltip"),onClick:fo},a.ZP.createElement(He.Z,{name:"view-once"}),a.ZP.createElement(He.Z,{name:"one-filled"})),mo&&a.ZP.createElement(Xe.Z,{round:!0,color:"danger",className:"cancel",onClick:co,ariaLabel:"Cancel voice recording"},a.ZP.createElement("i",{className:"icon icon-delete"})),zn&&!mo&&a.ZP.createElement(Xe.Z,{round:!0,className:"story-reaction-button",color:"secondary",onClick:Qs,onContextMenu:ls,onMouseDown:ds,ariaLabel:An("AccDescrLike"),ref:On},on&&a.ZP.createElement(St.Z,{key:"documentId"in on?on.documentId:on.emoticon,containerId:(0,c.hl)(ee,ne),reaction:on,withEffectOnly:ca}),(!on||ca)&&a.ZP.createElement("i",{className:(0,m.Z)("icon","icon-heart",ca&&"story-reaction-heart"),"aria-hidden":!0})),a.ZP.createElement(Xe.Z,{ref:ho,round:!0,color:"secondary",className:(0,m.Z)(ns,"main-button",!y&&"not-ready",mo&&"recording"),disabled:Hs,allowDisabledClick:!0,noFastClick:!0,ariaLabel:An(Gs),onClick:zs,onContextMenu:ns===It.Send&&as?ss:void 0},a.ZP.createElement("i",{className:"icon icon-send"}),a.ZP.createElement("i",{className:"icon icon-microphone-alt"}),mn&&a.ZP.createElement("i",{className:"icon icon-forward"}),Hn&&a.ZP.createElement("i",{className:"icon icon-schedule"}),Hn&&a.ZP.createElement("i",{className:"icon icon-check"})),as&&a.ZP.createElement(rt.Z,{isOpen:os,canSchedule:Hn&&!Zo,canScheduleUntilOnline:d&&!Zo,onSendSilent:Ae?void 0:ti,onSendSchedule:l?void 0:ei,onSendWhenOnline:ni,onClose:is,onCloseAnimationEnd:rs,isSavedMessages:Ae}),ma)})))},40329:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(60748),o=n(33555),s=n(41765),i=n(7054),r=n(32340),c=n(59107),l=n(231),d=n(34563),m=n(70172);const u=(0,a.X$)((0,o.c$)(((e,{chat:t,isSavedDialog:n})=>{const a=(0,s.YC)(t.id),o=(0,i.FM1)(e,t.id),r=a&&(0,i.dyD)(e,(0,s.zX)(t)),c=r&&(0,s.cS)(r)&&!t.isSupport,l=a&&!o&&!c&&!n,d=a?(0,s.Vl)((0,i.dyD)(e,(0,s.zX)(t))):void 0;return{isPrivateChat:a,isChatWithSelf:o,isBot:c,isChannel:(0,s.eA)(t),isBasicGroup:(0,s.G9)(t),isSuperGroup:(0,s.ZV)(t),currentUserId:e.currentUserId,canDeleteForAll:l,contactName:d}}))((({isOpen:e,chat:t,isSavedDialog:n,isChannel:i,isPrivateChat:u,isChatWithSelf:h,isBot:p,isBasicGroup:Z,isSuperGroup:g,currentUserId:f,canDeleteForAll:v,contactName:P,onClose:E,onCloseAnimationEnd:y})=>{const{leaveChannel:b,deleteHistory:C,deleteSavedHistory:w,deleteChannel:S,deleteChatUser:I,blockUser:N}=(0,o.Sv)(),M=(0,c.Z)(),k=(0,s.U)(M,t),T=(0,a.I4)((()=>{C({chatId:t.id,shouldDeleteForAll:!0}),E()}),[t.id,E]),x=(0,a.I4)((()=>{C({chatId:t.id,shouldDeleteForAll:!0}),N({userId:t.id}),E()}),[t.id,E]),A=(0,a.I4)((()=>{n?w({chatId:t.id}):u?C({chatId:t.id,shouldDeleteForAll:!1}):Z?(I({chatId:t.id,userId:f}),C({chatId:t.id,shouldDeleteForAll:!1})):!i&&!g||t.isCreator?(i||g)&&t.isCreator&&S({chatId:t.id}):b({chatId:t.id}),E()}),[u,Z,i,g,f,t.isCreator,t.id,n,E]),R=(0,a.I4)((()=>{i||g?(b({chatId:t.id}),E()):A()}),[t.id,A,i,g,b,E]);return a.ZP.createElement(d.Z,{isOpen:e,className:"DeleteChatModal",header:a.ZP.createElement("div",{className:"modal-header",dir:M.isRtl?"rtl":void 0},a.ZP.createElement(m.Z,{size:"tiny",peer:t,isSavedMessages:h}),a.ZP.createElement("h3",{className:"modal-title"},M(n?h?"ClearHistoryMyNotesTitle":"ClearHistoryTitleSingle2":i&&!t.isCreator?"LeaveChannel":i&&t.isCreator?"ChannelDelete":Z||g?"Group.LeaveGroup":"DeleteChatUser"))),onClose:E,onCloseAnimationEnd:y},n?a.ZP.createElement("p",null,(0,r.Z)(h?M("ClearHistoryMyNotesMessage"):M("ClearHistoryMessageSingle",k),["simple_markdown","emoji"])):i&&t.isCreator?a.ZP.createElement("p",null,(0,r.Z)(M("ChatList.DeleteAndLeaveGroupConfirmation",k),["simple_markdown","emoji"])):i&&!t.isCreator||Z||g?a.ZP.createElement("p",null,(0,r.Z)(M("ChannelLeaveAlertWithName",k),["simple_markdown","emoji"])):a.ZP.createElement("p",null,(0,r.Z)(M("ChatList.DeleteChatConfirmation",P),["simple_markdown","emoji"])),a.ZP.createElement("div",{className:"dialog-buttons-column"},p&&!n&&a.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:x},M("DeleteAndStop")),v&&a.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},P?(0,r.Z)(M("ChatList.DeleteForEveryone",P)):M("DeleteForAll")),!u&&t.isCreator&&!n&&a.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:A},M("DeleteForAll")),a.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:u||n?A:R},M(n?"Delete":i&&!t.isCreator?"LeaveChannel":i&&t.isCreator?"Chat.Input.Delete":Z||g?"Group.LeaveGroup":v?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(l.Z,{className:"confirm-dialog-button",isText:!0,onClick:E},M("Cancel"))))})))},82535:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(60748),o=n(33555),s=n(83716),i=n(41765),r=n(15376),c=n(60706),l=n(3657),d=n(59107),m=n(25190),u=n(6202),h=n(6701),p=n(14605),Z=n(17551),g=n(47002);const f=new Set(["svg","svgz"]),v=(0,a.X$)((({message:e,observeIntersection:t,smaller:n,canAutoLoad:v,autoLoadFileMaxSizeMb:P,uploadProgress:E,withDate:y,datetime:b,className:C,sender:w,isSelected:S,isSelectable:I,shouldWarnAboutSvg:N,isDownloading:M,onCancelUpload:k,onMediaClick:T,onDateClick:x})=>{const{cancelMessageMediaDownload:A,downloadMessageMedia:R,setSettingOption:O}=(0,o.Sv)(),L=(0,a.sO)(null),B=(0,d.Z)(),[D,$,F]=(0,c.Z)(),[U,j]=(0,a.eJ)(!1),_=e.content.document||(0,i.N4)(e),{fileName:H,size:z,timestamp:V}=_,W=(0,r.K2)(_)||"",q=(0,l.Op)(L,t),[Y,G]=(0,c.Z)();(0,a.d4)((()=>{q&&G()}),[q,G]);const[X,J]=(0,a.eJ)(v&&(!P||z<=1048576*P)),K=Boolean(M||X&&Y),Q=(0,i.Ti)(e,"download"),{loadProgress:ee,mediaData:te}=(0,h.Z)(Q,!K,(0,i.kG)(e,"download"),void 0,!0),ne=Boolean(te),{isUploading:ae,isTransferring:oe,transferProgress:se}=(0,i.Sc)(e,E||ee,K&&!ne,void 0!==E),ie=(0,r.v6)(_),re=ie?(0,i.DH)(e):void 0,ce=ie?_.previewBlobUrl:void 0,le=(0,u.Z)((0,i.Ti)(e,"pictogram"),!q),de=T&&Boolean(_.mediaType)&&(s.wGh.has(_.mimeType)||s.oGt.has(_.mimeType)),me=(0,m.Z)((()=>{R({message:e})})),ue=(0,m.Z)((()=>{ae?k&&k():M?A({message:e}):oe?J(!1):de?T():f.has(W)&&N?$():me()})),he=(0,m.Z)((()=>{O({shouldWarnAboutSvg:!U}),F(),me()})),pe=(0,m.Z)((()=>{x(e.id,e.chatId)}));return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(g.Z,{ref:L,name:H,extension:W,size:z,timestamp:y?b||V:void 0,thumbnailDataUri:re,previewData:ce||le,smaller:n,isTransferring:oe,isUploading:ae,transferProgress:se,className:C,sender:w,isSelectable:I,isSelected:S,actionIcon:de?(0,i.hC)(e)?"play":"eye":"download",onClick:ue,onDateClick:x?pe:void 0}),a.ZP.createElement(Z.Z,{isOpen:D,onClose:F,confirmHandler:he},B("lng_launch_svg_warning"),a.ZP.createElement(p.Z,{className:"dialog-checkbox",checked:U,label:B("lng_launch_exe_dont_ask"),onCheck:j})))}))},78780:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(46752),s=n(32340),i=n(59107);const r=({content:e,className:t})=>{const n=(0,i.Z)();return a.ZP.createElement("span",{className:(0,o.Z)("DotAnimation",t),dir:n.isRtl?"rtl":"auto"},(0,s.Z)(e),a.ZP.createElement("span",{className:"ellipsis"}))}},47002:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(60748),o=n(46752),s=n(33323),i=n(97184),r=n(15376),c=n(74399),l=n(32340),d=n(42797),m=n(15866),u=n(59107),h=n(70692),p=n(31212),Z=n(8337),g=n(39196);const f=(0,a.X$)((({ref:e,name:t,size:n,extension:f="",timestamp:v,sender:P,thumbnailDataUri:E,previewData:y,className:b,smaller:C,isTransferring:w,isUploading:S,isSelectable:I,isSelected:N,transferProgress:M,actionIcon:k,onClick:T,onDateClick:x})=>{const A=(0,u.Z)();let R=(0,a.sO)(null);e&&(R=e);const{isMobile:O}=(0,d.ZP)(),[L]=(0,a.eJ)(!y),B=Boolean(y),D=(0,m.Z)(E,B,O&&!i.vX),$=(0,h.Z)(!B),{shouldRender:F,transitionClassNames:U}=(0,p.Z)(w,void 0,!0),j=(0,r.Oh)(f),_=(0,r.yW)(n),H=(0,a.Ye)((()=>w&&M?`${(0,r.yW)(n*M)} / ${_}`:_),[w,n,_,M]),{width:z,height:V}=(0,c.lE)(C),W=(0,o.Z)("File",b,C&&"smaller",T&&!S&&"interactive",N&&"file-is-selected");return a.ZP.createElement("div",{ref:R,className:W,dir:A.isRtl?"rtl":void 0},I&&a.ZP.createElement("div",{className:"message-select-control"},N&&a.ZP.createElement("i",{className:"icon icon-select"})),a.ZP.createElement("div",{className:"file-icon-container",onClick:S?void 0:T},E||y?a.ZP.createElement("div",{className:"file-preview media-inner"},a.ZP.createElement("img",{src:y,className:"full-media",width:z,height:V,draggable:!1,alt:""}),L&&a.ZP.createElement("canvas",{ref:D,className:(0,o.Z)("thumbnail",$)})):a.ZP.createElement("div",{className:`file-icon ${j}`},f.length<=4&&a.ZP.createElement("span",{className:"file-ext",dir:"auto"},f)),F&&a.ZP.createElement("div",{className:(0,o.Z)("file-progress",j,U)},a.ZP.createElement(g.Z,{progress:M,size:C?"s":"m",onClick:S?T:void 0})),T&&a.ZP.createElement("i",{className:(0,o.Z)("action-icon","icon",k?`icon-${k}`:"icon-download",F&&"hidden")})),a.ZP.createElement("div",{className:"file-info"},a.ZP.createElement("div",{className:"file-title",dir:"auto",title:t},(0,l.Z)(t)),a.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},a.ZP.createElement("span",null,H),P&&a.ZP.createElement("span",{className:"file-sender"},(0,l.Z)(P)),!P&&Boolean(v)&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"}),a.ZP.createElement(Z.Z,{onClick:x},(0,s.ZK)(A,1e3*v,!0))))),P&&Boolean(v)&&a.ZP.createElement(Z.Z,{onClick:x},(0,s.VX)(A,1e3*v)))}))},98799:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(60748),o=n(33555),s=n(91713),i=n(41765),r=n(7054),c=n(46752),l=n(74399),d=n(32340),m=n(59107),u=n(25190),h=n(2255),p=n(70172),Z=n(78780),g=n(2153),f=n(65979),v=n(2995),P=n(68729);const E=2.5*l.Gw,y=(0,a.X$)((0,o.c$)(((e,{chatId:t,threadId:n})=>{const a=(0,r.Z1J)(e,t),o=n?(0,r.tZg)(e,t,n):void 0,s=a?(0,r.YK0)(e,a):void 0,i=Boolean((0,r.Zwk)(e,t)),c=n?a?.topics?.[n]:void 0;return{chat:a,threadInfo:o,onlineCount:s,topic:c,areMessagesLoaded:i,messagesCount:c&&(0,r.xxG)(e,t,n),self:(0,r.dyD)(e,e.currentUserId)}}))((({typingStatus:e,className:t,statusIcon:n,avatarSize:r="medium",noAvatar:l,status:y,withDots:b,withMediaViewer:C,withUsername:w,withFullInfo:S,withUpdatingStatus:I,withChatType:N,threadInfo:M,noRtl:k,chat:T,onlineCount:x,areMessagesLoaded:A,topic:R,messagesCount:O,noStatusOrTyping:L,withStory:B,storyViewerOrigin:D,noEmojiStatus:$,emojiStatusSize:F,isSavedDialog:U,self:j,onClick:_,onEmojiStatusClick:H})=>{const{loadFullChat:z,openMediaViewer:V,loadProfilePhotos:W}=(0,o.Sv)(),q=(0,m.Z)(),Y=T&&(0,i.ZV)(T),G=Boolean(T?.isForum&&M&&R),{id:X,isMin:J,isRestricted:K}=T||{};(0,a.d4)((()=>{X&&!J&&(S&&z({chatId:X}),C&&W({profileId:X}))}),[X,J,S,z,W,Y,C]);const Q=(0,u.Z)(((e,t)=>{T&&t&&(e.stopPropagation(),V({avatarOwnerId:T.id,mediaId:0,origin:"jumbo"===r?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))})),ee=(0,a.Ye)((()=>T&&w&&(0,i.WS)(T)),[T,w]);if(T)return a.ZP.createElement("div",{className:(0,c.Z)("ChatInfo",t),dir:!k&&q.isRtl?"rtl":void 0,onClick:_},!l&&!G&&a.ZP.createElement(a.ZP.Fragment,null,U&&j&&a.ZP.createElement(p.Z,{key:"saved-messages",size:r,peer:j,isSavedMessages:!0,className:"saved-dialog-avatar"}),a.ZP.createElement(p.Z,{key:T.id,className:(0,c.Z)(U&&"overlay-avatar"),size:r,peer:T,withStory:B,storyViewerOrigin:D,storyViewerMode:"single-peer",isSavedDialog:U,onClick:C?Q:void 0})),G&&a.ZP.createElement(v.Z,{topic:R,className:"topic-header-icon",size:E}),a.ZP.createElement("div",{className:"info"},R?a.ZP.createElement("h3",{dir:"auto",className:"fullName"},(0,d.Z)(R.title)):a.ZP.createElement(g.Z,{peer:T,emojiStatusSize:F,withEmojiStatus:!$,isSavedDialog:U,onEmojiStatusClick:H}),!L&&function(){if(y)return b?a.ZP.createElement(Z.Z,{className:"status",content:y}):a.ZP.createElement("span",{className:"status",dir:"auto"},n&&a.ZP.createElement(f.Z,{className:"status-icon",name:n}),(0,d.Z)(y));if(I&&!A&&!K)return a.ZP.createElement(Z.Z,{className:"status",content:q("Updating")});if(!T)return;if(e)return a.ZP.createElement(P.Z,{typingStatus:e});if(G)return a.ZP.createElement("span",{className:"status",dir:"auto"},a.ZP.createElement(h.ZP,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==O?1:2,className:"message-count-transition"},void 0!==O&&q("messages",O,"i")));if(N)return a.ZP.createElement("span",{className:"status",dir:"auto"},q((0,i.l6)(T)));const t=function(e,t){const n=e((0,i.l6)(t)),{membersCount:a}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":a?e("Channel"===n?"Subscribers":"Members",a,"i"):n}(q,T),o=x?`, ${q("OnlineCount",x,"i")}`:void 0;return a.ZP.createElement("span",{className:"status"},ee&&a.ZP.createElement("span",{className:"handle withStatus"},ee),a.ZP.createElement("span",{className:"group-status"},t),o&&a.ZP.createElement("span",{className:"online-status"},o))}()))})))},76844:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(33323),s=n(59107),i=n(8018);const r=(0,a.X$)((({message:e,outgoingStatus:t,draftDate:n})=>{const r=(0,s.Z)(),c=n&&n>e.date;return a.ZP.createElement("div",{className:"LastMessageMeta"},t&&!c&&a.ZP.createElement(i.Z,{status:t}),a.ZP.createElement("span",{className:"time"},(0,o.VX)(r,1e3*(c?n:e.date))))}))},12007:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(60748),o=n(33555),s=n(46752),i=n(64319),r=n(42797),c=n(59107),l=n(25190),d=n(231),m=n(53106),u=n(58964),h=n(65979);const p=(0,a.X$)((({title:e,link:t,isDisabled:n,className:p,withShare:Z,onRevoke:g})=>{const f=(0,c.Z)(),{showNotification:v,openChatWithDraft:P}=(0,o.Sv)(),{isMobile:E}=(0,r.ZP)(),y=!g,b=(0,l.Z)((()=>{(0,i.TE)(t),v({message:f("LinkCopied")})})),C=(0,l.Z)((()=>{n||b()})),w=(0,l.Z)((()=>{P({text:{text:t}})})),S=(0,a.Ye)((()=>({onTrigger:e,isOpen:t})=>a.ZP.createElement(d.Z,{round:!0,ripple:!E,size:"smaller",color:"translucent",className:t?"active":"",onClick:e,ariaLabel:f("AccDescrOpenMenu2")},a.ZP.createElement("i",{className:"icon icon-more"}))),[E,f]);return a.ZP.createElement("div",{className:p},a.ZP.createElement("p",{className:"vCMpiQTJ"},f(e||"InviteLink.InviteLink")),a.ZP.createElement("div",{className:"xNjJHI7j"},a.ZP.createElement("input",{className:(0,s.Z)("form-control","Ag6k_p7b"),value:t,readOnly:!0,onClick:C}),y?a.ZP.createElement(d.Z,{color:"translucent",className:"obuPXobw",size:"smaller",round:!0,disabled:n,onClick:C},a.ZP.createElement(h.Z,{name:"copy"})):a.ZP.createElement(m.Z,{className:"p7t3macG",trigger:S,positionX:"right"},a.ZP.createElement(u.Z,{icon:"copy",onClick:C,disabled:n},f("Copy")),g&&a.ZP.createElement(u.Z,{icon:"delete",onClick:g,destructive:!0},f("RevokeButton")))),Z&&a.ZP.createElement(d.Z,{size:"smaller",disabled:n,onClick:w},f("FolderLinkScreen.LinkActionShare")))}))},13709:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(60748),o=n(41765),s=n(46752),i=n(33323),r=n(3858),c=n(60706),l=n(3657),d=n(25190),m=n(6202),u=n(70692),h=n(62230);const p=(0,a.X$)((({message:e,idPrefix:t="shared-media",isProtected:n,observeIntersection:p,onClick:Z})=>{const g=(0,a.sO)(null),f=(0,l.Op)(g,p),v=(0,o.DH)(e),P=(0,m.Z)((0,o.Ti)(e,"pictogram"),!f),E=(0,u.Z)(P),y=(0,o.b7)(e),b=(0,o.NE)(e),[C,,w]=(0,c.Z)(b),S=(0,d.Z)((()=>{w(),Z(e.id,e.chatId)}));return a.ZP.createElement("div",{ref:g,id:`${t}${(0,o.d0)(e.id)}`,className:"Media scroll-item",onClick:Z?S:void 0},a.ZP.createElement("img",{src:v,className:"media-miniature",alt:"",draggable:!n,decoding:"async",onContextMenu:n?r.Z:void 0}),a.ZP.createElement("img",{src:P,className:(0,s.Z)("full-media","media-miniature",E),alt:"",draggable:!n,decoding:"async",onContextMenu:n?r.Z:void 0}),b&&a.ZP.createElement(h.Z,{thumbDataUri:P||v,isVisible:C,className:"media-spoiler"}),y&&a.ZP.createElement("span",{className:"video-duration"},y.isGif?"GIF":(0,i.k9)(y.duration)),n&&a.ZP.createElement("span",{className:"protector"}))}))},62230:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(46752),s=n(15866),i=n(25190),r=n(31212);const c=(0,a.X$)((({isVisible:e,withAnimation:t,thumbDataUri:n,className:c,width:l,height:d})=>{const m=(0,a.sO)(null),{shouldRender:u,transitionClassNames:h}=(0,r.Z)(e,void 0,!0,!t&&void 0,void 0,500),p=(0,s.Z)(n,!u,void 0,25,l,d),Z=(0,i.Z)((e=>{if(!m.current)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,a=e.clientY-t.top,o=n-t.width/2,s=a-t.height/2;m.current.setAttribute("style",`--click-shift-x: ${o}px; --click-shift-y: ${s}px`)}));if(u)return a.ZP.createElement("div",{className:(0,o.Z)("qF2WgYVg",h,c,t&&"pNM3cgkY"),ref:m,onClick:t?Z:void 0},a.ZP.createElement("canvas",{ref:p,className:"eULqS2yR",width:l,height:d}),a.ZP.createElement("div",{className:"XBor45hE"}))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(2255),s=n(65979),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,a.X$)((({status:e})=>a.ZP.createElement("div",{className:"MessageOutgoingStatus"},a.ZP.createElement(o.ZP,{name:"reveal",activeKey:i[e]},"failed"===e?a.ZP.createElement("div",{className:"MessageOutgoingStatus--failed"},a.ZP.createElement(s.Z,{name:"message-failed"})):a.ZP.createElement(s.Z,{name:`message-${e}`})))))},47262:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(46752),s=n(32340),i=n(59107),r=n(31212);const c=(0,a.X$)((({text:e="Nothing found.",description:t})=>{const n=(0,i.Z)(),{transitionClassNames:c}=(0,r.Z)(!0);return a.ZP.createElement("div",{className:(0,o.Z)("NothingFound",c,t&&"with-description")},e,t&&a.ZP.createElement("p",{className:"description"},(0,s.Z)(n(t),["br"])))}))},99364:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(60748),o=n(83716),s=n(57710),i=n(46752),r=n(3858),c=n(97184),l=n(49488),d=n(42797),m=n(59107),u=n(231);const h=(0,a.X$)((({isLoading:e=!1,isPasswordVisible:t,error:n,hint:h,placeholder:p="Password",submitLabel:Z="Next",description:g,shouldShowSubmit:f,shouldResetValue:v,shouldDisablePasswordManager:P=!1,noRipple:E=!1,clearError:y,onChangePasswordVisibility:b,onInputChange:C,onSubmit:w})=>{const S=(0,a.sO)(null),I=(0,m.Z)(),{isMobile:N}=(0,d.ZP)(),[M,k]=(0,a.eJ)(""),[T,x]=(0,a.eJ)(!1),A=N?550:400;return(0,a.d4)((()=>{v&&k("")}),[v]),(0,l.Z)((()=>{c.$b||S.current.focus()}),A),(0,a.d4)((()=>{n&&(0,s.WM)((()=>{S.current.focus(),S.current.select()}))}),[n]),a.ZP.createElement("form",{action:"",onSubmit:w?function(t){t.preventDefault(),e||T&&w(M)}:r.Z,autoComplete:"off"},a.ZP.createElement("div",{className:(0,i.Z)("input-group password-input",M&&"touched",n&&"error"),dir:I.isRtl?"rtl":void 0},P&&a.ZP.createElement("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),a.ZP.createElement("input",{ref:S,className:"form-control",type:t?"text":"password",id:"sign-in-password",value:M||"",autoComplete:P?"one-time-code":"current-password",onChange:function(e){n&&y();const{target:t}=e;k(t.value),x(t.value.length>=o.loe),C&&C(t.value)},maxLength:256,dir:"auto"}),a.ZP.createElement("label",null,n||h||p),a.ZP.createElement("div",{className:"div-button toggle-password",onClick:function(){b(!t)},role:"button",tabIndex:0,title:"Toggle password visibility","aria-label":"Toggle password visibility"},a.ZP.createElement("i",{className:(0,i.Z)("icon",t?"icon-eye":"icon-eye-closed")}))),g&&a.ZP.createElement("p",{className:"description"},g),w&&(T||f)&&a.ZP.createElement(u.Z,{type:"submit",ripple:!E,isLoading:e,disabled:!T},Z))}))},11820:(e,t,n)=>{n.d(t,{Z:()=>P});var a=n(60748),o=n(57710),s=n(41765),i=n(46752),r=n(60782),c=n(27407),l=n(59107),d=n(25190),m=n(14605),u=n(21273),h=n(97687),p=n(31876),Z=n(34288),g=n(98799),f=n(49187),v=n(6058);const P=(0,a.X$)((({className:e,itemIds:t,selectedIds:n,filterValue:P,filterPlaceholder:E,notFoundText:y,searchInputId:b,isLoading:C,noScrollRestore:w,isSearchable:S,isRoundCheckbox:I,lockedSelectedIds:N,lockedUnselectedIds:M,lockedUnselectedSubtitle:k,forceShowSelf:T,isViewOnly:x,onSelectedIdsChange:A,onFilterChange:R,onDisabledClick:O,onLoadMore:L,isCountryList:B,countryList:D})=>{const $=(0,a.sO)(null),F=n.length>10;(0,a.d4)((()=>{S&&setTimeout((()=>{(0,o.i$)((()=>{$.current.focus()}))}),500)}),[S]);const U=(0,a.Ye)((()=>new Set(N)),[N]),j=(0,a.Ye)((()=>new Set(M)),[M]),_=(0,a.Ye)((()=>n.filter((e=>!U.has(e)))),[U,n]),H=(0,a.Ye)((()=>{const e=[],n=[],a=[];return t.forEach((t=>{U.has(t)?e.push(t):j.has(t)?a.push(t):n.push(t)})),e.concat(n).concat(a)}),[t,U,j]),z=(0,d.Z)((e=>{if(U.has(e))return void O?.(e,!0);if(j.has(e))return void O?.(e,!1);const t=n.slice();t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),A?.(t),R?.("")})),V=(0,d.Z)((e=>{const{value:t}=e.currentTarget;R?.(t)})),[W,q]=(0,c.Z)(L,H,Boolean(P)),Y=(0,l.Z)(),G=(0,a.Ye)((()=>{if(D)return(0,r.ee)(D,"iso2")}),[D]);return a.ZP.createElement("div",{className:(0,i.Z)("Picker",e)},S&&a.ZP.createElement("div",{className:"picker-header custom-scroll",dir:Y.isRtl?"rtl":void 0},N?.map(((e,t)=>a.ZP.createElement(f.Z,{peerId:e,isMinimized:F&&t<n.length-5,forceShowSelf:T,onClick:z,clickArg:e}))),_.map(((e,t)=>a.ZP.createElement(f.Z,{peerId:e,isMinimized:F&&t+(N?.length||0)<n.length-5,canClose:!0,onClick:z,clickArg:e}))),a.ZP.createElement(h.Z,{id:b,ref:$,value:P,onChange:V,placeholder:E||Y("SelectChat")})),W?.length?a.ZP.createElement(u.Z,{className:(0,i.Z)("picker-list","custom-scroll",I&&"withRoundedCheckbox"),items:W,onLoadMore:q,noScrollRestore:w},W.map((e=>{const t=j.has(e),o=U.has(e)||t,r=()=>x||t?void 0:a.ZP.createElement(m.Z,{label:"",disabled:o,checked:n.includes(e),round:I});return a.ZP.createElement(p.Z,{key:e,className:(0,i.Z)("chat-item-clickable picker-list-item",I&&"chat-item"),disabled:o,inactive:x,allowDisabledClick:Boolean(O),secondaryIcon:t?"lock-badge":void 0,onClick:()=>z(e),ripple:!0},I?void 0:r(),(e=>{const t=j.has(e);if(B&&G){const t=G[e];return a.ZP.createElement("div",null,t.defaultName)}return(0,s.YC)(e)?a.ZP.createElement(v.Z,{forceShowSelf:T,userId:e,status:t?k:void 0}):a.ZP.createElement(g.Z,{chatId:e,status:t?k:void 0})})(e),I?r():void 0)}))):C||!W||W.length?a.ZP.createElement(Z.Z,null):a.ZP.createElement("p",{className:"no-results"},y||"Sorry, nothing found."))}))},49187:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(60748),o=n(33555),s=n(41765),i=n(7054),r=n(46752),c=n(33780),l=n(32340),d=n(59107),m=n(70172);const u=(0,a.X$)((0,o.c$)(((e,{peerId:t,forceShowSelf:n})=>{if(!t)return{};const a=(0,i.Z1J)(e,t),o=(0,i.dyD)(e,t);return{chat:a,user:o,isSavedMessages:!n&&o&&o.isSelf}}))((({icon:e,title:t,isMinimized:n,canClose:o,clickArg:i,chat:u,user:h,className:p,fluid:Z,isSavedMessages:g,withPeerColors:f,onClick:v})=>{const P=(0,d.Z)();let E,y;if(e&&t)E=a.ZP.createElement("div",{className:"item-icon"},a.ZP.createElement("i",{className:(0,r.Z)("icon",`icon-${e}`)})),y=t;else if(h||u){E=a.ZP.createElement(m.Z,{peer:h||u,size:"small",isSavedMessages:g});const e=!u||h&&!g?(0,s.Vl)(h):(0,s.U)(P,u,g);y=e?(0,l.Z)(e):void 0}const b=(0,r.Z)("PickerSelectedItem",p,u?.isForum&&"forum-avatar",n&&"minimized",o&&"closeable",Z&&"fluid",f&&(0,c.D)(u||h));return a.ZP.createElement("div",{className:b,onClick:()=>v(i),title:n?y:void 0,dir:P.isRtl?"rtl":void 0},E,!n&&a.ZP.createElement("div",{className:"item-name",dir:"auto"},y),o&&a.ZP.createElement("div",{className:"item-remove"},a.ZP.createElement("i",{className:"icon icon-close"})))})))},66:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(46752),s=n(80036),i=n(59107),r=n(65979);const c="_b5HgBXr",l="P6mch4bB",d=(0,a.X$)((({leftText:e,rightText:t,floatingBadgeText:n,floatingBadgeIcon:d,progress:m,className:u})=>{const h=(0,i.Z)(),p=Boolean(d||n),Z=Boolean(m)&&m>.99,g=m&&(m<.1?0:m>.9?1:.5);return a.ZP.createElement("div",{className:(0,o.Z)("nY2ggBsF",p&&"RYtVQAjM",u),style:(0,s.Z)(void 0!==m&&`--progress: ${m}`,void 0!==g&&`--tail-position: ${g}`)},p&&a.ZP.createElement("div",{className:"dhigNjAq"},a.ZP.createElement("div",{className:"cOpfCGPh"},a.ZP.createElement("div",{className:"uNwBLNOy"},d&&a.ZP.createElement(r.Z,{name:d,className:"MJ7MTmxi"}),n&&a.ZP.createElement("div",{className:"MwzZt3Qo",dir:h.isRtl?"rtl":void 0},n)),a.ZP.createElement("div",{className:"qRwO7SZm"},a.ZP.createElement("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none"},a.ZP.createElement("path",{d:"m 28,4 v 9 c 0.0089,7.283278 -3.302215,5.319646 -6.750951,8.589815 l -5.8284,5.82843 c -0.781,0.78105 -2.0474,0.78104 -2.8284,0 L 6.7638083,21.589815 C 2.8288652,17.959047 0.04527024,20.332086 0,13 V 4 C 0,4 0.00150581,0.97697493 3,1 5.3786658,1.018266 22.594519,0.9142007 25,1 c 2.992326,0.1067311 3,3 3,3 z",fill:"#7E85FF"}))))),a.ZP.createElement("div",{className:c},a.ZP.createElement("span",null,e)),a.ZP.createElement("div",{className:l},a.ZP.createElement("span",null,t)),a.ZP.createElement("div",{className:(0,o.Z)("sZZV0yoe",Z&&"m8ie8IxL")},a.ZP.createElement("div",{className:c},a.ZP.createElement("span",null,e)),a.ZP.createElement("div",{className:l},a.ZP.createElement("span",null,t))))}))},6058:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(60748),o=n(33555),s=n(91713),i=n(41765),r=n(7054),c=n(46752),l=n(32340),d=n(59107),m=n(25190),u=n(68512),h=n(70172),p=n(78780),Z=n(2153),g=n(65979),f=n(68729);const v=(0,a.X$)((0,o.c$)(((e,{userId:t,forceShowSelf:n})=>{const{isSynced:a}=e,o=(0,r.dyD)(e,t),s=(0,r.ssc)(e,t),i=!n&&o&&o.isSelf,c=i?o:(0,r.dyD)(e,e.currentUserId);return{user:o,userStatus:s,isSavedMessages:i,areMessagesLoaded:Boolean((0,r.Zwk)(e,t)),self:c,isSynced:a}}))((({typingStatus:e,avatarSize:t="medium",status:n,statusIcon:r,withDots:v,withMediaViewer:P,withUsername:E,withStory:y,withFullInfo:b,withUpdatingStatus:C,emojiStatusSize:w,noStatusOrTyping:S,noEmojiStatus:I,noFake:N,noVerified:M,isUnknownUser:k,noRtl:T,user:x,userStatus:A,self:R,isSavedMessages:O,isSavedDialog:L,areMessagesLoaded:B,adminMember:D,ripple:$,className:F,storyViewerOrigin:U,isSynced:j,onEmojiStatusClick:_,iconElement:H,rightElement:z})=>{const{loadFullUser:V,openMediaViewer:W,loadProfilePhotos:q}=(0,o.Sv)(),Y=(0,d.Z)(),{id:G}=x||{};(0,a.d4)((()=>{G&&(b&&j&&V({userId:G}),P&&q({profileId:G}))}),[G,b,P,j]);const X=(0,m.Z)(((e,n)=>{x&&n&&(e.stopPropagation(),W({avatarOwnerId:x.id,mediaId:0,origin:"jumbo"===t?s.bZ.ProfileAvatar:s.bZ.MiddleHeaderAvatar}))})),J=(0,a.Ye)((()=>x&&E&&(0,i.WS)(x)),[x,E]);if(!x&&!k)return;const K=D?D.customTitle||Y(D.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return a.ZP.createElement("div",{className:(0,c.Z)("ChatInfo",F),dir:!T&&Y.isRtl?"rtl":void 0},L&&R&&a.ZP.createElement(h.Z,{key:"saved-messages",size:t,peer:R,isSavedMessages:!0,className:"saved-dialog-avatar"}),a.ZP.createElement(h.Z,{key:x?.id,size:t,peer:x,className:(0,c.Z)(L&&"overlay-avatar"),isSavedMessages:O,isUnknownUser:k,isSavedDialog:L,withStory:y,storyViewerOrigin:U,storyViewerMode:"single-peer",onClick:P?X:void 0}),a.ZP.createElement("div",{className:"info"},K?a.ZP.createElement("div",{className:"info-name-title"},a.ZP.createElement(Z.Z,{peer:x,withEmojiStatus:!I,emojiStatusSize:w,isSavedMessages:O,isSavedDialog:L,onEmojiStatusClick:_}),K&&a.ZP.createElement("span",{className:"custom-title"},K)):a.ZP.createElement(Z.Z,{peer:x,noFake:N,noVerified:M,withEmojiStatus:!I,emojiStatusSize:w,isSavedMessages:O,isSavedDialog:L,onEmojiStatusClick:_,isUnknownUser:k,iconElement:H}),(n||!O&&!S)&&function(){if(n)return v?a.ZP.createElement(p.Z,{className:"status",content:n}):a.ZP.createElement("span",{className:"status",dir:"auto"},r&&a.ZP.createElement(g.Z,{className:"status-icon",name:r}),(0,l.Z)(n));if(C&&!B)return a.ZP.createElement(p.Z,{className:"status",content:Y("Updating")});if(!x)return;if(e)return a.ZP.createElement(f.Z,{typingStatus:e});const t=(0,i.Tq)(Y,x,A),o=(0,c.Z)("handle",t&&"withStatus");return a.ZP.createElement("span",{className:(0,c.Z)("status",(0,i.kM)(x,A,!0)&&"online")},J&&a.ZP.createElement("span",{className:o},J),t&&a.ZP.createElement("span",{className:"user-status",dir:"auto"},t))}()),$&&a.ZP.createElement(u.Z,null),z)})))},16568:(e,t,n)=>{n.d(t,{Z:()=>U});var a=n(60748),o=n(33555),s=n(91713),i=n(41765),r=n(7054),c=n(46752),l=n(64963),d=n(70735),m=n(97184),u=n(32340),h=n(59107),p=n(25190),Z=n(87204),g=n(70971),f=n(59187),v=n(40647),P=n(2255),E=n(70172),y=n(2153),b=n(2155),C=n(33780),w=n(42797),S=n(15866),I=n(60706),N=n(6202),M=n(70692),k=n(57080),T=n(49204),x=n(65979);const A=(0,a.X$)((({chat:e,user:t,photo:n,isSavedMessages:o,isSavedDialog:s,canPlayVideo:r,onClick:l})=>{const d=(0,a.sO)(null),p=(0,h.Z)(),{isMobile:Z}=(0,w.ZP)(),g=t&&(0,i.NB)(t),f=e&&(0,i.pK)(e.id),v=e&&(0,i.wo)(e.id),P=t||e,E=P&&!o&&!g&&!f&&!v,{isVideo:y}=n||{},A=E&&(0,i.RT)(P,"normal"),R=(0,N.Z)(A),O=E&&n&&!y&&`photo${n.id}?size=c`,L=(0,N.Z)(O),B=E&&n&&y&&(0,i.Dk)(n),D=(0,N.Z)(B)||L,[$,F]=(0,I.Z)(),U=Boolean(D&&(!y||$)),j=(0,M.Z)(U),_=E&&!U&&!R&&n?.thumbnail?.dataUri,H=(0,S.Z)(n?.thumbnail?.dataUri,!_,Z&&!m.vX),z=n||R||_;(0,a.d4)((()=>{d.current&&!r&&(d.current.currentTime=0)}),[r]);const V=(0,a.Ye)((()=>o?s?"my-notes":"avatar-saved-messages":g?"avatar-deleted-account":f?"reply-filled":v?"author-hidden":void 0),[v,g,s,f,o]);let W;if(V)W=a.ZP.createElement(x.Z,{name:V,role:"img"});else if(z)W=a.ZP.createElement(a.ZP.Fragment,null,_?a.ZP.createElement("canvas",{ref:H,className:"thumb"}):a.ZP.createElement("img",{src:R,draggable:!1,className:"thumb",alt:""}),n&&(y?a.ZP.createElement(k.Z,{canPlay:r,ref:d,src:D,className:(0,c.Z)("avatar-media",j),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:F}):a.ZP.createElement("img",{src:D,className:(0,c.Z)("avatar-media",j),alt:""})));else if(t){const e=(0,i.Js)(t);W=e?(0,b.Xv)(e,2):void 0}else if(e){const t=(0,i.U)(p,e);W=t&&(0,b.Xv)(t,(0,i.YC)(e.id)?2:1)}else W=a.ZP.createElement("div",{className:"spinner-wrapper"},a.ZP.createElement(T.Z,{color:"white"}));const q=(0,c.Z)("ProfilePhoto",(0,C.D)(P),o&&"saved-messages",v&&"anonymous-forwards",g&&"deleted-account",f&&"replies-bot-account",!o&&!z&&"no-photo");return a.ZP.createElement("div",{className:q,onClick:z?l:void 0},"string"==typeof W?(0,u.Z)(W,["hq_emoji"]):W)}));var R=n(2995);const O="cpyXyZDl",L="Wm9Ygb23",B="nflKKT3R",D="tFkRrvxe",$="GBGLnrA7",F="ZZRcBh8v",U=(0,a.X$)((0,o.c$)(((e,{userId:t})=>{const{isSynced:n}=e,a=(0,r.dyD)(e,t),o=(0,i.YC)(t),s=(0,r.ssc)(e,t),c=(0,r.Z1J)(e,t),{mediaId:l,avatarOwnerId:d}=(0,r.jUK)(e).mediaViewer,m=c?.isForum,{threadId:u}=(0,r.Btg)(e)||{},h=m&&u?c?.topics?.[u]:void 0,p=o?(0,r.ccz)(e,t):void 0,Z=o?void 0:(0,r.x67)(e,t),g=(a||c)?.emojiStatus,f=g?e.customEmojis.byId[g.documentId]:void 0;return{isSynced:n,user:a,userStatus:s,chat:c,userPersonalPhoto:p?.personalPhoto,userProfilePhoto:p?.profilePhoto,userFallbackPhoto:p?.fallbackPhoto,chatProfilePhoto:Z?.profilePhoto,mediaId:l,avatarOwnerId:d,emojiStatusSticker:f,...h&&{topic:h,messagesCount:(0,r.xxG)(e,t,u)}}}))((({forceShowSelf:e,canPlayVideo:t,user:n,userStatus:r,chat:b,isSynced:C,mediaId:w,avatarOwnerId:S,topic:I,messagesCount:N,userPersonalPhoto:M,userProfilePhoto:k,userFallbackPhoto:T,chatProfilePhoto:x,emojiStatusSticker:U})=>{const{loadFullUser:j,openMediaViewer:_,openPremiumModal:H,openStickerSet:z,openPrivacySettingsNoticeModal:V}=(0,o.Sv)(),W=(0,h.Z)(),{id:q}=n||{},{id:Y}=b||{},G=n?.photos||b?.photos||d.D,X=(0,Z.Z)(w),J=(0,Z.Z)(S),K=(0,g.Y)(w),[Q,ee]=(0,a.eJ)(!0),te=Q?W.isRtl?"slideRtl":"slide":"none",[ne,ae]=(0,a.eJ)(0),oe=G.length<=1||0===ne,se=G.length<=1||ne===G.length-1;(0,a.d4)((()=>{J&&void 0!==X&&void 0===w&&(ee(!1),ae(X))}),[w,X,J]),(0,a.d4)((()=>{ee(!1),ae(K.current||0)}),[K,G]),(0,a.d4)((()=>{ne>G.length&&(ee(!1),ae(Math.max(0,G.length-1)))}),[ne,G.length]),(0,a.d4)((()=>{C&&q&&!e&&j({userId:q})}),[q,j,C,e]),function(e,t){(0,a.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])}(G,ne);const ie=(0,p.Z)((()=>{_({avatarOwnerId:q||Y,mediaId:ne,origin:e?s.bZ.SettingsAvatar:s.bZ.ProfileAvatar})})),re=(0,p.Z)((()=>{q?H({fromUserId:q}):z({stickerSetInfo:U.stickerSetInfo})})),ce=(0,p.Z)((()=>{oe||(ee(!0),ae(ne-1))})),le=(0,p.Z)((()=>{se||(ee(!0),ae(ne+1))})),de=(0,p.Z)((()=>{V({chatId:b.id,isReadDate:!1})}));if((0,a.d4)((()=>{const e=document.querySelector(`.${$}`);if(e)return(0,l.sf)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:m.$b?(e,t)=>t===l.eM.Right?(ce(),!0):t===l.eM.Left&&(le(),!0):void 0})}),[le,ce]),n||b)return I?a.ZP.createElement("div",{className:"yzg267rr"},a.ZP.createElement(R.Z,{topic:I,size:120,className:"ZCxp0_t4",letterClassName:"lkfZNWOm",noLoopLimit:!0}),a.ZP.createElement("h3",{className:"umOuiu3K",dir:W.isRtl?"rtl":void 0},(0,u.Z)(I.title)),a.ZP.createElement("p",{className:"tLTzQ2ks"},N?W("Chat.Title.Topic",N,"i"):W("lng_forum_no_messages"))):a.ZP.createElement("div",{className:(0,c.Z)("ProfileInfo",e&&"DnvLcTfv"),dir:W.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:$},function(){if(G&&!(G.length<=1))return a.ZP.createElement("div",{className:"uyvKpR3B"},G.map(((e,t)=>a.ZP.createElement("span",{className:(0,c.Z)("wB4yjvei",t===ne&&"aZmp9FLh")}))))}(),!e&&M&&a.ZP.createElement("div",{className:(0,c.Z)(L,oe&&D)},a.ZP.createElement("div",{className:B},W(M.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto"))),e&&T&&a.ZP.createElement("div",{className:(0,c.Z)(L,(oe||se)&&D)},a.ZP.createElement("div",{className:B,onClick:function(){oe&&(ee(!0),ae(G.length-1))}},!se&&a.ZP.createElement(E.Z,{photo:T,className:"R7w3H5eC",size:"mini"}),W(T.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto"))),a.ZP.createElement(P.ZP,{activeKey:ne,name:te},me),!oe&&a.ZP.createElement("button",{type:"button",dir:W.isRtl?"rtl":void 0,className:(0,c.Z)(F,"RQITz4WQ"),"aria-label":W("AccDescrPrevious"),onClick:ce}),!se&&a.ZP.createElement("button",{type:"button",dir:W.isRtl?"rtl":void 0,className:(0,c.Z)(F,"_0F1Txru"),"aria-label":W("Next"),onClick:le})),a.ZP.createElement("div",{className:"UcyW7tVh",dir:W.isRtl?"rtl":"auto"},(n||b)&&a.ZP.createElement(y.Z,{peer:n||b,withEmojiStatus:!0,emojiStatusSize:24,onEmojiStatusClick:re,noLoopLimit:!0,canCopyTitle:!0}),function(){const e=Y||q;if(!(0,i.wo)(e))return n?a.ZP.createElement("div",{className:(0,c.Z)(O,"status",(0,i.kM)(n,r)&&"online")},a.ZP.createElement("span",{className:"_HDVUj4P",dir:"auto"},(0,i.Tq)(W,n,r)),r?.isReadDateRestrictedByMe&&a.ZP.createElement("span",{className:"Qga38M20",onClick:de},a.ZP.createElement("span",null,W("StatusHiddenShow")))):a.ZP.createElement("span",{className:(0,c.Z)(O,"status"),dir:"auto"},(0,i.eA)(b)?W("Subscribers",b.membersCount??0,"i"):W("Members",b.membersCount??0,"i"))}()));function me(e){const o=(G.length>0?G[ne]:void 0)||M||k||x||T;return a.ZP.createElement(A,{key:ne,user:n,chat:b,photo:o,canPlayVideo:Boolean(e&&t),onClick:ie})}})))},48198:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(60748),o=n(59187),s=n(41765),i=n(46752),r=n(6202),c=n(70692),l=n(96459),d=n(69123);const m=(0,a.X$)((({reaction:e,availableReactions:t,className:n,size:m,withIconHeart:u,observeIntersection:h})=>{const p="documentId"in e,Z=(0,a.Ye)((()=>t?.find((t=>(0,s.Hl)(t.reaction,e)))),[t,e]),g=Z?.staticIcon?.id,f=(0,r.Z)(`document${g}`,!g,o.IU.BlobUrl),v=(0,c.Z)(f),P="emoticon"in e&&"🦄"===e.emoticon,E=u&&"emoticon"in e&&""===e.emoticon;return p?a.ZP.createElement(l.Z,{documentId:e.documentId,className:(0,i.Z)("ReactionStaticEmoji",n),size:m,observeIntersectionForPlaying:h}):E?a.ZP.createElement("i",{className:"ReactionStaticEmoji icon icon-heart",style:`font-size: ${m}px; width: ${m}px`}):a.ZP.createElement("img",{className:(0,i.Z)("ReactionStaticEmoji",P&&"with-unicorn-fix",v,n),style:m?`width: ${m}px; height: ${m}px`:void 0,src:f||d,alt:Z?.title,draggable:!1})}))},66534:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(60748),o=n(33555),s=n(46752),i=n(59107),r=n(25190),c=n(231),l=n(97687),d=n(34563),m=n(14434);const u=(0,a.X$)((({isOpen:e,subject:t="messages",peerId:n,photo:u,messageIds:h,storyId:p,onClose:Z,onCloseAnimationEnd:g})=>{const{reportMessages:f,reportPeer:v,reportProfilePhoto:P,reportStory:E,exitMessageSelectMode:y}=(0,o.Sv)(),[b,C]=(0,a.eJ)("spam"),[w,S]=(0,a.eJ)(""),I=(0,r.Z)((()=>{switch(t){case"messages":f({messageIds:h,reason:b,description:w}),y();break;case"peer":v({chatId:n,reason:b,description:w});break;case"media":P({chatId:n,photo:u,reason:b,description:w});break;case"story":E({peerId:n,storyId:p,reason:b,description:w})}Z()})),N=(0,r.Z)((e=>{C(e)})),M=(0,r.Z)((e=>{S(e.target.value)})),k=(0,i.Z)(),T=(0,a.Ye)((()=>[{value:"spam",label:k("lng_report_reason_spam")},{value:"violence",label:k("lng_report_reason_violence")},{value:"pornography",label:k("lng_report_reason_pornography")},{value:"childAbuse",label:k("lng_report_reason_child_abuse")},{value:"copyright",label:k("ReportPeer.ReasonCopyright")},{value:"illegalDrugs",label:"Illegal Drugs"},{value:"personalDetails",label:"Personal Details"},{value:"other",label:k("lng_report_reason_other")}]),[k]);if("messages"===t&&!h||"peer"===t&&!n||"media"===t&&(!n||!u)||"story"===t&&(!p||!n))return;const x=k("messages"===t?"lng_report_message_title":"ReportPeer.Report");return a.ZP.createElement(d.Z,{isOpen:e,onClose:Z,onEnter:e?I:void 0,onCloseAnimationEnd:g,className:(0,s.Z)("narrow","story"===t&&"component-theme-dark"),title:x},a.ZP.createElement(m.Z,{name:"report-message",options:T,onChange:N,selected:b}),a.ZP.createElement(l.Z,{label:k("lng_report_reason_description"),value:w,onChange:M}),a.ZP.createElement("div",{className:"dialog-buttons"},a.ZP.createElement(c.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:I},k("lng_report_button")),a.ZP.createElement(c.Z,{className:"confirm-dialog-button",isText:!0,onClick:Z},k("Cancel"))))}))},2995:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(96459),s=n(58987);const i=(0,a.X$)((({topic:e,className:t,letterClassName:n,size:i,noLoopLimit:r,observeIntersection:c,onClick:l})=>e.iconEmojiId&&"0"!==e.iconEmojiId?a.ZP.createElement(o.Z,{documentId:e.iconEmojiId,className:t,size:i,observeIntersectionForPlaying:c,loopLimit:r?void 0:2,onClick:l}):a.ZP.createElement(s.Z,{iconColor:e.iconColor,title:e.title,topicId:e.id,className:t,letterClassName:n,onClick:l})))},68729:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(33555),s=n(41765),i=n(7054),r=n(32340),c=n(59107),l=n(78780);const d=(0,a.X$)((0,o.c$)(((e,{typingStatus:t})=>t.userId?{typingUser:(0,i.dyD)(e,t.userId)}:{}))((({typingStatus:e,typingUser:t})=>{const n=(0,c.Z)(),o=t&&!t.isSelf&&(0,s.Vl)(t),i=n(e.action).replace("{user}","").replace("{emoji}",e.emoji||"").trim();return a.ZP.createElement("p",{className:"typing-status",dir:n.isRtl?"rtl":"auto"},o&&a.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,r.Z)(o)),a.ZP.createElement(l.Z,{content:i}))})))},45418:(e,t,n)=>{n.d(t,{Z:()=>Z});var a=n(60748),o=n(41765),s=n(46752),i=n(33323),r=n(48035),c=n(996),l=n(32340),d=n(59107),m=n(25190),u=n(8337),h=n(13709),p=n(10088);const Z=(0,a.X$)((({message:e,senderTitle:t,isProtected:n,observeIntersection:Z,onMessageClick:g})=>{const f=(0,d.Z)();let v=(0,o.s1)(e);if(!v){const t=(0,o.T7)(e);if(t){const{url:n,domain:a}=t;v={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,o.UD)(e)!==n?(0,c.e)(f,e,void 0,void 0,170):void 0}}}const P=(0,m.Z)((()=>{g(e.id,e.chatId)}));if(!v)return;const{siteName:E,url:y,displayUrl:b,title:C,description:w,formattedDescription:S,photo:I,video:N}=v,M=!t&&w&&(0,r.Z)(w,170),k=(0,s.Z)("WebLink scroll-item",!I&&!N&&"without-media"),T=y.replace("mailto:","")||b;return a.ZP.createElement("div",{className:k,"data-initial":(E||b)[0],dir:f.isRtl?"rtl":void 0},I&&a.ZP.createElement(h.Z,{message:e,isProtected:n,observeIntersection:Z}),a.ZP.createElement("div",{className:"content"},a.ZP.createElement(u.Z,{isRtl:f.isRtl,className:"site-title",onClick:P},(0,l.Z)(C||E||b)),(M||S)&&a.ZP.createElement(u.Z,{isRtl:f.isRtl,className:"site-description",onClick:P},S||M&&(0,l.Z)(M)),a.ZP.createElement(p.Z,{url:y,className:"site-name",text:T,isRtl:f.isRtl}),t&&a.ZP.createElement("div",{className:"sender-name"},(0,l.Z)(t))),t&&a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(u.Z,{className:"date",onClick:P,isRtl:f.isRtl},(0,i.VX)(f,1e3*e.date))))}))},32683:(e,t,n)=>{n.d(t,{Z:()=>w,m:()=>C});var a=n(60748),o=n(41765),s=n(46752),i=n(68368),r=n(74399),c=n(33780),l=n(32340),d=n(4809),m=n(39415),u=n(3657),h=n(59107),p=n(6202),Z=n(2903),g=n(75368),f=n(64261),v=n(65979),P=n(62230),E=n(45370),y=n(41278);const b=({className:e,message:t,replyInfo:n,sender:i,senderChat:b,forwardSender:C,title:w,customText:S,isProtected:I,isInComposer:N,noUserColors:M,chatTranslations:k,requestedChatTranslationLanguage:T,observeIntersectionForLoading:x,observeIntersectionForPlaying:A,onClick:R})=>{const O=(0,a.sO)(null),L=(0,u.Op)(O,x),B=(0,a.Ye)((()=>{const e="message"===n?.type&&n.replyMedia;if(e)return{content:e}}),[n]),D=(0,p.Z)(t&&(0,o.Ti)(t,"pictogram"),!L),$=(0,Z.Z)(t||B),F=Boolean(t&&(0,o.Y5)(t)),U=Boolean(t&&(0,o.NE)(t)),j=Boolean("message"===n?.type&&n.isQuote),_="message"===n?.type?n.replyFrom:void 0,H=t&&(0,o.cT)(t),{translatedText:z}=(0,g.Z)(k,t?.chatId,H?t?.id:void 0,T),V=(0,h.Z)(),W=i?(0,o.OU)(V,i):_?.hiddenUserName||t?.forwardInfo?.hiddenUserName,q=b?(0,o.OU)(V,b):void 0,Y=C?(0,o.OU)(V,C):t?.forwardInfo?.hiddenUserName,G=i&&i.id===C?.id,{handleClick:X,handleMouseDown:J}=(0,m.m)(R);return a.ZP.createElement("div",{ref:O,className:(0,s.Z)("EmbeddedMessage",e,(0,c.D)(i,M,!0),j&&"is-quote",$&&"with-thumb"),dir:V.isRtl?"rtl":void 0,onClick:X,onMouseDown:J},$&&function(e,t,n,o,i){const{width:c,height:l}=(0,r.W7)(),d=t||e;return a.ZP.createElement("div",{className:(0,s.Z)("embedded-thumb",n&&"round")},!i&&a.ZP.createElement("img",{src:d,width:c,height:l,alt:"",className:"pictogram",draggable:!1}),a.ZP.createElement(P.Z,{thumbDataUri:d,isVisible:Boolean(i),width:c,height:l}),o&&a.ZP.createElement("span",{className:"protector"}))}($,D,F,I,U),i?.color?.backgroundEmojiId&&a.ZP.createElement(y.Z,{emojiDocumentId:i.color.backgroundEmojiId,className:"EmbeddedMessage--background-icons"}),a.ZP.createElement("div",{className:"message-text"},a.ZP.createElement("p",{className:(0,s.Z)("embedded-text-wrapper",j&&"multiline")},"message"===n?.type&&n.quoteText?(0,d.H)({text:n.quoteText.text,entities:n.quoteText.entities,noLineBreaks:N}):t?(0,o.FT)(t)?a.ZP.createElement(f.Z,{message:t,isEmbedded:!0,observeIntersectionForLoading:x,observeIntersectionForPlaying:A}):a.ZP.createElement(E.Z,{lang:V,message:t,noEmoji:Boolean($),translatedText:z,observeIntersectionForLoading:x,observeIntersectionForPlaying:A,emojiSize:17}):S||" "),a.ZP.createElement("div",{className:"message-title"},function(){if(w)return(0,l.Z)(w);if(!W)return" ";let e;b&&((0,o.eA)(b)&&(e="channel-filled"),(0,o.Bf)(b)&&(e="group-filled"));const t=b&&b.id===i?.id,s=N&&Boolean(n&&"quoteText"in n&&n?.quoteText);return a.ZP.createElement(a.ZP.Fragment,null,!t&&a.ZP.createElement("span",{className:"embedded-sender"},(0,l.Z)(s?V("ReplyToQuote",W):W)),e&&a.ZP.createElement(v.Z,{name:e,className:"embedded-chat-icon"}),e&&q&&(0,l.Z)(q))}(),Y&&!G&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(v.Z,{name:C?"share-filled":"forward",className:"embedded-origin-icon"}),(0,l.Z)(Y)))))},C=(0,i.Z)(b),w=b},41278:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(60748),o=n(57710),s=n(41765),i=n(46752),r=n(71394),c=n(74399),l=n(92085),d=n(59107),m=n(25190),u=n(6202),h=n(78722),p=n(38146),Z=n(60422);const g=[{inline:22,block:38,opacity:.35,scale:.75},{inline:32,block:12,opacity:.3,scale:1},{inline:60,block:22,opacity:.25,scale:.75},{inline:75,block:44,opacity:.25,scale:1},{inline:75,block:2,opacity:.2,scale:.625},{inline:95,block:18,opacity:.2,scale:1},{inline:115,block:38,opacity:.2,scale:.625},{inline:125,block:12,opacity:.1,scale:.75}],f=c.Gw,v=(0,a.X$)((({emojiDocumentId:e,className:t})=>{const n=(0,a.sO)(null),c=(0,a.sO)(null),[v,P]=(0,a.eJ)(),E=(0,p.Z)(),y=(0,d.Z)(),{customEmoji:b}=(0,Z.Z)(e),C=b?(0,s.RK)(b.id):void 0,w=(0,u.Z)(C),S=(0,l.Z)(c);(0,a.d4)((()=>{w&&(0,r.pt)(w).then(P)}),[w]);const I=(0,m.Z)((()=>{const e=n.current;if(!e||!v||!S)return;const t=e.getContext("2d"),{width:a,height:o}=e;t.clearRect(0,0,a,o),g.forEach((({inline:e,block:n,opacity:o,scale:s})=>{const i=(y.isRtl?e:a/E-e)*E,r=n*E,c=f*E;t.save(),t.globalAlpha=o,t.translate(i,r),t.scale(s,s),t.drawImage(v,-c/2,-c/2,c,c),t.restore()}));const s=`${S}${b.isLottie?"ff":"bb"}`;t.save(),t.fillStyle=s,t.globalCompositeOperation="source-atop",t.fillRect(0,0,a,o),t.restore()}));(0,a.d4)((()=>{I()}),[v,y.isRtl,S]);const N=(0,m.Z)(((e,t)=>{const a=n.current;a&&(a.width=e*E,a.height=t*E,a.style.width=`${e}px`,a.style.height=`${t}px`,I())})),M=(0,m.Z)((e=>{const{width:t,height:n}=e.contentRect;(0,o.WM)((()=>{N(t,n)}))}));return(0,h.Z)(c,M),(0,a.d4)((()=>{const e=c.current;if(!e)return;const{width:t,height:n}=e.getBoundingClientRect();(0,o.WM)((()=>{N(t,n)}))}),[E]),a.ZP.createElement("div",{className:(0,i.Z)("pTWe_CYU",t),ref:c},a.ZP.createElement("canvas",{ref:n}))}))},4830:(e,t,n)=>{function a(e,t){const{level:n,boosts:a,currentLevelBoosts:o,nextLevelBoosts:s,hasMyBoost:i,prepaidGiveaways:r}=e,c=t&&a===o&&i;return{currentLevel:c?n-1:n,hasNextLevel:Boolean(s),boosts:a,levelProgress:!s||c?1:(a-o)/(s-o),remainingBoosts:s?s-a:0,isMaxLevel:void 0===s,prepaidGiveaways:r}}n.d(t,{k:()=>a})},659:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(83716);function o(e,t){return t?`${a.zHP}${e}`:`@${e}`}},996:(e,t,n)=>{n.d(t,{X:()=>l,e:()=>d});var a=n(59187),o=n(41765),s=n(490),i=n(48035),r=n(32340),c=n(4809);function l({message:e,highlight:t,emojiSize:n,isSimple:a,truncateLength:r,isProtected:l,forcePlayback:d,shouldRenderAsHtml:m,isForMediaViewer:u}){const{text:h,entities:p}=e.content.text||{};if(!h){const t=(0,o.UD)(e);return t?[(0,i.Z)(t,r)]:void 0}const Z=(0,s.Tp)(e);return(0,c.H)({text:(0,i.Z)(h,r),entities:p,highlight:t,emojiSize:n,shouldRenderAsHtml:m,containerId:`${u?"mv-":""}${Z}`,isSimple:a,isProtected:l,forcePlayback:d})}function d(e,t,n=!1,s,c=o.lN){const{entities:d}=t.content.text||{},m=d?.some((e=>e.type===a.Vv.Spoiler)),u=d?.some((e=>e.type===a.Vv.CustomEmoji));if(!m&&!u){const a=(0,i.Z)((0,o.MK)(e,t,n),c);return s?(0,r.Z)(a,["emoji","highlight"],{highlight:s}):(0,r.Z)(a)}const h=!n&&(0,o.Eb)(t),p=h?`${h} `:"",Z=l({message:t,highlight:s,isSimple:!0,truncateLength:c}),g=(0,o.Kk)(e,t,Z);return[...(0,r.Z)(p),...Array.isArray(g)?g:[g]].filter(Boolean)}},67263:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(33555),o=n(7054),s=n(60782);const i=3e9,r=3e8;function c(e,t=!1,n){const c=(0,a.Rd)();return(0,s.Xo)(e,(e=>{const a=(0,o.Z1J)(c,e);if(!a)return 0;let s=0;const l=(0,o._If)(c,e);return l&&(s+=l.date),t&&a.isVerified&&(s+=i),n&&n.includes(e)&&(s=Date.now()+r+(n.length-n.indexOf(e))),s}),"desc")}},62277:(e,t,n)=>{n.d(t,{Z:()=>Q});var a=n(60748),o=n(33555),s=n(59187),i=n(83716),r=n(41765),c=n(7054),l=n(64319),d=n(6272),m=n(69118),u=n(3858),h=n(9950),p=n(659),Z=n(32340),g=n(274),f=n(59107),v=n(25190),P=n(6202),E=n(38146),y=n(19235),b=n(31876),C=n(74607),w=n(83321),S=n(57710),I=n(46752),N=n(33323);const M=1440,k=10080;function T(){const e=new Date;e.setHours(0,0,0,0);const t=e.getDay(),n=e.getDate()-t+(0===t?-6:1);return new Date(e.setDate(n)).getTime()}function x(e,t){if(0===t)return e;const n=[];for(const a of e){let e=(a.startMinute+t)%k,o=(a.endMinute+t)%k;e<0&&(e+=k),o<=0&&(o+=k),e>o?(n.push({startMinute:e,endMinute:10079}),n.push({startMinute:0,endMinute:o})):n.push({startMinute:e,endMinute:o})}return n.sort(((e,t)=>e.startMinute-t.startMinute)),n.reduce(((e,t)=>{const n=e[e.length-1];return n&&n.endMinute>=t.startMinute?n.endMinute=Math.max(n.endMinute,t.endMinute):e.push(t),e}),[])}var A=n(97184),R=n(96557),O=n(86203),L=n(60706),B=n(65326),D=n(78961),$=n(2255),F=n(65979);const U="MPBKHdZL",j=Array.from({length:7},((e,t)=>t)),_=(0,a.X$)((({businessHours:e})=>{const t=(0,a.sO)(null),[n,o,s]=(0,L.Z)(!1),[i,r,c]=(0,L.Z)(!1),l=(0,f.Z)(),d=(0,B.Z)();(0,R.Z)(d,6e4);const m=(0,D.Z)((e=>e.timezones?.byId)),u=(0,O.Z)(m,[m]),h=(0,a.Ye)((()=>{if(!u)return 0;const t=u[e.timezoneId];return(-60*(new Date).getTimezoneOffset()-t.utcOffset)/60}),[e.timezoneId,u]),p=(0,a.Ye)((()=>{const t=T(),n=function(e){const t={};for(const n of e){const e=n.startMinute,a=n.endMinute,o=Math.floor(e/M),s=Math.floor((a-1)/M);for(let n=o;n<=s;n++)t[n]||(t[n]=[]),t[n].push({startMinute:Math.max(0,e-n*M),endMinute:Math.min(M,a-n*M)})}return t}(x(e.workHours,i?h:0)),a={};return j.forEach((e=>{const o=n[e];a[e]=o?o.map((({startMinute:e,endMinute:n})=>n-e==1440?l("BusinessHoursDayFullOpened"):`${(0,N.mr)(l,t+60*e*1e3)} ${(0,N.mr)(l,t+60*n*1e3)}`)):[l("BusinessHoursDayClosed")]})),a}),[e.workHours,i,l,h]),Z=(0,a.Ye)((()=>{const t=x(e.workHours,h),n=T(),a=((new Date).getTime()-n)/1e3/60;return t.some((({startMinute:e,endMinute:t})=>e<=a&&a<=t))}),[e.workHours,h]),g=(0,a.Ye)((()=>(new Date(Date.now()-(i?0:60*h*1e3)).getDay()+6)%7),[i,h]),P=(0,v.Z)((()=>{n?s():o()})),E=(0,v.Z)((e=>{e.stopPropagation(),i?c():r()}));(0,a.d4)((()=>{if(!n)return;const e=document.querySelector(`.${$.qM} > .${U}`);if(!e)return;const a=e.offsetHeight;(0,S.WM)((()=>{t.current.style.height=`${a}px`}))}),[n]);const y=(0,v.Z)((()=>{const e=document.querySelector(`.${$.Am} > .${U}`);(0,S.i$)((()=>{const n=e.offsetHeight;(0,S.WM)((()=>{t.current.style.height=`${n}px`}))}))}));return a.ZP.createElement(b.Z,{icon:"clock",iconClassName:"rlM4Mbnn",multiline:!0,className:"Ef_0p5Qm",isStatic:n,ripple:!0,narrow:!0,withColorTransition:!0,onClick:P},a.ZP.createElement("div",{className:"nHSmCUNs"},a.ZP.createElement("div",{className:"JTZ8UnnP"},a.ZP.createElement("div",null,l("BusinessHoursProfile")),a.ZP.createElement("div",{className:(0,I.Z)("JVL7ZnnJ",Z&&"segAfYXs")},l(Z?"BusinessHoursProfileNowOpen":"BusinessHoursProfileNowClosed"))),a.ZP.createElement(F.Z,{className:"dYxw2cFn",name:n?"up":"down"})),n&&a.ZP.createElement("div",{className:"lp9VIV1o"},Boolean(h)&&a.ZP.createElement("div",{className:"gVwflFhz",role:"button",tabIndex:0,onMouseDown:A.$b?void 0:E,onClick:A.$b?E:void 0},l(i?"BusinessHoursProfileSwitchMy":"BusinessHoursProfileSwitchLocal")),a.ZP.createElement($.ZP,{className:"WKgL_XiP",ref:t,name:"fade",activeKey:Number(i),onStart:y},a.ZP.createElement("dl",{className:U},j.map((e=>a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("dt",{className:(0,I.Z)("cmxPqAof",e===g&&"YZVvP_56")},(0,N.$y)(l,6===e?0:e+1)),a.ZP.createElement("dd",{className:"Rs0VPgpq"},p[e].map((e=>a.ZP.createElement("div",null,e)))))))))))}));var H=n(60782),z=n(40647),V=n(49488),W=n(36765);const q=["🎉","🎆","🎈"],Y=(0,a.X$)((0,o.c$)((e=>{const{birthdayNumbers:t,animatedEmojiEffects:n}=e;return{birthdayNumbers:t,animatedEmojiEffects:n,isPremiumPurchaseBlocked:(0,c.oe5)(e)}}))((({user:e,birthday:t,isPremiumPurchaseBlocked:n,birthdayNumbers:i,animatedEmojiEffects:c,isInSettings:l})=>{const{openGiftPremiumModal:d,requestConfetti:m}=(0,o.Sv)(),u=(0,a.sO)(null),h=(0,a.sO)(!1),[p,g,P]=(0,L.Z)(),E=(0,f.Z)(),{formattedDate:y,isToday:C,age:w}=(0,a.Ye)((()=>{const e=new Date,n=new Date;return t.year&&n.setFullYear(t.year),n.setMonth(t.month-1),n.setDate(t.day),n.setHours(0,0,0,0),{formattedDate:(0,N.xH)(n,E.code,!0,"long"),isToday:n.getDate()===e.getDate()&&n.getMonth()===e.getMonth(),age:t.year&&G(n)}}),[t,E]),M=(0,a.Ye)((()=>{if(!w||!C)return;const e=i?.stickers?.filter((({emoji:e})=>e?.endsWith("")));if(!e)return;const t=(0,H.ee)(e,"emoji");return w.toString().split("").map((e=>t[e+""]))}),[w,i?.stickers,C]),k=(0,a.Ye)((()=>{if(!C)return;const e=q[Math.floor(Math.random()*q.length)];return c?.stickers?.find((({emoji:t})=>t===e))}),[c?.stickers,C]);(0,a.d4)((()=>{if(C&&M&&(M.forEach((e=>{const t=(0,r.bZ)(e.id);z.he(t,s.IU.BlobUrl)})),k)){const e=(0,r.bZ)(k.id);z.he(e,s.IU.BlobUrl)}}),[k,C,M]),(0,V.Z)(P,p?3e3:void 0),(0,a.d4)((()=>{if(p){h.current=!0;const e=document.getElementById(l?"LeftColumn":"RightColumn");if(!e)return;(0,S.i$)((()=>{const{top:t,left:n,width:a,height:o}=e.getBoundingClientRect();m({top:t,left:n,width:a,height:o,style:"top-down"})}))}}),[l,p]);const T=`ProfileBirthday${C?"Today":""}Value${w?"Year":""}`,x=C&&!e.isPremium&&!e.isSelf&&!n,R=(0,v.Z)((()=>{d({forUserIds:[e.id]})})),O=(0,v.Z)((()=>{C&&(x&&h.current?R():g())})),B=!C&&!x;return a.ZP.createElement("div",{className:"wCp6TBYF"},a.ZP.createElement(b.Z,{icon:"calendar",secondaryIcon:x?"gift":void 0,secondaryIconClassName:"c4HDQNGJ",multiline:!0,narrow:!0,ref:u,ripple:!B,onClick:O,isStatic:B,onSecondaryIconClick:R},a.ZP.createElement("div",{className:"title"},(0,Z.Z)(E(T,[y,w],void 0,w))),a.ZP.createElement("span",{className:"subtitle"},E(C?"ProfileBirthdayToday":"ProfileBirthday"))),p&&A._G&&M?.map(((e,t)=>a.ZP.createElement("div",{className:(0,I.Z)("lQeU96Fj",t>0&&"e1ezfWJb"),style:`--digit-offset: ${t}`},a.ZP.createElement(W.Z,{containerRef:u,sticker:e,size:128,forceAlways:!0})))),p&&k&&a.ZP.createElement("div",{className:"cFEXGUih"},a.ZP.createElement(W.Z,{containerRef:u,sticker:k,size:288,shouldLoop:!0,forceAlways:!0})))})));function G(e){const t=new Date;let n=t.getFullYear()-e.getFullYear();const a=t.getMonth()-e.getMonth();return(a<0||0===a&&t.getDate()<e.getDate())&&n--,n}const X="UZbkeFDB",J={width:64,height:64,zoom:15},K=(0,m.Ds)((e=>e()),500,!1),Q=(0,a.X$)((0,o.c$)(((e,{chatOrUserId:t,isSavedDialog:n})=>{const{countryList:{phoneCodes:a}}=e,o=t?(0,c.Z1J)(e,t):void 0,s=t?(0,c.dyD)(e,t):void 0,i=o?.isForum,l=o&&(0,r.i4)(o,(0,c.dZI)(e),(0,c.NJL)(e)),{threadId:d}=(0,c.Btg)(e)||{},m=i?Number(d):void 0,u=o&&(0,c.x67)(e,o.id),h=s&&(0,c.ccz)(e,s.id),p=u?.inviteLink,Z=h?.bio||u?.about;return{phoneCodeList:a,chat:o,user:s,userFullInfo:h,canInviteUsers:o&&!s&&(!(0,r.eA)(o)&&!(0,r.Mg)(o,"inviteUsers")||(0,r.VE)(o,"inviteUsers")),isMuted:l,topicId:m,chatInviteLink:p,description:Z,topicLink:m?(0,c.Pn)(e,t,m):void 0,hasSavedMessages:!n&&e.chats.listIds.saved?.includes(t),personalChannel:h?.personalChannelId?(0,c.Z1J)(e,h.personalChannelId):void 0}}))((({chatOrUserId:e,user:t,chat:n,userFullInfo:c,isInSettings:m,canInviteUsers:S,isMuted:I,phoneCodeList:N,topicId:M,description:k,chatInviteLink:T,topicLink:x,hasSavedMessages:A,personalChannel:R})=>{const{showNotification:O,updateChatMutedState:L,updateTopicMutedState:B,loadPeerStories:D,openSavedDialog:$,openMapModal:F,requestCollectibleInfo:U}=(0,o.Sv)(),{id:j,usernames:H,phoneNumber:z,isSelf:V}=t||{},{id:W,usernames:q}=n||{},G=j||W,{businessLocation:Q,businessWorkHours:ee,personalChannelMessageId:te,birthday:ne}=c||{},ae=(0,f.Z)(),[oe,se]=(0,a.eJ)(!I);(0,a.d4)((()=>{se(!I)}),[I]),(0,g.Z)((([e])=>{G&&e!==G&&(t||n&&(0,r.eA)(n))&&D({peerId:G})}),[G,n,t]);const{width:ie,height:re,zoom:ce}=J,le=(0,E.Z)(),de=Q?.geo&&(0,r.k6)(Q.geo,ie,re,ce,le),me=(0,P.Z)(de),ue=(0,a.Ye)((()=>{if(Q?.geo)return me?a.ZP.createElement("img",{src:me,alt:"",className:X}):a.ZP.createElement(C.Z,{className:X})}),[Q,me]),he=Boolean(M&&M!==s._f),pe=n&&(0,r.eA)(n)||t?.isPremium,Ze=(0,a.Ye)((()=>{const e=H?.filter((e=>e.isActive));return e?.length?e:void 0}),[H]),ge=(0,a.Ye)((()=>{const e=t?void 0:q?.filter((e=>e.isActive));return e?.length?e:void 0}),[q,t]),fe=(0,a.Ye)((()=>{if(n)return he?x:(0,r.hu)(n)||T}),[n,he,x,T]),ve=(0,v.Z)((()=>{const{address:e,geo:t}=Q;if(!t)return(0,l.TE)(e),void O({message:ae("BusinessLocationCopied")});F({geoPoint:t,zoom:ce})})),Pe=(0,v.Z)((()=>{se((e=>{const t=!e;return K((()=>{he?B({chatId:W,topicId:M,isMuted:!t}):L({chatId:W,isMuted:!t})})),t}))})),Ee=(0,v.Z)((()=>{$({chatId:e})}));function ye(e,t){(0,l.TE)(e),O({message:`${t} was copied`})}const be=z&&(0,d.WZ)(N,z),Ce=(0,v.Z)((()=>{z?.length===i.c4A&&z.startsWith(i.DRi)?U({collectible:z,userId:j,type:"phone"}):ye(be,ae("Phone"))})),we=(0,v.Z)(((e,t)=>{e.isEditable?ye((0,p.Z)(e.username,t),ae(t?"Link":"Username")):U({collectible:e.username,userId:j,type:"username"})}));if(n&&!n.isRestricted&&(!V||m))return a.ZP.createElement("div",{className:"ChatExtra"},R&&a.ZP.createElement("div",{className:"HP5EJx7s"},a.ZP.createElement("h3",{className:"cHyTGri2"},ae("ProfileChannel")),a.ZP.createElement("span",{className:"kYd2GrmU"},ae("Subscribers",R.membersCount,"i")),a.ZP.createElement(y.Z,{chatId:R.id,orderDiff:0,animationType:h.b.None,isPreview:!0,previewMessageId:te,className:"qOJwhXMC"})),Boolean(be?.length)&&a.ZP.createElement(b.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:Ce},a.ZP.createElement("span",{className:"title",dir:"auto"},be),a.ZP.createElement("span",{className:"subtitle"},ae("Phone"))),Ze&&Se(Ze),k&&Boolean(k.length)&&a.ZP.createElement(b.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0},a.ZP.createElement("span",{className:"title word-break allow-selection",dir:"auto"},(0,Z.Z)(k,["br",pe?"links":"tg_links","emoji"])),a.ZP.createElement("span",{className:"subtitle"},ae(j?"UserBio":"Info"))),ge&&!he&&Se(ge,!0),(!ge&&S||he)&&fe&&a.ZP.createElement(b.Z,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>ye(fe,ae("SetUrlPlaceholder"))},a.ZP.createElement("div",{className:"title"},fe),a.ZP.createElement("span",{className:"subtitle"},ae("SetUrlPlaceholder"))),ne&&a.ZP.createElement(Y,{key:G,birthday:ne,user:t,isInSettings:m}),!m&&a.ZP.createElement(b.Z,{icon:"unmute",ripple:!0,onClick:Pe},a.ZP.createElement("span",null,ae("Notifications")),a.ZP.createElement(w.Z,{id:"group-notifications",label:j?"Toggle User Notifications":"Toggle Chat Notifications",checked:oe,inactive:!0})),ee&&a.ZP.createElement(_,{businessHours:ee}),Q&&a.ZP.createElement(b.Z,{icon:"location",ripple:!0,multiline:!0,narrow:!0,rightElement:ue,onClick:ve},a.ZP.createElement("div",{className:"title"},Q.address),a.ZP.createElement("span",{className:"subtitle"},ae("BusinessProfileLocation"))),A&&!m&&a.ZP.createElement(b.Z,{icon:"saved-messages",ripple:!0,onClick:Ee},a.ZP.createElement("span",null,ae("SavedMessagesTab"))));function Se(e,t){const[n,...o]=e,s=o.length?ae("UsernameAlso","%USERNAMES%").split("%").map((e=>"USERNAMES"===e?a.ZP.createElement(a.ZP.Fragment,null,o.map(((e,n)=>a.ZP.createElement(a.ZP.Fragment,null,n>0?", ":"",a.ZP.createElement("a",{key:e.username,href:(0,p.Z)(e.username,!0),onMouseDown:u.Z,onClick:n=>{(0,u.Z)(n),we(e,t)},className:"text-entity-link username-link"},(0,p.Z)(e.username)))))):e)):void 0;return a.ZP.createElement(b.Z,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>{we(n,t)}},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,p.Z)(n.username,t)),a.ZP.createElement("span",{className:"subtitle"},s&&a.ZP.createElement("span",{className:"other-usernames"},s),ae(t?"Link":"Username")))}})))},67427:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(60748),o=n(41765),s=n(46752),i=n(80036),r=n(97184),c=n(6202),l=n(96459);const d="PZAuNVZH",m=(0,a.X$)((({reaction:e,isLottie:t,className:n,particleSize:m,onEnded:u})=>{const h=(0,o.RK)(e.documentId),p=(0,c.Z)(t?void 0:h),Z=(0,a.Ye)((()=>r._G?Array.from({length:7}).map((()=>function(e=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(p||t)return a.ZP.createElement("div",{className:(0,s.Z)("aInga6VW",n),style:(0,i.Z)(Boolean(m)&&`--particle-size: ${m}px`)},Z.map(((n,o)=>{const s=`--offset-path: path('${n}');`;return t?a.ZP.createElement(l.Z,{documentId:e.documentId,className:d,style:s,withSharedAnimation:!0,size:m,onAnimationEnd:0===o?u:void 0}):a.ZP.createElement("img",{src:p,alt:"",className:d,style:s,draggable:!1,onAnimationEnd:0===o?u:void 0})})))}))},36368:(e,t,n)=>{n.d(t,{Z:()=>w});var a=n(60748),o=n(33555),s=n(41765),i=n(7054),r=n(46752),c=n(28712),l=n(74399),d=n(60706),m=n(3657),u=n(25190),h=n(6202),p=n(31212),Z=n(60422),g=n(97799),f=n(96459),v=n(48198),P=n(67427);const E={root:"O9uCTt5C","animated-icon":"HiI6SMxF",animatedIcon:"HiI6SMxF",effect:"NhFcTGja",animating:"ikfZ6Igz",withEffectOnly:"jjRJmHCg"},y=1.5*l.Gw,b=6.5*l.Gw,C=l.Gw,w=(0,a.X$)((0,o.c$)(((e,{containerId:t})=>{const{genericEmojiEffects:n,reactions:a}=e,{activeReactions:o}=(0,i.jUK)(e),s=(0,i.$Yd)(e,"reactionEffects");return{activeReactions:o?.[t],availableReactions:a.availableReactions,genericEffects:n,withEffects:s}}))((({containerId:e,reaction:t,className:n,size:i=y,effectSize:l=b,activeReactions:w,availableReactions:S,genericEffects:I,withEffects:N,withEffectOnly:M,shouldPause:k,shouldLoop:T,loopLimit:x,observeIntersection:A})=>{const{stopActiveReaction:R}=(0,o.Sv)(),O=(0,a.sO)(null),L="documentId"in t,B=(0,a.Ye)((()=>S?.find((e=>(0,s.Hl)(e.reaction,t)))),[S,t]),D=B?.centerIcon?.id,{customEmoji:$}=(0,Z.Z)(L?t.documentId:void 0),F=(0,a.Ye)((()=>{if(!L)return B?.aroundAnimation?.id;if(!$)return;const e=S?.find((e=>e.reaction.emoticon===$.emoji))?.aroundAnimation?.id;return e}),[B,S,$,L]),U=(0,a.Ye)((()=>{if(F)return F;if(!I?.stickers)return;const{stickers:e}=I;return e[Math.floor(Math.random()*e.length)].id}),[F,I]),j=(0,m.Op)(O,A),_=D&&`sticker${D}`,H=U&&`sticker${U}`,z=(0,h.Z)(_,!D),V=(0,h.Z)(H,!U),W=(0,a.Ye)((()=>w?.find((e=>(0,s.Hl)(e,t)))),[w,t]),q=Boolean(N&&W&&(L||z)&&V),Y=j&&(q&&!M||T),{shouldRender:G,transitionClassNames:X}=(0,p.Z)(q,void 0,!0,"slow"),{shouldRender:J,transitionClassNames:K}=(0,p.Z)(Y,void 0,!0,"slow"),Q=(0,u.Z)((()=>{R({containerId:e,reaction:t})})),[ee,te,ne]=(0,d.Z)(),ae=!(L||Y&&ee),{shouldRender:oe,transitionClassNames:se}=(0,p.Z)(ae,void 0,!0),ie=(0,r.Z)(E.root,G&&E.animating,M&&E.withEffectOnly,n);return a.ZP.createElement("div",{className:ie,ref:O},!M&&oe&&a.ZP.createElement(v.Z,{className:se,reaction:t,availableReactions:S,size:i,observeIntersection:A}),!M&&L&&a.ZP.createElement(f.Z,{documentId:t.documentId,className:E.customEmoji,size:i,noPlay:k,loopLimit:x,forceAlways:!0,observeIntersectionForPlaying:A}),J&&!L&&a.ZP.createElement(g.Z,{key:`${D}-${i}`,className:(0,r.Z)(E.animatedIcon,K),size:(0,c.gO)(1.9*i),tgsUrl:z,play:j&&!k,noLoop:!T,forceAlways:!0,onLoad:te,onEnded:ne}),G&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(g.Z,{key:`${U}-${l}`,className:(0,r.Z)(E.effect,X),size:l,tgsUrl:V,play:j,noLoop:!0,forceAlways:!0,onEnded:Q}),L&&!F&&j&&a.ZP.createElement(P.Z,{reaction:t,className:X,particleSize:Math.max(.5*i,C),onEnded:Q})))})))},50742:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(99203),s=n(48778);const i=e=>{const{isOpen:t}=e,n=(0,s.Z)(o.gl.Extra,"ChatFolderModal",!t);return n?a.ZP.createElement(n,e):void 0}},79347:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(99203),s=n(48778);const i=e=>{const{isOpen:t}=e,n=(0,s.Z)(o.gl.Extra,"MuteChatModal",!t);return n?a.ZP.createElement(n,e):void 0}},19235:(e,t,n)=>{n.d(t,{Z:()=>R});var a=n(60748),o=n(33555),s=n(59187),i=n(91713),r=n(41765),c=n(26646),l=n(7054),d=n(46752),m=n(15780),u=n(97184),h=n(42797),p=n(41470),Z=n(75790),g=n(60706),f=n(3657),v=n(25190),P=n(78961),E=n(31212),y=n(44499),b=n(70172),C=n(40329),w=n(2153),S=n(76844),I=n(66534),N=n(31876),M=n(50742),k=n(79347),T=n(77699);const x="AA5s1Pu4",A=(0,a.X$)((({isSelected:e,isActive:t,isMobile:n})=>a.ZP.createElement("div",{className:(0,d.Z)("byPckqUT",t&&"IsUWP16T",e&&!n&&"qy2i51dM")},a.ZP.createElement("div",{className:"nl36F75B"},a.ZP.createElement("div",{className:x}),a.ZP.createElement("div",{className:x}),a.ZP.createElement("div",{className:x}))))),R=(0,a.X$)((0,o.c$)(((e,{chatId:t,isSavedDialog:n,isPreview:a,previewMessageId:o})=>{const i=(0,l.Z1J)(e,t);if(!i)return{currentUserId:e.currentUserId};const d=o||(0,l.xMv)(e,t,n?"saved":"all"),m=o?(0,l.hjO)(e,t,o):(0,l._If)(e,t,n?"saved":"all"),{senderId:u,isOutgoing:h,forwardInfo:p}=m||{},Z=n?p?.fromId:u,g=m&&(0,c.H)(m)?.replyToMsgId,f=Z?(0,l.RGZ)(e,Z):void 0,v=m?(0,r.N5)(m):void 0,P=v&&g?(0,l.hjO)(e,i.id,g):void 0,{targetUserIds:E,targetChatId:y}=v||{},b=(0,r.zX)(i),{chatId:C,threadId:w,type:S}=(0,l.Btg)(e)||{},I=!a&&t===C&&(n?t===w:w===s._f),N=i.isForum&&t===C||t===(0,l.jUK)(e).forumPanelChatId,M=b?(0,l.dyD)(e,b):void 0,k=b?(0,l.ssc)(e,b):void 0,T=m&&(0,l.p$s)(e,m),x=(0,l.WPz)(e,t,s._f,"typingStatus");return{chat:i,isMuted:(0,r.i4)(i,(0,l.dZI)(e),(0,l.NJL)(e)),lastMessageSender:f,actionTargetUserIds:E,actionTargetChatId:y,actionTargetMessage:P,draft:(0,l.Mst)(e,t,s._f),isSelected:I,isSelectedForum:N,isForumPanelOpen:(0,l.nd)(e),canScrollDown:I&&"thread"===S,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,...h&&m&&{lastMessageOutgoingStatus:(0,l.dTW)(e,m)},user:M,userStatus:k,lastMessageTopic:T,typingStatus:x,withInterfaceAnimations:(0,l.FOo)(e),lastMessage:m,lastMessageId:d,currentUserId:e.currentUserId}}))((({chatId:e,folderId:t,orderDiff:n,animationType:c,isPinned:x,observeIntersection:R,chat:O,isMuted:L,user:B,userStatus:D,actionTargetUserIds:$,lastMessageSender:F,lastMessageOutgoingStatus:U,actionTargetMessage:j,actionTargetChatId:_,offsetTop:H,draft:z,withInterfaceAnimations:V,isSelected:W,isSelectedForum:q,isForumPanelOpen:Y,canScrollDown:G,canChangeFolder:X,lastMessageTopic:J,typingStatus:K,lastMessageId:Q,lastMessage:ee,isSavedDialog:te,currentUserId:ne,isPreview:ae,previewMessageId:oe,className:se,onDragEnter:ie})=>{const{openChat:re,openSavedDialog:ce,toggleChatInfo:le,focusLastMessage:de,focusMessage:me,loadTopics:ue,openForumPanel:he,closeForumPanel:pe,setShouldCloseRightColumn:Ze}=(0,o.Sv)(),{isMobile:ge}=(0,h.ZP)(),[fe,ve,Pe]=(0,g.Z)(),[Ee,ye,be]=(0,g.Z)(),[Ce,we,Se]=(0,g.Z)(),[Ie,Ne,Me]=(0,g.Z)(),[ke,Te,xe]=(0,g.Z)(),[Ae,Re,Oe]=(0,g.Z)(),[Le,Be,De]=(0,g.Z)(),[$e,Fe,Ue]=(0,g.Z)(),{isForum:je,isForumAsMessages:_e}=O||{};(0,Z.Z)(te?ne:e,Q,ee);const{renderSubtitle:He,ref:ze}=(0,y.Z)({chat:O,chatId:e,lastMessage:ee,typingStatus:K,draft:z,actionTargetMessage:j,actionTargetUserIds:$,actionTargetChatId:_,lastMessageTopic:J,lastMessageSender:F,observeIntersection:R,animationType:c,withInterfaceAnimations:V,orderDiff:n,isSavedDialog:te,isPreview:ae}),Ve=(0,P.Z)(l.hqL),We=(0,v.Z)((()=>{const t=ge&&_e;if(ge&&Ze({value:!0}),ae)me({chatId:e,messageId:oe});else{if(te)return ce({chatId:e,noForumTopicPanel:!0},{forceOnHeavyAnimation:!0}),void(ge&&le({force:!1}));if(je){if(Y)return void pe(void 0,{forceOnHeavyAnimation:!0});if(t||he({chatId:e},{forceOnHeavyAnimation:!0}),!_e)return}re({id:e,noForumTopicPanel:t,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),W&&G&&de()}})),qe=(0,v.Z)((t=>{t.preventDefault(),ie?.(e)})),Ye=(0,v.Z)((()=>{Te(),ve()})),Ge=(0,v.Z)((()=>{Re(),ye()})),Xe=(0,v.Z)((()=>{Be(),we()})),Je=(0,v.Z)((()=>{Fe(),Ne()})),Ke=(0,p.Z)({chat:O,user:B,handleDelete:Ye,handleMute:Ge,handleChatFolderChange:Xe,handleReport:Je,folderId:t,isPinned:x,isMuted:L,canChangeFolder:X,isSavedDialog:te,currentUserId:ne,isPreview:ae}),Qe=(0,f.Op)(ze,O?R:void 0);(0,a.d4)((()=>{Qe&&je&&O&&void 0===O.listedTopicIds&&ue({chatId:e})}),[O,e,je,Qe]);const et=B&&D&&(0,r.kM)(B,D),{hasShownClass:tt}=(0,E.Z)(et),nt=(0,a.Ye)((()=>{if(u.IT)return te?`#${(0,m.tB)(ne,"thread",e)}`:`#${(0,m.tB)(e,"thread",s._f)}`}),[e,ne,te]);if(!O)return;const at=B||O,ot=(0,d.Z)("Chat chat-item-clickable",(0,r.YC)(e)?"private":"group",je&&"forum",W&&"selected",q&&"selected-forum",ae&&"standalone",se);return a.ZP.createElement(N.Z,{ref:ze,className:ot,href:nt,style:`top: ${H}px`,ripple:!je&&!ge,contextActions:Ke,onClick:We,onDragEnter:qe,withPortalForMenu:!0},a.ZP.createElement("div",{className:(0,d.Z)("status","status-clickable")},a.ZP.createElement(b.Z,{peer:at,isSavedMessages:B?.isSelf,isSavedDialog:te,withStory:!B?.isSelf,withStoryGap:tt,storyViewerOrigin:i.ze.ChatList,storyViewerMode:"single-peer"}),a.ZP.createElement("div",{className:"avatar-badge-wrapper"},a.ZP.createElement("div",{className:(0,d.Z)("avatar-online",tt&&"avatar-online-shown")}),a.ZP.createElement(T.Z,{chat:O,isMuted:L,shouldShowOnlyMostImportant:!0,forceHidden:Ve})),O.isCallActive&&O.isCallNotEmpty&&a.ZP.createElement(A,{isMobile:ge,isSelected:W,isActive:V})),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"info-row"},a.ZP.createElement(w.Z,{peer:at,withEmojiStatus:!0,isSavedMessages:e===B?.id&&B?.isSelf,isSavedDialog:te,observeIntersection:R}),L&&!te&&a.ZP.createElement("i",{className:"icon icon-muted"}),a.ZP.createElement("div",{className:"separator"}),ee&&a.ZP.createElement(S.Z,{message:ee,outgoingStatus:te?void 0:U,draftDate:z?.date})),a.ZP.createElement("div",{className:"subtitle"},He(),!ae&&a.ZP.createElement(T.Z,{chat:O,isPinned:x,isMuted:L,isSavedDialog:te}))),ke&&a.ZP.createElement(C.Z,{isOpen:fe,onClose:Pe,onCloseAnimationEnd:xe,chat:O,isSavedDialog:te}),Ae&&a.ZP.createElement(k.Z,{isOpen:Ee,onClose:be,onCloseAnimationEnd:Oe,chatId:e}),Le&&a.ZP.createElement(M.Z,{isOpen:Ce,onClose:Se,onCloseAnimationEnd:De,chatId:e}),$e&&a.ZP.createElement(I.Z,{isOpen:Ie,onClose:Me,onCloseAnimationEnd:Ue,peerId:e,subject:"peer"}))})))},77699:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(46752),s=n(19369),i=n(2155),r=n(86203),c=n(34076),l=n(40126);const d=(0,a.X$)((({topic:e,chat:t,isPinned:n,isMuted:d,shouldShowOnlyMostImportant:m,wasTopicOpened:u,forceHidden:h,isSavedDialog:p})=>{const{unreadMentionsCount:Z=0,unreadReactionsCount:g=0}=t.isForum?{}:t,f=!n&&e&&!u,v=t.isForum&&!e,P=(0,a.Ye)((()=>v&&t?.topics?Object.values(t.topics).filter((({unreadCount:e})=>e)):void 0),[t,v]),E=(0,a.Ye)((()=>v?d&&P?.filter((e=>!1===e.isMuted)).length||P?.length:(e||t).unreadCount),[t,e,P,v,d]),y=(0,a.Ye)((()=>{const e=t.topics&&Object.values(t.topics).some((e=>!e.isMuted&&e.unreadCount));return d||t.topics&&!e}),[t,d]),b=!e&&t.hasUnreadMark,C=!(0,r.Z)((()=>(0,s.$Z)(h)?h():h),[h])&&Boolean(E||Z||b||n||g||f),w=Boolean((E||b)&&!p),S=(0,o.Z)("ChatBadge",y&&"muted",!w&&n&&"pinned",w&&"unread");return a.ZP.createElement(l.Z,{isCustom:!0,className:"ChatBadge-transition",isOpen:C},function(){const e=g&&a.ZP.createElement("div",{className:(0,o.Z)("ChatBadge reaction",y&&"muted")},a.ZP.createElement("i",{className:"icon icon-heart"})),t=Z&&a.ZP.createElement("div",{className:"ChatBadge mention"},a.ZP.createElement("i",{className:"icon icon-mention"})),s=f&&a.ZP.createElement("div",{className:(0,o.Z)("ChatBadge unopened",y&&"muted")}),r=b||E?a.ZP.createElement("div",{className:S},!b&&a.ZP.createElement(c.Z,{text:(0,i.bi)(E)})):void 0,l=n&&a.ZP.createElement("div",{className:S},a.ZP.createElement("i",{className:"icon icon-pinned-chat"})),d=[s,e,t,r,!r&&!t&&!e&&l].filter(Boolean);return p?l:0!==d.length?1===d.length?d[0]:m?[t,r,e,l].filter(Boolean)[0]:a.ZP.createElement("div",{className:"ChatBadge-wrapper"},d):void 0}())}))},13648:(e,t,n)=>{n.d(t,{Z:()=>_});var a=n(60748),o=n(33555),s=n(91713),i=n(83716),r=n(46752),c=n(16974),l=n(82267),d=n(97184),m=n(13995),u=n(57710),h=n(87675),p=n(67360),Z=n(25190),g=n(95616),f=n(73541),v=n(27407),P=n(3657),E=n(61204),y=n(21273),b=n(34288),C=n(41765),w=n(60782),S=n(2155),I=n(32340),N=n(59107),M=n(95481),k=n(31876);const T={root:"sG8AAzvK",minimized:"lTOui0dp",button:"bNkLqJf1",title:"rMTpNazX","unread-count":"O7esHjyC",unreadCount:"O7esHjyC",info:"OS2LWzdu",name:"bkCtPuPQ",icon:"f4LUPgr4",avatarWrapper:"RMY__Znz",avatar:"qeb0Aox1",chatsPreview:"_1817Hwgd",unread:"SS39xuL3"},x=(0,a.X$)((({archiveSettings:e,onDragEnter:t,onClick:n})=>{const{updateArchiveSettings:s}=(0,o.Sv)(),c=(0,N.Z)(),l=(0,g.d7)(i.WSp),d=(0,g.yi)(),m=d[i.WSp]?.chatsCount,u=(0,a.Ye)((()=>{if(!l?.length)return c("Loading");const e=(0,o.Rd)().chats.byId;return l.slice(0,5).map(((t,n,o)=>{const s=n===o.length-1,i=e[t];if(!i)return;const l=(0,C.U)(c,i);return a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:(0,r.Z)(T.chat,m&&i.unreadCount&&T.unread)},(0,I.Z)(l)),s?"":", ")}))}),[l,c,m]),h=(0,a.Ye)((()=>{const t=!e.isMinimized&&{title:c("lng_context_archive_collapse"),icon:"collapse",handler:()=>{s({isMinimized:!0})}},n=e.isMinimized&&{title:c("lng_context_archive_expand"),icon:"expand",handler:()=>{s({isMinimized:!1})}},a={title:c("lng_context_archive_to_menu"),icon:"archive-to-main",handler:()=>{s({isHidden:!0})}};return(0,w.oA)([t,n,a])}),[e.isMinimized,c,s]),p=(0,a.I4)((e=>{e.preventDefault(),t?.()}),[t]);return a.ZP.createElement(k.Z,{onClick:n,onDragEnter:p,className:(0,r.Z)(T.root,e.isMinimized&&T.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:T.button,contextActions:h,withPortalForMenu:!0},e.isMinimized?a.ZP.createElement("div",{className:(0,r.Z)(T.info,"info")},a.ZP.createElement("div",{className:"info-row"},a.ZP.createElement("div",{className:(0,r.Z)("title",T.title)},a.ZP.createElement("h3",{dir:"auto",className:(0,r.Z)(T.name,"fullName")},a.ZP.createElement("i",{className:(0,r.Z)(T.icon,"icon","icon-archive-filled")}),c("ArchivedChats"))),a.ZP.createElement(M.Z,{className:T.unreadCount,text:m?(0,S.bi)(m):void 0}))):a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("div",{className:(0,r.Z)("status",T.avatarWrapper)},a.ZP.createElement("div",{className:(0,r.Z)("Avatar",T.avatar)},a.ZP.createElement("i",{className:"icon icon-archive-filled"}))),a.ZP.createElement("div",{className:(0,r.Z)(T.info,"info")},a.ZP.createElement("div",{className:"info-row"},a.ZP.createElement("div",{className:(0,r.Z)("title",T.title)},a.ZP.createElement("h3",{dir:"auto",className:(0,r.Z)(T.name,"fullName")},c("ArchivedChats")))),a.ZP.createElement("div",{className:"subtitle"},a.ZP.createElement("div",{className:(0,r.Z)("status",T.chatsPreview)},u),a.ZP.createElement(M.Z,{className:T.unreadCount,text:m?(0,S.bi)(m):void 0})))))}));var A=n(19235),R=n(7054),O=n(42797),L=n(45601),B=n(231);const D=(0,a.X$)((0,o.c$)(((e,{folderId:t,folderType:n})=>({chatFolder:t&&"folder"===n?(0,R.MwT)(e,t):void 0,animatedEmoji:(0,R.zB_)(e,"📂")})))((({chatFolder:e,animatedEmoji:t,foldersDispatch:n,onSettingsScreenSelect:o})=>{const i=(0,N.Z)(),{isMobile:r}=(0,O.ZP)(),c=(0,a.I4)((()=>{n({type:"editFolder",payload:e}),o(s.MT.FoldersEditFolderFromChatList)}),[e,n,o]);return a.ZP.createElement("div",{className:"yftKUVDQ"},a.ZP.createElement("div",{className:"UCBfMOiz"},t&&a.ZP.createElement(L.Z,{sticker:t,size:96})),a.ZP.createElement("h3",{className:"dB9cHelg",dir:"auto"},i("FilterNoChatsToDisplay")),a.ZP.createElement("p",{className:"TJ_liZcJ",dir:"auto"},i(e?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),e&&a.ZP.createElement(B.Z,{ripple:!r,fluid:!0,pill:!0,onClick:c,size:"smaller",isRtl:i.isRtl},a.ZP.createElement("i",{className:"icon icon-settings"}),a.ZP.createElement("div",{className:"aL7e0w4t"},i("ChatList.EmptyChatListEditFilter"))))})));var $=n(78722);const F="pedMJD_v",U=(0,a.X$)((({sessions:e,onHeightChange:t})=>{const{changeSessionSettings:n,terminateAuthorization:s,showNotification:i}=(0,o.Sv)(),r=(0,a.sO)(null),c=(0,N.Z)();(0,$.Z)(r,(e=>{const n=e.borderBoxSize?.[0]?.blockSize||e.contentRect.height;t(n)}));const l=(0,a.Ye)((()=>Object.values(e).sort(((e,t)=>t.dateCreated-e.dateCreated)).find((e=>e.isUnconfirmed))),[e]),d=(0,a.Ye)((()=>[l.deviceModel,l.region,l.country].filter(Boolean).join(", ")),[l]),m=(0,Z.Z)((()=>{n({hash:l.hash,isConfirmed:!0})})),u=(0,Z.Z)((()=>{s({hash:l.hash}),i({title:c("UnconfirmedAuthDeniedTitle",1),message:c("UnconfirmedAuthDeniedMessageSingle",d)})}));return a.ZP.createElement("div",{className:"yEkGgZVL",ref:r},a.ZP.createElement("h2",{className:"VhAJDrnz"},c("UnconfirmedAuthTitle")),a.ZP.createElement("p",{className:"WmyL1NJ8"},c("UnconfirmedAuthSingle",d)),a.ZP.createElement("div",{className:"_40UGD1Y"},a.ZP.createElement(B.Z,{fluid:!0,isText:!0,size:"smaller",className:F,onClick:m},c("UnconfirmedAuthConfirm")),a.ZP.createElement(B.Z,{fluid:!0,isText:!0,size:"smaller",color:"danger",onClick:u,className:F},c("UnconfirmedAuthDeny"))))})),j=new Set(["9","0"]),_=(0,a.X$)((({className:e,folderType:t,folderId:n,isActive:C,isForumPanelOpen:w,canDisplayArchive:S,archiveSettings:I,sessions:N,foldersDispatch:M,onSettingsScreenSelect:k,onLeftColumnContentChange:T})=>{const{openChat:R,openNextChat:O,closeForumPanel:L,toggleStoryRibbon:B}=(0,o.Sv)(),$=(0,a.sO)(null),F=(0,a.sO)(!1),[_,H]=(0,a.eJ)(0),z="archived"===t,V="all"===t,W="saved"===t,q=V?i.NfV:z?i.WSp:W?i.aV7:n,Y=V&&S&&I,G=(0,g.d7)(q);(0,m.Z)(G);const X=(G?.length||0)*i.rSj,J=Y?I?.isMinimized?i.RBO:i.rSj:0,{orderDiffById:K,getAnimationType:Q}=(0,E.Z)(G),[ee,te]=(0,v.Z)(void 0,G,void 0,i.t_F),ne=(0,a.Ye)((()=>{const e=Object.values(N||{}),t=e.find((e=>e.isCurrent));return!(!t||(0,l.bp)()-t.dateCreated<i.I0B)&&V&&e.some((e=>e.isUnconfirmed))}),[V,N]);(0,a.d4)((()=>{ne||H(0)}),[ne]),(0,f.y)(C&&G?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),O({targetIndexDelta:-1,orderedIds:G})},"Alt+ArrowDown":e=>{e.preventDefault(),O({targetIndexDelta:1,orderedIds:G})}}:void 0),(0,a.d4)((()=>{if(C&&!W&&G&&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||j.has(t))return;const n=Y&&I&&!I.isMinimized,a=n?-1:0,o=Number(t)+a-1;if(n&&-1===o)return void T?.(s.du.Archived);if(o>G.length-1)return;R({id:G[o],shouldReplaceHistory:!0})}}}),[I,W,C,T,R,O,G,Y]);const{observe:ae}=(0,P.S1)({rootRef:$,throttleMs:200}),oe=(0,Z.Z)((()=>{T(s.du.Archived),L()})),se=(0,Z.Z)((()=>{F.current?F.current=!1:oe()})),ie=(0,p.Z)((e=>{F.current?F.current=!1:R({id:e,shouldReplaceHistory:!0})}),[R],500,!0),re=(0,Z.Z)((e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,a=e.clientY-t.top;n<t.width||a<t.y||(F.current=!0)})),ce=function(e,t,n,o){const s=(0,a.sO)(null),i=(0,a.sO)(!1),r=(0,a.sO)(0),c=(0,a.sO)(!1),l=(0,a.sO)(!0),m=(0,a.sO)(0),g=(0,a.sO)(!1),f=(0,Z.Z)(((t=!1)=>{c.current||s.current&&e.current&&(s.current.style.display="block",e.current.scrollTop=1,d.s$||t||(0,h.n)(e.current),i.current=!0,r.current=1,c.current=!0,l.current=!0)})),v=(0,Z.Z)((()=>{c.current&&s.current&&(s.current.style.display="none",c.current=!1)})),P=(0,Z.Z)((()=>{if(!e.current)return;if(i.current)return void(i.current=!1);const a=e.current.scrollTop,o=a>r.current,d=a<r.current,h=0===a,p=Date.now()-m.current;if(s.current){if(h&&!c.current)return void(0,u.x4)(f,[e.current,s.current]);(0,u.x4)(v,s.current)}d&&(l.current&&p>100||a<0&&g.current)?t?.():o&&a>0&&n?.(),r.current=a,l.current=h,m.current=Date.now(),g.current=o&&a<0})),E=(0,p.Z)((a=>{if(!e.current)return;const o=e.current;o.scrollHeight>o.offsetHeight||0===a.deltaY||(a.deltaY<0?t?.():n?.())}),[e,t,n],250);return(0,a.d4)((()=>{const t=e.current;if(t)return 0===t.scrollTop&&(0,u.WM)((()=>{f(!0)})),t.addEventListener("scroll",P,{passive:!0}),t.addEventListener("wheel",E,{passive:!0}),()=>{t.removeEventListener("scroll",P),t.removeEventListener("wheel",E)}}),[e,E]),d.cj||o?void 0:a.ZP.createElement("div",{ref:s,className:"overscroll-trigger",key:"overscroll-trigger"})}($,(0,Z.Z)((()=>{B({isShown:!0,isArchived:z})})),(0,Z.Z)((()=>{B({isShown:!1,isArchived:z})})),W);return a.ZP.createElement(y.Z,{className:(0,r.Z)("chat-list custom-scroll",w&&"forum-panel-open",e),ref:$,items:ee,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:i.t_F,withAbsolutePositioning:!0,beforeChildren:ce,maxHeight:X+J+_,onLoadMore:te,onDragLeave:re},ne&&a.ZP.createElement(U,{key:"unconfirmed",sessions:N,onHeightChange:H}),Y&&a.ZP.createElement(x,{key:"archive",archiveSettings:I,onClick:oe,onDragEnter:se}),ee?.length?function(){const e=G.indexOf(ee[0]),t=(0,c.aE)(q)||0;return ee.map(((o,s)=>{const r=e+s<t,l=_+J+(e+s)*i.rSj;return a.ZP.createElement(A.Z,{key:o,teactOrderKey:r?s:(0,c.jK)(o,W),chatId:o,isPinned:r,folderId:n,isSavedDialog:W,animationType:Q(o),orderDiff:K[o],offsetTop:l,observeIntersection:ae,onDragEnter:ie})}))}():!ee||ee.length||W?a.ZP.createElement(b.Z,{key:"loading"}):a.ZP.createElement(D,{folderId:n,folderType:t,foldersDispatch:M,onSettingsScreenSelect:k}))}))},59690:(e,t,n)=>{n.d(t,{Z:()=>Y});var a=n(60748),o=n(33555),s=n(59187),i=n(83716),r=n(57710),c=n(41765),l=n(7054),d=n(46752),m=n(23989),u=n(64963),h=n(1279),p=n(97184),Z=n(42797),g=n(18674),f=n(46590),v=n(27407),P=n(3657),E=n(59107),y=n(25190),b=n(87204),C=n(61204),w=n(4794),S=n(98799),I=n(59188),N=n(231),M=n(21273),k=n(34288),T=n(74399),x=n(45601);const A={root:"Ky16H_sV","button-text":"W01t9CIf",buttonText:"W01t9CIf",sticker:"c8lE3XW5",title:"wlwD1B1Q",description:"V8OCFHmp","is-ios":"IxW_z_r0",isIos:"IxW_z_r0","is-macos":"OFxKGCEJ",isMacos:"OFxKGCEJ"},R=7*T.Gw,O=(0,a.X$)((0,o.c$)(((e,{chatId:t})=>{const n=(0,l.Z1J)(e,t),a=n&&(n.isCreator||(0,c.VE)(n,"manageTopics"));return{animatedEmoji:(0,l.zB_)(e,"🐣"),canManageTopics:a}}))((({chatId:e,animatedEmoji:t,canManageTopics:n})=>{const{openCreateTopicPanel:s}=(0,o.Sv)(),i=(0,E.Z)(),{isMobile:r}=(0,Z.ZP)(),c=(0,a.I4)((()=>{s({chatId:e})}),[e,s]);return a.ZP.createElement("div",{className:A.root},a.ZP.createElement("div",{className:A.sticker},t&&a.ZP.createElement(x.Z,{sticker:t,size:R})),a.ZP.createElement("h3",{className:A.title,dir:"auto"},i("ChatList.EmptyTopicsTitle")),a.ZP.createElement("p",{className:(0,d.Z)(A.description,A.centered),dir:"auto"},i("ChatList.EmptyTopicsDescription")),n&&a.ZP.createElement(N.Z,{ripple:!r,fluid:!0,onClick:c,size:"smaller",isRtl:i.isRtl},a.ZP.createElement("div",{className:A.buttonText},i("ChatList.EmptyTopicsCreate"))))})));var L=n(26646),B=n(15780),D=n(32340),$=n(60706),F=n(44499),U=n(60782),j=n(76844),_=n(2995),H=n(17551),z=n(31876),V=n(79347),W=n(77699);const q=(0,a.X$)((0,o.c$)(((e,{chatId:t,topic:n,isSelected:a})=>{const o=(0,l.Z1J)(e,t),s=(0,l.hjO)(e,t,n.lastMessageId),{senderId:i,isOutgoing:r}=s||{},d=s&&(0,L.H)(s)?.replyToMsgId,m=i?(0,l.dyD)(e,i)||(0,l.Z1J)(e,i):void 0,u=s?(0,c.N5)(s):void 0,h=u&&d?(0,l.hjO)(e,t,d):void 0,{targetUserIds:p,targetChatId:Z}=u||{},g=(0,l.WPz)(e,t,n.id,"typingStatus"),f=(0,l.Mst)(e,t,n.id),v=(0,l.tZg)(e,t,n.id),P=Boolean(v?.lastReadInboxMessageId),{chatId:E,threadId:y}=(0,l.Btg)(e)||{};return{chat:o,lastMessage:s,actionTargetUserIds:p,actionTargetChatId:Z,actionTargetMessage:h,lastMessageSender:m,typingStatus:g,canDelete:(0,l.nt7)(e,t,n.id),withInterfaceAnimations:(0,l.FOo)(e),draft:f,...r&&s&&{lastMessageOutgoingStatus:(0,l.dTW)(e,s)},canScrollDown:a&&o?.id===E&&y===n.id,wasTopicOpened:P}}))((({topic:e,isSelected:t,chatId:n,chat:s,style:i,lastMessage:r,canScrollDown:l,lastMessageOutgoingStatus:m,observeIntersection:u,canDelete:h,actionTargetMessage:Z,actionTargetUserIds:g,actionTargetChatId:f,lastMessageSender:v,animationType:P,withInterfaceAnimations:b,orderDiff:C,typingStatus:w,draft:S,wasTopicOpened:I})=>{const{openThread:N,deleteTopic:M,focusLastMessage:k,setViewForumAsMessages:T}=(0,o.Sv)(),x=(0,E.Z)(),[A,R,O]=(0,$.Z)(),[L,q,Y]=(0,$.Z)(),[G,X,J]=(0,$.Z)(),[K,Q,ee]=(0,$.Z)(),{isPinned:te,isClosed:ne}=e,ae=e.isMuted||void 0===e.isMuted&&s.isMuted,oe=(0,y.Z)((()=>{X(),R()})),se=(0,y.Z)((()=>{M({chatId:s.id,topicId:e.id})})),ie=(0,y.Z)((()=>{Q(),q()})),{renderSubtitle:re,ref:ce}=(0,F.Z)({chat:s,chatId:n,lastMessage:r,draft:S,actionTargetMessage:Z,actionTargetUserIds:g,actionTargetChatId:f,lastMessageSender:v,lastMessageTopic:e,observeIntersection:u,isTopic:!0,typingStatus:w,animationType:P,withInterfaceAnimations:b,orderDiff:C}),le=(0,y.Z)((()=>{N({chatId:n,threadId:e.id,shouldReplaceHistory:!0}),T({chatId:n,isEnabled:!1}),l&&k()})),de=function({topic:e,chat:t,wasOpened:n,canDelete:s,handleDelete:i,handleMute:r}){const l=(0,E.Z)();return(0,a.Ye)((()=>{const{isPinned:a,isMuted:d,isClosed:m,id:u}=e,h=t.id,{editTopic:Z,toggleTopicPinned:g,markTopicRead:f,updateTopicMutedState:v,openChatInNewTab:P}=(0,o.Sv)(),E=(0,c.GU)(t,e),y=t.isCreator||(0,c.VE)(t,"manageTopics"),b=p.IT&&{title:"Open in new tab",icon:"open-in-new-tab",handler:()=>{P({chatId:t.id,threadId:u})}},C=e.unreadCount||!n?{title:l("MarkAsRead"),icon:"readchats",handler:()=>{f({chatId:h,topicId:u})}}:void 0,w=y?a?{title:l("UnpinFromTop"),icon:"unpin",handler:()=>g({chatId:h,topicId:u,isPinned:!1})}:{title:l("PinToTop"),icon:"pin",handler:()=>g({chatId:h,topicId:u,isPinned:!0})}:void 0,S=t.isMuted&&!1!==d||!0===d?{title:l("ChatList.Unmute"),icon:"unmute",handler:()=>v({chatId:h,topicId:u,isMuted:!1})}:{title:`${l("ChatList.Mute")}...`,icon:"mute",handler:r},I=E?m?{title:l("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>Z({chatId:h,topicId:u,isClosed:!1})}:{title:l("lng_forum_topic_close"),icon:"close-topic",handler:()=>Z({chatId:h,topicId:u,isClosed:!0})}:void 0,N=s?{title:l("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:i}:void 0;return(0,U.oA)([b,w,C,S,I,N])}),[e,t,n,l,s,i,r])}({topic:e,chat:s,wasOpened:I,canDelete:h,handleDelete:oe,handleMute:ie});return a.ZP.createElement(z.Z,{className:(0,d.Z)("Fn34Vu_9","Chat",t&&"selected","chat-item-clickable"),onClick:le,style:i,href:p.IT?`#${(0,B.tB)(n,"thread",e.id)}`:void 0,contextActions:de,withPortalForMenu:!0,ref:ce},a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"info-row"},a.ZP.createElement("div",{className:(0,d.Z)("title")},a.ZP.createElement(_.Z,{topic:e,className:"oXJl4tra",observeIntersection:u}),a.ZP.createElement("h3",{dir:"auto",className:"fullName"},(0,D.Z)(e.title))),e.isMuted&&a.ZP.createElement("i",{className:"icon icon-muted"}),a.ZP.createElement("div",{className:"separator"}),ne&&a.ZP.createElement("i",{className:(0,d.Z)("icon","icon-lock-badge","MB7Gomjn")}),r&&a.ZP.createElement(j.Z,{message:r,outgoingStatus:m})),a.ZP.createElement("div",{className:"subtitle"},re(),a.ZP.createElement(W.Z,{chat:s,isPinned:te,isMuted:ae,topic:e,wasTopicOpened:I}))),G&&a.ZP.createElement(H.Z,{isOpen:A,onClose:O,onCloseAnimationEnd:J,confirmIsDestructive:!0,confirmHandler:se,text:x("lng_forum_topic_delete_sure"),confirmLabel:x("Delete")}),K&&a.ZP.createElement(V.Z,{isOpen:L,onClose:Y,onCloseAnimationEnd:ee,chatId:n,topicId:e.id}))}))),Y=(0,a.X$)((0,o.c$)((e=>{const t=(0,l.jUK)(e).forumPanelChatId,n=t?(0,l.Z1J)(e,t):void 0,{chatId:a,threadId:o}=(0,l.Btg)(e)||{};return{chat:n,currentTopicId:t===a?Number(o):void 0,withInterfaceAnimations:(0,l.FOo)(e)}}),(e=>(0,l.nd)(e)))((({chat:e,currentTopicId:t,isOpen:n,isHidden:l,onTopicSearch:T,onCloseAnimationEnd:x,onOpenAnimationStart:A,withInterfaceAnimations:R})=>{const{closeForumPanel:L,openChatWithInfo:B,loadTopics:D}=(0,o.Sv)(),$=(0,a.sO)(null),F=(0,a.sO)(null),U=(0,a.sO)(null),{isMobile:j}=(0,Z.ZP)();(0,a.d4)((()=>{e&&!e.topics&&D({chatId:e.id})}),[e,D]);const[_,H]=(0,a.eJ)(!1),z=(0,E.Z)(),V=(0,y.Z)((()=>{L()}));(0,a.d4)((()=>{R||n||x?.()}),[R,n,x]);const W=(0,y.Z)((()=>{e&&B({id:e.id,shouldReplaceHistory:!0})})),{observe:Y}=(0,P.S1)({rootRef:F,throttleMs:200});(0,P._N)(U,Y,(({isIntersecting:e})=>{H(!e)}));const G=(0,a.Ye)((()=>e?.topics?(0,c.AY)(Object.values(e.topics),e.orderedPinnedTopicIds).map((({id:e})=>e)):[]),[e]),{orderDiffById:X,getAnimationType:J}=(0,C.Z)(G,e?.id),[K,Q]=(0,v.Z)((()=>{e&&D({chatId:e.id})}),G,!e?.topicsCount||G.length>=e.topicsCount,i.C1M),ee=(0,a.sO)(!1),te=n&&!l,ne=(0,b.Z)(te);ne!==te&&(ee.current=!1),(0,f.Z)({isActive:te,onBack:V}),(0,a.d4)((()=>te?(0,m.Z)(V):void 0),[V,te]),(0,a.d4)((()=>{ne!==te&&(0,r.Yq)((()=>{if(!$.current)return;const e=(0,g.YW)();(0,h.L)($.current,e),A?.(),te?(ee.current=!0,$.current.style.transform="none"):(ee.current=!1,$.current.style.transform="")}))}),[te,A,ne]),(0,a.d4)((()=>{if(p.$b)return(0,u.sf)($.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(z.isRtl?u.eM.Left:u.eM.Right)&&(L(),!0)})}),[L,z.isRtl]);const ae=void 0===e?.topics;return a.ZP.createElement("div",{ref:$,className:(0,d.Z)("MlF2n1nb",_&&"SZ24u3cn",z.isRtl&&"Xs2y1fCE",!R&&"kmDMv6D8"),onTransitionEnd:n?void 0:x},a.ZP.createElement("div",{id:"TopicListHeader",className:"left-header"},a.ZP.createElement(N.Z,{round:!0,size:"smaller",color:"translucent",onClick:V,ariaLabel:z("Close")},a.ZP.createElement("i",{className:"icon icon-close"})),e&&a.ZP.createElement(S.Z,{noAvatar:!0,className:"Sf633zAP",chatId:e.id,onClick:W}),e&&a.ZP.createElement(I.Z,{chatId:e.id,threadId:s._f,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:j,onTopicSearch:T})),e&&a.ZP.createElement(w.Z,{chatId:e.id,hasPinnedOffset:!1,className:"wUpRjGJ2"}),a.ZP.createElement("div",{className:"hGeb3TQJ"}),a.ZP.createElement(M.Z,{className:"chat-list custom-scroll",ref:F,items:K,preloadBackwards:i.C1M,withAbsolutePositioning:!0,maxHeight:(G?.length||0)*i.oDu,onLoadMore:Q,sensitiveArea:i.BtI,beforeChildren:a.ZP.createElement("div",{ref:U,className:"ERz3fcar"})},Boolean(K?.length)&&function(){const n=G.indexOf(K[0]);return K?.map(((o,s)=>a.ZP.createElement(q,{key:o,chatId:e.id,topic:e.topics[o],style:`top: ${(n+s)*i.oDu}px;`,isSelected:t===o,observeIntersection:Y,animationType:J(o),orderDiff:X[o]})))}(),ae&&!K?.length&&a.ZP.createElement(k.Z,{key:"loading"})),!ae&&1===K?.length&&K[0]===i.OxA&&a.ZP.createElement(O,{chatId:e.id}))})))},9950:(e,t,n)=>{n.d(t,{b:()=>o,w:()=>s});var a=n(60748);let o=function(e){return e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None",e}({});function s(e){return(0,a.Ye)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,a=t.filter((e=>e>0)).length;return t=>{const s=e[t];return 0===s?o.None:s===1/0||s===-1/0||n<=a&&s<0||a<n&&s>0?o.Opacity:o.Move}}),[e])}},44499:(e,t,n)=>{n.d(t,{Z:()=>T});var a=n(60748),o=n(33555),s=n(83716),i=n(57710),r=n(41765),c=n(26646),l=n(46752),d=n(18005),m=n(32340),u=n(4809),h=n(9950),p=n(75790),Z=n(59107),g=n(6202),f=n(74399),v=n(42797),P=n(39415),E=n(2995);const y="CBda1UmC",b="BhS75ocD",C="uWo2dhui",w="g3XnC73g",S=Number(f.Gw),I=(0,a.X$)((({chat:e,renderLastMessage:t,observeIntersection:n})=>{const{openThread:s}=(0,o.Sv)(),i=(0,a.sO)(null),c=(0,a.sO)(null),d=(0,Z.Z)(),[u,...h]=(0,a.Ye)((()=>e.topics?(0,r.AY)(Object.values(e.topics),void 0,!0).slice(0,3):[]),[e.topics]),[p,g]=(0,a.eJ)(!1),[f,I]=(0,a.eJ)(void 0),{handleClick:N,handleMouseDown:M}=(0,P.m)((t=>{0===u.unreadCount||e.isForumAsMessages||(t.stopPropagation(),t.preventDefault(),s({chatId:e.id,threadId:u.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,v.W7)()}))}));return(0,a.d4)((()=>{const e=i.current,t=c.current;if(!e||!t)return;const n=e.offsetWidth,a=t.offsetWidth;Math.abs(n-a)<S?I(Math.max(n,a)):I(void 0),g(n>a)}),[u,t]),a.ZP.createElement("div",{className:(0,l.Z)("Ow6Ij9O5",p&&"U_yhhC0w",f&&"HV0wCR4O"),dir:d.isRtl?"rtl":void 0,style:f?`--overwritten-width: ${f}px`:void 0},u&&a.ZP.createElement("div",{className:y},a.ZP.createElement("div",{className:(0,l.Z)("lEbV6HrI",u.unreadCount&&b),ref:c,onClick:N,onMouseDown:M},a.ZP.createElement(E.Z,{topic:u,observeIntersection:n}),a.ZP.createElement("div",{className:"k3Ch25ZQ"},(0,m.Z)(u.title)),!f&&p&&a.ZP.createElement("div",{className:C},a.ZP.createElement("div",{className:w}))),a.ZP.createElement("div",{className:"IkuCBmvA"},h.map((e=>a.ZP.createElement("div",{className:(0,l.Z)("d0hTIVJn",e.unreadCount&&b),key:e.id},a.ZP.createElement(E.Z,{topic:e,className:"oknhG11L",observeIntersection:n}),a.ZP.createElement("span",{className:"ZUj3xAjs"},(0,m.Z)(e.title)))))),a.ZP.createElement("div",{className:"_m_2xcPW"})),!u&&a.ZP.createElement("div",{className:(0,l.Z)(y,"L4Zk0yMN")},d("Loading")),a.ZP.createElement("div",{className:(0,l.Z)("KJ16dBus",u?.unreadCount&&b),ref:i,onClick:N,onMouseDown:M},t(),!f&&!p&&a.ZP.createElement("div",{className:C},a.ZP.createElement("div",{className:w}))))}));var N=n(45370),M=n(68729);const k=200;function T({chat:e,lastMessage:t,chatId:n,typingStatus:f,draft:v,actionTargetMessage:P,actionTargetUserIds:E,lastMessageTopic:y,lastMessageSender:b,actionTargetChatId:C,observeIntersection:w,animationType:S,orderDiff:T,withInterfaceAnimations:x,isTopic:A,isSavedDialog:R,isPreview:O}){const L=(0,Z.Z)(),B=(0,a.sO)(null),D=t&&(0,r.FT)(t),$=t&&(0,c.H)(t)?.replyToMsgId;(0,p.Z)(n,D?$:void 0,P);const F=t&&!(0,r.bf)(t)?(0,r.DH)(t):void 0,U=(0,g.Z)(t?(0,r.Ti)(t,"micro"):void 0),j=Boolean(t&&(0,r.Y5)(t)),_=(0,a.Ye)((()=>{if(!E)return;const e=(0,o.Rd)().users.byId;return E.map((t=>e[t])).filter(Boolean)}),[E]),H=(0,a.I4)((()=>{if(!R&&!O&&f&&t&&f.timestamp>1e3*t.date)return a.ZP.createElement(M.Z,{typingStatus:f});const o=v&&v.replyInfo?.replyToMsgId===y?.id,s=v?.replyInfo&&!v.text&&v.isLocal;if(!e?.isForum&&!R&&!O&&v&&!s&&(!A||!o))return a.ZP.createElement("p",{className:"last-message",dir:L.isRtl?"auto":"ltr"},a.ZP.createElement("span",{className:"draft"},L("Draft")),(0,u.H)({text:v.text?.text||"",entities:v.text?.entities,isSimple:!0,withTranslucentThumbs:!0}));if(!t)return;if((0,r.DI)(t))return a.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:L.isRtl?"auto":"ltr"},(0,r.o_)(L,t));if(D){const n=e&&((0,r.eA)(e)||t.senderId===t.chatId);return a.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:L.isRtl?"auto":"ltr"},(0,d.D)(L,t,n?void 0:b,n?e:void 0,_,P,C,y,{isEmbedded:!0},void 0,void 0))}const i=(0,r.zF)(L,n,b);return a.ZP.createElement("p",{className:"last-message shared-canvas-container",dir:L.isRtl?"auto":"ltr"},i&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"sender-name"},(0,m.Z)(i)),a.ZP.createElement("span",{className:"colon"},":")),!R&&t.forwardInfo&&a.ZP.createElement("i",{className:"icon icon-share-filled chat-prefix-icon"}),"story"===t.replyInfo?.type&&a.ZP.createElement("i",{className:"icon icon-story-reply chat-prefix-icon"}),function(e,t,n,o,s){const i=a.ZP.createElement(N.Z,{lang:e,message:t,noEmoji:Boolean(o),observeIntersectionForLoading:n,inChatList:!0});if(!o)return i;const c=(0,r.NE)(t);return a.ZP.createElement("span",{className:"media-preview"},a.ZP.createElement("img",{src:o,alt:"",className:(0,l.Z)("media-preview--image",s&&"round",c&&"media-preview-spoiler"),draggable:!1}),(0,r.b7)(t)&&a.ZP.createElement("i",{className:"icon icon-play"}),i)}(L,t,w,U||F,j))}),[C,P,_,e,n,v,D,j,A,L,t,b,y,U,F,w,f,R,O]);return(0,a.bt)((()=>{const e=B.current;if(x&&e){if(S===h.b.Opacity)e.style.opacity="0",(0,i.WM)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(S!==h.b.Move)return;e.style.transform=`translate3d(0, ${-T*s.rSj}px, 0)`,(0,i.WM)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,i.WM)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),k+s.fK3)}}),[x,T,S]),{renderSubtitle:function(){return e?.isForum&&!A?a.ZP.createElement(I,{chat:e,renderLastMessage:H,observeIntersection:w}):H()},ref:B}}},73217:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(65326),s=n(87204);function i(e){const t=(0,o.Z)(),n=(0,a.sO)(e),i=(0,s.Z)(e);return!1===e&&i!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},61204:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(60782),s=n(9950),i=n(87204);function r(e,t){const n=(0,a.Ye)((()=>{if(e)return e.reduce(((e,t,n)=>(e[t]=n,e)),{})}),[e]),r=(0,i.Z)(n),c=(0,i.Z)(t),l=(0,a.Ye)((()=>n&&r&&t===c?(0,o.Q8)(n,((e,t)=>void 0!==r[t]?e-r[t]:-1/0)):{}),[t,n,c,r]);return{orderDiffById:l,getAnimationType:(0,s.w)(l)}}},91:(e,t,n)=>{n.d(t,{F:()=>o});var a=n(41765);function o(e,t,n,o){const{senderId:s}=t;if(!s)return;const i=(0,a.YC)(s)?o[s]:n[s];let r=(0,a.OU)(e,i);const c=n[t.chatId];return c&&("isSelf"in i&&i.isSelf?r=`${e("FromYou")} ${(0,a.U)(e,c)}`:(0,a.Bf)(c)&&(r+=` ${(0,a.U)(e,c)}`)),r}},64261:(e,t,n)=>{n.d(t,{Z:()=>Y});var a=n(60748),o=n(33555),s=n(41765),i=n(26646),r=n(7054),c=n(46752),l=n(18005),d=n(32340),m=n(30386),u=n(17240),h=n(75790),p=n(60706),Z=n(3657),g=n(59107),f=n(31212),v=n(45277),P=n(45601),E=n(59187),y=n(91713),b=n(40647),C=n(25190),w=n(6202),S=n(70172),I=n(17551),N=n(66735);const M=(0,a.X$)((({message:e,renderContent:t})=>{const{openMediaViewer:n,uploadProfilePhoto:i,showNotification:r}=(0,o.Sv)(),{isOutgoing:c}=e,l=(0,g.Z)(),[d,m]=(0,a.eJ)(),[u,h,Z]=(0,p.Z)(!1),f=(0,w.Z)((0,s.Ti)(e,"full")),v=e.content.action.photo?.isVideo,P=(0,C.Z)((()=>{r({title:l("ApplyAvatarHintTitle"),message:l("ApplyAvatarHint"),action:{action:"requestNextSettingsScreen",payload:{screen:y.MT.Main}},actionText:l("Open")})})),M=(0,C.Z)((e=>{m(void 0),i({file:e}),P()})),k=(0,C.Z)((()=>{m(void 0)})),T=(0,C.Z)((async()=>{Z(),P();const t=e.content.action.photo,n=await b.he(`videoAvatar${t.id}?size=u`,E.IU.BlobUrl),a=await fetch(n).then((e=>e.blob()));i({file:new File([a],"avatar.mp4"),isVideo:!0,videoTs:t.videoSizes?.find((e=>void 0!==e.videoStartTs))?.videoStartTs})}));return a.ZP.createElement("span",{className:"action-message-suggested-avatar",tabIndex:0,role:"button",onClick:async()=>{!c&&f?v?h():m(await fetch(f).then((e=>e.blob()))):n({chatId:e.chatId,mediaId:e.id,threadId:E._f,origin:y.bZ.SuggestedAvatar})}},a.ZP.createElement(S.Z,{photo:e.content.action.photo,loopIndefinitely:!0,withVideo:v,size:"jumbo"}),a.ZP.createElement("span",null,t()),a.ZP.createElement("span",{className:"action-message-button"},l(v?"ViewVideoAction":"ViewPhotoAction")),a.ZP.createElement(N.Z,{file:d,onClose:k,onChange:M}),a.ZP.createElement(I.Z,{isOpen:u,title:l("SuggestedVideo"),confirmHandler:T,onClose:Z,textParts:t()}))}));var k=n(97182),T=n(2155),x=n(49488),A=n(75851);var R=n(78781),O=n(65979),L=n(231),B=n(74607);const D="d8axZxyN",$="glDpC2av",F="gqCs9fSo",U="gnYhwnvf",j="HWgwnKui",_="BTNQ4KBH",H="Xl9MVMTn",z="Qizai7yv";function V({channel:e}){const{openChat:t}=(0,o.Sv)(),n=function(e,t="#00000000"){const[n,o]=(0,a.eJ)(t),i=(0,w.Z)((0,s.RT)(e),!1,E.IU.BlobUrl);return(0,a.d4)((()=>{(async()=>{if(!i)return;const e=await(0,A.ix)(i);o(`#${(0,A.CO)(e)}`)})()}),[i]),n}(e,"#3C3C4399");return a.ZP.createElement("div",{className:$,onClick:()=>t({id:e.id})},a.ZP.createElement(S.Z,{className:F,key:e.id,size:"large",peer:e}),a.ZP.createElement("div",{style:`background: ${n}`,className:U},a.ZP.createElement("i",{className:(0,c.Z)(D,"icon icon-user-filled")}),a.ZP.createElement("span",{className:j},(0,T.bi)(e?.membersCount||0))),a.ZP.createElement("span",{className:_},e.title))}function W({channel:e,chatId:t,channelsCount:n,isCurrentUserPremium:s}){const{openPremiumModal:i,openChatWithInfo:r}=(0,o.Sv)(),l=(0,g.Z)();return a.ZP.createElement("div",{className:(0,c.Z)($,"MBChXyXk"),onClick:()=>{s?r({id:t,shouldReplaceHistory:!0,profileTab:"similarChannels",forceScrollProfileTab:!0}):i()}},a.ZP.createElement(S.Z,{className:F,key:e.id,size:"large",peer:e}),a.ZP.createElement("div",{className:H},a.ZP.createElement("div",{className:z})),a.ZP.createElement("div",{className:(0,c.Z)(H,"JxSmtOFi")},a.ZP.createElement("div",{className:z})),a.ZP.createElement("div",{className:U},a.ZP.createElement("span",{className:j},`+${n}`),!s&&a.ZP.createElement(O.Z,{name:"lock-badge",className:D})),a.ZP.createElement("span",{className:_},l("MoreSimilar")))}const q=(0,a.X$)((0,o.c$)(((e,{chatId:t})=>{const{similarChannelIds:n,shouldShowInChat:a,count:o}=(0,r.D2x)(e,t)||{};return{similarChannelIds:n,shouldShowInChat:a,count:o,isCurrentUserPremium:(0,r.wVz)(e)}}))((({chatId:e,similarChannelIds:t,shouldShowInChat:n,count:s,isCurrentUserPremium:i})=>{const l=(0,g.Z)(),{toggleChannelRecommendations:d}=(0,o.Sv)(),[m,u,h]=(0,p.Z)(!1),[Z,f,v]=(0,p.Z)(!1),P=(0,a.sO)(null),E=(0,a.Ye)((()=>{if(!t)return;const e=(0,o.Rd)();return t.map((t=>(0,r.Z1J)(e,t))).filter(Boolean)}),[t]),[y,b]=(0,a.eJ)(!t),w=(0,a.Ye)((()=>E?.slice(0,10)),[E]),S=Boolean(w?.length);(0,R.Z)(P,!S||!n||y,!0);const I=Boolean(!y&&(n||Z||m)&&S);(0,x.Z)((()=>b(!1)),2e3),(0,a.d4)((()=>{if(y&&E&&n){const e=setTimeout((()=>{b(!1)}),300);return()=>clearTimeout(e)}}),[E,n,y]);const N=(0,C.Z)((()=>{d({chatId:e}),n?(h(),f()):(u(),v())}));return a.ZP.createElement("div",{className:(0,c.Z)("V3RHiOJR")},a.ZP.createElement("div",{className:"join-text"},a.ZP.createElement("span",{className:(0,c.Z)(S&&"UHAMd4fI"),onClick:S?N:void 0},l("ChannelJoined"))),y&&a.ZP.createElement(B.Z,{className:"xKVZv7KE"}),I&&a.ZP.createElement("div",{className:(0,c.Z)(m&&"eb8rX09E",Z&&"XR6_qLCc")},a.ZP.createElement("div",{className:"tfG_BSDt"},a.ZP.createElement("svg",{width:"19",height:"7",viewBox:"0 0 19 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.ZP.createElement("path",{className:"HVbeGv4t","fill-rule":"evenodd","clip-rule":"evenodd",d:"M19 7C16.8992 7 13.59 3.88897 11.5003 1.67424C10.7648 0.894688 10.397 0.50491 10.0434 0.385149C9.70568 0.270811 9.4225 0.270474 9.08456 0.38401C8.73059 0.50293 8.36133 0.892443 7.62279 1.67147C5.52303 3.88637 2.18302 7 0 7L19 7Z",fill:"white"}))),a.ZP.createElement("div",{className:"njAC8dR9"},a.ZP.createElement("div",{className:"s7QOi22Q"},a.ZP.createElement("span",{className:"JstcOhAN"},l("SimilarChannels")),a.ZP.createElement(L.Z,{className:"meewH7t_",color:"translucent",onClick:N},a.ZP.createElement(O.Z,{name:"close"}))),a.ZP.createElement("div",{ref:P,className:(0,c.Z)("h4gWlNen","no-scrollbar")},w?.map(((t,n)=>9===n?a.ZP.createElement(W,{channel:t,chatId:e,channelsCount:s-10+1,isCurrentUserPremium:i}):a.ZP.createElement(V,{channel:t})))))))}))),Y=(0,a.X$)((0,o.c$)(((e,{message:t,threadId:n})=>{const{chatId:a,senderId:o,content:s}=t,{targetUserIds:c,targetChatId:l}=s.action||{},d=(0,i.H)(t)?.replyToMsgId,m=d?(0,r.hjO)(e,a,d):void 0,u=!!n&&(0,r._XY)(e,t,n),{direction:h,noHighlight:p}=u&&(0,r.jUK)(e).focusedMessage||{},Z=(0,r.dyD)(e,o||a),g=(0,r.Z1J)(e,a),f=l?(0,r.Z1J)(e,l):void 0,v=s.action?.months;return{senderUser:Z,senderChat:g,targetChat:f,targetChatId:l,targetUserIds:c,targetMessage:m,isFocused:u,premiumGiftSticker:(0,r.PGA)(e,v),topic:(0,r.p$s)(e,t),canPlayAnimatedEmojis:(0,r.W9H)(e),...u&&{focusDirection:h,noFocusHighlight:p}}}))((({message:e,isEmbedded:t,appearanceOrder:n=0,isJustAdded:i,isLastInList:r,senderUser:E,senderChat:y,targetUserIds:b,targetMessage:C,targetChatId:w,targetChat:S,isFocused:I,focusDirection:N,noFocusHighlight:T,premiumGiftSticker:x,isInsideTopic:A,topic:R,memoFirstUnreadIdRef:O,canPlayAnimatedEmojis:L,observeIntersectionForReading:B,observeIntersectionForLoading:D,observeIntersectionForPlaying:$,onPinnedIntersectionChange:F})=>{const{openPremiumModal:U,requestConfetti:j,checkGiftCode:_}=(0,o.Sv)(),H=(0,g.Z)(),z=(0,a.sO)(null);(0,Z._N)(z,B),(0,h.Z)(e.chatId,"message"===e.replyInfo?.type?e.replyInfo.replyToMsgId:void 0,C),(0,v.Z)(z,e.chatId,I,N,T,i),(0,a.d4)((()=>{if(e.isPinned)return()=>{F?.({viewportPinnedIdsToRemove:[e.id],isUnmount:!0})}}),[F,e.isPinned,e.id]);const V=n<=0,[W,Y]=(0,p.Z)(V),G=Boolean(e.content.action?.text.startsWith("ActionGift")),X=Boolean(e.content.action?.text.startsWith("BoostingReceivedGift")),J="suggestProfilePhoto"===e.content.action?.type&&e.content.action.photo,K=(0,s.Pt)(e);(0,a.d4)((()=>{V||setTimeout(Y,10*n)}),[n,Y,V]);const Q=(0,Z.Op)(z,$),ee=(0,a.sO)((()=>{const t=O?.current&&e.id>=O.current;return G&&!e.isOutgoing&&t})());(0,a.d4)((()=>{Q&&ee.current&&(ee.current=!1,j({}))}),[Q,j]);const{transitionClassNames:te}=(0,f.Z)(W,void 0,V,!1),ne=(0,o.Rd)().users.byId,ae=(0,a.Ye)((()=>b?b.map((e=>ne?.[e])).filter(Boolean):void 0),[b,ne]),oe=(0,a.I4)((()=>(0,l.D)(H,e,E,y,ae,C,w,R,{isEmbedded:t},D,$)),[t,H,e,D,$,y,E,w,C,ae,R]),{isContextMenuOpen:se,contextMenuPosition:ie,handleBeforeContextMenu:re,handleContextMenu:ce,handleContextMenuClose:le,handleContextMenuHide:de}=(0,u.Z)(z),me=void 0!==ie,ue=()=>{const t=e.content.action?.slug;t&&_({slug:t,message:{chatId:e.chatId,messageId:e.id}})};if(A&&"TopicWasCreatedAction"===e.content.action?.text)return a.ZP.createElement("span",{ref:z});if(t)return a.ZP.createElement("span",{ref:z,className:"embedded-action-message"},oe());const he=(0,c.Z)("ActionMessage message-list-item",I&&!T&&"focused",(G||J)&&"centered-action",me&&"has-menu-open",r&&"last-in-list",te);return a.ZP.createElement("div",{ref:z,id:(0,s.d0)(e.id),className:he,"data-message-id":e.id,"data-is-pinned":e.isPinned||void 0,onMouseDown:e=>{(0,m.q)(e),re(e)},onContextMenu:ce},!J&&!X&&!K&&a.ZP.createElement("span",{className:"action-message-content"},oe()),G&&a.ZP.createElement("span",{className:"action-message-gift",tabIndex:0,role:"button",onClick:()=>{U({isGift:!0,fromUserId:E?.id,toUserId:b?.[0],monthsAmount:e.content.action?.months||0})}},a.ZP.createElement(P.Z,{key:e.id,sticker:x,play:L,noLoop:!0,nonInteractive:!0}),a.ZP.createElement("strong",null,H("ActionGiftPremiumTitle")),a.ZP.createElement("span",null,H("ActionGiftPremiumSubtitle",H("Months",e.content.action?.months,"i"))),a.ZP.createElement("span",{className:"action-message-button"},H("ActionGiftPremiumView"))),X&&function(){const t=e.content.action?.isGiveaway,n=e.content.action?.isUnclaimed;return a.ZP.createElement("span",{className:"action-message-gift action-message-gift-code",tabIndex:0,role:"button",onClick:ue},a.ZP.createElement(P.Z,{key:e.id,sticker:x,play:L,noLoop:!0,nonInteractive:!0}),a.ZP.createElement("strong",null,H(n?"BoostingUnclaimedPrize":"BoostingCongratulations")),a.ZP.createElement("span",{className:"action-message-subtitle"},S&&(0,d.Z)(H(t?"BoostingReceivedGiftFrom":n?"BoostingReceivedPrizeFrom":"BoostingYouHaveUnclaimedPrize",(0,s.U)(H,S)),["simple_markdown"])),a.ZP.createElement("span",{className:"action-message-subtitle"},(0,d.Z)(H("BoostingUnclaimedPrizeDuration",H("Months",e.content.action?.months,"i")),["simple_markdown"])),a.ZP.createElement("span",{className:"action-message-button"},H("BoostingReceivedGiftOpenBtn")))}(),J&&a.ZP.createElement(M,{message:e,renderContent:oe}),K&&a.ZP.createElement(q,{chatId:w}),ie&&a.ZP.createElement(k.Z,{isOpen:se,anchor:ie,message:e,messageListType:"thread",onClose:le,onCloseAnimationEnd:de}))})))},59188:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(60748),o=n(33555),s=n(59187),i=n(91713),r=n(57710),c=n(41765),l=n(7054),d=n(97184),m=n(73541),u=n(59107),h=n(25190),p=n(231),Z=n(53106),g=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?a.ZP.createElement(n,e):void 0},y=(0,a.X$)((0,o.c$)(((e,{chatId:t,threadId:n,messageListType:a,isMobile:o})=>{const i=(0,l.Z1J)(e,t),r=Boolean(i&&(0,c.eA)(i)),m=Boolean(i&&(0,c.ZV)(i)),u=(0,l.rB0)(e),h=(0,l.Mc4)(e),p=(0,c.YC)(t),{doNotTranslate:Z}=e.settings.byKey;if(!i||i.isRestricted||(0,l.CAb)(e))return{noMenu:!0,language:u,translationLanguage:h,doNotTranslate:Z};const g=(0,l.kBx)(e,t),f=p?void 0:(0,l.x67)(e,t),v=p?(0,l.ccz)(e,t):void 0,P=f||v,E=(0,l.FM1)(e,t),y="thread"===a&&n===s._f,b="thread"===a&&n!==s._f,C=(0,l.Jf5)(e,o),w=(0,c._o)(t,n,e.currentUserId),S=!!p&&(0,l.s4q)(e,t),I=Boolean(g&&S),N=!I&&Boolean((0,l.pkN)(e,t)),M=S&&!g,k=Boolean((y||i.isForum)&&(r||m)&&i.isNotJoined),T=y||b,x=d.Bi&&(0,c.YC)(i.id)&&!E&&!g&&!i.isSupport&&!(0,c.wo)(i.id),A=y&&!E&&!k,R=w||y&&!k,O=d.Bi&&y&&i.isCallActive,L=d.Bi&&y&&!i.isCallActive&&(i.adminRights?.manageCall||i.isCreator&&(0,c.G9)(i)),B=y&&f?.canViewStatistics,D=y&&(m||r)&&(B||(0,c.VE)(i,"postStories")),$=!D&&(m||r),F=y?f?.requestsPending:void 0,U=Boolean(i?.isNotJoined&&i.isJoinToSend),j=Boolean(i?.isNotJoined&&i.isJoinRequest),_=!(0,l.FOo)(e),H=Boolean((0,l.lpX)(e,t));return{noMenu:!1,isChannel:r,isRightColumnShown:C,canStartBot:N,canRestartBot:I,canSubscribe:k,canSearch:T,canCall:x,canMute:A,canViewStatistics:B,canViewBoosts:D,canShowBoostModal:$,canLeave:R,canEnterVoiceChat:O,canCreateVoiceChat:L,pendingJoinRequests:F,shouldJoinToSend:U,shouldSendJoinRequest:j,noAnimation:_,canTranslate:(0,l.GDM)(e,t)&&!P?.isTranslationDisabled,isTranslating:H,translationLanguage:h,language:u,doNotTranslate:Z,detectedChatLanguage:i.detectedLanguage,canUnblock:M}}))((({chatId:e,threadId:t,noMenu:n,isMobile:s,isChannel:c,canStartBot:l,canRestartBot:v,canUnblock:P,canSubscribe:y,canSearch:C,canCall:w,canMute:S,canViewStatistics:I,canViewBoosts:N,canShowBoostModal:M,canLeave:k,canEnterVoiceChat:T,canCreateVoiceChat:x,pendingJoinRequests:A,isRightColumnShown:R,isForForum:O,canExpandActions:L,shouldJoinToSend:B,shouldSendJoinRequest:D,noAnimation:$,canTranslate:F,isTranslating:U,translationLanguage:j,language:_,detectedChatLanguage:H,doNotTranslate:z,onTopicSearch:V})=>{const{joinChannel:W,sendBotCommand:q,openLocalTextSearch:Y,restartBot:G,requestMasterAndRequestCall:X,requestNextManagementScreen:J,showNotification:K,openChat:Q,requestChatTranslation:ee,togglePeerTranslations:te,openChatLanguageModal:ne,setSettingOption:ae,unblockUser:oe,setViewForumAsMessages:se}=(0,o.Sv)(),ie=(0,a.sO)(null),re=(0,u.Z)(),[ce,le]=(0,a.eJ)(!1),[de,me]=(0,a.eJ)(void 0),ue=(0,h.Z)((()=>{le(!0);const e=ie.current.getBoundingClientRect();me({x:e.right,y:e.bottom})})),he=(0,h.Z)((()=>{le(!1)})),pe=(0,h.Z)((()=>{me(void 0)})),Ze=(0,h.Z)((()=>{W({chatId:e}),D&&K({message:re(c?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})})),ge=(0,h.Z)((()=>{q({command:"/start"})})),fe=(0,h.Z)((()=>{G({chatId:e})})),ve=(0,h.Z)((()=>{oe({userId:e})})),Pe=(0,h.Z)((()=>{ee(U?{chatId:e,toLanguageCode:void 0}:{chatId:e,toLanguageCode:j})})),Ee=(0,h.Z)((()=>{J({screen:i.u1.JoinRequests})})),ye=(0,h.Z)((()=>{O?V?.():(Y(),s?document.querySelector("#MobileSearch input").focus():$?(0,r.i$)((()=>{(0,r.Yq)(b)})):setTimeout(b,320))})),be=(0,h.Z)((()=>{Q({id:e}),se({chatId:e,isEnabled:!0})})),Ce=(0,h.Z)((()=>{X({userId:e})})),we=(0,h.Z)((e=>{C&&d.RM&&!e.shiftKey&&(e.preventDefault(),ye())})),Se=(0,h.Z)(((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,a=re(n);if(a!==n)return re(e,a);const o=new Intl.DisplayNames([_],{type:"language"}).of(t);return re(`${e}Other`,o)})),Ie=(0,a.Ye)((()=>U?re("ShowOriginalButton"):Se("TranslateToButton",j)),[j,Se,U,re]),Ne=(0,a.Ye)((()=>{if(H)return Se("DoNotTranslateLanguage",H)}),[Se,H]),Me=(0,h.Z)((()=>{te({chatId:e,isEnabled:!1}),ee({chatId:e,toLanguageCode:void 0})})),ke=(0,h.Z)((()=>{ne({chatId:e})})),Te=(0,h.Z)((()=>{H&&(ae({doNotTranslate:[...z,H]}),ee({chatId:e,toLanguageCode:void 0}),K({message:Se("AddedToDoNotTranslate",H)}))}));(0,m.y)({"Mod+F":we});const xe=(0,a.Ye)((()=>({onTrigger:e,isOpen:t})=>a.ZP.createElement(p.Z,{round:!0,ripple:R,color:"translucent",size:"smaller",className:t?"active":"",onClick:e,ariaLabel:re("TranslateMessage")},a.ZP.createElement("i",{className:"icon icon-language","aria-hidden":!0}))),[R,re]);return a.ZP.createElement("div",{className:"HeaderActions"},!O&&F&&a.ZP.createElement(Z.Z,{className:"stickers-more-menu with-menu-transitions",trigger:xe,positionX:"right"},a.ZP.createElement(g.Z,{icon:"language",onClick:Pe},Ie),a.ZP.createElement(g.Z,{icon:"replace",onClick:ke},re("Chat.Translate.Menu.To")),a.ZP.createElement(f.Z,null),H&&a.ZP.createElement(g.Z,{icon:"hand-stop",onClick:Te},Ne),a.ZP.createElement(g.Z,{icon:"close-circle",onClick:Me},re("Hide"))),!s&&a.ZP.createElement(a.ZP.Fragment,null,L&&!D&&(y||B)&&a.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:Ze},re(c?"ProfileJoinChannel":"ProfileJoinGroup")),L&&D&&a.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:Ze},re("ChannelJoinRequest")),L&&l&&a.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:ge},re("BotStart")),L&&v&&a.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:fe},re("BotRestart")),L&&P&&a.ZP.createElement(p.Z,{size:"tiny",ripple:!0,fluid:!0,onClick:ve},re("Unblock")),C&&a.ZP.createElement(p.Z,{round:!0,ripple:R,color:"translucent",size:"smaller",onClick:ye,ariaLabel:re("Conversation.SearchPlaceholder")},a.ZP.createElement("i",{className:"icon icon-search","aria-hidden":!0})),w&&a.ZP.createElement(p.Z,{round:!0,color:"translucent",size:"smaller",onClick:Ce,ariaLabel:"Call"},a.ZP.createElement("i",{className:"icon icon-phone","aria-hidden":!0}))),!O&&Boolean(A)&&a.ZP.createElement(p.Z,{round:!0,className:"badge-button",ripple:R,color:"translucent",size:"smaller",onClick:Ee,ariaLabel:re(c?"SubscribeRequests":"MemberRequests")},a.ZP.createElement("i",{className:"icon icon-user","aria-hidden":!0}),a.ZP.createElement("div",{className:"badge"},A)),a.ZP.createElement(p.Z,{ref:ie,className:ce?"active":"",round:!0,ripple:!s,size:"smaller",color:"translucent",disabled:n,ariaLabel:"More actions",onClick:ue},a.ZP.createElement("i",{className:"icon icon-more","aria-hidden":!0})),de&&a.ZP.createElement(E,{chatId:e,threadId:t,isOpen:ce,anchor:de,withExtraActions:s||!L,isChannel:c,canStartBot:l,canSubscribe:y,canSearch:C,canCall:w,canMute:S,canViewStatistics:I,canViewBoosts:N,canShowBoostModal:M,canLeave:k,canEnterVoiceChat:T,canCreateVoiceChat:x,pendingJoinRequests:A,onJoinRequestsClick:Ee,withForumActions:O,onSubscribeChannel:Ze,onSearchClick:ye,onAsMessagesClick:be,onClose:he,onCloseAnimationEnd:pe}))})));function b(){const e=document.querySelector(".RightHeader .SearchInput input");e?.focus()}},43159:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(60748),o=n(33555),s=n(60706),i=n(59107),r=n(25190),c=n(52328),l=n(58964),d=n(59187),m=n(41765),u=n(46752),h=n(42797),p=n(6202);const Z="VGmPJoga",g=/#fff/gi,f=(0,a.X$)((({icon:e,theme:t})=>{const{isTouchScreen:n}=(0,h.ZP)(),o=(0,p.Z)((0,m.ym)(e),!1,d.IU.Text),s=(0,a.Ye)((()=>{if(!o)return"";const e="dark"===t?"rgb(170, 170, 170)":"rgb(112, 117, 121)",n=o.replace(g,e),a=(new DOMParser).parseFromString(n,"image/svg+xml");return a.querySelectorAll("path").forEach((t=>{t.style.stroke=e,t.style.strokeWidth="0.5px"})),`data:image/svg+xml;utf8,${a.documentElement.outerHTML}`}),[o,t]);return a.ZP.createElement("i",{className:(0,u.Z)("mklnEg0s","icon",!n&&Z)},a.ZP.createElement("img",{src:s,alt:"",className:(0,u.Z)("tT8KQwg0",!n&&Z),draggable:!1}))})),v=(0,a.X$)((({bot:e,theme:t,chatId:n,threadId:d,isInSideMenu:m,canShowNew:u,onMenuOpened:h,onMenuClosed:p})=>{const{callAttachBot:Z,toggleAttachBot:g}=(0,o.Sv)(),v=(0,i.Z)(),P=(0,a.Ye)((()=>e.icons.find((({name:e})=>"default_static"===e))?.document),[e.icons]),[E,y,b]=(0,s.Z)(),[C,w]=(0,a.eJ)(void 0),S=(0,r.Z)((e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();w({x:t.right,y:t.bottom}),h(),y()})),I=(0,r.Z)((()=>{Z(m?{bot:e,isFromSideMenu:!0}:{bot:e,chatId:n,threadId:d})})),N=(0,r.Z)((()=>{b(),p()})),M=(0,r.Z)((()=>{w(void 0)})),k=(0,r.Z)((()=>{g({botId:e.id,isEnabled:!1})}));return a.ZP.createElement(l.Z,{key:e.id,customIcon:P&&a.ZP.createElement(f,{icon:P,theme:t}),icon:P?void 0:"bots",onClick:I,onContextMenu:S},e.shortName,u&&e.isDisclaimerNeeded&&a.ZP.createElement("span",{className:"menu-item-badge"},v("New")),C&&a.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},a.ZP.createElement(l.Z,{icon:"stop",destructive:!0,onClick:k},v("WebApp.RemoveBot"))))}))},93219:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(99203),s=n(48778);const i=e=>{const{isOpen:t}=e,n=(0,s.Z)(o.gl.Extra,"CustomEmojiTooltip",!t);return n?a.ZP.createElement(n,e):void 0}},67146:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(99203),s=n(48778);const i=e=>{const{isOpen:t}=e,n=(0,s.Z)(o.gl.Extra,"CustomSendMenu",!t);return n?a.ZP.createElement(n,e):void 0}},12420:(e,t,n)=>{n.d(t,{t:()=>f,Z:()=>v});var a=n(60748),o=n(33555),s=n(41765),i=n(46752),r=n(23989),c=n(76087),l=n(21262),d=n(59107),m=n(25190),u=n(87204),h=n(31212),p=n(62898),Z=n(60706);const g=(0,a.X$)((({isQuick:e,isGeneric:t,onFileSelect:n})=>{const[o,s,r]=(0,Z.Z)(),c=(0,i.Z)("DropTarget",o&&"hovered");return a.ZP.createElement("div",{className:c,onDrop:n,onDragEnter:s,onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),r()},"data-dropzone":!0},a.ZP.createElement("div",{className:"target-content"},a.ZP.createElement("div",{className:"icon icon-"+(e?"photo":"document")}),a.ZP.createElement("div",{className:"title"},"Drop files here to send them"),!t&&a.ZP.createElement("div",{className:"description"},e?"in a quick way":"without compression")))}));let f=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const v=(0,a.X$)((({isOpen:e,withQuick:t,onHide:n,onFileSelect:Z,editingMessage:f})=>{const v=(0,d.Z)(),{showNotification:P}=(0,o.Sv)(),E=(0,a.sO)(null),y=(0,u.Z)(t),{shouldRender:b,transitionClassNames:C}=(0,h.Z)(e),w=f&&f?.groupedId;(0,a.d4)((()=>e?(0,r.Z)(n):void 0),[e,n]);const S=(0,m.Z)((async e=>{const{dataTransfer:a}=e;let o=[];if(!(a.files&&a.files.length>0)||a.items&&a.items.length){if(a.items&&a.items.length>0){const e=await(0,l.Z)(a.items),t=e&&await(0,c.Z)(e[0].name,e[0]),n=f&&t&&(0,s.Gy)(f,t),i=t&&(0,s.kT)(t);if(n||i)return void P({message:v(w?"lng_edit_media_album_error":"lng_edit_media_invalid_file")});e?.length&&(o=o.concat(e))}}else o=o.concat(Array.from(a.files));n(),Z(o,!t&&void 0)})),I=(0,m.Z)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(n(),Z(Array.from(t.files),!0))})),N=(0,m.Z)((e=>{e.stopPropagation();const{target:t,relatedTarget:a}=e;!t.matches(".DropTarget, .DropArea")||a&&a.matches(".DropTarget, .DropArea")||(E.current=window.setTimeout((()=>{n()}),150))}));if(!b)return;const M=t||y,k=(0,i.Z)("DropArea",C);return a.ZP.createElement(p.Z,{containerId:"#middle-column-portals"},a.ZP.createElement("div",{className:k,onDragLeave:N,onDragOver:()=>{E.current&&window.clearTimeout(E.current)},onDrop:n,onClick:n},a.ZP.createElement(g,{onFileSelect:S,isGeneric:!M}),M&&a.ZP.createElement(g,{onFileSelect:I,isQuick:!0})))}))},19830:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(99203),s=n(48778);const i=e=>{const{isOpen:t}=e,n=(0,s.Z)(o.gl.Extra,"EmojiTooltip",!t);return n?a.ZP.createElement(n,e):void 0}},76609:(e,t,n)=>{n.d(t,{Z:()=>W});var a=n(60748),o=n(33555),s=n(83716),i=n(57710),r=n(7054),c=n(46752),l=n(517),d=n(98069),m=n(9668),u=n(65723),h=n(69118),p=n(97184),Z=n(32340),g=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){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?a:String(a))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,i.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,i.i$)((()=>{if(!this.video)return;const a=this.video,{width:o,height:s}=this.container.getBoundingClientRect();(0,i.WM)((()=>{a.style.left=`${Math.round(t*o)}px`,a.style.top=`${Math.round(n*s)}px`,a.style.width=`${e}px`,a.style.height=`${e}px`}))}))}}var N=n(82850),M=n(28712),k=n(27370),T=n(74399),x=n(22268),A=n(92085),R=n(274),O=n(78722),L=n(3927),B=n(13819),D=n(38146);const $=1.25*T.Gw;var F=n(4292),U=n(99203),j=n(48778);const _=e=>{const{isOpen:t}=e,n=(0,j.Z)(U.gl.Extra,"TextFormatter",!t);return n?a.ZP.createElement(n,e):void 0},H="input-scroller",z=140,V=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],W=(0,a.X$)((0,o.c$)(((e,{chatId:t,threadId:n})=>{const{messageSendKeyCombo:a}=e.settings.byKey;return{messageSendKeyCombo:a,replyInfo:t&&n?(0,r.Mst)(e,t,n)?.replyInfo:void 0,isSelectModeActive:(0,r.CAb)(e),canPlayAnimatedEmojis:(0,r.W9H)(e)}}))((({ref:e,id:t,chatId:n,captionLimit:w,isAttachmentModalInput:S,isStoryInput:T,customEmojiPrefix:U,editableInputId:j,isReady:W,isActive:q,getHtml:Y,placeholder:G,timedPlaceholderLangKey:X,timedPlaceholderDate:J,forcedPlaceholder:K,canSendPlainText:Q,canAutoFocus:ee,noFocusInterception:te,shouldSuppressFocus:ne,shouldSuppressTextFormatter:ae,replyInfo:oe,isSelectModeActive:se,canPlayAnimatedEmojis:ie,messageSendKeyCombo:re,onUpdate:ce,onSuppressedFocus:le,onSend:de,onScroll:me,onFocus:ue,onBlur:he})=>{const{editLastMessage:pe,replyToNextMessage:Ze,showAllowedMessageTypesNotification:ge}=(0,o.Sv)();let fe=(0,a.sO)(null);e&&(fe=e);const ve=(0,a.sO)(null),Pe=(0,a.sO)(null),Ee=(0,a.sO)(null),ye=(0,a.sO)(null),be=(0,a.sO)(null),Ce=(0,a.sO)(null),we=(0,y.Z)(),Se=(0,a.sO)(!1),[Ie,Ne,Me]=(0,P.Z)(),[ke,Te]=(0,a.eJ)(),[xe,Ae]=(0,a.eJ)(),[Re,Oe]=(0,a.eJ)(!1),{isMobile:Le}=(0,f.ZP)(),Be=Le&&(p.cj||p.wZ),[De,$e]=(0,a.eJ)(!1);(0,a.d4)((()=>{$e(Boolean(X&&J))}),[J,X]);const Fe=(0,b.Z)((()=>{$e(!1)}));!function(e,t,n,s,c,l,d,m,u){const h=(0,A.Z)(t,!m),p=(0,x.Z)(h,!0),Z=(0,D.Z)(),g=(0,a.sO)(new Map),f=(0,b.Z)((e=>{e.forEach((e=>{const t=g.current.get(e);t&&(t.destroy(),g.current.delete(e))}))})),v=(0,b.Z)((()=>{if(!(m&&t.current&&n.current&&s.current))return;const e=(0,o.Rd)(),a=new Set(g.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach((t=>{if(!t.dataset.uniqueId)return;const o=`${l}${t.dataset.uniqueId}${h||""}`,i=t.dataset.documentId;a.delete(o);const m=(0,N.XH)(i);if(!m)return;const u=n.current.getBoundingClientRect(),f=t.getBoundingClientRect(),v=(0,M.NM)((f.left-u.left)/u.width,4),P=(0,M.NM)((f.top-u.top)/u.height,4);if(g.current.has(o))return void g.current.get(o).updatePosition(v,P);const E=e.customEmojis.byId[i];if(!E)return;const y=E?.stickerSetInfo&&(0,r.Si0)(e,E.stickerSetInfo),b=[l,i,h,Z].filter(Boolean).join("_");(async function({customEmoji:e,sharedCanvasRef:t,sharedCanvasHqRef:n,absoluteContainerRef:a,renderId:o,viewId:s,mediaUrl:i,position:r,isHq:c,textColor:l,colorFilter:d}){if(e.isLottie){const a=e.shouldUseTextColor&&l?(0,k.oo)(l):void 0,d=(await(0,C.t)()).init(i,c?n.current:t.current,o,{size:$,coords:r,isLowPriority:!c},s,a?[a.r,a.g,a.b]:void 0);return{play:()=>d.play(),pause:()=>d.pause(),destroy:()=>d.removeView(s),updatePosition:(e,t)=>d.setSharedCanvasCoords(s,{x:e,y:t})}}if(e.isVideo){const t=e.shouldUseTextColor&&d?`filter: ${d};`:void 0,n=new I(i,a.current,{size:$,position:r,style:t});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:E,sharedCanvasRef:n,sharedCanvasHqRef:s,absoluteContainerRef:c,renderId:b,viewId:o,mediaUrl:m,isHq:y,position:{x:v,y:P},textColor:h,colorFilter:p}).then((e=>{d&&e.play(),g.current.set(o,e)}))})),f(Array.from(a))}));(0,a.d4)((()=>(0,N.bn)(v)),[v]),(0,a.d4)((()=>{const e=g.current;return()=>{f(Array.from(e.keys()))}}),[]),(0,a.d4)((()=>{e()&&t.current&&n.current&&u&&m?(0,i.i$)((()=>{v()})):f(Array.from(g.current.keys()))}),[e,v,t,f,n,u,m]),(0,a.bt)((()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",p||"none")}),[p]),(0,R.Z)((([e])=>{void 0!==e&&h!==e&&v()}),[h,v]);const P=(0,L.Z)(v,[v],300,!1);(0,O.Z)(n,P),(0,R.Z)((([e])=>{Z!==e&&(f(Array.from(g.current.keys())),v())}),[Z,v]);const E=(0,b.Z)((()=>{g.current.forEach((e=>{e.pause()}))})),y=(0,b.Z)((()=>{d&&g.current?.forEach((e=>{e.play()}))})),w=(0,b.Z)((()=>{(0,i.i$)(y)}));(0,B.Z)(E,w)}(Y,fe,ye,be,Ce,U,ie,W,q);const Ue=S?160:T?128:Le?256:416,je=(0,b.Z)(((e=!1)=>{(0,i.lT)((()=>{const t=fe.current.closest(`.${H}`),n=Number(t.style.height.replace("px","")),a=Ee.current,{scrollHeight:o}=a,s=Math.min(o,Ue);if(s===n)return;const r=o>Ue;function c(){const e=Math.round(50*Math.log(Math.abs(s-n)));t.style.height=`${s}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",r)}return e?void(0,i.WM)(c):c}))}));(0,a.bt)((()=>{S&&je(!1)}),[S,je]);const _e=(0,a.sO)(Y());(0,a.bt)((()=>{const e=q?Y():"";e!==fe.current.innerHTML&&(fe.current.innerHTML=e),e!==Pe.current.innerHTML&&(Pe.current.innerHTML=e),e!==_e.current&&(_e.current=e,je(!e))}),[Y,q,je]),(0,a.sO)(n).current=n;const He=(0,b.Z)((()=>{fe.current&&((0,E.zG)()?setTimeout(He,350):(0,u.Z)(fe.current))})),ze=(0,b.Z)((()=>{Me(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}));function Ve(){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!(ae||!(0,g.R)(t,j||s.R2F)||!n||(0,m.Z)(n)||!t.START_TO_END)||(Me(),!1)}function We(){if(!Ve())return;if(Re)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=fe.current.closest(`.${H}`).getBoundingClientRect();let a=t.left+t.width/2-n.left;a<z?a=z:a>n.width-z&&(a=n.width-z),Te({x:a,y:t.top-n.top}),Ae(e),Ne()}function qe(){ve.current&&window.clearTimeout(ve.current),ve.current=window.setTimeout(We,260)}(0,a.d4)((()=>{p.$b||ee&&He()}),[n,He,oe,ee]),(0,a.d4)((()=>{if(!n||j!==s.R2F||te||Be||se)return;const e=e=>{if((0,d.wT)())return;const{key:t}=e,n=e.target;if(!n||V.includes(t))return;const a=fe.current,o=document.getSelection()?.isCollapsed;if(!((t.startsWith("Arrow")||e.shiftKey&&"Shift"===t)&&!o||"KeyC"===e.code&&(e.ctrlKey||e.metaKey)&&"INPUT"!==n.tagName)&&a&&n!==a&&"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!n.isContentEditable){(0,u.Z)(a,!0,!0);const t=new KeyboardEvent(e.type,e);a.dispatchEvent(t)}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}}),[n,j,Be,se,te]),(0,a.d4)((()=>{const e=(0,h.Ds)((e=>{"Tab"!==e.key||(0,d.wT)()||(e.preventDefault(),(0,i.WM)(He))}),2e3,!0,!1);return(0,l.Z)({onTab:e})}),[He]),(0,a.d4)((()=>{const e=fe.current;function t(){e.blur()}return ne&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[ne]);const Ye=(0,v.Z)((()=>Boolean(q&&Y())),[q,Y]),Ge=(0,c.Z)("form-control allow-selection",Ye&&"touched",ne&&"focus-disabled");return a.ZP.createElement("div",{id:t,onClick:ne?le:void 0,dir:we.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:(0,c.Z)("custom-scroll",H),onScroll:me,onClick:S||Q?void 0:function(){S||Q||ge({chatId:n})}},a.ZP.createElement("div",{className:"input-scroller-content"},a.ZP.createElement("div",{ref:fe,id:j||s.R2F,className:Ge,contentEditable:S||Q,role:"textbox",dir:"auto",tabIndex:0,onClick:He,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=Y();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 Ze({targetIndexDelta:t})}t||"Enter"!==e.key||e.shiftKey?t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",qe,{once:!0}):(e.preventDefault(),pe()):!Be&&("enter"===re&&!e.shiftKey||"ctrl-enter"===re&&(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",qe,{once:!0})},onContextMenu:p.wZ?function(e){Ve()&&(Oe(!Re),Re?Me():(e.preventDefault(),e.stopPropagation(),We()))}:void 0,onTouchCancel:p.wZ?qe:void 0,"aria-label":G,onFocus:ue,onBlur:he}),!K&&a.ZP.createElement("span",{className:(0,c.Z)("placeholder-text",!S&&!Q&&"with-icon"),dir:"auto"},!S&&!Q&&a.ZP.createElement("i",{className:"icon icon-lock-badge placeholder-icon"}),De?a.ZP.createElement(F.Z,{langKey:X,endsAt:J,onEnd:Fe}):G),a.ZP.createElement("canvas",{ref:ye,className:"shared-canvas"}),a.ZP.createElement("canvas",{ref:be,className:"shared-canvas"}),a.ZP.createElement("div",{ref:Ce,className:"absolute-video-container"}))),a.ZP.createElement("div",{ref:Ee,className:(0,c.Z)("custom-scroll",H,"clone")},a.ZP.createElement("div",{className:"input-scroller-content"},a.ZP.createElement("div",{ref:Pe,className:(0,c.Z)(Ge,"clone"),dir:"auto"}))),void 0!==w&&a.ZP.createElement("div",{className:"max-length-indicator",dir:"auto"},w),a.ZP.createElement(_,{isOpen:Ie,anchorPosition:ke,selectedRange:xe,setSelectedRange:Ae,onClose:ze}),K&&a.ZP.createElement("span",{className:"forced-placeholder"},(0,Z.Z)(K)))})))},23522:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(60748),o=n(33555),s=n(83716),i=n(46752),r=n(60706),c=n(25190),l=n(12644),d=n(231),m=n(43521),u=n(49204),h=n(99203),p=n(48778);const Z=e=>{const{isOpen:t}=e,n=(0,p.Z)(h.gl.Extra,"SymbolMenu",!t);return n?a.ZP.createElement(n,e):void 0},g=(0,a.X$)((({chatId:e,threadId:t,isMobile:n,canSendGifs:h,canSendStickers:p,isMessageComposer:g,isReady:f,isSymbolMenuOpen:v,idPrefix:P,isAttachmentModal:E,canSendPlainText:y,isSymbolMenuForced:b,className:C,forceDarkTheme:w,inputCssSelector:S=s.Edp,openSymbolMenu:I,closeSymbolMenu:N,onCustomEmojiSelect:M,onStickerSelect:k,onGifSelect:T,onRemoveSymbol:x,onEmojiSelect:A,closeBotCommandMenu:R,closeSendAsMenu:O})=>{const{setStickerSearchQuery:L,setGifSearchQuery:B,addRecentEmoji:D,addRecentCustomEmoji:$}=(0,o.Sv)(),F=(0,a.sO)(null),[U,j]=(0,r.Z)(),[_,H]=(0,a.eJ)(void 0),z=(0,i.Z)("mobile-symbol-menu-button",!f&&"not-ready",U?v&&"menu-opened":v&&"is-loading"),V=(0,c.Z)((()=>{R?.(),O?.(),I();const e=F.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();H({x:t,y:n})})),W=(0,c.Z)((e=>{"stickers"===e?(L({query:""}),B({query:void 0})):(B({query:""}),L({query:void 0}))})),q=(0,c.Z)((()=>{const e=document.querySelector(E?s.VEm:S);n&&e===document.activeElement?(e?.blur(),setTimeout((()=>{R?.(),I()}),100)):I()})),Y=(0,c.Z)((()=>F.current)),G=(0,c.Z)((()=>F.current?.closest(".custom-scroll, .no-scrollbar"))),X=(0,c.Z)((()=>document.querySelector("#portals .SymbolMenu .bubble"))),J=(0,c.Z)((()=>({withPortal:!0}))),{positionX:K,positionY:Q,transformOriginX:ee,transformOriginY:te,style:ne}=(0,l.Z)(_,Y,G,X,J);return a.ZP.createElement(a.ZP.Fragment,null,n?a.ZP.createElement(d.Z,{className:z,round:!0,color:"translucent",onClick:v?N:q,ariaLabel:"Choose emoji, sticker or GIF"},a.ZP.createElement("i",{className:"icon icon-smile"}),a.ZP.createElement("i",{className:"icon icon-keyboard"}),v&&!U&&a.ZP.createElement(u.Z,{color:"gray"})):a.ZP.createElement(m.Z,{className:(0,i.Z)("symbol-menu-button",v&&"activated"),round:!0,color:"translucent",onActivate:V,ariaLabel:"Choose emoji, sticker or GIF"},a.ZP.createElement("div",{ref:F,className:"symbol-menu-trigger"}),a.ZP.createElement("i",{className:"icon icon-smile"})),a.ZP.createElement(Z,{chatId:e,threadId:t,isOpen:v||Boolean(b),canSendGifs:h,canSendStickers:p,isMessageComposer:g,idPrefix:P,onLoad:j,onClose:N,onEmojiSelect:A,onStickerSelect:k,onCustomEmojiSelect:M,onGifSelect:T,onRemoveSymbol:x,onSearchOpen:W,addRecentEmoji:D,addRecentCustomEmoji:$,isAttachmentModal:E,canSendPlainText:y,className:(0,i.Z)(C,w&&"component-theme-dark"),positionX:E?K:void 0,positionY:E?Q:void 0,transformOriginX:E?ee:void 0,transformOriginY:E?te:void 0,style:E?ne:void 0}))}))},76087:(e,t,n)=>{n.d(t,{Z:()=>d,V:()=>m});var a=n(83716),o=n(71394),s=n(93447);const i=1280,r=40,c=20,l=/\.[^/.]+$/;async function d(e,t,c){const m=URL.createObjectURL(t),{type:h,size:p}=t;let Z,g,f,v;if(a.oGt.has(h)){const n=await(0,o.pt)(m),{width:p,height:g}=n;v=!u(p,g);const P=Math.max(p,g)>i,E=h===a.s11;if(!v){if(!c?.compressedBlobUrl&&!E&&(P||"image/jpeg"!==h)){const n=await(0,s.j)(m,P?i/Math.max(p,g):1,"image/jpeg");return URL.revokeObjectURL(m),d(e,t,{compressedBlobUrl:n})}"image/jpeg"===h&&(e=e.replace(l,".jpg")),Z={width:p,height:g}}f=Math.max(p,g)>r?await(0,s.j)(m,r/Math.max(p,g),"image/jpeg"):m}else if(a.wGh.has(h)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,o.jj)(m);v=!u(e,t),v||(Z={width:e,height:t,duration:n})}catch(e){v=!0}f=await(0,o.ud)(m)}else if(a.e74.has(h)){const{duration:e,title:t,performer:a,coverUrl:o}=await async function(e){const{fetchFromUrl:t,selectCover:a}=await n.e(8505).then(n.t.bind(n,38505,23)),o=await t(e),{common:{title:s,artist:i,picture:r},format:{duration:c}}=o,l=a(r),d=l?new Blob([l.data],{type:l.format}):void 0;return{title:s,performer:i,duration:c,coverUrl:d?URL.createObjectURL(d):void 0}}(m);g={duration:e||0,title:t,performer:a},f=o}return{blobUrl:m,filename:e,mimeType:h,size:p,quick:Z,audio:g,previewBlobUrl:f,shouldSendAsFile:v||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...c}}function m(e,t){return e.map((e=>t?e.compressedBlobUrl?{...e,blobUrl:e.compressedBlobUrl}:e:{...e,shouldSendAsFile:!e.voice||void 0,shouldSendAsSpoiler:void 0}))}function u(e,t){return Math.max(e,t)/Math.min(e,t)<=c}},21262:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(71394);async function o(e){const t=[];function n(e,a){return new Promise((o=>{if(e instanceof File)t.push(e),o(e);else if(e.isFile){const n=a.getAsFile();e.file((e=>{t.push(e),o(e)}),(()=>{n&&t.push(n),o(n)}))}else e.isDirectory&&e.createReader().readEntries((e=>{const t=[];for(let o=0;o<e.length;o++)t.push(n(e[o],a));o(Promise.all(t))}))}))}const o=[];for(let t=0;t<e.length;t++){const a=e[t];if("file"===a.kind){const e=a.webkitGetAsEntry()||a.getAsFile();e&&o.push(n(e,a))}}return await Promise.all(o),(0,a.ox)(t)}},52400:(e,t,n)=>{n.d(t,{_:()=>r});const a=/(<br>|<br\s?\/>)/g,o=/(&nbsp;|\u00A0)/g,s=/(<div>|<\/div>)/gi,i=/\n$/i;function r(e){return e.replace(o," ").replace(a,"\n").replace(s,"").replace(i,"")}},96391:(e,t,n)=>{n.d(t,{R:()=>o});const a=5;function o(e,t){const{commonAncestorContainer:n}=e;let o=n,s=1;for(;o&&o.id!==t&&s<a;)o=o.parentElement,s++;return Boolean(o&&o.id===t)}},60130:(e,t,n)=>{n.d(t,{Z:()=>E});var a=n(60748),o=n(33555),s=n(83716),i=n(57710),r=n(33681),c=n(65723),l=n(41098),d=n(97184),m=n(44139),u=n(11309),h=n(71790),p=n(86203),Z=n(60706),g=n(25190);const f=300,v=new RegExp(`(${r.Z.source})$`,"g"),P=new RegExp(`${s.t8f.source}$`,"g");function E(e,t,n,E,y,b){const{loadCustomEmojiForEmoji:C,clearCustomEmojiForEmoji:w}=(0,o.Sv)(),[S,I,N]=(0,Z.Z)(!1),M=(0,u.CH)((()=>{const n=t();if(!e||!n||!E()?.collapsed)return;if(!n.match(d.op?r.Z:s.t8f))return;const a=(0,l.gJ)(y.current);return a.match(d.op?v:P)?.[0]}),[t,E,y,e],f),k=(0,h.Z)(M,[M,t,E],!0),T=(0,p.Z)((()=>Boolean(k())),[k]),x=Boolean(b?.length);(0,a.d4)((()=>{if(!e||!T)return;const t=k();t?x||C({emoji:d.op?t:t.match(/.+alt="(.+)"/)?.[1]}):w()}),[e,T,k,x,w,C]);const A=(0,g.Z)((t=>{const a=k();if(!e||!a)return;const o=y.current,s=(0,l.gJ)(o),r=d.op?a:a.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),u=new RegExp(`(${r})\\1*$`,""),h=s.match(u)[0].length/a.length,p=s.replace(u,(0,m.yR)(t).repeat(h)),Z=o.innerHTML.substring(s.length);n(`${p}${Z}`),(0,i.Yq)((()=>{(0,c.Z)(o,!0,!0)}))}));return(0,a.d4)(N,[N,t]),{isCustomEmojiTooltipOpen:Boolean(T&&x&&!S),closeCustomEmojiTooltip:I,insertCustomEmoji:A}}},28353:(e,t,n)=>{n.d(t,{Z:()=>x});var a=n(60748),o=n(33555),s=n(83716),i=n(57710),r=n(7054),c=n(61463),l=n(65723),d=n(60782),m=n(70735),u=n(16580),h=n(32340),p=n(44139),Z=n(52400),g=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,u.Z)((function(e,t,n){return e&&t.length?Object.values((0,d.q0)(e,t)).slice(0,n):m.D})),k=(0,u.Z)((function(e,t,n){const a=Object.values(e),o=(0,d.ee)(a,"native"),s=t?(0,d.Q8)(t,(e=>Object.values((0,d.q0)(o,e)))):{},i=n?(0,d.Q8)(n,(e=>Object.values((0,d.q0)(o,e)))):{},r={...s,...i},c=[].concat(Object.keys(s),Object.keys(i)),l=a.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{}),m=Object.keys(l),u=c.reduce(((e,t)=>Math.max(e,t.length)),0);return{byKeyword:r,keywords:c,byName:l,names:m,maxKeyLength:u}})),T=(0,u.Z)((function(e,t,n){const{byKeyword:a,keywords:o,byName:s,names:i,maxKeyLength:r}=e;let c=[];if(t.length>r)return m.D;const l=o.filter((e=>e.startsWith(t))).sort();c=c.concat(Object.values((0,d.q0)(a,l)).flat());const u=i.filter((e=>e.startsWith(t)));return c=c.concat(Object.values((0,d.q0)(s,u)).flat()),c=(0,d.Tw)(c),c.length?c.slice(0,n):m.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 x(e,t,u,x=s.R2F,A,R,O){const[L,B,D]=(0,v.Z)(!1),[$,F]=(0,a.eJ)(),[U,j]=(0,a.eJ)(m.D),[_,H]=(0,a.eJ)(m.D);(0,a.d4)((()=>{function t(){F(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 z=(0,g.CH)((()=>{const n=t();return e&&n.includes(":")?(0,Z._)(n).match(C)?.[0].trim():void 0}),[t,e],N),V=(0,f.Z)(z,[z,t],!0),W=(0,P.Z)((e=>{if(j(e),e===m.D)return void H(m.D);const t=e.map((e=>e.native)),n=(0,d.od)((0,r.iXW)((0,o.Rd)(),t),"id");H(n)})),q=(0,P.Z)(((e,n=!1)=>{const a=t();if(!a)return;const o=a.lastIndexOf(":",n?a.lastIndexOf(":")-1:void 0);if(-1!==o){const t="string"==typeof e?(0,h.Z)(e,["emoji_html"]):(0,p.yR)(e);u(`${a.substring(0,o)}${t}`);const n=x===s.R2F?document.querySelector(s.Edp):document.getElementById(x);(0,i.Yq)((()=>{(0,l.Z)(n,!0,!0)}))}W(m.D)}));return(0,a.d4)((()=>{const e=V();if(!e||!$)return void W(m.D);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let a=m.D;if(n){if(1===n.length&&w.test(n)||n.length>=I){const e=k($,R,O);a=T(e,n.toLowerCase(),S)}}else a=M($,A,S);a.length?t?q(a[0].native,!0):W(a):W(m.D)}),[R,$,V,O,q,A,W]),(0,a.d4)(D,[D,t]),{isEmojiTooltipOpen:Boolean(U.length||_.length)&&!L,closeEmojiTooltip:B,filteredEmojis:U,filteredCustomEmojis:_,insertEmoji:q}}},29295:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(60748),o=n(33555),s=n(59187),i=n(57710),r=n(41765),c=n(65723),l=n(60782),d=n(41098),m=n(52400),u=n(11309),h=n(71790),p=n(60706),Z=n(25190);const g=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,a.eJ)(),[I,N,M]=(0,p.Z)(!1),k=(0,u.CH)((()=>{const n=t();if(!e||!v()?.collapsed||!n.includes("@"))return;const a=(0,d.gJ)(E.current);return(0,m._)(a).match(f)?.[0].trim()}),[e,t,v,E],g),T=(0,h.Z)(k,[k,t,v],!0),x=(0,h.Z)((()=>e&&t().startsWith("@")),[t,e]);(0,a.d4)((()=>{const e=T();if(!e||!y&&!b)return void S(void 0);const t=(0,o.Rd)().users.byId;if(!t)return void S(void 0);const n=y?.reduce(((e,t)=>(t.userId!==C&&e.push(t.userId),e)),[]),a=e.substring(1),s=(0,r.kK)((0,l.Tw)([...x()&&b||[],...n||[]]),t,a);S(Object.values((0,l.q0)(t,s)))}),[C,y,b,T,x]);const A=(0,Z.Z)(((e,t=!1)=>{if(!e.usernames&&!(0,r.Vl)(e))return;const a=(0,r.WS)(e),o=(0,r.Vl)(e)||"",l=a?`@${a}`:`<a\n class="text-entity-link"\n data-entity-type="${s.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${o}</a>`,m=E.current,u=P((0,d.gJ)(m)),h=u.lastIndexOf("@"),p=(a?a.length+1:o.length)-(u.length-h);if(-1!==h){const e=`${u.substr(0,h)}${l}&nbsp;`,a=P(m.innerHTML).substring(u.length),o=(0,d.qK)(m);n(`${e}${a}`),(0,i.Yq)((()=>{const e=o+p+1;(0,c.Z)(m,t),e>=0&&(0,d.Mq)(m,e)}))}S(void 0)}));return(0,a.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 a=n(60748),o=n(33555),s=n(41765),i=n(46752),r=n(33323),c=n(97184),l=n(42797),d=n(15866),m=n(18360),u=n(59107),h=n(25190),p=n(6202),Z=n(31212),g=n(42175);const f=(0,a.X$)((function({story:e,isPreview:t,isProtected:n,isConnected:f}){const{openStoryViewer:v,loadPeerStoriesByIds:P,showNotification:E}=(0,o.Sv)(),y=(0,u.Z)(),{isMobile:b}=(0,l.ZP)(),C=e&&"isDeleted"in e,w=e&&"content"in e,S=w?e.content.video:void 0,I=w?(0,s.Cc)(e):void 0,N=(0,p.Z)(I),M=w?S?S.thumbnail?.dataUri:e.content.photo?.thumbnail?.dataUri:void 0,k=(0,m.Z)(N,!0),{shouldRender:T,transitionClassNames:x}=(0,Z.Z)(Boolean(k)),A=(0,d.Z)(M,C&&!t,b&&!c.vX),R=(0,i.Z)("EVLTkrt1","media-inner",(!f||C)&&"AQWPv0bP",C&&"tprkr7qf",t&&"V3HabdKr");(0,a.d4)((()=>{!e||w||C||P({peerId:e.peerId,storyIds:[e.id]})}),[e,C,w]);const O=(0,h.Z)((()=>{C?E({message:y("StoryNotFound")}):v({peerId:e.peerId,storyId:e.id,isSinglePeer:!0,isSingleStory:!0})}));return a.ZP.createElement("div",{className:R,onClick:f?O:void 0},!C&&t&&a.ZP.createElement("canvas",{ref:A,className:"thumbnail blurred-bg"}),T&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("img",{src:k,alt:"",className:(0,i.Z)("WAItYc5d",t&&"ClGe8yij",x),draggable:!1}),w&&a.ZP.createElement(g.Z,{story:e,className:x})),C&&a.ZP.createElement("span",null,a.ZP.createElement("i",{className:(0,i.Z)("nLA7VEhv","icon icon-story-expired"),"aria-hidden":!0}),y("StoryExpiredSubtitle")),Boolean(S?.duration)&&a.ZP.createElement("div",{className:"message-media-duration"},(0,r.k9)(S.duration)),n&&a.ZP.createElement("span",{className:"protector"}))}))},97182:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(99203),s=n(48778);const i=e=>{const{isOpen:t}=e,n=(0,s.Z)(o.gl.Extra,"ContextMenuContainer",!t);return n?a.ZP.createElement(n,e):void 0}},95822:(e,t,n)=>{n.d(t,{Z:()=>b});var a=n(60748),o=n(83716),s=n(57710),i=n(41765),r=n(46752),c=n(26593),l=n(83967),d=n(42797),m=n(60706),u=n(3657),h=n(25190),p=n(72645),Z=n(70692),g=n(6701),f=n(87204),v=n(31212),P=n(41280),E=n(62230),y=n(39196);const b=({id:e,message:t,observeIntersection:n,noAvatars:b,canAutoLoad:C,isInSelectMode:w,isSelected:S,uploadProgress:I,forcedWidth:N,size:M="inline",dimensions:k,asForwarded:T,nonInteractive:x,shouldAffectAppendix:A,isDownloading:R,isProtected:O,theme:L,onClick:B,onCancelUpload:D})=>{const $=(0,a.sO)(null),F=(0,i.O$)(t)||(0,i.F$)(t),U=F.blobUrl,j=(0,u.Op)($,n),{isMobile:_}=(0,d.ZP)(),[H,z]=(0,a.eJ)(C),V=H&&j,{mediaData:W,loadProgress:q}=(0,g.Z)((0,i.Ti)(t,M),!V),Y=U||W,G=Boolean(N),[X]=(0,a.eJ)(!Y),J=Boolean(Y),K=(0,P.Z)(t,J),Q=(0,P.Z)(t,!G),ee=(0,Z.Z)(!J),te=(0,i.DH)(t),[ne,ae,oe]=(0,m.Z)(F.isSpoiler);(0,a.d4)((()=>{F.isSpoiler?ae():oe()}),[F.isSpoiler]);const{loadProgress:se}=(0,g.Z)((0,i.Ti)(t,"download"),!R,(0,i.kG)(t,"download")),{isUploading:ie,isTransferring:re,transferProgress:ce}=(0,i.Sc)(t,I||(R?se:q),V&&!Y,void 0!==I),le=!1===(0,f.Z)(H),{shouldRender:de,transitionClassNames:me}=(0,v.Z)(re,void 0,le,"slow"),{shouldRender:ue,transitionClassNames:he}=(0,v.Z)(!Y&&!H),pe=(0,h.Z)((()=>{ie?D?.(t):Y?ne?oe():B?.(t.id):z((e=>!e))})),Ze=(0,i.B4)(t);(0,p.Z)((([e])=>{if(!A)return void(e&&$.current.closest(o.be_).removeAttribute(o.s22));const t=$.current.closest(o.be_);Y?(0,c.Z)(Y,Ze,S,L).then((e=>{(0,s.WM)((()=>{t.style.setProperty("--appendix-bg",e),t.setAttribute(o.s22,"")}))})):t.classList.add("has-appendix-thumb")}),[A,Y,Ze,w,S,L]);const{width:ge,height:fe,isSmall:ve}=k||(0,l.GH)(t,T,b,_),Pe=(0,r.Z)("media-inner",!ie&&!x&&"interactive",ve&&"small-image",ge===fe&&"square-image",fe<l.Xo&&"fix-min-height"),Ee=k?` width: ${ge}px; left: ${k.x}px; top: ${k.y}px;`:"",ye="inline"===M?`height: ${fe}px;${Ee}`:void 0;return a.ZP.createElement("div",{id:e,ref:$,className:Pe,style:ye,onClick:ie?void 0:pe},G&&a.ZP.createElement("canvas",{ref:Q,className:"thumbnail blurred-bg"}),a.ZP.createElement("img",{src:Y,className:(0,r.Z)("full-media",G&&"with-blurred-bg"),alt:"",style:N?`width: ${N}px`:void 0,draggable:!O}),X&&a.ZP.createElement("canvas",{ref:K,className:(0,r.Z)("thumbnail",ee)}),O&&a.ZP.createElement("span",{className:"protector"}),de&&!ue&&a.ZP.createElement("div",{className:`media-loading ${me}`},a.ZP.createElement(y.Z,{progress:ce,onClick:ie?pe:void 0})),ue&&a.ZP.createElement("i",{className:(0,r.Z)("icon","icon-download",he)}),a.ZP.createElement(E.Z,{isVisible:ne,withAnimation:!0,thumbDataUri:te,width:ge,height:fe,className:"media-spoiler"}),re&&a.ZP.createElement("span",{className:"message-transfer-progress"},Math.round(100*ce),"%"))}},56766:(e,t,n)=>{n.d(t,{Z:()=>T});var a=n(60748),o=n(33555),s=n(59187),i=n(41765),r=n(10396),c=n(46752),l=n(33323),d=n(74753),m=n(74399),u=n(11309),h=n(60706),p=n(3657),Z=n(25190),g=n(70692),f=n(6701),v=n(87204),P=n(31212),E=n(33799),y=n(41280),b=n(65979),C=n(62230),w=n(231),S=n(57080),I=n(39196);const N=m.Rj/2,M=2*(N-6)*Math.PI;let k;const T=({message:e,className:t,canAutoLoad:n,isDownloading:T,origin:x,observeIntersection:A,onStop:R,onReadMedia:O})=>{const L=(0,a.sO)(null),B=(0,a.sO)(null),D=(0,a.sO)(null),$=e.content.video,{cancelMessageMediaDownload:F,openOneTimeMediaModal:U}=(0,o.Sv)(),j=(0,p.Op)(L,A),[_,H]=(0,a.eJ)(n),z=Boolean(_&&j),{mediaData:V,loadProgress:W}=(0,f.Z)((0,i.Ti)(e,"inline"),!z,(0,i.kG)(e,"inline")),{loadProgress:q}=(0,f.Z)((0,i.Ti)(e,"download"),!T,s.IU.BlobUrl),[Y,G]=(0,h.Z)(),X=(0,i.qR)(e),J="oneTimeModal"===x,K=X&&!J,Q=!Boolean((0,i.DH)(e))||Y||K,ee=(0,y.Z)(e,Q),te=(0,g.Z)(!Q),ne=(0,i.DH)(e),ae=_&&!Y||T,oe=!1===(0,v.Z)(_),{shouldRender:se,transitionClassNames:ie}=(0,P.Z)(ae,void 0,oe),[re,ce]=(0,a.eJ)(!1),[le,de]=(0,E.Z)(0),me=(0,u.WR)(le,16);(0,a.d4)((()=>{if(!re)return;const e=B.current;de(e.currentTime/e.duration)}),[de,re,me]),(0,a.bt)((()=>{if(!re||!D.current)return;const e=M-me()*M;D.current.setAttribute("stroke-dashoffset",e.toString())}),[re,me]);const ue=Boolean(V&&j),he=(0,Z.Z)((()=>{B.current&&(ce(!1),de(0),(0,d.Z)(B.current))})),pe=(0,Z.Z)((()=>{k?.(),k=he})),Ze=(0,Z.Z)((()=>{const e=B.current;re?e.paused?((0,d.Z)(e),(0,r.Es)()):e.pause():(pe(),e.pause(),e.currentTime=0,(0,d.Z)(e),(0,r.Es)(),ce(!0))}));(0,a.d4)((()=>{J&&Ze()}),[J]);const ge=(0,Z.Z)((()=>{if(V){if(!T)return X&&!J?(U({message:e}),void O?.()):void Ze();F({message:e})}else H((e=>!e))})),fe=(0,Z.Z)((e=>{const t=e.currentTarget;de(t.currentTime/t.duration)}));return a.ZP.createElement("div",{ref:L,className:(0,c.Z)("RoundVideo","media-inner",J&&"non-interactive",t),onClick:ge},V&&a.ZP.createElement("div",{className:"video-wrapper"},K&&a.ZP.createElement(C.Z,{isVisible:!0,thumbDataUri:ne,width:m.Rj,height:m.Rj,className:"media-spoiler"}),a.ZP.createElement(S.Z,{canPlay:ue,ref:B,src:V,className:"full-media",width:m.Rj,height:m.Rj,autoPlay:!K,disablePictureInPicture:!0,muted:!re,loop:!re,playsInline:!0,isPriority:!0,onEnded:re?R??he:void 0,onTimeUpdate:re?fe:void 0,onReady:G})),!K&&a.ZP.createElement("canvas",{ref:ee,className:(0,c.Z)("thumbnail",te),style:`width: ${m.Rj}px; height: ${m.Rj}px`}),a.ZP.createElement("div",{className:"progress"},re&&a.ZP.createElement("svg",{width:m.Rj,height:m.Rj},a.ZP.createElement("circle",{ref:D,cx:N,cy:N,r:N-6,className:"progress-circle",transform:`rotate(-90, ${N}, ${N})`,"stroke-dasharray":M,"stroke-dashoffset":M}))),se&&a.ZP.createElement("div",{className:`media-loading ${ie}`},a.ZP.createElement(I.Z,{progress:T?q:W})),K&&!se&&a.ZP.createElement("div",{className:"play-wrapper"},a.ZP.createElement(w.Z,{color:"dark",round:!0,size:"smaller",className:"play",nonInteractive:!0},a.ZP.createElement(b.Z,{name:"play"})),a.ZP.createElement(b.Z,{name:"view-once"})),!V&&!_&&a.ZP.createElement("i",{className:"icon icon-download"}),!J&&a.ZP.createElement("div",{className:"message-media-duration"},re?(0,l.k9)(B.current.currentTime):(0,l.k9)($.duration),(!re||B.current.paused)&&a.ZP.createElement(b.Z,{name:"muted"})))}},35269:(e,t,n)=>{n.d(t,{Z:()=>S});var a=n(60748),o=n(33555),s=n(41765),i=n(46752),r=n(33323),c=n(40647),l=n(74399),d=n(83967),m=n(13617),u=n(42797),h=n(60706),p=n(3657),Z=n(25190),g=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=({id:e,message:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:S,noAvatars:I,canAutoLoad:N,canAutoPlay:M,uploadProgress:k,forcedWidth:T,dimensions:x,asForwarded:A,isDownloading:R,isProtected:O,onClick:L,onCancelUpload:B})=>{const D=(0,a.sO)(null),$=(0,a.sO)(null),F=(0,s.b7)(t)||(0,s.Cg)(t),U=F.blobUrl,[j,_,H]=(0,h.Z)(F.isSpoiler);(0,a.d4)((()=>{F.isSpoiler?_():H()}),[F.isSpoiler]);const z=(0,p.Op)(D,n),V=(0,p.Op)(D,S)&&z,W=(0,a.sO)(z);V&&!W.current&&(W.current=!0);const{isMobile:q}=(0,u.ZP)(),[Y,G]=(0,a.eJ)(N),X=Boolean(Y&&z),[J,K]=(0,a.eJ)(Boolean(M&&!j)),Q=(0,s.Ti)(t,"inline"),[ee]=(0,a.eJ)(Boolean(Q&&c.UV(Q))),{mediaData:te,loadProgress:ne}=(0,v.Z)(Q,!X,(0,s.kG)(t,"inline")),ae=U||te,[oe,se]=(0,h.Z)(),ie=(0,s.DH)(t),re=Boolean(ie),ce=Boolean(T),le=(0,s.Ti)(t,"preview"),[de]=(0,a.eJ)(Boolean(le&&c.UV(le))),me=z,ue=(0,g.Z)(le,!me),he=(0,f.Z)((re||ue)&&!oe),pe=!re||ue||oe,Ze=(0,y.Z)(t,pe),ge=(0,y.Z)(t,!ce),fe=(0,f.Z)(!pe),ve=ae&&W.current,Pe=(0,m.Z)($,!0,!ve),{loadProgress:Ee}=(0,v.Z)((0,s.Ti)(t,"download"),!R,(0,s.kG)(t,"download")),{isUploading:ye,isTransferring:be,transferProgress:Ce}=(0,s.Sc)(t,k||(R?Ee:ne),X&&!oe&&!ee||R,void 0!==k),we=!1===(0,P.Z)(Y),{shouldRender:Se,transitionClassNames:Ie}=(0,E.Z)(be&&!Pe,void 0,we),{transitionClassNames:Ne}=(0,E.Z)(Boolean((Y||ae)&&!J&&!Se)),[Me,ke]=(0,a.eJ)(0),Te=(0,Z.Z)((e=>{ke(Math.max(0,e.currentTarget.currentTime-1))})),xe=(Number.isFinite($.current?.duration)?$.current?.duration:F.duration)||0,Ae=(0,s.B4)(t),Re=Boolean((0,s.Cg)(t)),{width:Oe,height:Le}=x||(0,l.GC)(F,Ae,A,Re,I,q),Be=(0,Z.Z)((()=>{ye?B?.(t):R?(0,o.Sv)().cancelMessageMediaDownload({message:t}):ae?(ae&&!J&&K(!0),j?H():L?.(t.id)):G((e=>!e))})),De=(0,i.Z)("media-inner dark",!ye&&"interactive",Le<d.Xo&&"fix-min-height"),$e=`height: ${Le}px;${x?` width: ${Oe}px; left: ${x.x}px; top: ${x.y}px;`:""}`;return a.ZP.createElement("div",{ref:D,id:e,className:De,style:$e,onClick:ye?void 0:Be},ce&&a.ZP.createElement("canvas",{ref:ge,className:"thumbnail blurred-bg"}),ve&&a.ZP.createElement(C.Z,{ref:$,src:ae,className:(0,i.Z)("full-media",ce&&"with-blurred-bg"),canPlay:J&&V&&!Pe,muted:!0,loop:!0,playsInline:!0,draggable:!O,onTimeUpdate:Te,onReady:se,style:T?`width: ${T}px`:void 0}),a.ZP.createElement("img",{src:ue,className:(0,i.Z)("thumbnail",he,ce&&"with-blurred-bg"),alt:"",style:T?`width: ${T}px;`:void 0,draggable:!O}),re&&!de&&a.ZP.createElement("canvas",{ref:Ze,className:(0,i.Z)("thumbnail",fe)}),O&&a.ZP.createElement("span",{className:"protector"}),a.ZP.createElement("i",{className:(0,i.Z)("icon","icon-large-play",Ne)}),a.ZP.createElement(b.Z,{isVisible:j,withAnimation:!0,thumbDataUri:ie,width:Oe,height:Le,className:"media-spoiler"}),Se&&a.ZP.createElement("div",{className:(0,i.Z)("media-loading",Ie)},a.ZP.createElement(w.Z,{progress:Ce,onClick:Be})),!Y&&!ae&&a.ZP.createElement("i",{className:"icon icon-download"}),!be||Pe&&!R?a.ZP.createElement("div",{className:"message-media-duration"},F.isGif?"GIF":(0,r.k9)(Math.max(xe-Me,0)),Pe&&a.ZP.createElement("i",{className:"icon icon-message-failed playback-failed"})):a.ZP.createElement("span",{className:"message-transfer-progress"},ye||R?`${Math.round(100*Ce)}%`:"..."))}},54659:(e,t,n)=>{n.d(t,{Z:()=>S});var a=n(60748),o=n(33555),s=n(91713),i=n(41765),r=n(46752),c=n(48035),l=n(32340),d=n(83967),m=n(92085),u=n(42797),h=n(31526),p=n(59107),Z=n(25190),g=n(73482),f=n(82535),v=n(41278),P=n(10088),E=n(36765),y=n(231),b=n(93609),C=n(95822),w=n(35269);const S=(0,a.X$)((({message:e,observeIntersectionForLoading:t,observeIntersectionForPlaying:n,noAvatars:S,canAutoLoad:I,canAutoPlay:N,inPreview:M,asForwarded:k,isDownloading:T=!1,isProtected:x,isConnected:A,story:R,theme:O,backgroundEmojiId:L,shouldWarnAboutSvg:B,autoLoadFileMaxSizeMb:D,onMediaClick:$,onAudioPlay:F,onCancelMediaTransfer:U})=>{const{openTelegramLink:j}=(0,o.Sv)(),_=(0,i.s1)(e),{isMobile:H}=(0,u.ZP)(),z=(0,a.sO)(null),V=(0,a.sO)(null),W=(0,p.Z)(),q=(0,Z.Z)((()=>{$()})),Y=(0,Z.Z)((()=>{_&&j({url:_.url})})),{story:G,stickers:X}=_||{};(0,h.Z)(G?.peerId,G?.id,R);const J=X?.isWithTextColor||X?.documents?.[0]?.shouldUseTextColor,K=(0,m.Z)(V,!J);if(!_)return;const{siteName:Q,url:ee,displayUrl:te,title:ne,description:ae,photo:oe,video:se,audio:ie,type:re,document:ce}=_,le="telegram_story"===re,de=M||R&&"isDeleted"in R?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":case"telegram_group_boost":return"lng_view_button_boost";case"telegram_stickerset":return"lng_view_button_stickerset";default:return}}(re),me=(0,c.Z)(ae,170),ue=Boolean(me||ne||Q);let he=Boolean(X);if(ue&&_?.photo&&!_.video){const{width:t,height:n}=(0,d.GH)(e,void 0,void 0,H);he=t===n}const pe=(oe||se)&&$&&!he,Ze=(0,r.Z)("WebPage",M&&"in-preview",he&&"with-square-photo",!oe&&!se&&!M&&"without-media",se&&"with-video",!ue&&"no-article",ce&&"with-document",de&&"with-quick-button");return a.ZP.createElement("div",{ref:z,className:Ze,"data-initial":(Q||te)[0],dir:W.isRtl?"rtl":"auto"},a.ZP.createElement("div",{className:(0,r.Z)("WebPage--content",le&&"is-story")},L&&a.ZP.createElement(v.Z,{emojiDocumentId:L,className:"WebPage--background-icons"}),le&&a.ZP.createElement(b.Z,{story:R,isProtected:x,isConnected:A,isPreview:!0}),oe&&!se&&a.ZP.createElement(C.Z,{message:e,observeIntersection:t,noAvatars:S,canAutoLoad:I,size:he?"pictogram":"inline",asForwarded:k,nonInteractive:!pe,isDownloading:T,isProtected:x,theme:O,onClick:pe?q:void 0,onCancelUpload:U}),ue&&a.ZP.createElement("div",{className:"WebPage-text"},a.ZP.createElement(P.Z,{className:"site-name",url:ee,text:Q||te}),!M&&ne&&a.ZP.createElement("p",{className:"site-title"},(0,l.Z)(ne)),me&&a.ZP.createElement("p",{className:"site-description"},(0,l.Z)(me,["emoji","br"]))),!M&&se&&a.ZP.createElement(w.Z,{message:e,observeIntersectionForLoading:t,noAvatars:S,canAutoLoad:I,canAutoPlay:N,asForwarded:k,isDownloading:T,isProtected:x,onClick:pe?q:void 0,onCancelUpload:U}),!M&&ie&&a.ZP.createElement(g.ZP,{theme:O,message:e,origin:s.Cr.Inline,noAvatars:S,isDownloading:T,onPlay:F,onCancelUpload:U}),!M&&ce&&a.ZP.createElement(f.Z,{message:e,observeIntersection:t,autoLoadFileMaxSizeMb:D,onMediaClick:q,onCancelUpload:U,isDownloading:T,shouldWarnAboutSvg:B}),!M&&X&&a.ZP.createElement("div",{ref:V,className:(0,r.Z)("media-inner","square-image",X.isEmoji&&"WebPage--emoji-grid","WebPage--stickers")},X.documents.map((e=>a.ZP.createElement("div",{key:e.id,className:"WebPage--sticker"},a.ZP.createElement(E.Z,{containerRef:V,sticker:e,shouldLoop:!0,size:X.isEmoji?40:80,customColor:K,observeIntersectionForPlaying:n,observeIntersectionForLoading:t}))))),M&&te&&!ue&&a.ZP.createElement("div",{className:"WebPage-text"},a.ZP.createElement("p",{className:"site-name"},te),a.ZP.createElement("p",{className:"site-description"},W("Chat.Empty.LinkPreview")))),de&&(ge=de,a.ZP.createElement(y.Z,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,onClick:Y},W(ge))));var ge}))},26593:(e,t,n)=>{n.d(t,{Z:()=>o});const a={dark:{outgoing:"rgb(135,116,225)",incoming:"rgb(33,33,33)"},light:{outgoing:"rgb(238,255,222)",incoming:"rgb(255,255,255)"}};function o(e,t,n,o){return n?Promise.resolve(a[o||"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 a=document.createElement("canvas"),o=a.getContext("2d");a.width=n.width,a.height=n.height,o.drawImage(n,0,0,n.width,n.height);const s=t?n.width-1:0,i=n.height-1;return`rgba(${Array.from(o.getImageData(s,i,1,1).data).join(",")})`}(e,t)}},83967:(e,t,n)=>{n.d(t,{GH:()=>m,Pw:()=>d,Vx:()=>r,Xo:()=>l});var a=n(41765),o=n(74399);const s=12,i=40,r=20*o.Gw,c=s*o.Gw,l=5*o.Gw;function d(e,t){return(e?.length??0)>i||t?r:c}function m(e,t,n,i){const r=(0,a.B4)(e),c=(0,a.O$)(e)||(0,a.F$)(e),m=(0,a.b7)(e),u=Boolean((0,a.F$)(e)),h=Boolean((0,a.Cg)(e)),{width:p,height:Z}=c?(0,o.Eh)(c,r,t,u,n,i):(0,o.GC)(m,r,t,h,n,i),g=d((0,a.UD)(e));let f=1;p<g&&g-p<s&&(f=g/p),Z*f<l&&l-Z*f<s&&(f=l/Z);const v=Math.round(p*f),P=Math.round(Z*f);return{width:v,height:P,isSmall:v<g||P<l}}},41280:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(41765),o=n(97184),s=n(42797),i=n(15866);function r(e,t,n){const{isMobile:r}=(0,s.ZP)(),c=n||(0,a.DH)(e);return(0,i.Z)(c,Boolean(t),r&&!o.vX)}},45277:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(31664),s=n(57710),i=n(81740);const r=500,c=750,l=20;function d(e,t,n,d,m,u,h,p){const Z=(0,a.sO)(!h);(0,a.bt)((()=>{const t=Z.current;if(Z.current=!1,n&&e.current){const n=e.current.closest(".MessageList"),a=m,h=()=>{const t=(0,i.ZP)(n,e.current,a?"end":"centerOrTop",l,void 0!==d?a?r:c:void 0,d,void 0,u,!0);if(p){const t=e.current.querySelector(".is-quote");t&&(0,s.WM)((()=>{(0,o.D_)(t,"animate")}))}return t};t?(0,s.lT)(h):(0,s.i$)((()=>{(0,s.WM)(h())}))}}),[e,t,n,d,m,u,p])}},75368:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(33555),s=n(69118);const i=new Map;function r(e,t,n,s){const r=s&&n?e?.byLangCode[s]?.[n]:void 0,{isPending:l,text:d}=r||{};return(0,a.d4)((()=>{t&&n&&!d&&void 0===l&&s&&function(e,t,n){const a=i.get(n)||new Map,s=a.get(e)||[];s.includes(t)||(s.push(t),a.set(e,s),i.set(n,a),(0,o.Sv)().markMessagesTranslationPending({chatId:e,messageIds:s,toLanguageCode:n})),c()}(t,n,s)}),[t,d,l,n,s]),t&&n?{isPending:l,translatedText:d}:{isPending:!1,translatedText:void 0}}const c=(0,s.P2)((function(){const{translateMessages:e}=(0,o.Sv)();let t=!1;i.forEach(((n,a)=>{n.forEach(((n,o)=>{const s=n.slice(0,20);s.length<n.length&&(t=!0),e({chatId:o,messageIds:s,toLanguageCode:a}),function(e,t,n){const a=i.get(n);if(!a?.size)return void i.delete(n);const o=a.get(e);if(!o?.length)return void a.delete(e);const s=o.filter((e=>!t.includes(e)));if(!s?.length)return a.delete(e),void(a.size||i.delete(n));a.set(e,s)}(o,s,a)}))})),t&&c()}),500)},96621:(e,t,n)=>{n.d(t,{Z:()=>S});var a=n(60748),o=n(33555),s=n(41765),i=n(46752),r=n(59107),c=n(25190),l=n(231),d=n(8337),m=n(74399),u=n(96459),h=n(65979);const p="uGUjDZKl",Z="M62HGuIV",g="WMpEr5XQ",f=2*m.Gw,v=(0,a.X$)((({reaction:e,chosen:t,isReady:n,noAppearAnimation:o,style:s,isLocked:r,onToggleReaction:c})=>a.ZP.createElement("div",{className:(0,i.Z)(p,"oc1hpMwv",t&&Z,!o&&n&&"sx6RTuAU",o&&"kqcWe4tf"),style:s,onClick:function(){c(e)}},a.ZP.createElement(u.Z,{documentId:e.documentId,size:f}),r&&a.ZP.createElement(h.Z,{className:g,name:"lock-badge"}))));var P=n(60706),E=n(6202),y=n(97799);const b=2*m.Gw,C=(0,a.X$)((({reaction:e,isReady:t,noAppearAnimation:n,chosen:o,isLocked:s,onToggleReaction:r})=>{const c=(0,E.Z)(`sticker${e.appearAnimation?.id}`,!t||n),l=(0,E.Z)(`document${e.selectAnimation?.id}`,!t||n),d=(0,E.Z)(`document${e.staticIcon?.id}`,!n),[m,u]=(0,P.Z)(),[f,,v]=(0,P.Z)(!0),[C,w,S]=(0,P.Z)();return a.ZP.createElement("div",{className:(0,i.Z)(p,o&&Z),onClick:function(){r(e.reaction)},onMouseEnter:t&&!f?w:void 0},n&&a.ZP.createElement("img",{className:"MZ2tH980",src:d,alt:e.reaction.emoticon,draggable:!1}),!m&&!n&&a.ZP.createElement(y.Z,{key:e.appearAnimation?.id,tgsUrl:c,play:f,noLoop:!0,size:b,onEnded:v,forceAlways:!0}),!f&&!n&&a.ZP.createElement(y.Z,{key:e.selectAnimation?.id,tgsUrl:l,play:C,noLoop:!0,size:b,onLoad:u,onEnded:S,forceAlways:!0}),s&&a.ZP.createElement(h.Z,{className:g,name:"lock-badge"}))})),w=(0,i.y)("ReactionSelector"),S=(0,a.X$)((({allAvailableReactions:e,topReactions:t,defaultTagReactions:n,enabledReactions:m,currentReactions:u,maxUniqueReactions:h,isPrivate:p,isReady:Z,canPlayAnimatedEmojis:g,className:f,isCurrentUserPremium:P,isInSavedMessages:E,isInStoryViewer:y,onClose:b,onToggleReaction:S,onShowMore:I})=>{const{openPremiumModal:N}=(0,o.Sv)(),M=(0,a.sO)(null),k=(0,r.Z)(),T=E&&!P&&!y,x=(0,a.Ye)((()=>{const a=E?n:"some"===m?.type?m.allowed:e?.map((e=>e.reaction)),o=a?.map((t=>{const n="documentId"in t,a=e?.find((e=>(0,s.Hl)(e.reaction,t)));if((n||a)&&!a?.isInactive&&(p||m&&(0,s.XU)(t,m))&&(!(h&&u&&u.length>=h)||u.some((({reaction:e})=>(0,s.Hl)(t,e)))))return n?t:a})).filter(Boolean)||[];return(0,s.PO)(o,t)}),[e,u,n,m,E,p,h,t]),A=(0,a.Ye)((()=>8===x.length?x:x.slice(0,7)),[x]),R=A.length<x.length,O=(0,a.Ye)((()=>{const e=u?.filter((({chosenOrder:e})=>void 0!==e))||[];return new Set(e.map((({reaction:e})=>A.findIndex((t=>t&&(0,s.Hl)("reaction"in t?t.reaction:t,e))))))}),[u,A]),L=(0,c.Z)((()=>{const e=M.current?.getBoundingClientRect()||{x:0,y:0};I({x:e.x,y:e.y})})),B=(0,c.Z)((()=>{b?.(),N({initialSection:"saved_tags"})})),D=(0,a.Ye)((()=>{if(E){if(!P){const e=k("lng_subscribe_tag_about").split("{link}");return a.ZP.createElement("span",null,e[0],a.ZP.createElement(d.Z,{isPrimary:!0,onClick:B},k("lng_subscribe_tag_link")),e[1])}return k("SavedTagReactionsHint2")}if(y)return k("StoryReactionsHint")}),[P,E,y,k]);if(A.length)return a.ZP.createElement("div",{className:(0,i.Z)(w("&",k.isRtl&&"isRtl"),f),ref:M},a.ZP.createElement("div",{className:w("bubble-small",k.isRtl&&"isRtl")}),a.ZP.createElement("div",{className:w("items-wrapper")},a.ZP.createElement("div",{className:w("bubble-big",k.isRtl&&"isRtl")}),a.ZP.createElement("div",{className:w("items")},D&&a.ZP.createElement("div",{className:w("hint")},D),a.ZP.createElement("div",{className:w("reactions"),dir:k.isRtl?"rtl":void 0},A.map(((e,t)=>"reaction"in e?a.ZP.createElement(C,{key:(0,s.jq)(e.reaction),isReady:Z,onToggleReaction:S,reaction:e,noAppearAnimation:!g,chosen:O.has(t),isLocked:T}):a.ZP.createElement(v,{key:(0,s.jq)(e),isReady:Z,onToggleReaction:S,reaction:e,noAppearAnimation:!g,chosen:O.has(t),isLocked:T,style:`--_animation-delay: ${20*(7-t)}ms`}))),R&&a.ZP.createElement(l.Z,{color:"translucent",className:w("show-more"),onClick:L},a.ZP.createElement("i",{className:"icon icon-down"}))))))}))},14018:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(60748),o=n(33555),s=n(46752),i=n(74399),r=n(17240),c=n(60706),l=n(59107),d=n(25190),m=n(12644),u=n(36368),h=n(231),p=n(97687),Z=n(34563);const g=(0,a.X$)((({isOpen:e,title:t,subtitle:n,placeholder:o,submitText:s,maxLength:i,initialValue:r="",onClose:c,onSubmit:m})=>{const u=(0,l.Z)(),[g,f]=(0,a.eJ)(r),v=(0,d.Z)((e=>{f(e.target.value)})),P=(0,d.Z)((()=>{m(g)}));return a.ZP.createElement(Z.Z,{className:"narrow",title:t,isOpen:e,onClose:c,isSlim:!0},Boolean(n)&&a.ZP.createElement("div",{className:"cGrbcqD_"},n),a.ZP.createElement(p.Z,{placeholder:o,value:g,onChange:v,maxLength:i,teactExperimentControlled:!0}),a.ZP.createElement("div",{className:"dialog-buttons mt-2"},a.ZP.createElement(h.Z,{className:"confirm-dialog-button",onClick:P},s||u("Save")),a.ZP.createElement(h.Z,{className:"confirm-dialog-button",isText:!0,onClick:c},u("Cancel"))))}));var f=n(52328),v=n(58964),P=n(31482);const E=1.25*i.Gw,y=(0,a.X$)((({reaction:e,tag:t,containerId:n,isChosen:i,isOwnMessage:p,className:Z,chosenClassName:y,withCount:b,isDisabled:C,withContextMenu:w,observeIntersection:S,onClick:I,onRemove:N})=>{const{editSavedReactionTag:M}=(0,o.Sv)(),k=(0,a.sO)(null),T=(0,a.sO)(null),x=(0,l.Z)(),[A,R,O]=(0,c.Z)(),{title:L,count:B}=t||{},D=Boolean(L||b&&B),$=(0,d.Z)((()=>{I?.(e)})),F=(0,d.Z)((()=>{N?.(e)})),U=(0,d.Z)((t=>{M({reaction:e,title:t}),O()})),{isContextMenuOpen:j,contextMenuPosition:_,handleBeforeContextMenu:H,handleContextMenu:z,handleContextMenuClose:V,handleContextMenuHide:W}=(0,r.Z)(k,!w),q=(0,d.Z)((()=>k.current)),Y=(0,d.Z)((()=>document.body)),G=(0,d.Z)((()=>T.current)),{positionX:X,positionY:J,transformOriginX:K,transformOriginY:Q,style:ee}=(0,m.Z)(_,q,Y,G,(()=>({withPortal:!0,shouldAvoidNegativePosition:!0})));if(!b||0!==B)return a.ZP.createElement(h.Z,{className:(0,s.Z)(P.Z.root,P.Z.tag,p&&P.Z.own,i&&P.Z.chosen,i&&y,C&&P.Z.disabled,Z),size:"tiny",onClick:$,onMouseDown:H,onContextMenu:z,ref:k},a.ZP.createElement(u.Z,{className:P.Z.animatedEmoji,containerId:n,reaction:e,loopLimit:1,size:E,observeIntersection:S}),D&&a.ZP.createElement("span",{className:P.Z.tagText},L&&a.ZP.createElement("span",null,L),b&&a.ZP.createElement("span",null,B)),a.ZP.createElement("svg",{className:P.Z.tail,width:"15",height:"30",viewBox:"0 0 15 30"},a.ZP.createElement("path",{className:P.Z.tailFill,d:"m 0,30 c 3.1855,0 6.1803,-1.5176 8.0641,-4.0864 l 5.835,-7.9568 c 1.2906,-1.7599 1.2906,-4.1537 0,-5.9136 L 8.0641,4.08636 C 6.1803,1.51761 3.1855,0 0,0"})),w&&a.ZP.createElement(g,{isOpen:A,maxLength:15,title:x(t?.title?"SavedTagRenameTag":"SavedTagLabelTag"),subtitle:x("SavedTagLabelTagText"),placeholder:x("SavedTagLabelPlaceholder"),initialValue:t?.title,onClose:O,onSubmit:U}),w&&_&&a.ZP.createElement(f.Z,{ref:T,isOpen:j,transformOriginX:K,transformOriginY:Q,positionX:X,positionY:J,style:ee,autoClose:!0,withPortal:!0,onClose:V,onCloseAnimationEnd:W},a.ZP.createElement(v.Z,{icon:"tag-filter",onClick:$},x("SavedTagFilterByTag")),a.ZP.createElement(v.Z,{icon:"tag-name",onClick:R},x(t?.title?"SavedTagRenameTag":"SavedTagLabelTag")),a.ZP.createElement(v.Z,{icon:"tag-crossed",destructive:!0,onClick:F},x("SavedTagRemoveTag"))))}))},17891:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(65326),s=n(34446);function i(e,t){const n=void 0===t,i=(0,a.sO)(n),r=(0,a.sO)(),c=(0,o.Z)();return(0,s.Z)((()=>{n||(i.current=!1,r.current&&(clearTimeout(r.current),r.current=void 0))}),e),(0,a.d4)((()=>{if(n||i.current)return;const e=()=>{i.current=!0,c()};t>0?r.current=window.setTimeout(e,t):e()}),e),i.current}},16289:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(60748),o=n(46752),s=n(33323),i=n(2155),r=n(59107);const c="gvrp3KoR",l="IHb3ZATQ",d="zAPFdKbZ",m=[[{name:"followers",title:"ChannelStats.Overview.Followers"},{name:"enabledNotifications",title:"ChannelStats.Overview.EnabledNotifications",isPercentage:!0}],[{name:"viewsPerPost",title:"ChannelStats.Overview.ViewsPerPost"},{name:"viewsPerStory",title:"ChannelStats.Overview.ViewsPerStory"}],[{name:"sharesPerPost",title:"ChannelStats.Overview.SharesPerPost"},{name:"sharesPerStory",title:"ChannelStats.Overview.SharesPerStory"}],[{name:"reactionsPerPost",title:"ChannelStats.Overview.ReactionsPerPost"},{name:"reactionsPerStory",title:"ChannelStats.Overview.ReactionsPerStory"}]],u=[[{name:"members",title:"Stats.GroupMembers"},{name:"messages",title:"Stats.GroupMessages"}],[{name:"viewers",title:"Stats.GroupViewers"},{name:"posters",title:"Stats.GroupPosters"}]],h=[[{name:"viewsCount",title:"Stats.Message.Views",isPlain:!0},{name:"publicForwards",title:"Stats.Message.PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"Stats.Message.PrivateShares",isPlain:!0,isApproximate:!0}]],p=[[{name:"viewsCount",title:"Channel.Stats.Overview.Views",isPlain:!0},{name:"publicForwards",title:"PublicShares",isPlain:!0}],[{name:"reactionsCount",title:"Channel.Stats.Overview.Reactions",isPlain:!0},{name:"forwardsCount",title:"PrivateShares",isPlain:!0}]],Z=[[{name:"level",title:"Stats.Boosts.Level",isPlain:!0},{name:"premiumSubscribers",title:"Stats.Boosts.PremiumSubscribers",isPercentage:!0,isApproximate:!0,withAbsoluteValue:!0}],[{name:"boosts",title:"Stats.Boosts.ExistingBoosts",isPlain:!0},{name:"remainingBoosts",title:"Stats.Boosts.BoostsToLevelUp",isPlain:!0}]],g=(0,a.X$)((({title:e,type:t,statistics:n,className:g})=>{const f=(0,r.Z)(),{period:v}=n,P=function(e){switch(e){case"group":return u;case"message":return h;case"boost":return Z;case"story":return p;default:return m}}(t);return a.ZP.createElement("div",{className:(0,o.Z)("Gi8Nokbl",g)},a.ZP.createElement("div",{className:"H01lE7mv"},e&&a.ZP.createElement("div",{className:"VQbs04hT"},e),v&&a.ZP.createElement("div",{className:"X7bBlGdi"},(0,s.Tu)(f,1e3*v.minDate)," ",(0,s.Tu)(f,1e3*v.maxDate))),a.ZP.createElement("table",{className:"s5beXqqL"},P.map((e=>a.ZP.createElement("tr",null,e.map((e=>{const t=n[e.name];return e.isPlain?a.ZP.createElement("td",{className:c},a.ZP.createElement("b",{className:d},`${e.isApproximate?"":""}${(0,i.kh)(t)}`),a.ZP.createElement("h3",{className:l},f(e.title))):e.isPercentage?a.ZP.createElement("td",{className:c},e.withAbsoluteValue&&a.ZP.createElement("span",{className:d},`${e.isApproximate?"":""}${(0,i.kh)(t.part)}`),a.ZP.createElement("span",{className:e.withAbsoluteValue?"_mYEmh_u":d},t.percentage,"%"),a.ZP.createElement("h3",{className:l},f(e.title))):a.ZP.createElement("td",{className:c},a.ZP.createElement("b",{className:d},(0,i.bi)(t.current))," ",(({change:e,percentage:t})=>{if(!e)return;const n=Number(e)<0;return a.ZP.createElement("span",{className:(0,o.Z)("idLrmbhS",n&&"SLfwGHQC")},n?`-${(0,i.bi)(Math.abs(e))}`:`+${(0,i.bi)(e)}`,t&&a.ZP.createElement(a.ZP.Fragment,null," ","(",t,"%)"))})(t),a.ZP.createElement("h3",{className:l},f(e.title)))})))))))}))},47505:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(60748),o=n(33555),s=n(46752),i=n(42797),r=n(78781),c=n(59107),l=n(91713),d=n(41765),m=n(30386),u=n(17240),h=n(25190),p=n(12644),Z=n(19156),g=n(70172),f=n(52328),v=n(58964),P=n(41372);const E=(0,a.X$)((function({peer:e,isArchived:t}){const{openChat:n,openChatWithInfo:i,openStoryViewer:r,toggleStoriesHidden:E}=(0,o.Sv)(),y=(0,c.Z)(),b=(0,a.sO)(null),C="isSelf"in e&&e.isSelf,w=!(0,d.YC)(e.id);(0,Z.Z)(e.id);const{isContextMenuOpen:S,contextMenuPosition:I,handleBeforeContextMenu:N,handleContextMenu:M,handleContextMenuClose:k,handleContextMenuHide:T}=(0,u.Z)(b),x=(0,h.Z)((()=>b.current)),A=(0,h.Z)((()=>document.body)),R=(0,h.Z)((()=>b.current.querySelector(".story-peer-context-menu .bubble"))),O=(0,h.Z)((()=>({withPortal:!0,isDense:!0}))),{positionX:L,positionY:B,transformOriginX:D,transformOriginY:$,style:F}=(0,p.Z)(I,x,A,R,O),U=(0,h.Z)((()=>{S||r({peerId:e.id,origin:l.ze.StoryRibbon})})),j=(0,h.Z)((e=>{(0,m.b)(e),N(e)})),_=(0,h.Z)((()=>{i({id:e.id,shouldReplaceHistory:!0,profileTab:"stories"})})),H=(0,h.Z)((()=>{i({id:e.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})})),z=(0,h.Z)((()=>{n({id:e.id,shouldReplaceHistory:!0})})),V=(0,h.Z)((()=>{i({id:e.id,shouldReplaceHistory:!0})})),W=(0,h.Z)((()=>{E({peerId:e.id,isHidden:!t})}));return a.ZP.createElement("div",{ref:b,role:"button","data-peer-id":e.id,tabIndex:0,className:P.Z.peer,onMouseDown:j,onClick:U,onContextMenu:M},a.ZP.createElement(g.Z,{peer:e,withStory:!0,storyViewerOrigin:l.ze.StoryRibbon,storyViewerMode:"full"}),a.ZP.createElement("div",{className:(0,s.Z)(P.Z.name,e.hasUnreadStories&&P.Z.name_hasUnreadStory)},C?y("MyStory"):(0,d.OU)(y,e)),void 0!==I&&a.ZP.createElement(f.Z,{isOpen:S,transformOriginX:D,transformOriginY:$,positionX:L,positionY:B,style:F,className:(0,s.Z)("story-peer-context-menu",P.Z.contextMenu),autoClose:!0,withPortal:!0,onClose:k,onCloseAnimationEnd:T},C?a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement(v.Z,{onClick:_,icon:"play-story"},y("StoryList.Context.SavedStories")),a.ZP.createElement(v.Z,{onClick:H,icon:"archive"},y("StoryList.Context.ArchivedStories"))):a.ZP.createElement(a.ZP.Fragment,null,!w&&a.ZP.createElement(v.Z,{onClick:z,icon:"message"},y("SendMessageTitle")),w?a.ZP.createElement(v.Z,{onClick:V,icon:"channel"},y("ChatList.ContextOpenChannel")):a.ZP.createElement(v.Z,{onClick:V,icon:"user"},y("StoryList.Context.ViewProfile")),a.ZP.createElement(v.Z,{onClick:W,icon:t?"unarchive":"archive"},y(t?"StoryList.Context.Unarchive":"StoryList.Context.Archive")))))})),y=(0,a.X$)((0,o.c$)(((e,{isArchived:t})=>{const{orderedPeerIds:{active:n,archived:a}}=e.stories;return{orderedPeerIds:t?a:n,usersById:e.users.byId,chatsById:e.chats.byId}}))((function({isArchived:e,className:t,orderedPeerIds:n,usersById:o,chatsById:l,isClosing:d}){const m=(0,c.Z)(),u=(0,s.Z)(P.Z.root,!n.length&&P.Z.hidden,d&&P.Z.closing,t,"no-scrollbar"),h=(0,a.sO)(null);return(0,r.Z)(h,(0,i.W7)()),a.ZP.createElement("div",{ref:h,id:"StoryRibbon",className:u,dir:m.isRtl?"rtl":void 0},n.map((t=>{const n=o[t]||l[t];if(n)return a.ZP.createElement(E,{key:t,peer:n,isArchived:e})})))})))},85194:(e,t,n)=>{n.d(t,{Z:()=>Z});var a=n(60748),o=n(33555),s=n(83716),i=n(7054),r=n(46752),c=n(32136),l=n(18674),d=n(59107),m=n(31212),u=n(19156),h=n(70172),p=n(4710);const Z=(0,a.X$)((0,o.c$)(((e,{isArchived:t})=>{const{orderedPeerIds:{archived:n,active:a},byPeerId:o}=e.stories,{storyViewer:{isRibbonShown:s,isArchivedRibbonShown:r}}=(0,i.jUK)(e),c=(0,i.nd)(e),l=(0,i.$Yd)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:t?n:a,isShown:t?!r:!s,isForumPanelOpen:c,withAnimation:l,usersById:e.users.byId,chatsById:e.chats.byId,peerStories:o}}))((function({currentUserId:e,orderedPeerIds:t,usersById:n,chatsById:i,canShow:Z,isShown:g,isForumPanelOpen:f,isArchived:v,withAnimation:P,peerStories:E}){const{toggleStoryRibbon:y}=(0,o.Sv)(),b=(0,d.Z)(),C=(0,a.Ye)((()=>1===t.length?[n[t[0]]||i[t[0]]]:t.map((e=>n[e]||i[e])).filter((t=>t&&t.id!==e)).slice(0,s.Ob7).reverse()),[e,t,n,i]),w=(0,a.Ye)((()=>C?.length?C.reduce(((e,t)=>{const n=E[t.id];if(!n)return e;const a=n.orderedIds.some((e=>{const t=n.byId[e];if(!t||!("isForCloseFriends"in t))return!1;const a=n.lastReadId&&t.id<=n.lastReadId;return t.isForCloseFriends&&!a}));return e[t.id]=a,e}),{}):{}),[E,C]),S=(0,a.Ye)((()=>t.slice(0,5)),[t]);(0,u.Z)(S);const I=Z&&g,{shouldRender:N,transitionClassNames:M}=(0,m.Z)(I,void 0,void 0,"slow");if((0,a.d4)((()=>{P&&!f&&(I?((0,l.YW)(c.zn+s.fK3),(0,c.V$)(v)):((0,l.YW)(c.zn+s.fK3),(0,c.DO)(v)))}),[v,I,P,f]),N)return a.ZP.createElement("button",{type:"button",id:"StoryToggler",className:(0,r.Z)(p.Z.root,M),"aria-label":b("Chat.Context.Peer.OpenStory"),onClick:()=>y({isShown:!0,isArchived:v}),dir:b.isRtl?"rtl":void 0},C.map((e=>a.ZP.createElement(h.Z,{key:e.id,peer:e,size:"tiny",className:p.Z.avatar,withStorySolid:!0,forceFriendStorySolid:w[e.id]}))))})))},32136:(e,t,n)=>{n.d(t,{DO:()=>g,V$:()=>f,zn:()=>d});var a=n(83716),o=n(57710),s=n(9933),i=n(3858),r=n(74399),c=n(41372),l=n(4710);const d=250,m=.25*r.Gw,u=11,h=.1875*r.Gw,p=.125*r.Gw,Z=new Set;function g(e){C();const{container:t,toggler:n,leftMainHeader:i,ribbonPeers:r,toggleAvatars:c}=v(e);if(!(n&&c&&r&&t&&i))return;const{bottom:p,right:g}=i.getBoundingClientRect(),f=p+m,w=c[0],S=c[c.length-1],I=E(w);Array.from(r).reverse().forEach(((e,i,{length:r})=>{const c=E(e);if(!c)return;const m=c===I;let p=y(n,c),v=u+i+1;if(p||(p=i===r-1?S:w,v=u),!p)return;let{top:C,left:N,width:M}=p.getBoundingClientRect();const{left:k,width:T}=e.getBoundingClientRect();if(k>g)return;N-=h,M+=2*h;const x=N-k,A=C-f,R=M/T;C-=h;const O=k-N+2*h,L=f-C+h,B=T/(M+2*h);(0,o.WM)((()=>{if(!p)return;const n=P(e);let i;v>u?(i=P(p),m&&i.classList.add(l.Z.ghostLast)):n.classList.add(l.Z.ghostAnimateName),(0,s.Zs)(n,{top:`${f}px`,left:`${k}px`,zIndex:`${v}`,opacity:i?"0":"",transform:`translate3d(${x}px, ${A}px, 0) scale(${R})`}),i&&(0,s.Zs)(i,{top:`${C}px`,left:`${N}px`,zIndex:`${v}`}),t.appendChild(n),i&&t.appendChild(i),p.classList.add("animating"),e.classList.add("animating"),(0,o.WM)((()=>{(0,s.Zs)(n,{opacity:"",transform:""}),i?(0,s.Zs)(i,{opacity:"0",transform:`translate3d(${O}px, ${L}px, 0) scale(${B})`}):n.classList.add(l.Z.ghostRevealName);const r=b((()=>{(0,o.WM)((()=>{t.contains(n)&&t.removeChild(n),i&&t.contains(i)&&t.removeChild(i),p?.classList.remove("animating"),e.classList.remove("animating")}))}),d+a.fK3);Z.add(r)}))}))}))}function f(e){C();const{container:t,toggler:n,toggleAvatars:i,ribbonPeers:r,leftMainHeader:c}=v(e);if(!(n&&i&&r&&t&&c))return;const{right:m}=c.getBoundingClientRect(),g=i[0],f=i[i.length-1],w=E(g);Array.from(r).reverse().forEach(((e,i,{length:r})=>{const c=E(e);if(!c)return;const v=c===w;let C=y(n,c),S=u+i+1;if(C||(C=i===r-1?f:g,S=u),!C)return;const{top:I,left:N,width:M}=e.getBoundingClientRect();let{left:k,width:T,top:x}=C.getBoundingClientRect();if(N>m)return;k-=h,T+=2*h;const A=k-N,R=x-I-p,O=T/M;x-=h;const L=N-k+2*h,B=I-x+h,D=M/(T+2*h);(0,o.WM)((()=>{const n=P(e);let i;S>u?(i=P(C),v&&i.classList.add(l.Z.ghostLast)):n.classList.add(l.Z.ghostAnimateName,l.Z.ghostRevealName),(0,s.Zs)(n,{top:`${I}px`,left:`${N}px`,width:`${M}px`,zIndex:`${S}`}),i&&(0,s.Zs)(i,{top:`${x}px`,left:`${k}px`,zIndex:`${S}`,opacity:"0",transform:`translate3d(${L}px, ${B}px, 0) scale(${D})`}),e.classList.add("animating"),C.classList.add("animating"),t.appendChild(n),i&&t.appendChild(i),(0,o.WM)((()=>{(0,s.Zs)(n,{opacity:i?"0":"",transform:`translate3d(${A}px, ${R}px, 0) scale(${O})`}),i?(0,s.Zs)(i,{opacity:"",transform:""}):n.classList.remove(l.Z.ghostRevealName);const r=b((()=>{(0,o.WM)((()=>{t.contains(n)&&t.removeChild(n),i&&t.contains(i)&&t.removeChild(i),e.classList.remove("animating"),C.classList.remove("animating")}))}),d+a.fK3);Z.add(r)}))}))}))}function v(e){let t=document.getElementById("LeftColumn");if(t&&e&&(t=t.querySelector(".ArchivedChats")),!t)return{};const n=t.querySelector("#StoryToggler"),a=t.querySelector("#StoryRibbon"),o=t.querySelector(".left-header"),s=a?.querySelectorAll(`.${c.Z.peer}`),i=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:o,ribbonPeers:s,toggleAvatars:i}}function P(e){const t=e.cloneNode(!0);t.classList.add(l.Z.ghost),t.classList.remove("animating"),t.draggable=!1,t.oncontextmenu=i.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(){Z.forEach((e=>e())),Z.clear()}},29497:(e,t,n)=>{n.d(t,{M:()=>a,X:()=>o});const a="video/mp4; codecs=hvc1.1.6.L63.00",o="video/mp4; codecs=avc1.64001E"},19156:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(60748),o=n(33555),s=n(59187),i=n(41765),r=n(7054),c=n(36560),l=n(71394),d=n(40647),m=n(80793),u=n(69118),h=n(29497),p=n(87712);const Z={},g=(0,u.wO)(1e3),f=function(e,t){(0,a.d4)((()=>{if(void 0===e)return;(Array.isArray(e)?e:[e]).forEach((e=>{const n=t||(0,o.Rd)().stories.byPeerId[e]?.orderedIds?.[0];n&&(async e=>{await g,e.forEach((({hash:e,format:t,isStream:n})=>{n?async function(e){const t=(0,m.z)((0,d.Oj)(e));let n=0;for await(const e of t)if(n+=e.byteLength,n>=2097152)break}(e):d.he(e,t).then((e=>{e&&(t===s.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.disableRemotePlayback=!0,n.style.display="none",t.appendChild(n),n.load(),setTimeout((()=>{(0,c.Z)(n),t.removeChild(n)}),1e3)}(e),t===s.IU.BlobUrl&&(0,l.pt)(e))}))}))})(function(e,t){const n=(0,r.nST)((0,o.Rd)(),e);if(!n||!n.orderedIds?.length)return[];const a=function(e,t,n){const a=e.indexOf(t),o=Math.max(a-5,0),s=Math.min(a+5,e.length);return e.slice(o,s)}(n.orderedIds,t),c=[];return a.forEach((t=>{if(Z[e]?.has(t))return;const a=n.byId[t];if(!a||!("content"in a))return;const o=Boolean(a.content.video);c.push({hash:(0,i.Cc)(a,"full"),format:o?s.IU.Progressive:s.IU.BlobUrl,isStream:o&&(0,p.U)(h.M)}),c.push({hash:(0,i.Cc)(a),format:s.IU.BlobUrl}),a.content.altVideo&&c.push({hash:(0,i.Cc)(a,"full",!0),format:s.IU.Progressive}),Z[e]=(Z[e]||new Set).add(t)})),c}(e,n))}))}),[t,e])}},42175:(e,t,n)=>{n.d(t,{Z:()=>E});var a=n(60748),o=n(33555),s=n(83716),i=n(57710),r=n(46752),c=n(80036),l=n(22418),d=n(41765),m=n(74399),u=n(274),h=n(25190),p=n(78722),Z=n(36368);const g="pruw1nLm",f=(0,a.X$)((({story:e,mediaArea:t,index:n,className:s,style:i,isPreview:l})=>{const{sendStoryReaction:g}=(0,o.Sv)(),f=(0,a.sO)(null),[v,P]=(0,a.eJ)(1.5*m.Gw),{peerId:E,id:y,views:b}=e,{reactions:C}=b||{},{reaction:w,isDark:S,isFlipped:I}=t,N=!(0,d.YC)(E),M=`${(0,d.hl)(E,y)}-${n}-${l?"preview":"viewer"}`,k=(0,a.Ye)((()=>C?.find((e=>(0,d.Hl)(e.reaction,w)))?.count),[w,C]),T=!l&&Boolean(k)&&N,x=(0,h.Z)((()=>{if(!f.current)return;const e=f.current.clientHeight;P(Math.round(.6*e))}));(0,u.Z)((([e])=>{Boolean(k)!==Boolean(e)&&x()}),[k]),(0,p.Z)(f,x);const A=(0,h.Z)((()=>{g({peerId:E,storyId:y,containerId:M,reaction:w})}));return a.ZP.createElement("div",{ref:f,className:(0,r.Z)("WQ5DA3P_",S&&"eic2vQ8c",s),style:(0,c.Z)(i,`--custom-emoji-size: ${v}px`),onClick:A},a.ZP.createElement("div",{className:(0,r.Z)("j4MKFabm",I&&"furSXGdL")}),Boolean(v)&&a.ZP.createElement(Z.Z,{className:(0,r.Z)("Et3MvYmN",T&&"mFTLUHm2"),reaction:w,containerId:M,size:v,effectSize:4*v,shouldPause:l,shouldLoop:!l}),T&&a.ZP.createElement("span",{className:"Tr8mYyDk"},k))})),v=9/16;function P(e){const{x:t,y:n,width:a,height:o,rotation:s}=e.coordinates;return(0,c.Z)(`left: ${t}%`,`top: ${n}%`,`width: ${a}%`,`height: ${o}%`,`transform: rotate(${s}deg) translate(-50%, -50%)`)}const E=(0,a.X$)((({story:e,isActive:t,className:n})=>{const{openMapModal:c,focusMessage:d,closeStoryViewer:m}=(0,o.Sv)(),u=(0,a.sO)(null),h=(0,l.Z)();(0,a.d4)((()=>{if(!u.current||!t)return;const e=u.current;if(h.width>s.l35)return void(0,i.WM)((()=>{e.style.removeProperty("--media-width"),e.style.removeProperty("--media-height")}));const n=h.width/h.height,a=n<v?e.clientHeight*v:e.clientWidth,o=n<v?e.clientHeight:e.clientWidth/v;(0,i.WM)((()=>{e.style.setProperty("--media-width",`${a}px`),e.style.setProperty("--media-height",`${o}px`)}))}),[t,h]);const p=e.mediaAreas;return a.ZP.createElement("div",{className:(0,r.Z)("RXAMu4VD",!t&&"_5HkplWee",n),ref:u},p?.map(((n,o)=>{switch(n.type){case"geoPoint":case"venue":case"channelPost":{const e=t&&("geoPoint"===n.type||"venue"===n.type);return a.ZP.createElement("div",{className:(0,r.Z)(g,e&&"xFjJpeOA"),style:P(n),onClick:()=>(e=>{switch(e.type){case"geoPoint":case"venue":c({geoPoint:e.geo});break;case"channelPost":d({chatId:e.channelId,messageId:e.messageId}),m()}})(n)})}case"suggestedReaction":return a.ZP.createElement(f,{key:`${n.type}-${o}`,story:e,mediaArea:n,index:o,isPreview:!t,className:g,style:P(n)});default:return}})))}))},13617:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(60748),o=n(33555),s=n(97184),i=n(59107),r=n(25190);const c=8e3;function l(e,t,n){const{showNotification:l}=(0,o.Sv)(),d=(0,i.Z)(),[m,u]=(0,a.eJ)(!1),h=(0,r.Z)((()=>{u(!0),t||l({message:s.q$?d("Video.Unsupported.Mobile"):d("Video.Unsupported.Desktop"),duration:c})})),p=(0,r.Z)((e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||h())})),Z=(0,r.Z)((e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||h()}));return(0,a.d4)((()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",p),t.addEventListener("canplay",Z),()=>{t.removeEventListener("error",p),t.removeEventListener("canplay",Z)}):void 0}),[n,e]),m}},13995:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(60748),o=n(33555),s=n(41765),i=n(7054),r=n(69118);const c=36e5,l=new Map;let d=new Set;const m=(0,r.P2)((()=>{const e=Array.from(d),t=e.slice(0,100),n=e.slice(101);(0,o.Sv)().loadStoriesMaxIds({peerIds:t}),t.forEach((e=>l.set(e,Date.now()))),d=new Set(n),d.size&&m()}),500);function u(e){const t=(0,a.Ye)((()=>{const t=(0,o.Rd)();return e?.map((e=>(0,i.RGZ)(t,e))).filter(Boolean)}),[e]),n=(0,a.Ye)((()=>{const e=(0,o.Rd)();return t?.filter((t=>{const n=l.get(t.id)||0;if(Date.now()-n<c)return!1;if((0,s.YC)(t.id)){const n=t,a=(0,i.ssc)(e,n.id),o=a&&"userStatusEmpty"!==a.type;return!n.isContact&&!n.isSelf&&!(0,s.cS)(n)&&!t.isSupport&&o}{const e=t;return(0,s.eA)(e)&&!e.isRestricted}})).map((e=>e.id))}),[t]);(0,a.d4)((()=>{n?.length&&(n.forEach((e=>d.add(e))),m())}),[n])}},53455:(e,t,n)=>{n.d(t,{Yy:()=>i,ZP:()=>h,fi:()=>s,vb:()=>l});var a=n(60782),o=n(91090);const s=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],i=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],r=["includedChatIds","bots","channels","groups","contacts","nonContacts"],c=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function l(e,t,n){let o=[],s=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:(0,a.ei)(e.folder,r);o=t||[],s=Object.keys(i).filter((e=>Boolean(i[e])))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:(0,a.ei)(e.folder,c);o=t||[],s=Object.keys(i).filter((e=>Boolean(i[e])))}return{selectedChatIds:o,selectedChatTypes:s}}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 m={mode:"create",chatFilter:"",folder:{title:"",includedChatIds:[],excludedChatIds:[]}},u=(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,a.ei)(e.folder,r)};case"editExcludeFilters":return{...e,excludeFilters:(0,a.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,a.CE)(e.folder,r),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,a.CE)(e.folder,c),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...a}=t.payload;return{mode:"edit",folderId:e,folder:a,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"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 m;default:return e}},h=()=>(0,o.Z)(u,m)},49488:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(25190);const s=function(e,t){const n=(0,o.Z)(e);(0,a.d4)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>n()),t);return()=>clearTimeout(e)}),[t])}},11309:(e,t,n)=>{n.d(t,{CH:()=>i,Vr:()=>l,WR:()=>r,iD:()=>c});var a=n(67360),o=n(71790),s=n(3927);function i(e,t,n,a=!1){return(0,s.Z)((t=>{t(e())}),t,n,a)}function r(e,t,n=!1){const a=i((()=>e()),[e],t,n);return(0,o.Z)(a,[a,e],!0)}function c(e,t,n,o=!1,s=!1){return(0,a.Z)((t=>{t(e())}),t,n,o,s)}function l(e,t,n=!1,a=!1){const s=c((()=>e()),[e],t,n,a);return(0,o.Z)(s,[s,e],!0)}},23186:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(60748),o=n(33555),s=n(83716),i=n(7054),r=n(10396),c=n(64532),l=n(85266),d=n(274),m=n(25190),u=n(34446);const h=(e,t,n,h,p,Z,g,f=!1,v,P,E=!1,y=!1,b,C=!1,w=!1)=>{const S=(0,a.sO)(null),[I,N]=(0,a.eJ)(!1);let M=I;const[k,T]=(0,a.eJ)(0),x=(0,m.Z)((()=>{N(!1),P&&P()}));(0,u.Z)((()=>{if(!e)return;S.current=(0,r.z2)(e,n,((e,a)=>{if(!w){switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:a,toggleMuted:r,proxy:l}=S.current;N(!0),"oneTimeVoice"!==n&&(0,c.N)(Z,function(e){let t={};if(e&&e.current){const{play:n,pause:a,setCurrentTime:s,proxy:i,requestNextTrack:r,requestPreviousTrack:c,isFirst:l,isLast:d}=e.current;t={play:()=>{n(i.src)},pause:()=>{a()},stop:()=>{a(),s(0),(0,o.Sv)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;s(Math.max(i.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;s(Math.min(i.currentTime+t,i.duration))},seekTo:e=>{e.seekTime&&s(e.seekTime)}},d()||(t.nexttrack=()=>{r()}),l()||(t.previoustrack=()=>{c()})}return t}(S)),(0,c.pC)("playing");const{audioPlayer:d}=(0,i.jUK)((0,o.Rd)());e(d.volume),r(Boolean(d.isMuted));const m=l.duration&&Number.isFinite(l.duration)?l.duration:t;("voice"===n||m>s.J0S)&&a(d.playbackRate),(0,c.NS)({duration:l.duration||0,playbackRate:l.playbackRate,position:l.currentTime});break}case"onRateChange":{const{proxy:e}=S.current;(0,c.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":N(!1),(0,c.pC)("paused"),b?.();break;case"onTimeUpdate":{const{proxy:e}=S.current;if(C&&0===e.currentTime)break;const n=e.duration&&Number.isFinite(e.duration)?e.duration:t;y||T(e.currentTime/n);break}case"onEnded":(0,c.pC)("paused")}p?.[e]?.(a)}}),v,x);const{proxy:a}=S.current;I||a.paused||(N(!0),M=!0),g&&!w&&g(a)}),[e]),(0,a.d4)((()=>{I&&Z&&(0,c.Ym)(Z)}),[Z,I]);const{play:A,pause:R,setCurrentTime:O,proxy:L,destroy:B,setVolume:D,stop:$,isFirst:F,isLast:U,requestNextTrack:j,requestPreviousTrack:_,setPlaybackRate:H,toggleMuted:z}=S.current??{},V=(0,a.Ye)((()=>L?.duration&&Number.isFinite(L.duration)?L.duration:t),[L?.duration,t]);(0,a.d4)((()=>{L&&(C&&0===L.currentTime||!V||(0,l.z)(L)||y||T(L.currentTime/V))}),[V,k,L,y,C]),(0,a.d4)((()=>()=>{B?.(E)}),[B,E]),(0,d.Z)((([e,t])=>{e===f&&h===t||L?.src&&L?.paused||f&&h&&!I&&A?.(h)}),[f,h,I,A,L?.src,L?.paused,n]);const W=(0,m.Z)((()=>{h&&A?.(h)})),q=(0,m.Z)((()=>{I?R?.():W()})),Y=(0,m.Z)((e=>{O?.(e),V&&L&&T(L.currentTime/V)}));return{isPlaying:M,playProgress:k,playPause:q,pause:R,play:W,stop:$,setCurrentTime:Y,setVolume:D,audioProxy:L,duration:V,requestNextTrack:j,requestPreviousTrack:_,isFirst:F,isLast:U,setPlaybackRate:H,toggleMuted:z}}},15866:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(96264),s=n(57710),i=n(97184),r=n(34446);const c=2,l=2;function d(e,t=!1,n,d=c,m,u){const h=(0,a.sO)(null),p=(0,a.sO)();return(0,r.Z)((()=>{t||(p.current=!1)}),[e,t]),(0,a.d4)((()=>{const a=h.current;if(!e||!a||t||p.current)return;p.current=!0;const r=new Image,c=()=>{const e=m||r.width,t=u||r.height,n=a.getContext("2d",{alpha:!1});(0,s.WM)((()=>{a.width=e,a.height=t,i.vX&&(n.filter=`blur(${d}px)`),n.drawImage(r,2*-d,2*-d,e+4*d,t+4*d),i.vX||(0,o.Z)(n,0,0,e,t,d,l)}))};r.onload=()=>{n?(0,s.i$)(c):c()},r.src=e}),[e,t,u,m,d,n]),h}},41470:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(60748),o=n(33555),s=n(83716),i=n(41765),r=n(60782),c=n(97184),l=n(59107);const d=({chat:e,user:t,folderId:n,isPinned:d,isMuted:m,canChangeFolder:u,isSavedDialog:h,currentUserId:p,isPreview:Z,handleDelete:g,handleMute:f,handleChatFolderChange:v,handleReport:P},E=!1)=>{const y=(0,l.Z)(),{isSelf:b}=t||{},C=t?.id===s.awM,w=(0,a.Ye)((()=>{if(e)return h?y("Delete"):(0,i.YC)(e.id)?y("DeleteChatUser"):(0,i.cc)(e)?y("DeleteChat"):(0,i.eA)(e)?y("LeaveChannel"):y("Group.LeaveGroup")}),[e,h,y]);return(0,a.Ye)((()=>{if(!e||Z)return;const{toggleChatPinned:a,toggleSavedDialogPinned:s,updateChatMutedState:l,toggleChatArchived:S,toggleChatUnread:I,openChatInNewTab:N}=(0,o.Sv)(),M=c.IT&&{title:c.D$?"Open in new window":"Open in new tab",icon:"open-in-new-tab",handler:()=>{N(h?{chatId:p,threadId:e.id}:{chatId:e.id})}},k=()=>{h?s({id:e.id}):a({id:e.id,folderId:n})},T=d?{title:y("UnpinFromTop"),icon:"unpin",handler:k}:{title:y("PinToTop"),icon:"pin",handler:k},x={title:w,icon:"delete",destructive:!0,handler:g};if(h)return(0,r.oA)([M,T,x]);const A=u?{title:y("ChatList.Filter.AddToFolder"),icon:"folder",handler:v}:void 0,R=m?{title:y("ChatList.Unmute"),icon:"unmute",handler:()=>l({chatId:e.id,isMuted:!1})}:{title:`${y("ChatList.Mute")}...`,icon:"mute",handler:f};if(E)return(0,r.oA)([M,T,A,R]);const O=e.unreadCount||e.hasUnreadMark?{title:y("MarkAsRead"),icon:"readchats",handler:()=>I({id:e.id})}:void 0,L=e.unreadCount||e.hasUnreadMark||e.isForum?void 0:{title:y("MarkAsUnread"),icon:"unread",handler:()=>I({id:e.id})},B=(0,i.pE)(e)?{title:y("Unarchive"),icon:"unarchive",handler:()=>S({id:e.id})}:{title:y("Archive"),icon:"archive",handler:()=>S({id:e.id})},D=P&&((0,i.eA)(e)||(0,i.Bf)(e)||t&&!t.isSelf)?{title:y("ReportPeer.Report"),icon:"flag",handler:P}:void 0,$=void 0!==n;return(0,r.oA)([M,A,O,L,T,!b&&R,!b&&!C&&!$&&B,D,x])}),[e,t,u,y,v,d,E,m,p,g,f,P,n,b,C,h,w,Z])}},71790:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(33799),o=n(93862),s=n(70971),i=n(34446);const r=function(e,t,n=!1){const r=t?e:()=>e;t??(t=[e]);const[c,l]=(0,a.Z)(),d=(0,s.Y)(r);function m(){const e=d.current;n?e(l):l(e())}return(0,i.Z)(m,t),(0,o.b)(m,t),c}},86203:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(65326),s=n(93862),i=n(70971),r=n(34446);const c=function(e,t,n=!1){const c=t?e:()=>e();t??(t=[e]);const l=(0,a.sO)(),d=(0,o.Z)(),m=(0,i.Y)(c);function u(e=!1){const t=m.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,r.Z)((()=>{u(!0)}),t),(0,s.b)(u,t),l.current}},75790:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(33555);function s(e,t,n,s,i){const{loadMessage:r}=(0,o.Sv)();(0,a.d4)((()=>{i||t&&!n&&r({chatId:e,messageId:t,replyOriginForId:s})}),[i,e,n,t,s])}},31526:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(33555),s=n(69118);const i=function(e,t,n){const{loadPeerStoriesByIds:i}=(0,o.Sv)(),r=(0,a.Ye)((()=>{const n=(0,s.P2)(i,200,!0);return()=>{n({peerId:e,storyIds:[t]})}}),[t,e]);(0,a.d4)((()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&r()}),[r,n,t,e])}},95616:(e,t,n)=>{n.d(t,{d7:()=>i,mE:()=>c,yi:()=>r});var a=n(60748),o=n(16974),s=n(65326);function i(e){const t=(0,s.Z)();return(0,a.d4)((()=>(0,o.M2)(e,t)),[e,t]),(0,o.gO)(e)}function r(){const e=(0,s.Z)();return(0,a.d4)((()=>(0,o.O6)(e)),[e]),(0,o.wC)()}function c(){const e=(0,s.Z)();return(0,a.d4)((()=>(0,o.r_)(e)),[e]),(0,o.Yz)()}},54416:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(65326),s=n(25190),i=n(34446);function r(e=!1){const t=(0,a.sO)(e),n=(0,a.sO)(!1),r=(0,o.Z)();(0,i.Z)((()=>{e&&(t.current=!0)}),[e]);const c=(0,s.Z)((()=>{t.current=!1,n.current=!1,r()})),l=(0,s.Z)((()=>{n.current=!0,r()}));return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:c,handleForumPanelAnimationStart:l}}},69156:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(33799);function s(e){const[t,n]=(0,o.Z)();return(0,a.d4)((()=>{function t(){const t=window.getSelection();if(!t?.rangeCount)return;const a=t.getRangeAt(0);if(!a)return;if(!document.querySelector(e))return;const{commonAncestorContainer:o}=a;(o instanceof Element?o:o.parentElement).closest(e)&&n(a)}return document.addEventListener("selectionchange",t),()=>document.removeEventListener("selectionchange",t)}),[e,n]),t}},78781:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(60748);const o=(e,t,n=!1)=>{(0,a.d4)((()=>{if(t)return;const a=e.current;function o(e){e.deltaX||(a.scrollLeft+=e.deltaY/4,n&&e.preventDefault())}return a.addEventListener("wheel",o,{passive:!n}),()=>{a.removeEventListener("wheel",o)}}),[e,t,n])}},73541:(e,t,n)=>{n.d(t,{y:()=>r});var a=n(60748),o=n(16063);const s=new Set(["INPUT","TEXTAREA","SELECT"]),i=(0,o._)();function r(e){(0,a.d4)((()=>{if(!e)return;const t=Object.entries(e);return i.addCallback((function(e){(function(e){return!(e.target instanceof HTMLElement)||!s.has(e.target.tagName)})(e)&&t.forEach((([t,n])=>{(function(e){return t=>function(e,t){const{alt:n,ctrl:a,meta:o,mod:s,shift:i,key:r}=e,{altKey:c,ctrlKey:l,metaKey:d,shiftKey:m,key:u}=t;if(n!==c)return!1;if(s){if(!l&&!d)return!1}else{if(a!==l)return!1;if(o!==d)return!1}return i===m&&Boolean(r&&(u.toLowerCase()===r.toLowerCase()||t.code.replace("Key","").toLowerCase()===r.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")},a=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find((e=>!a.includes(e)))}}(e),t)})(t)(e)&&n(e)}))}))}),[e])}document.documentElement.addEventListener("keydown",i.runCallbacks)},12515:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(57710),s=n(42797);const i=500,r=300;function c(e,t,n){const{isMobile:c}=(0,s.ZP)();(0,a.d4)((()=>{t?c||setTimeout((()=>{(0,o.WM)((()=>{e.current?.isConnected&&e.current.focus()}))}),i):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,r))}),[e,c,t,n])}},6701:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(60748),o=n(59187),s=n(40647),i=n(69118),r=n(97184),c=n(65326),l=n(27704);const d=.75,m=1500,u=500;function h(e,t=!1,n=o.IU.BlobUrl,h,p=!1){const Z=e?s.UV(e):void 0,g=r.I_&&n===o.IU.Progressive,f=(0,c.Z)(),v=(0,l.Z)(),[P,E]=(0,a.eJ)(Z&&!g?1:0),y=(0,a.sO)(),b=(0,a.Ye)((()=>(0,i.P2)((e=>{y.current&&(!h||Date.now()-y.current>h)&&E(e)}),u,!0)),[h]);return(0,a.d4)((()=>{!t&&e&&(Z?g&&setTimeout((()=>{E(d)}),m):(E(0),y.current&&s.cC(b),y.current=Date.now(),s.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,Z,n,f,g,h,b,p,v]),(0,a.d4)((()=>{t&&y.current&&(s.cC(b),E(0),y.current=void 0)}),[b,t]),(0,a.d4)((()=>()=>{e&&s.Iq(e,v)}),[v,e]),{mediaData:Z,loadProgress:P}}},56503:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(60748),o=n(97184),s=n(25190);const i=250;let r;function c(e,t,n=i,c=!1){const l=(0,a.sO)(!1),d=(0,s.Z)((()=>{l.current=!0}));return(0,a.d4)((()=>{r&&(clearTimeout(r),r=void 0),!e||o.$b||c||(r=window.setTimeout((()=>{l.current||t()}),2*n))}),[c,e,n,t]),[(0,s.Z)((()=>{l.current=!0})),(0,s.Z)((()=>{l.current=!1,r&&(clearTimeout(r),r=void 0),r=window.setTimeout((()=>{l.current||t()}),n)})),d]}},52678:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(65326),s=n(87204),i=n(34446);function r(e,t){const n=(0,s.Z)(e,!0),r=(0,a.sO)(),c=(0,o.Z)(),l=null!=e,d=null!=n;return l&&r.current&&(clearTimeout(r.current),r.current=void 0),(0,i.Z)((()=>{t&&!l&&d&&!r.current&&(r.current=window.setTimeout((()=>{r.current=void 0,c()}),t))}),[t,c,l,d]),r.current&&t&&!l?n:e}},91090:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(65326);function s(e,t){const n=(0,o.Z)(),s=(0,a.sO)(e),i=(0,a.sO)(t),r=(0,a.I4)((e=>(i.current=s.current(i.current,e),n(),i.current)),[]);return[i.current,r]}},88957:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(67360);function o(e,t,n,o=[]){return(0,a.Z)((e=>{e()}),o,e,t,n)}},33057:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(60748),o=n(83716),s=n(33323),i=n(82267),r=n(59107),c=n(25190),l=n(99203),d=n(48778);const m=e=>{const{isOpen:t}=e,n=(0,d.Z)(l.gl.Extra,"CalendarModal",!t);return n?a.ZP.createElement(n,e):void 0},u=(e,t,n)=>{const l=(0,r.Z)(),[d,u]=(0,a.eJ)(),h=(0,c.Z)(((e,t=!1)=>{const n=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:(0,i.Qj)());d?.(n),u(void 0)})),p=(0,c.Z)((()=>{h(new Date(1e3*o.t4X),!0)})),Z=(0,c.Z)((()=>{u(void 0),t?.()})),g=(0,c.Z)((e=>{u((()=>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),[g,a.ZP.createElement(m,{isOpen:Boolean(d),withTimePicker:!0,selectedAt:f.getTime(),maxAt:(0,s._F)(v),isFutureMode:!0,secondButtonLabel:e?l("Schedule.SendWhenOnline"):void 0,onClose:Z,onSubmit:h,onSecondButtonClick:e?p:void 0})]}},78961:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(65116),o=n(33555),s=n(19369),i=n(7792);const r=new Map;(0,a.ll)((e=>{for(const[t,{setter:n}]of r)n(t(e))}));const c=function(e){let t=r.get(e);if(!t){const[n,a]=(0,s.gQ)(e((0,o.Rd)()));t={clientsCount:0,getter:n,setter:a},r.set(e,t)}return(0,i.Z)((()=>(t.clientsCount++,()=>{t.clientsCount--,t.clientsCount||r.delete(e)}))),t.getter}},56389:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(60748),o=n(33555),s=n(83716),i=n(69118);const r=(e,t)=>(0,a.Ye)((()=>(0,i.P2)((n=>{e&&t&&(0,o.Sv)().sendMessageAction({chatId:e,threadId:t,action:n})}),s.o_S)),[e,t])},33799:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60748),o=n(19369);function s(e){const t=(0,a.sO)();return t.current??(t.current=(0,o.gQ)(e)),t.current}},93862:(e,t,n)=>{n.d(t,{b:()=>i});var a=n(60748),o=n(19369),s=n(7792);function i(e,t){const n=(0,a.sO)(!0);n.current&&(n.current=!1,t?.forEach((t=>{(0,o.$Z)(t)&&t.subscribe(e)}))),(0,s.Z)((()=>()=>{(0,o.Dc)(e)}))}},87712:(e,t,n)=>{n.d(t,{F:()=>m,U:()=>u});var a=n(60748),o=n(83716),s=n(57710),i=n(9933),r=n(36560),c=n(80793),l=n(97184);const d=100;function m(e,t,n){return(0,a.d4)((()=>{if(!t||!e.current)return;const a=Z(),o=e.current;if(!l.s$||!n||!a?.isTypeSupported(n))return;const m=new a;function u(){if(!t||!n)return;const e=m.addSourceBuffer(n),a=(0,c.z)(t);e.addEventListener("updateend",(function(){a.next().then((({value:t,done:n})=>{"open"===m.readyState&&(n?p(m):h(e,t))}))})),a.next().then((({value:t,done:n})=>{n||"open"!==m.readyState||((0,s.WM)((()=>{o.style.display="block",setTimeout((()=>{(0,s.WM)((()=>{(0,i.Zs)(o,{opacity:"1"})}))}),d)})),h(e,t))}))}return m.addEventListener("sourceopen",u,{once:!0}),(0,s.WM)((()=>{(0,i.Zs)(o,{display:"none",opacity:"0"}),o.src=URL.createObjectURL(m)})),()=>{(0,s.WM)((()=>{const e=o.src;(0,r.Z)(o),m.removeEventListener("sourceopen",u),"open"===m.readyState&&p(m),URL.revokeObjectURL(e)}))}}),[n,t,e]),u(n)}function u(e){return!(!l.s$||!e)&&Boolean(Z()?.isTypeSupported(e))}function h(e,t){try{e.appendBuffer(t)}catch(e){o.eMD&&console.warn("[Stream] failed to append buffer",e)}}function p(e){try{e.endOfStream()}catch(e){o.eMD&&console.warn("[Stream] failed to end stream",e)}}function Z(){return"ManagedMediaSource"in window?ManagedMediaSource:"MediaSource"in window?MediaSource:void 0}},20797:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(60748),o=n(69118),s=n(25190);function i(e){const t=(0,s.Z)(e);(0,a.d4)((()=>(0,o.Gq)(t)),[t])}},74095:(e,t,n)=>{n.d(t,{K:()=>i});var a=n(69995);function o(e,t,n){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,"string");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t))?a:String(a))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class s{constructor(e,t,n){this.target=e,this.onUpdate=t,this.channel=n,o(this,"requestStates",new Map),o(this,"requestStatesByCallback",new Map)}destroy(){}init(...e){this.postMessage({type:"init",args:e})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,o=(0,a.Z)(),s={type:"callMethod",messageId:o,...e},i={messageId:o},r=new Promise(((e,t)=>{Object.assign(i,{resolve:e,reject:t})}));if("function"==typeof s.args[s.args.length-1]){s.withCallback=!0;const e=s.args.pop();i.callback=e,n.set(e,i)}return t.set(o,i),r.catch((()=>{})).finally((()=>{t.delete(o),i.callback&&n.delete(i.callback)})),this.postMessage(s),r}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 i(e,t,n){const a=new s(e,t,n);function o({data:e}){a.onMessage(e)}return e.addEventListener("message",o),a.destroy=()=>{e.removeEventListener("message",o)},a}},8582:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(33555),o=n(57710),s=n(7054),i=n(9933);const r=300,c=new Map;function l(e,t,n=r){(0,s.FOo)((0,a.Rd)())||(n=0);const l="rtl"===e.getAttribute("dir"),{scrollLeft:d,offsetWidth:m,scrollWidth:u,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=u-(d+m);p=Math.min(p,e)}if(0===p)return Promise.resolve();h&&c.has(h)&&c.get(h)();const Z=d+p;return new Promise((t=>{(0,o.WM)((()=>{if(0===n)return e.scrollLeft=Z,void t();let a=!1;const s=Math.random().toString();e.dataset.scrollId=s,c.set(s,(()=>{a=!0})),e.style.scrollSnapType="none";const r=Date.now();(0,i.jt)((()=>{if(a)return!1;const o=Math.min((Date.now()-r)/n,1),i=p*(1-function(e){return 1-(1-e)**3.5}(o));return e.scrollLeft=Math.round(Z-i),o>=1&&(e.style.scrollSnapType="",delete e.dataset.scrollId,c.delete(s),t()),o<1}),o.WM)}))}))}},81740:(e,t,n)=>{n.d(t,{Ni:()=>g,ZP:()=>h,wA:()=>p});var a=n(33555),o=n(91713),s=n(83716),i=n(57710),r=n(7054),c=n(9933),l=n(97184),d=n(18674);let m,u=!1;function h(...e){m=e.slice(0,8);const t=Z(...m);if(e[8])return t;(0,i.WM)(t)}function p(){u&&((0,c.vR)(),(0,i.i$)((()=>{(0,i.WM)(Z(...m))})))}function Z(e,t,n,h=0,p=s.V$q,Z,g,P){Z!==o.fo.Static&&(0,r.FOo)((0,a.Rd)())||(g=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,n=s.V$q,a){const{scrollTop:i}=e;if(void 0===a){const e=t-i;if(e<-n)return i+(e+n);if(e>n)return i+(e-n)}else{if(a===o.fo.Up)return t+n;if(a===o.fo.Down)return Math.max(0,t-n)}return i}(e,I,p,Z);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===g)return void(e.scrollTop=t);u=!0;const n=k<=s.xnK?f:v,a=g||s.bKs+k/s.V$q*(s.ckE-s.bKs),o=Date.now(),r=(0,d.YW)();(0,c.cK)((()=>{const s=Math.min((Date.now()-o)/a,1),i=M*(1-n(s)),c=Math.round(t-i);return e.scrollTop=c,u=s<1&&c!==t,u||(m=void 0,r()),u}),i.WM)}}function g(){return u}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:()=>g,z2:()=>f});var a=n(33555),o=n(91713),s=n(57710),i=n(7054),r=n(490),c=n(85266),l=n(74753),d=n(97184);const m=new Map;let u,h=[],p=[];function Z(e,t){const n=u&&m.get(u);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const s=v(e,(0,i.jUK)((0,a.Rd)()).audioPlayer.origin||o.Cr.Inline,t);if(!s)return;if(!m.has(s))return void(0,a.Sv)().openAudioPlayer((0,r.Ak)(E(s).messageKey));const c=m.get(s);c.onForcePlay&&c.onForcePlay(),u=s,c.audio.src&&(0,l.Z)(c.audio)}function g(){const e=u&&m.get(u);e&&e.audio.pause()}function f(e,t,n,g,f){if(!m.has(e)){const n=function(e,t,n,a){const o=new Audio;function s(t){return n=>{m.has(e)&&((0,c.z)(o)||m.get(e).handlers.forEach((e=>{e(t,n)})))}}return o.addEventListener("timeupdate",s("onTimeUpdate")),o.addEventListener("play",s("onPlay")),o.addEventListener("pause",s("onPause")),o.addEventListener("loadstart",s("onLoadStart")),o.addEventListener("loadeddata",s("onLoadedData")),o.addEventListener("playing",s("onPlaying")),o.addEventListener("ended",(()=>{m.has(e)&&((0,c.z)(o)||Z(e))})),{audio:o,type:t,proxy:new Proxy(o,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:a}}(e,t,g,f);m.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}=m.get(e);return C.push(n),{play(n){if(!P.paused)return;const s=u&&m.get(u);s&&u!==e&&(s.audio.pause(),s.audio.currentTime=0,(0,c.z)(s.audio)&&(s.audio.dataset.preventPlayAfterPatch="true"),s.onTrackChange&&s.onTrackChange()),u=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,i.jUK)((0,a.Rd)()).globalSearch.currentContent===o.nJ.Music)return;const{chatId:n}=(0,r.Ak)(E(t).messageKey),s=(0,i.Btg)((0,a.Rd)())?.chatId,c=e=>e.startsWith(`msg${n}`)||s&&e.startsWith(`msg${s}`);"audio"===e&&(p=p.filter(c)),"voice"===e&&(h=h.filter(c))}(t,e)},pause(){u===e&&P.pause()},stop(){if(u===e){const e=P.src;P.pause(),(0,s.Yq)((()=>{P.src="",P.src=e}))}},setCurrentTime(t){u===e&&(P.fastSeek?P.fastSeek(t):P.currentTime=t)},setVolume(t){u===e&&(P.volume=t,P.muted=!1)},setPlaybackRate(t){u===e&&(P.playbackRate=t)},toggleMuted(e){P.muted=void 0===e?!P.muted:e},proxy:b,requestNextTrack(){Z(e)},isLast:()=>!v(e,(0,i.jUK)((0,a.Rd)()).audioPlayer.origin),isFirst:()=>!v(e,(0,i.jUK)((0,a.Rd)()).audioPlayer.origin,!0),requestPreviousTrack(){Z(e,!0)},destroy(t=!1){const a=m.get(e);a&&(a.handlers=a.handlers.filter((e=>e!==n)),a.handlers.length||(a.audio.pause(),m.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))}(a,e),e===u&&(u=void 0)))}}}function v(e,t=o.Cr.Inline,n){const a=function(e){switch(e.type){case"audio":return p;case"voice":return h;default:return}}(m.get(e));if(!a)return;if(t===o.Cr.Search){const t=a.indexOf(e);if(t<0)return;return a[t+(n?-1:1)]}const{chatId:s}=(0,r.Ak)(E(e).messageKey),i=a.filter((e=>e.startsWith(`msg${s}`))),c=i.indexOf(e);if(c<0)return;let l=t===o.Cr.Inline?-1:1;return n&&(l*=-1),i[c+l]}function P(e){const t=(0,r.zf)(e);if(t)return`${t}-${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:a}=E(e),{date:o,messageKey:s}=E(t),i=o-n;return 0===i?s.localeCompare(a):i}},75851:(e,t,n)=>{n.d(t,{CO:()=>s,eb:()=>r,ix:()=>c,rZ:()=>l,uR:()=>d,wK:()=>o,xP:()=>i});var a=n(71394);function o(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function s(e){const t=e[0].toString(16),n=e[1].toString(16),a=e[2].toString(16);return(1==t.length?"0"+t:t)+(1==n.length?"0"+n:n)+(1==a.length?"0"+a:a)}function i([e,t,n]){e/=255,t/=255,n/=255;let a,o,s=Math.max(e,t,n),i=Math.min(e,t,n),r=s,c=s-i;if(o=0==s?0:c/s,s==i)a=0;else{switch(s){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return[a,o,r]}function r([e,t,n]){let a,o,s,i=Math.floor(6*e),r=6*e-i,c=n*(1-t),l=n*(1-r*t),d=n*(1-(1-r)*t);switch(i%6){case 0:a=n,o=d,s=c;break;case 1:a=l,o=n,s=c;break;case 2:a=c,o=n,s=d;break;case 3:a=c,o=l,s=n;break;case 4:a=d,o=c,s=n;break;case 5:a=n,o=c,s=l}return[Math.round(255*a),Math.round(255*o),Math.round(255*s)]}async function c(e){const t=[0,0,0];let n,o,s,i,r=-4,c=[0,0,0],l=0;const d=document.createElement("canvas"),m=d.getContext&&d.getContext("2d");if(!m)return t;const u=await(0,a.pt)(e);s=u.naturalHeight||u.offsetHeight||u.height,o=u.naturalWidth||u.offsetWidth||u.width,d.height=s,d.width=o,m.drawImage(u,0,0);try{n=m.getImageData(0,0,o,s)}catch(e){return t}for(i=n.data.length;(r+=20)<i;)0!==n.data[r+3]&&(++l,c[0]+=n.data[r],c[1]+=n.data[r+1],c[2]+=n.data[r+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,a]=e;return.2126*t+.7152*n+.0722*a}function d(e){let[t,n,a]=i(e);return n=Math.min(1,n+.05+.1*(1-n)),a=a>.5?Math.max(0,.65*a):Math.max(0,Math.min(1,1-.65*a)),`hsla(${360*t}, ${100*n}%, ${100*a}%, .4)`}},3570:(e,t,n)=>{function a(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>a})},6562:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(69118);const o=10,s=1e3;let i=[],r=!1;function c(e,t){i.push({url:e,filename:t}),r||(r=!0,setTimeout((async()=>{await async function(){let e=0;for(const t of i)l(t),e++,e===o&&(await(0,a.wO)(s),e=0);i=[]}(),r=!1}),s))}function l({url:e,filename:t}){const n=document.createElement("a");n.href=e,n.download=t;try{n.click()}catch(e){console.error(e)}}},9668:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(33681),o=n(15594);const s=new RegExp(`^(?:${a.Z.source})+$`,""),i=e=>{const t=(0,o.Z)(e).split("\n"),n=t.join("");if(n.length>800)return!1;if(!Boolean(n.match(s)))return!1;const i=t.map((e=>{let t=0;for(;a.Z.exec(e);)if(t++,t>100)return a.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}},65723:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(97184);function o(e,t,n){if(!t&&e===document.activeElement)return;const o=window.getSelection(),s=document.createRange(),i=e.lastChild||e;a.$b||n||i&&i.nodeValue?(s.selectNodeContents(n?e:i),s.collapse(!1),o.removeAllRanges(),o.addRange(s)):e.focus()}},60998:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(83716);const o=1;function s(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&i(e.focusNode,a.gnl);if(!t||0===t.childElementCount)return;const s=Array.from(t.children).reduce(((e,t)=>t.nodeType===o&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce(((e,t)=>e.concat(Number(t.dataset.messageId))),e):t.nodeType===o&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e),[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n||s.pop(),s}function i(e,t){return!(e.nodeType!==o||!e.classList.contains(t))||!!e.parentNode&&i(e.parentNode,t)}},93447:(e,t,n)=>{n.d(t,{j:()=>s,t:()=>i});var a=n(75851);const o=240;function s(e,t,n="image/png"){const a=e instanceof Blob?URL.createObjectURL(e):e,o=new Image;return new Promise((s=>{o.onload=()=>{r(o,o.width*t,o.height*t,n).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(s).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(a)}))},o.src=a}))}function i(e,t,n,a="image/png"){const o=e instanceof Blob?URL.createObjectURL(e):e,s=new Image;return new Promise((i=>{s.onload=()=>{r(s,t,n,a).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(i).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(o)}))},s.src=o}))}async function r(e,t,n,s="image/png"){if(!("createImageBitmap"in window))return c(e,t,n,void 0,s);try{const i=await window.createImageBitmap(e,{resizeWidth:t,resizeHeight:n,resizeQuality:"high"});if(i.height!==n||i.width!==t)throw new Error("Image bitmap resize not supported!");const r=await(0,a.ix)(e.src),c=(0,a.rZ)(r)<o?"#fff":"#000";return await new Promise((e=>{const t=document.createElement("canvas");t.width=i.width,t.height=i.height;const n=t.getContext("2d");n.fillStyle=c,n.fillRect(0,0,t.width,t.height);const a=t.getContext("bitmaprenderer");a?a.transferFromImageBitmap(i):n.drawImage(i,0,0),t.toBlob(e,s)}))}catch(a){return c(e,t,n,void 0,s)}}async function c(e,t,n,s=.5,i="image/png"){const r=document.createElement("canvas"),c=r.getContext("2d"),l=document.createElement("canvas"),d=l.getContext("2d");if(r.width=t,r.height=n,e.width*s>t){const n=1/s;let a={width:Math.floor(e.width*s),height:Math.floor(e.height*s)};for(l.width=a.width,l.height=a.height,d.drawImage(e,0,0,a.width,a.height);a.width*s>t;)a={width:Math.floor(a.width*s),height:Math.floor(a.height*s)},d.drawImage(l,0,0,a.width*n,a.height*n,0,0,a.width,a.height);c.drawImage(l,0,0,a.width,a.height,0,0,r.width,r.height)}else c.drawImage(e,0,0,r.width,r.height);const m=await(0,a.ix)(e.src),u=(0,a.rZ)(m)<o?"#fff":"#000";return c.fillStyle=u,c.globalCompositeOperation="destination-over",c.fillRect(0,0,r.width,r.height),new Promise((e=>{r.toBlob(e,i)}))}},55254:(e,t,n)=>{n.d(t,{P:()=>o});var a=n(43858);function o(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=a.Z.get();return t.top<=n&&t.top+t.height>=0}},91489:(e,t,n)=>{n.d(t,{Qw:()=>r,k4:()=>l,lZ:()=>c,zY:()=>i});const a={google:"https://maps.google.com/maps",bing:"https://bing.com/maps/default.aspx",osm:"https://www.openstreetmap.org",apple:"https://maps.apple.com"},o=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"})),s=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function i(e,t,n=15){const{lat:o,long:s}=t,i=a[e];switch(e){case"google":return`${i}/place/${o}+${s}/@${o},${s},${n}z`;case"bing":return`${i}?cp=${o}~${s}&lvl=${n}&sp=point.${o}_${s}`;case"apple":return`${i}?q=${o},${s}`;default:return`${i}/?mlat=${o}&mlon=${s}&zoom=${n}`}}function r(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?o.get(e)||o.get(e.split("/")[0])||s[(t=e,t.split("").reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)|0),0)%s.length)]:"#008df2";var t}},64532:(e,t,n)=>{n.d(t,{Ay:()=>r,N:()=>o,NS:()=>l,Of:()=>d,Ym:()=>s,pC:()=>c});const a={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function o(e,t){const{mediaSession:n}=window.navigator;n?(e&&s(e),t&&i(t)):console.warn("MediaSession API not supported in this browser")}function s(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=e??null)}function i(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...a,...e}).forEach((([e,n])=>{try{t.setActionHandler(e,n)}catch(e){}}))}function r(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,i(a),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function c(e="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({title:e,artist:t,album:n,artwork:a}){if("MediaMetadata"in window)return new window.MediaMetadata({title:e,artist:t,album:n,artwork:a})}},16580:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(60782);const o=new WeakMap;function s(e){return(...t)=>{const n=o.get(e);if(n&&(0,a.et)(n.lastArgs,t))return n.lastResult;const s=e(...t);return o.set(e,{lastArgs:t,lastResult:s}),s}}},89455:(e,t,n)=>{n.d(t,{ZP:()=>c,fu:()=>l,xe:()=>i});var a=n(59187),o=n(83716),s=n(97184);const i={B:a.Vv.Bold,STRONG:a.Vv.Bold,I:a.Vv.Italic,EM:a.Vv.Italic,INS:a.Vv.Underline,U:a.Vv.Underline,S:a.Vv.Strike,STRIKE:a.Vv.Strike,DEL:a.Vv.Strike,CODE:a.Vv.Code,PRE:a.Vv.Pre,BLOCKQUOTE:a.Vv.Blockquote},r=3;function c(e,t=!1,n=!1){const c=document.createElement("div");c.innerHTML=n?e:function(e){let t=e.slice(0);return t=t.replace(/&nbsp;/g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[`]{1}([^`\n]+)[`]{1}(?![^<]*<\/(code|pre)>)/g,"<code>$2</code>"),s.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="${a.Vv.Spoiler}">$2</span>`),t}(t?function(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${o.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 m=-c.innerText.indexOf(d[0]),u=0;const h=[];function p(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=function(e,t,n){const o=function(e){if(e instanceof HTMLElement&&e.dataset.entityType)return e.dataset.entityType;if(i[e.nodeName])return i[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.Vv.MentionName?a.Vv.MentionName:t.dataset.entityType===a.Vv.Url?a.Vv.Url:t.href.startsWith("mailto:")?a.Vv.Email:t.href.startsWith("tel:")?a.Vv.Phone:t.href!==t.textContent?a.Vv.TextUrl:a.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:"IMG"===e.nodeName&&e.dataset.documentId?a.Vv.CustomEmoji:void 0}(e);if(!o||!e.textContent)return{index:n,entity:void 0};const s=t.indexOf(e.textContent,n),r=s>=0?s:n,c=t.substring(0,r).length,{length:l}=t.substring(r,r+e.textContent.length);return o===a.Vv.TextUrl?{index:r,entity:{type:o,offset:c,length:l,url:e.href}}:o===a.Vv.MentionName?{index:r,entity:{type:o,offset:c,length:l,userId:e.dataset.userId}}:o===a.Vv.Pre?{index:r,entity:{type:o,offset:c,length:l,language:e.dataset.language}}:o===a.Vv.CustomEmoji?{index:r,entity:{type:o,offset:c,length:l,documentId:e.dataset.documentId}}:{index:r,entity:{type:o,offset:c,length:l}}}(e,d,m);if(n)m=t,h.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;m+=e.textContent.length}e.hasChildNodes()&&u<=r&&(u+=1,Array.from(e.childNodes).forEach(p))}return Array.from(c.childNodes).forEach((e=>{u=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||"")}))}},80793:(e,t,n)=>{n.d(t,{z:()=>d});var a=n(59187),o=n(92387);const s=262144,i=5242879,r=new Map,c=new Map,l=new Map;async function*d(e,t=0,n=s){const d=e.match(/fileSize=(\d+)/);let m;for(m=d?d&&Number(d[1]):c.get(e);;){if(m&&t>=m)return;let s=t+n-1;m&&s>m&&(s=m-1);const d=`${e}:${t}-${s}`;let u=r.get(d);if(!u){let n=l.get(d);n||(n=(0,o.t9)("downloadMedia",{mediaFormat:a.IU.Progressive,url:e,start:t,end:s}),l.set(d,n));const h=await n.finally((()=>{l.delete(d)}));if(!h?.arrayBuffer)return;h.fullSize&&!m&&(m=h.fullSize,c.set(e,h.fullSize)),u=h.arrayBuffer,s<=i&&r.set(d,h.arrayBuffer)}yield u,t=s+1}}},41098:(e,t,n)=>{n.d(t,{Mq:()=>r,dG:()=>c,gJ:()=>s,qK:()=>i,tx:()=>o});const a=document.createElement("div");function o(e){const t=window.getSelection();if(t?.getRangeAt&&t.rangeCount){const n=t.getRangeAt(0);n.deleteContents();const a=n.createContextualFragment(e),o=a.lastChild;n.insertNode(a),o?(n.setStartAfter(o),n.setEndAfter(o)):n.collapse(!1),t.removeAllRanges(),t.addRange(n)}}function s(e,t){if(!e)return"";const n=window.getSelection();if(!n||!n.rangeCount)return e.innerHTML;const o=n.getRangeAt(0).cloneRange();return o.intersectsNode(e)?t||e.contains(o.commonAncestorContainer)?(o.collapse(!0),o.setStart(e,0),a.innerHTML="",a.appendChild(o.cloneContents()),a.innerHTML):"":e.innerHTML}function i(e){let t=0;const n=window.getSelection();if(!n||0===n.rangeCount)return t;const a=n.getRangeAt(0),o=a.cloneRange();return o.selectNodeContents(e),o.setEnd(a.endContainer,a.endOffset),t=o.toString().length,t}function r(e,t){for(const n of e.childNodes)if(n.nodeType===Node.TEXT_NODE){if(n.length>=t){const e=document.createRange(),a=window.getSelection();return e.setStart(n,t),e.collapse(!0),a.removeAllRanges(),a.addRange(e),-1}t-="length"in n?n.length:0}else if(-1===(t=r(n,t)))return-1;return t}function c(){const e=window.getSelection();e?.removeAllRanges()}},85655:(e,t,n)=>{let a;function o(e="*",t,n=!1){a||(a=document.createElement("input"),a.setAttribute("type","file")),a.setAttribute("accept",e),n?a.removeAttribute("multiple"):a.setAttribute("multiple","multiple"),a.onchange=null,a.value="",a.onchange=t,a.click()}n.d(t,{g:()=>o})},1735:(e,t,n)=>{function a(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const a=Array(n),o=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=o[t]+(o[t+1]<<8);a[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),i=Math.floor(5*(n-1)%8),r=o[s]+(o[s+1]<<8);return a[n-1]=r>>i&31,a}function o(e,t){let n=0;const a=new Array(t),o=e.length/t,s=e[0],i=e[e.length-1];for(let r=0;r<t;r++){const t=Math.floor(r*o),c=((e[t-1]??s)+(e[t]??s)+(e[t+1]??i))/3;a[r]=c,n<c&&(n=c)}return{data:a,peak:n}}n.d(t,{C:()=>o,x:()=>a})},31482:(e,t,n)=>{n.d(t,{Z:()=>a});const a={root:"gXO57D98",chosen:"VXSJn0Sm","animated-emoji":"lFjoRm_p",animatedEmoji:"lFjoRm_p",tag:"Dr889Kzc",tail:"cUfY1b26","is-safari":"rxxUijuG",isSafari:"rxxUijuG","tail-fill":"y591o4fN",tailFill:"y591o4fN","tag-text":"ly7cruxF",tagText:"ly7cruxF",counter:"P2FqNJAi",disabled:"NRtGofbf"}},41372:(e,t,n)=>{n.d(t,{Z:()=>a});const a={root:"CdTfL4f7",fadeIn:"MyeHARy0",closing:"EZbKn_M3",peer:"kW0xpExG",name:"BDZrSTO_",name_hasUnreadStory:"OoUm5AUZ",nameHasUnreadStory:"OoUm5AUZ",hidden:"lnVtxMZI",contextMenu:"N1sagA0s"}},4710:(e,t,n)=>{n.d(t,{Z:()=>a});const a={name:"BDZrSTO_",root:"QOz6fQFU",avatar:"dXSy0i2c",avatarHidden:"n0vJEdNW",ghost:"E1IeDpeb",ghostAnimateName:"HMp3KTKQ",ghostRevealName:"unYkDic1",ghostLast:"dZJGfaXC"}},68973:(e,t,n)=>{e.exports=n.p+"encoderWorker.min.8ea62f6317fbac7d4558.js"},67592:(e,t,n)=>{e.exports=n.p+"GiftBlueRound.90e369f0f350cdfb20d4.svg"},40377:(e,t,n)=>{e.exports=n.p+"GiftGreenRound.f66f0acd5d3dda1c7baf.svg"},13581:(e,t,n)=>{e.exports=n.p+"GiftRedRound.a86b78b0b99e07f69a70.svg"}}]);
//# sourceMappingURL=3442.0c99aec2d7cb850d5031.js.map