var Ln=e=>{throw TypeError(e)};var $n=(e,t,n)=>t.has(e)||Ln("Cannot "+n);var ne=(e,t,n)=>($n(e,t,"read from private field"),n?n.call(e):t.get(e)),Bn=(e,t,n)=>t.has(e)?Ln("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ft=(e,t,n,o)=>($n(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);import{r as i,c as Xe,j as p,d as xt,u as Ur,o as Vr,s as Wr,f as Kr,e as Gr,h as zr,i as Yr,l as Xr,k as qr}from"./vendor-react-AgJGJ0jt.js";var Zr=Object.defineProperty,dn=(e,t)=>Zr(e,"name",{value:t,configurable:!0});function zt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}dn(zt,"setRef");function oo(...e){return t=>{let n=!1;const o=e.map(r=>{const s=zt(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;rQr(e,"name",{value:t,configurable:!0});function ge(e){const t=i.forwardRef((n,o)=>{let{children:r,...s}=n,c=null,a=!1;const u=[];Yt(r)&&typeof at=="function"&&(r=at(r._payload)),i.Children.forEach(r,f=>{if(ao(f)){a=!0;const C=f;let g="child"in C.props?C.props.child:C.props.children;Yt(g)&&typeof at=="function"&&(g=at(g._payload)),c=Jr(C,g),u.push(c?.props?.children)}else u.push(f)}),c?c=i.cloneElement(c,void 0,u):!a&&i.Children.count(r)===1&&i.isValidElement(r)&&(c=r);const d=c?co(c):void 0,v=k(o,d);if(!c){if(r||r===0)throw new Error(a?ns(e):ts(e));return r}const l=io(s,c.props??{});return c.type!==i.Fragment&&(l.ref=o?v:d),i.cloneElement(c,l)});return t.displayName=`${e}.Slot`,t}xe(ge,"createSlot");var Eu=ge("Slot"),ro=Symbol.for("radix.slottable");function so(e){const t=xe(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=ro,t}xe(so,"createSlottable");var Jr=xe((e,t)=>{if("child"in e.props){const n=e.props.child;return i.isValidElement(n)?i.cloneElement(n,void 0,e.props.children(n.props.children)):null}return i.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function io(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]=(...a)=>{const u=s(...a);return r(...a),u}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}xe(io,"mergeProps");function co(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)}xe(co,"getElementRef");function ao(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ro}xe(ao,"isSlottable");var es=Symbol.for("react.lazy");function Yt(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===es&&"_payload"in e&&uo(e._payload)}xe(Yt,"isLazyComponent");function uo(e){return typeof e=="object"&&e!==null&&"then"in e}xe(uo,"isPromiseLike");var ts=xe(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),ns=xe(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),at=Xe[" use ".trim().toString()],os=Object.defineProperty,qe=(e,t)=>os(e,"name",{value:t,configurable:!0}),lo=!!(typeof window<"u"&&window.document&&window.document.createElement);function E(e,t,{checkForDefaultPrevented:n=!0}={}){return qe(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}qe(E,"composeEventHandlers");function rs(e){if(!lo)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}qe(rs,"getOwnerWindow");function Xt(e){if(!lo)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}qe(Xt,"getOwnerDocument");function fo(e,t=!1){const{activeElement:n}=Xt(e);if(!n?.nodeName)return null;if(po(n)&&n.contentDocument)return fo(n.contentDocument.body,t);if(t){const o=n.getAttribute("aria-activedescendant");if(o){const r=Xt(n).getElementById(o);if(r)return r}}return n}qe(fo,"getActiveElement");function po(e){return e.tagName==="IFRAME"}qe(po,"isFrame");var ss=Object.defineProperty,de=(e,t)=>ss(e,"name",{value:t,configurable:!0});function is(e,t){const n=i.createContext(t);n.displayName=e+"Context";const o=de(s=>{const{children:c,...a}=s,u=i.useMemo(()=>a,Object.values(a));return p.jsx(n.Provider,{value:u,children:c})},"Provider");o.displayName=e+"Provider";function r(s,c={}){const{optional:a=!1}=c,u=i.useContext(n);if(u)return u;if(t!==void 0)return t;if(!a)throw new Error(`\`${s}\` must be used within \`${e}\``)}return de(r,"useContext"),[o,r]}de(is,"createContext");function fe(e,t=[]){let n=[];function o(s,c){const a=i.createContext(c);a.displayName=s+"Context";const u=n.length;n=[...n,c];const d=de(l=>{const{scope:f,children:C,...g}=l,m=f?.[e]?.[u]||a,h=i.useMemo(()=>g,Object.values(g));return p.jsx(m.Provider,{value:h,children:C})},"Provider");d.displayName=s+"Provider";function v(l,f,C={}){const{optional:g=!1}=C,m=f?.[e]?.[u]||a,h=i.useContext(m);if(h)return h;if(c!==void 0)return c;if(!g)throw new Error(`\`${l}\` must be used within \`${s}\``)}return de(v,"useContext"),[d,v]}de(o,"createContext");const r=de(()=>{const s=n.map(c=>i.createContext(c));return de(function(a){const u=a?.[e]||s;return i.useMemo(()=>({[`__scope${e}`]:{...a,[e]:u}}),[a,u])},"useScope")},"createScope");return r.scopeName=e,[o,ho(r,...t)]}de(fe,"createContextScope");function ho(...e){const t=e[0];if(e.length===1)return t;const n=de(()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return de(function(s){const c=o.reduce((a,{useScope:u,scopeName:d})=>{const l=u(s)[`__scope${d}`];return{...a,...l}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}de(ho,"composeContextScopes");var Z=globalThis?.document?i.useLayoutEffect:()=>{},cs=Object.defineProperty,as=(e,t)=>cs(e,"name",{value:t,configurable:!0}),us=Xe[" useId ".trim().toString()]||(()=>{}),ls=0;function Te(e){const[t,n]=i.useState(us());return Z(()=>{e||n(o=>o??String(ls++))},[e]),e||(t?`radix-${t}`:"")}as(Te,"useId");var ds=Object.defineProperty,fs=(e,t)=>ds(e,"name",{value:t,configurable:!0}),Hn=Xe[" useEffectEvent ".trim().toString()],Un=Xe[" useInsertionEffect ".trim().toString()];function vo(e){if(typeof Hn=="function")return Hn(e);const t=i.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Un=="function"?Un(()=>{t.current=e}):Z(()=>{t.current=e}),i.useMemo(()=>((...n)=>t.current?.(...n)),[])}fs(vo,"useEffectEvent");var ps=Object.defineProperty,ot=(e,t)=>ps(e,"name",{value:t,configurable:!0}),hs=Xe[" useInsertionEffect ".trim().toString()]||Z;function Ae({prop:e,defaultProp:t,onChange:n=ot(()=>{},"onChange"),caller:o}){const[r,s,c]=mo({defaultProp:t,onChange:n}),a=e!==void 0,u=a?e:r,d=i.useCallback(v=>{if(a){const l=go(v)?v(e):v;l!==e&&c.current?.(l)}else s(v)},[a,e,s,c]);return[u,d]}ot(Ae,"useControllableState");function mo({defaultProp:e,onChange:t}){const[n,o]=i.useState(e),r=i.useRef(n),s=i.useRef(t);return hs(()=>{s.current=t},[t]),i.useEffect(()=>{r.current!==n&&(s.current?.(n),r.current=n)},[n,r]),[n,o,s]}ot(mo,"useUncontrolledState");function go(e){return typeof e=="function"}ot(go,"isFunction");var Vn=Symbol("RADIX:SYNC_STATE");function vs(e,t,n,o){const{prop:r,defaultProp:s,onChange:c,caller:a}=t,u=r!==void 0,d=vo(c),v=[{...n,state:s}];o&&v.push(o);const[l,f]=i.useReducer((h,b)=>{if(b.type===Vn)return{...h,state:b.state};const S=e(h,b);return u&&!Object.is(S.state,h.state)&&d(S.state),S},...v),C=l.state,g=i.useRef(C);i.useEffect(()=>{g.current!==C&&(g.current=C,u||d(C))},[C,g,u]);const m=i.useMemo(()=>r!==void 0?{...l,state:r}:l,[l,r]);return i.useEffect(()=>{u&&!Object.is(r,l.state)&&f({type:Vn,state:r})},[r,l.state,u]),[m,f]}ot(vs,"useControllableStateReducer");var ms=Object.defineProperty,gs=(e,t)=>ms(e,"name",{value:t,configurable:!0}),Cs=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],N=Cs.reduce((e,t)=>{const n=ge(`Primitive.${t}`),o=i.forwardRef((r,s)=>{const{asChild:c,...a}=r,u=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(u,{...a,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function fn(e,t){e&&xt.flushSync(()=>e.dispatchEvent(t))}gs(fn,"dispatchDiscreteCustomEvent");var xs=Object.defineProperty,ws=(e,t)=>xs(e,"name",{value:t,configurable:!0});function Ce(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>((...n)=>t.current?.(...n)),[])}ws(Ce,"useCallbackRef");var Ss=Object.defineProperty,Q=(e,t)=>Ss(e,"name",{value:t,configurable:!0}),qt="dismissableLayer.update",bs="dismissableLayer.pointerDownOutside",ys="dismissableLayer.focusOutside",Wn,Co=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),rt=i.forwardRef(Q(function(t,n){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:a,onInteractOutside:u,onDismiss:d,...v}=t,l=i.useContext(Co),[f,C]=i.useState(null),g=f?.ownerDocument??globalThis?.document,[,m]=i.useState({}),h=k(n,C),b=Array.from(l.layers),[S]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),x=S?b.indexOf(S):-1,w=f?b.indexOf(f):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,P=w>=x,T=i.useRef(!1),O=wo(M=>{c?.(M),u?.(M),M.defaultPrevented||d?.()},{ownerDocument:g,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:l.dismissableSurfaces,shouldHandlePointerDownOutside:i.useCallback(M=>{if(!(M instanceof Node))return!1;const j=[...l.branches].some(B=>B.contains(M));return P&&!j},[l.branches,P])}),_=So(M=>{if(r&&T.current)return;const j=M.target;[...l.branches].some(G=>G.contains(j))||(a?.(M),u?.(M),M.defaultPrevented||d?.())},g),F=f?w===b.length-1:!1,D=Ce(M=>{M.key==="Escape"&&(s?.(M),!M.defaultPrevented&&d&&(M.preventDefault(),d()))});return i.useEffect(()=>{if(F)return g.addEventListener("keydown",D,{capture:!0}),()=>g.removeEventListener("keydown",D,{capture:!0})},[g,F,D]),i.useEffect(()=>{if(f)return o&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Wn=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),Zt(),()=>{o&&(l.layersWithOutsidePointerEventsDisabled.delete(f),l.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=Wn))}},[f,g,o,l]),i.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),Zt())},[f,l]),i.useEffect(()=>{const M=Q(()=>m({}),"handleUpdate");return document.addEventListener(qt,M),()=>document.removeEventListener(qt,M)},[]),p.jsx(N.div,{...v,ref:h,style:{pointerEvents:y?P?"auto":"none":void 0,...t.style},onFocusCapture:E(t.onFocusCapture,_.onFocusCapture),onBlurCapture:E(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:E(t.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer"));function xo(){const e=i.useContext(Co),[t,n]=i.useState(null);return i.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Q(xo,"useDismissableLayerSurface");var Ps=Q(()=>!0,"IS_TRUE");function wo(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s,shouldHandlePointerDownOutside:c=Ps}=t,a=Ce(e),u=i.useRef(!1),d=i.useRef(!1),v=i.useRef(new Map),l=i.useRef(()=>{});return i.useEffect(()=>{function f(){d.current=!1,r.current=!1,v.current.clear()}Q(f,"resetOutsideInteraction");function C(){return Array.from(v.current.values()).some(Boolean)}Q(C,"isOutsideInteractionIntercepted");function g(x){if(!d.current)return;const w=x.target;w instanceof Node&&[...s].some(P=>P.contains(w))||v.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{d.current&&l.current()},0)}Q(g,"handleInteractionCapture");function m(x){d.current&&v.current.set(x.type,!1)}Q(m,"handleInteractionBubble");const h=Q(x=>{if(x.target&&!u.current){let w=function(){n.removeEventListener("click",l.current);const P=C();f(),P||pn(bs,a,y,{discrete:!0})};if(Q(w,"handleAndDispatchPointerDownOutsideEvent"),!c(x.target)){n.removeEventListener("click",l.current),f(),u.current=!1;return}const y={originalEvent:x};d.current=!0,r.current=o&&x.button===0,v.current.clear(),!o||x.button!==0?w():(n.removeEventListener("click",l.current),l.current=w,n.addEventListener("click",l.current,{once:!0}))}else n.removeEventListener("click",l.current),f();u.current=!1},"handlePointerDown"),b=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of b)n.addEventListener(x,g,!0),n.addEventListener(x,m);const S=window.setTimeout(()=>{n.addEventListener("pointerdown",h)},0);return()=>{window.clearTimeout(S),n.removeEventListener("pointerdown",h),n.removeEventListener("click",l.current);for(const x of b)n.removeEventListener(x,g,!0),n.removeEventListener(x,m)}},[n,a,o,r,s,c]),{onPointerDownCapture:Q(()=>u.current=!0,"onPointerDownCapture")}}Q(wo,"usePointerDownOutside");function So(e,t=globalThis?.document){const n=Ce(e),o=i.useRef(!1);return i.useEffect(()=>{const r=Q(s=>{s.target&&!o.current&&pn(ys,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:Q(()=>o.current=!0,"onFocusCapture"),onBlurCapture:Q(()=>o.current=!1,"onBlurCapture")}}Q(So,"useFocusOutside");function Zt(){const e=new CustomEvent(qt);document.dispatchEvent(e)}Q(Zt,"dispatchUpdate");function pn(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?fn(r,s):r.dispatchEvent(s)}Q(pn,"handleAndDispatchCustomEvent");var Es=Object.defineProperty,re=(e,t)=>Es(e,"name",{value:t,configurable:!0}),Lt="focusScope.autoFocusOnMount",$t="focusScope.autoFocusOnUnmount",Kn={bubbles:!1,cancelable:!0},wt=i.forwardRef(re(function(t,n){const{loop:o=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:c,...a}=t,[u,d]=i.useState(null),v=Ce(s),l=Ce(c),f=i.useRef(null),C=k(n,d),g=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(r){let h=function(w){if(g.paused||!u)return;const y=w.target;u.contains(y)?f.current=y:Ie(f.current,{select:!0})},b=function(w){if(g.paused||!u)return;const y=w.relatedTarget;y!==null&&(u.contains(y)||Ie(f.current,{select:!0}))},S=function(w){if(document.activeElement===document.body)for(const P of w)P.removedNodes.length>0&&Ie(u)};re(h,"handleFocusIn"),re(b,"handleFocusOut"),re(S,"handleMutations"),document.addEventListener("focusin",h),document.addEventListener("focusout",b);const x=new MutationObserver(S);return u&&x.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),x.disconnect()}}},[r,u,g.paused]),i.useEffect(()=>{if(u){Gn.add(g);const h=document.activeElement;if(!u.contains(h)){const S=new CustomEvent(Lt,Kn);u.addEventListener(Lt,v),u.dispatchEvent(S),S.defaultPrevented||(bo(Io(hn(u)),{select:!0}),document.activeElement===h&&Ie(u))}return()=>{u.removeEventListener(Lt,v),setTimeout(()=>{const S=new CustomEvent($t,Kn);u.addEventListener($t,l),u.dispatchEvent(S),S.defaultPrevented||Ie(h??document.body,{select:!0}),u.removeEventListener($t,l),Gn.remove(g)},0)}}},[u,v,l,g]);const m=i.useCallback(h=>{if(!o&&!r||g.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,S=document.activeElement;if(b&&S){const x=h.currentTarget,[w,y]=yo(x);w&&y?!h.shiftKey&&S===y?(h.preventDefault(),o&&Ie(w,{select:!0})):h.shiftKey&&S===w&&(h.preventDefault(),o&&Ie(y,{select:!0})):S===x&&h.preventDefault()}},[o,r,g.paused]);return p.jsx(N.div,{tabIndex:-1,...a,ref:C,onKeyDown:m})},"FocusScope"));function bo(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Ie(o,{select:t}),document.activeElement!==n)return}re(bo,"focusFirst");function yo(e){const t=hn(e),n=Qt(t,e),o=Qt(t.reverse(),e);return[n,o]}re(yo,"getTabbableEdges");function hn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:re(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},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}re(hn,"getTabbableCandidates");function Qt(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const o of e)if(!(n?!o.checkVisibility({checkVisibilityCSS:!0}):Po(o,{upTo:t})))return o}re(Qt,"findVisible");function Po(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}re(Po,"isHidden");function Eo(e){return e instanceof HTMLInputElement&&"select"in e}re(Eo,"isSelectableInput");function Ie(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Eo(e)&&t&&e.select()}}re(Ie,"focus");var Gn=Ro();function Ro(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Jt(e,t),e.unshift(t)},remove(t){e=Jt(e,t),e[0]?.resume()}}}re(Ro,"createFocusScopesStack");function Jt(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}re(Jt,"arrayRemove");function Io(e){return e.filter(t=>t.tagName!=="A")}re(Io,"removeLinks");var Rs=Object.defineProperty,Is=(e,t)=>Rs(e,"name",{value:t,configurable:!0}),st=i.forwardRef(Is(function(t,n){const{container:o,...r}=t,[s,c]=i.useState(!1);Z(()=>c(!0),[]);const a=o||s&&globalThis?.document?.body;return a?xt.createPortal(p.jsx(N.div,{...r,ref:n}),a):null},"Portal")),_s=Object.defineProperty,Me=(e,t)=>_s(e,"name",{value:t,configurable:!0});function _o(e,t){return i.useReducer((n,o)=>t[n][o]??n,e)}Me(_o,"useStateMachine");var pe=Me(e=>{const{present:t,children:n}=e,o=Mo(t),r=typeof n=="function"?n({present:o.isPresent}):i.Children.only(n),s=To(o.ref,Oo(r));return typeof n=="function"||o.isPresent?i.cloneElement(r,{ref:s}):null},"Presence");function Mo(e){const[t,n]=i.useState(),o=i.useRef(null),r=i.useRef(e),s=i.useRef("none"),c=i.useRef(void 0),a=e?"mounted":"unmounted",[u,d]=_o(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{u==="mounted"?(s.current=c.current??Ke(o.current),c.current=void 0):s.current="none"},[u]),Z(()=>{const v=o.current,l=r.current;if(l!==e){const C=s.current,g=Ke(v);e?(c.current=g,d("MOUNT")):g==="none"||v?.display==="none"?d("UNMOUNT"):d(l&&C!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,d]),Z(()=>{if(t){let v;const l=t.ownerDocument.defaultView??window,f=Me(g=>{const h=Ke(o.current).includes(CSS.escape(g.animationName));if(g.target===t&&h&&(d("ANIMATION_END"),!r.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",v=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},"handleAnimationEnd"),C=Me(g=>{g.target===t&&(s.current=Ke(o.current))},"handleAnimationStart");return t.addEventListener("animationstart",C),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{l.clearTimeout(v),t.removeEventListener("animationstart",C),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:i.useCallback(v=>{if(v){const l=getComputedStyle(v);o.current=l,c.current=Ke(l)}else o.current=null;n(v)},[])}}Me(Mo,"usePresence");function en(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Me(en,"setRef");function To(...e){const t=i.useRef(e);return t.current=e,i.useCallback(n=>{const o=t.current;let r=!1;const s=o.map(c=>{const a=en(c,n);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let c=0;cMs(e,"name",{value:t,configurable:!0}),ut=0,He=null;function Ts(e){return Ze(),e.children}vn(Ts,"FocusGuards");function Ze(){i.useEffect(()=>{He||(He={start:tn(),end:tn()});const{start:e,end:t}=He;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ut++,()=>{ut===1&&(He?.start.remove(),He?.end.remove(),He=null),ut=Math.max(0,ut-1)}},[])}vn(Ze,"useFocusGuards");function tn(){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}vn(tn,"createFocusGuard");var we=function(){return we=Object.assign||function(t){for(var n,o=1,r=arguments.length;o"u")return zs;var t=Ys(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])}},qs=No(),Ge="data-scroll-locked",Zs=function(e,t,n,o){var r=e.left,s=e.top,c=e.right,a=e.gap;return n===void 0&&(n="margin"),` .`.concat(Ds,` { overflow: hidden `).concat(o,`; padding-right: `).concat(a,"px ").concat(o,`; } body[`).concat(Ge,`] { 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(c,`px; margin-left:0; margin-top:0; margin-right: `).concat(a,"px ").concat(o,`; `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(o,";")].filter(Boolean).join(""),` } .`).concat(mt,` { right: `).concat(a,"px ").concat(o,`; } .`).concat(gt,` { margin-right: `).concat(a,"px ").concat(o,`; } .`).concat(mt," .").concat(mt,` { right: 0 `).concat(o,`; } .`).concat(gt," .").concat(gt,` { margin-right: 0 `).concat(o,`; } body[`).concat(Ge,`] { `).concat(As,": ").concat(a,`px; } `)},Yn=function(){var e=parseInt(document.body.getAttribute(Ge)||"0",10);return isFinite(e)?e:0},Qs=function(){i.useEffect(function(){return document.body.setAttribute(Ge,(Yn()+1).toString()),function(){var e=Yn()-1;e<=0?document.body.removeAttribute(Ge):document.body.setAttribute(Ge,e.toString())}},[])},Js=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Qs();var s=i.useMemo(function(){return Xs(r)},[r]);return i.createElement(qs,{styles:Zs(s,!t,r,n?"":"!important")})},nn=!1;if(typeof window<"u")try{var lt=Object.defineProperty({},"passive",{get:function(){return nn=!0,!0}});window.addEventListener("test",lt,lt),window.removeEventListener("test",lt,lt)}catch{nn=!1}var Ue=nn?{passive:!1}:!1,ei=function(e){return e.tagName==="TEXTAREA"},jo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ei(e)&&n[t]==="visible")},ti=function(e){return jo(e,"overflowY")},ni=function(e){return jo(e,"overflowX")},Xn=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Fo(e,o);if(r){var s=Lo(e,o),c=s[1],a=s[2];if(c>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},oi=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},ri=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Fo=function(e,t){return e==="v"?ti(t):ni(t)},Lo=function(e,t){return e==="v"?oi(t):ri(t)},si=function(e,t){return e==="h"&&t==="rtl"?-1:1},ii=function(e,t,n,o,r){var s=si(e,window.getComputedStyle(t).direction),c=s*o,a=n.target,u=t.contains(a),d=!1,v=c>0,l=0,f=0;do{if(!a)break;var C=Lo(e,a),g=C[0],m=C[1],h=C[2],b=m-h-s*g;(g||b)&&Fo(e,a)&&(l+=b,f+=g);var S=a.parentNode;a=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return(v&&Math.abs(l)<1||!v&&Math.abs(f)<1)&&(d=!0),d},dt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qn=function(e){return[e.deltaX,e.deltaY]},Zn=function(e){return e&&"current"in e?e.current:e},ci=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ai=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},ui=0,Ve=[];function li(e){var t=i.useRef([]),n=i.useRef([0,0]),o=i.useRef(),r=i.useState(ui++)[0],s=i.useState(No)[0],c=i.useRef(e);i.useEffect(function(){c.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var m=Os([e.lockRef.current],(e.shards||[]).map(Zn),!0).filter(Boolean);return m.forEach(function(h){return h.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var a=i.useCallback(function(m,h){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!c.current.allowPinchZoom;var b=dt(m),S=n.current,x="deltaX"in m?m.deltaX:S[0]-b[0],w="deltaY"in m?m.deltaY:S[1]-b[1],y,P=m.target,T=Math.abs(x)>Math.abs(w)?"h":"v";if("touches"in m&&T==="h"&&P.type==="range")return!1;var O=window.getSelection(),_=O&&O.anchorNode,F=_?_===P||_.contains(P):!1;if(F)return!1;var D=Xn(T,P);if(!D)return!0;if(D?y=T:(y=T==="v"?"h":"v",D=Xn(T,P)),!D)return!1;if(!o.current&&"changedTouches"in m&&(x||w)&&(o.current=y),!y)return!0;var M=o.current||y;return ii(M,h,m,M==="h"?x:w)},[]),u=i.useCallback(function(m){var h=m;if(!(!Ve.length||Ve[Ve.length-1]!==s)){var b="deltaY"in h?qn(h):dt(h),S=t.current.filter(function(y){return y.name===h.type&&(y.target===h.target||h.target===y.shadowParent)&&ci(y.delta,b)})[0];if(S&&S.should){h.cancelable&&h.preventDefault();return}if(!S){var x=(c.current.shards||[]).map(Zn).filter(Boolean).filter(function(y){return y.contains(h.target)}),w=x.length>0?a(h,x[0]):!c.current.noIsolation;w&&h.cancelable&&h.preventDefault()}}},[]),d=i.useCallback(function(m,h,b,S){var x={name:m,delta:h,target:b,should:S,shadowParent:di(b)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(w){return w!==x})},1)},[]),v=i.useCallback(function(m){n.current=dt(m),o.current=void 0},[]),l=i.useCallback(function(m){d(m.type,qn(m),m.target,a(m,e.lockRef.current))},[]),f=i.useCallback(function(m){d(m.type,dt(m),m.target,a(m,e.lockRef.current))},[]);i.useEffect(function(){return Ve.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:f}),document.addEventListener("wheel",u,Ue),document.addEventListener("touchmove",u,Ue),document.addEventListener("touchstart",v,Ue),function(){Ve=Ve.filter(function(m){return m!==s}),document.removeEventListener("wheel",u,Ue),document.removeEventListener("touchmove",u,Ue),document.removeEventListener("touchstart",v,Ue)}},[]);var C=e.removeScrollBar,g=e.inert;return i.createElement(i.Fragment,null,g?i.createElement(s,{styles:ai(r)}):null,C?i.createElement(Js,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function di(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fi=Bs(ko,li);var it=i.forwardRef(function(e,t){return i.createElement(St,we({},e,{ref:t,sideCar:fi}))});it.classNames=St.classNames;var pi=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},We=new WeakMap,ft=new WeakMap,pt={},Vt=0,$o=function(e){return e&&(e.host||$o(e.parentNode))},hi=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=$o(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})},vi=function(e,t,n,o){var r=hi(t,Array.isArray(e)?e:[e]);pt[n]||(pt[n]=new WeakMap);var s=pt[n],c=[],a=new Set,u=new Set(r),d=function(l){!l||a.has(l)||(a.add(l),d(l.parentNode))};r.forEach(d);var v=function(l){!l||u.has(l)||Array.prototype.forEach.call(l.children,function(f){if(a.has(f))v(f);else try{var C=f.getAttribute(o),g=C!==null&&C!=="false",m=(We.get(f)||0)+1,h=(s.get(f)||0)+1;We.set(f,m),s.set(f,h),c.push(f),m===1&&g&&ft.set(f,!0),h===1&&f.setAttribute(n,"true"),g||f.setAttribute(o,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return v(t),a.clear(),Vt++,function(){c.forEach(function(l){var f=We.get(l)-1,C=s.get(l)-1;We.set(l,f),s.set(l,C),f||(ft.has(l)||l.removeAttribute(o),ft.delete(l)),C||l.removeAttribute(n)}),Vt--,Vt||(We=new WeakMap,We=new WeakMap,ft=new WeakMap,pt={})}},bt=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=pi(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),vi(o,r,n,"aria-hidden")):function(){return null}},mi=Object.defineProperty,he=(e,t)=>mi(e,"name",{value:t,configurable:!0}),mn="Dialog",[Bo,Ru]=fe(mn),[gi,Se]=Bo(mn),Iu=he(e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:c=!0}=e,a=i.useRef(null),u=i.useRef(null),[d,v]=Ae({prop:o,defaultProp:r??!1,onChange:s,caller:mn}),[l,f]=i.useState(0),[C,g]=i.useState(0);return p.jsx(gi,{scope:t,triggerRef:a,contentRef:u,contentId:Te(),titleId:Te(),descriptionId:Te(),titlePresent:l>0,descriptionPresent:C>0,setTitleCount:f,setDescriptionCount:g,open:d,onOpenChange:v,onOpenToggle:i.useCallback(()=>v(m=>!m),[v]),modal:c,children:n})},"Dialog"),Ho="DialogPortal",[Ci,Uo]=Bo(Ho,{forceMount:void 0}),_u=he(e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=Se(Ho,t);return p.jsx(Ci,{scope:t,forceMount:n,children:i.Children.map(o,c=>p.jsx(pe,{present:n||s.open,children:p.jsx(st,{asChild:!0,container:r,children:c})}))})},"DialogPortal"),on="DialogOverlay",Mu=i.forwardRef(he(function(t,n){const o=Uo(on,t.__scopeDialog),{forceMount:r=o.forceMount,...s}=t,c=Se(on,t.__scopeDialog);return c.modal?p.jsx(pe,{present:r||c.open,children:p.jsx(wi,{...s,ref:n})}):null},"DialogOverlay")),xi=ge("DialogOverlay.RemoveScroll"),wi=i.forwardRef(he(function(t,n){const{__scopeDialog:o,...r}=t,s=Se(on,o),c=xo(),a=k(n,c);return p.jsx(it,{as:xi,allowPinchZoom:!0,shards:[s.contentRef],children:p.jsx(N.div,{"data-state":gn(s.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),Qe="DialogContent",Tu=i.forwardRef(he(function(t,n){const o=Uo(Qe,t.__scopeDialog),{forceMount:r=o.forceMount,...s}=t,c=Se(Qe,t.__scopeDialog);return p.jsx(pe,{present:r||c.open,children:c.modal?p.jsx(Si,{...s,ref:n}):p.jsx(bi,{...s,ref:n})})},"DialogContent")),Si=i.forwardRef(he(function(t,n){const o=Se(Qe,t.__scopeDialog),r=i.useRef(null),s=k(n,o.contentRef,r);return i.useEffect(()=>{const c=r.current;if(c)return bt(c)},[]),p.jsx(Vo,{...t,ref:s,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:E(t.onCloseAutoFocus,c=>{c.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:E(t.onPointerDownOutside,c=>{const a=c.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&c.preventDefault()}),onFocusOutside:E(t.onFocusOutside,c=>c.preventDefault())})},"DialogContentModal")),bi=i.forwardRef(he(function(t,n){const o=Se(Qe,t.__scopeDialog),r=i.useRef(!1),s=i.useRef(!1);return p.jsx(Vo,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{t.onCloseAutoFocus?.(c),c.defaultPrevented||(r.current||o.triggerRef.current?.focus(),c.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:c=>{t.onInteractOutside?.(c),c.defaultPrevented||(r.current=!0,c.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=c.target;o.triggerRef.current?.contains(a)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&s.current&&c.preventDefault()}})},"DialogContentNonModal")),Vo=i.forwardRef(he(function(t,n){const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:c,...a}=t,u=Se(Qe,o);return Ze(),p.jsx(p.Fragment,{children:p.jsx(wt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:c,children:p.jsx(rt,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":gn(u.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl")),yi="DialogTitle",Ou=i.forwardRef(he(function(t,n){const{__scopeDialog:o,...r}=t,s=Se(yi,o),{setTitleCount:c}=s;return Z(()=>(c(a=>a+1),()=>c(a=>a-1)),[c]),p.jsx(N.h2,{id:s.titleId,...r,ref:n})},"DialogTitle")),Pi="DialogDescription",Du=i.forwardRef(he(function(t,n){const{__scopeDialog:o,...r}=t,s=Se(Pi,o),{setDescriptionCount:c}=s;return Z(()=>(c(a=>a+1),()=>c(a=>a-1)),[c]),p.jsx(N.p,{id:s.descriptionId,...r,ref:n})},"DialogDescription")),Ei="DialogClose",Au=i.forwardRef(he(function(t,n){const{__scopeDialog:o,...r}=t,s=Se(Ei,o);return p.jsx(N.button,{type:"button",...r,ref:n,onClick:E(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function gn(e){return e?"open":"closed"}he(gn,"getState");var Ri=Object.defineProperty,J=(e,t)=>Ri(e,"name",{value:t,configurable:!0});function yt(e){const t=e+"CollectionProvider",[n,o]=fe(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=J(m=>{const{scope:h,children:b}=m,S=i.useRef(null),x=i.useRef(new Map).current;return p.jsx(r,{scope:h,itemMap:x,collectionRef:S,children:b})},"CollectionProvider");c.displayName=t;const a=e+"CollectionSlot",u=ge(a),d=i.forwardRef((m,h)=>{const{scope:b,children:S}=m,x=s(a,b),w=k(h,x.collectionRef);return p.jsx(u,{ref:w,children:S})});d.displayName=a;const v=e+"CollectionItemSlot",l="data-radix-collection-item",f=ge(v),C=i.forwardRef((m,h)=>{const{scope:b,children:S,...x}=m,w=i.useRef(null),y=k(h,w),P=s(v,b);return i.useEffect(()=>(P.itemMap.set(w,{ref:w,...x}),()=>{P.itemMap.delete(w)})),p.jsx(f,{[l]:"",ref:y,children:S})});C.displayName=v;function g(m){const h=s(e+"CollectionConsumer",m);return i.useCallback(()=>{const S=h.collectionRef.current;if(!S)return[];const x=Array.from(S.querySelectorAll(`[${l}]`));return Array.from(h.itemMap.values()).sort((P,T)=>x.indexOf(P.ref.current)-x.indexOf(T.ref.current))},[h.collectionRef,h.itemMap])}return J(g,"useCollection"),[{Provider:c,Slot:d,ItemSlot:C},g,o]}J(yt,"createCollection");var Qn=new WeakMap,X,ce,Wt=(ce=class extends Map{constructor(n){super(n);Bn(this,X);Ft(this,X,[...super.keys()]),Qn.set(this,!0)}set(n,o){return Qn.get(this)&&(this.has(n)?ne(this,X)[ne(this,X).indexOf(n)]=n:ne(this,X).push(n)),super.set(n,o),this}insert(n,o,r){const s=this.has(o),c=ne(this,X).length,a=Cn(n);let u=a>=0?a:c+a;const d=u<0||u>=c?-1:u;if(d===this.size||s&&d===this.size-1||d===-1)return this.set(o,r),this;const v=this.size+(s?0:1);a<0&&u++;const l=[...ne(this,X)];let f,C=!1;for(let g=u;g=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,o){const r=this.indexOf(n);if(r===-1)return;let s=r+o;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,o){let r=0;for(const s of this){if(Reflect.apply(n,o,[s,r,this]))return s;r++}}findIndex(n,o){let r=0;for(const s of this){if(Reflect.apply(n,o,[s,r,this]))return r;r++}return-1}filter(n,o){const r=[];let s=0;for(const c of this)Reflect.apply(n,o,[c,s,this])&&r.push(c),s++;return new ce(r)}map(n,o){const r=[];let s=0;for(const c of this)r.push([c[0],Reflect.apply(n,o,[c,s,this])]),s++;return new ce(r)}reduce(...n){const[o,r]=n;let s=0,c=r??this.at(0);for(const a of this)s===0&&n.length===1?c=a:c=Reflect.apply(o,this,[c,a,s,this]),s++;return c}reduceRight(...n){const[o,r]=n;let s=r??this.at(-1);for(let c=this.size-1;c>=0;c--){const a=this.at(c);c===this.size-1&&n.length===1?s=a:s=Reflect.apply(o,this,[s,a,c,this])}return s}toSorted(n){const o=[...this.entries()].sort(n);return new ce(o)}toReversed(){const n=new ce;for(let o=this.size-1;o>=0;o--){const r=this.keyAt(o),s=this.get(r);n.set(r,s)}return n}toSpliced(...n){const o=[...this.entries()];return o.splice(...n),new ce(o)}slice(n,o){const r=new ce;let s=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),o!==void 0&&o>0&&(s=o-1);for(let c=n;c<=s;c++){const a=this.keyAt(c),u=this.get(a);r.set(a,u)}return r}every(n,o){let r=0;for(const s of this){if(!Reflect.apply(n,o,[s,r,this]))return!1;r++}return!0}some(n,o){let r=0;for(const s of this){if(Reflect.apply(n,o,[s,r,this]))return!0;r++}return!1}},X=new WeakMap,J(ce,"OrderedDict"),ce);function Ct(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=Wo(e,t);return n===-1?void 0:e[n]}J(Ct,"at");function Wo(e,t){const n=e.length,o=Cn(t),r=o>=0?o:n+o;return r<0||r>=n?-1:r}J(Wo,"toSafeIndex");function Cn(e){return e!==e||e===0?0:Math.trunc(e)}J(Cn,"toSafeInteger");function Ii(e){const t=e+"CollectionProvider",[n,o]=fe(t),[r,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Wt,setItemMap:J(()=>{},"setItemMap")}),c=J(({state:x,...w})=>x?p.jsx(u,{...w,state:x}):p.jsx(a,{...w}),"CollectionProvider");c.displayName=t;const a=J(x=>{const w=h();return p.jsx(u,{...x,state:w})},"CollectionInit");a.displayName=t+"Init";const u=J(x=>{const{scope:w,children:y,state:P}=x,T=i.useRef(null),[O,_]=i.useState(null),F=k(T,_),[D,M]=P;return i.useEffect(()=>{if(!O)return;const j=zo(()=>{});return j.observe(O,{childList:!0,subtree:!0}),()=>{j.disconnect()}},[O]),p.jsx(r,{scope:w,itemMap:D,setItemMap:M,collectionRef:F,collectionRefObject:T,collectionElement:O,children:y})},"CollectionProviderImpl");u.displayName=t+"Impl";const d=e+"CollectionSlot",v=ge(d),l=i.forwardRef((x,w)=>{const{scope:y,children:P}=x,T=s(d,y),O=k(w,T.collectionRef);return p.jsx(v,{ref:O,children:P})});l.displayName=d;const f=e+"CollectionItemSlot",C="data-radix-collection-item",g=ge(f),m=i.forwardRef((x,w)=>{const{scope:y,children:P,...T}=x,O=i.useRef(null),[_,F]=i.useState(null),D=k(w,O,F),M=s(f,y),{setItemMap:j}=M,B=i.useRef(T);Ko(B.current,T)||(B.current=T);const G=B.current;return i.useEffect(()=>{const z=G;return j(A=>_?A.has(_)?A.set(_,{...z,element:_}).toSorted(rn):(A.set(_,{...z,element:_}),A.toSorted(rn)):A),()=>{j(A=>!_||!A.has(_)?A:(A.delete(_),new Wt(A)))}},[_,G,j]),p.jsx(g,{[C]:"",ref:D,children:P})});m.displayName=f;function h(){return i.useState(new Wt)}J(h,"useInitCollection");function b(x){const{itemMap:w}=s(e+"CollectionConsumer",x);return w}return J(b,"useCollection"),[{Provider:c,Slot:l,ItemSlot:m},{createCollectionScope:o,useCollection:b,useInitCollection:h}]}J(Ii,"createCollection");function Ko(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}J(Ko,"shallowEqual");function Go(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}J(Go,"isElementPreceding");function rn(e,t){return!e[1].element||!t[1].element?0:Go(e[1].element,t[1].element)?-1:1}J(rn,"sortByDocumentPosition");function zo(e){return new MutationObserver(n=>{for(const o of n)if(o.type==="childList"){e();return}})}J(zo,"getChildListObserver");var _i=Object.defineProperty,Mi=(e,t)=>_i(e,"name",{value:t,configurable:!0}),Ti=i.createContext(void 0);function xn(e){const t=i.useContext(Ti);return e||t||"ltr"}Mi(xn,"useDirection");var Oi=Object.defineProperty,Di=(e,t)=>Oi(e,"name",{value:t,configurable:!0}),Ai=i.forwardRef(Di(function(t,n){const{children:o,width:r=10,height:s=5,...c}=t;return p.jsx(N.svg,{...c,ref:n,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?o:p.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),ki=Ai,Ni=Object.defineProperty,ji=(e,t)=>Ni(e,"name",{value:t,configurable:!0});function wn(e){const[t,n]=i.useState(void 0);return Z(()=>{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 c,a;if("borderBoxSize"in s){const u=s.borderBoxSize,d=Array.isArray(u)?u[0]:u;c=d.inlineSize,a=d.blockSize}else c=e.offsetWidth,a=e.offsetHeight;n({width:c,height:a})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}ji(wn,"useSize");var Fi=Object.defineProperty,_e=(e,t)=>Fi(e,"name",{value:t,configurable:!0}),Yo="Popper",[Xo,De]=fe(Yo),[Li,qo]=Xo(Yo),$i=_e(e=>{const{__scopePopper:t,children:n}=e,[o,r]=i.useState(null),[s,c]=i.useState(void 0);return p.jsx(Li,{scope:t,anchor:o,onAnchorChange:r,placementState:s,setPlacementState:c,children:n})},"Popper"),Bi="PopperAnchor",Hi=i.forwardRef(_e(function(t,n){const{__scopePopper:o,virtualRef:r,...s}=t,c=qo(Bi,o),a=i.useRef(null),u=c.onAnchorChange,d=i.useCallback(m=>{a.current=m,m&&u(m)},[u]),v=k(n,d),l=i.useRef(null);i.useEffect(()=>{if(!r)return;const m=l.current;l.current=r.current,m!==l.current&&u(l.current)});const f=c.placementState&&Pt(c.placementState),C=f?.[0],g=f?.[1];return r?null:p.jsx(N.div,{"data-radix-popper-side":C,"data-radix-popper-align":g,...s,ref:v})},"PopperAnchor")),Zo="PopperContent",[Ui,Vi]=Xo(Zo),Wi=i.forwardRef(_e(function(t,n){const{__scopePopper:o,side:r="bottom",sideOffset:s=0,align:c="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:v=[],collisionPadding:l=0,sticky:f="partial",hideWhenDetached:C=!1,updatePositionStrategy:g="optimized",onPlaced:m,...h}=t,b=qo(Zo,o),[S,x]=i.useState(null),w=k(n,x),[y,P]=i.useState(null),T=wn(y),O=T?.width??0,_=T?.height??0,F=r+(c!=="center"?"-"+c:""),D=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},M=Array.isArray(v)?v:[v],j=M.length>0,B={padding:D,boundary:M.filter(Qo),altBoundary:j},{refs:G,floatingStyles:z,placement:A,isPositioned:oe,middlewareData:K}=Ur({strategy:"fixed",placement:F,whileElementsMounted:_e((...H)=>qr(...H,{animationFrame:g==="always"}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[Vr({mainAxis:s+_,alignmentAxis:a}),d&&Wr({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Xr():void 0,...B}),d&&Kr({...B}),Gr({...B,apply:_e(({elements:H,rects:te,availableWidth:V,availableHeight:W})=>{const{width:Y,height:Re}=te.reference,le=H.floating.style;le.setProperty("--radix-popper-available-width",`${V}px`),le.setProperty("--radix-popper-available-height",`${W}px`),le.setProperty("--radix-popper-anchor-width",`${Y}px`),le.setProperty("--radix-popper-anchor-height",`${Re}px`)},"apply")}),y&&zr({element:y,padding:u}),Yi({arrowWidth:O,arrowHeight:_}),C&&Yr({strategy:"referenceHidden",...B,boundary:j?B.boundary:void 0})]}),R=b.setPlacementState;Z(()=>(R(A),()=>{R(void 0)}),[A,R]);const[ee,U]=Pt(A),q=Ce(m);Z(()=>{oe&&q?.()},[oe,q]);const ae=K.arrow?.x,ue=K.arrow?.y,Ee=K.arrow?.centerOffset!==0,[ie,I]=i.useState();return Z(()=>{S&&I(window.getComputedStyle(S).zIndex)},[S]),p.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:oe?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[K.transformOrigin?.x,K.transformOrigin?.y].join(" "),...K.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:p.jsx(Ui,{scope:o,placedSide:ee,placedAlign:U,onArrowChange:P,arrowX:ae,arrowY:ue,shouldHideArrow:Ee,children:p.jsx(N.div,{"data-side":ee,"data-align":U,...h,ref:w,style:{...h.style,animation:oe?h.style?.animation:"none"}})})})},"PopperContent")),Ki="PopperArrow",Gi={top:"bottom",right:"left",bottom:"top",left:"right"},zi=i.forwardRef(_e(function(t,n){const{__scopePopper:o,...r}=t,s=Vi(Ki,o),c=Gi[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[c]: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(ki,{...r,ref:n,style:{...r.style,display:"block"}})})},"PopperArrow"));function Qo(e){return e!==null}_e(Qo,"isNotNull");var Yi=_e(e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,c=r.arrow?.centerOffset!==0,a=c?0:e.arrowWidth,u=c?0:e.arrowHeight,[d,v]=Pt(n),l={start:"0%",center:"50%",end:"100%"}[v],f=(r.arrow?.x??0)+a/2,C=(r.arrow?.y??0)+u/2;let g="",m="";return d==="bottom"?(g=c?l:`${f}px`,m=`${-u}px`):d==="top"?(g=c?l:`${f}px`,m=`${o.floating.height+u}px`):d==="right"?(g=`${-u}px`,m=c?l:`${C}px`):d==="left"&&(g=`${o.floating.width+u}px`,m=c?l:`${C}px`),{data:{x:g,y:m}}}}),"transformOrigin");function Pt(e){const[t,n="center"]=e.split("-");return[t,n]}_e(Pt,"getSideAndAlignFromPlacement");var Jo=$i,Sn=Hi,Et=Wi,Xi=zi,qi=Object.defineProperty,bn=(e,t)=>qi(e,"name",{value:t,configurable:!0}),Kt=!1;function er(){const[e,t]=i.useState(Kt);return i.useEffect(()=>{Kt||(Kt=!0,t(!0))},[]),e}bn(er,"useIsHydrated");var tr=Xe[" useSyncExternalStore ".trim().toString()];function nr(){return()=>{}}bn(nr,"subscribe");function or(){return tr(nr,()=>!0,()=>!1)}bn(or,"useIsHydratedModern");var Zi=typeof tr=="function"?or:er,Qi=Object.defineProperty,Ne=(e,t)=>Qi(e,"name",{value:t,configurable:!0}),Gt="rovingFocusGroup.onEntryFocus",Ji={bubbles:!1,cancelable:!0},Rt="RovingFocusGroup",[sn,rr,ec]=yt(Rt),[tc,sr]=fe(Rt,[ec]),[nc,oc]=tc(Rt),rc=i.forwardRef(Ne(function(t,n){return p.jsx(sn.Provider,{scope:t.__scopeRovingFocusGroup,children:p.jsx(sn.Slot,{scope:t.__scopeRovingFocusGroup,children:p.jsx(sc,{...t,ref:n})})})},"RovingFocusGroup")),sc=i.forwardRef(Ne(function(t,n){const{__scopeRovingFocusGroup:o,orientation:r,loop:s=!1,dir:c,currentTabStopId:a,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:v,preventScrollOnEntryFocus:l=!1,...f}=t,C=i.useRef(null),g=k(n,C),m=xn(c),[h,b]=Ae({prop:a,defaultProp:u??null,onChange:d,caller:Rt}),[S,x]=i.useState(!1),w=Ce(v),y=rr(o),P=i.useRef(!1),[T,O]=i.useState(0);return i.useEffect(()=>{const _=C.current;if(_)return _.addEventListener(Gt,w),()=>_.removeEventListener(Gt,w)},[w]),p.jsx(nc,{scope:o,orientation:r,dir:m,loop:s,currentTabStopId:h,onItemFocus:i.useCallback(_=>b(_),[b]),onItemShiftTab:i.useCallback(()=>x(!0),[]),onFocusableItemAdd:i.useCallback(()=>O(_=>_+1),[]),onFocusableItemRemove:i.useCallback(()=>O(_=>_-1),[]),children:p.jsx(N.div,{tabIndex:S||T===0?-1:0,"data-orientation":r,...f,ref:g,style:{outline:"none",...t.style},onMouseDown:E(t.onMouseDown,()=>{P.current=!0}),onFocus:E(t.onFocus,_=>{const F=!P.current;if(_.target===_.currentTarget&&F&&!S){const D=new CustomEvent(Gt,Ji);if(_.currentTarget.dispatchEvent(D),!D.defaultPrevented){const M=y().filter(A=>A.focusable),j=M.find(A=>A.active),B=M.find(A=>A.id===h),z=[j,B,...M].filter(Boolean).map(A=>A.ref.current);yn(z,l)}}P.current=!1}),onBlur:E(t.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),ic="RovingFocusGroupItem",cc=i.forwardRef(Ne(function(t,n){const{__scopeRovingFocusGroup:o,focusable:r=!0,active:s=!1,tabStopId:c,children:a,...u}=t,d=Te(),v=c||d,l=oc(ic,o),f=l.currentTabStopId===v,C=rr(o),{onFocusableItemAdd:g,onFocusableItemRemove:m,currentTabStopId:h}=l,b=Zi();return Z(()=>{if(!(!b||!r))return g(),()=>m()},[b,r,g,m]),i.useEffect(()=>{if(!(b||!r))return g(),()=>m()},[b,r,g,m]),p.jsx(sn.ItemSlot,{scope:o,id:v,focusable:r,active:s,children:p.jsx(N.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...u,ref:n,onMouseDown:E(t.onMouseDown,S=>{r?l.onItemFocus(v):S.preventDefault()}),onFocus:E(t.onFocus,()=>l.onItemFocus(v)),onKeyDown:E(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){l.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const x=cr(S,l.orientation,l.dir);if(x!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let y=C().filter(P=>P.focusable).map(P=>P.ref.current);if(x==="last")y.reverse();else if(x==="prev"||x==="next"){x==="prev"&&y.reverse();const P=y.indexOf(S.currentTarget);y=l.loop?ar(y,P+1):y.slice(P+1)}setTimeout(()=>yn(y))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:h!=null}):a})})},"RovingFocusGroupItem")),ac={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ir(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Ne(ir,"getDirectionAwareKey");function cr(e,t,n){const o=ir(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return ac[o]}Ne(cr,"getFocusIntent");function yn(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}Ne(yn,"focusFirst");function ar(e,t){return e.map((n,o)=>e[(t+o)%e.length])}Ne(ar,"wrapArray");var uc=rc,lc=cc,dc=Object.defineProperty,$=(e,t)=>dc(e,"name",{value:t,configurable:!0}),cn=["Enter"," "],fc=["ArrowDown","PageUp","Home"],ur=["ArrowUp","PageDown","End"],pc=[...fc,...ur],hc={ltr:[...cn,"ArrowRight"],rtl:[...cn,"ArrowLeft"]},vc={ltr:["ArrowLeft"],rtl:["ArrowRight"]},It="Menu",[Je,mc,gc]=yt(It),[je,lr]=fe(It,[gc,De,sr]),dr=De(),fr=sr(),[ku,Fe]=je(It),[Nu,ct]=je(It),Cc=i.forwardRef($(function(t,n){const{__scopeMenu:o,...r}=t,s=dr(o);return p.jsx(Sn,{...s,...r,ref:n})},"MenuAnchor")),pr="MenuPortal",[xc,hr]=je(pr,{forceMount:void 0}),wc=$(e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,s=Fe(pr,t);return p.jsx(xc,{scope:t,forceMount:n,children:p.jsx(pe,{present:n||s.open,children:p.jsx(st,{asChild:!0,container:r,children:o})})})},"MenuPortal"),me="MenuContent",[Sc,Pn]=je(me),bc=i.forwardRef($(function(t,n){const o=hr(me,t.__scopeMenu),{forceMount:r=o.forceMount,...s}=t,c=Fe(me,t.__scopeMenu),a=ct(me,t.__scopeMenu);return p.jsx(Je.Provider,{scope:t.__scopeMenu,children:p.jsx(pe,{present:r||c.open,children:p.jsx(Je.Slot,{scope:t.__scopeMenu,children:a.modal?p.jsx(yc,{...s,ref:n}):p.jsx(Pc,{...s,ref:n})})})})},"MenuContent")),yc=i.forwardRef($(function(t,n){const o=Fe(me,t.__scopeMenu),r=i.useRef(null),s=k(n,r);return i.useEffect(()=>{const c=r.current;if(c)return bt(c)},[]),p.jsx(En,{...t,ref:s,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:E(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),Pc=i.forwardRef($(function(t,n){const o=Fe(me,t.__scopeMenu);return p.jsx(En,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),Ec=ge("MenuContent.ScrollLock"),En=i.forwardRef($(function(t,n){const{__scopeMenu:o,loop:r=!1,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:v,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:C,onDismiss:g,disableOutsideScroll:m,...h}=t,b=Fe(me,o),S=ct(me,o),x=dr(o),w=fr(o),y=mc(o),[P,T]=i.useState(null),O=i.useRef(null),_=k(n,O,b.onContentChange),F=i.useRef(0),D=i.useRef(""),M=i.useRef(0),j=i.useRef(null),B=i.useRef("right"),G=i.useRef(0),z=m?it:i.Fragment,A=m?{as:Ec,allowPinchZoom:!0}:void 0,oe=$(R=>{const ee=D.current+R,U=y().filter(I=>!I.disabled),q=document.activeElement,ae=U.find(I=>I.ref.current===q)?.textValue,ue=U.map(I=>I.textValue),Ee=Sr(ue,ee,ae),ie=U.find(I=>I.textValue===Ee)?.ref.current;$((function I(H){D.current=H,window.clearTimeout(F.current),H!==""&&(F.current=window.setTimeout(()=>I(""),1e3))}),"updateSearch")(ee),ie&&setTimeout(()=>ie.focus())},"handleTypeaheadSearch");i.useEffect(()=>()=>window.clearTimeout(F.current),[]),Ze();const K=i.useCallback(R=>B.current===j.current?.side&&yr(R,j.current?.area),[]);return p.jsx(Sc,{scope:o,searchRef:D,onItemEnter:i.useCallback(R=>{K(R)&&R.preventDefault()},[K]),onItemLeave:i.useCallback(R=>{K(R)||(O.current?.focus(),T(null))},[K]),onTriggerLeave:i.useCallback(R=>{K(R)&&R.preventDefault()},[K]),pointerGraceTimerRef:M,onPointerGraceIntentChange:i.useCallback(R=>{j.current=R},[]),children:p.jsx(z,{...A,children:p.jsx(wt,{asChild:!0,trapped:s,onMountAutoFocus:E(c,R=>{R.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:p.jsx(rt,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:v,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:C,onDismiss:g,children:p.jsx(uc,{asChild:!0,...w,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:T,onEntryFocus:E(d,R=>{S.isUsingKeyboardRef.current||R.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(Et,{role:"menu","aria-orientation":"vertical","data-state":In(b.open),"data-radix-menu-content":"",dir:S.dir,...x,...h,ref:_,style:{outline:"none",...h.style},onKeyDown:E(h.onKeyDown,R=>{const U=R.target.closest("[data-radix-menu-content]")===R.currentTarget,q=R.ctrlKey||R.altKey||R.metaKey,ae=R.key.length===1;U&&(R.key==="Tab"&&R.preventDefault(),!q&&ae&&oe(R.key));const ue=O.current;if(R.target!==ue||!pc.includes(R.key))return;R.preventDefault();const ie=y().filter(I=>!I.disabled).map(I=>I.ref.current);ur.includes(R.key)&&ie.reverse(),xr(ie)}),onBlur:E(t.onBlur,R=>{R.currentTarget.contains(R.target)||(window.clearTimeout(F.current),D.current="")}),onPointerMove:E(t.onPointerMove,ze(R=>{const ee=R.target,U=G.current!==R.clientX;if(R.currentTarget.contains(ee)&&U){const q=R.clientX>G.current?"right":"left";B.current=q,G.current=R.clientX}}))})})})})})})},"MenuContentImpl")),Rc=i.forwardRef($(function(t,n){const{__scopeMenu:o,...r}=t;return p.jsx(N.div,{...r,ref:n})},"MenuLabel")),an="MenuItem",Jn="menu.itemSelect",Rn=i.forwardRef($(function(t,n){const{disabled:o=!1,onSelect:r,...s}=t,c=i.useRef(null),a=ct(an,t.__scopeMenu),u=Pn(an,t.__scopeMenu),d=k(n,c),v=i.useRef(!1),l=$(()=>{const f=c.current;if(!o&&f){const C=new CustomEvent(Jn,{bubbles:!0,cancelable:!0});f.addEventListener(Jn,g=>r?.(g),{once:!0}),fn(f,C),C.defaultPrevented?v.current=!1:a.onClose()}},"handleSelect");return p.jsx(vr,{...s,ref:d,disabled:o,onClick:E(t.onClick,l),onPointerDown:f=>{t.onPointerDown?.(f),v.current=!0},onPointerUp:E(t.onPointerUp,f=>{v.current||f.currentTarget?.click()}),onKeyDown:E(t.onKeyDown,f=>{o||f.target!==f.currentTarget||u.searchRef.current!==""&&f.key===" "||cn.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})},"MenuItem")),vr=i.forwardRef($(function(t,n){const{__scopeMenu:o,disabled:r=!1,textValue:s,...c}=t,a=Pn(an,o),u=fr(o),d=i.useRef(null),v=k(n,d),[l,f]=i.useState(!1),[C,g]=i.useState("");return i.useEffect(()=>{const m=d.current;m&&g((m.textContent??"").trim())},[c.children]),p.jsx(Je.ItemSlot,{scope:o,disabled:r,textValue:s??C,children:p.jsx(lc,{asChild:!0,...u,focusable:!r,children:p.jsx(N.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...c,ref:v,onPointerMove:E(t.onPointerMove,ze(m=>{r?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:E(t.onPointerLeave,ze(m=>a.onItemLeave(m))),onFocus:E(t.onFocus,()=>f(!0)),onBlur:E(t.onBlur,()=>f(!1))})})})},"MenuItemImpl")),Ic=i.forwardRef($(function(t,n){const{checked:o=!1,onCheckedChange:r,...s}=t;return p.jsx(gr,{scope:t.__scopeMenu,checked:o,children:p.jsx(Rn,{role:"menuitemcheckbox","aria-checked":et(o)?"mixed":o,...s,ref:n,"data-state":_t(o),onSelect:E(s.onSelect,()=>r?.(et(o)?!0:!o),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),_c="MenuRadioGroup",[ju,Mc]=je(_c,{value:void 0,onValueChange:$(()=>{},"onValueChange")}),Tc="MenuRadioItem",Oc=i.forwardRef($(function(t,n){const{value:o,...r}=t,s=Mc(Tc,t.__scopeMenu),c=o===s.value;return p.jsx(gr,{scope:t.__scopeMenu,checked:c,children:p.jsx(Rn,{role:"menuitemradio","aria-checked":c,...r,ref:n,"data-state":_t(c),onSelect:E(r.onSelect,()=>s.onValueChange?.(o),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),mr="MenuItemIndicator",[gr,Dc]=je(mr,{checked:!1}),Ac=i.forwardRef($(function(t,n){const{__scopeMenu:o,forceMount:r,...s}=t,c=Dc(mr,o);return p.jsx(pe,{present:r||et(c.checked)||c.checked===!0,children:p.jsx(N.span,{...s,ref:n,"data-state":_t(c.checked)})})},"MenuItemIndicator")),kc=i.forwardRef($(function(t,n){const{__scopeMenu:o,...r}=t;return p.jsx(N.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})},"MenuSeparator")),Nc="MenuSub",[Fu,Cr]=je(Nc),ht="MenuSubTrigger",jc=i.forwardRef($(function(t,n){const o=Fe(ht,t.__scopeMenu),r=ct(ht,t.__scopeMenu),s=Cr(ht,t.__scopeMenu),c=Pn(ht,t.__scopeMenu),a=i.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=c,v={__scopeMenu:t.__scopeMenu},l=i.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);i.useEffect(()=>l,[l]),i.useEffect(()=>{const C=u.current;return()=>{window.clearTimeout(C),d(null)}},[u,d]);const f=k(n,s.onTriggerChange);return p.jsx(Cc,{asChild:!0,...v,children:p.jsx(vr,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?s.contentId:void 0,"data-state":In(o.open),...t,ref:f,onClick:C=>{t.onClick?.(C),!(t.disabled||C.defaultPrevented)&&(C.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:E(t.onPointerMove,ze(C=>{c.onItemEnter(C),!C.defaultPrevented&&!t.disabled&&!o.open&&!a.current&&(c.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{o.onOpenChange(!0),l()},100))})),onPointerLeave:E(t.onPointerLeave,ze(C=>{l();const g=o.content?.getBoundingClientRect();if(g){const m=o.content?.dataset.side,h=m==="right",b=h?-5:5,S=g[h?"left":"right"],x=g[h?"right":"left"];c.onPointerGraceIntentChange({area:[{x:C.clientX+b,y:C.clientY},{x:S,y:g.top},{x,y:g.top},{x,y:g.bottom},{x:S,y:g.bottom}],side:m}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(C),C.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:E(t.onKeyDown,C=>{t.disabled||C.target!==C.currentTarget||c.searchRef.current!==""&&C.key===" "||hc[r.dir].includes(C.key)&&(o.onOpenChange(!0),o.content?.focus(),C.preventDefault())})})})},"MenuSubTrigger")),Fc="MenuSubContent",Lc=i.forwardRef($(function(t,n){const o=hr(me,t.__scopeMenu),{forceMount:r=o.forceMount,align:s="start",...c}=t,a=Fe(me,t.__scopeMenu),u=ct(me,t.__scopeMenu),d=Cr(Fc,t.__scopeMenu),v=i.useRef(null),l=k(n,v);return p.jsx(Je.Provider,{scope:t.__scopeMenu,children:p.jsx(pe,{present:r||a.open,children:p.jsx(Je.Slot,{scope:t.__scopeMenu,children:p.jsx(En,{id:d.contentId,"aria-labelledby":d.triggerId,...c,ref:l,align:s,side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{u.isUsingKeyboardRef.current&&v.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:E(t.onFocusOutside,f=>{f.target!==d.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:E(t.onEscapeKeyDown,f=>{u.onClose(),f.preventDefault()}),onKeyDown:E(t.onKeyDown,f=>{const C=f.currentTarget.contains(f.target),g=vc[u.dir].includes(f.key);C&&g&&(a.onOpenChange(!1),d.trigger?.focus(),f.preventDefault())})})})})})},"MenuSubContent"));function In(e){return e?"open":"closed"}$(In,"getOpenState");function et(e){return e==="indeterminate"}$(et,"isIndeterminate");function _t(e){return et(e)?"indeterminate":e?"checked":"unchecked"}$(_t,"getCheckedState");function xr(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}$(xr,"focusFirst");function wr(e,t){return e.map((n,o)=>e[(t+o)%e.length])}$(wr,"wrapArray");function Sr(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=wr(e,Math.max(s,0));r.length===1&&(c=c.filter(d=>d!==n));const u=c.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return u!==n?u:void 0}$(Sr,"getNextMatch");function br(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,c=t.length-1;so!=f>o&&n<(l-d)*(o-v)/(f-v)+d&&(r=!r)}return r}$(br,"isPointInPolygon");function yr(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return br(n,t)}$(yr,"isPointerInGraceArea");function ze(e){return t=>t.pointerType==="mouse"?e(t):void 0}$(ze,"whenMouse");var $c=wc,Bc=bc,Hc=Rc,Uc=Rn,Vc=Ic,Wc=Oc,Kc=Ac,Gc=kc,zc=jc,Yc=Lc,Xc=Object.defineProperty,be=(e,t)=>Xc(e,"name",{value:t,configurable:!0}),Pr="DropdownMenu",[qc,Lu]=fe(Pr,[lr]),ye=lr(),[$u,Zc]=qc(Pr),Qc=be(e=>{const{__scopeDropdownMenu:t,...n}=e,o=ye(t);return p.jsx($c,{...o,...n})},"DropdownMenuPortal"),Jc="DropdownMenuContent",ea=i.forwardRef(be(function(t,n){const{__scopeDropdownMenu:o,...r}=t,s=Zc(Jc,o),c=ye(o),a=i.useRef(!1);return p.jsx(Bc,{id:s.contentId,"aria-labelledby":s.triggerId,...c,...r,ref:n,onCloseAutoFocus:E(t.onCloseAutoFocus,u=>{a.current||s.triggerRef.current?.focus(),a.current=!1,u.preventDefault()}),onInteractOutside:E(t.onInteractOutside,u=>{const d=u.detail.originalEvent,v=d.button===0&&d.ctrlKey===!0,l=d.button===2||v;(!s.modal||l)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),ta=i.forwardRef(be(function(t,n){const{__scopeDropdownMenu:o,...r}=t,s=ye(o);return p.jsx(Hc,{...s,...r,ref:n})},"DropdownMenuLabel")),na=i.forwardRef(be(function(t,n){const{__scopeDropdownMenu:o,...r}=t,s=ye(o);return p.jsx(Uc,{...s,...r,ref:n})},"DropdownMenuItem")),oa=i.forwardRef(be(function(t,n){const{__scopeDropdownMenu:o,...r}=t,s=ye(o);return p.jsx(Vc,{...s,...r,ref:n})},"DropdownMenuCheckboxItem")),ra=i.forwardRef(be(function(t,n){const{__scopeDropdownMenu:o,...r}=t,s=ye(o);return p.jsx(Wc,{...s,...r,ref:n})},"DropdownMenuRadioItem")),sa=i.forwardRef(be(function(t,n){const{__scopeDropdownMenu:o,...r}=t,s=ye(o);return p.jsx(Kc,{...s,...r,ref:n})},"DropdownMenuItemIndicator")),ia=i.forwardRef(be(function(t,n){const{__scopeDropdownMenu:o,...r}=t,s=ye(o);return p.jsx(Gc,{...s,...r,ref:n})},"DropdownMenuSeparator")),ca=i.forwardRef(be(function(t,n){const{__scopeDropdownMenu:o,...r}=t,s=ye(o);return p.jsx(zc,{...s,...r,ref:n})},"DropdownMenuSubTrigger")),aa=i.forwardRef(be(function(t,n){const{__scopeDropdownMenu:o,...r}=t,s=ye(o);return p.jsx(Yc,{...s,...r,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent")),Bu=Qc,Hu=ea,Uu=ta,Vu=na,Wu=oa,Ku=ra,Gu=sa,zu=ia,Yu=ca,Xu=aa,ua=Object.defineProperty,Pe=(e,t)=>ua(e,"name",{value:t,configurable:!0}),_n="Popover",[Er,qu]=fe(_n,[De]),Mt=De(),[la,Le]=Er(_n),da=Pe(e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:c=!1}=e,a=Mt(t),u=i.useRef(null),[d,v]=i.useState(!1),[l,f]=Ae({prop:o,defaultProp:r??!1,onChange:s,caller:_n});return p.jsx(Jo,{...a,children:p.jsx(la,{scope:t,contentId:Te(),triggerRef:u,open:l,onOpenChange:f,onOpenToggle:i.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback(()=>v(!0),[]),onCustomAnchorRemove:i.useCallback(()=>v(!1),[]),modal:c,children:n})})},"Popover"),fa="PopoverTrigger",pa=i.forwardRef(Pe(function(t,n){const{__scopePopover:o,...r}=t,s=Le(fa,o),c=Mt(o),a=k(n,s.triggerRef),u=p.jsx(N.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Mn(s.open),...r,ref:a,onClick:E(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:p.jsx(Sn,{asChild:!0,...c,children:u})},"PopoverTrigger")),Rr="PopoverPortal",[ha,va]=Er(Rr,{forceMount:void 0}),ma=Pe(e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,s=Le(Rr,t);return p.jsx(ha,{scope:t,forceMount:n,children:p.jsx(pe,{present:n||s.open,children:p.jsx(st,{asChild:!0,container:r,children:o})})})},"PopoverPortal"),tt="PopoverContent",ga=i.forwardRef(Pe(function(t,n){const o=va(tt,t.__scopePopover),{forceMount:r=o.forceMount,...s}=t,c=Le(tt,t.__scopePopover);return p.jsx(pe,{present:r||c.open,children:c.modal?p.jsx(xa,{...s,ref:n}):p.jsx(wa,{...s,ref:n})})},"PopoverContent")),Ca=ge("PopoverContent.RemoveScroll"),xa=i.forwardRef(Pe(function(t,n){const o=Le(tt,t.__scopePopover),r=i.useRef(null),s=k(n,r),c=i.useRef(!1);return i.useEffect(()=>{const a=r.current;if(a)return bt(a)},[]),p.jsx(it,{as:Ca,allowPinchZoom:!0,children:p.jsx(Ir,{...t,ref:s,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(t.onCloseAutoFocus,a=>{a.preventDefault(),c.current||o.triggerRef.current?.focus()}),onPointerDownOutside:E(t.onPointerDownOutside,a=>{const u=a.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,v=u.button===2||d;c.current=v},{checkForDefaultPrevented:!1}),onFocusOutside:E(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),wa=i.forwardRef(Pe(function(t,n){const o=Le(tt,t.__scopePopover),r=i.useRef(!1),s=i.useRef(!1);return p.jsx(Ir,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{t.onCloseAutoFocus?.(c),c.defaultPrevented||(r.current||o.triggerRef.current?.focus(),c.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:c=>{t.onInteractOutside?.(c),c.defaultPrevented||(r.current=!0,c.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=c.target;o.triggerRef.current?.contains(a)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&s.current&&c.preventDefault()}})},"PopoverContentNonModal")),Ir=i.forwardRef(Pe(function(t,n){const{__scopePopover:o,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:v,onInteractOutside:l,...f}=t,C=Le(tt,o),g=Mt(o);return Ze(),p.jsx(wt,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:c,children:p.jsx(rt,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:v,onDismiss:()=>C.onOpenChange(!1),deferPointerDownOutside:!0,children:p.jsx(Et,{"data-state":Mn(C.open),role:"dialog",id:C.contentId,...g,...f,ref:n,style:{...f.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)"}})})})},"PopoverContentImpl")),Sa="PopoverClose",ba=i.forwardRef(Pe(function(t,n){const{__scopePopover:o,...r}=t,s=Le(Sa,o);return p.jsx(N.button,{type:"button",...r,ref:n,onClick:E(t.onClick,()=>s.onOpenChange(!1))})},"PopoverClose")),ya=i.forwardRef(Pe(function(t,n){const{__scopePopover:o,...r}=t,s=Mt(o);return p.jsx(Xi,{...s,...r,ref:n})},"PopoverArrow"));function Mn(e){return e?"open":"closed"}Pe(Mn,"getState");var Zu=da,Qu=pa,Ju=ma,el=ga,tl=ba,nl=ya,Pa=Object.defineProperty,Ea=(e,t)=>Pa(e,"name",{value:t,configurable:!0});function un(e,[t,n]){return Math.min(n,Math.max(t,e))}Ea(un,"clamp");var Ra=Object.defineProperty,Ia=(e,t)=>Ra(e,"name",{value:t,configurable:!0}),_a=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"}),Ma=i.forwardRef(Ia(function(t,n){return p.jsx(N.span,{...t,ref:n,style:{..._a,...t.style}})},"VisuallyHidden")),Ta=Ma,Oa=Object.defineProperty,L=(e,t)=>Oa(e,"name",{value:t,configurable:!0}),Da=[" ","Enter","ArrowUp","ArrowDown"],Aa=[" ","Enter"],Ye="Select",[Tt,Tn,ka]=yt(Ye),[$e,ol]=fe(Ye,[ka,De]),On=De(),[Na,Be]=$e(Ye),[ja,Fa]=$e(Ye);function La(e){const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:c,defaultValue:a,onValueChange:u,dir:d,name:v,autoComplete:l,disabled:f,required:C,form:g,internal_do_not_use_render:m}=e,h=On(t),[b,S]=i.useState(null),[x,w]=i.useState(null),[y,P]=i.useState(!1),T=xn(d),[O,_]=Ae({prop:o,defaultProp:r??!1,onChange:s,caller:Ye}),[F,D]=Ae({prop:c,defaultProp:a,onChange:u,caller:Ye}),M=i.useRef(null),j=i.useRef(F);i.useEffect(()=>{const U=g?b?.ownerDocument.getElementById(g):b?.form;if(U instanceof HTMLFormElement){const q=L(()=>D(j.current),"reset");return U.addEventListener("reset",q),()=>U.removeEventListener("reset",q)}},[g,b,D]);const B=b?!!g||!!b.closest("form"):!0,[G,z]=i.useState(new Set),A=Te(),oe=Array.from(G).map(U=>U.props.value).join(";"),K=i.useCallback(U=>{z(q=>new Set(q).add(U))},[]),R=i.useCallback(U=>{z(q=>{const ae=new Set(q);return ae.delete(U),ae})},[]),ee={required:C,trigger:b,onTriggerChange:S,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:y,onValueNodeHasChildrenChange:P,contentId:A,value:F,onValueChange:D,open:O,onOpenChange:_,dir:T,triggerPointerDownPosRef:M,disabled:f,name:v,autoComplete:l,form:g,nativeOptions:G,nativeSelectKey:oe,isFormControl:B};return p.jsx(Jo,{...h,children:p.jsx(Na,{scope:t,...ee,children:p.jsx(Tt.Provider,{scope:t,children:p.jsx(ja,{scope:t,onNativeOptionAdd:K,onNativeOptionRemove:R,children:Tr(m)?m(ee):n})})})})}L(La,"SelectProvider");var $a="SelectTrigger",rl=i.forwardRef(L(function(t,n){const{__scopeSelect:o,disabled:r=!1,...s}=t,c=On(o),a=Be($a,o),u=a.disabled||r,d=k(n,a.onTriggerChange),v=Tn(o),l=i.useRef("touch"),[f,C,g]=Dn(h=>{const b=v().filter(w=>!w.disabled),S=b.find(w=>w.value===a.value),x=An(b,h,S);x!==void 0&&a.onValueChange(x.value)}),m=L(h=>{u||(a.onOpenChange(!0),g()),h&&(a.triggerPointerDownPosRef.current={x:Math.round(h.pageX),y:Math.round(h.pageY)})},"handleOpen");return p.jsx(Sn,{asChild:!0,...c,children:p.jsx(N.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":Dt(a.value)?"":void 0,...s,ref:d,onClick:E(s.onClick,h=>{h.currentTarget.focus(),l.current!=="mouse"&&m(h)}),onPointerDown:E(s.onPointerDown,h=>{l.current=h.pointerType;const b=h.target;b.hasPointerCapture(h.pointerId)&&b.releasePointerCapture(h.pointerId),h.button===0&&h.ctrlKey===!1&&h.pointerType==="mouse"&&(m(h),h.preventDefault())}),onKeyDown:E(s.onKeyDown,h=>{const b=f.current!=="";!(h.ctrlKey||h.altKey||h.metaKey)&&h.key.length===1&&C(h.key),!(b&&h.key===" ")&&Da.includes(h.key)&&(m(),h.preventDefault())})})})},"SelectTrigger")),Ba="SelectValue",sl=i.forwardRef(L(function(t,n){const{__scopeSelect:o,className:r,style:s,children:c,placeholder:a="",...u}=t,d=Be(Ba,o),{onValueNodeHasChildrenChange:v}=d,l=c!==void 0,f=k(n,d.onValueNodeChange);Z(()=>{v(l)},[v,l]);const C=Dt(d.value);return p.jsx(N.span,{...u,asChild:C?!1:u.asChild,ref:f,style:{pointerEvents:"none"},children:p.jsx(i.Fragment,{children:C?a:c},C?"placeholder":"value")})},"SelectValue")),il=i.forwardRef(L(function(t,n){const{__scopeSelect:o,children:r,...s}=t;return p.jsx(N.span,{"aria-hidden":!0,...s,ref:n,children:r||"▼"})},"SelectIcon")),Ha="SelectPortal",[Ua,Va]=$e(Ha,{forceMount:void 0}),cl=L(e=>{const{__scopeSelect:t,forceMount:n,...o}=e;return p.jsx(Ua,{scope:e.__scopeSelect,forceMount:n,children:p.jsx(st,{asChild:!0,...o})})},"SelectPortal"),ke="SelectContent",al=i.forwardRef(L(function(t,n){const o=Va(ke,t.__scopeSelect),{forceMount:r=o.forceMount,...s}=t,c=Be(ke,t.__scopeSelect),[a,u]=i.useState();return Z(()=>{u(new DocumentFragment)},[]),p.jsx(pe,{present:r||c.open,children:({present:d})=>d?p.jsx(Ga,{...s,ref:n}):p.jsx(Wa,{...s,fragment:a})})},"SelectContent")),Wa=i.forwardRef(L(function(t,n){const{__scopeSelect:o,children:r,fragment:s}=t;return s?xt.createPortal(p.jsx(_r,{scope:o,children:p.jsx(Tt.Slot,{scope:o,children:p.jsx("div",{ref:n,children:r})})}),s):null},"SelectContentFragment")),ve=10,[_r,Ot]=$e(ke),Ka=ge("SelectContent.RemoveScroll"),Ga=i.forwardRef(L(function(t,n){const{__scopeSelect:o}=t,{position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:c,onPointerDownOutside:a,side:u,sideOffset:d,align:v,alignOffset:l,arrowPadding:f,collisionBoundary:C,collisionPadding:g,sticky:m,hideWhenDetached:h,avoidCollisions:b,...S}=t,x=Be(ke,o),[w,y]=i.useState(null),[P,T]=i.useState(null),O=k(n,y),[_,F]=i.useState(null),[D,M]=i.useState(null),j=Tn(o),[B,G]=i.useState(!1),z=i.useRef(!1);i.useEffect(()=>{if(w)return bt(w)},[w]),Ze();const A=i.useCallback(I=>{const[H,...te]=j().map(Y=>Y.ref.current),[V]=te.slice(-1),W=document.activeElement;for(const Y of I)if(Y===W||(Y?.scrollIntoView({block:"nearest"}),Y===H&&P&&(P.scrollTop=0),Y===V&&P&&(P.scrollTop=P.scrollHeight),Y?.focus(),document.activeElement!==W))return},[j,P]),oe=i.useCallback(()=>A([_,w]),[A,_,w]);i.useEffect(()=>{B&&oe()},[B,oe]);const{onOpenChange:K,triggerPointerDownPosRef:R}=x;i.useEffect(()=>{if(w){let I={x:0,y:0};const H=L(V=>{I={x:Math.abs(Math.round(V.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(V.pageY)-(R.current?.y??0))}},"handlePointerMove"),te=L(V=>{I.x<=10&&I.y<=10?V.preventDefault():V.composedPath().includes(w)||K(!1),document.removeEventListener("pointermove",H),R.current=null},"handlePointerUp");return R.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",te,{capture:!0})}}},[w,K,R]),i.useEffect(()=>{const I=L(()=>K(!1),"close");return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[K]);const[ee,U]=Dn(I=>{const H=j().filter(W=>!W.disabled),te=H.find(W=>W.ref.current===document.activeElement),V=An(H,I,te);V&&setTimeout(()=>V.ref.current?.focus())}),q=i.useCallback((I,H,te)=>{const V=!z.current&&!te;(x.value!==void 0&&x.value===H||V)&&(F(I),V&&(z.current=!0))},[x.value]),ae=i.useCallback(()=>w?.focus(),[w]),ue=i.useCallback((I,H,te)=>{const V=!z.current&&!te;(x.value!==void 0&&x.value===H||V)&&M(I)},[x.value]),Ee=r==="popper"?eo:za,ie=Ee===eo?{side:u,sideOffset:d,align:v,alignOffset:l,arrowPadding:f,collisionBoundary:C,collisionPadding:g,sticky:m,hideWhenDetached:h,avoidCollisions:b}:{};return p.jsx(_r,{scope:o,content:w,viewport:P,onViewportChange:T,itemRefCallback:q,selectedItem:_,onItemLeave:ae,itemTextRefCallback:ue,focusSelectedItem:oe,selectedItemText:D,position:r,isPositioned:B,searchRef:ee,children:p.jsx(it,{as:Ka,allowPinchZoom:!0,children:p.jsx(wt,{asChild:!0,trapped:x.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:E(s,I=>{x.trigger?.focus({preventScroll:!0}),I.preventDefault()}),children:p.jsx(rt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:a,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:p.jsx(Ee,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:I=>I.preventDefault(),...S,...ie,onPlaced:()=>G(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:E(S.onKeyDown,I=>{const H=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!H&&I.key.length===1&&U(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let V=j().filter(W=>!W.disabled).map(W=>W.ref.current);if(["ArrowUp","End"].includes(I.key)&&(V=V.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const W=I.target,Y=V.indexOf(W);V=V.slice(Y+1)}setTimeout(()=>A(V)),I.preventDefault()}})})})})})})},"SelectContentImpl")),za=i.forwardRef(L(function(t,n){const{__scopeSelect:o,onPlaced:r,...s}=t,c=Be(ke,o),a=Ot(ke,o),[u,d]=i.useState(null),[v,l]=i.useState(null),f=k(n,l),C=Tn(o),g=i.useRef(!1),m=i.useRef(!0),{viewport:h,selectedItem:b,selectedItemText:S,focusSelectedItem:x}=a,w=i.useCallback(()=>{if(c.trigger&&c.valueNode&&u&&v&&h&&b&&S){const O=c.trigger.getBoundingClientRect(),_=v.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),D=S.getBoundingClientRect();if(c.dir!=="rtl"){const W=D.left-_.left,Y=F.left-W,Re=O.left-Y,le=O.width+Re,kt=Math.max(le,_.width),Nt=window.innerWidth-ve,jt=un(Y,[ve,Math.max(ve,Nt-kt)]);u.style.minWidth=le+"px",u.style.left=jt+"px"}else{const W=_.right-D.right,Y=window.innerWidth-F.right-W,Re=window.innerWidth-O.right-Y,le=O.width+Re,kt=Math.max(le,_.width),Nt=window.innerWidth-ve,jt=un(Y,[ve,Math.max(ve,Nt-kt)]);u.style.minWidth=le+"px",u.style.right=jt+"px"}const M=C(),j=window.innerHeight-ve*2,B=h.scrollHeight,G=window.getComputedStyle(v),z=parseInt(G.borderTopWidth,10),A=parseInt(G.paddingTop,10),oe=parseInt(G.borderBottomWidth,10),K=parseInt(G.paddingBottom,10),R=z+A+B+K+oe,ee=Math.min(b.offsetHeight*5,R),U=window.getComputedStyle(h),q=parseInt(U.paddingTop,10),ae=parseInt(U.paddingBottom,10),ue=O.top+O.height/2-ve,Ee=j-ue,ie=b.offsetHeight/2,I=b.offsetTop+ie,H=z+A+I,te=R-H;if(H<=ue){const W=M.length>0&&b===M[M.length-1].ref.current;u.style.bottom="0px";const Y=v.clientHeight-h.offsetTop-h.offsetHeight,Re=Math.max(Ee,ie+(W?ae:0)+Y+oe),le=H+Re;u.style.height=le+"px"}else{const W=M.length>0&&b===M[0].ref.current;u.style.top="0px";const Re=Math.max(ue,z+h.offsetTop+(W?q:0)+ie)+te;u.style.height=Re+"px",h.scrollTop=H-ue+h.offsetTop}u.style.margin=`${ve}px 0`,u.style.minHeight=ee+"px",u.style.maxHeight=j+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[C,c.trigger,c.valueNode,u,v,h,b,S,c.dir,r]);Z(()=>w(),[w]);const[y,P]=i.useState();Z(()=>{v&&P(window.getComputedStyle(v).zIndex)},[v]);const T=i.useCallback(O=>{O&&m.current===!0&&(w(),x?.(),m.current=!1)},[w,x]);return p.jsx(Ya,{scope:o,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:T,children:p.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:y},children:p.jsx(N.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),eo=i.forwardRef(L(function(t,n){const{__scopeSelect:o,align:r="start",collisionPadding:s=ve,...c}=t,a=On(o);return p.jsx(Et,{...a,...c,ref:n,align:r,collisionPadding:s,style:{boxSizing:"border-box",...c.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)"}})},"SelectPopperPosition")),[Ya,Xa]=$e(ke,{}),to="SelectViewport",ul=i.forwardRef(L(function(t,n){const{__scopeSelect:o,nonce:r,...s}=t,c=Ot(to,o),a=Xa(to,o),u=k(n,c.onViewportChange),d=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:r}),p.jsx(Tt.Slot,{scope:o,children:p.jsx(N.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:E(s.onScroll,v=>{const l=v.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:C}=a;if(C?.current&&f){const g=Math.abs(d.current-l.scrollTop);if(g>0){const m=window.innerHeight-ve*2,h=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),S=Math.max(h,b);if(S0?y:0,f.style.justifyContent="flex-end")}}}d.current=l.scrollTop})})})]})},"SelectViewport")),qa="SelectGroup",[ll,Za]=$e(qa),Qa="SelectLabel",dl=i.forwardRef(L(function(t,n){const{__scopeSelect:o,...r}=t,s=Za(Qa,o);return p.jsx(N.div,{id:s.id,...r,ref:n})},"SelectLabel")),ln="SelectItem",[Ja,Mr]=$e(ln),fl=i.forwardRef(L(function(t,n){const{__scopeSelect:o,value:r,disabled:s=!1,textValue:c,...a}=t,u=Be(ln,o),d=Ot(ln,o),v=u.value===r,[l,f]=i.useState(c??""),[C,g]=i.useState(!1),m=Ce(w=>d.itemRefCallback?.(w,r,s)),h=k(n,m),b=Te(),S=i.useRef("touch"),x=L(()=>{s||(u.onValueChange(r),u.onOpenChange(!1))},"handleSelect");return p.jsx(Ja,{scope:o,value:r,disabled:s,textId:b,isSelected:v,onItemTextChange:i.useCallback(w=>{f(y=>y||(w?.textContent??"").trim())},[]),children:p.jsx(Tt.ItemSlot,{scope:o,value:r,disabled:s,textValue:l,children:p.jsx(N.div,{role:"option","aria-labelledby":b,"data-highlighted":C?"":void 0,"aria-selected":v&&C,"data-state":v?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:h,onFocus:E(a.onFocus,()=>g(!0)),onBlur:E(a.onBlur,()=>g(!1)),onClick:E(a.onClick,()=>{S.current!=="mouse"&&x()}),onPointerUp:E(a.onPointerUp,()=>{S.current==="mouse"&&x()}),onPointerDown:E(a.onPointerDown,w=>{S.current=w.pointerType}),onPointerMove:E(a.onPointerMove,w=>{S.current=w.pointerType,s?d.onItemLeave?.():S.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(a.onPointerLeave,w=>{w.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:E(a.onKeyDown,w=>{s||w.target!==w.currentTarget||d.searchRef?.current!==""&&w.key===" "||(Aa.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})},"SelectItem")),vt="SelectItemText",pl=i.forwardRef(L(function(t,n){const{__scopeSelect:o,className:r,style:s,...c}=t,a=Be(vt,o),u=Ot(vt,o),d=Mr(vt,o),v=Fa(vt,o),[l,f]=i.useState(null),C=Ce(x=>u.itemTextRefCallback?.(x,d.value,d.disabled)),g=k(n,f,d.onItemTextChange,C),m=l?.textContent,h=i.useMemo(()=>p.jsx("option",{value:d.value,disabled:d.disabled,children:m},d.value),[d.disabled,d.value,m]),{onNativeOptionAdd:b,onNativeOptionRemove:S}=v;return Z(()=>(b(h),()=>S(h)),[b,S,h]),p.jsxs(p.Fragment,{children:[p.jsx(N.span,{id:d.textId,...c,ref:g}),d.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!Dt(a.value)?xt.createPortal(c.children,a.valueNode):null]})},"SelectItemText")),eu="SelectItemIndicator",hl=i.forwardRef(L(function(t,n){const{__scopeSelect:o,...r}=t;return Mr(eu,o).isSelected?p.jsx(N.span,{"aria-hidden":!0,...r,ref:n}):null},"SelectItemIndicator")),vl=i.forwardRef(L(function(t,n){const{__scopeSelect:o,...r}=t;return p.jsx(N.div,{"aria-hidden":!0,...r,ref:n})},"SelectSeparator"));function Tr(e){return typeof e=="function"}L(Tr,"isFunction");function Dt(e){return e===""||e===void 0}L(Dt,"shouldShowPlaceholder");function Dn(e){const t=Ce(e),n=i.useRef(""),o=i.useRef(0),r=i.useCallback(c=>{const a=n.current+c;t(a),L((function u(d){n.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>u(""),1e3))}),"updateSearch")(a)},[t]),s=i.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}L(Dn,"useTypeaheadSearch");function An(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=Or(e,Math.max(s,0));r.length===1&&(c=c.filter(d=>d!==n));const u=c.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return u!==n?u:void 0}L(An,"findNextItem");function Or(e,t){return e.map((n,o)=>e[(t+o)%e.length])}L(Or,"wrapArray");var tu=Object.defineProperty,Oe=(e,t)=>tu(e,"name",{value:t,configurable:!0}),kn="Switch",[nu,ml]=fe(kn),[ou,Nn]=nu(kn);function Dr(e){const{__scopeSwitch:t,checked:n,children:o,defaultChecked:r,disabled:s,form:c,name:a,onCheckedChange:u,required:d,value:v="on",internal_do_not_use_render:l}=e,[f,C]=Ae({prop:n,defaultProp:r??!1,onChange:u,caller:kn}),[g,m]=i.useState(null),[h,b]=i.useState(null),S=i.useRef(!1),[x,w]=i.useReducer(T=>T+1,0),y=g?!!c||!!g.closest("form"):!0,P={checked:f,setChecked:C,disabled:s,control:g,setControl:m,name:a,form:c,value:v,hasConsumerStoppedPropagationRef:S,userInteractionCount:x,onUserInteraction:w,required:d,defaultChecked:r,isFormControl:y,bubbleInput:h,setBubbleInput:b};return p.jsx(ou,{scope:t,...P,children:Ar(l)?l(P):o})}Oe(Dr,"SwitchProvider");var ru="SwitchTrigger",su=i.forwardRef(Oe(function({__scopeSwitch:t,onClick:n,...o},r){const{control:s,form:c,value:a,disabled:u,checked:d,required:v,setControl:l,setChecked:f,hasConsumerStoppedPropagationRef:C,onUserInteraction:g,isFormControl:m,bubbleInput:h}=Nn(ru,t),b=k(r,l),S=i.useRef(d);return i.useEffect(()=>{const x=c?s?.ownerDocument.getElementById(c):s?.form;if(x instanceof HTMLFormElement){const w=Oe(()=>f(S.current),"reset");return x.addEventListener("reset",w),()=>x.removeEventListener("reset",w)}},[s,c,f]),p.jsx(N.button,{type:"button",role:"switch","aria-checked":d,"aria-required":v,"data-state":jn(d),"data-disabled":u?"":void 0,disabled:u,value:a,...o,ref:b,onClick:E(n,x=>{g(),f(w=>!w),h&&m&&(C.current=x.isPropagationStopped(),C.current||x.stopPropagation())})})},"SwitchTrigger")),gl=i.forwardRef(Oe(function(t,n){const{__scopeSwitch:o,name:r,checked:s,defaultChecked:c,required:a,disabled:u,value:d,onCheckedChange:v,form:l,...f}=t;return p.jsx(Dr,{__scopeSwitch:o,checked:s,defaultChecked:c,disabled:u,required:a,onCheckedChange:v,name:r,form:l,value:d,internal_do_not_use_render:({isFormControl:C})=>p.jsxs(p.Fragment,{children:[p.jsx(su,{...f,ref:n,__scopeSwitch:o}),C&&p.jsx(au,{__scopeSwitch:o})]})})},"Switch")),iu="SwitchThumb",Cl=i.forwardRef(Oe(function(t,n){const{__scopeSwitch:o,...r}=t,s=Nn(iu,o);return p.jsx(N.span,{"data-state":jn(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})},"SwitchThumb")),cu="SwitchBubbleInput",au=i.forwardRef(Oe(function({__scopeSwitch:t,onClick:n,...o},r){const{control:s,hasConsumerStoppedPropagationRef:c,userInteractionCount:a,checked:u,defaultChecked:d,required:v,disabled:l,name:f,value:C,form:g,bubbleInput:m,setBubbleInput:h}=Nn(cu,t),b=k(r,h),S=wn(s),x=i.useRef(!1),w=i.useRef(u),y=i.useRef(a);i.useEffect(()=>{const T=m;if(!T)return;const O=window.HTMLInputElement.prototype,F=Object.getOwnPropertyDescriptor(O,"checked").set,D=a!==y.current;y.current=a;const M=w.current!==u;w.current=u;const j=!(D&&c.current);if(M&&F){x.current=!D;const B=new Event("click",{bubbles:j});F.call(T,u),T.dispatchEvent(B),x.current=!1}},[m,u,c,a]);const P=i.useRef(u);return p.jsx(N.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??P.current,required:v,disabled:l,name:f,value:C,form:g,...o,tabIndex:-1,ref:b,onClick:E(n,T=>{x.current&&T.stopPropagation()}),style:{...o.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Ar(e){return typeof e=="function"}Oe(Ar,"isFunction");function jn(e){return e?"checked":"unchecked"}Oe(jn,"getState");var uu=Object.defineProperty,se=(e,t)=>uu(e,"name",{value:t,configurable:!0}),[Fn,xl]=fe("Tooltip",[De]),lu=De(),du="TooltipProvider",fu=700,no="tooltip.open",[pu,hu]=Fn(du),vu=se(e=>{const{__scopeTooltip:t,delayDuration:n=fu,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,c=i.useRef(!0),a=i.useRef(!1),u=i.useRef(0);return i.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),p.jsx(pu,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:i.useCallback(()=>{o<=0||(window.clearTimeout(u.current),c.current=!1)},[o]),onClose:i.useCallback(()=>{o<=0||(window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,o))},[o]),isPointerInTransitRef:a,onPointerInTransitChange:i.useCallback(d=>{a.current=d},[]),disableHoverableContent:r,children:s})},"TooltipProvider"),mu="Tooltip",[wl,At]=Fn(mu),kr="TooltipPortal",[gu,Cu]=Fn(kr,{forceMount:void 0}),xu=se(e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=At(kr,t);return p.jsx(gu,{scope:t,forceMount:n,children:p.jsx(pe,{present:n||s.open,children:p.jsx(st,{asChild:!0,container:r,children:o})})})},"TooltipPortal"),nt="TooltipContent",wu=i.forwardRef(se(function(t,n){const o=Cu(nt,t.__scopeTooltip),{forceMount:r=o.forceMount,side:s="top",...c}=t,a=At(nt,t.__scopeTooltip);return p.jsx(pe,{present:r||a.open,children:a.disableHoverableContent?p.jsx(Nr,{side:s,...c,ref:n}):p.jsx(Su,{side:s,...c,ref:n})})},"TooltipContent")),Su=i.forwardRef(se(function(t,n){const o=At(nt,t.__scopeTooltip),r=hu(nt,t.__scopeTooltip),s=i.useRef(null),c=k(n,s),[a,u]=i.useState(null),{trigger:d,onClose:v}=o,l=s.current,{onPointerInTransitChange:f}=r,C=i.useCallback(()=>{u(null),f(!1)},[f]),g=i.useCallback((m,h)=>{const b=m.currentTarget,S={x:m.clientX,y:m.clientY},x=jr(S,b.getBoundingClientRect()),w=Fr(S,x),y=Lr(h.getBoundingClientRect()),P=Br([...w,...y]);u(P),f(!0)},[f]);return i.useEffect(()=>()=>C(),[C]),i.useEffect(()=>{if(d&&l){const m=se(b=>g(b,l),"handleTriggerLeave"),h=se(b=>g(b,d),"handleContentLeave");return d.addEventListener("pointerleave",m),l.addEventListener("pointerleave",h),()=>{d.removeEventListener("pointerleave",m),l.removeEventListener("pointerleave",h)}}},[d,l,g,C]),i.useEffect(()=>{if(a){const m=se(h=>{const b=h.target,S={x:h.clientX,y:h.clientY},x=d?.contains(b)||l?.contains(b),w=!$r(S,a);x?C():w&&(C(),v())},"handleTrackPointerGrace");return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[d,l,a,v,C]),p.jsx(Nr,{...t,ref:c})},"TooltipContentHoverable")),bu=so("TooltipContent"),Nr=i.forwardRef(se(function(t,n){const{__scopeTooltip:o,children:r,"aria-label":s,id:c,onEscapeKeyDown:a,onPointerDownOutside:u,...d}=t,v=At(nt,o),l=lu(o),{onClose:f}=v;i.useEffect(()=>(document.addEventListener(no,f),()=>document.removeEventListener(no,f)),[f]),i.useEffect(()=>{if(v.trigger){const g=se(m=>{m.target instanceof Node&&m.target.contains(v.trigger)&&f()},"handleScroll");return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[v.trigger,f]);const{setContentId:C}=v;return Z(()=>(C(c),()=>{C(void 0)}),[c,C]),p.jsx(rt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:u,onFocusOutside:g=>g.preventDefault(),onDismiss:f,children:p.jsxs(Et,{"data-state":v.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:v.contentId,...l,...d,ref:n,style:{...d.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(bu,{children:r}),s?p.jsx(Ta,{id:v.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function jr(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")}}se(jr,"getExitSideFromRect");function Fr(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}se(Fr,"getPaddedExitPoints");function Lr(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}]}se(Lr,"getPointsFromRect");function $r(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,c=t.length-1;so!=f>o&&n<(l-d)*(o-v)/(f-v)+d&&(r=!r)}return r}se($r,"isPointInPolygon");function Br(e){const t=e.slice();return t.sort((n,o)=>n.xo.x?1:n.yo.y?1:0),Hr(t)}se(Br,"getHull");function Hr(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(r.y-c.y)>=(s.y-c.y)*(r.x-c.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],c=n[n.length-2];if((s.x-c.x)*(r.y-c.y)>=(s.y-c.y)*(r.x-c.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)}se(Hr,"getHullPresorted");var Sl=vu,bl=xu,yl=wu;export{nl as A,dl as B,Hu as C,Iu as D,vl as E,gl as F,Cl as G,bl as H,Vu as I,yl as J,Sl as K,Uu as L,Zu as M,N as P,Ku as R,Eu as S,Qu as T,_u as a,Mu as b,Tu as c,oo as d,Au as e,Ou as f,Du as g,Yu as h,Xu as i,Bu as j,Wu as k,Gu as l,zu as m,Ju as n,el as o,tl as p,rl as q,sl as r,il as s,cl as t,Te as u,al as v,ul as w,fl as x,pl as y,hl as z};