lu-lowcode-package-form 0.3.7 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -253,7 +253,7 @@ html body {
253
253
  &-hidden.${o}-row`]:{display:"none"},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:e.lineHeight,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:u,color:s,fontSize:c,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:"top"},[`&${t}-required:not(${t}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:e.marginXXS,color:l,fontSize:e.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${r}-hide-required-mark &`]:{display:"none"}},[`${t}-optional`]:{display:"inline-block",marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`${r}-hide-required-mark &`]:{display:"none"}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:e.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:f,marginInlineEnd:g},[`&${t}-no-colon::after`]:{content:'"\\a0"'}}},[`${t}-control`]:{"--ant-display":"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${o}-col-'"]):not([class*="' ${o}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:e.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[t]:{"&-explain, &-extra":{clear:"both",color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:"auto",opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:"center",visibility:"visible",animationName:rd,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:"none","&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},j2=e=>{const{componentCls:t,formItemCls:n}=e;return{[`${t}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:"1 1 0",minWidth:0},[`${n}-label[class$='-24'], ${n}-label[class*='-24 ']`]:{[`& + ${n}-control`]:{minWidth:"unset"}}}}},z2=e=>{const{componentCls:t,formItemCls:n,inlineItemMarginBottom:r}=e;return{[`${t}-inline`]:{display:"flex",flexWrap:"wrap",[n]:{flex:"none",marginInlineEnd:e.margin,marginBottom:r,"&-row":{flexWrap:"nowrap"},[`> ${n}-label,
254
254
  > ${n}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${n}-label`]:{flex:"none"},[`${t}-text`]:{display:"inline-block"},[`${n}-has-feedback`]:{display:"inline-block"}}}}},ea=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),B2=e=>{const{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${n} ${n}-label`]:ea(e),[`${t}:not(${t}-inline)`]:{[n]:{flexWrap:"wrap",[`${n}-label, ${n}-control`]:{[`&:not([class*=" ${r}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},H2=e=>{const{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${t}-vertical`]:{[n]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${t}-item-control`]:{width:"100%"}}},[`${t}-vertical ${n}-label,
255
255
  .${r}-col-24${n}-label,
256
- .${r}-col-xl-24${n}-label`]:ea(e),[`@media (max-width: ${Ge(e.screenXSMax)})`]:[B2(e),{[t]:{[`.${r}-col-xs-24${n}-label`]:ea(e)}}],[`@media (max-width: ${Ge(e.screenSMMax)})`]:{[t]:{[`.${r}-col-sm-24${n}-label`]:ea(e)}},[`@media (max-width: ${Ge(e.screenMDMax)})`]:{[t]:{[`.${r}-col-md-24${n}-label`]:ea(e)}},[`@media (max-width: ${Ge(e.screenLGMax)})`]:{[t]:{[`.${r}-col-lg-24${n}-label`]:ea(e)}}}},k2=e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0,inlineItemMarginBottom:0}),T0=(e,t)=>fn(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t}),Rd=mr("Form",(e,t)=>{let{rootPrefixCls:n}=t;const r=T0(e,n);return[L2(r),V2(r),D2(r),j2(r),z2(r),H2(r),Op(r),rd]},k2,{order:-1e3}),R0=[];function Md(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof e=="string"?e:`${t}-${r}`,error:e,errorStatus:n}}const M0=e=>{let{help:t,helpStatus:n,errors:r=R0,warnings:o=R0,className:l,fieldId:s,onVisibleChanged:c}=e;const{prefixCls:u}=v.useContext(td),f=`${u}-item-explain`,g=br(u),[h,m,b]=Rd(u,g),C=z.useMemo(()=>_u(u),[u]),S=Es(r),p=Es(o),w=v.useMemo(()=>t!=null?[Md(t,"help",n)]:[].concat(Re(S.map((E,$)=>Md(E,"error","error",$))),Re(p.map((E,$)=>Md(E,"warning","warning",$)))),[t,n,S,p]),x={};return s&&(x.id=`${s}_help`),h(v.createElement(di,{motionDeadline:C.motionDeadline,motionName:`${u}-show-help`,visible:!!w.length,onVisibleChanged:c},E=>{const{className:$,style:I}=E;return v.createElement("div",Object.assign({},x,{className:Oe(f,$,b,g,l,m),style:I,role:"alert"}),v.createElement(sx,Object.assign({keys:w},_u(u),{motionName:`${u}-show-help-item`,component:!1}),O=>{const{key:N,error:P,errorStatus:R,className:F,style:B}=O;return v.createElement("div",{key:N,className:Oe(F,{[`${f}-${R}`]:R}),style:B},P)}))}))},W2=["parentNode"],K2="form_item";function nl(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function A0(e,t){if(!e.length)return;const n=e.join("_");return t?`${t}_${n}`:W2.includes(n)?`${K2}_${n}`:n}function D0(e,t,n,r,o,l){let s=r;return l!==void 0?s=l:n.validating?s="validating":e.length?s="error":t.length?s="warning":(n.touched||o&&n.validated)&&(s="success"),s}function F0(e){return nl(e).join("_")}function U2(e,t){const n=t.getFieldInstance(e);if(n instanceof HTMLElement)return n;if((n==null?void 0:n.nativeElement)instanceof HTMLElement)return n.nativeElement;const r=A0(nl(e),t.__INTERNAL__.name);if(r)return document.getElementById(r)}function L0(e){const[t]=Ju(),n=v.useRef({}),r=v.useMemo(()=>e??Object.assign(Object.assign({},t),{__INTERNAL__:{itemRef:o=>l=>{const s=F0(o);l?n.current[s]=l:delete n.current[s]}},scrollToField:function(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=U2(o,r);s&&Zx(s,Object.assign({scrollMode:"if-needed",block:"nearest"},l))},getFieldInstance:o=>{const l=F0(o);return n.current[l]}}),[e,t]);return[r]}const Os={};function G2(e){let{name:t}=e;const n=xn("Form");z.useEffect(()=>{if(t)return Os[t]=(Os[t]||0)+1,process.env.NODE_ENV!=="production"&&n(Os[t]<=1,"usage","There exist multiple Form with same `name`."),()=>{Os[t]-=1}},[t])}var q2=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const X2=(e,t)=>{const n=v.useContext(bo),{getPrefixCls:r,direction:o,form:l}=v.useContext(qt),{prefixCls:s,className:c,rootClassName:u,size:f,disabled:g=n,form:h,colon:m,labelAlign:b,labelWrap:C,labelCol:S,wrapperCol:p,hideRequiredMark:w,layout:x="horizontal",scrollToFirstError:E,requiredMark:$,onFinishFailed:I,name:O,style:N,feedbackIcons:P,variant:R}=e,F=q2(e,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),B=yo(f),K=v.useContext(gg);process.env.NODE_ENV!=="production"&&G2(e);const U=z.useMemo(()=>$!==void 0?$:w?!1:l&&l.requiredMark!==void 0?l.requiredMark:!0,[w,$,l]),A=m??(l==null?void 0:l.colon),k=r("form",s),j=br(k),[D,L,X]=Rd(k,j),q=Oe(k,`${k}-${x}`,{[`${k}-hide-required-mark`]:U===!1,[`${k}-rtl`]:o==="rtl",[`${k}-${B}`]:B},X,j,L,l==null?void 0:l.className,c,u),[W]=L0(h),{__INTERNAL__:Q}=W;Q.name=O;const ne=z.useMemo(()=>({name:O,labelAlign:b,labelCol:S,labelWrap:C,wrapperCol:p,vertical:x==="vertical",colon:A,requiredMark:U,itemRef:Q.itemRef,form:W,feedbackIcons:P}),[O,b,S,p,x,A,U,W,P]);v.useImperativeHandle(t,()=>W);const ue=(de,ie)=>{if(de){let me={block:"nearest"};typeof de=="object"&&(me=de),W.scrollToField(ie,me)}},oe=de=>{if(I==null||I(de),de.errorFields.length){const ie=de.errorFields[0].name;if(E!==void 0){ue(E,ie);return}l&&l.scrollToFirstError!==void 0&&ue(l.scrollToFirstError,ie)}};return D(v.createElement(Ep.Provider,{value:R},v.createElement(Dg,{disabled:g},v.createElement(Aa.Provider,{value:B},v.createElement(wp,{validateMessages:K},v.createElement(Co.Provider,{value:ne},v.createElement(Ui,Object.assign({id:O},F,{name:O,onFinishFailed:oe,form:W,style:Object.assign(Object.assign({},l==null?void 0:l.style),N),className:q}))))))))},V0=v.forwardRef(X2);process.env.NODE_ENV!=="production"&&(V0.displayName="Form");const Y2=V0;function Z2(e){if(typeof e=="function")return e;const t=no(e);return t.length<=1?t[0]:t}const j0=()=>{const{status:e,errors:t=[],warnings:n=[]}=z.useContext(Wn);if(process.env.NODE_ENV!=="production"){const r=xn("Form.Item");process.env.NODE_ENV!=="production"&&r(e!==void 0,"usage","Form.Item.useStatus should be used under Form.Item component. For more information: https://u.ant.design/form-item-usestatus")}return{status:e,errors:t,warnings:n}};j0.Context=Wn;const Q2=j0;function J2(e){const[t,n]=v.useState(e),r=z.useRef(null),o=z.useRef([]),l=z.useRef(!1);v.useEffect(()=>(l.current=!1,()=>{l.current=!0,hn.cancel(r.current),r.current=null}),[]);function s(c){l.current||(r.current===null&&(o.current=[],r.current=hn(()=>{r.current=null,n(u=>{let f=u;return o.current.forEach(g=>{f=g(f)}),f})})),o.current.push(c))}return[t,s]}function eP(){const{itemRef:e}=v.useContext(Co),t=v.useRef({});function n(r,o){const l=o&&typeof o=="object"&&o.ref,s=r.join("_");return(t.current.name!==s||t.current.originRef!==l)&&(t.current.name=s,t.current.originRef=l,t.current.ref=Wr(e(r),l)),t.current.ref}return n}const tP=e=>{const{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${t}-control`]:{display:"flex"}}}},nP=Xg(["Form","item-item"],(e,t)=>{let{rootPrefixCls:n}=t;const r=T0(e,n);return[tP(r)]}),rP=e=>{const{prefixCls:t,status:n,wrapperCol:r,children:o,errors:l,warnings:s,_internalItemRender:c,extra:u,help:f,fieldId:g,marginBottom:h,onErrorVisibleChanged:m}=e,b=`${t}-item`,C=v.useContext(Co),S=r||C.wrapperCol||{},p=Oe(`${b}-control`,S.className),w=v.useMemo(()=>Object.assign({},C),[C]);delete w.labelCol,delete w.wrapperCol;const x=v.createElement("div",{className:`${b}-control-input`},v.createElement("div",{className:`${b}-control-input-content`},o)),E=v.useMemo(()=>({prefixCls:t,status:n}),[t,n]),$=h!==null||l.length||s.length?v.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},v.createElement(td.Provider,{value:E},v.createElement(M0,{fieldId:g,errors:l,warnings:s,help:f,helpStatus:n,className:`${b}-explain-connected`,onVisibleChanged:m})),!!h&&v.createElement("div",{style:{width:0,height:h}})):null,I={};g&&(I.id=`${g}_extra`);const O=u?v.createElement("div",Object.assign({},I,{className:`${b}-extra`}),u):null,N=c&&c.mark==="pro_table_render"&&c.render?c.render(e,{input:x,errorList:$,extra:O}):v.createElement(v.Fragment,null,x,$,O);return v.createElement(Co.Provider,{value:w},v.createElement(Ss,Object.assign({},S,{className:p}),N),v.createElement(nP,{prefixCls:t}))};var oP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"};const iP=oP;var aP=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:iP}))},z0=v.forwardRef(aP);process.env.NODE_ENV!=="production"&&(z0.displayName="QuestionCircleOutlined");const lP=z0;var sP=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function cP(e){return e?typeof e=="object"&&!v.isValidElement(e)?e:{title:e}:null}const uP=e=>{let{prefixCls:t,label:n,htmlFor:r,labelCol:o,labelAlign:l,colon:s,required:c,requiredMark:u,tooltip:f}=e;var g;const[h]=bg("Form"),{vertical:m,labelAlign:b,labelCol:C,labelWrap:S,colon:p}=v.useContext(Co);if(!n)return null;const w=o||C||{},x=l||b,E=`${t}-item-label`,$=Oe(E,x==="left"&&`${E}-left`,w.className,{[`${E}-wrap`]:!!S});let I=n;const O=s===!0||p!==!1&&s!==!1;O&&!m&&typeof n=="string"&&n.trim()!==""&&(I=n.replace(/[:|:]\s*$/,""));const P=cP(f);if(P){const{icon:K=v.createElement(lP,null)}=P,U=sP(P,["icon"]),A=v.createElement(XI,Object.assign({},U),v.cloneElement(K,{className:`${t}-item-tooltip`,title:"",onClick:k=>{k.preventDefault()},tabIndex:null}));I=v.createElement(v.Fragment,null,I,A)}const R=u==="optional",F=typeof u=="function";F?I=u(I,{required:!!c}):R&&!c&&(I=v.createElement(v.Fragment,null,I,v.createElement("span",{className:`${t}-item-optional`,title:""},(h==null?void 0:h.optional)||((g=li.Form)===null||g===void 0?void 0:g.optional))));const B=Oe({[`${t}-item-required`]:c,[`${t}-item-required-mark-optional`]:R||F,[`${t}-item-no-colon`]:!O});return v.createElement(Ss,Object.assign({},w,{className:$}),v.createElement("label",{htmlFor:r,className:B,title:typeof n=="string"?n:""},I))},dP={success:Tx,warning:Hx,error:Su,validating:ns};function B0(e){let{children:t,errors:n,warnings:r,hasFeedback:o,validateStatus:l,prefixCls:s,meta:c,noStyle:u}=e;const f=`${s}-item`,{feedbackIcons:g}=v.useContext(Co),h=D0(n,r,c,null,!!o,l),{isFormItemInput:m,status:b,hasFeedback:C,feedbackIcon:S}=v.useContext(Wn),p=v.useMemo(()=>{var w;let x;if(o){const $=o!==!0&&o.icons||g,I=h&&((w=$==null?void 0:$({status:h,errors:n,warnings:r}))===null||w===void 0?void 0:w[h]),O=h&&dP[h];x=I!==!1&&O?v.createElement("span",{className:Oe(`${f}-feedback-icon`,`${f}-feedback-icon-${h}`)},I||v.createElement(O,null)):null}const E={status:h||"",errors:n,warnings:r,hasFeedback:!!o,feedbackIcon:x,isFormItemInput:!0};return u&&(E.status=(h??b)||"",E.isFormItemInput=m,E.hasFeedback=!!(o??C),E.feedbackIcon=o!==void 0?E.feedbackIcon:S),E},[h,o,u,m,b]);return v.createElement(Wn.Provider,{value:p},t)}var fP=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function vP(e){const{prefixCls:t,className:n,rootClassName:r,style:o,help:l,errors:s,warnings:c,validateStatus:u,meta:f,hasFeedback:g,hidden:h,children:m,fieldId:b,required:C,isRequired:S,onSubItemMetaChange:p}=e,w=fP(e,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),x=`${t}-item`,{requiredMark:E}=v.useContext(Co),$=v.useRef(null),I=Es(s),O=Es(c),N=l!=null,P=!!(N||s.length||c.length),R=!!$.current&&Iu($.current),[F,B]=v.useState(null);nn(()=>{if(P&&$.current){const j=getComputedStyle($.current);B(parseInt(j.marginBottom,10))}},[P,R]);const K=j=>{j||B(null)},A=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const D=j?I:f.errors,L=j?O:f.warnings;return D0(D,L,f,"",!!g,u)}(),k=Oe(x,n,r,{[`${x}-with-help`]:N||I.length||O.length,[`${x}-has-feedback`]:A&&g,[`${x}-has-success`]:A==="success",[`${x}-has-warning`]:A==="warning",[`${x}-has-error`]:A==="error",[`${x}-is-validating`]:A==="validating",[`${x}-hidden`]:h});return v.createElement("div",{className:k,style:o,ref:$},v.createElement(y0,Object.assign({className:`${x}-row`},ro(w,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),v.createElement(uP,Object.assign({htmlFor:b},e,{requiredMark:E,required:C??S,prefixCls:t})),v.createElement(rP,Object.assign({},e,f,{errors:I,warnings:O,prefixCls:t,status:A,help:l,marginBottom:F,onErrorVisibleChanged:K}),v.createElement(Cp.Provider,{value:p},v.createElement(B0,{prefixCls:t,meta:f,errors:f.errors,warnings:f.warnings,hasFeedback:g,validateStatus:A},m)))),!!F&&v.createElement("div",{className:`${x}-margin-offset`,style:{marginBottom:-F}}))}const gP="__SPLIT__";function hP(e,t){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(o=>{const l=e[o],s=t[o];return l===s||typeof l=="function"||typeof s=="function"})}const pP=v.memo(e=>{let{children:t}=e;return t},(e,t)=>hP(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((n,r)=>n===t.childProps[r]));function H0(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function mP(e){const{name:t,noStyle:n,className:r,dependencies:o,prefixCls:l,shouldUpdate:s,rules:c,children:u,required:f,label:g,messageVariables:h,trigger:m="onChange",validateTrigger:b,hidden:C,help:S}=e,{getPrefixCls:p}=v.useContext(qt),{name:w}=v.useContext(Co),x=Z2(u),E=typeof x=="function",$=v.useContext(Cp),{validateTrigger:I}=v.useContext(pi),O=b!==void 0?b:I,N=t!=null,P=p("form",l),R=br(P),[F,B,K]=Rd(P,R),U=xn("Form.Item");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&U(t!==null,"usage","`null` is passed as `name` property");const A=v.useContext(za),k=v.useRef(),[j,D]=J2({}),[L,X]=ui(()=>H0()),q=ie=>{const me=A==null?void 0:A.getKey(ie.name);if(X(ie.destroy?H0():ie,!0),n&&S!==!1&&$){let we=ie.name;if(ie.destroy)we=k.current||we;else if(me!==void 0){const[ae,re]=me;we=[ae].concat(Re(re)),k.current=we}$(ie,we)}},W=(ie,me)=>{D(we=>{const ae=Object.assign({},we),he=[].concat(Re(ie.name.slice(0,-1)),Re(me)).join(gP);return ie.destroy?delete ae[he]:ae[he]=ie,ae})},[Q,ne]=v.useMemo(()=>{const ie=Re(L.errors),me=Re(L.warnings);return Object.values(j).forEach(we=>{ie.push.apply(ie,Re(we.errors||[])),me.push.apply(me,Re(we.warnings||[]))}),[ie,me]},[j,L.errors,L.warnings]),ue=eP();function oe(ie,me,we){return n&&!C?v.createElement(B0,{prefixCls:P,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:L,errors:Q,warnings:ne,noStyle:!0},ie):v.createElement(vP,Object.assign({key:"row"},e,{className:Oe(r,K,R,B),prefixCls:P,fieldId:me,isRequired:we,errors:Q,warnings:ne,meta:L,onSubItemMetaChange:W}),ie)}if(!N&&!E&&!o)return F(oe(x));let de={};return typeof g=="string"?de.label=g:t&&(de.label=String(t)),h&&(de=Object.assign(Object.assign({},de),h)),F(v.createElement(Zu,Object.assign({},e,{messageVariables:de,trigger:m,validateTrigger:O,onMetaChange:q}),(ie,me,we)=>{const ae=nl(t).length&&me?me.name:[],re=A0(ae,w),he=f!==void 0?f:!!(c&&c.some(se=>{if(se&&typeof se=="object"&&se.required&&!se.warningOnly)return!0;if(typeof se=="function"){const _e=se(we);return _e&&_e.required&&!_e.warningOnly}return!1})),Ne=Object.assign({},ie);let J=null;if(process.env.NODE_ENV!=="production"&&U(!(s&&o),"usage","`shouldUpdate` and `dependencies` shouldn't be used together. See https://u.ant.design/form-deps."),Array.isArray(x)&&N)process.env.NODE_ENV!=="production"&&U(!1,"usage","A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://u.ant.design/complex-form-item."),J=x;else if(E&&(!(s||o)||N))process.env.NODE_ENV!=="production"&&U(!!(s||o),"usage","A `Form.Item` with a render function must have either `shouldUpdate` or `dependencies`."),process.env.NODE_ENV!=="production"&&U(!N,"usage","A `Form.Item` with a render function cannot be a field, and thus cannot have a `name` prop.");else if(o&&!E&&!N)process.env.NODE_ENV!=="production"&&U(!1,"usage","Must set `name` or use a render function when `dependencies` is set.");else if(v.isValidElement(x)){process.env.NODE_ENV!=="production"&&U(x.props.defaultValue===void 0,"usage","`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.");const se=Object.assign(Object.assign({},x.props),Ne);if(se.id||(se.id=re),S||Q.length>0||ne.length>0||e.extra){const je=[];(S||Q.length>0)&&je.push(`${re}_help`),e.extra&&je.push(`${re}_extra`),se["aria-describedby"]=je.join(" ")}Q.length>0&&(se["aria-invalid"]="true"),he&&(se["aria-required"]="true"),Mi(x)&&(se.ref=ue(ae,x)),new Set([].concat(Re(nl(m)),Re(nl(O)))).forEach(je=>{se[je]=function(){for(var xe,fe,be,Le,Be,ze=arguments.length,Ue=new Array(ze),Te=0;Te<ze;Te++)Ue[Te]=arguments[Te];(be=Ne[je])===null||be===void 0||(xe=be).call.apply(xe,[Ne].concat(Ue)),(Be=(Le=x.props)[je])===null||Be===void 0||(fe=Be).call.apply(fe,[Le].concat(Ue))}});const Fe=[se["aria-required"],se["aria-invalid"],se["aria-describedby"]];J=v.createElement(pP,{control:Ne,update:x,childProps:Fe},zo(x,se))}else E&&(s||o)&&!N?J=x(we):(process.env.NODE_ENV!=="production"&&U(!ae.length||!!n,"usage","`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead."),J=x);return oe(J,re,he)}))}const k0=mP;k0.useStatus=Q2;const bP=k0;var yP=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const SP=e=>{var{prefixCls:t,children:n}=e,r=yP(e,["prefixCls","children"]);if(process.env.NODE_ENV!=="production"){const c=xn("Form.List");process.env.NODE_ENV!=="production"&&c(typeof r.name=="number"||(Array.isArray(r.name)?!!r.name.length:!!r.name),"usage","Miss `name` prop.")}const{getPrefixCls:o}=v.useContext(qt),l=o("form",t),s=v.useMemo(()=>({prefixCls:l,status:"error"}),[l]);return v.createElement(pp,Object.assign({},r),(c,u,f)=>v.createElement(td.Provider,{value:s},n(c.map(g=>Object.assign(Object.assign({},g),{fieldKey:g.key})),u,{errors:f.errors,warnings:f.warnings})))};function CP(){const{form:e}=z.useContext(Co);return e}const wo=Y2;wo.Item=bP,wo.List=SP,wo.ErrorList=M0,wo.useForm=L0,wo.useFormInstance=CP,wo.useWatch=Sp,wo.Provider=wp,wo.create=()=>{process.env.NODE_ENV!=="production"&&Ta(!1,"Form","antd v4 removed `Form.create`. Please remove or use `@ant-design/compatible` instead.")};const Ad=wo;var Dd=v.createContext(null),wP=function(t){for(var n=t.prefixCls,r=t.level,o=t.isStart,l=t.isEnd,s="".concat(n,"-indent-unit"),c=[],u=0;u<r;u+=1)c.push(v.createElement("span",{key:u,className:Oe(s,V(V({},"".concat(s,"-start"),o[u]),"".concat(s,"-end"),l[u]))}));return v.createElement("span",{"aria-hidden":"true",className:"".concat(n,"-indent")},c)};const xP=v.memo(wP);var EP=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],W0="open",K0="close",OP="---",$P=function(e){uo(n,e);var t=ri(n);function n(){var r;Ln(this,n);for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];return r=t.call.apply(t,[this].concat(l)),V(Ce(r),"state",{dragNodeHighlight:!1}),V(Ce(r),"selectHandle",void 0),V(Ce(r),"cacheIndent",void 0),V(Ce(r),"onSelectorClick",function(c){var u=r.props.context.onNodeClick;u(c,Tn(r.props)),r.isSelectable()?r.onSelect(c):r.onCheck(c)}),V(Ce(r),"onSelectorDoubleClick",function(c){var u=r.props.context.onNodeDoubleClick;u(c,Tn(r.props))}),V(Ce(r),"onSelect",function(c){if(!r.isDisabled()){var u=r.props.context.onNodeSelect;u(c,Tn(r.props))}}),V(Ce(r),"onCheck",function(c){if(!r.isDisabled()){var u=r.props,f=u.disableCheckbox,g=u.checked,h=r.props.context.onNodeCheck;if(!(!r.isCheckable()||f)){var m=!g;h(c,Tn(r.props),m)}}}),V(Ce(r),"onMouseEnter",function(c){var u=r.props.context.onNodeMouseEnter;u(c,Tn(r.props))}),V(Ce(r),"onMouseLeave",function(c){var u=r.props.context.onNodeMouseLeave;u(c,Tn(r.props))}),V(Ce(r),"onContextMenu",function(c){var u=r.props.context.onNodeContextMenu;u(c,Tn(r.props))}),V(Ce(r),"onDragStart",function(c){var u=r.props.context.onNodeDragStart;c.stopPropagation(),r.setState({dragNodeHighlight:!0}),u(c,Ce(r));try{c.dataTransfer.setData("text/plain","")}catch{}}),V(Ce(r),"onDragEnter",function(c){var u=r.props.context.onNodeDragEnter;c.preventDefault(),c.stopPropagation(),u(c,Ce(r))}),V(Ce(r),"onDragOver",function(c){var u=r.props.context.onNodeDragOver;c.preventDefault(),c.stopPropagation(),u(c,Ce(r))}),V(Ce(r),"onDragLeave",function(c){var u=r.props.context.onNodeDragLeave;c.stopPropagation(),u(c,Ce(r))}),V(Ce(r),"onDragEnd",function(c){var u=r.props.context.onNodeDragEnd;c.stopPropagation(),r.setState({dragNodeHighlight:!1}),u(c,Ce(r))}),V(Ce(r),"onDrop",function(c){var u=r.props.context.onNodeDrop;c.preventDefault(),c.stopPropagation(),r.setState({dragNodeHighlight:!1}),u(c,Ce(r))}),V(Ce(r),"onExpand",function(c){var u=r.props,f=u.loading,g=u.context.onNodeExpand;f||g(c,Tn(r.props))}),V(Ce(r),"setSelectHandle",function(c){r.selectHandle=c}),V(Ce(r),"getNodeState",function(){var c=r.props.expanded;return r.isLeaf()?null:c?W0:K0}),V(Ce(r),"hasChildren",function(){var c=r.props.eventKey,u=r.props.context.keyEntities,f=lr(u,c)||{},g=f.children;return!!(g||[]).length}),V(Ce(r),"isLeaf",function(){var c=r.props,u=c.isLeaf,f=c.loaded,g=r.props.context.loadData,h=r.hasChildren();return u===!1?!1:u||!g&&!h||g&&f&&!h}),V(Ce(r),"isDisabled",function(){var c=r.props.disabled,u=r.props.context.disabled;return!!(u||c)}),V(Ce(r),"isCheckable",function(){var c=r.props.checkable,u=r.props.context.checkable;return!u||c===!1?!1:u}),V(Ce(r),"syncLoadData",function(c){var u=c.expanded,f=c.loading,g=c.loaded,h=r.props.context,m=h.loadData,b=h.onNodeLoad;f||m&&u&&!r.isLeaf()&&!g&&b(Tn(r.props))}),V(Ce(r),"isDraggable",function(){var c=r.props,u=c.data,f=c.context.draggable;return!!(f&&(!f.nodeDraggable||f.nodeDraggable(u)))}),V(Ce(r),"renderDragHandler",function(){var c=r.props.context,u=c.draggable,f=c.prefixCls;return u!=null&&u.icon?v.createElement("span",{className:"".concat(f,"-draggable-icon")},u.icon):null}),V(Ce(r),"renderSwitcherIconDom",function(c){var u=r.props.switcherIcon,f=r.props.context.switcherIcon,g=u||f;return typeof g=="function"?g(Z(Z({},r.props),{},{isLeaf:c})):g}),V(Ce(r),"renderSwitcher",function(){var c=r.props.expanded,u=r.props.context.prefixCls;if(r.isLeaf()){var f=r.renderSwitcherIconDom(!0);return f!==!1?v.createElement("span",{className:Oe("".concat(u,"-switcher"),"".concat(u,"-switcher-noop"))},f):null}var g=Oe("".concat(u,"-switcher"),"".concat(u,"-switcher_").concat(c?W0:K0)),h=r.renderSwitcherIconDom(!1);return h!==!1?v.createElement("span",{onClick:r.onExpand,className:g},h):null}),V(Ce(r),"renderCheckbox",function(){var c=r.props,u=c.checked,f=c.halfChecked,g=c.disableCheckbox,h=r.props.context.prefixCls,m=r.isDisabled(),b=r.isCheckable();if(!b)return null;var C=typeof b!="boolean"?b:null;return v.createElement("span",{className:Oe("".concat(h,"-checkbox"),u&&"".concat(h,"-checkbox-checked"),!u&&f&&"".concat(h,"-checkbox-indeterminate"),(m||g)&&"".concat(h,"-checkbox-disabled")),onClick:r.onCheck},C)}),V(Ce(r),"renderIcon",function(){var c=r.props.loading,u=r.props.context.prefixCls;return v.createElement("span",{className:Oe("".concat(u,"-iconEle"),"".concat(u,"-icon__").concat(r.getNodeState()||"docu"),c&&"".concat(u,"-icon_loading"))})}),V(Ce(r),"renderSelector",function(){var c=r.state.dragNodeHighlight,u=r.props,f=u.title,g=f===void 0?OP:f,h=u.selected,m=u.icon,b=u.loading,C=u.data,S=r.props.context,p=S.prefixCls,w=S.showIcon,x=S.icon,E=S.loadData,$=S.titleRender,I=r.isDisabled(),O="".concat(p,"-node-content-wrapper"),N;if(w){var P=m||x;N=P?v.createElement("span",{className:Oe("".concat(p,"-iconEle"),"".concat(p,"-icon__customize"))},typeof P=="function"?P(r.props):P):r.renderIcon()}else E&&b&&(N=r.renderIcon());var R;typeof g=="function"?R=g(C):$?R=$(C):R=g;var F=v.createElement("span",{className:"".concat(p,"-title")},R);return v.createElement("span",{ref:r.setSelectHandle,title:typeof g=="string"?g:"",className:Oe("".concat(O),"".concat(O,"-").concat(r.getNodeState()||"normal"),!I&&(h||c)&&"".concat(p,"-node-selected")),onMouseEnter:r.onMouseEnter,onMouseLeave:r.onMouseLeave,onContextMenu:r.onContextMenu,onClick:r.onSelectorClick,onDoubleClick:r.onSelectorDoubleClick},N,F,r.renderDropIndicator())}),V(Ce(r),"renderDropIndicator",function(){var c=r.props,u=c.disabled,f=c.eventKey,g=r.props.context,h=g.draggable,m=g.dropLevelOffset,b=g.dropPosition,C=g.prefixCls,S=g.indent,p=g.dropIndicatorRender,w=g.dragOverNodeKey,x=g.direction,E=!!h,$=!u&&E&&w===f,I=S??r.cacheIndent;return r.cacheIndent=S,$?p({dropPosition:b,dropLevelOffset:m,indent:I,prefixCls:C,direction:x}):null}),r}return Vn(n,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var o=this.props.selectable,l=this.props.context.selectable;return typeof o=="boolean"?o:l}},{key:"render",value:function(){var o,l=this.props,s=l.eventKey,c=l.className,u=l.style,f=l.dragOver,g=l.dragOverGapTop,h=l.dragOverGapBottom,m=l.isLeaf,b=l.isStart,C=l.isEnd,S=l.expanded,p=l.selected,w=l.checked,x=l.halfChecked,E=l.loading,$=l.domRef,I=l.active;l.data;var O=l.onMouseMove,N=l.selectable,P=Gt(l,EP),R=this.props.context,F=R.prefixCls,B=R.filterTreeNode,K=R.keyEntities,U=R.dropContainerKey,A=R.dropTargetKey,k=R.draggingNodeKey,j=this.isDisabled(),D=jo(P,{aria:!0,data:!0}),L=lr(K,s)||{},X=L.level,q=C[C.length-1],W=this.isDraggable(),Q=!j&&W,ne=k===s,ue=N!==void 0?{"aria-selected":!!N}:void 0;return v.createElement("div",rt({ref:$,className:Oe(c,"".concat(F,"-treenode"),(o={},V(V(V(V(V(V(V(V(V(V(o,"".concat(F,"-treenode-disabled"),j),"".concat(F,"-treenode-switcher-").concat(S?"open":"close"),!m),"".concat(F,"-treenode-checkbox-checked"),w),"".concat(F,"-treenode-checkbox-indeterminate"),x),"".concat(F,"-treenode-selected"),p),"".concat(F,"-treenode-loading"),E),"".concat(F,"-treenode-active"),I),"".concat(F,"-treenode-leaf-last"),q),"".concat(F,"-treenode-draggable"),W),"dragging",ne),V(V(V(V(V(V(o,"drop-target",A===s),"drop-container",U===s),"drag-over",!j&&f),"drag-over-gap-top",!j&&g),"drag-over-gap-bottom",!j&&h),"filter-node",B&&B(Tn(this.props))))),style:u,draggable:Q,"aria-grabbed":ne,onDragStart:Q?this.onDragStart:void 0,onDragEnter:W?this.onDragEnter:void 0,onDragOver:W?this.onDragOver:void 0,onDragLeave:W?this.onDragLeave:void 0,onDrop:W?this.onDrop:void 0,onDragEnd:W?this.onDragEnd:void 0,onMouseMove:O},ue,D),v.createElement(xP,{prefixCls:F,level:X,isStart:b,isEnd:C}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(v.Component),ta=function(t){return v.createElement(Dd.Consumer,null,function(n){return v.createElement($P,rt({},t,{context:n}))})};ta.displayName="TreeNode",ta.isTreeNode=1;function xo(e,t){if(!e)return[];var n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function Ho(e,t){var n=(e||[]).slice();return n.indexOf(t)===-1&&n.push(t),n}function Fd(e){return e.split("-")}function _P(e,t){var n=[],r=lr(t,e);function o(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];l.forEach(function(s){var c=s.key,u=s.children;n.push(c),o(u)})}return o(r.children),n}function IP(e){if(e.parent){var t=Fd(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function NP(e){var t=Fd(e.pos);return Number(t[t.length-1])===0}function U0(e,t,n,r,o,l,s,c,u,f){var g,h=e.clientX,m=e.clientY,b=e.target.getBoundingClientRect(),C=b.top,S=b.height,p=(f==="rtl"?-1:1)*(((o==null?void 0:o.x)||0)-h),w=(p-12)/r,x=u.filter(function(j){var D;return(D=c[j])===null||D===void 0||(D=D.children)===null||D===void 0?void 0:D.length}),E=lr(c,n.props.eventKey);if(m<C+S/2){var $=s.findIndex(function(j){return j.key===E.key}),I=$<=0?0:$-1,O=s[I].key;E=lr(c,O)}var N=E.key,P=E,R=E.key,F=0,B=0;if(!x.includes(N))for(var K=0;K<w&&IP(E);K+=1)E=E.parent,B+=1;var U=t.props.data,A=E.node,k=!0;return NP(E)&&E.level===0&&m<C+S/2&&l({dragNode:U,dropNode:A,dropPosition:-1})&&E.key===n.props.eventKey?F=-1:(P.children||[]).length&&x.includes(R)?l({dragNode:U,dropNode:A,dropPosition:0})?F=0:k=!1:B===0?w>-1.5?l({dragNode:U,dropNode:A,dropPosition:1})?F=1:k=!1:l({dragNode:U,dropNode:A,dropPosition:0})?F=0:l({dragNode:U,dropNode:A,dropPosition:1})?F=1:k=!1:l({dragNode:U,dropNode:A,dropPosition:1})?F=1:k=!1,{dropPosition:F,dropLevelOffset:B,dropTargetKey:E.key,dropTargetPos:E.pos,dragOverNodeKey:R,dropContainerKey:F===0?null:((g=E.parent)===null||g===void 0?void 0:g.key)||null,dropAllowed:k}}function G0(e,t){if(e){var n=t.multiple;return n?e.slice():e.length?[e[0]]:e}}function Ld(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(ct(e)==="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return at(!1,"`checkedKeys` is not an array or an object"),null;return t}function Vd(e,t){var n=new Set;function r(o){if(!n.has(o)){var l=lr(t,o);if(l){n.add(o);var s=l.parent,c=l.node;c.disabled||s&&r(s.key)}}}return(e||[]).forEach(function(o){r(o)}),Re(n)}function PP(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case-1:o.top=0,o.left=-n*r;break;case 1:o.bottom=0,o.left=-n*r;break;case 0:o.bottom=0,o.left=r;break}return v.createElement("div",{style:o})}function q0(e){if(e==null)throw new TypeError("Cannot destructure "+e)}function TP(e,t){var n=v.useState(!1),r=ce(n,2),o=r[0],l=r[1];nn(function(){if(o)return e(),function(){t()}},[o]),nn(function(){return l(!0),function(){l(!1)}},[])}var RP=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],X0=function(t,n){var r=t.className,o=t.style,l=t.motion,s=t.motionNodes,c=t.motionType,u=t.onMotionStart,f=t.onMotionEnd,g=t.active,h=t.treeNodeRequiredProps,m=Gt(t,RP),b=v.useState(!0),C=ce(b,2),S=C[0],p=C[1],w=v.useContext(Dd),x=w.prefixCls,E=s&&c!=="hide";nn(function(){s&&E!==S&&p(E)},[s]);var $=function(){s&&u()},I=v.useRef(!1),O=function(){s&&!I.current&&(I.current=!0,f())};TP($,O);var N=function(R){E===R&&O()};return s?v.createElement(di,rt({ref:n,visible:S},l,{motionAppear:c==="show",onVisibleChanged:N}),function(P,R){var F=P.className,B=P.style;return v.createElement("div",{ref:R,className:Oe("".concat(x,"-treenode-motion"),F),style:B},s.map(function(K){var U=Object.assign({},(q0(K.data),K.data)),A=K.title,k=K.key,j=K.isStart,D=K.isEnd;delete U.children;var L=tl(k,h);return v.createElement(ta,rt({},U,L,{title:A,active:g,data:K.data,key:k,isStart:j,isEnd:D}))}))}):v.createElement(ta,rt({domRef:n,className:r,style:o},m,{active:g}))};X0.displayName="MotionTreeNode";var MP=v.forwardRef(X0);function AP(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e.length,r=t.length;if(Math.abs(n-r)!==1)return{add:!1,key:null};function o(l,s){var c=new Map;l.forEach(function(f){c.set(f,!0)});var u=s.filter(function(f){return!c.has(f)});return u.length===1?u[0]:null}return n<r?{add:!0,key:o(e,t)}:{add:!1,key:o(t,e)}}function Y0(e,t,n){var r=e.findIndex(function(c){return c.key===n}),o=e[r+1],l=t.findIndex(function(c){return c.key===n});if(o){var s=t.findIndex(function(c){return c.key===o.key});return t.slice(l+1,s)}return t.slice(l+1)}var DP=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],Z0={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},FP=function(){},bi="RC_TREE_MOTION_".concat(Math.random()),jd={key:bi},Q0={key:bi,level:0,index:0,pos:"0",node:jd,nodes:[jd]},J0={parent:null,children:[],pos:Q0.pos,data:jd,title:null,key:bi,isStart:[],isEnd:[]};function eb(e,t,n,r){return t===!1||!n?e:e.slice(0,Math.ceil(n/r)+1)}function tb(e){var t=e.key,n=e.pos;return el(t,n)}function LP(e){for(var t=String(e.data.key),n=e;n.parent;)n=n.parent,t="".concat(n.data.key," > ").concat(t);return t}var nb=v.forwardRef(function(e,t){var n=e.prefixCls,r=e.data;e.selectable,e.checkable;var o=e.expandedKeys,l=e.selectedKeys,s=e.checkedKeys,c=e.loadedKeys,u=e.loadingKeys,f=e.halfCheckedKeys,g=e.keyEntities,h=e.disabled,m=e.dragging,b=e.dragOverNodeKey,C=e.dropPosition,S=e.motion,p=e.height,w=e.itemHeight,x=e.virtual,E=e.focusable,$=e.activeItem,I=e.focused,O=e.tabIndex,N=e.onKeyDown,P=e.onFocus,R=e.onBlur,F=e.onActiveChange,B=e.onListChangeStart,K=e.onListChangeEnd,U=Gt(e,DP),A=v.useRef(null),k=v.useRef(null);v.useImperativeHandle(t,function(){return{scrollTo:function(be){A.current.scrollTo(be)},getIndentWidth:function(){return k.current.offsetWidth}}});var j=v.useState(o),D=ce(j,2),L=D[0],X=D[1],q=v.useState(r),W=ce(q,2),Q=W[0],ne=W[1],ue=v.useState(r),oe=ce(ue,2),de=oe[0],ie=oe[1],me=v.useState([]),we=ce(me,2),ae=we[0],re=we[1],he=v.useState(null),Ne=ce(he,2),J=Ne[0],se=Ne[1],_e=v.useRef(r);_e.current=r;function Fe(){var fe=_e.current;ne(fe),ie(fe),re([]),se(null),K()}nn(function(){X(o);var fe=AP(L,o);if(fe.key!==null)if(fe.add){var be=Q.findIndex(function(We){var Ve=We.key;return Ve===fe.key}),Le=eb(Y0(Q,r,fe.key),x,p,w),Be=Q.slice();Be.splice(be+1,0,J0),ie(Be),re(Le),se("show")}else{var ze=r.findIndex(function(We){var Ve=We.key;return Ve===fe.key}),Ue=eb(Y0(r,Q,fe.key),x,p,w),Te=r.slice();Te.splice(ze+1,0,J0),ie(Te),re(Ue),se("hide")}else Q!==r&&(ne(r),ie(r))},[o,r]),v.useEffect(function(){m||Fe()},[m]);var je=S?de:r,xe={expandedKeys:o,selectedKeys:l,loadedKeys:c,loadingKeys:u,checkedKeys:s,halfCheckedKeys:f,dragOverNodeKey:b,dropPosition:C,keyEntities:g};return v.createElement(v.Fragment,null,I&&$&&v.createElement("span",{style:Z0,"aria-live":"assertive"},LP($)),v.createElement("div",null,v.createElement("input",{style:Z0,disabled:E===!1||h,tabIndex:E!==!1?O:null,onKeyDown:N,onFocus:P,onBlur:R,value:"",onChange:FP,"aria-label":"for screen reader"})),v.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},v.createElement("div",{className:"".concat(n,"-indent")},v.createElement("div",{ref:k,className:"".concat(n,"-indent-unit")}))),v.createElement(gd,rt({},U,{data:je,itemKey:tb,height:p,fullHeight:!1,virtual:x,itemHeight:w,prefixCls:"".concat(n,"-list"),ref:A,onVisibleChange:function(be,Le){var Be=new Set(be),ze=Le.filter(function(Ue){return!Be.has(Ue)});ze.some(function(Ue){return tb(Ue)===bi})&&Fe()}}),function(fe){var be=fe.pos,Le=Object.assign({},(q0(fe.data),fe.data)),Be=fe.title,ze=fe.key,Ue=fe.isStart,Te=fe.isEnd,We=el(ze,be);delete Le.key,delete Le.children;var Ve=tl(We,xe);return v.createElement(MP,rt({},Le,Ve,{title:Be,active:!!$&&ze===$.key,pos:be,data:fe.data,isStart:Ue,isEnd:Te,motion:S,motionNodes:ze===bi?ae:null,motionType:J,onMotionStart:B,onMotionEnd:Fe,treeNodeRequiredProps:xe,onMouseMove:function(){F(null)}}))}))});nb.displayName="NodeList";var VP=10,$s=function(e){uo(n,e);var t=ri(n);function n(){var r;Ln(this,n);for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];return r=t.call.apply(t,[this].concat(l)),V(Ce(r),"destroyed",!1),V(Ce(r),"delayedDragEnterLogic",void 0),V(Ce(r),"loadingRetryTimes",{}),V(Ce(r),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:Zi()}),V(Ce(r),"dragStartMousePosition",null),V(Ce(r),"dragNode",void 0),V(Ce(r),"currentMouseOverDroppableNodeKey",null),V(Ce(r),"listRef",v.createRef()),V(Ce(r),"onNodeDragStart",function(c,u){var f=r.state,g=f.expandedKeys,h=f.keyEntities,m=r.props.onDragStart,b=u.props.eventKey;r.dragNode=u,r.dragStartMousePosition={x:c.clientX,y:c.clientY};var C=xo(g,b);r.setState({draggingNodeKey:b,dragChildrenKeys:_P(b,h),indent:r.listRef.current.getIndentWidth()}),r.setExpandedKeys(C),window.addEventListener("dragend",r.onWindowDragEnd),m==null||m({event:c,node:Tn(u.props)})}),V(Ce(r),"onNodeDragEnter",function(c,u){var f=r.state,g=f.expandedKeys,h=f.keyEntities,m=f.dragChildrenKeys,b=f.flattenNodes,C=f.indent,S=r.props,p=S.onDragEnter,w=S.onExpand,x=S.allowDrop,E=S.direction,$=u.props,I=$.pos,O=$.eventKey,N=Ce(r),P=N.dragNode;if(r.currentMouseOverDroppableNodeKey!==O&&(r.currentMouseOverDroppableNodeKey=O),!P){r.resetDragState();return}var R=U0(c,P,u,C,r.dragStartMousePosition,x,b,h,g,E),F=R.dropPosition,B=R.dropLevelOffset,K=R.dropTargetKey,U=R.dropContainerKey,A=R.dropTargetPos,k=R.dropAllowed,j=R.dragOverNodeKey;if(m.indexOf(K)!==-1||!k){r.resetDragState();return}if(r.delayedDragEnterLogic||(r.delayedDragEnterLogic={}),Object.keys(r.delayedDragEnterLogic).forEach(function(D){clearTimeout(r.delayedDragEnterLogic[D])}),P.props.eventKey!==u.props.eventKey&&(c.persist(),r.delayedDragEnterLogic[I]=window.setTimeout(function(){if(r.state.draggingNodeKey!==null){var D=Re(g),L=lr(h,u.props.eventKey);L&&(L.children||[]).length&&(D=Ho(g,u.props.eventKey)),"expandedKeys"in r.props||r.setExpandedKeys(D),w==null||w(D,{node:Tn(u.props),expanded:!0,nativeEvent:c.nativeEvent})}},800)),P.props.eventKey===K&&B===0){r.resetDragState();return}r.setState({dragOverNodeKey:j,dropPosition:F,dropLevelOffset:B,dropTargetKey:K,dropContainerKey:U,dropTargetPos:A,dropAllowed:k}),p==null||p({event:c,node:Tn(u.props),expandedKeys:g})}),V(Ce(r),"onNodeDragOver",function(c,u){var f=r.state,g=f.dragChildrenKeys,h=f.flattenNodes,m=f.keyEntities,b=f.expandedKeys,C=f.indent,S=r.props,p=S.onDragOver,w=S.allowDrop,x=S.direction,E=Ce(r),$=E.dragNode;if($){var I=U0(c,$,u,C,r.dragStartMousePosition,w,h,m,b,x),O=I.dropPosition,N=I.dropLevelOffset,P=I.dropTargetKey,R=I.dropContainerKey,F=I.dropAllowed,B=I.dropTargetPos,K=I.dragOverNodeKey;g.indexOf(P)!==-1||!F||($.props.eventKey===P&&N===0?r.state.dropPosition===null&&r.state.dropLevelOffset===null&&r.state.dropTargetKey===null&&r.state.dropContainerKey===null&&r.state.dropTargetPos===null&&r.state.dropAllowed===!1&&r.state.dragOverNodeKey===null||r.resetDragState():O===r.state.dropPosition&&N===r.state.dropLevelOffset&&P===r.state.dropTargetKey&&R===r.state.dropContainerKey&&B===r.state.dropTargetPos&&F===r.state.dropAllowed&&K===r.state.dragOverNodeKey||r.setState({dropPosition:O,dropLevelOffset:N,dropTargetKey:P,dropContainerKey:R,dropTargetPos:B,dropAllowed:F,dragOverNodeKey:K}),p==null||p({event:c,node:Tn(u.props)}))}}),V(Ce(r),"onNodeDragLeave",function(c,u){r.currentMouseOverDroppableNodeKey===u.props.eventKey&&!c.currentTarget.contains(c.relatedTarget)&&(r.resetDragState(),r.currentMouseOverDroppableNodeKey=null);var f=r.props.onDragLeave;f==null||f({event:c,node:Tn(u.props)})}),V(Ce(r),"onWindowDragEnd",function(c){r.onNodeDragEnd(c,null,!0),window.removeEventListener("dragend",r.onWindowDragEnd)}),V(Ce(r),"onNodeDragEnd",function(c,u){var f=r.props.onDragEnd;r.setState({dragOverNodeKey:null}),r.cleanDragState(),f==null||f({event:c,node:Tn(u.props)}),r.dragNode=null,window.removeEventListener("dragend",r.onWindowDragEnd)}),V(Ce(r),"onNodeDrop",function(c,u){var f,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,h=r.state,m=h.dragChildrenKeys,b=h.dropPosition,C=h.dropTargetKey,S=h.dropTargetPos,p=h.dropAllowed;if(p){var w=r.props.onDrop;if(r.setState({dragOverNodeKey:null}),r.cleanDragState(),C!==null){var x=Z(Z({},tl(C,r.getTreeNodeRequiredProps())),{},{active:((f=r.getActiveItem())===null||f===void 0?void 0:f.key)===C,data:lr(r.state.keyEntities,C).node}),E=m.indexOf(C)!==-1;at(!E,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var $=Fd(S),I={event:c,node:Tn(x),dragNode:r.dragNode?Tn(r.dragNode.props):null,dragNodesKeys:[r.dragNode.props.eventKey].concat(m),dropToGap:b!==0,dropPosition:b+Number($[$.length-1])};g||w==null||w(I),r.dragNode=null}}}),V(Ce(r),"cleanDragState",function(){var c=r.state.draggingNodeKey;c!==null&&r.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),r.dragStartMousePosition=null,r.currentMouseOverDroppableNodeKey=null}),V(Ce(r),"triggerExpandActionExpand",function(c,u){var f=r.state,g=f.expandedKeys,h=f.flattenNodes,m=u.expanded,b=u.key,C=u.isLeaf;if(!(C||c.shiftKey||c.metaKey||c.ctrlKey)){var S=h.filter(function(w){return w.key===b})[0],p=Tn(Z(Z({},tl(b,r.getTreeNodeRequiredProps())),{},{data:S.data}));r.setExpandedKeys(m?xo(g,b):Ho(g,b)),r.onNodeExpand(c,p)}}),V(Ce(r),"onNodeClick",function(c,u){var f=r.props,g=f.onClick,h=f.expandAction;h==="click"&&r.triggerExpandActionExpand(c,u),g==null||g(c,u)}),V(Ce(r),"onNodeDoubleClick",function(c,u){var f=r.props,g=f.onDoubleClick,h=f.expandAction;h==="doubleClick"&&r.triggerExpandActionExpand(c,u),g==null||g(c,u)}),V(Ce(r),"onNodeSelect",function(c,u){var f=r.state.selectedKeys,g=r.state,h=g.keyEntities,m=g.fieldNames,b=r.props,C=b.onSelect,S=b.multiple,p=u.selected,w=u[m.key],x=!p;x?S?f=Ho(f,w):f=[w]:f=xo(f,w);var E=f.map(function($){var I=lr(h,$);return I?I.node:null}).filter(function($){return $});r.setUncontrolledState({selectedKeys:f}),C==null||C(f,{event:"select",selected:x,node:u,selectedNodes:E,nativeEvent:c.nativeEvent})}),V(Ce(r),"onNodeCheck",function(c,u,f){var g=r.state,h=g.keyEntities,m=g.checkedKeys,b=g.halfCheckedKeys,C=r.props,S=C.checkStrictly,p=C.onCheck,w=u.key,x,E={event:"check",node:u,checked:f,nativeEvent:c.nativeEvent};if(S){var $=f?Ho(m,w):xo(m,w),I=xo(b,w);x={checked:$,halfChecked:I},E.checkedNodes=$.map(function(B){return lr(h,B)}).filter(function(B){return B}).map(function(B){return B.node}),r.setUncontrolledState({checkedKeys:$})}else{var O=Qi([].concat(Re(m),[w]),!0,h),N=O.checkedKeys,P=O.halfCheckedKeys;if(!f){var R=new Set(N);R.delete(w);var F=Qi(Array.from(R),{checked:!1,halfCheckedKeys:P},h);N=F.checkedKeys,P=F.halfCheckedKeys}x=N,E.checkedNodes=[],E.checkedNodesPositions=[],E.halfCheckedKeys=P,N.forEach(function(B){var K=lr(h,B);if(K){var U=K.node,A=K.pos;E.checkedNodes.push(U),E.checkedNodesPositions.push({node:U,pos:A})}}),r.setUncontrolledState({checkedKeys:N},!1,{halfCheckedKeys:P})}p==null||p(x,E)}),V(Ce(r),"onNodeLoad",function(c){var u,f=c.key,g=r.state.keyEntities,h=lr(g,f);if(!(h!=null&&(u=h.children)!==null&&u!==void 0&&u.length)){var m=new Promise(function(b,C){r.setState(function(S){var p=S.loadedKeys,w=p===void 0?[]:p,x=S.loadingKeys,E=x===void 0?[]:x,$=r.props,I=$.loadData,O=$.onLoad;if(!I||w.indexOf(f)!==-1||E.indexOf(f)!==-1)return null;var N=I(c);return N.then(function(){var P=r.state.loadedKeys,R=Ho(P,f);O==null||O(R,{event:"load",node:c}),r.setUncontrolledState({loadedKeys:R}),r.setState(function(F){return{loadingKeys:xo(F.loadingKeys,f)}}),b()}).catch(function(P){if(r.setState(function(F){return{loadingKeys:xo(F.loadingKeys,f)}}),r.loadingRetryTimes[f]=(r.loadingRetryTimes[f]||0)+1,r.loadingRetryTimes[f]>=VP){var R=r.state.loadedKeys;at(!1,"Retry for `loadData` many times but still failed. No more retry."),r.setUncontrolledState({loadedKeys:Ho(R,f)}),b()}C(P)}),{loadingKeys:Ho(E,f)}})});return m.catch(function(){}),m}}),V(Ce(r),"onNodeMouseEnter",function(c,u){var f=r.props.onMouseEnter;f==null||f({event:c,node:u})}),V(Ce(r),"onNodeMouseLeave",function(c,u){var f=r.props.onMouseLeave;f==null||f({event:c,node:u})}),V(Ce(r),"onNodeContextMenu",function(c,u){var f=r.props.onRightClick;f&&(c.preventDefault(),f({event:c,node:u}))}),V(Ce(r),"onFocus",function(){var c=r.props.onFocus;r.setState({focused:!0});for(var u=arguments.length,f=new Array(u),g=0;g<u;g++)f[g]=arguments[g];c==null||c.apply(void 0,f)}),V(Ce(r),"onBlur",function(){var c=r.props.onBlur;r.setState({focused:!1}),r.onActiveChange(null);for(var u=arguments.length,f=new Array(u),g=0;g<u;g++)f[g]=arguments[g];c==null||c.apply(void 0,f)}),V(Ce(r),"getTreeNodeRequiredProps",function(){var c=r.state,u=c.expandedKeys,f=c.selectedKeys,g=c.loadedKeys,h=c.loadingKeys,m=c.checkedKeys,b=c.halfCheckedKeys,C=c.dragOverNodeKey,S=c.dropPosition,p=c.keyEntities;return{expandedKeys:u||[],selectedKeys:f||[],loadedKeys:g||[],loadingKeys:h||[],checkedKeys:m||[],halfCheckedKeys:b||[],dragOverNodeKey:C,dropPosition:S,keyEntities:p}}),V(Ce(r),"setExpandedKeys",function(c){var u=r.state,f=u.treeData,g=u.fieldNames,h=xd(f,c,g);r.setUncontrolledState({expandedKeys:c,flattenNodes:h},!0)}),V(Ce(r),"onNodeExpand",function(c,u){var f=r.state.expandedKeys,g=r.state,h=g.listChanging,m=g.fieldNames,b=r.props,C=b.onExpand,S=b.loadData,p=u.expanded,w=u[m.key];if(!h){var x=f.indexOf(w),E=!p;if(at(p&&x!==-1||!p&&x===-1,"Expand state not sync with index check"),E?f=Ho(f,w):f=xo(f,w),r.setExpandedKeys(f),C==null||C(f,{node:u,expanded:E,nativeEvent:c.nativeEvent}),E&&S){var $=r.onNodeLoad(u);$&&$.then(function(){var I=xd(r.state.treeData,f,m);r.setUncontrolledState({flattenNodes:I})}).catch(function(){var I=r.state.expandedKeys,O=xo(I,w);r.setExpandedKeys(O)})}}}),V(Ce(r),"onListChangeStart",function(){r.setUncontrolledState({listChanging:!0})}),V(Ce(r),"onListChangeEnd",function(){setTimeout(function(){r.setUncontrolledState({listChanging:!1})})}),V(Ce(r),"onActiveChange",function(c){var u=r.state.activeKey,f=r.props,g=f.onActiveChange,h=f.itemScrollOffset,m=h===void 0?0:h;u!==c&&(r.setState({activeKey:c}),c!==null&&r.scrollTo({key:c,offset:m}),g==null||g(c))}),V(Ce(r),"getActiveItem",function(){var c=r.state,u=c.activeKey,f=c.flattenNodes;return u===null?null:f.find(function(g){var h=g.key;return h===u})||null}),V(Ce(r),"offsetActiveKey",function(c){var u=r.state,f=u.flattenNodes,g=u.activeKey,h=f.findIndex(function(C){var S=C.key;return S===g});h===-1&&c<0&&(h=f.length),h=(h+c+f.length)%f.length;var m=f[h];if(m){var b=m.key;r.onActiveChange(b)}else r.onActiveChange(null)}),V(Ce(r),"onKeyDown",function(c){var u=r.state,f=u.activeKey,g=u.expandedKeys,h=u.checkedKeys,m=u.fieldNames,b=r.props,C=b.onKeyDown,S=b.checkable,p=b.selectable;switch(c.which){case Pe.UP:{r.offsetActiveKey(-1),c.preventDefault();break}case Pe.DOWN:{r.offsetActiveKey(1),c.preventDefault();break}}var w=r.getActiveItem();if(w&&w.data){var x=r.getTreeNodeRequiredProps(),E=w.data.isLeaf===!1||!!(w.data[m.children]||[]).length,$=Tn(Z(Z({},tl(f,x)),{},{data:w.data,active:!0}));switch(c.which){case Pe.LEFT:{E&&g.includes(f)?r.onNodeExpand({},$):w.parent&&r.onActiveChange(w.parent.key),c.preventDefault();break}case Pe.RIGHT:{E&&!g.includes(f)?r.onNodeExpand({},$):w.children&&w.children.length&&r.onActiveChange(w.children[0].key),c.preventDefault();break}case Pe.ENTER:case Pe.SPACE:{S&&!$.disabled&&$.checkable!==!1&&!$.disableCheckbox?r.onNodeCheck({},$,!h.includes(f)):!S&&p&&!$.disabled&&$.selectable!==!1&&r.onNodeSelect({},$);break}}}C==null||C(c)}),V(Ce(r),"setUncontrolledState",function(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!r.destroyed){var g=!1,h=!0,m={};Object.keys(c).forEach(function(b){if(b in r.props){h=!1;return}g=!0,m[b]=c[b]}),g&&(!u||h)&&r.setState(Z(Z({},m),f))}}),V(Ce(r),"scrollTo",function(c){r.listRef.current.scrollTo(c)}),r}return Vn(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var o=this.props,l=o.activeKey,s=o.itemScrollOffset,c=s===void 0?0:s;l!==void 0&&l!==this.state.activeKey&&(this.setState({activeKey:l}),l!==null&&this.scrollTo({key:l,offset:c}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var o=this.state,l=o.focused,s=o.flattenNodes,c=o.keyEntities,u=o.draggingNodeKey,f=o.activeKey,g=o.dropLevelOffset,h=o.dropContainerKey,m=o.dropTargetKey,b=o.dropPosition,C=o.dragOverNodeKey,S=o.indent,p=this.props,w=p.prefixCls,x=p.className,E=p.style,$=p.showLine,I=p.focusable,O=p.tabIndex,N=O===void 0?0:O,P=p.selectable,R=p.showIcon,F=p.icon,B=p.switcherIcon,K=p.draggable,U=p.checkable,A=p.checkStrictly,k=p.disabled,j=p.motion,D=p.loadData,L=p.filterTreeNode,X=p.height,q=p.itemHeight,W=p.virtual,Q=p.titleRender,ne=p.dropIndicatorRender,ue=p.onContextMenu,oe=p.onScroll,de=p.direction,ie=p.rootClassName,me=p.rootStyle,we=jo(this.props,{aria:!0,data:!0}),ae;return K&&(ct(K)==="object"?ae=K:typeof K=="function"?ae={nodeDraggable:K}:ae={}),v.createElement(Dd.Provider,{value:{prefixCls:w,selectable:P,showIcon:R,icon:F,switcherIcon:B,draggable:ae,draggingNodeKey:u,checkable:U,checkStrictly:A,disabled:k,keyEntities:c,dropLevelOffset:g,dropContainerKey:h,dropTargetKey:m,dropPosition:b,dragOverNodeKey:C,indent:S,direction:de,dropIndicatorRender:ne,loadData:D,filterTreeNode:L,titleRender:Q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},v.createElement("div",{role:"tree",className:Oe(w,x,ie,V(V(V({},"".concat(w,"-show-line"),$),"".concat(w,"-focused"),l),"".concat(w,"-active-focused"),f!==null)),style:me},v.createElement(nb,rt({ref:this.listRef,prefixCls:w,style:E,data:s,disabled:k,selectable:P,checkable:!!U,motion:j,dragging:u!==null,height:X,itemHeight:q,virtual:W,focusable:I,focused:l,tabIndex:N,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ue,onScroll:oe},this.getTreeNodeRequiredProps(),we))))}}],[{key:"getDerivedStateFromProps",value:function(o,l){var s=l.prevProps,c={prevProps:o};function u(O){return!s&&O in o||s&&s[O]!==o[O]}var f,g=l.fieldNames;if(u("fieldNames")&&(g=Zi(o.fieldNames),c.fieldNames=g),u("treeData")?f=o.treeData:u("children")&&(at(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),f=s0(o.children)),f){c.treeData=f;var h=Ed(f,{fieldNames:g});c.keyEntities=Z(V({},bi,Q0),h.keyEntities),process.env.NODE_ENV!=="production"&&_N(f,g)}var m=c.keyEntities||l.keyEntities;if(u("expandedKeys")||s&&u("autoExpandParent"))c.expandedKeys=o.autoExpandParent||!s&&o.defaultExpandParent?Vd(o.expandedKeys,m):o.expandedKeys;else if(!s&&o.defaultExpandAll){var b=Z({},m);delete b[bi],c.expandedKeys=Object.keys(b).map(function(O){return b[O].key})}else!s&&o.defaultExpandedKeys&&(c.expandedKeys=o.autoExpandParent||o.defaultExpandParent?Vd(o.defaultExpandedKeys,m):o.defaultExpandedKeys);if(c.expandedKeys||delete c.expandedKeys,f||c.expandedKeys){var C=xd(f||l.treeData,c.expandedKeys||l.expandedKeys,g);c.flattenNodes=C}if(o.selectable&&(u("selectedKeys")?c.selectedKeys=G0(o.selectedKeys,o):!s&&o.defaultSelectedKeys&&(c.selectedKeys=G0(o.defaultSelectedKeys,o))),o.checkable){var S;if(u("checkedKeys")?S=Ld(o.checkedKeys)||{}:!s&&o.defaultCheckedKeys?S=Ld(o.defaultCheckedKeys)||{}:f&&(S=Ld(o.checkedKeys)||{checkedKeys:l.checkedKeys,halfCheckedKeys:l.halfCheckedKeys}),S){var p=S,w=p.checkedKeys,x=w===void 0?[]:w,E=p.halfCheckedKeys,$=E===void 0?[]:E;if(!o.checkStrictly){var I=Qi(x,!0,m);x=I.checkedKeys,$=I.halfCheckedKeys}c.checkedKeys=x,c.halfCheckedKeys=$}}return u("loadedKeys")&&(c.loadedKeys=o.loadedKeys),c}}]),n}(v.Component);V($s,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:PP,allowDrop:function(){return!0},expandAction:!1}),V($s,"TreeNode",ta);var jP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};const zP=jP;var BP=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:zP}))},rb=v.forwardRef(BP);process.env.NODE_ENV!=="production"&&(rb.displayName="FileOutlined");const ob=rb;var HP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};const kP=HP;var WP=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:kP}))},ib=v.forwardRef(WP);process.env.NODE_ENV!=="production"&&(ib.displayName="FolderOpenOutlined");const KP=ib;var UP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"};const GP=UP;var qP=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:GP}))},ab=v.forwardRef(qP);process.env.NODE_ENV!=="production"&&(ab.displayName="FolderOutlined");const XP=ab;var YP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"};const ZP=YP;var QP=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:ZP}))},lb=v.forwardRef(QP);process.env.NODE_ENV!=="production"&&(lb.displayName="HolderOutlined");const JP=lb,eT=new rn("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),tT=(e,t)=>({[`.${e}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${t.motionDurationSlow}`}}}),nT=(e,t)=>({[`.${e}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${Ge(t.lineWidthBold)} solid ${t.colorPrimary}`,borderRadius:"50%",content:'""'}}}),rT=(e,t)=>{const{treeCls:n,treeNodeCls:r,treeNodePadding:o,titleHeight:l,nodeSelectedBg:s,nodeHoverBg:c}=t,u=t.paddingXS;return{[n]:Object.assign(Object.assign({},tr(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:`background-color ${t.motionDurationSlow}`,[`&${n}-rtl`]:{[`${n}-switcher`]:{"&_close":{[`${n}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${n}-active-focused)`]:Object.assign({},Da(t)),[`${n}-list-holder-inner`]:{alignItems:"flex-start"},[`&${n}-block-node`]:{[`${n}-list-holder-inner`]:{alignItems:"stretch",[`${n}-node-content-wrapper`]:{flex:"auto"},[`${r}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,border:`1px solid ${t.colorPrimary}`,opacity:0,animationName:eT,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${r}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${Ge(o)} 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${n}-node-content-wrapper`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${n}-node-content-wrapper`]:{background:t.controlItemBgHover},[`&:not(${r}-disabled).filter-node ${n}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",[`${n}-draggable-icon`]:{flexShrink:0,width:l,lineHeight:`${Ge(l)}`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${t.motionDurationSlow}`,[`${r}:hover &`]:{opacity:.45}},[`&${r}-disabled`]:{[`${n}-draggable-icon`]:{visibility:"hidden"}}}},[`${n}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:l}},[`${n}-draggable-icon`]:{visibility:"hidden"},[`${n}-switcher`]:Object.assign(Object.assign({},tT(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:l,margin:0,lineHeight:`${Ge(l)}`,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${t.motionDurationSlow}`,borderRadius:t.borderRadius,"&-noop":{cursor:"unset"},[`&:not(${n}-switcher-noop):hover`]:{backgroundColor:t.colorBgTextHover},"&_close":{[`${n}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(l).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(l).div(2).equal()).mul(.8).equal(),height:t.calc(l).div(2).equal(),borderBottom:`1px solid ${t.colorBorder}`,content:'""'}}}),[`${n}-checkbox`]:{top:"initial",marginInlineEnd:u,alignSelf:"flex-start",marginTop:t.marginXXS},[`${n}-node-content-wrapper, ${n}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:l,margin:0,padding:`0 ${Ge(t.calc(t.paddingXS).div(2).equal())}`,color:"inherit",lineHeight:`${Ge(l)}`,background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:`all ${t.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:c},[`&${n}-node-selected`]:{backgroundColor:s},[`${n}-iconEle`]:{display:"inline-block",width:l,height:l,lineHeight:`${Ge(l)}`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${n}-unselectable ${n}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${n}-node-content-wrapper`]:Object.assign({lineHeight:`${Ge(l)}`,userSelect:"none"},nT(e,t)),[`${r}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${t.colorPrimary}`}},"&-show-line":{[`${n}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(l).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${n}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${r}-leaf-last`]:{[`${n}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${Ge(t.calc(l).div(2).equal())} !important`}}}}})}},oT=e=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:r,directoryNodeSelectedBg:o,directoryNodeSelectedColor:l}=e;return{[`${t}${t}-directory`]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,transition:`background-color ${e.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},[`${t}-switcher`]:{transition:`color ${e.motionDurationMid}`},[`${t}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${t}-node-selected`]:{color:l,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:o},[`${t}-switcher`]:{color:l},[`${t}-node-content-wrapper`]:{color:l,background:"transparent"}}}}}},sb=(e,t)=>{const n=`.${e}`,r=`${n}-treenode`,o=t.calc(t.paddingXS).div(2).equal(),l=fn(t,{treeCls:n,treeNodeCls:r,treeNodePadding:o});return[rT(e,l),oT(l)]},cb=e=>{const{controlHeightSM:t}=e;return{titleHeight:t,nodeHoverBg:e.controlItemBgHover,nodeSelectedBg:e.controlItemBgActive}},iT=mr("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:Od(`${n}-checkbox`,e)},sb(n,e),Op(e)]},e=>{const{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},cb(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})}),ub=4;function aT(e){const{dropPosition:t,dropLevelOffset:n,prefixCls:r,indent:o,direction:l="ltr"}=e,s=l==="ltr"?"left":"right",c=l==="ltr"?"right":"left",u={[s]:-n*o+ub,[c]:0};switch(t){case-1:u.top=-3;break;case 1:u.bottom=-3;break;default:u.bottom=-3,u[s]=o+ub;break}return z.createElement("div",{style:u,className:`${r}-drop-indicator`})}var lT={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"};const sT=lT;var cT=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:sT}))},db=v.forwardRef(cT);process.env.NODE_ENV!=="production"&&(db.displayName="CaretDownFilled");const uT=db;var dT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const fT=dT;var vT=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:fT}))},fb=v.forwardRef(vT);process.env.NODE_ENV!=="production"&&(fb.displayName="MinusSquareOutlined");const gT=fb;var hT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"};const pT=hT;var mT=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:pT}))},vb=v.forwardRef(mT);process.env.NODE_ENV!=="production"&&(vb.displayName="PlusSquareOutlined");const bT=vb,gb=e=>{const{prefixCls:t,switcherIcon:n,treeNodeProps:r,showLine:o}=e,{isLeaf:l,expanded:s,loading:c}=r;if(c)return v.createElement(ns,{className:`${t}-switcher-loading-icon`});let u;if(o&&typeof o=="object"&&(u=o.showLeafIcon),l){if(!o)return null;if(typeof u!="boolean"&&u){const h=typeof u=="function"?u(r):u,m=`${t}-switcher-line-custom-icon`;return v.isValidElement(h)?zo(h,{className:Oe(h.props.className||"",m)}):h}return u?v.createElement(ob,{className:`${t}-switcher-line-icon`}):v.createElement("span",{className:`${t}-switcher-leaf-line`})}const f=`${t}-switcher-icon`,g=typeof n=="function"?n(r):n;return v.isValidElement(g)?zo(g,{className:Oe(g.props.className||"",f)}):g!==void 0?g:o?s?v.createElement(gT,{className:`${t}-switcher-line-icon`}):v.createElement(bT,{className:`${t}-switcher-line-icon`}):v.createElement(uT,{className:f})},hb=z.forwardRef((e,t)=>{var n;const{getPrefixCls:r,direction:o,virtual:l,tree:s}=z.useContext(qt),{prefixCls:c,className:u,showIcon:f=!1,showLine:g,switcherIcon:h,blockNode:m=!1,children:b,checkable:C=!1,selectable:S=!0,draggable:p,motion:w,style:x}=e,E=r("tree",c),$=r(),I=w??Object.assign(Object.assign({},_u($)),{motionAppear:!1}),O=Object.assign(Object.assign({},e),{checkable:C,selectable:S,showIcon:f,motion:I,blockNode:m,showLine:!!g,dropIndicatorRender:aT}),[N,P,R]=iT(E),[,F]=er(),B=F.paddingXS/2+(((n=F.Tree)===null||n===void 0?void 0:n.titleHeight)||F.controlHeightSM),K=z.useMemo(()=>{if(!p)return!1;let A={};switch(typeof p){case"function":A.nodeDraggable=p;break;case"object":A=Object.assign({},p);break}return A.icon!==!1&&(A.icon=A.icon||z.createElement(JP,null)),A},[p]),U=A=>z.createElement(gb,{prefixCls:E,switcherIcon:h,treeNodeProps:A,showLine:g});return N(z.createElement($s,Object.assign({itemHeight:B,ref:t,virtual:l},O,{style:Object.assign(Object.assign({},s==null?void 0:s.style),x),prefixCls:E,className:Oe({[`${E}-icon-hide`]:!f,[`${E}-block-node`]:m,[`${E}-unselectable`]:!S,[`${E}-rtl`]:o==="rtl"},s==null?void 0:s.className,u,P,R),direction:o,checkable:C&&z.createElement("span",{className:`${E}-checkbox-inner`}),selectable:S,switcherIcon:U,draggable:K}),b))});process.env.NODE_ENV!=="production"&&(hb.displayName="Tree");const pb=hb,mb=0,zd=1,bb=2;function Bd(e,t,n){const{key:r,children:o}=n;function l(s){const c=s[r],u=s[o];t(c,s)!==!1&&Bd(u||[],t,n)}e.forEach(l)}function yT(e){let{treeData:t,expandedKeys:n,startKey:r,endKey:o,fieldNames:l}=e;const s=[];let c=mb;if(r&&r===o)return[r];if(!r||!o)return[];function u(f){return f===r||f===o}return Bd(t,f=>{if(c===bb)return!1;if(u(f)){if(s.push(f),c===mb)c=zd;else if(c===zd)return c=bb,!1}else c===zd&&s.push(f);return n.includes(f)},Zi(l)),s}function Hd(e,t,n){const r=Re(t),o=[];return Bd(e,(l,s)=>{const c=r.indexOf(l);return c!==-1&&(o.push(s),r.splice(c,1)),!!r.length},Zi(n)),o}var yb=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function ST(e){const{isLeaf:t,expanded:n}=e;return t?v.createElement(ob,null):n?v.createElement(KP,null):v.createElement(XP,null)}function Sb(e){let{treeData:t,children:n}=e;return t||s0(n)}const CT=(e,t)=>{var{defaultExpandAll:n,defaultExpandParent:r,defaultExpandedKeys:o}=e,l=yb(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=v.useRef(),c=v.useRef(),u=()=>{const{keyEntities:P}=Ed(Sb(l));let R;return n?R=Object.keys(P):r?R=Vd(l.expandedKeys||o||[],P):R=l.expandedKeys||o||[],R},[f,g]=v.useState(l.selectedKeys||l.defaultSelectedKeys||[]),[h,m]=v.useState(()=>u());v.useEffect(()=>{"selectedKeys"in l&&g(l.selectedKeys)},[l.selectedKeys]),v.useEffect(()=>{"expandedKeys"in l&&m(l.expandedKeys)},[l.expandedKeys]);const b=(P,R)=>{var F;return"expandedKeys"in l||m(P),(F=l.onExpand)===null||F===void 0?void 0:F.call(l,P,R)},C=(P,R)=>{var F;const{multiple:B,fieldNames:K}=l,{node:U,nativeEvent:A}=R,{key:k=""}=U,j=Sb(l),D=Object.assign(Object.assign({},R),{selected:!0}),L=(A==null?void 0:A.ctrlKey)||(A==null?void 0:A.metaKey),X=A==null?void 0:A.shiftKey;let q;B&&L?(q=P,s.current=k,c.current=q,D.selectedNodes=Hd(j,q,K)):B&&X?(q=Array.from(new Set([].concat(Re(c.current||[]),Re(yT({treeData:j,expandedKeys:h,startKey:k,endKey:s.current,fieldNames:K}))))),D.selectedNodes=Hd(j,q,K)):(q=[k],s.current=k,c.current=q,D.selectedNodes=Hd(j,q,K)),(F=l.onSelect)===null||F===void 0||F.call(l,q,D),"selectedKeys"in l||g(q)},{getPrefixCls:S,direction:p}=v.useContext(qt),{prefixCls:w,className:x,showIcon:E=!0,expandAction:$="click"}=l,I=yb(l,["prefixCls","className","showIcon","expandAction"]),O=S("tree",w),N=Oe(`${O}-directory`,{[`${O}-directory-rtl`]:p==="rtl"},x);return v.createElement(pb,Object.assign({icon:ST,ref:t,blockNode:!0},I,{showIcon:E,expandAction:$,prefixCls:O,className:N,expandedKeys:h,selectedKeys:f,onSelect:C,onExpand:b}))},Cb=v.forwardRef(CT);process.env.NODE_ENV!=="production"&&(Cb.displayName="DirectoryTree");const wT=Cb,kd=pb;kd.DirectoryTree=wT,kd.TreeNode=ta;const xT=kd,ET=function(e){var t=v.useRef({valueLabels:new Map});return v.useMemo(function(){var n=t.current.valueLabels,r=new Map,o=e.map(function(l){var s,c=l.value,u=(s=l.label)!==null&&s!==void 0?s:n.get(c);return r.set(c,u),Z(Z({},l),{},{label:u})});return t.current.valueLabels=r,[o]},[e])},OT=function(e,t,n,r){return v.useMemo(function(){var o=e.map(function(u){var f=u.value;return f}),l=t.map(function(u){var f=u.value;return f}),s=o.filter(function(u){return!r[u]});if(n){var c=Qi(o,!0,r);o=c.checkedKeys,l=c.halfCheckedKeys}return[Array.from(new Set([].concat(Re(s),Re(o)))),l]},[e,t,n,r])};function wb(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function $T(e){var t=e||{},n=t.label,r=t.value,o=t.children,l=r||"value";return{_title:n?[n]:["title","label"],value:l,key:l,children:o||"children"}}function Wd(e){return!e||e.disabled||e.disableCheckbox||e.checkable===!1}function _T(e,t){var n=[];function r(o){o.forEach(function(l){var s=l[t.children];s&&(n.push(l[t.value]),r(s))})}return r(e),n}function Kd(e){return e==null}const IT=function(e,t){return v.useMemo(function(){var n=Ed(e,{fieldNames:t,initWrapper:function(o){return Z(Z({},o),{},{valueEntities:new Map})},processEntity:function(o,l){var s=o.node[t.value];if(process.env.NODE_ENV!=="production"){var c=o.node.key;at(!Kd(s),"TreeNode `value` is invalidate: undefined"),at(!l.valueEntities.has(s),"Same `value` exist in the tree: ".concat(s)),at(!c||String(c)===String(s),"`key` or `value` with TreeNode must be the same or you can remove one of them. key: ".concat(c,", value: ").concat(s,"."))}l.valueEntities.set(s,o)}});return n},[e,t])};var Ud=function(){return null},NT=["children","value"];function xb(e){return no(e).map(function(t){if(!v.isValidElement(t)||!t.type)return null;var n=t,r=n.key,o=n.props,l=o.children,s=o.value,c=Gt(o,NT),u=Z({key:r,value:s},c),f=xb(l);return f.length&&(u.children=f),u}).filter(function(t){return t})}function Gd(e){if(!e)return e;var t=Z({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return at(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),t}}),t}function PT(e,t,n,r,o,l){var s=null,c=null;function u(){function f(g){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return g.map(function(b,C){var S="".concat(h,"-").concat(C),p=b[l.value],w=n.includes(p),x=f(b[l.children]||[],S,w),E=v.createElement(Ud,b,x.map(function(I){return I.node}));if(t===p&&(s=E),w){var $={pos:S,node:E,children:x};return m||c.push($),$}return null}).filter(function(b){return b})}c||(c=[],f(r),c.sort(function(g,h){var m=g.node.props.value,b=h.node.props.value,C=n.indexOf(m),S=n.indexOf(b);return C-S}))}Object.defineProperty(e,"triggerNode",{get:function(){return at(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),u(),s}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return at(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),u(),o?c:c.map(function(g){var h=g.node;return h})}})}const TT=function(e,t,n){var r=n.treeNodeFilterProp,o=n.filterTreeNode,l=n.fieldNames,s=l.children;return v.useMemo(function(){if(!t||o===!1)return e;var c;if(typeof o=="function")c=o;else{var u=t.toUpperCase();c=function(h,m){var b=m[r];return String(b).toUpperCase().includes(u)}}function f(g){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return g.reduce(function(m,b){var C=b[s],S=h||c(t,Gd(b)),p=f(C||[],S);return(S||p.length)&&m.push(Z(Z({},b),{},V({isLeaf:void 0},s,p))),m},[])}return f(e)},[e,t,s,r,o])};function Eb(e){var t=v.useRef();t.current=e;var n=v.useCallback(function(){return t.current.apply(t,arguments)},[]);return n}function RT(e,t){var n=t.id,r=t.pId,o=t.rootPId,l={},s=[],c=e.map(function(u){var f=Z({},u),g=f[n];return l[g]=f,f.key=f.key||g,f});return c.forEach(function(u){var f=u[r],g=l[f];g&&(g.children=g.children||[],g.children.push(u)),(f===o||!g&&o===null)&&s.push(u)}),s}function MT(e,t,n){return v.useMemo(function(){return e?n?RT(e,Z({id:"id",pId:"pId",rootPId:null},n!==!0?n:{})):e:xb(t)},[t,n,e])}var Ob=v.createContext(null),$b=v.createContext(null),AT={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},DT=function(t,n){var r=Lp(),o=r.prefixCls,l=r.multiple,s=r.searchValue,c=r.toggleOpen,u=r.open,f=r.notFoundContent,g=v.useContext($b),h=g.virtual,m=g.listHeight,b=g.listItemHeight,C=g.listItemScrollOffset,S=g.treeData,p=g.fieldNames,w=g.onSelect,x=g.dropdownMatchSelectWidth,E=g.treeExpandAction,$=g.treeTitleRender,I=g.onPopupScroll,O=v.useContext(Ob),N=O.checkable,P=O.checkedKeys,R=O.halfCheckedKeys,F=O.treeExpandedKeys,B=O.treeDefaultExpandAll,K=O.treeDefaultExpandedKeys,U=O.onTreeExpand,A=O.treeIcon,k=O.showTreeIcon,j=O.switcherIcon,D=O.treeLine,L=O.treeNodeFilterProp,X=O.loadData,q=O.treeLoadedKeys,W=O.treeMotion,Q=O.onTreeLoad,ne=O.keyEntities,ue=v.useRef(),oe=xa(function(){return S},[u,S],function(We,Ve){return Ve[0]&&We[1]!==Ve[1]}),de=v.useState(null),ie=ce(de,2),me=ie[0],we=ie[1],ae=ne[me],re=v.useMemo(function(){return N?{checked:P,halfChecked:R}:null},[N,P,R]);v.useEffect(function(){if(u&&!l&&P.length){var We;(We=ue.current)===null||We===void 0||We.scrollTo({key:P[0]}),we(P[0])}},[u]);var he=String(s).toLowerCase(),Ne=function(Ve){return he?String(Ve[L]).toLowerCase().includes(he):!1},J=v.useState(K),se=ce(J,2),_e=se[0],Fe=se[1],je=v.useState(null),xe=ce(je,2),fe=xe[0],be=xe[1],Le=v.useMemo(function(){return F?Re(F):s?fe:_e},[_e,fe,F,s]);v.useEffect(function(){s&&be(_T(S,p))},[s]);var Be=function(Ve){Fe(Ve),be(Ve),U&&U(Ve)},ze=function(Ve){Ve.preventDefault()},Ue=function(Ve,qe){var He=qe.node;N&&Wd(He)||(w(He.key,{selected:!P.includes(He.key)}),l||c(!1))};if(v.useImperativeHandle(n,function(){var We;return{scrollTo:(We=ue.current)===null||We===void 0?void 0:We.scrollTo,onKeyDown:function(qe){var He,ft=qe.which;switch(ft){case Pe.UP:case Pe.DOWN:case Pe.LEFT:case Pe.RIGHT:(He=ue.current)===null||He===void 0||He.onKeyDown(qe);break;case Pe.ENTER:{if(ae){var ut=(ae==null?void 0:ae.node)||{},_t=ut.selectable,At=ut.value;_t!==!1&&Ue(null,{node:{key:me},selected:!P.includes(At)})}break}case Pe.ESC:c(!1)}},onKeyUp:function(){}}}),oe.length===0)return v.createElement("div",{role:"listbox",className:"".concat(o,"-empty"),onMouseDown:ze},f);var Te={fieldNames:p};return q&&(Te.loadedKeys=q),Le&&(Te.expandedKeys=Le),v.createElement("div",{onMouseDown:ze},ae&&u&&v.createElement("span",{style:AT,"aria-live":"assertive"},ae.node.value),v.createElement($s,rt({ref:ue,focusable:!1,prefixCls:"".concat(o,"-tree"),treeData:oe,height:m,itemHeight:b,itemScrollOffset:C,virtual:h!==!1&&x!==!1,multiple:l,icon:A,showIcon:k,switcherIcon:j,showLine:D,loadData:s?null:X,motion:W,activeKey:me,checkable:N,checkStrictly:!0,checkedKeys:re,selectedKeys:N?[]:P,defaultExpandAll:B,titleRender:$},Te,{onActiveChange:we,onSelect:Ue,onCheck:Ue,onExpand:Be,onLoad:Q,filterTreeNode:Ne,expandAction:E,onScroll:I})))},_b=v.forwardRef(DT);process.env.NODE_ENV!=="production"&&(_b.displayName="OptionList");var qd="SHOW_ALL",Xd="SHOW_PARENT",_s="SHOW_CHILD";function Ib(e,t,n,r){var o=new Set(e);return t===_s?e.filter(function(l){var s=n[l];return!(s&&s.children&&s.children.some(function(c){var u=c.node;return o.has(u[r.value])})&&s.children.every(function(c){var u=c.node;return Wd(u)||o.has(u[r.value])}))}):t===Xd?e.filter(function(l){var s=n[l],c=s?s.parent:null;return!(c&&!Wd(c.node)&&o.has(c.key))}):e}function FT(e){var t=e.searchPlaceholder,n=e.treeCheckStrictly,r=e.treeCheckable,o=e.labelInValue,l=e.value,s=e.multiple;at(!t,"`searchPlaceholder` has been removed."),n&&o===!1&&at(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(o||n)&&at(wb(l).every(function(c){return c&&ct(c)==="object"&&"value"in c}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),n||s||r?at(!l||Array.isArray(l),"`value` should be an array when `TreeSelect` is checkable or multiple."):at(!Array.isArray(l),"`value` should not be array when `TreeSelect` is single mode.")}var LT=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","listHeight","listItemHeight","listItemScrollOffset","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion","treeTitleRender","onPopupScroll"];function VT(e){return!e||ct(e)!=="object"}var Nb=v.forwardRef(function(e,t){var n=e.id,r=e.prefixCls,o=r===void 0?"rc-tree-select":r,l=e.value,s=e.defaultValue,c=e.onChange,u=e.onSelect,f=e.onDeselect,g=e.searchValue,h=e.inputValue,m=e.onSearch,b=e.autoClearSearchValue,C=b===void 0?!0:b,S=e.filterTreeNode,p=e.treeNodeFilterProp,w=p===void 0?"value":p,x=e.showCheckedStrategy,E=e.treeNodeLabelProp,$=e.multiple,I=e.treeCheckable,O=e.treeCheckStrictly,N=e.labelInValue,P=e.fieldNames,R=e.treeDataSimpleMode,F=e.treeData,B=e.children,K=e.loadData,U=e.treeLoadedKeys,A=e.onTreeLoad,k=e.treeDefaultExpandAll,j=e.treeExpandedKeys,D=e.treeDefaultExpandedKeys,L=e.onTreeExpand,X=e.treeExpandAction,q=e.virtual,W=e.listHeight,Q=W===void 0?200:W,ne=e.listItemHeight,ue=ne===void 0?20:ne,oe=e.listItemScrollOffset,de=oe===void 0?0:oe,ie=e.onDropdownVisibleChange,me=e.dropdownMatchSelectWidth,we=me===void 0?!0:me,ae=e.treeLine,re=e.treeIcon,he=e.showTreeIcon,Ne=e.switcherIcon,J=e.treeMotion,se=e.treeTitleRender,_e=e.onPopupScroll,Fe=Gt(e,LT),je=pm(n),xe=I&&!O,fe=I||O,be=O||N,Le=fe||$,Be=Tr(s,{value:l}),ze=ce(Be,2),Ue=ze[0],Te=ze[1],We=v.useMemo(function(){return I?x||_s:qd},[x,I]);process.env.NODE_ENV!=="production"&&FT(e);var Ve=v.useMemo(function(){return $T(P)},[JSON.stringify(P)]),qe=Tr("",{value:g!==void 0?g:h,postState:function(ke){return ke||""}}),He=ce(qe,2),ft=He[0],ut=He[1],_t=function(ke){ut(ke),m==null||m(ke)},At=MT(F,B,R),ln=IT(At,Ve),yt=ln.keyEntities,vt=ln.valueEntities,Et=v.useCallback(function(Ze){var ke=[],Ke=[];return Ze.forEach(function(Ee){vt.has(Ee)?Ke.push(Ee):ke.push(Ee)}),{missingRawValues:ke,existRawValues:Ke}},[vt]),kt=TT(At,ft,{fieldNames:Ve,treeNodeFilterProp:w,filterTreeNode:S}),Dt=v.useCallback(function(Ze){if(Ze){if(E)return Ze[E];for(var ke=Ve._title,Ke=0;Ke<ke.length;Ke+=1){var Ee=Ze[ke[Ke]];if(Ee!==void 0)return Ee}}},[Ve,E]),St=v.useCallback(function(Ze){var ke=wb(Ze);return ke.map(function(Ke){return VT(Ke)?{value:Ke}:Ke})},[]),Wt=v.useCallback(function(Ze){var ke=St(Ze);return ke.map(function(Ke){var Ee=Ke.label,Ie=Ke.value,Me=Ke.halfChecked,tt,pt=vt.get(Ie);if(pt){var Kt;Ee=(Kt=Ee)!==null&&Kt!==void 0?Kt:Dt(pt.node),tt=pt.node.disabled}else if(Ee===void 0){var Rt=St(Ue).find(function(Rn){return Rn.value===Ie});Ee=Rt.label}return{label:Ee,value:Ie,halfChecked:Me,disabled:tt}})},[vt,Dt,St,Ue]),jt=v.useMemo(function(){return St(Ue)},[St,Ue]),Ft=v.useMemo(function(){var Ze=[],ke=[];return jt.forEach(function(Ke){Ke.halfChecked?ke.push(Ke):Ze.push(Ke)}),[Ze,ke]},[jt]),it=ce(Ft,2),Ct=it[0],ot=it[1],De=v.useMemo(function(){return Ct.map(function(Ze){return Ze.value})},[Ct]),lt=OT(Ct,ot,xe,yt),$t=ce(lt,2),Ae=$t[0],Qe=$t[1],Xe=v.useMemo(function(){var Ze=Ib(Ae,We,yt,Ve),ke=Ze.map(function(Me){var tt,pt;return(tt=(pt=yt[Me])===null||pt===void 0||(pt=pt.node)===null||pt===void 0?void 0:pt[Ve.value])!==null&&tt!==void 0?tt:Me}),Ke=ke.map(function(Me){var tt=Ct.find(function(Kt){return Kt.value===Me}),pt;return N&&tt.label!==void 0?pt=tt.label:!N&&se&&(pt=se(tt)),{value:Me,label:pt}}),Ee=Wt(Ke),Ie=Ee[0];return!Le&&Ie&&Kd(Ie.value)&&Kd(Ie.label)?[]:Ee.map(function(Me){var tt;return Z(Z({},Me),{},{label:(tt=Me.label)!==null&&tt!==void 0?tt:Me.value})})},[Ve,Le,Ae,Ct,Wt,We,yt]),dt=ET(Xe),wt=ce(dt,1),Nt=wt[0],Jt=Eb(function(Ze,ke,Ke){var Ee=Wt(Ze);if(Te(Ee),C&&ut(""),c){var Ie=Ze;if(xe){var Me=Ib(Ze,We,yt,Ve);Ie=Me.map(function(gn){var bn=vt.get(gn);return bn?bn.node[Ve.value]:gn})}var tt=ke||{triggerValue:void 0,selected:void 0},pt=tt.triggerValue,Kt=tt.selected,Rt=Ie;if(O){var Rn=ot.filter(function(gn){return!Ie.includes(gn.value)});Rt=[].concat(Re(Rt),Re(Rn))}var zn=Wt(Rt),vn={preValue:Ct,triggerValue:pt},On=!0;(O||Ke==="selection"&&!Kt)&&(On=!1),PT(vn,pt,Ze,At,On,Ve),fe?vn.checked=Kt:vn.selected=Kt;var sr=be?zn:zn.map(function(gn){return gn.value});c(Le?sr:sr[0],be?null:zn.map(function(gn){return gn.label}),vn)}}),H=v.useCallback(function(Ze,ke){var Ke,Ee=ke.selected,Ie=ke.source,Me=yt[Ze],tt=Me==null?void 0:Me.node,pt=(Ke=tt==null?void 0:tt[Ve.value])!==null&&Ke!==void 0?Ke:Ze;if(!Le)Jt([pt],{selected:!0,triggerValue:pt},"option");else{var Kt=Ee?[].concat(Re(De),[pt]):Ae.filter(function(bn){return bn!==pt});if(xe){var Rt=Et(Kt),Rn=Rt.missingRawValues,zn=Rt.existRawValues,vn=zn.map(function(bn){return vt.get(bn).key}),On;if(Ee){var sr=Qi(vn,!0,yt);On=sr.checkedKeys}else{var gn=Qi(vn,{checked:!1,halfCheckedKeys:Qe},yt);On=gn.checkedKeys}Kt=[].concat(Re(Rn),Re(On.map(function(bn){return yt[bn].node[Ve.value]})))}Jt(Kt,{selected:Ee,triggerValue:pt},Ie||"option")}Ee||!Le?u==null||u(pt,Gd(tt)):f==null||f(pt,Gd(tt))},[Et,vt,yt,Ve,Le,De,Jt,xe,u,f,Ae,Qe]),ve=v.useCallback(function(Ze){if(ie){var ke={};Object.defineProperty(ke,"documentClickClose",{get:function(){return at(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),ie(Ze,ke)}},[ie]),pe=Eb(function(Ze,ke){var Ke=Ze.map(function(Ee){return Ee.value});if(ke.type==="clear"){Jt(Ke,{},"selection");return}ke.values.length&&H(ke.values[0].value,{selected:!1,source:"selection"})}),Je=v.useMemo(function(){return{virtual:q,dropdownMatchSelectWidth:we,listHeight:Q,listItemHeight:ue,listItemScrollOffset:de,treeData:kt,fieldNames:Ve,onSelect:H,treeExpandAction:X,treeTitleRender:se,onPopupScroll:_e}},[q,we,Q,ue,de,kt,Ve,H,X,se,_e]),gt=v.useMemo(function(){return{checkable:fe,loadData:K,treeLoadedKeys:U,onTreeLoad:A,checkedKeys:Ae,halfCheckedKeys:Qe,treeDefaultExpandAll:k,treeExpandedKeys:j,treeDefaultExpandedKeys:D,onTreeExpand:L,treeIcon:re,treeMotion:J,showTreeIcon:he,switcherIcon:Ne,treeLine:ae,treeNodeFilterProp:w,keyEntities:yt}},[fe,K,U,A,Ae,Qe,k,j,D,L,re,J,he,Ne,ae,w,yt]);return v.createElement($b.Provider,{value:Je},v.createElement(Ob.Provider,{value:gt},v.createElement(ud,rt({ref:t},Fe,{id:je,prefixCls:o,mode:Le?"multiple":void 0,displayValues:Nt,onDisplayValuesChange:pe,searchValue:ft,onSearch:_t,OptionList:_b,emptyOptions:!At.length,onDropdownVisibleChange:ve,dropdownMatchSelectWidth:we}))))});process.env.NODE_ENV!=="production"&&(Nb.displayName="TreeSelect");var rl=Nb;rl.TreeNode=Ud,rl.SHOW_ALL=qd,rl.SHOW_PARENT=Xd,rl.SHOW_CHILD=_s;const jT=e=>{const{componentCls:t,treePrefixCls:n,colorBgElevated:r}=e,o=`.${n}`;return[{[`${t}-dropdown`]:[{padding:`${Ge(e.paddingXS)} ${Ge(e.calc(e.paddingXS).div(2).equal())}`},sb(n,fn(e,{colorBgContainer:r})),{[o]:{borderRadius:0,[`${o}-list-holder-inner`]:{alignItems:"stretch",[`${o}-treenode`]:{[`${o}-node-content-wrapper`]:{flex:"auto"}}}}},Od(`${n}-checkbox`,e),{"&-rtl":{direction:"rtl",[`${o}-switcher${o}-switcher_close`]:{[`${o}-switcher-icon svg`]:{transform:"rotate(90deg)"}}}}]}]};function zT(e,t,n){return mr("TreeSelect",r=>{const o=fn(r,{treePrefixCls:t});return[jT(o)]},cb)(e,n)}var BT=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const HT=(e,t)=>{var n,{prefixCls:r,size:o,disabled:l,bordered:s=!0,className:c,rootClassName:u,treeCheckable:f,multiple:g,listHeight:h=256,listItemHeight:m=26,placement:b,notFoundContent:C,switcherIcon:S,treeLine:p,getPopupContainer:w,popupClassName:x,dropdownClassName:E,treeIcon:$=!1,transitionName:I,choiceTransitionName:O="",status:N,treeExpandAction:P,builtinPlacements:R,dropdownMatchSelectWidth:F,popupMatchSelectWidth:B,allowClear:K,variant:U,dropdownStyle:A,tagRender:k}=e,j=BT(e,["prefixCls","size","disabled","bordered","className","rootClassName","treeCheckable","multiple","listHeight","listItemHeight","placement","notFoundContent","switcherIcon","treeLine","getPopupContainer","popupClassName","dropdownClassName","treeIcon","transitionName","choiceTransitionName","status","treeExpandAction","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","allowClear","variant","dropdownStyle","tagRender"]);const{getPopupContainer:D,getPrefixCls:L,renderEmpty:X,direction:q,virtual:W,popupMatchSelectWidth:Q,popupOverflow:ne}=v.useContext(qt);if(process.env.NODE_ENV!=="production"){const St=xn("TreeSelect");process.env.NODE_ENV!=="production"&&St(g!==!1||!f,"usage","`multiple` will always be `true` when `treeCheckable` is true"),St.deprecated(!E,"dropdownClassName","popupClassName"),St.deprecated(F===void 0,"dropdownMatchSelectWidth","popupMatchSelectWidth"),process.env.NODE_ENV!=="production"&&St(!("showArrow"in j),"deprecated","`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null."),St.deprecated(!("bordered"in j),"bordered","variant")}const ue=L(),oe=L("select",r),de=L("select-tree",r),ie=L("tree-select",r),{compactSize:me,compactItemClassnames:we}=Va(oe,q),ae=br(oe),re=br(ie),[he,Ne,J]=Pm(oe,ae),[se]=zT(ie,de,re),[_e,Fe]=hs(U,s),je=Oe(x||E,`${ie}-dropdown`,{[`${ie}-dropdown-rtl`]:q==="rtl"},u,J,ae,re,Ne),xe=!!(f||g),fe=Fm(j.suffixIcon,j.showArrow),be=(n=B??F)!==null&&n!==void 0?n:Q,{status:Le,hasFeedback:Be,isFormItemInput:ze,feedbackIcon:Ue}=v.useContext(Wn),Te=Za(Le,N),{suffixIcon:We,removeIcon:Ve,clearIcon:qe}=Dm(Object.assign(Object.assign({},j),{multiple:xe,showSuffixIcon:fe,hasFeedback:Be,feedbackIcon:Ue,prefixCls:oe,componentName:"TreeSelect"})),He=K===!0?{clearIcon:qe}:K;let ft;C!==void 0?ft=C:ft=(X==null?void 0:X("Select"))||v.createElement(xm,{componentName:"Select"});const ut=ro(j,["suffixIcon","removeIcon","clearIcon","itemIcon","switcherIcon"]),_t=v.useMemo(()=>b!==void 0?b:q==="rtl"?"bottomRight":"bottomLeft",[b,q]),At=yo(St=>{var Wt;return(Wt=o??me)!==null&&Wt!==void 0?Wt:St}),ln=v.useContext(bo),yt=l??ln,vt=Oe(!r&&ie,{[`${oe}-lg`]:At==="large",[`${oe}-sm`]:At==="small",[`${oe}-rtl`]:q==="rtl",[`${oe}-${_e}`]:Fe,[`${oe}-in-form-item`]:ze},Ya(oe,Te,Be),we,c,u,J,ae,re,Ne),Et=St=>v.createElement(gb,{prefixCls:de,switcherIcon:S,treeNodeProps:St,showLine:p}),[kt]=wu("SelectLike",A==null?void 0:A.zIndex),Dt=v.createElement(rl,Object.assign({virtual:W,disabled:yt},ut,{dropdownMatchSelectWidth:be,builtinPlacements:Em(R,ne),ref:t,prefixCls:oe,className:vt,listHeight:h,listItemHeight:m,treeCheckable:f&&v.createElement("span",{className:`${oe}-tree-checkbox-inner`}),treeLine:!!p,suffixIcon:We,multiple:xe,placement:_t,removeIcon:Ve,allowClear:He,switcherIcon:Et,showTreeIcon:$,notFoundContent:ft,getPopupContainer:w||D,treeMotion:null,dropdownClassName:je,dropdownStyle:Object.assign(Object.assign({},A),{zIndex:kt}),choiceTransitionName:is(ue,"",O),transitionName:is(ue,"slide-up",I),treeExpandAction:P,tagRender:xe?k:void 0}));return he(se(Dt))},ko=v.forwardRef(HT),kT=Ap(ko);ko.TreeNode=Ud,ko.SHOW_ALL=qd,ko.SHOW_PARENT=Xd,ko.SHOW_CHILD=_s,ko._InternalPanelDoNotUseOrYouWillBeFired=kT,process.env.NODE_ENV!=="production"&&(ko.displayName="TreeSelect");const WT=ko,Yr=function({label:t,children:n,prompt:r,...o}){return Xt.jsxs("div",{className:"relative",children:[t&&Xt.jsx("div",{className:"h-8 text-sm flex justify-between items-center",children:t}),Xt.jsx("div",{className:"w-full flex items-stretch",children:n}),Xt.jsx("div",{className:"text-xs text-gray-500 min-h-5 flex items-center",children:r})]})},{TextArea:KT,Password:UT,Search:GT}=Td,qT=e=>Xt.jsx(Yr,{...e,children:Xt.jsx(Td,{...e})}),XT=({value:e,...t})=>(e=e||"系统自动生成",Xt.jsx(Yr,{...t,children:Xt.jsx(Td,{...t,disabled:!0,value:e})})),YT=e=>Xt.jsx(Yr,{...e,children:Xt.jsx(KT,{...e})}),ZT=e=>Xt.jsx(Yr,{...e,children:Xt.jsx(UT,{...e})}),QT=e=>Xt.jsx(Yr,{...e,children:Xt.jsx(GT,{...e})});function Pb(e,t="id",n="title",r="parentId",o="children",l=0,s=0){return JT(e,t,n,r,o,l,c=>({value:c[t],title:c[n],key:c[t],disabled:c[t]===s}))}function JT(e,t,n,r,o,l,s){if(!Array.isArray(e)||e.length===0)return[];const c=e.map(u=>({...u,...s(u)}));return c.filter(u=>{const f=c.filter(g=>u[t]===g[r]);return u[o]=f.length>0?f:[],u[r]===l})}var Is={exports:{}};/**
256
+ .${r}-col-xl-24${n}-label`]:ea(e),[`@media (max-width: ${Ge(e.screenXSMax)})`]:[B2(e),{[t]:{[`.${r}-col-xs-24${n}-label`]:ea(e)}}],[`@media (max-width: ${Ge(e.screenSMMax)})`]:{[t]:{[`.${r}-col-sm-24${n}-label`]:ea(e)}},[`@media (max-width: ${Ge(e.screenMDMax)})`]:{[t]:{[`.${r}-col-md-24${n}-label`]:ea(e)}},[`@media (max-width: ${Ge(e.screenLGMax)})`]:{[t]:{[`.${r}-col-lg-24${n}-label`]:ea(e)}}}},k2=e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0,inlineItemMarginBottom:0}),T0=(e,t)=>fn(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t}),Rd=mr("Form",(e,t)=>{let{rootPrefixCls:n}=t;const r=T0(e,n);return[L2(r),V2(r),D2(r),j2(r),z2(r),H2(r),Op(r),rd]},k2,{order:-1e3}),R0=[];function Md(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof e=="string"?e:`${t}-${r}`,error:e,errorStatus:n}}const M0=e=>{let{help:t,helpStatus:n,errors:r=R0,warnings:o=R0,className:l,fieldId:s,onVisibleChanged:c}=e;const{prefixCls:u}=v.useContext(td),f=`${u}-item-explain`,g=br(u),[h,m,b]=Rd(u,g),C=z.useMemo(()=>_u(u),[u]),S=Es(r),p=Es(o),w=v.useMemo(()=>t!=null?[Md(t,"help",n)]:[].concat(Re(S.map((E,$)=>Md(E,"error","error",$))),Re(p.map((E,$)=>Md(E,"warning","warning",$)))),[t,n,S,p]),x={};return s&&(x.id=`${s}_help`),h(v.createElement(di,{motionDeadline:C.motionDeadline,motionName:`${u}-show-help`,visible:!!w.length,onVisibleChanged:c},E=>{const{className:$,style:I}=E;return v.createElement("div",Object.assign({},x,{className:Oe(f,$,b,g,l,m),style:I,role:"alert"}),v.createElement(sx,Object.assign({keys:w},_u(u),{motionName:`${u}-show-help-item`,component:!1}),O=>{const{key:N,error:P,errorStatus:R,className:F,style:B}=O;return v.createElement("div",{key:N,className:Oe(F,{[`${f}-${R}`]:R}),style:B},P)}))}))},W2=["parentNode"],K2="form_item";function nl(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function A0(e,t){if(!e.length)return;const n=e.join("_");return t?`${t}_${n}`:W2.includes(n)?`${K2}_${n}`:n}function D0(e,t,n,r,o,l){let s=r;return l!==void 0?s=l:n.validating?s="validating":e.length?s="error":t.length?s="warning":(n.touched||o&&n.validated)&&(s="success"),s}function F0(e){return nl(e).join("_")}function U2(e,t){const n=t.getFieldInstance(e);if(n instanceof HTMLElement)return n;if((n==null?void 0:n.nativeElement)instanceof HTMLElement)return n.nativeElement;const r=A0(nl(e),t.__INTERNAL__.name);if(r)return document.getElementById(r)}function L0(e){const[t]=Ju(),n=v.useRef({}),r=v.useMemo(()=>e??Object.assign(Object.assign({},t),{__INTERNAL__:{itemRef:o=>l=>{const s=F0(o);l?n.current[s]=l:delete n.current[s]}},scrollToField:function(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const s=U2(o,r);s&&Zx(s,Object.assign({scrollMode:"if-needed",block:"nearest"},l))},getFieldInstance:o=>{const l=F0(o);return n.current[l]}}),[e,t]);return[r]}const Os={};function G2(e){let{name:t}=e;const n=xn("Form");z.useEffect(()=>{if(t)return Os[t]=(Os[t]||0)+1,process.env.NODE_ENV!=="production"&&n(Os[t]<=1,"usage","There exist multiple Form with same `name`."),()=>{Os[t]-=1}},[t])}var q2=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const X2=(e,t)=>{const n=v.useContext(bo),{getPrefixCls:r,direction:o,form:l}=v.useContext(qt),{prefixCls:s,className:c,rootClassName:u,size:f,disabled:g=n,form:h,colon:m,labelAlign:b,labelWrap:C,labelCol:S,wrapperCol:p,hideRequiredMark:w,layout:x="horizontal",scrollToFirstError:E,requiredMark:$,onFinishFailed:I,name:O,style:N,feedbackIcons:P,variant:R}=e,F=q2(e,["prefixCls","className","rootClassName","size","disabled","form","colon","labelAlign","labelWrap","labelCol","wrapperCol","hideRequiredMark","layout","scrollToFirstError","requiredMark","onFinishFailed","name","style","feedbackIcons","variant"]),B=yo(f),K=v.useContext(gg);process.env.NODE_ENV!=="production"&&G2(e);const U=z.useMemo(()=>$!==void 0?$:w?!1:l&&l.requiredMark!==void 0?l.requiredMark:!0,[w,$,l]),A=m??(l==null?void 0:l.colon),k=r("form",s),j=br(k),[D,L,X]=Rd(k,j),q=Oe(k,`${k}-${x}`,{[`${k}-hide-required-mark`]:U===!1,[`${k}-rtl`]:o==="rtl",[`${k}-${B}`]:B},X,j,L,l==null?void 0:l.className,c,u),[W]=L0(h),{__INTERNAL__:Q}=W;Q.name=O;const ne=z.useMemo(()=>({name:O,labelAlign:b,labelCol:S,labelWrap:C,wrapperCol:p,vertical:x==="vertical",colon:A,requiredMark:U,itemRef:Q.itemRef,form:W,feedbackIcons:P}),[O,b,S,p,x,A,U,W,P]);v.useImperativeHandle(t,()=>W);const ue=(de,ie)=>{if(de){let me={block:"nearest"};typeof de=="object"&&(me=de),W.scrollToField(ie,me)}},oe=de=>{if(I==null||I(de),de.errorFields.length){const ie=de.errorFields[0].name;if(E!==void 0){ue(E,ie);return}l&&l.scrollToFirstError!==void 0&&ue(l.scrollToFirstError,ie)}};return D(v.createElement(Ep.Provider,{value:R},v.createElement(Dg,{disabled:g},v.createElement(Aa.Provider,{value:B},v.createElement(wp,{validateMessages:K},v.createElement(Co.Provider,{value:ne},v.createElement(Ui,Object.assign({id:O},F,{name:O,onFinishFailed:oe,form:W,style:Object.assign(Object.assign({},l==null?void 0:l.style),N),className:q}))))))))},V0=v.forwardRef(X2);process.env.NODE_ENV!=="production"&&(V0.displayName="Form");const Y2=V0;function Z2(e){if(typeof e=="function")return e;const t=no(e);return t.length<=1?t[0]:t}const j0=()=>{const{status:e,errors:t=[],warnings:n=[]}=z.useContext(Wn);if(process.env.NODE_ENV!=="production"){const r=xn("Form.Item");process.env.NODE_ENV!=="production"&&r(e!==void 0,"usage","Form.Item.useStatus should be used under Form.Item component. For more information: https://u.ant.design/form-item-usestatus")}return{status:e,errors:t,warnings:n}};j0.Context=Wn;const Q2=j0;function J2(e){const[t,n]=v.useState(e),r=z.useRef(null),o=z.useRef([]),l=z.useRef(!1);v.useEffect(()=>(l.current=!1,()=>{l.current=!0,hn.cancel(r.current),r.current=null}),[]);function s(c){l.current||(r.current===null&&(o.current=[],r.current=hn(()=>{r.current=null,n(u=>{let f=u;return o.current.forEach(g=>{f=g(f)}),f})})),o.current.push(c))}return[t,s]}function eP(){const{itemRef:e}=v.useContext(Co),t=v.useRef({});function n(r,o){const l=o&&typeof o=="object"&&o.ref,s=r.join("_");return(t.current.name!==s||t.current.originRef!==l)&&(t.current.name=s,t.current.originRef=l,t.current.ref=Wr(e(r),l)),t.current.ref}return n}const tP=e=>{const{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${t}-control`]:{display:"flex"}}}},nP=Xg(["Form","item-item"],(e,t)=>{let{rootPrefixCls:n}=t;const r=T0(e,n);return[tP(r)]}),rP=e=>{const{prefixCls:t,status:n,wrapperCol:r,children:o,errors:l,warnings:s,_internalItemRender:c,extra:u,help:f,fieldId:g,marginBottom:h,onErrorVisibleChanged:m}=e,b=`${t}-item`,C=v.useContext(Co),S=r||C.wrapperCol||{},p=Oe(`${b}-control`,S.className),w=v.useMemo(()=>Object.assign({},C),[C]);delete w.labelCol,delete w.wrapperCol;const x=v.createElement("div",{className:`${b}-control-input`},v.createElement("div",{className:`${b}-control-input-content`},o)),E=v.useMemo(()=>({prefixCls:t,status:n}),[t,n]),$=h!==null||l.length||s.length?v.createElement("div",{style:{display:"flex",flexWrap:"nowrap"}},v.createElement(td.Provider,{value:E},v.createElement(M0,{fieldId:g,errors:l,warnings:s,help:f,helpStatus:n,className:`${b}-explain-connected`,onVisibleChanged:m})),!!h&&v.createElement("div",{style:{width:0,height:h}})):null,I={};g&&(I.id=`${g}_extra`);const O=u?v.createElement("div",Object.assign({},I,{className:`${b}-extra`}),u):null,N=c&&c.mark==="pro_table_render"&&c.render?c.render(e,{input:x,errorList:$,extra:O}):v.createElement(v.Fragment,null,x,$,O);return v.createElement(Co.Provider,{value:w},v.createElement(Ss,Object.assign({},S,{className:p}),N),v.createElement(nP,{prefixCls:t}))};var oP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"};const iP=oP;var aP=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:iP}))},z0=v.forwardRef(aP);process.env.NODE_ENV!=="production"&&(z0.displayName="QuestionCircleOutlined");const lP=z0;var sP=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function cP(e){return e?typeof e=="object"&&!v.isValidElement(e)?e:{title:e}:null}const uP=e=>{let{prefixCls:t,label:n,htmlFor:r,labelCol:o,labelAlign:l,colon:s,required:c,requiredMark:u,tooltip:f}=e;var g;const[h]=bg("Form"),{vertical:m,labelAlign:b,labelCol:C,labelWrap:S,colon:p}=v.useContext(Co);if(!n)return null;const w=o||C||{},x=l||b,E=`${t}-item-label`,$=Oe(E,x==="left"&&`${E}-left`,w.className,{[`${E}-wrap`]:!!S});let I=n;const O=s===!0||p!==!1&&s!==!1;O&&!m&&typeof n=="string"&&n.trim()!==""&&(I=n.replace(/[:|:]\s*$/,""));const P=cP(f);if(P){const{icon:K=v.createElement(lP,null)}=P,U=sP(P,["icon"]),A=v.createElement(XI,Object.assign({},U),v.cloneElement(K,{className:`${t}-item-tooltip`,title:"",onClick:k=>{k.preventDefault()},tabIndex:null}));I=v.createElement(v.Fragment,null,I,A)}const R=u==="optional",F=typeof u=="function";F?I=u(I,{required:!!c}):R&&!c&&(I=v.createElement(v.Fragment,null,I,v.createElement("span",{className:`${t}-item-optional`,title:""},(h==null?void 0:h.optional)||((g=li.Form)===null||g===void 0?void 0:g.optional))));const B=Oe({[`${t}-item-required`]:c,[`${t}-item-required-mark-optional`]:R||F,[`${t}-item-no-colon`]:!O});return v.createElement(Ss,Object.assign({},w,{className:$}),v.createElement("label",{htmlFor:r,className:B,title:typeof n=="string"?n:""},I))},dP={success:Tx,warning:Hx,error:Su,validating:ns};function B0(e){let{children:t,errors:n,warnings:r,hasFeedback:o,validateStatus:l,prefixCls:s,meta:c,noStyle:u}=e;const f=`${s}-item`,{feedbackIcons:g}=v.useContext(Co),h=D0(n,r,c,null,!!o,l),{isFormItemInput:m,status:b,hasFeedback:C,feedbackIcon:S}=v.useContext(Wn),p=v.useMemo(()=>{var w;let x;if(o){const $=o!==!0&&o.icons||g,I=h&&((w=$==null?void 0:$({status:h,errors:n,warnings:r}))===null||w===void 0?void 0:w[h]),O=h&&dP[h];x=I!==!1&&O?v.createElement("span",{className:Oe(`${f}-feedback-icon`,`${f}-feedback-icon-${h}`)},I||v.createElement(O,null)):null}const E={status:h||"",errors:n,warnings:r,hasFeedback:!!o,feedbackIcon:x,isFormItemInput:!0};return u&&(E.status=(h??b)||"",E.isFormItemInput=m,E.hasFeedback=!!(o??C),E.feedbackIcon=o!==void 0?E.feedbackIcon:S),E},[h,o,u,m,b]);return v.createElement(Wn.Provider,{value:p},t)}var fP=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function vP(e){const{prefixCls:t,className:n,rootClassName:r,style:o,help:l,errors:s,warnings:c,validateStatus:u,meta:f,hasFeedback:g,hidden:h,children:m,fieldId:b,required:C,isRequired:S,onSubItemMetaChange:p}=e,w=fP(e,["prefixCls","className","rootClassName","style","help","errors","warnings","validateStatus","meta","hasFeedback","hidden","children","fieldId","required","isRequired","onSubItemMetaChange"]),x=`${t}-item`,{requiredMark:E}=v.useContext(Co),$=v.useRef(null),I=Es(s),O=Es(c),N=l!=null,P=!!(N||s.length||c.length),R=!!$.current&&Iu($.current),[F,B]=v.useState(null);nn(()=>{if(P&&$.current){const j=getComputedStyle($.current);B(parseInt(j.marginBottom,10))}},[P,R]);const K=j=>{j||B(null)},A=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const D=j?I:f.errors,L=j?O:f.warnings;return D0(D,L,f,"",!!g,u)}(),k=Oe(x,n,r,{[`${x}-with-help`]:N||I.length||O.length,[`${x}-has-feedback`]:A&&g,[`${x}-has-success`]:A==="success",[`${x}-has-warning`]:A==="warning",[`${x}-has-error`]:A==="error",[`${x}-is-validating`]:A==="validating",[`${x}-hidden`]:h});return v.createElement("div",{className:k,style:o,ref:$},v.createElement(y0,Object.assign({className:`${x}-row`},ro(w,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])),v.createElement(uP,Object.assign({htmlFor:b},e,{requiredMark:E,required:C??S,prefixCls:t})),v.createElement(rP,Object.assign({},e,f,{errors:I,warnings:O,prefixCls:t,status:A,help:l,marginBottom:F,onErrorVisibleChanged:K}),v.createElement(Cp.Provider,{value:p},v.createElement(B0,{prefixCls:t,meta:f,errors:f.errors,warnings:f.warnings,hasFeedback:g,validateStatus:A},m)))),!!F&&v.createElement("div",{className:`${x}-margin-offset`,style:{marginBottom:-F}}))}const gP="__SPLIT__";function hP(e,t){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(o=>{const l=e[o],s=t[o];return l===s||typeof l=="function"||typeof s=="function"})}const pP=v.memo(e=>{let{children:t}=e;return t},(e,t)=>hP(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((n,r)=>n===t.childProps[r]));function H0(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function mP(e){const{name:t,noStyle:n,className:r,dependencies:o,prefixCls:l,shouldUpdate:s,rules:c,children:u,required:f,label:g,messageVariables:h,trigger:m="onChange",validateTrigger:b,hidden:C,help:S}=e,{getPrefixCls:p}=v.useContext(qt),{name:w}=v.useContext(Co),x=Z2(u),E=typeof x=="function",$=v.useContext(Cp),{validateTrigger:I}=v.useContext(pi),O=b!==void 0?b:I,N=t!=null,P=p("form",l),R=br(P),[F,B,K]=Rd(P,R),U=xn("Form.Item");process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&U(t!==null,"usage","`null` is passed as `name` property");const A=v.useContext(za),k=v.useRef(),[j,D]=J2({}),[L,X]=ui(()=>H0()),q=ie=>{const me=A==null?void 0:A.getKey(ie.name);if(X(ie.destroy?H0():ie,!0),n&&S!==!1&&$){let we=ie.name;if(ie.destroy)we=k.current||we;else if(me!==void 0){const[ae,re]=me;we=[ae].concat(Re(re)),k.current=we}$(ie,we)}},W=(ie,me)=>{D(we=>{const ae=Object.assign({},we),he=[].concat(Re(ie.name.slice(0,-1)),Re(me)).join(gP);return ie.destroy?delete ae[he]:ae[he]=ie,ae})},[Q,ne]=v.useMemo(()=>{const ie=Re(L.errors),me=Re(L.warnings);return Object.values(j).forEach(we=>{ie.push.apply(ie,Re(we.errors||[])),me.push.apply(me,Re(we.warnings||[]))}),[ie,me]},[j,L.errors,L.warnings]),ue=eP();function oe(ie,me,we){return n&&!C?v.createElement(B0,{prefixCls:P,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:L,errors:Q,warnings:ne,noStyle:!0},ie):v.createElement(vP,Object.assign({key:"row"},e,{className:Oe(r,K,R,B),prefixCls:P,fieldId:me,isRequired:we,errors:Q,warnings:ne,meta:L,onSubItemMetaChange:W}),ie)}if(!N&&!E&&!o)return F(oe(x));let de={};return typeof g=="string"?de.label=g:t&&(de.label=String(t)),h&&(de=Object.assign(Object.assign({},de),h)),F(v.createElement(Zu,Object.assign({},e,{messageVariables:de,trigger:m,validateTrigger:O,onMetaChange:q}),(ie,me,we)=>{const ae=nl(t).length&&me?me.name:[],re=A0(ae,w),he=f!==void 0?f:!!(c&&c.some(se=>{if(se&&typeof se=="object"&&se.required&&!se.warningOnly)return!0;if(typeof se=="function"){const _e=se(we);return _e&&_e.required&&!_e.warningOnly}return!1})),Ne=Object.assign({},ie);let J=null;if(process.env.NODE_ENV!=="production"&&U(!(s&&o),"usage","`shouldUpdate` and `dependencies` shouldn't be used together. See https://u.ant.design/form-deps."),Array.isArray(x)&&N)process.env.NODE_ENV!=="production"&&U(!1,"usage","A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://u.ant.design/complex-form-item."),J=x;else if(E&&(!(s||o)||N))process.env.NODE_ENV!=="production"&&U(!!(s||o),"usage","A `Form.Item` with a render function must have either `shouldUpdate` or `dependencies`."),process.env.NODE_ENV!=="production"&&U(!N,"usage","A `Form.Item` with a render function cannot be a field, and thus cannot have a `name` prop.");else if(o&&!E&&!N)process.env.NODE_ENV!=="production"&&U(!1,"usage","Must set `name` or use a render function when `dependencies` is set.");else if(v.isValidElement(x)){process.env.NODE_ENV!=="production"&&U(x.props.defaultValue===void 0,"usage","`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.");const se=Object.assign(Object.assign({},x.props),Ne);if(se.id||(se.id=re),S||Q.length>0||ne.length>0||e.extra){const je=[];(S||Q.length>0)&&je.push(`${re}_help`),e.extra&&je.push(`${re}_extra`),se["aria-describedby"]=je.join(" ")}Q.length>0&&(se["aria-invalid"]="true"),he&&(se["aria-required"]="true"),Mi(x)&&(se.ref=ue(ae,x)),new Set([].concat(Re(nl(m)),Re(nl(O)))).forEach(je=>{se[je]=function(){for(var xe,fe,be,Le,Be,ze=arguments.length,Ue=new Array(ze),Te=0;Te<ze;Te++)Ue[Te]=arguments[Te];(be=Ne[je])===null||be===void 0||(xe=be).call.apply(xe,[Ne].concat(Ue)),(Be=(Le=x.props)[je])===null||Be===void 0||(fe=Be).call.apply(fe,[Le].concat(Ue))}});const Fe=[se["aria-required"],se["aria-invalid"],se["aria-describedby"]];J=v.createElement(pP,{control:Ne,update:x,childProps:Fe},zo(x,se))}else E&&(s||o)&&!N?J=x(we):(process.env.NODE_ENV!=="production"&&U(!ae.length||!!n,"usage","`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead."),J=x);return oe(J,re,he)}))}const k0=mP;k0.useStatus=Q2;const bP=k0;var yP=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const SP=e=>{var{prefixCls:t,children:n}=e,r=yP(e,["prefixCls","children"]);if(process.env.NODE_ENV!=="production"){const c=xn("Form.List");process.env.NODE_ENV!=="production"&&c(typeof r.name=="number"||(Array.isArray(r.name)?!!r.name.length:!!r.name),"usage","Miss `name` prop.")}const{getPrefixCls:o}=v.useContext(qt),l=o("form",t),s=v.useMemo(()=>({prefixCls:l,status:"error"}),[l]);return v.createElement(pp,Object.assign({},r),(c,u,f)=>v.createElement(td.Provider,{value:s},n(c.map(g=>Object.assign(Object.assign({},g),{fieldKey:g.key})),u,{errors:f.errors,warnings:f.warnings})))};function CP(){const{form:e}=z.useContext(Co);return e}const wo=Y2;wo.Item=bP,wo.List=SP,wo.ErrorList=M0,wo.useForm=L0,wo.useFormInstance=CP,wo.useWatch=Sp,wo.Provider=wp,wo.create=()=>{process.env.NODE_ENV!=="production"&&Ta(!1,"Form","antd v4 removed `Form.create`. Please remove or use `@ant-design/compatible` instead.")};const Ad=wo;var Dd=v.createContext(null),wP=function(t){for(var n=t.prefixCls,r=t.level,o=t.isStart,l=t.isEnd,s="".concat(n,"-indent-unit"),c=[],u=0;u<r;u+=1)c.push(v.createElement("span",{key:u,className:Oe(s,V(V({},"".concat(s,"-start"),o[u]),"".concat(s,"-end"),l[u]))}));return v.createElement("span",{"aria-hidden":"true",className:"".concat(n,"-indent")},c)};const xP=v.memo(wP);var EP=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],W0="open",K0="close",OP="---",$P=function(e){uo(n,e);var t=ri(n);function n(){var r;Ln(this,n);for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];return r=t.call.apply(t,[this].concat(l)),V(Ce(r),"state",{dragNodeHighlight:!1}),V(Ce(r),"selectHandle",void 0),V(Ce(r),"cacheIndent",void 0),V(Ce(r),"onSelectorClick",function(c){var u=r.props.context.onNodeClick;u(c,Tn(r.props)),r.isSelectable()?r.onSelect(c):r.onCheck(c)}),V(Ce(r),"onSelectorDoubleClick",function(c){var u=r.props.context.onNodeDoubleClick;u(c,Tn(r.props))}),V(Ce(r),"onSelect",function(c){if(!r.isDisabled()){var u=r.props.context.onNodeSelect;u(c,Tn(r.props))}}),V(Ce(r),"onCheck",function(c){if(!r.isDisabled()){var u=r.props,f=u.disableCheckbox,g=u.checked,h=r.props.context.onNodeCheck;if(!(!r.isCheckable()||f)){var m=!g;h(c,Tn(r.props),m)}}}),V(Ce(r),"onMouseEnter",function(c){var u=r.props.context.onNodeMouseEnter;u(c,Tn(r.props))}),V(Ce(r),"onMouseLeave",function(c){var u=r.props.context.onNodeMouseLeave;u(c,Tn(r.props))}),V(Ce(r),"onContextMenu",function(c){var u=r.props.context.onNodeContextMenu;u(c,Tn(r.props))}),V(Ce(r),"onDragStart",function(c){var u=r.props.context.onNodeDragStart;c.stopPropagation(),r.setState({dragNodeHighlight:!0}),u(c,Ce(r));try{c.dataTransfer.setData("text/plain","")}catch{}}),V(Ce(r),"onDragEnter",function(c){var u=r.props.context.onNodeDragEnter;c.preventDefault(),c.stopPropagation(),u(c,Ce(r))}),V(Ce(r),"onDragOver",function(c){var u=r.props.context.onNodeDragOver;c.preventDefault(),c.stopPropagation(),u(c,Ce(r))}),V(Ce(r),"onDragLeave",function(c){var u=r.props.context.onNodeDragLeave;c.stopPropagation(),u(c,Ce(r))}),V(Ce(r),"onDragEnd",function(c){var u=r.props.context.onNodeDragEnd;c.stopPropagation(),r.setState({dragNodeHighlight:!1}),u(c,Ce(r))}),V(Ce(r),"onDrop",function(c){var u=r.props.context.onNodeDrop;c.preventDefault(),c.stopPropagation(),r.setState({dragNodeHighlight:!1}),u(c,Ce(r))}),V(Ce(r),"onExpand",function(c){var u=r.props,f=u.loading,g=u.context.onNodeExpand;f||g(c,Tn(r.props))}),V(Ce(r),"setSelectHandle",function(c){r.selectHandle=c}),V(Ce(r),"getNodeState",function(){var c=r.props.expanded;return r.isLeaf()?null:c?W0:K0}),V(Ce(r),"hasChildren",function(){var c=r.props.eventKey,u=r.props.context.keyEntities,f=lr(u,c)||{},g=f.children;return!!(g||[]).length}),V(Ce(r),"isLeaf",function(){var c=r.props,u=c.isLeaf,f=c.loaded,g=r.props.context.loadData,h=r.hasChildren();return u===!1?!1:u||!g&&!h||g&&f&&!h}),V(Ce(r),"isDisabled",function(){var c=r.props.disabled,u=r.props.context.disabled;return!!(u||c)}),V(Ce(r),"isCheckable",function(){var c=r.props.checkable,u=r.props.context.checkable;return!u||c===!1?!1:u}),V(Ce(r),"syncLoadData",function(c){var u=c.expanded,f=c.loading,g=c.loaded,h=r.props.context,m=h.loadData,b=h.onNodeLoad;f||m&&u&&!r.isLeaf()&&!g&&b(Tn(r.props))}),V(Ce(r),"isDraggable",function(){var c=r.props,u=c.data,f=c.context.draggable;return!!(f&&(!f.nodeDraggable||f.nodeDraggable(u)))}),V(Ce(r),"renderDragHandler",function(){var c=r.props.context,u=c.draggable,f=c.prefixCls;return u!=null&&u.icon?v.createElement("span",{className:"".concat(f,"-draggable-icon")},u.icon):null}),V(Ce(r),"renderSwitcherIconDom",function(c){var u=r.props.switcherIcon,f=r.props.context.switcherIcon,g=u||f;return typeof g=="function"?g(Z(Z({},r.props),{},{isLeaf:c})):g}),V(Ce(r),"renderSwitcher",function(){var c=r.props.expanded,u=r.props.context.prefixCls;if(r.isLeaf()){var f=r.renderSwitcherIconDom(!0);return f!==!1?v.createElement("span",{className:Oe("".concat(u,"-switcher"),"".concat(u,"-switcher-noop"))},f):null}var g=Oe("".concat(u,"-switcher"),"".concat(u,"-switcher_").concat(c?W0:K0)),h=r.renderSwitcherIconDom(!1);return h!==!1?v.createElement("span",{onClick:r.onExpand,className:g},h):null}),V(Ce(r),"renderCheckbox",function(){var c=r.props,u=c.checked,f=c.halfChecked,g=c.disableCheckbox,h=r.props.context.prefixCls,m=r.isDisabled(),b=r.isCheckable();if(!b)return null;var C=typeof b!="boolean"?b:null;return v.createElement("span",{className:Oe("".concat(h,"-checkbox"),u&&"".concat(h,"-checkbox-checked"),!u&&f&&"".concat(h,"-checkbox-indeterminate"),(m||g)&&"".concat(h,"-checkbox-disabled")),onClick:r.onCheck},C)}),V(Ce(r),"renderIcon",function(){var c=r.props.loading,u=r.props.context.prefixCls;return v.createElement("span",{className:Oe("".concat(u,"-iconEle"),"".concat(u,"-icon__").concat(r.getNodeState()||"docu"),c&&"".concat(u,"-icon_loading"))})}),V(Ce(r),"renderSelector",function(){var c=r.state.dragNodeHighlight,u=r.props,f=u.title,g=f===void 0?OP:f,h=u.selected,m=u.icon,b=u.loading,C=u.data,S=r.props.context,p=S.prefixCls,w=S.showIcon,x=S.icon,E=S.loadData,$=S.titleRender,I=r.isDisabled(),O="".concat(p,"-node-content-wrapper"),N;if(w){var P=m||x;N=P?v.createElement("span",{className:Oe("".concat(p,"-iconEle"),"".concat(p,"-icon__customize"))},typeof P=="function"?P(r.props):P):r.renderIcon()}else E&&b&&(N=r.renderIcon());var R;typeof g=="function"?R=g(C):$?R=$(C):R=g;var F=v.createElement("span",{className:"".concat(p,"-title")},R);return v.createElement("span",{ref:r.setSelectHandle,title:typeof g=="string"?g:"",className:Oe("".concat(O),"".concat(O,"-").concat(r.getNodeState()||"normal"),!I&&(h||c)&&"".concat(p,"-node-selected")),onMouseEnter:r.onMouseEnter,onMouseLeave:r.onMouseLeave,onContextMenu:r.onContextMenu,onClick:r.onSelectorClick,onDoubleClick:r.onSelectorDoubleClick},N,F,r.renderDropIndicator())}),V(Ce(r),"renderDropIndicator",function(){var c=r.props,u=c.disabled,f=c.eventKey,g=r.props.context,h=g.draggable,m=g.dropLevelOffset,b=g.dropPosition,C=g.prefixCls,S=g.indent,p=g.dropIndicatorRender,w=g.dragOverNodeKey,x=g.direction,E=!!h,$=!u&&E&&w===f,I=S??r.cacheIndent;return r.cacheIndent=S,$?p({dropPosition:b,dropLevelOffset:m,indent:I,prefixCls:C,direction:x}):null}),r}return Vn(n,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var o=this.props.selectable,l=this.props.context.selectable;return typeof o=="boolean"?o:l}},{key:"render",value:function(){var o,l=this.props,s=l.eventKey,c=l.className,u=l.style,f=l.dragOver,g=l.dragOverGapTop,h=l.dragOverGapBottom,m=l.isLeaf,b=l.isStart,C=l.isEnd,S=l.expanded,p=l.selected,w=l.checked,x=l.halfChecked,E=l.loading,$=l.domRef,I=l.active;l.data;var O=l.onMouseMove,N=l.selectable,P=Gt(l,EP),R=this.props.context,F=R.prefixCls,B=R.filterTreeNode,K=R.keyEntities,U=R.dropContainerKey,A=R.dropTargetKey,k=R.draggingNodeKey,j=this.isDisabled(),D=jo(P,{aria:!0,data:!0}),L=lr(K,s)||{},X=L.level,q=C[C.length-1],W=this.isDraggable(),Q=!j&&W,ne=k===s,ue=N!==void 0?{"aria-selected":!!N}:void 0;return v.createElement("div",rt({ref:$,className:Oe(c,"".concat(F,"-treenode"),(o={},V(V(V(V(V(V(V(V(V(V(o,"".concat(F,"-treenode-disabled"),j),"".concat(F,"-treenode-switcher-").concat(S?"open":"close"),!m),"".concat(F,"-treenode-checkbox-checked"),w),"".concat(F,"-treenode-checkbox-indeterminate"),x),"".concat(F,"-treenode-selected"),p),"".concat(F,"-treenode-loading"),E),"".concat(F,"-treenode-active"),I),"".concat(F,"-treenode-leaf-last"),q),"".concat(F,"-treenode-draggable"),W),"dragging",ne),V(V(V(V(V(V(o,"drop-target",A===s),"drop-container",U===s),"drag-over",!j&&f),"drag-over-gap-top",!j&&g),"drag-over-gap-bottom",!j&&h),"filter-node",B&&B(Tn(this.props))))),style:u,draggable:Q,"aria-grabbed":ne,onDragStart:Q?this.onDragStart:void 0,onDragEnter:W?this.onDragEnter:void 0,onDragOver:W?this.onDragOver:void 0,onDragLeave:W?this.onDragLeave:void 0,onDrop:W?this.onDrop:void 0,onDragEnd:W?this.onDragEnd:void 0,onMouseMove:O},ue,D),v.createElement(xP,{prefixCls:F,level:X,isStart:b,isEnd:C}),this.renderDragHandler(),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),n}(v.Component),ta=function(t){return v.createElement(Dd.Consumer,null,function(n){return v.createElement($P,rt({},t,{context:n}))})};ta.displayName="TreeNode",ta.isTreeNode=1;function xo(e,t){if(!e)return[];var n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function Ho(e,t){var n=(e||[]).slice();return n.indexOf(t)===-1&&n.push(t),n}function Fd(e){return e.split("-")}function _P(e,t){var n=[],r=lr(t,e);function o(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];l.forEach(function(s){var c=s.key,u=s.children;n.push(c),o(u)})}return o(r.children),n}function IP(e){if(e.parent){var t=Fd(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function NP(e){var t=Fd(e.pos);return Number(t[t.length-1])===0}function U0(e,t,n,r,o,l,s,c,u,f){var g,h=e.clientX,m=e.clientY,b=e.target.getBoundingClientRect(),C=b.top,S=b.height,p=(f==="rtl"?-1:1)*(((o==null?void 0:o.x)||0)-h),w=(p-12)/r,x=u.filter(function(j){var D;return(D=c[j])===null||D===void 0||(D=D.children)===null||D===void 0?void 0:D.length}),E=lr(c,n.props.eventKey);if(m<C+S/2){var $=s.findIndex(function(j){return j.key===E.key}),I=$<=0?0:$-1,O=s[I].key;E=lr(c,O)}var N=E.key,P=E,R=E.key,F=0,B=0;if(!x.includes(N))for(var K=0;K<w&&IP(E);K+=1)E=E.parent,B+=1;var U=t.props.data,A=E.node,k=!0;return NP(E)&&E.level===0&&m<C+S/2&&l({dragNode:U,dropNode:A,dropPosition:-1})&&E.key===n.props.eventKey?F=-1:(P.children||[]).length&&x.includes(R)?l({dragNode:U,dropNode:A,dropPosition:0})?F=0:k=!1:B===0?w>-1.5?l({dragNode:U,dropNode:A,dropPosition:1})?F=1:k=!1:l({dragNode:U,dropNode:A,dropPosition:0})?F=0:l({dragNode:U,dropNode:A,dropPosition:1})?F=1:k=!1:l({dragNode:U,dropNode:A,dropPosition:1})?F=1:k=!1,{dropPosition:F,dropLevelOffset:B,dropTargetKey:E.key,dropTargetPos:E.pos,dragOverNodeKey:R,dropContainerKey:F===0?null:((g=E.parent)===null||g===void 0?void 0:g.key)||null,dropAllowed:k}}function G0(e,t){if(e){var n=t.multiple;return n?e.slice():e.length?[e[0]]:e}}function Ld(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(ct(e)==="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return at(!1,"`checkedKeys` is not an array or an object"),null;return t}function Vd(e,t){var n=new Set;function r(o){if(!n.has(o)){var l=lr(t,o);if(l){n.add(o);var s=l.parent,c=l.node;c.disabled||s&&r(s.key)}}}return(e||[]).forEach(function(o){r(o)}),Re(n)}function PP(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case-1:o.top=0,o.left=-n*r;break;case 1:o.bottom=0,o.left=-n*r;break;case 0:o.bottom=0,o.left=r;break}return v.createElement("div",{style:o})}function q0(e){if(e==null)throw new TypeError("Cannot destructure "+e)}function TP(e,t){var n=v.useState(!1),r=ce(n,2),o=r[0],l=r[1];nn(function(){if(o)return e(),function(){t()}},[o]),nn(function(){return l(!0),function(){l(!1)}},[])}var RP=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],X0=function(t,n){var r=t.className,o=t.style,l=t.motion,s=t.motionNodes,c=t.motionType,u=t.onMotionStart,f=t.onMotionEnd,g=t.active,h=t.treeNodeRequiredProps,m=Gt(t,RP),b=v.useState(!0),C=ce(b,2),S=C[0],p=C[1],w=v.useContext(Dd),x=w.prefixCls,E=s&&c!=="hide";nn(function(){s&&E!==S&&p(E)},[s]);var $=function(){s&&u()},I=v.useRef(!1),O=function(){s&&!I.current&&(I.current=!0,f())};TP($,O);var N=function(R){E===R&&O()};return s?v.createElement(di,rt({ref:n,visible:S},l,{motionAppear:c==="show",onVisibleChanged:N}),function(P,R){var F=P.className,B=P.style;return v.createElement("div",{ref:R,className:Oe("".concat(x,"-treenode-motion"),F),style:B},s.map(function(K){var U=Object.assign({},(q0(K.data),K.data)),A=K.title,k=K.key,j=K.isStart,D=K.isEnd;delete U.children;var L=tl(k,h);return v.createElement(ta,rt({},U,L,{title:A,active:g,data:K.data,key:k,isStart:j,isEnd:D}))}))}):v.createElement(ta,rt({domRef:n,className:r,style:o},m,{active:g}))};X0.displayName="MotionTreeNode";var MP=v.forwardRef(X0);function AP(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e.length,r=t.length;if(Math.abs(n-r)!==1)return{add:!1,key:null};function o(l,s){var c=new Map;l.forEach(function(f){c.set(f,!0)});var u=s.filter(function(f){return!c.has(f)});return u.length===1?u[0]:null}return n<r?{add:!0,key:o(e,t)}:{add:!1,key:o(t,e)}}function Y0(e,t,n){var r=e.findIndex(function(c){return c.key===n}),o=e[r+1],l=t.findIndex(function(c){return c.key===n});if(o){var s=t.findIndex(function(c){return c.key===o.key});return t.slice(l+1,s)}return t.slice(l+1)}var DP=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],Z0={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},FP=function(){},bi="RC_TREE_MOTION_".concat(Math.random()),jd={key:bi},Q0={key:bi,level:0,index:0,pos:"0",node:jd,nodes:[jd]},J0={parent:null,children:[],pos:Q0.pos,data:jd,title:null,key:bi,isStart:[],isEnd:[]};function eb(e,t,n,r){return t===!1||!n?e:e.slice(0,Math.ceil(n/r)+1)}function tb(e){var t=e.key,n=e.pos;return el(t,n)}function LP(e){for(var t=String(e.data.key),n=e;n.parent;)n=n.parent,t="".concat(n.data.key," > ").concat(t);return t}var nb=v.forwardRef(function(e,t){var n=e.prefixCls,r=e.data;e.selectable,e.checkable;var o=e.expandedKeys,l=e.selectedKeys,s=e.checkedKeys,c=e.loadedKeys,u=e.loadingKeys,f=e.halfCheckedKeys,g=e.keyEntities,h=e.disabled,m=e.dragging,b=e.dragOverNodeKey,C=e.dropPosition,S=e.motion,p=e.height,w=e.itemHeight,x=e.virtual,E=e.focusable,$=e.activeItem,I=e.focused,O=e.tabIndex,N=e.onKeyDown,P=e.onFocus,R=e.onBlur,F=e.onActiveChange,B=e.onListChangeStart,K=e.onListChangeEnd,U=Gt(e,DP),A=v.useRef(null),k=v.useRef(null);v.useImperativeHandle(t,function(){return{scrollTo:function(be){A.current.scrollTo(be)},getIndentWidth:function(){return k.current.offsetWidth}}});var j=v.useState(o),D=ce(j,2),L=D[0],X=D[1],q=v.useState(r),W=ce(q,2),Q=W[0],ne=W[1],ue=v.useState(r),oe=ce(ue,2),de=oe[0],ie=oe[1],me=v.useState([]),we=ce(me,2),ae=we[0],re=we[1],he=v.useState(null),Ne=ce(he,2),J=Ne[0],se=Ne[1],_e=v.useRef(r);_e.current=r;function Fe(){var fe=_e.current;ne(fe),ie(fe),re([]),se(null),K()}nn(function(){X(o);var fe=AP(L,o);if(fe.key!==null)if(fe.add){var be=Q.findIndex(function(We){var Ve=We.key;return Ve===fe.key}),Le=eb(Y0(Q,r,fe.key),x,p,w),Be=Q.slice();Be.splice(be+1,0,J0),ie(Be),re(Le),se("show")}else{var ze=r.findIndex(function(We){var Ve=We.key;return Ve===fe.key}),Ue=eb(Y0(r,Q,fe.key),x,p,w),Te=r.slice();Te.splice(ze+1,0,J0),ie(Te),re(Ue),se("hide")}else Q!==r&&(ne(r),ie(r))},[o,r]),v.useEffect(function(){m||Fe()},[m]);var je=S?de:r,xe={expandedKeys:o,selectedKeys:l,loadedKeys:c,loadingKeys:u,checkedKeys:s,halfCheckedKeys:f,dragOverNodeKey:b,dropPosition:C,keyEntities:g};return v.createElement(v.Fragment,null,I&&$&&v.createElement("span",{style:Z0,"aria-live":"assertive"},LP($)),v.createElement("div",null,v.createElement("input",{style:Z0,disabled:E===!1||h,tabIndex:E!==!1?O:null,onKeyDown:N,onFocus:P,onBlur:R,value:"",onChange:FP,"aria-label":"for screen reader"})),v.createElement("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},v.createElement("div",{className:"".concat(n,"-indent")},v.createElement("div",{ref:k,className:"".concat(n,"-indent-unit")}))),v.createElement(gd,rt({},U,{data:je,itemKey:tb,height:p,fullHeight:!1,virtual:x,itemHeight:w,prefixCls:"".concat(n,"-list"),ref:A,onVisibleChange:function(be,Le){var Be=new Set(be),ze=Le.filter(function(Ue){return!Be.has(Ue)});ze.some(function(Ue){return tb(Ue)===bi})&&Fe()}}),function(fe){var be=fe.pos,Le=Object.assign({},(q0(fe.data),fe.data)),Be=fe.title,ze=fe.key,Ue=fe.isStart,Te=fe.isEnd,We=el(ze,be);delete Le.key,delete Le.children;var Ve=tl(We,xe);return v.createElement(MP,rt({},Le,Ve,{title:Be,active:!!$&&ze===$.key,pos:be,data:fe.data,isStart:Ue,isEnd:Te,motion:S,motionNodes:ze===bi?ae:null,motionType:J,onMotionStart:B,onMotionEnd:Fe,treeNodeRequiredProps:xe,onMouseMove:function(){F(null)}}))}))});nb.displayName="NodeList";var VP=10,$s=function(e){uo(n,e);var t=ri(n);function n(){var r;Ln(this,n);for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];return r=t.call.apply(t,[this].concat(l)),V(Ce(r),"destroyed",!1),V(Ce(r),"delayedDragEnterLogic",void 0),V(Ce(r),"loadingRetryTimes",{}),V(Ce(r),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:Zi()}),V(Ce(r),"dragStartMousePosition",null),V(Ce(r),"dragNode",void 0),V(Ce(r),"currentMouseOverDroppableNodeKey",null),V(Ce(r),"listRef",v.createRef()),V(Ce(r),"onNodeDragStart",function(c,u){var f=r.state,g=f.expandedKeys,h=f.keyEntities,m=r.props.onDragStart,b=u.props.eventKey;r.dragNode=u,r.dragStartMousePosition={x:c.clientX,y:c.clientY};var C=xo(g,b);r.setState({draggingNodeKey:b,dragChildrenKeys:_P(b,h),indent:r.listRef.current.getIndentWidth()}),r.setExpandedKeys(C),window.addEventListener("dragend",r.onWindowDragEnd),m==null||m({event:c,node:Tn(u.props)})}),V(Ce(r),"onNodeDragEnter",function(c,u){var f=r.state,g=f.expandedKeys,h=f.keyEntities,m=f.dragChildrenKeys,b=f.flattenNodes,C=f.indent,S=r.props,p=S.onDragEnter,w=S.onExpand,x=S.allowDrop,E=S.direction,$=u.props,I=$.pos,O=$.eventKey,N=Ce(r),P=N.dragNode;if(r.currentMouseOverDroppableNodeKey!==O&&(r.currentMouseOverDroppableNodeKey=O),!P){r.resetDragState();return}var R=U0(c,P,u,C,r.dragStartMousePosition,x,b,h,g,E),F=R.dropPosition,B=R.dropLevelOffset,K=R.dropTargetKey,U=R.dropContainerKey,A=R.dropTargetPos,k=R.dropAllowed,j=R.dragOverNodeKey;if(m.indexOf(K)!==-1||!k){r.resetDragState();return}if(r.delayedDragEnterLogic||(r.delayedDragEnterLogic={}),Object.keys(r.delayedDragEnterLogic).forEach(function(D){clearTimeout(r.delayedDragEnterLogic[D])}),P.props.eventKey!==u.props.eventKey&&(c.persist(),r.delayedDragEnterLogic[I]=window.setTimeout(function(){if(r.state.draggingNodeKey!==null){var D=Re(g),L=lr(h,u.props.eventKey);L&&(L.children||[]).length&&(D=Ho(g,u.props.eventKey)),"expandedKeys"in r.props||r.setExpandedKeys(D),w==null||w(D,{node:Tn(u.props),expanded:!0,nativeEvent:c.nativeEvent})}},800)),P.props.eventKey===K&&B===0){r.resetDragState();return}r.setState({dragOverNodeKey:j,dropPosition:F,dropLevelOffset:B,dropTargetKey:K,dropContainerKey:U,dropTargetPos:A,dropAllowed:k}),p==null||p({event:c,node:Tn(u.props),expandedKeys:g})}),V(Ce(r),"onNodeDragOver",function(c,u){var f=r.state,g=f.dragChildrenKeys,h=f.flattenNodes,m=f.keyEntities,b=f.expandedKeys,C=f.indent,S=r.props,p=S.onDragOver,w=S.allowDrop,x=S.direction,E=Ce(r),$=E.dragNode;if($){var I=U0(c,$,u,C,r.dragStartMousePosition,w,h,m,b,x),O=I.dropPosition,N=I.dropLevelOffset,P=I.dropTargetKey,R=I.dropContainerKey,F=I.dropAllowed,B=I.dropTargetPos,K=I.dragOverNodeKey;g.indexOf(P)!==-1||!F||($.props.eventKey===P&&N===0?r.state.dropPosition===null&&r.state.dropLevelOffset===null&&r.state.dropTargetKey===null&&r.state.dropContainerKey===null&&r.state.dropTargetPos===null&&r.state.dropAllowed===!1&&r.state.dragOverNodeKey===null||r.resetDragState():O===r.state.dropPosition&&N===r.state.dropLevelOffset&&P===r.state.dropTargetKey&&R===r.state.dropContainerKey&&B===r.state.dropTargetPos&&F===r.state.dropAllowed&&K===r.state.dragOverNodeKey||r.setState({dropPosition:O,dropLevelOffset:N,dropTargetKey:P,dropContainerKey:R,dropTargetPos:B,dropAllowed:F,dragOverNodeKey:K}),p==null||p({event:c,node:Tn(u.props)}))}}),V(Ce(r),"onNodeDragLeave",function(c,u){r.currentMouseOverDroppableNodeKey===u.props.eventKey&&!c.currentTarget.contains(c.relatedTarget)&&(r.resetDragState(),r.currentMouseOverDroppableNodeKey=null);var f=r.props.onDragLeave;f==null||f({event:c,node:Tn(u.props)})}),V(Ce(r),"onWindowDragEnd",function(c){r.onNodeDragEnd(c,null,!0),window.removeEventListener("dragend",r.onWindowDragEnd)}),V(Ce(r),"onNodeDragEnd",function(c,u){var f=r.props.onDragEnd;r.setState({dragOverNodeKey:null}),r.cleanDragState(),f==null||f({event:c,node:Tn(u.props)}),r.dragNode=null,window.removeEventListener("dragend",r.onWindowDragEnd)}),V(Ce(r),"onNodeDrop",function(c,u){var f,g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,h=r.state,m=h.dragChildrenKeys,b=h.dropPosition,C=h.dropTargetKey,S=h.dropTargetPos,p=h.dropAllowed;if(p){var w=r.props.onDrop;if(r.setState({dragOverNodeKey:null}),r.cleanDragState(),C!==null){var x=Z(Z({},tl(C,r.getTreeNodeRequiredProps())),{},{active:((f=r.getActiveItem())===null||f===void 0?void 0:f.key)===C,data:lr(r.state.keyEntities,C).node}),E=m.indexOf(C)!==-1;at(!E,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var $=Fd(S),I={event:c,node:Tn(x),dragNode:r.dragNode?Tn(r.dragNode.props):null,dragNodesKeys:[r.dragNode.props.eventKey].concat(m),dropToGap:b!==0,dropPosition:b+Number($[$.length-1])};g||w==null||w(I),r.dragNode=null}}}),V(Ce(r),"cleanDragState",function(){var c=r.state.draggingNodeKey;c!==null&&r.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),r.dragStartMousePosition=null,r.currentMouseOverDroppableNodeKey=null}),V(Ce(r),"triggerExpandActionExpand",function(c,u){var f=r.state,g=f.expandedKeys,h=f.flattenNodes,m=u.expanded,b=u.key,C=u.isLeaf;if(!(C||c.shiftKey||c.metaKey||c.ctrlKey)){var S=h.filter(function(w){return w.key===b})[0],p=Tn(Z(Z({},tl(b,r.getTreeNodeRequiredProps())),{},{data:S.data}));r.setExpandedKeys(m?xo(g,b):Ho(g,b)),r.onNodeExpand(c,p)}}),V(Ce(r),"onNodeClick",function(c,u){var f=r.props,g=f.onClick,h=f.expandAction;h==="click"&&r.triggerExpandActionExpand(c,u),g==null||g(c,u)}),V(Ce(r),"onNodeDoubleClick",function(c,u){var f=r.props,g=f.onDoubleClick,h=f.expandAction;h==="doubleClick"&&r.triggerExpandActionExpand(c,u),g==null||g(c,u)}),V(Ce(r),"onNodeSelect",function(c,u){var f=r.state.selectedKeys,g=r.state,h=g.keyEntities,m=g.fieldNames,b=r.props,C=b.onSelect,S=b.multiple,p=u.selected,w=u[m.key],x=!p;x?S?f=Ho(f,w):f=[w]:f=xo(f,w);var E=f.map(function($){var I=lr(h,$);return I?I.node:null}).filter(function($){return $});r.setUncontrolledState({selectedKeys:f}),C==null||C(f,{event:"select",selected:x,node:u,selectedNodes:E,nativeEvent:c.nativeEvent})}),V(Ce(r),"onNodeCheck",function(c,u,f){var g=r.state,h=g.keyEntities,m=g.checkedKeys,b=g.halfCheckedKeys,C=r.props,S=C.checkStrictly,p=C.onCheck,w=u.key,x,E={event:"check",node:u,checked:f,nativeEvent:c.nativeEvent};if(S){var $=f?Ho(m,w):xo(m,w),I=xo(b,w);x={checked:$,halfChecked:I},E.checkedNodes=$.map(function(B){return lr(h,B)}).filter(function(B){return B}).map(function(B){return B.node}),r.setUncontrolledState({checkedKeys:$})}else{var O=Qi([].concat(Re(m),[w]),!0,h),N=O.checkedKeys,P=O.halfCheckedKeys;if(!f){var R=new Set(N);R.delete(w);var F=Qi(Array.from(R),{checked:!1,halfCheckedKeys:P},h);N=F.checkedKeys,P=F.halfCheckedKeys}x=N,E.checkedNodes=[],E.checkedNodesPositions=[],E.halfCheckedKeys=P,N.forEach(function(B){var K=lr(h,B);if(K){var U=K.node,A=K.pos;E.checkedNodes.push(U),E.checkedNodesPositions.push({node:U,pos:A})}}),r.setUncontrolledState({checkedKeys:N},!1,{halfCheckedKeys:P})}p==null||p(x,E)}),V(Ce(r),"onNodeLoad",function(c){var u,f=c.key,g=r.state.keyEntities,h=lr(g,f);if(!(h!=null&&(u=h.children)!==null&&u!==void 0&&u.length)){var m=new Promise(function(b,C){r.setState(function(S){var p=S.loadedKeys,w=p===void 0?[]:p,x=S.loadingKeys,E=x===void 0?[]:x,$=r.props,I=$.loadData,O=$.onLoad;if(!I||w.indexOf(f)!==-1||E.indexOf(f)!==-1)return null;var N=I(c);return N.then(function(){var P=r.state.loadedKeys,R=Ho(P,f);O==null||O(R,{event:"load",node:c}),r.setUncontrolledState({loadedKeys:R}),r.setState(function(F){return{loadingKeys:xo(F.loadingKeys,f)}}),b()}).catch(function(P){if(r.setState(function(F){return{loadingKeys:xo(F.loadingKeys,f)}}),r.loadingRetryTimes[f]=(r.loadingRetryTimes[f]||0)+1,r.loadingRetryTimes[f]>=VP){var R=r.state.loadedKeys;at(!1,"Retry for `loadData` many times but still failed. No more retry."),r.setUncontrolledState({loadedKeys:Ho(R,f)}),b()}C(P)}),{loadingKeys:Ho(E,f)}})});return m.catch(function(){}),m}}),V(Ce(r),"onNodeMouseEnter",function(c,u){var f=r.props.onMouseEnter;f==null||f({event:c,node:u})}),V(Ce(r),"onNodeMouseLeave",function(c,u){var f=r.props.onMouseLeave;f==null||f({event:c,node:u})}),V(Ce(r),"onNodeContextMenu",function(c,u){var f=r.props.onRightClick;f&&(c.preventDefault(),f({event:c,node:u}))}),V(Ce(r),"onFocus",function(){var c=r.props.onFocus;r.setState({focused:!0});for(var u=arguments.length,f=new Array(u),g=0;g<u;g++)f[g]=arguments[g];c==null||c.apply(void 0,f)}),V(Ce(r),"onBlur",function(){var c=r.props.onBlur;r.setState({focused:!1}),r.onActiveChange(null);for(var u=arguments.length,f=new Array(u),g=0;g<u;g++)f[g]=arguments[g];c==null||c.apply(void 0,f)}),V(Ce(r),"getTreeNodeRequiredProps",function(){var c=r.state,u=c.expandedKeys,f=c.selectedKeys,g=c.loadedKeys,h=c.loadingKeys,m=c.checkedKeys,b=c.halfCheckedKeys,C=c.dragOverNodeKey,S=c.dropPosition,p=c.keyEntities;return{expandedKeys:u||[],selectedKeys:f||[],loadedKeys:g||[],loadingKeys:h||[],checkedKeys:m||[],halfCheckedKeys:b||[],dragOverNodeKey:C,dropPosition:S,keyEntities:p}}),V(Ce(r),"setExpandedKeys",function(c){var u=r.state,f=u.treeData,g=u.fieldNames,h=xd(f,c,g);r.setUncontrolledState({expandedKeys:c,flattenNodes:h},!0)}),V(Ce(r),"onNodeExpand",function(c,u){var f=r.state.expandedKeys,g=r.state,h=g.listChanging,m=g.fieldNames,b=r.props,C=b.onExpand,S=b.loadData,p=u.expanded,w=u[m.key];if(!h){var x=f.indexOf(w),E=!p;if(at(p&&x!==-1||!p&&x===-1,"Expand state not sync with index check"),E?f=Ho(f,w):f=xo(f,w),r.setExpandedKeys(f),C==null||C(f,{node:u,expanded:E,nativeEvent:c.nativeEvent}),E&&S){var $=r.onNodeLoad(u);$&&$.then(function(){var I=xd(r.state.treeData,f,m);r.setUncontrolledState({flattenNodes:I})}).catch(function(){var I=r.state.expandedKeys,O=xo(I,w);r.setExpandedKeys(O)})}}}),V(Ce(r),"onListChangeStart",function(){r.setUncontrolledState({listChanging:!0})}),V(Ce(r),"onListChangeEnd",function(){setTimeout(function(){r.setUncontrolledState({listChanging:!1})})}),V(Ce(r),"onActiveChange",function(c){var u=r.state.activeKey,f=r.props,g=f.onActiveChange,h=f.itemScrollOffset,m=h===void 0?0:h;u!==c&&(r.setState({activeKey:c}),c!==null&&r.scrollTo({key:c,offset:m}),g==null||g(c))}),V(Ce(r),"getActiveItem",function(){var c=r.state,u=c.activeKey,f=c.flattenNodes;return u===null?null:f.find(function(g){var h=g.key;return h===u})||null}),V(Ce(r),"offsetActiveKey",function(c){var u=r.state,f=u.flattenNodes,g=u.activeKey,h=f.findIndex(function(C){var S=C.key;return S===g});h===-1&&c<0&&(h=f.length),h=(h+c+f.length)%f.length;var m=f[h];if(m){var b=m.key;r.onActiveChange(b)}else r.onActiveChange(null)}),V(Ce(r),"onKeyDown",function(c){var u=r.state,f=u.activeKey,g=u.expandedKeys,h=u.checkedKeys,m=u.fieldNames,b=r.props,C=b.onKeyDown,S=b.checkable,p=b.selectable;switch(c.which){case Pe.UP:{r.offsetActiveKey(-1),c.preventDefault();break}case Pe.DOWN:{r.offsetActiveKey(1),c.preventDefault();break}}var w=r.getActiveItem();if(w&&w.data){var x=r.getTreeNodeRequiredProps(),E=w.data.isLeaf===!1||!!(w.data[m.children]||[]).length,$=Tn(Z(Z({},tl(f,x)),{},{data:w.data,active:!0}));switch(c.which){case Pe.LEFT:{E&&g.includes(f)?r.onNodeExpand({},$):w.parent&&r.onActiveChange(w.parent.key),c.preventDefault();break}case Pe.RIGHT:{E&&!g.includes(f)?r.onNodeExpand({},$):w.children&&w.children.length&&r.onActiveChange(w.children[0].key),c.preventDefault();break}case Pe.ENTER:case Pe.SPACE:{S&&!$.disabled&&$.checkable!==!1&&!$.disableCheckbox?r.onNodeCheck({},$,!h.includes(f)):!S&&p&&!$.disabled&&$.selectable!==!1&&r.onNodeSelect({},$);break}}}C==null||C(c)}),V(Ce(r),"setUncontrolledState",function(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!r.destroyed){var g=!1,h=!0,m={};Object.keys(c).forEach(function(b){if(b in r.props){h=!1;return}g=!0,m[b]=c[b]}),g&&(!u||h)&&r.setState(Z(Z({},m),f))}}),V(Ce(r),"scrollTo",function(c){r.listRef.current.scrollTo(c)}),r}return Vn(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var o=this.props,l=o.activeKey,s=o.itemScrollOffset,c=s===void 0?0:s;l!==void 0&&l!==this.state.activeKey&&(this.setState({activeKey:l}),l!==null&&this.scrollTo({key:l,offset:c}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var o=this.state,l=o.focused,s=o.flattenNodes,c=o.keyEntities,u=o.draggingNodeKey,f=o.activeKey,g=o.dropLevelOffset,h=o.dropContainerKey,m=o.dropTargetKey,b=o.dropPosition,C=o.dragOverNodeKey,S=o.indent,p=this.props,w=p.prefixCls,x=p.className,E=p.style,$=p.showLine,I=p.focusable,O=p.tabIndex,N=O===void 0?0:O,P=p.selectable,R=p.showIcon,F=p.icon,B=p.switcherIcon,K=p.draggable,U=p.checkable,A=p.checkStrictly,k=p.disabled,j=p.motion,D=p.loadData,L=p.filterTreeNode,X=p.height,q=p.itemHeight,W=p.virtual,Q=p.titleRender,ne=p.dropIndicatorRender,ue=p.onContextMenu,oe=p.onScroll,de=p.direction,ie=p.rootClassName,me=p.rootStyle,we=jo(this.props,{aria:!0,data:!0}),ae;return K&&(ct(K)==="object"?ae=K:typeof K=="function"?ae={nodeDraggable:K}:ae={}),v.createElement(Dd.Provider,{value:{prefixCls:w,selectable:P,showIcon:R,icon:F,switcherIcon:B,draggable:ae,draggingNodeKey:u,checkable:U,checkStrictly:A,disabled:k,keyEntities:c,dropLevelOffset:g,dropContainerKey:h,dropTargetKey:m,dropPosition:b,dragOverNodeKey:C,indent:S,direction:de,dropIndicatorRender:ne,loadData:D,filterTreeNode:L,titleRender:Q,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},v.createElement("div",{role:"tree",className:Oe(w,x,ie,V(V(V({},"".concat(w,"-show-line"),$),"".concat(w,"-focused"),l),"".concat(w,"-active-focused"),f!==null)),style:me},v.createElement(nb,rt({ref:this.listRef,prefixCls:w,style:E,data:s,disabled:k,selectable:P,checkable:!!U,motion:j,dragging:u!==null,height:X,itemHeight:q,virtual:W,focusable:I,focused:l,tabIndex:N,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ue,onScroll:oe},this.getTreeNodeRequiredProps(),we))))}}],[{key:"getDerivedStateFromProps",value:function(o,l){var s=l.prevProps,c={prevProps:o};function u(O){return!s&&O in o||s&&s[O]!==o[O]}var f,g=l.fieldNames;if(u("fieldNames")&&(g=Zi(o.fieldNames),c.fieldNames=g),u("treeData")?f=o.treeData:u("children")&&(at(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),f=s0(o.children)),f){c.treeData=f;var h=Ed(f,{fieldNames:g});c.keyEntities=Z(V({},bi,Q0),h.keyEntities),process.env.NODE_ENV!=="production"&&_N(f,g)}var m=c.keyEntities||l.keyEntities;if(u("expandedKeys")||s&&u("autoExpandParent"))c.expandedKeys=o.autoExpandParent||!s&&o.defaultExpandParent?Vd(o.expandedKeys,m):o.expandedKeys;else if(!s&&o.defaultExpandAll){var b=Z({},m);delete b[bi],c.expandedKeys=Object.keys(b).map(function(O){return b[O].key})}else!s&&o.defaultExpandedKeys&&(c.expandedKeys=o.autoExpandParent||o.defaultExpandParent?Vd(o.defaultExpandedKeys,m):o.defaultExpandedKeys);if(c.expandedKeys||delete c.expandedKeys,f||c.expandedKeys){var C=xd(f||l.treeData,c.expandedKeys||l.expandedKeys,g);c.flattenNodes=C}if(o.selectable&&(u("selectedKeys")?c.selectedKeys=G0(o.selectedKeys,o):!s&&o.defaultSelectedKeys&&(c.selectedKeys=G0(o.defaultSelectedKeys,o))),o.checkable){var S;if(u("checkedKeys")?S=Ld(o.checkedKeys)||{}:!s&&o.defaultCheckedKeys?S=Ld(o.defaultCheckedKeys)||{}:f&&(S=Ld(o.checkedKeys)||{checkedKeys:l.checkedKeys,halfCheckedKeys:l.halfCheckedKeys}),S){var p=S,w=p.checkedKeys,x=w===void 0?[]:w,E=p.halfCheckedKeys,$=E===void 0?[]:E;if(!o.checkStrictly){var I=Qi(x,!0,m);x=I.checkedKeys,$=I.halfCheckedKeys}c.checkedKeys=x,c.halfCheckedKeys=$}}return u("loadedKeys")&&(c.loadedKeys=o.loadedKeys),c}}]),n}(v.Component);V($s,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:PP,allowDrop:function(){return!0},expandAction:!1}),V($s,"TreeNode",ta);var jP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};const zP=jP;var BP=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:zP}))},rb=v.forwardRef(BP);process.env.NODE_ENV!=="production"&&(rb.displayName="FileOutlined");const ob=rb;var HP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};const kP=HP;var WP=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:kP}))},ib=v.forwardRef(WP);process.env.NODE_ENV!=="production"&&(ib.displayName="FolderOpenOutlined");const KP=ib;var UP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"};const GP=UP;var qP=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:GP}))},ab=v.forwardRef(qP);process.env.NODE_ENV!=="production"&&(ab.displayName="FolderOutlined");const XP=ab;var YP={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"};const ZP=YP;var QP=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:ZP}))},lb=v.forwardRef(QP);process.env.NODE_ENV!=="production"&&(lb.displayName="HolderOutlined");const JP=lb,eT=new rn("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),tT=(e,t)=>({[`.${e}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${t.motionDurationSlow}`}}}),nT=(e,t)=>({[`.${e}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${Ge(t.lineWidthBold)} solid ${t.colorPrimary}`,borderRadius:"50%",content:'""'}}}),rT=(e,t)=>{const{treeCls:n,treeNodeCls:r,treeNodePadding:o,titleHeight:l,nodeSelectedBg:s,nodeHoverBg:c}=t,u=t.paddingXS;return{[n]:Object.assign(Object.assign({},tr(t)),{background:t.colorBgContainer,borderRadius:t.borderRadius,transition:`background-color ${t.motionDurationSlow}`,[`&${n}-rtl`]:{[`${n}-switcher`]:{"&_close":{[`${n}-switcher-icon`]:{svg:{transform:"rotate(90deg)"}}}}},[`&-focused:not(:hover):not(${n}-active-focused)`]:Object.assign({},Da(t)),[`${n}-list-holder-inner`]:{alignItems:"flex-start"},[`&${n}-block-node`]:{[`${n}-list-holder-inner`]:{alignItems:"stretch",[`${n}-node-content-wrapper`]:{flex:"auto"},[`${r}.dragging`]:{position:"relative","&:after":{position:"absolute",top:0,insetInlineEnd:0,bottom:o,insetInlineStart:0,border:`1px solid ${t.colorPrimary}`,opacity:0,animationName:eT,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none"}}}},[`${r}`]:{display:"flex",alignItems:"flex-start",padding:`0 0 ${Ge(o)} 0`,outline:"none","&-rtl":{direction:"rtl"},"&-disabled":{[`${n}-node-content-wrapper`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}}},[`&-active ${n}-node-content-wrapper`]:{background:t.controlItemBgHover},[`&:not(${r}-disabled).filter-node ${n}-title`]:{color:"inherit",fontWeight:500},"&-draggable":{cursor:"grab",[`${n}-draggable-icon`]:{flexShrink:0,width:l,lineHeight:`${Ge(l)}`,textAlign:"center",visibility:"visible",opacity:.2,transition:`opacity ${t.motionDurationSlow}`,[`${r}:hover &`]:{opacity:.45}},[`&${r}-disabled`]:{[`${n}-draggable-icon`]:{visibility:"hidden"}}}},[`${n}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:l}},[`${n}-draggable-icon`]:{visibility:"hidden"},[`${n}-switcher`]:Object.assign(Object.assign({},tT(e,t)),{position:"relative",flex:"none",alignSelf:"stretch",width:l,margin:0,lineHeight:`${Ge(l)}`,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${t.motionDurationSlow}`,borderRadius:t.borderRadius,"&-noop":{cursor:"unset"},[`&:not(${n}-switcher-noop):hover`]:{backgroundColor:t.colorBgTextHover},"&_close":{[`${n}-switcher-icon`]:{svg:{transform:"rotate(-90deg)"}}},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(l).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(l).div(2).equal()).mul(.8).equal(),height:t.calc(l).div(2).equal(),borderBottom:`1px solid ${t.colorBorder}`,content:'""'}}}),[`${n}-checkbox`]:{top:"initial",marginInlineEnd:u,alignSelf:"flex-start",marginTop:t.marginXXS},[`${n}-node-content-wrapper, ${n}-checkbox + span`]:{position:"relative",zIndex:"auto",minHeight:l,margin:0,padding:`0 ${Ge(t.calc(t.paddingXS).div(2).equal())}`,color:"inherit",lineHeight:`${Ge(l)}`,background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:`all ${t.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,"&:hover":{backgroundColor:c},[`&${n}-node-selected`]:{backgroundColor:s},[`${n}-iconEle`]:{display:"inline-block",width:l,height:l,lineHeight:`${Ge(l)}`,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${n}-unselectable ${n}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${n}-node-content-wrapper`]:Object.assign({lineHeight:`${Ge(l)}`,userSelect:"none"},nT(e,t)),[`${r}.drop-container`]:{"> [draggable]":{boxShadow:`0 0 0 2px ${t.colorPrimary}`}},"&-show-line":{[`${n}-indent`]:{"&-unit":{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(l).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&-end":{"&:before":{display:"none"}}}},[`${n}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${r}-leaf-last`]:{[`${n}-switcher`]:{"&-leaf-line":{"&:before":{top:"auto !important",bottom:"auto !important",height:`${Ge(t.calc(l).div(2).equal())} !important`}}}}})}},oT=e=>{const{treeCls:t,treeNodeCls:n,treeNodePadding:r,directoryNodeSelectedBg:o,directoryNodeSelectedColor:l}=e;return{[`${t}${t}-directory`]:{[n]:{position:"relative","&:before":{position:"absolute",top:0,insetInlineEnd:0,bottom:r,insetInlineStart:0,transition:`background-color ${e.motionDurationMid}`,content:'""',pointerEvents:"none"},"&:hover":{"&:before":{background:e.controlItemBgHover}},"> *":{zIndex:1},[`${t}-switcher`]:{transition:`color ${e.motionDurationMid}`},[`${t}-node-content-wrapper`]:{borderRadius:0,userSelect:"none","&:hover":{background:"transparent"},[`&${t}-node-selected`]:{color:l,background:"transparent"}},"&-selected":{"\n &:hover::before,\n &::before\n ":{background:o},[`${t}-switcher`]:{color:l},[`${t}-node-content-wrapper`]:{color:l,background:"transparent"}}}}}},sb=(e,t)=>{const n=`.${e}`,r=`${n}-treenode`,o=t.calc(t.paddingXS).div(2).equal(),l=fn(t,{treeCls:n,treeNodeCls:r,treeNodePadding:o});return[rT(e,l),oT(l)]},cb=e=>{const{controlHeightSM:t}=e;return{titleHeight:t,nodeHoverBg:e.controlItemBgHover,nodeSelectedBg:e.controlItemBgActive}},iT=mr("Tree",(e,t)=>{let{prefixCls:n}=t;return[{[e.componentCls]:Od(`${n}-checkbox`,e)},sb(n,e),Op(e)]},e=>{const{colorTextLightSolid:t,colorPrimary:n}=e;return Object.assign(Object.assign({},cb(e)),{directoryNodeSelectedColor:t,directoryNodeSelectedBg:n})}),ub=4;function aT(e){const{dropPosition:t,dropLevelOffset:n,prefixCls:r,indent:o,direction:l="ltr"}=e,s=l==="ltr"?"left":"right",c=l==="ltr"?"right":"left",u={[s]:-n*o+ub,[c]:0};switch(t){case-1:u.top=-3;break;case 1:u.bottom=-3;break;default:u.bottom=-3,u[s]=o+ub;break}return z.createElement("div",{style:u,className:`${r}-drop-indicator`})}var lT={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"};const sT=lT;var cT=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:sT}))},db=v.forwardRef(cT);process.env.NODE_ENV!=="production"&&(db.displayName="CaretDownFilled");const uT=db;var dT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const fT=dT;var vT=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:fT}))},fb=v.forwardRef(vT);process.env.NODE_ENV!=="production"&&(fb.displayName="MinusSquareOutlined");const gT=fb;var hT={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"};const pT=hT;var mT=function(t,n){return v.createElement(jn,rt({},t,{ref:n,icon:pT}))},vb=v.forwardRef(mT);process.env.NODE_ENV!=="production"&&(vb.displayName="PlusSquareOutlined");const bT=vb,gb=e=>{const{prefixCls:t,switcherIcon:n,treeNodeProps:r,showLine:o}=e,{isLeaf:l,expanded:s,loading:c}=r;if(c)return v.createElement(ns,{className:`${t}-switcher-loading-icon`});let u;if(o&&typeof o=="object"&&(u=o.showLeafIcon),l){if(!o)return null;if(typeof u!="boolean"&&u){const h=typeof u=="function"?u(r):u,m=`${t}-switcher-line-custom-icon`;return v.isValidElement(h)?zo(h,{className:Oe(h.props.className||"",m)}):h}return u?v.createElement(ob,{className:`${t}-switcher-line-icon`}):v.createElement("span",{className:`${t}-switcher-leaf-line`})}const f=`${t}-switcher-icon`,g=typeof n=="function"?n(r):n;return v.isValidElement(g)?zo(g,{className:Oe(g.props.className||"",f)}):g!==void 0?g:o?s?v.createElement(gT,{className:`${t}-switcher-line-icon`}):v.createElement(bT,{className:`${t}-switcher-line-icon`}):v.createElement(uT,{className:f})},hb=z.forwardRef((e,t)=>{var n;const{getPrefixCls:r,direction:o,virtual:l,tree:s}=z.useContext(qt),{prefixCls:c,className:u,showIcon:f=!1,showLine:g,switcherIcon:h,blockNode:m=!1,children:b,checkable:C=!1,selectable:S=!0,draggable:p,motion:w,style:x}=e,E=r("tree",c),$=r(),I=w??Object.assign(Object.assign({},_u($)),{motionAppear:!1}),O=Object.assign(Object.assign({},e),{checkable:C,selectable:S,showIcon:f,motion:I,blockNode:m,showLine:!!g,dropIndicatorRender:aT}),[N,P,R]=iT(E),[,F]=er(),B=F.paddingXS/2+(((n=F.Tree)===null||n===void 0?void 0:n.titleHeight)||F.controlHeightSM),K=z.useMemo(()=>{if(!p)return!1;let A={};switch(typeof p){case"function":A.nodeDraggable=p;break;case"object":A=Object.assign({},p);break}return A.icon!==!1&&(A.icon=A.icon||z.createElement(JP,null)),A},[p]),U=A=>z.createElement(gb,{prefixCls:E,switcherIcon:h,treeNodeProps:A,showLine:g});return N(z.createElement($s,Object.assign({itemHeight:B,ref:t,virtual:l},O,{style:Object.assign(Object.assign({},s==null?void 0:s.style),x),prefixCls:E,className:Oe({[`${E}-icon-hide`]:!f,[`${E}-block-node`]:m,[`${E}-unselectable`]:!S,[`${E}-rtl`]:o==="rtl"},s==null?void 0:s.className,u,P,R),direction:o,checkable:C&&z.createElement("span",{className:`${E}-checkbox-inner`}),selectable:S,switcherIcon:U,draggable:K}),b))});process.env.NODE_ENV!=="production"&&(hb.displayName="Tree");const pb=hb,mb=0,zd=1,bb=2;function Bd(e,t,n){const{key:r,children:o}=n;function l(s){const c=s[r],u=s[o];t(c,s)!==!1&&Bd(u||[],t,n)}e.forEach(l)}function yT(e){let{treeData:t,expandedKeys:n,startKey:r,endKey:o,fieldNames:l}=e;const s=[];let c=mb;if(r&&r===o)return[r];if(!r||!o)return[];function u(f){return f===r||f===o}return Bd(t,f=>{if(c===bb)return!1;if(u(f)){if(s.push(f),c===mb)c=zd;else if(c===zd)return c=bb,!1}else c===zd&&s.push(f);return n.includes(f)},Zi(l)),s}function Hd(e,t,n){const r=Re(t),o=[];return Bd(e,(l,s)=>{const c=r.indexOf(l);return c!==-1&&(o.push(s),r.splice(c,1)),!!r.length},Zi(n)),o}var yb=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};function ST(e){const{isLeaf:t,expanded:n}=e;return t?v.createElement(ob,null):n?v.createElement(KP,null):v.createElement(XP,null)}function Sb(e){let{treeData:t,children:n}=e;return t||s0(n)}const CT=(e,t)=>{var{defaultExpandAll:n,defaultExpandParent:r,defaultExpandedKeys:o}=e,l=yb(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const s=v.useRef(),c=v.useRef(),u=()=>{const{keyEntities:P}=Ed(Sb(l));let R;return n?R=Object.keys(P):r?R=Vd(l.expandedKeys||o||[],P):R=l.expandedKeys||o||[],R},[f,g]=v.useState(l.selectedKeys||l.defaultSelectedKeys||[]),[h,m]=v.useState(()=>u());v.useEffect(()=>{"selectedKeys"in l&&g(l.selectedKeys)},[l.selectedKeys]),v.useEffect(()=>{"expandedKeys"in l&&m(l.expandedKeys)},[l.expandedKeys]);const b=(P,R)=>{var F;return"expandedKeys"in l||m(P),(F=l.onExpand)===null||F===void 0?void 0:F.call(l,P,R)},C=(P,R)=>{var F;const{multiple:B,fieldNames:K}=l,{node:U,nativeEvent:A}=R,{key:k=""}=U,j=Sb(l),D=Object.assign(Object.assign({},R),{selected:!0}),L=(A==null?void 0:A.ctrlKey)||(A==null?void 0:A.metaKey),X=A==null?void 0:A.shiftKey;let q;B&&L?(q=P,s.current=k,c.current=q,D.selectedNodes=Hd(j,q,K)):B&&X?(q=Array.from(new Set([].concat(Re(c.current||[]),Re(yT({treeData:j,expandedKeys:h,startKey:k,endKey:s.current,fieldNames:K}))))),D.selectedNodes=Hd(j,q,K)):(q=[k],s.current=k,c.current=q,D.selectedNodes=Hd(j,q,K)),(F=l.onSelect)===null||F===void 0||F.call(l,q,D),"selectedKeys"in l||g(q)},{getPrefixCls:S,direction:p}=v.useContext(qt),{prefixCls:w,className:x,showIcon:E=!0,expandAction:$="click"}=l,I=yb(l,["prefixCls","className","showIcon","expandAction"]),O=S("tree",w),N=Oe(`${O}-directory`,{[`${O}-directory-rtl`]:p==="rtl"},x);return v.createElement(pb,Object.assign({icon:ST,ref:t,blockNode:!0},I,{showIcon:E,expandAction:$,prefixCls:O,className:N,expandedKeys:h,selectedKeys:f,onSelect:C,onExpand:b}))},Cb=v.forwardRef(CT);process.env.NODE_ENV!=="production"&&(Cb.displayName="DirectoryTree");const wT=Cb,kd=pb;kd.DirectoryTree=wT,kd.TreeNode=ta;const xT=kd,ET=function(e){var t=v.useRef({valueLabels:new Map});return v.useMemo(function(){var n=t.current.valueLabels,r=new Map,o=e.map(function(l){var s,c=l.value,u=(s=l.label)!==null&&s!==void 0?s:n.get(c);return r.set(c,u),Z(Z({},l),{},{label:u})});return t.current.valueLabels=r,[o]},[e])},OT=function(e,t,n,r){return v.useMemo(function(){var o=e.map(function(u){var f=u.value;return f}),l=t.map(function(u){var f=u.value;return f}),s=o.filter(function(u){return!r[u]});if(n){var c=Qi(o,!0,r);o=c.checkedKeys,l=c.halfCheckedKeys}return[Array.from(new Set([].concat(Re(s),Re(o)))),l]},[e,t,n,r])};function wb(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function $T(e){var t=e||{},n=t.label,r=t.value,o=t.children,l=r||"value";return{_title:n?[n]:["title","label"],value:l,key:l,children:o||"children"}}function Wd(e){return!e||e.disabled||e.disableCheckbox||e.checkable===!1}function _T(e,t){var n=[];function r(o){o.forEach(function(l){var s=l[t.children];s&&(n.push(l[t.value]),r(s))})}return r(e),n}function Kd(e){return e==null}const IT=function(e,t){return v.useMemo(function(){var n=Ed(e,{fieldNames:t,initWrapper:function(o){return Z(Z({},o),{},{valueEntities:new Map})},processEntity:function(o,l){var s=o.node[t.value];if(process.env.NODE_ENV!=="production"){var c=o.node.key;at(!Kd(s),"TreeNode `value` is invalidate: undefined"),at(!l.valueEntities.has(s),"Same `value` exist in the tree: ".concat(s)),at(!c||String(c)===String(s),"`key` or `value` with TreeNode must be the same or you can remove one of them. key: ".concat(c,", value: ").concat(s,"."))}l.valueEntities.set(s,o)}});return n},[e,t])};var Ud=function(){return null},NT=["children","value"];function xb(e){return no(e).map(function(t){if(!v.isValidElement(t)||!t.type)return null;var n=t,r=n.key,o=n.props,l=o.children,s=o.value,c=Gt(o,NT),u=Z({key:r,value:s},c),f=xb(l);return f.length&&(u.children=f),u}).filter(function(t){return t})}function Gd(e){if(!e)return e;var t=Z({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return at(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),t}}),t}function PT(e,t,n,r,o,l){var s=null,c=null;function u(){function f(g){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return g.map(function(b,C){var S="".concat(h,"-").concat(C),p=b[l.value],w=n.includes(p),x=f(b[l.children]||[],S,w),E=v.createElement(Ud,b,x.map(function(I){return I.node}));if(t===p&&(s=E),w){var $={pos:S,node:E,children:x};return m||c.push($),$}return null}).filter(function(b){return b})}c||(c=[],f(r),c.sort(function(g,h){var m=g.node.props.value,b=h.node.props.value,C=n.indexOf(m),S=n.indexOf(b);return C-S}))}Object.defineProperty(e,"triggerNode",{get:function(){return at(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),u(),s}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return at(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),u(),o?c:c.map(function(g){var h=g.node;return h})}})}const TT=function(e,t,n){var r=n.treeNodeFilterProp,o=n.filterTreeNode,l=n.fieldNames,s=l.children;return v.useMemo(function(){if(!t||o===!1)return e;var c;if(typeof o=="function")c=o;else{var u=t.toUpperCase();c=function(h,m){var b=m[r];return String(b).toUpperCase().includes(u)}}function f(g){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return g.reduce(function(m,b){var C=b[s],S=h||c(t,Gd(b)),p=f(C||[],S);return(S||p.length)&&m.push(Z(Z({},b),{},V({isLeaf:void 0},s,p))),m},[])}return f(e)},[e,t,s,r,o])};function Eb(e){var t=v.useRef();t.current=e;var n=v.useCallback(function(){return t.current.apply(t,arguments)},[]);return n}function RT(e,t){var n=t.id,r=t.pId,o=t.rootPId,l={},s=[],c=e.map(function(u){var f=Z({},u),g=f[n];return l[g]=f,f.key=f.key||g,f});return c.forEach(function(u){var f=u[r],g=l[f];g&&(g.children=g.children||[],g.children.push(u)),(f===o||!g&&o===null)&&s.push(u)}),s}function MT(e,t,n){return v.useMemo(function(){return e?n?RT(e,Z({id:"id",pId:"pId",rootPId:null},n!==!0?n:{})):e:xb(t)},[t,n,e])}var Ob=v.createContext(null),$b=v.createContext(null),AT={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},DT=function(t,n){var r=Lp(),o=r.prefixCls,l=r.multiple,s=r.searchValue,c=r.toggleOpen,u=r.open,f=r.notFoundContent,g=v.useContext($b),h=g.virtual,m=g.listHeight,b=g.listItemHeight,C=g.listItemScrollOffset,S=g.treeData,p=g.fieldNames,w=g.onSelect,x=g.dropdownMatchSelectWidth,E=g.treeExpandAction,$=g.treeTitleRender,I=g.onPopupScroll,O=v.useContext(Ob),N=O.checkable,P=O.checkedKeys,R=O.halfCheckedKeys,F=O.treeExpandedKeys,B=O.treeDefaultExpandAll,K=O.treeDefaultExpandedKeys,U=O.onTreeExpand,A=O.treeIcon,k=O.showTreeIcon,j=O.switcherIcon,D=O.treeLine,L=O.treeNodeFilterProp,X=O.loadData,q=O.treeLoadedKeys,W=O.treeMotion,Q=O.onTreeLoad,ne=O.keyEntities,ue=v.useRef(),oe=xa(function(){return S},[u,S],function(We,Ve){return Ve[0]&&We[1]!==Ve[1]}),de=v.useState(null),ie=ce(de,2),me=ie[0],we=ie[1],ae=ne[me],re=v.useMemo(function(){return N?{checked:P,halfChecked:R}:null},[N,P,R]);v.useEffect(function(){if(u&&!l&&P.length){var We;(We=ue.current)===null||We===void 0||We.scrollTo({key:P[0]}),we(P[0])}},[u]);var he=String(s).toLowerCase(),Ne=function(Ve){return he?String(Ve[L]).toLowerCase().includes(he):!1},J=v.useState(K),se=ce(J,2),_e=se[0],Fe=se[1],je=v.useState(null),xe=ce(je,2),fe=xe[0],be=xe[1],Le=v.useMemo(function(){return F?Re(F):s?fe:_e},[_e,fe,F,s]);v.useEffect(function(){s&&be(_T(S,p))},[s]);var Be=function(Ve){Fe(Ve),be(Ve),U&&U(Ve)},ze=function(Ve){Ve.preventDefault()},Ue=function(Ve,qe){var He=qe.node;N&&Wd(He)||(w(He.key,{selected:!P.includes(He.key)}),l||c(!1))};if(v.useImperativeHandle(n,function(){var We;return{scrollTo:(We=ue.current)===null||We===void 0?void 0:We.scrollTo,onKeyDown:function(qe){var He,ft=qe.which;switch(ft){case Pe.UP:case Pe.DOWN:case Pe.LEFT:case Pe.RIGHT:(He=ue.current)===null||He===void 0||He.onKeyDown(qe);break;case Pe.ENTER:{if(ae){var ut=(ae==null?void 0:ae.node)||{},_t=ut.selectable,At=ut.value;_t!==!1&&Ue(null,{node:{key:me},selected:!P.includes(At)})}break}case Pe.ESC:c(!1)}},onKeyUp:function(){}}}),oe.length===0)return v.createElement("div",{role:"listbox",className:"".concat(o,"-empty"),onMouseDown:ze},f);var Te={fieldNames:p};return q&&(Te.loadedKeys=q),Le&&(Te.expandedKeys=Le),v.createElement("div",{onMouseDown:ze},ae&&u&&v.createElement("span",{style:AT,"aria-live":"assertive"},ae.node.value),v.createElement($s,rt({ref:ue,focusable:!1,prefixCls:"".concat(o,"-tree"),treeData:oe,height:m,itemHeight:b,itemScrollOffset:C,virtual:h!==!1&&x!==!1,multiple:l,icon:A,showIcon:k,switcherIcon:j,showLine:D,loadData:s?null:X,motion:W,activeKey:me,checkable:N,checkStrictly:!0,checkedKeys:re,selectedKeys:N?[]:P,defaultExpandAll:B,titleRender:$},Te,{onActiveChange:we,onSelect:Ue,onCheck:Ue,onExpand:Be,onLoad:Q,filterTreeNode:Ne,expandAction:E,onScroll:I})))},_b=v.forwardRef(DT);process.env.NODE_ENV!=="production"&&(_b.displayName="OptionList");var qd="SHOW_ALL",Xd="SHOW_PARENT",_s="SHOW_CHILD";function Ib(e,t,n,r){var o=new Set(e);return t===_s?e.filter(function(l){var s=n[l];return!(s&&s.children&&s.children.some(function(c){var u=c.node;return o.has(u[r.value])})&&s.children.every(function(c){var u=c.node;return Wd(u)||o.has(u[r.value])}))}):t===Xd?e.filter(function(l){var s=n[l],c=s?s.parent:null;return!(c&&!Wd(c.node)&&o.has(c.key))}):e}function FT(e){var t=e.searchPlaceholder,n=e.treeCheckStrictly,r=e.treeCheckable,o=e.labelInValue,l=e.value,s=e.multiple;at(!t,"`searchPlaceholder` has been removed."),n&&o===!1&&at(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(o||n)&&at(wb(l).every(function(c){return c&&ct(c)==="object"&&"value"in c}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),n||s||r?at(!l||Array.isArray(l),"`value` should be an array when `TreeSelect` is checkable or multiple."):at(!Array.isArray(l),"`value` should not be array when `TreeSelect` is single mode.")}var LT=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","listHeight","listItemHeight","listItemScrollOffset","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion","treeTitleRender","onPopupScroll"];function VT(e){return!e||ct(e)!=="object"}var Nb=v.forwardRef(function(e,t){var n=e.id,r=e.prefixCls,o=r===void 0?"rc-tree-select":r,l=e.value,s=e.defaultValue,c=e.onChange,u=e.onSelect,f=e.onDeselect,g=e.searchValue,h=e.inputValue,m=e.onSearch,b=e.autoClearSearchValue,C=b===void 0?!0:b,S=e.filterTreeNode,p=e.treeNodeFilterProp,w=p===void 0?"value":p,x=e.showCheckedStrategy,E=e.treeNodeLabelProp,$=e.multiple,I=e.treeCheckable,O=e.treeCheckStrictly,N=e.labelInValue,P=e.fieldNames,R=e.treeDataSimpleMode,F=e.treeData,B=e.children,K=e.loadData,U=e.treeLoadedKeys,A=e.onTreeLoad,k=e.treeDefaultExpandAll,j=e.treeExpandedKeys,D=e.treeDefaultExpandedKeys,L=e.onTreeExpand,X=e.treeExpandAction,q=e.virtual,W=e.listHeight,Q=W===void 0?200:W,ne=e.listItemHeight,ue=ne===void 0?20:ne,oe=e.listItemScrollOffset,de=oe===void 0?0:oe,ie=e.onDropdownVisibleChange,me=e.dropdownMatchSelectWidth,we=me===void 0?!0:me,ae=e.treeLine,re=e.treeIcon,he=e.showTreeIcon,Ne=e.switcherIcon,J=e.treeMotion,se=e.treeTitleRender,_e=e.onPopupScroll,Fe=Gt(e,LT),je=pm(n),xe=I&&!O,fe=I||O,be=O||N,Le=fe||$,Be=Tr(s,{value:l}),ze=ce(Be,2),Ue=ze[0],Te=ze[1],We=v.useMemo(function(){return I?x||_s:qd},[x,I]);process.env.NODE_ENV!=="production"&&FT(e);var Ve=v.useMemo(function(){return $T(P)},[JSON.stringify(P)]),qe=Tr("",{value:g!==void 0?g:h,postState:function(ke){return ke||""}}),He=ce(qe,2),ft=He[0],ut=He[1],_t=function(ke){ut(ke),m==null||m(ke)},At=MT(F,B,R),ln=IT(At,Ve),yt=ln.keyEntities,vt=ln.valueEntities,Et=v.useCallback(function(Ze){var ke=[],Ke=[];return Ze.forEach(function(Ee){vt.has(Ee)?Ke.push(Ee):ke.push(Ee)}),{missingRawValues:ke,existRawValues:Ke}},[vt]),kt=TT(At,ft,{fieldNames:Ve,treeNodeFilterProp:w,filterTreeNode:S}),Dt=v.useCallback(function(Ze){if(Ze){if(E)return Ze[E];for(var ke=Ve._title,Ke=0;Ke<ke.length;Ke+=1){var Ee=Ze[ke[Ke]];if(Ee!==void 0)return Ee}}},[Ve,E]),St=v.useCallback(function(Ze){var ke=wb(Ze);return ke.map(function(Ke){return VT(Ke)?{value:Ke}:Ke})},[]),Wt=v.useCallback(function(Ze){var ke=St(Ze);return ke.map(function(Ke){var Ee=Ke.label,Ie=Ke.value,Me=Ke.halfChecked,tt,pt=vt.get(Ie);if(pt){var Kt;Ee=(Kt=Ee)!==null&&Kt!==void 0?Kt:Dt(pt.node),tt=pt.node.disabled}else if(Ee===void 0){var Rt=St(Ue).find(function(Rn){return Rn.value===Ie});Ee=Rt.label}return{label:Ee,value:Ie,halfChecked:Me,disabled:tt}})},[vt,Dt,St,Ue]),jt=v.useMemo(function(){return St(Ue)},[St,Ue]),Ft=v.useMemo(function(){var Ze=[],ke=[];return jt.forEach(function(Ke){Ke.halfChecked?ke.push(Ke):Ze.push(Ke)}),[Ze,ke]},[jt]),it=ce(Ft,2),Ct=it[0],ot=it[1],De=v.useMemo(function(){return Ct.map(function(Ze){return Ze.value})},[Ct]),lt=OT(Ct,ot,xe,yt),$t=ce(lt,2),Ae=$t[0],Qe=$t[1],Xe=v.useMemo(function(){var Ze=Ib(Ae,We,yt,Ve),ke=Ze.map(function(Me){var tt,pt;return(tt=(pt=yt[Me])===null||pt===void 0||(pt=pt.node)===null||pt===void 0?void 0:pt[Ve.value])!==null&&tt!==void 0?tt:Me}),Ke=ke.map(function(Me){var tt=Ct.find(function(Kt){return Kt.value===Me}),pt;return N&&tt.label!==void 0?pt=tt.label:!N&&se&&(pt=se(tt)),{value:Me,label:pt}}),Ee=Wt(Ke),Ie=Ee[0];return!Le&&Ie&&Kd(Ie.value)&&Kd(Ie.label)?[]:Ee.map(function(Me){var tt;return Z(Z({},Me),{},{label:(tt=Me.label)!==null&&tt!==void 0?tt:Me.value})})},[Ve,Le,Ae,Ct,Wt,We,yt]),dt=ET(Xe),wt=ce(dt,1),Nt=wt[0],Jt=Eb(function(Ze,ke,Ke){var Ee=Wt(Ze);if(Te(Ee),C&&ut(""),c){var Ie=Ze;if(xe){var Me=Ib(Ze,We,yt,Ve);Ie=Me.map(function(gn){var bn=vt.get(gn);return bn?bn.node[Ve.value]:gn})}var tt=ke||{triggerValue:void 0,selected:void 0},pt=tt.triggerValue,Kt=tt.selected,Rt=Ie;if(O){var Rn=ot.filter(function(gn){return!Ie.includes(gn.value)});Rt=[].concat(Re(Rt),Re(Rn))}var zn=Wt(Rt),vn={preValue:Ct,triggerValue:pt},On=!0;(O||Ke==="selection"&&!Kt)&&(On=!1),PT(vn,pt,Ze,At,On,Ve),fe?vn.checked=Kt:vn.selected=Kt;var sr=be?zn:zn.map(function(gn){return gn.value});c(Le?sr:sr[0],be?null:zn.map(function(gn){return gn.label}),vn)}}),H=v.useCallback(function(Ze,ke){var Ke,Ee=ke.selected,Ie=ke.source,Me=yt[Ze],tt=Me==null?void 0:Me.node,pt=(Ke=tt==null?void 0:tt[Ve.value])!==null&&Ke!==void 0?Ke:Ze;if(!Le)Jt([pt],{selected:!0,triggerValue:pt},"option");else{var Kt=Ee?[].concat(Re(De),[pt]):Ae.filter(function(bn){return bn!==pt});if(xe){var Rt=Et(Kt),Rn=Rt.missingRawValues,zn=Rt.existRawValues,vn=zn.map(function(bn){return vt.get(bn).key}),On;if(Ee){var sr=Qi(vn,!0,yt);On=sr.checkedKeys}else{var gn=Qi(vn,{checked:!1,halfCheckedKeys:Qe},yt);On=gn.checkedKeys}Kt=[].concat(Re(Rn),Re(On.map(function(bn){return yt[bn].node[Ve.value]})))}Jt(Kt,{selected:Ee,triggerValue:pt},Ie||"option")}Ee||!Le?u==null||u(pt,Gd(tt)):f==null||f(pt,Gd(tt))},[Et,vt,yt,Ve,Le,De,Jt,xe,u,f,Ae,Qe]),ve=v.useCallback(function(Ze){if(ie){var ke={};Object.defineProperty(ke,"documentClickClose",{get:function(){return at(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),ie(Ze,ke)}},[ie]),pe=Eb(function(Ze,ke){var Ke=Ze.map(function(Ee){return Ee.value});if(ke.type==="clear"){Jt(Ke,{},"selection");return}ke.values.length&&H(ke.values[0].value,{selected:!1,source:"selection"})}),Je=v.useMemo(function(){return{virtual:q,dropdownMatchSelectWidth:we,listHeight:Q,listItemHeight:ue,listItemScrollOffset:de,treeData:kt,fieldNames:Ve,onSelect:H,treeExpandAction:X,treeTitleRender:se,onPopupScroll:_e}},[q,we,Q,ue,de,kt,Ve,H,X,se,_e]),gt=v.useMemo(function(){return{checkable:fe,loadData:K,treeLoadedKeys:U,onTreeLoad:A,checkedKeys:Ae,halfCheckedKeys:Qe,treeDefaultExpandAll:k,treeExpandedKeys:j,treeDefaultExpandedKeys:D,onTreeExpand:L,treeIcon:re,treeMotion:J,showTreeIcon:he,switcherIcon:Ne,treeLine:ae,treeNodeFilterProp:w,keyEntities:yt}},[fe,K,U,A,Ae,Qe,k,j,D,L,re,J,he,Ne,ae,w,yt]);return v.createElement($b.Provider,{value:Je},v.createElement(Ob.Provider,{value:gt},v.createElement(ud,rt({ref:t},Fe,{id:je,prefixCls:o,mode:Le?"multiple":void 0,displayValues:Nt,onDisplayValuesChange:pe,searchValue:ft,onSearch:_t,OptionList:_b,emptyOptions:!At.length,onDropdownVisibleChange:ve,dropdownMatchSelectWidth:we}))))});process.env.NODE_ENV!=="production"&&(Nb.displayName="TreeSelect");var rl=Nb;rl.TreeNode=Ud,rl.SHOW_ALL=qd,rl.SHOW_PARENT=Xd,rl.SHOW_CHILD=_s;const jT=e=>{const{componentCls:t,treePrefixCls:n,colorBgElevated:r}=e,o=`.${n}`;return[{[`${t}-dropdown`]:[{padding:`${Ge(e.paddingXS)} ${Ge(e.calc(e.paddingXS).div(2).equal())}`},sb(n,fn(e,{colorBgContainer:r})),{[o]:{borderRadius:0,[`${o}-list-holder-inner`]:{alignItems:"stretch",[`${o}-treenode`]:{[`${o}-node-content-wrapper`]:{flex:"auto"}}}}},Od(`${n}-checkbox`,e),{"&-rtl":{direction:"rtl",[`${o}-switcher${o}-switcher_close`]:{[`${o}-switcher-icon svg`]:{transform:"rotate(90deg)"}}}}]}]};function zT(e,t,n){return mr("TreeSelect",r=>{const o=fn(r,{treePrefixCls:t});return[jT(o)]},cb)(e,n)}var BT=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const HT=(e,t)=>{var n,{prefixCls:r,size:o,disabled:l,bordered:s=!0,className:c,rootClassName:u,treeCheckable:f,multiple:g,listHeight:h=256,listItemHeight:m=26,placement:b,notFoundContent:C,switcherIcon:S,treeLine:p,getPopupContainer:w,popupClassName:x,dropdownClassName:E,treeIcon:$=!1,transitionName:I,choiceTransitionName:O="",status:N,treeExpandAction:P,builtinPlacements:R,dropdownMatchSelectWidth:F,popupMatchSelectWidth:B,allowClear:K,variant:U,dropdownStyle:A,tagRender:k}=e,j=BT(e,["prefixCls","size","disabled","bordered","className","rootClassName","treeCheckable","multiple","listHeight","listItemHeight","placement","notFoundContent","switcherIcon","treeLine","getPopupContainer","popupClassName","dropdownClassName","treeIcon","transitionName","choiceTransitionName","status","treeExpandAction","builtinPlacements","dropdownMatchSelectWidth","popupMatchSelectWidth","allowClear","variant","dropdownStyle","tagRender"]);const{getPopupContainer:D,getPrefixCls:L,renderEmpty:X,direction:q,virtual:W,popupMatchSelectWidth:Q,popupOverflow:ne}=v.useContext(qt);if(process.env.NODE_ENV!=="production"){const St=xn("TreeSelect");process.env.NODE_ENV!=="production"&&St(g!==!1||!f,"usage","`multiple` will always be `true` when `treeCheckable` is true"),St.deprecated(!E,"dropdownClassName","popupClassName"),St.deprecated(F===void 0,"dropdownMatchSelectWidth","popupMatchSelectWidth"),process.env.NODE_ENV!=="production"&&St(!("showArrow"in j),"deprecated","`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null."),St.deprecated(!("bordered"in j),"bordered","variant")}const ue=L(),oe=L("select",r),de=L("select-tree",r),ie=L("tree-select",r),{compactSize:me,compactItemClassnames:we}=Va(oe,q),ae=br(oe),re=br(ie),[he,Ne,J]=Pm(oe,ae),[se]=zT(ie,de,re),[_e,Fe]=hs(U,s),je=Oe(x||E,`${ie}-dropdown`,{[`${ie}-dropdown-rtl`]:q==="rtl"},u,J,ae,re,Ne),xe=!!(f||g),fe=Fm(j.suffixIcon,j.showArrow),be=(n=B??F)!==null&&n!==void 0?n:Q,{status:Le,hasFeedback:Be,isFormItemInput:ze,feedbackIcon:Ue}=v.useContext(Wn),Te=Za(Le,N),{suffixIcon:We,removeIcon:Ve,clearIcon:qe}=Dm(Object.assign(Object.assign({},j),{multiple:xe,showSuffixIcon:fe,hasFeedback:Be,feedbackIcon:Ue,prefixCls:oe,componentName:"TreeSelect"})),He=K===!0?{clearIcon:qe}:K;let ft;C!==void 0?ft=C:ft=(X==null?void 0:X("Select"))||v.createElement(xm,{componentName:"Select"});const ut=ro(j,["suffixIcon","removeIcon","clearIcon","itemIcon","switcherIcon"]),_t=v.useMemo(()=>b!==void 0?b:q==="rtl"?"bottomRight":"bottomLeft",[b,q]),At=yo(St=>{var Wt;return(Wt=o??me)!==null&&Wt!==void 0?Wt:St}),ln=v.useContext(bo),yt=l??ln,vt=Oe(!r&&ie,{[`${oe}-lg`]:At==="large",[`${oe}-sm`]:At==="small",[`${oe}-rtl`]:q==="rtl",[`${oe}-${_e}`]:Fe,[`${oe}-in-form-item`]:ze},Ya(oe,Te,Be),we,c,u,J,ae,re,Ne),Et=St=>v.createElement(gb,{prefixCls:de,switcherIcon:S,treeNodeProps:St,showLine:p}),[kt]=wu("SelectLike",A==null?void 0:A.zIndex),Dt=v.createElement(rl,Object.assign({virtual:W,disabled:yt},ut,{dropdownMatchSelectWidth:be,builtinPlacements:Em(R,ne),ref:t,prefixCls:oe,className:vt,listHeight:h,listItemHeight:m,treeCheckable:f&&v.createElement("span",{className:`${oe}-tree-checkbox-inner`}),treeLine:!!p,suffixIcon:We,multiple:xe,placement:_t,removeIcon:Ve,allowClear:He,switcherIcon:Et,showTreeIcon:$,notFoundContent:ft,getPopupContainer:w||D,treeMotion:null,dropdownClassName:je,dropdownStyle:Object.assign(Object.assign({},A),{zIndex:kt}),choiceTransitionName:is(ue,"",O),transitionName:is(ue,"slide-up",I),treeExpandAction:P,tagRender:xe?k:void 0}));return he(se(Dt))},ko=v.forwardRef(HT),kT=Ap(ko);ko.TreeNode=Ud,ko.SHOW_ALL=qd,ko.SHOW_PARENT=Xd,ko.SHOW_CHILD=_s,ko._InternalPanelDoNotUseOrYouWillBeFired=kT,process.env.NODE_ENV!=="production"&&(ko.displayName="TreeSelect");const WT=ko,Yr=function({label:t,children:n,prompt:r,...o}){return Xt.jsxs("div",{className:"relative",children:[t&&Xt.jsx("div",{className:"h-8 text-sm flex justify-between items-center",children:t}),Xt.jsx("div",{className:"w-full flex items-stretch",children:n}),Xt.jsx("div",{className:"text-xs text-gray-500 min-h-5 flex items-center",children:r})]})},{TextArea:KT,Password:UT,Search:GT}=Td,qT=e=>Xt.jsx(Yr,{...e,children:Xt.jsx(Td,{...e})}),XT=({value:e,...t})=>(e=e||"系统自动生成",Xt.jsx(Yr,{...t,children:Xt.jsx(Td,{...t,disabled:!0,value:e})})),YT=e=>Xt.jsx(Yr,{...e,children:Xt.jsx(KT,{...e})}),ZT=e=>Xt.jsx(Yr,{...e,children:Xt.jsx(UT,{...e})}),QT=e=>Xt.jsx(Yr,{...e,children:Xt.jsx(GT,{...e})}),B3="";function Pb(e,t="id",n="title",r="parentId",o="children",l=0,s=0){return JT(e,t,n,r,o,l,c=>({value:c[t],title:c[n],key:c[t],disabled:c[t]===s}))}function JT(e,t,n,r,o,l,s){if(!Array.isArray(e)||e.length===0)return[];const c=e.map(u=>({...u,...s(u)}));return c.filter(u=>{const f=c.filter(g=>u[t]===g[r]);return u[o]=f.length>0?f:[],u[r]===l})}var Is={exports:{}};/**
257
257
  * @license
