mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-10 06:48:35 +01:00
2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[824],{7799:(e,t,n)=>{n.d(t,{Z:()=>u});var r=n(4050),o=n(9118),c=n(6752),s=n(8674),a=n(5332);let l,i;async function d(){return l||(l=n.e(941).then(n.bind(n,7941)),i=(await l).default),l}setTimeout(d,5e3);const u=(0,r.X$)((({className:e,id:t,animationData:n,play:l,playSegment:u,speed:m,noLoop:f,size:h,quality:p,isLowPriority:v,onLoad:g,color:w})=>{const[Z,y]=(0,r.eJ)(),E=(0,r.sO)(null),C=(0,r.sO)(!1),b=(0,r.sO)(!1),I=(0,r.sO)();I.current=l;const A=(0,r.sO)();A.current=u,(0,r.d4)((()=>{if(Z||!n)return;const e=()=>{if(!E.current)return;const e=new i(t,E.current,n,{noLoop:f,size:h,quality:p,isLowPriority:v},g,w);m&&e.setSpeed(m),y(e)};i?e():d().then((()=>{(0,o.T2)((()=>{E.current&&e()}))}))}),[w,Z,n,t,v,f,g,p,h,m]),(0,r.d4)((()=>{Z&&Z.setColor(w)}),[w,Z]),(0,r.d4)((()=>()=>{Z&&Z.destroy()}),[Z]);const T=(0,r.I4)(((e=!1)=>{Z&&(I.current||A.current)&&(A.current?Z.playSegment(A.current):e?Z.goToAndPlay(0):Z.play())}),[Z]),P=(0,r.I4)((()=>{Z&&Z.pause()}),[Z]),N=(0,r.I4)((()=>{b.current=!0,Z&&(C.current||(C.current=Z.isPlaying()),P())}),[Z,P]),S=(0,r.I4)((()=>{C.current&&T(),C.current=!1,b.current=!1}),[T]),L=(0,r.I4)((()=>{(0,o.T2)(S)}),[S]);(0,r.d4)((()=>{Z&&(l||u?b.current?C.current=!0:T(f):b.current?C.current=!1:P())}),[Z,l,u,f,T,P]),(0,r.d4)((()=>{Z&&(Z.changeData(n),T())}),[T,Z,n]),(0,s.ZP)(N,S),(0,a.Z)(N,L);const k=(0,c.Z)("AnimatedSticker",e),B=h?`width: ${h}px; height: ${h}px;`:void 0;return r.ZP.createElement("div",{ref:E,className:k,style:B})}))},172:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),o=n(6137),c=n(3716),s=n(2858),a=n(2155),l=n(6752),i=n(2340),d=n(6202),u=n(1212),m=n(9107);const f=(0,r.X$)((({className:e,size:t="large",chat:n,user:f,text:h,withOnlineStatus:p,isSavedMessages:v,lastSyncTime:g,onClick:w})=>{const Z=f&&(0,s.NB)(f),y=f&&(0,s.pK)(f.id);let E;v||Z||(f?E=(0,s.RT)(f):n&&(E=(0,s.RT)(n)));const C=(0,d.Z)(E,!1,o.IU.BlobUrl,g),b=Boolean(C),{transitionClassNames:I}=(0,u.Z)(b,void 0,b,"slow"),A=(0,m.Z)();let T="";if(v)T=r.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(Z)T=r.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(y)T=r.ZP.createElement("i",{className:"icon-reply-filled"});else if(C)T=r.ZP.createElement("img",{src:C,className:(0,l.Z)("avatar-media",I),alt:"",decoding:"async"});else if(f){const e=(0,s.Js)(f);T=e?(0,a.Xv)(e,2):void 0}else if(n){const e=(0,s.U)(A,n);T=e&&(0,a.Xv)(e,(0,s.YC)(n.id)?2:1)}else h&&(T=(0,a.Xv)(h,2));const P=!v&&f&&(0,s.kM)(f),N=(0,l.Z)(`Avatar size-${t}`,e,`color-bg-${(0,s.Rs)(f||n)}`,v&&"saved-messages",Z&&"deleted-account",y&&"replies-bot-account",p&&P&&"online",w&&"interactive",!v&&!C&&"no-photo"),S=Boolean(v||C),L=(0,r.I4)((e=>{w&&w(e,S)}),[w,S]),k=(f||n)&&(f||n).id;return r.ZP.createElement("div",{className:N,onClick:L,"data-test-sender-id":c.Cg?k:void 0},"string"==typeof T?(0,i.Z)(T,["jumbo"===t?"hq_emoji":"emoji"]):T)}))},1273:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(1713),o=n(4050),c=n(9118),s=n(7675);const a=({ref:e,className:t,onLoadMore:n,onScroll:a,onKeyDown:l,items:i,itemSelector:d=".ListItem",preloadBackwards:u=20,sensitiveArea:m=800,noScrollRestore:f=!1,noScrollRestoreOnTop:h=!1,noFastList:p,cacheBuster:v,children:g})=>{let w=(0,o.sO)(null);e&&(w=e);const Z=(0,o.sO)({}),[y,E]=(0,o.Ye)((()=>n?[(0,c.Ds)(((e=!1)=>{n({direction:r.Uq.Backwards,noScroll:e})}),1e3,!0,!1),(0,c.Ds)((()=>{n({direction:r.Uq.Forwards})}),1e3,!0,!1)]:[]),[n,i]);(0,o.d4)((()=>{if(!y)return;if(u>0&&(!i||i.length<u))return void y(!0);const{scrollHeight:e,clientHeight:t}=w.current;t&&e<=t&&y()}),[i,y,u]),(0,o.bt)((()=>{const e=w.current,t=Z.current;let n;if(t.listItemElements=e.querySelectorAll(d),t.currentAnchor&&Array.from(t.listItemElements).includes(t.currentAnchor)){const{scrollTop:r}=e;n=r+(t.currentAnchor.getBoundingClientRect().top-t.currentAnchorTop)}else{const e=t.listItemElements[0];e&&(t.currentAnchor=e,t.currentAnchorTop=e.getBoundingClientRect().top)}f||h&&0===e.scrollTop||((0,s.Z)(e,n),t.isScrollTopJustUpdated=!0)}),[i,d,f,h,v]);const C=(0,o.I4)((e=>{if(E&&y){const{isScrollTopJustUpdated:e,currentAnchor:t,currentAnchorTop:n}=Z.current,r=Z.current.listItemElements;if(e)return void(Z.current.isScrollTopJustUpdated=!1);const o=r.length,c=w.current,{scrollTop:a,scrollHeight:l,offsetHeight:i}=c,d=a<=(o?r[0].offsetTop:0)+m,u=(o?r[o-1].offsetTop+r[o-1].offsetHeight:l)-(a+i)<=m;let f=!1;if(d){const e=r[0];if(e){const r=e.getBoundingClientRect().top,o=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&o>n&&(Z.current.currentAnchor=e,Z.current.currentAnchorTop=r,f=!0,(0,s.Z)(c),E())}}if(u){const e=r[o-1];if(e){const r=e.getBoundingClientRect().top,o=null!=t&&t.offsetParent&&t!==e?t.getBoundingClientRect().top:r;t&&void 0!==n&&o<n&&(Z.current.currentAnchor=e,Z.current.currentAnchorTop=r,f=!0,(0,s.Z)(c),y())}}if(!f)if(null!=t&&t.offsetParent)Z.current.currentAnchorTop=t.getBoundingClientRect().top;else{const e=r[0];e&&(Z.current.currentAnchor=e,Z.current.currentAnchorTop=e.getBoundingClientRect().top)}}a&&a(e)}),[y,E,a,m]);return o.ZP.createElement("div",{ref:w,className:t,onScroll:C,teactFastList:!p,onKeyDown:l},g)}},3103:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(4050),o=n(517),c=n(6752),s=n(8674),a=n(1212),l=n(274),i=n(9107),d=n(6590),u=n(231),m=n(2898);const f=({dialogRef:e,title:t,className:n,isOpen:f,header:h,hasCloseButton:p,noBackdrop:v,children:g,onClose:w,onCloseAnimationEnd:Z,onEnter:y,shouldSkipHistoryAnimations:E})=>{const{shouldRender:C,transitionClassNames:b}=(0,a.Z)(f,Z,E,void 0,E),I=(0,r.sO)(null);(0,r.d4)((()=>f?(0,o.Z)({onEsc:w,onEnter:y}):void 0),[f,w,y]),(0,r.d4)((()=>f&&I.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 r=n.findIndex((e=>e.isSameNode(document.activeElement)));let o=0;r>=0&&(o=t.shiftKey?r>0?r-1:n.length-1:r<n.length-1?r+1:0),n[o].focus()}return document.addEventListener("keydown",t,!1),()=>{document.removeEventListener("keydown",t,!1)}}(I.current):void 0),[f]);const{forceClose:A}=(0,d.ZP)(f,w);(0,r.d4)((()=>()=>{f&&A()}),[]),(0,l.Z)((([e])=>(document.body.classList.toggle("has-open-dialog",f),(f||!f&&void 0!==e)&&(0,s.YW)(200),()=>{document.body.classList.remove("has-open-dialog")})),[f]);const T=(0,i.Z)();if(!C)return;const P=(0,c.Z)("Modal",n,b,v&&"transparent-backdrop");return r.ZP.createElement(m.Z,null,r.ZP.createElement("div",{ref:I,className:P,tabIndex:-1,role:"dialog"},r.ZP.createElement("div",{className:"modal-container"},r.ZP.createElement("div",{className:"modal-backdrop",onClick:w}),r.ZP.createElement("div",{className:"modal-dialog",ref:e},h||(t?r.ZP.createElement("div",{className:"modal-header"},p&&r.ZP.createElement(u.Z,{round:!0,color:"translucent",size:"smaller",ariaLabel:T("Close"),onClick:w},r.ZP.createElement("i",{className:"icon-close"})),r.ZP.createElement("div",{className:"modal-title"},t)):void 0),r.ZP.createElement("div",{className:"modal-content custom-scroll"},g)))))}},2898:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4050),o=n(2916);const c=({containerId:e,className:t,children:n})=>{const c=(0,r.sO)();return c.current||(c.current=document.createElement("div")),(0,r.bt)((()=>{const n=document.querySelector(e||"#portals");if(!n)return;const r=c.current;return t&&r.classList.add(t),n.appendChild(r),()=>{o.Z.render(void 0,r),n.removeChild(r)}}),[t,e]),o.Z.render(n,c.current)}},5332:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(4050);function o(e,t){(0,r.d4)((()=>(e&&!document.hasFocus()&&e(),e&&window.addEventListener("blur",e),t&&window.addEventListener("focus",t),()=>{t&&window.removeEventListener("focus",t),e&&window.removeEventListener("blur",e)})),[e,t])}},7407:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(4050),o=n(1713),c=n(782),s=n(5326),a=n(7204);const l=(e,t,n=!1,l=30,d=!1)=>{const u=(0,r.sO)(),m=(0,r.sO)((()=>{if(!t||u.current)return;const{newViewportIds:e}=i(t,o.Uq.Forwards,l,t[0]);return e})()),f=(0,s.Z)(),h=(0,a.Z)(t),p=(0,a.Z)(n);if(t&&!n&&(t!==h||n!==p)){const{offsetId:e=t[0],direction:n=o.Uq.Forwards}=u.current||{},{newViewportIds:r}=i(t,n,l,e);m.current&&(0,c.et)(m.current,r)||(m.current=r)}(0,r.d4)((()=>{if(t&&!n&&e&&d){const t=m.current;e({offsetId:t[t.length-1]})}}),[t,n,e,d]);const v=(0,r.I4)((({direction:n,noScroll:r})=>{const s=m.current,a=s?n===o.Uq.Backwards?s[s.length-1]:s[0]:void 0;if(!t)return void(e&&e({offsetId:a}));r||(u.current={...u.current,direction:n,offsetId:a});const{newViewportIds:d,areSomeLocal:h,areAllLocal:p}=i(t,n,l,a);!h||s&&(0,c.et)(s,d)||(m.current=d,f()),!p&&e&&e({offsetId:a})}),[t,l,e,f]);return n?[t]:[m.current,v]};function i(e,t,n,r){const{length:c}=e,s=r?e.indexOf(r):0,a=t===o.Uq.Forwards?s:s+1||c,l=Math.max(0,a-n),i=a+n-1,d=e.slice(Math.max(0,l),i+1);let u,m;switch(t){case o.Uq.Forwards:u=a>0,m=l>=0;break;case o.Uq.Backwards:u=a<c,m=i<=c-1}return{newViewportIds:d,areSomeLocal:u,areAllLocal:m}}},6202:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(4050),o=n(6137),c=n(647),s=n(5326);const a=(e,t=!1,n=o.IU.BlobUrl,a,l)=>{const i=e?c.UV(e):void 0,d=(0,s.Z)();return(0,r.d4)((()=>{if(!t&&e&&!i){const t=Date.now();c.he(e,n).then((()=>{const e=Date.now()-t;!l||e>=l?d():setTimeout(d,l-e)}))}}),[t,e,i,n,a,d,l]),i}},4319:(e,t,n)=>{n.d(t,{yl:()=>o,TE:()=>s,VP:()=>a});var r=n(3716);const o=navigator.clipboard&&window.ClipboardItem,c=document.createElement("textarea");c.setAttribute("readonly",""),c.tabIndex=-1,c.className="visually-hidden";const s=e=>{c.value=e,document.body.appendChild(c);const t=document.getSelection();if(t){const e=t.rangeCount>0&&t.getRangeAt(0);c.select(),document.execCommand("copy"),e&&(t.removeAllRanges(),t.addRange(e))}document.body.removeChild(c)},a=e=>{if(!e)return;const t=document.createElement("canvas"),n=t.getContext("2d"),r=new Image;r.onload=e=>{if(n&&e.currentTarget){const r=e.currentTarget;t.width=r.width,t.height=r.height,n.drawImage(r,0,0,r.width,r.height),t.toBlob(l,"image/png",1)}},r.src=e};async function l(e){if(e&&o)try{await navigator.clipboard.write([new window.ClipboardItem({[e.type]:e})])}catch(e){r.eM&&console.error(e)}}},7675:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(7361);const o=(e,t)=>{r.cj&&(e.style.overflow="hidden"),void 0!==t&&(e.scrollTop=t),r.cj&&(e.style.overflow="")}},4753:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(3716);const o=e=>{e.play().catch((t=>{r.eM&&console.warn(t,e)}))}}}]);
|
|
//# sourceMappingURL=824.99496e45ca79e9811441.js.map
|