@customize-agent/server 4.0.95 → 4.0.97

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 (88) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +52 -79
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/routes-manifest.json +0 -6
  5. package/.next/server/chunks/1928.js +1 -1
  6. package/.next/server/chunks/1936.js +1 -1
  7. package/.next/server/chunks/8204.js +1 -1
  8. package/.next/server/middleware-build-manifest.js +1 -1
  9. package/.next/server/pages/404.html +1 -1
  10. package/.next/server/pages/500.html +1 -1
  11. package/.next/server/pages/_app.js +1 -1
  12. package/.next/server/pages/_app.js.nft.json +1 -1
  13. package/.next/server/pages/_error.js +1 -1
  14. package/.next/server/pages/_error.js.nft.json +1 -1
  15. package/.next/server/pages/asset-library.html +1 -1
  16. package/.next/server/pages/document-roles.html +1 -1
  17. package/.next/server/pages/documents.html +1 -1
  18. package/.next/server/pages/guide.html +1 -1
  19. package/.next/server/pages/index.html +1 -1
  20. package/.next/server/pages/index.js.nft.json +1 -1
  21. package/.next/server/pages/knowledge/file-detail.html +1 -1
  22. package/.next/server/pages/knowledge/files.html +1 -1
  23. package/.next/server/pages/knowledge/manage.html +1 -1
  24. package/.next/server/pages/knowledge.html +1 -1
  25. package/.next/server/pages/models.html +1 -1
  26. package/.next/server/pages/overview.html +1 -1
  27. package/.next/server/pages/prompt.html +1 -1
  28. package/.next/server/pages/settings.html +1 -1
  29. package/.next/server/pages/system/logs.html +1 -1
  30. package/.next/server/pages-manifest.json +22 -23
  31. package/.next/static/023mfOogIrGGOivjQt58T/_buildManifest.js +1 -0
  32. package/.next/static/chunks/337-b06909f6d29f6d1f.js +1 -0
  33. package/.next/static/chunks/371-291e96a3ec471950.js +6 -0
  34. package/.next/static/chunks/375-1e1be370b94c7512.js +1 -0
  35. package/.next/static/chunks/478-ac4777b05b3c42e8.js +1 -0
  36. package/.next/static/chunks/63-dd8eeb8edd766bae.js +4 -0
  37. package/.next/static/chunks/726-835aceca52ec904a.js +1 -0
  38. package/.next/static/chunks/788-72bd97a04f2aee27.js +1 -0
  39. package/.next/static/chunks/795-ed2375ec938022d8.js +1 -0
  40. package/.next/static/chunks/850-0f48354694fc6b3e.js +1 -0
  41. package/.next/static/chunks/pages/{_app-d0d7f3a02373fa7e.js → _app-d98d9d52c6257579.js} +17 -17
  42. package/.next/static/chunks/pages/{asset-library-c744f6c91b24629f.js → asset-library-b76abaab31043cdb.js} +1 -1
  43. package/.next/static/chunks/pages/document-roles-edefc9a1752155f1.js +1 -0
  44. package/.next/static/chunks/pages/documents-cccd60ddbf3d8401.js +1 -0
  45. package/.next/static/chunks/pages/{guide-e00b6e23a8dd41b3.js → guide-40908b2721e92d01.js} +1 -1
  46. package/.next/static/chunks/pages/{index-a2a24e9602e7ea52.js → index-9df5670a1487dbb1.js} +1 -1
  47. package/.next/static/chunks/pages/knowledge/file-detail-8c37a455e6cc010f.js +1 -0
  48. package/.next/static/chunks/pages/knowledge/files-ebe54cb8a7886df1.js +1 -0
  49. package/.next/static/chunks/pages/knowledge/manage-1363f53928abf98c.js +1 -0
  50. package/.next/static/chunks/pages/models-8883cd27c251e4ae.js +1 -0
  51. package/.next/static/chunks/pages/{overview-1260176045ed5f7a.js → overview-63f3dda2dde16c9e.js} +1 -1
  52. package/.next/static/chunks/pages/prompt-5adc3ca18a2764f4.js +1 -0
  53. package/.next/static/chunks/pages/settings-810eb1a6cf1a6b02.js +1 -0
  54. package/.next/static/chunks/pages/system/logs-1b77471f6db59846.js +1 -0
  55. package/.next/static/chunks/webpack-4224e970a97a4a86.js +1 -0
  56. package/.next/static/css/20743781fa68bc70.css +1 -0
  57. package/messages/en-US.json +127 -3
  58. package/messages/zh-CN.json +128 -3
  59. package/package.json +4 -2
  60. package/postcss.config.mjs +3 -1
  61. package/scripts/start-server.cjs +5 -0
  62. package/.next/server/pages/knowledge/search.html +0 -1
  63. package/.next/server/pages/knowledge/search.js.nft.json +0 -1
  64. package/.next/static/3nHhxjRVb6Sv1RCvTTJ6o/_buildManifest.js +0 -1
  65. package/.next/static/chunks/192-dee7faefaf840b17.js +0 -1
  66. package/.next/static/chunks/238-4ad320af4f787bd6.js +0 -1
  67. package/.next/static/chunks/375-4a1c73eb22d653d2.js +0 -1
  68. package/.next/static/chunks/525-5d947137d894f5fe.js +0 -1
  69. package/.next/static/chunks/621-1c48b0d6d904f023.js +0 -4
  70. package/.next/static/chunks/694-2d545cfbb9779f2c.js +0 -1
  71. package/.next/static/chunks/788-7f7359a830e3f4fd.js +0 -1
  72. package/.next/static/chunks/795-e8cfd56df2293576.js +0 -1
  73. package/.next/static/chunks/797-9166f495bb6138e3.js +0 -6
  74. package/.next/static/chunks/861-91cbdd34b8e23151.js +0 -1
  75. package/.next/static/chunks/938-45efd516bb130bd5.js +0 -1
  76. package/.next/static/chunks/pages/document-roles-5108efe16c9b0dd0.js +0 -1
  77. package/.next/static/chunks/pages/documents-1fad70e8cff2eff9.js +0 -1
  78. package/.next/static/chunks/pages/knowledge/file-detail-44e52d9e351e8784.js +0 -1
  79. package/.next/static/chunks/pages/knowledge/files-4f7bacb11528982e.js +0 -1
  80. package/.next/static/chunks/pages/knowledge/manage-205647551376b193.js +0 -1
  81. package/.next/static/chunks/pages/knowledge/search-577f08171a786578.js +0 -1
  82. package/.next/static/chunks/pages/models-47a9542ac5bec5c0.js +0 -1
  83. package/.next/static/chunks/pages/prompt-aad4329e419fb442.js +0 -1
  84. package/.next/static/chunks/pages/settings-78d0d5322fd61afe.js +0 -1
  85. package/.next/static/chunks/pages/system/logs-c97311a24d1a67e1.js +0 -1
  86. package/.next/static/chunks/webpack-77d10b4726f13aa5.js +0 -1
  87. package/.next/static/css/38dba0a7a42a8df3.css +0 -1
  88. /package/.next/static/{3nHhxjRVb6Sv1RCvTTJ6o → 023mfOogIrGGOivjQt58T}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[309],{1873:(e,t,l)=>{e.exports=l(91952)},4632:(e,t)=>{"use strict";function l(e){var t;let{config:l,src:n,width:r,quality:i}=e,a=i||(null==(t=l.qualities)?void 0:t.reduce((e,t)=>Math.abs(t-75)<Math.abs(e-75)?t:e))||75;return l.path+"?url="+encodeURIComponent(n)+"&w="+r+"&q="+a+(n.startsWith("/_next/static/media/"),"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n}}),l.__next_img_default=!0;let n=l},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"}},37690:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/file-detail",function(){return l(70107)}])},45551:(e,t,l)=>{"use strict";function n(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),l=e/Math.pow(1024,t);return"".concat(l.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let l=Math.floor(Math.floor((Date.now()-e)/1e3)/60),n=Math.floor(l/60),r=Math.floor(n/24);return r>30?new Date(e).toLocaleDateString(t):"en-US"===t?r>0?"".concat(r,"d ago"):n>0?"".concat(n,"h ago"):l>0?"".concat(l,"m ago"):"Just now":r>0?"".concat(r," 天前"):n>0?"".concat(n," 小时前"):l>0?"".concat(l," 分钟前"):"刚刚"}l.d(t,{Jm:()=>s,fw:()=>r,z3:()=>n});let i={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},a={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function s(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===l?a:i)[e])?t:e}},49952:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return w}});let n=l(34007),r=l(26908),i=l(65321),a=r._(l(97109)),s=n._(l(61222)),o=n._(l(64041)),c=l(62956),d=l(83149),u=l(65059);l(28965);let h=l(99318),m=n._(l(4632)),g=l(47503),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function f(e,t,l,n,r,i,a){let s=null==e?void 0:e.src;e&&e["data-loaded-src"]!==s&&(e["data-loaded-src"]=s,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&r(!0),null==l?void 0:l.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,r=!1;l.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>r,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{r=!0,t.stopPropagation()}})}(null==n?void 0:n.current)&&n.current(e)}}))}function y(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}let _=(0,a.forwardRef)((e,t)=>{let{src:l,srcSet:n,sizes:r,height:s,width:o,decoding:c,className:d,style:u,fetchPriority:h,placeholder:m,loading:p,unoptimized:_,fill:x,onLoadRef:w,onLoadingCompleteRef:v,setBlurComplete:j,setShowAltText:b,sizesInput:C,onLoad:A,onError:S,...P}=e,k=(0,a.useCallback)(e=>{e&&(S&&(e.src=e.src),e.complete&&f(e,m,w,v,j,_,C))},[l,m,w,v,j,S,_,C]),R=(0,g.useMergedRef)(t,k);return(0,i.jsx)("img",{...P,...y(h),loading:p,width:o,height:s,decoding:c,"data-nimg":x?"fill":"1",className:d,style:u,sizes:r,srcSet:n,src:l,ref:R,onLoad:e=>{f(e.currentTarget,m,w,v,j,_,C)},onError:e=>{b(!0),"empty"!==m&&j(!0),S&&S(e)}})});function x(e){let{isAppRouter:t,imgAttributes:l}=e,n={as:"image",imageSrcSet:l.srcSet,imageSizes:l.sizes,crossOrigin:l.crossOrigin,referrerPolicy:l.referrerPolicy,...y(l.fetchPriority)};return t&&s.default.preload?(s.default.preload(l.src,n),null):(0,i.jsx)(o.default,{children:(0,i.jsx)("link",{rel:"preload",href:l.srcSet?void 0:l.src,...n},"__nimg-"+l.src+l.srcSet+l.sizes)})}let w=(0,a.forwardRef)((e,t)=>{let l=(0,a.useContext)(h.RouterContext),n=(0,a.useContext)(u.ImageConfigContext),r=(0,a.useMemo)(()=>{var e;let t=p||n||d.imageConfigDefault,l=[...t.deviceSizes,...t.imageSizes].sort((e,t)=>e-t),r=t.deviceSizes.sort((e,t)=>e-t),i=null==(e=t.qualities)?void 0:e.sort((e,t)=>e-t);return{...t,allSizes:l,deviceSizes:r,qualities:i}},[n]),{onLoad:s,onLoadingComplete:o}=e,g=(0,a.useRef)(s);(0,a.useEffect)(()=>{g.current=s},[s]);let f=(0,a.useRef)(o);(0,a.useEffect)(()=>{f.current=o},[o]);let[y,w]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1),{props:b,meta:C}=(0,c.getImgProps)(e,{defaultLoader:m.default,imgConf:r,blurComplete:y,showAltText:v});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_,{...b,unoptimized:C.unoptimized,placeholder:C.placeholder,fill:C.fill,onLoadRef:g,onLoadingCompleteRef:f,setBlurComplete:w,setShowAltText:j,sizesInput:e.sizes,ref:t}),C.priority?(0,i.jsx)(x,{isAppRouter:!l,imgAttributes:b}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},58970:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"arrow-left",theme:"outlined"}},62956:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return o}}),l(28965);let n=l(65545),r=l(83149),i=["-moz-initial","fill","none","scale-down",void 0];function a(e){return void 0!==e.default}function s(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function o(e,t){var l,o;let c,d,u,{src:h,sizes:m,unoptimized:g=!1,priority:p=!1,loading:f,className:y,quality:_,width:x,height:w,fill:v=!1,style:j,overrideSrc:b,onLoad:C,onLoadingComplete:A,placeholder:S="empty",blurDataURL:P,fetchPriority:k,decoding:R="async",layout:I,objectFit:z,objectPosition:O,lazyBoundary:E,lazyRoot:N,...M}=e,{imgConf:D,showAltText:L,blurComplete:F,defaultLoader:T}=t,B=D||r.imageConfigDefault;if("allSizes"in B)c=B;else{let e=[...B.deviceSizes,...B.imageSizes].sort((e,t)=>e-t),t=B.deviceSizes.sort((e,t)=>e-t),n=null==(l=B.qualities)?void 0:l.sort((e,t)=>e-t);c={...B,allSizes:e,deviceSizes:t,qualities:n}}if(void 0===T)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let J=M.loader||T;delete M.loader,delete M.srcSet;let V="__next_img_default"in J;if(V){if("custom"===c.loader)throw Object.defineProperty(Error('Image with src "'+h+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader'),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=J;J=t=>{let{config:l,...n}=t;return e(n)}}if(I){"fill"===I&&(v=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[I];e&&(j={...j,...e});let t={responsive:"100vw",fill:"100vw"}[I];t&&!m&&(m=t)}let H="",K=s(x),G=s(w);if((o=h)&&"object"==typeof o&&(a(o)||void 0!==o.src)){let e=a(h)?h.default:h;if(!e.src)throw Object.defineProperty(Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e)),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!e.height||!e.width)throw Object.defineProperty(Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e)),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(d=e.blurWidth,u=e.blurHeight,P=P||e.blurDataURL,H=e.src,!v)if(K||G){if(K&&!G){let t=K/e.width;G=Math.round(e.height*t)}else if(!K&&G){let t=G/e.height;K=Math.round(e.width*t)}}else K=e.width,G=e.height}let W=!p&&("lazy"===f||void 0===f);(!(h="string"==typeof h?h:H)||h.startsWith("data:")||h.startsWith("blob:"))&&(g=!0,W=!1),c.unoptimized&&(g=!0),V&&!c.dangerouslyAllowSVG&&h.split("?",1)[0].endsWith(".svg")&&(g=!0);let U=s(_),X=Object.assign(v?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:z,objectPosition:O}:{},L?{}:{color:"transparent"},j),q=F||"empty"===S?null:"blur"===S?'url("data:image/svg+xml;charset=utf-8,'+(0,n.getImageBlurSvg)({widthInt:K,heightInt:G,blurWidth:d,blurHeight:u,blurDataURL:P||"",objectFit:X.objectFit})+'")':'url("'+S+'")',$=i.includes(X.objectFit)?"fill"===X.objectFit?"100% 100%":"cover":X.objectFit,Y=q?{backgroundSize:$,backgroundPosition:X.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:q}:{},Z=function(e){let{config:t,src:l,unoptimized:n,width:r,quality:i,sizes:a,loader:s}=e;if(n)return{src:l,srcSet:void 0,sizes:void 0};let{widths:o,kind:c}=function(e,t,l){let{deviceSizes:n,allSizes:r}=e;if(l){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let n;n=e.exec(l);)t.push(parseInt(n[2]));if(t.length){let e=.01*Math.min(...t);return{widths:r.filter(t=>t>=n[0]*e),kind:"w"}}return{widths:r,kind:"w"}}return"number"!=typeof t?{widths:n,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>r.find(t=>t>=e)||r[r.length-1]))],kind:"x"}}(t,r,a),d=o.length-1;return{sizes:a||"w"!==c?a:"100vw",srcSet:o.map((e,n)=>s({config:t,src:l,quality:i,width:e})+" "+("w"===c?e:n+1)+c).join(", "),src:s({config:t,src:l,quality:i,width:o[d]})}}({config:c,src:h,unoptimized:g,width:K,quality:U,sizes:m,loader:J});return{props:{...M,loading:W?"lazy":f,fetchPriority:k,width:K,height:G,decoding:R,className:y,style:{...X,...Y},sizes:Z.sizes,srcSet:Z.srcSet,src:b||Z.src},meta:{unoptimized:g,priority:p,placeholder:S,fill:v}}}},65545:(e,t)=>{"use strict";function l(e){let{widthInt:t,heightInt:l,blurWidth:n,blurHeight:r,blurDataURL:i,objectFit:a}=e,s=n?40*n:t,o=r?40*r:l,c=s&&o?"viewBox='0 0 "+s+" "+o+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+c+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(c?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+i+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return l}})},70107:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>F});var n=l(65321),r=l(97109),i=l(1873),a=l.n(i),s=l(86109),o=l(35292),c=l(76506),d=l(33442),u=l(11702),h=l(9137),m=l(21289),g=l(68787),p=l(56985),f=l(49604),y=l(88762),_=l(85493),x=l(84253),w=l(85114),v=l(58569),j=l(7576),b=l(58970),C=l(88483);function A(){return(A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(this,arguments)}let S=r.forwardRef((e,t)=>r.createElement(C.A,A({},e,{ref:t,icon:b.A})));var P=l(6578),k=l(44494),R=l(45551),I=l(14569),z=l.n(I);let{Paragraph:O}=o.A;function E(e){if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}function N(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e).slice(0,30):[]}function M(e,t){let l=t.trim()?[t.trim(),...t.split(/[\s,,。;;::、]+/u)].filter(Boolean).sort((e,t)=>t.length-e.length):[];if(0===l.length)return e;let r=RegExp("(".concat(l.map(e=>e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join("|"),")"),"giu");return e.split(r).map((e,t)=>l.some(t=>t.toLowerCase()===e.toLowerCase())?(0,n.jsx)("mark",{children:e},t):e)}function D(e,t,l){return null==t||""===t||Array.isArray(t)&&0===t.length?null:(0,n.jsx)(c.A.Item,{label:e,children:Array.isArray(t)?(0,n.jsx)(d.A,{wrap:!0,children:t.map(e=>(0,n.jsx)(u.A,{className:"cursor-pointer",onClick:()=>null==l?void 0:l(String(e)),children:String(e)},String(e)))}):String(t)})}function L(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"value";return e.map((e,l)=>({key:"".concat(t,"-").concat(l),name:e}))}function F(){var e,t,l,i,o;let b=(0,k.Vr)(),C=(0,s.useRouter)(),A="string"==typeof C.query.relativePath?C.query.relativePath:"",[I,F]=(0,r.useState)(),[T,B]=(0,r.useState)(!1),[J,V]=(0,r.useState)(""),[H,K]=(0,r.useState)(!1),[G,W]=(0,r.useState)(""),[U,X]=(0,r.useState)([]);(0,r.useEffect)(()=>{A&&(B(!0),V(""),(0,P.xC)(A).then(F).catch(e=>{F(void 0),V(e instanceof Error?e.message:"文件详情加载失败")}).finally(()=>B(!1)))},[A]);let q=(0,r.useMemo)(()=>(function(e){let t=E(null==e?void 0:e.file.metadataJson);return"object"==typeof t.extraction&&t.extraction?t.extraction:t})(I),[I]),$=N(q.layerNames);(0,r.useEffect)(()=>{X($)},[null==I?void 0:I.file.relativePath,$.join("|")]);let Y=G.trim().toLowerCase(),Z=(0,r.useMemo)(()=>{var e;return I&&Y?I.chunks.filter(e=>{let t=E(e.metadataJson);return[e.content,e.sectionTitle,t.rowRange,t.chunkKind,t.parentId,JSON.stringify(t)].some(e=>String(null!=e?e:"").toLowerCase().includes(Y))}):null!=(e=null==I?void 0:I.chunks)?e:[]},[I,Y]),Q=(0,r.useMemo)(()=>{var e;return I&&Y?I.parents.filter(e=>[e.content,e.sectionTitle,e.parentId,e.metadataJson].some(e=>String(null!=e?e:"").toLowerCase().includes(Y))):null!=(e=null==I?void 0:I.parents)?e:[]},[I,Y]),ee=async()=>{if(A){K(!0);try{let e=await (0,P.HC)(A);e.detail&&F(e.detail),h.Ay.success("文件索引已重建")}finally{K(!1)}}},et=async e=>{e&&(await navigator.clipboard.writeText(e),h.Ay.success("已复制"))},el=async e=>{A&&(await (0,P.tn)(A,e),h.Ay.success("file"===e?"已请求打开文件":"已请求打开目录"))},en=(0,r.useMemo)(()=>{var e,t,l,r,i,s;let o=[],h=N(q.sheetNames),y=N(q.columnNames),_=N(q.layerNames),x=N(q.blockNames),w=N(q.entityTypes),v=N(q.productNames),j=N(q.materialNames),b=N(q.entityNames),C=N(q.dataPaths),A=h.length>0||y.length>0||null!=q.rowCount||null!=q.columnCount||null!=q.formulaCount||null!=q.mergeCount,S=L(y,"column"),P=(null!=(e=null==I?void 0:I.chunks)?e:[]).map(e=>E(e.metadataJson).rowRange).filter(e=>"string"==typeof e).map((e,t)=>({key:"row-".concat(t),name:e})),k=(null!=(t=null==I?void 0:I.chunks)?t:[]).flatMap(e=>e.content.split(/\r?\n/u)).map(e=>e.trim()).filter(e=>e.includes("|")).slice(0,80).map((e,t)=>({key:"grid-".concat(t),cells:e.split("|").map(e=>e.trim()).filter(Boolean)}));(A||S.length>0||P.length>0||k.length>0)&&o.push({key:"table",label:"表格",children:(0,n.jsxs)(d.A,{direction:"vertical",className:"w-full",children:[A&&(0,n.jsxs)(c.A,{size:"small",column:2,bordered:!0,children:[D("Sheet",h,W),D("表头",y,W),D("行数",q.rowCount),D("列数",q.columnCount),D("公式数",q.formulaCount),D("合并单元格",q.mergeCount)]}),S.length>0&&(0,n.jsx)(m.A,{size:"small",pagination:!1,rowKey:"key",dataSource:S,columns:[{title:"列名",dataIndex:"name",render:e=>(0,n.jsx)(u.A,{className:"cursor-pointer",onClick:()=>W(String(e)),children:String(e)})}]}),P.length>0&&(0,n.jsx)(m.A,{size:"small",pagination:!1,rowKey:"key",dataSource:P,columns:[{title:"行范围",dataIndex:"name",render:e=>(0,n.jsxs)(u.A,{color:"gold",className:"cursor-pointer",onClick:()=>W(String(e)),children:["行 ",String(e)]})}]}),k.length>0&&(0,n.jsx)(m.A,{size:"small",rowKey:"key",dataSource:k,pagination:{pageSize:10},columns:[{title:"表格网格预览",dataIndex:"cells",render:e=>(0,n.jsx)(d.A,{wrap:!0,children:e.map((e,t)=>(0,n.jsx)(u.A,{children:e},"".concat(e,"-").concat(t)))})}]})]})});let R=_.length>0||x.length>0||w.length>0||v.length>0||j.length>0||b.length>0,M=[...L(_,"layer").map(e=>({...e,type:"图层"})),...L(w,"entity").map(e=>({...e,type:"实体类型"})),...L(x,"block").map(e=>({...e,type:"块/符号"}))];(R||_.length>0||M.length>0)&&o.push({key:"drawing",label:"图纸",children:(0,n.jsxs)(d.A,{direction:"vertical",className:"w-full",children:[R&&(0,n.jsxs)(c.A,{size:"small",column:2,bordered:!0,children:[D("图层",_,W),D("块/符号",x,W),D("实体类型",w,W),D("产品/零件",v,W),D("材料",j,W),D("实体名称",b,W)]}),_.length>0&&(0,n.jsxs)(g.A,{size:"small",title:"图层开关 / 图纸预览",children:[(0,n.jsx)(p.A.Group,{value:U,options:_.map(e=>({label:e,value:e})),onChange:e=>X(e.map(String))}),(0,n.jsx)("div",{className:z().drawingPreview,children:U.map(e=>(0,n.jsx)(u.A,{color:"blue",children:e},e))})]}),M.length>0&&(0,n.jsx)(m.A,{size:"small",pagination:!1,rowKey:"key",dataSource:M,columns:[{title:"类型",dataIndex:"type",width:120},{title:"名称",dataIndex:"name",render:e=>(0,n.jsx)(u.A,{className:"cursor-pointer",onClick:()=>W(String(e)),children:String(e)})}]})]})});let F=(null!=(l=null==I?void 0:I.chunks)?l:[]).flatMap(e=>e.content.split(/\r?\n/u)).map(e=>e.trim()).filter(e=>/^[\w.[\]-]+\s*[:=]/u.test(e)).slice(0,200).map((e,t)=>{var l,n,r,i;let a=/^([^:=]+)\s*[:=]\s*(.*)$/u.exec(e);return{key:"data-".concat(t),path:null!=(r=null==a||null==(l=a[1])?void 0:l.trim())?r:e,value:null!=(i=null==a||null==(n=a[2])?void 0:n.trim())?i:""}});(C.length>0||F.length>0)&&o.push({key:"data",label:"数据路径",children:(0,n.jsxs)(d.A,{direction:"vertical",className:"w-full",children:[C.length>0&&(0,n.jsx)(f.A,{defaultExpandAll:!0,treeData:function(e){let t=new Map;for(let l of e){let e=t;for(let t of l.replace(/\[(\d+)\]/gu,".$1").split(".").filter(Boolean))e.has(t)||e.set(t,new Map),e=e.get(t)}let l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return[...e.entries()].map(e=>{let[n,r]=e;return{title:n,key:t?"".concat(t,".").concat(n):n,children:l(r,t?"".concat(t,".").concat(n):n)}})};return l(t)}(C),onSelect:e=>{var t;return W(String(null!=(t=e[0])?t:""))}}),F.length>0&&(0,n.jsx)(m.A,{size:"small",rowKey:"key",dataSource:F,pagination:{pageSize:20},columns:[{title:"Path",dataIndex:"path",width:260,render:e=>(0,n.jsx)(u.A,{className:"cursor-pointer",onClick:()=>W(String(e)),children:String(e)})},{title:"Value",dataIndex:"value",render:e=>(0,n.jsx)("span",{className:"break-all",children:String(e)})}]})]})});let T=[q.ocrRecommended,q.ocrReason,q.ocrProvider,q.ocrLanguages,q.ocrTextLength,q.pdfPageOcrSupported,q.ocrPageCount,q.pdfOcrPageLimit,q.pdfRenderer,q.pdfPageCount,q.textPages,q.ocrAugmented,q.ocrPages,q.failedPages,q.imagePreprocessor].some(e=>null!=e),B=(null!=(r=null==I?void 0:I.chunks)?r:[]).map(e=>e.content).join("\n\n").split(/PDF OCR 第\s*(\d+)\s*页[::]/u).slice(1).reduce((e,t,l,n)=>{var r,i,a;return l%2==0&&e.push({key:"page-".concat(t),page:t,text:null!=(a=null==(i=n[l+1])||null==(r=i.split(/PDF OCR 第\s*\d+\s*页[::]/u)[0])?void 0:r.trim())?a:""}),e},[]),J=(null==I?void 0:I.file.format)==="pdf";return(T||J||B.length>0)&&o.push({key:"ocr",label:"OCR/PDF",children:(0,n.jsxs)(d.A,{direction:"vertical",className:"w-full",children:[T&&(0,n.jsxs)(c.A,{size:"small",column:2,bordered:!0,children:[D("OCR 建议",q.ocrRecommended),D("OCR 原因",q.ocrReason),D("OCR 引擎",q.ocrProvider),D("OCR 语言",q.ocrLanguages),D("OCR 文本长度",q.ocrTextLength),D("PDF 总页数",q.pdfPageCount),D("PDF 文本页数",q.textPages),D("PDF 已 OCR 增强",q.ocrAugmented),D("PDF OCR 页码",Array.isArray(q.ocrPages)?q.ocrPages.join(", "):q.ocrPages),D("PDF 失败页",Array.isArray(q.failedPages)?q.failedPages.map(e=>JSON.stringify(e)).join("; "):q.failedPages),D("PDF 页面 OCR 支持",q.pdfPageOcrSupported),D("PDF OCR 页数",q.ocrPageCount),D("PDF OCR 页数上限",q.pdfOcrPageLimit),D("PDF 渲染器",q.pdfRenderer),D("图像预处理",q.imagePreprocessor)]}),J&&(0,n.jsx)("div",{className:z().pdfPreviewStrip,children:Array.from({length:Math.min(Number(null!=(s=null!=(i=q.pdfPageCount)?i:q.ocrPageCount)?s:1)||1,6)},(e,t)=>(0,n.jsx)(a(),{width:220,height:320,src:"/api/kb/files/preview-pdf-page?relativePath=".concat(encodeURIComponent(I.file.relativePath),"&page=").concat(t+1),alt:"PDF 第 ".concat(t+1," 页"),unoptimized:!0},t))}),B.length>0&&(0,n.jsx)(m.A,{size:"small",rowKey:"key",dataSource:B,pagination:{pageSize:10},columns:[{title:"页码",dataIndex:"page",width:90},{title:"OCR 文本",dataIndex:"text",render:e=>(0,n.jsx)(O,{ellipsis:{rows:4,expandable:!0,symbol:"展开"},children:String(e)})}]})]})}),o},[q,I,U]),er=[{title:"序号",key:"index",width:70,render:(e,t,l)=>l+1},{title:b("knowledge.chunkIndex"),dataIndex:"chunkIndex",width:90,render:e=>String(e)},{title:b("knowledge.chunkType"),width:110,render:(e,t)=>{var l;return(0,n.jsx)(u.A,{children:String(null!=(l=E(t.metadataJson).chunkKind)?l:t.category)})}},{title:b("knowledge.sectionOrRange"),width:220,render:(e,t)=>{let l=E(t.metadataJson),r="string"==typeof l.rowRange?l.rowRange:void 0;return(0,n.jsxs)(d.A,{wrap:!0,children:[t.sectionTitle?(0,n.jsx)(u.A,{color:"cyan",children:t.sectionTitle}):null,r?(0,n.jsxs)(u.A,{color:"gold",children:["行 ",r]}):null]})}},{title:"Token",dataIndex:"tokenCount",width:90},{title:b("knowledge.chunkContent"),render:(e,t)=>(0,n.jsx)(O,{ellipsis:{rows:3,expandable:!0,symbol:"展开"},className:z().searchContent,children:M(t.content,G)})}],ei=[{title:"序号",key:"index",width:70,render:(e,t,l)=>l+1},{title:b("knowledge.parentChunkId"),dataIndex:"parentId",width:260,render:e=>(0,n.jsx)("span",{className:"break-all",children:e})},{title:"切片数",dataIndex:"chunkCount",width:90},{title:"章节",dataIndex:"sectionTitle",width:220},{title:b("knowledge.chunkContent"),render:(e,t)=>(0,n.jsx)(O,{ellipsis:{rows:3,expandable:!0,symbol:"展开"},className:z().searchContent,children:M(t.content,G)})}];return T?(0,n.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,n.jsx)(y.A,{active:!0,paragraph:{rows:1}}),(0,n.jsx)(g.A,{size:"small",children:(0,n.jsx)(y.A,{active:!0,paragraph:{rows:6}})}),(0,n.jsx)(g.A,{size:"small",children:(0,n.jsx)(y.A,{active:!0,paragraph:{rows:4}})})]}):J?(0,n.jsx)(_.A,{type:"error",showIcon:!0,message:"文件详情加载失败",description:J}):I?(0,n.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(w.Ay,{icon:(0,n.jsx)(S,{}),href:"/knowledge/files",size:"small",style:{marginBottom:12},children:"返回文件列表"}),(0,n.jsxs)("div",{className:z().searchResultHeader,children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"pageTitle",children:"文件详情"}),(0,n.jsx)("p",{className:"pageDesc",children:"查看解析结果、图纸/表格/数据结构化字段、parent chunk 和 child chunk。"})]}),(0,n.jsxs)(d.A,{children:[(0,n.jsx)(w.Ay,{onClick:()=>{et(null==I?void 0:I.absolutePath)},children:"复制原文件路径"}),(0,n.jsx)(w.Ay,{onClick:()=>{et(null==I?void 0:I.directory)},children:"复制所在目录"}),(0,n.jsx)(w.Ay,{onClick:()=>{el("file")},children:"打开文件"}),(0,n.jsx)(w.Ay,{onClick:()=>{el("directory")},children:"打开目录"}),"pdf"===I.file.format?(0,n.jsx)(w.Ay,{loading:H,onClick:()=>{ee()},children:"重新 OCR"}):null,(0,n.jsx)(w.Ay,{type:"primary",loading:H,onClick:()=>{ee()},children:"重建该文件索引"})]})]})]}),(0,n.jsx)(g.A,{size:"small",title:"基础信息",children:(0,n.jsxs)(c.A,{size:"small",column:2,bordered:!0,children:[(0,n.jsx)(c.A.Item,{label:"路径",children:I.file.relativePath}),(0,n.jsx)(c.A.Item,{label:"原文件",children:null!=(e=I.absolutePath)?e:"-"}),(0,n.jsx)(c.A.Item,{label:"所在目录",children:null!=(t=I.directory)?t:"-"}),(0,n.jsxs)(c.A.Item,{label:"分类",children:[(0,n.jsx)(u.A,{children:(0,R.Jm)(I.file.category)})," ",(0,n.jsx)(u.A,{children:I.file.format})]}),(0,n.jsx)(c.A.Item,{label:"大小",children:(0,R.z3)(I.file.fileSize)}),(0,n.jsx)(c.A.Item,{label:"切片数",children:I.file.chunkCount}),(0,n.jsx)(c.A.Item,{label:"状态",children:I.file.status}),(0,n.jsx)(c.A.Item,{label:"解析模式",children:String(null!=(l=q.extractionMode)?l:"-")}),(0,n.jsx)(c.A.Item,{label:"覆盖范围",children:String(null!=(i=q.contentCoverage)?i:"-")}),(0,n.jsx)(c.A.Item,{label:"正文长度",children:String(null!=(o=q.textLength)?o:"-")})]})}),en.length>0&&(0,n.jsx)(g.A,{size:"small",title:"结构化信息",children:(0,n.jsx)(v.A,{items:en})}),(0,n.jsx)(g.A,{size:"small",title:"详情筛选",children:(0,n.jsxs)(d.A,{direction:"vertical",className:"w-full",children:[(0,n.jsx)(j.A,{allowClear:!0,value:G,onChange:e=>W(e.target.value),placeholder:"筛选 rowRange、图层、实体、data path、section、chunk 内容"}),G?(0,n.jsxs)(d.A,{wrap:!0,children:[(0,n.jsxs)(u.A,{color:"blue",children:[b("knowledge.parentMatches")," ",Q.length]}),(0,n.jsxs)(u.A,{color:"green",children:[b("knowledge.childMatches")," ",Z.length]}),(0,n.jsxs)(u.A,{color:"purple",children:[b("knowledge.filterTerm")," ",G]})]}):null]})}),(0,n.jsxs)(g.A,{size:"small",title:"".concat(b("knowledge.parentChunks")," (").concat(Q.length,"/").concat(I.parents.length,")"),children:[(0,n.jsx)(_.A,{type:"info",showIcon:!0,message:b("knowledge.parentChunkHint"),style:{marginBottom:12}}),(0,n.jsx)(m.A,{rowKey:"id",columns:ei,dataSource:Q,pagination:{pageSize:10},size:"small"})]}),(0,n.jsx)(g.A,{size:"small",title:"".concat(b("knowledge.childChunks")," (").concat(Z.length,"/").concat(I.chunks.length,")"),children:(0,n.jsx)(m.A,{rowKey:"id",columns:er,dataSource:Z,pagination:{pageSize:20},size:"small"})})]}):(0,n.jsx)(x.A,{description:"请选择文件"})}},91952:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var l in t)Object.defineProperty(e,l,{enumerable:!0,get:t[l]})}(t,{default:function(){return o},getImageProps:function(){return s}});let n=l(34007),r=l(62956),i=l(49952),a=n._(l(4632));function s(e){let{props:t}=(0,r.getImgProps)(e,{defaultLoader:a.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,l]of Object.entries(t))void 0===l&&delete t[e];return{props:t}}let o=i.Image}},e=>{e.O(0,[433,787,576,985,375,102,506,289,861,636,593,792],()=>e(e.s=37690)),_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,l)=>{"use strict";l.d(t,{A:()=>j});var r=l(51541),a=l(61848),s=l(5669),i=l(97109),n=l(72658),c=l(3638),o=l(92162),d=l(82725),u=l(74567),h=l(632),f=l(49517),m=l(79412),p=l(19527);let v=(0,d.U)(e=>{let{prefixCls:t,className:l,closeIcon:r,closable:a,type:s,title:d,children:v,footer:g,classNames:y,styles:x,...j}=e,{getPrefixCls:w}=i.useContext(u.QO),{className:_,style:A,classNames:b,styles:z}=(0,u.TP)("modal"),C=w(),P=t||w("modal"),k=(0,h.A)(C),[S,M]=(0,p.Ay)(P,k),[N,E]=(0,o.AV)([b,y],[z,x],{props:e}),O=`${P}-confirm`,H={};return H=s?{closable:a??!1,title:"",footer:"",children:i.createElement(f.k,{...e,prefixCls:P,confirmPrefixCls:O,rootPrefixCls:C,content:v})}:{closable:a??!0,title:d,footer:null!==g&&i.createElement(m.w,{...e}),children:v},i.createElement(n.Z,{prefixCls:P,className:(0,c.$)(S,`${P}-pure-panel`,s&&O,s&&`${O}-${s}`,l,_,M,k,N.root),style:{...A,...E.root},...j,closeIcon:(0,m.O)(P,r),closable:a,classNames:N,styles:E,...H})});var g=l(99739);function y(e){return(0,r.Ay)((0,r.fp)(e))}let x=s.A;x.useModal=g.A,x.info=function(e){return(0,r.Ay)((0,r.$D)(e))},x.success=function(e){return(0,r.Ay)((0,r.Ej)(e))},x.error=function(e){return(0,r.Ay)((0,r.jT)(e))},x.warning=y,x.warn=y,x.confirm=function(e){return(0,r.Ay)((0,r.lr)(e))},x.destroyAll=function(){for(;a.A.length;){let e=a.A.pop();e&&e()}},x.config=r.FB,x._InternalPanelDoNotUseOrYouWillBeFired=v;let j=x},26619:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var r=l(97109),a=l(1611),s=l(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.A})))},26631:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var r=l(97109),a=l(12887),s=l(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.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"}},45551:(e,t,l)=>{"use strict";function r(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),l=e/Math.pow(1024,t);return"".concat(l.toFixed(+(0!==t))," ").concat(["B","KB","MB","GB","TB"][t])}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";if(!e||e<=0)return"en-US"===t?"Never":"从未";let l=Math.floor(Math.floor((Date.now()-e)/1e3)/60),r=Math.floor(l/60),a=Math.floor(r/24);return a>30?new Date(e).toLocaleDateString(t):"en-US"===t?a>0?"".concat(a,"d ago"):r>0?"".concat(r,"h ago"):l>0?"".concat(l,"m ago"):"Just now":a>0?"".concat(a," 天前"):r>0?"".concat(r," 小时前"):l>0?"".concat(l," 分钟前"):"刚刚"}l.d(t,{Jm:()=>n,fw:()=>a,z3:()=>r});let s={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},i={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function n(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===l?i: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"}},58209:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var r=l(97109),a=l(23793),s=l(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.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,l)=>{"use strict";l.d(t,{A:()=>n});var r=l(97109),a=l(30289),s=l(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.A})))},82738:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>et});var r=l(65321),a=l(97109),s=l(44494),i=l(43220),n=l.n(i),c=l(86109),o=l(17807),d=l(25258),u=l(11702),h=l(33442),f=l(14932),m=l(85114),p=l(7576),v=l(57271),g=l(68787),y=l(99605),x=l(21289),j=l(56768),w=l(48893),_=l(88483);function A(){return(A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let b=a.forwardRef((e,t)=>a.createElement(_.A,A({},e,{ref:t,icon:w.A})));var z=l(13067);function C(){return(C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let P=a.forwardRef((e,t)=>a.createElement(_.A,C({},e,{ref:t,icon:z.A})));var k=l(58520);function S(){return(S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let M=a.forwardRef((e,t)=>a.createElement(_.A,S({},e,{ref:t,icon:k.A})));var N=l(90939);function E(){return(E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let O=a.forwardRef((e,t)=>a.createElement(_.A,E({},e,{ref:t,icon:N.A})));var H=l(93314),V=l(61825),I=l(26619),T=l(29606),F=l(26631),B=l(64254),L=l(64629),R=l(58209),D=l(30486),U=l(92803);function $(){return($=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let J=a.forwardRef((e,t)=>a.createElement(_.A,$({},e,{ref:t,icon:U.A})));var Q=l(84742),W=l(38762),X=l(6578),q=l(45551),G=l(14569),K=l.n(G);let Z=["document","spreadsheet","image","cad","code","data","web","diagram","other"],Y=/\.(zip|jar|war|apk|tar|gz|tgz|bz2|rar|7z)$/iu,ee=/(^|\/)\.DS_Store$|(^|\/)Thumbs\.db$|(^|\/)__MACOSX\/|\.bak$/iu;function et(){let e=(0,s.Vr)("knowledge"),{locale:t}=(0,s.x_)(),{message:l}=o.A.useApp(),i=(0,c.useRouter)(),w="string"==typeof i.query.category?i.query.category:"",[_,A]=(0,a.useState)([]),[z,C]=(0,a.useState)(!1),[k,S]=(0,a.useState)(""),[N,E]=(0,a.useState)(""),[U,$]=(0,a.useState)(w),[G,et]=(0,a.useState)(!1),[el,er]=(0,a.useState)(!1),[ea,es]=(0,a.useState)([]),[ei,en]=(0,a.useState)([]),[ec,eo]=(0,a.useState)(new Set),[ed,eu]=(0,a.useState)("all"),[eh,ef]=(0,a.useState)(!0),[em,ep]=(0,a.useState)([]),[ev,eg]=(0,a.useState)(new Set),ey=(0,a.useRef)(U);(0,a.useEffect)(()=>{ey.current=U},[U]),(0,a.useEffect)(()=>{$("string"==typeof i.query.category?i.query.category:"")},[i.query.category]);let ex=(0,a.useCallback)(async(e,t)=>{let l=null!=e?e:ey.current;(null==t?void 0:t.silent)||(C(!0),S(""));try{let e=await (0,X.HT)({category:l||void 0,limit:5e3});A(e.files||[]),e.initializing&&window.setTimeout(()=>{ex(l,{silent:!0})},3e3)}catch(e){(null==t?void 0:t.silent)||(A([]),S(e instanceof Error?e.message:"文件列表加载失败"))}finally{(null==t?void 0:t.silent)||C(!1)}},[]);(0,a.useEffect)(()=>{ex(U)},[U,ex]);let ej=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}),ew=(0,a.useCallback)(async()=>{try{let e=(await (0,X.Qx)()).operations.map(ej);es(t=>{let l=new Set(e.map(e=>e.id).filter(Boolean)),r=e.map(e=>{var l;let r=t.find(t=>t.id===e.id);return r?{...r,...e,createdAt:null!=(l=r.createdAt)?l:e.createdAt}:e}),a=t.filter(e=>e.id&&!l.has(e.id)&&"processing"===e.status);return[...r,...a].slice(0,50)})}catch(e){}},[]),e_=(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];es(l=>{let r=l.findIndex(l=>e.id&&l.id===e.id||t.includes(l.title));if(r>=0){var a;let t=[...l];return t[r]={...l[r],...e,createdAt:null!=(a=l[r].createdAt)?a:e.createdAt},t}return[e,...l].slice(0,50)})},[]);(0,a.useEffect)(()=>{ew()},[ew]);let eA=async()=>{try{await (0,X.H7)(),es([]),l.success("任务状态已清空")}catch(e){l.error("清空任务状态失败")}},eb=async(e,t)=>{if(t.stopPropagation(),e.id)try{await (0,X.CU)(e.id)}catch(e){}es(t=>t.filter(t=>t!==e))},ez=(0,a.useMemo)(()=>{let e=0,t=0,l=0;for(let r of ea)"processing"===r.status?e++:"success"===r.status?t++:("error"===r.status||"warning"===r.status)&&l++;return{processing:e,success:t,error:l}},[ea]);(0,a.useEffect)(()=>{ez.processing>0&&ef(!1)},[ez.processing]),(0,a.useEffect)(()=>{if(0===ez.processing)return;let e=window.setInterval(()=>{ew()},2e3),t=window.setInterval(()=>{ex(void 0,{silent:!0})},8e3);return()=>{window.clearInterval(e),window.clearInterval(t)}},[ex,ew,ez.processing]);let eC="all"===ed?ea:ea.filter(e=>"processing"===ed?"processing"===e.status:"success"===ed?"success"===e.status:"error"!==ed||"error"===e.status||"warning"===e.status),eP=async e=>{let t=e.filter(e=>{let t=e.webkitRelativePath||e.name;return e.size>0&&!Y.test(e.name)&&!ee.test(t)}),r=e.length-t.length;if(r>0&&l.warning("已跳过 ".concat(r," 个空文件、系统文件、备份文件或压缩包")),0===t.length)return;let a=1===t.length?t[0].name:"".concat(t.length," 个文件");et(!0);let s="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));e_({id:s,type:"upload",title:"上传 ".concat(a),description:"等待上传、解析、切片和入库;同路径文件会更新,其他已有文件不会清除",status:"processing",percent:5});try{await (0,X.c1)(t,void 0,s,e=>{e_({id:s,type:"upload",title:"上传 ".concat(a),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)))})}),l.info("文件已上传,正在后台解析、切片和入库;同路径文件会更新,其他已有文件不会清除,可在顶部“后台任务”查看进度"),E(""),$(""),en([]),ey.current="",await ew(),window.setTimeout(()=>{ex(void 0,{silent:!0})},2e3)}catch(t){let e=t instanceof Error?t.message:"请重试或检查文件格式";l.error(e||"上传失败"),e_({id:s,type:"error",title:"上传失败 ".concat(a),description:e,status:"error",percent:100})}finally{et(!1)}},ek=async()=>{er(!0);let e="reindex-ui-".concat(Date.now());e_({id:e,type:"reindex",title:"重新解析入库",description:"正在提交后台任务",status:"processing",percent:5});try{var t;let r=await (0,X.H1)(),a=r.operationId||e,s=r.job;l.info(r.alreadyRunning?"已有重新解析任务正在后台执行":"已提交重新解析入库任务,可在顶部“后台任务”查看进度"),e_({id:a,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,X.ax)(a).then(e=>e.job).catch(async()=>(await (0,X.Qx)()).operations.find(e=>e.id===a));if(e){let t="success"===e.status||"error"===e.status;if(e_({id:a,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?l.success(e.message||"重新解析入库完成"):l.error(e.error||e.message||"重新解析入库失败");break}}await new Promise(e=>setTimeout(e,1e3))}await ex(),await ew()}catch(r){let t=r instanceof Error?r.message:"重新解析入库失败";l.error(t),e_({id:e,type:"error",title:"重新解析入库失败",description:t,status:"error",percent:100},["重新解析入库","重新解析入库完成","重新解析入库失败"])}finally{er(!1)}},eS=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 r;let a=await (0,X.HC)(e.relativePath),s=a.operationId||t,i=a.job;l.info(a.alreadyRunning?"已有知识库任务正在后台执行":"已提交单文件重新解析任务"),e_({id:s,type:"reindex",title:(null==i?void 0:i.title)||"重新解析 ".concat(e.relativePath),description:(null==i?void 0:i.message)||"后台将重新解析、分块并入库该文件",status:(null==i?void 0:i.status)||"processing",percent:null!=(r=null==i?void 0:i.percent)?r:10,filePath:(null==i?void 0:i.filePath)||e.relativePath,chunkCount:null==i?void 0:i.chunkCount,error:null==i?void 0:i.error},["重新解析 ".concat(e.relativePath)]);for(let t=0;t<240;t++){let t=await (0,X.ax)(s).then(e=>e.job).catch(async()=>(await (0,X.Qx)()).operations.find(e=>e.id===s));if(t){let r="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 ex(),r){"success"===t.status?l.success(t.message||"单文件重新解析完成"):l.error(t.error||t.message||"单文件重新解析失败");break}}await new Promise(e=>setTimeout(e,1e3))}await ex(),await ew()}catch(a){let r=a instanceof Error?a.message:"单文件重新解析失败";l.error(r),e_({id:t,type:"error",title:"重新解析失败 ".concat(e.relativePath),description:r,status:"error",percent:100,filePath:e.relativePath},["重新解析 ".concat(e.relativePath)])}finally{eg(t=>{let l=new Set(t);return l.delete(e.relativePath),l})}},eM=t=>{let r="selected"===t?eF:"filtered"===t?eN.map(e=>e.relativePath):[],a=_.length;if("all"!==t&&0===r.length||"all"===t&&0===a)return void l.info("没有可删除的文件");let s="all"===t?"删除全部文件 ".concat(a," 个?"):"filtered"===t?"删除当前筛选结果中的文件 ".concat(r.length," 个?"):"删除已选文件 ".concat(r.length," 个?");d.A.confirm({title:s,content:"将同时删除文件、切片、索引和向量记录。此操作不可撤销。",okText:e("common.delete"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{es(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,X.X8)():"selected"===t?await (0,X.tZ)(eT,eI):await (0,X.SJ)(r)).deleted)?e:"all"===t?a:r.length;l.success("已删除 ".concat(s," 个文件")),en([]),es(e=>[{type:"delete",title:"批量删除完成",description:"已删除 ".concat(s," 个文件、切片和索引"),status:"success"},...e].slice(0,50)),await ex(),await ew()}catch(e){l.error("批量删除失败"),es(e=>[{type:"error",title:"批量删除失败",description:"请重试",status:"error"},...e].slice(0,50))}}})},eN=(0,a.useMemo)(()=>N?_.filter(e=>e.relativePath.toLowerCase().includes(N.toLowerCase())):_,[N,_]),eE=(0,a.useMemo)(()=>new Set(eN.map(e=>e.relativePath)),[eN]),eO=(0,a.useMemo)(()=>{let e={};for(let l of[...eN].sort((e,t)=>e.relativePath.localeCompare(t.relativePath))){let r=l.relativePath.split("/"),a="";for(let s=0;s<r.length;s++){let i=r[s],n=a;a=a?"".concat(a,"/").concat(i):i;let c=s===r.length-1;if(e[a])c||e[a].isFolder?c&&(e[a].isFolder=!1,e[a].file=l,e[a].fileCount=1,e[a].totalSize=l.fileSize,e[a].totalChunks=l.chunkCount):(e[a].isFolder=!0,e[a].children=[],e[a].fileCount=0,e[a].totalSize=0,e[a].totalChunks=0);else{var t;e[a]={key:a,name:i,isFolder:!c,...c?{file:l,fileCount:1,totalSize:l.fileSize,totalChunks:l.chunkCount}:{children:[],fileCount:0,totalSize:0,totalChunks:0}},n&&(null==(t=e[n])?void 0:t.children)&&e[n].children.push(e[a])}}}let l=e=>{for(let s of e)if(s.children){l(s.children);let e=0,i=0,n=0;for(let l of s.children){var t,r,a;e+=null!=(t=l.fileCount)?t:0,i+=null!=(r=l.totalSize)?r:0,n+=null!=(a=l.totalChunks)?a:0}s.fileCount=e,s.totalSize=i,s.totalChunks=n}},r=e=>e.map(e=>e.children?{...e,children:r(e.children)}:e).filter(e=>{var t,l,r;return!e.isFolder||(null!=(l=e.fileCount)?l:0)>0&&(null!=(r=null==(t=e.children)?void 0:t.length)?r:0)>0}),a=Object.values(e).filter(e=>!e.key.includes("/"));return l(a),r(a)},[eN]),eH=(0,a.useMemo)(()=>{let e=[],t=l=>{for(let r of l)e.push(r.key),r.children&&t(r.children)};return t(eO),e},[eO]),eV=(0,a.useMemo)(()=>new Set([...eE,...eH]),[eH,eE]),eI=(0,a.useMemo)(()=>ei.map(String).filter(e=>!eE.has(e)&&eH.includes(e)),[eH,ei,eE]),eT=(0,a.useMemo)(()=>ei.map(String).filter(e=>eE.has(e)),[ei,eE]),eF=(0,a.useMemo)(()=>{let e=new Set;for(let t of eT){let l=_.find(e=>e.relativePath===t);l&&e.add(l.relativePath)}for(let t of eI){let l="".concat(t,"/");for(let t of _)t.relativePath.startsWith(l)&&e.add(t.relativePath)}return Array.from(e)},[_,eT,eI]),eB=eF.length;(0,a.useEffect)(()=>{en(e=>e.filter(e=>eV.has(String(e))))},[eV]);let eL=(0,a.useMemo)(()=>N?eH:eO.map(e=>e.key),[N,eH,eO]);(0,a.useEffect)(()=>{ep(eL)},[eL]);let eR=(e,t)=>{ep(l=>e?[...l,t.key]:l.filter(e=>e!==t.key))},eD=[{title:e("fileName"),dataIndex:"name",key:"name",render:(e,t)=>(0,r.jsxs)("span",{className:K().fileNameCell,children:[t.isFolder?(0,r.jsx)("span",{style:{cursor:"pointer"},onClick:e=>{e.stopPropagation(),eR(!em.includes(t.key),t)},children:(e=>{let t=e.children;return t&&0!==t.length?(0,r.jsx)(B.A,{style:{color:"#fa8c16",fontSize:15}}):(0,r.jsx)(T.A,{style:{color:"#fa8c16",fontSize:15}})})(t)}):(e=>{if(!e)return(0,r.jsx)(j.A,{style:{fontSize:15}});let t=e.category;return"image"===t?(0,r.jsx)(b,{style:{color:"#eb2f96",fontSize:15}}):"spreadsheet"===t?(0,r.jsx)(P,{style:{color:"#52c41a",fontSize:15}}):"document"===t?(0,r.jsx)(M,{style:{color:"#1677ff",fontSize:15}}):"code"===t?(0,r.jsx)(O,{style:{color:"#fa8c16",fontSize:15}}):"archive"===t?(0,r.jsx)(H.A,{style:{color:"#8c8c8c",fontSize:15}}):"web"===t?(0,r.jsx)(V.A,{style:{color:"#13c2c2",fontSize:15}}):"data"===t?(0,r.jsx)(I.A,{style:{color:"#722ed1",fontSize:15}}):"cad"===t?(0,r.jsx)(T.A,{style:{color:"#fa541c",fontSize:15}}):"diagram"===t?(0,r.jsx)(b,{style:{color:"#a0d911",fontSize:15}}):(0,r.jsx)(F.A,{style:{fontSize:15}})})(t.file),t.isFolder?(0,r.jsx)("span",{className:K().folderName,onClick:e=>{e.stopPropagation(),eR(!em.includes(t.key),t)},children:t.name}):(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(n(),{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,l)=>{var a,s;return l.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(u.A,{children:(0,q.Jm)(null!=(s=null==(a=l.file)?void 0:a.category)?s:"",t)})}},{title:e("fileSize"),dataIndex:"fileSize",key:"size",width:90,render:(e,t)=>{var l,r,a;return(0,q.z3)(t.isFolder?null!=(r=t.totalSize)?r:0:null!=(a=null==(l=t.file)?void 0:l.fileSize)?a:0)}},{title:"切片",dataIndex:"chunkCount",key:"chunks",width:80,render:(e,t)=>{var l,a,s;let i=t.isFolder?null!=(a=t.totalChunks)?a:0:null!=(s=null==(l=t.file)?void 0:l.chunkCount)?s:0;return(0,r.jsx)(u.A,{color:i>1?"green":"orange",children:i})}},{title:"解析状态",dataIndex:"status",key:"status",width:100,render:(e,t)=>{var l,a,s,i;return t.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(u.A,{color:"active"===(i=null==(l=t.file)?void 0:l.status)?"green":"processing"===i||"indexing"===i?"blue":"error"===i?"red":"orange",children:(null==(a=t.file)?void 0:a.errorMessage)||(null==(s=t.file)?void 0:s.status)||"—"})}},{title:e("fileDate"),dataIndex:"mtime",key:"date",width:130,render:(e,l)=>{var a;return l.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(null==(a=l.file)?void 0:a.mtime)?new Date(l.file.mtime).toLocaleDateString(t):"—"}},{title:"来源",key:"source",width:100,render:(e,t)=>t.isFolder?(0,r.jsx)("span",{style:{color:"var(--colorTextQuaternary)"},children:"—"}):(0,r.jsx)(u.A,{color:"cyan",children:"文件"})},{title:"",key:"act",width:100,render:(t,a)=>a.isFolder?null:(0,r.jsxs)(h.A,{size:4,children:[(0,r.jsx)(f.A,{title:"重新解析、分块并入库",children:(0,r.jsx)(m.Ay,{type:"text",size:"small",loading:!!(a.file&&ev.has(a.file.relativePath)),icon:(0,r.jsx)(L.A,{}),onClick:()=>{eS(a.file)}})}),(0,r.jsx)(m.Ay,{type:"text",danger:!0,size:"small",icon:(0,r.jsx)(R.A,{}),onClick:()=>{var t;return t=a.file,void d.A.confirm({title:e("delete"),content:e("deleteConfirm"),okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{es(e=>[{type:"delete",title:"删除 ".concat(t.relativePath),description:"正在删除文件记录",status:"processing"},...e].slice(0,50));try{await (0,X.xq)(t.relativePath),l.success("已删除"),es(e=>[{type:"delete",title:"删除完成 ".concat(t.relativePath),description:"文件和索引记录已移除",status:"success"},...e].slice(0,50)),en(e=>e.filter(e=>e!==t.relativePath)),await ex(),await ew()}catch(e){l.error("删除失败"),es(e=>[{type:"error",title:"删除失败 ".concat(t.relativePath),description:"请重试",status:"error"},...e].slice(0,50))}}})}})]})}];return(0,r.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,r.jsx)("h2",{className:"pageTitle",children:e("files")}),(0,r.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,r.jsx)(p.A,{placeholder:e("searchPlaceholder"),prefix:(0,r.jsx)(D.A,{}),value:N,onChange:e=>{E(e.target.value)},allowClear:!0,className:K().filterInput}),(0,r.jsx)(v.A,{value:U||void 0,onChange:e=>{$(e||"")},placeholder:e("filterCategory"),allowClear:!0,className:K().filterSelect,options:[{label:e("allCategories"),value:""},...Z.map(e=>({label:(0,q.Jm)(e,t),value:e}))]}),(0,r.jsx)(m.Ay,{type:"primary",icon:(0,r.jsx)(J,{}),loading:G,onClick:()=>{var e;return null==(e=document.getElementById("kb-file-upload-input"))?void 0:e.click()},children:G?e("uploading"):e("upload")}),(0,r.jsx)(m.Ay,{icon:(0,r.jsx)(J,{}),loading:G,onClick:()=>{var e;return null==(e=document.getElementById("kb-folder-upload-input"))?void 0:e.click()},children:"上传文件夹"}),(0,r.jsx)(m.Ay,{icon:(0,r.jsx)(L.A,{}),loading:el,onClick:()=>{ek()},children:"重新解析入库"}),(0,r.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 l=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",eP(l)}}),(0,r.jsx)("input",{id:"kb-folder-upload-input",type:"file",multiple:!0,hidden:!0,webkitdirectory:"",onChange:e=>{var t;let l=Array.from(null!=(t=e.target.files)?t:[]);e.target.value="",eP(l)}})]}),(0,r.jsxs)(g.A,{size:"small",className:K().statusCard,styles:{body:{padding:0}},children:[(0,r.jsxs)("div",{className:K().statusSummary,onClick:()=>ef(!eh),children:[(0,r.jsx)("span",{className:K().statusSummaryText,children:0===ea.length?"暂无文件任务":(0,r.jsxs)(h.A,{size:6,children:[ez.processing>0&&(0,r.jsxs)(u.A,{color:"processing",style:{margin:0},icon:(0,r.jsx)(L.A,{spin:!0}),children:["处理中 ",ez.processing]}),(0,r.jsxs)(u.A,{color:"success",style:{margin:0},icon:(0,r.jsx)(Q.A,{}),children:["已完成 ",ez.success]}),(0,r.jsxs)(u.A,{color:"error",style:{margin:0},icon:(0,r.jsx)(W.A,{}),children:["失败 ",ez.error]})]})}),ea.length>0&&(0,r.jsxs)(h.A,{size:6,children:[(0,r.jsx)(m.Ay,{size:"small",className:K().statusClearBtn,onClick:e=>{e.stopPropagation(),eA()},children:"清空"}),(0,r.jsx)(m.Ay,{size:"small",className:K().statusExpandBtn,onClick:e=>{e.stopPropagation(),ef(!eh)},children:eh?"展开":"收起"})]})]}),!eh&&ea.length>0&&(0,r.jsxs)("div",{className:K().statusPanel,children:[(0,r.jsxs)("div",{className:K().statusFilters,children:[(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("all"===ed?K().filterPillActive:""),style:"all"===ed?{color:"#1677ff"}:void 0,onClick:()=>eu("all"),children:["全部 ",(0,r.jsx)("b",{children:ea.length})]}),(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("processing"===ed?K().filterPillActive:""),style:"processing"===ed?{color:"#1677ff"}:void 0,onClick:()=>eu("processing"),children:[(0,r.jsx)(L.A,{spin:ez.processing>0})," 处理中 ",(0,r.jsx)("b",{children:ez.processing})]}),(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("success"===ed?K().filterPillActive:""),style:"success"===ed?{color:"#52c41a"}:void 0,onClick:()=>eu("success"),children:[(0,r.jsx)(Q.A,{})," 已完成 ",(0,r.jsx)("b",{children:ez.success})]}),(0,r.jsxs)("span",{className:"".concat(K().filterPill," ").concat("error"===ed?K().filterPillActive:""),style:"error"===ed?{color:"#ff4d4f"}:void 0,onClick:()=>eu("error"),children:[(0,r.jsx)(W.A,{})," 失败 ",(0,r.jsx)("b",{children:ez.error})]})]}),(0,r.jsx)("div",{className:K().timelineList,children:0===eC.length?(0,r.jsx)("div",{className:K().statusEmpty,children:"没有匹配的任务"}):eC.map((e,l)=>{var a;let s=e.id||"".concat(e.type,"-").concat(null!=(a=e.createdAt)?a:e.title,"-").concat(l),i=ec.has(s);return(0,r.jsxs)("div",{className:K().timelineItem,children:[(0,r.jsxs)("div",{className:K().timelineRow,onClick:()=>{eo(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},children:[(0,r.jsx)("span",{className:K().timelineStatusIcon,children:"success"===e.status?(0,r.jsx)(Q.A,{style:{color:"#52c41a"}}):"processing"===e.status?(0,r.jsx)(L.A,{spin:!0,style:{color:"#1677ff"}}):"error"===e.status?(0,r.jsx)(W.A,{style:{color:"#ff4d4f"}}):(0,r.jsx)("span",{style:{color:"#fa8c16",fontWeight:700},children:"!"})}),(0,r.jsx)("span",{className:K().timelineTitle,children:e.title}),"number"==typeof e.percent&&"processing"===e.status&&(0,r.jsxs)("span",{className:K().timelinePercent,children:[e.percent,"%"]}),(0,r.jsx)(m.Ay,{type:"text",size:"small",danger:!0,icon:(0,r.jsx)(R.A,{}),style:{width:22,height:22,padding:0,fontSize:12},onClick:t=>{eb(e,t)}})]}),i&&(0,r.jsxs)("div",{className:K().timelineDetail,children:["number"==typeof e.percent&&"processing"===e.status&&(0,r.jsx)(y.A,{percent:e.percent,size:"small",strokeColor:"#1677ff"}),e.description&&(0,r.jsx)("div",{className:K().timelineDesc,children:e.description}),e.error&&(0,r.jsx)("div",{style:{color:"var(--colorError)",fontSize:12,wordBreak:"break-word"},children:e.error}),e.filePath&&(0,r.jsx)(f.A,{title:e.filePath,children:(0,r.jsx)("div",{className:K().timelinePath,children:e.filePath})}),(0,r.jsxs)("div",{className:K().timelineMeta,children:["number"==typeof e.chunkCount&&(0,r.jsxs)("span",{className:K().timelineMetaTag,children:["切片 ",(0,r.jsx)("b",{children:e.chunkCount})]}),"number"==typeof e.textLength&&(0,r.jsxs)("span",{className:K().timelineMetaTag,children:["正文 ",(0,r.jsx)("b",{children:e.textLength.toLocaleString(t)})," 字符"]}),e.extractionMode&&(0,r.jsxs)("span",{className:K().timelineMetaTag,children:["解析 ",(0,r.jsx)("b",{children:e.extractionMode})]})]}),"error"===e.status&&(0,r.jsx)("div",{style:{color:"var(--colorError)",fontSize:12},children:"此任务失败,请重新上传文件或重试操作"})]})]},s)})})]})]}),(0,r.jsxs)(g.A,{title:"文件列表",extra:(0,r.jsxs)(h.A,{size:8,children:[(0,r.jsxs)(m.Ay,{danger:!0,size:"small",disabled:0===eB,icon:(0,r.jsx)(R.A,{}),onClick:()=>eM("selected"),children:["删除已选 ",eB||""]}),(0,r.jsx)(m.Ay,{danger:!0,size:"small",disabled:0===_.length,onClick:()=>eM("all"),children:"删除全部文件"})]}),children:[k&&(0,r.jsxs)("div",{className:K().statusEmpty,children:["文件列表加载失败:",k]}),(0,r.jsx)(x.A,{rowKey:"key",columns:eD,dataSource:eO,loading:z,size:"middle",expandable:{expandedRowKeys:em,onExpand:eR,childrenColumnName:"children"},locale:{emptyText:z?"正在加载文件列表...":N?e("emptySearch"):e("noFiles")},pagination:!1,rowClassName:e=>e.isFolder?K().folderRow:"",rowSelection:{selectedRowKeys:ei,onChange:en,checkStrictly:!1,getCheckboxProps:e=>{var t;return{disabled:!!e.isFolder&&(null!=(t=e.fileCount)?t:0)===0}}},footer:()=>(0,r.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["当前展示 ",eN.length," 个文件;全部文件 ",_.length," 个;",eO.length," 个顶层目录"]})})]})]})}},90426:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/files",function(){return l(82738)}])},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"}},92803:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"}},93314:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var r=l(97109),a=l(53234),s=l(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r])}return e}).apply(this,arguments)}let n=r.forwardRef((e,t)=>r.createElement(s.A,i({},e,{ref:t,icon:a.A})))}},e=>{e.O(0,[433,787,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(44494),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(29606),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()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[207],{4184:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>E});var l=s(65321),r=s(43220),i=s.n(r),a=s(97109),n=s(35292),c=s(17807),o=s(85114),d=s(85493),u=s(68787),h=s(33442),_=s(7576),m=s(48318),y=s(11702),p=s(76506),x=s(42700),j=s(84253),g=s(30486),w=s(44494),A=s(6578),f=s(14569),v=s.n(f);let{Paragraph:b}=n.A,S=["keyword","vector","rewrite","hybridBonus"],P=["keywordScore","bm25Score","vectorScore","rerankBoost","hybridScore"];function k(e){return"number"==typeof e?e.toFixed(2):"-"}function C(e,t,s){let l=e(t);return l===t?s:l}function I(e,t){let s=[t.trim(),...t.split(/[\s,,。;;::、]+/u)].filter(Boolean).sort((e,t)=>t.length-e.length);if(0===s.length)return e;let r=RegExp("(".concat(s.map(e=>e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join("|"),")"),"giu");return e.split(r).map((e,t)=>s.some(t=>t.toLowerCase()===e.toLowerCase())?(0,l.jsx)("mark",{children:e},t):e)}function E(){var e,t,s;let{message:r}=c.A.useApp(),n=(0,w.Vr)("knowledge"),[f,E]=(0,a.useState)(""),[N,R]=(0,a.useState)(!1),[T,B]=(0,a.useState)([]),[z,L]=(0,a.useState)([]),[F,D]=(0,a.useState)(),[M,V]=(0,a.useState)(),[O,W]=(0,a.useState)(""),[H,U]=(0,a.useState)({keyword:1,vector:.9,rewrite:.72,hybridBonus:.35}),X=async e=>{await navigator.clipboard.writeText(e),r.success(n("copyPriorityEvidenceSuccess"))},K=async()=>{let e=f.trim();if(e){R(!0),W("");try{let[t,s]=await Promise.all([(0,A.W2)(e,{limit:10,weights:H}),(0,A.nU)({query:e,limit:20,includeContent:!0})]);B(t.results),L(s.files),D(t.queryTimeMs),V(t.debug)}catch(e){B([]),L([]),W(e instanceof Error?e.message:n("searchFailed"))}finally{R(!1)}}};return(0,l.jsxs)("div",{className:"space-y-6 animateFadeIn",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"pageTitle",children:n("searchTitle")}),(0,l.jsx)("p",{className:"pageDesc",children:n("searchDesc")})]}),(0,l.jsx)(i(),{href:"/documents",children:(0,l.jsx)(o.Ay,{children:n("goToDocuments")})})]}),(0,l.jsx)(d.A,{type:"info",showIcon:!0,message:n("autoSearchFirst"),description:n("autoSearchFirstDesc")}),(0,l.jsx)(u.A,{size:"small",children:(0,l.jsxs)(h.A.Compact,{className:"w-full",children:[(0,l.jsx)(_.A,{value:f,onChange:e=>E(e.target.value),onPressEnter:()=>{K()},placeholder:n("searchContentPlaceholder")}),(0,l.jsx)(o.Ay,{type:"primary",icon:(0,l.jsx)(g.A,{}),loading:N,onClick:()=>{K()},children:n("searchAction")})]})}),(0,l.jsx)(u.A,{size:"small",title:n("recallWeightTuning"),children:(0,l.jsx)(h.A,{wrap:!0,children:S.map(e=>(0,l.jsxs)("span",{children:[C(n,"weights.".concat(e),e)," ",(0,l.jsx)(m.A,{min:0,max:"hybridBonus"===e?2:5,step:"hybridBonus"===e?.05:.1,value:H[e],onChange:t=>U(s=>({...s,[e]:Number(null!=t?t:s[e])}))})]},e))})}),z.length>0&&(0,l.jsx)(u.A,{size:"small",title:"匹配文件",extra:"".concat(z.length," 个"),children:(0,l.jsx)("div",{style:{display:"grid",gap:8},children:z.map(e=>(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:12,alignItems:"center",padding:"10px 12px",border:"1px solid var(--colorBorderSecondary)",borderRadius:10},children:[(0,l.jsxs)("div",{style:{minWidth:0},children:[(0,l.jsxs)(h.A,{size:8,wrap:!0,children:[(0,l.jsx)(i(),{href:"/knowledge/file-detail?relativePath=".concat(encodeURIComponent(e.relativePath)),children:I(e.relativePath,f)}),(0,l.jsx)(y.A,{color:"content"===e.matchedBy?"purple":"disk"===e.matchedBy?"orange":"blue",children:"content"===e.matchedBy?"内容匹配":"disk"===e.matchedBy?"磁盘文件":"文件匹配"}),(0,l.jsx)(y.A,{children:e.status}),0===e.chunkCount&&(0,l.jsx)(y.A,{color:"warning",children:"未切片"})]}),(0,l.jsxs)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12},children:[e.category||"未分类"," \xb7 ",e.format||"未知格式"," \xb7 ",Math.round((e.fileSize||0)/1024)," KB"]})]}),(0,l.jsx)(o.Ay,{size:"small",onClick:()=>{X(e.relativePath)},children:n("copyAsPriorityEvidence")})]},e.relativePath))})}),M&&(0,l.jsx)(u.A,{size:"small",title:n("debugPanel"),children:(0,l.jsxs)(p.A,{size:"small",column:2,bordered:!0,children:[(0,l.jsx)(p.A.Item,{label:n("originalQuery"),children:M.originalQuery}),(0,l.jsx)(p.A.Item,{label:n("reranker"),children:M.reranker}),(0,l.jsx)(p.A.Item,{label:n("rewrittenQueries"),span:2,children:(0,l.jsx)(h.A,{wrap:!0,children:null==(e=M.rewrittenQueries)?void 0:e.map(e=>(0,l.jsx)(y.A,{children:e},e))})}),(0,l.jsx)(p.A.Item,{label:n("recallCounts"),span:2,children:(0,l.jsx)(h.A,{wrap:!0,children:Object.entries(null!=(t=M.recallCounts)?t:{}).map(e=>{let[t,s]=e;return(0,l.jsxs)(y.A,{children:[C(n,"recallSources.".concat(t),t),": ",s]},t)})})}),(0,l.jsx)(p.A.Item,{label:n("recallWeights"),span:2,children:(0,l.jsx)(h.A,{wrap:!0,children:Object.entries(null!=(s=M.weights)?s:{}).map(e=>{let[t,s]=e;return(0,l.jsxs)(y.A,{children:[C(n,"weights.".concat(t),t),": ",s]},t)})})})]})}),(0,l.jsxs)(u.A,{size:"small",title:n("searchResults"),extra:"number"==typeof F?"".concat(F," ms"):void 0,children:[O?(0,l.jsx)(d.A,{type:"error",showIcon:!0,message:n("searchFailed"),description:O,className:"mb-4"}):null,N?(0,l.jsx)(x.A,{}):0===T.length?(0,l.jsx)(j.A,{description:n("noSearchResults")}):(0,l.jsx)("div",{className:v().searchResultList,children:T.map((e,t)=>{var s,r;return(0,l.jsxs)("div",{className:v().searchResultItem,children:[(0,l.jsxs)("div",{className:v().searchResultHeader,children:[(0,l.jsxs)(h.A,{size:8,wrap:!0,children:[(0,l.jsxs)(y.A,{children:[n("resultIndex")," ",t+1]}),(0,l.jsx)(y.A,{color:"hybrid"===e.source?"purple":"vector"===e.source?"blue":"green",children:C(n,"recallSources.".concat(null!=(s=e.source)?s:"keyword"),null!=(r=e.source)?r:"keyword")}),(0,l.jsx)(y.A,{children:C(n,"scopes.".concat(e.scope),e.scope)}),e.chunkKind&&(0,l.jsx)(y.A,{color:"geekblue",children:e.chunkKind}),e.rowRange&&(0,l.jsxs)(y.A,{color:"gold",children:[n("rowRange")," ",e.rowRange]}),e.sectionTitle&&(0,l.jsx)(y.A,{color:"cyan",children:e.sectionTitle})]}),(0,l.jsx)("strong",{children:k(e.score)})]}),(0,l.jsx)("div",{className:v().statusPath,children:(0,l.jsxs)(h.A,{size:8,wrap:!0,children:[(0,l.jsx)(i(),{href:"/knowledge/file-detail?relativePath=".concat(encodeURIComponent(e.filePath)),children:e.filePath}),"number"==typeof e.chunkIndex?" #".concat(e.chunkIndex):"",(0,l.jsx)(o.Ay,{size:"small",onClick:()=>{X(e.filePath)},children:n("copyAsPriorityEvidence")})]})}),(0,l.jsx)(b,{ellipsis:{rows:6,expandable:!0,symbol:n("expand")},className:v().searchContent,children:I(e.content,f)}),e.facets&&Object.keys(e.facets).length>0&&(0,l.jsx)("div",{className:v().statusMeta,children:Object.entries(e.facets).slice(0,8).map(e=>{let[t,s]=e;return(0,l.jsxs)("span",{children:[t," ",(0,l.jsx)("b",{children:Array.isArray(s)?s.join(", "):String(s)})]},t)})}),(0,l.jsx)("div",{className:v().statusMeta,children:P.map(t=>{var s;return(0,l.jsxs)("span",{children:[C(n,"scoreDetails.".concat(t),t)," ",(0,l.jsx)("b",{children:k(null==(s=e.scoreDetails)?void 0:s[t])})]},t)})})]},e.id)})})]})]})}},9208:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/search",function(){return s(4184)}])},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"}}},e=>{e.O(0,[433,787,576,506,938,636,593,792],()=>e(e.s=9208)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46],{22708:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>U});var o=s(65321),a=s(97109),r=s(44494),i=s(17807),t=s(88762),n=s(68787),c=s(85114),d=s(2256),m=s(38770),h=s(33442),x=s(26171),p=s(11702),y=s(85493),u=s(57271),v=s(7576),j=s(48318),g=s(44534),A=s(34052),f=s(63455),b=s(56985),S=s(54746),w=s(29071),z=s(59188),k=s(4216),C=s(13114),P=s(99650),B=s(58209),I=s(76981),T=s(61825),K=s(6578);let E=[{label:"OpenAI 兼容",value:"openai"},{label:"Anthropic",value:"anthropic"},{label:"Google",value:"google"},{label:"Ollama",value:"ollama"},{label:"OpenRouter",value:"openrouter"}],N=[{key:"reader",labelKey:"models.tierReader",descKey:"models.tierReaderDesc"},{key:"reasoning",labelKey:"models.tierReasoning",descKey:"models.tierReasoningDesc"},{key:"action",labelKey:"models.tierAction",descKey:"models.tierActionDesc"}],F=[{key:"imageGeneration",label:"图片生成"},{key:"imageUnderstanding",label:"图片理解"},{key:"fileUnderstanding",label:"文件理解"},{key:"audio",label:"音频能力"},{key:"video",label:"视频能力"}],R={enabled:!1,allowProjectFacts:!1,maxQueriesPerChapter:2,maxResultsPerQuery:3,trustedDomains:[]};function U(){let e=(0,r.Vr)(),{message:l}=i.A.useApp(),[s,U]=(0,a.useState)(!0),[_,O]=(0,a.useState)([]),[D,W]=(0,a.useState)(null),[H,Q]=(0,a.useState)({provider:"transformers-local",model:"BAAI/bge-small-zh-v1.5",dimensions:512}),[M,G]=(0,a.useState)(R),[L,q]=(0,a.useState)(!1),[X,Z]=(0,a.useState)(!1),[V,J]=(0,a.useState)(!1),[Y,$]=(0,a.useState)(null),[ee,el]=(0,a.useState)(null),[es,eo]=(0,a.useState)({}),[ea,er]=(0,a.useState)(!1),[ei,et]=(0,a.useState)(!1),[en,ec]=(0,a.useState)(""),[ed,em]=(0,a.useState)(""),[eh,ex]=(0,a.useState)(""),[ep,ey]=(0,a.useState)(""),[eu,ev]=(0,a.useState)("openai"),[ej,eg]=(0,a.useState)(!1),[eA,ef]=(0,a.useState)({}),[eb,eS]=(0,a.useState)(!1),ew=async()=>{U(!0);try{let[e,l,s,o]=await Promise.all([(0,K.Z3)().catch(()=>[]),(0,K.zr)().catch(()=>null),(0,K.II)().catch(()=>({provider:"transformers-local",model:"BAAI/bge-small-zh-v1.5",dimensions:512})),(0,K.jQ)().catch(()=>R)]);O(e),W(l),Q(s),G(o)}catch(s){l.error(e("common.error"))}finally{U(!1)}};(0,a.useEffect)(()=>{ew()},[]);let ez=async e=>{et(!0),ec(e.name),em(e.name),ex(""),ey(e.baseUrl||""),ev(e.protocol||e.detectedProtocol||"openai"),ef(e.capabilities||{});try{let l=await (0,K.Bh)(e.name);ex(l.apiKey?"••••••••":""),ey(l.baseUrl||""),ef(l.capabilities||{})}catch(e){}er(!0)},ek=async()=>{if(ed.trim()){eS(!0);try{let s=ei&&eh.includes("•")?void 0:eh||void 0;await (0,K._m)(ed.trim(),{oldName:ei?en:void 0,apiKey:s,baseUrl:ep||void 0,protocol:eu,directEndpoint:ej,capabilities:eA}),er(!1),await ew(),l.success(e("common.success"))}catch(s){l.error(e("common.error"))}finally{eS(!1)}}},eC=async s=>{try{await (0,K.h1)(s),await ew(),l.success(e("common.success"))}catch(s){l.error(e("common.error"))}},eP=async s=>{el(s);try{let o=await (0,K.bZ)(s);eo(e=>({...e,[s]:o.success}));let a=o.success?e("models.connected"):"".concat(e("models.connectionFailed")).concat(o.message?":".concat(o.message):"").concat(o.requestId?" (".concat(o.requestId,")"):"");l[o.success?"success":"error"](a)}catch(o){eo(e=>({...e,[s]:!1})),l.error(o instanceof Error?o.message:e("models.connectionFailed"))}finally{el(null)}},eB=async(s,o)=>{if(!D)return;let a={...D},r=a[s];if(!o){r.active="",W(a);try{await (0,K.aP)(a)}catch(s){l.error(e("common.error"))}return}let[i,t]=o.includes(":")?o.split(":"):[o,o];r.active=t,r.list.some(e=>e.name===t&&e.provider===i)||r.list.push({name:t,provider:i}),W(a);try{await (0,K.aP)(a)}catch(s){l.error(e("common.error"))}},eI=async()=>{Z(!0);try{let s=await (0,K.dd)(H);Q(s),$(null),l.success(e("common.success"))}catch(s){l.error(e("common.error"))}finally{Z(!1)}},eT=async()=>{J(!0);try{let s=await (0,K.u6)();$(s.success),l[s.success?"success":"error"](s.message||(s.success?e("models.connected"):e("models.connectionFailed")))}catch(e){$(!1)}finally{J(!1)}},eK=async s=>{G(s),q(!0);try{let o=await (0,K.IW)(s);G(o),l.success(e("common.success"))}catch(s){G(M),l.error(e("common.error"))}finally{q(!1)}};return s?(0,o.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,o.jsx)(t.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,o.jsx)(n.A,{size:"small",children:(0,o.jsx)(t.A,{active:!0,paragraph:{rows:6}})}),(0,o.jsx)(n.A,{size:"small",children:(0,o.jsx)(t.A,{active:!0,paragraph:{rows:4}})}),(0,o.jsx)(n.A,{size:"small",children:(0,o.jsx)(t.A,{active:!0,paragraph:{rows:3}})})]}):(0,o.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"pageTitle",children:e("models.title")}),(0,o.jsx)("p",{className:"pageDesc",children:e("models.description")})]}),(0,o.jsx)(c.Ay,{type:"primary",icon:(0,o.jsx)(S.A,{}),onClick:()=>{et(!1),ec(""),em(""),ex(""),ey(""),ev("openai"),eg(!1),ef({}),er(!0)},children:e("models.addModel")})]}),(0,o.jsx)(n.A,{size:"small",title:"".concat(e("models.modelList")," (").concat(_.length,")"),children:0===_.length?(0,o.jsx)("span",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:e("models.noProviders")}):(0,o.jsx)(d.A,{gutter:[12,12],children:_.map(l=>(0,o.jsx)(m.A,{xs:24,sm:12,lg:8,xl:6,children:(0,o.jsxs)(n.A,{size:"small",hoverable:!0,style:{height:"100%"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,marginBottom:8,minWidth:0},children:[(0,o.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,o.jsx)("div",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.name}),(0,o.jsxs)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:[(0,o.jsx)(w.A,{})," ",l.protocol||l.detectedProtocol||"openai"]})]}),(0,o.jsxs)(h.A,{size:2,children:[(0,o.jsx)(c.Ay,{size:"small",loading:ee===l.name,onClick:()=>{eP(l.name)},icon:!0===es[l.name]?(0,o.jsx)(z.A,{style:{color:"var(--colorOk)"}}):!1===es[l.name]?(0,o.jsx)(k.A,{style:{color:"var(--colorDanger)"}}):(0,o.jsx)(C.A,{})}),(0,o.jsx)(c.Ay,{size:"small",icon:(0,o.jsx)(P.A,{}),onClick:()=>{ez(l)}}),(0,o.jsx)(x.A,{title:e("models.deleteProviderConfirm"),onConfirm:()=>{eC(l.name)},children:(0,o.jsx)(c.Ay,{size:"small",danger:!0,icon:(0,o.jsx)(B.A,{})})})]})]}),(0,o.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,o.jsxs)("span",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:[(0,o.jsx)(I.A,{})," ",l.hasApiKey?"••••••••":"—"]}),l.baseUrl&&(0,o.jsxs)("span",{style:{fontSize:12,color:"var(--colorTextSecondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:l.baseUrl,children:[(0,o.jsx)(T.A,{})," ",l.baseUrl]}),(0,o.jsx)(h.A,{size:4,wrap:!0,children:F.filter(e=>{var s;return null==(s=l.capabilities)?void 0:s[e.key]}).map(e=>(0,o.jsx)(p.A,{color:"purple",style:{margin:0,fontSize:10,lineHeight:"16px"},children:e.label},e.key))})]})]})},l.name))})}),(0,o.jsxs)(n.A,{size:"small",title:e("models.embeddingConfig"),children:[(0,o.jsx)(y.A,{type:"info",showIcon:!0,description:e("models.embeddingHint"),style:{marginBottom:16}}),(0,o.jsxs)(d.A,{gutter:[12,12],children:[(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.embeddingProvider")}),(0,o.jsx)(u.A,{value:H.provider,style:{width:"100%"},options:[{label:"本地语义模型(推荐)",value:"transformers-local"},{label:"外部 Embedding(高级)",value:"openai-compatible"}],onChange:e=>Q(l=>({...l,provider:e,model:"transformers-local"===e?l.model||"BAAI/bge-small-zh-v1.5":l.model,dimensions:"transformers-local"===e?512:l.dimensions||1024}))})]}),"openai-compatible"===H.provider&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:"Base URL"}),(0,o.jsx)(v.A,{value:H.baseUrl,onChange:e=>Q(l=>({...l,baseUrl:e.target.value})),placeholder:"http://localhost:11434/v1"})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.model")}),(0,o.jsx)(v.A,{value:H.model,onChange:e=>Q(l=>({...l,model:e.target.value})),placeholder:"bge-m3"})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.apiKey")}),(0,o.jsx)(v.A.Password,{value:H.apiKey,onFocus:()=>{var e;(null==(e=H.apiKey)?void 0:e.includes("•"))&&Q(e=>({...e,apiKey:""}))},onChange:e=>Q(l=>({...l,apiKey:e.target.value})),placeholder:e("models.optional")}),H.hasApiKey&&(0,o.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginTop:4},children:e("models.embeddingApiKeyHint")})]})]}),"transformers-local"===H.provider&&(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.model")}),(0,o.jsx)(v.A,{value:H.model,onChange:e=>Q(l=>({...l,model:e.target.value})),placeholder:"BAAI/bge-small-zh-v1.5"})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.dimensions")}),(0,o.jsx)(j.A,{style:{width:"100%"},min:1,value:H.dimensions,onChange:e=>Q(l=>({...l,dimensions:Number(e||("transformers-local"===l.provider?512:1024))}))})]}),(0,o.jsxs)(m.A,{xs:24,sm:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:e("models.status")}),(0,o.jsxs)(h.A,{children:[(0,o.jsx)(p.A,{color:"blue",children:"transformers-local"===H.provider?"本地语义模型":e("models.openAICompatible")}),!0===Y&&(0,o.jsx)(p.A,{color:"success",children:e("models.connected")}),!1===Y&&(0,o.jsx)(p.A,{color:"error",children:e("models.connectionFailed")})]})]})]}),(0,o.jsxs)(h.A,{style:{marginTop:16},children:[(0,o.jsx)(c.Ay,{type:"primary",loading:X,onClick:()=>{eI()},children:e("models.saveEmbedding")}),(0,o.jsx)(c.Ay,{loading:V,onClick:()=>{eT()},children:e("models.testEmbedding")})]})]}),(0,o.jsxs)(n.A,{size:"small",title:"联网增强",children:[(0,o.jsx)(y.A,{type:"info",showIcon:!0,description:"默认关闭。开启后,系统会受控检索公开规范、政策和通用技术资料,用于增强措施准确性;联网资料不会覆盖本地项目事实。",style:{marginBottom:16}}),(0,o.jsxs)(d.A,{gutter:[12,12],align:"middle",children:[(0,o.jsx)(m.A,{xs:24,md:8,children:(0,o.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,o.jsxs)(h.A,{children:[(0,o.jsx)(g.A,{checked:M.enabled,loading:L,onChange:e=>{eK({...M,enabled:e,allowProjectFacts:!1})}}),(0,o.jsx)("span",{style:{fontWeight:600},children:M.enabled?"已开启联网增强":"未开启联网增强"})]}),(0,o.jsx)("span",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:"仅用于公开规范、政策、工艺和措施补充,不作为项目事实来源。"})]})}),(0,o.jsxs)(m.A,{xs:24,sm:12,md:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:"每章最大查询数"}),(0,o.jsx)(j.A,{style:{width:"100%"},min:1,max:4,value:M.maxQueriesPerChapter,onChange:e=>{eK({...M,maxQueriesPerChapter:Number(e||2),allowProjectFacts:!1})}})]}),(0,o.jsxs)(m.A,{xs:24,sm:12,md:8,children:[(0,o.jsx)("div",{style:{fontSize:12,marginBottom:4,color:"var(--colorTextSecondary)"},children:"每次最大结果数"}),(0,o.jsx)(j.A,{style:{width:"100%"},min:1,max:5,value:M.maxResultsPerQuery,onChange:e=>{eK({...M,maxResultsPerQuery:Number(e||3),allowProjectFacts:!1})}})]})]})]}),D&&(0,o.jsx)(n.A,{size:"small",title:e("models.modelTiers"),children:(0,o.jsx)(d.A,{gutter:[12,12],children:N.map(l=>{let{key:s,labelKey:a,descKey:r}=l,i=D[s],t=i.list.map(e=>({label:"".concat(e.provider," / ").concat(e.name),value:"".concat(e.provider,":").concat(e.name)})),c=_.filter(e=>!i.list.some(l=>l.provider===e.name)).map(e=>({label:e.name,value:"".concat(e.name,":").concat(e.name)})),d=i.active?i.list.find(e=>e.name===i.active):null;return(0,o.jsx)(m.A,{xs:24,lg:8,children:(0,o.jsxs)(n.A,{size:"small",title:(0,o.jsx)("span",{style:{fontSize:14},children:e(a)}),style:{height:"100%"},children:[(0,o.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)",marginBottom:8,lineHeight:1.5},children:e(r)}),(0,o.jsx)(u.A,{value:i.active?"".concat((null==d?void 0:d.provider)||"",":").concat(i.active):void 0,onChange:e=>{eB(s,e)},allowClear:!0,placeholder:e("models.selectModelPlaceholder"),style:{width:"100%"},options:[...t,...c]}),d&&(()=>{let e=_.find(e=>e.name===d.provider);return(0,o.jsxs)("div",{style:{marginTop:12,padding:"8px 12px",background:"var(--colorBgElevated)",borderRadius:6,border:"1px solid var(--colorBorderSecondary)",display:"flex",alignItems:"center",gap:8},children:[(0,o.jsx)(C.A,{style:{color:"var(--colorAccent)",fontSize:14,flexShrink:0}}),(0,o.jsx)("span",{style:{fontSize:12,fontWeight:500,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.provider}),(null==e?void 0:e.capabilities)&&F.filter(l=>e.capabilities[l.key]).length>0&&(0,o.jsx)(h.A,{size:4,wrap:!0,style:{flexShrink:0},children:F.filter(l=>e.capabilities[l.key]).slice(0,2).map(e=>(0,o.jsx)(p.A,{color:"purple",style:{margin:0,fontSize:10,lineHeight:"16px"},children:e.label},e.key))}),(0,o.jsx)(p.A,{color:"blue",style:{margin:0,fontSize:10,lineHeight:"18px",flexShrink:0},children:"激活"})]})})()]})},s)})})}),(0,o.jsx)(A.A,{title:ei?e("models.editModel"):e("models.addModel"),open:ea,onClose:()=>er(!1),style:{borderRadius:"12px 0 0 12px",width:800},styles:{body:{padding:"16px 24px"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,o.jsx)(c.Ay,{type:"primary",loading:eb,onClick:()=>{ek()},children:e("common.save")}),children:(0,o.jsxs)(f.A,{layout:"vertical",children:[(0,o.jsx)(f.A.Item,{label:e("models.modelName"),children:(0,o.jsx)(v.A,{value:ed,onChange:e=>em(e.target.value),placeholder:e("models.modelNamePlaceholder")})}),(0,o.jsx)(f.A.Item,{label:e("models.apiKey"),help:ei?e("models.apiKeyEditHint"):void 0,children:(0,o.jsx)(v.A.Password,{value:eh,onFocus:()=>{ei&&eh.includes("•")&&ex("")},onChange:e=>ex(e.target.value),placeholder:ei?e("models.apiKeyEditPlaceholder"):"sk-..."})}),(0,o.jsx)(f.A.Item,{label:e("models.baseUrl"),children:(0,o.jsx)(v.A,{value:ep,onChange:e=>ey(e.target.value),placeholder:"https://api.openai.com/v1"})}),(0,o.jsx)(f.A.Item,{label:e("models.protocol"),children:(0,o.jsx)(u.A,{value:eu,onChange:ev,options:E})}),(0,o.jsx)(f.A.Item,{label:"直连端点",children:(0,o.jsx)(b.A,{checked:ej,onChange:e=>eg(e.target.checked),children:"Base URL 是完整接口地址"})}),(0,o.jsx)(f.A.Item,{label:"多模态能力",children:(0,o.jsx)(b.A.Group,{value:F.filter(e=>eA[e.key]).map(e=>e.key),options:F.map(e=>({label:e.label,value:e.key})),onChange:e=>ef(Object.fromEntries(F.map(l=>[l.key,e.includes(l.key)])))})})]})})]})}},77305:(e,l,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/models",function(){return s(22708)}])}},e=>{e.O(0,[433,787,576,195,985,797,938,238,636,593,792],()=>e(e.s=77305)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[26],{27549:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/prompt",function(){return r(34508)}])},34508:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>K});var o=r(65321),l=r(97109),i=r(44494),n=r(17807),s=r(33442),a=r(11702),c=r(56985),d=r(85114),p=r(26171),h=r(68787),m=r(88762),u=r(7576),x=r(57271),y=r(49292),f=r(55122),g=r(84253),j=r(34052),v=r(42700),w=r(54746),S=r(99650),A=r(81668),b=r(58209),C=r(26631),k=r(29606),z=r(96091),T=r(30486),N=r(46082),F=r(42758),I=r(24810),O=r(7492);async function B(){let e=await fetch("/api/prompt");if(!e.ok)throw Error("Failed");return e.json()}async function E(e,t,r){let o=await fetch("/api/prompt",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:e,content:t,name:r})});if(!o.ok)throw Error("Failed");return o.json()}async function R(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create",projectRoot:e,content:"# CUSTOMIZE\n"})});if(!t.ok)throw Error("Failed");return t.json()}async function P(e,t){let r=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"createCustom",name:e,content:t})});if(!r.ok)throw Error("Failed");return r.json()}async function W(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"select",selectedIds:e})});if(!t.ok)throw Error("Failed");return t.json()}async function D(e){let t=await fetch("/api/prompt",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"import",...e&&"object"==typeof e?e:{prompts:[]}})});if(!t.ok)throw Error(await t.text());return t.json()}async function H(){return J("",!1,60)}async function _(e){let t=await fetch("/api/kb/files/detail?relativePath=".concat(encodeURIComponent(e)));if(!t.ok)throw Error("Failed");return((await t.json()).chunks||[]).map(e=>e.content||"").filter(Boolean).join("\n\n").slice(0,12e3)}async function J(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,o=new URLSearchParams({limit:String(r)});e.trim()&&o.set("q",e.trim()),t||o.set("includeContent","0");let l=await fetch("/api/kb/files/search?".concat(o));return l.ok&&(await l.json()).files||[]}async function L(e){let t=await fetch("/api/prompt/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){let e=await t.text();try{let t=JSON.parse(e);throw Error(t.error||t.message||e||"AI 对话失败")}catch(t){throw Error(e||"AI 对话失败")}}return t.json()}function M(e,t){let r=new Blob([JSON.stringify(t,null,2)],{type:"application/json;charset=utf-8"}),o=URL.createObjectURL(r),l=document.createElement("a");l.href=o,l.download=e,l.click(),URL.revokeObjectURL(o)}function U(e){return e.id.startsWith("custom:")}function $(e){return U(e)?"custom":e.isCurrent?"current":"project"}function G(e,t,r){return e?"customize-agent:prompt-chat:".concat(e.id,":").concat(e.customizePath||e.projectName):"customize-agent:prompt-chat:draft:".concat(r||t||"new")}function X(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:220,r=e.hasFile&&e.content?e.content.replace(/^#.*$/gm,"").replace(/\n{3,}/g,"\n\n").trim():"";return r.length>t?"".concat(r.slice(0,t),"..."):r}function Y(e){let t=Date.parse(e);return Number.isNaN(t)?"-":new Date(t).toLocaleString()}function Z(e){return{type:"customize-agent.prompts",version:1,exportedAt:new Date().toISOString(),prompts:e.map(e=>({name:e.projectName,content:e.content||"",selected:e.selected,source:$(e)}))}}function q(e){let t=e.match(/(^|\s)@([^\s@]*)$/);return t?t[2]:null}function K(){let e=(0,i.Vr)(),{message:t}=n.A.useApp(),[r,K]=(0,l.useState)(!0),[V,Q]=(0,l.useState)([]),[ee,et]=(0,l.useState)(!1),[er,eo]=(0,l.useState)(null),[el,ei]=(0,l.useState)(""),[en,es]=(0,l.useState)(""),[ea,ec]=(0,l.useState)(!1),[ed,ep]=(0,l.useState)(!1),[eh,em]=(0,l.useState)("custom"),[eu,ex]=(0,l.useState)("all"),[ey,ef]=(0,l.useState)("mtime"),[eg,ej]=(0,l.useState)("list"),[ev,ew]=(0,l.useState)(""),[eS,eA]=(0,l.useState)(null),[eb,eC]=(0,l.useState)([]),[ek,ez]=(0,l.useState)(!1),[eT,eN]=(0,l.useState)([]),[eF,eI]=(0,l.useState)(""),[eO,eB]=(0,l.useState)(""),[eE,eR]=(0,l.useState)(!1),[eP,eW]=(0,l.useState)([]),[eD,eH]=(0,l.useState)([]),[e_,eJ]=(0,l.useState)([]),[eL,eM]=(0,l.useState)(!1),[eU,e$]=(0,l.useState)(!1),[eG,eX]=(0,l.useState)(!1),eY=(0,l.useRef)(null),eZ=(0,l.useRef)(null),eq=q(eO),eK=async()=>{K(!0);try{Q(await B())}catch(r){t.error(e("common.error"))}finally{K(!1)}};(0,l.useEffect)(()=>{eK()},[]),(0,l.useEffect)(()=>{let e=window.localStorage.getItem("customize-agent:prompt-view-mode");("list"===e||"card"===e)&&ej(e)},[]),(0,l.useEffect)(()=>{window.localStorage.setItem("customize-agent:prompt-view-mode",eg)},[eg]),(0,l.useEffect)(()=>{let e=eZ.current;e&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"}),eF&&window.localStorage.setItem(eF,JSON.stringify(eT.slice(-30)))},[eT,eE,eF]),(0,l.useEffect)(()=>{!ee||eP.length>0||eL||(eM(!0),H().then(eW).catch(()=>void 0).finally(()=>eM(!1)))},[ee,eP.length,eL]),(0,l.useEffect)(()=>{let e=null==eq?void 0:eq.trim();if(!ee||!e){eH([]),e$(!1);return}let t=!1;e$(!0);let r=window.setTimeout(()=>{J(e).then(e=>{t||eH(e)}).catch(()=>{t||eH([])}).finally(()=>{t||e$(!1)})},250);return()=>{t=!0,window.clearTimeout(r)}},[ee,eq]);let eV=V.find(e=>e.isCurrent),eQ=V.filter(U),e0={all:V.length,custom:V.filter(e=>"custom"===$(e)).length,current:V.filter(e=>"current"===$(e)).length,project:V.filter(e=>"project"===$(e)).length,selected:V.filter(e=>e.selected).length,unselected:V.filter(e=>!e.selected).length,hasFile:V.filter(e=>e.hasFile).length,missingFile:V.filter(e=>!e.hasFile).length},e1=V.filter(e=>{var t;let r=$(e);return("all"===eh||r===eh)&&("selected"!==eu||!!e.selected)&&("unselected"!==eu||!e.selected)&&("hasFile"!==eu||!!e.hasFile)&&("missingFile"!==eu||!e.hasFile)&&(!ev.trim()||(t=ev.trim(),!!"".concat(e.projectName,"\n").concat(e.projectRoot||"","\n").concat(e.customizePath||"","\n").concat(e.content||"").toLowerCase().includes(t.toLowerCase())))}).sort((e,t)=>"name"===ey?e.projectName.localeCompare(t.projectName):"source"===ey?["custom","current","project"].indexOf($(e))-["custom","current","project"].indexOf($(t)):"selected"===ey&&Number(t.selected)-Number(e.selected)||Date.parse(t.mtime||"")-Date.parse(e.mtime||"")),e2=e1.find(e=>e.id===eS)||e1[0]||null,e8=eb.filter(e=>e1.some(t=>t.id===e)),e4=(null==eq?void 0:eq.trim())?eD:eP,e6=(e,t,r)=>{let o=G(e,t,r);eI(o),eN(function(e){try{let t=JSON.parse(window.localStorage.getItem(e)||"[]");return Array.isArray(t)?t.filter(e=>("user"===e.role||"assistant"===e.role)&&"string"==typeof e.content).slice(-30):[]}catch(e){return[]}}(o)),eB(""),eR(!1),eJ([]),eX(!1)},e7=r=>{if(null==r?void 0:r.projectRoot)return void R(r.projectRoot).then(()=>{t.success(e("common.success")),eK()}).catch(()=>t.error(e("common.error")));let o="new:".concat(Date.now());eo(null),ep(!0),es(""),ei(""),e6(null,"new",o),et(!0)},e3=async()=>{if(!en.trim())return void t.error("请输入名称");ec(!0);try{if(er)await E(er.customizePath,el,U(er)?en.trim():void 0),t.success(e("common.success"));else{let r=await P(en.trim(),el||"# ".concat(en.trim(),"\n"));!function(e,t){if(!e||!t||e===t)return;let r=window.localStorage.getItem(e);r&&!window.localStorage.getItem(t)&&window.localStorage.setItem(t,r)}(eF,G({id:r.id,projectId:r.id,projectName:en.trim(),customizePath:r.id,content:el,mtime:"",hasFile:!0,isCurrent:!1,selected:!1,source:"custom"},en.trim())),t.success(e("common.success"))}et(!1),await eK()}catch(r){t.error(e("common.error"))}finally{ec(!1)}},e5=async e=>{let t=Array.from(new Set([...e_,...eP.filter(t=>e.includes("@".concat(t.relativePath))).map(e=>e.relativePath)])).slice(0,3),r=[];for(let e of t){let t=await _(e);t&&r.push({relativePath:e,content:t})}return r},e9=async()=>{let e=eO.trim();if(!e||eE)return;let r=[...eT,{role:"user",content:e}];eN(r),eB(""),eX(!1),eR(!0);try{let t=await e5(e),o=await L({name:en||(null==er?void 0:er.projectName)||"未命名提示词",content:el,message:e,history:eT,references:t});eN([...r,{role:"assistant",content:o.content||"AI 未返回内容"}])}catch(e){t.error(e instanceof Error?e.message:"AI 对话失败,请检查模型配置"),eN(r)}finally{eR(!1)}},te=async(r,o)=>{let l=o?Array.from(new Set([...V.filter(e=>e.selected).map(e=>e.id),r.id])):V.filter(e=>e.selected&&e.id!==r.id).map(e=>e.id);try{await W(l),Q(e=>e.map(e=>({...e,selected:l.includes(e.id)})))}catch(r){t.error(e("common.error"))}},tt=async r=>{let o=V.filter(e=>e.selected).map(e=>e.id),l=r?Array.from(new Set([...o,...e8])):o.filter(e=>!e8.includes(e));try{await W(l),Q(e=>e.map(e=>({...e,selected:l.includes(e.id)}))),eC([]),t.success(e("common.success"))}catch(r){t.error(e("common.error"))}},tr=async r=>{try{if(!(await fetch("/api/prompt",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:r.projectId,filePath:r.customizePath})})).ok)throw Error("Failed");t.success(e("common.success")),eC(e=>e.filter(e=>e!==r.id)),await eK()}catch(r){t.error(e("common.error"))}},to=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"custom",r="checked"===e?V.filter(e=>e8.includes(e.id)):"filtered"===e?e1:eQ;M("customize-prompts-".concat(new Date().toISOString().slice(0,10),".json"),Z(r)),t.success("已导出 ".concat(r.length," 条提示词"))},tl=async e=>{if(e){ez(!0);try{let r=await e.text(),o=JSON.parse(r),l=await D(o);t.success("已导入 ".concat(l.imported," 条提示词")),await eK()}catch(e){t.error("导入失败,请确认 JSON 文件格式正确")}finally{ez(!1),eY.current&&(eY.current.value="")}}},ti=e=>{let t=$(e);return(0,o.jsxs)(s.A,{size:4,wrap:!0,children:[(0,o.jsx)(a.A,{color:"custom"===t?"cyan":"current"===t?"green":"project"===t?"blue":"default",style:{margin:0},children:"custom"===t?"我的提示词":"current"===t?"当前项目":"project"===t?"其他项目":"全部"}),e.selected&&(0,o.jsx)(a.A,{color:"purple",style:{margin:0},children:"已选中"}),!e.hasFile&&(0,o.jsx)(a.A,{style:{margin:0},children:"无文件"})]})},tn=e=>(0,o.jsxs)(s.A,{size:6,children:[e.hasFile&&(0,o.jsx)(c.A,{checked:e.selected,onChange:t=>{te(e,t.target.checked)},children:"选中"}),!e.hasFile&&e.projectRoot&&(0,o.jsx)(d.Ay,{size:"small",icon:(0,o.jsx)(w.A,{}),onClick:()=>e7(e),children:"创建"}),e.hasFile&&(0,o.jsx)(d.Ay,{size:"small",icon:(0,o.jsx)(S.A,{}),onClick:()=>{eo(e),ep(!1),es(e.projectName),ei(e.content||""),e6(e,e.projectName),et(!0)},children:"编辑"}),e.hasFile&&(0,o.jsx)(d.Ay,{size:"small",icon:(0,o.jsx)(A.A,{}),onClick:()=>{var r;return r=e,void(M("customize-prompt-".concat(r.projectName.trim().replace(/[\\/:*?"<>|]/g,"-").slice(0,80)||"untitled","-").concat(new Date().toISOString().slice(0,10),".json"),Z([r])),t.success("已导出 1 条提示词"))},children:"导出"}),(0,o.jsx)(p.A,{title:U(e)?"删除自定义提示词?":"删除项目记录及文件?",onConfirm:()=>{tr(e)},children:(0,o.jsx)(d.Ay,{size:"small",danger:!0,icon:(0,o.jsx)(b.A,{})})})]});return r?(0,o.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,o.jsx)(m.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,o.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:12},children:Array.from({length:4}).map((e,t)=>(0,o.jsx)(h.A,{size:"small",children:(0,o.jsx)(m.A,{active:!0,paragraph:{rows:4}})},t))})]}):(0,o.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h1",{className:"pageTitle",children:e("nav.promptManagement")}),(0,o.jsx)("p",{className:"pageDesc",children:e("prompt.description")})]}),(0,o.jsxs)(s.A,{wrap:!0,children:[eV&&(0,o.jsxs)(a.A,{color:"green",style:{lineHeight:"22px"},children:[(0,o.jsx)(k.A,{})," ",eV.projectRoot]}),(0,o.jsx)("input",{ref:eY,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:e=>{var t;tl(null==(t=e.target.files)?void 0:t[0])}}),(0,o.jsx)(d.Ay,{icon:(0,o.jsx)(z.A,{}),loading:ek,onClick:()=>{var e;return null==(e=eY.current)?void 0:e.click()},children:"导入"}),(0,o.jsx)(d.Ay,{icon:(0,o.jsx)(A.A,{}),disabled:0===e1.length,onClick:()=>to("filtered"),children:"导出筛选"}),(0,o.jsx)(d.Ay,{type:"primary",icon:(0,o.jsx)(w.A,{}),onClick:()=>e7(),children:"创建提示词"})]})]}),(0,o.jsxs)(h.A,{size:"small",styles:{body:{display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"}},children:[(0,o.jsx)(u.A,{prefix:(0,o.jsx)(T.A,{}),allowClear:!0,placeholder:"搜索名称、内容、路径...",value:ev,onChange:e=>ew(e.target.value),style:{width:280}}),(0,o.jsx)(x.A,{value:eh,onChange:em,style:{width:150},options:[{label:"全部 (".concat(e0.all,")"),value:"all"},{label:"我的提示词 (".concat(e0.custom,")"),value:"custom"},{label:"当前项目 (".concat(e0.current,")"),value:"current"},{label:"其他项目 (".concat(e0.project,")"),value:"project"}]}),(0,o.jsx)(x.A,{value:eu,onChange:ex,style:{width:130},options:[{label:"全部状态",value:"all"},{label:"已选中 (".concat(e0.selected,")"),value:"selected"},{label:"未选中 (".concat(e0.unselected,")"),value:"unselected"},{label:"有文件 (".concat(e0.hasFile,")"),value:"hasFile"},{label:"无文件 (".concat(e0.missingFile,")"),value:"missingFile"}]}),(0,o.jsx)(x.A,{value:ey,onChange:ef,style:{width:140},options:[{label:"最近修改优先",value:"mtime"},{label:"名称 A-Z",value:"name"},{label:"来源优先",value:"source"},{label:"已选中优先",value:"selected"}]}),(0,o.jsx)(y.A,{value:eg,onChange:e=>ej(e),options:[{label:(0,o.jsx)(N.A,{}),value:"list"},{label:(0,o.jsx)(F.A,{}),value:"card"}]}),(0,o.jsx)("div",{style:{flex:1}}),(0,o.jsxs)("span",{style:{color:"var(--colorTextSecondary)",fontSize:13},children:["已显示 ",e1.length," / ",V.length]})]}),(0,o.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"260px minmax(0, 1fr)",gap:14,alignItems:"start"},children:[(0,o.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[(0,o.jsxs)(h.A,{size:"small",title:"分组导航",styles:{body:{padding:8}},children:[[["all","全部",e0.all],["custom","我的提示词",e0.custom],["current","当前项目",e0.current],["project","其他项目",e0.project]].map(e=>{let[t,r,l]=e;return(0,o.jsxs)("button",{onClick:()=>em(t),style:{width:"100%",border:"none",background:eh===t?"var(--colorFillSecondary)":"transparent",color:"var(--colorText)",padding:"9px 10px",borderRadius:8,display:"flex",justifyContent:"space-between",cursor:"pointer",fontWeight:eh===t?700:400},children:[(0,o.jsx)("span",{children:r}),(0,o.jsx)("span",{children:l})]},t)}),(0,o.jsx)(f.A,{style:{margin:"8px 0"}}),[["selected","已选中",e0.selected],["unselected","未选中",e0.unselected]].map(e=>{let[t,r,l]=e;return(0,o.jsxs)("button",{onClick:()=>ex(eu===t?"all":t),style:{width:"100%",border:"none",background:eu===t?"var(--colorFillSecondary)":"transparent",color:"var(--colorText)",padding:"9px 10px",borderRadius:8,display:"flex",justifyContent:"space-between",cursor:"pointer",fontWeight:eu===t?700:400},children:[(0,o.jsx)("span",{children:r}),(0,o.jsx)("span",{children:l})]},t)})]}),(0,o.jsx)(h.A,{size:"small",title:"详情预览",styles:{body:{height:300,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:e2?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[(0,o.jsx)(C.A,{style:{color:"var(--colorAccent)",flexShrink:0}}),(0,o.jsx)("strong",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e2.projectName})]}),(0,o.jsx)("div",{style:{minWidth:0,overflow:"hidden"},children:ti(e2)}),(0,o.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12,lineHeight:1.7,minWidth:0},children:[(0,o.jsxs)("div",{children:["更新时间:",Y(e2.mtime)]}),(0,o.jsxs)("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["文件路径:",e2.customizePath||"-"]}),(0,o.jsxs)("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["项目路径:",e2.projectRoot||"-"]})]}),(0,o.jsx)("div",{style:{flex:1,minHeight:0,padding:10,borderRadius:8,background:"var(--colorFillAlter)",color:"var(--colorTextSecondary)",fontSize:12,lineHeight:1.7,overflow:"auto",whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-word"},children:X(e2,800)||"暂无内容预览"}),(0,o.jsx)("div",{children:tn(e2)})]}):(0,o.jsx)(g.A,{image:g.A.PRESENTED_IMAGE_SIMPLE,description:"请选择一个提示词"})})]}),(0,o.jsxs)("div",{style:{minWidth:0},children:[e8.length>0&&(0,o.jsxs)(h.A,{size:"small",style:{marginBottom:12},styles:{body:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"}},children:[(0,o.jsxs)("span",{style:{fontWeight:600},children:["已选择 ",e8.length," 项"]}),(0,o.jsx)(d.Ay,{size:"small",onClick:()=>{tt(!0)},children:"批量选中"}),(0,o.jsx)(d.Ay,{size:"small",onClick:()=>{tt(!1)},children:"取消选中"}),(0,o.jsx)(d.Ay,{size:"small",icon:(0,o.jsx)(A.A,{}),onClick:()=>to("checked"),children:"导出选中"}),(0,o.jsx)(d.Ay,{size:"small",onClick:()=>eC([]),children:"清空选择"})]}),0===e1.length?(0,o.jsx)(h.A,{children:(0,o.jsx)(g.A,{description:ev||"all"!==eu?"没有找到匹配的提示词,请尝试更换关键词或清空筛选条件":"当前分组没有提示词"})}):"list"===eg?(0,o.jsx)(s.A,{direction:"vertical",size:10,style:{width:"100%"},children:e1.map(e=>{let t=X(e,180),r=(null==e2?void 0:e2.id)===e.id;return(0,o.jsxs)("div",{onClick:()=>eA(e.id),style:{display:"grid",gridTemplateColumns:"28px minmax(0, 1fr) auto",gap:12,alignItems:"center",padding:14,border:"1px solid ".concat(r?"var(--colorAccent)":"var(--colorBorderSecondary)"),borderRadius:12,background:r?"var(--colorFillSecondary)":"var(--colorBgContainer)",cursor:"pointer",transition:"all .2s ease"},children:[(0,o.jsx)(c.A,{checked:eb.includes(e.id),onClick:e=>e.stopPropagation(),onChange:t=>eC(r=>t.target.checked?Array.from(new Set([...r,e.id])):r.filter(t=>t!==e.id))}),(0,o.jsxs)("div",{style:{minWidth:0},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[(0,o.jsx)(C.A,{style:{color:e.isCurrent?"var(--colorOk)":"var(--colorAccent)"}}),(0,o.jsx)("span",{style:{fontWeight:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.projectName}),ti(e)]}),(0,o.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginBottom:6*!!t},children:[(0,o.jsx)(k.A,{style:{marginRight:4}}),e.projectRoot||e.customizePath||"本地提示词"," \xb7 ",Y(e.mtime)]}),t&&(0,o.jsx)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12,lineHeight:1.6,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",whiteSpace:"pre-wrap"},children:t})]}),(0,o.jsx)("div",{onClick:e=>e.stopPropagation(),children:tn(e)})]},e.id)})}):(0,o.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:12},children:e1.map(e=>{let t=X(e,180),r=(null==e2?void 0:e2.id)===e.id;return(0,o.jsxs)(h.A,{size:"small",hoverable:!0,onClick:()=>eA(e.id),style:{borderColor:r?"var(--colorAccent)":void 0},styles:{body:{display:"flex",flexDirection:"column",minHeight:210}},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,o.jsx)(c.A,{checked:eb.includes(e.id),onClick:e=>e.stopPropagation(),onChange:t=>eC(r=>t.target.checked?Array.from(new Set([...r,e.id])):r.filter(t=>t!==e.id))}),(0,o.jsx)(C.A,{style:{color:e.isCurrent?"var(--colorOk)":"var(--colorAccent)"}}),(0,o.jsx)("span",{style:{fontWeight:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:e.projectName})]}),(0,o.jsx)("div",{style:{marginBottom:8},children:ti(e)}),(0,o.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginBottom:8},children:[(0,o.jsx)(k.A,{style:{marginRight:4}}),e.projectRoot||e.customizePath||"本地提示词"]}),(0,o.jsx)("div",{style:{padding:10,background:"var(--colorFillAlter)",borderRadius:8,color:"var(--colorTextSecondary)",fontSize:12,lineHeight:1.6,minHeight:72,maxHeight:72,overflow:"hidden",whiteSpace:"pre-wrap"},children:t||"暂无内容预览"}),(0,o.jsxs)("div",{style:{marginTop:"auto",paddingTop:10,borderTop:"1px solid var(--colorBorderSecondary)",display:"flex",justifyContent:"space-between",alignItems:"center"},onClick:e=>e.stopPropagation(),children:[(0,o.jsx)("span",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:Y(e.mtime)}),tn(e)]})]},e.id)})})]})]}),(0,o.jsxs)(j.A,{title:ed?"创建提示词":er&&U(er)?"编辑我的提示词 — ".concat(en||er.projectName):"编辑项目提示词 — ".concat((null==er?void 0:er.projectName)||""),open:ee,onClose:()=>et(!1),width:980,maskClosable:!1,style:{borderRadius:"12px 0 0 12px"},styles:{body:{padding:"16px 24px",display:"grid",gridTemplateRows:"minmax(320px, 1fr) 420px",gap:14,height:"100%"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,o.jsxs)(s.A,{children:[(0,o.jsx)(d.Ay,{onClick:()=>et(!1),children:e("common.cancel")}),(0,o.jsx)(d.Ay,{type:"primary",loading:ea,onClick:()=>{e3()},children:e("common.save")})]}),children:[(0,o.jsxs)("div",{style:{minHeight:0,display:"flex",flexDirection:"column"},children:[(0,o.jsx)("div",{style:{marginBottom:12},children:ed||er&&U(er)?(0,o.jsxs)(s.A,{direction:"vertical",size:6,style:{width:"100%"},children:[(0,o.jsx)(u.A,{placeholder:"提示词名称",value:en,onChange:e=>es(e.target.value),style:{maxWidth:520}}),!ed&&(0,o.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:null==er?void 0:er.customizePath})]}):(0,o.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:null==er?void 0:er.customizePath})}),(0,o.jsx)(u.A.TextArea,{value:el,onChange:e=>ei(e.target.value),style:{flex:1,minHeight:280,fontFamily:"SF Mono, Monaco, Consolas, monospace",fontSize:13,resize:"none"}})]}),(0,o.jsxs)("div",{style:{minHeight:0,border:"1px solid var(--colorBorderSecondary)",borderRadius:10,background:"var(--colorBgContainer)",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 8px 24px rgba(15, 23, 42, 0.06)"},children:[(0,o.jsxs)("div",{style:{padding:"10px 12px",borderBottom:"1px solid var(--colorBorderSecondary)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,o.jsxs)(s.A,{size:6,children:[(0,o.jsx)(I.A,{style:{color:"var(--colorAccent)"}}),(0,o.jsx)("span",{style:{fontWeight:600},children:"AI 提示词助手"})]}),(0,o.jsxs)(s.A,{size:6,children:[eT.length>0&&(0,o.jsx)(d.Ay,{size:"small",onClick:()=>eN([]),children:"清空历史"}),eE?(0,o.jsx)(a.A,{color:"processing",style:{margin:0},children:"生成中"}):(0,o.jsx)(a.A,{color:"blue",style:{margin:0},children:"可对话优化"})]})]}),(0,o.jsx)("div",{ref:eZ,style:{flex:1,minHeight:0,overflowY:"auto",padding:14,background:"var(--colorFillAlter)"},children:0!==eT.length||eE?(0,o.jsxs)(s.A,{direction:"vertical",size:12,style:{width:"100%"},children:[eT.map((e,r)=>{let l="user"===e.role;return(0,o.jsx)("div",{style:{display:"flex",justifyContent:l?"flex-end":"flex-start"},children:(0,o.jsxs)("div",{style:{maxWidth:"78%",padding:"10px 12px",borderRadius:12,background:l?"var(--colorFillSecondary)":"var(--colorBgContainer)",color:"var(--colorText)",border:"1px solid var(--colorBorderSecondary)",whiteSpace:"pre-wrap",lineHeight:1.7,fontSize:13,transition:"all .2s ease"},children:[e.content,!l&&(0,o.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:8},children:(0,o.jsx)(d.Ay,{size:"small",type:"primary",onClick:()=>{ei(e.content),t.success("已应用到编辑内容,请确认后保存")},children:"应用"})})]})},"".concat(e.role,"-").concat(r))}),eE&&(0,o.jsx)("div",{style:{display:"flex",justifyContent:"flex-start"},children:(0,o.jsxs)("div",{style:{padding:"10px 12px",borderRadius:12,background:"var(--colorBgContainer)",border:"1px solid var(--colorBorderSecondary)",color:"var(--colorTextSecondary)",fontSize:13},children:[(0,o.jsx)(v.A,{size:"small",style:{marginRight:8}}),"AI 正在分析并生成内容..."]})})]}):(0,o.jsx)(g.A,{image:g.A.PRESENTED_IMAGE_SIMPLE,description:"输入 @ 召回知识库文件,再描述你的优化目标"})}),(0,o.jsx)(f.A,{style:{margin:0}}),(0,o.jsxs)("div",{style:{padding:12},children:[e_.length>0&&(0,o.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:8},children:e_.map(e=>(0,o.jsxs)(a.A,{closable:!0,onClose:()=>eJ(t=>t.filter(t=>t!==e)),style:{margin:0,maxWidth:360,overflow:"hidden",textOverflow:"ellipsis"},children:["@",e]},e))}),eG&&(0,o.jsxs)("div",{style:{maxHeight:260,overflowY:"auto",marginBottom:8,border:"1px solid var(--colorBorderSecondary)",borderRadius:12,background:"var(--colorBgElevated, var(--colorBgContainer))",boxShadow:"0 16px 40px rgba(15, 23, 42, 0.14)"},children:[(0,o.jsxs)("div",{style:{position:"sticky",top:0,zIndex:1,padding:"10px 12px",borderBottom:"1px solid var(--colorBorderSecondary)",background:"var(--colorBgElevated, var(--colorBgContainer))",display:"flex",justifyContent:"space-between",gap:12,alignItems:"center"},children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{style:{color:"var(--colorText)",fontSize:13,fontWeight:700},children:"召回知识库文件"}),(0,o.jsx)("div",{style:{color:"var(--colorTextSecondary)",fontSize:11},children:"支持文件名与知识库内容检索,最多召回 3 个文件"})]}),(0,o.jsx)(a.A,{color:eq?"blue":"default",style:{margin:0,maxWidth:240,overflow:"hidden",textOverflow:"ellipsis"},children:eq?"@".concat(eq):"输入 @关键词"})]}),eL?(0,o.jsxs)("div",{style:{padding:14,color:"var(--colorTextSecondary)",fontSize:12},children:[(0,o.jsx)(v.A,{size:"small",style:{marginRight:8}}),"正在加载知识库文件..."]}):0===eP.length?(0,o.jsx)("div",{style:{padding:14,color:"var(--colorTextSecondary)",fontSize:12},children:"暂无可召回的知识库文件"}):0===e4.length?(0,o.jsx)("div",{style:{padding:14,color:"var(--colorTextSecondary)",fontSize:12},children:eU?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(v.A,{size:"small",style:{marginRight:8}}),"正在检索知识库内容..."]}):"没有匹配的知识库文件,请换个关键词"}):(0,o.jsxs)(o.Fragment,{children:[eU&&(0,o.jsxs)("div",{style:{padding:"8px 12px",color:"var(--colorTextSecondary)",fontSize:12,borderBottom:"1px solid var(--colorBorderSecondary)"},children:[(0,o.jsx)(v.A,{size:"small",style:{marginRight:8}}),"正在继续检索内容匹配..."]}),e4.slice(0,30).map(e=>(0,o.jsxs)("div",{onMouseDown:t=>{var r;t.preventDefault(),r=e.relativePath,eJ(e=>e.includes(r)?e:[...e,r]),eB(e=>e.replace(/(^|\s)@([^\s@]*)$/,"$1@".concat(r," "))),eX(!1)},style:{padding:"10px 12px",cursor:"pointer",borderBottom:"1px solid var(--colorBorderSecondary)",fontSize:12,display:"grid",gridTemplateColumns:"22px minmax(0, 1fr) auto",gap:10,alignItems:"center"},children:[(0,o.jsx)("div",{style:{width:22,height:22,borderRadius:7,background:"var(--colorFillSecondary)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,o.jsx)(C.A,{style:{color:"var(--colorAccent)"}})}),(0,o.jsxs)("div",{style:{minWidth:0},children:[(0,o.jsx)("div",{style:{color:"var(--colorText)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:700},children:e.relativePath}),(0,o.jsxs)("div",{style:{color:"var(--colorTextSecondary)",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.category||"未分类"," \xb7 ",e.format||"未知格式","number"==typeof e.score?" \xb7 score ".concat(e.score.toFixed(2)):""]})]}),(0,o.jsxs)(s.A,{size:4,children:[(0,o.jsx)(a.A,{color:"content"===e.matchedBy?"purple":"disk"===e.matchedBy?"orange":"blue",style:{margin:0},children:"content"===e.matchedBy?"内容匹配":"disk"===e.matchedBy?"磁盘文件":"文件匹配"}),(0,o.jsx)(a.A,{style:{margin:0},children:e.status})]})]},e.relativePath))]})]}),(0,o.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-end"},children:[(0,o.jsx)(u.A.TextArea,{value:eO,onChange:e=>{let t=e.target.value;eB(t),eX(null!==q(t))},onFocus:()=>eX(null!==q(eO)),onPressEnter:e=>{e.shiftKey||(e.preventDefault(),e9())},disabled:eE,placeholder:"输入 @ 召回知识库文件,再描述优化目标...",autoSize:{minRows:2,maxRows:5},style:{fontSize:13,lineHeight:1.6}}),(0,o.jsx)(d.Ay,{type:"primary",icon:(0,o.jsx)(O.A,{}),loading:eE,disabled:!eO.trim(),onClick:()=>{e9()},children:"发送"})]})]})]})]})]})}}},e=>{e.O(0,[433,787,576,195,985,525,636,593,792],()=>e(e.s=27549)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[199],{2256:(e,l,s)=>{"use strict";s.d(l,{A:()=>i});let i=s(25341).A},7368:(e,l,s)=>{"use strict";s.r(l),s.d(l,{default:()=>S});var i=s(65321),t=s(97109),r=s(44494),n=s(49759),o=s(88762),d=s(2256),a=s(38770),c=s(68787),x=s(11702),h=s(73340),y=s(1278);let g=(0,y.A)("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);var v=s(56733),j=s(38300);let p=(0,y.A)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);var m=s(87824);let u=(0,y.A)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var f=s(6578);let A=(e,l,s)=>(0,i.jsx)("div",{style:{width:32,height:32,borderRadius:8,background:l,display:"flex",alignItems:"center",justifyContent:"center",color:s,flexShrink:0},children:e});function S(){var e,l;let s=(0,r.Vr)("settings"),{theme:y,resolvedTheme:S,setTheme:b}=(0,n.D)(),{locale:z,setLocale:k}=(0,r.x_)(),[w,T]=(0,t.useState)(null),[B,N]=(0,t.useState)(null),[F,_]=(0,t.useState)(null),[C,I]=(0,t.useState)(!0);(0,t.useEffect)(()=>{I(!0),Promise.all([(0,f.FC)().catch(()=>null),(0,f.le)().catch(()=>null),(0,f.II)().catch(()=>null)]).then(e=>{let[l,s,i]=e;T(l),N(s),_(i)}).finally(()=>I(!1))},[]);let W="system"===y?"system":S,M=e=>"applePill".concat(e?" applePillActive":"");return C?(0,i.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,i.jsx)(o.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,i.jsxs)(d.A,{gutter:[16,16],children:[Array.from({length:4}).map((e,l)=>(0,i.jsx)(a.A,{xs:24,md:12,children:(0,i.jsx)(c.A,{size:"small",children:(0,i.jsx)(o.A,{active:!0,paragraph:{rows:2}})})},l)),(0,i.jsx)(a.A,{xs:24,children:(0,i.jsx)(c.A,{size:"small",children:(0,i.jsx)(o.A,{active:!0,paragraph:{rows:4}})})})]})]}):(0,i.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{className:"pageTitle",children:s("title")}),(0,i.jsx)("p",{className:"pageDesc",children:s("description")})]}),(0,i.jsxs)(d.A,{gutter:[16,16],children:[(0,i.jsx)(a.A,{xs:24,md:12,style:{display:"flex"},children:(0,i.jsxs)(c.A,{size:"small",style:{flex:1},styles:{body:{padding:"14px 18px"}},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[A((0,i.jsx)(h.A,{size:16}),"rgba(88,86,214,0.1)","#5856d6"),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{style:{fontWeight:600,fontSize:14},children:s("language")}),(0,i.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:s("languageDesc")})]})]}),(0,i.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,i.jsx)("button",{className:M("zh-CN"===z),onClick:()=>k("zh-CN"),children:"中文"}),(0,i.jsx)("button",{className:M("en-US"===z),onClick:()=>k("en-US"),children:"English"})]})]})}),(0,i.jsx)(a.A,{xs:24,md:12,style:{display:"flex"},children:(0,i.jsxs)(c.A,{size:"small",style:{flex:1},styles:{body:{padding:"14px 18px"}},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[A((0,i.jsx)(g,{size:16}),"rgba(250,140,22,0.1)","#fa8c16"),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{style:{fontWeight:600,fontSize:14},children:s("theme")}),(0,i.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:s("themeDesc")})]})]}),(0,i.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,i.jsxs)("button",{className:M("light"===W),onClick:()=>b("light"),children:[(0,i.jsx)(v.A,{size:14}),s("light")]}),(0,i.jsxs)("button",{className:M("dark"===W),onClick:()=>b("dark"),children:[(0,i.jsx)(j.A,{size:14}),s("dark")]}),(0,i.jsxs)("button",{className:M("system"===W),onClick:()=>b("system"),children:[(0,i.jsx)(g,{size:14}),s("system")]})]})]})}),(0,i.jsx)(a.A,{xs:24,md:12,style:{display:"flex"},children:(0,i.jsxs)(c.A,{size:"small",style:{flex:1},styles:{body:{padding:"14px 18px"}},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[A((0,i.jsx)(p,{size:16}),"rgba(22,119,255,0.1)","#1677ff"),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{style:{fontWeight:600,fontSize:14},children:"服务运行状态"}),(0,i.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:"查看当前服务是否正常,以及本机资源占用情况。"})]})]}),(0,i.jsxs)(d.A,{gutter:[12,12],children:[(0,i.jsx)(a.A,{span:12,children:(0,i.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,i.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"状态"}),(0,i.jsx)(x.A,{color:(null==B?void 0:B.status)==="ok"?"success":"error",style:{margin:0},children:(null==B?void 0:B.status)==="ok"?"运行中":"—"})]})}),(0,i.jsx)(a.A,{span:12,children:(0,i.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,i.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"运行时间"}),(0,i.jsx)("div",{style:{fontSize:14,fontWeight:600},children:B?(e=>{let l=Math.floor(e/86400),s=Math.floor(e%86400/3600),i=Math.floor(e%3600/60);return l>0?"".concat(l," 天 ").concat(s," 小时"):s>0?"".concat(s," 小时 ").concat(i," 分"):"".concat(i," 分")})(B.uptime):"—"})]})}),(0,i.jsx)(a.A,{span:12,children:(0,i.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,i.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"CPU"}),(0,i.jsx)("div",{style:{fontSize:14,fontWeight:600},children:w?"".concat(w.cpu.usagePercent.toFixed(1),"%"):"—"}),(0,i.jsxs)("div",{style:{fontSize:10,color:"var(--colorTextSecondary)"},children:[null!=(e=null==w?void 0:w.cpu.cores)?e:0," 核"]})]})}),(0,i.jsx)(a.A,{span:12,children:(0,i.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,i.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"内存"}),(0,i.jsx)("div",{style:{fontSize:14,fontWeight:600},children:w?"".concat(w.memory.processMB," MB"):"—"}),(0,i.jsxs)("div",{style:{fontSize:10,color:"var(--colorTextSecondary)"},children:["/ ",null!=(l=null==w?void 0:w.memory.totalMB)?l:0," MB"]})]})})]})]})}),(0,i.jsx)(a.A,{xs:24,md:12,style:{display:"flex"},children:(0,i.jsxs)(c.A,{size:"small",style:{flex:1},styles:{body:{padding:"14px 18px"}},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[A((0,i.jsx)(m.A,{size:16}),"rgba(82,196,26,0.1)","#52c41a"),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{style:{fontWeight:600,fontSize:14},children:"知识库向量配置"}),(0,i.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:"用于知识库检索。修改模型或维度后,建议重新索引知识库。"})]})]}),(0,i.jsxs)(d.A,{gutter:[12,12],children:[(0,i.jsx)(a.A,{span:12,children:(0,i.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,i.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"供应商"}),(0,i.jsx)(x.A,{color:"blue",style:{margin:0},children:(null==F?void 0:F.provider)||"—"})]})}),(0,i.jsx)(a.A,{span:12,children:(0,i.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,i.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"密钥状态"}),(null==F?void 0:F.hasApiKey)?(0,i.jsx)(x.A,{color:"success",style:{margin:0},children:"已配置"}):(0,i.jsx)(x.A,{color:"default",style:{margin:0},children:"未配置"})]})}),(0,i.jsx)(a.A,{span:12,children:(0,i.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,i.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"模型"}),(0,i.jsx)("div",{style:{fontSize:12,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(null==F?void 0:F.model)||"—"})]})}),(0,i.jsx)(a.A,{span:12,children:(0,i.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"10px 12px",textAlign:"left"},children:[(0,i.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:4},children:"维度"}),(0,i.jsx)("div",{style:{fontSize:14,fontWeight:600},children:(null==F?void 0:F.dimensions)?"".concat(F.dimensions):"—"})]})})]})]})}),(0,i.jsx)(a.A,{xs:24,children:(0,i.jsxs)(c.A,{size:"small",styles:{body:{padding:"14px 18px"}},children:[(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[A((0,i.jsx)(u,{size:16}),"rgba(114,46,209,0.1)","#722ed1"),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{style:{fontWeight:600,fontSize:14},children:"本地数据与使用概况"}),(0,i.jsx)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)"},children:"用户数据保存在本机,包含知识库、提示词、角色配置、规范包、生成记录和日志。"})]})]}),(0,i.jsx)(d.A,{gutter:[8,8],children:[{label:"用户数据目录",value:"~/.customize-agent/",mono:!0},{label:"知识库数据",value:"本地索引与向量库"},{label:"生成记录",value:"草稿、导出和资源"},{label:"配置数据",value:"提示词、角色、规范包"},{label:"累计任务",value:w?w.tasks.total.toLocaleString():"—"},{label:"Token 用量",value:w?w.tokens.total.toLocaleString():"—"},{label:"日志",value:"本地运行日志"},{label:"数据范围",value:"仅保存在本机"}].map(e=>(0,i.jsx)(a.A,{xs:12,sm:6,children:(0,i.jsxs)("div",{style:{background:"var(--colorFillAlter)",borderRadius:8,padding:"8px 12px"},children:[(0,i.jsx)("div",{style:{fontSize:11,color:"var(--colorTextSecondary)",marginBottom:2},children:e.label}),(0,i.jsx)("div",{style:{fontSize:13,fontWeight:600,fontFamily:e.mono?"monospace":void 0},children:e.value})]})},e.label))})]})})]})]})}},38770:(e,l,s)=>{"use strict";s.d(l,{A:()=>i});let i=s(51916).A},58451:(e,l,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return s(7368)}])}},e=>{e.O(0,[433,787,636,593,792],()=>e(e.s=58451)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[979],{14995:(e,t)=>{"use strict";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"}},39214:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/system/logs",function(){return r(91698)}])},91698:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>k});var a=r(65321),s=r(97109),i=r(35292),n=r(9137),l=r(11702),o=r(88762),c=r(33442),d=r(85114),h=r(26171),p=r(85493),g=r(7576),u=r(21289),x=r(84253),f=r(99811),y=r(58209),m=r(96651),w=r(60470),j=r(44494),v=r(6578);let{Text:A,Paragraph:b}=i.A;function k(){let e=(0,j.Vr)(),[t,r]=(0,s.useState)([]),[i,k]=(0,s.useState)(!0),[S,z]=(0,s.useState)(""),[I,C]=(0,s.useState)(!1),N=async()=>{k(!0);try{r((await (0,v.oH)(500)).logs)}catch(e){n.Ay.error(e instanceof Error?e.message:"加载日志失败")}finally{k(!1)}};(0,s.useEffect)(()=>{N()},[]);let B=(0,s.useMemo)(()=>{let e=S.trim().toLowerCase();return e?t.filter(t=>[t.id,t.level,t.source,t.functionName,t.message,t.stack].filter(Boolean).some(t=>String(t).toLowerCase().includes(e))):t},[S,t]),O=[{title:"序号",key:"index",width:70,render:(e,t,r)=>r+1},{title:"时间",dataIndex:"createdAt",width:170,render:e=>new Date(e).toLocaleString()},{title:"级别",dataIndex:"level",width:80,render:e=>(0,a.jsx)(l.A,{color:"error"===e?"error":"warn"===e?"warning":"blue",style:{margin:0},children:e})},{title:"来源",dataIndex:"source",width:200,render:e=>(0,a.jsx)(A,{code:!0,style:{fontSize:12},children:e})},{title:"函数",dataIndex:"functionName",width:160,render:e=>e?(0,a.jsx)(A,{code:!0,style:{fontSize:12},children:e}):(0,a.jsx)(A,{type:"secondary",children:"-"})},{title:"错误信息",dataIndex:"message",render:e=>(0,a.jsx)(b,{style:{maxWidth:480,overflowWrap:"anywhere",wordBreak:"break-all",marginBottom:0,fontSize:12},ellipsis:{rows:2,expandable:!0,symbol:"展开"},children:e})},{title:"Request ID",dataIndex:"id",width:200,render:e=>(0,a.jsx)(A,{copyable:!0,code:!0,style:{fontSize:12},children:e.slice(0,8)})}];return i&&0===t.length?(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)(o.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,a.jsx)(o.A,{active:!0,paragraph:{rows:12}})]}):(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"pageTitle",children:e("nav.systemLogs")}),(0,a.jsx)("p",{className:"pageDesc",children:"查看 API 异常、模型健康检查失败、PDF 降级等运行时问题。"})]}),(0,a.jsxs)(c.A,{children:[(0,a.jsx)(d.Ay,{icon:(0,a.jsx)(f.A,{}),loading:i,onClick:()=>void N(),children:"刷新"}),(0,a.jsx)(h.A,{title:"确认清空所有错误日志?",onConfirm:()=>{(async()=>{await (0,v.hH)(),n.Ay.success("已清空"),await N()})()},children:(0,a.jsx)(d.Ay,{danger:!0,icon:(0,a.jsx)(y.A,{}),children:"清空日志"})})]})]}),(0,a.jsx)(p.A,{type:"info",showIcon:!0,message:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsx)("span",{children:"日志保存在本机 ~/.customize-agent/logs/errors.jsonl,最多读取最近 500 条。"}),(0,a.jsx)(d.Ay,{type:"link",size:"small",icon:I?(0,a.jsx)(m.A,{}):(0,a.jsx)(w.A,{}),onClick:()=>C(!I),style:{padding:"0 4px"},children:I?"收起":"展开"})]}),description:I?"系统自动记录未捕获的异常、API 错误、模型健康检查失败等运行时问题。日志文件超过 2MB 会自动轮转。":void 0}),(0,a.jsx)(g.A.Search,{allowClear:!0,placeholder:"搜索 requestId / source / function / message / stack",value:S,onChange:e=>z(e.target.value),style:{maxWidth:480}}),(0,a.jsx)(u.A,{rowKey:"id",loading:i,dataSource:B,columns:O,size:"middle",locale:{emptyText:(0,a.jsx)(x.A,{description:"暂无错误日志"})},pagination:{pageSize:20,showSizeChanger:!0,showTotal:e=>"共 ".concat(e," 条")},expandable:{expandedRowRender:e=>(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"8px 0"},children:[e.request&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Request"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5},children:JSON.stringify(e.request,null,2)})]}),void 0!==e.meta&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Meta"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5},children:JSON.stringify(e.meta,null,2)})]}),e.stack&&(0,a.jsxs)("div",{children:[(0,a.jsx)(A,{strong:!0,style:{fontSize:12,marginBottom:4,display:"block"},children:"Stack"}),(0,a.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0,padding:10,background:"var(--colorFillAlter)",borderRadius:8,fontSize:12,lineHeight:1.5,maxHeight:300,overflow:"auto"},children:e.stack})]})]})}})]})}},92123:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"}},96651:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(97109),s=r(92123),i=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 l=a.forwardRef((e,t)=>a.createElement(i.A,n({},e,{ref:t,icon:s.A})))},99811:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var a=r(97109),s=r(14995),i=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 l=a.forwardRef((e,t)=>a.createElement(i.A,n({},e,{ref:t,icon:s.A})))}},e=>{e.O(0,[433,576,195,985,375,102,289,861,636,593,792],()=>e(e.s=39214)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (()=>{"use strict";var e={},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={exports:{}},f=!0;try{e[o](a,a.exports,t),f=!1}finally{f&&delete r[o]}return a.exports}t.m=e,(()=>{var e=[];t.O=(r,o,n,a)=>{if(o){a=a||0;for(var f=e.length;f>0&&e[f-1][2]>a;f--)e[f]=e[f-1];e[f]=[o,n,a];return}for(var l=1/0,f=0;f<e.length;f++){for(var[o,n,a]=e[f],u=!0,i=0;i<o.length;i++)(!1&a||l>=a)&&Object.keys(t.O).every(e=>t.O[e](o[i]))?o.splice(i--,1):(u=!1,a<l&&(l=a));if(u){e.splice(f--,1);var p=n();void 0!==p&&(r=p)}}return r}})(),t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},(()=>{var e,r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;t.t=function(o,n){if(1&n&&(o=this(o)),8&n||"object"==typeof o&&o&&(4&n&&o.__esModule||16&n&&"function"==typeof o.then))return o;var a=Object.create(null);t.r(a);var f={};e=e||[null,r({}),r([]),r(r)];for(var l=2&n&&o;"object"==typeof l&&!~e.indexOf(l);l=r(l))Object.getOwnPropertyNames(l).forEach(e=>f[e]=()=>o[e]);return f.default=()=>o,t.d(a,f),a}})(),t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.p="/_next/",(()=>{var e={68:0};t.O.j=r=>0===e[r];var r=(r,o)=>{var n,a,[f,l,u]=o,i=0;if(f.some(r=>0!==e[r])){for(n in l)t.o(l,n)&&(t.m[n]=l[n]);if(u)var p=u(t)}for(r&&r(o);i<f.length;i++)a=f[i],t.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return t.O(p)},o=self.webpackChunk_N_E=self.webpackChunk_N_E||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})()})();
@@ -1 +0,0 @@
1
- :root{--colorBg:#f5f5f7;--colorBgElevated:#ffffff;--colorBgSecondary:rgba(255,255,255,0.64);--colorText:#1d1d1f;--colorTextSecondary:#6e6e73;--colorTextTertiary:#aeaeb2;--colorBrand:#007aff;--colorBrandHover:#0a84ff;--colorBrand2:#5856d6;--colorDanger:#ff3b30;--colorOk:#34c759;--colorWarn:#ff9500;--glassBg:rgba(255,255,255,0.72);--glassBlur:saturate(180%) blur(22px);--borderColor:rgba(60,60,67,0.16);--borderColorStrong:rgba(60,60,67,0.26);--shadowSoft:0 8px 24px rgba(0,0,0,0.06);--shadowCard:0 18px 45px rgba(0,0,0,0.08);--shadowButton:0 4px 14px rgba(0,122,255,0.25);--radiusSm:10px;--radiusMd:14px;--radiusLg:20px;--radiusPill:100px;--sidebarWidth:240px;--fontSans:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",sans-serif}.dark{--colorBg:#1c1c1e;--colorBgElevated:#2c2c2e;--colorBgSecondary:rgba(255,255,255,0.08);--colorText:#f5f5f7;--colorTextSecondary:#98989d;--colorTextTertiary:#6e6e73;--colorBrand:#0a84ff;--colorBrandHover:#409cff;--colorBrand2:#5e5ce6;--colorDanger:#ff453a;--colorOk:#30d158;--colorWarn:#ff9f0a;--glassBg:rgba(28,28,30,0.72);--borderColor:rgba(255,255,255,0.12);--borderColorStrong:rgba(255,255,255,0.2);--shadowSoft:0 8px 24px rgba(0,0,0,0.24);--shadowCard:0 18px 45px rgba(0,0,0,0.32);--shadowButton:0 4px 14px rgba(10,132,255,0.3)}*,:after,:before{box-sizing:border-box}html{font-family:var(--fontSans);background:var(--colorBg);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.appShellPlaceholder{min-height:100vh;background:var(--colorBg)}body{margin:0;min-height:100vh;font-family:var(--fontSans);color:var(--colorText);background:radial-gradient(circle at 15% 0,rgba(0,122,255,.07),transparent 28rem),radial-gradient(circle at 85% 8%,rgba(88,86,214,.05),transparent 26rem),linear-gradient(180deg,rgba(251,251,253,1) 0,var(--colorBg) 100%)}.dark body{background:radial-gradient(circle at 15% 0,rgba(10,132,255,.06),transparent 28rem),radial-gradient(circle at 85% 8%,rgba(94,92,230,.04),transparent 26rem),linear-gradient(180deg,rgba(28,28,30,.98) 0,var(--colorBg) 100%)}a{color:inherit;text-decoration:none}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--borderColor);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--borderColorStrong)}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.animateFadeIn{animation:fadeIn .3s ease-out}.flex{display:flex}.inline-block{display:inline-block}.block{display:block}.flex-1{flex:1 1 0%}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:2px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.space-y-2>*+*{margin-top:8px}.space-y-5>*+*{margin-top:20px}.space-y-6>*+*{margin-top:24px}.mt-2{margin-top:8px}.mb-4{margin-bottom:16px}.py-16{padding-top:64px;padding-bottom:64px}.min-h-screen{min-height:100vh}.w-full{width:100%}.max-w-2xl{max-width:672px}.max-w-\[400px\]{max-width:400px}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-xs{font-size:12px;line-height:1.4}.text-sm{font-size:14px;line-height:1.45}.font-semibold{font-weight:600}.text-\[var\(--colorOk\)\]{color:var(--colorOk)}.text-\[var\(--colorDanger\)\]{color:var(--colorDanger)}.routeProgress{position:fixed;top:0;left:var(--sidebarWidth);right:0;height:3px;z-index:1000;background:linear-gradient(90deg,var(--colorPrimary),var(--colorAccent));animation:routeProgress .9s ease-in-out infinite}.routeLoadingCard{margin-bottom:16px;border:1px solid var(--borderSoft);border-radius:16px;padding:14px 16px;color:var(--textSecondary);background:var(--surfaceElevated)}@keyframes routeProgress{0%{transform:scaleX(.15);transform-origin:left;opacity:.65}50%{transform:scaleX(.7);transform-origin:left;opacity:1}to{transform:scaleX(1);transform-origin:left;opacity:.35}}@media (max-width:1024px){:root{--sidebarWidth:200px}}@media (max-width:860px){:root{--sidebarWidth:72px}.sidebarLogo{padding:16px;justify-content:center}.sidebarFooter,.sidebarItem span:not(.sidebarChevron),.sidebarLogoSub,.sidebarLogoTitle{display:none}.sidebarItem{justify-content:center;padding:11px}.sidebarSubmenu{padding-left:0}.sidebarSubItem{padding-left:11px}.mainInner{padding:20px 20px calc(20px + env(safe-area-inset-bottom, 0px))}.topbar{padding:10px 16px;margin:10px 12px 0}}@media (max-width:640px){.sidebar{left:6px;top:6px;bottom:calc(6px + env(safe-area-inset-bottom, 0px))}.mainContent{margin-left:72px}.mainInner{padding:12px 12px calc(12px + env(safe-area-inset-bottom, 0px))}.topbar{margin:8px 8px 0;padding:8px 12px;border-radius:16px}}.sidebar{position:fixed;left:12px;top:12px;bottom:calc(12px + env(safe-area-inset-bottom, 0px));width:calc(var(--sidebarWidth) - 16px);display:flex;flex-direction:column;z-index:20;background:linear-gradient(180deg,color-mix(in srgb,var(--glassBg) 92%,white 8%),var(--glassBg));border:1px solid color-mix(in srgb,var(--borderColor) 58%,transparent);border-radius:24px;backdrop-filter:var(--glassBlur);-webkit-backdrop-filter:var(--glassBlur);box-shadow:var(--shadowCard),inset 0 1px 0 rgba(255,255,255,.5);overflow:hidden;transition:width .22s ease,transform .22s ease}.sidebarCollapsedSelf{width:64px}.sidebarLogo{display:flex;align-items:center;gap:12px;padding:18px 18px 16px;border-bottom:1px solid color-mix(in srgb,var(--borderColor) 48%,transparent)}.sidebarLogoTitle{font-size:15px;font-weight:800;letter-spacing:-.035em;line-height:1.15}.logoGradient{background:linear-gradient(135deg,#007aff,#5856d6 50%,#af52de);-webkit-background-clip:text;background-clip:text}.dark .logoGradient,.logoGradient{-webkit-text-fill-color:transparent}.dark .logoGradient{background:linear-gradient(135deg,#0a84ff,#5e5ce6 50%,#bf5af2);-webkit-background-clip:text;background-clip:text}.sidebarLogoSub{margin-top:3px;font-size:10.5px;letter-spacing:.02em;color:var(--colorTextSecondary)}.sidebarCollapseBtn{margin:10px 12px 4px;height:34px;border-radius:14px;border:1px solid var(--borderColor);background:color-mix(in srgb,var(--glassBg) 86%,white 14%);color:var(--colorTextSecondary);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .16s ease}.sidebarCollapseBtn:hover{color:var(--colorText);border-color:color-mix(in srgb,var(--colorBrand) 42%,var(--borderColor));box-shadow:0 8px 18px rgba(0,122,255,.12)}.sidebarCollapsedSelf .sidebarLogo{justify-content:center;padding:16px 8px}.sidebarCollapsedSelf .sidebarChevron,.sidebarCollapsedSelf .sidebarFooter,.sidebarCollapsedSelf .sidebarItem span:not(.sidebarChevron),.sidebarCollapsedSelf .sidebarLogoSub,.sidebarCollapsedSelf .sidebarLogoTitle{display:none}.sidebarCollapsedSelf .sidebarItem{justify-content:center;padding:11px}.sidebarCollapsedSelf .sidebarCollapseBtn{margin:10px}.sidebarNav{flex:1;padding:16px 12px;overflow-y:auto;display:flex;flex-direction:column;gap:2px}.sidebarItem{display:flex;align-items:center;gap:12px;padding:9px 12px;border-radius:12px;font-size:14px;font-weight:500;color:var(--colorTextSecondary);transition:all .15s ease;cursor:pointer}.sidebarItem:hover{background:color-mix(in srgb,var(--colorBrand) 10%,transparent);color:var(--colorText);transform:translateX(2px)}.dark .sidebarItem:hover{background:color-mix(in srgb,var(--colorBrand) 16%,transparent)}.sidebarItemActive,.sidebarItemActive:hover{background:linear-gradient(180deg,var(--colorBrandHover),var(--colorBrand));color:#ffffff;box-shadow:0 8px 22px rgba(0,122,255,.22);transform:none}.dark .sidebarItemActive,.dark .sidebarItemActive:hover{background:linear-gradient(180deg,var(--colorBrandHover),var(--colorBrand));color:#ffffff;box-shadow:0 8px 24px rgba(10,132,255,.28)}.sidebarFooter{padding:16px 20px;border-top:1px solid var(--borderColor);font-size:11px;color:var(--colorTextSecondary)}.sidebarParent{justify-content:flex-start}.sidebarChevron{margin-left:auto;display:flex;align-items:center;opacity:.5}.sidebarSubmenu{padding-left:16px;display:flex;flex-direction:column;gap:2px}.sidebarSubItem{padding-left:16px;font-size:13px}.topbar{position:sticky;top:14px;z-index:10;display:flex;align-items:center;justify-content:flex-end;gap:12px;margin:14px 24px 0;padding:10px 14px;background:linear-gradient(180deg,color-mix(in srgb,var(--glassBg) 92%,white 8%),var(--glassBg));border:1px solid var(--borderColor);border-radius:22px;box-shadow:var(--shadowSoft),inset 0 1px 0 rgba(255,255,255,.42);backdrop-filter:var(--glassBlur);-webkit-backdrop-filter:var(--glassBlur)}.topbarBtn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:var(--radiusMd);border:1px solid var(--borderColor);background:rgba(255,255,255,.88);color:var(--colorTextSecondary);font-size:12px;font-weight:600;cursor:pointer;transition:all .15s ease;outline:none;box-shadow:inset 0 0 0 1px rgba(255,255,255,.25)}.dark .topbarBtn{background:rgba(255,255,255,.08)}.topbarBtn:hover{border-color:rgba(0,122,255,.35);color:var(--colorText);transform:translateY(-1px);box-shadow:0 4px 12px rgba(0,122,255,.1),inset 0 0 0 1px rgba(255,255,255,.25)}.mainContent{margin-left:var(--sidebarWidth);flex:1;display:flex;flex-direction:column;min-height:100vh;transition:margin-left .22s ease}.sidebarCollapsed .mainContent{margin-left:88px}.mainInner{flex:1;padding:clamp(16px,2.5vw,40px) clamp(16px,2.5vw,40px) calc(clamp(16px, 2.5vw, 40px) + env(safe-area-inset-bottom, 0px));width:100%;overflow-x:hidden;transition:opacity .12s ease}.mainInner.pageTransitioning{opacity:.3;pointer-events:none}.applePill{display:inline-flex;align-items:center;gap:8px;padding:8px 18px;border-radius:var(--radiusMd);font-size:13px;font-weight:600;border:1px solid var(--borderColor);cursor:pointer;transition:all .15s ease;background:rgba(255,255,255,.88);color:var(--colorTextSecondary);box-shadow:inset 0 0 0 1px rgba(255,255,255,.25)}.dark .applePill{background:rgba(255,255,255,.08)}.applePill:hover{border-color:rgba(0,122,255,.35);color:var(--colorText)}.applePillActive{background:#1d1d1f;color:#ffffff;border-color:transparent;box-shadow:none}.dark .applePillActive{background:rgba(255,255,255,.9);color:#1c1c1e}.applePillActive:hover{border-color:transparent;color:#ffffff}.dark .applePillActive:hover{color:#1c1c1e}.statItem{gap:12px;padding:4px}.statItem,.statItemIcon{display:flex;align-items:center}.statItemIcon{width:40px;height:40px;border-radius:10px;flex-shrink:0;justify-content:center;background:rgba(0,122,255,.08);color:var(--colorBrand)}.statItemValue{font-size:24px;font-weight:700;line-height:1.1;color:var(--colorText)}.statItemLabel{font-size:12px;color:var(--colorTextSecondary);margin-top:1px}.pageTitle{font-size:22px;font-weight:700;letter-spacing:-.015em;color:var(--colorText);margin:0}.pageDesc{margin-top:4px;font-size:14px;color:var(--colorTextSecondary)}.ant-card{background:linear-gradient(180deg,color-mix(in srgb,var(--glassBg) 92%,white 8%),var(--glassBg))!important;border:1px solid color-mix(in srgb,var(--borderColor) 46%,transparent)!important;border-radius:24px!important;box-shadow:var(--shadowSoft),inset 0 1px 0 rgba(255,255,255,.38)!important;backdrop-filter:var(--glassBlur);-webkit-backdrop-filter:var(--glassBlur);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.ant-card:hover{border-color:color-mix(in srgb,var(--colorBrand) 14%,var(--borderColor))!important;box-shadow:var(--shadowCard),inset 0 1px 0 rgba(255,255,255,.5)!important;transform:translateY(-1px)}.ant-card .ant-card-head{border-bottom-color:var(--borderColor)!important}.ant-modal-content{backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border-radius:var(--radiusLg)!important}.ant-table-wrapper .ant-table{border-radius:16px;overflow:hidden}.ant-table-thead>tr>th{font-size:12px!important;font-weight:600!important;text-transform:uppercase;letter-spacing:.05em}.ant-table-cell{font-size:13px}.ant-btn-primary{box-shadow:var(--shadowButton)!important}.ant-spin-dot-item{background-color:var(--colorBrand)!important}.ant-tag{border-radius:var(--radiusPill)!important;font-size:12px!important}