telegram-tt/dist/548.3bb36f6c7bb19731757e.js
Alexander Zinchuk 6747f229fc [Build]
2022-04-01 21:03:25 +02:00

2 lines
9.5 KiB
JavaScript

"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[548],{172:(e,t,n)=>{n.d(t,{Z:()=>h});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 h=(0,o.X$)((e=>{let{className:t,size:n="large",chat:h,user:v,photo:p,userStatus:g,text:Z,isSavedMessages:E,lastSyncTime:w,onClick:C}=e;const y=v&&(0,s.NB)(v),A=v&&(0,s.pK)(v.id);let P;E||y||(v?P=(0,s.RT)(v):h?P=(0,s.RT)(h):p&&(P=`photo${p.id}?size=m`));const N=(0,d.Z)(P,!1,r.IU.BlobUrl,w),b=Boolean(N),{transitionClassNames:I}=(0,u.Z)(b,void 0,b,"slow"),T=(0,m.Z)();let k="";if(E)k=o.ZP.createElement("i",{className:(0,i.Z)(f.icon,"icon-avatar-saved-messages")});else if(y)k=o.ZP.createElement("i",{className:(0,i.Z)(f.icon,"icon-avatar-deleted-account")});else if(A)k=o.ZP.createElement("i",{className:(0,i.Z)(f.icon,"icon-reply-filled")});else if(N)k=o.ZP.createElement("img",{src:N,className:(0,i.Z)(f.img,"avatar-media",I),alt:"",decoding:"async"});else if(v){const e=(0,s.Js)(v);k=e?(0,l.Xv)(e,2):void 0}else if(h){const e=(0,s.U)(T,h);k=e&&(0,l.Xv)(e,(0,s.YC)(h.id)?2:1)}else Z&&(k=(0,l.Xv)(Z,2));const B=!E&&v&&g&&(0,s.kM)(v,g),S=(0,i.Z)(`Avatar size-${n}`,t,`color-bg-${(0,s.Rs)(v||h)}`,E&&"saved-messages",y&&"deleted-account",A&&"replies-bot-account",B&&"online",C&&"interactive",!E&&!N&&"no-photo"),U=Boolean(E||N),L=(0,o.I4)((e=>{C&&C(e,U)}),[C,U]),R=(v||h)&&(v||h).id;return o.ZP.createElement("div",{className:S,onClick:L,"data-test-sender-id":c.Cg?R:void 0},"string"==typeof k?(0,a.Z)(k,["jumbo"===n?"hq_emoji":"emoji"]):k)}))},7551:(e,t,n)=>{n.d(t,{Z:()=>i});var o=n(4050),r=n(9107),c=n(2313),s=n(3103),l=n(231);const i=(0,o.X$)((e=>{let{isOpen:t,onClose:n,onCloseAnimationEnd:i,title:a,header:d,text:u,textParts:m,confirmLabel:f="Confirm",confirmHandler:h,confirmIsDestructive:v,isButtonsInOneRow:p,children:g}=e;const Z=(0,r.Z)(),E=(0,o.sO)(null),w=(0,o.I4)((e=>{-1===e&&h()}),[h]),C=(0,c.Z)(E,t,w,".Button");return o.ZP.createElement(s.Z,{className:"confirm",title:a,header:d,isOpen:t,onClose:n,onCloseAnimationEnd:i},u&&u.split("\\n").map((e=>o.ZP.createElement("p",null,e))),m||g,o.ZP.createElement("div",{className:p?"dialog-buttons mt-2":"",ref:E,onKeyDown:C},o.ZP.createElement(l.Z,{className:"confirm-dialog-button",isText:!0,onClick:h,color:v?"danger":"primary"},f),o.ZP.createElement(l.Z,{className:"confirm-dialog-button",isText:!0,onClick:n},Z("Cancel"))))}))},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:h,itemSelector:v=i,preloadBackwards:p=a,sensitiveArea:g=d,withAbsolutePositioning:Z,maxHeight:E,noScrollRestore:w=!1,noScrollRestoreOnTop:C=!1,noFastList:y,cacheBuster:A,children:P}=e,N=(0,r.sO)(null);t&&(N=t);const b=(0,r.sO)({}),[I,T]=(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,h]);(0,r.d4)((()=>{if(!I)return;if(p>0&&(!h||h.length<p))return void I(!0);const{scrollHeight:e,clientHeight:t}=N.current;t&&e<=t&&I()}),[h,I,p]),(0,r.bt)((()=>{const e=N.current,t=b.current;let n;if(t.listItemElements=e.querySelectorAll(v),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||w||C&&0===e.scrollTop||((0,s.Z)(e,n),t.isScrollTopJustUpdated=!0)}),[h,v,w,C,A,Z]);const k=(0,r.I4)((e=>{if(T&&I){const{isScrollTopJustUpdated:e,currentAnchor:t,currentAnchorTop:n}=b.current,o=b.current.listItemElements;if(e)return void(b.current.isScrollTopJustUpdated=!1);const r=o.length,c=N.current,{scrollTop:s,scrollHeight:l,offsetHeight:i}=c,a=s<=(r?o[0].offsetTop:0)+g,d=(r?o[r-1].offsetTop+o[r-1].offsetHeight:l)-(s+i)<=g;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&&(b.current.currentAnchor=e,b.current.currentAnchorTop=o,u=!0,T())}}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&&(b.current.currentAnchor=e,b.current.currentAnchorTop=o,u=!0,I())}}if(!u)if(null!=t&&t.offsetParent)b.current.currentAnchorTop=t.getBoundingClientRect().top;else{const e=o[0];e&&(b.current.currentAnchor=e,b.current.currentAnchorTop=e.getBoundingClientRect().top)}}m&&m(e)}),[I,T,m,g]);return r.ZP.createElement("div",{ref:N,className:n,onScroll:k,teactFastList:!y&&!Z,onKeyDown:f},Z&&null!=h&&h.length?r.ZP.createElement("div",{teactFastList:!y,style:`position: relative;${l.wZ?` height: ${E}px;`:void 0}`},P):P)}},3103:(e,t,n)=>{n.d(t,{Z:()=>f});var o=n(4050),r=n(517),c=n(6752),s=n(8674),l=n(1212),i=n(274),a=n(9107),d=n(6590),u=n(231),m=n(2898);const f=e=>{let{dialogRef:t,title:n,className:f,isOpen:h,header:v,hasCloseButton:p,noBackdrop:g,children:Z,onClose:E,onCloseAnimationEnd:w,onEnter:C,shouldSkipHistoryAnimations:y}=e;const{shouldRender:A,transitionClassNames:P}=(0,l.Z)(h,w,y,void 0,y),N=(0,o.sO)(null);(0,o.d4)((()=>h?(0,r.Z)({onEsc:E,onEnter:C}):void 0),[h,E,C]),(0,o.d4)((()=>h&&N.current?function(e){function t(t){if("Tab"!==t.key)return;t.preventDefault(),t.stopPropagation();const n=Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(!n.length)return;const o=n.findIndex((e=>e.isSameNode(document.activeElement)));let r=0;o>=0&&(r=t.shiftKey?o>0?o-1:n.length-1:o<n.length-1?o+1:0),n[r].focus()}return document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}}(N.current):void 0),[h]);const{forceClose:b}=(0,d.ZP)(h,E);(0,o.d4)((()=>()=>{h&&b()}),[]),(0,i.Z)((e=>{let[t]=e;return document.body.classList.toggle("has-open-dialog",h),(h||!h&&void 0!==t)&&(0,s.YW)(200),()=>{document.body.classList.remove("has-open-dialog")}}),[h]);const I=(0,a.Z)();if(!A)return;const T=(0,c.Z)("Modal",f,P,g&&"transparent-backdrop");return o.ZP.createElement(m.Z,null,o.ZP.createElement("div",{ref:N,className:T,tabIndex:-1,role:"dialog"},o.ZP.createElement("div",{className:"modal-container"},o.ZP.createElement("div",{className:"modal-backdrop",onClick:E}),o.ZP.createElement("div",{className:"modal-dialog",ref:t},v||(n?o.ZP.createElement("div",{className:"modal-header"},p&&o.ZP.createElement(u.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:I("Close"),onClick:E},o.ZP.createElement("i",{className:"icon-close"})),o.ZP.createElement("div",{className:"modal-title"},n)):void 0),o.ZP.createElement("div",{className:"modal-content custom-scroll"},Z)))))}},2898:(e,t,n)=>{n.d(t,{Z:()=>c});var o=n(4050),r=n(2916);const c=e=>{let{containerId:t,className:n,children:c}=e;const s=(0,o.sO)();return s.current||(s.current=document.createElement("div")),(0,o.bt)((()=>{const e=document.querySelector(t||"#portals");if(!e)return;const o=s.current;return n&&o.classList.add(n),e.appendChild(o),()=>{r.Z.render(void 0,o),e.removeChild(o)}}),[n,t]),r.Z.render(c,s.current)}},8360:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(7204);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=(0,o.Z)(e,t);return n||null!=e?e:r}},7407:(e,t,n)=>{n.d(t,{Z:()=>a});var o=n(4050),r=n(1713),c=n(782),s=n(5326),l=n(7204);function i(e,t,n,o){const{length:c}=e,s=o?e.indexOf(o):0,l=t===r.Uq.Forwards?s:s+1||c,i=Math.max(0,l-n),a=l+n-1,d=e.slice(Math.max(0,i),a+1);let u,m;switch(t){case r.Uq.Forwards:u=l>0,m=i>=0;break;case r.Uq.Backwards:u=l<c,m=a<=c-1}return{newViewportIds:d,areSomeLocal:u,areAllLocal:m}}const a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;const d=(0,o.sO)(),u=(0,o.sO)((()=>{if(!t||d.current)return;const{newViewportIds:e}=i(t,r.Uq.Forwards,a,t[0]);return e})()),m=(0,s.Z)();n&&(d.current={});const f=(0,l.Z)(t),h=(0,l.Z)(n);if(t&&!n&&(t!==f||n!==h)){const{offsetId:e=t[0],direction:n=r.Uq.Forwards}=d.current||{},{newViewportIds:o}=i(t,n,a,e);u.current&&(0,c.et)(u.current,o)||(u.current=o)}const v=(0,o.I4)((n=>{let{direction:o,noScroll:s}=n;const l=u.current,f=l?o===r.Uq.Backwards?l[l.length-1]:l[0]:void 0;if(!t)return void(e&&e({offsetId:f}));s||(d.current={...d.current,direction:o,offsetId:f});const{newViewportIds:h,areSomeLocal:v,areAllLocal:p}=i(t,o,a,f);!v||l&&(0,c.et)(l,h)||(u.current=h,m()),!p&&e&&e({offsetId:f})}),[t,a,e,m]);return n?[t]:[u.current,v]}},6202:(e,t,n)=>{n.d(t,{Z:()=>l});var o=n(4050),r=n(6137),c=n(647),s=n(5326);const l=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.IU.BlobUrl,l=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;const a=e?c.UV(e):void 0,d=(0,s.Z)();return(0,o.d4)((()=>{if(!t&&e&&!a){const t=Date.now();c.he(e,n).then((()=>{const e=Date.now()-t;!i||e>=i?d():setTimeout(d,i-e)}))}}),[t,e,a,n,l,d,i]),a}},2972:(e,t,n)=>{function o(e){e.offsetWidth}n.d(t,{Z:()=>o})},7675:(e,t,n)=>{n.d(t,{Z:()=>s,z:()=>c});var o=n(7361),r=n(2972);function c(e){e.style.display="none",(0,r.Z)(e),e.style.display=""}const s=(e,t)=>{o.cj&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),o.cj&&(e.style.overflow="")}},4753:(e,t,n)=>{n.d(t,{Z:()=>r});var o=n(3716);const r=e=>{e.play().catch((t=>{o.eM&&console.warn(t,e)}))}}}]);
//# sourceMappingURL=548.3bb36f6c7bb19731757e.js.map