import{h}from"@stencil/core";export class PrestoCTAOverlay{constructor(){this.player=void 0,this.direction=void 0,this.preset=void 0,this.i18n=void 0,this.provider=void 0,this.currentTime=void 0,this.duration=void 0,this.ended=void 0}componentWillLoad(){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(){var e;return h("presto-cta-overlay-controller",{key:"8ee64dc818a0256e6674c9c2b0f33916374c89fa",ended:this.ended,currentTime:this.currentTime,duration:this.duration,direction:this.direction,cta:null===(e=this.preset)||void 0===e?void 0:e.cta,i18n:this.i18n,provider:this.provider})}static get is(){return"presto-cta-overlay"}static get originalStyleUrls(){return{$:["presto-cta-overlay.css"]}}static get styleUrls(){return{$:["presto-cta-overlay.css"]}}static get properties(){return{player:{type:"any",mutable:!1,complexType:{original:"any",resolved:"any",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"player",reflect:!1},direction:{type:"string",mutable:!1,complexType:{original:"'rtl'",resolved:'"rtl"',references:{}},required:!1,optional:!0,docs:{tags:[],text:""},attribute:"direction",reflect:!1},preset:{type:"unknown",mutable:!1,complexType:{original:"presetAttributes",resolved:"presetAttributes",references:{presetAttributes:{location:"import",path:"../../../../../interfaces",id:"src/interfaces.ts::presetAttributes"}}},required:!1,optional:!1,docs:{tags:[],text:""}},i18n:{type:"unknown",mutable:!1,complexType:{original:"i18nConfig",resolved:"i18nConfig",references:{i18nConfig:{location:"import",path:"../../../../../interfaces",id:"src/interfaces.ts::i18nConfig"}}},required:!1,optional:!1,docs:{tags:[],text:""}},provider:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"provider",reflect:!1}}}static get states(){return{currentTime:{},duration:{},ended:{}}}}