import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{f as fitText}from"./fittext.js";const prestoDynamicOverlayUiCss=":host{display:block}.overlay-text{text-decoration:none;display:inline-block;user-select:none;line-height:1;opacity:var(--presto-dynamic-overlay-opacity, 1);font-size:var(--presto-dynamic-overlay-font-size, 18px);padding:var(--presto-dynamic-overlay-padding, 0.65em 0.85em);font-weight:var(--presto-dynamic-overlay-font-weight, 500);border-radius:var(--presto-dynamic-overlay-radius, 0.25em);background:var(--presto-dynamic-overlay-background, rgba(0, 0, 0, 0.8));color:var(--presto-dynamic-overlay-color, #fff);opacity:var(--presto-dynamic-overlay-opacity, 1);word-break:break-word}a.overlay-text{cursor:pointer}",PrestoDynamicOverlayUi=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.position="top-right"}closestElement(e,t){return t&&t!=document&&t!=window&&t.closest(e)||t&&this.closestElement(e,t.getRootNode().host)}componentDidLoad(){let e=this.closestElement("presto-player",this.el);fitText(this.text,3,{maxFontSize:16,minFontSize:10,container:e})}render(){const e=this.href?"a":"span";return h(e,{key:"aba93930fd5449cfccd632ecd9983841c5333d9f",class:{"overlay-text":!0,"overlay--top-left":"top-left"===this.position,"overlay--top-right":"top-right"===this.position},href:this.href,target:this.target,part:"overlay-text",ref:e=>this.text=e},h("slot",{key:"be2b2aa9b5c71e613ccef9e62f828451964649fe"}))}get el(){return this}static get style(){return prestoDynamicOverlayUiCss}},[257,"presto-dynamic-overlay-ui",{href:[1],target:[1],position:[1]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["presto-dynamic-overlay-ui"].forEach(e=>{"presto-dynamic-overlay-ui"===e&&(customElements.get(e)||customElements.define(e,PrestoDynamicOverlayUi))})}export{PrestoDynamicOverlayUi as P,defineCustomElement as d};