TelegramPWA/dist/131.dea6f57183b333b48ca9.js
Alexander Zinchuk 6fd1d0c598 [Build]
2025-09-19 14:39:00 +02:00

2 lines
76 KiB
JavaScript

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[131],{101:(e,t,n)=>{n.d(t,{A:()=>s});var o=n(84051),i=n(87679),a=n(56863);function s(e){const t=(0,o.li)(),{result:n}=(0,a.A)(()=>{if(!e)return Promise.resolve(void 0);t.current&&URL.revokeObjectURL(t.current);const n=URL.createObjectURL(e);return t.current=n,(0,i.NN)(n)},[e]);return(0,o.vJ)(()=>()=>{t.current&&(URL.revokeObjectURL(t.current),t.current=void 0)},[]),{image:n}}},537:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051);function i(e,t){const n=(0,o.li)(0);return(0,o.Kr)(()=>{t||(n.current+=1)},[...e]),n.current}},10187:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(13439),a=n(70636),s=n(91048),c=n(87357),r=n(35049),l=n(59030),d=n(21849),u=n(34431),h=n(18276);var m=n(20021);const p=(0,o.ph)((0,i.EK)((e,t)=>{let{peerId:n,forceShowSelf:o}=t;if(!n)return{peer:void 0,isSavedMessages:void 0};const i=(0,s.PVB)(e,n),a=(0,s.mBe)(e,n);return{peer:i,isSavedMessages:!o&&a&&a.isSelf}})(e=>{let{icon:t,title:n,isMinimized:o,canClose:i,isCloseNonDestructive:s,clickArg:p,peer:g,mockPeer:A,customPeer:v,className:f,isSavedMessages:C,withPeerColors:y,withEmojiStatus:S,onClick:I,itemClassName:w}=e;const R=(0,l.A)(),N=A||g,b=v||N,M=N&&(0,a.vj)(N)?N:void 0;let x,P,k;t&&n?(x=(0,m.Y)("div",{className:"NtoGLT22",children:(0,m.Y)(h.A,{name:t,style:"f91Ad80i"})}),P=n):b&&(x=(0,m.Y)(d.A,{className:"La8BQ9yr",peer:b,size:"small",isSavedMessages:C}),k=(0,a.F9)(R,b)||n,P=n||(0,m.Y)(u.A,{peer:b,isSavedMessages:C,withEmojiStatus:S}));const Y=(0,c.A)("_Lq6_4e5",(M?.isForum||v?.isAvatarSquare)&&"JIHfTUVn",o&&"UhOZvxvs",i&&"uvvgSFUJ",s&&"fAk5yEeV",!I&&"P8r3OoaX",y&&(0,r.y)(v||g),f);return(0,m.FD)("div",{className:Y,onClick:()=>I?.(p),title:o?k:void 0,dir:R.isRtl?"rtl":void 0,children:[x,!o&&(0,m.Y)("div",{className:(0,c.A)("XPVuH29G",w),dir:"auto",children:P}),i&&(0,m.Y)("div",{className:"xVPG2UTy",children:(0,m.Y)(h.A,{name:"close"})})]})}))},11241:(e,t,n)=>{n.d(t,{A:()=>N});var o=n(84051),i=n(13439),a=n(90709),s=n(91048),c=n(87357),r=n(43336),l=n(76023),d=n(37661),u=n(5912),h=n(17712),m=n(62587),p=n(50680),g=n(47483),A=n(18104),v=n(87412),f=n(83594),C=n(17794),y=n(93879),S=n(20021);const I=1.5*l.$,w=6.5*l.$,R=l.$,N=(0,o.ph)((0,i.EK)((e,t)=>{let{containerId:n}=t;const{genericEmojiEffects:o,reactions:i}=e,{activeReactions:a}=(0,s.nTw)(e),c=(0,s.xYJ)(e,"reactionEffects");return{activeReactions:a?.[n],availableReactions:i.availableReactions,genericEffects:o,withEffects:c}})(e=>{let{containerId:t,reaction:n,className:s,size:l=I,effectSize:N=w,activeReactions:b,availableReactions:M,genericEffects:x,withEffects:P,withEffectOnly:k,shouldPause:Y,shouldLoop:T,loopLimit:D,observeIntersection:L}=e;const{stopActiveReaction:F}=(0,i.ko)(),E=(0,o.li)(),B="custom"===n.type,O=(0,o.Kr)(()=>M?.find(e=>(0,a.a0)(e.reaction,n)),[M,n]),K=O?.centerIcon?.id,{customEmoji:_}=(0,g.A)(B?n.documentId:void 0),U=(0,o.Kr)(()=>{if(!B)return O?.aroundAnimation?.id;if(!_)return;const e=M?.find(e=>e.reaction.emoticon===_.emoji)?.aroundAnimation?.id;return e},[O,M,_,B]),$=(0,o.Kr)(()=>{if(U)return U;if(!x?.stickers)return;const{stickers:e}=x;return e[Math.floor(Math.random()*e.length)].id},[U,x]),J=(0,u.Vz)(E,L),z=K&&(0,a.aL)(K),j=$&&(0,a.aL)($),H=(0,m.A)(z),q=(0,m.A)(j),G=(0,o.Kr)(()=>b?.find(e=>(0,a.a0)(e,n)),[b,n]),V=Boolean(P&&G&&(B||H)&&q),W=J&&(V&&!k||T),{shouldRender:X,transitionClassNames:Z}=(0,p.A)(V,void 0,!0,"slow"),{shouldRender:Q,transitionClassNames:ee}=(0,p.A)(W,void 0,!0,"slow"),te=(0,h.A)(()=>{F({containerId:t,reaction:n})}),[ne,oe,ie]=(0,d.A)(),ae=!(B||W&&ne),{shouldRender:se,transitionClassNames:ce}=(0,p.A)(ae,void 0,!0),re=(0,c.A)(y.A.root,X&&y.A.animating,k&&y.A.withEffectOnly,s);return(0,S.FD)("div",{className:re,ref:E,children:[!k&&se&&(0,S.Y)(C.A,{className:ce,reaction:n,availableReactions:M,size:l,observeIntersection:L}),!k&&B&&(0,S.Y)(v.A,{documentId:n.documentId,className:y.A.customEmoji,size:l,noPlay:Y,noVideoOnMobile:!0,loopLimit:D,observeIntersectionForPlaying:L,forceAlways:!0}),Q&&!B&&(0,S.Y)(A.A,{className:(0,c.A)(y.A.animatedIcon,ee),size:(0,r.Ki)(1.9*l),tgsUrl:H,play:J&&!Y,noLoop:!T,onLoad:oe,onEnded:ie,forceAlways:!0},`${K}-${l}`),X&&(0,S.FD)(S.FK,{children:[(0,S.Y)(A.A,{className:(0,c.A)(y.A.effect,Z),size:N,tgsUrl:q,play:J,noLoop:!0,onEnded:te,forceAlways:!0},`${$}-${N}`),B&&!U&&J&&(0,S.Y)(f.A,{reaction:n,className:Z,particleSize:Math.max(.5*l,R),onEnded:te})]})]})}))},14622:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(13439),a=n(81954),s=n(17712),c=n(93545),r=n(672);const l=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{focusLastMessage:n}=(0,i.ko)(),l=(0,o.li)(0),d=(0,s.A)(e=>{const t=l.current,i=e.contentRect.height;if(l.current=i,(0,a.o8)()||!t||i<=t)return;const s=e.target.closest(".MessageList");if(!s)return;(0,o.VK)(400);const c=i-t,{offsetHeight:r,scrollHeight:d,scrollTop:u}=s;Math.round(d-u-r)-c<=5&&n()}),u=(0,r.A)(d,[d],300,!1);(0,c.A)(e,u,!t)}},14737:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(17712);const a=function(e,t){const n=(0,i.A)(e);(0,o.vJ)(()=>{if("number"!=typeof t)return;const e=setTimeout(()=>n(),t);return()=>clearTimeout(e)},[t])}},15535:(e,t,n)=>{n.d(t,{A:()=>A});var o=n(84051),i=n(31481),a=n(66644),s=n(63495),c=n(96454),r=n(87357),l=n(83868),d=n(14737),u=n(43874),h=n(39351),m=n(64493),p=n(18276),g=n(20021);const A=(0,o.ph)(e=>{let{isLoading:t=!1,isPasswordVisible:n,error:A,hint:v,placeholder:f,submitLabel:C,description:y,shouldShowSubmit:S,shouldResetValue:I,shouldDisablePasswordManager:w=!1,noRipple:R=!1,onClearError:N,onChangePasswordVisibility:b,onInputChange:M,onSubmit:x}=e;const P=(0,o.li)(),k=(0,h.A)(),{isMobile:Y}=(0,u.Ay)(),[T,D]=(0,o.J0)(""),[L,F]=(0,o.J0)(!1),E=Y?550:400;return(0,o.vJ)(()=>{I&&D("")},[I]),(0,d.A)(()=>{c.TF||P.current.focus()},E),(0,o.vJ)(()=>{A&&(0,a.RK)(()=>{P.current.focus(),P.current.select()})},[A]),(0,g.FD)("form",{action:"",onSubmit:x?function(e){e.preventDefault(),t||L&&x(T)}:l.A,autoComplete:"off",children:[(0,g.FD)("div",{className:(0,r.A)("input-group password-input",T&&"touched",A&&"error"),dir:k.isRtl?"rtl":void 0,children:[w&&(0,g.Y)("input",{type:"password",id:"prevent_autofill",autoComplete:"off",className:"visually-hidden",tabIndex:-2}),(0,g.Y)("input",{ref:P,className:"form-control",type:n?"text":"password",id:"sign-in-password",value:T||"",autoComplete:w?"one-time-code":"current-password",spellCheck:!s.Vq&&void 0,onChange:function(e){A&&N();const{target:t}=e;D(t.value),F(t.value.length>=i.AGC),M&&M(t.value)},maxLength:256,dir:"auto"}),(0,g.Y)("label",{children:A||v||f||k("PasswordFormPlaceholder")}),(0,g.Y)("div",{className:"div-button toggle-password",onClick:function(){b(!n)},role:"button",tabIndex:0,title:k("AriaPasswordToggle"),"aria-label":k("AriaPasswordToggle"),children:(0,g.Y)(p.A,{name:n?"eye":"eye-crossed"})})]}),y&&(0,g.Y)("p",{className:"description",children:y}),x&&(L||S)&&(0,g.Y)(m.A,{type:"submit",ripple:!R,isLoading:t,disabled:!L,children:C||k("PasswordFormSubmit")})]})})},15640:(e,t,n)=>{function o(e){return"touches"in e?{x:e.touches[0].clientX,y:e.touches[0].clientY}:{x:e.clientX,y:e.clientY}}n.d(t,{A:()=>o})},17794:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),i=n(90709),a=n(87357),s=n(62587),c=n(83057),r=n(87412),l=n(18276),d=n(61911),u=n(20021);const h=(0,o.ph)(e=>{let{reaction:t,availableReactions:n,className:h,size:m,withIconHeart:p,observeIntersection:g}=e;const A=(0,o.Kr)(()=>n?.find(e=>(0,i.a0)(e.reaction,t)),[n,t]),v=A?.staticIcon?.id,f=v?`document${v}`:void 0,C=(0,s.A)(f),y=(0,c.A)(C),S="emoji"===t.type&&"🦄"===t.emoticon,I=p&&"emoji"===t.type&&"❤"===t.emoticon;return"custom"===t.type?(0,u.Y)(r.A,{documentId:t.documentId,className:(0,a.A)("ReactionStaticEmoji",h),size:m,observeIntersectionForPlaying:g}):I?(0,u.Y)(l.A,{name:"heart",className:"ReactionStaticEmoji",style:`font-size: ${m}px; width: ${m}px`}):(0,u.Y)("img",{className:(0,a.A)("ReactionStaticEmoji",S&&"with-unicorn-fix",y,h),style:m?`width: ${m}px; height: ${m}px`:void 0,src:C||d,alt:A?.title,draggable:!1})})},20333:(e,t,n)=>{n.d(t,{A:()=>y});var o=n(84051),i=n(87357),a=n(95807),s=n(76023),c=n(537),r=n(30857),l=n(59030),d=n(29886),u=n(93545),h=n(35297),m=n(41036),p=n(18276);const g="HS9PzRKt",A="_b5HgBXr",v="P6mch4bB",f="xdKGgbKQ";var C=n(20021);const y=(0,o.ph)(e=>{let{leftText:t,rightText:n,floatingBadgeText:y,floatingBadgeIcon:S,progress:I=0,isPrimary:w,isNegative:R,animationDirection:N="none",className:b}=e;const M=(0,l.A)(),x=(0,o.li)(),P=(0,o.li)(),[k,Y]=(0,o.J0)(0),[T,D]=(0,o.J0)(0),[L,F]=(0,o.J0)(0),E=(0,d.A)(L),[B,O]=(0,o.J0)(R?0:I),[K,_]=(0,o.J0)(R?I:0),[U,$]=(0,o.J0)(I),[J,z]=(0,o.J0)(0),[j,H]=(0,o.J0)(!1),[q,G]=(0,o.J0)(!1),[V,W]=(0,o.J0)(!1),[X,Z]=(0,o.J0)(!1),[Q,ee]=(0,o.J0)(!1),te=(0,c.A)([y,S]),ne=(0,o.li)(!1),oe=(0,d.A)(t),ie=(0,d.A)(n),ae=(0,d.A)(R),se=14+s.$,ce=1.5*s.$,re=()=>{if(x.current&&P.current){const e=P.current.offsetWidth,t=L/2,n=t,o=e-t,i=14,a=R?(1-U)*e:U*e;let s=Math.max(n,Math.min(a,o));a<se&&(s=a+t),a>e-se&&(s=a-t);const c=t+(a-s)-i;Y(s/e),D(c)}};(0,o.vJ)(re,[U,L,R,se]),(0,u.A)(P,re),(0,o.vJ)(()=>{F((x?.current?.clientWidth||0)+ce)},[y,S,ce]);const le=(0,r.A)();(0,h.A)(()=>{let e;if((oe||ie)&&(void 0!==ae&&ae!==R||Q)&&!ne.current){ne.current=!0;const t=Q?800:400;e=window.setTimeout(()=>{ne.current=!1,le()},t)}return()=>{e&&(clearTimeout(e),ne.current=!1)}},[t,oe,n,ie,ae,R,N,Q]);const de=ne.current;(0,o.vJ)(()=>{R?(O(0),_(I)):(_(0),O(I)),$(I)},[I,R]);const ue=Boolean(S||y),he=de?oe:t,me=de?ie:n,pe=(0,d.A)(I);(0,o.vJ)(()=>{const e=[];if("none"===N||void 0===pe)return;const t=I,n=e=>{R?_(e):O(e)};if("forward"===N||"backward"===N){const o="forward"===N;ee(!0),n(o?1:0),W(!0),z(o?0:1),e.push(window.setTimeout(()=>{W(!1),H(!0),z(t),o&&(G(!0),n(0))},400)),e.push(window.setTimeout(()=>{G(!0),W(!0),Z(!1),n(t),H(!1),e.push(window.setTimeout(()=>{G(!1),W(!1),ee(!1)},50))},800))}return()=>{e.forEach(clearTimeout)}},[I,N,R,pe,800]);const ge=(e,t,n,o)=>{const a=e?"MzFvyMb5":"S6H6hBpP";return(0,C.FD)("div",{className:(0,i.A)(a,n,o&&g),style:`--layer-progress: ${t}`,children:[(0,C.Y)("div",{className:A,children:(0,C.Y)("span",{children:he})}),(0,C.Y)("div",{className:v,children:(0,C.Y)("span",{children:me})})]})};return(0,C.FD)("div",{ref:P,className:(0,i.A)("nY2ggBsF",ue&&"RYtVQAjM",w&&"Zi0w7QJ3",R&&"dXs41qvC",de&&"I7toQztx",Q&&"SxTCkiyg",b),style:(0,a.A)(`--positive-progress: ${B}`,`--negative-progress: ${K}`,`--layer-progress: ${J}`,`--shift-x: ${k}`,"--cycling-animation-badge-position: 800ms","--cycling-animation-progress: 400ms"),children:[ue&&(0,C.Y)("div",{className:"dhigNjAq",children:(0,C.FD)("div",{className:"cOpfCGPh",children:[(0,C.Y)("div",{className:(0,i.A)("uNwBLNOy",(!E||0===E)&&g),style:`width: ${L}px;`,children:(0,C.Y)(m.Ay,{activeKey:te,name:"fade",shouldCleanup:!0,children:(0,C.FD)("div",{ref:x,className:"W4rqGyJl",children:[S&&(0,C.Y)(p.A,{name:S,className:"MJ7MTmxi"}),y&&(0,C.Y)("div",{className:"MwzZt3Qo",dir:M.isRtl?"rtl":void 0,children:y})]})})}),(0,C.Y)("div",{className:"qRwO7SZm",style:`left: ${T}px`,children:(0,C.Y)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",children:(0,C.Y)("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:"currentColor"})})})]})}),(0,C.Y)("div",{className:A,children:(0,C.Y)("span",{children:he})}),(0,C.Y)("div",{className:v,children:(0,C.Y)("span",{children:me})}),(0,C.FD)("div",{className:"_B4r3D5W",children:[ge(!0,B,(0,i.A)(X&&f),q),ge(!1,K,(0,i.A)(X&&f),q),ge(!R,J,(0,i.A)(R?"QZwWHVdB":"VmyTBAzN",j&&"tkyw4hXo"),V)]})]})})},24531:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(31481),a=n(17663),s=n(80140),c=n(17712),r=n(59030),l=n(80089),d=n(80464),u=n(20021);const h=e=>{const{isOpen:t}=e,n=(0,d.A)(l.ar.Extra,"CalendarModal",!t);return n?(0,u.Y)(n,{...e}):void 0},m=(e,t,n)=>{const l=(0,r.A)(),[d,m]=(0,o.J0)(),p=(0,c.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,s.SF)());d?.(n),m(void 0)}),g=(0,c.A)(()=>{p(new Date(1e3*i.NkL),!0)}),A=(0,c.A)(()=>{m(void 0),t?.()}),v=(0,c.A)(e=>{m(()=>e)}),f=n?new Date(1e3*n):new Date;f.setSeconds(0),f.setMilliseconds(0);const C=new Date;return C.setFullYear(C.getFullYear()+1),[v,(0,u.Y)(h,{isOpen:Boolean(d),withTimePicker:!0,selectedAt:f.getTime(),maxAt:(0,a.CS)(C),isFutureMode:!0,secondButtonLabel:e?l("Schedule.SendWhenOnline"):void 0,onClose:A,onSubmit:p,onSecondButtonClick:e?g:void 0})]}},26875:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(87357),a=n(59030),s=n(21849);var c=n(20021);const r=3,l=(0,o.ph)(e=>{let{peers:t,size:n,className:l,limit:d=r,badgeText:u}=e;const h=(0,a.A)(),m="number"==typeof n?n:s.R[n],p=(0,o.Kr)(()=>u||(!t?.length||t.length<=d?void 0:"+"+(t.length-d)),[u,t,d]);return(0,c.FD)("div",{className:(0,i.A)(l,"kXs18Nmi"),style:`--_size: ${m}px;`,dir:h.isRtl?"rtl":"ltr",children:[t?.slice(0,d).map(e=>(0,c.Y)(s.A,{size:n,peer:e,className:"XND8fhC1"})),p&&(0,c.Y)("div",{className:"SHyAyGFO",children:p})]})})},27860:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),i=n(66644),a=n(87357),s=n(45470),c=n(39351),r=n(17712),l=n(50680),d=n(18276);var u=n(20021);const h=(0,o.ph)(e=>{let{isVisible:t,withAnimation:n,thumbDataUri:h,isNsfw:m,className:p,width:g,height:A}=e;const v=(0,o.li)(),f=(0,c.A)(),{shouldRender:C,transitionClassNames:y}=(0,l.A)(t,void 0,!0,!n&&void 0,void 0,500),S=(0,s.A)(h,!C,void 0,25,g,A),I=(0,r.A)(e=>{if(!v.current)return;const t=v.current,n=e.currentTarget.getBoundingClientRect(),o=e.clientX-n.left,a=e.clientY-n.top,s=o-n.width/2,c=a-n.height/2;(0,i.RK)(()=>{t.setAttribute("style",`--click-shift-x: ${s}px; --click-shift-y: ${c}px`)})});if(C)return(0,u.FD)("div",{className:(0,a.A)("qF2WgYVg",y,p,n&&"pNM3cgkY"),ref:v,onClick:n?I:void 0,children:[(0,u.Y)("canvas",{ref:S,className:"eULqS2yR",width:g,height:A}),(0,u.Y)("div",{className:"XBor45hE"}),m&&(0,u.FD)("span",{className:"FJGQoa6s",children:[(0,u.Y)(d.A,{name:"eye-crossed-outline",className:"Y7JVRkxJ"}),f("MediaSpoilerSensitive")]})]})})},29886:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051);function i(e){const t=(0,o.li)(),n=(0,o.li)();return n.current!==e&&(t.current=n.current),n.current=e,t.current}},31460:(e,t,n)=>{n.d(t,{P:()=>a});var o=n(31481),i=n(96454);function a(e,t){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return arguments.length>2&&void 0!==arguments[2]&&arguments[2]||t===o.dnp?"none":t===o.zHL?"slideFade":"slideOptimized"===e?n?"slideOptimizedRtl":"slideOptimized":"slide"===e?n?"slideRtl":"slide":i.Ni?"slideFade":i.pz?"slideLayers":"pushSlide"}},31722:(e,t,n)=>{n.d(t,{A:()=>o});const o={container:"YmM5biTv",header:"S7WFT2bv",pickerCategoryTitle:"YK1300x2",peerChip:"gsKPBPoK",pickerList:"yLCbiItq",padded:"bXzIGw8s",noResults:"dXWKD0ve",onlineStatus:"d5GDOYh9"}},36838:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(84051);const i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,o.vJ)(()=>{if(t)return;const o=e.current;function i(e){e.deltaX||(o.scrollLeft+=e.deltaY/4,n&&e.preventDefault())}return o.addEventListener("wheel",i,{passive:!n}),()=>{o.removeEventListener("wheel",i)}},[e,t,n])}},40558:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(66644),a=n(90709),s=n(87357),c=n(95807),r=n(87679),l=n(17712),d=n(62587),u=n(93545),h=n(38691);var m=n(20021);const p=(0,o.ph)(e=>{let{backgroundColors:t,patternColor:n,patternIcon:p,clearBottomSector:g,className:A}=e;const v=(0,o.li)(),f=(0,o.li)(),[C,y]=(0,o.Ul)({width:0,height:0}),S=(0,h.A)(),[I,w]=(0,o.J0)(),R=p&&(0,a.Mw)(p,"preview"),N=(0,d.A)(R);(0,o.vJ)(()=>{N&&(0,r.NN)(N).then(w)},[N]);const b=(0,o.Kr)(()=>{const e=[];for(let t=1;t<=3;t++){const n=Math.floor(8*(1+.5*(t-1))),o=t/3,i=.05+(.4-.05)*o,a=t%2==0?Math.PI/n:0;for(let t=0;t<n;t++){const s=t/n*Math.PI*2+a;if(g&&s>.45*Math.PI&&s<.55*Math.PI)continue;const c=.5+1.71*i*Math.cos(s),r=.5+i*Math.sin(s),l=1.4-o*Math.random();e.push({x:c,y:r,sizeFactor:l})}}return e},[g]);(0,u.A)(v,e=>{y({width:e.contentRect.width,height:e.contentRect.height})}),(0,o.vJ)(()=>{const e=v.current;e&&y({width:e.clientWidth,height:e.clientHeight})},[y]);const M=(0,l.A)(()=>{const e=f.current;if(!e||!I)return;const t=e.getContext("2d"),{width:o,height:i}=e;if(!o||!i)return;t.save(),b.forEach(e=>{let{x:n,y:a,sizeFactor:s}=e;const c=(o-Math.max(o,250*S))/2,r=n*Math.max(o,250*S)+c,l=a*Math.max(i,250*S)+c,d=20*S*s*(c?.8:1);t.drawImage(I,r-d/2,l-d/2,d,d)}),t.restore(),n&&(t.save(),t.fillStyle=n,t.globalCompositeOperation="source-atop",t.fillRect(0,0,o,i),t.restore());const a=t.createRadialGradient(o/2,i/2,0,o/2,i/2,o/2);a.addColorStop(0,"#FFFFFF77"),a.addColorStop(1,"#FFFFFF"),t.save(),t.globalCompositeOperation="destination-out",t.fillStyle=a,t.fillRect(0,0,o,i),t.restore()});return(0,o.vJ)(()=>{M()},[I]),(0,o.vJ)(()=>{const{width:e,height:t}=C(),n=f.current;if(!e||!t)return;const o=Math.max(e,t);(0,i.RK)(()=>{n.width=o*S,n.height=o*S,M()})},[C,S]),(0,m.Y)("div",{ref:v,className:(0,s.A)("Af3tYFMg",A),style:(0,c.A)(`--_bg-1: ${t[0]}`,`--_bg-2: ${t[1]||t[0]}`),children:(0,m.Y)("canvas",{className:"GbpiDSS_",ref:f})})})},41512:(e,t,n)=>{n.d(t,{Y:()=>i});var o=n(43503);function i(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=o.A.get();return t.top<=n&&t.top+t.height>=0}},43581:(e,t,n)=>{n.d(t,{A:()=>$});var o=n(84051),i=n(13439),a=n(90709),s=n(91048),c=n(87357),r=n(60343),l=n(15283),d=n(17712),u=n(59030),h=n(14242),m=n(76023),p=n(63527),g=n(10722),A=n(82117),v=n(39351),f=n(29886),C=n(34201),y=n(68292),S=n(26875),I=n(96454),w=n(58443),R=n(5912),N=n(4438),b=n(9267),M=n(93879),x=n(20021);const P=1.5*m.$,k=6.5*m.$,Y=I.pz||I.Ni?2:5,T=I.pz||I.Ni?2:3,D=(0,o.ph)((0,i.EK)((e,t)=>{let{containerId:n}=t;const{activeReactions:o}=(0,s.nTw)(e),i=(0,s.xYJ)(e,"reactionEffects");return{activeReactions:o?.[n],withEffects:i}})(e=>{let{containerId:t,reaction:n,className:s,size:r=P,effectSize:l=k,activeReactions:u,localAmount:h,withEffects:m,observeIntersection:p}=e;const{stopActiveReaction:g}=(0,i.ko)(),v=(0,o.li)(),f=(0,o.li)(),[y,S]=(0,o.J0)([]),I=(0,R.Vz)(v,p),D=(0,o.Kr)(()=>u?.find(e=>(0,a.a0)(e,n)),[u,n]),L=Boolean(m&&D),F=y.length<Y;(0,A.A)(e=>{let[t]=e;L?!h||h<=(t||0)||F&&S(e=>[...e,Date.now()]):S([])},[h,F,L]);const{shouldRender:E}=(0,C.A)({ref:f,noMountTransition:!0,isOpen:L,className:"slow",withShouldRender:!0}),B=(0,d.A)(()=>{const e=y.slice(1);S(e),e.length||g({containerId:t,reaction:n})}),O=(0,c.A)(M.A.root,E&&M.A.animating,s);return(0,x.FD)("div",{className:O,ref:v,teactFastList:!0,children:[(0,x.Y)(b.A,{type:"gold",size:"adaptive",style:`width: ${r}px; height: ${r}px`},"icon"),E&&y.map(e=>(0,x.Y)(N.A,{ref:f,className:M.A.effect,size:l,tgsUrl:w.w.StarReactionEffect,play:I,noLoop:!0,forceAlways:!0,nonInteractive:!0,quality:T,onEnded:B},e))]})}));var L=n(11241),F=n(85118),E=n(64493),B=n(69988);const O=1.25*m.$;function K(e){return e.stars}const _=(0,o.ph)(e=>{let{reaction:t,containerId:n,isOwnMessage:s,recentReactors:r,className:l,chosenClassName:u,chatId:m,messageId:I,isOutside:w,observeIntersection:R,onClick:N,onPaidClick:b}=e;const{openStarsBalanceModal:M,resetLocalPaidReactions:P,openPaidReactionModal:k,requestWave:Y}=(0,i.ko)(),T=(0,o.li)(),_=(0,o.li)(),U=(0,o.li)(),$=(0,v.A)(),J="paid"===t.reaction.type,z=(0,p.A)(K),j=Boolean(z),H=(0,d.A)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;b?.(e)}),q=(0,d.A)(e=>{if("paid"===t.reaction.type)return e.stopPropagation(),void H();N?.(t.reaction)}),{isContextMenuOpen:G,handleBeforeContextMenu:V,handleContextMenu:W,handleContextMenuClose:X,handleContextMenuHide:Z}=(0,g.A)(T,"paid"!==t.reaction.type,void 0,void 0,void 0,!0);(0,o.vJ)(()=>{G&&(k({chatId:m,messageId:I}),X(),Z())},[X,Z,G,m,I]),(0,A.A)(e=>{let[n]=e;const o=t.localAmount,i=T.current;if(!o||!i||o===n?.localAmount)return;if(j&&o>z.balance.amount)return M({originReaction:{chatId:m,messageId:I,amount:o}}),void P({chatId:m,messageId:I});if(t.localAmount){const{left:e,top:t}=i.getBoundingClientRect(),n=e+i.offsetWidth/2,o=t+i.offsetHeight/2;Y({startX:n,startY:o})}const a=Number(getComputedStyle(i).scale)||1;U.current?.cancel(),U.current=i.animate([{scale:a},{scale:Math.min(1.2*a,3),offset:.2},{scale:1}],{duration:500*a,easing:"ease-out"})},[t,z?.balance,j,m,I]);const Q=(0,f.A)(t.localAmount),{shouldRender:ee}=(0,C.A)({isOpen:Boolean(t.localAmount),ref:_,className:"slow",withShouldRender:!0});return(0,x.FD)(E.A,{className:(0,c.A)(B.A.root,s&&B.A.own,J&&B.A.paid,w&&B.A.outside,(0,a.eu)(t)&&B.A.chosen,(0,a.eu)(t)&&u,l),size:"tiny",ref:T,onMouseDown:V,onContextMenu:W,onClick:q,children:["paid"===t.reaction.type?(0,x.FD)(x.FK,{children:[(0,x.Y)(F.A,{preset:"button"}),(0,x.Y)(D,{className:B.A.animatedEmoji,containerId:n,reaction:t.reaction,size:O,localAmount:t.localAmount,observeIntersection:R}),ee&&(0,x.Y)(y.A,{ref:_,text:`+${(0,h.Vw)($,t.localAmount||Q)}`,className:B.A.paidCounter})]}):(0,x.Y)(L.A,{className:B.A.animatedEmoji,containerId:n,reaction:t.reaction,size:O,observeIntersection:R}),r?.length?(0,x.Y)(S.A,{size:"mini",peers:r}):(0,x.Y)(y.A,{text:(0,h.Vw)($,t.count+(t.localAmount||0)),className:B.A.counter})]})});var U=n(92915);const $=(0,o.ph)(e=>{let{message:t,threadId:n,isOutside:h,maxWidth:m,metaChildren:p,observeIntersection:g,noRecentReactors:A,isCurrentUserPremium:v,tags:f,isAccountFrozen:C}=e;const{toggleReaction:y,addLocalPaidReaction:S,updateMiddleSearch:I,performMiddleSearch:w,openPremiumModal:R,resetLocalPaidReactions:N,showNotification:b,openFrozenAccountModal:M}=(0,i.ko)(),P=(0,u.A)(),{results:k,areTags:Y,recentReactions:T}=t.reactions,D=Boolean(t.areReactionsPossible&&t.reactions),L=(0,o.Kr)(()=>k.reduce((e,t)=>e+t.count,0),[k]),F=(0,o.Kr)(()=>{const e=(0,i.mS)();return T?.reduce((t,n)=>{const{reaction:o,peerId:i}=n,c=(0,a.Jj)(o),r=(0,s.PVB)(e,i);if(!r)return t;const l=t[c]||[];return l.push(r),t[c]=l,t},{})},[T]),E=(0,o.Kr)(()=>{const e=(0,r.bj)(t);return k.map(t=>{const n=(0,a.Jj)(t.reaction),o=F?.[n],i=L>3||A,s=Y?f?.[n]:void 0;return{reaction:t,reactionKey:n,messageKey:e,recentReactors:i?void 0:o,isChosen:(0,a.eu)(t),tag:s}})},[t,A,F,k,Y,f,L]),B=(0,d.A)(e=>{if(!C)return Y?v?(I({chatId:t.chatId,threadId:n,update:{savedTag:e}}),void w({chatId:t.chatId,threadId:n})):void R({initialSection:"saved_tags"}):void y({chatId:t.chatId,messageId:t.id,reaction:e});M()}),O=(0,o.Kr)(()=>k.find(e=>"paid"===e.reaction.type)?.localAmount||0,[k]),K=(0,d.A)(e=>{C?M():S({chatId:t.chatId,messageId:t.id,count:e})});(0,o.vJ)(()=>{O&&b({localId:(0,r.bj)(t),title:P("StarsSentTitle"),message:P("StarsSentText",O),actionText:P("StarsSentUndo"),cacheBreaker:O.toString(),action:{action:"resetLocalPaidReactions",payload:{chatId:t.chatId,messageId:t.id}},dismissAction:{action:"sendPaidReaction",payload:{chatId:t.chatId,messageId:t.id}},duration:5e3,shouldShowTimer:!0,disableClickDismiss:!0,icon:"star"})},[P,t,O]);const $=(0,d.A)(e=>{C?M():y({chatId:t.chatId,messageId:t.id,reaction:e})});return(0,l.A)(()=>()=>{N({chatId:t.chatId,messageId:t.id})}),(0,x.FD)("div",{className:(0,c.A)("Reactions",h&&"is-outside",D&&"is-service"),style:m?`max-width: ${m}px`:void 0,dir:P.isRtl?"rtl":"ltr",children:[E.map(e=>{let{reaction:n,recentReactors:o,messageKey:i,reactionKey:a,isChosen:s,tag:c}=e;return Y?(0,x.Y)(U.A,{className:"message-reaction",chosenClassName:"chosen",containerId:i,isOwnMessage:t.isOutgoing,isChosen:s,reaction:n.reaction,tag:c,withContextMenu:v,onClick:B,onRemove:$,observeIntersection:g},a):(0,x.Y)(_,{chatId:t.chatId,messageId:t.id,className:"message-reaction",chosenClassName:"chosen",containerId:i,isOwnMessage:t.isOutgoing,recentReactors:o,isOutside:h,reaction:n,onClick:B,onPaidClick:K,observeIntersection:g},a)}),p]})})},45470:(e,t,n)=>{n.d(t,{A:()=>d});var o=n(84051),i=n(32587),a=n(66644),s=n(96454),c=n(35297);const r=2,l=2;function d(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r,u=arguments.length>4?arguments[4]:void 0,h=arguments.length>5?arguments[5]:void 0;const m=(0,o.li)(),p=(0,o.li)();return(0,c.A)(()=>{t||(p.current=!1)},[e,t]),(0,o.vJ)(()=>{const o=m.current;if(!e||!o||t||p.current)return;p.current=!0;const c=new Image,r=()=>{const e=u||c.width,t=h||c.height,n=o.getContext("2d",{alpha:!1});(0,a.RK)(()=>{o.width=e,o.height=t,s.QH&&(n.filter=`blur(${d}px)`),n.drawImage(c,2*-d,2*-d,e+4*d,t+4*d),s.QH||(0,i.A)(n,0,0,e,t,d,l)})};c.onload=()=>{n?(0,a.YS)(r):r()},c.src=e},[e,t,h,u,d,n]),m}},45780:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(96454),i=n(87357),a=n(17712),s=n(59030),c=n(42452);var r=n(20021);const l=e=>{let{title:t,subtitle:n,avatarElement:l,inputElement:d,inputPosition:u="start",disabled:h,inactive:m,ripple:p,className:g,titleClassName:A,subtitleClassName:v,style:f,onClick:C,onDisabledClick:y}=e;const S=(0,s.A)(),I=!m&&!h,w=(0,a.A)(()=>{m||(h?y?.():C?.())});return(0,r.FD)("div",{className:(0,i.A)("OHkx_W75",n&&"neXqB2_A",h&&"tvZeVJPh",I&&"VUSwo4t5",l&&"dMT9byM6",g),onClick:w,style:f,dir:S.isRtl?"rtl":void 0,role:I?"button":void 0,tabIndex:I?0:void 0,children:[!h&&!m&&p&&(0,r.Y)(c.A,{}),Boolean(d)&&(0,r.Y)("div",{className:(0,i.A)("kmjqObdP","end"===u?"iqGhSQGm":"F0Hv3EQm"),children:d}),Boolean(l)&&(0,r.Y)("div",{className:"dnAaRPCo",children:l}),(0,r.Y)("div",{className:(0,i.A)("JSSC0N8V",A),children:t}),Boolean(n)&&(0,r.Y)("div",{className:(0,i.A)("OYmzCSp2",v),children:n}),!d&&o.pz&&(0,r.Y)("div",{className:"P53DrbWA"})]})}},49086:(e,t,n)=>{n.d(t,{C:()=>m,V:()=>h});var o=n(13439),i=n(23174),a=n(90709),s=n(3544),c=n(60343),r=n(43044),l=n(58849),d=n(4961),u=n(18501);function h(e){let{message:t,highlight:n,emojiSize:o,asPreview:i,truncateLength:s,isProtected:d,forcePlayback:h,shouldRenderAsHtml:m,isForMediaViewer:p,threadId:g,maxTimestamp:A}=e;const{text:v,entities:f}=t.content.text||{};if(!v){const e=(0,a.BN)((0,r.Yw)(),t)?.text;return e?[(0,l.A)(e,s)]:void 0}const C=(0,c.bj)(t);return(0,u.fd)({text:(0,l.A)(v,s),entities:f,highlight:n,emojiSize:o,shouldRenderAsHtml:m,containerId:`${p?"mv-":""}${C}`,asPreview:i,isProtected:d,forcePlayback:h,messageId:"id"in t?t.id:void 0,chatId:t.chatId,threadId:g,maxTimestamp:A})}function m(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:s.vs;const{entities:u}=t.content.text||{},m=(0,o.mS)(),p=(0,a.ni)(m,t),g=u?.some(e=>e.type===i.C7.Spoiler),A=u?.some(e=>e.type===i.C7.CustomEmoji);if(!g&&!A){const o=(0,l.A)((0,s.dS)(e,t,p,n),r);return c?(0,d.A)(o,["emoji","highlight"],{highlight:c}):(0,d.A)(o)}const v=!n&&(0,s.Su)(t),f=v?`${v} `:"",C=h({message:t,highlight:c,asPreview:!0,truncateLength:r}),y=(0,s.oL)(e,t,p,C);return[...(0,d.A)(f),...Array.isArray(y)?y:[y]].filter(Boolean)}},49746:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(84051),i=n(13439);function a(e,t,n,a,s){const{loadMessage:c}=(0,i.ko)();(0,o.vJ)(()=>{s||t&&!n&&c({chatId:e,messageId:t,replyOriginForId:a})},[s,e,n,t,a])}},54960:(e,t,n)=>{n.d(t,{A:()=>P});var o=n(84051),i=n(13439),a=n(31481),s=n(66644),c=n(90709),r=n(70636),l=n(91048),d=n(87357),u=n(87894),h=n(79824),m=n(96374),p=n(17712),g=n(59030),A=n(19806),v=n(46222),f=n(40664),C=n(52745),y=n(24956),S=n(21849),I=n(34431),w=n(18276),R=n(10187),N=n(45780),b=n(31722),M=n(20021);const x="PeerPickerItem",P=(0,o.ph)(e=>{let{className:t,categories:n,itemIds:P,categoryPlaceholderKey:k,filterValue:Y,filterPlaceholder:T,notFoundText:D,searchInputId:L,itemClassName:F,isLoading:E,noScrollRestore:B,isSearchable:O,lockedUnselectedSubtitle:K,forceShowSelf:_,isViewOnly:U,itemInputType:$,withStatus:J,withPeerTypes:z,withPeerUsernames:j,withDefaultPadding:H,onFilterChange:q,onDisabledClick:G,onLoadMore:V,...W}=e;const X=(0,g.A)(),Z=W.allowMultiple,Q=Z?W.lockedSelectedIds:void 0,ee=Z?W.lockedUnselectedIds:void 0,te=(0,o.Kr)(()=>Z?W.selectedCategories:W.selectedCategory?[W.selectedCategory]:h.p,[Z,W.selectedCategory,W.selectedCategories]),ne=(0,o.Kr)(()=>Z?W.selectedIds:W.selectedId?[W.selectedId]:h.p,[Z,W.selectedId,W.selectedIds]),oe=(0,o.li)(),ie=ne.length>10;(0,o.vJ)(()=>{if(!O)return;const e=window.setTimeout(()=>{(0,s.YS)(()=>{oe.current?.focus()})},500);return()=>{window.clearTimeout(e)}},[O]);const ae=(0,o.Kr)(()=>new Set(Q),[Q]),se=(0,o.Kr)(()=>new Set(ee),[ee]),ce=(0,o.Kr)(()=>ne.filter(e=>!ae.has(e)),[ae,ne]),re=(0,o.Kr)(()=>n?(0,u.dU)(n,"type"):{},[n]),le=(0,o.Kr)(()=>{if(Y)return P;const e=[],t=[],n=[];return P.forEach(o=>{ae.has(o)?e.push(o):se.has(o)?n.push(o):t.push(o)}),e.concat(t,n)},[Y,P,ae,se]),de=(0,p.A)(e=>{if(ae.has(e))G?.(e,!0);else if(se.has(e))G?.(e,!1);else{if(Z&&re[e]){const t=re[e].type,n=te?.slice()||[];return n.includes(t)?n.splice(n.indexOf(t),1):n.push(t),void W.onSelectedCategoriesChange?.(n)}if(Z){const t=ne.slice();return t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),void W.onSelectedIdsChange?.(t)}re[e]?W.onSelectedCategoryChange?.(re[e].type):W.onSelectedIdChange?.(e)}}),ue=(0,p.A)(e=>{const{value:t}=e.currentTarget;q?.(t)}),[he,me]=(0,m.A)(V,le,Boolean(Y)),pe=(0,o.hb)((e,t)=>{const n=(0,i.mS)(),o=t?re[e]:void 0,s=t?void 0:(0,l.PVB)(n,e),u=s||o;if(!u)return a.Oig?(0,M.FD)("div",{children:["No peer or category with ID",e]},e):void 0;const h=s&&!(0,r.vj)(s)?s.isSelf&&!_:void 0,m=se.has(e),p=ae.has(e),g=m||p,v=o?te?.includes(o.type):ne.includes(e),[f,C]=function(){if(m)return[K];if(s){if(j){const e=(0,c.Kl)(s);if(e)return[`@${e}`]}if(J){if((0,r.vj)(s))return[(0,c.sT)(X,s)];const e=(0,l.K0y)(n,s.id);return[(0,c.CD)(X,s,e),(0,d.A)((0,c.PF)(s,e,!0)&&b.A.onlineStatus)]}if(z){const e=(0,r.cy)(s);return e&&[X(e)]}}}()||[];return(0,M.Y)(N.A,{className:(0,d.A)(x,F),title:(0,M.Y)(I.A,{peer:u}),avatarElement:(0,M.Y)(S.A,{peer:s||o,isSavedMessages:h,size:"medium"}),subtitle:f,subtitleClassName:C,disabled:g,inactive:U,ripple:!0,inputElement:g?(0,M.Y)(w.A,{name:"lock-badge"}):"radio"===$?(0,M.Y)(y.A,{checked:v,disabled:g,onlyInput:!0}):"checkbox"===$?(0,M.Y)(A.A,{checked:v,disabled:g,onlyInput:!0}):void 0,inputPosition:"end",onClick:()=>de(e),onDisabledClick:G&&(()=>G(e,p))},e)},[re,_,U,F,$,X,ae,se,K,G,te,ne,z,J,j]),ge=(0,o.Kr)(()=>{if(n?.length)return(0,M.FD)("div",{children:[k&&(0,M.Y)("div",{className:b.A.pickerCategoryTitle,children:X(k)}),n?.map(e=>pe(e.type,!0)),(0,M.Y)("div",{className:b.A.pickerCategoryTitle,children:X("FilterChats")})]},"categories")},[n,k,X,pe]);return(0,M.FD)("div",{className:(0,d.A)(b.A.container,t),children:[O&&(0,M.FD)("div",{className:(0,d.A)(b.A.header,"custom-scroll"),dir:X.isRtl?"rtl":void 0,children:[te?.map(e=>(0,M.Y)(R.A,{className:b.A.peerChip,customPeer:re[e],onClick:de,clickArg:e,canClose:!0})),Q?.map((e,t)=>(0,M.Y)(R.A,{className:b.A.peerChip,peerId:e,isMinimized:ie&&t<ne.length-5,forceShowSelf:_,onClick:de,clickArg:e})),ce.map((e,t)=>(0,M.Y)(R.A,{className:b.A.peerChip,peerId:e,isMinimized:ie&&t+(Q?.length||0)<ne.length-5,canClose:!0,onClick:de,clickArg:e})),(0,M.Y)(f.A,{id:L,ref:oe,value:Y,onChange:ue,placeholder:T||X("SelectChat")})]}),he?.length?(0,M.Y)(v.A,{className:(0,d.A)(b.A.pickerList,H&&b.A.padded,"custom-scroll"),items:he,itemSelector:`.${x}`,beforeChildren:ge,onLoadMore:me,noScrollRestore:B,children:he.map(e=>pe(e))}):E||!he||he.length?(0,M.Y)(C.A,{}):(0,M.Y)("p",{className:b.A.noResults,children:D||"Sorry, nothing found."})]})})},56133:(e,t,n)=>{n.d(t,{A:()=>i});var o=n(16581);function i(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,o.A)(e=>{e()},i,e,t,n)}},57446:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(13439),i=n(66644),a=n(91048),s=n(19822);const c=300,r=new Map;function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c;(0,a.PKK)((0,o.mS)())||(n=0);const l="rtl"===e.getAttribute("dir"),{scrollLeft:d,offsetWidth:u,scrollWidth:h,dataset:{scrollId:m}}=e;let p=t-d;if(p<0){const e=-d*(l?-1:1);p=Math.max(p,e)}else if(p>0){const e=h-(d+u);p=Math.min(p,e)}if(0===p)return Promise.resolve();m&&r.has(m)&&r.get(m)();const g=d+p;return new Promise(t=>{(0,i.RK)(()=>{if(0===n)return e.scrollLeft=g,void t();let o=!1;const a=Math.random().toString();e.dataset.scrollId=a,r.set(a,()=>{o=!0}),e.style.scrollSnapType="none";const c=Date.now();function l(){e.style.scrollSnapType="",delete e.dataset.scrollId,r.delete(a)}(0,s.i0)(()=>{if(o)return l(),!1;const i=Math.min((Date.now()-c)/n,1),a=p*(1-function(e){return 1-(1-e)**3.5}(i));return e.scrollLeft=Math.round(g-a),i>=1&&(l(),t()),i<1},i.RK)})})}},58968:(e,t,n)=>{n.d(t,{I5:()=>s,LS:()=>a,V2:()=>i,lw:()=>o});const o={isCustomPeer:!0,type:"premium",titleKey:"PrivacyPremium",subtitleKey:"PrivacyPremiumText",avatarIcon:"star",isAvatarSquare:!0,withPremiumGradient:!0},i=[{isCustomPeer:!0,type:"contacts",titleKey:"FilterContacts",avatarIcon:"user",isAvatarSquare:!0,peerColorId:5},{isCustomPeer:!0,type:"nonContacts",titleKey:"FilterNonContacts",avatarIcon:"non-contacts",isAvatarSquare:!0,peerColorId:4},{isCustomPeer:!0,type:"groups",titleKey:"FilterGroups",avatarIcon:"group",isAvatarSquare:!0,peerColorId:3},{isCustomPeer:!0,type:"channels",titleKey:"FilterChannels",avatarIcon:"channel",isAvatarSquare:!0,peerColorId:1},{isCustomPeer:!0,type:"bots",titleKey:"FilterBots",avatarIcon:"bots",isAvatarSquare:!0,peerColorId:6}],a=[{isCustomPeer:!0,type:"excludeMuted",titleKey:"FilterMuted",avatarIcon:"mute",isAvatarSquare:!0,peerColorId:6},{isCustomPeer:!0,type:"excludeRead",titleKey:"FilterRead",avatarIcon:"readchats",isAvatarSquare:!0,peerColorId:4},{isCustomPeer:!0,type:"excludeArchived",titleKey:"FilterArchived",avatarIcon:"archive",isAvatarSquare:!0,peerColorId:5}],s={isCustomPeer:!0,type:"hidden",titleKey:"StarsTransactionHidden",avatarIcon:"author-hidden",peerColorId:4}},64489:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(84051),i=n(87357),a=n(95807),s=n(37661),c=n(17712),r=n(83057),l=n(4438);const d="lM2usrZU";var u=n(20021);const h=new Set,m=(0,o.ph)(function(e){const{previewUrl:t,thumbDataUri:n,className:o,...m}=e,[p,,g]=(0,s.A)(Boolean(n)),A=(0,r.A)(p),[v,f,C]=(0,s.A)(h.has(t)),y=(0,r.A)(v),[S,I]=(0,s.A)(!1),w=(0,c.A)(()=>{f(),h.add(t)}),R=(0,c.A)(()=>{g(),C(),setTimeout(I,300)}),{size:N}=e;return(0,u.FD)("div",{className:(0,i.A)(o,"xCi2f0YH"),style:(0,a.A)(void 0!==N&&`width: ${N}px; height: ${N}px;`),children:[n&&!S&&(0,u.Y)("img",{src:n,className:(0,i.A)(d,A),draggable:!1}),t&&!S&&(0,u.Y)("img",{src:t,className:(0,i.A)(d,y),draggable:!1,onLoad:w}),(0,u.Y)(l.A,{...m,onLoad:R})]})})},65632:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(13439),a=n(31481),s=n(74824),c=n(87679);const r=(e,t)=>{const{setThemeSettings:n}=(0,i.ko)(),[r,l]=(0,o.J0)(t);return(0,o.vJ)(()=>{t&&(t.startsWith("#")?l(t):s.fetch(a.nfi,e,s.Type.Blob).then(e=>{const t=URL.createObjectURL(e);(0,c.NN)(t).then(()=>{l(`url(${t})`)})}).catch(()=>{n({theme:e,background:void 0,backgroundColor:void 0,isBlurred:!0,patternColor:"dark"===e?a.MkD:a.be8})}))},[t,e]),t?r:void 0}},66833:(e,t,n)=>{function o(e){return"starGift"===e.type?e.sticker:e.attributes.find(e=>"model"===e.type)?.sticker}function i(e){return"starGift"===e.type?e.availabilityTotal:e.totalCount}function a(e){if("starGiftUnique"===e.type)return function(e){const t=e.find(e=>"model"===e.type),n=e.find(e=>"backdrop"===e.type),o=e.find(e=>"pattern"===e.type);return{model:t,originalDetails:e.find(e=>"originalDetails"===e.type),pattern:o,backdrop:n}}(e.attributes)}n.d(t,{UC:()=>i,uc:()=>a,yQ:()=>o})},68292:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(84051),i=n(13439),a=n(91048),s=n(87357),c=n(37836),r=n(30857),l=n(39351),d=n(73767);var u=n(20021);let h=0;const m=(0,c.Fe)(()=>{h=0}),p=(0,o.ph)(e=>{let{text:t,className:n,isDisabled:c,ref:p}=e;const{isRtl:g}=(0,l.A)(),A=(0,d.A)(t),v=(0,r.A)(),f=!(!(!c&&(0,a.PKK)((0,i.mS)())&&void 0!==A&&A!==t)||h>=10||(0===h&&m(),h++,0)),C=(0,o.Kr)(()=>f?function(e,t){const n=[],o=e.length,i=t?.length??0;for(let a=0;a<=o;a++){const s=o-a,c=i-a;t&&c>=0&&e[s]!==t[c]?n.unshift((0,u.FD)("div",{className:"IYTzbS8o",children:[(0,u.Y)("div",{className:"Jw1oQFdk",children:e[s]??""}),(0,u.Y)("div",{className:"TZfEz3sc",children:t[c]}),(0,u.Y)("div",{className:"Y9ied8_t",children:e[s]??""})]})):n.unshift((0,u.Y)("span",{children:e[s]??""}))}return n}(t,A):t,[f,A,t]);return(0,o.vJ)(()=>{if(!f)return;const e=window.setTimeout(()=>{v()},200);return()=>{window.clearTimeout(e)}},[f,t]),(0,u.Y)("span",{ref:p,className:(0,s.A)(n,!c&&"tgKbsVmz"),dir:g?"rtl":void 0,children:C})})},69988:(e,t,n)=>{n.d(t,{A:()=>o});const o={root:"gXO57D98",chosen:"VXSJn0Sm",paid:"N3lcrsh8",outside:"Hqw10FGl","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",paidCounter:"CW4UO1n3"}},73104:(e,t,n)=>{let o,i;n.d(t,{M6:()=>r,v5:()=>l});const a={Down:!0,ArrowDown:!0,Up:!0,ArrowUp:!0,Left:!0,ArrowLeft:!0,Right:!0,ArrowRight:!0," ":!0,PageUp:!0,PageDown:!0,End:!0,Home:!0,Tab:!0},s=e=>{const t="deltaY"in e?e.deltaY:(e=>"changedTouches"in e?e.changedTouches[0].clientY:0)(e);if(!o||!o.contains(e.target)||o.scrollTop<=0&&t<=0||o.scrollTop>=o.scrollHeight-o.offsetHeight&&t>=0){if(i&&e.target.closest(i))return;e.preventDefault()}};function c(e){a[e.key]&&!function(e){if(!(e&&e instanceof HTMLElement))return!1;const t=e,n=t.tagName.toLowerCase();if("textarea"===n)return!0;if("input"!==n)return!1;const o=t.getAttribute("type");return!!o&&["text","password","number","email","tel","url","search","date","datetime","datetime-local","time","month","week"].indexOf(o.toLowerCase())>-1}(e.target)&&e.preventDefault()}function r(e,t){return o=e,i=t,document.addEventListener("wheel",s,{passive:!1}),document.addEventListener("touchmove",s,{passive:!1}),document.onkeydown=c,l}function l(){o=void 0,i=void 0,document.removeEventListener("wheel",s),document.removeEventListener("touchmove",s),document.onkeydown=null}},74984:(e,t,n)=>{n.d(t,{Jm:()=>l,Rh:()=>s,g5:()=>r,ic:()=>c});var o=n(84051),i=n(49763),a=n(30857);function s(e){const t=(0,a.A)();return(0,o.vJ)(()=>(0,i.Yw)(e,t),[e,t]),(0,i.YA)(e)}function c(){const e=(0,a.A)();return(0,o.vJ)(()=>(0,i.P1)(e),[e]),(0,i.PZ)()}function r(){const e=(0,a.A)();return(0,o.vJ)(()=>(0,i.BU)(e),[e]),(0,i.jn)()}function l(){const e=(0,a.A)();return(0,o.vJ)(()=>(0,i.dk)(e),[e]),(0,i.Xq)()}},76283:(e,t,n)=>{n.d(t,{A:()=>P});var o=n(84051),i=n(13439),a=n(90709),s=n(87357),c=n(17712),r=n(59030),l=n(18276),d=n(64493),u=n(96530),h=n(58443),m=n(76023),p=n(10722),g=n(4438),A=n(87412);const v="uGUjDZKl",f="M62HGuIV",C="WMpEr5XQ";var y=n(20021);const S=2*m.$,I=(0,o.ph)(e=>{let{reaction:t,chosen:n,isReady:i,noAppearAnimation:a,style:r,isLocked:d,onToggleReaction:u,onSendPaidReaction:m,onShowPaidReactionModal:I}=e;const w=(0,o.li)(),R=(0,c.A)(()=>{"paid"!==t.type?u(t):m?.()}),{isContextMenuOpen:N,handleBeforeContextMenu:b,handleContextMenu:M,handleContextMenuClose:x,handleContextMenuHide:P}=(0,p.A)(w,"paid"!==t.type,void 0,void 0,void 0,!0);return(0,o.vJ)(()=>{N&&(I?.(),x(),P())},[x,I,P,N]),(0,y.FD)("div",{className:(0,s.A)(v,"oc1hpMwv",n&&"paid"!==t.type&&f,!a&&i&&"sx6RTuAU",a&&"kqcWe4tf"),ref:w,style:r,onClick:R,onMouseDown:b,onContextMenu:M,children:["paid"===t.type?(0,y.Y)(g.A,{tgsUrl:h.w.StarReaction,size:S,noLoop:!1}):(0,y.Y)(A.A,{documentId:t.documentId,size:S}),d&&(0,y.Y)(l.A,{className:C,name:"lock-badge"})]})});var w=n(37661),R=n(62587),N=n(18104);const b=2*m.$,M=(0,o.ph)(e=>{let{reaction:t,isReady:n,noAppearAnimation:o,chosen:i,isLocked:a,onToggleReaction:c}=e;const r=(0,R.A)(`sticker${t.appearAnimation?.id}`,!n||o),d=(0,R.A)(`document${t.selectAnimation?.id}`,!n||o),u=(0,R.A)(`document${t.staticIcon?.id}`,!o),[h,m]=(0,w.A)(),[p,,g]=(0,w.A)(!0),[A,S,I]=(0,w.A)();return(0,y.FD)("div",{className:(0,s.A)(v,i&&f),onClick:function(){c(t.reaction)},onMouseEnter:n&&!p?S:void 0,children:[o&&(0,y.Y)("img",{className:"MZ2tH980",src:u,alt:t.reaction.emoticon,draggable:!1}),!h&&!o&&(0,y.Y)(N.A,{tgsUrl:r,play:p,noLoop:!0,size:b,onEnded:g,forceAlways:!0},t.appearAnimation?.id),!p&&!o&&(0,y.Y)(N.A,{tgsUrl:d,play:A,noLoop:!0,size:b,onLoad:m,onEnded:I,forceAlways:!0},t.selectAnimation?.id),a&&(0,y.Y)(l.A,{className:C,name:"lock-badge"})]})}),x=(0,s.x)("ReactionSelector"),P=(0,o.ph)(e=>{let{allAvailableReactions:t,topReactions:n,defaultTagReactions:h,enabledReactions:m,currentReactions:p,reactionsLimit:g,isPrivate:A,isReady:v,canPlayAnimatedEmojis:f,className:C,isCurrentUserPremium:S,isInSavedMessages:w,isInStoryViewer:R,isForEffects:N,effectReactions:b,isWithPaidReaction:P,onClose:k,onToggleReaction:Y,onSendPaidReaction:T,onShowPaidReactionModal:D,onShowMore:L}=e;const{openPremiumModal:F}=(0,i.ko)(),E=(0,o.li)(),B=(0,r.A)(),O=w&&!S&&!R,K=Boolean(g&&p&&p.length>=g),_=(0,o.Kr)(()=>{const e=K?p?.map(e=>e.reaction):N?b:w?h:"some"===m?.type?m.allowed:t?.map(e=>e.reaction),o=e?.map(e=>{const n="custom"===e.type,o=t?.find(t=>(0,a.a0)(t.reaction,e));return N?o:(n||o)&&!o?.isInactive&&(A||K||m&&(0,a.A3)(e,m))?n?e:o:void 0}).filter(Boolean)||[],i=(0,a.fu)(o,n);return P&&i.unshift({type:"paid"}),i},[t,p,h,m,w,A,n,N,b,K,P]),U=(0,o.Kr)(()=>8===_.length?_:_.slice(0,7),[_]),$=U.length<_.length,J=(0,o.Kr)(()=>{const e=p?.filter(e=>{let{chosenOrder:t}=e;return void 0!==t})||[];return new Set(e.map(e=>{let{reaction:t}=e;return U.findIndex(e=>e&&(0,a.a0)("reaction"in e?e.reaction:e,t))}))},[p,U]),z=(0,c.A)(()=>{const e=E.current?.getBoundingClientRect()||{x:0,y:0};L({x:e.x,y:e.y})}),j=(0,c.A)(()=>{k?.(),F({initialSection:"saved_tags"})}),H=(0,o.Kr)(()=>{if(w){if(!S){const e=B("lng_subscribe_tag_about").split("{link}");return(0,y.FD)("span",{children:[e[0],(0,y.Y)(u.A,{isPrimary:!0,onClick:j,children:B("lng_subscribe_tag_link")}),e[1]]})}return B("SavedTagReactionsHint2")}return R?B("StoryReactionsHint"):N?B("AddEffectMessageHint"):void 0},[S,w,R,B,N]);if(U.length)return(0,y.FD)("div",{className:(0,s.A)(x("&"),C),ref:E,children:[(0,y.Y)("div",{className:x("bubble-small",B.isRtl&&"isRtl")}),(0,y.FD)("div",{className:x("items-wrapper"),children:[(0,y.Y)("div",{className:x("bubble-big",B.isRtl&&"isRtl")}),(0,y.FD)("div",{className:x("items"),children:[H&&(0,y.Y)("div",{className:x("hint"),children:H}),(0,y.FD)("div",{className:x("reactions"),dir:B.isRtl?"rtl":void 0,children:[U.map((e,t)=>"reaction"in e?(0,y.Y)(M,{isReady:v,onToggleReaction:Y,reaction:e,noAppearAnimation:!f,chosen:J.has(t),isLocked:O},(0,a.Jj)(e.reaction)):(0,y.Y)(I,{isReady:v,onToggleReaction:Y,onSendPaidReaction:T,onShowPaidReactionModal:D,reaction:e,noAppearAnimation:!f,chosen:J.has(t),isLocked:O,style:`--_animation-delay: ${20*(7-t)}ms`},(0,a.Jj)(e))),$&&(0,y.Y)(d.A,{color:"translucent",className:x("show-more"),onClick:z,children:(0,y.Y)(l.A,{name:"down"})})]})]})]})]})})},79174:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(84051),i=n(66644),a=n(43874);const s=500,c=300;function r(e,t,n){const{isMobile:r}=(0,a.Ay)();(0,o.vJ)(()=>{t?r||setTimeout(()=>{(0,i.RK)(()=>{e.current?.isConnected&&e.current.focus()})},s):(e.current?.isConnected&&e.current.blur(),n&&setTimeout(n,c))},[e,r,t,n])}},79519:(e,t,n)=>{n.d(t,{A:()=>u});var o=n(84051),i=n(61433),a=n(31481),s=n(66644),c=n(81954);const r=500,l=a.nxZ,d=20;function u(e){let{elementRef:t,chatId:n,isFocused:a,focusDirection:u,noFocusHighlight:h,isResizingContainer:m,isJustAdded:p,isQuote:g,scrollTargetPosition:A}=e;const v=(0,o.li)(!p);(0,o.Nf)(()=>{const e=v.current;if(v.current=!1,a&&t.current){const n=t.current.closest(".MessageList"),o=h,a=A||o?"end":"centerOrTop",p=()=>{const e=void 0!==u?o?r:l:void 0,h=(0,c.Ay)({container:n,element:t.current,position:a,margin:d,maxDistance:e,forceDirection:u,forceNormalContainerHeight:m,shouldReturnMutationFn:!0});if(g){const e=t.current.querySelector(".is-quote");e&&(0,s.RK)(()=>{(0,i.YM)(e,"animate")})}return h};e?(0,s.gm)(p):(0,s.YS)(()=>{(0,s.RK)(p())})}},[t,n,a,u,h,m,g,A])}},79577:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(84051),i=n(23174),a=n(90709),s=n(62587),c=n(64489),r=n(20021);const l=(0,o.ph)(function(e){const{sticker:t,noLoad:n,forcePreview:o,...l}=e,d=t?.thumbnail?.dataUri,u=t&&(0,a.Mw)(t,"full"),h=(0,s.A)(t?(0,a.Mw)(t,"preview"):void 0,n&&!o,i.qZ.BlobUrl),m=(0,s.A)(u,n);return(0,r.Y)(c.A,{tgsUrl:m,previewUrl:h,thumbDataUri:d,...l})})},79582:(e,t,n)=>{n.d(t,{A:()=>r});var o=n(13439),i=n(91048),a=n(87894);const s=3e9,c=3e8;function r(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const l=(0,o.mS)();return(0,a.My)(e,e=>{if(e===r)return 1/0;const o=(0,i.hds)(l,e);if(!o)return 0;let a=0;const d=(0,i.yHC)(l,e);return d&&(a+=d.date),t&&o.isVerified&&(a+=s),n&&n.includes(e)&&(a=Date.now()+c+(n.length-n.indexOf(e))),a},"desc")}},80539:(e,t,n)=>{n.d(t,{Ay:()=>r,g4:()=>l,qh:()=>s});var o=n(23174),i=n(31481),a=n(96454);const s={B:o.C7.Bold,STRONG:o.C7.Bold,I:o.C7.Italic,EM:o.C7.Italic,INS:o.C7.Underline,U:o.C7.Underline,S:o.C7.Strike,STRIKE:o.C7.Strike,DEL:o.C7.Strike,CODE:o.C7.Code,PRE:o.C7.Pre,BLOCKQUOTE:o.C7.Blockquote},c=3;function r(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=document.createElement("div");r.innerHTML=n?e:function(e){let t=e.slice(0);return t=t.replace(/&nbsp;/g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/(?!<(code|pre)[^<]*|<\/)[`]{1}([^`\n]+)[`]{1}(?![^<]*<\/(code|pre)>)/g,"<code>$2</code>"),a.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="${o.C7.Spoiler}">$2</span>`),t}(t?function(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${i.kNZ}+?)\\)`,"g"),(e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`https://${n}`}">${t}</a>`)}(e):e),l(r);const d=r.innerText.trim().replace(/\u200b+/g,"");let u=-r.innerText.indexOf(d[0]),h=0;const m=[];function p(e){if(e.nodeType===Node.COMMENT_NODE)return;const{index:t,entity:n}=function(e,t,n){const i=function(e){if(e instanceof HTMLElement&&e.dataset.entityType)return e.dataset.entityType;if(s[e.nodeName])return s[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===o.C7.MentionName?o.C7.MentionName:t.dataset.entityType===o.C7.Url?o.C7.Url:t.href.startsWith("mailto:")?o.C7.Email:t.href.startsWith("tel:")?o.C7.Phone:t.href!==t.textContent?o.C7.TextUrl:o.C7.Url}return"SPAN"===e.nodeName?e.dataset.entityType:"IMG"===e.nodeName&&e.dataset.documentId?o.C7.CustomEmoji:void 0}(e);if(!i||!e.textContent)return{index:n,entity:void 0};const a=t.indexOf(e.textContent,n),c=a>=0?a:n,r=t.substring(0,c).length,{length:l}=t.substring(c,c+e.textContent.length);if(i===o.C7.TextUrl)return{index:c,entity:{type:i,offset:r,length:l,url:e.href}};if(i===o.C7.MentionName)return{index:c,entity:{type:i,offset:r,length:l,userId:e.dataset.userId}};if(i===o.C7.Pre)return{index:c,entity:{type:i,offset:r,length:l,language:e.dataset.language}};if(i===o.C7.CustomEmoji)return{index:c,entity:{type:i,offset:r,length:l,documentId:e.dataset.documentId}};if(i===o.C7.Timestamp){const t=Number(e.dataset.timestamp);return Number.isNaN(t)?{index:c,entity:void 0}:{index:c,entity:{type:i,offset:r,length:l,timestamp:t}}}return{index:c,entity:{type:i,offset:r,length:l}}}(e,d,u);if(n)u=t,m.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;u+=e.textContent.length}e.hasChildNodes()&&h<=c&&(h+=1,Array.from(e.childNodes).forEach(p))}return Array.from(r.childNodes).forEach(e=>{h=1,p(e)}),{text:d,entities:m.length?m:void 0}}function l(e){e.querySelectorAll("img").forEach(e=>{e.dataset.documentId?e.textContent=e.alt||"":e.replaceWith(e.alt||"")})}},81686:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(31481);const i=1;function a(){const e=window.getSelection();let t=e?.rangeCount?e.getRangeAt(0).cloneContents():void 0;const n=e?.focusNode&&e.focusOffset>0&&s(e.focusNode,o.zPk);if(!t||0===t.childElementCount)return;const a=Array.from(t.children).reduce((e,t)=>t.nodeType===i&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce((e,t)=>e.concat(Number(t.dataset.messageId)),e):t.nodeType===i&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e,[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n||a.pop(),a}function s(e,t){return!(e.nodeType!==i||!e.classList.contains(t))||!!e.parentNode&&s(e.parentNode,t)}},81949:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(87357);var i=n(20021);const a=e=>{let{children:t,className:n,onClick:a,onMouseDown:s}=e;return(0,i.Y)("div",{className:(0,o.A)("hJUqHi4B",a&&"hjDEmFaT",n),onClick:a,onMouseDown:s,children:t})}},81954:(e,t,n)=>{n.d(t,{Ay:()=>g,H$:()=>C,_v:()=>A,o8:()=>f});var o=n(84051),i=n(13439),a=n(89925),s=n(31481),c=n(66644),r=n(91048),l=n(96454),d=n(16460),u=n(19822);let h,m,p=!1;function g(e){h=e;const t=v(e);if(e.shouldReturnMutationFn)return t;(0,c.RK)(t)}function A(){p&&((0,u.vk)(),(0,c.YS)(()=>{(0,c.RK)(v(h))}))}function v(e){const{container:t,element:n,position:g,margin:A=0,maxDistance:v=s.nxZ,forceDirection:f,forceNormalContainerHeight:C}=e;let I=e.forceDuration;f!==a.CC.Static&&(0,r.PKK)((0,i.mS)())||(I=0);const{offsetHeight:w}=n,{scrollTop:R,clientHeight:N,scrollHeight:b}=t,M=(0,d.A)(n,t).top,x=C&&t.dataset.normalHeight?Number(t.dataset.normalHeight):N;let P;switch(g){case"start":P=M-A+(l.Ni?1:0);break;case"end":P=M+w+A-x;break;case"nearest":case"center":case"centerOrTop":P=w<x?M+w/2-x/2:M-A}const k=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.nxZ,o=arguments.length>3?arguments[3]:void 0;const{scrollTop:i}=e;if(void 0===o){const e=t-i;if(e<-n)return i+(e+n);if(e>n)return i+(e-n)}else{if(o===a.CC.Up)return t+n;if(o===a.CC.Down)return Math.max(0,t-n)}return i}(t,P,v,f);let Y=P-k;if(Y<0){const e=-k;Y=Math.max(Y,e)}else if(Y>0){const e=b-(k+x);Y=Math.min(Y,e)}const T=Math.abs(Y);return()=>{if(T<1)return void(R!==k&&(t.scrollTop=k));const e=k+Y;if(0===I)return void(t.scrollTop=e);const n=T<=s.s8T?y:S,i=I||s.SKD+T/s.nxZ*(s.OzO-s.SKD),a=Date.now();p=!0;const r=m;m=(0,o.VK)(void 0,!0),r?.(),(0,u.S0)(()=>{const o=Math.min((Date.now()-a)/i,1),s=Y*(1-n(o)),c=Math.round(e-s);return t.scrollTop=c,p=o<1&&c!==e,p||(h=void 0,m?.(),m=void 0),p},c.RK)}}function f(){return p}function C(){m(),m=void 0}function y(e){return 1-(1-e)**3.5}function S(e){return 1-(1-e)**6}},83594:(e,t,n)=>{n.d(t,{A:()=>h});var o=n(84051),i=n(90709),a=n(96454),s=n(87357),c=n(95807),r=n(62587),l=n(87412);const d="PZAuNVZH";var u=n(20021);const h=(0,o.ph)(e=>{let{reaction:t,isLottie:n,className:h,particleSize:m,onEnded:p}=e;const g=(0,i.aL)(t.documentId,!0),A=(0,r.A)(n?void 0:g),v=(0,o.Kr)(()=>a.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}`}(m)):[],[m]);if(A||n)return(0,u.Y)("div",{className:(0,s.A)("aInga6VW",h),style:(0,c.A)(Boolean(m)&&`--particle-size: ${m}px`),children:v.map((e,o)=>{const i=`--offset-path: path('${e}');`;return n?(0,u.Y)(l.A,{documentId:t.documentId,className:d,style:i,withSharedAnimation:!0,size:m,onAnimationEnd:0===o?p:void 0}):(0,u.Y)("img",{src:A,alt:"",className:d,style:i,draggable:!1,onAnimationEnd:0===o?p:void 0})})})})},92915:(e,t,n)=>{n.d(t,{A:()=>S});var o=n(84051),i=n(13439),a=n(87357),s=n(76023),c=n(10722),r=n(37661),l=n(17712),d=n(59030),u=n(11241),h=n(64493),m=n(40664),p=n(22337);var g=n(20021);const A=(0,o.ph)(e=>{let{isOpen:t,title:n,subtitle:i,placeholder:a,submitText:s,maxLength:c,initialValue:r="",onClose:u,onSubmit:A}=e;const v=(0,d.A)(),[f,C]=(0,o.J0)(r),y=(0,l.A)(e=>{C(e.target.value)}),S=(0,l.A)(()=>{A(f)});return(0,g.FD)(p.A,{className:"narrow",title:n,isOpen:t,onClose:u,isSlim:!0,children:[Boolean(i)&&(0,g.Y)("div",{className:"cGrbcqD_",children:i}),(0,g.Y)(m.A,{placeholder:a,value:f,onChange:y,maxLength:c,teactExperimentControlled:!0}),(0,g.FD)("div",{className:"dialog-buttons mt-2",children:[(0,g.Y)(h.A,{className:"confirm-dialog-button",onClick:S,children:s||v("Save")}),(0,g.Y)(h.A,{className:"confirm-dialog-button",isText:!0,onClick:u,children:v("Cancel")})]})]})});var v=n(71429),f=n(24433),C=n(69988);const y=1.25*s.$,S=(0,o.ph)(e=>{let{reaction:t,tag:n,containerId:s,isChosen:m,isOwnMessage:p,className:S,chosenClassName:I,withCount:w,isDisabled:R,withContextMenu:N,observeIntersection:b,onClick:M,onRemove:x}=e;const{editSavedReactionTag:P}=(0,i.ko)(),k=(0,o.li)(),Y=(0,o.li)(),T=(0,d.A)(),[D,L,F]=(0,r.A)(),{title:E,count:B}=n||{},O=Boolean(E||w&&B),K=(0,l.A)(()=>{M?.(t)}),_=(0,l.A)(()=>{x?.(t)}),U=(0,l.A)(e=>{P({reaction:t,title:e}),F()}),{isContextMenuOpen:$,contextMenuAnchor:J,handleBeforeContextMenu:z,handleContextMenu:j,handleContextMenuClose:H,handleContextMenuHide:q}=(0,c.A)(k,!N,void 0,void 0,void 0,!0),G=(0,l.A)(()=>k.current),V=(0,l.A)(()=>document.body),W=(0,l.A)(()=>Y.current),X=(0,l.A)(()=>({withPortal:!0,shouldAvoidNegativePosition:!0}));if(!w||0!==B)return(0,g.FD)(h.A,{className:(0,a.A)(C.A.root,C.A.tag,p&&C.A.own,m&&C.A.chosen,m&&I,R&&C.A.disabled,S),size:"tiny",onClick:K,onMouseDown:z,onContextMenu:j,ref:k,children:[(0,g.Y)(u.A,{className:C.A.animatedEmoji,containerId:s,reaction:t,loopLimit:1,size:y,observeIntersection:b}),O&&(0,g.FD)("span",{className:C.A.tagText,children:[E&&(0,g.Y)("span",{children:E}),w&&(0,g.Y)("span",{children:B})]}),(0,g.Y)("svg",{className:C.A.tail,width:"15",height:"30",viewBox:"0 0 15 30",children:(0,g.Y)("path",{className:C.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&&(0,g.Y)(A,{isOpen:D,maxLength:15,title:T(n?.title?"SavedTagRenameTag":"SavedTagLabelTag"),subtitle:T("SavedTagLabelTagText"),placeholder:T("SavedTagLabelPlaceholder"),initialValue:n?.title,onClose:F,onSubmit:U}),N&&J&&(0,g.FD)(v.A,{ref:Y,isOpen:$,anchor:J,getTriggerElement:G,getRootElement:V,getMenuElement:W,getLayout:X,autoClose:!0,withPortal:!0,onClose:H,onCloseAnimationEnd:q,children:[(0,g.Y)(f.A,{icon:"tag-filter",onClick:K,children:T("SavedTagFilterByTag")}),(0,g.Y)(f.A,{icon:"tag-name",onClick:L,children:T(n?.title?"SavedTagRenameTag":"SavedTagLabelTag")}),(0,g.Y)(f.A,{icon:"tag-crossed",destructive:!0,onClick:_,children:T("SavedTagRemoveTag")})]})]})})},93879:(e,t,n)=>{n.d(t,{A:()=>o});const o={root:"O9uCTt5C","animated-icon":"HiI6SMxF",animatedIcon:"HiI6SMxF",effect:"NhFcTGja",animating:"ikfZ6Igz",withEffectOnly:"jjRJmHCg"}},99515:(e,t,n)=>{n.d(t,{A:()=>ee});var o=n(84051),i=n(13439),a=n(23174),s=n(31481),c=n(90709),r=n(91048),l=n(56494),d=n(87357),u=n(85982),h=n(9716),m=n(80539);const p=document.createElement("div"),g=new Set([a.C7.Bold,a.C7.Italic,a.C7.Underline,a.C7.Strike,a.C7.Spoiler,a.C7.CustomEmoji]);function A(e){const t=function(e){const t=e.cloneContents();p.appendChild(t);const n=function(e,t){const n=e.commonAncestorContainer;if(n.nodeType===Node.ELEMENT_NODE&&n.classList.contains("text-content"))return t;let o=e.commonAncestorContainer.parentElement;for(;o&&!o.classList.contains("text-content");){const e=o.tagName.toLowerCase(),n=o.dataset.entityType;t=`<${e} ${n?`data-entity-type="${n}"`:""}>${t}</${e}>`,o=o.parentElement}return t}(e,p.innerHTML);return p.innerHTML="",n.replace(/<br\s*\/?>/gi,"\n").replace(/&nbsp;/gi," ").replace(/\u00a0/gi," ")}(e);return function(e){if(!e.entities)return e;const t=e.entities.filter(e=>g.has(e.type));return{...e,entities:t.length?t:void 0}}((0,m.Ay)(t,!1,!0))}var v=n(37661),f=n(39351),C=n(17712),y=n(59030),S=n(24531),I=n(34201),w=n(80089),R=n(80464),N=n(20021);const b=e=>{const{isOpen:t}=e,n=(0,R.A)(w.ar.Extra,"PinMessageModal",!t);return n?(0,N.Y)(n,{...e}):void 0};var M=n(94189),x=n(73104),P=n(76023),k=n(4961),Y=n(3544),T=n(96454),D=n(81686),L=n(43044),F=n(58554),E=n(49086);function B(e){return e?"lng_context_copy_selected":"lng_context_copy_text"}var O=n(43874),K=n(26875),_=n(71429),U=n(24433),$=n(60859),J=n(55158),z=n(17663);const j="C3LVl_JT",H="cd1ZZeSy",q=(0,o.ph)(function(e){let{message:t}=e;const n=(0,y.A)(),{editDate:o}=t,i=!o;return(0,N.Y)(U.A,{icon:"clock-edit",className:j,children:i?(0,N.Y)(J.A,{className:H}):Boolean(o)&&n("Chat.PrivateMessageEditTimestamp.Date",(0,z.U)(n,1e3*o))})});var G=n(76283),V=n(41036);const W=(0,o.ph)(function(e){let{message:t,shouldRenderShowWhen:n,canLoadReadDate:o,closeContextMenu:a}=e;const{openPrivacySettingsNoticeModal:s}=(0,i.ko)(),c=(0,y.A)(),{readDate:r}=t,l=o&&!r&&!n;return(0,N.Y)(U.A,{icon:"message-read",className:j,children:(0,N.Y)(V.Ay,{name:"fade",activeKey:l?1:2,className:"mg4sBQ9n",children:l?(0,N.Y)(J.A,{className:H}):(0,N.FD)(N.FK,{children:[Boolean(r)&&c("PmReadAt",(0,z.U)(c,1e3*r)),!r&&n&&(0,N.FD)("div",{children:[c("PmRead"),(0,N.Y)("span",{className:"bmxij_dk",onClick:()=>{a(),s({chatId:t.chatId,isReadDate:!0})},children:c("PmReadShowWhen")})]})]})})})}),X=(0,o.ph)(e=>{let{isReactionPickerOpen:t,availableReactions:n,topReactions:s,defaultTagReactions:r,isOpen:l,message:m,poll:p,webPage:g,story:A,isPrivate:S,isCurrentUserPremium:I,enabledReactions:w,isWithPaidReaction:R,reactionsLimit:b,anchor:M,targetHref:z,canSendNow:j,canReschedule:H,canBuyPremium:V,canReply:X,canQuote:Z,canEdit:Q,canAppendTodoList:ee,noReplies:te,canPin:ne,canUnpin:oe,canDelete:ie,canForward:ae,canReport:se,canFaveSticker:ce,canUnfaveSticker:re,canCopy:le,canCopyLink:de,canSelect:ue,canDownload:he,canSaveGif:me,canRevote:pe,canClosePoll:ge,canTranslate:Ae,canShowOriginal:ve,canSelectLanguage:fe,isDownloading:Ce,repliesThreadInfo:ye,canShowSeenBy:Se,canShowReactionsCount:Ie,canShowReactionList:we,seenByRecentPeers:Re,hasCustomEmoji:Ne,customEmojiSets:be,canPlayAnimatedEmojis:Me,isInSavedMessages:xe,shouldRenderShowWhen:Pe,canLoadReadDate:ke,onReply:Ye,onOpenThread:Te,onEdit:De,onAppendTodoList:Le,onPin:Fe,onUnpin:Ee,onForward:Be,onDelete:Oe,onFaveSticker:Ke,onReport:_e,onUnfaveSticker:Ue,onSelect:$e,onSend:Je,onReschedule:ze,onClose:je,onCloseAnimationEnd:He,onCopyLink:qe,onCopyNumber:Ge,onDownload:Ve,onSaveGif:We,onCancelVote:Xe,onClosePoll:Ze,onShowSeenBy:Qe,onShowReactors:et,onToggleReaction:tt,onSendPaidReaction:nt,onShowPaidReactionModal:ot,onCopyMessages:it,onReactionPickerOpen:at,onTranslate:st,onShowOriginal:ct,onSelectLanguage:rt,userFullName:lt,canGift:dt}=e;const{showNotification:ut,openStickerSet:ht,openCustomEmojiSets:mt,loadStickers:pt,openGiftModal:gt}=(0,i.ko)(),At=(0,o.li)(),vt=(0,o.li)(),ft=(0,y.A)(),Ct=(0,f.A)(),yt=!S&&!w,St=m.areReactionsPossible,It=we&&!yt||St,wt="isEdited"in m&&m.isEdited,Rt=m.seenByDates,Nt="giftPremium"===m.content.action?.type,bt="giftCode"===m.content.action?.type,Mt="starGift"===m.content.action?.type,xt="starGiftUnique"===m.content.action?.type,Pt=(0,h.L8)(m.chatId)&&dt&&(Nt||bt||Mt||xt),[kt,Yt]=(0,v.A)(),[Tt,Dt,Lt]=(0,v.A)(),{isMobile:Ft,isDesktop:Et}=(0,O.Ay)(),Bt=(0,o.Kr)(()=>Rt?Object.keys(Rt).length:0,[Rt]),Ot=(0,C.A)(()=>{ut({message:ft("Share.Link.Copied")}),je()}),Kt=(0,C.A)(()=>{gt({forUserId:m.chatId}),je()});(0,o.vJ)(()=>{l&&kt&&!t&&je()},[je,l,t,kt]),(0,o.vJ)(()=>{be?.length&&be.map(e=>pt({stickerSetInfo:{id:e.id,accessHash:e.accessHash}}))},[be,mt]);const _t=(0,C.A)(()=>{be&&(1===be.length?ht({stickerSetInfo:{shortName:be[0].shortName}}):mt({setIds:be.map(e=>e.id)}),je())}),Ut=function(e,t,n,o,i,s,r,l){const{webPage:d}=t||{},h=[],m=(0,c.P5)(e),p=(0,c.yl)(e)||((0,c.rU)(d)?void 0:(0,c.eY)(d)),g=(0,c.Qm)(e),A=p?(0,c.rI)(p,"full"):void 0,v=o&&p&&(A||(0,c.KG)(p))&&u.WO&&!T.Yw,f=window.getSelection();if(v&&h.push({label:"lng_context_copy_image",icon:"copy-media",handler:()=>{Promise.resolve(A?F.hd(A,a.qZ.BlobUrl):p.blobUrl).then(u.qp),i?.()}}),o&&n)h.push({label:"lng_context_copy_link",icon:"copy",handler:()=>{(0,u.eM)(n),i?.()}});else if(o&&m){const n=Boolean(f?.anchorNode?.parentNode&&f.anchorNode.parentNode.closest(".Message .content-inner")&&""!==f.toString().replace(/(?:\r\n|\r|\n)/g,"")&&function(e){const t=window.getSelection(),n=t?.anchorNode?.parentNode,o=n?.closest(".Message.message-list-item");return(0,c.GZ)(e.id)===o?.id}(e));h.push({label:B(n),icon:"copy",handler:()=>{const o=(0,D.A)();if(o?.length&&r)r(o);else if(n)document.execCommand("copy");else{const n=(0,E.V)({message:e,shouldRenderAsHtml:!0});n&&(0,u.A)(n.join(""),(0,Y.Gn)((0,L.Yw)(),e,t))}i?.()}})}return s&&h.push({label:"lng_context_copy_message_link",icon:"link",handler:s}),g&&l&&h.push({label:"lng_profile_copy_phone",icon:"copy",handler:()=>{l(),i?.()}}),h}(m,(0,c.FE)({poll:p,webPage:g,story:A}),z,le,Ot,de?qe:void 0,it,Ge),$t=(0,C.A)(()=>document.querySelector(`.Transition_slide-active > .MessageList div[data-message-id="${m.id}"]`)),Jt=(0,C.A)(()=>document.querySelector(".Transition_slide-active > .MessageList")),zt=(0,C.A)(()=>document.querySelector(".MessageContextMenu .bubble")),jt=(0,C.A)(()=>{const e=Ft&&document.querySelector(".AudioPlayer-content")?.offsetHeight||0,t=document.getElementById("MiddleColumn"),n=getComputedStyle(t),o=parseFloat(n.getPropertyValue("--middle-header-panes-height"))||0;return{extraPaddingX:10,extraTopPadding:document.querySelector(".MiddleHeader").offsetHeight,extraMarginTop:o+e,shouldAvoidNegativePosition:!Et,menuElMinWidth:It&&Ft?19.25*P.$:void 0}});(0,o.vJ)(()=>{l?setTimeout(()=>{Dt()},200):Lt()},[l,Dt,Lt]),(0,o.vJ)(()=>(0,x.M6)(vt.current,".ReactionPicker"),[l]);const Ht=(0,C.A)(e=>{at(e),Yt()});return(0,N.FD)(_.A,{ref:At,isOpen:l,anchor:M,getTriggerElement:$t,getRootElement:Jt,getMenuElement:zt,getLayout:jt,withMaxHeight:!0,className:(0,d.A)("MessageContextMenu","fluid",It&&"with-reactions"),onClose:je,onCloseAnimationEnd:He,children:[It&&(0,N.Y)(G.A,{enabledReactions:w,topReactions:s,allAvailableReactions:n,defaultTagReactions:r,currentReactions:m.reactions?.results,reactionsLimit:b,onToggleReaction:tt,onSendPaidReaction:nt,onShowPaidReactionModal:ot,isWithPaidReaction:R,isPrivate:S,isReady:Tt,canBuyPremium:V,isCurrentUserPremium:I,isInSavedMessages:xe,canPlayAnimatedEmojis:Me,onShowMore:Ht,onClose:je,className:(0,d.A)(kt&&"ReactionSelector-hidden")}),(0,N.FD)("div",{ref:vt,className:(0,d.A)("MessageContextMenu_items scrollable-content custom-scroll",kt&&"MessageContextMenu_items-hidden"),dir:ft.isRtl?"rtl":void 0,children:[Pt&&(0,N.Y)(U.A,{icon:"gift",onClick:Kt,children:m?.isOutgoing?ft("SendAnotherGift"):ft("Conversation.ContextMenuSendGiftTo",lt)}),j&&(0,N.Y)(U.A,{icon:"send-outline",onClick:Je,children:ft("MessageScheduleSend")}),H&&(0,N.Y)(U.A,{icon:"schedule",onClick:ze,children:ft("MessageScheduleEditTime")}),X&&(0,N.Y)(U.A,{icon:"reply",onClick:Ye,children:ft(Z?"lng_context_quote_and_reply":"Reply")}),!te&&Boolean(ye?.messagesCount)&&(0,N.Y)(U.A,{icon:"replies",onClick:Te,children:ft("Conversation.ContextViewReplies",ye.messagesCount,"i")}),Q&&(0,N.Y)(U.A,{icon:"edit",onClick:De,children:ft("Edit")}),ee&&(0,N.Y)(U.A,{icon:"add",onClick:Le,children:Ct("MenuButtonAppendTodoList")}),ce&&(0,N.Y)(U.A,{icon:"favorite",onClick:Ke,children:ft("AddToFavorites")}),re&&(0,N.Y)(U.A,{icon:"favorite",onClick:Ue,children:ft("Stickers.RemoveFromFavorites")}),Ae&&(0,N.Y)(U.A,{icon:"language",onClick:st,children:ft("TranslateMessage")}),ve&&(0,N.Y)(U.A,{icon:"language",onClick:ct,children:ft("ShowOriginalButton")}),fe&&(0,N.Y)(U.A,{icon:"web",onClick:rt,children:ft("lng_settings_change_lang")}),Ut.map(e=>(0,N.Y)(U.A,{icon:e.icon,onClick:e.handler,withPreventDefaultOnMouseDown:!0,children:ft(e.label)},e.label)),ne&&(0,N.Y)(U.A,{icon:"pin",onClick:Fe,children:ft("DialogPin")}),oe&&(0,N.Y)(U.A,{icon:"unpin",onClick:Ee,children:ft("DialogUnpin")}),me&&(0,N.Y)(U.A,{icon:"gifs",onClick:We,children:ft("lng_context_save_gif")}),pe&&(0,N.Y)(U.A,{icon:"revote",onClick:Xe,children:ft("lng_polls_retract")}),ge&&(0,N.Y)(U.A,{icon:"stop",onClick:Ze,children:ft("lng_polls_stop")}),he&&(0,N.Y)(U.A,{icon:"download",onClick:Ve,children:ft(Ce?"lng_context_cancel_download":"lng_media_download")}),ae&&(0,N.Y)(U.A,{icon:"forward",onClick:Be,children:ft("Forward")}),ue&&(0,N.Y)(U.A,{icon:"select",onClick:$e,children:ft("Common.Select")}),se&&(0,N.Y)(U.A,{icon:"flag",onClick:_e,children:ft("lng_context_report_msg")}),ie&&(0,N.Y)(U.A,{destructive:!0,icon:"delete",onClick:Oe,children:ft("Delete")}),Ne&&(0,N.FD)(N.FK,{children:[(0,N.Y)($.A,{size:"thick"}),!be&&(0,N.FD)(N.FK,{children:[(0,N.Y)(J.A,{inline:!0,className:"menu-loading-row"}),(0,N.Y)(J.A,{inline:!0,className:"menu-loading-row"})]}),be&&1===be.length&&(0,N.Y)(U.A,{withWrap:!0,onClick:_t,className:"menu-custom-emoji-sets",children:(0,k.A)(ft("MessageContainsEmojiPack",be[0].title),["simple_markdown","emoji"])}),be&&be.length>1&&(0,N.Y)(U.A,{withWrap:!0,onClick:_t,className:"menu-custom-emoji-sets",children:(0,k.A)(ft("MessageContainsEmojiPacks",be.length),["simple_markdown"])})]}),(Se||Ie)&&(0,N.FD)(N.FK,{children:[(0,N.Y)($.A,{size:Ne?"thin":"thick"}),(0,N.FD)(U.A,{icon:Ie?"heart-outline":"group",onClick:Ie?et:Qe,disabled:!Ie&&!Bt,children:[(0,N.Y)("span",{className:"MessageContextMenu--seen-by-label-wrapper",children:(0,N.Y)("span",{className:"MessageContextMenu--seen-by-label",dir:ft.isRtl?"rtl":void 0,children:Ie&&m.reactors?.count?Se&&Bt?ft("Chat.OutgoingContextMixedReactionCount",[m.reactors.count,Bt]):ft("Chat.ContextReactionCount",m.reactors.count,"i"):1===Bt&&Re?(0,k.A)((0,h.L8)(Re[0].id)?(0,c.Yg)(Re[0]):Re[0].title):Bt?ft("Conversation.ContextMenuSeen",Bt,"i"):ft("Conversation.ContextMenuNoViews")})}),(0,N.Y)(K.A,{className:"avatars",size:"micro",peers:Re})]})]}),(ke||Pe||wt)&&(0,N.Y)($.A,{size:Ne?"thin":"thick"}),(ke||Pe)&&(0,N.Y)(W,{canLoadReadDate:ke,shouldRenderShowWhen:Pe,message:m,closeContextMenu:je}),wt&&(0,N.Y)(q,{message:m})]})]})}),Z=window.getSelection(),Q=-1,ee=(0,o.ph)((0,i.EK)((e,t)=>{let{message:n,messageListType:o,detectedLanguage:i}=t;const{threadId:a}=(0,r.Xf0)(e)||{},{defaultTags:l,topReactions:d,availableReactions:u}=e.reactions,m=(0,r.yuw)(e),p=(0,r.hds)(e,n.chatId),g=p&&(0,h.L8)(p.id),A=g?void 0:(0,r.AWZ)(e,n.chatId),v=(0,r.mBe)(e,n.chatId),f=v&&(0,c.Yg)(v),{seenByExpiresAt:C,seenByMaxChatMembers:y,maxUniqueReactions:S,readDateExpiresAt:I}=e.appConfig,w=A?.reactionsLimit||S,{noOptions:R,canReplyGlobally:N,canPin:b,canUnpin:M,canDelete:x,canReport:P,canEdit:k,canFaveSticker:Y,canUnfaveSticker:T,canCopy:D,canCopyLink:L,canSelect:F,canDownload:E,canSaveGif:B,canRevote:O,canClosePoll:K}=a&&(0,r.WAX)(e,n,a)||{},_=(0,r.R4s)(e,n),U=g?(0,r.K0y)(e,p.id):void 0,$=(0,c.Ie)(n),J=p&&(0,r.yps)(e,p.id),z=Boolean(J),j=(0,r.Jbz)(e,n),H=Boolean(g&&$&&!z&&!j&&I&&n.date>Date.now()/1e3-I&&!U?.isReadDateRestricted&&"scheduled"!==o),q=Boolean(H&&g&&(0,r.K0y)(e,p.id)?.isReadDateRestrictedByMe),G="pinned"===o,V="scheduled"===o,W=p&&(0,c.WX)(p),X=a&&(0,r.Vw0)(e,n.chatId,a),Z=Boolean(X&&!X?.isCommentsInfo&&X?.fromChannelId),Q=a?(0,r.S0q)(e,n.chatId,a):void 0,ee=p&&!(0,c.Sq)(p,"sendPlain",A),te=!(!p||!a)&&(0,c.__)(p,Q,Z,A)&&ee,ne=(0,c.Nb)(n),oe=(0,c.G5)(n),ie=Boolean(!ne&&p&&!p.isMonoforum&&!j&&y&&C&&(0,c.YE)(p)&&$&&!V&&p.membersCount&&p.membersCount<=y&&n.date>Date.now()/1e3-C),ae=(0,c._P)(n),se=!ne&&!W&&!V&&!ae&&!g&&n.reactions&&!(0,c.G)(n.reactions)&&n.reactions.canSeeList,ce=(0,r.ynf)(e,n),re=Boolean(n.content.contact),le=(0,r.g29)(e),de=(0,r.S1W)(e,n),ue=de?.map(t=>(0,r.ycM)(e,t)),he=ue?.every(Boolean)?ue:void 0,me=(0,r.Rny)(e,n.chatId,n.id),pe=me?Boolean((0,r.a_$)(e,n.chatId,me)[n.id]?.text):void 0,ge=!pe&&(0,r.S86)(e,n,i),Ae=(0,r.qZq)(e,n.chatId),ve=(0,r.nZ4)(e,n.chatId),fe=(0,r.zcZ)(e,n),Ce=(0,r.Pn$)(e,n),ye=n.content.storyData,Se=ye?(0,r.Msb)(e,ye.peerId,ye.id):void 0,Ie=(0,r.X2D)(e,n.chatId),we=(0,r.QP5)(e,n),Re=e.appConfig.todoItemsMax;return{threadId:a,chat:p,availableReactions:u,topReactions:d,defaultTagReactions:l,noOptions:R,canReport:P,canSendNow:V,canReschedule:V,canReply:!G&&!V&&N,canPin:!V&&b,canUnpin:!V&&M,canDelete:x,canEdit:!G&&k,canAppendTodoList:n.content.todo?.todo.othersCanAppend&&n.content.todo?.todo.items?.length<Re,canForward:!V&&_,canFaveSticker:!V&&Y,canUnfaveSticker:!V&&T,canCopy:re||!ce&&D,canCopyLink:!V&&L,canSelect:F,canDownload:!ce&&E,canSaveGif:!ce&&B,canRevote:O,canClosePoll:!V&&K,activeDownloads:m,canShowSeenBy:ie,canLoadReadDate:H,shouldRenderShowWhen:q,enabledReactions:p?.isForbidden?void 0:A?.enabledReactions,reactionsLimit:w,isPrivate:g,isCurrentUserPremium:le,hasFullInfo:Boolean(A),canShowReactionsCount:se,canShowReactionList:!(ne||ae||V||p?.id===s.zv8||oe),canBuyPremium:!le&&!(0,r.n_C)(e),customEmojiSetsInfo:de,customEmojiSets:he,canScheduleUntilOnline:(0,r.RBq)(e,n.chatId),canTranslate:ge,canShowOriginal:pe&&!Ae,canSelectLanguage:pe&&!Ae,isMessageTranslated:pe,canPlayAnimatedEmojis:(0,r.BWX)(e),isReactionPickerOpen:(0,r.Ani)(e),isInSavedMessages:ve,isChannel:W,canReplyInChat:te,isWithPaidReaction:A?.isPaidReactionAvailable,poll:fe,story:Se,userFullName:f,canGift:Ie,savedDialogId:we,webPage:Ce}})(e=>{let{threadId:t,availableReactions:n,topReactions:r,defaultTagReactions:h,isOpen:m,messageListType:p,message:g,customEmojiSetsInfo:w,customEmojiSets:R,album:x,poll:P,webPage:k,story:Y,anchor:T,targetHref:D,noOptions:L,canSendNow:F,hasFullInfo:E,canReschedule:B,canReply:O,canPin:K,repliesThreadInfo:_,canUnpin:U,canDelete:$,canShowReactionsCount:J,chat:z,canReport:j,canShowReactionList:H,canEdit:q,canAppendTodoList:G,enabledReactions:V,reactionsLimit:W,isPrivate:ee,isCurrentUserPremium:te,canForward:ne,canBuyPremium:oe,canFaveSticker:ie,canUnfaveSticker:ae,canCopy:se,canCopyLink:ce,canSelect:re,canDownload:le,canSaveGif:de,canRevote:ue,canClosePoll:he,canPlayAnimatedEmojis:me,canLoadReadDate:pe,shouldRenderShowWhen:ge,activeDownloads:Ae,noReplies:ve,canShowSeenBy:fe,canScheduleUntilOnline:Ce,canTranslate:ye,isMessageTranslated:Se,canShowOriginal:Ie,canSelectLanguage:we,isReactionPickerOpen:Re,isInSavedMessages:Ne,canReplyInChat:be,isWithPaidReaction:Me,userFullName:xe,canGift:Pe,className:ke,savedDialogId:Ye,onClose:Te,onCloseAnimationEnd:De}=e;const{openThread:Le,updateDraftReplyInfo:Fe,setEditingId:Ee,pinMessage:Be,openForwardMenu:Oe,openReplyMenu:Ke,faveSticker:_e,unfaveSticker:Ue,toggleMessageSelection:$e,sendScheduledMessages:Je,rescheduleMessage:ze,downloadMedia:je,cancelMediaDownload:He,loadSeenBy:qe,openSeenByModal:Ge,openReactorListModal:Ve,loadFullChat:We,loadReactors:Xe,copyMessagesByIds:Ze,saveGif:Qe,loadStickers:et,cancelPollVote:tt,closePoll:nt,toggleReaction:ot,requestMessageTranslation:it,showOriginalMessage:at,openChatLanguageModal:st,openMessageReactionPicker:ct,openPremiumModal:rt,loadOutboxReadDate:lt,copyMessageLink:dt,openDeleteMessageModal:ut,addLocalPaidReaction:ht,openPaidReactionModal:mt,reportMessages:pt,openTodoListModal:gt,showNotification:At}=(0,i.ko)(),vt=(0,y.A)(),ft=(0,f.A)(),{ref:Ct}=(0,I.A)({isOpen:m,onCloseAnimationEnd:De,className:!1}),[yt,St]=(0,o.J0)(!0),[It,wt]=(0,o.J0)(!1),[Rt,Nt,bt]=(0,v.A)(),[Mt,xt]=(0,o.J0)(Q),[Pt,kt]=(0,S.A)(Ce,Te,g.date),Yt=void 0===w||Boolean(w.length);(0,o.vJ)(()=>{fe&&m&&qe({chatId:g.chatId,messageId:g.id})},[qe,m,g.chatId,g.id,fe]),(0,o.vJ)(()=>{pe&&m&&lt({chatId:g.chatId,messageId:g.id})},[pe,m,g.chatId,g.id,g.readDate]),(0,o.vJ)(()=>{J&&m&&Xe({chatId:g.chatId,messageId:g.id})},[J,m,Xe,g.chatId,g.id]),(0,o.vJ)(()=>{w?.length&&R?.length!==w.length&&w.forEach(e=>{et({stickerSetInfo:e})})},[w,R,et]),(0,o.vJ)(()=>{E||ee||!m||We({chatId:g.chatId})},[E,m,ee,We,g.chatId]);const Tt=(0,o.Kr)(()=>{const e=(0,i.mS)().chats.byId,t=(0,i.mS)().users.byId;if(g.reactions?.recentReactions?.length){const n=new Set(g.reactions?.recentReactions?.map(n=>{let{peerId:o}=n;return t[o]||e[o]}));return Array.from(n).filter(Boolean).slice(0,s.dqH)}if(g.seenByDates)return Object.keys(g.seenByDates).slice(0,s.dqH).map(n=>t[n]||e[n]).filter(Boolean)},[g.reactions?.recentReactions,g.seenByDates]),Dt=(0,o.Kr)(()=>{const e=(0,i.mS)();if(x)return x.messages.some(t=>{const n=(0,l.iS)(e,t);return!!n&&(0,c.$r)(Ae,n)});const t=(0,l.iS)(e,g);return!!t&&(0,c.$r)(Ae,t)},[Ae,x,g]),Lt=O&&Z?.rangeCount?Z.getRangeAt(0):void 0;(0,o.vJ)(()=>{if(Se)return void xt(Q);if(!Lt||Lt.collapsed||!Boolean(g.content.text?.text)||!function(e){const t=e.commonAncestorContainer,n=t.nodeType===Node.TEXT_NODE?t.parentNode:t;return Boolean(n.closest(".message-content-wrapper .text-content"))&&!(Boolean(n.closest(".EmbeddedMessage"))||Boolean(n.closest(".WebPage")))}(Lt))return void xt(Q);const e=A(Lt),t=g.content.text.text.replace(/\u00A0/g," ");e.text.trim().length>0&&t.includes(e.text)?xt(Lt.startOffset):xt(Q)},[Lt,Lt?.collapsed,Lt?.startOffset,Lt?.endOffset,Se,g.content.text]);const Ft=(0,C.A)(()=>{St(!1),Te()}),Et=(0,C.A)(()=>{St(!1),Ft();const e=x?.messages?x.messages.map(e=>{let{id:t}=e;return t}):[g.id];ut({chatId:g.chatId,messageIds:e,isSchedule:"scheduled"===p})}),Bt=(0,C.A)(()=>{wt(!1),Te()}),Ot=(0,C.A)(()=>{const e=Mt!==Q&&Lt?A(Lt):void 0;be?Fe({replyToMsgId:g.id,quoteText:e,quoteOffset:Mt,monoforumPeerId:Ye,replyToPeerId:void 0}):Ke({fromChatId:g.chatId,messageId:g.id,quoteText:e,quoteOffset:Mt}),Ft()}),Kt=(0,C.A)(()=>{Le({chatId:g.chatId,threadId:g.id}),Ft()}),_t=(0,C.A)(()=>{g.content.todo?gt({chatId:g.chatId,messageId:g.id}):Ee({messageId:g.id}),Ft()}),Ut=(0,C.A)(()=>{te?gt({chatId:g.chatId,messageId:g.id,forNewTask:!0}):At({message:ft("SubscribeToTelegramPremiumForAppendToDo"),action:{action:"openPremiumModal",payload:{initialSection:"todo"}},actionText:vt("PremiumMore")}),Ft()}),$t=(0,C.A)(()=>{St(!1),wt(!0)}),Jt=(0,C.A)(()=>{Be({chatId:g.chatId,messageId:g.id,isUnpin:!0}),Ft()}),zt=(0,C.A)(()=>{if(Ft(),x?.messages){const e=x.messages.map(e=>{let{id:t}=e;return t});Oe({fromChatId:g.chatId,messageIds:e})}else Oe({fromChatId:g.chatId,messageIds:[g.id]})}),jt=(0,C.A)(()=>{Ft(),_e({sticker:g.content.sticker})}),Ht=(0,C.A)(()=>{Ft(),Ue({sticker:g.content.sticker})}),qt=(0,C.A)(()=>{Ft(),tt({chatId:g.chatId,messageId:g.id})}),Gt=(0,C.A)(()=>{Ft(),nt({chatId:g.chatId,messageId:g.id})}),Vt=(0,C.A)(()=>{const e=x?.messages?{messageId:g.id,childMessageIds:x.messages.map(e=>{let{id:t}=e;return t}),withShift:!1}:{messageId:g.id,withShift:!1};$e(e),Ft()}),Wt=(0,C.A)(()=>{Je({chatId:g.chatId,id:g.id}),Ft()}),Xt=(0,C.A)(e=>{ze({chatId:g.chatId,messageId:g.id,scheduledAt:e}),Te()}),Zt=(0,C.A)(()=>{St(!1),Pt(Xt)}),Qt=(0,C.A)(()=>{Ft(),Ge({chatId:g.chatId,messageId:g.id})}),en=(0,C.A)(()=>{Ft(),Ve({chatId:g.chatId,messageId:g.id})}),tn=(0,C.A)(e=>{Ze({messageIds:e}),Ft()}),nn=(0,C.A)(()=>{dt({chatId:g.chatId,messageId:g.id,shouldIncludeThread:t!==a.l3,shouldIncludeGrouped:!0}),Ft()}),on=(0,C.A)(()=>{(0,u.eM)(g.content.contact.phoneNumber),Ft()}),an=(0,C.A)(()=>{const e=(0,i.mS)();(x?.messages||[g]).forEach(t=>{const n=(0,l.iS)(e,t);n&&(Dt?He({media:n}):je({media:n,originMessage:t}))}),Ft()}),sn=(0,C.A)(()=>{const e=(0,c.zX)(g);Qe({gif:e}),Ft()}),cn=(0,C.A)(e=>{Ne&&!te?rt({initialSection:"saved_tags"}):ot({chatId:g.chatId,messageId:g.id,reaction:e,shouldAddToRecent:!0}),Ft()}),rn=(0,C.A)(()=>{ht({chatId:g.chatId,messageId:g.id,count:1}),Ft()}),ln=(0,C.A)(()=>{mt({chatId:g.chatId,messageId:g.id}),Ft()}),dn=(0,C.A)(e=>{ct({chatId:g.chatId,messageId:g.id,position:e})}),un=(0,C.A)(()=>{it({chatId:g.chatId,id:g.id}),Ft()}),hn=(0,C.A)(()=>{at({chatId:g.chatId,id:g.id}),Ft()}),mn=(0,C.A)(()=>{st({chatId:g.chatId,messageId:g.id}),Ft()}),pn=(0,o.Kr)(()=>(x?x.messages:[g]).map(e=>{let{id:t}=e;return t}),[x,g]),gn=(0,C.A)(()=>{z&&(St(!1),Te(),pt({chatId:z.id,messageIds:pn}))});if(L)return void Ft();const An=new Date;return An.setFullYear(An.getFullYear()+1),(0,N.FD)("div",{ref:Ct,className:(0,d.A)("ContextMenuContainer",ke),children:[(0,N.Y)(X,{isReactionPickerOpen:Re,availableReactions:n,topReactions:r,defaultTagReactions:h,isWithPaidReaction:Me,message:g,isPrivate:ee,isCurrentUserPremium:te,canBuyPremium:oe,isOpen:yt,enabledReactions:V,reactionsLimit:W,anchor:T,targetHref:D,canShowReactionsCount:J,canShowReactionList:H,canSendNow:F,canReschedule:B,canReply:O,canQuote:Mt!==Q,canDelete:$,canPin:K,canReport:j,repliesThreadInfo:_,canUnpin:U,canEdit:q,canAppendTodoList:G,canForward:ne,canFaveSticker:ie,canUnfaveSticker:ae,canCopy:se,canCopyLink:ce,canSelect:re,canDownload:le,canSaveGif:de,canRevote:ue,canClosePoll:he,canShowSeenBy:fe,canTranslate:ye,canShowOriginal:Ie,canSelectLanguage:we,canPlayAnimatedEmojis:me,shouldRenderShowWhen:ge,canLoadReadDate:pe,hasCustomEmoji:Yt,customEmojiSets:R,isDownloading:Dt,seenByRecentPeers:Tt,isInSavedMessages:Ne,noReplies:ve,poll:P,webPage:k,story:Y,onOpenThread:Kt,onReply:Ot,onEdit:_t,onAppendTodoList:Ut,onPin:$t,onUnpin:Jt,onForward:zt,onDelete:Et,onReport:gn,onFaveSticker:jt,onUnfaveSticker:Ht,onSelect:Vt,onSend:Wt,onReschedule:Zt,onClose:Ft,onCopyLink:nn,onCopyMessages:tn,onCopyNumber:on,onDownload:an,onSaveGif:sn,onCancelVote:qt,onClosePoll:Nt,onShowSeenBy:Qt,onToggleReaction:cn,onSendPaidReaction:rn,onShowPaidReactionModal:ln,onShowReactors:en,onReactionPickerOpen:dn,onTranslate:un,onShowOriginal:hn,onSelectLanguage:mn,userFullName:xe,canGift:Pe}),(0,N.Y)(b,{isOpen:It,messageId:g.id,chatId:g.chatId,onClose:Bt}),(0,N.Y)(M.A,{isOpen:Rt,onClose:bt,text:vt("lng_polls_stop_warning"),confirmLabel:vt("lng_polls_stop_sure"),confirmHandler:Gt}),B&&kt]})}))}}]);
//# sourceMappingURL=131.dea6f57183b333b48ca9.js.map