@customize-agent/server 4.0.101 → 4.0.102

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.
Files changed (45) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +13 -13
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/chunks/1936.js +3 -3
  5. package/.next/server/chunks/6041.js +5 -5
  6. package/.next/server/chunks/9301.js +3 -3
  7. package/.next/server/middleware-build-manifest.js +1 -1
  8. package/.next/server/pages/404.html +1 -1
  9. package/.next/server/pages/500.html +1 -1
  10. package/.next/server/pages/_error.js +1 -1
  11. package/.next/server/pages/asset-library.html +1 -1
  12. package/.next/server/pages/document-roles.html +1 -1
  13. package/.next/server/pages/documents.html +1 -1
  14. package/.next/server/pages/guide.html +1 -1
  15. package/.next/server/pages/index.html +1 -1
  16. package/.next/server/pages/knowledge/file-detail.html +1 -1
  17. package/.next/server/pages/knowledge/files.html +1 -1
  18. package/.next/server/pages/knowledge/manage.html +1 -1
  19. package/.next/server/pages/knowledge.html +1 -1
  20. package/.next/server/pages/models.html +1 -1
  21. package/.next/server/pages/overview.html +1 -1
  22. package/.next/server/pages/prompt.html +1 -1
  23. package/.next/server/pages/settings.html +1 -1
  24. package/.next/server/pages/system/logs.html +1 -1
  25. package/.next/server/pages-manifest.json +27 -27
  26. package/.next/static/b86ypUJlvJCjFiEYoGlHL/_buildManifest.js +1 -0
  27. package/.next/static/chunks/375-4a1c73eb22d653d2.js +1 -0
  28. package/.next/static/chunks/478-6a65262872ea0bbc.js +1 -0
  29. package/.next/static/chunks/788-7f7359a830e3f4fd.js +1 -0
  30. package/.next/static/chunks/pages/documents-21ca3fef1b9e9bef.js +1 -0
  31. package/.next/static/chunks/pages/knowledge/files-11ea94b9bcad43b9.js +1 -0
  32. package/.next/static/chunks/pages/knowledge/manage-250023762ee610bc.js +1 -0
  33. package/.next/static/chunks/pages/prompt-a0fc6b4e20477939.js +1 -0
  34. package/.next/static/chunks/pages/system/logs-2800ddd7252a3ffb.js +1 -0
  35. package/package.json +1 -1
  36. package/.next/static/0a3p9m5rR2uwKBMUGBMl0/_buildManifest.js +0 -1
  37. package/.next/static/chunks/375-1e1be370b94c7512.js +0 -1
  38. package/.next/static/chunks/478-ac4777b05b3c42e8.js +0 -1
  39. package/.next/static/chunks/788-72bd97a04f2aee27.js +0 -1
  40. package/.next/static/chunks/pages/documents-cccd60ddbf3d8401.js +0 -1
  41. package/.next/static/chunks/pages/knowledge/files-ebe54cb8a7886df1.js +0 -1
  42. package/.next/static/chunks/pages/knowledge/manage-1363f53928abf98c.js +0 -1
  43. package/.next/static/chunks/pages/prompt-5adc3ca18a2764f4.js +0 -1
  44. package/.next/static/chunks/pages/system/logs-1b77471f6db59846.js +0 -1
  45. /package/.next/static/{0a3p9m5rR2uwKBMUGBMl0 → b86ypUJlvJCjFiEYoGlHL}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[375],{7225:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(97109),r=n(23830),i=n(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let a=o.forwardRef((e,t)=>o.createElement(i.A,l({},e,{ref:t,icon:r.A})))},10218:(e,t,n)=>{n.d(t,{A:()=>y,H:()=>f});var o=n(97109),r=n(4932),i=n(42644);let l=e=>"object"==typeof e&&null!=e&&1===e.nodeType,a=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,s=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return a(n.overflowY,t)||a(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},d=(e,t,n,o,r,i,l,a)=>i<e&&l>t||i>e&&l<t?0:i<=e&&a<=n||l>=t&&a>=n?i-e-o:l>t&&a<n||i<e&&a>n?l-t+r:0,c=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},h=(e,t)=>{var n,o,r,i;if("undefined"==typeof document)return[];let{scrollMode:a,block:h,inline:u,boundary:p,skipOverflowHiddenElements:f}=t,g="function"==typeof p?p:e=>e!==p;if(!l(e))throw TypeError("Invalid target");let y=document.scrollingElement||document.documentElement,v=[],b=e;for(;l(b)&&g(b);){if((b=c(b))===y){v.push(b);break}null!=b&&b===document.body&&s(b)&&!s(document.documentElement)||null!=b&&s(b,f)&&v.push(b)}let m=null!=(o=null==(n=window.visualViewport)?void 0:n.width)?o:innerWidth,k=null!=(i=null==(r=window.visualViewport)?void 0:r.height)?i:innerHeight,{scrollX:N,scrollY:w}=window,{height:x,width:E,top:$,right:K,bottom:C,left:S}=e.getBoundingClientRect(),{top:D,right:A,bottom:O,left:M}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),P="start"===h||"nearest"===h?$-D:"end"===h?C+O:$+x/2-D+O,T="center"===u?S+E/2-M+A:"end"===u?K+A:S-M,I=[];for(let e=0;e<v.length;e++){let t=v[e],{height:n,width:o,top:r,right:i,bottom:l,left:c}=t.getBoundingClientRect();if("if-needed"===a&&$>=0&&S>=0&&C<=k&&K<=m&&(t===y&&!s(t)||$>=r&&C<=l&&S>=c&&K<=i))break;let p=getComputedStyle(t),f=parseInt(p.borderLeftWidth,10),g=parseInt(p.borderTopWidth,10),b=parseInt(p.borderRightWidth,10),D=parseInt(p.borderBottomWidth,10),A=0,O=0,M="offsetWidth"in t?t.offsetWidth-t.clientWidth-f-b:0,R="offsetHeight"in t?t.offsetHeight-t.clientHeight-g-D:0,L="offsetWidth"in t?0===t.offsetWidth?0:o/t.offsetWidth:0,j="offsetHeight"in t?0===t.offsetHeight?0:n/t.offsetHeight:0;if(y===t)A="start"===h?P:"end"===h?P-k:"nearest"===h?d(w,w+k,k,g,D,w+P,w+P+x,x):P-k/2,O="start"===u?T:"center"===u?T-m/2:"end"===u?T-m:d(N,N+m,m,f,b,N+T,N+T+E,E),A=Math.max(0,A+w),O=Math.max(0,O+N);else{A="start"===h?P-r-g:"end"===h?P-l+D+R:"nearest"===h?d(r,l,n,g,D+R,P,P+x,x):P-(r+n/2)+R/2,O="start"===u?T-c-f:"center"===u?T-(c+o/2)+M/2:"end"===u?T-i+b+M:d(c,i,o,f,b+M,T,T+E,E);let{scrollLeft:e,scrollTop:a}=t;A=0===j?0:Math.max(0,Math.min(a+A/j,t.scrollHeight-n/j+R)),O=0===L?0:Math.max(0,Math.min(e+O/L,t.scrollWidth-o/L+M)),P+=a-A,T+=e-O}I.push({el:t,top:A,left:O})}return I};var u=n(26047),p=n(44624);function f(e){return(0,p.$r)(e).join("_")}function g(e,t){let n=t.getFieldInstance(e),o=(0,i.rb)(n);if(o)return o;let r=(0,p.kV)((0,p.$r)(e),t.__INTERNAL__.name);if(r)return document.getElementById(r)}function y(e){let[t]=(0,r.mN)(),n=o.useRef({}),i=o.useMemo(()=>e??{...t,__INTERNAL__:{itemRef:e=>t=>{let o=f(e);t?n.current[o]=t:delete n.current[o]}},scrollToField:(e,t={})=>{let{focus:n,...o}=t,r=g(e,i);r&&(!function(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(h(e,t));let o="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:r,top:i,left:l}of h(e,!1===t?{block:"end",inline:"nearest"}:t===Object(t)&&0!==Object.keys(t).length?t:{block:"start",inline:"nearest"})){let e=i-n.top+n.bottom,t=l-n.left+n.right;r.scroll({top:e,left:t,behavior:o})}}(r,{scrollMode:"if-needed",block:"nearest",...o}),n&&i.focusField(e))},focusField:e=>{let t=i.getFieldInstance(e);(0,u.Tn)(t?.focus)?t.focus():g(e,i)?.focus?.()},getFieldInstance:e=>{let t=f(e);return n.current[t]}},[e,t]);return[i]}},15437:(e,t,n)=>{n.d(t,{A:()=>o});let o=e=>{let{componentCls:t,antCls:n,motionDurationMid:o,motionEaseInOut:r}=e;return{[t]:{[`${n}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`${["height","opacity"].map(e=>`${e} ${o} ${r}`).join(", ")} !important`}},[`${n}-motion-collapse`]:{overflow:"hidden",transition:`${["height","opacity"].map(e=>`${e} ${o} ${r}`).join(", ")} !important`}}}}},23830:(e,t)=>{t.A={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"}},30960:(e,t)=>{t.A={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"}},44624:(e,t,n)=>{n.d(t,{$r:()=>r,BS:()=>l,kV:()=>i});let o=["parentNode"];function r(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function i(e,t){if(!e.length)return;let n=e.join("_");return t?`${t}_${n}`:o.includes(n)?`form_item_${n}`:n}function l(e,t,n,o,r,i){let l=o;return void 0!==i?l=i:n.validating?l="validating":e.length?l="error":t.length?l="warning":(n.touched||r&&n.validated)&&(l="success"),l}},49604:(e,t,n)=>{n.d(t,{A:()=>q});var o=n(87925),r=n(9750),i=n(97109),l=n(56768),a=n(64254),s=n(7225),d=n(3638),c=n(74567),h=n(57516),u=n(88483);function p(){return(p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let f=i.forwardRef((e,t)=>i.createElement(u.A,p({},e,{ref:t,icon:h.A})));var g=n(92162),y=n(84649),v=n(6831),b=n(7709),m=n(15561),k=n(96285),N=n(7961),w=n(15437),x=n(28403),E=n(10540);let $=new m.Mo("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),K=(0,E.OF)("Tree",(e,{prefixCls:t})=>[{[e.componentCls]:(0,k.gd)(`${t}-checkbox`,e)},((e,t,n=!0)=>{let o=`.${e}`,r=`${o}-treenode`,i=t.calc(t.paddingXS).div(2).equal(),l=(0,x.oX)(t,{treeCls:o,treeNodeCls:r,treeNodePadding:i});return[((e,t)=>{let{treeCls:n,treeNodeCls:o,treeNodePadding:r,titleHeight:i,indentSize:l,switcherSize:a,motionDurationMid:s,nodeSelectedBg:d,nodeHoverBg:c,colorTextQuaternary:h,controlItemBgActiveDisabled:u}=t;return{[n]:{...(0,N.dF)(t),"--rc-virtual-list-scrollbar-bg":t.colorSplit,background:t.colorBgContainer,borderRadius:t.borderRadius,transition:`background-color ${t.motionDurationSlow}`,"&-rtl":{direction:"rtl"},[`&${n}-rtl ${n}-switcher_close ${n}-switcher-icon svg`]:{transform:"rotate(90deg)"},[`${n}-list`]:{"&:focus-visible":{outline:"none",[`${o}-active ${n}-node-content-wrapper`]:{...(0,N.jk)(t)}}},[`${n}-list-holder-inner`]:{alignItems:"flex-start"},[`&${n}-block-node`]:{[`${n}-list-holder-inner`]:{alignItems:"stretch",[`${n}-node-content-wrapper`]:{flex:"auto"},[`${o}.dragging:after`]:{position:"absolute",inset:0,border:`1px solid ${t.colorPrimary}`,opacity:0,animationName:$,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none",borderRadius:t.borderRadius}}},[o]:{display:"flex",alignItems:"flex-start",marginBottom:r,lineHeight:(0,m.zA)(i),position:"relative","&:before":{content:'""',position:"absolute",zIndex:1,insetInlineStart:0,width:"100%",top:"100%",height:r},[`&-disabled ${n}-node-content-wrapper`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}},[`${n}-checkbox-disabled + ${n}-node-selected,&${o}-disabled${o}-selected ${n}-node-content-wrapper`]:{backgroundColor:u},[`${n}-checkbox-disabled`]:{pointerEvents:"unset"},[`&:not(${o}-disabled)`]:{[`${n}-node-content-wrapper`]:{"&:hover":{color:t.nodeHoverColor}}},[`&-active ${n}-node-content-wrapper`]:{background:t.controlItemBgHover},[`&:not(${o}-disabled).filter-node ${n}-title`]:{color:t.colorPrimary,fontWeight:t.fontWeightStrong},"&-draggable":{cursor:"grab",[`${n}-draggable-icon`]:{flexShrink:0,width:a,textAlign:"center",visibility:"visible",color:h},[`&${o}-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, ${n}-checkbox`]:{marginInlineEnd:t.calc(t.calc(a).sub(t.controlInteractiveSize)).div(2).equal()},[`${n}-checkbox`]:{flexShrink:0,alignSelf:"flex-start",marginBlockStart:t.calc(t.calc(i).sub(t.controlInteractiveSize)).div(2).equal()},[`${n}-switcher`]:{...{[`.${e}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${t.motionDurationSlow}`}}},position:"relative",flex:"none",alignSelf:"stretch",width:a,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${t.motionDurationSlow}`,"&-noop":{cursor:"unset"},"&:before":{pointerEvents:"none",content:'""',width:a,height:i,position:"absolute",left:{_skip_check_:!0,value:0},top:0,borderRadius:t.borderRadius,transition:`all ${t.motionDurationSlow}`},[`&:not(${n}-switcher-noop):hover:before`]:{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(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(a).div(2).equal()).mul(.8).equal(),height:t.calc(i).div(2).equal(),borderBottom:`1px solid ${t.colorBorder}`,content:'""'}}},[`${n}-node-content-wrapper`]:{position:"relative",minHeight:i,paddingBlock:0,paddingInline:t.paddingXS,background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:`all ${s}, border 0s, line-height 0s, box-shadow 0s`,...((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:`${(0,m.zA)(t.lineWidthBold)} solid ${t.colorPrimary}`,borderRadius:"50%",content:'""'}}}))(e,t),"&:hover":{backgroundColor:c},[`&${n}-node-selected`]:{color:t.nodeSelectedColor,backgroundColor:d},[`${n}-iconEle`]:{display:"inline-block",width:a,height:i,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${n}-unselectable ${n}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${o}.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(a).div(2).equal(),bottom:t.calc(r).mul(-1).equal(),borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&-end:before":{display:"none"}},[`${n}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${o}-leaf-last ${n}-switcher-leaf-line:before`]:{top:"auto !important",bottom:"auto !important",height:`${(0,m.zA)(t.calc(i).div(2).equal())} !important`}}}})(e,l),n&&(({treeCls:e,treeNodeCls:t,directoryNodeSelectedBg:n,directoryNodeSelectedColor:o,motionDurationMid:r,borderRadius:i,controlItemBgHover:l})=>({[`${e}${e}-directory ${t}`]:{[`${e}-node-content-wrapper`]:{position:"static",[`&:has(${e}-drop-indicator)`]:{position:"relative"},[`> *:not(${e}-drop-indicator)`]:{position:"relative"},"&:hover":{background:"transparent"},"&:before":{position:"absolute",inset:0,transition:`background-color ${r}`,content:'""',borderRadius:i},"&:hover:before":{background:l}},[`${e}-switcher, ${e}-checkbox, ${e}-draggable-icon`]:{zIndex:1},"&-selected":{background:n,borderRadius:i,[`${e}-switcher, ${e}-draggable-icon`]:{color:o},[`${e}-node-content-wrapper`]:{color:o,background:"transparent","&, &:hover":{color:o},"&:before, &:hover:before":{background:n}}}}}))(l)].filter(Boolean)})(t,e),(0,w.A)(e)],e=>{let{colorTextLightSolid:t,colorPrimary:n}=e;return{...(e=>{let{controlHeightSM:t,controlItemBgHover:n,controlItemBgActive:o}=e;return{titleHeight:t,switcherSize:t,indentSize:t,nodeHoverBg:n,nodeHoverColor:e.colorText,nodeSelectedBg:o,nodeSelectedColor:e.colorText}})(e),directoryNodeSelectedColor:t,directoryNodeSelectedBg:n}}),C=e=>{let{dropPosition:t,dropLevelOffset:n,prefixCls:o,indent:r,direction:l="ltr"}=e,a="ltr"===l?"left":"right",s={[a]:-n*r+4,["ltr"===l?"right":"left"]:0};switch(t){case -1:s.top=-3;break;case 1:s.bottom=-3;break;default:s.bottom=-3,s[a]=r+4}return i.createElement("div",{style:s,className:`${o}-drop-indicator`})};var S=n(60495);function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let A=i.forwardRef((e,t)=>i.createElement(u.A,D({},e,{ref:t,icon:S.A})));var O=n(83914),M=n(58833);function P(){return(P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let T=i.forwardRef((e,t)=>i.createElement(u.A,P({},e,{ref:t,icon:M.A})));var I=n(98953);function R(){return(R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let L=i.forwardRef((e,t)=>i.createElement(u.A,R({},e,{ref:t,icon:I.A})));var j=n(26047),H=n(52690);let B=e=>{let t,{prefixCls:n,switcherIcon:o,treeNodeProps:r,showLine:a,switcherLoadingIcon:s}=e,{isLeaf:c,expanded:h,loading:u}=r;if(u)return i.isValidElement(s)?s:i.createElement(O.A,{className:`${n}-switcher-loading-icon`});if((0,j.Qd)(a)&&(t=a.showLeafIcon),c){if(!a)return null;if("boolean"!=typeof t&&t){let e=(0,j.Tn)(t)?t(r):t,o=`${n}-switcher-line-custom-icon`;return i.isValidElement(e)?(0,H.Ob)(e,{className:(0,d.$)(e.props?.className,o)}):e}return t?i.createElement(l.A,{className:`${n}-switcher-line-icon`}):i.createElement("span",{className:`${n}-switcher-leaf-line`})}let p=`${n}-switcher-icon`,f=(0,j.Tn)(o)?o(r):o;return i.isValidElement(f)?(0,H.Ob)(f,{className:(0,d.$)(f.props?.className,a?`${n}-switcher-line-icon`:p)}):void 0!==f?f:a?h?i.createElement(T,{className:`${n}-switcher-line-icon`}):i.createElement(L,{className:`${n}-switcher-line-icon`}):i.createElement(A,{className:p})},z=i.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r,className:l,style:a,classNames:s,styles:h}=(0,c.TP)("tree"),{virtual:u}=i.useContext(c.QO),{prefixCls:p,className:m,showIcon:k=!1,showLine:N,switcherIcon:w,switcherLoadingIcon:x,blockNode:E=!1,children:$,checkable:S=!1,selectable:D=!0,draggable:A,disabled:O,motion:M,style:P,rootClassName:T,classNames:I,styles:R,icon:L}=e,j=i.useContext(v.A),H=O??j,z=n("tree",p),_=n(),W=M??{...(0,y.A)(_),motionAppear:!1},V={...e,showIcon:k,blockNode:E,checkable:S,selectable:D,disabled:H,motion:W},[F,q]=(0,g.AV)([s,I],[h,R],{props:V}),U={...V,showLine:!!N,icon:L,dropIndicatorRender:C},[G,X]=K(z),[,Q]=(0,b.Ay)(),Y=Q.paddingXS/2+(Q.Tree?.titleHeight||Q.controlHeightSM),Z=i.useMemo(()=>{if(!A)return!1;let e={};switch(typeof A){case"function":e.nodeDraggable=A;break;case"object":e={...A}}return!1!==e.icon&&(e.icon=e.icon||i.createElement(f,null)),e},[A]);return i.createElement(o.Ay,{itemHeight:Y,ref:t,virtual:u,...U,prefixCls:z,className:(0,d.$)({[`${z}-icon-hide`]:!k,[`${z}-block-node`]:E,[`${z}-unselectable`]:!D,[`${z}-rtl`]:"rtl"===r,[`${z}-disabled`]:H},l,m,G,X),style:{...a,...P},rootClassName:(0,d.$)(F.root,T),rootStyle:q.root,classNames:F,styles:q,direction:r,checkable:S?i.createElement("span",{className:`${z}-checkbox-inner`}):S,selectable:D,switcherIcon:e=>i.createElement(B,{prefixCls:z,switcherIcon:w,switcherLoadingIcon:x,treeNodeProps:e,showLine:N}),draggable:Z},$)});function _(e,t,n){let{key:o,children:r}=n;e.forEach(function(e){let i=e[o],l=e[r];!1!==t(i,e)&&_(l||[],t,n)})}function W(e){let{isLeaf:t,expanded:n}=e;return t?i.createElement(l.A,null):n?i.createElement(a.A,null):i.createElement(s.A,null)}function V({treeData:e,children:t}){return e||(0,o.vH)(t)}let F=i.forwardRef((e,t)=>{let{defaultExpandAll:n,defaultExpandParent:l=!0,defaultExpandedKeys:a,...s}=e,h=i.useRef(null),u=i.useRef(null),[p,f]=i.useState(s.selectedKeys||s.defaultSelectedKeys||[]),[g,y]=i.useState(()=>(()=>{let{keyEntities:e}=(0,o.cG)(V(s),{fieldNames:s.fieldNames}),t=s.expandedKeys||a||[];return n?Object.keys(e):l?(0,o.hr)(t,e):t})());i.useEffect(()=>{"selectedKeys"in s&&f(s.selectedKeys)},[s.selectedKeys]),i.useEffect(()=>{"expandedKeys"in s&&y(s.expandedKeys)},[s.expandedKeys]);let{getPrefixCls:v,direction:b}=i.useContext(c.QO),{prefixCls:m,className:k,showIcon:N=!0,expandAction:w="click",...x}=s,E=v("tree",m),$=(0,d.$)(`${E}-directory`,{[`${E}-directory-rtl`]:"rtl"===b},k);return i.createElement(z,{icon:W,ref:t,blockNode:!0,...x,showIcon:N,expandAction:w,prefixCls:E,className:$,defaultExpandParent:l,expandedKeys:g,selectedKeys:p,onSelect:(e,t)=>{let n,{multiple:i,fieldNames:l}=s,{node:a,nativeEvent:d}=t,{key:c=""}=a,p=V(s),y={...t,selected:!0},v=d?.ctrlKey||d?.metaKey,b=d?.shiftKey;i&&v?(n=e,h.current=c,u.current=n):i&&b?n=Array.from(new Set([].concat((0,r.A)(u.current||[]),(0,r.A)(function({treeData:e,expandedKeys:t,startKey:n,endKey:r,fieldNames:i}){let l=[],a=0;return n&&n===r?[n]:n&&r?(_(e,e=>{if(2===a)return!1;if(e===n||e===r){if(l.push(e),0===a)a=1;else if(1===a)return a=2,!1}else 1===a&&l.push(e);return t.includes(e)},(0,o.AZ)(i)),l):[]}({treeData:p,expandedKeys:g,startKey:c,endKey:h.current,fieldNames:l}))))):(n=[c],h.current=c,u.current=n),y.selectedNodes=function(e,t,n){let i=(0,r.A)(t),l=[];return _(e,(e,t)=>{let n=i.indexOf(e);return -1!==n&&(l.push(t),i.splice(n,1)),!!i.length},(0,o.AZ)(n)),l}(p,n,l),s.onSelect?.(n,y),"selectedKeys"in s||f(n)},onExpand:(e,t)=>("expandedKeys"in s||y(e),s.onExpand?.(e,t))})});z.DirectoryTree=F,z.TreeNode=o.nF;let q=z},56768:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(97109),r=n(30960),i=n(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let a=o.forwardRef((e,t)=>o.createElement(i.A,l({},e,{ref:t,icon:r.A})))},57516:(e,t)=>{t.A={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"}},58833:(e,t)=>{t.A={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"}},60495:(e,t)=>{t.A={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"}},64254:(e,t,n)=>{n.d(t,{A:()=>a});var o=n(97109),r=n(79662),i=n(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let a=o.forwardRef((e,t)=>o.createElement(i.A,l({},e,{ref:t,icon:r.A})))},79662:(e,t)=>{t.A={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"}},87925:(e,t,n)=>{n.d(t,{nF:()=>E,$s:()=>j,BA:()=>L,po:()=>q,hr:()=>W,cG:()=>y,vH:()=>f,Ay:()=>X,AZ:()=>p});var o=n(3638),r=n(42644),i=n(97109);let l=i.createContext(null),a=i.createContext({}),s=e=>{let{dropPosition:t,dropLevelOffset:n,indent:o}=e,r={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case -1:r.top=0,r.left=-n*o;break;case 1:r.bottom=0,r.left=-n*o;break;case 0:r.bottom=0,r.left=o}return i.createElement("div",{style:r})};var d=n(93307),c=n(67189);let h=i.memo(({prefixCls:e,level:t,isStart:n,isEnd:r})=>{let l=`${e}-indent-unit`,a=[];for(let e=0;e<t;e+=1)a.push(i.createElement("span",{key:e,className:(0,o.$)(l,{[`${l}-start`]:n[e],[`${l}-end`]:r[e]})}));return i.createElement("span",{"aria-hidden":"true",className:`${e}-indent`},a)});function u(e,t){return null!=e?e:t}function p(e){let{title:t,_title:n,key:o,children:r}=e||{},i=t||"title";return{title:i,_title:n||[i],key:o||"key",children:r||"children"}}function f(e){return function e(t){return(0,r.$r)(t).map(t=>{if(!(t&&t.type&&t.type.isTreeNode))return(0,r.$e)(!t,"Tree/TreeNode can only accept TreeNode as children."),null;let{key:n}=t,{children:o,...i}=t.props,l={key:n,...i},a=e(o);return a.length&&(l.children=a),l}).filter(e=>e)}(e)}function g(e,t,n){let{_title:o,key:i,children:l}=p(n),a=new Set(!0===t?[]:t),s=[];return!function e(n,d=null){return n.map((c,h)=>{var p;let f,g=(p=d?d.pos:"0",`${p}-${h}`),y=u(c[i],g);for(let e=0;e<o.length;e+=1){let t=o[e];if(void 0!==c[t]){f=c[t];break}}let v=Object.assign((0,r.cJ)(c,[...o,i,l]),{title:f,key:y,parent:d,pos:g,children:null,data:c,isStart:[...d?d.isStart:[],0===h],isEnd:[...d?d.isEnd:[],h===n.length-1]});return s.push(v),!0===t||a.has(y)?v.children=e(c[l]||[],v):v.children=[],v})}(e),s}function y(e,{initWrapper:t,processEntity:n,onProcessFinished:o,externalGetKey:r,childrenPropName:i,fieldNames:l}={},a){let s={},d={},c={posEntities:s,keyEntities:d};return t&&(c=t(c)||c),!function(e,t,n){let o,{childrenPropName:r,externalGetKey:i,fieldNames:l}=("object"==typeof n?n:{externalGetKey:n})||{},{key:a,children:s}=p(l),d=r||s;i?"string"==typeof i?o=e=>e[i]:"function"==typeof i&&(o=e=>i(e)):o=(e,t)=>u(e[a],t),!function n(r,i,l,a){var s;let c=r?r[d]:e,h=r?(s=l.pos,`${s}-${i}`):"0",u=r?[...a,r]:[];if(r){let e=o(r,h);t({node:r,index:i,pos:h,key:e,parentPos:l.node?l.pos:null,level:l.level+1,nodes:u})}c&&c.forEach((e,t)=>{n(e,t,{node:r,pos:h,level:l?l.level+1:-1},u)})}(null)}(e,e=>{let{node:t,index:o,pos:r,key:i,parentPos:l,level:a,nodes:h}=e,p={node:t,nodes:h,index:o,key:i,pos:r,level:a},f=u(i,r);s[r]=p,d[f]=p,p.parent=s[l],p.parent&&(p.parent.children=p.parent.children||[],p.parent.children.push(p)),n&&n(p,c)},{externalGetKey:r||a,childrenPropName:i,fieldNames:l}),o&&o(c),c}function v(e,t,n,o){return!1!==e&&(e||!t&&!n||t&&o&&!n)}function b(e,{expandedKeys:t,selectedKeys:n,loadedKeys:o,loadingKeys:r,checkedKeys:i,halfCheckedKeys:l,dragOverNodeKey:a,dropPosition:s,keyEntities:d}){let c=d[e];return{eventKey:e,expanded:-1!==t.indexOf(e),selected:-1!==n.indexOf(e),loaded:-1!==o.indexOf(e),loading:-1!==r.indexOf(e),checked:-1!==i.indexOf(e),halfChecked:-1!==l.indexOf(e),pos:String(c?c.pos:""),dragOver:a===e&&0===s,dragOverGapTop:a===e&&-1===s,dragOverGapBottom:a===e&&1===s}}function m(e){let{data:t,expanded:n,selected:o,checked:i,loaded:l,loading:a,halfChecked:s,dragOver:d,dragOverGapTop:c,dragOverGapBottom:h,pos:u,active:p,eventKey:f}=e,g={...t,expanded:n,selected:o,checked:i,loaded:l,loading:a,halfChecked:s,dragOver:d,dragOverGapTop:c,dragOverGapBottom:h,pos:u,active:p,key:f};return"props"in g||Object.defineProperty(g,"props",{get:()=>((0,r.$e)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e)}),g}function k(){return(k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let N="open",w="close",x=e=>{let{eventKey:t,className:n,style:s,dragOver:d,dragOverGapTop:c,dragOverGapBottom:u,isLeaf:p,isStart:f,isEnd:g,expanded:y,selected:b,checked:x,halfChecked:E,loading:$,domRef:K,active:C,data:S,onMouseMove:D,selectable:A,treeId:O,...M}=e,P=(0,r.OX)(O,t),T=i.useContext(l),{classNames:I,styles:R}=T||{},L=i.useContext(a),j=i.useRef(null),[H,B]=i.useState(!1),z=!!(T.disabled||e.disabled||L.nodeDisabled?.(S)),_=i.useMemo(()=>!!T.checkable&&!1!==e.checkable&&T.checkable,[T.checkable,e.checkable]),W=t=>{z||_&&!e.disableCheckbox&&T.onNodeCheck(t,m(e),!x)},V=i.useMemo(()=>"boolean"==typeof A?A:T.selectable,[A,T.selectable]),F=t=>{if(T.onNodeClick(t,m(e)),V)z||T.onNodeSelect(t,m(e));else W(t)},q=t=>{T.onNodeDoubleClick(t,m(e))},U=t=>{T.onNodeMouseEnter(t,m(e))},G=t=>{T.onNodeMouseLeave(t,m(e))},X=t=>{T.onNodeContextMenu(t,m(e))},Q=i.useMemo(()=>!!(T.draggable&&(!T.draggable.nodeDraggable||T.draggable.nodeDraggable(S))),[T.draggable,S]),Y=t=>{$||T.onNodeExpand(t,m(e))},Z=i.useMemo(()=>{let{children:e}=T.keyEntities[t]||{};return!!(e||[]).length},[T.keyEntities,t]),J=i.useMemo(()=>v(p,T.loadData,Z,e.loaded),[p,T.loadData,Z,e.loaded]);i.useEffect(()=>{!$&&("function"!=typeof T.loadData||!y||J||e.loaded||T.onNodeLoad(m(e)))},[$,T.loadData,T.onNodeLoad,y,J,e]);let ee=i.useMemo(()=>T.draggable?.icon?i.createElement("span",{className:`${T.prefixCls}-draggable-icon`},T.draggable.icon):null,[T.draggable]),et=t=>{let n=e.switcherIcon||T.switcherIcon;return"function"==typeof n?n({...e,isLeaf:t}):n},en=i.useMemo(()=>{if(!_)return null;let t="boolean"!=typeof _?_:null;return i.createElement("span",{className:(0,o.$)(`${T.prefixCls}-checkbox`,{[`${T.prefixCls}-checkbox-checked`]:x,[`${T.prefixCls}-checkbox-indeterminate`]:!x&&E,[`${T.prefixCls}-checkbox-disabled`]:z||e.disableCheckbox}),onClick:W,role:"checkbox","aria-checked":E?"mixed":x,"aria-disabled":z||e.disableCheckbox,"aria-labelledby":P},t)},[_,x,E,z,e.disableCheckbox,P]),eo=i.useMemo(()=>J?null:y?N:w,[J,y]),er=i.useMemo(()=>i.createElement("span",{className:(0,o.$)(I?.itemIcon,`${T.prefixCls}-iconEle`,`${T.prefixCls}-icon__${eo||"docu"}`,{[`${T.prefixCls}-icon_loading`]:$}),style:R?.itemIcon}),[T.prefixCls,eo,$]),ei=i.useMemo(()=>{let n=!!T.draggable;return!e.disabled&&n&&T.dragOverNodeKey===t?T.dropIndicatorRender({dropPosition:T.dropPosition,dropLevelOffset:T.dropLevelOffset,indent:T.indent,prefixCls:T.prefixCls,direction:T.direction}):null},[T.dropPosition,T.dropLevelOffset,T.indent,T.prefixCls,T.direction,T.draggable,T.dragOverNodeKey,T.dropIndicatorRender]),el=i.useMemo(()=>{let t,n,{title:r="---"}=e,l=`${T.prefixCls}-node-content-wrapper`;if(T.showIcon){let n=e.icon||T.icon;t=n?i.createElement("span",{className:(0,o.$)(I?.itemIcon,`${T.prefixCls}-iconEle`,`${T.prefixCls}-icon__customize`),style:R?.itemIcon},"function"==typeof n?n(e):n):er}else T.loadData&&$&&(t=er);return n="function"==typeof r?r(S):T.titleRender?T.titleRender(S):r,i.createElement("span",{ref:j,title:"string"==typeof r?r:"",className:(0,o.$)(l,`${l}-${eo||"normal"}`,{[`${T.prefixCls}-node-selected`]:!z&&(b||H)}),onMouseEnter:U,onMouseLeave:G,onContextMenu:X,onClick:F,onDoubleClick:q},t,i.createElement("span",{className:(0,o.$)(`${T.prefixCls}-title`,I?.itemTitle),style:R?.itemTitle},n),ei)},[T.prefixCls,T.showIcon,e,T.icon,er,T.titleRender,S,eo,U,G,X,F,q]),ea=(0,r.KE)(M,{aria:!0,data:!0}),{level:es}=T.keyEntities[t]||{},ed=g[g.length-1],ec=!z&&Q,eh=T.draggingNodeKey===t;return i.createElement("div",k({ref:K,role:"treeitem",id:P,"aria-expanded":J?void 0:y,"aria-selected":V&&!z?b:void 0,"aria-checked":_&&!z?E?"mixed":x:void 0,"aria-disabled":z,className:(0,o.$)(n,`${T.prefixCls}-treenode`,I?.item,{[`${T.prefixCls}-treenode-disabled`]:z,[`${T.prefixCls}-treenode-switcher-${y?"open":"close"}`]:!p,[`${T.prefixCls}-treenode-checkbox-checked`]:x,[`${T.prefixCls}-treenode-checkbox-indeterminate`]:E,[`${T.prefixCls}-treenode-selected`]:b,[`${T.prefixCls}-treenode-loading`]:$,[`${T.prefixCls}-treenode-active`]:C,[`${T.prefixCls}-treenode-leaf-last`]:ed,[`${T.prefixCls}-treenode-draggable`]:Q,dragging:eh,"drop-target":T.dropTargetKey===t,"drop-container":T.dropContainerKey===t,"drag-over":!z&&d,"drag-over-gap-top":!z&&c,"drag-over-gap-bottom":!z&&u,"filter-node":T.filterTreeNode?.(m(e)),[`${T.prefixCls}-treenode-leaf`]:J}),style:{...s,...R?.item},draggable:ec,onDragStart:ec?t=>{t.stopPropagation(),B(!0),T.onNodeDragStart(t,e);try{t.dataTransfer.setData("text/plain","")}catch{}}:void 0,onDragEnter:Q?t=>{t.preventDefault(),t.stopPropagation(),T.onNodeDragEnter(t,e)}:void 0,onDragOver:Q?t=>{t.preventDefault(),t.stopPropagation(),T.onNodeDragOver(t,e)}:void 0,onDragLeave:Q?t=>{t.stopPropagation(),T.onNodeDragLeave(t,e)}:void 0,onDrop:Q?t=>{t.preventDefault(),t.stopPropagation(),B(!1),T.onNodeDrop(t,e)}:void 0,onDragEnd:Q?t=>{t.stopPropagation(),B(!1),T.onNodeDragEnd(t,e)}:void 0,onMouseMove:D},ea),i.createElement(h,{prefixCls:T.prefixCls,level:es,isStart:f,isEnd:g}),ee,(()=>{if(J){let e=et(!0);return!1!==e?i.createElement("span",{className:(0,o.$)(`${T.prefixCls}-switcher`,`${T.prefixCls}-switcher-noop`,I?.itemSwitcher),style:R?.itemSwitcher},e):null}let e=et(!1);return!1!==e?i.createElement("span",{onClick:Y,className:(0,o.$)(`${T.prefixCls}-switcher`,`${T.prefixCls}-switcher_${y?N:w}`,I?.itemSwitcher),style:R?.itemSwitcher},e):null})(),en,el)};x.isTreeNode=1;let E=x,$=function(e,t){let[n,o]=i.useState(!1);(0,r.Nf)(()=>{if(n)return e(),()=>{t()}},[n]),(0,r.Nf)(()=>(o(!0),()=>{o(!1)}),[])};function K(){return(K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let C=i.forwardRef((e,t)=>{let{className:n,style:a,motion:s,motionNodes:d,motionType:h,onMotionStart:u,onMotionEnd:p,active:f,treeNodeRequiredProps:g,...y}=e,[v,m]=i.useState(!0),{prefixCls:k}=i.useContext(l),N=d&&"hide"!==h;(0,r.Nf)(()=>{d&&N!==v&&m(N)},[d]);let w=i.useRef(!1),x=()=>{d&&!w.current&&(w.current=!0,p())};return($(()=>{d&&u()},x),d)?i.createElement(c.Ay,K({ref:t,visible:v},s,{motionAppear:"show"===h,onVisibleChanged:e=>{N===e&&x()}}),({className:e,style:t},n)=>i.createElement("div",{ref:n,className:(0,o.$)(`${k}-treenode-motion`,e),style:t},d.map(e=>{let{data:{...t},title:n,key:o,isStart:r,isEnd:l}=e;delete t.children;let a=b(o,g);return i.createElement(E,K({},t,a,{title:n,active:f,data:e.data,key:o,isStart:r,isEnd:l}))}))):i.createElement(E,K({domRef:t,className:n,style:a},y,{active:f}))});function S(e,t,n){let o=e.findIndex(e=>e.key===n),r=e[o+1],i=t.findIndex(e=>e.key===n);if(r){let e=t.findIndex(e=>e.key===r.key);return t.slice(i+1,e)}return t.slice(i+1)}function D(){return(D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}let A=`RC_TREE_MOTION_${Math.random()}`,O={key:A},M={key:A,level:0,index:0,pos:"0",node:O,nodes:[O]},P={parent:null,children:[],pos:M.pos,data:O,title:null,key:A,isStart:[],isEnd:[]};function T(e,t,n,o){return!1!==t&&n?e.slice(0,Math.ceil(n/o)+1):e}function I(e){let{key:t,pos:n}=e;return u(t,n)}let R=i.forwardRef((e,t)=>{let{prefixCls:n,data:o,selectable:l,checkable:a,expandedKeys:s,selectedKeys:c,checkedKeys:h,loadedKeys:p,loadingKeys:f,halfCheckedKeys:g,keyEntities:y,disabled:v,dragging:m,dragOverNodeKey:k,dropPosition:N,motion:w,height:x,itemHeight:E,virtual:$,scrollWidth:K,focusable:O,activeItem:M,tabIndex:R,onKeyDown:L,onFocus:j,onBlur:H,onMouseDown:B,onActiveChange:z,onListChangeStart:_,onListChangeEnd:W,...V}=e,F=(0,r.Bi)(),q=i.useRef(null),U=i.useRef(null);i.useImperativeHandle(t,()=>({scrollTo:e=>{q.current.scrollTo(e)},getIndentWidth:()=>U.current.offsetWidth}));let[G,X]=i.useState(s),[Q,Y]=i.useState(o),[Z,J]=i.useState(o),[ee,et]=i.useState([]),[en,eo]=i.useState(null),er=i.useRef(o);function ei(){let e=er.current;Y(e),J(e),et([]),eo(null),W()}er.current=o,(0,r.Nf)(()=>{X(s);let e=function(e=[],t=[]){let n=e.length,o=t.length;if(1!==Math.abs(n-o))return{add:!1,key:null};function r(e,t){let n=new Map;e.forEach(e=>{n.set(e,!0)});let o=t.filter(e=>!n.has(e));return 1===o.length?o[0]:null}return n<o?{add:!0,key:r(e,t)}:{add:!1,key:r(t,e)}}(G,s);if(null!==e.key)if(e.add){let t=Q.findIndex(({key:t})=>t===e.key),n=T(S(Q,o,e.key),$,x,E),r=Q.slice();r.splice(t+1,0,P),J(r),et(n),eo("show")}else{let t=o.findIndex(({key:t})=>t===e.key),n=T(S(o,Q,e.key),$,x,E),r=o.slice();r.splice(t+1,0,P),J(r),et(n),eo("hide")}else Q!==o&&(Y(o),J(o))},[s,o]),i.useEffect(()=>{m||ei()},[m]);let el=w?Z:o,ea={expandedKeys:s,selectedKeys:c,loadedKeys:p,loadingKeys:f,checkedKeys:h,halfCheckedKeys:g,dragOverNodeKey:k,dropPosition:N,keyEntities:y};return i.createElement(i.Fragment,null,i.createElement("div",{className:`${n}-treenode`,"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},i.createElement("div",{className:`${n}-indent`},i.createElement("div",{ref:U,className:`${n}-indent-unit`}))),i.createElement(d.A,D({},V,{data:el,itemKey:I,height:x,fullHeight:!1,virtual:$,itemHeight:E,scrollWidth:K,prefixCls:`${n}-list`,ref:q,role:"tree",tabIndex:!1===O||v?void 0:R,"aria-activedescendant":M?(0,r.OX)(F,M.key):void 0,onKeyDown:L,onFocus:j,onBlur:H,onMouseDown:B,onVisibleChange:e=>{e.every(e=>I(e)!==A)&&ei()}}),e=>{let{pos:t,data:{...n},title:o,key:r,isStart:l,isEnd:a}=e,s=u(r,t);delete n.key,delete n.children;let d=b(s,ea);return i.createElement(C,D({},n,d,{title:o,active:!!M&&r===M.key,pos:t,data:e.data,isStart:l,isEnd:a,motion:w,motionNodes:r===A?ee:null,motionType:en,onMotionStart:_,onMotionEnd:ei,treeNodeRequiredProps:ea,treeId:F,onMouseMove:()=>{z(null)}}))}))});function L(e,t){if(!e)return[];let n=e.slice(),o=n.indexOf(t);return o>=0&&n.splice(o,1),n}function j(e,t){let n=(e||[]).slice();return -1===n.indexOf(t)&&n.push(t),n}function H(e){return e.split("-")}function B(e,t,n,o,r,i,l,a,s,d){let{clientX:c,clientY:h}=e,{top:u,height:p}=e.target.getBoundingClientRect(),f=(("rtl"===d?-1:1)*((r?.x||0)-c)-12)/o,g=s.filter(e=>a[e]?.children?.length),y=a[n.eventKey];if(h<u+p/2){let e=l.findIndex(e=>e.key===y.key);y=a[l[e<=0?0:e-1].key]}let v=y.key,b=y,m=y.key,k=0,N=0;if(!g.includes(v))for(let e=0;e<f;e+=1)if(function(e){if(e.parent){let t=H(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}(y))y=y.parent,N+=1;else break;let w=t.data,x=y.node,E=!0;return function(e){let t=H(e.pos);return 0===Number(t[t.length-1])}(y)&&0===y.level&&h<u+p/2&&i({dragNode:w,dropNode:x,dropPosition:-1})&&y.key===n.eventKey?k=-1:(b.children||[]).length&&g.includes(m)?i({dragNode:w,dropNode:x,dropPosition:0})?k=0:E=!1:0===N?f>-1.5?i({dragNode:w,dropNode:x,dropPosition:1})?k=1:E=!1:i({dragNode:w,dropNode:x,dropPosition:0})?k=0:i({dragNode:w,dropNode:x,dropPosition:1})?k=1:E=!1:i({dragNode:w,dropNode:x,dropPosition:1})?k=1:E=!1,{dropPosition:k,dropLevelOffset:N,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:m,dropContainerKey:0===k?null:y.parent?.key||null,dropAllowed:E}}function z(e,t){if(!e)return;let{multiple:n}=t;return n?e.slice():e.length?[e[0]]:e}function _(e){let t;if(!e)return null;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!=typeof e)return(0,r.$e)(!1,"`checkedKeys` is not an array or an object"),null;t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return t}function W(e,t){let n=new Set;return(e||[]).forEach(e=>{!function e(o){if(n.has(o))return;let r=t[o];if(!r)return;n.add(o);let{parent:i,node:l}=r;!l.disabled&&i&&e(i.key)}(e)}),[...n]}function V(e,t){let n=new Set;return e.forEach(e=>{t.has(e)||n.add(e)}),n}function F(e){let{disabled:t,disableCheckbox:n,checkable:o}=e||{};return!!(t||n)||!1===o}function q(e,t,n,o){let i,l=[];i=o||F;let a=new Set(e.filter(e=>{let t=!!n[e];return t||l.push(e),t})),s=new Map,d=0;return Object.keys(n).forEach(e=>{let t=n[e],{level:o}=t,r=s.get(o);r||(r=new Set,s.set(o,r)),r.add(t),d=Math.max(d,o)}),(0,r.$e)(!l.length,`Tree missing follow keys: ${l.slice(0,100).map(e=>`'${e}'`).join(", ")}`),!0===t?function(e,t,n,o){let r=new Set(e),i=new Set;for(let e=0;e<=n;e+=1)(t.get(e)||new Set).forEach(e=>{let{key:t,node:n,children:i=[]}=e;r.has(t)&&!o(n)&&i.filter(e=>!o(e.node)).forEach(e=>{r.add(e.key)})});let l=new Set;for(let e=n;e>=0;e-=1)(t.get(e)||new Set).forEach(e=>{let{parent:t,node:n}=e;if(o(n)||!e.parent||l.has(e.parent.key))return;if(o(e.parent.node))return void l.add(t.key);let a=!0,s=!1;(t.children||[]).filter(e=>!o(e.node)).forEach(({key:e})=>{let t=r.has(e);a&&!t&&(a=!1),!s&&(t||i.has(e))&&(s=!0)}),a&&r.add(t.key),s&&i.add(t.key),l.add(t.key)});return{checkedKeys:Array.from(r),halfCheckedKeys:Array.from(V(i,r))}}(a,s,d,i):function(e,t,n,o,r){let i=new Set(e),l=new Set(t);for(let e=0;e<=o;e+=1)(n.get(e)||new Set).forEach(e=>{let{key:t,node:n,children:o=[]}=e;i.has(t)||l.has(t)||r(n)||o.filter(e=>!r(e.node)).forEach(e=>{i.delete(e.key)})});l=new Set;let a=new Set;for(let e=o;e>=0;e-=1)(n.get(e)||new Set).forEach(e=>{let{parent:t,node:n}=e;if(r(n)||!e.parent||a.has(e.parent.key))return;if(r(e.parent.node))return void a.add(t.key);let o=!0,s=!1;(t.children||[]).filter(e=>!r(e.node)).forEach(({key:e})=>{let t=i.has(e);o&&!t&&(o=!1),!s&&(t||l.has(e))&&(s=!0)}),o||i.delete(t.key),s&&l.add(t.key),a.add(t.key)});return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(V(l,i))}}(a,t.halfCheckedKeys,s,d,i)}function U(){return(U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}class G extends i.Component{static 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:s,allowDrop:()=>!0,expandAction:!1};static TreeNode=E;destroyed=!1;delayedDragEnterLogic;loadingRetryTimes={};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:[],activeKey:null,listChanging:!1,prevProps:null,fieldNames:p()};dragStartMousePosition=null;dragNodeProps=null;currentMouseOverDroppableNodeKey=null;focusedByMouse=!1;listRef=i.createRef();componentDidMount(){this.destroyed=!1,this.onUpdated(),window.addEventListener("mouseup",this.onGlobalMouseUp)}componentDidUpdate(){this.onUpdated()}onUpdated(){let{activeKey:e,itemScrollOffset:t=0}=this.props;void 0!==e&&e!==this.state.activeKey&&(this.setState({activeKey:e}),null!==e&&this.scrollTo({key:e,offset:t}))}componentWillUnmount(){window.removeEventListener("dragend",this.onWindowDragEnd),window.removeEventListener("mouseup",this.onGlobalMouseUp),this.destroyed=!0}static getDerivedStateFromProps(e,t){let n,{prevProps:o}=t,i={prevProps:e};function l(t){return!o&&e.hasOwnProperty(t)||o&&o[t]!==e[t]}let{fieldNames:a}=t;l("fieldNames")&&(i.fieldNames=a=p(e.fieldNames)),l("treeData")?{treeData:n}=e:l("children")&&((0,r.$e)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),n=f(e.children)),n&&(i.treeData=n,i.keyEntities={[A]:M,...y(n,{fieldNames:a}).keyEntities});let s=i.keyEntities||t.keyEntities;if(l("expandedKeys")||o&&l("autoExpandParent"))i.expandedKeys=e.autoExpandParent||!o&&e.defaultExpandParent?W(e.expandedKeys,s):e.expandedKeys;else if(!o&&e.defaultExpandAll){let e={...s};delete e[A];let t=[];Object.keys(e).forEach(n=>{let o=e[n];o.children&&o.children.length&&t.push(o.key)}),i.expandedKeys=t}else!o&&e.defaultExpandedKeys&&(i.expandedKeys=e.autoExpandParent||e.defaultExpandParent?W(e.defaultExpandedKeys,s):e.defaultExpandedKeys);if(i.expandedKeys||delete i.expandedKeys,n||i.expandedKeys){let e=g(n||t.treeData,i.expandedKeys||t.expandedKeys,a);i.flattenNodes=e}if(e.selectable&&(l("selectedKeys")?i.selectedKeys=z(e.selectedKeys,e):!o&&e.defaultSelectedKeys&&(i.selectedKeys=z(e.defaultSelectedKeys,e))),e.checkable){let r;if(l("checkedKeys")?r=_(e.checkedKeys)||{}:!o&&e.defaultCheckedKeys?r=_(e.defaultCheckedKeys)||{}:n&&(r=_(e.checkedKeys)||{checkedKeys:t.checkedKeys,halfCheckedKeys:t.halfCheckedKeys}),r){let{checkedKeys:t=[],halfCheckedKeys:n=[]}=r;if(!e.checkStrictly){let e=q(t,!0,s);({checkedKeys:t,halfCheckedKeys:n}=e)}i.checkedKeys=t,i.halfCheckedKeys=n}}return l("loadedKeys")&&(i.loadedKeys=e.loadedKeys),i}onNodeDragStart=(e,t)=>{let{expandedKeys:n,keyEntities:o}=this.state,{onDragStart:r}=this.props,{eventKey:i}=t;this.dragNodeProps=t,this.dragStartMousePosition={x:e.clientX,y:e.clientY};let l=L(n,i);this.setState({draggingNodeKey:i,dragChildrenKeys:function(e,t){let n=[];return!function e(t=[]){t.forEach(({key:t,children:o})=>{n.push(t),e(o)})}(t[e].children),n}(i,o),indent:this.listRef.current.getIndentWidth()}),this.setExpandedKeys(l),window.addEventListener("dragend",this.onWindowDragEnd),r?.({event:e,node:m(t)})};onNodeDragEnter=(e,t)=>{let{expandedKeys:n,keyEntities:o,dragChildrenKeys:r,flattenNodes:i,indent:l}=this.state,{onDragEnter:a,onExpand:s,allowDrop:d,direction:c}=this.props,{pos:h,eventKey:u}=t;if(this.currentMouseOverDroppableNodeKey!==u&&(this.currentMouseOverDroppableNodeKey=u),!this.dragNodeProps)return void this.resetDragState();let{dropPosition:p,dropLevelOffset:f,dropTargetKey:g,dropContainerKey:y,dropTargetPos:v,dropAllowed:b,dragOverNodeKey:k}=B(e,this.dragNodeProps,t,l,this.dragStartMousePosition,d,i,o,n,c);return r.includes(g)||!b||(this.delayedDragEnterLogic||(this.delayedDragEnterLogic={}),Object.keys(this.delayedDragEnterLogic).forEach(e=>{clearTimeout(this.delayedDragEnterLogic[e])}),this.dragNodeProps.eventKey!==t.eventKey&&(e.persist(),this.delayedDragEnterLogic[h]=window.setTimeout(()=>{if(null===this.state.draggingNodeKey)return;let r=[...n],i=o[t.eventKey];i&&(i.children||[]).length&&(r=j(n,t.eventKey)),this.props.hasOwnProperty("expandedKeys")||this.setExpandedKeys(r),s?.(r,{node:m(t),expanded:!0,nativeEvent:e.nativeEvent})},800)),this.dragNodeProps.eventKey===g&&0===f)?void this.resetDragState():void(this.setState({dragOverNodeKey:k,dropPosition:p,dropLevelOffset:f,dropTargetKey:g,dropContainerKey:y,dropTargetPos:v,dropAllowed:b}),a?.({event:e,node:m(t),expandedKeys:n}))};onNodeDragOver=(e,t)=>{let{dragChildrenKeys:n,flattenNodes:o,keyEntities:r,expandedKeys:i,indent:l}=this.state,{onDragOver:a,allowDrop:s,direction:d}=this.props;if(!this.dragNodeProps)return;let{dropPosition:c,dropLevelOffset:h,dropTargetKey:u,dropContainerKey:p,dropTargetPos:f,dropAllowed:g,dragOverNodeKey:y}=B(e,this.dragNodeProps,t,l,this.dragStartMousePosition,s,o,r,i,d);!n.includes(u)&&g&&(this.dragNodeProps.eventKey===u&&0===h?(null!==this.state.dropPosition||null!==this.state.dropLevelOffset||null!==this.state.dropTargetKey||null!==this.state.dropContainerKey||null!==this.state.dropTargetPos||!1!==this.state.dropAllowed||null!==this.state.dragOverNodeKey)&&this.resetDragState():(c!==this.state.dropPosition||h!==this.state.dropLevelOffset||u!==this.state.dropTargetKey||p!==this.state.dropContainerKey||f!==this.state.dropTargetPos||g!==this.state.dropAllowed||y!==this.state.dragOverNodeKey)&&this.setState({dropPosition:c,dropLevelOffset:h,dropTargetKey:u,dropContainerKey:p,dropTargetPos:f,dropAllowed:g,dragOverNodeKey:y}),a?.({event:e,node:m(t)}))};onNodeDragLeave=(e,t)=>{this.currentMouseOverDroppableNodeKey!==t.eventKey||e.currentTarget.contains(e.relatedTarget)||(this.resetDragState(),this.currentMouseOverDroppableNodeKey=null);let{onDragLeave:n}=this.props;n?.({event:e,node:m(t)})};onWindowDragEnd=e=>{this.onNodeDragEnd(e,null,!0),window.removeEventListener("dragend",this.onWindowDragEnd)};onNodeDragEnd=(e,t)=>{let{onDragEnd:n}=this.props;this.setState({dragOverNodeKey:null}),this.cleanDragState(),n?.({event:e,node:m(t)}),this.dragNodeProps=null,window.removeEventListener("dragend",this.onWindowDragEnd)};onNodeDrop=(e,t,n=!1)=>{let{dragChildrenKeys:o,dropPosition:i,dropTargetKey:l,dropTargetPos:a,dropAllowed:s}=this.state;if(!s)return;let{onDrop:d}=this.props;if(this.setState({dragOverNodeKey:null}),this.cleanDragState(),null===l)return;let c={...b(l,this.getTreeNodeRequiredProps()),active:this.getActiveItem()?.key===l,data:this.state.keyEntities[l].node},h=o.includes(l);(0,r.$e)(!h,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");let u=H(a),p={event:e,node:m(c),dragNode:this.dragNodeProps?m(this.dragNodeProps):null,dragNodesKeys:[this.dragNodeProps.eventKey].concat(o),dropToGap:0!==i,dropPosition:i+Number(u[u.length-1])};n||d?.(p),this.dragNodeProps=null};resetDragState(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}cleanDragState=()=>{let{draggingNodeKey:e}=this.state;null!==e&&this.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),this.dragStartMousePosition=null,this.currentMouseOverDroppableNodeKey=null};triggerExpandActionExpand=(e,t)=>{let{expandedKeys:n,flattenNodes:o}=this.state,{expanded:r,key:i,isLeaf:l}=t;if(l||e.shiftKey||e.metaKey||e.ctrlKey)return;let a=o.filter(e=>e.key===i)[0],s=m({...b(i,this.getTreeNodeRequiredProps()),data:a.data});this.setExpandedKeys(r?L(n,i):j(n,i)),this.onNodeExpand(e,s)};onNodeClick=(e,t)=>{let{onClick:n,expandAction:o}=this.props;"click"===o&&this.triggerExpandActionExpand(e,t),n?.(e,t)};onNodeDoubleClick=(e,t)=>{let{onDoubleClick:n,expandAction:o}=this.props;"doubleClick"===o&&this.triggerExpandActionExpand(e,t),n?.(e,t)};onNodeSelect=(e,t)=>{let{selectedKeys:n}=this.state,{keyEntities:o,fieldNames:r}=this.state,{onSelect:i,multiple:l}=this.props,{selected:a}=t,s=t[r.key],d=!a,c=(n=d?l?j(n,s):[s]:L(n,s)).map(e=>{let t=o[e];return t?t.node:null}).filter(Boolean);this.setUncontrolledState({selectedKeys:n}),i?.(n,{event:"select",selected:d,node:t,selectedNodes:c,nativeEvent:e.nativeEvent})};onNodeCheck=(e,t,n)=>{let o,{keyEntities:r,checkedKeys:i,halfCheckedKeys:l}=this.state,{checkStrictly:a,onCheck:s}=this.props,{key:d}=t,c={event:"check",node:t,checked:n,nativeEvent:e.nativeEvent};if(a){let e=n?j(i,d):L(i,d);o={checked:e,halfChecked:L(l,d)},c.checkedNodes=e.map(e=>r[e]).filter(Boolean).map(e=>e.node),this.setUncontrolledState({checkedKeys:e})}else{let{checkedKeys:e,halfCheckedKeys:t}=q([...i,d],!0,r);if(!n){let n=new Set(e);n.delete(d),{checkedKeys:e,halfCheckedKeys:t}=q(Array.from(n),{checked:!1,halfCheckedKeys:t},r)}o=e,c.checkedNodes=[],c.checkedNodesPositions=[],c.halfCheckedKeys=t,e.forEach(e=>{let t=r[e];if(!t)return;let{node:n,pos:o}=t;c.checkedNodes.push(n),c.checkedNodesPositions.push({node:n,pos:o})}),this.setUncontrolledState({checkedKeys:e},!1,{halfCheckedKeys:t})}s?.(o,c)};onNodeLoad=e=>{let{key:t}=e,{keyEntities:n}=this.state,o=n[t];if(o?.children?.length)return;let i=new Promise((n,o)=>{this.setState(({loadedKeys:i=[],loadingKeys:l=[]})=>{let{loadData:a,onLoad:s}=this.props;return!a||i.includes(t)||l.includes(t)?null:(a(e).then(()=>{let{loadedKeys:o}=this.state,r=j(o,t);s?.(r,{event:"load",node:e}),this.setUncontrolledState({loadedKeys:r}),this.setState(e=>({loadingKeys:L(e.loadingKeys,t)})),n()}).catch(e=>{if(this.setState(e=>({loadingKeys:L(e.loadingKeys,t)})),this.loadingRetryTimes[t]=(this.loadingRetryTimes[t]||0)+1,this.loadingRetryTimes[t]>=10){let{loadedKeys:e}=this.state;(0,r.$e)(!1,"Retry for `loadData` many times but still failed. No more retry."),this.setUncontrolledState({loadedKeys:j(e,t)}),n()}o(e)}),{loadingKeys:j(l,t)})})});return i.catch(()=>{}),i};onNodeMouseEnter=(e,t)=>{let{onMouseEnter:n}=this.props;n?.({event:e,node:t})};onNodeMouseLeave=(e,t)=>{let{onMouseLeave:n}=this.props;n?.({event:e,node:t})};onNodeContextMenu=(e,t)=>{let{onRightClick:n}=this.props;n&&(e.preventDefault(),n({event:e,node:t}))};onMouseDown=e=>{this.focusedByMouse=!0;let{onMouseDown:t}=this.props;t?.(e)};onGlobalMouseUp=()=>{this.focusedByMouse=!1};onFocus=(...e)=>{let{onFocus:t,disabled:n}=this.props,{activeKey:o,selectedKeys:r,flattenNodes:i}=this.state;if(!this.focusedByMouse&&!n&&null===o){let e=r.find(e=>i.some(t=>t.key===e));void 0!==e?this.onActiveChange(e):this.onActiveChange(i?.[0]?.key||null)}t?.(...e)};onBlur=(...e)=>{let{onBlur:t}=this.props;this.onActiveChange(null),t?.(...e)};getTreeNodeRequiredProps=()=>{let{expandedKeys:e,selectedKeys:t,loadedKeys:n,loadingKeys:o,checkedKeys:r,halfCheckedKeys:i,dragOverNodeKey:l,dropPosition:a,keyEntities:s}=this.state;return{expandedKeys:e||[],selectedKeys:t||[],loadedKeys:n||[],loadingKeys:o||[],checkedKeys:r||[],halfCheckedKeys:i||[],dragOverNodeKey:l,dropPosition:a,keyEntities:s}};setExpandedKeys=e=>{let{treeData:t,fieldNames:n}=this.state,o=g(t,e,n);this.setUncontrolledState({expandedKeys:e,flattenNodes:o},!0)};onNodeExpand=(e,t)=>{let{expandedKeys:n}=this.state,{listChanging:o,fieldNames:i}=this.state,{onExpand:l,loadData:a}=this.props,{expanded:s}=t,d=t[i.key];if(o)return;let c=n.includes(d),h=!s;if((0,r.$e)(s&&c||!s&&!c,"Expand state not sync with index check"),n=h?j(n,d):L(n,d),this.setExpandedKeys(n),l?.(n,{node:t,expanded:h,nativeEvent:e.nativeEvent}),h&&a){let e=this.onNodeLoad(t);e&&e.then(()=>{let e=g(this.state.treeData,n,i);this.setUncontrolledState({flattenNodes:e})}).catch(()=>{let{expandedKeys:e}=this.state,t=L(e,d);this.setExpandedKeys(t)})}};onListChangeStart=()=>{this.setUncontrolledState({listChanging:!0})};onListChangeEnd=()=>{setTimeout(()=>{this.setUncontrolledState({listChanging:!1})})};onActiveChange=e=>{let{activeKey:t}=this.state,{onActiveChange:n,itemScrollOffset:o=0}=this.props;t!==e&&(this.setState({activeKey:e}),null!==e&&this.scrollTo({key:e,offset:o}),n?.(e))};getActiveItem=()=>{let{activeKey:e,flattenNodes:t}=this.state;return null===e?null:t.find(({key:t})=>t===e)||null};offsetActiveKey=e=>{let{flattenNodes:t,activeKey:n}=this.state,o=t.findIndex(({key:e})=>e===n);-1===o&&e<0&&(o=t.length),o=(o+e+t.length)%t.length;let r=t[o];if(r){let{key:e}=r;this.onActiveChange(e)}else this.onActiveChange(null)};onKeyDown=e=>{let{activeKey:t,expandedKeys:n,checkedKeys:o,flattenNodes:r,keyEntities:i}=this.state,{onKeyDown:l,checkable:a,selectable:s,disabled:d,loadData:c}=this.props;if(d)return;switch(e.key){case"ArrowUp":this.offsetActiveKey(-1),e.preventDefault();break;case"ArrowDown":this.offsetActiveKey(1),e.preventDefault();break;case"Home":this.onActiveChange(r?.[0]?.key),e.preventDefault();break;case"End":this.onActiveChange(r?.[r.length-1]?.key),e.preventDefault()}let h=this.getActiveItem();if(h&&h.data){let r=m({...b(t,this.getTreeNodeRequiredProps()),data:h.data,active:!0}),l=i[t],d=!!l?.children?.length,u=!v(h.data.isLeaf,c,d,r.loaded),p=a&&!r.disabled&&!1!==r.checkable&&!r.disableCheckbox,f=!a&&s&&!r.disabled&&!1!==r.selectable;switch(e.key){case"ArrowLeft":u&&n.includes(t)?this.onNodeExpand({},r):h.parent&&this.onActiveChange(h.parent.key),e.preventDefault();break;case"ArrowRight":u&&!n.includes(t)?this.onNodeExpand({},r):h.children&&h.children.length&&this.onActiveChange(h.children[0].key),e.preventDefault();break;case"Enter":u?(e.preventDefault(),this.onNodeExpand({},r)):p?o.includes(t)||(e.preventDefault(),this.onNodeCheck({},r,!0)):f&&!r.selected&&(e.preventDefault(),this.onNodeSelect({},r));break;case" ":p?(e.preventDefault(),this.onNodeCheck({},r,!o.includes(t))):f&&(e.preventDefault(),this.onNodeSelect({},r))}}l?.(e)};setUncontrolledState=(e,t=!1,n=null)=>{if(!this.destroyed){let o=!1,r=!0,i={};Object.keys(e).forEach(t=>{if(this.props.hasOwnProperty(t)){r=!1;return}o=!0,i[t]=e[t]}),o&&(!t||r)&&this.setState({...i,...n})}};scrollTo=e=>{this.listRef.current.scrollTo(e)};render(){let e,{flattenNodes:t,keyEntities:n,draggingNodeKey:a,dropLevelOffset:s,dropContainerKey:d,dropTargetKey:c,dropPosition:h,dragOverNodeKey:u,indent:p}=this.state,{prefixCls:f,className:g,style:y,styles:v,classNames:b,showLine:m,focusable:k,tabIndex:N=0,selectable:w,showIcon:x,icon:E,switcherIcon:$,draggable:K,checkable:C,checkStrictly:S,disabled:D,motion:A,loadData:O,filterTreeNode:M,height:P,itemHeight:T,scrollWidth:I,virtual:L,titleRender:j,dropIndicatorRender:H,onContextMenu:B,onScroll:z,direction:_,rootClassName:W,rootStyle:V}=this.props,F=(0,r.KE)(this.props,{aria:!0,data:!0});K&&(e="object"==typeof K?K:"function"==typeof K?{nodeDraggable:K}:{});let q={styles:v,classNames:b,prefixCls:f,selectable:w,showIcon:x,icon:E,switcherIcon:$,draggable:e,draggingNodeKey:a,checkable:C,checkStrictly:S,disabled:D,keyEntities:n,dropLevelOffset:s,dropContainerKey:d,dropTargetKey:c,dropPosition:h,dragOverNodeKey:u,indent:p,direction:_,dropIndicatorRender:H,loadData:O,filterTreeNode:M,titleRender:j,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};return i.createElement(l.Provider,{value:q},i.createElement("div",{className:(0,o.$)(f,g,W,{[`${f}-show-line`]:m}),style:V},i.createElement(R,U({ref:this.listRef,prefixCls:f,style:y,data:t,disabled:D,selectable:w,checkable:!!C,motion:A,dragging:null!==a,height:P,itemHeight:T,virtual:L,focusable:k,tabIndex:N,activeItem:this.getActiveItem(),onFocus:this.onFocus,onMouseDown:this.onMouseDown,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:B,onScroll:z,scrollWidth:I},this.getTreeNodeRequiredProps(),F))))}}let X=G},98953:(e,t)=>{t.A={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"}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[478],{7225:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(97109),n=r(23830),i=r(88483);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,o({},e,{ref:t,icon:n.A})))},7492:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(97109),n=r(33460),i=r(88483);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,o({},e,{ref:t,icon:n.A})))},12887:(e,t)=>{t.A={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 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"}},17362:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"unordered-list",theme:"outlined"}},23830:(e,t)=>{t.A={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"}},24810:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(97109),n=r(31738),i=r(88483);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,o({},e,{ref:t,icon:n.A})))},26631:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(97109),n=r(12887),i=r(88483);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,o({},e,{ref:t,icon:n.A})))},28438:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 144H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H212V212h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16zm-52 268H612V212h200v200zM464 544H160c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H212V612h200v200zm452-268H560c-8.8 0-16 7.2-16 16v304c0 8.8 7.2 16 16 16h304c8.8 0 16-7.2 16-16V560c0-8.8-7.2-16-16-16zm-52 268H612V612h200v200z"}}]},name:"appstore",theme:"outlined"}},31738:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"}},33460:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"}},42758:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(97109),n=r(28438),i=r(88483);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,o({},e,{ref:t,icon:n.A})))},46082:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(97109),n=r(17362),i=r(88483);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,o({},e,{ref:t,icon:n.A})))},49292:(e,t,r)=>{r.d(t,{A:()=>B});var a=r(97109),n=r(64446),i=r(32565),o=r(91147),l=r(77611),c=r(3638),d=r(67189),s=r(73473);let h=(e,t)=>{if(!e)return null;let r={left:e.offsetLeft,right:e.parentElement.clientWidth-e.clientWidth-e.offsetLeft,width:e.clientWidth,top:e.offsetTop,bottom:e.parentElement.clientHeight-e.clientHeight-e.offsetTop,height:e.clientHeight};return t?{left:0,right:0,width:0,top:r.top,bottom:r.bottom,height:r.height}:{left:r.left,right:r.right,width:r.width,top:0,bottom:0,height:0}},m=e=>void 0!==e?`${e}px`:void 0;function u(e){let{prefixCls:t,containerRef:r,value:n,getValueIndex:i,motionName:o,onMotionStart:u,onMotionEnd:g,direction:f,vertical:b=!1}=e,v=a.useRef(null),[p,$]=a.useState(n),w=e=>{let a=i(e),n=r.current?.querySelectorAll(`.${t}-item`)[a];return n?.offsetParent&&n},[z,A]=a.useState(null),[y,S]=a.useState(null);(0,s.A)(()=>{if(p!==n){let e=w(p),t=w(n),r=h(e,b),a=h(t,b);$(n),A(r),S(a),e&&t?u():g()}},[n]);let H=a.useMemo(()=>b?m(z?.top??0):"rtl"===f?m(-z?.right):m(z?.left),[b,f,z]),x=a.useMemo(()=>b?m(y?.top??0):"rtl"===f?m(-y?.right):m(y?.left),[b,f,y]);return z&&y?a.createElement(d.Ay,{visible:!0,motionName:o,motionAppear:!0,onAppearStart:()=>b?{transform:"translateY(var(--thumb-start-top))",height:"var(--thumb-start-height)"}:{transform:"translateX(var(--thumb-start-left))",width:"var(--thumb-start-width)"},onAppearActive:()=>b?{transform:"translateY(var(--thumb-active-top))",height:"var(--thumb-active-height)"}:{transform:"translateX(var(--thumb-active-left))",width:"var(--thumb-active-width)"},onVisibleChanged:()=>{A(null),S(null),g()}},({className:e,style:r},n)=>{let i={...r,"--thumb-start-left":H,"--thumb-start-width":m(z?.width),"--thumb-active-left":x,"--thumb-active-width":m(y?.width),"--thumb-start-top":H,"--thumb-start-height":m(z?.height),"--thumb-active-top":x,"--thumb-active-height":m(y?.height)},o={ref:(0,l.K4)(v,n),style:i,className:(0,c.$)(`${t}-thumb`,e)};return a.createElement("div",o)}):null}let g=({prefixCls:e,className:t,style:r,styles:n,classNames:i,data:o,disabled:l,checked:d,label:s,title:h,value:m,name:u,onChange:g,onFocus:f,onBlur:b,onKeyDown:v,onKeyUp:p,onMouseDown:$,itemRender:w=e=>e})=>w(a.createElement("label",{className:(0,c.$)(t,{[`${e}-item-disabled`]:l}),style:r,onMouseDown:$},a.createElement("input",{name:u,className:`${e}-item-input`,type:"radio",disabled:l,checked:d,onChange:e=>{l||g(e,m)},onFocus:f,onBlur:b,onKeyDown:v,onKeyUp:p}),a.createElement("div",{className:(0,c.$)(`${e}-item-label`,i?.label),title:h,style:n?.label},s)),{item:o}),f=a.forwardRef((e,t)=>{let{prefixCls:r="rc-segmented",direction:d,vertical:s,options:h=[],disabled:m,defaultValue:f,value:b,name:v,onChange:p,className:$="",style:w,styles:z,classNames:A,motionName:y="thumb-motion",itemRender:S,...H}=e,x=a.useRef(null),k=a.useMemo(()=>(0,l.K4)(x,t),[x,t]),M=a.useMemo(()=>h.map(e=>{if("object"==typeof e&&null!==e){let t=void 0!==e.title?e.title:"object"!=typeof e.label?e.label?.toString():void 0;return{...e,title:t}}return{label:e?.toString(),title:e?.toString(),value:e}}),[h]),[E,O]=(0,i.A)(f??M[0]?.value,b),[B,R]=a.useState(!1),j=(e,t)=>{O(t),p?.(t)},N=(0,o.A)(H,["children"]),[P,I]=a.useState(!1),[V,C]=a.useState(!1),L=()=>{C(!0)},q=()=>{C(!1)},T=()=>{I(!1)},W=e=>{"Tab"===e.key&&I(!0)},X=e=>{let t=M.findIndex(e=>e.value===E),r=M.length,a=M[(t+e+r)%r];a&&(O(a.value),p?.(a.value))},D=e=>{switch(e.key){case"ArrowLeft":case"ArrowUp":X(-1);break;case"ArrowRight":case"ArrowDown":X(1)}};return a.createElement("div",(0,n.A)({role:"radiogroup","aria-label":"segmented control",tabIndex:m?void 0:0,"aria-orientation":s?"vertical":"horizontal",style:w},N,{className:(0,c.$)(r,{[`${r}-rtl`]:"rtl"===d,[`${r}-disabled`]:m,[`${r}-vertical`]:s},$),ref:k}),a.createElement("div",{className:`${r}-group`},a.createElement(u,{vertical:s,prefixCls:r,value:E,containerRef:x,motionName:`${r}-${y}`,direction:d,getValueIndex:e=>M.findIndex(t=>t.value===e),onMotionStart:()=>{R(!0)},onMotionEnd:()=>{R(!1)}}),M.map(e=>{let{value:t,disabled:i}=e;return a.createElement(g,(0,n.A)({},e,{name:v,data:e,itemRender:S,key:t,prefixCls:r,className:(0,c.$)(e.className,`${r}-item`,A?.item,{[`${r}-item-selected`]:t===E&&!B,[`${r}-item-focused`]:V&&P&&t===E}),style:z?.item,classNames:A,styles:z,checked:t===E,onChange:j,onFocus:L,onBlur:q,onKeyDown:D,onKeyUp:W,onMouseDown:T,disabled:!!m||!!i}))})))});var b=r(42644),v=r(5045),p=r(92162),$=r(26047),w=r(74567),z=r(27273),A=r(14932),y=r(15561),S=r(7961),H=r(10540),x=r(28403);function k(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}}let M=e=>({background:e.itemSelectedBg,boxShadow:e.boxShadowTertiary}),E={overflow:"hidden",...S.L9},O=(0,H.OF)("Segmented",e=>{let{lineWidth:t,calc:r}=e;return(e=>{let{componentCls:t,motionDurationSlow:r,motionEaseInOut:a,motionDurationMid:n}=e,i=e.calc(e.controlHeight).sub(e.calc(e.trackPadding).mul(2)).equal(),o=e.calc(e.controlHeightLG).sub(e.calc(e.trackPadding).mul(2)).equal(),l=e.calc(e.controlHeightSM).sub(e.calc(e.trackPadding).mul(2)).equal();return{[t]:{...(0,S.dF)(e),display:"inline-block",padding:e.trackPadding,color:e.itemColor,background:e.trackBg,borderRadius:e.borderRadius,transition:`all ${n}`,...(0,S.K8)(e),[`${t}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",flexDirection:"row",width:"100%"},[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-vertical`]:{[`${t}-group`]:{flexDirection:"column"},[`${t}-thumb`]:{width:"100%",height:0,padding:`0 ${(0,y.zA)(e.paddingXXS)}`}},[`&${t}-block`]:{display:"flex"},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${n}`,borderRadius:e.borderRadiusSM,transform:"translateZ(0)","&-selected":{...M(e),color:e.itemSelectedColor},"&-focused":(0,S.jk)(e),"&::after":{content:'""',position:"absolute",zIndex:-1,width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",opacity:0,pointerEvents:"none",transition:["opacity","background-color"].map(e=>`${e} ${n}`).join(", ")},[`&:not(${t}-item-selected):not(${t}-item-disabled)`]:{"&:hover, &:active":{color:e.itemHoverColor},"&:hover::after":{opacity:1,backgroundColor:e.itemHoverBg},"&:active::after":{opacity:1,backgroundColor:e.itemActiveBg}},"&-label":{minHeight:i,lineHeight:(0,y.zA)(i),padding:`0 ${(0,y.zA)(e.segmentedPaddingHorizontal)}`,...E},"&-icon + *":{marginInlineStart:e.calc(e.marginSM).div(2).equal()},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${t}-thumb`]:{...M(e),position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${(0,y.zA)(e.paddingXXS)} 0`,borderRadius:e.borderRadiusSM,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:"transparent"}},[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:o,lineHeight:(0,y.zA)(o),padding:`0 ${(0,y.zA)(e.segmentedPaddingHorizontal)}`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:l,lineHeight:(0,y.zA)(l),padding:`0 ${(0,y.zA)(e.segmentedPaddingHorizontalSM)}`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}},...k(`&-disabled ${t}-item`,e),...k(`${t}-item-disabled`,e),[`${t}-thumb-motion-appear-active`]:{willChange:"transform, width",transition:["transform","width"].map(e=>`${e} ${r} ${a}`).join(", ")},[`&${t}-shape-round`]:{borderRadius:9999,[`${t}-item, ${t}-thumb`]:{borderRadius:9999}}}}})((0,x.oX)(e,{segmentedPaddingHorizontal:r(e.controlPaddingHorizontal).sub(t).equal(),segmentedPaddingHorizontalSM:r(e.controlPaddingHorizontalSM).sub(t).equal()}))},e=>{let{colorTextLabel:t,colorText:r,colorFillSecondary:a,colorBgElevated:n,colorFill:i,lineWidthBold:o,colorBgLayout:l}=e;return{trackPadding:o,trackBg:l,itemColor:t,itemHoverColor:r,itemHoverBg:a,itemSelectedBg:n,itemActiveBg:i,itemSelectedColor:r}}),B=a.forwardRef((e,t)=>{let r=(0,b.Bi)(),{prefixCls:n,className:i,rootClassName:o,block:l,options:d=[],size:s,style:h,vertical:m,orientation:u,shape:g="default",name:y=r,styles:S,classNames:H,...x}=e,{getPrefixCls:k,direction:M,className:E,style:B,classNames:R,styles:j}=(0,w.TP)("segmented"),N={...e,options:d,size:s,shape:g},P=(0,p.XT)(B),I=(0,p.XT)(h),[V,C]=(0,p.AV)([R,H],[j,P,S,I],{props:N}),L=k("segmented",n),[q,T]=O(L),W=(0,z.A)(s),X=a.useMemo(()=>d.map(e=>{if(function(e){return(0,$.Qd)(e)&&!!e?.icon}(e)){let{icon:t,label:r,...n}=e;return{...n,label:a.createElement(a.Fragment,null,a.createElement("span",{className:(0,c.$)(`${L}-item-icon`,V.icon),style:C.icon},t),r&&a.createElement("span",null,r))}}return e}),[d,L,V.icon,C.icon]),[,D]=(0,v.M)(u,m),F=(0,c.$)(i,o,E,V.root,{[`${L}-block`]:l,[`${L}-sm`]:"small"===W,[`${L}-lg`]:"large"===W,[`${L}-vertical`]:D,[`${L}-shape-${g}`]:"round"===g},q,T);return a.createElement(f,{...x,name:y,className:F,style:C.root,classNames:V,styles:C,itemRender:(e,{item:t})=>{if(!t.tooltip)return e;let r=(0,$.Qd)(t.tooltip)?t.tooltip:{title:t.tooltip};return a.createElement(A.A,{...r},e)},options:X,ref:t,prefixCls:L,direction:M,vertical:D})})},53707:(e,t)=>{t.A={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM653.3 424.6l52.2 52.2a8.01 8.01 0 01-4.7 13.6l-179.4 21c-5.1.6-9.5-3.7-8.9-8.9l21-179.4c.8-6.6 8.9-9.4 13.6-4.7l52.4 52.4 256.2-256.2c3.1-3.1 8.2-3.1 11.3 0l42.4 42.4c3.1 3.1 3.1 8.2 0 11.3L653.3 424.6z"}}]},name:"import",theme:"outlined"}},54746:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(97109),n=r(71242),i=r(88483);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,o({},e,{ref:t,icon:n.A})))},55122:(e,t,r)=>{r.d(t,{A:()=>b});var a=r(97109),n=r(3638),i=r(5045),o=r(92162),l=r(26047),c=r(74567),d=r(27273),s=r(15561),h=r(7961),m=r(10540),u=r(28403);let g=(0,m.OF)("Divider",e=>{let t=(0,u.oX)(e,{dividerHorizontalWithTextGutterMargin:e.margin,sizePaddingEdgeHorizontal:0});return[(e=>{let{componentCls:t,sizePaddingEdgeHorizontal:r,colorSplit:a,lineWidth:n,textPaddingInline:i,orientationMargin:o,verticalMarginInline:l}=e,c=`${t}-rail`;return{[t]:{...(0,h.dF)(e),borderBlockStart:`${(0,s.zA)(n)} solid ${a}`,[c]:{borderBlockStart:`${(0,s.zA)(n)} solid ${a}`},"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:l,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${(0,s.zA)(n)} solid ${a}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${(0,s.zA)(e.marginLG)} 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${(0,s.zA)(e.dividerHorizontalWithTextGutterMargin)} 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${a}`,[`${c}-start, ${c}-end`]:{width:"50%",borderBlockStartColor:"inherit",borderBlockEnd:0,content:"''"}},[`&-horizontal${t}-with-text-start`]:{[`${c}-start`]:{width:`calc(${o} * 100%)`},[`${c}-end`]:{width:`calc(100% - ${o} * 100%)`}},[`&-horizontal${t}-with-text-end`]:{[`${c}-start`]:{width:`calc(100% - ${o} * 100%)`},[`${c}-end`]:{width:`calc(${o} * 100%)`}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:i},"&-dashed":{background:"none",borderColor:a,borderStyle:"dashed",borderWidth:`${(0,s.zA)(n)} 0 0`,[c]:{borderBlockStart:`${(0,s.zA)(n)} dashed ${a}`}},[`&-horizontal${t}-with-text${t}-dashed`]:{[`${c}-start, ${c}-end`]:{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:n,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:a,borderStyle:"dotted",borderWidth:`${(0,s.zA)(n)} 0 0`,[c]:{borderBlockStart:`${(0,s.zA)(n)} dotted ${a}`}},[`&-horizontal${t}-with-text${t}-dotted`]:{"&::before, &::after":{borderStyle:"dotted none none"}},[`&-vertical${t}-dotted`]:{borderInlineStartWidth:n,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-start${t}-no-default-orientation-margin-start`]:{[`${c}-start`]:{width:0},[`${c}-end`]:{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:r}},[`&-horizontal${t}-with-text-end${t}-no-default-orientation-margin-end`]:{[`${c}-start`]:{width:"100%"},[`${c}-end`]:{width:0},[`${t}-inner-text`]:{paddingInlineEnd:r}}}}})(t),(e=>{let{componentCls:t}=e;return{[t]:{"&-horizontal":{[`&${t}`]:{"&-sm":{marginBlock:e.marginXS},"&-md":{marginBlock:e.margin}}}}}})(t)]},e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),{unitless:{orientationMargin:!0}}),f=["left","right","center","start","end"],b=e=>{let{getPrefixCls:t,direction:r,className:s,style:h,classNames:m,styles:u}=(0,c.TP)("divider"),{prefixCls:b,type:v,orientation:p,vertical:$,titlePlacement:w,orientationMargin:z,className:A,rootClassName:y,children:S,dashed:H,variant:x="solid",plain:k,style:M,size:E,classNames:O,styles:B,...R}=e,j=t("divider",b),N=`${j}-rail`,[P,I]=g(j),V=(0,d.A)(E),C=!!S,L=f.includes(p||""),q=a.useMemo(()=>{let e=w??(L?p:"center");return"left"===e?"rtl"===r?"end":"start":"right"===e?"rtl"===r?"start":"end":e},[r,p,w,L]),T="start"===q&&null!=z,W="end"===q&&null!=z,[X,D]=(0,i.M)(p,$,v),F={...e,orientation:X,titlePlacement:q,size:V},[G,K]=(0,o.AV)([m,O],[u,B],{props:F}),_=(0,n.$)(j,s,P,I,`${j}-${X}`,{[`${j}-with-text`]:C,[`${j}-with-text-${q}`]:C,[`${j}-dashed`]:!!H,[`${j}-${x}`]:"solid"!==x,[`${j}-plain`]:!!k,[`${j}-rtl`]:"rtl"===r,[`${j}-no-default-orientation-margin-start`]:T,[`${j}-no-default-orientation-margin-end`]:W,[`${j}-md`]:"medium"===V||"middle"===V,[`${j}-sm`]:"small"===V,[N]:!S,[G.rail]:G.rail&&!S},A,y,G.root),U=a.useMemo(()=>(0,l.Et)(z)?z:/^\d+$/.test(z)?Number(z):z,[z]);return a.createElement("div",{className:_,style:{...h,...K.root,...S?{}:K.rail,...M},...R,role:"separator"},S&&!D&&a.createElement(a.Fragment,null,a.createElement("div",{className:(0,n.$)(N,`${N}-start`,G.rail),style:K.rail}),a.createElement("span",{className:(0,n.$)(`${j}-inner-text`,G.content),style:{marginInlineStart:T?U:void 0,marginInlineEnd:W?U:void 0,...K.content}},S),a.createElement("div",{className:(0,n.$)(N,`${N}-end`,G.rail),style:K.rail})))}},71242:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"}},81668:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(97109),n=r(96724),i=r(88483);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,o({},e,{ref:t,icon:n.A})))},96091:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(97109),n=r(53707),i=r(88483);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let l=a.forwardRef((e,t)=>a.createElement(i.A,o({},e,{ref:t,icon:n.A})))},96724:(e,t)=>{t.A={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[788],{1611:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"}},2256:(e,t,a)=>{a.d(t,{A:()=>n});let n=a(25341).A},7225:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(97109),r=a(23830),c=a(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}let s=n.forwardRef((e,t)=>n.createElement(c.A,l({},e,{ref:t,icon:r.A})))},11100:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M567.1 512l318.5-319.3c5-5 1.5-13.7-5.6-13.7h-90.5c-2.1 0-4.2.8-5.6 2.3l-273.3 274-90.2-90.5c12.5-22.1 19.7-47.6 19.7-74.8 0-83.9-68.1-152-152-152s-152 68.1-152 152 68.1 152 152 152c27.7 0 53.6-7.4 75.9-20.3l90 90.3-90.1 90.3A151.04 151.04 0 00288 582c-83.9 0-152 68.1-152 152s68.1 152 152 152 152-68.1 152-152c0-27.2-7.2-52.7-19.7-74.8l90.2-90.5 273.3 274c1.5 1.5 3.5 2.3 5.6 2.3H880c7.1 0 10.7-8.6 5.6-13.7L567.1 512zM288 370c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80zm0 444c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"}}]},name:"scissor",theme:"outlined"}},14995:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"}},21247:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482.2 508.4L331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4a4.5 4.5 0 000-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4a4.52 4.52 0 000 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z"}}]},name:"merge-cells",theme:"outlined"}},23216:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(97109),r=a(29664),c=a(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}let s=n.forwardRef((e,t)=>n.createElement(c.A,l({},e,{ref:t,icon:r.A})))},23830:(e,t)=>{t.A={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"}},26619:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(97109),r=a(1611),c=a(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}let s=n.forwardRef((e,t)=>n.createElement(c.A,l({},e,{ref:t,icon:r.A})))},29664:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M908 640H804V488c0-4.4-3.6-8-8-8H548v-96h108c8.8 0 16-7.2 16-16V80c0-8.8-7.2-16-16-16H368c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h108v96H228c-4.4 0-8 3.6-8 8v152H116c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16H292v-88h440v88H620c-8.8 0-16 7.2-16 16v288c0 8.8 7.2 16 16 16h288c8.8 0 16-7.2 16-16V656c0-8.8-7.2-16-16-16zm-564 76v168H176V716h168zm84-408V140h168v168H428zm420 576H680V716h168v168z"}}]},name:"apartment",theme:"outlined"}},30960:(e,t)=>{t.A={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"}},35459:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(97109),r=a(98995),c=a(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}let s=n.forwardRef((e,t)=>n.createElement(c.A,l({},e,{ref:t,icon:r.A})))},38770:(e,t,a)=>{a.d(t,{A:()=>n});let n=a(51916).A},49484:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(97109),r=a(11100),c=a(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}let s=n.forwardRef((e,t)=>n.createElement(c.A,l({},e,{ref:t,icon:r.A})))},53234:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM496 208H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 544h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm328 244a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"hdd",theme:"outlined"}},54849:(e,t,a)=>{a.d(t,{A:()=>w});var n=a(97109),r=a(42644),c=a(52690),l=a(3638),s=a(92162),o=a(26047),i=a(74567),f=a(88762);let v=e=>{let t,{value:a,formatter:r,precision:c,decimalSeparator:l,groupSeparator:s="",prefixCls:i,className:f,style:v}=e;if((0,o.Tn)(r))t=r(a);else{let e=String(a),r=e.match(/^(-?)(\d*)(\.(\d+))?$/);if(r&&"-"!==e){let e=r[1],a=r[2]||"0",f=r[4]||"";a=a.replace(/\B(?=(\d{3})+(?!\d))/g,s),(0,o.Et)(c)&&(f=f.padEnd(c,"0").slice(0,c>0?c:0)),f&&(f=`${l}${f}`),t=[n.createElement("span",{key:"int",className:`${i}-content-value-int`},e,a),f&&n.createElement("span",{key:"decimal",className:`${i}-content-value-decimal`},f)]}else t=e}return n.createElement("span",{className:f,style:v},t)};var h=a(7961),d=a(10540),u=a(28403);let m=(0,d.OF)("Statistic",e=>(e=>{let{componentCls:t,marginXXS:a,padding:n,colorTextDescription:r,titleFontSize:c,colorTextHeading:l,contentFontSize:s,fontFamily:o}=e;return{[t]:{...(0,h.dF)(e),[`${t}-header`]:{paddingBottom:a,[`${t}-title`]:{color:r,fontSize:c}},[`${t}-skeleton`]:{paddingTop:n},[`${t}-content`]:{color:l,fontSize:s,fontFamily:o,[`${t}-content-value`]:{display:"inline-block",direction:"ltr"},[`${t}-content-prefix, ${t}-content-suffix`]:{display:"inline-block"},[`${t}-content-prefix`]:{marginInlineEnd:a},[`${t}-content-suffix`]:{marginInlineStart:a}}}}})((0,u.oX)(e,{})),e=>{let{fontSizeHeading3:t,fontSize:a}=e;return{titleFontSize:a,contentFontSize:t}}),p=n.forwardRef((e,t)=>{let{prefixCls:a,className:c,rootClassName:h,style:d,valueStyle:u,value:p=0,title:g,valueRender:b,prefix:A,suffix:H,loading:w=!1,formatter:y,precision:O,decimalSeparator:z=".",groupSeparator:V=",",onMouseEnter:E,onMouseLeave:$,styles:j,classNames:x,...M}=e,{getPrefixCls:N,direction:R,className:S,style:k,classNames:B,styles:P}=(0,i.TP)("statistic"),T=N("statistic",a),[C,I]=m(T),L={...e,decimalSeparator:z,groupSeparator:V,loading:w,value:p},D=(0,s.XT)(k),_=(0,s.XT)(d),[F,X]=(0,s.AV)([B,x],[P,D,j,_],{props:L}),q=(0,l.$)(T,{[`${T}-rtl`]:"rtl"===R},S,c,h,F.root,C,I),K=(0,l.$)(`${T}-header`,F.header),Y=(0,l.$)(`${T}-title`,F.title),G=(0,l.$)(`${T}-content`,F.content),J=(0,l.$)(`${T}-content-value`,F.value),Q=(0,l.$)(`${T}-content-prefix`,F.prefix),U=(0,l.$)(`${T}-content-suffix`,F.suffix),W=n.createElement(v,{decimalSeparator:z,groupSeparator:V,prefixCls:T,formatter:y,precision:O,value:p,className:J,style:X.value}),Z=n.useRef(null);n.useImperativeHandle(t,()=>({nativeElement:Z.current}));let ee=(0,r.KE)(M,{aria:!0,data:!0});return n.createElement("div",{...ee,className:q,style:X.root,ref:Z,onMouseEnter:E,onMouseLeave:$},g&&n.createElement("div",{className:K,style:X.header},n.createElement("div",{className:Y,style:X.title},g)),n.createElement(f.A,{paragraph:!1,loading:w,className:`${T}-skeleton`,active:!0},n.createElement("div",{className:G,style:{...u,...X.content}},A&&n.createElement("span",{className:Q,style:X.prefix},A),(0,o.Tn)(b)?b(W):W,H&&n.createElement("span",{className:U,style:X.suffix},H))))}),g=[["Y",31536e6],["M",2592e6],["D",864e5],["H",36e5],["m",6e4],["s",1e3],["S",1]],b=1e3/60,A=e=>{let{value:t,format:a="HH:mm:ss",onChange:l,onFinish:s,type:o,...i}=e,f="countdown"===o,[v,h]=n.useState(null),d=(0,r._q)(()=>{let e=Date.now(),a=new Date(t).getTime();h({});let n=f?a-e:e-a;return l?.(n),!f||!(a<e)||(s?.(),!1)});return n.useEffect(()=>{let e;return e=window.setInterval(()=>{d()||window.clearInterval(e)},b),()=>{window.clearInterval(e)}},[t,f]),n.useEffect(()=>{h({})},[]),n.createElement(p,{...i,value:t,valueRender:e=>(0,c.Ob)(e,{title:void 0}),formatter:(e,t)=>v?function(e,t,a){let{format:n=""}=t,r=new Date(e).getTime(),c=Date.now();return function(e,t){let a=e,n=/\[[^\]]*]/g,r=(t.match(n)||[]).map(e=>e.slice(1,-1)),c=t.replace(n,"[]"),l=g.reduce((e,[t,n])=>{if(e.includes(t)){let r=Math.floor(a/n);return a-=r*n,e.replace(RegExp(`${t}+`,"g"),e=>{let t=e.length;return r.toString().padStart(t,"0")})}return e},c),s=0;return l.replace(n,()=>{let e=r[s];return s+=1,e})}(a?Math.max(r-c,0):Math.max(c-r,0),n)}(e,{...t,format:a},f):"-"})},H=n.memo(e=>n.createElement(A,{...e,type:"countdown"}));p.Timer=A,p.Countdown=H;let w=p},56768:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(97109),r=a(30960),c=a(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}let s=n.forwardRef((e,t)=>n.createElement(c.A,l({},e,{ref:t,icon:r.A})))},63663:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(97109),r=a(21247),c=a(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}let s=n.forwardRef((e,t)=>n.createElement(c.A,l({},e,{ref:t,icon:r.A})))},93314:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(97109),r=a(53234),c=a(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}let s=n.forwardRef((e,t)=>n.createElement(c.A,l({},e,{ref:t,icon:r.A})))},98995:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M856 376H648V168c0-8.8-7.2-16-16-16H168c-8.8 0-16 7.2-16 16v464c0 8.8 7.2 16 16 16h208v208c0 8.8 7.2 16 16 16h464c8.8 0 16-7.2 16-16V392c0-8.8-7.2-16-16-16zm-480 16v188H220V220h360v156H392c-8.8 0-16 7.2-16 16zm204 52v136H444V444h136zm224 360H444V648h188c8.8 0 16-7.2 16-16V444h156v360z"}}]},name:"block",theme:"outlined"}},99811:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(97109),r=a(14995),c=a(88483);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e}).apply(this,arguments)}let s=n.forwardRef((e,t)=>n.createElement(c.A,l({},e,{ref:t,icon:r.A})))}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[298],{16403:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/documents",function(){return r(19562)}])},19562:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ed});var l=r(65321),s=r(97109),n=r(7576),a=r(35292),o=r(33442),i=r(11702),c=r(17807),d=r(63455),u=r(88762),p=r(85114),m=r(68787),h=r(84253),x=r(38332),g=r(26171),f=r(34052),v=r(42700),j=r(58569),y=r(2256),w=r(38770),A=r(76506),b=r(57271),S=r(49604),k=r(85493),I=r(23216),C=r(26619),T=r(8263),z=r(16285),R=r(8579),E=r(75548),B=r(7851),M=r(84742),N=r(29071),_=r(63552),F=r(26631),D=r(7225),P=r(83914),L=r(58209),W=r(54746),G=r(71330),O=r(64068),H=r(93051),q=r(38762),K=r(64629),V=r(67547),U=r(76830),X=r(1310),Q=r(6578),J=r(48321);let{TextArea:Y}=n.A,{Text:Z}=a.A;function $(e){let{type:t="info",title:r,children:s,style:n}=e,a="error"===t?"var(--colorError)":"warning"===t?"var(--colorWarning)":"success"===t?"var(--colorSuccess)":"var(--colorInfo)";return(0,l.jsxs)("div",{style:{border:"1px solid ".concat(a),background:"error"===t?"var(--colorErrorBg)":"warning"===t?"var(--colorWarningBg)":"success"===t?"var(--colorSuccessBg)":"var(--colorInfoBg)",borderRadius:8,padding:"9px 12px",...n},children:[(0,l.jsx)(Z,{strong:!0,style:{color:a},children:r}),s&&(0,l.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12},children:s})]})}function ee(e){let{children:t,gap:r=12,style:s}=e;return(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:r,...s},children:t})}let et=null;function er(){null==et||et.listeners.forEach(e=>e())}let el={role_binding:(0,l.jsx)(I.A,{}),knowledge_retrieval:(0,l.jsx)(C.A,{}),file_understanding:(0,l.jsx)(T.A,{}),fact_extraction:(0,l.jsx)(z.A,{}),chapter_generation:(0,l.jsx)(R.A,{}),asset_generation:(0,l.jsx)(E.A,{}),validation:(0,l.jsx)(B.A,{}),formatting:(0,l.jsx)(M.A,{}),llm_review:(0,l.jsx)(N.A,{}),export_ready:(0,l.jsx)(_.A,{}),reference:(0,l.jsx)(E.A,{})},es={施工组织设计:(0,l.jsx)(B.A,{}),投标文件:(0,l.jsx)(_.A,{}),技术方案:(0,l.jsx)(z.A,{}),报告:(0,l.jsx)(F.A,{}),自定义:(0,l.jsx)(R.A,{})};function en(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function ea(e){return e?e.split(/[\\/]/u).pop()||e:""}function eo(e){let t=[],r=e=>{for(let l of e)l.isFolder?l.children&&r(l.children):t.push(l.key)};return r(e),t}let ei={role_binding:"角色配置绑定",knowledge_retrieval:"知识库检索",file_understanding:"多模态文件理解",fact_extraction:"LLM 事实抽取",chapter_generation:"LLM 章节生成",asset_generation:"多模态资源生成",validation:"规则校验",formatting:"格式化排版",llm_review:"LLM 审查优化",export_ready:"导出就绪",reference:"参考资源处理"},ec={"knowledge-base":"知识库","document-readiness":"生成准备度检查","quality-repair":"质量补写","export-gate":"导出门禁","context-memory":"项目上下文","final-format":"正式排版","multimodal-files":"多模态文件理解",tender_announcement:"招标公告"};function ed(){var e,t,r,a,E;let ed=(0,J.Vr)(),{message:eu}=c.A.useApp(),[ep]=d.A.useForm(),em=(0,s.useRef)(null),[eh,ex]=(0,s.useState)([]),[eg,ef]=(0,s.useState)("construction-organization-design"),[ev,ej]=(0,s.useState)([]),[ey,ew]=(0,s.useState)([]),[eA,eb]=(0,s.useState)([]),[eS,ek]=(0,s.useState)([]),[eI,eC]=(0,s.useState)(!1),[eT,ez]=(0,s.useState)(""),[eR,eE]=(0,s.useState)(),[eB,eM]=(0,s.useState)([]),[eN,e_]=(0,s.useState)(!0),[eF,eD]=(0,s.useState)(!1),[eP,eL]=(0,s.useState)(null),[eW,eG]=(0,s.useState)(""),[eO,eH]=(0,s.useState)([]),[eq,eK]=(0,s.useState)(null),[eV,eU]=(0,s.useState)(null),[eX,eQ]=(0,s.useState)(""),[eJ,eY]=(0,s.useState)(!1),[eZ,e$]=(0,s.useState)("idle"),[e0,e1]=(0,s.useState)(null),[e2,e6]=(0,s.useState)(null),[e8,e4]=(0,s.useState)({start:0,end:0}),[e3,e5]=(0,s.useState)([]),[e7,e9]=(0,s.useState)(!1),[te,tt]=(0,s.useState)(!1),[tr,tl]=(0,s.useState)({}),ts=d.A.useWatch("projectRoleConfigId",ep),tn=(0,s.useMemo)(()=>ey.find(e=>e.id===ts),[ey,ts]),ta=(0,s.useMemo)(()=>new Set(((null==tn?void 0:tn.fileRoles)||[]).map(e=>e.roleId)),[tn]),to=(0,s.useMemo)(()=>ev.filter(e=>"file"===e.type&&(!ts||ta.has(e.id))).map(e=>({label:e.name,value:e.id})),[ev,ta,ts]),ti=(0,s.useMemo)(()=>to.find(e=>e.value===eR)||to[0],[eR,to]),tc=d.A.useWatch("fileBindingGroups",ep)||{},td=(0,s.useMemo)(()=>(function(e){let t={};for(let s of[...e].sort((e,t)=>e.relativePath.localeCompare(t.relativePath,"zh-CN"))){let e=s.relativePath.split("/").filter(Boolean),n="";for(let a=0;a<e.length;a++){let i=e[a],c=n;n=n?"".concat(n,"/").concat(i):i;let d=a===e.length-1;if(!t[n]){var r;t[n]={key:n,rawTitle:i,title:d?(0,l.jsx)("span",{title:s.relativePath,children:i}):(0,l.jsxs)(o.A,{size:4,children:[(0,l.jsx)(D.A,{style:{color:"#faad14"}}),(0,l.jsx)("span",{children:i})]}),isFolder:!d,fileCount:+!!d,...d?{}:{children:[]}},c&&(null==(r=t[c])?void 0:r.children)&&t[c].children.push(t[n])}d&&(t[n].fileCount=1)}}let s=e=>{for(let r of e){var t;(null==(t=r.children)?void 0:t.length)&&(s(r.children),r.fileCount=r.children.reduce((e,t)=>e+t.fileCount,0),r.title=(0,l.jsxs)(o.A,{size:4,children:[(0,l.jsx)(D.A,{style:{color:"#faad14"}}),(0,l.jsx)("span",{children:r.rawTitle}),(0,l.jsx)(i.A,{style:{margin:0},children:r.fileCount})]}))}},n=Object.values(t).filter(e=>!e.key.includes("/"));return s(n),n.filter(e=>!e.isFolder||e.fileCount>0)})(eS),[eS]),tu=(0,s.useMemo)(()=>(function e(t,r){let l=r.trim().toLowerCase();return l?t.flatMap(t=>{let r=t.children?e(t.children,l):void 0;return t.key.toLowerCase().includes(l)||t.rawTitle.toLowerCase().includes(l)||(null==r?void 0:r.length)?[{...t,children:r}]:[]}):t})(td,eT),[td,eT]),tp=(0,s.useMemo)(()=>eo(td),[td]),tm=(0,s.useMemo)(()=>{var e,t,r;return(null==(e=eA.find(e=>e.selected))?void 0:e.projectRoot)||(null==(t=eA.find(e=>e.isCurrent))?void 0:t.projectRoot)||(null==(r=eA[0])?void 0:r.projectRoot)||""},[eA]),th=(0,s.useMemo)(()=>{let e=[],t=r=>{for(let l of r)e.push(l.key),l.children&&t(l.children)};return t(td),e},[td]);(0,s.useEffect)(()=>{if(!te||!ts)return;let e=ep.getFieldValue("fileBindingGroups")||{},t=Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return ta.has(t)}));Object.keys(t).length!==Object.keys(e).length&&ep.setFieldValue("fileBindingGroups",t)},[ep,ta,ts,te]),(0,s.useEffect)(()=>{if(te){if(0===to.length)return void eE(void 0);eR&&to.some(e=>e.value===eR)||eE(to[0].value)}},[eR,to,te]);let[tx,tg]=(0,s.useState)([]),[tf,tv]=(0,s.useState)(null),[tj,ty]=(0,s.useState)(null),[tw,tA]=(0,s.useState)("templates"),[tb,tS]=(0,s.useState)(!1),[tk,tI]=(0,s.useState)("workflow"),tC=(0,s.useRef)(null),tT=(0,s.useRef)(null),tz=(0,s.useRef)(0),tR=(0,s.useMemo)(()=>"activeGenDocId:".concat(tm||"default"),[tm]),tE=async()=>{try{eH((await (0,Q.cQ)(tm||void 0)).documents)}catch(e){eH([])}};(0,s.useEffect)(()=>{let e=()=>{et&&(tg(et.flowSteps),tv(et.activeFlowKey),eD(et.loading),et.documentId&&eK(et.documentId),et.draft&&eL(et.draft),void 0!==et.content&&eG(et.content))},t=et;return null==t||t.listeners.add(e),e(),()=>{null==t||t.listeners.delete(e)}},[]),(0,s.useEffect)(()=>{e_(!0),Promise.all([(0,Q.Dl)().then(e=>{var t,r;ex(e.templates),ef(null!=(r=null==(t=e.templates[0])?void 0:t.id)?r:"construction-organization-design")}),(0,Q.lv)().then(e=>{ej(e.roles),ew(e.configs)}),(0,Q.dx)().then(e=>eb(e))]).catch(()=>eu.error(ed("common.error"))).finally(()=>e_(!1))},[eu,ed]),(0,s.useEffect)(()=>{tm&&(localStorage.removeItem("activeGenDocId"),tE())},[tm]),(0,s.useEffect)(()=>{if(0===eO.length)return;let e=localStorage.getItem(tR);if(!e)return;if(!eO.find(t=>t.id===e&&"generating"===t.status))return void localStorage.removeItem(tR);let t=setInterval(()=>{(async()=>{try{let{document:r}=await (0,Q.v7)(e,!1,tm||void 0);await tE(),"generating"!==r.status&&(localStorage.removeItem(tR),clearInterval(t))}catch(e){clearInterval(t)}})()},3e3);return()=>clearInterval(t)},[eO]);let tB=(0,s.useMemo)(()=>eh.find(e=>e.id===eg),[eh,eg]),tM=ey.map(e=>({label:e.name,value:e.id})),tN=Math.max(0,tx.findIndex(e=>e.key===tf)),t_=e=>{var t;return e?(null==(t=ev.find(t=>t.id===e))?void 0:t.name)||ec[e]||"未知角色":""},tF=e=>e.subtitle||e.roleName||t_(e.roleId)||ei[e.type]||e.type,tD=e=>{var t,r,l;return e.promptName||((t=e.promptId)?(null==(r=eA.find(e=>e.id===t))?void 0:r.projectName)||(null==(l=ev.find(e=>e.id===t))?void 0:l.name)||ec[t]||"未知提示词":"")},tP=()=>{tz.current+=1,eQ(""),e1(null),e6(null),e5([]),e9(!1),eY(!1),e$("idle")},tL=e=>{ef(e),eK(null),eL(null),eG(""),tP(),tI("workflow"),tS(!0),tA("drafts")},tW=async e=>{eK(e.id),ef(e.templateId);let t=tG(e.status);if(t||"failed"===e.status||"aborted"===e.status){tP(),ty(e),eL(null),eG(""),eD(t),tI("workflow"),tS(!0);try{let{document:t}=await (0,Q.v7)(e.id,!1,e.projectRoot||tm||void 0);tq(t),tG(t.status)?tK(t.id,t.projectRoot||e.projectRoot||tm||void 0):await tE()}catch(t){tq(e)}return}tI("editor"),tg([]),tv(null),tP();try{let{document:t}=await (0,Q.v7)(e.id,!1,e.projectRoot||tm||void 0);eL(t.draft||null),eG(t.editedMarkdown||t.markdown)}catch(e){eu.error(ed("common.error"))}tS(!0)},tG=e=>"completed"!==e&&"warning"!==e&&"failed"!==e&&"aborted"!==e,tO=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eF;(null==et?void 0:et.loading)&&(et.flowSteps=e,et.activeFlowKey=t,et.loading=r,er())},tH=e=>{var t,r,s,n,a;let o=e.executionStages||(null==(t=e.draft)?void 0:t.executionStages)||[];if(o.length>0){let t=o.map((t,r)=>{var s;let n,a=("failed"===e.status||"aborted"===e.status)&&"running"===t.status||"failed"===(n=t.status)?"error":"running"===n?"process":"fallback"===n?"warning":"finish";return{key:"".concat(t.type,"-").concat(r),title:t.title||ei[t.type]||t.type,subtitle:tF(t),description:t.message||"",status:a,icon:"role_binding"===(s=t.type)?(0,l.jsx)(I.A,{}):"knowledge_retrieval"===s?(0,l.jsx)(C.A,{}):"file_understanding"===s?(0,l.jsx)(T.A,{}):"fact_extraction"===s?(0,l.jsx)(z.A,{}):"chapter_generation"===s?(0,l.jsx)(R.A,{}):"llm_review"===s?(0,l.jsx)(N.A,{}):"validation"===s?(0,l.jsx)(B.A,{}):"formatting"===s?(0,l.jsx)(M.A,{}):"export_ready"===s?(0,l.jsx)(_.A,{}):(0,l.jsx)(F.A,{}),subSteps:((e,t,r)=>{let l=Array.isArray(e.details)?e.details.filter(Boolean):[],s=e.progress?"".concat(e.progress.label||"进度",":").concat(e.progress.current,"/").concat(e.progress.total):"",n=[...s?[s]:[],...l];return 0===n.length?[{key:"stage-".concat(r),title:tD(e)?"提示词:".concat(tD(e)):tF(e),status:t}]:n.slice(0,8).map((e,l)=>({key:"stage-".concat(r,"-").concat(l),title:e,status:"process"===t&&0===l?"process":"error"===t&&0===l?"error":"warning"===t?"warning":"process"===t?"finish":t}))})(t,a,r)}});"generating"===e.status&&t.length>0&&(null==(r=t.at(-1))?void 0:r.status)==="finish"&&(t[t.length-1]={...t[t.length-1],status:"process"});let i="generating"===e.status?(null==(s=t.at(-1))?void 0:s.key)||"prepare":"failed"===e.status||"aborted"===e.status?(null==(n=t.find(e=>"error"===e.status))?void 0:n.key)||(null==(a=t.at(-1))?void 0:a.key)||"prepare":"done";return{steps:t,activeKey:i}}return{steps:[],activeKey:null}},tq=e=>{ty(e);let{steps:t,activeKey:r}=tH(e);tg(t),tv(r),eD(tG(e.status)),tO(t,r,tG(e.status)),("failed"===e.status||"aborted"===e.status)&&tI("workflow"),("completed"===e.status||"warning"===e.status)&&e.draft&&(eL(e.draft),eG(e.editedMarkdown||e.markdown),tI("editor"),tg([]),tv(null))},tK=(e,t)=>{tC.current&&clearInterval(tC.current),tC.current=setInterval(()=>{(async()=>{try{let{document:r}=await (0,Q.v7)(e,!0,t||tm||void 0);tq(r),await tE(),tG(r.status)||(tC.current&&clearInterval(tC.current),tC.current=null,localStorage.removeItem(tR))}catch(e){}})()},2e3)};(0,s.useEffect)(()=>()=>{tC.current&&(clearInterval(tC.current),tC.current=null),tT.current&&(clearTimeout(tT.current),tT.current=null)},[]),(0,s.useEffect)(()=>{if(!eF||!tf)return;let e=window.setInterval(()=>tg(e=>{let t=e.map(e=>{if(e.key!==tf||"process"!==e.status)return e;let t=e.subSteps.findIndex(e=>"process"===e.status),r=t<0?0:Math.min(t+1,e.subSteps.length-1);return{...e,subSteps:e.subSteps.map((e,t)=>t<r?{...e,status:"finish"}:t===r?{...e,status:"process"}:{...e,status:"wait"})}});return tO(t,tf),t}),1400);return()=>window.clearInterval(e)},[tf,eF]);let tV=async()=>{eC(!0);try{let e=await (0,Q.HT)({limit:5e3,projectRoot:tm||void 0});ek(e.files)}catch(e){eu.error("知识库文件加载失败")}finally{eC(!1)}},tU=e=>{var t,r,l;let s=null!=e?e:{id:"tpl-".concat(Date.now()),name:"",description:"",category:"自定义",outputTitle:"",projectRoleConfigId:void 0,chapters:[],fileBindings:[]};ep.resetFields(),ep.setFieldsValue({...s,fileBindingGroups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((e,t)=>(t.roleId&&t.filePath&&(e[t.roleId]=en([...e[t.roleId]||[],t.filePath])),e),{})}(s.fileBindings)}),eE(null==(l=ey.find(e=>e.id===s.projectRoleConfigId))||null==(r=l.fileRoles)||null==(t=r[0])?void 0:t.roleId),ez(""),tV(),tt(!0)},tX=(e,t)=>{let r=ep.getFieldValue("fileBindingGroups")||{};ep.setFieldValue("fileBindingGroups",{...r,[e]:en(t)})},tQ=async()=>{try{var e;await ep.validateFields();let t=ep.getFieldsValue(!0),r=new Set(((null==(e=ey.find(e=>e.id===t.projectRoleConfigId))?void 0:e.fileRoles)||[]).map(e=>e.roleId)),l=t.fileBindingGroups||{},s=Object.entries(l).filter(e=>{let[t]=e;return 0===r.size||r.has(t)}).flatMap(e=>{let[t,r]=e;return en(r||[]).map(e=>({roleId:t,filePath:e}))}),{fileBindingGroups:n,...a}=t,o={...a,chapters:[],fileBindings:s},i=await (0,Q.l2)(o);ex(i.templates),ef(i.template.id),tt(!1),await tE(),eu.success(ed("common.success"))}catch(e){e instanceof Error&&eu.error(e.message)}},tJ=async e=>{try{let t=await (0,Q.bV)(e);ex(t.templates),ef(t.template.id),eu.success(ed("common.success"))}catch(e){eu.error(ed("common.error"))}},tY=async e=>{try{var t,r;let l=await (0,Q.h0)(e);ex(l.templates),ef(null!=(r=null==(t=l.templates[0])?void 0:t.id)?r:""),eu.success(ed("common.success"))}catch(e){eu.error(ed("common.error"))}},tZ=async e=>{try{let{validation:t}=await (0,Q.SM)(e,tm||void 0);tl(r=>({...r,[e]:t}));let r=t.issues.filter(e=>"error"===e.level);if(ef(e),r.length>0)return void eu.warning("模板运行前检查未通过,请先处理阻断项");if(t.issues.length>0)return void eu.warning("模板存在警告,可在检查面板确认后继续运行");tL(e)}catch(e){eu.error(e instanceof Error?e.message:"模板运行前检查失败")}},t$=async e=>{try{await (0,Q.QG)(e.id,e.projectRoot||tm||void 0),eq===e.id&&(eK(null),eL(null),eG("")),await tE(),eu.success(ed("common.success"))}catch(e){eu.error(ed("common.error"))}},t0=async(e,t)=>{let r=Date.now(),l=0,s=Date.now();for(;;){let n;if(null==t?void 0:t.aborted)throw Error("用户中止");let a=new AbortController;t&&(t.pollController=a);try{({document:n}=await (0,Q.v7)(e,!0,tm||void 0,a.signal))}finally{(null==t?void 0:t.pollController)===a&&(t.pollController=void 0)}if(tq(n),n.updatedAt!==l&&(l=n.updatedAt,s=Date.now()),("completed"===n.status||"warning"===n.status)&&n.draft)return n;if("failed"===n.status||"aborted"===n.status)throw Error(n.error||("aborted"===n.status?"生成已中止":"生成失败"));if(Date.now()-r>75e5||Date.now()-s>96e4)throw Error("生成任务疑似卡住,请点击继续生成或重新生成");await new Promise(e=>window.setTimeout(e,1500))}},t1=async()=>{if(!eg)return;if((null==et?void 0:et.aborted)&&(et=null),null==et?void 0:et.loading){tg(et.flowSteps),tv(et.activeFlowKey),eD(!0);return}if(!tm)return void eu.error("未识别当前项目,请先选择或打开项目后再生成文件");eD(!0);let e=(0,Q.OX)({templateId:eg,projectRoot:tm});et={id:Date.now(),templateId:eg,loading:!0,flowSteps:[],activeFlowKey:null,promise:e,listeners:new Set},tg([]),tv(null);let t=[];try{let r=await e;r.documentId&&(localStorage.setItem(tR,r.documentId),eK(r.documentId),(null==et?void 0:et.promise)===e&&(et.documentId=r.documentId)),await tE();let l=r.documentId?await t0(r.documentId,(null==et?void 0:et.promise)===e?et:void 0):void 0,s=r.draft||(null==l?void 0:l.draft);if(!s)throw Error("生成结果为空");(r.documentId||(null==l?void 0:l.id))&&eK(r.documentId||l.id),t.forEach(e=>window.clearTimeout(e)),eL(s),eG((null==l?void 0:l.editedMarkdown)||(null==l?void 0:l.markdown)||s.markdown),(null==et?void 0:et.promise)===e&&(et.draft=s,et.content=(null==l?void 0:l.editedMarkdown)||(null==l?void 0:l.markdown)||s.markdown);let n=l||{id:r.documentId||"draft-".concat(Date.now()),templateId:eg,title:s.title,requirement:s.requirement,projectRoot:s.projectRoot||tm,projectId:s.projectId,markdown:s.markdown,status:s.validationIssues.some(e=>"error"===e.level||"warning"===e.level)||!s.exportGate.passed?"warning":"completed",draft:s,executionStages:s.executionStages,assets:s.assets||[],createdAt:s.generatedAt,updatedAt:Date.now()},{steps:a}=tH(n);tg(a),tO(a,"done",!1),tv("done"),(null==et?void 0:et.promise)===e&&(et.activeFlowKey="done",et.loading=!1,er(),et=null),localStorage.removeItem(tR),await tE(),eu.success(ed("common.success")),window.setTimeout(()=>{var e;return null==(e=em.current)?void 0:e.scrollIntoView({behavior:"smooth",block:"start"})},200)}catch(l){localStorage.removeItem(tR);let t=l instanceof Error?l.message:ed("common.error"),r=/用户中止|abort|aborted/i.test(t);r||tg(e=>{let r=e.map(e=>"process"===e.status?{...e,status:"error",description:t,subSteps:((e,t)=>{if("wait"===t)return e.subSteps.map(e=>({...e,status:"wait"}));if("finish"===t)return e.subSteps.map(e=>({...e,status:"finish"}));if("error"===t)return e.subSteps.map((e,t)=>({...e,status:0===t?"error":e.status}));let r=e.subSteps.findIndex(e=>"wait"===e.status);return e.subSteps.map((e,t)=>t<r||-1===r?{...e,status:"finish"}:t===r?{...e,status:"process"}:e)})(e,"error")}:e);return tO(r,tf,!1),r}),(null==et?void 0:et.promise)===e&&(et.loading=!1,et.error=t,er(),et=null),await tE().catch(()=>void 0),r||eu.error(t)}finally{t.forEach(e=>window.clearTimeout(e)),eD(!1),(null==et?void 0:et.promise)===e&&(et.loading=!1,er())}},t2=(0,s.useRef)(!1);(0,s.useEffect)(()=>(tT.current&&(clearTimeout(tT.current),tT.current=null),!tb||"workflow"!==tk||eq||t2.current||(null==et?void 0:et.loading)||null==tB||!tB.projectRoleConfigId||(t2.current=!0,tT.current=setTimeout(()=>{tT.current=null,tb&&"workflow"===tk&&!eq&&eg==eg&&t1()},300)),tb||(t2.current=!1),()=>{tT.current&&(clearTimeout(tT.current),tT.current=null)}),[tb,tk,eq,tB,eg]);let t6=async e=>{try{eK(e.id),ef(e.templateId),tI("workflow"),tS(!0),eD(!0);let t=await (0,Q.UQ)(e.id,e.projectRoot||tm||void 0);localStorage.setItem(tR,t.documentId),await tE();let r=await t0(t.documentId);r.draft&&(eL(r.draft),eG(r.editedMarkdown||r.markdown||r.draft.markdown),tI("editor")),localStorage.removeItem(tR),await tE(),eu.success("已继续生成并完成")}catch(e){eu.error(e instanceof Error?e.message:"继续生成失败")}finally{eD(!1)}},t8=async e=>{if((null==et?void 0:et.loading)&&et.documentId===e.id){var t;et.aborted=!0,null==(t=et.pollController)||t.abort(),et.loading=!1,et.error="用户中止",er(),et=null,eD(!1)}localStorage.removeItem(tR),tC.current&&(clearInterval(tC.current),tC.current=null);try{await (0,Q.r)(e.id,e.projectRoot||tm||void 0),eu.success("已中止生成任务")}catch(e){eu.info("任务已不在运行,已刷新状态")}finally{await tE(),eq===e.id&&(eK(null),ty(null),eL(null),eG(""))}},t4=async e=>{if(eP){eU(e);try{eP.exportGate.passed||eu.warning("导出门禁存在风险项,已允许导出,请下载后人工复核。");let t={documentId:eq||void 0,title:eP.title,markdown:eW,format:e,enforceGate:!1,exportGate:eP.exportGate,useClientMarkdown:!0,projectRoot:eP.projectRoot||tm||void 0},r=await (0,Q.UE)(t);((e,t,r)=>{let l=new Blob([e],{type:r}),s=URL.createObjectURL(l),n=document.createElement("a");n.href=s,n.download=t,n.target="_self",n.rel="noopener",n.style.display="none",document.body.appendChild(n),n.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),n.remove(),window.setTimeout(()=>URL.revokeObjectURL(s),1e3)})(r,"".concat(eP.title,".").concat("markdown"===e?"md":e),{markdown:"text/markdown;charset=utf-8",html:"text/html;charset=utf-8",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}[e])}catch(e){eu.error(e instanceof Error?e.message:ed("common.error"))}finally{eU(null)}}},t3=async()=>{if(eP)try{if(eq)await (0,Q.a6)(eq,{editedMarkdown:eW,markdown:eW},eP.projectRoot||tm||void 0);else{let e=await (0,Q.Af)({...eP,markdown:eW});eL(e.draft)}await tE(),eu.success(ed("common.success"))}catch(e){eu.error(ed("common.error"))}},t5=(e,t)=>{e5(r=>[{id:"".concat(Date.now()),content:e,prompt:t,createdAt:Date.now()},...r].slice(0,12))},t7=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&eQ(""),e1(null),e6(null),e4({start:0,end:0})},t9=(e,t)=>{var r,l;return{title:(null==eP?void 0:eP.title)||"未命名文档",markdown:t,instruction:e,facts:null==eP||null==(r=eP.structuredFacts)?void 0:r.map(e=>"".concat(e.key,": ").concat(e.value)),chapters:null==eP||null==(l=eP.chapters)?void 0:l.map(e=>e.title),...(()=>{let e=e8.start,t=e8.end;return t>e?{selection:{start:e,end:t,text:eW.slice(e,t)},cursorOffset:e}:{cursorOffset:e}})()}},re=async()=>{let e=eX.trim();if(!eP||!e||eJ)return;let t=tz.current+1;tz.current=t,eY(!0),e$("planning"),e6(null);try{let r=await (0,Q.Gi)({mode:"plan",...t9(e,eW)});if(tz.current!==t||eq!=eq)return;if(!r.plan)throw Error("AI 未返回修改计划");e1(r.plan)}catch(e){tz.current===t&&eu.error(e instanceof Error?e.message:ed("common.error"))}finally{tz.current===t&&(eY(!1),e$("idle"))}},rt=async e=>{let t=eX.trim();if(!eP||!t||eJ)return;let r=tz.current+1;tz.current=r,eY(!0),e$("applying");try{let l=await (0,Q.Gi)({mode:"apply",...t9(t,eW),plan:e});if(tz.current!==r||eq!=eq)return;if(!l.markdown)throw Error("AI 未返回修改结果");e6({plan:l.plan||e,markdown:l.markdown,beforeSnippet:l.beforeSnippet,afterSnippet:l.afterSnippet,summary:l.summary,changedChars:l.changedChars,prompt:t,before:eW})}catch(e){tz.current===r&&eu.error(e instanceof Error?e.message:ed("common.error"))}finally{tz.current===r&&(eY(!1),e$("idle"))}};if(eN)return(0,l.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,l.jsx)(u.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,l.jsx)(u.A,{active:!0,paragraph:{rows:2}}),(0,l.jsx)(u.A,{active:!0,paragraph:{rows:8}})]});let rr="workflow"===tk?"工作流:".concat((null==tB?void 0:tB.name)||"选择模板"):"编辑:".concat((null==eP?void 0:eP.title)||(null==tB?void 0:tB.outputTitle)||"文档");return(0,l.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"pageTitle",children:ed("documents.title")}),(0,l.jsx)("p",{className:"pageDesc",children:ed("documents.description")})]}),(0,l.jsx)(p.Ay,{type:"primary",icon:(0,l.jsx)(W.A,{}),onClick:()=>tU(),children:ed("documents.newTemplate")})]}),(0,l.jsx)(m.A,{size:"small",tabList:[{key:"templates",label:"模板库 (".concat(eh.length,")")},{key:"drafts",label:"生成记录 (".concat(eO.length,")")}],activeTabKey:tw,onTabChange:tA,children:"templates"===tw?0===eh.length?(0,l.jsx)(h.A,{description:ed("common.noData")}):(0,l.jsx)(x.A,{dataSource:eh,renderItem:e=>{var t,r;return(0,l.jsx)(x.A.Item,{style:{cursor:"pointer",padding:"10px 0"},actions:[(0,l.jsx)(p.Ay,{size:"small",icon:(0,l.jsx)(G.A,{}),onClick:t=>{t.stopPropagation(),tU(e)},children:"配置"},"cfg"),(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:(0,l.jsx)(O.A,{}),onClick:t=>{t.stopPropagation(),tZ(e.id)},children:"运行"},"run"),(0,l.jsx)(p.Ay,{size:"small",icon:(0,l.jsx)(H.A,{}),onClick:t=>{t.stopPropagation(),tJ(e.id)}},"copy"),(0,l.jsx)(g.A,{title:ed("documents.deleteTemplateConfirm"),onConfirm:t=>{null==t||t.stopPropagation(),tY(e.id)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,icon:(0,l.jsx)(L.A,{}),onClick:e=>e.stopPropagation()})},"del")],onClick:()=>ef(e.id),children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10,minWidth:0,flex:1},children:[function(e,t){let r=es[e]||(0,l.jsx)(F.A,{});return(0,l.jsx)("span",{style:{color:t?"var(--colorAccent)":"var(--colorTextSecondary)",fontSize:16,marginTop:2,flexShrink:0},children:r})}(e.category,eg===e.id),(0,l.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:2},children:[(0,l.jsx)("span",{style:{fontWeight:eg===e.id?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),eg===e.id&&(0,l.jsx)(i.A,{color:"blue",style:{margin:0,fontSize:10,lineHeight:"16px",flexShrink:0},children:"当前"}),(0,l.jsx)(i.A,{style:{margin:0,fontSize:10,lineHeight:"16px",flexShrink:0},children:e.category}),tr[e.id]&&(0,l.jsxs)(i.A,{color:tr[e.id].issues.some(e=>"error"===e.level)?"error":tr[e.id].issues.length?"warning":"success",style:{margin:0,fontSize:10,lineHeight:"16px",flexShrink:0},children:["检查 ",tr[e.id].fileDiagnostics.length," 文件 / ",tr[e.id].promptDiagnostics.length," 提示词"]})]}),e.description&&(0,l.jsx)(Z,{type:"secondary",style:{fontSize:12,lineHeight:"18px"},children:e.description}),tr[e.id]&&(0,l.jsx)("div",{onClick:e=>e.stopPropagation(),style:{marginTop:8,padding:10,border:"1px solid ".concat(tr[e.id].issues.some(e=>"error"===e.level)?"var(--colorErrorBorder)":tr[e.id].issues.length?"var(--colorWarningBorder)":"var(--colorSuccessBorder)"),borderRadius:10,background:tr[e.id].issues.some(e=>"error"===e.level)?"var(--colorErrorBg)":tr[e.id].issues.length?"var(--colorWarningBg)":"var(--colorSuccessBg)"},children:(0,l.jsxs)(ee,{gap:6,style:{width:"100%"},children:[(0,l.jsxs)(o.A,{wrap:!0,children:[(0,l.jsx)(Z,{strong:!0,children:tr[e.id].issues.some(e=>"error"===e.level)?"运行前检查未通过":tr[e.id].issues.length?"运行前检查存在警告":"运行前检查通过"}),(0,l.jsxs)(i.A,{color:"blue",children:["文件角色 ",tr[e.id].fileDiagnostics.length]}),(0,l.jsxs)(i.A,{color:"purple",children:["提示词角色 ",tr[e.id].promptDiagnostics.length]}),tr[e.id].readiness&&(0,l.jsxs)(i.A,{color:tr[e.id].readiness.ready?"green":"error",children:["资料覆盖 ",Math.round(100*tr[e.id].readiness.materialCoverageRate),"%"]}),tr[e.id].readiness&&(0,l.jsxs)(i.A,{color:"cyan",children:["角色满足 ",Math.round(100*tr[e.id].readiness.roleSatisfactionRate),"%"]}),tr[e.id].readiness&&(0,l.jsxs)(i.A,{color:"geekblue",children:["规范完整 ",Math.round(100*tr[e.id].readiness.specCompletenessRate),"%"]})]}),null==(r=tr[e.id].readiness)||null==(t=r.chapterDiagnostics)?void 0:t.filter(e=>e.readinessRate<.7||e.missingFacts.length>0).slice(0,5).map(e=>(0,l.jsx)($,{type:e.readinessRate<.5?"warning":"info",title:"章节预检:".concat(e.title," \xb7 覆盖 ").concat(Math.round(100*e.readinessRate),"% \xb7 证据 ").concat(e.evidenceCount," 条").concat(e.missingFacts.length?" \xb7 缺失 ".concat(e.missingFacts.slice(0,4).join("、")):"")},e.chapterId)),tr[e.id].issues.length>0?tr[e.id].issues.map(e=>(0,l.jsx)($,{type:"error"===e.level?"error":"warning",title:e.message},e.message)):(0,l.jsx)($,{type:"success",title:"文件角色、提示词角色和后台自动规范检查通过,可以运行。"}),!tr[e.id].issues.some(e=>"error"===e.level)&&tr[e.id].issues.length>0&&(0,l.jsx)("div",{children:(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:(0,l.jsx)(O.A,{}),onClick:()=>tL(e.id),children:"忽略警告并继续运行"})})]})})]})]})})}}):0===eO.length?(0,l.jsx)(h.A,{description:ed("common.noData")}):(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:eO.slice(0,15).map((e,t)=>{var r,s,n,a,c;let d,u;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10,padding:"10px 12px",border:"1px solid var(--colorBorderSecondary)",borderRadius:10,cursor:"pointer",background:eq===e.id?"var(--colorFillAlter)":void 0,minWidth:0},onClick:()=>{tW(e)},children:["completed"===e.status?(0,l.jsx)(M.A,{style:{fontSize:18,color:"var(--colorOk)",flexShrink:0,marginTop:2}}):"failed"===e.status||"aborted"===e.status?(0,l.jsx)(q.A,{style:{fontSize:18,color:"var(--colorDanger)",flexShrink:0,marginTop:2}}):"warning"===e.status?(0,l.jsx)(B.A,{style:{fontSize:18,color:"var(--colorWarning)",flexShrink:0,marginTop:2}}):(0,l.jsx)(K.A,{spin:!0,style:{fontSize:18,color:"#1677ff",flexShrink:0,marginTop:2}}),(0,l.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,l.jsx)("div",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginBottom:3},children:e.title}),(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px 10px",color:"var(--colorTextSecondary)",fontSize:11},children:[(0,l.jsx)("span",{children:new Date(e.updatedAt).toLocaleString()}),(0,l.jsxs)("span",{children:["耗时 ",(e=>{let t=Math.max(0,Math.round(((e.completedAt||e.updatedAt)-e.createdAt)/1e3));if(t<60)return"".concat(t," 秒");let r=Math.floor(t/60),l=t%60;if(r<60)return l?"".concat(r," 分 ").concat(l," 秒"):"".concat(r," 分");let s=Math.floor(r/60),n=r%60;return n?"".concat(s," 小时 ").concat(n," 分"):"".concat(s," 小时")})(e)]})]}),e.partialChapters&&e.partialChapters.length>0&&(0,l.jsxs)("div",{style:{marginTop:3,fontSize:11,color:"var(--colorTextSecondary)"},children:["已完成章节 ",e.partialChapters.filter(e=>"completed"===e.status).length,"/",e.partialChapters.length," \xb7 ",e.partialChapters.reduce((e,t)=>e+t.chars,0).toLocaleString()," 字"]}),("warning"===e.status||"failed"===e.status||"aborted"===e.status)&&(0,l.jsx)("div",{style:{marginTop:3,color:"failed"===e.status||"aborted"===e.status?"var(--colorError)":"var(--colorWarning)",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.error||(null==(r=e.warningIssues)?void 0:r[0])||(null==(n=e.draft)||null==(s=n.validationIssues.find(e=>"error"===e.level||"warning"===e.level))?void 0:s.message)||"需复核"})]}),(0,l.jsxs)(o.A,{size:4,align:"center",children:[(0,l.jsx)(i.A,{color:"completed"===(d=e.status)?"success":"warning"===d?"warning":"failed"===d?"error":"aborted"===d?"default":"processing",style:{margin:0,fontSize:10,lineHeight:"18px"},children:"completed"===(u=e.status)?"已完成":"warning"===u?"需复核":"failed"===u?"失败":"aborted"===u?"已中止":"生成中"}),(0,l.jsxs)(i.A,{style:{margin:0,fontSize:10,lineHeight:"18px"},children:["#",t+1]}),(0,l.jsx)(g.A,{title:"确认删除?",onConfirm:t=>{null==t||t.stopPropagation(),t$(e)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,icon:(0,l.jsx)(L.A,{}),onClick:e=>e.stopPropagation()})}),tG(e.status)&&(0,l.jsx)(g.A,{title:"确定中止此生成任务?",onConfirm:t=>{null==t||t.stopPropagation(),t8(e)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,onClick:e=>e.stopPropagation(),children:"中止"})}),("failed"===e.status||"aborted"===e.status||"warning"===e.status&&!!(null==(a=e.checkpointChapters)?void 0:a.length)&&/继续生成|重新生成|中断|卡住|未完成/u.test(e.error||(null==(c=e.warningIssues)?void 0:c.join(";"))||""))&&(0,l.jsx)(p.Ay,{size:"small",onClick:t=>{t.stopPropagation(),t6(e)},children:"继续"}),(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:tG(e.status)?(0,l.jsx)(K.A,{spin:!0}):(0,l.jsx)(O.A,{}),onClick:t=>{t.stopPropagation(),tW(e)},children:"打开"})]})]},e.id)})})}),(0,l.jsx)(f.A,{title:rr,open:tb,onClose:()=>{tS(!1),tC.current&&(clearInterval(tC.current),tC.current=null)},size:800,mask:{closable:!1},style:{borderRadius:"12px 0 0 12px"},styles:{body:{padding:"16px 24px"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:eP?(0,l.jsxs)(o.A,{wrap:!0,children:[(0,l.jsx)(p.Ay,{icon:(0,l.jsx)(V.A,{}),disabled:eJ,onClick:()=>{t3()},children:ed("documents.saveDraft")}),(0,l.jsx)(p.Ay,{icon:(0,l.jsx)(U.A,{}),disabled:eJ,loading:"markdown"===eV,onClick:()=>{t4("markdown")},children:"MD"}),(0,l.jsx)(p.Ay,{disabled:eJ,loading:"html"===eV,onClick:()=>{t4("html")},children:"HTML"}),(0,l.jsx)(p.Ay,{disabled:eJ,loading:"docx"===eV,onClick:()=>{t4("docx")},children:"DOCX"}),(0,l.jsx)(p.Ay,{type:"primary",disabled:eJ,loading:"pdf"===eV,onClick:()=>{t4("pdf")},children:"PDF"})]}):eF&&"workflow"===tk?(0,l.jsx)(p.Ay,{danger:!0,onClick:()=>{(async()=>{if(eq&&await (0,Q.r)(eq,tm||void 0).catch(()=>void 0),et){var e;et.aborted=!0,null==(e=et.pollController)||e.abort(),et.loading=!1,et.error="用户中止",er(),et=null}localStorage.removeItem(tR),tC.current&&(clearInterval(tC.current),tC.current=null),eD(!1),tg([]),tv(null),tS(!1),await tE(),eu.info("已中止生成任务")})()},children:"中止任务"}):void 0,children:(0,l.jsxs)(ee,{style:{width:"100%"},gap:16,children:["workflow"===tk&&tx.length>0&&(0,l.jsx)(ee,{gap:10,children:tx.map((e,t)=>{let r;return(0,l.jsxs)("div",{style:{display:"flex",gap:10,padding:10,border:"1px solid var(--colorBorderSecondary)",borderRadius:10,background:t===tN?"var(--colorFillAlter)":"var(--colorBgContainer)"},children:[(0,l.jsx)("span",{children:"process"===e.status?(0,l.jsx)(P.A,{}):"warning"===e.status?(0,l.jsx)(B.A,{style:{color:"var(--colorWarning)"}}):e.icon}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsxs)(o.A,{wrap:!0,children:[(0,l.jsx)(Z,{strong:!0,children:e.title}),(0,l.jsx)(i.A,{color:"finish"===e.status?"success":"error"===e.status?"error":"warning"===e.status?"warning":"process"===e.status?"processing":"default",children:"warning"===(r=e.status)?"finish":r})]}),(0,l.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12,whiteSpace:"pre-wrap"},children:(0,l.jsxs)("div",{children:[e.subtitle&&(0,l.jsx)("div",{style:{marginBottom:4},children:(0,l.jsx)(i.A,{children:e.subtitle})}),(0,l.jsx)("div",{children:e.description}),(0,l.jsx)("div",{style:{marginTop:4},children:e.subSteps.map(e=>{var t;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"process"===e.status?"var(--colorPrimary)":"var(--colorTextSecondary)"},children:["process"===(t=e.status)?(0,l.jsx)(P.A,{}):"finish"===t?(0,l.jsx)(M.A,{}):"warning"===t?(0,l.jsx)(B.A,{style:{color:"var(--colorWarning)"}}):"error"===t?(0,l.jsx)(L.A,{}):(0,l.jsx)("span",{style:{display:"inline-block",height:6,width:6,borderRadius:"50%",background:"var(--colorTextTertiary)"}}),(0,l.jsx)("span",{children:e.title})]},e.key)})})]})})]})]},e.key)})}),"workflow"===tk&&(null==tj?void 0:tj.partialChapters)&&tj.partialChapters.length>0&&(0,l.jsx)(m.A,{size:"small",title:"章节进度",extra:(0,l.jsxs)(i.A,{color:"blue",children:[tj.partialChapters.filter(e=>"completed"===e.status).length,"/",tj.partialChapters.length]}),children:(0,l.jsx)(ee,{gap:6,style:{width:"100%"},children:tj.partialChapters.map(e=>(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:8,fontSize:12},children:[(0,l.jsx)(Z,{ellipsis:!0,style:{maxWidth:480},children:e.title}),(0,l.jsxs)(o.A,{size:6,children:[(0,l.jsx)(i.A,{color:"failed"===e.status?"error":"success",children:"failed"===e.status?"失败":"完成"}),(0,l.jsxs)(Z,{type:"secondary",children:[e.chars.toLocaleString()," 字"]})]})]},e.id))})}),"workflow"===tk&&(null==tj||null==(e=tj.reviewMetadata)?void 0:e.diagnostics)&&(0,l.jsx)($,{type:"info",title:"后台自动优化",children:"策略:".concat(tj.reviewMetadata.diagnostics.strategy.mode,";LLM 调用 ").concat(tj.reviewMetadata.diagnostics.llm.calls," 次;噪声过滤 ").concat((null==(t=tj.reviewMetadata.diagnostics.evidence)?void 0:t.filteredNoise)||0," 条;质量门禁 阻断").concat((null==(r=tj.reviewMetadata.diagnostics.quality)?void 0:r.blockingCount)||0,"/重要").concat((null==(a=tj.reviewMetadata.diagnostics.quality)?void 0:a.importantCount)||0,"/轻微").concat((null==(E=tj.reviewMetadata.diagnostics.quality)?void 0:E.minorCount)||0,";自动限流调整 ").concat(tj.reviewMetadata.diagnostics.llm.limitAdjustments," 次。审查与诊断信息仅用于系统修复,不会写入正文或导出文件。")}),"workflow"===tk&&eF&&0===tx.length&&(0,l.jsxs)("div",{style:{textAlign:"center",padding:40},children:[(0,l.jsx)(v.A,{}),(0,l.jsx)("div",{style:{marginTop:12,color:"var(--colorTextSecondary)"},children:"正在准备生成…"})]}),eP&&(0,l.jsx)("div",{ref:em,children:(0,l.jsx)(j.A,{items:[{key:"edit",label:ed("documents.edit"),children:(0,l.jsxs)(ee,{gap:16,style:{width:"100%"},children:[(0,l.jsx)(Y,{rows:28,value:eW,disabled:eJ,onSelect:e=>{var t,r,l;return e4({start:null!=(t=e.currentTarget.selectionStart)?t:0,end:null!=(l=null!=(r=e.currentTarget.selectionEnd)?r:e.currentTarget.selectionStart)?l:0})},onChange:e=>{var t,r,l;eG(e.target.value),e1(null),e6(null),e4({start:null!=(t=e.target.selectionStart)?t:0,end:null!=(l=null!=(r=e.target.selectionEnd)?r:e.target.selectionStart)?l:0})}}),(0,l.jsx)(m.A,{size:"small",style:{borderRadius:12,background:"linear-gradient(135deg, var(--colorFillAlter), var(--colorBgContainer))"},children:(0,l.jsxs)(ee,{gap:16,style:{width:"100%"},children:[(0,l.jsxs)(o.A,{align:"start",style:{width:"100%",justifyContent:"space-between"},children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)(o.A,{size:6,children:[(0,l.jsx)(N.A,{style:{color:"var(--colorAccent)"}}),(0,l.jsx)(Z,{strong:!0,children:"精准修改"}),(0,l.jsx)(i.A,{color:"blue",children:"AI 辅助"})]}),(0,l.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12},children:"针对当前编辑内容补充更具体的要求,AI 会保留文档结构并按你的提示细化修改。"})]}),(0,l.jsxs)(p.Ay,{size:"small",icon:(0,l.jsx)(X.A,{}),onClick:()=>e9(e=>!e),disabled:0===e3.length,children:["历史版本 ",e3.length>0?e3.length:""]})]}),(0,l.jsx)($,{type:"info",title:"系统只负责识别修改范围,不改写你的提示词;选中文字后优先只改选区,没有选区时按光标所在小节/章节定位。"}),(0,l.jsx)(Y,{rows:4,value:eX,disabled:eJ,onChange:e=>{eQ(e.target.value),e1(null),e6(null)},placeholder:"例如:写细一点;润色这段;第七章补充高处作业和临电安全措施;把安全检查频次改成每周一次。"}),(0,l.jsxs)(o.A,{wrap:!0,style:{width:"100%",justifyContent:"space-between"},children:[(0,l.jsx)(o.A,{wrap:!0,children:["写细一点","更专业","只润色选区","补充可执行措施"].map(e=>(0,l.jsx)(p.Ay,{size:"small",disabled:eJ,onClick:()=>eQ(t=>t?"".concat(t,";").concat(e):e),children:e},e))}),(0,l.jsx)(p.Ay,{type:"primary",icon:(0,l.jsx)(N.A,{}),loading:eJ&&"planning"===eZ,disabled:!eX.trim()||eJ,onClick:()=>{re()},children:"识别修改范围"})]}),e0&&!e2&&(0,l.jsx)(m.A,{size:"small",style:{borderRadius:10,borderColor:"var(--colorAccent)"},children:(0,l.jsxs)(ee,{gap:8,style:{width:"100%"},children:[(0,l.jsxs)(o.A,{wrap:!0,children:[(0,l.jsx)(i.A,{color:"purple",children:e0.scope}),(0,l.jsx)(i.A,{color:"blue",children:e0.action}),(0,l.jsxs)(i.A,{color:e0.confidence>=.8?"green":"orange",children:["置信度 ",Math.round(100*e0.confidence),"%"]}),e0.targetTitle&&(0,l.jsx)(Z,{strong:!0,children:e0.targetTitle})]}),(0,l.jsx)(Z,{children:e0.summary}),(0,l.jsx)(Z,{type:"secondary",style:{fontSize:12},children:"将按你的原始提示词执行,不添加额外编辑任务。"}),(0,l.jsxs)(o.A,{children:[(0,l.jsx)(p.Ay,{type:"primary",loading:eJ&&"applying"===eZ,onClick:()=>{rt(e0)},children:"执行并预览"}),(0,l.jsx)(p.Ay,{disabled:eJ,onClick:()=>e1(null),children:"取消"})]})]})}),e2&&(0,l.jsx)(m.A,{size:"small",style:{borderRadius:10,borderColor:"var(--colorSuccess)"},children:(0,l.jsxs)(ee,{gap:8,style:{width:"100%"},children:[(0,l.jsxs)(o.A,{wrap:!0,children:[(0,l.jsx)(i.A,{color:"green",children:"修改预览"}),(0,l.jsx)(Z,{children:e2.summary||e2.plan.summary}),(0,l.jsxs)(i.A,{children:[e2.changedChars&&e2.changedChars>0?"+".concat(e2.changedChars):e2.changedChars," 字符"]})]}),(0,l.jsxs)(y.A,{gutter:12,children:[(0,l.jsxs)(w.A,{span:12,children:[(0,l.jsx)(Z,{strong:!0,children:"修改前"}),(0,l.jsx)("div",{style:{marginTop:6,maxHeight:180,overflow:"auto",padding:10,borderRadius:8,background:"var(--colorFillAlter)",whiteSpace:"pre-wrap",fontSize:12},children:e2.beforeSnippet||"无片段预览"})]}),(0,l.jsxs)(w.A,{span:12,children:[(0,l.jsx)(Z,{strong:!0,children:"修改后"}),(0,l.jsx)("div",{style:{marginTop:6,maxHeight:180,overflow:"auto",padding:10,borderRadius:8,background:"var(--colorFillAlter)",whiteSpace:"pre-wrap",fontSize:12},children:e2.afterSnippet||"无片段预览"})]})]}),(0,l.jsxs)(o.A,{children:[(0,l.jsx)(p.Ay,{type:"primary",onClick:()=>{e2&&(t5(e2.before,e2.prompt),eG(e2.markdown),t7(!0),eu.success("已应用精准修改"))},children:"应用到文档"}),(0,l.jsx)(p.Ay,{onClick:()=>e6(null),children:"返回计划"}),(0,l.jsx)(p.Ay,{danger:!0,onClick:()=>{e1(null),e6(null)},children:"放弃"})]})]})}),e7&&(0,l.jsx)("div",{style:{borderTop:"1px solid var(--colorBorderSecondary)",paddingTop:12},children:(0,l.jsx)(x.A,{size:"small",dataSource:e3,locale:{emptyText:"暂无历史版本"},renderItem:e=>(0,l.jsx)(x.A.Item,{actions:[(0,l.jsx)(p.Ay,{size:"small",disabled:eJ,onClick:()=>{t5(eW,"恢复前版本"),eG(e.content),t7(!0),eu.success("已恢复历史版本")},children:"恢复"},"restore")],children:(0,l.jsx)(x.A.Item.Meta,{title:(0,l.jsxs)(o.A,{children:[(0,l.jsx)(Z,{children:new Date(e.createdAt).toLocaleString()}),(0,l.jsx)(i.A,{children:e.prompt})]}),description:(0,l.jsx)(Z,{type:"secondary",ellipsis:!0,children:e.content.replace(/\s+/gu," ").slice(0,120)})})})})})]})})]})},{key:"chapters-facts",label:"章节与事实",children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[eP.chapters.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsxs)(Z,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["章节 (",eP.chapters.length,")"]}),(0,l.jsx)(x.A,{size:"small",dataSource:eP.chapters,renderItem:e=>(0,l.jsx)(x.A.Item,{children:(0,l.jsx)(x.A.Item.Meta,{title:e.title,description:"证据: ".concat(e.evidence.length," \xb7 缺失: ").concat(e.missingFacts.length)})})})]}),eP.structuredFacts.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsxs)(Z,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["结构化事实 (",eP.structuredFacts.length,")"]}),(0,l.jsx)(A.A,{size:"small",column:1,bordered:!0,children:eP.structuredFacts.map((e,t)=>(0,l.jsxs)(A.A.Item,{label:e.key,children:[(0,l.jsx)("span",{children:e.value}),(0,l.jsx)(i.A,{style:{marginLeft:8},children:e.confidence.toFixed(2)}),(0,l.jsx)(Z,{type:"secondary",style:{fontSize:11,marginLeft:8},children:e.sourceFile})]},t))})]})]})},{key:"sources-missing",label:"来源与缺失",children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)(Z,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["引用来源 (",eP.sources.length,")"]}),0===eP.sources.length?(0,l.jsx)(h.A,{description:"暂无"}):(0,l.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:eP.sources.map(e=>(0,l.jsxs)(i.A,{color:"blue",children:[e.filePath," (",e.count,")"]},e.filePath))})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)(Z,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["缺失项 (",eP.missingItems.length,")"]}),0===eP.missingItems.length?(0,l.jsx)(h.A,{description:"无缺失"}):(0,l.jsx)(x.A,{size:"small",dataSource:eP.missingItems,renderItem:e=>(0,l.jsx)(x.A.Item,{children:e})})]})]})},{key:"validation",label:"校验 (".concat(eP.validationIssues.length,")"),children:0===eP.validationIssues.length?(0,l.jsx)(h.A,{description:"校验通过"}):(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[eP.validationIssues.map(e=>(0,l.jsxs)("div",{style:{border:"1px solid var(--colorBorderSecondary)",borderRadius:8,padding:12},children:[(0,l.jsx)(i.A,{color:"error"===e.level?"error":"warning"===e.level?"warning":"blue",children:e.level}),(0,l.jsx)("div",{style:{marginTop:6,whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-all",lineHeight:1.6},children:e.message}),e.suggestion&&(0,l.jsx)("div",{style:{marginTop:6,color:"var(--colorTextSecondary)",whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-all"},children:e.suggestion})]},"".concat(e.level,"-").concat(e.message))),eP.exportGate.checklist.length>0&&(0,l.jsxs)("div",{style:{marginTop:8},children:[(0,l.jsx)(Z,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:"导出门禁"}),(0,l.jsx)(x.A,{size:"small",dataSource:eP.exportGate.checklist,renderItem:e=>(0,l.jsxs)(x.A.Item,{children:[(0,l.jsx)(Z,{style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:e.label}),(0,l.jsx)(i.A,{color:e.passed?"success":"error",children:e.passed?"PASS":"FAIL"})]})})]})]})},{key:"stages",label:"执行阶段 (".concat(eP.executionStages.length,")"),children:(0,l.jsx)(x.A,{size:"small",dataSource:eP.executionStages,renderItem:e=>(0,l.jsxs)(x.A.Item,{children:[(0,l.jsx)(x.A.Item.Meta,{avatar:el[e.type]||(0,l.jsx)(F.A,{}),title:(0,l.jsx)(Z,{title:e.roleId,style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:"".concat(ei[e.type]||e.type," \xb7 ").concat(e.roleName||t_(e.roleId))}),description:(0,l.jsx)(Z,{type:"secondary",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-word"},children:e.message})}),(0,l.jsx)(i.A,{color:"success"===e.status?"success":"failed"===e.status?"error":"skipped"===e.status?"default":"warning",children:e.status})]})})}]})})]})}),(0,l.jsx)(f.A,{title:ed("documents.templateEditor"),open:te,onClose:()=>tt(!1),size:860,mask:{closable:!1},styles:{body:{padding:20,overflow:"auto"},header:{borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,l.jsxs)(o.A,{children:[(0,l.jsx)(p.Ay,{onClick:()=>tt(!1),children:ed("common.cancel")}),(0,l.jsx)(p.Ay,{type:"primary",onClick:()=>{tQ()},children:ed("common.save")})]}),children:(0,l.jsxs)(d.A,{form:ep,layout:"vertical",requiredMark:"optional",children:[(0,l.jsxs)(y.A,{gutter:12,children:[(0,l.jsx)(d.A.Item,{name:"id",hidden:!0,children:(0,l.jsx)(n.A,{})}),(0,l.jsx)(w.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"name",label:ed("documents.templateName"),rules:[{required:!0}],children:(0,l.jsx)(n.A,{})})}),(0,l.jsx)(w.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"category",label:ed("documents.templateCategory"),children:(0,l.jsx)(n.A,{})})}),(0,l.jsx)(w.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"outputTitle",label:ed("documents.outputTitle"),children:(0,l.jsx)(n.A,{})})}),(0,l.jsx)(w.A,{xs:24,md:12,children:(0,l.jsx)(d.A.Item,{name:"description",label:ed("documents.templateDescription"),children:(0,l.jsx)(n.A,{})})})]}),(0,l.jsx)(d.A.Item,{name:"projectRoleConfigId",label:ed("documents.projectRoleConfig"),rules:[{required:!0,message:ed("documents.projectRoleConfigRequired")}],children:(0,l.jsx)(b.A,{showSearch:!0,placeholder:ed("documents.projectRoleConfigRequired"),options:tM})}),(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(Z,{strong:!0,className:"text-base text-[var(--colorText)] block mb-1",children:"项目文件绑定"}),(0,l.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:"每个文件角色可直接勾选文件或文件夹;勾选文件夹会自动绑定该文件夹下所有文件。"})]}),(0,l.jsx)(i.A,{color:"blue",bordered:!1,children:"按文件角色多选"})]}),(0,l.jsx)(n.A.Search,{allowClear:!0,placeholder:"搜索文件或文件夹",value:eT,onChange:e=>ez(e.target.value),className:"mb-4"}),eI?(0,l.jsxs)("div",{className:"text-center py-8",children:[(0,l.jsx)(v.A,{}),(0,l.jsx)("div",{className:"mt-3 text-[var(--colorTextSecondary)] text-xs",children:"正在加载知识库文件…"})]}):0===to.length?(0,l.jsx)(h.A,{image:h.A.PRESENTED_IMAGE_SIMPLE,description:ts?"当前项目角色未配置文件角色":"请先选择项目角色"}):0===td.length?(0,l.jsx)(h.A,{image:h.A.PRESENTED_IMAGE_SIMPLE,description:"暂无知识库文件"}):(()=>{let e=null==ti?void 0:ti.value,t=e?en(tc[e]||[]).filter(e=>tp.includes(e)):[],r=new Set(eo(tu));return(0,l.jsxs)("div",{className:"flex flex-col md:flex-row gap-4 border border-[var(--borderColor)] rounded-xl overflow-hidden bg-[var(--colorBg)]",children:[(0,l.jsxs)("div",{className:"w-full md:w-[240px] border-b md:border-b-0 md:border-r border-[var(--borderColor)] bg-[var(--colorBgHover)] flex flex-col",children:[(0,l.jsx)("div",{className:"p-3 border-b border-[var(--borderColor)] text-xs font-semibold uppercase tracking-wider text-[var(--colorTextTertiary)]",children:"文件角色"}),(0,l.jsx)("div",{className:"flex-1 overflow-y-auto max-h-[200px] md:max-h-[400px] p-2 space-y-1",children:to.map(t=>{let r=en(tc[t.value]||[]).filter(e=>tp.includes(e)).length,s=t.value===e;return(0,l.jsxs)("div",{onClick:()=>eE(t.value),className:"flex items-center justify-between p-2 rounded-lg cursor-pointer transition-all duration-200 ".concat(s?"bg-[var(--colorBgSelected)] text-[var(--colorAccent)] font-medium shadow-sm":"text-[var(--colorText)] hover:bg-[var(--colorBgElevated)]"),children:[(0,l.jsx)("span",{className:"truncate flex-1 mr-2 text-sm",children:t.label}),(0,l.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded-full ".concat(s?"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400":"bg-[var(--colorFillAlter)] text-[var(--colorTextTertiary)]"),children:r})]},t.value)})})]}),(0,l.jsxs)("div",{className:"flex-1 flex flex-col bg-[var(--colorBgContainer)]",children:[(0,l.jsxs)("div",{className:"p-3 border-b border-[var(--borderColor)] flex items-center justify-between bg-[var(--colorBgHover)]",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"font-medium text-sm text-[var(--colorText)]",children:null==ti?void 0:ti.label}),(0,l.jsxs)(i.A,{color:"blue",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:["已选 ",t.length]})]}),(0,l.jsx)(p.Ay,{type:"text",size:"small",danger:!0,disabled:!e||0===t.length,onClick:()=>e&&tX(e,[]),children:"清空"})]}),e&&(0,l.jsx)(d.A.Item,{name:["fileBindingGroups",e],hidden:!0,children:(0,l.jsx)(n.A,{})}),(0,l.jsx)("div",{className:"px-4 py-2 border-b border-[var(--borderColor)] bg-blue-50/30 dark:bg-blue-900/10",children:(0,l.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)] truncate",children:t.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"text-blue-500 mr-1",children:"●"})," ",t.slice(0,4).map(ea).join("、")," ",t.length>4?" 等 ".concat(t.length," 个文件"):""]}):(0,l.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:"请在下方勾选要绑定的文件..."})})}),(0,l.jsx)("div",{className:"flex-1 p-3 overflow-y-auto max-h-[320px]",children:(0,l.jsx)(S.A,{checkable:!0,blockNode:!0,treeData:tu,checkedKeys:t,expandedKeys:eT.trim()?th:eB,onExpand:e=>eM(e),onCheck:(l,s)=>{if(!e)return;let n=new Set(t.filter(e=>!r.has(e)));for(let e of s.checkedNodes)e.isFolder?eo([e]).forEach(e=>n.add(e)):n.add(e.key);tX(e,Array.from(n))}})})]})]})})()]}),(0,l.jsx)(k.A,{type:"info",showIcon:!0,message:"文档规范由后台根据模板、提示词和角色绑定自动生成,无需手动维护规范包。",className:"mb-4 bg-[var(--colorBgHover)] border-0"})]})})]})}}},e=>{e.O(0,[433,576,787,195,375,371,506,63,636,593,792],()=>e(e.s=16403)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[28],{1611:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"}},12887:(e,t)=>{"use strict";t.A={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 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"}},13067:(e,t)=>{"use strict";t.A={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 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0010.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 00-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"}}]},name:"file-excel",theme:"outlined"}},14569:e=>{e.exports={featureLabel:"style_featureLabel__XFSTX",featureValue:"style_featureValue__I_wMP",filterInput:"style_filterInput__4_Elu",filterSelect:"style_filterSelect__vUBJ9",statusCard:"style_statusCard__H7Mee",statusSummary:"style_statusSummary__7KavF",statusSummaryText:"style_statusSummaryText__Shw3j",statusClearBtn:"style_statusClearBtn__uJ9bE",statusExpandBtn:"style_statusExpandBtn__HhgIj",statusFilters:"style_statusFilters__g_LbG",filterPill:"style_filterPill__1pjFW",filterPillActive:"style_filterPillActive___UZVi",statusPanel:"style_statusPanel__9arTu",statusEmpty:"style_statusEmpty__8LWzH",timelineList:"style_timelineList__dqJrz",timelineItem:"style_timelineItem__dbuL_",timelineStatusIcon:"style_timelineStatusIcon__SkRwb",timelinePercent:"style_timelinePercent__pEyH4",timelineRow:"style_timelineRow__EDOVa",timelineTitle:"style_timelineTitle__Yujr8",timelineClose:"style_timelineClose__Byx_9",timelineDetail:"style_timelineDetail__nALei",timelineDesc:"style_timelineDesc__FMjWE",timelinePath:"style_timelinePath__C9VQI",timelineMeta:"style_timelineMeta__u_pCn",timelineMetaTag:"style_timelineMetaTag__G3jF1",timelineExpandArrow:"style_timelineExpandArrow__xIBdF",timelineExpandArrowOpen:"style_timelineExpandArrowOpen__TWWDC",fileNameCell:"style_fileNameCell__EHsnt",folderName:"style_folderName__VhLXP",folderRow:"style_folderRow__d7k9S",searchResultList:"style_searchResultList__cVKZg",searchResultItem:"style_searchResultItem__boj6D",searchResultHeader:"style_searchResultHeader__meVdJ",searchContent:"style_searchContent__XbUVk",pdfPreviewStrip:"style_pdfPreviewStrip__94_eG",drawingPreview:"style_drawingPreview__lkk_L"}},23793:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"}},25258:(e,t,r)=>{"use strict";r.d(t,{A:()=>w});var a=r(51541),l=r(61848),s=r(5669),n=r(97109),i=r(72658),o=r(3638),c=r(92162),d=r(82725),u=r(74567),h=r(632),f=r(49517),m=r(79412),v=r(19527);let p=(0,d.U)(e=>{let{prefixCls:t,className:r,closeIcon:a,closable:l,type:s,title:d,children:p,footer:x,classNames:g,styles:y,...w}=e,{getPrefixCls:b}=n.useContext(u.QO),{className:j,style:_,classNames:A,styles:z}=(0,u.TP)("modal"),k=b(),C=t||b("modal"),S=(0,h.A)(k),[P,M]=(0,v.Ay)(C,S),[N,O]=(0,c.AV)([A,g],[z,y],{props:e}),T=`${C}-confirm`,H={};return H=s?{closable:l??!1,title:"",footer:"",children:n.createElement(f.k,{...e,prefixCls:C,confirmPrefixCls:T,rootPrefixCls:k,content:p})}:{closable:l??!0,title:d,footer:null!==x&&n.createElement(m.w,{...e}),children:p},n.createElement(i.Z,{prefixCls:C,className:(0,o.$)(P,`${C}-pure-panel`,s&&T,s&&`${T}-${s}`,r,j,M,S,N.root),style:{..._,...O.root},...w,closeIcon:(0,m.O)(C,a),closable:l,classNames:N,styles:O,...H})});var x=r(99739);function g(e){return(0,a.Ay)((0,a.fp)(e))}let y=s.A;y.useModal=x.A,y.info=function(e){return(0,a.Ay)((0,a.$D)(e))},y.success=function(e){return(0,a.Ay)((0,a.Ej)(e))},y.error=function(e){return(0,a.Ay)((0,a.jT)(e))},y.warning=g,y.warn=g,y.confirm=function(e){return(0,a.Ay)((0,a.lr)(e))},y.destroyAll=function(){for(;l.A.length;){let e=l.A.pop();e&&e()}},y.config=a.FB,y._InternalPanelDoNotUseOrYouWillBeFired=p;let w=y},26619:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(1611),s=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(s.A,n({},e,{ref:t,icon:l.A})))},26631:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(12887),s=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(s.A,n({},e,{ref:t,icon:l.A})))},30289:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.4 800.9c.2-.3.5-.6.7-.9C920.6 722.1 960 621.7 960 512s-39.4-210.1-104.8-288c-.2-.3-.5-.5-.7-.8-1.1-1.3-2.1-2.5-3.2-3.7-.4-.5-.8-.9-1.2-1.4l-4.1-4.7-.1-.1c-1.5-1.7-3.1-3.4-4.6-5.1l-.1-.1c-3.2-3.4-6.4-6.8-9.7-10.1l-.1-.1-4.8-4.8-.3-.3c-1.5-1.5-3-2.9-4.5-4.3-.5-.5-1-1-1.6-1.5-1-1-2-1.9-3-2.8-.3-.3-.7-.6-1-1C736.4 109.2 629.5 64 512 64s-224.4 45.2-304.3 119.2c-.3.3-.7.6-1 1-1 .9-2 1.9-3 2.9-.5.5-1 1-1.6 1.5-1.5 1.4-3 2.9-4.5 4.3l-.3.3-4.8 4.8-.1.1c-3.3 3.3-6.5 6.7-9.7 10.1l-.1.1c-1.6 1.7-3.1 3.4-4.6 5.1l-.1.1c-1.4 1.5-2.8 3.1-4.1 4.7-.4.5-.8.9-1.2 1.4-1.1 1.2-2.1 2.5-3.2 3.7-.2.3-.5.5-.7.8C103.4 301.9 64 402.3 64 512s39.4 210.1 104.8 288c.2.3.5.6.7.9l3.1 3.7c.4.5.8.9 1.2 1.4l4.1 4.7c0 .1.1.1.1.2 1.5 1.7 3 3.4 4.6 5l.1.1c3.2 3.4 6.4 6.8 9.6 10.1l.1.1c1.6 1.6 3.1 3.2 4.7 4.7l.3.3c3.3 3.3 6.7 6.5 10.1 9.6 80.1 74 187 119.2 304.5 119.2s224.4-45.2 304.3-119.2a300 300 0 0010-9.6l.3-.3c1.6-1.6 3.2-3.1 4.7-4.7l.1-.1c3.3-3.3 6.5-6.7 9.6-10.1l.1-.1c1.5-1.7 3.1-3.3 4.6-5 0-.1.1-.1.1-.2 1.4-1.5 2.8-3.1 4.1-4.7.4-.5.8-.9 1.2-1.4a99 99 0 003.3-3.7zm4.1-142.6c-13.8 32.6-32 62.8-54.2 90.2a444.07 444.07 0 00-81.5-55.9c11.6-46.9 18.8-98.4 20.7-152.6H887c-3 40.9-12.6 80.6-28.5 118.3zM887 484H743.5c-1.9-54.2-9.1-105.7-20.7-152.6 29.3-15.6 56.6-34.4 81.5-55.9A373.86 373.86 0 01887 484zM658.3 165.5c39.7 16.8 75.8 40 107.6 69.2a394.72 394.72 0 01-59.4 41.8c-15.7-45-35.8-84.1-59.2-115.4 3.7 1.4 7.4 2.9 11 4.4zm-90.6 700.6c-9.2 7.2-18.4 12.7-27.7 16.4V697a389.1 389.1 0 01115.7 26.2c-8.3 24.6-17.9 47.3-29 67.8-17.4 32.4-37.8 58.3-59 75.1zm59-633.1c11 20.6 20.7 43.3 29 67.8A389.1 389.1 0 01540 327V141.6c9.2 3.7 18.5 9.1 27.7 16.4 21.2 16.7 41.6 42.6 59 75zM540 640.9V540h147.5c-1.6 44.2-7.1 87.1-16.3 127.8l-.3 1.2A445.02 445.02 0 00540 640.9zm0-156.9V383.1c45.8-2.8 89.8-12.5 130.9-28.1l.3 1.2c9.2 40.7 14.7 83.5 16.3 127.8H540zm-56 56v100.9c-45.8 2.8-89.8 12.5-130.9 28.1l-.3-1.2c-9.2-40.7-14.7-83.5-16.3-127.8H484zm-147.5-56c1.6-44.2 7.1-87.1 16.3-127.8l.3-1.2c41.1 15.6 85 25.3 130.9 28.1V484H336.5zM484 697v185.4c-9.2-3.7-18.5-9.1-27.7-16.4-21.2-16.7-41.7-42.7-59.1-75.1-11-20.6-20.7-43.3-29-67.8 37.2-14.6 75.9-23.3 115.8-26.1zm0-370a389.1 389.1 0 01-115.7-26.2c8.3-24.6 17.9-47.3 29-67.8 17.4-32.4 37.8-58.4 59.1-75.1 9.2-7.2 18.4-12.7 27.7-16.4V327zM365.7 165.5c3.7-1.5 7.3-3 11-4.4-23.4 31.3-43.5 70.4-59.2 115.4-21-12-40.9-26-59.4-41.8 31.8-29.2 67.9-52.4 107.6-69.2zM165.5 365.7c13.8-32.6 32-62.8 54.2-90.2 24.9 21.5 52.2 40.3 81.5 55.9-11.6 46.9-18.8 98.4-20.7 152.6H137c3-40.9 12.6-80.6 28.5-118.3zM137 540h143.5c1.9 54.2 9.1 105.7 20.7 152.6a444.07 444.07 0 00-81.5 55.9A373.86 373.86 0 01137 540zm228.7 318.5c-39.7-16.8-75.8-40-107.6-69.2 18.5-15.8 38.4-29.7 59.4-41.8 15.7 45 35.8 84.1 59.2 115.4-3.7-1.4-7.4-2.9-11-4.4zm292.6 0c-3.7 1.5-7.3 3-11 4.4 23.4-31.3 43.5-70.4 59.2-115.4 21 12 40.9 26 59.4 41.8a373.81 373.81 0 01-107.6 69.2z"}}]},name:"global",theme:"outlined"}},35311:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"}},45551:(e,t,r)=>{"use strict";function a(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),r=e/Math.pow(1024,t);return"".concat(r.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let r=Math.floor(Math.floor((Date.now()-e)/1e3)/60),a=Math.floor(r/60),l=Math.floor(a/24);return l>30?new Date(e).toLocaleDateString(t):"en-US"===t?l>0?"".concat(l,"d ago"):a>0?"".concat(a,"h ago"):r>0?"".concat(r,"m ago"):"Just now":l>0?"".concat(l," 天前"):a>0?"".concat(a," 小时前"):r>0?"".concat(r," 分钟前"):"刚刚"}r.d(t,{Jm:()=>i,fw:()=>l,z3:()=>a});let s={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},n={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function i(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===r?n:s)[e])?t:e}},48893:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M553.1 509.1l-77.8 99.2-41.1-52.4a8 8 0 00-12.6 0l-99.8 127.2a7.98 7.98 0 006.3 12.9H696c6.7 0 10.4-7.7 6.3-12.9l-136.5-174a8.1 8.1 0 00-12.7 0zM360 442a40 40 0 1080 0 40 40 0 10-80 0zm494.6-153.4L639.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-image",theme:"outlined"}},53234:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM496 208H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 544h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H312c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8zm328 244a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"hdd",theme:"outlined"}},54746:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(71242),s=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(s.A,n({},e,{ref:t,icon:l.A})))},58209:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(23793),s=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(s.A,n({},e,{ref:t,icon:l.A})))},58520:(e,t)=>{"use strict";t.A={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 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 00-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 00-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"}}]},name:"file-word",theme:"outlined"}},61825:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(30289),s=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(s.A,n({},e,{ref:t,icon:l.A})))},64207:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ee});var a=r(65321),l=r(97109),s=r(48321),n=r(43220),i=r.n(n),o=r(86109),c=r(17807),d=r(25258),u=r(11702),h=r(71102),f=r(85114),m=r(7576),v=r(57271),p=r(33442),x=r(21289),g=r(56768),y=r(48893),w=r(88483);function b(){return(b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let j=l.forwardRef((e,t)=>l.createElement(w.A,b({},e,{ref:t,icon:y.A})));var _=r(13067);function A(){return(A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let z=l.forwardRef((e,t)=>l.createElement(w.A,A({},e,{ref:t,icon:_.A})));var k=r(58520);function C(){return(C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let S=l.forwardRef((e,t)=>l.createElement(w.A,C({},e,{ref:t,icon:k.A})));var P=r(90939);function M(){return(M=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let N=l.forwardRef((e,t)=>l.createElement(w.A,M({},e,{ref:t,icon:P.A})));var O=r(93314),T=r(61825),H=r(26619),E=r(7225),F=r(26631),V=r(64254),B=r(64629),I=r(58209),R=r(85855),D=r(30486),L=r(54746),q=r(84742),$=r(38762),J=r(39219),Q=r(22931),U=r(6578),W=r(45551),X=r(14569),G=r.n(X);let K=["document","spreadsheet","image","cad","code","data","web","diagram","other"],Z=/\.(zip|jar|war|apk|tar|gz|tgz|bz2|rar|7z)$/iu,Y=/(^|\/)\.DS_Store$|(^|\/)Thumbs\.db$|(^|\/)__MACOSX\/|\.bak$/iu;function ee(){let e=(0,s.Vr)("knowledge"),{locale:t}=(0,s.x_)(),{message:r}=c.A.useApp(),n=(0,o.useRouter)(),y="string"==typeof n.query.category?n.query.category:"",[w,b]=(0,l.useState)([]),[_,A]=(0,l.useState)(!1),[k,C]=(0,l.useState)(""),[P,M]=(0,l.useState)(""),[X,ee]=(0,l.useState)(y),[et,er]=(0,l.useState)(!1),[ea,el]=(0,l.useState)(!1),[es,en]=(0,l.useState)([]),[ei,eo]=(0,l.useState)([]),[ec,ed]=(0,l.useState)(new Set),[eu,eh]=(0,l.useState)("all"),[ef,em]=(0,l.useState)(!0),[ev,ep]=(0,l.useState)([]),[ex,eg]=(0,l.useState)(new Set),ey=(0,l.useRef)(X);(0,l.useEffect)(()=>{ey.current=X},[X]),(0,l.useEffect)(()=>{ee("string"==typeof n.query.category?n.query.category:"")},[n.query.category]);let ew=(0,l.useCallback)(async(e,t)=>{let r=null!=e?e:ey.current;(null==t?void 0:t.silent)||(A(!0),C(""));try{let e=await (0,U.HT)({category:r||void 0,limit:5e3});b(e.files||[]),e.initializing&&window.setTimeout(()=>{ew(r,{silent:!0})},3e3)}catch(e){(null==t?void 0:t.silent)||(b([]),C(e instanceof Error?e.message:"文件列表加载失败"))}finally{(null==t?void 0:t.silent)||A(!1)}},[]);(0,l.useEffect)(()=>{ew(X)},[X,ew]);let eb=e=>({id:e.id,type:e.type,title:e.title,description:e.message,status:e.status,percent:e.percent,filePath:e.filePath,chunkCount:e.chunkCount,textLength:e.textLength,extractionMode:e.extractionMode,error:e.error,createdAt:e.createdAt}),ej=(0,l.useCallback)(async()=>{try{let e=(await (0,U.Qx)()).operations.map(eb);en(t=>{let r=new Set(e.map(e=>e.id).filter(Boolean)),a=e.map(e=>{var r;let a=t.find(t=>t.id===e.id);return a?{...a,...e,createdAt:null!=(r=a.createdAt)?r:e.createdAt}:e}),l=t.filter(e=>e.id&&!r.has(e.id)&&"processing"===e.status);return[...a,...l].slice(0,50)})}catch(e){}},[]),e_=(0,l.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];en(r=>{let a=r.findIndex(r=>e.id&&r.id===e.id||t.includes(r.title));if(a>=0){var l;let t=[...r];return t[a]={...r[a],...e,createdAt:null!=(l=r[a].createdAt)?l:e.createdAt},t}return[e,...r].slice(0,50)})},[]);(0,l.useEffect)(()=>{ej()},[ej]);let eA=(0,l.useMemo)(()=>{let e=0,t=0,r=0;for(let a of es)"processing"===a.status?e++:"success"===a.status?t++:("error"===a.status||"warning"===a.status)&&r++;return{processing:e,success:t,error:r}},[es]);(0,l.useEffect)(()=>{eA.processing>0&&em(!1)},[eA.processing]),(0,l.useEffect)(()=>{if(0===eA.processing)return;let e=window.setInterval(()=>{ej()},2e3),t=window.setInterval(()=>{ew(void 0,{silent:!0})},8e3);return()=>{window.clearInterval(e),window.clearInterval(t)}},[ew,ej,eA.processing]),"all"===eu||es.filter(e=>"processing"===eu?"processing"===e.status:"success"===eu?"success"===e.status:"error"!==eu||"error"===e.status||"warning"===e.status);let ez=async e=>{let t=e.filter(e=>{let t=e.webkitRelativePath||e.name;return e.size>0&&!Z.test(e.name)&&!Y.test(t)}),a=e.length-t.length;if(a>0&&r.warning("已跳过 ".concat(a," 个空文件、系统文件、备份文件或压缩包")),0===t.length)return;let l=1===t.length?t[0].name:"".concat(t.length," 个文件");er(!0);let s="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));e_({id:s,type:"upload",title:"上传 ".concat(l),description:"等待上传、解析、切片和入库;同路径文件会更新,其他已有文件不会清除",status:"processing",percent:5});try{await (0,U.c1)(t,void 0,s,e=>{e_({id:s,type:"upload",title:"上传 ".concat(l),description:"正在上传文件:".concat(e.uploadedFiles,"/").concat(e.totalFiles,",批次 ").concat(e.batchIndex+1,"/").concat(e.totalBatches),status:"processing",percent:Math.min(5,Math.max(1,Math.round(e.uploadedFiles/Math.max(1,e.totalFiles)*5)))})}),r.info("文件已上传,正在后台解析、切片和入库;同路径文件会更新,其他已有文件不会清除,可在顶部“后台任务”查看进度"),M(""),ee(""),eo([]),ey.current="",await ej(),window.setTimeout(()=>{ew(void 0,{silent:!0})},2e3)}catch(t){let e=t instanceof Error?t.message:"请重试或检查文件格式";r.error(e||"上传失败"),e_({id:s,type:"error",title:"上传失败 ".concat(l),description:e,status:"error",percent:100})}finally{er(!1)}},ek=async()=>{el(!0);let e="reindex-ui-".concat(Date.now());e_({id:e,type:"reindex",title:"重新解析入库",description:"正在提交后台任务",status:"processing",percent:5});try{var t;let a=await (0,U.H1)(),l=a.operationId||e,s=a.job;r.info(a.alreadyRunning?"已有重新解析任务正在后台执行":"已提交重新解析入库任务,可在顶部“后台任务”查看进度"),e_({id:l,type:"reindex",title:(null==s?void 0:s.title)||"重新解析入库",description:(null==s?void 0:s.message)||"后台将重新扫描文件、解析、切片并重建索引",status:(null==s?void 0:s.status)||"processing",percent:null!=(t=null==s?void 0:s.percent)?t:10,error:null==s?void 0:s.error},["重新解析入库"]);for(let e=0;e<360;e++){let e=await (0,U.ax)(l).then(e=>e.job).catch(async()=>(await (0,U.Qx)()).operations.find(e=>e.id===l));if(e){let t="success"===e.status||"error"===e.status;if(e_({id:l,type:"error"===e.status?"error":"reindex",title:"success"===e.status?"重新解析入库完成":"error"===e.status?"重新解析入库失败":e.title,description:e.error||e.message,status:e.status,percent:e.percent,filePath:e.filePath,chunkCount:e.chunkCount,error:e.error}),t){"success"===e.status?r.success(e.message||"重新解析入库完成"):r.error(e.error||e.message||"重新解析入库失败");break}}await new Promise(e=>setTimeout(e,1e3))}await ew(),await ej()}catch(a){let t=a instanceof Error?a.message:"重新解析入库失败";r.error(t),e_({id:e,type:"error",title:"重新解析入库失败",description:t,status:"error",percent:100},["重新解析入库","重新解析入库完成","重新解析入库失败"])}finally{el(!1)}},eC=async e=>{let t="file-reindex-ui-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));eg(t=>new Set(t).add(e.relativePath)),e_({id:t,type:"reindex",title:"重新解析 ".concat(e.relativePath),description:"正在提交单文件后台任务",status:"processing",percent:5,filePath:e.relativePath});try{var a;let l=await (0,U.HC)(e.relativePath),s=l.operationId||t,n=l.job;r.info(l.alreadyRunning?"已有知识库任务正在后台执行":"已提交单文件重新解析任务"),e_({id:s,type:"reindex",title:(null==n?void 0:n.title)||"重新解析 ".concat(e.relativePath),description:(null==n?void 0:n.message)||"后台将重新解析、分块并入库该文件",status:(null==n?void 0:n.status)||"processing",percent:null!=(a=null==n?void 0:n.percent)?a:10,filePath:(null==n?void 0:n.filePath)||e.relativePath,chunkCount:null==n?void 0:n.chunkCount,error:null==n?void 0:n.error},["重新解析 ".concat(e.relativePath)]);for(let t=0;t<240;t++){let t=await (0,U.ax)(s).then(e=>e.job).catch(async()=>(await (0,U.Qx)()).operations.find(e=>e.id===s));if(t){let a="success"===t.status||"error"===t.status;if(e_({id:s,type:"error"===t.status?"error":"reindex",title:"success"===t.status?"重新解析完成 ".concat(e.relativePath):"error"===t.status?"重新解析失败 ".concat(e.relativePath):t.title,description:t.error||t.message,status:t.status,percent:t.percent,filePath:t.filePath||e.relativePath,chunkCount:t.chunkCount,error:t.error}),await ew(),a){"success"===t.status?r.success(t.message||"单文件重新解析完成"):r.error(t.error||t.message||"单文件重新解析失败");break}}await new Promise(e=>setTimeout(e,1e3))}await ew(),await ej()}catch(l){let a=l instanceof Error?l.message:"单文件重新解析失败";r.error(a),e_({id:t,type:"error",title:"重新解析失败 ".concat(e.relativePath),description:a,status:"error",percent:100,filePath:e.relativePath},["重新解析 ".concat(e.relativePath)])}finally{eg(t=>{let r=new Set(t);return r.delete(e.relativePath),r})}},eS=t=>{let a="selected"===t?eF:"filtered"===t?eP.map(e=>e.relativePath):[],l=w.length;if("all"!==t&&0===a.length||"all"===t&&0===l)return void r.info("没有可删除的文件");let s="all"===t?"删除全部文件 ".concat(l," 个?"):"filtered"===t?"删除当前筛选结果中的文件 ".concat(a.length," 个?"):"删除已选文件 ".concat(a.length," 个?");d.A.confirm({title:s,content:"将同时删除文件、切片、索引和向量记录。此操作不可撤销。",okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{en(e=>[{type:"delete",title:s,description:"正在批量删除文件和索引",status:"processing",percent:10},...e].slice(0,50));try{var e;let s=null!=(e=("all"===t?await (0,U.X8)():"selected"===t?await (0,U.tZ)(eE,eH):await (0,U.SJ)(a)).deleted)?e:"all"===t?l:a.length;r.success("已删除 ".concat(s," 个文件")),eo([]),en(e=>[{type:"delete",title:"批量删除完成",description:"已删除 ".concat(s," 个文件、切片和索引"),status:"success"},...e].slice(0,50)),await ew(),await ej()}catch(e){r.error("批量删除失败"),en(e=>[{type:"error",title:"批量删除失败",description:"请重试",status:"error"},...e].slice(0,50))}}})},eP=(0,l.useMemo)(()=>P?w.filter(e=>e.relativePath.toLowerCase().includes(P.toLowerCase())):w,[P,w]),eM=(0,l.useMemo)(()=>new Set(eP.map(e=>e.relativePath)),[eP]),eN=(0,l.useMemo)(()=>{let e={};for(let r of[...eP].sort((e,t)=>e.relativePath.localeCompare(t.relativePath))){let a=r.relativePath.split("/"),l="";for(let s=0;s<a.length;s++){let n=a[s],i=l;l=l?"".concat(l,"/").concat(n):n;let o=s===a.length-1;if(e[l])o||e[l].isFolder?o&&(e[l].isFolder=!1,e[l].file=r,e[l].fileCount=1,e[l].totalSize=r.fileSize,e[l].totalChunks=r.chunkCount):(e[l].isFolder=!0,e[l].children=[],e[l].fileCount=0,e[l].totalSize=0,e[l].totalChunks=0);else{var t;e[l]={key:l,name:n,isFolder:!o,...o?{file:r,fileCount:1,totalSize:r.fileSize,totalChunks:r.chunkCount}:{children:[],fileCount:0,totalSize:0,totalChunks:0}},i&&(null==(t=e[i])?void 0:t.children)&&e[i].children.push(e[l])}}}let r=e=>{for(let s of e)if(s.children){r(s.children);let e=0,n=0,i=0;for(let r of s.children){var t,a,l;e+=null!=(t=r.fileCount)?t:0,n+=null!=(a=r.totalSize)?a:0,i+=null!=(l=r.totalChunks)?l:0}s.fileCount=e,s.totalSize=n,s.totalChunks=i}},a=e=>e.map(e=>e.children?{...e,children:a(e.children)}:e).filter(e=>{var t,r,a;return!e.isFolder||(null!=(r=e.fileCount)?r:0)>0&&(null!=(a=null==(t=e.children)?void 0:t.length)?a:0)>0}),l=Object.values(e).filter(e=>!e.key.includes("/"));return r(l),a(l)},[eP]),eO=(0,l.useMemo)(()=>{let e=[],t=r=>{for(let a of r)e.push(a.key),a.children&&t(a.children)};return t(eN),e},[eN]),eT=(0,l.useMemo)(()=>new Set([...eM,...eO]),[eO,eM]),eH=(0,l.useMemo)(()=>ei.map(String).filter(e=>!eM.has(e)&&eO.includes(e)),[eO,ei,eM]),eE=(0,l.useMemo)(()=>ei.map(String).filter(e=>eM.has(e)),[ei,eM]),eF=(0,l.useMemo)(()=>{let e=new Set;for(let t of eE){let r=w.find(e=>e.relativePath===t);r&&e.add(r.relativePath)}for(let t of eH){let r="".concat(t,"/");for(let t of w)t.relativePath.startsWith(r)&&e.add(t.relativePath)}return Array.from(e)},[w,eE,eH]),eV=eF.length;(0,l.useEffect)(()=>{eo(e=>e.filter(e=>eT.has(String(e))))},[eT]);let eB=(0,l.useMemo)(()=>P?eO:eN.map(e=>e.key),[P,eO,eN]);(0,l.useEffect)(()=>{ep(eB)},[eB]);let eI=(e,t)=>{ep(r=>e?[...r,t.key]:r.filter(e=>e!==t.key))},eR=[{title:e("fileName"),dataIndex:"name",key:"name",render:(e,t)=>(0,a.jsxs)("span",{className:G().fileNameCell,children:[t.isFolder?(0,a.jsx)("span",{style:{cursor:"pointer"},onClick:e=>{e.stopPropagation(),eI(!ev.includes(t.key),t)},children:(e=>{let t=e.children;return t&&0!==t.length?(0,a.jsx)(V.A,{style:{color:"#fa8c16",fontSize:15}}):(0,a.jsx)(E.A,{style:{color:"#fa8c16",fontSize:15}})})(t)}):(e=>{if(!e)return(0,a.jsx)(g.A,{style:{fontSize:15}});let t=e.category;return"image"===t?(0,a.jsx)(j,{style:{color:"#eb2f96",fontSize:15}}):"spreadsheet"===t?(0,a.jsx)(z,{style:{color:"#52c41a",fontSize:15}}):"document"===t?(0,a.jsx)(S,{style:{color:"#1677ff",fontSize:15}}):"code"===t?(0,a.jsx)(N,{style:{color:"#fa8c16",fontSize:15}}):"archive"===t?(0,a.jsx)(O.A,{style:{color:"#8c8c8c",fontSize:15}}):"web"===t?(0,a.jsx)(T.A,{style:{color:"#13c2c2",fontSize:15}}):"data"===t?(0,a.jsx)(H.A,{style:{color:"#722ed1",fontSize:15}}):"cad"===t?(0,a.jsx)(E.A,{style:{color:"#fa541c",fontSize:15}}):"diagram"===t?(0,a.jsx)(j,{style:{color:"#a0d911",fontSize:15}}):(0,a.jsx)(F.A,{style:{fontSize:15}})})(t.file),t.isFolder?(0,a.jsx)("span",{className:G().folderName,onClick:e=>{e.stopPropagation(),eI(!ev.includes(t.key),t)},children:t.name}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(i(),{className:"truncate max-w-[380px] inline-block",href:"/knowledge/file-detail?relativePath=".concat(encodeURIComponent(t.key)),children:t.name})})]})},{title:e("fileCategory"),dataIndex:"category",key:"cat",width:110,render:(e,r)=>{var l,s;return r.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,a.jsx)(u.A,{children:(0,W.Jm)(null!=(s=null==(l=r.file)?void 0:l.category)?s:"",t)})}},{title:e("fileSize"),dataIndex:"fileSize",key:"size",width:90,render:(e,t)=>{var r,a,l;return(0,W.z3)(t.isFolder?null!=(a=t.totalSize)?a:0:null!=(l=null==(r=t.file)?void 0:r.fileSize)?l:0)}},{title:e("chunksCount"),dataIndex:"chunkCount",key:"chunks",width:80,render:(e,t)=>{var r,l,s;let n=t.isFolder?null!=(l=t.totalChunks)?l:0:null!=(s=null==(r=t.file)?void 0:r.chunkCount)?s:0;return(0,a.jsx)(u.A,{color:n>1?"green":"orange",children:n})}},{title:e("parsingStatus"),dataIndex:"status",key:"status",width:100,render:(e,t)=>{var r,l,s,n;return t.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,a.jsx)(u.A,{color:"active"===(n=null==(r=t.file)?void 0:r.status)?"green":"processing"===n||"indexing"===n?"blue":"error"===n?"red":"orange",children:(null==(l=t.file)?void 0:l.errorMessage)||(null==(s=t.file)?void 0:s.status)||"—"})}},{title:e("fileDate"),dataIndex:"mtime",key:"date",width:130,render:(e,r)=>{var l;return r.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(null==(l=r.file)?void 0:l.mtime)?new Date(r.file.mtime).toLocaleDateString(t):"—"}},{title:e("source"),key:"source",width:100,render:(t,r)=>r.isFolder?(0,a.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,a.jsx)(u.A,{color:"cyan",children:e("fileSource")})},{title:"",key:"act",width:80,align:"center",render:(t,l)=>l.isFolder?null:(0,a.jsx)(h.A,{menu:{items:[{key:"reindex",label:e("reindex"),icon:(0,a.jsx)(B.A,{}),onClick:()=>{eC(l.file)}},{type:"divider"},{key:"delete",label:e("delete"),icon:(0,a.jsx)(I.A,{}),danger:!0,onClick:()=>{var t;return t=l.file,void d.A.confirm({title:e("delete"),content:e("deleteConfirm"),okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{en(e=>[{type:"delete",title:"删除 ".concat(t.relativePath),description:"正在删除文件记录",status:"processing"},...e].slice(0,50));try{await (0,U.xq)(t.relativePath),r.success("已删除"),en(e=>[{type:"delete",title:"删除完成 ".concat(t.relativePath),description:"文件和索引记录已移除",status:"success"},...e].slice(0,50)),eo(e=>e.filter(e=>e!==t.relativePath)),await ew(),await ej()}catch(e){r.error("删除失败"),en(e=>[{type:"error",title:"删除失败 ".concat(t.relativePath),description:"请重试",status:"error"},...e].slice(0,50))}}})}}]},trigger:["click"],children:(0,a.jsx)(f.Ay,{type:"text",size:"small",icon:(0,a.jsx)(R.A,{})})})}],eD=(0,a.jsxs)("div",{className:"flex flex-1 md:flex-none w-full md:w-auto items-center gap-3",children:[(0,a.jsx)(m.A,{placeholder:e("searchPlaceholder"),prefix:(0,a.jsx)(D.A,{className:"text-[var(--colorTextTertiary)]"}),value:P,onChange:e=>{M(e.target.value)},allowClear:!0,className:"max-w-[300px] flex-1 bg-transparent hover:bg-transparent focus:bg-transparent shadow-none",bordered:!1,style:{borderBottom:"1px solid var(--borderColor)",borderRadius:0,paddingLeft:0,paddingRight:0}}),(0,a.jsx)(v.A,{value:X||void 0,onChange:e=>{ee(e||"")},placeholder:e("filterCategory"),allowClear:!0,style:{width:140},variant:"borderless",options:[{label:e("allCategories"),value:""},...K.map(e=>({label:(0,W.Jm)(e,t),value:e}))]}),(0,a.jsx)("div",{className:"w-[1px] h-6 bg-[var(--borderColor)] mx-1"}),(0,a.jsx)(h.A,{menu:{items:[{key:"file",label:e("uploadFiles"),icon:(0,a.jsx)(g.A,{}),onClick:()=>{var e;return null==(e=document.getElementById("kb-file-upload-input"))?void 0:e.click()}},{key:"folder",label:e("uploadFolder"),icon:(0,a.jsx)(E.A,{}),onClick:()=>{var e;return null==(e=document.getElementById("kb-folder-upload-input"))?void 0:e.click()}},{type:"divider"},{key:"reindex",label:e("reindexAll"),icon:(0,a.jsx)(B.A,{}),onClick:()=>{ek()},danger:!0}]},trigger:["click"],children:(0,a.jsx)(f.Ay,{type:"primary",icon:(0,a.jsx)(L.A,{}),loading:et||ea,className:"shadow-none rounded-md px-4",children:e("new")})}),(0,a.jsx)("input",{id:"kb-file-upload-input",type:"file",multiple:!0,hidden:!0,accept:".pdf,.doc,.docx,.txt,.md,.csv,.tsv,.xls,.xlsx,.png,.jpg,.jpeg,.webp,.svg,.dwg,.dxf,.step,.stp,.iges,.igs,.js,.ts,.tsx,.jsx,.py,.go,.java,.cs,.cpp,.c,.h,.json,.jsonl,.yaml,.yml,.xml,.html,.htm,.drawio,.dio,.vsdx,.vdx,.puml,.plantuml,.mmd,.mermaid,.excalidraw",onChange:e=>{var t;let r=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",ez(r)}}),(0,a.jsx)("input",{id:"kb-folder-upload-input",type:"file",multiple:!0,hidden:!0,webkitdirectory:"",onChange:e=>{var t;let r=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",ez(r)}})]});return(0,a.jsxs)("div",{className:"h-[calc(100vh-140px)] flex flex-col",children:[(0,a.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 pb-4 border-b border-[var(--borderColor)] shrink-0 animateFadeIn",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold tracking-tight text-[var(--colorText)] mb-1",children:e("files")}),(0,a.jsx)("p",{className:"text-xs text-[var(--colorTextSecondary)]",children:e("manageRawFiles")})]}),eD]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 py-4 shrink-0 animateFadeIn stagger-1 border-b border-[var(--borderColor)] mb-2",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 border-r border-[var(--borderColor)] pr-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-6 h-6 rounded-md bg-[var(--colorBgHover)] flex items-center justify-center text-[var(--colorTextTertiary)]",children:(0,a.jsx)(V.A,{})}),(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wider font-semibold text-[var(--colorTextTertiary)]",children:e("totalRootFolders")})]}),(0,a.jsx)("div",{className:"text-2xl font-bold text-[var(--colorText)]",children:eN.length}),(0,a.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)] mt-1",children:"目录层级"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 border-r border-[var(--borderColor)] px-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-6 h-6 rounded-md bg-[var(--colorBgHover)] flex items-center justify-center text-[var(--colorTextTertiary)]",children:(0,a.jsx)(F.A,{})}),(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wider font-semibold text-[var(--colorTextTertiary)]",children:e("totalFilesStats")})]}),(0,a.jsx)("div",{className:"text-2xl font-bold text-[var(--colorText)]",children:w.length}),(0,a.jsxs)("div",{className:"text-xs text-[var(--colorTextSecondary)] mt-1",children:["包含 ",w.filter(e=>"PDF"===e.category).length," 个 PDF"]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 border-r border-[var(--borderColor)] px-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-6 h-6 rounded-md bg-[var(--colorOk)]/10 flex items-center justify-center text-[var(--colorOk)]",children:(0,a.jsx)(q.A,{})}),(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wider font-semibold text-[var(--colorTextTertiary)]",children:e("successfullyParsed")})]}),(0,a.jsx)("div",{className:"text-2xl font-bold text-[var(--colorOk)]",children:w.filter(e=>"success"===e.status).length}),(0,a.jsxs)("div",{className:"text-xs text-[var(--colorTextSecondary)] mt-1",children:["总计切片: ",w.reduce((e,t)=>e+(t.chunkCount||0),0)]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 pl-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-6 h-6 rounded-md bg-[var(--colorDanger)]/10 flex items-center justify-center text-[var(--colorDanger)]",children:(0,a.jsx)($.A,{})}),(0,a.jsx)("div",{className:"text-[10px] uppercase tracking-wider font-semibold text-[var(--colorTextTertiary)]",children:e("parsingErrors")})]}),(0,a.jsx)("div",{className:"text-2xl font-bold text-[var(--colorDanger)]",children:w.filter(e=>"error"===e.status).length}),(0,a.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)] mt-1",children:"需手动排查"})]})]}),k&&(0,a.jsx)("div",{className:"p-4 mt-2 bg-[var(--colorDanger)]/10 text-[var(--colorDanger)] rounded-md border border-[var(--colorDanger)]/20",children:k}),(0,a.jsxs)("div",{className:"flex justify-between items-center py-2 shrink-0 animateFadeIn stagger-2",style:{opacity:0},children:[(0,a.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)] font-medium",children:e("showingMatchingFiles").replace("{count}",String(eP.length))}),(0,a.jsxs)(p.A,{size:8,children:[eV>0&&(0,a.jsxs)(f.Ay,{danger:!0,size:"small",type:"text",icon:(0,a.jsx)(I.A,{}),onClick:()=>eS("selected"),children:[e("deleteSelected")," (",eV,")"]}),(0,a.jsx)(f.Ay,{danger:!0,size:"small",type:"text",disabled:0===w.length,onClick:()=>eS("all"),children:e("deleteAll")})]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden bg-[var(--colorBg)] rounded-lg border border-[var(--borderColor)] animateFadeIn stagger-3 shadow-sm",style:{opacity:0},children:(0,a.jsx)(x.A,{rowKey:"key",columns:eR,dataSource:eN,loading:_&&!et&&!ea,size:"middle",className:"h-full modern-table",scroll:{y:"calc(100vh - 280px)"},expandable:{expandedRowKeys:ev,onExpand:eI,expandIcon:e=>{let{expanded:t,onExpand:r,record:l}=e;return l.isFolder?(0,a.jsx)("div",{onClick:e=>r(l,e),className:"cursor-pointer mr-2 inline-flex text-[var(--colorTextTertiary)] hover:text-[var(--colorText)] transition-colors",children:t?(0,a.jsx)(J.A,{size:16}):(0,a.jsx)(Q.A,{size:16})}):(0,a.jsx)("span",{className:"w-[24px] inline-block"})}},locale:{emptyText:_?e("common.loading"):P?e("emptySearch"):e("noFiles")},pagination:!1,rowClassName:e=>"hover:bg-[var(--colorBgHover)] transition-colors ".concat(e.isFolder?"font-medium bg-[var(--colorBgSecondary)]/50":""),rowSelection:{selectedRowKeys:ei,onChange:eo,checkStrictly:!1,getCheckboxProps:e=>{var t;return{disabled:!!e.isFolder&&(null!=(t=e.fileCount)?t:0)===0}}}})})]})}},71242:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"}},85855:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(35311),s=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(s.A,n({},e,{ref:t,icon:l.A})))},90426:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/files",function(){return r(64207)}])},90939:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 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:"code",theme:"outlined"}},93314:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var a=r(97109),l=r(53234),s=r(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e}).apply(this,arguments)}let i=a.forwardRef((e,t)=>a.createElement(s.A,n({},e,{ref:t,icon:l.A})))}},e=>{e.O(0,[433,576,985,375,102,289,636,593,792],()=>e(e.s=90426)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[414],{45551:(e,l,t)=>{"use strict";function n(e){if(0===e)return"0 B";let l=Math.floor(Math.log(e)/Math.log(1024)),t=e/Math.pow(1024,l);return"".concat(t.toFixed(+(0!==l))," ").concat(["B","KB","MB","GB","TB"][l])}function a(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===l?"Never":"从未";let t=Math.floor(Math.floor((Date.now()-e)/1e3)/60),n=Math.floor(t/60),a=Math.floor(n/24);return a>30?new Date(e).toLocaleDateString(l):"en-US"===l?a>0?"".concat(a,"d ago"):n>0?"".concat(n,"h ago"):t>0?"".concat(t,"m ago"):"Just now":a>0?"".concat(a," 天前"):n>0?"".concat(n," 小时前"):t>0?"".concat(t," 分钟前"):"刚刚"}t.d(l,{Jm:()=>o,fw:()=>a,z3:()=>n});let r={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},s={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function o(e){var l;let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(l=("en-US"===t?s:r)[e])?l:e}},50423:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>E});var n=t(65321),a=t(97109),r=t(34986),s=t(48321),o=t(17807),c=t(33442),i=t(85114),d=t(2256),u=t(38770),h=t(68787),x=t(54849),g=t(57271),m=t(76506),j=t(11702),A=t(7225),f=t(30486),w=t(99811),v=t(56768),k=t(26619),p=t(93314),y=t(58740),b=t(35459),C=t(23216),S=t(63663),z=t(49484),D=t(6578),N=t(45551);let _=["document","spreadsheet","image","cad","code","data","web","diagram","archive","other"];function E(){var e,l,t,E;let I=(0,s.Vr)(),{locale:T}=(0,s.x_)(),M=(0,r.useRouter)(),{stats:B,loading:F,reload:R}=function(){let[e,l]=(0,a.useState)(null),[t,n]=(0,a.useState)(!1),r=(0,a.useCallback)(async()=>{n(!0);try{l(await (0,D.hc)())}catch(e){}finally{n(!1)}},[]);return(0,a.useEffect)(()=>{r()},[r]),{stats:e,loading:t,reload:r}}(),O=function(){let[e,l]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(0,D.VW)().then(l).catch(()=>{})},[]),e}(),{reindexing:P,reindex:J}=function(){let[e,l]=(0,a.useState)(!1);return{reindexing:e,reindex:(0,a.useCallback)(async()=>{l(!0);try{return await (0,D.H1)(),!0}catch(e){return!1}finally{l(!1)}},[])}}(),[U,V]=(0,a.useState)("document"),[W,H]=(0,a.useState)({count:0,totalSize:0,totalChunks:0}),{message:X}=o.A.useApp(),G=(0,a.useCallback)(async e=>{try{let l=await (0,D.HT)({category:e,limit:1e4}),t=0,n=0;if(Array.isArray(l.files))for(let e of l.files)t+=e.fileSize||0,n+=e.chunkCount||0;H({count:l.total||0,totalSize:t,totalChunks:n})}catch(e){H({count:0,totalSize:0,totalChunks:0})}},[]);(0,a.useEffect)(()=>{G(U)},[U,G]);let K=async()=>{await J()?await Promise.all([R(),G(U)]):X.error(I("common.error"))};return(0,n.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"pageTitle",children:I("knowledge.manageTitle")}),(0,n.jsx)("p",{className:"pageDesc",children:I("knowledge.manageDesc")})]}),(0,n.jsxs)(c.A,{children:[(0,n.jsx)(i.Ay,{icon:(0,n.jsx)(A.A,{}),onClick:()=>M.push("/knowledge/files"),children:I("knowledge.files")}),(0,n.jsx)(i.Ay,{icon:(0,n.jsx)(f.A,{}),onClick:()=>M.push("/knowledge/search"),children:I("knowledge.search")}),(0,n.jsx)(i.Ay,{icon:(0,n.jsx)(w.A,{}),loading:P,onClick:()=>{K()},children:I("knowledge.reindex")})]})]}),(0,n.jsx)(d.A,{gutter:[16,16],children:[{icon:(0,n.jsx)(v.A,{}),label:I("knowledge.totalFiles"),value:null!=(l=null==B?void 0:B.fileCount)?l:0},{icon:(0,n.jsx)(k.A,{}),label:I("knowledge.totalChunks"),value:null!=(t=null==B?void 0:B.chunkCount)?t:0},{icon:(0,n.jsx)(p.A,{}),label:I("knowledge.totalSize"),value:(0,N.z3)(null!=(E=null==B?void 0:B.totalSizeBytes)?E:0)},{icon:(0,n.jsx)(y.A,{}),label:I("knowledge.lastIndexed"),value:(null==B?void 0:B.lastIndexedAt)?(0,N.fw)(B.lastIndexedAt,T):I("common.never")}].map((e,l)=>(0,n.jsx)(u.A,{xs:12,sm:6,children:(0,n.jsx)(h.A,{size:"small",loading:F&&!B,children:(0,n.jsx)(x.A,{title:e.label,value:e.value,prefix:e.icon})})},l))}),(0,n.jsxs)(h.A,{title:I("knowledge.categories"),size:"small",children:[(0,n.jsx)(g.A,{value:U,onChange:e=>V(e),options:_.map(e=>({label:(0,N.Jm)(e,T),value:e})),style:{width:160,marginBottom:16}}),(0,n.jsxs)(d.A,{gutter:[16,16],children:[(0,n.jsx)(u.A,{xs:12,sm:6,children:(0,n.jsx)(x.A,{title:I("knowledge.fileCount"),value:W.count,prefix:(0,n.jsx)(v.A,{style:{color:"var(--colorAccent)"}})})}),(0,n.jsx)(u.A,{xs:12,sm:6,children:(0,n.jsx)(x.A,{title:I("knowledge.totalSize"),value:(0,N.z3)(W.totalSize),prefix:(0,n.jsx)(p.A,{style:{color:"var(--colorWarning)"}})})}),(0,n.jsx)(u.A,{xs:12,sm:6,children:(0,n.jsx)(x.A,{title:"切片数",value:W.totalChunks,prefix:(0,n.jsx)(b.A,{style:{color:"var(--colorOk)"}})})}),(0,n.jsx)(u.A,{xs:12,sm:6,children:(0,n.jsx)(x.A,{title:"平均大小",value:W.count>0?(0,N.z3)(W.totalSize/W.count):"—",prefix:(0,n.jsx)(k.A,{style:{color:"var(--colorDanger)"}})})})]})]}),O&&(0,n.jsx)(h.A,{title:I("knowledge.features"),size:"small",children:(0,n.jsxs)(m.A,{size:"small",column:{xs:1,sm:2},bordered:!0,children:[(0,n.jsx)(m.A.Item,{label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(C.A,{style:{marginRight:4}}),"Vector Store"]}),children:(0,n.jsx)(j.A,{color:"blue",children:O.vectorStore})}),(0,n.jsx)(m.A.Item,{label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b.A,{style:{marginRight:4}}),"Embedding"]}),children:(0,n.jsx)(j.A,{color:"purple",children:O.embeddingProvider})}),(0,n.jsxs)(m.A.Item,{label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(S.A,{style:{marginRight:4}}),I("knowledge.featureDedup")]}),children:[(0,n.jsx)(j.A,{color:"green",children:O.dedupEngine}),(0,n.jsx)("div",{className:"text-xs",style:{color:"var(--colorTextSecondary)",marginTop:2},children:I("knowledge.featureDedupDesc")})]}),(0,n.jsxs)(m.A.Item,{label:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(z.A,{style:{marginRight:4}}),I("knowledge.featureChunker")]}),children:[(0,n.jsx)(j.A,{color:"orange",children:O.chunker}),(0,n.jsx)("div",{className:"text-xs",style:{color:"var(--colorTextSecondary)",marginTop:2},children:I("knowledge.featureChunkerDesc")})]}),(null==(e=O.builtinExtractors)?void 0:e.length)>0&&(0,n.jsx)(m.A.Item,{label:"内置提取器",span:2,children:(0,n.jsx)(c.A,{wrap:!0,children:O.builtinExtractors.map(e=>(0,n.jsx)(j.A,{color:"cyan",children:e},e))})})]})})]})}},54178:(e,l,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/manage",function(){return t(50423)}])}},e=>{e.O(0,[433,787,506,788,636,593,792],()=>e(e.s=54178)),_N_E=e.O()}]);