Loading
function(e,t,n){"use strict";var i=n(855986),r=n(439372),a=n(400492),s=n(734057),l=n(754712),o=n(309010),d=n(977997),c=n(63995),u=n(113783),_=n(597886),E=n(446600),A=n(39938);let f=!1,h=(0,a.Qh)("stage_waiting","stage_waiting",l.Ay.getOutputVolume()/400);function I(){let e=o.Ay.getVoiceChannelId();if(null==e){h.stop(),f=!1;return}let t=s.A.getChannel(e);if(!t?.isGuildStageVoice()||l.Ay.isSelfDeaf()){h.stop(),f=!1;return}if(A.A.shouldPlay()){h.volume=l.Ay.getOutputVolume()/400,h.loop(),f=!0;return}if(E.A.isLive(e)){h.stop(),f=!1;return}if(A.A.isMuted()){h.pause(),f=!1;return}let n=null!=Object.values(d.A.getVoiceStatesForChannel(e)).find(e=>!e.suppress&&!e.isVoiceMuted());n||f?n&&(h.pause(),f=!1):(h.volume=l.Ay.getOutputVolume()/400,h.loop(),f=!0)}class p extends r.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=s.A.getChannel(t);e?.isGuildStageVoice()?I():(h.stop(),f=!1)}else h.stop(),f=!1}handleLogout(){h.stop(),f=!1}handlePlay(e){let{play:t}=e;t?I():(h.pause(),f=!1)}handleMute(e){let{muted:t}=e;t?(h.pause(),f=!1):I()}handleVoiceStateUpdates(){I()}handleSetOutputVolume(e){let{volume:t}=e;h.volume=t/400}handleToggleSelfDeaf(){I()}}let m=new p;n.d(t,{},{Ay:m,Zl:function(e){let t=o.Ay.getVoiceChannelId()===e,n=null!=c.A.getMutableParticipants(e,_.ip.SPEAKER).find(e=>!e.voiceState.isVoiceMuted()),i=E.A.getStageInstanceByChannel(e);return t&&null==i&&!n},bF:function(e){let t=(0,i.bG)([o.Ay],()=>o.Ay.getVoiceChannelId()===e),n=null!=(0,u.E5)(e,_.ip.SPEAKER).find(e=>!e.voiceState.isVoiceMuted()),r=(0,i.bG)([E.A],()=>E.A.getStageInstanceByChannel(e));return t&&null==r&&!n}})}