text: !function(){"use strict";var _super;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(pan){var self=this;if(!this.ctx||!this.ctx.listener)return this;for(var i=this._howls.length-1;i>=0;i--)this._howls[i].stereo(pan);return this},HowlerGlobal.prototype.pos=function(x,y,z){var self=this;return this.ctx&&this.ctx.listener?(y="number"!=typeof y?this._pos[1]:y,z="number"!=typeof z?this._pos[2]:z,"number"!=typeof x?this._pos:(this._pos=[x,y,z],void 0!==this.ctx.listener.positionX?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(x,y,z,xUp,yUp,zUp){var self=this;if(!this.ctx||!this.ctx.listener)return this;var or=this._orientation;return y="number"!=typeof y?or[1]:y,z="number"!=typeof z?or[2]:z,xUp="number"!=typeof xUp?or[3]:xUp,yUp="number"!=typeof yUp?or[4]:yUp,zUp="number"!=typeof zUp?or[5]:zUp,"number"!=typeof x?or:(this._orientation=[x,y,z,xUp,yUp,zUp],void 0!==this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(x,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(y,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(z,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(x,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(y,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(z,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(x,y,z,xUp,yUp,zUp),this)},Howl.prototype.init=(_super=Howl.prototype.init,function(o){var self=this;return this._orientation=o.orientation||[1,0,0],this._stereo=o.stereo||null,this._pos=o.pos||null,this._pannerAttr={coneInnerAngle:void 0!==o.coneInnerAngle?o.coneInnerAngle:360,coneOuterAngle:void 0!==o.coneOuterAngle?o.coneOuterAngle:360,coneOuterGain:void 0!==o.coneOuterGain?o.coneOuterGain:0,distanceModel:void 0!==o.distanceModel?o.distanceModel:"inverse",maxDistance:void 0!==o.maxDistance?o.maxDistance:1e4,panningModel:void 0!==o.panningModel?o.panningModel:"HRTF",refDistance:void 0!==o.refDistance?o.refDistance:1,rolloffFactor:void 0!==o.rolloffFactor?o.rolloffFactor:1},this._onstereo=o.onstereo?[{fn:o.onstereo}]:[],this._onpos=o.onpos?[{fn:o.onpos}]:[],this._onorientation=o.onorientation?[{fn:o.onorientation}]:[],_super.call(this,o)}),Howl.prototype.stereo=function(pan,id){var self=this;if(!self._webAudio)return self;if("loaded"!==self._state)return self._queue.push({event:"stereo",action:function(){self.stereo(pan,id)}}),self;var pannerType=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===id){if("number"!=typeof pan)return self._stereo;self._stereo=pan,self._pos=[pan,0,0]}for(var ids=self._getSoundIds(id),i=0;i<ids.length;i++){var sound=self._soundById(ids[i]);if(sound){if("number"!=typeof pan)return sound._stereo;sound._stereo=pan,sound._pos=[pan,0,0],sound._node&&(sound._pannerAttr.panningModel="equalpower",sound._panner&&sound._panner.pan||setupPanner(sound,pannerType),"spatial"===pannerType?void 0!==sound._panner.positionX?(sound._panner.positionX.setValueAtTime(pan,Howler.ctx.currentTime),sound._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),sound._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):sound._panner.setPosition(pan,0,0):sound._panner.pan.setValueAtTime(pan,Howler.ctx.currentTime)),self._emit("stereo",sound._id)}}return self},Howl.prototype.pos=function(x,y,z,id){var self=this;if(!self._webAudio)return self;if("loaded"!==self._state)return self._queue.push({event:"pos",action:function(){self.pos(x,y,z,id)}}),self;if(y="number"!=typeof y?0:y,z="number"!=typeof z?-.5:z,void 0===id){if("number"!=typeof x)return self._pos;self._pos=[x,y,z]}for(var ids=self._getSoundIds(id),i=0;i<ids.length;i++){var sound=self._soundById(ids[i]);if(sound){if("number"!=typeof x)return sound._pos;sound._pos=[x,y,z],sound._node&&(sound._panner&&!sound._panner.pan||setupPanner(sound,"spatial"),void 0!==sound._panner.positionX?(sound._panner.positionX.setValueAtTime(x,Howler.ctx.currentTime),sound._panner.positionY.setValueAtTime(y,Howler.ctx.currentTime),sound._panner.positionZ.setValueAtTime(z,Howler.ctx.currentTime)):sound._panner.setPosition(x,y,z)),self._emit("pos",sound._id)}}return self},Howl.prototype.orientation=function(x,y,z,id){var self=this;if(!self._webAudio)return self;if("loaded"!==self._state)return self._queue.push({event:"orientation",action:function(){self.orientation(x,y,z,id)}}),self;if(y="number"!=typeof y?self._orientation[1]:y,z="number"!=typeof z?self._orientation[2]:z,void 0===id){if("number"!=typeof x)return self._orientation;self._orientation=[x,y,z]}for(var ids=self._getSoundIds(id),i=0;i<ids.length;i++){var sound=self._soundById(ids[i]);if(sound){if("number"!=typeof x)return sound._orientation;sound._orientation=[x,y,z],sound._node&&(sound._panner||(sound._pos||(sound._pos=self._pos||[0,0,-.5]),setupPanner(sound,"spatial")),void 0!==sound._panner.orientationX?(sound._panner.orientationX.setValueAtTime(x,Howler.ctx.currentTime),sound._panner.orientationY.setValueAtTime(y,Howler.ctx.currentTime),sound._panner.orientationZ.setValueAtTime(z,Howler.ctx.currentTime)):sound._panner.setOrientation(x,y,z)),self._emit("orientation",sound._id)}}return self},Howl.prototype.pannerAttr=function(){var self=this,args=arguments,o,id,sound;if(!this._webAudio)return this;if(0===args.length)return this._pannerAttr;if(1===args.length){if("object"!=typeof args[0])return(sound=this._soundById(parseInt(args[0],10)))?sound._pannerAttr:this._pannerAttr;o=args[0],void 0===id&&(o.pannerAttr||(o.pannerAttr={coneInnerAngle:o.coneInnerAngle,coneOuterAngle:o.coneOuterAngle,coneOuterGain:o.coneOuterGain,distanceModel:o.distanceModel,maxDistance:o.maxDistance,refDistance:o.refDistance,rolloffFactor:o.rolloffFactor,panningModel:o.panningModel}),this._pannerAttr={coneInnerAngle:void 0!==o.pannerAttr.coneInnerAngle?o.pannerAttr.coneInnerAngle:this._coneInnerAngle,coneOuterAngle:void 0!==o.pannerAttr.coneOuterAngle?o.pannerAttr.coneOuterAngle:this._coneOuterAngle,coneOuterGain:void 0!==o.pannerAttr.coneOuterGain?o.pannerAttr.coneOuterGain:this._coneOuterGain,distanceModel:void 0!==o.pannerAttr.distanceModel?o.pannerAttr.distanceModel:this._distanceModel,maxDistance:void 0!==o.pannerAttr.maxDistance?o.pannerAttr.maxDistance:this._maxDistance,refDistance:void 0!==o.pannerAttr.refDistance?o.pannerAttr.refDistance:this._refDistance,rolloffFactor:void 0!==o.pannerAttr.rolloffFactor?o.pannerAttr.rolloffFactor:this._rolloffFactor,panningModel:void 0!==o.pannerAttr.panningModel?o.pannerAttr.panningModel:this._panningModel})}else 2===args.length&&(o=args[0],id=parseInt(args[1],10));for(var ids=this._getSoundIds(id),i=0;i<ids.length;i++)if(sound=this._soundById(ids[i])){var pa=sound._pannerAttr;pa={coneInnerAngle:void 0!==o.coneInnerAngle?o.coneInnerAngle:pa.coneInnerAngle,coneOuterAngle:void 0!==o.coneOuterAngle?o.coneOuterAngle:pa.coneOuterAngle,coneOuterGain:void 0!==o.coneOuterGain?o.coneOuterGain:pa.coneOuterGain,distanceModel:void 0!==o.distanceModel?o.distanceModel:pa.distanceModel,maxDistance:void 0!==o.maxDistance?o.maxDistance:pa.maxDistance,refDistance:void 0!==o.refDistance?o.refDistance:pa.refDistance,rolloffFactor:void 0!==o.rolloffFactor?o.rolloffFactor:pa.rolloffFactor,panningModel:void 0!==o.panningModel?o.panningModel:pa.panningModel};var panner=sound._panner;panner?(panner.coneInnerAngle=pa.coneInnerAngle,panner.coneOuterAngle=pa.coneOuterAngle,panner.coneOuterGain=pa.coneOuterGain,panner.distanceModel=pa.distanceModel,panner.maxDistance=pa.maxDistance,panner.refDistance=pa.refDistance,panner.rolloffFactor=pa.rolloffFactor,panner.panningModel=pa.panningModel):(sound._pos||(sound._pos=this._pos||[0,0,-.5]),setupPanner(sound,"spatial"))}return this},Sound.prototype.init=function(_super){return function(){var self=this,parent=this._parent;this._orientation=parent._orientation,this._stereo=parent._stereo,this._pos=parent._pos,this._pannerAttr=parent._pannerAttr,_super.call(this),this._stereo?parent.stereo(this._stereo):this._pos&&parent.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(_super){return function(){var self=this,parent=this._parent;return this._orientation=parent._orientation,this._stereo=parent._stereo,this._pos=parent._pos,this._pannerAttr=parent._pannerAttr,this._stereo?parent.stereo(this._stereo):this._pos?parent.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,parent._refreshBuffer(this)),_super.call(this)}}(Sound.prototype.reset);var setupPanner=function(sound,type){"spatial"===(type=type||"spatial")?(sound._panner=Howler.ctx.createPanner(),sound._panner.coneInnerAngle=sound._pannerAttr.coneInnerAngle,sound._panner.coneOuterAngle=sound._pannerAttr.coneOuterAngle,sound._panner.coneOuterGain=sound._pannerAttr.coneOuterGain,sound._panner.distanceModel=sound._pannerAttr.distanceModel,sound._panner.maxDistance=sound._pannerAttr.maxDistance,sound._panner.refDistance=sound._pannerAttr.refDistance,sound._panner.rolloffFactor=sound._pannerAttr.rolloffFactor,sound._panner.panningModel=sound._pannerAttr.panningModel,void 0!==sound._panner.positionX?(sound._panner.positionX.setValueAtTime(sound._pos[0],Howler.ctx.currentTime),sound._panner.positionY.setValueAtTime(sound._pos[1],Howler.ctx.currentTime),sound._panner.positionZ.setValueAtTime(sound._pos[2],Howler.ctx.currentTime)):sound._panner.setPosition(sound._pos[0],sound._pos[1],sound._pos[2]),void 0!==sound._panner.orientationX?(sound._panner.orientationX.setValueAtTime(sound._orientation[0],Howler.ctx.currentTime),sound._panner.orientationY.setValueAtTime(sound._orientation[1],Howler.ctx.currentTime),sound._panner.orientationZ.setValueAtTime(sound._orientation[2],Howler.ctx.currentTime)):sound._panner.setOrientation(sound._orientation[0],sound._orientation[1],sound._orientation[2])):(sound._panner=Howler.ctx.createStereoPanner(),sound._panner.pan.setValueAtTime(sound._stereo,Howler.ctx.currentTime)),sound._panner.connect(sound._node),sound._paused||sound._parent.pause(sound._id,!0).play(sound._id,!0)}}();