1import{s as e,i as t,x as i}from"./chunk.lit-element-726bced0.js";import{E as o}from"./chunk.events-3f8ab4b2.js";import{i as s,c as l}from"./chunk.icons-d69a0007.js";class a extends e{static properties={youtubeId:{type:String},open:{type:Boolean},modal:{type:Element,attribute:!1}};static styles=[s,t`:host{position:absolute;left:0;top:0;height:0;width:0;overflow:visible}.modalContainer__overlay{min-width:100%;height:100%;background-color:#999;background-color:rgba(0,0,0,.7);position:fixed;top:0;right:0;bottom:0;left:0;transform:translate(100%,0);z-index:10000}:host(.isActive) .modalContainer__overlay{transform:translate(0,0)}.modalContainer__bd{width:100%;max-width:960px;position:fixed;top:50%;left:50%;z-index:10010;opacity:0;transform:translate(200%,-50%);transition:opacity .4s cubic-bezier(1,0,0,1);-webkit-backface-visibility:hidden}:host(.isActive) .modalContainer__bd{opacity:1;transform:translate(-50%,-50%)}.modal{position:absolute;top:0;left:0;right:0;transform:translate(0,-50%)}.modal__close{position:absolute;top:0;right:0;z-index:100;line-height:0}.modal__close button{background-color:transparent;border:0;padding:0;line-height:0;cursor:pointer}.modal__close button:hover{background-color:#000}.modal__bd{display:flex;position:relative;min-height:0;flex:1;overflow-x:hidden;overflow-y:auto;flex-direction:column;padding:46px 0 0 0}.modal__bd iframe{width:100%;height:auto;max-width:100%;aspect-ratio:16/9}`];constructor(){super(),this.youtubeId="",this.open=!1,this.modal=null,this._previouslyFocused=null}firstUpdated(){this.modal=this.renderRoot.querySelector("#modalVideo")}connectedCallback(){super.connectedCallback(),this._handleOpenModal=e=>this.onOpenVideoModal(e),this._handleClick=()=>this._closeClick(),this._handleKeydown=e=>{if("Escape"===e.key&&this._closeClick(),"Tab"===e.key&&this.open&&this.modal){const t=this.modal.querySelectorAll('button, iframe, [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const i=t[0],o=t[t.length-1],s=this.renderRoot.activeElement||this.modal;e.shiftKey&&s===i?(e.preventDefault(),o.focus()):e.shiftKey||s!==o||(e.preventDefault(),i.focus())}},window.addEventListener(o.OPEN_VIDEO_MODAL,this._handleOpenModal),this.addEventListener("click",this._handleClick),document.addEventListener("keydown",this._handleKeydown)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(o.OPEN_VIDEO_MODAL,this._handleOpenModal),this.removeEventListener("click",this._handleClick),document.removeEventListener("keydown",this._handleKeydown),this._handleOpenModal=null,this._handleClick=null,this._handleKeydown=null,this.modal=null}onOpenVideoModal(e){this._previouslyFocused=document.activeElement,this.youtubeId=e.detail,this.open=!0,this.classList.add("isActive");document.querySelector("html").classList.add("isLocked"),this.modal&&(this.modal.setAttribute("tabindex","0"),this.modal.setAttribute("aria-hidden","false"),this.modal.focus())}_closeClick(){if(!this.open)return;this.youtubeId="",this.open=!1,this.classList.remove("isActive");document.querySelector("html").classList.remove("isLocked"),this.modal&&(this.modal.setAttribute("tabindex","-1"),this.modal.setAttribute("aria-hidden","true")),this._previouslyFocused&&(this._previouslyFocused.focus(),this._previouslyFocused=null)}openClass(){return this.open?"open":""}_modalClick(e){e.stopPropagation()}renderIFrame(){if(this.youtubeId)return i`<iframe width="800" height="450" src="https://www.youtube.com/embed/${this.youtubeId}?&autoplay=1" frameborder="0" allowfullscreen></iframe>`}render(){return i`<div class="modalContainer__overlay"></div><div class="modalContainer__bd"><div class="modal" @click="${this._modalClick}" aria-modal="true" role="dialog" tabindex="-1" aria-hidden="true" id="modalVideo"><div class="modal__close"><button type="button" @click="${this._closeClick}" aria-label="close">${l}</button></div><div class="modal__bd">${this.renderIFrame()}</div></div></div>`}}customElements.define("modal-video",a);
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.