const e=require("../../_util/props-util/index.js");function t(e){let{key:t,children:n,props:{value:r,disabled:i,...a}}=e,o=n?.default;return{key:t,value:r===void 0?t:r,children:o,disabled:i||i===``,...a}}function n(r,i=!1){return e.flattenChildren(r).map((r,a)=>{if(!e.isValidElement(r)||!r.type)return null;let{type:{isSelectOptGroup:o},key:s,children:c,props:l}=r;if(i||!o)return t(r);let u=c&&c.default?c.default():void 0,d=l?.label||c.label?.()||s;return{key:`__RC_SELECT_GRP__${s===null?a:String(s)}__`,...l,label:d,options:n(u||[])}}).filter(e=>e)}exports.convertChildrenToData=n;