import{b as n,j as c,e as _e}from"./app-CyJEXGyv.js";import{e as $,a as Te,u as be,c as _,b as rt,d as st,h as lt,f as at,R as it,F as ct,D as dt}from"./index-BiS8IM9B.js";import{c as Ee,u as ut,R as pt,b as ft,A as mt,C as ht,a as vt}from"./index-CeYyXWc4.js";import{c as gt,u as k,a as te}from"./utils-D3rN0LeJ.js";import{u as xt,V as St}from"./index-D448AvbX.js";import{C as Ne}from"./chevron-down-CelnyKCC.js";import{c as Re}from"./createLucideIcon-DqnlFWer.js";/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],yt=Re("Check",wt);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ct=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],bt=Re("ChevronUp",Ct);function Pe(t,[o,e]){return Math.min(e,Math.max(o,t))}function It(t,o=[]){let e=[];function l(d,a){const s=n.createContext(a),i=e.length;e=[...e,a];const u=x=>{var y;const{scope:S,children:T,...w}=x,p=((y=S==null?void 0:S[t])==null?void 0:y[i])||s,g=n.useMemo(()=>w,Object.values(w));return c.jsx(p.Provider,{value:g,children:T})};u.displayName=d+"Provider";function v(x,S){var p;const T=((p=S==null?void 0:S[t])==null?void 0:p[i])||s,w=n.useContext(T);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${x}\` must be used within \`${d}\``)}return[u,v]}const r=()=>{const d=e.map(a=>n.createContext(a));return function(s){const i=(s==null?void 0:s[t])||d;return n.useMemo(()=>({[`__scope${t}`]:{...s,[t]:i}}),[s,i])}};return r.scopeName=t,[l,Tt(r,...o)]}function Tt(...t){const o=t[0];if(t.length===1)return o;const e=()=>{const l=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(d){const a=l.reduce((s,{useScope:i,scopeName:u})=>{const x=i(d)[`__scope${u}`];return{...s,...x}},{});return n.useMemo(()=>({[`__scope${o.scopeName}`]:a}),[a])}};return e.scopeName=o.scopeName,e}function je(t){const o=Pt(t),e=n.forwardRef((l,r)=>{const{children:d,...a}=l,s=n.Children.toArray(d),i=s.find(Et);if(i){const u=i.props.children,v=s.map(x=>x===i?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:x);return c.jsx(o,{...a,ref:r,children:n.isValidElement(u)?n.cloneElement(u,void 0,v):null})}return c.jsx(o,{...a,ref:r,children:d})});return e.displayName=`${t}.Slot`,e}function Pt(t){const o=n.forwardRef((e,l)=>{const{children:r,...d}=e;if(n.isValidElement(r)){const a=Rt(r),s=Nt(d,r.props);return r.type!==n.Fragment&&(s.ref=l?gt(l,a):a),n.cloneElement(r,s)}return n.Children.count(r)>1?n.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var _t=Symbol("radix.slottable");function Et(t){return n.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===_t}function Nt(t,o){const e={...o};for(const l in o){const r=t[l],d=o[l];/^on[A-Z]/.test(l)?r&&d?e[l]=(...s)=>{const i=d(...s);return r(...s),i}:r&&(e[l]=r):l==="style"?e[l]={...r,...d}:l==="className"&&(e[l]=[r,d].filter(Boolean).join(" "))}return{...t,...e}}function Rt(t){var l,r;let o=(l=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:l.get,e=o&&"isReactWarning"in o&&o.isReactWarning;return e?t.ref:(o=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,e=o&&"isReactWarning"in o&&o.isReactWarning,e?t.props.ref:t.props.ref||t.ref)}var jt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],j=jt.reduce((t,o)=>{const e=je(`Primitive.${o}`),l=n.forwardRef((r,d)=>{const{asChild:a,...s}=r,i=a?e:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(i,{...s,ref:d})});return l.displayName=`Primitive.${o}`,{...t,[o]:l}},{}),Mt=[" ","Enter","ArrowUp","ArrowDown"],At=[" ","Enter"],J="Select",[ce,de,Ot]=ft(J),[oe]=It(J,[Ot,Ee]),ue=Ee(),[Dt,G]=oe(J),[Lt,kt]=oe(J),Me=t=>{const{__scopeSelect:o,children:e,open:l,defaultOpen:r,onOpenChange:d,value:a,defaultValue:s,onValueChange:i,dir:u,name:v,autoComplete:x,disabled:S,required:T,form:w}=t,p=ue(o),[g,y]=n.useState(null),[f,h]=n.useState(null),[M,A]=n.useState(!1),ne=ut(u),[E,D]=Te({prop:l,defaultProp:r??!1,onChange:d,caller:J}),[U,q]=Te({prop:a,defaultProp:s,onChange:i,caller:J}),V=n.useRef(null),B=g?w||!!g.closest("form"):!0,[z,H]=n.useState(new Set),W=Array.from(z).map(N=>N.props.value).join(";");return c.jsx(pt,{...p,children:c.jsxs(Dt,{required:T,scope:o,trigger:g,onTriggerChange:y,valueNode:f,onValueNodeChange:h,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:be(),value:U,onValueChange:q,open:E,onOpenChange:D,dir:ne,triggerPointerDownPosRef:V,disabled:S,children:[c.jsx(ce.Provider,{scope:o,children:c.jsx(Lt,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(N=>{H(L=>new Set(L).add(N))},[]),onNativeOptionRemove:n.useCallback(N=>{H(L=>{const F=new Set(L);return F.delete(N),F})},[]),children:e})}),B?c.jsxs(et,{"aria-hidden":!0,required:T,tabIndex:-1,name:v,autoComplete:x,value:U,onChange:N=>q(N.target.value),disabled:S,form:w,children:[U===void 0?c.jsx("option",{value:""}):null,Array.from(z)]},W):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:l=!1,...r}=t,d=ue(e),a=G(Ae,e),s=a.disabled||l,i=k(o,a.onTriggerChange),u=de(e),v=n.useRef("touch"),[x,S,T]=ot(p=>{const g=u().filter(h=>!h.disabled),y=g.find(h=>h.value===a.value),f=nt(g,p,y);f!==void 0&&a.onValueChange(f.value)}),w=p=>{s||(a.onOpenChange(!0),T()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return c.jsx(mt,{asChild:!0,...d,children:c.jsx(j.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:s,"data-disabled":s?"":void 0,"data-placeholder":tt(a.value)?"":void 0,...r,ref:i,onClick:_(r.onClick,p=>{p.currentTarget.focus(),v.current!=="mouse"&&w(p)}),onPointerDown:_(r.onPointerDown,p=>{v.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(w(p),p.preventDefault())}),onKeyDown:_(r.onKeyDown,p=>{const g=x.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&S(p.key),!(g&&p.key===" ")&&Mt.includes(p.key)&&(w(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",Le=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:l,style:r,children:d,placeholder:a="",...s}=t,i=G(De,e),{onValueNodeHasChildrenChange:u}=i,v=d!==void 0,x=k(o,i.onValueNodeChange);return $(()=>{u(v)},[u,v]),c.jsx(j.span,{...s,ref:x,style:{pointerEvents:"none"},children:tt(i.value)?c.jsx(c.Fragment,{children:a}):d})});Le.displayName=De;var Vt="SelectIcon",ke=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:l,...r}=t;return c.jsx(j.span,{"aria-hidden":!0,...r,ref:o,children:l||"▼"})});ke.displayName=Vt;var Bt="SelectPortal",Ve=t=>c.jsx(rt,{asChild:!0,...t});Ve.displayName=Bt;var Q="SelectContent",Be=n.forwardRef((t,o)=>{const e=G(Q,t.__scopeSelect),[l,r]=n.useState();if($(()=>{r(new DocumentFragment)},[]),!e.open){const d=l;return d?_e.createPortal(c.jsx(He,{scope:t.__scopeSelect,children:c.jsx(ce.Slot,{scope:t.__scopeSelect,children:c.jsx("div",{children:t.children})})}),d):null}return c.jsx(We,{...t,ref:o})});Be.displayName=Q;var O=10,[He,Y]=oe(Q),Ht="SelectContentImpl",Wt=je("SelectContent.RemoveScroll"),We=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:l="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:d,onPointerDownOutside:a,side:s,sideOffset:i,align:u,alignOffset:v,arrowPadding:x,collisionBoundary:S,collisionPadding:T,sticky:w,hideWhenDetached:p,avoidCollisions:g,...y}=t,f=G(Q,e),[h,M]=n.useState(null),[A,ne]=n.useState(null),E=k(o,m=>M(m)),[D,U]=n.useState(null),[q,V]=n.useState(null),B=de(e),[z,H]=n.useState(!1),W=n.useRef(!1);n.useEffect(()=>{if(h)return lt(h)},[h]),at();const N=n.useCallback(m=>{const[P,...R]=B().map(b=>b.ref.current),[I]=R.slice(-1),C=document.activeElement;for(const b of m)if(b===C||(b==null||b.scrollIntoView({block:"nearest"}),b===P&&A&&(A.scrollTop=0),b===I&&A&&(A.scrollTop=A.scrollHeight),b==null||b.focus(),document.activeElement!==C))return},[B,A]),L=n.useCallback(()=>N([D,h]),[N,D,h]);n.useEffect(()=>{z&&L()},[z,L]);const{onOpenChange:F,triggerPointerDownPosRef:K}=f;n.useEffect(()=>{if(h){let m={x:0,y:0};const P=I=>{var C,b;m={x:Math.abs(Math.round(I.pageX)-(((C=K.current)==null?void 0:C.x)??0)),y:Math.abs(Math.round(I.pageY)-(((b=K.current)==null?void 0:b.y)??0))}},R=I=>{m.x<=10&&m.y<=10?I.preventDefault():h.contains(I.target)||F(!1),document.removeEventListener("pointermove",P),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",P),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",P),document.removeEventListener("pointerup",R,{capture:!0})}}},[h,F,K]),n.useEffect(()=>{const m=()=>F(!1);return window.addEventListener("blur",m),window.addEventListener("resize",m),()=>{window.removeEventListener("blur",m),window.removeEventListener("resize",m)}},[F]);const[pe,le]=ot(m=>{const P=B().filter(C=>!C.disabled),R=P.find(C=>C.ref.current===document.activeElement),I=nt(P,m,R);I&&setTimeout(()=>I.ref.current.focus())}),fe=n.useCallback((m,P,R)=>{const I=!W.current&&!R;(f.value!==void 0&&f.value===P||I)&&(U(m),I&&(W.current=!0))},[f.value]),me=n.useCallback(()=>h==null?void 0:h.focus(),[h]),ee=n.useCallback((m,P,R)=>{const I=!W.current&&!R;(f.value!==void 0&&f.value===P||I)&&V(m)},[f.value]),ae=l==="popper"?xe:Fe,re=ae===xe?{side:s,sideOffset:i,align:u,alignOffset:v,arrowPadding:x,collisionBoundary:S,collisionPadding:T,sticky:w,hideWhenDetached:p,avoidCollisions:g}:{};return c.jsx(He,{scope:e,content:h,viewport:A,onViewportChange:ne,itemRefCallback:fe,selectedItem:D,onItemLeave:me,itemTextRefCallback:ee,focusSelectedItem:L,selectedItemText:q,position:l,isPositioned:z,searchRef:pe,children:c.jsx(it,{as:Wt,allowPinchZoom:!0,children:c.jsx(ct,{asChild:!0,trapped:f.open,onMountAutoFocus:m=>{m.preventDefault()},onUnmountAutoFocus:_(r,m=>{var P;(P=f.trigger)==null||P.focus({preventScroll:!0}),m.preventDefault()}),children:c.jsx(dt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:c.jsx(ae,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:m=>m.preventDefault(),...y,...re,onPlaced:()=>H(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:_(y.onKeyDown,m=>{const P=m.ctrlKey||m.altKey||m.metaKey;if(m.key==="Tab"&&m.preventDefault(),!P&&m.key.length===1&&le(m.key),["ArrowUp","ArrowDown","Home","End"].includes(m.key)){let I=B().filter(C=>!C.disabled).map(C=>C.ref.current);if(["ArrowUp","End"].includes(m.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(m.key)){const C=m.target,b=I.indexOf(C);I=I.slice(b+1)}setTimeout(()=>N(I)),m.preventDefault()}})})})})})})});We.displayName=Ht;var Ft="SelectItemAlignedPosition",Fe=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:l,...r}=t,d=G(Q,e),a=Y(Q,e),[s,i]=n.useState(null),[u,v]=n.useState(null),x=k(o,E=>v(E)),S=de(e),T=n.useRef(!1),w=n.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:y,focusSelectedItem:f}=a,h=n.useCallback(()=>{if(d.trigger&&d.valueNode&&s&&u&&p&&g&&y){const E=d.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),U=d.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(d.dir!=="rtl"){const C=q.left-D.left,b=U.left-C,Z=E.left-b,X=E.width+Z,he=Math.max(X,D.width),ve=window.innerWidth-O,ge=Pe(b,[O,Math.max(O,ve-he)]);s.style.minWidth=X+"px",s.style.left=ge+"px"}else{const C=D.right-q.right,b=window.innerWidth-U.right-C,Z=window.innerWidth-E.right-b,X=E.width+Z,he=Math.max(X,D.width),ve=window.innerWidth-O,ge=Pe(b,[O,Math.max(O,ve-he)]);s.style.minWidth=X+"px",s.style.right=ge+"px"}const V=S(),B=window.innerHeight-O*2,z=p.scrollHeight,H=window.getComputedStyle(u),W=parseInt(H.borderTopWidth,10),N=parseInt(H.paddingTop,10),L=parseInt(H.borderBottomWidth,10),F=parseInt(H.paddingBottom,10),K=W+N+z+F+L,pe=Math.min(g.offsetHeight*5,K),le=window.getComputedStyle(p),fe=parseInt(le.paddingTop,10),me=parseInt(le.paddingBottom,10),ee=E.top+E.height/2-O,ae=B-ee,re=g.offsetHeight/2,m=g.offsetTop+re,P=W+N+m,R=K-P;if(P<=ee){const C=V.length>0&&g===V[V.length-1].ref.current;s.style.bottom="0px";const b=u.clientHeight-p.offsetTop-p.offsetHeight,Z=Math.max(ae,re+(C?me:0)+b+L),X=P+Z;s.style.height=X+"px"}else{const C=V.length>0&&g===V[0].ref.current;s.style.top="0px";const Z=Math.max(ee,W+p.offsetTop+(C?fe:0)+re)+R;s.style.height=Z+"px",p.scrollTop=P-ee+p.offsetTop}s.style.margin=`${O}px 0`,s.style.minHeight=pe+"px",s.style.maxHeight=B+"px",l==null||l(),requestAnimationFrame(()=>T.current=!0)}},[S,d.trigger,d.valueNode,s,u,p,g,y,d.dir,l]);$(()=>h(),[h]);const[M,A]=n.useState();$(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const ne=n.useCallback(E=>{E&&w.current===!0&&(h(),f==null||f(),w.current=!1)},[h,f]);return c.jsx(zt,{scope:e,contentWrapper:s,shouldExpandOnScrollRef:T,onScrollButtonChange:ne,children:c.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:c.jsx(j.div,{...r,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Fe.displayName=Ft;var Ut="SelectPopperPosition",xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:l="start",collisionPadding:r=O,...d}=t,a=ue(e);return c.jsx(ht,{...a,...d,ref:o,align:l,collisionPadding:r,style:{boxSizing:"border-box",...d.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)"}})});xe.displayName=Ut;var[zt,Ie]=oe(Q,{}),Se="SelectViewport",Ue=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:l,...r}=t,d=Y(Se,e),a=Ie(Se,e),s=k(o,d.onViewportChange),i=n.useRef(0);return c.jsxs(c.Fragment,{children:[c.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:l}),c.jsx(ce.Slot,{scope:e,children:c.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:_(r.onScroll,u=>{const v=u.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:S}=a;if(S!=null&&S.current&&x){const T=Math.abs(i.current-v.scrollTop);if(T>0){const w=window.innerHeight-O*2,p=parseFloat(x.style.minHeight),g=parseFloat(x.style.height),y=Math.max(p,g);if(y<w){const f=y+T,h=Math.min(w,f),M=f-h;x.style.height=h+"px",x.style.bottom==="0px"&&(v.scrollTop=M>0?M:0,x.style.justifyContent="flex-end")}}}i.current=v.scrollTop})})})]})});Ue.displayName=Se;var ze="SelectGroup",[Kt,$t]=oe(ze),Gt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...l}=t,r=be();return c.jsx(Kt,{scope:e,id:r,children:c.jsx(j.div,{role:"group","aria-labelledby":r,...l,ref:o})})});Gt.displayName=ze;var Ke="SelectLabel",Yt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...l}=t,r=$t(Ke,e);return c.jsx(j.div,{id:r.id,...l,ref:o})});Yt.displayName=Ke;var ie="SelectItem",[qt,$e]=oe(ie),Ge=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:l,disabled:r=!1,textValue:d,...a}=t,s=G(ie,e),i=Y(ie,e),u=s.value===l,[v,x]=n.useState(d??""),[S,T]=n.useState(!1),w=k(o,f=>{var h;return(h=i.itemRefCallback)==null?void 0:h.call(i,f,l,r)}),p=be(),g=n.useRef("touch"),y=()=>{r||(s.onValueChange(l),s.onOpenChange(!1))};if(l==="")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 c.jsx(qt,{scope:e,value:l,disabled:r,textId:p,isSelected:u,onItemTextChange:n.useCallback(f=>{x(h=>h||((f==null?void 0:f.textContent)??"").trim())},[]),children:c.jsx(ce.ItemSlot,{scope:e,value:l,disabled:r,textValue:v,children:c.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":S?"":void 0,"aria-selected":u&&S,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:w,onFocus:_(a.onFocus,()=>T(!0)),onBlur:_(a.onBlur,()=>T(!1)),onClick:_(a.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:_(a.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:_(a.onPointerDown,f=>{g.current=f.pointerType}),onPointerMove:_(a.onPointerMove,f=>{var h;g.current=f.pointerType,r?(h=i.onItemLeave)==null||h.call(i):g.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(a.onPointerLeave,f=>{var h;f.currentTarget===document.activeElement&&((h=i.onItemLeave)==null||h.call(i))}),onKeyDown:_(a.onKeyDown,f=>{var M;((M=i.searchRef)==null?void 0:M.current)!==""&&f.key===" "||(At.includes(f.key)&&y(),f.key===" "&&f.preventDefault())})})})})});Ge.displayName=ie;var se="SelectItemText",Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:l,style:r,...d}=t,a=G(se,e),s=Y(se,e),i=$e(se,e),u=kt(se,e),[v,x]=n.useState(null),S=k(o,y=>x(y),i.onItemTextChange,y=>{var f;return(f=s.itemTextRefCallback)==null?void 0:f.call(s,y,i.value,i.disabled)}),T=v==null?void 0:v.textContent,w=n.useMemo(()=>c.jsx("option",{value:i.value,disabled:i.disabled,children:T},i.value),[i.disabled,i.value,T]),{onNativeOptionAdd:p,onNativeOptionRemove:g}=u;return $(()=>(p(w),()=>g(w)),[p,g,w]),c.jsxs(c.Fragment,{children:[c.jsx(j.span,{id:i.textId,...d,ref:S}),i.isSelected&&a.valueNode&&!a.valueNodeHasChildren?_e.createPortal(d.children,a.valueNode):null]})});Ye.displayName=se;var qe="SelectItemIndicator",Ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,...l}=t;return $e(qe,e).isSelected?c.jsx(j.span,{"aria-hidden":!0,...l,ref:o}):null});Ze.displayName=qe;var we="SelectScrollUpButton",Xe=n.forwardRef((t,o)=>{const e=Y(we,t.__scopeSelect),l=Ie(we,t.__scopeSelect),[r,d]=n.useState(!1),a=k(o,l.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let s=function(){const u=i.scrollTop>0;d(u)};const i=e.viewport;return s(),i.addEventListener("scroll",s),()=>i.removeEventListener("scroll",s)}},[e.viewport,e.isPositioned]),r?c.jsx(Qe,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:i}=e;s&&i&&(s.scrollTop=s.scrollTop-i.offsetHeight)}}):null});Xe.displayName=we;var ye="SelectScrollDownButton",Je=n.forwardRef((t,o)=>{const e=Y(ye,t.__scopeSelect),l=Ie(ye,t.__scopeSelect),[r,d]=n.useState(!1),a=k(o,l.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let s=function(){const u=i.scrollHeight-i.clientHeight,v=Math.ceil(i.scrollTop)<u;d(v)};const i=e.viewport;return s(),i.addEventListener("scroll",s),()=>i.removeEventListener("scroll",s)}},[e.viewport,e.isPositioned]),r?c.jsx(Qe,{...t,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:i}=e;s&&i&&(s.scrollTop=s.scrollTop+i.offsetHeight)}}):null});Je.displayName=ye;var Qe=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:l,...r}=t,d=Y("SelectScrollButton",e),a=n.useRef(null),s=de(e),i=n.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return n.useEffect(()=>()=>i(),[i]),$(()=>{var v;const u=s().find(x=>x.ref.current===document.activeElement);(v=u==null?void 0:u.ref.current)==null||v.scrollIntoView({block:"nearest"})},[s]),c.jsx(j.div,{"aria-hidden":!0,...r,ref:o,style:{flexShrink:0,...r.style},onPointerDown:_(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(l,50))}),onPointerMove:_(r.onPointerMove,()=>{var u;(u=d.onItemLeave)==null||u.call(d),a.current===null&&(a.current=window.setInterval(l,50))}),onPointerLeave:_(r.onPointerLeave,()=>{i()})})}),Zt="SelectSeparator",Xt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...l}=t;return c.jsx(j.div,{"aria-hidden":!0,...l,ref:o})});Xt.displayName=Zt;var Ce="SelectArrow",Jt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...l}=t,r=ue(e),d=G(Ce,e),a=Y(Ce,e);return d.open&&a.position==="popper"?c.jsx(vt,{...r,...l,ref:o}):null});Jt.displayName=Ce;var Qt="SelectBubbleInput",et=n.forwardRef(({__scopeSelect:t,value:o,...e},l)=>{const r=n.useRef(null),d=k(l,r),a=xt(o);return n.useEffect(()=>{const s=r.current;if(!s)return;const i=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(i,"value").set;if(a!==o&&v){const x=new Event("change",{bubbles:!0});v.call(s,o),s.dispatchEvent(x)}},[a,o]),c.jsx(j.select,{...e,style:{...St,...e.style},ref:d,defaultValue:o})});et.displayName=Qt;function tt(t){return t===""||t===void 0}function ot(t){const o=st(t),e=n.useRef(""),l=n.useRef(0),r=n.useCallback(a=>{const s=e.current+a;o(s),(function i(u){e.current=u,window.clearTimeout(l.current),u!==""&&(l.current=window.setTimeout(()=>i(""),1e3))})(s)},[o]),d=n.useCallback(()=>{e.current="",window.clearTimeout(l.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(l.current),[]),[e,r,d]}function nt(t,o,e){const r=o.length>1&&Array.from(o).every(u=>u===o[0])?o[0]:o,d=e?t.indexOf(e):-1;let a=eo(t,Math.max(d,0));r.length===1&&(a=a.filter(u=>u!==e));const i=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return i!==e?i:void 0}function eo(t,o){return t.map((e,l)=>t[(o+l)%t.length])}var to=Me,oo=Oe,no=Le,ro=ke,so=Ve,lo=Be,ao=Ue,io=Ge,co=Ye,uo=Ze,po=Xe,fo=Je;function bo({...t}){return c.jsx(to,{"data-slot":"select",...t})}function Io({...t}){return c.jsx(no,{"data-slot":"select-value",...t})}function To({className:t,children:o,...e}){return c.jsxs(oo,{"data-slot":"select-trigger",className:te("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>span]:line-clamp-1",t),...e,children:[o,c.jsx(ro,{asChild:!0,children:c.jsx(Ne,{className:"size-4 opacity-50"})})]})}function Po({className:t,children:o,position:e="popper",...l}){return c.jsx(so,{children:c.jsxs(lo,{"data-slot":"select-content",className:te("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",e==="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",t),position:e,...l,children:[c.jsx(mo,{}),c.jsx(ao,{className:te("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),c.jsx(ho,{})]})})}function _o({className:t,children:o,...e}){return c.jsxs(io,{"data-slot":"select-item",className:te("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground 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 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...e,children:[c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(uo,{children:c.jsx(yt,{className:"size-4"})})}),c.jsx(co,{children:o})]})}function mo({className:t,...o}){return c.jsx(po,{"data-slot":"select-scroll-up-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:c.jsx(bt,{className:"size-4"})})}function ho({className:t,...o}){return c.jsx(fo,{"data-slot":"select-scroll-down-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:c.jsx(Ne,{className:"size-4"})})}export{yt as C,bo as S,To as a,Io as b,Po as c,_o as d,Le as e};
