import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";const prestoYoutubeSubscribeButtonCss=":host{display:block}",PrestoYoutubeSubscribeButton=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.channel=void 0,this.layout="default",this.showCount=void 0}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",{class:"g-ytsubscribe",ref:t=>this.textInput=t})}static get style(){return":host{display:block}"}},[0,"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))}))}defineCustomElement();export{PrestoYoutubeSubscribeButton as P,defineCustomElement as d};