import{r as c,j as p,R as Jn,a as ft}from"./vendor-react-CVHocMAO.js";import{_ as Pe,a as gr,b as uc}from"./vendor-amplify-BttVyssp.js";function S(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Ho(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function eo(...e){return t=>{let n=!1;const o=e.map(r=>{const s=Ho(r,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let r=0;r<o.length;r++){const s=o[r];typeof s=="function"?s():Ho(e[r],null)}}}}function O(...e){return c.useCallback(eo(...e),e)}function Z(e,t=[]){let n=[];function o(s,a){const i=c.createContext(a);i.displayName=s+"Context";const l=n.length;n=[...n,a];const f=u=>{var y;const{scope:m,children:h,...x}=u,v=((y=m==null?void 0:m[e])==null?void 0:y[l])||i,w=c.useMemo(()=>x,Object.values(x));return p.jsx(v.Provider,{value:w,children:h})};f.displayName=s+"Provider";function d(u,m){var v;const h=((v=m==null?void 0:m[e])==null?void 0:v[l])||i,x=c.useContext(h);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${s}\``)}return[f,d]}const r=()=>{const s=n.map(a=>c.createContext(a));return function(i){const l=(i==null?void 0:i[e])||s;return c.useMemo(()=>({[`__scope${e}`]:{...i,[e]:l}}),[i,l])}};return r.scopeName=e,[o,dc(r,...t)]}function dc(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(s){const a=o.reduce((i,{useScope:l,scopeName:f})=>{const u=l(s)[`__scope${f}`];return{...i,...u}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Ae(e){const t=c.forwardRef((n,o)=>{let{children:r,...s}=n,a=null,i=!1;const l=[];Go(r)&&typeof _t=="function"&&(r=_t(r._payload)),c.Children.forEach(r,m=>{var h;if(hc(m)){i=!0;const x=m;let v="child"in x.props?x.props.child:x.props.children;Go(v)&&typeof _t=="function"&&(v=_t(v._payload)),a=pc(x,v),l.push((h=a==null?void 0:a.props)==null?void 0:h.children)}else l.push(m)}),a?a=c.cloneElement(a,void 0,l):!i&&c.Children.count(r)===1&&c.isValidElement(r)&&(a=r);const f=a?vc(a):void 0,d=O(o,f);if(!a){if(r||r===0)throw new Error(i?yc(e):wc(e));return r}const u=mc(s,a.props??{});return a.type!==c.Fragment&&(u.ref=o?d:f),c.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var av=Ae("Slot"),xr=Symbol.for("radix.slottable");function fc(e){const t=n=>"child"in n?n.children(n.child):n.children;return t.displayName=`${e}.Slottable`,t.__radixId=xr,t}var pc=(e,t)=>{if("child"in e.props){const n=e.props.child;return c.isValidElement(n)?c.cloneElement(n,void 0,e.props.children(n.props.children)):null}return c.isValidElement(t)?t:null};function mc(e,t){const n={...t};for(const o in t){const r=e[o],s=t[o];/^on[A-Z]/.test(o)?r&&s?n[o]=(...i)=>{const l=s(...i);return r(...i),l}:r&&(n[o]=r):o==="style"?n[o]={...r,...s}:o==="className"&&(n[o]=[r,s].filter(Boolean).join(" "))}return{...e,...n}}function vc(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function hc(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xr}var gc=Symbol.for("react.lazy");function Go(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===gc&&"_payload"in e&&xc(e._payload)}function xc(e){return typeof e=="object"&&e!==null&&"then"in e}var wc=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,yc=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,_t=Jn[" use ".trim().toString()],bc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],A=bc.reduce((e,t)=>{const n=Ae(`Primitive.${t}`),o=c.forwardRef((r,s)=>{const{asChild:a,...i}=r,l=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...i,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function wr(e,t){e&&ft.flushSync(()=>e.dispatchEvent(t))}function ue(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function Cc(e,t=globalThis==null?void 0:globalThis.document){const n=ue(e);c.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var Rc="DismissableLayer",Ln="dismissableLayer.update",Sc="dismissableLayer.pointerDownOutside",Ec="dismissableLayer.focusOutside",Ko,to=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Je=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:i,onDismiss:l,...f}=e,d=c.useContext(to),[u,m]=c.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=c.useState({}),v=O(t,T=>m(T)),w=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=w.indexOf(y),b=u?w.indexOf(u):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,R=b>=g,E=c.useRef(!1),_=Tc(T=>{const k=T.target;if(!(k instanceof Node))return;const j=[...d.branches].some(N=>N.contains(k));!R||j||(s==null||s(T),i==null||i(T),T.defaultPrevented||l==null||l())},{ownerDocument:h,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:d.dismissableSurfaces}),M=Ic(T=>{if(o&&E.current)return;const k=T.target;[...d.branches].some(N=>N.contains(k))||(a==null||a(T),i==null||i(T),T.defaultPrevented||l==null||l())},h);return Cc(T=>{b===d.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},h),c.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ko=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),Uo(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(u),d.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=Ko))}},[u,h,n,d]),c.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),Uo())},[u,d]),c.useEffect(()=>{const T=()=>x({});return document.addEventListener(Ln,T),()=>document.removeEventListener(Ln,T)},[]),p.jsx(A.div,{...f,ref:v,style:{pointerEvents:C?R?"auto":"none":void 0,...e.style},onFocusCapture:S(e.onFocusCapture,M.onFocusCapture),onBlurCapture:S(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:S(e.onPointerDownCapture,_.onPointerDownCapture)})});Je.displayName=Rc;var Pc="DismissableLayerBranch",_c=c.forwardRef((e,t)=>{const n=c.useContext(to),o=c.useRef(null),r=O(t,o);return c.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),p.jsx(A.div,{...e,ref:r})});_c.displayName=Pc;function Ac(){const e=c.useContext(to),[t,n]=c.useState(null);return c.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function Tc(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:s}=t,a=ue(e),i=c.useRef(!1),l=c.useRef(!1),f=c.useRef(new Map),d=c.useRef(()=>{});return c.useEffect(()=>{function u(){l.current=!1,r.current=!1,f.current.clear()}function m(){return Array.from(f.current.values()).some(Boolean)}function h(g){if(!l.current)return;const b=g.target;b instanceof Node&&[...s].some(R=>R.contains(b))||f.current.set(g.type,!0),g.type==="click"&&window.setTimeout(()=>{l.current&&d.current()},0)}function x(g){l.current&&f.current.set(g.type,!1)}const v=g=>{if(g.target&&!i.current){let b=function(){n.removeEventListener("click",d.current);const R=m();u(),R||yr(Sc,a,C,{discrete:!0})};const C={originalEvent:g};l.current=!0,r.current=o&&g.button===0,f.current.clear(),!o||g.button!==0?b():(n.removeEventListener("click",d.current),d.current=b,n.addEventListener("click",d.current,{once:!0}))}else n.removeEventListener("click",d.current),u();i.current=!1},w=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const g of w)n.addEventListener(g,h,!0),n.addEventListener(g,x);const y=window.setTimeout(()=>{n.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(y),n.removeEventListener("pointerdown",v),n.removeEventListener("click",d.current);for(const g of w)n.removeEventListener(g,h,!0),n.removeEventListener(g,x)}},[n,a,o,r,s]),{onPointerDownCapture:()=>i.current=!0}}function Ic(e,t=globalThis==null?void 0:globalThis.document){const n=ue(e),o=c.useRef(!1);return c.useEffect(()=>{const r=s=>{s.target&&!o.current&&yr(Ec,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Uo(){const e=new CustomEvent(Ln);document.dispatchEvent(e)}function yr(e,t,n,{discrete:o}){const r=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?wr(r,s):r.dispatchEvent(s)}var q=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Mc=Jn[" useId ".trim().toString()]||(()=>{}),Nc=0;function te(e){const[t,n]=c.useState(Mc());return q(()=>{n(o=>o??String(Nc++))},[e]),e||(t?`radix-${t}`:"")}const Dc=["top","right","bottom","left"],Te=Math.min,re=Math.max,$t=Math.round,At=Math.floor,xe=e=>({x:e,y:e}),Oc={left:"right",right:"left",bottom:"top",top:"bottom"};function Fn(e,t,n){return re(e,Te(t,n))}function be(e,t){return typeof e=="function"?e(t):e}function Ce(e){return e.split("-")[0]}function et(e){return e.split("-")[1]}function no(e){return e==="x"?"y":"x"}function oo(e){return e==="y"?"height":"width"}function ge(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ro(e){return no(ge(e))}function kc(e,t,n){n===void 0&&(n=!1);const o=et(e),r=ro(e),s=oo(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Bt(a)),[a,Bt(a)]}function jc(e){const t=Bt(e);return[$n(e),t,$n(t)]}function $n(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Wo=["left","right"],zo=["right","left"],Lc=["top","bottom"],Fc=["bottom","top"];function $c(e,t,n){switch(e){case"top":case"bottom":return n?t?zo:Wo:t?Wo:zo;case"left":case"right":return t?Lc:Fc;default:return[]}}function Bc(e,t,n,o){const r=et(e);let s=$c(Ce(e),n==="start",o);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map($n)))),s}function Bt(e){const t=Ce(e);return Oc[t]+e.slice(t.length)}function Vc(e){return{top:0,right:0,bottom:0,left:0,...e}}function br(e){return typeof e!="number"?Vc(e):{top:e,right:e,bottom:e,left:e}}function Vt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Yo(e,t,n){let{reference:o,floating:r}=e;const s=ge(t),a=ro(t),i=oo(a),l=Ce(t),f=s==="y",d=o.x+o.width/2-r.width/2,u=o.y+o.height/2-r.height/2,m=o[i]/2-r[i]/2;let h;switch(l){case"top":h={x:d,y:o.y-r.height};break;case"bottom":h={x:d,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:u};break;case"left":h={x:o.x-r.width,y:u};break;default:h={x:o.x,y:o.y}}switch(et(t)){case"start":h[a]-=m*(n&&f?-1:1);break;case"end":h[a]+=m*(n&&f?-1:1);break}return h}async function Hc(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:a,elements:i,strategy:l}=e,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:m=!1,padding:h=0}=be(t,e),x=br(h),w=i[m?u==="floating"?"reference":"floating":u],y=Vt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:f,rootBoundary:d,strategy:l})),g=u==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(i.floating)),C=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},R=Vt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:g,offsetParent:b,strategy:l}):g);return{top:(y.top-R.top+x.top)/C.y,bottom:(R.bottom-y.bottom+x.bottom)/C.y,left:(y.left-R.left+x.left)/C.x,right:(R.right-y.right+x.right)/C.x}}const Gc=50,Kc=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:Hc},l=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:u}=Yo(f,o,l),m=o,h=0;const x={};for(let v=0;v<s.length;v++){const w=s[v];if(!w)continue;const{name:y,fn:g}=w,{x:b,y:C,data:R,reset:E}=await g({x:d,y:u,initialPlacement:o,placement:m,strategy:r,middlewareData:x,rects:f,platform:i,elements:{reference:e,floating:t}});d=b??d,u=C??u,x[y]={...x[y],...R},E&&h<Gc&&(h++,typeof E=="object"&&(E.placement&&(m=E.placement),E.rects&&(f=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):E.rects),{x:d,y:u}=Yo(f,m,l)),v=-1)}return{x:d,y:u,placement:m,strategy:r,middlewareData:x}},Uc=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:a,elements:i,middlewareData:l}=t,{element:f,padding:d=0}=be(e,t)||{};if(f==null)return{};const u=br(d),m={x:n,y:o},h=ro(r),x=oo(h),v=await a.getDimensions(f),w=h==="y",y=w?"top":"left",g=w?"bottom":"right",b=w?"clientHeight":"clientWidth",C=s.reference[x]+s.reference[h]-m[h]-s.floating[x],R=m[h]-s.reference[h],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let _=E?E[b]:0;(!_||!await(a.isElement==null?void 0:a.isElement(E)))&&(_=i.floating[b]||s.floating[x]);const M=C/2-R/2,T=_/2-v[x]/2-1,k=Te(u[y],T),j=Te(u[g],T),N=k,$=_-v[x]-j,F=_/2-v[x]/2+M,H=Fn(N,F,$),L=!l.arrow&&et(r)!=null&&F!==H&&s.reference[x]/2-(F<N?k:j)-v[x]/2<0,B=L?F<N?F-N:F-$:0;return{[h]:m[h]+B,data:{[h]:H,centerOffset:F-H-B,...L&&{alignmentOffset:B}},reset:L}}}),Wc=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:a,initialPlacement:i,platform:l,elements:f}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...w}=be(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Ce(r),g=ge(i),b=Ce(i)===i,C=await(l.isRTL==null?void 0:l.isRTL(f.floating)),R=m||(b||!v?[Bt(i)]:jc(i)),E=x!=="none";!m&&E&&R.push(...Bc(i,v,x,C));const _=[i,...R],M=await l.detectOverflow(t,w),T=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&T.push(M[y]),u){const F=kc(r,a,C);T.push(M[F[0]],M[F[1]])}if(k=[...k,{placement:r,overflows:T}],!T.every(F=>F<=0)){var j,N;const F=(((j=s.flip)==null?void 0:j.index)||0)+1,H=_[F];if(H&&(!(u==="alignment"?g!==ge(H):!1)||k.every(I=>ge(I.placement)===g?I.overflows[0]>0:!0)))return{data:{index:F,overflows:k},reset:{placement:H}};let L=(N=k.filter(B=>B.overflows[0]<=0).sort((B,I)=>B.overflows[1]-I.overflows[1])[0])==null?void 0:N.placement;if(!L)switch(h){case"bestFit":{var $;const B=($=k.filter(I=>{if(E){const P=ge(I.placement);return P===g||P==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(P=>P>0).reduce((P,V)=>P+V,0)]).sort((I,P)=>I[1]-P[1])[0])==null?void 0:$[0];B&&(L=B);break}case"initialPlacement":L=i;break}if(r!==L)return{reset:{placement:L}}}return{}}}};function Xo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function qo(e){return Dc.some(t=>e[t]>=0)}const zc=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...s}=be(e,t);switch(r){case"referenceHidden":{const a=await o.detectOverflow(t,{...s,elementContext:"reference"}),i=Xo(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:qo(i)}}}case"escaped":{const a=await o.detectOverflow(t,{...s,altBoundary:!0}),i=Xo(a,n.floating);return{data:{escapedOffsets:i,escaped:qo(i)}}}default:return{}}}}},Cr=new Set(["left","top"]);async function Yc(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=Ce(n),i=et(n),l=ge(n)==="y",f=Cr.has(a)?-1:1,d=s&&l?-1:1,u=be(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:x}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return i&&typeof x=="number"&&(h=i==="end"?x*-1:x),l?{x:h*d,y:m*f}:{x:m*f,y:h*d}}const Xc=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:a,middlewareData:i}=t,l=await Yc(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(o=i.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:s+l.y,data:{...l,placement:a}}}}},qc=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:s}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:y=>{let{x:g,y:b}=y;return{x:g,y:b}}},...f}=be(e,t),d={x:n,y:o},u=await s.detectOverflow(t,f),m=ge(Ce(r)),h=no(m);let x=d[h],v=d[m];if(a){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",b=x+u[y],C=x-u[g];x=Fn(b,x,C)}if(i){const y=m==="y"?"top":"left",g=m==="y"?"bottom":"right",b=v+u[y],C=v-u[g];v=Fn(b,v,C)}const w=l.fn({...t,[h]:x,[m]:v});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[h]:a,[m]:i}}}}}},Zc=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:a}=t,{offset:i=0,mainAxis:l=!0,crossAxis:f=!0}=be(e,t),d={x:n,y:o},u=ge(r),m=no(u);let h=d[m],x=d[u];const v=be(i,t),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const b=m==="y"?"height":"width",C=s.reference[m]-s.floating[b]+w.mainAxis,R=s.reference[m]+s.reference[b]-w.mainAxis;h<C?h=C:h>R&&(h=R)}if(f){var y,g;const b=m==="y"?"width":"height",C=Cr.has(Ce(r)),R=s.reference[u]-s.floating[b]+(C&&((y=a.offset)==null?void 0:y[u])||0)+(C?0:w.crossAxis),E=s.reference[u]+s.reference[b]+(C?0:((g=a.offset)==null?void 0:g[u])||0)-(C?w.crossAxis:0);x<R?x=R:x>E&&(x=E)}return{[m]:h,[u]:x}}}},Qc=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:a,elements:i}=t,{apply:l=()=>{},...f}=be(e,t),d=await a.detectOverflow(t,f),u=Ce(r),m=et(r),h=ge(r)==="y",{width:x,height:v}=s.floating;let w,y;u==="top"||u==="bottom"?(w=u,y=m===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(y=u,w=m==="end"?"top":"bottom");const g=v-d.top-d.bottom,b=x-d.left-d.right,C=Te(v-d[w],g),R=Te(x-d[y],b),E=!t.middlewareData.shift;let _=C,M=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(_=g),E&&!m){const k=re(d.left,0),j=re(d.right,0),N=re(d.top,0),$=re(d.bottom,0);h?M=x-2*(k!==0||j!==0?k+j:re(d.left,d.right)):_=v-2*(N!==0||$!==0?N+$:re(d.top,d.bottom))}await l({...t,availableWidth:M,availableHeight:_});const T=await a.getDimensions(i.floating);return x!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function Xt(){return typeof window<"u"}function tt(e){return Rr(e)?(e.nodeName||"").toLowerCase():"#document"}function se(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function we(e){var t;return(t=(Rr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Rr(e){return Xt()?e instanceof Node||e instanceof se(e).Node:!1}function de(e){return Xt()?e instanceof Element||e instanceof se(e).Element:!1}function Re(e){return Xt()?e instanceof HTMLElement||e instanceof se(e).HTMLElement:!1}function Zo(e){return!Xt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof se(e).ShadowRoot}function pt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function Jc(e){return/^(table|td|th)$/.test(tt(e))}function qt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const el=/transform|translate|scale|rotate|perspective|filter/,tl=/paint|layout|strict|content/,je=e=>!!e&&e!=="none";let _n;function so(e){const t=de(e)?fe(e):e;return je(t.transform)||je(t.translate)||je(t.scale)||je(t.rotate)||je(t.perspective)||!ao()&&(je(t.backdropFilter)||je(t.filter))||el.test(t.willChange||"")||tl.test(t.contain||"")}function nl(e){let t=Ie(e);for(;Re(t)&&!Xe(t);){if(so(t))return t;if(qt(t))return null;t=Ie(t)}return null}function ao(){return _n==null&&(_n=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_n}function Xe(e){return/^(html|body|#document)$/.test(tt(e))}function fe(e){return se(e).getComputedStyle(e)}function Zt(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ie(e){if(tt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zo(e)&&e.host||we(e);return Zo(t)?t.host:t}function Sr(e){const t=Ie(e);return Xe(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&pt(t)?t:Sr(t)}function ct(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Sr(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=se(r);if(s){const i=Bn(a);return t.concat(a,a.visualViewport||[],pt(r)?r:[],i&&n?ct(i):[])}else return t.concat(r,ct(r,[],n))}function Bn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Er(e){const t=fe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Re(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,i=$t(n)!==s||$t(o)!==a;return i&&(n=s,o=a),{width:n,height:o,$:i}}function io(e){return de(e)?e:e.contextElement}function ze(e){const t=io(e);if(!Re(t))return xe(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Er(t);let a=(s?$t(n.width):n.width)/o,i=(s?$t(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const ol=xe(0);function Pr(e){const t=se(e);return!ao()||!t.visualViewport?ol:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==se(e)?!1:t}function Le(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=io(e);let a=xe(1);t&&(o?de(o)&&(a=ze(o)):a=ze(e));const i=rl(s,n,o)?Pr(s):xe(0);let l=(r.left+i.x)/a.x,f=(r.top+i.y)/a.y,d=r.width/a.x,u=r.height/a.y;if(s){const m=se(s),h=o&&de(o)?se(o):o;let x=m,v=Bn(x);for(;v&&o&&h!==x;){const w=ze(v),y=v.getBoundingClientRect(),g=fe(v),b=y.left+(v.clientLeft+parseFloat(g.paddingLeft))*w.x,C=y.top+(v.clientTop+parseFloat(g.paddingTop))*w.y;l*=w.x,f*=w.y,d*=w.x,u*=w.y,l+=b,f+=C,x=se(v),v=Bn(x)}}return Vt({width:d,height:u,x:l,y:f})}function Qt(e,t){const n=Zt(e).scrollLeft;return t?t.left+n:Le(we(e)).left+n}function _r(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Qt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function sl(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",a=we(o),i=t?qt(t.floating):!1;if(o===a||i&&s)return n;let l={scrollLeft:0,scrollTop:0},f=xe(1);const d=xe(0),u=Re(o);if((u||!u&&!s)&&((tt(o)!=="body"||pt(a))&&(l=Zt(o)),u)){const h=Le(o);f=ze(o),d.x=h.x+o.clientLeft,d.y=h.y+o.clientTop}const m=a&&!u&&!s?_r(a,l):xe(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+d.x+m.x,y:n.y*f.y-l.scrollTop*f.y+d.y+m.y}}function al(e){return Array.from(e.getClientRects())}function il(e){const t=we(e),n=Zt(e),o=e.ownerDocument.body,r=re(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=re(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Qt(e);const i=-n.scrollTop;return fe(o).direction==="rtl"&&(a+=re(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:i}}const Qo=25;function cl(e,t){const n=se(e),o=we(e),r=n.visualViewport;let s=o.clientWidth,a=o.clientHeight,i=0,l=0;if(r){s=r.width,a=r.height;const d=ao();(!d||d&&t==="fixed")&&(i=r.offsetLeft,l=r.offsetTop)}const f=Qt(o);if(f<=0){const d=o.ownerDocument,u=d.body,m=getComputedStyle(u),h=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(o.clientWidth-u.clientWidth-h);x<=Qo&&(s-=x)}else f<=Qo&&(s+=f);return{width:s,height:a,x:i,y:l}}function ll(e,t){const n=Le(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Re(e)?ze(e):xe(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,l=r*s.x,f=o*s.y;return{width:a,height:i,x:l,y:f}}function Jo(e,t,n){let o;if(t==="viewport")o=cl(e,n);else if(t==="document")o=il(we(e));else if(de(t))o=ll(t,n);else{const r=Pr(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Vt(o)}function Ar(e,t){const n=Ie(e);return n===t||!de(n)||Xe(n)?!1:fe(n).position==="fixed"||Ar(n,t)}function ul(e,t){const n=t.get(e);if(n)return n;let o=ct(e,[],!1).filter(i=>de(i)&&tt(i)!=="body"),r=null;const s=fe(e).position==="fixed";let a=s?Ie(e):e;for(;de(a)&&!Xe(a);){const i=fe(a),l=so(a);!l&&i.position==="fixed"&&(r=null),(s?!l&&!r:!l&&i.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||pt(a)&&!l&&Ar(e,a))?o=o.filter(d=>d!==a):r=i,a=Ie(a)}return t.set(e,o),o}function dl(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?qt(t)?[]:ul(t,this._c):[].concat(n),o],i=Jo(t,a[0],r);let l=i.top,f=i.right,d=i.bottom,u=i.left;for(let m=1;m<a.length;m++){const h=Jo(t,a[m],r);l=re(h.top,l),f=Te(h.right,f),d=Te(h.bottom,d),u=re(h.left,u)}return{width:f-u,height:d-l,x:u,y:l}}function fl(e){const{width:t,height:n}=Er(e);return{width:t,height:n}}function pl(e,t,n){const o=Re(t),r=we(t),s=n==="fixed",a=Le(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const l=xe(0);function f(){l.x=Qt(r)}if(o||!o&&!s)if((tt(t)!=="body"||pt(r))&&(i=Zt(t)),o){const h=Le(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else r&&f();s&&!o&&r&&f();const d=r&&!o&&!s?_r(r,i):xe(0),u=a.left+i.scrollLeft-l.x-d.x,m=a.top+i.scrollTop-l.y-d.y;return{x:u,y:m,width:a.width,height:a.height}}function An(e){return fe(e).position==="static"}function er(e,t){if(!Re(e)||fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return we(e)===n&&(n=n.ownerDocument.body),n}function Tr(e,t){const n=se(e);if(qt(e))return n;if(!Re(e)){let r=Ie(e);for(;r&&!Xe(r);){if(de(r)&&!An(r))return r;r=Ie(r)}return n}let o=er(e,t);for(;o&&Jc(o)&&An(o);)o=er(o,t);return o&&Xe(o)&&An(o)&&!so(o)?n:o||nl(e)||n}const ml=async function(e){const t=this.getOffsetParent||Tr,n=this.getDimensions,o=await n(e.floating);return{reference:pl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function vl(e){return fe(e).direction==="rtl"}const hl={convertOffsetParentRelativeRectToViewportRelativeRect:sl,getDocumentElement:we,getClippingRect:dl,getOffsetParent:Tr,getElementRects:ml,getClientRects:al,getDimensions:fl,getScale:ze,isElement:de,isRTL:vl};function Ir(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gl(e,t){let n=null,o;const r=we(e);function s(){var i;clearTimeout(o),(i=n)==null||i.disconnect(),n=null}function a(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),s();const f=e.getBoundingClientRect(),{left:d,top:u,width:m,height:h}=f;if(i||t(),!m||!h)return;const x=At(u),v=At(r.clientWidth-(d+m)),w=At(r.clientHeight-(u+h)),y=At(d),b={rootMargin:-x+"px "+-v+"px "+-w+"px "+-y+"px",threshold:re(0,Te(1,l))||1};let C=!0;function R(E){const _=E[0].intersectionRatio;if(_!==l){if(!C)return a();_?a(!1,_):o=setTimeout(()=>{a(!1,1e-7)},1e3)}_===1&&!Ir(f,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(R,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(R,b)}n.observe(e)}return a(!0),s}function xl(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=io(e),d=r||s?[...f?ct(f):[],...t?ct(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const u=f&&i?gl(f,n):null;let m=-1,h=null;a&&(h=new ResizeObserver(y=>{let[g]=y;g&&g.target===f&&h&&t&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),f&&!l&&h.observe(f),t&&h.observe(t));let x,v=l?Le(e):null;l&&w();function w(){const y=Le(e);v&&!Ir(v,y)&&n(),v=y,x=requestAnimationFrame(w)}return n(),()=>{var y;d.forEach(g=>{r&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),u==null||u(),(y=h)==null||y.disconnect(),h=null,l&&cancelAnimationFrame(x)}}const wl=Xc,yl=qc,bl=Wc,Cl=Qc,Rl=zc,tr=Uc,Sl=Zc,El=(e,t,n)=>{const o=new Map,r={platform:hl,...n},s={...r.platform,_c:o};return Kc(e,t,{...r,platform:s})};var Pl=typeof document<"u",_l=function(){},kt=Pl?c.useLayoutEffect:_l;function Ht(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Ht(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Ht(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Mr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nr(e,t){const n=Mr(e);return Math.round(t*n)/n}function Tn(e){const t=c.useRef(e);return kt(()=>{t.current=e}),t}function Al(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:a}={},transform:i=!0,whileElementsMounted:l,open:f}=e,[d,u]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=c.useState(o);Ht(m,o)||h(o);const[x,v]=c.useState(null),[w,y]=c.useState(null),g=c.useCallback(I=>{I!==E.current&&(E.current=I,v(I))},[]),b=c.useCallback(I=>{I!==_.current&&(_.current=I,y(I))},[]),C=s||x,R=a||w,E=c.useRef(null),_=c.useRef(null),M=c.useRef(d),T=l!=null,k=Tn(l),j=Tn(r),N=Tn(f),$=c.useCallback(()=>{if(!E.current||!_.current)return;const I={placement:t,strategy:n,middleware:m};j.current&&(I.platform=j.current),El(E.current,_.current,I).then(P=>{const V={...P,isPositioned:N.current!==!1};F.current&&!Ht(M.current,V)&&(M.current=V,ft.flushSync(()=>{u(V)}))})},[m,t,n,j,N]);kt(()=>{f===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,u(I=>({...I,isPositioned:!1})))},[f]);const F=c.useRef(!1);kt(()=>(F.current=!0,()=>{F.current=!1}),[]),kt(()=>{if(C&&(E.current=C),R&&(_.current=R),C&&R){if(k.current)return k.current(C,R,$);$()}},[C,R,$,k,T]);const H=c.useMemo(()=>({reference:E,floating:_,setReference:g,setFloating:b}),[g,b]),L=c.useMemo(()=>({reference:C,floating:R}),[C,R]),B=c.useMemo(()=>{const I={position:n,left:0,top:0};if(!L.floating)return I;const P=nr(L.floating,d.x),V=nr(L.floating,d.y);return i?{...I,transform:"translate("+P+"px, "+V+"px)",...Mr(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:V}},[n,i,L.floating,d.x,d.y]);return c.useMemo(()=>({...d,update:$,refs:H,elements:L,floatingStyles:B}),[d,$,H,L,B])}const Tl=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?tr({element:o.current,padding:r}).fn(n):{}:o?tr({element:o,padding:r}).fn(n):{}}}},Il=(e,t)=>{const n=wl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ml=(e,t)=>{const n=yl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nl=(e,t)=>({fn:Sl(e).fn,options:[e,t]}),Dl=(e,t)=>{const n=bl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ol=(e,t)=>{const n=Cl(e);return{name:n.name,fn:n.fn,options:[e,t]}},kl=(e,t)=>{const n=Rl(e);return{name:n.name,fn:n.fn,options:[e,t]}},jl=(e,t)=>{const n=Tl(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ll="Arrow",Nr=c.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return p.jsx(A.svg,{...s,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});Nr.displayName=Ll;var Fl=Nr;function mt(e){const[t,n]=c.useState(void 0);return q(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const s=r[0];let a,i;if("borderBoxSize"in s){const l=s.borderBoxSize,f=Array.isArray(l)?l[0]:l;a=f.inlineSize,i=f.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var co="Popper",[Dr,Ne]=Z(co),[$l,Or]=Dr(co),kr=e=>{const{__scopePopper:t,children:n}=e,[o,r]=c.useState(null),[s,a]=c.useState(void 0);return p.jsx($l,{scope:t,anchor:o,onAnchorChange:r,placementState:s,setPlacementState:a,children:n})};kr.displayName=co;var jr="PopperAnchor",Lr=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Or(jr,n),a=c.useRef(null),i=s.onAnchorChange,l=c.useCallback(x=>{a.current=x,x&&i(x)},[i]),f=O(t,l),d=c.useRef(null);c.useEffect(()=>{if(!o)return;const x=d.current;d.current=o.current,x!==d.current&&i(d.current)});const u=s.placementState&&uo(s.placementState),m=u==null?void 0:u[0],h=u==null?void 0:u[1];return o?null:p.jsx(A.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...r,ref:f})});Lr.displayName=jr;var lo="PopperContent",[Bl,Vl]=Dr(lo),Fr=c.forwardRef((e,t)=>{var U,z,K,G,W,ve;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:f=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:x,...v}=e,w=Or(lo,n),[y,g]=c.useState(null),b=O(t,oe=>g(oe)),[C,R]=c.useState(null),E=mt(C),_=(E==null?void 0:E.width)??0,M=(E==null?void 0:E.height)??0,T=o+(s!=="center"?"-"+s:""),k=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(f)?f:[f],N=j.length>0,$={padding:k,boundary:j.filter(Gl),altBoundary:N},{refs:F,floatingStyles:H,placement:L,isPositioned:B,middlewareData:I}=Al({strategy:"fixed",placement:T,whileElementsMounted:(...oe)=>xl(...oe,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[Il({mainAxis:r+M,alignmentAxis:a}),l&&Ml({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Nl():void 0,...$}),l&&Dl({...$}),Ol({...$,apply:({elements:oe,rects:Ge,availableWidth:rt,availableHeight:st})=>{const{width:cc,height:lc}=Ge.reference,Pt=oe.floating.style;Pt.setProperty("--radix-popper-available-width",`${rt}px`),Pt.setProperty("--radix-popper-available-height",`${st}px`),Pt.setProperty("--radix-popper-anchor-width",`${cc}px`),Pt.setProperty("--radix-popper-anchor-height",`${lc}px`)}}),C&&jl({element:C,padding:i}),Kl({arrowWidth:_,arrowHeight:M}),m&&kl({strategy:"referenceHidden",...$,boundary:N?$.boundary:void 0})]}),P=w.setPlacementState;q(()=>(P(L),()=>{P(void 0)}),[L,P]);const[V,Y]=uo(L),X=ue(x);q(()=>{B&&(X==null||X())},[B,X]);const ae=(U=I.arrow)==null?void 0:U.x,ie=(z=I.arrow)==null?void 0:z.y,ye=((K=I.arrow)==null?void 0:K.centerOffset)!==0,[ne,D]=c.useState();return q(()=>{y&&D(window.getComputedStyle(y).zIndex)},[y]),p.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:B?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(G=I.transformOrigin)==null?void 0:G.x,(W=I.transformOrigin)==null?void 0:W.y].join(" "),...((ve=I.hide)==null?void 0:ve.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(Bl,{scope:n,placedSide:V,placedAlign:Y,onArrowChange:R,arrowX:ae,arrowY:ie,shouldHideArrow:ye,children:p.jsx(A.div,{"data-side":V,"data-align":Y,...v,ref:b,style:{...v.style,animation:B?void 0:"none"}})})})});Fr.displayName=lo;var $r="PopperArrow",Hl={top:"bottom",right:"left",bottom:"top",left:"right"},Br=c.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=Vl($r,o),a=Hl[s.placedSide];return p.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:p.jsx(Fl,{...r,ref:n,style:{...r.style,display:"block"}})})});Br.displayName=$r;function Gl(e){return e!==null}var Kl=e=>({name:"transformOrigin",options:e,fn(t){var w,y,g;const{placement:n,rects:o,middlewareData:r}=t,a=((w=r.arrow)==null?void 0:w.centerOffset)!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[f,d]=uo(n),u={start:"0%",center:"50%",end:"100%"}[d],m=(((y=r.arrow)==null?void 0:y.x)??0)+i/2,h=(((g=r.arrow)==null?void 0:g.y)??0)+l/2;let x="",v="";return f==="bottom"?(x=a?u:`${m}px`,v=`${-l}px`):f==="top"?(x=a?u:`${m}px`,v=`${o.floating.height+l}px`):f==="right"?(x=`${-l}px`,v=a?u:`${h}px`):f==="left"&&(x=`${o.floating.width+l}px`,v=a?u:`${h}px`),{data:{x,y:v}}}});function uo(e){const[t,n="center"]=e.split("-");return[t,n]}var Jt=kr,vt=Lr,en=Fr,tn=Br,Ul="Portal",ht=c.forwardRef((e,t)=>{var i;const{container:n,...o}=e,[r,s]=c.useState(!1);q(()=>s(!0),[]);const a=n||r&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?ft.createPortal(p.jsx(A.div,{...o,ref:t}),a):null});ht.displayName=Ul;function Wl(e,t){return c.useReducer((n,o)=>t[n][o]??n,e)}var Q=e=>{const{present:t,children:n}=e,o=zl(t),r=typeof n=="function"?n({present:o.isPresent}):c.Children.only(n),s=Yl(o.ref,Xl(r));return typeof n=="function"||o.isPresent?c.cloneElement(r,{ref:s}):null};Q.displayName="Presence";function zl(e){const[t,n]=c.useState(),o=c.useRef(null),r=c.useRef(e),s=c.useRef("none"),a=e?"mounted":"unmounted",[i,l]=Wl(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const f=Tt(o.current);s.current=i==="mounted"?f:"none"},[i]),q(()=>{const f=o.current,d=r.current;if(d!==e){const m=s.current,h=Tt(f);e?l("MOUNT"):h==="none"||(f==null?void 0:f.display)==="none"?l("UNMOUNT"):l(d&&m!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),q(()=>{if(t){let f;const d=t.ownerDocument.defaultView??window,u=h=>{const v=Tt(o.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(l("ANIMATION_END"),!r.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=h=>{h.target===t&&(s.current=Tt(o.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(f),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(f=>{o.current=f?getComputedStyle(f):null,n(f)},[])}}function or(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yl(...e){const t=c.useRef(e);return t.current=e,c.useCallback(n=>{const o=t.current;let r=!1;const s=o.map(a=>{const i=or(a,n);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<s.length;a++){const i=s[a];typeof i=="function"?i():or(o[a],null)}}},[])}function Tt(e){return(e==null?void 0:e.animationName)||"none"}function Xl(e){var o,r;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ql=Jn[" useInsertionEffect ".trim().toString()]||q;function J({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,a]=Zl({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r;{const d=c.useRef(e!==void 0);c.useEffect(()=>{const u=d.current;u!==i&&console.warn(`${o} is changing from ${u?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,o])}const f=c.useCallback(d=>{var u;if(i){const m=Ql(d)?d(e):d;m!==e&&((u=a.current)==null||u.call(a,m))}else s(d)},[i,e,s,a]);return[l,f]}function Zl({defaultProp:e,onChange:t}){const[n,o]=c.useState(e),r=c.useRef(n),s=c.useRef(t);return ql(()=>{s.current=t},[t]),c.useEffect(()=>{var a;r.current!==n&&((a=s.current)==null||a.call(s,n),r.current=n)},[n,r]),[n,o,s]}function Ql(e){return typeof e=="function"}var Vr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Jl="VisuallyHidden",Hr=c.forwardRef((e,t)=>p.jsx(A.span,{...e,ref:t,style:{...Vr,...e.style}}));Hr.displayName=Jl;var eu=Hr,[nn]=Z("Tooltip",[Ne]),on=Ne(),Gr="TooltipProvider",tu=700,Vn="tooltip.open",[nu,fo]=nn(Gr),Kr=e=>{const{__scopeTooltip:t,delayDuration:n=tu,skipDelayDuration:o=300,disableHoverableContent:r=!1,children:s}=e,a=c.useRef(!0),i=c.useRef(!1),l=c.useRef(0);return c.useEffect(()=>{const f=l.current;return()=>window.clearTimeout(f)},[]),p.jsx(nu,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:c.useCallback(()=>{o<=0||(window.clearTimeout(l.current),a.current=!1)},[o]),onClose:c.useCallback(()=>{o<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,o))},[o]),isPointerInTransitRef:i,onPointerInTransitChange:c.useCallback(f=>{i.current=f},[]),disableHoverableContent:r,children:s})};Kr.displayName=Gr;var lt="Tooltip",[ou,rn]=nn(lt),Ur=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:i}=e,l=fo(lt,e.__scopeTooltip),f=on(t),[d,u]=c.useState(null),m=te(),h=c.useRef(0),x=a??l.disableHoverableContent,v=i??l.delayDuration,w=c.useRef(!1),[y,g]=J({prop:o,defaultProp:r??!1,onChange:_=>{_?(l.onOpen(),document.dispatchEvent(new CustomEvent(Vn))):l.onClose(),s==null||s(_)},caller:lt}),b=c.useMemo(()=>y?w.current?"delayed-open":"instant-open":"closed",[y]),C=c.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w.current=!1,g(!0)},[g]),R=c.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g(!1)},[g]),E=c.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{w.current=!0,g(!0),h.current=0},v)},[v,g]);return c.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),p.jsx(Jt,{...f,children:p.jsx(ou,{scope:t,contentId:m,open:y,stateAttribute:b,trigger:d,onTriggerChange:u,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayedRef.current?E():C()},[l.isOpenDelayedRef,E,C]),onTriggerLeave:c.useCallback(()=>{x?R():(window.clearTimeout(h.current),h.current=0)},[R,x]),onOpen:C,onClose:R,disableHoverableContent:x,children:n})})};Ur.displayName=lt;var Hn="TooltipTrigger",Wr=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=rn(Hn,n),s=fo(Hn,n),a=on(n),i=c.useRef(null),l=O(t,i,r.onTriggerChange),f=c.useRef(!1),d=c.useRef(!1),u=c.useCallback(()=>f.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",u),[u]),p.jsx(vt,{asChild:!0,...a,children:p.jsx(A.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:S(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),d.current=!0)}),onPointerLeave:S(e.onPointerLeave,()=>{r.onTriggerLeave(),d.current=!1}),onPointerDown:S(e.onPointerDown,()=>{r.open&&r.onClose(),f.current=!0,document.addEventListener("pointerup",u,{once:!0})}),onFocus:S(e.onFocus,()=>{f.current||r.onOpen()}),onBlur:S(e.onBlur,r.onClose),onClick:S(e.onClick,r.onClose)})})});Wr.displayName=Hn;var ru="TooltipPortal",[iv,su]=nn(ru,{forceMount:void 0}),qe="TooltipContent",zr=c.forwardRef((e,t)=>{const n=su(qe,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,a=rn(qe,e.__scopeTooltip);return p.jsx(Q,{present:o||a.open,children:a.disableHoverableContent?p.jsx(Yr,{side:r,...s,ref:t}):p.jsx(au,{side:r,...s,ref:t})})}),au=c.forwardRef((e,t)=>{const n=rn(qe,e.__scopeTooltip),o=fo(qe,e.__scopeTooltip),r=c.useRef(null),s=O(t,r),[a,i]=c.useState(null),{trigger:l,onClose:f}=n,d=r.current,{onPointerInTransitChange:u}=o,m=c.useCallback(()=>{i(null),u(!1)},[u]),h=c.useCallback((x,v)=>{const w=x.currentTarget,y={x:x.clientX,y:x.clientY},g=du(y,w.getBoundingClientRect()),b=fu(y,g),C=pu(v.getBoundingClientRect()),R=vu([...b,...C]);i(R),u(!0)},[u]);return c.useEffect(()=>()=>m(),[m]),c.useEffect(()=>{if(l&&d){const x=w=>h(w,d),v=w=>h(w,l);return l.addEventListener("pointerleave",x),d.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",v)}}},[l,d,h,m]),c.useEffect(()=>{if(a){const x=v=>{const w=v.target,y={x:v.clientX,y:v.clientY},g=(l==null?void 0:l.contains(w))||(d==null?void 0:d.contains(w)),b=!mu(y,a);g?m():b&&(m(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,d,a,f,m]),p.jsx(Yr,{...e,ref:s})}),[iu,cu]=nn(lt,{isInside:!1}),lu=fc("TooltipContent"),Yr=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:a,...i}=e,l=rn(qe,n),f=on(n),{onClose:d}=l;return c.useEffect(()=>(document.addEventListener(Vn,d),()=>document.removeEventListener(Vn,d)),[d]),c.useEffect(()=>{if(l.trigger){const u=m=>{m.target instanceof Node&&m.target.contains(l.trigger)&&d()};return window.addEventListener("scroll",u,{capture:!0}),()=>window.removeEventListener("scroll",u,{capture:!0})}},[l.trigger,d]),p.jsx(Je,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:u=>u.preventDefault(),onDismiss:d,children:p.jsxs(en,{"data-state":l.stateAttribute,...f,...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:[p.jsx(lu,{children:o}),p.jsx(iu,{scope:n,isInside:!0,children:p.jsx(eu,{id:l.contentId,role:"tooltip",children:r||o})})]})})});zr.displayName=qe;var Xr="TooltipArrow",uu=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=on(n);return cu(Xr,n).isInside?null:p.jsx(tn,{...r,...o,ref:t})});uu.displayName=Xr;function du(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,o,r,s)){case s:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function fu(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return o}function pu(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}function mu(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],l=t[a],f=i.x,d=i.y,u=l.x,m=l.y;d>o!=m>o&&n<(u-f)*(o-d)/(m-d)+f&&(r=!r)}return r}function vu(e){const t=e.slice();return t.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),hu(t)}function hu(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const r=e[o];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(r.y-a.y)>=(s.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var cv=Kr,lv=Ur,uv=Wr,dv=zr,In="focusScope.autoFocusOnMount",Mn="focusScope.autoFocusOnUnmount",rr={bubbles:!1,cancelable:!0},gu="FocusScope",gt=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...a}=e,[i,l]=c.useState(null),f=ue(r),d=ue(s),u=c.useRef(null),m=O(t,v=>l(v)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(o){let v=function(b){if(h.paused||!i)return;const C=b.target;i.contains(C)?u.current=C:Ee(u.current,{select:!0})},w=function(b){if(h.paused||!i)return;const C=b.relatedTarget;C!==null&&(i.contains(C)||Ee(u.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const R of b)R.removedNodes.length>0&&Ee(i)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const g=new MutationObserver(y);return i&&g.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),g.disconnect()}}},[o,i,h.paused]),c.useEffect(()=>{if(i){ar.add(h);const v=document.activeElement;if(!i.contains(v)){const y=new CustomEvent(In,rr);i.addEventListener(In,f),i.dispatchEvent(y),y.defaultPrevented||(xu(Ru(qr(i)),{select:!0}),document.activeElement===v&&Ee(i))}return()=>{i.removeEventListener(In,f),setTimeout(()=>{const y=new CustomEvent(Mn,rr);i.addEventListener(Mn,d),i.dispatchEvent(y),y.defaultPrevented||Ee(v??document.body,{select:!0}),i.removeEventListener(Mn,d),ar.remove(h)},0)}}},[i,f,d,h]);const x=c.useCallback(v=>{if(!n&&!o||h.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,y=document.activeElement;if(w&&y){const g=v.currentTarget,[b,C]=wu(g);b&&C?!v.shiftKey&&y===C?(v.preventDefault(),n&&Ee(b,{select:!0})):v.shiftKey&&y===b&&(v.preventDefault(),n&&Ee(C,{select:!0})):y===g&&v.preventDefault()}},[n,o,h.paused]);return p.jsx(A.div,{tabIndex:-1,...a,ref:m,onKeyDown:x})});gt.displayName=gu;function xu(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Ee(o,{select:t}),document.activeElement!==n)return}function wu(e){const t=qr(e),n=sr(t,e),o=sr(t.reverse(),e);return[n,o]}function qr(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function sr(e,t){for(const n of e)if(!yu(n,{upTo:t}))return n}function yu(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 bu(e){return e instanceof HTMLInputElement&&"select"in e}function Ee(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bu(e)&&t&&e.select()}}var ar=Cu();function Cu(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ir(e,t),e.unshift(t)},remove(t){var n;e=ir(e,t),(n=e[0])==null||n.resume()}}}function ir(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Ru(e){return e.filter(t=>t.tagName!=="A")}var It=0,he=null;function sn(){c.useEffect(()=>{he||(he={start:cr(),end:cr()});const{start:e,end:t}=he;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),It++,()=>{It===1&&(he==null||he.start.remove(),he==null||he.end.remove(),he=null),It=Math.max(0,It-1)}},[])}function cr(){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 jt="right-scroll-bar-position",Lt="width-before-scroll-bar",Su="with-scroll-bars-hidden",Eu="--removed-body-scroll-bar-size";function Nn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Pu(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var _u=typeof window<"u"?c.useLayoutEffect:c.useEffect,lr=new WeakMap;function Au(e,t){var n=Pu(null,function(o){return e.forEach(function(r){return Nn(r,o)})});return _u(function(){var o=lr.get(n);if(o){var r=new Set(o),s=new Set(e),a=n.current;r.forEach(function(i){s.has(i)||Nn(i,null)}),s.forEach(function(i){r.has(i)||Nn(i,a)})}lr.set(n,e)},[e]),n}function Tu(e){return e}function Iu(e,t){t===void 0&&(t=Tu);var n=[],o=!1,r={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,o);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(s){for(o=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(i){return s(i)},filter:function(){return n}}},assignMedium:function(s){o=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(s),a=n}var l=function(){var d=a;a=[],d.forEach(s)},f=function(){return Promise.resolve().then(l)};f(),n={push:function(d){a.push(d),f()},filter:function(d){return a=a.filter(d),n}}}};return r}function Mu(e){e===void 0&&(e={});var t=Iu(null);return t.options=Pe({async:!0,ssr:!1},e),t}var Zr=function(e){var t=e.sideCar,n=gr(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return c.createElement(o,Pe({},n))};Zr.isSideCarExport=!0;function Nu(e,t){return e.useMedium(t),Zr}var Qr=Mu(),Dn=function(){},an=c.forwardRef(function(e,t){var n=c.useRef(null),o=c.useState({onScrollCapture:Dn,onWheelCapture:Dn,onTouchMoveCapture:Dn}),r=o[0],s=o[1],a=e.forwardProps,i=e.children,l=e.className,f=e.removeScrollBar,d=e.enabled,u=e.shards,m=e.sideCar,h=e.noRelative,x=e.noIsolation,v=e.inert,w=e.allowPinchZoom,y=e.as,g=y===void 0?"div":y,b=e.gapMode,C=gr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=m,E=Au([n,t]),_=Pe(Pe({},C),r);return c.createElement(c.Fragment,null,d&&c.createElement(R,{sideCar:Qr,removeScrollBar:f,shards:u,noRelative:h,noIsolation:x,inert:v,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:b}),a?c.cloneElement(c.Children.only(i),Pe(Pe({},_),{ref:E})):c.createElement(g,Pe({},_,{className:l,ref:E}),i))});an.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};an.classNames={fullWidth:Lt,zeroRight:jt};var Du=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ou(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Du();return t&&e.setAttribute("nonce",t),e}function ku(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ju(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Lu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ou())&&(ku(t,n),ju(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Fu=function(){var e=Lu();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Jr=function(){var e=Fu(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},$u={left:0,top:0,right:0,gap:0},On=function(e){return parseInt(e||"",10)||0},Bu=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[On(n),On(o),On(r)]},Vu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return $u;var t=Bu(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Hu=Jr(),Ye="data-scroll-locked",Gu=function(e,t,n,o){var r=e.left,s=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(Su,` {
   overflow: hidden `).concat(o,`;
   padding-right: `).concat(i,"px ").concat(o,`;
  }
  body[`).concat(Ye,`] {
    overflow: hidden `).concat(o,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
    padding-left: `.concat(r,`px;
    padding-top: `).concat(s,`px;
    padding-right: `).concat(a,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(i,"px ").concat(o,`;
    `),n==="padding"&&"padding-right: ".concat(i,"px ").concat(o,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(jt,` {
    right: `).concat(i,"px ").concat(o,`;
  }
  
  .`).concat(Lt,` {
    margin-right: `).concat(i,"px ").concat(o,`;
  }
  
  .`).concat(jt," .").concat(jt,` {
    right: 0 `).concat(o,`;
  }
  
  .`).concat(Lt," .").concat(Lt,` {
    margin-right: 0 `).concat(o,`;
  }
  
  body[`).concat(Ye,`] {
    `).concat(Eu,": ").concat(i,`px;
  }
`)},ur=function(){var e=parseInt(document.body.getAttribute(Ye)||"0",10);return isFinite(e)?e:0},Ku=function(){c.useEffect(function(){return document.body.setAttribute(Ye,(ur()+1).toString()),function(){var e=ur()-1;e<=0?document.body.removeAttribute(Ye):document.body.setAttribute(Ye,e.toString())}},[])},Uu=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Ku();var s=c.useMemo(function(){return Vu(r)},[r]);return c.createElement(Hu,{styles:Gu(s,!t,r,n?"":"!important")})},Gn=!1;if(typeof window<"u")try{var Mt=Object.defineProperty({},"passive",{get:function(){return Gn=!0,!0}});window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{Gn=!1}var Ke=Gn?{passive:!1}:!1,Wu=function(e){return e.tagName==="TEXTAREA"},es=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Wu(e)&&n[t]==="visible")},zu=function(e){return es(e,"overflowY")},Yu=function(e){return es(e,"overflowX")},dr=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=ts(e,o);if(r){var s=ns(e,o),a=s[1],i=s[2];if(a>i)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Xu=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},qu=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},ts=function(e,t){return e==="v"?zu(t):Yu(t)},ns=function(e,t){return e==="v"?Xu(t):qu(t)},Zu=function(e,t){return e==="h"&&t==="rtl"?-1:1},Qu=function(e,t,n,o,r){var s=Zu(e,window.getComputedStyle(t).direction),a=s*o,i=n.target,l=t.contains(i),f=!1,d=a>0,u=0,m=0;do{if(!i)break;var h=ns(e,i),x=h[0],v=h[1],w=h[2],y=v-w-s*x;(x||y)&&ts(e,i)&&(u+=y,m+=x);var g=i.parentNode;i=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(d&&Math.abs(u)<1||!d&&Math.abs(m)<1)&&(f=!0),f},Nt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fr=function(e){return[e.deltaX,e.deltaY]},pr=function(e){return e&&"current"in e?e.current:e},Ju=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ed=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},td=0,Ue=[];function nd(e){var t=c.useRef([]),n=c.useRef([0,0]),o=c.useRef(),r=c.useState(td++)[0],s=c.useState(Jr)[0],a=c.useRef(e);c.useEffect(function(){a.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var v=uc([e.lockRef.current],(e.shards||[]).map(pr),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var i=c.useCallback(function(v,w){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var y=Nt(v),g=n.current,b="deltaX"in v?v.deltaX:g[0]-y[0],C="deltaY"in v?v.deltaY:g[1]-y[1],R,E=v.target,_=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in v&&_==="h"&&E.type==="range")return!1;var M=window.getSelection(),T=M&&M.anchorNode,k=T?T===E||T.contains(E):!1;if(k)return!1;var j=dr(_,E);if(!j)return!0;if(j?R=_:(R=_==="v"?"h":"v",j=dr(_,E)),!j)return!1;if(!o.current&&"changedTouches"in v&&(b||C)&&(o.current=R),!R)return!0;var N=o.current||R;return Qu(N,w,v,N==="h"?b:C)},[]),l=c.useCallback(function(v){var w=v;if(!(!Ue.length||Ue[Ue.length-1]!==s)){var y="deltaY"in w?fr(w):Nt(w),g=t.current.filter(function(R){return R.name===w.type&&(R.target===w.target||w.target===R.shadowParent)&&Ju(R.delta,y)})[0];if(g&&g.should){w.cancelable&&w.preventDefault();return}if(!g){var b=(a.current.shards||[]).map(pr).filter(Boolean).filter(function(R){return R.contains(w.target)}),C=b.length>0?i(w,b[0]):!a.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),f=c.useCallback(function(v,w,y,g){var b={name:v,delta:w,target:y,should:g,shadowParent:od(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),d=c.useCallback(function(v){n.current=Nt(v),o.current=void 0},[]),u=c.useCallback(function(v){f(v.type,fr(v),v.target,i(v,e.lockRef.current))},[]),m=c.useCallback(function(v){f(v.type,Nt(v),v.target,i(v,e.lockRef.current))},[]);c.useEffect(function(){return Ue.push(s),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Ke),document.addEventListener("touchmove",l,Ke),document.addEventListener("touchstart",d,Ke),function(){Ue=Ue.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,Ke),document.removeEventListener("touchmove",l,Ke),document.removeEventListener("touchstart",d,Ke)}},[]);var h=e.removeScrollBar,x=e.inert;return c.createElement(c.Fragment,null,x?c.createElement(s,{styles:ed(r)}):null,h?c.createElement(Uu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function od(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rd=Nu(Qr,nd);var xt=c.forwardRef(function(e,t){return c.createElement(an,Pe({},e,{ref:t,sideCar:rd}))});xt.classNames=an.classNames;var sd=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},We=new WeakMap,Dt=new WeakMap,Ot={},kn=0,os=function(e){return e&&(e.host||os(e.parentNode))},ad=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=os(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},id=function(e,t,n,o){var r=ad(t,Array.isArray(e)?e:[e]);Ot[n]||(Ot[n]=new WeakMap);var s=Ot[n],a=[],i=new Set,l=new Set(r),f=function(u){!u||i.has(u)||(i.add(u),f(u.parentNode))};r.forEach(f);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(m){if(i.has(m))d(m);else try{var h=m.getAttribute(o),x=h!==null&&h!=="false",v=(We.get(m)||0)+1,w=(s.get(m)||0)+1;We.set(m,v),s.set(m,w),a.push(m),v===1&&x&&Dt.set(m,!0),w===1&&m.setAttribute(n,"true"),x||m.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",m,y)}})};return d(t),i.clear(),kn++,function(){a.forEach(function(u){var m=We.get(u)-1,h=s.get(u)-1;We.set(u,m),s.set(u,h),m||(Dt.has(u)||u.removeAttribute(o),Dt.delete(u)),h||u.removeAttribute(n)}),kn--,kn||(We=new WeakMap,We=new WeakMap,Dt=new WeakMap,Ot={})}},cn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=sd(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),id(o,r,n,"aria-hidden")):function(){return null}},ln="Dialog",[rs,ss]=Z(ln),[cd,pe]=rs(ln),as=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!0}=e,i=c.useRef(null),l=c.useRef(null),[f,d]=J({prop:o,defaultProp:r??!1,onChange:s,caller:ln});return p.jsx(cd,{scope:t,triggerRef:i,contentRef:l,contentId:te(),titleId:te(),descriptionId:te(),open:f,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(u=>!u),[d]),modal:a,children:n})};as.displayName=ln;var is="DialogTrigger",cs=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(is,n),s=O(t,r.triggerRef);return p.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":vo(r.open),...o,ref:s,onClick:S(e.onClick,r.onOpenToggle)})});cs.displayName=is;var po="DialogPortal",[ld,ls]=rs(po,{forceMount:void 0}),us=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=pe(po,t);return p.jsx(ld,{scope:t,forceMount:n,children:c.Children.map(o,a=>p.jsx(Q,{present:n||s.open,children:p.jsx(ht,{asChild:!0,container:r,children:a})}))})};us.displayName=po;var Gt="DialogOverlay",ds=c.forwardRef((e,t)=>{const n=ls(Gt,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=pe(Gt,e.__scopeDialog);return s.modal?p.jsx(Q,{present:o||s.open,children:p.jsx(dd,{...r,ref:t})}):null});ds.displayName=Gt;var ud=Ae("DialogOverlay.RemoveScroll"),dd=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(Gt,n),s=Ac(),a=O(t,s);return p.jsx(xt,{as:ud,allowPinchZoom:!0,shards:[r.contentRef],children:p.jsx(A.div,{"data-state":vo(r.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),Ze="DialogContent",fs=c.forwardRef((e,t)=>{const n=ls(Ze,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=pe(Ze,e.__scopeDialog);return p.jsx(Q,{present:o||s.open,children:s.modal?p.jsx(fd,{...r,ref:t}):p.jsx(pd,{...r,ref:t})})});fs.displayName=Ze;var fd=c.forwardRef((e,t)=>{const n=pe(Ze,e.__scopeDialog),o=c.useRef(null),r=O(t,n.contentRef,o);return c.useEffect(()=>{const s=o.current;if(s)return cn(s)},[]),p.jsx(ps,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:S(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:S(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:S(e.onFocusOutside,s=>s.preventDefault())})}),pd=c.forwardRef((e,t)=>{const n=pe(Ze,e.__scopeDialog),o=c.useRef(!1),r=c.useRef(!1);return p.jsx(ps,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(o.current||(i=n.triggerRef.current)==null||i.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{var l,f;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=s.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),ps=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...a}=e,i=pe(Ze,n);return sn(),p.jsx(p.Fragment,{children:p.jsx(gt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:p.jsx(Je,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":vo(i.open),...a,ref:t,deferPointerDownOutside:!0,onDismiss:()=>i.onOpenChange(!1)})})})}),ms="DialogTitle",vs=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(ms,n);return p.jsx(A.h2,{id:r.titleId,...o,ref:t})});vs.displayName=ms;var hs="DialogDescription",gs=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(hs,n);return p.jsx(A.p,{id:r.descriptionId,...o,ref:t})});gs.displayName=hs;var xs="DialogClose",mo=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=pe(xs,n);return p.jsx(A.button,{type:"button",...o,ref:t,onClick:S(e.onClick,()=>r.onOpenChange(!1))})});mo.displayName=xs;function vo(e){return e?"open":"closed"}var un="Popover",[ws]=Z(un,[Ne]),wt=Ne(),[md,De]=ws(un),ys=e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,i=wt(t),l=c.useRef(null),[f,d]=c.useState(!1),[u,m]=J({prop:o,defaultProp:r??!1,onChange:s,caller:un});return p.jsx(Jt,{...i,children:p.jsx(md,{scope:t,contentId:te(),triggerRef:l,open:u,onOpenChange:m,onOpenToggle:c.useCallback(()=>m(h=>!h),[m]),hasCustomAnchor:f,onCustomAnchorAdd:c.useCallback(()=>d(!0),[]),onCustomAnchorRemove:c.useCallback(()=>d(!1),[]),modal:a,children:n})})};ys.displayName=un;var bs="PopoverAnchor",vd=c.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=De(bs,n),s=wt(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=r;return c.useEffect(()=>(a(),()=>i()),[a,i]),p.jsx(vt,{...s,...o,ref:t})});vd.displayName=bs;var Cs="PopoverTrigger",Rs=c.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=De(Cs,n),s=wt(n),a=O(t,r.triggerRef),i=p.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":As(r.open),...o,ref:a,onClick:S(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?i:p.jsx(vt,{asChild:!0,...s,children:i})});Rs.displayName=Cs;var ho="PopoverPortal",[hd,gd]=ws(ho,{forceMount:void 0}),Ss=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,s=De(ho,t);return p.jsx(hd,{scope:t,forceMount:n,children:p.jsx(Q,{present:n||s.open,children:p.jsx(ht,{asChild:!0,container:r,children:o})})})};Ss.displayName=ho;var Qe="PopoverContent",Es=c.forwardRef((e,t)=>{const n=gd(Qe,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,s=De(Qe,e.__scopePopover);return p.jsx(Q,{present:o||s.open,children:s.modal?p.jsx(wd,{...r,ref:t}):p.jsx(yd,{...r,ref:t})})});Es.displayName=Qe;var xd=Ae("PopoverContent.RemoveScroll"),wd=c.forwardRef((e,t)=>{const n=De(Qe,e.__scopePopover),o=c.useRef(null),r=O(t,o),s=c.useRef(!1);return c.useEffect(()=>{const a=o.current;if(a)return cn(a)},[]),p.jsx(xt,{as:xd,allowPinchZoom:!0,children:p.jsx(Ps,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:S(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),s.current||(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:S(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0,f=i.button===2||l;s.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:S(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),yd=c.forwardRef((e,t)=>{const n=De(Qe,e.__scopePopover),o=c.useRef(!1),r=c.useRef(!1);return p.jsx(Ps,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,i;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(o.current||(i=n.triggerRef.current)==null||i.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{var l,f;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=s.target;((f=n.triggerRef.current)==null?void 0:f.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),Ps=c.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:d,...u}=e,m=De(Qe,n),h=wt(n);return sn(),p.jsx(gt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:p.jsx(Je,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:f,onDismiss:()=>m.onOpenChange(!1),deferPointerDownOutside:!0,children:p.jsx(en,{"data-state":As(m.open),role:"dialog",id:m.contentId,...h,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),_s="PopoverClose",bd=c.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=De(_s,n);return p.jsx(A.button,{type:"button",...o,ref:t,onClick:S(e.onClick,()=>r.onOpenChange(!1))})});bd.displayName=_s;var Cd="PopoverArrow",Rd=c.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=wt(n);return p.jsx(tn,{...r,...o,ref:t})});Rd.displayName=Cd;function As(e){return e?"open":"closed"}var fv=ys,pv=Rs,mv=Ss,vv=Es,Sd="Label",Ts=c.forwardRef((e,t)=>p.jsx(A.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ts.displayName=Sd;var hv=Ts,go="Avatar",[Ed]=Z(go),Pd=[0,()=>{}],[_d,Is]=Ed(go),Ad=c.forwardRef((e,t)=>{const{__scopeAvatar:n,...o}=e,[r,s]=c.useState("idle"),[a,i]=Nd();return p.jsx(_d,{scope:n,imageLoadingStatus:r,setImageLoadingStatus:s,imageCount:a,setImageCount:i,children:p.jsx(A.span,{...o,ref:t})})});Ad.displayName=go;var Ms="AvatarImage",Td=c.forwardRef((e,t)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:r,...s}=e,a=Is(Ms,n);Dd(a.setImageCount);const i=Md(o,{referrerPolicy:s.referrerPolicy,crossOrigin:s.crossOrigin,loadingStatus:a.imageLoadingStatus,setLoadingStatus:a.setImageLoadingStatus}),l=ue(d=>{r==null||r(d)}),f=c.useRef(i);return q(()=>{const d=f.current;f.current=i,i!==d&&l(i)},[i,l]),i==="loaded"?p.jsx(A.img,{...s,ref:t,src:o}):null});Td.displayName=Ms;var Ns="AvatarFallback",Id=c.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:o,...r}=e,s=Is(Ns,n),[a,i]=c.useState(o===void 0);return c.useEffect(()=>{if(o!==void 0){const l=window.setTimeout(()=>i(!0),o);return()=>window.clearTimeout(l)}},[o]),a&&s.imageLoadingStatus!=="loaded"?p.jsx(A.span,{...r,ref:t}):null});Id.displayName=Ns;function Md(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:o,crossOrigin:r}){return q(()=>{if(!e){n("error");return}const s=new window.Image,a=l=>{const f=l.currentTarget;n(mr(f))},i=()=>n("error");return s.addEventListener("load",a),s.addEventListener("error",i),o&&(s.referrerPolicy=o),s.crossOrigin=r??null,s.src=e,n(mr(s)),()=>{s.removeEventListener("load",a),s.removeEventListener("error",i),n("idle")}},[e,r,o,n]),t}function mr(e){return e.complete?e.naturalWidth>0?"loaded":"error":"loading"}function Nd(){let e=Pd;{e=c.useState(0);const[t]=e,n=c.useRef(!1);c.useEffect(()=>{t>1&&!n.current&&(n.current=!0,console.warn("Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior."))},[t])}return e}function Dd(e){c.useEffect(()=>(e(t=>t+1),()=>{e(t=>t-1)}),[e])}var Ds="AlertDialog",[Od]=Z(Ds,[ss]),Se=ss(),Os=e=>{const{__scopeAlertDialog:t,...n}=e,o=Se(t);return p.jsx(as,{...o,...n,modal:!0})};Os.displayName=Ds;var kd="AlertDialogTrigger",jd=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(cs,{...r,...o,ref:t})});jd.displayName=kd;var Ld="AlertDialogPortal",ks=e=>{const{__scopeAlertDialog:t,...n}=e,o=Se(t);return p.jsx(us,{...o,...n})};ks.displayName=Ld;var Fd="AlertDialogOverlay",js=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(ds,{...r,...o,ref:t})});js.displayName=Fd;var Ls="AlertDialogContent",[$d,Bd]=Od(Ls),Fs=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:o,...r}=e,s=Se(n),a=c.useRef(null),i=O(t,a),l=c.useRef(null);return p.jsx($d,{scope:n,cancelRef:l,children:p.jsx(fs,{role:"alertdialog",...s,...r,ref:i,onOpenAutoFocus:S(r.onOpenAutoFocus,f=>{var d;f.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:o})})});Fs.displayName=Ls;var Vd="AlertDialogTitle",$s=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(vs,{...r,...o,ref:t})});$s.displayName=Vd;var Hd="AlertDialogDescription",Bs=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(gs,{...r,...o,ref:t})});Bs.displayName=Hd;var Gd="AlertDialogAction",Vs=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(mo,{...r,...o,ref:t})});Vs.displayName=Gd;var Hs="AlertDialogCancel",Gs=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:r}=Bd(Hs,n),s=Se(n),a=O(t,r);return p.jsx(mo,{...s,...o,ref:a})});Gs.displayName=Hs;var gv=Os,xv=ks,wv=js,yv=Fs,bv=Vs,Cv=Gs,Rv=$s,Sv=Bs;function yt(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var dn="Checkbox",[Kd]=Z(dn),[Ud,xo]=Kd(dn);function Wd(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:s,form:a,name:i,onCheckedChange:l,required:f,value:d="on",internal_do_not_use_render:u}=e,[m,h]=J({prop:n,defaultProp:r??!1,onChange:l,caller:dn}),[x,v]=c.useState(null),[w,y]=c.useState(null),g=c.useRef(!1),b=x?!!a||!!x.closest("form"):!0,C={checked:m,disabled:s,setChecked:h,control:x,setControl:v,name:i,form:a,value:d,hasConsumerStoppedPropagationRef:g,required:f,defaultChecked:_e(r)?!1:r,isFormControl:b,bubbleInput:w,setBubbleInput:y};return p.jsx(Ud,{scope:t,...C,children:Xd(u)?u(C):o})}var Ks="CheckboxTrigger",Us=c.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:s,value:a,disabled:i,checked:l,required:f,setControl:d,setChecked:u,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:x}=xo(Ks,e),v=O(r,d),w=c.useRef(l);return c.useEffect(()=>{const y=s==null?void 0:s.form;if(y){const g=()=>u(w.current);return y.addEventListener("reset",g),()=>y.removeEventListener("reset",g)}},[s,u]),p.jsx(A.button,{type:"button",role:"checkbox","aria-checked":_e(l)?"mixed":l,"aria-required":f,"data-state":Xs(l),"data-disabled":i?"":void 0,disabled:i,value:a,...o,ref:v,onKeyDown:S(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:S(n,y=>{u(g=>_e(g)?!0:!g),x&&h&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})})});Us.displayName=Ks;var zd=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:s,required:a,disabled:i,value:l,onCheckedChange:f,form:d,...u}=e;return p.jsx(Wd,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:i,required:a,onCheckedChange:f,name:o,form:d,value:l,internal_do_not_use_render:({isFormControl:m})=>p.jsxs(p.Fragment,{children:[p.jsx(Us,{...u,ref:t,__scopeCheckbox:n}),m&&p.jsx(Ys,{__scopeCheckbox:n})]})})});zd.displayName=dn;var Ws="CheckboxIndicator",Yd=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,s=xo(Ws,n);return p.jsx(Q,{present:o||_e(s.checked)||s.checked===!0,children:p.jsx(A.span,{"data-state":Xs(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});Yd.displayName=Ws;var zs="CheckboxBubbleInput",Ys=c.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:a,required:i,disabled:l,name:f,value:d,form:u,bubbleInput:m,setBubbleInput:h}=xo(zs,e),x=O(n,h),v=yt(s),w=mt(o);c.useEffect(()=>{const g=m;if(!g)return;const b=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(b,"checked").set,E=!r.current;if(v!==s&&R){const _=new Event("click",{bubbles:E});g.indeterminate=_e(s),R.call(g,_e(s)?!1:s),g.dispatchEvent(_)}},[m,v,s,r]);const y=c.useRef(_e(s)?!1:s);return p.jsx(A.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??y.current,required:i,disabled:l,name:f,value:d,form:u,...t,tabIndex:-1,ref:x,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ys.displayName=zs;function Xd(e){return typeof e=="function"}function _e(e){return e==="indeterminate"}function Xs(e){return _e(e)?"indeterminate":e?"checked":"unchecked"}function Kt(e,[t,n]){return Math.min(n,Math.max(t,e))}function bt(e){const t=e+"CollectionProvider",[n,o]=Z(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=v=>{const{scope:w,children:y}=v,g=c.useRef(null),b=c.useRef(new Map).current;return p.jsx(r,{scope:w,itemMap:b,collectionRef:g,children:y})};a.displayName=t;const i=e+"CollectionSlot",l=Ae(i),f=c.forwardRef((v,w)=>{const{scope:y,children:g}=v,b=s(i,y),C=O(w,b.collectionRef);return p.jsx(l,{ref:C,children:g})});f.displayName=i;const d=e+"CollectionItemSlot",u="data-radix-collection-item",m=Ae(d),h=c.forwardRef((v,w)=>{const{scope:y,children:g,...b}=v,C=c.useRef(null),R=O(w,C),E=s(d,y);return c.useEffect(()=>(E.itemMap.set(C,{ref:C,...b}),()=>void E.itemMap.delete(C))),p.jsx(m,{[u]:"",ref:R,children:g})});h.displayName=d;function x(v){const w=s(e+"CollectionConsumer",v);return c.useCallback(()=>{const g=w.collectionRef.current;if(!g)return[];const b=Array.from(g.querySelectorAll(`[${u}]`));return Array.from(w.itemMap.values()).sort((E,_)=>b.indexOf(E.ref.current)-b.indexOf(_.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:a,Slot:f,ItemSlot:h},x,o]}var qd=c.createContext(void 0);function $e(e){const t=c.useContext(qd);return e||t||"ltr"}var Zd=[" ","Enter","ArrowUp","ArrowDown"],Qd=[" ","Enter"],Fe="Select",[fn,pn,Jd]=bt(Fe),[Be]=Z(Fe,[Jd,Ne]),mn=Ne(),[ef,Oe]=Be(Fe),[tf,nf]=Be(Fe),of="SelectProvider";function qs(e){const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:a,defaultValue:i,onValueChange:l,dir:f,name:d,autoComplete:u,disabled:m,required:h,form:x,internal_do_not_use_render:v}=e,w=mn(t),[y,g]=c.useState(null),[b,C]=c.useState(null),[R,E]=c.useState(!1),_=$e(f),[M,T]=J({prop:o,defaultProp:r??!1,onChange:s,caller:Fe}),[k,j]=J({prop:a,defaultProp:i,onChange:l,caller:Fe}),N=c.useRef(null),$=y?!!x||!!y.closest("form"):!0,[F,H]=c.useState(new Set),L=te(),B=Array.from(F).map(Y=>Y.props.value).join(";"),I=c.useCallback(Y=>{H(X=>new Set(X).add(Y))},[]),P=c.useCallback(Y=>{H(X=>{const ae=new Set(X);return ae.delete(Y),ae})},[]),V={required:h,trigger:y,onTriggerChange:g,valueNode:b,onValueNodeChange:C,valueNodeHasChildren:R,onValueNodeHasChildrenChange:E,contentId:L,value:k,onValueChange:j,open:M,onOpenChange:T,dir:_,triggerPointerDownPosRef:N,disabled:m,name:d,autoComplete:u,form:x,nativeOptions:F,nativeSelectKey:B,isFormControl:$};return p.jsx(Jt,{...w,children:p.jsx(ef,{scope:t,...V,children:p.jsx(fn.Provider,{scope:t,children:p.jsx(tf,{scope:t,onNativeOptionAdd:I,onNativeOptionRemove:P,children:Df(v)?v(V):n})})})})}qs.displayName=of;var rf=e=>{const{__scopeSelect:t,children:n,...o}=e;return p.jsx(qs,{__scopeSelect:t,...o,internal_do_not_use_render:({isFormControl:r})=>p.jsxs(p.Fragment,{children:[n,r?p.jsx(da,{__scopeSelect:t}):null]})})};rf.displayName=Fe;var Zs="SelectTrigger",sf=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=mn(n),a=Oe(Zs,n),i=a.disabled||o,l=O(t,a.onTriggerChange),f=pn(n),d=c.useRef("touch"),[u,m,h]=fa(v=>{const w=f().filter(b=>!b.disabled),y=w.find(b=>b.value===a.value),g=pa(w,v,y);g!==void 0&&a.onValueChange(g.value)}),x=v=>{i||(a.onOpenChange(!0),h()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return p.jsx(vt,{asChild:!0,...s,children:p.jsx(A.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":vn(a.value)?"":void 0,...r,ref:l,onClick:S(r.onClick,v=>{v.currentTarget.focus(),d.current!=="mouse"&&x(v)}),onPointerDown:S(r.onPointerDown,v=>{d.current=v.pointerType;const w=v.target;w.hasPointerCapture(v.pointerId)&&w.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(x(v),v.preventDefault())}),onKeyDown:S(r.onKeyDown,v=>{const w=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(w&&v.key===" ")&&Zd.includes(v.key)&&(x(),v.preventDefault())})})})});sf.displayName=Zs;var Qs="SelectValue",af=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:a="",...i}=e,l=Oe(Qs,n),{onValueNodeHasChildrenChange:f}=l,d=s!==void 0,u=O(t,l.onValueNodeChange);q(()=>{f(d)},[f,d]);const m=vn(l.value);return p.jsx(A.span,{...i,asChild:m?!1:i.asChild,ref:u,style:{pointerEvents:"none"},children:p.jsx(c.Fragment,{children:m?a:s},m?"placeholder":"value")})});af.displayName=Qs;var cf="SelectIcon",lf=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return p.jsx(A.span,{"aria-hidden":!0,...r,ref:t,children:o||"â–¼"})});lf.displayName=cf;var Js="SelectPortal",[uf,df]=Be(Js,{forceMount:void 0}),ff=e=>{const{__scopeSelect:t,forceMount:n,...o}=e;return p.jsx(uf,{scope:e.__scopeSelect,forceMount:n,children:p.jsx(ht,{asChild:!0,...o})})};ff.displayName=Js;var Me="SelectContent",pf=c.forwardRef((e,t)=>{const n=df(Me,e.__scopeSelect),{forceMount:o=n.forceMount,...r}=e,s=Oe(Me,e.__scopeSelect),[a,i]=c.useState();return q(()=>{i(new DocumentFragment)},[]),p.jsx(Q,{present:o||s.open,children:({present:l})=>l?p.jsx(na,{...r,ref:t}):p.jsx(ea,{...r,fragment:a})})});pf.displayName=Me;var ea=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,fragment:r}=e;return r?ft.createPortal(p.jsx(ta,{scope:n,children:p.jsx(fn.Slot,{scope:n,children:p.jsx("div",{ref:t,children:o})})}),r):null});ea.displayName="SelectContentFragment";var le=10,[ta,ke]=Be(Me),mf="SelectContentImpl",vf=Ae("SelectContent.RemoveScroll"),na=c.forwardRef((e,t)=>{const{__scopeSelect:n}=e,{position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:l,align:f,alignOffset:d,arrowPadding:u,collisionBoundary:m,collisionPadding:h,sticky:x,hideWhenDetached:v,avoidCollisions:w,...y}=e,g=Oe(Me,n),[b,C]=c.useState(null),[R,E]=c.useState(null),_=O(t,D=>C(D)),[M,T]=c.useState(null),[k,j]=c.useState(null),N=pn(n),[$,F]=c.useState(!1),H=c.useRef(!1);c.useEffect(()=>{if(b)return cn(b)},[b]),sn();const L=c.useCallback(D=>{const[U,...z]=N().map(W=>W.ref.current),[K]=z.slice(-1),G=document.activeElement;for(const W of D)if(W===G||(W==null||W.scrollIntoView({block:"nearest"}),W===U&&R&&(R.scrollTop=0),W===K&&R&&(R.scrollTop=R.scrollHeight),W==null||W.focus(),document.activeElement!==G))return},[N,R]),B=c.useCallback(()=>L([M,b]),[L,M,b]);c.useEffect(()=>{$&&B()},[$,B]);const{onOpenChange:I,triggerPointerDownPosRef:P}=g;c.useEffect(()=>{if(b){let D={x:0,y:0};const U=K=>{var G,W;D={x:Math.abs(Math.round(K.pageX)-(((G=P.current)==null?void 0:G.x)??0)),y:Math.abs(Math.round(K.pageY)-(((W=P.current)==null?void 0:W.y)??0))}},z=K=>{D.x<=10&&D.y<=10?K.preventDefault():K.composedPath().includes(b)||I(!1),document.removeEventListener("pointermove",U),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",z,{capture:!0})}}},[b,I,P]),c.useEffect(()=>{const D=()=>I(!1);return window.addEventListener("blur",D),window.addEventListener("resize",D),()=>{window.removeEventListener("blur",D),window.removeEventListener("resize",D)}},[I]);const[V,Y]=fa(D=>{const U=N().filter(G=>!G.disabled),z=U.find(G=>G.ref.current===document.activeElement),K=pa(U,D,z);K&&setTimeout(()=>{var G;return(G=K.ref.current)==null?void 0:G.focus()})}),X=c.useCallback((D,U,z)=>{const K=!H.current&&!z;(g.value!==void 0&&g.value===U||K)&&(T(D),K&&(H.current=!0))},[g.value]),ae=c.useCallback(()=>b==null?void 0:b.focus(),[b]),ie=c.useCallback((D,U,z)=>{const K=!H.current&&!z;(g.value!==void 0&&g.value===U||K)&&j(D)},[g.value]),ye=o==="popper"?Kn:oa,ne=ye===Kn?{side:i,sideOffset:l,align:f,alignOffset:d,arrowPadding:u,collisionBoundary:m,collisionPadding:h,sticky:x,hideWhenDetached:v,avoidCollisions:w}:{};return p.jsx(ta,{scope:n,content:b,viewport:R,onViewportChange:E,itemRefCallback:X,selectedItem:M,onItemLeave:ae,itemTextRefCallback:ie,focusSelectedItem:B,selectedItemText:k,position:o,isPositioned:$,searchRef:V,children:p.jsx(xt,{as:vf,allowPinchZoom:!0,children:p.jsx(gt,{asChild:!0,trapped:g.open,onMountAutoFocus:D=>{D.preventDefault()},onUnmountAutoFocus:S(r,D=>{var U;(U=g.trigger)==null||U.focus({preventScroll:!0}),D.preventDefault()}),children:p.jsx(Je,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:D=>D.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:p.jsx(ye,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:D=>D.preventDefault(),...y,...ne,onPlaced:()=>F(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:S(y.onKeyDown,D=>{const U=D.ctrlKey||D.altKey||D.metaKey;if(D.key==="Tab"&&D.preventDefault(),!U&&D.key.length===1&&Y(D.key),["ArrowUp","ArrowDown","Home","End"].includes(D.key)){let K=N().filter(G=>!G.disabled).map(G=>G.ref.current);if(["ArrowUp","End"].includes(D.key)&&(K=K.slice().reverse()),["ArrowUp","ArrowDown"].includes(D.key)){const G=D.target,W=K.indexOf(G);K=K.slice(W+1)}setTimeout(()=>L(K)),D.preventDefault()}})})})})})})});na.displayName=mf;var hf="SelectItemAlignedPosition",oa=c.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=Oe(Me,n),a=ke(Me,n),[i,l]=c.useState(null),[f,d]=c.useState(null),u=O(t,_=>d(_)),m=pn(n),h=c.useRef(!1),x=c.useRef(!0),{viewport:v,selectedItem:w,selectedItemText:y,focusSelectedItem:g}=a,b=c.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&f&&v&&w&&y){const _=s.trigger.getBoundingClientRect(),M=f.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),k=y.getBoundingClientRect();if(s.dir!=="rtl"){const G=k.left-M.left,W=T.left-G,ve=_.left-W,oe=_.width+ve,Ge=Math.max(oe,M.width),rt=window.innerWidth-le,st=Kt(W,[le,Math.max(le,rt-Ge)]);i.style.minWidth=oe+"px",i.style.left=st+"px"}else{const G=M.right-k.right,W=window.innerWidth-T.right-G,ve=window.innerWidth-_.right-W,oe=_.width+ve,Ge=Math.max(oe,M.width),rt=window.innerWidth-le,st=Kt(W,[le,Math.max(le,rt-Ge)]);i.style.minWidth=oe+"px",i.style.right=st+"px"}const j=m(),N=window.innerHeight-le*2,$=v.scrollHeight,F=window.getComputedStyle(f),H=parseInt(F.borderTopWidth,10),L=parseInt(F.paddingTop,10),B=parseInt(F.borderBottomWidth,10),I=parseInt(F.paddingBottom,10),P=H+L+$+I+B,V=Math.min(w.offsetHeight*5,P),Y=window.getComputedStyle(v),X=parseInt(Y.paddingTop,10),ae=parseInt(Y.paddingBottom,10),ie=_.top+_.height/2-le,ye=N-ie,ne=w.offsetHeight/2,D=w.offsetTop+ne,U=H+L+D,z=P-U;if(U<=ie){const G=j.length>0&&w===j[j.length-1].ref.current;i.style.bottom="0px";const W=f.clientHeight-v.offsetTop-v.offsetHeight,ve=Math.max(ye,ne+(G?ae:0)+W+B),oe=U+ve;i.style.height=oe+"px"}else{const G=j.length>0&&w===j[0].ref.current;i.style.top="0px";const ve=Math.max(ie,H+v.offsetTop+(G?X:0)+ne)+z;i.style.height=ve+"px",v.scrollTop=U-ie+v.offsetTop}i.style.margin=`${le}px 0`,i.style.minHeight=V+"px",i.style.maxHeight=N+"px",o==null||o(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,i,f,v,w,y,s.dir,o]);q(()=>b(),[b]);const[C,R]=c.useState();q(()=>{f&&R(window.getComputedStyle(f).zIndex)},[f]);const E=c.useCallback(_=>{_&&x.current===!0&&(b(),g==null||g(),x.current=!1)},[b,g]);return p.jsx(xf,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:p.jsx(A.div,{...r,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});oa.displayName=hf;var gf="SelectPopperPosition",Kn=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=le,...s}=e,a=mn(n);return p.jsx(en,{...a,...s,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Kn.displayName=gf;var[xf,wo]=Be(Me,{}),Un="SelectViewport",wf=c.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=ke(Un,n),a=wo(Un,n),i=O(t,s.onViewportChange),l=c.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),p.jsx(fn.Slot,{scope:n,children:p.jsx(A.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:S(r.onScroll,f=>{const d=f.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:m}=a;if(m!=null&&m.current&&u){const h=Math.abs(l.current-d.scrollTop);if(h>0){const x=window.innerHeight-le*2,v=parseFloat(u.style.minHeight),w=parseFloat(u.style.height),y=Math.max(v,w);if(y<x){const g=y+h,b=Math.min(x,g),C=g-b;u.style.height=b+"px",u.style.bottom==="0px"&&(d.scrollTop=C>0?C:0,u.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});wf.displayName=Un;var ra="SelectGroup",[yf,bf]=Be(ra),Cf=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=te();return p.jsx(yf,{scope:n,id:r,children:p.jsx(A.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Cf.displayName=ra;var sa="SelectLabel",Rf=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=bf(sa,n);return p.jsx(A.div,{id:r.id,...o,ref:t})});Rf.displayName=sa;var Ut="SelectItem",[Sf,aa]=Be(Ut),Ef=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...a}=e,i=Oe(Ut,n),l=ke(Ut,n),f=i.value===o,[d,u]=c.useState(s??""),[m,h]=c.useState(!1),x=O(t,g=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,g,o,r)}),v=te(),w=c.useRef("touch"),y=()=>{r||(i.onValueChange(o),i.onOpenChange(!1))};return p.jsx(Sf,{scope:n,value:o,disabled:r,textId:v,isSelected:f,onItemTextChange:c.useCallback(g=>{u(b=>b||((g==null?void 0:g.textContent)??"").trim())},[]),children:p.jsx(fn.ItemSlot,{scope:n,value:o,disabled:r,textValue:d,children:p.jsx(A.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":f&&m,"data-state":f?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:x,onFocus:S(a.onFocus,()=>h(!0)),onBlur:S(a.onBlur,()=>h(!1)),onClick:S(a.onClick,()=>{w.current!=="mouse"&&y()}),onPointerUp:S(a.onPointerUp,()=>{w.current==="mouse"&&y()}),onPointerDown:S(a.onPointerDown,g=>{w.current=g.pointerType}),onPointerMove:S(a.onPointerMove,g=>{var b;w.current=g.pointerType,r?(b=l.onItemLeave)==null||b.call(l):w.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:S(a.onPointerLeave,g=>{var b;g.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:S(a.onKeyDown,g=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&g.key===" "||(Qd.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});Ef.displayName=Ut;var at="SelectItemText",Pf=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,a=Oe(at,n),i=ke(at,n),l=aa(at,n),f=nf(at,n),[d,u]=c.useState(null),m=O(t,y=>u(y),l.onItemTextChange,y=>{var g;return(g=i.itemTextRefCallback)==null?void 0:g.call(i,y,l.value,l.disabled)}),h=d==null?void 0:d.textContent,x=c.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:w}=f;return q(()=>(v(x),()=>w(x)),[v,w,x]),p.jsxs(p.Fragment,{children:[p.jsx(A.span,{id:l.textId,...s,ref:m}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!vn(a.value)?ft.createPortal(s.children,a.valueNode):null]})});Pf.displayName=at;var ia="SelectItemIndicator",_f=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return aa(ia,n).isSelected?p.jsx(A.span,{"aria-hidden":!0,...o,ref:t}):null});_f.displayName=ia;var Wn="SelectScrollUpButton",Af=c.forwardRef((e,t)=>{const n=ke(Wn,e.__scopeSelect),o=wo(Wn,e.__scopeSelect),[r,s]=c.useState(!1),a=O(t,o.onScrollButtonChange);return q(()=>{if(n.viewport&&n.isPositioned){let i=function(){const f=l.scrollTop>0;s(f)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),r?p.jsx(ca,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});Af.displayName=Wn;var zn="SelectScrollDownButton",Tf=c.forwardRef((e,t)=>{const n=ke(zn,e.__scopeSelect),o=wo(zn,e.__scopeSelect),[r,s]=c.useState(!1),a=O(t,o.onScrollButtonChange);return q(()=>{if(n.viewport&&n.isPositioned){let i=function(){const f=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<f;s(d)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),r?p.jsx(ca,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});Tf.displayName=zn;var ca=c.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=ke("SelectScrollButton",n),a=c.useRef(null),i=pn(n),l=c.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return c.useEffect(()=>()=>l(),[l]),q(()=>{var d;const f=i().find(u=>u.ref.current===document.activeElement);(d=f==null?void 0:f.ref.current)==null||d.scrollIntoView({block:"nearest"})},[i]),p.jsx(A.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:S(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:S(r.onPointerMove,()=>{var f;(f=s.onItemLeave)==null||f.call(s),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:S(r.onPointerLeave,()=>{l()})})}),If="SelectSeparator",Mf=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return p.jsx(A.div,{"aria-hidden":!0,...o,ref:t})});Mf.displayName=If;var la="SelectArrow",Nf=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=mn(n);return ke(la,n).position==="popper"?p.jsx(tn,{...r,...o,ref:t}):null});Nf.displayName=la;var ua="SelectBubbleInput",da=c.forwardRef(({__scopeSelect:e,...t},n)=>{const o=Oe(ua,e),{value:r,onValueChange:s,required:a,disabled:i,name:l,autoComplete:f,form:d}=o,{nativeOptions:u,nativeSelectKey:m}=o,h=c.useRef(null),x=O(n,h),v=r??"",w=yt(v),y=Array.from(u).some(g=>(g.props.value??"")==="");return c.useEffect(()=>{const g=h.current;if(!g)return;const b=window.HTMLSelectElement.prototype,R=Object.getOwnPropertyDescriptor(b,"value").set;if(w!==v&&R){const E=new Event("change",{bubbles:!0});R.call(g,v),g.dispatchEvent(E)}},[w,v]),p.jsxs(A.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:l,autoComplete:f,disabled:i,form:d,onChange:g=>s(g.target.value),...t,style:{...Vr,...t.style},ref:x,defaultValue:v,children:[vn(r)&&!y?p.jsx("option",{value:""}):null,Array.from(u)]},m)});da.displayName=ua;function Df(e){return typeof e=="function"}function vn(e){return e===""||e===void 0}function fa(e){const t=ue(e),n=c.useRef(""),o=c.useRef(0),r=c.useCallback(a=>{const i=n.current+a;t(i),function l(f){n.current=f,window.clearTimeout(o.current),f!==""&&(o.current=window.setTimeout(()=>l(""),1e3))}(i)},[t]),s=c.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return c.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,s]}function pa(e,t,n){const r=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Of(e,Math.max(s,0));r.length===1&&(a=a.filter(f=>f!==n));const l=a.find(f=>f.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function Of(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var hn="Switch",[kf]=Z(hn),[jf,yo]=kf(hn);function Lf(e){const{__scopeSwitch:t,checked:n,children:o,defaultChecked:r,disabled:s,form:a,name:i,onCheckedChange:l,required:f,value:d="on",internal_do_not_use_render:u}=e,[m,h]=J({prop:n,defaultProp:r??!1,onChange:l,caller:hn}),[x,v]=c.useState(null),[w,y]=c.useState(null),g=c.useRef(!1),b=x?!!a||!!x.closest("form"):!0,C={checked:m,setChecked:h,disabled:s,control:x,setControl:v,name:i,form:a,value:d,hasConsumerStoppedPropagationRef:g,required:f,defaultChecked:r,isFormControl:b,bubbleInput:w,setBubbleInput:y};return p.jsx(jf,{scope:t,...C,children:Bf(u)?u(C):o})}var ma="SwitchTrigger",va=c.forwardRef(({__scopeSwitch:e,onClick:t,...n},o)=>{const{value:r,disabled:s,checked:a,required:i,setControl:l,setChecked:f,hasConsumerStoppedPropagationRef:d,isFormControl:u,bubbleInput:m}=yo(ma,e),h=O(o,l);return p.jsx(A.button,{type:"button",role:"switch","aria-checked":a,"aria-required":i,"data-state":wa(a),"data-disabled":s?"":void 0,disabled:s,value:r,...n,ref:h,onClick:S(t,x=>{f(v=>!v),m&&u&&(d.current=x.isPropagationStopped(),d.current||x.stopPropagation())})})});va.displayName=ma;var Ff=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:s,required:a,disabled:i,value:l,onCheckedChange:f,form:d,...u}=e;return p.jsx(Lf,{__scopeSwitch:n,checked:r,defaultChecked:s,disabled:i,required:a,onCheckedChange:f,name:o,form:d,value:l,internal_do_not_use_render:({isFormControl:m})=>p.jsxs(p.Fragment,{children:[p.jsx(va,{...u,ref:t,__scopeSwitch:n}),m&&p.jsx(xa,{__scopeSwitch:n})]})})});Ff.displayName=hn;var ha="SwitchThumb",$f=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=yo(ha,n);return p.jsx(A.span,{"data-state":wa(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});$f.displayName=ha;var ga="SwitchBubbleInput",xa=c.forwardRef(({__scopeSwitch:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:a,required:i,disabled:l,name:f,value:d,form:u,bubbleInput:m,setBubbleInput:h}=yo(ga,e),x=O(n,h),v=yt(s),w=mt(o);c.useEffect(()=>{const g=m;if(!g)return;const b=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(b,"checked").set,E=!r.current;if(v!==s&&R){const _=new Event("click",{bubbles:E});R.call(g,s),g.dispatchEvent(_)}},[m,v,s,r]);const y=c.useRef(s);return p.jsx(A.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??y.current,required:i,disabled:l,name:f,value:d,form:u,...t,tabIndex:-1,ref:x,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});xa.displayName=ga;function Bf(e){return typeof e=="function"}function wa(e){return e?"checked":"unchecked"}var Vf="Separator",vr="horizontal",Hf=["horizontal","vertical"],ya=c.forwardRef((e,t)=>{const{decorative:n,orientation:o=vr,...r}=e,s=Gf(o)?o:vr,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return p.jsx(A.div,{"data-orientation":s,...i,...r,ref:t})});ya.displayName=Vf;function Gf(e){return Hf.includes(e)}var Ev=ya,ba=["PageUp","PageDown"],Ca=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ra={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},nt="Slider",[Yn,Kf,Uf]=bt(nt),[bo]=Z(nt,[Uf]),[Wf,Ct]=bo(nt),zf=c.forwardRef((e,t)=>{const{name:n,min:o=0,max:r=100,step:s=1,orientation:a="horizontal",disabled:i=!1,minStepsBetweenThumbs:l=0,defaultValue:f=[o],value:d,onValueChange:u=()=>{},onValueCommit:m=()=>{},inverted:h=!1,form:x,...v}=e,w=c.useRef(new Set),y=c.useRef(0),g=c.useRef(!1),C=a==="horizontal"?Yf:Xf,[R=[],E]=J({prop:d,defaultProp:f,onChange:N=>{var F;(F=[...w.current][y.current])==null||F.focus({preventScroll:!0,focusVisible:g.current}),g.current=!1,u(N)}}),_=c.useRef(R);function M(N){const $=np(R,N);j(N,$)}function T(N){j(N,y.current)}function k(){const N=_.current[y.current];R[y.current]!==N&&m(R)}function j(N,$,{commit:F}={commit:!1}){const H=ap(s),L=ip(Math.round((N-o)/s)*s+o,H),B=Kt(L,[o,r]);E((I=[])=>{const P=ep(I,B,$);if(sp(P,l*s)){y.current=P.indexOf(B);const V=String(P)!==String(I);return V&&F&&m(P),V?P:I}else return I})}return p.jsx(Wf,{scope:e.__scopeSlider,name:n,disabled:i,min:o,max:r,valueIndexToChangeRef:y,thumbs:w.current,values:R,orientation:a,form:x,children:p.jsx(Yn.Provider,{scope:e.__scopeSlider,children:p.jsx(Yn.Slot,{scope:e.__scopeSlider,children:p.jsx(C,{"aria-disabled":i,"data-disabled":i?"":void 0,...v,ref:t,onPointerDown:S(v.onPointerDown,()=>{i||(_.current=R,g.current=!1)}),min:o,max:r,inverted:h,onSlideStart:i?void 0:M,onSlideMove:i?void 0:T,onSlideEnd:i?void 0:k,onHomeKeyDown:()=>{i||(g.current=!0,j(o,0,{commit:!0}))},onEndKeyDown:()=>{i||(g.current=!0,j(r,R.length-1,{commit:!0}))},onStepKeyDown:({event:N,direction:$})=>{if(!i){g.current=!0;const L=ba.includes(N.key)||N.shiftKey&&Ca.includes(N.key)?10:1,B=y.current,I=R[B],P=s*L*$;j(I+P,B,{commit:!0})}}})})})})});zf.displayName=nt;var[Sa,Ea]=bo(nt,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Yf=c.forwardRef((e,t)=>{const{min:n,max:o,dir:r,inverted:s,onSlideStart:a,onSlideMove:i,onSlideEnd:l,onStepKeyDown:f,...d}=e,[u,m]=c.useState(null),h=O(t,b=>m(b)),x=c.useRef(void 0),v=$e(r),w=v==="ltr",y=w&&!s||!w&&s;function g(b){const C=x.current||u.getBoundingClientRect(),R=[0,C.width],_=Co(R,y?[n,o]:[o,n]);return x.current=C,_(b-C.left)}return p.jsx(Sa,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:p.jsx(Pa,{dir:v,"data-orientation":"horizontal",...d,ref:h,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const C=g(b.clientX);a==null||a(C)},onSlideMove:b=>{const C=g(b.clientX);i==null||i(C)},onSlideEnd:()=>{x.current=void 0,l==null||l()},onStepKeyDown:b=>{const R=Ra[y?"from-left":"from-right"].includes(b.key);f==null||f({event:b,direction:R?-1:1})}})})}),Xf=c.forwardRef((e,t)=>{const{min:n,max:o,inverted:r,onSlideStart:s,onSlideMove:a,onSlideEnd:i,onStepKeyDown:l,...f}=e,d=c.useRef(null),u=O(t,d),m=c.useRef(void 0),h=!r;function x(v){const w=m.current||d.current.getBoundingClientRect(),y=[0,w.height],b=Co(y,h?[o,n]:[n,o]);return m.current=w,b(v-w.top)}return p.jsx(Sa,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:p.jsx(Pa,{"data-orientation":"vertical",...f,ref:u,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const w=x(v.clientY);s==null||s(w)},onSlideMove:v=>{const w=x(v.clientY);a==null||a(w)},onSlideEnd:()=>{m.current=void 0,i==null||i()},onStepKeyDown:v=>{const y=Ra[h?"from-bottom":"from-top"].includes(v.key);l==null||l({event:v,direction:y?-1:1})}})})}),Pa=c.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:r,onSlideEnd:s,onHomeKeyDown:a,onEndKeyDown:i,onStepKeyDown:l,...f}=e,d=Ct(nt,n);return p.jsx(A.span,{...f,ref:t,onKeyDown:S(e.onKeyDown,u=>{u.key==="Home"?(a(u),u.preventDefault()):u.key==="End"?(i(u),u.preventDefault()):ba.concat(Ca).includes(u.key)&&(l(u),u.preventDefault())}),onPointerDown:S(e.onPointerDown,u=>{const m=u.target;m.setPointerCapture(u.pointerId),u.preventDefault(),d.thumbs.has(m)?m.focus({preventScroll:!0,focusVisible:!1}):o(u)}),onPointerMove:S(e.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&r(u)}),onPointerUp:S(e.onPointerUp,u=>{const m=u.target;m.hasPointerCapture(u.pointerId)&&(m.releasePointerCapture(u.pointerId),s(u))})})}),_a="SliderTrack",qf=c.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=Ct(_a,n);return p.jsx(A.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...o,ref:t})});qf.displayName=_a;var Xn="SliderRange",Zf=c.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=Ct(Xn,n),s=Ea(Xn,n),a=c.useRef(null),i=O(t,a),l=r.values.length,f=r.values.map(m=>ka(m,r.min,r.max)),d=l>1?Math.min(...f):0,u=100-Math.max(...f);return p.jsx(A.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...o,ref:i,style:{...e.style,[s.startEdge]:d+"%",[s.endEdge]:u+"%"}})});Zf.displayName=Xn;var Aa="SliderThumb",[Qf,Ta]=bo(Aa),Ia="SliderThumbProvider";function Ma(e){const{__scopeSlider:t,name:n,children:o,internal_do_not_use_render:r}=e,s=Ct(Ia,t),a=Kf(t),[i,l]=c.useState(null),f=c.useMemo(()=>i?a().findIndex(w=>w.ref.current===i):-1,[a,i]),d=mt(i),u=i?!!s.form||!!i.closest("form"):!0,m=s.values[f],h=n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),x=m===void 0?0:ka(m,s.min,s.max);c.useEffect(()=>{if(i)return s.thumbs.add(i),()=>{s.thumbs.delete(i)}},[i,s.thumbs]);const v={value:m,name:h,form:s.form,isFormControl:u,index:f,thumb:i,onThumbChange:l,percent:x,size:d};return p.jsx(Qf,{scope:t,...v,children:cp(r)?r(v):o})}Ma.displayName=Ia;var Ft="SliderThumbTrigger",Na=c.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=Ct(Ft,n),s=Ea(Ft,n),{index:a,value:i,percent:l,size:f,onThumbChange:d}=Ta(Ft,n),u=O(t,v=>d(v)),m=tp(a,r.values.length),h=f==null?void 0:f[s.size],x=h?op(h,l,s.direction):0;return p.jsx("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[s.startEdge]:`calc(${l}% + ${x}px)`},children:p.jsx(Yn.ItemSlot,{scope:n,children:p.jsx(A.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":r.min,"aria-valuenow":i,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...o,ref:u,style:i===void 0?{display:"none"}:e.style,onFocus:S(e.onFocus,()=>{r.valueIndexToChangeRef.current=a})})})})});Na.displayName=Ft;var Jf=c.forwardRef((e,t)=>{const{__scopeSlider:n,name:o,...r}=e;return p.jsx(Ma,{__scopeSlider:n,name:o,internal_do_not_use_render:({index:s,isFormControl:a})=>p.jsxs(p.Fragment,{children:[p.jsx(Na,{...r,ref:t,__scopeSlider:n}),a?p.jsx(Oa,{__scopeSlider:n},s):null]})})});Jf.displayName=Aa;var Da="SliderBubbleInput",Oa=c.forwardRef(({__scopeSlider:e,...t},n)=>{const{value:o,name:r,form:s}=Ta(Da,e),a=c.useRef(null),i=O(a,n),l=yt(o);return c.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==o&&m){const h=new Event("input",{bubbles:!0});m.call(f,o),f.dispatchEvent(h)}},[l,o]),p.jsx(A.input,{style:{display:"none"},name:r,form:s,...t,ref:i,defaultValue:o})});Oa.displayName=Da;function ep(e=[],t,n){const o=[...e];return o[n]=t,o.sort((r,s)=>r-s)}function ka(e,t,n){const s=100/(n-t)*(e-t);return Kt(s,[0,100])}function tp(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function np(e,t){if(e.length===1)return 0;const n=e.map(r=>Math.abs(r-t)),o=Math.min(...n);return n.indexOf(o)}function op(e,t,n){const o=e/2,s=Co([0,50],[0,o]);return(o-s(t)*n)*n}function rp(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function sp(e,t){if(t>0){const n=rp(e);return Math.min(...n)>=t}return!0}function Co(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function ap(e){if(!Number.isFinite(e))return 0;const t=e.toString();if(t.includes("e")){const[o,r]=t.split("e"),s=o.split(".")[1]||"",a=Number(r);return Math.max(0,s.length-a)}const n=t.split(".")[1];return n?n.length:0}function ip(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}function cp(e){return typeof e=="function"}var jn="rovingFocusGroup.onEntryFocus",lp={bubbles:!1,cancelable:!0},Rt="RovingFocusGroup",[qn,ja,up]=bt(Rt),[dp,ot]=Z(Rt,[up]),[fp,pp]=dp(Rt),La=c.forwardRef((e,t)=>p.jsx(qn.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(qn.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(mp,{...e,ref:t})})}));La.displayName=Rt;var mp=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:f,preventScrollOnEntryFocus:d=!1,...u}=e,m=c.useRef(null),h=O(t,m),x=$e(s),[v,w]=J({prop:a,defaultProp:i??null,onChange:l,caller:Rt}),[y,g]=c.useState(!1),b=ue(f),C=ja(n),R=c.useRef(!1),[E,_]=c.useState(0);return c.useEffect(()=>{const M=m.current;if(M)return M.addEventListener(jn,b),()=>M.removeEventListener(jn,b)},[b]),p.jsx(fp,{scope:n,orientation:o,dir:x,loop:r,currentTabStopId:v,onItemFocus:c.useCallback(M=>w(M),[w]),onItemShiftTab:c.useCallback(()=>g(!0),[]),onFocusableItemAdd:c.useCallback(()=>_(M=>M+1),[]),onFocusableItemRemove:c.useCallback(()=>_(M=>M-1),[]),children:p.jsx(A.div,{tabIndex:y||E===0?-1:0,"data-orientation":o,...u,ref:h,style:{outline:"none",...e.style},onMouseDown:S(e.onMouseDown,()=>{R.current=!0}),onFocus:S(e.onFocus,M=>{const T=!R.current;if(M.target===M.currentTarget&&T&&!y){const k=new CustomEvent(jn,lp);if(M.currentTarget.dispatchEvent(k),!k.defaultPrevented){const j=C().filter(L=>L.focusable),N=j.find(L=>L.active),$=j.find(L=>L.id===v),H=[N,$,...j].filter(Boolean).map(L=>L.ref.current);Ba(H,d)}}R.current=!1}),onBlur:S(e.onBlur,()=>g(!1))})})}),Fa="RovingFocusGroupItem",$a=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:a,...i}=e,l=te(),f=s||l,d=pp(Fa,n),u=d.currentTabStopId===f,m=ja(n),{onFocusableItemAdd:h,onFocusableItemRemove:x,currentTabStopId:v}=d;return c.useEffect(()=>{if(o)return h(),()=>x()},[o,h,x]),p.jsx(qn.ItemSlot,{scope:n,id:f,focusable:o,active:r,children:p.jsx(A.span,{tabIndex:u?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:S(e.onMouseDown,w=>{o?d.onItemFocus(f):w.preventDefault()}),onFocus:S(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:S(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){d.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const y=gp(w,d.orientation,d.dir);if(y!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let b=m().filter(C=>C.focusable).map(C=>C.ref.current);if(y==="last")b.reverse();else if(y==="prev"||y==="next"){y==="prev"&&b.reverse();const C=b.indexOf(w.currentTarget);b=d.loop?xp(b,C+1):b.slice(C+1)}setTimeout(()=>Ba(b))}}),children:typeof a=="function"?a({isCurrentTabStop:u,hasTabStop:v!=null}):a})})});$a.displayName=Fa;var vp={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function hp(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function gp(e,t,n){const o=hp(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return vp[o]}function Ba(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function xp(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Ro=La,So=$a,Eo="Radio",[wp,Va]=Z(Eo),[yp,gn]=wp(Eo);function Ha(e){const{__scopeRadio:t,checked:n=!1,children:o,disabled:r,form:s,name:a,onCheck:i,required:l,value:f="on",internal_do_not_use_render:d}=e,[u,m]=c.useState(null),[h,x]=c.useState(null),v=c.useRef(!1),w=u?!!s||!!u.closest("form"):!0,y={checked:n,disabled:r,required:l,name:a,form:s,value:f,control:u,setControl:m,hasConsumerStoppedPropagationRef:v,isFormControl:w,bubbleInput:h,setBubbleInput:x,onCheck:()=>i==null?void 0:i()};return p.jsx(yp,{scope:t,...y,children:Cp(d)?d(y):o})}var Ga="RadioTrigger",Po=c.forwardRef(({__scopeRadio:e,onClick:t,...n},o)=>{const{checked:r,disabled:s,value:a,setControl:i,onCheck:l,hasConsumerStoppedPropagationRef:f,isFormControl:d,bubbleInput:u}=gn(Ga,e),m=O(o,i);return p.jsx(A.button,{type:"button",role:"radio","aria-checked":r,"data-state":za(r),"data-disabled":s?"":void 0,disabled:s,value:a,...n,ref:m,onClick:S(t,h=>{r||l(),u&&d&&(f.current=h.isPropagationStopped(),f.current||h.stopPropagation())})})});Po.displayName=Ga;var bp=c.forwardRef((e,t)=>{const{__scopeRadio:n,name:o,checked:r,required:s,disabled:a,value:i,onCheck:l,form:f,...d}=e;return p.jsx(Ha,{__scopeRadio:n,checked:r,disabled:a,required:s,onCheck:l,name:o,form:f,value:i,internal_do_not_use_render:({isFormControl:u})=>p.jsxs(p.Fragment,{children:[p.jsx(Po,{...d,ref:t,__scopeRadio:n}),u&&p.jsx(_o,{__scopeRadio:n})]})})});bp.displayName=Eo;var Ka="RadioIndicator",Ua=c.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:o,...r}=e,s=gn(Ka,n);return p.jsx(Q,{present:o||s.checked,children:p.jsx(A.span,{"data-state":za(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})})});Ua.displayName=Ka;var Wa="RadioBubbleInput",_o=c.forwardRef(({__scopeRadio:e,...t},n)=>{const{control:o,checked:r,required:s,disabled:a,name:i,value:l,form:f,bubbleInput:d,setBubbleInput:u,hasConsumerStoppedPropagationRef:m}=gn(Wa,e),h=O(n,u),x=yt(r),v=mt(o);c.useEffect(()=>{const y=d;if(!y)return;const g=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(g,"checked").set,R=!m.current;if(x!==r&&C){const E=new Event("click",{bubbles:R});C.call(y,r),y.dispatchEvent(E)}},[d,x,r,m]);const w=c.useRef(r);return p.jsx(A.input,{type:"radio","aria-hidden":!0,defaultChecked:w.current,required:s,disabled:a,name:i,value:l,form:f,...t,tabIndex:-1,ref:h,style:{...t.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});_o.displayName=Wa;function Cp(e){return typeof e=="function"}function za(e){return e?"checked":"unchecked"}var Rp=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],xn="RadioGroup",[Sp]=Z(xn,[ot,Va]),Ya=ot(),wn=Va(),[Ep,Pp]=Sp(xn),_p=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:o,defaultValue:r,value:s,required:a=!1,disabled:i=!1,orientation:l,dir:f,loop:d=!0,onValueChange:u,...m}=e,h=Ya(n),x=$e(f),[v,w]=J({prop:s,defaultProp:r??null,onChange:u,caller:xn});return p.jsx(Ep,{scope:n,name:o,required:a,disabled:i,value:v,onValueChange:w,children:p.jsx(Ro,{asChild:!0,...h,orientation:l,dir:x,loop:d,children:p.jsx(A.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":i?"":void 0,dir:x,...m,ref:t})})})});_p.displayName=xn;var Ap="RadioGroupItem",Tp="RadioGroupItemProvider",Xa="RadioGroupItemTrigger",Ip="RadioGroupItemBubbleInput";function Mp(e){const{__scopeRadioGroup:t,value:n,disabled:o,children:r,internal_do_not_use_render:s}=e,a=Pp(Tp,t),i=wn(t),l=a.disabled||o;return p.jsx(Ha,{...i,checked:a.value===n,disabled:l,required:a.required,name:a.name,value:n,onCheck:()=>a.onValueChange(n),internal_do_not_use_render:s,children:r})}var qa=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...o}=e,r=Ya(n),s=wn(n),{checked:a,disabled:i}=gn(Xa,s.__scopeRadio),l=c.useRef(null),f=O(t,l),d=c.useRef(!1);return c.useEffect(()=>{const u=h=>{Rp.includes(h.key)&&(d.current=!0)},m=()=>d.current=!1;return document.addEventListener("keydown",u),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",u),document.removeEventListener("keyup",m)}},[]),p.jsx(So,{asChild:!0,...r,focusable:!i,active:a,children:p.jsx(Po,{...s,...o,ref:f,onKeyDown:S(o.onKeyDown,u=>{u.key==="Enter"&&u.preventDefault()}),onFocus:S(o.onFocus,()=>{var u;d.current&&((u=l.current)==null||u.click())})})})});qa.displayName=Xa;var Np=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,value:o,disabled:r,...s}=e;return p.jsx(Mp,{__scopeRadioGroup:n,value:o,disabled:r,internal_do_not_use_render:({isFormControl:a})=>p.jsxs(p.Fragment,{children:[p.jsx(qa,{...s,ref:t,__scopeRadioGroup:n}),a&&p.jsx(Za,{__scopeRadioGroup:n})]})})});Np.displayName=Ap;var Za=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...o}=e,r=wn(n);return p.jsx(_o,{...r,...o,ref:t})});Za.displayName=Ip;var Dp="RadioGroupIndicator",Op=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...o}=e,r=wn(n);return p.jsx(Ua,{...r,...o,ref:t})});Op.displayName=Dp;var Zn=["Enter"," "],kp=["ArrowDown","PageUp","Home"],Qa=["ArrowUp","PageDown","End"],jp=[...kp,...Qa],Lp={ltr:[...Zn,"ArrowRight"],rtl:[...Zn,"ArrowLeft"]},Fp={ltr:["ArrowLeft"],rtl:["ArrowRight"]},St="Menu",[ut,$p,Bp]=bt(St),[Ve,Ja]=Z(St,[Bp,Ne,ot]),yn=Ne(),ei=ot(),[Vp,He]=Ve(St),[Hp,Et]=Ve(St),ti=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:s,modal:a=!0}=e,i=yn(t),[l,f]=c.useState(null),d=c.useRef(!1),u=ue(s),m=$e(r);return c.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),c.useEffect(()=>{if(!n)return;const h=()=>u(!1);return window.addEventListener("blur",h),()=>window.removeEventListener("blur",h)},[n,u]),p.jsx(Jt,{...i,children:p.jsx(Vp,{scope:t,open:n,onOpenChange:u,content:l,onContentChange:f,children:p.jsx(Hp,{scope:t,onClose:c.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:m,modal:a,children:o})})})};ti.displayName=St;var Gp="MenuAnchor",Ao=c.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=yn(n);return p.jsx(vt,{...r,...o,ref:t})});Ao.displayName=Gp;var To="MenuPortal",[Kp,ni]=Ve(To,{forceMount:void 0}),oi=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,s=He(To,t);return p.jsx(Kp,{scope:t,forceMount:n,children:p.jsx(Q,{present:n||s.open,children:p.jsx(ht,{asChild:!0,container:r,children:o})})})};oi.displayName=To;var ce="MenuContent",[Up,Io]=Ve(ce),ri=c.forwardRef((e,t)=>{const n=ni(ce,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=He(ce,e.__scopeMenu),a=Et(ce,e.__scopeMenu);return p.jsx(ut.Provider,{scope:e.__scopeMenu,children:p.jsx(Q,{present:o||s.open,children:p.jsx(ut.Slot,{scope:e.__scopeMenu,children:a.modal?p.jsx(Wp,{...r,ref:t}):p.jsx(zp,{...r,ref:t})})})})}),Wp=c.forwardRef((e,t)=>{const n=He(ce,e.__scopeMenu),o=c.useRef(null),r=O(t,o);return c.useEffect(()=>{const s=o.current;if(s)return cn(s)},[]),p.jsx(Mo,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),zp=c.forwardRef((e,t)=>{const n=He(ce,e.__scopeMenu);return p.jsx(Mo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Yp=Ae("MenuContent.ScrollLock"),Mo=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:l,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:m,onDismiss:h,disableOutsideScroll:x,...v}=e,w=He(ce,n),y=Et(ce,n),g=yn(n),b=ei(n),C=$p(n),[R,E]=c.useState(null),_=c.useRef(null),M=O(t,_,w.onContentChange),T=c.useRef(0),k=c.useRef(""),j=c.useRef(0),N=c.useRef(null),$=c.useRef("right"),F=c.useRef(0),H=x?xt:c.Fragment,L=x?{as:Yp,allowPinchZoom:!0}:void 0,B=P=>{var D,U;const V=k.current+P,Y=C().filter(z=>!z.disabled),X=document.activeElement,ae=(D=Y.find(z=>z.ref.current===X))==null?void 0:D.textValue,ie=Y.map(z=>z.textValue),ye=am(ie,V,ae),ne=(U=Y.find(z=>z.textValue===ye))==null?void 0:U.ref.current;(function z(K){k.current=K,window.clearTimeout(T.current),K!==""&&(T.current=window.setTimeout(()=>z(""),1e3))})(V),ne&&setTimeout(()=>ne.focus())};c.useEffect(()=>()=>window.clearTimeout(T.current),[]),sn();const I=c.useCallback(P=>{var Y,X;return $.current===((Y=N.current)==null?void 0:Y.side)&&cm(P,(X=N.current)==null?void 0:X.area)},[]);return p.jsx(Up,{scope:n,searchRef:k,onItemEnter:c.useCallback(P=>{I(P)&&P.preventDefault()},[I]),onItemLeave:c.useCallback(P=>{var V;I(P)||((V=_.current)==null||V.focus(),E(null))},[I]),onTriggerLeave:c.useCallback(P=>{I(P)&&P.preventDefault()},[I]),pointerGraceTimerRef:j,onPointerGraceIntentChange:c.useCallback(P=>{N.current=P},[]),children:p.jsx(H,{...L,children:p.jsx(gt,{asChild:!0,trapped:r,onMountAutoFocus:S(s,P=>{var V;P.preventDefault(),(V=_.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:p.jsx(Je,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:m,onDismiss:h,children:p.jsx(Ro,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:o,currentTabStopId:R,onCurrentTabStopIdChange:E,onEntryFocus:S(l,P=>{y.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(en,{role:"menu","aria-orientation":"vertical","data-state":yi(w.open),"data-radix-menu-content":"",dir:y.dir,...g,...v,ref:M,style:{outline:"none",...v.style},onKeyDown:S(v.onKeyDown,P=>{const Y=P.target.closest("[data-radix-menu-content]")===P.currentTarget,X=P.ctrlKey||P.altKey||P.metaKey,ae=P.key.length===1;Y&&(P.key==="Tab"&&P.preventDefault(),!X&&ae&&B(P.key));const ie=_.current;if(P.target!==ie||!jp.includes(P.key))return;P.preventDefault();const ne=C().filter(D=>!D.disabled).map(D=>D.ref.current);Qa.includes(P.key)&&ne.reverse(),rm(ne)}),onBlur:S(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(T.current),k.current="")}),onPointerMove:S(e.onPointerMove,dt(P=>{const V=P.target,Y=F.current!==P.clientX;if(P.currentTarget.contains(V)&&Y){const X=P.clientX>F.current?"right":"left";$.current=X,F.current=P.clientX}}))})})})})})})});ri.displayName=ce;var Xp="MenuGroup",No=c.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(A.div,{role:"group",...o,ref:t})});No.displayName=Xp;var qp="MenuLabel",si=c.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(A.div,{...o,ref:t})});si.displayName=qp;var Wt="MenuItem",hr="menu.itemSelect",bn=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,s=c.useRef(null),a=Et(Wt,e.__scopeMenu),i=Io(Wt,e.__scopeMenu),l=O(t,s),f=c.useRef(!1),d=()=>{const u=s.current;if(!n&&u){const m=new CustomEvent(hr,{bubbles:!0,cancelable:!0});u.addEventListener(hr,h=>o==null?void 0:o(h),{once:!0}),wr(u,m),m.defaultPrevented?f.current=!1:a.onClose()}};return p.jsx(ai,{...r,ref:l,disabled:n,onClick:S(e.onClick,d),onPointerDown:u=>{var m;(m=e.onPointerDown)==null||m.call(e,u),f.current=!0},onPointerUp:S(e.onPointerUp,u=>{var m;f.current||(m=u.currentTarget)==null||m.click()}),onKeyDown:S(e.onKeyDown,u=>{const m=i.searchRef.current!=="";n||m&&u.key===" "||Zn.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});bn.displayName=Wt;var ai=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=e,a=Io(Wt,n),i=ei(n),l=c.useRef(null),f=O(t,l),[d,u]=c.useState(!1),[m,h]=c.useState("");return c.useEffect(()=>{const x=l.current;x&&h((x.textContent??"").trim())},[s.children]),p.jsx(ut.ItemSlot,{scope:n,disabled:o,textValue:r??m,children:p.jsx(So,{asChild:!0,...i,focusable:!o,children:p.jsx(A.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:f,onPointerMove:S(e.onPointerMove,dt(x=>{o?a.onItemLeave(x):(a.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,dt(x=>a.onItemLeave(x))),onFocus:S(e.onFocus,()=>u(!0)),onBlur:S(e.onBlur,()=>u(!1))})})})}),Zp="MenuCheckboxItem",ii=c.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return p.jsx(fi,{scope:e.__scopeMenu,checked:n,children:p.jsx(bn,{role:"menuitemcheckbox","aria-checked":zt(n)?"mixed":n,...r,ref:t,"data-state":Oo(n),onSelect:S(r.onSelect,()=>o==null?void 0:o(zt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ii.displayName=Zp;var ci="MenuRadioGroup",[Qp,Jp]=Ve(ci,{value:void 0,onValueChange:()=>{}}),li=c.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,s=ue(o);return p.jsx(Qp,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(No,{...r,ref:t})})});li.displayName=ci;var ui="MenuRadioItem",di=c.forwardRef((e,t)=>{const{value:n,...o}=e,r=Jp(ui,e.__scopeMenu),s=n===r.value;return p.jsx(fi,{scope:e.__scopeMenu,checked:s,children:p.jsx(bn,{role:"menuitemradio","aria-checked":s,...o,ref:t,"data-state":Oo(s),onSelect:S(o.onSelect,()=>{var a;return(a=r.onValueChange)==null?void 0:a.call(r,n)},{checkForDefaultPrevented:!1})})})});di.displayName=ui;var Do="MenuItemIndicator",[fi,em]=Ve(Do,{checked:!1}),pi=c.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,s=em(Do,n);return p.jsx(Q,{present:o||zt(s.checked)||s.checked===!0,children:p.jsx(A.span,{...r,ref:t,"data-state":Oo(s.checked)})})});pi.displayName=Do;var tm="MenuSeparator",mi=c.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(A.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});mi.displayName=tm;var nm="MenuArrow",vi=c.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=yn(n);return p.jsx(tn,{...r,...o,ref:t})});vi.displayName=nm;var om="MenuSub",[Pv,hi]=Ve(om),it="MenuSubTrigger",gi=c.forwardRef((e,t)=>{const n=He(it,e.__scopeMenu),o=Et(it,e.__scopeMenu),r=hi(it,e.__scopeMenu),s=Io(it,e.__scopeMenu),a=c.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:l}=s,f={__scopeMenu:e.__scopeMenu},d=c.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return c.useEffect(()=>d,[d]),c.useEffect(()=>{const u=i.current;return()=>{window.clearTimeout(u),l(null)}},[i,l]),p.jsx(Ao,{asChild:!0,...f,children:p.jsx(ai,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":n.open?r.contentId:void 0,"data-state":yi(n.open),...e,ref:eo(t,r.onTriggerChange),onClick:u=>{var m;(m=e.onClick)==null||m.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,dt(u=>{s.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:S(e.onPointerLeave,dt(u=>{var h,x;d();const m=(h=n.content)==null?void 0:h.getBoundingClientRect();if(m){const v=(x=n.content)==null?void 0:x.dataset.side,w=v==="right",y=w?-5:5,g=m[w?"left":"right"],b=m[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+y,y:u.clientY},{x:g,y:m.top},{x:b,y:m.top},{x:b,y:m.bottom},{x:g,y:m.bottom}],side:v}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:S(e.onKeyDown,u=>{var h;const m=s.searchRef.current!=="";e.disabled||m&&u.key===" "||Lp[o.dir].includes(u.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),u.preventDefault())})})})});gi.displayName=it;var xi="MenuSubContent",wi=c.forwardRef((e,t)=>{const n=ni(ce,e.__scopeMenu),{forceMount:o=n.forceMount,align:r="start",...s}=e,a=He(ce,e.__scopeMenu),i=Et(ce,e.__scopeMenu),l=hi(xi,e.__scopeMenu),f=c.useRef(null),d=O(t,f);return p.jsx(ut.Provider,{scope:e.__scopeMenu,children:p.jsx(Q,{present:o||a.open,children:p.jsx(ut.Slot,{scope:e.__scopeMenu,children:p.jsx(Mo,{id:l.contentId,"aria-labelledby":l.triggerId,...s,ref:d,align:r,side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var m;i.isUsingKeyboardRef.current&&((m=f.current)==null||m.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:S(e.onFocusOutside,u=>{u.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:S(e.onKeyDown,u=>{var x;const m=u.currentTarget.contains(u.target),h=Fp[i.dir].includes(u.key);m&&h&&(a.onOpenChange(!1),(x=l.trigger)==null||x.focus(),u.preventDefault())})})})})})});wi.displayName=xi;function yi(e){return e?"open":"closed"}function zt(e){return e==="indeterminate"}function Oo(e){return zt(e)?"indeterminate":e?"checked":"unchecked"}function rm(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function sm(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function am(e,t,n){const r=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=sm(e,Math.max(s,0));r.length===1&&(a=a.filter(f=>f!==n));const l=a.find(f=>f.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function im(e,t){const{x:n,y:o}=e;let r=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const i=t[s],l=t[a],f=i.x,d=i.y,u=l.x,m=l.y;d>o!=m>o&&n<(u-f)*(o-d)/(m-d)+f&&(r=!r)}return r}function cm(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return im(n,t)}function dt(e){return t=>t.pointerType==="mouse"?e(t):void 0}var lm=ti,um=Ao,dm=oi,fm=ri,pm=No,mm=si,vm=bn,hm=ii,gm=li,xm=di,wm=pi,ym=mi,bm=vi,Cm=gi,Rm=wi,Cn="DropdownMenu",[Sm]=Z(Cn,[Ja]),ee=Ja(),[Em,bi]=Sm(Cn),Ci=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,l=ee(t),f=c.useRef(null),[d,u]=J({prop:r,defaultProp:s??!1,onChange:a,caller:Cn});return p.jsx(Em,{scope:t,triggerId:te(),triggerRef:f,contentId:te(),open:d,onOpenChange:u,onOpenToggle:c.useCallback(()=>u(m=>!m),[u]),modal:i,children:p.jsx(lm,{...l,open:d,onOpenChange:u,dir:o,modal:i,children:n})})};Ci.displayName=Cn;var Ri="DropdownMenuTrigger",Si=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,s=bi(Ri,n),a=ee(n);return p.jsx(um,{asChild:!0,...a,children:p.jsx(A.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":o?"":void 0,disabled:o,...r,ref:eo(t,s.triggerRef),onPointerDown:S(e.onPointerDown,i=>{!o&&i.button===0&&i.ctrlKey===!1&&(s.onOpenToggle(),s.open||i.preventDefault())}),onKeyDown:S(e.onKeyDown,i=>{o||(["Enter"," "].includes(i.key)&&s.onOpenToggle(),i.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});Si.displayName=Ri;var Pm="DropdownMenuPortal",Ei=e=>{const{__scopeDropdownMenu:t,...n}=e,o=ee(t);return p.jsx(dm,{...o,...n})};Ei.displayName=Pm;var Pi="DropdownMenuContent",_i=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=bi(Pi,n),s=ee(n),a=c.useRef(!1);return p.jsx(fm,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:t,onCloseAutoFocus:S(e.onCloseAutoFocus,i=>{var l;a.current||(l=r.triggerRef.current)==null||l.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:S(e.onInteractOutside,i=>{const l=i.detail.originalEvent,f=l.button===0&&l.ctrlKey===!0,d=l.button===2||f;(!r.modal||d)&&(a.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)"}})});_i.displayName=Pi;var _m="DropdownMenuGroup",Am=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(pm,{...r,...o,ref:t})});Am.displayName=_m;var Tm="DropdownMenuLabel",Ai=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(mm,{...r,...o,ref:t})});Ai.displayName=Tm;var Im="DropdownMenuItem",Ti=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(vm,{...r,...o,ref:t})});Ti.displayName=Im;var Mm="DropdownMenuCheckboxItem",Ii=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(hm,{...r,...o,ref:t})});Ii.displayName=Mm;var Nm="DropdownMenuRadioGroup",Dm=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(gm,{...r,...o,ref:t})});Dm.displayName=Nm;var Om="DropdownMenuRadioItem",Mi=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(xm,{...r,...o,ref:t})});Mi.displayName=Om;var km="DropdownMenuItemIndicator",Ni=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(wm,{...r,...o,ref:t})});Ni.displayName=km;var jm="DropdownMenuSeparator",Di=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(ym,{...r,...o,ref:t})});Di.displayName=jm;var Lm="DropdownMenuArrow",Fm=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(bm,{...r,...o,ref:t})});Fm.displayName=Lm;var $m="DropdownMenuSubTrigger",Oi=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(Cm,{...r,...o,ref:t})});Oi.displayName=$m;var Bm="DropdownMenuSubContent",ki=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=ee(n);return p.jsx(Rm,{...r,...o,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ki.displayName=Bm;var _v=Ci,Av=Si,Tv=Ei,Iv=_i,Mv=Ai,Nv=Ti,Dv=Ii,Ov=Mi,kv=Ni,jv=Di,Lv=Oi,Fv=ki,Rn="Tabs",[Vm]=Z(Rn,[ot]),ji=ot(),[Hm,ko]=Vm(Rn),Li=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:s,orientation:a="horizontal",dir:i,activationMode:l="automatic",...f}=e,d=$e(i),[u,m]=J({prop:o,onChange:r,defaultProp:s??"",caller:Rn});return p.jsx(Hm,{scope:n,baseId:te(),value:u,onValueChange:m,orientation:a,dir:d,activationMode:l,children:p.jsx(A.div,{dir:d,"data-orientation":a,...f,ref:t})})});Li.displayName=Rn;var Fi="TabsList",$i=c.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,s=ko(Fi,n),a=ji(n);return p.jsx(Ro,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:p.jsx(A.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});$i.displayName=Fi;var Bi="TabsTrigger",Vi=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...s}=e,a=ko(Bi,n),i=ji(n),l=Ki(a.baseId,o),f=Ui(a.baseId,o),d=o===a.value;return p.jsx(So,{asChild:!0,...i,focusable:!r,active:d,children:p.jsx(A.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":f,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:t,onMouseDown:S(e.onMouseDown,u=>{!r&&u.button===0&&u.ctrlKey===!1?a.onValueChange(o):u.preventDefault()}),onKeyDown:S(e.onKeyDown,u=>{[" ","Enter"].includes(u.key)&&a.onValueChange(o)}),onFocus:S(e.onFocus,()=>{const u=a.activationMode!=="manual";!d&&!r&&u&&a.onValueChange(o)})})})});Vi.displayName=Bi;var Hi="TabsContent",Gi=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:s,...a}=e,i=ko(Hi,n),l=Ki(i.baseId,o),f=Ui(i.baseId,o),d=o===i.value,u=c.useRef(d);return c.useEffect(()=>{const m=requestAnimationFrame(()=>u.current=!1);return()=>cancelAnimationFrame(m)},[]),p.jsx(Q,{present:r||d,children:({present:m})=>p.jsx(A.div,{"data-state":d?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!m,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:u.current?"0s":void 0},children:m&&s})})});Gi.displayName=Hi;function Ki(e,t){return`${e}-trigger-${t}`}function Ui(e,t){return`${e}-content-${t}`}var $v=Li,Bv=$i,Vv=Vi,Hv=Gi,Sn="Collapsible",[Gm,Wi]=Z(Sn),[Km,jo]=Gm(Sn),zi=c.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:r,disabled:s,onOpenChange:a,...i}=e,[l,f]=J({prop:o,defaultProp:r??!1,onChange:a,caller:Sn});return p.jsx(Km,{scope:n,disabled:s,contentId:te(),open:l,onOpenToggle:c.useCallback(()=>f(d=>!d),[f]),children:p.jsx(A.div,{"data-state":Fo(l),"data-disabled":s?"":void 0,...i,ref:t})})});zi.displayName=Sn;var Yi="CollapsibleTrigger",Xi=c.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,r=jo(Yi,n);return p.jsx(A.button,{type:"button","aria-controls":r.open?r.contentId:void 0,"aria-expanded":r.open||!1,"data-state":Fo(r.open),"data-disabled":r.disabled?"":void 0,disabled:r.disabled,...o,ref:t,onClick:S(e.onClick,r.onOpenToggle)})});Xi.displayName=Yi;var Lo="CollapsibleContent",qi=c.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=jo(Lo,e.__scopeCollapsible);return p.jsx(Q,{present:n||r.open,children:({present:s})=>p.jsx(Um,{...o,ref:t,present:s})})});qi.displayName=Lo;var Um=c.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:r,...s}=e,a=jo(Lo,n),[i,l]=c.useState(o),f=c.useRef(null),d=O(t,f),u=c.useRef(0),m=u.current,h=c.useRef(0),x=h.current,v=a.open||i,w=c.useRef(v),y=c.useRef(void 0);return c.useEffect(()=>{const g=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(g)},[]),q(()=>{const g=f.current;if(g){y.current=y.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const b=g.getBoundingClientRect();u.current=b.height,h.current=b.width,w.current||(g.style.transitionDuration=y.current.transitionDuration,g.style.animationName=y.current.animationName),l(o)}},[a.open,o]),p.jsx(A.div,{"data-state":Fo(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!v,...s,ref:d,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:v&&r})});function Fo(e){return e?"open":"closed"}var Wm=zi,zm=Xi,Ym=qi,me="Accordion",Xm=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[$o,qm,Zm]=bt(me),[En]=Z(me,[Zm,Wi]),Bo=Wi(),Zi=c.forwardRef((e,t)=>{const{type:n,...o}=e,r=o,s=o;return p.jsx($o.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?p.jsx(tv,{...s,ref:t}):p.jsx(ev,{...r,ref:t})})});Zi.displayName=me;var[Qi,Qm]=En(me),[Ji,Jm]=En(me,{collapsible:!1}),ev=c.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},collapsible:s=!1,...a}=e,[i,l]=J({prop:n,defaultProp:o??"",onChange:r,caller:me});return p.jsx(Qi,{scope:e.__scopeAccordion,value:c.useMemo(()=>i?[i]:[],[i]),onItemOpen:l,onItemClose:c.useCallback(()=>s&&l(""),[s,l]),children:p.jsx(Ji,{scope:e.__scopeAccordion,collapsible:s,children:p.jsx(ec,{...a,ref:t})})})}),tv=c.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:r=()=>{},...s}=e,[a,i]=J({prop:n,defaultProp:o??[],onChange:r,caller:me}),l=c.useCallback(d=>i((u=[])=>[...u,d]),[i]),f=c.useCallback(d=>i((u=[])=>u.filter(m=>m!==d)),[i]);return p.jsx(Qi,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:f,children:p.jsx(Ji,{scope:e.__scopeAccordion,collapsible:!0,children:p.jsx(ec,{...s,ref:t})})})}),[nv,Pn]=En(me),ec=c.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:o,dir:r,orientation:s="vertical",...a}=e,i=c.useRef(null),l=O(i,t),f=qm(n),u=$e(r)==="ltr",m=S(e.onKeyDown,h=>{var M;if(!Xm.includes(h.key))return;const x=h.target,v=f().filter(T=>{var k;return!((k=T.ref.current)!=null&&k.disabled)}),w=v.findIndex(T=>T.ref.current===x),y=v.length;if(w===-1)return;h.preventDefault();let g=w;const b=0,C=y-1,R=()=>{g=w+1,g>C&&(g=b)},E=()=>{g=w-1,g<b&&(g=C)};switch(h.key){case"Home":g=b;break;case"End":g=C;break;case"ArrowRight":s==="horizontal"&&(u?R():E());break;case"ArrowDown":s==="vertical"&&R();break;case"ArrowLeft":s==="horizontal"&&(u?E():R());break;case"ArrowUp":s==="vertical"&&E();break}const _=g%y;(M=v[_].ref.current)==null||M.focus()});return p.jsx(nv,{scope:n,disabled:o,direction:r,orientation:s,children:p.jsx($o.Slot,{scope:n,children:p.jsx(A.div,{...a,"data-orientation":s,ref:l,onKeyDown:o?void 0:m})})})}),Yt="AccordionItem",[ov,Vo]=En(Yt),tc=c.forwardRef((e,t)=>{const{__scopeAccordion:n,value:o,...r}=e,s=Pn(Yt,n),a=Qm(Yt,n),i=Bo(n),l=te(),f=o&&a.value.includes(o)||!1,d=s.disabled||e.disabled;return p.jsx(ov,{scope:n,open:f,disabled:d,triggerId:l,children:p.jsx(Wm,{"data-orientation":s.orientation,"data-state":ic(f),...i,...r,ref:t,disabled:d,open:f,onOpenChange:u=>{u?a.onItemOpen(o):a.onItemClose(o)}})})});tc.displayName=Yt;var nc="AccordionHeader",oc=c.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=Pn(me,n),s=Vo(nc,n);return p.jsx(A.h3,{"data-orientation":r.orientation,"data-state":ic(s.open),"data-disabled":s.disabled?"":void 0,...o,ref:t})});oc.displayName=nc;var Qn="AccordionTrigger",rc=c.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=Pn(me,n),s=Vo(Qn,n),a=Jm(Qn,n),i=Bo(n);return p.jsx($o.ItemSlot,{scope:n,children:p.jsx(zm,{"aria-disabled":s.open&&!a.collapsible||void 0,"data-orientation":r.orientation,id:s.triggerId,...i,...o,ref:t})})});rc.displayName=Qn;var sc="AccordionContent",ac=c.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,r=Pn(me,n),s=Vo(sc,n),a=Bo(n);return p.jsx(Ym,{role:"region","aria-labelledby":s.triggerId,"data-orientation":r.orientation,...a,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});ac.displayName=sc;function ic(e){return e?"open":"closed"}var Gv=Zi,Kv=tc,Uv=oc,Wv=rc,zv=ac;export{Zf as $,Ad as A,sf as B,dv as C,as as D,lf as E,Af as F,Tf as G,ff as H,pf as I,wf as J,Rf as K,Ef as L,_f as M,Pf as N,wv as O,cv as P,Mf as Q,lv as R,av as S,uv as T,rf as U,af as V,Ff as W,$f as X,Ev as Y,zf as Z,qf as _,us as a,Jf as a0,_p as a1,Np as a2,Op as a3,Lv as a4,Fv as a5,Tv as a6,Iv as a7,Nv as a8,Dv as a9,kv as aa,Ov as ab,Mv as ac,jv as ad,_v as ae,Av as af,$v as ag,Bv as ah,Vv as ai,Hv as aj,Gv as ak,Kv as al,Uv as am,Wv as an,zv as ao,fs as b,mo as c,vs as d,gs as e,cs as f,mv as g,vv as h,fv as i,pv as j,hv as k,A as l,ds as m,eo as n,Td as o,Id as p,xv as q,yv as r,Rv as s,Sv as t,te as u,bv as v,Cv as w,gv as x,zd as y,Yd as z};