v-float 0.1.0 → 0.2.1
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.
- package/README.md +97 -86
- package/dist/composables/interactions/polygon.d.ts +28 -0
- package/dist/composables/interactions/polygon.d.ts.map +1 -0
- package/dist/composables/interactions/use-dismiss.d.ts.map +1 -1
- package/dist/composables/interactions/use-hover.d.ts +11 -15
- package/dist/composables/interactions/use-hover.d.ts.map +1 -1
- package/dist/composables/use-arrow.d.ts +9 -2
- package/dist/composables/use-arrow.d.ts.map +1 -1
- package/dist/composables/use-floating.d.ts +7 -22
- package/dist/composables/use-floating.d.ts.map +1 -1
- package/dist/composables/use-tree.d.ts +0 -7
- package/dist/composables/use-tree.d.ts.map +1 -1
- package/dist/utils.d.ts +15 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/v-float.es.js +1243 -1021
- package/dist/v-float.umd.js +1 -1
- package/package.json +9 -3
- package/dist/composables/utils/dom.d.ts +0 -11
- package/dist/composables/utils/dom.d.ts.map +0 -1
- package/dist/composables/utils/use-composition.d.ts +0 -4
- package/dist/composables/utils/use-composition.d.ts.map +0 -1
- package/dist/utils/dom.d.ts +0 -9
- package/dist/utils/dom.d.ts.map +0 -1
- package/dist/utils/id.d.ts +0 -2
- package/dist/utils/id.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/reactivity.d.ts +0 -2
- package/dist/utils/reactivity.d.ts.map +0 -1
- package/dist/utils/type-guards.d.ts +0 -8
- package/dist/utils/type-guards.d.ts.map +0 -1
package/dist/v-float.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(E,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(E=typeof globalThis<"u"?globalThis:E||self,a(E.VFloat={},E.Vue))})(this,function(E,a){"use strict";var Ln=Object.defineProperty;var at=E=>{throw TypeError(E)};var On=(E,a,C)=>a in E?Ln(E,a,{enumerable:!0,configurable:!0,writable:!0,value:C}):E[a]=C;var Q=(E,a,C)=>On(E,typeof a!="symbol"?a+"":a,C),Se=(E,a,C)=>a.has(E)||at("Cannot "+C);var Ve=(E,a,C)=>(Se(E,a,"read from private field"),C?C.call(E):a.get(E)),we=(E,a,C)=>a.has(E)?at("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(E):a.set(E,C),Ne=(E,a,C,ie)=>(Se(E,a,"write to private field"),ie?ie.call(E,C):a.set(E,C),C),ke=(E,a,C)=>(Se(E,a,"access private method"),C);var le,ce,ae,Fe;function C(e,t){const n=ie(e);return Math.round(t*n)/n}function ie(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}let ut=0;function ft(){return`vfloat-id-${ut++}`}const dt=["top","right","bottom","left"],Z=Math.min,U=Math.max,ue=Math.round,fe=Math.floor,k=e=>({x:e,y:e}),ht={left:"right",right:"left",bottom:"top",top:"bottom"},pt={start:"end",end:"start"};function ye(e,t,n){return U(e,Z(t,n))}function z(e,t){return typeof e=="function"?e(t):e}function q(e){return e.split("-")[0]}function re(e){return e.split("-")[1]}function He(e){return e==="x"?"y":"x"}function xe(e){return e==="y"?"height":"width"}function ee(e){return["top","bottom"].includes(q(e))?"y":"x"}function be(e){return He(ee(e))}function mt(e,t,n){n===void 0&&(n=!1);const o=re(e),i=be(e),s=xe(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=de(r)),[r,de(r)]}function vt(e){const t=de(e);return[Ee(e),t,Ee(t)]}function Ee(e){return e.replace(/start|end/g,t=>pt[t])}function gt(e,t,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?s:r;default:return[]}}function wt(e,t,n,o){const i=re(e);let s=gt(q(e),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),t&&(s=s.concat(s.map(Ee)))),s}function de(e){return e.replace(/left|right|bottom|top/g,t=>ht[t])}function yt(e){return{top:0,right:0,bottom:0,left:0,...e}}function Be(e){return typeof e!="number"?yt(e):{top:e,right:e,bottom:e,left:e}}function he(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 We(e,t,n){let{reference:o,floating:i}=e;const s=ee(t),r=be(t),l=xe(r),u=q(t),c=s==="y",d=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,g=o[l]/2-i[l]/2;let p;switch(u){case"top":p={x:d,y:o.y-i.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-i.width,y:f};break;default:p={x:o.x,y:o.y}}switch(re(t)){case"start":p[r]-=g*(n&&c?-1:1);break;case"end":p[r]+=g*(n&&c?-1:1);break}return p}const xt=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),u=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=We(c,o,u),g=o,p={},v=0;for(let h=0;h<l.length;h++){const{name:m,fn:y}=l[h],{x:L,y:b,data:w,reset:T}=await y({x:d,y:f,initialPlacement:o,placement:g,strategy:i,middlewareData:p,rects:c,platform:r,elements:{reference:e,floating:t}});d=L??d,f=b??f,p={...p,[m]:{...p[m],...w}},T&&v<=50&&(v++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(c=T.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:d,y:f}=We(c,g,u)),h=-1)}return{x:d,y:f,placement:g,strategy:i,middlewareData:p}};async function pe(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:s,rects:r,elements:l,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=z(t,e),v=Be(p),m=l[g?f==="floating"?"reference":"floating":f],y=he(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:u})),L=f==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},T=he(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:L,offsetParent:b,strategy:u}):L);return{top:(y.top-T.top+v.top)/w.y,bottom:(T.bottom-y.bottom+v.bottom)/w.y,left:(y.left-T.left+v.left)/w.x,right:(T.right-y.right+v.right)/w.x}}const bt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:r,elements:l,middlewareData:u}=t,{element:c,padding:d=0}=z(e,t)||{};if(c==null)return{};const f=Be(d),g={x:n,y:o},p=be(i),v=xe(p),h=await r.getDimensions(c),m=p==="y",y=m?"top":"left",L=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=s.reference[v]+s.reference[p]-g[p]-s.floating[v],T=g[p]-s.reference[p],P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let O=P?P[b]:0;(!O||!await(r.isElement==null?void 0:r.isElement(P)))&&(O=l.floating[b]||s.floating[v]);const j=w/2-T/2,B=O/2-h[v]/2-1,N=Z(f[y],B),Y=Z(f[L],B),x=N,M=O-h[v]-Y,R=O/2-h[v]/2+j,X=ye(x,R,M),$=!u.arrow&&re(i)!=null&&R!==X&&s.reference[v]/2-(R<x?N:Y)-h[v]/2<0,W=$?R<x?R-x:R-M:0;return{[p]:g[p]+W,data:{[p]:X,centerOffset:R-X-W,...$&&{alignmentOffset:W}},reset:$}}}),Et=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:l,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...m}=z(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=q(i),L=ee(l),b=q(l)===l,w=await(u.isRTL==null?void 0:u.isRTL(c.floating)),T=g||(b||!h?[de(l)]:vt(l)),P=v!=="none";!g&&P&&T.push(...wt(l,h,v,w));const O=[l,...T],j=await pe(t,m),B=[];let N=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&B.push(j[y]),f){const R=mt(i,r,w);B.push(j[R[0]],j[R[1]])}if(N=[...N,{placement:i,overflows:B}],!B.every(R=>R<=0)){var Y,x;const R=(((Y=s.flip)==null?void 0:Y.index)||0)+1,X=O[R];if(X)return{data:{index:R,overflows:N},reset:{placement:X}};let $=(x=N.filter(W=>W.overflows[0]<=0).sort((W,_)=>W.overflows[1]-_.overflows[1])[0])==null?void 0:x.placement;if(!$)switch(p){case"bestFit":{var M;const W=(M=N.filter(_=>{if(P){const K=ee(_.placement);return K===L||K==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(K=>K>0).reduce((K,Tn)=>K+Tn,0)]).sort((_,K)=>_[1]-K[1])[0])==null?void 0:M[0];W&&($=W);break}case"initialPlacement":$=l;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function $e(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ie(e){return dt.some(t=>e[t]>=0)}const Tt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=z(e,t);switch(o){case"referenceHidden":{const s=await pe(t,{...i,elementContext:"reference"}),r=$e(s,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Ie(r)}}}case"escaped":{const s=await pe(t,{...i,altBoundary:!0}),r=$e(s,n.floating);return{data:{escapedOffsets:r,escaped:Ie(r)}}}default:return{}}}}};async function Lt(e,t){const{placement:n,platform:o,elements:i}=e,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=q(n),l=re(n),u=ee(n)==="y",c=["left","top"].includes(r)?-1:1,d=s&&u?-1:1,f=z(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(p=l==="end"?v*-1:v),u?{x:p*d,y:g*c}:{x:g*c,y:p*d}}const Ot=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:s,placement:r,middlewareData:l}=t,u=await Lt(t,e);return r===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:r}}}}},Pt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:m=>{let{x:y,y:L}=m;return{x:y,y:L}}},...u}=z(e,t),c={x:n,y:o},d=await pe(t,u),f=ee(q(i)),g=He(f);let p=c[g],v=c[f];if(s){const m=g==="y"?"top":"left",y=g==="y"?"bottom":"right",L=p+d[m],b=p-d[y];p=ye(L,p,b)}if(r){const m=f==="y"?"top":"left",y=f==="y"?"bottom":"right",L=v+d[m],b=v-d[y];v=ye(L,v,b)}const h=l.fn({...t,[g]:p,[f]:v});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[g]:s,[f]:r}}}}}};function me(){return typeof window<"u"}function te(e){return je(e)?(e.nodeName||"").toLowerCase():"#document"}function A(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function F(e){var t;return(t=(je(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function je(e){return me()?e instanceof Node||e instanceof A(e).Node:!1}function D(e){return me()?e instanceof Element||e instanceof A(e).Element:!1}function H(e){return me()?e instanceof HTMLElement||e instanceof A(e).HTMLElement:!1}function Ye(e){return!me()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof A(e).ShadowRoot}function se(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=S(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Ct(e){return["table","td","th"].includes(te(e))}function ve(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Te(e){const t=Le(),n=D(e)?S(e):e;return["transform","translate","scale","rotate","perspective"].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)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Rt(e){let t=I(e);for(;H(t)&&!ne(t);){if(Te(t))return t;if(ve(t))return null;t=I(t)}return null}function Le(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ne(e){return["html","body","#document"].includes(te(e))}function S(e){return A(e).getComputedStyle(e)}function ge(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function I(e){if(te(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ye(e)&&e.host||F(e);return Ye(t)?t.host:t}function Xe(e){const t=I(e);return ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:H(t)&&se(t)?t:Xe(t)}function G(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Xe(e),s=i===((o=e.ownerDocument)==null?void 0:o.body),r=A(i);if(s){const l=Oe(r);return t.concat(r,r.visualViewport||[],se(i)?i:[],l&&n?G(l):[])}return t.concat(i,G(i,[],n))}function Oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _e(e){const t=S(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=H(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,l=ue(n)!==s||ue(o)!==r;return l&&(n=s,o=r),{width:n,height:o,$:l}}function Pe(e){return D(e)?e:e.contextElement}function oe(e){const t=Pe(e);if(!H(t))return k(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=_e(t);let r=(s?ue(n.width):n.width)/o,l=(s?ue(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Mt=k(0);function Ke(e){const t=A(e);return!Le()||!t.visualViewport?Mt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function At(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==A(e)?!1:t}function J(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Pe(e);let r=k(1);t&&(o?D(o)&&(r=oe(o)):r=oe(e));const l=At(s,n,o)?Ke(s):k(0);let u=(i.left+l.x)/r.x,c=(i.top+l.y)/r.y,d=i.width/r.x,f=i.height/r.y;if(s){const g=A(s),p=o&&D(o)?A(o):o;let v=g,h=Oe(v);for(;h&&o&&p!==v;){const m=oe(h),y=h.getBoundingClientRect(),L=S(h),b=y.left+(h.clientLeft+parseFloat(L.paddingLeft))*m.x,w=y.top+(h.clientTop+parseFloat(L.paddingTop))*m.y;u*=m.x,c*=m.y,d*=m.x,f*=m.y,u+=b,c+=w,v=A(h),h=Oe(v)}}return he({width:d,height:f,x:u,y:c})}function Ce(e,t){const n=ge(e).scrollLeft;return t?t.left+n:J(F(e)).left+n}function Ue(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:Ce(e,o)),s=o.top+t.scrollTop;return{x:i,y:s}}function Dt(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s=i==="fixed",r=F(o),l=t?ve(t.floating):!1;if(o===r||l&&s)return n;let u={scrollLeft:0,scrollTop:0},c=k(1);const d=k(0),f=H(o);if((f||!f&&!s)&&((te(o)!=="body"||se(r))&&(u=ge(o)),H(o))){const p=J(o);c=oe(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const g=r&&!f&&!s?Ue(r,u,!0):k(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+g.x,y:n.y*c.y-u.scrollTop*c.y+d.y+g.y}}function St(e){return Array.from(e.getClientRects())}function Vt(e){const t=F(e),n=ge(e),o=e.ownerDocument.body,i=U(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=U(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ce(e);const l=-n.scrollTop;return S(o).direction==="rtl"&&(r+=U(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:l}}function Nt(e,t){const n=A(e),o=F(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,l=0,u=0;if(i){s=i.width,r=i.height;const c=Le();(!c||c&&t==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:s,height:r,x:l,y:u}}function kt(e,t){const n=J(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=H(e)?oe(e):k(1),r=e.clientWidth*s.x,l=e.clientHeight*s.y,u=i*s.x,c=o*s.y;return{width:r,height:l,x:u,y:c}}function qe(e,t,n){let o;if(t==="viewport")o=Nt(e,n);else if(t==="document")o=Vt(F(e));else if(D(t))o=kt(t,n);else{const i=Ke(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return he(o)}function Ge(e,t){const n=I(e);return n===t||!D(n)||ne(n)?!1:S(n).position==="fixed"||Ge(n,t)}function Ft(e,t){const n=t.get(e);if(n)return n;let o=G(e,[],!1).filter(l=>D(l)&&te(l)!=="body"),i=null;const s=S(e).position==="fixed";let r=s?I(e):e;for(;D(r)&&!ne(r);){const l=S(r),u=Te(r);!u&&l.position==="fixed"&&(i=null),(s?!u&&!i:!u&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||se(r)&&!u&&Ge(e,r))?o=o.filter(d=>d!==r):i=l,r=I(r)}return t.set(e,o),o}function Ht(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?ve(t)?[]:Ft(t,this._c):[].concat(n),o],l=r[0],u=r.reduce((c,d)=>{const f=qe(t,d,i);return c.top=U(f.top,c.top),c.right=Z(f.right,c.right),c.bottom=Z(f.bottom,c.bottom),c.left=U(f.left,c.left),c},qe(t,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Bt(e){const{width:t,height:n}=_e(e);return{width:t,height:n}}function Wt(e,t,n){const o=H(t),i=F(t),s=n==="fixed",r=J(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=k(0);if(o||!o&&!s)if((te(t)!=="body"||se(i))&&(l=ge(t)),o){const g=J(t,!0,s,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else i&&(u.x=Ce(i));const c=i&&!o&&!s?Ue(i,l):k(0),d=r.left+l.scrollLeft-u.x-c.x,f=r.top+l.scrollTop-u.y-c.y;return{x:d,y:f,width:r.width,height:r.height}}function Re(e){return S(e).position==="static"}function Je(e,t){if(!H(e)||S(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return F(e)===n&&(n=n.ownerDocument.body),n}function Qe(e,t){const n=A(e);if(ve(e))return n;if(!H(e)){let i=I(e);for(;i&&!ne(i);){if(D(i)&&!Re(i))return i;i=I(i)}return n}let o=Je(e,t);for(;o&&Ct(o)&&Re(o);)o=Je(o,t);return o&&ne(o)&&Re(o)&&!Te(o)?n:o||Rt(e)||n}const $t=async function(e){const t=this.getOffsetParent||Qe,n=this.getDimensions,o=await n(e.floating);return{reference:Wt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function It(e){return S(e).direction==="rtl"}const jt={convertOffsetParentRelativeRectToViewportRelativeRect:Dt,getDocumentElement:F,getClippingRect:Ht,getOffsetParent:Qe,getElementRects:$t,getClientRects:St,getDimensions:Bt,getScale:oe,isElement:D,isRTL:It};function Ze(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yt(e,t){let n=null,o;const i=F(e);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function r(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const c=e.getBoundingClientRect(),{left:d,top:f,width:g,height:p}=c;if(l||t(),!g||!p)return;const v=fe(f),h=fe(i.clientWidth-(d+g)),m=fe(i.clientHeight-(f+p)),y=fe(d),b={rootMargin:-v+"px "+-h+"px "+-m+"px "+-y+"px",threshold:U(0,Z(1,u))||1};let w=!0;function T(P){const O=P[0].intersectionRatio;if(O!==u){if(!w)return r();O?r(!1,O):o=setTimeout(()=>{r(!1,1e-7)},1e3)}O===1&&!Ze(c,e.getBoundingClientRect())&&r(),w=!1}try{n=new IntersectionObserver(T,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return r(!0),s}function ze(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,c=Pe(e),d=i||s?[...c?G(c):[],...G(t)]:[];d.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=c&&l?Yt(c,n):null;let g=-1,p=null;r&&(p=new ResizeObserver(y=>{let[L]=y;L&&L.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,h=u?J(e):null;u&&m();function m(){const y=J(e);h&&!Ze(h,y)&&n(),h=y,v=requestAnimationFrame(m)}return n(),()=>{var y;d.forEach(L=>{i&&L.removeEventListener("scroll",n),s&&L.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const Xt=Ot,_t=Pt,Kt=Et,Ut=Tt,qt=bt,Gt=(e,t,n)=>{const o=new Map,i={platform:jt,...n},s={...i.platform,_c:o};return xt(e,t,{...i,platform:s})};function Jt(e,t,n={}){const{transform:o=!0,middlewares:i,whileElementsMounted:s,open:r=a.ref(!1),setOpen:l=b=>{r.value=b}}=n,u=a.computed(()=>a.toValue(n.placement)??"bottom"),c=a.computed(()=>a.toValue(n.strategy)??"absolute"),d=a.ref(0),f=a.ref(0),g=a.ref(u.value),p=a.ref(c.value),v=a.shallowRef({}),h=a.ref(!1),m=async()=>{if(!e.value||!t.value)return;const b=await Gt(e.value,t.value,{placement:u.value,strategy:c.value,middleware:i});d.value=b.x,f.value=b.y,g.value=b.placement,p.value=b.strategy,v.value=b.middlewareData,h.value=r.value};a.watch([u,c],()=>{r.value&&m()});let y;a.watch([e,t,r],([b,w,T])=>{!T||!b||!w||(s?y=s(b,w,m):y=ze(b,w,m),a.onWatcherCleanup(()=>{y==null||y(),y=void 0}))},{immediate:!0}),a.onScopeDispose(()=>y==null?void 0:y()),a.watch(r,b=>{b||(h.value=!1)});const L=a.computed(()=>{const b={position:p.value,left:"0",top:"0"};if(!h.value||!t.value)return b;const w=C(t.value,d.value),T=C(t.value,f.value);return a.toValue(o)?{...b,transform:`translate(${w}px, ${T}px)`,...ie(t.value)>=1.5&&{willChange:"transform"}}:{...b,left:`${w}px`,top:`${T}px`}});return{x:d,y:f,strategy:p,placement:g,middlewareData:v,isPositioned:h,floatingStyles:L,update:m,refs:{anchorEl:e,floatingEl:t},open:r,setOpen:l}}function Qt(e,t,n,o={}){return ze(e,t,n,o)}function Zt(e,t={}){const{middlewareData:n,placement:o}=e,{offset:i="-12px"}=t,s=a.computed(()=>{var u;return((u=n.value.arrow)==null?void 0:u.x)??0}),r=a.computed(()=>{var u;return((u=n.value.arrow)==null?void 0:u.y)??0}),l=a.computed(()=>{const u={top:"inset-block-end",right:"inset-inline-start",bottom:"inset-block-start",left:"inset-inline-end"}[a.toValue(o).split("-")[0]],c=s.value!=null?`${s.value}px`:"",d=r.value!=null?`${r.value}px`:"";return{"inset-inline-start":c,"inset-block-start":d,[u]:i}});return{arrowX:s,arrowY:r,arrowStyles:l}}const et=10;function zt(e){return e==="mouse"||e==="pen"}function en(e,t,n){const{delay:o}=n,i=a.computed(()=>{const c=a.toValue(o);return(typeof c=="number"?c:c.open)??0}),s=a.computed(()=>{const c=a.toValue(o);return(typeof c=="number"?c:c.close)??0});let r,l;const u=()=>{clearTimeout(r),clearTimeout(l)};return a.onScopeDispose(u),{show:c=>{u();const d=c??i.value;d===0?e():r=setTimeout(e,d)},hide:c=>{u();const d=c??s.value;d===0?t():l=setTimeout(t,d)},showDelay:i,hideDelay:s,clearTimeouts:u}}function tn(e,t={}){const{open:n,setOpen:o,refs:{anchorEl:i,floatingEl:s}}=e,{enabled:r=!0,delay:l=0,restMs:u=0,mouseOnly:c=!1}=t,d=a.computed(()=>a.toValue(r)),f=a.computed(()=>a.toValue(u)),g=a.computed(()=>{const x=i.value;return!x||x instanceof HTMLElement?x:x.contextElement??null}),{hide:p,show:v,showDelay:h,clearTimeouts:m}=en(()=>{n.value||o(!0)},()=>{n.value&&o(!1)},{delay:l});let y=null,L;const b=a.computed(()=>h.value===0&&f.value>0);function w(x){if(!d.value||!O(x)||!b.value||!y)return;const M={x:x.clientX,y:x.clientY},R=Math.abs(M.x-y.x),X=Math.abs(M.y-y.y);(R>et||X>et)&&(y=M,clearTimeout(L),L=setTimeout(()=>{v(0)},f.value))}function T(x){!d.value||!O(x)||!b.value||(y={x:x.clientX,y:x.clientY},L=setTimeout(()=>{v(0)},f.value))}function P(){clearTimeout(L),y=null}a.watchPostEffect(()=>{const x=g.value;!x||!d.value||!b.value||(x.addEventListener("pointerenter",T),x.addEventListener("pointermove",w),x.addEventListener("pointerleave",P),a.onWatcherCleanup(()=>{x.removeEventListener("pointerenter",T),x.removeEventListener("pointermove",w),x.removeEventListener("pointerleave",P)}))}),a.onScopeDispose(()=>{clearTimeout(L)});function O(x){return!(a.toValue(c)&&!zt(x.pointerType))}function j(x){!d.value||!O(x)||b.value||v()}function B(x){!d.value||!O(x)||m()}function N(x){var M;!d.value||!O(x)||(M=s.value)!=null&&M.contains(x.relatedTarget)||p()}function Y(x){var M;!d.value||!O(x)||(M=g.value)!=null&&M.contains(x.relatedTarget)||p()}a.watchPostEffect(()=>{const x=g.value;!x||!d.value||(x.addEventListener("pointerenter",j),x.addEventListener("pointerleave",N),a.onWatcherCleanup(()=>{x.removeEventListener("pointerenter",j),x.removeEventListener("pointerleave",N)}))}),a.watchPostEffect(()=>{const x=s.value;!x||!d.value||(x.addEventListener("pointerenter",B),x.addEventListener("pointerleave",Y),a.onWatcherCleanup(()=>{x.removeEventListener("pointerenter",B),x.removeEventListener("pointerleave",Y)}))})}function nn(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}const on=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const rn=Object.prototype.toString,sn=e=>rn.call(e)==="[object Object]";function Me(e){return Array.isArray(e)?e:[e]}function ln(e,t,n){return a.watch(e,t,{...n,immediate:!0})}const cn=on?window:void 0;function an(e){var t;const n=a.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function V(...e){const t=[],n=()=>{t.forEach(l=>l()),t.length=0},o=(l,u,c,d)=>(l.addEventListener(u,c,d),()=>l.removeEventListener(u,c,d)),i=a.computed(()=>{const l=Me(a.toValue(e[0])).filter(u=>u!=null);return l.every(u=>typeof u!="string")?l:void 0}),s=ln(()=>{var l,u;return[(u=(l=i.value)==null?void 0:l.map(c=>an(c)))!=null?u:[cn].filter(c=>c!=null),Me(a.toValue(i.value?e[1]:e[0])),Me(a.unref(i.value?e[2]:e[1])),a.toValue(i.value?e[3]:e[2])]},([l,u,c,d])=>{if(n(),!(l!=null&&l.length)||!(u!=null&&u.length)||!(c!=null&&c.length))return;const f=sn(d)?{...d}:d;t.push(...l.flatMap(g=>u.flatMap(p=>c.map(v=>o(g,p,v,f)))))},{flush:"post"}),r=()=>{s(),n()};return nn(n),r}function un(e,t={}){const{open:n,setOpen:o,refs:{floatingEl:i,anchorEl:s}}=e,{enabled:r=!0,requireFocusVisible:l=!0}=t,u=a.computed(()=>s.value?s.value instanceof HTMLElement?s.value:s.value.contextElement:null);let c=!1,d=!0,f;V(window,"blur",()=>{!n.value&&u.value&&u.value===document.activeElement&&(c=!0)}),V(window,"focus",()=>{c=!1}),a.onMounted(()=>{tt()&&nt()&&(V(window,"keydown",()=>{d=!0},{capture:!0}),V(window,"pointerdown",()=>{d=!1},{capture:!0}))});function g(v){if(c){c=!1;return}const h=v.target;if(a.toValue(l)&&h){if(tt()&&nt()&&!v.relatedTarget){if(!d&&!fn(h))return}else if(!dn(h))return}o(!0)}function p(v){clearTimeout(f),f=window.setTimeout(()=>{var y;const m=(((y=u.value)==null?void 0:y.ownerDocument)??document).activeElement;!v.relatedTarget&&m===u.value||i.value&&m&&i.value.contains(m)||o(!1)},0)}a.watchPostEffect(()=>{if(!a.toValue(r))return;const v=u.value;!v||!(v instanceof HTMLElement)||(v.addEventListener("focus",g),v.addEventListener("blur",p),a.onWatcherCleanup(()=>{v.removeEventListener("focus",g),v.removeEventListener("blur",p)}))}),a.onScopeDispose(()=>{clearTimeout(f)})}function tt(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function nt(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function fn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement}function dn(e){return e.matches(":focus-visible")}function hn(e,t={}){const{open:n,setOpen:o,refs:i}=e,{enabled:s=!0,event:r="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:c=!0}=t;let d,f=!1;const g=a.computed(()=>a.toValue(s)),p=a.computed(()=>i.anchorEl.value instanceof HTMLElement?i.anchorEl.value:null);function v(){n.value?a.toValue(l)&&o(!1):o(!0)}function h(w){d=w.pointerType}function m(w){if(w.button!==0||a.toValue(r)==="click"||ot(d)&&a.toValue(u))return;const T=w.target;!n.value&&T===p.value&&w.preventDefault(),v()}function y(){if(a.toValue(r)==="mousedown"&&d){d=void 0;return}if(ot(d)&&a.toValue(u)){d=void 0;return}v(),d=void 0}function L(w){if(d=void 0,w.defaultPrevented||!a.toValue(c)||it(w))return;const T=p.value;T&&(w.key===" "&&!rt(T)&&(w.preventDefault(),f=!0),w.key==="Enter"&&v())}function b(w){const T=p.value;T&&(w.defaultPrevented||!a.toValue(c)||it(w)||rt(T)||w.key===" "&&f&&(f=!1,v()))}a.watchPostEffect(()=>{const w=p.value;!g.value||!w||(w.addEventListener("pointerdown",h),w.addEventListener("mousedown",m),w.addEventListener("click",y),w.addEventListener("keydown",L),w.addEventListener("keyup",b),a.onWatcherCleanup(()=>{w.removeEventListener("pointerdown",h),w.removeEventListener("mousedown",m),w.removeEventListener("click",y),w.removeEventListener("keydown",L),w.removeEventListener("keyup",b)}))})}function ot(e,t){return e===void 0?!1:e==="mouse"}function it(e){return e.target instanceof HTMLElement&&e.target.tagName==="BUTTON"}function pn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function rt(e){return pn(e)}function mn(){const e=a.ref(!1);return V(document,"compositionstart",()=>{e.value=!0}),V(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function vn(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Ae(e){return e instanceof Element&&e instanceof HTMLElement}function st(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function gn(e,t){const n=t.offsetWidth-t.clientWidth,o=t.offsetHeight-t.clientHeight;return n>0&&e.clientX>t.clientWidth||o>0&&e.clientY>t.clientHeight}function wn(e,t={}){const{enabled:n=!0,escapeKey:o=!0,outsidePress:i=!0,outsidePressEvent:s="pointerdown",anchorPress:r=!1,anchorPressEvent:l="pointerdown",ancestorScroll:u=!1,capture:c}=t,d=a.computed(()=>a.toValue(n)),f=e.refs.floatingEl,g=a.computed(()=>{const w=e.refs.anchorEl.value;return w?w instanceof HTMLElement?w:w.contextElement instanceof HTMLElement?w.contextElement:null:null}),{isComposing:p}=mn(),{escapeKey:v,outsidePress:h}=vn(c);let m=!1;const y=w=>{!d.value||!e.open.value||!a.toValue(o)||w.key!=="Escape"||p()||e.setOpen(!1)},L=w=>{if(!d.value||!e.open.value)return;if(s==="click"&&m){m=!1;return}const T=a.toValue(i);if(!T||typeof T=="function"&&!T(w))return;const P=w.target;P&&(Ae(P)&&f.value&&gn(w,P)||st(w,g.value)||st(w,f.value)||e.setOpen(!1))},b=()=>{d.value&&e.open.value&&a.toValue(r)&&e.setOpen(!1)};a.watchEffect(w=>{if(!d.value||!e.open.value||!a.toValue(u))return;const T=()=>{e.open.value&&e.setOpen(!1)},P=[];g.value&&P.push(...G(g.value).filter(Ae)),f.value&&P.push(...G(f.value).filter(Ae));for(const O of P)O.addEventListener("scroll",T,{passive:!0});w(()=>{for(const O of P)O.removeEventListener("scroll",T)})}),V(document,"keydown",y,a.toValue(v)),V(document,s,L,a.toValue(h)),V(g,l,b),V(f,"mousedown",()=>{m=!0},{capture:!0}),V(f,"mouseup",()=>{m=!0},{capture:!0})}function yn(e,t,n={}){const{open:o,refs:i}=t;let s;const r=a.ref({x:null,y:null}),l=a.computed(()=>a.toValue(n.axis??"both")),u=a.computed(()=>a.toValue(n.enabled??!0)),c=a.computed(()=>a.toValue(n.x??null)),d=a.computed(()=>a.toValue(n.y??null)),f=(h,m)=>{r.value={x:h,y:m},o.value&&(i.anchorEl.value=xn(e.value,l.value,r.value))};a.watchEffect(()=>{const h=c.value,m=d.value;u.value&&h!=null&&m!=null&&f(h,m)});const g=h=>{s=h.pointerType,f(h.clientX,h.clientY)},p=h=>{s=h.pointerType,!o.value&<(s,!0)&&f(h.clientX,h.clientY)},v=h=>{o.value&<(s,!0)&&f(h.clientX,h.clientY)};return a.watchEffect(()=>{if(c.value!=null||d.value!=null)return;const h=e.value;!h||!u.value||(h.addEventListener("pointerenter",p),h.addEventListener("pointerdown",g),h.addEventListener("pointermove",v),a.onWatcherCleanup(()=>{h==null||h.removeEventListener("pointerenter",p),h==null||h.removeEventListener("pointerdown",g),h==null||h.removeEventListener("pointermove",v)}))}),{coordinates:a.readonly(r),updatePosition:f}}function xn(e,t,n){let o=null,i=null;const s=e;return{contextElement:s||void 0,getBoundingClientRect:()=>{const r=(s==null?void 0:s.getBoundingClientRect())??{width:0,height:0,x:0,y:0},l=t==="x"||t==="both",u=t==="y"||t==="both";let c=0,d=0,f=r.x,g=r.y;return s&&(o==null&&n.x!=null&&l&&(o=r.x-n.x),i==null&&n.y!=null&&u&&(i=r.y-n.y),f-=o||0,g-=i||0),l&&n.x!=null?f=n.x:(o=null,c=r.width),u&&n.y!=null?g=n.y:(i=null,d=r.height),t==="both"&&(c=0,d=0),{width:c,height:d,x:f,y:g,top:g,right:f+c,bottom:g+d,left:f}}}}function lt(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function bn(e){return{name:"arrow",options:e,fn(t){const n=a.toValue(e.element);return n==null?{}:qt({element:n,padding:e.padding}).fn(t)}}}class De{constructor(t,n=null,o={},i=!1){Q(this,"id");Q(this,"data");Q(this,"parent");Q(this,"children");we(this,le);this.id=o.id??ft(),this.data=t,this.parent=a.shallowRef(n),this.children=a.shallowRef([]),Ne(this,le,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}updateData(t){const n=this.data;typeof n=="object"&&n!==null&&typeof t=="object"&&t!==null?this.data=Object.assign({},n,t):this.data=t}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 Ve(this,le)}get isLeaf(){return this.children.value.length===0}}le=new WeakMap;class ct{constructor(t,n){we(this,ae);Q(this,"root");Q(this,"nodeMap");we(this,ce);Ne(this,ce,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=a.shallowReactive(new Map),this.root=new De(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 s=new De(t,i,o);return this.nodeMap.set(s.id,s),i.addChild(s),s}removeNode(t,n){const o=n??Ve(this,ce),i=this.findNodeById(t);if(!i)return!1;if(i.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const s=i.parent.value;if(o==="recursive")ke(this,ae,Fe).call(this,i);else{for(const r of i.children.value)r.parent.value=null;i.children.value=[],this.nodeMap.delete(i.id)}return s._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 s=o.parent.value;if(s){if(!s._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 s=i.pop();o.push(s);for(let r=s.children.value.length-1;r>=0;r--)i.push(s.children.value[r])}}else{const i=[n];for(;i.length>0;){const s=i.shift();o.push(s);for(const r of s.children.value)i.push(r)}}return o}dispose(){this.nodeMap.clear()}}ce=new WeakMap,ae=new WeakSet,Fe=function(t){const n=[...t.children.value];for(const o of n)ke(this,ae,Fe).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function En(e,t={}){const n=new ct(e,t);return{get nodeMap(){return n.nodeMap},get root(){return n.root},findNodeById:r=>n.findNodeById(r),moveNode:(r,l)=>n.moveNode(r,l),dispose:()=>n.dispose(),addNode:(r,l)=>n.addNode(r,l),removeNode:(r,l)=>n.removeNode(r,l),traverse:(r,l)=>n.traverse(r,l),isTopmost:r=>{const l=n.findNodeById(r);if(!l||!l.data.open.value)return!1;let u=l.parent.value;for(;u;){if(u.data.open.value)return!1;u=u.parent.value}return!0},getAllOpenNodes:()=>{const r=[];for(const l of n.nodeMap.values())l.data.open.value&&r.push(l);return r},forEach:(r,l,u={})=>{const{relationship:c="self-and-children",applyToMatching:d=!0}=u,f=n.findNodeById(r);if(!f)return;const g=[],p=new Set,v=m=>{m&&!p.has(m.id)&&(g.push(m),p.add(m.id))},h=m=>{for(const y of m)v(y)};if(c==="ancestors-only")for(const m of f.getPath())m.id!==f.id&&v(m);else if(c==="siblings-only"){if(f.parent.value)for(const m of f.parent.value.children.value)m.id!==f.id&&v(m)}else if(c==="descendants-only")for(const m of n.traverse("dfs",f))m.id!==f.id&&v(m);else if(c==="children-only")h(f.children.value);else if(c==="self-and-ancestors")h(f.getPath());else if(c==="self-and-children")v(f),h(f.children.value);else if(c==="self-and-descendants")h(n.traverse("dfs",f));else if(c==="self-and-siblings")v(f),f.parent.value&&h(f.parent.value.children.value);else if(c==="self-ancestors-and-children")h(f.getPath()),h(f.children.value);else if(c==="full-branch")h(f.getPath()),h(n.traverse("dfs",f));else if(c==="all-except-branch"){const m=new Set;for(const y of f.getPath())m.add(y.id);for(const y of n.traverse("dfs",f))m.add(y.id);for(const y of n.nodeMap.values())!m.has(y.id)===d&&l(y);return}else{console.warn(`forEach: Unknown relationship "${c}".`);return}if(d)for(const m of g)l(m);else for(const m of n.nodeMap.values())p.has(m.id)||l(m)}}}E.Tree=ct,E.TreeNode=De,E.arrow=bn,E.autoUpdate=Qt,E.flip=Kt,E.hide=Ut,E.offset=Xt,E.shift=_t,E.useArrow=Zt,E.useClick=hn,E.useClientPoint=yn,E.useDismiss=wn,E.useFloating=Jt,E.useFloatingTree=En,E.useFocus=un,E.useHover=tn,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(x,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(x=typeof globalThis<"u"?globalThis:x||self,f(x.VFloat={},x.Vue))})(this,function(x,f){"use strict";var jn=Object.defineProperty;var Ct=x=>{throw TypeError(x)};var _n=(x,f,V)=>f in x?jn(x,f,{enumerable:!0,configurable:!0,writable:!0,value:V}):x[f]=V;var oe=(x,f,V)=>_n(x,typeof f!="symbol"?f+"":f,V),Ye=(x,f,V)=>f.has(x)||Ct("Cannot "+V);var Xe=(x,f,V)=>(Ye(x,f,"read from private field"),V?V.call(x):f.get(x)),Oe=(x,f,V)=>f.has(x)?Ct("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(x):f.set(x,V),je=(x,f,V,J)=>(Ye(x,f,"write to private field"),J?J.call(x,V):f.set(x,V),V),_e=(x,f,V)=>(Ye(x,f,"access private method"),V);var de,he,pe,Ke;const V=["top","right","bottom","left"],J=Math.min,Z=Math.max,ve=Math.round,we=Math.floor,K=e=>({x:e,y:e}),Mt={left:"right",right:"left",bottom:"top",top:"bottom"},At={start:"end",end:"start"};function Ce(e,t,n){return Z(e,J(t,n))}function ie(e,t){return typeof e=="function"?e(t):e}function z(e){return e.split("-")[0]}function ue(e){return e.split("-")[1]}function qe(e){return e==="x"?"y":"x"}function Me(e){return e==="y"?"height":"width"}function se(e){return["top","bottom"].includes(z(e))?"y":"x"}function Ae(e){return qe(se(e))}function Dt(e,t,n){n===void 0&&(n=!1);const o=ue(e),i=Ae(e),r=Me(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=ye(s)),[s,ye(s)]}function St(e){const t=ye(e);return[De(e),t,De(t)]}function De(e){return e.replace(/start|end/g,t=>At[t])}function Rt(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:s;default:return[]}}function Vt(e,t,n,o){const i=ue(e);let r=Rt(z(e),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),t&&(r=r.concat(r.map(De)))),r}function ye(e){return e.replace(/left|right|bottom|top/g,t=>Mt[t])}function Nt(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ue(e){return typeof e!="number"?Nt(e):{top:e,right:e,bottom:e,left:e}}function be(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 Ge(e,t,n){let{reference:o,floating:i}=e;const r=se(t),s=Ae(t),c=Me(s),d=z(t),a=r==="y",p=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,v=o[c]/2-i[c]/2;let u;switch(d){case"top":u={x:p,y:o.y-i.height};break;case"bottom":u={x:p,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:h};break;case"left":u={x:o.x-i.width,y:h};break;default:u={x:o.x,y:o.y}}switch(ue(t)){case"start":u[s]-=v*(n&&a?-1:1);break;case"end":u[s]+=v*(n&&a?-1:1);break}return u}const kt=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:h}=Ge(a,o,d),v=o,u={},w=0;for(let m=0;m<c.length;m++){const{name:g,fn:b}=c[m],{x:L,y:P,data:y,reset:O}=await b({x:p,y:h,initialPlacement:o,placement:v,strategy:i,middlewareData:u,rects:a,platform:s,elements:{reference:e,floating:t}});p=L??p,h=P??h,u={...u,[g]:{...u[g],...y}},O&&w<=50&&(w++,typeof O=="object"&&(O.placement&&(v=O.placement),O.rects&&(a=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:p,y:h}=Ge(a,v,d)),m=-1)}return{x:p,y:h,placement:v,strategy:i,middlewareData:u}};async function Ee(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:s,elements:c,strategy:d}=e,{boundary:a="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:v=!1,padding:u=0}=ie(t,e),w=Ue(u),g=c[v?h==="floating"?"reference":"floating":h],b=be(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:a,rootBoundary:p,strategy:d})),L=h==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),y=await(r.isElement==null?void 0:r.isElement(P))?await(r.getScale==null?void 0:r.getScale(P))||{x:1,y:1}:{x:1,y:1},O=be(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:L,offsetParent:P,strategy:d}):L);return{top:(b.top-O.top+w.top)/y.y,bottom:(O.bottom-b.bottom+w.bottom)/y.y,left:(b.left-O.left+w.left)/y.x,right:(O.right-b.right+w.right)/y.x}}const Ft=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:d}=t,{element:a,padding:p=0}=ie(e,t)||{};if(a==null)return{};const h=Ue(p),v={x:n,y:o},u=Ae(i),w=Me(u),m=await s.getDimensions(a),g=u==="y",b=g?"top":"left",L=g?"bottom":"right",P=g?"clientHeight":"clientWidth",y=r.reference[w]+r.reference[u]-v[u]-r.floating[w],O=v[u]-r.reference[u],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let A=C?C[P]:0;(!A||!await(s.isElement==null?void 0:s.isElement(C)))&&(A=c.floating[P]||r.floating[w]);const F=y/2-O/2,E=A/2-m[w]/2-1,l=J(h[b],E),k=J(h[L],E),S=l,I=A-m[w]-k,M=A/2-m[w]/2+F,D=Ce(S,M,I),T=!d.arrow&&ue(i)!=null&&M!==D&&r.reference[w]/2-(M<S?l:k)-m[w]/2<0,R=T?M<S?M-S:M-I:0;return{[u]:v[u]+R,data:{[u]:D,centerOffset:M-D-R,...T&&{alignmentOffset:R}},reset:T}}}),Ht=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:d,elements:a}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:m=!0,...g}=ie(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const b=z(i),L=se(c),P=z(c)===c,y=await(d.isRTL==null?void 0:d.isRTL(a.floating)),O=v||(P||!m?[ye(c)]:St(c)),C=w!=="none";!v&&C&&O.push(...Vt(c,m,w,y));const A=[c,...O],F=await Ee(t,g),E=[];let l=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&E.push(F[b]),h){const M=Dt(i,s,y);E.push(F[M[0]],F[M[1]])}if(l=[...l,{placement:i,overflows:E}],!E.every(M=>M<=0)){var k,S;const M=(((k=r.flip)==null?void 0:k.index)||0)+1,D=A[M];if(D)return{data:{index:M,overflows:l},reset:{placement:D}};let T=(S=l.filter(R=>R.overflows[0]<=0).sort((R,H)=>R.overflows[1]-H.overflows[1])[0])==null?void 0:S.placement;if(!T)switch(u){case"bestFit":{var I;const R=(I=l.filter(H=>{if(C){const W=se(H.placement);return W===L||W==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(W=>W>0).reduce((W,G)=>W+G,0)]).sort((H,W)=>H[1]-W[1])[0])==null?void 0:I[0];R&&(T=R);break}case"initialPlacement":T=c;break}if(i!==T)return{reset:{placement:T}}}return{}}}};function Je(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qe(e){return V.some(t=>e[t]>=0)}const Wt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=ie(e,t);switch(o){case"referenceHidden":{const r=await Ee(t,{...i,elementContext:"reference"}),s=Je(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Qe(s)}}}case"escaped":{const r=await Ee(t,{...i,altBoundary:!0}),s=Je(r,n.floating);return{data:{escapedOffsets:s,escaped:Qe(s)}}}default:return{}}}}};async function $t(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=z(n),c=ue(n),d=se(n)==="y",a=["left","top"].includes(s)?-1:1,p=r&&d?-1:1,h=ie(t,e);let{mainAxis:v,crossAxis:u,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof w=="number"&&(u=c==="end"?w*-1:w),d?{x:u*p,y:v*a}:{x:v*a,y:u*p}}const It=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:s,middlewareData:c}=t,d=await $t(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:r+d.y,data:{...d,placement:s}}}}},Yt=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:s=!1,limiter:c={fn:g=>{let{x:b,y:L}=g;return{x:b,y:L}}},...d}=ie(e,t),a={x:n,y:o},p=await Ee(t,d),h=se(z(i)),v=qe(h);let u=a[v],w=a[h];if(r){const g=v==="y"?"top":"left",b=v==="y"?"bottom":"right",L=u+p[g],P=u-p[b];u=Ce(L,u,P)}if(s){const g=h==="y"?"top":"left",b=h==="y"?"bottom":"right",L=w+p[g],P=w-p[b];w=Ce(L,w,P)}const m=c.fn({...t,[v]:u,[h]:w});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[v]:r,[h]:s}}}}}};function Te(){return typeof window<"u"}function re(e){return Ze(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){var t;return(t=(Ze(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ze(e){return Te()?e instanceof Node||e instanceof Y(e).Node:!1}function X(e){return Te()?e instanceof Element||e instanceof Y(e).Element:!1}function U(e){return Te()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function ze(e){return!Te()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}function fe(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=j(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Xt(e){return["table","td","th"].includes(re(e))}function Pe(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Se(e){const t=Re(),n=X(e)?j(e):e;return["transform","translate","scale","rotate","perspective"].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)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function jt(e){let t=Q(e);for(;U(t)&&!le(t);){if(Se(t))return t;if(Pe(t))return null;t=Q(t)}return null}function Re(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function le(e){return["html","body","#document"].includes(re(e))}function j(e){return Y(e).getComputedStyle(e)}function Le(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q(e){if(re(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ze(e)&&e.host||q(e);return ze(t)?t.host:t}function Be(e){const t=Q(e);return le(t)?e.ownerDocument?e.ownerDocument.body:e.body:U(t)&&fe(t)?t:Be(t)}function B(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Be(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),s=Y(i);if(r){const c=Ve(s);return t.concat(s,s.visualViewport||[],fe(i)?i:[],c&&n?B(c):[])}return t.concat(i,B(i,[],n))}function Ve(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function et(e){const t=j(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=U(e),r=i?e.offsetWidth:n,s=i?e.offsetHeight:o,c=ve(n)!==r||ve(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Ne(e){return X(e)?e:e.contextElement}function ae(e){const t=Ne(e);if(!U(t))return K(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=et(t);let s=(r?ve(n.width):n.width)/o,c=(r?ve(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const _t=K(0);function tt(e){const t=Y(e);return!Re()||!t.visualViewport?_t:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Y(e)?!1:t}function ee(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=Ne(e);let s=K(1);t&&(o?X(o)&&(s=ae(o)):s=ae(e));const c=Kt(r,n,o)?tt(r):K(0);let d=(i.left+c.x)/s.x,a=(i.top+c.y)/s.y,p=i.width/s.x,h=i.height/s.y;if(r){const v=Y(r),u=o&&X(o)?Y(o):o;let w=v,m=Ve(w);for(;m&&o&&u!==w;){const g=ae(m),b=m.getBoundingClientRect(),L=j(m),P=b.left+(m.clientLeft+parseFloat(L.paddingLeft))*g.x,y=b.top+(m.clientTop+parseFloat(L.paddingTop))*g.y;d*=g.x,a*=g.y,p*=g.x,h*=g.y,d+=P,a+=y,w=Y(m),m=Ve(w)}}return be({width:p,height:h,x:d,y:a})}function ke(e,t){const n=Le(e).scrollLeft;return t?t.left+n:ee(q(e)).left+n}function nt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:ke(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function qt(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",s=q(o),c=t?Pe(t.floating):!1;if(o===s||c&&r)return n;let d={scrollLeft:0,scrollTop:0},a=K(1);const p=K(0),h=U(o);if((h||!h&&!r)&&((re(o)!=="body"||fe(s))&&(d=Le(o)),U(o))){const u=ee(o);a=ae(o),p.x=u.x+o.clientLeft,p.y=u.y+o.clientTop}const v=s&&!h&&!r?nt(s,d,!0):K(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-d.scrollLeft*a.x+p.x+v.x,y:n.y*a.y-d.scrollTop*a.y+p.y+v.y}}function Ut(e){return Array.from(e.getClientRects())}function Gt(e){const t=q(e),n=Le(e),o=e.ownerDocument.body,i=Z(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Z(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ke(e);const c=-n.scrollTop;return j(o).direction==="rtl"&&(s+=Z(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function Jt(e,t){const n=Y(e),o=q(e),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,d=0;if(i){r=i.width,s=i.height;const a=Re();(!a||a&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}return{width:r,height:s,x:c,y:d}}function Qt(e,t){const n=ee(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=U(e)?ae(e):K(1),s=e.clientWidth*r.x,c=e.clientHeight*r.y,d=i*r.x,a=o*r.y;return{width:s,height:c,x:d,y:a}}function ot(e,t,n){let o;if(t==="viewport")o=Jt(e,n);else if(t==="document")o=Gt(q(e));else if(X(t))o=Qt(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 be(o)}function it(e,t){const n=Q(e);return n===t||!X(n)||le(n)?!1:j(n).position==="fixed"||it(n,t)}function Zt(e,t){const n=t.get(e);if(n)return n;let o=B(e,[],!1).filter(c=>X(c)&&re(c)!=="body"),i=null;const r=j(e).position==="fixed";let s=r?Q(e):e;for(;X(s)&&!le(s);){const c=j(s),d=Se(s);!d&&c.position==="fixed"&&(i=null),(r?!d&&!i:!d&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||fe(s)&&!d&&it(e,s))?o=o.filter(p=>p!==s):i=c,s=Q(s)}return t.set(e,o),o}function zt(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const s=[...n==="clippingAncestors"?Pe(t)?[]:Zt(t,this._c):[].concat(n),o],c=s[0],d=s.reduce((a,p)=>{const h=ot(t,p,i);return a.top=Z(h.top,a.top),a.right=J(h.right,a.right),a.bottom=J(h.bottom,a.bottom),a.left=Z(h.left,a.left),a},ot(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Bt(e){const{width:t,height:n}=et(e);return{width:t,height:n}}function en(e,t,n){const o=U(t),i=q(t),r=n==="fixed",s=ee(e,!0,r,t);let c={scrollLeft:0,scrollTop:0};const d=K(0);if(o||!o&&!r)if((re(t)!=="body"||fe(i))&&(c=Le(t)),o){const v=ee(t,!0,r,t);d.x=v.x+t.clientLeft,d.y=v.y+t.clientTop}else i&&(d.x=ke(i));const a=i&&!o&&!r?nt(i,c):K(0),p=s.left+c.scrollLeft-d.x-a.x,h=s.top+c.scrollTop-d.y-a.y;return{x:p,y:h,width:s.width,height:s.height}}function Fe(e){return j(e).position==="static"}function st(e,t){if(!U(e)||j(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function rt(e,t){const n=Y(e);if(Pe(e))return n;if(!U(e)){let i=Q(e);for(;i&&!le(i);){if(X(i)&&!Fe(i))return i;i=Q(i)}return n}let o=st(e,t);for(;o&&Xt(o)&&Fe(o);)o=st(o,t);return o&&le(o)&&Fe(o)&&!Se(o)?n:o||jt(e)||n}const tn=async function(e){const t=this.getOffsetParent||rt,n=this.getDimensions,o=await n(e.floating);return{reference:en(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function nn(e){return j(e).direction==="rtl"}const on={convertOffsetParentRelativeRectToViewportRelativeRect:qt,getDocumentElement:q,getClippingRect:zt,getOffsetParent:rt,getElementRects:tn,getClientRects:Ut,getDimensions:Bt,getScale:ae,isElement:X,isRTL:nn};function lt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sn(e,t){let n=null,o;const i=q(e);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),r();const a=e.getBoundingClientRect(),{left:p,top:h,width:v,height:u}=a;if(c||t(),!v||!u)return;const w=we(h),m=we(i.clientWidth-(p+v)),g=we(i.clientHeight-(h+u)),b=we(p),P={rootMargin:-w+"px "+-m+"px "+-g+"px "+-b+"px",threshold:Z(0,J(1,d))||1};let y=!0;function O(C){const A=C[0].intersectionRatio;if(A!==d){if(!y)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!lt(a,e.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(O,{...P,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,P)}n.observe(e)}return s(!0),r}function rn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,a=Ne(e),p=i||r?[...a?B(a):[],...B(t)]:[];p.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),r&&b.addEventListener("resize",n)});const h=a&&c?sn(a,n):null;let v=-1,u=null;s&&(u=new ResizeObserver(b=>{let[L]=b;L&&L.target===a&&u&&(u.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var P;(P=u)==null||P.observe(t)})),n()}),a&&!d&&u.observe(a),u.observe(t));let w,m=d?ee(e):null;d&&g();function g(){const b=ee(e);m&&!lt(m,b)&&n(),m=b,w=requestAnimationFrame(g)}return n(),()=>{var b;p.forEach(L=>{i&&L.removeEventListener("scroll",n),r&&L.removeEventListener("resize",n)}),h==null||h(),(b=u)==null||b.disconnect(),u=null,d&&cancelAnimationFrame(w)}}const ln=It,an=Yt,cn=Ht,un=Wt,fn=Ft,dn=(e,t,n)=>{const o=new Map,i={platform:on,...n},r={...i.platform,_c:o};return kt(e,t,{...i,platform:r})};function hn(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:r=!0,open:s=f.ref(!1)}=n,c=P=>{s.value=P},d=f.computed(()=>f.toValue(n.placement)??"bottom"),a=f.computed(()=>f.toValue(n.strategy)??"absolute"),p=f.ref(0),h=f.ref(0),v=f.ref(d.value),u=f.ref(a.value),w=f.shallowRef({}),m=f.ref(!1),g=async()=>{if(!e.value||!t.value)return;const P=await dn(e.value,t.value,{placement:d.value,strategy:a.value,middleware:i});p.value=P.x,h.value=P.y,v.value=P.placement,u.value=P.strategy,w.value=P.middlewareData,m.value=s.value};f.watch([d,a],()=>{s.value&&g()});let b;f.watch([e,t,s],([P,y,O])=>{!O||!P||!y||(r&&(b=rn(P,y,g,typeof r=="object"?r:void 0)),f.onWatcherCleanup(()=>{b==null||b(),b=void 0}))},{immediate:!0}),f.onScopeDispose(()=>b==null?void 0:b()),f.watch(s,P=>{P||(m.value=!1)});const L=f.ref({position:a.value,left:"0",top:"0"});return f.watch([p,h,()=>f.toValue(o)],([P,y,O])=>{const C=t.value;if(!C)return;const A={position:u.value,left:"0",top:"0"},F=at(C,P),E=at(C,y);O?L.value={...A,transform:`translate(${F}px, ${E}px)`,...ct(C)>=1.5&&{"will-change":"transform"}}:L.value={...A,left:`${F}px`,top:`${E}px`}},{immediate:!0}),{x:p,y:h,strategy:u,placement:v,middlewareData:w,isPositioned:m,floatingStyles:L,update:g,refs:{anchorEl:e,floatingEl:t},open:s,setOpen:c}}function at(e,t){const n=ct(e);return Math.round(t*n)/n}function ct(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pn(e,t={}){const{middlewareData:n,placement:o}=e,{offset:i="-4px"}=t,r=f.computed(()=>{var d;return((d=n.value.arrow)==null?void 0:d.x)??0}),s=f.computed(()=>{var d;return((d=n.value.arrow)==null?void 0:d.y)??0}),c=f.computed(()=>{const d=f.toValue(o).split("-")[0],a=r.value,p=s.value;return d==="bottom"?{"inset-inline-start":`${a}px`,"inset-block-start":i}:d==="top"?{"inset-inline-start":`${a}px`,"inset-block-end":i}:d==="right"?{"inset-block-start":`${p}px`,"inset-inline-start":i}:d==="left"?{"inset-block-start":`${p}px`,"inset-inline-end":i}:{}});return{arrowX:r,arrowY:s,arrowStyles:c}}let mn=0;function gn(){return`vfloat-id-${mn++}`}function ut(e){return typeof e=="object"&&e instanceof HTMLElement}function He(e,t){return e.contains(t)}function vn(e){return e.target}function ft(e,t){const[n,o]=e;let i=!1;const r=t.length;for(let s=0,c=r-1;s<r;c=s++){const[d,a]=t[s]||[0,0],[p,h]=t[c]||[0,0];a>=o!=h>=o&&n<=(p-d)*(o-a)/(h-a)+d&&(i=!i)}return i}function wn(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function yn(e={}){const{requireIntent:t=!0}=e;let n,o=!1,i=null,r=null,s=performance.now();function c(d,a){const p=performance.now(),h=p-s;if(i===null||r===null||h===0)return i=d,r=a,s=p,null;const v=d-i,u=a-r,m=Math.sqrt(v*v+u*u)/h;return i=d,r=a,s=p,m}return function({x:a,y:p,placement:h,elements:v,buffer:u,onClose:w}){const m=f.computed(()=>{const g=v.domReference;return ut(g)?g:(g==null?void 0:g.contextElement)??null});return function(b){var ge,Et,Tt,Pt,Lt,xt,Ot;function L(){clearTimeout(n),w()}if(clearTimeout(n),!v.domReference||!v.floating||h==null||a==null||p==null)return;const{clientX:P,clientY:y}=b,O=vn(b),C=b.type==="mouseleave",A=v.floating&&He(v.floating,O),F=m.value&&He(m.value,O),E=(ge=m.value)==null?void 0:ge.getBoundingClientRect(),l=(Et=v.floating)==null?void 0:Et.getBoundingClientRect(),k=h.split("-")[0],S=a>((l==null?void 0:l.right)??0)-((l==null?void 0:l.width)??0)/2,I=p>((l==null?void 0:l.bottom)??0)-((l==null?void 0:l.height)??0)/2,M=((l==null?void 0:l.width)??0)>((E==null?void 0:E.width)??0),D=((l==null?void 0:l.height)??0)>((E==null?void 0:E.height)??0),T=((Tt=M?E:l)==null?void 0:Tt.left)??0,R=((Pt=M?E:l)==null?void 0:Pt.right)??0,H=((Lt=D?E:l)==null?void 0:Lt.top)??0,W=((xt=D?E:l)==null?void 0:xt.bottom)??0;if(A&&(o=!0,!C))return;if(F&&(o=!1),F&&!C){o=!0;return}if(C&&ut(b.relatedTarget)&&v.floating&&He(v.floating,b.relatedTarget))return;if(k==="top"&&p>=((E==null?void 0:E.bottom)??0)-1||k==="bottom"&&p<=((E==null?void 0:E.top)??0)+1||k==="left"&&a>=((E==null?void 0:E.right)??0)-1||k==="right"&&a<=((E==null?void 0:E.left)??0)+1)return L();let G=[];switch(k){case"top":G=[[T,((E==null?void 0:E.top)??0)+1],[T,((l==null?void 0:l.bottom)??0)-1],[R,((l==null?void 0:l.bottom)??0)-1],[R,((E==null?void 0:E.top)??0)+1]];break;case"bottom":G=[[T,((l==null?void 0:l.top)??0)+1],[T,((E==null?void 0:E.bottom)??0)-1],[R,((E==null?void 0:E.bottom)??0)-1],[R,((l==null?void 0:l.top)??0)+1]];break;case"left":G=[[((l==null?void 0:l.right)??0)-1,W],[((l==null?void 0:l.right)??0)-1,H],[((E==null?void 0:E.left)??0)+1,H],[((E==null?void 0:E.left)??0)+1,W]];break;case"right":G=[[((E==null?void 0:E.right)??0)-1,W],[((E==null?void 0:E.right)??0)-1,H],[((l==null?void 0:l.left)??0)+1,H],[((l==null?void 0:l.left)??0)+1,W]];break}function xe([N,$]){switch(k){case"top":{const te=[M?N+u/2:S?N+u*4:N-u*4,$+u+1],ne=[M?N-u/2:S?N+u*4:N-u*4,$+u+1],ce=[[(l==null?void 0:l.left)??0,S||M?((l==null?void 0:l.bottom)??0)-u:(l==null?void 0:l.top)??0],[(l==null?void 0:l.right)??0,S?M?((l==null?void 0:l.bottom)??0)-u:(l==null?void 0:l.top)??0:((l==null?void 0:l.bottom)??0)-u]];return[te,ne,...ce]}case"bottom":{const te=[M?N+u/2:S?N+u*4:N-u*4,$-u],ne=[M?N-u/2:S?N+u*4:N-u*4,$-u],ce=[[(l==null?void 0:l.left)??0,S||M?((l==null?void 0:l.top)??0)+u:(l==null?void 0:l.bottom)??0],[(l==null?void 0:l.right)??0,S?M?((l==null?void 0:l.top)??0)+u:(l==null?void 0:l.bottom)??0:((l==null?void 0:l.top)??0)+u]];return[te,ne,...ce]}case"left":{const te=[N+u+1,D?$+u/2:I?$+u*4:$-u*4],ne=[N+u+1,D?$-u/2:I?$+u*4:$-u*4];return[...[[I||D?((l==null?void 0:l.right)??0)-u:(l==null?void 0:l.left)??0,(l==null?void 0:l.top)??0],[I?D?((l==null?void 0:l.right)??0)-u:(l==null?void 0:l.left)??0:((l==null?void 0:l.right)??0)-u,(l==null?void 0:l.bottom)??0]],te,ne]}case"right":{const te=[N-u,D?$+u/2:I?$+u*4:$-u*4],ne=[N-u,D?$-u/2:I?$+u*4:$-u*4],ce=[[I||D?((l==null?void 0:l.left)??0)+u:(l==null?void 0:l.right)??0,(l==null?void 0:l.top)??0],[I?D?((l==null?void 0:l.left)??0)+u:(l==null?void 0:l.right)??0:((l==null?void 0:l.left)??0)+u,(l==null?void 0:l.bottom)??0]];return[te,ne,...ce]}}}if(ft([P,y],G))return;if(o&&E&&!wn([P,y],E))return L();if(!C&&t){const N=c(b.clientX,b.clientY);if(N!==null&&N<.1)return L()}const me=xe([a,p]);(Ot=e.onPolygonChange)==null||Ot.call(e,me),ft([P,y],me)?!o&&t&&(n=window.setTimeout(L,40)):L()}}}const dt=10;function bn(e){return e==="mouse"||e==="pen"}function En(e,t,n){const{delay:o}=n,i=f.computed(()=>{const a=f.toValue(o);return(typeof a=="number"?a:a.open)??0}),r=f.computed(()=>{const a=f.toValue(o);return(typeof a=="number"?a:a.close)??0});let s,c;const d=()=>{clearTimeout(s),clearTimeout(c)};return f.onScopeDispose(d),{show:a=>{d();const p=a??i.value;p===0?e():s=setTimeout(e,p)},hide:a=>{d();const p=a??r.value;p===0?t():c=setTimeout(t,p)},showDelay:i,hideDelay:r,clearTimeouts:d}}function Tn(e,t={}){const{open:n,setOpen:o,refs:{anchorEl:i,floatingEl:r}}=e,{enabled:s=!0,delay:c=0,restMs:d=0,mouseOnly:a=!1,safePolygon:p=!1}=t,h=f.computed(()=>f.toValue(s)),v=f.computed(()=>f.toValue(d)),u=f.computed(()=>{const T=i.value;return!T||T instanceof HTMLElement?T:T.contextElement??null}),{hide:w,show:m,showDelay:g,clearTimeouts:b}=En(()=>{n.value||o(!0)},()=>{n.value&&o(!1)},{delay:c});let L=null,P;const y=f.computed(()=>g.value===0&&v.value>0);function O(T){if(!h.value||!F(T)||!y.value||!L)return;const R={x:T.clientX,y:T.clientY},H=Math.abs(R.x-L.x),W=Math.abs(R.y-L.y);(H>dt||W>dt)&&(L=R,clearTimeout(P),P=setTimeout(()=>{m(0)},v.value))}function C(T){!h.value||!F(T)||!y.value||(L={x:T.clientX,y:T.clientY},P=setTimeout(()=>{m(0)},v.value))}function A(){clearTimeout(P),L=null}f.watchPostEffect(()=>{const T=u.value;!T||!h.value||!y.value||(T.addEventListener("pointerenter",C),T.addEventListener("pointermove",O),T.addEventListener("pointerleave",A),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",C),T.removeEventListener("pointermove",O),T.removeEventListener("pointerleave",A)}))}),f.onScopeDispose(()=>{clearTimeout(P)});function F(T){return!(f.toValue(a)&&!bn(T.pointerType))}function E(T){!h.value||!F(T)||y.value||m()}function l(T){!h.value||!F(T)||(b(),S())}let k=null;function S(){k&&(document.removeEventListener("pointermove",k),k=null)}const I=f.computed(()=>!!f.toValue(p)),M=f.computed(()=>{const T=f.toValue(p);if(typeof T=="object"&&T)return T;if(T===!0)return{}});function D(T){var G;if(!h.value||!F(T))return;const{clientX:R,clientY:H}=T,W=T.relatedTarget;I.value?setTimeout(()=>{var ge;S();const xe=u.value,me=r.value;if(!xe||!me){w();return}k=yn(M.value)({x:R,y:H,placement:e.placement.value,elements:{domReference:xe,floating:me},buffer:((ge=M.value)==null?void 0:ge.buffer)??1,onClose:()=>{S(),w()}}),document.addEventListener("pointermove",k)},0):(G=r.value)!=null&&G.contains(W)||w()}f.watchPostEffect(()=>{const T=u.value;!T||!h.value||(T.addEventListener("pointerenter",E),T.addEventListener("pointerleave",D),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",E),T.removeEventListener("pointerleave",D)}))}),f.watchPostEffect(()=>{const T=r.value;!T||!h.value||(T.addEventListener("pointerenter",l),T.addEventListener("pointerleave",D),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",l),T.removeEventListener("pointerleave",D)}))}),f.onScopeDispose(()=>{S()})}function Pn(e){return f.getCurrentScope()?(f.onScopeDispose(e),!0):!1}const Ln=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const xn=Object.prototype.toString,On=e=>xn.call(e)==="[object Object]";function We(e){return Array.isArray(e)?e:[e]}function Cn(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const Mn=Ln?window:void 0;function An(e){var t;const n=f.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function _(...e){const t=[],n=()=>{t.forEach(c=>c()),t.length=0},o=(c,d,a,p)=>(c.addEventListener(d,a,p),()=>c.removeEventListener(d,a,p)),i=f.computed(()=>{const c=We(f.toValue(e[0])).filter(d=>d!=null);return c.every(d=>typeof d!="string")?c:void 0}),r=Cn(()=>{var c,d;return[(d=(c=i.value)==null?void 0:c.map(a=>An(a)))!=null?d:[Mn].filter(a=>a!=null),We(f.toValue(i.value?e[1]:e[0])),We(f.unref(i.value?e[2]:e[1])),f.toValue(i.value?e[3]:e[2])]},([c,d,a,p])=>{if(n(),!(c!=null&&c.length)||!(d!=null&&d.length)||!(a!=null&&a.length))return;const h=On(p)?{...p}:p;t.push(...c.flatMap(v=>d.flatMap(u=>a.map(w=>o(v,u,w,h)))))},{flush:"post"}),s=()=>{r(),n()};return Pn(n),s}function Dn(e,t={}){const{open:n,setOpen:o,refs:{floatingEl:i,anchorEl:r}}=e,{enabled:s=!0,requireFocusVisible:c=!0}=t,d=f.computed(()=>r.value?r.value instanceof HTMLElement?r.value:r.value.contextElement:null);let a=!1,p=!0,h;_(window,"blur",()=>{!n.value&&d.value&&d.value===document.activeElement&&(a=!0)}),_(window,"focus",()=>{a=!1}),f.onMounted(()=>{ht()&&pt()&&(_(window,"keydown",()=>{p=!0},{capture:!0}),_(window,"pointerdown",()=>{p=!1},{capture:!0}))});function v(w){if(a){a=!1;return}const m=w.target;if(f.toValue(c)&&m){if(ht()&&pt()&&!w.relatedTarget){if(!p&&!Sn(m))return}else if(!Rn(m))return}o(!0)}function u(w){clearTimeout(h),h=window.setTimeout(()=>{var b;const g=(((b=d.value)==null?void 0:b.ownerDocument)??document).activeElement;!w.relatedTarget&&g===d.value||i.value&&g&&i.value.contains(g)||o(!1)},0)}f.watchPostEffect(()=>{if(!f.toValue(s))return;const w=d.value;!w||!(w instanceof HTMLElement)||(w.addEventListener("focus",v),w.addEventListener("blur",u),f.onWatcherCleanup(()=>{w.removeEventListener("focus",v),w.removeEventListener("blur",u)}))}),f.onScopeDispose(()=>{clearTimeout(h)})}function ht(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function pt(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Sn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement}function Rn(e){return e.matches(":focus-visible")}function Vn(e,t={}){const{open:n,setOpen:o,refs:i}=e,{enabled:r=!0,event:s="click",toggle:c=!0,ignoreMouse:d=!1,keyboardHandlers:a=!0}=t;let p,h=!1;const v=f.computed(()=>f.toValue(r)),u=f.computed(()=>i.anchorEl.value instanceof HTMLElement?i.anchorEl.value:null);function w(){n.value?f.toValue(c)&&o(!1):o(!0)}function m(y){p=y.pointerType}function g(y){if(y.button!==0||f.toValue(s)==="click"||mt(p)&&f.toValue(d))return;const O=y.target;!n.value&&O===u.value&&y.preventDefault(),w()}function b(){if(f.toValue(s)==="mousedown"&&p){p=void 0;return}if(mt(p)&&f.toValue(d)){p=void 0;return}w(),p=void 0}function L(y){if(p=void 0,y.defaultPrevented||!f.toValue(a)||gt(y))return;const O=u.value;O&&(y.key===" "&&!vt(O)&&(y.preventDefault(),h=!0),y.key==="Enter"&&w())}function P(y){const O=u.value;O&&(y.defaultPrevented||!f.toValue(a)||gt(y)||vt(O)||y.key===" "&&h&&(h=!1,w()))}f.watchPostEffect(()=>{const y=u.value;!v.value||!y||(y.addEventListener("pointerdown",m),y.addEventListener("mousedown",g),y.addEventListener("click",b),y.addEventListener("keydown",L),y.addEventListener("keyup",P),f.onWatcherCleanup(()=>{y.removeEventListener("pointerdown",m),y.removeEventListener("mousedown",g),y.removeEventListener("click",b),y.removeEventListener("keydown",L),y.removeEventListener("keyup",P)}))})}function mt(e,t){return e===void 0?!1:e==="mouse"}function gt(e){return e.target instanceof HTMLElement&&e.target.tagName==="BUTTON"}function Nn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function vt(e){return Nn(e)}function kn(e,t={}){const{enabled:n=!0,escapeKey:o=!0,outsidePress:i=!0,outsidePressEvent:r="pointerdown",anchorPress:s=!1,anchorPressEvent:c="pointerdown",ancestorScroll:d=!1,capture:a}=t,p=f.computed(()=>f.toValue(n)),h=e.refs.floatingEl,v=f.computed(()=>{const y=e.refs.anchorEl.value;return y?y instanceof HTMLElement?y:y.contextElement instanceof HTMLElement?y.contextElement:null:null}),{isComposing:u}=Wn(),{escapeKey:w,outsidePress:m}=Fn(a);let g=!1;const b=y=>{!p.value||!e.open.value||!f.toValue(o)||y.key!=="Escape"||u()||e.setOpen(!1)},L=y=>{if(!p.value||!e.open.value)return;if(r==="click"&&g){g=!1;return}const O=f.toValue(i);if(!O||typeof O=="function"&&!O(y))return;const C=y.target;C&&($e(C)&&h.value&&Hn(y,C)||wt(y,v.value)||wt(y,h.value)||e.setOpen(!1))},P=()=>{p.value&&e.open.value&&f.toValue(s)&&e.setOpen(!1)};f.watchEffect(y=>{if(!p.value||!e.open.value||!f.toValue(d))return;const O=()=>{e.open.value&&e.setOpen(!1)},C=[];v.value&&C.push(...B(v.value).filter($e)),h.value&&C.push(...B(h.value).filter($e));for(const A of C)A.addEventListener("scroll",O,{passive:!0});y(()=>{for(const A of C)A.removeEventListener("scroll",O)})}),_(document,"keydown",b,f.toValue(w)),_(document,r,L,f.toValue(m)),_(v,c,P),_(h,"mousedown",()=>{g=!0},{capture:!0}),_(h,"mouseup",()=>{g=!0},{capture:!0})}function Fn(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function $e(e){return e instanceof Element&&e instanceof HTMLElement}function wt(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function Hn(e,t){const n=t.offsetWidth-t.clientWidth,o=t.offsetHeight-t.clientHeight;return n>0&&e.clientX>t.clientWidth||o>0&&e.clientY>t.clientHeight}function Wn(){const e=f.ref(!1);return _(document,"compositionstart",()=>{e.value=!0}),_(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function $n(e,t,n={}){const{open:o,refs:i}=t;let r;const s=f.ref({x:null,y:null}),c=f.computed(()=>f.toValue(n.axis??"both")),d=f.computed(()=>f.toValue(n.enabled??!0)),a=f.computed(()=>f.toValue(n.x??null)),p=f.computed(()=>f.toValue(n.y??null)),h=(m,g)=>{s.value={x:m,y:g},o.value&&(i.anchorEl.value=In(e.value,c.value,s.value))};f.watchEffect(()=>{const m=a.value,g=p.value;d.value&&m!=null&&g!=null&&h(m,g)});const v=m=>{r=m.pointerType,h(m.clientX,m.clientY)},u=m=>{r=m.pointerType,!o.value&&yt(r,!0)&&h(m.clientX,m.clientY)},w=m=>{o.value&&yt(r,!0)&&h(m.clientX,m.clientY)};return f.watchEffect(()=>{if(a.value!=null||p.value!=null)return;const m=e.value;!m||!d.value||(m.addEventListener("pointerenter",u),m.addEventListener("pointerdown",v),m.addEventListener("pointermove",w),f.onWatcherCleanup(()=>{m==null||m.removeEventListener("pointerenter",u),m==null||m.removeEventListener("pointerdown",v),m==null||m.removeEventListener("pointermove",w)}))}),{coordinates:f.readonly(s),updatePosition:h}}function In(e,t,n){let o=null,i=null;const r=e;return{contextElement:r||void 0,getBoundingClientRect:()=>{const s=(r==null?void 0:r.getBoundingClientRect())??{width:0,height:0,x:0,y:0},c=t==="x"||t==="both",d=t==="y"||t==="both";let a=0,p=0,h=s.x,v=s.y;return r&&(o==null&&n.x!=null&&c&&(o=s.x-n.x),i==null&&n.y!=null&&d&&(i=s.y-n.y),h-=o||0,v-=i||0),c&&n.x!=null?h=n.x:(o=null,a=s.width),d&&n.y!=null?v=n.y:(i=null,p=s.height),t==="both"&&(a=0,p=0),{width:a,height:p,x:h,y:v,top:v,right:h+a,bottom:v+p,left:h}}}}function yt(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function Yn(e){return{name:"arrow",options:e,fn(t){const n=f.toValue(e.element);return n==null?{}:fn({element:n,padding:e.padding}).fn(t)}}}class Ie{constructor(t,n=null,o={},i=!1){oe(this,"id");oe(this,"data");oe(this,"parent");oe(this,"children");Oe(this,de);this.id=o.id??gn(),this.data=t,this.parent=f.shallowRef(n),this.children=f.shallowRef([]),je(this,de,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 Xe(this,de)}get isLeaf(){return this.children.value.length===0}}de=new WeakMap;class bt{constructor(t,n){Oe(this,pe);oe(this,"root");oe(this,"nodeMap");Oe(this,he);je(this,he,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=f.shallowReactive(new Map),this.root=new Ie(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 Ie(t,i,o);return this.nodeMap.set(r.id,r),i.addChild(r),r}removeNode(t,n){const o=n??Xe(this,he),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")_e(this,pe,Ke).call(this,i);else{for(const s of i.children.value)s.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 s=r.children.value.length-1;s>=0;s--)i.push(r.children.value[s])}}else{const i=[n];for(;i.length>0;){const r=i.shift();o.push(r);for(const s of r.children.value)i.push(s)}}return o}dispose(){this.nodeMap.clear()}}he=new WeakMap,pe=new WeakSet,Ke=function(t){const n=[...t.children.value];for(const o of n)_e(this,pe,Ke).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function Xn(e,t={}){const n=new bt(e,t);return{get nodeMap(){return n.nodeMap},get root(){return n.root},findNodeById:s=>n.findNodeById(s),moveNode:(s,c)=>n.moveNode(s,c),dispose:()=>n.dispose(),addNode:(s,c)=>n.addNode(s,c),removeNode:(s,c)=>n.removeNode(s,c),traverse:(s,c)=>n.traverse(s,c),isTopmost:s=>{const c=n.findNodeById(s);if(!c||!c.data.open.value)return!1;let d=c.parent.value;for(;d;){if(d.data.open.value)return!1;d=d.parent.value}return!0},getAllOpenNodes:()=>{const s=[];for(const c of n.nodeMap.values())c.data.open.value&&s.push(c);return s},forEach:(s,c,d={})=>{const{relationship:a="self-and-children",applyToMatching:p=!0}=d,h=n.findNodeById(s);if(!h)return;const v=[],u=new Set,w=g=>{g&&!u.has(g.id)&&(v.push(g),u.add(g.id))},m=g=>{for(const b of g)w(b)};if(a==="ancestors-only")for(const g of h.getPath())g.id!==h.id&&w(g);else if(a==="siblings-only"){if(h.parent.value)for(const g of h.parent.value.children.value)g.id!==h.id&&w(g)}else if(a==="descendants-only")for(const g of n.traverse("dfs",h))g.id!==h.id&&w(g);else if(a==="children-only")m(h.children.value);else if(a==="self-and-ancestors")m(h.getPath());else if(a==="self-and-children")w(h),m(h.children.value);else if(a==="self-and-descendants")m(n.traverse("dfs",h));else if(a==="self-and-siblings")w(h),h.parent.value&&m(h.parent.value.children.value);else if(a==="self-ancestors-and-children")m(h.getPath()),m(h.children.value);else if(a==="full-branch")m(h.getPath()),m(n.traverse("dfs",h));else if(a==="all-except-branch"){const g=new Set;for(const b of h.getPath())g.add(b.id);for(const b of n.traverse("dfs",h))g.add(b.id);for(const b of n.nodeMap.values())!g.has(b.id)===p&&c(b);return}else{console.warn(`forEach: Unknown relationship "${a}".`);return}if(p)for(const g of v)c(g);else for(const g of n.nodeMap.values())u.has(g.id)||c(g)}}}x.Tree=bt,x.TreeNode=Ie,x.arrow=Yn,x.flip=cn,x.hide=un,x.offset=ln,x.shift=an,x.useArrow=pn,x.useClick=Vn,x.useClientPoint=$n,x.useDismiss=kn,x.useFloating=hn,x.useFloatingTree=Xn,x.useFocus=Dn,x.useHover=Tn,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "v-float",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Vue 3 port of Floating UI - a library for positioning floating elements",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -20,10 +20,12 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@floating-ui/dom": "^1.6.13",
|
|
22
22
|
"@vueuse/core": "^13.0.0",
|
|
23
|
+
"vitepress-plugin-demo": "^0.8.0",
|
|
23
24
|
"vue": "^3.5.13"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"
|
|
27
|
+
"@21st-extension/toolbar-vue": "^0.5.14",
|
|
28
|
+
"@21st-extension/vue": "^0.5.14",
|
|
27
29
|
"@biomejs/biome": "1.9.4",
|
|
28
30
|
"@testing-library/vue": "^8.1.0",
|
|
29
31
|
"@tsconfig/node22": "^22.0.1",
|
|
@@ -37,6 +39,7 @@
|
|
|
37
39
|
"@vue/test-utils": "^2.4.6",
|
|
38
40
|
"@vue/tsconfig": "^0.7.0",
|
|
39
41
|
"jsdom": "^26.0.0",
|
|
42
|
+
"lucide-vue-next": "^0.513.0",
|
|
40
43
|
"npm-run-all2": "^7.0.2",
|
|
41
44
|
"playwright": "^1.51.1",
|
|
42
45
|
"prettier": "^3.5.3",
|
|
@@ -58,6 +61,9 @@
|
|
|
58
61
|
"build-only": "vite build",
|
|
59
62
|
"type-check": "vue-tsc --build tsconfig.build.json",
|
|
60
63
|
"lint": "biome check --apply --write",
|
|
61
|
-
"test:browser": "vitest --workspace=vitest.workspace.ts"
|
|
64
|
+
"test:browser": "vitest --workspace=vitest.workspace.ts",
|
|
65
|
+
"docs:dev": "vitepress dev docs",
|
|
66
|
+
"docs:build": "vitepress build docs",
|
|
67
|
+
"docs:preview": "vitepress preview docs"
|
|
62
68
|
}
|
|
63
69
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare function normalizeProp(normalizable?: boolean | {
|
|
2
|
-
escapeKey?: boolean;
|
|
3
|
-
outsidePress?: boolean;
|
|
4
|
-
}): {
|
|
5
|
-
escapeKey: boolean;
|
|
6
|
-
outsidePress: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function isHTMLElement(node: unknown | null): node is HTMLElement;
|
|
9
|
-
export declare function isEventTargetWithin(event: Event, element: Element | null | undefined): boolean;
|
|
10
|
-
export declare function isClickOnScrollbar(event: MouseEvent, target: HTMLElement): boolean;
|
|
11
|
-
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/composables/utils/dom.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAC3B,YAAY,CAAC,EAAE,OAAO,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE;;;EAQzE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,WAAW,CAEvE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAU9F;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAalF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-composition.d.ts","sourceRoot":"","sources":["../../../src/composables/utils/use-composition.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc;;EAc7B"}
|
package/dist/utils/dom.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rounds a value based on the device pixel ratio
|
|
3
|
-
*/
|
|
4
|
-
export declare function roundByDPR(el: HTMLElement, value: number): number;
|
|
5
|
-
/**
|
|
6
|
-
* Gets the device pixel ratio for an element
|
|
7
|
-
*/
|
|
8
|
-
export declare function getDPR(el: HTMLElement): number;
|
|
9
|
-
//# sourceMappingURL=dom.d.ts.map
|
package/dist/utils/dom.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,UAGxD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,EAAE,EAAE,WAAW,UAIrC"}
|
package/dist/utils/id.d.ts
DELETED
package/dist/utils/id.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/utils/id.ts"],"names":[],"mappings":"AAEA,wBAAgB,KAAK,IAAI,MAAM,CAE9B"}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,MAAM,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reactivity.d.ts","sourceRoot":"","sources":["../../src/utils/reactivity.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAEpD"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AnyFn } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if a value is a function
|
|
4
|
-
* @param value - The value to check
|
|
5
|
-
* @returns True if the value is a function, false otherwise
|
|
6
|
-
*/
|
|
7
|
-
export declare function isFunction(value: unknown): value is AnyFn;
|
|
8
|
-
//# sourceMappingURL=type-guards.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../../src/utils/type-guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEzD"}
|