TelegramPWA/dist/131.e56ffc9423cd546337b6.js
Alexander Zinchuk 5af6178460 [Build]
2025-08-21 12:08:29 +02:00

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