Build 614181stable
Module 175203
11,882 characters · in 6d7327312f33717a.js, 01b65b7852279e18.jsDependencies
Lazily required by (0)none
Requires (85)
1247017928195753130031408400565109266004733928310783982110234111162117029141035164617209932254138266080272812280450289020290863304047321073345812358618365199375708384059408278428678428689429913461782477900479669485296503698520698544576551826556525567249574172582128584841609425609731612258614518615675635885646270652215654820661531665691666654672979706787712687717421723702731854738678765671788120790381793574802867804980806931820284827343834730866665885386890856943812952270958005977997983851990836
Lazily requires (0)none
Source Raw
function(e,t,l){l.d(t,{Ay:()=>e$,Yl:()=>ew}),l(321073);var i=l(477900),s=l(582128),n=l(503698),a=l.n(n),d=l(479669),r=l(738678),o=l(12470),c=l(17928),p=l(661531),u=l(31300),m=l(428689),A=l(289020),h=l(890856),x=l(646270),v=l(615675),j=l(666654),g=l(990836),I=l(83107),y=l(866665),N=l(408278),f=l(609731),T=l(788120),S=l(943812),E=l(834730),C=l(717421),b=l(365199),O=l(358618),_=l(983851),G=l(428678),M=l(952270),U=l(254138),D=l(827343),R=l(820284),L=l(765671),P=l(672979),V=l(793574),k=l(429913),w=l(520698),$=l(164617),z=l(66004),W=l(958005),H=l(384059),Q=l(556525),Y=l(609425),X=l(73392),J=l(51092),F=l(40056),B=l(117029),q=l(612258),K=l(551826),Z=l(567249),ee=l(574172),et=l(665691),el=l(635885),ei=l(209932),es=l(885386),en=l(461782),ea=l(614518),ed=l(706787),er=l(280450),eo=l(111162),ec=l(544576),ep=l(290863),eu=l(485296),em=l(977997),eA=l(712687),eh=l(790381),ex=l(266080),ev=l(723702),ej=l(19575),eg=l(141035),eI=l(654820),ey=l(804980),eN=l(272812),ef=l(304047),eT=l(802867),eS=l(83982),eE=l(345812),eC=l(110234),eb=l(652215),eO=l(806931),e_=l(31408),eG=l(731854),eM=l(375708),eU=l(584841);let eD=[eO.lp.ACTIVITY],eR=s.memo(e=>{var t,l,n;let d,r,o,{participant:p,popoutType:x,onDoubleClick:v,onContextMenu:j,onClick:g,onMouseDown:I,onKeyDown:y,className:N,style:f,containerStyle:T,channel:S,width:E,onVideoResize:C,inCall:b=!1,selected:O=!1,noBorder:_=!1,noVideoRender:G=!1,focused:M=!1,blocked:U=!1,ignored:P=!1,fit:V=J.$.CONTAIN,paused:$=!1,pulseSpeakingIndicator:W=!1,forceIdle:H=!1,controlsBottom:Y}=e,X=s.useContext(en.vG)||H,[B,Z]=s.useState(!1),ee=es.Q_.useSetting(),el=(0,c.bG)([eo.default],()=>eo.default.isStreamInfoOverlayEnabled),[ep,eA]=s.useState(!1),eh=(0,c.bG)([er.default],()=>er.default.getId()),ex=p.type===eO.lp.ACTIVITY?null:p.user,ev=ex?.id??null,[ej]=(0,k.A)(p.type===eO.lp.ACTIVITY?[p.applicationId]:[]),ef=(0,c.bG)([ec.Ay],()=>null!=ev&&ec.Ay.isLocalVideoDisabled(ev,(0,w.A)(p.type)),[ev,p.type]),eE=(0,c.bG)([ec.Ay],()=>null!=ev?ec.Ay.getVideoToggleState(ev,(0,w.A)(p.type)):eb.bb8.NONE,[ev,p.type]),eR=eE===eb.bb8.AUTO_PROBING,{speaking:eL,ringing:eP,hasVideo:eV}=(0,eC.A)(p,eh),ew=(0,c.bG)([ei.A],()=>null!==ev&&ei.A.isUserPlayingSounds(ev),[ev]),e$=(t=eh,l=p,n=S.getGuildId(),d=l.type!==eO.lp.ACTIVITY?l.user.id:l.applicationId,r=(0,c.cf)([em.A],()=>{let e=em.A.getVoiceState(n,d);return{muted:e?.mute??!1,deafened:e?.deaf??!1,suppressed:e?.suppress??!1,voiceChannelId:e?.channelId}}),o=(0,c.cf)([ec.Ay],()=>{let e=(0,w.A)(l.type);return t===d?{muted:!1,deafened:!1}:{muted:ec.Ay.isLocalMute(d,e),localVideoDisabled:ec.Ay.isLocalVideoDisabled(d,e),localVideoAutoDisabled:ec.Ay.isLocalVideoAutoDisabled(d,e)}},[t,l.type,d]),{serverMuted:r.muted,serverDeafened:r.deafened,suppressed:r.suppressed,localMuted:o.muted,muted:(l.type===eO.lp.USER&&l.voiceState?.isVoiceMuted())??!1,deafened:(l.type===eO.lp.USER&&l.voiceState?.isVoiceDeafened())??!1}),ez=p.type===eO.lp.STREAM&&ev===eh,eW=(0,c.bG)([ea.A],()=>p.type===eO.lp.USER&&null!=ev?ea.A.getEffectForUserId(ev):null),eH=(0,c.bG)([em.A],()=>em.A.getVoicePlatformForChannel(S.id,ev??eb.dJq)),eQ=(0,et.UF)({userId:ev,channelId:S.id}),eY=(0,et.DY)({streamKey:p.type===eO.lp.STREAM?p.id:null,channelId:S.id}),eX=s.useMemo(()=>p.type===eO.lp.STREAM?eY??!1:p.type===eO.lp.USER&&(eQ??!1),[eY,eQ,p.type]);s.useEffect(()=>{Z(M)},[M]);let eJ=s.useCallback(()=>{null!=ev&&D.A.toggleLocalMute(ev,eG.x.STREAM)},[ev]),eF=s.useCallback(e=>{g?.(p,e)},[g,p]),eB=s.useCallback(e=>{v?.(p,e)},[v,p]),eq=s.useCallback((e,t,l)=>{j?.(p,e,t,l)},[j,p]),eK=null,eZ=null,e0="";switch(p.type){case eO.lp.STREAM:eK=(0,i.jsx)(eT.A,{participant:p,selected:O,popoutType:x,width:E,fit:V,onVideoResize:C,paused:$}),eZ=(0,i.jsx)(eT.D,{participant:p,selected:O,width:E,focused:M,idle:X,premiumIndicator:!1}),e0=eM.intl.formatToPlainString(eM.t.gHPz3Q,{streamerName:p.user.username});break;case eO.lp.USER:eK=(0,i.jsx)(eS.A,{channel:S,inCall:b,participant:p,popoutType:x,fit:V,onVideoResize:C,paused:$,selected:O,width:E,blocked:U,ignored:P,noVideoRender:G||eR,pulseSpeakingIndicator:W}),eZ=(0,i.jsx)(eS.s,{participant:p,channelId:S.id}),e0=eM.intl.formatToPlainString(eM.t["iC/x/Q"],{username:p.user.username});break;case eO.lp.ACTIVITY:eK=(0,i.jsx)(ey.Ay,{interactible:M,participant:p,selected:O,channel:S,width:E}),e0=eM.intl.formatToPlainString(eM.t.YCvOsO,{activityName:ej?.name});break;case eO.lp.HIDDEN_STREAM:eK=(0,i.jsx)(eT.A,{participant:p,selected:O,width:E,fit:V,onVideoResize:C,paused:$,popoutType:x})}let{ref:e1,width:e2,height:e5}=(0,L.Ay)(),e7=(0,c.bG)([eu.A],()=>p.type===eO.lp.USER?eu.A.getVoiceVolume(p.id):-1/0),e6=(0,Q.v)({isSpeaking:eL,voiceDb:e7,spreadDirection:Q.O.INSET_ONLY,maxInnerSpreadRadius:4}),e8=(0,eO.Ay)(p)?u.k:eV?m.VideoIcon:A.E,e9=p.type===eO.lp.STREAM&&M;return(0,i.jsx)(R.A,{section:eb.JJy.VOICE_CHANNEL_TILE,children:(0,i.jsx)(F.Ay,{streamKey:p.id,enableZoom:e9,children:(0,i.jsx)("div",{className:a()(eU.iE,{[eU.DF]:eP},N),style:T,onMouseEnter:function(){eA(!0)},onMouseLeave:function(){eA(!1)},children:(0,i.jsxs)(K.A,{shakeLocation:e_.uD.VOICE_USER,isShaking:eL,className:eU.Vs,children:[(0,i.jsx)(eN.A,{ref:e1,className:a()(eU.Vs,{[eU.E7]:_,[eU.k_]:null==g,[eU.N7]:X}),noBorder:_,style:f,participantUserId:ev,children:(0,i.jsxs)(h.s,{"aria-label":e0,className:eU.lG,onDoubleClick:eB,onContextMenu:e=>eq(e,p.type===eO.lp.STREAM),onClick:eF,onMouseDown:I,onKeyDown:y,focusProps:{offset:1},children:[null!=eW&&null!=ev?(0,i.jsx)(ed.A,{voiceChannelEffect:eW,onComplete:()=>(0,ea.a)(ev),userId:ev}):null,p.type===eO.lp.USER?(0,i.jsx)("div",{className:eU.nl,children:(0,i.jsx)(z.A,{userId:ev,channelId:S.id,guildId:S.getGuildId(),containerDimensions:{width:e2??0,height:e5??0}})}):null,eK,_?null:(0,i.jsx)("div",{className:eU.hD,children:eZ}),O?(0,i.jsx)("div",{className:eU._Q,children:(0,i.jsx)(e8,{size:"md",color:"currentColor",className:eU.Dt})}):null,eD.includes(p.type)?null:(0,i.jsx)(ek,{focused:M,width:E,inCall:b,participantId:p.id,participantType:p.type,hasVideo:eV??!1,...e$,idle:X,platform:eH,title:(0,eg.A)(S,p),blocked:U,ignored:P,localVideoDisabled:ef,videoToggleState:eE,hideAudioIcon:ez,onContextMenu:eq,onToggleMute:eJ,participantUserId:ev,channel:S,secureFramesVerified:eX,isHovered:ep,popoutType:x,paused:$,controlsBottom:Y,streamId:p.type===eO.lp.STREAM?p.streamId:null}),b&&!_?(0,i.jsx)("div",{className:a()(eU.PQ,{[eU.pU]:!M&&(ew||null!=eW)}),style:M||ew?void 0:e6}):null]})}),ee&&el&&ep&&(0,i.jsx)(eI.A,{currentUserId:eh,participant:p}),(0,i.jsx)(q.A,{isFiring:B,callTileRef:e1})]})})})})});function eL(e){let{participantType:t,platform:l,className:s}=e;if(t===eO.lp.STREAM)return l===eO.J7.XBOX?(0,i.jsx)(ex.A,{className:s}):(0,i.jsx)(u.k,{size:"md",color:"currentColor",className:s});switch(l){case eO.J7.MOBILE:return(0,i.jsx)(x.u,{size:"xs",color:"currentColor",className:s});case eO.J7.XBOX:return(0,i.jsx)(ex.A,{className:s});case eO.J7.PLAYSTATION:return(0,i.jsx)(eh.A,{className:s});case eO.J7.QUEST:return(0,i.jsx)(r.G,{size:"xs",color:"currentColor",className:s});default:return null}}function eP(e){let{icon:t,tooltipText:l,hideWhenInactive:s,idle:n,onClick:d}=e;return(0,i.jsx)(y.m,{text:l,children:(0,i.jsx)("div",{className:a()(eU.V7,{[eU.kl]:s,[eU.N7]:n}),children:(0,i.jsx)(N.K,{size:"sm",variant:"overlay-secondary",onClick:e=>{e.stopPropagation(),d(e)},"aria-label":l,icon:t})})})}function eV(e){let{channelId:t,participantId:l,hideWhenInactive:n,idle:a}=e,d=s.useMemo(()=>(0,W.A)(t,l),[t,l]),r=(0,c.bG)([Z.A],()=>Z.A.getIsAlwaysOnTop(d)),o=s.useCallback(()=>{(0,H.X)(V.A.CALL_TILE_POPOUT,H.O.STAY_ON_TOP,!r),ee.setAlwaysOnTop(d,!r)},[d,r]);return ev.isPlatformEmbedded&&ej.Ay.supportsFeature(eb.BYE.POPOUT_WINDOWS)?(0,i.jsx)(eP,{onClick:o,tooltipText:r?eM.intl.string(eM.t.YdyDM9):eM.intl.string(eM.t.ZVGHwP),icon:r?f.h:T.q,hideWhenInactive:n,idle:a}):null}eR.displayName="CallTile";let ek=s.memo(e=>{let{idle:t,title:l,width:n,focused:r,videoToggleState:u,blocked:m,ignored:A,participantId:h,participantType:x,participantUserId:N,channel:f,platform:T,secureFramesVerified:D,onContextMenu:R,muted:L,deafened:k,localMuted:z,serverMuted:Q,serverDeafened:J,hasVideo:F,hideAudioIcon:q,onToggleMute:K,popoutType:Z,paused:et,controlsBottom:ei,streamId:es}=e,en=(0,c.bG)([er.default],()=>er.default.getId()),ea=(0,c.bG)([ep.A],()=>x===eO.lp.USER&&null!=N?ep.A.getActivities(N).find(P.A)?.application_id:null),ed=(0,el.V)(N),eo=(0,c.bG)([ec.Ay],()=>null!=N&&ec.Ay.isLocalVideoAutoDisabled(N,(0,w.A)(x)),[N,x]),eu=(0,Y.A)({userId:N,guildId:f.getGuildId()}),em=(0,X.a)({displayNameStyles:eu}),eh=(0,eE.Yb)(n),ex=(0,eE.VE)(n),ev=(0,eE.DO)(n),[ej,eg]=s.useState(!1);s.useEffect(()=>{let e=!1;function t(){e!==eA.A.isOpen()&&((e=eA.A.isOpen())||eg(!1))}return eA.A.addChangeListener(t),()=>eA.A.removeChangeListener(t)},[]);let eI=!q&&x===eO.lp.STREAM&&F&&(!ex||z),ey=function(e){let{localMuted:t,serverMuted:l,serverDeafened:i,deafened:s,muted:n}=e;return i?v.T:l?j.O:s?g.c:t?j.O:n?I.z:null}({localMuted:z,serverMuted:Q,serverDeafened:J,deafened:k,muted:L}),eN=(0,C.z)({value:null!=ei?ei:0,config:{...d.config.stiff,clamp:!0}},"animate-always"),eT=[];r&&x===eO.lp.STREAM&&eT.push((0,i.jsx)(B.A,{streamId:es,paused:et},"zoom-controls")),r?Z===$.N.CALL_TILE&&(eT.push((0,i.jsx)(eV,{channelId:f.id,participantId:h,hideWhenInactive:!1,idle:t},"stay-on-top")),eT.push((0,i.jsx)(eP,{onClick:()=>{(0,H.X)(V.A.CALL_TILE_POPOUT,H.O.POPOUT_RETURN),ee.close((0,W.A)(f.id,h))},tooltipText:eM.intl.string(eM.t["7Dwcnj"]),icon:o._,hideWhenInactive:!1,idle:t},"close"))):(ev||x!==eO.lp.USER||null==N||N===en||null==ed||eT.push((0,i.jsx)(ef.M,{userId:N,channel:f,applicationId:ed,hideWhenInactive:!ej,idle:t},"gift")),eT.push((0,i.jsx)(eP,{onClick:function(e){e.stopPropagation(),eg(!0),R(e,!0,eO.GK.THREE_DOT)},tooltipText:eM.intl.string(eM.t["+1H47t"]),icon:b.MoreHorizontalIcon,hideWhenInactive:!ej,idle:t},"options")),eI&&eT.push((0,i.jsx)(eP,{onClick:K,tooltipText:z?eM.intl.string(eM.t.YqAjXy):eM.intl.string(eM.t.w4m945),icon:z?O._:_.H,hideWhenInactive:!z&&!ej,idle:t},"mute")));let eS=[];null!=ey&&x===eO.lp.USER&&eS.push((0,i.jsx)(ey,{className:eU.gr,size:"xs",color:"currentColor"},"sound-icon")),m&&eS.push((0,i.jsx)("div",{className:eU.Z5,children:(0,i.jsx)(G.K,{size:"lg",className:eU.Q6,color:p.A.unsafe_rawColors.RED_400.css})},"blocked-icon")),A&&eS.push((0,i.jsx)("div",{className:eU.PP,children:(0,i.jsx)(M.EyeSlashIcon,{size:"lg",className:eU.Q6})},"ignored-icon")),t||eS.push((0,i.jsx)(eL,{participantType:x,platform:T,className:eU.gr},"title-icon")),null==l||""===l||t||eS.push((0,i.jsx)("span",{className:a()(eU.Wk,em),children:l},"title-text")),D&&eS.push((0,i.jsx)(y.m,{text:eM.intl.string(eM.t.ZEem6O),children:(0,i.jsx)(U.m,{className:eU.vW,size:"xs",color:p.A.colors.TEXT_STRONG,"aria-label":eM.intl.string(eM.t.mR9cf3)})},"secure-frames-icon"));let eC=ed??ea,e_=r&&Z!==$.N.CALL_TILE||t||ev||x!==eO.lp.USER||null==N||null==eC?null:(0,i.jsx)(ef.X,{applicationId:eC,hideApplicationName:ex});return(0,i.jsxs)("div",{className:a()(eU.MU,{[eU.oE]:ex,[eU.Ol]:r}),children:[(0,i.jsx)("div",{className:a()(eU.Ik,{[eU.EX]:n<195}),children:eo||u===eb.bb8.AUTO_PROBING?t?(0,i.jsx)("div",{className:eU.h5,children:(0,i.jsx)(S.O,{size:"md",color:"currentColor"})}):(0,i.jsxs)("div",{className:a()(eU.ns,eU.WP),children:[(0,i.jsx)("div",{className:eU.h5,children:(0,i.jsx)(S.O,{size:"md",color:"currentColor"})}),(0,i.jsx)(E.E,{variant:"text-sm/normal",className:eU.Wk,children:eM.intl.string(eM.t.m2Hyj0)})]}):null}),!eh&&(0,i.jsxs)("div",{className:a()(eU.Qp,{[eU.EX]:n<195}),children:[(0,i.jsxs)("div",{className:eU.qV,children:[eS.length>0&&(0,i.jsx)(E.E,{className:eU.ac,color:"none",variant:ex?"text-sm/normal":"text-md/normal",children:eS}),e_]}),eT.length>0?(0,i.jsx)(d.animated.div,{className:a()(eU._v,{[eU.N7]:t}),style:{marginBottom:eN.value},children:eT}):null]})]})});ek.displayName="CallTileOverlay";let ew=/^(221552|614256)$/.test(l.j)?J.$:null,e$=eR}