import{e as xt,i as p,j as x,f as dn,r as vt,R as wt,u as ne,a as pn,g as mn,b as hn,p as gn,n as xn,T as vn}from"./index-8Yb0GG_8.js";import{R as wn,f as yn}from"./time-CuFqSW_4.js";/**
 * @license lucide-react v1.16.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bn=[["path",{d:"M5 12h14",key:"1ays0h"}]],Cn=xt("minus",bn);/**
 * @license lucide-react v1.16.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const En=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],Rn=xt("trending-down",En);var Pn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],q=Pn.reduce((e,t)=>{const n=dn(`Primitive.${t}`),o=p.forwardRef((r,s)=>{const{asChild:i,...c}=r,a=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function An(e,t){e&&vt.flushSync(()=>e.dispatchEvent(t))}var On=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Tn="VisuallyHidden",yt=p.forwardRef((e,t)=>x.jsx(q.span,{...e,ref:t,style:{...On,...e.style}}));yt.displayName=Tn;var Sn=yt;function bt(e,t=[]){let n=[];function o(s,i){const c=p.createContext(i),a=n.length;n=[...n,i];const u=f=>{var w;const{scope:m,children:d,...h}=f,g=((w=m==null?void 0:m[e])==null?void 0:w[a])||c,v=p.useMemo(()=>h,Object.values(h));return x.jsx(g.Provider,{value:v,children:d})};u.displayName=s+"Provider";function l(f,m){var g;const d=((g=m==null?void 0:m[e])==null?void 0:g[a])||c,h=p.useContext(d);if(h)return h;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,l]}const r=()=>{const s=n.map(i=>p.createContext(i));return function(c){const a=(c==null?void 0:c[e])||s;return p.useMemo(()=>({[`__scope${e}`]:{...c,[e]:a}}),[c,a])}};return r.scopeName=e,[o,Nn(r,...t)]}function Nn(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const i=o.reduce((c,{useScope:a,scopeName:u})=>{const f=a(s)[`__scope${u}`];return{...c,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}var Q=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},Ln=wt[" useInsertionEffect ".trim().toString()]||Q;function Dn({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,i]=Mn({defaultProp:t,onChange:n}),c=e!==void 0,a=c?e:r;{const l=p.useRef(e!==void 0);p.useEffect(()=>{const f=l.current;f!==c&&console.warn(`${o} is changing from ${f?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),l.current=c},[c,o])}const u=p.useCallback(l=>{var f;if(c){const m=jn(l)?l(e):l;m!==e&&((f=i.current)==null||f.call(i,m))}else s(l)},[c,e,s,i]);return[a,u]}function Mn({defaultProp:e,onChange:t}){const[n,o]=p.useState(e),r=p.useRef(n),s=p.useRef(t);return Ln(()=>{s.current=t},[t]),p.useEffect(()=>{var i;r.current!==n&&((i=s.current)==null||i.call(s,n),r.current=n)},[n,r]),[n,o,s]}function jn(e){return typeof e=="function"}function _n(e,t){return p.useReducer((n,o)=>t[n][o]??n,e)}var Ie=e=>{const{present:t,children:n}=e,o=$n(t),r=typeof n=="function"?n({present:o.isPresent}):p.Children.only(n),s=ne(o.ref,kn(r));return typeof n=="function"||o.isPresent?p.cloneElement(r,{ref:s}):null};Ie.displayName="Presence";function $n(e){const[t,n]=p.useState(),o=p.useRef(null),r=p.useRef(e),s=p.useRef("none"),i=e?"mounted":"unmounted",[c,a]=_n(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=he(o.current);s.current=c==="mounted"?u:"none"},[c]),Q(()=>{const u=o.current,l=r.current;if(l!==e){const m=s.current,d=he(u);e?a("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(l&&m!==d?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,a]),Q(()=>{if(t){let u;const l=t.ownerDocument.defaultView??window,f=d=>{const g=he(o.current).includes(CSS.escape(d.animationName));if(d.target===t&&g&&(a("ANIMATION_END"),!r.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",u=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},m=d=>{d.target===t&&(s.current=he(o.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{l.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function he(e){return(e==null?void 0:e.animationName)||"none"}function kn(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fn=wt[" useId ".trim().toString()]||(()=>{}),In=0;function Wn(e){const[t,n]=p.useState(Fn());return Q(()=>{n(o=>o??String(In++))},[e]),t?`radix-${t}`:""}function Ee(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function Bn(e,t=globalThis==null?void 0:globalThis.document){const n=Ee(e);p.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Hn="DismissableLayer",Me="dismissableLayer.update",zn="dismissableLayer.pointerDownOutside",Un="dismissableLayer.focusOutside",ot,Ct=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Et=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:i,onDismiss:c,...a}=e,u=p.useContext(Ct),[l,f]=p.useState(null),m=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=p.useState({}),h=ne(t,E=>f(E)),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(v),y=l?g.indexOf(l):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,b=y>=w,P=Xn(E=>{const O=E.target,M=[...u.branches].some(T=>T.contains(O));!b||M||(r==null||r(E),i==null||i(E),E.defaultPrevented||c==null||c())},m),R=Gn(E=>{const O=E.target;[...u.branches].some(T=>T.contains(O))||(s==null||s(E),i==null||i(E),E.defaultPrevented||c==null||c())},m);return Bn(E=>{y===u.layers.size-1&&(o==null||o(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},m),p.useEffect(()=>{if(l)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ot=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(l)),u.layers.add(l),rt(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ot)}},[l,m,n,u]),p.useEffect(()=>()=>{l&&(u.layers.delete(l),u.layersWithOutsidePointerEventsDisabled.delete(l),rt())},[l,u]),p.useEffect(()=>{const E=()=>d({});return document.addEventListener(Me,E),()=>document.removeEventListener(Me,E)},[]),x.jsx(q.div,{...a,ref:h,style:{pointerEvents:C?b?"auto":"none":void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,P.onPointerDownCapture)})});Et.displayName=Hn;var Vn="DismissableLayerBranch",Yn=p.forwardRef((e,t)=>{const n=p.useContext(Ct),o=p.useRef(null),r=ne(t,o);return p.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(q.div,{...e,ref:r})});Yn.displayName=Vn;function Xn(e,t=globalThis==null?void 0:globalThis.document){const n=Ee(e),o=p.useRef(!1),r=p.useRef(()=>{});return p.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let a=function(){Rt(zn,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=a,t.addEventListener("click",r.current,{once:!0})):a()}else t.removeEventListener("click",r.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Gn(e,t=globalThis==null?void 0:globalThis.document){const n=Ee(e),o=p.useRef(!1);return p.useEffect(()=>{const r=s=>{s.target&&!o.current&&Rt(Un,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function rt(){const e=new CustomEvent(Me);document.dispatchEvent(e)}function Rt(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?An(r,s):r.dispatchEvent(s)}var Kn="Portal",Pt=p.forwardRef((e,t)=>{var c;const{container:n,...o}=e,[r,s]=p.useState(!1);Q(()=>s(!0),[]);const i=n||r&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return i?pn.createPortal(x.jsx(q.div,{...o,ref:t}),i):null});Pt.displayName=Kn;function Qn(e){const[t,n]=p.useState(void 0);return Q(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let i,c;if("borderBoxSize"in s){const a=s.borderBoxSize,u=Array.isArray(a)?a[0]:a;i=u.inlineSize,c=u.blockSize}else i=e.offsetWidth,c=e.offsetHeight;n({width:i,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}const Zn=["top","right","bottom","left"],Z=Math.min,F=Math.max,we=Math.round,ge=Math.floor,U=e=>({x:e,y:e}),Jn={left:"right",right:"left",bottom:"top",top:"bottom"};function je(e,t,n){return F(e,Z(t,n))}function X(e,t){return typeof e=="function"?e(t):e}function G(e){return e.split("-")[0]}function ie(e){return e.split("-")[1]}function We(e){return e==="x"?"y":"x"}function Be(e){return e==="y"?"height":"width"}function z(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function He(e){return We(z(e))}function qn(e,t,n){n===void 0&&(n=!1);const o=ie(e),r=He(e),s=Be(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ye(i)),[i,ye(i)]}function eo(e){const t=ye(e);return[_e(e),t,_e(t)]}function _e(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const st=["left","right"],it=["right","left"],to=["top","bottom"],no=["bottom","top"];function oo(e,t,n){switch(e){case"top":case"bottom":return n?t?it:st:t?st:it;case"left":case"right":return t?to:no;default:return[]}}function ro(e,t,n,o){const r=ie(e);let s=oo(G(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(_e)))),s}function ye(e){const t=G(e);return Jn[t]+e.slice(t.length)}function so(e){return{top:0,right:0,bottom:0,left:0,...e}}function At(e){return typeof e!="number"?so(e):{top:e,right:e,bottom:e,left:e}}function be(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function ct(e,t,n){let{reference:o,floating:r}=e;const s=z(t),i=He(t),c=Be(i),a=G(t),u=s==="y",l=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let d;switch(a){case"top":d={x:l,y:o.y-r.height};break;case"bottom":d={x:l,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-r.width,y:f};break;default:d={x:o.x,y:o.y}}switch(ie(t)){case"start":d[i]-=m*(n&&u?-1:1);break;case"end":d[i]+=m*(n&&u?-1:1);break}return d}async function io(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:c,strategy:a}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:f="floating",altBoundary:m=!1,padding:d=0}=X(t,e),h=At(d),v=c[m?f==="floating"?"reference":"floating":f],w=be(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:l,strategy:a})),y=f==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},P=be(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:C,strategy:a}):y);return{top:(w.top-P.top+h.top)/b.y,bottom:(P.bottom-w.bottom+h.bottom)/b.y,left:(w.left-P.left+h.left)/b.x,right:(P.right-w.right+h.right)/b.x}}const co=50,ao=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,c=i.detectOverflow?i:{...i,detectOverflow:io},a=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:l,y:f}=ct(u,o,a),m=o,d=0;const h={};for(let g=0;g<s.length;g++){const v=s[g];if(!v)continue;const{name:w,fn:y}=v,{x:C,y:b,data:P,reset:R}=await y({x:l,y:f,initialPlacement:o,placement:m,strategy:r,middlewareData:h,rects:u,platform:c,elements:{reference:e,floating:t}});l=C??l,f=b??f,h[w]={...h[w],...P},R&&d<co&&(d++,typeof R=="object"&&(R.placement&&(m=R.placement),R.rects&&(u=R.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):R.rects),{x:l,y:f}=ct(u,m,a)),g=-1)}return{x:l,y:f,placement:m,strategy:r,middlewareData:h}},lo=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:a}=t,{element:u,padding:l=0}=X(e,t)||{};if(u==null)return{};const f=At(l),m={x:n,y:o},d=He(r),h=Be(d),g=await i.getDimensions(u),v=d==="y",w=v?"top":"left",y=v?"bottom":"right",C=v?"clientHeight":"clientWidth",b=s.reference[h]+s.reference[d]-m[d]-s.floating[h],P=m[d]-s.reference[d],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let E=R?R[C]:0;(!E||!await(i.isElement==null?void 0:i.isElement(R)))&&(E=c.floating[C]||s.floating[h]);const O=b/2-P/2,M=E/2-g[h]/2-1,T=Z(f[w],M),_=Z(f[y],M),$=T,N=E-g[h]-_,S=E/2-g[h]/2+O,k=je($,S,N),L=!a.arrow&&ie(r)!=null&&S!==k&&s.reference[h]/2-(S<$?T:_)-g[h]/2<0,D=L?S<$?S-$:S-N:0;return{[d]:m[d]+D,data:{[d]:k,centerOffset:S-k-D,...L&&{alignmentOffset:D}},reset:L}}}),uo=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:c,platform:a,elements:u}=t,{mainAxis:l=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...v}=X(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=G(r),y=z(c),C=G(c)===c,b=await(a.isRTL==null?void 0:a.isRTL(u.floating)),P=m||(C||!g?[ye(c)]:eo(c)),R=h!=="none";!m&&R&&P.push(...ro(c,g,h,b));const E=[c,...P],O=await a.detectOverflow(t,v),M=[];let T=((o=s.flip)==null?void 0:o.overflows)||[];if(l&&M.push(O[w]),f){const S=qn(r,i,b);M.push(O[S[0]],O[S[1]])}if(T=[...T,{placement:r,overflows:M}],!M.every(S=>S<=0)){var _,$;const S=(((_=s.flip)==null?void 0:_.index)||0)+1,k=E[S];if(k&&(!(f==="alignment"?y!==z(k):!1)||T.every(A=>z(A.placement)===y?A.overflows[0]>0:!0)))return{data:{index:S,overflows:T},reset:{placement:k}};let L=($=T.filter(D=>D.overflows[0]<=0).sort((D,A)=>D.overflows[1]-A.overflows[1])[0])==null?void 0:$.placement;if(!L)switch(d){case"bestFit":{var N;const D=(N=T.filter(A=>{if(R){const j=z(A.placement);return j===y||j==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(j=>j>0).reduce((j,H)=>j+H,0)]).sort((A,j)=>A[1]-j[1])[0])==null?void 0:N[0];D&&(L=D);break}case"initialPlacement":L=c;break}if(r!==L)return{reset:{placement:L}}}return{}}}};function at(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lt(e){return Zn.some(t=>e[t]>=0)}const fo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=X(e,t);switch(r){case"referenceHidden":{const i=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=at(i,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:lt(c)}}}case"escaped":{const i=await o.detectOverflow(t,{...s,altBoundary:!0}),c=at(i,n.floating);return{data:{escapedOffsets:c,escaped:lt(c)}}}default:return{}}}}},Ot=new Set(["left","top"]);async function po(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=G(n),c=ie(n),a=z(n)==="y",u=Ot.has(i)?-1:1,l=s&&a?-1:1,f=X(t,e);let{mainAxis:m,crossAxis:d,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof h=="number"&&(d=c==="end"?h*-1:h),a?{x:d*l,y:m*u}:{x:m*u,y:d*l}}const mo=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:c}=t,a=await po(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:s+a.y,data:{...a,placement:i}}}}},ho=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:c=!1,limiter:a={fn:w=>{let{x:y,y:C}=w;return{x:y,y:C}}},...u}=X(e,t),l={x:n,y:o},f=await s.detectOverflow(t,u),m=z(G(r)),d=We(m);let h=l[d],g=l[m];if(i){const w=d==="y"?"top":"left",y=d==="y"?"bottom":"right",C=h+f[w],b=h-f[y];h=je(C,h,b)}if(c){const w=m==="y"?"top":"left",y=m==="y"?"bottom":"right",C=g+f[w],b=g-f[y];g=je(C,g,b)}const v=a.fn({...t,[d]:h,[m]:g});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[d]:i,[m]:c}}}}}},go=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:a=!0,crossAxis:u=!0}=X(e,t),l={x:n,y:o},f=z(r),m=We(f);let d=l[m],h=l[f];const g=X(c,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(a){const C=m==="y"?"height":"width",b=s.reference[m]-s.floating[C]+v.mainAxis,P=s.reference[m]+s.reference[C]-v.mainAxis;d<b?d=b:d>P&&(d=P)}if(u){var w,y;const C=m==="y"?"width":"height",b=Ot.has(G(r)),P=s.reference[f]-s.floating[C]+(b&&((w=i.offset)==null?void 0:w[f])||0)+(b?0:v.crossAxis),R=s.reference[f]+s.reference[C]+(b?0:((y=i.offset)==null?void 0:y[f])||0)-(b?v.crossAxis:0);h<P?h=P:h>R&&(h=R)}return{[m]:d,[f]:h}}}},xo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:c}=t,{apply:a=()=>{},...u}=X(e,t),l=await i.detectOverflow(t,u),f=G(r),m=ie(r),d=z(r)==="y",{width:h,height:g}=s.floating;let v,w;f==="top"||f==="bottom"?(v=f,w=m===(await(i.isRTL==null?void 0:i.isRTL(c.floating))?"start":"end")?"left":"right"):(w=f,v=m==="end"?"top":"bottom");const y=g-l.top-l.bottom,C=h-l.left-l.right,b=Z(g-l[v],y),P=Z(h-l[w],C),R=!t.middlewareData.shift;let E=b,O=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=C),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=y),R&&!m){const T=F(l.left,0),_=F(l.right,0),$=F(l.top,0),N=F(l.bottom,0);d?O=h-2*(T!==0||_!==0?T+_:F(l.left,l.right)):E=g-2*($!==0||N!==0?$+N:F(l.top,l.bottom))}await a({...t,availableWidth:O,availableHeight:E});const M=await i.getDimensions(c.floating);return h!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Re(){return typeof window<"u"}function ce(e){return Tt(e)?(e.nodeName||"").toLowerCase():"#document"}function I(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){var t;return(t=(Tt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tt(e){return Re()?e instanceof Node||e instanceof I(e).Node:!1}function W(e){return Re()?e instanceof Element||e instanceof I(e).Element:!1}function K(e){return Re()?e instanceof HTMLElement||e instanceof I(e).HTMLElement:!1}function ut(e){return!Re()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof I(e).ShadowRoot}function fe(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=B(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function vo(e){return/^(table|td|th)$/.test(ce(e))}function Pe(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const wo=/transform|translate|scale|rotate|perspective|filter/,yo=/paint|layout|strict|content/,ee=e=>!!e&&e!=="none";let Ne;function ze(e){const t=W(e)?B(e):e;return ee(t.transform)||ee(t.translate)||ee(t.scale)||ee(t.rotate)||ee(t.perspective)||!Ue()&&(ee(t.backdropFilter)||ee(t.filter))||wo.test(t.willChange||"")||yo.test(t.contain||"")}function bo(e){let t=J(e);for(;K(t)&&!re(t);){if(ze(t))return t;if(Pe(t))return null;t=J(t)}return null}function Ue(){return Ne==null&&(Ne=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ne}function re(e){return/^(html|body|#document)$/.test(ce(e))}function B(e){return I(e).getComputedStyle(e)}function Ae(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(ce(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ut(e)&&e.host||V(e);return ut(t)?t.host:t}function St(e){const t=J(e);return re(t)?e.ownerDocument?e.ownerDocument.body:e.body:K(t)&&fe(t)?t:St(t)}function le(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=St(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=I(r);if(s){const c=$e(i);return t.concat(i,i.visualViewport||[],fe(r)?r:[],c&&n?le(c):[])}else return t.concat(r,le(r,[],n))}function $e(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nt(e){const t=B(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=K(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,c=we(n)!==s||we(o)!==i;return c&&(n=s,o=i),{width:n,height:o,$:c}}function Ve(e){return W(e)?e:e.contextElement}function oe(e){const t=Ve(e);if(!K(t))return U(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Nt(t);let i=(s?we(n.width):n.width)/o,c=(s?we(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Co=U(0);function Lt(e){const t=I(e);return!Ue()||!t.visualViewport?Co:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Eo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==I(e)?!1:t}function te(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Ve(e);let i=U(1);t&&(o?W(o)&&(i=oe(o)):i=oe(e));const c=Eo(s,n,o)?Lt(s):U(0);let a=(r.left+c.x)/i.x,u=(r.top+c.y)/i.y,l=r.width/i.x,f=r.height/i.y;if(s){const m=I(s),d=o&&W(o)?I(o):o;let h=m,g=$e(h);for(;g&&o&&d!==h;){const v=oe(g),w=g.getBoundingClientRect(),y=B(g),C=w.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,b=w.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;a*=v.x,u*=v.y,l*=v.x,f*=v.y,a+=C,u+=b,h=I(g),g=$e(h)}}return be({width:l,height:f,x:a,y:u})}function Oe(e,t){const n=Ae(e).scrollLeft;return t?t.left+n:te(V(e)).left+n}function Dt(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Oe(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Ro(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=V(o),c=t?Pe(t.floating):!1;if(o===i||c&&s)return n;let a={scrollLeft:0,scrollTop:0},u=U(1);const l=U(0),f=K(o);if((f||!f&&!s)&&((ce(o)!=="body"||fe(i))&&(a=Ae(o)),f)){const d=te(o);u=oe(o),l.x=d.x+o.clientLeft,l.y=d.y+o.clientTop}const m=i&&!f&&!s?Dt(i,a):U(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+l.x+m.x,y:n.y*u.y-a.scrollTop*u.y+l.y+m.y}}function Po(e){return Array.from(e.getClientRects())}function Ao(e){const t=V(e),n=Ae(e),o=e.ownerDocument.body,r=F(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=F(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Oe(e);const c=-n.scrollTop;return B(o).direction==="rtl"&&(i+=F(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:c}}const ft=25;function Oo(e,t){const n=I(e),o=V(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,c=0,a=0;if(r){s=r.width,i=r.height;const l=Ue();(!l||l&&t==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}const u=Oe(o);if(u<=0){const l=o.ownerDocument,f=l.body,m=getComputedStyle(f),d=l.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(o.clientWidth-f.clientWidth-d);h<=ft&&(s-=h)}else u<=ft&&(s+=u);return{width:s,height:i,x:c,y:a}}function To(e,t){const n=te(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=K(e)?oe(e):U(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,a=r*s.x,u=o*s.y;return{width:i,height:c,x:a,y:u}}function dt(e,t,n){let o;if(t==="viewport")o=Oo(e,n);else if(t==="document")o=Ao(V(e));else if(W(t))o=To(t,n);else{const r=Lt(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return be(o)}function Mt(e,t){const n=J(e);return n===t||!W(n)||re(n)?!1:B(n).position==="fixed"||Mt(n,t)}function So(e,t){const n=t.get(e);if(n)return n;let o=le(e,[],!1).filter(c=>W(c)&&ce(c)!=="body"),r=null;const s=B(e).position==="fixed";let i=s?J(e):e;for(;W(i)&&!re(i);){const c=B(i),a=ze(i);!a&&c.position==="fixed"&&(r=null),(s?!a&&!r:!a&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||fe(i)&&!a&&Mt(e,i))?o=o.filter(l=>l!==i):r=c,i=J(i)}return t.set(e,o),o}function No(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Pe(t)?[]:So(t,this._c):[].concat(n),o],c=dt(t,i[0],r);let a=c.top,u=c.right,l=c.bottom,f=c.left;for(let m=1;m<i.length;m++){const d=dt(t,i[m],r);a=F(d.top,a),u=Z(d.right,u),l=Z(d.bottom,l),f=F(d.left,f)}return{width:u-f,height:l-a,x:f,y:a}}function Lo(e){const{width:t,height:n}=Nt(e);return{width:t,height:n}}function Do(e,t,n){const o=K(t),r=V(t),s=n==="fixed",i=te(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const a=U(0);function u(){a.x=Oe(r)}if(o||!o&&!s)if((ce(t)!=="body"||fe(r))&&(c=Ae(t)),o){const d=te(t,!0,s,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else r&&u();s&&!o&&r&&u();const l=r&&!o&&!s?Dt(r,c):U(0),f=i.left+c.scrollLeft-a.x-l.x,m=i.top+c.scrollTop-a.y-l.y;return{x:f,y:m,width:i.width,height:i.height}}function Le(e){return B(e).position==="static"}function pt(e,t){if(!K(e)||B(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return V(e)===n&&(n=n.ownerDocument.body),n}function jt(e,t){const n=I(e);if(Pe(e))return n;if(!K(e)){let r=J(e);for(;r&&!re(r);){if(W(r)&&!Le(r))return r;r=J(r)}return n}let o=pt(e,t);for(;o&&vo(o)&&Le(o);)o=pt(o,t);return o&&re(o)&&Le(o)&&!ze(o)?n:o||bo(e)||n}const Mo=async function(e){const t=this.getOffsetParent||jt,n=this.getDimensions,o=await n(e.floating);return{reference:Do(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function jo(e){return B(e).direction==="rtl"}const _o={convertOffsetParentRelativeRectToViewportRelativeRect:Ro,getDocumentElement:V,getClippingRect:No,getOffsetParent:jt,getElementRects:Mo,getClientRects:Po,getDimensions:Lo,getScale:oe,isElement:W,isRTL:jo};function _t(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $o(e,t){let n=null,o;const r=V(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),s();const u=e.getBoundingClientRect(),{left:l,top:f,width:m,height:d}=u;if(c||t(),!m||!d)return;const h=ge(f),g=ge(r.clientWidth-(l+m)),v=ge(r.clientHeight-(f+d)),w=ge(l),C={rootMargin:-h+"px "+-g+"px "+-v+"px "+-w+"px",threshold:F(0,Z(1,a))||1};let b=!0;function P(R){const E=R[0].intersectionRatio;if(E!==a){if(!b)return i();E?i(!1,E):o=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!_t(u,e.getBoundingClientRect())&&i(),b=!1}try{n=new IntersectionObserver(P,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(P,C)}n.observe(e)}return i(!0),s}function ko(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,u=Ve(e),l=r||s?[...u?le(u):[],...t?le(t):[]]:[];l.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const f=u&&c?$o(u,n):null;let m=-1,d=null;i&&(d=new ResizeObserver(w=>{let[y]=w;y&&y.target===u&&d&&t&&(d.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=d)==null||C.observe(t)})),n()}),u&&!a&&d.observe(u),t&&d.observe(t));let h,g=a?te(e):null;a&&v();function v(){const w=te(e);g&&!_t(g,w)&&n(),g=w,h=requestAnimationFrame(v)}return n(),()=>{var w;l.forEach(y=>{r&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),f==null||f(),(w=d)==null||w.disconnect(),d=null,a&&cancelAnimationFrame(h)}}const Fo=mo,Io=ho,Wo=uo,Bo=xo,Ho=fo,mt=lo,zo=go,Uo=(e,t,n)=>{const o=new Map,r={platform:_o,...n},s={...r.platform,_c:o};return ao(e,t,{...r,platform:s})};var Vo=typeof document<"u",Yo=function(){},ve=Vo?p.useLayoutEffect:Yo;function Ce(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Ce(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Ce(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function $t(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ht(e,t){const n=$t(e);return Math.round(t*n)/n}function De(e){const t=p.useRef(e);return ve(()=>{t.current=e}),t}function Xo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:a,open:u}=e,[l,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,d]=p.useState(o);Ce(m,o)||d(o);const[h,g]=p.useState(null),[v,w]=p.useState(null),y=p.useCallback(A=>{A!==R.current&&(R.current=A,g(A))},[]),C=p.useCallback(A=>{A!==E.current&&(E.current=A,w(A))},[]),b=s||h,P=i||v,R=p.useRef(null),E=p.useRef(null),O=p.useRef(l),M=a!=null,T=De(a),_=De(r),$=De(u),N=p.useCallback(()=>{if(!R.current||!E.current)return;const A={placement:t,strategy:n,middleware:m};_.current&&(A.platform=_.current),Uo(R.current,E.current,A).then(j=>{const H={...j,isPositioned:$.current!==!1};S.current&&!Ce(O.current,H)&&(O.current=H,vt.flushSync(()=>{f(H)}))})},[m,t,n,_,$]);ve(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[u]);const S=p.useRef(!1);ve(()=>(S.current=!0,()=>{S.current=!1}),[]),ve(()=>{if(b&&(R.current=b),P&&(E.current=P),b&&P){if(T.current)return T.current(b,P,N);N()}},[b,P,N,T,M]);const k=p.useMemo(()=>({reference:R,floating:E,setReference:y,setFloating:C}),[y,C]),L=p.useMemo(()=>({reference:b,floating:P}),[b,P]),D=p.useMemo(()=>{const A={position:n,left:0,top:0};if(!L.floating)return A;const j=ht(L.floating,l.x),H=ht(L.floating,l.y);return c?{...A,transform:"translate("+j+"px, "+H+"px)",...$t(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:H}},[n,c,L.floating,l.x,l.y]);return p.useMemo(()=>({...l,update:N,refs:k,elements:L,floatingStyles:D}),[l,N,k,L,D])}const Go=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?mt({element:o.current,padding:r}).fn(n):{}:o?mt({element:o,padding:r}).fn(n):{}}}},Ko=(e,t)=>{const n=Fo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qo=(e,t)=>{const n=Io(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zo=(e,t)=>({fn:zo(e).fn,options:[e,t]}),Jo=(e,t)=>{const n=Wo(e);return{name:n.name,fn:n.fn,options:[e,t]}},qo=(e,t)=>{const n=Bo(e);return{name:n.name,fn:n.fn,options:[e,t]}},er=(e,t)=>{const n=Ho(e);return{name:n.name,fn:n.fn,options:[e,t]}},tr=(e,t)=>{const n=Go(e);return{name:n.name,fn:n.fn,options:[e,t]}};var nr="Arrow",kt=p.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return x.jsx(q.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});kt.displayName=nr;var or=kt,Ye="Popper",[Ft,It]=bt(Ye),[rr,Wt]=Ft(Ye),Bt=e=>{const{__scopePopper:t,children:n}=e,[o,r]=p.useState(null);return x.jsx(rr,{scope:t,anchor:o,onAnchorChange:r,children:n})};Bt.displayName=Ye;var Ht="PopperAnchor",zt=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Wt(Ht,n),i=p.useRef(null),c=ne(t,i),a=p.useRef(null);return p.useEffect(()=>{const u=a.current;a.current=(o==null?void 0:o.current)||i.current,u!==a.current&&s.onAnchorChange(a.current)}),o?null:x.jsx(q.div,{...r,ref:c})});zt.displayName=Ht;var Xe="PopperContent",[sr,ir]=Ft(Xe),Ut=p.forwardRef((e,t)=>{var Qe,Ze,Je,qe,et,tt;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:c=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:l=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:d="optimized",onPlaced:h,...g}=e,v=Wt(Xe,n),[w,y]=p.useState(null),C=ne(t,ae=>y(ae)),[b,P]=p.useState(null),R=Qn(b),E=(R==null?void 0:R.width)??0,O=(R==null?void 0:R.height)??0,M=o+(s!=="center"?"-"+s:""),T=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},_=Array.isArray(u)?u:[u],$=_.length>0,N={padding:T,boundary:_.filter(ar),altBoundary:$},{refs:S,floatingStyles:k,placement:L,isPositioned:D,middlewareData:A}=Xo({strategy:"fixed",placement:M,whileElementsMounted:(...ae)=>ko(...ae,{animationFrame:d==="always"}),elements:{reference:v.anchor},middleware:[Ko({mainAxis:r+O,alignmentAxis:i}),a&&Qo({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Zo():void 0,...N}),a&&Jo({...N}),qo({...N,apply:({elements:ae,rects:nt,availableWidth:an,availableHeight:ln})=>{const{width:un,height:fn}=nt.reference,me=ae.floating.style;me.setProperty("--radix-popper-available-width",`${an}px`),me.setProperty("--radix-popper-available-height",`${ln}px`),me.setProperty("--radix-popper-anchor-width",`${un}px`),me.setProperty("--radix-popper-anchor-height",`${fn}px`)}}),b&&tr({element:b,padding:c}),lr({arrowWidth:E,arrowHeight:O}),m&&er({strategy:"referenceHidden",...N})]}),[j,H]=Xt(L),pe=Ee(h);Q(()=>{D&&(pe==null||pe())},[D,pe]);const nn=(Qe=A.arrow)==null?void 0:Qe.x,on=(Ze=A.arrow)==null?void 0:Ze.y,rn=((Je=A.arrow)==null?void 0:Je.centerOffset)!==0,[sn,cn]=p.useState();return Q(()=>{w&&cn(window.getComputedStyle(w).zIndex)},[w]),x.jsx("div",{ref:S.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:D?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:sn,"--radix-popper-transform-origin":[(qe=A.transformOrigin)==null?void 0:qe.x,(et=A.transformOrigin)==null?void 0:et.y].join(" "),...((tt=A.hide)==null?void 0:tt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(sr,{scope:n,placedSide:j,onArrowChange:P,arrowX:nn,arrowY:on,shouldHideArrow:rn,children:x.jsx(q.div,{"data-side":j,"data-align":H,...g,ref:C,style:{...g.style,animation:D?void 0:"none"}})})})});Ut.displayName=Xe;var Vt="PopperArrow",cr={top:"bottom",right:"left",bottom:"top",left:"right"},Yt=p.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=ir(Vt,o),i=cr[s.placedSide];return x.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:x.jsx(or,{...r,ref:n,style:{...r.style,display:"block"}})})});Yt.displayName=Vt;function ar(e){return e!==null}var lr=e=>({name:"transformOrigin",options:e,fn(t){var v,w,y;const{placement:n,rects:o,middlewareData:r}=t,i=((v=r.arrow)==null?void 0:v.centerOffset)!==0,c=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[u,l]=Xt(n),f={start:"0%",center:"50%",end:"100%"}[l],m=(((w=r.arrow)==null?void 0:w.x)??0)+c/2,d=(((y=r.arrow)==null?void 0:y.y)??0)+a/2;let h="",g="";return u==="bottom"?(h=i?f:`${m}px`,g=`${-a}px`):u==="top"?(h=i?f:`${m}px`,g=`${o.floating.height+a}px`):u==="right"?(h=`${-a}px`,g=i?f:`${d}px`):u==="left"&&(h=`${o.floating.width+a}px`,g=i?f:`${d}px`),{data:{x:h,y:g}}}});function Xt(e){const[t,n="center"]=e.split("-");return[t,n]}var ur=Bt,fr=zt,dr=Ut,pr=Yt,[Te]=bt("Tooltip",[It]),Se=It(),Gt="TooltipProvider",mr=700,ke="tooltip.open",[hr,Ge]=Te(Gt),Kt=e=>{const{__scopeTooltip:t,delayDuration:n=mr,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,i=p.useRef(!0),c=p.useRef(!1),a=p.useRef(0);return p.useEffect(()=>{const u=a.current;return()=>window.clearTimeout(u)},[]),x.jsx(hr,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(a.current),i.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:p.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:s})};Kt.displayName=Gt;var ue="Tooltip",[gr,de]=Te(ue),Qt=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:s,disableHoverableContent:i,delayDuration:c}=e,a=Ge(ue,e.__scopeTooltip),u=Se(t),[l,f]=p.useState(null),m=Wn(),d=p.useRef(0),h=i??a.disableHoverableContent,g=c??a.delayDuration,v=p.useRef(!1),[w,y]=Dn({prop:o,defaultProp:r??!1,onChange:E=>{E?(a.onOpen(),document.dispatchEvent(new CustomEvent(ke))):a.onClose(),s==null||s(E)},caller:ue}),C=p.useMemo(()=>w?v.current?"delayed-open":"instant-open":"closed",[w]),b=p.useCallback(()=>{window.clearTimeout(d.current),d.current=0,v.current=!1,y(!0)},[y]),P=p.useCallback(()=>{window.clearTimeout(d.current),d.current=0,y(!1)},[y]),R=p.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>{v.current=!0,y(!0),d.current=0},g)},[g,y]);return p.useEffect(()=>()=>{d.current&&(window.clearTimeout(d.current),d.current=0)},[]),x.jsx(ur,{...u,children:x.jsx(gr,{scope:t,contentId:m,open:w,stateAttribute:C,trigger:l,onTriggerChange:f,onTriggerEnter:p.useCallback(()=>{a.isOpenDelayedRef.current?R():b()},[a.isOpenDelayedRef,R,b]),onTriggerLeave:p.useCallback(()=>{h?P():(window.clearTimeout(d.current),d.current=0)},[P,h]),onOpen:b,onClose:P,disableHoverableContent:h,children:n})})};Qt.displayName=ue;var Fe="TooltipTrigger",Zt=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=de(Fe,n),s=Ge(Fe,n),i=Se(n),c=p.useRef(null),a=ne(t,c,r.onTriggerChange),u=p.useRef(!1),l=p.useRef(!1),f=p.useCallback(()=>u.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),x.jsx(fr,{asChild:!0,...i,children:x.jsx(q.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:a,onPointerMove:Y(e.onPointerMove,m=>{m.pointerType!=="touch"&&!l.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),l.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{r.onTriggerLeave(),l.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Y(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:Y(e.onBlur,r.onClose),onClick:Y(e.onClick,r.onClose)})})});Zt.displayName=Fe;var Ke="TooltipPortal",[xr,vr]=Te(Ke,{forceMount:void 0}),Jt=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=de(Ke,t);return x.jsx(xr,{scope:t,forceMount:n,children:x.jsx(Ie,{present:n||s.open,children:x.jsx(Pt,{asChild:!0,container:r,children:o})})})};Jt.displayName=Ke;var se="TooltipContent",qt=p.forwardRef((e,t)=>{const n=vr(se,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,i=de(se,e.__scopeTooltip);return x.jsx(Ie,{present:o||i.open,children:i.disableHoverableContent?x.jsx(en,{side:r,...s,ref:t}):x.jsx(wr,{side:r,...s,ref:t})})}),wr=p.forwardRef((e,t)=>{const n=de(se,e.__scopeTooltip),o=Ge(se,e.__scopeTooltip),r=p.useRef(null),s=ne(t,r),[i,c]=p.useState(null),{trigger:a,onClose:u}=n,l=r.current,{onPointerInTransitChange:f}=o,m=p.useCallback(()=>{c(null),f(!1)},[f]),d=p.useCallback((h,g)=>{const v=h.currentTarget,w={x:h.clientX,y:h.clientY},y=Rr(w,v.getBoundingClientRect()),C=Pr(w,y),b=Ar(g.getBoundingClientRect()),P=Tr([...C,...b]);c(P),f(!0)},[f]);return p.useEffect(()=>()=>m(),[m]),p.useEffect(()=>{if(a&&l){const h=v=>d(v,l),g=v=>d(v,a);return a.addEventListener("pointerleave",h),l.addEventListener("pointerleave",g),()=>{a.removeEventListener("pointerleave",h),l.removeEventListener("pointerleave",g)}}},[a,l,d,m]),p.useEffect(()=>{if(i){const h=g=>{const v=g.target,w={x:g.clientX,y:g.clientY},y=(a==null?void 0:a.contains(v))||(l==null?void 0:l.contains(v)),C=!Or(w,i);y?m():C&&(m(),u())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[a,l,i,u,m]),x.jsx(en,{...e,ref:s})}),[yr,br]=Te(ue,{isInside:!1}),Cr=mn("TooltipContent"),en=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:i,...c}=e,a=de(se,n),u=Se(n),{onClose:l}=a;return p.useEffect(()=>(document.addEventListener(ke,l),()=>document.removeEventListener(ke,l)),[l]),p.useEffect(()=>{if(a.trigger){const f=m=>{const d=m.target;d!=null&&d.contains(a.trigger)&&l()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[a.trigger,l]),x.jsx(Et,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:l,children:x.jsxs(dr,{"data-state":a.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[x.jsx(Cr,{children:o}),x.jsx(yr,{scope:n,isInside:!0,children:x.jsx(Sn,{id:a.contentId,role:"tooltip",children:r||o})})]})})});qt.displayName=se;var tn="TooltipArrow",Er=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Se(n);return br(tn,n).isInside?null:x.jsx(pr,{...r,...o,ref:t})});Er.displayName=tn;function Rr(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,o,r,s)){case s:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Pr(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function Ar(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function Or(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const c=t[s],a=t[i],u=c.x,l=c.y,f=a.x,m=a.y;l>o!=m>o&&n<(f-u)*(o-l)/(m-l)+u&&(r=!r)}return r}function Tr(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),Sr(t)}function Sr(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(r.y-i.y)>=(s.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Nr=Kt,Lr=Qt,Dr=Zt,Mr=Jt,jr=qt;function _r({delayDuration:e=0,...t}){return x.jsx(Nr,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function $r({...e}){return x.jsx(Lr,{"data-slot":"tooltip",...e})}function kr({...e}){return x.jsx(Dr,{"data-slot":"tooltip-trigger",...e})}function Fr({className:e,sideOffset:t=4,children:n,...o}){return x.jsx(Mr,{children:x.jsx(jr,{"data-slot":"tooltip-content",sideOffset:t,className:hn("z-50 max-w-sm rounded-md border bg-popover px-3 py-1.5 text-xs text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o,children:n})})}const xe=new Intl.NumberFormat("es-AR",{minimumFractionDigits:2,maximumFractionDigits:2});function gt({quote:e,title:t}){const n=e?Number(e.difference):0,o=e?Number(e.percentage):0,r=n>0,s=n<0;return x.jsxs("div",{className:"rounded-lg border p-4",children:[x.jsxs("div",{className:"flex items-center justify-between mb-2",children:[x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx("p",{className:"text-sm text-muted-foreground",children:t}),e&&x.jsx(_r,{children:x.jsxs($r,{children:[x.jsx(kr,{className:"cursor-pointer inline-flex",children:r?x.jsx(vn,{className:"h-4 w-4 text-emerald-500"}):s?x.jsx(Rn,{className:"h-4 w-4 text-red-500"}):x.jsx(Cn,{className:"h-4 w-4 text-muted-foreground/50"})}),x.jsx(Fr,{children:x.jsx("p",{children:r?`Subió $${xe.format(n)} (${o.toFixed(2)}%)`:s?`Bajó $${xe.format(Math.abs(n))} (${o.toFixed(2)}%)`:"Sin cambios"})})]})})]}),e&&x.jsx("span",{className:"text-xs text-muted-foreground",children:yn(e.timeStamp)})]}),e?x.jsxs("div",{className:"space-y-1",children:[x.jsxs("p",{className:"text-sm",children:["Compra: ",x.jsxs("span",{className:"text-lg font-bold",children:["$",xe.format(Number(e.buy))]})]}),x.jsxs("p",{className:"text-sm",children:["Venta: ",x.jsxs("span",{className:"text-lg font-bold",children:["$",xe.format(Number(e.sell))]})]})]}):x.jsx("p",{className:"text-sm text-muted-foreground",children:"Sin datos"})]})}function Ir(){const{data:e,isLoading:t}=gn(),{mutate:n,isPending:o}=xn(),r=e==null?void 0:e.find(c=>c.type==="BELO"),s=e==null?void 0:e.find(c=>c.type==="BLUE"),i=t||o;return x.jsxs("div",{className:"space-y-4",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("h1",{className:"text-2xl font-semibold",children:"Panel"}),x.jsxs("button",{type:"button",disabled:i,onClick:()=>n(),className:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[x.jsx(wn,{className:`h-4 w-4 ${i?"animate-spin":""}`}),"Actualizar"]})]}),x.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[x.jsxs("div",{className:"rounded-lg border p-4",children:[x.jsx("p",{className:"text-sm text-muted-foreground",children:"Total ingresos"}),x.jsx("p",{className:"text-2xl font-bold",children:"$0.00"})]}),x.jsxs("div",{className:"rounded-lg border p-4",children:[x.jsx("p",{className:"text-sm text-muted-foreground",children:"Gastos del mes"}),x.jsx("p",{className:"text-2xl font-bold",children:"$0.00"})]}),x.jsx(gt,{quote:r,title:"BELO"}),x.jsx(gt,{quote:s,title:"BLUE"})]})]})}const Hr=Ir;export{Hr as component};
