import{bG as _n,j as x,bH as z,bI as ct,bJ as Y,bK as Je,bL as _t,bM as oe,bN as vt,bO as lt,bP as F,bQ as Mn,bR as Dn,bS as Ln,bT as jn,bU as kn,bV as Hn,n as J}from"./index-BB3C6ia3.js";import{b as u,R as ge,d as at}from"./vendor-q1sfVHxQ.js";import{I as Mt}from"./IconChevronDown-K0V3QdSs.js";import{u as Bn,a as Vn}from"./index-Bm2nI4FA.js";/** * @license lucide-react v0.577.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $n=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Wn=_n("check",$n);var Dt=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"}),Fn="VisuallyHidden",zn=u.forwardRef((e,t)=>x.jsx(z.span,{...e,ref:t,style:{...Dt,...e.style}}));zn.displayName=Fn;function Un(e){const t=e+"CollectionProvider",[n,o]=ct(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:v,children:y}=f,g=ge.useRef(null),S=ge.useRef(new Map).current;return x.jsx(r,{scope:v,itemMap:S,collectionRef:g,children:y})};s.displayName=t;const c=e+"CollectionSlot",l=Je(c),a=ge.forwardRef((f,v)=>{const{scope:y,children:g}=f,S=i(c,y),b=Y(v,S.collectionRef);return x.jsx(l,{ref:b,children:g})});a.displayName=c;const d=e+"CollectionItemSlot",p="data-radix-collection-item",w=Je(d),m=ge.forwardRef((f,v)=>{const{scope:y,children:g,...S}=f,b=ge.useRef(null),C=Y(v,b),A=i(d,y);return ge.useEffect(()=>(A.itemMap.set(b,{ref:b,...S}),()=>void A.itemMap.delete(b))),x.jsx(w,{[p]:"",ref:C,children:g})});m.displayName=d;function h(f){const v=i(e+"CollectionConsumer",f);return ge.useCallback(()=>{const g=v.collectionRef.current;if(!g)return[];const S=Array.from(g.querySelectorAll(`[${p}]`));return Array.from(v.itemMap.values()).sort((A,T)=>S.indexOf(A.ref.current)-S.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:a,ItemSlot:m},h,o]}var Kn=u.createContext(void 0);function Yn(e){const t=u.useContext(Kn);return e||t||"ltr"}const Xn=["top","right","bottom","left"],ae=Math.min,X=Math.max,De=Math.round,_e=Math.floor,ne=e=>({x:e,y:e}),Gn={left:"right",right:"left",bottom:"top",top:"bottom"};function Qe(e,t,n){return X(e,ae(t,n))}function se(e,t){return typeof e=="function"?e(t):e}function ie(e){return e.split("-")[0]}function Re(e){return e.split("-")[1]}function dt(e){return e==="x"?"y":"x"}function ft(e){return e==="y"?"height":"width"}function te(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ut(e){return dt(te(e))}function qn(e,t,n){n===void 0&&(n=!1);const o=Re(e),r=ut(e),i=ft(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Le(s)),[s,Le(s)]}function Zn(e){const t=Le(e);return[et(e),t,et(t)]}function et(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const yt=["left","right"],St=["right","left"],Jn=["top","bottom"],Qn=["bottom","top"];function eo(e,t,n){switch(e){case"top":case"bottom":return n?t?St:yt:t?yt:St;case"left":case"right":return t?Jn:Qn;default:return[]}}function to(e,t,n,o){const r=Re(e);let i=eo(ie(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(et)))),i}function Le(e){const t=ie(e);return Gn[t]+e.slice(t.length)}function no(e){return{top:0,right:0,bottom:0,left:0,...e}}function Lt(e){return typeof e!="number"?no(e):{top:e,right:e,bottom:e,left:e}}function je(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 bt(e,t,n){let{reference:o,floating:r}=e;const i=te(t),s=ut(t),c=ft(s),l=ie(t),a=i==="y",d=o.x+o.width/2-r.width/2,p=o.y+o.height/2-r.height/2,w=o[c]/2-r[c]/2;let m;switch(l){case"top":m={x:d,y:o.y-r.height};break;case"bottom":m={x:d,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:p};break;case"left":m={x:o.x-r.width,y:p};break;default:m={x:o.x,y:o.y}}switch(Re(t)){case"start":m[s]-=w*(n&&a?-1:1);break;case"end":m[s]+=w*(n&&a?-1:1);break}return m}async function oo(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:w=!1,padding:m=0}=se(t,e),h=Lt(m),v=c[w?p==="floating"?"reference":"floating":p],y=je(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:d,strategy:l})),g=p==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),b=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},C=je(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:S,strategy:l}):g);return{top:(y.top-C.top+h.top)/b.y,bottom:(C.bottom-y.bottom+h.bottom)/b.y,left:(y.left-C.left+h.left)/b.x,right:(C.right-y.right+h.right)/b.x}}const ro=50,so=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=s.detectOverflow?s:{...s,detectOverflow:oo},l=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:p}=bt(a,o,l),w=o,m=0;const h={};for(let f=0;f({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:s,elements:c,middlewareData:l}=t,{element:a,padding:d=0}=se(e,t)||{};if(a==null)return{};const p=Lt(d),w={x:n,y:o},m=ut(r),h=ft(m),f=await s.getDimensions(a),v=m==="y",y=v?"top":"left",g=v?"bottom":"right",S=v?"clientHeight":"clientWidth",b=i.reference[h]+i.reference[m]-w[m]-i.floating[h],C=w[m]-i.reference[m],A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let T=A?A[S]:0;(!T||!await(s.isElement==null?void 0:s.isElement(A)))&&(T=c.floating[S]||i.floating[h]);const N=b/2-C/2,B=T/2-f[h]/2-1,M=ae(p[y],B),D=ae(p[g],B),L=M,_=T-f[h]-D,O=T/2-f[h]/2+N,V=Qe(L,O,_),E=!l.arrow&&Re(r)!=null&&O!==V&&i.reference[h]/2-(OO<=0)){var D,L;const O=(((D=i.flip)==null?void 0:D.index)||0)+1,V=T[O];if(V&&(!(p==="alignment"?g!==te(V):!1)||M.every(P=>te(P.placement)===g?P.overflows[0]>0:!0)))return{data:{index:O,overflows:M},reset:{placement:V}};let E=(L=M.filter(I=>I.overflows[0]<=0).sort((I,P)=>I.overflows[1]-P.overflows[1])[0])==null?void 0:L.placement;if(!E)switch(m){case"bestFit":{var _;const I=(_=M.filter(P=>{if(A){const j=te(P.placement);return j===g||j==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(j=>j>0).reduce((j,K)=>j+K,0)]).sort((P,j)=>P[1]-j[1])[0])==null?void 0:_[0];I&&(E=I);break}case"initialPlacement":E=c;break}if(r!==E)return{reset:{placement:E}}}return{}}}};function Ct(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Rt(e){return Xn.some(t=>e[t]>=0)}const lo=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...i}=se(e,t);switch(r){case"referenceHidden":{const s=await o.detectOverflow(t,{...i,elementContext:"reference"}),c=Ct(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:Rt(c)}}}case"escaped":{const s=await o.detectOverflow(t,{...i,altBoundary:!0}),c=Ct(s,n.floating);return{data:{escapedOffsets:c,escaped:Rt(c)}}}default:return{}}}}},jt=new Set(["left","top"]);async function ao(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=ie(n),c=Re(n),l=te(n)==="y",a=jt.has(s)?-1:1,d=i&&l?-1:1,p=se(t,e);let{mainAxis:w,crossAxis:m,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof h=="number"&&(m=c==="end"?h*-1:h),l?{x:m*d,y:w*a}:{x:w*a,y:m*d}}const fo=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=t,l=await ao(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},uo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:l={fn:y=>{let{x:g,y:S}=y;return{x:g,y:S}}},...a}=se(e,t),d={x:n,y:o},p=await i.detectOverflow(t,a),w=te(ie(r)),m=dt(w);let h=d[m],f=d[w];if(s){const y=m==="y"?"top":"left",g=m==="y"?"bottom":"right",S=h+p[y],b=h-p[g];h=Qe(S,h,b)}if(c){const y=w==="y"?"top":"left",g=w==="y"?"bottom":"right",S=f+p[y],b=f-p[g];f=Qe(S,f,b)}const v=l.fn({...t,[m]:h,[w]:f});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[m]:s,[w]:c}}}}}},po=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:l=!0,crossAxis:a=!0}=se(e,t),d={x:n,y:o},p=te(r),w=dt(p);let m=d[w],h=d[p];const f=se(c,t),v=typeof f=="number"?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(l){const S=w==="y"?"height":"width",b=i.reference[w]-i.floating[S]+v.mainAxis,C=i.reference[w]+i.reference[S]-v.mainAxis;mC&&(m=C)}if(a){var y,g;const S=w==="y"?"width":"height",b=jt.has(ie(r)),C=i.reference[p]-i.floating[S]+(b&&((y=s.offset)==null?void 0:y[p])||0)+(b?0:v.crossAxis),A=i.reference[p]+i.reference[S]+(b?0:((g=s.offset)==null?void 0:g[p])||0)-(b?v.crossAxis:0);hA&&(h=A)}return{[w]:m,[p]:h}}}},mo=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:s,elements:c}=t,{apply:l=()=>{},...a}=se(e,t),d=await s.detectOverflow(t,a),p=ie(r),w=Re(r),m=te(r)==="y",{width:h,height:f}=i.floating;let v,y;p==="top"||p==="bottom"?(v=p,y=w===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(y=p,v=w==="end"?"top":"bottom");const g=f-d.top-d.bottom,S=h-d.left-d.right,b=ae(f-d[v],g),C=ae(h-d[y],S),A=!t.middlewareData.shift;let T=b,N=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=S),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(T=g),A&&!w){const M=X(d.left,0),D=X(d.right,0),L=X(d.top,0),_=X(d.bottom,0);m?N=h-2*(M!==0||D!==0?M+D:X(d.left,d.right)):T=f-2*(L!==0||_!==0?L+_:X(d.top,d.bottom))}await l({...t,availableWidth:N,availableHeight:T});const B=await s.getDimensions(c.floating);return h!==B.width||f!==B.height?{reset:{rects:!0}}:{}}}};function Be(){return typeof window<"u"}function Pe(e){return kt(e)?(e.nodeName||"").toLowerCase():"#document"}function G(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function re(e){var t;return(t=(kt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kt(e){return Be()?e instanceof Node||e instanceof G(e).Node:!1}function Q(e){return Be()?e instanceof Element||e instanceof G(e).Element:!1}function ce(e){return Be()?e instanceof HTMLElement||e instanceof G(e).HTMLElement:!1}function Pt(e){return!Be()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof G(e).ShadowRoot}function Ne(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function ho(e){return/^(table|td|th)$/.test(Pe(e))}function Ve(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const go=/transform|translate|scale|rotate|perspective|filter/,xo=/paint|layout|strict|content/,xe=e=>!!e&&e!=="none";let Ge;function pt(e){const t=Q(e)?ee(e):e;return xe(t.transform)||xe(t.translate)||xe(t.scale)||xe(t.rotate)||xe(t.perspective)||!mt()&&(xe(t.backdropFilter)||xe(t.filter))||go.test(t.willChange||"")||xo.test(t.contain||"")}function wo(e){let t=de(e);for(;ce(t)&&!Ce(t);){if(pt(t))return t;if(Ve(t))return null;t=de(t)}return null}function mt(){return Ge==null&&(Ge=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ge}function Ce(e){return/^(html|body|#document)$/.test(Pe(e))}function ee(e){return G(e).getComputedStyle(e)}function $e(e){return Q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function de(e){if(Pe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Pt(e)&&e.host||re(e);return Pt(t)?t.host:t}function Ht(e){const t=de(e);return Ce(t)?e.ownerDocument?e.ownerDocument.body:e.body:ce(t)&&Ne(t)?t:Ht(t)}function Ie(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Ht(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=G(r);if(i){const c=tt(s);return t.concat(s,s.visualViewport||[],Ne(r)?r:[],c&&n?Ie(c):[])}else return t.concat(r,Ie(r,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bt(e){const t=ee(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ce(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,c=De(n)!==i||De(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function ht(e){return Q(e)?e:e.contextElement}function be(e){const t=ht(e);if(!ce(t))return ne(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Bt(t);let s=(i?De(n.width):n.width)/o,c=(i?De(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const vo=ne(0);function Vt(e){const t=G(e);return!mt()||!t.visualViewport?vo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==G(e)?!1:t}function we(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=ht(e);let s=ne(1);t&&(o?Q(o)&&(s=be(o)):s=be(e));const c=yo(i,n,o)?Vt(i):ne(0);let l=(r.left+c.x)/s.x,a=(r.top+c.y)/s.y,d=r.width/s.x,p=r.height/s.y;if(i){const w=G(i),m=o&&Q(o)?G(o):o;let h=w,f=tt(h);for(;f&&o&&m!==h;){const v=be(f),y=f.getBoundingClientRect(),g=ee(f),S=y.left+(f.clientLeft+parseFloat(g.paddingLeft))*v.x,b=y.top+(f.clientTop+parseFloat(g.paddingTop))*v.y;l*=v.x,a*=v.y,d*=v.x,p*=v.y,l+=S,a+=b,h=G(f),f=tt(h)}}return je({width:d,height:p,x:l,y:a})}function We(e,t){const n=$e(e).scrollLeft;return t?t.left+n:we(re(e)).left+n}function $t(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-We(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function So(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=re(o),c=t?Ve(t.floating):!1;if(o===s||c&&i)return n;let l={scrollLeft:0,scrollTop:0},a=ne(1);const d=ne(0),p=ce(o);if((p||!p&&!i)&&((Pe(o)!=="body"||Ne(s))&&(l=$e(o)),p)){const m=we(o);a=be(o),d.x=m.x+o.clientLeft,d.y=m.y+o.clientTop}const w=s&&!p&&!i?$t(s,l):ne(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+d.x+w.x,y:n.y*a.y-l.scrollTop*a.y+d.y+w.y}}function bo(e){return Array.from(e.getClientRects())}function Co(e){const t=re(e),n=$e(e),o=e.ownerDocument.body,r=X(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=X(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+We(e);const c=-n.scrollTop;return ee(o).direction==="rtl"&&(s+=X(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}const At=25;function Ro(e,t){const n=G(e),o=re(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,l=0;if(r){i=r.width,s=r.height;const d=mt();(!d||d&&t==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}const a=We(o);if(a<=0){const d=o.ownerDocument,p=d.body,w=getComputedStyle(p),m=d.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,h=Math.abs(o.clientWidth-p.clientWidth-m);h<=At&&(i-=h)}else a<=At&&(i+=a);return{width:i,height:s,x:c,y:l}}function Po(e,t){const n=we(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ce(e)?be(e):ne(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,l=r*i.x,a=o*i.y;return{width:s,height:c,x:l,y:a}}function Tt(e,t,n){let o;if(t==="viewport")o=Ro(e,n);else if(t==="document")o=Co(re(e));else if(Q(t))o=Po(t,n);else{const r=Vt(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return je(o)}function Wt(e,t){const n=de(e);return n===t||!Q(n)||Ce(n)?!1:ee(n).position==="fixed"||Wt(n,t)}function Ao(e,t){const n=t.get(e);if(n)return n;let o=Ie(e,[],!1).filter(c=>Q(c)&&Pe(c)!=="body"),r=null;const i=ee(e).position==="fixed";let s=i?de(e):e;for(;Q(s)&&!Ce(s);){const c=ee(s),l=pt(s);!l&&c.position==="fixed"&&(r=null),(i?!l&&!r:!l&&c.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Ne(s)&&!l&&Wt(e,s))?o=o.filter(d=>d!==s):r=c,s=de(s)}return t.set(e,o),o}function To(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Ve(t)?[]:Ao(t,this._c):[].concat(n),o],c=Tt(t,s[0],r);let l=c.top,a=c.right,d=c.bottom,p=c.left;for(let w=1;w{s(!1,1e-7)},1e3)}T===1&&!zt(a,e.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(C,{...S,root:r.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(e)}return s(!0),i}function Do(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=ht(e),d=r||i?[...a?Ie(a):[],...t?Ie(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const p=a&&c?Mo(a,n):null;let w=-1,m=null;s&&(m=new ResizeObserver(y=>{let[g]=y;g&&g.target===a&&m&&t&&(m.unobserve(t),cancelAnimationFrame(w),w=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(t)})),n()}),a&&!l&&m.observe(a),t&&m.observe(t));let h,f=l?we(e):null;l&&v();function v(){const y=we(e);f&&!zt(f,y)&&n(),f=y,h=requestAnimationFrame(v)}return n(),()=>{var y;d.forEach(g=>{r&&g.removeEventListener("scroll",n),i&&g.removeEventListener("resize",n)}),p?.(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(h)}}const Lo=fo,jo=uo,ko=co,Ho=mo,Bo=lo,Ot=io,Vo=po,$o=(e,t,n)=>{const o=new Map,r={platform:_o,...n},i={...r.platform,_c:o};return so(e,t,{...r,platform:i})};var Wo=typeof document<"u",Fo=function(){},Me=Wo?u.useLayoutEffect:Fo;function ke(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(!ke(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 i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!ke(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ut(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function It(e,t){const n=Ut(e);return Math.round(t*n)/n}function Ze(e){const t=u.useRef(e);return Me(()=>{t.current=e}),t}function zo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[d,p]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[w,m]=u.useState(o);ke(w,o)||m(o);const[h,f]=u.useState(null),[v,y]=u.useState(null),g=u.useCallback(P=>{P!==A.current&&(A.current=P,f(P))},[]),S=u.useCallback(P=>{P!==T.current&&(T.current=P,y(P))},[]),b=i||h,C=s||v,A=u.useRef(null),T=u.useRef(null),N=u.useRef(d),B=l!=null,M=Ze(l),D=Ze(r),L=Ze(a),_=u.useCallback(()=>{if(!A.current||!T.current)return;const P={placement:t,strategy:n,middleware:w};D.current&&(P.platform=D.current),$o(A.current,T.current,P).then(j=>{const K={...j,isPositioned:L.current!==!1};O.current&&!ke(N.current,K)&&(N.current=K,at.flushSync(()=>{p(K)}))})},[w,t,n,D,L]);Me(()=>{a===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,p(P=>({...P,isPositioned:!1})))},[a]);const O=u.useRef(!1);Me(()=>(O.current=!0,()=>{O.current=!1}),[]),Me(()=>{if(b&&(A.current=b),C&&(T.current=C),b&&C){if(M.current)return M.current(b,C,_);_()}},[b,C,_,M,B]);const V=u.useMemo(()=>({reference:A,floating:T,setReference:g,setFloating:S}),[g,S]),E=u.useMemo(()=>({reference:b,floating:C}),[b,C]),I=u.useMemo(()=>{const P={position:n,left:0,top:0};if(!E.floating)return P;const j=It(E.floating,d.x),K=It(E.floating,d.y);return c?{...P,transform:"translate("+j+"px, "+K+"px)",...Ut(E.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:K}},[n,c,E.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:_,refs:V,elements:E,floatingStyles:I}),[d,_,V,E,I])}const Uo=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?Ot({element:o.current,padding:r}).fn(n):{}:o?Ot({element:o,padding:r}).fn(n):{}}}},Ko=(e,t)=>{const n=Lo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yo=(e,t)=>{const n=jo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xo=(e,t)=>({fn:Vo(e).fn,options:[e,t]}),Go=(e,t)=>{const n=ko(e);return{name:n.name,fn:n.fn,options:[e,t]}},qo=(e,t)=>{const n=Ho(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zo=(e,t)=>{const n=Bo(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jo=(e,t)=>{const n=Uo(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Qo="Arrow",Kt=u.forwardRef((e,t)=>{const{children:n,width:o=10,height:r=5,...i}=e;return x.jsx(z.svg,{...i,ref:t,width:o,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});Kt.displayName=Qo;var er=Kt,gt="Popper",[Yt,Xt]=ct(gt),[tr,Gt]=Yt(gt),qt=e=>{const{__scopePopper:t,children:n}=e,[o,r]=u.useState(null);return x.jsx(tr,{scope:t,anchor:o,onAnchorChange:r,children:n})};qt.displayName=gt;var Zt="PopperAnchor",Jt=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...r}=e,i=Gt(Zt,n),s=u.useRef(null),c=Y(t,s),l=u.useRef(null);return u.useEffect(()=>{const a=l.current;l.current=o?.current||s.current,a!==l.current&&i.onAnchorChange(l.current)}),o?null:x.jsx(z.div,{...r,ref:c})});Jt.displayName=Zt;var xt="PopperContent",[nr,or]=Yt(xt),Qt=u.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:a=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:w=!1,updatePositionStrategy:m="optimized",onPlaced:h,...f}=e,v=Gt(xt,n),[y,g]=u.useState(null),S=Y(t,R=>g(R)),[b,C]=u.useState(null),A=Bn(b),T=A?.width??0,N=A?.height??0,B=o+(i!=="center"?"-"+i:""),M=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(a)?a:[a],L=D.length>0,_={padding:M,boundary:D.filter(sr),altBoundary:L},{refs:O,floatingStyles:V,placement:E,isPositioned:I,middlewareData:P}=zo({strategy:"fixed",placement:B,whileElementsMounted:(...R)=>Do(...R,{animationFrame:m==="always"}),elements:{reference:v.anchor},middleware:[Ko({mainAxis:r+N,alignmentAxis:s}),l&&Yo({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Xo():void 0,..._}),l&&Go({..._}),qo({..._,apply:({elements:R,rects:$,availableWidth:U,availableHeight:k})=>{const{width:H,height:W}=$.reference,q=R.floating.style;q.setProperty("--radix-popper-available-width",`${U}px`),q.setProperty("--radix-popper-available-height",`${k}px`),q.setProperty("--radix-popper-anchor-width",`${H}px`),q.setProperty("--radix-popper-anchor-height",`${W}px`)}}),b&&Jo({element:b,padding:c}),ir({arrowWidth:T,arrowHeight:N}),w&&Zo({strategy:"referenceHidden",..._})]}),[j,K]=nn(E),pe=_t(h);oe(()=>{I&&pe?.()},[I,pe]);const Te=P.arrow?.x,Ee=P.arrow?.y,le=P.arrow?.centerOffset!==0,[Se,me]=u.useState();return oe(()=>{y&&me(window.getComputedStyle(y).zIndex)},[y]),x.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:I?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Se,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:x.jsx(nr,{scope:n,placedSide:j,onArrowChange:C,arrowX:Te,arrowY:Ee,shouldHideArrow:le,children:x.jsx(z.div,{"data-side":j,"data-align":K,...f,ref:S,style:{...f.style,animation:I?void 0:"none"}})})})});Qt.displayName=xt;var en="PopperArrow",rr={top:"bottom",right:"left",bottom:"top",left:"right"},tn=u.forwardRef(function(t,n){const{__scopePopper:o,...r}=t,i=or(en,o),s=rr[i.placedSide];return x.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:x.jsx(er,{...r,ref:n,style:{...r.style,display:"block"}})})});tn.displayName=en;function sr(e){return e!==null}var ir=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,s=r.arrow?.centerOffset!==0,c=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[a,d]=nn(n),p={start:"0%",center:"50%",end:"100%"}[d],w=(r.arrow?.x??0)+c/2,m=(r.arrow?.y??0)+l/2;let h="",f="";return a==="bottom"?(h=s?p:`${w}px`,f=`${-l}px`):a==="top"?(h=s?p:`${w}px`,f=`${o.floating.height+l}px`):a==="right"?(h=`${-l}px`,f=s?p:`${m}px`):a==="left"&&(h=`${o.floating.width+l}px`,f=s?p:`${m}px`),{data:{x:h,y:f}}}});function nn(e){const[t,n="center"]=e.split("-");return[t,n]}var cr=qt,lr=Jt,ar=Qt,dr=tn;function Nt(e,[t,n]){return Math.min(n,Math.max(t,e))}var fr=[" ","Enter","ArrowUp","ArrowDown"],ur=[" ","Enter"],ve="Select",[Fe,ze,pr]=Un(ve),[Ae]=ct(ve,[pr,Xt]),Ue=Xt(),[mr,fe]=Ae(ve),[hr,gr]=Ae(ve),on=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:r,onOpenChange:i,value:s,defaultValue:c,onValueChange:l,dir:a,name:d,autoComplete:p,disabled:w,required:m,form:h}=e,f=Ue(t),[v,y]=u.useState(null),[g,S]=u.useState(null),[b,C]=u.useState(!1),A=Yn(a),[T,N]=vt({prop:o,defaultProp:r??!1,onChange:i,caller:ve}),[B,M]=vt({prop:s,defaultProp:c,onChange:l,caller:ve}),D=u.useRef(null),L=v?h||!!v.closest("form"):!0,[_,O]=u.useState(new Set),V=Array.from(_).map(E=>E.props.value).join(";");return x.jsx(cr,{...f,children:x.jsxs(mr,{required:m,scope:t,trigger:v,onTriggerChange:y,valueNode:g,onValueNodeChange:S,valueNodeHasChildren:b,onValueNodeHasChildrenChange:C,contentId:lt(),value:B,onValueChange:M,open:T,onOpenChange:N,dir:A,triggerPointerDownPosRef:D,disabled:w,children:[x.jsx(Fe.Provider,{scope:t,children:x.jsx(hr,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(E=>{O(I=>new Set(I).add(E))},[]),onNativeOptionRemove:u.useCallback(E=>{O(I=>{const P=new Set(I);return P.delete(E),P})},[]),children:n})}),L?x.jsxs(Tn,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:p,value:B,onChange:E=>M(E.target.value),disabled:w,form:h,children:[B===void 0?x.jsx("option",{value:""}):null,Array.from(_)]},V):null]})})};on.displayName=ve;var rn="SelectTrigger",sn=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...r}=e,i=Ue(n),s=fe(rn,n),c=s.disabled||o,l=Y(t,s.onTriggerChange),a=ze(n),d=u.useRef("touch"),[p,w,m]=On(f=>{const v=a().filter(S=>!S.disabled),y=v.find(S=>S.value===s.value),g=In(v,f,y);g!==void 0&&s.onValueChange(g.value)}),h=f=>{c||(s.onOpenChange(!0),m()),f&&(s.triggerPointerDownPosRef.current={x:Math.round(f.pageX),y:Math.round(f.pageY)})};return x.jsx(lr,{asChild:!0,...i,children:x.jsx(z.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":En(s.value)?"":void 0,...r,ref:l,onClick:F(r.onClick,f=>{f.currentTarget.focus(),d.current!=="mouse"&&h(f)}),onPointerDown:F(r.onPointerDown,f=>{d.current=f.pointerType;const v=f.target;v.hasPointerCapture(f.pointerId)&&v.releasePointerCapture(f.pointerId),f.button===0&&f.ctrlKey===!1&&f.pointerType==="mouse"&&(h(f),f.preventDefault())}),onKeyDown:F(r.onKeyDown,f=>{const v=p.current!=="";!(f.ctrlKey||f.altKey||f.metaKey)&&f.key.length===1&&w(f.key),!(v&&f.key===" ")&&fr.includes(f.key)&&(h(),f.preventDefault())})})})});sn.displayName=rn;var cn="SelectValue",ln=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,children:i,placeholder:s="",...c}=e,l=fe(cn,n),{onValueNodeHasChildrenChange:a}=l,d=i!==void 0,p=Y(t,l.onValueNodeChange);return oe(()=>{a(d)},[a,d]),x.jsx(z.span,{...c,ref:p,style:{pointerEvents:"none"},children:En(l.value)?x.jsx(x.Fragment,{children:s}):i})});ln.displayName=cn;var xr="SelectIcon",an=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...r}=e;return x.jsx(z.span,{"aria-hidden":!0,...r,ref:t,children:o||"▼"})});an.displayName=xr;var wr="SelectPortal",dn=e=>x.jsx(Mn,{asChild:!0,...e});dn.displayName=wr;var ye="SelectContent",fn=u.forwardRef((e,t)=>{const n=fe(ye,e.__scopeSelect),[o,r]=u.useState();if(oe(()=>{r(new DocumentFragment)},[]),!n.open){const i=o;return i?at.createPortal(x.jsx(un,{scope:e.__scopeSelect,children:x.jsx(Fe.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),i):null}return x.jsx(pn,{...e,ref:t})});fn.displayName=ye;var Z=10,[un,ue]=Ae(ye),vr="SelectContentImpl",yr=Je("SelectContent.RemoveScroll"),pn=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:i,onPointerDownOutside:s,side:c,sideOffset:l,align:a,alignOffset:d,arrowPadding:p,collisionBoundary:w,collisionPadding:m,sticky:h,hideWhenDetached:f,avoidCollisions:v,...y}=e,g=fe(ye,n),[S,b]=u.useState(null),[C,A]=u.useState(null),T=Y(t,R=>b(R)),[N,B]=u.useState(null),[M,D]=u.useState(null),L=ze(n),[_,O]=u.useState(!1),V=u.useRef(!1);u.useEffect(()=>{if(S)return Dn(S)},[S]),Ln();const E=u.useCallback(R=>{const[$,...U]=L().map(W=>W.ref.current),[k]=U.slice(-1),H=document.activeElement;for(const W of R)if(W===H||(W?.scrollIntoView({block:"nearest"}),W===$&&C&&(C.scrollTop=0),W===k&&C&&(C.scrollTop=C.scrollHeight),W?.focus(),document.activeElement!==H))return},[L,C]),I=u.useCallback(()=>E([N,S]),[E,N,S]);u.useEffect(()=>{_&&I()},[_,I]);const{onOpenChange:P,triggerPointerDownPosRef:j}=g;u.useEffect(()=>{if(S){let R={x:0,y:0};const $=k=>{R={x:Math.abs(Math.round(k.pageX)-(j.current?.x??0)),y:Math.abs(Math.round(k.pageY)-(j.current?.y??0))}},U=k=>{R.x<=10&&R.y<=10?k.preventDefault():S.contains(k.target)||P(!1),document.removeEventListener("pointermove",$),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",$),document.addEventListener("pointerup",U,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",U,{capture:!0})}}},[S,P,j]),u.useEffect(()=>{const R=()=>P(!1);return window.addEventListener("blur",R),window.addEventListener("resize",R),()=>{window.removeEventListener("blur",R),window.removeEventListener("resize",R)}},[P]);const[K,pe]=On(R=>{const $=L().filter(H=>!H.disabled),U=$.find(H=>H.ref.current===document.activeElement),k=In($,R,U);k&&setTimeout(()=>k.ref.current.focus())}),Te=u.useCallback((R,$,U)=>{const k=!V.current&&!U;(g.value!==void 0&&g.value===$||k)&&(B(R),k&&(V.current=!0))},[g.value]),Ee=u.useCallback(()=>S?.focus(),[S]),le=u.useCallback((R,$,U)=>{const k=!V.current&&!U;(g.value!==void 0&&g.value===$||k)&&D(R)},[g.value]),Se=o==="popper"?nt:mn,me=Se===nt?{side:c,sideOffset:l,align:a,alignOffset:d,arrowPadding:p,collisionBoundary:w,collisionPadding:m,sticky:h,hideWhenDetached:f,avoidCollisions:v}:{};return x.jsx(un,{scope:n,content:S,viewport:C,onViewportChange:A,itemRefCallback:Te,selectedItem:N,onItemLeave:Ee,itemTextRefCallback:le,focusSelectedItem:I,selectedItemText:M,position:o,isPositioned:_,searchRef:K,children:x.jsx(jn,{as:yr,allowPinchZoom:!0,children:x.jsx(kn,{asChild:!0,trapped:g.open,onMountAutoFocus:R=>{R.preventDefault()},onUnmountAutoFocus:F(r,R=>{g.trigger?.focus({preventScroll:!0}),R.preventDefault()}),children:x.jsx(Hn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:R=>R.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:x.jsx(Se,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:R=>R.preventDefault(),...y,...me,onPlaced:()=>O(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:F(y.onKeyDown,R=>{const $=R.ctrlKey||R.altKey||R.metaKey;if(R.key==="Tab"&&R.preventDefault(),!$&&R.key.length===1&&pe(R.key),["ArrowUp","ArrowDown","Home","End"].includes(R.key)){let k=L().filter(H=>!H.disabled).map(H=>H.ref.current);if(["ArrowUp","End"].includes(R.key)&&(k=k.slice().reverse()),["ArrowUp","ArrowDown"].includes(R.key)){const H=R.target,W=k.indexOf(H);k=k.slice(W+1)}setTimeout(()=>E(k)),R.preventDefault()}})})})})})})});pn.displayName=vr;var Sr="SelectItemAlignedPosition",mn=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...r}=e,i=fe(ye,n),s=ue(ye,n),[c,l]=u.useState(null),[a,d]=u.useState(null),p=Y(t,T=>d(T)),w=ze(n),m=u.useRef(!1),h=u.useRef(!0),{viewport:f,selectedItem:v,selectedItemText:y,focusSelectedItem:g}=s,S=u.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&a&&f&&v&&y){const T=i.trigger.getBoundingClientRect(),N=a.getBoundingClientRect(),B=i.valueNode.getBoundingClientRect(),M=y.getBoundingClientRect();if(i.dir!=="rtl"){const H=M.left-N.left,W=B.left-H,q=T.left-W,he=T.width+q,Ke=Math.max(he,N.width),Ye=window.innerWidth-Z,Xe=Nt(W,[Z,Math.max(Z,Ye-Ke)]);c.style.minWidth=he+"px",c.style.left=Xe+"px"}else{const H=N.right-M.right,W=window.innerWidth-B.right-H,q=window.innerWidth-T.right-W,he=T.width+q,Ke=Math.max(he,N.width),Ye=window.innerWidth-Z,Xe=Nt(W,[Z,Math.max(Z,Ye-Ke)]);c.style.minWidth=he+"px",c.style.right=Xe+"px"}const D=w(),L=window.innerHeight-Z*2,_=f.scrollHeight,O=window.getComputedStyle(a),V=parseInt(O.borderTopWidth,10),E=parseInt(O.paddingTop,10),I=parseInt(O.borderBottomWidth,10),P=parseInt(O.paddingBottom,10),j=V+E+_+P+I,K=Math.min(v.offsetHeight*5,j),pe=window.getComputedStyle(f),Te=parseInt(pe.paddingTop,10),Ee=parseInt(pe.paddingBottom,10),le=T.top+T.height/2-Z,Se=L-le,me=v.offsetHeight/2,R=v.offsetTop+me,$=V+E+R,U=j-$;if($<=le){const H=D.length>0&&v===D[D.length-1].ref.current;c.style.bottom="0px";const W=a.clientHeight-f.offsetTop-f.offsetHeight,q=Math.max(Se,me+(H?Ee:0)+W+I),he=$+q;c.style.height=he+"px"}else{const H=D.length>0&&v===D[0].ref.current;c.style.top="0px";const q=Math.max(le,V+f.offsetTop+(H?Te:0)+me)+U;c.style.height=q+"px",f.scrollTop=$-le+f.offsetTop}c.style.margin=`${Z}px 0`,c.style.minHeight=K+"px",c.style.maxHeight=L+"px",o?.(),requestAnimationFrame(()=>m.current=!0)}},[w,i.trigger,i.valueNode,c,a,f,v,y,i.dir,o]);oe(()=>S(),[S]);const[b,C]=u.useState();oe(()=>{a&&C(window.getComputedStyle(a).zIndex)},[a]);const A=u.useCallback(T=>{T&&h.current===!0&&(S(),g?.(),h.current=!1)},[S,g]);return x.jsx(Cr,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:A,children:x.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:x.jsx(z.div,{...r,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});mn.displayName=Sr;var br="SelectPopperPosition",nt=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:r=Z,...i}=e,s=Ue(n);return x.jsx(ar,{...s,...i,ref:t,align:o,collisionPadding:r,style:{boxSizing:"border-box",...i.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)"}})});nt.displayName=br;var[Cr,wt]=Ae(ye,{}),ot="SelectViewport",hn=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...r}=e,i=ue(ot,n),s=wt(ot,n),c=Y(t,i.onViewportChange),l=u.useRef(0);return x.jsxs(x.Fragment,{children:[x.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}),x.jsx(Fe.Slot,{scope:n,children:x.jsx(z.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:F(r.onScroll,a=>{const d=a.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:w}=s;if(w?.current&&p){const m=Math.abs(l.current-d.scrollTop);if(m>0){const h=window.innerHeight-Z*2,f=parseFloat(p.style.minHeight),v=parseFloat(p.style.height),y=Math.max(f,v);if(y0?b:0,p.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});hn.displayName=ot;var gn="SelectGroup",[Rr,Pr]=Ae(gn),Ar=u.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=lt();return x.jsx(Rr,{scope:n,id:r,children:x.jsx(z.div,{role:"group","aria-labelledby":r,...o,ref:t})})});Ar.displayName=gn;var xn="SelectLabel",wn=u.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Pr(xn,n);return x.jsx(z.div,{id:r.id,...o,ref:t})});wn.displayName=xn;var He="SelectItem",[Tr,vn]=Ae(He),yn=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:r=!1,textValue:i,...s}=e,c=fe(He,n),l=ue(He,n),a=c.value===o,[d,p]=u.useState(i??""),[w,m]=u.useState(!1),h=Y(t,g=>l.itemRefCallback?.(g,o,r)),f=lt(),v=u.useRef("touch"),y=()=>{r||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A 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 x.jsx(Tr,{scope:n,value:o,disabled:r,textId:f,isSelected:a,onItemTextChange:u.useCallback(g=>{p(S=>S||(g?.textContent??"").trim())},[]),children:x.jsx(Fe.ItemSlot,{scope:n,value:o,disabled:r,textValue:d,children:x.jsx(z.div,{role:"option","aria-labelledby":f,"data-highlighted":w?"":void 0,"aria-selected":a&&w,"data-state":a?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...s,ref:h,onFocus:F(s.onFocus,()=>m(!0)),onBlur:F(s.onBlur,()=>m(!1)),onClick:F(s.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:F(s.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:F(s.onPointerDown,g=>{v.current=g.pointerType}),onPointerMove:F(s.onPointerMove,g=>{v.current=g.pointerType,r?l.onItemLeave?.():v.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:F(s.onPointerLeave,g=>{g.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:F(s.onKeyDown,g=>{l.searchRef?.current!==""&&g.key===" "||(ur.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});yn.displayName=He;var Oe="SelectItemText",Sn=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:r,...i}=e,s=fe(Oe,n),c=ue(Oe,n),l=vn(Oe,n),a=gr(Oe,n),[d,p]=u.useState(null),w=Y(t,y=>p(y),l.onItemTextChange,y=>c.itemTextRefCallback?.(y,l.value,l.disabled)),m=d?.textContent,h=u.useMemo(()=>x.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:f,onNativeOptionRemove:v}=a;return oe(()=>(f(h),()=>v(h)),[f,v,h]),x.jsxs(x.Fragment,{children:[x.jsx(z.span,{id:l.textId,...i,ref:w}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?at.createPortal(i.children,s.valueNode):null]})});Sn.displayName=Oe;var bn="SelectItemIndicator",Cn=u.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return vn(bn,n).isSelected?x.jsx(z.span,{"aria-hidden":!0,...o,ref:t}):null});Cn.displayName=bn;var rt="SelectScrollUpButton",Rn=u.forwardRef((e,t)=>{const n=ue(rt,e.__scopeSelect),o=wt(rt,e.__scopeSelect),[r,i]=u.useState(!1),s=Y(t,o.onScrollButtonChange);return oe(()=>{if(n.viewport&&n.isPositioned){let c=function(){const a=l.scrollTop>0;i(a)};const l=n.viewport;return c(),l.addEventListener("scroll",c),()=>l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?x.jsx(An,{...e,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop-l.offsetHeight)}}):null});Rn.displayName=rt;var st="SelectScrollDownButton",Pn=u.forwardRef((e,t)=>{const n=ue(st,e.__scopeSelect),o=wt(st,e.__scopeSelect),[r,i]=u.useState(!1),s=Y(t,o.onScrollButtonChange);return oe(()=>{if(n.viewport&&n.isPositioned){let c=function(){const a=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),r?x.jsx(An,{...e,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:l}=n;c&&l&&(c.scrollTop=c.scrollTop+l.offsetHeight)}}):null});Pn.displayName=st;var An=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...r}=e,i=ue("SelectScrollButton",n),s=u.useRef(null),c=ze(n),l=u.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return u.useEffect(()=>()=>l(),[l]),oe(()=>{c().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),x.jsx(z.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:F(r.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:F(r.onPointerMove,()=>{i.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:F(r.onPointerLeave,()=>{l()})})}),Er="SelectSeparator",Or=u.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return x.jsx(z.div,{"aria-hidden":!0,...o,ref:t})});Or.displayName=Er;var it="SelectArrow",Ir=u.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,r=Ue(n),i=fe(it,n),s=ue(it,n);return i.open&&s.position==="popper"?x.jsx(dr,{...r,...o,ref:t}):null});Ir.displayName=it;var Nr="SelectBubbleInput",Tn=u.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const r=u.useRef(null),i=Y(o,r),s=Vn(t);return u.useEffect(()=>{const c=r.current;if(!c)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&d){const p=new Event("change",{bubbles:!0});d.call(c,t),c.dispatchEvent(p)}},[s,t]),x.jsx(z.select,{...n,style:{...Dt,...n.style},ref:i,defaultValue:t})});Tn.displayName=Nr;function En(e){return e===""||e===void 0}function On(e){const t=_t(e),n=u.useRef(""),o=u.useRef(0),r=u.useCallback(s=>{const c=n.current+s;t(c),(function l(a){n.current=a,window.clearTimeout(o.current),a!==""&&(o.current=window.setTimeout(()=>l(""),1e3))})(c)},[t]),i=u.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,i]}function In(e,t,n){const r=t.length>1&&Array.from(t).every(a=>a===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=_r(e,Math.max(i,0));r.length===1&&(s=s.filter(a=>a!==n));const l=s.find(a=>a.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function _r(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Mr=on,Dr=sn,Lr=ln,jr=an,kr=dn,Hr=fn,Br=hn,Vr=wn,$r=yn,Wr=Sn,Fr=Cn,zr=Rn,Ur=Pn;function Kr({size:e=16,className:t,...n}){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1",className:t,...n,children:x.jsx("path",{d:"M13 10.5L8 5.5L3 10.5"})})}function Yr({...e}){return x.jsx(Mr,{"data-slot":"select",...e})}function Xr({...e}){return x.jsx(Lr,{"data-slot":"select-value",...e})}const Nn=u.forwardRef(({className:e,size:t="default",children:n,...o},r)=>x.jsxs(Dr,{ref:r,"data-slot":"select-trigger","data-size":t,className:J("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...o,children:[n,x.jsx(jr,{asChild:!0,children:x.jsx(Mt,{className:"size-4 opacity-50"})})]}));Nn.displayName="SelectTrigger";function Gr({className:e,children:t,position:n="popper",align:o="center",...r}){return x.jsx(kr,{children:x.jsxs(Hr,{"data-slot":"select-content",className:J("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:o,...r,children:[x.jsx(Jr,{}),x.jsx(Br,{className:J("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),x.jsx(Qr,{})]})})}function qr({className:e,...t}){return x.jsx(Vr,{"data-slot":"select-label",className:J("px-2 py-1.5 text-xs text-muted-foreground",e),...t})}function Zr({className:e,children:t,...n}){return x.jsxs($r,{"data-slot":"select-item",className:J("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[x.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:x.jsx(Fr,{children:x.jsx(Wn,{className:"size-4"})})}),x.jsx(Wr,{children:t})]})}function Jr({className:e,...t}){return x.jsx(zr,{"data-slot":"select-scroll-up-button",className:J("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(Kr,{className:"size-4"})})}function Qr({className:e,...t}){return x.jsx(Ur,{"data-slot":"select-scroll-down-button",className:J("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(Mt,{className:"size-4"})})}const ls=Yr,as=Xr,es=u.forwardRef(({className:e,...t},n)=>x.jsx(Nn,{ref:n,className:J("!h-[3.2rem] min-h-[3.2rem] rounded-none text-[1.2rem] leading-[1.8rem] px-[0.8rem] py-0","bg-[var(--fig-btn-default-secondary)] text-[var(--fig-text-primary)]","dark:bg-[var(--fig-btn-default-secondary)] dark:hover:bg-[var(--fig-btn-default-secondary)]","border-[var(--fig-btn-enabled)] shadow-none","data-[placeholder]:text-[var(--fig-text-secondary)]","focus:ring-0 focus-visible:ring-0","focus-visible:border-[var(--fig-btn-default-primary)] data-[state=open]:border-[var(--fig-btn-default-primary)]","[&_svg]:size-[1.6rem] [&_svg]:opacity-100 [&_svg]:!text-[var(--fig-text-primary)]","[&_svg]:transition-transform [&_svg]:duration-200 data-[state=open]:[&_svg]:rotate-180","disabled:opacity-100 disabled:border-[var(--fig-btn-disabled)] disabled:text-[var(--fig-btn-disabled)] disabled:[&_svg]:!text-[var(--fig-btn-disabled)] disabled:data-[placeholder]:text-[var(--fig-btn-disabled)]",e),...t}));es.displayName="SelectTrigger";const ts=u.forwardRef(({className:e,align:t="start",...n},o)=>x.jsx(Gr,{ref:o,align:t,className:J("rounded-none text-[1.2rem] shadow-none","border-[var(--fig-btn-default-primary)] bg-[var(--fig-btn-default-secondary)]","[&_[data-radix-select-viewport]]:p-0","w-auto min-w-[var(--radix-select-trigger-width)] max-w-[var(--radix-select-content-available-width)]","[&_[data-radix-select-viewport]]:min-w-full","data-[side=bottom]:translate-y-[-0.1rem] data-[side=top]:translate-y-[0.1rem]",e),...n}));ts.displayName="SelectContent";const ns=u.forwardRef(({className:e,...t},n)=>x.jsx(Zr,{ref:n,className:J("h-[3.2rem] min-h-[3.2rem] rounded-none justify-start text-[1.2rem] leading-[1.8rem]","whitespace-nowrap","px-[0.8rem] [&>span:first-child]:hidden","border-b border-[var(--fig-btn-default-primary)] last:border-b-0","text-[var(--fig-text-primary)]","focus:bg-[var(--fig-btn-hover-secondary)] focus:text-[var(--fig-text-primary)]","data-[highlighted]:bg-[var(--fig-btn-hover-secondary)] data-[highlighted]:text-[var(--fig-text-primary)]",e),...t}));ns.displayName="SelectItem";const os=u.forwardRef(({className:e,...t},n)=>x.jsx(qr,{ref:n,className:J("text-[1.2rem]",e),...t}));os.displayName="SelectLabel";export{ls as S,es as a,as as b,ts as c,ns as d,Un as e,Yn as u};