(function(r,s){typeof exports=="object"&&typeof module!="undefined"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(r=typeof globalThis!="undefined"?globalThis:r||self,s(r.vueTooltip={},r.Vue))})(this,function(r,s){"use strict";function l(o){return new a(o)}function p(o,i){const e=s.ref();s.onMounted(()=>{e.value=l(Object.assign({container:o.value},i))}),s.onUnmounted(()=>{e.value&&e.value.detach()});function n(){e.value&&e.value.hide()}function t(u,d){e.value&&e.value.show(u,d)}return{closeTooltip:n,showTooltip:t}}class a{constructor(i){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"wrapper",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isShow",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.wrapper=document.createElement("div"),this._init()}_init(){const i=this.options.container;i&&(i.style.position="relative",this.wrapper.style.minWidth="160px",this.wrapper.style.position="absolute",this.wrapper.style.boxSizing="border-box",this.wrapper.style.borderRadius="4px",this.wrapper.style.backgroundColor="#fff",this.wrapper.style.padding="6px",this.wrapper.style.zIndex="99999999999",this.wrapper.style.boxShadow="0px 2px 10px rgba(0, 0, 0, 0.1)",this.wrapper.style.display="none",i.appendChild(this.wrapper))}_renderActions(i){const e=document.createElement("ul");i.forEach(n=>{const t=document.createElement("li");t.innerText=n.label,t.addEventListener("click",()=>{n.handler(n),this.hide()},!1),t.style.listStyle="none",t.style.padding="6px 0px",t.style.backgroundColor="#fff",t.style.transition="background-color 0.2s ease-in-out",t.style.fontSize="14px",t.style.cursor="pointer",t.style.userSelect="none",t.addEventListener("mouseenter",()=>{t.style.backgroundColor="#f5f5f5"},!1),t.addEventListener("mouseleave",()=>{t.style.backgroundColor="#fff"},!1),e.appendChild(t)}),e.style.listStyle="none",e.style.margin="0px",e.style.padding="0px",i.length===0&&(e.style.minHeight="40px"),this.wrapper.appendChild(e)}show(i,e){this.isShow&&this.hide(),this._renderActions(i),this.wrapper.style.left=e.x+"px",this.wrapper.style.top=e.y+"px",this.wrapper.style.display="block",this.isShow=!0}hide(){this.isShow&&(this.wrapper.innerHTML="",this.wrapper.style.left="0px",this.wrapper.style.top="0px",this.wrapper.style.display="none",this.isShow=!1)}detach(){this.wrapper.remove()}}r.createToolTip=l,r.useTooltip=p,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});