import{d as Tt,l as ot,m as Et,ae as Rt,z as St,Q as Lt,o as Pt,b as Dt,C as _t,W as kt,j as Mt}from"./Dad40niL.js";import{u as Bt}from"./BJoRK3DD.js";const Nt=["top","right","bottom","left"],it=["start","end"],st=Nt.reduce((t,e)=>t.concat(e,e+"-"+it[0],e+"-"+it[1]),[]),Q=Math.min,_=Math.max,j=Math.round,E=t=>({x:t,y:t}),Ft={left:"right",right:"left",bottom:"top",top:"bottom"},Vt={start:"end",end:"start"};function rt(t,e,o){return _(t,Q(e,o))}function M(t,e){return typeof t=="function"?t(e):t}function D(t){return t.split("-")[0]}function L(t){return t.split("-")[1]}function G(t){return t==="x"?"y":"x"}function dt(t){return t==="y"?"height":"width"}function $(t){return["top","bottom"].includes(D(t))?"y":"x"}function mt(t){return G($(t))}function Wt(t,e,o){o===void 0&&(o=!1);const n=L(t),i=mt(t),r=dt(i);let s=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ct(s)),[s,ct(s)]}function $t(t){return t.replace(/start|end/g,e=>Vt[e])}function ct(t){return t.replace(/left|right|bottom|top/g,e=>Ft[e])}function Ht(t){return{top:0,right:0,bottom:0,left:0,...t}}function jt(t){return typeof t!="number"?Ht(t):{top:t,right:t,bottom:t,left:t}}function I(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function lt(t,e,o){let{reference:n,floating:i}=t;const r=$(e),s=mt(e),c=dt(s),f=D(e),u=r==="y",l=n.x+n.width/2-i.width/2,a=n.y+n.height/2-i.height/2,m=n[c]/2-i[c]/2;let d;switch(f){case"top":d={x:l,y:n.y-i.height};break;case"bottom":d={x:l,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:a};break;case"left":d={x:n.x-i.width,y:a};break;default:d={x:n.x,y:n.y}}switch(L(e)){case"start":d[s]-=m*(o&&u?-1:1);break;case"end":d[s]+=m*(o&&u?-1:1);break}return d}const It=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=o,c=r.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(e));let u=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:l,y:a}=lt(u,n,f),m=n,d={},h=0;for(let g=0;g<c.length;g++){const{name:p,fn:x}=c[g],{x:w,y:v,data:b,reset:y}=await x({x:l,y:a,initialPlacement:n,placement:m,strategy:i,middlewareData:d,rects:u,platform:s,elements:{reference:t,floating:e}});l=w??l,a=v??a,d={...d,[p]:{...d[p],...b}},y&&h<=50&&(h++,typeof y=="object"&&(y.placement&&(m=y.placement),y.rects&&(u=y.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):y.rects),{x:l,y:a}=lt(u,m,f)),g=-1)}return{x:l,y:a,placement:m,strategy:i,middlewareData:d}};async function ht(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:r,rects:s,elements:c,strategy:f}=t,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:a="floating",altBoundary:m=!1,padding:d=0}=M(e,t),h=jt(d),p=c[m?a==="floating"?"reference":"floating":a],x=I(await r.getClippingRect({element:(o=await(r.isElement==null?void 0:r.isElement(p)))==null||o?p:p.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:u,rootBoundary:l,strategy:f})),w=a==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),b=await(r.isElement==null?void 0:r.isElement(v))?await(r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1},y=I(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:v,strategy:f}):w);return{top:(x.top-y.top+h.top)/b.y,bottom:(y.bottom-x.bottom+h.bottom)/b.y,left:(x.left-y.left+h.left)/b.x,right:(y.right-x.right+h.right)/b.x}}function Yt(t,e,o){return(t?[...o.filter(i=>L(i)===t),...o.filter(i=>L(i)!==t)]:o.filter(i=>D(i)===i)).filter(i=>t?L(i)===t||(e?$t(i)!==i:!1):!0)}const Xt=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var o,n,i;const{rects:r,middlewareData:s,placement:c,platform:f,elements:u}=e,{crossAxis:l=!1,alignment:a,allowedPlacements:m=st,autoAlignment:d=!0,...h}=M(t,e),g=a!==void 0||m===st?Yt(a||null,d,m):m,p=await ht(e,h),x=((o=s.autoPlacement)==null?void 0:o.index)||0,w=g[x];if(w==null)return{};const v=Wt(w,r,await(f.isRTL==null?void 0:f.isRTL(u.floating)));if(c!==w)return{reset:{placement:g[0]}};const b=[p[D(w)],p[v[0]],p[v[1]]],y=[...((n=s.autoPlacement)==null?void 0:n.overflows)||[],{placement:w,overflows:b}],F=g[x+1];if(F)return{data:{index:x+1,overflows:y},reset:{placement:F}};const et=y.map(T=>{const V=L(T.placement);return[T.placement,V&&l?T.overflows.slice(0,2).reduce((Ct,Ot)=>Ct+Ot,0):T.overflows[0],T.overflows]}).sort((T,V)=>T[1]-V[1]),nt=((i=et.filter(T=>T[2].slice(0,L(T[0])?2:3).every(V=>V<=0))[0])==null?void 0:i[0])||et[0][0];return nt!==c?{data:{index:x+1,overflows:y},reset:{placement:nt}}:{}}}};async function zt(t,e){const{placement:o,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=D(o),c=L(o),f=$(o)==="y",u=["left","top"].includes(s)?-1:1,l=r&&f?-1:1,a=M(e,t);let{mainAxis:m,crossAxis:d,alignmentAxis:h}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:{mainAxis:a.mainAxis||0,crossAxis:a.crossAxis||0,alignmentAxis:a.alignmentAxis};return c&&typeof h=="number"&&(d=c==="end"?h*-1:h),f?{x:d*l,y:m*u}:{x:m*u,y:d*l}}const Kt=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;const{x:i,y:r,placement:s,middlewareData:c}=e,f=await zt(e,t);return s===((o=c.offset)==null?void 0:o.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:s}}}}},Qt=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:n,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:p=>{let{x,y:w}=p;return{x,y:w}}},...f}=M(t,e),u={x:o,y:n},l=await ht(e,f),a=$(D(i)),m=G(a);let d=u[m],h=u[a];if(r){const p=m==="y"?"top":"left",x=m==="y"?"bottom":"right",w=d+l[p],v=d-l[x];d=rt(w,d,v)}if(s){const p=a==="y"?"top":"left",x=a==="y"?"bottom":"right",w=h+l[p],v=h-l[x];h=rt(w,h,v)}const g=c.fn({...e,[m]:d,[a]:h});return{...g,data:{x:g.x-o,y:g.y-n,enabled:{[m]:r,[a]:s}}}}}},Ut=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:o,y:n,placement:i,rects:r,middlewareData:s}=e,{offset:c=0,mainAxis:f=!0,crossAxis:u=!0}=M(t,e),l={x:o,y:n},a=$(i),m=G(a);let d=l[m],h=l[a];const g=M(c,e),p=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(f){const v=m==="y"?"height":"width",b=r.reference[m]-r.floating[v]+p.mainAxis,y=r.reference[m]+r.reference[v]-p.mainAxis;d<b?d=b:d>y&&(d=y)}if(u){var x,w;const v=m==="y"?"width":"height",b=["top","left"].includes(D(i)),y=r.reference[a]-r.floating[v]+(b&&((x=s.offset)==null?void 0:x[a])||0)+(b?0:p.crossAxis),F=r.reference[a]+r.reference[v]+(b?0:((w=s.offset)==null?void 0:w[a])||0)-(b?p.crossAxis:0);h<y?h=y:h>F&&(h=F)}return{[m]:d,[a]:h}}}};function Y(){return typeof window<"u"}function N(t){return pt(t)?(t.nodeName||"").toLowerCase():"#document"}function A(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function S(t){var e;return(e=(pt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function pt(t){return Y()?t instanceof Node||t instanceof A(t).Node:!1}function C(t){return Y()?t instanceof Element||t instanceof A(t).Element:!1}function R(t){return Y()?t instanceof HTMLElement||t instanceof A(t).HTMLElement:!1}function at(t){return!Y()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof A(t).ShadowRoot}function H(t){const{overflow:e,overflowX:o,overflowY:n,display:i}=O(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&!["inline","contents"].includes(i)}function qt(t){return["table","td","th"].includes(N(t))}function X(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function J(t){const e=Z(),o=C(t)?O(t):t;return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!e&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!e&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(o.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(o.contain||"").includes(n))}function Gt(t){let e=P(t);for(;R(e)&&!B(e);){if(J(e))return e;if(X(e))return null;e=P(e)}return null}function Z(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function B(t){return["html","body","#document"].includes(N(t))}function O(t){return A(t).getComputedStyle(t)}function z(t){return C(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function P(t){if(N(t)==="html")return t;const e=t.assignedSlot||t.parentNode||at(t)&&t.host||S(t);return at(e)?e.host:e}function gt(t){const e=P(t);return B(e)?t.ownerDocument?t.ownerDocument.body:t.body:R(e)&&H(e)?e:gt(e)}function U(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=!0);const i=gt(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=A(i);if(r){const c=q(s);return e.concat(s,s.visualViewport||[],H(i)?i:[],c&&o?U(c):[])}return e.concat(i,U(i,[],o))}function q(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function xt(t){const e=O(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=R(t),r=i?t.offsetWidth:o,s=i?t.offsetHeight:n,c=j(o)!==r||j(n)!==s;return c&&(o=r,n=s),{width:o,height:n,$:c}}function wt(t){return C(t)?t:t.contextElement}function k(t){const e=wt(t);if(!R(e))return E(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:r}=xt(e);let s=(r?j(o.width):o.width)/n,c=(r?j(o.height):o.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Jt=E(0);function yt(t){const e=A(t);return!Z()||!e.visualViewport?Jt:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Zt(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==A(t)?!1:e}function W(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),r=wt(t);let s=E(1);e&&(n?C(n)&&(s=k(n)):s=k(t));const c=Zt(r,o,n)?yt(r):E(0);let f=(i.left+c.x)/s.x,u=(i.top+c.y)/s.y,l=i.width/s.x,a=i.height/s.y;if(r){const m=A(r),d=n&&C(n)?A(n):n;let h=m,g=q(h);for(;g&&n&&d!==h;){const p=k(g),x=g.getBoundingClientRect(),w=O(g),v=x.left+(g.clientLeft+parseFloat(w.paddingLeft))*p.x,b=x.top+(g.clientTop+parseFloat(w.paddingTop))*p.y;f*=p.x,u*=p.y,l*=p.x,a*=p.y,f+=v,u+=b,h=A(g),g=q(h)}}return I({width:l,height:a,x:f,y:u})}function tt(t,e){const o=z(t).scrollLeft;return e?e.left+o:W(S(t)).left+o}function vt(t,e,o){o===void 0&&(o=!1);const n=t.getBoundingClientRect(),i=n.left+e.scrollLeft-(o?0:tt(t,n)),r=n.top+e.scrollTop;return{x:i,y:r}}function te(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const r=i==="fixed",s=S(n),c=e?X(e.floating):!1;if(n===s||c&&r)return o;let f={scrollLeft:0,scrollTop:0},u=E(1);const l=E(0),a=R(n);if((a||!a&&!r)&&((N(n)!=="body"||H(s))&&(f=z(n)),R(n))){const d=W(n);u=k(n),l.x=d.x+n.clientLeft,l.y=d.y+n.clientTop}const m=s&&!a&&!r?vt(s,f,!0):E(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-f.scrollLeft*u.x+l.x+m.x,y:o.y*u.y-f.scrollTop*u.y+l.y+m.y}}function ee(t){return Array.from(t.getClientRects())}function ne(t){const e=S(t),o=z(t),n=t.ownerDocument.body,i=_(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=_(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-o.scrollLeft+tt(t);const c=-o.scrollTop;return O(n).direction==="rtl"&&(s+=_(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:c}}function oe(t,e){const o=A(t),n=S(t),i=o.visualViewport;let r=n.clientWidth,s=n.clientHeight,c=0,f=0;if(i){r=i.width,s=i.height;const u=Z();(!u||u&&e==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}return{width:r,height:s,x:c,y:f}}function ie(t,e){const o=W(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=R(t)?k(t):E(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,f=i*r.x,u=n*r.y;return{width:s,height:c,x:f,y:u}}function ft(t,e,o){let n;if(e==="viewport")n=oe(t,o);else if(e==="document")n=ne(S(t));else if(C(e))n=ie(e,o);else{const i=yt(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return I(n)}function bt(t,e){const o=P(t);return o===e||!C(o)||B(o)?!1:O(o).position==="fixed"||bt(o,e)}function se(t,e){const o=e.get(t);if(o)return o;let n=U(t,[],!1).filter(c=>C(c)&&N(c)!=="body"),i=null;const r=O(t).position==="fixed";let s=r?P(t):t;for(;C(s)&&!B(s);){const c=O(s),f=J(s);!f&&c.position==="fixed"&&(i=null),(r?!f&&!i:!f&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||H(s)&&!f&&bt(t,s))?n=n.filter(l=>l!==s):i=c,s=P(s)}return e.set(t,n),n}function re(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const s=[...o==="clippingAncestors"?X(e)?[]:se(e,this._c):[].concat(o),n],c=s[0],f=s.reduce((u,l)=>{const a=ft(e,l,i);return u.top=_(a.top,u.top),u.right=Q(a.right,u.right),u.bottom=Q(a.bottom,u.bottom),u.left=_(a.left,u.left),u},ft(e,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function ce(t){const{width:e,height:o}=xt(t);return{width:e,height:o}}function le(t,e,o){const n=R(e),i=S(e),r=o==="fixed",s=W(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const f=E(0);if(n||!n&&!r)if((N(e)!=="body"||H(i))&&(c=z(e)),n){const m=W(e,!0,r,e);f.x=m.x+e.clientLeft,f.y=m.y+e.clientTop}else i&&(f.x=tt(i));const u=i&&!n&&!r?vt(i,c):E(0),l=s.left+c.scrollLeft-f.x-u.x,a=s.top+c.scrollTop-f.y-u.y;return{x:l,y:a,width:s.width,height:s.height}}function K(t){return O(t).position==="static"}function ut(t,e){if(!R(t)||O(t).position==="fixed")return null;if(e)return e(t);let o=t.offsetParent;return S(t)===o&&(o=o.ownerDocument.body),o}function At(t,e){const o=A(t);if(X(t))return o;if(!R(t)){let i=P(t);for(;i&&!B(i);){if(C(i)&&!K(i))return i;i=P(i)}return o}let n=ut(t,e);for(;n&&qt(n)&&K(n);)n=ut(n,e);return n&&B(n)&&K(n)&&!J(n)?o:n||Gt(t)||o}const ae=async function(t){const e=this.getOffsetParent||At,o=this.getDimensions,n=await o(t.floating);return{reference:le(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function fe(t){return O(t).direction==="rtl"}const ue={convertOffsetParentRelativeRectToViewportRelativeRect:te,getDocumentElement:S,getClippingRect:re,getOffsetParent:At,getElementRects:ae,getClientRects:ee,getDimensions:ce,getScale:k,isElement:C,isRTL:fe},de=Kt,me=Xt,he=Qt,pe=Ut,ge=(t,e,o)=>{const n=new Map,i={platform:ue,...o},r={...i.platform,_c:n};return It(t,e,{...i,platform:r})},xe=Tt({__name:"HTooltip",props:{placement:{type:String,default:"bottom-start"},content:{type:String,default:""},customStyles:{type:Object,default:null}},setup(t){const e=t,o=Bt(),n=ot(null),i=ot(null),r=Et(()=>{const l={bottom:["bottom","bottom-start","bottom-end"],"bottom-end":["bottom-end","bottom","bottom-start"],"bottom-start":["bottom-start","bottom","bottom-end"],"right-start":["right-start","bottom-end","bottom-start"],top:["top","top-end","top-start"]};return l[e.placement]||l.bottom}),s=()=>{const l=document.createElement("span");l.setAttribute("id",`content-${o}`),l.setAttribute("class","h-tooltip__content"),e.customStyles&&Object.assign(l.style,e.customStyles),l.innerHTML=e.content,i.value=l},c=async()=>{if(!n.value||!i.value)return;document.body.append(i.value),await kt();const{x:l,y:a}=await ge(n.value,i.value,{middleware:[de({mainAxis:5}),me({allowedPlacements:r.value}),he({limiter:pe()})]});Object.assign(i.value.style,{left:`${l}px`,top:`${a}px`})},f=()=>{var l;(l=i.value)==null||l.remove()},u=[{event:"mouseenter",action:c},{event:"mouseleave",action:f},{event:"focus",action:c},{event:"blur",action:f}];return Rt(()=>e.content,()=>{s()}),St(()=>{s(),u.forEach(l=>{var a;(a=n.value)==null||a.addEventListener(l.event,l.action)})}),Lt(()=>{f(),u.forEach(l=>{var a;(a=n.value)==null||a.removeEventListener(l.event,l.action)})}),(l,a)=>(Pt(),Dt("span",{ref_key:"tooltip",ref:n,class:"h-tooltip"},[_t(l.$slots,"default",{},void 0,!0)],512))}}),be=Mt(xe,[["__scopeId","data-v-568ebf2e"]]);export{be as _,me as a,ge as c,de as o};
