2 lines
288 KiB
JavaScript
2 lines
288 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[9122],{63744:(e,t,n)=>{n.d(t,{A:()=>A});var a=n(84051),o=n(13439),i=n(67321),r=n(71331),s=n(87357),l=n(14),c=n(39351),d=n(34201),m=n(26875),u=n(64493);const A=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatId:n}=t;const a=(0,i.hds)(e,n),o=(0,r.mD)(e,n);return{groupCall:o,isActive:((0,i.nTw)(e).isMasterTab?e.groupCalls.activeGroupCallId:void 0)!==o?.id&&Boolean(o?o.participantsCount>0&&o.isLoaded:a&&a.isCallNotEmpty&&a.isCallActive)}}))((e=>{let{chatId:t,isActive:n,className:i,groupCall:r,hasPinnedOffset:A}=e;const{requestMasterAndJoinGroupCall:h,subscribeToGroupCallUpdates:p}=(0,o.ko)(),g=(0,c.A)(),y=(0,a.hb)((()=>{h({chatId:t})}),[h,t]),f=r?.participants,v=(0,a.Kr)((()=>{if(!f)return[];const e=(0,o.mS)().users.byId,t=(0,o.mS)().chats.byId;return Object.values(f).slice(0,3).map((n=>{let{id:a}=n;return e[a]||t[a]})).filter(Boolean)}),[f]);(0,a.vJ)((()=>{if(r?.id&&(n||!r.isLoaded))return p({id:r.id,subscribed:!0}),()=>{p({id:r.id,subscribed:!1})}}),[r?.id,r?.isLoaded,n,p]);const{shouldRender:E,transitionClassNames:C}=(0,d.A)(Boolean(r&&n)),b=(0,l.A)(r?.participantsCount,!0),w=(0,l.A)(v,!0);if(E)return a.Ay.createElement("div",{className:(0,s.A)("GroupCallTopPane",A&&"has-pinned-offset",i,C),onClick:y},a.Ay.createElement("div",{className:"info"},a.Ay.createElement("span",{className:"title"},g("VoipGroupVoiceChat")),a.Ay.createElement("span",{className:"participants"},g("Participants",b??0,"i"))),Boolean(w?.length)&&a.Ay.createElement(m.A,{size:"small",peers:w,className:"avatars"}),a.Ay.createElement(u.A,{round:!0,className:"join"},g("VoipChatJoin")))})))},68292:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(84051),o=n(13439),i=n(67321),r=n(87357),s=n(37661),l=n(39351);const c=e=>{let{text:t,className:n}=e;const c=(0,l.A)(),d=(0,a.li)(),[m,u,A]=(0,s.A)(!1),h=(0,i.PKK)((0,o.mS)()),p=(0,a.Kr)((()=>{if(!h)return t;if(!m)return d.current||t;const e=d.current,n=[];for(let o=0;o<t.length;o++)e&&t[o]!==e[o]?n.push(a.Ay.createElement("div",{className:"IYTzbS8o"},a.Ay.createElement("div",{className:"Jw1oQFdk"},t[o]),a.Ay.createElement("div",{className:"TZfEz3sc",onAnimationEnd:A},e[o]),a.Ay.createElement("div",{className:"Y9ied8_t",onAnimationEnd:A},t[o]))):n.push(a.Ay.createElement("span",null,t[o]));return d.current=t,n}),[h,m,t]);return(0,a.vJ)((()=>{u()}),[t]),a.Ay.createElement("span",{className:(0,r.A)("tgKbsVmz",n),dir:c.isRtl?"rtl":void 0},p)}},79577:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(84051),o=n(97335),i=n(59589),r=n(62587),s=n(64489);function l(){return l=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},l.apply(this,arguments)}const c=(0,a.ph)((function(e){const{sticker:t,noLoad:n,forcePreview:c,...d}=e,m=t?.thumbnail?.dataUri,u=t&&`sticker${t.id}`,A=(0,r.A)(t?(0,i.I6)(t.id):void 0,n&&!c,o.qZ.BlobUrl),h=(0,r.A)(u,n);return a.Ay.createElement(s.A,l({tgsUrl:h,previewUrl:A,thumbDataUri:m},d))}))},64489:(e,t,n)=>{n.d(t,{A:()=>A});var a=n(84051),o=n(87357),i=n(95807),r=n(37661),s=n(17712),l=n(37960),c=n(4438);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,A=(0,a.ph)((function(e){const{previewUrl:t,thumbDataUri:n,className:A,...h}=e,[p,,g]=(0,r.A)(Boolean(n)),y=(0,l.A)(p),[f,v,E]=(0,r.A)(u.has(t)),C=(0,l.A)(f),[b,w]=(0,r.A)(!1),S=(0,s.A)((()=>{v(),u.add(t)})),N=(0,s.A)((()=>{g(),E(),setTimeout(w,300)})),{size:I}=e;return a.Ay.createElement("div",{className:(0,o.A)(A,"xCi2f0YH"),style:(0,i.A)(void 0!==I&&`width: ${I}px; height: ${I}px;`)},n&&!b&&a.Ay.createElement("img",{src:n,className:(0,o.A)(d,y),draggable:!1}),t&&!b&&a.Ay.createElement("img",{src:t,className:(0,o.A)(d,C),draggable:!1,onLoad:S}),a.Ay.createElement(c.A,m({},h,{onLoad:N})))}))},62894:(e,t,n)=>{n.d(t,{Ay:()=>R});var a=n(84051),o=n(13439),i=n(97335),r=n(89925),s=n(59589),l=n(53827),c=n(87357),d=n(50442),m=n(11410),u=n(70497),A=n(42186),h=n(91525),p=n(4961);var g=n(43874),y=n(88792),f=n(71533),v=n(39351),E=n(17712),C=n(62587),b=n(91800),w=n(34201),S=n(64493),N=n(96530),I=n(35913),M=n(4438),k=n(76785);const T=window.matchMedia("(max-width: 375px)"),P=window.matchMedia("(max-width: 410px)");function x(e,t,n){return a.Ay.createElement("div",{className:"seekline",ref:n},t.map((e=>{let{start:t,end:n}=e;return a.Ay.createElement("div",{className:"seekline-buffered-progress",style:`left: ${100*t}%; right: ${100-100*n}%`})})),a.Ay.createElement("span",{className:"seekline-play-progress"},a.Ay.createElement("i",{className:"seekline-play-progress-inner",style:`transform: translateX(${100*e}%)`})),a.Ay.createElement("span",{className:"seekline-thumb"},a.Ay.createElement("i",{className:"seekline-thumb-inner",style:`transform: translateX(${100*e}%)`})))}const R=(0,a.ph)((e=>{let{theme:t,message:n,senderTitle:R,uploadProgress:L,origin:B,date:O,noAvatars:F,className:D,isSelectable:U,isSelected:j,isDownloading:$,isTranscribing:K,isTranscriptionHidden:_,isTranscribed:z,isTranscriptionError:J,canDownload:H,canTranscribe:V,autoPlay:q,onHideTranscription:G,onPlay:W,onPause:Q,onReadMedia:Y,onCancelUpload:Z,onDateClick:X}=e;const{cancelMessageMediaDownload:ee,downloadMessageMedia:te,transcribeAudio:ne,openOneTimeMediaModal:ae}=(0,o.ko)(),{content:{audio:oe,voice:ie,video:re},isMediaUnread:se}=n,le=oe||(0,s.Rp)(n),ce=Boolean(ie||re),de=(0,a.li)(!1),me=(0,a.li)(null),ue=(0,v.A)(),{isRtl:Ae}=ue,{isMobile:he}=(0,g.Ay)(),[pe,ge]=(0,a.J0)(!1),ye=pe||!0,fe=(0,s.EO)(n,"pictogram"),ve=(0,C.A)(fe,!1,i.qZ.BlobUrl),Ee=(0,s.G5)(n),Ce=B===r.d9.OneTimeModal,be=ce?Ee?"oneTimeVoice":"voice":"audio",we=(0,C.A)((0,s.EO)(n,"inline"),!ye,(0,s.nl)(n,"inline")),{loadProgress:Se}=(0,b.A)((0,s.EO)(n,"download"),!$,(0,s.nl)(n,"download")),Ne=(0,E.A)((()=>{ge(!0),W?.(n.id,n.chatId)})),Ie=(0,E.A)((()=>{ge(!1)})),{isBuffered:Me,bufferedRanges:ke,bufferingHandlers:Te,checkBuffering:Pe}=(0,f.A)(),xe=Ce,{isPlaying:Re,playProgress:Le,playPause:Be,setCurrentTime:Oe,duration:Fe}=(0,y.A)((0,l.dj)(n),(0,s.Fk)(n),be,we,Te,void 0,Pe,Boolean(pe||q),Ne,Ie,(0,s.Nb)(n)||Ee,void 0,Q,xe,Ee&&!Ce),De=1-Le,Ue=(0,s.Ie)(n),je=Ee&&Ce,$e=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];const l=(0,a.li)(null),{data:c,peak:d}=(0,a.Kr)((()=>{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?T.matches?16:20:25,MAX_SPIKES:e?T.matches?35:t&&P.matches?40:45:75}}(r,i),s=Math.min(n/10,1),l=Math.round(a+(o-a)*s),c=(0,u.e)(new Uint8Array(e));return(0,u.p)(c,l)}),[r,t,i])||{};return(0,a.Nf)((()=>{const t=l.current;t&&c&&void 0!==d&&function(e,t,n,a){let{peak:o,fillStyle:i,progressFillStyle:r}=a;const s=4*t.length;e.width=2*s,e.height=46,e.style.width=`${s}px`,e.style.height="23px";const l=e.getContext("2d");l.scale(2,2),t.forEach(((e,a)=>{l.globalAlpha=a/t.length>=n?.5:1,l.fillStyle=n>a/t.length?r:i;const s=Math.max(2,e/Math.max(1,o)*23);!function(e,t,n,a,o,i){2<2*i&&(i=1),o<2*i&&(i=o/2),e.beginPath(),e.moveTo(t+i,n),e.arcTo(t+2,n,t+2,n-o,i),e.arcTo(t+2,n-o,t,n-o,i),e.arcTo(t,n-o,t,n,i),e.arcTo(t,n,t+2,n,i),e.closePath()}(l,4*a,(23+s)/2,0,s,1),l.fill()}))}(t,c,s?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,c,e,s]),l}(t,ie,!se||Ue||je?Le:1,Ue,!F,he,je),Ke=Re||Le>0&&Le<1;(0,a.vJ)((()=>{ge(Re)}),[Re]);const _e=pe&&!Me,{isUploading:ze,isTransferring:Je,transferProgress:He}=(0,s.LK)(n,L||Se,_e||$,void 0!==L),{shouldRender:Ve,transitionClassNames:qe}=(0,w.A)(Je),Ge=Ve&&(_e||ze),We=(0,E.A)((()=>{if(ze)Z?.();else{if(Ee)return ae({message:n}),void Y?.();Re||W?.(n.id,n.chatId),(0,o.ko)().setAudioPlayerOrigin({origin:B}),ge(!pe),Be()}}));(0,a.vJ)((()=>{Y&&se&&(Re||$)&&Y()}),[Re,se,Y,$]);const Qe=(0,E.A)((()=>{$?ee({message:n}):te({message:n})})),Ye=(0,E.A)((e=>{if(de.current&&me.current){const{width:t,left:n}=me.current.getBoundingClientRect(),a=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),Oe(Math.max(Math.min(Fe*((a-n)/t),Fe-.1),.001))}})),Ze=(0,E.A)((e=>{e instanceof MouseEvent&&2===e.button||(de.current=!0,Ye(e))})),Xe=(0,E.A)((()=>{de.current=!1})),et=(0,E.A)((()=>{X(n.id,n.chatId)})),tt=(0,E.A)((()=>{ne({chatId:n.chatId,messageId:n.id})}));function nt(){if(ce)return R||"Voice";const{title:e,fileName:t}=le;return e||t}(0,a.vJ)((()=>{if(me.current&&Ke&&!Ce)return(0,d.wJ)(me.current,{onCapture:Ze,onRelease:Xe,onClick:Xe,onDrag:Ye})}),[Ke,Ze,Ye,Xe,Ce]);const at=(0,c.A)("Audio",D,Ce&&"non-interactive",B===r.d9.Inline&&"inline",Ue&&B===r.d9.Inline&&"own",(B===r.d9.Search||B===r.d9.SharedMedia)&&"bigger",j&&"audio-is-selected"),ot=["toogle-play-wrapper"];Ge?ot.push("loading"):ot.push(Re?"pause":"play");const it=(0,c.A)("content",Ke&&"with-seekline");function rt(){return a.Ay.createElement("div",{className:it},a.Ay.createElement("div",{className:"content-row"},a.Ay.createElement("p",{className:"title",dir:"auto",title:nt()},(0,p.A)(nt())),a.Ay.createElement("div",{className:"message-date"},Boolean(O)&&a.Ay.createElement(N.A,{className:"date",onClick:et},(0,m.be)(ue,1e3*O)))),Ke&&a.Ay.createElement("div",{className:"meta search-result",dir:Ae?"rtl":void 0},a.Ay.createElement("span",{className:"duration with-seekline",dir:"auto"},Le<1&&`${(0,m.QO)(Fe*Le,Fe)}`),x(Le,ke,me)),!Ke&&function(){if(ce)return a.Ay.createElement("div",{className:"meta",dir:Ae?"rtl":void 0},(0,m.QO)((ie||re).duration));const{performer:e}=le;return a.Ay.createElement("div",{className:"meta",dir:Ae?"rtl":void 0},(0,m.QO)(Fe),a.Ay.createElement("span",{className:"bullet"},"•"),e&&a.Ay.createElement("span",{className:"performer",title:e},(0,p.A)(e)),e&&R&&a.Ay.createElement("span",{className:"bullet"},"•"),R&&a.Ay.createElement("span",{title:R},(0,p.A)(R)))}())}return a.Ay.createElement("div",{className:at,dir:ue.isRtl?"rtl":"ltr"},U&&a.Ay.createElement("div",{className:"message-select-control"},j&&a.Ay.createElement("i",{className:"icon icon-select"})),a.Ay.createElement("div",{className:(0,c.A)(...ot)},a.Ay.createElement(S.A,{round:!0,ripple:!he,size:"smaller",className:"toggle-play",color:ve?"translucent-white":"primary",ariaLabel:Re?"Pause audio":"Play audio",onClick:We,isRtl:ue.isRtl,backgroundImage:ve,nonInteractive:Ce},!Ce&&a.Ay.createElement(k.A,{name:"play"}),!Ce&&a.Ay.createElement(k.A,{name:"pause"}),Ce&&a.Ay.createElement(M.A,{className:"flame",tgsUrl:A.w.Flame,nonInteractive:!0,noLoop:!1,size:40})),Ee&&!Ce&&a.Ay.createElement(k.A,{name:"view-once"})),Ve&&a.Ay.createElement("div",{className:(0,c.A)("media-loading",qe,Ge&&"interactive")},a.Ay.createElement(I.A,{progress:He,transparent:!0,withColor:!0,size:"m",onClick:Ge?We:void 0,noCross:!Ge})),Ce&&!Ve&&a.Ay.createElement("div",{className:(0,c.A)("media-loading")},a.Ay.createElement(I.A,{progress:Le,transparent:!0,size:"m",noCross:!0,rotationOffset:3/4})),le&&H&&!ze&&a.Ay.createElement(S.A,{round:!0,size:"tiny",className:"download-button",ariaLabel:$?"Cancel download":"Download",onClick:Qe},a.Ay.createElement("i",{className:(0,c.A)("icon",$?"icon-close":"icon-arrow-down")})),B===r.d9.Search&&rt(),B!==r.d9.Search&&le&&function(e,t,n,o,i,r,s,l,c,d,u){const{title:A,performer:g,fileName:y}=t,f=o||i>0&&i<1,{isRtl:v}=e;return a.Ay.createElement("div",{className:"content"},a.Ay.createElement("p",{className:"title",dir:"auto",title:A},(0,p.A)(A||y)),f&&a.Ay.createElement("div",{className:"meta",dir:v?"rtl":void 0},a.Ay.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,m.QO)(n*i,n)),x(i,r,s)),!f&&l&&a.Ay.createElement("div",{className:"meta",dir:v?"rtl":void 0},d?`${(0,h.zV)(t.size*d)} / `:void 0,(0,h.zV)(t.size)),!f&&!l&&a.Ay.createElement("div",{className:"meta",dir:v?"rtl":void 0},a.Ay.createElement("span",{className:"duration",dir:"auto"},(0,m.QO)(n)),g&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement("span",{className:"bullet"},"•"),a.Ay.createElement("span",{className:"performer",dir:"auto",title:g},(0,p.A)(g))),Boolean(c)&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement("span",{className:"bullet"},"•"),a.Ay.createElement(N.A,{className:"date",onClick:u},(0,m.fS)(e,1e3*c,!0)))))}(ue,le,Fe,Re,Le,ke,me,$||ze,O,He,X?et:void 0),B===r.d9.SharedMedia&&(ie||re)&&rt(),(B===r.d9.Inline||Ce)&&ie&&function(e,t,n,o,i,s,l,d,u,A,h,p){return a.Ay.createElement("div",{className:"content"},a.Ay.createElement("div",{className:"waveform-wrapper"},a.Ay.createElement("div",{className:"waveform",draggable:!1,ref:t},a.Ay.createElement("canvas",{ref:n})),A&&a.Ay.createElement(S.A,{onClick:()=>{(d||u)&&h?h(!l):s||A()}},a.Ay.createElement("i",{className:(0,c.A)("transcribe-icon","icon",d||u?"icon-down":"icon-transcribe",(d||u)&&!l&&"transcribe-shown")}),s&&a.Ay.createElement("svg",{viewBox:"0 0 32 24",className:"loading-svg"},a.Ay.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.Ay.createElement("p",{className:(0,c.A)("voice-duration",p!==r.d9.OneTimeModal&&i&&"unread"),dir:"auto"},0===o||1===o?(0,m.QO)(e.duration):(0,m.QO)(e.duration*o)))}(ie,me,$e,Ee?De:Le,se,K,_,z,J,V?tt:void 0,G,B))}))},26875:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(84051),o=n(87357),i=n(39351),r=n(21849);const s={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"},l=3,c=(0,a.ph)((e=>{let{peers:t,size:n,className:c,limit:d=l,badgeText:m}=e;const u=(0,i.A)(),A=(0,a.Kr)((()=>m||(!t?.length||t.length<=d?void 0:"+"+(t.length-d))),[m,t,d]);return a.Ay.createElement("div",{className:(0,o.A)(c,s.root,s[`size-${n}`]),dir:u.isRtl?"rtl":"ltr"},t?.slice(0,d).map((e=>a.Ay.createElement(r.A,{size:n,peer:e,className:s.avatar}))),A&&a.Ay.createElement("div",{className:s.badge},A))}))},47736:(e,t,n)=>{n.d(t,{A:()=>Mt});var a=n(84051),o=n(13439),i=n(97335),r=n(31481),s=n(66644),l=n(59589),c=n(67321),d=n(64520),m=n(87357),u=n(11410),A=n(53307),h=n(36353),p=n(79824),g=n(80539),y=n(39074),f=n(80140),v=n(82393),E=n(43503);let C;function b(e){C.focus(),e.focus()}v.pz&&(C=document.createElement("input"),C.classList.add("for-ios-autocapitalization-fix"),document.body.appendChild(C));var w=n(55153),S=n(58734),N=n(11359),I=n(35049),M=n(4961),k=n(54487),T=n(32625),P=n(14737),x=n(10722),R=n(19129),L=n(82117),B=n(37661),O=n(41316),F=n(39351),D=n(17712),U=n(29886),j=n(24531),$=n(73172),K=n(34201),_=n(56331),z=n(41257),J=n(35297),H=n(17778),V=n(63988),q=n(83414);const G=/^\/([\w@]{1,32})?$/i;var W=n(78396);const Q=/id="docs-internal-guid/i,Y={BOLD:"700",ITALIC:"italic",UNDERLINE:"underline",STRIKETHROUGH:"line-through",SUPERSCRIPT:"super",SUBSCRIPT:"sub"},Z={ANCHOR:"a",BOLD:"strong",ITALIC:"em",UNDERLINE:"u",BLOCKQUOTE:"blockquote",STRIKETHROUGH:"del",SUPERSCRIPT:"sup",SUBSCRIPT:"sub"},X=["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(Z.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===Y.BOLD&&(n=ne(n,Z.BOLD)),e.style&&e.style.fontStyle===Y.ITALIC&&(n=ne(n,Z.ITALIC)),e.style&&e.style.textDecoration===Y.UNDERLINE&&(n=ne(n,Z.UNDERLINE)),e.style&&e.style.textDecoration===Y.STRIKETHROUGH&&(n=ne(n,Z.STRIKETHROUGH)),e.style&&e.style.verticalAlign===Y.SUPERSCRIPT&&(n=ne(n,Z.SUPERSCRIPT)),e.style&&e.style.verticalAlign===Y.SUBSCRIPT&&(n=ne(n,Z.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 ie(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(...ie(e.childNodes[t]));a.map((e=>n.appendChild(e)))}else-1!==X.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(...ie(e.childNodes[n]));return t}return[e]}function re(e){return 8!==e.nodeType}const se=/<style>(.*?)<\/style>/gs;var le=n(45761);const ce=(e,t,n,s,c,d,m)=>{const{showNotification:u}=(0,o.ko)(),A=(0,F.A)();(0,a.vJ)((()=>{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&&![r.CfG,r.e0F,r.YVZ].includes(a.id))return;const o=e.clipboardData.getData("text").substring(0,4096),h=e.clipboardData.getData("text/html");let p=h?(0,g.Ay)(function(e){let t=document.createElement("div");try{e=(n=e).match(Q)?function(e){const t=document.createElement("body"),n=e.childNodes,a=Array.from(n).filter(re),o=[];for(const e of a)o.push(...ie(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){r.Oig&&console.error(e)}var n;t.innerHTML=e.replace(/\u00a0/g," ").replace(se,"");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.qh[e.tagName]&&e.setAttribute("data-entity-type",g.qh[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 i.C7.MentionName:e.replaceWith(e.textContent||"");break;case i.C7.CustomEmoji:e.textContent=e.dataset.alt||""}else e.remove()})),t.innerHTML.trimEnd()}(h),void 0,!0):void 0;p&&(0,W.T8)(p)&&d&&(p=(0,W.m4)(p),m?.());const{items:y}=e.clipboardData;let f=[];if(e.preventDefault(),y.length>0&&(f=await(0,le.A)(y),c&&(f=f?.slice(0,1))),!f?.length&&!o)return;const v=p?.entities?.length?p:{text:o};let E=!1;try{E="urn:schemas-microsoft-com:office:word"===(new DOMParser).parseFromString(h,"text/html").documentElement.getAttribute("xmlns:w")}catch(e){}const C=v&&v.text;let b=f?.length&&!E;const S=f?await Promise.all(f.map((e=>(0,w.A)(e.name,e)))):[],N=c&&S?.length&&(0,l.eh)(c,S[0])||Boolean(C),I=(0,l.NK)(S[0]),M=c&&c?.groupedId;c&&I?u({message:A(M?"lng_edit_media_album_error":"lng_edit_media_invalid_file")}):!M||(b=N,b)?(b&&n(c?S:e=>e.concat(S)),C&&(b?s(v):t(v,a?.id))):u({message:A("lng_edit_media_album_error")})}}),[t,c,n,e,d,m,s,A])};var de=n(3225),me=n(37859),ue=n(56133),Ae=n(61157),he=n(60138);let pe=!1;const ge=new Set([i.C7.TextUrl,i.C7.Url]);var ye=n(25498),fe=n(37830);const ve=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+(.*)/is,Ee=/^@([a-z0-9_]{1,32})[\u00A0\u0020]+\n{2,}/i,Ce={username:"",query:"",canShowHelp:!1,usernameLowered:""},be=document.createElement("div");const we=(0,fe.A)(((e,t,n)=>({username:e,query:t,canShowHelp:n,usernameLowered:e.toLowerCase()})));var Se=n(9442),Ne=n(98221),Ie=n(17237);const Me=new RegExp(`^${r.bpX.source}$`,"g");var ke=n(11778);const Te={encoderPath:new URL(n(89755),n.b).href,reuseWorker:!0},Pe={type:"audio/ogg"};let xe,Re,Le;async function Be(){return xe||(xe=n.e(4550).then(n.t.bind(n,14550,23)),Re=(await xe).default,Le=new Re(Te)),xe}async function Oe(e){await async function(){await Be(),await Le.start()}();const t=Date.now();let n;const a=[],o=[];Le.ondataavailable=e=>{a.push(e)};const i=function(t,n){const a=t.sourceNode,i=a.context.createAnalyser();i.fftSize=64,a.connect(i);const r=i.frequencyBinCount,l=new Uint8Array(r);let c=!1;return function t(){if(c)return;i.getByteFrequencyData(l);const n=l.reduce(((e,t)=>e+t),0)/r/255;(t=>{o.push(255*t),e(t)})(n<.1?0:n),(0,s.YS)(t)}(),()=>{c=!0}}(Le);return{stop:()=>new Promise(((e,r)=>{Le.onstop=()=>{e({blob:new Blob(a,Pe),duration:Math.round(((n||Date.now())-t)/1e3),waveform:o})},Le.onerror=r;const s=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Le.stop(),i()}),s)})),pause:()=>{const e=Math.max(0,t+1e3-Date.now());setTimeout((()=>{Le.pause(),n=Date.now(),i()}),e)}}}var Fe=n(80089),De=n(80464);const Ue=e=>{const{attachments:t}=e,n=(0,De.A)(Fe.ar.Extra,"AttachmentModal",!t.length);return n?a.Ay.createElement(n,e):void 0};var je=n(61182),$e=n(87679),Ke=n(52844),_e=n(36680),ze=n(76785),Je=n(9168),He=n(24433),Ve=n(66469),qe=n(54639);const Ge=(0,a.ph)((e=>{let{chatId:t,threadId:n,isButtonVisible:o,canAttachMedia:i,canAttachPolls:s,canSendPhotos:c,canSendVideos:d,canSendDocuments:m,canSendAudios:u,attachBots:A,peerType:h,isScheduled:p,theme:g,shouldCollectDebugLogs:y,onFileSelect:f,onMenuOpen:E,onMenuClose:C,onPollCreate:b,hasReplaceableMedia:w,editingMessage:S}=e;const[N,I,M]=(0,B.A)(),[k,T,P]=(0,_e.A)(N,M),x=c&&d,R=c||d,[L,O,U]=(0,B.A)(),j=N||L,$=S&&S?.groupedId&&Boolean((0,l.yl)(S)||(0,l.dc)(S)||Boolean((0,l.zX)(S)||(0,l.QC)(S))),K=S&&S?.groupedId&&Boolean((0,l.wp)(S)||(0,l.gB)(S)||(0,l.zC)(S));(0,a.vJ)((()=>{N&&P()}),[N,P]),(0,a.vJ)((()=>{j?E():C()}),[j,C,E]);const _=(0,D.A)((()=>{N?M():I()})),z=(0,D.A)(((e,t)=>{const{files:n}=e.target,a=(0,$e.kc)(n);a?.length&&f(a,t)})),J=(0,D.A)((()=>{(0,Ke.p)(Array.from(x?r.mxD:c?r.RJA:r.fNs).join(","),(e=>z(e,!0)))})),H=(0,D.A)((()=>{(0,Ke.p)(!m&&u?Array.from(r.IH3).join(","):"*",(e=>z(e,!1)))})),V=(0,D.A)((()=>{const e=new File([(0,je.F8)()],r.lFE,{type:"text/plain"});f([e])})),q=(0,a.Kr)((()=>A?Object.values(A).filter((e=>!(!h||!e.isForAttachMenu)&&(!("bots"!==h||e.id!==t||!e.attachMenuPeerTypes.includes("self"))||e.attachMenuPeerTypes.includes(h)))):void 0),[A,t,h]),G=(0,F.A)();if(o)return a.Ay.createElement("div",{className:"AttachMenu"},S&&w?a.Ay.createElement(Ve.A,{id:"replace-menu-button",className:N?"AttachMenu--button activated":"AttachMenu--button",round:!0,color:"translucent",onActivate:_,ariaLabel:"Replace an attachment",ariaControls:"replace-menu-controls",hasPopup:!0},a.Ay.createElement(ze.A,{name:"replace"})):a.Ay.createElement(Ve.A,{id:"attach-menu-button",disabled:Boolean(S),className:N?"AttachMenu--button activated":"AttachMenu--button",round:!0,color:"translucent",onActivate:_,ariaLabel:"Add an attachment",ariaControls:"attach-menu-controls",hasPopup:!0},a.Ay.createElement(ze.A,{name:"attach"})),a.Ay.createElement(Je.A,{id:"attach-menu-controls",isOpen:j,autoClose:!0,positionX:"right",positionY:"bottom",onClose:M,className:"AttachMenu--menu fluid",onCloseAnimationEnd:M,onMouseEnter:v.TF?void 0:k,onMouseLeave:v.TF?void 0:T,noCloseOnBackdrop:!v.TF,ariaLabelledBy:"attach-menu-button"},!i&&a.Ay.createElement(He.A,{className:"media-disabled",disabled:!0},"Posting media content is not allowed in this group."),i&&a.Ay.createElement(a.Ay.Fragment,null,R&&!K&&a.Ay.createElement(He.A,{icon:"photo",onClick:J},G(x?"AttachmentMenu.PhotoOrVideo":c?"InputAttach.Popover.Photo":"InputAttach.Popover.Video")),(m||u)&&!$&&a.Ay.createElement(He.A,{icon:"document",onClick:H},G(!m&&u?"InputAttach.Popover.Music":"AttachDocument")),m&&y&&a.Ay.createElement(He.A,{icon:"bug",onClick:V},G("DebugSendLogs"))),s&&!S&&a.Ay.createElement(He.A,{icon:"poll",onClick:b},G("Poll")),!S&&!w&&!p&&q?.map((e=>a.Ay.createElement(qe.A,{bot:e,chatId:t,threadId:n,theme:g,onMenuOpened:O,onMenuClosed:U})))))})),We=e=>{const{isOpen:t}=e,n=(0,De.A)(Fe.ar.Extra,"BotCommandMenu",!t);return n?a.Ay.createElement(n,e):void 0};var Qe=n(64493);const Ye=(0,a.ph)((0,o.EK)(((e,t)=>{let{messageId:n}=t;const{chatId:a}=(0,c.Xf0)(e)||{};return a?{message:(0,c.O5q)(e,a,n)}:{}}))((e=>{let{isOpen:t,message:n,onClose:i}=e;const{clickBotInlineButton:r}=(0,o.ko)(),[s,l]=(0,_e.A)(t,i),{isKeyboardSingleUse:c}=n||{};if(n&&n.keyboardButtons)return a.Ay.createElement(Je.A,{isOpen:t,autoClose:c,positionX:"right",positionY:"bottom",onClose:i,className:"BotKeyboardMenu",onCloseAnimationEnd:i,onMouseEnter:v.TF?void 0:s,onMouseLeave:v.TF?void 0:l,noCompact:!0},a.Ay.createElement("div",{className:"content custom-scroll"},n.keyboardButtons.map((e=>a.Ay.createElement("div",{className:"row"},e.map((e=>a.Ay.createElement(Qe.A,{ripple:!0,disabled:"unsupported"===e.type,onClick:()=>r({messageId:n.id,button:e})},e.text))))))))}))),Ze=(0,a.ph)((e=>{let{isOpen:t,onClick:n,text:o,isDisabled:i}=e;const r=(0,a.li)(null);return(0,a.vJ)((()=>{const e=r.current;if(!e)return;const t=e.scrollWidth+1;e.closest(".Composer").style.setProperty("--bot-menu-text-width",`${t}px`)}),[t,o]),(0,a.vJ)((()=>{const e=r.current;if(!e)return;const t=e.closest(".Composer");return()=>{t.style.removeProperty("--bot-menu-text-width")}}),[]),a.Ay.createElement(Qe.A,{className:(0,m.A)("bot-menu",t&&"open"),round:!0,color:"translucent",disabled:i,onClick:n,ariaLabel:"Open bot command keyboard"},a.Ay.createElement("i",{className:(0,m.A)("bot-menu-icon","icon","icon-webapp",t&&"open")}),a.Ay.createElement("span",{ref:r,className:"bot-menu-text"},o))})),Xe=e=>{const{isOpen:t}=e,n=(0,De.A)(Fe.ar.Extra,"ChatCommandTooltip",!t);return n?a.Ay.createElement(n,e):void 0};var et=n(14),tt=n(94803),nt=n(93809),at=n(91930),ot=n(60859);const it=(0,a.ph)((0,o.EK)(((e,t)=>{let{shouldForceShowEditing:n}=t;const{chatId:a,threadId:o,type:i}=(0,c.Xf0)(e)||{};if(!a||!o||!i)return{};const{forwardMessages:{fromChatId:r,toChatId:s,messageIds:l,noAuthors:d,noCaptions:m,isModalShown:u}}=(0,c.nTw)(e),A="scheduled"===i?(0,c.VlN)(e,a):(0,c.Ys6)(e,a,o),h=(0,c.PKK)(e),p=s===a,g=l?.map((t=>(0,c.O5q)(e,r,t))),y=(0,c.GA4)(e,a,o),f=y?.replyInfo,v=f?.replyToPeerId,E=v?(0,c.hds)(e,v):void 0,C=p||f?.isShowingDelayNeeded;let b,w;if(f&&!n?b=(0,c.O5q)(e,f.replyToPeerId||a,f.replyToMsgId):A?b=(0,c.KLw)(e,a,o,i):p&&1===l.length&&(b=g?.[0]),f&&b&&!n){const{forwardInfo:t}=b,n=(0,c.nZ4)(e,a);t&&(t.isChannelPost||n)&&(w=(0,c.Szq)(e,b)),w||t?.hiddenUserName&&!Boolean(f.quoteText)||(w=(0,c.Y7C)(e,b))}else p?(b&&(w=(0,c.Szq)(e,b),w||(w=(0,c.Y7C)(e,b))),w||(w=(0,c.PVB)(e,r))):A&&b&&(w=(0,c.Y7C)(e,b));const S=g?.some((e=>e?.content.text&&Object.keys(e.content).length>1)),N=p&&1===l.length&&Boolean(b?.content.storyData),I=f?.replyToMsgId===o&&!f.replyToPeerId;return{replyInfo:f,editingId:A,message:b,sender:w,shouldAnimate:h,forwardedMessagesCount:p?l.length:void 0,noAuthors:d,noCaptions:m,forwardsHaveCaptions:S,isCurrentUserPremium:(0,c.g29)(e),isContextMenuDisabled:N,isReplyToDiscussion:I,isInChangingRecipientMode:u,isChangingChats:C,senderChat:E}}))((e=>{let{replyInfo:t,editingId:n,message:i,sender:r,shouldAnimate:s,forwardedMessagesCount:c,noAuthors:d,noCaptions:u,forwardsHaveCaptions:A,shouldForceShowEditing:h,isCurrentUserPremium:p,isContextMenuDisabled:g,isReplyToDiscussion:y,onClear:f,isInChangingRecipientMode:v,isChangingChats:E,senderChat:C}=e;const{resetDraftReplyInfo:b,updateDraftReplyInfo:w,setEditingId:S,focusMessage:N,changeRecipient:M,setForwardNoAuthors:k,setForwardNoCaptions:T,exitForwardMode:P}=(0,o.ko)(),R=(0,a.li)(null),L=(0,F.A)(),B="topicCreate"===i?.content.action?.type,O=t&&!h,U=Boolean(t?.quoteText),j=Boolean(c),$=Boolean((t||n)&&i&&!v||r&&c),_=(0,nt.A)([$,j],$&&E?300:void 0),{shouldRender:z,transitionClassNames:J}=(0,K.A)(_&&$&&!B&&!y,void 0,!s,void 0,!s);(0,a.vJ)((()=>{_&&t?.isShowingDelayNeeded&&w({isShowingDelayNeeded:!1})}));const H=(0,D.A)((()=>{t&&!h?b():n?S({messageId:void 0}):c&&P(),f?.()}));(0,a.vJ)((()=>$?(0,ke.A)(H):void 0),[$,H]);const{isContextMenuOpen:V,contextMenuPosition:q,handleContextMenu:G,handleContextMenuClose:W,handleContextMenuHide:Q}=(0,x.A)(R),Y=(0,D.A)((e=>{G(e)})),Z=(0,D.A)((e=>{e.stopPropagation(),H(),Q()})),X=e=>()=>{W(),e()},ee=(0,D.A)(X(M)),te=(0,D.A)(X((()=>{N({chatId:i.chatId,messageId:i.id,noForumTopicPanel:!0})}))),ne=(0,D.A)(X((()=>w({quoteText:void 0})))),ae=(0,D.A)(X(M)),oe=(0,D.A)(X(H)),ie=(0,D.A)((()=>R.current)),re=(0,D.A)((()=>R.current)),se=(0,D.A)((()=>R.current.querySelector(".forward-context-menu .bubble"))),{positionX:le,positionY:ce,transformOriginX:de,transformOriginY:me,style:ue}=(0,tt.A)(q,ie,re,se);(0,a.vJ)((()=>{z||(W(),Q())}),[W,Q,z]);const Ae=(0,m.A)("ComposerEmbeddedMessage",J),he=(0,et.A)(r,!0),pe=(0,m.A)("ComposerEmbeddedMessage_inner",(0,I.y)(he)),ge=(0,a.Kr)((()=>O?"reply":n?"edit":j?"forward":void 0),[n,j,O]),ye=c&&c>1?L("ForwardedMessageCount",c):void 0,fe=(0,a.Kr)((()=>{if(!i||!j||!i.content.text||!d||p)return i;const e=(0,l.m4)(i.content.text);return{...i,content:{...i.content,text:e}}}),[p,j,i,d]),ve=(0,et.A)(ge,!0);if(z)return a.Ay.createElement("div",{className:Ae,ref:R,onContextMenu:G},a.Ay.createElement("div",{className:pe},a.Ay.createElement("div",{className:"embedded-left-icon",onClick:G},ve&&a.Ay.createElement(ze.A,{name:ve}),Boolean(t?.quoteText)&&a.Ay.createElement(ze.A,{name:"quote",className:"quote-reply"})),a.Ay.createElement(at.b,{isOpen:$,className:"inside-input",replyInfo:t,isInComposer:!0,message:fe,sender:d?void 0:r,customText:ye,title:n&&!O?L("EditMessage"):d?L("HiddenSendersNameDescription"):void 0,onClick:Y,senderChat:C}),a.Ay.createElement(Qe.A,{className:"embedded-cancel",round:!0,faded:!0,color:"translucent",ariaLabel:L("Cancel"),onClick:Z},a.Ay.createElement("i",{className:"icon icon-close"})),(O||j)&&!g&&a.Ay.createElement(Je.A,{isOpen:V,transformOriginX:de,transformOriginY:me,positionX:le,positionY:ce,style:ue,className:"forward-context-menu",onClose:W,onCloseAnimationEnd:Q},j&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(He.A,{icon:d?void 0:"message-succeeded",customIcon:d?a.Ay.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>k({noAuthors:!1})},L(c>1?"ShowSenderNames":"ShowSendersName")),a.Ay.createElement(He.A,{icon:d?"message-succeeded":void 0,customIcon:d?void 0:a.Ay.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>k({noAuthors:!0})},L(c>1?"HideSenderNames":"HideSendersName")),A&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(ot.A,null),a.Ay.createElement(He.A,{icon:u?void 0:"message-succeeded",customIcon:u?a.Ay.createElement("i",{className:"icon icon-placeholder"}):void 0,onClick:()=>T({noCaptions:!1})},L(c>1?"Conversation.ForwardOptions.ShowCaption":"ShowCaption")),a.Ay.createElement(He.A,{icon:u?"message-succeeded":void 0,customIcon:u?void 0:a.Ay.createElement("i",{className:"icon icon-placeholder"}),onClick:()=>T({noCaptions:!0})},L(c>1?"Conversation.ForwardOptions.HideCaption":"HideCaption"))),a.Ay.createElement(ot.A,null),a.Ay.createElement(He.A,{icon:"replace",onClick:ee},L("ForwardAnotherChat"))),O&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(He.A,{icon:"show-message",onClick:te},L("Message.Context.Goto")),U&&a.Ay.createElement(He.A,{icon:"remove-quote",onClick:ne},L("RemoveQuote")),a.Ay.createElement(He.A,{icon:"replace",onClick:ae},L("ReplyToAnotherChat")),a.Ay.createElement(He.A,{icon:"delete",onClick:oe},L("DoNotReply"))))))})));var rt=n(25897),st=n(83689),lt=n(41510);const ct=e=>{const{isOpen:t}=e,n=(0,De.A)(Fe.ar.Extra,"DropArea",!t);return n?a.Ay.createElement(n,e):void 0};var dt=n(49068);const mt=e=>{const{isOpen:t}=e,n=(0,De.A)(Fe.ar.Extra,"InlineBotTooltip",!t);return n?a.Ay.createElement(n,e):void 0},ut=e=>{const{isOpen:t}=e,n=(0,De.A)(Fe.ar.Extra,"MentionTooltip",!t);return n?a.Ay.createElement(n,e):void 0};var At=n(78407);const ht=e=>{const{isOpen:t}=e,n=(0,De.A)(Fe.ar.Extra,"PollModal",!t);return n?a.Ay.createElement(n,e):void 0},pt=e=>{const{isOpen:t}=e,n=(0,De.A)(Fe.ar.Extra,"SendAsMenu",!t);return n?a.Ay.createElement(n,e):void 0},gt=e=>{const{isOpen:t}=e,n=(0,De.A)(Fe.ar.Extra,"StickerTooltip",!t);return n?a.Ay.createElement(n,e):void 0};var yt=n(26440),ft=n(70314);const vt=new RegExp(r.kNZ,"i"),Et=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatId:n,threadId:a}=t;const o=(0,c.rQx)(e,n,a);return{theme:(0,c.SJA)(e),webPagePreview:(0,c.nTw)(e).webPagePreview,noWebPage:o}}))((e=>{let{chatId:t,threadId:n,getHtml:r,isDisabled:s,webPagePreview:l,noWebPage:c,theme:d}=e;const{loadWebPagePreview:u,clearWebPagePreview:A,toggleMessageWebPage:h}=(0,o.ko)(),p=(0,a.li)(),y=(0,V.tF)((()=>{const e=(0,g.Ay)(r()),t=e.entities?.find((e=>e.type===i.C7.TextUrl));return p.current=e,t?.url||e.text.match(vt)?.[0]}),[r],300,!0),f=(0,q.A)(y,[y,r],!0);(0,a.vJ)((()=>{const e=f(),a=p.current;e?u({text:a}):(A(),h({chatId:t,threadId:n}))}),[f,t,n]),(0,J.A)((()=>{A(),h({chatId:t,threadId:n})}),[t,A,n,h]);const v=(0,R.A)((()=>Boolean(l&&r()&&!c&&!s)),[s,r,c,l]),{shouldRender:E,transitionClassNames:C}=(0,K.A)(v),b=(0,et.A)(l,!0),w=(0,D.A)((()=>{h({chatId:t,threadId:n,noWebPage:!0})}));if(!E||!b)return;const{photo:S,...N}=b,I={content:{webPage:N}};return a.Ay.createElement("div",{className:(0,m.A)("WebPagePreview",C)},a.Ay.createElement("div",{className:"WebPagePreview_inner"},a.Ay.createElement("div",{className:"WebPagePreview-left-icon"},a.Ay.createElement("i",{className:"icon icon-link"})),a.Ay.createElement(ft.A,{message:I,inPreview:!0,theme:d}),a.Ay.createElement(Qe.A,{className:"WebPagePreview-clear",round:!0,faded:!0,color:"translucent",ariaLabel:"Clear Webpage Preview",onClick:w},a.Ay.createElement("i",{className:"icon icon-close"}))))})));var Ct=n(76283),bt=n(57474),wt=n(21849);const St=e=>{const{isOpen:t}=e,n=(0,De.A)(Fe.ar.Extra,"DeleteMessageModal",!t);return n?a.Ay.createElement(n,e):void 0};var Nt=n(23470),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 Mt=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatId:n,threadId:a,storyId:o,messageListType:s,isMobile:m,type:u}=t;const A=(0,c.hds)(e,n),h=n!==r.f51?(0,c.yps)(e,n):void 0,p=Boolean(h),g=(0,c.nZ4)(e,n),y=(0,l.L8)(n),f=p?(0,c.vGo)(e,h.id):void 0,v=y?void 0:(0,c.AWZ)(e,n),E=(p||!y)&&(0,c.tVS)(e,n,a),C=(0,c.K3w)(e,n,a),{language:b,shouldSuggestStickers:w,shouldSuggestCustomEmoji:S,shouldUpdateStickerSetOrder:N}=e.settings.byKey,I=e.emojiKeywords[r.cUY],M=b!==r.cUY?e.emojiKeywords[b]:void 0,k=E?E.id:void 0,T=k?(0,c.O5q)(e,n,k):void 0,{currentUserId:P}=e,x=(0,c.mBe)(e,P),R=v?v?.sendAsId||P:void 0,L=A?.sendAsPeerIds&&R&&(A.sendAsPeerIds.some((e=>e.id===R))?R:A?.adminRights?.anonymous?A?.id:void 0),B=L?(0,c.mBe)(e,L):void 0,O=!B&&L?(0,c.hds)(e,L):void 0,F=(0,c.sam)(e,n),D=(0,c.p6T)(e,n),U=(0,c.nTw)(e),j=Boolean(U.storyViewer.storyId),$=(0,c.Xf0)(e),K=n===$?.chatId&&a===$?.threadId&&s===$?.type&&!j,_=(0,c.mBe)(e,n),z=(_&&!(0,c.vGo)(e,_.id)?.noVoiceMessages)??!0,J=v?.slowMode,H=(0,c.g29)(e),V="scheduled"===s?(0,c.dkp)(e,n):(0,c.U0A)(e,n,a),q=o&&(0,c.Msb)(e,n,o),G=q&&"sentReaction"in q?q.sentReaction:void 0,W=(0,c.GA4)(e,n,a),Q=W?.replyInfo?(0,c.O5q)(e,n,W.replyInfo.replyToMsgId):void 0,Y=A?.isForum&&A.isForumAsMessages&&a===i.l3&&Q?(0,c.nkm)(e,Q):void 0,Z="scheduled"===s,X=y&&!p&&!Z&&!g;return{availableReactions:"story"===u?e.reactions.availableReactions:void 0,topReactions:"story"===u?e.reactions.topReactions:void 0,isOnActiveTab:!U.isBlurred,editingMessage:(0,c.KLw)(e,n,a,s),draft:W,chat:A,isChatWithBot:p,isChatWithSelf:g,isForCurrentMessageList:K,canScheduleUntilOnline:(0,c.RBq)(e,n),isChannel:A?(0,l.WX)(A):void 0,isRightColumnShown:(0,c.gjV)(e,m),isSelectModeActive:(0,c.rTV)(e),withScheduledButton:"thread"===s&&Boolean(C?.length),isInScheduledList:Z,botKeyboardMessageId:k,botKeyboardPlaceholder:T?.keyboardPlaceholder,isForwarding:n===U.forwardMessages.toChatId,pollModal:U.pollModal,stickersForEmoji:e.stickers.forEmoji.stickers,customEmojiForEmoji:e.customEmojis.forEmoji.stickers,chatFullInfo:v,topInlineBotIds:e.topInlineBots?.userIds,currentUserId:P,currentUser:x,contentToBeScheduled:U.contentToBeScheduled,shouldSuggestStickers:w,shouldSuggestCustomEmoji:S,shouldUpdateStickerSetOrder:N,recentEmojis:e.recentEmojis,baseEmojiKeywords:I?.keywords,emojiKeywords:M?.keywords,inlineBots:U.inlineBots.byUsername,isInlineBotLoading:U.inlineBots.isLoading,botCommands:f?f.botInfo?.commands||!1:void 0,botMenuButton:f?.botInfo?.menuButton,sendAsUser:B,sendAsChat:O,sendAsId:L,editingDraft:V,requestedDraft:F,requestedDraftFiles:D,attachBots:e.attachMenu.bots,attachMenuPeerType:(0,c.dfQ)(e,n),theme:(0,c.SJA)(e),fileSizeLimit:(0,d.d)(e,"uploadMaxFileparts")*r.dK5,captionLimit:(0,d.d)(e,"captionLength"),isCurrentUserPremium:H,canSendVoiceByPrivacy:z,attachmentSettings:e.attachmentSettings,slowMode:J,currentMessageList:$,isReactionPickerOpen:(0,c.Ani)(e),canBuyPremium:!H&&!(0,c.n_C)(e),canPlayAnimatedEmojis:(0,c.BWX)(e),canSendOneTimeMedia:!g&&y&&!p&&!Z,shouldCollectDebugLogs:e.settings.byKey.shouldCollectDebugLogs,sentStoryReaction:G,stealthMode:e.stories.stealthMode,replyToTopic:Y,quickReplyMessages:e.quickReplies.messagesById,quickReplies:e.quickReplies.byId,canSendQuickReplies:X}}))((e=>{let{type:t,isOnActiveTab:n,dropAreaState:c,isInScheduledList:d,canScheduleUntilOnline:C,isReady:W,isMobile:Q,onDropHide:Y,onFocus:Z,onBlur:X,editingMessage:ee,chatId:te,threadId:ne,storyId:ae,currentMessageList:oe,messageListType:ie,draft:re,chat:se,chatFullInfo:le,replyToTopic:fe,isForCurrentMessageList:Te,isCurrentUserPremium:Pe,canSendVoiceByPrivacy:xe,isChatWithBot:Re,isChatWithSelf:Le,isChannel:Fe,fileSizeLimit:De,isRightColumnShown:je,isSelectModeActive:$e,isReactionPickerOpen:Ke,isForwarding:_e,pollModal:Je,botKeyboardMessageId:He,botKeyboardPlaceholder:qe,inputPlaceholder:et,withScheduledButton:tt,stickersForEmoji:nt,customEmojiForEmoji:at,topInlineBotIds:ot,currentUserId:ft,currentUser:vt,captionLimit:Mt,contentToBeScheduled:kt,shouldSuggestStickers:Tt,shouldSuggestCustomEmoji:Pt,baseEmojiKeywords:xt,emojiKeywords:Rt,recentEmojis:Lt,inlineBots:Bt,isInlineBotLoading:Ot,botCommands:Ft,sendAsUser:Dt,sendAsChat:Ut,sendAsId:jt,editingDraft:$t,requestedDraft:Kt,requestedDraftFiles:_t,botMenuButton:zt,attachBots:Jt,attachMenuPeerType:Ht,attachmentSettings:Vt,theme:qt,slowMode:Gt,shouldUpdateStickerSetOrder:Wt,editableInputCssSelector:Qt,editableInputId:Yt,inputId:Zt,className:Xt,availableReactions:en,topReactions:tn,canBuyPremium:nn,canPlayAnimatedEmojis:an,shouldCollectDebugLogs:on,sentStoryReaction:rn,stealthMode:sn,canSendOneTimeMedia:ln,quickReplyMessages:cn,quickReplies:dn,canSendQuickReplies:mn,onForward:un}=e;const{sendMessage:An,clearDraft:hn,showDialog:pn,forwardMessages:gn,openPollModal:yn,closePollModal:fn,loadScheduledHistory:vn,openThread:En,addRecentEmoji:Cn,sendInlineBotResult:bn,loadSendAs:wn,resetOpenChatWithDraft:Sn,callAttachBot:Nn,addRecentCustomEmoji:In,showNotification:Mn,showAllowedMessageTypesNotification:kn,openStoryReactionPicker:Tn,closeReactionPicker:Pn,sendStoryReaction:xn,editMessage:Rn}=(0,o.ko)(),Ln=(0,F.A)(),Bn=(0,a.li)(null),On=(0,a.li)(null),[Fn,Dn]=(0,_.A)(""),[Un,jn]=(0,a.J0)(!1),$n=(0,O.A)(Qt),Kn=(0,a.li)(),_n=(0,U.A)(c),{width:zn}=E.A.get(),Jn="messageList"===t,Hn="story"===t,Vn=Jn?se?.sendAsPeerIds:void 0,qn=Vn&&(Vn.length>1||!Vn.some((e=>e.id===ft))),[Gn,Wn,Qn]=(0,B.A)(),Yn=(0,$.A)(te,ne),[Zn,Xn,ea]=(0,B.A)(),[ta,na,aa]=(0,B.A)(),oa=ee&&(0,l.rO)(ee),{emojiSet:ia,members:ra,botCommands:sa}=le||{},la=ia?.id,ca=!(!rn||!("emoticon"in rn))&&rn.emoticon===r.tNZ.emoticon;(0,a.vJ)(A.VU,[Fn]);const da=(0,a.li)(0),[ma,ua]=(0,j.A)(Jn&&C,Qn);(0,P.A)((()=>{jn(!0)}),430),(0,a.vJ)((()=>{Jn||Pn()}),[Jn,ae]),(0,a.vJ)((()=>{Kn.current=void 0}),[te]),(0,a.vJ)((()=>{te&&W&&!Hn&&vn({chatId:te})}),[W,te,ne,Hn]),(0,a.vJ)((()=>{te&&se&&!Vn&&W&&(0,l.Vs)(se)&&wn({chatId:te})}),[se,te,W,wn,Vn]);const Aa=(0,a.li)(!1);(0,J.A)((e=>{let[t,n]=e;Aa.current=Boolean(te===t&&Vn&&!n)}),[te,Vn]);const[ha,pa]=(0,a.J0)([]),ga=Boolean(ha.length),[ya,fa]=(0,a.J0)(void 0),{canSendStickers:va,canSendGifs:Ea,canAttachMedia:Ca,canAttachPolls:ba,canAttachEmbedLinks:wa,canSendVoices:Sa,canSendPlainText:Na,canSendAudios:Ia,canSendVideos:Ma,canSendPhotos:ka,canSendDocuments:Ta}=(0,a.Kr)((()=>(0,l.Q_)(se,le,Re,Hn)),[se,le,Re,Hn]),Pa=!Na&&!ee,xa=(0,D.A)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yt;if(t===Yt&&Pa)return;const n=window.getSelection();let a;if(a=t===Yt?document.querySelector(Qt):document.getElementById(t),n.rangeCount){const o=n.getRangeAt(0);if((0,N.L)(o,t))return(0,y.oR)(e),void a.dispatchEvent(new Event("input",{bubbles:!0}))}Dn(`${Fn()}${e}`),(0,s.Uz)((()=>{(0,h.A)(a)}))})),Ra=(0,D.A)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yt;const n=(0,M.A)(e,["escape_html","emoji_html","br_html"]).join("").replace(/\u200b+/g,"");xa(n,t)})),La=(0,D.A)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yt;const n=(0,k.Q)(e);xa(n,t)})),Ba=(0,D.A)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yt;xa((0,S.hB)(e),t)})),Oa=(0,D.A)((()=>{ya&&(La(ya,Yt),fa(void 0))})),{shouldSuggestCompression:Fa,shouldForceCompression:Da,shouldForceAsFile:Ua,handleAppendFiles:ja,handleFileSelect:$a,onCaptionUpdate:Ka,handleClearAttachments:_a,handleSetAttachments:za}=function(e){let{attachments:t,fileSizeLimit:n,setHtml:i,setAttachments:r,chatId:s,canSendAudios:c,canSendVideos:d,canSendPhotos:m,canSendDocuments:u,insertNextText:A,editedMessage:h}=e;const g=(0,F.A)(),{openLimitReachedModal:y,showAllowedMessageTypesNotification:f,showNotification:v}=(0,o.ko)(),[E,C]=(0,a.J0)(!1),[b,S]=(0,a.J0)(!1),[N,I]=(0,a.J0)(void 0),M=(0,D.A)((()=>{r(p.p),A()})),k=(0,D.A)((e=>{const a="function"==typeof e?e(t):e;if(a.length)if(a.some((e=>{const t=(0,l.iT)(e);return"audio"===t&&!c&&!u||"video"===t&&!d&&!u||"image"===t&&!m&&!u||"file"===t&&!u})))f({chatId:s});else if(a.some((e=>{let{size:t}=e;return t>n})))y({limit:"uploadMaxFileparts"});else{r(a);const e=a.some((e=>{const t=(0,l.iT)(e);return"audio"===t&&!c||"video"===t&&!d||"image"===t&&!m}));C(Boolean(e&&u)),S(!u),I(void 0)}else M()}));return{shouldSuggestCompression:N,handleAppendFiles:(0,D.A)((async(e,n)=>{if(h){const t=await(0,w.A)(e[0].name,e[0]),n=h&&(0,l.eh)(h,t);h?.groupedId?n?k([t]):v({message:g("lng_edit_media_album_error")}):k([t])}else{const a=await Promise.all(e.map((e=>(0,w.A)(e.name,e,{shouldSendAsSpoiler:n||void 0}))));k([...t,...a])}})),handleFileSelect:(0,D.A)((async(e,t)=>{if(h){const t=await(0,w.A)(e[0].name,e[0]),n=h&&(0,l.eh)(h,t);h?.groupedId?n?k([t]):v({message:g("lng_edit_media_album_error")}):k([t])}else{const t=await Promise.all(e.map((e=>(0,w.A)(e.name,e))));k(t)}I(t)})),onCaptionUpdate:i,handleClearAttachments:M,handleSetAttachments:k,shouldForceCompression:b,shouldForceAsFile:E}}({attachments:ha,setHtml:Dn,setAttachments:pa,fileSizeLimit:De,chatId:te,canSendAudios:Ia,canSendVideos:Ma,canSendPhotos:ka,canSendDocuments:Ta,insertNextText:Oa,editedMessage:ee}),[Ja,Ha,Va]=(0,B.A)(),[qa,Ga,Wa]=(0,B.A)(),[Qa,Ya,Za]=(0,B.A)(),[Xa,eo,to]=(0,B.A)(),[no,ao,oo]=(0,B.A)(),[io,ro,so]=(0,B.A)(),{startRecordingVoice:lo,stopRecordingVoice:co,pauseRecordingVoice:mo,activeVoiceRecording:uo,currentRecordTime:Ao,recordButtonRef:ho,startRecordTimeRef:po,isViewOnceEnabled:go,setIsViewOnceEnabled:yo,toogleViewOnceEnabled:fo}=(()=>{const e=(0,a.li)(null),[t,n]=(0,a.J0)(),o=(0,a.li)(),[i,r]=(0,a.J0)(),[l,c]=(0,a.J0)(!1);(0,a.vJ)((()=>{v.Yw&&v.pW&&Be()}),[]);const d=(0,D.A)((async()=>{try{const{stop:t,pause:a}=await Oe((t=>{e.current&&(o.current&&Date.now()%4==0&&(0,s.RK)((()=>{e.current&&(e.current.style.boxShadow=`0 0 0 ${50*(t||0)}px rgba(0,0,0,.15)`)})),r(Date.now()))}));o.current=Date.now(),r(Date.now()),n({stop:t,pause:a})}catch(e){console.error(e)}})),m=(0,D.A)((()=>{if(t){(0,s.RK)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.pause()}catch(e){return void console.error(e)}}})),u=(0,D.A)((()=>{if(t){n(void 0),o.current=void 0,r(void 0),(0,s.RK)((()=>{e.current&&(e.current.style.boxShadow="none")}));try{return t.stop()}catch(e){return void console.error(e)}}}));(0,a.vJ)((()=>t?(0,ke.A)(u):void 0),[t,u]);const A=(0,D.A)((()=>{c(!l)}));return{startRecordingVoice:d,pauseRecordingVoice:m,stopRecordingVoice:u,activeVoiceRecording:t,currentRecordTime:i,recordButtonRef:e,startRecordTimeRef:o,isViewOnceEnabled:l,setIsViewOnceEnabled:c,toogleViewOnceEnabled:A}})(),vo=Te&&!Hn;(0,T.A)((()=>{Yn({type:"recordAudio"})}),vo?uo&&r.cqp:void 0),(0,a.vJ)((()=>{Te&&!Hn&&(uo||Yn({type:"cancel"}))}),[uo,Te,Hn,Yn]);const Eo=(0,z.i)(Boolean(ee));(0,a.vJ)((()=>{Te&&!Hn&&Fn()&&!Eo.current&&Yn({type:"typing"})}),[Fn,Eo,Te,Hn,Yn]);const Co=se&&(0,l.SJ)(se),{isEmojiTooltipOpen:bo,closeEmojiTooltip:wo,filteredEmojis:So,filteredCustomEmojis:No,insertEmoji:Io}=(0,ye.A)(Boolean(W&&n&&(Hn||Te)&&Tt&&!ga),Fn,Dn,void 0,Lt,xt,Rt),{isCustomEmojiTooltipOpen:Mo,closeCustomEmojiTooltip:ko,insertCustomEmoji:To}=(0,de.A)(Boolean(W&&n&&(Hn||Te)&&Pt&&!ga),Fn,Dn,$n,Bn,at),{isStickerTooltipOpen:Po,closeStickerTooltip:xo}=function(e,t,n){const{loadStickersForEmoji:i,clearStickersForEmoji:s}=(0,o.ko)(),[l,c,d]=(0,B.A)(!1),m=(0,q.A)((()=>{const n=t();if(!e||!n||v.TL&&n.length>8)return;if(!n.match(v.TL?Ne.A:r.bpX))return;const a=(0,H.S)(n);return a&&(v.TL&&1===(0,Ie.A)(a)||!v.TL&&Boolean(n.match(Me)))?v.TL?a:a.match(/alt="(.+)"/)?.[1]:void 0}),[t,e]),u=(0,R.A)((()=>Boolean(m())),[m]),A=Boolean(n?.length);return(0,a.vJ)((()=>{if(!e||!u)return;const t=m();t?A||i({emoji:t}):s()}),[e,u,m,A,i,s]),(0,a.vJ)(d,[d,t]),{isStickerTooltipOpen:Boolean(u&&A&&!l),closeStickerTooltip:c}}(Boolean(W&&n&&(Hn||Te)&&Tt&&va&&!ga),Fn,nt),{isMentionTooltipOpen:Ro,closeMentionTooltip:Lo,insertMention:Bo,mentionFilteredUsers:Oo}=(0,Se.A)(Boolean(Jn&&W&&Te&&!ga),Fn,Dn,$n,Bn,ra,ot,ft),{isOpen:Fo,botId:Do,isGallery:Uo,switchPm:jo,switchWebview:$o,results:Ko,closeTooltip:_o,help:zo,loadMore:Jo}=function(e,t,n,i){const{queryInlineBot:r,resetInlineBot:s,resetAllInlineBots:l}=(0,o.ko)(),[c,d,m]=(0,B.A)(!1),u=(0,V.gs)((()=>{const t=n();return e&&t.startsWith("@")?function(e){if(!e.startsWith("@"))return Ce;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(ve);return n?we(n[1],n[2],""===n[2]&&!t.match(Ee)):Ce}(t):Ce}),[n,e],300),{username:A,query:h,canShowHelp:p,usernameLowered:g}=(0,R.A)(u,[u,n],!0);(0,J.A)((e=>{let[t]=e;t&&s({username:t})}),[A,s]),(0,a.vJ)((()=>{g&&r({chatId:t,username:g,query:h})}),[t,h,r,g]),(0,a.vJ)(m,[m,n]);const{id:y,switchPm:f,switchWebview:v,offset:E,results:C,isGallery:b,help:w}=g&&i?.[g]||{},S=Boolean((C?.length||f)&&!c);(0,a.vJ)((()=>{S||A||l()}),[S,l,A]);const N=(0,D.A)((()=>{g&&r({chatId:t,username:g,query:h,offset:E})}));return{isOpen:S,botId:y,isGallery:b,switchPm:f,switchWebview:v,results:C,closeTooltip:d,help:p&&w?`@${A} ${w}`:void 0,loadMore:N}}(Boolean(Jn&&W&&Te&&!ga),te,Fn,Bt),Ho=Boolean(dn&&Object.keys(dn).length),{isOpen:Vo,close:qo,filteredBotCommands:Go,filteredQuickReplies:Wo}=function(e,t,n,o,i){const[r,s]=(0,a.J0)(),[l,c]=(0,a.J0)(),[d,m,u]=(0,B.A)(!1),A=(0,V.gs)((()=>{const n=t();return e&&n.startsWith("/")?(0,H.S)(n).match(G)?.[0].trim():void 0}),[t,e],300),h=(0,q.A)(A,[A,t],!0);return(0,a.vJ)((()=>{const e=h(),t=n||o;if(!e||!t&&!i)return s(void 0),void c(void 0);const a=e.substring(1),r=t?.filter((e=>!a||e.command.startsWith(a)));s(r?.length?r:void 0);const l=Object.values(i||{}).filter((e=>!a||e.shortcut.startsWith(a)));c(l?.length?l:void 0)}),[h,n,o,i]),(0,a.vJ)(u,[u,t]),{isOpen:Boolean((r?.length||l?.length)&&!d),close:m,filteredBotCommands:r,filteredQuickReplies:l}}(Boolean(Jn&&W&&Te&&(Ft&&Ft?.length||sa?.length||Ho&&mn)),Fn,Ft,sa,mn?dn:void 0);(e=>{let{draft:t,chatId:n,threadId:l,getHtml:c,setHtml:d,editedMessage:m,isDisabled:u}=e;const{saveDraft:A,clearDraft:h,loadCustomEmojis:p}=(0,o.ko)(),y=(0,a.li)(!1);(0,a.vJ)((()=>{const e=c(),n=void 0!==t?.isLocal;(0,k.Q)(t?.text)!==e||n?y.current=!0:y.current=!1}),[t,c]),(0,a.vJ)((()=>{y.current=!1}),[n,l]);const f=Boolean(m),v=(0,D.A)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(u||f||!y.current)return;const t=c();t?(0,s.YS)((()=>{A({chatId:e.chatId??n,threadId:e.threadId??l,text:(0,g.Ay)(t)})})):h({chatId:e.chatId??n,threadId:e.threadId??l,shouldKeepReply:!0})})),E=(0,ue.A)(r.mPG,!0,void 0,[n,l]);(0,me.A)((e=>{let[a,o,r]=e;if(u)return;const s=y.current;if(n===a&&l===o){if(s&&!t)return;if(!t&&r&&d(""),s)return}if(m||!t)return;d((0,k.Q)(t.text));const c=t.text?.entities?.map((e=>e.type===i.C7.CustomEmoji&&e.documentId)).filter(Boolean)||[];c.length&&p({ids:c})}),[n,l,t,c,d,m,u]),(0,a.Nf)((()=>{if(!u)return()=>{f||v({chatId:n,threadId:l}),pe=!0,(0,s.YS)((()=>{pe=!1}))}}),[n,l,f,v,u]);const C=(0,z.i)(n),b=(0,z.i)(l);(0,a.vJ)((()=>{if(u||pe)return;if(!c())return void v();const e=C.current,t=b.current;E((()=>{C.current===e&&b.current===t&&v()}))}),[C,c,u,E,b,v]),(0,Ae.A)(v),(0,he.A)(v)})({draft:re,chatId:te,threadId:ne,getHtml:Fn,setHtml:Dn,editedMessage:ee,isDisabled:Hn||Boolean(Kt)});const Qo=(0,D.A)((function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||Dn(""),pa(p.p),fa(void 0),wo(),ko(),xo(),Lo(),Q?setTimeout((()=>Za()),350):Za()})),[Yo,Zo,Xo]=((e,t,n,i,c,d,m,u,A,p)=>{const{editMessage:y,setEditingDraft:f,toggleMessageWebPage:v}=(0,o.ko)(),[E,C]=(0,a.J0)(!1),b=A?.replyInfo?.replyToMsgId;(0,L.A)((e=>{let[a,o]=e;if(!n)return;if(b&&o!==b)return t(""),void C(!1);if(a?.id===n.id&&b===o)return;const i=!a&&p?.text.length?p:n.content.text,l=(0,k.Q)(i);t(l),C(!0),(0,s.Uz)((()=>{const e=document.querySelector(r.m$5);e&&(0,h.A)(e,!0)}))}),[n,b,p,t]),(0,a.vJ)((()=>{if(!n)return;const e=!("webPage"in n.content)&&n.content.text?.entities?.some((e=>ge.has(e.type)));v({chatId:d,threadId:m,noWebPage:e})}),[d,m,n]),(0,a.vJ)((()=>{if(n)return()=>{const t=(0,g.Ay)(e()),n=t.text.length?t:void 0;f({chatId:d,threadId:m,type:u,text:n})}}),[d,n,e,f,m,u]);const w=(0,V.tF)((()=>{if(!n)return!1;const t=(0,g.Ay)(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),S=(0,q.A)(w,[w,e],!0);(0,L.A)((e=>{let[t]=e;n&&t?.id===n.id&&S()&&v({chatId:d,threadId:m,noWebPage:!1})}),[n,d,e,m,S]);const N=(0,D.A)((()=>{A&&(0,s.YS)((()=>{t((0,k.Q)(A.text)),(0,s.Uz)((()=>{const e=document.querySelector(r.m$5);e&&(0,h.A)(e,!0)}))}))})),I=(0,D.A)((()=>{i(),N()})),M=(0,D.A)((()=>{const{text:t,entities:a}=(0,g.Ay)(e());n&&(t||(0,l.mR)(n)?(y({messageList:{chatId:d,threadId:m,type:u},text:t,entities:a}),i(),N()):c())})),T=(0,D.A)((()=>{if(!n)return;const t=(0,g.Ay)(e()),a=t.text.length?t:void 0;f({chatId:d,threadId:m,type:u,text:a})}));return(0,Ae.A)(T),(0,he.A)(T),[M,I,E]})(Fn,Dn,ee,Qo,ao,te,ne,ie,re,$t),ei=(0,z.i)(Qo),ti=(0,z.i)(co);(0,a.vJ)((()=>()=>{ti.current(),ei.current()}),[te,ne,ei,ti]);const ni=(0,D.A)((()=>{const e=da.current;Mn(e?{message:Ln("UnlockPremiumEmojiHint2"),action:{action:"openChat",payload:{id:ft,shouldReplaceHistory:!0}},actionText:Ln("Open")}:{message:Ln("UnlockPremiumEmojiHint"),action:{action:"openPremiumModal",payload:{initialSection:"animated_emoji"}},actionText:Ln("PremiumMore")}),da.current=Number(!e)})),ai=(0,R.A)((()=>Zn||!un||Fn()&&!ga?ee&&Xo?It.Edit:!v.pW||uo||_e||Fn()&&!ga?d?It.Schedule:It.Send:It.Record:It.Forward),[uo,ee,Fn,ga,_e,Zn,un,Xo,d]),oi=!d,{isContextMenuOpen:ii,handleContextMenu:ri,handleContextMenuClose:si,handleContextMenuHide:li}=(0,x.A)(ho,!(ai===It.Send&&oi)),{contextMenuPosition:ci,handleContextMenu:di,handleBeforeContextMenu:mi,handleContextMenuHide:ui}=(0,x.A)(On,!Hn);(0,a.vJ)((()=>{Ke||ci&&(Tn({peerId:te,storyId:ae,position:ci}),ui())}),[te,ui,Ke,ae,ci]),ce(Te||Hn,La,za,fa,ee,!Pe&&!Le,ni);const Ai=(0,D.A)((()=>{ee&&Zo()})),hi=(0,D.A)(((e,t)=>{const n=t?Mt: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})),pi=(0,D.A)((()=>{if(Gt&&!Co){const e=document.querySelector(Qt),t=(0,f.Fm)(),n=Kn.current&&Math.floor(t-Kn.current),a=Gt.nextSendDate&&Gt.nextSendDate>t;if(n&&n<Gt.seconds||a){const o=a?Gt.nextSendDate-t:Gt.seconds-n;return pn({data:{message:Ln("SlowModeHint",(0,u.QO)(o)),isSlowMode:!0,hasErrorKey:!1}}),e?.blur(),!1}}return!0})),gi=(0,D.A)((e=>{let{attachments:t,sendCompressed:n=Vt.shouldCompress,sendGrouped:a=Vt.shouldSendGrouped,isSilent:o,scheduledAt:i}=e;if(!oe&&!ae)return;const{text:r,entities:l}=(0,g.Ay)(Fn());(r||t.length)&&hi(r,!0)&&pi()&&(ee?Rn({messageList:oe,text:r,entities:l,attachments:(0,w.L)(t,n)}):An({messageList:oe,text:r,entities:l,scheduledAt:i,isSilent:o,shouldUpdateStickerSetOrder:Wt,attachments:(0,w.L)(t,n),shouldGroupMessages:a}),Kn.current=(0,f.Fm)(),hn({chatId:te,isLocalOnly:!0}),(0,s.YS)((()=>{Qo()})))})),yi=(0,D.A)(((e,t,n,a)=>{gi({attachments:ha,sendCompressed:e,sendGrouped:t,isSilent:n,scheduledAt:a})})),fi=(0,D.A)((async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;if(!oe&&!ae)return;let n=ha;if(uo){const e=await co(),t=go?r.dxe:void 0;if(e){const{blob:a,duration:o,waveform:i}=e;n=[await(0,w.A)("wonderful-voice-message.ogg",a,{voice:{duration:o,waveform:i},ttlSeconds:t})]}}const{text:a,entities:o}=(0,g.Ay)(Fn());if(n.length)return void gi({attachments:n,scheduledAt:t,isSilent:e});if(!a&&!_e)return;if(!hi(a))return;const i=document.querySelector(Qt);if(a){if(!pi())return;An({messageList:oe,text:a,entities:o,scheduledAt:t,isSilent:e,shouldUpdateStickerSetOrder:Wt})}_e&&gn({scheduledAt:t,isSilent:e}),Kn.current=(0,f.Fm)(),hn({chatId:te,isLocalOnly:!0}),v.pz&&i&&i===document.activeElement&&b(i),(0,s.YS)((()=>{Qo()}))})),vi=(0,D.A)((()=>{"webApp"===zt?.type&&Nn({chatId:te,url:zt.url,threadId:ne})})),Ei=(0,D.A)((()=>{Za(),Ga()})),Ci=(0,D.A)(((e,t,n)=>{if(e&&"queryId"in e){const{id:a,queryId:o,isSilent:i}=e;return void bn({id:a,queryId:o,scheduledAt:t,isSilent:i,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;yi(n,o,a,t)}else An({...e,messageList:n,scheduledAt:t});else fi(Boolean(a),t)}));(0,L.A)((e=>{let[t]=e;oe&&kt&&kt!==t&&ma((e=>{Ci(kt,e,oe)}))}),[kt,oe,Ci,ma]),(0,a.vJ)((()=>{Kt&&(La(Kt),Sn(),(0,s.Uz)((()=>{const e=document.getElementById(Yt);(0,h.A)(e,!0)})))}),[Yt,Kt,Sn,Dn]),(0,a.vJ)((()=>{_t?.length&&($a(_t),Sn())}),[$a,_t,Sn]);const bi=(0,D.A)(((e,t)=>{const n="id"in e.stickerSetInfo&&e.stickerSetInfo.id;e.isFree||Pe||Le||n===la?Ba(e,t):ni()})),wi=(0,D.A)((e=>{bi(e,r.e0F)})),Si=(0,D.A)(((e,t,n)=>{(oe||ae)&&(d||n?(Wn(),ma((n=>{Qn(),Ci({gif:e,isSilent:t},n,oe),(0,s.YS)((()=>{Qo(!0)}))}))):(An({messageList:oe,gif:e,isSilent:t}),(0,s.YS)((()=>{Qo(!0)}))))})),Ni=(0,D.A)((function(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;(oe||ae)&&(e={...e,isPreloadedGlobally:!0},d||n?(Wn(),ma((n=>{Qn(),Ci({sticker:e,isSilent:t},n,oe),(0,s.YS)((()=>{Qo(a)}))}))):(An({messageList:oe,sticker:e,isSilent:t,shouldUpdateStickerSetOrder:Wt&&o}),(0,s.YS)((()=>{Qo(a)}))))})),Ii=(0,D.A)(((e,t,n)=>{if(!oe&&!ae)return;d||n?ma((n=>{Ci({id:e.id,queryId:e.queryId,isSilent:t},n,oe)})):bn({id:e.id,queryId:e.queryId,isSilent:t,messageList:oe});const a=document.querySelector(Qt);v.pz&&a&&a===document.activeElement&&b(a),hn({chatId:te,isLocalOnly:!0}),(0,s.YS)((()=>{Qo()}))})),Mi=(0,D.A)((()=>{hn({chatId:te,isLocalOnly:!0}),(0,s.YS)((()=>{Qo()}))})),ki=(0,D.A)((e=>{oe&&(d?(ma((t=>{Ci({poll:e},t,oe)})),fn()):(An({messageList:oe,poll:e}),fn()))})),Ti=(0,D.A)((e=>{if(d)ma((t=>{Ci({...e,isSilent:!0},t,oe)}));else if(e&&("sendCompressed"in e||"sendGrouped"in e)){const{sendCompressed:t=!1,sendGrouped:n=!1}=e;yi(t,n,!0)}else fi(!0)})),Pi=(0,D.A)((()=>{const e=document.querySelector(Qt);if(!Q||e!==document.activeElement)return Wa(),Za(),void eo();e?.blur(),setTimeout((()=>{Wa(),Za(),eo()}),100)}));(0,a.vJ)((()=>{Pa&&Dn("")}),[Pa,Dn,ha]);const xi=(0,D.A)((e=>{Ra(e,r.e0F)})),Ri=(0,D.A)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Yt;const t=window.getSelection();if(t.rangeCount){const n=t.getRangeAt(0);if((0,N.L)(n,e))return void document.execCommand("delete",!1)}Dn(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(),i=window.getSelection();o.setStart(n,a),o.setEnd(n,a),i.removeAllRanges(),i.addRange(o),document.execCommand("delete",!1);const r=t.innerHTML;return document.body.removeChild(t),r}(Fn()))})),Li=(0,D.A)((()=>{Ri(r.e0F)})),Bi=(0,D.A)((()=>{En({chatId:te,threadId:ne,type:"scheduled",noForumTopicPanel:!0})}));(0,a.vJ)((()=>{je&&Q&&Za()}),[je,Za,Q]),(0,a.vJ)((()=>{W&&($e?ro():setTimeout((()=>{so()}),200))}),[$e,so,ro,W]);const Oi=Re&&"webApp"===zt?.type&&!ee,Fi=(0,R.A)((()=>Oi&&!Fn()&&!uo),[Oi,Fn,uo]),[Di,Ui]=(0,a.Kr)((()=>Gt?.nextSendDate?["SlowModeWait",Gt.nextSendDate]:sn?.activeUntil&&Hn?["StealthModeActiveHint",sn.activeUntil]:[]),[Hn,Gt?.nextSendDate,sn?.activeUntil]),ji=Ja||Qa||bo||Xa||Ro||Fo||no||qa||ta||Po||Vo||Mo||Fi||ii||Boolean(uo)||ha.length>0||Zn,$i=ji&&!Ke&&Hn&&!ta&&!Qa,Ki=se?.isForum&&se?.isForumAsMessages&&ne===i.l3?fe?Ln("Chat.InputPlaceholderReplyInTopic",fe.title):Ln("Message.Placeholder.MessageInGeneral"):void 0;(0,a.vJ)((()=>{ji?Z?.():X?.()}),[ji,X,Z]);const{shouldRender:_i,transitionClassNames:zi}=(0,K.A)($i),Ji=!(ai!==It.Record||Ca&&xe&&Sa),Hi=(0,D.A)((()=>{switch(ai){case It.Forward:un?.();break;case It.Send:fi();break;case It.Record:Ji?xe?Sa||kn({chatId:te}):Mn({message:Ln("VoiceMessagesRestrictedByPrivacy",se?.title)}):(yo(!1),lo());break;case It.Edit:Yo();break;case It.Schedule:if(uo&&mo(),!oe)return;ma((e=>{Ci({},e,oe)}))}})),Vi=(0,U.A)(ee,!0),qi=ee||Vi,Gi=new Date;Gi.setSeconds(0),Gi.setMilliseconds(0);const Wi=new Date;Wi.setFullYear(Wi.getFullYear()+1);let Qi="SendMessage";switch(ai){case It.Forward:Qi="Forward";break;case It.Edit:Qi="Save edited message";break;case It.Record:Qi=Ca?"AccDescrVoiceMessage":"Conversation.DefaultRestrictedMedia"}const Yi=(0,m.A)("Composer",!$e&&"shown",io&&"hover-disabled",Un&&"mounted",Xt),Zi=(0,D.A)((e=>{let t,n;if("emoticon"in e)t=e.emoticon;else{const a=(0,o.mS)().customEmojis.byId[e.documentId];if(!a)return;if(!a.isFree&&!Pe&&!Le)return void ni();const i=(0,g.Ay)((0,S.hB)(a));t=i.text,n=i.entities}An({text:t,entities:n,isReaction:!0}),Pn()})),Xi=(0,D.A)((e=>{Tn({peerId:te,storyId:ae,position:e,sendAsMessage:!0})})),er=(0,D.A)((()=>{const e=rn?void 0:r.tNZ;xn({peerId:te,storyId:ae,containerId:(0,l.$_)(te,ae),reaction:e})})),tr=(0,D.A)((()=>{ma((e=>{Ci({},e,oe)}))})),nr=(0,D.A)((()=>{Ti()})),ar=(0,D.A)((()=>{Ci({},r.NkL,oe)})),or=(0,D.A)(((e,t)=>{ma((n=>{Ci({sendCompressed:e,sendGrouped:t},n,oe)}))})),ir=(0,D.A)(((e,t)=>{Ti({sendCompressed:e,sendGrouped:t})})),rr=(0,a.Kr)((()=>{switch(ai){case It.Edit:return Yo;case It.Schedule:return tr;default:return fi}}),[ai,Yo]),sr=Re&&"commands"===zt?.type&&!ee&&!1!==Ft&&!uo;return a.Ay.createElement("div",{className:Yi},Jn&&Ca&&W&&a.Ay.createElement(ct,{isOpen:c!==lt.I.None,withQuick:c===lt.I.QuickFile||_n===lt.I.QuickFile,onHide:Y,onFileSelect:$a,editingMessage:ee}),_i&&a.Ay.createElement(Ct.A,{topReactions:tn,allAvailableReactions:en,onToggleReaction:Zi,isPrivate:!0,isReady:W,canBuyPremium:nn,isCurrentUserPremium:Pe,isInSavedMessages:Le,isInStoryViewer:Hn,canPlayAnimatedEmojis:an,onShowMore:Xi,className:zi}),a.Ay.createElement(Ue,{chatId:te,threadId:ne,canShowCustomSendMenu:oi,attachments:ha,getHtml:Fn,isReady:W,shouldSuggestCompression:Fa,shouldForceCompression:Da,shouldForceAsFile:Ua,isForCurrentMessageList:Te,isForMessage:Jn,shouldSchedule:d,forceDarkTheme:Hn,onCaptionUpdate:Ka,onSendSilent:ir,onSend:yi,onSendScheduled:or,onFileAppend:ja,onClear:_a,onAttachmentsUpdate:za,onCustomEmojiSelect:wi,onRemoveSymbol:Li,onEmojiSelect:xi,editingMessage:ee}),a.Ay.createElement(ht,{isOpen:Je.isOpen,isQuiz:Je.isQuiz,shouldBeAnonymous:Fe,onClear:fn,onSend:ki}),qi&&a.Ay.createElement(St,{isOpen:no,isSchedule:"scheduled"===ie,onClose:oo,message:qi}),a.Ay.createElement(pt,{isOpen:Xa,onClose:to,chatId:te,selectedSendAsId:jt,sendAsPeerIds:Vn,isCurrentUserPremium:Pe}),a.Ay.createElement(ut,{isOpen:Ro,filteredUsers:Oo,onInsertUserName:Bo,onClose:Lo}),a.Ay.createElement(Xe,{isOpen:Vo,chatId:te,withUsername:Boolean(sa),botCommands:Go,quickReplies:Wo,getHtml:Fn,self:vt,quickReplyMessages:cn,onClick:Mi,onClose:qo}),a.Ay.createElement("div",{className:(0,m.A)("composer-wrapper",Hn&&"with-story-tweaks")},a.Ay.createElement("svg",{className:"svg-appendix",width:"9",height:"20"},a.Ay.createElement("defs",null,a.Ay.createElement("filter",{x:"-50%",y:"-14.7%",width:"200%",height:"141.2%",filterUnits:"objectBoundingBox",id:"composerAppendix"},a.Ay.createElement("feOffset",{dy:"1",in:"SourceAlpha",result:"shadowOffsetOuter1"}),a.Ay.createElement("feGaussianBlur",{stdDeviation:"1",in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),a.Ay.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.Ay.createElement("g",{fill:"none","fill-rule":"evenodd"},a.Ay.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.Ay.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"}))),Jn&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(mt,{isOpen:Fo,botId:Do,isGallery:Uo,inlineBotResults:Ko,switchPm:jo,switchWebview:$o,loadMore:Jo,isSavedMessages:Le,canSendGifs:Ea,isCurrentUserPremium:Pe,onSelectResult:Ii,onClose:_o}),a.Ay.createElement(it,{onClear:Ai,shouldForceShowEditing:Boolean(Xo&&ee)}),a.Ay.createElement(Et,{chatId:te,threadId:ne,getHtml:Fn,isDisabled:!wa||ga})),a.Ay.createElement("div",{className:(0,m.A)("message-input-wrapper",(0,I.y)(vt))},Jn&&a.Ay.createElement(a.Ay.Fragment,null,Oi&&a.Ay.createElement(Ze,{isOpen:Fi,text:zt.text,isDisabled:Boolean(uo),onClick:vi}),sr&&a.Ay.createElement(Ve.A,{className:(0,m.A)("bot-commands",qa&&"activated"),round:!0,disabled:void 0===Ft,color:"translucent",onActivate:Ei,ariaLabel:"Open bot command keyboard"},a.Ay.createElement("i",{className:"icon icon-bot-commands-filled"})),qn&&(Dt||Ut)&&a.Ay.createElement(Qe.A,{round:!0,color:"translucent",onClick:Xa?to:Pi,ariaLabel:Ln("SendMessageAsTitle"),className:(0,m.A)("send-as-button",Aa.current&&"appear-animation")},a.Ay.createElement(wt.A,{peer:Dt||Ut,size:"tiny"}))),(!Pa||Ea||va)&&a.Ay.createElement(yt.A,{chatId:te,threadId:ne,isMobile:Q,isReady:W,isSymbolMenuOpen:Qa,openSymbolMenu:Ya,closeSymbolMenu:Za,canSendStickers:va,canSendGifs:Ea,isMessageComposer:Jn,onGifSelect:Si,onStickerSelect:Ni,onCustomEmojiSelect:bi,onRemoveSymbol:Ri,onEmojiSelect:Ra,closeBotCommandMenu:Wa,closeSendAsMenu:to,isSymbolMenuForced:Gn,canSendPlainText:!Pa,inputCssSelector:Qt,idPrefix:t,forceDarkTheme:Hn}),a.Ay.createElement(At.A,{ref:Bn,id:Zt,editableInputId:Yt,customEmojiPrefix:t,isStoryInput:Hn,chatId:te,canSendPlainText:!Pa,threadId:ne,isReady:W,isActive:!ga,getHtml:Fn,placeholder:uo&&zn<=600?"":Pa?Ln("Chat.PlaceholderTextNotAllowed"):qe||et||Ln(Ki||"Message"),timedPlaceholderDate:Ui,timedPlaceholderLangKey:Di,forcedPlaceholder:zo,canAutoFocus:W&&Te&&!ga&&Jn,noFocusInterception:ga,shouldSuppressFocus:Q&&Qa,shouldSuppressTextFormatter:bo||Ro||Fo,onUpdate:Dn,onSend:rr,onSuppressedFocus:Za,onFocus:Xn,onBlur:ea}),Jn&&a.Ay.createElement(a.Ay.Fragment,null,Ot&&Boolean(Do)&&a.Ay.createElement(bt.A,{color:"gray"}),tt&&a.Ay.createElement(Qe.A,{round:!0,faded:!0,className:"scheduled-button",color:"translucent",onClick:Bi,ariaLabel:"Open scheduled messages"},a.Ay.createElement("i",{className:"icon icon-schedule"})),Boolean(He)&&!uo&&!ee&&a.Ay.createElement(Ve.A,{className:Ja?"activated":"",round:!0,color:"translucent",onActivate:Ha,ariaLabel:"Open bot command keyboard"},a.Ay.createElement("i",{className:"icon icon-bot-command"}))),uo&&Boolean(Ao)&&a.Ay.createElement("span",{className:"recording-state"},(0,u.JW)(Ao-po.current)),a.Ay.createElement(Ge,{chatId:te,threadId:ne,editingMessage:ee,hasReplaceableMedia:oa,isButtonVisible:!uo,canAttachMedia:Ca,canAttachPolls:ba,canSendPhotos:ka,canSendVideos:Ma,canSendDocuments:Ta,canSendAudios:Ia,onFileSelect:$a,onPollCreate:yn,isScheduled:d,attachBots:Jn?Jt:void 0,peerType:Ht,shouldCollectDebugLogs:on,theme:qt,onMenuOpen:na,onMenuClose:aa}),Jn&&Boolean(He)&&a.Ay.createElement(Ye,{messageId:He,isOpen:Ja,onClose:Va}),Jn&&Ft&&a.Ay.createElement(We,{isOpen:qa,botCommands:Ft,onClose:Wa}),a.Ay.createElement(rt.A,{key:`custom-emoji-tooltip-${Yt}`,chatId:te,isOpen:Mo,onCustomEmojiSelect:To,addRecentCustomEmoji:In,onClose:ko}),a.Ay.createElement(gt,{key:`sticker-tooltip-${Yt}`,chatId:te,threadId:ne,isOpen:Po,onStickerSelect:Ni,onClose:xo}),a.Ay.createElement(dt.A,{key:`emoji-tooltip-${Yt}`,isOpen:bo,emojis:So,customEmojis:No,addRecentEmoji:Cn,addRecentCustomEmoji:In,onEmojiSelect:Io,onCustomEmojiSelect:Io,onClose:wo}))),ln&&uo&&a.Ay.createElement(Qe.A,{className:(0,m.A)("view-once",go&&"active"),round:!0,color:"secondary",ariaLabel:Ln("Chat.PlayOnceVoiceMessageTooltip"),onClick:fo},a.Ay.createElement(ze.A,{name:"view-once"}),a.Ay.createElement(ze.A,{name:"one-filled"})),uo&&a.Ay.createElement(Qe.A,{round:!0,color:"danger",className:"cancel",onClick:co,ariaLabel:"Cancel voice recording"},a.Ay.createElement("i",{className:"icon icon-delete"})),Hn&&!uo&&a.Ay.createElement(Qe.A,{round:!0,className:"story-reaction-button",color:"secondary",onClick:er,onContextMenu:di,onMouseDown:mi,ariaLabel:Ln("AccDescrLike"),ref:On},rn&&a.Ay.createElement(Nt.A,{key:"documentId"in rn?rn.documentId:rn.emoticon,containerId:(0,l.$_)(te,ae),reaction:rn,withEffectOnly:ca}),(!rn||ca)&&a.Ay.createElement("i",{className:(0,m.A)("icon","icon-heart",ca&&"story-reaction-heart"),"aria-hidden":!0})),a.Ay.createElement(Qe.A,{ref:ho,round:!0,color:"secondary",className:(0,m.A)(ai,"main-button",!W&&"not-ready",uo&&"recording"),disabled:Ji,allowDisabledClick:!0,noFastClick:!0,ariaLabel:Ln(Qi),onClick:Hi,onContextMenu:ai===It.Send&&oi?ri:void 0},a.Ay.createElement("i",{className:"icon icon-send"}),a.Ay.createElement("i",{className:"icon icon-microphone-alt"}),un&&a.Ay.createElement("i",{className:"icon icon-forward"}),Jn&&a.Ay.createElement("i",{className:"icon icon-schedule"}),Jn&&a.Ay.createElement("i",{className:"icon icon-check"})),oi&&a.Ay.createElement(st.A,{isOpen:ii,canSchedule:Jn&&!go,canScheduleUntilOnline:C&&!go,onSendSilent:Le?void 0:nr,onSendSchedule:d?void 0:tr,onSendWhenOnline:ar,onClose:si,onCloseAnimationEnd:li,isSavedMessages:Le}),ua)})))},54314:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(84051),o=n(13439),i=n(59589),r=n(67321),s=n(4961),l=n(39351),c=n(64493),d=n(8410),m=n(21849);const u=(0,a.ph)((0,o.EK)(((e,t)=>{let{chat:n,isSavedDialog:a}=t;const o=(0,i.L8)(n.id),s=(0,r.nZ4)(e,n.id),l=o&&(0,r.mBe)(e,(0,i.e7)(n)),c=l&&(0,i.tv)(l)&&!n.isSupport,d=o&&!s&&!c&&!a,m=o?(0,i.u0)((0,r.mBe)(e,(0,i.e7)(n))):void 0;return{isPrivateChat:o,isChatWithSelf:s,isBot:c,isChannel:(0,i.WX)(n),isBasicGroup:(0,i.yn)(n),isSuperGroup:(0,i.Vs)(n),currentUserId:e.currentUserId,canDeleteForAll:d,contactName:m}}))((e=>{let{isOpen:t,chat:n,isSavedDialog:r,isChannel:u,isPrivateChat:A,isChatWithSelf:h,isBot:p,isBasicGroup:g,isSuperGroup:y,currentUserId:f,canDeleteForAll:v,contactName:E,onClose:C,onCloseAnimationEnd:b}=e;const{leaveChannel:w,deleteHistory:S,deleteSavedHistory:N,deleteChannel:I,deleteChatUser:M,blockUser:k}=(0,o.ko)(),T=(0,l.A)(),P=(0,i.Js)(T,n),x=(0,a.hb)((()=>{S({chatId:n.id,shouldDeleteForAll:!0}),C()}),[n.id,C]),R=(0,a.hb)((()=>{S({chatId:n.id,shouldDeleteForAll:!0}),k({userId:n.id}),C()}),[n.id,C]),L=(0,a.hb)((()=>{r?N({chatId:n.id}):A?S({chatId:n.id,shouldDeleteForAll:!1}):g?(M({chatId:n.id,userId:f}),S({chatId:n.id,shouldDeleteForAll:!1})):!u&&!y||n.isCreator?(u||y)&&n.isCreator&&I({chatId:n.id}):w({chatId:n.id}),C()}),[A,g,u,y,f,n.isCreator,n.id,r,C]),B=(0,a.hb)((()=>{u||y?(w({chatId:n.id}),C()):L()}),[n.id,L,u,y,w,C]);return a.Ay.createElement(d.A,{isOpen:t,className:"DeleteChatModal",header:a.Ay.createElement("div",{className:"modal-header",dir:T.isRtl?"rtl":void 0},a.Ay.createElement(m.A,{size:"tiny",peer:n,isSavedMessages:h}),a.Ay.createElement("h3",{className:"modal-title"},T(r?h?"ClearHistoryMyNotesTitle":"ClearHistoryTitleSingle2":u&&!n.isCreator?"LeaveChannel":u&&n.isCreator?"ChannelDelete":g||y?"Group.LeaveGroup":"DeleteChatUser"))),onClose:C,onCloseAnimationEnd:b},r?a.Ay.createElement("p",null,(0,s.A)(h?T("ClearHistoryMyNotesMessage"):T("ClearHistoryMessageSingle",P),["simple_markdown","emoji"])):u&&n.isCreator?a.Ay.createElement("p",null,(0,s.A)(T("ChatList.DeleteAndLeaveGroupConfirmation",P),["simple_markdown","emoji"])):u&&!n.isCreator||g||y?a.Ay.createElement("p",null,(0,s.A)(T("ChannelLeaveAlertWithName",P),["simple_markdown","emoji"])):a.Ay.createElement("p",null,(0,s.A)(T("ChatList.DeleteChatConfirmation",E),["simple_markdown","emoji"])),a.Ay.createElement("div",{className:"dialog-buttons-column"},p&&!r&&a.Ay.createElement(c.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:R},T("DeleteAndStop")),v&&a.Ay.createElement(c.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:x},E?(0,s.A)(T("ChatList.DeleteForEveryone",E)):T("DeleteForAll")),!A&&n.isCreator&&!r&&a.Ay.createElement(c.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:L},T("DeleteForAll")),a.Ay.createElement(c.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:A||r?L:B},T(r?"Delete":u&&!n.isCreator?"LeaveChannel":u&&n.isCreator?"Chat.Input.Delete":g||y?"Group.LeaveGroup":v?"ChatList.DeleteForCurrentUser":"Delete")),a.Ay.createElement(c.A,{className:"confirm-dialog-button",isText:!0,onClick:C},T("Cancel"))))})))},44589:(e,t,n)=>{n.d(t,{A:()=>f});var a=n(84051),o=n(13439),i=n(31481),r=n(59589),s=n(91525),l=n(37661),c=n(5912),d=n(39351),m=n(17712),u=n(62587),A=n(91800),h=n(19806),p=n(94189),g=n(52988);const y=new Set(["svg","svgz"]),f=(0,a.ph)((e=>{let{message:t,observeIntersection:n,smaller:f,canAutoLoad:v,autoLoadFileMaxSizeMb:E,uploadProgress:C,withDate:b,datetime:w,className:S,sender:N,isSelected:I,isSelectable:M,shouldWarnAboutSvg:k,isDownloading:T,onCancelUpload:P,onMediaClick:x,onDateClick:R}=e;const{cancelMessageMediaDownload:L,downloadMessageMedia:B,setSettingOption:O}=(0,o.ko)(),F=(0,a.li)(null),D=(0,d.A)(),[U,j,$]=(0,l.A)(),[K,_]=(0,a.J0)(!1),z=t.content.document||(0,r.os)(t),{fileName:J,size:H,timestamp:V}=z,q=(0,s.rK)(z)||"",G=(0,c.Vz)(F,n),[W,Q]=(0,l.A)();(0,a.vJ)((()=>{G&&Q()}),[G,Q]);const[Y,Z]=(0,a.J0)(v&&(!E||H<=1048576*E)),X=Boolean(T||Y&&W),ee=(0,r.EO)(t,"download"),{loadProgress:te,mediaData:ne}=(0,A.A)(ee,!X,(0,r.nl)(t,"download"),void 0,!0),ae=Boolean(ne),{isUploading:oe,isTransferring:ie,transferProgress:re}=(0,r.LK)(t,C||te,X&&!ae,void 0!==C),se=(0,s.ON)(z),le=se?(0,r.CI)(t):void 0,ce=se?z.previewBlobUrl:void 0,de=(0,u.A)((0,r.EO)(t,"pictogram"),!G),me=x&&Boolean(z.mediaType)&&(i.fNs.has(z.mimeType)||i.RJA.has(z.mimeType)),ue=(0,m.A)((()=>{B({message:t})})),Ae=(0,m.A)((()=>{oe?P&&P():T?L({message:t}):ie?Z(!1):me?x():y.has(q)&&k?j():ue()})),he=(0,m.A)((()=>{O({shouldWarnAboutSvg:!K}),$(),ue()})),pe=(0,m.A)((()=>{R(t.id,t.chatId)}));return a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(g.A,{ref:F,name:J,extension:q,size:H,timestamp:b?w||V:void 0,thumbnailDataUri:le,previewData:ce||de,smaller:f,isTransferring:ie,isUploading:oe,transferProgress:re,className:S,sender:N,isSelectable:M,isSelected:I,actionIcon:me?(0,r._4)(t)?"play":"eye":"download",onClick:Ae,onDateClick:R?pe:void 0}),a.Ay.createElement(p.A,{isOpen:U,onClose:$,confirmHandler:he},D("lng_launch_svg_warning"),a.Ay.createElement(h.A,{className:"dialog-checkbox",checked:K,label:D("lng_launch_exe_dont_ask"),onCheck:_})))}))},80999:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(84051),o=n(87357),i=n(4961),r=n(39351);const s=e=>{let{content:t,className:n}=e;const s=(0,r.A)();return a.Ay.createElement("span",{className:(0,o.A)("DotAnimation",n),dir:s.isRtl?"rtl":"auto"},(0,i.A)(t),a.Ay.createElement("span",{className:"ellipsis"}))}},52988:(e,t,n)=>{n.d(t,{A:()=>y});var a=n(84051),o=n(87357),i=n(11410),r=n(82393),s=n(91525),l=n(76023),c=n(4961),d=n(43874),m=n(45470),u=n(39351),A=n(37960),h=n(34201),p=n(96530),g=n(35913);const y=(0,a.ph)((e=>{let{ref:t,name:n,size:y,extension:f="",timestamp:v,sender:E,thumbnailDataUri:C,previewData:b,className:w,smaller:S,isTransferring:N,isUploading:I,isSelectable:M,isSelected:k,transferProgress:T,actionIcon:P,onClick:x,onDateClick:R}=e;const L=(0,u.A)();let B=(0,a.li)(null);t&&(B=t);const{isMobile:O}=(0,d.Ay)(),[F]=(0,a.J0)(!b),D=Boolean(b),U=(0,m.A)(C,D,O&&!r.QH),j=(0,A.A)(!D),{shouldRender:$,transitionClassNames:K}=(0,h.A)(N,void 0,!0),_=(0,s.fE)(f),z=(0,s.zV)(y),J=(0,a.Kr)((()=>N&&T?`${(0,s.zV)(y*T)} / ${z}`:z),[N,y,z,T]),{width:H,height:V}=(0,l.tP)(S),q=(0,o.A)("File",w,S&&"smaller",x&&!I&&"interactive",k&&"file-is-selected");return a.Ay.createElement("div",{ref:B,className:q,dir:L.isRtl?"rtl":void 0},M&&a.Ay.createElement("div",{className:"message-select-control"},k&&a.Ay.createElement("i",{className:"icon icon-select"})),a.Ay.createElement("div",{className:"file-icon-container",onClick:I?void 0:x},C||b?a.Ay.createElement("div",{className:"file-preview media-inner"},a.Ay.createElement("img",{src:b,className:"full-media",width:H,height:V,draggable:!1,alt:""}),F&&a.Ay.createElement("canvas",{ref:U,className:(0,o.A)("thumbnail",j)})):a.Ay.createElement("div",{className:`file-icon ${_}`},f.length<=4&&a.Ay.createElement("span",{className:"file-ext",dir:"auto"},f)),$&&a.Ay.createElement("div",{className:(0,o.A)("file-progress",_,K)},a.Ay.createElement(g.A,{progress:T,size:S?"s":"m",onClick:I?x:void 0})),x&&a.Ay.createElement("i",{className:(0,o.A)("action-icon","icon",P?`icon-${P}`:"icon-download",$&&"hidden")})),a.Ay.createElement("div",{className:"file-info"},a.Ay.createElement("div",{className:"file-title",dir:"auto",title:n},(0,c.A)(n)),a.Ay.createElement("div",{className:"file-subtitle",dir:"auto"},a.Ay.createElement("span",null,J),E&&a.Ay.createElement("span",{className:"file-sender"},(0,c.A)(E)),!E&&Boolean(v)&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement("span",{className:"bullet"}),a.Ay.createElement(p.A,{onClick:R},(0,i.fS)(L,1e3*v,!0))))),E&&Boolean(v)&&a.Ay.createElement(p.A,{onClick:R},(0,i.be)(L,1e3*v)))}))},51083:(e,t,n)=>{n.d(t,{A:()=>C});var a=n(84051),o=n(13439),i=n(89925),r=n(59589),s=n(67321),l=n(87357),c=n(76023),d=n(4961),m=n(39351),u=n(17712),A=n(41036),h=n(21849),p=n(80999),g=n(34431),y=n(76785),f=n(38102),v=n(80477);const E=2.5*c.$,C=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatId:n,threadId:a}=t;const o=(0,s.hds)(e,n),i=a?(0,s.Vw0)(e,n,a):void 0,r=o?(0,s.ToO)(e,o):void 0,l=Boolean((0,s.zeq)(e,n)),c=a?o?.topics?.[a]:void 0;return{chat:o,threadInfo:i,onlineCount:r,topic:c,areMessagesLoaded:l,messagesCount:c&&(0,s.QbG)(e,n,a),self:(0,s.mBe)(e,e.currentUserId)}}))((e=>{let{typingStatus:t,className:n,statusIcon:s,avatarSize:c="medium",noAvatar:C,status:b,withDots:w,withMediaViewer:S,withUsername:N,withFullInfo:I,withUpdatingStatus:M,withChatType:k,threadInfo:T,noRtl:P,chat:x,onlineCount:R,areMessagesLoaded:L,topic:B,messagesCount:O,noStatusOrTyping:F,withStory:D,storyViewerOrigin:U,noEmojiStatus:j,emojiStatusSize:$,isSavedDialog:K,self:_,onClick:z,onEmojiStatusClick:J}=e;const{loadFullChat:H,openMediaViewer:V,loadProfilePhotos:q}=(0,o.ko)(),G=(0,m.A)(),W=x&&(0,r.Vs)(x),Q=Boolean(x?.isForum&&T&&B),{id:Y,isMin:Z,isRestricted:X}=x||{};(0,a.vJ)((()=>{Y&&!Z&&(I&&H({chatId:Y}),S&&q({profileId:Y}))}),[Y,Z,I,H,q,W,S]);const ee=(0,u.A)(((e,t)=>{x&&t&&(e.stopPropagation(),V({avatarOwnerId:x.id,mediaId:0,origin:"jumbo"===c?i.TQ.ProfileAvatar:i.TQ.MiddleHeaderAvatar}))})),te=(0,a.Kr)((()=>x&&N&&(0,r.Kl)(x)),[x,N]);if(x)return a.Ay.createElement("div",{className:(0,l.A)("ChatInfo",n),dir:!P&&G.isRtl?"rtl":void 0,onClick:z},!C&&!Q&&a.Ay.createElement(a.Ay.Fragment,null,K&&_&&a.Ay.createElement(h.A,{key:"saved-messages",size:c,peer:_,isSavedMessages:!0,className:"saved-dialog-avatar"}),a.Ay.createElement(h.A,{key:x.id,className:(0,l.A)(K&&"overlay-avatar"),size:c,peer:x,withStory:D,storyViewerOrigin:U,storyViewerMode:"single-peer",isSavedDialog:K,onClick:S?ee:void 0})),Q&&a.Ay.createElement(f.A,{topic:B,className:"topic-header-icon",size:E}),a.Ay.createElement("div",{className:"info"},B?a.Ay.createElement("h3",{dir:"auto",className:"fullName"},(0,d.A)(B.title)):a.Ay.createElement(g.A,{peer:x,emojiStatusSize:$,withEmojiStatus:!j,isSavedDialog:K,onEmojiStatusClick:J}),!F&&function(){if(b)return w?a.Ay.createElement(p.A,{className:"status",content:b}):a.Ay.createElement("span",{className:"status",dir:"auto"},s&&a.Ay.createElement(y.A,{className:"status-icon",name:s}),(0,d.A)(b));if(M&&!L&&!X)return a.Ay.createElement(p.A,{className:"status",content:G("Updating")});if(!x)return;if(t)return a.Ay.createElement(v.A,{typingStatus:t});if(Q)return a.Ay.createElement("span",{className:"status",dir:"auto"},a.Ay.createElement(A.Ay,{name:"fade",shouldRestoreHeight:!0,activeKey:void 0!==O?1:2,className:"message-count-transition"},void 0!==O&&G("messages",O,"i")));if(k)return a.Ay.createElement("span",{className:"status",dir:"auto"},G((0,r.Gg)(x)));const e=function(e,t){const n=e((0,r.Gg)(t)),{membersCount:a}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":a?e("Channel"===n?"Subscribers":"Members",a,"i"):n}(G,x),n=R?`, ${G("OnlineCount",R,"i")}`:void 0;return a.Ay.createElement("span",{className:"status"},te&&a.Ay.createElement("span",{className:"handle withStatus"},te),a.Ay.createElement("span",{className:"group-status"},e),n&&a.Ay.createElement("span",{className:"online-status"},n))}()))})))},81642:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(84051),o=n(11410),i=n(39351),r=n(45);const s=(0,a.ph)((e=>{let{message:t,outgoingStatus:n,draftDate:s}=e;const l=(0,i.A)(),c=s&&s>t.date;return a.Ay.createElement("div",{className:"LastMessageMeta"},n&&!c&&a.Ay.createElement(r.A,{status:n}),a.Ay.createElement("span",{className:"time"},(0,o.be)(l,1e3*(c?s:t.date))))}))},47058:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(84051),o=n(13439),i=n(87357),r=n(85982),s=n(43874),l=n(39351),c=n(17712),d=n(64493),m=n(22699),u=n(24433),A=n(76785);const h=(0,a.ph)((e=>{let{title:t,link:n,isDisabled:h,className:p,withShare:g,onRevoke:y}=e;const f=(0,l.A)(),{showNotification:v,openChatWithDraft:E}=(0,o.ko)(),{isMobile:C}=(0,s.Ay)(),b=!y,w=(0,c.A)((()=>{(0,r.eM)(n),v({message:f("LinkCopied")})})),S=(0,c.A)((()=>{h||w()})),N=(0,c.A)((()=>{E({text:{text:n}})})),I=(0,a.Kr)((()=>e=>{let{onTrigger:t,isOpen:n}=e;return a.Ay.createElement(d.A,{round:!0,ripple:!C,size:"smaller",color:"translucent",className:n?"active":"",onClick:t,ariaLabel:f("AccDescrOpenMenu2")},a.Ay.createElement("i",{className:"icon icon-more"}))}),[C,f]);return a.Ay.createElement("div",{className:p},a.Ay.createElement("p",{className:"vCMpiQTJ"},f(t||"InviteLink.InviteLink")),a.Ay.createElement("div",{className:"xNjJHI7j"},a.Ay.createElement("input",{className:(0,i.A)("form-control","Ag6k_p7b"),value:n,readOnly:!0,onClick:S}),b?a.Ay.createElement(d.A,{color:"translucent",className:"obuPXobw",size:"smaller",round:!0,disabled:h,onClick:S},a.Ay.createElement(A.A,{name:"copy"})):a.Ay.createElement(m.A,{className:"p7t3macG",trigger:I,positionX:"right"},a.Ay.createElement(u.A,{icon:"copy",onClick:S,disabled:h},f("Copy")),y&&a.Ay.createElement(u.A,{icon:"delete",onClick:y,destructive:!0},f("RevokeButton")))),g&&a.Ay.createElement(d.A,{size:"smaller",disabled:h,onClick:N},f("FolderLinkScreen.LinkActionShare")))}))},81524:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(84051),o=n(59589),i=n(87357),r=n(11410),s=n(83868),l=n(37661),c=n(5912),d=n(17712),m=n(62587),u=n(37960),A=n(27860);const h=(0,a.ph)((e=>{let{message:t,idPrefix:n="shared-media",isProtected:h,observeIntersection:p,onClick:g}=e;const y=(0,a.li)(null),f=(0,c.Vz)(y,p),v=(0,o.CI)(t),E=(0,m.A)((0,o.EO)(t,"pictogram"),!f),C=(0,u.A)(E),b=(0,o.zX)(t),w=(0,o.y2)(t),[S,,N]=(0,l.A)(w),I=(0,d.A)((()=>{N(),g(t.id,t.chatId)}));return a.Ay.createElement("div",{ref:y,id:`${n}${(0,o.GZ)(t.id)}`,className:"Media scroll-item",onClick:g?I:void 0},a.Ay.createElement("img",{src:v,className:"media-miniature",alt:"",draggable:!h,decoding:"async",onContextMenu:h?s.A:void 0}),a.Ay.createElement("img",{src:E,className:(0,i.A)("full-media","media-miniature",C),alt:"",draggable:!h,decoding:"async",onContextMenu:h?s.A:void 0}),w&&a.Ay.createElement(A.A,{thumbDataUri:E||v,isVisible:S,className:"media-spoiler"}),b&&a.Ay.createElement("span",{className:"video-duration"},b.isGif?"GIF":(0,r.QO)(b.duration)),h&&a.Ay.createElement("span",{className:"protector"}))}))},27860:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(84051),o=n(87357),i=n(45470),r=n(17712),s=n(34201);const l=(0,a.ph)((e=>{let{isVisible:t,withAnimation:n,thumbDataUri:l,className:c,width:d,height:m}=e;const u=(0,a.li)(null),{shouldRender:A,transitionClassNames:h}=(0,s.A)(t,void 0,!0,!n&&void 0,void 0,500),p=(0,i.A)(l,!A,void 0,25,d,m),g=(0,r.A)((e=>{if(!u.current)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,a=e.clientY-t.top,o=n-t.width/2,i=a-t.height/2;u.current.setAttribute("style",`--click-shift-x: ${o}px; --click-shift-y: ${i}px`)}));if(A)return a.Ay.createElement("div",{className:(0,o.A)("qF2WgYVg",h,c,n&&"pNM3cgkY"),ref:u,onClick:n?g:void 0},a.Ay.createElement("canvas",{ref:p,className:"eULqS2yR",width:d,height:m}),a.Ay.createElement("div",{className:"XBor45hE"}))}))},45:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(84051),o=n(41036),i=n(76785),r=function(e){return e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read",e}(r||{});const s=(0,a.ph)((e=>{let{status:t}=e;return a.Ay.createElement("div",{className:"MessageOutgoingStatus"},a.Ay.createElement(o.Ay,{name:"reveal",activeKey:r[t]},"failed"===t?a.Ay.createElement("div",{className:"MessageOutgoingStatus--failed"},a.Ay.createElement(i.A,{name:"message-failed"})):a.Ay.createElement(i.A,{name:`message-${t}`})))}))},42827:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(84051),o=n(87357),i=n(4961),r=n(39351),s=n(34201);const l="Nothing found.",c=(0,a.ph)((e=>{let{text:t=l,description:n}=e;const c=(0,r.A)(),{transitionClassNames:d}=(0,s.A)(!0);return a.Ay.createElement("div",{className:(0,o.A)("NothingFound",d,n&&"with-description")},t,n&&a.Ay.createElement("p",{className:"description"},(0,i.A)(c(n),["br"])))}))},15535:(e,t,n)=>{n.d(t,{A:()=>A});var a=n(84051),o=n(31481),i=n(66644),r=n(87357),s=n(83868),l=n(82393),c=n(14737),d=n(43874),m=n(39351),u=n(64493);const A=(0,a.ph)((e=>{let{isLoading:t=!1,isPasswordVisible:n,error:A,hint:h,placeholder:p="Password",submitLabel:g="Next",description:y,shouldShowSubmit:f,shouldResetValue:v,shouldDisablePasswordManager:E=!1,noRipple:C=!1,clearError:b,onChangePasswordVisibility:w,onInputChange:S,onSubmit:N}=e;const I=(0,a.li)(null),M=(0,m.A)(),{isMobile:k}=(0,d.Ay)(),[T,P]=(0,a.J0)(""),[x,R]=(0,a.J0)(!1),L=k?550:400;return(0,a.vJ)((()=>{v&&P("")}),[v]),(0,c.A)((()=>{l.TF||I.current.focus()}),L),(0,a.vJ)((()=>{A&&(0,i.RK)((()=>{I.current.focus(),I.current.select()}))}),[A]),a.Ay.createElement("form",{action:"",onSubmit:N?function(e){e.preventDefault(),t||x&&N(T)}:s.A,autoComplete:"off"},a.Ay.createElement("div",{className:(0,r.A)("input-group password-input",T&&"touched",A&&"error"),dir:M.isRtl?"rtl":void 0},E&&a.Ay.createElement("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),a.Ay.createElement("input",{ref:I,className:"form-control",type:n?"text":"password",id:"sign-in-password",value:T||"",autoComplete:E?"one-time-code":"current-password",onChange:function(e){A&&b();const{target:t}=e;P(t.value),R(t.value.length>=o.AGC),S&&S(t.value)},maxLength:256,dir:"auto"}),a.Ay.createElement("label",null,A||h||p),a.Ay.createElement("div",{className:"div-button toggle-password",onClick:function(){w(!n)},role:"button",tabIndex:0,title:"Toggle password visibility","aria-label":"Toggle password visibility"},a.Ay.createElement("i",{className:(0,r.A)("icon",n?"icon-eye":"icon-eye-closed")}))),y&&a.Ay.createElement("p",{className:"description"},y),N&&(x||f)&&a.Ay.createElement(u.A,{type:"submit",ripple:!C,isLoading:t,disabled:!x},g))}))},17416:(e,t,n)=>{n.d(t,{A:()=>v});var a=n(84051),o=n(66644),i=n(59589),r=n(87357),s=n(87894),l=n(96374),c=n(39351),d=n(17712),m=n(19806),u=n(46222),A=n(40664),h=n(22720),p=n(52745),g=n(51083),y=n(39970),f=n(17751);const v=(0,a.ph)((e=>{let{className:t,categories:n,itemIds:v,selectedCategories:E,selectedIds:C,filterValue:b,filterPlaceholder:w,notFoundText:S,searchInputId:N,isLoading:I,noScrollRestore:M,isSearchable:k,isRoundCheckbox:T,lockedSelectedIds:P,lockedUnselectedIds:x,lockedUnselectedSubtitle:R,forceShowSelf:L,isViewOnly:B,onSelectedCategoriesChange:O,onSelectedIdsChange:F,onFilterChange:D,onDisabledClick:U,onLoadMore:j,isCountryList:$,countryList:K}=e;const _=(0,a.li)(null),z=C.length>10;(0,a.vJ)((()=>{k&&setTimeout((()=>{(0,o.YS)((()=>{_.current.focus()}))}),500)}),[k]);const J=(0,a.Kr)((()=>new Set(P)),[P]),H=(0,a.Kr)((()=>new Set(x)),[x]),V=(0,a.Kr)((()=>C.filter((e=>!J.has(e)))),[J,C]),q=(0,a.Kr)((()=>n?(0,s.dU)(n,"type"):{}),[n]),G=(0,a.Kr)((()=>{if(b)return v;const e=[],t=[],n=[];return v.forEach((a=>{J.has(a)?e.push(a):H.has(a)?n.push(a):t.push(a)})),e.concat(t,n)}),[b,v,J,H]),W=(0,d.A)((e=>{if(J.has(e))U?.(e,!0);else if(H.has(e))U?.(e,!1);else{if(q[e]){const t=q[e].type,n=E?.slice()||[];n.includes(t)?n.splice(n.indexOf(t),1):n.push(t),O?.(n)}else{const t=C.slice();t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),F?.(t)}D?.("")}})),Q=(0,d.A)((e=>{const{value:t}=e.currentTarget;D?.(t)})),[Y,Z]=(0,l.A)(j,G,Boolean(b)),X=(0,c.A)(),ee=(0,a.Kr)((()=>{if(K)return(0,s.dU)(K,"iso2")}),[K]),te=(0,d.A)((e=>a.Ay.createElement(f.A,{customPeer:e}))),ne=(0,d.A)((e=>{const t=H.has(e);if($&&ee){const t=ee[e];return a.Ay.createElement("div",null,t.defaultName)}return(0,i.L8)(e)?a.Ay.createElement(f.A,{forceShowSelf:L,userId:e,status:t?R:void 0}):a.Ay.createElement(g.A,{chatId:e,status:t?R:void 0})})),ae=(0,a.hb)(((e,t)=>{const n=t?q[e]:void 0,o=H.has(e),i=J.has(e)||o,s=n?E?.includes(n.type):C.includes(e),l=()=>B||o?void 0:a.Ay.createElement(m.A,{label:"",disabled:i,checked:s,round:T});return a.Ay.createElement(h.A,{key:e,className:(0,r.A)("chat-item-clickable picker-list-item",T&&"chat-item"),disabled:i,inactive:B,allowDisabledClick:Boolean(U),secondaryIcon:o?"lock-badge":void 0,onClick:()=>W(e),ripple:!0},T?void 0:l(),n?te(n):ne(e),T?l():void 0)}),[q,T,B,J,H,U,ne,E,C]),oe=(0,a.Kr)((()=>a.Ay.createElement("div",{key:"categories"},Boolean(n?.length)&&a.Ay.createElement("div",{className:"picker-category-title"},X("PrivacyUserTypes")),n?.map((e=>ae(e.type,!0))),a.Ay.createElement("div",{className:"picker-category-title"},X("FilterChats")))),[n,X,ae]);return a.Ay.createElement("div",{className:(0,r.A)("Picker",t)},k&&a.Ay.createElement("div",{className:"picker-header custom-scroll",dir:X.isRtl?"rtl":void 0},E?.map((e=>a.Ay.createElement(y.A,{customPeer:q[e],onClick:W,clickArg:e,canClose:!0}))),P?.map(((e,t)=>a.Ay.createElement(y.A,{peerId:e,isMinimized:z&&t<C.length-5,forceShowSelf:L,onClick:W,clickArg:e}))),V.map(((e,t)=>a.Ay.createElement(y.A,{peerId:e,isMinimized:z&&t+(P?.length||0)<C.length-5,canClose:!0,onClick:W,clickArg:e}))),a.Ay.createElement(A.A,{id:N,ref:_,value:b,onChange:Q,placeholder:w||X("SelectChat")})),Y?.length?a.Ay.createElement(u.A,{className:(0,r.A)("picker-list","custom-scroll",T&&"withRoundedCheckbox"),items:Y,beforeChildren:oe,onLoadMore:Z,noScrollRestore:M},Y.map((e=>ae(e)))):I||!Y||Y.length?a.Ay.createElement(p.A,null):a.Ay.createElement("p",{className:"no-results"},S||"Sorry, nothing found."))}))},39970:(e,t,n)=>{n.d(t,{A:()=>A});var a=n(84051),o=n(13439),i=n(59589),r=n(67321),s=n(87357),l=n(35049),c=n(4961),d=n(39351),m=n(21849),u=n(76785);const A=(0,a.ph)((0,o.EK)(((e,t)=>{let{peerId:n,forceShowSelf:a}=t;if(!n)return{};const o=(0,r.hds)(e,n),i=(0,r.mBe)(e,n);return{chat:o,user:i,isSavedMessages:!a&&i&&i.isSelf}}))((e=>{let{icon:t,title:n,isMinimized:o,canClose:r,clickArg:A,chat:h,user:p,customPeer:g,className:y,fluid:f,isSavedMessages:v,withPeerColors:E,onClick:C}=e;const b=(0,d.A)();let w,S;if(t&&n)w=a.Ay.createElement("div",{className:"item-icon"},a.Ay.createElement(u.A,{name:t})),S=n;else if(g||p||h){w=a.Ay.createElement(m.A,{peer:g||p||h,size:"small",isSavedMessages:v});const e=g&&b(g.titleKey)||(!h||p&&!v?(0,i.u0)(p):(0,i.Js)(b,h,v));S=e?(0,c.A)(e):void 0}const N=(0,s.A)("PickerSelectedItem",y,(h?.isForum||g?.isAvatarSquare)&&"square-avatar",o&&"minimized",r&&"closeable",f&&"fluid",E&&(0,l.y)(g||h||p));return a.Ay.createElement("div",{className:N,onClick:()=>C(A),title:o?S:void 0,dir:b.isRtl?"rtl":void 0},w,!o&&a.Ay.createElement("div",{className:"item-name",dir:"auto"},S),r&&a.Ay.createElement("div",{className:"item-remove"},a.Ay.createElement(u.A,{name:"close"})))})))},20333:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(84051),o=n(87357),i=n(95807),r=n(39351),s=n(76785);const l="_b5HgBXr",c="P6mch4bB",d=(0,a.ph)((e=>{let{leftText:t,rightText:n,floatingBadgeText:d,floatingBadgeIcon:m,progress:u,className:A}=e;const h=(0,r.A)(),p=Boolean(m||d),g=Boolean(u)&&u>.99,y=d?.length,f=u&&(u<.1?0:u>.9?1:.5);return a.Ay.createElement("div",{className:(0,o.A)("nY2ggBsF",p&&"RYtVQAjM",A),style:(0,i.A)(void 0!==u&&`--progress: ${u}`,void 0!==f&&`--tail-position: ${f}`,void 0!==y&&`--digits-count: ${y}`)},p&&a.Ay.createElement("div",{className:"dhigNjAq"},a.Ay.createElement("div",{className:"cOpfCGPh"},a.Ay.createElement("div",{className:"uNwBLNOy"},m&&a.Ay.createElement(s.A,{name:m,className:"MJ7MTmxi"}),d&&a.Ay.createElement("div",{className:"MwzZt3Qo",dir:h.isRtl?"rtl":void 0},d)),a.Ay.createElement("div",{className:"qRwO7SZm"},a.Ay.createElement("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none"},a.Ay.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.Ay.createElement("div",{className:l},a.Ay.createElement("span",null,t)),a.Ay.createElement("div",{className:c},a.Ay.createElement("span",null,n)),a.Ay.createElement("div",{className:(0,o.A)("sZZV0yoe",g&&"m8ie8IxL")},a.Ay.createElement("div",{className:l},a.Ay.createElement("span",null,t)),a.Ay.createElement("div",{className:c},a.Ay.createElement("span",null,n))))}))},17751:(e,t,n)=>{n.d(t,{A:()=>f});var a=n(84051),o=n(13439),i=n(89925),r=n(59589),s=n(67321),l=n(87357),c=n(4961),d=n(39351),m=n(17712),u=n(42452),A=n(21849),h=n(80999),p=n(34431),g=n(76785),y=n(80477);const f=(0,a.ph)((0,o.EK)(((e,t)=>{let{userId:n,forceShowSelf:a}=t;const{isSynced:o}=e,i=n?(0,s.mBe)(e,n):void 0,r=n?(0,s.K0y)(e,n):void 0,l=!a&&i&&i.isSelf,c=l?i:(0,s.mBe)(e,e.currentUserId);return{user:i,userStatus:r,isSavedMessages:l,areMessagesLoaded:Boolean(n&&(0,s.zeq)(e,n)),self:c,isSynced:o}}))((e=>{let{customPeer:t,typingStatus:n,avatarSize:s="medium",status:f,statusIcon:v,withDots:E,withMediaViewer:C,withUsername:b,withStory:w,withFullInfo:S,withUpdatingStatus:N,emojiStatusSize:I,noStatusOrTyping:M,noEmojiStatus:k,noFake:T,noVerified:P,noRtl:x,user:R,userStatus:L,self:B,isSavedMessages:O,isSavedDialog:F,areMessagesLoaded:D,adminMember:U,ripple:j,className:$,storyViewerOrigin:K,isSynced:_,onEmojiStatusClick:z,iconElement:J,rightElement:H}=e;const{loadFullUser:V,openMediaViewer:q,loadProfilePhotos:G}=(0,o.ko)(),W=(0,d.A)(),{id:Q}=R||{};(0,a.vJ)((()=>{Q&&(S&&_&&V({userId:Q}),C&&G({profileId:Q}))}),[Q,S,C,_]);const Y=(0,m.A)(((e,t)=>{R&&t&&(e.stopPropagation(),q({avatarOwnerId:R.id,mediaId:0,origin:"jumbo"===s?i.TQ.ProfileAvatar:i.TQ.MiddleHeaderAvatar}))})),Z=(0,a.Kr)((()=>R&&b&&(0,r.Kl)(R)),[R,b]);if(!R&&!t)return;const X=U?U.customTitle||W(U.isOwner?"GroupInfo.LabelOwner":"GroupInfo.LabelAdmin"):void 0;return a.Ay.createElement("div",{className:(0,l.A)("ChatInfo",$),dir:!x&&W.isRtl?"rtl":void 0},F&&B&&a.Ay.createElement(A.A,{key:"saved-messages",size:s,peer:B,isSavedMessages:!0,className:"saved-dialog-avatar"}),a.Ay.createElement(A.A,{key:t?.type||R?.id,size:s,peer:t||R,className:(0,l.A)(F&&"overlay-avatar"),isSavedMessages:O,isSavedDialog:F,withStory:w,storyViewerOrigin:K,storyViewerMode:"single-peer",onClick:C?Y:void 0}),a.Ay.createElement("div",{className:"info"},X?a.Ay.createElement("div",{className:"info-name-title"},a.Ay.createElement(p.A,{peer:R,withEmojiStatus:!k,emojiStatusSize:I,isSavedMessages:O,isSavedDialog:F,onEmojiStatusClick:z}),X&&a.Ay.createElement("span",{className:"custom-title"},X)):a.Ay.createElement(p.A,{peer:t||R,noFake:T,noVerified:P,withEmojiStatus:!k,emojiStatusSize:I,isSavedMessages:O,isSavedDialog:F,onEmojiStatusClick:z,iconElement:J}),(f||!O&&!M)&&function(){if(f)return E?a.Ay.createElement(h.A,{className:"status",content:f}):a.Ay.createElement("span",{className:"status",dir:"auto"},v&&a.Ay.createElement(g.A,{className:"status-icon",name:v}),(0,c.A)(f));if(N&&!D)return a.Ay.createElement(h.A,{className:"status",content:W("Updating")});if(t?.subtitleKey)return a.Ay.createElement("span",{className:"status",dir:"auto"},a.Ay.createElement("span",{className:"user-status",dir:"auto"},W(t.subtitleKey)));if(!R)return;if(n)return a.Ay.createElement(y.A,{typingStatus:n});const e=(0,r.CD)(W,R,L),o=(0,l.A)("handle",e&&"withStatus");return a.Ay.createElement("span",{className:(0,l.A)("status",(0,r.PF)(R,L,!0)&&"online")},Z&&a.Ay.createElement("span",{className:o},Z),e&&a.Ay.createElement("span",{className:"user-status",dir:"auto"},e))}()),j&&a.Ay.createElement(u.A,null),H)})))},70195:(e,t,n)=>{n.d(t,{A:()=>$});var a=n(84051),o=n(13439),i=n(89925),r=n(59589),s=n(67321),l=n(87357),c=n(50442),d=n(79824),m=n(82393),u=n(4961),A=n(39351),h=n(17712),p=n(29886),g=n(41257),y=n(97335),f=n(58554),v=n(41036),E=n(21849),C=n(34431),b=n(14242),w=n(35049),S=n(43874),N=n(45470),I=n(37661),M=n(62587),k=n(37960),T=n(65843),P=n(57474),x=n(76785);const R=(0,a.ph)((e=>{let{chat:t,user:n,photo:o,isSavedMessages:i,isSavedDialog:s,canPlayVideo:c,onClick:d}=e;const h=(0,a.li)(null),p=(0,A.A)(),{isMobile:g}=(0,S.Ay)(),y=n&&(0,r.PL)(n),f=t&&(0,r.kE)(t.id),v=t&&(0,r.Qe)(t.id),E=n||t,C=E&&!i&&!y&&!f&&!v,{isVideo:R}=o||{},L=C&&(0,r.cP)(E,"normal"),B=(0,M.A)(L),O=C&&o&&!R&&`photo${o.id}?size=c`,F=(0,M.A)(O),D=C&&o&&R&&(0,r.hU)(o),U=(0,M.A)(D)||F,[j,$]=(0,I.A)(),K=Boolean(U&&(!R||j)),_=(0,k.A)(K),z=C&&!K&&!B&&o?.thumbnail?.dataUri,J=(0,N.A)(o?.thumbnail?.dataUri,!z,g&&!m.QH),H=o||B||z;(0,a.vJ)((()=>{h.current&&!c&&(h.current.currentTime=0)}),[c]);const V=(0,a.Kr)((()=>i?s?"my-notes":"avatar-saved-messages":y?"avatar-deleted-account":f?"reply-filled":v?"author-hidden":void 0),[v,y,s,f,i]);let q;if(V)q=a.Ay.createElement(x.A,{name:V,role:"img"});else if(H)q=a.Ay.createElement(a.Ay.Fragment,null,z?a.Ay.createElement("canvas",{ref:J,className:"thumb"}):a.Ay.createElement("img",{src:B,draggable:!1,className:"thumb",alt:""}),o&&(R?a.Ay.createElement(T.A,{canPlay:c,ref:h,src:U,className:(0,l.A)("avatar-media",_),muted:!0,disablePictureInPicture:!0,loop:!0,playsInline:!0,onReady:$}):a.Ay.createElement("img",{src:U,className:(0,l.A)("avatar-media",_),alt:""})));else if(n){const e=(0,r.Yg)(n);q=e?(0,b.Qh)(e,2):void 0}else if(t){const e=(0,r.Js)(p,t);q=e&&(0,b.Qh)(e,(0,r.L8)(t.id)?2:1)}else q=a.Ay.createElement("div",{className:"spinner-wrapper"},a.Ay.createElement(P.A,{color:"white"}));const G=(0,l.A)("ProfilePhoto",(0,w.y)(E),i&&"saved-messages",v&&"anonymous-forwards",y&&"deleted-account",f&&"replies-bot-account",!i&&!H&&"no-photo");return a.Ay.createElement("div",{className:G,onClick:H?d:void 0},"string"==typeof q?(0,u.A)(q,["hq_emoji"]):q)}));var L=n(38102);const B="cpyXyZDl",O="Wm9Ygb23",F="nflKKT3R",D="tFkRrvxe",U="GBGLnrA7",j="ZZRcBh8v",$=(0,a.ph)((0,o.EK)(((e,t)=>{let{userId:n}=t;const{isSynced:a}=e,o=(0,s.mBe)(e,n),i=(0,r.L8)(n),l=(0,s.K0y)(e,n),c=(0,s.hds)(e,n),{mediaId:d,avatarOwnerId:m}=(0,s.nTw)(e).mediaViewer,u=c?.isForum,{threadId:A}=(0,s.Xf0)(e)||{},h=u&&A?c?.topics?.[A]:void 0,p=i?(0,s.vGo)(e,n):void 0,g=i?void 0:(0,s.AWZ)(e,n),y=(o||c)?.emojiStatus,f=y?e.customEmojis.byId[y.documentId]:void 0;return{isSynced:a,user:o,userStatus:l,chat:c,userPersonalPhoto:p?.personalPhoto,userProfilePhoto:p?.profilePhoto,userFallbackPhoto:p?.fallbackPhoto,chatProfilePhoto:g?.profilePhoto,mediaId:d,avatarOwnerId:m,emojiStatusSticker:f,...h&&{topic:h,messagesCount:(0,s.QbG)(e,n,A)}}}))((e=>{let{forceShowSelf:t,canPlayVideo:n,user:s,userStatus:b,chat:w,isSynced:S,mediaId:N,avatarOwnerId:I,topic:M,messagesCount:k,userPersonalPhoto:T,userProfilePhoto:P,userFallbackPhoto:x,chatProfilePhoto:$,emojiStatusSticker:K}=e;const{loadFullUser:_,openMediaViewer:z,openPremiumModal:J,openStickerSet:H,openPrivacySettingsNoticeModal:V}=(0,o.ko)(),q=(0,A.A)(),{id:G}=s||{},{id:W}=w||{},Q=s?.photos||w?.photos||d.p,Y=(0,p.A)(N),Z=(0,p.A)(I),X=(0,g.i)(N),[ee,te]=(0,a.J0)(!0),ne=ee?q.isRtl?"slideRtl":"slide":"none",[ae,oe]=(0,a.J0)(0),ie=Q.length<=1||0===ae,re=Q.length<=1||ae===Q.length-1;(0,a.vJ)((()=>{Z&&void 0!==Y&&void 0===N&&(te(!1),oe(Y))}),[N,Y,Z]),(0,a.vJ)((()=>{te(!1),oe(X.current||0)}),[X,Q]),(0,a.vJ)((()=>{ae>Q.length&&(te(!1),oe(Math.max(0,Q.length-1)))}),[ae,Q.length]),(0,a.vJ)((()=>{S&&G&&!t&&_({userId:G})}),[G,_,S,t]),function(e,t){(0,a.vJ)((()=>{e.slice(t,t+4).forEach((e=>{f.Ih(`photo${e.id}?size=c`)||f.hd(`photo${e.id}?size=c`,y.qZ.BlobUrl)}))}),[t,e])}(Q,ae);const se=(0,h.A)((()=>{z({avatarOwnerId:G||W,mediaId:ae,origin:t?i.TQ.SettingsAvatar:i.TQ.ProfileAvatar})})),le=(0,h.A)((()=>{G?J({fromUserId:G}):H({stickerSetInfo:K.stickerSetInfo})})),ce=(0,h.A)((()=>{ie||(te(!0),oe(ae-1))})),de=(0,h.A)((()=>{re||(te(!0),oe(ae+1))})),me=(0,h.A)((()=>{V({chatId:w.id,isReadDate:!1})}));if((0,a.vJ)((()=>{const e=document.querySelector(`.${U}`);if(e)return(0,c.wJ)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:m.TF?(e,t)=>t===c.ez.Right?(ce(),!0):t===c.ez.Left&&(de(),!0):void 0})}),[de,ce]),s||w)return M?a.Ay.createElement("div",{className:"yzg267rr"},a.Ay.createElement(L.A,{topic:M,size:120,className:"ZCxp0_t4",letterClassName:"lkfZNWOm",noLoopLimit:!0}),a.Ay.createElement("h3",{className:"umOuiu3K",dir:q.isRtl?"rtl":void 0},(0,u.A)(M.title)),a.Ay.createElement("p",{className:"tLTzQ2ks"},k?q("Chat.Title.Topic",k,"i"):q("lng_forum_no_messages"))):a.Ay.createElement("div",{className:(0,l.A)("ProfileInfo",t&&"DnvLcTfv"),dir:q.isRtl?"rtl":void 0},a.Ay.createElement("div",{className:U},function(){if(Q&&!(Q.length<=1))return a.Ay.createElement("div",{className:"uyvKpR3B"},Q.map(((e,t)=>a.Ay.createElement("span",{className:(0,l.A)("wB4yjvei",t===ae&&"aZmp9FLh")}))))}(),!t&&T&&a.Ay.createElement("div",{className:(0,l.A)(O,ie&&D)},a.Ay.createElement("div",{className:F},q(T.isVideo?"UserInfo.CustomVideo":"UserInfo.CustomPhoto"))),t&&x&&a.Ay.createElement("div",{className:(0,l.A)(O,(ie||re)&&D)},a.Ay.createElement("div",{className:F,onClick:function(){ie&&(te(!0),oe(Q.length-1))}},!re&&a.Ay.createElement(E.A,{photo:x,className:"R7w3H5eC",size:"mini"}),q(x.isVideo?"UserInfo.PublicVideo":"UserInfo.PublicPhoto"))),a.Ay.createElement(v.Ay,{activeKey:ae,name:ne},ue),!ie&&a.Ay.createElement("button",{type:"button",dir:q.isRtl?"rtl":void 0,className:(0,l.A)(j,"RQITz4WQ"),"aria-label":q("AccDescrPrevious"),onClick:ce}),!re&&a.Ay.createElement("button",{type:"button",dir:q.isRtl?"rtl":void 0,className:(0,l.A)(j,"_0F1Txru"),"aria-label":q("Next"),onClick:de})),a.Ay.createElement("div",{className:"UcyW7tVh",dir:q.isRtl?"rtl":"auto"},(s||w)&&a.Ay.createElement(C.A,{peer:s||w,withEmojiStatus:!0,emojiStatusSize:24,onEmojiStatusClick:le,noLoopLimit:!0,canCopyTitle:!0}),function(){const e=W||G;if(!(0,r.Qe)(e))return s?a.Ay.createElement("div",{className:(0,l.A)(B,"status",(0,r.PF)(s,b)&&"online")},a.Ay.createElement("span",{className:"_HDVUj4P",dir:"auto"},(0,r.CD)(q,s,b)),b?.isReadDateRestrictedByMe&&a.Ay.createElement("span",{className:"Qga38M20",onClick:me},a.Ay.createElement("span",null,q("StatusHiddenShow")))):a.Ay.createElement("span",{className:(0,l.A)(B,"status"),dir:"auto"},(0,r.WX)(w)?q("Subscribers",w.membersCount??0,"i"):q("Members",w.membersCount??0,"i"))}()));function ue(e){const t=(Q.length>0?Q[ae]:void 0)||T||P||$||x;return a.Ay.createElement(R,{key:ae,user:s,chat:w,photo:t,canPlayVideo:Boolean(e&&n),onClick:se})}})))},45603:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(84051),o=n(97335),i=n(59589),r=n(87357),s=n(62587),l=n(37960),c=n(87412),d=n(61911);const m=(0,a.ph)((e=>{let{reaction:t,availableReactions:n,className:m,size:u,withIconHeart:A,observeIntersection:h}=e;const p="documentId"in t,g=(0,a.Kr)((()=>n?.find((e=>(0,i.a0)(e.reaction,t)))),[n,t]),y=g?.staticIcon?.id,f=(0,s.A)(`document${y}`,!y,o.qZ.BlobUrl),v=(0,l.A)(f),E="emoticon"in t&&"🦄"===t.emoticon,C=A&&"emoticon"in t&&"❤"===t.emoticon;return p?a.Ay.createElement(c.A,{documentId:t.documentId,className:(0,r.A)("ReactionStaticEmoji",m),size:u,observeIntersectionForPlaying:h}):C?a.Ay.createElement("i",{className:"ReactionStaticEmoji icon icon-heart",style:`font-size: ${u}px; width: ${u}px`}):a.Ay.createElement("img",{className:(0,r.A)("ReactionStaticEmoji",E&&"with-unicorn-fix",v,m),style:u?`width: ${u}px; height: ${u}px`:void 0,src:f||d,alt:g?.title,draggable:!1})}))},94285:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(84051),o=n(13439),i=n(87357),r=n(39351),s=n(17712),l=n(64493),c=n(40664),d=n(8410),m=n(98033);const u=(0,a.ph)((e=>{let{isOpen:t,subject:n="messages",peerId:u,photo:A,messageIds:h,storyId:p,onClose:g,onCloseAnimationEnd:y}=e;const{reportMessages:f,reportPeer:v,reportProfilePhoto:E,reportStory:C,exitMessageSelectMode:b}=(0,o.ko)(),[w,S]=(0,a.J0)("spam"),[N,I]=(0,a.J0)(""),M=(0,s.A)((()=>{switch(n){case"messages":f({messageIds:h,reason:w,description:N}),b();break;case"peer":v({chatId:u,reason:w,description:N});break;case"media":E({chatId:u,photo:A,reason:w,description:N});break;case"story":C({peerId:u,storyId:p,reason:w,description:N})}g()})),k=(0,s.A)((e=>{S(e)})),T=(0,s.A)((e=>{I(e.target.value)})),P=(0,r.A)(),x=(0,a.Kr)((()=>[{value:"spam",label:P("lng_report_reason_spam")},{value:"violence",label:P("lng_report_reason_violence")},{value:"pornography",label:P("lng_report_reason_pornography")},{value:"childAbuse",label:P("lng_report_reason_child_abuse")},{value:"copyright",label:P("ReportPeer.ReasonCopyright")},{value:"illegalDrugs",label:"Illegal Drugs"},{value:"personalDetails",label:"Personal Details"},{value:"other",label:P("lng_report_reason_other")}]),[P]);if("messages"===n&&!h||"peer"===n&&!u||"media"===n&&(!u||!A)||"story"===n&&(!p||!u))return;const R=P("messages"===n?"lng_report_message_title":"ReportPeer.Report");return a.Ay.createElement(d.A,{isOpen:t,onClose:g,onEnter:t?M:void 0,onCloseAnimationEnd:y,className:(0,i.A)("narrow","story"===n&&"component-theme-dark"),title:R},a.Ay.createElement(m.A,{name:"report-message",options:x,onChange:k,selected:w}),a.Ay.createElement(c.A,{label:P("lng_report_reason_description"),value:N,onChange:T}),a.Ay.createElement("div",{className:"dialog-buttons"},a.Ay.createElement(l.A,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},P("lng_report_button")),a.Ay.createElement(l.A,{className:"confirm-dialog-button",isText:!0,onClick:g},P("Cancel"))))}))},38102:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(87412),i=n(76471);const r=(0,a.ph)((e=>{let{topic:t,className:n,letterClassName:r,size:s,noLoopLimit:l,observeIntersection:c,onClick:d}=e;return t.iconEmojiId&&"0"!==t.iconEmojiId?a.Ay.createElement(o.A,{documentId:t.iconEmojiId,className:n,size:s,observeIntersectionForPlaying:c,loopLimit:l?void 0:2,onClick:d}):a.Ay.createElement(i.A,{iconColor:t.iconColor,title:t.title,topicId:t.id,className:n,letterClassName:r,onClick:d})}))},80477:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(84051),o=n(13439),i=n(59589),r=n(67321),s=n(4961),l=n(39351),c=n(80999);const d=(0,a.ph)((0,o.EK)(((e,t)=>{let{typingStatus:n}=t;return n.userId?{typingUser:(0,r.mBe)(e,n.userId)}:{}}))((e=>{let{typingStatus:t,typingUser:n}=e;const o=(0,l.A)(),r=n&&!n.isSelf&&(0,i.u0)(n),d=o(t.action).replace("{user}","").replace("{emoji}",t.emoji||"").trim();return a.Ay.createElement("p",{className:"typing-status",dir:o.isRtl?"rtl":"auto"},r&&a.Ay.createElement("span",{className:"sender-name",dir:"auto"},(0,s.A)(r)),a.Ay.createElement(c.A,{content:d}))})))},37378:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(84051),o=n(59589),i=n(87357),r=n(11410),s=n(58849),l=n(49086),c=n(4961),d=n(39351),m=n(17712),u=n(96530),A=n(81524),h=n(56440);const p=(0,a.ph)((e=>{let{message:t,senderTitle:n,isProtected:p,observeIntersection:g,onMessageClick:y}=e;const f=(0,d.A)();let v=(0,o.T_)(t);if(!v){const e=(0,o.ZD)(t);if(e){const{url:n,domain:a}=e;v={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,o.P5)(t)!==n?(0,l.C)(f,t,void 0,void 0,170):void 0}}}const E=(0,m.A)((()=>{y(t.id,t.chatId)}));if(!v)return;const{siteName:C,url:b,displayUrl:w,title:S,description:N,formattedDescription:I,photo:M,video:k}=v,T=!n&&N&&(0,s.A)(N,170),P=(0,i.A)("WebLink scroll-item",!M&&!k&&"without-media"),x=b.replace("mailto:","")||w;return a.Ay.createElement("div",{className:P,"data-initial":(C||w)[0],dir:f.isRtl?"rtl":void 0},M&&a.Ay.createElement(A.A,{message:t,isProtected:p,observeIntersection:g}),a.Ay.createElement("div",{className:"content"},a.Ay.createElement(u.A,{isRtl:f.isRtl,className:"site-title",onClick:E},(0,c.A)(S||C||w)),(T||I)&&a.Ay.createElement(u.A,{isRtl:f.isRtl,className:"site-description",onClick:E},I||T&&(0,c.A)(T)),a.Ay.createElement(h.A,{url:b,className:"site-name",text:x,isRtl:f.isRtl}),n&&a.Ay.createElement("div",{className:"sender-name"},(0,c.A)(n))),n&&a.Ay.createElement("div",{className:"message-date"},a.Ay.createElement(u.A,{className:"date",onClick:E,isRtl:f.isRtl},(0,r.be)(f,1e3*t.date))))}))},91930:(e,t,n)=>{n.d(t,{A:()=>I,b:()=>N});var a=n(84051),o=n(31481),i=n(59589),r=n(87357),s=n(91034),l=n(76023),c=n(35049),d=n(4961),m=n(54487),u=n(11217),A=n(5912),h=n(39351),p=n(62587),g=n(22867),y=n(64154),f=n(95685),v=n(76785),E=n(27860),C=n(18653),b=n(39877);const w=" ",S=e=>{let{className:t,message:n,replyInfo:s,sender:S,senderChat:N,forwardSender:I,title:M,customText:k,isProtected:T,isInComposer:P,noUserColors:x,chatTranslations:R,requestedChatTranslationLanguage:L,observeIntersectionForLoading:B,observeIntersectionForPlaying:O,onClick:F}=e;const D=(0,a.li)(null),U=(0,A.Vz)(D,B),j=(0,a.Kr)((()=>{const e="message"===s?.type&&s.replyMedia;if(e)return{content:e}}),[s]),$=(0,p.A)(n&&(0,i.EO)(n,"pictogram"),!U),K=(0,g.A)(n||j),_=Boolean(n&&(0,i.lk)(n)),z=Boolean(n&&(0,i.y2)(n)),J=Boolean("message"===s?.type&&s.isQuote),H="message"===s?.type?s.replyFrom:void 0,V=n&&(0,i.ZR)(n),{translatedText:q}=(0,y.A)(R,n?.chatId,V?n?.id:void 0,L),G=(0,h.A)(),W=S?(0,i.qg)(G,S):H?.hiddenUserName||n?.forwardInfo?.hiddenUserName,Q=N?(0,i.qg)(G,N):void 0,Y=I?(0,i.qg)(G,I):n?.forwardInfo?.hiddenUserName,Z=S&&S.id===I?.id,{handleClick:X,handleMouseDown:ee}=(0,u.Q)(F);return a.Ay.createElement("div",{ref:D,className:(0,r.A)("EmbeddedMessage",t,(0,c.y)(S,x,!0),J&&"is-quote",K&&"with-thumb"),dir:G.isRtl?"rtl":void 0,onClick:X,onMouseDown:ee},K&&function(e,t,n,o,i){const{width:s,height:c}=(0,l.mr)(),d=t||e;return a.Ay.createElement("div",{className:(0,r.A)("embedded-thumb",n&&"round")},!i&&a.Ay.createElement("img",{src:d,width:s,height:c,alt:"",className:"pictogram",draggable:!1}),a.Ay.createElement(E.A,{thumbDataUri:d,isVisible:Boolean(i),width:s,height:c}),o&&a.Ay.createElement("span",{className:"protector"}))}(K,$,_,T,z),S?.color?.backgroundEmojiId&&a.Ay.createElement(b.A,{emojiDocumentId:S.color.backgroundEmojiId,className:"EmbeddedMessage--background-icons"}),a.Ay.createElement("div",{className:"message-text"},a.Ay.createElement("p",{className:(0,r.A)("embedded-text-wrapper",J&&"multiline")},"message"===s?.type&&s.quoteText?(0,m.f)({text:s.quoteText.text,entities:s.quoteText.entities,noLineBreaks:P,emojiSize:17}):n?(0,i._P)(n)?a.Ay.createElement(f.A,{message:n,isEmbedded:!0,observeIntersectionForLoading:B,observeIntersectionForPlaying:O}):a.Ay.createElement(C.A,{lang:G,message:n,noEmoji:Boolean(K),translatedText:q,observeIntersectionForLoading:B,observeIntersectionForPlaying:O,emojiSize:17}):k||function(e){if(!e||e.content.text)return w;const t=(0,i.GG)(G,e.content);return t&&t!==o.bVP?a.Ay.createElement("span",null,(0,d.A)(t)):w}(j)||w),a.Ay.createElement("div",{className:"message-title"},function(){if(M)return(0,d.A)(M);if(!W)return w;let e;N&&((0,i.WX)(N)&&(e="channel-filled"),(0,i.YE)(N)&&(e="group-filled"));const t=P&&Boolean(s&&"quoteText"in s&&s?.quoteText);return a.Ay.createElement(a.Ay.Fragment,null,(!N||!!(0,i.L8)(N?.id)||N.id!==S?.id)&&a.Ay.createElement("span",{className:"embedded-sender"},(0,d.A)(t?G("ReplyToQuote",W):W)),e&&a.Ay.createElement(v.A,{name:e,className:"embedded-chat-icon"}),e&&Q&&a.Ay.createElement("span",{className:"embedded-sender-chat"},(0,d.A)(Q)))}(),Y&&!Z&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(v.A,{name:I?"share-filled":"forward",className:"embedded-origin-icon"}),(0,d.A)(Y)))))},N=(0,s.A)(S),I=S},39877:(e,t,n)=>{n.d(t,{A:()=>f});var a=n(84051),o=n(66644),i=n(59589),r=n(87357),s=n(87679),l=n(76023),c=n(86974),d=n(39351),m=n(17712),u=n(62587),A=n(93545),h=n(38691),p=n(47483);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}],y=l.$,f=(0,a.ph)((e=>{let{emojiDocumentId:t,className:n}=e;const l=(0,a.li)(null),f=(0,a.li)(null),[v,E]=(0,a.J0)(),C=(0,h.A)(),b=(0,d.A)(),{customEmoji:w}=(0,p.A)(t),S=w?(0,i.I6)(w.id):void 0,N=(0,u.A)(S),I=(0,c.A)(f);(0,a.vJ)((()=>{N&&(0,s.NN)(N).then(E)}),[N]);const M=(0,m.A)((()=>{const e=l.current;if(!e||!v||!I)return;const t=e.getContext("2d"),{width:n,height:a}=e;t.clearRect(0,0,n,a),g.forEach((e=>{let{inline:a,block:o,opacity:i,scale:r}=e;const s=(b.isRtl?a:n/C-a)*C,l=o*C,c=y*C;t.save(),t.globalAlpha=i,t.translate(s,l),t.scale(r,r),t.drawImage(v,-c/2,-c/2,c,c),t.restore()}));const o=`${I}${w.isLottie?"ff":"bb"}`;t.save(),t.fillStyle=o,t.globalCompositeOperation="source-atop",t.fillRect(0,0,n,a),t.restore()}));(0,a.vJ)((()=>{M()}),[v,b.isRtl,I]);const k=(0,m.A)(((e,t)=>{const n=l.current;n&&(n.width=e*C,n.height=t*C,n.style.width=`${e}px`,n.style.height=`${t}px`,M())})),T=(0,m.A)((e=>{const{width:t,height:n}=e.contentRect;(0,o.RK)((()=>{k(t,n)}))}));return(0,A.A)(f,T),(0,a.vJ)((()=>{const e=f.current;if(!e)return;const{width:t,height:n}=e.getBoundingClientRect();(0,o.RK)((()=>{k(t,n)}))}),[C]),a.Ay.createElement("div",{className:(0,r.A)("pTWe_CYU",n),ref:f},a.Ay.createElement("canvas",{ref:l}))}))},55317:(e,t,n)=>{function a(e,t){const{level:n,boosts:a,currentLevelBoosts:o,nextLevelBoosts:i,hasMyBoost:r,prepaidGiveaways:s}=e,l=t&&a===o&&r;return{currentLevel:l?n-1:n,hasNextLevel:Boolean(i),boosts:a,levelProgress:!i||l?1:(a-o)/(i-o),remainingBoosts:i?i-a:0,isMaxLevel:void 0===i,prepaidGiveaways:s}}n.d(t,{z:()=>a})},24899:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(31481);function o(e,t){return t?`${a.jsp}${e}`:`@${e}`}},49086:(e,t,n)=>{n.d(t,{C:()=>d,V:()=>c});var a=n(97335),o=n(59589),i=n(50140),r=n(58849),s=n(4961),l=n(54487);function c(e){let{message:t,highlight:n,emojiSize:a,isSimple:s,truncateLength:c,isProtected:d,forcePlayback:m,shouldRenderAsHtml:u,isForMediaViewer:A}=e;const{text:h,entities:p}=t.content.text||{};if(!h){const e=(0,o.P5)(t);return e?[(0,r.A)(e,c)]:void 0}const g=(0,i.bj)(t);return(0,l.f)({text:(0,r.A)(h,c),entities:p,highlight:n,emojiSize:a,shouldRenderAsHtml:u,containerId:`${A?"mv-":""}${g}`,isSimple:s,isProtected:d,forcePlayback:m})}function d(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:o.vs;const{entities:d}=t.content.text||{},m=d?.some((e=>e.type===a.C7.Spoiler)),u=d?.some((e=>e.type===a.C7.CustomEmoji));if(!m&&!u){const a=(0,r.A)((0,o.dS)(e,t,n),l);return i?(0,s.A)(a,["emoji","highlight"],{highlight:i}):(0,s.A)(a)}const A=!n&&(0,o.Su)(t),h=A?`${A} `:"",p=c({message:t,highlight:i,isSimple:!0,truncateLength:l}),g=(0,o.oL)(e,t,p);return[...(0,s.A)(h),...Array.isArray(g)?g:[g]].filter(Boolean)}},79582:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(13439),o=n(67321),i=n(87894);const r=3e9,s=3e8;function l(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const l=(0,a.mS)();return(0,i.My)(e,(e=>{const a=(0,o.hds)(l,e);if(!a)return 0;let i=0;const c=(0,o.yHC)(l,e);return c&&(i+=c.date),t&&a.isVerified&&(i+=r),n&&n.includes(e)&&(i=Date.now()+s+(n.length-n.indexOf(e))),i}),"desc")}},97549:(e,t,n)=>{n.d(t,{A:()=>X});var a=n(84051),o=n(13439),i=n(97335),r=n(31481),s=n(59589),l=n(67321),c=n(85982),d=n(64713),m=n(37836),u=n(83868),A=n(79882),h=n(24899),p=n(4961),g=n(82117),y=n(39351),f=n(17712),v=n(62587),E=n(38691),C=n(32754),b=n(22720),w=n(55158),S=n(63152),N=n(66644),I=n(87357),M=n(11410);const k=1440,T=10080;function P(){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)%T,o=(a.endMinute+t)%T;e<0&&(e+=T),o<=0&&(o+=T),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 R=n(82393),L=n(32625),B=n(19129),O=n(37661),F=n(30857),D=n(36486),U=n(41036),j=n(76785);const $="MPBKHdZL",K=Array.from({length:7},((e,t)=>t)),_=(0,a.ph)((e=>{let{businessHours:t}=e;const n=(0,a.li)(null),[o,i,r]=(0,O.A)(!1),[s,l,c]=(0,O.A)(!1),d=(0,y.A)(),m=(0,F.A)();(0,L.A)(m,6e4);const u=(0,D.A)((e=>e.timezones?.byId)),A=(0,B.A)(u,[u]),h=(0,a.Kr)((()=>{if(!A)return 0;const e=A[t.timezoneId];return(-60*(new Date).getTimezoneOffset()-e.utcOffset)/60}),[t.timezoneId,A]),p=(0,a.Kr)((()=>{const e=P(),n=function(e){const t={};for(const n of e){const e=n.startMinute,a=n.endMinute,o=Math.floor(e/k),i=Math.floor((a-1)/k);for(let n=o;n<=i;n++)t[n]||(t[n]=[]),t[n].push({startMinute:Math.max(0,e-n*k),endMinute:Math.min(k,a-n*k)})}return t}(x(t.workHours,s?h:0)),a={};return K.forEach((t=>{const o=n[t];a[t]=o?o.map((t=>{let{startMinute:n,endMinute:a}=t;return a-n==1440?d("BusinessHoursDayFullOpened"):`${(0,M.fU)(d,e+60*n*1e3)} – ${(0,M.fU)(d,e+60*a*1e3)}`})):[d("BusinessHoursDayClosed")]})),a}),[t.workHours,s,d,h]),g=(0,a.Kr)((()=>{const e=x(t.workHours,h),n=P(),a=((new Date).getTime()-n)/1e3/60;return e.some((e=>{let{startMinute:t,endMinute:n}=e;return t<=a&&a<=n}))}),[t.workHours,h]),v=(0,a.Kr)((()=>(new Date(Date.now()-(s?0:60*h*1e3)).getDay()+6)%7),[s,h]),E=(0,f.A)((()=>{o?r():i()})),C=(0,f.A)((e=>{e.stopPropagation(),s?c():l()}));(0,a.vJ)((()=>{if(!o)return;const e=document.querySelector(`.${U.uo} > .${$}`);if(!e)return;const t=e.offsetHeight;(0,N.RK)((()=>{n.current.style.height=`${t}px`}))}),[o]);const w=(0,f.A)((()=>{const e=document.querySelector(`.${U.VY} > .${$}`);(0,N.YS)((()=>{const t=e.offsetHeight;(0,N.RK)((()=>{n.current.style.height=`${t}px`}))}))}));return a.Ay.createElement(b.A,{icon:"clock",iconClassName:"rlM4Mbnn",multiline:!0,className:"Ef_0p5Qm",isStatic:o,ripple:!0,narrow:!0,withColorTransition:!0,onClick:E},a.Ay.createElement("div",{className:"nHSmCUNs"},a.Ay.createElement("div",{className:"JTZ8UnnP"},a.Ay.createElement("div",null,d("BusinessHoursProfile")),a.Ay.createElement("div",{className:(0,I.A)("JVL7ZnnJ",g&&"segAfYXs")},d(g?"BusinessHoursProfileNowOpen":"BusinessHoursProfileNowClosed"))),a.Ay.createElement(j.A,{className:"dYxw2cFn",name:o?"up":"down"})),o&&a.Ay.createElement("div",{className:"lp9VIV1o"},Boolean(h)&&a.Ay.createElement("div",{className:"gVwflFhz",role:"button",tabIndex:0,onMouseDown:R.TF?void 0:C,onClick:R.TF?C:void 0},d(s?"BusinessHoursProfileSwitchMy":"BusinessHoursProfileSwitchLocal")),a.Ay.createElement(U.Ay,{className:"WKgL_XiP",ref:n,name:"fade",activeKey:Number(s),onStart:w},a.Ay.createElement("dl",{className:$},K.map((e=>a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement("dt",{className:(0,I.A)("cmxPqAof",e===v&&"YZVvP_56")},(0,M.wv)(d,6===e?0:e+1)),a.Ay.createElement("dd",{className:"Rs0VPgpq"},p[e].map((e=>a.Ay.createElement("div",null,e)))))))))))}));var z=n(87894),J=n(58554),H=n(14737),V=n(6413);const q=["🎉","🎆","🎈"],G=(0,a.ph)((0,o.EK)((e=>{const{birthdayNumbers:t,animatedEmojiEffects:n}=e;return{birthdayNumbers:t,animatedEmojiEffects:n,isPremiumPurchaseBlocked:(0,l.n_C)(e)}}))((e=>{let{user:t,birthday:n,isPremiumPurchaseBlocked:r,birthdayNumbers:l,animatedEmojiEffects:c,isInSettings:d}=e;const{openGiftPremiumModal:m,requestConfetti:u}=(0,o.ko)(),A=(0,a.li)(null),h=(0,a.li)(!1),[g,v,E]=(0,O.A)(),C=(0,y.A)(),{formattedDate:w,isToday:S,age:k}=(0,a.Kr)((()=>{const e=new Date,t=new Date;return n.year&&t.setFullYear(n.year),t.setMonth(n.month-1),t.setDate(n.day),t.setHours(0,0,0,0),{formattedDate:(0,M.A)(t,C.code,!0,"long"),isToday:t.getDate()===e.getDate()&&t.getMonth()===e.getMonth(),age:n.year&&W(t)}}),[n,C]),T=(0,a.Kr)((()=>{if(!k||!S)return;const e=l?.stickers?.filter((e=>{let{emoji:t}=e;return t?.endsWith("️⃣")}));if(!e)return;const t=(0,z.dU)(e,"emoji");return k.toString().split("").map((e=>t[e+"️⃣"]))}),[k,l?.stickers,S]),P=(0,a.Kr)((()=>{if(!S)return;const e=q[Math.floor(Math.random()*q.length)];return c?.stickers?.find((t=>{let{emoji:n}=t;return n===e}))}),[c?.stickers,S]);(0,a.vJ)((()=>{if(S&&T&&(T.forEach((e=>{const t=(0,s.Mw)(e.id);J.hd(t,i.qZ.BlobUrl)})),P)){const e=(0,s.Mw)(P.id);J.hd(e,i.qZ.BlobUrl)}}),[P,S,T]),(0,H.A)(E,g?3e3:void 0),(0,a.vJ)((()=>{if(g){h.current=!0;const e=document.getElementById(d?"LeftColumn":"RightColumn");if(!e)return;(0,N.YS)((()=>{const{top:t,left:n,width:a,height:o}=e.getBoundingClientRect();u({top:t,left:n,width:a,height:o,style:"top-down"})}))}}),[d,g]);const x=`ProfileBirthday${S?"Today":""}Value${k?"Year":""}`,L=S&&!t.isPremium&&!t.isSelf&&!r,B=(0,f.A)((()=>{m({forUserIds:[t.id]})})),F=(0,f.A)((()=>{S&&(L&&h.current?B():v())})),D=!S&&!L;return a.Ay.createElement("div",{className:"wCp6TBYF"},a.Ay.createElement(b.A,{icon:"calendar",secondaryIcon:L?"gift":void 0,secondaryIconClassName:"c4HDQNGJ",multiline:!0,narrow:!0,ref:A,ripple:!D,onClick:F,isStatic:D,onSecondaryIconClick:B},a.Ay.createElement("div",{className:"title"},(0,p.A)(C(x,[w,k],void 0,k))),a.Ay.createElement("span",{className:"subtitle"},C(S?"ProfileBirthdayToday":"ProfileBirthday"))),g&&R.ol&&T?.map(((e,t)=>a.Ay.createElement("div",{className:(0,I.A)("lQeU96Fj",t>0&&"e1ezfWJb"),style:`--digit-offset: ${t}`},a.Ay.createElement(V.A,{containerRef:A,sticker:e,size:128,forceAlways:!0})))),g&&P&&a.Ay.createElement("div",{className:"cFEXGUih"},a.Ay.createElement(V.A,{containerRef:A,sticker:P,size:288,shouldLoop:!0,forceAlways:!0})))})));function W(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 Q="UZbkeFDB",Y={width:64,height:64,zoom:15},Z=(0,m.sg)((e=>e()),500,!1),X=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatOrUserId:n,isSavedDialog:a}=t;const{countryList:{phoneCodes:o}}=e,i=n?(0,l.hds)(e,n):void 0,r=n?(0,l.mBe)(e,n):void 0,c=i?.isForum,d=i&&(0,s.W1)(i,(0,l.$5S)(e),(0,l.GrP)(e)),{threadId:m}=(0,l.Xf0)(e)||{},u=c?Number(m):void 0,A=i&&(0,l.AWZ)(e,i.id),h=r&&(0,l.vGo)(e,r.id),p=A?.inviteLink,g=h?.bio||A?.about;return{phoneCodeList:o,chat:i,user:r,userFullInfo:h,canInviteUsers:i&&!r&&(!(0,s.WX)(i)&&!(0,s.Sq)(i,"inviteUsers")||(0,s.ub)(i,"inviteUsers")),isMuted:d,topicId:u,chatInviteLink:p,description:g,topicLink:u?(0,l.sZk)(e,n,u):void 0,hasSavedMessages:!a&&e.chats.listIds.saved?.includes(n),personalChannel:h?.personalChannelId?(0,l.hds)(e,h.personalChannelId):void 0}}))((e=>{let{chatOrUserId:t,user:n,chat:l,userFullInfo:m,isInSettings:N,canInviteUsers:I,isMuted:M,phoneCodeList:k,topicId:T,description:P,chatInviteLink:x,topicLink:R,hasSavedMessages:L,personalChannel:B}=e;const{showNotification:O,updateChatMutedState:F,updateTopicMutedState:D,loadPeerStories:U,openSavedDialog:j,openMapModal:$,requestCollectibleInfo:K}=(0,o.ko)(),{id:z,usernames:J,phoneNumber:H,isSelf:V}=n||{},{id:q,usernames:W}=l||{},X=z||q,{businessLocation:ee,businessWorkHours:te,personalChannelMessageId:ne,birthday:ae}=m||{},oe=(0,y.A)(),[ie,re]=(0,a.J0)(!M);(0,a.vJ)((()=>{re(!M)}),[M]),(0,g.A)((e=>{let[t]=e;X&&t!==X&&(n||l&&(0,s.WX)(l))&&U({peerId:X})}),[X,l,n]);const{width:se,height:le,zoom:ce}=Y,de=(0,E.A)(),me=ee?.geo&&(0,s.rt)(ee.geo,se,le,ce,de),ue=(0,v.A)(me),Ae=(0,a.Kr)((()=>{if(ee?.geo)return ue?a.Ay.createElement("img",{src:ue,alt:"",className:Q}):a.Ay.createElement(w.A,{className:Q})}),[ee,ue]),he=Boolean(T&&T!==i.l3),pe=l&&(0,s.WX)(l)||n?.isPremium,ge=(0,a.Kr)((()=>{const e=J?.filter((e=>e.isActive));return e?.length?e:void 0}),[J]),ye=(0,a.Kr)((()=>{const e=n?void 0:W?.filter((e=>e.isActive));return e?.length?e:void 0}),[W,n]),fe=(0,a.Kr)((()=>{if(l)return he?R:(0,s.L7)(l)||x}),[l,he,R,x]),ve=(0,f.A)((()=>{const{address:e,geo:t}=ee;if(!t)return(0,c.eM)(e),void O({message:oe("BusinessLocationCopied")});$({geoPoint:t,zoom:ce})})),Ee=(0,f.A)((()=>{re((e=>{const t=!e;return Z((()=>{he?D({chatId:q,topicId:T,isMuted:!t}):F({chatId:q,isMuted:!t})})),t}))})),Ce=(0,f.A)((()=>{j({chatId:t})}));function be(e,t){(0,c.eM)(e),O({message:`${t} was copied`})}const we=H&&(0,d.Ox)(k,H),Se=(0,f.A)((()=>{H?.length===r.PGI&&H.startsWith(r._Bb)?K({collectible:H,peerId:X,type:"phone"}):be(we,oe("Phone"))})),Ne=(0,f.A)(((e,t)=>{e.isEditable?be((0,h.A)(e.username,t),oe(t?"Link":"Username")):K({collectible:e.username,peerId:X,type:"username"})}));if(l&&!l.isRestricted&&(!V||N))return a.Ay.createElement("div",{className:"ChatExtra"},B&&a.Ay.createElement("div",{className:"HP5EJx7s"},a.Ay.createElement("h3",{className:"cHyTGri2"},oe("ProfileChannel")),a.Ay.createElement("span",{className:"kYd2GrmU"},oe("Subscribers",B.membersCount,"i")),a.Ay.createElement(C.A,{chatId:B.id,orderDiff:0,animationType:A.I.None,isPreview:!0,previewMessageId:ne,className:"qOJwhXMC"})),Boolean(we?.length)&&a.Ay.createElement(b.A,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:Se},a.Ay.createElement("span",{className:"title",dir:"auto"},we),a.Ay.createElement("span",{className:"subtitle"},oe("Phone"))),ge&&Ie(ge),P&&Boolean(P.length)&&a.Ay.createElement(b.A,{icon:"info",multiline:!0,narrow:!0,isStatic:!0,allowSelection:!0},a.Ay.createElement("span",{className:"title word-break allow-selection",dir:"auto"},(0,p.A)(P,["br",pe?"links":"tg_links","emoji"])),a.Ay.createElement("span",{className:"subtitle"},oe(z?"UserBio":"Info"))),ye&&!he&&Ie(ye,!0),(!ye&&I||he)&&fe&&a.Ay.createElement(b.A,{icon:"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>be(fe,oe("SetUrlPlaceholder"))},a.Ay.createElement("div",{className:"title"},fe),a.Ay.createElement("span",{className:"subtitle"},oe("SetUrlPlaceholder"))),ae&&a.Ay.createElement(G,{key:X,birthday:ae,user:n,isInSettings:N}),!N&&a.Ay.createElement(b.A,{icon:"unmute",ripple:!0,onClick:Ee},a.Ay.createElement("span",null,oe("Notifications")),a.Ay.createElement(S.A,{id:"group-notifications",label:z?"Toggle User Notifications":"Toggle Chat Notifications",checked:ie,inactive:!0})),te&&a.Ay.createElement(_,{businessHours:te}),ee&&a.Ay.createElement(b.A,{icon:"location",ripple:!0,multiline:!0,narrow:!0,rightElement:Ae,onClick:ve},a.Ay.createElement("div",{className:"title"},ee.address),a.Ay.createElement("span",{className:"subtitle"},oe("BusinessProfileLocation"))),L&&!N&&a.Ay.createElement(b.A,{icon:"saved-messages",ripple:!0,onClick:Ce},a.Ay.createElement("span",null,oe("SavedMessagesTab"))));function Ie(e,t){const[n,...o]=e,i=o.length?oe("UsernameAlso","%USERNAMES%").split("%").map((e=>"USERNAMES"===e?a.Ay.createElement(a.Ay.Fragment,null,o.map(((e,n)=>a.Ay.createElement(a.Ay.Fragment,null,n>0?", ":"",a.Ay.createElement("a",{key:e.username,href:(0,h.A)(e.username,!0),onMouseDown:u.A,onClick:n=>{(0,u.A)(n),Ne(e,t)},className:"text-entity-link username-link"},(0,h.A)(e.username)))))):e)):void 0;return a.Ay.createElement(b.A,{icon:t?"link":"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>{Ne(n,t)}},a.Ay.createElement("span",{className:"title",dir:"auto"},(0,h.A)(n.username,t)),a.Ay.createElement("span",{className:"subtitle"},i&&a.Ay.createElement("span",{className:"other-usernames"},i),oe(t?"Link":"Username")))}})))},83594:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(84051),o=n(59589),i=n(87357),r=n(95807),s=n(82393),l=n(62587),c=n(87412);const d="PZAuNVZH",m=(0,a.ph)((e=>{let{reaction:t,isLottie:n,className:m,particleSize:u,onEnded:A}=e;const h=(0,o.I6)(t.documentId),p=(0,l.A)(n?void 0:h),g=(0,a.Kr)((()=>s.ol?Array.from({length:7}).map((()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;const t=(e/2+Math.random()*e*3)*(Math.random()>.5?1:-1),n=e+Math.random()*e*4;return`M 0 0 C 0 0 ${t} ${-n-e} ${t} ${n}`}(u))):[]),[u]);if(p||n)return a.Ay.createElement("div",{className:(0,i.A)("aInga6VW",m),style:(0,r.A)(Boolean(u)&&`--particle-size: ${u}px`)},g.map(((e,o)=>{const i=`--offset-path: path('${e}');`;return n?a.Ay.createElement(c.A,{documentId:t.documentId,className:d,style:i,withSharedAnimation:!0,size:u,onAnimationEnd:0===o?A:void 0}):a.Ay.createElement("img",{src:p,alt:"",className:d,style:i,draggable:!1,onAnimationEnd:0===o?A:void 0})})))}))},23470:(e,t,n)=>{n.d(t,{A:()=>S});var a=n(84051),o=n(13439),i=n(59589),r=n(67321),s=n(87357),l=n(43336),c=n(76023),d=n(37661),m=n(5912),u=n(17712),A=n(62587),h=n(34201),p=n(47483),g=n(18104),y=n(87412),f=n(45603),v=n(83594);const E={root:"O9uCTt5C","animated-icon":"HiI6SMxF",animatedIcon:"HiI6SMxF",effect:"NhFcTGja",animating:"ikfZ6Igz",withEffectOnly:"jjRJmHCg"},C=1.5*c.$,b=6.5*c.$,w=c.$,S=(0,a.ph)((0,o.EK)(((e,t)=>{let{containerId:n}=t;const{genericEmojiEffects:a,reactions:o}=e,{activeReactions:i}=(0,r.nTw)(e),s=(0,r.xYJ)(e,"reactionEffects");return{activeReactions:i?.[n],availableReactions:o.availableReactions,genericEffects:a,withEffects:s}}))((e=>{let{containerId:t,reaction:n,className:r,size:c=C,effectSize:S=b,activeReactions:N,availableReactions:I,genericEffects:M,withEffects:k,withEffectOnly:T,shouldPause:P,shouldLoop:x,loopLimit:R,observeIntersection:L}=e;const{stopActiveReaction:B}=(0,o.ko)(),O=(0,a.li)(null),F="documentId"in n,D=(0,a.Kr)((()=>I?.find((e=>(0,i.a0)(e.reaction,n)))),[I,n]),U=D?.centerIcon?.id,{customEmoji:j}=(0,p.A)(F?n.documentId:void 0),$=(0,a.Kr)((()=>{if(!F)return D?.aroundAnimation?.id;if(!j)return;const e=I?.find((e=>e.reaction.emoticon===j.emoji))?.aroundAnimation?.id;return e}),[D,I,j,F]),K=(0,a.Kr)((()=>{if($)return $;if(!M?.stickers)return;const{stickers:e}=M;return e[Math.floor(Math.random()*e.length)].id}),[$,M]),_=(0,m.Vz)(O,L),z=U&&`sticker${U}`,J=K&&`sticker${K}`,H=(0,A.A)(z,!U),V=(0,A.A)(J,!K),q=(0,a.Kr)((()=>N?.find((e=>(0,i.a0)(e,n)))),[N,n]),G=Boolean(k&&q&&(F||H)&&V),W=_&&(G&&!T||x),{shouldRender:Q,transitionClassNames:Y}=(0,h.A)(G,void 0,!0,"slow"),{shouldRender:Z,transitionClassNames:X}=(0,h.A)(W,void 0,!0,"slow"),ee=(0,u.A)((()=>{B({containerId:t,reaction:n})})),[te,ne,ae]=(0,d.A)(),oe=!(F||W&&te),{shouldRender:ie,transitionClassNames:re}=(0,h.A)(oe,void 0,!0),se=(0,s.A)(E.root,Q&&E.animating,T&&E.withEffectOnly,r);return a.Ay.createElement("div",{className:se,ref:O},!T&&ie&&a.Ay.createElement(f.A,{className:re,reaction:n,availableReactions:I,size:c,observeIntersection:L}),!T&&F&&a.Ay.createElement(y.A,{documentId:n.documentId,className:E.customEmoji,size:c,noPlay:P,loopLimit:R,forceAlways:!0,observeIntersectionForPlaying:L}),Z&&!F&&a.Ay.createElement(g.A,{key:`${U}-${c}`,className:(0,s.A)(E.animatedIcon,X),size:(0,l.Ki)(1.9*c),tgsUrl:H,play:_&&!P,noLoop:!x,forceAlways:!0,onLoad:ne,onEnded:ae}),Q&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(g.A,{key:`${K}-${S}`,className:(0,s.A)(E.effect,Y),size:S,tgsUrl:V,play:_,noLoop:!0,forceAlways:!0,onEnded:ee}),F&&!$&&_&&a.Ay.createElement(v.A,{reaction:n,className:Y,particleSize:Math.max(.5*c,w),onEnded:ee})))})))},97967:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(80089),i=n(80464);const r=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"ChatFolderModal",!t);return n?a.Ay.createElement(n,e):void 0}},97046:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(80089),i=n(80464);const r=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"MuteChatModal",!t);return n?a.Ay.createElement(n,e):void 0}},32754:(e,t,n)=>{n.d(t,{A:()=>L});var a=n(84051),o=n(13439),i=n(97335),r=n(89925),s=n(59589),l=n(26129),c=n(67321),d=n(87357),m=n(66414),u=n(82393),A=n(43874),h=n(47067),p=n(49746),g=n(37661),y=n(5912),f=n(17712),v=n(36486),E=n(34201),C=n(53188),b=n(21849),w=n(54314),S=n(34431),N=n(81642),I=n(94285),M=n(22720),k=n(97967),T=n(97046),P=n(24807);const x="AA5s1Pu4",R=(0,a.ph)((e=>{let{isSelected:t,isActive:n,isMobile:o}=e;return a.Ay.createElement("div",{className:(0,d.A)("byPckqUT",n&&"IsUWP16T",t&&!o&&"qy2i51dM")},a.Ay.createElement("div",{className:"nl36F75B"},a.Ay.createElement("div",{className:x}),a.Ay.createElement("div",{className:x}),a.Ay.createElement("div",{className:x})))})),L=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatId:n,isSavedDialog:a,isPreview:o,previewMessageId:r}=t;const d=(0,c.hds)(e,n);if(!d)return{currentUserId:e.currentUserId};const m=r||(0,c.ZZX)(e,n,a?"saved":"all"),u=r?(0,c.O5q)(e,n,r):(0,c.yHC)(e,n,a?"saved":"all"),{senderId:A,isOutgoing:h,forwardInfo:p}=u||{},g=a?p?.fromId:A,y=u&&(0,l.Q)(u)?.replyToMsgId,f=g?(0,c.PVB)(e,g):void 0,v=u?(0,s.mK)(u):void 0,E=v&&y?(0,c.O5q)(e,d.id,y):void 0,{targetUserIds:C,targetChatId:b}=v||{},w=(0,s.e7)(d),{chatId:S,threadId:N,type:I}=(0,c.Xf0)(e)||{},M=!o&&n===S&&(a?n===N:N===i.l3),k=d.isForum&&n===S||n===(0,c.nTw)(e).forumPanelChatId,T=w?(0,c.mBe)(e,w):void 0,P=w?(0,c.K0y)(e,w):void 0,x=u&&(0,c.nkm)(e,u),R=(0,c.C5H)(e,n,i.l3,"typingStatus");return{chat:d,isMuted:(0,s.W1)(d,(0,c.$5S)(e),(0,c.GrP)(e)),lastMessageSender:f,actionTargetUserIds:C,actionTargetChatId:b,actionTargetMessage:E,draft:(0,c.GA4)(e,n,i.l3),isSelected:M,isSelectedForum:k,isForumPanelOpen:(0,c.clw)(e),canScrollDown:M&&"thread"===I,canChangeFolder:(e.chatFolders.orderedIds?.length||0)>1,...h&&u&&{lastMessageOutgoingStatus:(0,c.Tl2)(e,u)},user:T,userStatus:P,lastMessageTopic:x,typingStatus:R,withInterfaceAnimations:(0,c.PKK)(e),lastMessage:u,lastMessageId:m,currentUserId:e.currentUserId}}))((e=>{let{chatId:t,folderId:n,orderDiff:l,animationType:x,isPinned:L,observeIntersection:B,chat:O,isMuted:F,user:D,userStatus:U,actionTargetUserIds:j,lastMessageSender:$,lastMessageOutgoingStatus:K,actionTargetMessage:_,actionTargetChatId:z,offsetTop:J,draft:H,withInterfaceAnimations:V,isSelected:q,isSelectedForum:G,isForumPanelOpen:W,canScrollDown:Q,canChangeFolder:Y,lastMessageTopic:Z,typingStatus:X,lastMessageId:ee,lastMessage:te,isSavedDialog:ne,currentUserId:ae,isPreview:oe,previewMessageId:ie,className:re,onDragEnter:se}=e;const{openChat:le,openSavedDialog:ce,toggleChatInfo:de,focusLastMessage:me,focusMessage:ue,loadTopics:Ae,openForumPanel:he,closeForumPanel:pe,setShouldCloseRightColumn:ge}=(0,o.ko)(),{isMobile:ye}=(0,A.Ay)(),[fe,ve,Ee]=(0,g.A)(),[Ce,be,we]=(0,g.A)(),[Se,Ne,Ie]=(0,g.A)(),[Me,ke,Te]=(0,g.A)(),[Pe,xe,Re]=(0,g.A)(),[Le,Be,Oe]=(0,g.A)(),[Fe,De,Ue]=(0,g.A)(),[je,$e,Ke]=(0,g.A)(),{isForum:_e,isForumAsMessages:ze}=O||{};(0,p.A)(ne?ae:t,ee,te);const{renderSubtitle:Je,ref:He}=(0,C.A)({chat:O,chatId:t,lastMessage:te,typingStatus:X,draft:H,actionTargetMessage:_,actionTargetUserIds:j,actionTargetChatId:z,lastMessageTopic:Z,lastMessageSender:$,observeIntersection:B,animationType:x,withInterfaceAnimations:V,orderDiff:l,isSavedDialog:ne,isPreview:oe}),Ve=(0,v.A)(c.sRo),qe=(0,f.A)((()=>{const e=ye&&ze;if(ye&&ge({value:!0}),oe)ue({chatId:t,messageId:ie});else{if(ne)return ce({chatId:t,noForumTopicPanel:!0},{forceOnHeavyAnimation:!0}),void(ye&&de({force:!1}));if(_e){if(W)return void pe(void 0,{forceOnHeavyAnimation:!0});if(e||he({chatId:t},{forceOnHeavyAnimation:!0}),!ze)return}le({id:t,noForumTopicPanel:e,shouldReplaceHistory:!0},{forceOnHeavyAnimation:!0}),q&&Q&&me()}})),Ge=(0,f.A)((e=>{e.preventDefault(),se?.(t)})),We=(0,f.A)((()=>{xe(),ve()})),Qe=(0,f.A)((()=>{Be(),be()})),Ye=(0,f.A)((()=>{De(),Ne()})),Ze=(0,f.A)((()=>{$e(),ke()})),Xe=(0,h.A)({chat:O,user:D,handleDelete:We,handleMute:Qe,handleChatFolderChange:Ye,handleReport:Ze,folderId:n,isPinned:L,isMuted:F,canChangeFolder:Y,isSavedDialog:ne,currentUserId:ae,isPreview:oe}),et=(0,y.Vz)(He,O?B:void 0);(0,a.vJ)((()=>{et&&_e&&O&&void 0===O.listedTopicIds&&Ae({chatId:t})}),[O,t,_e,et]);const tt=D&&U&&(0,s.PF)(D,U),{hasShownClass:nt}=(0,E.A)(tt),at=(0,a.Kr)((()=>{if(u.OS)return ne?`#${(0,m.az)(ae,"thread",t)}`:`#${(0,m.az)(t,"thread",i.l3)}`}),[t,ae,ne]);if(!O)return;const ot=D||O,it=(0,d.A)("Chat chat-item-clickable",(0,s.L8)(t)?"private":"group",_e&&"forum",q&&"selected",G&&"selected-forum",oe&&"standalone",re);return a.Ay.createElement(M.A,{ref:He,className:it,href:at,style:`top: ${J}px`,ripple:!_e&&!ye,contextActions:Xe,onClick:qe,onDragEnter:Ge,withPortalForMenu:!0},a.Ay.createElement("div",{className:(0,d.A)("status","status-clickable")},a.Ay.createElement(b.A,{peer:ot,isSavedMessages:D?.isSelf,isSavedDialog:ne,withStory:!D?.isSelf,withStoryGap:nt,storyViewerOrigin:r.G9.ChatList,storyViewerMode:"single-peer"}),a.Ay.createElement("div",{className:"avatar-badge-wrapper"},a.Ay.createElement("div",{className:(0,d.A)("avatar-online",nt&&"avatar-online-shown")}),a.Ay.createElement(P.A,{chat:O,isMuted:F,shouldShowOnlyMostImportant:!0,forceHidden:Ve})),O.isCallActive&&O.isCallNotEmpty&&a.Ay.createElement(R,{isMobile:ye,isSelected:q,isActive:V})),a.Ay.createElement("div",{className:"info"},a.Ay.createElement("div",{className:"info-row"},a.Ay.createElement(S.A,{peer:ot,withEmojiStatus:!0,isSavedMessages:t===D?.id&&D?.isSelf,isSavedDialog:ne,observeIntersection:B}),F&&!ne&&a.Ay.createElement("i",{className:"icon icon-muted"}),a.Ay.createElement("div",{className:"separator"}),te&&a.Ay.createElement(N.A,{message:te,outgoingStatus:ne?void 0:K,draftDate:H?.date})),a.Ay.createElement("div",{className:"subtitle"},Je(),!oe&&a.Ay.createElement(P.A,{chat:O,isPinned:L,isMuted:F,isSavedDialog:ne}))),Pe&&a.Ay.createElement(w.A,{isOpen:fe,onClose:Ee,onCloseAnimationEnd:Re,chat:O,isSavedDialog:ne}),Le&&a.Ay.createElement(T.A,{isOpen:Ce,onClose:we,onCloseAnimationEnd:Oe,chatId:t}),Fe&&a.Ay.createElement(k.A,{isOpen:Se,onClose:Ie,onCloseAnimationEnd:Ue,chatId:t}),je&&a.Ay.createElement(I.A,{isOpen:Me,onClose:Te,onCloseAnimationEnd:Ke,peerId:t,subject:"peer"}))})))},24807:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(84051),o=n(87357),i=n(22237),r=n(14242),s=n(19129),l=n(68292),c=n(26607);const d=(0,a.ph)((e=>{let{topic:t,chat:n,isPinned:d,isMuted:m,shouldShowOnlyMostImportant:u,wasTopicOpened:A,forceHidden:h,isSavedDialog:p}=e;const{unreadMentionsCount:g=0,unreadReactionsCount:y=0}=n.isForum?{}:n,f=!d&&t&&!A,v=n.isForum&&!t,E=(0,a.Kr)((()=>v&&n?.topics?Object.values(n.topics).filter((e=>{let{unreadCount:t}=e;return t})):void 0),[n,v]),C=(0,a.Kr)((()=>v?m&&E?.filter((e=>!1===e.isMuted)).length||E?.length:(t||n).unreadCount),[n,t,E,v,m]),b=(0,a.Kr)((()=>{const e=n.topics&&Object.values(n.topics).some((e=>!e.isMuted&&e.unreadCount));return m||n.topics&&!e}),[n,m]),w=!t&&n.hasUnreadMark,S=!(0,s.A)((()=>(0,i.Hp)(h)?h():h),[h])&&Boolean(C||g||w||d||y||f),N=Boolean((C||w)&&!p),I=(0,o.A)("ChatBadge",b&&"muted",!N&&d&&"pinned",N&&"unread");return a.Ay.createElement(c.A,{isCustom:!0,className:"ChatBadge-transition",isOpen:S},function(){const e=y&&a.Ay.createElement("div",{className:(0,o.A)("ChatBadge reaction",b&&"muted")},a.Ay.createElement("i",{className:"icon icon-heart"})),t=g&&a.Ay.createElement("div",{className:"ChatBadge mention"},a.Ay.createElement("i",{className:"icon icon-mention"})),n=f&&a.Ay.createElement("div",{className:(0,o.A)("ChatBadge unopened",b&&"muted")}),i=w||C?a.Ay.createElement("div",{className:I},!w&&a.Ay.createElement(l.A,{text:(0,r.Vw)(C)})):void 0,s=d&&a.Ay.createElement("div",{className:I},a.Ay.createElement("i",{className:"icon icon-pinned-chat"})),c=[n,e,t,i,!i&&!t&&!e&&s].filter(Boolean);return p?s:0!==c.length?1===c.length?c[0]:u?[t,i,e,s].filter(Boolean)[0]:a.Ay.createElement("div",{className:"ChatBadge-wrapper"},c):void 0}())}))},62830:(e,t,n)=>{n.d(t,{A:()=>_});var a=n(84051),o=n(13439),i=n(89925),r=n(31481),s=n(87357),l=n(49763),c=n(80140),d=n(82393),m=n(23459),u=n(66644),A=n(9718),h=n(16581),p=n(17712),g=n(74984),y=n(2178),f=n(96374),v=n(5912),E=n(9717),C=n(46222),b=n(52745),w=n(59589),S=n(87894),N=n(14242),I=n(4961),M=n(39351),k=n(24713),T=n(22720);const P={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.ph)((e=>{let{archiveSettings:t,onDragEnter:n,onClick:i}=e;const{updateArchiveSettings:l}=(0,o.ko)(),c=(0,M.A)(),d=(0,g.Rh)(r._E9),m=(0,g.ic)(),u=m[r._E9]?.chatsCount,A=(0,a.Kr)((()=>{if(!d?.length)return c("Loading");const e=(0,o.mS)().chats.byId;return d.slice(0,5).map(((t,n,o)=>{const i=n===o.length-1,r=e[t];if(!r)return;const l=(0,w.Js)(c,r);return a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement("span",{className:(0,s.A)(P.chat,u&&r.unreadCount&&P.unread)},(0,I.A)(l)),i?"":", ")}))}),[d,c,u]),h=(0,a.Kr)((()=>{const e=!t.isMinimized&&{title:c("lng_context_archive_collapse"),icon:"collapse",handler:()=>{l({isMinimized:!0})}},n=t.isMinimized&&{title:c("lng_context_archive_expand"),icon:"expand",handler:()=>{l({isMinimized:!1})}},a={title:c("lng_context_archive_to_menu"),icon:"archive-to-main",handler:()=>{l({isHidden:!0})}};return(0,S.oE)([e,n,a])}),[t.isMinimized,c,l]),p=(0,a.hb)((e=>{e.preventDefault(),n?.()}),[n]);return a.Ay.createElement(T.A,{onClick:i,onDragEnter:p,className:(0,s.A)(P.root,t.isMinimized&&P.minimized,"chat-item-clickable","chat-item-archive"),buttonClassName:P.button,contextActions:h,withPortalForMenu:!0},t.isMinimized?a.Ay.createElement("div",{className:(0,s.A)(P.info,"info")},a.Ay.createElement("div",{className:"info-row"},a.Ay.createElement("div",{className:(0,s.A)("title",P.title)},a.Ay.createElement("h3",{dir:"auto",className:(0,s.A)(P.name,"fullName")},a.Ay.createElement("i",{className:(0,s.A)(P.icon,"icon","icon-archive-filled")}),c("ArchivedChats"))),a.Ay.createElement(k.A,{className:P.unreadCount,text:u?(0,N.Vw)(u):void 0}))):a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement("div",{className:(0,s.A)("status",P.avatarWrapper)},a.Ay.createElement("div",{className:(0,s.A)("Avatar",P.avatar)},a.Ay.createElement("i",{className:"icon icon-archive-filled"}))),a.Ay.createElement("div",{className:(0,s.A)(P.info,"info")},a.Ay.createElement("div",{className:"info-row"},a.Ay.createElement("div",{className:(0,s.A)("title",P.title)},a.Ay.createElement("h3",{dir:"auto",className:(0,s.A)(P.name,"fullName")},c("ArchivedChats")))),a.Ay.createElement("div",{className:"subtitle"},a.Ay.createElement("div",{className:(0,s.A)("status",P.chatsPreview)},A),a.Ay.createElement(k.A,{className:P.unreadCount,text:u?(0,N.Vw)(u):void 0})))))}));var R=n(32754),L=n(67321),B=n(43874),O=n(79577),F=n(64493);const D=(0,a.ph)((0,o.EK)(((e,t)=>{let{folderId:n,folderType:a}=t;return{chatFolder:n&&"folder"===a?(0,L.$aQ)(e,n):void 0,animatedEmoji:(0,L.oei)(e,"📂")}}))((e=>{let{chatFolder:t,animatedEmoji:n,foldersDispatch:o,onSettingsScreenSelect:r}=e;const s=(0,M.A)(),{isMobile:l}=(0,B.Ay)(),c=(0,a.hb)((()=>{o({type:"editFolder",payload:t}),r(i.VS.FoldersEditFolderFromChatList)}),[t,o,r]);return a.Ay.createElement("div",{className:"yftKUVDQ"},a.Ay.createElement("div",{className:"UCBfMOiz"},n&&a.Ay.createElement(O.A,{sticker:n,size:96})),a.Ay.createElement("h3",{className:"dB9cHelg",dir:"auto"},s("FilterNoChatsToDisplay")),a.Ay.createElement("p",{className:"TJ_liZcJ",dir:"auto"},s(t?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),t&&a.Ay.createElement(F.A,{ripple:!l,fluid:!0,pill:!0,onClick:c,size:"smaller",isRtl:s.isRtl},a.Ay.createElement("i",{className:"icon icon-settings"}),a.Ay.createElement("div",{className:"aL7e0w4t"},s("ChatList.EmptyChatListEditFilter"))))})));var U=n(93545);const j="pedMJD_v",$=(0,a.ph)((e=>{let{sessions:t,onHeightChange:n}=e;const{changeSessionSettings:i,terminateAuthorization:r,showNotification:s}=(0,o.ko)(),l=(0,a.li)(null),c=(0,M.A)();(0,U.A)(l,(e=>{const t=e.borderBoxSize?.[0]?.blockSize||e.contentRect.height;n(t)}));const d=(0,a.Kr)((()=>Object.values(t).sort(((e,t)=>t.dateCreated-e.dateCreated)).find((e=>e.isUnconfirmed))),[t]),m=(0,a.Kr)((()=>[d.deviceModel,d.region,d.country].filter(Boolean).join(", ")),[d]),u=(0,p.A)((()=>{i({hash:d.hash,isConfirmed:!0})})),A=(0,p.A)((()=>{r({hash:d.hash}),s({title:c("UnconfirmedAuthDeniedTitle",1),message:c("UnconfirmedAuthDeniedMessageSingle",m)})}));return a.Ay.createElement("div",{className:"yEkGgZVL",ref:l},a.Ay.createElement("h2",{className:"VhAJDrnz"},c("UnconfirmedAuthTitle")),a.Ay.createElement("p",{className:"WmyL1NJ8"},c("UnconfirmedAuthSingle",m)),a.Ay.createElement("div",{className:"_40UGD1Y"},a.Ay.createElement(F.A,{fluid:!0,isText:!0,size:"smaller",className:j,onClick:u},c("UnconfirmedAuthConfirm")),a.Ay.createElement(F.A,{fluid:!0,isText:!0,size:"smaller",color:"danger",onClick:A,className:j},c("UnconfirmedAuthDeny"))))})),K=new Set(["9","0"]),_=(0,a.ph)((e=>{let{className:t,folderType:n,folderId:w,isActive:S,isForumPanelOpen:N,canDisplayArchive:I,archiveSettings:M,sessions:k,foldersDispatch:T,onSettingsScreenSelect:P,onLeftColumnContentChange:L}=e;const{openChat:B,openNextChat:O,closeForumPanel:F,toggleStoryRibbon:U}=(0,o.ko)(),j=(0,a.li)(null),_=(0,a.li)(!1),[z,J]=(0,a.J0)(0),H="archived"===n,V="all"===n,q="saved"===n,G=V?r.DSF:H?r._E9:q?r.pX9:w,W=V&&I&&M,Q=(0,g.Rh)(G);(0,m.A)(Q);const Y=(Q?.length||0)*r.yq1,Z=W?M?.isMinimized?r.eqO:r.yq1:0,{orderDiffById:X,getAnimationType:ee}=(0,E.A)(Q),[te,ne]=(0,f.A)(void 0,Q,void 0,r.T7t),ae=(0,a.Kr)((()=>{const e=Object.values(k||{}),t=e.find((e=>e.isCurrent));return!(!t||(0,c.Fm)()-t.dateCreated<r.C7Y)&&V&&e.some((e=>e.isUnconfirmed))}),[V,k]);(0,a.vJ)((()=>{ae||J(0)}),[ae]),(0,y.v)(S&&Q?.length?{"Alt+ArrowUp":e=>{e.preventDefault(),O({targetIndexDelta:-1,orderedIds:Q})},"Alt+ArrowDown":e=>{e.preventDefault(),O({targetIndexDelta:1,orderedIds:Q})}}:void 0),(0,a.vJ)((()=>{if(S&&!q&&Q&&d.lE)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((d.MP&&e.metaKey||!d.MP&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t||K.has(t))return;const n=W&&M&&!M.isMinimized,a=n?-1:0,o=Number(t)+a-1;if(n&&-1===o)return void L?.(i.Bn.Archived);if(o>Q.length-1)return;B({id:Q[o],shouldReplaceHistory:!0})}}}),[M,q,S,L,B,O,Q,W]);const{observe:oe}=(0,v.BL)({rootRef:j,throttleMs:200}),ie=(0,p.A)((()=>{L(i.Bn.Archived),F()})),re=(0,p.A)((()=>{_.current?_.current=!1:ie()})),se=(0,h.A)((e=>{_.current?_.current=!1:B({id:e,shouldReplaceHistory:!0})}),[B],500,!0),le=(0,p.A)((e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,a=e.clientY-t.top;n<t.width||a<t.y||(_.current=!0)})),ce=function(e,t,n,o){const i=(0,a.li)(null),r=(0,a.li)(!1),s=(0,a.li)(0),l=(0,a.li)(!1),c=(0,a.li)(!0),m=(0,a.li)(0),g=(0,a.li)(!1),y=(0,p.A)((function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];l.current||i.current&&e.current&&(i.current.style.display="block",e.current.scrollTop=1,d.Yw||t||(0,A.E)(e.current),r.current=!0,s.current=1,l.current=!0,c.current=!0)})),f=(0,p.A)((()=>{l.current&&i.current&&(i.current.style.display="none",l.current=!1)})),v=(0,p.A)((()=>{if(!e.current)return;if(r.current)return void(r.current=!1);const a=e.current.scrollTop,o=a>s.current,d=a<s.current,A=0===a,h=Date.now()-m.current;if(i.current){if(A&&!l.current)return void(0,u.dL)(y,[e.current,i.current]);(0,u.dL)(f,i.current)}d&&(c.current&&h>100||a<0&&g.current)?t?.():o&&a>0&&n?.(),s.current=a,c.current=A,m.current=Date.now(),g.current=o&&a<0})),E=(0,h.A)((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.vJ)((()=>{const t=e.current;if(t)return 0===t.scrollTop&&(0,u.RK)((()=>{y(!0)})),t.addEventListener("scroll",v,{passive:!0}),t.addEventListener("wheel",E,{passive:!0}),()=>{t.removeEventListener("scroll",v),t.removeEventListener("wheel",E)}}),[e,E]),d.pz||o?void 0:a.Ay.createElement("div",{ref:i,className:"overscroll-trigger",key:"overscroll-trigger"})}(j,(0,p.A)((()=>{U({isShown:!0,isArchived:H})})),(0,p.A)((()=>{U({isShown:!1,isArchived:H})})),q);return a.Ay.createElement(C.A,{className:(0,s.A)("chat-list custom-scroll",N&&"forum-panel-open",t),ref:j,items:te,itemSelector:".ListItem:not(.chat-item-archive)",preloadBackwards:r.T7t,withAbsolutePositioning:!0,beforeChildren:ce,maxHeight:Y+Z+z,onLoadMore:ne,onDragLeave:le},ae&&a.Ay.createElement($,{key:"unconfirmed",sessions:k,onHeightChange:J}),W&&a.Ay.createElement(x,{key:"archive",archiveSettings:M,onClick:ie,onDragEnter:re}),te?.length?function(){const e=Q.indexOf(te[0]),t=(0,l.zm)(G)||0;return te.map(((n,o)=>{const i=e+o<t,s=z+Z+(e+o)*r.yq1;return a.Ay.createElement(R.A,{key:n,teactOrderKey:i?o:(0,l.uk)(n,q),chatId:n,isPinned:i,folderId:w,isSavedDialog:q,animationType:ee(n),orderDiff:X[n],offsetTop:s,observeIntersection:oe,onDragEnter:se})}))}():!te||te.length||q?a.Ay.createElement(b.A,{key:"loading"}):a.Ay.createElement(D,{folderId:w,folderType:n,foldersDispatch:T,onSettingsScreenSelect:P}))}))},90054:(e,t,n)=>{n.d(t,{A:()=>G});var a=n(84051),o=n(13439),i=n(97335),r=n(31481),s=n(66644),l=n(59589),c=n(67321),d=n(87357),m=n(11778),u=n(50442),A=n(25903),h=n(82393),p=n(43874),g=n(32706),y=n(26072),f=n(96374),v=n(5912),E=n(39351),C=n(17712),b=n(29886),w=n(9717),S=n(63744),N=n(51083),I=n(48553),M=n(64493),k=n(46222),T=n(52745),P=n(76023),x=n(79577);const R={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"},L=7*P.$,B=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatId:n}=t;const a=(0,c.hds)(e,n),o=a&&(a.isCreator||(0,l.ub)(a,"manageTopics"));return{animatedEmoji:(0,c.oei)(e,"🐣"),canManageTopics:o}}))((e=>{let{chatId:t,animatedEmoji:n,canManageTopics:i}=e;const{openCreateTopicPanel:r}=(0,o.ko)(),s=(0,E.A)(),{isMobile:l}=(0,p.Ay)(),c=(0,a.hb)((()=>{r({chatId:t})}),[t,r]);return a.Ay.createElement("div",{className:R.root},a.Ay.createElement("div",{className:R.sticker},n&&a.Ay.createElement(x.A,{sticker:n,size:L})),a.Ay.createElement("h3",{className:R.title,dir:"auto"},s("ChatList.EmptyTopicsTitle")),a.Ay.createElement("p",{className:(0,d.A)(R.description,R.centered),dir:"auto"},s("ChatList.EmptyTopicsDescription")),i&&a.Ay.createElement(M.A,{ripple:!l,fluid:!0,onClick:c,size:"smaller",isRtl:s.isRtl},a.Ay.createElement("div",{className:R.buttonText},s("ChatList.EmptyTopicsCreate"))))})));var O=n(26129),F=n(66414),D=n(4961),U=n(37661),j=n(53188),$=n(87894),K=n(81642),_=n(38102),z=n(94189),J=n(22720),H=n(97046),V=n(24807);const q=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatId:n,topic:a,isSelected:o}=t;const i=(0,c.hds)(e,n),r=(0,c.O5q)(e,n,a.lastMessageId),{senderId:s,isOutgoing:d}=r||{},m=r&&(0,O.Q)(r)?.replyToMsgId,u=s?(0,c.mBe)(e,s)||(0,c.hds)(e,s):void 0,A=r?(0,l.mK)(r):void 0,h=A&&m?(0,c.O5q)(e,n,m):void 0,{targetUserIds:p,targetChatId:g}=A||{},y=(0,c.C5H)(e,n,a.id,"typingStatus"),f=(0,c.GA4)(e,n,a.id),v=(0,c.Vw0)(e,n,a.id),E=Boolean(v?.lastReadInboxMessageId),{chatId:C,threadId:b}=(0,c.Xf0)(e)||{};return{chat:i,lastMessage:r,actionTargetUserIds:p,actionTargetChatId:g,actionTargetMessage:h,lastMessageSender:u,typingStatus:y,canDelete:(0,c.DBV)(e,n,a.id),withInterfaceAnimations:(0,c.PKK)(e),draft:f,...d&&r&&{lastMessageOutgoingStatus:(0,c.Tl2)(e,r)},canScrollDown:o&&i?.id===C&&b===a.id,wasTopicOpened:E}}))((e=>{let{topic:t,isSelected:n,chatId:i,chat:r,style:s,lastMessage:c,canScrollDown:m,lastMessageOutgoingStatus:u,observeIntersection:A,canDelete:p,actionTargetMessage:g,actionTargetUserIds:y,actionTargetChatId:f,lastMessageSender:v,animationType:b,withInterfaceAnimations:w,orderDiff:S,typingStatus:N,draft:I,wasTopicOpened:M}=e;const{openThread:k,deleteTopic:T,focusLastMessage:P,setViewForumAsMessages:x}=(0,o.ko)(),R=(0,E.A)(),[L,B,O]=(0,U.A)(),[q,G,W]=(0,U.A)(),[Q,Y,Z]=(0,U.A)(),[X,ee,te]=(0,U.A)(),{isPinned:ne,isClosed:ae}=t,oe=t.isMuted||void 0===t.isMuted&&r.isMuted,ie=(0,C.A)((()=>{Y(),B()})),re=(0,C.A)((()=>{T({chatId:r.id,topicId:t.id})})),se=(0,C.A)((()=>{ee(),G()})),{renderSubtitle:le,ref:ce}=(0,j.A)({chat:r,chatId:i,lastMessage:c,draft:I,actionTargetMessage:g,actionTargetUserIds:y,actionTargetChatId:f,lastMessageSender:v,lastMessageTopic:t,observeIntersection:A,isTopic:!0,typingStatus:N,animationType:b,withInterfaceAnimations:w,orderDiff:S}),de=(0,C.A)((()=>{k({chatId:i,threadId:t.id,shouldReplaceHistory:!0}),x({chatId:i,isEnabled:!1}),m&&P()})),me=function(e){let{topic:t,chat:n,wasOpened:i,canDelete:r,handleDelete:s,handleMute:c}=e;const d=(0,E.A)();return(0,a.Kr)((()=>{const{isPinned:e,isMuted:a,isClosed:m,id:u}=t,A=n.id,{editTopic:p,toggleTopicPinned:g,markTopicRead:y,updateTopicMutedState:f,openChatInNewTab:v}=(0,o.ko)(),E=(0,l.l1)(n,t),C=n.isCreator||(0,l.ub)(n,"manageTopics"),b=h.OS&&{title:"Open in new tab",icon:"open-in-new-tab",handler:()=>{v({chatId:n.id,threadId:u})}},w=t.unreadCount||!i?{title:d("MarkAsRead"),icon:"readchats",handler:()=>{y({chatId:A,topicId:u})}}:void 0,S=C?e?{title:d("UnpinFromTop"),icon:"unpin",handler:()=>g({chatId:A,topicId:u,isPinned:!1})}:{title:d("PinToTop"),icon:"pin",handler:()=>g({chatId:A,topicId:u,isPinned:!0})}:void 0,N=n.isMuted&&!1!==a||!0===a?{title:d("ChatList.Unmute"),icon:"unmute",handler:()=>f({chatId:A,topicId:u,isMuted:!1})}:{title:`${d("ChatList.Mute")}...`,icon:"mute",handler:c},I=E?m?{title:d("lng_forum_topic_reopen"),icon:"reopen-topic",handler:()=>p({chatId:A,topicId:u,isClosed:!1})}:{title:d("lng_forum_topic_close"),icon:"close-topic",handler:()=>p({chatId:A,topicId:u,isClosed:!0})}:void 0,M=r?{title:d("lng_forum_topic_delete"),icon:"delete",destructive:!0,handler:s}:void 0;return(0,$.oE)([b,S,w,N,I,M])}),[t,n,i,d,r,s,c])}({topic:t,chat:r,wasOpened:M,canDelete:p,handleDelete:ie,handleMute:se});return a.Ay.createElement(J.A,{className:(0,d.A)("Fn34Vu_9","Chat",n&&"selected","chat-item-clickable"),onClick:de,style:s,href:h.OS?`#${(0,F.az)(i,"thread",t.id)}`:void 0,contextActions:me,withPortalForMenu:!0,ref:ce},a.Ay.createElement("div",{className:"info"},a.Ay.createElement("div",{className:"info-row"},a.Ay.createElement("div",{className:(0,d.A)("title")},a.Ay.createElement(_.A,{topic:t,className:"oXJl4tra",observeIntersection:A}),a.Ay.createElement("h3",{dir:"auto",className:"fullName"},(0,D.A)(t.title))),t.isMuted&&a.Ay.createElement("i",{className:"icon icon-muted"}),a.Ay.createElement("div",{className:"separator"}),ae&&a.Ay.createElement("i",{className:(0,d.A)("icon","icon-lock-badge","MB7Gomjn")}),c&&a.Ay.createElement(K.A,{message:c,outgoingStatus:u})),a.Ay.createElement("div",{className:"subtitle"},le(),a.Ay.createElement(V.A,{chat:r,isPinned:ne,isMuted:oe,topic:t,wasTopicOpened:M}))),Q&&a.Ay.createElement(z.A,{isOpen:L,onClose:O,onCloseAnimationEnd:Z,confirmIsDestructive:!0,confirmHandler:re,text:R("lng_forum_topic_delete_sure"),confirmLabel:R("Delete")}),X&&a.Ay.createElement(H.A,{isOpen:q,onClose:W,onCloseAnimationEnd:te,chatId:i,topicId:t.id}))}))),G=(0,a.ph)((0,o.EK)((e=>{const t=(0,c.nTw)(e).forumPanelChatId,n=t?(0,c.hds)(e,t):void 0,{chatId:a,threadId:o}=(0,c.Xf0)(e)||{};return{chat:n,currentTopicId:t===a?Number(o):void 0,withInterfaceAnimations:(0,c.PKK)(e)}}),(e=>(0,c.clw)(e)))((e=>{let{chat:t,currentTopicId:n,isOpen:c,isHidden:P,onTopicSearch:x,onCloseAnimationEnd:R,onOpenAnimationStart:L,withInterfaceAnimations:O}=e;const{closeForumPanel:F,openChatWithInfo:D,loadTopics:U}=(0,o.ko)(),j=(0,a.li)(null),$=(0,a.li)(null),K=(0,a.li)(null),{isMobile:_}=(0,p.Ay)();(0,a.vJ)((()=>{t&&!t.topics&&U({chatId:t.id})}),[t,U]);const[z,J]=(0,a.J0)(!1),H=(0,E.A)(),V=(0,C.A)((()=>{F()}));(0,a.vJ)((()=>{O||c||R?.()}),[O,c,R]);const G=(0,C.A)((()=>{t&&D({id:t.id,shouldReplaceHistory:!0})})),{observe:W}=(0,v.BL)({rootRef:$,throttleMs:200});(0,v.mv)(K,W,(e=>{let{isIntersecting:t}=e;J(!t)}));const Q=(0,a.Kr)((()=>t?.topics?(0,l.CO)(Object.values(t.topics),t.orderedPinnedTopicIds).map((e=>{let{id:t}=e;return t})):[]),[t]),{orderDiffById:Y,getAnimationType:Z}=(0,w.A)(Q,t?.id),[X,ee]=(0,f.A)((()=>{t&&U({chatId:t.id})}),Q,!t?.topicsCount||Q.length>=t.topicsCount,r.iIc),te=(0,a.li)(!1),ne=c&&!P,ae=(0,b.A)(ne);ae!==ne&&(te.current=!1),(0,y.A)({isActive:ne,onBack:V}),(0,a.vJ)((()=>ne?(0,m.A)(V):void 0),[V,ne]),(0,a.vJ)((()=>{ae!==ne&&(0,s.Uz)((()=>{if(!j.current)return;const e=(0,g.UH)();(0,A.j)(j.current,e),L?.(),ne?(te.current=!0,j.current.style.transform="none"):(te.current=!1,j.current.style.transform="")}))}),[ne,L,ae]),(0,a.vJ)((()=>{if(h.TF)return(0,u.wJ)(j.current,{selectorToPreventScroll:".chat-list",onSwipe:(e,t)=>t===(H.isRtl?u.ez.Left:u.ez.Right)&&(F(),!0)})}),[F,H.isRtl]);const oe=void 0===t?.topics;return a.Ay.createElement("div",{ref:j,className:(0,d.A)("MlF2n1nb",z&&"SZ24u3cn",H.isRtl&&"Xs2y1fCE",!O&&"kmDMv6D8"),onTransitionEnd:c?void 0:R},a.Ay.createElement("div",{id:"TopicListHeader",className:"left-header"},a.Ay.createElement(M.A,{round:!0,size:"smaller",color:"translucent",onClick:V,ariaLabel:H("Close")},a.Ay.createElement("i",{className:"icon icon-close"})),t&&a.Ay.createElement(N.A,{noAvatar:!0,className:"Sf633zAP",chatId:t.id,onClick:G}),t&&a.Ay.createElement(I.A,{chatId:t.id,threadId:i.l3,messageListType:"thread",canExpandActions:!1,isForForum:!0,isMobile:_,onTopicSearch:x})),t&&a.Ay.createElement(S.A,{chatId:t.id,hasPinnedOffset:!1,className:"wUpRjGJ2"}),a.Ay.createElement("div",{className:"hGeb3TQJ"}),a.Ay.createElement(k.A,{className:"chat-list custom-scroll",ref:$,items:X,preloadBackwards:r.iIc,withAbsolutePositioning:!0,maxHeight:(Q?.length||0)*r.HGU,onLoadMore:ee,sensitiveArea:r.C$_,beforeChildren:a.Ay.createElement("div",{ref:K,className:"ERz3fcar"})},Boolean(X?.length)&&function(){const e=Q.indexOf(X[0]);return X?.map(((o,i)=>a.Ay.createElement(q,{key:o,chatId:t.id,topic:t.topics[o],style:`top: ${(e+i)*r.HGU}px;`,isSelected:n===o,observeIntersection:W,animationType:Z(o),orderDiff:Y[o]})))}(),oe&&!X?.length&&a.Ay.createElement(T.A,{key:"loading"})),!oe&&1===X?.length&&X[0]===r.HxB&&a.Ay.createElement(B,{chatId:t.id}))})))},79882:(e,t,n)=>{n.d(t,{I:()=>o,W:()=>i});var a=n(84051);let o=function(e){return e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None",e}({});function i(e){return(0,a.Kr)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,a=t.filter((e=>e>0)).length;return t=>{const i=e[t];return 0===i?o.None:i===1/0||i===-1/0||n<=a&&i<0||a<n&&i>0?o.Opacity:o.Move}}),[e])}},53188:(e,t,n)=>{n.d(t,{A:()=>P});var a=n(84051),o=n(13439),i=n(31481),r=n(66644),s=n(59589),l=n(26129),c=n(87357),d=n(59776),m=n(4961),u=n(54487),A=n(79882),h=n(49746),p=n(39351),g=n(62587),y=n(76023),f=n(43874),v=n(11217),E=n(38102);const C="CBda1UmC",b="BhS75ocD",w="uWo2dhui",S="g3XnC73g",N=Number(y.$),I=(0,a.ph)((e=>{let{chat:t,renderLastMessage:n,observeIntersection:i}=e;const{openThread:r}=(0,o.ko)(),l=(0,a.li)(null),d=(0,a.li)(null),u=(0,p.A)(),[A,...h]=(0,a.Kr)((()=>t.topics?(0,s.CO)(Object.values(t.topics),void 0,!0).slice(0,3):[]),[t.topics]),[g,y]=(0,a.J0)(!1),[I,M]=(0,a.J0)(void 0),{handleClick:k,handleMouseDown:T}=(0,v.Q)((e=>{0===A.unreadCount||t.isForumAsMessages||(e.stopPropagation(),e.preventDefault(),r({chatId:t.id,threadId:A.id,shouldReplaceHistory:!0,noForumTopicPanel:(0,f.Ny)()}))}));return(0,a.vJ)((()=>{const e=l.current,t=d.current;if(!e||!t)return;const n=e.offsetWidth,a=t.offsetWidth;Math.abs(n-a)<N?M(Math.max(n,a)):M(void 0),y(n>a)}),[A,n]),a.Ay.createElement("div",{className:(0,c.A)("Ow6Ij9O5",g&&"U_yhhC0w",I&&"HV0wCR4O"),dir:u.isRtl?"rtl":void 0,style:I?`--overwritten-width: ${I}px`:void 0},A&&a.Ay.createElement("div",{className:C},a.Ay.createElement("div",{className:(0,c.A)("lEbV6HrI",A.unreadCount&&b),ref:d,onClick:k,onMouseDown:T},a.Ay.createElement(E.A,{topic:A,observeIntersection:i}),a.Ay.createElement("div",{className:"k3Ch25ZQ"},(0,m.A)(A.title)),!I&&g&&a.Ay.createElement("div",{className:w},a.Ay.createElement("div",{className:S}))),a.Ay.createElement("div",{className:"IkuCBmvA"},h.map((e=>a.Ay.createElement("div",{className:(0,c.A)("d0hTIVJn",e.unreadCount&&b),key:e.id},a.Ay.createElement(E.A,{topic:e,className:"oknhG11L",observeIntersection:i}),a.Ay.createElement("span",{className:"ZUj3xAjs"},(0,m.A)(e.title)))))),a.Ay.createElement("div",{className:"_m_2xcPW"})),!A&&a.Ay.createElement("div",{className:(0,c.A)(C,"L4Zk0yMN")},u("Loading")),a.Ay.createElement("div",{className:(0,c.A)("KJ16dBus",A?.unreadCount&&b),ref:l,onClick:k,onMouseDown:T},n(),!I&&!g&&a.Ay.createElement("div",{className:w},a.Ay.createElement("div",{className:S}))))}));var M=n(18653),k=n(80477);const T=200;function P(e){let{chat:t,lastMessage:n,chatId:y,typingStatus:f,draft:v,actionTargetMessage:E,actionTargetUserIds:C,lastMessageTopic:b,lastMessageSender:w,actionTargetChatId:S,observeIntersection:N,animationType:P,orderDiff:x,withInterfaceAnimations:R,isTopic:L,isSavedDialog:B,isPreview:O}=e;const F=(0,p.A)(),D=(0,a.li)(null),U=n&&(0,s._P)(n),j=n&&(0,l.Q)(n)?.replyToMsgId;(0,h.A)(y,U?j:void 0,E);const $=n&&!(0,s.fP)(n)?(0,s.CI)(n):void 0,K=(0,g.A)(n?(0,s.EO)(n,"micro"):void 0),_=Boolean(n&&(0,s.lk)(n)),z=(0,a.Kr)((()=>{if(!C)return;const e=(0,o.mS)().users.byId;return C.map((t=>e[t])).filter(Boolean)}),[C]),J=(0,a.hb)((()=>{if(!B&&!O&&f&&n&&f.timestamp>1e3*n.date)return a.Ay.createElement(k.A,{typingStatus:f});const e=v&&v.replyInfo?.replyToMsgId===b?.id,o=v?.replyInfo&&!v.text&&v.isLocal;if(!t?.isForum&&!B&&!O&&v&&!o&&(!L||!e))return a.Ay.createElement("p",{className:"last-message",dir:F.isRtl?"auto":"ltr"},a.Ay.createElement("span",{className:"draft"},F("Draft")),(0,u.f)({text:v.text?.text||"",entities:v.text?.entities,isSimple:!0,withTranslucentThumbs:!0}));if(!n)return;if((0,s.r$)(n))return a.Ay.createElement("p",{className:"last-message shared-canvas-container",dir:F.isRtl?"auto":"ltr"},(0,s.Po)(F,n));if(U){const e=t&&((0,s.WX)(t)||n.senderId===n.chatId);return a.Ay.createElement("p",{className:"last-message shared-canvas-container",dir:F.isRtl?"auto":"ltr"},(0,d.V)(F,n,e?void 0:w,e?t:void 0,z,E,S,b,{isEmbedded:!0},void 0,void 0))}const i=(0,s.Q5)(F,y,w);return a.Ay.createElement("p",{className:"last-message shared-canvas-container",dir:F.isRtl?"auto":"ltr"},i&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement("span",{className:"sender-name"},(0,m.A)(i)),a.Ay.createElement("span",{className:"colon"},":")),!B&&n.forwardInfo&&a.Ay.createElement("i",{className:"icon icon-share-filled chat-prefix-icon"}),"story"===n.replyInfo?.type&&a.Ay.createElement("i",{className:"icon icon-story-reply chat-prefix-icon"}),function(e,t,n,o,i){const r=a.Ay.createElement(M.A,{lang:e,message:t,noEmoji:Boolean(o),observeIntersectionForLoading:n,inChatList:!0});if(!o)return r;const l=(0,s.y2)(t);return a.Ay.createElement("span",{className:"media-preview"},a.Ay.createElement("img",{src:o,alt:"",className:(0,c.A)("media-preview--image",i&&"round",l&&"media-preview-spoiler"),draggable:!1}),(0,s.zX)(t)&&a.Ay.createElement("i",{className:"icon icon-play"}),r)}(F,n,N,K||$,_))}),[S,E,z,t,y,v,U,_,L,F,n,w,b,K,$,N,f,B,O]);return(0,a.Nf)((()=>{const e=D.current;if(R&&e){if(P===A.I.Opacity)e.style.opacity="0",(0,r.RK)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(P!==A.I.Move)return;e.style.transform=`translate3d(0, ${-x*i.yq1}px, 0)`,(0,r.RK)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,r.RK)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),T+i.xB5)}}),[R,x,P]),{renderSubtitle:function(){return t?.isForum&&!L?a.Ay.createElement(I,{chat:t,renderLastMessage:J,observeIntersection:N}):J()},ref:D}}},24920:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(30857),i=n(29886);function r(e){const t=(0,o.A)(),n=(0,a.li)(e),r=(0,i.A)(e);return!1===e&&r!==e&&(n.current=!1),{shouldDisableDropdownMenuTransitionRef:n,handleDropdownMenuTransitionEnd:function(){n.current=Boolean(e),t()}}}},9717:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(84051),o=n(87894),i=n(79882),r=n(29886);function s(e,t){const n=(0,a.Kr)((()=>{if(e)return e.reduce(((e,t,n)=>(e[t]=n,e)),{})}),[e]),s=(0,r.A)(n),l=(0,r.A)(t),c=(0,a.Kr)((()=>n&&s&&t===l?(0,o.LG)(n,((e,t)=>void 0!==s[t]?e-s[t]:-1/0)):{}),[t,n,l,s]);return{orderDiffById:c,getAnimationType:(0,i.W)(c)}}},55429:(e,t,n)=>{n.d(t,{N:()=>o});var a=n(59589);function o(e,t,n,o){const{senderId:i}=t;if(!i)return;const r=(0,a.L8)(i)?o[i]:n[i];let s=(0,a.qg)(e,r);const l=n[t.chatId];return l&&("isSelf"in r&&r.isSelf?s=`${e("FromYou")} → ${(0,a.Js)(e,l)}`:(0,a.YE)(l)&&(s+=` → ${(0,a.Js)(e,l)}`)),s}},95685:(e,t,n)=>{n.d(t,{A:()=>G});var a=n(84051),o=n(13439),i=n(59589),r=n(26129),s=n(67321),l=n(87357),c=n(59776),d=n(4961),m=n(54464),u=n(10722),A=n(49746),h=n(37661),p=n(5912),g=n(39351),y=n(34201),f=n(79519),v=n(79577),E=n(97335),C=n(89925),b=n(58554),w=n(17712),S=n(62587),N=n(21849),I=n(94189),M=n(68584);const k=(0,a.ph)((e=>{let{message:t,renderContent:n}=e;const{openMediaViewer:r,uploadProfilePhoto:s,showNotification:l}=(0,o.ko)(),{isOutgoing:c}=t,d=(0,g.A)(),[m,u]=(0,a.J0)(),[A,p,y]=(0,h.A)(!1),f=(0,S.A)((0,i.EO)(t,"full")),v=t.content.action.photo?.isVideo,k=(0,w.A)((()=>{l({title:d("ApplyAvatarHintTitle"),message:d("ApplyAvatarHint"),action:{action:"requestNextSettingsScreen",payload:{screen:C.VS.Main}},actionText:d("Open")})})),T=(0,w.A)((e=>{u(void 0),s({file:e}),k()})),P=(0,w.A)((()=>{u(void 0)})),x=(0,w.A)((async()=>{y(),k();const e=t.content.action.photo,n=await b.hd(`videoAvatar${e.id}?size=u`,E.qZ.BlobUrl),a=await fetch(n).then((e=>e.blob()));s({file:new File([a],"avatar.mp4"),isVideo:!0,videoTs:e.videoSizes?.find((e=>void 0!==e.videoStartTs))?.videoStartTs})}));return a.Ay.createElement("span",{className:"action-message-suggested-avatar",tabIndex:0,role:"button",onClick:async()=>{!c&&f?v?p():u(await fetch(f).then((e=>e.blob()))):r({chatId:t.chatId,mediaId:t.id,threadId:E.l3,origin:C.TQ.SuggestedAvatar})}},a.Ay.createElement(N.A,{photo:t.content.action.photo,loopIndefinitely:!0,withVideo:v,size:"jumbo"}),a.Ay.createElement("span",null,n()),a.Ay.createElement("span",{className:"action-message-button"},d(v?"ViewVideoAction":"ViewPhotoAction")),a.Ay.createElement(M.A,{file:m,onClose:P,onChange:T}),a.Ay.createElement(I.A,{isOpen:A,title:d("SuggestedVideo"),confirmHandler:x,onClose:y,textParts:n()}))}));var T=n(19381),P=n(14242),x=n(14737),R=n(48894);var L=n(36838),B=n(76785),O=n(64493),F=n(55158);const D="d8axZxyN",U="glDpC2av",j="gqCs9fSo",$="gnYhwnvf",K="HWgwnKui",_="BTNQ4KBH",z="Xl9MVMTn",J="Qizai7yv";function H(e){let{channel:t}=e;const{openChat:n}=(0,o.ko)(),r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#00000000";const[n,o]=(0,a.J0)(t),r=(0,S.A)((0,i.cP)(e),!1,E.qZ.BlobUrl);return(0,a.vJ)((()=>{(async()=>{if(!r)return;const e=await(0,R.rX)(r);o(`#${(0,R.v2)(e)}`)})()}),[r]),n}(t,"#3C3C4399");return a.Ay.createElement("div",{className:U,onClick:()=>n({id:t.id})},a.Ay.createElement(N.A,{className:j,key:t.id,size:"large",peer:t}),a.Ay.createElement("div",{style:`background: ${r}`,className:$},a.Ay.createElement("i",{className:(0,l.A)(D,"icon icon-user-filled")}),a.Ay.createElement("span",{className:K},(0,P.Vw)(t?.membersCount||0))),a.Ay.createElement("span",{className:_},t.title))}function V(e){let{channel:t,chatId:n,channelsCount:i,isCurrentUserPremium:r}=e;const{openPremiumModal:s,openChatWithInfo:c}=(0,o.ko)(),d=(0,g.A)();return a.Ay.createElement("div",{className:(0,l.A)(U,"MBChXyXk"),onClick:()=>{r?c({id:n,shouldReplaceHistory:!0,profileTab:"similarChannels",forceScrollProfileTab:!0}):s()}},a.Ay.createElement(N.A,{className:j,key:t.id,size:"large",peer:t}),a.Ay.createElement("div",{className:z},a.Ay.createElement("div",{className:J})),a.Ay.createElement("div",{className:(0,l.A)(z,"JxSmtOFi")},a.Ay.createElement("div",{className:J})),a.Ay.createElement("div",{className:$},a.Ay.createElement("span",{className:K},`+${i}`),!r&&a.Ay.createElement(B.A,{name:"lock-badge",className:D})),a.Ay.createElement("span",{className:_},d("MoreSimilar")))}const q=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatId:n}=t;const{similarChannelIds:a,shouldShowInChat:o,count:i}=(0,s.dg4)(e,n)||{};return{similarChannelIds:a,shouldShowInChat:o,count:i,isCurrentUserPremium:(0,s.g29)(e)}}))((e=>{let{chatId:t,similarChannelIds:n,shouldShowInChat:i,count:r,isCurrentUserPremium:c}=e;const d=(0,g.A)(),{toggleChannelRecommendations:m}=(0,o.ko)(),[u,A,p]=(0,h.A)(!1),[y,f,v]=(0,h.A)(!1),E=(0,a.li)(null),C=(0,a.Kr)((()=>{if(!n)return;const e=(0,o.mS)();return n.map((t=>(0,s.hds)(e,t))).filter(Boolean)}),[n]),[b,S]=(0,a.J0)(!n),N=(0,a.Kr)((()=>C?.slice(0,10)),[C]),I=Boolean(N?.length);(0,L.A)(E,!I||!i||b,!0);const M=Boolean(!b&&(i||y||u)&&I);(0,x.A)((()=>S(!1)),2e3),(0,a.vJ)((()=>{if(b&&C&&i){const e=setTimeout((()=>{S(!1)}),300);return()=>clearTimeout(e)}}),[C,i,b]);const k=(0,w.A)((()=>{m({chatId:t}),i?(p(),f()):(A(),v())}));return a.Ay.createElement("div",{className:(0,l.A)("V3RHiOJR")},a.Ay.createElement("div",{className:"join-text"},a.Ay.createElement("span",{className:(0,l.A)(I&&"UHAMd4fI"),onClick:I?k:void 0},d("ChannelJoined"))),b&&a.Ay.createElement(F.A,{className:"xKVZv7KE"}),M&&a.Ay.createElement("div",{className:(0,l.A)(u&&"eb8rX09E",y&&"XR6_qLCc")},a.Ay.createElement("div",{className:"tfG_BSDt"},a.Ay.createElement("svg",{width:"19",height:"7",viewBox:"0 0 19 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.Ay.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.Ay.createElement("div",{className:"njAC8dR9"},a.Ay.createElement("div",{className:"s7QOi22Q"},a.Ay.createElement("span",{className:"JstcOhAN"},d("SimilarChannels")),a.Ay.createElement(O.A,{className:"meewH7t_",color:"translucent",onClick:k},a.Ay.createElement(B.A,{name:"close"}))),a.Ay.createElement("div",{ref:E,className:(0,l.A)("h4gWlNen","no-scrollbar")},N?.map(((e,n)=>9===n?a.Ay.createElement(V,{channel:e,chatId:t,channelsCount:r-10+1,isCurrentUserPremium:c}):a.Ay.createElement(H,{channel:e})))))))}))),G=(0,a.ph)((0,o.EK)(((e,t)=>{let{message:n,threadId:a}=t;const{chatId:o,senderId:i,content:l}=n,{targetUserIds:c,targetChatId:d}=l.action||{},m=(0,r.Q)(n)?.replyToMsgId,u=m?(0,s.O5q)(e,o,m):void 0,A=!!a&&(0,s.nJv)(e,n,a),{direction:h,noHighlight:p}=A&&(0,s.nTw)(e).focusedMessage||{},g=(0,s.mBe)(e,i||o),y=(0,s.hds)(e,o),f=d?(0,s.hds)(e,d):void 0,v=l.action?.months;return{senderUser:g,senderChat:y,targetChat:f,targetChatId:d,targetUserIds:c,targetMessage:u,isFocused:A,premiumGiftSticker:(0,s.t0O)(e,v),topic:(0,s.nkm)(e,n),canPlayAnimatedEmojis:(0,s.BWX)(e),...A&&{focusDirection:h,noFocusHighlight:p}}}))((e=>{let{message:t,isEmbedded:n,appearanceOrder:r=0,isJustAdded:s,isLastInList:E,senderUser:C,senderChat:b,targetUserIds:w,targetMessage:S,targetChatId:N,targetChat:I,isFocused:M,focusDirection:P,noFocusHighlight:x,premiumGiftSticker:R,isInsideTopic:L,topic:B,memoFirstUnreadIdRef:O,canPlayAnimatedEmojis:F,observeIntersectionForReading:D,observeIntersectionForLoading:U,observeIntersectionForPlaying:j,onPinnedIntersectionChange:$}=e;const{openPremiumModal:K,requestConfetti:_,checkGiftCode:z}=(0,o.ko)(),J=(0,g.A)(),H=(0,a.li)(null);(0,p.mv)(H,D),(0,A.A)(t.chatId,"message"===t.replyInfo?.type?t.replyInfo.replyToMsgId:void 0,S),(0,f.A)(H,t.chatId,M,P,x,s),(0,a.vJ)((()=>{if(t.isPinned)return()=>{$?.({viewportPinnedIdsToRemove:[t.id],isUnmount:!0})}}),[$,t.isPinned,t.id]);const V=r<=0,[G,W]=(0,h.A)(V),Q=Boolean(t.content.action?.text.startsWith("ActionGift")),Y=Boolean(t.content.action?.text.startsWith("BoostingReceivedGift")),Z="suggestProfilePhoto"===t.content.action?.type&&t.content.action.photo,X=(0,i.CV)(t);(0,a.vJ)((()=>{V||setTimeout(W,10*r)}),[r,W,V]);const ee=(0,p.Vz)(H,j),te=(0,a.li)((()=>{const e=O?.current&&t.id>=O.current;return Q&&!t.isOutgoing&&e})());(0,a.vJ)((()=>{ee&&te.current&&(te.current=!1,_({}))}),[ee,_]);const{transitionClassNames:ne}=(0,y.A)(G,void 0,V,!1),ae=(0,o.mS)().users.byId,oe=(0,a.Kr)((()=>w?w.map((e=>ae?.[e])).filter(Boolean):void 0),[w,ae]),ie=(0,a.hb)((()=>(0,c.V)(J,t,C,b,oe,S,N,B,{isEmbedded:n},U,j)),[n,J,t,U,j,b,C,N,S,oe,B]),{isContextMenuOpen:re,contextMenuPosition:se,handleBeforeContextMenu:le,handleContextMenu:ce,handleContextMenuClose:de,handleContextMenuHide:me}=(0,u.A)(H),ue=void 0!==se,Ae=()=>{const e=t.content.action?.slug;e&&z({slug:e,message:{chatId:t.chatId,messageId:t.id}})};if(L&&"TopicWasCreatedAction"===t.content.action?.text)return a.Ay.createElement("span",{ref:H});if(n)return a.Ay.createElement("span",{ref:H,className:"embedded-action-message"},ie());const he=(0,l.A)("ActionMessage message-list-item",M&&!x&&"focused",(Q||Z)&&"centered-action",ue&&"has-menu-open",E&&"last-in-list",ne);return a.Ay.createElement("div",{ref:H,id:(0,i.GZ)(t.id),className:he,"data-message-id":t.id,"data-is-pinned":t.isPinned||void 0,onMouseDown:e=>{(0,m.l)(e),le(e)},onContextMenu:ce},!Z&&!Y&&!X&&a.Ay.createElement("span",{className:"action-message-content"},ie()),Q&&a.Ay.createElement("span",{className:"action-message-gift",tabIndex:0,role:"button",onClick:()=>{K({isGift:!0,fromUserId:C?.id,toUserId:w?.[0],monthsAmount:t.content.action?.months||0})}},a.Ay.createElement(v.A,{key:t.id,sticker:R,play:F,noLoop:!0,nonInteractive:!0}),a.Ay.createElement("strong",null,J("ActionGiftPremiumTitle")),a.Ay.createElement("span",null,J("ActionGiftPremiumSubtitle",J("Months",t.content.action?.months,"i"))),a.Ay.createElement("span",{className:"action-message-button"},J("ActionGiftPremiumView"))),Y&&function(){const e=t.content.action?.isGiveaway,n=t.content.action?.isUnclaimed;return a.Ay.createElement("span",{className:"action-message-gift action-message-gift-code",tabIndex:0,role:"button",onClick:Ae},a.Ay.createElement(v.A,{key:t.id,sticker:R,play:F,noLoop:!0,nonInteractive:!0}),a.Ay.createElement("strong",null,J(n?"BoostingUnclaimedPrize":"BoostingCongratulations")),a.Ay.createElement("span",{className:"action-message-subtitle"},I&&(0,d.A)(J(e?"BoostingReceivedGiftFrom":n?"BoostingReceivedPrizeFrom":"BoostingYouHaveUnclaimedPrize",(0,i.Js)(J,I)),["simple_markdown"])),a.Ay.createElement("span",{className:"action-message-subtitle"},(0,d.A)(J("BoostingUnclaimedPrizeDuration",J("Months",t.content.action?.months,"i")),["simple_markdown"])),a.Ay.createElement("span",{className:"action-message-button"},J("BoostingReceivedGiftOpenBtn")))}(),Z&&a.Ay.createElement(k,{message:t,renderContent:ie}),X&&a.Ay.createElement(q,{chatId:N}),se&&a.Ay.createElement(T.A,{isOpen:re,anchor:se,message:t,messageListType:"thread",onClose:de,onCloseAnimationEnd:me}))})))},48553:(e,t,n)=>{n.d(t,{A:()=>C});var a=n(84051),o=n(13439),i=n(97335),r=n(89925),s=n(66644),l=n(59589),c=n(67321),d=n(82393),m=n(2178),u=n(39351),A=n(17712),h=n(64493),p=n(22699),g=n(24433),y=n(60859),f=n(80089),v=n(80464);const E=e=>{const{isOpen:t}=e,n=(0,v.A)(f.ar.Extra,"HeaderMenuContainer",!t);return n?a.Ay.createElement(n,e):void 0},C=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatId:n,threadId:a,messageListType:o,isMobile:r}=t;const s=(0,c.hds)(e,n),m=Boolean(s&&(0,l.WX)(s)),u=Boolean(s&&(0,l.Vs)(s)),A=(0,c.wmb)(e),h=(0,c.Qq_)(e),p=(0,l.L8)(n),{doNotTranslate:g}=e.settings.byKey;if(!s||s.isRestricted||(0,c.rTV)(e))return{noMenu:!0,language:A,translationLanguage:h,doNotTranslate:g};const y=(0,c.yps)(e,n),f=p?void 0:(0,c.AWZ)(e,n),v=p?(0,c.vGo)(e,n):void 0,E=f||v,C=(0,c.nZ4)(e,n),b="thread"===o&&a===i.l3,w="thread"===o&&a!==i.l3,S=(0,c.gjV)(e,r),N=(0,l.cG)(n,a,e.currentUserId),I=!!p&&(0,c.apd)(e,n),M=Boolean(y&&I),k=!M&&Boolean((0,c.I_m)(e,n)),T=I&&!y,P=Boolean((b||s.isForum)&&(m||u)&&s.isNotJoined),x=b||w,R=d.OL&&(0,l.L8)(s.id)&&!C&&!y&&!s.isSupport&&!(0,l.Qe)(s.id),L=b&&!C&&!P,B=N||b&&!P,O=d.OL&&b&&s.isCallActive,F=d.OL&&b&&!s.isCallActive&&(s.adminRights?.manageCall||s.isCreator&&(0,l.yn)(s)),D=b&&f?.canViewStatistics,U=b&&(u||m)&&(D||(0,l.ub)(s,"postStories")),j=!U&&(u||m),$=b?f?.requestsPending:void 0,K=Boolean(s?.isNotJoined&&s.isJoinToSend),_=Boolean(s?.isNotJoined&&s.isJoinRequest),z=!(0,c.PKK)(e),J=Boolean((0,c.qZq)(e,n));return{noMenu:!1,isChannel:m,isRightColumnShown:S,canStartBot:k,canRestartBot:M,canSubscribe:P,canSearch:x,canCall:R,canMute:L,canViewStatistics:D,canViewBoosts:U,canShowBoostModal:j,canLeave:B,canEnterVoiceChat:O,canCreateVoiceChat:F,pendingJoinRequests:$,shouldJoinToSend:K,shouldSendJoinRequest:_,noAnimation:z,canTranslate:(0,c.jGY)(e,n)&&!E?.isTranslationDisabled,isTranslating:J,translationLanguage:h,language:A,doNotTranslate:g,detectedChatLanguage:s.detectedLanguage,canUnblock:T}}))((e=>{let{chatId:t,threadId:n,noMenu:i,isMobile:l,isChannel:c,canStartBot:f,canRestartBot:v,canUnblock:C,canSubscribe:w,canSearch:S,canCall:N,canMute:I,canViewStatistics:M,canViewBoosts:k,canShowBoostModal:T,canLeave:P,canEnterVoiceChat:x,canCreateVoiceChat:R,pendingJoinRequests:L,isRightColumnShown:B,isForForum:O,canExpandActions:F,shouldJoinToSend:D,shouldSendJoinRequest:U,noAnimation:j,canTranslate:$,isTranslating:K,translationLanguage:_,language:z,detectedChatLanguage:J,doNotTranslate:H,onTopicSearch:V}=e;const{joinChannel:q,sendBotCommand:G,openLocalTextSearch:W,restartBot:Q,requestMasterAndRequestCall:Y,requestNextManagementScreen:Z,showNotification:X,openChat:ee,requestChatTranslation:te,togglePeerTranslations:ne,openChatLanguageModal:ae,setSettingOption:oe,unblockUser:ie,setViewForumAsMessages:re}=(0,o.ko)(),se=(0,a.li)(null),le=(0,u.A)(),[ce,de]=(0,a.J0)(!1),[me,ue]=(0,a.J0)(void 0),Ae=(0,A.A)((()=>{de(!0);const e=se.current.getBoundingClientRect();ue({x:e.right,y:e.bottom})})),he=(0,A.A)((()=>{de(!1)})),pe=(0,A.A)((()=>{ue(void 0)})),ge=(0,A.A)((()=>{q({chatId:t}),U&&X({message:le(c?"RequestToJoinChannelSentDescription":"RequestToJoinGroupSentDescription")})})),ye=(0,A.A)((()=>{G({command:"/start"})})),fe=(0,A.A)((()=>{Q({chatId:t})})),ve=(0,A.A)((()=>{ie({userId:t})})),Ee=(0,A.A)((()=>{te(K?{chatId:t,toLanguageCode:void 0}:{chatId:t,toLanguageCode:_})})),Ce=(0,A.A)((()=>{Z({screen:r.je.JoinRequests})})),be=(0,A.A)((()=>{O?V?.():(W(),l?document.querySelector("#MobileSearch input").focus():j?(0,s.YS)((()=>{(0,s.Uz)(b)})):setTimeout(b,320))})),we=(0,A.A)((()=>{ee({id:t}),re({chatId:t,isEnabled:!0})})),Se=(0,A.A)((()=>{Y({userId:t})})),Ne=(0,A.A)((e=>{S&&d.lE&&!e.shiftKey&&(e.preventDefault(),be())})),Ie=(0,A.A)(((e,t)=>{const n=`TranslateLanguage${t.split("-")[0].toUpperCase()}`,a=le(n);if(a!==n)return le(e,a);const o=new Intl.DisplayNames([z],{type:"language"}).of(t);return le(`${e}Other`,o)})),Me=(0,a.Kr)((()=>K?le("ShowOriginalButton"):Ie("TranslateToButton",_)),[_,Ie,K,le]),ke=(0,a.Kr)((()=>{if(J)return Ie("DoNotTranslateLanguage",J)}),[Ie,J]),Te=(0,A.A)((()=>{ne({chatId:t,isEnabled:!1}),te({chatId:t,toLanguageCode:void 0})})),Pe=(0,A.A)((()=>{ae({chatId:t})})),xe=(0,A.A)((()=>{J&&(oe({doNotTranslate:[...H,J]}),te({chatId:t,toLanguageCode:void 0}),X({message:Ie("AddedToDoNotTranslate",J)}))}));(0,m.v)({"Mod+F":Ne});const Re=(0,a.Kr)((()=>e=>{let{onTrigger:t,isOpen:n}=e;return a.Ay.createElement(h.A,{round:!0,ripple:B,color:"translucent",size:"smaller",className:n?"active":"",onClick:t,ariaLabel:le("TranslateMessage")},a.Ay.createElement("i",{className:"icon icon-language","aria-hidden":!0}))}),[B,le]);return a.Ay.createElement("div",{className:"HeaderActions"},!O&&$&&a.Ay.createElement(p.A,{className:"stickers-more-menu with-menu-transitions",trigger:Re,positionX:"right"},a.Ay.createElement(g.A,{icon:"language",onClick:Ee},Me),a.Ay.createElement(g.A,{icon:"replace",onClick:Pe},le("Chat.Translate.Menu.To")),a.Ay.createElement(y.A,null),J&&a.Ay.createElement(g.A,{icon:"hand-stop",onClick:xe},ke),a.Ay.createElement(g.A,{icon:"close-circle",onClick:Te},le("Hide"))),!l&&a.Ay.createElement(a.Ay.Fragment,null,F&&!U&&(w||D)&&a.Ay.createElement(h.A,{size:"tiny",ripple:!0,fluid:!0,onClick:ge},le(c?"ProfileJoinChannel":"ProfileJoinGroup")),F&&U&&a.Ay.createElement(h.A,{size:"tiny",ripple:!0,fluid:!0,onClick:ge},le("ChannelJoinRequest")),F&&f&&a.Ay.createElement(h.A,{size:"tiny",ripple:!0,fluid:!0,onClick:ye},le("BotStart")),F&&v&&a.Ay.createElement(h.A,{size:"tiny",ripple:!0,fluid:!0,onClick:fe},le("BotRestart")),F&&C&&a.Ay.createElement(h.A,{size:"tiny",ripple:!0,fluid:!0,onClick:ve},le("Unblock")),S&&a.Ay.createElement(h.A,{round:!0,ripple:B,color:"translucent",size:"smaller",onClick:be,ariaLabel:le("Conversation.SearchPlaceholder")},a.Ay.createElement("i",{className:"icon icon-search","aria-hidden":!0})),N&&a.Ay.createElement(h.A,{round:!0,color:"translucent",size:"smaller",onClick:Se,ariaLabel:"Call"},a.Ay.createElement("i",{className:"icon icon-phone","aria-hidden":!0}))),!O&&Boolean(L)&&a.Ay.createElement(h.A,{round:!0,className:"badge-button",ripple:B,color:"translucent",size:"smaller",onClick:Ce,ariaLabel:le(c?"SubscribeRequests":"MemberRequests")},a.Ay.createElement("i",{className:"icon icon-user","aria-hidden":!0}),a.Ay.createElement("div",{className:"badge"},L)),a.Ay.createElement(h.A,{ref:se,className:ce?"active":"",round:!0,ripple:!l,size:"smaller",color:"translucent",disabled:i,ariaLabel:"More actions",onClick:Ae},a.Ay.createElement("i",{className:"icon icon-more","aria-hidden":!0})),me&&a.Ay.createElement(E,{chatId:t,threadId:n,isOpen:ce,anchor:me,withExtraActions:l||!F,isChannel:c,canStartBot:f,canSubscribe:w,canSearch:S,canCall:N,canMute:I,canViewStatistics:M,canViewBoosts:k,canShowBoostModal:T,canLeave:P,canEnterVoiceChat:x,canCreateVoiceChat:R,pendingJoinRequests:L,onJoinRequestsClick:Ce,withForumActions:O,onSubscribeChannel:ge,onSearchClick:be,onAsMessagesClick:we,onClose:he,onCloseAnimationEnd:pe}))})));function b(){const e=document.querySelector(".RightHeader .SearchInput input");e?.focus()}},54639:(e,t,n)=>{n.d(t,{A:()=>f});var a=n(84051),o=n(13439),i=n(37661),r=n(39351),s=n(17712),l=n(9168),c=n(24433),d=n(97335),m=n(59589),u=n(87357),A=n(43874),h=n(62587);const p="VGmPJoga",g=/#fff/gi,y=(0,a.ph)((e=>{let{icon:t,theme:n}=e;const{isTouchScreen:o}=(0,A.Ay)(),i=(0,h.A)((0,m.mr)(t),!1,d.qZ.Text),r=(0,a.Kr)((()=>{if(!i)return"";const e="dark"===n?"rgb(170, 170, 170)":"rgb(112, 117, 121)",t=i.replace(g,e),a=(new DOMParser).parseFromString(t,"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}`}),[i,n]);return a.Ay.createElement("i",{className:(0,u.A)("mklnEg0s","icon",!o&&p)},a.Ay.createElement("img",{src:r,alt:"",className:(0,u.A)("tT8KQwg0",!o&&p),draggable:!1}))})),f=(0,a.ph)((e=>{let{bot:t,theme:n,chatId:d,threadId:m,isInSideMenu:u,canShowNew:A,onMenuOpened:h,onMenuClosed:p}=e;const{callAttachBot:g,toggleAttachBot:f}=(0,o.ko)(),v=(0,r.A)(),E=(0,a.Kr)((()=>t.icons.find((e=>{let{name:t}=e;return"default_static"===t}))?.document),[t.icons]),[C,b,w]=(0,i.A)(),[S,N]=(0,a.J0)(void 0),I=(0,s.A)((e=>{e.preventDefault();const t=e.currentTarget.getBoundingClientRect();N({x:t.right,y:t.bottom}),h(),b()})),M=(0,s.A)((()=>{g(u?{bot:t,isFromSideMenu:!0}:{bot:t,chatId:d,threadId:m})})),k=(0,s.A)((()=>{w(),p()})),T=(0,s.A)((()=>{N(void 0)})),P=(0,s.A)((()=>{f({botId:t.id,isEnabled:!1})}));return a.Ay.createElement(c.A,{key:t.id,customIcon:E&&a.Ay.createElement(y,{icon:E,theme:n}),icon:E?void 0:"bots",onClick:M,onContextMenu:I},t.shortName,A&&t.isDisclaimerNeeded&&a.Ay.createElement("span",{className:"menu-item-badge"},v("New")),S&&a.Ay.createElement(l.A,{isOpen:C,positionX:"right",style:`left: ${S.x}px;top: ${S.y}px;`,className:"bot-attach-context-menu",autoClose:!0,withPortal:!0,onClose:k,onCloseAnimationEnd:T},a.Ay.createElement(c.A,{icon:"stop",destructive:!0,onClick:P},v("WebApp.RemoveBot"))))}))},25897:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(80089),i=n(80464);const r=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"CustomEmojiTooltip",!t);return n?a.Ay.createElement(n,e):void 0}},83689:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(80089),i=n(80464);const r=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"CustomSendMenu",!t);return n?a.Ay.createElement(n,e):void 0}},41510:(e,t,n)=>{n.d(t,{I:()=>y,A:()=>f});var a=n(84051),o=n(13439),i=n(59589),r=n(87357),s=n(11778),l=n(55153),c=n(45761),d=n(39351),m=n(17712),u=n(29886),A=n(34201),h=n(3325),p=n(37661);const g=(0,a.ph)((e=>{let{isQuick:t,isGeneric:n,onFileSelect:o}=e;const[i,s,l]=(0,p.A)(),c=(0,r.A)("DropTarget",i&&"hovered");return a.Ay.createElement("div",{className:c,onDrop:o,onDragEnter:s,onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),l()},"data-dropzone":!0},a.Ay.createElement("div",{className:"target-content"},a.Ay.createElement("div",{className:"icon icon-"+(t?"photo":"document")}),a.Ay.createElement("div",{className:"title"},"Drop files here to send them"),!n&&a.Ay.createElement("div",{className:"description"},t?"in a quick way":"without compression")))}));let y=function(e){return e.None="none",e.Document="document",e.QuickFile="quick_file",e}({});const f=(0,a.ph)((e=>{let{isOpen:t,withQuick:n,onHide:p,onFileSelect:y,editingMessage:f}=e;const v=(0,d.A)(),{showNotification:E}=(0,o.ko)(),C=(0,a.li)(null),b=(0,u.A)(n),{shouldRender:w,transitionClassNames:S}=(0,A.A)(t),N=f&&f?.groupedId;(0,a.vJ)((()=>t?(0,s.A)(p):void 0),[t,p]);const I=(0,m.A)((async e=>{const{dataTransfer:t}=e;let a=[];if(!(t.files&&t.files.length>0)||t.items&&t.items.length){if(t.items&&t.items.length>0){const e=await(0,c.A)(t.items),n=e&&await(0,l.A)(e[0].name,e[0]);if(f&&n&&(0,i.eh)(f,n))return void E({message:v(N?"lng_edit_media_album_error":"lng_edit_media_invalid_file")});e?.length&&(a=a.concat(e))}}else a=a.concat(Array.from(t.files));p(),y(a,!n&&void 0)})),M=(0,m.A)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(p(),y(Array.from(t.files),!0))})),k=(0,m.A)((e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;!t.matches(".DropTarget, .DropArea")||n&&n.matches(".DropTarget, .DropArea")||(C.current=window.setTimeout((()=>{p()}),150))}));if(!w)return;const T=n||b,P=(0,r.A)("DropArea",S);return a.Ay.createElement(h.A,{containerId:"#middle-column-portals"},a.Ay.createElement("div",{className:P,onDragLeave:k,onDragOver:()=>{C.current&&window.clearTimeout(C.current)},onDrop:p,onClick:p},a.Ay.createElement(g,{onFileSelect:I,isGeneric:!T}),T&&a.Ay.createElement(g,{onFileSelect:M,isQuick:!0})))}))},49068:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(80089),i=n(80464);const r=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"EmojiTooltip",!t);return n?a.Ay.createElement(n,e):void 0}},78407:(e,t,n)=>{n.d(t,{A:()=>V});var a=n(84051),o=n(13439),i=n(31481),r=n(66644),s=n(67321),l=n(87357),c=n(52674),d=n(14680),m=n(17237),u=n(36353),A=n(37836),h=n(82393),p=n(4961),g=n(11359),y=n(43874),f=n(19129),v=n(37661),E=n(32706),C=n(39351),b=n(17712),w=n(88458),S=n(41733);function N(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: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,N(this,"video",void 0),N(this,"isPlaying",!1),this.video=document.createElement("video"),this.video.src=e,this.video.disablePictureInPicture=!0,this.video.muted=!0,n.style&&this.video.setAttribute("style",n.style),this.video.style.position="absolute",this.video.load(),this.options.noLoop||(this.video.loop=!0),(0,r.RK)((()=>{this.container.appendChild(this.video),this.recalculatePositionAndSize()}))}play(){!this.isPlaying&&this.video&&(this.recalculatePositionAndSize(),this.video.paused&&(0,S.A)(this.video),this.isPlaying=!0)}pause(){this.isPlaying&&this.video&&(this.video.paused||this.video.pause(),this.isPlaying=!1)}destroy(){this.pause(),this.video?.remove(),this.video=void 0}updatePosition(e){this.options.position=e,this.recalculatePositionAndSize()}recalculatePositionAndSize(){const{size:e,position:{x:t,y:n}}=this.options;(0,r.YS)((()=>{if(!this.video)return;const a=this.video,{width:o,height:i}=this.container.getBoundingClientRect();(0,r.RK)((()=>{a.style.left=`${Math.round(t*o)}px`,a.style.top=`${Math.round(n*i)}px`,a.style.width=`${e}px`,a.style.height=`${e}px`}))}))}}var M=n(53307),k=n(43336),T=n(71322),P=n(76023),x=n(28021),R=n(86974),L=n(82117),B=n(93545),O=n(672),F=n(61157),D=n(38691);const U=1.25*P.$;var j=n(61361),$=n(80089),K=n(80464);const _=e=>{const{isOpen:t}=e,n=(0,K.A)($.ar.Extra,"TextFormatter",!t);return n?a.Ay.createElement(n,e):void 0},z="input-scroller",J=140,H=["Esc","Escape","Enter","PageUp","PageDown","Meta","Alt","Ctrl","ArrowDown","ArrowUp","Control","Shift"],V=(0,a.ph)((0,o.EK)(((e,t)=>{let{chatId:n,threadId:a}=t;const{messageSendKeyCombo:o}=e.settings.byKey;return{messageSendKeyCombo:o,replyInfo:n&&a?(0,s.GA4)(e,n,a)?.replyInfo:void 0,isSelectModeActive:(0,s.rTV)(e),canPlayAnimatedEmojis:(0,s.BWX)(e)}}))((e=>{let{ref:t,id:n,chatId:S,captionLimit:N,isAttachmentModalInput:P,isStoryInput:$,customEmojiPrefix:K,editableInputId:V,isReady:q,isActive:G,getHtml:W,placeholder:Q,timedPlaceholderLangKey:Y,timedPlaceholderDate:Z,forcedPlaceholder:X,canSendPlainText:ee,canAutoFocus:te,noFocusInterception:ne,shouldSuppressFocus:ae,shouldSuppressTextFormatter:oe,replyInfo:ie,isSelectModeActive:re,canPlayAnimatedEmojis:se,messageSendKeyCombo:le,onUpdate:ce,onSuppressedFocus:de,onSend:me,onScroll:ue,onFocus:Ae,onBlur:he}=e;const{editLastMessage:pe,replyToNextMessage:ge,showAllowedMessageTypesNotification:ye}=(0,o.ko)();let fe=(0,a.li)(null);t&&(fe=t);const ve=(0,a.li)(null),Ee=(0,a.li)(null),Ce=(0,a.li)(null),be=(0,a.li)(null),we=(0,a.li)(null),Se=(0,a.li)(null),Ne=(0,C.A)(),Ie=(0,a.li)(!1),[Me,ke,Te]=(0,v.A)(),[Pe,xe]=(0,a.J0)(),[Re,Le]=(0,a.J0)(),[Be,Oe]=(0,a.J0)(!1),{isMobile:Fe}=(0,y.Ay)(),De=Fe&&(h.pz||h.Ni),[Ue,je]=(0,a.J0)(!1);(0,a.vJ)((()=>{je(Boolean(Y&&Z))}),[Z,Y]);const $e=(0,b.A)((()=>{je(!1)}));!function(e,t,n,i,l,c,d,m,u){const A=(0,R.A)(t,!m),h=(0,x.A)(A,!0),p=(0,D.A)(),g=(0,a.li)(new Map),y=(0,b.A)((e=>{e.forEach((e=>{const t=g.current.get(e);t&&(t.destroy(),g.current.delete(e))}))})),f=(0,b.A)((()=>{if(!(m&&t.current&&n.current&&i.current))return;const e=(0,o.mS)(),a=new Set(g.current.keys());Array.from(t.current.querySelectorAll(".custom-emoji")).forEach((t=>{if(!t.dataset.uniqueId)return;const o=`${c}${t.dataset.uniqueId}${A||""}`,r=t.dataset.documentId;a.delete(o);const m=(0,M.ZR)(r);if(!m)return;const u=n.current.getBoundingClientRect(),y=t.getBoundingClientRect(),f=(0,k.LI)((y.left-u.left)/u.width,4),v=(0,k.LI)((y.top-u.top)/u.height,4);if(g.current.has(o))return void g.current.get(o).updatePosition(f,v);const E=e.customEmojis.byId[r];if(!E)return;const C=E?.stickerSetInfo&&(0,s.CzR)(e,E.stickerSetInfo),b=[c,r,A,p].filter(Boolean).join("_");(async function(e){let{customEmoji:t,sharedCanvasRef:n,sharedCanvasHqRef:a,absoluteContainerRef:o,renderId:i,viewId:r,mediaUrl:s,position:l,isHq:c,textColor:d,colorFilter:m}=e;if(t.isLottie){const e=t.shouldUseTextColor&&d?(0,T.E2)(d):void 0,o=(await(0,w.Y)()).init(s,c?a.current:n.current,i,{size:U,coords:l,isLowPriority:!c},r,e?[e.r,e.g,e.b]:void 0);return{play:()=>o.play(),pause:()=>o.pause(),destroy:()=>o.removeView(r),updatePosition:(e,t)=>o.setSharedCanvasCoords(r,{x:e,y:t})}}if(t.isVideo){const e=t.shouldUseTextColor&&m?`filter: ${m};`:void 0,n=new I(s,o.current,{size:U,position:l,style:e});return{play:()=>n.play(),pause:()=>n.pause(),destroy:()=>n.destroy(),updatePosition:(e,t)=>n.updatePosition({x:e,y:t})}}throw new Error("Unsupported custom emoji type")})({customEmoji:E,sharedCanvasRef:n,sharedCanvasHqRef:i,absoluteContainerRef:l,renderId:b,viewId:o,mediaUrl:m,isHq:C,position:{x:f,y:v},textColor:A,colorFilter:h}).then((e=>{d&&e.play(),g.current.set(o,e)}))})),y(Array.from(a))}));(0,a.vJ)((()=>(0,M.K3)(f)),[f]),(0,a.vJ)((()=>{const e=g.current;return()=>{y(Array.from(e.keys()))}}),[]),(0,a.vJ)((()=>{e()&&t.current&&n.current&&u&&m?(0,r.YS)((()=>{f()})):y(Array.from(g.current.keys()))}),[e,f,t,y,n,u,m]),(0,a.Nf)((()=>{document.documentElement.style.setProperty("--input-custom-emoji-filter",h||"none")}),[h]),(0,L.A)((e=>{let[t]=e;void 0!==t&&A!==t&&f()}),[A,f]);const v=(0,O.A)(f,[f],300,!1);(0,B.A)(n,v),(0,L.A)((e=>{let[t]=e;p!==t&&(y(Array.from(g.current.keys())),f())}),[p,f]);const E=(0,b.A)((()=>{g.current.forEach((e=>{e.pause()}))})),C=(0,b.A)((()=>{d&&g.current?.forEach((e=>{e.play()}))})),S=(0,b.A)((()=>{(0,r.YS)(C)}));(0,F.A)(E,S)}(W,fe,be,we,Se,K,se,q,G);const Ke=P?160:$?128:Fe?256:416,_e=(0,b.A)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,r.gm)((()=>{const t=fe.current.closest(`.${z}`),n=Number(t.style.height.replace("px","")),a=Ce.current,{scrollHeight:o}=a,i=Math.min(o,Ke);if(i===n)return;const s=o>Ke;function l(){const e=Math.round(50*Math.log(Math.abs(i-n)));t.style.height=`${i}px`,t.style.transitionDuration=`${e}ms`,t.classList.toggle("overflown",s)}return e?void(0,r.RK)(l):l}))}));(0,a.Nf)((()=>{P&&_e(!1)}),[P,_e]);const ze=(0,a.li)(W());(0,a.Nf)((()=>{const e=G?W():"";e!==fe.current.innerHTML&&(fe.current.innerHTML=e),e!==Ee.current.innerHTML&&(Ee.current.innerHTML=e),e!==ze.current&&(ze.current=e,_e(!e))}),[W,G,_e]),(0,a.li)(S).current=S;const Je=(0,b.A)((()=>{fe.current&&((0,E.G)()?setTimeout(Je,350):(0,u.A)(fe.current))})),He=(0,b.A)((()=>{Te(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}));function Ve(){if(h.pz)return!1;const e=window.getSelection();if(!e||!e.rangeCount||Ie.current)return Te(),h.Ni&&Oe(!1),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(oe||!(0,g.L)(t,V||i.CfG)||!n||(0,m.A)(n)||!t.START_TO_END)||(Te(),!1)}function qe(){if(!Ve())return;if(Be)return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=fe.current.closest(`.${z}`).getBoundingClientRect();let a=t.left+t.width/2-n.left;a<J?a=J:a>n.width-J&&(a=n.width-J),xe({x:a,y:t.top-n.top}),Le(e),ke()}function Ge(){ve.current&&window.clearTimeout(ve.current),ve.current=window.setTimeout(qe,260)}(0,a.vJ)((()=>{h.TF||te&&Je()}),[S,Je,ie,te]),(0,a.vJ)((()=>{if(!S||V!==i.CfG||ne||De||re)return;const e=e=>{if((0,d.ZJ)())return;const{key:t}=e,n=e.target;if(!n||H.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.A)(a,!0,!0);const t=new KeyboardEvent(e.type,e);a.dispatchEvent(t)}};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}}),[S,V,De,re,ne]),(0,a.vJ)((()=>{const e=(0,A.sg)((e=>{"Tab"!==e.key||(0,d.ZJ)()||(e.preventDefault(),(0,r.RK)(Je))}),2e3,!0,!1);return(0,c.A)({onTab:e})}),[Je]),(0,a.vJ)((()=>{const e=fe.current;function t(){e.blur()}return ae&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[ae]);const We=(0,f.A)((()=>Boolean(G&&W())),[G,W]),Qe=(0,l.A)("form-control allow-selection",We&&"touched",ae&&"focus-disabled");return a.Ay.createElement("div",{id:n,onClick:ae?de:void 0,dir:Ne.isRtl?"rtl":void 0},a.Ay.createElement("div",{className:(0,l.A)("custom-scroll",z),onScroll:ue,onClick:P||ee?void 0:function(){P||ee||ye({chatId:S})}},a.Ay.createElement("div",{className:"input-scroller-content"},a.Ay.createElement("div",{ref:fe,id:V||i.CfG,className:Qe,contentEditable:P||ee,role:"textbox",dir:"auto",tabIndex:0,onClick:Je,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if(ce("<br>"===t?"":t),!h.TF&&(!n||!n.length)&&(h.TL||!t.includes("emoji-small"))&&!t.includes("custom-emoji")){const e=window.getSelection();e&&(fe.current.blur(),e.removeAllRanges(),(0,u.A)(fe.current,!0))}},onKeyDown:function(e){const{isComposing:t}=e,n=W();if(!t&&!n&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void ge({targetIndexDelta:t})}t||"Enter"!==e.key||e.shiftKey?t||"ArrowUp"!==e.key||n||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",Ge,{once:!0}):(e.preventDefault(),pe()):!De&&("enter"===le&&!e.shiftKey||"ctrl-enter"===le&&(e.ctrlKey||e.metaKey))&&(e.preventDefault(),Te(),me())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout((()=>{Ie.current=!1}),100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?Ie.current||(Ie.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):(e.currentTarget.closest(".message-input-wrapper")||e.target).addEventListener("mouseup",Ge,{once:!0})},onContextMenu:h.Ni?function(e){Ve()&&(Oe(!Be),Be?Te():(e.preventDefault(),e.stopPropagation(),qe()))}:void 0,onTouchCancel:h.Ni?Ge:void 0,"aria-label":Q,onFocus:Ae,onBlur:he}),!X&&a.Ay.createElement("span",{className:(0,l.A)("placeholder-text",!P&&!ee&&"with-icon"),dir:"auto"},!P&&!ee&&a.Ay.createElement("i",{className:"icon icon-lock-badge placeholder-icon"}),Ue?a.Ay.createElement(j.A,{langKey:Y,endsAt:Z,onEnd:$e}):Q),a.Ay.createElement("canvas",{ref:be,className:"shared-canvas"}),a.Ay.createElement("canvas",{ref:we,className:"shared-canvas"}),a.Ay.createElement("div",{ref:Se,className:"absolute-video-container"}))),a.Ay.createElement("div",{ref:Ce,className:(0,l.A)("custom-scroll",z,"clone")},a.Ay.createElement("div",{className:"input-scroller-content"},a.Ay.createElement("div",{ref:Ee,className:(0,l.A)(Qe,"clone"),dir:"auto"}))),void 0!==N&&a.Ay.createElement("div",{className:"max-length-indicator",dir:"auto"},N),a.Ay.createElement(_,{isOpen:Me,anchorPosition:Pe,selectedRange:Re,setSelectedRange:Le,onClose:He}),X&&a.Ay.createElement("span",{className:"forced-placeholder"},(0,p.A)(X)))})))},26440:(e,t,n)=>{n.d(t,{A:()=>g});var a=n(84051),o=n(13439),i=n(31481),r=n(87357),s=n(37661),l=n(17712),c=n(94803),d=n(64493),m=n(66469),u=n(57474),A=n(80089),h=n(80464);const p=e=>{const{isOpen:t}=e,n=(0,h.A)(A.ar.Extra,"SymbolMenu",!t);return n?a.Ay.createElement(n,e):void 0},g=(0,a.ph)((e=>{let{chatId:t,threadId:n,isMobile:A,canSendGifs:h,canSendStickers:g,isMessageComposer:y,isReady:f,isSymbolMenuOpen:v,idPrefix:E,isAttachmentModal:C,canSendPlainText:b,isSymbolMenuForced:w,className:S,forceDarkTheme:N,inputCssSelector:I=i.m$5,openSymbolMenu:M,closeSymbolMenu:k,onCustomEmojiSelect:T,onStickerSelect:P,onGifSelect:x,onRemoveSymbol:R,onEmojiSelect:L,closeBotCommandMenu:B,closeSendAsMenu:O}=e;const{setStickerSearchQuery:F,setGifSearchQuery:D,addRecentEmoji:U,addRecentCustomEmoji:j}=(0,o.ko)(),$=(0,a.li)(null),[K,_]=(0,s.A)(),[z,J]=(0,a.J0)(void 0),H=(0,r.A)("mobile-symbol-menu-button",!f&&"not-ready",K?v&&"menu-opened":v&&"is-loading"),V=(0,l.A)((()=>{B?.(),O?.(),M();const e=$.current;if(!e)return;const{x:t,y:n}=e.getBoundingClientRect();J({x:t,y:n})})),q=(0,l.A)((e=>{"stickers"===e?(F({query:""}),D({query:void 0})):(D({query:""}),F({query:void 0}))})),G=(0,l.A)((()=>{const e=document.querySelector(C?i.wVm:I);A&&e===document.activeElement?(e?.blur(),setTimeout((()=>{B?.(),M()}),100)):M()})),W=(0,l.A)((()=>$.current)),Q=(0,l.A)((()=>$.current?.closest(".custom-scroll, .no-scrollbar"))),Y=(0,l.A)((()=>document.querySelector("#portals .SymbolMenu .bubble"))),Z=(0,l.A)((()=>({withPortal:!0}))),{positionX:X,positionY:ee,transformOriginX:te,transformOriginY:ne,style:ae}=(0,c.A)(z,W,Q,Y,Z);return a.Ay.createElement(a.Ay.Fragment,null,A?a.Ay.createElement(d.A,{className:H,round:!0,color:"translucent",onClick:v?k:G,ariaLabel:"Choose emoji, sticker or GIF"},a.Ay.createElement("i",{className:"icon icon-smile"}),a.Ay.createElement("i",{className:"icon icon-keyboard"}),v&&!K&&a.Ay.createElement(u.A,{color:"gray"})):a.Ay.createElement(m.A,{className:(0,r.A)("symbol-menu-button",v&&"activated"),round:!0,color:"translucent",onActivate:V,ariaLabel:"Choose emoji, sticker or GIF"},a.Ay.createElement("div",{ref:$,className:"symbol-menu-trigger"}),a.Ay.createElement("i",{className:"icon icon-smile"})),a.Ay.createElement(p,{chatId:t,threadId:n,isOpen:v||Boolean(w),canSendGifs:h,canSendStickers:g,isMessageComposer:y,idPrefix:E,onLoad:_,onClose:k,onEmojiSelect:L,onStickerSelect:P,onCustomEmojiSelect:T,onGifSelect:x,onRemoveSymbol:R,onSearchOpen:q,addRecentEmoji:U,addRecentCustomEmoji:j,isAttachmentModal:C,canSendPlainText:b,className:(0,r.A)(S,N&&"component-theme-dark"),positionX:C?X:void 0,positionY:C?ee:void 0,transformOriginX:C?te:void 0,transformOriginY:C?ne:void 0,style:C?ae:void 0}))}))},55153:(e,t,n)=>{n.d(t,{A:()=>d,L:()=>m});var a=n(31481),o=n(87679),i=n(24909);const r=1280,s=40,l=20,c=/\.[^/.]+$/;async function d(e,t,l){const m=URL.createObjectURL(t),{type:A,size:h}=t;let p,g,y,f;if(a.RJA.has(A)){const n=await(0,o.NN)(m),{width:h,height:g}=n;f=!u(h,g);const v=Math.max(h,g)>r,E=A===a.Vz3;if(!f){if(!l?.compressedBlobUrl&&!E&&(v||"image/jpeg"!==A)){const n=await(0,i.s)(m,v?r/Math.max(h,g):1,"image/jpeg");return URL.revokeObjectURL(m),d(e,t,{compressedBlobUrl:n})}"image/jpeg"===A&&(e=e.replace(c,".jpg")),p={width:h,height:g}}y=Math.max(h,g)>s?await(0,i.s)(m,s/Math.max(h,g),"image/jpeg"):m}else if(a.fNs.has(A)){try{const{videoWidth:e,videoHeight:t,duration:n}=await(0,o.FW)(m);f=!u(e,t),f||(p={width:e,height:t,duration:n})}catch(e){f=!0}y=await(0,o.eT)(m)}else if(a.IH3.has(A)){const{duration:e,title:t,performer:a,coverUrl:o}=await async function(e){const{fetchFromUrl:t,selectCover:a}=await n.e(244).then(n.t.bind(n,30244,23)),o=await t(e),{common:{title:i,artist:r,picture:s},format:{duration:l}}=o,c=a(s),d=c?new Blob([c.data],{type:c.format}):void 0;return{title:i,performer:r,duration:l,coverUrl:d?URL.createObjectURL(d):void 0}}(m);g={duration:e||0,title:t,performer:a},y=o}return{blobUrl:m,filename:e,mimeType:A,size:h,quick:p,audio:g,previewBlobUrl:y,shouldSendAsFile:f||void 0,uniqueId:`${Date.now()}-${Math.random()}`,...l}}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)<=l}},45761:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(87679);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.kc)(t)}},17778:(e,t,n)=>{n.d(t,{S:()=>s});const a=/(<br>|<br\s?\/>)/g,o=/( |\u00A0)/g,i=/(<div>|<\/div>)/gi,r=/\n$/i;function s(e){return e.replace(o," ").replace(a,"\n").replace(i,"").replace(r,"")}},11359:(e,t,n)=>{n.d(t,{L:()=>o});const a=5;function o(e,t){const{commonAncestorContainer:n}=e;let o=n,i=1;for(;o&&o.id!==t&&i<a;)o=o.parentElement,i++;return Boolean(o&&o.id===t)}},3225:(e,t,n)=>{n.d(t,{A:()=>E});var a=n(84051),o=n(13439),i=n(31481),r=n(66644),s=n(98221),l=n(36353),c=n(39074),d=n(82393),m=n(58734),u=n(63988),A=n(83414),h=n(19129),p=n(37661),g=n(17712);const y=300,f=new RegExp(`(${s.A.source})$`,"g"),v=new RegExp(`${i.bpX.source}$`,"g");function E(e,t,n,E,C,b){const{loadCustomEmojiForEmoji:w,clearCustomEmojiForEmoji:S}=(0,o.ko)(),[N,I,M]=(0,p.A)(!1),k=(0,u.gs)((()=>{const n=t();if(!e||!n||!E()?.collapsed)return;if(!n.match(d.TL?s.A:i.bpX))return;const a=(0,c.LV)(C.current);return a.match(d.TL?f:v)?.[0]}),[t,E,C,e],y),T=(0,A.A)(k,[k,t,E],!0),P=(0,h.A)((()=>Boolean(T())),[T]),x=Boolean(b?.length);(0,a.vJ)((()=>{if(!e||!P)return;const t=T();t?x||w({emoji:d.TL?t:t.match(/.+alt="(.+)"/)?.[1]}):S()}),[e,P,T,x,S,w]);const R=(0,g.A)((t=>{const a=T();if(!e||!a)return;const o=C.current,i=(0,c.LV)(o),s=d.TL?a:a.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),u=new RegExp(`(${s})\\1*$`,""),A=i.match(u)[0].length/a.length,h=i.replace(u,(0,m.hB)(t).repeat(A)),p=o.innerHTML.substring(i.length);n(`${h}${p}`),(0,r.Uz)((()=>{(0,l.A)(o,!0,!0)}))}));return(0,a.vJ)(M,[M,t]),{isCustomEmojiTooltipOpen:Boolean(P&&x&&!N),closeCustomEmojiTooltip:I,insertCustomEmoji:R}}},25498:(e,t,n)=>{n.d(t,{A:()=>x});var a=n(84051),o=n(13439),i=n(31481),r=n(66644),s=n(67321),l=n(52491),c=n(36353),d=n(87894),m=n(79824),u=n(37830),A=n(4961),h=n(58734),p=n(17778),g=n(63988),y=n(83414),f=n(37661),v=n(17712);let E,C,b,w,S;const N=36,I=2,M=300,k=(0,u.A)((function(e,t,n){return e&&t.length?Object.values((0,d._E)(e,t)).slice(0,n):m.p})),T=(0,u.A)((function(e,t,n){const a=Object.values(e),o=(0,d.dU)(a,"native"),i=t?(0,d.LG)(t,(e=>Object.values((0,d._E)(o,e)))):{},r=n?(0,d.LG)(n,(e=>Object.values((0,d._E)(o,e)))):{},s={...i,...r},l=[].concat(Object.keys(i),Object.keys(r)),c=a.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{}),m=Object.keys(c),u=l.reduce(((e,t)=>Math.max(e,t.length)),0);return{byKeyword:s,keywords:l,byName:c,names:m,maxKeyLength:u}})),P=(0,u.A)((function(e,t,n){const{byKeyword:a,keywords:o,byName:i,names:r,maxKeyLength:s}=e;let l=[];if(t.length>s)return m.p;const c=o.filter((e=>e.startsWith(t))).sort();l=l.concat(Object.values((0,d._E)(a,c)).flat());const u=r.filter((e=>e.startsWith(t)));return l=l.concat(Object.values((0,d._E)(i,u)).flat()),l=(0,d.Am)(l),l.length?l.slice(0,n):m.p}));try{w=/(^|\s):(?!\s)[-+_:'\s\p{L}\p{N}]*$/giu,S=/\p{Ll}/u}catch(e){w=/(^|\s):(?!\s)[-+_:'\s\d\wа-яёґєії]*$/gi,S=/[a-zяёґєії]/}function x(e,t,u){let x=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.CfG,R=arguments.length>4?arguments[4]:void 0,L=arguments.length>5?arguments[5]:void 0,B=arguments.length>6?arguments[6]:void 0;const[O,F,D]=(0,f.A)(!1),[U,j]=(0,a.J0)(),[$,K]=(0,a.J0)(m.p),[_,z]=(0,a.J0)(m.p);(0,a.vJ)((()=>{function t(){j(b.emojis)}e&&(b?t():async function(){return E||(E=n.e(996).then(n.t.bind(n,20996,19)),C=(await E).default,b=(0,l.cp)(C)),E}().then(t))}),[e]);const J=(0,g.gs)((()=>{const n=t();return e&&n.includes(":")?(0,p.S)(n).match(w)?.[0].trim():void 0}),[t,e],M),H=(0,y.A)(J,[J,t],!0),V=(0,v.A)((e=>{if(K(e),e===m.p)return void z(m.p);const t=e.map((e=>e.native)),n=(0,d.Xd)((0,s.oZ0)((0,o.mS)(),t),"id");z(n)})),q=(0,v.A)((function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[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,A.A)(e,["emoji_html"]):(0,h.hB)(e);u(`${a.substring(0,o)}${t}`);const n=x===i.CfG?document.querySelector(i.m$5):document.getElementById(x);(0,r.Uz)((()=>{(0,c.A)(n,!0,!0)}))}V(m.p)}));return(0,a.vJ)((()=>{const e=H();if(!e||!U)return void V(m.p);const t=e.length>2&&e.endsWith(":"),n=e.substring(1,t?1+e.length-2:void 0);let a=m.p;if(n){if(1===n.length&&S.test(n)||n.length>=I){const e=T(U,L,B);a=P(e,n.toLowerCase(),N)}}else a=k(U,R,N);a.length?t?q(a[0].native,!0):V(a):V(m.p)}),[L,U,H,B,q,R,V]),(0,a.vJ)(D,[D,t]),{isEmojiTooltipOpen:Boolean($.length||_.length)&&!O,closeEmojiTooltip:F,filteredEmojis:$,filteredCustomEmojis:_,insertEmoji:q}}},9442:(e,t,n)=>{n.d(t,{A:()=>f});var a=n(84051),o=n(13439),i=n(97335),r=n(66644),s=n(59589),l=n(36353),c=n(87894),d=n(39074),m=n(17778),u=n(63988),A=n(83414),h=n(37661),p=n(17712);const g=300;let y;try{y=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){y=/(^|\s)@[-_\d\wа-яёґєії]*$/gi}function f(e,t,n,f,E,C,b,w){const[S,N]=(0,a.J0)(),[I,M,k]=(0,h.A)(!1),T=(0,u.gs)((()=>{const n=t();if(!e||!f()?.collapsed||!n.includes("@"))return;const a=(0,d.LV)(E.current);return(0,m.S)(a).match(y)?.[0].trim()}),[e,t,f,E],g),P=(0,A.A)(T,[T,t,f],!0),x=(0,A.A)((()=>e&&t().startsWith("@")),[t,e]);(0,a.vJ)((()=>{const e=P();if(!e||!C&&!b)return void N(void 0);const t=(0,o.mS)().users.byId;if(!t)return void N(void 0);const n=C?.reduce(((e,t)=>(t.userId!==w&&e.push(t.userId),e)),[]),a=e.substring(1),i=(0,s.Z$)((0,c.Am)([...x()&&b||[],...n||[]]),t,a);N(Object.values((0,c._E)(t,i)))}),[w,C,b,P,x]);const R=(0,p.A)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.usernames&&!(0,s.u0)(e))return;const a=(0,s.Kl)(e),o=(0,s.u0)(e)||"",c=a?`@${a}`:`<a\n class="text-entity-link"\n data-entity-type="${i.C7.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${o}</a>`,m=E.current,u=v((0,d.LV)(m)),A=u.lastIndexOf("@"),h=(a?a.length+1:o.length)-(u.length-A);if(-1!==A){const e=`${u.substr(0,A)}${c} `,a=v(m.innerHTML).substring(u.length),o=(0,d.JC)(m);n(`${e}${a}`),(0,r.Uz)((()=>{const e=o+h+1;(0,l.A)(m,t),e>=0&&(0,d.vZ)(m,e)}))}N(void 0)}));return(0,a.vJ)(k,[k,t]),{isMentionTooltipOpen:Boolean(S?.length&&!I),closeMentionTooltip:M,insertMention:R,mentionFilteredUsers:S}}function v(e){return e.replace(/<div>(<br>|<br\s?\/>)?<\/div>/gi,"<br>")}},70297:(e,t,n)=>{n.d(t,{A:()=>y});var a=n(84051),o=n(13439),i=n(59589),r=n(87357),s=n(11410),l=n(82393),c=n(43874),d=n(45470),m=n(14),u=n(39351),A=n(17712),h=n(62587),p=n(34201),g=n(83429);const y=(0,a.ph)((function(e){let{story:t,isPreview:n,isProtected:y,isConnected:f}=e;const{openStoryViewer:v,loadPeerStoriesByIds:E,showNotification:C}=(0,o.ko)(),b=(0,u.A)(),{isMobile:w}=(0,c.Ay)(),S=t&&"isDeleted"in t,N=t&&"content"in t,I=N?t.content.video:void 0,M=N?(0,i.EN)(t):void 0,k=(0,h.A)(M),T=N?I?I.thumbnail?.dataUri:t.content.photo?.thumbnail?.dataUri:void 0,P=(0,m.A)(k,!0),{shouldRender:x,transitionClassNames:R}=(0,p.A)(Boolean(P)),L=(0,d.A)(T,S&&!n,w&&!l.QH),B=(0,r.A)("EVLTkrt1","media-inner",(!f||S)&&"AQWPv0bP",S&&"tprkr7qf",n&&"V3HabdKr");(0,a.vJ)((()=>{!t||N||S||E({peerId:t.peerId,storyIds:[t.id]})}),[t,S,N]);const O=(0,A.A)((()=>{S?C({message:b("StoryNotFound")}):v({peerId:t.peerId,storyId:t.id,isSinglePeer:!0,isSingleStory:!0})}));return a.Ay.createElement("div",{className:B,onClick:f?O:void 0},!S&&n&&a.Ay.createElement("canvas",{ref:L,className:"thumbnail blurred-bg"}),x&&a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement("img",{src:P,alt:"",className:(0,r.A)("WAItYc5d",n&&"ClGe8yij",R),draggable:!1}),N&&a.Ay.createElement(g.A,{story:t,className:R})),S&&a.Ay.createElement("span",null,a.Ay.createElement("i",{className:(0,r.A)("nLA7VEhv","icon icon-story-expired"),"aria-hidden":!0}),b("StoryExpiredSubtitle")),Boolean(I?.duration)&&a.Ay.createElement("div",{className:"message-media-duration"},(0,s.QO)(I.duration)),y&&a.Ay.createElement("span",{className:"protector"}))}))},19381:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(80089),i=n(80464);const r=e=>{const{isOpen:t}=e,n=(0,i.A)(o.ar.Extra,"ContextMenuContainer",!t);return n?a.Ay.createElement(n,e):void 0}},51644:(e,t,n)=>{n.d(t,{A:()=>b});var a=n(84051),o=n(31481),i=n(66644),r=n(59589),s=n(87357),l=n(40435),c=n(35127),d=n(43874),m=n(37661),u=n(5912),A=n(17712),h=n(37859),p=n(37960),g=n(91800),y=n(29886),f=n(34201),v=n(67749),E=n(27860),C=n(35913);const b=e=>{let{id:t,message:n,observeIntersection:b,noAvatars:w,canAutoLoad:S,isInSelectMode:N,isSelected:I,uploadProgress:M,forcedWidth:k,size:T="inline",dimensions:P,asForwarded:x,nonInteractive:R,shouldAffectAppendix:L,isDownloading:B,isProtected:O,theme:F,onClick:D,onCancelUpload:U}=e;const j=(0,a.li)(null),$=(0,r.yl)(n)||(0,r.dc)(n),K=$.blobUrl,_=(0,u.Vz)(j,b),{isMobile:z}=(0,d.Ay)(),[J,H]=(0,a.J0)(S),V=J&&_,{mediaData:q,loadProgress:G}=(0,g.A)((0,r.EO)(n,T),!V),W=K||q,Q=Boolean(k),[Y]=(0,a.J0)(!W),Z=Boolean(W),X=(0,v.A)(n,Z),ee=(0,v.A)(n,!Q),te=(0,p.A)(!Z),ne=(0,r.CI)(n),[ae,oe,ie]=(0,m.A)($.isSpoiler);(0,a.vJ)((()=>{$.isSpoiler?oe():ie()}),[$.isSpoiler]);const{loadProgress:re}=(0,g.A)((0,r.EO)(n,"download"),!B,(0,r.nl)(n,"download")),{isUploading:se,isTransferring:le,transferProgress:ce}=(0,r.LK)(n,M||(B?re:G),V&&!W,void 0!==M),de=!1===(0,y.A)(J),{shouldRender:me,transitionClassNames:ue}=(0,f.A)(le,void 0,de,"slow"),{shouldRender:Ae,transitionClassNames:he}=(0,f.A)(!W&&!J),pe=(0,A.A)((()=>{se?U?.(n):W?ae?ie():D?.(n.id):H((e=>!e))})),ge=(0,r.Ie)(n);(0,h.A)((e=>{let[t]=e;if(!L)return void(t&&j.current.closest(o.KFG).removeAttribute(o.D3G));const n=j.current.closest(o.KFG);W?(0,l.A)(W,ge,I,F).then((e=>{(0,i.RK)((()=>{n.style.setProperty("--appendix-bg",e),n.setAttribute(o.D3G,"")}))})):n.classList.add("has-appendix-thumb")}),[L,W,ge,N,I,F]);const{width:ye,height:fe,isSmall:ve}=P||(0,c.yA)(n,x,w,z),Ee=(0,s.A)("media-inner",!se&&!R&&"interactive",ve&&"small-image",ye===fe&&"square-image",fe<c.ej&&"fix-min-height"),Ce=P?` width: ${ye}px; left: ${P.x}px; top: ${P.y}px;`:"",be="inline"===T?`height: ${fe}px;${Ce}`:void 0;return a.Ay.createElement("div",{id:t,ref:j,className:Ee,style:be,onClick:se?void 0:pe},Q&&a.Ay.createElement("canvas",{ref:ee,className:"thumbnail blurred-bg"}),a.Ay.createElement("img",{src:W,className:(0,s.A)("full-media",Q&&"with-blurred-bg"),alt:"",style:k?`width: ${k}px`:void 0,draggable:!O}),Y&&a.Ay.createElement("canvas",{ref:X,className:(0,s.A)("thumbnail",te)}),O&&a.Ay.createElement("span",{className:"protector"}),me&&!Ae&&a.Ay.createElement("div",{className:`media-loading ${ue}`},a.Ay.createElement(C.A,{progress:ce,onClick:se?pe:void 0})),Ae&&a.Ay.createElement("i",{className:(0,s.A)("icon","icon-download",he)}),a.Ay.createElement(E.A,{isVisible:ae,withAnimation:!0,thumbDataUri:ne,width:ye,height:fe,className:"media-spoiler"}),le&&a.Ay.createElement("span",{className:"message-transfer-progress"},Math.round(100*ce),"%"))}},84555:(e,t,n)=>{n.d(t,{A:()=>P});var a=n(84051),o=n(13439),i=n(97335),r=n(59589),s=n(53827),l=n(87357),c=n(11410),d=n(41733),m=n(76023),u=n(63988),A=n(37661),h=n(5912),p=n(17712),g=n(37960),y=n(91800),f=n(29886),v=n(34201),E=n(56331),C=n(67749),b=n(76785),w=n(27860),S=n(64493),N=n(65843),I=n(35913);const M=m.Wd/2,k=2*(M-6)*Math.PI;let T;const P=e=>{let{message:t,className:n,canAutoLoad:P,isDownloading:x,origin:R,observeIntersection:L,onStop:B,onReadMedia:O}=e;const F=(0,a.li)(null),D=(0,a.li)(null),U=(0,a.li)(null),j=t.content.video,{cancelMessageMediaDownload:$,openOneTimeMediaModal:K}=(0,o.ko)(),_=(0,h.Vz)(F,L),[z,J]=(0,a.J0)(P),H=Boolean(z&&_),{mediaData:V,loadProgress:q}=(0,y.A)((0,r.EO)(t,"inline"),!H,(0,r.nl)(t,"inline")),{loadProgress:G}=(0,y.A)((0,r.EO)(t,"download"),!x,i.qZ.BlobUrl),[W,Q]=(0,A.A)(),Y=(0,r.G5)(t),Z="oneTimeModal"===R,X=Y&&!Z,ee=!Boolean((0,r.CI)(t))||W||X,te=(0,C.A)(t,ee),ne=(0,g.A)(!ee),ae=(0,r.CI)(t),oe=z&&!W||x,ie=!1===(0,f.A)(z),{shouldRender:re,transitionClassNames:se}=(0,v.A)(oe,void 0,ie),[le,ce]=(0,a.J0)(!1),[de,me]=(0,E.A)(0),ue=(0,u.aG)(de,16);(0,a.vJ)((()=>{if(!le)return;const e=D.current;me(e.currentTime/e.duration)}),[me,le,ue]),(0,a.Nf)((()=>{if(!le||!U.current)return;const e=k-ue()*k;U.current.setAttribute("stroke-dashoffset",e.toString())}),[le,ue]);const Ae=Boolean(V&&_),he=(0,p.A)((()=>{D.current&&(ce(!1),me(0),(0,d.A)(D.current))})),pe=(0,p.A)((()=>{T?.(),T=he})),ge=(0,p.A)((()=>{const e=D.current;le?e.paused?((0,d.A)(e),(0,s._K)()):e.pause():(pe(),e.pause(),e.currentTime=0,(0,d.A)(e),(0,s._K)(),ce(!0))}));(0,a.vJ)((()=>{Z&&ge()}),[Z]);const ye=(0,p.A)((()=>{if(V){if(!x)return Y&&!Z?(K({message:t}),void O?.()):void ge();$({message:t})}else J((e=>!e))})),fe=(0,p.A)((e=>{const t=e.currentTarget;me(t.currentTime/t.duration)}));return a.Ay.createElement("div",{ref:F,className:(0,l.A)("RoundVideo","media-inner",Z&&"non-interactive",n),onClick:ye},V&&a.Ay.createElement("div",{className:"video-wrapper"},X&&a.Ay.createElement(w.A,{isVisible:!0,thumbDataUri:ae,width:m.Wd,height:m.Wd,className:"media-spoiler"}),a.Ay.createElement(N.A,{canPlay:Ae,ref:D,src:V,className:"full-media",width:m.Wd,height:m.Wd,autoPlay:!X,disablePictureInPicture:!0,muted:!le,loop:!le,playsInline:!0,isPriority:!0,onEnded:le?B??he:void 0,onTimeUpdate:le?fe:void 0,onReady:Q})),!X&&a.Ay.createElement("canvas",{ref:te,className:(0,l.A)("thumbnail",ne),style:`width: ${m.Wd}px; height: ${m.Wd}px`}),a.Ay.createElement("div",{className:"progress"},le&&a.Ay.createElement("svg",{width:m.Wd,height:m.Wd},a.Ay.createElement("circle",{ref:U,cx:M,cy:M,r:M-6,className:"progress-circle",transform:`rotate(-90, ${M}, ${M})`,"stroke-dasharray":k,"stroke-dashoffset":k}))),re&&a.Ay.createElement("div",{className:`media-loading ${se}`},a.Ay.createElement(I.A,{progress:x?G:q})),X&&!re&&a.Ay.createElement("div",{className:"play-wrapper"},a.Ay.createElement(S.A,{color:"dark",round:!0,size:"smaller",className:"play",nonInteractive:!0},a.Ay.createElement(b.A,{name:"play"})),a.Ay.createElement(b.A,{name:"view-once"})),!V&&!z&&a.Ay.createElement("i",{className:"icon icon-download"}),!Z&&a.Ay.createElement("div",{className:"message-media-duration"},le?(0,c.QO)(D.current.currentTime):(0,c.QO)(j.duration),(!le||D.current.paused)&&a.Ay.createElement(b.A,{name:"muted"})))}},25477:(e,t,n)=>{n.d(t,{A:()=>N});var a=n(84051),o=n(13439),i=n(59589),r=n(87357),s=n(11410),l=n(58554),c=n(76023),d=n(35127),m=n(84313),u=n(43874),A=n(37661),h=n(5912),p=n(17712),g=n(62587),y=n(37960),f=n(91800),v=n(29886),E=n(34201),C=n(67749),b=n(27860),w=n(65843),S=n(35913);const N=e=>{let{id:t,message:n,observeIntersectionForLoading:N,observeIntersectionForPlaying:I,noAvatars:M,canAutoLoad:k,canAutoPlay:T,uploadProgress:P,forcedWidth:x,dimensions:R,asForwarded:L,isDownloading:B,isProtected:O,onClick:F,onCancelUpload:D}=e;const U=(0,a.li)(null),j=(0,a.li)(null),$=(0,i.zX)(n)||(0,i.QC)(n),K=$.blobUrl,[_,z,J]=(0,A.A)($.isSpoiler);(0,a.vJ)((()=>{$.isSpoiler?z():J()}),[$.isSpoiler]);const H=(0,h.Vz)(U,N),V=(0,h.Vz)(U,I)&&H,q=(0,a.li)(H);V&&!q.current&&(q.current=!0);const{isMobile:G}=(0,u.Ay)(),[W,Q]=(0,a.J0)(k),Y=Boolean(W&&H),[Z,X]=(0,a.J0)(Boolean(T&&!_)),ee=(0,i.EO)(n,"inline"),[te]=(0,a.J0)(Boolean(ee&&l.Ih(ee))),{mediaData:ne,loadProgress:ae}=(0,f.A)(ee,!Y,(0,i.nl)(n,"inline")),oe=K||ne,[ie,re]=(0,A.A)(),se=(0,i.CI)(n),le=Boolean(se),ce=Boolean(x),de=(0,i.EO)(n,"preview"),[me]=(0,a.J0)(Boolean(de&&l.Ih(de))),ue=H,Ae=(0,g.A)(de,!ue),he=(0,y.A)((le||Ae)&&!ie),pe=!le||Ae||ie,ge=(0,C.A)(n,pe),ye=(0,C.A)(n,!ce),fe=(0,y.A)(!pe),ve=oe&&q.current,Ee=(0,m.A)(j,!0,!ve),{loadProgress:Ce}=(0,f.A)((0,i.EO)(n,"download"),!B,(0,i.nl)(n,"download")),{isUploading:be,isTransferring:we,transferProgress:Se}=(0,i.LK)(n,P||(B?Ce:ae),Y&&!ie&&!te||B,void 0!==P),Ne=!1===(0,v.A)(W),{shouldRender:Ie,transitionClassNames:Me}=(0,E.A)(we&&!Ee,void 0,Ne),{transitionClassNames:ke}=(0,E.A)(Boolean((W||oe)&&!Z&&!Ie)),[Te,Pe]=(0,a.J0)(0),xe=(0,p.A)((e=>{Pe(Math.max(0,e.currentTarget.currentTime-1))})),Re=(Number.isFinite(j.current?.duration)?j.current?.duration:$.duration)||0,Le=(0,i.Ie)(n),Be=Boolean((0,i.QC)(n)),{width:Oe,height:Fe}=R||(0,c.rO)($,Le,L,Be,M,G),De=(0,p.A)((()=>{be?D?.(n):B?(0,o.ko)().cancelMessageMediaDownload({message:n}):oe?(oe&&!Z&&X(!0),_?J():F?.(n.id)):Q((e=>!e))})),Ue=(0,r.A)("media-inner dark",!be&&"interactive",Fe<d.ej&&"fix-min-height"),je=`height: ${Fe}px;${R?` width: ${Oe}px; left: ${R.x}px; top: ${R.y}px;`:""}`;return a.Ay.createElement("div",{ref:U,id:t,className:Ue,style:je,onClick:be?void 0:De},ce&&a.Ay.createElement("canvas",{ref:ye,className:"thumbnail blurred-bg"}),ve&&a.Ay.createElement(w.A,{ref:j,src:oe,className:(0,r.A)("full-media",ce&&"with-blurred-bg"),canPlay:Z&&V&&!Ee,muted:!0,loop:!0,playsInline:!0,draggable:!O,onTimeUpdate:xe,onReady:re,style:x?`width: ${x}px`:void 0}),a.Ay.createElement("img",{src:Ae,className:(0,r.A)("thumbnail",he,ce&&"with-blurred-bg"),alt:"",style:x?`width: ${x}px;`:void 0,draggable:!O}),le&&!me&&a.Ay.createElement("canvas",{ref:ge,className:(0,r.A)("thumbnail",fe)}),O&&a.Ay.createElement("span",{className:"protector"}),a.Ay.createElement("i",{className:(0,r.A)("icon","icon-large-play",ke)}),a.Ay.createElement(b.A,{isVisible:_,withAnimation:!0,thumbDataUri:se,width:Oe,height:Fe,className:"media-spoiler"}),Ie&&a.Ay.createElement("div",{className:(0,r.A)("media-loading",Me)},a.Ay.createElement(S.A,{progress:Se,onClick:De})),!W&&!oe&&a.Ay.createElement("i",{className:"icon icon-download"}),!we||Ee&&!B?a.Ay.createElement("div",{className:"message-media-duration"},$.isGif?"GIF":(0,s.QO)(Math.max(Re-Te,0)),Ee&&a.Ay.createElement("i",{className:"icon icon-message-failed playback-failed"})):a.Ay.createElement("span",{className:"message-transfer-progress"},be||B?`${Math.round(100*Se)}%`:"..."))}},70314:(e,t,n)=>{n.d(t,{A:()=>N});var a=n(84051),o=n(13439),i=n(89925),r=n(59589),s=n(87357),l=n(58849),c=n(4961),d=n(35127),m=n(86974),u=n(43874),A=n(21488),h=n(39351),p=n(17712),g=n(62894),y=n(44589),f=n(39877),v=n(56440),E=n(6413),C=n(64493),b=n(70297),w=n(51644),S=n(25477);const N=(0,a.ph)((e=>{let{message:t,observeIntersectionForLoading:n,observeIntersectionForPlaying:N,noAvatars:I,canAutoLoad:M,canAutoPlay:k,inPreview:T,asForwarded:P,isDownloading:x=!1,isProtected:R,isConnected:L,story:B,theme:O,backgroundEmojiId:F,shouldWarnAboutSvg:D,autoLoadFileMaxSizeMb:U,onMediaClick:j,onAudioPlay:$,onCancelMediaTransfer:K}=e;const{openTelegramLink:_}=(0,o.ko)(),z=(0,r.T_)(t),{isMobile:J}=(0,u.Ay)(),H=(0,a.li)(null),V=(0,a.li)(null),q=(0,h.A)(),G=(0,p.A)((()=>{j()})),W=(0,p.A)((()=>{z&&_({url:z.url})})),{story:Q,stickers:Y}=z||{};(0,A.A)(Q?.peerId,Q?.id,B);const Z=Y?.isWithTextColor||Y?.documents?.[0]?.shouldUseTextColor,X=(0,m.A)(V,!Z);if(!z)return;const{siteName:ee,url:te,displayUrl:ne,title:ae,description:oe,photo:ie,video:re,audio:se,type:le,document:ce}=z,de="telegram_story"===le,me=T||B&&"isDeleted"in B?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}}(le),ue=(0,l.A)(oe,170),Ae=Boolean(ue||ae||ee);let he=Boolean(Y);if(Ae&&z?.photo&&!z.video){const{width:e,height:n}=(0,d.yA)(t,void 0,void 0,J);he=e===n}const pe=(ie||re)&&j&&!he,ge=(0,s.A)("WebPage",T&&"in-preview",he&&"with-square-photo",!ie&&!re&&!T&&"without-media",re&&"with-video",!Ae&&"no-article",ce&&"with-document",me&&"with-quick-button");return a.Ay.createElement("div",{ref:H,className:ge,"data-initial":(ee||ne)[0],dir:q.isRtl?"rtl":"auto"},a.Ay.createElement("div",{className:(0,s.A)("WebPage--content",de&&"is-story")},F&&a.Ay.createElement(f.A,{emojiDocumentId:F,className:"WebPage--background-icons"}),de&&a.Ay.createElement(b.A,{story:B,isProtected:R,isConnected:L,isPreview:!0}),ie&&!re&&a.Ay.createElement(w.A,{message:t,observeIntersection:n,noAvatars:I,canAutoLoad:M,size:he?"pictogram":"inline",asForwarded:P,nonInteractive:!pe,isDownloading:x,isProtected:R,theme:O,onClick:pe?G:void 0,onCancelUpload:K}),Ae&&a.Ay.createElement("div",{className:"WebPage-text"},a.Ay.createElement(v.A,{className:"site-name",url:te,text:ee||ne}),!T&&ae&&a.Ay.createElement("p",{className:"site-title"},(0,c.A)(ae)),ue&&a.Ay.createElement("p",{className:"site-description"},(0,c.A)(ue,["emoji","br"]))),!T&&re&&a.Ay.createElement(S.A,{message:t,observeIntersectionForLoading:n,noAvatars:I,canAutoLoad:M,canAutoPlay:k,asForwarded:P,isDownloading:x,isProtected:R,onClick:pe?G:void 0,onCancelUpload:K}),!T&&se&&a.Ay.createElement(g.Ay,{theme:O,message:t,origin:i.d9.Inline,noAvatars:I,isDownloading:x,onPlay:$,onCancelUpload:K}),!T&&ce&&a.Ay.createElement(y.A,{message:t,observeIntersection:n,autoLoadFileMaxSizeMb:U,onMediaClick:G,onCancelUpload:K,isDownloading:x,shouldWarnAboutSvg:D}),!T&&Y&&a.Ay.createElement("div",{ref:V,className:(0,s.A)("media-inner","square-image",Y.isEmoji&&"WebPage--emoji-grid","WebPage--stickers")},Y.documents.map((e=>a.Ay.createElement("div",{key:e.id,className:"WebPage--sticker"},a.Ay.createElement(E.A,{containerRef:V,sticker:e,shouldLoop:!0,size:Y.isEmoji?38:80,customColor:X,observeIntersectionForPlaying:N,observeIntersectionForLoading:n}))))),T&&ne&&!Ae&&a.Ay.createElement("div",{className:"WebPage-text"},a.Ay.createElement("p",{className:"site-name"},ne),a.Ay.createElement("p",{className:"site-description"},q("Chat.Empty.LinkPreview")))),me&&(ye=me,a.Ay.createElement(C.A,{className:"WebPage--quick-button",size:"tiny",color:"translucent",isRectangular:!0,onClick:W},q(ye))));var ye}))},40435:(e,t,n)=>{n.d(t,{A:()=>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 i=t?n.width-1:0,r=n.height-1;return`rgba(${Array.from(o.getImageData(i,r,1,1).data).join(",")})`}(e,t)}},35127:(e,t,n)=>{n.d(t,{MC:()=>s,ej:()=>c,nP:()=>d,yA:()=>m});var a=n(59589),o=n(76023);const i=12,r=40,s=20*o.$,l=i*o.$,c=5*o.$;function d(e,t){return(e?.length??0)>r||t?s:l}function m(e,t,n,r){const s=(0,a.Ie)(e),l=(0,a.yl)(e)||(0,a.dc)(e),m=(0,a.zX)(e),u=Boolean((0,a.dc)(e)),A=Boolean((0,a.QC)(e)),{width:h,height:p}=l?(0,o.ck)(l,s,t,u,n,r):(0,o.rO)(m,s,t,A,n,r),g=d((0,a.P5)(e));let y=1;h<g&&g-h<i&&(y=g/h),p*y<c&&c-p*y<i&&(y=c/p);const f=Math.round(h*y),v=Math.round(p*y);return{width:f,height:v,isSmall:f<g||v<c}}},67749:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(59589),o=n(82393),i=n(43874),r=n(45470);function s(e,t,n){const{isMobile:s}=(0,i.Ay)(),l=n||(0,a.CI)(e);return(0,r.A)(l,Boolean(t),s&&!o.QH)}},79519:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(84051),o=n(51401),i=n(66644),r=n(81954);const s=500,l=750,c=20;function d(e,t,n,d,m,u,A,h){const p=(0,a.li)(!A);(0,a.Nf)((()=>{const t=p.current;if(p.current=!1,n&&e.current){const n=e.current.closest(".MessageList"),a=m,A=()=>{const t=(0,r.Ay)(n,e.current,a?"end":"centerOrTop",c,void 0!==d?a?s:l:void 0,d,void 0,u,!0);if(h){const t=e.current.querySelector(".is-quote");t&&(0,i.RK)((()=>{(0,o.YM)(t,"animate")}))}return t};t?(0,i.gm)(A):(0,i.YS)((()=>{(0,i.RK)(A())}))}}),[e,t,n,d,m,u,h])}},64154:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(84051),o=n(13439),i=n(37836);const r=new Map;function s(e,t,n,i){const s=i&&n?e?.byLangCode[i]?.[n]:void 0,{isPending:c,text:d}=s||{};return(0,a.vJ)((()=>{t&&n&&!d&&void 0===c&&i&&function(e,t,n){const a=r.get(n)||new Map,i=a.get(e)||[];i.includes(t)||(i.push(t),a.set(e,i),r.set(n,a),(0,o.ko)().markMessagesTranslationPending({chatId:e,messageIds:i,toLanguageCode:n})),l()}(t,n,i)}),[t,d,c,n,i]),t&&n?{isPending:c,translatedText:d}:{isPending:!1,translatedText:void 0}}const l=(0,i.nF)((function(){const{translateMessages:e}=(0,o.ko)();let t=!1;r.forEach(((n,a)=>{n.forEach(((n,o)=>{const i=n.slice(0,20);i.length<n.length&&(t=!0),e({chatId:o,messageIds:i,toLanguageCode:a}),function(e,t,n){const a=r.get(n);if(!a?.size)return void r.delete(n);const o=a.get(e);if(!o?.length)return void a.delete(e);const i=o.filter((e=>!t.includes(e)));if(!i?.length)return a.delete(e),void(a.size||r.delete(n));a.set(e,i)}(o,i,a)}))})),t&&l()}),500)},76283:(e,t,n)=>{n.d(t,{A:()=>N});var a=n(84051),o=n(13439),i=n(59589),r=n(87357),s=n(39351),l=n(17712),c=n(64493),d=n(96530),m=n(76023),u=n(87412),A=n(76785);const h="uGUjDZKl",p="M62HGuIV",g="WMpEr5XQ",y=2*m.$,f=(0,a.ph)((e=>{let{reaction:t,chosen:n,isReady:o,noAppearAnimation:i,style:s,isLocked:l,onToggleReaction:c}=e;return a.Ay.createElement("div",{className:(0,r.A)(h,"oc1hpMwv",n&&p,!i&&o&&"sx6RTuAU",i&&"kqcWe4tf"),style:s,onClick:function(){c(t)}},a.Ay.createElement(u.A,{documentId:t.documentId,size:y}),l&&a.Ay.createElement(A.A,{className:g,name:"lock-badge"}))}));var v=n(37661),E=n(62587),C=n(18104);const b=2*m.$,w=(0,a.ph)((e=>{let{reaction:t,isReady:n,noAppearAnimation:o,chosen:i,isLocked:s,onToggleReaction:l}=e;const c=(0,E.A)(`sticker${t.appearAnimation?.id}`,!n||o),d=(0,E.A)(`document${t.selectAnimation?.id}`,!n||o),m=(0,E.A)(`document${t.staticIcon?.id}`,!o),[u,y]=(0,v.A)(),[f,,w]=(0,v.A)(!0),[S,N,I]=(0,v.A)();return a.Ay.createElement("div",{className:(0,r.A)(h,i&&p),onClick:function(){l(t.reaction)},onMouseEnter:n&&!f?N:void 0},o&&a.Ay.createElement("img",{className:"MZ2tH980",src:m,alt:t.reaction.emoticon,draggable:!1}),!u&&!o&&a.Ay.createElement(C.A,{key:t.appearAnimation?.id,tgsUrl:c,play:f,noLoop:!0,size:b,onEnded:w,forceAlways:!0}),!f&&!o&&a.Ay.createElement(C.A,{key:t.selectAnimation?.id,tgsUrl:d,play:S,noLoop:!0,size:b,onLoad:y,onEnded:I,forceAlways:!0}),s&&a.Ay.createElement(A.A,{className:g,name:"lock-badge"}))})),S=(0,r.x)("ReactionSelector"),N=(0,a.ph)((e=>{let{allAvailableReactions:t,topReactions:n,defaultTagReactions:m,enabledReactions:u,currentReactions:A,maxUniqueReactions:h,isPrivate:p,isReady:g,canPlayAnimatedEmojis:y,className:v,isCurrentUserPremium:E,isInSavedMessages:C,isInStoryViewer:b,onClose:N,onToggleReaction:I,onShowMore:M}=e;const{openPremiumModal:k}=(0,o.ko)(),T=(0,a.li)(null),P=(0,s.A)(),x=C&&!E&&!b,R=(0,a.Kr)((()=>{const e=C?m:"some"===u?.type?u.allowed:t?.map((e=>e.reaction)),a=e?.map((e=>{const n="documentId"in e,a=t?.find((t=>(0,i.a0)(t.reaction,e)));if((n||a)&&!a?.isInactive&&(p||u&&(0,i.A3)(e,u))&&(!(h&&A&&A.length>=h)||A.some((t=>{let{reaction:n}=t;return(0,i.a0)(e,n)}))))return n?e:a})).filter(Boolean)||[];return(0,i.fu)(a,n)}),[t,A,m,u,C,p,h,n]),L=(0,a.Kr)((()=>8===R.length?R:R.slice(0,7)),[R]),B=L.length<R.length,O=(0,a.Kr)((()=>{const e=A?.filter((e=>{let{chosenOrder:t}=e;return void 0!==t}))||[];return new Set(e.map((e=>{let{reaction:t}=e;return L.findIndex((e=>e&&(0,i.a0)("reaction"in e?e.reaction:e,t)))})))}),[A,L]),F=(0,l.A)((()=>{const e=T.current?.getBoundingClientRect()||{x:0,y:0};M({x:e.x,y:e.y})})),D=(0,l.A)((()=>{N?.(),k({initialSection:"saved_tags"})})),U=(0,a.Kr)((()=>{if(C){if(!E){const e=P("lng_subscribe_tag_about").split("{link}");return a.Ay.createElement("span",null,e[0],a.Ay.createElement(d.A,{isPrimary:!0,onClick:D},P("lng_subscribe_tag_link")),e[1])}return P("SavedTagReactionsHint2")}if(b)return P("StoryReactionsHint")}),[E,C,b,P]);if(L.length)return a.Ay.createElement("div",{className:(0,r.A)(S("&",P.isRtl&&"isRtl"),v),ref:T},a.Ay.createElement("div",{className:S("bubble-small",P.isRtl&&"isRtl")}),a.Ay.createElement("div",{className:S("items-wrapper")},a.Ay.createElement("div",{className:S("bubble-big",P.isRtl&&"isRtl")}),a.Ay.createElement("div",{className:S("items")},U&&a.Ay.createElement("div",{className:S("hint")},U),a.Ay.createElement("div",{className:S("reactions"),dir:P.isRtl?"rtl":void 0},L.map(((e,t)=>"reaction"in e?a.Ay.createElement(w,{key:(0,i.Jj)(e.reaction),isReady:g,onToggleReaction:I,reaction:e,noAppearAnimation:!y,chosen:O.has(t),isLocked:x}):a.Ay.createElement(f,{key:(0,i.Jj)(e),isReady:g,onToggleReaction:I,reaction:e,noAppearAnimation:!y,chosen:O.has(t),isLocked:x,style:`--_animation-delay: ${20*(7-t)}ms`}))),B&&a.Ay.createElement(c.A,{color:"translucent",className:S("show-more"),onClick:F},a.Ay.createElement("i",{className:"icon icon-down"}))))))}))},92915:(e,t,n)=>{n.d(t,{A:()=>C});var a=n(84051),o=n(13439),i=n(87357),r=n(76023),s=n(10722),l=n(37661),c=n(39351),d=n(17712),m=n(94803),u=n(23470),A=n(64493),h=n(40664),p=n(8410);const g=(0,a.ph)((e=>{let{isOpen:t,title:n,subtitle:o,placeholder:i,submitText:r,maxLength:s,initialValue:l="",onClose:m,onSubmit:u}=e;const g=(0,c.A)(),[y,f]=(0,a.J0)(l),v=(0,d.A)((e=>{f(e.target.value)})),E=(0,d.A)((()=>{u(y)}));return a.Ay.createElement(p.A,{className:"narrow",title:n,isOpen:t,onClose:m,isSlim:!0},Boolean(o)&&a.Ay.createElement("div",{className:"cGrbcqD_"},o),a.Ay.createElement(h.A,{placeholder:i,value:y,onChange:v,maxLength:s,teactExperimentControlled:!0}),a.Ay.createElement("div",{className:"dialog-buttons mt-2"},a.Ay.createElement(A.A,{className:"confirm-dialog-button",onClick:E},r||g("Save")),a.Ay.createElement(A.A,{className:"confirm-dialog-button",isText:!0,onClick:m},g("Cancel"))))}));var y=n(9168),f=n(24433),v=n(69988);const E=1.25*r.$,C=(0,a.ph)((e=>{let{reaction:t,tag:n,containerId:r,isChosen:h,isOwnMessage:p,className:C,chosenClassName:b,withCount:w,isDisabled:S,withContextMenu:N,observeIntersection:I,onClick:M,onRemove:k}=e;const{editSavedReactionTag:T}=(0,o.ko)(),P=(0,a.li)(null),x=(0,a.li)(null),R=(0,c.A)(),[L,B,O]=(0,l.A)(),{title:F,count:D}=n||{},U=Boolean(F||w&&D),j=(0,d.A)((()=>{M?.(t)})),$=(0,d.A)((()=>{k?.(t)})),K=(0,d.A)((e=>{T({reaction:t,title:e}),O()})),{isContextMenuOpen:_,contextMenuPosition:z,handleBeforeContextMenu:J,handleContextMenu:H,handleContextMenuClose:V,handleContextMenuHide:q}=(0,s.A)(P,!N),G=(0,d.A)((()=>P.current)),W=(0,d.A)((()=>document.body)),Q=(0,d.A)((()=>x.current)),{positionX:Y,positionY:Z,transformOriginX:X,transformOriginY:ee,style:te}=(0,m.A)(z,G,W,Q,(()=>({withPortal:!0,shouldAvoidNegativePosition:!0})));if(!w||0!==D)return a.Ay.createElement(A.A,{className:(0,i.A)(v.A.root,v.A.tag,p&&v.A.own,h&&v.A.chosen,h&&b,S&&v.A.disabled,C),size:"tiny",onClick:j,onMouseDown:J,onContextMenu:H,ref:P},a.Ay.createElement(u.A,{className:v.A.animatedEmoji,containerId:r,reaction:t,loopLimit:1,size:E,observeIntersection:I}),U&&a.Ay.createElement("span",{className:v.A.tagText},F&&a.Ay.createElement("span",null,F),w&&a.Ay.createElement("span",null,D)),a.Ay.createElement("svg",{className:v.A.tail,width:"15",height:"30",viewBox:"0 0 15 30"},a.Ay.createElement("path",{className:v.A.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"})),N&&a.Ay.createElement(g,{isOpen:L,maxLength:15,title:R(n?.title?"SavedTagRenameTag":"SavedTagLabelTag"),subtitle:R("SavedTagLabelTagText"),placeholder:R("SavedTagLabelPlaceholder"),initialValue:n?.title,onClose:O,onSubmit:K}),N&&z&&a.Ay.createElement(y.A,{ref:x,isOpen:_,transformOriginX:X,transformOriginY:ee,positionX:Y,positionY:Z,style:te,autoClose:!0,withPortal:!0,onClose:V,onCloseAnimationEnd:q},a.Ay.createElement(f.A,{icon:"tag-filter",onClick:j},R("SavedTagFilterByTag")),a.Ay.createElement(f.A,{icon:"tag-name",onClick:B},R(n?.title?"SavedTagRenameTag":"SavedTagLabelTag")),a.Ay.createElement(f.A,{icon:"tag-crossed",destructive:!0,onClick:$},R("SavedTagRemoveTag"))))}))},93809:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(30857),i=n(35297);function r(e,t){const n=void 0===t,r=(0,a.li)(n),s=(0,a.li)(),l=(0,o.A)();return(0,i.A)((()=>{n||(r.current=!1,s.current&&(clearTimeout(s.current),s.current=void 0))}),e),(0,a.vJ)((()=>{if(n||r.current)return;const e=()=>{r.current=!0,l()};t>0?s.current=window.setTimeout(e,t):e()}),e),r.current}},71950:(e,t,n)=>{n.d(t,{A:()=>g});var a=n(84051),o=n(87357),i=n(11410),r=n(14242),s=n(39351);const l="gvrp3KoR",c="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"}]],A=[[{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}]],h=[[{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}]],p=[[{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.ph)((e=>{let{title:t,type:n,statistics:g,className:y}=e;const f=(0,s.A)(),{period:v}=g,E=function(e){switch(e){case"group":return u;case"message":return A;case"boost":return p;case"story":return h;default:return m}}(n);return a.Ay.createElement("div",{className:(0,o.A)("Gi8Nokbl",y)},a.Ay.createElement("div",{className:"H01lE7mv"},t&&a.Ay.createElement("div",{className:"VQbs04hT"},t),v&&a.Ay.createElement("div",{className:"X7bBlGdi"},(0,i.Lu)(f,1e3*v.minDate)," — ",(0,i.Lu)(f,1e3*v.maxDate))),a.Ay.createElement("table",{className:"s5beXqqL"},E.map((e=>a.Ay.createElement("tr",null,e.map((e=>{const t=g[e.name];return e.isPlain?a.Ay.createElement("td",{className:l},a.Ay.createElement("b",{className:d},`${e.isApproximate?"≈":""}${(0,r.Sm)(t)}`),a.Ay.createElement("h3",{className:c},f(e.title))):e.isPercentage?a.Ay.createElement("td",{className:l},e.withAbsoluteValue&&a.Ay.createElement("span",{className:d},`${e.isApproximate?"≈":""}${(0,r.Sm)(t.part)}`),a.Ay.createElement("span",{className:e.withAbsoluteValue?"_mYEmh_u":d},t.percentage,"%"),a.Ay.createElement("h3",{className:c},f(e.title))):a.Ay.createElement("td",{className:l},a.Ay.createElement("b",{className:d},(0,r.Vw)(t.current))," ",(e=>{let{change:t,percentage:n}=e;if(!t)return;const i=Number(t)<0;return a.Ay.createElement("span",{className:(0,o.A)("idLrmbhS",i&&"SLfwGHQC")},i?`-${(0,r.Vw)(Math.abs(t))}`:`+${(0,r.Vw)(t)}`,n&&a.Ay.createElement(a.Ay.Fragment,null," ","(",n,"%)"))})(t),a.Ay.createElement("h3",{className:c},f(e.title)))})))))))}))},75343:(e,t,n)=>{n.d(t,{A:()=>C});var a=n(84051),o=n(13439),i=n(87357),r=n(43874),s=n(36838),l=n(39351),c=n(89925),d=n(59589),m=n(54464),u=n(10722),A=n(17712),h=n(94803),p=n(92111),g=n(21849),y=n(9168),f=n(24433),v=n(2429);const E=(0,a.ph)((function(e){let{peer:t,isArchived:n}=e;const{openChat:r,openChatWithInfo:s,openStoryViewer:E,toggleStoriesHidden:C}=(0,o.ko)(),b=(0,l.A)(),w=(0,a.li)(null),S="isSelf"in t&&t.isSelf,N=!(0,d.L8)(t.id);(0,p.A)(t.id);const{isContextMenuOpen:I,contextMenuPosition:M,handleBeforeContextMenu:k,handleContextMenu:T,handleContextMenuClose:P,handleContextMenuHide:x}=(0,u.A)(w),R=(0,A.A)((()=>w.current)),L=(0,A.A)((()=>document.body)),B=(0,A.A)((()=>w.current.querySelector(".story-peer-context-menu .bubble"))),O=(0,A.A)((()=>({withPortal:!0,isDense:!0}))),{positionX:F,positionY:D,transformOriginX:U,transformOriginY:j,style:$}=(0,h.A)(M,R,L,B,O),K=(0,A.A)((()=>{I||E({peerId:t.id,origin:c.G9.StoryRibbon})})),_=(0,A.A)((e=>{(0,m.u)(e),k(e)})),z=(0,A.A)((()=>{s({id:t.id,shouldReplaceHistory:!0,profileTab:"stories"})})),J=(0,A.A)((()=>{s({id:t.id,shouldReplaceHistory:!0,profileTab:"storiesArchive"})})),H=(0,A.A)((()=>{r({id:t.id,shouldReplaceHistory:!0})})),V=(0,A.A)((()=>{s({id:t.id,shouldReplaceHistory:!0})})),q=(0,A.A)((()=>{C({peerId:t.id,isHidden:!n})}));return a.Ay.createElement("div",{ref:w,role:"button","data-peer-id":t.id,tabIndex:0,className:v.A.peer,onMouseDown:_,onClick:K,onContextMenu:T},a.Ay.createElement(g.A,{peer:t,withStory:!0,storyViewerOrigin:c.G9.StoryRibbon,storyViewerMode:"full"}),a.Ay.createElement("div",{className:(0,i.A)(v.A.name,t.hasUnreadStories&&v.A.name_hasUnreadStory)},S?b("MyStory"):(0,d.qg)(b,t)),void 0!==M&&a.Ay.createElement(y.A,{isOpen:I,transformOriginX:U,transformOriginY:j,positionX:F,positionY:D,style:$,className:(0,i.A)("story-peer-context-menu",v.A.contextMenu),autoClose:!0,withPortal:!0,onClose:P,onCloseAnimationEnd:x},S?a.Ay.createElement(a.Ay.Fragment,null,a.Ay.createElement(f.A,{onClick:z,icon:"play-story"},b("StoryList.Context.SavedStories")),a.Ay.createElement(f.A,{onClick:J,icon:"archive"},b("StoryList.Context.ArchivedStories"))):a.Ay.createElement(a.Ay.Fragment,null,!N&&a.Ay.createElement(f.A,{onClick:H,icon:"message"},b("SendMessageTitle")),N?a.Ay.createElement(f.A,{onClick:V,icon:"channel"},b("ChatList.ContextOpenChannel")):a.Ay.createElement(f.A,{onClick:V,icon:"user"},b("StoryList.Context.ViewProfile")),a.Ay.createElement(f.A,{onClick:q,icon:n?"unarchive":"archive"},b(n?"StoryList.Context.Unarchive":"StoryList.Context.Archive")))))})),C=(0,a.ph)((0,o.EK)(((e,t)=>{let{isArchived:n}=t;const{orderedPeerIds:{active:a,archived:o}}=e.stories;return{orderedPeerIds:n?o:a,usersById:e.users.byId,chatsById:e.chats.byId}}))((function(e){let{isArchived:t,className:n,orderedPeerIds:o,usersById:c,chatsById:d,isClosing:m}=e;const u=(0,l.A)(),A=(0,i.A)(v.A.root,!o.length&&v.A.hidden,m&&v.A.closing,n,"no-scrollbar"),h=(0,a.li)(null);return(0,s.A)(h,(0,r.Ny)()),a.Ay.createElement("div",{ref:h,id:"StoryRibbon",className:A,dir:u.isRtl?"rtl":void 0},o.map((e=>{const n=c[e]||d[e];if(n)return a.Ay.createElement(E,{key:e,peer:n,isArchived:t})})))})))},40175:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(84051),o=n(13439),i=n(31481),r=n(67321),s=n(87357),l=n(34458),c=n(32706),d=n(39351),m=n(34201),u=n(92111),A=n(21849),h=n(17169);const p=(0,a.ph)((0,o.EK)(((e,t)=>{let{isArchived:n}=t;const{orderedPeerIds:{archived:a,active:o},byPeerId:i}=e.stories,{storyViewer:{isRibbonShown:s,isArchivedRibbonShown:l}}=(0,r.nTw)(e),c=(0,r.clw)(e),d=(0,r.xYJ)(e,"storyRibbonAnimations");return{currentUserId:e.currentUserId,orderedPeerIds:n?a:o,isShown:n?!l:!s,isForumPanelOpen:c,withAnimation:d,usersById:e.users.byId,chatsById:e.chats.byId,peerStories:i}}))((function(e){let{currentUserId:t,orderedPeerIds:n,usersById:r,chatsById:p,canShow:g,isShown:y,isForumPanelOpen:f,isArchived:v,withAnimation:E,peerStories:C}=e;const{toggleStoryRibbon:b}=(0,o.ko)(),w=(0,d.A)(),S=(0,a.Kr)((()=>1===n.length?[r[n[0]]||p[n[0]]]:n.map((e=>r[e]||p[e])).filter((e=>e&&e.id!==t)).slice(0,i.dqH).reverse()),[t,n,r,p]),N=(0,a.Kr)((()=>S?.length?S.reduce(((e,t)=>{const n=C[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}),{}):{}),[C,S]),I=(0,a.Kr)((()=>n.slice(0,5)),[n]);(0,u.A)(I);const M=g&&y,{shouldRender:k,transitionClassNames:T}=(0,m.A)(M,void 0,void 0,"slow");if((0,a.vJ)((()=>{E&&!f&&(M?((0,c.UH)(l.UG+i.xB5),(0,l.$)(v)):((0,c.UH)(l.UG+i.xB5),(0,l.wV)(v)))}),[v,M,E,f]),k)return a.Ay.createElement("button",{type:"button",id:"StoryToggler",className:(0,s.A)(h.A.root,T),"aria-label":w("Chat.Context.Peer.OpenStory"),onClick:()=>b({isShown:!0,isArchived:v}),dir:w.isRtl?"rtl":void 0},S.map((e=>a.Ay.createElement(A.A,{key:e.id,peer:e,size:"tiny",className:h.A.avatar,withStorySolid:!0,forceFriendStorySolid:N[e.id]}))))})))},34458:(e,t,n)=>{n.d(t,{$:()=>y,UG:()=>d,wV:()=>g});var a=n(31481),o=n(66644),i=n(19822),r=n(83868),s=n(76023),l=n(2429),c=n(17169);const d=250,m=.25*s.$,u=11,A=.1875*s.$,h=.125*s.$,p=new Set;function g(e){w();const{container:t,toggler:n,leftMainHeader:r,ribbonPeers:s,toggleAvatars:l}=f(e);if(!(n&&l&&s&&t&&r))return;const{bottom:h,right:g}=r.getBoundingClientRect(),y=h+m,S=l[0],N=l[l.length-1],I=E(S);Array.from(s).reverse().forEach(((e,r,s)=>{let{length:l}=s;const m=E(e);if(!m)return;const h=m===I;let f=C(n,m),w=u+r+1;if(f||(f=r===l-1?N:S,w=u),!f)return;let{top:M,left:k,width:T}=f.getBoundingClientRect();const{left:P,width:x}=e.getBoundingClientRect();if(P>g)return;k-=A,T+=2*A;const R=k-P,L=M-y,B=T/x;M-=A;const O=P-k+2*A,F=y-M+A,D=x/(T+2*A);(0,o.RK)((()=>{if(!f)return;const n=v(e);let r;w>u?(r=v(f),h&&r.classList.add(c.A.ghostLast)):n.classList.add(c.A.ghostAnimateName),(0,i.ZM)(n,{top:`${y}px`,left:`${P}px`,zIndex:`${w}`,opacity:r?"0":"",transform:`translate3d(${R}px, ${L}px, 0) scale(${B})`}),r&&(0,i.ZM)(r,{top:`${M}px`,left:`${k}px`,zIndex:`${w}`}),t.appendChild(n),r&&t.appendChild(r),f.classList.add("animating"),e.classList.add("animating"),(0,o.RK)((()=>{(0,i.ZM)(n,{opacity:"",transform:""}),r?(0,i.ZM)(r,{opacity:"0",transform:`translate3d(${O}px, ${F}px, 0) scale(${D})`}):n.classList.add(c.A.ghostRevealName);const s=b((()=>{(0,o.RK)((()=>{t.contains(n)&&t.removeChild(n),r&&t.contains(r)&&t.removeChild(r),f?.classList.remove("animating"),e.classList.remove("animating")}))}),d+a.xB5);p.add(s)}))}))}))}function y(e){w();const{container:t,toggler:n,toggleAvatars:r,ribbonPeers:s,leftMainHeader:l}=f(e);if(!(n&&r&&s&&t&&l))return;const{right:m}=l.getBoundingClientRect(),g=r[0],y=r[r.length-1],S=E(g);Array.from(s).reverse().forEach(((e,r,s)=>{let{length:l}=s;const f=E(e);if(!f)return;const w=f===S;let N=C(n,f),I=u+r+1;if(N||(N=r===l-1?y:g,I=u),!N)return;const{top:M,left:k,width:T}=e.getBoundingClientRect();let{left:P,width:x,top:R}=N.getBoundingClientRect();if(k>m)return;P-=A,x+=2*A;const L=P-k,B=R-M-h,O=x/T;R-=A;const F=k-P+2*A,D=M-R+A,U=T/(x+2*A);(0,o.RK)((()=>{const n=v(e);let r;I>u?(r=v(N),w&&r.classList.add(c.A.ghostLast)):n.classList.add(c.A.ghostAnimateName,c.A.ghostRevealName),(0,i.ZM)(n,{top:`${M}px`,left:`${k}px`,width:`${T}px`,zIndex:`${I}`}),r&&(0,i.ZM)(r,{top:`${R}px`,left:`${P}px`,zIndex:`${I}`,opacity:"0",transform:`translate3d(${F}px, ${D}px, 0) scale(${U})`}),e.classList.add("animating"),N.classList.add("animating"),t.appendChild(n),r&&t.appendChild(r),(0,o.RK)((()=>{(0,i.ZM)(n,{opacity:r?"0":"",transform:`translate3d(${L}px, ${B}px, 0) scale(${O})`}),r?(0,i.ZM)(r,{opacity:"",transform:""}):n.classList.remove(c.A.ghostRevealName);const s=b((()=>{(0,o.RK)((()=>{t.contains(n)&&t.removeChild(n),r&&t.contains(r)&&t.removeChild(r),e.classList.remove("animating"),N.classList.remove("animating")}))}),d+a.xB5);p.add(s)}))}))}))}function f(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"),i=a?.querySelectorAll(`.${l.A.peer}`),r=n?.querySelectorAll(".Avatar");return{container:t,toggler:n,leftMainHeader:o,ribbonPeers:i,toggleAvatars:r}}function v(e){const t=e.cloneNode(!0);t.classList.add(c.A.ghost),t.classList.remove("animating"),t.draggable=!1,t.oncontextmenu=r.A;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 C(e,t){return e?.querySelector(`[data-peer-id="${t}"]`)}function b(e,t){const n=setTimeout(e,t);return()=>{clearTimeout(n),e()}}function w(){p.forEach((e=>e())),p.clear()}},46051:(e,t,n)=>{n.d(t,{G:()=>a,w:()=>o});const a="video/mp4; codecs=hvc1.1.6.L63.00",o="video/mp4; codecs=avc1.64001E"},92111:(e,t,n)=>{n.d(t,{A:()=>y});var a=n(84051),o=n(13439),i=n(97335),r=n(59589),s=n(67321),l=n(39761),c=n(87679),d=n(58554),m=n(20897),u=n(37836),A=n(46051),h=n(66991);const p={},g=(0,u.v7)(1e3),y=function(e,t){(0,a.vJ)((()=>{if(void 0===e)return;(Array.isArray(e)?e:[e]).forEach((e=>{const n=t||(0,o.mS)().stories.byPeerId[e]?.orderedIds?.[0];n&&(async e=>{await g,e.forEach((e=>{let{hash:t,format:n,isStream:a}=e;a?async function(e){const t=(0,m.h)((0,d.RB)(e));let n=0;for await(const e of t)if(n+=e.byteLength,n>=2097152)break}(t):d.hd(t,n).then((e=>{e&&(n===i.qZ.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,l.A)(n),t.removeChild(n)}),1e3)}(e),n===i.qZ.BlobUrl&&(0,c.NN)(e))}))}))})(function(e,t){const n=(0,s._bp)((0,o.mS)(),e);if(!n||!n.orderedIds?.length)return[];const a=function(e,t,n){const a=e.indexOf(t),o=Math.max(a-5,0),i=Math.min(a+5,e.length);return e.slice(o,i)}(n.orderedIds,t),l=[];return a.forEach((t=>{if(p[e]?.has(t))return;const a=n.byId[t];if(!a||!("content"in a))return;const o=Boolean(a.content.video);l.push({hash:(0,r.EN)(a,"full"),format:o?i.qZ.Progressive:i.qZ.BlobUrl,isStream:o&&(0,h.c)(A.G)}),l.push({hash:(0,r.EN)(a),format:i.qZ.BlobUrl}),a.content.altVideo&&l.push({hash:(0,r.EN)(a,"full",!0),format:i.qZ.Progressive}),p[e]=(p[e]||new Set).add(t)})),l}(e,n))}))}),[t,e])}},83429:(e,t,n)=>{n.d(t,{A:()=>E});var a=n(84051),o=n(13439),i=n(31481),r=n(66644),s=n(87357),l=n(95807),c=n(39751),d=n(59589),m=n(76023),u=n(82117),A=n(17712),h=n(93545),p=n(23470);const g="pruw1nLm",y=(0,a.ph)((e=>{let{story:t,mediaArea:n,index:i,className:r,style:c,isPreview:g}=e;const{sendStoryReaction:y}=(0,o.ko)(),f=(0,a.li)(null),[v,E]=(0,a.J0)(1.5*m.$),{peerId:C,id:b,views:w}=t,{reactions:S}=w||{},{reaction:N,isDark:I,isFlipped:M}=n,k=!(0,d.L8)(C),T=`${(0,d.$_)(C,b)}-${i}-${g?"preview":"viewer"}`,P=(0,a.Kr)((()=>S?.find((e=>(0,d.a0)(e.reaction,N)))?.count),[N,S]),x=!g&&Boolean(P)&&k,R=(0,A.A)((()=>{if(!f.current)return;const e=f.current.clientHeight;E(Math.round(.6*e))}));(0,u.A)((e=>{let[t]=e;Boolean(P)!==Boolean(t)&&R()}),[P]),(0,h.A)(f,R);const L=(0,A.A)((()=>{y({peerId:C,storyId:b,containerId:T,reaction:N})}));return a.Ay.createElement("div",{ref:f,className:(0,s.A)("WQ5DA3P_",I&&"eic2vQ8c",r),style:(0,l.A)(c,`--custom-emoji-size: ${v}px`),onClick:L},a.Ay.createElement("div",{className:(0,s.A)("j4MKFabm",M&&"furSXGdL")}),Boolean(v)&&a.Ay.createElement(p.A,{className:(0,s.A)("Et3MvYmN",x&&"mFTLUHm2"),reaction:N,containerId:T,size:v,effectSize:4*v,shouldPause:g,shouldLoop:!g}),x&&a.Ay.createElement("span",{className:"Tr8mYyDk"},P))})),f=9/16;function v(e){const{x:t,y:n,width:a,height:o,rotation:i}=e.coordinates;return(0,l.A)(`left: ${t}%`,`top: ${n}%`,`width: ${a}%`,`height: ${o}%`,`transform: rotate(${i}deg) translate(-50%, -50%)`)}const E=(0,a.ph)((e=>{let{story:t,isActive:n,className:l}=e;const{openMapModal:d,focusMessage:m,closeStoryViewer:u}=(0,o.ko)(),A=(0,a.li)(null),h=(0,c.A)();(0,a.vJ)((()=>{if(!A.current||!n)return;const e=A.current;if(h.width>i.c2m)return void(0,r.RK)((()=>{e.style.removeProperty("--media-width"),e.style.removeProperty("--media-height")}));const t=h.width/h.height,a=t<f?e.clientHeight*f:e.clientWidth,o=t<f?e.clientHeight:e.clientWidth/f;(0,r.RK)((()=>{e.style.setProperty("--media-width",`${a}px`),e.style.setProperty("--media-height",`${o}px`)}))}),[n,h]);const p=t.mediaAreas;return a.Ay.createElement("div",{className:(0,s.A)("RXAMu4VD",!n&&"_5HkplWee",l),ref:A},p?.map(((e,o)=>{switch(e.type){case"geoPoint":case"venue":case"channelPost":{const t=n&&("geoPoint"===e.type||"venue"===e.type);return a.Ay.createElement("div",{className:(0,s.A)(g,t&&"xFjJpeOA"),style:v(e),onClick:()=>(e=>{switch(e.type){case"geoPoint":case"venue":d({geoPoint:e.geo});break;case"channelPost":m({chatId:e.channelId,messageId:e.messageId}),u()}})(e)})}case"suggestedReaction":return a.Ay.createElement(y,{key:`${e.type}-${o}`,story:t,mediaArea:e,index:o,isPreview:!n,className:g,style:v(e)});default:return}})))}))},84313:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(84051),o=n(13439),i=n(82393),r=n(39351),s=n(17712);const l=8e3;function c(e,t,n){const{showNotification:c}=(0,o.ko)(),d=(0,r.A)(),[m,u]=(0,a.J0)(!1),A=(0,s.A)((()=>{u(!0),t||c({message:i.yS?d("Video.Unsupported.Mobile"):d("Video.Unsupported.Desktop"),duration:l})})),h=(0,s.A)((e=>{const t=e.currentTarget,{error:n}=t;n&&(3!==n.code&&4!==n.code||A())})),p=(0,s.A)((e=>{const t=e.currentTarget;t.videoHeight&&t.videoWidth||A()}));return(0,a.vJ)((()=>{if(n)return;const{current:t}=e;return t?(t.addEventListener("error",h),t.addEventListener("canplay",p),()=>{t.removeEventListener("error",h),t.removeEventListener("canplay",p)}):void 0}),[n,e]),m}},23459:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(84051),o=n(13439),i=n(59589),r=n(67321),s=n(37836);const l=36e5,c=new Map;let d=new Set;const m=(0,s.nF)((()=>{const e=Array.from(d),t=e.slice(0,100),n=e.slice(101);(0,o.ko)().loadStoriesMaxIds({peerIds:t}),t.forEach((e=>c.set(e,Date.now()))),d=new Set(n),d.size&&m()}),500);function u(e){const t=(0,a.Kr)((()=>{const t=(0,o.mS)();return e?.map((e=>(0,r.PVB)(t,e))).filter(Boolean)}),[e]),n=(0,a.Kr)((()=>{const e=(0,o.mS)();return t?.filter((t=>{const n=c.get(t.id)||0;if(Date.now()-n<l)return!1;if((0,i.L8)(t.id)){const n=t,a=(0,r.K0y)(e,n.id),o=a&&"userStatusEmpty"!==a.type;return!n.isContact&&!n.isSelf&&!(0,i.tv)(n)&&!t.isSupport&&o}{const e=t;return(0,i.WX)(e)&&!e.isRestricted}})).map((e=>e.id))}),[t]);(0,a.vJ)((()=>{n?.length&&(n.forEach((e=>d.add(e))),m())}),[n])}},31880:(e,t,n)=>{n.d(t,{Ay:()=>A,_E:()=>r,a9:()=>c,ci:()=>i});var a=n(87894),o=n(42215);const i=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],r=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],s=["includedChatIds","bots","channels","groups","contacts","nonContacts"],l=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function c(e,t,n){let o=[],i=[];if("included"===t){const{includedChatIds:t,...r}=n?e.includeFilters||{}:(0,a.Up)(e.folder,s);o=t||[],i=Object.keys(r).filter((e=>Boolean(r[e])))}else{const{excludedChatIds:t,...r}=n?e.excludeFilters||{}:(0,a.Up)(e.folder,l);o=t||[],i=Object.keys(r).filter((e=>Boolean(r[e])))}return{selectedChatIds:o,selectedChatTypes:i}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||t?.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const 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.Up)(e.folder,s)};case"editExcludeFilters":return{...e,excludeFilters:(0,a.Up)(e.folder,l)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,a.cJ)(e.folder,s),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,a.cJ)(e.folder,l),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...a}=t.payload;return{mode:"edit",folderId:e,folder:a,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"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}},A=()=>(0,o.A)(u,m)},14737:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(84051),o=n(17712);const i=function(e,t){const n=(0,o.A)(e);(0,a.vJ)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>n()),t);return()=>clearTimeout(e)}),[t])}},63988:(e,t,n)=>{n.d(t,{D7:()=>c,aG:()=>s,gs:()=>r,tF:()=>l});var a=n(16581),o=n(83414),i=n(672);function r(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,i.A)((t=>{t(e())}),t,n,a)}function s(e,t){const n=r((()=>e()),[e],t,arguments.length>2&&void 0!==arguments[2]&&arguments[2]);return(0,o.A)(n,[n,e],!0)}function l(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return(0,a.A)((t=>{t(e())}),t,n,o,i)}function c(e,t){const n=l((()=>e()),[e],t,arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]&&arguments[3]);return(0,o.A)(n,[n,e],!0)}},88792:(e,t,n)=>{n.d(t,{A:()=>A});var a=n(84051),o=n(13439),i=n(31481),r=n(67321),s=n(53827),l=n(49642),c=n(80853),d=n(82117),m=n(17712),u=n(35297);const A=function(e,t,n,A,h,p,g){let y=arguments.length>7&&void 0!==arguments[7]&&arguments[7],f=arguments.length>8?arguments[8]:void 0,v=arguments.length>9?arguments[9]:void 0,E=arguments.length>10&&void 0!==arguments[10]&&arguments[10],C=arguments.length>11&&void 0!==arguments[11]&&arguments[11],b=arguments.length>12?arguments[12]:void 0,w=arguments.length>13&&void 0!==arguments[13]&&arguments[13],S=arguments.length>14&&void 0!==arguments[14]&&arguments[14];const N=(0,a.li)(null),[I,M]=(0,a.J0)(!1);let k=I;const[T,P]=(0,a.J0)(0),x=(0,m.A)((()=>{M(!1),v&&v()}));(0,u.A)((()=>{if(!e)return;N.current=(0,s.kz)(e,n,((e,a)=>{if(!S){switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:a,toggleMuted:s,proxy:c}=N.current;M(!0),"oneTimeVoice"!==n&&(0,l.MV)(p,function(e){let t={};if(e&&e.current){const{play:n,pause:a,setCurrentTime:i,proxy:r,requestNextTrack:s,requestPreviousTrack:l,isFirst:c,isLast:d}=e.current;t={play:()=>{n(r.src)},pause:()=>{a()},stop:()=>{a(),i(0),(0,o.ko)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;i(Math.max(r.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;i(Math.min(r.currentTime+t,r.duration))},seekTo:e=>{e.seekTime&&i(e.seekTime)}},d()||(t.nexttrack=()=>{s()}),c()||(t.previoustrack=()=>{l()})}return t}(N)),(0,l.HW)("playing");const{audioPlayer:d}=(0,r.nTw)((0,o.mS)());e(d.volume),s(Boolean(d.isMuted));const m=c.duration&&Number.isFinite(c.duration)?c.duration:t;("voice"===n||m>i.CVm)&&a(d.playbackRate),(0,l.hm)({duration:c.duration||0,playbackRate:c.playbackRate,position:c.currentTime});break}case"onRateChange":{const{proxy:e}=N.current;(0,l.hm)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":M(!1),(0,l.HW)("paused"),b?.();break;case"onTimeUpdate":{const{proxy:e}=N.current;if(w&&0===e.currentTime)break;const n=e.duration&&Number.isFinite(e.duration)?e.duration:t;C||P(e.currentTime/n);break}case"onEnded":(0,l.HW)("paused")}h?.[e]?.(a)}}),f,x);const{proxy:a}=N.current;I||a.paused||(M(!0),k=!0),g&&!S&&g(a)}),[e]),(0,a.vJ)((()=>{I&&p&&(0,l.D5)(p)}),[p,I]);const{play:R,pause:L,setCurrentTime:B,proxy:O,destroy:F,setVolume:D,stop:U,isFirst:j,isLast:$,requestNextTrack:K,requestPreviousTrack:_,setPlaybackRate:z,toggleMuted:J}=N.current??{},H=(0,a.Kr)((()=>O?.duration&&Number.isFinite(O.duration)?O.duration:t),[O?.duration,t]);(0,a.vJ)((()=>{O&&(w&&0===O.currentTime||!H||(0,c.f)(O)||C||P(O.currentTime/H))}),[H,T,O,C,w]),(0,a.vJ)((()=>()=>{F?.(E)}),[F,E]),(0,d.A)((e=>{let[t,n]=e;t===y&&A===n||O?.src&&O?.paused||y&&A&&!I&&R?.(A)}),[y,A,I,R,O?.src,O?.paused,n]);const V=(0,m.A)((()=>{A&&R?.(A)})),q=(0,m.A)((()=>{I?L?.():V()})),G=(0,m.A)((e=>{B?.(e),H&&O&&P(O.currentTime/H)}));return{isPlaying:k,playProgress:T,playPause:q,pause:L,play:V,stop:U,setCurrentTime:G,setVolume:D,audioProxy:O,duration:H,requestNextTrack:K,requestPreviousTrack:_,isFirst:j,isLast:$,setPlaybackRate:z,toggleMuted:J}}},45470:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(84051),o=n(32610),i=n(66644),r=n(82393),s=n(35297);const l=2,c=2;function d(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l,m=arguments.length>4?arguments[4]:void 0,u=arguments.length>5?arguments[5]:void 0;const A=(0,a.li)(null),h=(0,a.li)();return(0,s.A)((()=>{t||(h.current=!1)}),[e,t]),(0,a.vJ)((()=>{const a=A.current;if(!e||!a||t||h.current)return;h.current=!0;const s=new Image,l=()=>{const e=m||s.width,t=u||s.height,n=a.getContext("2d",{alpha:!1});(0,i.RK)((()=>{a.width=e,a.height=t,r.QH&&(n.filter=`blur(${d}px)`),n.drawImage(s,2*-d,2*-d,e+4*d,t+4*d),r.QH||(0,o.A)(n,0,0,e,t,d,c)}))};s.onload=()=>{n?(0,i.YS)(l):l()},s.src=e}),[e,t,u,m,d,n]),A}},47067:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(84051),o=n(13439),i=n(31481),r=n(59589),s=n(87894),l=n(82393),c=n(39351);const d=function(e){let{chat:t,user:n,folderId:d,isPinned:m,isMuted:u,canChangeFolder:A,isSavedDialog:h,currentUserId:p,isPreview:g,handleDelete:y,handleMute:f,handleChatFolderChange:v,handleReport:E}=e,C=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const b=(0,c.A)(),{isSelf:w}=n||{},S=n?.id===i.zv8,N=(0,a.Kr)((()=>{if(t)return h?b("Delete"):(0,r.L8)(t.id)?b("DeleteChatUser"):(0,r.IC)(t)?b("DeleteChat"):(0,r.WX)(t)?b("LeaveChannel"):b("Group.LeaveGroup")}),[t,h,b]);return(0,a.Kr)((()=>{if(!t||g)return;const{toggleChatPinned:e,toggleSavedDialogPinned:a,updateChatMutedState:i,toggleChatArchived:c,toggleChatUnread:I,openChatInNewTab:M}=(0,o.ko)(),k=l.OS&&{title:l.cp?"Open in new window":"Open in new tab",icon:"open-in-new-tab",handler:()=>{M(h?{chatId:p,threadId:t.id}:{chatId:t.id})}},T=()=>{h?a({id:t.id}):e({id:t.id,folderId:d})},P=m?{title:b("UnpinFromTop"),icon:"unpin",handler:T}:{title:b("PinToTop"),icon:"pin",handler:T},x={title:N,icon:"delete",destructive:!0,handler:y};if(h)return(0,s.oE)([k,P,x]);const R=A?{title:b("ChatList.Filter.AddToFolder"),icon:"folder",handler:v}:void 0,L=u?{title:b("ChatList.Unmute"),icon:"unmute",handler:()=>i({chatId:t.id,isMuted:!1})}:{title:`${b("ChatList.Mute")}...`,icon:"mute",handler:f};if(C)return(0,s.oE)([k,P,R,L]);const B=t.unreadCount||t.hasUnreadMark?{title:b("MarkAsRead"),icon:"readchats",handler:()=>I({id:t.id})}:void 0,O=t.unreadCount||t.hasUnreadMark||t.isForum?void 0:{title:b("MarkAsUnread"),icon:"unread",handler:()=>I({id:t.id})},F=(0,r.TJ)(t)?{title:b("Unarchive"),icon:"unarchive",handler:()=>c({id:t.id})}:{title:b("Archive"),icon:"archive",handler:()=>c({id:t.id})},D=E&&((0,r.WX)(t)||(0,r.YE)(t)||n&&!n.isSelf)?{title:b("ReportPeer.Report"),icon:"flag",handler:E}:void 0,U=void 0!==d;return(0,s.oE)([k,R,B,O,P,!w&&L,!w&&!S&&!U&&F,D,x])}),[t,n,A,b,v,m,C,u,p,y,f,E,d,w,S,h,N,g])}},83414:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(56331),o=n(5718),i=n(41257),r=n(35297);const s=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=t?e:()=>e;t??(t=[e]);const[l,c]=(0,a.A)(),d=(0,i.i)(s);function m(){const e=d.current;n?e(c):c(e())}return(0,r.A)(m,t),(0,o.R)(m,t),l}},49746:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(84051),o=n(13439);function i(e,t,n,i,r){const{loadMessage:s}=(0,o.ko)();(0,a.vJ)((()=>{r||t&&!n&&s({chatId:e,messageId:t,replyOriginForId:i})}),[r,e,n,t,i])}},21488:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(13439),i=n(37836);const r=function(e,t,n){const{loadPeerStoriesByIds:r}=(0,o.ko)(),s=(0,a.Kr)((()=>{const n=(0,i.nF)(r,200,!0);return()=>{n({peerId:e,storyIds:[t]})}}),[t,e]);(0,a.vJ)((()=>{e&&t&&(!n||!("content"in n)&&!("isDeleted"in n))&&s()}),[s,n,t,e])}},74984:(e,t,n)=>{n.d(t,{Rh:()=>r,g5:()=>l,ic:()=>s});var a=n(84051),o=n(49763),i=n(30857);function r(e){const t=(0,i.A)();return(0,a.vJ)((()=>(0,o.Yw)(e,t)),[e,t]),(0,o.YA)(e)}function s(){const e=(0,i.A)();return(0,a.vJ)((()=>(0,o.P1)(e)),[e]),(0,o.PZ)()}function l(){const e=(0,i.A)();return(0,a.vJ)((()=>(0,o.BU)(e)),[e]),(0,o.jn)()}},11462:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(84051),o=n(30857),i=n(17712),r=n(35297);function s(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,a.li)(e),n=(0,a.li)(!1),s=(0,o.A)();(0,r.A)((()=>{e&&(t.current=!0)}),[e]);const l=(0,i.A)((()=>{t.current=!1,n.current=!1,s()})),c=(0,i.A)((()=>{n.current=!0,s()}));return{shouldRenderForumPanel:t.current,isAnimationStarted:n.current,handleForumPanelAnimationEnd:l,handleForumPanelAnimationStart:c}}},41316:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(84051),o=n(56331);function i(e){const[t,n]=(0,o.A)();return(0,a.vJ)((()=>{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}},36838:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(84051);const o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,a.vJ)((()=>{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])}},2178:(e,t,n)=>{n.d(t,{v:()=>s});var a=n(84051),o=n(46536);const i=new Set(["INPUT","TEXTAREA","SELECT"]),r=(0,o.h)();function s(e){(0,a.vJ)((()=>{if(!e)return;const t=Object.entries(e);return r.addCallback((function(e){(function(e){return!(e.target instanceof HTMLElement)||!i.has(e.target.tagName)})(e)&&t.forEach((t=>{let[n,a]=t;(function(e){return t=>function(e,t){const{alt:n,ctrl:a,meta:o,mod:i,shift:r,key:s}=e,{altKey:l,ctrlKey:c,metaKey:d,shiftKey:m,key:u}=t;if(n!==l)return!1;if(i){if(!c&&!d)return!1}else{if(a!==c)return!1;if(o!==d)return!1}return r===m&&Boolean(s&&(u.toLowerCase()===s.toLowerCase()||t.code.replace("Key","").toLowerCase()===s.toLowerCase()))}(function(e){const t=e.toLowerCase().split("+").map((e=>e.trim())),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift")},a=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find((e=>!a.includes(e)))}}(e),t)})(n)(e)&&a(e)}))}))}),[e])}document.documentElement.addEventListener("keydown",r.runCallbacks)},79174:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(84051),o=n(66644),i=n(43874);const r=500,s=300;function l(e,t,n){const{isMobile:l}=(0,i.Ay)();(0,a.vJ)((()=>{t?l||setTimeout((()=>{(0,o.RK)((()=>{e.current?.isConnected&&e.current.focus()}))}),r):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,s))}),[e,l,t,n])}},91800:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(84051),o=n(97335),i=n(67321),r=n(58554),s=n(37836),l=n(82393),c=n(30857),d=n(30414),m=n(14745);const u=.75,A=1500,h=500;function p(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.qZ.BlobUrl,p=arguments.length>3?arguments[3]:void 0,g=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const y=e?r.Ih(e):void 0,f=l.Uz&&n===o.qZ.Progressive,v=(0,c.A)(),E=(0,d.A)(i.nIz),C=(0,m.A)(),[b,w]=(0,a.J0)(y&&!f?1:0),S=(0,a.li)(),N=(0,a.Kr)((()=>(0,s.nF)((e=>{S.current&&(!p||Date.now()-S.current>p)&&w(e)}),h,!0)),[p]);return(0,a.vJ)((()=>{!t&&e&&(y?f&&setTimeout((()=>{w(u)}),A):(w(0),S.current&&r.ch(N),S.current=Date.now(),r.hd(e,n,g,N,C).then((()=>{const e=Date.now()-S.current;S.current=void 0,!p||e>=p?v():setTimeout(v,p-e)}))))}),[t,e,y,n,f,p,N,g,C,E]),(0,a.vJ)((()=>{t&&S.current&&(r.ch(N),w(0),S.current=void 0)}),[N,t]),(0,a.vJ)((()=>()=>{e&&r.Cn(e,C)}),[C,e]),{mediaData:y,loadProgress:b}}},36680:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(84051),o=n(82393),i=n(17712);const r=250;let s;function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const c=(0,a.li)(!1),d=(0,i.A)((()=>{c.current=!0}));return(0,a.vJ)((()=>{s&&(clearTimeout(s),s=void 0),!e||o.TF||l||(s=window.setTimeout((()=>{c.current||t()}),2*n))}),[l,e,n,t]),[(0,i.A)((()=>{c.current=!0})),(0,i.A)((()=>{c.current=!1,s&&(clearTimeout(s),s=void 0),s=window.setTimeout((()=>{c.current||t()}),n)})),d]}},23565:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(84051),o=n(30857),i=n(29886),r=n(35297);function s(e,t){const n=(0,i.A)(e,!0),s=(0,a.li)(),l=(0,o.A)(),c=null!=e,d=null!=n;return c&&s.current&&(clearTimeout(s.current),s.current=void 0),(0,r.A)((()=>{t&&!c&&d&&!s.current&&(s.current=window.setTimeout((()=>{s.current=void 0,l()}),t))}),[t,l,c,d]),s.current&&t&&!c?n:e}},42215:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(84051),o=n(30857);function i(e,t){const n=(0,o.A)(),i=(0,a.li)(e),r=(0,a.li)(t),s=(0,a.hb)((e=>(r.current=i.current(r.current,e),n(),r.current)),[]);return[r.current,s]}},56133:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(16581);function o(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,a.A)((e=>{e()}),o,e,t,n)}},24531:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(84051),o=n(31481),i=n(11410),r=n(80140),s=n(39351),l=n(17712),c=n(80089),d=n(80464);const m=e=>{const{isOpen:t}=e,n=(0,d.A)(c.ar.Extra,"CalendarModal",!t);return n?a.Ay.createElement(n,e):void 0},u=(e,t,n)=>{const c=(0,s.A)(),[d,u]=(0,a.J0)(),A=(0,l.A)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:(0,r.SF)());d?.(n),u(void 0)})),h=(0,l.A)((()=>{A(new Date(1e3*o.NkL),!0)})),p=(0,l.A)((()=>{u(void 0),t?.()})),g=(0,l.A)((e=>{u((()=>e))})),y=n?new Date(1e3*n):new Date;y.setSeconds(0),y.setMilliseconds(0);const f=new Date;return f.setFullYear(f.getFullYear()+1),[g,a.Ay.createElement(m,{isOpen:Boolean(d),withTimePicker:!0,selectedAt:y.getTime(),maxAt:(0,i.CS)(f),isFutureMode:!0,secondButtonLabel:e?c("Schedule.SendWhenOnline"):void 0,onClose:p,onSubmit:A,onSecondButtonClick:e?h:void 0})]}},73172:(e,t,n)=>{n.d(t,{A:()=>s});var a=n(84051),o=n(13439),i=n(31481),r=n(37836);const s=(e,t)=>(0,a.Kr)((()=>(0,r.nF)((n=>{e&&t&&(0,o.ko)().sendMessageAction({chatId:e,threadId:t,action:n})}),i.cqp)),[e,t])},56331:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(84051),o=n(22237);function i(e){const t=(0,a.li)();return t.current??(t.current=(0,o.n5)(e)),t.current}},66991:(e,t,n)=>{n.d(t,{Y:()=>m,c:()=>u});var a=n(84051),o=n(31481),i=n(66644),r=n(19822),s=n(39761),l=n(20897),c=n(82393);const d=100;function m(e,t,n){return(0,a.vJ)((()=>{if(!t||!e.current)return;const a=p(),o=e.current;if(!c.Yw||!n||!a?.isTypeSupported(n))return;const m=new a;function u(){if(!t||!n)return;const e=m.addSourceBuffer(n),a=(0,l.h)(t);e.addEventListener("updateend",(function(){a.next().then((t=>{let{value:n,done:a}=t;"open"===m.readyState&&(a?h(m):A(e,n))}))})),a.next().then((t=>{let{value:n,done:a}=t;a||"open"!==m.readyState||((0,i.RK)((()=>{o.style.display="block",setTimeout((()=>{(0,i.RK)((()=>{(0,r.ZM)(o,{opacity:"1"})}))}),d)})),A(e,n))}))}return m.addEventListener("sourceopen",u,{once:!0}),(0,i.RK)((()=>{(0,r.ZM)(o,{display:"none",opacity:"0"}),o.src=URL.createObjectURL(m)})),()=>{(0,i.RK)((()=>{const e=o.src;(0,s.A)(o),m.removeEventListener("sourceopen",u),"open"===m.readyState&&h(m),URL.revokeObjectURL(e)}))}}),[n,t,e]),u(n)}function u(e){return!(!c.Yw||!e)&&Boolean(p()?.isTypeSupported(e))}function A(e,t){try{e.appendBuffer(t)}catch(e){o.Oig&&console.warn("[Stream] failed to append buffer",e)}}function h(e){try{e.endOfStream()}catch(e){o.Oig&&console.warn("[Stream] failed to end stream",e)}}function p(){return"ManagedMediaSource"in window?ManagedMediaSource:"MediaSource"in window?MediaSource:void 0}},60138:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(84051),o=n(37836),i=n(17712);function r(e){const t=(0,i.A)(e);(0,a.vJ)((()=>(0,o.yu)(t)),[t])}},5130:(e,t,n)=>{n.d(t,{U:()=>r});var a=n(14235);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: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.target=e,this.onUpdate=t,this.channel=n,o(this,"requestStates",new Map),o(this,"requestStatesByCallback",new Map)}destroy(){}init(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.postMessage({type:"init",args:t})}request(e){const{requestStates:t,requestStatesByCallback:n}=this,o=(0,a.A)(),i={type:"callMethod",messageId:o,...e},r={messageId:o},s=new Promise(((e,t)=>{Object.assign(r,{resolve:e,reject:t})}));if("function"==typeof i.args[i.args.length-1]){i.withCallback=!0;const e=i.args.pop();r.callback=e,n.set(e,r)}return t.set(o,r),s.catch((()=>{})).finally((()=>{t.delete(o),r.callback&&n.delete(r.callback)})),this.postMessage(i),s}cancelCallback(e){e.isCanceled=!0;const{messageId:t}=this.requestStatesByCallback.get(e)||{};t&&this.postMessage({type:"cancelProgress",messageId:t})}onMessage(e){const{requestStates:t,channel:n}=this;if(e.channel===n)if("update"===e.type&&this.onUpdate&&this.onUpdate(e.update),"methodResponse"===e.type){const n=t.get(e.messageId);n&&(e.error?n.reject(e.error):n.resolve(e.response))}else if("methodCallback"===e.type){const n=t.get(e.messageId);n?.callback?.(...e.callbackArgs)}else if("unhandledError"===e.type)throw new Error(e.error?.message)}postMessage(e){e.channel=this.channel,this.target.postMessage(e)}}function r(e,t,n){const a=new i(e,t,n);function o(e){let{data:t}=e;a.onMessage(t)}return e.addEventListener("message",o),a.destroy=()=>{e.removeEventListener("message",o)},a}},57446:(e,t,n)=>{n.d(t,{A:()=>c});var a=n(13439),o=n(66644),i=n(67321),r=n(19822);const s=300,l=new Map;function c(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;(0,i.PKK)((0,a.mS)())||(n=0);const c="rtl"===e.getAttribute("dir"),{scrollLeft:d,offsetWidth:m,scrollWidth:u,dataset:{scrollId:A}}=e;let h=t-d;if(h<0){const e=-d*(c?-1:1);h=Math.max(h,e)}else if(h>0){const e=u-(d+m);h=Math.min(h,e)}if(0===h)return Promise.resolve();A&&l.has(A)&&l.get(A)();const p=d+h;return new Promise((t=>{(0,o.RK)((()=>{if(0===n)return e.scrollLeft=p,void t();let a=!1;const i=Math.random().toString();e.dataset.scrollId=i,l.set(i,(()=>{a=!0})),e.style.scrollSnapType="none";const s=Date.now();(0,r.i0)((()=>{if(a)return!1;const o=Math.min((Date.now()-s)/n,1),r=h*(1-function(e){return 1-(1-e)**3.5}(o));return e.scrollLeft=Math.round(p-r),o>=1&&(e.style.scrollSnapType="",delete e.dataset.scrollId,l.delete(i),t()),o<1}),o.RK)}))}))}},81954:(e,t,n)=>{n.d(t,{Ay:()=>A,_v:()=>h,o8:()=>g});var a=n(13439),o=n(89925),i=n(31481),r=n(66644),s=n(67321),l=n(19822),c=n(82393),d=n(32706);let m,u=!1;function A(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];m=t.slice(0,8);const a=p(...m);if(t[8])return a;(0,r.RK)(a)}function h(){u&&((0,l.vk)(),(0,r.YS)((()=>{(0,r.RK)(p(...m))})))}function p(e,t,n){let A=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i.Hor,p=arguments.length>5?arguments[5]:void 0,g=arguments.length>6?arguments[6]:void 0,v=arguments.length>7?arguments[7]:void 0;p!==o.CC.Static&&(0,s.PKK)((0,a.mS)())||(g=0);const{offsetTop:E,offsetHeight:C}=t,{scrollTop:b,offsetHeight:w,scrollHeight:S}=e,N=v&&e.dataset.normalHeight?Number(e.dataset.normalHeight):w;let I;switch(n){case"start":I=E-A+(c.Ni?1:0);break;case"end":I=E+C+A-N;break;case"nearest":case"center":case"centerOrTop":I=C<N?E+C/2-N/2:E-A}const M=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.Hor,a=arguments.length>3?arguments[3]:void 0;const{scrollTop:r}=e;if(void 0===a){const e=t-r;if(e<-n)return r+(e+n);if(e>n)return r+(e-n)}else{if(a===o.CC.Up)return t+n;if(a===o.CC.Down)return Math.max(0,t-n)}return r}(e,I,h,p);let k=I-M;if(k<0){const e=-M;k=Math.max(k,e)}else if(k>0){const e=S-(M+N);k=Math.min(k,e)}const T=Math.abs(k);return()=>{if(T<1)return void(b!==M&&(e.scrollTop=M));const t=M+k;if(0===g)return void(e.scrollTop=t);u=!0;const n=T<=i.QNl?y:f,a=g||i.Qk7+T/i.Hor*(i.qke-i.Qk7),o=Date.now(),s=(0,d.UH)();(0,l.S0)((()=>{const i=Math.min((Date.now()-o)/a,1),r=k*(1-n(i)),l=Math.round(t-r);return e.scrollTop=l,u=i<1&&l!==t,u||(m=void 0,s()),u}),r.RK)}}function g(){return u}function y(e){return 1-(1-e)**3.5}function f(e){return 1-(1-e)**6.5}},53827:(e,t,n)=>{n.d(t,{_K:()=>g,dj:()=>v,kz:()=>y});var a=n(13439),o=n(89925),i=n(66644),r=n(67321),s=n(50140),l=n(80853),c=n(41733),d=n(82393);const m=new Map;let u,A=[],h=[];function p(e,t){const n=u&&m.get(u);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const i=f(e,(0,r.nTw)((0,a.mS)()).audioPlayer.origin||o.d9.Inline,t);if(!i)return;if(!m.has(i))return void(0,a.ko)().openAudioPlayer((0,s.ES)(E(i).messageKey));const l=m.get(i);l.onForcePlay&&l.onForcePlay(),u=i,l.audio.src&&(0,c.A)(l.audio)}function g(){const e=u&&m.get(u);e&&e.audio.pause()}function y(e,t,n,g,y){if(!m.has(e)){const n=function(e,t,n,a){const o=new Audio;function i(t){return n=>{m.has(e)&&((0,l.f)(o)||m.get(e).handlers.forEach((e=>{e(t,n)})))}}return o.addEventListener("timeupdate",i("onTimeUpdate")),o.addEventListener("play",i("onPlay")),o.addEventListener("pause",i("onPause")),o.addEventListener("loadstart",i("onLoadStart")),o.addEventListener("loadeddata",i("onLoadedData")),o.addEventListener("playing",i("onPlaying")),o.addEventListener("ended",(()=>{m.has(e)&&((0,l.f)(o)||p(e))})),{audio:o,type:t,proxy:new Proxy(o,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:a}}(e,t,g,y);m.set(e,n),function(e,t){"audio"!==e.type||h.includes(t)||(h.push(t),h.sort(C)),"voice"!==e.type||A.includes(t)||(A.push(t),A.sort(C))}(n,e)}const{audio:v,proxy:b,handlers:w}=m.get(e);return w.push(n),{play(n){if(!v.paused)return;const i=u&&m.get(u);i&&u!==e&&(i.audio.pause(),i.audio.currentTime=0,(0,l.f)(i.audio)&&(i.audio.dataset.preventPlayAfterPatch="true"),i.onTrackChange&&i.onTrackChange()),u=e,v.src||(v.src=n,v.preload="auto",n.includes("/progressive/")&&d.Yw&&(delete v.dataset.preventPlayAfterPatch,(0,l.C)(v))),(0,c.A)(v),function(e,t){if((0,r.nTw)((0,a.mS)()).globalSearch.currentContent===o.$C.Music)return;const{chatId:n}=(0,s.ES)(E(t).messageKey),i=(0,r.Xf0)((0,a.mS)())?.chatId,l=e=>e.startsWith(`msg${n}`)||i&&e.startsWith(`msg${i}`);"audio"===e&&(h=h.filter(l)),"voice"===e&&(A=A.filter(l))}(t,e)},pause(){u===e&&v.pause()},stop(){if(u===e){const e=v.src;v.pause(),(0,i.Uz)((()=>{v.src="",v.src=e}))}},setCurrentTime(t){u===e&&(v.fastSeek?v.fastSeek(t):v.currentTime=t)},setVolume(t){u===e&&(v.volume=t,v.muted=!1)},setPlaybackRate(t){u===e&&(v.playbackRate=t)},toggleMuted(e){v.muted=void 0===e?!v.muted:e},proxy:b,requestNextTrack(){p(e)},isLast:()=>!f(e,(0,r.nTw)((0,a.mS)()).audioPlayer.origin),isFirst:()=>!f(e,(0,r.nTw)((0,a.mS)()).audioPlayer.origin,!0),requestPreviousTrack(){p(e,!0)},destroy(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];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&&(h=h.filter(n)),"voice"===e.type&&(A=A.filter(n))}(a,e),e===u&&(u=void 0)))}}}function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.d9.Inline,n=arguments.length>2?arguments[2]:void 0;const a=function(e){switch(e.type){case"audio":return h;case"voice":return A;default:return}}(m.get(e));if(!a)return;if(t===o.d9.Search){const t=a.indexOf(e);if(t<0)return;return a[t+(n?-1:1)]}const{chatId:i}=(0,s.ES)(E(e).messageKey),r=a.filter((e=>e.startsWith(`msg${i}`))),l=r.indexOf(e);if(l<0)return;let c=t===o.d9.Inline?-1:1;return n&&(c*=-1),r[l+c]}function v(e){const t=(0,s.AD)(e);if(t)return`${t}-${e.date}`}function E(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function C(e,t){if(!e||!t)return 0;const{date:n,messageKey:a}=E(e),{date:o,messageKey:i}=E(t),r=o-n;return 0===r?i.localeCompare(a):r}},48894:(e,t,n)=>{n.d(t,{LS:()=>c,Yi:()=>d,Zf:()=>s,bM:()=>r,rX:()=>l,v2:()=>i,xp:()=>o});var a=n(87679);function o(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}function i(e){const t=e[0].toString(16),n=e[1].toString(16),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 r(e){let[t,n,a]=e;t/=255,n/=255,a/=255;let o,i,r=Math.max(t,n,a),s=Math.min(t,n,a),l=r,c=r-s;if(i=0==r?0:c/r,r==s)o=0;else{switch(r){case t:o=(n-a)/c+(n<a?6:0);break;case n:o=(a-t)/c+2;break;case a:o=(t-n)/c+4}o/=6}return[o,i,l]}function s(e){let t,n,a,[o,i,r]=e,s=Math.floor(6*o),l=6*o-s,c=r*(1-i),d=r*(1-l*i),m=r*(1-(1-l)*i);switch(s%6){case 0:t=r,n=m,a=c;break;case 1:t=d,n=r,a=c;break;case 2:t=c,n=r,a=m;break;case 3:t=c,n=d,a=r;break;case 4:t=m,n=c,a=r;break;case 5:t=r,n=c,a=d}return[Math.round(255*t),Math.round(255*n),Math.round(255*a)]}async function l(e){const t=[0,0,0];let n,o,i,r,s=-4,l=[0,0,0],c=0;const d=document.createElement("canvas"),m=d.getContext&&d.getContext("2d");if(!m)return t;const u=await(0,a.NN)(e);i=u.naturalHeight||u.offsetHeight||u.height,o=u.naturalWidth||u.offsetWidth||u.width,d.height=i,d.width=o,m.drawImage(u,0,0);try{n=m.getImageData(0,0,o,i)}catch(e){return t}for(r=n.data.length;(s+=20)<r;)0!==n.data[s+3]&&(++c,l[0]+=n.data[s],l[1]+=n.data[s+1],l[2]+=n.data[s+2]);return l[0]=Math.floor(l[0]/c),l[1]=Math.floor(l[1]/c),l[2]=Math.floor(l[2]/c),l}function c(e){const[t,n,a]=e;return.2126*t+.7152*n+.0722*a}function d(e){let[t,n,a]=r(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)`}},67054:(e,t,n)=>{function a(e,t){return t-Math.floor(t/e)*e}n.d(t,{A:()=>a})},95362:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(37836);const o=10,i=1e3;let r=[],s=!1;function l(e,t){r.push({url:e,filename:t}),s||(s=!0,setTimeout((async()=>{await async function(){let e=0;for(const t of r)c(t),e++,e===o&&(await(0,a.v7)(i),e=0);r=[]}(),s=!1}),i))}function c(e){let{url:t,filename:n}=e;const a=document.createElement("a");a.href=t,a.download=n;try{a.click()}catch(e){console.error(e)}}},17237:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(98221),o=n(24282);const i=new RegExp(`^(?:${a.A.source})+$`,""),r=e=>{const t=(0,o.A)(e).split("\n"),n=t.join("");if(n.length>800)return!1;if(!Boolean(n.match(i)))return!1;const r=t.map((e=>{let t=0;for(;a.A.exec(e);)if(t++,t>100)return a.A.lastIndex=0,-1;return t}));let s=t.length;for(let e=0;e<r.length;e++){if(-1===r[e])return!1;r[e]>s&&(s=r[e])}return s}},36353:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(82393);function o(e,t,n){if(!t&&e===document.activeElement)return;const o=window.getSelection(),i=document.createRange(),r=e.lastChild||e;a.TF||n||r&&r.nodeValue?(i.selectNodeContents(n?e:r),i.collapse(!1),o.removeAllRanges(),o.addRange(i)):e.focus()}},81686:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(31481);const o=1;function i(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&r(e.focusNode,a.zPk);if(!t||0===t.childElementCount)return;const i=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||i.pop(),i}function r(e,t){return!(e.nodeType!==o||!e.classList.contains(t))||!!e.parentNode&&r(e.parentNode,t)}},24909:(e,t,n)=>{n.d(t,{s:()=>i,y:()=>r});var a=n(48894);const o=240;function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/png";const a=e instanceof Blob?URL.createObjectURL(e):e,o=new Image;return new Promise((i=>{o.onload=()=>{s(o,o.width*t,o.height*t,n).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(i).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(a)}))},o.src=a}))}function r(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";const o=e instanceof Blob?URL.createObjectURL(e):e,i=new Image;return new Promise((r=>{i.onload=()=>{s(i,t,n,a).then((e=>{if(!e)throw new Error("Image resize failed!");return URL.createObjectURL(e)})).then(r).finally((()=>{e instanceof Blob&&URL.revokeObjectURL(o)}))},i.src=o}))}async function s(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"image/png";if(!("createImageBitmap"in window))return l(e,t,n,void 0,i);try{const r=await window.createImageBitmap(e,{resizeWidth:t,resizeHeight:n,resizeQuality:"high"});if(r.height!==n||r.width!==t)throw new Error("Image bitmap resize not supported!");const s=await(0,a.rX)(e.src),l=(0,a.LS)(s)<o?"#fff":"#000";return await new Promise((e=>{const t=document.createElement("canvas");t.width=r.width,t.height=r.height;const n=t.getContext("2d");n.fillStyle=l,n.fillRect(0,0,t.width,t.height);const a=t.getContext("bitmaprenderer");a?a.transferFromImageBitmap(r):n.drawImage(r,0,0),t.toBlob(e,i)}))}catch(a){return l(e,t,n,void 0,i)}}async function l(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"image/png";const s=document.createElement("canvas"),l=s.getContext("2d"),c=document.createElement("canvas"),d=c.getContext("2d");if(s.width=t,s.height=n,e.width*i>t){const n=1/i;let a={width:Math.floor(e.width*i),height:Math.floor(e.height*i)};for(c.width=a.width,c.height=a.height,d.drawImage(e,0,0,a.width,a.height);a.width*i>t;)a={width:Math.floor(a.width*i),height:Math.floor(a.height*i)},d.drawImage(c,0,0,a.width*n,a.height*n,0,0,a.width,a.height);l.drawImage(c,0,0,a.width,a.height,0,0,s.width,s.height)}else l.drawImage(e,0,0,s.width,s.height);const m=await(0,a.rX)(e.src),u=(0,a.LS)(m)<o?"#fff":"#000";return l.fillStyle=u,l.globalCompositeOperation="destination-over",l.fillRect(0,0,s.width,s.height),new Promise((e=>{s.toBlob(e,r)}))}},4457:(e,t,n)=>{n.d(t,{Y:()=>o});var a=n(43503);function o(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=a.A.get();return t.top<=n&&t.top+t.height>=0}},47526:(e,t,n)=>{n.d(t,{KE:()=>l,PP:()=>c,_u:()=>s,zS:()=>r});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"})),i=["#e56cd5","#f89440","#9986ff","#44b3f5","#6dc139","#ff5d5a","#f87aad","#6e82b3","#f5ba21"];function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15;const{lat:o,long:i}=t,r=a[e];switch(e){case"google":return`${r}/place/${o}+${i}/@${o},${i},${n}z`;case"bing":return`${r}?cp=${o}~${i}&lvl=${n}&sp=point.${o}_${i}`;case"apple":return`${r}?q=${o},${i}`;default:return`${r}/?mlat=${o}&mlon=${i}&zoom=${n}`}}function s(e,t){return 156543.03392*Math.cos(e*(Math.PI/180))/2**t}function l(e){return e?`https://ss3.4sqi.net/img/categories_v2/${e}_88.png`:""}function c(e){return e?o.get(e)||o.get(e.split("/")[0])||i[(t=e,t.split("").reduce(((e,t)=>(e<<5)-e+t.charCodeAt(0)|0),0)%i.length)]:"#008df2";var t}},49642:(e,t,n)=>{n.d(t,{D5:()=>i,Eg:()=>s,HW:()=>l,MV:()=>o,hm:()=>c,wp:()=>d});const a={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function o(e,t){const{mediaSession:n}=window.navigator;n?(e&&i(e),t&&r(t)):console.warn("MediaSession API not supported in this browser")}function i(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=e??null)}function r(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...a,...e}).forEach((e=>{let[n,a]=e;try{t.setActionHandler(n,a)}catch(e){}}))}function s(){const{mediaSession:e}=window.navigator;e&&(e.metadata=null,r(a),e.playbackState&&(e.playbackState="none"),e.setPositionState?.())}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function c(e){if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:t}=window.navigator;t?.setPositionState?.(e)}function d(e){let{title:t,artist:n,album:a,artwork:o}=e;if("MediaMetadata"in window)return new window.MediaMetadata({title:t,artist:n,album:a,artwork:o})}},37830:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(87894);const o=new WeakMap;function i(e){return function(){const t=o.get(e);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];if(t&&(0,a.k)(t.lastArgs,i))return t.lastResult;const s=e(...i);return o.set(e,{lastArgs:i,lastResult:s}),s}}},58968:(e,t,n)=>{n.d(t,{V:()=>o,l:()=>a});const a={isCustomPeer:!0,type:"premium",titleKey:"PrivacyPremium",subtitleKey:"PrivacyPremiumText",avatarIcon:"premium",isAvatarSquare:!0,withPremiumGradient:!0},o={isCustomPeer:!0,type:"toBeDistributed",titleKey:"BoostingToBeDistributed",avatarIcon:"user",withPremiumGradient:!0}},80539:(e,t,n)=>{n.d(t,{Ay:()=>l,g4:()=>c,qh:()=>r});var a=n(97335),o=n(31481),i=n(82393);const r={B:a.C7.Bold,STRONG:a.C7.Bold,I:a.C7.Italic,EM:a.C7.Italic,INS:a.C7.Underline,U:a.C7.Underline,S:a.C7.Strike,STRIKE:a.C7.Strike,DEL:a.C7.Strike,CODE:a.C7.Code,PRE:a.C7.Pre,BLOCKQUOTE:a.C7.Blockquote},s=3;function l(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const l=document.createElement("div");l.innerHTML=n?e:function(e){let t=e.slice(0);return t=t.replace(/ /g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[`]{1}([^`\n]+)[`]{1}(?![^<]*<\/(code|pre)>)/g,"<code>$2</code>"),i.TL||(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.C7.Spoiler}">$2</span>`),t}(t?function(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${o.kNZ}+?)\\)`,"g"),((e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`https://${n}`}">${t}</a>`))}(e):e),c(l);const d=l.innerText.trim().replace(/\u200b+/g,"");let m=-l.innerText.indexOf(d[0]),u=0;const A=[];function h(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(r[e.nodeName])return r[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.C7.MentionName?a.C7.MentionName:t.dataset.entityType===a.C7.Url?a.C7.Url:t.href.startsWith("mailto:")?a.C7.Email:t.href.startsWith("tel:")?a.C7.Phone:t.href!==t.textContent?a.C7.TextUrl:a.C7.Url}return"SPAN"===e.nodeName?e.dataset.entityType:"IMG"===e.nodeName&&e.dataset.documentId?a.C7.CustomEmoji:void 0}(e);if(!o||!e.textContent)return{index:n,entity:void 0};const i=t.indexOf(e.textContent,n),s=i>=0?i:n,l=t.substring(0,s).length,{length:c}=t.substring(s,s+e.textContent.length);return o===a.C7.TextUrl?{index:s,entity:{type:o,offset:l,length:c,url:e.href}}:o===a.C7.MentionName?{index:s,entity:{type:o,offset:l,length:c,userId:e.dataset.userId}}:o===a.C7.Pre?{index:s,entity:{type:o,offset:l,length:c,language:e.dataset.language}}:o===a.C7.CustomEmoji?{index:s,entity:{type:o,offset:l,length:c,documentId:e.dataset.documentId}}:{index:s,entity:{type:o,offset:l,length:c}}}(e,d,m);if(n)m=t,A.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;m+=e.textContent.length}e.hasChildNodes()&&u<=s&&(u+=1,Array.from(e.childNodes).forEach(h))}return Array.from(l.childNodes).forEach((e=>{u=1,h(e)})),{text:d,entities:A.length?A:void 0}}function c(e){e.querySelectorAll("img").forEach((e=>{e.dataset.documentId?e.textContent=e.alt||"":e.replaceWith(e.alt||"")}))}},20897:(e,t,n)=>{n.d(t,{h:()=>d});var a=n(97335),o=n(4875);const i=262144,r=5242879,s=new Map,l=new Map,c=new Map;function d(e){try{let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return async function*(){const i=e.match(/fileSize=(\d+)/);let d;for(d=i?i&&Number(i[1]):l.get(e);;){if(d&&t>=d)return;let i=t+n-1;d&&i>d&&(i=d-1);const m=`${e}:${t}-${i}`;let u=s.get(m);if(!u){let n=c.get(m);n||(n=(0,o.px)("downloadMedia",{mediaFormat:a.qZ.Progressive,url:e,start:t,end:i}),c.set(m,n));const A=await n.finally((()=>{c.delete(m)}));if(!A?.arrayBuffer)return;A.fullSize&&!d&&(d=A.fullSize,l.set(e,A.fullSize)),u=A.arrayBuffer,i<=r&&s.set(m,A.arrayBuffer)}yield u,t=i+1}}()}catch(e){return Promise.reject(e)}}},39074:(e,t,n)=>{n.d(t,{DY:()=>l,JC:()=>r,LV:()=>i,oR:()=>o,vZ:()=>s});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 i(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 r(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 s(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=s(n,t)))return-1;return t}function l(){const e=window.getSelection();e?.removeAllRanges()}},52844:(e,t,n)=>{let a;function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];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,{p:()=>o})},70497:(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),i=o[t]+(o[t+1]<<8);a[e]=i>>n&31}const i=Math.floor(5*(n-1)/8),r=Math.floor(5*(n-1)%8),s=o[i]+(o[i+1]<<8);return a[n-1]=s>>r&31,a}function o(e,t){let n=0;const a=new Array(t),o=e.length/t,i=e[0],r=e[e.length-1];for(let s=0;s<t;s++){const t=Math.floor(s*o),l=((e[t-1]??i)+(e[t]??i)+(e[t+1]??r))/3;a[s]=l,n<l&&(n=l)}return{data:a,peak:n}}n.d(t,{e:()=>a,p:()=>o})},69988:(e,t,n)=>{n.d(t,{A:()=>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"}},2429:(e,t,n)=>{n.d(t,{A:()=>a});const a={root:"CdTfL4f7",fadeIn:"MyeHARy0",closing:"EZbKn_M3",peer:"kW0xpExG",name:"BDZrSTO_",name_hasUnreadStory:"OoUm5AUZ",nameHasUnreadStory:"OoUm5AUZ",hidden:"lnVtxMZI",contextMenu:"N1sagA0s"}},17169:(e,t,n)=>{n.d(t,{A:()=>a});const a={name:"BDZrSTO_",root:"QOz6fQFU",avatar:"dXSy0i2c",avatarHidden:"n0vJEdNW",ghost:"E1IeDpeb",ghostAnimateName:"HMp3KTKQ",ghostRevealName:"unYkDic1",ghostLast:"dZJGfaXC"}},89755:(e,t,n)=>{e.exports=n.p+"encoderWorker.min.40a69ba9ec4d2c4cf3a7.js"},72078:(e,t,n)=>{e.exports=n.p+"GiftBlueRound.90e369f0f350cdfb20d4.svg"},68153:(e,t,n)=>{e.exports=n.p+"GiftGreenRound.f66f0acd5d3dda1c7baf.svg"},65741:(e,t,n)=>{e.exports=n.p+"GiftRedRound.a86b78b0b99e07f69a70.svg"}}]);
|
||
//# sourceMappingURL=9122.9abf88bcb86ce22b82ee.js.map
|