telegram-tt/dist/37.9e975e031ef296075093.js

2 lines
113 KiB
JavaScript
Raw Normal View History

2022-01-24 04:57:29 +01:00
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[37],{7854:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(4050),r=n(6137),s=n(6752),i=n(3657),o=n(6202),c=n(692),l=n(5296),d=n(4399),u=n(7799);const m=(0,a.X$)((({sticker:e,effect:t,isOwn:n,soundId:m,size:h="medium",observeIntersection:f,lastSyncTime:v,forceLoadPreview:p,messageId:g,chatId:Z,activeEmojiInteraction:E})=>{var P;const{markAnimationLoaded:y,isAnimationLoaded:C,ref:b,width:N,style:w,handleClick:k,playKey:I}=(0,l.Z)(h,Z,g,m,E,n,void 0,null==t?void 0:t.emoji),T=`sticker${e.id}`,M=(0,i.Op)(b,f),S=null===(P=e.thumbnail)||void 0===P?void 0:P.dataUri,x=(0,o.Z)(`${T}?size=m`,!M&&!p,r.IU.BlobUrl,v),L=(0,c.Z)(x),$=(0,o.Z)(T,!M,r.IU.Lottie,v),A=Boolean($);return a.ZP.createElement("div",{ref:b,className:(0,s.Z)("AnimatedEmoji media-inner",e.id===d.wB&&"like-sticker-thumb"),style:w,onClick:k},!C&&S&&a.ZP.createElement("img",{src:S,alt:""}),!C&&x&&a.ZP.createElement("img",{src:x,className:L,alt:""}),A&&T&&a.ZP.createElement(u.Z,{key:T,id:T,animationData:$,size:N,quality:1,play:M&&I,forceOnHeavyAnimation:!0,noLoop:!0,onLoad:y}))}))},4752:(e,t,n)=>{n.d(t,{Z:()=>T});var a=n(4050),r=n(5116),s=n(6137),i=n(1713),o=n(7361),c=n(790),l=n(2858),d=n(6752),u=n(2340),m=n(5376),h=n(2566),f=n(1212),v=n(2019),p=n(3186),g=n(9107),Z=n(1174),E=n(6202),P=n(396),y=n(711),C=n(231),b=n(9196),N=n(8033);const w=o.wB?20:25,k=o.wB?50:75;function I(e,t,n){return a.ZP.createElement("div",{className:"seekline no-selection",ref:n},a.ZP.createElement("span",{className:"seekline-buffered-progress"},a.ZP.createElement("i",{style:`transform: translateX(${100*t}%)`})),a.ZP.createElement("span",{className:"seekline-play-progress"},a.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})),a.ZP.createElement("span",{className:"seekline-thumb"},a.ZP.createElement("i",{style:`transform: translateX(${100*e}%)`})))}const T=(0,a.X$)((({theme:e,message:t,senderTitle:n,uploadProgress:T,origin:M,date:S,lastSyncTime:x,className:L,isSelectable:$,isSelected:A,isDownloading:O,onPlay:F,onReadMedia:R,onCancelUpload:D,onDateClick:U})=>{const{content:{audio:B,voice:X,video:V},isMediaUnread:j}=t,z=Boolean(X||V),K=(0,a.sO)(!1),Y=(0,a.sO)(!1),H=(0,a.sO)(null),q=(0,g.Z)(),{isRtl:W}=q,_=(0,r.uC)(),[J,G]=(0,a.eJ)(!1),Q=x,ee=(0,l.Ti)(t,"pictogram"),te=(0,E.Z)(ee,!1,s.IU.BlobUrl),ne=(0,E.Z)((0,l.Ti)(t,"inline"),!Q,(0,l.kG)(t,"inline")),{loadProgress:ae}=(0,h.Z)((0,l.Ti)(t,"download"),!O),re=(0,a.I4)((()=>{G(!0),F(t.id,t.chatId)}),[t,F]),se=(0,a.I4)((()=>{G(!1)}),[]),{isBuffered:ie,bufferedProgress:oe,bufferingHandlers:ce,checkBuffering:le}=(0,v.Z)(),{isPlaying:de,playProgress:ue,playPause:me,play:he,pause:fe,setCurrentTime:ve,duration:pe}=(0,p.Z)((0,P.An)(t),(0,l.XV)(t),z?"voice":"audio",ne,ce,void 0,le,J,re,se,(0,l.CI)(t)),ge=(0,l.B4)(t),Ze=function(e,t,n=0,r=!1){const s=(0,a.sO)(null),{data:i,peak:o}=(0,a.Ye)((()=>{if(!t)return;const{waveform:e,duration:n}=t;if(!e)return{data:new Array(Math.min(n,30)).fill(0),peak:0};const a=Math.min(n/10,1),r=Math.round(w+(k-w)*a);return function(e,t){let n=0;const a=new Array(t),r=e.length/t,s=e[0],i=e[e.length-1];for(let d=0;d<t;d++){var o,c,l;const t=Math.floor(d*r),u=((null!==(o=e[t-1])&&void 0!==o?o:s)+(null!==(c=e[t])&&void 0!==c?c:s)+(null!==(l=e[t+1])&&void 0!==l?l:i))/3;a[d]=u,n<u&&(n=u)}return{data:a,peak:n}}(function(e){const t=8*e.length,n=Math.floor(t/5);if(!n)return[];const a=Array(n),r=e;for(let e=0,t=n-1;e!==t;++e){const t=Math.floor(5*e/8),n=Math.floor(5*e%8),s=r[t]+(r[t+1]<<8);a[e]=s>>n&31}const s=Math.floor(5*(n-1)/8),i=Math.floor(5*(n-1)%8),o=r[s]+(r[s+1]<<8);return a[n-1]=o>>i&31,a}(new Uint8Array(e)),r)}),[t])||{};return(0,a.bt)((()=>{const t=s.current;t&&i&&void 0!==o&&function(e,t,n,{peak:a,fillStyle:r,progressFillStyle:s}){const i=4*t.length;e.width=2*i,e.height=46,e.style.width=`${i}px`,e.style.height="23px";const o=e.getContext("2d");o.scale(2,2),t.forEach(((e,i)=>{o.globalAlpha=i/t.length>=n?.5:1,o.fillStyle=n>i/t.length?s:r;const c=Math.max(2,e/Math.max(1,a)*23);!function(e,t,n,a,r,s){2<2*s&&(s=1),r<2*s&&(s=r/2),e.beginPath(),e.moveTo(t+s,
//# sourceMappingURL=37.9e975e031ef296075093.js.map