v-float 0.10.0 → 0.11.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.
- package/README.md +44 -175
- package/dist/index.d.mts +688 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2038 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +74 -75
- package/dist/composables/index.d.ts +0 -4
- package/dist/composables/index.d.ts.map +0 -1
- package/dist/composables/interactions/index.d.ts +0 -7
- package/dist/composables/interactions/index.d.ts.map +0 -1
- package/dist/composables/interactions/polygon.d.ts +0 -38
- package/dist/composables/interactions/polygon.d.ts.map +0 -1
- package/dist/composables/interactions/use-click.d.ts +0 -120
- package/dist/composables/interactions/use-click.d.ts.map +0 -1
- package/dist/composables/interactions/use-escape-key.d.ts +0 -57
- package/dist/composables/interactions/use-escape-key.d.ts.map +0 -1
- package/dist/composables/interactions/use-focus-trap.d.ts +0 -78
- package/dist/composables/interactions/use-focus-trap.d.ts.map +0 -1
- package/dist/composables/interactions/use-focus.d.ts +0 -60
- package/dist/composables/interactions/use-focus.d.ts.map +0 -1
- package/dist/composables/interactions/use-hover.d.ts +0 -78
- package/dist/composables/interactions/use-hover.d.ts.map +0 -1
- package/dist/composables/interactions/use-list-navigation.d.ts +0 -144
- package/dist/composables/interactions/use-list-navigation.d.ts.map +0 -1
- package/dist/composables/middlewares/arrow.d.ts +0 -25
- package/dist/composables/middlewares/arrow.d.ts.map +0 -1
- package/dist/composables/middlewares/index.d.ts +0 -4
- package/dist/composables/middlewares/index.d.ts.map +0 -1
- package/dist/composables/positioning/index.d.ts +0 -5
- package/dist/composables/positioning/index.d.ts.map +0 -1
- package/dist/composables/positioning/use-arrow.d.ts +0 -55
- package/dist/composables/positioning/use-arrow.d.ts.map +0 -1
- package/dist/composables/positioning/use-client-point.d.ts +0 -218
- package/dist/composables/positioning/use-client-point.d.ts.map +0 -1
- package/dist/composables/positioning/use-floating-tree.d.ts +0 -240
- package/dist/composables/positioning/use-floating-tree.d.ts.map +0 -1
- package/dist/composables/positioning/use-floating.d.ts +0 -162
- package/dist/composables/positioning/use-floating.d.ts.map +0 -1
- package/dist/composables/utils/is-using-keyboard.d.ts +0 -2
- package/dist/composables/utils/is-using-keyboard.d.ts.map +0 -1
- package/dist/composables/utils/use-active-descendant.d.ts +0 -8
- package/dist/composables/utils/use-active-descendant.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -18
- package/dist/types.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -92
- package/dist/utils.d.ts.map +0 -1
- package/dist/v-float.es.js +0 -3827
- package/dist/v-float.umd.js +0 -8
package/dist/v-float.umd.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
(function(j,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(j=typeof globalThis<"u"?globalThis:j||self,f(j.VFloat={},j.Vue))})(this,(function(j,f){"use strict";var Br=Object.defineProperty;var Hr=(j,f,Ce)=>f in j?Br(j,f,{enumerable:!0,configurable:!0,writable:!0,value:Ce}):j[f]=Ce;var Ne=(j,f,Ce)=>Hr(j,typeof f!="symbol"?f+"":f,Ce);function Ce(t,e,n={}){const{offset:o="-4px"}=n,{middlewareData:r,placement:l,refs:i}=e;f.watch(t,h=>{i.arrowEl.value=h});const s=f.computed(()=>{var h;return((h=r.value.arrow)==null?void 0:h.x)??0}),d=f.computed(()=>{var h;return((h=r.value.arrow)==null?void 0:h.y)??0}),a=f.computed(()=>{if(!(t.value||i.arrowEl.value)||!r.value.arrow)return{};const u=f.toValue(l).split("-")[0],v=s.value,p=d.value;return u==="bottom"?{"inset-inline-start":`${v}px`,"inset-block-start":o}:u==="top"?{"inset-inline-start":`${v}px`,"inset-block-end":o}:u==="right"?{"inset-block-start":`${p}px`,"inset-inline-start":o}:u==="left"?{"inset-block-start":`${p}px`,"inset-inline-end":o}:{}});return{arrowX:s,arrowY:d,arrowStyles:a}}let An=0;function Ot(){return f.useId()||`id-${++An}`}function rt(t){return t instanceof Element&&t instanceof HTMLElement}function Pn(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function Dn(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Nn(t){return typeof(t==null?void 0:t.matches)!="function"?!1:t.matches(":focus-visible")}function At(t,e){if(t===void 0)return!1;const n=t==="mouse";return e?n:n||t==="pen"}function it(t){return!t||!(t instanceof HTMLElement)?!1:t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t.isContentEditable&&t.contentEditable!=="false"}function Pt(t){const e=t.target;return e instanceof HTMLElement?e.tagName==="BUTTON"||e.tagName==="INPUT"&&e.getAttribute("type")==="button"||e.getAttribute("role")==="button":!1}function Dt(t){return it(t)}function Nt(t,e){return e?"composedPath"in t&&typeof t.composedPath=="function"?t.composedPath().includes(e):e.contains(t.target):!1}function Fn(t,e){const n=e.getBoundingClientRect(),o=e.offsetWidth-e.clientWidth,r=e.offsetHeight-e.clientHeight,l=t.clientX-n.left,i=t.clientY-n.top;if(o>0){const s=e.clientWidth;if(l>=s&&l<=e.offsetWidth)return!0}if(r>0){const s=e.clientHeight;if(i>=s&&i<=e.offsetHeight)return!0}return!1}function at(t,e){return t.contains(e)}function Rn(t){return t.target}function Ft(){return typeof performance<"u"?performance.now():Date.now()}function Rt(t){t!==-1&&clearTimeout(t)}function Ln(t){return t!==null&&typeof t=="object"&&"data"in t&&"id"in t&&"children"in t&&"parent"in t}function Fe(t){return Ln(t)?{floatingContext:t.data,treeContext:t}:{floatingContext:t,treeContext:null}}function re(t,e){if(!e)return!1;if(typeof e=="object"&&e!==null&&"contextElement"in e){const n=e.contextElement;return n instanceof Element?n.contains(t):!1}return e instanceof Element?e.contains(t):!1}function lt(t,e){for(const n of t.children.value)if(n.data.open.value){if(re(e,n.data.refs.anchorEl.value)||re(e,n.data.refs.floatingEl.value))return n;const o=lt(n,e);if(o)return o}return null}const Be=t=>typeof t=="number"&&Number.isFinite(t)?t:null,Te=class Te{create(e){const n=this.buildConfiguration(e);return{contextElement:n.referenceElement||void 0,getBoundingClientRect:()=>this.buildBoundingRect(n)}}buildConfiguration(e){return{coordinates:e.coordinates,referenceElement:e.referenceElement??null,baselineCoordinates:e.baselineCoordinates??null,axis:e.axis??"both"}}buildBoundingRect(e){const n=this.getReferenceRect(e.referenceElement),o=this.resolvePosition(e,n),r=this.calculateSize(e.axis,n);return this.buildDOMRect({x:o.x,y:o.y,width:r.width,height:r.height})}getReferenceRect(e){if(e)try{return e.getBoundingClientRect()}catch(n){console.warn("VirtualElementFactory: Failed to get element bounds",{element:e,error:n})}return this.buildDOMRect({x:0,y:0,width:Te.DEFAULT_DIMENSIONS.width,height:Te.DEFAULT_DIMENSIONS.height})}resolvePosition(e,n){var o,r;return{x:this.resolveAxisCoordinate({current:e.coordinates.x,baseline:((o=e.baselineCoordinates)==null?void 0:o.x)??null,fallback:n.x,isAxisEnabled:e.axis==="x"||e.axis==="both"}),y:this.resolveAxisCoordinate({current:e.coordinates.y,baseline:((r=e.baselineCoordinates)==null?void 0:r.y)??null,fallback:n.y,isAxisEnabled:e.axis==="y"||e.axis==="both"})}}resolveAxisCoordinate(e){const{current:n,baseline:o,fallback:r,isAxisEnabled:l}=e;return l&&n!==null?n:o!==null?o:r}calculateSize(e,n){const o=(r,l)=>Math.max(0,r||l);switch(e){case"both":return{width:0,height:0};case"x":return{width:o(n.width,Te.DEFAULT_DIMENSIONS.width),height:0};case"y":return{width:0,height:o(n.height,Te.DEFAULT_DIMENSIONS.height)}}}buildDOMRect(e){const{x:n,y:o,width:r,height:l}=e,i=Math.max(0,r),s=Math.max(0,l);return{x:n,y:o,width:i,height:s,top:o,right:n+i,bottom:o+s,left:n,toJSON:()=>({x:n,y:o,width:i,height:s})}}};Ne(Te,"DEFAULT_DIMENSIONS",{width:100,height:30});let He=Te;class st{constructor(){Ne(this,"lastKnownCoordinates",null)}getCoordinatesForOpening(){return this.lastKnownCoordinates}onClose(){this.lastKnownCoordinates=null}reset(){this.lastKnownCoordinates=null}}class Lt extends st{constructor(){super(...arguments);Ne(this,"name","follow")}getRequiredEvents(){return["pointerdown","pointermove","pointerenter"]}process(n,o){const r=n.coordinates;switch(this.lastKnownCoordinates=r,n.type){case"pointerdown":return r;case"pointermove":return o.isOpen&&At(n.originalEvent.pointerType,!0)?r:null;case"pointerenter":return r;default:return null}}}class kt extends st{constructor(){super(...arguments);Ne(this,"name","static");Ne(this,"triggerCoordinates",null)}getRequiredEvents(){return["pointerdown"]}process(n,o){const r=n.coordinates;return this.triggerCoordinates=r,this.lastKnownCoordinates=r,o.isOpen?r:null}getCoordinatesForOpening(){return this.triggerCoordinates?this.triggerCoordinates:this.lastKnownCoordinates}reset(){super.reset(),this.triggerCoordinates=null}onClose(){this.triggerCoordinates=null}}function kn(t,e,n={}){const{open:o,refs:r}=e,l=new He,i=f.ref({x:null,y:null}),s=f.ref(null),d=f.computed(()=>f.toValue(n.axis??"both")),a=f.computed(()=>f.toValue(n.enabled??!0)),h=f.computed(()=>Be(f.toValue(n.x??null))),u=f.computed(()=>Be(f.toValue(n.y??null))),v=f.computed(()=>h.value!==null&&u.value!==null),p=f.computed(()=>v.value?{x:h.value,y:u.value}:i.value),w=f.computed(()=>{const S=p.value;switch(d.value){case"x":return{x:S.x,y:null};case"y":return{x:null,y:S.y};case"both":return S}}),x=(n.trackingMode??"follow")==="follow"?new Lt:new kt,y=(S,N)=>{v.value||(i.value={x:Be(S),y:Be(N)})},m=()=>{v.value||(i.value={x:null,y:null})},C=(S,N)=>{const W={type:N,coordinates:{x:S.clientX,y:S.clientY},originalEvent:S},V=x.process(W,{isOpen:o.value});V&&y(V.x,V.y)};f.watch([w,s,d,t],()=>{r.anchorEl.value=l.create({coordinates:w.value,referenceElement:t.value,baselineCoordinates:s.value,axis:d.value})},{immediate:!0}),f.watch(o,S=>{if(!(!a.value||v.value))if(S){const N=x.getCoordinatesForOpening();N?(y(N.x,N.y),s.value={...N}):s.value={...i.value}}else x.onClose(),m(),s.value=null});const D=S=>{C(S,"pointerdown")},P=S=>{C(S,"pointerenter")},F=S=>{C(S,"pointermove")};return f.watchEffect(()=>{if(v.value||!a.value)return;const S=t.value;if(!S)return;const N=x.getRequiredEvents(),W={pointerenter:P,pointerdown:D,pointermove:F};N.forEach(V=>{const k=W[V];k&&S.addEventListener(V,k)}),f.onWatcherCleanup(()=>{N.forEach(V=>{const k=W[V];k&&S.removeEventListener(V,k)})})}),{coordinates:f.readonly(w),updatePosition:(S,N)=>y(S,N)}}const Mt=["top","right","bottom","left"],It=["start","end"],Vt=Mt.reduce((t,e)=>t.concat(e,e+"-"+It[0],e+"-"+It[1]),[]),ve=Math.min,ee=Math.max,We=Math.round,Ke=Math.floor,ce=t=>({x:t,y:t}),Mn={left:"right",right:"left",bottom:"top",top:"bottom"},In={start:"end",end:"start"};function ct(t,e,n){return ee(t,ve(e,n))}function pe(t,e){return typeof t=="function"?t(e):t}function ue(t){return t.split("-")[0]}function ie(t){return t.split("-")[1]}function Bt(t){return t==="x"?"y":"x"}function ut(t){return t==="y"?"height":"width"}const Vn=new Set(["top","bottom"]);function he(t){return Vn.has(ue(t))?"y":"x"}function ft(t){return Bt(he(t))}function Ht(t,e,n){n===void 0&&(n=!1);const o=ie(t),r=ft(t),l=ut(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(i=je(i)),[i,je(i)]}function Bn(t){const e=je(t);return[$e(t),e,$e(e)]}function $e(t){return t.replace(/start|end/g,e=>In[e])}const Wt=["left","right"],Kt=["right","left"],Hn=["top","bottom"],Wn=["bottom","top"];function Kn(t,e,n){switch(t){case"top":case"bottom":return n?e?Kt:Wt:e?Wt:Kt;case"left":case"right":return e?Hn:Wn;default:return[]}}function $n(t,e,n,o){const r=ie(t);let l=Kn(ue(t),n==="start",o);return r&&(l=l.map(i=>i+"-"+r),e&&(l=l.concat(l.map($e)))),l}function je(t){return t.replace(/left|right|bottom|top/g,e=>Mn[e])}function jn(t){return{top:0,right:0,bottom:0,left:0,...t}}function $t(t){return typeof t!="number"?jn(t):{top:t,right:t,bottom:t,left:t}}function _e(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function jt(t,e,n){let{reference:o,floating:r}=t;const l=he(e),i=ft(e),s=ut(i),d=ue(e),a=l==="y",h=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,v=o[s]/2-r[s]/2;let p;switch(d){case"top":p={x:h,y:o.y-r.height};break;case"bottom":p={x:h,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={x:o.x-r.width,y:u};break;default:p={x:o.x,y:o.y}}switch(ie(e)){case"start":p[i]-=v*(n&&a?-1:1);break;case"end":p[i]+=v*(n&&a?-1:1);break}return p}const _n=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:l=[],platform:i}=n,s=l.filter(Boolean),d=await(i.isRTL==null?void 0:i.isRTL(e));let a=await i.getElementRects({reference:t,floating:e,strategy:r}),{x:h,y:u}=jt(a,o,d),v=o,p={},w=0;for(let x=0;x<s.length;x++){const{name:y,fn:m}=s[x],{x:C,y:D,data:P,reset:F}=await m({x:h,y:u,initialPlacement:o,placement:v,strategy:r,middlewareData:p,rects:a,platform:i,elements:{reference:t,floating:e}});h=C??h,u=D??u,p={...p,[y]:{...p[y],...P}},F&&w<=50&&(w++,typeof F=="object"&&(F.placement&&(v=F.placement),F.rects&&(a=F.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):F.rects),{x:h,y:u}=jt(a,v,d)),x=-1)}return{x:h,y:u,placement:v,strategy:r,middlewareData:p}};async function Se(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:l,rects:i,elements:s,strategy:d}=t,{boundary:a="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:v=!1,padding:p=0}=pe(e,t),w=$t(p),y=s[v?u==="floating"?"reference":"floating":u],m=_e(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(y)))==null||n?y:y.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(s.floating)),boundary:a,rootBoundary:h,strategy:d})),C=u==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,D=await(l.getOffsetParent==null?void 0:l.getOffsetParent(s.floating)),P=await(l.isElement==null?void 0:l.isElement(D))?await(l.getScale==null?void 0:l.getScale(D))||{x:1,y:1}:{x:1,y:1},F=_e(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:D,strategy:d}):C);return{top:(m.top-F.top+w.top)/P.y,bottom:(F.bottom-m.bottom+w.bottom)/P.y,left:(m.left-F.left+w.left)/P.x,right:(F.right-m.right+w.right)/P.x}}const zn=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:r,rects:l,platform:i,elements:s,middlewareData:d}=e,{element:a,padding:h=0}=pe(t,e)||{};if(a==null)return{};const u=$t(h),v={x:n,y:o},p=ft(r),w=ut(p),x=await i.getDimensions(a),y=p==="y",m=y?"top":"left",C=y?"bottom":"right",D=y?"clientHeight":"clientWidth",P=l.reference[w]+l.reference[p]-v[p]-l.floating[w],F=v[p]-l.reference[p],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a));let N=S?S[D]:0;(!N||!await(i.isElement==null?void 0:i.isElement(S)))&&(N=s.floating[D]||l.floating[w]);const W=P/2-F/2,V=N/2-x[w]/2-1,k=ve(u[m],V),K=ve(u[C],V),I=k,b=N-x[w]-K,g=N/2-x[w]/2+W,E=ct(I,g,b),c=!d.arrow&&ie(r)!=null&&g!==E&&l.reference[w]/2-(g<I?k:K)-x[w]/2<0,M=c?g<I?g-I:g-b:0;return{[p]:v[p]+M,data:{[p]:E,centerOffset:g-E-M,...c&&{alignmentOffset:M}},reset:c}}});function Yn(t,e,n){return(t?[...n.filter(r=>ie(r)===t),...n.filter(r=>ie(r)!==t)]:n.filter(r=>ue(r)===r)).filter(r=>t?ie(r)===t||(e?$e(r)!==r:!1):!0)}const Xn=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,r;const{rects:l,middlewareData:i,placement:s,platform:d,elements:a}=e,{crossAxis:h=!1,alignment:u,allowedPlacements:v=Vt,autoAlignment:p=!0,...w}=pe(t,e),x=u!==void 0||v===Vt?Yn(u||null,p,v):v,y=await Se(e,w),m=((n=i.autoPlacement)==null?void 0:n.index)||0,C=x[m];if(C==null)return{};const D=Ht(C,l,await(d.isRTL==null?void 0:d.isRTL(a.floating)));if(s!==C)return{reset:{placement:x[0]}};const P=[y[ue(C)],y[D[0]],y[D[1]]],F=[...((o=i.autoPlacement)==null?void 0:o.overflows)||[],{placement:C,overflows:P}],S=x[m+1];if(S)return{data:{index:m+1,overflows:F},reset:{placement:S}};const N=F.map(k=>{const K=ie(k.placement);return[k.placement,K&&h?k.overflows.slice(0,2).reduce((I,b)=>I+b,0):k.overflows[0],k.overflows]}).sort((k,K)=>k[1]-K[1]),V=((r=N.filter(k=>k[2].slice(0,ie(k[0])?2:3).every(K=>K<=0))[0])==null?void 0:r[0])||N[0][0];return V!==s?{data:{index:m+1,overflows:F},reset:{placement:V}}:{}}}},Un=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:l,rects:i,initialPlacement:s,platform:d,elements:a}=e,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:v,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:x=!0,...y}=pe(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const m=ue(r),C=he(s),D=ue(s)===s,P=await(d.isRTL==null?void 0:d.isRTL(a.floating)),F=v||(D||!x?[je(s)]:Bn(s)),S=w!=="none";!v&&S&&F.push(...$n(s,x,w,P));const N=[s,...F],W=await Se(e,y),V=[];let k=((o=l.flip)==null?void 0:o.overflows)||[];if(h&&V.push(W[m]),u){const g=Ht(r,i,P);V.push(W[g[0]],W[g[1]])}if(k=[...k,{placement:r,overflows:V}],!V.every(g=>g<=0)){var K,I;const g=(((K=l.flip)==null?void 0:K.index)||0)+1,E=N[g];if(E&&(!(u==="alignment"?C!==he(E):!1)||k.every(T=>he(T.placement)===C?T.overflows[0]>0:!0)))return{data:{index:g,overflows:k},reset:{placement:E}};let c=(I=k.filter(M=>M.overflows[0]<=0).sort((M,T)=>M.overflows[1]-T.overflows[1])[0])==null?void 0:I.placement;if(!c)switch(p){case"bestFit":{var b;const M=(b=k.filter(T=>{if(S){const L=he(T.placement);return L===C||L==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(L=>L>0).reduce((L,z)=>L+z,0)]).sort((T,L)=>T[1]-L[1])[0])==null?void 0:b[0];M&&(c=M);break}case"initialPlacement":c=s;break}if(r!==c)return{reset:{placement:c}}}return{}}}};function _t(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function zt(t){return Mt.some(e=>t[e]>=0)}const qn=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...r}=pe(t,e);switch(o){case"referenceHidden":{const l=await Se(e,{...r,elementContext:"reference"}),i=_t(l,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:zt(i)}}}case"escaped":{const l=await Se(e,{...r,altBoundary:!0}),i=_t(l,n.floating);return{data:{escapedOffsets:i,escaped:zt(i)}}}default:return{}}}}},Gn=new Set(["left","top"]);async function Zn(t,e){const{placement:n,platform:o,elements:r}=t,l=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=ue(n),s=ie(n),d=he(n)==="y",a=Gn.has(i)?-1:1,h=l&&d?-1:1,u=pe(e,t);let{mainAxis:v,crossAxis:p,alignmentAxis:w}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof w=="number"&&(p=s==="end"?w*-1:w),d?{x:p*h,y:v*a}:{x:v*a,y:p*h}}const Jn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:l,placement:i,middlewareData:s}=e,d=await Zn(e,t);return i===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+d.x,y:l+d.y,data:{...d,placement:i}}}}},Qn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:l=!0,crossAxis:i=!1,limiter:s={fn:y=>{let{x:m,y:C}=y;return{x:m,y:C}}},...d}=pe(t,e),a={x:n,y:o},h=await Se(e,d),u=he(ue(r)),v=Bt(u);let p=a[v],w=a[u];if(l){const y=v==="y"?"top":"left",m=v==="y"?"bottom":"right",C=p+h[y],D=p-h[m];p=ct(C,p,D)}if(i){const y=u==="y"?"top":"left",m=u==="y"?"bottom":"right",C=w+h[y],D=w-h[m];w=ct(C,w,D)}const x=s.fn({...e,[v]:p,[u]:w});return{...x,data:{x:x.x-n,y:x.y-o,enabled:{[v]:l,[u]:i}}}}}},eo=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:l,platform:i,elements:s}=e,{apply:d=()=>{},...a}=pe(t,e),h=await Se(e,a),u=ue(r),v=ie(r),p=he(r)==="y",{width:w,height:x}=l.floating;let y,m;u==="top"||u==="bottom"?(y=u,m=v===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,y=v==="end"?"top":"bottom");const C=x-h.top-h.bottom,D=w-h.left-h.right,P=ve(x-h[y],C),F=ve(w-h[m],D),S=!e.middlewareData.shift;let N=P,W=F;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(W=D),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(N=C),S&&!v){const k=ee(h.left,0),K=ee(h.right,0),I=ee(h.top,0),b=ee(h.bottom,0);p?W=w-2*(k!==0||K!==0?k+K:ee(h.left,h.right)):N=x-2*(I!==0||b!==0?I+b:ee(h.top,h.bottom))}await d({...e,availableWidth:W,availableHeight:N});const V=await i.getDimensions(s.floating);return w!==V.width||x!==V.height?{reset:{rects:!0}}:{}}}};function ze(){return typeof window<"u"}function Oe(t){return Yt(t)?(t.nodeName||"").toLowerCase():"#document"}function te(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function fe(t){var e;return(e=(Yt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Yt(t){return ze()?t instanceof Node||t instanceof te(t).Node:!1}function ae(t){return ze()?t instanceof Element||t instanceof te(t).Element:!1}function de(t){return ze()?t instanceof HTMLElement||t instanceof te(t).HTMLElement:!1}function Xt(t){return!ze()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof te(t).ShadowRoot}const to=new Set(["inline","contents"]);function Re(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=le(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!to.has(r)}const no=new Set(["table","td","th"]);function oo(t){return no.has(Oe(t))}const ro=[":popover-open",":modal"];function Ye(t){return ro.some(e=>{try{return t.matches(e)}catch{return!1}})}const io=["transform","translate","scale","rotate","perspective"],ao=["transform","translate","scale","rotate","perspective","filter"],lo=["paint","layout","strict","content"];function dt(t){const e=ht(),n=ae(t)?le(t):t;return io.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||ao.some(o=>(n.willChange||"").includes(o))||lo.some(o=>(n.contain||"").includes(o))}function so(t){let e=me(t);for(;de(e)&&!Ae(e);){if(dt(e))return e;if(Ye(e))return null;e=me(e)}return null}function ht(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const co=new Set(["html","body","#document"]);function Ae(t){return co.has(Oe(t))}function le(t){return te(t).getComputedStyle(t)}function Xe(t){return ae(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function me(t){if(Oe(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Xt(t)&&t.host||fe(t);return Xt(e)?e.host:e}function Ut(t){const e=me(t);return Ae(e)?t.ownerDocument?t.ownerDocument.body:t.body:de(e)&&Re(e)?e:Ut(e)}function Le(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Ut(t),l=r===((o=t.ownerDocument)==null?void 0:o.body),i=te(r);if(l){const s=vt(i);return e.concat(i,i.visualViewport||[],Re(r)?r:[],s&&n?Le(s):[])}return e.concat(r,Le(r,[],n))}function vt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function qt(t){const e=le(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=de(t),l=r?t.offsetWidth:n,i=r?t.offsetHeight:o,s=We(n)!==l||We(o)!==i;return s&&(n=l,o=i),{width:n,height:o,$:s}}function pt(t){return ae(t)?t:t.contextElement}function Pe(t){const e=pt(t);if(!de(e))return ce(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:l}=qt(e);let i=(l?We(n.width):n.width)/o,s=(l?We(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const uo=ce(0);function Gt(t){const e=te(t);return!ht()||!e.visualViewport?uo:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function fo(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==te(t)?!1:e}function be(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),l=pt(t);let i=ce(1);e&&(o?ae(o)&&(i=Pe(o)):i=Pe(t));const s=fo(l,n,o)?Gt(l):ce(0);let d=(r.left+s.x)/i.x,a=(r.top+s.y)/i.y,h=r.width/i.x,u=r.height/i.y;if(l){const v=te(l),p=o&&ae(o)?te(o):o;let w=v,x=vt(w);for(;x&&o&&p!==w;){const y=Pe(x),m=x.getBoundingClientRect(),C=le(x),D=m.left+(x.clientLeft+parseFloat(C.paddingLeft))*y.x,P=m.top+(x.clientTop+parseFloat(C.paddingTop))*y.y;d*=y.x,a*=y.y,h*=y.x,u*=y.y,d+=D,a+=P,w=te(x),x=vt(w)}}return _e({width:h,height:u,x:d,y:a})}function Ue(t,e){const n=Xe(t).scrollLeft;return e?e.left+n:be(fe(t)).left+n}function Zt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-Ue(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function ho(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const l=r==="fixed",i=fe(o),s=e?Ye(e.floating):!1;if(o===i||s&&l)return n;let d={scrollLeft:0,scrollTop:0},a=ce(1);const h=ce(0),u=de(o);if((u||!u&&!l)&&((Oe(o)!=="body"||Re(i))&&(d=Xe(o)),de(o))){const p=be(o);a=Pe(o),h.x=p.x+o.clientLeft,h.y=p.y+o.clientTop}const v=i&&!u&&!l?Zt(i,d):ce(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-d.scrollLeft*a.x+h.x+v.x,y:n.y*a.y-d.scrollTop*a.y+h.y+v.y}}function vo(t){return Array.from(t.getClientRects())}function po(t){const e=fe(t),n=Xe(t),o=t.ownerDocument.body,r=ee(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=ee(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Ue(t);const s=-n.scrollTop;return le(o).direction==="rtl"&&(i+=ee(e.clientWidth,o.clientWidth)-r),{width:r,height:l,x:i,y:s}}const Jt=25;function mo(t,e){const n=te(t),o=fe(t),r=n.visualViewport;let l=o.clientWidth,i=o.clientHeight,s=0,d=0;if(r){l=r.width,i=r.height;const h=ht();(!h||h&&e==="fixed")&&(s=r.offsetLeft,d=r.offsetTop)}const a=Ue(o);if(a<=0){const h=o.ownerDocument,u=h.body,v=getComputedStyle(u),p=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,w=Math.abs(o.clientWidth-u.clientWidth-p);w<=Jt&&(l-=w)}else a<=Jt&&(l+=a);return{width:l,height:i,x:s,y:d}}const go=new Set(["absolute","fixed"]);function bo(t,e){const n=be(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,l=de(t)?Pe(t):ce(1),i=t.clientWidth*l.x,s=t.clientHeight*l.y,d=r*l.x,a=o*l.y;return{width:i,height:s,x:d,y:a}}function Qt(t,e,n){let o;if(e==="viewport")o=mo(t,n);else if(e==="document")o=po(fe(t));else if(ae(e))o=bo(e,n);else{const r=Gt(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return _e(o)}function en(t,e){const n=me(t);return n===e||!ae(n)||Ae(n)?!1:le(n).position==="fixed"||en(n,e)}function wo(t,e){const n=e.get(t);if(n)return n;let o=Le(t,[],!1).filter(s=>ae(s)&&Oe(s)!=="body"),r=null;const l=le(t).position==="fixed";let i=l?me(t):t;for(;ae(i)&&!Ae(i);){const s=le(i),d=dt(i);!d&&s.position==="fixed"&&(r=null),(l?!d&&!r:!d&&s.position==="static"&&!!r&&go.has(r.position)||Re(i)&&!d&&en(t,i))?o=o.filter(h=>h!==i):r=s,i=me(i)}return e.set(t,o),o}function yo(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const i=[...n==="clippingAncestors"?Ye(e)?[]:wo(e,this._c):[].concat(n),o],s=i[0],d=i.reduce((a,h)=>{const u=Qt(e,h,r);return a.top=ee(u.top,a.top),a.right=ve(u.right,a.right),a.bottom=ve(u.bottom,a.bottom),a.left=ee(u.left,a.left),a},Qt(e,s,r));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Eo(t){const{width:e,height:n}=qt(t);return{width:e,height:n}}function To(t,e,n){const o=de(e),r=fe(e),l=n==="fixed",i=be(t,!0,l,e);let s={scrollLeft:0,scrollTop:0};const d=ce(0);function a(){d.x=Ue(r)}if(o||!o&&!l)if((Oe(e)!=="body"||Re(r))&&(s=Xe(e)),o){const p=be(e,!0,l,e);d.x=p.x+e.clientLeft,d.y=p.y+e.clientTop}else r&&a();l&&!o&&r&&a();const h=r&&!o&&!l?Zt(r,s):ce(0),u=i.left+s.scrollLeft-d.x-h.x,v=i.top+s.scrollTop-d.y-h.y;return{x:u,y:v,width:i.width,height:i.height}}function mt(t){return le(t).position==="static"}function tn(t,e){if(!de(t)||le(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return fe(t)===n&&(n=n.ownerDocument.body),n}function nn(t,e){const n=te(t);if(Ye(t))return n;if(!de(t)){let r=me(t);for(;r&&!Ae(r);){if(ae(r)&&!mt(r))return r;r=me(r)}return n}let o=tn(t,e);for(;o&&oo(o)&&mt(o);)o=tn(o,e);return o&&Ae(o)&&mt(o)&&!dt(o)?n:o||so(t)||n}const xo=async function(t){const e=this.getOffsetParent||nn,n=this.getDimensions,o=await n(t.floating);return{reference:To(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Co(t){return le(t).direction==="rtl"}const So={convertOffsetParentRelativeRectToViewportRelativeRect:ho,getDocumentElement:fe,getClippingRect:yo,getOffsetParent:nn,getElementRects:xo,getClientRects:vo,getDimensions:Eo,getScale:Pe,isElement:ae,isRTL:Co};function on(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Oo(t,e){let n=null,o;const r=fe(t);function l(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function i(s,d){s===void 0&&(s=!1),d===void 0&&(d=1),l();const a=t.getBoundingClientRect(),{left:h,top:u,width:v,height:p}=a;if(s||e(),!v||!p)return;const w=Ke(u),x=Ke(r.clientWidth-(h+v)),y=Ke(r.clientHeight-(u+p)),m=Ke(h),D={rootMargin:-w+"px "+-x+"px "+-y+"px "+-m+"px",threshold:ee(0,ve(1,d))||1};let P=!0;function F(S){const N=S[0].intersectionRatio;if(N!==d){if(!P)return i();N?i(!1,N):o=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!on(a,t.getBoundingClientRect())&&i(),P=!1}try{n=new IntersectionObserver(F,{...D,root:r.ownerDocument})}catch{n=new IntersectionObserver(F,D)}n.observe(t)}return i(!0),l}function Ao(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,a=pt(t),h=r||l?[...a?Le(a):[],...Le(e)]:[];h.forEach(m=>{r&&m.addEventListener("scroll",n,{passive:!0}),l&&m.addEventListener("resize",n)});const u=a&&s?Oo(a,n):null;let v=-1,p=null;i&&(p=new ResizeObserver(m=>{let[C]=m;C&&C.target===a&&p&&(p.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var D;(D=p)==null||D.observe(e)})),n()}),a&&!d&&p.observe(a),p.observe(e));let w,x=d?be(t):null;d&&y();function y(){const m=be(t);x&&!on(x,m)&&n(),x=m,w=requestAnimationFrame(y)}return n(),()=>{var m;h.forEach(C=>{r&&C.removeEventListener("scroll",n),l&&C.removeEventListener("resize",n)}),u==null||u(),(m=p)==null||m.disconnect(),p=null,d&&cancelAnimationFrame(w)}}const Po=Jn,Do=Xn,No=Qn,Fo=Un,Ro=eo,Lo=qn,ko=zn,Mo=(t,e,n)=>{const o=new Map,r={platform:So,...n},l={...r.platform,_c:o};return _n(t,e,{...r,platform:l})};function rn(t){return{name:"arrow",options:t,fn(e){const n=f.toValue(t.element);return n==null?{}:ko({element:n,padding:t.padding}).fn(e)}}}function an(t,e,n={}){const{transform:o=!0,middlewares:r,autoUpdate:l=!0,open:i=f.ref(!1),onOpenChange:s}=n,d=(S,N,W)=>{if(i.value===S)return;i.value=S;const V=N??"programmatic";s==null||s(S,V,W)},a=f.computed(()=>f.toValue(n.placement)??"bottom"),h=f.computed(()=>f.toValue(n.strategy)??"absolute"),u=f.ref(0),v=f.ref(0),p=f.ref(a.value),w=f.ref(h.value),x=f.shallowRef({}),y=f.ref(!1),m=f.ref(null),C=f.computed(()=>{const S=f.toValue(r)||[];return m.value&&!S.some(W=>W.name==="arrow")?[...S,rn({element:m})]:S}),D=async()=>{if(!(!t.value||!e.value))try{const S=await Mo(t.value,e.value,{placement:a.value,strategy:h.value,middleware:C.value});u.value=S.x,v.value=S.y,p.value=S.placement,w.value=S.strategy,x.value=S.middlewareData,y.value=i.value}catch{}};f.watch([a,h,C],()=>{i.value&&D()});let P;f.watch([t,e,i],([S,N,W])=>{!W||!S||!N||(l&&(P=Ao(S,N,D,typeof l=="object"?l:void 0)),f.onWatcherCleanup(()=>{P==null||P(),P=void 0}))},{immediate:!0}),f.onScopeDispose(()=>P==null?void 0:P()),f.watch(i,S=>{S||(y.value=!1)});const F=f.ref({position:h.value,left:"0",top:"0"});return f.watch([u,v,()=>f.toValue(o)],([S,N,W])=>{const V=e.value;if(!V)return;const k={position:w.value,left:"0",top:"0"},K=ln(V,S),I=ln(V,N);W?F.value={...k,transform:`translate(${K}px, ${I}px)`,...sn(V)>=1.5&&{"will-change":"transform"}}:F.value={...k,left:`${K}px`,top:`${I}px`}},{immediate:!0}),{id:n.id,x:u,y:v,strategy:w,placement:p,middlewareData:x,isPositioned:y,floatingStyles:F,update:D,refs:{anchorEl:t,floatingEl:e,arrowEl:m},open:i,setOpen:d}}function ln(t,e){const n=sn(t);return Math.round(e*n)/n}function sn(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Io(t={}){let e;return e=cn(t),{...e,get root(){return e.root},addNode:(i,s,d={})=>{const{parentId:a,...h}=d,u=Ot(),v=h.onOpenChange,p=an(i,s,{...h,id:u,onOpenChange:(x,y,m)=>{if(v==null||v(x,y,m),!x){const C=e.findNodeById(u);if(C){const D=C.children.value;for(const P of D)P.data.open.value&&P.data.setOpen(!1,"tree-ancestor-close",m)}}}});return e.addNode(p,a,{id:u})},getAllOpenNodes:()=>{const i=[];for(const s of e.nodeMap.values())s.data.open.value&&i.push(s);return i},getDeepestOpenNode:()=>{let i=null,s=-1;for(const d of e.nodeMap.values())if(d.data.open.value){const a=d.getPath().length;a>s&&(s=a,i=d)}return i},applyToNodes:(i,s,d={})=>{const{relationship:a="self-and-children",applyToMatching:h=!0}=d,u=e.findNodeById(i);if(!u)return;const v=[],p=new Set,w=y=>{y&&!p.has(y.id)&&(v.push(y),p.add(y.id))},x=y=>{for(const m of y)w(m)};if(a==="ancestors-only")for(const y of u.getPath())y.id!==u.id&&w(y);else if(a==="siblings-only"){if(u.parent.value)for(const y of u.parent.value.children.value)y.id!==u.id&&w(y)}else if(a==="descendants-only")for(const y of e.traverse("dfs",u))y.id!==u.id&&w(y);else if(a==="children-only")x(u.children.value);else if(a==="self-and-ancestors")x(u.getPath());else if(a==="self-and-children")w(u),x(u.children.value);else if(a==="self-and-descendants")x(e.traverse("dfs",u));else if(a==="self-and-siblings")w(u),u.parent.value&&x(u.parent.value.children.value);else if(a==="self-ancestors-and-children")x(u.getPath()),x(u.children.value);else if(a==="full-branch")x(u.getPath()),x(e.traverse("dfs",u));else if(a==="all-except-branch"){const y=new Set;for(const m of u.getPath())y.add(m.id);for(const m of e.traverse("dfs",u))y.add(m.id);for(const m of e.nodeMap.values())!y.has(m.id)===h&&s(m);return}else{console.warn(`applyToNodes: Unknown relationship "${a}".`);return}if(h)for(const y of v)s(y);else for(const y of e.nodeMap.values())p.has(y.id)||s(y)}}}function gt(t,e=null,n={},o=!1){const r=n.id??Ot(),l=f.shallowRef(e),i=f.shallowRef([]),s=f.computed(()=>i.value.length===0),d={id:r,data:t,parent:l,children:i,isRoot:o,isLeaf:s,addChild:a=>{i.value=[...i.value,a]},_removeChildInstance:a=>i.value.includes(a)?(i.value=i.value.filter(h=>h.id!==a.id),a.parent.value=null,!0):!1,findChild:a=>i.value.find(a)??null,findDescendant:a=>{const h=[d];for(;h.length>0;){const u=h.pop();if(a(u))return u;for(let v=u.children.value.length-1;v>=0;v--)h.push(u.children.value[v])}return null},isDescendantOf:a=>{let h=l.value;for(;h;){if(h.id===a.id)return!0;h=h.parent.value}return!1},getPath:()=>{const a=[];let h=d;for(;h;)a.push(h),h=h.parent.value;return a.reverse()}};return Object.freeze(d)}function cn(t){const e=(t==null?void 0:t.deleteStrategy)??"recursive",n=f.shallowReactive(new Map);let o=null;const r=u=>n.get(u)??null,l=(u,v=null,p={})=>{if(!o){if(v!=null)return console.error(`Tree addNode: Cannot add a non-root node before a root exists. Received parentId=${v}.`),null;const y=gt(u,null,p,!0);return n.set(y.id,y),o=y,y}const w=v?r(v):o;if(!w)return console.error(`Tree addNode: Parent node with ID ${v} not found.`),null;p.id&&n.has(p.id)&&(p.id=void 0);const x=gt(u,w,p);return n.set(x.id,x),w.addChild(x),x},i=(u,v)=>{const p=v??e,w=r(u);if(!w)return!1;if(w.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const x=w.parent.value;if(p==="recursive")h(w);else{for(const y of w.children.value)y.parent.value=null;w.children.value=[],n.delete(w.id)}return x._removeChildInstance(w)},s=(u,v)=>{const p=r(u);if(!p)return console.error(`Tree moveNode: Node with ID ${u} not found.`),!1;if(p.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(u===v)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const w=v?r(v):o;if(!w)return console.error(`Tree moveNode: New parent node with ID ${v} not found.`),!1;if(w.isDescendantOf(p))return console.error("Tree moveNode: Cannot move a node to become its own descendant."),!1;const x=p.parent.value;if(x){if(!x._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},d=(u="dfs",v=o)=>{const p=[];if(!v)return console.warn("Tree traverse: Start node is null, returning empty array."),p;if(u==="dfs"){const w=[v];for(;w.length>0;){const x=w.pop();p.push(x);for(let y=x.children.value.length-1;y>=0;y--)w.push(x.children.value[y])}}else{const w=[v];for(;w.length>0;){const x=w.shift();p.push(x);for(const y of x.children.value)w.push(y)}}return p},a=()=>{n.clear()},h=u=>{const v=[...u.children.value];for(const p of v)h(p);n.delete(u.id),u.children.value=[]};return Object.freeze({get root(){return o},get nodeMap(){return n},findNodeById:r,addNode:l,removeNode:i,moveNode:s,traverse:d,dispose:a})}function Vo(t){return f.getCurrentScope()?(f.onScopeDispose(t),!0):!1}const Bo=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Ho=Object.prototype.toString,Wo=t=>Ho.call(t)==="[object Object]";function bt(t){return Array.isArray(t)?t:[t]}function Ko(t,e,n){return f.watch(t,e,{...n,immediate:!0})}const $o=Bo?window:void 0;function jo(t){var e;const n=f.toValue(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Q(...t){const e=[],n=()=>{e.forEach(s=>s()),e.length=0},o=(s,d,a,h)=>(s.addEventListener(d,a,h),()=>s.removeEventListener(d,a,h)),r=f.computed(()=>{const s=bt(f.toValue(t[0])).filter(d=>d!=null);return s.every(d=>typeof d!="string")?s:void 0}),l=Ko(()=>{var s,d;return[(d=(s=r.value)==null?void 0:s.map(a=>jo(a)))!=null?d:[$o].filter(a=>a!=null),bt(f.toValue(r.value?t[1]:t[0])),bt(f.unref(r.value?t[2]:t[1])),f.toValue(r.value?t[3]:t[2])]},([s,d,a,h])=>{if(n(),!(s!=null&&s.length)||!(d!=null&&d.length)||!(a!=null&&a.length))return;const u=Wo(h)?{...h}:h;e.push(...s.flatMap(v=>d.flatMap(p=>a.map(w=>o(v,p,w,u)))))},{flush:"post"}),i=()=>{l(),n()};return Vo(n),i}function _o(t,e={}){const{floatingContext:n,treeContext:o}=Fe(t),{open:r,setOpen:l,refs:i}=n,{enabled:s=!0,event:d="click",toggle:a=!0,ignoreMouse:h=!1,ignoreKeyboard:u=!1,ignoreTouch:v=!1,outsideClick:p=!1,outsideEvent:w="pointerdown",outsideCapture:x=!0,onOutsideClick:y,preventScrollbarClick:m=!0,handleDragEvents:C=!0}=e;let D,P=!1,F=!1,S=!1;const N=f.computed(()=>f.toValue(s)),W=f.computed(()=>f.toValue(p)),V=f.computed(()=>{const O=i.anchorEl.value;return O instanceof HTMLElement?O:null}),k=f.computed(()=>i.floatingEl.value);function K(O,Y){S=!0;try{r.value?f.toValue(a)&&l(!1,O,Y):l(!0,O,Y)}finally{Promise.resolve().then(()=>{S=!1})}}function I(){D=void 0,P=!1,F=!1}function b(O){D=O.pointerType}function g(O){O.button===0&&f.toValue(d)!=="click"&&($(D)||K("anchor-click",O))}function E(O){if(f.toValue(u)&&O.detail===0){I();return}if(f.toValue(d)==="mousedown"&&D){I();return}if($(D)){I();return}K("anchor-click",O),I()}function c(O){if(D=void 0,O.defaultPrevented||f.toValue(u)||Pt(O))return;const Y=V.value;Y&&(O.key===" "&&!Dt(Y)&&(O.preventDefault(),P=!0),O.key==="Enter"&&K("keyboard-activate",O))}function M(O){const Y=V.value;Y&&(O.defaultPrevented||f.toValue(u)||Pt(O)||Dt(Y)||O.key===" "&&P&&(P=!1,K("keyboard-activate",O)))}function T(O){if(!N.value||!W.value||!r.value)return;if(f.toValue(w)==="click"&&f.toValue(C)&&F){F=!1;return}if(S)return;const Y=O.target;if(Y&&!(f.toValue(m)&&rt(Y)&&k.value&&Fn(O,Y))){if(o){if(!zo(o,Y))return}else if(Nt(O,V.value)||Nt(O,k.value))return;y?y(O,n):l(!1,"outside-pointer",O)}}function L(){F=!0}function z(){setTimeout(()=>{F=!1},0)}function $(O){return!!(At(O,!0)&&f.toValue(h)||O==="touch"&&f.toValue(v))}f.watchPostEffect(()=>{const O=V.value;!N.value||!O||(O.addEventListener("pointerdown",b),O.addEventListener("mousedown",g),O.addEventListener("click",E),O.addEventListener("keydown",c),O.addEventListener("keyup",M),f.onWatcherCleanup(()=>{O.removeEventListener("pointerdown",b),O.removeEventListener("mousedown",g),O.removeEventListener("click",E),O.removeEventListener("keydown",c),O.removeEventListener("keyup",M),I()}))}),Q(()=>N.value&&W.value?document:null,()=>f.toValue(w),T,{capture:f.toValue(x)}),Q(()=>N.value&&W.value&&f.toValue(C)?k.value:null,"mousedown",L,{capture:!0}),Q(()=>N.value&&W.value&&f.toValue(C)?k.value:null,"mouseup",z,{capture:!0})}function zo(t,e){return!(re(e,t.data.refs.anchorEl.value)||re(e,t.data.refs.floatingEl.value)||lt(t,e))}function Yo(t,e={}){const{floatingContext:n,treeContext:o}=Fe(t),{enabled:r=!0,capture:l=!1,onEscape:i}=e,{isComposing:s}=Uo();Q(document,"keydown",a=>{if(!(a.key!=="Escape"||!f.toValue(r)||s())){if(i){i(a);return}if(o){const h=Xo(o);h&&h.data.setOpen(!1,"escape-key",a)}else n.setOpen(!1,"escape-key",a)}},l)}function Xo(t){var l;let e=t;for(;(l=e.parent)!=null&&l.value&&!e.isRoot;)e=e.parent.value;let n=null,o=-1;const r=i=>{var d;if(i.data.open.value){const a=i.getPath().length;a>o&&(o=a,n=i)}const s=((d=i.children)==null?void 0:d.value)??[];for(const a of s)r(a)};return r(e),n}function Uo(){const t=f.ref(!1);return Q(document,"compositionstart",()=>{t.value=!0}),Q(document,"compositionend",()=>{t.value=!1}),{isComposing:()=>t.value}}const qe=f.ref(!1);typeof window<"u"&&(Q(window,"keydown",()=>{qe.value=!0},{capture:!0}),Q(window,"pointerdown",()=>{qe.value=!1},{capture:!0}),Q(window,"pointermove",()=>{qe.value=!1},{capture:!0}));const un=f.readonly(qe),qo=0;function Go(t,e={}){const{open:n,setOpen:o,refs:{floatingEl:r,anchorEl:l}}=t,{enabled:i=!0,requireFocusVisible:s=!0,tree:d}=e,a=f.computed(()=>l.value?l.value instanceof HTMLElement?l.value:l.value.contextElement:null);let h=!1;const u=Pn()&&Dn();let v,p=new Zo(r);if(d){let m=null;if(t.id&&(m=d.findNodeById(t.id)),!m){for(const C of d.nodeMap.values())if(C.data===t){m=C;break}}m&&(p=new Jo(m))}Q(window,"blur",()=>{!n.value&&a.value&&a.value===document.activeElement&&(h=!0)}),Q(window,"focus",()=>{h=!1});function w(m){if(h){h=!1;return}const C=m.target instanceof Element?m.target:null;if(f.toValue(s)&&C){if(u&&!m.relatedTarget){if(!un.value&&!it(C))return}else if(!Nn(C))return}try{o(!0,"focus",m)}catch(D){console.error("[useFocus] Error in onFocus handler:",D)}}function x(m){clearTimeout(v),v=window.setTimeout(()=>{var P;const D=(((P=a.value)==null?void 0:P.ownerDocument)??document).activeElement;if(!(!m.relatedTarget&&D===a.value)&&!p.shouldRemainOpen(D))try{if(D instanceof Element){const F=p.getAncestorsToClose(D);for(const S of F)try{S.data.setOpen(!1,"tree-ancestor-close",m)}catch(N){console.error("[useFocus] Error closing ancestor on blur:",N)}}o(!1,"blur",m)}catch(F){console.error("[useFocus] Error in onBlur handler:",F)}},qo)}Q(document,"focusin",m=>{if(!f.toValue(i))return;const C=m.target;if(!(C instanceof Element))return;const D=a.value;if(!(D&&re(C,D))&&!p.shouldRemainOpen(C))try{const P=p.getAncestorsToClose(C);for(const F of P)try{F.data.setOpen(!1,"tree-ancestor-close",m)}catch(S){console.error("[useFocus] Error closing ancestor on focusin:",S)}o(!1,"blur",m)}catch(P){console.error("[useFocus] Error in document focusin handler:",P)}},{capture:!0});const y=f.watchPostEffect(()=>{if(!f.toValue(i))return;const m=a.value;!m||!(m instanceof HTMLElement)||(m.addEventListener("focus",w),m.addEventListener("blur",x),f.onWatcherCleanup(()=>{m.removeEventListener("focus",w),m.removeEventListener("blur",x)}))});return f.onScopeDispose(()=>{clearTimeout(v)}),{cleanup:()=>{clearTimeout(v),y()}}}class Zo{constructor(e){this.floatingEl=e}shouldRemainOpen(e){return!e||!this.floatingEl.value?!1:this.floatingEl.value.contains(e)}getAncestorsToClose(e){return[]}}class Jo{constructor(e){this.treeContext=e}shouldRemainOpen(e){return e?this.isFocusWithinNodeHierarchy(this.treeContext,e):!1}getAncestorsToClose(e){const n=[];let o=this.treeContext.parent.value;for(;o;){if(!this.isFocusWithinNodeHierarchy(o,e)){n.push(o),o=o.parent.value;continue}break}return n}isFocusWithinNodeHierarchy(e,n){return re(n,e.data.refs.anchorEl.value)||re(n,e.data.refs.floatingEl.value)?!0:this.findDescendantContainingFocus(e,n)!==null}findDescendantContainingFocus(e,n){for(const o of e.children.value)if(o.data.open.value){if(re(n,o.data.refs.anchorEl.value)||re(n,o.data.refs.floatingEl.value))return o;const r=this.findDescendantContainingFocus(o,n);if(r)return r}return null}}function fn(t){return t.children.value.some(e=>e.data.open.value||fn(e))}function Qo(t,e){return t[0]>=e.x&&t[0]<=e.x+e.width&&t[1]>=e.y&&t[1]<=e.y+e.height}function dn(t,e){const[n,o]=t;let r=!1;const l=e.length;for(let i=0,s=l-1;i<l;s=i++){const[d,a]=e[i]||[0,0],[h,u]=e[s]||[0,0];a>=o!=u>=o&&n<=(h-d)*(o-a)/(u-a)+d&&(r=!r)}return r}function er(t={}){const{blockPointerEvents:e=!1,requireIntent:n=!0}=t;let o=-1,r=!1;function l(s,d,a,h,u){const v=Ft(),p=v-u;if(a===null||h===null||p===0)return{speed:null,lastX:s,lastY:d,lastCursorTime:v};const w=s-a,x=d-h;return{speed:Math.sqrt(w*w+x*x)/p,lastX:s,lastY:d,lastCursorTime:v}}const i=function(d){const{x:a,y:h,placement:u,elements:v,buffer:p,onClose:w,nodeId:x,tree:y}=d,m=f.computed(()=>{const F=v.domReference;return rt(F)?F:(F==null?void 0:F.contextElement)??null});let C=null,D=null,P=Ft();return function(S){var xe,tt,nt,Ve,ot,R,H;function N(){Rt(o),o=-1,w()}if(Rt(o),o=-1,!v.domReference||!v.floating||u==null||a==null||h==null)return;const{clientX:W,clientY:V}=S,k=[W,V],K=Rn(S),I=S.type==="mouseleave",b=v.floating&&at(v.floating,K),g=m.value&&at(m.value,K),E=(xe=m.value)==null?void 0:xe.getBoundingClientRect(),c=(tt=v.floating)==null?void 0:tt.getBoundingClientRect(),M=u.split("-")[0],T=a>((c==null?void 0:c.right)??0)-((c==null?void 0:c.width)??0)/2,L=h>((c==null?void 0:c.bottom)??0)-((c==null?void 0:c.height)??0)/2,z=E?Qo(k,E):!1,$=((c==null?void 0:c.width)??0)>((E==null?void 0:E.width)??0),O=((c==null?void 0:c.height)??0)>((E==null?void 0:E.height)??0),Y=((nt=$?E:c)==null?void 0:nt.left)??0,G=((Ve=$?E:c)==null?void 0:Ve.right)??0,U=((ot=O?E:c)==null?void 0:ot.top)??0,oe=((R=O?E:c)==null?void 0:R.bottom)??0;if(b&&(r=!0,!I))return;if(g&&(r=!1),g&&!I){r=!0;return}if(I&&rt(S.relatedTarget)&&v.floating&&at(v.floating,S.relatedTarget))return;if(y&&x){const B=y.nodes.get(x);if(B&&fn(B))return}if(M==="top"&&h>=((E==null?void 0:E.bottom)??0)-1||M==="bottom"&&h<=((E==null?void 0:E.top)??0)+1||M==="left"&&a>=((E==null?void 0:E.right)??0)-1||M==="right"&&a<=((E==null?void 0:E.left)??0)+1)return N();let J=[];switch(M){case"top":J=[[Y,((E==null?void 0:E.top)??0)+1],[Y,((c==null?void 0:c.bottom)??0)-1],[G,((c==null?void 0:c.bottom)??0)-1],[G,((E==null?void 0:E.top)??0)+1]];break;case"bottom":J=[[Y,((c==null?void 0:c.top)??0)+1],[Y,((E==null?void 0:E.bottom)??0)-1],[G,((E==null?void 0:E.bottom)??0)-1],[G,((c==null?void 0:c.top)??0)+1]];break;case"left":J=[[((c==null?void 0:c.right)??0)-1,oe],[((c==null?void 0:c.right)??0)-1,U],[((E==null?void 0:E.left)??0)+1,U],[((E==null?void 0:E.left)??0)+1,oe]];break;case"right":J=[[((E==null?void 0:E.right)??0)-1,oe],[((E==null?void 0:E.right)??0)-1,U],[((c==null?void 0:c.left)??0)+1,U],[((c==null?void 0:c.left)??0)+1,oe]];break}function ne([B,_]){const A=p;switch(M){case"top":{const X=[$?B+A/2:T?B+A*4:B-A*4,_+A+1],Z=[$?B-A/2:T?B+A*4:B-A*4,_+A+1],q=[[(c==null?void 0:c.left)??0,T||$?((c==null?void 0:c.bottom)??0)-A:(c==null?void 0:c.top)??0],[(c==null?void 0:c.right)??0,T?$?((c==null?void 0:c.bottom)??0)-A:(c==null?void 0:c.top)??0:((c==null?void 0:c.bottom)??0)-A]];return[X,Z,...q]}case"bottom":{const X=[$?B+A/2:T?B+A*4:B-A*4,_-A],Z=[$?B-A/2:T?B+A*4:B-A*4,_-A],q=[[(c==null?void 0:c.left)??0,T||$?((c==null?void 0:c.top)??0)+A:(c==null?void 0:c.bottom)??0],[(c==null?void 0:c.right)??0,T?$?((c==null?void 0:c.top)??0)+A:(c==null?void 0:c.bottom)??0:((c==null?void 0:c.top)??0)+A]];return[X,Z,...q]}case"left":{const X=[B+A+1,O?_+A/2:L?_+A*4:_-A*4],Z=[B+A+1,O?_-A/2:L?_+A*4:_-A*4];return[...[[L||O?((c==null?void 0:c.right)??0)-A:(c==null?void 0:c.left)??0,(c==null?void 0:c.top)??0],[L?O?((c==null?void 0:c.right)??0)-A:(c==null?void 0:c.left)??0:((c==null?void 0:c.right)??0)-A,(c==null?void 0:c.bottom)??0]],X,Z]}case"right":{const X=[B-A,O?_+A/2:L?_+A*4:_-A*4],Z=[B-A,O?_-A/2:L?_+A*4:_-A*4],q=[[L||O?((c==null?void 0:c.left)??0)+A:(c==null?void 0:c.right)??0,(c==null?void 0:c.top)??0],[L?O?((c==null?void 0:c.left)??0)+A:(c==null?void 0:c.right)??0:((c==null?void 0:c.left)??0)+A,(c==null?void 0:c.bottom)??0]];return[X,Z,...q]}}}const ge=ne([a,h]);if((H=t.onPolygonChange)==null||H.call(t,ge),!dn(k,J)){if(dn(k,ge)){if(!r&&n){const B=l(S.clientX,S.clientY,C,D,P);C=B.lastX,D=B.lastY,P=B.lastCursorTime,B.speed!==null&&B.speed<.1&&(o=window.setTimeout(N,40))}return}if(r&&!z)return N();N()}}};return i.__options={blockPointerEvents:e},i}const hn=10;function tr(t,e,n){const{delay:o}=n,r=f.computed(()=>{const a=f.toValue(o);return(typeof a=="number"?a:a.open)??0}),l=f.computed(()=>{const a=f.toValue(o);return(typeof a=="number"?a:a.close)??0});let i,s;const d=()=>{clearTimeout(i),clearTimeout(s)};return f.onScopeDispose(d),{show:(a,h)=>{d();const u=a??r.value;u===0?t(h):i=setTimeout(()=>t(h),u)},hide:(a,h)=>{d();const u=a??l.value;u===0?e(h):s=setTimeout(()=>e(h),u)},showDelay:r,hideDelay:l,clearTimeouts:d}}function nr(t,e={}){const{floatingContext:n,treeContext:o}=Fe(t),{open:r,setOpen:l,refs:{anchorEl:i,floatingEl:s}}=n,{enabled:d=!0,delay:a=0,restMs:h=0,mouseOnly:u=!1,safePolygon:v=!1}=e,p=f.computed(()=>f.toValue(d)),w=f.computed(()=>f.toValue(h)),x=f.computed(()=>{const T=i.value;return!T||T instanceof HTMLElement?T:T.contextElement??null}),{hide:y,show:m,showDelay:C,clearTimeouts:D}=tr(T=>{r.value||l(!0,"hover",T)},T=>{r.value&&l(!1,"hover",T)},{delay:a});let P=null,F;const S=f.computed(()=>C.value===0&&w.value>0);function N(T){if(!p.value||!k(T)||!S.value||!P)return;const L={x:T.clientX,y:T.clientY},z=Math.abs(L.x-P.x),$=Math.abs(L.y-P.y);(z>hn||$>hn)&&(P=L,clearTimeout(F),F=setTimeout(()=>{m(0,T)},w.value))}function W(T){!p.value||!k(T)||!S.value||(P={x:T.clientX,y:T.clientY},F=setTimeout(()=>{m(0,T)},w.value))}function V(){clearTimeout(F),P=null}f.watchPostEffect(()=>{const T=x.value;!T||!p.value||!S.value||(T.addEventListener("pointerenter",W),T.addEventListener("pointermove",N),T.addEventListener("pointerleave",V),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",W),T.removeEventListener("pointermove",N),T.removeEventListener("pointerleave",V)}))}),f.onScopeDispose(()=>{clearTimeout(F)});function k(T){return f.toValue(u)?T.pointerType==="mouse":!0}function K(T){!p.value||!k(T)||S.value||(g(),m(void 0,T))}function I(T){!p.value||!k(T)||(D(),g())}let b=null;function g(){b&&(document.removeEventListener("pointermove",b),b=null);const T=c.value;T!=null&&T.onPolygonChange&&T.onPolygonChange([])}const E=f.computed(()=>!!f.toValue(v)),c=f.computed(()=>{const T=f.toValue(v);if(typeof T=="object"&&T)return T;if(T===!0)return{}});function M(T){var O;if(!p.value||!k(T))return;const{clientX:L,clientY:z}=T,$=T.relatedTarget;if(E.value)setTimeout(()=>{var J;g();const Y=x.value,G=s.value;if(!Y||!G){y(void 0,T);return}let U,oe;if(o){U=new Map;const ne=ge=>{U==null||U.set(ge.id,ge);for(const xe of ge.children.value)ne(xe)};ne(o),oe=o.id}b=er(c.value)({x:L,y:z,placement:n.placement.value,elements:{domReference:Y,floating:G},buffer:((J=c.value)==null?void 0:J.buffer)??1,onClose:()=>{g(),y(void 0)},nodeId:oe,tree:U?{nodes:U}:void 0}),b&&document.addEventListener("pointermove",b)},0);else{if(o){if(!or(o,$))return}else if((O=s.value)!=null&&O.contains($))return;y(void 0,T)}}f.watchPostEffect(()=>{const T=x.value;!T||!p.value||(T.addEventListener("pointerenter",K),T.addEventListener("pointerleave",M),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",K),T.removeEventListener("pointerleave",M)}))}),f.watchPostEffect(()=>{const T=s.value;!T||!p.value||(T.addEventListener("pointerenter",I),T.addEventListener("pointerleave",M),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",I),T.removeEventListener("pointerleave",M)}))}),f.onScopeDispose(()=>{g()})}function or(t,e){return e?!(re(e,t.data.refs.anchorEl.value)||re(e,t.data.refs.floatingEl.value)||lt(t,e)):!0}function rr(t,e,n,o){const r=f.computed(()=>!!f.toValue(o.virtual));f.watch([r,o.open,f.computed(()=>f.toValue(n))],([l,i,s])=>{const d=t.value;if(!d)return;if(!l||!i||s==null){d.removeAttribute("aria-activedescendant");return}const a=e.value[s];a&&(a.id||(a.id=`vfloat-option-${Math.random().toString(16).slice(2,10)}`),d.setAttribute("aria-activedescendant",a.id),o.virtualItemRef&&(o.virtualItemRef.value=a))})}function we(t,e,n){const{items:o,loop:r,allowEscape:l,isVirtual:i,findNextEnabled:s,getFirstEnabledIndex:d,getLastEnabledIndex:a}=n,h=o.length,u=t==null?e===1?0:h-1:t+e;let v=s(u,e,r);if(v==null&&r){if(l&&i)return{type:"navigate",index:null};v=e===1?d():a()}return v!=null?{type:"navigate",index:v}:null}class vn{handleKey(e,n){const{isRtl:o,nested:r}=n;return e==="ArrowDown"?we(n.current,1,n):e==="ArrowUp"?we(n.current,-1,n):r&&e===(o?"ArrowRight":"ArrowLeft")?{type:"close"}:null}}class pn{handleKey(e,n){const{isRtl:o,nested:r}=n;return e==="ArrowRight"?we(n.current,o?-1:1,n):e==="ArrowLeft"?we(n.current,o?1:-1,n):r&&e==="ArrowUp"?{type:"close"}:null}}class wt{constructor(e=!1,n="row"){this.fallbackToLinear=e,this.loopDirection=n}handleKey(e,n){const{current:o,items:r,isDisabled:l,loop:i,allowEscape:s,isVirtual:d,getFirstEnabledIndex:a,getLastEnabledIndex:h,cols:u}=n;if(e==="ArrowRight"||e==="ArrowLeft"){const v=e==="ArrowRight"?1:-1;if(o===null)return we(o,v,n);const p=o+v,w=Math.floor(o/u),x=Math.floor(p/u);if(p>=0&&p<r.length&&w===x&&!l(p))return{type:"navigate",index:p};if(i){if(s&&d){const m=o===0,C=o===r.length-1;if(v===-1&&m||v===1&&C)return{type:"navigate",index:null}}let y;if(this.loopDirection==="next"?v===1?(y=o+1,y>=r.length&&(y=0)):(y=o-1,y<0&&(y=r.length-1)):v===1?y=w*u:y=Math.min((w+1)*u-1,r.length-1),this.loopDirection==="next"){let m=y;for(let C=0;C<r.length;C++){if(!l(m))return{type:"navigate",index:m};if(m+=v,m>=r.length&&(m=0),m<0&&(m=r.length-1),m===y)break}}else{const m=v,C=w*u,D=Math.min((w+1)*u-1,r.length-1);for(;y>=C&&y<=D;){if(!l(y))return{type:"navigate",index:y};if(y+=m,y<C||y>D)break}}}return we(o,v,n)}if(e==="ArrowDown"||e==="ArrowUp"){if(u<=1)return null;const v=e==="ArrowDown"?u:-u,p=v>0?u:-u;let x=(o??(v>0?-u:r.length))+v;for(;x>=0&&x<r.length&&l(x);)x+=p;if(x>=0&&x<r.length)return{type:"navigate",index:x};if(i){if(s&&d)return{type:"navigate",index:null};if(o===null){const C=v>0?a():h();return C!=null?{type:"navigate",index:C}:null}const y=o%u;let m;for(v>0?m=y:(m=(Math.ceil(r.length/u)-1)*u+y,m>=r.length&&(m-=u));m>=0&&m<r.length&&l(m);)m+=p;if(m>=0&&m<r.length)return{type:"navigate",index:m}}if(this.fallbackToLinear)return we(o,e==="ArrowDown"?1:-1,n)}return null}}function ir(t,e){const{floatingContext:n,treeContext:o}=Fe(t),{refs:r,open:l,setOpen:i}=n,{listRef:s,activeIndex:d,onNavigate:a,enabled:h=!0,loop:u=!1,orientation:v="vertical",disabledIndices:p,focusItemOnHover:w=!0,openOnArrowKeyDown:x=!0,scrollItemIntoView:y=!0,selectedIndex:m=null,focusItemOnOpen:C="auto",nested:D=!1,rtl:P=!1,virtual:F=!1,virtualItemRef:S,cols:N=1,allowEscape:W=!1}=e,V={isEnabled:f.computed(()=>f.toValue(h)),anchorEl:f.computed(()=>{const R=r.anchorEl.value;return R instanceof HTMLElement?R:R&&"contextElement"in R&&R.contextElement instanceof HTMLElement?R.contextElement:null}),floatingEl:f.computed(()=>r.floatingEl.value),isVirtual:f.computed(()=>!!f.toValue(F)),isRtl:f.computed(()=>!!f.toValue(P)),gridCols:f.computed(()=>Math.max(1,Number(f.toValue(N)??1)))},{isEnabled:k,anchorEl:K,floatingEl:I,isVirtual:b,isRtl:g,gridCols:E}=V,c=()=>d!==void 0?f.toValue(d):null,M=R=>p?Array.isArray(p)?p.includes(R):!!p(R):!1,T=()=>{const R=s.value;for(let H=0;H<R.length;H++)if(R[H]&&!M(H))return H;return null},L=[],z=R=>(L.push(R),R),$=()=>{var R;for(;L.length;)(R=L.pop())==null||R()},O=()=>{const R=s.value;for(let H=R.length-1;H>=0;H--)if(R[H]&&!M(H))return H;return null};function Y(R,H,B){switch(R){case"vertical":return H;case"horizontal":return B;default:return H||B}}function G(R,H){return Y(H,R==="ArrowUp"||R==="ArrowDown",R==="ArrowLeft"||R==="ArrowRight")}function U(R,H,B){return Y(H,R==="ArrowDown",B?R==="ArrowLeft":R==="ArrowRight")||R==="Enter"||R===" "||R===""}const oe=(R,H,B)=>{const _=s.value,A=_.length;let X=R;for(let Z=0;Z<A;Z++){if(X<0||X>=A){if(!B)return null;X=(X+A)%A}if(_[X]&&!M(X))return X;X+=H}return null},J=(R,H=!1)=>{var _;if(R==null)return;const B=s.value[R];if(B&&!b.value){B.focus({preventScroll:!0});const A=y;!!A&&(H||un.value)&&((_=B.scrollIntoView)==null||_.call(B,typeof A=="boolean"?{block:"nearest",inline:"nearest"}:A))}};let ne=null;const ge=R=>{if(R.defaultPrevented)return;const H=R.target;if(H&&it(H)&&H!==K.value)return;const B=R.key,_=f.toValue(v);if(ne=B,l.value&&b.value){xe(R);return}if(!G(B,_)||l.value||!f.toValue(x))return;R.preventDefault(),i(!0,"keyboard-activate",R);const X=(m!==void 0?f.toValue(m):null)??(U(B,_,g.value)?T():O());X!=null&&(a==null||a(X))},xe=R=>{if(R.defaultPrevented)return;const H=R.key,B=f.toValue(v),_=s.value;if(!_.length)return;if(!b.value){if(H==="Home"){R.preventDefault();const q=T();q!=null&&(a==null||a(q));return}if(H==="End"){R.preventDefault();const q=O();q!=null&&(a==null||a(q));return}}let A;B==="vertical"?A=new vn:B==="horizontal"?A=E.value>1?new wt(!1,f.toValue(e.gridLoopDirection)??"row"):new pn:A=new wt(!0,f.toValue(e.gridLoopDirection)??"row");const X={current:c(),items:_,isRtl:g.value,loop:!!f.toValue(u),allowEscape:!!f.toValue(W),isVirtual:b.value,cols:E.value,nested:!!f.toValue(D),isDisabled:M,findNextEnabled:oe,getFirstEnabledIndex:T,getLastEnabledIndex:O},Z=A.handleKey(H,X);if(Z){if(Z.type==="navigate")R.preventDefault(),a==null||a(Z.index);else if(Z.type==="close"){R.preventDefault(),i(!1,"programmatic",R);const q=o==null?void 0:o.parent.value,se=q==null?void 0:q.data.refs.anchorEl.value;se instanceof HTMLElement?se.focus({preventScroll:!0}):se&&"contextElement"in se&&se.contextElement instanceof HTMLElement&&se.contextElement.focus({preventScroll:!0})}}},tt=f.watch([l,f.computed(()=>c())],([R,H])=>{k.value&&R&&H!=null&&J(H)},{flush:"post"});z(tt),z(Q(()=>k.value?K.value:null,"keydown",ge)),z(Q(()=>k.value?I.value:null,"keydown",xe));const nt=f.watchPostEffect(()=>{if(!k.value||!f.toValue(w))return;const R=I.value;if(!R)return;let H=null,B=null;const _=A=>{if(H===A.clientX&&B===A.clientY)return;H=A.clientX,B=A.clientY;const X=A.target;if(!X)return;const Z=s.value;let q=-1;for(let se=0;se<Z.length;se++){const St=Z[se];if(St&&(St===X||St.contains(X))){q=se;break}}q>=0&&(a==null||a(q))};R.addEventListener("mousemove",_),f.onWatcherCleanup(()=>{R.removeEventListener("mousemove",_)})});z(nt);const Ve=f.ref(!1),ot=f.watch(()=>l.value,R=>{if(k.value){if(R&&!Ve.value){const H=f.toValue(C);if(H===!0||H==="auto"&&ne!=null){const _=(m!==void 0?f.toValue(m):null)??(ne&&U(ne,f.toValue(v),g.value)?T():O());_!=null&&(a==null||a(_),J(_,!0))}}Ve.value=R}},{flush:"post",immediate:!0});return z(ot),rr(K,s,f.computed(()=>c()),{virtual:F,open:l,virtualItemRef:S}),{cleanup:$}}/*!
|
|
2
|
-
* tabbable 6.3.0
|
|
3
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
-
*/var mn=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Ge=mn.join(","),gn=typeof Element>"u",ye=gn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ze=!gn&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t==null?void 0:t.ownerDocument},ke=function(e,n){var o;n===void 0&&(n=!0);var r=e==null||(o=e.getAttribute)===null||o===void 0?void 0:o.call(e,"inert"),l=r===""||r==="true",i=l||n&&e&&ke(e.parentNode);return i},ar=function(e){var n,o=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return o===""||o==="true"},bn=function(e,n,o){if(ke(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Ge));return n&&ye.call(e,Ge)&&r.unshift(e),r=r.filter(o),r},Je=function(e,n,o){for(var r=[],l=Array.from(e);l.length;){var i=l.shift();if(!ke(i,!1))if(i.tagName==="SLOT"){var s=i.assignedElements(),d=s.length?s:i.children,a=Je(d,!0,o);o.flatten?r.push.apply(r,a):r.push({scopeParent:i,candidates:a})}else{var h=ye.call(i,Ge);h&&o.filter(i)&&(n||!e.includes(i))&&r.push(i);var u=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),v=!ke(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(u&&v){var p=Je(u===!0?i.children:u.children,!0,o);o.flatten?r.push.apply(r,p):r.push({scopeParent:i,candidates:p})}else l.unshift.apply(l,i.children)}}return r},wn=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ee=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ar(e))&&!wn(e)?0:e.tabIndex},lr=function(e,n){var o=Ee(e);return o<0&&n&&!wn(e)?0:o},sr=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},yn=function(e){return e.tagName==="INPUT"},cr=function(e){return yn(e)&&e.type==="hidden"},ur=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"});return n},fr=function(e,n){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===n)return e[o]},dr=function(e){if(!e.name)return!0;var n=e.form||Ze(e),o=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(e.name));else try{r=o(e.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var l=fr(r,e.form);return!l||l===e},hr=function(e){return yn(e)&&e.type==="radio"},vr=function(e){return hr(e)&&!dr(e)},pr=function(e){var n,o=e&&Ze(e),r=(n=o)===null||n===void 0?void 0:n.host,l=!1;if(o&&o!==e){var i,s,d;for(l=!!((i=r)!==null&&i!==void 0&&(s=i.ownerDocument)!==null&&s!==void 0&&s.contains(r)||e!=null&&(d=e.ownerDocument)!==null&&d!==void 0&&d.contains(e));!l&&r;){var a,h,u;o=Ze(r),r=(a=o)===null||a===void 0?void 0:a.host,l=!!((h=r)!==null&&h!==void 0&&(u=h.ownerDocument)!==null&&u!==void 0&&u.contains(r))}}return l},En=function(e){var n=e.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},mr=function(e,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in e){var l=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!l}if(getComputedStyle(e).visibility==="hidden")return!0;var i=ye.call(e,"details>summary:first-of-type"),s=i?e.parentElement:e;if(ye.call(s,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var d=e;e;){var a=e.parentElement,h=Ze(e);if(a&&!a.shadowRoot&&r(a)===!0)return En(e);e.assignedSlot?e=e.assignedSlot:!a&&h!==e.ownerDocument?e=h.host:e=a}e=d}if(pr(e))return!e.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return En(e);return!1},gr=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return ye.call(n,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}n=n.parentElement}return!1},Qe=function(e,n){return!(n.disabled||ke(n)||cr(n)||mr(n,e)||ur(n)||gr(n))},yt=function(e,n){return!(vr(n)||Ee(n)<0||!Qe(e,n))},br=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Tn=function(e){var n=[],o=[];return e.forEach(function(r,l){var i=!!r.scopeParent,s=i?r.scopeParent:r,d=lr(s,i),a=i?Tn(r.candidates):s;d===0?i?n.push.apply(n,a):n.push(s):o.push({documentOrder:l,tabIndex:d,item:r,isScope:i,content:a})}),o.sort(sr).reduce(function(r,l){return l.isScope?r.push.apply(r,l.content):r.push(l.content),r},[]).concat(n)},wr=function(e,n){n=n||{};var o;return n.getShadowRoot?o=Je([e],n.includeContainer,{filter:yt.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:br}):o=bn(e,n.includeContainer,yt.bind(null,n)),Tn(o)},yr=function(e,n){n=n||{};var o;return n.getShadowRoot?o=Je([e],n.includeContainer,{filter:Qe.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=bn(e,n.includeContainer,Qe.bind(null,n)),o},De=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return ye.call(e,Ge)===!1?!1:yt(n,e)},Er=mn.concat("iframe").join(","),Et=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return ye.call(e,Er)===!1?!1:Qe(n,e)};/*!
|
|
5
|
-
* focus-trap 7.6.6
|
|
6
|
-
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
7
|
-
*/function Tt(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function Tr(t){if(Array.isArray(t))return Tt(t)}function xr(t,e,n){return(e=Pr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Cr(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Sr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
8
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Cn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?xn(Object(n),!0).forEach(function(o){xr(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xn(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function Or(t){return Tr(t)||Cr(t)||Dr(t)||Sr()}function Ar(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Pr(t){var e=Ar(t,"string");return typeof e=="symbol"?e:e+""}function Dr(t,e){if(t){if(typeof t=="string")return Tt(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(t,e):void 0}}var Sn={activateTrap:function(e,n){if(e.length>0){var o=e[e.length-1];o!==n&&o._setPausedState(!0)}var r=e.indexOf(n);r===-1||e.splice(r,1),e.push(n)},deactivateTrap:function(e,n){var o=e.indexOf(n);o!==-1&&e.splice(o,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)}},Nr=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Fr=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},Me=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},Rr=function(e){return Me(e)&&!e.shiftKey},Lr=function(e){return Me(e)&&e.shiftKey},On=function(e){return setTimeout(e,0)},Ie=function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return typeof e=="function"?e.apply(void 0,o):e},et=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},kr=[],Mr=function(e,n){var o=(n==null?void 0:n.document)||document,r=(n==null?void 0:n.trapStack)||kr,l=Cn({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Rr,isKeyBackward:Lr},n),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s,d=function(b,g,E){return b&&b[g]!==void 0?b[g]:l[E||g]},a=function(b,g){var E=typeof(g==null?void 0:g.composedPath)=="function"?g.composedPath():void 0;return i.containerGroups.findIndex(function(c){var M=c.container,T=c.tabbableNodes;return M.contains(b)||(E==null?void 0:E.includes(M))||T.find(function(L){return L===b})})},h=function(b){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=g.hasFallback,c=E===void 0?!1:E,M=g.params,T=M===void 0?[]:M,L=l[b];if(typeof L=="function"&&(L=L.apply(void 0,Or(T))),L===!0&&(L=void 0),!L){if(L===void 0||L===!1)return L;throw new Error("`".concat(b,"` was specified but was not a node, or did not return a node"))}var z=L;if(typeof L=="string"){try{z=o.querySelector(L)}catch($){throw new Error("`".concat(b,'` appears to be an invalid selector; error="').concat($.message,'"'))}if(!z&&!c)throw new Error("`".concat(b,"` as selector refers to no known node"))}return z},u=function(){var b=h("initialFocus",{hasFallback:!0});if(b===!1)return!1;if(b===void 0||b&&!Et(b,l.tabbableOptions))if(a(o.activeElement)>=0)b=o.activeElement;else{var g=i.tabbableGroups[0],E=g&&g.firstTabbableNode;b=E||h("fallbackFocus")}else b===null&&(b=h("fallbackFocus"));if(!b)throw new Error("Your focus-trap needs to have at least one focusable element");return b},v=function(){if(i.containerGroups=i.containers.map(function(b){var g=wr(b,l.tabbableOptions),E=yr(b,l.tabbableOptions),c=g.length>0?g[0]:void 0,M=g.length>0?g[g.length-1]:void 0,T=E.find(function($){return De($)}),L=E.slice().reverse().find(function($){return De($)}),z=!!g.find(function($){return Ee($)>0});return{container:b,tabbableNodes:g,focusableNodes:E,posTabIndexesFound:z,firstTabbableNode:c,lastTabbableNode:M,firstDomTabbableNode:T,lastDomTabbableNode:L,nextTabbableNode:function(O){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,G=g.indexOf(O);return G<0?Y?E.slice(E.indexOf(O)+1).find(function(U){return De(U)}):E.slice(0,E.indexOf(O)).reverse().find(function(U){return De(U)}):g[G+(Y?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(b){return b.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!h("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(b){return b.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function(b){var g=b.activeElement;if(g)return g.shadowRoot&&g.shadowRoot.activeElement!==null?p(g.shadowRoot):g},w=function(b){if(b!==!1&&b!==p(document)){if(!b||!b.focus){w(u());return}b.focus({preventScroll:!!l.preventScroll}),i.mostRecentlyFocusedNode=b,Nr(b)&&b.select()}},x=function(b){var g=h("setReturnFocus",{params:[b]});return g||(g===!1?!1:b)},y=function(b){var g=b.target,E=b.event,c=b.isBackward,M=c===void 0?!1:c;g=g||et(E),v();var T=null;if(i.tabbableGroups.length>0){var L=a(g,E),z=L>=0?i.containerGroups[L]:void 0;if(L<0)M?T=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:T=i.tabbableGroups[0].firstTabbableNode;else if(M){var $=i.tabbableGroups.findIndex(function(J){var ne=J.firstTabbableNode;return g===ne});if($<0&&(z.container===g||Et(g,l.tabbableOptions)&&!De(g,l.tabbableOptions)&&!z.nextTabbableNode(g,!1))&&($=L),$>=0){var O=$===0?i.tabbableGroups.length-1:$-1,Y=i.tabbableGroups[O];T=Ee(g)>=0?Y.lastTabbableNode:Y.lastDomTabbableNode}else Me(E)||(T=z.nextTabbableNode(g,!1))}else{var G=i.tabbableGroups.findIndex(function(J){var ne=J.lastTabbableNode;return g===ne});if(G<0&&(z.container===g||Et(g,l.tabbableOptions)&&!De(g,l.tabbableOptions)&&!z.nextTabbableNode(g))&&(G=L),G>=0){var U=G===i.tabbableGroups.length-1?0:G+1,oe=i.tabbableGroups[U];T=Ee(g)>=0?oe.firstTabbableNode:oe.firstDomTabbableNode}else Me(E)||(T=z.nextTabbableNode(g))}}else T=h("fallbackFocus");return T},m=function(b){var g=et(b);if(!(a(g,b)>=0)){if(Ie(l.clickOutsideDeactivates,b)){s.deactivate({returnFocus:l.returnFocusOnDeactivate});return}Ie(l.allowOutsideClick,b)||b.preventDefault()}},C=function(b){var g=et(b),E=a(g,b)>=0;if(E||g instanceof Document)E&&(i.mostRecentlyFocusedNode=g);else{b.stopImmediatePropagation();var c,M=!0;if(i.mostRecentlyFocusedNode)if(Ee(i.mostRecentlyFocusedNode)>0){var T=a(i.mostRecentlyFocusedNode),L=i.containerGroups[T].tabbableNodes;if(L.length>0){var z=L.findIndex(function($){return $===i.mostRecentlyFocusedNode});z>=0&&(l.isKeyForward(i.recentNavEvent)?z+1<L.length&&(c=L[z+1],M=!1):z-1>=0&&(c=L[z-1],M=!1))}}else i.containerGroups.some(function($){return $.tabbableNodes.some(function(O){return Ee(O)>0})})||(M=!1);else M=!1;M&&(c=y({target:i.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(i.recentNavEvent)})),w(c||i.mostRecentlyFocusedNode||u())}i.recentNavEvent=void 0},D=function(b){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=b;var E=y({event:b,isBackward:g});E&&(Me(b)&&b.preventDefault(),w(E))},P=function(b){(l.isKeyForward(b)||l.isKeyBackward(b))&&D(b,l.isKeyBackward(b))},F=function(b){Fr(b)&&Ie(l.escapeDeactivates,b)!==!1&&(b.preventDefault(),s.deactivate())},S=function(b){var g=et(b);a(g,b)>=0||Ie(l.clickOutsideDeactivates,b)||Ie(l.allowOutsideClick,b)||(b.preventDefault(),b.stopImmediatePropagation())},N=function(){if(i.active)return Sn.activateTrap(r,s),i.delayInitialFocusTimer=l.delayInitialFocus?On(function(){w(u())}):w(u()),o.addEventListener("focusin",C,!0),o.addEventListener("mousedown",m,{capture:!0,passive:!1}),o.addEventListener("touchstart",m,{capture:!0,passive:!1}),o.addEventListener("click",S,{capture:!0,passive:!1}),o.addEventListener("keydown",P,{capture:!0,passive:!1}),o.addEventListener("keydown",F),s},W=function(){if(i.active)return o.removeEventListener("focusin",C,!0),o.removeEventListener("mousedown",m,!0),o.removeEventListener("touchstart",m,!0),o.removeEventListener("click",S,!0),o.removeEventListener("keydown",P,!0),o.removeEventListener("keydown",F),s},V=function(b){var g=b.some(function(E){var c=Array.from(E.removedNodes);return c.some(function(M){return M===i.mostRecentlyFocusedNode})});g&&w(u())},k=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(V):void 0,K=function(){k&&(k.disconnect(),i.active&&!i.paused&&i.containers.map(function(b){k.observe(b,{subtree:!0,childList:!0})}))};return s={get active(){return i.active},get paused(){return i.paused},activate:function(b){if(i.active)return this;var g=d(b,"onActivate"),E=d(b,"onPostActivate"),c=d(b,"checkCanFocusTrap");c||v(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=p(o),g==null||g();var M=function(){c&&v(),N(),K(),E==null||E()};return c?(c(i.containers.concat()).then(M,M),this):(M(),this)},deactivate:function(b){if(!i.active)return this;var g=Cn({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},b);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,W(),i.active=!1,i.paused=!1,K(),Sn.deactivateTrap(r,s);var E=d(g,"onDeactivate"),c=d(g,"onPostDeactivate"),M=d(g,"checkCanReturnFocus"),T=d(g,"returnFocus","returnFocusOnDeactivate");E==null||E();var L=function(){On(function(){T&&w(x(i.nodeFocusedBeforeActivation)),c==null||c()})};return T&&M?(M(x(i.nodeFocusedBeforeActivation)).then(L,L),this):(L(),this)},pause:function(b){return i.active?(i.manuallyPaused=!0,this._setPausedState(!0,b)):this},unpause:function(b){return i.active?(i.manuallyPaused=!1,r[r.length-1]!==this?this:this._setPausedState(!1,b)):this},updateContainerElements:function(b){var g=[].concat(b).filter(Boolean);return i.containers=g.map(function(E){return typeof E=="string"?o.querySelector(E):E}),i.active&&v(),K(),this}},Object.defineProperties(s,{_isManuallyPaused:{value:function(){return i.manuallyPaused}},_setPausedState:{value:function(b,g){if(i.paused===b)return this;if(i.paused=b,b){var E=d(g,"onPause"),c=d(g,"onPostPause");E==null||E(),W(),K(),c==null||c()}else{var M=d(g,"onUnpause"),T=d(g,"onPostUnpause");M==null||M(),v(),N(),K(),T==null||T()}return this}}}),s.updateContainerElements(e),s};const xt=new WeakMap,Ct=new WeakMap,Ir=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function Vr(t,e={}){const{floatingContext:n}=Fe(t),{refs:{floatingEl:o},open:r,setOpen:l}=n,{enabled:i=!0,modal:s=!1,initialFocus:d,returnFocus:a=!0,closeOnFocusOut:h=!1,preventScroll:u=!0,outsideElementsInert:v=!1,onError:p}=e,w=f.computed(()=>!!f.toValue(i)),x=f.computed(()=>!!f.toValue(s)),y=f.computed(()=>!x.value&&!!f.toValue(h)),m=f.computed(()=>!!f.toValue(v)),C=f.shallowRef(null),D=f.computed(()=>C.value!==null);let P=null,F=!1;function S(V){if(!x.value)return()=>{};const k=(V.ownerDocument??document).body,I=Array.from(k.children).filter(g=>!(g===V||V.contains(g)||g.contains(V))),b=m.value&&Ir;for(const g of I)b?(Ct.set(g,g.inert??null),g.inert=!0):(xt.set(g,g.getAttribute("aria-hidden")),g.setAttribute("aria-hidden","true"));return()=>{for(const g of I)if(b){const E=Ct.get(g);g.inert=E??!1,Ct.delete(g)}else{const E=xt.get(g);E==null?g.removeAttribute("aria-hidden"):g.setAttribute("aria-hidden",E),xt.delete(g)}}}const N=()=>{if(!(F||!C.value)){F=!0;try{C.value.deactivate(),C.value=null}finally{F=!1}}},W=()=>{N();const V=o.value;if(V){C.value=Mr(V,{onActivate:()=>{P=S(V)},onDeactivate:()=>{P&&(P(),P=null),y.value&&l(!1)},initialFocus:()=>typeof d=="function"?d():d,fallbackFocus:()=>V,returnFocusOnDeactivate:f.toValue(a),clickOutsideDeactivates:y.value,allowOutsideClick:!x.value,escapeDeactivates:!1,preventScroll:f.toValue(u),tabbableOptions:{displayCheck:"none"}});try{C.value.activate()}catch(k){P&&(P(),P=null),C.value=null,p&&p(k)}}};return f.watchPostEffect(()=>{w.value&&r.value&&o.value?W():N()}),f.onScopeDispose(()=>{N()}),{isActive:D,activate:W,deactivate:N}}j.FollowTracker=Lt,j.GridNavigationStrategy=wt,j.HorizontalNavigationStrategy=pn,j.StaticTracker=kt,j.TrackingStrategy=st,j.VerticalNavigationStrategy=vn,j.VirtualElementFactory=He,j.arrow=rn,j.autoPlacement=Do,j.createTree=cn,j.createTreeNode=gt,j.flip=Fo,j.hide=Lo,j.offset=Po,j.shift=No,j.size=Ro,j.useArrow=Ce,j.useClick=_o,j.useClientPoint=kn,j.useEscapeKey=Yo,j.useFloating=an,j.useFloatingTree=Io,j.useFocus=Go,j.useFocusTrap=Vr,j.useHover=nr,j.useListNavigation=ir,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})}));
|