v-float 0.7.1 → 0.8.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 (52) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +223 -204
  3. package/dist/composables/index.d.ts +1 -3
  4. package/dist/composables/index.d.ts.map +1 -1
  5. package/dist/composables/interactions/index.d.ts +0 -2
  6. package/dist/composables/interactions/index.d.ts.map +1 -1
  7. package/dist/composables/interactions/polygon.d.ts +2 -2
  8. package/dist/composables/interactions/polygon.d.ts.map +1 -1
  9. package/dist/composables/interactions/use-click.d.ts +2 -2
  10. package/dist/composables/interactions/use-click.d.ts.map +1 -1
  11. package/dist/composables/interactions/use-escape-key.d.ts +2 -2
  12. package/dist/composables/interactions/use-escape-key.d.ts.map +1 -1
  13. package/dist/composables/interactions/use-focus.d.ts +30 -25
  14. package/dist/composables/interactions/use-focus.d.ts.map +1 -1
  15. package/dist/composables/interactions/use-hover.d.ts +2 -2
  16. package/dist/composables/interactions/use-hover.d.ts.map +1 -1
  17. package/dist/composables/middlewares/arrow.d.ts +1 -2
  18. package/dist/composables/middlewares/arrow.d.ts.map +1 -1
  19. package/dist/composables/middlewares/index.d.ts +3 -1
  20. package/dist/composables/middlewares/index.d.ts.map +1 -1
  21. package/dist/composables/positioning/index.d.ts +5 -0
  22. package/dist/composables/positioning/index.d.ts.map +1 -0
  23. package/dist/composables/positioning/use-arrow.d.ts.map +1 -0
  24. package/dist/composables/{interactions → positioning}/use-client-point.d.ts +2 -2
  25. package/dist/composables/positioning/use-client-point.d.ts.map +1 -0
  26. package/dist/composables/positioning/use-floating-tree.d.ts +240 -0
  27. package/dist/composables/positioning/use-floating-tree.d.ts.map +1 -0
  28. package/dist/composables/{use-floating.d.ts → positioning/use-floating.d.ts} +19 -10
  29. package/dist/composables/positioning/use-floating.d.ts.map +1 -0
  30. package/dist/types.d.ts +15 -0
  31. package/dist/types.d.ts.map +1 -1
  32. package/dist/utils.d.ts +84 -7
  33. package/dist/utils.d.ts.map +1 -1
  34. package/dist/v-float.es.js +1732 -1620
  35. package/dist/v-float.umd.js +1 -1
  36. package/package.json +73 -76
  37. package/dist/composables/interactions/use-client-point.d.ts.map +0 -1
  38. package/dist/composables/interactions/utils/browser-detection.d.ts +0 -23
  39. package/dist/composables/interactions/utils/browser-detection.d.ts.map +0 -1
  40. package/dist/composables/interactions/utils/element-detection.d.ts +0 -53
  41. package/dist/composables/interactions/utils/element-detection.d.ts.map +0 -1
  42. package/dist/composables/interactions/utils/event-utils.d.ts +0 -30
  43. package/dist/composables/interactions/utils/event-utils.d.ts.map +0 -1
  44. package/dist/composables/interactions/utils/index.d.ts +0 -11
  45. package/dist/composables/interactions/utils/index.d.ts.map +0 -1
  46. package/dist/composables/interactions/utils/tree-context.d.ts +0 -32
  47. package/dist/composables/interactions/utils/tree-context.d.ts.map +0 -1
  48. package/dist/composables/use-arrow.d.ts.map +0 -1
  49. package/dist/composables/use-floating-tree.d.ts +0 -110
  50. package/dist/composables/use-floating-tree.d.ts.map +0 -1
  51. package/dist/composables/use-floating.d.ts.map +0 -1
  52. /package/dist/composables/{use-arrow.d.ts → positioning/use-arrow.d.ts} +0 -0
