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