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