import{h}from"@stencil/core";import fitText from"../../../../../library/fittext.js";export class EmailOverlayUI{handleSubmit(e){this.submitForm.emit({email:this.email}),e.preventDefault()}componentDidLoad(){let e=this.type||this.provider;this.isAudioProvider="audio"===e,fitText(this.textInput,3,{maxFontSize:this.isAudioProvider?15:20,minFontSize:8})}handleChange(e){this.email=e.target.value}render(){var e,t,i,r;return h("div",{key:"b8e118c613aa8700448994aed04447b6464a119b",class:"overlay "+("rtl"===this.direction?"rtl":""),ref:e=>this.textInput=e},h("div",{key:"5a14ca9fa2b25515cea4da5466a933912ad9a9ed",class:"content"},h("h1",{key:"bd756aebf1015cdd0b4efd84f81f282edd9d93ba",class:this.isAudioProvider&&"is-small"},this.headline||(null===(e=null==this?void 0:this.i18n)||void 0===e?void 0:e.emailDefaultHeadline)),this.isLoading?h("presto-player-spinner",null):h("form",{onSubmit:e=>this.handleSubmit(e)},h("input",{type:"email",placeholder:null===(t=null==this?void 0:this.i18n)||void 0===t?void 0:t.emailPlaceholder,value:this.email,onInput:e=>this.handleChange(e),required:!0}),h("button",{type:"submit"},this.buttonText||(null===(i=null==this?void 0:this.i18n)||void 0===i?void 0:i.play))),this.errorMessage&&h("p",{key:"6c5bbc81394175cda1efcc160b170159cc079c74",class:"error"},this.errorMessage),this.bottomText&&h("p",{key:"47891a20de1cb0c9ac22339348d683394a3529bd",innerHTML:this.bottomText,class:this.isAudioProvider&&"is-small"}),!!this.allowSkip&&h("div",{key:"338e4db6407a69a42f5a7b6ae03baa50646cd23b",class:"skip",onClick:()=>{this.skip.emit()}},null===(r=null==this?void 0:this.i18n)||void 0===r?void 0:r.skip," →")))}static get is(){return"presto-email-overlay-ui"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["presto-email-overlay-ui.scss"]}}static get styleUrls(){return{$:["presto-email-overlay-ui.css"]}}static get properties(){return{headline:{type:"string",attribute:"headline",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Props"},getter:!1,setter:!1,reflect:!1},bottomText:{type:"string",attribute:"bottom-text",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1},buttonText:{type:"string",attribute:"button-text",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1},allowSkip:{type:"boolean",attribute:"allow-skip",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1},borderRadius:{type:"number",attribute:"border-radius",mutable:!1,complexType:{original:"number",resolved:"number",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1},isLoading:{type:"boolean",attribute:"is-loading",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1},errorMessage:{type:"string",attribute:"error-message",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!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},i18n:{type:"unknown",attribute:"i-1-8n",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:""},getter:!1,setter:!1},provider:{type:"string",attribute:"provider",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1},type:{type:"string",attribute:"type",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},getter:!1,setter:!1,reflect:!1}}}static get states(){return{email:{},isAudioProvider:{}}}static get events(){return[{method:"submitForm",name:"submitForm",bubbles:!0,cancelable:!0,composed:!0,docs:{tags:[],text:"Events"},complexType:{original:"object",resolved:"object",references:{}}},{method:"skip",name:"skip",bubbles:!0,cancelable:!0,composed:!0,docs:{tags:[],text:""},complexType:{original:"object",resolved:"object",references:{}}}]}}