2022-05-03 15:31:01 +02:00
|
|
|
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[453],{172:(e,t,n)=>{n.d(t,{Z:()=>v});var o=n(4050),r=n(6137),c=n(3716),s=n(5806),l=n(2155),i=n(6752),a=n(2340),d=n(6202),u=n(1212),m=n(9107);const f=(0,i.y)("Avatar");f.img=f("img"),f.icon=f("icon");const v=(0,o.X$)((e=>{let{className:t,size:n="large",chat:v,user:h,photo:g,userStatus:p,text:Z,isSavedMessages:w,lastSyncTime:b,onClick:E}=e;const y=h&&(0,s.NB)(h),A=h&&(0,s.pK)(h.id);let C;const I="jumbo"===n;w||y||(h?C=(0,s.RT)(h,I?"big":void 0):v?C=(0,s.RT)(v,I?"big":void 0):g&&(C=`photo${g.id}?size=m`));const k=(0,d.Z)(C,!1,r.IU.BlobUrl,b),N=Boolean(k),{transitionClassNames:P}=(0,u.Z)(N,void 0,N,"slow"),T=(0,m.Z)();let B="";const S=h?(0,s.Js)(h):v?(0,s.U)(T,v):Z;if(w)B=o.ZP.createElement("i",{className:(0,i.Z)(f.icon,"icon-avatar-saved-messages"),"aria-label":S});else if(y)B=o.ZP.createElement("i",{className:(0,i.Z)(f.icon,"icon-avatar-deleted-account"),"aria-label":S});else if(A)B=o.ZP.createElement("i",{className:(0,i.Z)(f.icon,"icon-reply-filled"),"aria-label":S});else if(k)B=o.ZP.createElement("img",{src:k,className:(0,i.Z)(f.img,"avatar-media",P),alt:S,decoding:"async"});else if(h){const e=(0,s.Js)(h);B=e?(0,l.Xv)(e,2):void 0}else if(v){const e=(0,s.U)(T,v);B=e&&(0,l.Xv)(e,(0,s.YC)(v.id)?2:1)}else Z&&(B=(0,l.Xv)(Z,2));const U=!w&&h&&p&&(0,s.kM)(h,p),L=(0,i.Z)(`Avatar size-${n}`,t,`color-bg-${(0,s.Rs)(h||v)}`,w&&"saved-messages",y&&"deleted-account",A&&"replies-bot-account",U&&"online",E&&"interactive",!w&&!k&&"no-photo"),R=Boolean(w||k),q=(0,o.I4)((e=>{E&&E(e,R)}),[E,R]),x=(h||v)&&(h||v).id;return o.ZP.createElement("div",{className:L,onClick:q,"data-test-sender-id":c.Cg?x:void 0,"aria-label":"string"==typeof B?S:void 0},"string"==typeof B?(0,a.Z)(B,["jumbo"===n?"hq_emoji":"emoji"]):B)}))},1273:(e,t,n)=>{n.d(t,{Z:()=>u});var o=n(1713),r=n(4050),c=n(9118),s=n(7675),l=n(7361);const i=".ListItem",a=20,d=800,u=e=>{let{ref:t,className:n,onLoadMore:u,onScroll:m,onKeyDown:f,items:v,itemSelector:h=i,preloadBackwards:g=a,sensitiveArea:p=d,withAbsolutePositioning:Z,maxHeight:w,noScrollRestore:b=!1,noScrollRestoreOnTop:E=!1,noFastList:y,cacheBuster:A,children:C}=e,I=(0,r.sO)(null);t&&(I=t);const k=(0,r.sO)({}),[N,P]=(0,r.Ye)((()=>u?[(0,c.Ds)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u({direction:o.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,c.Ds)((()=>{u({direction:o.Uq.Forwards})}),1e3,!0,!1)]:[]),[u,v]);(0,r.d4)((()=>{if(!N)return;if(g>0&&(!v||v.length<g))return void N(!0);const{scrollHeight:e,clientHeight:t}=I.current;t&&e<=t&&N()}),[v,N,g]),(0,r.bt)((()=>{const e=I.current,t=k.current;let n;if(t.listItemElements=e.querySelectorAll(h),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:o}=e;n=o+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}Z||b||E&&0===e.scrollTop||((0,s.Z)(e,n),t.isScrollTopJustUpdated=!0)}),[v,h,b,E,A,Z]);const T=(0,r.I4)((e=>{if(P&&N){const{isScrollTopJustUpdated:e,currentAnchor:t,currentAnchorTop:n}=k.current,o=k.current.listItemElements;if(e)return void(k.current.isScrollTopJustUpdated=!1);const r=o.length,c=I.current,{scrollTop:s,scrollHeight:l,offsetHeight:i}=c,a=s<=(r?o[0].offsetTop:0)+p,d=(r?o[r-1].offsetTop+o[r-1].offsetHeight:l)-(s+i)<=p;let u=!1;if(a){const e=o[0];if(e){const o=e.getBoundingClientRect().top,r=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:o;t&&void 0!==n&&r>n&&(k.current.currentAnchor=e,k.current.currentAnchorTop=o,u=!0,P())}}if(d){const e=o[r-1];if(e){const o=e.getBoundingClientRect().top,r=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:o;t&&void 0!==n&&r<n&&(k.current.currentAnchor=e,k.current.currentAnchorTop=o,u=!0,N())}}if(!u)if(null!=t&&t.offsetParent)k.current.currentAnchorTop=t.getBoundingClientRect().top;else{const e=o[0];e&&(k.current.currentAnchor=e,k.current.currentAnchorTop=e.getBoundingClientRect().top)}}m&&m(e)}),[N,P,m,p]);return r.ZP.createElement("div",{ref:I,cl
|