const e=require("../_util/type.js");require("../vc-util/warning.js");const t=require("../_util/classNames.js"),n=require("../_util/omit.js"),r=require("../_util/props-util/initDefaultProps.js"),i=require("../_util/props-util/index.js"),a=require("../config-provider/hooks/useConfigInject.js"),o=require("../_util/vue-types/index.js"),s=require("../vc-util/devWarning.js"),c=require("../vc-tree/props.js"),l=require("../vc-tree/index.js"),u=require("./style/index.js"),d=require("./utils/dropIndicator.js"),f=require("./utils/iconUtil.js");let p=require("vue");var m=()=>{let t=c.treeProps();return{...t,showLine:e.someType([Boolean,Object]),multiple:e.booleanType(),autoExpandParent:e.booleanType(),checkStrictly:e.booleanType(),checkable:e.booleanType(),disabled:e.booleanType(),defaultExpandAll:e.booleanType(),defaultExpandParent:e.booleanType(),defaultExpandedKeys:e.arrayType(),expandedKeys:e.arrayType(),checkedKeys:e.someType([Array,Object]),defaultCheckedKeys:e.arrayType(),selectedKeys:e.arrayType(),defaultSelectedKeys:e.arrayType(),selectable:e.booleanType(),loadedKeys:e.arrayType(),draggable:e.booleanType(),showIcon:e.booleanType(),icon:e.functionType(),switcherIcon:o.default.any,prefixCls:String,replaceFields:e.objectType(),blockNode:e.booleanType(),openAnimation:o.default.any,onDoubleclick:t.onDblclick,"onUpdate:selectedKeys":e.functionType(),"onUpdate:checkedKeys":e.functionType(),"onUpdate:expandedKeys":e.functionType()}},h=(0,p.defineComponent)({compatConfig:{MODE:3},name:`ATree`,inheritAttrs:!1,props:r.default(m(),{checkable:!1,selectable:!0,showIcon:!1,blockNode:!1}),slots:Object,setup(e,{attrs:r,expose:o,emit:c,slots:m}){e.treeData===void 0&&m.default;let{prefixCls:h,direction:g,virtual:_}=a.default(`tree`,e),[v,y]=u.default(h),b=(0,p.ref)();o({treeRef:b,onNodeExpand:(...e)=>{b.value?.onNodeExpand(...e)},scrollTo:e=>{b.value?.scrollTo(e)},selectedKeys:(0,p.computed)(()=>b.value?.selectedKeys),checkedKeys:(0,p.computed)(()=>b.value?.checkedKeys),halfCheckedKeys:(0,p.computed)(()=>b.value?.halfCheckedKeys),loadedKeys:(0,p.computed)(()=>b.value?.loadedKeys),loadingKeys:(0,p.computed)(()=>b.value?.loadingKeys),expandedKeys:(0,p.computed)(()=>b.value?.expandedKeys)}),(0,p.watchEffect)(()=>{s.default(e.replaceFields===void 0,`Tree`,"`replaceFields` is deprecated, please use fieldNames instead")});let x=(e,t)=>{c(`update:checkedKeys`,e),c(`check`,e,t)},S=(e,t)=>{c(`update:expandedKeys`,e),c(`expand`,e,t)},C=(e,t)=>{c(`update:selectedKeys`,e),c(`select`,e,t)};return()=>{let{showIcon:a,showLine:o,switcherIcon:s=m.switcherIcon,icon:c=m.icon,blockNode:u,checkable:w,selectable:T,fieldNames:E=e.replaceFields,motion:D=e.openAnimation,itemHeight:O=28,onDoubleclick:k,onDblclick:A}=e,j={...r,...n.default(e,[`onUpdate:checkedKeys`,`onUpdate:expandedKeys`,`onUpdate:selectedKeys`,`onDoubleclick`]),showLine:!!o,dropIndicatorRender:d.default,fieldNames:E,icon:c,itemHeight:O},M=m.default?i.filterEmpty(m.default()):void 0;return v((0,p.createVNode)(l.default,{...j,virtual:_.value,motion:D,ref:b,prefixCls:h.value,class:t.default({[`${h.value}-icon-hide`]:!a,[`${h.value}-block-node`]:u,[`${h.value}-unselectable`]:!T,[`${h.value}-rtl`]:g.value===`rtl`},r.class,y.value),direction:g.value,checkable:w,selectable:T,switcherIcon:e=>f.default(h.value,s,e,m.leafIcon,o),onCheck:x,onExpand:S,onSelect:C,onDblclick:A||k,children:M},{...m,checkable:()=>(0,p.createVNode)(`span`,{class:`${h.value}-checkbox-inner`},null)}))}}});exports.default=h,exports.treeProps=m;