import k from"./Kbd.jbtAGVVz.js";import{I as M,J as c,h as O,K as g,v as A,Z as B,r as N,o as s,c as n,M as v,d as u,B as i,b as $,w as b,a as p,z as d,t as h,F as D,A as j,y as z,P as w,T as F}from"./entry.RGd0w9hd.js";import{b as L,u as S}from"./selectMenu.C9lwG85K.js";import{u as V}from"./usePopper._FH1S1iZ.js";import{_ as K}from"./_plugin-vue_export-helper.x3n3nnut.js";import"./index.8phAC65J.js";import"./index.g8c07QCY.js";const P={wrapper:"relative inline-flex",container:"z-20 group",width:"max-w-xs",background:"bg-white dark:bg-gray-900",color:"text-gray-900 dark:text-white",shadow:"shadow",rounded:"rounded",ring:"ring-1 ring-gray-200 dark:ring-gray-800",base:"[@media(pointer:coarse)]:hidden h-6 px-2 py-1 text-xs font-normal truncate relative",shortcuts:"hidden md:inline-flex flex-shrink-0 gap-0.5",middot:"mx-1 text-gray-700 dark:text-gray-200",transition:{enterActiveClass:"transition ease-out duration-200",enterFromClass:"opacity-0 translate-y-1",enterToClass:"opacity-100 translate-y-0",leaveActiveClass:"transition ease-in duration-150",leaveFromClass:"opacity-100 translate-y-0",leaveToClass:"opacity-0 translate-y-1"},popper:{strategy:"fixed"},arrow:L},U=M(c.ui.strategy,c.ui.tooltip,P),I=O({components:{UKbd:k},inheritAttrs:!1,props:{text:{type:String,default:null},prevent:{type:Boolean,default:!1},shortcuts:{type:Array,default:()=>[]},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:0},popper:{type:Object,default:()=>({})},class:{type:[String,Object,Array],default:()=>""},ui:{type:Object,default:()=>({})}},setup(e){const{ui:o,attrs:f}=S("tooltip",g(e,"ui"),U,g(e,"class")),l=A(()=>B({},e.popper,o.value.popper)),[m,y]=V(l.value),r=N(!1);let t=null,a=null;function C(){a&&(clearTimeout(a),a=null),!r.value&&(t=t||setTimeout(()=>{r.value=!0,t=null},e.openDelay))}function T(){t&&(clearTimeout(t),t=null),r.value&&(a=a||setTimeout(()=>{r.value=!1,a=null},e.closeDelay))}return{ui:o,attrs:f,popper:l,trigger:m,container:y,open:r,onMouseOver:C,onMouseLeave:T}}});function E(e,o,f,l,m,y){const r=k;return s(),n("div",w({ref:"trigger",class:e.ui.wrapper},e.attrs,{onMouseover:o[0]||(o[0]=(...t)=>e.onMouseOver&&e.onMouseOver(...t)),onMouseleave:o[1]||(o[1]=(...t)=>e.onMouseLeave&&e.onMouseLeave(...t))}),[v(e.$slots,"default",{open:e.open},()=>[u(" Hover ")]),e.open&&!e.prevent?(s(),n("div",{key:0,ref:"container",class:i([e.ui.container,e.ui.width])},[$(F,w({appear:""},e.ui.transition),{default:b(()=>{var t;return[p("div",null,[e.popper.arrow?(s(),n("div",{key:0,"data-popper-arrow":"",class:i(Object.values(e.ui.arrow))},null,2)):d("",!0),p("div",{class:i([e.ui.base,e.ui.background,e.ui.color,e.ui.rounded,e.ui.shadow,e.ui.ring])},[v(e.$slots,"text",{},()=>[u(h(e.text),1)]),(t=e.shortcuts)!=null&&t.length?(s(),n("span",{key:0,class:i(e.ui.shortcuts)},[p("span",{class:i(e.ui.middot)},"·",2),(s(!0),n(D,null,j(e.shortcuts,a=>(s(),z(r,{key:a,size:"xs"},{default:b(()=>[u(h(a),1)]),_:2},1024))),128))],2)):d("",!0)],2)])]}),_:3},16)],2)):d("",!0)],16)}const W=K(I,[["render",E]]);export{W as default};
