functionSoundBox(){this.sounds={},this.load=function(a,b,c){returnthis.sounds[a]=newAudio(b),"function"==typeofc?voidthis.sounds[a].addEventListener("canplaythrough",c):newPromise((d,e)=>{this.sounds[a].addEventListener("canplaythrough",d),this.sounds[a].addEventListener("error",e)})},this.remove=function(a){"undefined"!=typeofthis.sounds&&deletethis.sounds[a],"function"==typeofthis.sound_callbacks&&deletethis.sound_callbacks[a]},this.play=function(a,b){if("undefined"==typeofthis.sounds[a])returnconsole.error("Can't find sound called '"+a+"'."),!1;varc=this.sounds[a].cloneNode(!0);returnc.play(),"function"==typeofb?(c.addEventListener("ended",b),!0):newPromise(d=>c.addEventListener("ended",d))}}SoundBox.version="0.2";