import{r as o,S as r,O as v,T as w,U as I,V as P,W as _,X as b}from"./index-CKIL6d0V.js";const{Option:c}=r;function f(e){return e&&e.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}const j=(e,m)=>{var s;const{prefixCls:C,className:S,popupClassName:x,dropdownClassName:E,children:i,dataSource:p}=e,n=v(i);let a;n.length===1&&o.isValidElement(n[0])&&!f(n[0])&&([a]=n);const g=a?()=>a:void 0;let l;n.length&&f(n[0])?l=i:l=p?p.map(t=>{if(o.isValidElement(t))return t;switch(typeof t){case"string":return o.createElement(c,{key:t,value:t},t);case"object":{const{value:O}=t;return o.createElement(c,{key:O,value:O},t.text)}default:return}}):[];const{getPrefixCls:y}=o.useContext(w),d=y("select",C),[N]=I("SelectLike",(s=e.dropdownStyle)===null||s===void 0?void 0:s.zIndex);return o.createElement(r,Object.assign({ref:m,suffixIcon:null},P(e,["dataSource","dropdownClassName"]),{prefixCls:d,popupClassName:x||E,dropdownStyle:Object.assign(Object.assign({},e.dropdownStyle),{zIndex:N}),className:_(`${d}-auto-complete`,S),mode:r.SECRET_COMBOBOX_MODE_DO_NOT_USE,getInputElement:g}),l)},u=o.forwardRef(j),z=b(u);u.Option=c;u._InternalPanelDoNotUseOrYouWillBeFired=z;export{u as R};
