import{h}from"@stencil/core";export class PrestoActionBar{componentWillLoad(){this.player&&(this.player.on("ended",()=>this.setEnded()),this.player.on("timeupdate",e=>this.setCurrentTime(e)))}handlePlayerChange(){this.player&&(this.player.on("ended",()=>this.setEnded()),this.player.on("timeupdate",e=>this.setCurrentTime(e)))}setEnded(){this.ended=!0}setCurrentTime(e){var t,r;this.currentTime=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.plyr.currentTime,this.duration=null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.plyr.duration}disconnectedCallback(){this.player&&(this.player.off("ended",this.setEnded),this.player.off("timeupdate",this.setCurrentTime))}render(){return h("presto-action-bar-controller",{key:"b3e5ee805698aa3db15cd161ead5687cdc8dd527",ended:this.ended,config:this.config,currentTime:this.currentTime,duration:this.duration,direction:this.direction,youtube:this.youtube})}static get is(){return"presto-action-bar"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["presto-action-bar.scss"]}}static get styleUrls(){return{$:["presto-action-bar.css"]}}static get properties(){return{player:{type:"any",attribute:"player",mutable:!1,complexType:{original:"any",resolved:"any",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1},config:{type:"unknown",attribute:"config",mutable:!1,complexType:{original:"ActionBarConfig",resolved:"ActionBarConfig",references:{ActionBarConfig:{location:"import",path:"../../../../../interfaces",id:"src/interfaces.ts::ActionBarConfig"}}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1},direction:{type:"string",attribute:"direction",mutable:!1,complexType:{original:"'rtl'",resolved:'"rtl"',references:{}},required:!1,optional:!0,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1},youtube:{type:"unknown",attribute:"youtube",mutable:!1,complexType:{original:"YoutubeConfig",resolved:"YoutubeConfig",references:{YoutubeConfig:{location:"import",path:"../../../../../interfaces",id:"src/interfaces.ts::YoutubeConfig"}}},required:!1,optional:!0,docs:{tags:[],text:""},getter:!1,setter:!1}}}static get states(){return{currentTime:{},duration:{},ended:{}}}static get elementRef(){return"el"}static get watchers(){return[{propName:"player",methodName:"handlePlayerChange"}]}}