/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
import{ref as t,watch as e,nextTick as o,openBlock as l,createElementBlock as p,renderSlot as n,createVNode as i,Transition as u,withCtx as r,normalizeStyle as s,normalizeClass as a,createTextVNode as f,toDisplayString as c,createCommentVNode as g}from"vue";import './Tooltip2.css';import './Tooltip.css';/* empty css            *//* empty css            */import d from"../../_virtual/_plugin-vue_export-helper.js";const h=/* @__PURE__ */d({__name:"Tooltip",props:{content:{type:String,default:""},placement:{type:String,default:"top"},offset:{type:Number,default:8},bg:{type:String,default:""}},setup(d){const h=d,v=t(!1),m=t(null),b=t(null),x=t({});function y(){v.value=!0,o(w)}function _(){v.value=!1}function w(){const t=m.value,e=b.value;if(!t||!e)return;const o=t.getBoundingClientRect(),l=e.getBoundingClientRect(),p=h.offset,n={top:{left:o.width/2-l.width/2+"px",bottom:`${o.height+p}px`},bottom:{left:o.width/2-l.width/2+"px",top:`${o.height+p}px`},left:{right:`${o.width+p}px`,top:o.height/2-l.height/2+"px"},right:{left:`${o.width+p}px`,top:o.height/2-l.height/2+"px"}},i=n[h.placement]||n.top;h.bg&&(i.backgroundColor=h.bg,e.style.setProperty("--gsc-tooltip-bg",h.bg)),x.value=i}return e(()=>[h.placement,h.offset,h.content,h.bg],()=>{v.value&&o(w)}),e(v,t=>{t&&o(w)}),(t,e)=>(l(),p("div",{ref_key:"wrapper",ref:m,class:"gsc-tooltip-wrapper",onMouseenter:y,onMouseleave:_,onFocusin:y,onFocusout:_},[n(t.$slots,"default",{},void 0,!0),i(u,{name:"gsc-tooltip-fade"},{default:r(()=>[v.value?(l(),p("div",{key:0,ref_key:"tooltip",ref:b,class:a(["gsc-tooltip",d.placement]),style:s(x.value),role:"tooltip"},[n(t.$slots,"content",{},()=>[f(c(d.content),1)],!0)],6)):g("",!0)]),_:3})],544))}},[["__scopeId","data-v-4529db20"]]);export{h as default};