v-float 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/LICENSE +20 -20
  2. package/dist/composables/index.d.ts +2 -3
  3. package/dist/composables/index.d.ts.map +1 -1
  4. package/dist/composables/interactions/index.d.ts +3 -3
  5. package/dist/composables/interactions/index.d.ts.map +1 -1
  6. package/dist/composables/interactions/polygon.d.ts +1 -1
  7. package/dist/composables/interactions/polygon.d.ts.map +1 -1
  8. package/dist/composables/interactions/use-click.d.ts +2 -2
  9. package/dist/composables/interactions/use-click.d.ts.map +1 -1
  10. package/dist/composables/interactions/use-client-point.d.ts +180 -20
  11. package/dist/composables/interactions/use-client-point.d.ts.map +1 -1
  12. package/dist/composables/interactions/use-escape-key.d.ts +37 -4
  13. package/dist/composables/interactions/use-escape-key.d.ts.map +1 -1
  14. package/dist/composables/interactions/use-focus.d.ts +2 -2
  15. package/dist/composables/interactions/use-focus.d.ts.map +1 -1
  16. package/dist/composables/interactions/use-hover.d.ts +1 -1
  17. package/dist/composables/interactions/use-hover.d.ts.map +1 -1
  18. package/dist/composables/interactions/utils/index.d.ts +3 -3
  19. package/dist/composables/interactions/utils/index.d.ts.map +1 -1
  20. package/dist/composables/interactions/utils/tree-context.d.ts +2 -2
  21. package/dist/composables/interactions/utils/tree-context.d.ts.map +1 -1
  22. package/dist/composables/middlewares/index.d.ts +1 -1
  23. package/dist/composables/middlewares/index.d.ts.map +1 -1
  24. package/dist/composables/use-arrow.d.ts +0 -5
  25. package/dist/composables/use-arrow.d.ts.map +1 -1
  26. package/dist/composables/use-floating-tree.d.ts +72 -10
  27. package/dist/composables/use-floating-tree.d.ts.map +1 -1
  28. package/dist/composables/use-floating.d.ts +1 -1
  29. package/dist/composables/use-floating.d.ts.map +1 -1
  30. package/dist/v-float.es.js +2313 -2166
  31. package/dist/v-float.umd.js +1 -1
  32. package/package.json +2 -2
  33. package/dist/composables/use-tree.d.ts +0 -144
  34. package/dist/composables/use-tree.d.ts.map +0 -1
