{"version":3,"names":["prestoCtaOverlayUiCss","PrestoCtaOverlayUiStyle0","CTAOverlayUI","componentDidLoad","currentType","this","type","provider","isAudioProvider","fitText","textInput","maxFontSize","minFontSize","handleCTAClick","e","_a","buttonLink","url","preventDefault","stopPropagation","handleLink","opensInNewTab","window","open","_b","location","href","_c","render","h","key","class","ref","el","onClick","direction","part","headline","defaultHeadline","bottomText","innerHTML","showButton","full","target","buttonText","allowRewatch","stopImmediatePropagation","rewatch","emit","xmlns","width","height","viewBox","fill","stroke","points","d","_d","i18n","allowSkip","skip","_e"],"sources":["src/components/core/features/presto-cta-overlay/ui/presto-cta-overlay-ui.scss?tag=presto-cta-overlay-ui&encapsulation=shadow","src/components/core/features/presto-cta-overlay/ui/presto-cta-overlay-ui.tsx"],"sourcesContent":[":host {\n display: block;\n font-size: 16px;\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n z-index: 99999;\n user-select: none;\n}\n\n* {\n box-sizing: border-box;\n}\n\n$family: 'San Francisco', -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', Avenir, 'Avenir Next', 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, sans-serif;\n\na {\n color: #fff;\n}\n\n.wrapper {\n height: 100%;\n position: relative;\n color: #fff;\n font-family: var(--plyr-font-family, $family);\n}\n.overlay {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 48px;\n height: 100%;\n\n &.has-link {\n cursor: pointer;\n }\n\n &:before {\n content: '';\n border-radius: var(--presto-player-border-radius, 0);\n opacity: var(--presto-player-cta-background-opacity, 0.75);\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n background-color: var(--presto-player-cta-background, #000);\n z-index: -1;\n box-shadow: inset 0 0 100px black;\n }\n}\n\n.content {\n width: 80%;\n max-width: 600px;\n\n & * ~ * {\n margin-top: 22px;\n }\n}\n\nbutton {\n background: var(--plyr-color-main, #000);\n appearance: none;\n padding: 6px 12px;\n align-items: center;\n display: inline-flex;\n border-width: 1px;\n border-color: transparent;\n color: #fff;\n border-radius: 0;\n cursor: pointer;\n font-size: 0.8em;\n border-radius: 0 var(--presto-player-cta-border-radius, 0) var(--presto-player-cta-border-radius) 0;\n\n @media screen and (min-width: 700px) {\n padding: 10px 18px;\n }\n\n &:focus {\n box-shadow: rgb(255, 255, 255) 0px 0px 0px 2px, var(--plyr-color-main, #000) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;\n z-index: 1;\n }\n &:focus,\n &:hover {\n outline: none;\n }\n}\n\nh1 {\n font-size: 1.5em;\n font-weight: 500;\n margin: 0;\n line-height: 1.1em;\n}\n\n.skip,\n.rewatch {\n font-size: 0.8em;\n font-weight: 600;\n position: absolute;\n top: 0;\n right: 0;\n padding: 4%;\n cursor: pointer;\n}\n\n.rewatch {\n display: inline-flex;\n align-items: center;\n right: auto;\n left: 0;\n\n .icon {\n margin-right: 5px;\n }\n}\n\np {\n font-size: 0.85em;\n margin: 0;\n margin-top: 1.5em;\n line-height: 1.4em;\n opacity: 0.75;\n\n &.is-small {\n font-size: 0.85em;\n margin: 1.5em 0px 0px;\n line-height: 0.1em;\n opacity: 0.75;\n }\n}\n\n.is-centered {\n text-align: center;\n}\n","import { Component, Event, EventEmitter, h, Prop, State } from '@stencil/core';\nimport { ButtonLinkObject, i18nConfig } from '../../../../../interfaces';\nimport fitText from '../../../../../library/fittext.js';\n\n@Component({\n tag: 'presto-cta-overlay-ui',\n styleUrl: 'presto-cta-overlay-ui.scss',\n shadow: true,\n})\nexport class CTAOverlayUI {\n private textInput?: HTMLInputElement;\n\n /**\n * Props\n */\n @Prop() headline: string;\n @Prop() defaultHeadline: string;\n @Prop() bottomText: string;\n @Prop() showButton: boolean;\n @Prop() buttonText: string;\n @Prop() buttonType: 'link' | 'time';\n @Prop() buttonLink: ButtonLinkObject;\n @Prop() allowRewatch: boolean;\n @Prop() allowSkip: boolean;\n @Prop() direction?: 'rtl';\n @Prop() i18n: i18nConfig;\n @Prop() provider: string;\n @Prop() type: string;\n\n /**\n * State\n */\n @State() isAudioProvider: boolean;\n\n /**\n * Events\n */\n @Event() skip: EventEmitter;\n @Event() rewatch: EventEmitter;\n\n /**\n * Shrink text.\n */\n componentDidLoad() {\n let currentType = this.type || this.provider;\n this.isAudioProvider = currentType === 'audio' ? true : false;\n fitText(this.textInput, 3, {\n maxFontSize: this.isAudioProvider === true ? 15 : 20,\n minFontSize: 8,\n });\n }\n\n handleCTAClick(e) {\n if (!this.buttonLink?.url) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n this.handleLink();\n }\n\n handleLink() {\n if (this.buttonLink?.opensInNewTab) {\n window.open(this.buttonLink?.url, '_blank');\n } else {\n window.location.href = this.buttonLink?.url;\n }\n }\n\n render() {\n return (\n
(this.textInput = el as HTMLInputElement)}>\n
this.handleCTAClick(e)} class={`overlay ${this.direction === 'rtl' ? 'rtl' : ''} ${this.buttonLink?.url ? 'has-link' : ''}`}>\n
\n

{this.headline || this.defaultHeadline}

\n {this.bottomText &&

}\n {this.showButton && (\n this.handleCTAClick(e)}\n part=\"cta-button\"\n href={this?.buttonLink?.url}\n target={this?.buttonLink?.opensInNewTab ? '_blank' : '_self'}\n class=\"button\"\n type=\"primary\"\n >\n {this.buttonText}\n \n )}\n
\n
\n {!!this.allowRewatch && (\n {\n e.preventDefault();\n e.stopImmediatePropagation();\n this.rewatch.emit();\n }}\n >\n \n \n \n \n {this?.i18n?.rewatch}\n
\n )}\n {!!this.allowSkip && (\n {\n e.preventDefault();\n this.skip.emit();\n }}\n >\n {this?.i18n?.skip} →\n \n )}\n \n );\n }\n}\n"],"mappings":"sFAAA,MAAMA,EAAwB,s6DAC9B,MAAAC,EAAeD,E,MCQFE,EAAY,M,2bAkCvB,gBAAAC,GACE,IAAIC,EAAcC,KAAKC,MAAQD,KAAKE,SACpCF,KAAKG,gBAAkBJ,IAAgB,QAAU,KAAO,MACxDK,EAAQ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