1import S from"./BDVHwxPm.js";import{_ as T,ag as f,c as a,m as w,F as c,l as p,n as h,d as v,t as x,a as g,e as m,b as _,o as r}from"./C_VzGqEg.js";import"./BHKnQFBo.js";const b={name:"Tooltip",props:{content:{type:[String,Object],default:""},tooltipClasses:{type:String,default:"min-w-37"},timeToClose:{type:Number,default:3e3},disableClick:{type:Boolean,default:!1},position:{type:String,default:"top"},tooltipLeft:{type:Boolean,default:!1},tooltipRight:{type:Boolean,default:!1},tooltipCenter:{type:Boolean,default:!1},wideTooltip:{type:Boolean,default:!0}},setup(){return{wrapperId:`tooltip-wrapper-${f()}`,tooltipId:`tooltip-${f()}`}},data(){return{tooltipStatus:!1,tooltipStyle:{top:"3000px",left:"0px"},triangleStyle:{left:"50%",transform:"translateX(-50%)"},isTouchDevice:!1}},computed:{isStringContent(){return typeof this.content=="string"},triangleVerticalPosition(){return this.position==="bottom"?"-top-2xs rotate-180":"-bottom-2xs"},tooltipWidth(){return this.wideTooltip?"w-56":null},tooltipPadding(){return this.wideTooltip?"p-fluid-sm":"p-fluid-2xs"}},mounted(){this.updateTouchDeviceStatus(),window.addEventListener("resize",this.updateTouchDeviceStatus)},beforeUnmount(){window.removeEventListener("resize",this.updateTouchDeviceStatus)},methods:{updateTouchDeviceStatus(){this.isTouchDevice="ontouchstart"in window||navigator.maxTouchPoints>0},handleMouseEnter(){this.isTouchDevice||this.showTooltip()},handleMouseLeave(){this.isTouchDevice||this.hideTooltip()},showTooltip(){this.tooltipStatus=!0,this.$nextTick(()=>{this.getTriggerElementData()})},hideTooltip(){this.tooltipStatus=!1},toggleTooltip(){!this.disableClick&&this.isTouchDevice&&(this.tooltipStatus=!this.tooltipStatus),this.tooltipStatus&&setTimeout(()=>{this.tooltipStatus=!1},this.timeToClose),this.tooltipStatus&&(this.$nextTick(()=>{this.getTriggerElementData()}),setTimeout(()=>{this.tooltipStatus=!1},this.timeToClose))},getTriggerElementData(){const d=this.$refs.tooltipEl,l=this.$refs.wrapperEl;if(l&&d){const e=l.getBoundingClientRect(),i=d.getBoundingClientRect(),s=window.innerWidth;let t=null,o=null;this.tooltipRight?(t=-i.height-12,o=e.width-12):this.tooltipLeft?(t=-i.height-12,o=0):(t=-12-i.height,o=(e.width-i.width)/2),!this.tooltipLeft&&!this.tooltipRight&&e.left+o<0&&(o=-e.left+12),e.top-i.height<=0&&(t=e.height+12);const n=e.left+o,u=n+i.width;!this.tooltipLeft&&!this.tooltipRight&&u>s?o-=u-s+12:n<0&&(o=-e.left+12),this.tooltipStyle.top=`${t}px`,this.tooltipLeft?(this.tooltipStyle.right="0",this.tooltipStyle.left="auto"):this.tooltipStyle.left=`${o}px`;const y=Math.min(Math.max(e.width/2,Math.abs(o)+e.width/2),i.width-12);this.triangleStyle.left=this.tooltipCenter?"50%":this.tooltipLeft?"100%":this.tooltipRight?"10px":`${y}px`,this.triangleStyle.transform=this.position==="bottom"?"translateX(-50%) rotate(180deg)":this.tooltipLeft?"translateX(-100%)":"translateX(-50%)"}}}},C=["id"],D=["id"],E=["id"];function k(d,l,e,i,s,t){const o=S;return r(),a("div",{id:i.wrapperId,ref:"wrapperEl",class:"relative cursor-pointer",onMouseenter:l[0]||(l[0]=(...n)=>t.handleMouseEnter&&t.handleMouseEnter(...n)),onMouseleave:l[1]||(l[1]=(...n)=>t.handleMouseLeave&&t.handleMouseLeave(...n)),onClick:l[2]||(l[2]=(...n)=>t.toggleTooltip&&t.toggleTooltip(...n))},[w(d.$slots,"default",{},void 0,!0),t.isStringContent?(r(),a(c,{key:0},[s.tooltipStatus?(r(),a("div",{key:0,id:i.tooltipId,ref:"tooltipEl",class:h(["shadow-tooltip-shadow z-20 text-foreground-2 absolute background-flyout border-none rounded-sm opacity-1 text-2xs leading-sm",[e.tooltipClasses,t.tooltipPadding,t.tooltipWidth]]),style:p(s.tooltipStyle)},[v(x(e.content)+" ",1),g("div",{class:h(`triangle absolute ${t.triangleVerticalPosition}`),style:p(s.triangleStyle)},null,6)],14,D)):m("",!0)],64)):(r(),a(c,{key:1},[s.tooltipStatus?(r(),a("div",{key:0,id:i.tooltipId,ref:"tooltipEl",class:h(["shadow-tooltip-shadow z-20 text-foreground-2 absolute background-flyout border-none rounded-sm opacity-1 text-2xs leading-sm",[e.tooltipClasses,t.tooltipPadding,t.tooltipWidth]]),style:p(s.tooltipStyle)},[_(o,{content:e.content},null,8,["content"]),g("div",{class:h(`triangle absolute ${t.triangleVerticalPosition}`),style:p(s.triangleStyle)},null,6)],14,E)):m("",!0)],64))],40,C)}const P=Object.assign(T(b,[["render",k],["__scopeId","data-v-dc8c676d"]]),{__name:"Tooltip"});export{P as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.