class LiteYTEmbed extends HTMLElement{constructor(){super(),this.videoId=encodeURIComponent(this.getAttribute("video-id")),this.playerSrc=this.getAttribute("player-src")}connectedCallback(){this.addEventListener("pointerover",LiteYTEmbed.warmConnections,{once:!0}),this.addEventListener("click",(e=>this.addIframe()))}static addPrefetch(e,t,c){const n=document.createElement("link");n.rel=e,n.href=t,c&&(n.as=c),n.crossorigin=!0,document.head.append(n)}static warmConnections(){LiteYTEmbed.preconnected||(LiteYTEmbed.addPrefetch("preconnect","https://www.youtube-nocookie.com"),LiteYTEmbed.addPrefetch("preconnect","https://www.google.com"),LiteYTEmbed.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),LiteYTEmbed.addPrefetch("preconnect","https://static.doubleclick.net"),LiteYTEmbed.addPrefetch("preconnect","https://rutube.ru"),LiteYTEmbed.preconnected=!0)}addIframe(){const e=`\n            <iframe\n                width="560"\n                height="315"\n                frameborder="0"\n                allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen"\n                webkitAllowFullScreen\n                mozallowfullscreen\n                allowfullscreen\n                src="${this.playerSrc}"\n            ></iframe>`;this.insertAdjacentHTML("beforeend",e),this.classList.add("lyt-activated")}}customElements.define("lite-youtube",LiteYTEmbed);