import{b as Pc,r as i,j as p,c as io,a as ft,R as Me,d as Tc}from"./router-zNjPR4CY.js";var Ac=Pc();function Go(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Se(...e){return t=>{let n=!1;const o=e.map(r=>{const s=Go(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r{let{children:s,...a}=o;Rr(s)&&typeof Lt=="function"&&(s=Lt(s._payload));const c=i.Children.toArray(s),l=c.find(Dc);if(l){const u=l.props.children,f=c.map(d=>d===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}var Nv=pt("Slot");function Nc(e){const t=i.forwardRef((n,o)=>{let{children:r,...s}=n;if(Rr(r)&&typeof Lt=="function"&&(r=Lt(r._payload)),i.isValidElement(r)){const a=Lc(r),c=Mc(s,r.props);return r.type!==i.Fragment&&(c.ref=o?Se(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oc=Symbol("radix.slottable");function Dc(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oc}function Mc(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Lc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function jc(e){const t=kc(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(Fc);if(l){const u=l.props.children,f=c.map(d=>d===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function kc(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=Bc(r),c=Vc(s,r.props);return r.type!==i.Fragment&&(c.ref=o?Se(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $c=Symbol("radix.slottable");function Fc(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$c}function Vc(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Bc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Wc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=Wc.reduce((e,t)=>{const n=jc(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function ao(e,t){e&&ft.flushSync(()=>e.dispatchEvent(t))}var G=globalThis?.document?i.useLayoutEffect:()=>{};function Hc(e,t){return i.useReducer((n,o)=>t[n][o]??n,e)}var X=e=>{const{present:t,children:n}=e,o=Kc(t),r=typeof n=="function"?n({present:o.isPresent}):i.Children.only(n),s=k(o.ref,Uc(r));return typeof n=="function"||o.isPresent?i.cloneElement(r,{ref:s}):null};X.displayName="Presence";function Kc(e){const[t,n]=i.useState(),o=i.useRef(null),r=i.useRef(e),s=i.useRef("none"),a=e?"mounted":"unmounted",[c,l]=Hc(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const u=Rt(o.current);s.current=c==="mounted"?u:"none"},[c]),G(()=>{const u=o.current,f=r.current;if(f!==e){const m=s.current,h=Rt(u);e?l("MOUNT"):h==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&m!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),G(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=h=>{const v=Rt(o.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(l("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},m=h=>{h.target===t&&(s.current=Rt(o.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:i.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function Rt(e){return e?.animationName||"none"}function Uc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function zc(e,t){const n=i.createContext(t),o=s=>{const{children:a,...c}=s,l=i.useMemo(()=>c,Object.values(c));return p.jsx(n.Provider,{value:l,children:a})};o.displayName=e+"Provider";function r(s){const a=i.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[o,r]}function Z(e,t=[]){let n=[];function o(s,a){const c=i.createContext(a),l=n.length;n=[...n,a];const u=d=>{const{scope:m,children:h,...w}=d,v=m?.[e]?.[l]||c,g=i.useMemo(()=>w,Object.values(w));return p.jsx(v.Provider,{value:g,children:h})};u.displayName=s+"Provider";function f(d,m){const h=m?.[e]?.[l]||c,w=i.useContext(h);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const r=()=>{const s=n.map(a=>i.createContext(a));return function(c){const l=c?.[e]||s;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,Gc(r,...t)]}function Gc(...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 a=o.reduce((c,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...c,...d}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function z(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>t.current?.(...n),[])}var Yc=i.createContext(void 0);function et(e){const t=i.useContext(Yc);return e||t||"ltr"}function at(e,[t,n]){return Math.min(n,Math.max(t,e))}function R(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Xc(e,t){return i.useReducer((n,o)=>t[n][o]??n,e)}var co="ScrollArea",[Pr]=Z(co),[qc,ce]=Pr(co),Tr=i.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:o="hover",dir:r,scrollHideDelay:s=600,...a}=e,[c,l]=i.useState(null),[u,f]=i.useState(null),[d,m]=i.useState(null),[h,w]=i.useState(null),[v,g]=i.useState(null),[x,y]=i.useState(0),[b,S]=i.useState(0),[C,P]=i.useState(!1),[E,N]=i.useState(!1),O=k(t,_=>l(_)),M=et(r);return p.jsx(qc,{scope:n,type:o,dir:M,scrollHideDelay:s,scrollArea:c,viewport:u,onViewportChange:f,content:d,onContentChange:m,scrollbarX:h,onScrollbarXChange:w,scrollbarXEnabled:C,onScrollbarXEnabledChange:P,scrollbarY:v,onScrollbarYChange:g,scrollbarYEnabled:E,onScrollbarYEnabledChange:N,onCornerWidthChange:y,onCornerHeightChange:S,children:p.jsx(D.div,{dir:M,...a,ref:O,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});Tr.displayName=co;var Ar="ScrollAreaViewport",_r=i.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:o,nonce:r,...s}=e,a=ce(Ar,n),c=i.useRef(null),l=k(t,c,a.onViewportChange);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),p.jsx(D.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:p.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});_r.displayName=Ar;var ge="ScrollAreaScrollbar",Zc=i.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=ce(ge,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=r,c=e.orientation==="horizontal";return i.useEffect(()=>(c?s(!0):a(!0),()=>{c?s(!1):a(!1)}),[c,s,a]),r.type==="hover"?p.jsx(Qc,{...o,ref:t,forceMount:n}):r.type==="scroll"?p.jsx(Jc,{...o,ref:t,forceMount:n}):r.type==="auto"?p.jsx(Ir,{...o,ref:t,forceMount:n}):r.type==="always"?p.jsx(lo,{...o,ref:t}):null});Zc.displayName=ge;var Qc=i.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=ce(ge,e.__scopeScrollArea),[s,a]=i.useState(!1);return i.useEffect(()=>{const c=r.scrollArea;let l=0;if(c){const u=()=>{window.clearTimeout(l),a(!0)},f=()=>{l=window.setTimeout(()=>a(!1),r.scrollHideDelay)};return c.addEventListener("pointerenter",u),c.addEventListener("pointerleave",f),()=>{window.clearTimeout(l),c.removeEventListener("pointerenter",u),c.removeEventListener("pointerleave",f)}}},[r.scrollArea,r.scrollHideDelay]),p.jsx(X,{present:n||s,children:p.jsx(Ir,{"data-state":s?"visible":"hidden",...o,ref:t})})}),Jc=i.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=ce(ge,e.__scopeScrollArea),s=e.orientation==="horizontal",a=Yt(()=>l("SCROLL_END"),100),[c,l]=Xc("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return i.useEffect(()=>{if(c==="idle"){const u=window.setTimeout(()=>l("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(u)}},[c,r.scrollHideDelay,l]),i.useEffect(()=>{const u=r.viewport,f=s?"scrollLeft":"scrollTop";if(u){let d=u[f];const m=()=>{const h=u[f];d!==h&&(l("SCROLL"),a()),d=h};return u.addEventListener("scroll",m),()=>u.removeEventListener("scroll",m)}},[r.viewport,s,l,a]),p.jsx(X,{present:n||c!=="hidden",children:p.jsx(lo,{"data-state":c==="hidden"?"hidden":"visible",...o,ref:t,onPointerEnter:R(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:R(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),Ir=i.forwardRef((e,t)=>{const n=ce(ge,e.__scopeScrollArea),{forceMount:o,...r}=e,[s,a]=i.useState(!1),c=e.orientation==="horizontal",l=Yt(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...o}=e,r=ce(ge,e.__scopeScrollArea),s=i.useRef(null),a=i.useRef(0),[c,l]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=Mr(c.viewport,c.content),f={...o,sizes:c,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:m=>s.current=m,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:m=>a.current=m};function d(m,h){return il(m,a.current,c,h)}return n==="horizontal"?p.jsx(el,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const m=r.viewport.scrollLeft,h=Yo(m,c,r.dir);s.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:m=>{r.viewport&&(r.viewport.scrollLeft=m)},onDragScroll:m=>{r.viewport&&(r.viewport.scrollLeft=d(m,r.dir))}}):n==="vertical"?p.jsx(tl,{...f,ref:t,onThumbPositionChange:()=>{if(r.viewport&&s.current){const m=r.viewport.scrollTop,h=Yo(m,c);s.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:m=>{r.viewport&&(r.viewport.scrollTop=m)},onDragScroll:m=>{r.viewport&&(r.viewport.scrollTop=d(m))}}):null}),el=i.forwardRef((e,t)=>{const{sizes:n,onSizesChange:o,...r}=e,s=ce(ge,e.__scopeScrollArea),[a,c]=i.useState(),l=i.useRef(null),u=k(t,l,s.onScrollbarXChange);return i.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),p.jsx(Or,{"data-orientation":"horizontal",...r,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Gt(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,d)=>{if(s.viewport){const m=s.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),jr(m,d)&&f.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&o({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:kt(a.paddingLeft),paddingEnd:kt(a.paddingRight)}})}})}),tl=i.forwardRef((e,t)=>{const{sizes:n,onSizesChange:o,...r}=e,s=ce(ge,e.__scopeScrollArea),[a,c]=i.useState(),l=i.useRef(null),u=k(t,l,s.onScrollbarYChange);return i.useEffect(()=>{l.current&&c(getComputedStyle(l.current))},[l]),p.jsx(Or,{"data-orientation":"vertical",...r,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Gt(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,d)=>{if(s.viewport){const m=s.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),jr(m,d)&&f.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&o({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:kt(a.paddingTop),paddingEnd:kt(a.paddingBottom)}})}})}),[nl,Nr]=Pr(ge),Or=i.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:r,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:c,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:f,onResize:d,...m}=e,h=ce(ge,n),[w,v]=i.useState(null),g=k(t,O=>v(O)),x=i.useRef(null),y=i.useRef(""),b=h.viewport,S=o.content-o.viewport,C=z(f),P=z(l),E=Yt(d,10);function N(O){if(x.current){const M=O.clientX-x.current.left,_=O.clientY-x.current.top;u({x:M,y:_})}}return i.useEffect(()=>{const O=M=>{const _=M.target;w?.contains(_)&&C(M,S)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[b,w,S,C]),i.useEffect(P,[o,P]),qe(w,E),qe(h.content,E),p.jsx(nl,{scope:n,scrollbar:w,hasThumb:r,onThumbChange:z(s),onThumbPointerUp:z(a),onThumbPositionChange:P,onThumbPointerDown:z(c),children:p.jsx(D.div,{...m,ref:g,style:{position:"absolute",...m.style},onPointerDown:R(e.onPointerDown,O=>{O.button===0&&(O.target.setPointerCapture(O.pointerId),x.current=w.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),N(O))}),onPointerMove:R(e.onPointerMove,N),onPointerUp:R(e.onPointerUp,O=>{const M=O.target;M.hasPointerCapture(O.pointerId)&&M.releasePointerCapture(O.pointerId),document.body.style.webkitUserSelect=y.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),jt="ScrollAreaThumb",ol=i.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=Nr(jt,e.__scopeScrollArea);return p.jsx(X,{present:n||r.hasThumb,children:p.jsx(rl,{ref:t,...o})})}),rl=i.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:o,...r}=e,s=ce(jt,n),a=Nr(jt,n),{onThumbPositionChange:c}=a,l=k(t,d=>a.onThumbChange(d)),u=i.useRef(void 0),f=Yt(()=>{u.current&&(u.current(),u.current=void 0)},100);return i.useEffect(()=>{const d=s.viewport;if(d){const m=()=>{if(f(),!u.current){const h=al(d,c);u.current=h,c()}};return c(),d.addEventListener("scroll",m),()=>d.removeEventListener("scroll",m)}},[s.viewport,f,c]),p.jsx(D.div,{"data-state":a.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:R(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),w=d.clientX-h.left,v=d.clientY-h.top;a.onThumbPointerDown({x:w,y:v})}),onPointerUp:R(e.onPointerUp,a.onThumbPointerUp)})});ol.displayName=jt;var uo="ScrollAreaCorner",Dr=i.forwardRef((e,t)=>{const n=ce(uo,e.__scopeScrollArea),o=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&o?p.jsx(sl,{...e,ref:t}):null});Dr.displayName=uo;var sl=i.forwardRef((e,t)=>{const{__scopeScrollArea:n,...o}=e,r=ce(uo,n),[s,a]=i.useState(0),[c,l]=i.useState(0),u=!!(s&&c);return qe(r.scrollbarX,()=>{const f=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(f),l(f)}),qe(r.scrollbarY,()=>{const f=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(f),a(f)}),u?p.jsx(D.div,{...o,ref:t,style:{width:s,height:c,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function kt(e){return e?parseInt(e,10):0}function Mr(e,t){const n=e/t;return isNaN(n)?0:n}function Gt(e){const t=Mr(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-n)*t;return Math.max(o,18)}function il(e,t,n,o="ltr"){const r=Gt(n),s=r/2,a=t||s,c=r-a,l=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-c,f=n.content-n.viewport,d=o==="ltr"?[0,f]:[f*-1,0];return Lr([l,u],d)(e)}function Yo(e,t,n="ltr"){const o=Gt(t),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-r,a=t.content-t.viewport,c=s-o,l=n==="ltr"?[0,a]:[a*-1,0],u=at(e,l);return Lr([0,a],[0,c])(u)}function Lr(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function jr(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},o=0;return(function r(){const s={left:e.scrollLeft,top:e.scrollTop},a=n.left!==s.left,c=n.top!==s.top;(a||c)&&t(),n=s,o=window.requestAnimationFrame(r)})(),()=>window.cancelAnimationFrame(o)};function Yt(e,t){const n=z(e),o=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),i.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(n,t)},[n,t])}function qe(e,t){const n=z(t);G(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,n])}var Ov=Tr,Dv=_r,Mv=Dr,cl=io[" useInsertionEffect ".trim().toString()]||G;function ae({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,a]=ll({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:r;{const f=i.useRef(e!==void 0);i.useEffect(()=>{const d=f.current;d!==c&&console.warn(`${o} is changing from ${d?"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.`),f.current=c},[c,o])}const u=i.useCallback(f=>{if(c){const d=ul(f)?f(e):f;d!==e&&a.current?.(d)}else s(f)},[c,e,s,a]);return[l,u]}function ll({defaultProp:e,onChange:t}){const[n,o]=i.useState(e),r=i.useRef(n),s=i.useRef(t);return cl(()=>{s.current=t},[t]),i.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}function ul(e){return typeof e=="function"}var dl=io[" useId ".trim().toString()]||(()=>{}),fl=0;function ue(e){const[t,n]=i.useState(dl());return G(()=>{n(o=>o??String(fl++))},[e]),t?`radix-${t}`:""}var Xt="Collapsible",[pl,Lv]=Z(Xt),[ml,fo]=pl(Xt),kr=i.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:r,disabled:s,onOpenChange:a,...c}=e,[l,u]=ae({prop:o,defaultProp:r??!1,onChange:a,caller:Xt});return p.jsx(ml,{scope:n,disabled:s,contentId:ue(),open:l,onOpenToggle:i.useCallback(()=>u(f=>!f),[u]),children:p.jsx(D.div,{"data-state":mo(l),"data-disabled":s?"":void 0,...c,ref:t})})});kr.displayName=Xt;var $r="CollapsibleTrigger",Fr=i.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=fo($r,n);return p.jsx(D.button,{type:"button","aria-controls":r.contentId,"aria-expanded":r.open||!1,"data-state":mo(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:R(e.onClick,r.onOpenToggle)})});Fr.displayName=$r;var po="CollapsibleContent",Vr=i.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=fo(po,e.__scopeCollapsible);return p.jsx(X,{present:n||r.open,children:({present:s})=>p.jsx(vl,{...o,ref:t,present:s})})});Vr.displayName=po;var vl=i.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:r,...s}=e,a=fo(po,n),[c,l]=i.useState(o),u=i.useRef(null),f=k(t,u),d=i.useRef(0),m=d.current,h=i.useRef(0),w=h.current,v=a.open||c,g=i.useRef(v),x=i.useRef(void 0);return i.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),G(()=>{const y=u.current;if(y){x.current=x.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const b=y.getBoundingClientRect();d.current=b.height,h.current=b.width,g.current||(y.style.transitionDuration=x.current.transitionDuration,y.style.animationName=x.current.animationName),l(o)}},[a.open,o]),p.jsx(D.div,{"data-state":mo(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...s,ref:f,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:v&&r})});function mo(e){return e?"open":"closed"}var jv=kr,kv=Fr,$v=Vr,hl=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],gl=hl.reduce((e,t)=>{const n=pt(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),wl="Label",Br=i.forwardRef((e,t)=>p.jsx(gl.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Br.displayName=wl;var Fv=Br;function Xo(e){const t=xl(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(bl);if(l){const u=l.props.children,f=c.map(d=>d===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function xl(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=Cl(r),c=Sl(s,r.props);return r.type!==i.Fragment&&(c.ref=o?Se(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yl=Symbol("radix.slottable");function bl(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yl}function Sl(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Cl(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function mt(e){const t=e+"CollectionProvider",[n,o]=Z(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:g,children:x}=v,y=Me.useRef(null),b=Me.useRef(new Map).current;return p.jsx(r,{scope:g,itemMap:b,collectionRef:y,children:x})};a.displayName=t;const c=e+"CollectionSlot",l=Xo(c),u=Me.forwardRef((v,g)=>{const{scope:x,children:y}=v,b=s(c,x),S=k(g,b.collectionRef);return p.jsx(l,{ref:S,children:y})});u.displayName=c;const f=e+"CollectionItemSlot",d="data-radix-collection-item",m=Xo(f),h=Me.forwardRef((v,g)=>{const{scope:x,children:y,...b}=v,S=Me.useRef(null),C=k(g,S),P=s(f,x);return Me.useEffect(()=>(P.itemMap.set(S,{ref:S,...b}),()=>{P.itemMap.delete(S)})),p.jsx(m,{[d]:"",ref:C,children:y})});h.displayName=f;function w(v){const g=s(e+"CollectionConsumer",v);return Me.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((P,E)=>b.indexOf(P.ref.current)-b.indexOf(E.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:u,ItemSlot:h},w,o]}function El(e,t=globalThis?.document){const n=z(e);i.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 Rl="DismissableLayer",Vn="dismissableLayer.update",Pl="dismissableLayer.pointerDownOutside",Tl="dismissableLayer.focusOutside",qo,Wr=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ve=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:a,onDismiss:c,...l}=e,u=i.useContext(Wr),[f,d]=i.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=i.useState({}),w=k(t,E=>d(E)),v=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(g),y=f?v.indexOf(f):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,S=y>=x,C=_l(E=>{const N=E.target,O=[...u.branches].some(M=>M.contains(N));!S||O||(r?.(E),a?.(E),E.defaultPrevented||c?.())},m),P=Il(E=>{const N=E.target;[...u.branches].some(M=>M.contains(N))||(s?.(E),a?.(E),E.defaultPrevented||c?.())},m);return El(E=>{y===u.layers.size-1&&(o?.(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},m),i.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(qo=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Zo(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=qo)}},[f,m,n,u]),i.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Zo())},[f,u]),i.useEffect(()=>{const E=()=>h({});return document.addEventListener(Vn,E),()=>document.removeEventListener(Vn,E)},[]),p.jsx(D.div,{...l,ref:w,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:R(e.onFocusCapture,P.onFocusCapture),onBlurCapture:R(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,C.onPointerDownCapture)})});Ve.displayName=Rl;var Al="DismissableLayerBranch",Hr=i.forwardRef((e,t)=>{const n=i.useContext(Wr),o=i.useRef(null),r=k(t,o);return i.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(D.div,{...e,ref:r})});Hr.displayName=Al;function _l(e,t=globalThis?.document){const n=z(e),o=i.useRef(!1),r=i.useRef(()=>{});return i.useEffect(()=>{const s=c=>{if(c.target&&!o.current){let l=function(){Kr(Pl,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Il(e,t=globalThis?.document){const n=z(e),o=i.useRef(!1);return i.useEffect(()=>{const r=s=>{s.target&&!o.current&&Kr(Tl,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 Zo(){const e=new CustomEvent(Vn);document.dispatchEvent(e)}function Kr(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?ao(r,s):r.dispatchEvent(s)}var Nl=Ve,Ol=Hr,Dl="Portal",Be=i.forwardRef((e,t)=>{const{container:n,...o}=e,[r,s]=i.useState(!1);G(()=>s(!0),[]);const a=n||r&&globalThis?.document?.body;return a?Tc.createPortal(p.jsx(D.div,{...o,ref:t}),a):null});Be.displayName=Dl;var Ur=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"}),Ml="VisuallyHidden",qt=i.forwardRef((e,t)=>p.jsx(D.span,{...e,ref:t,style:{...Ur,...e.style}}));qt.displayName=Ml;var Ll=qt,vo="ToastProvider",[ho,jl,kl]=mt("Toast"),[zr]=Z("Toast",[kl]),[$l,Zt]=zr(vo),Gr=e=>{const{__scopeToast:t,label:n="Notification",duration:o=5e3,swipeDirection:r="right",swipeThreshold:s=50,children:a}=e,[c,l]=i.useState(null),[u,f]=i.useState(0),d=i.useRef(!1),m=i.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${vo}\`. Expected non-empty \`string\`.`),p.jsx(ho.Provider,{scope:t,children:p.jsx($l,{scope:t,label:n,duration:o,swipeDirection:r,swipeThreshold:s,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:i.useCallback(()=>f(h=>h+1),[]),onToastRemove:i.useCallback(()=>f(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:m,children:a})})};Gr.displayName=vo;var Yr="ToastViewport",Fl=["F8"],Bn="toast.viewportPause",Wn="toast.viewportResume",Xr=i.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:o=Fl,label:r="Notifications ({hotkey})",...s}=e,a=Zt(Yr,n),c=jl(n),l=i.useRef(null),u=i.useRef(null),f=i.useRef(null),d=i.useRef(null),m=k(t,d,a.onViewportChange),h=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=a.toastCount>0;i.useEffect(()=>{const g=x=>{o.length!==0&&o.every(b=>x[b]||x.code===b)&&d.current?.focus()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[o]),i.useEffect(()=>{const g=l.current,x=d.current;if(w&&g&&x){const y=()=>{if(!a.isClosePausedRef.current){const P=new CustomEvent(Bn);x.dispatchEvent(P),a.isClosePausedRef.current=!0}},b=()=>{if(a.isClosePausedRef.current){const P=new CustomEvent(Wn);x.dispatchEvent(P),a.isClosePausedRef.current=!1}},S=P=>{!g.contains(P.relatedTarget)&&b()},C=()=>{g.contains(document.activeElement)||b()};return g.addEventListener("focusin",y),g.addEventListener("focusout",S),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",C),window.addEventListener("blur",y),window.addEventListener("focus",b),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",C),window.removeEventListener("blur",y),window.removeEventListener("focus",b)}}},[w,a.isClosePausedRef]);const v=i.useCallback(({tabbingDirection:g})=>{const y=c().map(b=>{const S=b.ref.current,C=[S,...Ql(S)];return g==="forwards"?C:C.reverse()});return(g==="forwards"?y.reverse():y).flat()},[c]);return i.useEffect(()=>{const g=d.current;if(g){const x=y=>{const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const C=document.activeElement,P=y.shiftKey;if(y.target===g&&P){u.current?.focus();return}const O=v({tabbingDirection:P?"backwards":"forwards"}),M=O.findIndex(_=>_===C);An(O.slice(M+1))?y.preventDefault():P?u.current?.focus():f.current?.focus()}};return g.addEventListener("keydown",x),()=>g.removeEventListener("keydown",x)}},[c,v]),p.jsxs(Ol,{ref:l,role:"region","aria-label":r.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&p.jsx(Hn,{ref:u,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"forwards"});An(g)}}),p.jsx(ho.Slot,{scope:n,children:p.jsx(D.ol,{tabIndex:-1,...s,ref:m})}),w&&p.jsx(Hn,{ref:f,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"backwards"});An(g)}})]})});Xr.displayName=Yr;var qr="ToastFocusProxy",Hn=i.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:o,...r}=e,s=Zt(qr,n);return p.jsx(qt,{tabIndex:0,...r,ref:t,style:{position:"fixed"},onFocus:a=>{const c=a.relatedTarget;!s.viewport?.contains(c)&&o()}})});Hn.displayName=qr;var vt="Toast",Vl="toast.swipeStart",Bl="toast.swipeMove",Wl="toast.swipeCancel",Hl="toast.swipeEnd",Zr=i.forwardRef((e,t)=>{const{forceMount:n,open:o,defaultOpen:r,onOpenChange:s,...a}=e,[c,l]=ae({prop:o,defaultProp:r??!0,onChange:s,caller:vt});return p.jsx(X,{present:n||c,children:p.jsx(zl,{open:c,...a,ref:t,onClose:()=>l(!1),onPause:z(e.onPause),onResume:z(e.onResume),onSwipeStart:R(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:R(e.onSwipeMove,u=>{const{x:f,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:R(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:R(e.onSwipeEnd,u=>{const{x:f,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});Zr.displayName=vt;var[Kl,Ul]=zr(vt,{onClose(){}}),zl=i.forwardRef((e,t)=>{const{__scopeToast:n,type:o="foreground",duration:r,open:s,onClose:a,onEscapeKeyDown:c,onPause:l,onResume:u,onSwipeStart:f,onSwipeMove:d,onSwipeCancel:m,onSwipeEnd:h,...w}=e,v=Zt(vt,n),[g,x]=i.useState(null),y=k(t,A=>x(A)),b=i.useRef(null),S=i.useRef(null),C=r||v.duration,P=i.useRef(0),E=i.useRef(C),N=i.useRef(0),{onToastAdd:O,onToastRemove:M}=v,_=z(()=>{g?.contains(document.activeElement)&&v.viewport?.focus(),a()}),$=i.useCallback(A=>{!A||A===1/0||(window.clearTimeout(N.current),P.current=new Date().getTime(),N.current=window.setTimeout(_,A))},[_]);i.useEffect(()=>{const A=v.viewport;if(A){const V=()=>{$(E.current),u?.()},j=()=>{const F=new Date().getTime()-P.current;E.current=E.current-F,window.clearTimeout(N.current),l?.()};return A.addEventListener(Bn,j),A.addEventListener(Wn,V),()=>{A.removeEventListener(Bn,j),A.removeEventListener(Wn,V)}}},[v.viewport,C,l,u,$]),i.useEffect(()=>{s&&!v.isClosePausedRef.current&&$(C)},[s,C,v.isClosePausedRef,$]),i.useEffect(()=>(O(),()=>M()),[O,M]);const B=i.useMemo(()=>g?rs(g):null,[g]);return v.viewport?p.jsxs(p.Fragment,{children:[B&&p.jsx(Gl,{__scopeToast:n,role:"status","aria-live":o==="foreground"?"assertive":"polite",children:B}),p.jsx(Kl,{scope:n,onClose:_,children:ft.createPortal(p.jsx(ho.ItemSlot,{scope:n,children:p.jsx(Nl,{asChild:!0,onEscapeKeyDown:R(c,()=>{v.isFocusedToastEscapeKeyDownRef.current||_(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:p.jsx(D.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection,...w,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:R(e.onKeyDown,A=>{A.key==="Escape"&&(c?.(A.nativeEvent),A.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,_()))}),onPointerDown:R(e.onPointerDown,A=>{A.button===0&&(b.current={x:A.clientX,y:A.clientY})}),onPointerMove:R(e.onPointerMove,A=>{if(!b.current)return;const V=A.clientX-b.current.x,j=A.clientY-b.current.y,F=!!S.current,I=["left","right"].includes(v.swipeDirection),T=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,U=I?T(0,V):0,q=I?0:T(0,j),Q=A.pointerType==="touch"?10:2,te={x:U,y:q},J={originalEvent:A,delta:te};F?(S.current=te,Pt(Bl,d,J,{discrete:!1})):Qo(te,v.swipeDirection,Q)?(S.current=te,Pt(Vl,f,J,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(V)>Q||Math.abs(j)>Q)&&(b.current=null)}),onPointerUp:R(e.onPointerUp,A=>{const V=S.current,j=A.target;if(j.hasPointerCapture(A.pointerId)&&j.releasePointerCapture(A.pointerId),S.current=null,b.current=null,V){const F=A.currentTarget,I={originalEvent:A,delta:V};Qo(V,v.swipeDirection,v.swipeThreshold)?Pt(Hl,h,I,{discrete:!0}):Pt(Wl,m,I,{discrete:!0}),F.addEventListener("click",T=>T.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),Gl=e=>{const{__scopeToast:t,children:n,...o}=e,r=Zt(vt,t),[s,a]=i.useState(!1),[c,l]=i.useState(!1);return ql(()=>a(!0)),i.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),c?null:p.jsx(Be,{asChild:!0,children:p.jsx(qt,{...o,children:s&&p.jsxs(p.Fragment,{children:[r.label," ",n]})})})},Yl="ToastTitle",Qr=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return p.jsx(D.div,{...o,ref:t})});Qr.displayName=Yl;var Xl="ToastDescription",Jr=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e;return p.jsx(D.div,{...o,ref:t})});Jr.displayName=Xl;var es="ToastAction",ts=i.forwardRef((e,t)=>{const{altText:n,...o}=e;return n.trim()?p.jsx(os,{altText:n,asChild:!0,children:p.jsx(go,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${es}\`. Expected non-empty \`string\`.`),null)});ts.displayName=es;var ns="ToastClose",go=i.forwardRef((e,t)=>{const{__scopeToast:n,...o}=e,r=Ul(ns,n);return p.jsx(os,{asChild:!0,children:p.jsx(D.button,{type:"button",...o,ref:t,onClick:R(e.onClick,r.onClose)})})});go.displayName=ns;var os=i.forwardRef((e,t)=>{const{__scopeToast:n,altText:o,...r}=e;return p.jsx(D.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...r,ref:t})});function rs(e){const t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),Zl(o)){const r=o.ariaHidden||o.hidden||o.style.display==="none",s=o.dataset.radixToastAnnounceExclude==="";if(!r)if(s){const a=o.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...rs(o))}}),t}function Pt(e,t,n,{discrete:o}){const r=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?ao(r,s):r.dispatchEvent(s)}var Qo=(e,t,n=0)=>{const o=Math.abs(e.x),r=Math.abs(e.y),s=o>r;return t==="left"||t==="right"?s&&o>n:!s&&r>n};function ql(e=()=>{}){const t=z(e);G(()=>{let n=0,o=0;return n=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(o)}},[t])}function Zl(e){return e.nodeType===e.ELEMENT_NODE}function Ql(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function An(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Vv=Gr,Bv=Xr,Wv=Zr,Hv=Qr,Kv=Jr,Uv=ts,zv=go;const Jl=["top","right","bottom","left"],Te=Math.min,oe=Math.max,$t=Math.round,Tt=Math.floor,he=e=>({x:e,y:e}),eu={left:"right",right:"left",bottom:"top",top:"bottom"};function Kn(e,t,n){return oe(e,Te(t,n))}function ye(e,t){return typeof e=="function"?e(t):e}function be(e){return e.split("-")[0]}function tt(e){return e.split("-")[1]}function wo(e){return e==="x"?"y":"x"}function xo(e){return e==="y"?"height":"width"}function ve(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function yo(e){return wo(ve(e))}function tu(e,t,n){n===void 0&&(n=!1);const o=tt(e),r=yo(e),s=xo(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Ft(a)),[a,Ft(a)]}function nu(e){const t=Ft(e);return[Un(e),t,Un(t)]}function Un(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Jo=["left","right"],er=["right","left"],ou=["top","bottom"],ru=["bottom","top"];function su(e,t,n){switch(e){case"top":case"bottom":return n?t?er:Jo:t?Jo:er;case"left":case"right":return t?ou:ru;default:return[]}}function iu(e,t,n,o){const r=tt(e);let s=su(be(e),n==="start",o);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(Un)))),s}function Ft(e){const t=be(e);return eu[t]+e.slice(t.length)}function au(e){return{top:0,right:0,bottom:0,left:0,...e}}function ss(e){return typeof e!="number"?au(e):{top:e,right:e,bottom:e,left:e}}function Vt(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 tr(e,t,n){let{reference:o,floating:r}=e;const s=ve(t),a=yo(t),c=xo(a),l=be(t),u=s==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,m=o[c]/2-r[c]/2;let h;switch(l){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-r.width,y:d};break;default:h={x:o.x,y:o.y}}switch(tt(t)){case"start":h[a]-=m*(n&&u?-1:1);break;case"end":h[a]+=m*(n&&u?-1:1);break}return h}async function cu(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:a,elements:c,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:h=0}=ye(t,e),w=ss(h),g=c[m?d==="floating"?"reference":"floating":d],x=Vt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:l})),y=d==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),S=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},C=Vt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:b,strategy:l}):y);return{top:(x.top-C.top+w.top)/S.y,bottom:(C.bottom-x.bottom+w.bottom)/S.y,left:(x.left-C.left+w.left)/S.x,right:(C.right-x.right+w.right)/S.x}}const lu=50,uu=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,c=a.detectOverflow?a:{...a,detectOverflow:cu},l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:d}=tr(u,o,l),m=o,h=0;const w={};for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:a,elements:c,middlewareData:l}=t,{element:u,padding:f=0}=ye(e,t)||{};if(u==null)return{};const d=ss(f),m={x:n,y:o},h=yo(r),w=xo(h),v=await a.getDimensions(u),g=h==="y",x=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",S=s.reference[w]+s.reference[h]-m[h]-s.floating[w],C=m[h]-s.reference[h],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let E=P?P[b]:0;(!E||!await(a.isElement==null?void 0:a.isElement(P)))&&(E=c.floating[b]||s.floating[w]);const N=S/2-C/2,O=E/2-v[w]/2-1,M=Te(d[x],O),_=Te(d[y],O),$=M,B=E-v[w]-_,A=E/2-v[w]/2+N,V=Kn($,A,B),j=!l.arrow&&tt(r)!=null&&A!==V&&s.reference[w]/2-(A<$?M:_)-v[w]/2<0,F=j?A<$?A-$:A-B:0;return{[h]:m[h]+F,data:{[h]:V,centerOffset:A-V-F,...j&&{alignmentOffset:F}},reset:j}}}),fu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:a,initialPlacement:c,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:v=!0,...g}=ye(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=be(r),y=ve(c),b=be(c)===c,S=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=m||(b||!v?[Ft(c)]:nu(c)),P=w!=="none";!m&&P&&C.push(...iu(c,v,w,S));const E=[c,...C],N=await l.detectOverflow(t,g),O=[];let M=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&O.push(N[x]),d){const A=tu(r,a,S);O.push(N[A[0]],N[A[1]])}if(M=[...M,{placement:r,overflows:O}],!O.every(A=>A<=0)){var _,$;const A=(((_=s.flip)==null?void 0:_.index)||0)+1,V=E[A];if(V&&(!(d==="alignment"?y!==ve(V):!1)||M.every(I=>ve(I.placement)===y?I.overflows[0]>0:!0)))return{data:{index:A,overflows:M},reset:{placement:V}};let j=($=M.filter(F=>F.overflows[0]<=0).sort((F,I)=>F.overflows[1]-I.overflows[1])[0])==null?void 0:$.placement;if(!j)switch(h){case"bestFit":{var B;const F=(B=M.filter(I=>{if(P){const T=ve(I.placement);return T===y||T==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(T=>T>0).reduce((T,U)=>T+U,0)]).sort((I,T)=>I[1]-T[1])[0])==null?void 0:B[0];F&&(j=F);break}case"initialPlacement":j=c;break}if(r!==j)return{reset:{placement:j}}}return{}}}};function nr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function or(e){return Jl.some(t=>e[t]>=0)}const pu=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=ye(e,t);switch(r){case"referenceHidden":{const a=await o.detectOverflow(t,{...s,elementContext:"reference"}),c=nr(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:or(c)}}}case"escaped":{const a=await o.detectOverflow(t,{...s,altBoundary:!0}),c=nr(a,n.floating);return{data:{escapedOffsets:c,escaped:or(c)}}}default:return{}}}}},is=new Set(["left","top"]);async function mu(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=be(n),c=tt(n),l=ve(n)==="y",u=is.has(a)?-1:1,f=s&&l?-1:1,d=ye(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof w=="number"&&(h=c==="end"?w*-1:w),l?{x:h*f,y:m*u}:{x:m*u,y:h*f}}const vu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:a,middlewareData:c}=t,l=await mu(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:a}}}}},hu=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:a=!0,crossAxis:c=!1,limiter:l={fn:x=>{let{x:y,y:b}=x;return{x:y,y:b}}},...u}=ye(e,t),f={x:n,y:o},d=await s.detectOverflow(t,u),m=ve(be(r)),h=wo(m);let w=f[h],v=f[m];if(a){const x=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=w+d[x],S=w-d[y];w=Kn(b,w,S)}if(c){const x=m==="y"?"top":"left",y=m==="y"?"bottom":"right",b=v+d[x],S=v-d[y];v=Kn(b,v,S)}const g=l.fn({...t,[h]:w,[m]:v});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[h]:a,[m]:c}}}}}},gu=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:a}=t,{offset:c=0,mainAxis:l=!0,crossAxis:u=!0}=ye(e,t),f={x:n,y:o},d=ve(r),m=wo(d);let h=f[m],w=f[d];const v=ye(c,t),g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const b=m==="y"?"height":"width",S=s.reference[m]-s.floating[b]+g.mainAxis,C=s.reference[m]+s.reference[b]-g.mainAxis;hC&&(h=C)}if(u){var x,y;const b=m==="y"?"width":"height",S=is.has(be(r)),C=s.reference[d]-s.floating[b]+(S&&((x=a.offset)==null?void 0:x[d])||0)+(S?0:g.crossAxis),P=s.reference[d]+s.reference[b]+(S?0:((y=a.offset)==null?void 0:y[d])||0)-(S?g.crossAxis:0);wP&&(w=P)}return{[m]:h,[d]:w}}}},wu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:a,elements:c}=t,{apply:l=()=>{},...u}=ye(e,t),f=await a.detectOverflow(t,u),d=be(r),m=tt(r),h=ve(r)==="y",{width:w,height:v}=s.floating;let g,x;d==="top"||d==="bottom"?(g=d,x=m===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(x=d,g=m==="end"?"top":"bottom");const y=v-f.top-f.bottom,b=w-f.left-f.right,S=Te(v-f[g],y),C=Te(w-f[x],b),P=!t.middlewareData.shift;let E=S,N=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(E=y),P&&!m){const M=oe(f.left,0),_=oe(f.right,0),$=oe(f.top,0),B=oe(f.bottom,0);h?N=w-2*(M!==0||_!==0?M+_:oe(f.left,f.right)):E=v-2*($!==0||B!==0?$+B:oe(f.top,f.bottom))}await l({...t,availableWidth:N,availableHeight:E});const O=await a.getDimensions(c.floating);return w!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function Qt(){return typeof window<"u"}function nt(e){return as(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function we(e){var t;return(t=(as(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function as(e){return Qt()?e instanceof Node||e instanceof re(e).Node:!1}function de(e){return Qt()?e instanceof Element||e instanceof re(e).Element:!1}function Ce(e){return Qt()?e instanceof HTMLElement||e instanceof re(e).HTMLElement:!1}function rr(e){return!Qt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}function ht(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function xu(e){return/^(table|td|th)$/.test(nt(e))}function Jt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const yu=/transform|translate|scale|rotate|perspective|filter/,bu=/paint|layout|strict|content/,Le=e=>!!e&&e!=="none";let _n;function bo(e){const t=de(e)?fe(e):e;return Le(t.transform)||Le(t.translate)||Le(t.scale)||Le(t.rotate)||Le(t.perspective)||!So()&&(Le(t.backdropFilter)||Le(t.filter))||yu.test(t.willChange||"")||bu.test(t.contain||"")}function Su(e){let t=Ae(e);for(;Ce(t)&&!Ze(t);){if(bo(t))return t;if(Jt(t))return null;t=Ae(t)}return null}function So(){return _n==null&&(_n=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_n}function Ze(e){return/^(html|body|#document)$/.test(nt(e))}function fe(e){return re(e).getComputedStyle(e)}function en(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ae(e){if(nt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rr(e)&&e.host||we(e);return rr(t)?t.host:t}function cs(e){const t=Ae(e);return Ze(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ce(t)&&ht(t)?t:cs(t)}function ct(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=cs(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=re(r);if(s){const c=zn(a);return t.concat(a,a.visualViewport||[],ht(r)?r:[],c&&n?ct(c):[])}else return t.concat(r,ct(r,[],n))}function zn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ls(e){const t=fe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ce(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,c=$t(n)!==s||$t(o)!==a;return c&&(n=s,o=a),{width:n,height:o,$:c}}function Co(e){return de(e)?e:e.contextElement}function Ge(e){const t=Co(e);if(!Ce(t))return he(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=ls(t);let a=(s?$t(n.width):n.width)/o,c=(s?$t(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const Cu=he(0);function us(e){const t=re(e);return!So()||!t.visualViewport?Cu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Eu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==re(e)?!1:t}function je(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Co(e);let a=he(1);t&&(o?de(o)&&(a=Ge(o)):a=Ge(e));const c=Eu(s,n,o)?us(s):he(0);let l=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,f=r.width/a.x,d=r.height/a.y;if(s){const m=re(s),h=o&&de(o)?re(o):o;let w=m,v=zn(w);for(;v&&o&&h!==w;){const g=Ge(v),x=v.getBoundingClientRect(),y=fe(v),b=x.left+(v.clientLeft+parseFloat(y.paddingLeft))*g.x,S=x.top+(v.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,d*=g.y,l+=b,u+=S,w=re(v),v=zn(w)}}return Vt({width:f,height:d,x:l,y:u})}function tn(e,t){const n=en(e).scrollLeft;return t?t.left+n:je(we(e)).left+n}function ds(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-tn(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Ru(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",a=we(o),c=t?Jt(t.floating):!1;if(o===a||c&&s)return n;let l={scrollLeft:0,scrollTop:0},u=he(1);const f=he(0),d=Ce(o);if((d||!d&&!s)&&((nt(o)!=="body"||ht(a))&&(l=en(o)),d)){const h=je(o);u=Ge(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const m=a&&!d&&!s?ds(a,l):he(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+m.x,y:n.y*u.y-l.scrollTop*u.y+f.y+m.y}}function Pu(e){return Array.from(e.getClientRects())}function Tu(e){const t=we(e),n=en(e),o=e.ownerDocument.body,r=oe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=oe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+tn(e);const c=-n.scrollTop;return fe(o).direction==="rtl"&&(a+=oe(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:c}}const sr=25;function Au(e,t){const n=re(e),o=we(e),r=n.visualViewport;let s=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){s=r.width,a=r.height;const f=So();(!f||f&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const u=tn(o);if(u<=0){const f=o.ownerDocument,d=f.body,m=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,w=Math.abs(o.clientWidth-d.clientWidth-h);w<=sr&&(s-=w)}else u<=sr&&(s+=u);return{width:s,height:a,x:c,y:l}}function _u(e,t){const n=je(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Ce(e)?Ge(e):he(1),a=e.clientWidth*s.x,c=e.clientHeight*s.y,l=r*s.x,u=o*s.y;return{width:a,height:c,x:l,y:u}}function ir(e,t,n){let o;if(t==="viewport")o=Au(e,n);else if(t==="document")o=Tu(we(e));else if(de(t))o=_u(t,n);else{const r=us(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Vt(o)}function fs(e,t){const n=Ae(e);return n===t||!de(n)||Ze(n)?!1:fe(n).position==="fixed"||fs(n,t)}function Iu(e,t){const n=t.get(e);if(n)return n;let o=ct(e,[],!1).filter(c=>de(c)&&nt(c)!=="body"),r=null;const s=fe(e).position==="fixed";let a=s?Ae(e):e;for(;de(a)&&!Ze(a);){const c=fe(a),l=bo(a);!l&&c.position==="fixed"&&(r=null),(s?!l&&!r:!l&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||ht(a)&&!l&&fs(e,a))?o=o.filter(f=>f!==a):r=c,a=Ae(a)}return t.set(e,o),o}function Nu(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Jt(t)?[]:Iu(t,this._c):[].concat(n),o],c=ir(t,a[0],r);let l=c.top,u=c.right,f=c.bottom,d=c.left;for(let m=1;m{a(!1,1e-7)},1e3)}E===1&&!ms(u,e.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(C,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,b)}n.observe(e)}return a(!0),s}function $u(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=Co(e),f=r||s?[...u?ct(u):[],...t?ct(t):[]]:[];f.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const d=u&&c?ku(u,n):null;let m=-1,h=null;a&&(h=new ResizeObserver(x=>{let[y]=x;y&&y.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),u&&!l&&h.observe(u),t&&h.observe(t));let w,v=l?je(e):null;l&&g();function g(){const x=je(e);v&&!ms(v,x)&&n(),v=x,w=requestAnimationFrame(g)}return n(),()=>{var x;f.forEach(y=>{r&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d?.(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(w)}}const Fu=vu,Vu=hu,Bu=fu,Wu=wu,Hu=pu,cr=du,Ku=gu,Uu=(e,t,n)=>{const o=new Map,r={platform:ju,...n},s={...r.platform,_c:o};return uu(e,t,{...r,platform:s})};var zu=typeof document<"u",Gu=function(){},Ot=zu?i.useLayoutEffect:Gu;function Bt(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(!Bt(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)&&!Bt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function vs(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lr(e,t){const n=vs(e);return Math.round(t*n)/n}function Nn(e){const t=i.useRef(e);return Ot(()=>{t.current=e}),t}function Yu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:a}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[f,d]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=i.useState(o);Bt(m,o)||h(o);const[w,v]=i.useState(null),[g,x]=i.useState(null),y=i.useCallback(I=>{I!==P.current&&(P.current=I,v(I))},[]),b=i.useCallback(I=>{I!==E.current&&(E.current=I,x(I))},[]),S=s||w,C=a||g,P=i.useRef(null),E=i.useRef(null),N=i.useRef(f),O=l!=null,M=Nn(l),_=Nn(r),$=Nn(u),B=i.useCallback(()=>{if(!P.current||!E.current)return;const I={placement:t,strategy:n,middleware:m};_.current&&(I.platform=_.current),Uu(P.current,E.current,I).then(T=>{const U={...T,isPositioned:$.current!==!1};A.current&&!Bt(N.current,U)&&(N.current=U,ft.flushSync(()=>{d(U)}))})},[m,t,n,_,$]);Ot(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,d(I=>({...I,isPositioned:!1})))},[u]);const A=i.useRef(!1);Ot(()=>(A.current=!0,()=>{A.current=!1}),[]),Ot(()=>{if(S&&(P.current=S),C&&(E.current=C),S&&C){if(M.current)return M.current(S,C,B);B()}},[S,C,B,M,O]);const V=i.useMemo(()=>({reference:P,floating:E,setReference:y,setFloating:b}),[y,b]),j=i.useMemo(()=>({reference:S,floating:C}),[S,C]),F=i.useMemo(()=>{const I={position:n,left:0,top:0};if(!j.floating)return I;const T=lr(j.floating,f.x),U=lr(j.floating,f.y);return c?{...I,transform:"translate("+T+"px, "+U+"px)",...vs(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:T,top:U}},[n,c,j.floating,f.x,f.y]);return i.useMemo(()=>({...f,update:B,refs:V,elements:j,floatingStyles:F}),[f,B,V,j,F])}const Xu=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?cr({element:o.current,padding:r}).fn(n):{}:o?cr({element:o,padding:r}).fn(n):{}}}},qu=(e,t)=>{const n=Fu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zu=(e,t)=>{const n=Vu(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qu=(e,t)=>({fn:Ku(e).fn,options:[e,t]}),Ju=(e,t)=>{const n=Bu(e);return{name:n.name,fn:n.fn,options:[e,t]}},ed=(e,t)=>{const n=Wu(e);return{name:n.name,fn:n.fn,options:[e,t]}},td=(e,t)=>{const n=Hu(e);return{name:n.name,fn:n.fn,options:[e,t]}},nd=(e,t)=>{const n=Xu(e);return{name:n.name,fn:n.fn,options:[e,t]}};var od="Arrow",hs=i.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return p.jsx(D.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});hs.displayName=od;var rd=hs;function nn(e){const[t,n]=i.useState(void 0);return G(()=>{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 a,c;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,c=u.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Eo="Popper",[gs,_e]=Z(Eo),[sd,ws]=gs(Eo),xs=e=>{const{__scopePopper:t,children:n}=e,[o,r]=i.useState(null);return p.jsx(sd,{scope:t,anchor:o,onAnchorChange:r,children:n})};xs.displayName=Eo;var ys="PopperAnchor",bs=i.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=ws(ys,n),a=i.useRef(null),c=k(t,a),l=i.useRef(null);return i.useEffect(()=>{const u=l.current;l.current=o?.current||a.current,u!==l.current&&s.onAnchorChange(l.current)}),o?null:p.jsx(D.div,{...r,ref:c})});bs.displayName=ys;var Ro="PopperContent",[id,ad]=gs(Ro),Ss=i.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:w,...v}=e,g=ws(Ro,n),[x,y]=i.useState(null),b=k(t,L=>y(L)),[S,C]=i.useState(null),P=nn(S),E=P?.width??0,N=P?.height??0,O=o+(s!=="center"?"-"+s:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(u)?u:[u],$=_.length>0,B={padding:M,boundary:_.filter(ld),altBoundary:$},{refs:A,floatingStyles:V,placement:j,isPositioned:F,middlewareData:I}=Yu({strategy:"fixed",placement:O,whileElementsMounted:(...L)=>$u(...L,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[qu({mainAxis:r+N,alignmentAxis:a}),l&&Zu({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Qu():void 0,...B}),l&&Ju({...B}),ed({...B,apply:({elements:L,rects:W,availableWidth:ee,availableHeight:H})=>{const{width:K,height:Y}=W.reference,se=L.floating.style;se.setProperty("--radix-popper-available-width",`${ee}px`),se.setProperty("--radix-popper-available-height",`${H}px`),se.setProperty("--radix-popper-anchor-width",`${K}px`),se.setProperty("--radix-popper-anchor-height",`${Y}px`)}}),S&&nd({element:S,padding:c}),ud({arrowWidth:E,arrowHeight:N}),m&&td({strategy:"referenceHidden",...B})]}),[T,U]=Rs(j),q=z(w);G(()=>{F&&q?.()},[F,q]);const Q=I.arrow?.x,te=I.arrow?.y,J=I.arrow?.centerOffset!==0,[xe,ne]=i.useState();return G(()=>{x&&ne(window.getComputedStyle(x).zIndex)},[x]),p.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:F?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(id,{scope:n,placedSide:T,onArrowChange:C,arrowX:Q,arrowY:te,shouldHideArrow:J,children:p.jsx(D.div,{"data-side":T,"data-align":U,...v,ref:b,style:{...v.style,animation:F?void 0:"none"}})})})});Ss.displayName=Ro;var Cs="PopperArrow",cd={top:"bottom",right:"left",bottom:"top",left:"right"},Es=i.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=ad(Cs,o),a=cd[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]: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:p.jsx(rd,{...r,ref:n,style:{...r.style,display:"block"}})})});Es.displayName=Cs;function ld(e){return e!==null}var ud=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=r.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,f]=Rs(n),d={start:"0%",center:"50%",end:"100%"}[f],m=(r.arrow?.x??0)+c/2,h=(r.arrow?.y??0)+l/2;let w="",v="";return u==="bottom"?(w=a?d:`${m}px`,v=`${-l}px`):u==="top"?(w=a?d:`${m}px`,v=`${o.floating.height+l}px`):u==="right"?(w=`${-l}px`,v=a?d:`${h}px`):u==="left"&&(w=`${o.floating.width+l}px`,v=a?d:`${h}px`),{data:{x:w,y:v}}}});function Rs(e){const[t,n="center"]=e.split("-");return[t,n]}var on=xs,gt=bs,rn=Ss,sn=Es,dd=Symbol("radix.slottable");function fd(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=dd,t}var[an]=Z("Tooltip",[_e]),cn=_e(),Ps="TooltipProvider",pd=700,Gn="tooltip.open",[md,Po]=an(Ps),Ts=e=>{const{__scopeTooltip:t,delayDuration:n=pd,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,a=i.useRef(!0),c=i.useRef(!1),l=i.useRef(0);return i.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),p.jsx(md,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:i.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:i.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:s})};Ts.displayName=Ps;var lt="Tooltip",[vd,wt]=an(lt),As=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:c}=e,l=Po(lt,e.__scopeTooltip),u=cn(t),[f,d]=i.useState(null),m=ue(),h=i.useRef(0),w=a??l.disableHoverableContent,v=c??l.delayDuration,g=i.useRef(!1),[x,y]=ae({prop:o,defaultProp:r??!1,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(Gn))):l.onClose(),s?.(E)},caller:lt}),b=i.useMemo(()=>x?g.current?"delayed-open":"instant-open":"closed",[x]),S=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g.current=!1,y(!0)},[y]),C=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y(!1)},[y]),P=i.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{g.current=!0,y(!0),h.current=0},v)},[v,y]);return i.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),p.jsx(on,{...u,children:p.jsx(vd,{scope:t,contentId:m,open:x,stateAttribute:b,trigger:f,onTriggerChange:d,onTriggerEnter:i.useCallback(()=>{l.isOpenDelayedRef.current?P():S()},[l.isOpenDelayedRef,P,S]),onTriggerLeave:i.useCallback(()=>{w?C():(window.clearTimeout(h.current),h.current=0)},[C,w]),onOpen:S,onClose:C,disableHoverableContent:w,children:n})})};As.displayName=lt;var Yn="TooltipTrigger",_s=i.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=wt(Yn,n),s=Po(Yn,n),a=cn(n),c=i.useRef(null),l=k(t,c,r.onTriggerChange),u=i.useRef(!1),f=i.useRef(!1),d=i.useCallback(()=>u.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),p.jsx(gt,{asChild:!0,...a,children:p.jsx(D.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:R(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:R(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:R(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:R(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:R(e.onBlur,r.onClose),onClick:R(e.onClick,r.onClose)})})});_s.displayName=Yn;var To="TooltipPortal",[hd,gd]=an(To,{forceMount:void 0}),Is=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=wt(To,t);return p.jsx(hd,{scope:t,forceMount:n,children:p.jsx(X,{present:n||s.open,children:p.jsx(Be,{asChild:!0,container:r,children:o})})})};Is.displayName=To;var Qe="TooltipContent",Ns=i.forwardRef((e,t)=>{const n=gd(Qe,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,a=wt(Qe,e.__scopeTooltip);return p.jsx(X,{present:o||a.open,children:a.disableHoverableContent?p.jsx(Os,{side:r,...s,ref:t}):p.jsx(wd,{side:r,...s,ref:t})})}),wd=i.forwardRef((e,t)=>{const n=wt(Qe,e.__scopeTooltip),o=Po(Qe,e.__scopeTooltip),r=i.useRef(null),s=k(t,r),[a,c]=i.useState(null),{trigger:l,onClose:u}=n,f=r.current,{onPointerInTransitChange:d}=o,m=i.useCallback(()=>{c(null),d(!1)},[d]),h=i.useCallback((w,v)=>{const g=w.currentTarget,x={x:w.clientX,y:w.clientY},y=Cd(x,g.getBoundingClientRect()),b=Ed(x,y),S=Rd(v.getBoundingClientRect()),C=Td([...b,...S]);c(C),d(!0)},[d]);return i.useEffect(()=>()=>m(),[m]),i.useEffect(()=>{if(l&&f){const w=g=>h(g,f),v=g=>h(g,l);return l.addEventListener("pointerleave",w),f.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",w),f.removeEventListener("pointerleave",v)}}},[l,f,h,m]),i.useEffect(()=>{if(a){const w=v=>{const g=v.target,x={x:v.clientX,y:v.clientY},y=l?.contains(g)||f?.contains(g),b=!Pd(x,a);y?m():b&&(m(),u())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,f,a,u,m]),p.jsx(Os,{...e,ref:s})}),[xd,yd]=an(lt,{isInside:!1}),bd=fd("TooltipContent"),Os=i.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:a,...c}=e,l=wt(Qe,n),u=cn(n),{onClose:f}=l;return i.useEffect(()=>(document.addEventListener(Gn,f),()=>document.removeEventListener(Gn,f)),[f]),i.useEffect(()=>{if(l.trigger){const d=m=>{m.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),p.jsx(Ve,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:p.jsxs(rn,{"data-state":l.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:[p.jsx(bd,{children:o}),p.jsx(xd,{scope:n,isInside:!0,children:p.jsx(Ll,{id:l.contentId,role:"tooltip",children:r||o})})]})})});Ns.displayName=Qe;var Ds="TooltipArrow",Sd=i.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=cn(n);return yd(Ds,n).isInside?null:p.jsx(sn,{...r,...o,ref:t})});Sd.displayName=Ds;function Cd(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 Ed(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 Rd(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 Pd(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,a=t.length-1;so!=m>o&&n<(d-u)*(o-f)/(m-f)+u&&(r=!r)}return r}function Td(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),Ad(t)}function Ad(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.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],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.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 Gv=Ts,Yv=As,Xv=_s,qv=Is,Zv=Ns,On="focusScope.autoFocusOnMount",Dn="focusScope.autoFocusOnUnmount",ur={bubbles:!1,cancelable:!0},_d="FocusScope",xt=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...a}=e,[c,l]=i.useState(null),u=z(r),f=z(s),d=i.useRef(null),m=k(t,v=>l(v)),h=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(o){let v=function(b){if(h.paused||!c)return;const S=b.target;c.contains(S)?d.current=S:Re(d.current,{select:!0})},g=function(b){if(h.paused||!c)return;const S=b.relatedTarget;S!==null&&(c.contains(S)||Re(d.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&Re(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",g);const y=new MutationObserver(x);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",g),y.disconnect()}}},[o,c,h.paused]),i.useEffect(()=>{if(c){fr.add(h);const v=document.activeElement;if(!c.contains(v)){const x=new CustomEvent(On,ur);c.addEventListener(On,u),c.dispatchEvent(x),x.defaultPrevented||(Id(Ld(Ms(c)),{select:!0}),document.activeElement===v&&Re(c))}return()=>{c.removeEventListener(On,u),setTimeout(()=>{const x=new CustomEvent(Dn,ur);c.addEventListener(Dn,f),c.dispatchEvent(x),x.defaultPrevented||Re(v??document.body,{select:!0}),c.removeEventListener(Dn,f),fr.remove(h)},0)}}},[c,u,f,h]);const w=i.useCallback(v=>{if(!n&&!o||h.paused)return;const g=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(g&&x){const y=v.currentTarget,[b,S]=Nd(y);b&&S?!v.shiftKey&&x===S?(v.preventDefault(),n&&Re(b,{select:!0})):v.shiftKey&&x===b&&(v.preventDefault(),n&&Re(S,{select:!0})):x===y&&v.preventDefault()}},[n,o,h.paused]);return p.jsx(D.div,{tabIndex:-1,...a,ref:m,onKeyDown:w})});xt.displayName=_d;function Id(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Re(o,{select:t}),document.activeElement!==n)return}function Nd(e){const t=Ms(e),n=dr(t,e),o=dr(t.reverse(),e);return[n,o]}function Ms(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dr(e,t){for(const n of e)if(!Od(n,{upTo:t}))return n}function Od(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Dd(e){return e instanceof HTMLInputElement&&"select"in e}function Re(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Dd(e)&&t&&e.select()}}var fr=Md();function Md(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=pr(e,t),e.unshift(t)},remove(t){e=pr(e,t),e[0]?.resume()}}}function pr(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Ld(e){return e.filter(t=>t.tagName!=="A")}var Mn=0;function ln(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??mr()),document.body.insertAdjacentElement("beforeend",e[1]??mr()),Mn++,()=>{Mn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Mn--}},[])}function mr(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var me=function(){return me=Object.assign||function(t){for(var n,o=1,r=arguments.length;o"u")return Qd;var t=Jd(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},tf=$s(),Ye="data-scroll-locked",nf=function(e,t,n,o){var r=e.left,s=e.top,a=e.right,c=e.gap;return n===void 0&&(n="margin"),` .`.concat(kd,` { overflow: hidden `).concat(o,`; padding-right: `).concat(c,"px ").concat(o,`; } body[`).concat(Ye,`] { overflow: hidden `).concat(o,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&` padding-left: `.concat(r,`px; padding-top: `).concat(s,`px; padding-right: `).concat(a,`px; margin-left:0; margin-top:0; margin-right: `).concat(c,"px ").concat(o,`; `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(o,";")].filter(Boolean).join(""),` } .`).concat(Dt,` { right: `).concat(c,"px ").concat(o,`; } .`).concat(Mt,` { margin-right: `).concat(c,"px ").concat(o,`; } .`).concat(Dt," .").concat(Dt,` { right: 0 `).concat(o,`; } .`).concat(Mt," .").concat(Mt,` { margin-right: 0 `).concat(o,`; } body[`).concat(Ye,`] { `).concat($d,": ").concat(c,`px; } `)},hr=function(){var e=parseInt(document.body.getAttribute(Ye)||"0",10);return isFinite(e)?e:0},of=function(){i.useEffect(function(){return document.body.setAttribute(Ye,(hr()+1).toString()),function(){var e=hr()-1;e<=0?document.body.removeAttribute(Ye):document.body.setAttribute(Ye,e.toString())}},[])},rf=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;of();var s=i.useMemo(function(){return ef(r)},[r]);return i.createElement(tf,{styles:nf(s,!t,r,n?"":"!important")})},Xn=!1;if(typeof window<"u")try{var At=Object.defineProperty({},"passive",{get:function(){return Xn=!0,!0}});window.addEventListener("test",At,At),window.removeEventListener("test",At,At)}catch{Xn=!1}var Ke=Xn?{passive:!1}:!1,sf=function(e){return e.tagName==="TEXTAREA"},Fs=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!sf(e)&&n[t]==="visible")},af=function(e){return Fs(e,"overflowY")},cf=function(e){return Fs(e,"overflowX")},gr=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Vs(e,o);if(r){var s=Bs(e,o),a=s[1],c=s[2];if(a>c)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},lf=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},uf=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Vs=function(e,t){return e==="v"?af(t):cf(t)},Bs=function(e,t){return e==="v"?lf(t):uf(t)},df=function(e,t){return e==="h"&&t==="rtl"?-1:1},ff=function(e,t,n,o,r){var s=df(e,window.getComputedStyle(t).direction),a=s*o,c=n.target,l=t.contains(c),u=!1,f=a>0,d=0,m=0;do{if(!c)break;var h=Bs(e,c),w=h[0],v=h[1],g=h[2],x=v-g-s*w;(w||x)&&Vs(e,c)&&(d+=x,m+=w);var y=c.parentNode;c=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(f&&Math.abs(d)<1||!f&&Math.abs(m)<1)&&(u=!0),u},_t=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wr=function(e){return[e.deltaX,e.deltaY]},xr=function(e){return e&&"current"in e?e.current:e},pf=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mf=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},vf=0,Ue=[];function hf(e){var t=i.useRef([]),n=i.useRef([0,0]),o=i.useRef(),r=i.useState(vf++)[0],s=i.useState($s)[0],a=i.useRef(e);i.useEffect(function(){a.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var v=jd([e.lockRef.current],(e.shards||[]).map(xr),!0).filter(Boolean);return v.forEach(function(g){return g.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),v.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var c=i.useCallback(function(v,g){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var x=_t(v),y=n.current,b="deltaX"in v?v.deltaX:y[0]-x[0],S="deltaY"in v?v.deltaY:y[1]-x[1],C,P=v.target,E=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in v&&E==="h"&&P.type==="range")return!1;var N=window.getSelection(),O=N&&N.anchorNode,M=O?O===P||O.contains(P):!1;if(M)return!1;var _=gr(E,P);if(!_)return!0;if(_?C=E:(C=E==="v"?"h":"v",_=gr(E,P)),!_)return!1;if(!o.current&&"changedTouches"in v&&(b||S)&&(o.current=C),!C)return!0;var $=o.current||C;return ff($,g,v,$==="h"?b:S)},[]),l=i.useCallback(function(v){var g=v;if(!(!Ue.length||Ue[Ue.length-1]!==s)){var x="deltaY"in g?wr(g):_t(g),y=t.current.filter(function(C){return C.name===g.type&&(C.target===g.target||g.target===C.shadowParent)&&pf(C.delta,x)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var b=(a.current.shards||[]).map(xr).filter(Boolean).filter(function(C){return C.contains(g.target)}),S=b.length>0?c(g,b[0]):!a.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),u=i.useCallback(function(v,g,x,y){var b={name:v,delta:g,target:x,should:y,shadowParent:gf(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),f=i.useCallback(function(v){n.current=_t(v),o.current=void 0},[]),d=i.useCallback(function(v){u(v.type,wr(v),v.target,c(v,e.lockRef.current))},[]),m=i.useCallback(function(v){u(v.type,_t(v),v.target,c(v,e.lockRef.current))},[]);i.useEffect(function(){return Ue.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Ke),document.addEventListener("touchmove",l,Ke),document.addEventListener("touchstart",f,Ke),function(){Ue=Ue.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,Ke),document.removeEventListener("touchmove",l,Ke),document.removeEventListener("touchstart",f,Ke)}},[]);var h=e.removeScrollBar,w=e.inert;return i.createElement(i.Fragment,null,w?i.createElement(s,{styles:mf(r)}):null,h?i.createElement(rf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function gf(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wf=Ud(ks,hf);var yt=i.forwardRef(function(e,t){return i.createElement(un,me({},e,{ref:t,sideCar:wf}))});yt.classNames=un.classNames;var xf=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ze=new WeakMap,It=new WeakMap,Nt={},$n=0,Ws=function(e){return e&&(e.host||Ws(e.parentNode))},yf=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Ws(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},bf=function(e,t,n,o){var r=yf(t,Array.isArray(e)?e:[e]);Nt[n]||(Nt[n]=new WeakMap);var s=Nt[n],a=[],c=new Set,l=new Set(r),u=function(d){!d||c.has(d)||(c.add(d),u(d.parentNode))};r.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(m){if(c.has(m))f(m);else try{var h=m.getAttribute(o),w=h!==null&&h!=="false",v=(ze.get(m)||0)+1,g=(s.get(m)||0)+1;ze.set(m,v),s.set(m,g),a.push(m),v===1&&w&&It.set(m,!0),g===1&&m.setAttribute(n,"true"),w||m.setAttribute(o,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(t),c.clear(),$n++,function(){a.forEach(function(d){var m=ze.get(d)-1,h=s.get(d)-1;ze.set(d,m),s.set(d,h),m||(It.has(d)||d.removeAttribute(o),It.delete(d)),h||d.removeAttribute(n)}),$n--,$n||(ze=new WeakMap,ze=new WeakMap,It=new WeakMap,Nt={})}},dn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=xf(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),bf(o,r,n,"aria-hidden")):function(){return null}};function Sf(e){const t=Cf(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(Rf);if(l){const u=l.props.children,f=c.map(d=>d===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function Cf(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=Tf(r),c=Pf(s,r.props);return r.type!==i.Fragment&&(c.ref=o?Se(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ef=Symbol("radix.slottable");function Rf(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ef}function Pf(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function Tf(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fn="Dialog",[Hs,Ks]=Z(fn),[Af,pe]=Hs(fn),Us=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!0}=e,c=i.useRef(null),l=i.useRef(null),[u,f]=ae({prop:o,defaultProp:r??!1,onChange:s,caller:fn});return p.jsx(Af,{scope:t,triggerRef:c,contentRef:l,contentId:ue(),titleId:ue(),descriptionId:ue(),open:u,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};Us.displayName=fn;var zs="DialogTrigger",Gs=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(zs,n),s=k(t,r.triggerRef);return p.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Io(r.open),...o,ref:s,onClick:R(e.onClick,r.onOpenToggle)})});Gs.displayName=zs;var Ao="DialogPortal",[_f,Ys]=Hs(Ao,{forceMount:void 0}),Xs=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=pe(Ao,t);return p.jsx(_f,{scope:t,forceMount:n,children:i.Children.map(o,a=>p.jsx(X,{present:n||s.open,children:p.jsx(Be,{asChild:!0,container:r,children:a})}))})};Xs.displayName=Ao;var Wt="DialogOverlay",qs=i.forwardRef((e,t)=>{const n=Ys(Wt,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=pe(Wt,e.__scopeDialog);return s.modal?p.jsx(X,{present:o||s.open,children:p.jsx(Nf,{...r,ref:t})}):null});qs.displayName=Wt;var If=Sf("DialogOverlay.RemoveScroll"),Nf=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(Wt,n);return p.jsx(yt,{as:If,allowPinchZoom:!0,shards:[r.contentRef],children:p.jsx(D.div,{"data-state":Io(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),ke="DialogContent",Zs=i.forwardRef((e,t)=>{const n=Ys(ke,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=pe(ke,e.__scopeDialog);return p.jsx(X,{present:o||s.open,children:s.modal?p.jsx(Of,{...r,ref:t}):p.jsx(Df,{...r,ref:t})})});Zs.displayName=ke;var Of=i.forwardRef((e,t)=>{const n=pe(ke,e.__scopeDialog),o=i.useRef(null),r=k(t,n.contentRef,o);return i.useEffect(()=>{const s=o.current;if(s)return dn(s)},[]),p.jsx(Qs,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:R(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&s.preventDefault()}),onFocusOutside:R(e.onFocusOutside,s=>s.preventDefault())})}),Df=i.forwardRef((e,t)=>{const n=pe(ke,e.__scopeDialog),o=i.useRef(!1),r=i.useRef(!1);return p.jsx(Qs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),Qs=i.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...a}=e,c=pe(ke,n),l=i.useRef(null),u=k(t,l);return ln(),p.jsxs(p.Fragment,{children:[p.jsx(xt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:p.jsx(Ve,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Io(c.open),...a,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(Lf,{titleId:c.titleId}),p.jsx(kf,{contentRef:l,descriptionId:c.descriptionId})]})]})}),_o="DialogTitle",Js=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(_o,n);return p.jsx(D.h2,{id:r.titleId,...o,ref:t})});Js.displayName=_o;var ei="DialogDescription",ti=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(ei,n);return p.jsx(D.p,{id:r.descriptionId,...o,ref:t})});ti.displayName=ei;var ni="DialogClose",oi=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(ni,n);return p.jsx(D.button,{type:"button",...o,ref:t,onClick:R(e.onClick,()=>r.onOpenChange(!1))})});oi.displayName=ni;function Io(e){return e?"open":"closed"}var ri="DialogTitleWarning",[Mf,si]=zc(ri,{contentName:ke,titleName:_o,docsSlug:"dialog"}),Lf=({titleId:e})=>{const t=si(ri),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jf="DialogDescriptionWarning",kf=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${si(jf).contentName}}.`;return i.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},$f=Us,Ff=Gs,Vf=Xs,Bf=qs,Wf=Zs,Hf=Js,Kf=ti,ii=oi,Uf=Symbol("radix.slottable");function zf(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Uf,t}var ai="AlertDialog",[Gf]=Z(ai,[Ks]),Ee=Ks(),ci=e=>{const{__scopeAlertDialog:t,...n}=e,o=Ee(t);return p.jsx($f,{...o,...n,modal:!0})};ci.displayName=ai;var Yf="AlertDialogTrigger",li=i.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Ee(n);return p.jsx(Ff,{...r,...o,ref:t})});li.displayName=Yf;var Xf="AlertDialogPortal",ui=e=>{const{__scopeAlertDialog:t,...n}=e,o=Ee(t);return p.jsx(Vf,{...o,...n})};ui.displayName=Xf;var qf="AlertDialogOverlay",di=i.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Ee(n);return p.jsx(Bf,{...r,...o,ref:t})});di.displayName=qf;var Xe="AlertDialogContent",[Zf,Qf]=Gf(Xe),Jf=zf("AlertDialogContent"),fi=i.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:o,...r}=e,s=Ee(n),a=i.useRef(null),c=k(t,a),l=i.useRef(null);return p.jsx(Mf,{contentName:Xe,titleName:pi,docsSlug:"alert-dialog",children:p.jsx(Zf,{scope:n,cancelRef:l,children:p.jsxs(Wf,{role:"alertdialog",...s,...r,ref:c,onOpenAutoFocus:R(r.onOpenAutoFocus,u=>{u.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[p.jsx(Jf,{children:o}),p.jsx(tp,{contentRef:a})]})})})});fi.displayName=Xe;var pi="AlertDialogTitle",mi=i.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Ee(n);return p.jsx(Hf,{...r,...o,ref:t})});mi.displayName=pi;var vi="AlertDialogDescription",hi=i.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Ee(n);return p.jsx(Kf,{...r,...o,ref:t})});hi.displayName=vi;var ep="AlertDialogAction",gi=i.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Ee(n);return p.jsx(ii,{...r,...o,ref:t})});gi.displayName=ep;var wi="AlertDialogCancel",xi=i.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:r}=Qf(wi,n),s=Ee(n),a=k(t,r);return p.jsx(ii,{...s,...o,ref:a})});xi.displayName=wi;var tp=({contentRef:e})=>{const t=`\`${Xe}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Xe}\` by passing a \`${vi}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Xe}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return i.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Qv=ci,Jv=li,eh=ui,th=di,nh=fi,oh=gi,rh=xi,sh=mi,ih=hi,Fn="rovingFocusGroup.onEntryFocus",np={bubbles:!1,cancelable:!0},bt="RovingFocusGroup",[qn,yi,op]=mt(bt),[rp,pn]=Z(bt,[op]),[sp,ip]=rp(bt),bi=i.forwardRef((e,t)=>p.jsx(qn.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(qn.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(ap,{...e,ref:t})})}));bi.displayName=bt;var ap=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,m=i.useRef(null),h=k(t,m),w=et(s),[v,g]=ae({prop:a,defaultProp:c??null,onChange:l,caller:bt}),[x,y]=i.useState(!1),b=z(u),S=yi(n),C=i.useRef(!1),[P,E]=i.useState(0);return i.useEffect(()=>{const N=m.current;if(N)return N.addEventListener(Fn,b),()=>N.removeEventListener(Fn,b)},[b]),p.jsx(sp,{scope:n,orientation:o,dir:w,loop:r,currentTabStopId:v,onItemFocus:i.useCallback(N=>g(N),[g]),onItemShiftTab:i.useCallback(()=>y(!0),[]),onFocusableItemAdd:i.useCallback(()=>E(N=>N+1),[]),onFocusableItemRemove:i.useCallback(()=>E(N=>N-1),[]),children:p.jsx(D.div,{tabIndex:x||P===0?-1:0,"data-orientation":o,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:R(e.onMouseDown,()=>{C.current=!0}),onFocus:R(e.onFocus,N=>{const O=!C.current;if(N.target===N.currentTarget&&O&&!x){const M=new CustomEvent(Fn,np);if(N.currentTarget.dispatchEvent(M),!M.defaultPrevented){const _=S().filter(j=>j.focusable),$=_.find(j=>j.active),B=_.find(j=>j.id===v),V=[$,B,..._].filter(Boolean).map(j=>j.ref.current);Ei(V,f)}}C.current=!1}),onBlur:R(e.onBlur,()=>y(!1))})})}),Si="RovingFocusGroupItem",Ci=i.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:a,...c}=e,l=ue(),u=s||l,f=ip(Si,n),d=f.currentTabStopId===u,m=yi(n),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:v}=f;return i.useEffect(()=>{if(o)return h(),()=>w()},[o,h,w]),p.jsx(qn.ItemSlot,{scope:n,id:u,focusable:o,active:r,children:p.jsx(D.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...c,ref:t,onMouseDown:R(e.onMouseDown,g=>{o?f.onItemFocus(u):g.preventDefault()}),onFocus:R(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:R(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const x=up(g,f.orientation,f.dir);if(x!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=m().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")b.reverse();else if(x==="prev"||x==="next"){x==="prev"&&b.reverse();const S=b.indexOf(g.currentTarget);b=f.loop?dp(b,S+1):b.slice(S+1)}setTimeout(()=>Ei(b))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:v!=null}):a})})});Ci.displayName=Si;var cp={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lp(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function up(e,t,n){const o=lp(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return cp[o]}function Ei(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function dp(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Ri=bi,Pi=Ci;function fp(e){const t=pp(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(vp);if(l){const u=l.props.children,f=c.map(d=>d===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function pp(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=gp(r),c=hp(s,r.props);return r.type!==i.Fragment&&(c.ref=o?Se(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mp=Symbol("radix.slottable");function vp(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mp}function hp(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function gp(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Zn=["Enter"," "],wp=["ArrowDown","PageUp","Home"],Ti=["ArrowUp","PageDown","End"],xp=[...wp,...Ti],yp={ltr:[...Zn,"ArrowRight"],rtl:[...Zn,"ArrowLeft"]},bp={ltr:["ArrowLeft"],rtl:["ArrowRight"]},St="Menu",[ut,Sp,Cp]=mt(St),[We,ah]=Z(St,[Cp,_e,pn]),mn=_e(),Ai=pn(),[Ep,He]=We(St),[Rp,Ct]=We(St),_i=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:s,modal:a=!0}=e,c=mn(t),[l,u]=i.useState(null),f=i.useRef(!1),d=z(s),m=et(r);return i.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>f.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),p.jsx(on,{...c,children:p.jsx(Ep,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:p.jsx(Rp,{scope:t,onClose:i.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:m,modal:a,children:o})})})};_i.displayName=St;var Pp="MenuAnchor",No=i.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=mn(n);return p.jsx(gt,{...r,...o,ref:t})});No.displayName=Pp;var Oo="MenuPortal",[Tp,Ii]=We(Oo,{forceMount:void 0}),Ni=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,s=He(Oo,t);return p.jsx(Tp,{scope:t,forceMount:n,children:p.jsx(X,{present:n||s.open,children:p.jsx(Be,{asChild:!0,container:r,children:o})})})};Ni.displayName=Oo;var ie="MenuContent",[Ap,Do]=We(ie),Oi=i.forwardRef((e,t)=>{const n=Ii(ie,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=He(ie,e.__scopeMenu),a=Ct(ie,e.__scopeMenu);return p.jsx(ut.Provider,{scope:e.__scopeMenu,children:p.jsx(X,{present:o||s.open,children:p.jsx(ut.Slot,{scope:e.__scopeMenu,children:a.modal?p.jsx(_p,{...r,ref:t}):p.jsx(Ip,{...r,ref:t})})})})}),_p=i.forwardRef((e,t)=>{const n=He(ie,e.__scopeMenu),o=i.useRef(null),r=k(t,o);return i.useEffect(()=>{const s=o.current;if(s)return dn(s)},[]),p.jsx(Mo,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:R(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ip=i.forwardRef((e,t)=>{const n=He(ie,e.__scopeMenu);return p.jsx(Mo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Np=fp("MenuContent.ScrollLock"),Mo=i.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:h,disableOutsideScroll:w,...v}=e,g=He(ie,n),x=Ct(ie,n),y=mn(n),b=Ai(n),S=Sp(n),[C,P]=i.useState(null),E=i.useRef(null),N=k(t,E,g.onContentChange),O=i.useRef(0),M=i.useRef(""),_=i.useRef(0),$=i.useRef(null),B=i.useRef("right"),A=i.useRef(0),V=w?yt:i.Fragment,j=w?{as:Np,allowPinchZoom:!0}:void 0,F=T=>{const U=M.current+T,q=S().filter(L=>!L.disabled),Q=document.activeElement,te=q.find(L=>L.ref.current===Q)?.textValue,J=q.map(L=>L.textValue),xe=Hp(J,U,te),ne=q.find(L=>L.textValue===xe)?.ref.current;(function L(W){M.current=W,window.clearTimeout(O.current),W!==""&&(O.current=window.setTimeout(()=>L(""),1e3))})(U),ne&&setTimeout(()=>ne.focus())};i.useEffect(()=>()=>window.clearTimeout(O.current),[]),ln();const I=i.useCallback(T=>B.current===$.current?.side&&Up(T,$.current?.area),[]);return p.jsx(Ap,{scope:n,searchRef:M,onItemEnter:i.useCallback(T=>{I(T)&&T.preventDefault()},[I]),onItemLeave:i.useCallback(T=>{I(T)||(E.current?.focus(),P(null))},[I]),onTriggerLeave:i.useCallback(T=>{I(T)&&T.preventDefault()},[I]),pointerGraceTimerRef:_,onPointerGraceIntentChange:i.useCallback(T=>{$.current=T},[]),children:p.jsx(V,{...j,children:p.jsx(xt,{asChild:!0,trapped:r,onMountAutoFocus:R(s,T=>{T.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:p.jsx(Ve,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:h,children:p.jsx(Ri,{asChild:!0,...b,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:P,onEntryFocus:R(l,T=>{x.isUsingKeyboardRef.current||T.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(rn,{role:"menu","aria-orientation":"vertical","data-state":Yi(g.open),"data-radix-menu-content":"",dir:x.dir,...y,...v,ref:N,style:{outline:"none",...v.style},onKeyDown:R(v.onKeyDown,T=>{const q=T.target.closest("[data-radix-menu-content]")===T.currentTarget,Q=T.ctrlKey||T.altKey||T.metaKey,te=T.key.length===1;q&&(T.key==="Tab"&&T.preventDefault(),!Q&&te&&F(T.key));const J=E.current;if(T.target!==J||!xp.includes(T.key))return;T.preventDefault();const ne=S().filter(L=>!L.disabled).map(L=>L.ref.current);Ti.includes(T.key)&&ne.reverse(),Bp(ne)}),onBlur:R(e.onBlur,T=>{T.currentTarget.contains(T.target)||(window.clearTimeout(O.current),M.current="")}),onPointerMove:R(e.onPointerMove,dt(T=>{const U=T.target,q=A.current!==T.clientX;if(T.currentTarget.contains(U)&&q){const Q=T.clientX>A.current?"right":"left";B.current=Q,A.current=T.clientX}}))})})})})})})});Oi.displayName=ie;var Op="MenuGroup",Lo=i.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(D.div,{role:"group",...o,ref:t})});Lo.displayName=Op;var Dp="MenuLabel",Di=i.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(D.div,{...o,ref:t})});Di.displayName=Dp;var Ht="MenuItem",yr="menu.itemSelect",vn=i.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,s=i.useRef(null),a=Ct(Ht,e.__scopeMenu),c=Do(Ht,e.__scopeMenu),l=k(t,s),u=i.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const m=new CustomEvent(yr,{bubbles:!0,cancelable:!0});d.addEventListener(yr,h=>o?.(h),{once:!0}),ao(d,m),m.defaultPrevented?u.current=!1:a.onClose()}};return p.jsx(Mi,{...r,ref:l,disabled:n,onClick:R(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),u.current=!0},onPointerUp:R(e.onPointerUp,d=>{u.current||d.currentTarget?.click()}),onKeyDown:R(e.onKeyDown,d=>{const m=c.searchRef.current!=="";n||m&&d.key===" "||Zn.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});vn.displayName=Ht;var Mi=i.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=e,a=Do(Ht,n),c=Ai(n),l=i.useRef(null),u=k(t,l),[f,d]=i.useState(!1),[m,h]=i.useState("");return i.useEffect(()=>{const w=l.current;w&&h((w.textContent??"").trim())},[s.children]),p.jsx(ut.ItemSlot,{scope:n,disabled:o,textValue:r??m,children:p.jsx(Pi,{asChild:!0,...c,focusable:!o,children:p.jsx(D.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:u,onPointerMove:R(e.onPointerMove,dt(w=>{o?a.onItemLeave(w):(a.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:R(e.onPointerLeave,dt(w=>a.onItemLeave(w))),onFocus:R(e.onFocus,()=>d(!0)),onBlur:R(e.onBlur,()=>d(!1))})})})}),Mp="MenuCheckboxItem",Li=i.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return p.jsx(Vi,{scope:e.__scopeMenu,checked:n,children:p.jsx(vn,{role:"menuitemcheckbox","aria-checked":Kt(n)?"mixed":n,...r,ref:t,"data-state":ko(n),onSelect:R(r.onSelect,()=>o?.(Kt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Li.displayName=Mp;var ji="MenuRadioGroup",[Lp,jp]=We(ji,{value:void 0,onValueChange:()=>{}}),ki=i.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,s=z(o);return p.jsx(Lp,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(Lo,{...r,ref:t})})});ki.displayName=ji;var $i="MenuRadioItem",Fi=i.forwardRef((e,t)=>{const{value:n,...o}=e,r=jp($i,e.__scopeMenu),s=n===r.value;return p.jsx(Vi,{scope:e.__scopeMenu,checked:s,children:p.jsx(vn,{role:"menuitemradio","aria-checked":s,...o,ref:t,"data-state":ko(s),onSelect:R(o.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Fi.displayName=$i;var jo="MenuItemIndicator",[Vi,kp]=We(jo,{checked:!1}),Bi=i.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,s=kp(jo,n);return p.jsx(X,{present:o||Kt(s.checked)||s.checked===!0,children:p.jsx(D.span,{...r,ref:t,"data-state":ko(s.checked)})})});Bi.displayName=jo;var $p="MenuSeparator",Wi=i.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(D.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});Wi.displayName=$p;var Fp="MenuArrow",Hi=i.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=mn(n);return p.jsx(sn,{...r,...o,ref:t})});Hi.displayName=Fp;var Vp="MenuSub",[ch,Ki]=We(Vp),st="MenuSubTrigger",Ui=i.forwardRef((e,t)=>{const n=He(st,e.__scopeMenu),o=Ct(st,e.__scopeMenu),r=Ki(st,e.__scopeMenu),s=Do(st,e.__scopeMenu),a=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},f=i.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return i.useEffect(()=>f,[f]),i.useEffect(()=>{const d=c.current;return()=>{window.clearTimeout(d),l(null)}},[c,l]),p.jsx(No,{asChild:!0,...u,children:p.jsx(Mi,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":Yi(n.open),...e,ref:Se(t,r.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:R(e.onPointerMove,dt(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:R(e.onPointerLeave,dt(d=>{f();const m=n.content?.getBoundingClientRect();if(m){const h=n.content?.dataset.side,w=h==="right",v=w?-5:5,g=m[w?"left":"right"],x=m[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+v,y:d.clientY},{x:g,y:m.top},{x,y:m.top},{x,y:m.bottom},{x:g,y:m.bottom}],side:h}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:R(e.onKeyDown,d=>{const m=s.searchRef.current!=="";e.disabled||m&&d.key===" "||yp[o.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});Ui.displayName=st;var zi="MenuSubContent",Gi=i.forwardRef((e,t)=>{const n=Ii(ie,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=He(ie,e.__scopeMenu),a=Ct(ie,e.__scopeMenu),c=Ki(zi,e.__scopeMenu),l=i.useRef(null),u=k(t,l);return p.jsx(ut.Provider,{scope:e.__scopeMenu,children:p.jsx(X,{present:o||s.open,children:p.jsx(ut.Slot,{scope:e.__scopeMenu,children:p.jsx(Mo,{id:c.contentId,"aria-labelledby":c.triggerId,...r,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{a.isUsingKeyboardRef.current&&l.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:R(e.onFocusOutside,f=>{f.target!==c.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:R(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:R(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),m=bp[a.dir].includes(f.key);d&&m&&(s.onOpenChange(!1),c.trigger?.focus(),f.preventDefault())})})})})})});Gi.displayName=zi;function Yi(e){return e?"open":"closed"}function Kt(e){return e==="indeterminate"}function ko(e){return Kt(e)?"indeterminate":e?"checked":"unchecked"}function Bp(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Wp(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function Hp(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Wp(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function Kp(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,a=t.length-1;so!=m>o&&n<(d-u)*(o-f)/(m-f)+u&&(r=!r)}return r}function Up(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Kp(n,t)}function dt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var lh=_i,uh=No,dh=Ni,fh=Oi,ph=Lo,mh=Di,vh=vn,hh=Li,gh=ki,wh=Fi,xh=Bi,yh=Wi,bh=Hi,Sh=Ui,Ch=Gi,hn="Tabs",[zp]=Z(hn,[pn]),Xi=pn(),[Gp,$o]=zp(hn),qi=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:s,orientation:a="horizontal",dir:c,activationMode:l="automatic",...u}=e,f=et(c),[d,m]=ae({prop:o,onChange:r,defaultProp:s??"",caller:hn});return p.jsx(Gp,{scope:n,baseId:ue(),value:d,onValueChange:m,orientation:a,dir:f,activationMode:l,children:p.jsx(D.div,{dir:f,"data-orientation":a,...u,ref:t})})});qi.displayName=hn;var Zi="TabsList",Qi=i.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,s=$o(Zi,n),a=Xi(n);return p.jsx(Ri,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:p.jsx(D.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});Qi.displayName=Zi;var Ji="TabsTrigger",ea=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...s}=e,a=$o(Ji,n),c=Xi(n),l=oa(a.baseId,o),u=ra(a.baseId,o),f=o===a.value;return p.jsx(Pi,{asChild:!0,...c,focusable:!r,active:f,children:p.jsx(D.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:t,onMouseDown:R(e.onMouseDown,d=>{!r&&d.button===0&&d.ctrlKey===!1?a.onValueChange(o):d.preventDefault()}),onKeyDown:R(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(o)}),onFocus:R(e.onFocus,()=>{const d=a.activationMode!=="manual";!f&&!r&&d&&a.onValueChange(o)})})})});ea.displayName=Ji;var ta="TabsContent",na=i.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:s,...a}=e,c=$o(ta,n),l=oa(c.baseId,o),u=ra(c.baseId,o),f=o===c.value,d=i.useRef(f);return i.useEffect(()=>{const m=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(m)},[]),p.jsx(X,{present:r||f,children:({present:m})=>p.jsx(D.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:m&&s})})});na.displayName=ta;function oa(e,t){return`${e}-trigger-${t}`}function ra(e,t){return`${e}-content-${t}`}var Eh=qi,Rh=Qi,Ph=ea,Th=na;function Yp(e,t=[]){let n=[];function o(s,a){const c=i.createContext(a);c.displayName=s+"Context";const l=n.length;n=[...n,a];const u=d=>{const{scope:m,children:h,...w}=d,v=m?.[e]?.[l]||c,g=i.useMemo(()=>w,Object.values(w));return p.jsx(v.Provider,{value:g,children:h})};u.displayName=s+"Provider";function f(d,m){const h=m?.[e]?.[l]||c,w=i.useContext(h);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const r=()=>{const s=n.map(a=>i.createContext(a));return function(c){const l=c?.[e]||s;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,Xp(r,...t)]}function Xp(...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 a=o.reduce((c,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...c,...d}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var qp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sa=qp.reduce((e,t)=>{const n=pt(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Fo="Progress",Vo=100,[Zp]=Yp(Fo),[Qp,Jp]=Zp(Fo),ia=i.forwardRef((e,t)=>{const{__scopeProgress:n,value:o=null,max:r,getValueLabel:s=em,...a}=e;(r||r===0)&&!br(r)&&console.error(tm(`${r}`,"Progress"));const c=br(r)?r:Vo;o!==null&&!Sr(o,c)&&console.error(nm(`${o}`,"Progress"));const l=Sr(o,c)?o:null,u=Ut(l)?s(l,c):void 0;return p.jsx(Qp,{scope:n,value:l,max:c,children:p.jsx(sa.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Ut(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":la(l,c),"data-value":l??void 0,"data-max":c,...a,ref:t})})});ia.displayName=Fo;var aa="ProgressIndicator",ca=i.forwardRef((e,t)=>{const{__scopeProgress:n,...o}=e,r=Jp(aa,n);return p.jsx(sa.div,{"data-state":la(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...o,ref:t})});ca.displayName=aa;function em(e,t){return`${Math.round(e/t*100)}%`}function la(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Ut(e){return typeof e=="number"}function br(e){return Ut(e)&&!isNaN(e)&&e>0}function Sr(e,t){return Ut(e)&&!isNaN(e)&&e<=t&&e>=0}function tm(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Vo}\`.`}function nm(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${Vo} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. Defaulting to \`null\`.`}var Ah=ia,_h=ca;function om(e){const t=rm(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(im);if(l){const u=l.props.children,f=c.map(d=>d===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function rm(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=cm(r),c=am(s,r.props);return r.type!==i.Fragment&&(c.ref=o?Se(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sm=Symbol("radix.slottable");function im(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sm}function am(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function cm(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function gn(e){const t=i.useRef({value:e,previous:e});return i.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var lm=[" ","Enter","ArrowUp","ArrowDown"],um=[" ","Enter"],$e="Select",[wn,xn,dm]=mt($e),[ot]=Z($e,[dm,_e]),yn=_e(),[fm,Ie]=ot($e),[pm,mm]=ot($e),ua=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:a,defaultValue:c,onValueChange:l,dir:u,name:f,autoComplete:d,disabled:m,required:h,form:w}=e,v=yn(t),[g,x]=i.useState(null),[y,b]=i.useState(null),[S,C]=i.useState(!1),P=et(u),[E,N]=ae({prop:o,defaultProp:r??!1,onChange:s,caller:$e}),[O,M]=ae({prop:a,defaultProp:c,onChange:l,caller:$e}),_=i.useRef(null),$=g?w||!!g.closest("form"):!0,[B,A]=i.useState(new Set),V=Array.from(B).map(j=>j.props.value).join(";");return p.jsx(on,{...v,children:p.jsxs(fm,{required:h,scope:t,trigger:g,onTriggerChange:x,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:ue(),value:O,onValueChange:M,open:E,onOpenChange:N,dir:P,triggerPointerDownPosRef:_,disabled:m,children:[p.jsx(wn.Provider,{scope:t,children:p.jsx(pm,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback(j=>{A(F=>new Set(F).add(j))},[]),onNativeOptionRemove:i.useCallback(j=>{A(F=>{const I=new Set(F);return I.delete(j),I})},[]),children:n})}),$?p.jsxs(Ma,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:d,value:O,onChange:j=>M(j.target.value),disabled:m,form:w,children:[O===void 0?p.jsx("option",{value:""}):null,Array.from(B)]},V):null]})})};ua.displayName=$e;var da="SelectTrigger",fa=i.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=yn(n),a=Ie(da,n),c=a.disabled||o,l=k(t,a.onTriggerChange),u=xn(n),f=i.useRef("touch"),[d,m,h]=ja(v=>{const g=u().filter(b=>!b.disabled),x=g.find(b=>b.value===a.value),y=ka(g,v,x);y!==void 0&&a.onValueChange(y.value)}),w=v=>{c||(a.onOpenChange(!0),h()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return p.jsx(gt,{asChild:!0,...s,children:p.jsx(D.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":La(a.value)?"":void 0,...r,ref:l,onClick:R(r.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&w(v)}),onPointerDown:R(r.onPointerDown,v=>{f.current=v.pointerType;const g=v.target;g.hasPointerCapture(v.pointerId)&&g.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(w(v),v.preventDefault())}),onKeyDown:R(r.onKeyDown,v=>{const g=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(g&&v.key===" ")&&lm.includes(v.key)&&(w(),v.preventDefault())})})})});fa.displayName=da;var pa="SelectValue",ma=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:a="",...c}=e,l=Ie(pa,n),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,d=k(t,l.onValueNodeChange);return G(()=>{u(f)},[u,f]),p.jsx(D.span,{...c,ref:d,style:{pointerEvents:"none"},children:La(l.value)?p.jsx(p.Fragment,{children:a}):s})});ma.displayName=pa;var vm="SelectIcon",va=i.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return p.jsx(D.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});va.displayName=vm;var hm="SelectPortal",ha=e=>p.jsx(Be,{asChild:!0,...e});ha.displayName=hm;var Fe="SelectContent",ga=i.forwardRef((e,t)=>{const n=Ie(Fe,e.__scopeSelect),[o,r]=i.useState();if(G(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?ft.createPortal(p.jsx(wa,{scope:e.__scopeSelect,children:p.jsx(wn.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),s):null}return p.jsx(xa,{...e,ref:t})});ga.displayName=Fe;var le=10,[wa,Ne]=ot(Fe),gm="SelectContentImpl",wm=om("SelectContent.RemoveScroll"),xa=i.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:a,side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:m,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:g,...x}=e,y=Ie(Fe,n),[b,S]=i.useState(null),[C,P]=i.useState(null),E=k(t,L=>S(L)),[N,O]=i.useState(null),[M,_]=i.useState(null),$=xn(n),[B,A]=i.useState(!1),V=i.useRef(!1);i.useEffect(()=>{if(b)return dn(b)},[b]),ln();const j=i.useCallback(L=>{const[W,...ee]=$().map(Y=>Y.ref.current),[H]=ee.slice(-1),K=document.activeElement;for(const Y of L)if(Y===K||(Y?.scrollIntoView({block:"nearest"}),Y===W&&C&&(C.scrollTop=0),Y===H&&C&&(C.scrollTop=C.scrollHeight),Y?.focus(),document.activeElement!==K))return},[$,C]),F=i.useCallback(()=>j([N,b]),[j,N,b]);i.useEffect(()=>{B&&F()},[B,F]);const{onOpenChange:I,triggerPointerDownPosRef:T}=y;i.useEffect(()=>{if(b){let L={x:0,y:0};const W=H=>{L={x:Math.abs(Math.round(H.pageX)-(T.current?.x??0)),y:Math.abs(Math.round(H.pageY)-(T.current?.y??0))}},ee=H=>{L.x<=10&&L.y<=10?H.preventDefault():b.contains(H.target)||I(!1),document.removeEventListener("pointermove",W),T.current=null};return T.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",ee,{capture:!0})}}},[b,I,T]),i.useEffect(()=>{const L=()=>I(!1);return window.addEventListener("blur",L),window.addEventListener("resize",L),()=>{window.removeEventListener("blur",L),window.removeEventListener("resize",L)}},[I]);const[U,q]=ja(L=>{const W=$().filter(K=>!K.disabled),ee=W.find(K=>K.ref.current===document.activeElement),H=ka(W,L,ee);H&&setTimeout(()=>H.ref.current.focus())}),Q=i.useCallback((L,W,ee)=>{const H=!V.current&&!ee;(y.value!==void 0&&y.value===W||H)&&(O(L),H&&(V.current=!0))},[y.value]),te=i.useCallback(()=>b?.focus(),[b]),J=i.useCallback((L,W,ee)=>{const H=!V.current&&!ee;(y.value!==void 0&&y.value===W||H)&&_(L)},[y.value]),xe=o==="popper"?Qn:ya,ne=xe===Qn?{side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:m,collisionPadding:h,sticky:w,hideWhenDetached:v,avoidCollisions:g}:{};return p.jsx(wa,{scope:n,content:b,viewport:C,onViewportChange:P,itemRefCallback:Q,selectedItem:N,onItemLeave:te,itemTextRefCallback:J,focusSelectedItem:F,selectedItemText:M,position:o,isPositioned:B,searchRef:U,children:p.jsx(yt,{as:wm,allowPinchZoom:!0,children:p.jsx(xt,{asChild:!0,trapped:y.open,onMountAutoFocus:L=>{L.preventDefault()},onUnmountAutoFocus:R(r,L=>{y.trigger?.focus({preventScroll:!0}),L.preventDefault()}),children:p.jsx(Ve,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:L=>L.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:p.jsx(xe,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:L=>L.preventDefault(),...x,...ne,onPlaced:()=>A(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:R(x.onKeyDown,L=>{const W=L.ctrlKey||L.altKey||L.metaKey;if(L.key==="Tab"&&L.preventDefault(),!W&&L.key.length===1&&q(L.key),["ArrowUp","ArrowDown","Home","End"].includes(L.key)){let H=$().filter(K=>!K.disabled).map(K=>K.ref.current);if(["ArrowUp","End"].includes(L.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(L.key)){const K=L.target,Y=H.indexOf(K);H=H.slice(Y+1)}setTimeout(()=>j(H)),L.preventDefault()}})})})})})})});xa.displayName=gm;var xm="SelectItemAlignedPosition",ya=i.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=Ie(Fe,n),a=Ne(Fe,n),[c,l]=i.useState(null),[u,f]=i.useState(null),d=k(t,E=>f(E)),m=xn(n),h=i.useRef(!1),w=i.useRef(!0),{viewport:v,selectedItem:g,selectedItemText:x,focusSelectedItem:y}=a,b=i.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&v&&g&&x){const E=s.trigger.getBoundingClientRect(),N=u.getBoundingClientRect(),O=s.valueNode.getBoundingClientRect(),M=x.getBoundingClientRect();if(s.dir!=="rtl"){const K=M.left-N.left,Y=O.left-K,se=E.left-Y,De=E.width+se,Rn=Math.max(De,N.width),Pn=window.innerWidth-le,Tn=at(Y,[le,Math.max(le,Pn-Rn)]);c.style.minWidth=De+"px",c.style.left=Tn+"px"}else{const K=N.right-M.right,Y=window.innerWidth-O.right-K,se=window.innerWidth-E.right-Y,De=E.width+se,Rn=Math.max(De,N.width),Pn=window.innerWidth-le,Tn=at(Y,[le,Math.max(le,Pn-Rn)]);c.style.minWidth=De+"px",c.style.right=Tn+"px"}const _=m(),$=window.innerHeight-le*2,B=v.scrollHeight,A=window.getComputedStyle(u),V=parseInt(A.borderTopWidth,10),j=parseInt(A.paddingTop,10),F=parseInt(A.borderBottomWidth,10),I=parseInt(A.paddingBottom,10),T=V+j+B+I+F,U=Math.min(g.offsetHeight*5,T),q=window.getComputedStyle(v),Q=parseInt(q.paddingTop,10),te=parseInt(q.paddingBottom,10),J=E.top+E.height/2-le,xe=$-J,ne=g.offsetHeight/2,L=g.offsetTop+ne,W=V+j+L,ee=T-W;if(W<=J){const K=_.length>0&&g===_[_.length-1].ref.current;c.style.bottom="0px";const Y=u.clientHeight-v.offsetTop-v.offsetHeight,se=Math.max(xe,ne+(K?te:0)+Y+F),De=W+se;c.style.height=De+"px"}else{const K=_.length>0&&g===_[0].ref.current;c.style.top="0px";const se=Math.max(J,V+v.offsetTop+(K?Q:0)+ne)+ee;c.style.height=se+"px",v.scrollTop=W-J+v.offsetTop}c.style.margin=`${le}px 0`,c.style.minHeight=U+"px",c.style.maxHeight=$+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,c,u,v,g,x,s.dir,o]);G(()=>b(),[b]);const[S,C]=i.useState();G(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const P=i.useCallback(E=>{E&&w.current===!0&&(b(),y?.(),w.current=!1)},[b,y]);return p.jsx(bm,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:P,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:p.jsx(D.div,{...r,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});ya.displayName=xm;var ym="SelectPopperPosition",Qn=i.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=le,...s}=e,a=yn(n);return p.jsx(rn,{...a,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Qn.displayName=ym;var[bm,Bo]=ot(Fe,{}),Jn="SelectViewport",ba=i.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=Ne(Jn,n),a=Bo(Jn,n),c=k(t,s.onViewportChange),l=i.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),p.jsx(wn.Slot,{scope:n,children:p.jsx(D.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:R(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:m}=a;if(m?.current&&d){const h=Math.abs(l.current-f.scrollTop);if(h>0){const w=window.innerHeight-le*2,v=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),x=Math.max(v,g);if(x0?S:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});ba.displayName=Jn;var Sa="SelectGroup",[Sm,Cm]=ot(Sa),Em=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=ue();return p.jsx(Sm,{scope:n,id:r,children:p.jsx(D.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Em.displayName=Sa;var Ca="SelectLabel",Ea=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Cm(Ca,n);return p.jsx(D.div,{id:r.id,...o,ref:t})});Ea.displayName=Ca;var zt="SelectItem",[Rm,Ra]=ot(zt),Pa=i.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...a}=e,c=Ie(zt,n),l=Ne(zt,n),u=c.value===o,[f,d]=i.useState(s??""),[m,h]=i.useState(!1),w=k(t,y=>l.itemRefCallback?.(y,o,r)),v=ue(),g=i.useRef("touch"),x=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(Rm,{scope:n,value:o,disabled:r,textId:v,isSelected:u,onItemTextChange:i.useCallback(y=>{d(b=>b||(y?.textContent??"").trim())},[]),children:p.jsx(wn.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:p.jsx(D.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:w,onFocus:R(a.onFocus,()=>h(!0)),onBlur:R(a.onBlur,()=>h(!1)),onClick:R(a.onClick,()=>{g.current!=="mouse"&&x()}),onPointerUp:R(a.onPointerUp,()=>{g.current==="mouse"&&x()}),onPointerDown:R(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:R(a.onPointerMove,y=>{g.current=y.pointerType,r?l.onItemLeave?.():g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:R(a.onPointerLeave,y=>{y.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:R(a.onKeyDown,y=>{l.searchRef?.current!==""&&y.key===" "||(um.includes(y.key)&&x(),y.key===" "&&y.preventDefault())})})})})});Pa.displayName=zt;var it="SelectItemText",Ta=i.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,a=Ie(it,n),c=Ne(it,n),l=Ra(it,n),u=mm(it,n),[f,d]=i.useState(null),m=k(t,x=>d(x),l.onItemTextChange,x=>c.itemTextRefCallback?.(x,l.value,l.disabled)),h=f?.textContent,w=i.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:g}=u;return G(()=>(v(w),()=>g(w)),[v,g,w]),p.jsxs(p.Fragment,{children:[p.jsx(D.span,{id:l.textId,...s,ref:m}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ft.createPortal(s.children,a.valueNode):null]})});Ta.displayName=it;var Aa="SelectItemIndicator",_a=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Ra(Aa,n).isSelected?p.jsx(D.span,{"aria-hidden":!0,...o,ref:t}):null});_a.displayName=Aa;var eo="SelectScrollUpButton",Ia=i.forwardRef((e,t)=>{const n=Ne(eo,e.__scopeSelect),o=Bo(eo,e.__scopeSelect),[r,s]=i.useState(!1),a=k(t,o.onScrollButtonChange);return G(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?p.jsx(Oa,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Ia.displayName=eo;var to="SelectScrollDownButton",Na=i.forwardRef((e,t)=>{const n=Ne(to,e.__scopeSelect),o=Bo(to,e.__scopeSelect),[r,s]=i.useState(!1),a=k(t,o.onScrollButtonChange);return G(()=>{if(n.viewport&&n.isPositioned){let c=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?p.jsx(Oa,{...e,ref:a,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Na.displayName=to;var Oa=i.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=Ne("SelectScrollButton",n),a=i.useRef(null),c=xn(n),l=i.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return i.useEffect(()=>()=>l(),[l]),G(()=>{c().find(f=>f.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),p.jsx(D.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:R(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:R(r.onPointerMove,()=>{s.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:R(r.onPointerLeave,()=>{l()})})}),Pm="SelectSeparator",Da=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return p.jsx(D.div,{"aria-hidden":!0,...o,ref:t})});Da.displayName=Pm;var no="SelectArrow",Tm=i.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=yn(n),s=Ie(no,n),a=Ne(no,n);return s.open&&a.position==="popper"?p.jsx(sn,{...r,...o,ref:t}):null});Tm.displayName=no;var Am="SelectBubbleInput",Ma=i.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=i.useRef(null),s=k(o,r),a=gn(t);return i.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&f){const d=new Event("change",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[a,t]),p.jsx(D.select,{...n,style:{...Ur,...n.style},ref:s,defaultValue:t})});Ma.displayName=Am;function La(e){return e===""||e===void 0}function ja(e){const t=z(e),n=i.useRef(""),o=i.useRef(0),r=i.useCallback(a=>{const c=n.current+a;t(c),(function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),s=i.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function ka(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=_m(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function _m(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Ih=ua,Nh=fa,Oh=ma,Dh=va,Mh=ha,Lh=ga,jh=ba,kh=Ea,$h=Pa,Fh=Ta,Vh=_a,Bh=Ia,Wh=Na,Hh=Da,bn="Switch",[Im]=Z(bn),[Nm,Om]=Im(bn),$a=i.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:s,required:a,disabled:c,value:l="on",onCheckedChange:u,form:f,...d}=e,[m,h]=i.useState(null),w=k(t,b=>h(b)),v=i.useRef(!1),g=m?f||!!m.closest("form"):!0,[x,y]=ae({prop:r,defaultProp:s??!1,onChange:u,caller:bn});return p.jsxs(Nm,{scope:n,checked:x,disabled:c,children:[p.jsx(D.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":Wa(x),"data-disabled":c?"":void 0,disabled:c,value:l,...d,ref:w,onClick:R(e.onClick,b=>{y(S=>!S),g&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),g&&p.jsx(Ba,{control:m,bubbles:!v.current,name:o,value:l,checked:x,required:a,disabled:c,form:f,style:{transform:"translateX(-100%)"}})]})});$a.displayName=bn;var Fa="SwitchThumb",Va=i.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=Om(Fa,n);return p.jsx(D.span,{"data-state":Wa(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});Va.displayName=Fa;var Dm="SwitchBubbleInput",Ba=i.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},s)=>{const a=i.useRef(null),c=k(a,s),l=gn(n),u=nn(t);return i.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&h){const w=new Event("click",{bubbles:o});h.call(f,n),f.dispatchEvent(w)}},[l,n,o]),p.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:c,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ba.displayName=Dm;function Wa(e){return e?"checked":"unchecked"}var Kh=$a,Uh=Va,Sn="Checkbox",[Mm]=Z(Sn),[Lm,Wo]=Mm(Sn);function jm(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:s,form:a,name:c,onCheckedChange:l,required:u,value:f="on",internal_do_not_use_render:d}=e,[m,h]=ae({prop:n,defaultProp:r??!1,onChange:l,caller:Sn}),[w,v]=i.useState(null),[g,x]=i.useState(null),y=i.useRef(!1),b=w?!!a||!!w.closest("form"):!0,S={checked:m,disabled:s,setChecked:h,control:w,setControl:v,name:c,form:a,value:f,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:Pe(r)?!1:r,isFormControl:b,bubbleInput:g,setBubbleInput:x};return p.jsx(Lm,{scope:t,...S,children:Fm(d)?d(S):o})}var Ha="CheckboxTrigger",Ka=i.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:s,value:a,disabled:c,checked:l,required:u,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:w}=Wo(Ha,e),v=k(r,f),g=i.useRef(l);return i.useEffect(()=>{const x=s?.form;if(x){const y=()=>d(g.current);return x.addEventListener("reset",y),()=>x.removeEventListener("reset",y)}},[s,d]),p.jsx(D.button,{type:"button",role:"checkbox","aria-checked":Pe(l)?"mixed":l,"aria-required":u,"data-state":Ya(l),"data-disabled":c?"":void 0,disabled:c,value:a,...o,ref:v,onKeyDown:R(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:R(n,x=>{d(y=>Pe(y)?!0:!y),w&&h&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})});Ka.displayName=Ha;var km=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:s,required:a,disabled:c,value:l,onCheckedChange:u,form:f,...d}=e;return p.jsx(jm,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:c,required:a,onCheckedChange:u,name:o,form:f,value:l,internal_do_not_use_render:({isFormControl:m})=>p.jsxs(p.Fragment,{children:[p.jsx(Ka,{...d,ref:t,__scopeCheckbox:n}),m&&p.jsx(Ga,{__scopeCheckbox:n})]})})});km.displayName=Sn;var Ua="CheckboxIndicator",$m=i.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,s=Wo(Ua,n);return p.jsx(X,{present:o||Pe(s.checked)||s.checked===!0,children:p.jsx(D.span,{"data-state":Ya(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});$m.displayName=Ua;var za="CheckboxBubbleInput",Ga=i.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:a,required:c,disabled:l,name:u,value:f,form:d,bubbleInput:m,setBubbleInput:h}=Wo(za,e),w=k(n,h),v=gn(s),g=nn(o);i.useEffect(()=>{const y=m;if(!y)return;const b=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(b,"checked").set,P=!r.current;if(v!==s&&C){const E=new Event("click",{bubbles:P});y.indeterminate=Pe(s),C.call(y,Pe(s)?!1:s),y.dispatchEvent(E)}},[m,v,s,r]);const x=i.useRef(Pe(s)?!1:s);return p.jsx(D.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??x.current,required:c,disabled:l,name:u,value:f,form:d,...t,tabIndex:-1,ref:w,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ga.displayName=za;function Fm(e){return typeof e=="function"}function Pe(e){return e==="indeterminate"}function Ya(e){return Pe(e)?"indeterminate":e?"checked":"unchecked"}var Vm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Bm=Vm.reduce((e,t)=>{const n=pt(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Wm="Separator",Cr="horizontal",Hm=["horizontal","vertical"],Xa=i.forwardRef((e,t)=>{const{decorative:n,orientation:o=Cr,...r}=e,s=Km(o)?o:Cr,c=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return p.jsx(Bm.div,{"data-orientation":s,...c,...r,ref:t})});Xa.displayName=Wm;function Km(e){return Hm.includes(e)}var zh=Xa,qa=["PageUp","PageDown"],Za=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Qa={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},rt="Slider",[oo,Um,zm]=mt(rt),[Ja]=Z(rt,[zm]),[Gm,Cn]=Ja(rt),ec=i.forwardRef((e,t)=>{const{name:n,min:o=0,max:r=100,step:s=1,orientation:a="horizontal",disabled:c=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[o],value:f,onValueChange:d=()=>{},onValueCommit:m=()=>{},inverted:h=!1,form:w,...v}=e,g=i.useRef(new Set),x=i.useRef(0),b=a==="horizontal"?Ym:Xm,[S=[],C]=ae({prop:f,defaultProp:u,onChange:_=>{[...g.current][x.current]?.focus(),d(_)}}),P=i.useRef(S);function E(_){const $=ev(S,_);M(_,$)}function N(_){M(_,x.current)}function O(){const _=P.current[x.current];S[x.current]!==_&&m(S)}function M(_,$,{commit:B}={commit:!1}){const A=rv(s),V=sv(Math.round((_-o)/s)*s+o,A),j=at(V,[o,r]);C((F=[])=>{const I=Qm(F,j,$);if(ov(I,l*s)){x.current=I.indexOf(j);const T=String(I)!==String(F);return T&&B&&m(I),T?I:F}else return F})}return p.jsx(Gm,{scope:e.__scopeSlider,name:n,disabled:c,min:o,max:r,valueIndexToChangeRef:x,thumbs:g.current,values:S,orientation:a,form:w,children:p.jsx(oo.Provider,{scope:e.__scopeSlider,children:p.jsx(oo.Slot,{scope:e.__scopeSlider,children:p.jsx(b,{"aria-disabled":c,"data-disabled":c?"":void 0,...v,ref:t,onPointerDown:R(v.onPointerDown,()=>{c||(P.current=S)}),min:o,max:r,inverted:h,onSlideStart:c?void 0:E,onSlideMove:c?void 0:N,onSlideEnd:c?void 0:O,onHomeKeyDown:()=>!c&&M(o,0,{commit:!0}),onEndKeyDown:()=>!c&&M(r,S.length-1,{commit:!0}),onStepKeyDown:({event:_,direction:$})=>{if(!c){const V=qa.includes(_.key)||_.shiftKey&&Za.includes(_.key)?10:1,j=x.current,F=S[j],I=s*V*$;M(F+I,j,{commit:!0})}}})})})})});ec.displayName=rt;var[tc,nc]=Ja(rt,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Ym=i.forwardRef((e,t)=>{const{min:n,max:o,dir:r,inverted:s,onSlideStart:a,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...f}=e,[d,m]=i.useState(null),h=k(t,b=>m(b)),w=i.useRef(void 0),v=et(r),g=v==="ltr",x=g&&!s||!g&&s;function y(b){const S=w.current||d.getBoundingClientRect(),C=[0,S.width],E=Ho(C,x?[n,o]:[o,n]);return w.current=S,E(b-S.left)}return p.jsx(tc,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:p.jsx(oc,{dir:v,"data-orientation":"horizontal",...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const S=y(b.clientX);a?.(S)},onSlideMove:b=>{const S=y(b.clientX);c?.(S)},onSlideEnd:()=>{w.current=void 0,l?.()},onStepKeyDown:b=>{const C=Qa[x?"from-left":"from-right"].includes(b.key);u?.({event:b,direction:C?-1:1})}})})}),Xm=i.forwardRef((e,t)=>{const{min:n,max:o,inverted:r,onSlideStart:s,onSlideMove:a,onSlideEnd:c,onStepKeyDown:l,...u}=e,f=i.useRef(null),d=k(t,f),m=i.useRef(void 0),h=!r;function w(v){const g=m.current||f.current.getBoundingClientRect(),x=[0,g.height],b=Ho(x,h?[o,n]:[n,o]);return m.current=g,b(v-g.top)}return p.jsx(tc,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:p.jsx(oc,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const g=w(v.clientY);s?.(g)},onSlideMove:v=>{const g=w(v.clientY);a?.(g)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:v=>{const x=Qa[h?"from-bottom":"from-top"].includes(v.key);l?.({event:v,direction:x?-1:1})}})})}),oc=i.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:r,onSlideEnd:s,onHomeKeyDown:a,onEndKeyDown:c,onStepKeyDown:l,...u}=e,f=Cn(rt,n);return p.jsx(D.span,{...u,ref:t,onKeyDown:R(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(c(d),d.preventDefault()):qa.concat(Za).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:R(e.onPointerDown,d=>{const m=d.target;m.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(m)?m.focus():o(d)}),onPointerMove:R(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&r(d)}),onPointerUp:R(e.onPointerUp,d=>{const m=d.target;m.hasPointerCapture(d.pointerId)&&(m.releasePointerCapture(d.pointerId),s(d))})})}),rc="SliderTrack",sc=i.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=Cn(rc,n);return p.jsx(D.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...o,ref:t})});sc.displayName=rc;var ro="SliderRange",ic=i.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=Cn(ro,n),s=nc(ro,n),a=i.useRef(null),c=k(t,a),l=r.values.length,u=r.values.map(m=>lc(m,r.min,r.max)),f=l>1?Math.min(...u):0,d=100-Math.max(...u);return p.jsx(D.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...o,ref:c,style:{...e.style,[s.startEdge]:f+"%",[s.endEdge]:d+"%"}})});ic.displayName=ro;var so="SliderThumb",ac=i.forwardRef((e,t)=>{const n=Um(e.__scopeSlider),[o,r]=i.useState(null),s=k(t,c=>r(c)),a=i.useMemo(()=>o?n().findIndex(c=>c.ref.current===o):-1,[n,o]);return p.jsx(qm,{...e,ref:s,index:a})}),qm=i.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:r,...s}=e,a=Cn(so,n),c=nc(so,n),[l,u]=i.useState(null),f=k(t,y=>u(y)),d=l?a.form||!!l.closest("form"):!0,m=nn(l),h=a.values[o],w=h===void 0?0:lc(h,a.min,a.max),v=Jm(o,a.values.length),g=m?.[c.size],x=g?tv(g,w,c.direction):0;return i.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${w}% + ${x}px)`},children:[p.jsx(oo.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(D.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":a.min,"aria-valuenow":h,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...s,ref:f,style:h===void 0?{display:"none"}:e.style,onFocus:R(e.onFocus,()=>{a.valueIndexToChangeRef.current=o})})}),d&&p.jsx(cc,{name:r??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:h},o)]})});ac.displayName=so;var Zm="RadioBubbleInput",cc=i.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const r=i.useRef(null),s=k(r,o),a=gn(t);return i.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&f){const d=new Event("input",{bubbles:!0});f.call(c,t),c.dispatchEvent(d)}},[a,t]),p.jsx(D.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});cc.displayName=Zm;function Qm(e=[],t,n){const o=[...e];return o[n]=t,o.sort((r,s)=>r-s)}function lc(e,t,n){const s=100/(n-t)*(e-t);return at(s,[0,100])}function Jm(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function ev(e,t){if(e.length===1)return 0;const n=e.map(r=>Math.abs(r-t)),o=Math.min(...n);return n.indexOf(o)}function tv(e,t,n){const o=e/2,s=Ho([0,50],[0,o]);return(o-s(t)*n)*n}function nv(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function ov(e,t){if(t>0){const n=nv(e);return Math.min(...n)>=t}return!0}function Ho(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function rv(e){return(String(e).split(".")[1]||"").length}function sv(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Gh=ec,Yh=sc,Xh=ic,qh=ac;function iv(e){const t=av(e),n=i.forwardRef((o,r)=>{const{children:s,...a}=o,c=i.Children.toArray(s),l=c.find(lv);if(l){const u=l.props.children,f=c.map(d=>d===l?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...a,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,f):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}function av(e){const t=i.forwardRef((n,o)=>{const{children:r,...s}=n;if(i.isValidElement(r)){const a=dv(r),c=uv(s,r.props);return r.type!==i.Fragment&&(c.ref=o?Se(o,a):a),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cv=Symbol("radix.slottable");function lv(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cv}function uv(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...c)=>{const l=s(...c);return r(...c),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function dv(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var En="Popover",[uc]=Z(En,[_e]),Et=_e(),[fv,Oe]=uc(En),dc=e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,c=Et(t),l=i.useRef(null),[u,f]=i.useState(!1),[d,m]=ae({prop:o,defaultProp:r??!1,onChange:s,caller:En});return p.jsx(on,{...c,children:p.jsx(fv,{scope:t,contentId:ue(),triggerRef:l,open:d,onOpenChange:m,onOpenToggle:i.useCallback(()=>m(h=>!h),[m]),hasCustomAnchor:u,onCustomAnchorAdd:i.useCallback(()=>f(!0),[]),onCustomAnchorRemove:i.useCallback(()=>f(!1),[]),modal:a,children:n})})};dc.displayName=En;var fc="PopoverAnchor",pv=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Oe(fc,n),s=Et(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:c}=r;return i.useEffect(()=>(a(),()=>c()),[a,c]),p.jsx(gt,{...s,...o,ref:t})});pv.displayName=fc;var pc="PopoverTrigger",mc=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Oe(pc,n),s=Et(n),a=k(t,r.triggerRef),c=p.jsx(D.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":xc(r.open),...o,ref:a,onClick:R(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?c:p.jsx(gt,{asChild:!0,...s,children:c})});mc.displayName=pc;var Ko="PopoverPortal",[mv,vv]=uc(Ko,{forceMount:void 0}),vc=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,s=Oe(Ko,t);return p.jsx(mv,{scope:t,forceMount:n,children:p.jsx(X,{present:n||s.open,children:p.jsx(Be,{asChild:!0,container:r,children:o})})})};vc.displayName=Ko;var Je="PopoverContent",hc=i.forwardRef((e,t)=>{const n=vv(Je,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,s=Oe(Je,e.__scopePopover);return p.jsx(X,{present:o||s.open,children:s.modal?p.jsx(gv,{...r,ref:t}):p.jsx(wv,{...r,ref:t})})});hc.displayName=Je;var hv=iv("PopoverContent.RemoveScroll"),gv=i.forwardRef((e,t)=>{const n=Oe(Je,e.__scopePopover),o=i.useRef(null),r=k(t,o),s=i.useRef(!1);return i.useEffect(()=>{const a=o.current;if(a)return dn(a)},[]),p.jsx(yt,{as:hv,allowPinchZoom:!0,children:p.jsx(gc,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:R(e.onCloseAutoFocus,a=>{a.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:R(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:R(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),wv=i.forwardRef((e,t)=>{const n=Oe(Je,e.__scopePopover),o=i.useRef(!1),r=i.useRef(!1);return p.jsx(gc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),gc=i.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,...d}=e,m=Oe(Je,n),h=Et(n);return ln(),p.jsx(xt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:p.jsx(Ve,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:p.jsx(rn,{"data-state":xc(m.open),role:"dialog",id:m.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),wc="PopoverClose",xv=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Oe(wc,n);return p.jsx(D.button,{type:"button",...o,ref:t,onClick:R(e.onClick,()=>r.onOpenChange(!1))})});xv.displayName=wc;var yv="PopoverArrow",bv=i.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=Et(n);return p.jsx(sn,{...r,...o,ref:t})});bv.displayName=yv;function xc(e){return e?"open":"closed"}var Zh=dc,Qh=mc,Jh=vc,eg=hc;function Sv(e,t=[]){let n=[];function o(s,a){const c=i.createContext(a);c.displayName=s+"Context";const l=n.length;n=[...n,a];const u=d=>{const{scope:m,children:h,...w}=d,v=m?.[e]?.[l]||c,g=i.useMemo(()=>w,Object.values(w));return p.jsx(v.Provider,{value:g,children:h})};u.displayName=s+"Provider";function f(d,m){const h=m?.[e]?.[l]||c,w=i.useContext(h);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const r=()=>{const s=n.map(a=>i.createContext(a));return function(c){const l=c?.[e]||s;return i.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])}};return r.scopeName=e,[o,Cv(r,...t)]}function Cv(...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 a=o.reduce((c,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...c,...d}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Ev=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Uo=Ev.reduce((e,t)=>{const n=pt(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:a,...c}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...c,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Rv(){return Ac.useSyncExternalStore(Pv,()=>!0,()=>!1)}function Pv(){return()=>{}}var zo="Avatar",[Tv]=Sv(zo),[Av,yc]=Tv(zo),bc=i.forwardRef((e,t)=>{const{__scopeAvatar:n,...o}=e,[r,s]=i.useState("idle");return p.jsx(Av,{scope:n,imageLoadingStatus:r,onImageLoadingStatusChange:s,children:p.jsx(Uo.span,{...o,ref:t})})});bc.displayName=zo;var Sc="AvatarImage",Cc=i.forwardRef((e,t)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:r=()=>{},...s}=e,a=yc(Sc,n),c=_v(o,s),l=z(u=>{r(u),a.onImageLoadingStatusChange(u)});return G(()=>{c!=="idle"&&l(c)},[c,l]),c==="loaded"?p.jsx(Uo.img,{...s,ref:t,src:o}):null});Cc.displayName=Sc;var Ec="AvatarFallback",Rc=i.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:o,...r}=e,s=yc(Ec,n),[a,c]=i.useState(o===void 0);return i.useEffect(()=>{if(o!==void 0){const l=window.setTimeout(()=>c(!0),o);return()=>window.clearTimeout(l)}},[o]),a&&s.imageLoadingStatus!=="loaded"?p.jsx(Uo.span,{...r,ref:t}):null});Rc.displayName=Ec;function Er(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function _v(e,{referrerPolicy:t,crossOrigin:n}){const o=Rv(),r=i.useRef(null),s=o?(r.current||(r.current=new window.Image),r.current):null,[a,c]=i.useState(()=>Er(s,e));return G(()=>{c(Er(s,e))},[s,e]),G(()=>{const l=d=>()=>{c(d)};if(!s)return;const u=l("loaded"),f=l("error");return s.addEventListener("load",u),s.addEventListener("error",f),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",u),s.removeEventListener("error",f)}},[s,n,t]),a}var tg=bc,ng=Cc,og=Rc;export{yh as $,Uv as A,oh as B,Wf as C,Kv as D,rh as E,Qv as F,Jv as G,ii as H,Hf as I,Kf as J,Ff as K,Sh as L,Ch as M,dh as N,Bf as O,D as P,fh as Q,$f as R,Nv as S,Hv as T,R as U,Dv as V,vh as W,hh as X,xh as Y,wh as Z,mh as _,Vf as a,ah as a0,Z as a1,ae as a2,lh as a3,uh as a4,ph as a5,gh as a6,bh as a7,Rh as a8,Ph as a9,pn as aA,X as aB,gn as aC,nn as aD,km as aE,$m as aF,Ih as aG,Oh as aH,Nh as aI,Dh as aJ,Mh as aK,Lh as aL,jh as aM,$h as aN,Vh as aO,Fh as aP,Bh as aQ,Wh as aR,kh as aS,Hh as aT,Th as aa,Eh as ab,tg as ac,og as ad,ng as ae,Zh as af,Qh as ag,Jh as ah,eg as ai,Kh as aj,Uh as ak,zh as al,mt as am,kv as an,$v as ao,k as ap,et as aq,Lv as ar,Ah as as,_h as at,Gh as au,Yh as av,Xh as aw,qh as ax,Ri as ay,Pi as az,Ov as b,Se as c,Mv as d,Zc as e,ol as f,jv as g,Fr as h,Vr as i,Fv as j,Bv as k,Wv as l,zv as m,Vv as n,qv as o,Zv as p,Gv as q,Yv as r,Ac as s,Xv as t,ue as u,th as v,eh as w,nh as x,sh as y,ih as z};