258
258
  * Lodash <https://lodash.com/>
259
259
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ *,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.relative{position:relative}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.box-border{box-sizing:border-box}.flex{display:flex}.h-8{height:2rem}.h-full{height:100%}.min-h-5{min-height:1.25rem}.w-\[960px\]{width:960px}.w-full{width:100%}.flex-col{flex-direction:column}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.overflow-auto{overflow:auto}.rounded{border-radius:.25rem}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}.p-6{padding:1.5rem}.pb-10{padding-bottom:2.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.text-\[\#1890ff\]{--tw-text-opacity: 1;color:rgb(24 144 255 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\:text-\[\#1890ff\]:hover{--tw-text-opacity: 1;color:rgb(24 144 255 / var(--tw-text-opacity))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lu-lowcode-package-form",
3
- "version": "0.3.7",
3
+ "version": "0.5.1",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.3.7",
6
6
  "@testing-library/jest-dom": "^5.17.0",
@@ -42,16 +42,16 @@
42
42
  "@babel/core": "^7.24.7",
43
43
  "@babel/preset-env": "^7.24.7",
44
44
  "@babel/preset-react": "^7.24.7",
45
- "react-scripts": "5.0.1",
45
+ "@vitejs/plugin-react": "^4.3.1",
46
46
  "autoprefixer": "^10.4.19",
47
47
  "babel-loader": "^9.1.3",
48
48
  "postcss": "^8.4.38",
49
- "tailwindcss": "^3.4.4",
50
- "webpack": "^5.91.0",
51
49
  "react": "^18.3.1",
52
50
  "react-dom": "^18.3.1",
53
- "webpack-cli": "^5.1.4",
54
- "@vitejs/plugin-react": "^4.3.1",
55
- "vite": "^5.2.13"
51
+ "react-scripts": "5.0.1",
52
+ "tailwindcss": "^3.4.4",
53
+ "vite": "^5.2.13",
54
+ "webpack": "^5.91.0",
55
+ "webpack-cli": "^5.1.4"
56
56
  }
57
- }
57
+ }
@@ -1,4 +1,5 @@
1
1
  import { Input, TextArea, Password, Search ,CodeMachine} from './field/input/index.jsx'
