1const a=()=>{class l extends HTMLElement{connectedCallback(){this.setup()}disconnectedCallback(){document.removeEventListener("touchstart",r),this.placeholder.replaceWith(this.placeholder.cloneNode(!0)),this.replaceWith(this.cloneNode(!0))}handleDropdownPosition(){this.dropdown.style.setProperty("--arrow-translate-x",null),this.dropdown.style.left=null,this.dropdown.style.right=null,this.dropdown.style.transform=null;const t=this.placeholder.getBoundingClientRect(),e=this.dropdown.getBoundingClientRect(),o=e.x+e.width,d=t.x+t.width;e.x<0?(this.dropdown.style.left="0",this.dropdown.style.right="auto",this.dropdown.style.transform=`translateX(${-t.x+16}px)`):o>window.innerWidth&&(this.dropdown.style.left="auto",this.dropdown.style.right="0",this.dropdown.style.transform=`translateX(${window.innerWidth-d-16}px)`),setTimeout(()=>{this.handleDropdownArrowPosition()},5)}handleDropdownArrowPosition(){const n=this.placeholder.getBoundingClientRect(),t=this.dropdown.getBoundingClientRect(),e=t.x+t.width/2,o=n.x+n.width/2;e>o?this.dropdown.style.setProperty("--arrow-translate-x",`-${e-o}px`):e<o?this.dropdown.style.setProperty("--arrow-translate-x",`${o-e}px`):this.dropdown.style.setProperty("--arrow-translate-x",null)}toggle(){this.classList.contains("is-open")?this.close():this.open()}open(){this.classList.add("is-open"),this.handleDropdownPosition()}close(){this.classList.remove("is-open")}setup(){this.placeholder=this.querySelector("[data-tooltip-placeholder]"),this.dropdown=this.querySelector("[data-tooltip-dropdown]"),this.placeholder.addEventListener("mouseover",()=>this.handleDropdownPosition()),this.placeholder.addEventListener("focusin",()=>this.open()),this.placeholder.addEventListener("focusout",()=>this.close())}}function i(s){if(typeof s.target.closest!="function")return;const n=s.target.closest(".ll-tooltip");document.querySelectorAll(".ll-tooltip.is-open").forEach(t=>{t!==n&&(t.classList.remove("is-open"),t.querySelector("[data-tooltip-dropdown]").style.setProperty("--arrow-translate-x",null))})}const r=s=>i(s);customElements.define("ll-tooltip",l),document.addEventListener("touchstart",r)};function c(){document.querySelectorAll(".ll-tooltip.is-open").forEach(l=>{l.classList.remove("is-open"),l.querySelector("[data-tooltip-dropdown]").style.setProperty("--arrow-translate-x",null)})}export{a as default,c as forceCloseAllTooltips};
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.