1import{r as z,P as s}from"./react.01-10--15-59-26.RXCSs4lJ.js";import{f as ne,c0 as n,c1 as r,c2 as re,c3 as le,s as t,c4 as se}from"./redux.01-10--15-59-26.CJsG_uGv.js";import{h as x}from"./howler.01-10--15-59-26.Ld5pASKc.js";import{d as ce,c as de,i as ae}from"./daily_double.01-10--15-59-26.Bc9GBKUG.js";import"./utils.01-10--15-59-26.CMspICcW.js";import"./bootstrapEtc.01-10--15-59-26.TDRmwVjv.js";const fe=["/join","/joinresumegame","/remoteview","/viewanswers","/leaderboard","/teams"].includes(window.location.pathname.toLowerCase().trim()),pe=se()==="viewanswers",me=se()==="leaderboard";let O=!1,y=!1,w=!1,e=null;function Q({themeMusic:o,volumeLevel:i,timerMusic:A,stopTimer:m,scoringMusic:a,ddMusicEffect:S,isDailyDouble:b,isFFQuestion:T,isQuestion:f,readingTimerOnOff:h,themeMusicOnConnectedDevices:M,startMusicAfterReadingTime:D,questionTime:H,readingTime:C,isGamePaused:q,onTimeExpire:L,buzz:V,playerBuzzedinOrAnswered:R,questionTimeUp:B,customizations:g}){const[ue,v]=z.useState(new Date().getTime());return z.useEffect(()=>{let l=.5;i===1&&(l=.1),i===3&&(l=1);const d=new x.Howl({src:[o||"https://factile-static.s3.amazonaws.com/Jeopardy-theme-song.mp3"],preload:!0,loop:!0,volume:l}),c=new x.Howl({src:[ce],preload:!0,volume:l,onend:()=>{v(new Date().getTime())}}),E=new x.Howl({src:[de],volume:l}),F=new x.Howl({src:[ae],volume:l}),U=()=>{d.playing()||(d.play(),e="themeMusic")},G=()=>{d.stop(),e=null},j=()=>{c.playing()||(c.play(),t.stopAllFileAudio(),t.stopVideo(),t.stopTextToSpeech(),e="dailyDoubleMusic")},W=()=>{a&&E.play()},k=()=>{a&&F.play()},J=()=>{},$=({detail:u})=>{u!=null&&u.isHardStop&&(y=!0),d.stop(),c.stop(),e=null},I=({detail:u})=>{if(e==="dailyDoubleMusic"&&(u!=null&&u.isAutoPlay)){t.stopAllFileAudio(),e="dailyDoubleMusic";return}t.stopAllFileAudio({url:u.url}),t.stopVideo(),t.stopTextToSpeech(),t.stopMusicSounds(),e="fileAudio"},K=()=>{e==="video"||e==="textToSpeech"||(e=null,v(new Date().getTime()))},N=()=>{t.stopMusicSounds(),t.stopAllFileAudio(),t.stopTextToSpeech(),e="video"},X=()=>{e==="fileAudio"||e==="textToSpeech"||(e=null,v(new Date().getTime()))},Y=({detail:u})=>{if(e==="dailyDoubleMusic"&&(u!=null&&u.isAutoPlay)){setTimeout(()=>{var p;(p=window.responsiveVoice)==null||p.cancel()},20);return}t.stopMusicSounds(),t.stopVideo(),t.stopAllFileAudio(),e="textToSpeech"},Z=()=>{e==="fileAudio"||e==="video"||(e=null,v(new Date().getTime()))},_=()=>{d.mute(!0),c.mute(!0),w=!0},P=()=>{d.mute(!1),c.mute(!1),w=!1},ee=({detail:u})=>{const p=document.querySelectorAll("#loadAudio");p&&p.length>0&&p.forEach(ie=>{u!=null&&u.url&&ie.getAttribute("data-url")===u.url||(ie.pause(),e=null)})},oe=()=>{var u;(u=window.responsiveVoice)==null||u.cancel(),e=null},te=()=>{t.stopMusicSounds(),t.stopVideo(),t.stopAllFileAudio(),t.stopTextToSpeech(),e=null};return w&&(d.mute(!0),c.mute(!0)),n("themeMusicStart",U),n("themeMusicStop",G),n("dailyDoubleMusicStart",j),n("playCorrectSound",W),n("playWrongSound",k),n("stopMusicSounds",$),n("beepTimerEndSound",J),n("fileAudioStart",I),n("fileAudioEnded",K),n("videoStart",N),n("videoEnded",X),n("textToSpeechStart",Y),n("textToSpeechEnded",Z),n("muteMusicSounds",_),n("unmuteMusicSounds",P),n("stopAllFileAudio",ee),n("stopTextToSpeech",oe),n("stopAllSounds",te),()=>{d.off(),d.unload(),c.off(),c.unload(),E.off(),E.unload(),F.off(),F.unload(),r("themeMusicStart",U),r("themeMusicStop",G),r("dailyDoubleMusicStart",j),r("playCorrectSound",W),r("playWrongSound",k),r("stopMusicSounds",$),r("beepTimerEndSound",J),r("fileAudioStart",I),r("fileAudioEnded",K),r("videoStart",N),r("videoEnded",X),r("textToSpeechStart",Y),r("textToSpeechEnded",Z),r("muteMusicSounds",_),r("unmuteMusicSounds",P),r("stopAllFileAudio",ee),r("stopTextToSpeech",oe),r("stopAllSounds",te)}},[o,a]),z.useEffect(()=>{O=!1,y=!1},[H]),z.useEffect(()=>{let l=H&&f&&!m&&!L&&!V&&!R&&!B&&!y;(pe||me)&&(l=!1),fe&&(l=l&&M);const d=l&&b&&S&&!O;d||(l=l&&!q),h&&D&&(l=l&&!C);let c=l&&e!=="fileAudio"&&e!=="video";T||(c=c&&re(g)),T&&!le(g)&&(c=!1),d?(setTimeout(()=>{O=!0},2e3),t.dailyDoubleMusicStart()):e==="fileAudio"||e==="video"||e==="textToSpeech"?()=>{}:l?f?c?t.themeMusicStart():t.stopAllSounds():t.stopAllSounds():t.stopMusicSounds()},[A,g,m,S,a,H,C,q,M,f,L,V,R,B,ue]),null}Q.propTypes={themeMusic:s.string,volumeLevel:s.number,timerMusic:s.oneOf(["all","regular","ff","off"]),stopTimer:s.bool,scoringMusic:s.bool,ddMusicEffect:s.bool,isDailyDouble:s.bool,isFFQuestion:s.bool,isQuestion:s.bool,readingTimerOnOff:s.bool,startMusicAfterReadingTime:s.bool,questionTime:s.bool,readingTime:s.bool,isGamePaused:s.bool,themeMusicOnConnectedDevices:s.bool,onTimeExpire:s.bool,buzz:s.bool,playerBuzzedinOrAnswered:s.bool,questionTimeUp:s.bool,customizations:s.shape({timerMusic:s.oneOf(["all","regular","ff","off"])})};Q.defaultProps={themeMusic:"",volumeLevel:.5,timerMusic:"all",stopTimer:!1,scoringMusic:!1,ddMusicEffect:!1,isDailyDouble:!1,isFFQuestion:!1,isQuestion:!1,readingTimerOnOff:!1,startMusicAfterReadingTime:!1,questionTime:!1,readingTime:!1,isGamePaused:!1,themeMusicOnConnectedDevices:!1,onTimeExpire:!1,buzz:!1,playerBuzzedinOrAnswered:!1,questionTimeUp:!1,customizations:{}};const Se=({gamePlay:o={}},i)=>{var A,m,a,S,b,T,f,h,M,D;return{themeMusic:i.themeMusic||((A=o.customizations)==null?void 0:A.activeThinkingMusic),readingTimerOnOff:i.readingTimerOnOff||((m=o.customizations)==null?void 0:m.readingTimerOnOff),volumeLevel:i.volumeLevel||((a=o.customizations)==null?void 0:a.volumeLevel),timerMusic:i.timerMusic||((S=o.customizations)==null?void 0:S.timerMusic)||"all",customizations:o.customizations||{},stopTimer:i.stopTimer||o.stopTimer,startMusicAfterReadingTime:i.startMusicAfterReadingTime||((b=o.customizations)==null?void 0:b.startMusicAfterReadingTime),scoringMusic:i.scoringMusic||((T=o.customizations)==null?void 0:T.scoringMusic),questionTime:i.questionTime||o.questionTime,readingTime:i.readingTime||o.readingTime,isGamePaused:i.scoringMusic||o.isGamePaused,ddMusicEffect:i.ddMusicEffect||((f=o.customizations)==null?void 0:f.ddMusicEffect),isDailyDouble:i.isDailyDouble||((h=o.currentQuestion)==null?void 0:h.isDailyDouble),isFFQuestion:i.isFFQuestion||((M=o.currentQuestion)==null?void 0:M.isFFQuestion),isQuestion:i.isQuestion||o.gameMode==="memory"?!!o.currentQuestion&&!o.secondCardData:!!o.currentQuestion,themeMusicOnConnectedDevices:i.themeMusicOnConnectedDevices||((D=o.customizations)==null?void 0:D.remoteScoringMusicForChoice),onTimeExpire:i.onTimeExpire||o.onTimeExpire,buzz:i.buzz||o.buzz,playerBuzzedinOrAnswered:i.playerBuzzedinOrAnswered||o.playerBuzzedinOrAnswered,questionTimeUp:i.questionTimeUp||o.questionTimeUp}},ve=ne(Se)(Q);export{ve as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.