import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";const prestoYoutubeSubscribeButtonCss=":host{display:block}",PrestoYoutubeSubscribeButton=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.layout="default"}waitForApi(t){var e=setInterval(function(){var o;(null===(o=null===window||void 0===window?void 0:window.gapi)||void 0===o?void 0:o.ytsubscribe)&&(clearInterval(e),t())},50)}componentDidLoad(){const t=document.createElement("script");t.type="text/javascript",t.async=!1,t.src="https://apis.google.com/js/platform.js";const e=document.getElementsByTagName("script")[0];e&&e.parentNode.insertBefore(t,e),this.waitForApi(()=>{window.gapi.ytsubscribe.render(this.textInput,{channelId:this.channel,layout:this.layout,count:this.showCount?"default":"hidden"})})}render(){return h("div",{key:"5891adca82eb9dfda8db90ca5b11dac0cfdc58ed",class:"g-ytsubscribe",ref:t=>this.textInput=t})}static get style(){return":host{display:block}"}},[256,"presto-youtube-subscribe-button",{channel:[1],layout:[1],showCount:[4,"show-count"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["presto-youtube-subscribe-button"].forEach(t=>{"presto-youtube-subscribe-button"===t&&(customElements.get(t)||customElements.define(t,PrestoYoutubeSubscribeButton))})}export{PrestoYoutubeSubscribeButton as P,defineCustomElement as d};