import{r as a,j as d,e as nt,b as _t,$ as Fr,a as yt,m as Ee,q as Ii,c as $i}from"./app-BAHAOwU3.js";import{S as U,c as M,a as Br,b as ji,B as Ur}from"./button-T-Jxhehc.js";import{I as Li}from"./input-CeK7CEQL.js";import{c as Wr,_ as zr,u as Gr,a as X,f as Kr,z as Hr,s as Vr,b as Yr,R as Xr,e as qr,h as Zr}from"./index-C2c0nwNI.js";import{c as Z,X as ki,a as Qr,C as Fi,H as Bi}from"./x-DpOGo0Ip.js";/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ui=Z("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wi=Z("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zi=Z("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gi=Z("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ki=Z("Frame",[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hi=Z("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vi=Z("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Yi=Z("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xi=Z("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qi=Z("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zi=Z("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qi=Z("Sun",[["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"}]]);function Ji(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ec(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),l=n.length;n=[...n,c];const u=f=>{var b;const{scope:h,children:v,...g}=f,m=((b=h==null?void 0:h[e])==null?void 0:b[l])||i,x=a.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:x,children:v})};u.displayName=s+"Provider";function p(f,h){var m;const v=((m=h==null?void 0:h[e])==null?void 0:m[l])||i,g=a.useContext(v);if(g)return g;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,p]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,tc(o,...t)]}function tc(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((i,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function Jr(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function nc({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=rc({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:r,i=Jr(n),l=a.useCallback(u=>{if(s){const f=typeof u=="function"?u(e):u;f!==e&&i(f)}else o(u)},[s,e,o,i]);return[c,l]}function rc({defaultProp:e,onChange:t}){const n=a.useState(e),[r]=n,o=a.useRef(r),s=Jr(t);return a.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var Ct=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{};function oc(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function sc(...e){return t=>e.forEach(n=>oc(n,t))}function eo(...e){return a.useCallback(sc(...e),e)}var ac=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],yn=ac.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...c}=r,i=s?U:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ic(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var to=e=>{const{present:t,children:n}=e,r=cc(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),s=eo(r.ref,uc(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:s}):null};to.displayName="Presence";function cc(e){const[t,n]=a.useState(),r=a.useRef({}),o=a.useRef(e),s=a.useRef("none"),c=e?"mounted":"unmounted",[i,l]=ic(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=dt(r.current);s.current=i==="mounted"?u:"none"},[i]),Ct(()=>{const u=r.current,p=o.current;if(p!==e){const h=s.current,v=dt(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(p&&h!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ct(()=>{if(t){let u;const p=t.ownerDocument.defaultView??window,f=v=>{const m=dt(r.current).includes(v.animationName);if(v.target===t&&m&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=v=>{v.target===t&&(s.current=dt(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:a.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function dt(e){return(e==null?void 0:e.animationName)||"none"}function uc(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lc=nt.useId||(()=>{}),dc=0;function fc(e){const[t,n]=a.useState(lc());return Ct(()=>{e||n(r=>r??String(dc++))},[e]),e||(t?`radix-${t}`:"")}var Cn="Collapsible",[pc,rh]=ec(Cn),[mc,En]=pc(Cn),no=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:s,onOpenChange:c,...i}=e,[l=!1,u]=nc({prop:r,defaultProp:o,onChange:c});return d.jsx(mc,{scope:n,disabled:s,contentId:fc(),open:l,onOpenToggle:a.useCallback(()=>u(p=>!p),[u]),children:d.jsx(yn.div,{"data-state":Rn(l),"data-disabled":s?"":void 0,...i,ref:t})})});no.displayName=Cn;var ro="CollapsibleTrigger",oo=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=En(ro,n);return d.jsx(yn.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Rn(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Ji(e.onClick,o.onOpenToggle)})});oo.displayName=ro;var Sn="CollapsibleContent",so=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=En(Sn,e.__scopeCollapsible);return d.jsx(to,{present:n||o.open,children:({present:s})=>d.jsx(hc,{...r,ref:t,present:s})})});so.displayName=Sn;var hc=a.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...s}=e,c=En(Sn,n),[i,l]=a.useState(r),u=a.useRef(null),p=eo(t,u),f=a.useRef(0),h=f.current,v=a.useRef(0),g=v.current,m=c.open||i,x=a.useRef(m),b=a.useRef();return a.useEffect(()=>{const w=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(w)},[]),Ct(()=>{const w=u.current;if(w){b.current=b.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const y=w.getBoundingClientRect();f.current=y.height,v.current=y.width,x.current||(w.style.transitionDuration=b.current.transitionDuration,w.style.animationName=b.current.animationName),l(r)}},[c.open,r]),d.jsx(yn.div,{"data-state":Rn(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!m,...s,ref:p,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:m&&o})});function Rn(e){return e?"open":"closed"}var vc=no;const gc=vc,xc=oo,bc=so,Yt=768;function wc(){const[e,t]=a.useState(void 0);return a.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Yt-1}px)`),r=()=>{t(window.innerWidth<Yt)};return n.addEventListener("change",r),t(window.innerWidth<Yt),()=>n.removeEventListener("change",r)},[]),!!e}var yc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Cc=yc.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...c}=r,i=s?U:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Ec="Separator",nr="horizontal",Sc=["horizontal","vertical"],ao=a.forwardRef((e,t)=>{const{decorative:n,orientation:r=nr,...o}=e,s=Rc(r)?r:nr,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return d.jsx(Cc.div,{"data-orientation":s,...i,...o,ref:t})});ao.displayName=Ec;function Rc(e){return Sc.includes(e)}var io=ao;const Nn=a.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>d.jsx(io,{ref:o,decorative:n,orientation:t,className:M("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Nn.displayName=io.displayName;function ve(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Nc(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Pc(...e){return t=>e.forEach(n=>Nc(n,t))}function Pe(...e){return a.useCallback(Pc(...e),e)}function Mc(e,t){const n=a.createContext(t),r=s=>{const{children:c,...i}=s,l=a.useMemo(()=>i,Object.values(i));return d.jsx(n.Provider,{value:l,children:c})};r.displayName=e+"Provider";function o(s){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ac(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),l=n.length;n=[...n,c];const u=f=>{var b;const{scope:h,children:v,...g}=f,m=((b=h==null?void 0:h[e])==null?void 0:b[l])||i,x=a.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:x,children:v})};u.displayName=s+"Provider";function p(f,h){var m;const v=((m=h==null?void 0:h[e])==null?void 0:m[l])||i,g=a.useContext(v);if(g)return g;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,p]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Tc(o,...t)]}function Tc(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((i,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Et=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},Oc=nt.useId||(()=>{}),_c=0;function Xt(e){const[t,n]=a.useState(Oc());return Et(()=>{e||n(r=>r??String(_c++))},[e]),e||(t?`radix-${t}`:"")}function Se(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Dc({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Ic({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:r,i=Se(n),l=a.useCallback(u=>{if(s){const f=typeof u=="function"?u(e):u;f!==e&&i(f)}else o(u)},[s,e,o,i]);return[c,l]}function Ic({defaultProp:e,onChange:t}){const n=a.useState(e),[r]=n,o=a.useRef(r),s=Se(t);return a.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var $c=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],le=$c.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...c}=r,i=s?U:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function jc(e,t){e&&_t.flushSync(()=>e.dispatchEvent(t))}function Lc(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var kc="DismissableLayer",an="dismissableLayer.update",Fc="dismissableLayer.pointerDownOutside",Bc="dismissableLayer.focusOutside",rr,co=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),uo=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:i,...l}=e,u=a.useContext(co),[p,f]=a.useState(null),h=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=a.useState({}),g=Pe(t,E=>f(E)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(x),w=p?m.indexOf(p):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,C=w>=b,S=zc(E=>{const N=E.target,T=[...u.branches].some(O=>O.contains(N));!C||T||(o==null||o(E),c==null||c(E),E.defaultPrevented||i==null||i())},h),R=Gc(E=>{const N=E.target;[...u.branches].some(O=>O.contains(N))||(s==null||s(E),c==null||c(E),E.defaultPrevented||i==null||i())},h);return Lc(E=>{w===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&i&&(E.preventDefault(),i()))},h),a.useEffect(()=>{if(p)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(rr=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),or(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=rr)}},[p,h,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),or())},[p,u]),a.useEffect(()=>{const E=()=>v({});return document.addEventListener(an,E),()=>document.removeEventListener(an,E)},[]),d.jsx(le.div,{...l,ref:g,style:{pointerEvents:y?C?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,R.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,S.onPointerDownCapture)})});uo.displayName=kc;var Uc="DismissableLayerBranch",Wc=a.forwardRef((e,t)=>{const n=a.useContext(co),r=a.useRef(null),o=Pe(t,r);return a.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),d.jsx(le.div,{...e,ref:o})});Wc.displayName=Uc;function zc(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let l=function(){lo(Fc,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Gc(e,t=globalThis==null?void 0:globalThis.document){const n=Se(e),r=a.useRef(!1);return a.useEffect(()=>{const o=s=>{s.target&&!r.current&&lo(Bc,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function or(){const e=new CustomEvent(an);document.dispatchEvent(e)}function lo(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?jc(o,s):o.dispatchEvent(s)}var qt="focusScope.autoFocusOnMount",Zt="focusScope.autoFocusOnUnmount",sr={bubbles:!1,cancelable:!0},Kc="FocusScope",fo=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[i,l]=a.useState(null),u=Se(o),p=Se(s),f=a.useRef(null),h=Pe(t,m=>l(m)),v=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let m=function(y){if(v.paused||!i)return;const C=y.target;i.contains(C)?f.current=C:me(f.current,{select:!0})},x=function(y){if(v.paused||!i)return;const C=y.relatedTarget;C!==null&&(i.contains(C)||me(f.current,{select:!0}))},b=function(y){if(document.activeElement===document.body)for(const S of y)S.removedNodes.length>0&&me(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const w=new MutationObserver(b);return i&&w.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),w.disconnect()}}},[r,i,v.paused]),a.useEffect(()=>{if(i){ir.add(v);const m=document.activeElement;if(!i.contains(m)){const b=new CustomEvent(qt,sr);i.addEventListener(qt,u),i.dispatchEvent(b),b.defaultPrevented||(Hc(Zc(po(i)),{select:!0}),document.activeElement===m&&me(i))}return()=>{i.removeEventListener(qt,u),setTimeout(()=>{const b=new CustomEvent(Zt,sr);i.addEventListener(Zt,p),i.dispatchEvent(b),b.defaultPrevented||me(m??document.body,{select:!0}),i.removeEventListener(Zt,p),ir.remove(v)},0)}}},[i,u,p,v]);const g=a.useCallback(m=>{if(!n&&!r||v.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(x&&b){const w=m.currentTarget,[y,C]=Vc(w);y&&C?!m.shiftKey&&b===C?(m.preventDefault(),n&&me(y,{select:!0})):m.shiftKey&&b===y&&(m.preventDefault(),n&&me(C,{select:!0})):b===w&&m.preventDefault()}},[n,r,v.paused]);return d.jsx(le.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});fo.displayName=Kc;function Hc(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(me(r,{select:t}),document.activeElement!==n)return}function Vc(e){const t=po(e),n=ar(t,e),r=ar(t.reverse(),e);return[n,r]}function po(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ar(e,t){for(const n of e)if(!Yc(n,{upTo:t}))return n}function Yc(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Xc(e){return e instanceof HTMLInputElement&&"select"in e}function me(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Xc(e)&&t&&e.select()}}var ir=qc();function qc(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=cr(e,t),e.unshift(t)},remove(t){var n;e=cr(e,t),(n=e[0])==null||n.resume()}}}function cr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Zc(e){return e.filter(t=>t.tagName!=="A")}var Qc="Portal",mo=a.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,s]=a.useState(!1);Et(()=>s(!0),[]);const c=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return c?Fr.createPortal(d.jsx(le.div,{...r,ref:t}),c):null});mo.displayName=Qc;function Jc(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var Dt=e=>{const{present:t,children:n}=e,r=eu(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),s=Pe(r.ref,tu(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:s}):null};Dt.displayName="Presence";function eu(e){const[t,n]=a.useState(),r=a.useRef({}),o=a.useRef(e),s=a.useRef("none"),c=e?"mounted":"unmounted",[i,l]=Jc(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=ft(r.current);s.current=i==="mounted"?u:"none"},[i]),Et(()=>{const u=r.current,p=o.current;if(p!==e){const h=s.current,v=ft(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(p&&h!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Et(()=>{if(t){let u;const p=t.ownerDocument.defaultView??window,f=v=>{const m=ft(r.current).includes(v.animationName);if(v.target===t&&m&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=v=>{v.target===t&&(s.current=ft(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:a.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function ft(e){return(e==null?void 0:e.animationName)||"none"}function tu(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qt=0;function nu(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ur()),document.body.insertAdjacentElement("beforeend",e[1]??ur()),Qt++,()=>{Qt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qt--}},[])}function ur(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ho=Wr(),Jt=function(){},It=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:Jt,onWheelCapture:Jt,onTouchMoveCapture:Jt}),o=r[0],s=r[1],c=e.forwardProps,i=e.children,l=e.className,u=e.removeScrollBar,p=e.enabled,f=e.shards,h=e.sideCar,v=e.noIsolation,g=e.inert,m=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,w=e.gapMode,y=zr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,S=Gr([n,t]),R=X(X({},y),o);return a.createElement(a.Fragment,null,p&&a.createElement(C,{sideCar:ho,removeScrollBar:u,shards:f,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:w}),c?a.cloneElement(a.Children.only(i),X(X({},R),{ref:S})):a.createElement(b,X({},R,{className:l,ref:S}),i))});It.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};It.classNames={fullWidth:Kr,zeroRight:Hr};var cn=!1;if(typeof window<"u")try{var pt=Object.defineProperty({},"passive",{get:function(){return cn=!0,!0}});window.addEventListener("test",pt,pt),window.removeEventListener("test",pt,pt)}catch{cn=!1}var _e=cn?{passive:!1}:!1,ru=function(e){return e.tagName==="TEXTAREA"},vo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ru(e)&&n[t]==="visible")},ou=function(e){return vo(e,"overflowY")},su=function(e){return vo(e,"overflowX")},lr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=go(e,r);if(o){var s=xo(e,r),c=s[1],i=s[2];if(c>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},au=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},iu=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},go=function(e,t){return e==="v"?ou(t):su(t)},xo=function(e,t){return e==="v"?au(t):iu(t)},cu=function(e,t){return e==="h"&&t==="rtl"?-1:1},uu=function(e,t,n,r,o){var s=cu(e,window.getComputedStyle(t).direction),c=s*r,i=n.target,l=t.contains(i),u=!1,p=c>0,f=0,h=0;do{var v=xo(e,i),g=v[0],m=v[1],x=v[2],b=m-x-s*g;(g||b)&&go(e,i)&&(f+=b,h+=g),i instanceof ShadowRoot?i=i.host:i=i.parentNode}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(p&&(Math.abs(f)<1||!o)||!p&&(Math.abs(h)<1||!o))&&(u=!0),u},mt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dr=function(e){return[e.deltaX,e.deltaY]},fr=function(e){return e&&"current"in e?e.current:e},lu=function(e,t){return e[0]===t[0]&&e[1]===t[1]},du=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},fu=0,De=[];function pu(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(fu++)[0],s=a.useState(Vr)[0],c=a.useRef(e);a.useEffect(function(){c.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Yr([e.lockRef.current],(e.shards||[]).map(fr),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=a.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!c.current.allowPinchZoom;var b=mt(m),w=n.current,y="deltaX"in m?m.deltaX:w[0]-b[0],C="deltaY"in m?m.deltaY:w[1]-b[1],S,R=m.target,E=Math.abs(y)>Math.abs(C)?"h":"v";if("touches"in m&&E==="h"&&R.type==="range")return!1;var N=lr(E,R);if(!N)return!0;if(N?S=E:(S=E==="v"?"h":"v",N=lr(E,R)),!N)return!1;if(!r.current&&"changedTouches"in m&&(y||C)&&(r.current=S),!S)return!0;var T=r.current||S;return uu(T,x,m,T==="h"?y:C,!0)},[]),l=a.useCallback(function(m){var x=m;if(!(!De.length||De[De.length-1]!==s)){var b="deltaY"in x?dr(x):mt(x),w=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&lu(S.delta,b)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var y=(c.current.shards||[]).map(fr).filter(Boolean).filter(function(S){return S.contains(x.target)}),C=y.length>0?i(x,y[0]):!c.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),u=a.useCallback(function(m,x,b,w){var y={name:m,delta:x,target:b,should:w,shadowParent:mu(b)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(C){return C!==y})},1)},[]),p=a.useCallback(function(m){n.current=mt(m),r.current=void 0},[]),f=a.useCallback(function(m){u(m.type,dr(m),m.target,i(m,e.lockRef.current))},[]),h=a.useCallback(function(m){u(m.type,mt(m),m.target,i(m,e.lockRef.current))},[]);a.useEffect(function(){return De.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,_e),document.addEventListener("touchmove",l,_e),document.addEventListener("touchstart",p,_e),function(){De=De.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,_e),document.removeEventListener("touchmove",l,_e),document.removeEventListener("touchstart",p,_e)}},[]);var v=e.removeScrollBar,g=e.inert;return a.createElement(a.Fragment,null,g?a.createElement(s,{styles:du(o)}):null,v?a.createElement(Xr,{gapMode:e.gapMode}):null)}function mu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hu=qr(ho,pu);var bo=a.forwardRef(function(e,t){return a.createElement(It,X({},e,{ref:t,sideCar:hu}))});bo.classNames=It.classNames;var Pn="Dialog",[wo,oh]=Ac(Pn),[vu,te]=wo(Pn),yo=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:c=!0}=e,i=a.useRef(null),l=a.useRef(null),[u=!1,p]=Dc({prop:r,defaultProp:o,onChange:s});return d.jsx(vu,{scope:t,triggerRef:i,contentRef:l,contentId:Xt(),titleId:Xt(),descriptionId:Xt(),open:u,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(f=>!f),[p]),modal:c,children:n})};yo.displayName=Pn;var Co="DialogTrigger",gu=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=te(Co,n),s=Pe(t,o.triggerRef);return d.jsx(le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Tn(o.open),...r,ref:s,onClick:ve(e.onClick,o.onOpenToggle)})});gu.displayName=Co;var Mn="DialogPortal",[xu,Eo]=wo(Mn,{forceMount:void 0}),So=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=te(Mn,t);return d.jsx(xu,{scope:t,forceMount:n,children:a.Children.map(r,c=>d.jsx(Dt,{present:n||s.open,children:d.jsx(mo,{asChild:!0,container:o,children:c})}))})};So.displayName=Mn;var St="DialogOverlay",Ro=a.forwardRef((e,t)=>{const n=Eo(St,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=te(St,e.__scopeDialog);return s.modal?d.jsx(Dt,{present:r||s.open,children:d.jsx(bu,{...o,ref:t})}):null});Ro.displayName=St;var bu=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=te(St,n);return d.jsx(bo,{as:U,allowPinchZoom:!0,shards:[o.contentRef],children:d.jsx(le.div,{"data-state":Tn(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Re="DialogContent",No=a.forwardRef((e,t)=>{const n=Eo(Re,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=te(Re,e.__scopeDialog);return d.jsx(Dt,{present:r||s.open,children:s.modal?d.jsx(wu,{...o,ref:t}):d.jsx(yu,{...o,ref:t})})});No.displayName=Re;var wu=a.forwardRef((e,t)=>{const n=te(Re,e.__scopeDialog),r=a.useRef(null),o=Pe(t,n.contentRef,r);return a.useEffect(()=>{const s=r.current;if(s)return Zr(s)},[]),d.jsx(Po,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,s=>{var c;s.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,i=c.button===0&&c.ctrlKey===!0;(c.button===2||i)&&s.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,s=>s.preventDefault())})}),yu=a.forwardRef((e,t)=>{const n=te(Re,e.__scopeDialog),r=a.useRef(!1),o=a.useRef(!1);return d.jsx(Po,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,s),s.defaultPrevented||(r.current||(i=n.triggerRef.current)==null||i.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),Po=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=e,i=te(Re,n),l=a.useRef(null),u=Pe(t,l);return nu(),d.jsxs(d.Fragment,{children:[d.jsx(fo,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:d.jsx(uo,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Tn(i.open),...c,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Cu,{titleId:i.titleId}),d.jsx(Su,{contentRef:l,descriptionId:i.descriptionId})]})]})}),An="DialogTitle",Mo=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=te(An,n);return d.jsx(le.h2,{id:o.titleId,...r,ref:t})});Mo.displayName=An;var Ao="DialogDescription",To=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=te(Ao,n);return d.jsx(le.p,{id:o.descriptionId,...r,ref:t})});To.displayName=Ao;var Oo="DialogClose",_o=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=te(Oo,n);return d.jsx(le.button,{type:"button",...r,ref:t,onClick:ve(e.onClick,()=>o.onOpenChange(!1))})});_o.displayName=Oo;function Tn(e){return e?"open":"closed"}var Do="DialogTitleWarning",[sh,Io]=Mc(Do,{contentName:Re,titleName:An,docsSlug:"dialog"}),Cu=({titleId:e})=>{const t=Io(Do),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Eu="DialogDescriptionWarning",Su=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Io(Eu).contentName}}.`;return a.useEffect(()=>{var s;const o=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ru=yo,Nu=So,$o=Ro,jo=No,Lo=Mo,ko=To,Pu=_o;const Mu=Ru,Au=Nu,Fo=a.forwardRef(({className:e,...t},n)=>d.jsx($o,{className:M("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Fo.displayName=$o.displayName;const Tu=Br("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Bo=a.forwardRef(({side:e="right",className:t,children:n,...r},o)=>d.jsxs(Au,{children:[d.jsx(Fo,{}),d.jsxs(jo,{ref:o,className:M(Tu({side:e}),t),...r,children:[n,d.jsxs(Pu,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[d.jsx(ki,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bo.displayName=jo.displayName;const Ou=a.forwardRef(({className:e,...t},n)=>d.jsx(Lo,{ref:n,className:M("text-lg font-semibold text-foreground",e),...t}));Ou.displayName=Lo.displayName;const _u=a.forwardRef(({className:e,...t},n)=>d.jsx(ko,{ref:n,className:M("text-sm text-muted-foreground",e),...t}));_u.displayName=ko.displayName;function pr({className:e,...t}){return d.jsx("div",{className:M("animate-pulse rounded-md bg-muted",e),...t})}function ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Du(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Iu(...e){return t=>e.forEach(n=>Du(n,t))}function Me(...e){return a.useCallback(Iu(...e),e)}function $u(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),l=n.length;n=[...n,c];const u=f=>{var b;const{scope:h,children:v,...g}=f,m=((b=h==null?void 0:h[e])==null?void 0:b[l])||i,x=a.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:x,children:v})};u.displayName=s+"Provider";function p(f,h){var m;const v=((m=h==null?void 0:h[e])==null?void 0:m[l])||i,g=a.useContext(v);if(g)return g;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,p]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,ju(o,...t)]}function ju(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((i,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Lu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ze=Lu.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...c}=r,i=s?U:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ku(e,t){e&&_t.flushSync(()=>e.dispatchEvent(t))}function Ge(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Fu(e,t=globalThis==null?void 0:globalThis.document){const n=Ge(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Bu="DismissableLayer",un="dismissableLayer.update",Uu="dismissableLayer.pointerDownOutside",Wu="dismissableLayer.focusOutside",mr,Uo=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wo=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:i,...l}=e,u=a.useContext(Uo),[p,f]=a.useState(null),h=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=a.useState({}),g=Me(t,E=>f(E)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(x),w=p?m.indexOf(p):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,C=w>=b,S=Ku(E=>{const N=E.target,T=[...u.branches].some(O=>O.contains(N));!C||T||(o==null||o(E),c==null||c(E),E.defaultPrevented||i==null||i())},h),R=Hu(E=>{const N=E.target;[...u.branches].some(O=>O.contains(N))||(s==null||s(E),c==null||c(E),E.defaultPrevented||i==null||i())},h);return Fu(E=>{w===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&i&&(E.preventDefault(),i()))},h),a.useEffect(()=>{if(p)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(mr=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),hr(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=mr)}},[p,h,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),hr())},[p,u]),a.useEffect(()=>{const E=()=>v({});return document.addEventListener(un,E),()=>document.removeEventListener(un,E)},[]),d.jsx(ze.div,{...l,ref:g,style:{pointerEvents:y?C?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,R.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,S.onPointerDownCapture)})});Wo.displayName=Bu;var zu="DismissableLayerBranch",Gu=a.forwardRef((e,t)=>{const n=a.useContext(Uo),r=a.useRef(null),o=Me(t,r);return a.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),d.jsx(ze.div,{...e,ref:o})});Gu.displayName=zu;function Ku(e,t=globalThis==null?void 0:globalThis.document){const n=Ge(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let l=function(){zo(Uu,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Hu(e,t=globalThis==null?void 0:globalThis.document){const n=Ge(e),r=a.useRef(!1);return a.useEffect(()=>{const o=s=>{s.target&&!r.current&&zo(Wu,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hr(){const e=new CustomEvent(un);document.dispatchEvent(e)}function zo(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ku(o,s):o.dispatchEvent(s)}var Fe=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},Vu=nt.useId||(()=>{}),Yu=0;function Xu(e){const[t,n]=a.useState(Vu());return Fe(()=>{n(r=>r??String(Yu++))},[e]),t?`radix-${t}`:""}const qu=["top","right","bottom","left"],ge=Math.min,K=Math.max,Rt=Math.round,ht=Math.floor,xe=e=>({x:e,y:e}),Zu={left:"right",right:"left",bottom:"top",top:"bottom"},Qu={start:"end",end:"start"};function ln(e,t,n){return K(e,ge(t,n))}function ce(e,t){return typeof e=="function"?e(t):e}function ue(e){return e.split("-")[0]}function Ke(e){return e.split("-")[1]}function On(e){return e==="x"?"y":"x"}function _n(e){return e==="y"?"height":"width"}function He(e){return["top","bottom"].includes(ue(e))?"y":"x"}function Dn(e){return On(He(e))}function Ju(e,t,n){n===void 0&&(n=!1);const r=Ke(e),o=Dn(e),s=_n(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Nt(c)),[c,Nt(c)]}function el(e){const t=Nt(e);return[dn(e),t,dn(t)]}function dn(e){return e.replace(/start|end/g,t=>Qu[t])}function tl(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:c;default:return[]}}function nl(e,t,n,r){const o=Ke(e);let s=tl(ue(e),n==="start",r);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(dn)))),s}function Nt(e){return e.replace(/left|right|bottom|top/g,t=>Zu[t])}function rl(e){return{top:0,right:0,bottom:0,left:0,...e}}function Go(e){return typeof e!="number"?rl(e):{top:e,right:e,bottom:e,left:e}}function Pt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function vr(e,t,n){let{reference:r,floating:o}=e;const s=He(t),c=Dn(t),i=_n(c),l=ue(t),u=s==="y",p=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[i]/2-o[i]/2;let v;switch(l){case"top":v={x:p,y:r.y-o.height};break;case"bottom":v={x:p,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:f};break;case"left":v={x:r.x-o.width,y:f};break;default:v={x:r.x,y:r.y}}switch(Ke(t)){case"start":v[c]-=h*(n&&u?-1:1);break;case"end":v[c]+=h*(n&&u?-1:1);break}return v}const ol=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:c}=n,i=s.filter(Boolean),l=await(c.isRTL==null?void 0:c.isRTL(t));let u=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:f}=vr(u,r,l),h=r,v={},g=0;for(let m=0;m<i.length;m++){const{name:x,fn:b}=i[m],{x:w,y,data:C,reset:S}=await b({x:p,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:v,rects:u,platform:c,elements:{reference:e,floating:t}});p=w??p,f=y??f,v={...v,[x]:{...v[x],...C}},S&&g<=50&&(g++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(u=S.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:p,y:f}=vr(u,h,l)),m=-1)}return{x:p,y:f,placement:h,strategy:o,middlewareData:v}};async function Qe(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:c,elements:i,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:h=!1,padding:v=0}=ce(t,e),g=Go(v),x=i[h?f==="floating"?"reference":"floating":f],b=Pt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:u,rootBoundary:p,strategy:l})),w=f==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),C=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},S=Pt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:w,offsetParent:y,strategy:l}):w);return{top:(b.top-S.top+g.top)/C.y,bottom:(S.bottom-b.bottom+g.bottom)/C.y,left:(b.left-S.left+g.left)/C.x,right:(S.right-b.right+g.right)/C.x}}const sl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:c,elements:i,middlewareData:l}=t,{element:u,padding:p=0}=ce(e,t)||{};if(u==null)return{};const f=Go(p),h={x:n,y:r},v=Dn(o),g=_n(v),m=await c.getDimensions(u),x=v==="y",b=x?"top":"left",w=x?"bottom":"right",y=x?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[v]-h[v]-s.floating[g],S=h[v]-s.reference[v],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(u));let E=R?R[y]:0;(!E||!await(c.isElement==null?void 0:c.isElement(R)))&&(E=i.floating[y]||s.floating[g]);const N=C/2-S/2,T=E/2-m[g]/2-1,O=ge(f[b],T),F=ge(f[w],T),_=O,L=E-m[g]-F,j=E/2-m[g]/2+N,D=ln(_,j,L),I=!l.arrow&&Ke(o)!=null&&j!==D&&s.reference[g]/2-(j<_?O:F)-m[g]/2<0,A=I?j<_?j-_:j-L:0;return{[v]:h[v]+A,data:{[v]:D,centerOffset:j-D-A,...I&&{alignmentOffset:A}},reset:I}}}),al=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:c,initialPlacement:i,platform:l,elements:u}=t,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...x}=ce(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=ue(o),w=ue(i)===i,y=await(l.isRTL==null?void 0:l.isRTL(u.floating)),C=h||(w||!m?[Nt(i)]:el(i));!h&&g!=="none"&&C.push(...nl(i,m,g,y));const S=[i,...C],R=await Qe(t,x),E=[];let N=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&E.push(R[b]),f){const _=Ju(o,c,y);E.push(R[_[0]],R[_[1]])}if(N=[...N,{placement:o,overflows:E}],!E.every(_=>_<=0)){var T,O;const _=(((T=s.flip)==null?void 0:T.index)||0)+1,L=S[_];if(L)return{data:{index:_,overflows:N},reset:{placement:L}};let j=(O=N.filter(D=>D.overflows[0]<=0).sort((D,I)=>D.overflows[1]-I.overflows[1])[0])==null?void 0:O.placement;if(!j)switch(v){case"bestFit":{var F;const D=(F=N.map(I=>[I.placement,I.overflows.filter(A=>A>0).reduce((A,$)=>A+$,0)]).sort((I,A)=>I[1]-A[1])[0])==null?void 0:F[0];D&&(j=D);break}case"initialPlacement":j=i;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function gr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xr(e){return qu.some(t=>e[t]>=0)}const il=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ce(e,t);switch(r){case"referenceHidden":{const s=await Qe(t,{...o,elementContext:"reference"}),c=gr(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:xr(c)}}}case"escaped":{const s=await Qe(t,{...o,altBoundary:!0}),c=gr(s,n.floating);return{data:{escapedOffsets:c,escaped:xr(c)}}}default:return{}}}}};async function cl(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=ue(n),i=Ke(n),l=He(n)==="y",u=["left","top"].includes(c)?-1:1,p=s&&l?-1:1,f=ce(t,e);let{mainAxis:h,crossAxis:v,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return i&&typeof g=="number"&&(v=i==="end"?g*-1:g),l?{x:v*p,y:h*u}:{x:h*u,y:v*p}}const ul=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:c,middlewareData:i}=t,l=await cl(t,e);return c===((n=i.offset)==null?void 0:n.placement)&&(r=i.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:c}}}}},ll=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:i={fn:x=>{let{x:b,y:w}=x;return{x:b,y:w}}},...l}=ce(e,t),u={x:n,y:r},p=await Qe(t,l),f=He(ue(o)),h=On(f);let v=u[h],g=u[f];if(s){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=v+p[x],y=v-p[b];v=ln(w,v,y)}if(c){const x=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=g+p[x],y=g-p[b];g=ln(w,g,y)}const m=i.fn({...t,[h]:v,[f]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},dl=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:c}=t,{offset:i=0,mainAxis:l=!0,crossAxis:u=!0}=ce(e,t),p={x:n,y:r},f=He(o),h=On(f);let v=p[h],g=p[f];const m=ce(i,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const y=h==="y"?"height":"width",C=s.reference[h]-s.floating[y]+x.mainAxis,S=s.reference[h]+s.reference[y]-x.mainAxis;v<C?v=C:v>S&&(v=S)}if(u){var b,w;const y=h==="y"?"width":"height",C=["top","left"].includes(ue(o)),S=s.reference[f]-s.floating[y]+(C&&((b=c.offset)==null?void 0:b[f])||0)+(C?0:x.crossAxis),R=s.reference[f]+s.reference[y]+(C?0:((w=c.offset)==null?void 0:w[f])||0)-(C?x.crossAxis:0);g<S?g=S:g>R&&(g=R)}return{[h]:v,[f]:g}}}},fl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:c=()=>{},...i}=ce(e,t),l=await Qe(t,i),u=ue(n),p=Ke(n),f=He(n)==="y",{width:h,height:v}=r.floating;let g,m;u==="top"||u==="bottom"?(g=u,m=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(m=u,g=p==="end"?"top":"bottom");const x=v-l[g],b=h-l[m],w=!t.middlewareData.shift;let y=x,C=b;if(f){const R=h-l.left-l.right;C=p||w?ge(b,R):R}else{const R=v-l.top-l.bottom;y=p||w?ge(x,R):R}if(w&&!p){const R=K(l.left,0),E=K(l.right,0),N=K(l.top,0),T=K(l.bottom,0);f?C=h-2*(R!==0||E!==0?R+E:K(l.left,l.right)):y=v-2*(N!==0||T!==0?N+T:K(l.top,l.bottom))}await c({...t,availableWidth:C,availableHeight:y});const S=await o.getDimensions(s.floating);return h!==S.width||v!==S.height?{reset:{rects:!0}}:{}}}};function Ve(e){return Ko(e)?(e.nodeName||"").toLowerCase():"#document"}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function de(e){var t;return(t=(Ko(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ko(e){return e instanceof Node||e instanceof H(e).Node}function re(e){return e instanceof Element||e instanceof H(e).Element}function oe(e){return e instanceof HTMLElement||e instanceof H(e).HTMLElement}function br(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function rt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function pl(e){return["table","td","th"].includes(Ve(e))}function In(e){const t=$n(),n=ee(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function ml(e){let t=be(e);for(;oe(t)&&!Be(t);){if(In(t))return t;t=be(t)}return null}function $n(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Be(e){return["html","body","#document"].includes(Ve(e))}function ee(e){return H(e).getComputedStyle(e)}function $t(e){return re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function be(e){if(Ve(e)==="html")return e;const t=e.assignedSlot||e.parentNode||br(e)&&e.host||de(e);return br(t)?t.host:t}function Ho(e){const t=be(e);return Be(t)?e.ownerDocument?e.ownerDocument.body:e.body:oe(t)&&rt(t)?t:Ho(t)}function Je(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ho(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),c=H(o);return s?t.concat(c,c.visualViewport||[],rt(o)?o:[],c.frameElement&&n?Je(c.frameElement):[]):t.concat(o,Je(o,[],n))}function Vo(e){const t=ee(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=oe(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r,i=Rt(n)!==s||Rt(r)!==c;return i&&(n=s,r=c),{width:n,height:r,$:i}}function jn(e){return re(e)?e:e.contextElement}function je(e){const t=jn(e);if(!oe(t))return xe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Vo(t);let c=(s?Rt(n.width):n.width)/r,i=(s?Rt(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!i||!Number.isFinite(i))&&(i=1),{x:c,y:i}}const hl=xe(0);function Yo(e){const t=H(e);return!$n()||!t.visualViewport?hl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==H(e)?!1:t}function Ne(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=jn(e);let c=xe(1);t&&(r?re(r)&&(c=je(r)):c=je(e));const i=vl(s,n,r)?Yo(s):xe(0);let l=(o.left+i.x)/c.x,u=(o.top+i.y)/c.y,p=o.width/c.x,f=o.height/c.y;if(s){const h=H(s),v=r&&re(r)?H(r):r;let g=h,m=g.frameElement;for(;m&&r&&v!==g;){const x=je(m),b=m.getBoundingClientRect(),w=ee(m),y=b.left+(m.clientLeft+parseFloat(w.paddingLeft))*x.x,C=b.top+(m.clientTop+parseFloat(w.paddingTop))*x.y;l*=x.x,u*=x.y,p*=x.x,f*=x.y,l+=y,u+=C,g=H(m),m=g.frameElement}}return Pt({width:p,height:f,x:l,y:u})}const gl=[":popover-open",":modal"];function Ln(e){return gl.some(t=>{try{return e.matches(t)}catch{return!1}})}function xl(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",c=de(r),i=t?Ln(t.floating):!1;if(r===c||i&&s)return n;let l={scrollLeft:0,scrollTop:0},u=xe(1);const p=xe(0),f=oe(r);if((f||!f&&!s)&&((Ve(r)!=="body"||rt(c))&&(l=$t(r)),oe(r))){const h=Ne(r);u=je(r),p.x=h.x+r.clientLeft,p.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+p.x,y:n.y*u.y-l.scrollTop*u.y+p.y}}function bl(e){return Array.from(e.getClientRects())}function Xo(e){return Ne(de(e)).left+$t(e).scrollLeft}function wl(e){const t=de(e),n=$t(e),r=e.ownerDocument.body,o=K(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=K(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Xo(e);const i=-n.scrollTop;return ee(r).direction==="rtl"&&(c+=K(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:c,y:i}}function yl(e,t){const n=H(e),r=de(e),o=n.visualViewport;let s=r.clientWidth,c=r.clientHeight,i=0,l=0;if(o){s=o.width,c=o.height;const u=$n();(!u||u&&t==="fixed")&&(i=o.offsetLeft,l=o.offsetTop)}return{width:s,height:c,x:i,y:l}}function Cl(e,t){const n=Ne(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=oe(e)?je(e):xe(1),c=e.clientWidth*s.x,i=e.clientHeight*s.y,l=o*s.x,u=r*s.y;return{width:c,height:i,x:l,y:u}}function wr(e,t,n){let r;if(t==="viewport")r=yl(e,n);else if(t==="document")r=wl(de(e));else if(re(t))r=Cl(t,n);else{const o=Yo(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Pt(r)}function qo(e,t){const n=be(e);return n===t||!re(n)||Be(n)?!1:ee(n).position==="fixed"||qo(n,t)}function El(e,t){const n=t.get(e);if(n)return n;let r=Je(e,[],!1).filter(i=>re(i)&&Ve(i)!=="body"),o=null;const s=ee(e).position==="fixed";let c=s?be(e):e;for(;re(c)&&!Be(c);){const i=ee(c),l=In(c);!l&&i.position==="fixed"&&(o=null),(s?!l&&!o:!l&&i.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||rt(c)&&!l&&qo(e,c))?r=r.filter(p=>p!==c):o=i,c=be(c)}return t.set(e,r),r}function Sl(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?Ln(t)?[]:El(t,this._c):[].concat(n),r],i=c[0],l=c.reduce((u,p)=>{const f=wr(t,p,o);return u.top=K(f.top,u.top),u.right=ge(f.right,u.right),u.bottom=ge(f.bottom,u.bottom),u.left=K(f.left,u.left),u},wr(t,i,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Rl(e){const{width:t,height:n}=Vo(e);return{width:t,height:n}}function Nl(e,t,n){const r=oe(t),o=de(t),s=n==="fixed",c=Ne(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const l=xe(0);if(r||!r&&!s)if((Ve(t)!=="body"||rt(o))&&(i=$t(t)),r){const f=Ne(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=Xo(o));const u=c.left+i.scrollLeft-l.x,p=c.top+i.scrollTop-l.y;return{x:u,y:p,width:c.width,height:c.height}}function en(e){return ee(e).position==="static"}function yr(e,t){return!oe(e)||ee(e).position==="fixed"?null:t?t(e):e.offsetParent}function Zo(e,t){const n=H(e);if(Ln(e))return n;if(!oe(e)){let o=be(e);for(;o&&!Be(o);){if(re(o)&&!en(o))return o;o=be(o)}return n}let r=yr(e,t);for(;r&&pl(r)&&en(r);)r=yr(r,t);return r&&Be(r)&&en(r)&&!In(r)?n:r||ml(e)||n}const Pl=async function(e){const t=this.getOffsetParent||Zo,n=this.getDimensions,r=await n(e.floating);return{reference:Nl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ml(e){return ee(e).direction==="rtl"}const Al={convertOffsetParentRelativeRectToViewportRelativeRect:xl,getDocumentElement:de,getClippingRect:Sl,getOffsetParent:Zo,getElementRects:Pl,getClientRects:bl,getDimensions:Rl,getScale:je,isElement:re,isRTL:Ml};function Tl(e,t){let n=null,r;const o=de(e);function s(){var i;clearTimeout(r),(i=n)==null||i.disconnect(),n=null}function c(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),s();const{left:u,top:p,width:f,height:h}=e.getBoundingClientRect();if(i||t(),!f||!h)return;const v=ht(p),g=ht(o.clientWidth-(u+f)),m=ht(o.clientHeight-(p+h)),x=ht(u),w={rootMargin:-v+"px "+-g+"px "+-m+"px "+-x+"px",threshold:K(0,ge(1,l))||1};let y=!0;function C(S){const R=S[0].intersectionRatio;if(R!==l){if(!y)return c();R?c(!1,R):r=setTimeout(()=>{c(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return c(!0),s}function Qo(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=jn(e),p=o||s?[...u?Je(u):[],...Je(t)]:[];p.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const f=u&&i?Tl(u,n):null;let h=-1,v=null;c&&(v=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&v&&(v.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=v)==null||y.observe(t)})),n()}),u&&!l&&v.observe(u),v.observe(t));let g,m=l?Ne(e):null;l&&x();function x(){const b=Ne(e);m&&(b.x!==m.x||b.y!==m.y||b.width!==m.width||b.height!==m.height)&&n(),m=b,g=requestAnimationFrame(x)}return n(),()=>{var b;p.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),f==null||f(),(b=v)==null||b.disconnect(),v=null,l&&cancelAnimationFrame(g)}}const Jo=ul,es=ll,ts=al,ns=fl,rs=il,Cr=sl,os=dl,Ol=(e,t,n)=>{const r=new Map,o={platform:Al,...n},s={...o.platform,_c:r};return ol(e,t,{...o,platform:s})},ss=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Cr({element:r.current,padding:o}).fn(n):{}:r?Cr({element:r,padding:o}).fn(n):{}}}};var wt=typeof document<"u"?a.useLayoutEffect:a.useEffect;function Mt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Mt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Mt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function as(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Er(e,t){const n=as(e);return Math.round(t*n)/n}function Sr(e){const t=a.useRef(e);return wt(()=>{t.current=e}),t}function is(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:c}={},transform:i=!0,whileElementsMounted:l,open:u}=e,[p,f]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,v]=a.useState(r);Mt(h,r)||v(r);const[g,m]=a.useState(null),[x,b]=a.useState(null),w=a.useCallback(A=>{A!==R.current&&(R.current=A,m(A))},[]),y=a.useCallback(A=>{A!==E.current&&(E.current=A,b(A))},[]),C=s||g,S=c||x,R=a.useRef(null),E=a.useRef(null),N=a.useRef(p),T=l!=null,O=Sr(l),F=Sr(o),_=a.useCallback(()=>{if(!R.current||!E.current)return;const A={placement:t,strategy:n,middleware:h};F.current&&(A.platform=F.current),Ol(R.current,E.current,A).then($=>{const P={...$,isPositioned:!0};L.current&&!Mt(N.current,P)&&(N.current=P,_t.flushSync(()=>{f(P)}))})},[h,t,n,F]);wt(()=>{u===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[u]);const L=a.useRef(!1);wt(()=>(L.current=!0,()=>{L.current=!1}),[]),wt(()=>{if(C&&(R.current=C),S&&(E.current=S),C&&S){if(O.current)return O.current(C,S,_);_()}},[C,S,_,O,T]);const j=a.useMemo(()=>({reference:R,floating:E,setReference:w,setFloating:y}),[w,y]),D=a.useMemo(()=>({reference:C,floating:S}),[C,S]),I=a.useMemo(()=>{const A={position:n,left:0,top:0};if(!D.floating)return A;const $=Er(D.floating,p.x),P=Er(D.floating,p.y);return i?{...A,transform:"translate("+$+"px, "+P+"px)",...as(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:P}},[n,i,D.floating,p.x,p.y]);return a.useMemo(()=>({...p,update:_,refs:j,elements:D,floatingStyles:I}),[p,_,j,D,I])}var _l="Arrow",cs=a.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return d.jsx(ze.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});cs.displayName=_l;var Dl=cs;function Il(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),l=n.length;n=[...n,c];function u(f){const{scope:h,children:v,...g}=f,m=(h==null?void 0:h[e][l])||i,x=a.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:x,children:v})}function p(f,h){const v=(h==null?void 0:h[e][l])||i,g=a.useContext(v);if(g)return g;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,p]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,$l(o,...t)]}function $l(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((i,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function jl(e){const[t,n]=a.useState(void 0);return Fe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let c,i;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;c=u.inlineSize,i=u.blockSize}else c=e.offsetWidth,i=e.offsetHeight;n({width:c,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var kn="Popper",[us,ls]=Il(kn),[Ll,ds]=us(kn),fs=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.useState(null);return d.jsx(Ll,{scope:t,anchor:r,onAnchorChange:o,children:n})};fs.displayName=kn;var ps="PopperAnchor",ms=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=ds(ps,n),c=a.useRef(null),i=Me(t,c);return a.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||c.current)}),r?null:d.jsx(ze.div,{...o,ref:i})});ms.displayName=ps;var Fn="PopperContent",[kl,Fl]=us(Fn),hs=a.forwardRef((e,t)=>{var Y,fe,z,pe,Ye,Xe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:c=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:v="optimized",onPlaced:g,...m}=e,x=ds(Fn,n),[b,w]=a.useState(null),y=Me(t,J=>w(J)),[C,S]=a.useState(null),R=jl(C),E=(R==null?void 0:R.width)??0,N=(R==null?void 0:R.height)??0,T=r+(s!=="center"?"-"+s:""),O=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},F=Array.isArray(u)?u:[u],_=F.length>0,L={padding:O,boundary:F.filter(Ul),altBoundary:_},{refs:j,floatingStyles:D,placement:I,isPositioned:A,middlewareData:$}=is({strategy:"fixed",placement:T,whileElementsMounted:(...J)=>Qo(...J,{animationFrame:v==="always"}),elements:{reference:x.anchor},middleware:[Jo({mainAxis:o+N,alignmentAxis:c}),l&&es({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?os():void 0,...L}),l&&ts({...L}),ns({...L,apply:({elements:J,rects:qe,availableWidth:Gt,availableHeight:Kt})=>{const{width:Ht,height:Vt}=qe.reference,ae=J.floating.style;ae.setProperty("--radix-popper-available-width",`${Gt}px`),ae.setProperty("--radix-popper-available-height",`${Kt}px`),ae.setProperty("--radix-popper-anchor-width",`${Ht}px`),ae.setProperty("--radix-popper-anchor-height",`${Vt}px`)}}),C&&ss({element:C,padding:i}),Wl({arrowWidth:E,arrowHeight:N}),h&&rs({strategy:"referenceHidden",...L})]}),[P,W]=xs(I),B=Ge(g);Fe(()=>{A&&(B==null||B())},[A,B]);const V=(Y=$.arrow)==null?void 0:Y.x,ye=(fe=$.arrow)==null?void 0:fe.y,Ce=((z=$.arrow)==null?void 0:z.centerOffset)!==0,[Oe,se]=a.useState();return Fe(()=>{b&&se(window.getComputedStyle(b).zIndex)},[b]),d.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:A?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Oe,"--radix-popper-transform-origin":[(pe=$.transformOrigin)==null?void 0:pe.x,(Ye=$.transformOrigin)==null?void 0:Ye.y].join(" "),...((Xe=$.hide)==null?void 0:Xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(kl,{scope:n,placedSide:P,onArrowChange:S,arrowX:V,arrowY:ye,shouldHideArrow:Ce,children:d.jsx(ze.div,{"data-side":P,"data-align":W,...m,ref:y,style:{...m.style,animation:A?void 0:"none"}})})})});hs.displayName=Fn;var vs="PopperArrow",Bl={top:"bottom",right:"left",bottom:"top",left:"right"},gs=a.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=Fl(vs,r),c=Bl[s.placedSide];return d.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:d.jsx(Dl,{...o,ref:n,style:{...o.style,display:"block"}})})});gs.displayName=vs;function Ul(e){return e!==null}var Wl=e=>({name:"transformOrigin",options:e,fn(t){var x,b,w;const{placement:n,rects:r,middlewareData:o}=t,c=((x=o.arrow)==null?void 0:x.centerOffset)!==0,i=c?0:e.arrowWidth,l=c?0:e.arrowHeight,[u,p]=xs(n),f={start:"0%",center:"50%",end:"100%"}[p],h=(((b=o.arrow)==null?void 0:b.x)??0)+i/2,v=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let g="",m="";return u==="bottom"?(g=c?f:`${h}px`,m=`${-l}px`):u==="top"?(g=c?f:`${h}px`,m=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,m=c?f:`${v}px`):u==="left"&&(g=`${r.floating.width+l}px`,m=c?f:`${v}px`),{data:{x:g,y:m}}}});function xs(e){const[t,n="center"]=e.split("-");return[t,n]}var zl=fs,Gl=ms,Kl=hs,Hl=gs;function Vl(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var bs=e=>{const{present:t,children:n}=e,r=Yl(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),s=Me(r.ref,Xl(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:s}):null};bs.displayName="Presence";function Yl(e){const[t,n]=a.useState(),r=a.useRef({}),o=a.useRef(e),s=a.useRef("none"),c=e?"mounted":"unmounted",[i,l]=Vl(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=vt(r.current);s.current=i==="mounted"?u:"none"},[i]),Fe(()=>{const u=r.current,p=o.current;if(p!==e){const h=s.current,v=vt(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(p&&h!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Fe(()=>{if(t){let u;const p=t.ownerDocument.defaultView??window,f=v=>{const m=vt(r.current).includes(v.animationName);if(v.target===t&&m&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=v=>{v.target===t&&(s.current=vt(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:a.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function vt(e){return(e==null?void 0:e.animationName)||"none"}function Xl(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ql({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Zl({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:r,i=Ge(n),l=a.useCallback(u=>{if(s){const f=typeof u=="function"?u(e):u;f!==e&&i(f)}else o(u)},[s,e,o,i]);return[c,l]}function Zl({defaultProp:e,onChange:t}){const n=a.useState(e),[r]=n,o=a.useRef(r),s=Ge(t);return a.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var Ql=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Jl=Ql.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...c}=r,i=s?U:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),ed="VisuallyHidden",ws=a.forwardRef((e,t)=>d.jsx(Jl.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ws.displayName=ed;var td=ws,[jt,ah]=$u("Tooltip",[ls]),Lt=ls(),ys="TooltipProvider",nd=700,fn="tooltip.open",[rd,Bn]=jt(ys),Cs=e=>{const{__scopeTooltip:t,delayDuration:n=nd,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,[c,i]=a.useState(!0),l=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{const p=u.current;return()=>window.clearTimeout(p)},[]),d.jsx(rd,{scope:t,isOpenDelayed:c,delayDuration:n,onOpen:a.useCallback(()=>{window.clearTimeout(u.current),i(!1)},[]),onClose:a.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>i(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:a.useCallback(p=>{l.current=p},[]),disableHoverableContent:o,children:s})};Cs.displayName=ys;var kt="Tooltip",[od,Ft]=jt(kt),Es=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:c,delayDuration:i}=e,l=Bn(kt,e.__scopeTooltip),u=Lt(t),[p,f]=a.useState(null),h=Xu(),v=a.useRef(0),g=c??l.disableHoverableContent,m=i??l.delayDuration,x=a.useRef(!1),[b=!1,w]=ql({prop:r,defaultProp:o,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(fn))):l.onClose(),s==null||s(E)}}),y=a.useMemo(()=>b?x.current?"delayed-open":"instant-open":"closed",[b]),C=a.useCallback(()=>{window.clearTimeout(v.current),x.current=!1,w(!0)},[w]),S=a.useCallback(()=>{window.clearTimeout(v.current),w(!1)},[w]),R=a.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{x.current=!0,w(!0)},m)},[m,w]);return a.useEffect(()=>()=>window.clearTimeout(v.current),[]),d.jsx(zl,{...u,children:d.jsx(od,{scope:t,contentId:h,open:b,stateAttribute:y,trigger:p,onTriggerChange:f,onTriggerEnter:a.useCallback(()=>{l.isOpenDelayed?R():C()},[l.isOpenDelayed,R,C]),onTriggerLeave:a.useCallback(()=>{g?S():window.clearTimeout(v.current)},[S,g]),onOpen:C,onClose:S,disableHoverableContent:g,children:n})})};Es.displayName=kt;var pn="TooltipTrigger",Ss=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ft(pn,n),s=Bn(pn,n),c=Lt(n),i=a.useRef(null),l=Me(t,i,o.onTriggerChange),u=a.useRef(!1),p=a.useRef(!1),f=a.useCallback(()=>u.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),d.jsx(Gl,{asChild:!0,...c,children:d.jsx(ze.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:ie(e.onPointerMove,h=>{h.pointerType!=="touch"&&!p.current&&!s.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:ie(e.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:ie(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ie(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:ie(e.onBlur,o.onClose),onClick:ie(e.onClick,o.onClose)})})});Ss.displayName=pn;var sd="TooltipPortal",[ih,ad]=jt(sd,{forceMount:void 0}),Ue="TooltipContent",Rs=a.forwardRef((e,t)=>{const n=ad(Ue,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...s}=e,c=Ft(Ue,e.__scopeTooltip);return d.jsx(bs,{present:r||c.open,children:c.disableHoverableContent?d.jsx(Ns,{side:o,...s,ref:t}):d.jsx(id,{side:o,...s,ref:t})})}),id=a.forwardRef((e,t)=>{const n=Ft(Ue,e.__scopeTooltip),r=Bn(Ue,e.__scopeTooltip),o=a.useRef(null),s=Me(t,o),[c,i]=a.useState(null),{trigger:l,onClose:u}=n,p=o.current,{onPointerInTransitChange:f}=r,h=a.useCallback(()=>{i(null),f(!1)},[f]),v=a.useCallback((g,m)=>{const x=g.currentTarget,b={x:g.clientX,y:g.clientY},w=dd(b,x.getBoundingClientRect()),y=fd(b,w),C=pd(m.getBoundingClientRect()),S=hd([...y,...C]);i(S),f(!0)},[f]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(l&&p){const g=x=>v(x,p),m=x=>v(x,l);return l.addEventListener("pointerleave",g),p.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",g),p.removeEventListener("pointerleave",m)}}},[l,p,v,h]),a.useEffect(()=>{if(c){const g=m=>{const x=m.target,b={x:m.clientX,y:m.clientY},w=(l==null?void 0:l.contains(x))||(p==null?void 0:p.contains(x)),y=!md(b,c);w?h():y&&(h(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,p,c,u,h]),d.jsx(Ns,{...e,ref:s})}),[cd,ud]=jt(kt,{isInside:!1}),Ns=a.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:c,...i}=e,l=Ft(Ue,n),u=Lt(n),{onClose:p}=l;return a.useEffect(()=>(document.addEventListener(fn,p),()=>document.removeEventListener(fn,p)),[p]),a.useEffect(()=>{if(l.trigger){const f=h=>{const v=h.target;v!=null&&v.contains(l.trigger)&&p()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,p]),d.jsx(Wo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:f=>f.preventDefault(),onDismiss:p,children:d.jsxs(Kl,{"data-state":l.stateAttribute,...u,...i,ref:t,style:{...i.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:[d.jsx(ji,{children:r}),d.jsx(cd,{scope:n,isInside:!0,children:d.jsx(td,{id:l.contentId,role:"tooltip",children:o||r})})]})})});Rs.displayName=Ue;var Ps="TooltipArrow",ld=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Lt(n);return ud(Ps,n).isInside?null:d.jsx(Hl,{...o,...r,ref:t})});ld.displayName=Ps;function dd(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function fd(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function pd(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function md(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const i=t[s].x,l=t[s].y,u=t[c].x,p=t[c].y;l>r!=p>r&&n<(u-i)*(r-l)/(p-l)+i&&(o=!o)}return o}function hd(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),vd(t)}function vd(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],c=t[t.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],c=n[n.length-2];if((s.x-c.x)*(o.y-c.y)>=(s.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var gd=Cs,xd=Es,bd=Ss,Ms=Rs;const wd=gd,yd=xd,Cd=bd,As=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>d.jsx(Ms,{ref:r,sideOffset:t,className:M("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));As.displayName=Ms.displayName;const Ed="sidebar:state",Sd=60*60*24*7,Rd="16rem",Nd="18rem",Pd="3rem",Md="b",Ts=a.createContext(null);function ot(){const e=a.useContext(Ts);if(!e)throw new Error("useSidebar must be used within a Sidebar.");return e}const Os=a.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:s,...c},i)=>{const l=wc(),[u,p]=a.useState(!1),[f,h]=a.useState(e),v=t??f,g=a.useCallback(w=>{if(n)return n==null?void 0:n(typeof w=="function"?w(v):w);h(w),document.cookie=`${Ed}=${v}; path=/; max-age=${Sd}`},[n,v]),m=a.useCallback(()=>l?p(w=>!w):g(w=>!w),[l,g,p]);a.useEffect(()=>{const w=y=>{y.key===Md&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),m())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[m]);const x=v?"expanded":"collapsed",b=a.useMemo(()=>({state:x,open:v,setOpen:g,isMobile:l,openMobile:u,setOpenMobile:p,toggleSidebar:m}),[x,v,g,l,u,p,m]);return d.jsx(Ts.Provider,{value:b,children:d.jsx(wd,{delayDuration:0,children:d.jsx("div",{style:{"--sidebar-width":Rd,"--sidebar-width-icon":Pd,...o},className:M("group/sidebar-wrapper flex min-h-svh w-full text-sidebar-foreground has-[[data-variant=inset]]:bg-sidebar",r),ref:i,...c,children:s})})})});Os.displayName="SidebarProvider";const _s=a.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...s},c)=>{const{isMobile:i,state:l,openMobile:u,setOpenMobile:p}=ot();return n==="none"?d.jsx("div",{className:M("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:c,...s,children:o}):i?d.jsx(Mu,{open:u,onOpenChange:p,...s,children:d.jsx(Bo,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Nd},side:e,children:d.jsx("div",{className:"flex h-full w-full flex-col",children:o})})}):d.jsxs("div",{ref:c,className:"group peer hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[d.jsx("div",{className:M("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),d.jsx("div",{className:M("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...s,children:d.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:o})})]})});_s.displayName="Sidebar";const Ds=a.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:o}=ot();return d.jsxs(Ur,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:M("h-7 w-7",e),onClick:s=>{t==null||t(s),o()},...n,children:[d.jsx(Xi,{}),d.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});Ds.displayName="SidebarTrigger";const Ad=a.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=ot();return d.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:M("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});Ad.displayName="SidebarRail";const Is=a.forwardRef(({className:e,...t},n)=>d.jsx("main",{ref:n,className:M("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));Is.displayName="SidebarInset";const Td=a.forwardRef(({className:e,...t},n)=>d.jsx(Li,{ref:n,"data-sidebar":"input",className:M("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));Td.displayName="SidebarInput";const $s=a.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,"data-sidebar":"header",className:M("flex flex-col gap-2 p-2",e),...t}));$s.displayName="SidebarHeader";const js=a.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,"data-sidebar":"footer",className:M("flex flex-col gap-2 p-2",e),...t}));js.displayName="SidebarFooter";const Od=a.forwardRef(({className:e,...t},n)=>d.jsx(Nn,{ref:n,"data-sidebar":"separator",className:M("mx-2 w-auto bg-sidebar-border",e),...t}));Od.displayName="SidebarSeparator";const Ls=a.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,"data-sidebar":"content",className:M("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));Ls.displayName="SidebarContent";const Un=a.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,"data-sidebar":"group",className:M("relative flex w-full min-w-0 flex-col p-2",e),...t}));Un.displayName="SidebarGroup";const ks=a.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const o=t?U:"div";return d.jsx(o,{ref:r,"data-sidebar":"group-label",className:M("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});ks.displayName="SidebarGroupLabel";const _d=a.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const o=t?U:"button";return d.jsx(o,{ref:r,"data-sidebar":"group-action",className:M("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});_d.displayName="SidebarGroupAction";const Fs=a.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,"data-sidebar":"group-content",className:M("w-full text-sm",e),...t}));Fs.displayName="SidebarGroupContent";const st=a.forwardRef(({className:e,...t},n)=>d.jsx("ul",{ref:n,"data-sidebar":"menu",className:M("flex w-full min-w-0 flex-col gap-1",e),...t}));st.displayName="SidebarMenu";const at=a.forwardRef(({className:e,...t},n)=>d.jsx("li",{ref:n,"data-sidebar":"menu-item",className:M("group/menu-item relative",e),...t}));at.displayName="SidebarMenuItem";const Dd=Br("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),it=a.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:s,...c},i)=>{const l=e?U:"button",{isMobile:u,state:p}=ot(),f=d.jsx(l,{ref:i,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:M(Dd({variant:n,size:r}),s),...c});return o?(typeof o=="string"&&(o={children:o}),d.jsxs(yd,{children:[d.jsx(Cd,{asChild:!0,children:f}),d.jsx(As,{side:"right",align:"center",hidden:p!=="collapsed"||u,...o})]})):f});it.displayName="SidebarMenuButton";const Bs=a.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},o)=>{const s=t?U:"button";return d.jsx(s,{ref:o,"data-sidebar":"menu-action",className:M("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})});Bs.displayName="SidebarMenuAction";const Id=a.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:M("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));Id.displayName="SidebarMenuBadge";const $d=a.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const o=a.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return d.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:M("rounded-md h-8 flex gap-2 px-2 items-center",e),...n,children:[t&&d.jsx(pr,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),d.jsx(pr,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});$d.displayName="SidebarMenuSkeleton";const Us=a.forwardRef(({className:e,...t},n)=>d.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:M("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Us.displayName="SidebarMenuSub";const Ws=a.forwardRef(({...e},t)=>d.jsx("li",{ref:t,...e}));Ws.displayName="SidebarMenuSubItem";const zs=a.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...o},s)=>{const c=e?U:"a";return d.jsx(c,{ref:s,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:M("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...o})});zs.displayName="SidebarMenuSubButton";function jd({items:e}){return d.jsxs(Un,{children:[d.jsx(ks,{children:"Navigation"}),d.jsx(st,{children:e.map(t=>{var n,r;return d.jsx(gc,{asChild:!0,defaultOpen:t.isActive,children:d.jsxs(at,{children:[d.jsx(it,{asChild:!0,tooltip:t.title,children:d.jsxs("a",{href:t.url,children:[d.jsx(t.icon,{}),d.jsx("span",{children:t.title})]})}),(n=t.items)!=null&&n.length?d.jsxs(d.Fragment,{children:[d.jsx(xc,{asChild:!0,children:d.jsxs(Bs,{className:"data-[state=open]:rotate-90",children:[d.jsx(Qr,{}),d.jsx("span",{className:"sr-only",children:"Toggle"})]})}),d.jsx(bc,{children:d.jsx(Us,{children:(r=t.items)==null?void 0:r.map(o=>d.jsx(Ws,{children:d.jsx(zs,{asChild:!0,children:d.jsx(yt,{href:o.url,children:d.jsx("span",{children:o.title})})})},o.title))})})]}):null]})},t.title)})})]})}function Ld({items:e,...t}){return d.jsx(Un,{...t,children:d.jsx(Fs,{children:d.jsx(st,{children:e.map(n=>d.jsx(at,{children:d.jsx(it,{asChild:!0,size:"sm",children:d.jsxs("a",{href:n.url,children:[d.jsx(n.icon,{}),d.jsx("span",{children:n.title})]})})},n.title))})})})}function kd(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),l=n.length;n=[...n,c];const u=f=>{var b;const{scope:h,children:v,...g}=f,m=((b=h==null?void 0:h[e])==null?void 0:b[l])||i,x=a.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:x,children:v})};u.displayName=s+"Provider";function p(f,h){var m;const v=((m=h==null?void 0:h[e])==null?void 0:m[l])||i,g=a.useContext(v);if(g)return g;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,p]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Fd(o,...t)]}function Fd(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((i,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function Bd(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Gs=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},Ud=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Wn=Ud.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...c}=r,i=s?U:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),zn="Avatar",[Wd,ch]=kd(zn),[zd,Ks]=Wd(zn),Hs=a.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,s]=a.useState("idle");return d.jsx(zd,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:s,children:d.jsx(Wn.span,{...r,ref:t})})});Hs.displayName=zn;var Vs="AvatarImage",Ys=a.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...s}=e,c=Ks(Vs,n),i=Gd(r,s.referrerPolicy),l=Bd(u=>{o(u),c.onImageLoadingStatusChange(u)});return Gs(()=>{i!=="idle"&&l(i)},[i,l]),i==="loaded"?d.jsx(Wn.img,{...s,ref:t,src:r}):null});Ys.displayName=Vs;var Xs="AvatarFallback",qs=a.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,s=Ks(Xs,n),[c,i]=a.useState(r===void 0);return a.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>i(!0),r);return()=>window.clearTimeout(l)}},[r]),c&&s.imageLoadingStatus!=="loaded"?d.jsx(Wn.span,{...o,ref:t}):null});qs.displayName=Xs;function Gd(e,t){const[n,r]=a.useState("idle");return Gs(()=>{if(!e){r("error");return}let o=!0;const s=new window.Image,c=i=>()=>{o&&r(i)};return r("loading"),s.onload=c("loaded"),s.onerror=c("error"),s.src=e,t&&(s.referrerPolicy=t),()=>{o=!1}},[e,t]),n}var Zs=Hs,Qs=Ys,Js=qs;const mn=a.forwardRef(({className:e,...t},n)=>d.jsx(Zs,{ref:n,className:M("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));mn.displayName=Zs.displayName;const Kd=a.forwardRef(({className:e,...t},n)=>d.jsx(Qs,{ref:n,className:M("aspect-square h-full w-full",e),...t}));Kd.displayName=Qs.displayName;const hn=a.forwardRef(({className:e,...t},n)=>d.jsx(Js,{ref:n,className:M("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));hn.displayName=Js.displayName;function At(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Hd(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Vd(...e){return t=>e.forEach(n=>Hd(n,t))}function Yd(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),l=n.length;n=[...n,c];const u=f=>{var b;const{scope:h,children:v,...g}=f,m=((b=h==null?void 0:h[e])==null?void 0:b[l])||i,x=a.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:x,children:v})};u.displayName=s+"Provider";function p(f,h){var m;const v=((m=h==null?void 0:h[e])==null?void 0:m[l])||i,g=a.useContext(v);if(g)return g;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,p]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Xd(o,...t)]}function Xd(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((i,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function ea(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function qd({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Zd({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:r,i=ea(n),l=a.useCallback(u=>{if(s){const f=typeof u=="function"?u(e):u;f!==e&&i(f)}else o(u)},[s,e,o,i]);return[c,l]}function Zd({defaultProp:e,onChange:t}){const n=a.useState(e),[r]=n,o=a.useRef(r),s=ea(t);return a.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var Qd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Jd=Qd.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...c}=r,i=s?U:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ef(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),l=n.length;n=[...n,c];function u(f){const{scope:h,children:v,...g}=f,m=(h==null?void 0:h[e][l])||i,x=a.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:x,children:v})}function p(f,h){const v=(h==null?void 0:h[e][l])||i,g=a.useContext(v);if(g)return g;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,p]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,tf(o,...t)]}function tf(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((i,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function nf(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function rf(...e){return t=>e.forEach(n=>nf(n,t))}function Rr(...e){return a.useCallback(rf(...e),e)}function ta(e){const t=e+"CollectionProvider",[n,r]=ef(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=v=>{const{scope:g,children:m}=v,x=Ee.useRef(null),b=Ee.useRef(new Map).current;return d.jsx(o,{scope:g,itemMap:b,collectionRef:x,children:m})};c.displayName=t;const i=e+"CollectionSlot",l=Ee.forwardRef((v,g)=>{const{scope:m,children:x}=v,b=s(i,m),w=Rr(g,b.collectionRef);return d.jsx(U,{ref:w,children:x})});l.displayName=i;const u=e+"CollectionItemSlot",p="data-radix-collection-item",f=Ee.forwardRef((v,g)=>{const{scope:m,children:x,...b}=v,w=Ee.useRef(null),y=Rr(g,w),C=s(u,m);return Ee.useEffect(()=>(C.itemMap.set(w,{ref:w,...b}),()=>void C.itemMap.delete(w))),d.jsx(U,{[p]:"",ref:y,children:x})});f.displayName=u;function h(v){const g=s(e+"CollectionConsumer",v);return Ee.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${p}]`));return Array.from(g.itemMap.values()).sort((C,S)=>b.indexOf(C.ref.current)-b.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:c,Slot:l,ItemSlot:f},h,r]}function of(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function na(...e){return t=>e.forEach(n=>of(n,t))}function ne(...e){return a.useCallback(na(...e),e)}function sf(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),l=n.length;n=[...n,c];const u=f=>{var b;const{scope:h,children:v,...g}=f,m=((b=h==null?void 0:h[e])==null?void 0:b[l])||i,x=a.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:x,children:v})};u.displayName=s+"Provider";function p(f,h){var m;const v=((m=h==null?void 0:h[e])==null?void 0:m[l])||i,g=a.useContext(v);if(g)return g;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[u,p]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,af(o,...t)]}function af(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((i,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var cf=a.createContext(void 0);function uf(e){const t=a.useContext(cf);return e||t||"ltr"}var lf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Q=lf.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...c}=r,i=s?U:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ra(e,t){e&&_t.flushSync(()=>e.dispatchEvent(t))}function we(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function df(e,t=globalThis==null?void 0:globalThis.document){const n=we(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ff="DismissableLayer",vn="dismissableLayer.update",pf="dismissableLayer.pointerDownOutside",mf="dismissableLayer.focusOutside",Nr,oa=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sa=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:c,onDismiss:i,...l}=e,u=a.useContext(oa),[p,f]=a.useState(null),h=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=a.useState({}),g=ne(t,E=>f(E)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(x),w=p?m.indexOf(p):-1,y=u.layersWithOutsidePointerEventsDisabled.size>0,C=w>=b,S=gf(E=>{const N=E.target,T=[...u.branches].some(O=>O.contains(N));!C||T||(o==null||o(E),c==null||c(E),E.defaultPrevented||i==null||i())},h),R=xf(E=>{const N=E.target;[...u.branches].some(O=>O.contains(N))||(s==null||s(E),c==null||c(E),E.defaultPrevented||i==null||i())},h);return df(E=>{w===u.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&i&&(E.preventDefault(),i()))},h),a.useEffect(()=>{if(p)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Nr=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Pr(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Nr)}},[p,h,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Pr())},[p,u]),a.useEffect(()=>{const E=()=>v({});return document.addEventListener(vn,E),()=>document.removeEventListener(vn,E)},[]),d.jsx(Q.div,{...l,ref:g,style:{pointerEvents:y?C?"auto":"none":void 0,...e.style},onFocusCapture:k(e.onFocusCapture,R.onFocusCapture),onBlurCapture:k(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:k(e.onPointerDownCapture,S.onPointerDownCapture)})});sa.displayName=ff;var hf="DismissableLayerBranch",vf=a.forwardRef((e,t)=>{const n=a.useContext(oa),r=a.useRef(null),o=ne(t,r);return a.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),d.jsx(Q.div,{...e,ref:o})});vf.displayName=hf;function gf(e,t=globalThis==null?void 0:globalThis.document){const n=we(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const s=i=>{if(i.target&&!r.current){let l=function(){aa(pf,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function xf(e,t=globalThis==null?void 0:globalThis.document){const n=we(e),r=a.useRef(!1);return a.useEffect(()=>{const o=s=>{s.target&&!r.current&&aa(mf,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Pr(){const e=new CustomEvent(vn);document.dispatchEvent(e)}function aa(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ra(o,s):o.dispatchEvent(s)}var tn=0;function bf(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Mr()),document.body.insertAdjacentElement("beforeend",e[1]??Mr()),tn++,()=>{tn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),tn--}},[])}function Mr(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var nn="focusScope.autoFocusOnMount",rn="focusScope.autoFocusOnUnmount",Ar={bubbles:!1,cancelable:!0},wf="FocusScope",ia=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...c}=e,[i,l]=a.useState(null),u=we(o),p=we(s),f=a.useRef(null),h=ne(t,m=>l(m)),v=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let m=function(y){if(v.paused||!i)return;const C=y.target;i.contains(C)?f.current=C:he(f.current,{select:!0})},x=function(y){if(v.paused||!i)return;const C=y.relatedTarget;C!==null&&(i.contains(C)||he(f.current,{select:!0}))},b=function(y){if(document.activeElement===document.body)for(const S of y)S.removedNodes.length>0&&he(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const w=new MutationObserver(b);return i&&w.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),w.disconnect()}}},[r,i,v.paused]),a.useEffect(()=>{if(i){Or.add(v);const m=document.activeElement;if(!i.contains(m)){const b=new CustomEvent(nn,Ar);i.addEventListener(nn,u),i.dispatchEvent(b),b.defaultPrevented||(yf(Nf(ca(i)),{select:!0}),document.activeElement===m&&he(i))}return()=>{i.removeEventListener(nn,u),setTimeout(()=>{const b=new CustomEvent(rn,Ar);i.addEventListener(rn,p),i.dispatchEvent(b),b.defaultPrevented||he(m??document.body,{select:!0}),i.removeEventListener(rn,p),Or.remove(v)},0)}}},[i,u,p,v]);const g=a.useCallback(m=>{if(!n&&!r||v.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(x&&b){const w=m.currentTarget,[y,C]=Cf(w);y&&C?!m.shiftKey&&b===C?(m.preventDefault(),n&&he(y,{select:!0})):m.shiftKey&&b===y&&(m.preventDefault(),n&&he(C,{select:!0})):b===w&&m.preventDefault()}},[n,r,v.paused]);return d.jsx(Q.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});ia.displayName=wf;function yf(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(he(r,{select:t}),document.activeElement!==n)return}function Cf(e){const t=ca(e),n=Tr(t,e),r=Tr(t.reverse(),e);return[n,r]}function ca(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tr(e,t){for(const n of e)if(!Ef(n,{upTo:t}))return n}function Ef(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Sf(e){return e instanceof HTMLInputElement&&"select"in e}function he(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Sf(e)&&t&&e.select()}}var Or=Rf();function Rf(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_r(e,t),e.unshift(t)},remove(t){var n;e=_r(e,t),(n=e[0])==null||n.resume()}}}function _r(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Nf(e){return e.filter(t=>t.tagName!=="A")}var We=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},Pf="Arrow",ua=a.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return d.jsx(Q.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});ua.displayName=Pf;var Mf=ua;function Af(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),l=n.length;n=[...n,c];function u(f){const{scope:h,children:v,...g}=f,m=(h==null?void 0:h[e][l])||i,x=a.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:x,children:v})}function p(f,h){const v=(h==null?void 0:h[e][l])||i,g=a.useContext(v);if(g)return g;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,p]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,Tf(o,...t)]}function Tf(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((i,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}function Of(e){const[t,n]=a.useState(void 0);return We(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let c,i;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;c=u.inlineSize,i=u.blockSize}else c=e.offsetWidth,i=e.offsetHeight;n({width:c,height:i})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Gn="Popper",[la,da]=Af(Gn),[_f,fa]=la(Gn),pa=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.useState(null);return d.jsx(_f,{scope:t,anchor:r,onAnchorChange:o,children:n})};pa.displayName=Gn;var ma="PopperAnchor",ha=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=fa(ma,n),c=a.useRef(null),i=ne(t,c);return a.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||c.current)}),r?null:d.jsx(Q.div,{...o,ref:i})});ha.displayName=ma;var Kn="PopperContent",[Df,If]=la(Kn),va=a.forwardRef((e,t)=>{var Y,fe,z,pe,Ye,Xe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:c=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:v="optimized",onPlaced:g,...m}=e,x=fa(Kn,n),[b,w]=a.useState(null),y=ne(t,J=>w(J)),[C,S]=a.useState(null),R=Of(C),E=(R==null?void 0:R.width)??0,N=(R==null?void 0:R.height)??0,T=r+(s!=="center"?"-"+s:""),O=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},F=Array.isArray(u)?u:[u],_=F.length>0,L={padding:O,boundary:F.filter(jf),altBoundary:_},{refs:j,floatingStyles:D,placement:I,isPositioned:A,middlewareData:$}=is({strategy:"fixed",placement:T,whileElementsMounted:(...J)=>Qo(...J,{animationFrame:v==="always"}),elements:{reference:x.anchor},middleware:[Jo({mainAxis:o+N,alignmentAxis:c}),l&&es({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?os():void 0,...L}),l&&ts({...L}),ns({...L,apply:({elements:J,rects:qe,availableWidth:Gt,availableHeight:Kt})=>{const{width:Ht,height:Vt}=qe.reference,ae=J.floating.style;ae.setProperty("--radix-popper-available-width",`${Gt}px`),ae.setProperty("--radix-popper-available-height",`${Kt}px`),ae.setProperty("--radix-popper-anchor-width",`${Ht}px`),ae.setProperty("--radix-popper-anchor-height",`${Vt}px`)}}),C&&ss({element:C,padding:i}),Lf({arrowWidth:E,arrowHeight:N}),h&&rs({strategy:"referenceHidden",...L})]}),[P,W]=ba(I),B=we(g);We(()=>{A&&(B==null||B())},[A,B]);const V=(Y=$.arrow)==null?void 0:Y.x,ye=(fe=$.arrow)==null?void 0:fe.y,Ce=((z=$.arrow)==null?void 0:z.centerOffset)!==0,[Oe,se]=a.useState();return We(()=>{b&&se(window.getComputedStyle(b).zIndex)},[b]),d.jsx("div",{ref:j.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:A?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Oe,"--radix-popper-transform-origin":[(pe=$.transformOrigin)==null?void 0:pe.x,(Ye=$.transformOrigin)==null?void 0:Ye.y].join(" "),...((Xe=$.hide)==null?void 0:Xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(Df,{scope:n,placedSide:P,onArrowChange:S,arrowX:V,arrowY:ye,shouldHideArrow:Ce,children:d.jsx(Q.div,{"data-side":P,"data-align":W,...m,ref:y,style:{...m.style,animation:A?void 0:"none"}})})})});va.displayName=Kn;var ga="PopperArrow",$f={top:"bottom",right:"left",bottom:"top",left:"right"},xa=a.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=If(ga,r),c=$f[s.placedSide];return d.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:d.jsx(Mf,{...o,ref:n,style:{...o.style,display:"block"}})})});xa.displayName=ga;function jf(e){return e!==null}var Lf=e=>({name:"transformOrigin",options:e,fn(t){var x,b,w;const{placement:n,rects:r,middlewareData:o}=t,c=((x=o.arrow)==null?void 0:x.centerOffset)!==0,i=c?0:e.arrowWidth,l=c?0:e.arrowHeight,[u,p]=ba(n),f={start:"0%",center:"50%",end:"100%"}[p],h=(((b=o.arrow)==null?void 0:b.x)??0)+i/2,v=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let g="",m="";return u==="bottom"?(g=c?f:`${h}px`,m=`${-l}px`):u==="top"?(g=c?f:`${h}px`,m=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,m=c?f:`${v}px`):u==="left"&&(g=`${r.floating.width+l}px`,m=c?f:`${v}px`),{data:{x:g,y:m}}}});function ba(e){const[t,n="center"]=e.split("-");return[t,n]}var kf=pa,Ff=ha,Bf=va,Uf=xa,Wf="Portal",wa=a.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,s]=a.useState(!1);We(()=>s(!0),[]);const c=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return c?Fr.createPortal(d.jsx(Q.div,{...r,ref:t}),c):null});wa.displayName=Wf;function zf(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var ct=e=>{const{present:t,children:n}=e,r=Gf(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),s=ne(r.ref,Kf(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:s}):null};ct.displayName="Presence";function Gf(e){const[t,n]=a.useState(),r=a.useRef({}),o=a.useRef(e),s=a.useRef("none"),c=e?"mounted":"unmounted",[i,l]=zf(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const u=gt(r.current);s.current=i==="mounted"?u:"none"},[i]),We(()=>{const u=r.current,p=o.current;if(p!==e){const h=s.current,v=gt(u);e?l("MOUNT"):v==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(p&&h!==v?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),We(()=>{if(t){let u;const p=t.ownerDocument.defaultView??window,f=v=>{const m=gt(r.current).includes(v.animationName);if(v.target===t&&m&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=v=>{v.target===t&&(s.current=gt(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{p.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:a.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function gt(e){return(e==null?void 0:e.animationName)||"none"}function Kf(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Le(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Hf(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Vf(...e){return t=>e.forEach(n=>Hf(n,t))}function Yf(...e){return a.useCallback(Vf(...e),e)}function Xf(e,t=[]){let n=[];function r(s,c){const i=a.createContext(c),l=n.length;n=[...n,c];function u(f){const{scope:h,children:v,...g}=f,m=(h==null?void 0:h[e][l])||i,x=a.useMemo(()=>g,Object.values(g));return d.jsx(m.Provider,{value:x,children:v})}function p(f,h){const v=(h==null?void 0:h[e][l])||i,g=a.useContext(v);if(g)return g;if(c!==void 0)return c;throw new Error(`\`${f}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,p]}const o=()=>{const s=n.map(c=>a.createContext(c));return function(i){const l=(i==null?void 0:i[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return o.scopeName=e,[r,qf(o,...t)]}function qf(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const c=r.reduce((i,{useScope:l,scopeName:u})=>{const f=l(s)[`__scope${u}`];return{...i,...f}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var Zf=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},Qf=nt.useId||(()=>{}),Jf=0;function ep(e){const[t,n]=a.useState(Qf());return Zf(()=>{n(r=>r??String(Jf++))},[e]),t?`radix-${t}`:""}var tp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ya=tp.reduce((e,t)=>{const n=a.forwardRef((r,o)=>{const{asChild:s,...c}=r,i=s?U:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(i,{...c,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Hn(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function np({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=rp({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:r,i=Hn(n),l=a.useCallback(u=>{if(s){const f=typeof u=="function"?u(e):u;f!==e&&i(f)}else o(u)},[s,e,o,i]);return[c,l]}function rp({defaultProp:e,onChange:t}){const n=a.useState(e),[r]=n,o=a.useRef(r),s=Hn(t);return a.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}var op=a.createContext(void 0);function sp(e){const t=a.useContext(op);return e||t||"ltr"}var on="rovingFocusGroup.onEntryFocus",ap={bubbles:!1,cancelable:!0},Bt="RovingFocusGroup",[gn,Ca,ip]=ta(Bt),[cp,Ea]=Xf(Bt,[ip]),[up,lp]=cp(Bt),Sa=a.forwardRef((e,t)=>d.jsx(gn.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(gn.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(dp,{...e,ref:t})})}));Sa.displayName=Bt;var dp=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...f}=e,h=a.useRef(null),v=Yf(t,h),g=sp(s),[m=null,x]=np({prop:c,defaultProp:i,onChange:l}),[b,w]=a.useState(!1),y=Hn(u),C=Ca(n),S=a.useRef(!1),[R,E]=a.useState(0);return a.useEffect(()=>{const N=h.current;if(N)return N.addEventListener(on,y),()=>N.removeEventListener(on,y)},[y]),d.jsx(up,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:m,onItemFocus:a.useCallback(N=>x(N),[x]),onItemShiftTab:a.useCallback(()=>w(!0),[]),onFocusableItemAdd:a.useCallback(()=>E(N=>N+1),[]),onFocusableItemRemove:a.useCallback(()=>E(N=>N-1),[]),children:d.jsx(ya.div,{tabIndex:b||R===0?-1:0,"data-orientation":r,...f,ref:v,style:{outline:"none",...e.style},onMouseDown:Le(e.onMouseDown,()=>{S.current=!0}),onFocus:Le(e.onFocus,N=>{const T=!S.current;if(N.target===N.currentTarget&&T&&!b){const O=new CustomEvent(on,ap);if(N.currentTarget.dispatchEvent(O),!O.defaultPrevented){const F=C().filter(I=>I.focusable),_=F.find(I=>I.active),L=F.find(I=>I.id===m),D=[_,L,...F].filter(Boolean).map(I=>I.ref.current);Pa(D,p)}}S.current=!1}),onBlur:Le(e.onBlur,()=>w(!1))})})}),Ra="RovingFocusGroupItem",Na=a.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...c}=e,i=ep(),l=s||i,u=lp(Ra,n),p=u.currentTabStopId===l,f=Ca(n),{onFocusableItemAdd:h,onFocusableItemRemove:v}=u;return a.useEffect(()=>{if(r)return h(),()=>v()},[r,h,v]),d.jsx(gn.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:d.jsx(ya.span,{tabIndex:p?0:-1,"data-orientation":u.orientation,...c,ref:t,onMouseDown:Le(e.onMouseDown,g=>{r?u.onItemFocus(l):g.preventDefault()}),onFocus:Le(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Le(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){u.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const m=mp(g,u.orientation,u.dir);if(m!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=f().filter(w=>w.focusable).map(w=>w.ref.current);if(m==="last")b.reverse();else if(m==="prev"||m==="next"){m==="prev"&&b.reverse();const w=b.indexOf(g.currentTarget);b=u.loop?hp(b,w+1):b.slice(w+1)}setTimeout(()=>Pa(b))}})})})});Na.displayName=Ra;var fp={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function pp(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mp(e,t,n){const r=pp(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return fp[r]}function Pa(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function hp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var vp=Sa,gp=Na,Ma=Wr(),sn=function(){},Ut=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:sn,onWheelCapture:sn,onTouchMoveCapture:sn}),o=r[0],s=r[1],c=e.forwardProps,i=e.children,l=e.className,u=e.removeScrollBar,p=e.enabled,f=e.shards,h=e.sideCar,v=e.noIsolation,g=e.inert,m=e.allowPinchZoom,x=e.as,b=x===void 0?"div":x,w=e.gapMode,y=zr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,S=Gr([n,t]),R=X(X({},y),o);return a.createElement(a.Fragment,null,p&&a.createElement(C,{sideCar:Ma,removeScrollBar:u,shards:f,noIsolation:v,inert:g,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:w}),c?a.cloneElement(a.Children.only(i),X(X({},R),{ref:S})):a.createElement(b,X({},R,{className:l,ref:S}),i))});Ut.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ut.classNames={fullWidth:Kr,zeroRight:Hr};var xn=!1;if(typeof window<"u")try{var xt=Object.defineProperty({},"passive",{get:function(){return xn=!0,!0}});window.addEventListener("test",xt,xt),window.removeEventListener("test",xt,xt)}catch{xn=!1}var Ie=xn?{passive:!1}:!1,xp=function(e){return e.tagName==="TEXTAREA"},Aa=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!xp(e)&&n[t]==="visible")},bp=function(e){return Aa(e,"overflowY")},wp=function(e){return Aa(e,"overflowX")},Dr=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Ta(e,r);if(o){var s=Oa(e,r),c=s[1],i=s[2];if(c>i)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yp=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Cp=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Ta=function(e,t){return e==="v"?bp(t):wp(t)},Oa=function(e,t){return e==="v"?yp(t):Cp(t)},Ep=function(e,t){return e==="h"&&t==="rtl"?-1:1},Sp=function(e,t,n,r,o){var s=Ep(e,window.getComputedStyle(t).direction),c=s*r,i=n.target,l=t.contains(i),u=!1,p=c>0,f=0,h=0;do{var v=Oa(e,i),g=v[0],m=v[1],x=v[2],b=m-x-s*g;(g||b)&&Ta(e,i)&&(f+=b,h+=g),i instanceof ShadowRoot?i=i.host:i=i.parentNode}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(p&&(Math.abs(f)<1||!o)||!p&&(Math.abs(h)<1||!o))&&(u=!0),u},bt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ir=function(e){return[e.deltaX,e.deltaY]},$r=function(e){return e&&"current"in e?e.current:e},Rp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Np=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},Pp=0,$e=[];function Mp(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(Pp++)[0],s=a.useState(Vr)[0],c=a.useRef(e);a.useEffect(function(){c.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Yr([e.lockRef.current],(e.shards||[]).map($r),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=a.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!c.current.allowPinchZoom;var b=bt(m),w=n.current,y="deltaX"in m?m.deltaX:w[0]-b[0],C="deltaY"in m?m.deltaY:w[1]-b[1],S,R=m.target,E=Math.abs(y)>Math.abs(C)?"h":"v";if("touches"in m&&E==="h"&&R.type==="range")return!1;var N=Dr(E,R);if(!N)return!0;if(N?S=E:(S=E==="v"?"h":"v",N=Dr(E,R)),!N)return!1;if(!r.current&&"changedTouches"in m&&(y||C)&&(r.current=S),!S)return!0;var T=r.current||S;return Sp(T,x,m,T==="h"?y:C,!0)},[]),l=a.useCallback(function(m){var x=m;if(!(!$e.length||$e[$e.length-1]!==s)){var b="deltaY"in x?Ir(x):bt(x),w=t.current.filter(function(S){return S.name===x.type&&(S.target===x.target||x.target===S.shadowParent)&&Rp(S.delta,b)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var y=(c.current.shards||[]).map($r).filter(Boolean).filter(function(S){return S.contains(x.target)}),C=y.length>0?i(x,y[0]):!c.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),u=a.useCallback(function(m,x,b,w){var y={name:m,delta:x,target:b,should:w,shadowParent:Ap(b)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(C){return C!==y})},1)},[]),p=a.useCallback(function(m){n.current=bt(m),r.current=void 0},[]),f=a.useCallback(function(m){u(m.type,Ir(m),m.target,i(m,e.lockRef.current))},[]),h=a.useCallback(function(m){u(m.type,bt(m),m.target,i(m,e.lockRef.current))},[]);a.useEffect(function(){return $e.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Ie),document.addEventListener("touchmove",l,Ie),document.addEventListener("touchstart",p,Ie),function(){$e=$e.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,Ie),document.removeEventListener("touchmove",l,Ie),document.removeEventListener("touchstart",p,Ie)}},[]);var v=e.removeScrollBar,g=e.inert;return a.createElement(a.Fragment,null,g?a.createElement(s,{styles:Np(o)}):null,v?a.createElement(Xr,{gapMode:e.gapMode}):null)}function Ap(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Tp=qr(Ma,Mp);var _a=a.forwardRef(function(e,t){return a.createElement(Ut,X({},e,{ref:t,sideCar:Tp}))});_a.classNames=Ut.classNames;var bn=["Enter"," "],Op=["ArrowDown","PageUp","Home"],Da=["ArrowUp","PageDown","End"],_p=[...Op,...Da],Dp={ltr:[...bn,"ArrowRight"],rtl:[...bn,"ArrowLeft"]},Ip={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ut="Menu",[et,$p,jp]=ta(ut),[Ae,Ia]=sf(ut,[jp,da,Ea]),Wt=da(),$a=Ea(),[Lp,Te]=Ae(ut),[kp,lt]=Ae(ut),ja=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:c=!0}=e,i=Wt(t),[l,u]=a.useState(null),p=a.useRef(!1),f=we(s),h=uf(o);return a.useEffect(()=>{const v=()=>{p.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>p.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),d.jsx(kf,{...i,children:d.jsx(Lp,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:d.jsx(kp,{scope:t,onClose:a.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:h,modal:c,children:r})})})};ja.displayName=ut;var Fp="MenuAnchor",Vn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Wt(n);return d.jsx(Ff,{...o,...r,ref:t})});Vn.displayName=Fp;var Yn="MenuPortal",[Bp,La]=Ae(Yn,{forceMount:void 0}),ka=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Te(Yn,t);return d.jsx(Bp,{scope:t,forceMount:n,children:d.jsx(ct,{present:n||s.open,children:d.jsx(wa,{asChild:!0,container:o,children:r})})})};ka.displayName=Yn;var q="MenuContent",[Up,Xn]=Ae(q),Fa=a.forwardRef((e,t)=>{const n=La(q,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Te(q,e.__scopeMenu),c=lt(q,e.__scopeMenu);return d.jsx(et.Provider,{scope:e.__scopeMenu,children:d.jsx(ct,{present:r||s.open,children:d.jsx(et.Slot,{scope:e.__scopeMenu,children:c.modal?d.jsx(Wp,{...o,ref:t}):d.jsx(zp,{...o,ref:t})})})})}),Wp=a.forwardRef((e,t)=>{const n=Te(q,e.__scopeMenu),r=a.useRef(null),o=ne(t,r);return a.useEffect(()=>{const s=r.current;if(s)return Zr(s)},[]),d.jsx(qn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:k(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),zp=a.forwardRef((e,t)=>{const n=Te(q,e.__scopeMenu);return d.jsx(qn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),qn=a.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:i,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:v,disableOutsideScroll:g,...m}=e,x=Te(q,n),b=lt(q,n),w=Wt(n),y=$a(n),C=$p(n),[S,R]=a.useState(null),E=a.useRef(null),N=ne(t,E,x.onContentChange),T=a.useRef(0),O=a.useRef(""),F=a.useRef(0),_=a.useRef(null),L=a.useRef("right"),j=a.useRef(0),D=g?_a:a.Fragment,I=g?{as:U,allowPinchZoom:!0}:void 0,A=P=>{var Y,fe;const W=O.current+P,B=C().filter(z=>!z.disabled),V=document.activeElement,ye=(Y=B.find(z=>z.ref.current===V))==null?void 0:Y.textValue,Ce=B.map(z=>z.textValue),Oe=tm(Ce,W,ye),se=(fe=B.find(z=>z.textValue===Oe))==null?void 0:fe.ref.current;(function z(pe){O.current=pe,window.clearTimeout(T.current),pe!==""&&(T.current=window.setTimeout(()=>z(""),1e3))})(W),se&&setTimeout(()=>se.focus())};a.useEffect(()=>()=>window.clearTimeout(T.current),[]),bf();const $=a.useCallback(P=>{var B,V;return L.current===((B=_.current)==null?void 0:B.side)&&rm(P,(V=_.current)==null?void 0:V.area)},[]);return d.jsx(Up,{scope:n,searchRef:O,onItemEnter:a.useCallback(P=>{$(P)&&P.preventDefault()},[$]),onItemLeave:a.useCallback(P=>{var W;$(P)||((W=E.current)==null||W.focus(),R(null))},[$]),onTriggerLeave:a.useCallback(P=>{$(P)&&P.preventDefault()},[$]),pointerGraceTimerRef:F,onPointerGraceIntentChange:a.useCallback(P=>{_.current=P},[]),children:d.jsx(D,{...I,children:d.jsx(ia,{asChild:!0,trapped:o,onMountAutoFocus:k(s,P=>{var W;P.preventDefault(),(W=E.current)==null||W.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:d.jsx(sa,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:v,children:d.jsx(vp,{asChild:!0,...y,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:R,onEntryFocus:k(l,P=>{b.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(Bf,{role:"menu","aria-orientation":"vertical","data-state":ti(x.open),"data-radix-menu-content":"",dir:b.dir,...w,...m,ref:N,style:{outline:"none",...m.style},onKeyDown:k(m.onKeyDown,P=>{const B=P.target.closest("[data-radix-menu-content]")===P.currentTarget,V=P.ctrlKey||P.altKey||P.metaKey,ye=P.key.length===1;B&&(P.key==="Tab"&&P.preventDefault(),!V&&ye&&A(P.key));const Ce=E.current;if(P.target!==Ce||!_p.includes(P.key))return;P.preventDefault();const se=C().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);Da.includes(P.key)&&se.reverse(),Jp(se)}),onBlur:k(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(T.current),O.current="")}),onPointerMove:k(e.onPointerMove,tt(P=>{const W=P.target,B=j.current!==P.clientX;if(P.currentTarget.contains(W)&&B){const V=P.clientX>j.current?"right":"left";L.current=V,j.current=P.clientX}}))})})})})})})});Fa.displayName=q;var Gp="MenuGroup",Zn=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(Q.div,{role:"group",...r,ref:t})});Zn.displayName=Gp;var Kp="MenuLabel",Ba=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(Q.div,{...r,ref:t})});Ba.displayName=Kp;var Tt="MenuItem",jr="menu.itemSelect",zt=a.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=a.useRef(null),c=lt(Tt,e.__scopeMenu),i=Xn(Tt,e.__scopeMenu),l=ne(t,s),u=a.useRef(!1),p=()=>{const f=s.current;if(!n&&f){const h=new CustomEvent(jr,{bubbles:!0,cancelable:!0});f.addEventListener(jr,v=>r==null?void 0:r(v),{once:!0}),ra(f,h),h.defaultPrevented?u.current=!1:c.onClose()}};return d.jsx(Ua,{...o,ref:l,disabled:n,onClick:k(e.onClick,p),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:k(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:k(e.onKeyDown,f=>{const h=i.searchRef.current!=="";n||h&&f.key===" "||bn.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});zt.displayName=Tt;var Ua=a.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,c=Xn(Tt,n),i=$a(n),l=a.useRef(null),u=ne(t,l),[p,f]=a.useState(!1),[h,v]=a.useState("");return a.useEffect(()=>{const g=l.current;g&&v((g.textContent??"").trim())},[s.children]),d.jsx(et.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:d.jsx(gp,{asChild:!0,...i,focusable:!r,children:d.jsx(Q.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:k(e.onPointerMove,tt(g=>{r?c.onItemLeave(g):(c.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:k(e.onPointerLeave,tt(g=>c.onItemLeave(g))),onFocus:k(e.onFocus,()=>f(!0)),onBlur:k(e.onBlur,()=>f(!1))})})})}),Hp="MenuCheckboxItem",Wa=a.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return d.jsx(Va,{scope:e.__scopeMenu,checked:n,children:d.jsx(zt,{role:"menuitemcheckbox","aria-checked":Ot(n)?"mixed":n,...o,ref:t,"data-state":Jn(n),onSelect:k(o.onSelect,()=>r==null?void 0:r(Ot(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Wa.displayName=Hp;var za="MenuRadioGroup",[Vp,Yp]=Ae(za,{value:void 0,onValueChange:()=>{}}),Ga=a.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=we(r);return d.jsx(Vp,{scope:e.__scopeMenu,value:n,onValueChange:s,children:d.jsx(Zn,{...o,ref:t})})});Ga.displayName=za;var Ka="MenuRadioItem",Ha=a.forwardRef((e,t)=>{const{value:n,...r}=e,o=Yp(Ka,e.__scopeMenu),s=n===o.value;return d.jsx(Va,{scope:e.__scopeMenu,checked:s,children:d.jsx(zt,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Jn(s),onSelect:k(r.onSelect,()=>{var c;return(c=o.onValueChange)==null?void 0:c.call(o,n)},{checkForDefaultPrevented:!1})})})});Ha.displayName=Ka;var Qn="MenuItemIndicator",[Va,Xp]=Ae(Qn,{checked:!1}),Ya=a.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=Xp(Qn,n);return d.jsx(ct,{present:r||Ot(s.checked)||s.checked===!0,children:d.jsx(Q.span,{...o,ref:t,"data-state":Jn(s.checked)})})});Ya.displayName=Qn;var qp="MenuSeparator",Xa=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(Q.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Xa.displayName=qp;var Zp="MenuArrow",qa=a.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Wt(n);return d.jsx(Uf,{...o,...r,ref:t})});qa.displayName=Zp;var Qp="MenuSub",[uh,Za]=Ae(Qp),Ze="MenuSubTrigger",Qa=a.forwardRef((e,t)=>{const n=Te(Ze,e.__scopeMenu),r=lt(Ze,e.__scopeMenu),o=Za(Ze,e.__scopeMenu),s=Xn(Ze,e.__scopeMenu),c=a.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},p=a.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return a.useEffect(()=>p,[p]),a.useEffect(()=>{const f=i.current;return()=>{window.clearTimeout(f),l(null)}},[i,l]),d.jsx(Vn,{asChild:!0,...u,children:d.jsx(Ua,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":ti(n.open),...e,ref:na(t,o.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:k(e.onPointerMove,tt(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(s.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:k(e.onPointerLeave,tt(f=>{var v,g;p();const h=(v=n.content)==null?void 0:v.getBoundingClientRect();if(h){const m=(g=n.content)==null?void 0:g.dataset.side,x=m==="right",b=x?-5:5,w=h[x?"left":"right"],y=h[x?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+b,y:f.clientY},{x:w,y:h.top},{x:y,y:h.top},{x:y,y:h.bottom},{x:w,y:h.bottom}],side:m}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:k(e.onKeyDown,f=>{var v;const h=s.searchRef.current!=="";e.disabled||h&&f.key===" "||Dp[r.dir].includes(f.key)&&(n.onOpenChange(!0),(v=n.content)==null||v.focus(),f.preventDefault())})})})});Qa.displayName=Ze;var Ja="MenuSubContent",ei=a.forwardRef((e,t)=>{const n=La(q,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=Te(q,e.__scopeMenu),c=lt(q,e.__scopeMenu),i=Za(Ja,e.__scopeMenu),l=a.useRef(null),u=ne(t,l);return d.jsx(et.Provider,{scope:e.__scopeMenu,children:d.jsx(ct,{present:r||s.open,children:d.jsx(et.Slot,{scope:e.__scopeMenu,children:d.jsx(qn,{id:i.contentId,"aria-labelledby":i.triggerId,...o,ref:u,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var f;c.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:k(e.onFocusOutside,p=>{p.target!==i.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:k(e.onEscapeKeyDown,p=>{c.onClose(),p.preventDefault()}),onKeyDown:k(e.onKeyDown,p=>{var v;const f=p.currentTarget.contains(p.target),h=Ip[c.dir].includes(p.key);f&&h&&(s.onOpenChange(!1),(v=i.trigger)==null||v.focus(),p.preventDefault())})})})})})});ei.displayName=Ja;function ti(e){return e?"open":"closed"}function Ot(e){return e==="indeterminate"}function Jn(e){return Ot(e)?"indeterminate":e?"checked":"unchecked"}function Jp(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function em(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function tm(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let c=em(e,Math.max(s,0));o.length===1&&(c=c.filter(u=>u!==n));const l=c.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function nm(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,c=t.length-1;s<t.length;c=s++){const i=t[s].x,l=t[s].y,u=t[c].x,p=t[c].y;l>r!=p>r&&n<(u-i)*(r-l)/(p-l)+i&&(o=!o)}return o}function rm(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return nm(n,t)}function tt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var om=ja,sm=Vn,am=ka,im=Fa,cm=Zn,um=Ba,lm=zt,dm=Wa,fm=Ga,pm=Ha,mm=Ya,hm=Xa,vm=qa,gm=Qa,xm=ei,bm=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},wm=nt.useId||(()=>{}),ym=0;function Lr(e){const[t,n]=a.useState(wm());return bm(()=>{e||n(r=>r??String(ym++))},[e]),e||(t?`radix-${t}`:"")}var er="DropdownMenu",[Cm,lh]=Yd(er,[Ia]),G=Ia(),[Em,ni]=Cm(er),ri=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:c,modal:i=!0}=e,l=G(t),u=a.useRef(null),[p=!1,f]=qd({prop:o,defaultProp:s,onChange:c});return d.jsx(Em,{scope:t,triggerId:Lr(),triggerRef:u,contentId:Lr(),open:p,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(h=>!h),[f]),modal:i,children:d.jsx(om,{...l,open:p,onOpenChange:f,dir:r,modal:i,children:n})})};ri.displayName=er;var oi="DropdownMenuTrigger",si=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=ni(oi,n),c=G(n);return d.jsx(sm,{asChild:!0,...c,children:d.jsx(Jd.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Vd(t,s.triggerRef),onPointerDown:At(e.onPointerDown,i=>{!r&&i.button===0&&i.ctrlKey===!1&&(s.onOpenToggle(),s.open||i.preventDefault())}),onKeyDown:At(e.onKeyDown,i=>{r||(["Enter"," "].includes(i.key)&&s.onOpenToggle(),i.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});si.displayName=oi;var Sm="DropdownMenuPortal",ai=e=>{const{__scopeDropdownMenu:t,...n}=e,r=G(t);return d.jsx(am,{...r,...n})};ai.displayName=Sm;var ii="DropdownMenuContent",ci=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=ni(ii,n),s=G(n),c=a.useRef(!1);return d.jsx(im,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:At(e.onCloseAutoFocus,i=>{var l;c.current||(l=o.triggerRef.current)==null||l.focus(),c.current=!1,i.preventDefault()}),onInteractOutside:At(e.onInteractOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,p=l.button===2||u;(!o.modal||p)&&(c.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)"}})});ci.displayName=ii;var Rm="DropdownMenuGroup",ui=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(cm,{...o,...r,ref:t})});ui.displayName=Rm;var Nm="DropdownMenuLabel",li=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(um,{...o,...r,ref:t})});li.displayName=Nm;var Pm="DropdownMenuItem",di=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(lm,{...o,...r,ref:t})});di.displayName=Pm;var Mm="DropdownMenuCheckboxItem",fi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(dm,{...o,...r,ref:t})});fi.displayName=Mm;var Am="DropdownMenuRadioGroup",Tm=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(fm,{...o,...r,ref:t})});Tm.displayName=Am;var Om="DropdownMenuRadioItem",pi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(pm,{...o,...r,ref:t})});pi.displayName=Om;var _m="DropdownMenuItemIndicator",mi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(mm,{...o,...r,ref:t})});mi.displayName=_m;var Dm="DropdownMenuSeparator",hi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(hm,{...o,...r,ref:t})});hi.displayName=Dm;var Im="DropdownMenuArrow",$m=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(vm,{...o,...r,ref:t})});$m.displayName=Im;var jm="DropdownMenuSubTrigger",vi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(gm,{...o,...r,ref:t})});vi.displayName=jm;var Lm="DropdownMenuSubContent",gi=a.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=G(n);return d.jsx(xm,{...o,...r,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)"}})});gi.displayName=Lm;var km=ri,Fm=si,Bm=ai,xi=ci,Um=ui,bi=li,wi=di,yi=fi,Ci=pi,Ei=mi,Si=hi,Ri=vi,Ni=gi;const Pi=km,Mi=Fm,Wm=Um,zm=a.forwardRef(({className:e,inset:t,children:n,...r},o)=>d.jsxs(Ri,{ref:o,className:M("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,d.jsx(Qr,{className:"ml-auto h-4 w-4"})]}));zm.displayName=Ri.displayName;const Gm=a.forwardRef(({className:e,...t},n)=>d.jsx(Ni,{ref:n,className:M("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",e),...t}));Gm.displayName=Ni.displayName;const tr=a.forwardRef(({className:e,sideOffset:t=4,...n},r)=>d.jsx(Bm,{children:d.jsx(xi,{ref:r,sideOffset:t,className:M("z-50 min-w-[8rem] overflow-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",e),...n})}));tr.displayName=xi.displayName;const ke=a.forwardRef(({className:e,inset:t,...n},r)=>d.jsx(wi,{ref:r,className:M("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]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));ke.displayName=wi.displayName;const Km=a.forwardRef(({className:e,children:t,checked:n,...r},o)=>d.jsxs(yi,{ref:o,className:M("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,...r,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(Ei,{children:d.jsx(Fi,{className:"h-4 w-4"})})}),t]}));Km.displayName=yi.displayName;const Hm=a.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(Ci,{ref:r,className:M("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:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(Ei,{children:d.jsx(zi,{className:"h-2 w-2 fill-current"})})}),t]}));Hm.displayName=Ci.displayName;const Ai=a.forwardRef(({className:e,inset:t,...n},r)=>d.jsx(bi,{ref:r,className:M("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Ai.displayName=bi.displayName;const wn=a.forwardRef(({className:e,...t},n)=>d.jsx(Si,{ref:n,className:M("-mx-1 my-1 h-px bg-muted",e),...t}));wn.displayName=Si.displayName;function Vm({user:e}){const{isMobile:t}=ot();return d.jsx(st,{children:d.jsx(at,{children:d.jsxs(Pi,{children:[d.jsx(Mi,{asChild:!0,children:d.jsxs(it,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[d.jsx(mn,{className:"h-8 w-8 rounded-lg",children:d.jsx(hn,{className:"rounded-lg",children:"CN"})}),d.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[d.jsx("span",{className:"truncate font-semibold",children:e.name}),d.jsx("span",{className:"truncate text-xs",children:e.email})]}),d.jsx(Wi,{className:"ml-auto size-4"})]})}),d.jsxs(tr,{className:"w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg",side:t?"bottom":"right",align:"end",sideOffset:4,children:[d.jsx(Ai,{className:"p-0 font-normal",children:d.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[d.jsx(mn,{className:"h-8 w-8 rounded-lg",children:d.jsx(hn,{className:"rounded-lg",children:"AC"})}),d.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[d.jsx("span",{className:"truncate font-semibold",children:e.name}),d.jsx("span",{className:"truncate text-xs",children:e.email})]})]})}),d.jsx(wn,{}),d.jsx(Wm,{children:d.jsx(ke,{asChild:!0,children:d.jsxs(yt,{href:route("profile.edit"),children:[d.jsx(Ui,{}),"Edit Profile"]})})}),d.jsx(wn,{}),d.jsx(ke,{asChild:!0,children:d.jsxs(yt,{className:"w-full",href:route("logout"),method:"post",as:"button",children:[d.jsx(Vi,{}),"Log out"]})})]})]})})})}const kr={user:{name:"shadcn",email:"m@example.com",avatar:"/avatars/shadcn.jpg"},navMain:[{title:"Dashboard",url:"/dashboard",icon:Bi},{title:"Projects",url:"#",icon:Zi,isActive:!0,items:[{title:"History",url:"#"}]},{title:"Design Engineering",url:"#",icon:Ki}],navSecondary:[{title:"Support",url:"#",icon:Hi},{title:"Feedback",url:"#",icon:qi}]};function Ym({...e}){const{auth:t}=Ii().props;return d.jsxs(_s,{variant:"inset",...e,children:[d.jsx($s,{children:d.jsx(st,{children:d.jsx(at,{children:d.jsx(it,{size:"lg",asChild:!0,children:d.jsxs(yt,{href:route("dashboard"),children:[d.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground",children:d.jsx(Gi,{className:"size-4"})}),d.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[d.jsx("span",{className:"truncate font-semibold",children:"Acme Inc"}),d.jsx("span",{className:"truncate text-xs",children:"Enterprise"})]})]})})})})}),d.jsxs(Ls,{children:[d.jsx(jd,{items:kr.navMain}),d.jsx(Ld,{items:kr.navSecondary,className:"mt-auto"})]}),d.jsx(js,{children:d.jsx(Vm,{user:t.user})})]})}const Ti=a.forwardRef(({...e},t)=>d.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));Ti.displayName="Breadcrumb";const Oi=a.forwardRef(({className:e,...t},n)=>d.jsx("ol",{ref:n,className:M("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));Oi.displayName="BreadcrumbList";const _i=a.forwardRef(({className:e,...t},n)=>d.jsx("li",{ref:n,className:M("inline-flex items-center gap-1.5",e),...t}));_i.displayName="BreadcrumbItem";const Xm=a.forwardRef(({asChild:e,className:t,...n},r)=>{const o=e?U:"a";return d.jsx(o,{ref:r,className:M("transition-colors hover:text-foreground",t),...n})});Xm.displayName="BreadcrumbLink";const Di=a.forwardRef(({className:e,...t},n)=>d.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:M("font-normal text-foreground",e),...t}));Di.displayName="BreadcrumbPage";const qm=()=>{const{setTheme:e,theme:t}=$i();return d.jsxs(Pi,{children:[d.jsx(Mi,{asChild:!0,children:d.jsxs(Ur,{variant:"ghost",size:"icon",className:M("h-7 w-7"),children:[t=="light"?d.jsx(Qi,{}):d.jsx(Yi,{}),d.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),d.jsxs(tr,{align:"end",children:[d.jsx(ke,{onClick:()=>e("light"),children:"Light"}),d.jsx(ke,{onClick:()=>e("dark"),children:"Dark"}),d.jsx(ke,{onClick:()=>e("system"),children:"System"})]})]})},Zm=qm;function dh({header:e,children:t}){return d.jsxs(Os,{children:[d.jsx(Ym,{}),d.jsxs(Is,{children:[d.jsxs("header",{className:"sticky top-0 bg-background flex h-16 shrink-0 items-center gap-2 justify-between p-4 border-b md:border-none md:rounded-xl",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Ds,{className:"-ml-1"}),d.jsx(Nn,{orientation:"vertical",className:"mr-2 h-4"}),d.jsx(Ti,{children:d.jsx(Oi,{children:d.jsx(_i,{children:d.jsx(Di,{children:e})})})})]}),d.jsx("div",{children:d.jsx(Zm,{})})]}),d.jsx("main",{className:"p-4 md:pt-0 h-full",children:t})]})]})}export{dh as A};
