import{r as o,h as t,g as e,H as i}from"./p-40eb06b7.js";import{f as a,t as s}from"./p-b415099e.js";import{c as r,a as l,f as n,s as p,o as d,b as h}from"./p-3777f34f.js";const m=["mouseenter"],b=["mouseleave","blur"],c=class{constructor(t){o(this,t),this.content=void 0,this.align="top"}componentDidLoad(){this.tooltip=a(),m.forEach((o=>{this.el.addEventListener(o,this.showHandler.bind(this))})),b.forEach((o=>{this.el.addEventListener(o,this.hideHandler.bind(this))}))}disconectedCallback(){m.forEach((o=>{this.el.removeEventListener(o,this.showHandler)})),b.forEach((o=>{this.el.removeEventListener(o,this.hideHandler)}))}showHandler(){this.tooltip.setAttribute("data-show",""),this.tooltip.querySelector("span").innerHTML=s(this.content)||"";const o=this.tooltip.querySelector(".tooltip-arrow");r(this.el,this.tooltip,{placement:this.align,middleware:["auto"==this.align?l():n(),p({padding:10}),d(4),h({element:o})]}).then((({x:t,y:e,middlewareData:i,placement:a})=>{if(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${e}px`,i.arrow){const{x:t,y:e}=i.arrow,s={top:"bottom",right:"left",bottom:"top",left:"right"}[a.split("-")[0]];Object.assign(o.style,{left:null!=t?`${t}px`:"",top:null!=e?`${e}px`:"",right:"",bottom:"",[s]:"-4px"})}}))}hideHandler(){setTimeout((()=>{this.tooltip.removeAttribute("data-show"),this.tooltip.querySelector("span").innerHTML=""}),50)}render(){return t(i,{key:"5a5634c258cb53ebbb84bf5381bdbd9727be30c9","aria-label":this.content})}get el(){return e(this)}};c.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{c as x_tooltip}