1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7155],{97155:(t,e,i)=>{i.r(e),i.d(e,{LiteYTEmbed:()=>o});class o extends HTMLElement{constructor(){super(),this.isIframeLoaded=!1,this.setupDom()}static get observedAttributes(){return["videoid","playlistid","videoplay","videotitle"]}connectedCallback(){this.addEventListener("pointerover",()=>o.warmConnections(this),{once:!0}),this.addEventListener("click",()=>this.addIframe())}get videoId(){return encodeURIComponent(this.getAttribute("videoid")||"")}set videoId(t){this.setAttribute("videoid",t)}get playlistId(){return encodeURIComponent(this.getAttribute("playlistid")||"")}set playlistId(t){this.setAttribute("playlistid",t)}get videoTitle(){return this.getAttribute("videotitle")||"Video"}set videoTitle(t){this.setAttribute("videotitle",t)}get videoPlay(){return this.getAttribute("videoplay")||"Play"}set videoPlay(t){this.setAttribute("videoplay",t)}get videoStartAt(){return this.getAttribute("videoStartAt")||"0"}get autoLoad(){return this.hasAttribute("autoload")}get autoPause(){return this.hasAttribute("autopause")}get noCookie(){return this.hasAttribute("nocookie")}get posterQuality(){return this.getAttribute("posterquality")||"hqdefault"}get posterLoading(){return this.getAttribute("posterloading")||"lazy"}get params(){return`start=${this.videoStartAt}&${this.getAttribute("params")}`}set params(t){this.setAttribute("params",t)}set posterQuality(t){this.setAttribute("posterquality",t)}get disableNoscript(){return this.hasAttribute("disablenoscript")}setupDom(){let t=this.attachShadow({mode:"open"}),e="";window.liteYouTubeNonce&&(e=`nonce="${window.liteYouTubeNonce}"`),t.innerHTML=` 2 <style ${e}> 3 :host { 4 --aspect-ratio: var(--lite-youtube-aspect-ratio, 16 / 9); 5 --aspect-ratio-short: var(--lite-youtube-aspect-ratio-short, 9 / 16); 6 --frame-shadow-visible: var(--lite-youtube-frame-shadow-visible, yes); 7 contain: content; 8 display: block; 9 position: relative; 10 width: 100%; 11 aspect-ratio: var(--aspect-ratio); 12 } 13 14 @media (max-width: 40em) { 15 :host([short]) { 16 aspect-ratio: var(--aspect-ratio-short); 17 } 18 } 19 20 #frame, #fallbackPlaceholder, iframe { 21 position: absolute; 22 width: 100%; 23 height: 100%; 24 left: 0; 25 top: 0; 26 } 27 28 #frame { 29 cursor: pointer; 30 } 31 32 #fallbackPlaceholder, slot[name=image]::slotted(*) { 33 object-fit: cover; 34 width: 100%; 35 } 36 37 @container style(--frame-shadow-visible: yes) { 38 #frame::before { 39 content: ''; 40 display: block; 41 position: absolute; 42 top: 0; 43 background-image: linear-gradient(180deg, #111 -20%, transparent 90%); 44 height: 60px; 45 width: 100%; 46 z-index: 1; 47 } 48 } 49 50 #playButton { 51 width: 68px; 52 height: 48px; 53 background-color: transparent; 54 background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>'); 55 z-index: 1; 56 border: 0; 57 border-radius: inherit; 58 } 59 60 #playButton:before { 61 content: ''; 62 border-style: solid; 63 border-width: 11px 0 11px 19px; 64 border-color: transparent transparent transparent #fff; 65 } 66 67 #playButton, 68 #playButton:before { 69 position: absolute; 70 top: 50%; 71 left: 50%; 72 transform: translate3d(-50%, -50%, 0); 73 cursor: inherit; 74 } 75 76 /* Post-click styles */ 77 .activated { 78 cursor: unset; 79 } 80 81 #frame.activated::before, 82 #frame.activated > #playButton { 83 display: none; 84 } 85 </style> 86 <div id="frame"> 87 <picture> 88 <slot name="image"> 89 <source id="webpPlaceholder" type="image/webp"> 90 <source id="jpegPlaceholder" type="image/jpeg"> 91 <img id="fallbackPlaceholder" referrerpolicy="origin" loading="lazy"> 92 </slot> 93 </picture> 94 <button id="playButton" part="playButton"></button> 95 </div> 96 `,this.domRefFrame=t.querySelector("#frame"),this.domRefImg={fallback:t.querySelector("#fallbackPlaceholder"),webp:t.querySelector("#webpPlaceholder"),jpeg:t.querySelector("#jpegPlaceholder")},this.domRefPlayButton=t.querySelector("#playButton")}setupComponent(){0===this.shadowRoot.querySelector("slot[name=image]").assignedNodes().length&&this.initImagePlaceholder(),this.domRefPlayButton.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),this.setAttribute("title",`${this.videoPlay}: ${this.videoTitle}`),(this.autoLoad||this.isYouTubeShort()||this.autoPause)&&this.initIntersectionObserver(),this.disableNoscript||this.injectSearchNoScript()}attributeChangedCallback(t,e,i){e!==i&&(this.setupComponent(),this.domRefFrame.classList.contains("activated")&&(this.domRefFrame.classList.remove("activated"),this.shadowRoot.querySelector("iframe").remove(),this.isIframeLoaded=!1))}injectSearchNoScript(){let t=document.createElement("noscript");this.prepend(t),t.innerHTML=this.generateIframe()}generateIframe(t=!1){let e,i=+!t,o=this.autoPause?"&enablejsapi=1":"",s=this.noCookie?"-nocookie":"";return e=this.playlistId?`?listType=playlist&list=${this.playlistId}&`:`${this.videoId}?`,this.isYouTubeShort()&&(this.params=`loop=1&mute=1&modestbranding=1&playsinline=1&rel=0&enablejsapi=1&playlist=${this.videoId}`,i=1),` 97<iframe credentialless frameborder="0" title="${this.videoTitle}" 98 allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen 99 src="https://www.youtube${s}.com/embed/${e}autoplay=${i}${o}&${this.params}" 100></iframe>`}addIframe(t=!1){if(!this.isIframeLoaded){let e=this.generateIframe(t);this.domRefFrame.insertAdjacentHTML("beforeend",e),this.domRefFrame.classList.add("activated"),this.isIframeLoaded=!0,this.attemptShortAutoPlay(),this.dispatchEvent(new CustomEvent("liteYoutubeIframeLoaded",{detail:{videoId:this.videoId},bubbles:!0,cancelable:!0}))}}initImagePlaceholder(){this.testPosterImage(),this.domRefImg.fallback.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),this.domRefImg?.fallback?.setAttribute("alt",`${this.videoPlay}: ${this.videoTitle}`)}async testPosterImage(){setTimeout(()=>{let t=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`,e=new Image;e.fetchPriority="low",e.referrerPolicy="origin",e.src=t,e.onload=async t=>{let e=t.target;
100e?.naturalHeight==90&&e?.naturalWidth==120&&(this.posterQuality="hqdefault");let i=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;this.domRefImg.webp.srcset=i;let o=`https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;this.domRefImg.fallback.loading=this.posterLoading,this.domRefImg.jpeg.srcset=o,this.domRefImg.fallback.src=o,this.domRefImg.fallback.loading=this.posterLoading}},100)}initIntersectionObserver(){new IntersectionObserver((t,e)=>{t.forEach(t=>{t.isIntersecting&&!this.isIframeLoaded&&(o.warmConnections(this),this.addIframe(!0),e.unobserve(this))})},{root:null,rootMargin:"0px",threshold:0}).observe(this),this.autoPause&&new IntersectionObserver((t,e)=>{t.forEach(t=>{1!==t.intersectionRatio&&this.shadowRoot.querySelector("iframe")?.contentWindow?.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")})},{threshold:1}).observe(this)}attemptShortAutoPlay(){this.isYouTubeShort()&&setTimeout(()=>{this.shadowRoot.querySelector("iframe")?.contentWindow?.postMessage('{"event":"command","func":"playVideo","args":""}',"*")},2e3)}isYouTubeShort(){return""===this.getAttribute("short")&&window.matchMedia("(max-width: 40em)").matches}static addPrefetch(t,e){let i=document.createElement("link");i.rel=t,i.href=e,i.crossOrigin="true",document.head.append(i)}static warmConnections(t){o.isPreconnected||window.liteYouTubeIsPreconnected||(o.addPrefetch("preconnect","https://i.ytimg.com/"),o.addPrefetch("preconnect","https://s.ytimg.com"),t.noCookie?o.addPrefetch("preconnect","https://www.youtube-nocookie.com"):(o.addPrefetch("preconnect","https://www.youtube.com"),o.addPrefetch("preconnect","https://www.google.com"),o.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),o.addPrefetch("preconnect","https://static.doubleclick.net")),o.isPreconnected=!0,window.liteYouTubeIsPreconnected=!0)}}o.isPreconnected=!1,customElements.define("lite-youtube",o)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.