@@ -1 +1 @@
1
- (function(T,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(T=typeof globalThis<"u"?globalThis:T||self,c(T.VFloat={},T.Vue))})(this,(function(T,c){"use strict";var xo=Object.defineProperty;var Qt=T=>{throw TypeError(T)};var To=(T,c,$)=>c in T?xo(T,c,{enumerable:!0,configurable:!0,writable:!0,value:$}):T[c]=$;var he=(T,c,$)=>To(T,typeof c!="symbol"?c+"":c,$),lt=(T,c,$)=>c.has(T)||Qt("Cannot "+$);var at=(T,c,$)=>(lt(T,c,"read from private field"),$?$.call(T):c.get(T)),We=(T,c,$)=>c.has(T)?Qt("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(T):c.set(T,$),ct=(T,c,$,Z)=>(lt(T,c,"write to private field"),Z?Z.call(T,$):c.set(T,$),$),ut=(T,c,$)=>(lt(T,c,"access private method"),$);var xe,Te,Ce,ft;const $=["top","right","bottom","left"],Z=Math.min,re=Math.max,Le=Math.round,Oe=Math.floor,K=e=>({x:e,y:e}),Zt={left:"right",right:"left",bottom:"top",top:"bottom"},en={start:"end",end:"start"};function $e(e,t,n){return re(e,Z(t,n))}function me(e,t){return typeof e=="function"?e(t):e}function se(e){return e.split("-")[0]}function ye(e){return e.split("-")[1]}function dt(e){return e==="x"?"y":"x"}function Xe(e){return e==="y"?"height":"width"}const tn=new Set(["top","bottom"]);function ne(e){return tn.has(se(e))?"y":"x"}function Ye(e){return dt(ne(e))}function nn(e,t,n){n===void 0&&(n=!1);const o=ye(e),i=Ye(e),r=Xe(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=Se(l)),[l,Se(l)]}function on(e){const t=Se(e);return[je(e),t,je(t)]}function je(e){return e.replace(/start|end/g,t=>en[t])}const ht=["left","right"],mt=["right","left"],rn=["top","bottom"],sn=["bottom","top"];function ln(e,t,n){switch(e){case"top":case"bottom":return n?t?mt:ht:t?ht:mt;case"left":case"right":return t?rn:sn;default:return[]}}function an(e,t,n,o){const i=ye(e);let r=ln(se(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(je)))),r}function Se(e){return e.replace(/left|right|bottom|top/g,t=>Zt[t])}function cn(e){return{top:0,right:0,bottom:0,left:0,...e}}function pt(e){return typeof e!="number"?cn(e):{top:e,right:e,bottom:e,left:e}}function Me(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function gt(e,t,n){let{reference:o,floating:i}=e;const r=ne(t),l=Ye(t),a=Xe(l),f=se(t),u=r==="y",m=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,g=o[a]/2-i[a]/2;let h;switch(f){case"top":h={x:m,y:o.y-i.height};break;case"bottom":h={x:m,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-i.width,y:d};break;default:h={x:o.x,y:o.y}}switch(ye(t)){case"start":h[l]-=g*(n&&u?-1:1);break;case"end":h[l]+=g*(n&&u?-1:1);break}return h}const un=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,a=r.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:d}=gt(u,o,f),g=o,h={},w=0;for(let p=0;p<a.length;p++){const{name:E,fn:y}=a[p],{x:b,y:L,data:S,reset:C}=await y({x:m,y:d,initialPlacement:o,placement:g,strategy:i,middlewareData:h,rects:u,platform:l,elements:{reference:e,floating:t}});m=b??m,d=L??d,h={...h,[E]:{...h[E],...S}},C&&w<=50&&(w++,typeof C=="object"&&(C.placement&&(g=C.placement),C.rects&&(u=C.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:m,y:d}=gt(u,g,f)),p=-1)}return{x:m,y:d,placement:g,strategy:i,middlewareData:h}};async function Ae(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:l,elements:a,strategy:f}=e,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:d="floating",altBoundary:g=!1,padding:h=0}=me(t,e),w=pt(h),E=a[g?d==="floating"?"reference":"floating":d],y=Me(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(E)))==null||n?E:E.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:u,rootBoundary:m,strategy:f})),b=d==="floating"?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),S=await(r.isElement==null?void 0:r.isElement(L))?await(r.getScale==null?void 0:r.getScale(L))||{x:1,y:1}:{x:1,y:1},C=Me(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:L,strategy:f}):b);return{top:(y.top-C.top+w.top)/S.y,bottom:(C.bottom-y.bottom+w.bottom)/S.y,left:(y.left-C.left+w.left)/S.x,right:(C.right-y.right+w.right)/S.x}}const fn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:a,middlewareData:f}=t,{element:u,padding:m=0}=me(e,t)||{};if(u==null)return{};const d=pt(m),g={x:n,y:o},h=Ye(i),w=Xe(h),p=await l.getDimensions(u),E=h==="y",y=E?"top":"left",b=E?"bottom":"right",L=E?"clientHeight":"clientWidth",S=r.reference[w]+r.reference[h]-g[h]-r.floating[w],C=g[h]-r.reference[h],P=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let N=P?P[L]:0;(!N||!await(l.isElement==null?void 0:l.isElement(P)))&&(N=a.floating[L]||r.floating[w]);const V=S/2-C/2,R=N/2-p[w]/2-1,D=Z(d[y],R),A=Z(d[b],R),k=D,W=N-p[w]-A,F=N/2-p[w]/2+V,j=$e(k,F,W),x=!f.arrow&&ye(i)!=null&&F!==j&&r.reference[w]/2-(F<k?D:A)-p[w]/2<0,s=x?F<k?F-k:F-W:0;return{[h]:g[h]+s,data:{[h]:j,centerOffset:F-j-s,...x&&{alignmentOffset:s}},reset:x}}}),dn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:a,platform:f,elements:u}=t,{mainAxis:m=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:p=!0,...E}=me(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const y=se(i),b=ne(a),L=se(a)===a,S=await(f.isRTL==null?void 0:f.isRTL(u.floating)),C=g||(L||!p?[Se(a)]:on(a)),P=w!=="none";!g&&P&&C.push(...an(a,p,w,S));const N=[a,...C],V=await Ae(t,E),R=[];let D=((o=r.flip)==null?void 0:o.overflows)||[];if(m&&R.push(V[y]),d){const F=nn(i,l,S);R.push(V[F[0]],V[F[1]])}if(D=[...D,{placement:i,overflows:R}],!R.every(F=>F<=0)){var A,k;const F=(((A=r.flip)==null?void 0:A.index)||0)+1,j=N[F];if(j&&(!(d==="alignment"?b!==ne(j):!1)||D.every(v=>ne(v.placement)===b?v.overflows[0]>0:!0)))return{data:{index:F,overflows:D},reset:{placement:j}};let x=(k=D.filter(s=>s.overflows[0]<=0).sort((s,v)=>s.overflows[1]-v.overflows[1])[0])==null?void 0:k.placement;if(!x)switch(h){case"bestFit":{var W;const s=(W=D.filter(v=>{if(P){const H=ne(v.placement);return H===b||H==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(H=>H>0).reduce((H,Y)=>H+Y,0)]).sort((v,H)=>v[1]-H[1])[0])==null?void 0:W[0];s&&(x=s);break}case"initialPlacement":x=a;break}if(i!==x)return{reset:{placement:x}}}return{}}}};function vt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wt(e){return $.some(t=>e[t]>=0)}const hn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=me(e,t);switch(o){case"referenceHidden":{const r=await Ae(t,{...i,elementContext:"reference"}),l=vt(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:wt(l)}}}case"escaped":{const r=await Ae(t,{...i,altBoundary:!0}),l=vt(r,n.floating);return{data:{escapedOffsets:l,escaped:wt(l)}}}default:return{}}}}},mn=new Set(["left","top"]);async function pn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=se(n),a=ye(n),f=ne(n)==="y",u=mn.has(l)?-1:1,m=r&&f?-1:1,d=me(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof w=="number"&&(h=a==="end"?w*-1:w),f?{x:h*m,y:g*u}:{x:g*u,y:h*m}}const gn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:a}=t,f=await pn(t,e);return l===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:l}}}}},vn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:a={fn:E=>{let{x:y,y:b}=E;return{x:y,y:b}}},...f}=me(e,t),u={x:n,y:o},m=await Ae(t,f),d=ne(se(i)),g=dt(d);let h=u[g],w=u[d];if(r){const E=g==="y"?"top":"left",y=g==="y"?"bottom":"right",b=h+m[E],L=h-m[y];h=$e(b,h,L)}if(l){const E=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=w+m[E],L=w-m[y];w=$e(b,w,L)}const p=a.fn({...t,[g]:h,[d]:w});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[g]:r,[d]:l}}}}}};function Ne(){return typeof window<"u"}function pe(e){return yt(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){var t;return(t=(yt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yt(e){return Ne()?e instanceof Node||e instanceof _(e).Node:!1}function z(e){return Ne()?e instanceof Element||e instanceof _(e).Element:!1}function J(e){return Ne()?e instanceof HTMLElement||e instanceof _(e).HTMLElement:!1}function bt(e){return!Ne()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _(e).ShadowRoot}const wn=new Set(["inline","contents"]);function be(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!wn.has(i)}const yn=new Set(["table","td","th"]);function bn(e){return yn.has(pe(e))}const En=[":popover-open",":modal"];function De(e){return En.some(t=>{try{return e.matches(t)}catch{return!1}})}const xn=["transform","translate","scale","rotate","perspective"],Tn=["transform","translate","scale","rotate","perspective","filter"],Cn=["paint","layout","strict","content"];function _e(e){const t=ze(),n=z(e)?U(e):e;return xn.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Tn.some(o=>(n.willChange||"").includes(o))||Cn.some(o=>(n.contain||"").includes(o))}function Pn(e){let t=oe(e);for(;J(t)&&!ge(t);){if(_e(t))return t;if(De(t))return null;t=oe(t)}return null}function ze(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ln=new Set(["html","body","#document"]);function ge(e){return Ln.has(pe(e))}function U(e){return _(e).getComputedStyle(e)}function Ve(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oe(e){if(pe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bt(e)&&e.host||G(e);return bt(t)?t.host:t}function Et(e){const t=oe(e);return ge(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&be(t)?t:Et(t)}function Ee(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Et(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=_(i);if(r){const a=Ue(l);return t.concat(l,l.visualViewport||[],be(i)?i:[],a&&n?Ee(a):[])}return t.concat(i,Ee(i,[],n))}function Ue(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xt(e){const t=U(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=J(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,a=Le(n)!==r||Le(o)!==l;return a&&(n=r,o=l),{width:n,height:o,$:a}}function qe(e){return z(e)?e:e.contextElement}function ve(e){const t=qe(e);if(!J(t))return K(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=xt(t);let l=(r?Le(n.width):n.width)/o,a=(r?Le(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const On=K(0);function Tt(e){const t=_(e);return!ze()||!t.visualViewport?On:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_(e)?!1:t}function le(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=qe(e);let l=K(1);t&&(o?z(o)&&(l=ve(o)):l=ve(e));const a=Sn(r,n,o)?Tt(r):K(0);let f=(i.left+a.x)/l.x,u=(i.top+a.y)/l.y,m=i.width/l.x,d=i.height/l.y;if(r){const g=_(r),h=o&&z(o)?_(o):o;let w=g,p=Ue(w);for(;p&&o&&h!==w;){const E=ve(p),y=p.getBoundingClientRect(),b=U(p),L=y.left+(p.clientLeft+parseFloat(b.paddingLeft))*E.x,S=y.top+(p.clientTop+parseFloat(b.paddingTop))*E.y;f*=E.x,u*=E.y,m*=E.x,d*=E.y,f+=L,u+=S,w=_(p),p=Ue(w)}}return Me({width:m,height:d,x:f,y:u})}function Re(e,t){const n=Ve(e).scrollLeft;return t?t.left+n:le(G(e)).left+n}function Ct(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Re(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function Mn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",l=G(o),a=t?De(t.floating):!1;if(o===l||a&&r)return n;let f={scrollLeft:0,scrollTop:0},u=K(1);const m=K(0),d=J(o);if((d||!d&&!r)&&((pe(o)!=="body"||be(l))&&(f=Ve(o)),J(o))){const h=le(o);u=ve(o),m.x=h.x+o.clientLeft,m.y=h.y+o.clientTop}const g=l&&!d&&!r?Ct(l,f):K(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-f.scrollLeft*u.x+m.x+g.x,y:n.y*u.y-f.scrollTop*u.y+m.y+g.y}}function An(e){return Array.from(e.getClientRects())}function Nn(e){const t=G(e),n=Ve(e),o=e.ownerDocument.body,i=re(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=re(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Re(e);const a=-n.scrollTop;return U(o).direction==="rtl"&&(l+=re(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:a}}const Pt=25;function Dn(e,t){const n=_(e),o=G(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,a=0,f=0;if(i){r=i.width,l=i.height;const m=ze();(!m||m&&t==="fixed")&&(a=i.offsetLeft,f=i.offsetTop)}const u=Re(o);if(u<=0){const m=o.ownerDocument,d=m.body,g=getComputedStyle(d),h=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,w=Math.abs(o.clientWidth-d.clientWidth-h);w<=Pt&&(r-=w)}else u<=Pt&&(r+=u);return{width:r,height:l,x:a,y:f}}const Vn=new Set(["absolute","fixed"]);function Rn(e,t){const n=le(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=J(e)?ve(e):K(1),l=e.clientWidth*r.x,a=e.clientHeight*r.y,f=i*r.x,u=o*r.y;return{width:l,height:a,x:f,y:u}}function Lt(e,t,n){let o;if(t==="viewport")o=Dn(e,n);else if(t==="document")o=Nn(G(e));else if(z(t))o=Rn(t,n);else{const i=Tt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Me(o)}function Ot(e,t){const n=oe(e);return n===t||!z(n)||ge(n)?!1:U(n).position==="fixed"||Ot(n,t)}function kn(e,t){const n=t.get(e);if(n)return n;let o=Ee(e,[],!1).filter(a=>z(a)&&pe(a)!=="body"),i=null;const r=U(e).position==="fixed";let l=r?oe(e):e;for(;z(l)&&!ge(l);){const a=U(l),f=_e(l);!f&&a.position==="fixed"&&(i=null),(r?!f&&!i:!f&&a.position==="static"&&!!i&&Vn.has(i.position)||be(l)&&!f&&Ot(e,l))?o=o.filter(m=>m!==l):i=a,l=oe(l)}return t.set(e,o),o}function Fn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?De(t)?[]:kn(t,this._c):[].concat(n),o],a=l[0],f=l.reduce((u,m)=>{const d=Lt(t,m,i);return u.top=re(d.top,u.top),u.right=Z(d.right,u.right),u.bottom=Z(d.bottom,u.bottom),u.left=re(d.left,u.left),u},Lt(t,a,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Hn(e){const{width:t,height:n}=xt(e);return{width:t,height:n}}function Bn(e,t,n){const o=J(t),i=G(t),r=n==="fixed",l=le(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const f=K(0);function u(){f.x=Re(i)}if(o||!o&&!r)if((pe(t)!=="body"||be(i))&&(a=Ve(t)),o){const h=le(t,!0,r,t);f.x=h.x+t.clientLeft,f.y=h.y+t.clientTop}else i&&u();r&&!o&&i&&u();const m=i&&!o&&!r?Ct(i,a):K(0),d=l.left+a.scrollLeft-f.x-m.x,g=l.top+a.scrollTop-f.y-m.y;return{x:d,y:g,width:l.width,height:l.height}}function Ke(e){return U(e).position==="static"}function St(e,t){if(!J(e)||U(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function Mt(e,t){const n=_(e);if(De(e))return n;if(!J(e)){let i=oe(e);for(;i&&!ge(i);){if(z(i)&&!Ke(i))return i;i=oe(i)}return n}let o=St(e,t);for(;o&&bn(o)&&Ke(o);)o=St(o,t);return o&&ge(o)&&Ke(o)&&!_e(o)?n:o||Pn(e)||n}const In=async function(e){const t=this.getOffsetParent||Mt,n=this.getDimensions,o=await n(e.floating);return{reference:Bn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Wn(e){return U(e).direction==="rtl"}const $n={convertOffsetParentRelativeRectToViewportRelativeRect:Mn,getDocumentElement:G,getClippingRect:Fn,getOffsetParent:Mt,getElementRects:In,getClientRects:An,getDimensions:Hn,getScale:ve,isElement:z,isRTL:Wn};function At(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Xn(e,t){let n=null,o;const i=G(e);function r(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function l(a,f){a===void 0&&(a=!1),f===void 0&&(f=1),r();const u=e.getBoundingClientRect(),{left:m,top:d,width:g,height:h}=u;if(a||t(),!g||!h)return;const w=Oe(d),p=Oe(i.clientWidth-(m+g)),E=Oe(i.clientHeight-(d+h)),y=Oe(m),L={rootMargin:-w+"px "+-p+"px "+-E+"px "+-y+"px",threshold:re(0,Z(1,f))||1};let S=!0;function C(P){const N=P[0].intersectionRatio;if(N!==f){if(!S)return l();N?l(!1,N):o=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!At(u,e.getBoundingClientRect())&&l(),S=!1}try{n=new IntersectionObserver(C,{...L,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,L)}n.observe(e)}return l(!0),r}function Yn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,u=qe(e),m=i||r?[...u?Ee(u):[],...Ee(t)]:[];m.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const d=u&&a?Xn(u,n):null;let g=-1,h=null;l&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var L;(L=h)==null||L.observe(t)})),n()}),u&&!f&&h.observe(u),h.observe(t));let w,p=f?le(e):null;f&&E();function E(){const y=le(e);p&&!At(p,y)&&n(),p=y,w=requestAnimationFrame(E)}return n(),()=>{var y;m.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,f&&cancelAnimationFrame(w)}}const jn=gn,_n=vn,zn=dn,Un=hn,qn=fn,Kn=(e,t,n)=>{const o=new Map,i={platform:$n,...n},r={...i.platform,_c:o};return un(e,t,{...i,platform:r})};function Gn(e){return{name:"arrow",options:e,fn(t){const n=c.toValue(e.element);return n==null?{}:qn({element:n,padding:e.padding}).fn(t)}}}function Ge(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:r=!0,open:l=c.ref(!1)}=n,a=C=>{l.value=C},f=c.computed(()=>c.toValue(n.placement)??"bottom"),u=c.computed(()=>c.toValue(n.strategy)??"absolute"),m=c.ref(0),d=c.ref(0),g=c.ref(f.value),h=c.ref(u.value),w=c.shallowRef({}),p=c.ref(!1),E=c.ref(null),y=c.computed(()=>{const C=i||[];return E.value&&!C.some(N=>N.name==="arrow")?[...C,Gn({element:E})]:C}),b=async()=>{if(!e.value||!t.value)return;const C=await Kn(e.value,t.value,{placement:f.value,strategy:u.value,middleware:y.value});m.value=C.x,d.value=C.y,g.value=C.placement,h.value=C.strategy,w.value=C.middlewareData,p.value=l.value};c.watch([f,u],()=>{l.value&&b()});let L;c.watch([e,t,l],([C,P,N])=>{!N||!C||!P||(r&&(L=Yn(C,P,b,typeof r=="object"?r:void 0)),c.onWatcherCleanup(()=>{L==null||L(),L=void 0}))},{immediate:!0}),c.onScopeDispose(()=>L==null?void 0:L()),c.watch(l,C=>{C||(p.value=!1)});const S=c.ref({position:u.value,left:"0",top:"0"});return c.watch([m,d,()=>c.toValue(o)],([C,P,N])=>{const V=t.value;if(!V)return;const R={position:h.value,left:"0",top:"0"},D=Nt(V,C),A=Nt(V,P);N?S.value={...R,transform:`translate(${D}px, ${A}px)`,...Dt(V)>=1.5&&{"will-change":"transform"}}:S.value={...R,left:`${D}px`,top:`${A}px`}},{immediate:!0}),{x:m,y:d,strategy:h,placement:g,middlewareData:w,isPositioned:p,floatingStyles:S,update:b,refs:{anchorEl:e,floatingEl:t,arrowEl:E},open:l,setOpen:a}}function Nt(e,t){const n=Dt(e);return Math.round(t*n)/n}function Dt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jn(e,t,n={}){const{offset:o="-4px",padding:i}=n,{middlewareData:r,placement:l,refs:a}=t;c.watch(e,d=>{a.arrowEl.value=d});const f=c.computed(()=>{var d;return((d=r.value.arrow)==null?void 0:d.x)??0}),u=c.computed(()=>{var d;return((d=r.value.arrow)==null?void 0:d.y)??0}),m=c.computed(()=>{if(!(e.value||a.arrowEl.value)||!r.value.arrow)return{};const g=c.toValue(l).split("-")[0],h=f.value,w=u.value;return g==="bottom"?{"inset-inline-start":`${h}px`,"inset-block-start":o}:g==="top"?{"inset-inline-start":`${h}px`,"inset-block-end":o}:g==="right"?{"inset-block-start":`${w}px`,"inset-inline-start":o}:g==="left"?{"inset-block-start":`${w}px`,"inset-inline-end":o}:{}});return{arrowX:f,arrowY:u,arrowStyles:m}}let Qn=0;function Zn(){return`vfloat-id-${Qn++}`}function Vt(e){return typeof e=="object"&&e instanceof HTMLElement}function Rt(e){return e!==null&&typeof e=="object"&&"data"in e&&"id"in e&&"children"in e&&"parent"in e}function ke(e){return Rt(e)?{floatingContext:e.data,treeContext:e}:{floatingContext:e,treeContext:null}}function q(e,t){if(!t)return!1;if(typeof t=="object"&&t!==null&&"contextElement"in t){const n=t.contextElement;return n instanceof Element?n.contains(e):!1}return t instanceof Element?t.contains(e):!1}function Fe(e,t){for(const n of e.children.value)if(n.data.open.value){if(q(t,n.data.refs.anchorEl.value)||q(t,n.data.refs.floatingEl.value))return n;const o=Fe(n,t);if(o)return o}return null}function He(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function Je(e){return!e||!(e instanceof HTMLElement)?!1:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable&&e.contentEditable!=="false"}function Qe(e){const t=e.target;return t instanceof HTMLElement?t.tagName==="BUTTON"||t.tagName==="INPUT"&&t.getAttribute("type")==="button"||t.getAttribute("role")==="button":!1}function Ze(e){return Je(e)}function kt(e){return e instanceof Element&&e instanceof HTMLElement}function Ft(e){return typeof e=="object"&&e!==null&&"contextElement"in e}function et(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function Ht(e,t){const n=t.getBoundingClientRect(),o=t.offsetWidth-t.clientWidth,i=t.offsetHeight-t.clientHeight,r=e.clientX-n.left,l=e.clientY-n.top;if(o>0){const a=t.clientWidth;if(r>=a&&r<=t.offsetWidth)return!0}if(i>0){const a=t.clientHeight;if(l>=a&&l<=t.offsetHeight)return!0}return!1}function tt(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function nt(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Bt(e){return typeof(e==null?void 0:e.matches)!="function"?!1:e.matches(":focus-visible")}function Be(e,t){return e.contains(t)}function It(e){return e.target}function ot(){return typeof performance<"u"?performance.now():Date.now()}function it(e){e!==-1&&clearTimeout(e)}function Wt(e){return e.children.value.some(t=>t.data.open.value||Wt(t))}function eo(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function $t(e,t){const[n,o]=e;let i=!1;const r=t.length;for(let l=0,a=r-1;l<r;a=l++){const[f,u]=t[l]||[0,0],[m,d]=t[a]||[0,0];u>=o!=d>=o&&n<=(m-f)*(o-u)/(d-u)+f&&(i=!i)}return i}function to(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e;let i=-1,r=!1;function l(f,u,m,d,g){const h=ot(),w=h-g;if(m===null||d===null||w===0)return{speed:null,lastX:f,lastY:u,lastCursorTime:h};const p=f-m,E=u-d;return{speed:Math.sqrt(p*p+E*E)/w,lastX:f,lastY:u,lastCursorTime:h}}const a=function(u){const{x:m,y:d,placement:g,elements:h,buffer:w,onClose:p,nodeId:E,tree:y}=u,b=c.computed(()=>{const P=h.domReference;return Vt(P)?P:(P==null?void 0:P.contextElement)??null});let L=null,S=null,C=ot();return function(N){var _t,zt,Ut,qt,Kt,Gt,Jt;function V(){it(i),i=-1,p()}if(it(i),i=-1,!h.domReference||!h.floating||g==null||m==null||d==null)return;const{clientX:R,clientY:D}=N,A=[R,D],k=It(N),W=N.type==="mouseleave",F=h.floating&&Be(h.floating,k),j=b.value&&Be(b.value,k),x=(_t=b.value)==null?void 0:_t.getBoundingClientRect(),s=(zt=h.floating)==null?void 0:zt.getBoundingClientRect(),v=g.split("-")[0],H=m>((s==null?void 0:s.right)??0)-((s==null?void 0:s.width)??0)/2,Y=d>((s==null?void 0:s.bottom)??0)-((s==null?void 0:s.height)??0)/2,ee=x?eo(A,x):!1,O=((s==null?void 0:s.width)??0)>((x==null?void 0:x.width)??0),I=((s==null?void 0:s.height)??0)>((x==null?void 0:x.height)??0),ae=((Ut=O?x:s)==null?void 0:Ut.left)??0,te=((qt=O?x:s)==null?void 0:qt.right)??0,ce=((Kt=I?x:s)==null?void 0:Kt.top)??0,ue=((Gt=I?x:s)==null?void 0:Gt.bottom)??0;if(F&&(r=!0,!W))return;if(j&&(r=!1),j&&!W){r=!0;return}if(W&&Vt(N.relatedTarget)&&h.floating&&Be(h.floating,N.relatedTarget))return;if(y&&E){const B=y.nodes.get(E);if(B&&Wt(B))return}if(v==="top"&&d>=((x==null?void 0:x.bottom)??0)-1||v==="bottom"&&d<=((x==null?void 0:x.top)??0)+1||v==="left"&&m>=((x==null?void 0:x.right)??0)-1||v==="right"&&m<=((x==null?void 0:x.left)??0)+1)return V();let ie=[];switch(v){case"top":ie=[[ae,((x==null?void 0:x.top)??0)+1],[ae,((s==null?void 0:s.bottom)??0)-1],[te,((s==null?void 0:s.bottom)??0)-1],[te,((x==null?void 0:x.top)??0)+1]];break;case"bottom":ie=[[ae,((s==null?void 0:s.top)??0)+1],[ae,((x==null?void 0:x.bottom)??0)-1],[te,((x==null?void 0:x.bottom)??0)-1],[te,((s==null?void 0:s.top)??0)+1]];break;case"left":ie=[[((s==null?void 0:s.right)??0)-1,ue],[((s==null?void 0:s.right)??0)-1,ce],[((x==null?void 0:x.left)??0)+1,ce],[((x==null?void 0:x.left)??0)+1,ue]];break;case"right":ie=[[((x==null?void 0:x.right)??0)-1,ue],[((x==null?void 0:x.right)??0)-1,ce],[((s==null?void 0:s.left)??0)+1,ce],[((s==null?void 0:s.left)??0)+1,ue]];break}function Pe([B,X]){const M=w;switch(v){case"top":{const fe=[O?B+M/2:H?B+M*4:B-M*4,X+M+1],de=[O?B-M/2:H?B+M*4:B-M*4,X+M+1],we=[[(s==null?void 0:s.left)??0,H||O?((s==null?void 0:s.bottom)??0)-M:(s==null?void 0:s.top)??0],[(s==null?void 0:s.right)??0,H?O?((s==null?void 0:s.bottom)??0)-M:(s==null?void 0:s.top)??0:((s==null?void 0:s.bottom)??0)-M]];return[fe,de,...we]}case"bottom":{const fe=[O?B+M/2:H?B+M*4:B-M*4,X-M],de=[O?B-M/2:H?B+M*4:B-M*4,X-M],we=[[(s==null?void 0:s.left)??0,H||O?((s==null?void 0:s.top)??0)+M:(s==null?void 0:s.bottom)??0],[(s==null?void 0:s.right)??0,H?O?((s==null?void 0:s.top)??0)+M:(s==null?void 0:s.bottom)??0:((s==null?void 0:s.top)??0)+M]];return[fe,de,...we]}case"left":{const fe=[B+M+1,I?X+M/2:Y?X+M*4:X-M*4],de=[B+M+1,I?X-M/2:Y?X+M*4:X-M*4];return[...[[Y||I?((s==null?void 0:s.right)??0)-M:(s==null?void 0:s.left)??0,(s==null?void 0:s.top)??0],[Y?I?((s==null?void 0:s.right)??0)-M:(s==null?void 0:s.left)??0:((s==null?void 0:s.right)??0)-M,(s==null?void 0:s.bottom)??0]],fe,de]}case"right":{const fe=[B-M,I?X+M/2:Y?X+M*4:X-M*4],de=[B-M,I?X-M/2:Y?X+M*4:X-M*4],we=[[Y||I?((s==null?void 0:s.left)??0)+M:(s==null?void 0:s.right)??0,(s==null?void 0:s.top)??0],[Y?I?((s==null?void 0:s.left)??0)+M:(s==null?void 0:s.right)??0:((s==null?void 0:s.left)??0)+M,(s==null?void 0:s.bottom)??0]];return[fe,de,...we]}}}const Ie=Pe([m,d]);if((Jt=e.onPolygonChange)==null||Jt.call(e,Ie),!$t(A,ie)){if($t(A,Ie)){if(!r&&o){const B=l(N.clientX,N.clientY,L,S,C);L=B.lastX,S=B.lastY,C=B.lastCursorTime,B.speed!==null&&B.speed<.1&&(i=window.setTimeout(V,40))}return}if(r&&!ee)return V();V()}}};return a.__options={blockPointerEvents:n},a}const Xt=10;function no(e,t,n){const{delay:o}=n,i=c.computed(()=>{const u=c.toValue(o);return(typeof u=="number"?u:u.open)??0}),r=c.computed(()=>{const u=c.toValue(o);return(typeof u=="number"?u:u.close)??0});let l,a;const f=()=>{clearTimeout(l),clearTimeout(a)};return c.onScopeDispose(f),{show:u=>{f();const m=u??i.value;m===0?e():l=setTimeout(e,m)},hide:u=>{f();const m=u??r.value;m===0?t():a=setTimeout(t,m)},showDelay:i,hideDelay:r,clearTimeouts:f}}function oo(e,t={}){const{floatingContext:n,treeContext:o}=ke(e),{open:i,setOpen:r,refs:{anchorEl:l,floatingEl:a}}=n,{enabled:f=!0,delay:u=0,restMs:m=0,mouseOnly:d=!1,safePolygon:g=!1}=t,h=c.computed(()=>c.toValue(f)),w=c.computed(()=>c.toValue(m)),p=c.computed(()=>{const v=l.value;return!v||v instanceof HTMLElement?v:v.contextElement??null}),{hide:E,show:y,showDelay:b,clearTimeouts:L}=no(()=>{i.value||r(!0)},()=>{i.value&&r(!1)},{delay:u});let S=null,C;const P=c.computed(()=>b.value===0&&w.value>0);function N(v){if(!h.value||!D(v)||!P.value||!S)return;const H={x:v.clientX,y:v.clientY},Y=Math.abs(H.x-S.x),ee=Math.abs(H.y-S.y);(Y>Xt||ee>Xt)&&(S=H,clearTimeout(C),C=setTimeout(()=>{y(0)},w.value))}function V(v){!h.value||!D(v)||!P.value||(S={x:v.clientX,y:v.clientY},C=setTimeout(()=>{y(0)},w.value))}function R(){clearTimeout(C),S=null}c.watchPostEffect(()=>{const v=p.value;!v||!h.value||!P.value||(v.addEventListener("pointerenter",V),v.addEventListener("pointermove",N),v.addEventListener("pointerleave",R),c.onWatcherCleanup(()=>{v.removeEventListener("pointerenter",V),v.removeEventListener("pointermove",N),v.removeEventListener("pointerleave",R)}))}),c.onScopeDispose(()=>{clearTimeout(C)});function D(v){return c.toValue(d)?v.pointerType==="mouse":!0}function A(v){!h.value||!D(v)||P.value||(F(),y())}function k(v){!h.value||!D(v)||(L(),F())}let W=null;function F(){W&&(document.removeEventListener("pointermove",W),W=null);const v=x.value;v!=null&&v.onPolygonChange&&v.onPolygonChange([])}const j=c.computed(()=>!!c.toValue(g)),x=c.computed(()=>{const v=c.toValue(g);if(typeof v=="object"&&v)return v;if(v===!0)return{}});function s(v){var O;if(!h.value||!D(v))return;const{clientX:H,clientY:Y}=v,ee=v.relatedTarget;if(j.value)setTimeout(()=>{var ue;F();const I=p.value,ae=a.value;if(!I||!ae){E();return}let te,ce;if(o){te=new Map;const ie=Pe=>{te.set(Pe.id,Pe);for(const Ie of Pe.children.value)ie(Ie)};ie(o),ce=o.id}W=to(x.value)({x:H,y:Y,placement:n.placement.value,elements:{domReference:I,floating:ae},buffer:((ue=x.value)==null?void 0:ue.buffer)??1,onClose:()=>{F(),E()},nodeId:ce,tree:te?{nodes:te}:void 0}),W&&document.addEventListener("pointermove",W)},0);else{if(o){if(!io(o,ee))return}else if((O=a.value)!=null&&O.contains(ee))return;E()}}c.watchPostEffect(()=>{const v=p.value;!v||!h.value||(v.addEventListener("pointerenter",A),v.addEventListener("pointerleave",s),c.onWatcherCleanup(()=>{v.removeEventListener("pointerenter",A),v.removeEventListener("pointerleave",s)}))}),c.watchPostEffect(()=>{const v=a.value;!v||!h.value||(v.addEventListener("pointerenter",k),v.addEventListener("pointerleave",s),c.onWatcherCleanup(()=>{v.removeEventListener("pointerenter",k),v.removeEventListener("pointerleave",s)}))}),c.onScopeDispose(()=>{F()})}function io(e,t){return t?!(q(t,e.data.refs.anchorEl.value)||q(t,e.data.refs.floatingEl.value)||Fe(e,t)):!0}function ro(e){return c.getCurrentScope()?(c.onScopeDispose(e),!0):!1}const so=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const lo=Object.prototype.toString,ao=e=>lo.call(e)==="[object Object]";function rt(e){return Array.isArray(e)?e:[e]}function co(e,t,n){return c.watch(e,t,{...n,immediate:!0})}const uo=so?window:void 0;function fo(e){var t;const n=c.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function Q(...e){const t=[],n=()=>{t.forEach(a=>a()),t.length=0},o=(a,f,u,m)=>(a.addEventListener(f,u,m),()=>a.removeEventListener(f,u,m)),i=c.computed(()=>{const a=rt(c.toValue(e[0])).filter(f=>f!=null);return a.every(f=>typeof f!="string")?a:void 0}),r=co(()=>{var a,f;return[(f=(a=i.value)==null?void 0:a.map(u=>fo(u)))!=null?f:[uo].filter(u=>u!=null),rt(c.toValue(i.value?e[1]:e[0])),rt(c.unref(i.value?e[2]:e[1])),c.toValue(i.value?e[3]:e[2])]},([a,f,u,m])=>{if(n(),!(a!=null&&a.length)||!(f!=null&&f.length)||!(u!=null&&u.length))return;const d=ao(m)?{...m}:m;t.push(...a.flatMap(g=>f.flatMap(h=>u.map(w=>o(g,h,w,d)))))},{flush:"post"}),l=()=>{r(),n()};return ro(n),l}function ho(e,t={}){const{floatingContext:n,treeContext:o}=ke(e),{open:i,setOpen:r,refs:{floatingEl:l,anchorEl:a}}=n,{enabled:f=!0,requireFocusVisible:u=!0}=t,m=c.computed(()=>a.value?a.value instanceof HTMLElement?a.value:a.value.contextElement:null);let d=!1,g=!0,h;Q(window,"blur",()=>{!i.value&&m.value&&m.value===document.activeElement&&(d=!0)}),Q(window,"focus",()=>{d=!1}),c.onMounted(()=>{tt()&&nt()&&(Q(window,"keydown",()=>{g=!0},{capture:!0}),Q(window,"pointerdown",()=>{g=!1},{capture:!0}))});function w(E){if(d){d=!1;return}const y=E.target;if(c.toValue(u)&&y){if(tt()&&nt()&&!E.relatedTarget){if(!g&&!Je(y))return}else if(!Bt(y))return}r(!0)}function p(E){clearTimeout(h),h=window.setTimeout(()=>{var L;const b=(((L=m.value)==null?void 0:L.ownerDocument)??document).activeElement;if(!(!E.relatedTarget&&b===m.value)){if(o){if(b&&mo(o,b))return}else if(l.value&&b&&l.value.contains(b))return;r(!1)}},0)}c.watchPostEffect(()=>{if(!c.toValue(f))return;const E=m.value;!E||!(E instanceof HTMLElement)||(E.addEventListener("focus",w),E.addEventListener("blur",p),c.onWatcherCleanup(()=>{E.removeEventListener("focus",w),E.removeEventListener("blur",p)}))}),c.onScopeDispose(()=>{clearTimeout(h)})}function mo(e,t){return q(t,e.data.refs.anchorEl.value)||q(t,e.data.refs.floatingEl.value)?!0:Yt(e,t)!==null}function Yt(e,t){for(const n of e.children.value)if(n.data.open.value){if(q(t,n.data.refs.anchorEl.value)||q(t,n.data.refs.floatingEl.value))return n;const o=Yt(n,t);if(o)return o}return null}function po(e,t={}){const{floatingContext:n,treeContext:o}=ke(e),{open:i,setOpen:r,refs:l}=n,{enabled:a=!0,event:f="click",toggle:u=!0,ignoreMouse:m=!1,ignoreKeyboard:d=!1,ignoreTouch:g=!1,outsideClick:h=!1,outsideEvent:w="pointerdown",outsideCapture:p=!0,onOutsideClick:E,preventScrollbarClick:y=!0,handleDragEvents:b=!0}=t;let L,S=!1,C=!1,P=!1;const N=c.computed(()=>c.toValue(a)),V=c.computed(()=>c.toValue(h)),R=c.computed(()=>{const O=l.anchorEl.value;return O?O instanceof HTMLElement?O:Ft(O)&&O.contextElement instanceof HTMLElement?O.contextElement:null:null}),D=c.computed(()=>l.floatingEl.value);function A(){P=!0;try{i.value?c.toValue(u)&&r(!1):r(!0)}finally{Promise.resolve().then(()=>{P=!1})}}function k(){L=void 0,S=!1,C=!1}function W(O){L=O.pointerType}function F(O){O.button===0&&c.toValue(f)!=="click"&&(ee(L)||A())}function j(){if(c.toValue(f)==="mousedown"&&L){k();return}if(ee(L)){k();return}A(),k()}function x(O){if(L=void 0,O.defaultPrevented||c.toValue(d)||Qe(O))return;const I=R.value;I&&(O.key===" "&&!Ze(I)&&(O.preventDefault(),S=!0),O.key==="Enter"&&A())}function s(O){const I=R.value;I&&(O.defaultPrevented||c.toValue(d)||Qe(O)||Ze(I)||O.key===" "&&S&&(S=!1,A()))}function v(O){if(!N.value||!V.value||!i.value)return;if(c.toValue(w)==="click"&&c.toValue(b)&&C){C=!1;return}if(P)return;const I=O.target;if(I&&!(c.toValue(y)&&kt(I)&&D.value&&Ht(O,I))){if(o){if(!go(o,I))return}else if(et(O,R.value)||et(O,D.value))return;E?E(O,n):r(!1)}}function H(){C=!0}function Y(){setTimeout(()=>{C=!1},0)}function ee(O){return!!(He(O,!0)&&c.toValue(m)||O==="touch"&&c.toValue(g))}c.watchPostEffect(()=>{const O=R.value;!N.value||!O||(O.addEventListener("pointerdown",W),O.addEventListener("mousedown",F),O.addEventListener("click",j),O.addEventListener("keydown",x),O.addEventListener("keyup",s),c.onWatcherCleanup(()=>{O.removeEventListener("pointerdown",W),O.removeEventListener("mousedown",F),O.removeEventListener("click",j),O.removeEventListener("keydown",x),O.removeEventListener("keyup",s),k()}))}),Q(()=>N.value&&V.value?document:null,()=>c.toValue(w),v,{capture:c.toValue(p)}),Q(()=>N.value&&V.value&&c.toValue(b)?D.value:null,"mousedown",H,{capture:!0}),Q(()=>N.value&&V.value&&c.toValue(b)?D.value:null,"mouseup",Y,{capture:!0})}function go(e,t){return!(q(t,e.data.refs.anchorEl.value)||q(t,e.data.refs.floatingEl.value)||Fe(e,t))}function vo(e,t,n={}){const{open:o,refs:i}=t;let r;const l=c.ref({x:null,y:null}),a=c.computed(()=>c.toValue(n.axis??"both")),f=c.computed(()=>c.toValue(n.enabled??!0)),u=c.computed(()=>c.toValue(n.x??null)),m=c.computed(()=>c.toValue(n.y??null)),d=(p,E)=>{l.value={x:p,y:E},o.value&&(i.anchorEl.value=wo(e.value,a.value,l.value))};c.watchEffect(()=>{const p=u.value,E=m.value;f.value&&p!=null&&E!=null&&d(p,E)});const g=p=>{r=p.pointerType,d(p.clientX,p.clientY)},h=p=>{r=p.pointerType,!o.value&&He(r,!0)&&d(p.clientX,p.clientY)},w=p=>{o.value&&He(r,!0)&&d(p.clientX,p.clientY)};return c.watchEffect(()=>{if(u.value!=null||m.value!=null)return;const p=e.value;!p||!f.value||(p.addEventListener("pointerenter",h),p.addEventListener("pointerdown",g),p.addEventListener("pointermove",w),c.onWatcherCleanup(()=>{p==null||p.removeEventListener("pointerenter",h),p==null||p.removeEventListener("pointerdown",g),p==null||p.removeEventListener("pointermove",w)}))}),{coordinates:c.readonly(l),updatePosition:d}}function wo(e,t,n){let o=null,i=null;const r=e;return{contextElement:r||void 0,getBoundingClientRect:()=>{const l=(r==null?void 0:r.getBoundingClientRect())??{width:0,height:0,x:0,y:0},a=t==="x"||t==="both",f=t==="y"||t==="both";let u=0,m=0,d=l.x,g=l.y;return r&&(o==null&&n.x!=null&&a&&(o=l.x-n.x),i==null&&n.y!=null&&f&&(i=l.y-n.y),d-=o||0,g-=i||0),a&&n.x!=null?d=n.x:(o=null,u=l.width),f&&n.y!=null?g=n.y:(i=null,m=l.height),t==="both"&&(u=0,m=0),{width:u,height:m,x:d,y:g,top:g,right:d+u,bottom:g+m,left:d}}}}function yo(e){const{enabled:t=!0,onEscape:n,capture:o}=e,{isComposing:i}=bo();Q(document,"keydown",r=>{r.key!=="Escape"||!c.toValue(t)||i()||n(r)},o)}function bo(){const e=c.ref(!1);return Q(document,"compositionstart",()=>{e.value=!0}),Q(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}class st{constructor(t,n=null,o={},i=!1){he(this,"id");he(this,"data");he(this,"parent");he(this,"children");We(this,xe);this.id=o.id??Zn(),this.data=t,this.parent=c.shallowRef(n),this.children=c.shallowRef([]),ct(this,xe,i)}addChild(t){this.children.value=[...this.children.value,t]}_removeChildInstance(t){return this.children.value.includes(t)?(this.children.value=this.children.value.filter(n=>n.id!==t.id),t.parent.value=null,!0):!1}findChild(t){return this.children.value.find(t)??null}findDescendant(t){const n=[this];for(;n.length>0;){const o=n.pop();if(t(o))return o;for(let i=o.children.value.length-1;i>=0;i--)n.push(o.children.value[i])}return null}isDescendantOf(t){let n=this.parent.value;for(;n;){if(n.id===t.id)return!0;n=n.parent.value}return!1}getPath(){const t=[];let n=this;for(;n;)t.push(n),n=n.parent.value;return t.reverse()}get isRoot(){return at(this,xe)}get isLeaf(){return this.children.value.length===0}}xe=new WeakMap;class jt{constructor(t,n){We(this,Ce);he(this,"root");he(this,"nodeMap");We(this,Te);ct(this,Te,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=c.shallowReactive(new Map),this.root=new st(t,null,{},!0),this.nodeMap.set(this.root.id,this.root)}findNodeById(t){return this.nodeMap.get(t)??null}addNode(t,n=null,o={}){const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree addNode: Parent node with ID ${n} not found.`),null;o.id&&this.nodeMap.has(o.id)&&(o.id=void 0);const r=new st(t,i,o);return this.nodeMap.set(r.id,r),i.addChild(r),r}removeNode(t,n){const o=n??at(this,Te),i=this.findNodeById(t);if(!i)return!1;if(i.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const r=i.parent.value;if(o==="recursive")ut(this,Ce,ft).call(this,i);else{for(const l of i.children.value)l.parent.value=null;i.children.value=[],this.nodeMap.delete(i.id)}return r._removeChildInstance(i)}moveNode(t,n){const o=this.findNodeById(t);if(!o)return console.error(`Tree moveNode: Node with ID ${t} not found.`),!1;if(o.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(t===n)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree moveNode: New parent node with ID ${n} not found.`),!1;if(i.isDescendantOf(o))return console.error("Tree moveNode: Cannot move a node to become its own descendant."),!1;const r=o.parent.value;if(r){if(!r._removeChildInstance(o))return console.error("Tree moveNode: Failed to remove node from its original parent."),!1}else if(o.isRoot){if(o.isRoot)return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."),!1}return i.addChild(o),o.parent.value=i,!0}traverse(t="dfs",n=this.root){const o=[];if(!n)return console.warn("Tree traverse: Start node is null, returning empty array."),o;if(t==="dfs"){const i=[n];for(;i.length>0;){const r=i.pop();o.push(r);for(let l=r.children.value.length-1;l>=0;l--)i.push(r.children.value[l])}}else{const i=[n];for(;i.length>0;){const r=i.shift();o.push(r);for(const l of r.children.value)i.push(l)}}return o}dispose(){this.nodeMap.clear()}}Te=new WeakMap,Ce=new WeakSet,ft=function(t){const n=[...t.children.value];for(const o of n)ut(this,Ce,ft).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function Eo(e,t,n={},o={}){const{parentId:i,...r}=n,l=Ge(e,t,r),a=new jt(l,o);return{get nodeMap(){return a.nodeMap},get root(){return a.root},findNodeById:y=>a.findNodeById(y),moveNode:(y,b)=>a.moveNode(y,b),dispose:()=>{a.dispose()},addNode:(y,b,L={})=>{const{parentId:S,...C}=L,P=Ge(y,b,C);return a.addNode(P,S)},removeNode:(y,b)=>a.removeNode(y,b),traverse:(y,b)=>a.traverse(y,b),getAllOpenNodes:()=>{const y=[];for(const b of a.nodeMap.values())b.data.open.value&&y.push(b);return y},getTopmostOpenNode:()=>{let y=null,b=-1;for(const L of a.nodeMap.values())if(L.data.open.value){const S=L.getPath().length;S>b&&(b=S,y=L)}return y},forEach:(y,b,L={})=>{const{relationship:S="self-and-children",applyToMatching:C=!0}=L,P=a.findNodeById(y);if(!P)return;const N=[],V=new Set,R=A=>{A&&!V.has(A.id)&&(N.push(A),V.add(A.id))},D=A=>{for(const k of A)R(k)};if(S==="ancestors-only")for(const A of P.getPath())A.id!==P.id&&R(A);else if(S==="siblings-only"){if(P.parent.value)for(const A of P.parent.value.children.value)A.id!==P.id&&R(A)}else if(S==="descendants-only")for(const A of a.traverse("dfs",P))A.id!==P.id&&R(A);else if(S==="children-only")D(P.children.value);else if(S==="self-and-ancestors")D(P.getPath());else if(S==="self-and-children")R(P),D(P.children.value);else if(S==="self-and-descendants")D(a.traverse("dfs",P));else if(S==="self-and-siblings")R(P),P.parent.value&&D(P.parent.value.children.value);else if(S==="self-ancestors-and-children")D(P.getPath()),D(P.children.value);else if(S==="full-branch")D(P.getPath()),D(a.traverse("dfs",P));else if(S==="all-except-branch"){const A=new Set;for(const k of P.getPath())A.add(k.id);for(const k of a.traverse("dfs",P))A.add(k.id);for(const k of a.nodeMap.values())!A.has(k.id)===C&&b(k);return}else{console.warn(`forEach: Unknown relationship "${S}".`);return}if(C)for(const A of N)b(A);else for(const A of a.nodeMap.values())V.has(A.id)||b(A)}}}T.Tree=jt,T.TreeNode=st,T.clearTimeoutIfSet=it,T.contains=Be,T.findDescendantContainingTarget=Fe,T.flip=zn,T.getContextFromParameter=ke,T.getCurrentTime=ot,T.getTarget=It,T.hide=Un,T.isButtonTarget=Qe,T.isClickOnScrollbar=Ht,T.isEventTargetWithin=et,T.isHTMLElement=kt,T.isMac=tt,T.isMouseLikePointerType=He,T.isSafari=nt,T.isSpaceIgnored=Ze,T.isTargetWithinElement=q,T.isTreeNode=Rt,T.isTypeableElement=Je,T.isVirtualElement=Ft,T.matchesFocusVisible=Bt,T.offset=jn,T.shift=_n,T.useArrow=Jn,T.useClick=po,T.useClientPoint=vo,T.useEscapeKey=yo,T.useFloating=Ge,T.useFloatingTree=Eo,T.useFocus=ho,T.useHover=oo,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(M,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(M=typeof globalThis<"u"?globalThis:M||self,u(M.VFloat={},M.Vue))})(this,(function(M,u){"use strict";var vo=Object.defineProperty;var wo=(M,u,fe)=>u in M?vo(M,u,{enumerable:!0,configurable:!0,writable:!0,value:fe}):M[u]=fe;var ye=(M,u,fe)=>wo(M,typeof u!="symbol"?u+"":u,fe);function fe(e){return u.getCurrentScope()?(u.onScopeDispose(e),!0):!1}const zt=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const _t=Object.prototype.toString,Ut=e=>_t.call(e)==="[object Object]";function Ie(e){return Array.isArray(e)?e:[e]}function Kt(e,t,n){return u.watch(e,t,{...n,immediate:!0})}const qt=zt?window:void 0;function Gt(e){var t;const n=u.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function q(...e){const t=[],n=()=>{t.forEach(a=>a()),t.length=0},o=(a,d,c,f)=>(a.addEventListener(d,c,f),()=>a.removeEventListener(d,c,f)),i=u.computed(()=>{const a=Ie(u.toValue(e[0])).filter(d=>d!=null);return a.every(d=>typeof d!="string")?a:void 0}),l=Kt(()=>{var a,d;return[(d=(a=i.value)==null?void 0:a.map(c=>Gt(c)))!=null?d:[qt].filter(c=>c!=null),Ie(u.toValue(i.value?e[1]:e[0])),Ie(u.unref(i.value?e[2]:e[1])),u.toValue(i.value?e[3]:e[2])]},([a,d,c,f])=>{if(n(),!(a!=null&&a.length)||!(d!=null&&d.length)||!(c!=null&&c.length))return;const g=Ut(f)?{...f}:f;t.push(...a.flatMap(m=>d.flatMap(h=>c.map(p=>o(m,h,p,g)))))},{flush:"post"}),r=()=>{l(),n()};return fe(n),r}function We(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function Be(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function st(e){return typeof(e==null?void 0:e.matches)!="function"?!1:e.matches(":focus-visible")}function $e(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function je(e){return!e||!(e instanceof HTMLElement)?!1:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable&&e.contentEditable!=="false"}function Xe(e){const t=e.target;return t instanceof HTMLElement?t.tagName==="BUTTON"||t.tagName==="INPUT"&&t.getAttribute("type")==="button"||t.getAttribute("role")==="button":!1}function Ye(e){return je(e)}function lt(e){return e instanceof Element&&e instanceof HTMLElement}function Jt(e){return typeof e=="object"&&e!==null&&"contextElement"in e}function ze(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function at(e,t){const n=t.getBoundingClientRect(),o=t.offsetWidth-t.clientWidth,i=t.offsetHeight-t.clientHeight,l=e.clientX-n.left,r=e.clientY-n.top;if(o>0){const a=t.clientWidth;if(l>=a&&l<=t.offsetWidth)return!0}if(i>0){const a=t.clientHeight;if(r>=a&&r<=t.offsetHeight)return!0}return!1}function Te(e,t){return e.contains(t)}function ct(e){return e.target}function _e(){return typeof performance<"u"?performance.now():Date.now()}function Ue(e){e!==-1&&clearTimeout(e)}function ut(e){return e!==null&&typeof e=="object"&&"data"in e&&"id"in e&&"children"in e&&"parent"in e}function be(e){return ut(e)?{floatingContext:e.data,treeContext:e}:{floatingContext:e,treeContext:null}}function z(e,t){if(!t)return!1;if(typeof t=="object"&&t!==null&&"contextElement"in t){const n=t.contextElement;return n instanceof Element?n.contains(e):!1}return t instanceof Element?t.contains(e):!1}function Oe(e,t){for(const n of e.children.value)if(n.data.open.value){if(z(t,n.data.refs.anchorEl.value)||z(t,n.data.refs.floatingEl.value))return n;const o=Oe(n,t);if(o)return o}return null}function Qt(e,t={}){const{floatingContext:n,treeContext:o}=be(e),{open:i,setOpen:l,refs:r}=n,{enabled:a=!0,event:d="click",toggle:c=!0,ignoreMouse:f=!1,ignoreKeyboard:g=!1,ignoreTouch:m=!1,outsideClick:h=!1,outsideEvent:p="pointerdown",outsideCapture:w=!0,onOutsideClick:v,preventScrollbarClick:E=!0,handleDragEvents:O=!0}=t;let T,A=!1,y=!1,x=!1;const L=u.computed(()=>u.toValue(a)),V=u.computed(()=>u.toValue(h)),N=u.computed(()=>{const P=r.anchorEl.value;return P instanceof HTMLElement?P:null}),D=u.computed(()=>r.floatingEl.value);function I(){x=!0;try{i.value?u.toValue(c)&&l(!1):l(!0)}finally{Promise.resolve().then(()=>{x=!1})}}function W(){T=void 0,A=!1,y=!1}function j(P){T=P.pointerType}function R(P){P.button===0&&u.toValue(d)!=="click"&&(B(T)||I())}function C(){if(u.toValue(d)==="mousedown"&&T){W();return}if(B(T)){W();return}I(),W()}function s(P){if(T=void 0,P.defaultPrevented||u.toValue(g)||Xe(P))return;const $=N.value;$&&(P.key===" "&&!Ye($)&&(P.preventDefault(),A=!0),P.key==="Enter"&&I())}function k(P){const $=N.value;$&&(P.defaultPrevented||u.toValue(g)||Xe(P)||Ye($)||P.key===" "&&A&&(A=!1,I()))}function b(P){if(!L.value||!V.value||!i.value)return;if(u.toValue(p)==="click"&&u.toValue(O)&&y){y=!1;return}if(x)return;const $=P.target;if($&&!(u.toValue(E)&&lt($)&&D.value&&at(P,$))){if(o){if(!Zt(o,$))return}else if(ze(P,N.value)||ze(P,D.value))return;v?v(P,n):l(!1)}}function F(){y=!0}function Z(){setTimeout(()=>{y=!1},0)}function B(P){return!!($e(P,!0)&&u.toValue(f)||P==="touch"&&u.toValue(m))}u.watchPostEffect(()=>{const P=N.value;!L.value||!P||(P.addEventListener("pointerdown",j),P.addEventListener("mousedown",R),P.addEventListener("click",C),P.addEventListener("keydown",s),P.addEventListener("keyup",k),u.onWatcherCleanup(()=>{P.removeEventListener("pointerdown",j),P.removeEventListener("mousedown",R),P.removeEventListener("click",C),P.removeEventListener("keydown",s),P.removeEventListener("keyup",k),W()}))}),q(()=>L.value&&V.value?document:null,()=>u.toValue(p),b,{capture:u.toValue(w)}),q(()=>L.value&&V.value&&u.toValue(O)?D.value:null,"mousedown",F,{capture:!0}),q(()=>L.value&&V.value&&u.toValue(O)?D.value:null,"mouseup",Z,{capture:!0})}function Zt(e,t){return!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Oe(e,t))}const Pe=e=>typeof e=="number"&&Number.isFinite(e)?e:null,se=class se{create(t){const n=this.buildConfiguration(t);return{contextElement:n.referenceElement||void 0,getBoundingClientRect:()=>this.buildBoundingRect(n)}}buildConfiguration(t){return{coordinates:t.coordinates,referenceElement:t.referenceElement??null,baselineCoordinates:t.baselineCoordinates??null,axis:t.axis??"both"}}buildBoundingRect(t){const n=this.getReferenceRect(t.referenceElement),o=this.resolvePosition(t,n),i=this.calculateSize(t.axis,n);return this.buildDOMRect({x:o.x,y:o.y,width:i.width,height:i.height})}getReferenceRect(t){if(t)try{return t.getBoundingClientRect()}catch(n){console.warn("VirtualElementFactory: Failed to get element bounds",{element:t,error:n})}return this.buildDOMRect({x:0,y:0,width:se.DEFAULT_DIMENSIONS.width,height:se.DEFAULT_DIMENSIONS.height})}resolvePosition(t,n){var o,i;return{x:this.resolveAxisCoordinate({current:t.coordinates.x,baseline:((o=t.baselineCoordinates)==null?void 0:o.x)??null,fallback:n.x,isAxisEnabled:t.axis==="x"||t.axis==="both"}),y:this.resolveAxisCoordinate({current:t.coordinates.y,baseline:((i=t.baselineCoordinates)==null?void 0:i.y)??null,fallback:n.y,isAxisEnabled:t.axis==="y"||t.axis==="both"})}}resolveAxisCoordinate(t){const{current:n,baseline:o,fallback:i,isAxisEnabled:l}=t;return l&&n!==null?n:o!==null?o:i}calculateSize(t,n){const o=(i,l)=>Math.max(0,i||l);switch(t){case"both":return{width:0,height:0};case"x":return{width:o(n.width,se.DEFAULT_DIMENSIONS.width),height:0};case"y":return{width:0,height:o(n.height,se.DEFAULT_DIMENSIONS.height)}}}buildDOMRect(t){const{x:n,y:o,width:i,height:l}=t,r=Math.max(0,i),a=Math.max(0,l);return{x:n,y:o,width:r,height:a,top:o,right:n+r,bottom:o+a,left:n,toJSON:()=>({x:n,y:o,width:r,height:a})}}};ye(se,"DEFAULT_DIMENSIONS",{width:100,height:30});let Ke=se;class ft{constructor(){ye(this,"lastKnownCoordinates",null)}getCoordinatesForOpening(){return this.lastKnownCoordinates}onClose(){this.lastKnownCoordinates=null}reset(){this.lastKnownCoordinates=null}}class en extends ft{constructor(){super(...arguments);ye(this,"name","follow")}getRequiredEvents(){return["pointerdown","pointermove","pointerenter"]}process(n,o){const i=n.coordinates;switch(this.lastKnownCoordinates=i,n.type){case"pointerdown":return i;case"pointermove":return o.isOpen&&$e(n.originalEvent.pointerType,!0)?i:null;case"pointerenter":return i;default:return null}}}class tn extends ft{constructor(){super(...arguments);ye(this,"name","static");ye(this,"triggerCoordinates",null)}getRequiredEvents(){return["pointerdown"]}process(n,o){const i=n.coordinates;return this.triggerCoordinates=i,this.lastKnownCoordinates=i,o.isOpen?i:null}getCoordinatesForOpening(){return this.triggerCoordinates?this.triggerCoordinates:this.lastKnownCoordinates}reset(){super.reset(),this.triggerCoordinates=null}onClose(){this.triggerCoordinates=null}}function nn(e,t,n={}){const{open:o,refs:i}=t,l=new Ke,r=u.ref({x:null,y:null}),a=u.ref(null),d=u.computed(()=>u.toValue(n.axis??"both")),c=u.computed(()=>u.toValue(n.enabled??!0)),f=u.computed(()=>Pe(u.toValue(n.x??null))),g=u.computed(()=>Pe(u.toValue(n.y??null))),m=u.computed(()=>f.value!==null&&g.value!==null),h=u.computed(()=>m.value?{x:f.value,y:g.value}:r.value),p=u.computed(()=>{const x=h.value;switch(d.value){case"x":return{x:x.x,y:null};case"y":return{x:null,y:x.y};case"both":return x}}),w=(n.trackingMode??"follow")==="follow"?new en:new tn,v=(x,L)=>{m.value||(r.value={x:Pe(x),y:Pe(L)})},E=()=>{m.value||(r.value={x:null,y:null})},O=(x,L)=>{const V={type:L,coordinates:{x:x.clientX,y:x.clientY},originalEvent:x},N=w.process(V,{isOpen:o.value});N&&v(N.x,N.y)};u.watch([p,a,d,e],()=>{i.anchorEl.value=l.create({coordinates:p.value,referenceElement:e.value,baselineCoordinates:a.value,axis:d.value})},{immediate:!0}),u.watch(o,x=>{if(!(!c.value||m.value))if(x){const L=w.getCoordinatesForOpening();L?(v(L.x,L.y),a.value={...L}):a.value={...r.value}}else w.onClose(),E(),a.value=null});const T=x=>{O(x,"pointerdown")},A=x=>{O(x,"pointerenter")},y=x=>{O(x,"pointermove")};return u.watchEffect(()=>{if(m.value||!c.value)return;const x=e.value;if(!x)return;const L=w.getRequiredEvents(),V={pointerenter:A,pointerdown:T,pointermove:y};L.forEach(N=>{const D=V[N];D&&x.addEventListener(N,D)}),u.onWatcherCleanup(()=>{L.forEach(N=>{const D=V[N];D&&x.removeEventListener(N,D)})})}),{coordinates:u.readonly(p),updatePosition:(x,L)=>v(x,L)}}function on(e,t={}){const{floatingContext:n,treeContext:o}=be(e),{enabled:i=!0,capture:l=!1,onEscape:r}=t,{isComposing:a}=sn();q(document,"keydown",c=>{if(!(c.key!=="Escape"||!u.toValue(i)||a())){if(r){r(c);return}if(o){const f=rn(o);f&&f.data.setOpen(!1)}else n.setOpen(!1)}},l)}function rn(e){let t=e;for(;t.parent.value&&!t.isRoot;)t=t.parent.value;let n=null,o=-1;const i=l=>{if(l.data.open.value){const r=l.getPath().length;r>o&&(o=r,n=l)}for(const r of l.children.value)i(r)};return i(t),n}function sn(){const e=u.ref(!1);return q(document,"compositionstart",()=>{e.value=!0}),q(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function ln(e,t={}){const{floatingContext:n,treeContext:o}=be(e),{open:i,setOpen:l,refs:{floatingEl:r,anchorEl:a}}=n,{enabled:d=!0,requireFocusVisible:c=!0}=t,f=u.computed(()=>a.value?a.value instanceof HTMLElement?a.value:a.value.contextElement:null);let g=!1,m=!0,h;q(window,"blur",()=>{!i.value&&f.value&&f.value===document.activeElement&&(g=!0)}),q(window,"focus",()=>{g=!1}),u.onMounted(()=>{We()&&Be()&&(q(window,"keydown",()=>{m=!0},{capture:!0}),q(window,"pointerdown",()=>{m=!1},{capture:!0}))});function p(v){if(g){g=!1;return}const E=v.target;if(u.toValue(c)&&E){if(We()&&Be()&&!v.relatedTarget){if(!m&&!je(E))return}else if(!st(E))return}l(!0)}function w(v){clearTimeout(h),h=window.setTimeout(()=>{var T;const O=(((T=f.value)==null?void 0:T.ownerDocument)??document).activeElement;if(!(!v.relatedTarget&&O===f.value)){if(o){if(O&&an(o,O))return}else if(r.value&&O&&r.value.contains(O))return;l(!1)}},0)}u.watchPostEffect(()=>{if(!u.toValue(d))return;const v=f.value;!v||!(v instanceof HTMLElement)||(v.addEventListener("focus",p),v.addEventListener("blur",w),u.onWatcherCleanup(()=>{v.removeEventListener("focus",p),v.removeEventListener("blur",w)}))}),u.onScopeDispose(()=>{clearTimeout(h)})}function an(e,t){return z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)?!0:dt(e,t)!==null}function dt(e,t){for(const n of e.children.value)if(n.data.open.value){if(z(t,n.data.refs.anchorEl.value)||z(t,n.data.refs.floatingEl.value))return n;const o=dt(n,t);if(o)return o}return null}let cn=0;function un(){return`vfloat-id-${cn++}`}function ht(e){return typeof e=="object"&&e instanceof HTMLElement}function mt(e){return e.children.value.some(t=>t.data.open.value||mt(t))}function fn(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function pt(e,t){const[n,o]=e;let i=!1;const l=t.length;for(let r=0,a=l-1;r<l;a=r++){const[d,c]=t[r]||[0,0],[f,g]=t[a]||[0,0];c>=o!=g>=o&&n<=(f-d)*(o-c)/(g-c)+d&&(i=!i)}return i}function dn(e={}){const{blockPointerEvents:t=!1,requireIntent:n=!0}=e;let o=-1,i=!1;function l(a,d,c,f,g){const m=_e(),h=m-g;if(c===null||f===null||h===0)return{speed:null,lastX:a,lastY:d,lastCursorTime:m};const p=a-c,w=d-f;return{speed:Math.sqrt(p*p+w*w)/h,lastX:a,lastY:d,lastCursorTime:m}}const r=function(d){const{x:c,y:f,placement:g,elements:m,buffer:h,onClose:p,nodeId:w,tree:v}=d,E=u.computed(()=>{const y=m.domReference;return ht(y)?y:(y==null?void 0:y.contextElement)??null});let O=null,T=null,A=_e();return function(x){var He,Wt,Bt,$t,jt,Xt,Yt;function L(){Ue(o),o=-1,p()}if(Ue(o),o=-1,!m.domReference||!m.floating||g==null||c==null||f==null)return;const{clientX:V,clientY:N}=x,D=[V,N],I=ct(x),W=x.type==="mouseleave",j=m.floating&&Te(m.floating,I),R=E.value&&Te(E.value,I),C=(He=E.value)==null?void 0:He.getBoundingClientRect(),s=(Wt=m.floating)==null?void 0:Wt.getBoundingClientRect(),k=g.split("-")[0],b=c>((s==null?void 0:s.right)??0)-((s==null?void 0:s.width)??0)/2,F=f>((s==null?void 0:s.bottom)??0)-((s==null?void 0:s.height)??0)/2,Z=C?fn(D,C):!1,B=((s==null?void 0:s.width)??0)>((C==null?void 0:C.width)??0),P=((s==null?void 0:s.height)??0)>((C==null?void 0:C.height)??0),$=((Bt=B?C:s)==null?void 0:Bt.left)??0,le=(($t=B?C:s)==null?void 0:$t.right)??0,K=((jt=P?C:s)==null?void 0:jt.top)??0,ae=((Xt=P?C:s)==null?void 0:Xt.bottom)??0;if(j&&(i=!0,!W))return;if(R&&(i=!1),R&&!W){i=!0;return}if(W&&ht(x.relatedTarget)&&m.floating&&Te(m.floating,x.relatedTarget))return;if(v&&w){const H=v.nodes.get(w);if(H&&mt(H))return}if(k==="top"&&f>=((C==null?void 0:C.bottom)??0)-1||k==="bottom"&&f<=((C==null?void 0:C.top)??0)+1||k==="left"&&c>=((C==null?void 0:C.right)??0)-1||k==="right"&&c<=((C==null?void 0:C.left)??0)+1)return L();let ne=[];switch(k){case"top":ne=[[$,((C==null?void 0:C.top)??0)+1],[$,((s==null?void 0:s.bottom)??0)-1],[le,((s==null?void 0:s.bottom)??0)-1],[le,((C==null?void 0:C.top)??0)+1]];break;case"bottom":ne=[[$,((s==null?void 0:s.top)??0)+1],[$,((C==null?void 0:C.bottom)??0)-1],[le,((C==null?void 0:C.bottom)??0)-1],[le,((s==null?void 0:s.top)??0)+1]];break;case"left":ne=[[((s==null?void 0:s.right)??0)-1,ae],[((s==null?void 0:s.right)??0)-1,K],[((C==null?void 0:C.left)??0)+1,K],[((C==null?void 0:C.left)??0)+1,ae]];break;case"right":ne=[[((C==null?void 0:C.right)??0)-1,ae],[((C==null?void 0:C.right)??0)-1,K],[((s==null?void 0:s.left)??0)+1,K],[((s==null?void 0:s.left)??0)+1,ae]];break}function Fe([H,X]){const S=h;switch(k){case"top":{const ce=[B?H+S/2:b?H+S*4:H-S*4,X+S+1],ue=[B?H-S/2:b?H+S*4:H-S*4,X+S+1],we=[[(s==null?void 0:s.left)??0,b||B?((s==null?void 0:s.bottom)??0)-S:(s==null?void 0:s.top)??0],[(s==null?void 0:s.right)??0,b?B?((s==null?void 0:s.bottom)??0)-S:(s==null?void 0:s.top)??0:((s==null?void 0:s.bottom)??0)-S]];return[ce,ue,...we]}case"bottom":{const ce=[B?H+S/2:b?H+S*4:H-S*4,X-S],ue=[B?H-S/2:b?H+S*4:H-S*4,X-S],we=[[(s==null?void 0:s.left)??0,b||B?((s==null?void 0:s.top)??0)+S:(s==null?void 0:s.bottom)??0],[(s==null?void 0:s.right)??0,b?B?((s==null?void 0:s.top)??0)+S:(s==null?void 0:s.bottom)??0:((s==null?void 0:s.top)??0)+S]];return[ce,ue,...we]}case"left":{const ce=[H+S+1,P?X+S/2:F?X+S*4:X-S*4],ue=[H+S+1,P?X-S/2:F?X+S*4:X-S*4];return[...[[F||P?((s==null?void 0:s.right)??0)-S:(s==null?void 0:s.left)??0,(s==null?void 0:s.top)??0],[F?P?((s==null?void 0:s.right)??0)-S:(s==null?void 0:s.left)??0:((s==null?void 0:s.right)??0)-S,(s==null?void 0:s.bottom)??0]],ce,ue]}case"right":{const ce=[H-S,P?X+S/2:F?X+S*4:X-S*4],ue=[H-S,P?X-S/2:F?X+S*4:X-S*4],we=[[F||P?((s==null?void 0:s.left)??0)+S:(s==null?void 0:s.right)??0,(s==null?void 0:s.top)??0],[F?P?((s==null?void 0:s.left)??0)+S:(s==null?void 0:s.right)??0:((s==null?void 0:s.left)??0)+S,(s==null?void 0:s.bottom)??0]];return[ce,ue,...we]}}}const ve=Fe([c,f]);if((Yt=e.onPolygonChange)==null||Yt.call(e,ve),!pt(D,ne)){if(pt(D,ve)){if(!i&&n){const H=l(x.clientX,x.clientY,O,T,A);O=H.lastX,T=H.lastY,A=H.lastCursorTime,H.speed!==null&&H.speed<.1&&(o=window.setTimeout(L,40))}return}if(i&&!Z)return L();L()}}};return r.__options={blockPointerEvents:t},r}const gt=10;function hn(e,t,n){const{delay:o}=n,i=u.computed(()=>{const c=u.toValue(o);return(typeof c=="number"?c:c.open)??0}),l=u.computed(()=>{const c=u.toValue(o);return(typeof c=="number"?c:c.close)??0});let r,a;const d=()=>{clearTimeout(r),clearTimeout(a)};return u.onScopeDispose(d),{show:c=>{d();const f=c??i.value;f===0?e():r=setTimeout(e,f)},hide:c=>{d();const f=c??l.value;f===0?t():a=setTimeout(t,f)},showDelay:i,hideDelay:l,clearTimeouts:d}}function mn(e,t={}){const{floatingContext:n,treeContext:o}=be(e),{open:i,setOpen:l,refs:{anchorEl:r,floatingEl:a}}=n,{enabled:d=!0,delay:c=0,restMs:f=0,mouseOnly:g=!1,safePolygon:m=!1}=t,h=u.computed(()=>u.toValue(d)),p=u.computed(()=>u.toValue(f)),w=u.computed(()=>{const b=r.value;return!b||b instanceof HTMLElement?b:b.contextElement??null}),{hide:v,show:E,showDelay:O,clearTimeouts:T}=hn(()=>{i.value||l(!0)},()=>{i.value&&l(!1)},{delay:c});let A=null,y;const x=u.computed(()=>O.value===0&&p.value>0);function L(b){if(!h.value||!D(b)||!x.value||!A)return;const F={x:b.clientX,y:b.clientY},Z=Math.abs(F.x-A.x),B=Math.abs(F.y-A.y);(Z>gt||B>gt)&&(A=F,clearTimeout(y),y=setTimeout(()=>{E(0)},p.value))}function V(b){!h.value||!D(b)||!x.value||(A={x:b.clientX,y:b.clientY},y=setTimeout(()=>{E(0)},p.value))}function N(){clearTimeout(y),A=null}u.watchPostEffect(()=>{const b=w.value;!b||!h.value||!x.value||(b.addEventListener("pointerenter",V),b.addEventListener("pointermove",L),b.addEventListener("pointerleave",N),u.onWatcherCleanup(()=>{b.removeEventListener("pointerenter",V),b.removeEventListener("pointermove",L),b.removeEventListener("pointerleave",N)}))}),u.onScopeDispose(()=>{clearTimeout(y)});function D(b){return u.toValue(g)?b.pointerType==="mouse":!0}function I(b){!h.value||!D(b)||x.value||(R(),E())}function W(b){!h.value||!D(b)||(T(),R())}let j=null;function R(){j&&(document.removeEventListener("pointermove",j),j=null);const b=s.value;b!=null&&b.onPolygonChange&&b.onPolygonChange([])}const C=u.computed(()=>!!u.toValue(m)),s=u.computed(()=>{const b=u.toValue(m);if(typeof b=="object"&&b)return b;if(b===!0)return{}});function k(b){var P;if(!h.value||!D(b))return;const{clientX:F,clientY:Z}=b,B=b.relatedTarget;if(C.value)setTimeout(()=>{var ne;R();const $=w.value,le=a.value;if(!$||!le){v();return}let K,ae;if(o){K=new Map;const Fe=ve=>{K==null||K.set(ve.id,ve);for(const He of ve.children.value)Fe(He)};Fe(o),ae=o.id}j=dn(s.value)({x:F,y:Z,placement:n.placement.value,elements:{domReference:$,floating:le},buffer:((ne=s.value)==null?void 0:ne.buffer)??1,onClose:()=>{R(),v()},nodeId:ae,tree:K?{nodes:K}:void 0}),j&&document.addEventListener("pointermove",j)},0);else{if(o){if(!pn(o,B))return}else if((P=a.value)!=null&&P.contains(B))return;v()}}u.watchPostEffect(()=>{const b=w.value;!b||!h.value||(b.addEventListener("pointerenter",I),b.addEventListener("pointerleave",k),u.onWatcherCleanup(()=>{b.removeEventListener("pointerenter",I),b.removeEventListener("pointerleave",k)}))}),u.watchPostEffect(()=>{const b=a.value;!b||!h.value||(b.addEventListener("pointerenter",W),b.addEventListener("pointerleave",k),u.onWatcherCleanup(()=>{b.removeEventListener("pointerenter",W),b.removeEventListener("pointerleave",k)}))}),u.onScopeDispose(()=>{R()})}function pn(e,t){return t?!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Oe(e,t)):!0}const gn=["top","right","bottom","left"],de=Math.min,oe=Math.max,Le=Math.round,Se=Math.floor,G=e=>({x:e,y:e}),vn={left:"right",right:"left",bottom:"top",top:"bottom"},wn={start:"end",end:"start"};function qe(e,t,n){return oe(e,de(t,n))}function he(e,t){return typeof e=="function"?e(t):e}function ie(e){return e.split("-")[0]}function xe(e){return e.split("-")[1]}function vt(e){return e==="x"?"y":"x"}function Ge(e){return e==="y"?"height":"width"}const yn=new Set(["top","bottom"]);function ee(e){return yn.has(ie(e))?"y":"x"}function Je(e){return vt(ee(e))}function bn(e,t,n){n===void 0&&(n=!1);const o=xe(e),i=Je(e),l=Ge(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(r=Ae(r)),[r,Ae(r)]}function xn(e){const t=Ae(e);return[Qe(e),t,Qe(t)]}function Qe(e){return e.replace(/start|end/g,t=>wn[t])}const wt=["left","right"],yt=["right","left"],En=["top","bottom"],Cn=["bottom","top"];function Tn(e,t,n){switch(e){case"top":case"bottom":return n?t?yt:wt:t?wt:yt;case"left":case"right":return t?En:Cn;default:return[]}}function On(e,t,n,o){const i=xe(e);let l=Tn(ie(e),n==="start",o);return i&&(l=l.map(r=>r+"-"+i),t&&(l=l.concat(l.map(Qe)))),l}function Ae(e){return e.replace(/left|right|bottom|top/g,t=>vn[t])}function Pn(e){return{top:0,right:0,bottom:0,left:0,...e}}function bt(e){return typeof e!="number"?Pn(e):{top:e,right:e,bottom:e,left:e}}function Me(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function xt(e,t,n){let{reference:o,floating:i}=e;const l=ee(t),r=Je(t),a=Ge(r),d=ie(t),c=l==="y",f=o.x+o.width/2-i.width/2,g=o.y+o.height/2-i.height/2,m=o[a]/2-i[a]/2;let h;switch(d){case"top":h={x:f,y:o.y-i.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:g};break;case"left":h={x:o.x-i.width,y:g};break;default:h={x:o.x,y:o.y}}switch(xe(t)){case"start":h[r]-=m*(n&&c?-1:1);break;case"end":h[r]+=m*(n&&c?-1:1);break}return h}const Ln=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:r}=n,a=l.filter(Boolean),d=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:g}=xt(c,o,d),m=o,h={},p=0;for(let w=0;w<a.length;w++){const{name:v,fn:E}=a[w],{x:O,y:T,data:A,reset:y}=await E({x:f,y:g,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:c,platform:r,elements:{reference:e,floating:t}});f=O??f,g=T??g,h={...h,[v]:{...h[v],...A}},y&&p<=50&&(p++,typeof y=="object"&&(y.placement&&(m=y.placement),y.rects&&(c=y.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:f,y:g}=xt(c,m,d)),w=-1)}return{x:f,y:g,placement:m,strategy:i,middlewareData:h}};async function De(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:l,rects:r,elements:a,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:m=!1,padding:h=0}=he(t,e),p=bt(h),v=a[m?g==="floating"?"reference":"floating":g],E=Me(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(v)))==null||n?v:v.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:d})),O=g==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a.floating)),A=await(l.isElement==null?void 0:l.isElement(T))?await(l.getScale==null?void 0:l.getScale(T))||{x:1,y:1}:{x:1,y:1},y=Me(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:O,offsetParent:T,strategy:d}):O);return{top:(E.top-y.top+p.top)/A.y,bottom:(y.bottom-E.bottom+p.bottom)/A.y,left:(E.left-y.left+p.left)/A.x,right:(y.right-E.right+p.right)/A.x}}const Sn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:l,platform:r,elements:a,middlewareData:d}=t,{element:c,padding:f=0}=he(e,t)||{};if(c==null)return{};const g=bt(f),m={x:n,y:o},h=Je(i),p=Ge(h),w=await r.getDimensions(c),v=h==="y",E=v?"top":"left",O=v?"bottom":"right",T=v?"clientHeight":"clientWidth",A=l.reference[p]+l.reference[h]-m[h]-l.floating[p],y=m[h]-l.reference[h],x=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let L=x?x[T]:0;(!L||!await(r.isElement==null?void 0:r.isElement(x)))&&(L=a.floating[T]||l.floating[p]);const V=A/2-y/2,N=L/2-w[p]/2-1,D=de(g[E],N),I=de(g[O],N),W=D,j=L-w[p]-I,R=L/2-w[p]/2+V,C=qe(W,R,j),s=!d.arrow&&xe(i)!=null&&R!==C&&l.reference[p]/2-(R<W?D:I)-w[p]/2<0,k=s?R<W?R-W:R-j:0;return{[h]:m[h]+k,data:{[h]:C,centerOffset:R-C-k,...s&&{alignmentOffset:k}},reset:s}}}),An=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:l,rects:r,initialPlacement:a,platform:d,elements:c}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:w=!0,...v}=he(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const E=ie(i),O=ee(a),T=ie(a)===a,A=await(d.isRTL==null?void 0:d.isRTL(c.floating)),y=m||(T||!w?[Ae(a)]:xn(a)),x=p!=="none";!m&&x&&y.push(...On(a,w,p,A));const L=[a,...y],V=await De(t,v),N=[];let D=((o=l.flip)==null?void 0:o.overflows)||[];if(f&&N.push(V[E]),g){const R=bn(i,r,A);N.push(V[R[0]],V[R[1]])}if(D=[...D,{placement:i,overflows:N}],!N.every(R=>R<=0)){var I,W;const R=(((I=l.flip)==null?void 0:I.index)||0)+1,C=L[R];if(C&&(!(g==="alignment"?O!==ee(C):!1)||D.every(b=>ee(b.placement)===O?b.overflows[0]>0:!0)))return{data:{index:R,overflows:D},reset:{placement:C}};let s=(W=D.filter(k=>k.overflows[0]<=0).sort((k,b)=>k.overflows[1]-b.overflows[1])[0])==null?void 0:W.placement;if(!s)switch(h){case"bestFit":{var j;const k=(j=D.filter(b=>{if(x){const F=ee(b.placement);return F===O||F==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(F=>F>0).reduce((F,Z)=>F+Z,0)]).sort((b,F)=>b[1]-F[1])[0])==null?void 0:j[0];k&&(s=k);break}case"initialPlacement":s=a;break}if(i!==s)return{reset:{placement:s}}}return{}}}};function Et(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ct(e){return gn.some(t=>e[t]>=0)}const Mn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=he(e,t);switch(o){case"referenceHidden":{const l=await De(t,{...i,elementContext:"reference"}),r=Et(l,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Ct(r)}}}case"escaped":{const l=await De(t,{...i,altBoundary:!0}),r=Et(l,n.floating);return{data:{escapedOffsets:r,escaped:Ct(r)}}}default:return{}}}}},Dn=new Set(["left","top"]);async function Nn(e,t){const{placement:n,platform:o,elements:i}=e,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=ie(n),a=xe(n),d=ee(n)==="y",c=Dn.has(r)?-1:1,f=l&&d?-1:1,g=he(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:p}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),d?{x:h*f,y:m*c}:{x:m*c,y:h*f}}const Rn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:l,placement:r,middlewareData:a}=t,d=await Nn(t,e);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:l+d.y,data:{...d,placement:r}}}}},kn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:l=!0,crossAxis:r=!1,limiter:a={fn:v=>{let{x:E,y:O}=v;return{x:E,y:O}}},...d}=he(e,t),c={x:n,y:o},f=await De(t,d),g=ee(ie(i)),m=vt(g);let h=c[m],p=c[g];if(l){const v=m==="y"?"top":"left",E=m==="y"?"bottom":"right",O=h+f[v],T=h-f[E];h=qe(O,h,T)}if(r){const v=g==="y"?"top":"left",E=g==="y"?"bottom":"right",O=p+f[v],T=p-f[E];p=qe(O,p,T)}const w=a.fn({...t,[m]:h,[g]:p});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[m]:l,[g]:r}}}}}};function Ne(){return typeof window<"u"}function me(e){return Tt(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function J(e){var t;return(t=(Tt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tt(e){return Ne()?e instanceof Node||e instanceof Y(e).Node:!1}function _(e){return Ne()?e instanceof Element||e instanceof Y(e).Element:!1}function Q(e){return Ne()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function Ot(e){return!Ne()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}const Vn=new Set(["inline","contents"]);function Ee(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Vn.has(i)}const Fn=new Set(["table","td","th"]);function Hn(e){return Fn.has(me(e))}const In=[":popover-open",":modal"];function Re(e){return In.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wn=["transform","translate","scale","rotate","perspective"],Bn=["transform","translate","scale","rotate","perspective","filter"],$n=["paint","layout","strict","content"];function Ze(e){const t=et(),n=_(e)?U(e):e;return Wn.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Bn.some(o=>(n.willChange||"").includes(o))||$n.some(o=>(n.contain||"").includes(o))}function jn(e){let t=te(e);for(;Q(t)&&!pe(t);){if(Ze(t))return t;if(Re(t))return null;t=te(t)}return null}function et(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Xn=new Set(["html","body","#document"]);function pe(e){return Xn.has(me(e))}function U(e){return Y(e).getComputedStyle(e)}function ke(e){return _(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function te(e){if(me(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ot(e)&&e.host||J(e);return Ot(t)?t.host:t}function Pt(e){const t=te(e);return pe(t)?e.ownerDocument?e.ownerDocument.body:e.body:Q(t)&&Ee(t)?t:Pt(t)}function Ce(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Pt(e),l=i===((o=e.ownerDocument)==null?void 0:o.body),r=Y(i);if(l){const a=tt(r);return t.concat(r,r.visualViewport||[],Ee(i)?i:[],a&&n?Ce(a):[])}return t.concat(i,Ce(i,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lt(e){const t=U(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=Q(e),l=i?e.offsetWidth:n,r=i?e.offsetHeight:o,a=Le(n)!==l||Le(o)!==r;return a&&(n=l,o=r),{width:n,height:o,$:a}}function nt(e){return _(e)?e:e.contextElement}function ge(e){const t=nt(e);if(!Q(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:l}=Lt(t);let r=(l?Le(n.width):n.width)/o,a=(l?Le(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Yn=G(0);function St(e){const t=Y(e);return!et()||!t.visualViewport?Yn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Y(e)?!1:t}function re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),l=nt(e);let r=G(1);t&&(o?_(o)&&(r=ge(o)):r=ge(e));const a=zn(l,n,o)?St(l):G(0);let d=(i.left+a.x)/r.x,c=(i.top+a.y)/r.y,f=i.width/r.x,g=i.height/r.y;if(l){const m=Y(l),h=o&&_(o)?Y(o):o;let p=m,w=tt(p);for(;w&&o&&h!==p;){const v=ge(w),E=w.getBoundingClientRect(),O=U(w),T=E.left+(w.clientLeft+parseFloat(O.paddingLeft))*v.x,A=E.top+(w.clientTop+parseFloat(O.paddingTop))*v.y;d*=v.x,c*=v.y,f*=v.x,g*=v.y,d+=T,c+=A,p=Y(w),w=tt(p)}}return Me({width:f,height:g,x:d,y:c})}function Ve(e,t){const n=ke(e).scrollLeft;return t?t.left+n:re(J(e)).left+n}function At(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ve(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function _n(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const l=i==="fixed",r=J(o),a=t?Re(t.floating):!1;if(o===r||a&&l)return n;let d={scrollLeft:0,scrollTop:0},c=G(1);const f=G(0),g=Q(o);if((g||!g&&!l)&&((me(o)!=="body"||Ee(r))&&(d=ke(o)),Q(o))){const h=re(o);c=ge(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const m=r&&!g&&!l?At(r,d):G(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-d.scrollTop*c.y+f.y+m.y}}function Un(e){return Array.from(e.getClientRects())}function Kn(e){const t=J(e),n=ke(e),o=e.ownerDocument.body,i=oe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),l=oe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ve(e);const a=-n.scrollTop;return U(o).direction==="rtl"&&(r+=oe(t.clientWidth,o.clientWidth)-i),{width:i,height:l,x:r,y:a}}const Mt=25;function qn(e,t){const n=Y(e),o=J(e),i=n.visualViewport;let l=o.clientWidth,r=o.clientHeight,a=0,d=0;if(i){l=i.width,r=i.height;const f=et();(!f||f&&t==="fixed")&&(a=i.offsetLeft,d=i.offsetTop)}const c=Ve(o);if(c<=0){const f=o.ownerDocument,g=f.body,m=getComputedStyle(g),h=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(o.clientWidth-g.clientWidth-h);p<=Mt&&(l-=p)}else c<=Mt&&(l+=c);return{width:l,height:r,x:a,y:d}}const Gn=new Set(["absolute","fixed"]);function Jn(e,t){const n=re(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,l=Q(e)?ge(e):G(1),r=e.clientWidth*l.x,a=e.clientHeight*l.y,d=i*l.x,c=o*l.y;return{width:r,height:a,x:d,y:c}}function Dt(e,t,n){let o;if(t==="viewport")o=qn(e,n);else if(t==="document")o=Kn(J(e));else if(_(t))o=Jn(t,n);else{const i=St(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Me(o)}function Nt(e,t){const n=te(e);return n===t||!_(n)||pe(n)?!1:U(n).position==="fixed"||Nt(n,t)}function Qn(e,t){const n=t.get(e);if(n)return n;let o=Ce(e,[],!1).filter(a=>_(a)&&me(a)!=="body"),i=null;const l=U(e).position==="fixed";let r=l?te(e):e;for(;_(r)&&!pe(r);){const a=U(r),d=Ze(r);!d&&a.position==="fixed"&&(i=null),(l?!d&&!i:!d&&a.position==="static"&&!!i&&Gn.has(i.position)||Ee(r)&&!d&&Nt(e,r))?o=o.filter(f=>f!==r):i=a,r=te(r)}return t.set(e,o),o}function Zn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?Re(t)?[]:Qn(t,this._c):[].concat(n),o],a=r[0],d=r.reduce((c,f)=>{const g=Dt(t,f,i);return c.top=oe(g.top,c.top),c.right=de(g.right,c.right),c.bottom=de(g.bottom,c.bottom),c.left=oe(g.left,c.left),c},Dt(t,a,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function eo(e){const{width:t,height:n}=Lt(e);return{width:t,height:n}}function to(e,t,n){const o=Q(t),i=J(t),l=n==="fixed",r=re(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const d=G(0);function c(){d.x=Ve(i)}if(o||!o&&!l)if((me(t)!=="body"||Ee(i))&&(a=ke(t)),o){const h=re(t,!0,l,t);d.x=h.x+t.clientLeft,d.y=h.y+t.clientTop}else i&&c();l&&!o&&i&&c();const f=i&&!o&&!l?At(i,a):G(0),g=r.left+a.scrollLeft-d.x-f.x,m=r.top+a.scrollTop-d.y-f.y;return{x:g,y:m,width:r.width,height:r.height}}function ot(e){return U(e).position==="static"}function Rt(e,t){if(!Q(e)||U(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return J(e)===n&&(n=n.ownerDocument.body),n}function kt(e,t){const n=Y(e);if(Re(e))return n;if(!Q(e)){let i=te(e);for(;i&&!pe(i);){if(_(i)&&!ot(i))return i;i=te(i)}return n}let o=Rt(e,t);for(;o&&Hn(o)&&ot(o);)o=Rt(o,t);return o&&pe(o)&&ot(o)&&!Ze(o)?n:o||jn(e)||n}const no=async function(e){const t=this.getOffsetParent||kt,n=this.getDimensions,o=await n(e.floating);return{reference:to(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function oo(e){return U(e).direction==="rtl"}const io={convertOffsetParentRelativeRectToViewportRelativeRect:_n,getDocumentElement:J,getClippingRect:Zn,getOffsetParent:kt,getElementRects:no,getClientRects:Un,getDimensions:eo,getScale:ge,isElement:_,isRTL:oo};function Vt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ro(e,t){let n=null,o;const i=J(e);function l(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,d){a===void 0&&(a=!1),d===void 0&&(d=1),l();const c=e.getBoundingClientRect(),{left:f,top:g,width:m,height:h}=c;if(a||t(),!m||!h)return;const p=Se(g),w=Se(i.clientWidth-(f+m)),v=Se(i.clientHeight-(g+h)),E=Se(f),T={rootMargin:-p+"px "+-w+"px "+-v+"px "+-E+"px",threshold:oe(0,de(1,d))||1};let A=!0;function y(x){const L=x[0].intersectionRatio;if(L!==d){if(!A)return r();L?r(!1,L):o=setTimeout(()=>{r(!1,1e-7)},1e3)}L===1&&!Vt(c,e.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(y,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(y,T)}n.observe(e)}return r(!0),l}function so(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=nt(e),f=i||l?[...c?Ce(c):[],...Ce(t)]:[];f.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),l&&E.addEventListener("resize",n)});const g=c&&a?ro(c,n):null;let m=-1,h=null;r&&(h=new ResizeObserver(E=>{let[O]=E;O&&O.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=h)==null||T.observe(t)})),n()}),c&&!d&&h.observe(c),h.observe(t));let p,w=d?re(e):null;d&&v();function v(){const E=re(e);w&&!Vt(w,E)&&n(),w=E,p=requestAnimationFrame(v)}return n(),()=>{var E;f.forEach(O=>{i&&O.removeEventListener("scroll",n),l&&O.removeEventListener("resize",n)}),g==null||g(),(E=h)==null||E.disconnect(),h=null,d&&cancelAnimationFrame(p)}}const lo=Rn,ao=kn,co=An,uo=Mn,fo=Sn,ho=(e,t,n)=>{const o=new Map,i={platform:io,...n},l={...i.platform,_c:o};return Ln(e,t,{...i,platform:l})};function mo(e,t,n={}){const{offset:o="-4px"}=n,{middlewareData:i,placement:l,refs:r}=t;u.watch(e,f=>{r.arrowEl.value=f});const a=u.computed(()=>{var f;return((f=i.value.arrow)==null?void 0:f.x)??0}),d=u.computed(()=>{var f;return((f=i.value.arrow)==null?void 0:f.y)??0}),c=u.computed(()=>{if(!(e.value||r.arrowEl.value)||!i.value.arrow)return{};const g=u.toValue(l).split("-")[0],m=a.value,h=d.value;return g==="bottom"?{"inset-inline-start":`${m}px`,"inset-block-start":o}:g==="top"?{"inset-inline-start":`${m}px`,"inset-block-end":o}:g==="right"?{"inset-block-start":`${h}px`,"inset-inline-start":o}:g==="left"?{"inset-block-start":`${h}px`,"inset-inline-end":o}:{}});return{arrowX:a,arrowY:d,arrowStyles:c}}function po(e){return{name:"arrow",options:e,fn(t){const n=u.toValue(e.element);return n==null?{}:fo({element:n,padding:e.padding}).fn(t)}}}function it(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:l=!0,open:r=u.ref(!1)}=n,a=y=>{r.value=y},d=u.computed(()=>u.toValue(n.placement)??"bottom"),c=u.computed(()=>u.toValue(n.strategy)??"absolute"),f=u.ref(0),g=u.ref(0),m=u.ref(d.value),h=u.ref(c.value),p=u.shallowRef({}),w=u.ref(!1),v=u.ref(null),E=u.computed(()=>{const y=u.toValue(i)||[];return v.value&&!y.some(L=>L.name==="arrow")?[...y,po({element:v})]:y}),O=async()=>{if(!e.value||!t.value)return;const y=await ho(e.value,t.value,{placement:d.value,strategy:c.value,middleware:E.value});f.value=y.x,g.value=y.y,m.value=y.placement,h.value=y.strategy,p.value=y.middlewareData,w.value=r.value};u.watch([d,c,E],()=>{r.value&&O()});let T;u.watch([e,t,r],([y,x,L])=>{!L||!y||!x||(l&&(T=so(y,x,O,typeof l=="object"?l:void 0)),u.onWatcherCleanup(()=>{T==null||T(),T=void 0}))},{immediate:!0}),u.onScopeDispose(()=>T==null?void 0:T()),u.watch(r,y=>{y||(w.value=!1)});const A=u.ref({position:c.value,left:"0",top:"0"});return u.watch([f,g,()=>u.toValue(o)],([y,x,L])=>{const V=t.value;if(!V)return;const N={position:h.value,left:"0",top:"0"},D=Ft(V,y),I=Ft(V,x);L?A.value={...N,transform:`translate(${D}px, ${I}px)`,...Ht(V)>=1.5&&{"will-change":"transform"}}:A.value={...N,left:`${D}px`,top:`${I}px`}},{immediate:!0}),{x:f,y:g,strategy:h,placement:m,middlewareData:p,isPositioned:w,floatingStyles:A,update:O,refs:{anchorEl:e,floatingEl:t,arrowEl:v},open:r,setOpen:a}}function Ft(e,t){const n=Ht(e);return Math.round(t*n)/n}function Ht(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function go(e,t,n={},o={}){const{...i}=n,l=it(e,t,i),r=It(l,o);return{...r,addNode:(g,m,h={})=>{const{parentId:p,...w}=h,v=it(g,m,w);return r.addNode(v,p)},getAllOpenNodes:()=>{const g=[];for(const m of r.nodeMap.values())m.data.open.value&&g.push(m);return g},getTopmostOpenNode:()=>{let g=null,m=-1;for(const h of r.nodeMap.values())if(h.data.open.value){const p=h.getPath().length;p>m&&(m=p,g=h)}return g},applyToNodes:(g,m,h={})=>{const{relationship:p="self-and-children",applyToMatching:w=!0}=h,v=r.findNodeById(g);if(!v)return;const E=[],O=new Set,T=y=>{y&&!O.has(y.id)&&(E.push(y),O.add(y.id))},A=y=>{for(const x of y)T(x)};if(p==="ancestors-only")for(const y of v.getPath())y.id!==v.id&&T(y);else if(p==="siblings-only"){if(v.parent.value)for(const y of v.parent.value.children.value)y.id!==v.id&&T(y)}else if(p==="descendants-only")for(const y of r.traverse("dfs",v))y.id!==v.id&&T(y);else if(p==="children-only")A(v.children.value);else if(p==="self-and-ancestors")A(v.getPath());else if(p==="self-and-children")T(v),A(v.children.value);else if(p==="self-and-descendants")A(r.traverse("dfs",v));else if(p==="self-and-siblings")T(v),v.parent.value&&A(v.parent.value.children.value);else if(p==="self-ancestors-and-children")A(v.getPath()),A(v.children.value);else if(p==="full-branch")A(v.getPath()),A(r.traverse("dfs",v));else if(p==="all-except-branch"){const y=new Set;for(const x of v.getPath())y.add(x.id);for(const x of r.traverse("dfs",v))y.add(x.id);for(const x of r.nodeMap.values())!y.has(x.id)===w&&m(x);return}else{console.warn(`applyToNodes: Unknown relationship "${p}".`);return}if(w)for(const y of E)m(y);else for(const y of r.nodeMap.values())O.has(y.id)||m(y)}}}function rt(e,t=null,n={},o=!1){const i=n.id??un(),l=u.shallowRef(t),r=u.shallowRef([]),a=u.computed(()=>r.value.length===0),d={id:i,data:e,parent:l,children:r,isRoot:o,isLeaf:a,addChild:c=>{r.value=[...r.value,c]},_removeChildInstance:c=>r.value.includes(c)?(r.value=r.value.filter(f=>f.id!==c.id),c.parent.value=null,!0):!1,findChild:c=>r.value.find(c)??null,findDescendant:c=>{const f=[d];for(;f.length>0;){const g=f.pop();if(c(g))return g;for(let m=g.children.value.length-1;m>=0;m--)f.push(g.children.value[m])}return null},isDescendantOf:c=>{let f=l.value;for(;f;){if(f.id===c.id)return!0;f=f.parent.value}return!1},getPath:()=>{const c=[];let f=d;for(;f;)c.push(f),f=f.parent.value;return c.reverse()}};return Object.freeze(d)}function It(e,t){const n=(t==null?void 0:t.deleteStrategy)??"recursive",o=u.shallowReactive(new Map),i=rt(e,null,{},!0);o.set(i.id,i);const l=m=>o.get(m)??null,r=(m,h=null,p={})=>{const w=h?l(h):i;if(!w)return console.error(`Tree addNode: Parent node with ID ${h} not found.`),null;p.id&&o.has(p.id)&&(p.id=void 0);const v=rt(m,w,p);return o.set(v.id,v),w.addChild(v),v},a=(m,h)=>{const p=h??n,w=l(m);if(!w)return!1;if(w.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const v=w.parent.value;if(p==="recursive")g(w);else{for(const E of w.children.value)E.parent.value=null;w.children.value=[],o.delete(w.id)}return v._removeChildInstance(w)},d=(m,h)=>{const p=l(m);if(!p)return console.error(`Tree moveNode: Node with ID ${m} not found.`),!1;if(p.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(m===h)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const w=h?l(h):i;if(!w)return console.error(`Tree moveNode: New parent node with ID ${h} not found.`),!1;if(w.isDescendantOf(p))return console.error("Tree moveNode: Cannot move a node to become its own descendant."),!1;const v=p.parent.value;if(v){if(!v._removeChildInstance(p))return console.error("Tree moveNode: Failed to remove node from its original parent."),!1}else if(p.isRoot){if(p.isRoot)return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."),!1}return w.addChild(p),p.parent.value=w,!0},c=(m="dfs",h=i)=>{const p=[];if(!h)return console.warn("Tree traverse: Start node is null, returning empty array."),p;if(m==="dfs"){const w=[h];for(;w.length>0;){const v=w.pop();p.push(v);for(let E=v.children.value.length-1;E>=0;E--)w.push(v.children.value[E])}}else{const w=[h];for(;w.length>0;){const v=w.shift();p.push(v);for(const E of v.children.value)w.push(E)}}return p},f=()=>{o.clear()},g=m=>{const h=[...m.children.value];for(const p of h)g(p);o.delete(m.id),m.children.value=[]};return Object.freeze({get root(){return i},get nodeMap(){return o},findNodeById:l,addNode:r,removeNode:a,moveNode:d,traverse:c,dispose:f})}M.clearTimeoutIfSet=Ue,M.contains=Te,M.createTree=It,M.createTreeNode=rt,M.findDescendantContainingTarget=Oe,M.flip=co,M.getContextFromParameter=be,M.getCurrentTime=_e,M.getTarget=ct,M.hide=uo,M.isButtonTarget=Xe,M.isClickOnScrollbar=at,M.isEventTargetWithin=ze,M.isHTMLElement=lt,M.isMac=We,M.isMouseLikePointerType=$e,M.isSafari=Be,M.isSpaceIgnored=Ye,M.isTargetWithinElement=z,M.isTreeNode=ut,M.isTypeableElement=je,M.isVirtualElement=Jt,M.matchesFocusVisible=st,M.offset=lo,M.shift=ao,M.useArrow=mo,M.useClick=Qt,M.useClientPoint=nn,M.useEscapeKey=on,M.useFloating=it,M.useFloatingTree=go,M.useFocus=ln,M.useHover=mn,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-float",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Vue 3 port of Floating UI - a library for positioning floating elements",
5
5
  "private": false,
6
6
  "type": "module",
@@ -63,7 +63,7 @@
63
63
  "build-only": "vite build",
64
64
  "type-check": "vue-tsc --build tsconfig.build.json",
65
65
  "lint": "biome check --write",
66
- "test": "vitest --workspace=vitest.workspace.ts",
66
+ "test": "vitest",
67
67
  "docs:dev": "vitepress dev docs",
68
68
  "docs:build": "vitepress build docs",
69
69
  "docs:preview": "vitepress preview docs",
@@ -1,144 +0,0 @@
1
- import { Ref } from 'vue';
2
- /**
3
- * Options for creating a TreeNode
4
- */
5
- export interface TreeNodeOptions {
6
- /** Optional ID for the node. If not provided, one will be generated. */
7
- id?: string;
8
- }
9
- /**
10
- * Options for configuring tree behavior
11
- */
12
- export interface TreeOptions {
13
- /** Strategy for deleting child nodes when a parent is deleted.
14
- * - 'orphan': Children are detached from the tree (parent becomes null).
15
- * - 'recursive': Children are also deleted recursively.
16
- * @default 'recursive'
17
- */
18
- deleteStrategy?: "orphan" | "recursive";
19
- }
20
- /**
21
- * Represents a node in a reactive tree structure.
22
- * Each node contains data, parent reference, and children references.
23
- */
24
- export declare class TreeNode<T> {
25
- #private;
26
- readonly id: string;
27
- data: T;
28
- parent: Ref<TreeNode<T> | null>;
29
- children: Ref<TreeNode<T>[]>;
30
- constructor(data: T, parent?: TreeNode<T> | null, options?: TreeNodeOptions, isRoot?: boolean);
31
- /**
32
- * Adds an existing node instance to this node's children array.
33
- * @internal
34
- * @param childNode The TreeNode instance to add.
35
- */
36
- addChild(childNode: TreeNode<T>): void;
37
- /**
38
- * Removes a specific child node instance from this node's children.
39
- * @internal
40
- * Note: This only removes the direct child link. Use the Tree's `removeNode` method for full removal including map updates and recursive deletion.
41
- * @param childNode The child node instance to remove.
42
- * @returns True if the child was found and removed, false otherwise.
43
- */
44
- _removeChildInstance(childNode: TreeNode<T>): boolean;
45
- /**
46
- * Finds the first direct child matching the predicate.
47
- * @param predicate Function to test each child node.
48
- * @returns The matching child node or null if not found.
49
- */
50
- findChild(predicate: (node: TreeNode<T>) => boolean): TreeNode<T> | null;
51
- /**
52
- * Finds the first descendant node (including self) matching the predicate using DFS.
53
- * @param predicate Function to test each node.
54
- * @returns The matching descendant node or null if not found.
55
- */
56
- findDescendant(predicate: (node: TreeNode<T>) => boolean): TreeNode<T> | null;
57
- /**
58
- * Checks if this node is a descendant of the potential ancestor.
59
- * @param potentialAncestor The node to check against.
60
- * @returns True if this node is a descendant, false otherwise.
61
- */
62
- isDescendantOf(potentialAncestor: TreeNode<T>): boolean;
63
- /**
64
- * Gets the path of nodes from the root to this node.
65
- * @returns An array of nodes starting with the root and ending with this node.
66
- */
67
- getPath(): TreeNode<T>[];
68
- /** Checks if the node is the true root of the tree, distinct from an orphaned node. */
69
- get isRoot(): boolean;
70
- /** Checks if the node is a leaf node (has no children). */
71
- get isLeaf(): boolean;
72
- }
73
- /**
74
- * Manages a reactive tree structure.
75
- *
76
- * This class provides a complete tree data structure with reactive nodes,
77
- * supporting operations like adding, removing, and moving nodes, as well as
78
- * traversal and search functionality.
79
- *
80
- * @template T The type of data stored in the tree nodes.
81
- */
82
- export declare class Tree<T> {
83
- #private;
84
- /** The root node of the tree. */
85
- readonly root: TreeNode<T>;
86
- /** Readonly reactive map of node IDs to TreeNode instances for quick lookups. */
87
- readonly nodeMap: Readonly<Map<string, TreeNode<T>>>;
88
- /**
89
- * Creates a new Tree instance.
90
- * @param initialRootData Data for the root node.
91
- * @param options Configuration options for the tree behavior.
92
- *
93
- * @example
94
- * ```ts
95
- * const myTree = new Tree({ name: 'Root' });
96
- * const childNode = myTree.addNode({ name: 'Child' }, myTree.root.id);
97
- * ```
98
- */
99
- constructor(initialRootData: T, options?: TreeOptions);
100
- /**
101
- * Finds a node anywhere in the tree by its ID.
102
- * @param id The ID of the node to find.
103
- * @returns The node if found, otherwise null.
104
- */
105
- findNodeById(id: string): TreeNode<T> | null;
106
- /**
107
- * Adds a new node to the tree.
108
- * @param data The data for the new node.
109
- * @param parentId The ID of the parent node. If null or undefined, adds to the root.
110
- * @param nodeOptions Optional configuration for the new node (e.g., custom ID).
111
- * @returns The newly created TreeNode, or null if the parent was not found.
112
- */
113
- addNode(data: T, parentId?: string | null, nodeOptions?: TreeNodeOptions): TreeNode<T> | null;
114
- /**
115
- * Removes a node from the tree by its ID.
116
- * Handles deletion of descendants based on the provided strategy or the tree's default.
117
- * @param nodeId The ID of the node to remove.
118
- * @param deleteStrategy Optional strategy override. If not provided, uses the tree's default strategy.
119
- * @returns True if the node was successfully removed, false otherwise.
120
- */
121
- removeNode(nodeId: string, deleteStrategy?: "orphan" | "recursive"): boolean;
122
- /**
123
- * Moves a node to become a child of a new parent.
124
- * @param nodeId The ID of the node to move.
125
- * @param newParentId The ID of the new parent node. Set to null to move to the root level.
126
- * @returns True if the node was successfully moved, false otherwise.
127
- */
128
- moveNode(nodeId: string, newParentId: string | null): boolean;
129
- /**
130
- * Traverses the tree using either Depth-First Search (DFS) or Breadth-First Search (BFS).
131
- * @param strategy The traversal strategy ('dfs' or 'bfs'). Defaults to 'dfs'.
132
- * @param startNode The node to start traversal from. Defaults to the root node.
133
- * @returns An array of nodes in the order they were visited.
134
- */
135
- traverse(strategy?: "dfs" | "bfs", startNode?: TreeNode<T> | null): TreeNode<T>[];
136
- /**
137
- * Clears the internal node map. This is crucial for allowing garbage collection
138
- * when the Tree instance is no longer needed, especially in scenarios like
139
- * Vue components where the instance might be tied to the component lifecycle.
140
- * Call this method when you are finished with the Tree instance (e.g., in `onScopeDispose`).
141
- */
142
- dispose(): void;
143
- }
144
- //# sourceMappingURL=use-tree.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["../../src/composables/use-tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAA+B,MAAM,KAAK,CAAA;AAM3D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAE1B;;;;OAIG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;CACxC;AAQD;;;GAGG;AACH,qBAAa,QAAQ,CAAC,CAAC;;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC/B,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;gBAI1B,IAAI,EAAE,CAAC,EACP,MAAM,GAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAW,EACjC,OAAO,GAAE,eAAoB,EAC7B,MAAM,UAAQ;IAShB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAKtC;;;;;;OAMG;IACH,oBAAoB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO;IAQrD;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAIxE;;;;OAIG;IACH,cAAc,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAgB7E;;;;OAIG;IACH,cAAc,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO;IAWvD;;;OAGG;IACH,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;IAUxB,uFAAuF;IACvF,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,2DAA2D;IAC3D,IAAI,MAAM,IAAI,OAAO,CAEpB;CACF;AAMD;;;;;;;;GAQG;AACH,qBAAa,IAAI,CAAC,CAAC;;IACjB,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAIpD;;;;;;;;;;OAUG;gBACS,eAAe,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,WAAW;IAQrD;;;;OAIG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAI5C;;;;;;OAMG;IACH,OAAO,CACL,IAAI,EAAE,CAAC,EACP,QAAQ,GAAE,MAAM,GAAG,IAAW,EAC9B,WAAW,GAAE,eAAoB,GAChC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAqBrB;;;;;;OAMG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO;IAiC5E;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IAqD7D;;;;;OAKG;IACH,QAAQ,CACN,QAAQ,GAAE,KAAK,GAAG,KAAa,EAC/B,SAAS,GAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAgB,GACxC,QAAQ,CAAC,CAAC,CAAC,EAAE;IAgChB;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAiBhB"}