Module 763793

3,930 characters · in aca7018765200529.js
Dependencies
Source Raw
function(e,t,n){n.d(t,{A:()=>w,i:()=>G});var i=n(627968),l=n(64700),s=n(284009),a=n.n(s),r=n(110259),o=n(311907),d=n(397927),c=n(367513),u=n(442433),h=n(401843),A=n(793574),_=n(688810),m=n(139286),p=n(313961),g=n(480890),f=n(643501),E=n(652896),x=n(279250),I=n(267102),C=n(401901),N=n(326567),T=n(342296),S=n(616356),b=n(961350),y=n(71393),v=n(576705),R=n(977997),j=n(312006),O=n(704384),L=n(289105),M=n(652215),D=n(806931),U=n(578758);let G=16/9,P=e=>{let{stageParticipant:t,rtcParticipant:n,channel:s,guildId:a,user:r,width:o,isModerator:c,onContextMenu:u,popoutType:h}=e,A=l.useRef(null),{reducedMotion:_}=l.useContext(d.CZY),{blocked:m,ignored:p,id:g}=t;return(0,i.jsx)(T.A,{targetElementRef:A,user:r,guildId:a,channelId:s.id,clickTrap:!0,children:e=>(0,i.jsx)(d.DUT,{innerRef:A,onContextMenu:e=>u(n,e),...e,children:(0,i.jsx)(O.A,{participant:n,aspectRatio:G,blocked:m,ignored:p,channel:s,className:U.V,inCall:!0,popoutType:h,pulseSpeakingIndicator:!_.enabled,width:o,onContextMenu:u,children:c&&(0,i.jsx)(L.A,{})},g)})})},k=e=>{let{stageParticipant:t,rtcParticipant:n,channel:s,width:a,isModerator:r,onContextMenu:u,popoutType:A}=e,{reducedMotion:_}=l.useContext(d.CZY),{id:m,blocked:g,ignored:I}=t,N=(0,o.yK)([S.A],()=>S.A.getAllActiveStreams(),[]),{selectedParticipant:T,largeStream:b}=(0,o.cf)([p.A],()=>({selectedParticipant:null!=s?p.A.getSelectedParticipant(s.id):null,largeStream:null!=s&&p.A.getStageStreamSize(s.id)})),j=l.useCallback((e,t)=>{if(e.type===D.lp.STREAM&&0===N.filter(t=>(0,E._z)(t)===e.id&&t.state!==M.XYD.ENDED).length){if(!(0,x.eo)(s,R.A,y.A,v.A,f.default)[0])return;(0,h.A9)((0,E.Iy)(e.id),{forceMultiple:t.shiftKey})}T?.id===e.id?b?(c.A.selectParticipant(s.id,null),c.A.updateStageStreamSize(s.id,!1)):c.A.updateStageStreamSize(s.id,!0):(c.A.updateStageStreamSize(s.id,!1),c.A.selectParticipant(s.id,e.id))},[N,s,T,b]);return(0,i.jsx)(O.A,{participant:n,aspectRatio:G,fit:n.type===D.lp.USER?C.$.COVER:void 0,blocked:g,ignored:I,channel:s,className:U.V,inCall:!0,popoutType:A,onClick:j,onContextMenu:u,pulseSpeakingIndicator:!_.enabled,width:a,children:r&&n.type===D.lp.USER&&(0,i.jsx)(L.A,{})},m)},w=l.memo(function(e){let{participant:t,channel:l,width:s,popoutType:d}=e,{newestAnalyticsLocation:c}=(0,_.Ay)(A.A.STAGE_TILE),h=(0,I.Us)(),f=l.getGuildId(),E=b.default.getId();a()(null!=f,"Channel cannot be guildless");let{user:x}=t,C=(0,o.bG)([p.A],()=>p.A.getParticipant(l.id,t.id),[l.id,t.id]),T=(0,o.bG)([j.Ay],()=>j.Ay.isModerator(x.id,l.id),[l.id,x.id]);if(null==C||C.type===D.lp.ACTIVITY)return null;let S=e=>{(0,m.x)({type:r.ImpressionTypes.MENU,name:r.ImpressionNames.CALL_TILE_CONTEXT_MENU,properties:{location:"StageTile",is_tile_owner:x.id===E,tile_type:e}})},y=(e,t,s,a)=>{switch(e.type){case D.lp.HIDDEN_STREAM:case D.lp.STREAM:S(D.qs.STREAM),(0,u.L3)(t,async()=>{let{default:t}=await n.e("66692").then(n.bind(n,796175));return n=>(0,i.jsx)(t,{...n,stream:e.stream,appContext:h,exitFullscreen:()=>{},onInteraction:(0,g.s)("StreamContextMenu",c,{entrypoint:a,targetUserId:x.id,tileType:D.qs.STREAM})})},{context:h});return;case D.lp.USER:default:if(S(D.qs.USER),s)return(0,N.r)(t,x,l,{context:h},(e,t)=>(0,g.Y)({menuName:e,menuItemProps:t,entrypoint:D.GK.THREE_DOT,targetUserId:x.id,location:c,tileType:D.qs.USER}));(0,u.L3)(t,async()=>{let{default:e}=await Promise.all([n.e("97262"),n.e("42128"),n.e("84841"),n.e("79842")]).then(n.bind(n,107632));return t=>(0,i.jsx)(e,{...t,user:x,guildId:f,channel:l,showMediaItems:!0,showStageChannelItems:!0,showChatItems:!1,onInteraction:(0,g.s)("GuildChannelUserContextMenu",c,{targetUserId:x.id,tileType:D.qs.USER})})},{context:h})}};return C.type!==D.lp.USER||C.voiceState?.selfVideo?(0,i.jsx)(k,{stageParticipant:t,rtcParticipant:C,channel:l,guildId:f,user:x,width:s,isModerator:T,onContextMenu:y,popoutType:d}):(0,i.jsx)(P,{stageParticipant:t,rtcParticipant:C,channel:l,guildId:f,user:x,width:s,isModerator:T,onContextMenu:y,popoutType:d})})}