function g(l,e,t){const{key:n}=l;let r;return t&&t.value&&l[t.value]!==void 0?{[t.value]:r}=l:"value"in l&&({value:r}=l),n??(r!==void 0?r:`rc-index-key-${e}`)}function b(l,e){const{label:t,value:n,options:r}=l||{};return{label:t||(e?"children":"label"),value:n||"value",options:r||"options"}}function h(l,{fieldNames:e,childrenAsData:t}={}){const n=[],{label:r,value:f,options:o}=b(e,!1);function p(s,u){s.forEach(i=>{const v=i[r];if(u||!(o in i)){const c=i[f];n.push({key:g(i,n.length,e),groupOption:u,data:i,label:v,value:c})}else{let c=v;c===void 0&&t&&(c=i.label),n.push({key:g(i,n.length,e),group:!0,data:i,label:c}),p(i[o],!0)}})}return p(l,!1),n}function y(l){const e={...l};return"props"in e||Object.defineProperty(e,"props",{get(){return e}}),e}function O(l,e){if(!e||!e.length)return null;let t=!1;function n(f,[o,...p]){if(!o)return[f];const s=f.split(o);return t=t||s.length>1,s.reduce((u,i)=>[...u,...n(i,p)],[]).filter(u=>u)}const r=n(l,e);return t?r:null}export{b as fillFieldNames,h as flattenOptions,O as getSeparatedContent,y as injectPropsWithOption};
