Files
aiops/backend/static/assets/select-CGtvCG8I.js
T

2 lines
23 KiB
JavaScript

import{r as n,j as a,an as ot,ao as Pe,af as nt,ab as Te,ap as rt,a8 as st,ag as Ie,aq as at,ac as L,ar as lt,aa as j,ad as E,as as $,at as ct,au as Re,av as it,aw as dt,ax as ut,ay as pt,az as ft,aA as mt,aB as ht,aC as gt,aD as Ee,aE as vt,$ as te,V as Ne,K as xt}from"./index-CwVkcMR-.js";import{u as St}from"./index-CBIZnJrN.js";import{C as wt}from"./chevron-up-DM77dvsL.js";function Ct(t){const o=yt(t),e=n.forwardRef((s,r)=>{const{children:d,...l}=s,c=n.Children.toArray(d),i=c.find(bt);if(i){const p=i.props.children,g=c.map(x=>x===i?n.Children.count(p)>1?n.Children.only(null):n.isValidElement(p)?p.props.children:null:x);return a.jsx(o,{...l,ref:r,children:n.isValidElement(p)?n.cloneElement(p,void 0,g):null})}return a.jsx(o,{...l,ref:r,children:d})});return e.displayName=`${t}.Slot`,e}function yt(t){const o=n.forwardRef((e,s)=>{const{children:r,...d}=e;if(n.isValidElement(r)){const l=Et(r),c=Tt(d,r.props);return r.type!==n.Fragment&&(c.ref=s?ot(s,l):l),n.cloneElement(r,c)}return n.Children.count(r)>1?n.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var It=Symbol("radix.slottable");function bt(t){return n.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===It}function Tt(t,o){const e={...o};for(const s in o){const r=t[s],d=o[s];/^on[A-Z]/.test(s)?r&&d?e[s]=(...c)=>{const i=d(...c);return r(...c),i}:r&&(e[s]=r):s==="style"?e[s]={...r,...d}:s==="className"&&(e[s]=[r,d].filter(Boolean).join(" "))}return{...t,...e}}function Et(t){let o=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,e=o&&"isReactWarning"in o&&o.isReactWarning;return e?t.ref:(o=Object.getOwnPropertyDescriptor(t,"ref")?.get,e=o&&"isReactWarning"in o&&o.isReactWarning,e?t.props.ref:t.props.ref||t.ref)}var Pt=[" ","Enter","ArrowUp","ArrowDown"],Rt=[" ","Enter"],J="Select",[ie,de,Nt]=at(J),[oe]=st(J,[Nt,Pe]),ue=Pe(),[_t,G]=oe(J),[jt,At]=oe(J),_e=t=>{const{__scopeSelect:o,children:e,open:s,defaultOpen:r,onOpenChange:d,value:l,defaultValue:c,onValueChange:i,dir:p,name:g,autoComplete:x,disabled:P,required:b,form:y}=t,u=ue(o),[h,S]=n.useState(null),[m,v]=n.useState(null),[F,A]=n.useState(!1),ne=nt(p),[R,O]=Te({prop:s,defaultProp:r??!1,onChange:d,caller:J}),[U,q]=Te({prop:l,defaultProp:c,onChange:i,caller:J}),k=n.useRef(null),V=h?y||!!h.closest("form"):!0,[z,B]=n.useState(new Set),H=Array.from(z).map(N=>N.props.value).join(";");return a.jsx(rt,{...u,children:a.jsxs(_t,{required:b,scope:o,trigger:h,onTriggerChange:S,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:F,onValueNodeHasChildrenChange:A,contentId:Ie(),value:U,onValueChange:q,open:R,onOpenChange:O,dir:ne,triggerPointerDownPosRef:k,disabled:P,children:[a.jsx(ie.Provider,{scope:o,children:a.jsx(jt,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(N=>{B(D=>new Set(D).add(N))},[]),onNativeOptionRemove:n.useCallback(N=>{B(D=>{const W=new Set(D);return W.delete(N),W})},[]),children:e})}),V?a.jsxs(Je,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:x,value:U,onChange:N=>q(N.target.value),disabled:P,form:y,children:[U===void 0?a.jsx("option",{value:""}):null,Array.from(z)]},H):null]})})};_e.displayName=J;var je="SelectTrigger",Ae=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:s=!1,...r}=t,d=ue(e),l=G(je,e),c=l.disabled||s,i=L(o,l.onTriggerChange),p=de(e),g=n.useRef("touch"),[x,P,b]=et(u=>{const h=p().filter(v=>!v.disabled),S=h.find(v=>v.value===l.value),m=tt(h,u,S);m!==void 0&&l.onValueChange(m.value)}),y=u=>{c||(l.onOpenChange(!0),b()),u&&(l.triggerPointerDownPosRef.current={x:Math.round(u.pageX),y:Math.round(u.pageY)})};return a.jsx(lt,{asChild:!0,...d,children:a.jsx(j.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Qe(l.value)?"":void 0,...r,ref:i,onClick:E(r.onClick,u=>{u.currentTarget.focus(),g.current!=="mouse"&&y(u)}),onPointerDown:E(r.onPointerDown,u=>{g.current=u.pointerType;const h=u.target;h.hasPointerCapture(u.pointerId)&&h.releasePointerCapture(u.pointerId),u.button===0&&u.ctrlKey===!1&&u.pointerType==="mouse"&&(y(u),u.preventDefault())}),onKeyDown:E(r.onKeyDown,u=>{const h=x.current!=="";!(u.ctrlKey||u.altKey||u.metaKey)&&u.key.length===1&&P(u.key),!(h&&u.key===" ")&&Pt.includes(u.key)&&(y(),u.preventDefault())})})})});Ae.displayName=je;var Me="SelectValue",Oe=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,children:d,placeholder:l="",...c}=t,i=G(Me,e),{onValueNodeHasChildrenChange:p}=i,g=d!==void 0,x=L(o,i.onValueNodeChange);return $(()=>{p(g)},[p,g]),a.jsx(j.span,{...c,ref:x,style:{pointerEvents:"none"},children:Qe(i.value)?a.jsx(a.Fragment,{children:l}):d})});Oe.displayName=Me;var Mt="SelectIcon",De=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,...r}=t;return a.jsx(j.span,{"aria-hidden":!0,...r,ref:o,children:s||"▼"})});De.displayName=Mt;var Ot="SelectPortal",Le=t=>a.jsx(ct,{asChild:!0,...t});Le.displayName=Ot;var Q="SelectContent",ke=n.forwardRef((t,o)=>{const e=G(Q,t.__scopeSelect),[s,r]=n.useState();if($(()=>{r(new DocumentFragment)},[]),!e.open){const d=s;return d?Re.createPortal(a.jsx(Ve,{scope:t.__scopeSelect,children:a.jsx(ie.Slot,{scope:t.__scopeSelect,children:a.jsx("div",{children:t.children})})}),d):null}return a.jsx(Be,{...t,ref:o})});ke.displayName=Q;var M=10,[Ve,Y]=oe(Q),Dt="SelectContentImpl",Lt=Ct("SelectContent.RemoveScroll"),Be=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:s="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:d,onPointerDownOutside:l,side:c,sideOffset:i,align:p,alignOffset:g,arrowPadding:x,collisionBoundary:P,collisionPadding:b,sticky:y,hideWhenDetached:u,avoidCollisions:h,...S}=t,m=G(Q,e),[v,F]=n.useState(null),[A,ne]=n.useState(null),R=L(o,f=>F(f)),[O,U]=n.useState(null),[q,k]=n.useState(null),V=de(e),[z,B]=n.useState(!1),H=n.useRef(!1);n.useEffect(()=>{if(v)return ut(v)},[v]),pt();const N=n.useCallback(f=>{const[I,..._]=V().map(T=>T.ref.current),[w]=_.slice(-1),C=document.activeElement;for(const T of f)if(T===C||(T?.scrollIntoView({block:"nearest"}),T===I&&A&&(A.scrollTop=0),T===w&&A&&(A.scrollTop=A.scrollHeight),T?.focus(),document.activeElement!==C))return},[V,A]),D=n.useCallback(()=>N([O,v]),[N,O,v]);n.useEffect(()=>{z&&D()},[z,D]);const{onOpenChange:W,triggerPointerDownPosRef:K}=m;n.useEffect(()=>{if(v){let f={x:0,y:0};const I=w=>{f={x:Math.abs(Math.round(w.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(w.pageY)-(K.current?.y??0))}},_=w=>{f.x<=10&&f.y<=10?w.preventDefault():v.contains(w.target)||W(!1),document.removeEventListener("pointermove",I),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",_,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",_,{capture:!0})}}},[v,W,K]),n.useEffect(()=>{const f=()=>W(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[W]);const[pe,ae]=et(f=>{const I=V().filter(C=>!C.disabled),_=I.find(C=>C.ref.current===document.activeElement),w=tt(I,f,_);w&&setTimeout(()=>w.ref.current.focus())}),fe=n.useCallback((f,I,_)=>{const w=!H.current&&!_;(m.value!==void 0&&m.value===I||w)&&(U(f),w&&(H.current=!0))},[m.value]),me=n.useCallback(()=>v?.focus(),[v]),ee=n.useCallback((f,I,_)=>{const w=!H.current&&!_;(m.value!==void 0&&m.value===I||w)&&k(f)},[m.value]),le=s==="popper"?xe:He,re=le===xe?{side:c,sideOffset:i,align:p,alignOffset:g,arrowPadding:x,collisionBoundary:P,collisionPadding:b,sticky:y,hideWhenDetached:u,avoidCollisions:h}:{};return a.jsx(Ve,{scope:e,content:v,viewport:A,onViewportChange:ne,itemRefCallback:fe,selectedItem:O,onItemLeave:me,itemTextRefCallback:ee,focusSelectedItem:D,selectedItemText:q,position:s,isPositioned:z,searchRef:pe,children:a.jsx(ft,{as:Lt,allowPinchZoom:!0,children:a.jsx(mt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:E(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:a.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:a.jsx(le,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...S,...re,onPlaced:()=>B(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:E(S.onKeyDown,f=>{const I=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!I&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let w=V().filter(C=>!C.disabled).map(C=>C.ref.current);if(["ArrowUp","End"].includes(f.key)&&(w=w.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const C=f.target,T=w.indexOf(C);w=w.slice(T+1)}setTimeout(()=>N(w)),f.preventDefault()}})})})})})})});Be.displayName=Dt;var kt="SelectItemAlignedPosition",He=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:s,...r}=t,d=G(Q,e),l=Y(Q,e),[c,i]=n.useState(null),[p,g]=n.useState(null),x=L(o,R=>g(R)),P=de(e),b=n.useRef(!1),y=n.useRef(!0),{viewport:u,selectedItem:h,selectedItemText:S,focusSelectedItem:m}=l,v=n.useCallback(()=>{if(d.trigger&&d.valueNode&&c&&p&&u&&h&&S){const R=d.trigger.getBoundingClientRect(),O=p.getBoundingClientRect(),U=d.valueNode.getBoundingClientRect(),q=S.getBoundingClientRect();if(d.dir!=="rtl"){const C=q.left-O.left,T=U.left-C,Z=R.left-T,X=R.width+Z,he=Math.max(X,O.width),ge=window.innerWidth-M,ve=Ee(T,[M,Math.max(M,ge-he)]);c.style.minWidth=X+"px",c.style.left=ve+"px"}else{const C=O.right-q.right,T=window.innerWidth-U.right-C,Z=window.innerWidth-R.right-T,X=R.width+Z,he=Math.max(X,O.width),ge=window.innerWidth-M,ve=Ee(T,[M,Math.max(M,ge-he)]);c.style.minWidth=X+"px",c.style.right=ve+"px"}const k=P(),V=window.innerHeight-M*2,z=u.scrollHeight,B=window.getComputedStyle(p),H=parseInt(B.borderTopWidth,10),N=parseInt(B.paddingTop,10),D=parseInt(B.borderBottomWidth,10),W=parseInt(B.paddingBottom,10),K=H+N+z+W+D,pe=Math.min(h.offsetHeight*5,K),ae=window.getComputedStyle(u),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),ee=R.top+R.height/2-M,le=V-ee,re=h.offsetHeight/2,f=h.offsetTop+re,I=H+N+f,_=K-I;if(I<=ee){const C=k.length>0&&h===k[k.length-1].ref.current;c.style.bottom="0px";const T=p.clientHeight-u.offsetTop-u.offsetHeight,Z=Math.max(le,re+(C?me:0)+T+D),X=I+Z;c.style.height=X+"px"}else{const C=k.length>0&&h===k[0].ref.current;c.style.top="0px";const Z=Math.max(ee,H+u.offsetTop+(C?fe:0)+re)+_;c.style.height=Z+"px",u.scrollTop=I-ee+u.offsetTop}c.style.margin=`${M}px 0`,c.style.minHeight=pe+"px",c.style.maxHeight=V+"px",s?.(),requestAnimationFrame(()=>b.current=!0)}},[P,d.trigger,d.valueNode,c,p,u,h,S,d.dir,s]);$(()=>v(),[v]);const[F,A]=n.useState();$(()=>{p&&A(window.getComputedStyle(p).zIndex)},[p]);const ne=n.useCallback(R=>{R&&y.current===!0&&(v(),m?.(),y.current=!1)},[v,m]);return a.jsx(Bt,{scope:e,contentWrapper:c,shouldExpandOnScrollRef:b,onScrollButtonChange:ne,children:a.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:a.jsx(j.div,{...r,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});He.displayName=kt;var Vt="SelectPopperPosition",xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:s="start",collisionPadding:r=M,...d}=t,l=ue(e);return a.jsx(gt,{...l,...d,ref:o,align:s,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=Vt;var[Bt,be]=oe(Q,{}),Se="SelectViewport",We=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:s,...r}=t,d=Y(Se,e),l=be(Se,e),c=L(o,d.onViewportChange),i=n.useRef(0);return a.jsxs(a.Fragment,{children:[a.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:s}),a.jsx(ie.Slot,{scope:e,children:a.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E(r.onScroll,p=>{const g=p.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:P}=l;if(P?.current&&x){const b=Math.abs(i.current-g.scrollTop);if(b>0){const y=window.innerHeight-M*2,u=parseFloat(x.style.minHeight),h=parseFloat(x.style.height),S=Math.max(u,h);if(S<y){const m=S+b,v=Math.min(y,m),F=m-v;x.style.height=v+"px",x.style.bottom==="0px"&&(g.scrollTop=F>0?F:0,x.style.justifyContent="flex-end")}}}i.current=g.scrollTop})})})]})});We.displayName=Se;var Fe="SelectGroup",[Ht,Wt]=oe(Fe),Ft=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Ie();return a.jsx(Ht,{scope:e,id:r,children:a.jsx(j.div,{role:"group","aria-labelledby":r,...s,ref:o})})});Ft.displayName=Fe;var Ue="SelectLabel",Ut=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Wt(Ue,e);return a.jsx(j.div,{id:r.id,...s,ref:o})});Ut.displayName=Ue;var ce="SelectItem",[zt,ze]=oe(ce),Ke=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:s,disabled:r=!1,textValue:d,...l}=t,c=G(ce,e),i=Y(ce,e),p=c.value===s,[g,x]=n.useState(d??""),[P,b]=n.useState(!1),y=L(o,m=>i.itemRefCallback?.(m,s,r)),u=Ie(),h=n.useRef("touch"),S=()=>{r||(c.onValueChange(s),c.onOpenChange(!1))};if(s==="")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 a.jsx(zt,{scope:e,value:s,disabled:r,textId:u,isSelected:p,onItemTextChange:n.useCallback(m=>{x(v=>v||(m?.textContent??"").trim())},[]),children:a.jsx(ie.ItemSlot,{scope:e,value:s,disabled:r,textValue:g,children:a.jsx(j.div,{role:"option","aria-labelledby":u,"data-highlighted":P?"":void 0,"aria-selected":p&&P,"data-state":p?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...l,ref:y,onFocus:E(l.onFocus,()=>b(!0)),onBlur:E(l.onBlur,()=>b(!1)),onClick:E(l.onClick,()=>{h.current!=="mouse"&&S()}),onPointerUp:E(l.onPointerUp,()=>{h.current==="mouse"&&S()}),onPointerDown:E(l.onPointerDown,m=>{h.current=m.pointerType}),onPointerMove:E(l.onPointerMove,m=>{h.current=m.pointerType,r?i.onItemLeave?.():h.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E(l.onPointerLeave,m=>{m.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:E(l.onKeyDown,m=>{i.searchRef?.current!==""&&m.key===" "||(Rt.includes(m.key)&&S(),m.key===" "&&m.preventDefault())})})})})});Ke.displayName=ce;var se="SelectItemText",$e=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,...d}=t,l=G(se,e),c=Y(se,e),i=ze(se,e),p=At(se,e),[g,x]=n.useState(null),P=L(o,S=>x(S),i.onItemTextChange,S=>c.itemTextRefCallback?.(S,i.value,i.disabled)),b=g?.textContent,y=n.useMemo(()=>a.jsx("option",{value:i.value,disabled:i.disabled,children:b},i.value),[i.disabled,i.value,b]),{onNativeOptionAdd:u,onNativeOptionRemove:h}=p;return $(()=>(u(y),()=>h(y)),[u,h,y]),a.jsxs(a.Fragment,{children:[a.jsx(j.span,{id:i.textId,...d,ref:P}),i.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Re.createPortal(d.children,l.valueNode):null]})});$e.displayName=se;var Ge="SelectItemIndicator",Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return ze(Ge,e).isSelected?a.jsx(j.span,{"aria-hidden":!0,...s,ref:o}):null});Ye.displayName=Ge;var we="SelectScrollUpButton",qe=n.forwardRef((t,o)=>{const e=Y(we,t.__scopeSelect),s=be(we,t.__scopeSelect),[r,d]=n.useState(!1),l=L(o,s.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let c=function(){const p=i.scrollTop>0;d(p)};const i=e.viewport;return c(),i.addEventListener("scroll",c),()=>i.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),r?a.jsx(Xe,{...t,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:i}=e;c&&i&&(c.scrollTop=c.scrollTop-i.offsetHeight)}}):null});qe.displayName=we;var Ce="SelectScrollDownButton",Ze=n.forwardRef((t,o)=>{const e=Y(Ce,t.__scopeSelect),s=be(Ce,t.__scopeSelect),[r,d]=n.useState(!1),l=L(o,s.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let c=function(){const p=i.scrollHeight-i.clientHeight,g=Math.ceil(i.scrollTop)<p;d(g)};const i=e.viewport;return c(),i.addEventListener("scroll",c),()=>i.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),r?a.jsx(Xe,{...t,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:i}=e;c&&i&&(c.scrollTop=c.scrollTop+i.offsetHeight)}}):null});Ze.displayName=Ce;var Xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:s,...r}=t,d=Y("SelectScrollButton",e),l=n.useRef(null),c=de(e),i=n.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return n.useEffect(()=>()=>i(),[i]),$(()=>{c().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),a.jsx(j.div,{"aria-hidden":!0,...r,ref:o,style:{flexShrink:0,...r.style},onPointerDown:E(r.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(s,50))}),onPointerMove:E(r.onPointerMove,()=>{d.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(s,50))}),onPointerLeave:E(r.onPointerLeave,()=>{i()})})}),Kt="SelectSeparator",$t=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return a.jsx(j.div,{"aria-hidden":!0,...s,ref:o})});$t.displayName=Kt;var ye="SelectArrow",Gt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=ue(e),d=G(ye,e),l=Y(ye,e);return d.open&&l.position==="popper"?a.jsx(vt,{...r,...s,ref:o}):null});Gt.displayName=ye;var Yt="SelectBubbleInput",Je=n.forwardRef(({__scopeSelect:t,value:o,...e},s)=>{const r=n.useRef(null),d=L(s,r),l=St(o);return n.useEffect(()=>{const c=r.current;if(!c)return;const i=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(i,"value").set;if(l!==o&&g){const x=new Event("change",{bubbles:!0});g.call(c,o),c.dispatchEvent(x)}},[l,o]),a.jsx(j.select,{...e,style:{...it,...e.style},ref:d,defaultValue:o})});Je.displayName=Yt;function Qe(t){return t===""||t===void 0}function et(t){const o=dt(t),e=n.useRef(""),s=n.useRef(0),r=n.useCallback(l=>{const c=e.current+l;o(c),(function i(p){e.current=p,window.clearTimeout(s.current),p!==""&&(s.current=window.setTimeout(()=>i(""),1e3))})(c)},[o]),d=n.useCallback(()=>{e.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[e,r,d]}function tt(t,o,e){const r=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,d=e?t.indexOf(e):-1;let l=qt(t,Math.max(d,0));r.length===1&&(l=l.filter(p=>p!==e));const i=l.find(p=>p.textValue.toLowerCase().startsWith(r.toLowerCase()));return i!==e?i:void 0}function qt(t,o){return t.map((e,s)=>t[(o+s)%t.length])}var Zt=_e,Xt=Ae,Jt=Oe,Qt=De,eo=Le,to=ke,oo=We,no=Ke,ro=$e,so=Ye,ao=qe,lo=Ze;function mo({...t}){return a.jsx(Zt,{"code-path":"src/components/ui/select.tsx:10:10","data-slot":"select",...t})}function ho({...t}){return a.jsx(Jt,{"code-path":"src/components/ui/select.tsx:22:10","data-slot":"select-value",...t})}function go({className:t,size:o="default",children:e,...s}){return a.jsxs(Xt,{"code-path":"src/components/ui/select.tsx:34:5","data-slot":"select-trigger","data-size":o,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 dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...s,children:[e,a.jsx(Qt,{"code-path":"src/components/ui/select.tsx:44:7",asChild:!0,children:a.jsx(Ne,{"code-path":"src/components/ui/select.tsx:45:9",className:"size-4 opacity-50"})})]})}function vo({className:t,children:o,position:e="item-aligned",align:s="center",...r}){return a.jsx(eo,{"code-path":"src/components/ui/select.tsx:59:5",children:a.jsxs(to,{"code-path":"src/components/ui/select.tsx:60:7","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-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto 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,align:s,...r,children:[a.jsx(co,{"code-path":"src/components/ui/select.tsx:72:9"}),a.jsx(oo,{"code-path":"src/components/ui/select.tsx:73:9",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}),a.jsx(io,{"code-path":"src/components/ui/select.tsx:82:9"})]})})}function xo({className:t,children:o,...e}){return a.jsxs(no,{"code-path":"src/components/ui/select.tsx:107:5","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:[a.jsx("span",{"code-path":"src/components/ui/select.tsx:115:7","data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(so,{"code-path":"src/components/ui/select.tsx:119:9",children:a.jsx(xt,{"code-path":"src/components/ui/select.tsx:120:11",className:"size-4"})})}),a.jsx(ro,{"code-path":"src/components/ui/select.tsx:123:7",children:o})]})}function co({className:t,...o}){return a.jsx(ao,{"code-path":"src/components/ui/select.tsx:146:5","data-slot":"select-scroll-up-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:a.jsx(wt,{"code-path":"src/components/ui/select.tsx:154:7",className:"size-4"})})}function io({className:t,...o}){return a.jsx(lo,{"code-path":"src/components/ui/select.tsx:164:5","data-slot":"select-scroll-down-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:a.jsx(Ne,{"code-path":"src/components/ui/select.tsx:172:7",className:"size-4"})})}export{mo as S,go as a,ho as b,vo as c,xo as d};