Module 30108

1,932 characters · in no known chunk
Dependencies
Required by (3)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{Ay:()=>S,Zl:()=>I,bF:()=>A});var r=n(311907),i=n(439372),s=n(400492),a=n(734057),o=n(430452),l=n(309010),u=n(977997),c=n(63995),d=n(113783),_=n(69407),f=n(446600),p=n(39938);let h=e=>e/400,m=!1,E=(0,s.Qh)("stage_waiting","stage_waiting",h(o.Ay.getOutputVolume()));function g(){let e=l.A.getVoiceChannelId();if(null==e){E.stop(),m=!1;return}let t=a.A.getChannel(e);if(!t?.isGuildStageVoice()||o.Ay.isSelfDeaf()){E.stop(),m=!1;return}if(p.A.shouldPlay()){E.volume=h(o.Ay.getOutputVolume()),E.loop(),m=!0;return}if(f.A.isLive(e)){E.stop(),m=!1;return}if(p.A.isMuted()){E.pause(),m=!1;return}let n=null!=Object.values(u.A.getVoiceStatesForChannel(e)).find(e=>!e.suppress&&!e.isVoiceMuted());n||m?n&&(E.pause(),m=!1):(E.volume=h(o.Ay.getOutputVolume()),E.loop(),m=!0)}function A(e){let t=(0,r.bG)([l.A],()=>l.A.getVoiceChannelId()===e),n=null!=(0,d.E5)(e,_.ip.SPEAKER).find(e=>!e.voiceState.isVoiceMuted()),i=(0,r.bG)([f.A],()=>f.A.getStageInstanceByChannel(e));return t&&null==i&&!n}function I(e){let t=l.A.getVoiceChannelId()===e,n=null!=c.A.getMutableParticipants(e,_.ip.SPEAKER).find(e=>!e.voiceState.isVoiceMuted()),r=f.A.getStageInstanceByChannel(e);return t&&null==r&&!n}class T extends i.A{actions={VOICE_CHANNEL_SELECT:this.handleVoiceChannelSelect,LOGOUT:this.handleLogout,STAGE_MUSIC_MUTE:this.handleMute,STAGE_MUSIC_PLAY:this.handlePlay,VOICE_STATE_UPDATES:this.handleVoiceStateUpdates,AUDIO_SET_OUTPUT_VOLUME:this.handleSetOutputVolume,AUDIO_TOGGLE_SELF_DEAF:this.handleToggleSelfDeaf};handleVoiceChannelSelect(e){let{channelId:t}=e;if(null!=t){let e=a.A.getChannel(t);e?.isGuildStageVoice()?g():(E.stop(),m=!1)}else E.stop(),m=!1}handleLogout(){E.stop(),m=!1}handlePlay(e){let{play:t}=e;t?g():(E.pause(),m=!1)}handleMute(e){let{muted:t}=e;t?(E.pause(),m=!1):g()}handleVoiceStateUpdates(){g()}handleSetOutputVolume(e){let{volume:t}=e;E.volume=h(t)}handleToggleSelfDeaf(){g()}}let S=new T}