2
+ import '../App.css';
2
3
  import { TreeSelect, Select } from './field/select/index.jsx'
3
4
  import Custom from './field/custom/index.jsx'
4
5
  import { default as FormContainer } from './form-container/index.jsx'
package/vite.config.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { defineConfig } from 'vite';
2
2
  import react from '@vitejs/plugin-react';
3
+ import tailwindcss from 'tailwindcss'
4
+ import autoprefixer from 'autoprefixer'
3
5
 
4
6
  export default defineConfig({
5
7
  build: {
@@ -18,5 +20,15 @@ export default defineConfig({
18
20
  }
19
21
  }
20
22
  },
21
- plugins: [react()],
23
+ css: {
24
+ postcss: {
25
+ plugins: [
26
+ tailwindcss,
27
+ autoprefixer,
28
+ ]
29
+ }
30
+ },
31
+ plugins: [
32
+ react(),
33
+ ],
22
34
  });
package/webpack.config.js DELETED
@@ -1,27 +0,0 @@
1
- const path = require('path');
2
-
3
- module.exports = {
4
- mode: 'production',
5
- entry: './src/components/index.jsx',
6
- output: {
7
- path: path.resolve(__dirname, 'dist'),
8
- filename: 'index.js',
9
- libraryTarget: 'umd',
10
- },
11
- module: {
12
- rules: [
13
- {
14
- test: /\.jsx?$/,
15
- exclude: /node_modules/,
16
- use: 'babel-loader',
17
- },
18
- ],
19
- },
20
- externals: {
21
- 'react': 'react',
22
- 'react-dom': 'react-dom'
23
- },
24
- resolve: {
25
- extensions: ['.js', '.jsx'],
26
- },
27
- };