import{l as e,$ as t,d as n,j as o,p as r,c as a,o as l,b as s,u as i,i as c,P as d,A as u,f as p,h as f,g as m,a0 as h,a1 as v,a2 as g,a3 as x,a4 as w,D as y,C as b,n as S}from"./ui-vendor-CPlxOuHz.js";import{r as C,a as j}from"./react-vendor-DjUmVRt1.js";import{V as N,e as R}from"./index-09CqdSdZ.js";import{ap as P,y as _,at as I}from"./icons-ClkGBw8e.js";function T(e,[t,n]){return Math.min(n,Math.max(t,e))}function k(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 D=[" ","Enter","ArrowUp","ArrowDown"],E=[" ","Enter"],M="Select",[L,O,A]=s(M),[H]=a(M,[A,e]),V=e(),[B,K]=H(M),[F,W]=H(M),z=e=>{const{__scopeSelect:a,children:s,open:i,defaultOpen:c,onOpenChange:d,value:u,defaultValue:p,onValueChange:f,dir:m,name:h,autoComplete:v,disabled:g,required:x,form:w}=e,y=V(a),[b,S]=C.useState(null),[j,N]=C.useState(null),[R,P]=C.useState(!1),_=t(m),[I,T]=n({prop:i,defaultProp:c??!1,onChange:d,caller:M}),[k,D]=n({prop:u,defaultProp:p,onChange:f,caller:M}),E=C.useRef(null),O=!b||(w||!!b.closest("form")),[A,H]=C.useState(new Set),K=Array.from(A).map(e=>e.props.value).join(";");return o.jsx(r,{...y,children:o.jsxs(B,{required:x,scope:a,trigger:b,onTriggerChange:S,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:R,onValueNodeHasChildrenChange:P,contentId:l(),value:k,onValueChange:D,open:I,onOpenChange:T,dir:_,triggerPointerDownPosRef:E,disabled:g,children:[o.jsx(L.Provider,{scope:a,children:o.jsx(F,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(e=>{H(t=>new Set(t).add(e))},[]),onNativeOptionRemove:C.useCallback(e=>{H(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:s})}),O?o.jsxs(Te,{"aria-hidden":!0,required:x,tabIndex:-1,name:h,autoComplete:v,value:k,onChange:e=>D(e.target.value),disabled:g,form:w,children:[void 0===k?o.jsx("option",{value:""}):null,Array.from(A)]},K):null]})})};z.displayName=M;var U="SelectTrigger",q=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,l=V(n),s=K(U,n),c=s.disabled||r,f=i(t,s.onTriggerChange),m=O(n),h=C.useRef("touch"),[v,g,x]=De(e=>{const t=m().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),o=Ee(t,e,n);void 0!==o&&s.onValueChange(o.value)}),w=e=>{c||(s.onOpenChange(!0),x()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return o.jsx(u,{asChild:!0,...l,children:o.jsx(d.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":ke(s.value)?"":void 0,...a,ref:f,onClick:p(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==h.current&&w(e)}),onPointerDown:p(a.onPointerDown,e=>{h.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(w(e),e.preventDefault())}),onKeyDown:p(a.onKeyDown,e=>{const t=""!==v.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||g(e.key),t&&" "===e.key||D.includes(e.key)&&(w(),e.preventDefault())})})})});q.displayName=U;var X="SelectValue",Y=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:l,placeholder:s="",...u}=e,p=K(X,n),{onValueNodeHasChildrenChange:f}=p,m=void 0!==l,h=i(t,p.onValueNodeChange);return c(()=>{f(m)},[f,m]),o.jsx(d.span,{...u,ref:h,style:{pointerEvents:"none"},children:ke(p.value)?o.jsx(o.Fragment,{children:s}):l})});Y.displayName=X;var $=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return o.jsx(d.span,{"aria-hidden":!0,...a,ref:t,children:r||"â–¼"})});$.displayName="SelectIcon";var G=e=>o.jsx(f,{asChild:!0,...e});G.displayName="SelectPortal";var Z="SelectContent",J=C.forwardRef((e,t)=>{const n=K(Z,e.__scopeSelect),[r,a]=C.useState();if(c(()=>{a(new DocumentFragment)},[]),!n.open){const t=r;return t?j.createPortal(o.jsx(ee,{scope:e.__scopeSelect,children:o.jsx(L.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),t):null}return o.jsx(oe,{...e,ref:t})});J.displayName=Z;var Q=10,[ee,te]=H(Z),ne=x("SelectContent.RemoveScroll"),oe=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:l,onPointerDownOutside:s,side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:x,collisionPadding:b,sticky:S,hideWhenDetached:j,avoidCollisions:N,...R}=e,P=K(Z,n),[_,I]=C.useState(null),[T,k]=C.useState(null),D=i(t,e=>I(e)),[E,M]=C.useState(null),[L,A]=C.useState(null),H=O(n),[V,B]=C.useState(!1),F=C.useRef(!1);C.useEffect(()=>{if(_)return h(_)},[_]),v();const W=C.useCallback(e=>{const[t,...n]=H().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const a of e){if(a===r)return;if(null==a||a.scrollIntoView({block:"nearest"}),a===t&&T&&(T.scrollTop=0),a===o&&T&&(T.scrollTop=T.scrollHeight),null==a||a.focus(),document.activeElement!==r)return}},[H,T]),z=C.useCallback(()=>W([E,_]),[W,E,_]);C.useEffect(()=>{V&&z()},[V,z]);const{onOpenChange:U,triggerPointerDownPosRef:q}=P;C.useEffect(()=>{if(_){let e={x:0,y:0};const t=t=>{var n,o;e={x:Math.abs(Math.round(t.pageX)-((null==(n=q.current)?void 0:n.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(o=q.current)?void 0:o.y)??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():_.contains(n.target)||U(!1),document.removeEventListener("pointermove",t),q.current=null};return null!==q.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[_,U,q]),C.useEffect(()=>{const e=()=>U(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[U]);const[X,Y]=De(e=>{const t=H().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=Ee(t,e,n);o&&setTimeout(()=>o.ref.current.focus())}),$=C.useCallback((e,t,n)=>{const o=!F.current&&!n;(void 0!==P.value&&P.value===t||o)&&(M(e),o&&(F.current=!0))},[P.value]),G=C.useCallback(()=>null==_?void 0:_.focus(),[_]),J=C.useCallback((e,t,n)=>{const o=!F.current&&!n;(void 0!==P.value&&P.value===t||o)&&A(e)},[P.value]),Q="popper"===r?ae:re,te=Q===ae?{side:c,sideOffset:d,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:x,collisionPadding:b,sticky:S,hideWhenDetached:j,avoidCollisions:N}:{};return o.jsx(ee,{scope:n,content:_,viewport:T,onViewportChange:k,itemRefCallback:$,selectedItem:E,onItemLeave:G,itemTextRefCallback:J,focusSelectedItem:z,selectedItemText:L,position:r,isPositioned:V,searchRef:X,children:o.jsx(g,{as:ne,allowPinchZoom:!0,children:o.jsx(w,{asChild:!0,trapped:P.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:p(a,e=>{var t;null==(t=P.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:o.jsx(y,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>P.onOpenChange(!1),children:o.jsx(Q,{role:"listbox",id:P.contentId,"data-state":P.open?"open":"closed",dir:P.dir,onContextMenu:e=>e.preventDefault(),...R,...te,onPlaced:()=>B(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:p(R.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||Y(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=H().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>W(t)),e.preventDefault()}})})})})})})});oe.displayName="SelectContentImpl";var re=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,l=K(Z,n),s=te(Z,n),[u,p]=C.useState(null),[f,m]=C.useState(null),h=i(t,e=>m(e)),v=O(n),g=C.useRef(!1),x=C.useRef(!0),{viewport:w,selectedItem:y,selectedItemText:b,focusSelectedItem:S}=s,j=C.useCallback(()=>{if(l.trigger&&l.valueNode&&u&&f&&w&&y&&b){const e=l.trigger.getBoundingClientRect(),t=f.getBoundingClientRect(),n=l.valueNode.getBoundingClientRect(),o=b.getBoundingClientRect();if("rtl"!==l.dir){const r=o.left-t.left,a=n.left-r,l=e.left-a,s=e.width+l,i=Math.max(s,t.width),c=window.innerWidth-Q,d=T(a,[Q,Math.max(Q,c-i)]);u.style.minWidth=s+"px",u.style.left=d+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,l=window.innerWidth-e.right-a,s=e.width+l,i=Math.max(s,t.width),c=window.innerWidth-Q,d=T(a,[Q,Math.max(Q,c-i)]);u.style.minWidth=s+"px",u.style.right=d+"px"}const a=v(),s=window.innerHeight-2*Q,i=w.scrollHeight,c=window.getComputedStyle(f),d=parseInt(c.borderTopWidth,10),p=parseInt(c.paddingTop,10),m=parseInt(c.borderBottomWidth,10),h=d+p+i+parseInt(c.paddingBottom,10)+m,x=Math.min(5*y.offsetHeight,h),S=window.getComputedStyle(w),C=parseInt(S.paddingTop,10),j=parseInt(S.paddingBottom,10),N=e.top+e.height/2-Q,R=s-N,P=y.offsetHeight/2,_=d+p+(y.offsetTop+P),I=h-_;if(_<=N){const e=a.length>0&&y===a[a.length-1].ref.current;u.style.bottom="0px";const t=f.clientHeight-w.offsetTop-w.offsetHeight,n=_+Math.max(R,P+(e?j:0)+t+m);u.style.height=n+"px"}else{const e=a.length>0&&y===a[0].ref.current;u.style.top="0px";const t=Math.max(N,d+w.offsetTop+(e?C:0)+P)+I;u.style.height=t+"px",w.scrollTop=_-N+w.offsetTop}u.style.margin=`${Q}px 0`,u.style.minHeight=x+"px",u.style.maxHeight=s+"px",null==r||r(),requestAnimationFrame(()=>g.current=!0)}},[v,l.trigger,l.valueNode,u,f,w,y,b,l.dir,r]);c(()=>j(),[j]);const[N,R]=C.useState();c(()=>{f&&R(window.getComputedStyle(f).zIndex)},[f]);const P=C.useCallback(e=>{e&&!0===x.current&&(j(),null==S||S(),x.current=!1)},[j,S]);return o.jsx(le,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:P,children:o.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:o.jsx(d.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});re.displayName="SelectItemAlignedPosition";var ae=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Q,...l}=e,s=V(n);return o.jsx(b,{...s,...l,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...l.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)"}})});ae.displayName="SelectPopperPosition";var[le,se]=H(Z,{}),ie="SelectViewport",ce=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,l=te(ie,n),s=se(ie,n),c=i(t,l.onViewportChange),u=C.useRef(0);return o.jsxs(o.Fragment,{children:[o.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:r}),o.jsx(L.Slot,{scope:n,children:o.jsx(d.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:p(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=s;if((null==o?void 0:o.current)&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*Q,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),l=Math.max(r,a);if(l<o){const r=l+e,a=Math.min(o,r),s=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});ce.displayName=ie;var de="SelectGroup",[ue,pe]=H(de);C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=l();return o.jsx(ue,{scope:n,id:a,children:o.jsx(d.div,{role:"group","aria-labelledby":a,...r,ref:t})})}).displayName=de;var fe="SelectLabel",me=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=pe(fe,n);return o.jsx(d.div,{id:a.id,...r,ref:t})});me.displayName=fe;var he="SelectItem",[ve,ge]=H(he),xe=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:s,...c}=e,u=K(he,n),f=te(he,n),m=u.value===r,[h,v]=C.useState(s??""),[g,x]=C.useState(!1),w=i(t,e=>{var t;return null==(t=f.itemRefCallback)?void 0:t.call(f,e,r,a)}),y=l(),b=C.useRef("touch"),S=()=>{a||(u.onValueChange(r),u.onOpenChange(!1))};if(""===r)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 o.jsx(ve,{scope:n,value:r,disabled:a,textId:y,isSelected:m,onItemTextChange:C.useCallback(e=>{v(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:o.jsx(L.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:o.jsx(d.div,{role:"option","aria-labelledby":y,"data-highlighted":g?"":void 0,"aria-selected":m&&g,"data-state":m?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...c,ref:w,onFocus:p(c.onFocus,()=>x(!0)),onBlur:p(c.onBlur,()=>x(!1)),onClick:p(c.onClick,()=>{"mouse"!==b.current&&S()}),onPointerUp:p(c.onPointerUp,()=>{"mouse"===b.current&&S()}),onPointerDown:p(c.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:p(c.onPointerMove,e=>{var t;b.current=e.pointerType,a?null==(t=f.onItemLeave)||t.call(f):"mouse"===b.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:p(c.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=f.onItemLeave)||t.call(f))}),onKeyDown:p(c.onKeyDown,e=>{var t;""!==(null==(t=f.searchRef)?void 0:t.current)&&" "===e.key||(E.includes(e.key)&&S()," "===e.key&&e.preventDefault())})})})})});xe.displayName=he;var we="SelectItemText",ye=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...l}=e,s=K(we,n),u=te(we,n),p=ge(we,n),f=W(we,n),[m,h]=C.useState(null),v=i(t,e=>h(e),p.onItemTextChange,e=>{var t;return null==(t=u.itemTextRefCallback)?void 0:t.call(u,e,p.value,p.disabled)}),g=null==m?void 0:m.textContent,x=C.useMemo(()=>o.jsx("option",{value:p.value,disabled:p.disabled,children:g},p.value),[p.disabled,p.value,g]),{onNativeOptionAdd:w,onNativeOptionRemove:y}=f;return c(()=>(w(x),()=>y(x)),[w,y,x]),o.jsxs(o.Fragment,{children:[o.jsx(d.span,{id:p.textId,...l,ref:v}),p.isSelected&&s.valueNode&&!s.valueNodeHasChildren?j.createPortal(l.children,s.valueNode):null]})});ye.displayName=we;var be="SelectItemIndicator",Se=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ge(be,n).isSelected?o.jsx(d.span,{"aria-hidden":!0,...r,ref:t}):null});Se.displayName=be;var Ce="SelectScrollUpButton",je=C.forwardRef((e,t)=>{const n=te(Ce,e.__scopeSelect),r=se(Ce,e.__scopeSelect),[a,l]=C.useState(!1),s=i(t,r.onScrollButtonChange);return c(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;l(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?o.jsx(Pe,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});je.displayName=Ce;var Ne="SelectScrollDownButton",Re=C.forwardRef((e,t)=>{const n=te(Ne,e.__scopeSelect),r=se(Ne,e.__scopeSelect),[a,l]=C.useState(!1),s=i(t,r.onScrollButtonChange);return c(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;l(n)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?o.jsx(Pe,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Re.displayName=Ne;var Pe=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,l=te("SelectScrollButton",n),s=C.useRef(null),i=O(n),u=C.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return C.useEffect(()=>()=>u(),[u]),c(()=>{var e;const t=i().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[i]),o.jsx(d.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:p(a.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(r,50))}),onPointerMove:p(a.onPointerMove,()=>{var e;null==(e=l.onItemLeave)||e.call(l),null===s.current&&(s.current=window.setInterval(r,50))}),onPointerLeave:p(a.onPointerLeave,()=>{u()})})}),_e=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(d.div,{"aria-hidden":!0,...r,ref:t})});_e.displayName="SelectSeparator";var Ie="SelectArrow";C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=V(n),l=K(Ie,n),s=te(Ie,n);return l.open&&"popper"===s.position?o.jsx(S,{...a,...r,ref:t}):null}).displayName=Ie;var Te=C.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=C.useRef(null),l=i(r,a),s=k(t);return C.useEffect(()=>{const e=a.current;if(!e)return;const n=window.HTMLSelectElement.prototype,o=Object.getOwnPropertyDescriptor(n,"value").set;if(s!==t&&o){const n=new Event("change",{bubbles:!0});o.call(e,t),e.dispatchEvent(n)}},[s,t]),o.jsx(d.select,{...n,style:{...N,...n.style},ref:l,defaultValue:t})});function ke(e){return""===e||void 0===e}function De(e){const t=m(e),n=C.useRef(""),o=C.useRef(0),r=C.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),a=C.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,r,a]}function Ee(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let a=(l=e,s=Math.max(r,0),l.map((e,t)=>l[(s+t)%l.length]));var l,s;1===o.length&&(a=a.filter(e=>e!==n));const i=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return i!==n?i:void 0}Te.displayName="SelectBubbleInput";var Me=q,Le=$,Oe=G,Ae=J,He=ce,Ve=me,Be=xe,Ke=ye,Fe=Se,We=je,ze=Re,Ue=_e;const qe=z,Xe=Y,Ye=C.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Me,{ref:r,className:R("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,o.jsx(Le,{asChild:!0,children:o.jsx(P,{className:"h-4 w-4 opacity-50"})})]}));Ye.displayName=Me.displayName;const $e=C.forwardRef(({className:e,...t},n)=>o.jsx(We,{ref:n,className:R("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(I,{className:"h-4 w-4"})}));$e.displayName=We.displayName;const Ge=C.forwardRef(({className:e,...t},n)=>o.jsx(ze,{ref:n,className:R("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(P,{className:"h-4 w-4"})}));Ge.displayName=ze.displayName;const Ze=C.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>o.jsx(Oe,{children:o.jsxs(Ae,{ref:a,className:R("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"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,...r,children:[o.jsx($e,{}),o.jsx(He,{className:R("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(Ge,{})]})}));Ze.displayName=Ae.displayName;C.forwardRef(({className:e,...t},n)=>o.jsx(Ve,{ref:n,className:R("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t})).displayName=Ve.displayName;const Je=C.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Be,{ref:r,className:R("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Fe,{children:o.jsx(_,{className:"h-4 w-4"})})}),o.jsx(Ke,{children:t})]}));Je.displayName=Be.displayName;C.forwardRef(({className:e,...t},n)=>o.jsx(Ue,{ref:n,className:R("-mx-1 my-1 h-px bg-muted",e),...t})).displayName=Ue.displayName;export{qe as S,Ye as a,Xe as b,Ze as c,Je as d,k as u};