import{r as c,a as Kt,R as nr,b as Ne,v as Ji}from"./charts-vendor-Cji9-Yri.js";var or={exports:{}},Gt={};/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var ec=c,tc=Symbol.for("react.element"),nc=Symbol.for("react.fragment"),oc=Object.prototype.hasOwnProperty,rc=ec.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,sc={key:!0,ref:!0,__self:!0,__source:!0};function rr(e,t,n){var o,r={},s=null,a=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(o in t)oc.call(t,o)&&!sc.hasOwnProperty(o)&&(r[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps,t)r[o]===void 0&&(r[o]=t[o]);return{$$typeof:tc,type:e,key:s,ref:a,props:r,_owner:rc.current}}Gt.Fragment=nc;Gt.jsx=rr;Gt.jsxs=rr;or.exports=Gt;var p=or.exports;function Ao(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zt(...e){return t=>{let n=!1;const o=e.map(r=>{const s=Ao(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():Ao(e[r],null)}}}}function O(...e){return c.useCallback(zt(...e),e)}function Pe(e){const t=ac(e),n=c.forwardRef((o,r)=>{const{children:s,...a}=o,i=c.Children.toArray(s),l=i.find(ic);if(l){const u=l.props.children,f=i.map(d=>d===l?c.Children.count(u)>1?c.Children.only(null):c.isValidElement(u)?u.props.children:null:d);return p.jsx(t,{...a,ref:r,children:c.isValidElement(u)?c.cloneElement(u,void 0,f):null})}return p.jsx(t,{...a,ref:r,children:s})});return n.displayName=`${e}.Slot`,n}var Wv=Pe("Slot");function ac(e){const t=c.forwardRef((n,o)=>{const{children:r,...s}=n;if(c.isValidElement(r)){const a=lc(r),i=cc(s,r.props);return r.type!==c.Fragment&&(i.ref=o?zt(o,a):a),c.cloneElement(r,i)}return c.Children.count(r)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sr=Symbol("radix.slottable");function ar(e){const t=({children:n})=>p.jsx(p.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=sr,t}function ic(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sr}function cc(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 lc(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 uc(e,t){const n=c.createContext(t),o=s=>{const{children:a,...i}=s,l=c.useMemo(()=>i,Object.values(i));return p.jsx(n.Provider,{value:l,children:a})};o.displayName=e+"Provider";function r(s){const a=c.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[o,r]}function q(e,t=[]){let n=[];function o(s,a){const i=c.createContext(a),l=n.length;n=[...n,a];const u=d=>{var w;const{scope:v,children:h,...x}=d,m=((w=v==null?void 0:v[e])==null?void 0:w[l])||i,g=c.useMemo(()=>x,Object.values(x));return p.jsx(m.Provider,{value:g,children:h})};u.displayName=s+"Provider";function f(d,v){var m;const h=((m=v==null?void 0:v[e])==null?void 0:m[l])||i,x=c.useContext(h);if(x)return x;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const r=()=>{const s=n.map(a=>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:u})=>{const d=l(s)[`__scope${u}`];return{...i,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function le(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)},[])}var X=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},fc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_=fc.reduce((e,t)=>{const n=Pe(`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 ir(e,t){e&&Kt.flushSync(()=>e.dispatchEvent(t))}var cr={exports:{}},lr={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ge=c;function pc(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vc=typeof Object.is=="function"?Object.is:pc,mc=Ge.useState,hc=Ge.useEffect,gc=Ge.useLayoutEffect,xc=Ge.useDebugValue;function wc(e,t){var n=t(),o=mc({inst:{value:n,getSnapshot:t}}),r=o[0].inst,s=o[1];return gc(function(){r.value=n,r.getSnapshot=t,bn(r)&&s({inst:r})},[e,n,t]),hc(function(){return bn(r)&&s({inst:r}),e(function(){bn(r)&&s({inst:r})})},[e]),xc(n),n}function bn(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vc(e,n)}catch{return!0}}function yc(e,t){return t()}var bc=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?yc:wc;lr.useSyncExternalStore=Ge.useSyncExternalStore!==void 0?Ge.useSyncExternalStore:bc;cr.exports=lr;var Cc=cr.exports;function Sc(){return Cc.useSyncExternalStore(Rc,()=>!0,()=>!1)}function Rc(){return()=>{}}var Xn="Avatar",[Ec]=q(Xn),[Pc,ur]=Ec(Xn),dr=c.forwardRef((e,t)=>{const{__scopeAvatar:n,...o}=e,[r,s]=c.useState("idle");return p.jsx(Pc,{scope:n,imageLoadingStatus:r,onImageLoadingStatusChange:s,children:p.jsx(_.span,{...o,ref:t})})});dr.displayName=Xn;var fr="AvatarImage",pr=c.forwardRef((e,t)=>{const{__scopeAvatar:n,src:o,onLoadingStatusChange:r=()=>{},...s}=e,a=ur(fr,n),i=Ac(o,s),l=le(u=>{r(u),a.onImageLoadingStatusChange(u)});return X(()=>{i!=="idle"&&l(i)},[i,l]),i==="loaded"?p.jsx(_.img,{...s,ref:t,src:o}):null});pr.displayName=fr;var vr="AvatarFallback",mr=c.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:o,...r}=e,s=ur(vr,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(_.span,{...r,ref:t}):null});mr.displayName=vr;function _o(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Ac(e,{referrerPolicy:t,crossOrigin:n}){const o=Sc(),r=c.useRef(null),s=o?(r.current||(r.current=new window.Image),r.current):null,[a,i]=c.useState(()=>_o(s,e));return X(()=>{i(_o(s,e))},[s,e]),X(()=>{const l=d=>()=>{i(d)};if(!s)return;const u=l("loaded"),f=l("error");return s.addEventListener("load",u),s.addEventListener("error",f),t&&(s.referrerPolicy=t),typeof n=="string"&&(s.crossOrigin=n),()=>{s.removeEventListener("load",u),s.removeEventListener("error",f)}},[s,n,t]),a}var Hv=dr,Uv=pr,Kv=mr;function E(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}var _c=nr[" useInsertionEffect ".trim().toString()]||X;function ie({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,s,a]=Tc({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==i&&console.warn(`${o} is changing from ${d?"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.`),f.current=i},[i,o])}const u=c.useCallback(f=>{var d;if(i){const v=Mc(f)?f(e):f;v!==e&&((d=a.current)==null||d.call(a,v))}else s(f)},[i,e,s,a]);return[l,u]}function Tc({defaultProp:e,onChange:t}){const[n,o]=c.useState(e),r=c.useRef(n),s=c.useRef(t);return _c(()=>{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 Mc(e){return typeof e=="function"}function Yt(e){const t=e+"CollectionProvider",[n,o]=q(t),[r,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:g,children:w}=m,y=Ne.useRef(null),b=Ne.useRef(new Map).current;return p.jsx(r,{scope:g,itemMap:b,collectionRef:y,children:w})};a.displayName=t;const i=e+"CollectionSlot",l=Pe(i),u=Ne.forwardRef((m,g)=>{const{scope:w,children:y}=m,b=s(i,w),C=O(g,b.collectionRef);return p.jsx(l,{ref:C,children:y})});u.displayName=i;const f=e+"CollectionItemSlot",d="data-radix-collection-item",v=Pe(f),h=Ne.forwardRef((m,g)=>{const{scope:w,children:y,...b}=m,C=Ne.useRef(null),S=O(g,C),A=s(f,w);return Ne.useEffect(()=>(A.itemMap.set(C,{ref:C,...b}),()=>void A.itemMap.delete(C))),p.jsx(v,{[d]:"",ref:S,children:y})});h.displayName=f;function x(m){const g=s(e+"CollectionConsumer",m);return Ne.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((A,R)=>b.indexOf(A.ref.current)-b.indexOf(R.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:u,ItemSlot:h},x,o]}var Ic=c.createContext(void 0);function qe(e){const t=c.useContext(Ic);return e||t||"ltr"}function Dc(e,t=globalThis==null?void 0:globalThis.document){const n=le(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 Nc="DismissableLayer",Dn="dismissableLayer.update",Oc="dismissableLayer.pointerDownOutside",kc="dismissableLayer.focusOutside",To,hr=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ze=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:s,onInteractOutside:a,onDismiss:i,...l}=e,u=c.useContext(hr),[f,d]=c.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=c.useState({}),x=O(t,R=>d(R)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=m.indexOf(g),y=f?m.indexOf(f):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,C=y>=w,S=Fc(R=>{const M=R.target,B=[...u.branches].some(k=>k.contains(M));!C||B||(r==null||r(R),a==null||a(R),R.defaultPrevented||i==null||i())},v),A=$c(R=>{const M=R.target;[...u.branches].some(k=>k.contains(M))||(s==null||s(R),a==null||a(R),R.defaultPrevented||i==null||i())},v);return Dc(R=>{y===u.layers.size-1&&(o==null||o(R),!R.defaultPrevented&&i&&(R.preventDefault(),i()))},v),c.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(To=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Mo(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=To)}},[f,v,n,u]),c.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Mo())},[f,u]),c.useEffect(()=>{const R=()=>h({});return document.addEventListener(Dn,R),()=>document.removeEventListener(Dn,R)},[]),p.jsx(_.div,{...l,ref:x,style:{pointerEvents:b?C?"auto":"none":void 0,...e.style},onFocusCapture:E(e.onFocusCapture,A.onFocusCapture),onBlurCapture:E(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:E(e.onPointerDownCapture,S.onPointerDownCapture)})});Ze.displayName=Nc;var Lc="DismissableLayerBranch",jc=c.forwardRef((e,t)=>{const n=c.useContext(hr),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(_.div,{...e,ref:r})});jc.displayName=Lc;function Fc(e,t=globalThis==null?void 0:globalThis.document){const n=le(e),o=c.useRef(!1),r=c.useRef(()=>{});return c.useEffect(()=>{const s=i=>{if(i.target&&!o.current){let l=function(){gr(Oc,n,u,{discrete:!0})};const u={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=l,t.addEventListener("click",r.current,{once:!0})):l()}else t.removeEventListener("click",r.current);o.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function $c(e,t=globalThis==null?void 0:globalThis.document){const n=le(e),o=c.useRef(!1);return c.useEffect(()=>{const r=s=>{s.target&&!o.current&&gr(kc,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 Mo(){const e=new CustomEvent(Dn);document.dispatchEvent(e)}function gr(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?ir(r,s):r.dispatchEvent(s)}var Cn=0;function Xt(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Io()),document.body.insertAdjacentElement("beforeend",e[1]??Io()),Cn++,()=>{Cn===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Cn--}},[])}function Io(){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 Sn="focusScope.autoFocusOnMount",Rn="focusScope.autoFocusOnUnmount",Do={bubbles:!1,cancelable:!0},Bc="FocusScope",vt=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:s,...a}=e,[i,l]=c.useState(null),u=le(r),f=le(s),d=c.useRef(null),v=O(t,m=>l(m)),h=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(o){let m=function(b){if(h.paused||!i)return;const C=b.target;i.contains(C)?d.current=C:Re(d.current,{select:!0})},g=function(b){if(h.paused||!i)return;const C=b.relatedTarget;C!==null&&(i.contains(C)||Re(d.current,{select:!0}))},w=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&Re(i)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const y=new MutationObserver(w);return i&&y.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),y.disconnect()}}},[o,i,h.paused]),c.useEffect(()=>{if(i){Oo.add(h);const m=document.activeElement;if(!i.contains(m)){const w=new CustomEvent(Sn,Do);i.addEventListener(Sn,u),i.dispatchEvent(w),w.defaultPrevented||(Vc(Gc(xr(i)),{select:!0}),document.activeElement===m&&Re(i))}return()=>{i.removeEventListener(Sn,u),setTimeout(()=>{const w=new CustomEvent(Rn,Do);i.addEventListener(Rn,f),i.dispatchEvent(w),w.defaultPrevented||Re(m??document.body,{select:!0}),i.removeEventListener(Rn,f),Oo.remove(h)},0)}}},[i,u,f,h]);const x=c.useCallback(m=>{if(!n&&!o||h.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,w=document.activeElement;if(g&&w){const y=m.currentTarget,[b,C]=Wc(y);b&&C?!m.shiftKey&&w===C?(m.preventDefault(),n&&Re(b,{select:!0})):m.shiftKey&&w===b&&(m.preventDefault(),n&&Re(C,{select:!0})):w===y&&m.preventDefault()}},[n,o,h.paused]);return p.jsx(_.div,{tabIndex:-1,...a,ref:v,onKeyDown:x})});vt.displayName=Bc;function Vc(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Re(o,{select:t}),document.activeElement!==n)return}function Wc(e){const t=xr(e),n=No(t,e),o=No(t.reverse(),e);return[n,o]}function xr(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 No(e,t){for(const n of e)if(!Hc(n,{upTo:t}))return n}function Hc(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 Uc(e){return e instanceof HTMLInputElement&&"select"in e}function Re(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Uc(e)&&t&&e.select()}}var Oo=Kc();function Kc(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ko(e,t),e.unshift(t)},remove(t){var n;e=ko(e,t),(n=e[0])==null||n.resume()}}}function ko(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function Gc(e){return e.filter(t=>t.tagName!=="A")}var zc=nr[" useId ".trim().toString()]||(()=>{}),Yc=0;function se(e){const[t,n]=c.useState(zc());return X(()=>{n(o=>o??String(Yc++))},[e]),e||(t?`radix-${t}`:"")}const Xc=["top","right","bottom","left"],Ae=Math.min,ne=Math.max,kt=Math.round,Pt=Math.floor,he=e=>({x:e,y:e}),qc={left:"right",right:"left",bottom:"top",top:"bottom"},Zc={start:"end",end:"start"};function Nn(e,t,n){return ne(e,Ae(t,n))}function be(e,t){return typeof e=="function"?e(t):e}function Ce(e){return e.split("-")[0]}function Qe(e){return e.split("-")[1]}function qn(e){return e==="x"?"y":"x"}function Zn(e){return e==="y"?"height":"width"}const Qc=new Set(["top","bottom"]);function me(e){return Qc.has(Ce(e))?"y":"x"}function Qn(e){return qn(me(e))}function Jc(e,t,n){n===void 0&&(n=!1);const o=Qe(e),r=Qn(e),s=Zn(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Lt(a)),[a,Lt(a)]}function el(e){const t=Lt(e);return[On(e),t,On(t)]}function On(e){return e.replace(/start|end/g,t=>Zc[t])}const Lo=["left","right"],jo=["right","left"],tl=["top","bottom"],nl=["bottom","top"];function ol(e,t,n){switch(e){case"top":case"bottom":return n?t?jo:Lo:t?Lo:jo;case"left":case"right":return t?tl:nl;default:return[]}}function rl(e,t,n,o){const r=Qe(e);let s=ol(Ce(e),n==="start",o);return r&&(s=s.map(a=>a+"-"+r),t&&(s=s.concat(s.map(On)))),s}function Lt(e){return e.replace(/left|right|bottom|top/g,t=>qc[t])}function sl(e){return{top:0,right:0,bottom:0,left:0,...e}}function wr(e){return typeof e!="number"?sl(e):{top:e,right:e,bottom:e,left:e}}function jt(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 Fo(e,t,n){let{reference:o,floating:r}=e;const s=me(t),a=Qn(t),i=Zn(a),l=Ce(t),u=s==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,v=o[i]/2-r[i]/2;let h;switch(l){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-r.width,y:d};break;default:h={x:o.x,y:o.y}}switch(Qe(t)){case"start":h[a]-=v*(n&&u?-1:1);break;case"end":h[a]+=v*(n&&u?-1:1);break}return h}const al=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:a}=n,i=s.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:d}=Fo(u,o,l),v=o,h={},x=0;for(let m=0;m<i.length;m++){const{name:g,fn:w}=i[m],{x:y,y:b,data:C,reset:S}=await w({x:f,y:d,initialPlacement:o,placement:v,strategy:r,middlewareData:h,rects:u,platform:a,elements:{reference:e,floating:t}});f=y??f,d=b??d,h={...h,[g]:{...h[g],...C}},S&&x<=50&&(x++,typeof S=="object"&&(S.placement&&(v=S.placement),S.rects&&(u=S.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:f,y:d}=Fo(u,v,l)),m=-1)}return{x:f,y:d,placement:v,strategy:r,middlewareData:h}};async function lt(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:a,elements:i,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:v=!1,padding:h=0}=be(t,e),x=wr(h),g=i[v?d==="floating"?"reference":"floating":d],w=jt(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(i.floating)),boundary:u,rootBoundary:f,strategy:l})),y=d==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(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},S=jt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:b,strategy:l}):y);return{top:(w.top-S.top+x.top)/C.y,bottom:(S.bottom-w.bottom+x.bottom)/C.y,left:(w.left-S.left+x.left)/C.x,right:(S.right-w.right+x.right)/C.x}}const il=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:u,padding:f=0}=be(e,t)||{};if(u==null)return{};const d=wr(f),v={x:n,y:o},h=Qn(r),x=Zn(h),m=await a.getDimensions(u),g=h==="y",w=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",C=s.reference[x]+s.reference[h]-v[h]-s.floating[x],S=v[h]-s.reference[h],A=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let R=A?A[b]:0;(!R||!await(a.isElement==null?void 0:a.isElement(A)))&&(R=i.floating[b]||s.floating[x]);const M=C/2-S/2,B=R/2-m[x]/2-1,k=Ae(d[w],B),N=Ae(d[y],B),j=k,L=R-m[x]-N,F=R/2-m[x]/2+M,V=Nn(j,F,L),D=!l.arrow&&Qe(r)!=null&&F!==V&&s.reference[x]/2-(F<j?k:N)-m[x]/2<0,$=D?F<j?F-j:F-L:0;return{[h]:v[h]+$,data:{[h]:V,centerOffset:F-V-$,...D&&{alignmentOffset:$}},reset:D}}}),cl=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:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:v,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:m=!0,...g}=be(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=Ce(r),y=me(i),b=Ce(i)===i,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),S=v||(b||!m?[Lt(i)]:el(i)),A=x!=="none";!v&&A&&S.push(...rl(i,m,x,C));const R=[i,...S],M=await lt(t,g),B=[];let k=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&B.push(M[w]),d){const F=Jc(r,a,C);B.push(M[F[0]],M[F[1]])}if(k=[...k,{placement:r,overflows:B}],!B.every(F=>F<=0)){var N,j;const F=(((N=s.flip)==null?void 0:N.index)||0)+1,V=R[F];if(V&&(!(d==="alignment"?y!==me(V):!1)||k.every(T=>me(T.placement)===y?T.overflows[0]>0:!0)))return{data:{index:F,overflows:k},reset:{placement:V}};let D=(j=k.filter($=>$.overflows[0]<=0).sort(($,T)=>$.overflows[1]-T.overflows[1])[0])==null?void 0:j.placement;if(!D)switch(h){case"bestFit":{var L;const $=(L=k.filter(T=>{if(A){const P=me(T.placement);return P===y||P==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(P=>P>0).reduce((P,G)=>P+G,0)]).sort((T,P)=>T[1]-P[1])[0])==null?void 0:L[0];$&&(D=$);break}case"initialPlacement":D=i;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function $o(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bo(e){return Xc.some(t=>e[t]>=0)}const ll=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=be(e,t);switch(o){case"referenceHidden":{const s=await lt(t,{...r,elementContext:"reference"}),a=$o(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Bo(a)}}}case"escaped":{const s=await lt(t,{...r,altBoundary:!0}),a=$o(s,n.floating);return{data:{escapedOffsets:a,escaped:Bo(a)}}}default:return{}}}}},yr=new Set(["left","top"]);async function ul(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=Qe(n),l=me(n)==="y",u=yr.has(a)?-1:1,f=s&&l?-1:1,d=be(t,e);let{mainAxis:v,crossAxis:h,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof x=="number"&&(h=i==="end"?x*-1:x),l?{x:h*f,y:v*u}:{x:v*u,y:h*f}}const dl=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 ul(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}}}}},fl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:i={fn:g=>{let{x:w,y}=g;return{x:w,y}}},...l}=be(e,t),u={x:n,y:o},f=await lt(t,l),d=me(Ce(r)),v=qn(d);let h=u[v],x=u[d];if(s){const g=v==="y"?"top":"left",w=v==="y"?"bottom":"right",y=h+f[g],b=h-f[w];h=Nn(y,h,b)}if(a){const g=d==="y"?"top":"left",w=d==="y"?"bottom":"right",y=x+f[g],b=x-f[w];x=Nn(y,x,b)}const m=i.fn({...t,[v]:h,[d]:x});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[v]:s,[d]:a}}}}}},pl=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:u=!0}=be(e,t),f={x:n,y:o},d=me(r),v=qn(d);let h=f[v],x=f[d];const m=be(i,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const b=v==="y"?"height":"width",C=s.reference[v]-s.floating[b]+g.mainAxis,S=s.reference[v]+s.reference[b]-g.mainAxis;h<C?h=C:h>S&&(h=S)}if(u){var w,y;const b=v==="y"?"width":"height",C=yr.has(Ce(r)),S=s.reference[d]-s.floating[b]+(C&&((w=a.offset)==null?void 0:w[d])||0)+(C?0:g.crossAxis),A=s.reference[d]+s.reference[b]+(C?0:((y=a.offset)==null?void 0:y[d])||0)-(C?g.crossAxis:0);x<S?x=S:x>A&&(x=A)}return{[v]:h,[d]:x}}}},vl=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=()=>{},...u}=be(e,t),f=await lt(t,u),d=Ce(r),v=Qe(r),h=me(r)==="y",{width:x,height:m}=s.floating;let g,w;d==="top"||d==="bottom"?(g=d,w=v===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(w=d,g=v==="end"?"top":"bottom");const y=m-f.top-f.bottom,b=x-f.left-f.right,C=Ae(m-f[g],y),S=Ae(x-f[w],b),A=!t.middlewareData.shift;let R=C,M=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=b),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(R=y),A&&!v){const k=ne(f.left,0),N=ne(f.right,0),j=ne(f.top,0),L=ne(f.bottom,0);h?M=x-2*(k!==0||N!==0?k+N:ne(f.left,f.right)):R=m-2*(j!==0||L!==0?j+L:ne(f.top,f.bottom))}await l({...t,availableWidth:M,availableHeight:R});const B=await a.getDimensions(i.floating);return x!==B.width||m!==B.height?{reset:{rects:!0}}:{}}}};function qt(){return typeof window<"u"}function Je(e){return br(e)?(e.nodeName||"").toLowerCase():"#document"}function oe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xe(e){var t;return(t=(br(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function br(e){return qt()?e instanceof Node||e instanceof oe(e).Node:!1}function ue(e){return qt()?e instanceof Element||e instanceof oe(e).Element:!1}function ge(e){return qt()?e instanceof HTMLElement||e instanceof oe(e).HTMLElement:!1}function Vo(e){return!qt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof oe(e).ShadowRoot}const ml=new Set(["inline","contents"]);function mt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=de(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!ml.has(r)}const hl=new Set(["table","td","th"]);function gl(e){return hl.has(Je(e))}const xl=[":popover-open",":modal"];function Zt(e){return xl.some(t=>{try{return e.matches(t)}catch{return!1}})}const wl=["transform","translate","scale","rotate","perspective"],yl=["transform","translate","scale","rotate","perspective","filter"],bl=["paint","layout","strict","content"];function Jn(e){const t=eo(),n=ue(e)?de(e):e;return wl.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||yl.some(o=>(n.willChange||"").includes(o))||bl.some(o=>(n.contain||"").includes(o))}function Cl(e){let t=_e(e);for(;ge(t)&&!ze(t);){if(Jn(t))return t;if(Zt(t))return null;t=_e(t)}return null}function eo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Sl=new Set(["html","body","#document"]);function ze(e){return Sl.has(Je(e))}function de(e){return oe(e).getComputedStyle(e)}function Qt(e){return ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _e(e){if(Je(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vo(e)&&e.host||xe(e);return Vo(t)?t.host:t}function Cr(e){const t=_e(e);return ze(t)?e.ownerDocument?e.ownerDocument.body:e.body:ge(t)&&mt(t)?t:Cr(t)}function ut(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Cr(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),a=oe(r);if(s){const i=kn(a);return t.concat(a,a.visualViewport||[],mt(r)?r:[],i&&n?ut(i):[])}return t.concat(r,ut(r,[],n))}function kn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Sr(e){const t=de(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ge(e),s=r?e.offsetWidth:n,a=r?e.offsetHeight:o,i=kt(n)!==s||kt(o)!==a;return i&&(n=s,o=a),{width:n,height:o,$:i}}function to(e){return ue(e)?e:e.contextElement}function He(e){const t=to(e);if(!ge(t))return he(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Sr(t);let a=(s?kt(n.width):n.width)/o,i=(s?kt(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const Rl=he(0);function Rr(e){const t=oe(e);return!eo()||!t.visualViewport?Rl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function El(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==oe(e)?!1:t}function Oe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=to(e);let a=he(1);t&&(o?ue(o)&&(a=He(o)):a=He(e));const i=El(s,n,o)?Rr(s):he(0);let l=(r.left+i.x)/a.x,u=(r.top+i.y)/a.y,f=r.width/a.x,d=r.height/a.y;if(s){const v=oe(s),h=o&&ue(o)?oe(o):o;let x=v,m=kn(x);for(;m&&o&&h!==x;){const g=He(m),w=m.getBoundingClientRect(),y=de(m),b=w.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,C=w.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,d*=g.y,l+=b,u+=C,x=oe(m),m=kn(x)}}return jt({width:f,height:d,x:l,y:u})}function Jt(e,t){const n=Qt(e).scrollLeft;return t?t.left+n:Oe(xe(e)).left+n}function Er(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Jt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Pl(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",a=xe(o),i=t?Zt(t.floating):!1;if(o===a||i&&s)return n;let l={scrollLeft:0,scrollTop:0},u=he(1);const f=he(0),d=ge(o);if((d||!d&&!s)&&((Je(o)!=="body"||mt(a))&&(l=Qt(o)),ge(o))){const h=Oe(o);u=He(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const v=a&&!d&&!s?Er(a,l):he(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+v.x,y:n.y*u.y-l.scrollTop*u.y+f.y+v.y}}function Al(e){return Array.from(e.getClientRects())}function _l(e){const t=xe(e),n=Qt(e),o=e.ownerDocument.body,r=ne(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=ne(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Jt(e);const i=-n.scrollTop;return de(o).direction==="rtl"&&(a+=ne(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:a,y:i}}const Wo=25;function Tl(e,t){const n=oe(e),o=xe(e),r=n.visualViewport;let s=o.clientWidth,a=o.clientHeight,i=0,l=0;if(r){s=r.width,a=r.height;const f=eo();(!f||f&&t==="fixed")&&(i=r.offsetLeft,l=r.offsetTop)}const u=Jt(o);if(u<=0){const f=o.ownerDocument,d=f.body,v=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(o.clientWidth-d.clientWidth-h);x<=Wo&&(s-=x)}else u<=Wo&&(s+=u);return{width:s,height:a,x:i,y:l}}const Ml=new Set(["absolute","fixed"]);function Il(e,t){const n=Oe(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=ge(e)?He(e):he(1),a=e.clientWidth*s.x,i=e.clientHeight*s.y,l=r*s.x,u=o*s.y;return{width:a,height:i,x:l,y:u}}function Ho(e,t,n){let o;if(t==="viewport")o=Tl(e,n);else if(t==="document")o=_l(xe(e));else if(ue(t))o=Il(t,n);else{const r=Rr(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return jt(o)}function Pr(e,t){const n=_e(e);return n===t||!ue(n)||ze(n)?!1:de(n).position==="fixed"||Pr(n,t)}function Dl(e,t){const n=t.get(e);if(n)return n;let o=ut(e,[],!1).filter(i=>ue(i)&&Je(i)!=="body"),r=null;const s=de(e).position==="fixed";let a=s?_e(e):e;for(;ue(a)&&!ze(a);){const i=de(a),l=Jn(a);!l&&i.position==="fixed"&&(r=null),(s?!l&&!r:!l&&i.position==="static"&&!!r&&Ml.has(r.position)||mt(a)&&!l&&Pr(e,a))?o=o.filter(f=>f!==a):r=i,a=_e(a)}return t.set(e,o),o}function Nl(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Zt(t)?[]:Dl(t,this._c):[].concat(n),o],i=a[0],l=a.reduce((u,f)=>{const d=Ho(t,f,r);return u.top=ne(d.top,u.top),u.right=Ae(d.right,u.right),u.bottom=Ae(d.bottom,u.bottom),u.left=ne(d.left,u.left),u},Ho(t,i,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Ol(e){const{width:t,height:n}=Sr(e);return{width:t,height:n}}function kl(e,t,n){const o=ge(t),r=xe(t),s=n==="fixed",a=Oe(e,!0,s,t);let i={scrollLeft:0,scrollTop:0};const l=he(0);function u(){l.x=Jt(r)}if(o||!o&&!s)if((Je(t)!=="body"||mt(r))&&(i=Qt(t)),o){const h=Oe(t,!0,s,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else r&&u();s&&!o&&r&&u();const f=r&&!o&&!s?Er(r,i):he(0),d=a.left+i.scrollLeft-l.x-f.x,v=a.top+i.scrollTop-l.y-f.y;return{x:d,y:v,width:a.width,height:a.height}}function En(e){return de(e).position==="static"}function Uo(e,t){if(!ge(e)||de(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xe(e)===n&&(n=n.ownerDocument.body),n}function Ar(e,t){const n=oe(e);if(Zt(e))return n;if(!ge(e)){let r=_e(e);for(;r&&!ze(r);){if(ue(r)&&!En(r))return r;r=_e(r)}return n}let o=Uo(e,t);for(;o&&gl(o)&&En(o);)o=Uo(o,t);return o&&ze(o)&&En(o)&&!Jn(o)?n:o||Cl(e)||n}const Ll=async function(e){const t=this.getOffsetParent||Ar,n=this.getDimensions,o=await n(e.floating);return{reference:kl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function jl(e){return de(e).direction==="rtl"}const Fl={convertOffsetParentRelativeRectToViewportRelativeRect:Pl,getDocumentElement:xe,getClippingRect:Nl,getOffsetParent:Ar,getElementRects:Ll,getClientRects:Al,getDimensions:Ol,getScale:He,isElement:ue,isRTL:jl};function _r(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $l(e,t){let n=null,o;const r=xe(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 u=e.getBoundingClientRect(),{left:f,top:d,width:v,height:h}=u;if(i||t(),!v||!h)return;const x=Pt(d),m=Pt(r.clientWidth-(f+v)),g=Pt(r.clientHeight-(d+h)),w=Pt(f),b={rootMargin:-x+"px "+-m+"px "+-g+"px "+-w+"px",threshold:ne(0,Ae(1,l))||1};let C=!0;function S(A){const R=A[0].intersectionRatio;if(R!==l){if(!C)return a();R?a(!1,R):o=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!_r(u,e.getBoundingClientRect())&&a(),C=!1}try{n=new IntersectionObserver(S,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,b)}n.observe(e)}return a(!0),s}function Bl(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,u=to(e),f=r||s?[...u?ut(u):[],...ut(t)]:[];f.forEach(w=>{r&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const d=u&&i?$l(u,n):null;let v=-1,h=null;a&&(h=new ResizeObserver(w=>{let[y]=w;y&&y.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let x,m=l?Oe(e):null;l&&g();function g(){const w=Oe(e);m&&!_r(m,w)&&n(),m=w,x=requestAnimationFrame(g)}return n(),()=>{var w;f.forEach(y=>{r&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,l&&cancelAnimationFrame(x)}}const Vl=dl,Wl=fl,Hl=cl,Ul=vl,Kl=ll,Ko=il,Gl=pl,zl=(e,t,n)=>{const o=new Map,r={platform:Fl,...n},s={...r.platform,_c:o};return al(e,t,{...r,platform:s})};var Yl=typeof document<"u",Xl=function(){},Dt=Yl?c.useLayoutEffect:Xl;function Ft(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(!Ft(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)&&!Ft(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Tr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Go(e,t){const n=Tr(e);return Math.round(t*n)/n}function Pn(e){const t=c.useRef(e);return Dt(()=>{t.current=e}),t}function ql(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:u}=e,[f,d]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,h]=c.useState(o);Ft(v,o)||h(o);const[x,m]=c.useState(null),[g,w]=c.useState(null),y=c.useCallback(T=>{T!==A.current&&(A.current=T,m(T))},[]),b=c.useCallback(T=>{T!==R.current&&(R.current=T,w(T))},[]),C=s||x,S=a||g,A=c.useRef(null),R=c.useRef(null),M=c.useRef(f),B=l!=null,k=Pn(l),N=Pn(r),j=Pn(u),L=c.useCallback(()=>{if(!A.current||!R.current)return;const T={placement:t,strategy:n,middleware:v};N.current&&(T.platform=N.current),zl(A.current,R.current,T).then(P=>{const G={...P,isPositioned:j.current!==!1};F.current&&!Ft(M.current,G)&&(M.current=G,Kt.flushSync(()=>{d(G)}))})},[v,t,n,N,j]);Dt(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[u]);const F=c.useRef(!1);Dt(()=>(F.current=!0,()=>{F.current=!1}),[]),Dt(()=>{if(C&&(A.current=C),S&&(R.current=S),C&&S){if(k.current)return k.current(C,S,L);L()}},[C,S,L,k,B]);const V=c.useMemo(()=>({reference:A,floating:R,setReference:y,setFloating:b}),[y,b]),D=c.useMemo(()=>({reference:C,floating:S}),[C,S]),$=c.useMemo(()=>{const T={position:n,left:0,top:0};if(!D.floating)return T;const P=Go(D.floating,f.x),G=Go(D.floating,f.y);return i?{...T,transform:"translate("+P+"px, "+G+"px)",...Tr(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:G}},[n,i,D.floating,f.x,f.y]);return c.useMemo(()=>({...f,update:L,refs:V,elements:D,floatingStyles:$}),[f,L,V,D,$])}const Zl=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?Ko({element:o.current,padding:r}).fn(n):{}:o?Ko({element:o,padding:r}).fn(n):{}}}},Ql=(e,t)=>({...Vl(e),options:[e,t]}),Jl=(e,t)=>({...Wl(e),options:[e,t]}),eu=(e,t)=>({...Gl(e),options:[e,t]}),tu=(e,t)=>({...Hl(e),options:[e,t]}),nu=(e,t)=>({...Ul(e),options:[e,t]}),ou=(e,t)=>({...Kl(e),options:[e,t]}),ru=(e,t)=>({...Zl(e),options:[e,t]});var su="Arrow",Mr=c.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...s}=e;return p.jsx(_.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"})})});Mr.displayName=su;var au=Mr;function ht(e){const[t,n]=c.useState(void 0);return X(()=>{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,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,i=u.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 no="Popper",[Ir,Te]=q(no),[iu,Dr]=Ir(no),Nr=e=>{const{__scopePopper:t,children:n}=e,[o,r]=c.useState(null);return p.jsx(iu,{scope:t,anchor:o,onAnchorChange:r,children:n})};Nr.displayName=no;var Or="PopperAnchor",kr=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,s=Dr(Or,n),a=c.useRef(null),i=O(t,a),l=c.useRef(null);return c.useEffect(()=>{const u=l.current;l.current=(o==null?void 0:o.current)||a.current,u!==l.current&&s.onAnchorChange(l.current)}),o?null:p.jsx(_.div,{...r,ref:i})});kr.displayName=Or;var oo="PopperContent",[cu,lu]=Ir(oo),Lr=c.forwardRef((e,t)=>{var I,H,z,W,U,K;const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:a=0,arrowPadding:i=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:v=!1,updatePositionStrategy:h="optimized",onPlaced:x,...m}=e,g=Dr(oo,n),[w,y]=c.useState(null),b=O(t,te=>y(te)),[C,S]=c.useState(null),A=ht(C),R=(A==null?void 0:A.width)??0,M=(A==null?void 0:A.height)??0,B=o+(s!=="center"?"-"+s:""),k=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},N=Array.isArray(u)?u:[u],j=N.length>0,L={padding:k,boundary:N.filter(du),altBoundary:j},{refs:F,floatingStyles:V,placement:D,isPositioned:$,middlewareData:T}=ql({strategy:"fixed",placement:B,whileElementsMounted:(...te)=>Bl(...te,{animationFrame:h==="always"}),elements:{reference:g.anchor},middleware:[Ql({mainAxis:r+M,alignmentAxis:a}),l&&Jl({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?eu():void 0,...L}),l&&tu({...L}),nu({...L,apply:({elements:te,rects:pe,availableWidth:rt,availableHeight:st})=>{const{width:at,height:Qi}=pe.reference,Et=te.floating.style;Et.setProperty("--radix-popper-available-width",`${rt}px`),Et.setProperty("--radix-popper-available-height",`${st}px`),Et.setProperty("--radix-popper-anchor-width",`${at}px`),Et.setProperty("--radix-popper-anchor-height",`${Qi}px`)}}),C&&ru({element:C,padding:i}),fu({arrowWidth:R,arrowHeight:M}),v&&ou({strategy:"referenceHidden",...L})]}),[P,G]=$r(D),Y=le(x);X(()=>{$&&(Y==null||Y())},[$,Y]);const J=(I=T.arrow)==null?void 0:I.x,we=(H=T.arrow)==null?void 0:H.y,re=((z=T.arrow)==null?void 0:z.centerOffset)!==0,[ye,ee]=c.useState();return X(()=>{w&&ee(window.getComputedStyle(w).zIndex)},[w]),p.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:$?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[(W=T.transformOrigin)==null?void 0:W.x,(U=T.transformOrigin)==null?void 0:U.y].join(" "),...((K=T.hide)==null?void 0:K.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(cu,{scope:n,placedSide:P,onArrowChange:S,arrowX:J,arrowY:we,shouldHideArrow:re,children:p.jsx(_.div,{"data-side":P,"data-align":G,...m,ref:b,style:{...m.style,animation:$?void 0:"none"}})})})});Lr.displayName=oo;var jr="PopperArrow",uu={top:"bottom",right:"left",bottom:"top",left:"right"},Fr=c.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,s=lu(jr,o),a=uu[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(au,{...r,ref:n,style:{...r.style,display:"block"}})})});Fr.displayName=jr;function du(e){return e!==null}var fu=e=>({name:"transformOrigin",options:e,fn(t){var g,w,y;const{placement:n,rects:o,middlewareData:r}=t,a=((g=r.arrow)==null?void 0:g.centerOffset)!==0,i=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,f]=$r(n),d={start:"0%",center:"50%",end:"100%"}[f],v=(((w=r.arrow)==null?void 0:w.x)??0)+i/2,h=(((y=r.arrow)==null?void 0:y.y)??0)+l/2;let x="",m="";return u==="bottom"?(x=a?d:`${v}px`,m=`${-l}px`):u==="top"?(x=a?d:`${v}px`,m=`${o.floating.height+l}px`):u==="right"?(x=`${-l}px`,m=a?d:`${h}px`):u==="left"&&(x=`${o.floating.width+l}px`,m=a?d:`${h}px`),{data:{x,y:m}}}});function $r(e){const[t,n="center"]=e.split("-");return[t,n]}var en=Nr,gt=kr,tn=Lr,nn=Fr,pu="Portal",et=c.forwardRef((e,t)=>{var i;const{container:n,...o}=e,[r,s]=c.useState(!1);X(()=>s(!0),[]);const a=n||r&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return a?Ji.createPortal(p.jsx(_.div,{...o,ref:t}),a):null});et.displayName=pu;function vu(e,t){return c.useReducer((n,o)=>t[n][o]??n,e)}var Z=e=>{const{present:t,children:n}=e,o=mu(t),r=typeof n=="function"?n({present:o.isPresent}):c.Children.only(n),s=O(o.ref,hu(r));return typeof n=="function"||o.isPresent?c.cloneElement(r,{ref:s}):null};Z.displayName="Presence";function mu(e){const[t,n]=c.useState(),o=c.useRef(null),r=c.useRef(e),s=c.useRef("none"),a=e?"mounted":"unmounted",[i,l]=vu(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const u=At(o.current);s.current=i==="mounted"?u:"none"},[i]),X(()=>{const u=o.current,f=r.current;if(f!==e){const v=s.current,h=At(u);e?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&v!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),X(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=h=>{const m=At(o.current).includes(CSS.escape(h.animationName));if(h.target===t&&m&&(l("ANIMATION_END"),!r.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},v=h=>{h.target===t&&(s.current=At(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(u=>{o.current=u?getComputedStyle(u):null,n(u)},[])}}function At(e){return(e==null?void 0:e.animationName)||"none"}function hu(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 An="rovingFocusGroup.onEntryFocus",gu={bubbles:!1,cancelable:!0},xt="RovingFocusGroup",[Ln,Br,xu]=Yt(xt),[wu,tt]=q(xt,[xu]),[yu,bu]=wu(xt),Vr=c.forwardRef((e,t)=>p.jsx(Ln.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Ln.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Cu,{...e,ref:t})})}));Vr.displayName=xt;var Cu=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,v=c.useRef(null),h=O(t,v),x=qe(s),[m,g]=ie({prop:a,defaultProp:i??null,onChange:l,caller:xt}),[w,y]=c.useState(!1),b=le(u),C=Br(n),S=c.useRef(!1),[A,R]=c.useState(0);return c.useEffect(()=>{const M=v.current;if(M)return M.addEventListener(An,b),()=>M.removeEventListener(An,b)},[b]),p.jsx(yu,{scope:n,orientation:o,dir:x,loop:r,currentTabStopId:m,onItemFocus:c.useCallback(M=>g(M),[g]),onItemShiftTab:c.useCallback(()=>y(!0),[]),onFocusableItemAdd:c.useCallback(()=>R(M=>M+1),[]),onFocusableItemRemove:c.useCallback(()=>R(M=>M-1),[]),children:p.jsx(_.div,{tabIndex:w||A===0?-1:0,"data-orientation":o,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:E(e.onMouseDown,()=>{S.current=!0}),onFocus:E(e.onFocus,M=>{const B=!S.current;if(M.target===M.currentTarget&&B&&!w){const k=new CustomEvent(An,gu);if(M.currentTarget.dispatchEvent(k),!k.defaultPrevented){const N=C().filter(D=>D.focusable),j=N.find(D=>D.active),L=N.find(D=>D.id===m),V=[j,L,...N].filter(Boolean).map(D=>D.ref.current);Ur(V,f)}}S.current=!1}),onBlur:E(e.onBlur,()=>y(!1))})})}),Wr="RovingFocusGroupItem",Hr=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:a,...i}=e,l=se(),u=s||l,f=bu(Wr,n),d=f.currentTabStopId===u,v=Br(n),{onFocusableItemAdd:h,onFocusableItemRemove:x,currentTabStopId:m}=f;return c.useEffect(()=>{if(o)return h(),()=>x()},[o,h,x]),p.jsx(Ln.ItemSlot,{scope:n,id:u,focusable:o,active:r,children:p.jsx(_.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...i,ref:t,onMouseDown:E(e.onMouseDown,g=>{o?f.onItemFocus(u):g.preventDefault()}),onFocus:E(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:E(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){f.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const w=Eu(g,f.orientation,f.dir);if(w!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let b=v().filter(C=>C.focusable).map(C=>C.ref.current);if(w==="last")b.reverse();else if(w==="prev"||w==="next"){w==="prev"&&b.reverse();const C=b.indexOf(g.currentTarget);b=f.loop?Pu(b,C+1):b.slice(C+1)}setTimeout(()=>Ur(b))}}),children:typeof a=="function"?a({isCurrentTabStop:d,hasTabStop:m!=null}):a})})});Hr.displayName=Wr;var Su={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ru(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Eu(e,t,n){const o=Ru(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return Su[o]}function Ur(e,t=!1){const n=document.activeElement;for(const o of e)if(o===n||(o.focus({preventScroll:t}),document.activeElement!==n))return}function Pu(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var ro=Vr,so=Hr,Au=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Be=new WeakMap,_t=new WeakMap,Tt={},_n=0,Kr=function(e){return e&&(e.host||Kr(e.parentNode))},_u=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Kr(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})},Tu=function(e,t,n,o){var r=_u(t,Array.isArray(e)?e:[e]);Tt[n]||(Tt[n]=new WeakMap);var s=Tt[n],a=[],i=new Set,l=new Set(r),u=function(d){!d||i.has(d)||(i.add(d),u(d.parentNode))};r.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(v){if(i.has(v))f(v);else try{var h=v.getAttribute(o),x=h!==null&&h!=="false",m=(Be.get(v)||0)+1,g=(s.get(v)||0)+1;Be.set(v,m),s.set(v,g),a.push(v),m===1&&x&&_t.set(v,!0),g===1&&v.setAttribute(n,"true"),x||v.setAttribute(o,"true")}catch(w){console.error("aria-hidden: cannot operate on ",v,w)}})};return f(t),i.clear(),_n++,function(){a.forEach(function(d){var v=Be.get(d)-1,h=s.get(d)-1;Be.set(d,v),s.set(d,h),v||(_t.has(d)||d.removeAttribute(o),_t.delete(d)),h||d.removeAttribute(n)}),_n--,_n||(Be=new WeakMap,Be=new WeakMap,_t=new WeakMap,Tt={})}},on=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=Au(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Tu(o,r,n,"aria-hidden")):function(){return null}},ve=function(){return ve=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ve.apply(this,arguments)};function Gr(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Mu(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,s;o<r;o++)(s||!(o in t))&&(s||(s=Array.prototype.slice.call(t,0,o)),s[o]=t[o]);return e.concat(s||Array.prototype.slice.call(t))}var Nt="right-scroll-bar-position",Ot="width-before-scroll-bar",Iu="with-scroll-bars-hidden",Du="--removed-body-scroll-bar-size";function Tn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Nu(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 Ou=typeof window<"u"?c.useLayoutEffect:c.useEffect,zo=new WeakMap;function ku(e,t){var n=Nu(null,function(o){return e.forEach(function(r){return Tn(r,o)})});return Ou(function(){var o=zo.get(n);if(o){var r=new Set(o),s=new Set(e),a=n.current;r.forEach(function(i){s.has(i)||Tn(i,null)}),s.forEach(function(i){r.has(i)||Tn(i,a)})}zo.set(n,e)},[e]),n}function Lu(e){return e}function ju(e,t){t===void 0&&(t=Lu);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 f=a;a=[],f.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){a.push(f),u()},filter:function(f){return a=a.filter(f),n}}}};return r}function Fu(e){e===void 0&&(e={});var t=ju(null);return t.options=ve({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,ve({},n))};zr.isSideCarExport=!0;function $u(e,t){return e.useMedium(t),zr}var Yr=Fu(),Mn=function(){},rn=c.forwardRef(function(e,t){var n=c.useRef(null),o=c.useState({onScrollCapture:Mn,onWheelCapture:Mn,onTouchMoveCapture:Mn}),r=o[0],s=o[1],a=e.forwardProps,i=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,d=e.shards,v=e.sideCar,h=e.noRelative,x=e.noIsolation,m=e.inert,g=e.allowPinchZoom,w=e.as,y=w===void 0?"div":w,b=e.gapMode,C=Gr(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=v,A=ku([n,t]),R=ve(ve({},C),r);return c.createElement(c.Fragment,null,f&&c.createElement(S,{sideCar:Yr,removeScrollBar:u,shards:d,noRelative:h,noIsolation:x,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?c.cloneElement(c.Children.only(i),ve(ve({},R),{ref:A})):c.createElement(y,ve({},R,{className:l,ref:A}),i))});rn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};rn.classNames={fullWidth:Ot,zeroRight:Nt};var Bu=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vu(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Bu();return t&&e.setAttribute("nonce",t),e}function Wu(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hu(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Uu=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vu())&&(Wu(t,n),Hu(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ku=function(){var e=Uu();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Xr=function(){var e=Ku(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},Gu={left:0,top:0,right:0,gap:0},In=function(e){return parseInt(e||"",10)||0},zu=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[In(n),In(o),In(r)]},Yu=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Gu;var t=zu(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])}},Xu=Xr(),Ue="data-scroll-locked",qu=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(Iu,` {
   overflow: hidden `).concat(o,`;
   padding-right: `).concat(i,"px ").concat(o,`;
  }
  body[`).concat(Ue,`] {
    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(Nt,` {
    right: `).concat(i,"px ").concat(o,`;
  }
  
  .`).concat(Ot,` {
    margin-right: `).concat(i,"px ").concat(o,`;
  }
  
  .`).concat(Nt," .").concat(Nt,` {
    right: 0 `).concat(o,`;
  }
  
  .`).concat(Ot," .").concat(Ot,` {
    margin-right: 0 `).concat(o,`;
  }
  
  body[`).concat(Ue,`] {
    `).concat(Du,": ").concat(i,`px;
  }
`)},Yo=function(){var e=parseInt(document.body.getAttribute(Ue)||"0",10);return isFinite(e)?e:0},Zu=function(){c.useEffect(function(){return document.body.setAttribute(Ue,(Yo()+1).toString()),function(){var e=Yo()-1;e<=0?document.body.removeAttribute(Ue):document.body.setAttribute(Ue,e.toString())}},[])},Qu=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Zu();var s=c.useMemo(function(){return Yu(r)},[r]);return c.createElement(Xu,{styles:qu(s,!t,r,n?"":"!important")})},jn=!1;if(typeof window<"u")try{var Mt=Object.defineProperty({},"passive",{get:function(){return jn=!0,!0}});window.addEventListener("test",Mt,Mt),window.removeEventListener("test",Mt,Mt)}catch{jn=!1}var Ve=jn?{passive:!1}:!1,Ju=function(e){return e.tagName==="TEXTAREA"},qr=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ju(e)&&n[t]==="visible")},ed=function(e){return qr(e,"overflowY")},td=function(e){return qr(e,"overflowX")},Xo=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Zr(e,o);if(r){var s=Qr(e,o),a=s[1],i=s[2];if(a>i)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},nd=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},od=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Zr=function(e,t){return e==="v"?ed(t):td(t)},Qr=function(e,t){return e==="v"?nd(t):od(t)},rd=function(e,t){return e==="h"&&t==="rtl"?-1:1},sd=function(e,t,n,o,r){var s=rd(e,window.getComputedStyle(t).direction),a=s*o,i=n.target,l=t.contains(i),u=!1,f=a>0,d=0,v=0;do{if(!i)break;var h=Qr(e,i),x=h[0],m=h[1],g=h[2],w=m-g-s*x;(x||w)&&Zr(e,i)&&(d+=w,v+=x);var y=i.parentNode;i=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&i!==document.body||l&&(t.contains(i)||t===i));return(f&&Math.abs(d)<1||!f&&Math.abs(v)<1)&&(u=!0),u},It=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qo=function(e){return[e.deltaX,e.deltaY]},Zo=function(e){return e&&"current"in e?e.current:e},ad=function(e,t){return e[0]===t[0]&&e[1]===t[1]},id=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},cd=0,We=[];function ld(e){var t=c.useRef([]),n=c.useRef([0,0]),o=c.useRef(),r=c.useState(cd++)[0],s=c.useState(Xr)[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 m=Mu([e.lockRef.current],(e.shards||[]).map(Zo),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var i=c.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var w=It(m),y=n.current,b="deltaX"in m?m.deltaX:y[0]-w[0],C="deltaY"in m?m.deltaY:y[1]-w[1],S,A=m.target,R=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in m&&R==="h"&&A.type==="range")return!1;var M=Xo(R,A);if(!M)return!0;if(M?S=R:(S=R==="v"?"h":"v",M=Xo(R,A)),!M)return!1;if(!o.current&&"changedTouches"in m&&(b||C)&&(o.current=S),!S)return!0;var B=o.current||S;return sd(B,g,m,B==="h"?b:C)},[]),l=c.useCallback(function(m){var g=m;if(!(!We.length||We[We.length-1]!==s)){var w="deltaY"in g?qo(g):It(g),y=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&ad(S.delta,w)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var b=(a.current.shards||[]).map(Zo).filter(Boolean).filter(function(S){return S.contains(g.target)}),C=b.length>0?i(g,b[0]):!a.current.noIsolation;C&&g.cancelable&&g.preventDefault()}}},[]),u=c.useCallback(function(m,g,w,y){var b={name:m,delta:g,target:w,should:y,shadowParent:ud(w)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(C){return C!==b})},1)},[]),f=c.useCallback(function(m){n.current=It(m),o.current=void 0},[]),d=c.useCallback(function(m){u(m.type,qo(m),m.target,i(m,e.lockRef.current))},[]),v=c.useCallback(function(m){u(m.type,It(m),m.target,i(m,e.lockRef.current))},[]);c.useEffect(function(){return We.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:v}),document.addEventListener("wheel",l,Ve),document.addEventListener("touchmove",l,Ve),document.addEventListener("touchstart",f,Ve),function(){We=We.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,Ve),document.removeEventListener("touchmove",l,Ve),document.removeEventListener("touchstart",f,Ve)}},[]);var h=e.removeScrollBar,x=e.inert;return c.createElement(c.Fragment,null,x?c.createElement(s,{styles:id(r)}):null,h?c.createElement(Qu,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ud(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dd=$u(Yr,ld);var wt=c.forwardRef(function(e,t){return c.createElement(rn,ve({},e,{ref:t,sideCar:dd}))});wt.classNames=rn.classNames;var Fn=["Enter"," "],fd=["ArrowDown","PageUp","Home"],Jr=["ArrowUp","PageDown","End"],pd=[...fd,...Jr],vd={ltr:[...Fn,"ArrowRight"],rtl:[...Fn,"ArrowLeft"]},md={ltr:["ArrowLeft"],rtl:["ArrowRight"]},yt="Menu",[dt,hd,gd]=Yt(yt),[Fe,es]=q(yt,[gd,Te,tt]),sn=Te(),ts=tt(),[xd,$e]=Fe(yt),[wd,bt]=Fe(yt),ns=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:r,onOpenChange:s,modal:a=!0}=e,i=sn(t),[l,u]=c.useState(null),f=c.useRef(!1),d=le(s),v=qe(r);return c.useEffect(()=>{const h=()=>{f.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>f.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})}},[]),p.jsx(en,{...i,children:p.jsx(xd,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:p.jsx(wd,{scope:t,onClose:c.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:v,modal:a,children:o})})})};ns.displayName=yt;var yd="MenuAnchor",ao=c.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=sn(n);return p.jsx(gt,{...r,...o,ref:t})});ao.displayName=yd;var io="MenuPortal",[bd,os]=Fe(io,{forceMount:void 0}),rs=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:r}=e,s=$e(io,t);return p.jsx(bd,{scope:t,forceMount:n,children:p.jsx(Z,{present:n||s.open,children:p.jsx(et,{asChild:!0,container:r,children:o})})})};rs.displayName=io;var ae="MenuContent",[Cd,co]=Fe(ae),ss=c.forwardRef((e,t)=>{const n=os(ae,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=$e(ae,e.__scopeMenu),a=bt(ae,e.__scopeMenu);return p.jsx(dt.Provider,{scope:e.__scopeMenu,children:p.jsx(Z,{present:o||s.open,children:p.jsx(dt.Slot,{scope:e.__scopeMenu,children:a.modal?p.jsx(Sd,{...r,ref:t}):p.jsx(Rd,{...r,ref:t})})})})}),Sd=c.forwardRef((e,t)=>{const n=$e(ae,e.__scopeMenu),o=c.useRef(null),r=O(t,o);return c.useEffect(()=>{const s=o.current;if(s)return on(s)},[]),p.jsx(lo,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:E(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Rd=c.forwardRef((e,t)=>{const n=$e(ae,e.__scopeMenu);return p.jsx(lo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ed=Pe("MenuContent.ScrollLock"),lo=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:i,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:v,onDismiss:h,disableOutsideScroll:x,...m}=e,g=$e(ae,n),w=bt(ae,n),y=sn(n),b=ts(n),C=hd(n),[S,A]=c.useState(null),R=c.useRef(null),M=O(t,R,g.onContentChange),B=c.useRef(0),k=c.useRef(""),N=c.useRef(0),j=c.useRef(null),L=c.useRef("right"),F=c.useRef(0),V=x?wt:c.Fragment,D=x?{as:Ed,allowPinchZoom:!0}:void 0,$=P=>{var I,H;const G=k.current+P,Y=C().filter(z=>!z.disabled),J=document.activeElement,we=(I=Y.find(z=>z.ref.current===J))==null?void 0:I.textValue,re=Y.map(z=>z.textValue),ye=jd(re,G,we),ee=(H=Y.find(z=>z.textValue===ye))==null?void 0:H.ref.current;(function z(W){k.current=W,window.clearTimeout(B.current),W!==""&&(B.current=window.setTimeout(()=>z(""),1e3))})(G),ee&&setTimeout(()=>ee.focus())};c.useEffect(()=>()=>window.clearTimeout(B.current),[]),Xt();const T=c.useCallback(P=>{var Y,J;return L.current===((Y=j.current)==null?void 0:Y.side)&&$d(P,(J=j.current)==null?void 0:J.area)},[]);return p.jsx(Cd,{scope:n,searchRef:k,onItemEnter:c.useCallback(P=>{T(P)&&P.preventDefault()},[T]),onItemLeave:c.useCallback(P=>{var G;T(P)||((G=R.current)==null||G.focus(),A(null))},[T]),onTriggerLeave:c.useCallback(P=>{T(P)&&P.preventDefault()},[T]),pointerGraceTimerRef:N,onPointerGraceIntentChange:c.useCallback(P=>{j.current=P},[]),children:p.jsx(V,{...D,children:p.jsx(vt,{asChild:!0,trapped:r,onMountAutoFocus:E(s,P=>{var G;P.preventDefault(),(G=R.current)==null||G.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:p.jsx(Ze,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:v,onDismiss:h,children:p.jsx(ro,{asChild:!0,...b,dir:w.dir,orientation:"vertical",loop:o,currentTabStopId:S,onCurrentTabStopIdChange:A,onEntryFocus:E(l,P=>{w.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(tn,{role:"menu","aria-orientation":"vertical","data-state":bs(g.open),"data-radix-menu-content":"",dir:w.dir,...y,...m,ref:M,style:{outline:"none",...m.style},onKeyDown:E(m.onKeyDown,P=>{const Y=P.target.closest("[data-radix-menu-content]")===P.currentTarget,J=P.ctrlKey||P.altKey||P.metaKey,we=P.key.length===1;Y&&(P.key==="Tab"&&P.preventDefault(),!J&&we&&$(P.key));const re=R.current;if(P.target!==re||!pd.includes(P.key))return;P.preventDefault();const ee=C().filter(I=>!I.disabled).map(I=>I.ref.current);Jr.includes(P.key)&&ee.reverse(),kd(ee)}),onBlur:E(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(B.current),k.current="")}),onPointerMove:E(e.onPointerMove,ft(P=>{const G=P.target,Y=F.current!==P.clientX;if(P.currentTarget.contains(G)&&Y){const J=P.clientX>F.current?"right":"left";L.current=J,F.current=P.clientX}}))})})})})})})});ss.displayName=ae;var Pd="MenuGroup",uo=c.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(_.div,{role:"group",...o,ref:t})});uo.displayName=Pd;var Ad="MenuLabel",as=c.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(_.div,{...o,ref:t})});as.displayName=Ad;var $t="MenuItem",Qo="menu.itemSelect",an=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...r}=e,s=c.useRef(null),a=bt($t,e.__scopeMenu),i=co($t,e.__scopeMenu),l=O(t,s),u=c.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const v=new CustomEvent(Qo,{bubbles:!0,cancelable:!0});d.addEventListener(Qo,h=>o==null?void 0:o(h),{once:!0}),ir(d,v),v.defaultPrevented?u.current=!1:a.onClose()}};return p.jsx(is,{...r,ref:l,disabled:n,onClick:E(e.onClick,f),onPointerDown:d=>{var v;(v=e.onPointerDown)==null||v.call(e,d),u.current=!0},onPointerUp:E(e.onPointerUp,d=>{var v;u.current||(v=d.currentTarget)==null||v.click()}),onKeyDown:E(e.onKeyDown,d=>{const v=i.searchRef.current!=="";n||v&&d.key===" "||Fn.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});an.displayName=$t;var is=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=e,a=co($t,n),i=ts(n),l=c.useRef(null),u=O(t,l),[f,d]=c.useState(!1),[v,h]=c.useState("");return c.useEffect(()=>{const x=l.current;x&&h((x.textContent??"").trim())},[s.children]),p.jsx(dt.ItemSlot,{scope:n,disabled:o,textValue:r??v,children:p.jsx(so,{asChild:!0,...i,focusable:!o,children:p.jsx(_.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:u,onPointerMove:E(e.onPointerMove,ft(x=>{o?a.onItemLeave(x):(a.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:E(e.onPointerLeave,ft(x=>a.onItemLeave(x))),onFocus:E(e.onFocus,()=>d(!0)),onBlur:E(e.onBlur,()=>d(!1))})})})}),_d="MenuCheckboxItem",cs=c.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...r}=e;return p.jsx(ps,{scope:e.__scopeMenu,checked:n,children:p.jsx(an,{role:"menuitemcheckbox","aria-checked":Bt(n)?"mixed":n,...r,ref:t,"data-state":po(n),onSelect:E(r.onSelect,()=>o==null?void 0:o(Bt(n)?!0:!n),{checkForDefaultPrevented:!1})})})});cs.displayName=_d;var ls="MenuRadioGroup",[Td,Md]=Fe(ls,{value:void 0,onValueChange:()=>{}}),us=c.forwardRef((e,t)=>{const{value:n,onValueChange:o,...r}=e,s=le(o);return p.jsx(Td,{scope:e.__scopeMenu,value:n,onValueChange:s,children:p.jsx(uo,{...r,ref:t})})});us.displayName=ls;var ds="MenuRadioItem",fs=c.forwardRef((e,t)=>{const{value:n,...o}=e,r=Md(ds,e.__scopeMenu),s=n===r.value;return p.jsx(ps,{scope:e.__scopeMenu,checked:s,children:p.jsx(an,{role:"menuitemradio","aria-checked":s,...o,ref:t,"data-state":po(s),onSelect:E(o.onSelect,()=>{var a;return(a=r.onValueChange)==null?void 0:a.call(r,n)},{checkForDefaultPrevented:!1})})})});fs.displayName=ds;var fo="MenuItemIndicator",[ps,Id]=Fe(fo,{checked:!1}),vs=c.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...r}=e,s=Id(fo,n);return p.jsx(Z,{present:o||Bt(s.checked)||s.checked===!0,children:p.jsx(_.span,{...r,ref:t,"data-state":po(s.checked)})})});vs.displayName=fo;var Dd="MenuSeparator",ms=c.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return p.jsx(_.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});ms.displayName=Dd;var Nd="MenuArrow",hs=c.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,r=sn(n);return p.jsx(nn,{...r,...o,ref:t})});hs.displayName=Nd;var Od="MenuSub",[Gv,gs]=Fe(Od),it="MenuSubTrigger",xs=c.forwardRef((e,t)=>{const n=$e(it,e.__scopeMenu),o=bt(it,e.__scopeMenu),r=gs(it,e.__scopeMenu),s=co(it,e.__scopeMenu),a=c.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},f=c.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return c.useEffect(()=>f,[f]),c.useEffect(()=>{const d=i.current;return()=>{window.clearTimeout(d),l(null)}},[i,l]),p.jsx(ao,{asChild:!0,...u,children:p.jsx(is,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":bs(n.open),...e,ref:zt(t,r.onTriggerChange),onClick:d=>{var v;(v=e.onClick)==null||v.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:E(e.onPointerMove,ft(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:E(e.onPointerLeave,ft(d=>{var h,x;f();const v=(h=n.content)==null?void 0:h.getBoundingClientRect();if(v){const m=(x=n.content)==null?void 0:x.dataset.side,g=m==="right",w=g?-5:5,y=v[g?"left":"right"],b=v[g?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+w,y:d.clientY},{x:y,y:v.top},{x:b,y:v.top},{x:b,y:v.bottom},{x:y,y:v.bottom}],side:m}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:E(e.onKeyDown,d=>{var h;const v=s.searchRef.current!=="";e.disabled||v&&d.key===" "||vd[o.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});xs.displayName=it;var ws="MenuSubContent",ys=c.forwardRef((e,t)=>{const n=os(ae,e.__scopeMenu),{forceMount:o=n.forceMount,...r}=e,s=$e(ae,e.__scopeMenu),a=bt(ae,e.__scopeMenu),i=gs(ws,e.__scopeMenu),l=c.useRef(null),u=O(t,l);return p.jsx(dt.Provider,{scope:e.__scopeMenu,children:p.jsx(Z,{present:o||s.open,children:p.jsx(dt.Slot,{scope:e.__scopeMenu,children:p.jsx(lo,{id:i.contentId,"aria-labelledby":i.triggerId,...r,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:E(e.onFocusOutside,f=>{f.target!==i.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:E(e.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:E(e.onKeyDown,f=>{var h;const d=f.currentTarget.contains(f.target),v=md[a.dir].includes(f.key);d&&v&&(s.onOpenChange(!1),(h=i.trigger)==null||h.focus(),f.preventDefault())})})})})})});ys.displayName=ws;function bs(e){return e?"open":"closed"}function Bt(e){return e==="indeterminate"}function po(e){return Bt(e)?"indeterminate":e?"checked":"unchecked"}function kd(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ld(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function jd(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Ld(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function Fd(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],u=i.x,f=i.y,d=l.x,v=l.y;f>o!=v>o&&n<(d-u)*(o-f)/(v-f)+u&&(r=!r)}return r}function $d(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Fd(n,t)}function ft(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Bd=ns,Vd=ao,Wd=rs,Hd=ss,Ud=uo,Kd=as,Gd=an,zd=cs,Yd=us,Xd=fs,qd=vs,Zd=ms,Qd=hs,Jd=xs,ef=ys,cn="DropdownMenu",[tf]=q(cn,[es]),Q=es(),[nf,Cs]=tf(cn),Ss=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:r,defaultOpen:s,onOpenChange:a,modal:i=!0}=e,l=Q(t),u=c.useRef(null),[f,d]=ie({prop:r,defaultProp:s??!1,onChange:a,caller:cn});return p.jsx(nf,{scope:t,triggerId:se(),triggerRef:u,contentId:se(),open:f,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(v=>!v),[d]),modal:i,children:p.jsx(Bd,{...l,open:f,onOpenChange:d,dir:o,modal:i,children:n})})};Ss.displayName=cn;var Rs="DropdownMenuTrigger",Es=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...r}=e,s=Cs(Rs,n),a=Q(n);return p.jsx(Vd,{asChild:!0,...a,children:p.jsx(_.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:zt(t,s.triggerRef),onPointerDown:E(e.onPointerDown,i=>{!o&&i.button===0&&i.ctrlKey===!1&&(s.onOpenToggle(),s.open||i.preventDefault())}),onKeyDown:E(e.onKeyDown,i=>{o||(["Enter"," "].includes(i.key)&&s.onOpenToggle(),i.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});Es.displayName=Rs;var of="DropdownMenuPortal",Ps=e=>{const{__scopeDropdownMenu:t,...n}=e,o=Q(t);return p.jsx(Wd,{...o,...n})};Ps.displayName=of;var As="DropdownMenuContent",_s=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Cs(As,n),s=Q(n),a=c.useRef(!1);return p.jsx(Hd,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:t,onCloseAutoFocus:E(e.onCloseAutoFocus,i=>{var l;a.current||(l=r.triggerRef.current)==null||l.focus(),a.current=!1,i.preventDefault()}),onInteractOutside:E(e.onInteractOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!r.modal||f)&&(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)"}})});_s.displayName=As;var rf="DropdownMenuGroup",sf=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Ud,{...r,...o,ref:t})});sf.displayName=rf;var af="DropdownMenuLabel",cf=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Kd,{...r,...o,ref:t})});cf.displayName=af;var lf="DropdownMenuItem",Ts=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Gd,{...r,...o,ref:t})});Ts.displayName=lf;var uf="DropdownMenuCheckboxItem",df=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(zd,{...r,...o,ref:t})});df.displayName=uf;var ff="DropdownMenuRadioGroup",pf=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Yd,{...r,...o,ref:t})});pf.displayName=ff;var vf="DropdownMenuRadioItem",mf=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Xd,{...r,...o,ref:t})});mf.displayName=vf;var hf="DropdownMenuItemIndicator",gf=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(qd,{...r,...o,ref:t})});gf.displayName=hf;var xf="DropdownMenuSeparator",wf=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Zd,{...r,...o,ref:t})});wf.displayName=xf;var yf="DropdownMenuArrow",bf=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Qd,{...r,...o,ref:t})});bf.displayName=yf;var Cf="DropdownMenuSubTrigger",Sf=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(Jd,{...r,...o,ref:t})});Sf.displayName=Cf;var Rf="DropdownMenuSubContent",Ef=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,r=Q(n);return p.jsx(ef,{...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)"}})});Ef.displayName=Rf;var zv=Ss,Yv=Es,Xv=Ps,qv=_s,Zv=Ts,ln="Dialog",[Ms,Is]=q(ln),[Pf,fe]=Ms(ln),Ds=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!0}=e,i=c.useRef(null),l=c.useRef(null),[u,f]=ie({prop:o,defaultProp:r??!1,onChange:s,caller:ln});return p.jsx(Pf,{scope:t,triggerRef:i,contentRef:l,contentId:se(),titleId:se(),descriptionId:se(),open:u,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(d=>!d),[f]),modal:a,children:n})};Ds.displayName=ln;var Ns="DialogTrigger",Os=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=fe(Ns,n),s=O(t,r.triggerRef);return p.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":ho(r.open),...o,ref:s,onClick:E(e.onClick,r.onOpenToggle)})});Os.displayName=Ns;var vo="DialogPortal",[Af,ks]=Ms(vo,{forceMount:void 0}),Ls=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=fe(vo,t);return p.jsx(Af,{scope:t,forceMount:n,children:c.Children.map(o,a=>p.jsx(Z,{present:n||s.open,children:p.jsx(et,{asChild:!0,container:r,children:a})}))})};Ls.displayName=vo;var Vt="DialogOverlay",js=c.forwardRef((e,t)=>{const n=ks(Vt,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=fe(Vt,e.__scopeDialog);return s.modal?p.jsx(Z,{present:o||s.open,children:p.jsx(Tf,{...r,ref:t})}):null});js.displayName=Vt;var _f=Pe("DialogOverlay.RemoveScroll"),Tf=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=fe(Vt,n);return p.jsx(wt,{as:_f,allowPinchZoom:!0,shards:[r.contentRef],children:p.jsx(_.div,{"data-state":ho(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),ke="DialogContent",Fs=c.forwardRef((e,t)=>{const n=ks(ke,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,s=fe(ke,e.__scopeDialog);return p.jsx(Z,{present:o||s.open,children:s.modal?p.jsx(Mf,{...r,ref:t}):p.jsx(If,{...r,ref:t})})});Fs.displayName=ke;var Mf=c.forwardRef((e,t)=>{const n=fe(ke,e.__scopeDialog),o=c.useRef(null),r=O(t,n.contentRef,o);return c.useEffect(()=>{const s=o.current;if(s)return on(s)},[]),p.jsx($s,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,i=a.button===0&&a.ctrlKey===!0;(a.button===2||i)&&s.preventDefault()}),onFocusOutside:E(e.onFocusOutside,s=>s.preventDefault())})}),If=c.forwardRef((e,t)=>{const n=fe(ke,e.__scopeDialog),o=c.useRef(!1),r=c.useRef(!1);return p.jsx($s,{...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,u;(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;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),$s=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...a}=e,i=fe(ke,n),l=c.useRef(null),u=O(t,l);return Xt(),p.jsxs(p.Fragment,{children:[p.jsx(vt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:p.jsx(Ze,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":ho(i.open),...a,ref:u,onDismiss:()=>i.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(Nf,{titleId:i.titleId}),p.jsx(kf,{contentRef:l,descriptionId:i.descriptionId})]})]})}),mo="DialogTitle",Bs=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=fe(mo,n);return p.jsx(_.h2,{id:r.titleId,...o,ref:t})});Bs.displayName=mo;var Vs="DialogDescription",Ws=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=fe(Vs,n);return p.jsx(_.p,{id:r.descriptionId,...o,ref:t})});Ws.displayName=Vs;var Hs="DialogClose",Us=c.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=fe(Hs,n);return p.jsx(_.button,{type:"button",...o,ref:t,onClick:E(e.onClick,()=>r.onOpenChange(!1))})});Us.displayName=Hs;function ho(e){return e?"open":"closed"}var Ks="DialogTitleWarning",[Df,Gs]=uc(Ks,{contentName:ke,titleName:mo,docsSlug:"dialog"}),Nf=({titleId:e})=>{const t=Gs(Ks),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

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

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Of="DialogDescriptionWarning",kf=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gs(Of).contentName}}.`;return c.useEffect(()=>{var s;const r=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Lf=Ds,jf=Os,Ff=Ls,$f=js,Bf=Fs,Vf=Bs,Wf=Ws,zs=Us,Ys="AlertDialog",[Hf]=q(Ys,[Is]),Se=Is(),Xs=e=>{const{__scopeAlertDialog:t,...n}=e,o=Se(t);return p.jsx(Lf,{...o,...n,modal:!0})};Xs.displayName=Ys;var Uf="AlertDialogTrigger",Kf=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(jf,{...r,...o,ref:t})});Kf.displayName=Uf;var Gf="AlertDialogPortal",qs=e=>{const{__scopeAlertDialog:t,...n}=e,o=Se(t);return p.jsx(Ff,{...o,...n})};qs.displayName=Gf;var zf="AlertDialogOverlay",Zs=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx($f,{...r,...o,ref:t})});Zs.displayName=zf;var Ke="AlertDialogContent",[Yf,Xf]=Hf(Ke),qf=ar("AlertDialogContent"),Qs=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(Df,{contentName:Ke,titleName:Js,docsSlug:"alert-dialog",children:p.jsx(Yf,{scope:n,cancelRef:l,children:p.jsxs(Bf,{role:"alertdialog",...s,...r,ref:i,onOpenAutoFocus:E(r.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=l.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[p.jsx(qf,{children:o}),p.jsx(Qf,{contentRef:a})]})})})});Qs.displayName=Ke;var Js="AlertDialogTitle",ea=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(Vf,{...r,...o,ref:t})});ea.displayName=Js;var ta="AlertDialogDescription",na=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(Wf,{...r,...o,ref:t})});na.displayName=ta;var Zf="AlertDialogAction",oa=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,r=Se(n);return p.jsx(zs,{...r,...o,ref:t})});oa.displayName=Zf;var ra="AlertDialogCancel",sa=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:r}=Xf(ra,n),s=Se(n),a=O(t,r);return p.jsx(zs,{...s,...o,ref:a})});sa.displayName=ra;var Qf=({contentRef:e})=>{const t=`\`${Ke}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${Ke}\` by passing a \`${ta}\` component as a child, which also benefits sighted users by adding visible context to the dialog.

Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ke}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.

For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return c.useEffect(()=>{var o;document.getElementById((o=e.current)==null?void 0:o.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Qv=Xs,Jv=qs,em=Zs,tm=Qs,nm=oa,om=sa,rm=ea,sm=na;function Wt(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ct(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 aa=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"}),Jf="VisuallyHidden",ia=c.forwardRef((e,t)=>p.jsx(_.span,{...e,ref:t,style:{...aa,...e.style}}));ia.displayName=Jf;var ep=ia,tp=[" ","Enter","ArrowUp","ArrowDown"],np=[" ","Enter"],Le="Select",[un,dn,op]=Yt(Le),[nt]=q(Le,[op,Te]),fn=Te(),[rp,Me]=nt(Le),[sp,ap]=nt(Le),ca=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:s,value:a,defaultValue:i,onValueChange:l,dir:u,name:f,autoComplete:d,disabled:v,required:h,form:x}=e,m=fn(t),[g,w]=c.useState(null),[y,b]=c.useState(null),[C,S]=c.useState(!1),A=qe(u),[R,M]=ie({prop:o,defaultProp:r??!1,onChange:s,caller:Le}),[B,k]=ie({prop:a,defaultProp:i,onChange:l,caller:Le}),N=c.useRef(null),j=g?x||!!g.closest("form"):!0,[L,F]=c.useState(new Set),V=Array.from(L).map(D=>D.props.value).join(";");return p.jsx(en,{...m,children:p.jsxs(rp,{required:h,scope:t,trigger:g,onTriggerChange:w,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:C,onValueNodeHasChildrenChange:S,contentId:se(),value:B,onValueChange:k,open:R,onOpenChange:M,dir:A,triggerPointerDownPosRef:N,disabled:v,children:[p.jsx(un.Provider,{scope:t,children:p.jsx(sp,{scope:e.__scopeSelect,onNativeOptionAdd:c.useCallback(D=>{F($=>new Set($).add(D))},[]),onNativeOptionRemove:c.useCallback(D=>{F($=>{const T=new Set($);return T.delete(D),T})},[]),children:n})}),j?p.jsxs(Ma,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:d,value:B,onChange:D=>k(D.target.value),disabled:v,form:x,children:[B===void 0?p.jsx("option",{value:""}):null,Array.from(L)]},V):null]})})};ca.displayName=Le;var la="SelectTrigger",ua=c.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,s=fn(n),a=Me(la,n),i=a.disabled||o,l=O(t,a.onTriggerChange),u=dn(n),f=c.useRef("touch"),[d,v,h]=Da(m=>{const g=u().filter(b=>!b.disabled),w=g.find(b=>b.value===a.value),y=Na(g,m,w);y!==void 0&&a.onValueChange(y.value)}),x=m=>{i||(a.onOpenChange(!0),h()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return p.jsx(gt,{asChild:!0,...s,children:p.jsx(_.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Ia(a.value)?"":void 0,...r,ref:l,onClick:E(r.onClick,m=>{m.currentTarget.focus(),f.current!=="mouse"&&x(m)}),onPointerDown:E(r.onPointerDown,m=>{f.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(x(m),m.preventDefault())}),onKeyDown:E(r.onKeyDown,m=>{const g=d.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&v(m.key),!(g&&m.key===" ")&&tp.includes(m.key)&&(x(),m.preventDefault())})})})});ua.displayName=la;var da="SelectValue",fa=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:s,placeholder:a="",...i}=e,l=Me(da,n),{onValueNodeHasChildrenChange:u}=l,f=s!==void 0,d=O(t,l.onValueNodeChange);return X(()=>{u(f)},[u,f]),p.jsx(_.span,{...i,ref:d,style:{pointerEvents:"none"},children:Ia(l.value)?p.jsx(p.Fragment,{children:a}):s})});fa.displayName=da;var ip="SelectIcon",pa=c.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return p.jsx(_.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});pa.displayName=ip;var cp="SelectPortal",va=e=>p.jsx(et,{asChild:!0,...e});va.displayName=cp;var je="SelectContent",ma=c.forwardRef((e,t)=>{const n=Me(je,e.__scopeSelect),[o,r]=c.useState();if(X(()=>{r(new DocumentFragment)},[]),!n.open){const s=o;return s?Kt.createPortal(p.jsx(ha,{scope:e.__scopeSelect,children:p.jsx(un.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),s):null}return p.jsx(ga,{...e,ref:t})});ma.displayName=je;var ce=10,[ha,Ie]=nt(je),lp="SelectContentImpl",up=Pe("SelectContent.RemoveScroll"),ga=c.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:s,onPointerDownOutside:a,side:i,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:v,collisionPadding:h,sticky:x,hideWhenDetached:m,avoidCollisions:g,...w}=e,y=Me(je,n),[b,C]=c.useState(null),[S,A]=c.useState(null),R=O(t,I=>C(I)),[M,B]=c.useState(null),[k,N]=c.useState(null),j=dn(n),[L,F]=c.useState(!1),V=c.useRef(!1);c.useEffect(()=>{if(b)return on(b)},[b]),Xt();const D=c.useCallback(I=>{const[H,...z]=j().map(K=>K.ref.current),[W]=z.slice(-1),U=document.activeElement;for(const K of I)if(K===U||(K==null||K.scrollIntoView({block:"nearest"}),K===H&&S&&(S.scrollTop=0),K===W&&S&&(S.scrollTop=S.scrollHeight),K==null||K.focus(),document.activeElement!==U))return},[j,S]),$=c.useCallback(()=>D([M,b]),[D,M,b]);c.useEffect(()=>{L&&$()},[L,$]);const{onOpenChange:T,triggerPointerDownPosRef:P}=y;c.useEffect(()=>{if(b){let I={x:0,y:0};const H=W=>{var U,K;I={x:Math.abs(Math.round(W.pageX)-(((U=P.current)==null?void 0:U.x)??0)),y:Math.abs(Math.round(W.pageY)-(((K=P.current)==null?void 0:K.y)??0))}},z=W=>{I.x<=10&&I.y<=10?W.preventDefault():b.contains(W.target)||T(!1),document.removeEventListener("pointermove",H),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",z,{capture:!0})}}},[b,T,P]),c.useEffect(()=>{const I=()=>T(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[T]);const[G,Y]=Da(I=>{const H=j().filter(U=>!U.disabled),z=H.find(U=>U.ref.current===document.activeElement),W=Na(H,I,z);W&&setTimeout(()=>W.ref.current.focus())}),J=c.useCallback((I,H,z)=>{const W=!V.current&&!z;(y.value!==void 0&&y.value===H||W)&&(B(I),W&&(V.current=!0))},[y.value]),we=c.useCallback(()=>b==null?void 0:b.focus(),[b]),re=c.useCallback((I,H,z)=>{const W=!V.current&&!z;(y.value!==void 0&&y.value===H||W)&&N(I)},[y.value]),ye=o==="popper"?$n:xa,ee=ye===$n?{side:i,sideOffset:l,align:u,alignOffset:f,arrowPadding:d,collisionBoundary:v,collisionPadding:h,sticky:x,hideWhenDetached:m,avoidCollisions:g}:{};return p.jsx(ha,{scope:n,content:b,viewport:S,onViewportChange:A,itemRefCallback:J,selectedItem:M,onItemLeave:we,itemTextRefCallback:re,focusSelectedItem:$,selectedItemText:k,position:o,isPositioned:L,searchRef:G,children:p.jsx(wt,{as:up,allowPinchZoom:!0,children:p.jsx(vt,{asChild:!0,trapped:y.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:E(r,I=>{var H;(H=y.trigger)==null||H.focus({preventScroll:!0}),I.preventDefault()}),children:p.jsx(Ze,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:p.jsx(ye,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:I=>I.preventDefault(),...w,...ee,onPlaced:()=>F(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:E(w.onKeyDown,I=>{const H=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!H&&I.key.length===1&&Y(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let W=j().filter(U=>!U.disabled).map(U=>U.ref.current);if(["ArrowUp","End"].includes(I.key)&&(W=W.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const U=I.target,K=W.indexOf(U);W=W.slice(K+1)}setTimeout(()=>D(W)),I.preventDefault()}})})})})})})});ga.displayName=lp;var dp="SelectItemAlignedPosition",xa=c.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,s=Me(je,n),a=Ie(je,n),[i,l]=c.useState(null),[u,f]=c.useState(null),d=O(t,R=>f(R)),v=dn(n),h=c.useRef(!1),x=c.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:w,focusSelectedItem:y}=a,b=c.useCallback(()=>{if(s.trigger&&s.valueNode&&i&&u&&m&&g&&w){const R=s.trigger.getBoundingClientRect(),M=u.getBoundingClientRect(),B=s.valueNode.getBoundingClientRect(),k=w.getBoundingClientRect();if(s.dir!=="rtl"){const U=k.left-M.left,K=B.left-U,te=R.left-K,pe=R.width+te,rt=Math.max(pe,M.width),st=window.innerWidth-ce,at=Wt(K,[ce,Math.max(ce,st-rt)]);i.style.minWidth=pe+"px",i.style.left=at+"px"}else{const U=M.right-k.right,K=window.innerWidth-B.right-U,te=window.innerWidth-R.right-K,pe=R.width+te,rt=Math.max(pe,M.width),st=window.innerWidth-ce,at=Wt(K,[ce,Math.max(ce,st-rt)]);i.style.minWidth=pe+"px",i.style.right=at+"px"}const N=v(),j=window.innerHeight-ce*2,L=m.scrollHeight,F=window.getComputedStyle(u),V=parseInt(F.borderTopWidth,10),D=parseInt(F.paddingTop,10),$=parseInt(F.borderBottomWidth,10),T=parseInt(F.paddingBottom,10),P=V+D+L+T+$,G=Math.min(g.offsetHeight*5,P),Y=window.getComputedStyle(m),J=parseInt(Y.paddingTop,10),we=parseInt(Y.paddingBottom,10),re=R.top+R.height/2-ce,ye=j-re,ee=g.offsetHeight/2,I=g.offsetTop+ee,H=V+D+I,z=P-H;if(H<=re){const U=N.length>0&&g===N[N.length-1].ref.current;i.style.bottom="0px";const K=u.clientHeight-m.offsetTop-m.offsetHeight,te=Math.max(ye,ee+(U?we:0)+K+$),pe=H+te;i.style.height=pe+"px"}else{const U=N.length>0&&g===N[0].ref.current;i.style.top="0px";const te=Math.max(re,V+m.offsetTop+(U?J:0)+ee)+z;i.style.height=te+"px",m.scrollTop=H-re+m.offsetTop}i.style.margin=`${ce}px 0`,i.style.minHeight=G+"px",i.style.maxHeight=j+"px",o==null||o(),requestAnimationFrame(()=>h.current=!0)}},[v,s.trigger,s.valueNode,i,u,m,g,w,s.dir,o]);X(()=>b(),[b]);const[C,S]=c.useState();X(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const A=c.useCallback(R=>{R&&x.current===!0&&(b(),y==null||y(),x.current=!1)},[b,y]);return p.jsx(pp,{scope:n,contentWrapper:i,shouldExpandOnScrollRef:h,onScrollButtonChange:A,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:p.jsx(_.div,{...r,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});xa.displayName=dp;var fp="SelectPopperPosition",$n=c.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=ce,...s}=e,a=fn(n);return p.jsx(tn,{...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)"}})});$n.displayName=fp;var[pp,go]=nt(je,{}),Bn="SelectViewport",wa=c.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,s=Ie(Bn,n),a=go(Bn,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(un.Slot,{scope:n,children:p.jsx(_.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E(r.onScroll,u=>{const f=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:v}=a;if(v!=null&&v.current&&d){const h=Math.abs(l.current-f.scrollTop);if(h>0){const x=window.innerHeight-ce*2,m=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),w=Math.max(m,g);if(w<x){const y=w+h,b=Math.min(x,y),C=y-b;d.style.height=b+"px",d.style.bottom==="0px"&&(f.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}l.current=f.scrollTop})})})]})});wa.displayName=Bn;var ya="SelectGroup",[vp,mp]=nt(ya),hp=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=se();return p.jsx(vp,{scope:n,id:r,children:p.jsx(_.div,{role:"group","aria-labelledby":r,...o,ref:t})})});hp.displayName=ya;var ba="SelectLabel",gp=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=mp(ba,n);return p.jsx(_.div,{id:r.id,...o,ref:t})});gp.displayName=ba;var Ht="SelectItem",[xp,Ca]=nt(Ht),Sa=c.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:s,...a}=e,i=Me(Ht,n),l=Ie(Ht,n),u=i.value===o,[f,d]=c.useState(s??""),[v,h]=c.useState(!1),x=O(t,y=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,y,o,r)}),m=se(),g=c.useRef("touch"),w=()=>{r||(i.onValueChange(o),i.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(xp,{scope:n,value:o,disabled:r,textId:m,isSelected:u,onItemTextChange:c.useCallback(y=>{d(b=>b||((y==null?void 0:y.textContent)??"").trim())},[]),children:p.jsx(un.ItemSlot,{scope:n,value:o,disabled:r,textValue:f,children:p.jsx(_.div,{role:"option","aria-labelledby":m,"data-highlighted":v?"":void 0,"aria-selected":u&&v,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:x,onFocus:E(a.onFocus,()=>h(!0)),onBlur:E(a.onBlur,()=>h(!1)),onClick:E(a.onClick,()=>{g.current!=="mouse"&&w()}),onPointerUp:E(a.onPointerUp,()=>{g.current==="mouse"&&w()}),onPointerDown:E(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:E(a.onPointerMove,y=>{var b;g.current=y.pointerType,r?(b=l.onItemLeave)==null||b.call(l):g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(a.onPointerLeave,y=>{var b;y.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:E(a.onKeyDown,y=>{var C;((C=l.searchRef)==null?void 0:C.current)!==""&&y.key===" "||(np.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})})})})});Sa.displayName=Ht;var ct="SelectItemText",Ra=c.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...s}=e,a=Me(ct,n),i=Ie(ct,n),l=Ca(ct,n),u=ap(ct,n),[f,d]=c.useState(null),v=O(t,w=>d(w),l.onItemTextChange,w=>{var y;return(y=i.itemTextRefCallback)==null?void 0:y.call(i,w,l.value,l.disabled)}),h=f==null?void 0:f.textContent,x=c.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return X(()=>(m(x),()=>g(x)),[m,g,x]),p.jsxs(p.Fragment,{children:[p.jsx(_.span,{id:l.textId,...s,ref:v}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Kt.createPortal(s.children,a.valueNode):null]})});Ra.displayName=ct;var Ea="SelectItemIndicator",Pa=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return Ca(Ea,n).isSelected?p.jsx(_.span,{"aria-hidden":!0,...o,ref:t}):null});Pa.displayName=Ea;var Vn="SelectScrollUpButton",Aa=c.forwardRef((e,t)=>{const n=Ie(Vn,e.__scopeSelect),o=go(Vn,e.__scopeSelect),[r,s]=c.useState(!1),a=O(t,o.onScrollButtonChange);return X(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollTop>0;s(u)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),r?p.jsx(Ta,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop-l.offsetHeight)}}):null});Aa.displayName=Vn;var Wn="SelectScrollDownButton",_a=c.forwardRef((e,t)=>{const n=Ie(Wn,e.__scopeSelect),o=go(Wn,e.__scopeSelect),[r,s]=c.useState(!1),a=O(t,o.onScrollButtonChange);return X(()=>{if(n.viewport&&n.isPositioned){let i=function(){const u=l.scrollHeight-l.clientHeight,f=Math.ceil(l.scrollTop)<u;s(f)};const l=n.viewport;return i(),l.addEventListener("scroll",i),()=>l.removeEventListener("scroll",i)}},[n.viewport,n.isPositioned]),r?p.jsx(Ta,{...e,ref:a,onAutoScroll:()=>{const{viewport:i,selectedItem:l}=n;i&&l&&(i.scrollTop=i.scrollTop+l.offsetHeight)}}):null});_a.displayName=Wn;var Ta=c.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,s=Ie("SelectScrollButton",n),a=c.useRef(null),i=dn(n),l=c.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return c.useEffect(()=>()=>l(),[l]),X(()=>{var f;const u=i().find(d=>d.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[i]),p.jsx(_.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:E(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(o,50))}),onPointerMove:E(r.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),a.current===null&&(a.current=window.setInterval(o,50))}),onPointerLeave:E(r.onPointerLeave,()=>{l()})})}),wp="SelectSeparator",yp=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return p.jsx(_.div,{"aria-hidden":!0,...o,ref:t})});yp.displayName=wp;var Hn="SelectArrow",bp=c.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=fn(n),s=Me(Hn,n),a=Ie(Hn,n);return s.open&&a.position==="popper"?p.jsx(nn,{...r,...o,ref:t}):null});bp.displayName=Hn;var Cp="SelectBubbleInput",Ma=c.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=c.useRef(null),s=O(o,r),a=Ct(t);return c.useEffect(()=>{const i=r.current;if(!i)return;const l=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&f){const d=new Event("change",{bubbles:!0});f.call(i,t),i.dispatchEvent(d)}},[a,t]),p.jsx(_.select,{...n,style:{...aa,...n.style},ref:s,defaultValue:t})});Ma.displayName=Cp;function Ia(e){return e===""||e===void 0}function Da(e){const t=le(e),n=c.useRef(""),o=c.useRef(0),r=c.useCallback(a=>{const i=n.current+a;t(i),function l(u){n.current=u,window.clearTimeout(o.current),u!==""&&(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 Na(e,t,n){const r=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=Sp(e,Math.max(s,0));r.length===1&&(a=a.filter(u=>u!==n));const l=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function Sp(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var am=ca,im=ua,cm=fa,lm=pa,um=va,dm=ma,fm=wa,pm=Sa,vm=Ra,mm=Pa,hm=Aa,gm=_a,Rp="Separator",Jo="horizontal",Ep=["horizontal","vertical"],Oa=c.forwardRef((e,t)=>{const{decorative:n,orientation:o=Jo,...r}=e,s=Pp(o)?o:Jo,i=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return p.jsx(_.div,{"data-orientation":s,...i,...r,ref:t})});Oa.displayName=Rp;function Pp(e){return Ep.includes(e)}var xm=Oa,pn="Popover",[ka]=q(pn,[Te]),St=Te(),[Ap,De]=ka(pn),La=e=>{const{__scopePopover:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:a=!1}=e,i=St(t),l=c.useRef(null),[u,f]=c.useState(!1),[d,v]=ie({prop:o,defaultProp:r??!1,onChange:s,caller:pn});return p.jsx(en,{...i,children:p.jsx(Ap,{scope:t,contentId:se(),triggerRef:l,open:d,onOpenChange:v,onOpenToggle:c.useCallback(()=>v(h=>!h),[v]),hasCustomAnchor:u,onCustomAnchorAdd:c.useCallback(()=>f(!0),[]),onCustomAnchorRemove:c.useCallback(()=>f(!1),[]),modal:a,children:n})})};La.displayName=pn;var ja="PopoverAnchor",_p=c.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=De(ja,n),s=St(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:i}=r;return c.useEffect(()=>(a(),()=>i()),[a,i]),p.jsx(gt,{...s,...o,ref:t})});_p.displayName=ja;var Fa="PopoverTrigger",$a=c.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=De(Fa,n),s=St(n),a=O(t,r.triggerRef),i=p.jsx(_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Ua(r.open),...o,ref:a,onClick:E(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?i:p.jsx(gt,{asChild:!0,...s,children:i})});$a.displayName=Fa;var xo="PopoverPortal",[Tp,Mp]=ka(xo,{forceMount:void 0}),Ba=e=>{const{__scopePopover:t,forceMount:n,children:o,container:r}=e,s=De(xo,t);return p.jsx(Tp,{scope:t,forceMount:n,children:p.jsx(Z,{present:n||s.open,children:p.jsx(et,{asChild:!0,container:r,children:o})})})};Ba.displayName=xo;var Ye="PopoverContent",Va=c.forwardRef((e,t)=>{const n=Mp(Ye,e.__scopePopover),{forceMount:o=n.forceMount,...r}=e,s=De(Ye,e.__scopePopover);return p.jsx(Z,{present:o||s.open,children:s.modal?p.jsx(Dp,{...r,ref:t}):p.jsx(Np,{...r,ref:t})})});Va.displayName=Ye;var Ip=Pe("PopoverContent.RemoveScroll"),Dp=c.forwardRef((e,t)=>{const n=De(Ye,e.__scopePopover),o=c.useRef(null),r=O(t,o),s=c.useRef(!1);return c.useEffect(()=>{const a=o.current;if(a)return on(a)},[]),p.jsx(wt,{as:Ip,allowPinchZoom:!0,children:p.jsx(Wa,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),s.current||(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0,u=i.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:E(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Np=c.forwardRef((e,t)=>{const n=De(Ye,e.__scopePopover),o=c.useRef(!1),r=c.useRef(!1);return p.jsx(Wa,{...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,u;(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;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})}),Wa=c.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,...d}=e,v=De(Ye,n),h=St(n);return Xt(),p.jsx(vt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:p.jsx(Ze,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>v.onOpenChange(!1),children:p.jsx(tn,{"data-state":Ua(v.open),role:"dialog",id:v.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ha="PopoverClose",Op=c.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=De(Ha,n);return p.jsx(_.button,{type:"button",...o,ref:t,onClick:E(e.onClick,()=>r.onOpenChange(!1))})});Op.displayName=Ha;var kp="PopoverArrow",Lp=c.forwardRef((e,t)=>{const{__scopePopover:n,...o}=e,r=St(n);return p.jsx(nn,{...r,...o,ref:t})});Lp.displayName=kp;function Ua(e){return e?"open":"closed"}var wm=La,ym=$a,bm=Ba,Cm=Va,jp="Label",Ka=c.forwardRef((e,t)=>p.jsx(_.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())}}));Ka.displayName=jp;var Sm=Ka,wo="Progress",yo=100,[Fp]=q(wo),[$p,Bp]=Fp(wo),Ga=c.forwardRef((e,t)=>{const{__scopeProgress:n,value:o=null,max:r,getValueLabel:s=Vp,...a}=e;(r||r===0)&&!er(r)&&console.error(Wp(`${r}`,"Progress"));const i=er(r)?r:yo;o!==null&&!tr(o,i)&&console.error(Hp(`${o}`,"Progress"));const l=tr(o,i)?o:null,u=Ut(l)?s(l,i):void 0;return p.jsx($p,{scope:n,value:l,max:i,children:p.jsx(_.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Ut(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":Xa(l,i),"data-value":l??void 0,"data-max":i,...a,ref:t})})});Ga.displayName=wo;var za="ProgressIndicator",Ya=c.forwardRef((e,t)=>{const{__scopeProgress:n,...o}=e,r=Bp(za,n);return p.jsx(_.div,{"data-state":Xa(r.value,r.max),"data-value":r.value??void 0,"data-max":r.max,...o,ref:t})});Ya.displayName=za;function Vp(e,t){return`${Math.round(e/t*100)}%`}function Xa(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Ut(e){return typeof e=="number"}function er(e){return Ut(e)&&!isNaN(e)&&e>0}function tr(e,t){return Ut(e)&&!isNaN(e)&&e<=t&&e>=0}function Wp(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${yo}\`.`}function Hp(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${yo} if no \`max\` prop is set)
  - \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`}var Rm=Ga,Em=Ya,vn="Tabs",[Up]=q(vn,[tt]),qa=tt(),[Kp,bo]=Up(vn),Za=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,onValueChange:r,defaultValue:s,orientation:a="horizontal",dir:i,activationMode:l="automatic",...u}=e,f=qe(i),[d,v]=ie({prop:o,onChange:r,defaultProp:s??"",caller:vn});return p.jsx(Kp,{scope:n,baseId:se(),value:d,onValueChange:v,orientation:a,dir:f,activationMode:l,children:p.jsx(_.div,{dir:f,"data-orientation":a,...u,ref:t})})});Za.displayName=vn;var Qa="TabsList",Ja=c.forwardRef((e,t)=>{const{__scopeTabs:n,loop:o=!0,...r}=e,s=bo(Qa,n),a=qa(n);return p.jsx(ro,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:p.jsx(_.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:t})})});Ja.displayName=Qa;var ei="TabsTrigger",ti=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,disabled:r=!1,...s}=e,a=bo(ei,n),i=qa(n),l=ri(a.baseId,o),u=si(a.baseId,o),f=o===a.value;return p.jsx(so,{asChild:!0,...i,focusable:!r,active:f,children:p.jsx(_.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...s,ref:t,onMouseDown:E(e.onMouseDown,d=>{!r&&d.button===0&&d.ctrlKey===!1?a.onValueChange(o):d.preventDefault()}),onKeyDown:E(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(o)}),onFocus:E(e.onFocus,()=>{const d=a.activationMode!=="manual";!f&&!r&&d&&a.onValueChange(o)})})})});ti.displayName=ei;var ni="TabsContent",oi=c.forwardRef((e,t)=>{const{__scopeTabs:n,value:o,forceMount:r,children:s,...a}=e,i=bo(ni,n),l=ri(i.baseId,o),u=si(i.baseId,o),f=o===i.value,d=c.useRef(f);return c.useEffect(()=>{const v=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(v)},[]),p.jsx(Z,{present:r||f,children:({present:v})=>p.jsx(_.div,{"data-state":f?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":l,hidden:!v,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:v&&s})})});oi.displayName=ni;function ri(e,t){return`${e}-trigger-${t}`}function si(e,t){return`${e}-content-${t}`}var Pm=Za,Am=Ja,_m=ti,Tm=oi,mn="Checkbox",[Gp]=q(mn),[zp,Co]=Gp(mn);function Yp(e){const{__scopeCheckbox:t,checked:n,children:o,defaultChecked:r,disabled:s,form:a,name:i,onCheckedChange:l,required:u,value:f="on",internal_do_not_use_render:d}=e,[v,h]=ie({prop:n,defaultProp:r??!1,onChange:l,caller:mn}),[x,m]=c.useState(null),[g,w]=c.useState(null),y=c.useRef(!1),b=x?!!a||!!x.closest("form"):!0,C={checked:v,disabled:s,setChecked:h,control:x,setControl:m,name:i,form:a,value:f,hasConsumerStoppedPropagationRef:y,required:u,defaultChecked:Ee(r)?!1:r,isFormControl:b,bubbleInput:g,setBubbleInput:w};return p.jsx(zp,{scope:t,...C,children:Zp(d)?d(C):o})}var ai="CheckboxTrigger",ii=c.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...o},r)=>{const{control:s,value:a,disabled:i,checked:l,required:u,setControl:f,setChecked:d,hasConsumerStoppedPropagationRef:v,isFormControl:h,bubbleInput:x}=Co(ai,e),m=O(r,f),g=c.useRef(l);return c.useEffect(()=>{const w=s==null?void 0:s.form;if(w){const y=()=>d(g.current);return w.addEventListener("reset",y),()=>w.removeEventListener("reset",y)}},[s,d]),p.jsx(_.button,{type:"button",role:"checkbox","aria-checked":Ee(l)?"mixed":l,"aria-required":u,"data-state":di(l),"data-disabled":i?"":void 0,disabled:i,value:a,...o,ref:m,onKeyDown:E(t,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:E(n,w=>{d(y=>Ee(y)?!0:!y),x&&h&&(v.current=w.isPropagationStopped(),v.current||w.stopPropagation())})})});ii.displayName=ai;var Xp=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:o,checked:r,defaultChecked:s,required:a,disabled:i,value:l,onCheckedChange:u,form:f,...d}=e;return p.jsx(Yp,{__scopeCheckbox:n,checked:r,defaultChecked:s,disabled:i,required:a,onCheckedChange:u,name:o,form:f,value:l,internal_do_not_use_render:({isFormControl:v})=>p.jsxs(p.Fragment,{children:[p.jsx(ii,{...d,ref:t,__scopeCheckbox:n}),v&&p.jsx(ui,{__scopeCheckbox:n})]})})});Xp.displayName=mn;var ci="CheckboxIndicator",qp=c.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:o,...r}=e,s=Co(ci,n);return p.jsx(Z,{present:o||Ee(s.checked)||s.checked===!0,children:p.jsx(_.span,{"data-state":di(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});qp.displayName=ci;var li="CheckboxBubbleInput",ui=c.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:o,hasConsumerStoppedPropagationRef:r,checked:s,defaultChecked:a,required:i,disabled:l,name:u,value:f,form:d,bubbleInput:v,setBubbleInput:h}=Co(li,e),x=O(n,h),m=Ct(s),g=ht(o);c.useEffect(()=>{const y=v;if(!y)return;const b=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(b,"checked").set,A=!r.current;if(m!==s&&S){const R=new Event("click",{bubbles:A});y.indeterminate=Ee(s),S.call(y,Ee(s)?!1:s),y.dispatchEvent(R)}},[v,m,s,r]);const w=c.useRef(Ee(s)?!1:s);return p.jsx(_.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??w.current,required:i,disabled:l,name:u,value:f,form:d,...t,tabIndex:-1,ref:x,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ui.displayName=li;function Zp(e){return typeof e=="function"}function Ee(e){return e==="indeterminate"}function di(e){return Ee(e)?"indeterminate":e?"checked":"unchecked"}var[hn]=q("Tooltip",[Te]),gn=Te(),fi="TooltipProvider",Qp=700,Un="tooltip.open",[Jp,So]=hn(fi),pi=e=>{const{__scopeTooltip:t,delayDuration:n=Qp,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 u=l.current;return()=>window.clearTimeout(u)},[]),p.jsx(Jp,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:c.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:c.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,o)},[o]),isPointerInTransitRef:i,onPointerInTransitChange:c.useCallback(u=>{i.current=u},[]),disableHoverableContent:r,children:s})};pi.displayName=fi;var pt="Tooltip",[ev,Rt]=hn(pt),vi=e=>{const{__scopeTooltip:t,children:n,open:o,defaultOpen:r,onOpenChange:s,disableHoverableContent:a,delayDuration:i}=e,l=So(pt,e.__scopeTooltip),u=gn(t),[f,d]=c.useState(null),v=se(),h=c.useRef(0),x=a??l.disableHoverableContent,m=i??l.delayDuration,g=c.useRef(!1),[w,y]=ie({prop:o,defaultProp:r??!1,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(Un))):l.onClose(),s==null||s(R)},caller:pt}),b=c.useMemo(()=>w?g.current?"delayed-open":"instant-open":"closed",[w]),C=c.useCallback(()=>{window.clearTimeout(h.current),h.current=0,g.current=!1,y(!0)},[y]),S=c.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y(!1)},[y]),A=c.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{g.current=!0,y(!0),h.current=0},m)},[m,y]);return c.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),p.jsx(en,{...u,children:p.jsx(ev,{scope:t,contentId:v,open:w,stateAttribute:b,trigger:f,onTriggerChange:d,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayedRef.current?A():C()},[l.isOpenDelayedRef,A,C]),onTriggerLeave:c.useCallback(()=>{x?S():(window.clearTimeout(h.current),h.current=0)},[S,x]),onOpen:C,onClose:S,disableHoverableContent:x,children:n})})};vi.displayName=pt;var Kn="TooltipTrigger",mi=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=Rt(Kn,n),s=So(Kn,n),a=gn(n),i=c.useRef(null),l=O(t,i,r.onTriggerChange),u=c.useRef(!1),f=c.useRef(!1),d=c.useCallback(()=>u.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),p.jsx(gt,{asChild:!0,...a,children:p.jsx(_.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...o,ref:l,onPointerMove:E(e.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:E(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:E(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:E(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:E(e.onBlur,r.onClose),onClick:E(e.onClick,r.onClose)})})});mi.displayName=Kn;var Ro="TooltipPortal",[tv,nv]=hn(Ro,{forceMount:void 0}),hi=e=>{const{__scopeTooltip:t,forceMount:n,children:o,container:r}=e,s=Rt(Ro,t);return p.jsx(tv,{scope:t,forceMount:n,children:p.jsx(Z,{present:n||s.open,children:p.jsx(et,{asChild:!0,container:r,children:o})})})};hi.displayName=Ro;var Xe="TooltipContent",gi=c.forwardRef((e,t)=>{const n=nv(Xe,e.__scopeTooltip),{forceMount:o=n.forceMount,side:r="top",...s}=e,a=Rt(Xe,e.__scopeTooltip);return p.jsx(Z,{present:o||a.open,children:a.disableHoverableContent?p.jsx(xi,{side:r,...s,ref:t}):p.jsx(ov,{side:r,...s,ref:t})})}),ov=c.forwardRef((e,t)=>{const n=Rt(Xe,e.__scopeTooltip),o=So(Xe,e.__scopeTooltip),r=c.useRef(null),s=O(t,r),[a,i]=c.useState(null),{trigger:l,onClose:u}=n,f=r.current,{onPointerInTransitChange:d}=o,v=c.useCallback(()=>{i(null),d(!1)},[d]),h=c.useCallback((x,m)=>{const g=x.currentTarget,w={x:x.clientX,y:x.clientY},y=iv(w,g.getBoundingClientRect()),b=cv(w,y),C=lv(m.getBoundingClientRect()),S=dv([...b,...C]);i(S),d(!0)},[d]);return c.useEffect(()=>()=>v(),[v]),c.useEffect(()=>{if(l&&f){const x=g=>h(g,f),m=g=>h(g,l);return l.addEventListener("pointerleave",x),f.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",x),f.removeEventListener("pointerleave",m)}}},[l,f,h,v]),c.useEffect(()=>{if(a){const x=m=>{const g=m.target,w={x:m.clientX,y:m.clientY},y=(l==null?void 0:l.contains(g))||(f==null?void 0:f.contains(g)),b=!uv(w,a);y?v():b&&(v(),u())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,f,a,u,v]),p.jsx(xi,{...e,ref:s})}),[rv,sv]=hn(pt,{isInside:!1}),av=ar("TooltipContent"),xi=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:o,"aria-label":r,onEscapeKeyDown:s,onPointerDownOutside:a,...i}=e,l=Rt(Xe,n),u=gn(n),{onClose:f}=l;return c.useEffect(()=>(document.addEventListener(Un,f),()=>document.removeEventListener(Un,f)),[f]),c.useEffect(()=>{if(l.trigger){const d=v=>{const h=v.target;h!=null&&h.contains(l.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,f]),p.jsx(Ze,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:p.jsxs(tn,{"data-state":l.stateAttribute,...u,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(av,{children:o}),p.jsx(rv,{scope:n,isInside:!0,children:p.jsx(ep,{id:l.contentId,role:"tooltip",children:r||o})})]})})});gi.displayName=Xe;var wi="TooltipArrow",yi=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...o}=e,r=gn(n);return sv(wi,n).isInside?null:p.jsx(nn,{...r,...o,ref:t})});yi.displayName=wi;function iv(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 cv(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 lv(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 uv(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],u=i.x,f=i.y,d=l.x,v=l.y;f>o!=v>o&&n<(d-u)*(o-f)/(v-f)+u&&(r=!r)}return r}function dv(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),fv(t)}function fv(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 Mm=pi,Im=vi,Dm=mi,Nm=hi,Om=gi,km=yi,Eo="Radio",[pv,bi]=q(Eo),[vv,mv]=pv(Eo),Ci=c.forwardRef((e,t)=>{const{__scopeRadio:n,name:o,checked:r=!1,required:s,disabled:a,value:i="on",onCheck:l,form:u,...f}=e,[d,v]=c.useState(null),h=O(t,g=>v(g)),x=c.useRef(!1),m=d?u||!!d.closest("form"):!0;return p.jsxs(vv,{scope:n,checked:r,disabled:a,children:[p.jsx(_.button,{type:"button",role:"radio","aria-checked":r,"data-state":Pi(r),"data-disabled":a?"":void 0,disabled:a,value:i,...f,ref:h,onClick:E(e.onClick,g=>{r||l==null||l(),m&&(x.current=g.isPropagationStopped(),x.current||g.stopPropagation())})}),m&&p.jsx(Ei,{control:d,bubbles:!x.current,name:o,value:i,checked:r,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});Ci.displayName=Eo;var Si="RadioIndicator",Ri=c.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:o,...r}=e,s=mv(Si,n);return p.jsx(Z,{present:o||s.checked,children:p.jsx(_.span,{"data-state":Pi(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})})});Ri.displayName=Si;var hv="RadioBubbleInput",Ei=c.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:o=!0,...r},s)=>{const a=c.useRef(null),i=O(a,s),l=Ct(n),u=ht(t);return c.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&h){const x=new Event("click",{bubbles:o});h.call(f,n),f.dispatchEvent(x)}},[l,n,o]),p.jsx(_.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:i,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Ei.displayName=hv;function Pi(e){return e?"checked":"unchecked"}var gv=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],xn="RadioGroup",[xv]=q(xn,[tt,bi]),Ai=tt(),_i=bi(),[wv,yv]=xv(xn),Ti=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:o,defaultValue:r,value:s,required:a=!1,disabled:i=!1,orientation:l,dir:u,loop:f=!0,onValueChange:d,...v}=e,h=Ai(n),x=qe(u),[m,g]=ie({prop:s,defaultProp:r??null,onChange:d,caller:xn});return p.jsx(wv,{scope:n,name:o,required:a,disabled:i,value:m,onValueChange:g,children:p.jsx(ro,{asChild:!0,...h,orientation:l,dir:x,loop:f,children:p.jsx(_.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":i?"":void 0,dir:x,...v,ref:t})})})});Ti.displayName=xn;var Mi="RadioGroupItem",Ii=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:o,...r}=e,s=yv(Mi,n),a=s.disabled||o,i=Ai(n),l=_i(n),u=c.useRef(null),f=O(t,u),d=s.value===r.value,v=c.useRef(!1);return c.useEffect(()=>{const h=m=>{gv.includes(m.key)&&(v.current=!0)},x=()=>v.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",x)}},[]),p.jsx(so,{asChild:!0,...i,focusable:!a,active:d,children:p.jsx(Ci,{disabled:a,required:s.required,checked:d,...l,...r,name:s.name,ref:f,onCheck:()=>s.onValueChange(r.value),onKeyDown:E(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:E(r.onFocus,()=>{var h;v.current&&((h=u.current)==null||h.click())})})})});Ii.displayName=Mi;var bv="RadioGroupIndicator",Di=c.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...o}=e,r=_i(n);return p.jsx(Ri,{...r,...o,ref:t})});Di.displayName=bv;var Lm=Ti,jm=Ii,Fm=Di,wn="Switch",[Cv]=q(wn),[Sv,Rv]=Cv(wn),Ni=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:o,checked:r,defaultChecked:s,required:a,disabled:i,value:l="on",onCheckedChange:u,form:f,...d}=e,[v,h]=c.useState(null),x=O(t,b=>h(b)),m=c.useRef(!1),g=v?f||!!v.closest("form"):!0,[w,y]=ie({prop:r,defaultProp:s??!1,onChange:u,caller:wn});return p.jsxs(Sv,{scope:n,checked:w,disabled:i,children:[p.jsx(_.button,{type:"button",role:"switch","aria-checked":w,"aria-required":a,"data-state":ji(w),"data-disabled":i?"":void 0,disabled:i,value:l,...d,ref:x,onClick:E(e.onClick,b=>{y(C=>!C),g&&(m.current=b.isPropagationStopped(),m.current||b.stopPropagation())})}),g&&p.jsx(Li,{control:v,bubbles:!m.current,name:o,value:l,checked:w,required:a,disabled:i,form:f,style:{transform:"translateX(-100%)"}})]})});Ni.displayName=wn;var Oi="SwitchThumb",ki=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...o}=e,r=Rv(Oi,n);return p.jsx(_.span,{"data-state":ji(r.checked),"data-disabled":r.disabled?"":void 0,...o,ref:t})});ki.displayName=Oi;var Ev="SwitchBubbleInput",Li=c.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:o=!0,...r},s)=>{const a=c.useRef(null),i=O(a,s),l=Ct(n),u=ht(t);return c.useEffect(()=>{const f=a.current;if(!f)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(l!==n&&h){const x=new Event("click",{bubbles:o});h.call(f,n),f.dispatchEvent(x)}},[l,n,o]),p.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...r,tabIndex:-1,ref:i,style:{...r.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Li.displayName=Ev;function ji(e){return e?"checked":"unchecked"}var $m=Ni,Bm=ki,Fi=["PageUp","PageDown"],$i=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Bi={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ot="Slider",[Gn,Pv,Av]=Yt(ot),[Vi]=q(ot,[Av]),[_v,yn]=Vi(ot),Wi=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:u=[o],value:f,onValueChange:d=()=>{},onValueCommit:v=()=>{},inverted:h=!1,form:x,...m}=e,g=c.useRef(new Set),w=c.useRef(0),b=a==="horizontal"?Tv:Mv,[C=[],S]=ie({prop:f,defaultProp:u,onChange:N=>{var L;(L=[...g.current][w.current])==null||L.focus(),d(N)}}),A=c.useRef(C);function R(N){const j=kv(C,N);k(N,j)}function M(N){k(N,w.current)}function B(){const N=A.current[w.current];C[w.current]!==N&&v(C)}function k(N,j,{commit:L}={commit:!1}){const F=$v(s),V=Bv(Math.round((N-o)/s)*s+o,F),D=Wt(V,[o,r]);S(($=[])=>{const T=Nv($,D,j);if(Fv(T,l*s)){w.current=T.indexOf(D);const P=String(T)!==String($);return P&&L&&v(T),P?T:$}else return $})}return p.jsx(_v,{scope:e.__scopeSlider,name:n,disabled:i,min:o,max:r,valueIndexToChangeRef:w,thumbs:g.current,values:C,orientation:a,form:x,children:p.jsx(Gn.Provider,{scope:e.__scopeSlider,children:p.jsx(Gn.Slot,{scope:e.__scopeSlider,children:p.jsx(b,{"aria-disabled":i,"data-disabled":i?"":void 0,...m,ref:t,onPointerDown:E(m.onPointerDown,()=>{i||(A.current=C)}),min:o,max:r,inverted:h,onSlideStart:i?void 0:R,onSlideMove:i?void 0:M,onSlideEnd:i?void 0:B,onHomeKeyDown:()=>!i&&k(o,0,{commit:!0}),onEndKeyDown:()=>!i&&k(r,C.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:j})=>{if(!i){const V=Fi.includes(N.key)||N.shiftKey&&$i.includes(N.key)?10:1,D=w.current,$=C[D],T=s*V*j;k($+T,D,{commit:!0})}}})})})})});Wi.displayName=ot;var[Hi,Ui]=Vi(ot,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Tv=c.forwardRef((e,t)=>{const{min:n,max:o,dir:r,inverted:s,onSlideStart:a,onSlideMove:i,onSlideEnd:l,onStepKeyDown:u,...f}=e,[d,v]=c.useState(null),h=O(t,b=>v(b)),x=c.useRef(void 0),m=qe(r),g=m==="ltr",w=g&&!s||!g&&s;function y(b){const C=x.current||d.getBoundingClientRect(),S=[0,C.width],R=Po(S,w?[n,o]:[o,n]);return x.current=C,R(b-C.left)}return p.jsx(Hi,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:p.jsx(Ki,{dir:m,"data-orientation":"horizontal",...f,ref:h,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const C=y(b.clientX);a==null||a(C)},onSlideMove:b=>{const C=y(b.clientX);i==null||i(C)},onSlideEnd:()=>{x.current=void 0,l==null||l()},onStepKeyDown:b=>{const S=Bi[w?"from-left":"from-right"].includes(b.key);u==null||u({event:b,direction:S?-1:1})}})})}),Mv=c.forwardRef((e,t)=>{const{min:n,max:o,inverted:r,onSlideStart:s,onSlideMove:a,onSlideEnd:i,onStepKeyDown:l,...u}=e,f=c.useRef(null),d=O(t,f),v=c.useRef(void 0),h=!r;function x(m){const g=v.current||f.current.getBoundingClientRect(),w=[0,g.height],b=Po(w,h?[o,n]:[n,o]);return v.current=g,b(m-g.top)}return p.jsx(Hi,{scope:e.__scopeSlider,startEdge:h?"bottom":"top",endEdge:h?"top":"bottom",size:"height",direction:h?1:-1,children:p.jsx(Ki,{"data-orientation":"vertical",...u,ref:d,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const g=x(m.clientY);s==null||s(g)},onSlideMove:m=>{const g=x(m.clientY);a==null||a(g)},onSlideEnd:()=>{v.current=void 0,i==null||i()},onStepKeyDown:m=>{const w=Bi[h?"from-bottom":"from-top"].includes(m.key);l==null||l({event:m,direction:w?-1:1})}})})}),Ki=c.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:r,onSlideEnd:s,onHomeKeyDown:a,onEndKeyDown:i,onStepKeyDown:l,...u}=e,f=yn(ot,n);return p.jsx(_.span,{...u,ref:t,onKeyDown:E(e.onKeyDown,d=>{d.key==="Home"?(a(d),d.preventDefault()):d.key==="End"?(i(d),d.preventDefault()):Fi.concat($i).includes(d.key)&&(l(d),d.preventDefault())}),onPointerDown:E(e.onPointerDown,d=>{const v=d.target;v.setPointerCapture(d.pointerId),d.preventDefault(),f.thumbs.has(v)?v.focus():o(d)}),onPointerMove:E(e.onPointerMove,d=>{d.target.hasPointerCapture(d.pointerId)&&r(d)}),onPointerUp:E(e.onPointerUp,d=>{const v=d.target;v.hasPointerCapture(d.pointerId)&&(v.releasePointerCapture(d.pointerId),s(d))})})}),Gi="SliderTrack",zi=c.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=yn(Gi,n);return p.jsx(_.span,{"data-disabled":r.disabled?"":void 0,"data-orientation":r.orientation,...o,ref:t})});zi.displayName=Gi;var zn="SliderRange",Yi=c.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,r=yn(zn,n),s=Ui(zn,n),a=c.useRef(null),i=O(t,a),l=r.values.length,u=r.values.map(v=>Zi(v,r.min,r.max)),f=l>1?Math.min(...u):0,d=100-Math.max(...u);return p.jsx(_.span,{"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,...o,ref:i,style:{...e.style,[s.startEdge]:f+"%",[s.endEdge]:d+"%"}})});Yi.displayName=zn;var Yn="SliderThumb",Xi=c.forwardRef((e,t)=>{const n=Pv(e.__scopeSlider),[o,r]=c.useState(null),s=O(t,i=>r(i)),a=c.useMemo(()=>o?n().findIndex(i=>i.ref.current===o):-1,[n,o]);return p.jsx(Iv,{...e,ref:s,index:a})}),Iv=c.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:r,...s}=e,a=yn(Yn,n),i=Ui(Yn,n),[l,u]=c.useState(null),f=O(t,y=>u(y)),d=l?a.form||!!l.closest("form"):!0,v=ht(l),h=a.values[o],x=h===void 0?0:Zi(h,a.min,a.max),m=Ov(o,a.values.length),g=v==null?void 0:v[i.size],w=g?Lv(g,x,i.direction):0;return c.useEffect(()=>{if(l)return a.thumbs.add(l),()=>{a.thumbs.delete(l)}},[l,a.thumbs]),p.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[i.startEdge]:`calc(${x}% + ${w}px)`},children:[p.jsx(Gn.ItemSlot,{scope:e.__scopeSlider,children:p.jsx(_.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":a.min,"aria-valuenow":h,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...s,ref:f,style:h===void 0?{display:"none"}:e.style,onFocus:E(e.onFocus,()=>{a.valueIndexToChangeRef.current=o})})}),d&&p.jsx(qi,{name:r??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:h},o)]})});Xi.displayName=Yn;var Dv="RadioBubbleInput",qi=c.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const r=c.useRef(null),s=O(r,o),a=Ct(t);return c.useEffect(()=>{const i=r.current;if(!i)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==t&&f){const d=new Event("input",{bubbles:!0});f.call(i,t),i.dispatchEvent(d)}},[a,t]),p.jsx(_.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});qi.displayName=Dv;function Nv(e=[],t,n){const o=[...e];return o[n]=t,o.sort((r,s)=>r-s)}function Zi(e,t,n){const s=100/(n-t)*(e-t);return Wt(s,[0,100])}function Ov(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function kv(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 Lv(e,t,n){const o=e/2,s=Po([0,50],[0,o]);return(o-s(t)*n)*n}function jv(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Fv(e,t){if(t>0){const n=jv(e);return Math.min(...n)>=t}return!0}function Po(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 $v(e){return(String(e).split(".")[1]||"").length}function Bv(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Vm=Wi,Wm=zi,Hm=Yi,Um=Xi;export{Dm as $,nm as A,Em as B,qv as C,sm as D,Pm as E,Kv as F,_m as G,Tm as H,Uv as I,$f as J,Bf as K,Am as L,zs as M,Vf as N,em as O,Xv as P,Wf as Q,Hv as R,Wv as S,Yv as T,Ff as U,cm as V,Lf as W,Xp as X,qp as Y,Mm as Z,Im as _,zv as a,Nm as a0,Om as a1,km as a2,Lm as a3,jm as a4,Fm as a5,$m as a6,Bm as a7,Vm as a8,Wm as a9,Hm as aa,Um as ab,Zv as b,tm as c,Jv as d,Qv as e,rm as f,om as g,am as h,im as i,p as j,lm as k,um as l,dm as m,fm as n,pm as o,mm as p,vm as q,hm as r,gm as s,xm as t,wm as u,ym as v,bm as w,Cm as x,Sm as y,Rm as z};
//# sourceMappingURL=radix-vendor-BP4rDxsU.js.map
