import{r as t,h as o,g as e,H as i}from"./p-444192d7.js";import{h as a,t as s}from"./p-ab760d78.js";import{c as r,d as l,f as n,s as d,o as p,e as h}from"./p-384ed661.js";const m=["mouseenter","touchstart"],c=["mouseleave","blur","touchend"],b=class{constructor(o){t(this,o),this.content=void 0,this.align="top"}componentDidLoad(){this.tooltip=a(),m.forEach((t=>{this.el.addEventListener(t,this.showHandler.bind(this))})),c.forEach((t=>{this.el.addEventListener(t,this.hideHandler.bind(this))}))}disconectedCallback(){b.activeElements.delete(this.el),m.forEach((t=>{this.el.removeEventListener(t,this.showHandler)})),c.forEach((t=>{this.el.removeEventListener(t,this.hideHandler)}))}showHandler(){b.activeElements.add(this.el),this.tooltip.setAttribute("data-show",""),this.tooltip.querySelector("span").innerHTML=s(this.content)||"";const t=this.tooltip.querySelector(".tooltip-arrow");r(this.el,this.tooltip,{placement:this.align,middleware:["auto"==this.align?l():n(),d({padding:10}),p(4),h({element:t})]}).then((({x:o,y:e,middlewareData:i,placement:a})=>{if(this.tooltip.style.left=`${o}px`,this.tooltip.style.top=`${e}px`,i.arrow){const{x:o,y:e}=i.arrow,s={top:"bottom",right:"left",bottom:"top",left:"right"}[a.split("-")[0]];Object.assign(t.style,{left:null!=o?`${o}px`:"",top:null!=e?`${e}px`:"",right:"",bottom:"",[s]:"-4px"})}}))}hideHandler(){b.activeElements.delete(this.el),0===b.activeElements.size&&(this.tooltip.removeAttribute("data-show"),this.tooltip.querySelector("span").innerHTML="")}render(){return o(i,{key:"9205e005c475445b4aa61f98a113aef33cde3ab4","aria-label":this.content})}get el(){return e(this)}};b.activeElements=new Set,b.style='x-tooltip{display:inherit}x-tooltip-overlay{font-family:"Poppins", "Arial", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";background:var(--color-dark-tinted, #626262);color:var(--color-text-light, #FEFEFE);padding:4px 8px;font-size:0.9rem;border-radius:4px;display:none;-webkit-box-shadow:0 0 1em rgba(0, 0, 0, 0.2);box-shadow:0 0 1em rgba(0, 0, 0, 0.2);z-index:10000;position:absolute;text-align:inherit;top:0;left:0;width:-webkit-max-content;width:-moz-max-content;width:max-content}x-tooltip-overlay:empty{display:none}.is-dark-mode x-tooltip-overlay{background:var(--color-light-shade, #d8d8d8);color:var(--color-text, #4A4A4A)}x-tooltip-overlay[data-show]{display:block;-webkit-animation:0.4s fadeIn;animation:0.4s fadeIn}x-tooltip-overlay>p{margin:0px;font-family:"Poppins", "Arial", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"}x-tooltip-overlay .tooltip-arrow{position:absolute;background:var(--color-dark-tinted, #626262);width:8px;height:8px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.is-dark-mode x-tooltip-overlay .tooltip-arrow{background:var(--color-light-shade, #d8d8d8)}';export{b as x_tooltip}