import"../../vc-util/warning.mjs";import{camelize as e}from"../../_util/util.mjs";import{filterEmpty as t}from"../../_util/props-util/index.mjs";import n from"../TreeNode.mjs";import{createVNode as r}from"vue";function i(e){return e&&e.type&&e.type.isTreeSelectNode}function a(n){function r(n=[]){return t(n).map(t=>{if(!i(t))return null;let n=t.children||{},a=t.key,o={};for(let[n,r]of Object.entries(t.props))o[e(n)]=r;let{isLeaf:s,checkable:c,selectable:l,disabled:u,disableCheckbox:d}=o,f={isLeaf:s||s===``||void 0,checkable:c||c===``||void 0,selectable:l||l===``||void 0,disabled:u||u===``||void 0,disableCheckbox:d||d===``||void 0},p={...o,...f},{title:m=n.title?.(p),switcherIcon:h=n.switcherIcon?.(p),...g}=o,_=n.default?.(),v={...g,title:m,switcherIcon:h,key:a,isLeaf:s,...f},y=r(_);return y.length&&(v.children=y),v})}return r(n)}function o(e){if(!e)return e;let t={...e};return`props`in t||Object.defineProperty(t,"props",{get(){return t}}),t}function s(e,t,i,a,o,s){let c=null,l=null;function u(){function e(a,o=`0`,u=!1){return a.map((a,d)=>{let f=`${o}-${d}`,p=a[s.value],m=i.includes(p),h=e(a[s.children]||[],f,m),g=r(n,a,{default:()=>[h.map(e=>e.node)]});if(t===p&&(c=g),m){let e={pos:f,node:g,children:h};return u||l.push(e),e}return null}).filter(e=>e)}l||(l=[],e(a),l.sort(({node:{props:{value:e}}},{node:{props:{value:t}}})=>i.indexOf(e)-i.indexOf(t)))}Object.defineProperty(e,"triggerNode",{get(){return u(),c}}),Object.defineProperty(e,"allCheckedNodes",{get(){return u(),o?l:l.map(({node:e})=>e)}})}export{a as convertChildrenToData,s as fillAdditionalInfo,o as fillLegacyProps};