import{r as a,j as r,u as Fn}from"./app-C7YxHmQz.js";import{c as ge,u as pe,P as j,b as g,a as Ne,j as he,d as ae,e as Ln,h as Gn,k as Kn,f as $n,R as Un,F as Bn,D as zn}from"./index-CCZex4bU.js";import{u as U,a as Vn,c as Pe}from"./index-Cp62Blk_.js";import{c as Te,u as je}from"./index-Djfxw5dv.js";import{c as Ae,R as Yn,A as Xn,C as Hn,a as Wn,b as Zn}from"./index-BvfrUVYs.js";import{c as A}from"./utils-DjqsqOe8.js";import{C as qn}from"./chevron-right-DHVrRgbL.js";import{c as we}from"./createLucideIcon-CBwNTxoJ.js";import{B as Jn}from"./button-CJ9RiI_R.js";/**
 * @license lucide-react v0.484.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qn=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],et=we("circle",Qn);/**
 * @license lucide-react v0.484.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nt=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],tt=we("moon",nt);/**
 * @license lucide-react v0.484.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ot=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],rt=we("sun",ot);var fe="rovingFocusGroup.onEntryFocus",at={bubbles:!1,cancelable:!0},Z="RovingFocusGroup",[me,ke,st]=Te(Z),[ct,Oe]=ge(Z,[st]),[it,ut]=ct(Z),Fe=a.forwardRef((e,t)=>r.jsx(me.Provider,{scope:e.__scopeRovingFocusGroup,children:r.jsx(me.Slot,{scope:e.__scopeRovingFocusGroup,children:r.jsx(dt,{...e,ref:t})})}));Fe.displayName=Z;var dt=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:s=!1,dir:c,currentTabStopId:d,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:m,onEntryFocus:v,preventScrollOnEntryFocus:u=!1,...i}=e,f=a.useRef(null),w=U(t,f),h=je(c),[b,x]=Ne({prop:d,defaultProp:l??null,onChange:m,caller:Z}),[R,P]=a.useState(!1),M=he(v),E=ke(n),B=a.useRef(!1),[Q,k]=a.useState(0);return a.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(fe,M),()=>_.removeEventListener(fe,M)},[M]),r.jsx(it,{scope:n,orientation:o,dir:h,loop:s,currentTabStopId:b,onItemFocus:a.useCallback(_=>x(_),[x]),onItemShiftTab:a.useCallback(()=>P(!0),[]),onFocusableItemAdd:a.useCallback(()=>k(_=>_+1),[]),onFocusableItemRemove:a.useCallback(()=>k(_=>_-1),[]),children:r.jsx(j.div,{tabIndex:R||Q===0?-1:0,"data-orientation":o,...i,ref:w,style:{outline:"none",...e.style},onMouseDown:g(e.onMouseDown,()=>{B.current=!0}),onFocus:g(e.onFocus,_=>{const G=!B.current;if(_.target===_.currentTarget&&G&&!R){const O=new CustomEvent(fe,at);if(_.currentTarget.dispatchEvent(O),!O.defaultPrevented){const z=E().filter(D=>D.focusable),V=z.find(D=>D.active),ee=z.find(D=>D.id===b),ue=[V,ee,...z].filter(Boolean).map(D=>D.ref.current);Ke(ue,u)}}B.current=!1}),onBlur:g(e.onBlur,()=>P(!1))})})}),Le="RovingFocusGroupItem",Ge=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:s=!1,tabStopId:c,children:d,...l}=e,m=pe(),v=c||m,u=ut(Le,n),i=u.currentTabStopId===v,f=ke(n),{onFocusableItemAdd:w,onFocusableItemRemove:h,currentTabStopId:b}=u;return a.useEffect(()=>{if(o)return w(),()=>h()},[o,w,h]),r.jsx(me.ItemSlot,{scope:n,id:v,focusable:o,active:s,children:r.jsx(j.span,{tabIndex:i?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:g(e.onMouseDown,x=>{o?u.onItemFocus(v):x.preventDefault()}),onFocus:g(e.onFocus,()=>u.onItemFocus(v)),onKeyDown:g(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){u.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const R=pt(x,u.orientation,u.dir);if(R!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let M=f().filter(E=>E.focusable).map(E=>E.ref.current);if(R==="last")M.reverse();else if(R==="prev"||R==="next"){R==="prev"&&M.reverse();const E=M.indexOf(x.currentTarget);M=u.loop?mt(M,E+1):M.slice(E+1)}setTimeout(()=>Ke(M))}}),children:typeof d=="function"?d({isCurrentTabStop:i,hasTabStop:b!=null}):d})})});Ge.displayName=Le;var lt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ft(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function pt(e,t,n){const o=ft(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return lt[o]}function Ke(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function mt(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var vt=Fe,gt=Ge,ve=["Enter"," "],ht=["ArrowDown","PageUp","Home"],$e=["ArrowUp","PageDown","End"],wt=[...ht,...$e],xt={ltr:[...ve,"ArrowRight"],rtl:[...ve,"ArrowLeft"]},Mt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},q="Menu",[H,_t,Ct]=Te(q),[F,Ue]=ge(q,[Ct,Ae,Oe]),se=Ae(),Be=Oe(),[Rt,L]=F(q),[bt,J]=F(q),ze=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:s,onOpenChange:c,modal:d=!0}=e,l=se(t),[m,v]=a.useState(null),u=a.useRef(!1),i=he(c),f=je(s);return a.useEffect(()=>{const w=()=>{u.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},h=()=>u.current=!1;return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),r.jsx(Yn,{...l,children:r.jsx(Rt,{scope:t,open:n,onOpenChange:i,content:m,onContentChange:v,children:r.jsx(bt,{scope:t,onClose:a.useCallback(()=>i(!1),[i]),isUsingKeyboardRef:u,dir:f,modal:d,children:o})})})};ze.displayName=q;var yt="MenuAnchor",xe=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,s=se(n);return r.jsx(Xn,{...s,...o,ref:t})});xe.displayName=yt;var Me="MenuPortal",[It,Ve]=F(Me,{forceMount:void 0}),Ye=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:s}=e,c=L(Me,t);return r.jsx(It,{scope:t,forceMount:n,children:r.jsx(ae,{present:n||c.open,children:r.jsx(Ln,{asChild:!0,container:s,children:o})})})};Ye.displayName=Me;var I="MenuContent",[Et,_e]=F(I),Xe=a.forwardRef((e,t)=>{const n=Ve(I,e.__scopeMenu),{forceMount:o=n.forceMount,...s}=e,c=L(I,e.__scopeMenu),d=J(I,e.__scopeMenu);return r.jsx(H.Provider,{scope:e.__scopeMenu,children:r.jsx(ae,{present:o||c.open,children:r.jsx(H.Slot,{scope:e.__scopeMenu,children:d.modal?r.jsx(St,{...s,ref:t}):r.jsx(Dt,{...s,ref:t})})})})}),St=a.forwardRef((e,t)=>{const n=L(I,e.__scopeMenu),o=a.useRef(null),s=U(t,o);return a.useEffect(()=>{const c=o.current;if(c)return Gn(c)},[]),r.jsx(Ce,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:g(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Dt=a.forwardRef((e,t)=>{const n=L(I,e.__scopeMenu);return r.jsx(Ce,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Nt=Vn("MenuContent.ScrollLock"),Ce=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:s,onOpenAutoFocus:c,onCloseAutoFocus:d,disableOutsidePointerEvents:l,onEntryFocus:m,onEscapeKeyDown:v,onPointerDownOutside:u,onFocusOutside:i,onInteractOutside:f,onDismiss:w,disableOutsideScroll:h,...b}=e,x=L(I,n),R=J(I,n),P=se(n),M=Be(n),E=_t(n),[B,Q]=a.useState(null),k=a.useRef(null),_=U(t,k,x.onContentChange),G=a.useRef(0),O=a.useRef(""),z=a.useRef(0),V=a.useRef(null),ee=a.useRef("right"),ne=a.useRef(0),ue=h?Un:a.Fragment,D=h?{as:Nt,allowPinchZoom:!0}:void 0,On=p=>{var $,Ee;const y=O.current+p,S=E().filter(N=>!N.disabled),T=document.activeElement,de=($=S.find(N=>N.ref.current===T))==null?void 0:$.textValue,le=S.map(N=>N.textValue),Ie=Ut(le,y,de),Y=(Ee=S.find(N=>N.textValue===Ie))==null?void 0:Ee.ref.current;(function N(Se){O.current=Se,window.clearTimeout(G.current),Se!==""&&(G.current=window.setTimeout(()=>N(""),1e3))})(y),Y&&setTimeout(()=>Y.focus())};a.useEffect(()=>()=>window.clearTimeout(G.current),[]),$n();const K=a.useCallback(p=>{var S,T;return ee.current===((S=V.current)==null?void 0:S.side)&&zt(p,(T=V.current)==null?void 0:T.area)},[]);return r.jsx(Et,{scope:n,searchRef:O,onItemEnter:a.useCallback(p=>{K(p)&&p.preventDefault()},[K]),onItemLeave:a.useCallback(p=>{var y;K(p)||((y=k.current)==null||y.focus(),Q(null))},[K]),onTriggerLeave:a.useCallback(p=>{K(p)&&p.preventDefault()},[K]),pointerGraceTimerRef:z,onPointerGraceIntentChange:a.useCallback(p=>{V.current=p},[]),children:r.jsx(ue,{...D,children:r.jsx(Bn,{asChild:!0,trapped:s,onMountAutoFocus:g(c,p=>{var y;p.preventDefault(),(y=k.current)==null||y.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:r.jsx(zn,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:v,onPointerDownOutside:u,onFocusOutside:i,onInteractOutside:f,onDismiss:w,children:r.jsx(vt,{asChild:!0,...M,dir:R.dir,orientation:"vertical",loop:o,currentTabStopId:B,onCurrentTabStopIdChange:Q,onEntryFocus:g(m,p=>{R.isUsingKeyboardRef.current||p.preventDefault()}),preventScrollOnEntryFocus:!0,children:r.jsx(Hn,{role:"menu","aria-orientation":"vertical","data-state":dn(x.open),"data-radix-menu-content":"",dir:R.dir,...P,...b,ref:_,style:{outline:"none",...b.style},onKeyDown:g(b.onKeyDown,p=>{const S=p.target.closest("[data-radix-menu-content]")===p.currentTarget,T=p.ctrlKey||p.altKey||p.metaKey,de=p.key.length===1;S&&(p.key==="Tab"&&p.preventDefault(),!T&&de&&On(p.key));const le=k.current;if(p.target!==le||!wt.includes(p.key))return;p.preventDefault();const Y=E().filter($=>!$.disabled).map($=>$.ref.current);$e.includes(p.key)&&Y.reverse(),Kt(Y)}),onBlur:g(e.onBlur,p=>{p.currentTarget.contains(p.target)||(window.clearTimeout(G.current),O.current="")}),onPointerMove:g(e.onPointerMove,W(p=>{const y=p.target,S=ne.current!==p.clientX;if(p.currentTarget.contains(y)&&S){const T=p.clientX>ne.current?"right":"left";ee.current=T,ne.current=p.clientX}}))})})})})})})});Xe.displayName=I;var Pt="MenuGroup",Re=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return r.jsx(j.div,{role:"group",...o,ref:t})});Re.displayName=Pt;var Tt="MenuLabel",He=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return r.jsx(j.div,{...o,ref:t})});He.displayName=Tt;var oe="MenuItem",De="menu.itemSelect",ce=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...s}=e,c=a.useRef(null),d=J(oe,e.__scopeMenu),l=_e(oe,e.__scopeMenu),m=U(t,c),v=a.useRef(!1),u=()=>{const i=c.current;if(!n&&i){const f=new CustomEvent(De,{bubbles:!0,cancelable:!0});i.addEventListener(De,w=>o==null?void 0:o(w),{once:!0}),Kn(i,f),f.defaultPrevented?v.current=!1:d.onClose()}};return r.jsx(We,{...s,ref:m,disabled:n,onClick:g(e.onClick,u),onPointerDown:i=>{var f;(f=e.onPointerDown)==null||f.call(e,i),v.current=!0},onPointerUp:g(e.onPointerUp,i=>{var f;v.current||(f=i.currentTarget)==null||f.click()}),onKeyDown:g(e.onKeyDown,i=>{const f=l.searchRef.current!=="";n||f&&i.key===" "||ve.includes(i.key)&&(i.currentTarget.click(),i.preventDefault())})})});ce.displayName=oe;var We=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:s,...c}=e,d=_e(oe,n),l=Be(n),m=a.useRef(null),v=U(t,m),[u,i]=a.useState(!1),[f,w]=a.useState("");return a.useEffect(()=>{const h=m.current;h&&w((h.textContent??"").trim())},[c.children]),r.jsx(H.ItemSlot,{scope:n,disabled:o,textValue:s??f,children:r.jsx(gt,{asChild:!0,...l,focusable:!o,children:r.jsx(j.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...c,ref:v,onPointerMove:g(e.onPointerMove,W(h=>{o?d.onItemLeave(h):(d.onItemEnter(h),h.defaultPrevented||h.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:g(e.onPointerLeave,W(h=>d.onItemLeave(h))),onFocus:g(e.onFocus,()=>i(!0)),onBlur:g(e.onBlur,()=>i(!1))})})})}),jt="MenuCheckboxItem",Ze=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...s}=e;return r.jsx(nn,{scope:e.__scopeMenu,checked:n,children:r.jsx(ce,{role:"menuitemcheckbox","aria-checked":re(n)?"mixed":n,...s,ref:t,"data-state":ye(n),onSelect:g(s.onSelect,()=>o==null?void 0:o(re(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ze.displayName=jt;var qe="MenuRadioGroup",[At,kt]=F(qe,{value:void 0,onValueChange:()=>{}}),Je=a.forwardRef((e,t)=>{const{value:n,onValueChange:o,...s}=e,c=he(o);return r.jsx(At,{scope:e.__scopeMenu,value:n,onValueChange:c,children:r.jsx(Re,{...s,ref:t})})});Je.displayName=qe;var Qe="MenuRadioItem",en=a.forwardRef((e,t)=>{const{value:n,...o}=e,s=kt(Qe,e.__scopeMenu),c=n===s.value;return r.jsx(nn,{scope:e.__scopeMenu,checked:c,children:r.jsx(ce,{role:"menuitemradio","aria-checked":c,...o,ref:t,"data-state":ye(c),onSelect:g(o.onSelect,()=>{var d;return(d=s.onValueChange)==null?void 0:d.call(s,n)},{checkForDefaultPrevented:!1})})})});en.displayName=Qe;var be="MenuItemIndicator",[nn,Ot]=F(be,{checked:!1}),tn=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...s}=e,c=Ot(be,n);return r.jsx(ae,{present:o||re(c.checked)||c.checked===!0,children:r.jsx(j.span,{...s,ref:t,"data-state":ye(c.checked)})})});tn.displayName=be;var Ft="MenuSeparator",on=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return r.jsx(j.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});on.displayName=Ft;var Lt="MenuArrow",rn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,s=se(n);return r.jsx(Wn,{...s,...o,ref:t})});rn.displayName=Lt;var Gt="MenuSub",[zo,an]=F(Gt),X="MenuSubTrigger",sn=a.forwardRef((e,t)=>{const n=L(X,e.__scopeMenu),o=J(X,e.__scopeMenu),s=an(X,e.__scopeMenu),c=_e(X,e.__scopeMenu),d=a.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:m}=c,v={__scopeMenu:e.__scopeMenu},u=a.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return a.useEffect(()=>u,[u]),a.useEffect(()=>{const i=l.current;return()=>{window.clearTimeout(i),m(null)}},[l,m]),r.jsx(xe,{asChild:!0,...v,children:r.jsx(We,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":dn(n.open),...e,ref:Pe(t,s.onTriggerChange),onClick:i=>{var f;(f=e.onClick)==null||f.call(e,i),!(e.disabled||i.defaultPrevented)&&(i.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:g(e.onPointerMove,W(i=>{c.onItemEnter(i),!i.defaultPrevented&&!e.disabled&&!n.open&&!d.current&&(c.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:g(e.onPointerLeave,W(i=>{var w,h;u();const f=(w=n.content)==null?void 0:w.getBoundingClientRect();if(f){const b=(h=n.content)==null?void 0:h.dataset.side,x=b==="right",R=x?-5:5,P=f[x?"left":"right"],M=f[x?"right":"left"];c.onPointerGraceIntentChange({area:[{x:i.clientX+R,y:i.clientY},{x:P,y:f.top},{x:M,y:f.top},{x:M,y:f.bottom},{x:P,y:f.bottom}],side:b}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(i),i.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:g(e.onKeyDown,i=>{var w;const f=c.searchRef.current!=="";e.disabled||f&&i.key===" "||xt[o.dir].includes(i.key)&&(n.onOpenChange(!0),(w=n.content)==null||w.focus(),i.preventDefault())})})})});sn.displayName=X;var cn="MenuSubContent",un=a.forwardRef((e,t)=>{const n=Ve(I,e.__scopeMenu),{forceMount:o=n.forceMount,...s}=e,c=L(I,e.__scopeMenu),d=J(I,e.__scopeMenu),l=an(cn,e.__scopeMenu),m=a.useRef(null),v=U(t,m);return r.jsx(H.Provider,{scope:e.__scopeMenu,children:r.jsx(ae,{present:o||c.open,children:r.jsx(H.Slot,{scope:e.__scopeMenu,children:r.jsx(Ce,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:v,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var i;d.isUsingKeyboardRef.current&&((i=m.current)==null||i.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:g(e.onFocusOutside,u=>{u.target!==l.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:g(e.onEscapeKeyDown,u=>{d.onClose(),u.preventDefault()}),onKeyDown:g(e.onKeyDown,u=>{var w;const i=u.currentTarget.contains(u.target),f=Mt[d.dir].includes(u.key);i&&f&&(c.onOpenChange(!1),(w=l.trigger)==null||w.focus(),u.preventDefault())})})})})})});un.displayName=cn;function dn(e){return e?"open":"closed"}function re(e){return e==="indeterminate"}function ye(e){return re(e)?"indeterminate":e?"checked":"unchecked"}function Kt(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $t(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function Ut(e,t,n){const s=t.length>1&&Array.from(t).every(v=>v===t[0])?t[0]:t,c=n?e.indexOf(n):-1;let d=$t(e,Math.max(c,0));s.length===1&&(d=d.filter(v=>v!==n));const m=d.find(v=>v.toLowerCase().startsWith(s.toLowerCase()));return m!==n?m:void 0}function Bt(e,t){const{x:n,y:o}=e;let s=!1;for(let c=0,d=t.length-1;c<t.length;d=c++){const l=t[c],m=t[d],v=l.x,u=l.y,i=m.x,f=m.y;u>o!=f>o&&n<(i-v)*(o-u)/(f-u)+v&&(s=!s)}return s}function zt(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Bt(n,t)}function W(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Vt=ze,Yt=xe,Xt=Ye,Ht=Xe,Wt=Re,Zt=He,qt=ce,Jt=Ze,Qt=Je,eo=en,no=tn,to=on,oo=rn,ro=sn,ao=un,ie="DropdownMenu",[so,Vo]=ge(ie,[Ue]),C=Ue(),[co,ln]=so(ie),fn=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:s,defaultOpen:c,onOpenChange:d,modal:l=!0}=e,m=C(t),v=a.useRef(null),[u,i]=Ne({prop:s,defaultProp:c??!1,onChange:d,caller:ie});return r.jsx(co,{scope:t,triggerId:pe(),triggerRef:v,contentId:pe(),open:u,onOpenChange:i,onOpenToggle:a.useCallback(()=>i(f=>!f),[i]),modal:l,children:r.jsx(Vt,{...m,open:u,onOpenChange:i,dir:o,modal:l,children:n})})};fn.displayName=ie;var pn="DropdownMenuTrigger",mn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...s}=e,c=ln(pn,n),d=C(n);return r.jsx(Yt,{asChild:!0,...d,children:r.jsx(j.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:Pe(t,c.triggerRef),onPointerDown:g(e.onPointerDown,l=>{!o&&l.button===0&&l.ctrlKey===!1&&(c.onOpenToggle(),c.open||l.preventDefault())}),onKeyDown:g(e.onKeyDown,l=>{o||(["Enter"," "].includes(l.key)&&c.onOpenToggle(),l.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});mn.displayName=pn;var io="DropdownMenuPortal",vn=e=>{const{__scopeDropdownMenu:t,...n}=e,o=C(t);return r.jsx(Xt,{...o,...n})};vn.displayName=io;var gn="DropdownMenuContent",hn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=ln(gn,n),c=C(n),d=a.useRef(!1);return r.jsx(Ht,{id:s.contentId,"aria-labelledby":s.triggerId,...c,...o,ref:t,onCloseAutoFocus:g(e.onCloseAutoFocus,l=>{var m;d.current||(m=s.triggerRef.current)==null||m.focus(),d.current=!1,l.preventDefault()}),onInteractOutside:g(e.onInteractOutside,l=>{const m=l.detail.originalEvent,v=m.button===0&&m.ctrlKey===!0,u=m.button===2||v;(!s.modal||u)&&(d.current=!0)}),style:{...e.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)"}})});hn.displayName=gn;var uo="DropdownMenuGroup",lo=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(Wt,{...s,...o,ref:t})});lo.displayName=uo;var fo="DropdownMenuLabel",wn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(Zt,{...s,...o,ref:t})});wn.displayName=fo;var po="DropdownMenuItem",xn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(qt,{...s,...o,ref:t})});xn.displayName=po;var mo="DropdownMenuCheckboxItem",Mn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(Jt,{...s,...o,ref:t})});Mn.displayName=mo;var vo="DropdownMenuRadioGroup",go=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(Qt,{...s,...o,ref:t})});go.displayName=vo;var ho="DropdownMenuRadioItem",_n=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(eo,{...s,...o,ref:t})});_n.displayName=ho;var wo="DropdownMenuItemIndicator",Cn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(no,{...s,...o,ref:t})});Cn.displayName=wo;var xo="DropdownMenuSeparator",Rn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(to,{...s,...o,ref:t})});Rn.displayName=xo;var Mo="DropdownMenuArrow",_o=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(oo,{...s,...o,ref:t})});_o.displayName=Mo;var Co="DropdownMenuSubTrigger",bn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(ro,{...s,...o,ref:t})});bn.displayName=Co;var Ro="DropdownMenuSubContent",yn=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,s=C(n);return r.jsx(ao,{...s,...o,ref:t,style:{...e.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)"}})});yn.displayName=Ro;var bo=fn,yo=mn,Io=vn,In=hn,En=wn,Sn=xn,Dn=Mn,Nn=_n,Pn=Cn,Tn=Rn,jn=bn,An=yn;const Eo=bo,So=yo,Do=a.forwardRef(({className:e,inset:t,children:n,...o},s)=>r.jsxs(jn,{ref:s,className:A("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[n,r.jsx(qn,{className:"ml-auto"})]}));Do.displayName=jn.displayName;const No=a.forwardRef(({className:e,...t},n)=>r.jsx(An,{ref:n,className:A("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));No.displayName=An.displayName;const kn=a.forwardRef(({className:e,sideOffset:t=4,...n},o)=>r.jsx(Io,{children:r.jsx(In,{ref:o,sideOffset:t,className:A("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n})}));kn.displayName=In.displayName;const te=a.forwardRef(({className:e,inset:t,...n},o)=>r.jsx(Sn,{ref:o,className:A("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));te.displayName=Sn.displayName;const Po=a.forwardRef(({className:e,children:t,checked:n,...o},s)=>r.jsxs(Dn,{ref:s,className:A("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(Pn,{children:r.jsx(Zn,{className:"h-4 w-4"})})}),t]}));Po.displayName=Dn.displayName;const To=a.forwardRef(({className:e,children:t,...n},o)=>r.jsxs(Nn,{ref:o,className:A("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(Pn,{children:r.jsx(et,{className:"h-2 w-2 fill-current"})})}),t]}));To.displayName=Nn.displayName;const jo=a.forwardRef(({className:e,inset:t,...n},o)=>r.jsx(En,{ref:o,className:A("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));jo.displayName=En.displayName;const Ao=a.forwardRef(({className:e,...t},n)=>r.jsx(Tn,{ref:n,className:A("-mx-1 my-1 h-px bg-muted",e),...t}));Ao.displayName=Tn.displayName;function Yo(){const{setTheme:e}=Fn();return r.jsxs(Eo,{children:[r.jsx(So,{asChild:!0,children:r.jsxs(Jn,{variant:"outline",size:"icon",children:[r.jsx(rt,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),r.jsx(tt,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),r.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),r.jsxs(kn,{align:"end",children:[r.jsx(te,{onClick:()=>e("light"),children:"Light"}),r.jsx(te,{onClick:()=>e("dark"),children:"Dark"}),r.jsx(te,{onClick:()=>e("system"),children:"System"})]})]})}export{Eo as D,Yo as M,So as a,kn as b,te as c};
