import{r as C,b as xe,j}from"./app-47e95562.js";import{P as ht}from"./index-ffe6cfc0.js";import{u as Vt}from"./index-42b8eec9.js";import{c as ye,b as ve,d as Dt}from"./index-8528199c.js";import{u as be}from"./index-0b8e1c04.js";const Ae=["top","right","bottom","left"],X=Math.min,k=Math.max,lt=Math.round,st=Math.floor,q=t=>({x:t,y:t}),Re={left:"right",right:"left",bottom:"top",top:"bottom"},Ce={start:"end",end:"start"};function mt(t,e,n){return k(t,X(e,n))}function V(t,e){return typeof t=="function"?t(e):t}function I(t){return t.split("-")[0]}function J(t){return t.split("-")[1]}function wt(t){return t==="x"?"y":"x"}function xt(t){return t==="y"?"height":"width"}function Q(t){return["top","bottom"].includes(I(t))?"y":"x"}function yt(t){return wt(Q(t))}function Pe(t,e,n){n===void 0&&(n=!1);const o=J(t),i=yt(t),r=xt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=at(s)),[s,at(s)]}function Oe(t){const e=at(t);return[gt(t),e,gt(e)]}function gt(t){return t.replace(/start|end/g,e=>Ce[e])}function Ee(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:s;default:return[]}}function Se(t,e,n,o){const i=J(t);let r=Ee(I(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(gt)))),r}function at(t){return t.replace(/left|right|bottom|top/g,e=>Re[e])}function Te(t){return{top:0,right:0,bottom:0,left:0,...t}}function It(t){return typeof t!="number"?Te(t):{top:t,right:t,bottom:t,left:t}}function ft(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function kt(t,e,n){let{reference:o,floating:i}=t;const r=Q(e),s=yt(e),l=xt(s),c=I(e),a=r==="y",p=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,m=o[l]/2-i[l]/2;let f;switch(c){case"top":f={x:p,y:o.y-i.height};break;case"bottom":f={x:p,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(J(e)){case"start":f[s]-=m*(n&&a?-1:1);break;case"end":f[s]+=m*(n&&a?-1:1);break}return f}const Me=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:d}=kt(a,o,c),m=o,f={},u=0;for(let g=0;g<l.length;g++){const{name:w,fn:h}=l[g],{x,y:A,data:y,reset:v}=await h({x:p,y:d,initialPlacement:o,placement:m,strategy:i,middlewareData:f,rects:a,platform:s,elements:{reference:t,floating:e}});if(p=x??p,d=A??d,f={...f,[w]:{...f[w],...y}},v&&u<=50){u++,typeof v=="object"&&(v.placement&&(m=v.placement),v.rects&&(a=v.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:p,y:d}=kt(a,m,c)),g=-1;continue}}return{x:p,y:d,placement:m,strategy:i,middlewareData:f}};async function et(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:p="viewport",elementContext:d="floating",altBoundary:m=!1,padding:f=0}=V(e,t),u=It(f),w=l[m?d==="floating"?"reference":"floating":d],h=ft(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(w)))==null||n?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:a,rootBoundary:p,strategy:c})),x=d==="floating"?{...s.floating,x:o,y:i}:s.reference,A=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),y=await(r.isElement==null?void 0:r.isElement(A))?await(r.getScale==null?void 0:r.getScale(A))||{x:1,y:1}:{x:1,y:1},v=ft(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:A,strategy:c}):x);return{top:(h.top-v.top+u.top)/y.y,bottom:(v.bottom-h.bottom+u.bottom)/y.y,left:(h.left-v.left+u.left)/y.x,right:(v.right-h.right+u.right)/y.x}}const Nt=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:l,middlewareData:c}=e,{element:a,padding:p=0}=V(t,e)||{};if(a==null)return{};const d=It(p),m={x:n,y:o},f=yt(i),u=xt(f),g=await s.getDimensions(a),w=f==="y",h=w?"top":"left",x=w?"bottom":"right",A=w?"clientHeight":"clientWidth",y=r.reference[u]+r.reference[f]-m[f]-r.floating[u],v=m[f]-r.reference[f],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let P=b?b[A]:0;(!P||!await(s.isElement==null?void 0:s.isElement(b)))&&(P=l.floating[A]||r.floating[u]);const S=y/2-v/2,F=P/2-g[u]/2-1,$=X(d[h],F),H=X(d[x],F),E=$,L=P-g[u]-H,T=P/2-g[u]/2+S,O=mt(E,T,L),M=!c.arrow&&J(i)!=null&&T!=O&&r.reference[u]/2-(T<E?$:H)-g[u]/2<0,R=M?T<E?T-E:T-L:0;return{[f]:m[f]+R,data:{[f]:O,centerOffset:T-O-R,...M&&{alignmentOffset:R}},reset:M}}}),Le=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:c,elements:a}=e,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:g=!0,...w}=V(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const h=I(i),x=I(l)===l,A=await(c.isRTL==null?void 0:c.isRTL(a.floating)),y=m||(x||!g?[at(l)]:Oe(l));!m&&u!=="none"&&y.push(...Se(l,g,u,A));const v=[l,...y],b=await et(e,w),P=[];let S=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&P.push(b[h]),d){const E=Pe(i,s,A);P.push(b[E[0]],b[E[1]])}if(S=[...S,{placement:i,overflows:P}],!P.every(E=>E<=0)){var F,$;const E=(((F=r.flip)==null?void 0:F.index)||0)+1,L=v[E];if(L)return{data:{index:E,overflows:S},reset:{placement:L}};let T=($=S.filter(O=>O.overflows[0]<=0).sort((O,M)=>O.overflows[1]-M.overflows[1])[0])==null?void 0:$.placement;if(!T)switch(f){case"bestFit":{var H;const O=(H=S.map(M=>[M.placement,M.overflows.filter(R=>R>0).reduce((R,D)=>R+D,0)]).sort((M,R)=>M[1]-R[1])[0])==null?void 0:H[0];O&&(T=O);break}case"initialPlacement":T=l;break}if(i!==T)return{reset:{placement:T}}}return{}}}};function Ft(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ht(t){return Ae.some(e=>t[e]>=0)}const De=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=V(t,e);switch(o){case"referenceHidden":{const r=await et(e,{...i,elementContext:"reference"}),s=Ft(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Ht(s)}}}case"escaped":{const r=await et(e,{...i,altBoundary:!0}),s=Ft(r,n.floating);return{data:{escapedOffsets:s,escaped:Ht(s)}}}default:return{}}}}};async function ke(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=I(n),l=J(n),c=Q(n)==="y",a=["left","top"].includes(s)?-1:1,p=r&&c?-1:1,d=V(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:u}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return l&&typeof u=="number"&&(f=l==="end"?u*-1:u),c?{x:f*p,y:m*a}:{x:m*a,y:f*p}}const Ne=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:o}=e,i=await ke(e,t);return{x:n+i.x,y:o+i.y,data:i}}}},Fe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:l={fn:w=>{let{x:h,y:x}=w;return{x:h,y:x}}},...c}=V(t,e),a={x:n,y:o},p=await et(e,c),d=Q(I(i)),m=wt(d);let f=a[m],u=a[d];if(r){const w=m==="y"?"top":"left",h=m==="y"?"bottom":"right",x=f+p[w],A=f-p[h];f=mt(x,f,A)}if(s){const w=d==="y"?"top":"left",h=d==="y"?"bottom":"right",x=u+p[w],A=u-p[h];u=mt(x,u,A)}const g=l.fn({...e,[m]:f,[d]:u});return{...g,data:{x:g.x-n,y:g.y-o}}}}},He=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:l=0,mainAxis:c=!0,crossAxis:a=!0}=V(t,e),p={x:n,y:o},d=Q(i),m=wt(d);let f=p[m],u=p[d];const g=V(l,e),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const A=m==="y"?"height":"width",y=r.reference[m]-r.floating[A]+w.mainAxis,v=r.reference[m]+r.reference[A]-w.mainAxis;f<y?f=y:f>v&&(f=v)}if(a){var h,x;const A=m==="y"?"width":"height",y=["top","left"].includes(I(i)),v=r.reference[d]-r.floating[A]+(y&&((h=s.offset)==null?void 0:h[d])||0)+(y?0:w.crossAxis),b=r.reference[d]+r.reference[A]+(y?0:((x=s.offset)==null?void 0:x[d])||0)-(y?w.crossAxis:0);u<v?u=v:u>b&&(u=b)}return{[m]:f,[d]:u}}}},We=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:i,elements:r}=e,{apply:s=()=>{},...l}=V(t,e),c=await et(e,l),a=I(n),p=J(n),d=Q(n)==="y",{width:m,height:f}=o.floating;let u,g;a==="top"||a==="bottom"?(u=a,g=p===(await(i.isRTL==null?void 0:i.isRTL(r.floating))?"start":"end")?"left":"right"):(g=a,u=p==="end"?"top":"bottom");const w=f-c[u],h=m-c[g],x=!e.middlewareData.shift;let A=w,y=h;if(d){const b=m-c.left-c.right;y=p||x?X(h,b):b}else{const b=f-c.top-c.bottom;A=p||x?X(w,b):b}if(x&&!p){const b=k(c.left,0),P=k(c.right,0),S=k(c.top,0),F=k(c.bottom,0);d?y=m-2*(b!==0||P!==0?b+P:k(c.left,c.right)):A=f-2*(S!==0||F!==0?S+F:k(c.top,c.bottom))}await s({...e,availableWidth:y,availableHeight:A});const v=await i.getDimensions(r.floating);return m!==v.width||f!==v.height?{reset:{rects:!0}}:{}}}};function U(t){return zt(t)?(t.nodeName||"").toLowerCase():"#document"}function N(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(zt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function zt(t){return t instanceof Node||t instanceof N(t).Node}function z(t){return t instanceof Element||t instanceof N(t).Element}function B(t){return t instanceof HTMLElement||t instanceof N(t).HTMLElement}function Wt(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof N(t).ShadowRoot}function ot(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=W(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function $e(t){return["table","td","th"].includes(U(t))}function vt(t){const e=bt(),n=W(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Be(t){let e=G(t);for(;B(e)&&!dt(e);){if(vt(e))return e;e=G(e)}return null}function bt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function dt(t){return["html","body","#document"].includes(U(t))}function W(t){return N(t).getComputedStyle(t)}function pt(t){return z(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function G(t){if(U(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Wt(t)&&t.host||Y(t);return Wt(e)?e.host:e}function Yt(t){const e=G(t);return dt(e)?t.ownerDocument?t.ownerDocument.body:t.body:B(e)&&ot(e)?e:Yt(e)}function nt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Yt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=N(i);return r?e.concat(s,s.visualViewport||[],ot(i)?i:[],s.frameElement&&n?nt(s.frameElement):[]):e.concat(i,nt(i,[],n))}function Xt(t){const e=W(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=B(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=lt(n)!==r||lt(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function At(t){return z(t)?t:t.contextElement}function K(t){const e=At(t);if(!B(e))return q(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Xt(e);let s=(r?lt(n.width):n.width)/o,l=(r?lt(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const _e=q(0);function qt(t){const e=N(t);return!bt()||!e.visualViewport?_e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function je(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==N(t)?!1:e}function Z(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=At(t);let s=q(1);e&&(o?z(o)&&(s=K(o)):s=K(t));const l=je(r,n,o)?qt(r):q(0);let c=(i.left+l.x)/s.x,a=(i.top+l.y)/s.y,p=i.width/s.x,d=i.height/s.y;if(r){const m=N(r),f=o&&z(o)?N(o):o;let u=m.frameElement;for(;u&&o&&f!==m;){const g=K(u),w=u.getBoundingClientRect(),h=W(u),x=w.left+(u.clientLeft+parseFloat(h.paddingLeft))*g.x,A=w.top+(u.clientTop+parseFloat(h.paddingTop))*g.y;c*=g.x,a*=g.y,p*=g.x,d*=g.y,c+=x,a+=A,u=N(u).frameElement}}return ft({width:p,height:d,x:c,y:a})}function Ve(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=B(n),r=Y(n);if(n===r)return e;let s={scrollLeft:0,scrollTop:0},l=q(1);const c=q(0);if((i||!i&&o!=="fixed")&&((U(n)!=="body"||ot(r))&&(s=pt(n)),B(n))){const a=Z(n);l=K(n),c.x=a.x+n.clientLeft,c.y=a.y+n.clientTop}return{width:e.width*l.x,height:e.height*l.y,x:e.x*l.x-s.scrollLeft*l.x+c.x,y:e.y*l.y-s.scrollTop*l.y+c.y}}function Ie(t){return Array.from(t.getClientRects())}function Ut(t){return Z(Y(t)).left+pt(t).scrollLeft}function ze(t){const e=Y(t),n=pt(t),o=t.ownerDocument.body,i=k(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=k(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ut(t);const l=-n.scrollTop;return W(o).direction==="rtl"&&(s+=k(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}function Ye(t,e){const n=N(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,c=0;if(i){r=i.width,s=i.height;const a=bt();(!a||a&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:r,height:s,x:l,y:c}}function Xe(t,e){const n=Z(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=B(t)?K(t):q(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,c=i*r.x,a=o*r.y;return{width:s,height:l,x:c,y:a}}function $t(t,e,n){let o;if(e==="viewport")o=Ye(t,n);else if(e==="document")o=ze(Y(t));else if(z(e))o=Xe(e,n);else{const i=qt(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return ft(o)}function Zt(t,e){const n=G(t);return n===e||!z(n)||dt(n)?!1:W(n).position==="fixed"||Zt(n,e)}function qe(t,e){const n=e.get(t);if(n)return n;let o=nt(t,[],!1).filter(l=>z(l)&&U(l)!=="body"),i=null;const r=W(t).position==="fixed";let s=r?G(t):t;for(;z(s)&&!dt(s);){const l=W(s),c=vt(s);!c&&l.position==="fixed"&&(i=null),(r?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ot(s)&&!c&&Zt(t,s))?o=o.filter(p=>p!==s):i=l,s=G(s)}return e.set(t,o),o}function Ue(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?qe(e,this._c):[].concat(n),o],l=s[0],c=s.reduce((a,p)=>{const d=$t(e,p,i);return a.top=k(d.top,a.top),a.right=X(d.right,a.right),a.bottom=X(d.bottom,a.bottom),a.left=k(d.left,a.left),a},$t(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ze(t){return Xt(t)}function Ke(t,e,n){const o=B(e),i=Y(e),r=n==="fixed",s=Z(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const c=q(0);if(o||!o&&!r)if((U(e)!=="body"||ot(i))&&(l=pt(e)),o){const a=Z(e,!0,r,e);c.x=a.x+e.clientLeft,c.y=a.y+e.clientTop}else i&&(c.x=Ut(i));return{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function Bt(t,e){return!B(t)||W(t).position==="fixed"?null:e?e(t):t.offsetParent}function Kt(t,e){const n=N(t);if(!B(t))return n;let o=Bt(t,e);for(;o&&$e(o)&&W(o).position==="static";)o=Bt(o,e);return o&&(U(o)==="html"||U(o)==="body"&&W(o).position==="static"&&!vt(o))?n:o||Be(t)||n}const Ge=async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||Kt,r=this.getDimensions;return{reference:Ke(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}};function Je(t){return W(t).direction==="rtl"}const Qe={convertOffsetParentRelativeRectToViewportRelativeRect:Ve,getDocumentElement:Y,getClippingRect:Ue,getOffsetParent:Kt,getElementRects:Ge,getClientRects:Ie,getDimensions:Ze,getScale:K,isElement:z,isRTL:Je};function tn(t,e){let n=null,o;const i=Y(t);function r(){clearTimeout(o),n&&n.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),r();const{left:a,top:p,width:d,height:m}=t.getBoundingClientRect();if(l||e(),!d||!m)return;const f=st(p),u=st(i.clientWidth-(a+d)),g=st(i.clientHeight-(p+m)),w=st(a),x={rootMargin:-f+"px "+-u+"px "+-g+"px "+-w+"px",threshold:k(0,X(1,c))||1};let A=!0;function y(v){const b=v[0].intersectionRatio;if(b!==c){if(!A)return s();b?s(!1,b):o=setTimeout(()=>{s(!1,1e-7)},100)}A=!1}try{n=new IntersectionObserver(y,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(y,x)}n.observe(t)}return s(!0),r}function en(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,a=At(t),p=i||r?[...a?nt(a):[],...nt(e)]:[];p.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),r&&h.addEventListener("resize",n)});const d=a&&l?tn(a,n):null;let m=-1,f=null;s&&(f=new ResizeObserver(h=>{let[x]=h;x&&x.target===a&&f&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{f&&f.observe(e)})),n()}),a&&!c&&f.observe(a),f.observe(e));let u,g=c?Z(t):null;c&&w();function w(){const h=Z(t);g&&(h.x!==g.x||h.y!==g.y||h.width!==g.width||h.height!==g.height)&&n(),g=h,u=requestAnimationFrame(w)}return n(),()=>{p.forEach(h=>{i&&h.removeEventListener("scroll",n),r&&h.removeEventListener("resize",n)}),d&&d(),f&&f.disconnect(),f=null,c&&cancelAnimationFrame(u)}}const nn=(t,e,n)=>{const o=new Map,i={platform:Qe,...n},r={...i.platform,_c:o};return Me(t,e,{...i,platform:r})};var ct=typeof document<"u"?C.useLayoutEffect:C.useEffect;function ut(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!ut(t[o],e[o]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,i[o]))return!1;for(o=n;o--!==0;){const r=i[o];if(!(r==="_owner"&&t.$$typeof)&&!ut(t[r],e[r]))return!1}return!0}return t!==t&&e!==e}function Gt(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function _t(t,e){const n=Gt(t);return Math.round(e*n)/n}function jt(t){const e=C.useRef(t);return ct(()=>{e.current=t}),e}function on(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:r,floating:s}={},transform:l=!0,whileElementsMounted:c,open:a}=t,[p,d]=C.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[m,f]=C.useState(o);ut(m,o)||f(o);const[u,g]=C.useState(null),[w,h]=C.useState(null),x=C.useCallback(R=>{R!==b.current&&(b.current=R,g(R))},[]),A=C.useCallback(R=>{R!==P.current&&(P.current=R,h(R))},[]),y=r||u,v=s||w,b=C.useRef(null),P=C.useRef(null),S=C.useRef(p),F=c!=null,$=jt(c),H=jt(i),E=C.useCallback(()=>{if(!b.current||!P.current)return;const R={placement:e,strategy:n,middleware:m};H.current&&(R.platform=H.current),nn(b.current,P.current,R).then(D=>{const _={...D,isPositioned:!0};L.current&&!ut(S.current,_)&&(S.current=_,xe.flushSync(()=>{d(_)}))})},[m,e,n,H]);ct(()=>{a===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,d(R=>({...R,isPositioned:!1})))},[a]);const L=C.useRef(!1);ct(()=>(L.current=!0,()=>{L.current=!1}),[]),ct(()=>{if(y&&(b.current=y),v&&(P.current=v),y&&v){if($.current)return $.current(y,v,E);E()}},[y,v,E,$,F]);const T=C.useMemo(()=>({reference:b,floating:P,setReference:x,setFloating:A}),[x,A]),O=C.useMemo(()=>({reference:y,floating:v}),[y,v]),M=C.useMemo(()=>{const R={position:n,left:0,top:0};if(!O.floating)return R;const D=_t(O.floating,p.x),_=_t(O.floating,p.y);return l?{...R,transform:"translate("+D+"px, "+_+"px)",...Gt(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:D,top:_}},[n,l,O.floating,p.x,p.y]);return C.useMemo(()=>({...p,update:E,refs:T,elements:O,floatingStyles:M}),[p,E,T,O,M])}const rn=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:i}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?Nt({element:o.current,padding:i}).fn(n):{}:o?Nt({element:o,padding:i}).fn(n):{}}}},sn=(t,e)=>({...Ne(t),options:[t,e]}),cn=(t,e)=>({...Fe(t),options:[t,e]}),ln=(t,e)=>({...He(t),options:[t,e]}),an=(t,e)=>({...Le(t),options:[t,e]}),fn=(t,e)=>({...We(t),options:[t,e]}),un=(t,e)=>({...De(t),options:[t,e]}),dn=(t,e)=>({...rn(t),options:[t,e]});var pn="Arrow",Jt=C.forwardRef((t,e)=>{const{children:n,width:o=10,height:i=5,...r}=t;return j.jsx(ht.svg,{...r,ref:e,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:j.jsx("polygon",{points:"0,0 30,0 15,10"})})});Jt.displayName=pn;var mn=Jt,Rt="Popper",[Qt,On]=ye(Rt),[gn,te]=Qt(Rt),ee=t=>{const{__scopePopper:e,children:n}=t,[o,i]=C.useState(null);return j.jsx(gn,{scope:e,anchor:o,onAnchorChange:i,children:n})};ee.displayName=Rt;var ne="PopperAnchor",oe=C.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:o,...i}=t,r=te(ne,n),s=C.useRef(null),l=Vt(e,s);return C.useEffect(()=>{r.onAnchorChange((o==null?void 0:o.current)||s.current)}),o?null:j.jsx(ht.div,{...i,ref:l})});oe.displayName=ne;var Ct="PopperContent",[hn,wn]=Qt(Ct),ie=C.forwardRef((t,e)=>{var Pt,Ot,Et,St,Tt,Mt;const{__scopePopper:n,side:o="bottom",sideOffset:i=0,align:r="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:a=[],collisionPadding:p=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:f="optimized",onPlaced:u,...g}=t,w=te(Ct,n),[h,x]=C.useState(null),A=Vt(e,tt=>x(tt)),[y,v]=C.useState(null),b=be(y),P=(b==null?void 0:b.width)??0,S=(b==null?void 0:b.height)??0,F=o+(r!=="center"?"-"+r:""),$=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},H=Array.isArray(a)?a:[a],E=H.length>0,L={padding:$,boundary:H.filter(yn),altBoundary:E},{refs:T,floatingStyles:O,placement:M,isPositioned:R,middlewareData:D}=on({strategy:"fixed",placement:F,whileElementsMounted:(...tt)=>en(...tt,{animationFrame:f==="always"}),elements:{reference:w.anchor},middleware:[sn({mainAxis:i+S,alignmentAxis:s}),c&&cn({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?ln():void 0,...L}),c&&an({...L}),fn({...L,apply:({elements:tt,rects:Lt,availableWidth:me,availableHeight:ge})=>{const{width:he,height:we}=Lt.reference,rt=tt.floating.style;rt.setProperty("--radix-popper-available-width",`${me}px`),rt.setProperty("--radix-popper-available-height",`${ge}px`),rt.setProperty("--radix-popper-anchor-width",`${he}px`),rt.setProperty("--radix-popper-anchor-height",`${we}px`)}}),y&&dn({element:y,padding:l}),vn({arrowWidth:P,arrowHeight:S}),m&&un({strategy:"referenceHidden",...L})]}),[_,le]=ce(M),it=ve(u);Dt(()=>{R&&(it==null||it())},[R,it]);const ae=(Pt=D.arrow)==null?void 0:Pt.x,fe=(Ot=D.arrow)==null?void 0:Ot.y,ue=((Et=D.arrow)==null?void 0:Et.centerOffset)!==0,[de,pe]=C.useState();return Dt(()=>{h&&pe(window.getComputedStyle(h).zIndex)},[h]),j.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:R?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(St=D.transformOrigin)==null?void 0:St.x,(Tt=D.transformOrigin)==null?void 0:Tt.y].join(" "),...((Mt=D.hide)==null?void 0:Mt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:j.jsx(hn,{scope:n,placedSide:_,onArrowChange:v,arrowX:ae,arrowY:fe,shouldHideArrow:ue,children:j.jsx(ht.div,{"data-side":_,"data-align":le,...g,ref:A,style:{...g.style,animation:R?void 0:"none"}})})})});ie.displayName=Ct;var re="PopperArrow",xn={top:"bottom",right:"left",bottom:"top",left:"right"},se=C.forwardRef(function(e,n){const{__scopePopper:o,...i}=e,r=wn(re,o),s=xn[r.placedSide];return j.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:j.jsx(mn,{...i,ref:n,style:{...i.style,display:"block"}})})});se.displayName=re;function yn(t){return t!==null}var vn=t=>({name:"transformOrigin",options:t,fn(e){var w,h,x;const{placement:n,rects:o,middlewareData:i}=e,s=((w=i.arrow)==null?void 0:w.centerOffset)!==0,l=s?0:t.arrowWidth,c=s?0:t.arrowHeight,[a,p]=ce(n),d={start:"0%",center:"50%",end:"100%"}[p],m=(((h=i.arrow)==null?void 0:h.x)??0)+l/2,f=(((x=i.arrow)==null?void 0:x.y)??0)+c/2;let u="",g="";return a==="bottom"?(u=s?d:`${m}px`,g=`${-c}px`):a==="top"?(u=s?d:`${m}px`,g=`${o.floating.height+c}px`):a==="right"?(u=`${-c}px`,g=s?d:`${f}px`):a==="left"&&(u=`${o.floating.width+c}px`,g=s?d:`${f}px`),{data:{x:u,y:g}}}});function ce(t){const[e,n="center"]=t.split("-");return[e,n]}var En=ee,Sn=oe,Tn=ie,Mn=se;export{Sn as A,Tn as C,En as R,Mn as a,On as c};