@@ -1 +1 @@
1
- (function(A,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(A=typeof globalThis<"u"?globalThis:A||self,f(A.VFloat={},A.Vue))})(this,(function(A,f){"use strict";var To=Object.defineProperty;var Oo=(A,f,he)=>f in A?To(A,f,{enumerable:!0,configurable:!0,writable:!0,value:he}):A[f]=he;var xe=(A,f,he)=>Oo(A,typeof f!="symbol"?f+"":f,he);function he(e){return f.getCurrentScope()?(f.onScopeDispose(e),!0):!1}const Gt=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Jt=Object.prototype.toString,Qt=e=>Jt.call(e)==="[object Object]";function Ie(e){return Array.isArray(e)?e:[e]}function Zt(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const en=Gt?window:void 0;function tn(e){var t;const n=f.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function J(...e){const t=[],n=()=>{t.forEach(a=>a()),t.length=0},o=(a,d,c,u)=>(a.addEventListener(d,c,u),()=>a.removeEventListener(d,c,u)),i=f.computed(()=>{const a=Ie(f.toValue(e[0])).filter(d=>d!=null);return a.every(d=>typeof d!="string")?a:void 0}),l=Zt(()=>{var a,d;return[(d=(a=i.value)==null?void 0:a.map(c=>tn(c)))!=null?d:[en].filter(c=>c!=null),Ie(f.toValue(i.value?e[1]:e[0])),Ie(f.unref(i.value?e[2]:e[1])),f.toValue(i.value?e[3]:e[2])]},([a,d,c,u])=>{if(n(),!(a!=null&&a.length)||!(d!=null&&d.length)||!(c!=null&&c.length))return;const g=Qt(u)?{...u}:u;t.push(...a.flatMap(h=>d.flatMap(m=>c.map(p=>o(h,m,p,g)))))},{flush:"post"}),r=()=>{l(),n()};return he(n),r}function Be(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function $e(){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 je(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function Xe(e){return!e||!(e instanceof HTMLElement)?!1:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable&&e.contentEditable!=="false"}function Ye(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 _e(e){return Xe(e)}function lt(e){return e instanceof Element&&e instanceof HTMLElement}function nn(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 Oe(e,t){return e.contains(t)}function ct(e){return e.target}function Ue(){return typeof performance<"u"?performance.now():Date.now()}function Ke(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 Ee(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 Pe(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=Pe(n,t);if(o)return o}return null}function on(e,t={}){const{floatingContext:n,treeContext:o}=Ee(e),{open:i,setOpen:l,refs:r}=n,{enabled:a=!0,event:d="click",toggle:c=!0,ignoreMouse:u=!1,ignoreKeyboard:g=!1,ignoreTouch:h=!1,outsideClick:m=!1,outsideEvent:p="pointerdown",outsideCapture:w=!0,onOutsideClick:v,preventScrollbarClick:x=!0,handleDragEvents:C=!0}=t;let T,S=!1,y=!1,E=!1;const P=f.computed(()=>f.toValue(a)),N=f.computed(()=>f.toValue(m)),R=f.computed(()=>{const L=r.anchorEl.value;return L instanceof HTMLElement?L:null}),M=f.computed(()=>r.floatingEl.value);function k(){E=!0;try{i.value?f.toValue(c)&&l(!1):l(!0)}finally{Promise.resolve().then(()=>{E=!1})}}function I(){T=void 0,S=!1,y=!1}function B(L){T=L.pointerType}function V(L){L.button===0&&f.toValue(d)!=="click"&&($(T)||k())}function O(){if(f.toValue(d)==="mousedown"&&T){I();return}if($(T)){I();return}k(),I()}function s(L){if(T=void 0,L.defaultPrevented||f.toValue(g)||Ye(L))return;const j=R.value;j&&(L.key===" "&&!_e(j)&&(L.preventDefault(),S=!0),L.key==="Enter"&&k())}function F(L){const j=R.value;j&&(L.defaultPrevented||f.toValue(g)||Ye(L)||_e(j)||L.key===" "&&S&&(S=!1,k()))}function b(L){if(!P.value||!N.value||!i.value)return;if(f.toValue(p)==="click"&&f.toValue(C)&&y){y=!1;return}if(E)return;const j=L.target;if(j&&!(f.toValue(x)&&lt(j)&&M.value&&at(L,j))){if(o){if(!rn(o,j))return}else if(ze(L,R.value)||ze(L,M.value))return;v?v(L,n):l(!1)}}function H(){y=!0}function oe(){setTimeout(()=>{y=!1},0)}function $(L){return!!(je(L,!0)&&f.toValue(u)||L==="touch"&&f.toValue(h))}f.watchPostEffect(()=>{const L=R.value;!P.value||!L||(L.addEventListener("pointerdown",B),L.addEventListener("mousedown",V),L.addEventListener("click",O),L.addEventListener("keydown",s),L.addEventListener("keyup",F),f.onWatcherCleanup(()=>{L.removeEventListener("pointerdown",B),L.removeEventListener("mousedown",V),L.removeEventListener("click",O),L.removeEventListener("keydown",s),L.removeEventListener("keyup",F),I()}))}),J(()=>P.value&&N.value?document:null,()=>f.toValue(p),b,{capture:f.toValue(w)}),J(()=>P.value&&N.value&&f.toValue(C)?M.value:null,"mousedown",H,{capture:!0}),J(()=>P.value&&N.value&&f.toValue(C)?M.value:null,"mouseup",oe,{capture:!0})}function rn(e,t){return!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Pe(e,t))}const Se=e=>typeof e=="number"&&Number.isFinite(e)?e:null,ce=class ce{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:ce.DEFAULT_DIMENSIONS.width,height:ce.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,ce.DEFAULT_DIMENSIONS.width),height:0};case"y":return{width:0,height:o(n.height,ce.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})}}};xe(ce,"DEFAULT_DIMENSIONS",{width:100,height:30});let qe=ce;class ft{constructor(){xe(this,"lastKnownCoordinates",null)}getCoordinatesForOpening(){return this.lastKnownCoordinates}onClose(){this.lastKnownCoordinates=null}reset(){this.lastKnownCoordinates=null}}class sn extends ft{constructor(){super(...arguments);xe(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&&je(n.originalEvent.pointerType,!0)?i:null;case"pointerenter":return i;default:return null}}}class ln extends ft{constructor(){super(...arguments);xe(this,"name","static");xe(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 an(e,t,n={}){const{open:o,refs:i}=t,l=new qe,r=f.ref({x:null,y:null}),a=f.ref(null),d=f.computed(()=>f.toValue(n.axis??"both")),c=f.computed(()=>f.toValue(n.enabled??!0)),u=f.computed(()=>Se(f.toValue(n.x??null))),g=f.computed(()=>Se(f.toValue(n.y??null))),h=f.computed(()=>u.value!==null&&g.value!==null),m=f.computed(()=>h.value?{x:u.value,y:g.value}:r.value),p=f.computed(()=>{const E=m.value;switch(d.value){case"x":return{x:E.x,y:null};case"y":return{x:null,y:E.y};case"both":return E}}),w=(n.trackingMode??"follow")==="follow"?new sn:new ln,v=(E,P)=>{h.value||(r.value={x:Se(E),y:Se(P)})},x=()=>{h.value||(r.value={x:null,y:null})},C=(E,P)=>{const N={type:P,coordinates:{x:E.clientX,y:E.clientY},originalEvent:E},R=w.process(N,{isOpen:o.value});R&&v(R.x,R.y)};f.watch([p,a,d,e],()=>{i.anchorEl.value=l.create({coordinates:p.value,referenceElement:e.value,baselineCoordinates:a.value,axis:d.value})},{immediate:!0}),f.watch(o,E=>{if(!(!c.value||h.value))if(E){const P=w.getCoordinatesForOpening();P?(v(P.x,P.y),a.value={...P}):a.value={...r.value}}else w.onClose(),x(),a.value=null});const T=E=>{C(E,"pointerdown")},S=E=>{C(E,"pointerenter")},y=E=>{C(E,"pointermove")};return f.watchEffect(()=>{if(h.value||!c.value)return;const E=e.value;if(!E)return;const P=w.getRequiredEvents(),N={pointerenter:S,pointerdown:T,pointermove:y};P.forEach(R=>{const M=N[R];M&&E.addEventListener(R,M)}),f.onWatcherCleanup(()=>{P.forEach(R=>{const M=N[R];M&&E.removeEventListener(R,M)})})}),{coordinates:f.readonly(p),updatePosition:(E,P)=>v(E,P)}}function cn(e,t={}){const{floatingContext:n,treeContext:o}=Ee(e),{enabled:i=!0,capture:l=!1,onEscape:r}=t,{isComposing:a}=fn();J(document,"keydown",c=>{if(!(c.key!=="Escape"||!f.toValue(i)||a())){if(r){r(c);return}if(o){const u=un(o);u&&u.data.setOpen(!1)}else n.setOpen(!1)}},l)}function un(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 fn(){const e=f.ref(!1);return J(document,"compositionstart",()=>{e.value=!0}),J(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function dn(e,t={}){const{floatingContext:n,treeContext:o}=Ee(e),{open:i,setOpen:l,refs:{floatingEl:r,anchorEl:a}}=n,{enabled:d=!0,requireFocusVisible:c=!0}=t,u=f.computed(()=>a.value?a.value instanceof HTMLElement?a.value:a.value.contextElement:null);let g=!1,h=!0,m;J(window,"blur",()=>{!i.value&&u.value&&u.value===document.activeElement&&(g=!0)}),J(window,"focus",()=>{g=!1}),f.onMounted(()=>{Be()&&$e()&&(J(window,"keydown",()=>{h=!0},{capture:!0}),J(window,"pointerdown",()=>{h=!1},{capture:!0}))});function p(v){if(g){g=!1;return}const x=v.target;if(f.toValue(c)&&x){if(Be()&&$e()&&!v.relatedTarget){if(!h&&!Xe(x))return}else if(!st(x))return}l(!0)}function w(v){clearTimeout(m),m=window.setTimeout(()=>{var T;const C=(((T=u.value)==null?void 0:T.ownerDocument)??document).activeElement;if(!(!v.relatedTarget&&C===u.value)){if(o){if(C&&mn(o,C))return}else if(r.value&&C&&r.value.contains(C))return;l(!1)}},0)}f.watchPostEffect(()=>{if(!f.toValue(d))return;const v=u.value;!v||!(v instanceof HTMLElement)||(v.addEventListener("focus",p),v.addEventListener("blur",w),f.onWatcherCleanup(()=>{v.removeEventListener("focus",p),v.removeEventListener("blur",w)}))}),f.onScopeDispose(()=>{clearTimeout(m)})}function mn(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 hn=0;function pn(){return`vfloat-id-${hn++}`}function mt(e){return typeof e=="object"&&e instanceof HTMLElement}function ht(e){return e.children.value.some(t=>t.data.open.value||ht(t))}function gn(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],[u,g]=t[a]||[0,0];c>=o!=g>=o&&n<=(u-d)*(o-c)/(g-c)+d&&(i=!i)}return i}function vn(e={}){const{blockPointerEvents:t=!1,requireIntent:n=!0}=e;let o=-1,i=!1;function l(a,d,c,u,g){const h=Ue(),m=h-g;if(c===null||u===null||m===0)return{speed:null,lastX:a,lastY:d,lastCursorTime:h};const p=a-c,w=d-u;return{speed:Math.sqrt(p*p+w*w)/m,lastX:a,lastY:d,lastCursorTime:h}}const r=function(d){const{x:c,y:u,placement:g,elements:h,buffer:m,onClose:p,nodeId:w,tree:v}=d,x=f.computed(()=>{const y=h.domReference;return mt(y)?y:(y==null?void 0:y.contextElement)??null});let C=null,T=null,S=Ue();return function(E){var We,Yt,_t,zt,Ut,Kt,qt;function P(){Ke(o),o=-1,p()}if(Ke(o),o=-1,!h.domReference||!h.floating||g==null||c==null||u==null)return;const{clientX:N,clientY:R}=E,M=[N,R],k=ct(E),I=E.type==="mouseleave",B=h.floating&&Oe(h.floating,k),V=x.value&&Oe(x.value,k),O=(We=x.value)==null?void 0:We.getBoundingClientRect(),s=(Yt=h.floating)==null?void 0:Yt.getBoundingClientRect(),F=g.split("-")[0],b=c>((s==null?void 0:s.right)??0)-((s==null?void 0:s.width)??0)/2,H=u>((s==null?void 0:s.bottom)??0)-((s==null?void 0:s.height)??0)/2,oe=O?gn(M,O):!1,$=((s==null?void 0:s.width)??0)>((O==null?void 0:O.width)??0),L=((s==null?void 0:s.height)??0)>((O==null?void 0:O.height)??0),j=((_t=$?O:s)==null?void 0:_t.left)??0,ue=((zt=$?O:s)==null?void 0:zt.right)??0,G=((Ut=L?O:s)==null?void 0:Ut.top)??0,fe=((Kt=L?O:s)==null?void 0:Kt.bottom)??0;if(B&&(i=!0,!I))return;if(V&&(i=!1),V&&!I){i=!0;return}if(I&&mt(E.relatedTarget)&&h.floating&&Oe(h.floating,E.relatedTarget))return;if(v&&w){const W=v.nodes.get(w);if(W&&ht(W))return}if(F==="top"&&u>=((O==null?void 0:O.bottom)??0)-1||F==="bottom"&&u<=((O==null?void 0:O.top)??0)+1||F==="left"&&c>=((O==null?void 0:O.right)??0)-1||F==="right"&&c<=((O==null?void 0:O.left)??0)+1)return P();let le=[];switch(F){case"top":le=[[j,((O==null?void 0:O.top)??0)+1],[j,((s==null?void 0:s.bottom)??0)-1],[ue,((s==null?void 0:s.bottom)??0)-1],[ue,((O==null?void 0:O.top)??0)+1]];break;case"bottom":le=[[j,((s==null?void 0:s.top)??0)+1],[j,((O==null?void 0:O.bottom)??0)-1],[ue,((O==null?void 0:O.bottom)??0)-1],[ue,((s==null?void 0:s.top)??0)+1]];break;case"left":le=[[((s==null?void 0:s.right)??0)-1,fe],[((s==null?void 0:s.right)??0)-1,G],[((O==null?void 0:O.left)??0)+1,G],[((O==null?void 0:O.left)??0)+1,fe]];break;case"right":le=[[((O==null?void 0:O.right)??0)-1,fe],[((O==null?void 0:O.right)??0)-1,G],[((s==null?void 0:s.left)??0)+1,G],[((s==null?void 0:s.left)??0)+1,fe]];break}function He([W,X]){const D=m;switch(F){case"top":{const de=[$?W+D/2:b?W+D*4:W-D*4,X+D+1],me=[$?W-D/2:b?W+D*4:W-D*4,X+D+1],be=[[(s==null?void 0:s.left)??0,b||$?((s==null?void 0:s.bottom)??0)-D:(s==null?void 0:s.top)??0],[(s==null?void 0:s.right)??0,b?$?((s==null?void 0:s.bottom)??0)-D:(s==null?void 0:s.top)??0:((s==null?void 0:s.bottom)??0)-D]];return[de,me,...be]}case"bottom":{const de=[$?W+D/2:b?W+D*4:W-D*4,X-D],me=[$?W-D/2:b?W+D*4:W-D*4,X-D],be=[[(s==null?void 0:s.left)??0,b||$?((s==null?void 0:s.top)??0)+D:(s==null?void 0:s.bottom)??0],[(s==null?void 0:s.right)??0,b?$?((s==null?void 0:s.top)??0)+D:(s==null?void 0:s.bottom)??0:((s==null?void 0:s.top)??0)+D]];return[de,me,...be]}case"left":{const de=[W+D+1,L?X+D/2:H?X+D*4:X-D*4],me=[W+D+1,L?X-D/2:H?X+D*4:X-D*4];return[...[[H||L?((s==null?void 0:s.right)??0)-D:(s==null?void 0:s.left)??0,(s==null?void 0:s.top)??0],[H?L?((s==null?void 0:s.right)??0)-D:(s==null?void 0:s.left)??0:((s==null?void 0:s.right)??0)-D,(s==null?void 0:s.bottom)??0]],de,me]}case"right":{const de=[W-D,L?X+D/2:H?X+D*4:X-D*4],me=[W-D,L?X-D/2:H?X+D*4:X-D*4],be=[[H||L?((s==null?void 0:s.left)??0)+D:(s==null?void 0:s.right)??0,(s==null?void 0:s.top)??0],[H?L?((s==null?void 0:s.left)??0)+D:(s==null?void 0:s.right)??0:((s==null?void 0:s.left)??0)+D,(s==null?void 0:s.bottom)??0]];return[de,me,...be]}}}const ye=He([c,u]);if((qt=e.onPolygonChange)==null||qt.call(e,ye),!pt(M,le)){if(pt(M,ye)){if(!i&&n){const W=l(E.clientX,E.clientY,C,T,S);C=W.lastX,T=W.lastY,S=W.lastCursorTime,W.speed!==null&&W.speed<.1&&(o=window.setTimeout(P,40))}return}if(i&&!oe)return P();P()}}};return r.__options={blockPointerEvents:t},r}const gt=10;function wn(e,t,n){const{delay:o}=n,i=f.computed(()=>{const c=f.toValue(o);return(typeof c=="number"?c:c.open)??0}),l=f.computed(()=>{const c=f.toValue(o);return(typeof c=="number"?c:c.close)??0});let r,a;const d=()=>{clearTimeout(r),clearTimeout(a)};return f.onScopeDispose(d),{show:c=>{d();const u=c??i.value;u===0?e():r=setTimeout(e,u)},hide:c=>{d();const u=c??l.value;u===0?t():a=setTimeout(t,u)},showDelay:i,hideDelay:l,clearTimeouts:d}}function yn(e,t={}){const{floatingContext:n,treeContext:o}=Ee(e),{open:i,setOpen:l,refs:{anchorEl:r,floatingEl:a}}=n,{enabled:d=!0,delay:c=0,restMs:u=0,mouseOnly:g=!1,safePolygon:h=!1}=t,m=f.computed(()=>f.toValue(d)),p=f.computed(()=>f.toValue(u)),w=f.computed(()=>{const b=r.value;return!b||b instanceof HTMLElement?b:b.contextElement??null}),{hide:v,show:x,showDelay:C,clearTimeouts:T}=wn(()=>{i.value||l(!0)},()=>{i.value&&l(!1)},{delay:c});let S=null,y;const E=f.computed(()=>C.value===0&&p.value>0);function P(b){if(!m.value||!M(b)||!E.value||!S)return;const H={x:b.clientX,y:b.clientY},oe=Math.abs(H.x-S.x),$=Math.abs(H.y-S.y);(oe>gt||$>gt)&&(S=H,clearTimeout(y),y=setTimeout(()=>{x(0)},p.value))}function N(b){!m.value||!M(b)||!E.value||(S={x:b.clientX,y:b.clientY},y=setTimeout(()=>{x(0)},p.value))}function R(){clearTimeout(y),S=null}f.watchPostEffect(()=>{const b=w.value;!b||!m.value||!E.value||(b.addEventListener("pointerenter",N),b.addEventListener("pointermove",P),b.addEventListener("pointerleave",R),f.onWatcherCleanup(()=>{b.removeEventListener("pointerenter",N),b.removeEventListener("pointermove",P),b.removeEventListener("pointerleave",R)}))}),f.onScopeDispose(()=>{clearTimeout(y)});function M(b){return f.toValue(g)?b.pointerType==="mouse":!0}function k(b){!m.value||!M(b)||E.value||(V(),x())}function I(b){!m.value||!M(b)||(T(),V())}let B=null;function V(){B&&(document.removeEventListener("pointermove",B),B=null);const b=s.value;b!=null&&b.onPolygonChange&&b.onPolygonChange([])}const O=f.computed(()=>!!f.toValue(h)),s=f.computed(()=>{const b=f.toValue(h);if(typeof b=="object"&&b)return b;if(b===!0)return{}});function F(b){var L;if(!m.value||!M(b))return;const{clientX:H,clientY:oe}=b,$=b.relatedTarget;if(O.value)setTimeout(()=>{var le;V();const j=w.value,ue=a.value;if(!j||!ue){v();return}let G,fe;if(o){G=new Map;const He=ye=>{G==null||G.set(ye.id,ye);for(const We of ye.children.value)He(We)};He(o),fe=o.id}B=vn(s.value)({x:H,y:oe,placement:n.placement.value,elements:{domReference:j,floating:ue},buffer:((le=s.value)==null?void 0:le.buffer)??1,onClose:()=>{V(),v()},nodeId:fe,tree:G?{nodes:G}:void 0}),B&&document.addEventListener("pointermove",B)},0);else{if(o){if(!bn(o,$))return}else if((L=a.value)!=null&&L.contains($))return;v()}}f.watchPostEffect(()=>{const b=w.value;!b||!m.value||(b.addEventListener("pointerenter",k),b.addEventListener("pointerleave",F),f.onWatcherCleanup(()=>{b.removeEventListener("pointerenter",k),b.removeEventListener("pointerleave",F)}))}),f.watchPostEffect(()=>{const b=a.value;!b||!m.value||(b.addEventListener("pointerenter",I),b.addEventListener("pointerleave",F),f.onWatcherCleanup(()=>{b.removeEventListener("pointerenter",I),b.removeEventListener("pointerleave",F)}))}),f.onScopeDispose(()=>{V()})}function bn(e,t){return t?!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Pe(e,t)):!0}const vt=["top","right","bottom","left"],wt=["start","end"],yt=vt.reduce((e,t)=>e.concat(t,t+"-"+wt[0],t+"-"+wt[1]),[]),ie=Math.min,Y=Math.max,Le=Math.round,Ae=Math.floor,Q=e=>({x:e,y:e}),xn={left:"right",right:"left",bottom:"top",top:"bottom"},En={start:"end",end:"start"};function Ge(e,t,n){return Y(e,ie(t,n))}function re(e,t){return typeof e=="function"?e(t):e}function Z(e){return e.split("-")[0]}function U(e){return e.split("-")[1]}function bt(e){return e==="x"?"y":"x"}function Je(e){return e==="y"?"height":"width"}const Cn=new Set(["top","bottom"]);function ne(e){return Cn.has(Z(e))?"y":"x"}function Qe(e){return bt(ne(e))}function xt(e,t,n){n===void 0&&(n=!1);const o=U(e),i=Qe(e),l=Je(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(r=Me(r)),[r,Me(r)]}function Tn(e){const t=Me(e);return[De(e),t,De(t)]}function De(e){return e.replace(/start|end/g,t=>En[t])}const Et=["left","right"],Ct=["right","left"],On=["top","bottom"],Pn=["bottom","top"];function Sn(e,t,n){switch(e){case"top":case"bottom":return n?t?Ct:Et:t?Et:Ct;case"left":case"right":return t?On:Pn;default:return[]}}function Ln(e,t,n,o){const i=U(e);let l=Sn(Z(e),n==="start",o);return i&&(l=l.map(r=>r+"-"+i),t&&(l=l.concat(l.map(De)))),l}function Me(e){return e.replace(/left|right|bottom|top/g,t=>xn[t])}function An(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tt(e){return typeof e!="number"?An(e):{top:e,right:e,bottom:e,left:e}}function Re(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 Ot(e,t,n){let{reference:o,floating:i}=e;const l=ne(t),r=Qe(t),a=Je(r),d=Z(t),c=l==="y",u=o.x+o.width/2-i.width/2,g=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let m;switch(d){case"top":m={x:u,y:o.y-i.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:g};break;case"left":m={x:o.x-i.width,y:g};break;default:m={x:o.x,y:o.y}}switch(U(t)){case"start":m[r]-=h*(n&&c?-1:1);break;case"end":m[r]+=h*(n&&c?-1:1);break}return m}const Dn=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:u,y:g}=Ot(c,o,d),h=o,m={},p=0;for(let w=0;w<a.length;w++){const{name:v,fn:x}=a[w],{x:C,y:T,data:S,reset:y}=await x({x:u,y:g,initialPlacement:o,placement:h,strategy:i,middlewareData:m,rects:c,platform:r,elements:{reference:e,floating:t}});u=C??u,g=T??g,m={...m,[v]:{...m[v],...S}},y&&p<=50&&(p++,typeof y=="object"&&(y.placement&&(h=y.placement),y.rects&&(c=y.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:g}=Ot(c,h,d)),w=-1)}return{x:u,y:g,placement:h,strategy:i,middlewareData:m}};async function pe(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:u="viewport",elementContext:g="floating",altBoundary:h=!1,padding:m=0}=re(t,e),p=Tt(m),v=a[h?g==="floating"?"reference":"floating":g],x=Re(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:u,strategy:d})),C=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)),S=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=Re(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:T,strategy:d}):C);return{top:(x.top-y.top+p.top)/S.y,bottom:(y.bottom-x.bottom+p.bottom)/S.y,left:(x.left-y.left+p.left)/S.x,right:(y.right-x.right+p.right)/S.x}}const Mn=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:u=0}=re(e,t)||{};if(c==null)return{};const g=Tt(u),h={x:n,y:o},m=Qe(i),p=Je(m),w=await r.getDimensions(c),v=m==="y",x=v?"top":"left",C=v?"bottom":"right",T=v?"clientHeight":"clientWidth",S=l.reference[p]+l.reference[m]-h[m]-l.floating[p],y=h[m]-l.reference[m],E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let P=E?E[T]:0;(!P||!await(r.isElement==null?void 0:r.isElement(E)))&&(P=a.floating[T]||l.floating[p]);const N=S/2-y/2,R=P/2-w[p]/2-1,M=ie(g[x],R),k=ie(g[C],R),I=M,B=P-w[p]-k,V=P/2-w[p]/2+N,O=Ge(I,V,B),s=!d.arrow&&U(i)!=null&&V!==O&&l.reference[p]/2-(V<I?M:k)-w[p]/2<0,F=s?V<I?V-I:V-B:0;return{[m]:h[m]+F,data:{[m]:O,centerOffset:V-O-F,...s&&{alignmentOffset:F}},reset:s}}});function Rn(e,t,n){return(e?[...n.filter(i=>U(i)===e),...n.filter(i=>U(i)!==e)]:n.filter(i=>Z(i)===i)).filter(i=>e?U(i)===e||(t?De(i)!==i:!1):!0)}const Nn=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,i;const{rects:l,middlewareData:r,placement:a,platform:d,elements:c}=t,{crossAxis:u=!1,alignment:g,allowedPlacements:h=yt,autoAlignment:m=!0,...p}=re(e,t),w=g!==void 0||h===yt?Rn(g||null,m,h):h,v=await pe(t,p),x=((n=r.autoPlacement)==null?void 0:n.index)||0,C=w[x];if(C==null)return{};const T=xt(C,l,await(d.isRTL==null?void 0:d.isRTL(c.floating)));if(a!==C)return{reset:{placement:w[0]}};const S=[v[Z(C)],v[T[0]],v[T[1]]],y=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:C,overflows:S}],E=w[x+1];if(E)return{data:{index:x+1,overflows:y},reset:{placement:E}};const P=y.map(M=>{const k=U(M.placement);return[M.placement,k&&u?M.overflows.slice(0,2).reduce((I,B)=>I+B,0):M.overflows[0],M.overflows]}).sort((M,k)=>M[1]-k[1]),R=((i=P.filter(M=>M[2].slice(0,U(M[0])?2:3).every(k=>k<=0))[0])==null?void 0:i[0])||P[0][0];return R!==a?{data:{index:x+1,overflows:y},reset:{placement:R}}:{}}}},kn=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:u=!0,crossAxis:g=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:w=!0,...v}=re(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const x=Z(i),C=ne(a),T=Z(a)===a,S=await(d.isRTL==null?void 0:d.isRTL(c.floating)),y=h||(T||!w?[Me(a)]:Tn(a)),E=p!=="none";!h&&E&&y.push(...Ln(a,w,p,S));const P=[a,...y],N=await pe(t,v),R=[];let M=((o=l.flip)==null?void 0:o.overflows)||[];if(u&&R.push(N[x]),g){const V=xt(i,r,S);R.push(N[V[0]],N[V[1]])}if(M=[...M,{placement:i,overflows:R}],!R.every(V=>V<=0)){var k,I;const V=(((k=l.flip)==null?void 0:k.index)||0)+1,O=P[V];if(O&&(!(g==="alignment"?C!==ne(O):!1)||M.every(b=>ne(b.placement)===C?b.overflows[0]>0:!0)))return{data:{index:V,overflows:M},reset:{placement:O}};let s=(I=M.filter(F=>F.overflows[0]<=0).sort((F,b)=>F.overflows[1]-b.overflows[1])[0])==null?void 0:I.placement;if(!s)switch(m){case"bestFit":{var B;const F=(B=M.filter(b=>{if(E){const H=ne(b.placement);return H===C||H==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(H=>H>0).reduce((H,oe)=>H+oe,0)]).sort((b,H)=>b[1]-H[1])[0])==null?void 0:B[0];F&&(s=F);break}case"initialPlacement":s=a;break}if(i!==s)return{reset:{placement:s}}}return{}}}};function Pt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function St(e){return vt.some(t=>e[t]>=0)}const Vn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=re(e,t);switch(o){case"referenceHidden":{const l=await pe(t,{...i,elementContext:"reference"}),r=Pt(l,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:St(r)}}}case"escaped":{const l=await pe(t,{...i,altBoundary:!0}),r=Pt(l,n.floating);return{data:{escapedOffsets:r,escaped:St(r)}}}default:return{}}}}},Fn=new Set(["left","top"]);async function Hn(e,t){const{placement:n,platform:o,elements:i}=e,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=Z(n),a=U(n),d=ne(n)==="y",c=Fn.has(r)?-1:1,u=l&&d?-1:1,g=re(t,e);let{mainAxis:h,crossAxis:m,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"&&(m=a==="end"?p*-1:p),d?{x:m*u,y:h*c}:{x:h*c,y:m*u}}const Wn=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 Hn(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}}}}},In=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,y:C}=v;return{x,y:C}}},...d}=re(e,t),c={x:n,y:o},u=await pe(t,d),g=ne(Z(i)),h=bt(g);let m=c[h],p=c[g];if(l){const v=h==="y"?"top":"left",x=h==="y"?"bottom":"right",C=m+u[v],T=m-u[x];m=Ge(C,m,T)}if(r){const v=g==="y"?"top":"left",x=g==="y"?"bottom":"right",C=p+u[v],T=p-u[x];p=Ge(C,p,T)}const w=a.fn({...t,[h]:m,[g]:p});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[h]:l,[g]:r}}}}}},Bn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:l,platform:r,elements:a}=t,{apply:d=()=>{},...c}=re(e,t),u=await pe(t,c),g=Z(i),h=U(i),m=ne(i)==="y",{width:p,height:w}=l.floating;let v,x;g==="top"||g==="bottom"?(v=g,x=h===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(x=g,v=h==="end"?"top":"bottom");const C=w-u.top-u.bottom,T=p-u.left-u.right,S=ie(w-u[v],C),y=ie(p-u[x],T),E=!t.middlewareData.shift;let P=S,N=y;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=T),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(P=C),E&&!h){const M=Y(u.left,0),k=Y(u.right,0),I=Y(u.top,0),B=Y(u.bottom,0);m?N=p-2*(M!==0||k!==0?M+k:Y(u.left,u.right)):P=w-2*(I!==0||B!==0?I+B:Y(u.top,u.bottom))}await d({...t,availableWidth:N,availableHeight:P});const R=await r.getDimensions(a.floating);return p!==R.width||w!==R.height?{reset:{rects:!0}}:{}}}};function Ne(){return typeof window<"u"}function ge(e){return Lt(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ee(e){var t;return(t=(Lt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Lt(e){return Ne()?e instanceof Node||e instanceof _(e).Node:!1}function K(e){return Ne()?e instanceof Element||e instanceof _(e).Element:!1}function te(e){return Ne()?e instanceof HTMLElement||e instanceof _(e).HTMLElement:!1}function At(e){return!Ne()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _(e).ShadowRoot}const $n=new Set(["inline","contents"]);function Ce(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!$n.has(i)}const jn=new Set(["table","td","th"]);function Xn(e){return jn.has(ge(e))}const Yn=[":popover-open",":modal"];function ke(e){return Yn.some(t=>{try{return e.matches(t)}catch{return!1}})}const _n=["transform","translate","scale","rotate","perspective"],zn=["transform","translate","scale","rotate","perspective","filter"],Un=["paint","layout","strict","content"];function Ze(e){const t=et(),n=K(e)?q(e):e;return _n.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)||zn.some(o=>(n.willChange||"").includes(o))||Un.some(o=>(n.contain||"").includes(o))}function Kn(e){let t=se(e);for(;te(t)&&!ve(t);){if(Ze(t))return t;if(ke(t))return null;t=se(t)}return null}function et(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const qn=new Set(["html","body","#document"]);function ve(e){return qn.has(ge(e))}function q(e){return _(e).getComputedStyle(e)}function Ve(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function se(e){if(ge(e)==="html")return e;const t=e.assignedSlot||e.parentNode||At(e)&&e.host||ee(e);return At(t)?t.host:t}function Dt(e){const t=se(e);return ve(t)?e.ownerDocument?e.ownerDocument.body:e.body:te(t)&&Ce(t)?t:Dt(t)}function Te(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Dt(e),l=i===((o=e.ownerDocument)==null?void 0:o.body),r=_(i);if(l){const a=tt(r);return t.concat(r,r.visualViewport||[],Ce(i)?i:[],a&&n?Te(a):[])}return t.concat(i,Te(i,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mt(e){const t=q(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=te(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 K(e)?e:e.contextElement}function we(e){const t=nt(e);if(!te(t))return Q(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:l}=Mt(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 Gn=Q(0);function Rt(e){const t=_(e);return!et()||!t.visualViewport?Gn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_(e)?!1:t}function ae(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),l=nt(e);let r=Q(1);t&&(o?K(o)&&(r=we(o)):r=we(e));const a=Jn(l,n,o)?Rt(l):Q(0);let d=(i.left+a.x)/r.x,c=(i.top+a.y)/r.y,u=i.width/r.x,g=i.height/r.y;if(l){const h=_(l),m=o&&K(o)?_(o):o;let p=h,w=tt(p);for(;w&&o&&m!==p;){const v=we(w),x=w.getBoundingClientRect(),C=q(w),T=x.left+(w.clientLeft+parseFloat(C.paddingLeft))*v.x,S=x.top+(w.clientTop+parseFloat(C.paddingTop))*v.y;d*=v.x,c*=v.y,u*=v.x,g*=v.y,d+=T,c+=S,p=_(w),w=tt(p)}}return Re({width:u,height:g,x:d,y:c})}function Fe(e,t){const n=Ve(e).scrollLeft;return t?t.left+n:ae(ee(e)).left+n}function Nt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Fe(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function Qn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const l=i==="fixed",r=ee(o),a=t?ke(t.floating):!1;if(o===r||a&&l)return n;let d={scrollLeft:0,scrollTop:0},c=Q(1);const u=Q(0),g=te(o);if((g||!g&&!l)&&((ge(o)!=="body"||Ce(r))&&(d=Ve(o)),te(o))){const m=ae(o);c=we(o),u.x=m.x+o.clientLeft,u.y=m.y+o.clientTop}const h=r&&!g&&!l?Nt(r,d):Q(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-d.scrollTop*c.y+u.y+h.y}}function Zn(e){return Array.from(e.getClientRects())}function eo(e){const t=ee(e),n=Ve(e),o=e.ownerDocument.body,i=Y(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),l=Y(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Fe(e);const a=-n.scrollTop;return q(o).direction==="rtl"&&(r+=Y(t.clientWidth,o.clientWidth)-i),{width:i,height:l,x:r,y:a}}const kt=25;function to(e,t){const n=_(e),o=ee(e),i=n.visualViewport;let l=o.clientWidth,r=o.clientHeight,a=0,d=0;if(i){l=i.width,r=i.height;const u=et();(!u||u&&t==="fixed")&&(a=i.offsetLeft,d=i.offsetTop)}const c=Fe(o);if(c<=0){const u=o.ownerDocument,g=u.body,h=getComputedStyle(g),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(o.clientWidth-g.clientWidth-m);p<=kt&&(l-=p)}else c<=kt&&(l+=c);return{width:l,height:r,x:a,y:d}}const no=new Set(["absolute","fixed"]);function oo(e,t){const n=ae(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,l=te(e)?we(e):Q(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 Vt(e,t,n){let o;if(t==="viewport")o=to(e,n);else if(t==="document")o=eo(ee(e));else if(K(t))o=oo(t,n);else{const i=Rt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Re(o)}function Ft(e,t){const n=se(e);return n===t||!K(n)||ve(n)?!1:q(n).position==="fixed"||Ft(n,t)}function io(e,t){const n=t.get(e);if(n)return n;let o=Te(e,[],!1).filter(a=>K(a)&&ge(a)!=="body"),i=null;const l=q(e).position==="fixed";let r=l?se(e):e;for(;K(r)&&!ve(r);){const a=q(r),d=Ze(r);!d&&a.position==="fixed"&&(i=null),(l?!d&&!i:!d&&a.position==="static"&&!!i&&no.has(i.position)||Ce(r)&&!d&&Ft(e,r))?o=o.filter(u=>u!==r):i=a,r=se(r)}return t.set(e,o),o}function ro(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?ke(t)?[]:io(t,this._c):[].concat(n),o],a=r[0],d=r.reduce((c,u)=>{const g=Vt(t,u,i);return c.top=Y(g.top,c.top),c.right=ie(g.right,c.right),c.bottom=ie(g.bottom,c.bottom),c.left=Y(g.left,c.left),c},Vt(t,a,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function so(e){const{width:t,height:n}=Mt(e);return{width:t,height:n}}function lo(e,t,n){const o=te(t),i=ee(t),l=n==="fixed",r=ae(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const d=Q(0);function c(){d.x=Fe(i)}if(o||!o&&!l)if((ge(t)!=="body"||Ce(i))&&(a=Ve(t)),o){const m=ae(t,!0,l,t);d.x=m.x+t.clientLeft,d.y=m.y+t.clientTop}else i&&c();l&&!o&&i&&c();const u=i&&!o&&!l?Nt(i,a):Q(0),g=r.left+a.scrollLeft-d.x-u.x,h=r.top+a.scrollTop-d.y-u.y;return{x:g,y:h,width:r.width,height:r.height}}function ot(e){return q(e).position==="static"}function Ht(e,t){if(!te(e)||q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ee(e)===n&&(n=n.ownerDocument.body),n}function Wt(e,t){const n=_(e);if(ke(e))return n;if(!te(e)){let i=se(e);for(;i&&!ve(i);){if(K(i)&&!ot(i))return i;i=se(i)}return n}let o=Ht(e,t);for(;o&&Xn(o)&&ot(o);)o=Ht(o,t);return o&&ve(o)&&ot(o)&&!Ze(o)?n:o||Kn(e)||n}const ao=async function(e){const t=this.getOffsetParent||Wt,n=this.getDimensions,o=await n(e.floating);return{reference:lo(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function co(e){return q(e).direction==="rtl"}const uo={convertOffsetParentRelativeRectToViewportRelativeRect:Qn,getDocumentElement:ee,getClippingRect:ro,getOffsetParent:Wt,getElementRects:ao,getClientRects:Zn,getDimensions:so,getScale:we,isElement:K,isRTL:co};function It(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fo(e,t){let n=null,o;const i=ee(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:u,top:g,width:h,height:m}=c;if(a||t(),!h||!m)return;const p=Ae(g),w=Ae(i.clientWidth-(u+h)),v=Ae(i.clientHeight-(g+m)),x=Ae(u),T={rootMargin:-p+"px "+-w+"px "+-v+"px "+-x+"px",threshold:Y(0,ie(1,d))||1};let S=!0;function y(E){const P=E[0].intersectionRatio;if(P!==d){if(!S)return r();P?r(!1,P):o=setTimeout(()=>{r(!1,1e-7)},1e3)}P===1&&!It(c,e.getBoundingClientRect())&&r(),S=!1}try{n=new IntersectionObserver(y,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(y,T)}n.observe(e)}return r(!0),l}function mo(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),u=i||l?[...c?Te(c):[],...Te(t)]:[];u.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),l&&x.addEventListener("resize",n)});const g=c&&a?fo(c,n):null;let h=-1,m=null;r&&(m=new ResizeObserver(x=>{let[C]=x;C&&C.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var T;(T=m)==null||T.observe(t)})),n()}),c&&!d&&m.observe(c),m.observe(t));let p,w=d?ae(e):null;d&&v();function v(){const x=ae(e);w&&!It(w,x)&&n(),w=x,p=requestAnimationFrame(v)}return n(),()=>{var x;u.forEach(C=>{i&&C.removeEventListener("scroll",n),l&&C.removeEventListener("resize",n)}),g==null||g(),(x=m)==null||x.disconnect(),m=null,d&&cancelAnimationFrame(p)}}const ho=Wn,po=Nn,go=In,vo=kn,wo=Bn,yo=Vn,Bt=Mn,bo=(e,t,n)=>{const o=new Map,i={platform:uo,...n},l={...i.platform,_c:o};return Dn(e,t,{...i,platform:l})};function xo(e,t,n={}){const{offset:o="-4px"}=n,{middlewareData:i,placement:l,refs:r}=t;f.watch(e,u=>{r.arrowEl.value=u});const a=f.computed(()=>{var u;return((u=i.value.arrow)==null?void 0:u.x)??0}),d=f.computed(()=>{var u;return((u=i.value.arrow)==null?void 0:u.y)??0}),c=f.computed(()=>{if(!(e.value||r.arrowEl.value)||!i.value.arrow)return{};const g=f.toValue(l).split("-")[0],h=a.value,m=d.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":`${m}px`,"inset-inline-start":o}:g==="left"?{"inset-block-start":`${m}px`,"inset-inline-end":o}:{}});return{arrowX:a,arrowY:d,arrowStyles:c}}function Eo(e){return{name:"arrow",options:e,fn(t){const n=f.toValue(e.element);return n==null?{}:Bt({element:n,padding:e.padding}).fn(t)}}}function it(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:l=!0,open:r=f.ref(!1)}=n,a=y=>{r.value=y},d=f.computed(()=>f.toValue(n.placement)??"bottom"),c=f.computed(()=>f.toValue(n.strategy)??"absolute"),u=f.ref(0),g=f.ref(0),h=f.ref(d.value),m=f.ref(c.value),p=f.shallowRef({}),w=f.ref(!1),v=f.ref(null),x=f.computed(()=>{const y=f.toValue(i)||[];return v.value&&!y.some(P=>P.name==="arrow")?[...y,Eo({element:v})]:y}),C=async()=>{if(!e.value||!t.value)return;const y=await bo(e.value,t.value,{placement:d.value,strategy:c.value,middleware:x.value});u.value=y.x,g.value=y.y,h.value=y.placement,m.value=y.strategy,p.value=y.middlewareData,w.value=r.value};f.watch([d,c,x],()=>{r.value&&C()});let T;f.watch([e,t,r],([y,E,P])=>{!P||!y||!E||(l&&(T=mo(y,E,C,typeof l=="object"?l:void 0)),f.onWatcherCleanup(()=>{T==null||T(),T=void 0}))},{immediate:!0}),f.onScopeDispose(()=>T==null?void 0:T()),f.watch(r,y=>{y||(w.value=!1)});const S=f.ref({position:c.value,left:"0",top:"0"});return f.watch([u,g,()=>f.toValue(o)],([y,E,P])=>{const N=t.value;if(!N)return;const R={position:m.value,left:"0",top:"0"},M=$t(N,y),k=$t(N,E);P?S.value={...R,transform:`translate(${M}px, ${k}px)`,...jt(N)>=1.5&&{"will-change":"transform"}}:S.value={...R,left:`${M}px`,top:`${k}px`}},{immediate:!0}),{x:u,y:g,strategy:m,placement:h,middlewareData:p,isPositioned:w,floatingStyles:S,update:C,refs:{anchorEl:e,floatingEl:t,arrowEl:v},open:r,setOpen:a}}function $t(e,t){const n=jt(e);return Math.round(t*n)/n}function jt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Co(e,t,n={},o={}){const{...i}=n,l=it(e,t,i),r=Xt(l,o);return{...r,addNode:(g,h,m={})=>{const{parentId:p,...w}=m,v=it(g,h,w);return r.addNode(v,p)},getAllOpenNodes:()=>{const g=[];for(const h of r.nodeMap.values())h.data.open.value&&g.push(h);return g},getTopmostOpenNode:()=>{let g=null,h=-1;for(const m of r.nodeMap.values())if(m.data.open.value){const p=m.getPath().length;p>h&&(h=p,g=m)}return g},applyToNodes:(g,h,m={})=>{const{relationship:p="self-and-children",applyToMatching:w=!0}=m,v=r.findNodeById(g);if(!v)return;const x=[],C=new Set,T=y=>{y&&!C.has(y.id)&&(x.push(y),C.add(y.id))},S=y=>{for(const E of y)T(E)};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")S(v.children.value);else if(p==="self-and-ancestors")S(v.getPath());else if(p==="self-and-children")T(v),S(v.children.value);else if(p==="self-and-descendants")S(r.traverse("dfs",v));else if(p==="self-and-siblings")T(v),v.parent.value&&S(v.parent.value.children.value);else if(p==="self-ancestors-and-children")S(v.getPath()),S(v.children.value);else if(p==="full-branch")S(v.getPath()),S(r.traverse("dfs",v));else if(p==="all-except-branch"){const y=new Set;for(const E of v.getPath())y.add(E.id);for(const E of r.traverse("dfs",v))y.add(E.id);for(const E of r.nodeMap.values())!y.has(E.id)===w&&h(E);return}else{console.warn(`applyToNodes: Unknown relationship "${p}".`);return}if(w)for(const y of x)h(y);else for(const y of r.nodeMap.values())C.has(y.id)||h(y)}}}function rt(e,t=null,n={},o=!1){const i=n.id??pn(),l=f.shallowRef(t),r=f.shallowRef([]),a=f.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(u=>u.id!==c.id),c.parent.value=null,!0):!1,findChild:c=>r.value.find(c)??null,findDescendant:c=>{const u=[d];for(;u.length>0;){const g=u.pop();if(c(g))return g;for(let h=g.children.value.length-1;h>=0;h--)u.push(g.children.value[h])}return null},isDescendantOf:c=>{let u=l.value;for(;u;){if(u.id===c.id)return!0;u=u.parent.value}return!1},getPath:()=>{const c=[];let u=d;for(;u;)c.push(u),u=u.parent.value;return c.reverse()}};return Object.freeze(d)}function Xt(e,t){const n=(t==null?void 0:t.deleteStrategy)??"recursive",o=f.shallowReactive(new Map),i=rt(e,null,{},!0);o.set(i.id,i);const l=h=>o.get(h)??null,r=(h,m=null,p={})=>{const w=m?l(m):i;if(!w)return console.error(`Tree addNode: Parent node with ID ${m} not found.`),null;p.id&&o.has(p.id)&&(p.id=void 0);const v=rt(h,w,p);return o.set(v.id,v),w.addChild(v),v},a=(h,m)=>{const p=m??n,w=l(h);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 x of w.children.value)x.parent.value=null;w.children.value=[],o.delete(w.id)}return v._removeChildInstance(w)},d=(h,m)=>{const p=l(h);if(!p)return console.error(`Tree moveNode: Node with ID ${h} not found.`),!1;if(p.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(h===m)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const w=m?l(m):i;if(!w)return console.error(`Tree moveNode: New parent node with ID ${m} 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=(h="dfs",m=i)=>{const p=[];if(!m)return console.warn("Tree traverse: Start node is null, returning empty array."),p;if(h==="dfs"){const w=[m];for(;w.length>0;){const v=w.pop();p.push(v);for(let x=v.children.value.length-1;x>=0;x--)w.push(v.children.value[x])}}else{const w=[m];for(;w.length>0;){const v=w.shift();p.push(v);for(const x of v.children.value)w.push(x)}}return p},u=()=>{o.clear()},g=h=>{const m=[...h.children.value];for(const p of m)g(p);o.delete(h.id),h.children.value=[]};return Object.freeze({get root(){return i},get nodeMap(){return o},findNodeById:l,addNode:r,removeNode:a,moveNode:d,traverse:c,dispose:u})}A.arrow=Bt,A.autoPlacement=po,A.clearTimeoutIfSet=Ke,A.contains=Oe,A.createTree=Xt,A.createTreeNode=rt,A.findDescendantContainingTarget=Pe,A.flip=vo,A.getContextFromParameter=Ee,A.getCurrentTime=Ue,A.getTarget=ct,A.hide=yo,A.isButtonTarget=Ye,A.isClickOnScrollbar=at,A.isEventTargetWithin=ze,A.isHTMLElement=lt,A.isMac=Be,A.isMouseLikePointerType=je,A.isSafari=$e,A.isSpaceIgnored=_e,A.isTargetWithinElement=z,A.isTreeNode=ut,A.isTypeableElement=Xe,A.isVirtualElement=nn,A.matchesFocusVisible=st,A.offset=ho,A.shift=go,A.size=wo,A.useArrow=xo,A.useClick=on,A.useClientPoint=an,A.useEscapeKey=cn,A.useFloating=it,A.useFloatingTree=Co,A.useFocus=dn,A.useHover=yn,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(N,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],h):(N=typeof globalThis<"u"?globalThis:N||self,h(N.VFloat={},N.Vue))})(this,(function(N,h){"use strict";var Co=Object.defineProperty;var To=(N,h,me)=>h in N?Co(N,h,{enumerable:!0,configurable:!0,writable:!0,value:me}):N[h]=me;var xe=(N,h,me)=>To(N,typeof h!="symbol"?h+"":h,me);function me(e,t,n={}){const{offset:o="-4px"}=n,{middlewareData:i,placement:c,refs:r}=t;h.watch(e,f=>{r.arrowEl.value=f});const a=h.computed(()=>{var f;return((f=i.value.arrow)==null?void 0:f.x)??0}),d=h.computed(()=>{var f;return((f=i.value.arrow)==null?void 0:f.y)??0}),s=h.computed(()=>{if(!(e.value||r.arrowEl.value)||!i.value.arrow)return{};const u=h.toValue(c).split("-")[0],p=a.value,m=d.value;return u==="bottom"?{"inset-inline-start":`${p}px`,"inset-block-start":o}:u==="top"?{"inset-inline-start":`${p}px`,"inset-block-end":o}:u==="right"?{"inset-block-start":`${m}px`,"inset-inline-start":o}:u==="left"?{"inset-block-start":`${m}px`,"inset-inline-end":o}:{}});return{arrowX:a,arrowY:d,arrowStyles:s}}let jt=0;function Qe(){return h.useId()||`id-${++jt}`}function He(e){return e instanceof Element&&e instanceof HTMLElement}function zt(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function Ut(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Kt(e){return typeof(e==null?void 0:e.matches)!="function"?!1:e.matches(":focus-visible")}function Ze(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function et(e){return!e||!(e instanceof HTMLElement)?!1:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable&&e.contentEditable!=="false"}function tt(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 nt(e){return et(e)}function ot(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function qt(e,t){const n=t.getBoundingClientRect(),o=t.offsetWidth-t.clientWidth,i=t.offsetHeight-t.clientHeight,c=e.clientX-n.left,r=e.clientY-n.top;if(o>0){const a=t.clientWidth;if(c>=a&&c<=t.offsetWidth)return!0}if(i>0){const a=t.clientHeight;if(r>=a&&r<=t.offsetHeight)return!0}return!1}function We(e,t){return e.contains(t)}function Gt(e){return e.target}function it(){return typeof performance<"u"?performance.now():Date.now()}function rt(e){e!==-1&&clearTimeout(e)}function Jt(e){return e!==null&&typeof e=="object"&&"data"in e&&"id"in e&&"children"in e&&"parent"in e}function Ie(e){return Jt(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 Be(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=Be(n,t);if(o)return o}return null}const Te=e=>typeof e=="number"&&Number.isFinite(e)?e:null,ce=class ce{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:ce.DEFAULT_DIMENSIONS.width,height:ce.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:c}=t;return c&&n!==null?n:o!==null?o:i}calculateSize(t,n){const o=(i,c)=>Math.max(0,i||c);switch(t){case"both":return{width:0,height:0};case"x":return{width:o(n.width,ce.DEFAULT_DIMENSIONS.width),height:0};case"y":return{width:0,height:o(n.height,ce.DEFAULT_DIMENSIONS.height)}}}buildDOMRect(t){const{x:n,y:o,width:i,height:c}=t,r=Math.max(0,i),a=Math.max(0,c);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})}}};xe(ce,"DEFAULT_DIMENSIONS",{width:100,height:30});let Oe=ce;class $e{constructor(){xe(this,"lastKnownCoordinates",null)}getCoordinatesForOpening(){return this.lastKnownCoordinates}onClose(){this.lastKnownCoordinates=null}reset(){this.lastKnownCoordinates=null}}class st extends $e{constructor(){super(...arguments);xe(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&&Ze(n.originalEvent.pointerType,!0)?i:null;case"pointerenter":return i;default:return null}}}class lt extends $e{constructor(){super(...arguments);xe(this,"name","static");xe(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 Qt(e,t,n={}){const{open:o,refs:i}=t,c=new Oe,r=h.ref({x:null,y:null}),a=h.ref(null),d=h.computed(()=>h.toValue(n.axis??"both")),s=h.computed(()=>h.toValue(n.enabled??!0)),f=h.computed(()=>Te(h.toValue(n.x??null))),u=h.computed(()=>Te(h.toValue(n.y??null))),p=h.computed(()=>f.value!==null&&u.value!==null),m=h.computed(()=>p.value?{x:f.value,y:u.value}:r.value),g=h.computed(()=>{const b=m.value;switch(d.value){case"x":return{x:b.x,y:null};case"y":return{x:null,y:b.y};case"both":return b}}),w=(n.trackingMode??"follow")==="follow"?new st:new lt,v=(b,P)=>{p.value||(r.value={x:Te(b),y:Te(P)})},E=()=>{p.value||(r.value={x:null,y:null})},x=(b,P)=>{const M={type:P,coordinates:{x:b.clientX,y:b.clientY},originalEvent:b},R=w.process(M,{isOpen:o.value});R&&v(R.x,R.y)};h.watch([g,a,d,e],()=>{i.anchorEl.value=c.create({coordinates:g.value,referenceElement:e.value,baselineCoordinates:a.value,axis:d.value})},{immediate:!0}),h.watch(o,b=>{if(!(!s.value||p.value))if(b){const P=w.getCoordinatesForOpening();P?(v(P.x,P.y),a.value={...P}):a.value={...r.value}}else w.onClose(),E(),a.value=null});const C=b=>{x(b,"pointerdown")},S=b=>{x(b,"pointerenter")},L=b=>{x(b,"pointermove")};return h.watchEffect(()=>{if(p.value||!s.value)return;const b=e.value;if(!b)return;const P=w.getRequiredEvents(),M={pointerenter:S,pointerdown:C,pointermove:L};P.forEach(R=>{const D=M[R];D&&b.addEventListener(R,D)}),h.onWatcherCleanup(()=>{P.forEach(R=>{const D=M[R];D&&b.removeEventListener(R,D)})})}),{coordinates:h.readonly(g),updatePosition:(b,P)=>v(b,P)}}const at=["top","right","bottom","left"],ct=["start","end"],ut=at.reduce((e,t)=>e.concat(t,t+"-"+ct[0],t+"-"+ct[1]),[]),ie=Math.min,Y=Math.max,Pe=Math.round,Se=Math.floor,Q=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 Y(e,ie(t,n))}function re(e,t){return typeof e=="function"?e(t):e}function Z(e){return e.split("-")[0]}function U(e){return e.split("-")[1]}function ft(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(Z(e))?"y":"x"}function Ye(e){return ft(ne(e))}function dt(e,t,n){n===void 0&&(n=!1);const o=U(e),i=Ye(e),c=Xe(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(r=Ae(r)),[r,Ae(r)]}function nn(e){const t=Ae(e);return[Le(e),t,Le(t)]}function Le(e){return e.replace(/start|end/g,t=>en[t])}const ht=["left","right"],mt=["right","left"],on=["top","bottom"],rn=["bottom","top"];function sn(e,t,n){switch(e){case"top":case"bottom":return n?t?mt:ht:t?ht:mt;case"left":case"right":return t?on:rn;default:return[]}}function ln(e,t,n,o){const i=U(e);let c=sn(Z(e),n==="start",o);return i&&(c=c.map(r=>r+"-"+i),t&&(c=c.concat(c.map(Le)))),c}function Ae(e){return e.replace(/left|right|bottom|top/g,t=>Zt[t])}function an(e){return{top:0,right:0,bottom:0,left:0,...e}}function pt(e){return typeof e!="number"?an(e):{top:e,right:e,bottom:e,left:e}}function De(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 c=ne(t),r=Ye(t),a=Xe(r),d=Z(t),s=c==="y",f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[a]/2-i[a]/2;let m;switch(d){case"top":m={x:f,y:o.y-i.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:u};break;case"left":m={x:o.x-i.width,y:u};break;default:m={x:o.x,y:o.y}}switch(U(t)){case"start":m[r]-=p*(n&&s?-1:1);break;case"end":m[r]+=p*(n&&s?-1:1);break}return m}const cn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:c=[],platform:r}=n,a=c.filter(Boolean),d=await(r.isRTL==null?void 0:r.isRTL(t));let s=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:u}=gt(s,o,d),p=o,m={},g=0;for(let w=0;w<a.length;w++){const{name:v,fn:E}=a[w],{x,y:C,data:S,reset:L}=await E({x:f,y:u,initialPlacement:o,placement:p,strategy:i,middlewareData:m,rects:s,platform:r,elements:{reference:e,floating:t}});f=x??f,u=C??u,m={...m,[v]:{...m[v],...S}},L&&g<=50&&(g++,typeof L=="object"&&(L.placement&&(p=L.placement),L.rects&&(s=L.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):L.rects),{x:f,y:u}=gt(s,p,d)),w=-1)}return{x:f,y:u,placement:p,strategy:i,middlewareData:m}};async function pe(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:c,rects:r,elements:a,strategy:d}=e,{boundary:s="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=re(t,e),g=pt(m),v=a[p?u==="floating"?"reference":"floating":u],E=De(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(v)))==null||n?v:v.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(a.floating)),boundary:s,rootBoundary:f,strategy:d})),x=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,C=await(c.getOffsetParent==null?void 0:c.getOffsetParent(a.floating)),S=await(c.isElement==null?void 0:c.isElement(C))?await(c.getScale==null?void 0:c.getScale(C))||{x:1,y:1}:{x:1,y:1},L=De(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:C,strategy:d}):x);return{top:(E.top-L.top+g.top)/S.y,bottom:(L.bottom-E.bottom+g.bottom)/S.y,left:(E.left-L.left+g.left)/S.x,right:(L.right-E.right+g.right)/S.x}}const un=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:c,platform:r,elements:a,middlewareData:d}=t,{element:s,padding:f=0}=re(e,t)||{};if(s==null)return{};const u=pt(f),p={x:n,y:o},m=Ye(i),g=Xe(m),w=await r.getDimensions(s),v=m==="y",E=v?"top":"left",x=v?"bottom":"right",C=v?"clientHeight":"clientWidth",S=c.reference[g]+c.reference[m]-p[m]-c.floating[g],L=p[m]-c.reference[m],b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s));let P=b?b[C]:0;(!P||!await(r.isElement==null?void 0:r.isElement(b)))&&(P=a.floating[C]||c.floating[g]);const M=S/2-L/2,R=P/2-w[g]/2-1,D=ie(u[E],R),k=ie(u[x],R),F=D,B=P-w[g]-k,V=P/2-w[g]/2+M,T=_e(F,V,B),l=!d.arrow&&U(i)!=null&&V!==T&&c.reference[g]/2-(V<F?D:k)-w[g]/2<0,H=l?V<F?V-F:V-B:0;return{[m]:p[m]+H,data:{[m]:T,centerOffset:V-T-H,...l&&{alignmentOffset:H}},reset:l}}});function fn(e,t,n){return(e?[...n.filter(i=>U(i)===e),...n.filter(i=>U(i)!==e)]:n.filter(i=>Z(i)===i)).filter(i=>e?U(i)===e||(t?Le(i)!==i:!1):!0)}const dn=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,i;const{rects:c,middlewareData:r,placement:a,platform:d,elements:s}=t,{crossAxis:f=!1,alignment:u,allowedPlacements:p=ut,autoAlignment:m=!0,...g}=re(e,t),w=u!==void 0||p===ut?fn(u||null,m,p):p,v=await pe(t,g),E=((n=r.autoPlacement)==null?void 0:n.index)||0,x=w[E];if(x==null)return{};const C=dt(x,c,await(d.isRTL==null?void 0:d.isRTL(s.floating)));if(a!==x)return{reset:{placement:w[0]}};const S=[v[Z(x)],v[C[0]],v[C[1]]],L=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:x,overflows:S}],b=w[E+1];if(b)return{data:{index:E+1,overflows:L},reset:{placement:b}};const P=L.map(D=>{const k=U(D.placement);return[D.placement,k&&f?D.overflows.slice(0,2).reduce((F,B)=>F+B,0):D.overflows[0],D.overflows]}).sort((D,k)=>D[1]-k[1]),R=((i=P.filter(D=>D[2].slice(0,U(D[0])?2:3).every(k=>k<=0))[0])==null?void 0:i[0])||P[0][0];return R!==a?{data:{index:E+1,overflows:L},reset:{placement:R}}:{}}}},hn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:c,rects:r,initialPlacement:a,platform:d,elements:s}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...v}=re(e,t);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const E=Z(i),x=ne(a),C=Z(a)===a,S=await(d.isRTL==null?void 0:d.isRTL(s.floating)),L=p||(C||!w?[Ae(a)]:nn(a)),b=g!=="none";!p&&b&&L.push(...ln(a,w,g,S));const P=[a,...L],M=await pe(t,v),R=[];let D=((o=c.flip)==null?void 0:o.overflows)||[];if(f&&R.push(M[E]),u){const V=dt(i,r,S);R.push(M[V[0]],M[V[1]])}if(D=[...D,{placement:i,overflows:R}],!R.every(V=>V<=0)){var k,F;const V=(((k=c.flip)==null?void 0:k.index)||0)+1,T=P[V];if(T&&(!(u==="alignment"?x!==ne(T):!1)||D.every(y=>ne(y.placement)===x?y.overflows[0]>0:!0)))return{data:{index:V,overflows:D},reset:{placement:T}};let l=(F=D.filter(H=>H.overflows[0]<=0).sort((H,y)=>H.overflows[1]-y.overflows[1])[0])==null?void 0:F.placement;if(!l)switch(m){case"bestFit":{var B;const H=(B=D.filter(y=>{if(b){const W=ne(y.placement);return W===x||W==="y"}return!0}).map(y=>[y.placement,y.overflows.filter(W=>W>0).reduce((W,oe)=>W+oe,0)]).sort((y,W)=>y[1]-W[1])[0])==null?void 0:B[0];H&&(l=H);break}case"initialPlacement":l=a;break}if(i!==l)return{reset:{placement:l}}}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 at.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}=re(e,t);switch(o){case"referenceHidden":{const c=await pe(t,{...i,elementContext:"reference"}),r=vt(c,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:wt(r)}}}case"escaped":{const c=await pe(t,{...i,altBoundary:!0}),r=vt(c,n.floating);return{data:{escapedOffsets:r,escaped:wt(r)}}}default:return{}}}}},pn=new Set(["left","top"]);async function gn(e,t){const{placement:n,platform:o,elements:i}=e,c=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=Z(n),a=U(n),d=ne(n)==="y",s=pn.has(r)?-1:1,f=c&&d?-1:1,u=re(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),d?{x:m*f,y:p*s}:{x:p*s,y:m*f}}const vn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:c,placement:r,middlewareData:a}=t,d=await gn(t,e);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:c+d.y,data:{...d,placement:r}}}}},wn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:c=!0,crossAxis:r=!1,limiter:a={fn:v=>{let{x:E,y:x}=v;return{x:E,y:x}}},...d}=re(e,t),s={x:n,y:o},f=await pe(t,d),u=ne(Z(i)),p=ft(u);let m=s[p],g=s[u];if(c){const v=p==="y"?"top":"left",E=p==="y"?"bottom":"right",x=m+f[v],C=m-f[E];m=_e(x,m,C)}if(r){const v=u==="y"?"top":"left",E=u==="y"?"bottom":"right",x=g+f[v],C=g-f[E];g=_e(x,g,C)}const w=a.fn({...t,[p]:m,[u]:g});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[p]:c,[u]:r}}}}}},yn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:c,platform:r,elements:a}=t,{apply:d=()=>{},...s}=re(e,t),f=await pe(t,s),u=Z(i),p=U(i),m=ne(i)==="y",{width:g,height:w}=c.floating;let v,E;u==="top"||u==="bottom"?(v=u,E=p===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(E=u,v=p==="end"?"top":"bottom");const x=w-f.top-f.bottom,C=g-f.left-f.right,S=ie(w-f[v],x),L=ie(g-f[E],C),b=!t.middlewareData.shift;let P=S,M=L;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(P=x),b&&!p){const D=Y(f.left,0),k=Y(f.right,0),F=Y(f.top,0),B=Y(f.bottom,0);m?M=g-2*(D!==0||k!==0?D+k:Y(f.left,f.right)):P=w-2*(F!==0||B!==0?F+B:Y(f.top,f.bottom))}await d({...t,availableWidth:M,availableHeight:P});const R=await r.getDimensions(a.floating);return g!==R.width||w!==R.height?{reset:{rects:!0}}:{}}}};function Re(){return typeof window<"u"}function ge(e){return yt(e)?(e.nodeName||"").toLowerCase():"#document"}function j(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ee(e){var t;return(t=(yt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yt(e){return Re()?e instanceof Node||e instanceof j(e).Node:!1}function K(e){return Re()?e instanceof Element||e instanceof j(e).Element:!1}function te(e){return Re()?e instanceof HTMLElement||e instanceof j(e).HTMLElement:!1}function bt(e){return!Re()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof j(e).ShadowRoot}const bn=new Set(["inline","contents"]);function Ee(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!bn.has(i)}const xn=new Set(["table","td","th"]);function En(e){return xn.has(ge(e))}const Cn=[":popover-open",":modal"];function Me(e){return Cn.some(t=>{try{return e.matches(t)}catch{return!1}})}const Tn=["transform","translate","scale","rotate","perspective"],On=["transform","translate","scale","rotate","perspective","filter"],Pn=["paint","layout","strict","content"];function je(e){const t=ze(),n=K(e)?q(e):e;return Tn.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)||On.some(o=>(n.willChange||"").includes(o))||Pn.some(o=>(n.contain||"").includes(o))}function Sn(e){let t=se(e);for(;te(t)&&!ve(t);){if(je(t))return t;if(Me(t))return null;t=se(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 ve(e){return Ln.has(ge(e))}function q(e){return j(e).getComputedStyle(e)}function Ne(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function se(e){if(ge(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bt(e)&&e.host||ee(e);return bt(t)?t.host:t}function xt(e){const t=se(e);return ve(t)?e.ownerDocument?e.ownerDocument.body:e.body:te(t)&&Ee(t)?t:xt(t)}function Ce(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=xt(e),c=i===((o=e.ownerDocument)==null?void 0:o.body),r=j(i);if(c){const a=Ue(r);return t.concat(r,r.visualViewport||[],Ee(i)?i:[],a&&n?Ce(a):[])}return t.concat(i,Ce(i,[],n))}function Ue(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Et(e){const t=q(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=te(e),c=i?e.offsetWidth:n,r=i?e.offsetHeight:o,a=Pe(n)!==c||Pe(o)!==r;return a&&(n=c,o=r),{width:n,height:o,$:a}}function Ke(e){return K(e)?e:e.contextElement}function we(e){const t=Ke(e);if(!te(t))return Q(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:c}=Et(t);let r=(c?Pe(n.width):n.width)/o,a=(c?Pe(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const An=Q(0);function Ct(e){const t=j(e);return!ze()||!t.visualViewport?An:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Dn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==j(e)?!1:t}function ae(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),c=Ke(e);let r=Q(1);t&&(o?K(o)&&(r=we(o)):r=we(e));const a=Dn(c,n,o)?Ct(c):Q(0);let d=(i.left+a.x)/r.x,s=(i.top+a.y)/r.y,f=i.width/r.x,u=i.height/r.y;if(c){const p=j(c),m=o&&K(o)?j(o):o;let g=p,w=Ue(g);for(;w&&o&&m!==g;){const v=we(w),E=w.getBoundingClientRect(),x=q(w),C=E.left+(w.clientLeft+parseFloat(x.paddingLeft))*v.x,S=E.top+(w.clientTop+parseFloat(x.paddingTop))*v.y;d*=v.x,s*=v.y,f*=v.x,u*=v.y,d+=C,s+=S,g=j(w),w=Ue(g)}}return De({width:f,height:u,x:d,y:s})}function ke(e,t){const n=Ne(e).scrollLeft;return t?t.left+n:ae(ee(e)).left+n}function Tt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ke(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function Rn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const c=i==="fixed",r=ee(o),a=t?Me(t.floating):!1;if(o===r||a&&c)return n;let d={scrollLeft:0,scrollTop:0},s=Q(1);const f=Q(0),u=te(o);if((u||!u&&!c)&&((ge(o)!=="body"||Ee(r))&&(d=Ne(o)),te(o))){const m=ae(o);s=we(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}const p=r&&!u&&!c?Tt(r,d):Q(0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-d.scrollLeft*s.x+f.x+p.x,y:n.y*s.y-d.scrollTop*s.y+f.y+p.y}}function Mn(e){return Array.from(e.getClientRects())}function Nn(e){const t=ee(e),n=Ne(e),o=e.ownerDocument.body,i=Y(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),c=Y(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+ke(e);const a=-n.scrollTop;return q(o).direction==="rtl"&&(r+=Y(t.clientWidth,o.clientWidth)-i),{width:i,height:c,x:r,y:a}}const Ot=25;function kn(e,t){const n=j(e),o=ee(e),i=n.visualViewport;let c=o.clientWidth,r=o.clientHeight,a=0,d=0;if(i){c=i.width,r=i.height;const f=ze();(!f||f&&t==="fixed")&&(a=i.offsetLeft,d=i.offsetTop)}const s=ke(o);if(s<=0){const f=o.ownerDocument,u=f.body,p=getComputedStyle(u),m=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(o.clientWidth-u.clientWidth-m);g<=Ot&&(c-=g)}else s<=Ot&&(c+=s);return{width:c,height:r,x:a,y:d}}const Fn=new Set(["absolute","fixed"]);function Vn(e,t){const n=ae(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,c=te(e)?we(e):Q(1),r=e.clientWidth*c.x,a=e.clientHeight*c.y,d=i*c.x,s=o*c.y;return{width:r,height:a,x:d,y:s}}function Pt(e,t,n){let o;if(t==="viewport")o=kn(e,n);else if(t==="document")o=Nn(ee(e));else if(K(t))o=Vn(t,n);else{const i=Ct(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return De(o)}function St(e,t){const n=se(e);return n===t||!K(n)||ve(n)?!1:q(n).position==="fixed"||St(n,t)}function Hn(e,t){const n=t.get(e);if(n)return n;let o=Ce(e,[],!1).filter(a=>K(a)&&ge(a)!=="body"),i=null;const c=q(e).position==="fixed";let r=c?se(e):e;for(;K(r)&&!ve(r);){const a=q(r),d=je(r);!d&&a.position==="fixed"&&(i=null),(c?!d&&!i:!d&&a.position==="static"&&!!i&&Fn.has(i.position)||Ee(r)&&!d&&St(e,r))?o=o.filter(f=>f!==r):i=a,r=se(r)}return t.set(e,o),o}function Wn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?Me(t)?[]:Hn(t,this._c):[].concat(n),o],a=r[0],d=r.reduce((s,f)=>{const u=Pt(t,f,i);return s.top=Y(u.top,s.top),s.right=ie(u.right,s.right),s.bottom=ie(u.bottom,s.bottom),s.left=Y(u.left,s.left),s},Pt(t,a,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function In(e){const{width:t,height:n}=Et(e);return{width:t,height:n}}function Bn(e,t,n){const o=te(t),i=ee(t),c=n==="fixed",r=ae(e,!0,c,t);let a={scrollLeft:0,scrollTop:0};const d=Q(0);function s(){d.x=ke(i)}if(o||!o&&!c)if((ge(t)!=="body"||Ee(i))&&(a=Ne(t)),o){const m=ae(t,!0,c,t);d.x=m.x+t.clientLeft,d.y=m.y+t.clientTop}else i&&s();c&&!o&&i&&s();const f=i&&!o&&!c?Tt(i,a):Q(0),u=r.left+a.scrollLeft-d.x-f.x,p=r.top+a.scrollTop-d.y-f.y;return{x:u,y:p,width:r.width,height:r.height}}function qe(e){return q(e).position==="static"}function Lt(e,t){if(!te(e)||q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ee(e)===n&&(n=n.ownerDocument.body),n}function At(e,t){const n=j(e);if(Me(e))return n;if(!te(e)){let i=se(e);for(;i&&!ve(i);){if(K(i)&&!qe(i))return i;i=se(i)}return n}let o=Lt(e,t);for(;o&&En(o)&&qe(o);)o=Lt(o,t);return o&&ve(o)&&qe(o)&&!je(o)?n:o||Sn(e)||n}const $n=async function(e){const t=this.getOffsetParent||At,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 _n(e){return q(e).direction==="rtl"}const Xn={convertOffsetParentRelativeRectToViewportRelativeRect:Rn,getDocumentElement:ee,getClippingRect:Wn,getOffsetParent:At,getElementRects:$n,getClientRects:Mn,getDimensions:In,getScale:we,isElement:K,isRTL:_n};function Dt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yn(e,t){let n=null,o;const i=ee(e);function c(){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),c();const s=e.getBoundingClientRect(),{left:f,top:u,width:p,height:m}=s;if(a||t(),!p||!m)return;const g=Se(u),w=Se(i.clientWidth-(f+p)),v=Se(i.clientHeight-(u+m)),E=Se(f),C={rootMargin:-g+"px "+-w+"px "+-v+"px "+-E+"px",threshold:Y(0,ie(1,d))||1};let S=!0;function L(b){const P=b[0].intersectionRatio;if(P!==d){if(!S)return r();P?r(!1,P):o=setTimeout(()=>{r(!1,1e-7)},1e3)}P===1&&!Dt(s,e.getBoundingClientRect())&&r(),S=!1}try{n=new IntersectionObserver(L,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(L,C)}n.observe(e)}return r(!0),c}function jn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:c=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,s=Ke(e),f=i||c?[...s?Ce(s):[],...Ce(t)]:[];f.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),c&&E.addEventListener("resize",n)});const u=s&&a?Yn(s,n):null;let p=-1,m=null;r&&(m=new ResizeObserver(E=>{let[x]=E;x&&x.target===s&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(t)})),n()}),s&&!d&&m.observe(s),m.observe(t));let g,w=d?ae(e):null;d&&v();function v(){const E=ae(e);w&&!Dt(w,E)&&n(),w=E,g=requestAnimationFrame(v)}return n(),()=>{var E;f.forEach(x=>{i&&x.removeEventListener("scroll",n),c&&x.removeEventListener("resize",n)}),u==null||u(),(E=m)==null||E.disconnect(),m=null,d&&cancelAnimationFrame(g)}}const zn=vn,Un=dn,Kn=wn,qn=hn,Gn=yn,Jn=mn,Qn=un,Zn=(e,t,n)=>{const o=new Map,i={platform:Xn,...n},c={...i.platform,_c:o};return cn(e,t,{...i,platform:c})};function Rt(e){return{name:"arrow",options:e,fn(t){const n=h.toValue(e.element);return n==null?{}:Qn({element:n,padding:e.padding}).fn(t)}}}function Mt(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:c=!0,open:r=h.ref(!1),onOpenChange:a}=n,d=(b,P,M)=>{if(r.value===b)return;r.value=b;const R=P??"programmatic";a==null||a(b,R,M)},s=h.computed(()=>h.toValue(n.placement)??"bottom"),f=h.computed(()=>h.toValue(n.strategy)??"absolute"),u=h.ref(0),p=h.ref(0),m=h.ref(s.value),g=h.ref(f.value),w=h.shallowRef({}),v=h.ref(!1),E=h.ref(null),x=h.computed(()=>{const b=h.toValue(i)||[];return E.value&&!b.some(M=>M.name==="arrow")?[...b,Rt({element:E})]:b}),C=async()=>{if(!(!e.value||!t.value))try{const b=await Zn(e.value,t.value,{placement:s.value,strategy:f.value,middleware:x.value});u.value=b.x,p.value=b.y,m.value=b.placement,g.value=b.strategy,w.value=b.middlewareData,v.value=r.value}catch{}};h.watch([s,f,x],()=>{r.value&&C()});let S;h.watch([e,t,r],([b,P,M])=>{!M||!b||!P||(c&&(S=jn(b,P,C,typeof c=="object"?c:void 0)),h.onWatcherCleanup(()=>{S==null||S(),S=void 0}))},{immediate:!0}),h.onScopeDispose(()=>S==null?void 0:S()),h.watch(r,b=>{b||(v.value=!1)});const L=h.ref({position:f.value,left:"0",top:"0"});return h.watch([u,p,()=>h.toValue(o)],([b,P,M])=>{const R=t.value;if(!R)return;const D={position:g.value,left:"0",top:"0"},k=Nt(R,b),F=Nt(R,P);M?L.value={...D,transform:`translate(${k}px, ${F}px)`,...kt(R)>=1.5&&{"will-change":"transform"}}:L.value={...D,left:`${k}px`,top:`${F}px`}},{immediate:!0}),{id:n.id,x:u,y:p,strategy:g,placement:m,middlewareData:w,isPositioned:v,floatingStyles:L,update:C,refs:{anchorEl:e,floatingEl:t,arrowEl:E},open:r,setOpen:d}}function Nt(e,t){const n=kt(e);return Math.round(t*n)/n}function kt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eo(e={}){let t;return t=Ft(e),{...t,get root(){return t.root},addNode:(r,a,d={})=>{const{parentId:s,...f}=d,u=Qe(),p=f.onOpenChange,m=Mt(r,a,{...f,id:u,onOpenChange:(w,v,E)=>{if(p==null||p(w,v,E),!w){const x=t.findNodeById(u);if(x){const C=x.children.value;for(const S of C)S.data.open.value&&S.data.setOpen(!1,"tree-ancestor-close",E)}}}});return t.addNode(m,s,{id:u})},getAllOpenNodes:()=>{const r=[];for(const a of t.nodeMap.values())a.data.open.value&&r.push(a);return r},getDeepestOpenNode:()=>{let r=null,a=-1;for(const d of t.nodeMap.values())if(d.data.open.value){const s=d.getPath().length;s>a&&(a=s,r=d)}return r},applyToNodes:(r,a,d={})=>{const{relationship:s="self-and-children",applyToMatching:f=!0}=d,u=t.findNodeById(r);if(!u)return;const p=[],m=new Set,g=v=>{v&&!m.has(v.id)&&(p.push(v),m.add(v.id))},w=v=>{for(const E of v)g(E)};if(s==="ancestors-only")for(const v of u.getPath())v.id!==u.id&&g(v);else if(s==="siblings-only"){if(u.parent.value)for(const v of u.parent.value.children.value)v.id!==u.id&&g(v)}else if(s==="descendants-only")for(const v of t.traverse("dfs",u))v.id!==u.id&&g(v);else if(s==="children-only")w(u.children.value);else if(s==="self-and-ancestors")w(u.getPath());else if(s==="self-and-children")g(u),w(u.children.value);else if(s==="self-and-descendants")w(t.traverse("dfs",u));else if(s==="self-and-siblings")g(u),u.parent.value&&w(u.parent.value.children.value);else if(s==="self-ancestors-and-children")w(u.getPath()),w(u.children.value);else if(s==="full-branch")w(u.getPath()),w(t.traverse("dfs",u));else if(s==="all-except-branch"){const v=new Set;for(const E of u.getPath())v.add(E.id);for(const E of t.traverse("dfs",u))v.add(E.id);for(const E of t.nodeMap.values())!v.has(E.id)===f&&a(E);return}else{console.warn(`applyToNodes: Unknown relationship "${s}".`);return}if(f)for(const v of p)a(v);else for(const v of t.nodeMap.values())m.has(v.id)||a(v)}}}function Ge(e,t=null,n={},o=!1){const i=n.id??Qe(),c=h.shallowRef(t),r=h.shallowRef([]),a=h.computed(()=>r.value.length===0),d={id:i,data:e,parent:c,children:r,isRoot:o,isLeaf:a,addChild:s=>{r.value=[...r.value,s]},_removeChildInstance:s=>r.value.includes(s)?(r.value=r.value.filter(f=>f.id!==s.id),s.parent.value=null,!0):!1,findChild:s=>r.value.find(s)??null,findDescendant:s=>{const f=[d];for(;f.length>0;){const u=f.pop();if(s(u))return u;for(let p=u.children.value.length-1;p>=0;p--)f.push(u.children.value[p])}return null},isDescendantOf:s=>{let f=c.value;for(;f;){if(f.id===s.id)return!0;f=f.parent.value}return!1},getPath:()=>{const s=[];let f=d;for(;f;)s.push(f),f=f.parent.value;return s.reverse()}};return Object.freeze(d)}function Ft(e){const t=(e==null?void 0:e.deleteStrategy)??"recursive",n=h.shallowReactive(new Map);let o=null;const i=u=>n.get(u)??null,c=(u,p=null,m={})=>{if(!o){if(p!=null)return console.error(`Tree addNode: Cannot add a non-root node before a root exists. Received parentId=${p}.`),null;const v=Ge(u,null,m,!0);return n.set(v.id,v),o=v,v}const g=p?i(p):o;if(!g)return console.error(`Tree addNode: Parent node with ID ${p} not found.`),null;m.id&&n.has(m.id)&&(m.id=void 0);const w=Ge(u,g,m);return n.set(w.id,w),g.addChild(w),w},r=(u,p)=>{const m=p??t,g=i(u);if(!g)return!1;if(g.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const w=g.parent.value;if(m==="recursive")f(g);else{for(const v of g.children.value)v.parent.value=null;g.children.value=[],n.delete(g.id)}return w._removeChildInstance(g)},a=(u,p)=>{const m=i(u);if(!m)return console.error(`Tree moveNode: Node with ID ${u} not found.`),!1;if(m.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(u===p)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const g=p?i(p):o;if(!g)return console.error(`Tree moveNode: New parent node with ID ${p} not found.`),!1;if(g.isDescendantOf(m))return console.error("Tree moveNode: Cannot move a node to become its own descendant."),!1;const w=m.parent.value;if(w){if(!w._removeChildInstance(m))return console.error("Tree moveNode: Failed to remove node from its original parent."),!1}else if(m.isRoot){if(m.isRoot)return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."),!1}return g.addChild(m),m.parent.value=g,!0},d=(u="dfs",p=o)=>{const m=[];if(!p)return console.warn("Tree traverse: Start node is null, returning empty array."),m;if(u==="dfs"){const g=[p];for(;g.length>0;){const w=g.pop();m.push(w);for(let v=w.children.value.length-1;v>=0;v--)g.push(w.children.value[v])}}else{const g=[p];for(;g.length>0;){const w=g.shift();m.push(w);for(const v of w.children.value)g.push(v)}}return m},s=()=>{n.clear()},f=u=>{const p=[...u.children.value];for(const m of p)f(m);n.delete(u.id),u.children.value=[]};return Object.freeze({get root(){return o},get nodeMap(){return n},findNodeById:i,addNode:c,removeNode:r,moveNode:a,traverse:d,dispose:s})}function to(e){return h.getCurrentScope()?(h.onScopeDispose(e),!0):!1}const no=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const oo=Object.prototype.toString,io=e=>oo.call(e)==="[object Object]";function Je(e){return Array.isArray(e)?e:[e]}function ro(e,t,n){return h.watch(e,t,{...n,immediate:!0})}const so=no?window:void 0;function lo(e){var t;const n=h.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function G(...e){const t=[],n=()=>{t.forEach(a=>a()),t.length=0},o=(a,d,s,f)=>(a.addEventListener(d,s,f),()=>a.removeEventListener(d,s,f)),i=h.computed(()=>{const a=Je(h.toValue(e[0])).filter(d=>d!=null);return a.every(d=>typeof d!="string")?a:void 0}),c=ro(()=>{var a,d;return[(d=(a=i.value)==null?void 0:a.map(s=>lo(s)))!=null?d:[so].filter(s=>s!=null),Je(h.toValue(i.value?e[1]:e[0])),Je(h.unref(i.value?e[2]:e[1])),h.toValue(i.value?e[3]:e[2])]},([a,d,s,f])=>{if(n(),!(a!=null&&a.length)||!(d!=null&&d.length)||!(s!=null&&s.length))return;const u=io(f)?{...f}:f;t.push(...a.flatMap(p=>d.flatMap(m=>s.map(g=>o(p,m,g,u)))))},{flush:"post"}),r=()=>{c(),n()};return to(n),r}function ao(e,t={}){const{floatingContext:n,treeContext:o}=Ie(e),{open:i,setOpen:c,refs:r}=n,{enabled:a=!0,event:d="click",toggle:s=!0,ignoreMouse:f=!1,ignoreKeyboard:u=!1,ignoreTouch:p=!1,outsideClick:m=!1,outsideEvent:g="pointerdown",outsideCapture:w=!0,onOutsideClick:v,preventScrollbarClick:E=!0,handleDragEvents:x=!0}=t;let C,S=!1,L=!1,b=!1;const P=h.computed(()=>h.toValue(a)),M=h.computed(()=>h.toValue(m)),R=h.computed(()=>{const O=r.anchorEl.value;return O instanceof HTMLElement?O:null}),D=h.computed(()=>r.floatingEl.value);function k(O,$){b=!0;try{i.value?h.toValue(s)&&c(!1,O,$):c(!0,O,$)}finally{Promise.resolve().then(()=>{b=!1})}}function F(){C=void 0,S=!1,L=!1}function B(O){C=O.pointerType}function V(O){O.button===0&&h.toValue(d)!=="click"&&(_(C)||k("anchor-click",O))}function T(O){if(h.toValue(u)&&O.detail===0){F();return}if(h.toValue(d)==="mousedown"&&C){F();return}if(_(C)){F();return}k("anchor-click",O),F()}function l(O){if(C=void 0,O.defaultPrevented||h.toValue(u)||tt(O))return;const $=R.value;$&&(O.key===" "&&!nt($)&&(O.preventDefault(),S=!0),O.key==="Enter"&&k("keyboard-activate",O))}function H(O){const $=R.value;$&&(O.defaultPrevented||h.toValue(u)||tt(O)||nt($)||O.key===" "&&S&&(S=!1,k("keyboard-activate",O)))}function y(O){if(!P.value||!M.value||!i.value)return;if(h.toValue(g)==="click"&&h.toValue(x)&&L){L=!1;return}if(b)return;const $=O.target;if($&&!(h.toValue(E)&&He($)&&D.value&&qt(O,$))){if(o){if(!co(o,$))return}else if(ot(O,R.value)||ot(O,D.value))return;v?v(O,n):c(!1,"outside-pointer",O)}}function W(){L=!0}function oe(){setTimeout(()=>{L=!1},0)}function _(O){return!!(Ze(O,!0)&&h.toValue(f)||O==="touch"&&h.toValue(p))}h.watchPostEffect(()=>{const O=R.value;!P.value||!O||(O.addEventListener("pointerdown",B),O.addEventListener("mousedown",V),O.addEventListener("click",T),O.addEventListener("keydown",l),O.addEventListener("keyup",H),h.onWatcherCleanup(()=>{O.removeEventListener("pointerdown",B),O.removeEventListener("mousedown",V),O.removeEventListener("click",T),O.removeEventListener("keydown",l),O.removeEventListener("keyup",H),F()}))}),G(()=>P.value&&M.value?document:null,()=>h.toValue(g),y,{capture:h.toValue(w)}),G(()=>P.value&&M.value&&h.toValue(x)?D.value:null,"mousedown",W,{capture:!0}),G(()=>P.value&&M.value&&h.toValue(x)?D.value:null,"mouseup",oe,{capture:!0})}function co(e,t){return!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Be(e,t))}function uo(e,t={}){const{floatingContext:n,treeContext:o}=Ie(e),{enabled:i=!0,capture:c=!1,onEscape:r}=t,{isComposing:a}=ho();G(document,"keydown",s=>{if(!(s.key!=="Escape"||!h.toValue(i)||a())){if(r){r(s);return}if(o){const f=fo(o);f&&f.data.setOpen(!1,"escape-key",s)}else n.setOpen(!1,"escape-key",s)}},c)}function fo(e){var c;let t=e;for(;(c=t.parent)!=null&&c.value&&!t.isRoot;)t=t.parent.value;let n=null,o=-1;const i=r=>{var d;if(r.data.open.value){const s=r.getPath().length;s>o&&(o=s,n=r)}const a=((d=r.children)==null?void 0:d.value)??[];for(const s of a)i(s)};return i(t),n}function ho(){const e=h.ref(!1);return G(document,"compositionstart",()=>{e.value=!0}),G(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}const mo=0;function po(e,t={}){const{open:n,setOpen:o,refs:{floatingEl:i,anchorEl:c}}=e,{enabled:r=!0,requireFocusVisible:a=!0,tree:d}=t,s=h.computed(()=>c.value?c.value instanceof HTMLElement?c.value:c.value.contextElement:null);let f=!1,u=!0;const p=zt()&&Ut();let m,g=new go(i);if(d){let x=null;if(e.id&&(x=d.findNodeById(e.id)),!x){for(const C of d.nodeMap.values())if(C.data===e){x=C;break}}x&&(g=new vo(x))}G(window,"blur",()=>{!n.value&&s.value&&s.value===document.activeElement&&(f=!0)}),G(window,"focus",()=>{f=!1}),h.onMounted(()=>{p&&(G(window,"keydown",()=>{u=!0},{capture:!0}),G(window,"pointerdown",()=>{u=!1},{capture:!0}))});function w(x){if(f){f=!1;return}const C=x.target instanceof Element?x.target:null;if(h.toValue(a)&&C){if(p&&!x.relatedTarget){if(!u&&!et(C))return}else if(!Kt(C))return}try{o(!0,"focus",x)}catch(S){console.error("[useFocus] Error in onFocus handler:",S)}}function v(x){clearTimeout(m),m=window.setTimeout(()=>{var L;const S=(((L=s.value)==null?void 0:L.ownerDocument)??document).activeElement;if(!(!x.relatedTarget&&S===s.value)&&!g.shouldRemainOpen(S))try{if(S instanceof Element){const b=g.getAncestorsToClose(S);for(const P of b)try{P.data.setOpen(!1,"tree-ancestor-close",x)}catch(M){console.error("[useFocus] Error closing ancestor on blur:",M)}}o(!1,"blur",x)}catch(b){console.error("[useFocus] Error in onBlur handler:",b)}},mo)}G(document,"focusin",x=>{if(!h.toValue(r))return;const C=x.target;if(!(C instanceof Element))return;const S=s.value;if(!(S&&z(C,S))&&!g.shouldRemainOpen(C))try{const L=g.getAncestorsToClose(C);for(const b of L)try{b.data.setOpen(!1,"tree-ancestor-close",x)}catch(P){console.error("[useFocus] Error closing ancestor on focusin:",P)}o(!1,"blur",x)}catch(L){console.error("[useFocus] Error in document focusin handler:",L)}},{capture:!0});const E=h.watchPostEffect(()=>{if(!h.toValue(r))return;const x=s.value;!x||!(x instanceof HTMLElement)||(x.addEventListener("focus",w),x.addEventListener("blur",v),h.onWatcherCleanup(()=>{x.removeEventListener("focus",w),x.removeEventListener("blur",v)}))});return h.onScopeDispose(()=>{clearTimeout(m)}),{cleanup:()=>{clearTimeout(m),E()}}}class go{constructor(t){this.floatingEl=t}shouldRemainOpen(t){return!t||!this.floatingEl.value?!1:this.floatingEl.value.contains(t)}getAncestorsToClose(t){return[]}}class vo{constructor(t){this.treeContext=t}shouldRemainOpen(t){return t?this.isFocusWithinNodeHierarchy(this.treeContext,t):!1}getAncestorsToClose(t){const n=[];let o=this.treeContext.parent.value;for(;o;){if(!this.isFocusWithinNodeHierarchy(o,t)){n.push(o),o=o.parent.value;continue}break}return n}isFocusWithinNodeHierarchy(t,n){return z(n,t.data.refs.anchorEl.value)||z(n,t.data.refs.floatingEl.value)?!0:this.findDescendantContainingFocus(t,n)!==null}findDescendantContainingFocus(t,n){for(const o of t.children.value)if(o.data.open.value){if(z(n,o.data.refs.anchorEl.value)||z(n,o.data.refs.floatingEl.value))return o;const i=this.findDescendantContainingFocus(o,n);if(i)return i}return null}}function Vt(e){return e.children.value.some(t=>t.data.open.value||Vt(t))}function wo(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Ht(e,t){const[n,o]=e;let i=!1;const c=t.length;for(let r=0,a=c-1;r<c;a=r++){const[d,s]=t[r]||[0,0],[f,u]=t[a]||[0,0];s>=o!=u>=o&&n<=(f-d)*(o-s)/(u-s)+d&&(i=!i)}return i}function yo(e={}){const{blockPointerEvents:t=!1,requireIntent:n=!0}=e;let o=-1,i=!1;function c(a,d,s,f,u){const p=it(),m=p-u;if(s===null||f===null||m===0)return{speed:null,lastX:a,lastY:d,lastCursorTime:p};const g=a-s,w=d-f;return{speed:Math.sqrt(g*g+w*w)/m,lastX:a,lastY:d,lastCursorTime:p}}const r=function(d){const{x:s,y:f,placement:u,elements:p,buffer:m,onClose:g,nodeId:w,tree:v}=d,E=h.computed(()=>{const L=p.domReference;return He(L)?L:(L==null?void 0:L.contextElement)??null});let x=null,C=null,S=it();return function(b){var Ve,It,Bt,$t,_t,Xt,Yt;function P(){rt(o),o=-1,g()}if(rt(o),o=-1,!p.domReference||!p.floating||u==null||s==null||f==null)return;const{clientX:M,clientY:R}=b,D=[M,R],k=Gt(b),F=b.type==="mouseleave",B=p.floating&&We(p.floating,k),V=E.value&&We(E.value,k),T=(Ve=E.value)==null?void 0:Ve.getBoundingClientRect(),l=(It=p.floating)==null?void 0:It.getBoundingClientRect(),H=u.split("-")[0],y=s>((l==null?void 0:l.right)??0)-((l==null?void 0:l.width)??0)/2,W=f>((l==null?void 0:l.bottom)??0)-((l==null?void 0:l.height)??0)/2,oe=T?wo(D,T):!1,_=((l==null?void 0:l.width)??0)>((T==null?void 0:T.width)??0),O=((l==null?void 0:l.height)??0)>((T==null?void 0:T.height)??0),$=((Bt=_?T:l)==null?void 0:Bt.left)??0,ue=(($t=_?T:l)==null?void 0:$t.right)??0,J=((_t=O?T:l)==null?void 0:_t.top)??0,fe=((Xt=O?T:l)==null?void 0:Xt.bottom)??0;if(B&&(i=!0,!F))return;if(V&&(i=!1),V&&!F){i=!0;return}if(F&&He(b.relatedTarget)&&p.floating&&We(p.floating,b.relatedTarget))return;if(v&&w){const I=v.nodes.get(w);if(I&&Vt(I))return}if(H==="top"&&f>=((T==null?void 0:T.bottom)??0)-1||H==="bottom"&&f<=((T==null?void 0:T.top)??0)+1||H==="left"&&s>=((T==null?void 0:T.right)??0)-1||H==="right"&&s<=((T==null?void 0:T.left)??0)+1)return P();let le=[];switch(H){case"top":le=[[$,((T==null?void 0:T.top)??0)+1],[$,((l==null?void 0:l.bottom)??0)-1],[ue,((l==null?void 0:l.bottom)??0)-1],[ue,((T==null?void 0:T.top)??0)+1]];break;case"bottom":le=[[$,((l==null?void 0:l.top)??0)+1],[$,((T==null?void 0:T.bottom)??0)-1],[ue,((T==null?void 0:T.bottom)??0)-1],[ue,((l==null?void 0:l.top)??0)+1]];break;case"left":le=[[((l==null?void 0:l.right)??0)-1,fe],[((l==null?void 0:l.right)??0)-1,J],[((T==null?void 0:T.left)??0)+1,J],[((T==null?void 0:T.left)??0)+1,fe]];break;case"right":le=[[((T==null?void 0:T.right)??0)-1,fe],[((T==null?void 0:T.right)??0)-1,J],[((l==null?void 0:l.left)??0)+1,J],[((l==null?void 0:l.left)??0)+1,fe]];break}function Fe([I,X]){const A=m;switch(H){case"top":{const de=[_?I+A/2:y?I+A*4:I-A*4,X+A+1],he=[_?I-A/2:y?I+A*4:I-A*4,X+A+1],be=[[(l==null?void 0:l.left)??0,y||_?((l==null?void 0:l.bottom)??0)-A:(l==null?void 0:l.top)??0],[(l==null?void 0:l.right)??0,y?_?((l==null?void 0:l.bottom)??0)-A:(l==null?void 0:l.top)??0:((l==null?void 0:l.bottom)??0)-A]];return[de,he,...be]}case"bottom":{const de=[_?I+A/2:y?I+A*4:I-A*4,X-A],he=[_?I-A/2:y?I+A*4:I-A*4,X-A],be=[[(l==null?void 0:l.left)??0,y||_?((l==null?void 0:l.top)??0)+A:(l==null?void 0:l.bottom)??0],[(l==null?void 0:l.right)??0,y?_?((l==null?void 0:l.top)??0)+A:(l==null?void 0:l.bottom)??0:((l==null?void 0:l.top)??0)+A]];return[de,he,...be]}case"left":{const de=[I+A+1,O?X+A/2:W?X+A*4:X-A*4],he=[I+A+1,O?X-A/2:W?X+A*4:X-A*4];return[...[[W||O?((l==null?void 0:l.right)??0)-A:(l==null?void 0:l.left)??0,(l==null?void 0:l.top)??0],[W?O?((l==null?void 0:l.right)??0)-A:(l==null?void 0:l.left)??0:((l==null?void 0:l.right)??0)-A,(l==null?void 0:l.bottom)??0]],de,he]}case"right":{const de=[I-A,O?X+A/2:W?X+A*4:X-A*4],he=[I-A,O?X-A/2:W?X+A*4:X-A*4],be=[[W||O?((l==null?void 0:l.left)??0)+A:(l==null?void 0:l.right)??0,(l==null?void 0:l.top)??0],[W?O?((l==null?void 0:l.left)??0)+A:(l==null?void 0:l.right)??0:((l==null?void 0:l.left)??0)+A,(l==null?void 0:l.bottom)??0]];return[de,he,...be]}}}const ye=Fe([s,f]);if((Yt=e.onPolygonChange)==null||Yt.call(e,ye),!Ht(D,le)){if(Ht(D,ye)){if(!i&&n){const I=c(b.clientX,b.clientY,x,C,S);x=I.lastX,C=I.lastY,S=I.lastCursorTime,I.speed!==null&&I.speed<.1&&(o=window.setTimeout(P,40))}return}if(i&&!oe)return P();P()}}};return r.__options={blockPointerEvents:t},r}const Wt=10;function bo(e,t,n){const{delay:o}=n,i=h.computed(()=>{const s=h.toValue(o);return(typeof s=="number"?s:s.open)??0}),c=h.computed(()=>{const s=h.toValue(o);return(typeof s=="number"?s:s.close)??0});let r,a;const d=()=>{clearTimeout(r),clearTimeout(a)};return h.onScopeDispose(d),{show:(s,f)=>{d();const u=s??i.value;u===0?e(f):r=setTimeout(()=>e(f),u)},hide:(s,f)=>{d();const u=s??c.value;u===0?t(f):a=setTimeout(()=>t(f),u)},showDelay:i,hideDelay:c,clearTimeouts:d}}function xo(e,t={}){const{floatingContext:n,treeContext:o}=Ie(e),{open:i,setOpen:c,refs:{anchorEl:r,floatingEl:a}}=n,{enabled:d=!0,delay:s=0,restMs:f=0,mouseOnly:u=!1,safePolygon:p=!1}=t,m=h.computed(()=>h.toValue(d)),g=h.computed(()=>h.toValue(f)),w=h.computed(()=>{const y=r.value;return!y||y instanceof HTMLElement?y:y.contextElement??null}),{hide:v,show:E,showDelay:x,clearTimeouts:C}=bo(y=>{i.value||c(!0,"hover",y)},y=>{i.value&&c(!1,"hover",y)},{delay:s});let S=null,L;const b=h.computed(()=>x.value===0&&g.value>0);function P(y){if(!m.value||!D(y)||!b.value||!S)return;const W={x:y.clientX,y:y.clientY},oe=Math.abs(W.x-S.x),_=Math.abs(W.y-S.y);(oe>Wt||_>Wt)&&(S=W,clearTimeout(L),L=setTimeout(()=>{E(0,y)},g.value))}function M(y){!m.value||!D(y)||!b.value||(S={x:y.clientX,y:y.clientY},L=setTimeout(()=>{E(0,y)},g.value))}function R(){clearTimeout(L),S=null}h.watchPostEffect(()=>{const y=w.value;!y||!m.value||!b.value||(y.addEventListener("pointerenter",M),y.addEventListener("pointermove",P),y.addEventListener("pointerleave",R),h.onWatcherCleanup(()=>{y.removeEventListener("pointerenter",M),y.removeEventListener("pointermove",P),y.removeEventListener("pointerleave",R)}))}),h.onScopeDispose(()=>{clearTimeout(L)});function D(y){return h.toValue(u)?y.pointerType==="mouse":!0}function k(y){!m.value||!D(y)||b.value||(V(),E(void 0,y))}function F(y){!m.value||!D(y)||(C(),V())}let B=null;function V(){B&&(document.removeEventListener("pointermove",B),B=null);const y=l.value;y!=null&&y.onPolygonChange&&y.onPolygonChange([])}const T=h.computed(()=>!!h.toValue(p)),l=h.computed(()=>{const y=h.toValue(p);if(typeof y=="object"&&y)return y;if(y===!0)return{}});function H(y){var O;if(!m.value||!D(y))return;const{clientX:W,clientY:oe}=y,_=y.relatedTarget;if(T.value)setTimeout(()=>{var le;V();const $=w.value,ue=a.value;if(!$||!ue){v(void 0,y);return}let J,fe;if(o){J=new Map;const Fe=ye=>{J==null||J.set(ye.id,ye);for(const Ve of ye.children.value)Fe(Ve)};Fe(o),fe=o.id}B=yo(l.value)({x:W,y:oe,placement:n.placement.value,elements:{domReference:$,floating:ue},buffer:((le=l.value)==null?void 0:le.buffer)??1,onClose:()=>{V(),v(void 0)},nodeId:fe,tree:J?{nodes:J}:void 0}),B&&document.addEventListener("pointermove",B)},0);else{if(o){if(!Eo(o,_))return}else if((O=a.value)!=null&&O.contains(_))return;v(void 0,y)}}h.watchPostEffect(()=>{const y=w.value;!y||!m.value||(y.addEventListener("pointerenter",k),y.addEventListener("pointerleave",H),h.onWatcherCleanup(()=>{y.removeEventListener("pointerenter",k),y.removeEventListener("pointerleave",H)}))}),h.watchPostEffect(()=>{const y=a.value;!y||!m.value||(y.addEventListener("pointerenter",F),y.addEventListener("pointerleave",H),h.onWatcherCleanup(()=>{y.removeEventListener("pointerenter",F),y.removeEventListener("pointerleave",H)}))}),h.onScopeDispose(()=>{V()})}function Eo(e,t){return t?!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Be(e,t)):!0}N.FollowTracker=st,N.StaticTracker=lt,N.TrackingStrategy=$e,N.VirtualElementFactory=Oe,N.arrow=Rt,N.autoPlacement=Un,N.createTree=Ft,N.createTreeNode=Ge,N.flip=qn,N.hide=Jn,N.offset=zn,N.shift=Kn,N.size=Gn,N.useArrow=me,N.useClick=ao,N.useClientPoint=Qt,N.useEscapeKey=uo,N.useFloating=Mt,N.useFloatingTree=eo,N.useFocus=po,N.useHover=xo,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,76 +1,73 @@
1
- {
2
- "name": "v-float",
3
- "version": "0.7.1",
4
- "description": "Vue 3 port of Floating UI - a library for positioning floating elements",
5
- "private": false,
6
- "type": "module",
7
- "files": [
8
- "dist"
9
- ],
10
- "types": "./dist/src/index.d.ts",
11
- "main": "./dist/v-float.umd.js",
12
- "module": "./dist/v-float.es.js",
13
- "exports": {
14
- ".": {
15
- "types": "./dist/index.d.ts",
16
- "import": "./dist/v-float.es.js",
17
- "require": "./dist/v-float.umd.js"
18
- }
19
- },
20
- "dependencies": {
21
- "@floating-ui/dom": "^1.7.4",
22
- "@vueuse/core": "^13.7.0",
23
- "vue": "^3.5.22"
24
- },
25
- "devDependencies": {
26
- "@21st-extension/toolbar-vue": "^0.5.14",
27
- "@21st-extension/vue": "^0.5.14",
28
- "@biomejs/biome": "2.2.2",
29
- "@release-it/conventional-changelog": "^10.0.1",
30
- "@testing-library/vue": "^8.1.0",
31
- "@tsconfig/node22": "^22.0.2",
32
- "@types/jsdom": "^21.1.7",
33
- "@types/node": "^22.18.0",
34
- "@unocss/reset": "66.1.0-beta.7",
35
- "@vitejs/plugin-vue": "^5.2.4",
36
- "@vitest/browser": "^3.2.4",
37
- "@vitest/coverage-v8": "^3.2.4",
38
- "@vitest/ui": "3.0.8",
39
- "@vue/test-utils": "^2.4.6",
40
- "@vue/tsconfig": "^0.7.0",
41
- "jsdom": "^26.1.0",
42
- "lucide-vue-next": "^0.513.0",
43
- "npm-run-all2": "^7.0.2",
44
- "playwright": "^1.55.0",
45
- "prettier": "^3.6.2",
46
- "release-it": "^19.0.4",
47
- "release-it-pnpm": "^4.6.6",
48
- "typescript": "~5.7.3",
49
- "unocss": "66.1.0-beta.7",
50
- "vite": "^6.3.5",
51
- "vite-plugin-dts": "^4.5.4",
52
- "vite-plugin-vue-devtools": "^7.7.7",
53
- "vitepress": "^1.6.4",
54
- "vitepress-plugin-demo": "^0.8.1",
55
- "vitest": "^3.2.4",
56
- "vitest-browser-vue": "^0.2.0",
57
- "vue-tsc": "^2.2.12"
58
- },
59
- "scripts": {
60
- "dev": "vite",
61
- "build": "run-p type-check \"build-only {@}\" --",
62
- "preview": "vite preview",
63
- "build-only": "vite build",
64
- "type-check": "vue-tsc --build tsconfig.build.json",
65
- "lint": "biome check --write",
66
- "test": "vitest",
67
- "docs:dev": "vitepress dev docs",
68
- "docs:build": "vitepress build docs",
69
- "docs:preview": "vitepress preview docs",
70
- "release": "release-it",
71
- "release:patch": "release-it patch",
72
- "release:minor": "release-it minor",
73
- "release:major": "release-it major",
74
- "release:dry": "release-it --dry-run"
75
- }
76
- }
1
+ {
2
+ "name": "v-float",
3
+ "version": "0.8.0",
4
+ "description": "Vue 3 port of Floating UI - a library for positioning floating elements",
5
+ "private": false,
6
+ "type": "module",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "types": "./dist/src/index.d.ts",
11
+ "main": "./dist/v-float.umd.js",
12
+ "module": "./dist/v-float.es.js",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/v-float.es.js",
17
+ "require": "./dist/v-float.umd.js"
18
+ }
19
+ },
20
+ "scripts": {
21
+ "dev": "vite",
22
+ "build": "run-p type-check \"build-only {@}\" --",
23
+ "preview": "vite preview",
24
+ "build-only": "vite build",
25
+ "type-check": "vue-tsc --build tsconfig.build.json",
26
+ "lint": "biome check --write",
27
+ "test": "vitest run",
28
+ "docs:dev": "vitepress dev docs",
29
+ "docs:build": "vitepress build docs",
30
+ "docs:preview": "vitepress preview docs",
31
+ "release": "release-it",
32
+ "release:patch": "release-it patch",
33
+ "release:minor": "release-it minor",
34
+ "release:major": "release-it major",
35
+ "release:dry": "release-it --dry-run",
36
+ "changelog": "changelogen",
37
+ "changelog:preview": "changelogen --no-output"
38
+ },
39
+ "dependencies": {
40
+ "@floating-ui/dom": "^1.7.4",
41
+ "@vueuse/core": "^13.7.0",
42
+ "vue": "^3.5.22"
43
+ },
44
+ "devDependencies": {
45
+ "@biomejs/biome": "2.2.2",
46
+ "@tsconfig/node22": "^22.0.2",
47
+ "@types/jsdom": "^21.1.7",
48
+ "@types/node": "^22.18.0",
49
+ "@unocss/reset": "66.1.0-beta.7",
50
+ "@vitejs/plugin-vue": "^5.2.4",
51
+ "@vitest/browser": "^3.2.4",
52
+ "@vitest/coverage-v8": "^3.2.4",
53
+ "@vue/tsconfig": "^0.7.0",
54
+ "jsdom": "^26.1.0",
55
+ "lucide-vue-next": "^0.513.0",
56
+ "npm-run-all2": "^7.0.2",
57
+ "playwright": "^1.55.0",
58
+ "prettier": "^3.6.2",
59
+ "release-it": "^19.0.4",
60
+ "typescript": "~5.7.3",
61
+ "unocss": "66.1.0-beta.7",
62
+ "vite": "^6.3.5",
63
+ "vite-plugin-dts": "^4.5.4",
64
+ "vite-plugin-vue-devtools": "^7.7.7",
65
+ "vitepress": "^1.6.4",
66
+ "changelogen": "^0.6.2",
67
+ "vitepress-plugin-demo": "^0.8.1",
68
+ "vitest": "^3.2.4",
69
+ "vitest-browser-vue": "^0.2.0",
70
+ "vue-tsc": "^2.2.12"
71
+ },
72
+ "packageManager": "npm@10.9.2"
73
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-client-point.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-client-point.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAEL,KAAK,gBAAgB,EAErB,KAAK,GAAG,EAMT,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAOpD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAChB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAA;AAE/C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE9C;;GAEG;AACH,UAAU,gBAAgB;IACxB,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,cAAc,CAAA;IACpD,WAAW,EAAE,WAAW,CAAA;IACxB,aAAa,EAAE,YAAY,CAAA;CAC5B;AAED;;GAEG;AACH,UAAU,eAAe;IACvB,MAAM,EAAE,OAAO,CAAA;CAChB;AAMD,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEnC;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAA;IAEvC;;;OAGG;IACH,CAAC,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAEnC;;;OAGG;IACH,CAAC,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAEnC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC;QAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC,CAAA;IAClE;;OAEG;IACH,cAAc,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/C;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAA;IAC5B,IAAI,EAAE;QACJ,QAAQ,EAAE,GAAG,CAAC,aAAa,CAAC,CAAA;KAC7B,CAAA;CACF;AAMD;;;GAGG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAA6B;IAEvE;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE;QACd,WAAW,EAAE,WAAW,CAAA;QACxB,gBAAgB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;QACrC,mBAAmB,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;QACxC,IAAI,CAAC,EAAE,cAAc,CAAA;KACtB,GAAG,cAAc;IASlB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAmB1B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAiBxB;;OAEG;IACH,OAAO,CAAC,eAAe;IAwBvB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAsB7B;;OAEG;IACH,OAAO,CAAC,aAAa;IA+BrB;;OAEG;IACH,OAAO,CAAC,YAAY;CAiBrB;AAMD;;GAEG;AACH,8BAAsB,gBAAgB;IACpC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAGpC,SAAS,CAAC,oBAAoB,EAAE,WAAW,GAAG,IAAI,CAAO;IAEzD;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,GAAG,WAAW,GAAG,IAAI;IAEvF;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE;IAExD;;;OAGG;IACH,wBAAwB,IAAI,WAAW,GAAG,IAAI;IAM9C;;;OAGG;IACH,OAAO,IAAI,IAAI;IAKf;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,QAAQ,CAAC,IAAI,EAAG,QAAQ,CAAS;IAEjC;;OAEG;IACH,iBAAiB,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE;IAI/C;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,GAAG,WAAW,GAAG,IAAI;CA4B/E;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,QAAQ,CAAC,IAAI,EAAG,QAAQ,CAAS;IAIjC,OAAO,CAAC,kBAAkB,CAA2B;IAErD;;;OAGG;IACH,iBAAiB,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE;IAI/C;;;OAGG;IACH,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,eAAe,GAAG,WAAW,GAAG,IAAI;IAW9E;;OAEG;IACH,wBAAwB,IAAI,WAAW,GAAG,IAAI;IAS9C;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb,OAAO,IAAI,IAAI;CAKhB;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAC5B,aAAa,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,EACtC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,CAmLtB"}
@@ -1,23 +0,0 @@
1
- /**
2
- * @fileoverview Browser environment detection utilities
3
- *
4
- * Provides utilities for detecting browser types, platforms, and
5
- * environment-specific polyfills for focus-visible behavior.
6
- */
7
- /**
8
- * Checks if the user agent is on a Mac.
9
- * @returns True if running on macOS
10
- */
11
- export declare function isMac(): boolean;
12
- /**
13
- * Checks if the browser is Safari.
14
- * @returns True if the browser is Safari
15
- */
16
- export declare function isSafari(): boolean;
17
- /**
18
- * A simple utility to check if an element matches `:focus-visible`.
19
- * @param element - The element to check
20
- * @returns True if the element matches :focus-visible
21
- */
22
- export declare function matchesFocusVisible(element: Element): boolean;
23
- //# sourceMappingURL=browser-detection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser-detection.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/browser-detection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAG/B;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAGlC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG7D"}
@@ -1,53 +0,0 @@
1
- import { VirtualElement } from '@floating-ui/dom';
2
- /**
3
- * Checks if the pointer type is mouse-like (mouse or pen).
4
- * @param pointerType - The pointer type string.
5
- * @param strict - If true, only considers "mouse".
6
- * @returns True if the pointer type is mouse-like.
7
- */
8
- export declare function isMouseLikePointerType(pointerType: string | undefined, strict?: boolean): boolean;
9
- /**
10
- * Checks if the element is an input, textarea, or contenteditable element.
11
- * @param element - The element to check.
12
- * @returns True if the element is typeable.
13
- */
14
- export declare function isTypeableElement(element: Element | null): boolean;
15
- /**
16
- * Checks if the event target is a button-like element.
17
- * @param event - The KeyboardEvent.
18
- * @returns True if the target is a button.
19
- */
20
- export declare function isButtonTarget(event: KeyboardEvent): boolean;
21
- /**
22
- * Checks if the Space key press should be ignored for the given element.
23
- * @param element - The element to check.
24
- * @returns True if Space should be ignored.
25
- */
26
- export declare function isSpaceIgnored(element: Element | null): boolean;
27
- /**
28
- * Checks if the value is an HTML element.
29
- * @param node - The value to check.
30
- * @returns True if the value is an HTML element.
31
- */
32
- export declare function isHTMLElement(node: unknown | null): node is HTMLElement;
33
- /**
34
- * Checks if the value is a VirtualElement.
35
- * @param el - The value to check.
36
- * @returns True if the value is a VirtualElement.
37
- */
38
- export declare function isVirtualElement(el: unknown): el is VirtualElement;
39
- /**
40
- * Checks if the event target is within the given element.
41
- * @param event - The event to check.
42
- * @param element - The element to check containment against.
43
- * @returns True if the event target is within the element.
44
- */
45
- export declare function isEventTargetWithin(event: Event, element: Element | null | undefined): boolean;
46
- /**
47
- * Checks if a click event occurred on a scrollbar.
48
- * @param event - The mouse event.
49
- * @param target - The target HTML element.
50
- * @returns True if the click was on a scrollbar.
51
- */
52
- export declare function isClickOnScrollbar(event: MouseEvent, target: HTMLElement): boolean;
53
- //# sourceMappingURL=element-detection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"element-detection.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/element-detection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAIjG;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAQlE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAS5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,WAAW,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,cAAc,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAQ9F;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CA0BlF"}
@@ -1,30 +0,0 @@
1
- /**
2
- * @fileoverview Event handling and timing utilities
3
- *
4
- * Provides utilities for event handling, timing operations,
5
- * and DOM element containment checks.
6
- */
7
- /**
8
- * Simple element containment wrapper.
9
- * @param el - The container element
10
- * @param target - The target element to check
11
- * @returns True if the container contains the target
12
- */
13
- export declare function contains(el: HTMLElement, target: Element | null): boolean;
14
- /**
15
- * Event target extraction utility.
16
- * @param event - The mouse or touch event
17
- * @returns The event target as an Element or null
18
- */
19
- export declare function getTarget(event: MouseEvent | TouchEvent): Element | null;
20
- /**
21
- * Safe performance timing that handles environments without performance API.
22
- * @returns Current timestamp in milliseconds
23
- */
24
- export declare function getCurrentTime(): number;
25
- /**
26
- * Centralized timeout management to prevent memory leaks.
27
- * @param timeoutId - The timeout ID to clear
28
- */
29
- export declare function clearTimeoutIfSet(timeoutId: number): void;
30
- //# sourceMappingURL=event-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-utils.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/event-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAEzE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,IAAI,CAExE;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAIzD"}
@@ -1,11 +0,0 @@
1
- /**
2
- * @fileoverview Centralized utility functions for interaction composables
3
- *
4
- * This module exports shared helper functions to eliminate code duplication
5
- * across use-click, use-focus, use-hover, use-client-point, and polygon composables.
6
- */
7
- export { isMac, isSafari, matchesFocusVisible, } from './browser-detection';
8
- export { isButtonTarget, isClickOnScrollbar, isEventTargetWithin, isHTMLElement, isMouseLikePointerType, isSpaceIgnored, isTypeableElement, isVirtualElement, } from './element-detection';
9
- export { clearTimeoutIfSet, contains, getCurrentTime, getTarget, } from './event-utils';
10
- export { findDescendantContainingTarget, getContextFromParameter, isTargetWithinElement, isTreeNode, } from './tree-context';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,KAAK,EACL,QAAQ,EACR,mBAAmB,GACpB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,EACvB,qBAAqB,EACrB,UAAU,GACX,MAAM,gBAAgB,CAAA"}
@@ -1,32 +0,0 @@
1
- import { FloatingContext } from '../..';
2
- import { TreeNode } from '../../use-floating-tree';
3
- /**
4
- * Type guard to determine if the context parameter is a TreeNode.
5
- * @param context - The context parameter to check
6
- * @returns True if the context is a TreeNode
7
- */
8
- export declare function isTreeNode(context: FloatingContext | TreeNode<FloatingContext>): context is TreeNode<FloatingContext>;
9
- /**
10
- * Extracts floating context and tree context from the parameter.
11
- * @param context - Either a FloatingContext or TreeNode<FloatingContext>
12
- * @returns Object containing both floating context and optional tree context
13
- */
14
- export declare function getContextFromParameter(context: FloatingContext | TreeNode<FloatingContext>): {
15
- floatingContext: FloatingContext;
16
- treeContext: TreeNode<FloatingContext> | null;
17
- };
18
- /**
19
- * Checks if a target node is within an anchor or floating element, handling VirtualElement.
20
- * @param target - The target node to check
21
- * @param element - The element to check containment against (can be VirtualElement or null)
22
- * @returns True if the target is within the element
23
- */
24
- export declare function isTargetWithinElement(target: Node, element: unknown): boolean;
25
- /**
26
- * Finds a descendant node that contains the target element.
27
- * @param node - The parent node to search from
28
- * @param target - The target element to find
29
- * @returns The descendant node containing the target, or null
30
- */
31
- export declare function findDescendantContainingTarget(node: TreeNode<FloatingContext>, target: Node): TreeNode<FloatingContext> | null;
32
- //# sourceMappingURL=tree-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree-context.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/tree-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAE/D;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,GACnD,OAAO,IAAI,QAAQ,CAAC,eAAe,CAAC,CAStC;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,GAAG;IAC7F,eAAe,EAAE,eAAe,CAAA;IAChC,WAAW,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,IAAI,CAAA;CAC9C,CAWA;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAkB7E;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,QAAQ,CAAC,eAAe,CAAC,EAC/B,MAAM,EAAE,IAAI,GACX,QAAQ,CAAC,eAAe,CAAC,GAAG,IAAI,CAgBlC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-arrow.d.ts","sourceRoot":"","sources":["../../src/composables/use-arrow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMrD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAE3B;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAE3B;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,EAChC,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,eAAoB,GAC5B,cAAc,CAyDhB"}