var vid,videobox={rewind:function(){},create:function(i,{centerX:t,centerY:e,path:o,callback:s={before:null,after:null},loop:n=!1}){this.callbacks=s,this.callbacks.before(),this.container=i.add.container(0,0),this.videoGroup=i.add.group(),this.isOpen=!0,this.vid,this.bgBox=i.add.graphics(),this.bgBox.fillStyle(0,1),this.bgBox.fillRoundedRect(0,0,i.game.config.width,i.game.config.height,0),this.bgBox.alpha=0,i.tweens.add({targets:this.bgBox,alpha:.8,ease:"Sine.InOut",duration:500}),this.closeOnClickZone=i.add.zone(0,0,i.game.config.width,i.game.config.height).setOrigin(0).setInteractive().on("pointerdown",(()=>{})),this.skipBtn=i.add.sprite(i.game.config.width-150,i.game.config.height-80,"SkipButton").on("pointerdown",(()=>{this.vid.destroy(),this.skipBtn.destroy(),this.bgBox.destroy(),this.closeOnClickZone.destroy(),this.runCallback(i)})).on("pointerover",(()=>{})).on("pointerout",(()=>{})).setInteractive({useHandCursor:!0}).setOrigin(.5),this.skipBtn.setVisible(!1),i.cache.video.remove("vid"),i.load.video("vid",o),i.load.once(Phaser.Loader.Events.COMPLETE,(()=>{1==this.isOpen&&(this.vid=i.add.video(0,0,"vid"),this.vid.setOrigin(0),this.vid.removeVideoElementOnDestroy=!0,this.vid.name="video",this.vid.play(n),this.vid.on("unlocked",(function(i){log("VID unlocked!",i)}),this),this.vid.on("stop",(function(i){log("VID stop!",i)}),this),this.vid.on("play",(function(i){log("VID START!",i),this.skipBtn.setVisible(!0)}),this),n||this.vid.on("complete",(function(t){log("VID complete!",t),this.vid.destroy(),this.skipBtn.destroy(),this.bgBox.destroy(),this.closeOnClickZone.destroy(),this.runCallback(i)}),this),this.videoGroup.addMultiple([this.vid]),this.videoGroup.setVisible(!0),this.bgBox.setDepth(1),this.vid.setDepth(9),this.skipBtn.setDepth(10))}),this),i.load.start()},runCallback:function(i){this.callbacks.after()},destroyMe:function(i,t){var e=i;"vid"==t&&e.vid&&(e.vid.setCurrentTime(0),e.vid.stop(),e.vid.destroy(),e.vid.name=""),e.popBox.destroy(),e.titleText.destroy(),e.closeOnClickZone.destroy(),e.bgBox.destroy(),e.isOpen=!1}};
//# sourceMappingURL=index.40c6a0e9.js.map
