telegram-tt/dist/1989.305756fa8222a2171db5.js

2 lines
10 KiB
JavaScript
Raw Normal View History

2022-08-31 15:12:25 +02:00
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[1989],{70172:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(14050),o=n(33555),c=n(6137),l=n(83716),s=n(83158),i=n(2155),a=n(46752),d=n(32340),u=n(6202),m=n(31212),v=n(59107),f=n(3657),p=n(21747);const g=(0,a.y)("Avatar");g.media=g("media"),g.icon=g("icon");const h=(0,r.X$)((e=>{var t,n,h;let{className:Z,size:E="large",chat:P,user:b,photo:y,userStatus:I,text:w,isSavedMessages:A,noVideo:C,noLoop:T,lastSyncTime:N,observeIntersection:k,onClick:B}=e;const{loadFullUser:S}=(0,o.Sv)(),L=(0,r.sO)(null),U=(0,r.sO)(null),O=(0,f.Op)(L,k),R=b&&(0,s.NB)(b),q=b&&(0,s.pK)(b.id);let x,F;const D=null===(t=b||P)||void 0===t?void 0:t.hasVideoAvatar,V=(null==b||null===(n=b.fullInfo)||void 0===n?void 0:n.profilePhoto)||(null==P||null===(h=P.fullInfo)||void 0===h?void 0:h.profilePhoto),H=!C&&Boolean((null==b?void 0:b.isPremium)&&(null==V?void 0:V.isVideo)),M=O&&H,j="jumbo"===E;A||R||(H&&(F=(0,s.RT)(b,void 0,"video")),b?x=(0,s.RT)(b,j?"big":void 0):P?x=(0,s.RT)(P,j?"big":void 0):y&&(x=`photo${y.id}?size=m`)),(0,p.Z)(U,M),(0,r.d4)((()=>{const e=U.current;if(!e||!T)return;const t=()=>{e.currentTime=0};return e.addEventListener("ended",t),()=>e.removeEventListener("ended",t)}),[T]),(0,r.d4)((()=>{O&&!C&&b&&D&&!V&&S({userId:b.id})}),[D,V,S,b,C,O]);const z=(0,u.Z)(x,!1,c.IU.BlobUrl,N),J=(0,u.Z)(F,!1,c.IU.BlobUrl,N),$=Boolean(z||J),{transitionClassNames:K}=(0,m.Z)($,void 0,$,"slow"),X=(0,v.Z)();let Y;const _=b?(0,s.Js)(b):P?(0,s.U)(X,P):w;if(A)Y=r.ZP.createElement("i",{className:(0,a.Z)(g.icon,"icon-avatar-saved-messages"),"aria-label":_});else if(R)Y=r.ZP.createElement("i",{className:(0,a.Z)(g.icon,"icon-avatar-deleted-account"),"aria-label":_});else if(q)Y=r.ZP.createElement("i",{className:(0,a.Z)(g.icon,"icon-reply-filled"),"aria-label":_});else if($)Y=r.ZP.createElement(r.ZP.Fragment,null,r.ZP.createElement("img",{src:z,className:(0,a.Z)(g.media,"avatar-media",K,J&&"poster"),alt:_,decoding:"async"}),J&&r.ZP.createElement("video",{ref:U,src:J,className:(0,a.Z)(g.media,"avatar-media",K),muted:!0,autoPlay:!0,disablePictureInPicture:!0,loop:!T,playsInline:!0}));else if(b){const e=(0,s.Js)(b);Y=e?(0,i.Xv)(e,2):void 0}else if(P){const e=(0,s.U)(X,P);Y=e&&(0,i.Xv)(e,(0,s.YC)(P.id)?2:1)}else w&&(Y=(0,i.Xv)(w,2));const W=!A&&b&&I&&(0,s.kM)(b,I),G=(0,a.Z)(`Avatar size-${E}`,Z,`color-bg-${(0,s.Rs)(b||P)}`,A&&"saved-messages",R&&"deleted-account",q&&"replies-bot-account",W&&"online",B&&"interactive",!A&&!z&&"no-photo"),Q=Boolean(A||z),ee=(0,r.I4)((e=>{B&&B(e,Q)}),[B,Q]),te=(b||P)&&(b||P).id;return r.ZP.createElement("div",{ref:L,className:G,onClick:ee,"data-test-sender-id":l.Cg?te:void 0,"aria-label":"string"==typeof Y?_:void 0},"string"==typeof Y?(0,d.Z)(Y,["jumbo"===E?"hq_emoji":"emoji"]):Y)}))},21747:(e,t,n)=>{n.d(t,{Z:()=>i});var r=n(14050),o=n(69118),c=n(74753),l=n(45332),s=n(18674);function i(e,t){var n;const i=(0,r.sO)(null===(n=e.current)||void 0===n?void 0:n.paused),a=(0,r.sO)();a.current=t;const d=(0,r.I4)((()=>{e.current&&(i.current=!e.current.paused,i.current&&e.current.pause())}),[e]),u=(0,r.I4)((()=>{e.current&&i.current&&a.current&&document.body.contains(e.current)&&(0,c.Z)(e.current)}),[e]),m=(0,r.I4)((()=>{(0,o.T2)(u)}),[u]);(0,l.Z)(d,m),(0,s.ZP)(d,u)}},21273:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(91713),o=n(14050),c=n(69118),l=n(87675),s=n(77361),i=n(80036);const a=".ListItem",d=20,u=800,m=e=>{let{ref:t,className:n,items:m,itemSelector:v=a,preloadBackwards:f=d,sensitiveArea:p=u,withAbsolutePositioning:g,maxHeight:h,noScrollRestore:Z=!1,noScrollRestoreOnTop:E=!1,noFastList:P,cacheBuster:b,children:y,onLoadMore:I,onScroll:w,onKeyDown:A,onDragOver:C,onDragLeave:T}=e,N=(0,o.sO)(null);t&&(N=t);const k=(0,o.sO)({}),[B,S]=(0,o.Ye)((()=>I?[(0,c.Ds)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];I({direction:r.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,c.Ds)((()=>{I({direction:r.Uq.Forwards})}),1e3,!0,!1)]:[]),[I,m]);(0,o.d4)((()=>{if(!B)return;if(f>0&&(!m||m.length<f))return void B(!0);const{scrollHeight:e,clientHeight:t}=N.current;t&&e<=t&&B()}),[m,B,f]),(
2022-09-12 13:33:17 +02:00
//# sourceMappingURL=1989.305756fa8222a2171db5.js.map