mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-12 09:09:45 +01:00
2 lines
121 KiB
JavaScript
2 lines
121 KiB
JavaScript
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[621],{45601:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(14050),r=n(6137),o=n(6202),i=n(21179);function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},s.apply(this,arguments)}const l=(0,a.X$)((function(e){var t;const{sticker:n,noLoad:l,forcePreview:c,lastSyncTime:d,...u}=e,m=null==n||null===(t=n.thumbnail)||void 0===t?void 0:t.dataUri,h=`sticker${null==n?void 0:n.id}`,v=(0,o.Z)(n?`${h}?size=m`:void 0,l&&!c,r.IU.BlobUrl,d),p=(0,o.Z)(h,l,void 0,d);return a.ZP.createElement(i.Z,s({tgsUrl:p,previewUrl:v,thumbDataUri:m},u))}))},21179:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(46752),o=n(70692),i=n(58912);const s="src-components-common-AnimatedIconWithPreview-module__preview";var l=n(60706),c=n(80036);function d(){return d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},d.apply(this,arguments)}const u=(0,a.X$)((function(e){const{previewUrl:t,thumbDataUri:n,className:u,...m}=e,h=(0,o.Z)(t),[v,p]=(0,l.Z)(!1),{size:f}=e;return a.ZP.createElement("div",{className:(0,r.Z)(u,"src-components-common-AnimatedIconWithPreview-module__root"),style:(0,c.Z)(void 0!==f&&`width: ${f}px; height: ${f}px;`)},!v&&n&&a.ZP.createElement("img",{src:n,className:(0,r.Z)(s)}),!v&&a.ZP.createElement("img",{src:t,className:(0,r.Z)(s,h)}),a.ZP.createElement(i.Z,d({},m,{onLoad:p,noTransition:!0})))}))},54752:(e,t,n)=>{n.d(t,{Z:()=>x});var a=n(14050),r=n(33555),o=n(6137),i=n(91713),s=n(77361),l=n(790),c=n(75806);function d(e,t,n,a){let{peak:r,fillStyle:o,progressFillStyle:i}=a;const s=4*t.length;e.width=2*s,e.height=46,e.style.width=`${s}px`,e.style.height="23px";const l=e.getContext("2d");l.scale(2,2),t.forEach(((e,a)=>{l.globalAlpha=a/t.length>=n?.5:1,l.fillStyle=n>a/t.length?i:o;const s=Math.max(2,e/Math.max(1,r)*23);!function(e,t,n,a,r,o){2<2*o&&(o=1),r<2*o&&(o=r/2),e.beginPath(),e.moveTo(t+o,n),e.arcTo(t+2,n,t+2,n-r,o),e.arcTo(t+2,n-r,t,n-r,o),e.arcTo(t,n-r,t,n,o),e.arcTo(t,n,t+2,n,o),e.closePath()}(l,4*a,23,0,s,1),l.fill()}))}var u=n(46752),m=n(32340),h=n(15376);function v(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),o=r[t]+(r[t+1]<<8);a[e]=o>>n&31}const o=Math.floor(5*(n-1)/8),i=Math.floor(5*(n-1)%8),s=r[o]+(r[o+1]<<8);return a[n-1]=s>>i&31,a}function p(e,t){let n=0;const a=new Array(t),r=e.length/t,o=e[0],i=e[e.length-1];for(let d=0;d<t;d++){var s,l,c;const t=Math.floor(d*r),u=((null!==(s=e[t-1])&&void 0!==s?s:o)+(null!==(l=e[t])&&void 0!==l?l:o)+(null!==(c=e[t+1])&&void 0!==c?c:i))/3;a[d]=u,n<u&&(n=u)}return{data:a,peak:n}}var f=n(92566),g=n(31212),Z=n(12019),P=n(23186),E=n(59107),y=n(71174),C=n(6202),b=n(10396),N=n(50711),w=n(231),k=n(39196),I=n(88033);const S=s.wB?20:25,T=s.wB?50:75;function M(e,t,n){return a.ZP.createElement("div",{className:"seekline no-selection",ref:n},t.map((e=>{let{start:t,end:n}=e;return a.ZP.createElement("div",{className:"seekline-buffered-progress",style:`left: ${100*t}%; right: ${100-100*n}%`})})),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 x=(0,a.X$)((e=>{let{theme:t,message:n,senderTitle:x,uploadProgress:L,origin:$,date:O,lastSyncTime:F,className:A,isSelectable:D,isSelected:R,isDownloading:U,onPlay:B,onReadMedia:X,onCancelUpload:Y,onDateClick:_}=e;const{cancelMessageMediaDownload:V,downloadMessageMedia:K}=(0,r.Sv)(),{content:{audio:j,voice:z,video:W},isMediaUnread:H}=n,J=Boolean(z||W),q=(0,a.sO)(!1),G=(0,a.sO)(null),Q=(0,E.Z)(),{isRtl:ee}=Q,[te,ne]=(0,a.eJ)(!1),ae=F,re=(0,c.Ti)(n,"pictogram"),oe=(0,C.Z)(re,!1,o.IU.BlobUrl),ie=(0,C.Z)((0,c.Ti)(n,"inline"),!ae,(0,c.kG)(n,"inline")),{loadProgress:se}=(0,f.Z)((0,c.Ti)(n,"download"),!U),le=(0,a.I4)((()=>{ne(!0),B(n.id,n.chatId)}),[n,B]),ce=(0,a.I4)((()=>{ne(!1)}),[]),{isBuffered:de,bufferedRanges:ue,bufferingHandlers:me,checkBuffering:he}=(0,Z.Z)(),{isPlaying:ve,playProgress:pe,playPause:fe,setCurrentTime:ge,duration:Ze}=(0,P.Z)((0,b.An)(n),(0,c.XV)(n),J?"voice":"audio",ie,me,void 0,he,te,le,ce,(0,c.CI)(n)),Pe=(0,c.B4)(n),Ee=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=(0,a.sO)(null),{data:i,peak:s}=(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(S+(T-S)*a);return p(v(new Uint8Array(e)),r)}),[t])||{};return(0,a.bt)((()=>{const t=o.current;t&&i&&void 0!==s&&d(t,i,n,{peak:s,fillStyle:r?"dark"===e?"#B7ABED":"#AEDFA4":"dark"===e?"#494A78":"#ADD3F7",progressFillStyle:r?"dark"===e?"#FFFFFF":"#4FAE4E":"dark"===e?"#8774E1":"#3390EC"})}),[r,s,n,i,e]),o}(t,z,H&&!Pe?1:pe,Pe),ye=ve||pe>0&&pe<1;(0,a.d4)((()=>{ne(ve)}),[ve]);const Ce=te&&!de,{isUploading:be,isTransferring:Ne,transferProgress:we}=(0,c.Sc)(n,L||se,Ce||U),{shouldRender:ke,transitionClassNames:Ie}=(0,g.Z)(Ne),Se=ke&&(Ce||be),Te=(0,a.I4)((()=>{be?null==Y||Y():(ve||B(n.id,n.chatId),(0,r.Sv)().setAudioPlayerOrigin({origin:$}),ne(!te),fe())}),[be,ve,te,fe,Y,B,n.id,n.chatId,$]);(0,a.d4)((()=>{X&&H&&(ve||U)&&X()}),[ve,H,X,U]);const Me=(0,a.I4)((()=>{U?V({message:n}):K({message:n})}),[V,K,U,n]),xe=(0,a.I4)((e=>{if(q.current&&G.current){const{width:t,left:n}=G.current.getBoundingClientRect(),a=e instanceof MouseEvent?e.clientX:e.targetTouches[0].clientX;e.stopPropagation(),ge(Math.max(Math.min(Ze*((a-n)/t),Ze-.1),.001))}}),[Ze,ge]),Le=(0,a.I4)((e=>{e instanceof MouseEvent&&2===e.button||(q.current=!0,xe(e))}),[xe]),$e=(0,a.I4)((()=>{q.current=!1}),[]),Oe=(0,a.I4)((()=>{_(n.id,n.chatId)}),[_,n.id,n.chatId]);function Fe(){if(J)return x||"Voice";const{title:e,fileName:t}=j;return e||t}(0,a.d4)((()=>{if(G.current&&ye)return(0,y.sf)(G.current,{onCapture:Le,onRelease:$e,onClick:$e,onDrag:xe})}),[ye,Le,xe,$e]);const Ae=(0,u.Z)("Audio",A,Pe&&$===i.Cr.Inline&&"own",($===i.Cr.Search||$===i.Cr.SharedMedia)&&"bigger",R&&"audio-is-selected"),De=["toggle-play"];Se?De.push("loading"):De.push(ve?"pause":"play");const Re=(0,u.Z)("content",ye&&"with-seekline");function Ue(){return a.ZP.createElement("div",{className:Re},a.ZP.createElement("div",{className:"content-row"},a.ZP.createElement("p",{className:"title",dir:"auto",title:Fe()},(0,m.Z)(Fe())),a.ZP.createElement("div",{className:"message-date"},O&&a.ZP.createElement(I.Z,{className:"date",onClick:Oe},(0,l.VX)(Q,1e3*O)))),ye&&a.ZP.createElement("div",{className:"meta search-result",dir:ee?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},pe<1&&`${(0,l.k9)(Ze*pe,Ze)}`),M(pe,ue,G)),!ye&&function(){if(J)return a.ZP.createElement("div",{className:"meta",dir:ee?"rtl":void 0},(0,l.k9)((z||W).duration));const{performer:e}=j;return a.ZP.createElement("div",{className:"meta",dir:ee?"rtl":void 0},(0,l.k9)(Ze),a.ZP.createElement("span",{className:"bullet"},"•"),e&&a.ZP.createElement("span",{className:"performer",title:e},(0,m.Z)(e)),e&&x&&a.ZP.createElement("span",{className:"bullet"},"•"),x&&a.ZP.createElement("span",{title:x},(0,m.Z)(x)))}())}return a.ZP.createElement("div",{className:Ae,dir:Q.isRtl?"rtl":"ltr"},D&&a.ZP.createElement("div",{className:"message-select-control"},R&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement(w.Z,{round:!0,ripple:!s.wB,size:"smaller",color:oe?"translucent-white":"primary",className:De.join(" "),ariaLabel:ve?"Pause audio":"Play audio",onClick:Te,isRtl:Q.isRtl,backgroundImage:oe},a.ZP.createElement("i",{className:"icon-play"}),a.ZP.createElement("i",{className:"icon-pause"})),ke&&a.ZP.createElement("div",{className:(0,u.Z)("media-loading",Ie,Se&&"interactive")},a.ZP.createElement(k.Z,{progress:we,transparent:!0,size:"m",onClick:Se?Te:void 0,noCross:!Se})),j&&!be&&a.ZP.createElement(w.Z,{round:!0,size:"tiny",className:"download-button",ariaLabel:U?"Cancel download":"Download",onClick:Me},a.ZP.createElement("i",{className:U?"icon-close":"icon-arrow-down"})),$===i.Cr.Search&&Ue(),$!==i.Cr.Search&&j&&function(e,t,n,r,o,i,s,c,d,u,v){const{title:p,performer:f,fileName:g}=t,Z=r||o>0&&o<1,{isRtl:P}=N.i0;return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("p",{className:"title",dir:"auto",title:p},(0,m.Z)(p||g)),Z&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},a.ZP.createElement("span",{className:"duration with-seekline",dir:"auto"},(0,l.k9)(n*o,n)),M(o,i,s)),!Z&&c&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},u?`${(0,h.yW)(t.size*u)} / `:void 0,(0,h.yW)(t.size)),!Z&&!c&&a.ZP.createElement("div",{className:"meta",dir:P?"rtl":void 0},a.ZP.createElement("span",{className:"duration",dir:"auto"},(0,l.k9)(n)),f&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement("span",{className:"performer",dir:"auto",title:f},(0,m.Z)(f))),d&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"},"•"),a.ZP.createElement(I.Z,{className:"date",onClick:v},(0,l.ZK)(e,1e3*d,!0)))))}(Q,j,Ze,ve,pe,ue,G,U||be,O,we,_?Oe:void 0),$===i.Cr.SharedMedia&&(z||W)&&Ue(),$===i.Cr.Inline&&z&&function(e,t,n,r,o){return a.ZP.createElement("div",{className:"content"},a.ZP.createElement("div",{className:"waveform",draggable:!1,ref:t},a.ZP.createElement("canvas",{ref:n})),a.ZP.createElement("p",{className:(0,u.Z)("voice-duration",o&&"unread"),dir:"auto"},0===r?(0,l.k9)(e.duration):(0,l.k9)(e.duration*r)))}(z,G,Ee,pe,H))}))},70180:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(14050),r=n(33555),o=n(11192),i=n(75806),s=n(32340),l=n(64319),c=n(6272),d=n(59107),u=n(31876),m=n(83321);const h=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatOrUserId:n}=t;const{lastSyncTime:a,countryList:{phoneCodes:r}}=e,s=n?(0,o.Z1)(e,n):void 0,l=(0,i.YC)(n)?(0,o.dy)(e,n):void 0,c=s&&(0,i.i4)(s,(0,o.dZ)(e),(0,o.NJ)(e));return{lastSyncTime:a,phoneCodeList:r,chat:s,user:l,canInviteUsers:s&&!l&&(!(0,i.eA)(s)&&!(0,i.Mg)(s,"inviteUsers")||(0,i.VE)(s,"inviteUsers")),isMuted:c}}))((e=>{let{lastSyncTime:t,user:n,chat:o,forceShowSelf:h,canInviteUsers:v,isMuted:p,phoneCodeList:f}=e;const{loadFullUser:g,showNotification:Z,updateChatMutedState:P}=(0,r.Sv)(),{id:E,fullInfo:y,username:C,phoneNumber:b,isSelf:N}=n||{},{id:w}=o||{},k=(0,d.Z)();(0,a.d4)((()=>{t&&E&&g({userId:E})}),[g,E,t]);const I=(0,a.I4)((()=>{P({chatId:w,isMuted:!p})}),[w,p,P]);if(!o||o.isRestricted||N&&!h)return;function S(e,t){(0,l.TE)(e),Z({message:`${t} was copied`})}const T=b&&(0,c.WZ)(f,b),M=(0,i.hu)(o),x=(null==y?void 0:y.bio)||(0,i.GM)(o);return a.ZP.createElement("div",{className:"ChatExtra"},T&&Boolean(T.length)&&a.ZP.createElement(u.Z,{icon:"phone",multiline:!0,narrow:!0,ripple:!0,onClick:()=>S(T,k("Phone"))},a.ZP.createElement("span",{className:"title",dir:"auto"},T),a.ZP.createElement("span",{className:"subtitle"},k("Phone"))),C&&a.ZP.createElement(u.Z,{icon:"mention",multiline:!0,narrow:!0,ripple:!0,onClick:()=>S(`@${C}`,k("Username"))},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,s.Z)(C)),a.ZP.createElement("span",{className:"subtitle"},k("Username"))),x&&Boolean(x.length)&&a.ZP.createElement(u.Z,{icon:"info",multiline:!0,narrow:!0,isStatic:!0},a.ZP.createElement("span",{className:"title",dir:"auto"},(0,s.Z)(x,["br","links","emoji"])),a.ZP.createElement("span",{className:"subtitle"},k(E?"UserBio":"Info"))),(v||!C)&&M&&a.ZP.createElement(u.Z,{icon:o.username?"mention":"link",multiline:!0,narrow:!0,ripple:!0,onClick:()=>S(M,k("SetUrlPlaceholder"))},a.ZP.createElement("div",{className:"title"},M),a.ZP.createElement("span",{className:"subtitle"},k("SetUrlPlaceholder"))),!h&&a.ZP.createElement(u.Z,{icon:"unmute",ripple:!0,onClick:I},a.ZP.createElement("span",null,k("Notifications")),a.ZP.createElement(m.Z,{id:"group-notifications",label:E?"Toggle User Notifications":"Toggle Chat Notifications",checked:!p,inactive:!0})))})))},40329:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(14050),r=n(33555),o=n(11192),i=n(75806),s=n(59107),l=n(32340),c=n(70172),d=n(13103),u=n(231);const m=(0,a.X$)((0,r.c$)(((e,t)=>{let{chat:n}=t;const a=(0,i.YC)(n.id),r=(0,o.FM)(e,n.id),s=a&&(0,o.dy)(e,(0,i.zX)(n)),l=s&&(0,i.cS)(s)&&!n.isSupport,c=a&&!r&&!l,d=a?(0,i.Vl)((0,o.dy)(e,(0,i.zX)(n))):void 0;return{isPrivateChat:a,isChatWithSelf:r,isBot:l,isChannel:(0,i.eA)(n),isBasicGroup:(0,i.G9)(n),isSuperGroup:(0,i.ZV)(n),currentUserId:e.currentUserId,canDeleteForAll:c,contactName:d}}))((e=>{let{isOpen:t,chat:n,isChannel:o,isPrivateChat:m,isChatWithSelf:h,isBot:v,isBasicGroup:p,isSuperGroup:f,currentUserId:g,canDeleteForAll:Z,contactName:P,onClose:E,onCloseAnimationEnd:y}=e;const{leaveChannel:C,deleteHistory:b,deleteChannel:N,deleteChatUser:w,blockContact:k}=(0,r.Sv)(),I=(0,s.Z)(),S=(0,i.U)(I,n),T=(0,a.I4)((()=>{b({chatId:n.id,shouldDeleteForAll:!0}),E()}),[b,n.id,E]),M=(0,a.I4)((()=>{b({chatId:n.id,shouldDeleteForAll:!0}),k({contactId:n.id,accessHash:n.accessHash}),E()}),[b,n.id,n.accessHash,k,E]),x=(0,a.I4)((()=>{m?b({chatId:n.id,shouldDeleteForAll:!1}):p?(w({chatId:n.id,userId:g}),b({chatId:n.id,shouldDeleteForAll:!1})):!o&&!f||n.isCreator?(o||f)&&n.isCreator&&N({chatId:n.id}):C({chatId:n.id}),E()}),[m,p,o,f,g,n.isCreator,n.id,E,b,w,C,N]),L=(0,a.I4)((()=>{o||f?(C({chatId:n.id}),E()):x()}),[n.id,x,o,f,C,E]);return a.ZP.createElement(d.Z,{isOpen:t,className:"DeleteChatModal",header:a.ZP.createElement("div",{className:"modal-header",dir:I.isRtl?"rtl":void 0},a.ZP.createElement(c.Z,{size:"tiny",chat:n,isSavedMessages:h}),a.ZP.createElement("h3",{className:"modal-title"},I(o&&!n.isCreator?"LeaveChannel":o&&n.isCreator?"ChannelDelete":p||f?"Group.LeaveGroup":"DeleteChatUser"))),onClose:E,onCloseAnimationEnd:y},o&&n.isCreator?a.ZP.createElement("p",null,(0,l.Z)(I("ChatList.DeleteAndLeaveGroupConfirmation",S),["simple_markdown"])):o&&!n.isCreator||p||f?a.ZP.createElement("p",null,(0,l.Z)(I("ChannelLeaveAlertWithName",S),["simple_markdown"])):a.ZP.createElement("p",null,(0,l.Z)(I("ChatList.DeleteChatConfirmation",P),["simple_markdown"])),v&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:M},I("DeleteAndStop")),Z&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:T},P?(0,l.Z)(I("ChatList.DeleteForEveryone",P)):I("DeleteForAll")),!m&&n.isCreator&&a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:x},I("DeleteForAll")),a.ZP.createElement(u.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:m?x:L},I(o&&!n.isCreator?"LeaveChannel":o&&n.isCreator?"Chat.Input.Delete":p||f?"Group.LeaveGroup":Z?"ChatList.DeleteForCurrentUser":"Delete")),a.ZP.createElement(u.Z,{className:"confirm-dialog-button",isText:!0,onClick:E},I("Cancel")))})))},82535:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(14050),r=n(33555),o=n(15376),i=n(75806),s=n(3657),l=n(92566),c=n(6202),d=n(60706),u=n(47002);const m=(0,a.X$)((e=>{let{message:t,observeIntersection:n,smaller:m,canAutoLoad:h,autoLoadFileMaxSizeMb:v,uploadProgress:p,withDate:f,datetime:g,className:Z,sender:P,isSelected:E,isSelectable:y,onCancelUpload:C,onMediaClick:b,onDateClick:N,isDownloading:w}=e;const k=(0,r.Sv)(),I=(0,a.sO)(null),S=t.content.document,{fileName:T,size:M,timestamp:x}=S,L=(0,o.K2)(S)||"",$=(0,s.Op)(I,n),[O,F]=(0,d.Z)();(0,a.d4)((()=>{$&&F()}),[$,F]);const[A,D]=(0,a.eJ)(h&&(!v||M<=1048576*v)),R=Boolean(w||A&&O),U=(0,i.Ti)(t,"download"),{loadProgress:B,mediaData:X}=(0,l.Z)(U,!R,void 0,void 0,void 0,!0),Y=Boolean(X),{isUploading:_,isTransferring:V,transferProgress:K}=(0,i.Sc)(t,p||B,R&&!Y),j=(0,o.v6)(S),z=j?(0,i.DH)(t):void 0,W=j?S.previewBlobUrl:void 0,H=(0,c.Z)((0,i.Ti)(t,"pictogram"),!$),J=b&&Boolean(S.mediaType),q=(0,a.I4)((()=>{_?C&&C():w?k.cancelMessageMediaDownload({message:t}):V?D(!1):J?b():k.downloadMessageMedia({message:t})}),[_,w,V,J,C,k,t,b]),G=(0,a.I4)((()=>{N(t.id,t.chatId)}),[N,t.id,t.chatId]);return a.ZP.createElement(u.Z,{ref:I,name:T,extension:L,size:M,timestamp:f?g||x:void 0,thumbnailDataUri:z,previewData:W||H,smaller:m,isTransferring:V,isUploading:_,transferProgress:K,className:Z,sender:P,isSelectable:y,isSelected:E,actionIcon:J?(0,i.hC)(t)?"icon-play":"icon-eye":"icon-download",onClick:q,onDateClick:N?G:void 0})}))},78780:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(59107),o=n(46752);const i=e=>{let{content:t,className:n}=e;const i=(0,r.Z)();return a.ZP.createElement("span",{className:(0,o.Z)("DotAnimation",n),dir:i.isRtl?"rtl":"auto"},t,a.ZP.createElement("span",{className:"ellipsis"}))}},50685:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(59107);const o=(0,a.X$)((e=>{let{fakeType:t}=e;const n=(0,r.Z)();return a.ZP.createElement("span",{className:"FakeIcon"},n("fake"===t?"FakeMessage":"ScamMessage"))}))},47002:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(14050),r=n(31212),o=n(70692),i=n(46752),s=n(790),l=n(15376),c=n(74399),d=n(32340),u=n(59107),m=n(39196),h=n(88033);const v=(0,a.X$)((e=>{let{ref:t,name:n,size:v,extension:p="",timestamp:f,sender:g,thumbnailDataUri:Z,previewData:P,className:E,smaller:y,isTransferring:C,isUploading:b,isSelectable:N,isSelected:w,transferProgress:k,actionIcon:I,onClick:S,onDateClick:T}=e;const M=(0,u.Z)();let x=(0,a.sO)(null);t&&(x=t);const L=(0,o.Z)(P),{shouldRender:$,transitionClassNames:O}=(0,r.Z)(C,void 0,!0),F=(0,l.Oh)(p),A=(0,l.yW)(v),{width:D,height:R}=(0,c.lE)(y),U=(0,i.Z)("File",E,y&&"smaller",S&&!b&&"interactive",w&&"file-is-selected");return a.ZP.createElement("div",{ref:x,className:U,dir:M.isRtl?"rtl":void 0},N&&a.ZP.createElement("div",{className:"message-select-control"},w&&a.ZP.createElement("i",{className:"icon-select"})),a.ZP.createElement("div",{className:"file-icon-container",onClick:b?void 0:S},Z||P?a.ZP.createElement("div",{className:"file-preview media-inner"},a.ZP.createElement("img",{src:Z,width:D,height:R,className:"thumbnail",alt:""}),a.ZP.createElement("img",{src:P,className:(0,i.Z)("full-media",L),width:D,height:R,alt:""})):a.ZP.createElement("div",{className:`file-icon ${F}`},p.length<=4&&a.ZP.createElement("span",{className:"file-ext",dir:"auto"},p)),$&&a.ZP.createElement("div",{className:(0,i.Z)("file-progress",F,O)},a.ZP.createElement(m.Z,{progress:k,size:y?"s":"m",onClick:b?S:void 0})),S&&a.ZP.createElement("i",{className:(0,i.Z)("action-icon",I||"icon-download",$&&"hidden")})),a.ZP.createElement("div",{className:"file-info"},a.ZP.createElement("div",{className:"file-title",dir:"auto"},(0,d.Z)(n)),a.ZP.createElement("div",{className:"file-subtitle",dir:"auto"},a.ZP.createElement("span",null,C&&k?`${Math.round(100*k)}%`:A),g&&a.ZP.createElement("span",{className:"file-sender"},(0,d.Z)(g)),!g&&f&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"bullet"}),a.ZP.createElement(h.Z,{onClick:T},(0,s.ZK)(M,1e3*f,!0))))),g&&f&&a.ZP.createElement(h.Z,{onClick:T},(0,s.VX)(M,1e3*f)))}))},98799:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(14050),r=n(33555),o=n(91713),i=n(75806),s=n(11192),l=n(32340),c=n(59107),d=n(70172),u=n(89411),m=n(68729),h=n(78780),v=n(50685);const p=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatId:n}=t;const{lastSyncTime:a}=e,r=(0,s.Z1)(e,n);return{lastSyncTime:a,chat:r,onlineCount:r?(0,s.YK)(e,r):void 0,areMessagesLoaded:Boolean((0,s.Zw)(e,n))}}))((e=>{let{typingStatus:t,avatarSize:n="medium",status:s,withDots:p,withMediaViewer:f,withUsername:g,withFullInfo:Z,withUpdatingStatus:P,withChatType:E,noRtl:y,chat:C,onlineCount:b,areMessagesLoaded:N,lastSyncTime:w}=e;const{loadFullChat:k,openMediaViewer:I}=(0,r.Sv)(),S=C&&(0,i.ZV)(C),{id:T,isMin:M,isRestricted:x}=C||{};(0,a.d4)((()=>{T&&!M&&Z&&w&&k({chatId:T})}),[T,M,w,Z,k,S]);const L=(0,a.I4)(((e,t)=>{C&&t&&(e.stopPropagation(),I({avatarOwnerId:C.id,origin:"jumbo"===n?o.bZ.ProfileAvatar:o.bZ.MiddleHeaderAvatar}))}),[C,n,I]),$=(0,c.Z)();if(C)return a.ZP.createElement("div",{className:"ChatInfo",dir:!y&&$.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:C.id,size:n,chat:C,onClick:f?L:void 0}),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},(0,l.Z)((0,i.U)($,C))),C.isVerified&&a.ZP.createElement(u.Z,null),C.fakeType&&a.ZP.createElement(v.Z,{fakeType:C.fakeType})),function(){if(s)return p?a.ZP.createElement(h.Z,{className:"status",content:s}):a.ZP.createElement("span",{className:"status",dir:"auto"},s);if(P&&!N&&!x)return a.ZP.createElement(h.Z,{className:"status",content:$("Updating")});if(!C)return;if(t)return a.ZP.createElement(m.Z,{typingStatus:t});if(E)return a.ZP.createElement("span",{className:"status",dir:"auto"},$((0,i.l6)(C)));const e=g?C.username:void 0,n=function(e,t){const n=e((0,i.l6)(t)),{membersCount:a}=t;return t.isRestricted?"Channel"===n?"channel is inaccessible":"group is inaccessible":a?e("Channel"===n?"Subscribers":"Members",a,"i"):n}($,C),r=b?`, ${$("OnlineCount",b,"i")}`:void 0;return a.ZP.createElement("span",{className:"status"},e&&a.ZP.createElement("span",{className:"handle"},e),a.ZP.createElement("span",{className:"group-status"},n),r&&a.ZP.createElement("span",{className:"online-status"},r))}()))})))},76844:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(790),o=n(59107),i=n(8018);const s=(0,a.X$)((e=>{let{message:t,outgoingStatus:n}=e;const s=(0,o.Z)();return a.ZP.createElement("div",{className:"LastMessageMeta"},n&&a.ZP.createElement(i.Z,{status:n}),a.ZP.createElement("span",{className:"time"},(0,r.VX)(s,1e3*t.date)))}))},13709:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(790),o=n(3858),i=n(75806),s=n(46752),l=n(6202),c=n(70692),d=n(3657);const u=(0,a.X$)((e=>{let{message:t,idPrefix:n="shared-media",isProtected:u,observeIntersection:m,onClick:h}=e;const v=(0,a.sO)(null),p=(0,d.Op)(v,m),f=(0,i.DH)(t),g=(0,l.Z)((0,i.Ti)(t,"pictogram"),!p),Z=(0,c.Z)(g),P=(0,i.b7)(t),E=(0,a.I4)((()=>{h(t.id,t.chatId)}),[t.id,t.chatId,h]);return a.ZP.createElement("div",{ref:v,id:`${n}${(0,i.d0)(t.id)}`,className:"Media scroll-item",onClick:h?E:void 0},a.ZP.createElement("img",{src:f,alt:"",draggable:!u,decoding:"async",onContextMenu:u?o.Z:void 0}),a.ZP.createElement("img",{src:g,className:(0,s.Z)("full-media",Z),alt:"",draggable:!u,decoding:"async",onContextMenu:u?o.Z:void 0}),P&&a.ZP.createElement("span",{className:"video-duration"},P.isGif?"GIF":(0,r.k9)(P.duration)),u&&a.ZP.createElement("span",{className:"protector"}))}))},8018:(e,t,n)=>{n.d(t,{Z:()=>i});var a,r=n(14050),o=n(2255);!function(e){e[e.failed=0]="failed",e[e.pending=1]="pending",e[e.succeeded=2]="succeeded",e[e.read=3]="read"}(a||(a={}));const i=(0,r.X$)((e=>{let{status:t}=e;return r.ZP.createElement("div",{className:"MessageOutgoingStatus"},r.ZP.createElement(o.Z,{name:"reveal",activeKey:a[t]},r.ZP.createElement("i",{className:`icon-message-${t}`})))}))},47262:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(14050),r=n(46752),o=n(31212),i=n(32340),s=n(59107);const l="Nothing found.",c=(0,a.X$)((e=>{let{text:t=l,description:n}=e;const c=(0,s.Z)(),{transitionClassNames:d}=(0,o.Z)(!0);return a.ZP.createElement("div",{className:(0,r.Z)("NothingFound",d,n&&"with-description")},t,n&&a.ZP.createElement("p",{className:"description"},(0,i.Z)(c(n),["br"])))}))},99364:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(83716),o=n(77361),i=n(46752),s=n(59107),l=n(28183),c=n(231);const d=o.wB?550:400,u=(0,a.X$)((e=>{let{isLoading:t=!1,isPasswordVisible:n,error:u,hint:m,placeholder:h="Password",submitLabel:v="Next",shouldShowSubmit:p,shouldResetValue:f,shouldDisablePasswordManager:g=!1,noRipple:Z=!1,clearError:P,onChangePasswordVisibility:E,onInputChange:y,onSubmit:C}=e;const b=(0,a.sO)(null),N=(0,s.Z)(),[w,k]=(0,a.eJ)(""),[I,S]=(0,a.eJ)(!1);return(0,a.d4)((()=>{f&&k("")}),[f]),(0,l.Z)((()=>{o.$b||b.current.focus()}),d),(0,a.d4)((()=>{u&&requestAnimationFrame((()=>{b.current.focus(),b.current.select()}))}),[u]),a.ZP.createElement("form",{action:"",onSubmit:function(e){e.preventDefault(),t||I&&C(w)},autoComplete:"off"},a.ZP.createElement("div",{className:(0,i.Z)("input-group password-input",w&&"touched",u&&"error"),dir:N.isRtl?"rtl":void 0},a.ZP.createElement("input",{ref:b,className:"form-control",type:n?"text":"password",id:"sign-in-password",value:w||"",autoComplete:g?"one-time-code":"current-password",onChange:function(e){u&&P();const{target:t}=e;k(t.value),S(t.value.length>=r.lo),y&&y(t.value)},maxLength:256,dir:"auto"}),a.ZP.createElement("label",null,u||m||h),a.ZP.createElement("div",{className:"toggle-password",onClick:function(){E(!n)},role:"button",tabIndex:0,title:"Toggle password visibility"},a.ZP.createElement("i",{className:n?"icon-eye":"icon-eye-closed"}))),(I||p)&&a.ZP.createElement(c.Z,{type:"submit",ripple:!Z,isLoading:t,disabled:!I},v))}))},11820:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(14050),r=n(75806),o=n(21273),i=n(14605),s=n(97687),l=n(31876),c=n(6058),d=n(98799),u=n(49187),m=n(27407),h=n(59107),v=n(34288);const p=(0,a.X$)((e=>{let{itemIds:t,selectedIds:n,filterValue:p,filterPlaceholder:f,notFoundText:g,searchInputId:Z,isLoading:P,noScrollRestore:E,onSelectedIdsChange:y,onFilterChange:C,onLoadMore:b}=e;const N=(0,a.sO)(null),w=n.length>10;(0,a.d4)((()=>{setTimeout((()=>{requestAnimationFrame((()=>{N.current.focus()}))}),500)}),[]);const k=(0,a.I4)((e=>{const t=[...n];t.includes(e)?t.splice(t.indexOf(e),1):t.push(e),y(t),C("")}),[n,y,C]),I=(0,a.I4)((e=>{const{value:t}=e.currentTarget;C(t)}),[C]),[S,T]=(0,m.Z)(b,t,Boolean(p)),M=(0,h.Z)();return a.ZP.createElement("div",{className:"Picker"},a.ZP.createElement("div",{className:"picker-header custom-scroll",dir:M.isRtl?"rtl":void 0},n.map(((e,t)=>a.ZP.createElement(u.Z,{chatOrUserId:e,isMinimized:w&&t<n.length-5,canClose:!0,onClick:k,clickArg:e}))),a.ZP.createElement(s.Z,{id:Z,ref:N,value:p,onChange:I,placeholder:f||M("SelectChat")})),null!=S&&S.length?a.ZP.createElement(o.Z,{className:"picker-list custom-scroll",items:S,onLoadMore:T,noScrollRestore:E},S.map((e=>a.ZP.createElement(l.Z,{key:e,className:"chat-item-clickable picker-list-item",onClick:()=>k(e),ripple:!0},a.ZP.createElement(i.Z,{label:"",checked:n.includes(e)}),(0,r.YC)(e)?a.ZP.createElement(c.Z,{userId:e}):a.ZP.createElement(d.Z,{chatId:e}))))):P||!S||S.length?a.ZP.createElement(v.Z,null):a.ZP.createElement("p",{className:"no-results"},g||"Sorry, nothing found."))}))},49187:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(33555),o=n(11192),i=n(75806),s=n(32340),l=n(46752),c=n(59107),d=n(70172);const u=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatOrUserId:n}=t;return n?{chat:n?(0,o.Z1)(e,n):void 0,user:(0,i.YC)(n)?(0,o.dy)(e,n):void 0}:{}}))((e=>{let{icon:t,title:n,isMinimized:r,canClose:o,onClick:u,clickArg:m,chat:h,user:v,className:p}=e;const f=(0,c.Z)();let g,Z;if(t&&n)g=a.ZP.createElement("div",{className:"item-icon"},a.ZP.createElement("i",{className:`icon-${t}`})),Z=n;else if(h||v){g=a.ZP.createElement(d.Z,{chat:h,user:v,size:"small",isSavedMessages:null==v?void 0:v.isSelf});const e=!h||v&&!v.isSelf?(0,i.Vl)(v):(0,i.U)(f,h,v);Z=e?(0,s.Z)(e):void 0}const P=(0,l.Z)("PickerSelectedItem",p,r&&"minimized",o&&"closeable");return a.ZP.createElement("div",{className:P,onClick:()=>u(m),title:r?Z:void 0,dir:f.isRtl?"rtl":void 0},g,!r&&a.ZP.createElement("div",{className:"item-name",dir:"auto"},Z),o&&a.ZP.createElement("div",{className:"item-remove"},a.ZP.createElement("i",{className:"icon-close"})))})))},6058:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(14050),r=n(33555),o=n(91713),i=n(11192),s=n(75806),l=n(32340),c=n(59107),d=n(70172),u=n(89411),m=n(68729),h=n(78780),v=n(50685);const p=(0,a.X$)((0,r.c$)(((e,t)=>{let{userId:n,forceShowSelf:a}=t;const{lastSyncTime:r,serverTimeOffset:o}=e,s=(0,i.dy)(e,n);return{lastSyncTime:r,user:s,userStatus:(0,i.ss)(e,n),isSavedMessages:!a&&s&&s.isSelf,areMessagesLoaded:Boolean((0,i.Zw)(e,n)),serverTimeOffset:o}}))((e=>{let{typingStatus:t,avatarSize:n="medium",status:i,withDots:p,withMediaViewer:f,withUsername:g,withFullInfo:Z,withUpdatingStatus:P,noStatusOrTyping:E,noRtl:y,user:C,userStatus:b,isSavedMessages:N,areMessagesLoaded:w,lastSyncTime:k,serverTimeOffset:I}=e;const{loadFullUser:S,openMediaViewer:T}=(0,r.Sv)(),{id:M}=C||{},x=(0,s.Js)(C);(0,a.d4)((()=>{Z&&k&&M&&S({userId:M})}),[M,S,k,Z]);const L=(0,a.I4)(((e,t)=>{C&&t&&(e.stopPropagation(),T({avatarOwnerId:C.id,origin:"jumbo"===n?o.bZ.ProfileAvatar:o.bZ.MiddleHeaderAvatar}))}),[C,n,T]),$=(0,c.Z)();if(C)return a.ZP.createElement("div",{className:"ChatInfo",dir:!y&&$.isRtl?"rtl":void 0},a.ZP.createElement(d.Z,{key:C.id,size:n,user:C,isSavedMessages:N,onClick:f?L:void 0}),a.ZP.createElement("div",{className:"info"},N?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,$("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},x&&(0,l.Z)(x)),(null==C?void 0:C.isVerified)&&a.ZP.createElement(u.Z,null),C.fakeType&&a.ZP.createElement(v.Z,{fakeType:C.fakeType})),(i||!N&&!E)&&(i?p?a.ZP.createElement(h.Z,{className:"status",content:i}):a.ZP.createElement("span",{className:"status",dir:"auto"},i):P&&!w?a.ZP.createElement(h.Z,{className:"status",content:$("Updating")}):C?t?a.ZP.createElement(m.Z,{typingStatus:t}):a.ZP.createElement("span",{className:"status "+((0,s.kM)(C,b)?"online":"")},g&&C.username&&a.ZP.createElement("span",{className:"handle"},C.username),a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,s.Tq)($,C,b,I))):void 0)))})))},20787:(e,t,n)=>{n.d(t,{Z:()=>C});var a=n(14050),r=n(33555),o=n(91713),i=n(77361),s=n(11192),l=n(75806),c=n(32340),d=n(71174),u=n(46752),m=n(6137),h=n(40647),v=n(59107),p=n(89411),f=n(2155),g=n(6202),Z=n(49204);const P=(0,a.X$)((e=>{var t;let{chat:n,user:r,photo:o,isFirstPhoto:i,isSavedMessages:s,lastSyncTime:d,onClick:h}=e;const p=(0,v.Z)(),P=r&&(0,l.NB)(r),E=n&&(0,l.pK)(n.id);function y(e,t){if(o&&!t)return`photo${o.id}?size=c`;let a;return s||P||E||(r?a=(0,l.RT)(r,e):n&&(a=(0,l.RT)(n,e))),a}const C=(0,g.Z)(y("big"),!1,m.IU.BlobUrl,d),b=i&&!C?y("normal",!0):void 0,N=(0,g.Z)(b,!1,m.IU.BlobUrl,d),w=C||N||(null==o||null===(t=o.thumbnail)||void 0===t?void 0:t.dataUri);let k;if(s)k=a.ZP.createElement("i",{className:"icon-avatar-saved-messages"});else if(P)k=a.ZP.createElement("i",{className:"icon-avatar-deleted-account"});else if(E)k=a.ZP.createElement("i",{className:"icon-reply-filled"});else if(w)k=a.ZP.createElement("img",{src:w,className:"avatar-media",alt:""});else if(r){const e=(0,l.Js)(r);k=e?(0,f.Xv)(e,2):void 0}else if(n){const e=(0,l.U)(p,n);k=e&&(0,f.Xv)(e,(0,l.YC)(n.id)?2:1)}else k=a.ZP.createElement("div",{className:"spinner-wrapper"},a.ZP.createElement(Z.Z,{color:"white"}));const I=(0,u.Z)("ProfilePhoto",`color-bg-${(0,l.Rs)(r||n)}`,s&&"saved-messages",P&&"deleted-account",E&&"replies-bot-account",!s&&!w&&"no-photo");return a.ZP.createElement("div",{className:I,onClick:w?h:void 0},"string"==typeof k?(0,c.Z)(k,["hq_emoji"]):k)}));var E=n(2255),y=n(50685);const C=(0,a.X$)((0,r.c$)(((e,t)=>{let{userId:n,forceShowSelf:a}=t;const{connectionState:r,serverTimeOffset:o}=e,i=(0,s.dy)(e,n),l=(0,s.ss)(e,n),c=(0,s.Z1)(e,n),d=!a&&i&&i.isSelf,{animationLevel:u}=e.settings.byKey;return{connectionState:r,user:i,userStatus:l,chat:c,isSavedMessages:d,animationLevel:u,serverTimeOffset:o}}))((e=>{var t,n;let{forceShowSelf:s,user:f,userStatus:g,chat:Z,isSavedMessages:C,connectionState:b,animationLevel:N,serverTimeOffset:w}=e;const{loadFullUser:k,openMediaViewer:I}=(0,r.Sv)(),S=(0,v.Z)(),{id:T}=f||{},{id:M}=Z||{},x=f?(0,l.Js)(f):Z?Z.title:"",L=(null==f?void 0:f.photos)||(null==Z?void 0:Z.photos)||[],$=N>=1?S.isRtl?"slide-optimized-rtl":"slide-optimized":"none",[O,F]=(0,a.eJ)(0),A=C||L.length<=1||0===O,D=C||L.length<=1||O===L.length-1;(0,a.d4)((()=>{O>L.length&&F(Math.max(0,L.length-1))}),[O,L.length]),(0,a.d4)((()=>{"connectionStateReady"===b&&T&&!s&&k({userId:T})}),[T,k,b,s]),function(e,t,n){(0,a.d4)((()=>{t.slice(n,n+4).forEach((e=>{h.UV(`photo${e.id}?size=c`)||h.he(`photo${e.id}?size=c`,m.IU.BlobUrl)}))}),[n,t])}(0,L,O);const R=(0,a.I4)((()=>{I({avatarOwnerId:T||M,profilePhotoIndex:O,origin:s?o.bZ.SettingsAvatar:o.bZ.ProfileAvatar})}),[I,T,M,O,s]),U=(0,a.I4)((()=>{A||F(O-1)}),[O,A]),B=(0,a.I4)((()=>{D||F(O+1)}),[O,D]);if((0,a.d4)((()=>{const e=document.querySelector(".photo-wrapper");if(e)return(0,d.sf)(e,{selectorToPreventScroll:".Profile, .settings-content",onSwipe:i.$b?(e,t)=>t===d.eM.Right?(U(),!0):t===d.eM.Left&&(B(),!0):void 0})}),[B,U]),!f&&!Z)return;const X=null===(t=f||Z)||void 0===t?void 0:t.isVerified,Y=null===(n=f||Z)||void 0===n?void 0:n.fakeType;return a.ZP.createElement("div",{className:(0,u.Z)("ProfileInfo",s&&"self"),dir:S.isRtl?"rtl":void 0},a.ZP.createElement("div",{className:"photo-wrapper"},function(){if(!(C||!L||L.length<=1))return a.ZP.createElement("div",{className:"photo-dashes"},L.map(((e,t)=>a.ZP.createElement("span",{className:"photo-dash "+(t===O?"current":"")}))))}(),a.ZP.createElement(E.Z,{activeKey:O,name:$,className:"profile-slide-container"},function(){const e=!C&&L&&L.length>0?L[O]:void 0;return a.ZP.createElement(P,{key:O,user:f,chat:Z,photo:e,isSavedMessages:C,isFirstPhoto:A,onClick:R})}()),!A&&a.ZP.createElement("button",{type:"button",className:"navigation prev","aria-label":S("AccDescrPrevious"),onClick:U}),!D&&a.ZP.createElement("button",{type:"button",className:"navigation next","aria-label":S("Next"),onClick:B})),a.ZP.createElement("div",{className:"info",dir:S.isRtl?"rtl":"auto"},C?a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},S("SavedMessages"))):a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",{dir:"auto"},x&&(0,c.Z)(x)),X&&a.ZP.createElement(p.Z,null),Y&&a.ZP.createElement(y.Z,{fakeType:Y})),!C&&(f?a.ZP.createElement("div",{className:"status "+((0,l.kM)(f,g)?"online":"")},a.ZP.createElement("span",{className:"user-status",dir:"auto"},(0,l.Tq)(S,f,g,w))):a.ZP.createElement("span",{className:"status",dir:"auto"},(0,l.eA)(Z)?S("Subscribers",null!==(_=Z.membersCount)&&void 0!==_?_:0,"i"):S("Members",null!==(V=Z.membersCount)&&void 0!==V?V:0,"i")))));var _,V})))},48198:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(14050),r=n(33555),o=n(6137),i=n(6202),s=n(46752);const l=(0,a.X$)((e=>{var t,n,l;let{reaction:c,ref:d,className:u}=e;const m=null===(t=(0,r.Rd)().availableReactions)||void 0===t||null===(n=t.find((e=>e.reaction===c)))||void 0===n||null===(l=n.staticIcon)||void 0===l?void 0:l.id,h=(0,i.Z)(`document${m}`,!m,o.IU.BlobUrl);return a.ZP.createElement("img",{className:(0,s.Z)("ReactionStaticEmoji",u),ref:d,src:h,alt:""})}))},66534:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(14050),r=n(33555),o=n(59107),i=n(13103),s=n(231),l=n(14434),c=n(97687);const d=(0,a.X$)((e=>{let{isOpen:t,subject:n="messages",chatId:d,photo:u,messageIds:m,onClose:h,onCloseAnimationEnd:v}=e;const{reportMessages:p,reportPeer:f,reportProfilePhoto:g,exitMessageSelectMode:Z}=(0,r.Sv)(),[P,E]=(0,a.eJ)("spam"),[y,C]=(0,a.eJ)(""),b=(0,a.I4)((()=>{switch(n){case"messages":p({messageIds:m,reason:P,description:y}),Z();break;case"peer":f({chatId:d,reason:P,description:y});break;case"media":g({chatId:d,photo:u,reason:P,description:y})}h()}),[y,Z,m,u,h,p,P,d,g,f,n]),N=(0,a.I4)((e=>{E(e)}),[]),w=(0,a.I4)((e=>{C(e.target.value)}),[]),k=(0,o.Z)(),I=(0,a.Ye)((()=>[{value:"spam",label:k("lng_report_reason_spam")},{value:"violence",label:k("lng_report_reason_violence")},{value:"pornography",label:k("lng_report_reason_pornography")},{value:"childAbuse",label:k("lng_report_reason_child_abuse")},{value:"copyright",label:k("ReportPeer.ReasonCopyright")},{value:"illegalDrugs",label:"Illegal Drugs"},{value:"personalDetails",label:"Personal Details"},{value:"other",label:k("lng_report_reason_other")}]),[k]);if("messages"===n&&!m||"peer"===n&&!d||"media"===n&&(!d||!u))return;const S=k("messages"===n?"lng_report_message_title":"ReportPeer.Report");return a.ZP.createElement(i.Z,{isOpen:t,onClose:h,onEnter:t?b:void 0,onCloseAnimationEnd:v,className:"report",title:S},a.ZP.createElement(l.Z,{name:"report-message",options:I,onChange:N,selected:P}),a.ZP.createElement(c.Z,{label:k("lng_report_reason_description"),value:y,onChange:w}),a.ZP.createElement(s.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:b},k("lng_report_button")),a.ZP.createElement(s.Z,{className:"confirm-dialog-button",isText:!0,onClick:h},k("Cancel")))}))},73547:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(14050),r=n(33555),o=n(6137),i=n(46752),s=n(30386),l=n(74753),c=n(77361),d=n(3657),u=n(6202),m=n(31212),h=n(60706),v=n(59107),p=n(17240),f=n(63394),g=n(97799),Z=n(231),P=n(52328),E=n(58964);const y=(0,a.X$)((e=>{let{sticker:t,size:n,noAnimate:y,title:C,className:b,clickArg:N,noContextMenu:w,isSavedMessages:k,canViewSet:I,observeIntersection:S,onClick:T,onFaveClick:M,onUnfaveClick:x,onRemoveRecentClick:L}=e;const{openStickerSet:$}=(0,r.Sv)(),O=(0,a.sO)(null),F=(0,v.Z)(),A=`sticker${t.id}`,D=`sticker-button-${t.id}`,R=(0,d.Op)(O,S),U=t.thumbnail?t.thumbnail.dataUri:void 0,B=(0,u.Z)(`${A}?size=m`,!R,o.IU.BlobUrl),X=R&&!y,Y=(0,u.Z)(t.isLottie&&A,!X),[_,V,K]=(0,h.Z)(Boolean(Y)),j=_&&X,z=t.isVideo&&c.Hh,W=(0,u.Z)(z&&A,!X,o.IU.BlobUrl),H=Boolean(z&&W&&X),{transitionClassNames:J}=(0,m.Z)(Boolean(B||j),void 0,void 0,"slow"),{isContextMenuOpen:q,contextMenuPosition:G,handleBeforeContextMenu:Q,handleContextMenu:ee,handleContextMenuClose:te,handleContextMenuHide:ne}=(0,p.Z)(O),ae=(0,a.I4)((()=>O.current),[]),re=(0,a.I4)((()=>O.current.closest(".custom-scroll, .no-scrollbar")),[]),oe=(0,a.I4)((()=>O.current.querySelector(".sticker-context-menu .bubble")),[]),{positionX:ie,positionY:se,transformOriginX:le,transformOriginY:ce,style:de}=(0,f.Z)(G,ae,re,oe);(0,a.d4)((()=>{X||K()}),[K,X]),(0,a.d4)((()=>{if(!z||!O.current)return;const e=O.current.querySelector("video");e&&(H?(0,l.Z)(e):e.pause())}),[z,H]),(0,a.d4)((()=>{R||te()}),[te,R]);const ue=(0,a.I4)((e=>{e.stopPropagation(),e.preventDefault(),L(t)}),[L,t]),me=(0,a.I4)((()=>{L(t)}),[L,t]),he=(0,a.I4)((()=>{x(t)}),[x,t]),ve=(0,a.I4)((()=>{M(t)}),[M,t]),pe=(0,a.I4)((()=>{null==T||T(N,!0)}),[N,T]),fe=(0,a.I4)((()=>{null==T||T(N,void 0,!0)}),[N,T]),ge=(0,a.I4)((()=>{$({sticker:t})}),[$,t]),Ze=!c.$b&&L,Pe=(0,i.Z)("StickerButton",T&&"interactive",D,b),Ee=!U||j||H?"":`background-image: url('${U}');`;return a.ZP.createElement("div",{ref:O,className:Pe,title:C||(null==t?void 0:t.emoji),style:Ee,"data-sticker-id":t.id,onMouseDown:e=>{(0,s.b)(e),Q(e)},onClick:()=>{q||null==T||T(N)},onContextMenu:ee},!j&&!H&&a.ZP.createElement("img",{src:B,className:J}),z&&a.ZP.createElement("video",{className:J,src:W,autoPlay:H,loop:!0,playsInline:!0,muted:!0}),X&&Y&&a.ZP.createElement(g.Z,{tgsUrl:Y,play:!0,size:n,isLowPriority:!0,onLoad:V}),Ze&&a.ZP.createElement(Z.Z,{className:"sticker-remove-button",color:"dark",round:!0,onClick:ue},a.ZP.createElement("i",{className:"icon-close"})),!w&&T&&void 0!==G&&a.ZP.createElement(P.Z,{isOpen:q,transformOriginX:le,transformOriginY:ce,positionX:ie,positionY:se,style:de,className:"sticker-context-menu",autoClose:!0,onClose:te,onCloseAnimationEnd:ne},x&&a.ZP.createElement(E.Z,{icon:"favorite",onClick:he},F("Stickers.RemoveFromFavorites")),M&&a.ZP.createElement(E.Z,{icon:"favorite",onClick:ve},F("AddToFavorites")),!k&&a.ZP.createElement(E.Z,{onClick:pe,icon:"muted"},F("SendWithoutSound")),a.ZP.createElement(E.Z,{onClick:fe,icon:"calendar"},F(k?"SetReminder":"ScheduleMessage")),I&&a.ZP.createElement(E.Z,{onClick:ge,icon:"stickers"},F("ViewPackPreview")),L&&a.ZP.createElement(E.Z,{icon:"delete",onClick:me},F("DeleteFromRecent"))))}))},94851:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(99203),o=n(48778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,o.Z)(r.gl.Extra,"StickerSetModal",!t);return n?a.ZP.createElement(n,e):void 0}))},68729:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(14050),r=n(33555),o=n(11192),i=n(75806),s=n(32340),l=n(59107),c=n(78780);const d=(0,a.X$)((0,r.c$)(((e,t)=>{let{typingStatus:n}=t;return n.userId?{typingUser:(0,o.dy)(e,n.userId)}:{}}))((e=>{let{typingStatus:t,typingUser:n}=e;const r=(0,l.Z)(),o=n&&!n.isSelf&&(0,i.Vl)(n),d=r(t.action).replace("{user}","").replace("{emoji}",t.emoji).trim();return a.ZP.createElement("p",{className:"typing-status",dir:r.isRtl?"rtl":"auto"},o&&a.ZP.createElement("span",{className:"sender-name",dir:"auto"},(0,s.Z)(o)),a.ZP.createElement(c.Z,{content:d}))})))},89411:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050);const r={__html:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.3 2.9c.1.1.2.1.3.2.7.6 1.3 1.1 2 1.7.3.2.6.4.9.4.9.1 1.7.2 2.6.2.5 0 .6.1.7.7.1.9.1 1.8.2 2.6 0 .4.2.7.4 1 .6.7 1.1 1.3 1.7 2 .3.4.3.5 0 .8-.5.6-1.1 1.3-1.6 1.9-.3.3-.5.7-.5 1.2-.1.8-.2 1.7-.2 2.5 0 .4-.2.5-.6.6-.8 0-1.6.1-2.5.2-.5 0-1 .2-1.4.5-.6.5-1.3 1.1-1.9 1.6-.3.3-.5.3-.8 0-.7-.6-1.4-1.2-2-1.8-.3-.2-.6-.4-.9-.4-.9-.1-1.8-.2-2.7-.2-.4 0-.5-.2-.6-.5 0-.9-.1-1.7-.2-2.6 0-.4-.2-.8-.4-1.1-.6-.6-1.1-1.3-1.6-2-.4-.4-.3-.5 0-1 .6-.6 1.1-1.3 1.7-1.9.3-.3.4-.6.4-1 0-.8.1-1.6.2-2.5 0-.5.1-.6.6-.6.9-.1 1.7-.1 2.6-.2.4 0 .7-.2 1-.4.7-.6 1.4-1.2 2.1-1.7.1-.2.3-.3.5-.2z" style="fill: var(--color-fill)"/><path class="lol" d="M16.4 10.1l-.2.2-5.4 5.4c-.1.1-.2.2-.4 0l-2.6-2.6c-.2-.2-.1-.3 0-.4.2-.2.5-.6.7-.6.3 0 .5.4.7.6l1.1 1.1c.2.2.3.2.5 0l4.3-4.3c.2-.2.4-.3.6 0 .1.2.3.3.4.5.2 0 .3.1.3.1z" style="fill: var(--color-checkmark)"/></svg>'},o=()=>a.ZP.createElement("span",{className:"VerifiedIcon",dangerouslySetInnerHTML:r})},45418:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(14050),r=n(75806),o=n(46752),i=n(48035),s=n(32340),l=n(790),c=n(59107),d=n(996),u=n(13709),m=n(88033),h=n(10088);const v=(0,a.X$)((e=>{let{message:t,senderTitle:n,isProtected:v,observeIntersection:p,onMessageClick:f}=e;const g=(0,c.Z)();let Z=(0,r.s1)(t);if(!Z){const e=(0,r.T7)(t);if(e){const{url:n,domain:a}=e;Z={siteName:a.replace(/^www./,""),url:n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`,formattedDescription:(0,r.UD)(t)!==n?(0,d.e)(g,t,void 0,void 0,170):void 0}}}const P=(0,a.I4)((()=>{f(t.id,t.chatId)}),[f,t.id,t.chatId]);if(!Z)return;const{siteName:E,url:y,displayUrl:C,title:b,description:N,formattedDescription:w,photo:k,video:I}=Z,S=!n&&N&&(0,i.Z)(N,170),T=(0,o.Z)("WebLink scroll-item",!k&&!I&&"without-media");return a.ZP.createElement("div",{className:T,"data-initial":(E||C)[0],dir:g.isRtl?"rtl":void 0},k&&a.ZP.createElement(u.Z,{message:t,isProtected:v,observeIntersection:p}),a.ZP.createElement("div",{className:"content"},a.ZP.createElement(m.Z,{isRtl:g.isRtl,className:"site-title",onClick:P},(0,s.Z)(b||E||C)),(S||w)&&a.ZP.createElement(m.Z,{isRtl:g.isRtl,className:"site-description",onClick:P},w||S&&(0,s.Z)(S)),a.ZP.createElement(h.Z,{url:y,className:"site-name",text:"",isRtl:g.isRtl},y.replace("mailto:","")||C),n&&a.ZP.createElement("div",{className:"sender-name"},(0,s.Z)(n))),n&&a.ZP.createElement("div",{className:"message-date"},a.ZP.createElement(m.Z,{className:"date",onClick:P,isRtl:g.isRtl},(0,l.VX)(g,1e3*t.date))))}))},74399:(e,t,n)=>{n.d(t,{Eh:()=>P,GC:()=>E,Gw:()=>l,L6:()=>s,PA:()=>N,Rj:()=>c,W7:()=>y,Wr:()=>b,fM:()=>Z,jg:()=>w,kc:()=>f,lE:()=>C,vY:()=>d,wB:()=>u});var a=n(83716),r=n(77361),o=n(43858),i=n(75806);const s="(max-height: 640px)",l=parseInt(getComputedStyle(document.documentElement).fontSize,10),c=240,d={width:640,height:640},u="4986041492570112461",m={width:100,height:100};let h,v,p;function f(e,t,n,a){const i=t||n?1.625:0,s=function(e,t){const n=e?30:29;if(!r.wB)return n;const{width:a}=o.Z.get();return h||(h=Math.min(30,a/l-4.5)),v||(v=Math.min(29,a/l-7)),p||(p=Math.min(29,a/l-4.5)),e?h:t?p:v}(e,a)-i;return s*l}function g(e){let{width:t,height:n,fromOwnMessage:a,isForwarded:r,isWebPagePhoto:o,isGif:i,noAvatars:s}=e;const c=n/t,d=f(a,r,o,s),u=function(e,t){return e&&t&&t>=.75&&t<=1.25?20*l:27*l}(i,c),m=i?Math.max(300,t):t;return w(d,u,m,i?n*(m/t):n)}function Z(e,t){const n=window.matchMedia(s),{width:a,height:i}=o.Z.get();let c=t&&n.matches?10:8.25;return e&&!r.$b&&(c=n.matches?10:12.5),{width:a,height:i-c*l}}function P(e,t,n,a,r){const{width:o,height:s}=(0,i.HV)(e)||m;return g({width:o,height:s,fromOwnMessage:t,isForwarded:n,isWebPagePhoto:a,noAvatars:r})}function E(e,t,n,a){const{width:r,height:o}=(0,i.jC)(e)||m;return g({width:r,height:o,fromOwnMessage:t,isForwarded:n,isGif:e.isGif,noAvatars:a})}function y(){return{width:2*l,height:2*l}}function C(e){return e?{width:3*l,height:3*l}:{width:3.375*l,height:3.375*l}}function b(e){const{width:t}=e;let{height:n}=e;e.id===u&&(n=t);const o=n&&t&&n/t,i=l*(r.wB?a.w7:a.K7),s=o?i*o:i;return o&&s>i?{width:Math.round(i/o),height:i}:{width:i,height:s}}function N(e,t){let{width:n,height:a}=e,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{width:o,height:i}=Z(t,r);return w(o,i,n,a)}function w(e,t,n,a){const r=a/n,o=Math.min(n,e);return Math.round(o*r)>t?{width:Math.round(t/r),height:t}:{width:o,height:Math.round(o*r)}}},50742:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(99203),o=n(48778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,o.Z)(r.gl.Extra,"ChatFolderModal",!t);return n?a.ZP.createElement(n,e):void 0}))},1080:(e,t,n)=>{n.d(t,{Z:()=>z});var a=n(14050),r=n(33555),o=n(83716),i=n(77361),s=n(60782),l=n(16974),c=n(87204),d=n(27407),u=n(95616);let m;!function(e){e[e.Move=0]="Move",e[e.Opacity=1]="Opacity",e[e.None=2]="None"}(m||(m={}));var h=n(73541),v=n(21273),p=n(34288),f=n(59107),g=n(6137),Z=n(75806),P=n(11192),E=n(18005),y=n(32340),C=n(69118),b=n(46752),N=n(75790),w=n(41470),k=n(60706),I=n(6202),S=n(996),T=n(70172),M=n(89411),x=n(68729),L=n(76844),$=n(40329),O=n(31876),F=n(2155),A=n(40126);const D=(0,a.X$)((e=>{let{chat:t,isPinned:n,isMuted:r}=e;const o=Boolean(t.unreadCount||t.unreadMentionsCount||t.hasUnreadMark||n||t.unreadReactionsCount),i=Boolean(t.unreadCount||t.hasUnreadMark),s=(0,b.Z)("Badge",r&&"muted",!i&&n&&"pinned",i&&"unread");return a.ZP.createElement(A.Z,{isCustom:!0,className:"Badge-transition",isOpen:o},function(){const e=t.unreadReactionsCount&&a.ZP.createElement("div",{className:(0,b.Z)("Badge reaction",r&&"muted")},a.ZP.createElement("i",{className:"icon-heart"})),o=t.unreadMentionsCount&&a.ZP.createElement("div",{className:"Badge mention"},a.ZP.createElement("i",{className:"icon-mention"})),i=t.hasUnreadMark||t.unreadCount?a.ZP.createElement("div",{className:s},!t.hasUnreadMark&&(0,F.bi)(t.unreadCount)):void 0,l=[e,o,i,n&&!i&&!o&&!e&&a.ZP.createElement("div",{className:s},a.ZP.createElement("i",{className:"icon-pinned-chat"}))].filter(Boolean);if(0!==l.length)return 1===l.length?l[0]:a.ZP.createElement("div",{className:"Badge-wrapper"},l)}())}));var R=n(50742);const U=(0,a.X$)((e=>{let{isSelected:t,isActive:n}=e;return a.ZP.createElement("div",{className:(0,b.Z)("ChatCallStatus",n&&"active",t&&!i.wB&&"selected")},a.ZP.createElement("div",{className:"indicator"},a.ZP.createElement("div",null),a.ZP.createElement("div",null),a.ZP.createElement("div",null)))}));var B=n(66534),X=n(50685);const Y=(0,a.X$)((0,r.c$)(((e,t)=>{var n;let{chatId:a}=t;const r=(0,P.Z1)(e,a);if(!r||!r.lastMessage)return{};const{senderId:o,replyToMessageId:i,isOutgoing:s}=r.lastMessage,l=o?(0,P.dy)(e,o):void 0,c=(0,Z.N5)(r.lastMessage),d=c&&i?(0,P.hj)(e,r.id,i):void 0,{targetUserIds:u,targetChatId:m}=c||{},h=(0,Z.zX)(r),{chatId:v,threadId:p,type:f}=(0,P.Bt)(e)||{},E=a===v&&p===g._f;return{chat:r,isMuted:(0,Z.i4)(r,(0,P.dZ)(e),(0,P.NJ)(e)),lastMessageSender:l,actionTargetUserIds:u,actionTargetChatId:m,actionTargetMessage:d,draft:(0,P.Ms)(e,a,g._f),animationLevel:e.settings.byKey.animationLevel,isSelected:E,canScrollDown:E&&"thread"===f,canChangeFolder:Boolean(null===(n=e.chatFolders.orderedIds)||void 0===n?void 0:n.length),lastSyncTime:e.lastSyncTime,...s&&{lastMessageOutgoingStatus:(0,P.dT)(e,r.lastMessage)},...h&&{user:(0,P.dy)(e,h),userStatus:(0,P.ss)(e,h)}}}))((e=>{let{style:t,chatId:n,folderId:s,orderDiff:l,animationType:c,isPinned:d,chat:u,isMuted:h,user:v,userStatus:p,actionTargetUserIds:g,lastMessageSender:P,lastMessageOutgoingStatus:F,actionTargetMessage:A,actionTargetChatId:Y,draft:_,animationLevel:V,isSelected:K,canScrollDown:j,canChangeFolder:z,lastSyncTime:W}=e;const{openChat:H,focusLastMessage:J}=(0,r.Sv)(),q=(0,a.sO)(null),[G,Q,ee]=(0,k.Z)(),[te,ne,ae]=(0,k.Z)(),[re,oe,ie]=(0,k.Z)(),[se,le,ce]=(0,k.Z)(),[de,ue,me]=(0,k.Z)(),[he,ve,pe]=(0,k.Z)(),{lastMessage:fe,typingStatus:ge}=u||{},Ze=fe&&(0,Z.Lo)(fe);(0,N.Z)(n,Ze?fe.replyToMessageId:void 0,A);const Pe=fe&&!(0,Z.bf)(fe)?(0,Z.DH)(fe):void 0,Ee=(0,I.Z)(fe?(0,Z.Ti)(fe,"micro"):void 0),ye=Boolean(fe&&(0,Z.Y5)(fe)),Ce=(0,a.Ye)((()=>{if(!g)return;const e=(0,r.Rd)().users.byId;return g.map((t=>e[t])).filter(Boolean)}),[g]);(0,a.bt)((()=>{const e=q.current;if(0!==V&&e){if(c===m.Opacity)e.style.opacity="0",(0,C.T2)((()=>{e.classList.add("animate-opacity"),e.style.opacity="1"}));else{if(c!==m.Move)return;e.style.transform=`translate3d(0, ${100*-l}%, 0)`,(0,C.T2)((()=>{e.classList.add("animate-transform"),e.style.transform=""}))}setTimeout((()=>{(0,C.T2)((()=>{e.classList.remove("animate-opacity","animate-transform"),e.style.opacity="",e.style.transform=""}))}),200+o.fK)}}),[V,l,c]);const be=(0,a.I4)((()=>{H({id:n,shouldReplaceHistory:!0}),K&&j&&J()}),[K,j,H,n,J]),Ne=(0,a.I4)((()=>{le(),Q()}),[le,Q]),we=(0,a.I4)((()=>{ue(),ne()}),[ue,ne]),ke=(0,a.I4)((()=>{ve(),oe()}),[ve,oe]),Ie=(0,w.Z)({chat:u,user:v,handleDelete:Ne,handleChatFolderChange:we,handleReport:ke,folderId:s,isPinned:d,isMuted:h,canChangeFolder:z}),Se=(0,f.Z)();if(!u)return;const Te=(0,b.Z)("Chat chat-item-clickable",(0,Z.YC)(n)?"private":"group",K&&"selected");return a.ZP.createElement(O.Z,{ref:q,className:Te,style:t,ripple:!i.wB,contextActions:Ie,onClick:be},a.ZP.createElement("div",{className:"status"},a.ZP.createElement(T.Z,{chat:u,user:v,userStatus:p,isSavedMessages:null==v?void 0:v.isSelf,lastSyncTime:W}),u.isCallActive&&u.isCallNotEmpty&&a.ZP.createElement(U,{isSelected:K,isActive:0!==V})),a.ZP.createElement("div",{className:"info"},a.ZP.createElement("div",{className:"title"},a.ZP.createElement("h3",null,(0,y.Z)((0,Z.U)(Se,u,v))),u.isVerified&&a.ZP.createElement(M.Z,null),u.fakeType&&a.ZP.createElement(X.Z,{fakeType:u.fakeType}),h&&a.ZP.createElement("i",{className:"icon-muted"}),u.lastMessage&&a.ZP.createElement(L.Z,{message:u.lastMessage,outgoingStatus:F})),a.ZP.createElement("div",{className:"subtitle"},function(){if(ge&&fe&&ge.timestamp>1e3*fe.date)return a.ZP.createElement(x.Z,{typingStatus:ge});if(null!=_&&_.text.length)return a.ZP.createElement("p",{className:"last-message",dir:Se.isRtl?"auto":"ltr"},a.ZP.createElement("span",{className:"draft"},Se("Draft")),(0,y.Z)(_.text));if(!fe)return;if(Ze){const e=u&&((0,Z.eA)(u)||fe.senderId===fe.chatId);return a.ZP.createElement("p",{className:"last-message",dir:Se.isRtl?"auto":"ltr"},(0,E.D)(Se,fe,e?void 0:P,e?u:void 0,Ce,A,Y,{asTextWithSpoilers:!0}))}const e=(0,Z.zF)(Se,n,P);return a.ZP.createElement("p",{className:"last-message",dir:Se.isRtl?"auto":"ltr"},e&&a.ZP.createElement(a.ZP.Fragment,null,a.ZP.createElement("span",{className:"sender-name"},(0,y.Z)(e)),a.ZP.createElement("span",{className:"colon"},":")),function(e,t,n,r){return n?a.ZP.createElement("span",{className:"media-preview"},a.ZP.createElement("img",{src:n,alt:"",className:(0,b.Z)("media-preview--image",r&&"round")}),(0,Z.b7)(t)&&a.ZP.createElement("i",{className:"icon-play"}),(0,S.e)(e,t,!0)):(0,S.e)(e,t)}(Se,fe,Ee||Pe,ye))}(),a.ZP.createElement(D,{chat:u,isPinned:d,isMuted:h}))),se&&a.ZP.createElement($.Z,{isOpen:G,onClose:ee,onCloseAnimationEnd:ce,chat:u}),de&&a.ZP.createElement(R.Z,{isOpen:te,onClose:ae,onCloseAnimationEnd:me,chatId:n}),he&&a.ZP.createElement(B.Z,{isOpen:re,onClose:ie,onCloseAnimationEnd:pe,chatId:n,subject:"peer"}))})));var _=n(91713),V=n(231),K=n(45601);const j=(0,a.X$)((0,r.c$)(((e,t)=>{let{folderId:n,folderType:a}=t;return{chatFolder:n&&"folder"===a?(0,P.Mw)(e,n):void 0,animatedEmoji:(0,P.zB)(e,"📂")}}))((e=>{let{chatFolder:t,animatedEmoji:n,foldersDispatch:r,onScreenSelect:o}=e;const s=(0,f.Z)(),l=(0,a.I4)((()=>{r({type:"editFolder",payload:t}),o(_.MT.FoldersEditFolderFromChatList)}),[t,r,o]);return a.ZP.createElement("div",{className:"EmptyFolder"},a.ZP.createElement("div",{className:"sticker"},n&&a.ZP.createElement(K.Z,{sticker:n,size:128})),a.ZP.createElement("h3",{className:"title",dir:"auto"},s("FilterNoChatsToDisplay")),a.ZP.createElement("p",{className:"description",dir:"auto"},s(t?"ChatList.EmptyChatListFilterText":"Chat.EmptyChat")),t&&r&&o&&a.ZP.createElement(V.Z,{ripple:!i.wB,fluid:!0,pill:!0,onClick:l,size:"smaller",isRtl:s.isRtl},a.ZP.createElement("i",{className:"icon-settings"}),s("ChatList.EmptyChatListEditFilter")))}))),z=(0,a.X$)((e=>{let{folderType:t,folderId:n,isActive:f,foldersDispatch:g,onScreenSelect:Z}=e;const{openChat:P,openNextChat:E}=(0,r.Sv)(),y="all"===t?o.Nf:"archived"===t?o.WS:n,C=(0,u.d7)(y),b=(0,a.Ye)((()=>{if(C)return C.reduce(((e,t,n)=>(e[t]=n,e)),{})}),[C]),N=(0,c.Z)(b),w=(0,a.Ye)((()=>b&&N?(0,s.Q8)(b,((e,t)=>void 0!==N[t]?e-N[t]:-1/0)):{}),[b,N]),[k,I]=(0,d.Z)(void 0,C,void 0,o.t_);(0,h.y)(f&&null!=C&&C.length?{"alt+ArrowUp":e=>{e.preventDefault(),E({targetIndexDelta:-1,orderedIds:C})},"alt+ArrowDown":e=>{e.preventDefault(),E({targetIndexDelta:1,orderedIds:C})}}:void 0),(0,a.d4)((()=>{if(f&&C&&i.fl)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){if((i.jm&&e.metaKey||!i.jm&&e.ctrlKey)&&e.code.startsWith("Digit")){const[,t]=e.code.match(/Digit(\d)/)||[];if(!t)return;const n=Number(t)-1;if(n>C.length-1)return;P({id:C[n],shouldReplaceHistory:!0})}}}),[f,P,E,C]);const S=function(e){return(0,a.Ye)((()=>{const t=Object.values(e),n=t.filter((e=>e<0)).length,a=t.filter((e=>e>0)).length;return t=>{const r=e[t];return 0===r?m.None:r===1/0||r===-1/0||n<=a&&r<0||a<n&&r>0?m.Opacity:m.Move}}),[e])}(w);return a.ZP.createElement(v.Z,{className:"chat-list custom-scroll",items:k,preloadBackwards:o.t_,withAbsolutePositioning:!0,maxHeight:((null==C?void 0:C.length)||0)*o.rS,onLoadMore:I},null!=k&&k.length?function(){const e=C.indexOf(k[0]),t=(0,l.aE)(y)||0;return k.map(((r,i)=>{const s=e+i<t;return a.ZP.createElement(Y,{key:r,teactOrderKey:s?i:(0,l.jK)(r),chatId:r,isPinned:s,folderId:n,animationType:S(r),orderDiff:w[r],style:`top: ${(e+i)*o.rS}px;`})}))}():k&&!k.length?a.ZP.createElement(j,{folderId:n,folderType:t,foldersDispatch:g,onScreenSelect:Z}):a.ZP.createElement(p.Z,{key:"loading"}))}))},91:(e,t,n)=>{n.d(t,{F:()=>r});var a=n(75806);function r(e,t,n,r){const{senderId:o}=t;if(!o)return;const i=(0,a.YC)(o)?r[o]:n[o];let s=(0,a.OU)(e,i);const l=n[t.chatId];return l&&((0,a.YC)(o)&&i.isSelf?s=`${e("FromYou")} → ${(0,a.U)(e,l)}`:(0,a.Bf)(l)&&(s+=` → ${(0,a.U)(e,l)}`)),s}},67146:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(99203),o=n(48778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,o.Z)(r.gl.Extra,"CustomSendMenu",!t);return n?a.ZP.createElement(n,e):void 0}))},12420:(e,t,n)=>{n.d(t,{t:()=>m,Z:()=>h});var a=n(14050),r=n(31212),o=n(46752),i=n(21262),s=n(23989),l=n(87204),c=n(62898),d=n(60706);const u=(0,a.X$)((e=>{let{isQuick:t,onFileSelect:n}=e;const[r,i,s]=(0,d.Z)(),l=(0,o.Z)("DropTarget",r&&"hovered");return a.ZP.createElement("div",{className:l,onDrop:n,onDragEnter:()=>{i()},onDragLeave:e=>{const{relatedTarget:t}=e;t&&e.stopPropagation(),s()}},a.ZP.createElement("div",{className:"target-content"},a.ZP.createElement("div",{className:"icon icon-"+(t?"photo":"document")}),a.ZP.createElement("div",{className:"title"},"Drop files here to send them"),a.ZP.createElement("div",{className:"description"},t?"in a quick way":"without compression")))}));let m;!function(e){e.None="none",e.Document="document",e.QuickFile="quick_file"}(m||(m={}));const h=(0,a.X$)((e=>{let{isOpen:t,withQuick:n,onHide:d,onFileSelect:m}=e;const h=(0,a.sO)(null),v=(0,l.Z)(n),{shouldRender:p,transitionClassNames:f}=(0,r.Z)(t);(0,a.d4)((()=>t?(0,s.Z)(d):void 0),[t,d]);const g=(0,a.I4)((async e=>{const{dataTransfer:t}=e;let n=[];if(!(t.files&&t.files.length>0)||t.items&&t.items.length){if(t.items&&t.items.length>0){const e=await(0,i.Z)(t.items);e.length&&(n=n.concat(e))}}else n=n.concat(Array.from(t.files));d(),m(n,!1)}),[m,d]),Z=(0,a.I4)((e=>{const{dataTransfer:t}=e;t.files&&t.files.length>0&&(d(),m(Array.from(t.files),!0))}),[m,d]),P=(0,a.I4)((e=>{e.stopPropagation();const{target:t,relatedTarget:n}=e;t.matches(".DropTarget, .DropArea")&&!n&&(h.current=window.setTimeout((()=>{d()}),150))}),[d]);if(!p)return;const E=(0,o.Z)("DropArea",f);return a.ZP.createElement(c.Z,{containerId:"#middle-column-portals"},a.ZP.createElement("div",{className:E,onDragLeave:P,onDragOver:()=>{h.current&&window.clearTimeout(h.current)},onDrop:d},a.ZP.createElement(u,{onFileSelect:g}),(n||v)&&a.ZP.createElement(u,{onFileSelect:Z,isQuick:!0})))}))},19830:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(99203),o=n(48778);const i=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,o.Z)(r.gl.Extra,"EmojiTooltip",!t);return n?a.ZP.createElement(n,e):void 0}))},13616:(e,t,n)=>{n.d(t,{Z:()=>C});var a=n(14050),r=n(33555),o=n(83716),i=n(11192),s=n(69118),l=n(65723),c=n(46752),d=n(77361),u=n(517),m=n(72645),h=n(60706),v=n(18674),p=n(56389),f=n(59107),g=n(64784),Z=n(96391),P=n(32340),E=n(72087);const y=d.wB?256:416,C=(0,a.X$)((0,r.c$)(((e,t)=>{let{chatId:n,threadId:a}=t;const{messageSendKeyCombo:r}=e.settings.byKey;return{messageSendKeyCombo:r,replyingToId:n&&a?(0,i.Yy)(e,n,a):void 0,noTabCapture:e.pollModal.isOpen||e.payment.isPaymentModalOpen}}))((e=>{let{id:t,chatId:n,threadId:i,isAttachmentModalInput:C,editableInputId:b,html:N,placeholder:w,forcedPlaceholder:k,canAutoFocus:I,shouldSuppressFocus:S,shouldSuppressTextFormatter:T,replyingToId:M,noTabCapture:x,messageSendKeyCombo:L,onUpdate:$,onSuppressedFocus:O,onSend:F}=e;const{editLastMessage:A,replyToNextMessage:D}=(0,r.Sv)(),R=(0,a.sO)(null),U=(0,a.sO)(null),B=(0,f.Z)(),X=(0,a.sO)(!1),[Y,_,V]=(0,h.Z)(),[K,j]=(0,a.eJ)(),[z,W]=(0,a.eJ)(),H=(0,p.Z)(n,i);(0,a.d4)((()=>{C&&ee(!1)}),[C]),(0,m.Z)((e=>{let[t]=e;N!==R.current.innerHTML&&(R.current.innerHTML=N),N!==U.current.innerHTML&&(U.current.innerHTML=N),void 0!==t&&t!==N&&ee(!N.length)}),[N]),(0,a.sO)(n).current=n;const J=(0,a.I4)((()=>{R.current&&((0,v.zG)()?setTimeout(J,350):(0,l.Z)(R.current))}),[]),q=(0,a.I4)((()=>{V(),function(){const e=window.getSelection();e&&(e.removeAllRanges?e.removeAllRanges():e.empty&&e.empty())}()}),[V]);function G(){if(d.cj)return!1;const e=window.getSelection();if(!e||!e.rangeCount||X.current)return V(),!1;const t=e.getRangeAt(0),n=t.toString().trim();return!(T||!(0,Z.R)(t,b||o.R2)||!n||(0,g.Z)(n)||!t.START_TO_END)||(V(),!1)}function Q(){if(!G())return;const e=window.getSelection().getRangeAt(0),t=e.getBoundingClientRect(),n=R.current.getBoundingClientRect();let a=t.left+t.width/2-n.left;a<90?a=90:a>n.width-90&&(a=n.width-90),j({x:a,y:t.top-n.top}),W(e),_()}function ee(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=R.current,n=U.current,a=Number(t.style.height.replace("px","")),r=Math.min(n.scrollHeight,y);if(r===a)return;const o=Math.round(50*Math.log(Math.abs(r-a))),i=()=>{t.style.height=`${r}px`,t.style.transitionDuration=`${o}ms`,t.classList.toggle("overflown",n.scrollHeight>y)};e?requestAnimationFrame(i):i()}(0,a.d4)((()=>{d.$b||I&&J()}),[n,J,M,I]),(0,a.d4)((()=>{if(x)return;const e=(0,s.Ds)((e=>{"Tab"===e.key&&(e.preventDefault(),requestAnimationFrame(J))}),2e3,!0,!1);return(0,u.Z)({onTab:e})}),[J,x]),(0,a.d4)((()=>{const e=R.current;function t(){e.blur()}return S&&e.addEventListener("focus",t),()=>{e.removeEventListener("focus",t)}}),[S]);const te=(0,c.Z)("form-control custom-scroll",N.length>0&&"touched",S&&"focus-disabled");return a.ZP.createElement("div",{id:t,onClick:S?O:void 0,dir:B.isRtl?"rtl":void 0},a.ZP.createElement("div",{ref:R,id:b||o.R2,className:te,contentEditable:!0,dir:"auto",onClick:J,onChange:function(e){const{innerHTML:t,textContent:n}=e.currentTarget;if($("<br>"===t?"":t),H({type:"typing"}),!d.$b&&(!n||!n.length)&&(d.op||!t.includes("emoji-small"))){const e=window.getSelection();e&&(R.current.blur(),e.removeAllRanges(),(0,l.Z)(R.current,!0))}},onKeyDown:function(e){if(!N.length&&(e.metaKey||e.ctrlKey)){const t="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:void 0;if(t)return e.preventDefault(),void D({targetIndexDelta:t})}"Enter"!==e.key||e.shiftKey?"ArrowUp"!==e.key||N.length||e.metaKey||e.ctrlKey||e.altKey?e.target.addEventListener("keyup",Q,{once:!0}):(e.preventDefault(),A()):d.cj||d.wZ||!("enter"===L&&!e.shiftKey||"ctrl-enter"===L&&(e.ctrlKey||e.metaKey))||(e.preventDefault(),V(),F())},onMouseDown:function(e){function t(e){e instanceof KeyboardEvent&&"Esc"!==e.key&&"Escape"!==e.key||(setTimeout((()=>{X.current=!1}),100),window.removeEventListener("keydown",t),window.removeEventListener("mousedown",t))}2===e.button?X.current||(X.current=!0,document.addEventListener("mousedown",t),document.addEventListener("keydown",t)):e.target.addEventListener("mouseup",Q,{once:!0})},onContextMenu:d.wZ?function(e){G()&&(e.preventDefault(),e.stopPropagation())}:void 0,onTouchCancel:d.wZ?Q:void 0,"aria-label":w}),a.ZP.createElement("div",{ref:U,className:(0,c.Z)(te,"clone"),dir:"auto"}),!k&&a.ZP.createElement("span",{className:"placeholder-text",dir:"auto"},w),a.ZP.createElement(E.Z,{isOpen:Y,anchorPosition:K,selectedRange:z,setSelectedRange:W,onClose:q}),k&&a.ZP.createElement("span",{className:"forced-placeholder"},(0,P.Z)(k)))})))},72087:(e,t,n)=>{n.d(t,{Z:()=>f});var a=n(14050),r=n(6137),o=n(83716),i=n(46752),s=n(81396),l=n(23989),c=n(31212),d=n(58758),u=n(60706),m=n(59107),h=n(231);const v={B:"bold",STRONG:"bold",I:"italic",EM:"italic",U:"underline",DEL:"strikethrough",CODE:"monospace",SPAN:"spoiler"},p=document.createElement("div"),f=(0,a.X$)((e=>{let{isOpen:t,anchorPosition:n,selectedRange:f,setSelectedRange:g,onClose:Z}=e;const P=(0,a.sO)(null),E=(0,a.sO)(null),{shouldRender:y,transitionClassNames:C}=(0,c.Z)(t),[b,N,w]=(0,u.Z)(),[k,I]=(0,a.eJ)(""),[S,T]=(0,a.eJ)(!1),[M,x]=(0,a.eJ)(),[L,$]=(0,a.eJ)({});(0,a.d4)((()=>t?(0,l.Z)(Z):void 0),[t,Z]),(0,d.Z)(t,P,Z),(0,a.d4)((()=>{b?E.current.focus():(I(""),T(!1))}),[b]),(0,a.d4)((()=>{y||(w(),$({}),x(void 0))}),[w,y]),(0,a.d4)((()=>{if(!t||!f)return;const e={};let{parentElement:n}=f.commonAncestorContainer;for(;n&&n.id!==o.R2;){const t=v[n.tagName];t&&(e[t]=!0),n=n.parentElement}$(e)}),[t,f,N]);const O=(0,a.I4)((()=>{if(!f)return;const e=window.getSelection();e&&(e.removeAllRanges(),e.addRange(f))}),[f]),F=(0,a.I4)((()=>{const e=window.getSelection();e&&g(e.getRangeAt(0))}),[g]),A=(0,a.I4)((()=>{if(f)return p.innerText=f.toString(),p.innerHTML}),[f]),D=(0,a.I4)((()=>{if(f)return f.commonAncestorContainer.parentElement}),[f]);function R(){const e=E.current;if(!e)return;const{offsetWidth:t,scrollWidth:n,scrollLeft:a}=e;if(n<=t)return void x(void 0);let r="";a<n-t&&(r="mask-right"),a>0&&(r+=" mask-left"),x(r)}function U(e){if(L[e])return"active";if("monospace"===e||"strikethrough"===e){if(Object.keys(L).some((t=>t!==e&&Boolean(L[t]))))return"disabled"}else if(L.monospace||L.strikethrough)return"disabled"}const B=(0,a.I4)((()=>{if(L.spoiler){const e=D();if(!f||!e||e.dataset.entityType!==r.Vv.Spoiler||!e.textContent)return;return e.replaceWith(e.textContent),void $((e=>({...e,spoiler:!1})))}const e=A();document.execCommand("insertHTML",!1,`<span class="spoiler" data-entity-type="${r.Vv.Spoiler}">${e}</span>`),Z()}),[D,A,Z,f,L.spoiler]),X=(0,a.I4)((()=>{$((e=>(document.execCommand(e.bold?"removeFormat":"bold"),Object.keys(e).forEach((t=>{"italic"!==t&&"underline"!==t||!Boolean(e[t])||document.execCommand(t)})),F(),{...e,bold:!e.bold})))}),[F]),Y=(0,a.I4)((()=>{document.execCommand("italic"),F(),$((e=>({...e,italic:!e.italic})))}),[F]),_=(0,a.I4)((()=>{document.execCommand("underline"),F(),$((e=>({...e,underline:!e.underline})))}),[F]),V=(0,a.I4)((()=>{if(L.strikethrough){const e=D();if(!f||!e||"DEL"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void $((e=>({...e,strikethrough:!1})))}const e=A();document.execCommand("insertHTML",!1,`<del>${e}</del>`),Z()}),[D,A,Z,f,L.strikethrough]),K=(0,a.I4)((()=>{if(L.monospace){const e=D();if(!f||!e||"CODE"!==e.tagName||!e.textContent)return;return e.replaceWith(e.textContent),void $((e=>({...e,monospace:!1})))}const e=A();document.execCommand("insertHTML",!1,`<code class="text-entity-code" dir="auto">${e}</code>`),Z()}),[D,A,Z,f,L.monospace]),j=(0,a.I4)((()=>{const e=((0,s.X)(k)||"").split("%").map(encodeURI).join("%");if(S){const t=D();if(!t||"A"!==t.tagName)return;return t.href=e,void Z()}const t=A();O(),document.execCommand("insertHTML",!1,`<a href=${e} class="text-entity-link" dir="auto">${t}</a>`),Z()}),[D,A,S,k,Z,O]),z=(0,a.I4)((e=>{const t={k:N,b:X,u:_,i:Y,m:K,s:V,p:B}[function(e){const t="key"in e?e.key:e.code;return t.startsWith("Key")?t.slice(3).toLowerCase():t}(e)];!e.altKey&&(e.ctrlKey||e.metaKey)&&t&&(e.preventDefault(),e.stopPropagation(),t())}),[N,X,_,Y,K,V,B]);(0,a.d4)((()=>(t&&document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z))),[t,z]);const W=(0,m.Z)();if(!y)return;const H=(0,i.Z)("TextFormatter",C,b&&"link-control-shown"),J=(0,i.Z)("TextFormatter-link-url-confirm",Boolean(k.length)&&"shown"),q=n?`left: ${n.x}px; top: ${n.y}px;--text-formatter-left: ${n.x}px;`:"";return a.ZP.createElement("div",{ref:P,className:H,style:q,onKeyDown:function(e){"Enter"===e.key&&b&&(j(),e.preventDefault())}},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Spoiler text",className:U("spoiler"),onClick:B},a.ZP.createElement("i",{className:"icon-eye-closed"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Bold text",className:U("bold"),onClick:X},a.ZP.createElement("i",{className:"icon-bold"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Italic text",className:U("italic"),onClick:Y},a.ZP.createElement("i",{className:"icon-italic"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Underlined text",className:U("underline"),onClick:_},a.ZP.createElement("i",{className:"icon-underlined"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Strikethrough text",className:U("strikethrough"),onClick:V},a.ZP.createElement("i",{className:"icon-strikethrough"})),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:"Monospace text",className:U("monospace"),onClick:K},a.ZP.createElement("i",{className:"icon-monospace"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:W("TextFormat.AddLinkTitle"),onClick:N},a.ZP.createElement("i",{className:"icon-link"}))),a.ZP.createElement("div",{className:"TextFormatter-link-control"},a.ZP.createElement("div",{className:"TextFormatter-buttons"},a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:W("Cancel"),onClick:w},a.ZP.createElement("i",{className:"icon-arrow-left"})),a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement("div",{className:(0,i.Z)("TextFormatter-link-url-input-wrapper",M)},a.ZP.createElement("input",{ref:E,className:"TextFormatter-link-url-input",type:"text",value:k,placeholder:"Enter URL...",autoComplete:"off",inputMode:"url",dir:"auto",onChange:function(e){I(e.target.value),R()},onScroll:R})),a.ZP.createElement("div",{className:J},a.ZP.createElement("div",{className:"TextFormatter-divider"}),a.ZP.createElement(h.Z,{color:"translucent",ariaLabel:W("Save"),className:"color-primary",onClick:j},a.ZP.createElement("i",{className:"icon-check"}))))))}))},21262:(e,t,n)=>{async function a(e){const t=[];function n(e,a){return new Promise((r=>{if(e instanceof File)t.push(e),r(e);else if(e.isFile){const n=a.getAsFile();e.file((e=>{t.push(e),r(e)}),(()=>{n&&t.push(n),r(n)}))}else e.isDirectory&&e.createReader().readEntries((e=>{const t=[];for(let r=0;r<e.length;r++)t.push(n(e[r],a));r(Promise.all(t))}))}))}const a=[];for(let t=0;t<e.length;t++){const r=e[t];if("file"===r.kind){const e=r.webkitGetAsEntry()||r.getAsFile();e&&a.push(n(e,r))}}return await Promise.all(a),t}n.d(t,{Z:()=>a})},52400:(e,t,n)=>{n.d(t,{_:()=>s});const a=/(<br>|<br\s?\/>)/g,r=/( |\u00A0)/g,o=/(<div>|<\/div>)/gi,i=/\n$/i;function s(e){return e.replace(r," ").replace(a,"\n").replace(o,"").replace(i,"")}},96391:(e,t,n)=>{function a(e,t){const{commonAncestorContainer:n}=e;let a=n,r=1;for(;a&&a.id!==t&&r<5;)a=a.parentElement,r++;return Boolean(a&&a.id===t)}n.d(t,{R:()=>a})},72162:(e,t,n)=>{n.d(t,{Z:()=>y});var a=n(14050),r=n(83716),o=n(70735),i=n(52400),s=n(34284),l=n(65723),c=n(60782);const d=new WeakMap;function u(e){return function(){const t=d.get(e);for(var n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];if(t&&(0,c.et)(t.lastArgs,a))return t.lastResult;const o=e(...a);return d.set(e,{lastArgs:a,lastResult:o}),o}}var m=n(60706),h=n(32340);let v,p,f,g;const Z=u((function(e,t,n){return e&&t.length?Object.values((0,c.q0)(e,t)).slice(0,n):o.D})),P=u((function(e,t,n){const a=Object.values(e),r=(0,c.ee)(a,"native"),o=t?(0,c.Q8)(t,(e=>Object.values((0,c.q0)(r,e)))):{},i=n?(0,c.Q8)(n,(e=>Object.values((0,c.q0)(r,e)))):{},s={...o,...i},l=[].concat(Object.keys(o),Object.keys(i)),d=a.reduce(((e,t)=>(t.names.forEach((n=>{e[n]||(e[n]=[]),e[n].push(t)})),e)),{});return{byKeyword:s,keywords:l,byName:d,names:Object.keys(d)}})),E=u((function(e,t,n){const{byKeyword:a,keywords:r,byName:i,names:s}=e;let l=o.D;const d=r.filter((e=>e.startsWith(t))).sort();l=l.concat(Object.values((0,c.q0)(a,d)).flat());const u=s.filter((e=>e.startsWith(t)));return l=l.concat(Object.values((0,c.q0)(i,u)).flat()),l=(0,c.Tw)(l),l.slice(0,n)}));try{g=/(^|\s):[-+_:\p{L}\p{N}]*$/giu}catch(e){g=/(^|\s):[-+_:\d\wа-яё]*$/gi}function y(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.R2,s=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0,d=arguments.length>6?arguments[6]:void 0,u=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const[v,p,g]=(0,m.Z)(),[y,N]=(0,a.eJ)(),[w,k]=(0,a.eJ)(!1),[I,S]=(0,a.eJ)(o.D);(0,a.d4)((()=>{if(u)return;const e=()=>{N(f.emojis)};f?e():b().then(e)}),[u]);const T=t.current;(0,a.d4)((()=>{if(!e||!T||!y||u)return void g();const t=T.includes(":")&&C(T);if(!t)return S(o.D),void g();const a=t.length>2&&t.endsWith(":"),r=t.substr(1,a?t.length-2:void 0);let i=o.D;if(k(a),r){if(r.length>=2){const e=P(y,c,d);i=E(e,r,36)}}else i=Z(y,n,36);i.length?(a||p(),S(i)):g()}),[y,T,e,p,n,g,k,u,c,d]);const M=(0,a.I4)(((e,n)=>{const a=t.current,o=a.lastIndexOf(":",n?a.lastIndexOf(":")-1:void 0);if(-1!==o){let t;s(`${a.substr(0,o)}${(0,h.Z)(e,["emoji_html"])}`),t=i===r.R2?document.querySelector(r.Ed):document.getElementById(i),requestAnimationFrame((()=>{(0,l.Z)(t,!0,!0)}))}g()}),[t,i,s,g]);return(0,a.d4)((()=>{v&&w&&I.length&&M(I[0].native,!0)}),[I,M,v,w]),{isEmojiTooltipOpen:v,closeEmojiTooltip:g,filteredEmojis:I,insertEmoji:M}}function C(e){const t=(0,i._)(e).match(g);return t?t[0].trim():void 0}async function b(){return v||(v=n.e(7501).then(n.t.bind(n,47501,19)),p=(await v).default,f=(0,s.NM)(p)),v}},29295:(e,t,n)=>{n.d(t,{Z:()=>v});var a=n(14050),r=n(33555),o=n(6137),i=n(83716),s=n(75806),l=n(52400),c=n(65723),d=n(60706),u=n(60782);const m=(0,n(69118).P2)((e=>e()),500,!0);let h;try{h=/(^|\s)@[-_\p{L}\p{M}\p{N}]*$/giu}catch(e){h=/(^|\s)@[-_\d\wа-яё]*$/gi}function v(e,t,n){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.R2,h=arguments.length>4?arguments[4]:void 0,v=arguments.length>5?arguments[5]:void 0,g=arguments.length>6?arguments[6]:void 0;const[Z,P,E]=(0,d.Z)(),[y,C]=(0,a.eJ)(),b=(0,a.I4)(((e,t)=>{const n=(0,r.Rd)().users.byId;(h||v)&&n?m((()=>{const a=null==h?void 0:h.reduce(((e,t)=>(t.userId!==g&&e.push(t.userId),e)),[]),r=(0,s.kK)((0,u.Tw)([...t&&v||[],...a||[]]),n,e);C(Object.values((0,u.q0)(n,r)))})):C(void 0)}),[g,h,v]),N=t.current;(0,a.d4)((()=>{if(!e||!N.length)return void E();const t=N.includes("@")&&p(N);if(t){const e=t?t.substr(1):"";b(e,f(N))}else E()}),[e,b,P,E,N]),(0,a.d4)((()=>{null!=y&&y.length?P():E()}),[P,E,y]);const w=(0,a.I4)((function(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.username&&!(0,s.Vl)(e))return;const r=e.username?`@${e.username}`:`<a\n class="text-entity-link"\n data-entity-type="${o.Vv.MentionName}"\n data-user-id="${e.id}"\n contenteditable="false"\n dir="auto"\n >${(0,s.Vl)(e)}</a>`,i=t.current,d=i.lastIndexOf("@");if(-1!==d){n(`${i.substr(0,d)}${r} `);const e=document.getElementById(l);requestAnimationFrame((()=>{(0,c.Z)(e,a)}))}E()}),[t,l,n,E]);return{isMentionTooltipOpen:Z,closeMentionTooltip:E,insertMention:w,mentionFilteredUsers:y}}function p(e){const t=(0,l._)(e).match(h);return t?t[0].trim():void 0}function f(e){return e.startsWith("@")}},17891:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(29290),o=n(65326);function i(e,t){const n=void 0===t,i=(0,a.sO)(n),s=(0,a.sO)(),l=(0,o.Z)();return(0,r.Z)((()=>{n||(i.current=!1,s.current&&(clearTimeout(s.current),s.current=void 0))}),e),(0,a.d4)((()=>{if(n||i.current)return;const e=()=>{i.current=!0,l()};t>0?s.current=window.setTimeout(e,t):e()}),e),i.current}},51218:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(14605);const o=(0,a.X$)((e=>{let{id:t,options:n,selected:o=[],disabled:i,round:s,loadingOptions:l,onChange:c}=e;const[d,u]=(0,a.eJ)(o||[]),m=(0,a.I4)((e=>{const{value:t,checked:n}=e.currentTarget;let a;a=n?[...d,t]:d.filter((e=>e!==t)),u(a),c(a)}),[c,d]);return a.ZP.createElement("div",{id:t,className:"radio-group"},n.map((e=>a.ZP.createElement(r.Z,{label:e.label,subLabel:e.subLabel,value:e.value,checked:-1!==o.indexOf(e.value),disabled:i,round:s,isLoading:l?-1!==l.indexOf(e.value):void 0,onChange:m}))))}))},17551:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(14050),r=n(59107),o=n(72313),i=n(13103),s=n(231);const l=(0,a.X$)((e=>{let{isOpen:t,onClose:n,onCloseAnimationEnd:l,title:c,header:d,text:u,textParts:m,confirmLabel:h="Confirm",confirmHandler:v,confirmIsDestructive:p,isButtonsInOneRow:f,children:g}=e;const Z=(0,r.Z)(),P=(0,a.sO)(null),E=(0,a.I4)((e=>{-1===e&&v()}),[v]),y=(0,o.Z)(P,t,E,".Button");return a.ZP.createElement(i.Z,{className:"confirm",title:c||Z("Telegram"),header:d,isOpen:t,onClose:n,onCloseAnimationEnd:l},u&&u.split("\\n").map((e=>a.ZP.createElement("p",null,e))),m||g,a.ZP.createElement("div",{className:f?"dialog-buttons mt-2":"",ref:P,onKeyDown:y},a.ZP.createElement(s.Z,{className:"confirm-dialog-button",isText:!0,onClick:v,color:p?"danger":"primary"},h),a.ZP.createElement(s.Z,{className:"confirm-dialog-button",isText:!0,onClick:n},Z("Cancel"))))}))},41151:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(46752),o=n(231);const i=e=>{let{isShown:t,className:n,color:i="primary",ariaLabel:s,disabled:l,onClick:c,children:d}=e;const u=(0,r.Z)("FloatingActionButton",t&&"revealed",n);return a.ZP.createElement(o.Z,{className:u,color:i,round:!0,disabled:l,onClick:t&&!l?c:void 0,ariaLabel:s,tabIndex:-1},d)}},31876:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(14050),r=n(77361),o=n(69118),i=n(46752),s=n(17240),l=n(63394),c=n(60706),d=n(59107),u=n(68512),m=n(52328),h=n(58964),v=n(231);const p=e=>{let{ref:t,buttonRef:n,icon:p,secondaryIcon:f,className:g,style:Z,children:P,disabled:E,ripple:y,narrow:C,inactive:b,focus:N,destructive:w,multiline:k,isStatic:I,contextActions:S,onMouseDown:T,onClick:M,onSecondaryIconClick:x}=e,L=(0,a.sO)(null);t&&(L=t);const[$,O,F]=(0,c.Z)(),{isContextMenuOpen:A,contextMenuPosition:D,handleBeforeContextMenu:R,handleContextMenu:U,handleContextMenuClose:B,handleContextMenuHide:X}=(0,s.Z)(L,!S),Y=(0,a.I4)((()=>L.current),[]),_=(0,a.I4)((()=>L.current.closest(".custom-scroll")),[]),V=(0,a.I4)((()=>L.current.querySelector(".ListItem-context-menu .bubble")),[]),{positionX:K,positionY:j,transformOriginX:z,transformOriginY:W,style:H}=(0,l.Z)(D,Y,_,V),J=(0,a.I4)((e=>{!E&&M&&(M(e),r.$b&&!y&&(O(),(0,o.T2)(F)))}),[E,O,M,y,F]),q=e=>{E||0!==e.button||!x&&!S||(e.stopPropagation(),x?x(e):U(e))},G=(0,a.I4)((e=>{b||r.$b||(!S||2!==e.button&&M||R(e),0===e.button&&(M?J(e):U(e)))}),[b,S,M,R,U,J]),Q=(0,d.Z)(),ee=(0,i.Z)("ListItem",g,!I&&"no-selection",y&&"has-ripple",C&&"narrow",E&&"disabled",b&&"inactive",D&&"has-menu-open",N&&"focus",w&&"destructive",k&&"multiline",I&&"is-static");return a.ZP.createElement("div",{ref:L,className:ee,dir:Q.isRtl?"rtl":void 0,style:Z,onMouseDown:T},a.ZP.createElement("div",{className:(0,i.Z)("ListItem-button",$&&"active"),role:I?void 0:"button",ref:n,tabIndex:I?void 0:0,onClick:!b&&r.$b?J:void 0,onMouseDown:G,onContextMenu:!b&&S?U:void 0},p&&a.ZP.createElement("i",{className:`icon-${p}`}),k&&a.ZP.createElement("div",{className:"multiline-item"},P),!k&&P,!E&&!b&&y&&a.ZP.createElement(u.Z,null),f&&a.ZP.createElement(v.Z,{className:"secondary-icon",round:!0,color:"translucent",size:"smaller",onClick:r.$b?q:void 0,onMouseDown:r.$b?void 0:q},a.ZP.createElement("i",{className:`icon-${f}`}))),S&&void 0!==D&&a.ZP.createElement(m.Z,{isOpen:A,transformOriginX:z,transformOriginY:W,positionX:K,positionY:j,style:H,className:"ListItem-context-menu",autoClose:!0,onClose:B,onCloseAnimationEnd:X},S.map((e=>a.ZP.createElement(h.Z,{key:e.title,icon:e.icon,destructive:e.destructive,disabled:!e.handler,onClick:e.handler},e.title)))))}},96937:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n(14050),r=n(83716),o=n(31212),i=n(46752),s=n(23989),l=n(62898);const c=3e3,d=e=>{let{message:t,duration:n=c,containerId:d,onDismiss:u}=e;const[m,h]=(0,a.eJ)(!0),v=(0,a.sO)(null),{transitionClassNames:p}=(0,o.Z)(m),f=(0,a.I4)((()=>{h(!1),setTimeout(u,150+r.fK)}),[u]);(0,a.d4)((()=>m?(0,s.Z)(f):void 0),[m,f]),(0,a.d4)((()=>(v.current=window.setTimeout(f,n),()=>{v.current&&(clearTimeout(v.current),v.current=void 0)})),[n,f]);const g=(0,a.I4)((()=>{v.current&&(clearTimeout(v.current),v.current=void 0)}),[]),Z=(0,a.I4)((()=>{v.current=window.setTimeout(f,n)}),[n,f]);return a.ZP.createElement(l.Z,{className:"Notification-container",containerId:d},a.ZP.createElement("div",{className:(0,i.Z)("Notification",p),onClick:f,onMouseEnter:g,onMouseLeave:Z},a.ZP.createElement("div",{className:"content"},t)))}},39196:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(46752);const o={s:22,m:25,l:28,xl:20},i=(0,a.X$)((e=>{let{progress:t=0,size:n="l",square:i,transparent:s,noCross:l,onClick:c}=e;const d=o[n],u=d-4,m=d-1,h=2*u*Math.PI,v=(0,a.sO)(null);(0,a.d4)((()=>{if(!v.current)return;const e=v.current.firstElementChild,n=h-Math.min(Math.max(.05,t),1)*h;e?e.firstElementChild.setAttribute("stroke-dashoffset",n.toString()):v.current.innerHTML=`<svg\n viewBox="0 0 ${2*m} ${2*m}"\n height="${2*m}"\n width="${2*m}"\n >\n <circle\n stroke="white"\n fill="transparent"\n stroke-width=2\n stroke-dasharray="${h} ${h}"}\n stroke-dashoffset="${n}"\n stroke-linecap="round"\n r=${u}\n cx=${m}\n cy=${m}\n />\n </svg>`}),[v,h,m,u,t]);const p=(0,r.Z)(`ProgressSpinner size-${n}`,s&&"transparent",i&&"square",l&&"no-cross");return a.ZP.createElement("div",{ref:v,className:p,onClick:c})}))},14434:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(14050),r=n(46752),o=n(59107),i=n(49204);const s=(0,a.X$)((e=>{let{id:t,label:n,subLabel:s,value:l,name:c,checked:d,disabled:u,hidden:m,isLoading:h,onChange:v}=e;const p=(0,o.Z)(),f=(0,r.Z)("Radio",u&&"disabled",m&&"hidden-widget",h&&"loading");return a.ZP.createElement("label",{className:f,dir:p.isRtl?"rtl":void 0},a.ZP.createElement("input",{type:"radio",name:c,value:l,id:t,checked:d,onChange:v,disabled:u||m}),a.ZP.createElement("div",{className:"Radio-main"},a.ZP.createElement("span",{className:"label",dir:p.isRtl?"auto":void 0},n),s&&a.ZP.createElement("span",{className:"subLabel",dir:p.isRtl?"auto":void 0},s)),h&&a.ZP.createElement(i.Z,null))})),l=(0,a.X$)((e=>{let{id:t,name:n,options:r,selected:o,disabled:i,loadingOption:l,onChange:c}=e;const d=(0,a.I4)((e=>{const{value:t}=e.currentTarget;c(t)}),[c]);return a.ZP.createElement("div",{id:t,className:"radio-group"},r.map((e=>a.ZP.createElement(s,{name:n,label:e.label,subLabel:e.subLabel,value:e.value,checked:e.value===o,hidden:e.hidden,disabled:i,isLoading:l?l===e.value:void 0,onChange:d}))))}))},18051:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(46752),o=n(59107);const i=(0,a.X$)((e=>{let{options:t,min:n=0,max:i=(t?t.length-1:100),step:s=1,label:l,value:c,disabled:d,bold:u,className:m,renderValue:h,onChange:v}=e;const p=(0,o.Z)(),f=(0,a.I4)((e=>{v(Number(e.currentTarget.value))}),[v]),g=(0,r.Z)(m,"RangeSlider",d&&"disabled",u&&"bold"),Z=(0,a.Ye)((()=>t?c/(t.length-1)*100:(c-n)/((i-n)/s)*100),[t,c,i,n,s]);return a.ZP.createElement("div",{className:g},l&&a.ZP.createElement("div",{className:"slider-top-row",dir:p.isRtl?"rtl":void 0},a.ZP.createElement("span",{className:"label",dir:"auto"},l),!t&&a.ZP.createElement("span",{className:"value",dir:"auto"},h?h(c):c)),a.ZP.createElement("div",{className:"slider-main"},a.ZP.createElement("div",{className:"slider-fill-track",style:`width: ${Z}%`}),a.ZP.createElement("input",{min:n,max:i,value:c,step:s,type:"range",className:"RangeSlider__input",onChange:f}),t&&a.ZP.createElement("div",{className:"slider-options"},t.map(((e,t)=>a.ZP.createElement("div",{className:(0,r.Z)("slider-option no-selection",t===c&&"active"),onClick:()=>v(t)},e))))))}))},69589:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(46752),o=n(60706),i=n(59107),s=n(12515),l=n(34288),c=n(231),d=n(40126);const u=(0,a.X$)((e=>{let{ref:t,children:n,parentContainerClassName:u,value:m,inputId:h,className:v,focused:p,isLoading:f,spinnerColor:g,spinnerBackgroundColor:Z,placeholder:P,disabled:E,autoComplete:y,canClose:C,autoFocusSearch:b,onChange:N,onReset:w,onFocus:k,onBlur:I,onSpinnerClick:S}=e,T=(0,a.sO)(null);t&&(T=t);const[M,x,L]=(0,o.Z)(p);(0,s.Z)(T,b,L),(0,a.d4)((()=>{T.current&&(p?T.current.focus():T.current.blur())}),[p,P]);const $=(0,i.Z)(),O=(0,a.I4)((e=>{if("ArrowDown"===e.key||"Enter"===e.key){const e=document.querySelector(`.${u} .ListItem-button`);e&&e.focus()}}),[u]);return a.ZP.createElement("div",{className:(0,r.Z)("SearchInput",v,M&&"has-focus"),dir:$.isRtl?"rtl":void 0},n,a.ZP.createElement("input",{ref:T,id:h,type:"text",dir:"auto",placeholder:P||$("Search"),className:"form-control",value:m,disabled:E,autoComplete:y,onChange:function(e){const{currentTarget:t}=e;N(t.value)},onFocus:function(){x(),k&&k()},onBlur:function(){L(),I&&I()},onKeyDown:O}),a.ZP.createElement("i",{className:"icon-search"}),a.ZP.createElement(d.Z,{isOpen:Boolean(f),className:"slow"},a.ZP.createElement(l.Z,{color:g,backgroundColor:Z,onClick:S})),!f&&(m||C)&&w&&a.ZP.createElement(c.Z,{round:!0,size:"tiny",color:"translucent",onClick:w},a.ZP.createElement("span",{className:"icon-close"})))}))},40126:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(31212),o=n(87204),i=n(46752);const s=e=>{let{isOpen:t,isCustom:n,id:s,className:l,onClick:c,children:d}=e;const{shouldRender:u,transitionClassNames:m}=(0,r.Z)(t,void 0,void 0,!n&&void 0),h=(0,o.Z)(t),v=(0,o.Z)(d),p=(0,a.sO)();return h&&!t&&(p.current=v),u&&a.ZP.createElement("div",{id:s,className:(0,i.Z)(l,m),onClick:c},t?d:p.current)}},83321:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(46752);const o=(0,a.X$)((e=>{let{id:t,name:n,value:o,label:i,checked:s=!1,disabled:l,inactive:c,noAnimation:d,onChange:u,onCheck:m}=e;const h=(0,a.I4)((e=>{u&&u(e),m&&m(e.currentTarget.checked)}),[u,m]),v=(0,r.Z)("Switcher",l&&"disabled",c&&"inactive",d&&"no-animation");return a.ZP.createElement("label",{className:v,title:i},a.ZP.createElement("input",{type:"checkbox",id:t,name:n,value:o,checked:s,disabled:l,onChange:h}),a.ZP.createElement("span",{className:"widget"}))}))},93133:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(14050),r=n(77361),o=n(81367),i=n(87204),s=n(78781),l=n(59107),c=n(46752),d=n(82972),u=n(32340);const m="Tab--active",h=(0,a.X$)((e=>{let{className:t,title:n,isActive:r,badgeCount:o,isBadgeActive:i,previousActiveTab:s,onClick:l,clickArg:h}=e;const v=(0,a.sO)(null);return(0,a.d4)((()=>{if(r&&void 0===s&&v.current&&v.current.classList.add(m),!r||void 0===s)return;const e=v.current,t=e.parentElement.children[s];if(!t)return;const n=e.querySelector("i"),a=t.querySelector("i"),o=a.parentElement.offsetLeft-n.parentElement.offsetLeft,i=a.clientWidth/n.clientWidth;a.classList.remove("animate"),n.classList.remove("animate"),n.style.transform=`translate3d(${o}px, 0, 0) scale3d(${i}, 1, 1)`,(0,d.Z)(n),n.classList.add("animate"),n.style.transform="none",t.classList.remove(m),e.classList.add(m)}),[r,s]),a.ZP.createElement("div",{className:(0,c.Z)("Tab",t),onClick:()=>l(h),ref:v},a.ZP.createElement("span",null,(0,u.Z)(n),Boolean(o)&&a.ZP.createElement("span",{className:(0,c.Z)("badge",i&&"Tab__badge--active")},o),a.ZP.createElement("i",null)))})),v=r.cj?450:r.wZ?400:300,p=(0,a.X$)((e=>{let{tabs:t,activeTab:n,big:r,onSwitchTab:c}=e;const d=(0,a.sO)(null),u=(0,i.Z)(n);(0,s.Z)(d.current),(0,a.d4)((()=>{const e=d.current,{scrollWidth:t,offsetWidth:a,scrollLeft:r}=e;if(t<=a)return;const i=e.childNodes[n];if(!i)return;const{offsetLeft:s,offsetWidth:l}=i,c=s-a/2+l/2;Math.abs(c-r)<16||(0,o.Z)(e,c,v)}),[n]);const m=(0,l.Z)();return a.ZP.createElement("div",{className:"TabList no-selection no-scrollbar "+(r?"big":""),ref:d,dir:m.isRtl?"rtl":void 0},t.map(((e,t)=>a.ZP.createElement(h,{key:e.title,title:m(e.title),isActive:t===n,badgeCount:e.badgeCount,isBadgeActive:e.isBadgeActive,previousActiveTab:u,onClick:c,clickArg:t}))))}))},53455:(e,t,n)=>{n.d(t,{Yy:()=>i,ZP:()=>h,fi:()=>o,vb:()=>c});var a=n(91090),r=n(60782);const o=[{icon:"user",title:"FilterContacts",key:"contacts"},{icon:"non-contacts",title:"FilterNonContacts",key:"nonContacts"},{icon:"group",title:"FilterGroups",key:"groups"},{icon:"channel",title:"FilterChannels",key:"channels"},{icon:"bots",title:"FilterBots",key:"bots"}],i=[{icon:"mute",title:"FilterMuted",key:"excludeMuted"},{icon:"archive",title:"FilterArchived",key:"excludeArchived"},{icon:"readchats",title:"FilterRead",key:"excludeRead"}],s=["includedChatIds","bots","channels","groups","contacts","nonContacts"],l=["excludedChatIds","excludeArchived","excludeMuted","excludeRead"];function c(e,t,n){let a=[],o=[];if("included"===t){const{includedChatIds:t,...i}=n?e.includeFilters||{}:(0,r.ei)(e.folder,s);a=t||[],o=Object.keys(i).filter((e=>Boolean(i[e])))}else{const{excludedChatIds:t,...i}=n?e.excludeFilters||{}:(0,r.ei)(e.folder,l);a=t||[],o=Object.keys(i).filter((e=>Boolean(i[e])))}return{selectedChatIds:a,selectedChatTypes:o}}function d(e){if(e){const{includedChatIds:t,...n}=e;if(Object.values(n).filter(Boolean).length>1||null!=t&&t.length)return"";if(n.bots)return"Bots";if(n.groups)return"Groups";if(n.channels)return"Channels";if(n.contacts)return"Contacts";if(n.nonContacts)return"Non-Contacts"}return""}const u={mode:"create",chatFilter:"",folder:{title:"",includedChatIds:[],excludedChatIds:[]}},m=(e,t)=>{switch(t.type){case"setTitle":return{...e,folder:{...e.folder,title:t.payload},isTouched:!0};case"editIncludeFilters":return{...e,includeFilters:(0,r.ei)(e.folder,s)};case"editExcludeFilters":return{...e,excludeFilters:(0,r.ei)(e.folder,l)};case"setIncludeFilters":return{...e,includeFilters:t.payload,chatFilter:""};case"setExcludeFilters":return{...e,excludeFilters:t.payload,chatFilter:""};case"saveFilters":return e.includeFilters?{...e,folder:{...(0,r.CE)(e.folder,s),title:e.folder.title?e.folder.title:d(e.includeFilters),...e.includeFilters},includeFilters:void 0,chatFilter:"",isTouched:!0}:e.excludeFilters?{...e,folder:{...(0,r.CE)(e.folder,l),...e.excludeFilters},excludeFilters:void 0,chatFilter:"",isTouched:!0}:e;case"editFolder":{const{id:e,description:n,...a}=t.payload;return{mode:"edit",folderId:e,folder:a,chatFilter:""}}case"setChatFilter":return{...e,chatFilter:t.payload};case"setIsLoading":return{...e,isLoading:t.payload};case"setError":return{...e,error:t.payload};case"reset":return u;default:return e}},h=()=>(0,a.Z)(m,u)},23186:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(33555),o=n(10396),i=n(274),s=n(85266),l=n(29290),c=n(64532);function d(e){let t={};if(e&&e.current){const{play:n,pause:a,setCurrentTime:o,proxy:i,requestNextTrack:s,requestPreviousTrack:l,isFirst:c,isLast:d}=e.current;t={play:()=>{n(i.src)},pause:()=>{a()},stop:()=>{a(),o(0),(0,r.Sv)().closeAudioPlayer()},seekbackward:e=>{const t=e.seekOffset||10;o(Math.max(i.currentTime-t,0))},seekforward:e=>{const t=e.seekOffset||10;o(Math.min(i.currentTime+t,i.duration))},seekTo:e=>{e.seekTime&&o(e.seekTime)}},d()||(t.nexttrack=()=>{s()}),c()||(t.previoustrack=()=>{l()})}return t}const u=function(e,t,n,u,m,h,v){let p=arguments.length>7&&void 0!==arguments[7]&&arguments[7],f=arguments.length>8?arguments[8]:void 0,g=arguments.length>9?arguments[9]:void 0,Z=arguments.length>10&&void 0!==arguments[10]&&arguments[10],P=arguments.length>11&&void 0!==arguments[11]&&arguments[11];const E=(0,a.sO)(null),[y,C]=(0,a.eJ)(!1);let b=y;const[N,w]=(0,a.eJ)(0),k=(0,a.I4)((()=>{C(!1),g&&g()}),[g]);(0,l.Z)((()=>{E.current=(0,o.z2)(e,n,((e,a)=>{var o;switch(e){case"onPlay":{const{setVolume:e,setPlaybackRate:t,toggleMuted:a,proxy:o}=E.current;C(!0),(0,c.N)(h,d(E)),(0,c.pC)("playing"),e((0,r.Rd)().audioPlayer.volume),a(Boolean((0,r.Rd)().audioPlayer.isMuted)),"voice"===n&&t((0,r.Rd)().audioPlayer.playbackRate),(0,c.NS)({duration:o.duration||0,playbackRate:o.playbackRate,position:o.currentTime});break}case"onRateChange":{const{proxy:e}=E.current;(0,c.NS)({duration:e.duration||0,playbackRate:e.playbackRate,position:e.currentTime});break}case"onPause":C(!1),(0,c.pC)("paused");break;case"onTimeUpdate":{const{proxy:e}=E.current,n=e.duration&&Number.isFinite(e.duration)?e.duration:t;P||w(e.currentTime/n);break}case"onEnded":(0,c.pC)("paused")}null==m||null===(o=m[e])||void 0===o||o.call(m,a)}),f,k);const{proxy:a}=E.current;y||a.paused||(C(!0),b=!0),v&&v(a)}),[e]),(0,a.d4)((()=>{y&&h&&(0,c.Ym)(h)}),[h,y]);const{play:I,pause:S,setCurrentTime:T,proxy:M,destroy:x,setVolume:L,stop:$,isFirst:O,isLast:F,requestNextTrack:A,requestPreviousTrack:D,setPlaybackRate:R,toggleMuted:U}=E.current,B=M.duration&&Number.isFinite(M.duration)?M.duration:t;(0,a.d4)((()=>{!B||(0,s.z)(M)||P||w(M.currentTime/B)}),[B,N,M,P]),(0,a.d4)((()=>()=>{x(Z)}),[x,Z]),(0,i.Z)((e=>{let[t,n]=e;t===p&&u===n||M.src&&M.paused||p&&u&&!y&&I(u)}),[p,u,y,I,M.src,M.paused]);const X=(0,a.I4)((()=>{u&&I(u)}),[u,I]),Y=(0,a.I4)((()=>{y?S():X()}),[S,X,y]),_=(0,a.I4)((e=>{T(e),B&&w(M.currentTime/B)}),[B,M,T]);return{isPlaying:b,playProgress:N,playPause:Y,pause:S,play:X,stop:$,setCurrentTime:_,setVolume:L,audioProxy:M,duration:B,requestNextTrack:A,requestPreviousTrack:D,isFirst:O,isLast:F,setPlaybackRate:R,toggleMuted:U}}},12019:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(69118),o=n(85266);function i(e,t){const n=[];for(let a=0;a<e.length;a++)n.push({start:e.start(a)/t,end:e.end(a)/t});return n}const s=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const[t,n]=(0,a.eJ)(!e),[s,l]=(0,a.eJ)(0),[c,d]=(0,a.eJ)([]),u=(0,a.Ye)((()=>(0,r.Ds)(n,200,!1,!0)),[]),m=(0,a.I4)((e=>{const t=e.currentTarget;if(!(0,o.z)(t)){if(t.buffered.length){const e=i(t.buffered,t.duration);d(e);const n=e.reduce(((e,t)=>{let{start:n,end:a}=t;return e+a-n}),0);l(n/t.duration)}u(t.readyState>=3||t.currentTime>0)}}),[u]),h={onLoadedData:m,onPlaying:m,onLoadStart:m,onPause:m,onTimeUpdate:m,onProgress:m};return{isBuffered:t,bufferedProgress:s,bufferedRanges:c,bufferingHandlers:h,checkBuffering(e){u(e.readyState>=3)}}}},15866:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(96264),o=n(65326),i=n(77361);function s(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const s=(0,a.sO)(null),l=(0,o.Z)();return(0,a.d4)((()=>{const a=s.current;if(!e||!a||t)return;const o=new Image,l=()=>{a.width=o.width,a.height=o.height;const e=a.getContext("2d",{alpha:!1});i.vX&&(e.filter="blur(2px)"),e.drawImage(o,-4,-4,a.width+8,a.height+8),i.vX||(0,r.Z)(e,0,0,a.width,a.height,2,2)};o.onload=()=>{n?requestAnimationFrame(l):l()},o.src=e}),[s,e,l,t,n]),s}},41470:(e,t,n)=>{n.d(t,{Z:()=>c});var a=n(14050),r=n(33555),o=n(83716),i=n(75806),s=n(60782),l=n(59107);const c=function(e){let{chat:t,user:n,folderId:c,isPinned:d,isMuted:u,canChangeFolder:m,handleDelete:h,handleChatFolderChange:v,handleReport:p}=e,f=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const g=(0,l.Z)(),{isSelf:Z}=n||{},P=(null==n?void 0:n.id)===o.aw;return(0,a.Ye)((()=>{if(!t)return;const{toggleChatPinned:e,updateChatMutedState:a,toggleChatArchived:o,toggleChatUnread:l}=(0,r.Sv)(),E=m?{title:g("ChatList.Filter.AddToFolder"),icon:"folder",handler:v}:void 0,y=d?{title:g("UnpinFromTop"),icon:"unpin",handler:()=>e({id:t.id,folderId:c})}:{title:g("PinToTop"),icon:"pin",handler:()=>e({id:t.id,folderId:c})};if(f)return(0,s.oA)([y,E]);const C=t.unreadCount||t.hasUnreadMark?{title:g("MarkAsRead"),icon:"readchats",handler:()=>l({id:t.id})}:{title:g("MarkAsUnread"),icon:"unread",handler:()=>l({id:t.id})},b=u?{title:g("ChatList.Unmute"),icon:"unmute",handler:()=>a({chatId:t.id,isMuted:!1})}:{title:g("ChatList.Mute"),icon:"mute",handler:()=>a({chatId:t.id,isMuted:!0})},N=(0,i.pE)(t)?{title:g("Unarchive"),icon:"unarchive",handler:()=>o({id:t.id})}:{title:g("Archive"),icon:"archive",handler:()=>o({id:t.id})},w=p&&((0,i.eA)(t)||(0,i.Bf)(t)||n&&!n.isSelf)?{title:g("ReportPeer.Report"),icon:"flag",handler:p}:void 0,k={title:(0,i.YC)(t.id)?g("Delete"):g((0,i.cc)(t)?"DeleteChat":(0,i.eA)(t)?"LeaveChannel":"Group.LeaveGroup"),icon:"delete",destructive:!0,handler:h},I=void 0!==c;return(0,s.oA)([E,C,y,!Z&&b,!Z&&!P&&!I&&N,w,k])}),[t,n,m,g,v,d,f,u,h,p,c,Z,P])}},17240:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(77361);function o(e){e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation()}const i=(e,t,n,i)=>{const[s,l]=(0,a.eJ)(!1),[c,d]=(0,a.eJ)(void 0),u=(0,a.I4)((e=>{t||2!==e.button||e.target.classList.add("no-selection")}),[t]),m=(0,a.I4)((e=>{e.target.classList.remove("no-selection"),t||n&&e.target.matches("a[href]")||(e.preventDefault(),c||(l(!0),d({x:e.clientX,y:e.clientY})))}),[t,n,c]),h=(0,a.I4)((()=>{l(!1)}),[]),v=(0,a.I4)((()=>{d(void 0)}),[]);return(0,a.d4)((()=>{if(t||!r.$b||i)return;const a=e.current;if(!a)return;let s;const u=()=>{s&&(clearTimeout(s),s=void 0)},m=e=>{t||(u(),s=window.setTimeout((()=>(e=>{u();const{clientX:t,clientY:i,target:s}=e.touches[0];c||n&&s.matches("a[href]")||(a.addEventListener("touchend",(function e(t){a.removeEventListener("touchend",e,!0),o(t)}),!0),r.fl&&r.cj&&a.addEventListener("mousedown",(function e(t){a.removeEventListener("mousedown",e,!0),o(t)}),!0),l(!0),d({x:t,y:i}))})(e)),200))};return a.addEventListener("touchstart",m,{passive:!0}),a.addEventListener("touchcancel",u,!0),a.addEventListener("touchend",u,!0),a.addEventListener("touchmove",u,{passive:!0}),()=>{u(),a.removeEventListener("touchstart",m),a.removeEventListener("touchcancel",u,!0),a.removeEventListener("touchend",u,!0),a.removeEventListener("touchmove",u)}}),[c,t,i,e,n]),{isContextMenuOpen:s,contextMenuPosition:c,handleBeforeContextMenu:u,handleContextMenu:m,handleContextMenuClose:h,handleContextMenuHide:v}}},63394:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050);const r={width:0,left:0,height:0,top:0};function o(e,t,n,o,i){const[s,l]=(0,a.eJ)("right"),[c,d]=(0,a.eJ)("bottom"),[u,m]=(0,a.eJ)(),[h,v]=(0,a.eJ)(),[p,f]=(0,a.eJ)(!1),[g,Z]=(0,a.eJ)(""),[P,E]=(0,a.eJ)("opacity: 0;");return(0,a.d4)((()=>{const a=t();if(!e||!a)return;let{x:s,y:c}=e;const u=s,h=c,p=o(),g=n(),{extraPaddingX:P=0,extraTopPadding:y=0,marginSides:C=0,extraMarginTop:b=0}=(null==i?void 0:i())||{},N=p?parseInt(getComputedStyle(p).marginTop,10)+b:void 0,w=p?{width:p.offsetWidth,height:p.offsetHeight+N}:r,k=g?g.getBoundingClientRect():r;let I,S;s+w.width+P<k.width+k.left?(s+=3,I="left"):s-w.width>0?(I="right",s-=3):(I="left",s=16),l(I),C&&"right"===I&&s+P+C>=k.width+k.left&&(s-=C),C&&"left"===I&&(s+P+C+w.width>=k.width+k.left?s-=C:s-C<=0&&(s+=C)),c+w.height<k.height+k.top?S="top":(S="bottom",c-w.height<k.top+y&&(c=k.top+k.height)),d(S);const T=a.getBoundingClientRect(),M="left"===I?Math.min(s-T.left,k.width-w.width-16):s-T.left,x=c-T.top,L=k.height-12-(N||0);f(L<w.height),E(`max-height: ${L}px;`),Z(`left: ${M}px; top: ${x}px`);const $=u-T.left-M,O=h-T.top-x-(N||0);m("left"===I?$:w.width+$),v("bottom"===S?w.height+O:O)}),[e,o,n,t,i]),{positionX:s,positionY:c,transformOriginX:u,transformOriginY:h,style:g,menuStyle:P,withScroll:p}}},75790:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(33555),o=n(69118);const i=(e,t,n,i)=>{const{loadMessage:s}=(0,r.Sv)(),l=(0,a.Ye)((()=>{const n=(0,o.P2)(s,500,!0);return()=>{n({chatId:e,messageId:t,replyOriginForId:i})}}),[s,e,t,i]);(0,a.d4)((()=>{t&&!n&&l()}))}},95616:(e,t,n)=>{n.d(t,{d7:()=>i,mE:()=>l,yi:()=>s});var a=n(14050),r=n(16974),o=n(65326);function i(e){const t=(0,o.Z)();return(0,a.d4)((()=>(0,r.M2)(e,t)),[e,t]),(0,r.gO)(e)}function s(){const e=(0,o.Z)();return(0,a.d4)((()=>(0,r.O6)(e)),[e]),(0,r.wC)()}function l(){const e=(0,o.Z)();return(0,a.d4)((()=>(0,r.r_)(e)),[e]),(0,r.Yz)()}},78781:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(14050);const r=(e,t)=>{(0,a.d4)((()=>{if(e&&!t)return e.addEventListener("wheel",n,{passive:!0}),()=>{e.removeEventListener("wheel",n)};function n(t){t.deltaX||(e.scrollLeft+=t.deltaY/4)}}),[e,t])}},73541:(e,t,n)=>{n.d(t,{y:()=>s});var a=n(14050);var r=n(16063);const o=new Set(["INPUT","TEXTAREA","SELECT"]),i=(0,r._)();function s(e){(0,a.d4)((()=>{if(!e)return;const t=Object.entries(e);return i.addCallback((function(e){(function(e){return!(e.target instanceof HTMLElement)||!o.has(e.target.tagName)})(e)&&t.forEach((t=>{let[n,a]=t;(function(e){return t=>function(e,t){const{alt:n,ctrl:a,meta:r,mod:o,shift:i,key:s}=e,{altKey:l,ctrlKey:c,metaKey:d,shiftKey:u,key:m}=t;if(n!==l)return!1;if(o){if(!c&&!d)return!1}else{if(a!==c)return!1;if(r!==d)return!1}return i===u&&Boolean(s&&(m.toLowerCase()===s.toLowerCase()||t.code.replace("Key","").toLowerCase()===s.toLowerCase()))}(function(e){const t=e.toLowerCase().split("+").map((e=>e.trim())),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift")},a=["alt","ctrl","meta","shift","mod"];return{...n,key:t.find((e=>!a.includes(e)))}}(e),t)})(n)(e)&&a(e)}))}))}),[e])}document.documentElement.addEventListener("keydown",i.runCallbacks)},12515:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(77361);function o(e,t,n){(0,a.d4)((()=>{t?r.wB||setTimeout((()=>{requestAnimationFrame((()=>{e.current&&e.current.focus()}))}),500):(e.current&&e.current.blur(),n&&setTimeout(n,300))}),[e,t,n])}},3657:(e,t,n)=>{n.d(t,{Op:()=>l,S1:()=>i,_N:()=>s});var a=n(14050),r=n(69118),o=n(18674);function i(e,t){let{rootRef:n,throttleMs:i,debounceMs:s,shouldSkipFirst:l,margin:c,threshold:d,isDisabled:u}=e;const m=(0,a.sO)(),h=(0,a.sO)(),v=(0,a.sO)(0),p=(0,a.sO)();h.current=t;const f=(0,a.I4)((()=>{v.current++}),[]),g=(0,a.I4)((()=>{v.current&&(v.current--,!v.current&&p.current&&(p.current(),p.current=void 0))}),[]);return(0,o.ZP)(f,g),(0,a.d4)((()=>{if(!u)return()=>{m.current&&(m.current.observer.disconnect(),m.current.callbacks.clear(),m.current=void 0)}}),[u]),{observe:(0,a.I4)(((e,t)=>{m.current||function(){const e=new Map,t=new Map,a=()=>{const n=Array.from(t.values());n.forEach((t=>{const a=e.get(t.target);a&&a(t,n)})),h.current&&h.current(n),t.clear()},o=i?r.P2:s?r.Ds:void 0,u=o?o(a,i||s,!l):a,f=new IntersectionObserver((e=>{e.forEach((e=>{t.set(e.target,e)})),v.current?p.current=()=>{u()}:u()}),{root:n.current,rootMargin:c?`${c}px`:void 0,threshold:d});m.current={observer:f,callbacks:e}}();const a=m.current;return a.observer.observe(e),t&&a.callbacks.set(e,t),()=>{t&&a.callbacks.delete(e),a.observer.unobserve(e)}}),[u]),freeze:f,unfreeze:g}}function s(e,t,n){(0,a.d4)((()=>t?t(e.current,n):void 0),[])}function l(e,t,n){const[r,o]=(0,a.eJ)(!t);return s(e,t,(e=>{o(e.isIntersecting),n&&n(e)})),r}},72645:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(87204);const o=(e,t,n)=>{const o=(0,r.Z)(t);return(0,a.bt)((()=>e(o||[])),t,n)}},92566:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(14050),r=n(77361),o=n(6137),i=n(69118),s=n(40647),l=n(65326),c=n(26926);const d={},u=()=>{const e=(0,a.sO)();return e.current||(e.current=(0,c.Z)(d),d[e.current]=!0),e.current};function m(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.IU.BlobUrl,c=arguments.length>3?arguments[3]:void 0,d=arguments.length>4?arguments[4]:void 0,m=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const h=e?s.UV(e):void 0,v=n===o.IU.Stream||r.I_&&n===o.IU.Progressive,p=(0,l.Z)(),f=u(),[g,Z]=(0,a.eJ)(h&&!v?1:0),P=(0,a.sO)(),E=(0,a.Ye)((()=>(0,i.P2)((e=>{P.current&&(!d||Date.now()-P.current>d)&&Z(e)}),500,!0)),[d]);return(0,a.d4)((()=>{!t&&e&&(h?v&&setTimeout((()=>{Z(.75)}),1500):(Z(0),P.current&&s.cC(E),P.current=Date.now(),s.he(e,n,m,E,f).then((()=>{const e=Date.now()-P.current;P.current=void 0,!d||e>=d?p():setTimeout(p,d-e)}))))}),[t,e,h,n,c,p,v,d,E,m,f]),(0,a.d4)((()=>{t&&P.current&&(s.cC(E),Z(0),P.current=void 0)}),[E,t]),(0,a.d4)((()=>()=>{e&&s.Iq(e,f)}),[f,e]),{mediaData:h,loadProgress:g}}},56503:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(14050),r=n(77361);let o;function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:250,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=(0,a.sO)(!1),l=(0,a.I4)((()=>{s.current=!0}),[]);(0,a.d4)((()=>{o&&(clearTimeout(o),o=void 0),!e||r.$b||i||(o=window.setTimeout((()=>{s.current||t()}),2*n))}),[i,e,n,t]);const c=(0,a.I4)((()=>{s.current=!0}),[]),d=(0,a.I4)((()=>{s.current=!1,o&&(clearTimeout(o),o=void 0),o=window.setTimeout((()=>{s.current||t()}),n)}),[n,t]);return[c,d,l]}},52678:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(87204),o=n(65326),i=n(29290);function s(e,t){const n=(0,r.Z)(e,!0),s=(0,a.sO)(),l=(0,o.Z)(),c=null!=e,d=null!=n;return c&&s.current&&(clearTimeout(s.current),s.current=void 0),(0,i.Z)((()=>{t&&!c&&d&&!s.current&&(s.current=window.setTimeout((()=>{s.current=void 0,l()}),t))}),[e]),s.current&&t&&!c?n:e}},91090:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(14050);function r(e,t){const n=(0,a.sO)(e),[r,o]=(0,a.eJ)(t);return[r,(0,a.I4)((e=>{o((t=>n.current(t,e)))}),[])]}},88957:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(67360);function r(e,t,n){return(0,a.Z)((e=>{e()}),[],e,t,n)}},33057:(e,t,n)=>{n.d(t,{Z:()=>u});var a=n(14050),r=n(65116),o=n(83716),i=n(790),s=n(59107),l=n(99203),c=n(48778);const d=(0,a.X$)((e=>{const{isOpen:t}=e,n=(0,c.Z)(l.gl.Extra,"CalendarModal",!t);return n?a.ZP.createElement(n,e):void 0})),u=(e,t)=>{const n=(0,s.Z)(),[l,c]=(0,a.eJ)(),u=(0,a.I4)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{serverTimeOffset:n}=(0,r.Rd)(),a=Math.round(Math.max(e.getTime(),Date.now()+6e4)/1e3)+(t?0:n);null==l||l(a),c(void 0)}),[l]),m=(0,a.I4)((()=>{u(new Date(1e3*o.t4),!0)}),[u]),h=(0,a.I4)((()=>{c(void 0),null==t||t()}),[t]),v=(0,a.I4)((e=>{c((()=>e))}),[]),p=new Date;p.setSeconds(0),p.setMilliseconds(0);const f=new Date;return f.setFullYear(f.getFullYear()+1),[v,a.ZP.createElement(d,{isOpen:Boolean(l),withTimePicker:!0,selectedAt:p.getTime(),maxAt:(0,i._F)(f),isFutureMode:!0,secondButtonLabel:e?n("Schedule.SendWhenOnline"):void 0,onClose:h,onSubmit:u,onSecondButtonClick:e?m:void 0})]}},56389:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(14050),r=n(33555),o=n(83716),i=n(69118);const s=(e,t)=>(0,a.Ye)((()=>(0,i.P2)((n=>{(0,r.Sv)().sendMessageAction({chatId:e,threadId:t,action:n})}),o.o_)),[e,t])},70971:(e,t,n)=>{n.d(t,{Y:()=>o});var a=n(14050),r=n(29290);function o(e){const t=(0,a.sO)(e);return(0,r.Z)((()=>{t.current=e}),[e]),t}},28183:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(14050);const r=function(e,t){const n=(0,a.sO)(e);(0,a.bt)((()=>{n.current=e}),[e]),(0,a.d4)((()=>{if("number"!=typeof t)return;const e=setTimeout((()=>n.current()),t);return()=>clearTimeout(e)}),[t])}},46898:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(14050),r=n(69118);function o(e,t){(0,a.d4)((()=>{const t=e.current;return()=>{t&&(0,r.T2)((()=>{t.pause(),t.src="",t.load()}))}}),t)}},96264:(e,t,n)=>{n.d(t,{Z:()=>o});const a=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],r=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18];function o(e,t,n,o,i,s,l){if(Number.isNaN(s)||s<1)return;s|=0,Number.isNaN(l)&&(l=1),(l|=0)>3&&(l=3),l<1&&(l=1);const c=e.getImageData(t,n,o,i),d=c.data;let u,m,h,v,p,f,g,Z,P,E,y,C,b=o-1,N=i-1,w=s+1,k=[],I=[],S=[],T=a[s],M=r[s],x=[],L=[];for(;l-- >0;){for(C=y=0,p=0;p<i;p++){for(u=d[C]*w,m=d[C+1]*w,h=d[C+2]*w,f=1;f<=s;f++)g=C+((f>b?b:f)<<2),u+=d[g++],m+=d[g++],h+=d[g++];for(v=0;v<o;v++)k[y]=u,I[y]=m,S[y]=h,0==p&&(x[v]=((g=v+w)<b?g:b)<<2,L[v]=(g=v-s)>0?g<<2:0),Z=C+x[v],P=C+L[v],u+=d[Z++]-d[P++],m+=d[Z++]-d[P++],h+=d[Z++]-d[P++],y++;C+=o<<2}for(v=0;v<o;v++){for(E=v,u=k[E]*w,m=I[E]*w,h=S[E]*w,f=1;f<=s;f++)E+=f>N?0:o,u+=k[E],m+=I[E],h+=S[E];for(y=v<<2,p=0;p<i;p++)d[y]=u*T>>>M,d[y+1]=m*T>>>M,d[y+2]=h*T>>>M,0==v&&(x[p]=((g=p+w)<N?g:N)*o,L[p]=(g=p-s)>0?g*o:0),Z=v+x[p],P=v+L[p],u+=k[Z]-k[P],m+=I[Z]-I[P],h+=S[Z]-S[P],y+=o<<2}}e.putImageData(c,t,n)}},10396:(e,t,n)=>{n.d(t,{An:()=>E,Es:()=>f,z2:()=>g});var a=n(33555),r=n(91713),o=n(77361),i=n(74753),s=n(85266),l=n(75806),c=n(69118),d=n(11192);const u=new Map;let m,h=[],v=[];function p(e,t){const n=m&&u.get(m);n&&(n.audio.pause(),n.audio.currentTime=0,n.onTrackChange&&n.onTrackChange());const o=P(e,(0,a.Rd)().audioPlayer.origin||r.Cr.Inline,t);if(!o)return;if(!u.has(o))return void(0,a.Sv)().openAudioPlayer((0,l.Ak)(y(o).messageKey));const s=u.get(o);s.onForcePlay&&s.onForcePlay(),m=o,s.audio.src&&(0,i.Z)(s.audio)}function f(){const e=m&&u.get(m);e&&e.audio.pause()}function g(e,t,n,f,g){if(!u.has(e)){const n=function(e,t,n,a){const r=new Audio;function o(t){return n=>{u.has(e)&&((0,s.z)(r)||u.get(e).handlers.forEach((e=>{e(t,n)})))}}return r.addEventListener("timeupdate",o("onTimeUpdate")),r.addEventListener("play",o("onPlay")),r.addEventListener("pause",o("onPause")),r.addEventListener("loadstart",o("onLoadStart")),r.addEventListener("loadeddata",o("onLoadedData")),r.addEventListener("playing",o("onPlaying")),r.addEventListener("ended",(()=>{u.has(e)&&((0,s.z)(r)||p(e))})),{audio:r,type:t,proxy:new Proxy(r,{get:(e,t)=>e[t]}),handlers:[],onForcePlay:n,onTrackChange:a}}(e,t,f,g);u.set(e,n),function(e,t){"audio"!==e.type||v.includes(t)||(v.push(t),v.sort(C)),"voice"!==e.type||h.includes(t)||(h.push(t),h.sort(C))}(n,e)}const{audio:Z,proxy:E,handlers:b}=u.get(e);return b.push(n),{play(n){if(!Z.paused)return;const c=m&&u.get(m);c&&m!==e&&(c.audio.pause(),c.audio.currentTime=0,(0,s.z)(c.audio)&&(c.audio.dataset.preventPlayAfterPatch="true"),c.onTrackChange&&c.onTrackChange()),m=e,Z.src||(Z.src=n,Z.preload="auto",n.includes("/progressive/")&&o.s$&&(delete Z.dataset.preventPlayAfterPatch,(0,s.B)(Z))),(0,i.Z)(Z),function(e,t){var n;if((0,a.Rd)().globalSearch.currentContent===r.nJ.Music)return;const{chatId:o}=(0,l.Ak)(y(t).messageKey),i=null===(n=(0,d.Bt)((0,a.Rd)()))||void 0===n?void 0:n.chatId,s=e=>e.startsWith(`msg${o}`)||i&&e.startsWith(`msg${i}`);"audio"===e&&(v=v.filter(s)),"voice"===e&&(h=h.filter(s))}(t,e)},pause(){m===e&&Z.pause()},stop(){if(m===e){const e=Z.src;Z.pause(),(0,c.T2)((()=>{Z.src="",Z.src=e}))}},setCurrentTime(t){m===e&&(Z.fastSeek?Z.fastSeek(t):Z.currentTime=t)},setVolume(t){m===e&&(Z.volume=t,Z.muted=!1)},setPlaybackRate(t){m===e&&(Z.playbackRate=t)},toggleMuted(e){Z.muted=void 0===e?!Z.muted:e},proxy:E,requestNextTrack(){p(e)},isLast:()=>!P(e,(0,a.Rd)().audioPlayer.origin),isFirst:()=>!P(e,(0,a.Rd)().audioPlayer.origin,!0),requestPreviousTrack(){p(e,!0)},destroy(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const a=u.get(e);a&&(a.handlers=a.handlers.filter((e=>e!==n)),a.handlers.length||(a.audio.pause(),u.delete(e),t&&function(e,t){const n=e=>e!==t;"audio"===e.type&&(v=v.filter(n)),"voice"===e.type&&(h=h.filter(n))}(a,e),e===m&&(m=void 0)))}}}function Z(e){switch(e.type){case"audio":return v;case"voice":return h;default:return}}function P(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.Cr.Inline,n=arguments.length>2?arguments[2]:void 0;const a=u.get(e),o=Z(a);if(!o)return;if(t===r.Cr.Search){const t=o.indexOf(e);if(t<0)return;return o[t+(n?-1:1)]}const{chatId:i}=(0,l.Ak)(y(e).messageKey),s=o.filter((e=>e.startsWith(`msg${i}`))),c=s.indexOf(e);if(c<0)return;let d=t===r.Cr.Inline?-1:1;return n&&(d*=-1),s[c+d]}function E(e){return`${(0,l.Tp)(e)}-${e.date}`}function y(e){return{messageKey:e.match(/^msg(-?\d+)-(\d+)/)[0],date:Number(e.split("-").pop())}}function C(e,t){if(!e||!t)return 0;const{date:n,messageKey:a}=y(e),{date:r,messageKey:o}=y(t),i=r-n;return 0===i?o.localeCompare(a):i}},71174:(e,t,n)=>{n.d(t,{eM:()=>i,sf:()=>u,vJ:()=>s});var a=n(77361),r=n(28712),o=n(69118);let i;!function(e){e[e.Up=0]="Up",e[e.Down=1]="Down",e[e.Left=2]="Left",e[e.Right=3]="Right"}(i||(i={}));const s=20;function l(e,t){return t?Math.hypot(t.pageX-e.pageX,t.pageY-e.pageY):0}function c(e,t){return{x:(e.pageX+t.pageX)/2,y:(e.pageY+t.pageY)/2}}let d=0;function u(e,t){var n,u,m;let h,v,p=!1,f=!1,g=!1,Z=0,P=null!==(n=t.initialZoom)&&void 0!==n?n:1,E={x:0,y:0},y={x:!1,y:!1},C={x:window.innerWidth/2,y:window.innerHeight/2};const b=null!==(u=t.minZoom)&&void 0!==u?u:1,N=null!==(m=t.maxZoom)&&void 0!==m?m:4;function w(e){if(!t.excludedClosestSelector||!e.target.matches(t.excludedClosestSelector)&&!e.target.closest(t.excludedClosestSelector)){if(h=e,"mousedown"===e.type)!t.withNativeDrag&&t.onDrag&&e.preventDefault(),document.addEventListener("mousemove",I),document.addEventListener("mouseup",k);else if("touchstart"===e.type){const t=e.target;t.addEventListener("touchmove",I,{passive:!0}),t.addEventListener("touchend",k),t.addEventListener("touchcancel",k),"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),2===e.touches.length&&(Z=l(e.touches[0],e.touches[1]),C=c(e.touches[0],e.touches[1])))}t.withCursor&&document.body.classList.add("cursor-grabbing"),t.onCapture&&t.onCapture(e)}}function k(e){h&&(t.withCursor&&document.body.classList.remove("cursor-grabbing"),document.removeEventListener("mouseup",k),document.removeEventListener("mousemove",I),h.target.removeEventListener("touchcancel",k),h.target.removeEventListener("touchend",k),h.target.removeEventListener("touchmove",I),a.cj&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow=""})),e&&(p?t.onRelease&&t.onRelease(e):"mouseup"===e.type&&(t.onDoubleClick&&Date.now()-d<300?t.onDoubleClick(e,{centerX:h.pageX,centerY:h.pageY}):!t.onClick||"button"in e&&0!==e.button||t.onClick(e),d=Date.now()))),p=!1,f=!1,g=!1,Z=0,P=(0,r.uZ)(P,b,N),v=void 0,E={x:0,y:0},y={x:!1,y:!1},C={x:window.innerWidth/2,y:window.innerHeight/2},h=void 0}function I(e){if(h){if("touchmove"===e.type&&"touches"in e&&(void 0===e.pageX&&(e.pageX=e.touches[0].pageX),void 0===e.pageY&&(e.pageY=e.touches[0].pageY),t.onZoom&&Z>0&&2===e.touches.length)){const n=l(e.touches[0],e.touches[1]),a=c(e.touches[0],e.touches[1]),r=a.x-C.x,o=a.y-C.y,i=n/Z;t.onZoom(e,{zoomFactor:i,initialCenterX:C.x,initialCenterY:C.y,dragOffsetX:r,dragOffsetY:o,currentCenterX:a.x,currentCenterY:a.y}),1!==i&&(p=!0)}const n=e.pageX-h.pageX,r=e.pageY-h.pageY;(Math.abs(n)>=15||Math.abs(r)>=15)&&(p=!0);let o=!1;t.onDrag&&(t.onDrag(e,h,{dragOffsetX:n,dragOffsetY:r}),o=!0),t.onSwipe&&!f&&(f=function(e,n,r){if(a.cj){const t=e.touches[0].pageX;if(t<=s||t>=window.innerWidth-s)return!1}const o=Math.abs(n),l=Math.abs(r);if(n&&r&&Math.max(o,l)/Math.min(o,l)<2)return!1;let c;if(o>=50?c="x":l>=50&&(c="y"),!c)return!1;if(v){if(v!==c)return!1}else v=c;return function(e,t,n,a,r){return"x"===t?r(e,n<0?i.Left:i.Right):"y"===t&&r(e,a<0?i.Up:i.Down)}(e,c,n,r,t.onSwipe)}(e,n,r),o=f),a.cj&&o&&t.selectorToPreventScroll&&Array.from(document.querySelectorAll(t.selectorToPreventScroll)).forEach((e=>{e.style.overflow="hidden"}))}}const S=(0,o.Ds)(k,100,!1);function T(e){if(!t.onZoom&&!t.onDrag)return;e.preventDefault(),e.stopPropagation(),p||(w(e),p=!0,C={x:e.x,y:e.y});const{doubleTapZoom:n=3}=t;if(t.onDoubleClick&&Object.is(e.deltaX,-0)&&Object.is(e.deltaY,-0)&&e.ctrlKey)return P=P>1?1:n,t.onDoubleClick(e,{centerX:e.pageX,centerY:e.pageY}),void(p=!1);const a=e.metaKey||e.ctrlKey||e.shiftKey;if(t.onZoom&&a){g=!0;const n=e.x-C.x,a=e.y-C.y,o=(0,r.uZ)(e.deltaY,-25,25);P-=.01*o,P=(0,r.uZ)(P,.5*b,3*N),t.onZoom(e,{zoom:(0,r.NM)(P,2),initialCenterX:C.x,initialCenterY:C.y,dragOffsetX:n,dragOffsetY:a,currentCenterX:e.x,currentCenterY:e.y})}if(t.onDrag&&!a&&!g){y.x&&Math.sign(E.x)!==Math.sign(e.deltaX)||(E.x-=e.deltaX),y.y&&Math.sign(E.y)!==Math.sign(e.deltaY)||(E.y-=e.deltaY);const{x:n,y:a}=E;t.onDrag(e,h,{dragOffsetX:n,dragOffsetY:a},((e,t)=>{y={x:e,y:t}}))}S(e)}return e.addEventListener("wheel",T),e.addEventListener("mousedown",w),e.addEventListener("touchstart",w,{passive:!t.isNotPassive}),()=>{k(),e.removeEventListener("wheel",T),e.removeEventListener("touchstart",w),e.removeEventListener("mousedown",w)}}},3570:(e,t,n)=>{function a(e,t){return t-Math.floor(t/e)*e}n.d(t,{Z:()=>a})},60539:(e,t,n)=>{n.d(t,{N:()=>m,Z:()=>u});var a=n(33555),r=n(91713),o=n(83716),i=n(77361),s=n(18674),l=n(9933),c=n(69118);let d=!1;function u(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:o.V$,l=arguments.length>5?arguments[5]:void 0,c=arguments.length>6?arguments[6]:void 0,d=arguments.length>7?arguments[7]:void 0;const u=h(e,t,s,l);l!==r.fo.Static?((0,a.Rd)().settings.byKey.animationLevel===o.oB&&(c=0),v(e,t,u,n,i,c,d)):v(e,t,u,n,i,0)}function m(){return d}function h(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o.V$,a=arguments.length>3?arguments[3]:void 0;const{offsetTop:i}=t,{scrollTop:s}=e;if(void 0===a){const t=i-e.scrollTop;if(t<-n)return s+(t+n);if(t>n)return s+(t-n)}else{if(a===r.fo.Up)return i+n;if(a===r.fo.Down)return Math.max(0,i-n)}return s}function v(e,t,n,a){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=arguments.length>5?arguments[5]:void 0,m=arguments.length>6?arguments[6]:void 0;const{offsetTop:h,offsetHeight:v}=t,{scrollTop:g,offsetHeight:Z,scrollHeight:P}=e,E=m&&e.dataset.normalHeight?Number(e.dataset.normalHeight):Z;let y;switch(g!==n&&(e.scrollTop=n),a){case"start":y=h-r-n+(i.wZ?1:0);break;case"end":y=h+v+r-(n+E);break;case"nearest":case"center":case"centerOrTop":y=v<E?h+v/2-(n+E/2):h-r-n}if(y<0){const e=-n;y=Math.max(y,e)}else if(y>0){const e=P-(n+E);y=Math.min(y,e)}if(0===y)return;const C=n+y;if(0===u)return void(e.scrollTop=C);d=!0;const b=Math.abs(y),N=b<o.xn?f:p,w=u||o.bK+b/o.V$*(o.ck-o.bK),k=Date.now(),I=(0,s.YW)();(0,c.T2)((()=>{(0,l.cK)((()=>{const t=Math.min((Date.now()-k)/w,1),n=y*(1-N(t));return e.scrollTop=Math.round(C-n),d=t<1,d||I(),d}))}))}function p(e){return 1-(1-e)**5}function f(e){return 1-(1-e)**3.5}},81367:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(33555),r=n(83716),o=n(9933),i=n(69118);function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300;(0,a.Rd)().settings.byKey.animationLevel===r.oB&&(n=0),l(e,t,n)}function l(e,t,n){const a="rtl"===e.getAttribute("dir"),{scrollLeft:r,offsetWidth:s,scrollWidth:l}=e;let c=t-r;if(c<0){const e=-r*(a?-1:1);c=Math.max(c,e)}else if(c>0){const e=l-(r+s);c=Math.min(c,e)}if(0===c)return;const d=r+c;if(0===n)return void(e.scrollLeft=d);const u=Date.now();(0,i.T2)((()=>{(0,o.jt)((()=>{const t=Math.min((Date.now()-u)/n,1),a=c*(1-function(e){return 1-(1-e)**3.5}(t));return e.scrollLeft=Math.round(d-a),t<1}))}))}},65723:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n(77361);function r(e,t,n){if(!t&&e===document.activeElement)return;const r=window.getSelection(),o=document.createRange(),i=e.lastChild||e;a.$b||n||i&&i.nodeValue?(o.selectNodeContents(n?e:i),o.collapse(!1),r.removeAllRanges(),r.addRange(o)):e.focus()}},60998:(e,t,n)=>{function a(){const e=window.getSelection();let t=e&&e.rangeCount?e.getRangeAt(0).cloneContents():void 0;if(!t||0===t.childElementCount)return;const n=Array.from(t.children).reduce(((e,t)=>1===t.nodeType&&t.classList.contains("message-date-group")?Array.from(t.querySelectorAll(".Message")).reduce(((e,t)=>e.concat(Number(t.dataset.messageId))),e):1===t.nodeType&&t.classList.contains("Message")?e.concat(Number(t.dataset.messageId)):e),[]);for(;t.firstChild;)t.removeChild(t.firstChild);return t=void 0,n}n.d(t,{Z:()=>a})},55254:(e,t,n)=>{n.d(t,{P:()=>r});var a=n(43858);function r(e){if("none"===e.style.display)return!1;const t=e.getBoundingClientRect(),{height:n}=a.Z.get();return t.top<=n&&t.top+t.height>=0}},28712:(e,t,n)=>{n.d(t,{Kh:()=>r,NM:()=>o,uZ:()=>a});const a=(e,t,n)=>Math.min(n,Math.max(t,e)),r=(e,t,n)=>e>=t&&e<=n,o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.round(e*10**t)/10**t}},64532:(e,t,n)=>{n.d(t,{Ay:()=>s,N:()=>r,NS:()=>c,Of:()=>d,Ym:()=>o,pC:()=>l});const a={play:void 0,pause:void 0,seekbackward:void 0,seekforward:void 0,previoustrack:void 0,nexttrack:void 0,stop:void 0,seekTo:void 0};function r(e,t){const{mediaSession:n}=window.navigator;n?(e&&o(e),t&&i(t)):console.warn("MediaSession API not supported in this browser")}function o(e){const{mediaSession:t}=window.navigator;t&&(t.metadata=null!=e?e:null)}function i(e){const{mediaSession:t}=window.navigator;t&&Object.entries({...a,...e}).forEach((e=>{let[n,a]=e;try{t.setActionHandler(n,a)}catch(e){}}))}function s(){const{mediaSession:e}=window.navigator;var t;e&&(e.metadata=null,i(a),e.playbackState&&(e.playbackState="none"),null===(t=e.setPositionState)||void 0===t||t.call(e))}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"none";const{mediaSession:t}=window.navigator;t&&t.playbackState&&(t.playbackState=e)}function c(e){var t;if(!e||void 0===e.position||void 0===e.duration)return;e.position=Math.min(e.position,e.duration);const{mediaSession:n}=window.navigator;null==n||null===(t=n.setPositionState)||void 0===t||t.call(n,e)}function d(e){let{title:t,artist:n,album:a,artwork:r}=e;if("MediaMetadata"in window)return new window.MediaMetadata({title:t,artist:n,album:a,artwork:r})}},83099:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(6137),r=n(77361),o=n(83716);const i={B:a.Vv.Bold,STRONG:a.Vv.Bold,I:a.Vv.Italic,EM:a.Vv.Italic,U:a.Vv.Underline,S:a.Vv.Strike,STRIKE:a.Vv.Strike,DEL:a.Vv.Strike,CODE:a.Vv.Code,PRE:a.Vv.Pre,BLOCKQUOTE:a.Vv.Blockquote};function s(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("div");n.innerHTML=l(t?c(e):e);const a=n.innerText.trim().replace(/\u200b+/g,"");let r=0,o=0;const i=[];function s(e){const{index:t,entity:n}=d(e,a,r);if(n)r=t,i.push(n);else if(e.textContent){if(0===t&&""===e.textContent.trim())return;r+=e.textContent.length}e.hasChildNodes()&&o<=3&&(o+=1,Array.from(e.childNodes).forEach(s))}return Array.from(n.childNodes).forEach((e=>{o=1,s(e)})),{text:a,entities:i.length?i:void 0}}function l(e){let t=e.slice(0);return r.op||(t=t.replace(/<img[^>]+alt="([^"]+)"[^>]*>/gm,"$1")),t=t.replace(/ /g," "),t=t.replace(/<div><br([^>]*)?><\/div>/g,"\n"),t=t.replace(/<br([^>]*)?>/g,"\n"),t=t.replace(/<\/div>(\s*)<div>/g,"\n"),t=t.replace(/<div>/g,"\n"),t=t.replace(/<\/div>/g,""),t=t.replace(/^`{3}(.*?)[\n\r](.*?[\n\r]?)`{3}/gms,'<pre data-language="$1">$2</pre>'),t=t.replace(/^`{3}[\n\r]?(.*?)[\n\r]?`{3}/gms,"<pre>$1</pre>"),t=t.replace(/[`]{3}([^`]+)[`]{3}/g,"<pre>$1</pre>"),t=t.replace(/[`]{1}([^`\n]+)[`]{1}/g,"<code>$1</code>"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[*]{2}([^*\n]+)[*]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<b>$2</b>$3"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[_]{2}([^_\n]+)[_]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<i>$2</i>$3"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[~]{2}([^~\n]+)[~]{2}(?![^<]*<\/code>)(\s|$)/g,"$1<s>$2</s>$3"),t=t.replace(/(^|\s)(?!<code[^<]*|<\/)[|]{2}([^|\n]+)[|]{2}(?![^<]*<\/code>)(\s|$)/g,`$1<span data-entity-type="${a.Vv.Spoiler}">$2</span>$3`),t}function c(e){return e.replace(new RegExp(`\\[([^\\]]+?)]\\((${o.FM}+?)\\)`,"g"),((e,t,n)=>`<a href="${n.includes("://")?n:n.includes("@")?`mailto:${n}`:`http://${n}`}">${t}</a>`))}function d(e,t,n){const r=function(e){if(i[e.nodeName])return i[e.nodeName];if("A"===e.nodeName){const t=e;return t.dataset.entityType===a.Vv.MentionName?a.Vv.MentionName:t.dataset.entityType===a.Vv.Url?a.Vv.Url:t.href.startsWith("mailto:")?a.Vv.Email:t.href.startsWith("tel:")?a.Vv.Phone:t.href!==t.textContent?a.Vv.TextUrl:a.Vv.Url}return"SPAN"===e.nodeName?e.dataset.entityType:void 0}(e);if(!r||!e.textContent)return{index:n,entity:void 0};const o=t.indexOf(e.textContent,n),s=o>=0?o:n,l=t.substring(0,s).length,{length:c}=t.substring(s,s+e.textContent.length);let d,u,m;return r===a.Vv.TextUrl&&(d=e.href),r===a.Vv.MentionName&&(u=e.dataset.userId),r===a.Vv.Pre&&(m=e.dataset.language),{index:s,entity:{type:r,offset:l,length:c,...d&&{url:d},...u&&{userId:u},...m&&{language:m}}}}},85266:(e,t,n)=>{function a(e){e.dataset.patchedForSafari||(e.addEventListener("play",(()=>{const t=e.currentTime;e.dataset.patchForSafariInProgress="true",e.addEventListener("progress",(function n(){e.buffered.length&&(e.currentTime=e.duration-1,e.addEventListener("progress",(()=>{delete e.dataset.patchForSafariInProgress,e.currentTime=t,e.paused&&!e.dataset.preventPlayAfterPatch&&e.play()}),{once:!0}),e.removeEventListener("progress",n))}))}),{once:!0}),e.dataset.patchedForSafari="true")}function r(e){return Boolean(e.dataset.patchForSafariInProgress)}n.d(t,{B:()=>a,z:()=>r})},3858:(e,t,n)=>{n.d(t,{Z:()=>a});const a=e=>{e.stopPropagation(),e.preventDefault()}},85655:(e,t,n)=>{let a;function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"*",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];a||(a=document.createElement("input"),a.setAttribute("type","file")),a.setAttribute("accept",e),n?a.removeAttribute("multiple"):a.setAttribute("multiple","multiple"),a.onchange=null,a.value="",a.onchange=t,a.click()}n.d(t,{g:()=>r})},18629:(e,t,n)=>{function a(){const e=getComputedStyle(document.documentElement),t=o(e,"--color-background"),n=o(e,"--color-text"),a=o(e,"--color-primary"),r=o(e,"--color-white"),i=o(e,"--color-links");return{bg_color:t,text_color:n,hint_color:o(e,"--color-text-secondary"),link_color:i,button_color:a,button_text_color:r}}function r(e){return/^#[0-9A-F]{6}$/i.test(e)}function o(e,t){return r(n=e.getPropertyValue(t).trim())?n:`#${n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+\.{0,1}\d*))?\)$/).slice(1).map(((e,t)=>(3===t?Math.round(255*parseFloat(e)):parseFloat(e)).toString(16).padStart(2,"0").replace("NaN",""))).join("")}`;var n}n.d(t,{B:()=>a,U:()=>r})}}]);
|
||
//# sourceMappingURL=621.d419b351754683e97515.js.map
|