@customize-agent/server 4.60.29 → 4.60.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +282 -193
- package/.next/prerender-manifest.json +3 -3
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +6 -0
- package/.next/server/chunks/1243.js +1 -1
- package/.next/server/chunks/1936.js +8 -8
- package/.next/server/chunks/2328.js +1 -1
- package/.next/server/chunks/4722.js +4 -4
- package/.next/server/chunks/6321.js +1 -1
- package/.next/server/chunks/8204.js +1 -1
- package/.next/server/chunks/9666.js +14 -14
- package/.next/server/instrumentation.js.nft.json +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/api/assets/generated/preview.js.nft.json +1 -1
- package/.next/server/pages/api/assets/generated.js.nft.json +1 -1
- package/.next/server/pages/api/config/embedding/healthCheck.js.nft.json +1 -1
- package/.next/server/pages/api/documents/canvas/[id].js.nft.json +1 -1
- package/.next/server/pages/api/documents/export.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generate/preview.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generate.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/events.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/figure/[name].js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/instruction.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/nodes/[nodeId].js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/nodes.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/pause.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/preview.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/confirm.js +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/confirm.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/rollback.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/repair.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/report.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id]/resume-generate.js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated/[id].js.nft.json +1 -1
- package/.next/server/pages/api/documents/generated.js.nft.json +1 -1
- package/.next/server/pages/api/health.js +1 -1
- package/.next/server/pages/api/jobs/[id].js.nft.json +1 -1
- package/.next/server/pages/api/kb/categories.js.nft.json +1 -1
- package/.next/server/pages/api/kb/duplicates.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/detail.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/export.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/open.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/preview-pdf-page.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/reindex.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/search.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files/source-preview.js.nft.json +1 -1
- package/.next/server/pages/api/kb/files.js.nft.json +1 -1
- package/.next/server/pages/api/kb/ignore.js.nft.json +1 -1
- package/.next/server/pages/api/kb/material-groups.js.nft.json +1 -1
- package/.next/server/pages/api/kb/operations.js.nft.json +1 -1
- package/.next/server/pages/api/kb/reindex.js.nft.json +1 -1
- package/.next/server/pages/api/kb/stats.js.nft.json +1 -1
- package/.next/server/pages/api/kb/tags.js.nft.json +1 -1
- package/.next/server/pages/api/kb/upload/complete.js.nft.json +1 -1
- package/.next/server/pages/api/kb/upload.js.nft.json +1 -1
- package/.next/server/pages/api/system/reset.js.nft.json +1 -1
- package/.next/server/pages/canvas/[id].html +1 -1
- package/.next/server/pages/canvas.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/guide.html +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/jobs.html +1 -0
- package/.next/server/pages/jobs.js.nft.json +1 -0
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge/source-preview.html +1 -1
- package/.next/server/pages/knowledge.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/prompt.html +1 -1
- package/.next/server/pages/settings.html +1 -1
- package/.next/server/pages/skills/[id]/edit.html +1 -1
- package/.next/server/pages/skills/[id].html +1 -1
- package/.next/server/pages/skills/new.html +1 -1
- package/.next/server/pages/skills.html +1 -1
- package/.next/server/pages/system/logs.html +1 -1
- package/.next/server/pages-manifest.json +39 -38
- package/.next/static/0fdab21c22b65a3042c22ee4ac8e49fbfd22e365df64d5e9b709ccb05aecf02e/_buildManifest.js +1 -0
- package/.next/static/chunks/1210-703ad87eaeee1e4e.js +15 -0
- package/.next/static/chunks/1499-ff8f02f6bb6f3d45.js +10 -0
- package/.next/static/chunks/1702-f5e99af7aface475.js +1 -0
- package/.next/static/chunks/2378-c6d25abe02815666.js +1 -0
- package/.next/static/chunks/{864-b06700e1a4e573f2.js → 2864-67ba808c5092c2f9.js} +1 -1
- package/.next/static/chunks/3456-8b609f8475ae5030.js +1 -0
- package/.next/static/chunks/4052-199e61ca9e6a33e7.js +1 -0
- package/.next/static/chunks/4530-e73bdd645bb7a953.js +1 -0
- package/.next/static/chunks/4565-3c5ff667062ccec9.js +21 -0
- package/.next/static/chunks/4665-1984a3d8b0573fa1.js +1 -0
- package/.next/static/chunks/5046-abead1022185a99a.js +1 -0
- package/.next/static/chunks/5061-80765d4a612286e0.js +1 -0
- package/.next/static/chunks/5257-915621e439b56580.js +1 -0
- package/.next/static/chunks/5544-d77b8289662b4c28.js +4 -0
- package/.next/static/chunks/5760-f4191aac081b12d4.js +11 -0
- package/.next/static/chunks/6409-5a3bb0fbad4f64b1.js +14 -0
- package/.next/static/chunks/6505-012e90937e1e8dae.js +1 -0
- package/.next/static/chunks/6748-04b5429330e1451e.js +1 -0
- package/.next/static/chunks/7217-416b8488e0d2d498.js +1 -0
- package/.next/static/chunks/7576-ba6fc03060415b0e.js +1 -0
- package/.next/static/chunks/7646-159733564c7eb8dc.js +1 -0
- package/.next/static/chunks/7795-c11ff1a81c67c5aa.js +1 -0
- package/.next/static/chunks/7955-3a7ee8cda4f857b9.js +1 -0
- package/.next/static/chunks/8318-cb3a94de1617f983.js +1 -0
- package/.next/static/chunks/8338-b2ea00050048ba9f.js +4 -0
- package/.next/static/chunks/8399-a001bb2a0cb1640b.js +16 -0
- package/.next/static/chunks/8564-ac3e2f1bf87765b3.js +1 -0
- package/.next/static/chunks/8569-1d5c61a3f4fa0e26.js +16 -0
- package/.next/static/chunks/8715-ee013bd7f5ba38e8.js +1 -0
- package/.next/static/chunks/8750-a3c55a576effb3a6.js +1 -0
- package/.next/static/chunks/{787-207289f4bb577708.js → 8787-49b1f35eb4acfac9.js} +1 -1
- package/.next/static/chunks/{964-82cc4701f08f7351.js → 8964-e959915ecfae86b2.js} +1 -1
- package/.next/static/chunks/9551-f4b09bf2213ad571.js +16 -0
- package/.next/static/chunks/9605-3dee531f8a7ecbe0.js +4 -0
- package/.next/static/chunks/framework-9cde5013cd555765.js +1 -0
- package/.next/static/chunks/main-b313efde54fa6d2e.js +1 -0
- package/.next/static/chunks/pages/_app-73e5b40b24a7fe7d.js +140 -0
- package/.next/static/chunks/pages/_error-c01b6fb772028676.js +1 -0
- package/.next/static/chunks/pages/canvas/[id]-45da860b862e0743.js +1 -0
- package/.next/static/chunks/pages/canvas-a15773d02c97b7a6.js +1 -0
- package/.next/static/chunks/pages/documents-a1af5c6be26daed2.js +1 -0
- package/.next/static/chunks/pages/guide-fdf0822dc1d28813.js +1 -0
- package/.next/static/chunks/pages/index-c572e9caa60cb278.js +1 -0
- package/.next/static/chunks/pages/jobs-ebd1877dbf788a83.js +1 -0
- package/.next/static/chunks/pages/knowledge/file-detail-5859f0c25af34ffe.js +1 -0
- package/.next/static/chunks/pages/knowledge/files-b796702bb5f8ac50.js +1 -0
- package/.next/static/chunks/pages/knowledge/manage-6d7b21cdca1255f2.js +1 -0
- package/.next/static/chunks/pages/knowledge/{source-preview-814c683fc3723177.js → source-preview-40ff4936b832787e.js} +1 -1
- package/.next/static/chunks/pages/knowledge-2a776c1740386874.js +1 -0
- package/.next/static/chunks/pages/models-0aaff5bfadc7b62f.js +1 -0
- package/.next/static/chunks/pages/overview-7e8018014009682e.js +1 -0
- package/.next/static/chunks/pages/prompt-11f87694feb6514c.js +1 -0
- package/.next/static/chunks/pages/settings-e8dcaba1551a0b2b.js +1 -0
- package/.next/static/chunks/pages/skills/[id]/edit-35892def57c4975f.js +1 -0
- package/.next/static/chunks/pages/skills/[id]-19c352e150e05c27.js +1 -0
- package/.next/static/chunks/pages/skills/new-a279e6ca2f7aded7.js +1 -0
- package/.next/static/chunks/pages/skills-8ad2577b4aa17f3b.js +1 -0
- package/.next/static/chunks/pages/system/logs-0856f7c65432befb.js +1 -0
- package/.next/static/chunks/{webpack-6224d37324e372cb.js → webpack-2da1769ff35eb1ed.js} +1 -1
- package/.next/static/css/837ac5def44e2eba.css +1 -0
- package/messages/en-US.json +24 -1
- package/messages/zh-CN.json +24 -1
- package/package.json +2 -2
- package/.next/static/3758d6b30df49605aef4791c994f3e5ea9c954d1cec254897982ed7bfa5a7c0b/_buildManifest.js +0 -1
- package/.next/static/chunks/127-7d37d37dab02bd10.js +0 -1
- package/.next/static/chunks/162-36b2a3e6ee7d9717.js +0 -8
- package/.next/static/chunks/257-879f095890deadad.js +0 -1
- package/.next/static/chunks/313-4b3ff7075e0ff3c3.js +0 -1
- package/.next/static/chunks/318-ca122b774ea4ee84.js +0 -1
- package/.next/static/chunks/338-19ccbaec57a7bf9c.js +0 -4
- package/.next/static/chunks/499-2233cadc6d4da647.js +0 -10
- package/.next/static/chunks/530-98c3b3fbf3fcd8e3.js +0 -1
- package/.next/static/chunks/551-446a9d48add4944f.js +0 -16
- package/.next/static/chunks/569-2bfdde9e402af5b2.js +0 -16
- package/.next/static/chunks/576-6699fed6c88502fe.js +0 -1
- package/.next/static/chunks/579-fc0a2eb64aedb001.js +0 -1
- package/.next/static/chunks/665-0634aa49137defc4.js +0 -1
- package/.next/static/chunks/711-40c1a2dbd15c2807.js +0 -21
- package/.next/static/chunks/715-6285c5942e5ec5ea.js +0 -1
- package/.next/static/chunks/717-743b697a417dd5ee.js +0 -4
- package/.next/static/chunks/748-e13db510f76568b1.js +0 -1
- package/.next/static/chunks/795-3edd02531a6d39ae.js +0 -1
- package/.next/static/chunks/808-0506edc7454b5c0e.js +0 -1
- package/.next/static/chunks/880-64d8a15c524106d2.js +0 -1
- package/.next/static/chunks/955-f0542d4dea118b62.js +0 -1
- package/.next/static/chunks/framework-4b565b3ddc94cdac.js +0 -1
- package/.next/static/chunks/main-0c91f573696223ca.js +0 -1
- package/.next/static/chunks/pages/_app-5f5b2094ef219088.js +0 -185
- package/.next/static/chunks/pages/_error-282257fbdcc167b4.js +0 -1
- package/.next/static/chunks/pages/canvas/[id]-792d02e3874c19c0.js +0 -1
- package/.next/static/chunks/pages/canvas-e011bb88585d3441.js +0 -1
- package/.next/static/chunks/pages/documents-e6a80f2de39c6fd2.js +0 -1
- package/.next/static/chunks/pages/guide-3185f12fbcb5a6af.js +0 -1
- package/.next/static/chunks/pages/index-cb27bfa36c212ab5.js +0 -1
- package/.next/static/chunks/pages/knowledge/file-detail-c34e1f995fb8316f.js +0 -1
- package/.next/static/chunks/pages/knowledge/files-b3ef5324e4b74c4a.js +0 -1
- package/.next/static/chunks/pages/knowledge/manage-d9eaebf3a8307953.js +0 -1
- package/.next/static/chunks/pages/knowledge-3afd4bc337d44550.js +0 -1
- package/.next/static/chunks/pages/models-e07b2e29595effd7.js +0 -1
- package/.next/static/chunks/pages/overview-8713b5d37af0eeb3.js +0 -1
- package/.next/static/chunks/pages/prompt-47a1ac955831dedb.js +0 -1
- package/.next/static/chunks/pages/settings-8879d8c90bee2025.js +0 -1
- package/.next/static/chunks/pages/skills/[id]/edit-88e2490a4190467b.js +0 -1
- package/.next/static/chunks/pages/skills/[id]-4700cd743c5efe05.js +0 -1
- package/.next/static/chunks/pages/skills/new-b2204742b055565a.js +0 -1
- package/.next/static/chunks/pages/skills-1f6bcb42cd90abeb.js +0 -1
- package/.next/static/chunks/pages/system/logs-8c5dd4d06fa9d8c9.js +0 -1
- package/.next/static/css/cb79b8022e718258.css +0 -1
- /package/.next/static/{3758d6b30df49605aef4791c994f3e5ea9c954d1cec254897982ed7bfa5a7c0b → 0fdab21c22b65a3042c22ee4ac8e49fbfd22e365df64d5e9b709ccb05aecf02e}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2731],{5122:(_,n,e)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_error",function(){return e(75599)}])}},_=>{_.O(0,[636,6593,8792],()=>_(_.s=5122)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8790],{38977:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>eJ});var r=n(65321),l=n(97109),i=n(3454),a=n.n(i),o=n(43220),s=n.n(o),c=n(86109),d=n(48399),u=n(17807),h=n(42700),p=n(32941),m=n(33442),x=n(85114),g=n(25258),v=n(11702),f=n(85493),y=n(99811),j=n(6578),A=n(39507),b=n(93533),w=n(8090);function k(e){let{readings:t}=e,n=null==t?void 0:t.contractQuality;if(!n)return(0,r.jsx)("div",{role:"status",children:"七维评价尚未产出。"});let l=n.score,i=null==t?void 0:t.contractQualityStale;return Array.isArray(l.defects)?(0,r.jsxs)("div",{"aria-label":"七维评价",style:{fontSize:12,lineHeight:1.8},children:[(0,r.jsx)("strong",{children:i?"编辑前的历史七维诊断":"七维专业诊断"}),(0,r.jsxs)("span",{children:[";",i?"当前正文须重新评价":l.deliveryReady?"适用职责核验满足,待专业验收":"仍有缺陷或待核事项"]}),(0,r.jsxs)("div",{children:["阻断 ",l.blocking.length," 项;按根因归并的问题 ",l.defects.length," 项。专业档位不换算为未经标定的百分分数。"]}),i&&(0,r.jsx)("div",{children:i.reason}),(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{children:"查看七个维度"}),(0,r.jsxs)("table",{style:{width:"100%"},children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"维度"}),(0,r.jsx)("th",{children:"质量档位"}),(0,r.jsx)("th",{children:"满足 / 未满足 / 未判定"})]})}),(0,r.jsx)("tbody",{children:l.dimensions.map(e=>(0,r.jsxs)("tr",{children:[(0,r.jsx)("td",{children:e.label}),(0,r.jsx)("td",{children:"not-applicable"===e.status?"不适用":e.qualityLabel}),(0,r.jsxs)("td",{children:[e.verification.met," / ",e.verification.failed," / ",e.verification.unmeasured]})]},e.id))})]}),(0,r.jsx)("div",{children:n.expertValidated?"已完成专家校准。":"尚未完成专家校准。"})]})]}):(0,r.jsx)("div",{role:"status",children:"历史评价回执保留;按当前专业诊断口径重新评价后显示核验与质量档位。"})}let{Paragraph:S,Text:I}=d.A;function C(e){return new Date(e).toLocaleString()}function z(e){var t,n,i;let{status:a,title:o,html:s,source:c,truncated:d,totalChars:u,renderedChars:p,stats:g,gate:y,loading:j,error:A,onRetry:b,updatedAt:z,generatedAt:R,className:N,t:E,deliveryReadings:T}=e,M=null!=s?s:"",L=M.trim().length>0,D=g?function(e){let t=[];return e.droppedDangerousBlocks>0&&t.push("删除了 ".concat(e.droppedDangerousBlocks," 处可执行/可加载内容(脚本、样式、内嵌页面等)")),e.blockedUrls>0&&t.push("拦截了 ".concat(e.blockedUrls," 个协议不安全的链接(如 javascript: / data:)")),e.escapedTags>0&&t.push("转义了 ".concat(e.escapedTags," 个不支持的标签(原文里的原始 HTML 会以文字显示)")),e.droppedAttributes>0&&t.push("剥离了 ".concat(e.droppedAttributes," 个属性(样式、事件、非白名单属性)")),e.droppedComments>0&&t.push("删除了 ".concat(e.droppedComments," 处注释/声明")),t}(g):[],[P,B]=(0,l.useState)(!1),q=null!=(t=null==y?void 0:y.issues)?t:[],_=q.length>5,H=P?q:q.slice(0,5),W=q.length-H.length,F=W+(null!=(n=null==y?void 0:y.truncatedCount)?n:0),U=(0,r.jsxs)("div",{className:"deliverablePreviewMeta",children:[o&&(0,r.jsx)(I,{strong:!0,style:{fontSize:15},children:o}),a&&(0,r.jsx)(v.A,{color:(0,w.uj)(a),children:(0,w.GC)(a,E)}),c&&(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"预览正文:".concat("editedMarkdown"===c?"编辑后的正文(以它为准)":"markdown"===c?"记录里的正文(markdown 字段)":"draft"===c?"生成时的草案正文(draft.markdown)":"none"===c?"没有正文":"未识别的正文来源(".concat(c,")"))}),R?(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"生成于 ".concat(C(R))}):null,z?(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"更新于 ".concat(C(z))}):null]}),G=q.length>0&&(0,r.jsxs)("div",{style:{fontSize:12.5,lineHeight:1.8},children:[H.map((e,t)=>(0,r.jsxs)("div",{children:["\xb7 ",e]},"".concat(t,"-").concat(e.slice(0,12)))),F>0&&(0,r.jsx)("div",{children:"…还有 ".concat(F," 项未列出").concat(W>0&&(null!=(i=null==y?void 0:y.truncatedCount)?i:0)>0?"(服务端只下发了 ".concat(q.length," 项)"):"")}),_&&(0,r.jsx)(x.Ay,{type:"link",size:"small",style:{paddingInline:0},onClick:()=>B(e=>!e),children:P?"收起阻断项":"展开全部 ".concat(q.length," 项")})]}),Q=y?(0,r.jsx)(f.A,{style:{width:"100%"},type:y.passed?"success":"warning",showIcon:!0,message:y.passed?"交付门禁:通过":"交付门禁:阻断 ".concat(y.blockingCount," 项"),description:(0,r.jsxs)(m.A,{direction:"vertical",size:4,style:{width:"100%"},children:[(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:"能否导出由服务端判定;此处仅供查看。"}),G]})}):(0,r.jsx)(f.A,{style:{width:"100%"},type:"info",showIcon:!0,message:"尚无交付门禁结论(生成中或尚未完成)——这不代表已通过。"});return(0,r.jsx)("div",{className:null!=N?N:"deliverablePreview",children:(0,r.jsxs)("div",{className:"deliverablePreviewStack",children:[U,(0,r.jsx)(k,{readings:T}),Q,d&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"warning",showIcon:!0,message:"正文过长,预览只渲染了前 ".concat((null!=p?p:0).toLocaleString()," 字(共 ").concat((null!=u?u:0).toLocaleString()," 字)"),description:"后续内容未渲染;导出物是完整正文,不受预览截断影响。"}),D.length>0&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"info",showIcon:!0,message:"预览已对内容做安全处置(与导出物可能存在差异)",description:(0,r.jsx)("div",{style:{fontSize:12,lineHeight:1.7},children:D.map(e=>(0,r.jsxs)("div",{children:["\xb7 ",e]},e))})}),j&&(0,r.jsxs)(m.A,{align:"center",size:8,children:[(0,r.jsx)(h.A,{size:"small"}),(0,r.jsx)(I,{type:"secondary",children:"正在取回成稿预览(服务端渲染 + 清洗)…"})]}),!j&&A&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"error",showIcon:!0,message:"取回成稿预览失败",description:(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(I,{style:{fontSize:12},children:A}),b&&(0,r.jsx)(x.Ay,{size:"small",onClick:b,children:"重新取回"})]})}),!j&&!A&&!L&&(0,r.jsx)(f.A,{style:{width:"100%"},type:"info",showIcon:!0,message:"这条记录还没有可预览的正文",description:"生成完成后这里会显示成稿全文;生成中的记录只有节点日志(见画布),没有正文可预览。"}),!A&&L&&(0,r.jsxs)("div",{className:"deliverablePreviewPaper",children:[(0,r.jsx)("article",{className:"deliverablePreviewBody","aria-label":"成稿预览正文",dangerouslySetInnerHTML:{__html:M}}),(0,r.jsxs)("div",{className:"deliverablePreviewEnd",children:[(0,r.jsx)(I,{type:"secondary",style:{fontSize:12},children:d?"正文到此为止(预览有截断,见上方提示;导出物是完整正文)":p&&p>0?"正文到此为止:以上是本记录的全部正文,共 ".concat(p.toLocaleString()," 字(未截断)"):"正文到此为止:以上是本记录的全部正文(未截断)"}),y&&!y.passed&&(0,r.jsx)(I,{style:{fontSize:12,color:"var(--colorWarning)"},children:"交付门禁未通过(阻断 ".concat(y.blockingCount," 项)——正文在这里结束并不代表成稿完整,缺什么见上方的阻断项清单。")})]})]}),!A&&L&&(0,r.jsx)(S,{type:"secondary",style:{fontSize:12,marginBottom:0,textAlign:"center"},children:"预览为服务端渲染结果;排版细节(字体、页眉页脚、分页)以导出物为准。"})]})})}let R=new Set(["prepare","understand","plan","blueprint"]),N=new Set(["close","deliver"]),E=new Set(["chapter","write"]);function T(e,t){let n=new Map;for(let t of e){if(void 0===t.parentId)continue;let e=n.get(t.parentId);e?e.push(t.id):n.set(t.parentId,[t.id])}let r=new Set([t]),l=[t],i=[];for(;l.length>0;){var a;let e=l.shift();for(let t of(i.push(e),null!=(a=n.get(e))?a:[]))r.has(t)||(r.add(t),l.push(t))}return i}function M(e,t){var n;let r=new Map(e.map(e=>[e.id,e])),l=r.get(t);if(!l)return;let i=T(e,t),a=e.map(e=>e.id).sort();if(R.has(l.type))return{targetNodeId:t,kind:"contaminated",affectedNodeIds:a,reason:"".concat(l.type," 承载事实 / 命名 / 标题指纹 → 11.1:跨文档污染,**不可回滚**(要么回滚,要么重新校准)"),escalate:a.length>5,rollbackable:!1};let o=(n=l.type).split(".")[0]||n;if(N.has(l.type)||N.has(o))return{targetNodeId:t,kind:"propagated",affectedNodeIds:a,reason:"".concat(l.type," 属全篇收口 / 交付层 → 预算守恒与全量判据复检波及整篇(11.1)"),escalate:a.length>5,rollbackable:!0};if(E.has(l.type)||"round"===o){let n=function(e,t,n){let r=new Set([t]),l=e.get(t);for(;l;){if(n(l))return l;let t=l.parentId;if(void 0===t||r.has(t))break;r.add(t),l=e.get(t)}}(r,t,e=>E.has(e.type)),i=n?T(e,n.id):a;return{targetNodeId:t,kind:"propagated",affectedNodeIds:i,reason:n?"".concat(l.type," 在章级锚点「").concat(n.title||n.id,"」内 → 跨章数值一致性 / 复读 / 依据对账(11.1)波及同章其余部分"):"".concat(l.type," 无章级锚点 → 按整篇保守估算(11.1)"),escalate:i.length>5,rollbackable:!0}}return{targetNodeId:t,kind:"local",affectedNodeIds:i,reason:"".concat(l.type," 属定点补丁层(11.5:确定性处理节点)→ 影响面限自身子树"),escalate:i.length>5,rollbackable:!0}}function L(e){let t=Math.max(18,Math.abs(e.y2-e.y1)/2);return"M ".concat(e.x1," ").concat(e.y1," C ").concat(e.x1," ").concat(e.y1+t,", ").concat(e.x2," ").concat(e.y2-t,", ").concat(e.x2," ").concat(e.y2)}let D={default:"canvasEdge",active:"canvasEdge canvasEdgeActive",warn:"canvasEdge canvasEdgeWarn",affected:"canvasEdge canvasEdgeAffected"},P={default:"url(#canvasArrow)",active:"url(#canvasArrowActive)",warn:"url(#canvasArrowWarn)",affected:"url(#canvasArrow)"};function B(e){let{edge:t,tone:n="default"}=e;return(0,r.jsx)("path",{className:D[n],d:L(t),markerEnd:P[n],"data-edge":"".concat(t.fromId,"->").concat(t.toId)})}function q(e){let{edges:t,width:n,height:l,toneOf:i,flowing:a,style:o}=e;return(0,r.jsxs)("svg",{className:"canvasEdgeLayer",width:Math.max(1,n),height:Math.max(1,l),viewBox:"0 0 ".concat(Math.max(1,n)," ").concat(Math.max(1,l)),"aria-hidden":"true",focusable:"false",style:o,children:[(0,r.jsxs)("defs",{children:[(0,r.jsx)("marker",{id:"canvasArrow",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{d:"M0,0 L8,4 L0,8 z",fill:"var(--canvasEdge)"})}),(0,r.jsx)("marker",{id:"canvasArrowActive",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{d:"M0,0 L8,4 L0,8 z",fill:"var(--canvasEdgeActive)"})}),(0,r.jsx)("marker",{id:"canvasArrowWarn",markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"strokeWidth",children:(0,r.jsx)("path",{d:"M0,0 L8,4 L0,8 z",fill:"var(--canvasEdgeWarn)"})})]}),t.map(e=>{var t;return(0,r.jsxs)("g",{children:[(0,r.jsx)(B,{edge:e,tone:null!=(t=null==i?void 0:i(e))?t:"default"}),(null==a?void 0:a.has(e.id))&&(0,r.jsx)("path",{className:"canvasEdgeFlow",d:L(e),"data-flow":"".concat(e.fromId,"->").concat(e.toId)})]},e.id)})]})}let _=new Set(["completed","failed","skipped"]),H=[{key:"chars",unit:" 字"},{key:"words",unit:" 字"},{key:"noteChars",unit:" 字"},{key:"turn",unit:" 轮",prefix:"第 "},{key:"chapters",unit:" 章"},{key:"facts",unit:" 条事实"},{key:"evidence",unit:" 条证据"},{key:"issues",unit:" 个问题"},{key:"toolCalls",unit:" 次工具调用"},{key:"totalFiles",unit:" 份资料"},{key:"totalChunks",unit:" 个切片"},{key:"roundIteration",unit:" 轮修复",prefix:"第 "}];function W(e){var t;let n=null==(t=e.metrics)?void 0:t.note;return"string"==typeof n&&n.trim()?n.trim():void 0}function F(e,t){let{input:n,output:r}=function(e){let t=e=>"string"==typeof e&&e.trim()?e.trim():void 0;return{input:t(e.inputSummary),output:t(e.outputSummary)}}(e);for(let l of"dispatch"===t?[n,W(e),e.title]:[r,W(e),e.title,function(e){var t;let n=null!=(t=e.metrics)?t:{},r=[];for(let{key:e,unit:t,prefix:l}of H){let i=n[e];if(("number"==typeof i||"string"==typeof i)&&""!==i&&0!==i&&(r.push("".concat(null!=l?l:"").concat("number"==typeof i?i.toLocaleString():i).concat(t)),2===r.length))break}return r.length>0?r.join(" \xb7 "):void 0}(e)])if(l&&l.trim())return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24,n=e.replace(/\s+/gu," ").trim();return n.length>t?"".concat(n.slice(0,t-1),"…"):n}(l)}function U(e){let{bubbles:t,layout:n,static:l=!1}=e;return 0===t.length?null:(0,r.jsx)("div",{className:"canvasBubbleLayer",style:{width:Math.max(1,n.width),height:Math.max(1,n.height)},"aria-hidden":"true",children:t.map(e=>{let t=function(e,t){let n=t.edges.find(t=>t.fromId===e.fromId&&t.toId===e.toId);if(n)return L(n);let r=t.edges.find(t=>t.fromId===e.toId&&t.toId===e.fromId);return r?function(e){let t=L(e),n=/^M ([\d.-]+) ([\d.-]+) C ([\d.-]+) ([\d.-]+), ([\d.-]+) ([\d.-]+), ([\d.-]+) ([\d.-]+)$/u.exec(t);if(!n)return t;let[,r,l,i,a,o,s,c,d]=n;return"M ".concat(c," ").concat(d," C ").concat(o," ").concat(s,", ").concat(i," ").concat(a,", ").concat(r," ").concat(l)}(r):null}(e,n);return t?(0,r.jsx)("div",{className:l?"canvasBubble canvasBubbleStatic":"canvasBubble","data-kind":e.kind,"data-from":e.fromId,"data-to":e.toId,style:{offsetPath:'path("'.concat(t,'")'),offsetRotate:"0deg",animationDuration:"".concat(1500,"ms")},children:(0,r.jsx)("span",{className:"canvasBubbleBody",children:(0,r.jsx)("span",{className:"canvasBubbleText",children:e.label})})},e.id):null})})}var G=n(94394);function Q(e){return"stage-details"===e.source}let O=new Set(["running","repairing"]),X=new Set(["role_binding","knowledge_retrieval","file_understanding","fact_extraction","chapter_generation","llm_review","validation","reference"]);function V(e){var t;return X.has(e)?null!=(t=G.i_[e])?t:e:(0,w.z9)(e)}function J(e,t){var n;let r=null==(n=e.metrics)?void 0:n[t];return"string"==typeof r&&r.trim()?r.trim():void 0}function Y(e,t,n){var r;let l=function(e){var t;let n=null==(t=e.metrics)?void 0:t.stageType;return"string"==typeof n&&n.trim()?n.trim():e.type.split(".")[0]||"default"}(e),i=null!=(r=J(e,"stageSubtitle"))?r:J(e,"stageRoleId"),a=J(e,"note");return{id:e.id,kind:l,kindLabel:V(l),...i&&i!==e.title?{role:i}:{},title:e.title||V(l),...a?{activity:a}:{},status:e.status,..."number"==typeof e.startedAt?{startedAt:e.startedAt}:{},..."number"==typeof e.completedAt?{completedAt:e.completedAt}:{},metrics:(0,w.dB)(e.metrics,8),depth:t}}function K(e,t){if("number"==typeof e.startedAt)return Math.max(0,("number"==typeof e.completedAt?e.completedAt:t)-e.startedAt)}var $=n(46758),Z=n(99605);let{Text:ee}=d.A,et=["error","warning","info"],en={error:"#ff4d4f",warning:"#faad14",info:"#1677ff"};function er(e){let{node:t,x:n,y:i,selected:a,affected:o,flashed:s,onSelect:c,onDrag:d,t:u}=e,h=function(e){let t=[],n=[];for(let r of e.issues)(Q(r)?n:t).push(r);return{problems:t,details:n,counts:{error:t.filter(e=>"error"===e.level).length,warning:t.filter(e=>"warning"===e.level).length,info:t.filter(e=>"info"===e.level).length}}}(t),p=(0,w.Jy)(t),m=(0,w.O0)(t.metrics,2),x=(0,l.useRef)(null);return(0,l.useEffect)(()=>()=>{var e;null==(e=x.current)||e.call(x)},[]),(0,r.jsxs)("div",{className:"canvasNode".concat(a?" canvasNodeSelected":"").concat(o?" canvasNodeAffected":"").concat(s?" canvasNodeFlashed":""),style:{left:n,top:i,width:w.zT,height:w.EL},role:"button",tabIndex:0,"aria-label":"节点 ".concat(t.title),"data-node-id":t.id,onClick:e=>{e.stopPropagation(),c(t)},onPointerDown:e=>{var n,r;if(0!==e.button||(e.stopPropagation(),!d||(null==(r=e.target)||null==(n=r.closest)?void 0:n.call(r,"button, a, input, textarea"))))return;let l=e.clientX,i=e.clientY,a=e.pointerId,o=!1,s={dx:0,dy:0},c=e=>{e.pointerId===a&&(s={dx:e.clientX-l,dy:e.clientY-i},!o&&4>Math.abs(s.dx)&&4>Math.abs(s.dy)||(o=!0,d(t,s.dx,s.dy,"move")))},u=e=>{if(e.pointerId===a)document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",u),document.removeEventListener("pointercancel",u),x.current=null,o&&(document.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault()},{capture:!0,once:!0}),d(t,s.dx,s.dy,"end"))};document.addEventListener("pointermove",c),document.addEventListener("pointerup",u),document.addEventListener("pointercancel",u),x.current=()=>{document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",u),document.removeEventListener("pointercancel",u)}},onContextMenu:e=>{e.preventDefault(),e.stopPropagation()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c(t))},children:[(0,r.jsxs)("div",{className:"canvasNodeHeader",children:[(0,r.jsx)("span",{className:"canvasNodeIcon","data-status":t.status,children:(0,w.kH)(t.type)}),(0,r.jsx)(ee,{ellipsis:!0,style:{flex:1,minWidth:0,fontWeight:600,fontSize:13},title:t.title,children:t.title}),et.map(e=>h.counts[e]>0&&(0,r.jsx)("span",{"data-issue-level":e,style:{flexShrink:0},children:(0,r.jsx)($.A,{count:h.counts[e],size:"small",color:en[e]})},e))]}),(0,r.jsxs)("div",{className:"canvasNodeMeta",children:[(0,r.jsx)(v.A,{color:(0,w.uv)(t.status),style:{marginInlineEnd:4},children:(0,w.m_)(t.status,u)}),(0,r.jsx)(ee,{type:"secondary",style:{fontSize:11},ellipsis:!0,children:(0,w.z9)(t.type)})]}),t.progress&&t.progress.total>0?(0,r.jsx)(Z.A,{percent:Math.round(t.progress.current/t.progress.total*100),size:"small",showInfo:!1,status:"failed"===t.status?"exception":"completed"===t.status?"success":"active",style:{marginBottom:0}}):(0,r.jsxs)("div",{className:"canvasNodeMetrics",children:[m.map(e=>(0,r.jsx)(ee,{type:"secondary",style:{fontSize:11},ellipsis:!0,children:e},e)),0===m.length&&(0,r.jsx)(ee,{type:"secondary",style:{fontSize:11},children:(0,w.uH)(p)})]})]})}var el=n(14932),ei=n(55122),ea=n(32965),eo=n(44400),es=n(48156),ec=n(63046),ed=n(64068),eu=n(96651),eh=n(83914);function ep(e){let{updatedAt:t,running:n}=e,[i,a]=(0,l.useState)(()=>Date.now());if((0,l.useEffect)(()=>{if(!n)return;let e=setInterval(()=>a(Date.now()),5e3);return()=>clearInterval(e)},[n]),!n||!t)return null;let o=Math.max(0,i-t);return o<=9e4?(0,r.jsx)(el.A,{title:"记录每 30 秒刷新一次(最近一次 ".concat(new Date(t).toLocaleTimeString(),")——长阶段里画布可能几分钟没有新节点,这个信号说明进程还在跑"),children:(0,r.jsxs)(v.A,{color:"processing",children:["心跳 ",Math.round(o/1e3)," 秒前"]})}):(0,r.jsx)(el.A,{title:"最后一次进度写入是 ".concat(new Date(t).toLocaleTimeString(),"——超过 ").concat(Math.round(1.5)," 分钟没有动静,进程可能已退出(可「继续生成」续跑)"),children:(0,r.jsxs)(v.A,{color:"warning",children:["心跳已停 ",Math.floor(o/6e4)," 分钟"]})})}function em(e){let{startedAt:t,endedAt:n,running:i}=e,[a,o]=(0,l.useState)(()=>Date.now());if((0,l.useEffect)(()=>{if(!i)return;let e=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(e)},[i]),!t)return null;let s=Math.max(0,(i?a:null!=n?n:a)-t);return(0,r.jsx)(el.A,{title:"本轮生成的整体耗时(自 ".concat(new Date(t).toLocaleTimeString()," 起").concat(i?"":",已结束",")"),children:(0,r.jsx)(v.A,{color:"default",children:"耗时 ".concat((0,w.uH)(s))})})}var ex=n(55897),eg=n(49075),ev=n(84742);let{Text:ef}=d.A;function ey(e){var t;let{row:n,now:l,onLocate:i}=e;return(0,r.jsxs)("div",{className:"canvasAgentDetail","data-node-id":n.id,children:[(0,r.jsxs)("div",{className:"canvasAgentDetailHead",children:[(0,r.jsx)("span",{className:"canvasAgentIcon","data-status":n.status,children:(0,w.Qs)(n.kind)}),(0,r.jsx)(ef,{strong:!0,style:{fontSize:12},children:n.kindLabel}),n.role&&(0,r.jsxs)(ef,{type:"secondary",style:{fontSize:12},children:["\xb7 ",n.role]})]}),(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(ef,{type:"secondary",style:{fontSize:12},children:"在干什么"}),(0,r.jsx)(ef,{style:{fontSize:12},children:null!=(t=n.activity)?t:n.title})]}),n.activity&&n.title&&n.activity!==n.title&&(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(ef,{type:"secondary",style:{fontSize:12},children:"对象"}),(0,r.jsx)(ef,{style:{fontSize:12},children:n.title})]}),(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(ef,{type:"secondary",style:{fontSize:12},children:n.completedAt?"耗时":"已跑"}),(0,r.jsx)(ef,{style:{fontSize:12},children:(0,w.uH)(K(n,l))})]}),n.metrics.length>0&&(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(ef,{type:"secondary",style:{fontSize:12},children:"指标"}),(0,r.jsx)(ef,{style:{fontSize:12},children:n.metrics.map(e=>e.text).join(" \xb7 ")})]}),(0,r.jsxs)("button",{type:"button",className:"canvasAgentLocate",onClick:()=>i(n.id),title:"在画布上定位到这条节点",children:[(0,r.jsx)(eg.A,{})," 定位到节点"]})]})}function ej(e){return e.some(e=>"failed"===e.status)?"repairing":"completed"}function eA(e){let{view:t,running:n,onLocate:i,decisions:a=[],active:o=!1}=e,[s,c]=(0,l.useState)(()=>Date.now());if((0,l.useEffect)(()=>{if(!n)return;let e=setInterval(()=>c(Date.now()),1e3);return()=>clearInterval(e)},[n]),0===t.runningTotal&&0===t.recentTotal&&0===a.length&&!o)return null;let d=t.runningTotal-t.running.length;return(0,r.jsxs)(m.A,{size:4,align:"center",wrap:!0,"data-agents":t.runningTotal,className:"canvasAgentsChips",children:[(0,r.jsx)(el.A,{title:"本稿此刻在调度哪些智能体(点图标看在干什么)",children:(0,r.jsx)(ef,{type:"secondary",style:{fontSize:12},children:"智能体调度中心"})}),(o||a.length>0)&&(0,r.jsx)(ex.A,{trigger:"click",placement:"bottomLeft",content:(0,r.jsx)("div",{className:"canvasAgentDetail",children:0===a.length?(0,r.jsx)("div",{className:"canvasAgentDetailRow",children:(0,r.jsx)(ef,{type:"secondary",style:{fontSize:12},children:"尚无来源或任务裁决回执。主智能体负责施工部署、来源与工况核定及作者协调;当前执行进度见运行节点。"})}):a.map(e=>{var t;return(0,r.jsxs)("div",{className:"canvasAgentDetailRow",children:[(0,r.jsx)(ef,{type:"secondary",style:{fontSize:12},children:e.action}),(0,r.jsx)(ef,{style:{fontSize:12},children:null!=(t=e.note)?t:e.title})]},e.id)})}),children:(0,r.jsxs)("button",{type:"button",className:"canvasAgentChip canvasAgentChipMain","data-kind":"supervisor","data-status":ej(a),title:"主智能体:核定施工部署、裁决来源与工况、协调作者任务和交付",children:[(0,r.jsx)("span",{className:"canvasAgentAvatar","data-status":ej(a),children:(0,r.jsx)("span",{className:"canvasAgentAvatarGlyph",children:(0,w.Qs)("supervisor")})}),(0,r.jsx)("span",{className:"canvasAgentRole","data-role":"main",children:"主"})]})}),t.running.map(e=>{var t;return(0,r.jsx)(ex.A,{trigger:"click",placement:"bottomLeft",content:(0,r.jsx)(ey,{row:e,now:s,onLocate:i}),children:(0,r.jsxs)("button",{type:"button",className:"canvasAgentChip","data-node-id":e.id,"data-kind":e.kind,"data-status":e.status,title:"".concat(e.kindLabel).concat(e.role?" \xb7 ".concat(e.role):"",":").concat(null!=(t=e.activity)?t:e.title),children:[(0,r.jsx)("span",{className:"canvasAgentAvatar","data-status":e.status,children:(0,r.jsx)("span",{className:"canvasAgentAvatarGlyph",children:(0,w.Qs)(e.kind)})}),(0,r.jsx)("span",{className:"canvasAgentRole","data-role":"sub",title:"子智能体(执行具体环节)",children:"子"})]})},e.id)}),d>0&&(0,r.jsx)(el.A,{title:"另有 ".concat(d," 个在跑(画布上可逐个查看)"),children:(0,r.jsxs)(ef,{type:"secondary",style:{fontSize:12},children:["+",d]})}),t.recent.length>0&&(0,r.jsx)(el.A,{title:t.recent.map(e=>"".concat(e.kindLabel,":").concat(e.title,"(已完成)")).join("\n"),children:(0,r.jsxs)(ef,{type:"secondary",style:{fontSize:12},children:[(0,r.jsx)(ev.A,{})," 刚完成 ",t.recentTotal]})})]})}var eb=n(34052),ew=n(84253),ek=n(76830),eS=n(96538);function eI(e){let{reports:t,deliveryReadings:n,t:i}=e,[a,o]=(0,l.useState)(!1),s=(e,t)=>{let n=null==i?void 0:i(e);return n&&n!==e?n:t},c=(0,l.useSyncExternalStore)(j.p5,j.dH,j.dH),d=c?function(e,t){var n,r;let{receipt:l}=e,i=(e,n,r,l)=>t(e,n).replace("{count}",String(r))+(l?":".concat(l):""),a=[];"review"===l.exportPurpose&&a.push({key:"review-purpose",tone:"info",text:"审阅稿:验收结论保持原状态,独立问题报告与正文版本绑定"}),l.issuesReport&&a.push({key:"review-report",tone:"info",text:"独立问题报告:".concat(l.issuesReport.id.slice(0,12),";正文 SHA256:").concat(l.issuesReport.bodySha256)}),"mismatch"===l.gateBinding?a.push({key:"binding-mismatch",tone:"error",text:t("records.receiptBindingMismatch","正文与门禁指纹不匹配:放行依据不是这份正文(收口后被编辑/替换过)")}):"absent"===l.gateBinding&&a.push({key:"binding-absent",tone:"warning",text:t("records.receiptBindingAbsent","门禁未绑定正文指纹:无法核对放行依据是否就是这份正文")}),l.gateIssues&&l.gateIssues.length>0&&a.push({key:"gate-issues",tone:"error",text:i("records.receiptGateIssues","门禁阻断清单 {count} 项",l.gateIssues.length,l.gateIssues[0])}),l.contentIssues&&l.contentIssues.length>0&&a.push({key:"content-issues",tone:"warning",text:i("records.receiptContentIssues","内容问题 {count} 条",l.contentIssues.length,l.contentIssues[0])});let o=null!=(r=null==(n=l.figureInline)?void 0:n.failed)?r:[];return o.length>0&&a.push({key:"figure-inline",tone:"warning",text:i("records.receiptFigureFailures","图件未内联 {count} 张",o.length,o[0])}),l.renderAudit&&l.renderAudit.blockerCount>0&&a.push({key:"render-blockers",tone:"error",text:i("records.receiptRenderBlockers","渲染审计:源层结构缺陷 {count} 项",l.renderAudit.blockerCount)}),l.renderAudit&&l.renderAudit.notices.length>0&&a.push({key:"render-notices",tone:"warning",text:i("records.receiptRenderNotices","渲染审计告警 {count} 条",l.renderAudit.notices.length,l.renderAudit.notices[0])}),l.templateWarning&&a.push({key:"template-warning",tone:"warning",text:"".concat(t("records.receiptTemplateWarning","模板占位符缺失,已回退:")).concat(l.templateWarning)}),l.pageLimit&&a.push({key:"page-limit",tone:"warning",text:l.pageLimit}),"number"==typeof l.pdfPageCount&&a.push({key:"pdf-pages",tone:"info",text:t("records.receiptPdfPages","PDF 共 {count} 页").replace("{count}",String(l.pdfPageCount))}),a}(c,s):[],u=d.filter(e=>"info"!==e.tone),h=d.length>0;if(0===t.length&&!n&&0===u.length&&!(null==c?void 0:c.receipt.issuesReport)&&(null==c?void 0:c.receipt.exportPurpose)!=="review")return null;let p=[...t].sort((e,t)=>t.exportedAt-e.exportedAt),m=p.find(e=>{var t,n;return(null!=(n=null==(t=e.gateChecklist)?void 0:t.items.length)?n:0)>0});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el.A,{title:s("records.reportTitle","导出闭环报告"),children:(0,r.jsxs)(x.Ay,{size:"small",icon:(0,r.jsx)(ek.A,{}),onClick:()=>o(!0),children:[(null==n?void 0:n.contractQuality)?"七维诊断".concat(n.contractQualityStale?"(历史)":n.contractQuality.score.deliveryReady?"(待验收)":"(待修验)"):s("records.reportEntry","导出报告"),t.length>0&&(0,r.jsx)("span",{className:"ml-1 text-[var(--colorTextTertiary)]",children:t.length}),u.length>0&&(0,r.jsx)(v.A,{color:u.some(e=>"error"===e.tone)?"error":"warning",className:"m-0 ml-1 border-0",children:s("records.receiptBadge","本次导出 {count} 项提醒").replace("{count}",String(u.length))})]})}),(0,r.jsxs)(eb.A,{title:s("records.reportTitle","导出闭环报告"),placement:"right",size:"default",open:a,onClose:()=>o(!1),styles:{body:{padding:16}},children:[h&&c&&(0,r.jsxs)("div",{className:"mb-3 rounded-xl border px-3 py-2.5 text-xs ".concat(u.length>0?"border-[var(--colorWarning)] bg-[var(--colorWarningBg)]":"border-[var(--borderColor)] bg-[var(--colorFillAlter)]"),children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"font-semibold",children:s("records.receiptTitle","最近一次导出回执")}),(0,r.jsx)(v.A,{color:"blue",className:"m-0 border-0 font-semibold",children:c.format.toUpperCase()}),(0,r.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:new Date(c.at).toLocaleString()}),c.filename&&(0,r.jsx)("span",{className:"break-all text-[var(--colorTextTertiary)]",children:c.filename})]}),c.receipt.issuesReport&&(0,r.jsx)("a",{className:"text-[var(--colorPrimary)] underline",href:(0,j.Es)(c,c.receipt.issuesReport),children:"下载本份正文的独立问题报告"}),(0,r.jsx)("div",{className:"mt-2 flex flex-col gap-1.5",children:d.map(e=>(0,r.jsx)("div",{className:"error"===e.tone?"text-[var(--colorError)]":"warning"===e.tone?"text-[var(--colorWarning)]":"text-[var(--colorTextSecondary)]",children:e.text},e.key))})]}),n&&(0,r.jsxs)("div",{className:"mb-3 flex flex-col gap-2 rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5 text-xs",children:[n.contractQuality&&(0,r.jsx)(k,{readings:n}),n.netChars&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:s("records.netCharsLabel","修复链净增字数")}),(0,r.jsxs)("span",{className:"font-semibold",children:[n.netChars.delta>0?"+":"",n.netChars.delta]}),(0,r.jsxs)("span",{className:"text-[var(--colorTextSecondary)]",children:["(",n.netChars.before," → ",n.netChars.after,",",s("records.netCharsRatio","占原稿")," ",(100*n.netChars.ratio).toFixed(1),"%)"]}),n.netChars.ratio>.05&&(0,r.jsx)(el.A,{title:s("records.netCharsWarn",'目标 ≤5%:净增越大,"分是修出来的"成分越高——首过写作的缺口被修复链补上了'),children:(0,r.jsx)(v.A,{color:"warning",className:"m-0 border-0",children:s("records.netCharsOver","超目标")})})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:s("records.reviewReportLabel","交付三件套报告")}),(0,r.jsx)("a",{href:"/api/documents/generated/".concat(encodeURIComponent(n.docId),"/report").concat(n.projectRoot?"?projectRoot=".concat(encodeURIComponent(n.projectRoot),"&download=1"):"?download=1"),className:"text-[var(--colorPrimary)] underline",children:s("records.reviewReportDownload","下载 .md")}),(0,r.jsx)("a",{href:"/api/documents/generated/".concat(encodeURIComponent(n.docId),"/report").concat(n.projectRoot?"?projectRoot=".concat(encodeURIComponent(n.projectRoot)):""),target:"_blank",rel:"noreferrer",className:"text-[var(--colorPrimary)] underline",children:s("records.reviewReportView","在线查看")}),(0,r.jsx)("span",{className:"text-[var(--colorTextTertiary)]",children:s("records.reviewReportHint","未跑到终门禁的记录没有报告(打开会说明原因)")})]})]}),0===p.length?(0,r.jsx)(ew.A,{image:ew.A.PRESENTED_IMAGE_SIMPLE,description:s("records.reportEmpty","还没有导出记录")}):(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[p.map((e,t)=>(0,r.jsxs)("div",{className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5 text-xs",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(v.A,{color:"blue",className:"m-0 border-0 font-semibold",children:e.format.toUpperCase()}),(0,r.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:new Date(e.exportedAt).toLocaleString()}),"review"===e.exportPurpose&&(0,r.jsx)(v.A,{children:"审阅稿"}),e.reviewReport&&(0,r.jsx)("a",{className:"text-[var(--colorPrimary)] underline",href:(0,j.Es)({documentId:null==n?void 0:n.docId,projectRoot:null==n?void 0:n.projectRoot},e.reviewReport),children:"下载独立问题报告"})]}),(0,r.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-[var(--colorTextSecondary)]",children:[void 0!==e.durationMs&&(0,r.jsxs)("span",{children:[s("records.reportDuration","总用时")," ",(0,eS.a)(e.durationMs,{unit:"ms",style:"fine-decimal"})]}),void 0!==e.repairedCount&&(0,r.jsxs)("span",{children:[s("records.reportRepaired","修复")," ",e.repairedCount,void 0!==e.blockingCount?"(".concat(s("records.reportBlocking","质量诊断快照阻断")," ").concat(e.blockingCount,")"):""]}),e.ruleSummary&&e.ruleSummary.length>0&&(0,r.jsxs)("span",{children:[s("records.reportRules","规则")," ",e.ruleSummary.length]}),!1===e.gatePassed&&(0,r.jsxs)(v.A,{color:"error",className:"m-0 border-0",children:[s("records.reportGateBlocked","非交付物"),void 0!==e.gateIssueCount&&e.gateIssueCount>0?" \xb7 ".concat(s("records.reportGateBlockedCount","门禁阻断")," ").concat(e.gateIssueCount," ").concat(s("records.reportGateBlockedUnit","项")):" \xb7 ".concat(s("records.reportGateBlockedUnknown","阻断数未记录(清单缺失)"))]}),e.healthAlerts&&e.healthAlerts.length>0&&(0,r.jsxs)(v.A,{color:"warning",className:"m-0 border-0",children:[s("records.reportHealthAlerts","健康告警")," ",e.healthAlerts.length]})]})]},"".concat(e.exportedAt,"-").concat(t))),(null==m?void 0:m.gateChecklist)&&(0,r.jsxs)("div",{className:"rounded-xl border border-[var(--colorWarning)] bg-[var(--colorWarningBg)] px-3 py-2.5",children:[(0,r.jsxs)("div",{className:"text-xs font-semibold text-[var(--colorWarning)]",children:[s("records.reportChecklistTitle","最近一次非交付物导出的未收敛项"),"(",s("records.reportChecklistTotal","共 {count} 项").replace("{count}",String(m.gateChecklist.total)),")"]}),(0,r.jsx)("div",{className:"mt-2 flex flex-col gap-2",children:m.gateChecklist.items.map(e=>(0,r.jsxs)("div",{className:"text-xs",children:[(0,r.jsx)("div",{className:"whitespace-pre-wrap text-[var(--colorText)]",children:"".concat(e.index,".【").concat(e.category,"】").concat(e.problem)}),(0,r.jsxs)("div",{className:"text-[var(--colorTextSecondary)]",children:[e.repairPath,e.detectorId?"|".concat(e.detectorId):""]})]},e.index))})]})]})]})]})}let{Text:eC}=d.A,ez={connecting:{text:"通道连接中",color:"default"},open:{text:"事件通道已连",color:"success"},error:{text:"通道已断(改用增量补差)",color:"warning"},closed:{text:"通道已关闭",color:"default"}};function eR(e){let{title:t,status:n,updatedAt:l,wordCount:i,nodeCount:a,visibleCount:o,hiddenCount:s,degraded:c,skills:d,gate:u,connection:h,lastSeq:p,zoom:g,following:y,followStatus:j,generating:A,resumable:b,exporting:k,nonDeliverableExport:S,onFit:I,onToggleFollow:C,onContinue:z,onPause:R,onResume:N,onAbort:E,onExport:T,exportReports:M,deliveryReadings:L,previewOpen:D,onTogglePreview:P,hasNodeOffsets:B,onResetNodeLayout:q,agents:_,onLocateAgent:H,supervisorDecisions:W,agentsActive:F,startedAt:U,t:G,collapsed:Q=!1,onToggleCollapsed:O}=e,X=A&&!b,V=(0,r.jsxs)("div",{style:{fontSize:12,lineHeight:1.7},children:[(0,r.jsx)("div",{children:"导出当前真实正文供审阅,并下载独立问题报告;不会自动补齐缺章或签发交付验收。"}),(0,r.jsx)("div",{children:"审阅身份标在文件名和回执中,正文不添加诊断、封面或水印。"})]});return Q?(0,r.jsx)("div",{className:"canvasToolbar canvasToolbarCollapsed",children:(0,r.jsxs)("button",{type:"button",className:"canvasToolbarBubble","aria-expanded":!1,"aria-label":"展开画布工具条",onClick:()=>null==O?void 0:O(!1),children:[(0,r.jsx)(eo.A,{}),n&&(0,r.jsx)(v.A,{color:(0,w.uj)(n),className:"m-0",children:(0,w.GC)(n,G)}),(0,r.jsx)(ep,{updatedAt:l,running:X}),u&&!u.passed&&(0,r.jsx)(v.A,{color:"error",className:"m-0",children:"门禁 ".concat(u.blockingCount)}),S?(0,r.jsx)(v.A,{color:"processing",className:"m-0",children:"已导出审阅稿"}):null]})}):(0,r.jsxs)("div",{className:"canvasToolbar",children:[(0,r.jsxs)(m.A,{wrap:!0,size:8,align:"center",style:{flex:1,minWidth:0},children:[(0,r.jsx)(eC,{strong:!0,style:{fontSize:14},ellipsis:!0,title:t,children:t}),n&&(0,r.jsx)(v.A,{color:(0,w.uj)(n),children:(0,w.GC)(n,G)}),(0,r.jsxs)(eC,{type:"secondary",style:{fontSize:12},children:[void 0!==i?"".concat(i.toLocaleString()," 字"):""," 已接收 ".concat(a," 个节点,显示 ").concat(o," 个"),s>0?"(未显示 ".concat(s,")"):"",l?" 更新于 ".concat(new Date(l).toLocaleTimeString()):""]}),(0,r.jsx)(ep,{updatedAt:l,running:X}),(0,r.jsx)(em,{startedAt:U,endedAt:l,running:X}),_&&(0,r.jsx)(eA,{view:_,running:_.runningTotal>0,onLocate:null!=H?H:()=>{},...W?{decisions:W}:{},active:!!F}),(0,r.jsx)(el.A,{title:"通道游标 seq=".concat(null!=p?p:0,"(断线重连用它补发;节点增量用日志时间 t)"),children:(0,r.jsx)(v.A,{color:ez[h].color,children:ez[h].text})}),d.hits.length>0&&(0,r.jsx)(el.A,{title:d.hits.map(e=>"".concat(e.title,"(").concat(e.skillId,")")).join("、"),children:(0,r.jsxs)(v.A,{color:"blue",children:["技能命中 ",d.hits.length]})}),u&&(0,r.jsx)(el.A,{title:u.issues.length>0?u.issues.join("\n"):"服务端门禁结论:通过",children:(0,r.jsx)(v.A,{color:u.passed?"success":"error",children:u.passed?"门禁:通过":"门禁:阻断 ".concat(u.blockingCount," 项")})})]}),(0,r.jsxs)(m.A,{wrap:!0,size:6,align:"center",children:[(0,r.jsxs)(eC,{type:"secondary",style:{fontSize:12,width:44,textAlign:"center"},children:[Math.round(100*g),"%"]}),(0,r.jsx)(el.A,{title:B?"把拖过的节点放回自动排布(手工摆放的是**偏移**,清空即恢复)":"没有手工拖过的节点:布局就是自动排布的",children:(0,r.jsx)(x.Ay,{size:"small",disabled:!B,onClick:q,children:"恢复布局"})}),(0,r.jsx)(el.A,{title:"适应窗口(按内容包围盒缩放)",children:(0,r.jsx)(x.Ay,{size:"small",onClick:I,children:"适应"})}),(0,r.jsx)(el.A,{title:null!=j?j:"跟随最新:生成中新出现的节点自动定位(关掉就不再打扰你的视角)",children:(0,r.jsx)(x.Ay,{size:"small",type:y?"primary":"default",onClick:C,children:y?(null==j?void 0:j.startsWith("跟随暂停"))?"跟随暂停中":"跟随中":"跟随最新"})}),(0,r.jsx)(ei.A,{type:"vertical"}),X&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(el.A,{title:"立即取消模型调用并保存已完成正文,停稳后可继续",children:(0,r.jsx)(x.Ay,{size:"small",icon:(0,r.jsx)(es.A,{}),onClick:R,children:"暂停"})}),(0,r.jsx)(ea.A,{title:"中止生成",description:"确定中止本次生成?已生成的章节会保留,可从中断处继续。",okText:"中止",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:E,children:(0,r.jsx)(x.Ay,{size:"small",danger:!0,icon:(0,r.jsx)(ec.A,{}),children:"中止"})})]}),!X&&b&&(0,r.jsx)(x.Ay,{size:"small",type:"primary",icon:(0,r.jsx)(ed.A,{}),onClick:z,children:"继续生成"}),!X&&!b&&"paused"===n&&(0,r.jsx)(x.Ay,{size:"small",type:"primary",icon:(0,r.jsx)(ed.A,{}),onClick:N,children:"从暂停处继续"}),(0,r.jsx)(ei.A,{type:"vertical"}),(0,r.jsx)(el.A,{title:V,children:(0,r.jsxs)(m.A,{size:4,children:[(0,r.jsx)(eC,{type:"secondary",children:"审阅导出"}),[{key:"docx",label:"DOCX"},{key:"pdf",label:"PDF",primary:!0}].map(e=>(0,r.jsx)(x.Ay,{size:"small",type:e.primary?"primary":"default",loading:k===e.key,disabled:null!==k&&k!==e.key,onClick:()=>T(e.key),children:e.label},e.key))]})}),(0,r.jsx)(eI,{reports:null!=M?M:[],...L?{deliveryReadings:L}:{},...G?{t:G}:{}}),(0,r.jsx)(el.A,{title:"成稿预览(服务端渲染并清洗后的全文;只读,不提供导出)",children:(0,r.jsx)(x.Ay,{size:"small",type:D?"primary":"default",onClick:P,children:"成稿预览"})}),(0,r.jsx)(el.A,{title:"收起工具条(把画布还给内容;状态与门禁仍留在气泡上)",children:(0,r.jsx)(x.Ay,{size:"small",icon:(0,r.jsx)(eu.A,{}),"aria-label":"收起工具条",onClick:()=>null==O?void 0:O(!0)})})]}),S&&(0,r.jsx)(f.A,{style:{width:"100%",marginTop:8},type:"info",showIcon:!0,message:"已导出审阅稿与独立问题报告",description:(0,r.jsxs)("div",{style:{whiteSpace:"pre-wrap",fontSize:12},children:[(0,r.jsx)("div",{children:"正文保留实际内容;审阅导出不代表交付验收通过。"}),S.count>0&&(0,r.jsxs)("div",{style:{marginTop:4},children:["阻断项(".concat(S.count,"):"),S.issues.slice(0,5).map((e,t)=>(0,r.jsxs)("div",{children:["\xb7 ",e]},t)),S.count>5&&(0,r.jsx)("div",{children:"…还有 ".concat(S.count-5," 项")})]})]})}),c.length>0&&(0,r.jsx)(f.A,{style:{width:"100%",marginTop:8},type:"warning",showIcon:!0,message:"画布显示有取整(下列内容本次未下发;聚合值与节点信息不受影响)",description:(0,r.jsx)("div",{style:{fontSize:12},children:c.map((e,t)=>(0,r.jsxs)("div",{children:["\xb7 ",e]},t))})}),0===a&&A&&(0,r.jsx)(f.A,{style:{width:"100%",marginTop:8},type:"info",showIcon:!0,icon:(0,r.jsx)(eh.A,{}),message:"还没有节点日志:生成侧尚未写入第一个节点(节点日志是唯一真相源,画布不伪造占位节点)"})]})}var eN=n(57481),eE=n(28629),eT=n(52057),eM=n(8665),eL=n(38332),eD=n(7576),eP=n(58569),eB=n(76506),eq=n(45042);let{Paragraph:e_,Text:eH}=d.A,eW={local:{text:"影响面:局部",color:"blue",hint:"改动只落在该节点自身子树:定点补丁即可。"},propagated:{text:"影响面:传播",color:"orange",hint:'改动会沿依赖传播到同章其余部分:按 11.1,走"变更传播"而不是重跑整个节点。'},contaminated:{text:"影响面:事实/命名类",color:"red",hint:"该节点持有事实 / 命名 / 标题指纹:按 11.1,**要么回滚、要么重新校准**,不能当普通改动提交。"}},eF={error:{color:"red",text:"错误"},warning:{color:"orange",text:"警告"},info:{color:"blue",text:"提示"}};function eU(e){var t,n,i,a,o,s,c,d,u,h,p;let{node:g,impact:f,flatNodes:y,highlighted:j,generating:A,repairPreview:b,onFocusNode:k,onRequestRepair:S,onClose:I,onDraftRepairNote:C,onCancelRepairPreview:z,onMention:R,onLocate:N,onPause:E,onResume:T,nodeEvents:M,t:L,onRunRepair:D,onConfirmRepair:P,onRollbackRepair:B,repairRun:q,defaultRepairNote:_}=e,H="skill.load"===g.type||"string"==typeof g.metrics.skillId,W=new Map(y.map(e=>[e.id,e])),F=(0,w.Jy)(g),U=(0,w.dB)(g.metrics,24),G=g.issues.filter(e=>!Q(e)),O=g.issues.filter(e=>Q(e)),X=G.filter(e=>"error"===e.level).length,V=f?(0,r.jsxs)(m.A,{direction:"vertical",size:8,style:{width:"100%"},children:[(0,r.jsxs)(m.A,{wrap:!0,children:[(0,r.jsx)(v.A,{color:eW[f.kind].color,children:eW[f.kind].text}),(0,r.jsx)(v.A,{color:f.rollbackable?"default":"red",children:f.rollbackable?"可回滚":"需回滚或重新校准"}),(0,r.jsx)(v.A,{color:f.escalate?"red":"default",children:"波及 ".concat(f.affectedNodeIds.length," 节点").concat(f.escalate?"(超阈值)":"")})]}),(0,r.jsx)(eH,{type:"secondary",style:{fontSize:12},children:f.reason}),(0,r.jsx)(eH,{type:"secondary",style:{fontSize:12},children:eW[f.kind].hint}),f.escalate&&(0,r.jsx)(v.A,{color:"red",children:"影响面超出阈值:该改动需**人工确认**后才能提交(自动留痕不再适用)"}),(0,r.jsx)(eL.A,{size:"small",header:(0,r.jsx)(eH,{type:"secondary",style:{fontSize:12},children:"波及节点(点击定位)"}),dataSource:f.affectedNodeIds,renderItem:e=>{let t=W.get(e);return(0,r.jsx)(eL.A.Item,{style:{paddingBlock:4},children:(0,r.jsx)(x.Ay,{type:"link",size:"small",style:{padding:0,height:"auto"},onClick:()=>k(e),children:t?"".concat(t.title,"(").concat((0,w.z9)(t.type),")"):"未知节点 ".concat(e)})})}})]}):(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(ew.A,{image:ew.A.PRESENTED_IMAGE_SIMPLE,description:"该节点没有预计算的影响面"}),(0,r.jsx)(eH,{type:"secondary",style:{fontSize:12},children:"聚合接口只对**有问题的节点**与**修复节点**预计算影响面(首屏不做 O(n\xb2))。 这里可以按需触发一次修复请求,服务端会在事务前给出权威判定——**本面板不冒充结论**。"}),(0,r.jsx)(x.Ay,{size:"small",disabled:!S,onClick:()=>null==S?void 0:S(g),children:"按需评估影响面(走修复请求)"})]}),[J,Y]=(0,l.useState)("");(0,l.useEffect)(()=>{Y(null!=_?_:"")},[_,g.id]);let K=b&&b.nodeId===g.id?(0,r.jsx)("div",{className:"nodeInfoRepair",children:(0,r.jsxs)(m.A,{direction:"vertical",size:6,style:{width:"100%"},children:[(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(eH,{strong:!0,style:{fontSize:13},children:"修复影响面预览"}),(0,r.jsx)(v.A,{color:eW[b.impact.kind].color,children:eW[b.impact.kind].text}),(0,r.jsx)(v.A,{color:b.impact.rollbackable?"default":"red",children:b.impact.rollbackable?"可回滚":"不可回滚"})]}),(0,r.jsxs)(eH,{type:"secondary",style:{fontSize:12},children:["波及 ".concat(b.impact.affectedNodeIds.length," 个节点").concat(b.impact.escalate?",超出阈值需人工确认":"","。"),b.impact.reason]}),!b.impact.rollbackable&&(0,r.jsx)(eH,{style:{fontSize:12,color:"var(--colorError)"},children:"11.1:污染类改动**要么回滚、要么重新校准**,不能当普通改动提交。"}),(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(x.Ay,{size:"small",onClick:C,children:"把修复意图写进输入框"}),(0,r.jsx)(x.Ay,{size:"small",type:"text",onClick:z,children:"收起"})]}),D&&(0,r.jsxs)("div",{className:"nodeInfoRepairRun","data-repair-node":g.id,children:[(0,r.jsx)(eH,{type:"secondary",style:{fontSize:12},children:"修复说明(会逐字记进修复请求;服务端按它定位与归因)"}),(0,r.jsx)(eD.A.TextArea,{size:"small",autoSize:{minRows:2,maxRows:4},value:J,onChange:e=>Y(e.target.value),placeholder:"例如:这一节的开挖深度与资料不符,应按图纸标注 5.15m 改写"}),(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(x.Ay,{size:"small",type:"primary",loading:(null==q?void 0:q.phase)==="creating"&&q.nodeId===g.id,disabled:0===J.trim().length,onClick:()=>D(J.trim()),children:"发起修复(@本节点)"}),(null==q?void 0:q.nodeId)===g.id&&"confirmable"===q.phase&&P&&!(q.needsLocalization&&(null!=(o=null==(t=q.candidates)?void 0:t.length)?o:0)>0)&&(0,r.jsx)(x.Ay,{size:"small",danger:!0,onClick:()=>P(),children:"确认执行变更事务"}),(null==q?void 0:q.nodeId)===g.id&&"executed"===q.phase&&q.requestId&&B&&(0,r.jsx)(x.Ay,{size:"small",onClick:B,children:"回滚这次修复"})]}),(null==q?void 0:q.nodeId)===g.id&&"creating"!==q.phase&&(0,r.jsxs)("div",{className:"nodeInfoRepairResult",children:["error"===q.phase&&(0,r.jsx)(eH,{style:{fontSize:12,color:"var(--colorError)"},children:"修复请求未建立:".concat(null!=(s=q.message)?s:"")}),"confirmable"===q.phase&&(0,r.jsx)(eH,{type:"secondary",style:{fontSize:12},children:"请求已建立(".concat(null!=(c=q.requestId)?c:"",")").concat(q.attribution?";归因:".concat(q.attribution):"","。")+(q.needsLocalization&&(null!=(d=null==(n=q.candidates)?void 0:n.length)?d:0)>0?"这句话该改哪个节点由你定:下面列出系统定位到的候选,点一个才会执行(缺定位服务端一律拒绝)。":'点「确认执行变更事务」后才会真的改正文——这是"必须人工确认"的落点。')}),"confirmable"===q.phase&&q.needsLocalization&&(null!=(u=null==(i=q.candidates)?void 0:i.length)?u:0)>0&&(0,r.jsx)(m.A,{direction:"vertical",size:4,style:{width:"100%"},children:q.candidates.map(e=>(0,r.jsx)("div",{"data-testid":"repair-location-candidate",children:(0,r.jsxs)(m.A,{size:6,wrap:!0,children:[(0,r.jsx)(v.A,{children:"匹配 ".concat(e.score.toFixed(2))}),(0,r.jsx)(eH,{style:{fontSize:12},children:e.excerpt.slice(0,60)}),P&&(0,r.jsx)(x.Ay,{size:"small",type:"primary",onClick:()=>P(e.nodeId),children:"定位到该节点并执行"})]})},e.nodeId))}),"executed"===q.phase&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(m.A,{wrap:!0,size:6,children:[(0,r.jsx)(v.A,{color:"applied"===q.outcome?"green":"rolled-back"===q.outcome?"orange":"red",children:"执行结果:".concat(null!=(h=q.outcome)?h:"未执行")}),q.attribution&&(0,r.jsx)(v.A,{children:"归因:".concat(q.attribution)}),void 0!==q.restoredChars&&(0,r.jsx)(v.A,{children:"恢复 ".concat(q.restoredChars," 字")})]}),q.notExecutedReason&&(0,r.jsx)(eH,{style:{fontSize:12,color:"var(--colorError)"},children:q.notExecutedReason})]})]})]})]})}):null;return(0,r.jsxs)("div",{className:"nodeInfoPanel","data-node-id":g.id,children:[(0,r.jsxs)("div",{className:"nodeInfoHeader",children:[(0,r.jsx)("span",{className:"nodeInfoHeaderIcon",children:(0,w.kH)(g.type)}),(0,r.jsx)(eH,{strong:!0,ellipsis:!0,style:{flex:1,minWidth:0,fontSize:14},title:g.title,children:g.title}),g.unknownType&&(0,r.jsx)(v.A,{children:"未知类型"}),(0,r.jsx)(v.A,{color:(0,w.uv)(g.status),children:(0,w.m_)(g.status,L)}),X>0&&(0,r.jsx)(v.A,{color:"red",children:"".concat(X," 个错误")}),A&&"running"===g.status&&(0,r.jsx)(eH,{type:"secondary",style:{fontSize:11},children:"运行中"}),I&&(0,r.jsx)(el.A,{title:"关闭(Esc)",children:(0,r.jsx)(x.Ay,{type:"text",size:"small",className:"nodeInfoClose","aria-label":"关闭信息卡片",onClick:I,children:(0,r.jsx)(eq.A,{})})})]}),(0,r.jsxs)("div",{className:"nodeInfoActions",children:[(0,r.jsx)(x.Ay,{size:"small",onClick:()=>null==R?void 0:R(g),children:"@ 到对话框"}),(0,r.jsx)(x.Ay,{size:"small",onClick:()=>null==N?void 0:N(g),children:"在画布中定位"}),(0,r.jsx)(x.Ay,{size:"small",danger:X>0,onClick:()=>null==S?void 0:S(g),children:"请求修复(预览影响面)"}),A&&"running"===g.status&&E&&(0,r.jsx)(x.Ay,{size:"small",onClick:E,children:"暂停"}),"paused"===g.status&&T&&(0,r.jsx)(x.Ay,{size:"small",onClick:T,children:"继续生成"})]}),K,(0,r.jsx)(eP.A,{size:"small",items:[{key:"overview",label:"概览",children:(0,r.jsxs)(eB.A,{size:"small",column:1,bordered:!0,children:[(0,r.jsx)(eB.A.Item,{label:"状态",children:(0,r.jsx)(v.A,{color:(0,w.uv)(g.status),children:(0,w.m_)(g.status,L)})}),(0,r.jsxs)(eB.A.Item,{label:"类型",children:[(0,w.z9)(g.type),g.unknownType?"(闭集外的类型,按通用卡片渲染)":""]}),(0,r.jsx)(eB.A.Item,{label:"节点 id",children:(0,r.jsx)(e_,{copyable:{text:g.id},style:{margin:0,fontSize:12},children:g.id})}),(0,r.jsx)(eB.A.Item,{label:"稳定序号",children:g.seq}),(0,r.jsx)(eB.A.Item,{label:"父节点",children:g.parentId?(0,r.jsx)(x.Ay,{type:"link",size:"small",style:{padding:0,height:"auto"},onClick:()=>k(g.parentId),children:null!=(p=null==(a=W.get(g.parentId))?void 0:a.title)?p:g.parentId}):"(根节点)"}),(0,r.jsxs)(eB.A.Item,{label:"耗时",children:[(0,w.uH)(F),"running"===g.status?"(运行中)":""]}),(0,r.jsx)(eB.A.Item,{label:"进度",children:g.progress?"".concat(g.progress.label||"进度",":").concat(g.progress.current,"/").concat(g.progress.total):"—"}),(0,r.jsxs)(eB.A.Item,{label:"子节点数",children:[g.children.length,j?"(当前处于影响面高亮)":""]}),(0,r.jsxs)(eB.A.Item,{label:"开始 / 完成",children:[g.startedAt?new Date(g.startedAt).toLocaleString():"—"," / ",g.completedAt?new Date(g.completedAt).toLocaleString():"—"]})]})},{key:"issues",label:"问题".concat(G.length>0?"(".concat(G.length,")"):""),children:0===G.length?(0,r.jsx)(ew.A,{image:ew.A.PRESENTED_IMAGE_SIMPLE,description:"该节点没有记录问题"}):(0,r.jsx)(eL.A,{size:"small",dataSource:G,renderItem:e=>{var t,n;let l=null!=(n=eF[e.level])?n:{color:"default",text:String(e.level)};return(0,r.jsx)(eL.A.Item,{children:(0,r.jsxs)(m.A,{direction:"vertical",size:2,style:{width:"100%"},children:[(0,r.jsxs)(m.A,{wrap:!0,size:4,children:[(0,r.jsx)(v.A,{color:l.color,children:l.text}),e.category&&(0,r.jsx)(v.A,{children:e.category}),e.repairability&&(0,r.jsx)(v.A,{color:"blue",children:e.repairability}),(null==(t=e.provenance)?void 0:t.detectorId)&&(0,r.jsx)(el.A,{title:e.provenance.fingerprint,children:(0,r.jsx)(v.A,{children:e.provenance.detectorId})})]}),(0,r.jsx)(eH,{style:{fontSize:12},children:e.message}),e.suggestion&&(0,r.jsxs)(eH,{type:"secondary",style:{fontSize:12},children:["建议:",e.suggestion]}),(e.chapterId||e.sectionTitle)&&(0,r.jsxs)(eH,{type:"secondary",style:{fontSize:11},children:["位置:",e.chapterId||""," ",e.sectionTitle||""]})]})})}})},...O.length>0?[{key:"details",label:"明细(".concat(O.length,")"),children:(0,r.jsx)(eL.A,{size:"small",dataSource:O,renderItem:e=>(0,r.jsx)(eL.A.Item,{style:{paddingBlock:3},children:(0,r.jsx)(eH,{type:"secondary",style:{fontSize:12},children:e.message})})})}]:[],...M&&M.length>0?[{key:"events",label:"事件(".concat(M.length,")"),children:(0,r.jsx)(eL.A,{size:"small",dataSource:[...M].slice(-40).reverse(),renderItem:e=>(0,r.jsx)(eL.A.Item,{style:{paddingBlock:3},children:(0,r.jsxs)(m.A,{size:6,wrap:!0,children:[(0,r.jsxs)(eH,{type:"secondary",style:{fontSize:11},children:["#",e.seq]}),(0,r.jsx)(v.A,{style:{fontSize:11},children:e.type}),(0,r.jsx)(eH,{type:"secondary",style:{fontSize:11},children:new Date(e.at).toLocaleTimeString()}),e.detail?(0,r.jsx)(eH,{style:{fontSize:11},ellipsis:!0,children:e.detail}):null]})})})}]:[],{key:"impact",label:"影响面",children:V},...H?[{key:"skills",label:"技能",children:(()=>{let e="string"==typeof g.metrics.skillId?g.metrics.skillId:void 0;return(0,r.jsxs)(eB.A,{size:"small",column:1,bordered:!0,children:[(0,r.jsx)(eB.A.Item,{label:"技能 id",children:null!=e?e:g.id}),(0,r.jsx)(eB.A.Item,{label:"技能名",children:g.title}),(0,r.jsx)(eB.A.Item,{label:"命中章节",children:"string"==typeof g.metrics.chapter?g.metrics.chapter:"—"}),(0,r.jsx)(eB.A.Item,{label:"状态",children:(0,r.jsx)(v.A,{color:(0,w.uv)(g.status),children:(0,w.m_)(g.status,L)})})]})})()}]:[],...U.length>0?[{key:"metrics",label:"指标",children:(0,r.jsx)(eB.A,{size:"small",column:1,bordered:!0,children:U.map(e=>(0,r.jsx)(eB.A.Item,{label:e.key,children:e.text.replace("".concat(e.key,": "),"")},e.key))})}]:[],...g.payloadRef?[{key:"payload",label:"载荷",children:(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(e_,{copyable:{text:g.payloadRef},style:{margin:0,fontSize:12},children:g.payloadRef}),(0,r.jsx)(eH,{type:"secondary",style:{fontSize:12},children:"8.6 / 附录 F.2:节点**不得携带载荷**(`agentWorkflow` 已是 p50 2.2 MB / max 94.6 MB)。 prompt / response / 证据快照等明细都在内容寻址的 `artifacts/<sha256>` 里,这里只有引用。"})]})}]:[]]})]})}var eG=n(34038);let{Text:eQ}=d.A,eO=["upsert","status","rollup","reset","start","stage","thinking","text","tool_call_preview","progress","error","done","complete","log"];function eX(e,t){var n,r;let l=null!=(n=e.projectRoot)?n:t;return{specId:e.templateId||e.id,promptIds:null!=(r=e.promptIds)?r:[],...e.materialRoot?{materialRoot:e.materialRoot}:{},...l?{projectRoot:l}:{},...e.templateName?{title:e.templateName}:{}}}function eV(e,t){let n=t.node;if(!n||"string"!=typeof n.id)return!0;if("upsert"===t.type)return e.set(n.id,n),!0;let r=e.get(n.id);if(!r){var l,i;return e.set(n.id,{...n,title:null!=(l=n.title)?l:n.id,seq:null!=(i=n.seq)?i:0}),!1}let{startedAt:a,...o}=n;return e.set(n.id,{...r,...o,id:r.id}),!0}function eJ(){var e,t,n,i,o,d,k,S,I,C,R,N,E,T,L,D,P,B,H,W,G,Q,X,V,J,$,Z,ee,et;let en=(0,c.useRouter)(),el=(0,A.Vr)(),{message:ei}=u.A.useApp(),ea="string"==typeof en.query.id?en.query.id:"",eo="string"==typeof en.query.projectRoot?en.query.projectRoot:void 0,[es,ec]=(0,l.useState)(null),[ed,eu]=(0,l.useState)(!0),[eh,ep]=(0,l.useState)(null),[em,ex]=(0,l.useState)(new Map),[eg,ev]=(0,l.useState)("connecting"),[ef,ey]=(0,l.useState)(0),[ej,eA]=(0,l.useState)(null),[eb,ew]=(0,l.useState)("all"),[ek,eS]=(0,l.useState)(!0),[eI,eC]=(0,l.useState)(0),[ez,eL]=(0,l.useState)(()=>Date.now()),eD=(0,l.useCallback)(()=>{ek&&eC(Date.now()+eT.WF)},[ek]),[eP,eB]=(0,l.useState)(""),[eq,e_]=(0,l.useState)(!1),[eH,eW]=(0,l.useState)([]),[,eF]=(0,l.useState)([]),[eJ,eK]=(0,l.useState)([]),[e$,eZ]=(0,l.useState)(null),[e0,e1]=(0,l.useState)(null),{bubbles:e2,push:e4,clear:e5}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1500,[t,n]=(0,l.useState)([]),r=(0,l.useRef)(null),i=(0,l.useCallback)(t=>{let r=function(e){var t,n;let r=null!=(t=e.now)?t:Date.now(),l=null!=(n=e.freshMs)?n:15e3,{before:i,after:a}=e,o=a.parentId;if(!o)return null;if(!i){if("number"!=typeof a.startedAt||r-a.startedAt>l||r-a.startedAt<-l)return null;let e=F(a,"dispatch");return e?{id:"".concat(o,"->").concat(a.id,":dispatch"),fromId:o,toId:a.id,kind:"dispatch",label:e,at:r}:null}if(!(_.has(a.status)&&!_.has(i.status))||"number"!=typeof a.completedAt||r-a.completedAt>l||r-a.completedAt<-l)return null;let s=F(a,"report");return s?{id:"".concat(a.id,"->").concat(o,":report"),fromId:a.id,toId:o,kind:"report",label:s,at:r}:null}(t);r&&n(t=>(function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1500,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:6,i=[...e.filter(e=>n-e.at<r&&e.id!==t.id),t];return i.length>l?i.slice(i.length-l):i})(t,r,r.at,e))},[e]),a=(0,l.useCallback)(()=>{n(e=>0===e.length?e:[])},[]);return(0,l.useEffect)(()=>{if(0!==t.length)return r.current=setTimeout(()=>{r.current=null,n(t=>(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1500,r=e.filter(e=>t-e.at<n);return r.length===e.length?e:r})(t,Date.now(),e))},Math.max(0,t.reduce((e,t)=>Math.min(e,t.at),1/0)+e-Date.now())),()=>{r.current&&(clearTimeout(r.current),r.current=null)}},[t,e]),{bubbles:t,push:i,clear:a}}(),[e6,e8]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if("function"!=typeof window.matchMedia)return;let e=window.matchMedia("(prefers-reduced-motion: reduce)"),t=()=>e8(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let[e3,e9]=(0,l.useState)(null),[e7,te]=(0,l.useState)(()=>new Map),[tt,tn]=(0,l.useState)([]),[tr,tl]=(0,l.useState)(null),[ti,ta]=(0,l.useState)(!1),[to,ts]=(0,l.useState)(!0),[tc,td]=(0,l.useState)(!0),[tu,th]=(0,l.useState)([]),[tp,tm]=(0,l.useState)(null),[tx,tg]=(0,l.useState)(!1),tv=(0,eT.s_)(),{centerOn:tf,fit:ty}=tv,tj=(0,l.useCallback)(()=>{var e;let t=null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect();if(!t)return{left:0,top:0,right:0,bottom:0};let n=e=>{let n=document.querySelector(e);if(!n)return null;let r=n.getBoundingClientRect();return{top:r.top-t.top,bottom:r.bottom-t.top}},r=n(".canvasToolbar"),l=n(".canvasInputBar"),i=Math.min(r?r.bottom+8:24,.4*t.height),a=Math.max(l?l.top-8:t.height-24,.6*t.height);return{left:24,top:i,right:t.width-24,bottom:a}},[tv.containerRef]),tA=(0,l.useRef)(new Map),tb=(0,l.useRef)(0),tw=(0,l.useRef)({nodes:[],events:[],cursor:0}),tk=(0,l.useRef)(null),tS=(0,l.useRef)(0),tI=(0,l.useRef)(eo),tC=(0,l.useCallback)(e=>{let t=e.key?el(e.key):e.text,n=t===e.key?e.text:t;tS.current+=1,eF(t=>[{id:tS.current,kind:e.kind,text:n,at:Date.now()},...t].slice(0,100)),"error"===e.kind?ei.error(n):"warning"===e.kind?ei.warning(n):"success"===e.kind&&ei.success(n)},[ei,el]),tz=(0,b.tl)({projectRoot:eo,documentId:ea||null,onNotice:tC,t:el}),{refreshDocuments:tR,applyRecord:tN}=tz,tE=function(e,t){let[n,r]=(0,l.useState)({loading:!1,error:null,preview:null}),i=(0,l.useRef)(0),a=(0,l.useCallback)(async()=>{if(!e)return void r({loading:!1,error:"缺少记录 id,无法取回成稿预览",preview:null});let n=i.current+1;i.current=n,r(e=>({...e,loading:!0,error:null}));try{let{preview:l}=await (0,j.sz)(e,t);if(i.current!==n)return;r({loading:!1,error:null,preview:l})}catch(e){if(i.current!==n)return;r({loading:!1,error:e instanceof Error?e.message:"取回成稿预览失败",preview:null})}},[e,t]),o=(0,l.useCallback)(()=>{i.current+=1,r({loading:!1,error:null,preview:null})},[]);return{...n,load:a,reset:o}}(ea,null!=(E=tI.current)?E:eo),tT=(0,l.useCallback)(()=>{var e;if(ti){tE.reset(),ta(!1);return}ta(!0),tE.load(),(0,j.f$)(null!=(e=tI.current)?e:eo).then(e=>th(e.assets.filter(e=>e.usedByDocumentIds.includes(ea)))).catch(()=>th([]))},[ti,tE,ea,eo]),tM=(0,l.useCallback)(e=>{var t;let n=null!=(t=tI.current)?t:eo;if("image"!==e.type)return void(0,j.oS)(e.id,"file",n).catch(()=>tC({kind:"error",text:"打开资产失败"}));tg(!1),tm(e)},[eo,tC]),tL=(0,l.useCallback)(e=>{tn(t=>t.includes(e)?t:[...t,e])},[]),tD=(0,l.useCallback)(()=>{tk.current||(tk.current=setTimeout(()=>{tk.current=null;let e=tw.current;if(tw.current={nodes:[],events:[],cursor:0},e.nodes.length>0){let n=tA.current,r=0;for(let l of e.nodes){var t;let e=null==(t=l.node)?void 0:t.id,i=e?n.get(e):void 0;eV(n,l)||(r+=1);let a=e?n.get(e):void 0;a&&e4({...i?{before:i}:{},after:a})}ex(new Map(n)),r>0&&tL("通道收到 ".concat(r," 条指向未知节点的补丁:已按最小节点收下(说明本客户端漏读了 upsert,或日志存在损坏)"))}if(e.cursor>tb.current&&(tb.current=e.cursor),e.events.length>0){let t=e.events;eW(e=>[...t.reverse(),...e].slice(0,200)),ey(e=>t.reduce((e,t)=>Math.max(e,t.seq),e))}},120))},[tL,e4]);(0,l.useEffect)(()=>()=>{tk.current&&clearTimeout(tk.current)},[]);let tP=(0,l.useCallback)((e,t)=>{let n=tw.current;t&&n.nodes.push(t),n.events.push(e),(null==t?void 0:t.logT)&&t.logT>n.cursor&&(n.cursor=t.logT),tD()},[tD]),tB=(0,l.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(ea){e.silent||eu(!0);try{var t,n,r,l,i,a;let e=tI.current?"?projectRoot=".concat(encodeURIComponent(tI.current)):"",o=await fetch("/api/documents/canvas/".concat(encodeURIComponent(ea)).concat(e));if(404===o.status)return void ep("记录不存在(可能已被删除)");if(!o.ok)throw Error(await o.text()||"HTTP ".concat(o.status));let s=await o.json();tI.current=null!=(r=s.document.projectRoot)?r:tI.current,ec(s),ep(null),tn(null!=(l=s.degraded)?l:[]);let c=function(e){let t=[],n=e=>{for(let r of e){let{children:e,...l}=r;t.push(l),e&&n(e)}};return n(e),t}(null!=(i=null==(t=s.nodes)?void 0:t.tree)?i:[]),d=new Map(c.map(e=>[e.id,e]));tA.current=d,ex(d),tb.current=Math.max(tb.current,null!=(a=null==(n=s.nodes)?void 0:n.cursor)?a:0)}catch(e){ep(e instanceof Error?e.message:String(e))}finally{e.silent||eu(!1)}}},[ea]);(0,l.useEffect)(()=>{tB()},[tB]),(0,l.useEffect)(()=>{var e;let t=null==es||null==(e=es.nodes)?void 0:e.depth;null!=t&&ew(t)},[es]),(0,l.useEffect)(()=>{ea&&tR()},[ea,tR]),(0,l.useEffect)(()=>{let e=tz.documents.find(e=>e.id===ea);e&&tN(e)},[tN,ea,tz.documents]);let tq=(0,l.useCallback)(async()=>{if(ea)try{var e,t;let n=new URLSearchParams({since:String(tb.current)});tI.current&&n.set("projectRoot",tI.current);let r=await fetch("/api/documents/generated/".concat(encodeURIComponent(ea),"/nodes?").concat(n.toString()));if(!r.ok)return;let l=await r.json(),i=tA.current;for(let t of null!=(e=l.nodes)?e:[])eV(i,{type:"upsert",node:t});(null!=(t=l.nodes)?t:[]).length>0&&ex(new Map(i)),l.cursor&&(tb.current=Math.max(tb.current,l.cursor)),l.downgraded&&tL(l.reason||"增量过大,服务端已降级为全量快照")}catch(e){}},[tL,ea]);(0,l.useEffect)(()=>{if(!ea)return;let e=setInterval(()=>{tq()},1e4);return()=>clearInterval(e)},[ea,tq]),(0,l.useEffect)(()=>{if(!ea||"undefined"==typeof EventSource)return;let e=tI.current?"?projectRoot=".concat(encodeURIComponent(tI.current)):"",t=new EventSource("/api/documents/generated/".concat(encodeURIComponent(ea),"/events").concat(e));ev("connecting");let n=e=>t=>{var n,r,l;let i={};try{i=JSON.parse(t.data)}catch(e){}let a=null!=(l=i.type)?l:e;"reset"===a&&(e5(),tB({silent:!0}),tL("通道补发不可用(服务端重启或环形覆盖):已重取全量快照"));let o=null==(n=i.node)?void 0:n.title;tP({seq:"number"==typeof i.seq?i.seq:0,type:a,at:"number"==typeof i.at?i.at:Date.now(),...i.nodeId?{nodeId:i.nodeId}:{},...o?{nodeTitle:o}:{},...(null==(r=i.payload)?void 0:r.message)?{detail:i.payload.message}:{}},i.node?{type:a,node:i.node,...i.logT?{logT:i.logT}:{}}:void 0),i.node&&tR()},r=eO.map(e=>[e,n(e)]);for(let[e,n]of(t.onopen=()=>ev("open"),t.onerror=()=>{ev("error"),tq()},r))t.addEventListener(e,n);return t.onmessage=n("message"),()=>{for(let[e,n]of r)t.removeEventListener(e,n);t.close()}},[tL,e5,ea,tB,tP,tR,tq]),(0,l.useEffect)(()=>{e5()},[e5,ea]);let t_=(0,l.useMemo)(()=>(0,w.Jr)([...em.values()],"all"===eb?void 0:eb),[em,eb]),tH=(0,l.useMemo)(()=>(0,w.x8)(t_),[t_]),tW=(0,l.useMemo)(()=>(0,w.PI)(t_),[t_]),tF=(0,l.useMemo)(()=>0!==e7.size||e3?(0,w.bJ)(tW,(0,w.Kq)(e7,e3)):tW,[tW,e7,e3]),tU=(0,l.useRef)(1);tU.current=tv.view.k;let tG=(0,l.useRef)(!1);tG.current=null!==e3;let tQ=(0,l.useCallback)((e,t,n,r)=>{let{dx:l,dy:i}=(0,w.qj)({dx:t,dy:n},tU.current);if("move"===r)return void e9({id:e.id,dx:l,dy:i});e9(null),(0!==t||0!==n)&&te(t=>{var n;let r=new Map(t),a=null!=(n=r.get(e.id))?n:{dx:0,dy:0};return r.set(e.id,{dx:a.dx+l,dy:a.dy+i}),r})},[]),tO=(0,l.useCallback)(()=>{e9(null),te(new Map)},[]),tX=(0,l.useMemo)(()=>new Map(tH.map(e=>[e.id,e])),[tH]),tV=ej&&null!=(T=tX.get(ej))?T:null,tJ=(0,l.useMemo)(()=>{if(ej)return M(tH.map(eY),ej)},[tH,ej]),tY=(0,l.useMemo)(()=>{var e;return new Set(null!=(e=null==tJ?void 0:tJ.affectedNodeIds)?e:[])},[tJ]),tK=(0,l.useMemo)(()=>new Set(ej?[...(0,w.II)(t_,ej),ej]:[]),[t_,ej]),t$=(0,l.useMemo)(()=>(0,w.Kg)(tF),[tF]),tZ=(0,l.useMemo)(()=>(function(e,t){var n,r;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null!=(n=l.limit)?n:6,a=null!=(r=l.recentLimit)?r:3,o=[],s=[],c=(e,n)=>{for(let r of e)O.has(r.status)?o.push(Y(r,n,t)):"completed"===r.status&&"number"==typeof r.completedAt&&t-r.completedAt<=9e4&&s.push(Y(r,n,t)),r.children.length>0&&c(r.children,n+1)};return c(e,0),o.sort((e,n)=>{var r,l;let i=null!=(r=K(e,t))?r:0;return(null!=(l=K(n,t))?l:0)-i||e.id.localeCompare(n.id)}),s.sort((e,t)=>{var n,r;return(null!=(n=t.completedAt)?n:0)-(null!=(r=e.completedAt)?r:0)||e.id.localeCompare(t.id)}),{running:o.slice(0,i),recent:s.slice(0,a),runningTotal:o.length,recentTotal:s.length}})(t_,Date.now()),[t_]),t0=(0,l.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=[],r=e=>{for(let i of e){if("supervisor"===i.type){var t,l;let e="string"==typeof(null==(t=i.metrics)?void 0:t.action)?i.metrics.action:"unknown",r="string"==typeof(null==(l=i.metrics)?void 0:l.note)?i.metrics.note:void 0;n.push({id:i.id,action:e,title:i.title||"调度决策",...r?{note:r}:{},status:i.status,..."number"==typeof i.completedAt?{at:i.completedAt}:"number"==typeof i.startedAt?{at:i.startedAt}:{}})}i.children.length>0&&r(i.children)}};return r(e),n.sort((e,t)=>{var n,r;return(null!=(n=t.at)?n:0)-(null!=(r=e.at)?r:0)||e.id.localeCompare(t.id)}),n.slice(0,t)})(t_),[t_]),t1=(0,l.useCallback)(e=>{let t=tX.get(e.fromId);return t?tY.has(e.fromId)&&tY.has(e.toId)?"affected":2>=(0,w.vp)(t.status)?"warn":tK.has(e.fromId)&&tK.has(e.toId)?"active":"default":"default"},[tY,tK,tX]);(0,l.useEffect)(()=>{if(0===eI)return;let e=setInterval(()=>eL(Date.now()),1e3);return()=>clearInterval(e)},[eI]);let t2=(0,l.useMemo)(()=>{if(0===tH.length)return null;let e=tH.filter(e=>"running"===e.status),t=e.length>0?e:tH;return t.reduce((e,t)=>{var n,r;return(null!=(n=t.seq)?n:0)>=(null!=(r=e.seq)?r:0)?t:e},t[0])},[tH]),t4=null==t2?void 0:t2.id,t5=(0,l.useMemo)(()=>{var e;return(0,eT.be)({following:ek,pausedUntil:eI,now:ez,node:t2?{title:t2.title,...(null==(e=t2.metrics)?void 0:e.roundIteration)!==void 0?{round:t2.metrics.roundIteration}:{}}:void 0})},[ek,eI,ez,t2]);(0,l.useEffect)(()=>{var e;if(!ek||!t4||eI>Date.now()||tG.current)return;let t=null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect();if(!t)return;let n=tF.nodes.find(e=>e.node.id===t4);n&&(0,eT.xA)({x:n.x,y:n.y,width:w.zT,height:w.EL},tv.view,{width:t.width,height:t.height},tj())&&tf(n.x,n.y,void 0,tj())},[tf,ek,eI,tF.nodes,t4,tj,tv.containerRef,tv.view]),(0,l.useEffect)(()=>{var e;if(!(null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect())||0===tF.nodes.length)return;let{dx:t,dy:n}=(0,eT.B)({width:tF.width,height:tF.height},tv.view,tj());tv.panBy(t,n)},[tF.width,tF.height,tF.nodes.length]);let t6=(0,l.useCallback)(e=>{eA(e);let t=tF.nodes.find(t=>t.node.id===e);t&&tf(t.x,t.y,void 0,tj())},[tf,tF.nodes,tj]);(0,l.useEffect)(()=>{if(!ej)return;let e=e=>{"Escape"===e.key&&eA(null)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[ej]);let t8=(0,l.useCallback)(e=>{eB(t=>""===t||t.endsWith(" ")?"".concat(t,"@").concat(e.title," "):"".concat(t," @").concat(e.title," "))},[]),t3=(0,l.useCallback)(()=>{let e=null==es?void 0:es.document;if(!e)return;let t=eP.trim();t&&(e_(!0),(0,j.wI)(e.id,t,{...tI.current?{projectRoot:tI.current}:{}}).then(e=>{var t;tC({kind:"info",text:e.answer?"".concat(e.receipt,"\n").concat(e.answer):e.receipt}),eK(null!=(t=e.candidates)?t:[]),eB("")}).catch(e=>tC({kind:"error",text:e instanceof Error?e.message:"指令未受理"})).finally(()=>e_(!1)))},[es,tC,eP]),t9=(0,l.useCallback)(()=>{let e=null==es?void 0:es.document;e&&(e_(!0),tz.startGeneration(eX(e,tI.current),eP.trim()).finally(()=>e_(!1)))},[es,tz,eP]),t7=(0,l.useCallback)(e=>{let t=null==es?void 0:es.document;t&&(e_(!0),(0,j.wI)(t.id,"(选定:".concat(e.label,")"),{...tI.current?{projectRoot:tI.current}:{},acceptedCandidate:{kind:e.kind}}).then(e=>{tC({kind:"info",text:e.receipt}),eK([])}).catch(e=>tC({kind:"error",text:e instanceof Error?e.message:"指令未受理"})).finally(()=>e_(!1)))},[es,tC]),ne=(0,l.useCallback)(async()=>{let e=null==es?void 0:es.document;if(!e)return;let t=eX(e,tI.current);if(!t.projectRoot)return void tC({kind:"error",text:"未识别当前项目,无法预览结构"});try{let e=await (0,j.dk)({promptIds:t.promptIds,requirement:eP.trim(),...t.materialRoot?{materialRoot:t.materialRoot}:{},...t.title?{title:t.title}:{},projectRoot:t.projectRoot});tl({title:e.title,chapters:e.chapters,outlineSource:e.derivation.outlineSource,materialScope:e.materialScope})}catch(e){tC({kind:"error",text:e instanceof Error?e.message:"结构预览失败"})}},[es,tC,eP]),nt=(0,l.useCallback)(e=>{let t=M(tH.map(eY),e.id);if(!t)return void tC({kind:"warning",text:"该节点不在当前节点集合里,无法评估影响面"});eZ({nodeId:e.id,nodeTitle:e.title,nodeType:e.type,impact:t})},[tH,tC]),nn=(0,l.useCallback)(()=>{if(!e$)return;let e=(0,w.RV)(e$.nodeTitle,e$.impact);eB(t=>t?"".concat(t," ").concat(e):e),eZ(null)},[e$]),[nr,nl]=(0,l.useState)(null),[ni,na]=(0,l.useState)(null),no=(0,l.useCallback)(e=>{if(!e$)return;let t=e$.nodeId;nl({nodeId:t,phase:"creating"}),(0,j.xU)({documentId:ea,targetNodeId:t,userMessage:e}).then(e=>{var n,r,l,i;nl({nodeId:t,phase:"confirmable",requestId:null==(n=e.request)?void 0:n.id,attribution:"string"==typeof e.attribution?e.attribution:void 0,localizationNote:e.localizationNote,...e.needsLocalization?{needsLocalization:!0}:{},...(null==(i=e.request)||null==(l=i.localization)||null==(r=l.candidates)?void 0:r.length)?{candidates:e.request.localization.candidates}:{}})}).catch(e=>{nl({nodeId:t,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea,e$]),ns=(0,l.useCallback)(e=>{na({phase:"creating"}),(0,j.xU)({documentId:ea,userMessage:e}).then(e=>{var t,n,r,l;na({phase:"confirmable",requestId:null==(t=e.request)?void 0:t.id,attribution:"string"==typeof e.attribution?e.attribution:void 0,candidates:null!=(l=null==(r=e.request)||null==(n=r.localization)?void 0:n.candidates)?l:[],localizationNote:e.localizationNote})}).catch(e=>{na({phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea]),nc=(0,l.useCallback)(e=>{(null==ni?void 0:ni.requestId)&&(0,j.Ho)({documentId:ea,requestId:ni.requestId,acceptedNodeId:e}).then(e=>{var t;na({...ni,phase:"executed",outcome:String(null!=(t=e.outcome)?t:""),notExecutedReason:e.notExecutedReason})}).catch(e=>{na({...ni,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ni,ea]),nd=(0,l.useCallback)(e=>{(null==nr?void 0:nr.requestId)&&(0,j.Ho)({documentId:ea,requestId:nr.requestId,...e?{acceptedNodeId:e}:{}}).then(e=>{var t;nl({...nr,phase:"executed",outcome:String(null!=(t=e.outcome)?t:""),notExecutedReason:e.notExecutedReason,attribution:"string"==typeof e.attribution?e.attribution:nr.attribution})}).catch(e=>{nl({...nr,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea,nr]),nu=(0,l.useCallback)(()=>{(null==nr?void 0:nr.requestId)&&(0,j.vX)({documentId:ea,requestId:nr.requestId}).then(e=>{var t,n,r;let l=null==(t=e.restoredChars)?void 0:t.beforeChars,i=null==(n=e.restoredChars)?void 0:n.afterChars;nl({...nr,phase:"executed",outcome:String(null!=(r=e.outcome)?r:"rolled-back"),restoredChars:void 0!==l&&void 0!==i?l-i:void 0})}).catch(e=>{nl({...nr,phase:"error",message:e instanceof Error?e.message:String(e)})})},[ea,nr]),nh=(0,l.useCallback)(()=>{tz.pauseDocument(ea).catch(e=>tC({kind:"error",text:e instanceof Error?e.message:"暂停失败"}))},[ea,tz,tC]),np=(0,l.useCallback)(()=>{tz.resumePausedDocument(ea).catch(e=>tC({kind:"error",text:e instanceof Error?e.message:"继续失败"}))},[ea,tz,tC]),nm=null==es?void 0:es.document.status,nx=tz.loading||"generating"===nm||"queued"===nm,ng=(0,l.useRef)(null),nv=(0,l.useRef)(null),[nf,ny]=(0,l.useState)({width:0,height:0});(0,l.useLayoutEffect)(()=>{let e=nv.current;if(!e)return void ny({width:0,height:0});let t=()=>{let t=e.firstElementChild;if(!t)return;let n=e.offsetWidth,r=Math.max(t.scrollHeight,t.offsetHeight);ny(e=>Math.abs(e.width-n)>2||Math.abs(e.height-r)>2?{width:n,height:r}:e)};t();let n=new ResizeObserver(t);return n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild),()=>n.disconnect()},[ej]);let nj=(0,l.useMemo)(()=>{var e;if(!ej)return null;let t=tF.nodes.find(e=>e.node.id===ej),n=null==(e=tv.containerRef.current)?void 0:e.getBoundingClientRect();if(!t||!n)return null;let r=[".canvasToolbar",".canvasInputBar",".canvasRecordsBall"].map(e=>{var t;return null==(t=document.querySelector(e))?void 0:t.getBoundingClientRect()}).filter(e=>!!e).map(e=>({left:e.left-n.left,top:e.top-n.top,right:e.right-n.left,bottom:e.bottom-n.top})),l="".concat(tv.view.x,",").concat(tv.view.y,",").concat(tv.view.k),i=ng.current,a=i&&i.id===ej&&i.viewKey===l?i:null,o=(0,w.Aq)({node:{x:t.x,y:t.y},view:tv.view,box:n,panelWidth:nf.width>0?nf.width:462,panelHeight:nf.height>0?nf.height:480,obstacles:r,...a?{pin:{left:a.left,top:a.top}}:{}});ng.current={id:ej,viewKey:l,left:o.left,top:o.top};let s=Math.round(.62*n.height);return{left:o.left,top:o.top,maxHeight:Math.max(180,Math.min(o.maxHeight,s))}},[tF.nodes,ej,tv,nf]),nA=(0,l.useCallback)(e=>{t8(e),requestAnimationFrame(()=>{var e;return null==(e=document.querySelector(".canvasInputBar textarea"))?void 0:e.focus()})},[t8]),nb=(0,l.useCallback)(e=>{t6(e.id),e1(e.id),window.setTimeout(()=>e1(t=>t===e.id?null:t),1200)},[t6]),nw=(0,l.useCallback)(async e=>{if(ea)try{let{document:t}=await (0,j.v7)(ea,!1,tI.current);if(!t)return void tC({kind:"warning",text:"记录不存在,无法导出"});await tz.export.exportRecord(t,e)}catch(e){tC({kind:"error",text:e instanceof Error?e.message:"导出失败"})}},[ea,tz.export,tC]),nk=tz.boundRecord,nS=function(e,t){if(!e)return;let n=(null==t?void 0:t.docId)===e.id?t:void 0,r=e.deliveryQuality;return r?{...n,docId:e.id,...e.projectRoot?{projectRoot:e.projectRoot}:{},contractQuality:r.receipt,...r.stale?{contractQualityStale:r.stale}:{contractQualityStale:void 0}}:n}(null==es?void 0:es.document,tz.deliveryReadings),nI=tz.canResume;return ea?eh?(0,r.jsx)(p.Ay,{status:"warning",title:"画布打不开",subTitle:eh,extra:(0,r.jsxs)(m.A,{children:[(0,r.jsx)(x.Ay,{icon:(0,r.jsx)(y.A,{}),onClick:()=>{tB()},children:"重试"}),(0,r.jsx)(s(),{href:"/documents",children:(0,r.jsx)(x.Ay,{type:"primary",children:"回到文档页"})})]})}):(0,r.jsxs)("div",{className:"canvasRoot",children:[(0,r.jsx)(a(),{children:(0,r.jsx)("title",{children:(null==es?void 0:es.document.title)?"".concat(es.document.title," \xb7 画布"):"生成画布"})}),(0,r.jsx)(eR,{title:(null==es?void 0:es.document.title)||"生成画布",...nm?{status:nm}:{},...(null==es?void 0:es.document.updatedAt)!==void 0?{updatedAt:es.document.updatedAt}:{},...(null==es?void 0:es.document.wordCount)!==void 0?{wordCount:es.document.wordCount}:{},agents:tZ,supervisorDecisions:t0,agentsActive:nx,...(null==es?void 0:es.document.createdAt)!==void 0?{startedAt:es.document.createdAt}:{},onLocateAgent:e=>{eA(e),e1(e)},nodeCount:em.size,visibleCount:tF.nodes.length,hiddenCount:null!=(L=null==es?void 0:es.nodes.hiddenCount)?L:0,degraded:tt,skills:{hits:null!=(D=null==es?void 0:es.skills.hits)?D:[],note:null!=(P=null==es?void 0:es.skills.note)?P:""},gate:null!=(B=null==es?void 0:es.gate)?B:null,connection:eg,lastSeq:ef,zoom:tv.view.k,following:ek,followStatus:t5.title,generating:!!nx,resumable:nI,exporting:tz.export.exporting,nonDeliverableExport:tz.export.nonDeliverableExport,onFit:()=>ty(tF.width,tF.height,tj()),onToggleFollow:()=>eS(e=>!e),onContinue:()=>{nk&&tz.resumeDocument(nk)},onPause:nh,onResume:np,onAbort:()=>{tz.abortGeneration()},onExport:e=>{nw(e)},exportReports:tz.export.exportReports,...nS?{deliveryReadings:nS}:{},previewOpen:ti,onTogglePreview:tT,hasNodeOffsets:e7.size>0,onResetNodeLayout:tO,collapsed:to,onToggleCollapsed:ts,t:el}),(0,r.jsxs)("div",{ref:tv.containerRef,className:"canvasStage",style:{backgroundImage:"radial-gradient(var(--canvasGridDot) 1px, transparent 1px)",backgroundSize:"".concat(eT.VF*tv.view.k,"px ").concat(eT.VF*tv.view.k,"px"),backgroundPosition:"".concat(tv.view.x,"px ").concat(tv.view.y,"px"),cursor:"grab"},onWheelCapture:eD,onPointerDown:e=>{var t;let n=e.target;null!=n&&null!=(t=n.closest)&&t.call(n,".nodeInfoLayer, .canvasToolbar, .canvasInputBar")||(eD(),tv.onPointerDown(e))},onPointerMove:tv.onPointerMove,onPointerUp:tv.endDrag,onPointerLeave:tv.endDrag,onClick:()=>eA(null),children:[ed&&(0,r.jsx)("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center"},children:(0,r.jsxs)(m.A,{direction:"vertical",align:"center",children:[(0,r.jsx)(h.A,{}),(0,r.jsx)(eQ,{type:"secondary",children:"正在读取节点日志…"})]})}),!ed&&0===tF.nodes.length&&(0,r.jsx)("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",pointerEvents:"none"},children:(0,r.jsxs)(m.A,{direction:"vertical",align:"center",size:8,children:[(0,r.jsx)(eQ,{type:"secondary",children:"还没有节点日志"}),(0,r.jsx)(eQ,{type:"secondary",style:{fontSize:12},children:"节点日志是唯一真相源:这里**不造占位节点**,发起生成后节点会随日志追加而出现。"})]})}),(0,r.jsxs)("div",{style:{position:"absolute",left:0,top:0,transformOrigin:"0 0",transform:"translate(".concat(tv.view.x,"px, ").concat(tv.view.y,"px) scale(").concat(tv.view.k,")"),width:tF.width,height:tF.height},children:[(0,r.jsx)(q,{edges:tF.edges,width:tF.width,height:tF.height,toneOf:t1,flowing:t$}),(0,r.jsx)(U,{bubbles:e2,layout:tF,static:e6}),tF.nodes.map(e=>(0,r.jsx)(er,{node:e.node,x:e.x,y:e.y,selected:e.node.id===ej,affected:tY.has(e.node.id)&&e.node.id!==ej,flashed:e0===e.node.id,onDrag:tQ,onSelect:e=>eA(e.id),t:el},e.node.id))]}),tV&&nj&&(0,r.jsx)("div",{ref:nv,className:"nodeInfoLayer",style:{left:nj.left,top:nj.top,maxHeight:nj.maxHeight},onClick:e=>e.stopPropagation(),onContextMenu:e=>e.stopPropagation(),children:(0,r.jsx)(eU,{node:tV,...tJ?{impact:tJ}:{},flatNodes:tH,highlighted:!!(ej&&tY.has(ej)),generating:!!nx,repairPreview:e$,repairRun:nr,onRunRepair:no,onConfirmRepair:nd,onRollbackRepair:nu,defaultRepairNote:e$?(0,w.RV)(e$.nodeTitle,e$.impact):"",onFocusNode:t6,onRequestRepair:nt,onClose:()=>eA(null),onDraftRepairNote:nn,onCancelRepairPreview:()=>eZ(null),onMention:nA,onLocate:nb,onPause:nh,onResume:np,nodeEvents:eH.filter(e=>e.nodeId===(null==tV?void 0:tV.id)),t:el})})]}),(0,r.jsx)(eM._,{quickActions:[...eJ.map(e=>({key:e.kind,label:"按「".concat(e.label,"」执行"),onClick:()=>t7(e)})),{key:"document-repair",label:"按这段要求修复正文(先定位)",onClick:()=>ns(eP.trim())},{key:"regenerate",label:"按这段要求再生成一份",onClick:t9}],value:eP,onChange:eB,onSend:t3,generating:!!nx,submitting:eq,disabled:!es,...es?{}:{disabledReason:"正在读取记录…"},selectedNode:tV,onMentionSelected:()=>{tV&&t8(tV)},resumable:nI,onContinue:()=>{nk&&tz.resumeDocument(nk)},onPreviewStructure:()=>{ne()},collapsed:tc,onToggleCollapsed:td}),(0,r.jsx)(eN._,{currentDocumentId:ea,...eo?{projectRoot:eo}:{},onSelect:e=>{en.push((0,eE.p)(e.id,e.projectRoot||eo))},onCurrentDeleted:()=>{en.push("/canvas")}}),(0,r.jsxs)(g.A,{open:!!ni,title:"文档级修复(先定位)",onCancel:()=>na(null),footer:(0,r.jsx)(x.Ay,{onClick:()=>na(null),children:"关闭"}),width:640,children:[(null==ni?void 0:ni.phase)==="creating"&&(0,r.jsx)(eQ,{type:"secondary",children:"正在定位要改的节点…"}),(null==ni?void 0:ni.phase)==="error"&&(0,r.jsx)(eQ,{type:"danger",children:"修复请求未建立:".concat(null!=(H=ni.message)?H:"")}),(null==ni?void 0:ni.phase)==="confirmable"&&(0,r.jsxs)(m.A,{direction:"vertical",size:8,style:{width:"100%"},children:[(0,r.jsx)(eQ,{type:"secondary",style:{fontSize:12},children:"请求已建立(".concat(null!=(W=ni.requestId)?W:"",")").concat(ni.attribution?";归因:".concat(ni.attribution):"","。")+"点一个候选才会真的改正文——定位这件事由你定,系统不替你点头。"}),(null!=(G=null==(e=ni.candidates)?void 0:e.length)?G:0)===0?(0,r.jsx)(eQ,{type:"warning",children:"系统定位不出候选节点:请改用「@ 节点名」指定,或在节点面板里发起(不猜一个节点去改)"}):ni.candidates.map(e=>(0,r.jsx)("div",{"data-testid":"document-repair-candidate",children:(0,r.jsxs)(m.A,{size:6,wrap:!0,children:[(0,r.jsx)(v.A,{children:"匹配 ".concat(e.score.toFixed(2))}),(0,r.jsx)(eQ,{style:{fontSize:12},children:e.excerpt.slice(0,80)}),(0,r.jsx)(x.Ay,{size:"small",type:"primary",onClick:()=>nc(e.nodeId),children:"定位到该节点并执行"})]})},e.nodeId))]}),(null==ni?void 0:ni.phase)==="executed"&&(0,r.jsxs)(m.A,{direction:"vertical",size:6,children:[(0,r.jsx)(v.A,{color:"applied"===ni.outcome?"green":"rolled-back"===ni.outcome?"orange":"red",children:"执行结果:".concat(null!=(Q=ni.outcome)?Q:"未执行")}),ni.notExecutedReason&&(0,r.jsx)(eQ,{type:"danger",style:{fontSize:12},children:ni.notExecutedReason})]})]}),(0,r.jsx)(eG.B,{open:!!tr,title:null!=(X=null==tr?void 0:tr.title)?X:"",chapters:null!=(V=null==tr?void 0:tr.chapters)?V:[],...(null==tr?void 0:tr.outlineSource)?{outlineSource:tr.outlineSource}:{},...(null==tr?void 0:tr.materialScope)?{materialScope:tr.materialScope}:{},onClose:()=>tl(null)}),(0,r.jsxs)(g.A,{open:ti,title:"成稿预览",onCancel:()=>{tE.reset(),ta(!1)},footer:(0,r.jsxs)(m.A,{children:[(0,r.jsx)(x.Ay,{onClick:()=>{tE.load()},loading:tE.loading,children:"重新取回"}),(0,r.jsx)(x.Ay,{type:"primary",onClick:()=>{tE.reset(),ta(!1)},children:"关闭"})]}),width:920,styles:{body:{maxHeight:"72vh",overflow:"auto",background:"var(--colorBgLayout)",padding:"16px 20px"}},style:{top:32},children:[(0,r.jsx)(z,{status:null!=(J=null==(t=tE.preview)?void 0:t.status)?J:nm,title:null!=($=null==(n=tE.preview)?void 0:n.title)?$:null==es?void 0:es.document.title,html:null==(i=tE.preview)?void 0:i.html,source:null==(o=tE.preview)?void 0:o.source,truncated:null==(d=tE.preview)?void 0:d.truncated,totalChars:null==(k=tE.preview)?void 0:k.totalChars,renderedChars:null==(S=tE.preview)?void 0:S.renderedChars,stats:null==(I=tE.preview)?void 0:I.stats,gate:null!=(ee=null!=(Z=null==(C=tE.preview)?void 0:C.gate)?Z:null==es?void 0:es.gate)?ee:null,deliveryReadings:nS,loading:tE.loading,error:tE.error,onRetry:()=>{tE.load()},updatedAt:null==(R=tE.preview)?void 0:R.updatedAt,generatedAt:null==(N=tE.preview)?void 0:N.generatedAt,t:el}),(0,r.jsxs)("div",{style:{marginTop:16,borderTop:"1px solid var(--colorBorderSecondary)",paddingTop:12},children:[(0,r.jsx)(eQ,{strong:!0,style:{fontSize:13},children:"本档用到的资产"}),0===tu.length?(0,r.jsx)("div",{children:(0,r.jsx)(eQ,{type:"secondary",style:{fontSize:12},children:"本档暂无资产"})}):(0,r.jsxs)(m.A,{direction:"vertical",size:4,style:{width:"100%",marginTop:6},children:[tu.slice(0,20).map(e=>(0,r.jsxs)(m.A,{size:8,children:[(0,r.jsx)(eQ,{style:{fontSize:12},children:e.name}),(0,r.jsx)(x.Ay,{size:"small",type:"link",onClick:()=>tM(e),children:"打开"})]},e.id)),tu.length>20?(0,r.jsxs)(eQ,{type:"secondary",style:{fontSize:12},children:["还有 ",tu.length-20," 项未列出"]}):null]})]})]}),(0,r.jsxs)(g.A,{open:!!tp,title:tp?"资产预览:".concat(tp.name):"",onCancel:()=>{tm(null),tg(!1)},footer:(0,r.jsxs)(m.A,{children:[tx&&tp?(0,r.jsx)(x.Ay,{onClick:()=>{var e;(0,j.oS)(tp.id,"file",null!=(e=tI.current)?e:eo).catch(()=>tC({kind:"error",text:"打开资产失败"}))},children:"用系统程序打开"}):null,(0,r.jsx)(x.Ay,{type:"primary",onClick:()=>{tm(null),tg(!1)},children:"关闭"})]}),width:760,styles:{body:{maxHeight:"68vh",overflow:"auto"}},children:[tp&&!tx?(0,r.jsx)("img",{alt:tp.name,src:(0,j.iN)(tp.id,null!=(et=tI.current)?et:eo),style:{maxWidth:"100%",display:"block",margin:"0 auto"},onError:()=>tg(!0)}):null,tx&&(0,r.jsx)(f.A,{type:"info",showIcon:!0,message:"这个资产不能在应用内渲染",description:"服务端只对图片(PNG / JPEG / WebP,按文件头验证)提供应用内渲染;其它形态请用系统程序打开。"})]})]}):(0,r.jsx)("div",{className:"appShellPlaceholder",children:(0,r.jsx)(h.A,{style:{margin:48}})})}function eY(e){return e}},72210:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/canvas/[id]",function(){return n(38977)}])}},e=>{e.O(0,[6409,1210,1702,5544,9551,4665,8399,7576,1499,8569,5061,9605,4052,5046,3456,8750,4530,636,6593,8792],()=>e(e.s=72210)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9124],{20241:(e,t,o)=>{"use strict";o.d(t,{A:()=>l});var n=o(97109),r=o(89857),a=o(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}let l=n.forwardRef((e,t)=>n.createElement(a.A,i({},e,{ref:t,icon:r.A})))},48161:(e,t,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/canvas",function(){return o(88785)}])},54746:(e,t,o)=>{"use strict";o.d(t,{A:()=>l});var n=o(97109),r=o(71242),a=o(88483);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}let l=n.forwardRef((e,t)=>n.createElement(a.A,i({},e,{ref:t,icon:r.A})))},71242:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"}},85493:(e,t,o)=>{"use strict";o.d(t,{A:()=>k});var n=o(97109),r=o(59188),a=o(4216),i=o(45042),l=o(97137),s=o(62188),c=o(67189),d=o(42644),u=o(3638),p=o(92162),m=o(26047),v=o(74567),g=o(15561),f=o(7961),h=o(10540);let b=(e,t,o)=>({background:e,[`${o}-icon`]:{color:t}}),y=(0,h.OF)("Alert",e=>[(e=>{let{componentCls:t,motionDurationSlow:o,marginXS:n,marginSM:r,fontSize:a,fontSizeLG:i,lineHeight:l,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:u,colorTextHeading:p,withDescriptionPadding:m,defaultPadding:v,lineWidth:h,lineType:b,colorSuccessBorder:y,colorWarningBorder:$,colorErrorBorder:S,colorInfoBorder:w}=e;return{[t]:{...(0,f.dF)(e),position:"relative",display:"flex",alignItems:"center",padding:v,wordWrap:"break-word",borderRadius:s,borderWidth:(0,g.zA)(h),borderStyle:b,[`&${t}-success`]:{borderColor:y},[`&${t}-info`]:{borderColor:w},[`&${t}-warning`]:{borderColor:$},[`&${t}-error`]:{borderColor:S},[`&${t}-filled`]:{borderColor:"transparent"},[`&${t}-rtl`]:{direction:"rtl"},[`${t}-section`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:a,lineHeight:l},"&-title":{color:p},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:["max-height","opacity","padding-top","padding-bottom","margin-bottom"].map(e=>`${e} ${o} ${c}`).join(", ")},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0},[`&${t}-with-description`]:{alignItems:"flex-start",padding:m,[`${t}-icon`]:{marginInlineEnd:r,fontSize:d,lineHeight:0},[`${t}-title`]:{display:"block",marginBottom:n,color:p,fontSize:i},[`${t}-description`]:{display:"block",color:u}},[`&${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}}})(e),(e=>{let{componentCls:t,colorSuccess:o,colorSuccessBg:n,colorWarning:r,colorWarningBg:a,colorError:i,colorErrorBg:l,colorInfo:s,colorInfoBg:c}=e;return{[t]:{"&-success":b(n,o,t),"&-info":b(c,s,t),"&-warning":b(a,r,t),"&-error":{...b(l,i,t),[`${t}-description > pre`]:{margin:0,padding:0}}}}})(e),(e=>{let{componentCls:t,iconCls:o,motionDurationMid:n,marginXS:r,fontSizeIcon:a,colorIcon:i,colorIconHover:l}=e;return{[t]:{[`${t}-actions`]:{marginInlineStart:r},[`${t}-close-icon`]:{marginInlineStart:r,padding:0,overflow:"hidden",fontSize:a,lineHeight:(0,g.zA)(a),backgroundColor:"transparent",border:"none",cursor:"pointer",...(0,f.K8)(e),[`${o}-close`]:{color:i,transition:`color ${n}`,"&:hover":{color:l}}},"&-close-text":{color:i,transition:`color ${n}`,"&:hover":{color:l}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),$=e=>{let{icon:t,type:o,className:i,style:c,successIcon:d,infoIcon:u,warningIcon:p,errorIcon:m}=e,v={success:d??n.createElement(r.A,null),info:u??n.createElement(s.A,null),error:m??n.createElement(a.A,null),warning:p??n.createElement(l.A,null)};return n.createElement("span",{className:i,style:c},t??v[o])},S=e=>{let{isClosable:t,prefixCls:o,closeIcon:r,handleClose:a,ariaProps:l,className:s,style:c}=e,d=!0===r||void 0===r?n.createElement(i.A,null):r;return t?n.createElement("button",{type:"button",onClick:a,className:(0,u.$)(`${o}-close-icon`,s),tabIndex:0,style:c,...l},d):null},w=n.forwardRef((e,t)=>{let{description:o,prefixCls:r,message:a,title:i,banner:l,className:s,rootClassName:g,style:f,onMouseEnter:h,onMouseLeave:b,onClick:w,afterClose:x,showIcon:E,closable:C,closeText:j,closeIcon:A,action:I,id:N,styles:k,classNames:P,...R}=e,z=i??a,[M,_]=n.useState(!1),O=n.useRef(null);n.useImperativeHandle(t,()=>({nativeElement:O.current}));let{getPrefixCls:D,direction:H,variant:q,closable:B,closeIcon:T,className:L,style:V,classNames:X,styles:Q,successIcon:F,infoIcon:G,warningIcon:K,errorIcon:W}=(0,v.TP)("alert"),U=D("alert",r),[J,Y]=y(U),{onClose:Z,afterClose:ee}=(0,m.Qd)(C)?C:{},et=t=>{_(!0),(Z??e.onClose)?.(t)},eo=n.useMemo(()=>void 0!==e.type?e.type:l?"warning":"info",[e.type,l]),en=e.variant??q??"outlined",er=n.useMemo(()=>!!(0,m.Qd)(C)&&!!C.closeIcon||!!j||("boolean"==typeof C?C:!!(!1!==A&&(0,m.R)(A))||!!B),[j,A,C,B]),ea=!!l&&void 0===E||E,ei={...e,prefixCls:U,variant:en,type:eo,showIcon:ea,closable:er},el=(0,p.XT)(V),es=(0,p.XT)(f),[ec,ed]=(0,p.AV)([X,P],[Q,el,k,es],{props:ei}),eu=(0,u.$)(U,`${U}-${eo}`,`${U}-${en}`,{[`${U}-with-description`]:!!o,[`${U}-no-icon`]:!ea,[`${U}-banner`]:!!l,[`${U}-rtl`]:"rtl"===H},L,s,g,ec.root,Y,J),ep=(0,d.KE)(R,{aria:!0,data:!0}),em=n.useMemo(()=>(0,m.Qd)(C)&&C.closeIcon?C.closeIcon:j||(void 0!==A?A:(0,m.Qd)(B)&&B.closeIcon?B.closeIcon:T),[A,C,B,j,T]),ev=n.useMemo(()=>{let e=C??B;return(0,m.Qd)(e)?(0,d.KE)(e,{data:!0,aria:!0}):{}},[C,B]);return n.createElement(c.Ay,{visible:!M,motionName:`${U}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:ee??x},({className:t,style:r},a)=>n.createElement("div",{id:N,ref:(0,d.K4)(O,a),"data-show":!M,className:(0,u.$)(eu,t),style:{...ed.root,...r},onMouseEnter:h,onMouseLeave:b,onClick:w,role:"alert",...ep},ea?n.createElement($,{className:(0,u.$)(`${U}-icon`,ec.icon),style:ed.icon,description:o,icon:e.icon,prefixCls:U,type:eo,successIcon:F,infoIcon:G,warningIcon:K,errorIcon:W}):null,n.createElement("div",{className:(0,u.$)(`${U}-section`,ec.section),style:ed.section},z?n.createElement("div",{className:(0,u.$)(`${U}-title`,ec.title),style:ed.title},z):null,o?n.createElement("div",{className:(0,u.$)(`${U}-description`,ec.description),style:ed.description},o):null),I?n.createElement("div",{className:(0,u.$)(`${U}-actions`,ec.actions),style:ed.actions},I):null,n.createElement(S,{className:ec.close,style:ed.close,isClosable:er,prefixCls:U,closeIcon:em,handleClose:et,ariaProps:ev})))});var x=o(41113),E=o(49939),C=o(90218),j=o(13076),A=o(83784),I=o(15472);let N=function(e){function t(){var e,o,n;return(0,x.A)(this,t),o=t,n=arguments,o=(0,C.A)(o),(e=(0,A.A)(this,(0,j.A)()?Reflect.construct(o,n||[],(0,C.A)(this).constructor):o.apply(this,n))).state={error:void 0,info:{}},e}return(0,I.A)(t,e),(0,E.A)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,title:t,description:o,id:r,children:a}=this.props,{error:i,info:l}=this.state,s=t??e,c=l?.componentStack||null,d=(0,m.R)(s)?s:i?.toString(),u=(0,m.R)(o)?o:c;return i?n.createElement(w,{id:r,type:"error",title:d,description:n.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},u)}):a}}])}(n.PureComponent);w.ErrorBoundary=N;let k=w},88785:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>f});var n=o(65321),r=o(97109),a=o(3454),i=o.n(a),l=o(86109),s=o(17807),c=o(6578),d=o(39507),u=o(8665),p=o(57481),m=o(28629),v=o(34038),g=o(52057);function f(){var e,t,o;let a=(0,g.s_)(),f=(0,l.useRouter)(),h=(0,d.Vr)(),{message:b}=s.A.useApp(),[y,$]=(0,r.useState)([]),[S,w]=(0,r.useState)([]),[x,E]=(0,r.useState)(""),[C,j]=(0,r.useState)(""),[A,I]=(0,r.useState)([]),[N,k]=(0,r.useState)(""),[P,R]=(0,r.useState)(!1),[z,M]=(0,r.useState)(null),[_,O]=(0,r.useState)(!0);(0,r.useEffect)(()=>{(async()=>{try{let[e,t]=await Promise.all([(0,c.ef)(),(0,c.dx)()]);w(e.groups),E(e.projectRoot),$(t)}catch(e){b.error(e instanceof Error?e.message:"读取项目资料/提示词失败")}})()},[b]);let D=(0,r.useMemo)(()=>S.map(e=>({value:e.root,label:"".concat(e.root,"(").concat(e.fileCount," 份").concat(e.mixedProjectNos?" \xb7 含多个项目编号,需先拆分":"",")")})),[S]),H=(0,r.useMemo)(()=>y.filter(e=>"custom"===e.source).map(e=>({value:e.id,label:e.projectName})),[y,x]),q=(0,r.useMemo)(()=>H.filter(e=>A.includes(e.value)),[H,A]),B=null!=(e=D.find(e=>e.value===C))?e:null,T=(0,r.useCallback)(e=>{j(e)},[]),L=(0,r.useCallback)(async()=>{if(0!==q.length&&B){R(!0);try{let e=await (0,c.OX)({promptIds:A,requirement:N,materialRoot:C,...C?{projectName:C}:{},projectRoot:x});if(!e.documentId)throw Error("服务端未返回 documentId");await f.push("/canvas/".concat(encodeURIComponent(e.documentId),"?projectRoot=").concat(encodeURIComponent(x)))}catch(e){b.error(e instanceof Error?e.message:"创建生成任务失败")}finally{R(!1)}}},[q,B,A,N,x,f,b]),V=(0,r.useCallback)(async()=>{if(0!==q.length&&B)try{let e=await (0,c.dk)({promptIds:A,requirement:N,materialRoot:C,...C?{projectName:C}:{},projectRoot:x});M({title:e.title,chapters:e.chapters,outlineSource:e.derivation.outlineSource,materialScope:e.materialScope})}catch(e){b.error(e instanceof Error?e.message:"结构预览失败")}},[q,B,A,N,x,b]);return(0,n.jsxs)("div",{className:"canvasRoot",children:[(0,n.jsx)(i(),{children:(0,n.jsx)("title",{children:h("nav.canvas")})}),(0,n.jsx)("div",{ref:a.containerRef,className:"canvasStage",style:{backgroundImage:"radial-gradient(var(--canvasGridDot) 1px, transparent 1px)",backgroundSize:"".concat(g.VF*a.view.k,"px ").concat(g.VF*a.view.k,"px"),backgroundPosition:"".concat(a.view.x,"px ").concat(a.view.y,"px"),cursor:"grab"},onPointerDown:a.onPointerDown,onPointerMove:a.onPointerMove,onPointerUp:a.endDrag,onPointerLeave:a.endDrag,children:(0,n.jsx)("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",pointerEvents:"none"},children:(0,n.jsxs)("div",{style:{textAlign:"center",maxWidth:420},children:[(0,n.jsx)("div",{style:{fontSize:15,marginBottom:6},children:"新画布"}),(0,n.jsxs)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)",lineHeight:1.7},children:["还没有节点日志——节点日志是唯一真相源,这里不造占位节点。",(0,n.jsx)("br",{}),"点屏幕底部中央那个 ",(0,n.jsx)("b",{children:"^"})," 展开输入框:用里面的「+」选择提示词与项目, 写下要求后点「生成」,节点会随日志追加而出现。"]})]})})}),(0,n.jsx)(p._,{...x?{projectRoot:x}:{},onSelect:e=>{f.push((0,m.p)(e.id,e.projectRoot||x))},onCurrentDeleted:()=>void 0}),(0,n.jsx)(u._,{value:N,onChange:k,onSend:()=>{L()},generating:!1,submitting:P,disabled:!1,requireGenerationSetup:!0,promptOptions:H,projectOptions:D,selectedPrompts:q,selectedProject:B,onSelectPrompts:I,onSelectProject:T,selectedNode:null,onMentionSelected:()=>void 0,resumable:!1,onContinue:()=>void 0,onPreviewStructure:()=>{V()},collapsed:_,onToggleCollapsed:O}),(0,n.jsx)(v.B,{open:!!z,title:null!=(t=null==z?void 0:z.title)?t:"",chapters:null!=(o=null==z?void 0:z.chapters)?o:[],...(null==z?void 0:z.outlineSource)?{outlineSource:z.outlineSource}:{},...(null==z?void 0:z.materialScope)?{materialScope:z.materialScope}:{},onClose:()=>M(null)})]})}},89857:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"}}},e=>{e.O(0,[6409,1210,1702,5544,9551,8399,7576,1499,5061,3456,4530,636,6593,8792],()=>e(e.s=48161)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4298],{16403:(e,o,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/documents",function(){return t(19562)}])},19562:(e,o,t)=>{"use strict";t.r(o),t.d(o,{default:()=>u});var n=t(97109),c=t(86109);function u(){let e=(0,c.useRouter)(),o="string"==typeof e.query.id?e.query.id:"",t="string"==typeof e.query.projectRoot?e.query.projectRoot:"";return(0,n.useEffect)(()=>{e.isReady&&e.replace(o?"/canvas/".concat(encodeURIComponent(o)).concat(t?"?projectRoot=".concat(encodeURIComponent(t)):""):"/canvas")},[o,t,e,e.isReady]),null}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=16403)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6920],{2548:(e,s,l)=>{"use strict";l.r(s),l.d(s,{default:()=>E});var r=l(65321),t=l(97109),c=l(43220),a=l.n(c),o=l(48399),n=l(11702),i=l(55122),d=l(80300),x=l(68787),m=l(15622),h=l(26619),u=l(71330),v=l(64068),j=l(84742),p=l(4527),g=l(95118),f=l(33555),N=l(64629),b=l(6578),w=l(85310),y=l(93360);let{Paragraph:k,Text:C}=o.A,T=[{icon:(0,r.jsx)(h.A,{}),title:"整理项目资料包",goal:"把同一项目的招标正文、清单、图纸、补疑等资料放进同一个项目文件夹,然后在知识库页上传;解析、切片、入库都在后台跑。",checks:["资料已上传","索引完成","可选择项目文件夹"],href:"/knowledge"},{icon:(0,r.jsx)(u.A,{}),title:"准备提示词",goal:'在提示词页维护"这一篇按什么口径、什么章节结构写"的提示词(章节大纲写在 <OUTLINE> 块里)。',checks:["提示词已保存","提示词里有 <OUTLINE> 大纲"],href:"/prompt"},{icon:(0,r.jsx)(v.A,{}),title:"在画布发起生成",goal:"进入画布,用输入框左侧的「+」选中提示词与项目,写下要求后点「生成」;节点随日志追加出现。",checks:["提示词与项目已选中","生成任务已启动","证据来源可追溯"],href:"/canvas"},{icon:(0,r.jsx)(j.A,{}),title:"审查与导出",goal:"先回画布看这次生成跑到哪、证据来自哪、有没有阻断项——导出门禁也在那里判定。确认无误后到生成记录里打开文档,做人工编辑并导出。",checks:["无阻断问题","正文无后台话术","导出结果可打开"],href:"/canvas",secondary:{href:"/documents",label:"去生成记录导出"}}],A=[{title:"招标文件正文",desc:"确定项目边界、响应要求、工期质量安全目标和评审关注点。",color:"blue"},{title:"工程量清单",desc:"确定主要工程内容、分部分项、项目特征、工程量和资源配置依据。",color:"green"},{title:"图纸/设计资料",desc:"确定施工对象、空间关系、构造做法、专业接口和重点难点。",color:"purple"},{title:"补疑/澄清/答疑",desc:"修正招标正文、清单或图纸口径;与原文件冲突时优先采用。",color:"orange"}],S=[{icon:(0,r.jsx)(p.A,{}),title:"自动资料识别",desc:"根据文件名、目录和内容线索识别资料类型。"},{icon:(0,r.jsx)(g.A,{}),title:"项目理解",desc:"建立项目资料包视角,提炼工程范围、招标要求、清单内容、图纸对象和补疑修正项。"},{icon:(0,r.jsx)(f.A,{}),title:"章节证据计划",desc:"不同章节按不同资料组合召回,减少泛化套话和无来源事实。"}];function _(e){let{n:s}=e;return(0,r.jsx)("span",{className:"w-6 h-6 shrink-0 rounded-full bg-[var(--colorBrand)]/10 text-[var(--colorBrand)] text-xs font-bold flex items-center justify-center",children:s})}function E(){let[e,s]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let e=!1;return(async()=>{try{var l,r,t;let c=await (0,b.dx)(),a=(null==(l=c.find(e=>e.selected))?void 0:l.projectRoot)||(null==(r=c.find(e=>e.isCurrent))?void 0:r.projectRoot)||(null==(t=c[0])?void 0:t.projectRoot)||"",[o,n]=await Promise.all([(0,b.cQ)(a||void 0),(0,b.hc)(a||void 0)]);if(e)return;s({kbFileCount:n.fileCount,promptCount:c.filter(e=>e.projectRoot===a&&!1!==e.hasFile).length,recordCount:o.documents.length,completedRecordCount:o.documents.filter(e=>"completed"===e.status||"completed_with_issues"===e.status||"warning"===e.status).length,exportCount:o.documents.reduce((e,s)=>{var l;return e+((null==(l=s.exportReports)?void 0:l.length)||0)},0)})}catch(e){}})(),()=>{e=!0}},[]),(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(y.z,{title:"使用指南",description:"生成只需要两样人工输入:提示词(这一篇按什么结构、什么口径写)与项目(资料范围来自项目自己的知识库)。系统自动识别招标正文、工程量清单、图纸、补疑、技术规范等资料类型,并基于项目理解生成专业文档。",extra:(0,r.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,r.jsx)(n.A,{color:"blue",bordered:!1,className:"m-0 px-3 py-1",children:"项目资料包"}),(0,r.jsx)(n.A,{color:"green",bordered:!1,className:"m-0 px-3 py-1",children:"自动识别"}),(0,r.jsx)(n.A,{color:"purple",bordered:!1,className:"m-0 px-3 py-1",children:"项目理解"})]})}),(0,r.jsx)(w.Zk,{title:"推荐操作流程",description:"从资料入库到文档导出,按以下四步完成。每步右下角显示当前项目的完成度。",children:(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4",children:T.map((s,l)=>{let t;return(0,r.jsxs)("div",{className:"flex flex-col h-full p-4 ".concat(w.wD),children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 shrink-0 rounded-xl bg-[var(--colorFillSecondary)] text-[var(--colorPrimary)] flex items-center justify-center text-lg",children:s.icon}),(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(_,{n:l+1}),(0,r.jsx)("div",{className:"font-semibold text-[var(--colorText)] truncate",children:s.title})]})]}),(0,r.jsx)(k,{className:"text-sm text-[var(--colorTextSecondary)] min-h-[66px] !mb-4",children:s.goal}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.checks.map(e=>(0,r.jsx)(n.A,{className:"m-0",children:e},e))}),(0,r.jsx)(i.A,{className:"!my-3"}),(0,r.jsxs)("div",{className:"mt-auto flex flex-col gap-2",children:[(t=(s=>{if(!e)return{text:"加载中…",level:"todo"};switch(s){case 0:return e.kbFileCount>0?{text:"已入库 ".concat(e.kbFileCount," 份资料文件"),level:"done"}:{text:"尚未上传项目资料",level:"progress"};case 1:return e.promptCount>0?{text:"".concat(e.promptCount," 份提示词可用"),level:"done"}:{text:"尚未准备提示词",level:"todo"};case 2:return e.recordCount>0?{text:"已生成 ".concat(e.completedRecordCount,"/").concat(e.recordCount," 条有效记录"),level:"done"}:{text:"尚无生成记录",level:"todo"};case 3:return e.exportCount>0?{text:"已导出 ".concat(e.exportCount," 次,报告已归档"),level:"done"}:e.completedRecordCount>0?{text:"有生成记录待导出",level:"progress"}:{text:"等待生成记录后导出",level:"todo"};default:return{text:"",level:"todo"}}})(l),(0,r.jsx)(n.A,{color:"done"===t.level?"success":"progress"===t.level?"processing":"default",icon:null===e?(0,r.jsx)(N.A,{spin:!0}):void 0,className:"border-0 m-0",children:t.text})),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsx)(a(),{className:"text-xs font-medium text-[var(--colorPrimary)] hover:underline",href:s.href,children:"去完成 ›"}),s.secondary&&(0,r.jsxs)(a(),{className:"text-xs text-[var(--colorTextSecondary)] hover:text-[var(--colorText)] hover:underline",href:s.secondary.href,children:[s.secondary.label," ›"]})]})]})]},s.title)})})}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-6",children:[(0,r.jsx)("div",{className:"lg:col-span-2",children:(0,r.jsx)(w.Zk,{title:"项目资料包如何组织",children:(0,r.jsx)(d.A,{className:"mt-1",items:[{color:"blue",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(C,{strong:!0,children:"一个项目一个文件夹"}),(0,r.jsx)(k,{className:"!mb-0 text-sm text-[var(--colorTextSecondary)]",children:"例如“徽光阁项目/”,在画布上选中它即可。"})]})},{color:"green",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(C,{strong:!0,children:"资料集中放置"}),(0,r.jsx)(k,{className:"!mb-0 text-sm text-[var(--colorTextSecondary)]",children:"招标正文、清单、图纸、补疑、技术规范等资料放在同一个资料包下。"})]})},{color:"purple",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(C,{strong:!0,children:"系统自动理解"}),(0,r.jsx)(k,{className:"!mb-0 text-sm text-[var(--colorTextSecondary)]",children:"生成前构建项目资料画像和项目理解模型。"})]})}]})})}),(0,r.jsx)("div",{className:"lg:col-span-3",children:(0,r.jsx)(w.Zk,{title:"关键资料职责",children:(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:A.map(e=>(0,r.jsxs)("div",{className:"p-4 ".concat(w.wD),children:[(0,r.jsx)(n.A,{color:e.color,bordered:!1,className:"m-0 mb-2",children:e.title}),(0,r.jsx)(k,{className:"!mb-0 text-sm text-[var(--colorTextSecondary)]",children:e.desc})]},e.title))})})})]}),(0,r.jsx)(w.Zk,{title:"生成链路说明",description:"这三件事在后台把「资料」变成「可写的证据」,是文档不写空话的来源。",children:(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:S.map((e,s)=>(0,r.jsxs)("div",{className:"p-4 ".concat(w.wD),children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,r.jsx)("div",{className:"w-9 h-9 shrink-0 rounded-xl bg-[var(--colorFillSecondary)] text-[var(--colorPrimary)] flex items-center justify-center",children:e.icon}),(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(_,{n:s+1}),(0,r.jsx)(C,{strong:!0,className:"truncate",children:e.title})]})]}),(0,r.jsx)(k,{className:"!mb-0 text-sm text-[var(--colorTextSecondary)]",children:e.desc})]},e.title))})}),(0,r.jsx)(x.A,{className:"rounded-2xl border border-[var(--borderColor)]",styles:{body:{padding:0}},children:(0,r.jsx)(m.A,{ghost:!0,items:[{key:"binding",label:"生成需要准备什么?",children:(0,r.jsxs)(k,{className:"!mb-0",children:["两样:一份带 ",(0,r.jsx)(C,{code:!0,children:"<OUTLINE>"})," 章节大纲的提示词,和一个项目。资料职责由系统自动识别,选中的项目自己的知识库就是本次的资料范围。"]})},{key:"addendum",label:"补疑/澄清如何处理?",children:(0,r.jsx)(k,{className:"!mb-0",children:"补疑、澄清、答疑属于高优先级资料。如与招标正文、清单或图纸存在冲突,生成时优先采用补疑/澄清口径。"})},{key:"quality",label:"专业性如何保证?",children:(0,r.jsx)(k,{className:"!mb-0",children:"生成链路会结合项目理解、章节证据计划、结构化事实、质量审查和导出门禁,减少泛化套话和无来源事实。"})},{key:"review",label:"生成完在哪里看结果、在哪里导出?",children:(0,r.jsxs)(k,{className:"!mb-0",children:["分两处:",(0,r.jsx)(C,{strong:!0,children:"审查在画布"}),"——节点日志、证据来源、阻断项与导出门禁结论都在那里;",(0,r.jsx)(C,{strong:!0,children:"编辑与导出在生成记录"}),"——打开某条记录即可人工修改正文并导出 MD/HTML/DOCX/PDF。"]})}]})})]})}},34899:(e,s,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/guide",function(){return l(2548)}])},85310:(e,s,l)=>{"use strict";l.d(s,{Zk:()=>c,dh:()=>a,wD:()=>t});var r=l(65321);l(97109);let t="rounded-xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)] hover:shadow-[var(--shadowSurfaceHover)] transition-shadow";function c(e){let{title:s,count:l,description:t,extra:c,className:a,children:o}=e;return(0,r.jsxs)("section",{className:"rounded-2xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)] p-6 animateFadeIn ".concat(null!=a?a:""),children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-3 mb-5",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("h2",{className:"text-base font-semibold text-[var(--colorText)] tracking-wide flex items-center gap-2 m-0",children:[s,void 0!==l&&(0,r.jsx)("span",{className:"text-[var(--colorTextTertiary)] font-normal text-sm",children:l})]}),t&&(0,r.jsx)("p",{className:"text-xs text-[var(--colorTextTertiary)] mt-1.5 mb-0 leading-relaxed max-w-3xl",children:t})]}),c]}),o]})}function a(e){let{children:s}=e;return(0,r.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wider mb-2 text-[var(--colorTextTertiary)]",children:s})}},93360:(e,s,l)=>{"use strict";l.d(s,{z:()=>c});var r=l(65321);l(97109);var t=l(33442);function c(e){let{title:s,description:l,extra:c,bottomContent:a}=e;return(0,r.jsxs)("div",{className:"animateFadeIn",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 border-b border-[var(--borderColor)]",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2",children:s}),l&&(0,r.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:l})]}),c&&(0,r.jsx)(t.A,{className:"w-full sm:w-auto overflow-x-auto pb-1 sm:pb-0 shrink-0",size:"middle",wrap:!1,children:c})]}),a&&(0,r.jsx)("div",{className:"mt-6",children:a})]})}}},e=>{e.O(0,[6409,1210,1702,4665,8399,8569,8787,5760,636,6593,8792],()=>e(e.s=34899)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3332],{15766:(_,u,e)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return e(76933)}])},76933:(_,u,e)=>{"use strict";e.r(u),e.d(u,{default:()=>n.default});var n=e(27795)}},_=>{_.O(0,[6409,1210,1702,8399,9605,8564,7795,636,6593,8792],()=>_(_.s=15766)),_N_E=_.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5232],{12446:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"}},13018:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"}},25258:(e,t,s)=>{"use strict";s.d(t,{A:()=>f});var r=s(51541),a=s(61848),l=s(5669),n=s(97109),o=s(72658),c=s(3638),i=s(92162),d=s(82725),x=s(74567),u=s(632),m=s(49517),j=s(79412),g=s(19527);let h=(0,d.U)(e=>{let{prefixCls:t,className:s,closeIcon:r,closable:a,type:l,title:d,children:h,footer:b,classNames:p,styles:v,...f}=e,{getPrefixCls:w}=n.useContext(x.QO),{className:y,style:N,classNames:A,styles:T}=(0,x.TP)("modal"),S=w(),C=t||w("modal"),k=(0,u.A)(S),[L,z]=(0,g.Ay)(C,k),[P,O]=(0,i.AV)([A,p],[T,v],{props:e}),_=`${C}-confirm`,E={};return E=l?{closable:a??!1,title:"",footer:"",children:n.createElement(m.k,{...e,prefixCls:C,confirmPrefixCls:_,rootPrefixCls:S,content:h})}:{closable:a??!0,title:d,footer:null!==b&&n.createElement(j.w,{...e}),children:h},n.createElement(o.Z,{prefixCls:C,className:(0,c.$)(L,`${C}-pure-panel`,l&&_,l&&`${_}-${l}`,s,y,z,k,P.root),style:{...N,...O.root},...f,closeIcon:(0,j.O)(C,r),closable:a,classNames:P,styles:O,...E})});var b=s(99739);function p(e){return(0,r.Ay)((0,r.fp)(e))}let v=l.A;v.useModal=b.A,v.info=function(e){return(0,r.Ay)((0,r.$D)(e))},v.success=function(e){return(0,r.Ay)((0,r.Ej)(e))},v.error=function(e){return(0,r.Ay)((0,r.jT)(e))},v.warning=p,v.warn=p,v.confirm=function(e){return(0,r.Ay)((0,r.lr)(e))},v.destroyAll=function(){for(;a.A.length;){let e=a.A.pop();e&&e()}},v.config=r.FB,v._InternalPanelDoNotUseOrYouWillBeFired=h;let f=v},38762:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var r=s(97109),a=s(13018),l=s(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e}).apply(this,arguments)}let o=r.forwardRef((e,t)=>r.createElement(l.A,n({},e,{ref:t,icon:a.A})))},46196:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>B});var r=s(65321),a=s(97109),l=s(17807),n=s(25258),o=s(84253),c=s(85114),i=s(49292),d=s(14932),x=s(7576),u=s(88762),m=s(58209),j=s(53998),g=s(30486),h=s(39507),b=s(93360),p=s(82238),v=s(64629),f=s(84742),w=s(58740),y=s(38762),N=s(11702),A=s(99605),T=s(32965),S=s(38964),C=s(48399),k=s(58690);let L={processing:"jobs.statusProcessing",success:"jobs.statusSuccess",warning:"jobs.statusWarning",error:"jobs.statusError"},z={document:"jobs.typeDocument",upload:"jobs.typeUpload",reindex:"jobs.typeReindex",delete:"jobs.typeDelete"},P={uploading:"jobs.stageUploading",parsing:"jobs.stageParsing",chunking:"jobs.stageChunking",vectorizing:"jobs.stageVectorizing",generating:"jobs.stageGenerating",validating:"jobs.stageValidating",done:"jobs.stageDone",error:"jobs.stageError"};function O(e,t){return t?new Date(e).toLocaleString():String(e)}function _(e){let{rows:t,mounted:s,onRemove:a,empty:l}=e,n=(0,h.Vr)(),o=[{title:n("jobs.colStatus"),dataIndex:"status",width:108,render:(e,t)=>{var s,a;return(0,r.jsx)(N.A,{color:"processing"===(s=t.status)?"processing":"success"===s?"success":"warning"===s?"warning":"error",icon:"processing"===(a=t.status)?(0,r.jsx)(v.A,{spin:!0}):"success"===a?(0,r.jsx)(f.A,{}):"warning"===a?(0,r.jsx)(w.A,{}):(0,r.jsx)(y.A,{}),className:"m-0",children:n(L[t.status])})}},{title:n("jobs.colTask"),dataIndex:"title",render:(e,t)=>{let s=t.error||t.message;return(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,r.jsx)("span",{className:"jobsCellLine font-medium text-[var(--colorText)]",title:t.title,children:t.title}),t.id.startsWith("intelligence-mixed-")?(0,r.jsx)(d.A,{title:n("jobs.residentHint"),children:(0,r.jsx)(N.A,{color:"purple",className:"m-0 shrink-0",children:n("jobs.resident")})}):null]}),s?(0,r.jsx)("div",{className:"jobsCellLine mt-1 text-xs ".concat(t.error?"text-[var(--colorDanger)]":"text-[var(--colorTextTertiary)]"),title:s,children:s}):null]})}},{title:n("jobs.typeLabel"),dataIndex:"type",width:104,render:(e,t)=>(0,r.jsx)("span",{className:"text-[var(--colorTextSecondary)]",children:n(z[t.type])})},{title:n("jobs.stageLabel"),dataIndex:"stage",width:116,render:(e,t)=>(0,r.jsx)("span",{className:"jobsCellLine block font-mono text-xs text-[var(--colorTextSecondary)]",title:t.stage,children:P[t.stage]?n(P[t.stage]):t.stage})},{title:n("jobs.colProgress"),dataIndex:"percent",width:168,render:(e,t)=>{let s=Math.max(0,Math.min(100,Math.round(t.percent||0))),a="error"===t.status?"exception":"success"===t.status?"success":"processing"===t.status?"active":"normal";return(0,r.jsx)(A.A,{percent:s,status:a,size:"small"})}},{title:n("jobs.updatedAtLabel"),dataIndex:"updatedAt",width:176,render:e=>(0,r.jsx)("span",{className:"font-mono text-xs text-[var(--colorTextSecondary)]",children:O(e,s)})},{title:n("jobs.colActions"),key:"actions",width:72,align:"right",render:(e,t)=>"processing"===t.status?null:(0,r.jsx)(T.A,{title:n("jobs.removeConfirm"),onConfirm:()=>a(t),okText:n("common.confirm"),cancelText:n("common.cancel"),children:(0,r.jsx)(c.Ay,{size:"small",type:"text",danger:!0,icon:(0,r.jsx)(m.A,{}),title:n("jobs.remove")})})}];return(0,r.jsx)(S.A,{rowKey:"id",dataSource:t,columns:o,size:"middle",className:"flex-1 border-0 modern-table tableFillHeight",tableLayout:"fixed",locale:{emptyText:l},pagination:(0,k.B)(n),expandable:{expandedRowRender:e=>(0,r.jsx)(M,{job:e,mounted:s})}})}function E(e){let{label:t,value:s,className:a}=e;return(0,r.jsxs)("div",{className:"flex gap-3 ".concat(null!=a?a:""),children:[(0,r.jsx)("span",{className:"w-20 shrink-0 text-[var(--colorTextTertiary)]",children:t}),(0,r.jsx)("span",{className:"min-w-0 break-words text-[var(--colorTextSecondary)]",children:s})]})}function M(e){var t;let{job:s,mounted:a}=e,l=(0,h.Vr)(),n=null!=(t=s.details)?t:[],o=n.slice(0,200),c=n.length-o.length;return(0,r.jsxs)("div",{className:"flex flex-col gap-3 px-4 py-3 text-xs",children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-x-8 gap-y-2 sm:grid-cols-2 xl:grid-cols-3",children:[(0,r.jsx)(E,{label:l("jobs.createdAtLabel"),value:O(s.createdAt,a)}),s.chunkCount?(0,r.jsx)(E,{label:l("jobs.chunksLabel"),value:s.chunkCount}):null,(0,r.jsx)(E,{label:l("jobs.idLabel"),value:(0,r.jsx)(C.A.Text,{copyable:!0,className:"font-mono text-xs",children:s.id})}),s.filePath?(0,r.jsx)(E,{className:"sm:col-span-2 xl:col-span-3",label:l("jobs.fileLabel"),value:(0,r.jsx)("span",{className:"break-all font-mono",children:s.filePath})}):null]}),s.error?(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-1 text-[var(--colorTextTertiary)]",children:l("jobs.errorLabel")}),(0,r.jsx)("div",{className:"max-h-40 overflow-auto whitespace-pre-wrap break-words text-[var(--colorDanger)]",children:s.error})]}):null,s.message&&s.message!==s.error?(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-1 text-[var(--colorTextTertiary)]",children:l("jobs.messageLabel")}),(0,r.jsx)("div",{className:"max-h-40 overflow-auto whitespace-pre-wrap break-words font-mono text-[var(--colorTextSecondary)]",children:s.message})]}):null,n.length>0?(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-1 text-[var(--colorTextTertiary)]",children:l("jobs.diagnostics")}),(0,r.jsx)("ul",{className:"m-0 max-h-80 overflow-auto rounded-lg border border-[var(--borderColor)] bg-[var(--colorFillAlter)] py-2 pl-6 leading-5 text-[var(--colorTextSecondary)]",children:o.map((e,t)=>(0,r.jsx)("li",{className:"break-words",children:e},"".concat(s.id,"-").concat(t)))}),c>0?(0,r.jsx)("div",{className:"mt-1 text-[var(--colorTextTertiary)]",children:l("jobs.detailsMore").replace("{count}",String(c))}):null]}):null]})}var D=s(73662),F=s(6578);function B(){let e=(0,h.Vr)(),{message:t}=l.A.useApp(),{jobs:s,loaded:v,loadFailed:f,mounted:w,truncated:y,reload:N}=(0,D.M4)(),[A,T]=(0,a.useState)("all"),[S,C]=(0,a.useState)(""),[k,L]=(0,a.useState)(!1),z=async s=>{try{await (0,F.CU)(s),t.success(e("jobs.removed")),await N()}catch(s){t.error(e("jobs.removeFailed"))}},P=(0,a.useMemo)(()=>({all:s.length,processing:s.filter(e=>"processing"===e.status).length,warning:s.filter(e=>"warning"===e.status).length,error:s.filter(e=>"error"===e.status).length}),[s]),O=(0,a.useMemo)(()=>{let e=S.trim().toLowerCase();return s.filter(t=>{var s;return("all"===A||t.status===A)&&(!e||[t.title,t.stage,t.message,t.error,t.fileName,t.filePath,t.id,...null!=(s=t.details)?s:[]].filter(Boolean).some(t=>String(t).toLowerCase().includes(e)))})},[s,A,S]),E="all"!==A||S.trim().length>0,M=f?(0,r.jsx)("span",{className:"text-sm text-[var(--colorTextTertiary)]",children:"—"}):0===s.length?(0,r.jsx)(o.A,{className:"py-12",description:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"text-[var(--colorTextSecondary)]",children:e("jobs.empty")}),(0,r.jsx)("div",{className:"mt-1 text-xs text-[var(--colorTextTertiary)]",children:e("jobs.emptyHint")})]})}):(0,r.jsx)(o.A,{className:"py-12",description:e("jobs.noMatch")});return(0,r.jsxs)("div",{className:"h-[calc(100vh_-_140px)] flex flex-col animateFadeIn",children:[(0,r.jsx)(b.z,{title:e("jobs.title"),description:e("jobs.pageSubtitle"),extra:(0,r.jsx)(c.Ay,{danger:!0,icon:(0,r.jsx)(m.A,{}),disabled:0===s.length,loading:k,onClick:()=>{n.A.confirm({title:e("jobs.clearConfirmTitle"),content:(0,r.jsxs)("div",{className:"text-sm",children:[(0,r.jsx)("div",{children:e("jobs.clearConfirmContent")}),(0,r.jsx)("div",{className:"mt-1 text-[var(--colorTextSecondary)]",children:e("jobs.clearConfirmWarning")})]}),okText:e("jobs.clearAll"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{L(!0);try{await (0,F.H7)(),t.success(e("jobs.cleared")),await N()}catch(s){t.error(e("jobs.clearFailed"))}finally{L(!1)}}})},children:e("jobs.clearAll")})}),(0,r.jsxs)("div",{className:"mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)]",children:[f&&(0,r.jsx)("div",{className:"shrink-0 p-4 pb-0",children:(0,r.jsx)(p.X,{failures:["后台任务列表"],note:s.length>0?"下方列表仍是上次成功读取的内容,可能已过期。":void 0})}),(0,r.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-x-3 gap-y-2 border-b border-[var(--borderColor)] bg-[var(--colorBgHover)] p-4",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[(0,r.jsx)(i.A,{value:A,onChange:e=>T(e),options:[{label:"".concat(e("jobs.filterAll")," ").concat(P.all),value:"all"},{label:"".concat(e("jobs.statusProcessing")," ").concat(P.processing),value:"processing"},{label:"".concat(e("jobs.statusWarning")," ").concat(P.warning),value:"warning"},{label:"".concat(e("jobs.statusError")," ").concat(P.error),value:"error"}]}),E&&(0,r.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:e("jobs.filteredRecords").replace("{count}",String(O.length))}),y&&(0,r.jsx)(d.A,{title:e("jobs.limitHint").replace("{count}",String(D.FX)),children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-[var(--colorTextTertiary)]",children:[(0,r.jsx)(j.A,{})," ",e("jobs.limitNotice").replace("{count}",String(D.FX))]})})]}),(0,r.jsx)("div",{className:"w-full shrink-0 lg:w-80",children:(0,r.jsx)(x.A,{allowClear:!0,prefix:(0,r.jsx)(g.A,{}),value:S,onChange:e=>C(e.target.value),placeholder:e("jobs.searchPlaceholder"),className:"w-full"})})]}),v||f?(0,r.jsx)(_,{rows:O,mounted:w,onRemove:e=>{z(e.id)},empty:M}):(0,r.jsx)("div",{className:"p-6",children:(0,r.jsx)(u.A,{active:!0,paragraph:{rows:6}})})]})]})}},47457:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/jobs",function(){return s(46196)}])},53998:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var r=s(97109),a=s(12446),l=s(88483);function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e}).apply(this,arguments)}let o=r.forwardRef((e,t)=>r.createElement(l.A,n({},e,{ref:t,icon:a.A})))},58690:(e,t,s)=>{"use strict";function r(e){var t,s,r;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{defaultPageSize:null!=(t=a.pageSize)?t:10,pageSizeOptions:null!=(s=a.pageSizeOptions)?s:[10,20,50,100],showSizeChanger:!0,showTotal:t=>{var s,r;return e(null!=(s=a.totalLabelKey)?s:"common.totalRows",null!=(r=a.totalLabelFallback)?r:"共 {count} 条").replace("{count}",String(t))},hideOnSinglePage:null!=(r=a.hideOnSinglePage)&&r,showQuickJumper:!1}}s.d(t,{B:()=>r})},82238:(e,t,s)=>{"use strict";s.d(t,{X:()=>a});var r=s(65321);function a(e){let{failures:t,note:s}=e;return 0===t.length?null:(0,r.jsxs)("div",{role:"alert",className:"rounded-xl border border-[var(--colorDanger)]/30 bg-[var(--colorDanger)]/10 px-4 py-3 text-sm text-[var(--colorDanger)]",children:["".concat(t.length," 项数据读取失败:").concat(t.join("、"),"——相关读数显示为「—」(未知),**不代表 0**;请稍后重试或查看服务端日志。"),s?(0,r.jsx)("div",{className:"mt-1 text-xs opacity-90",children:s}):null]})}},93360:(e,t,s)=>{"use strict";s.d(t,{z:()=>l});var r=s(65321);s(97109);var a=s(33442);function l(e){let{title:t,description:s,extra:l,bottomContent:n}=e;return(0,r.jsxs)("div",{className:"animateFadeIn",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 pb-6 border-b border-[var(--borderColor)]",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h1",{className:"text-3xl font-extrabold tracking-tight text-[var(--colorText)] mb-2",children:t}),s&&(0,r.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:s})]}),l&&(0,r.jsx)(a.A,{className:"w-full sm:w-auto overflow-x-auto pb-1 sm:pb-0 shrink-0",size:"middle",wrap:!1,children:l})]}),n&&(0,r.jsx)("div",{className:"mt-6",children:n})]})}}},e=>{e.O(0,[6409,1210,1702,5544,9551,4665,8399,7576,1499,8338,5061,8964,9605,7217,636,6593,8792],()=>e(e.s=47457)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3309],{9137:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>A});var n=l(9750),r=l(97109),a=l(42644),s=l(10252),o=l(74567),i=l(48921),c=l(98379),d=l(3638),u=l(632),m=l(34475),h=l(52093),x=l(60815),g=l(5741);let p=null,f=e=>e(),w=[],_={};function y(){let{getContainer:e,duration:t,rtl:l,maxCount:n,top:r,stack:a}=_,s=e?.()||document.body;return{getContainer:()=>s,duration:t,rtl:l,maxCount:n,top:r,stack:a}}let k=r.forwardRef((e,t)=>{let{messageConfig:l,sync:n}=e,{getPrefixCls:a}=(0,r.useContext)(o.QO),i=_.prefixCls||a("message"),c=(0,r.useContext)(s.B),[d,u]=(0,x.y)({...l,prefixCls:i,...c.message});return r.useImperativeHandle(t,()=>{let e={...d};return Object.keys(e).forEach(t=>{e[t]=(...e)=>(n(),d[t].apply(d,e))}),{instance:e,sync:n}}),u}),b=r.forwardRef((e,t)=>{let[l,n]=r.useState(y),a=()=>{n(y)};r.useEffect(a,[]);let s=(0,i.cr)(),o=s.getRootPrefixCls(),c=s.getIconPrefixCls(),d=s.getTheme(),u=r.createElement(k,{ref:t,sync:a,messageConfig:l});return r.createElement(i.Ay,{prefixCls:o,iconPrefixCls:c,theme:d},s.holderRender?s.holderRender(u):u)}),j=()=>{if(!p){let e=document.createDocumentFragment(),t={fragment:e};p=t,f(()=>{(0,a.XX)(r.createElement(b,{ref:e=>{let{instance:l,sync:n}=e||{};Promise.resolve().then(()=>{!t.instance&&l&&(t.instance=l,t.sync=n,j())})}}),e)});return}p.instance&&(w.forEach(e=>{let{type:t,skipped:l}=e;if(!l)switch(t){case"open":f(()=>{let t=p.instance.open({..._,...e.config});t?.then(e.resolve),e.setCloseFn(t)});break;case"destroy":f(()=>{p?.instance.destroy(e.key)});break;default:f(()=>{var l;let r=(l=p.instance)[t].apply(l,(0,n.A)(e.args));r?.then(e.resolve),e.setCloseFn(r)})}}),w=[])},v={open:function(e){let t=(0,g.E)(t=>{let l,n={type:"open",config:e,resolve:t,setCloseFn:e=>{l=e}};return w.push(n),()=>{l?f(()=>{l()}):n.skipped=!0}});return j(),t},destroy:e=>{w.push({type:"destroy",key:e}),j()},config:function(e){_={..._,...e},f(()=>{p?.sync?.()})},useMessage:x.A,_InternalPanelDoNotUseOrYouWillBeFired:m.Ay,_InternalListDoNotUseOrYouWillBeFired:e=>{let{items:t,classNames:l,style:n}=e,{getPrefixCls:a}=(0,o.TP)("message"),s=a("message"),i=(0,u.A)(s),[x,g]=(0,h.A)(s,i),p=`${s}-notice`,f=t.map(e=>{let{content:t,duration:l,key:n,type:r}=e,a=r?`${p}-icon-${r}`:void 0;return{key:n,duration:l,icon:(0,m.HC)(r),title:t,className:`${p}-${r}`,classNames:{wrapper:`${s}-${r}`,icon:a}}});return r.createElement(c.qb,{prefixCls:s,placement:"top",configList:f,className:(0,d.$)(x,g,i),classNames:{...l,wrapper:l?.wrapper,title:l?.title},style:n,stack:!1})}};["success","info","warning","error","loading"].forEach(e=>{v[e]=(...t)=>(function(e,t){(0,i.cr)();let l=(0,g.E)(l=>{let n,r={type:e,args:t,resolve:l,setCloseFn:e=>{n=e}};return w.push(r),()=>{n?f(()=>{n()}):r.skipped=!0}});return j(),l})(e,t)});let A=v},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"}},37690:(e,t,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/file-detail",function(){return l(48200)}])},45551:(e,t,l)=>{"use strict";l.d(t,{Jm:()=>i,fw:()=>a,je:()=>n.j,mc:()=>c,z3:()=>r});var n=l(96538);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),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," 分钟前"):"刚刚"}let s={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},o={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function i(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===l?o:s)[e])?t:e}let c={active:"common.statusIndexed",outdated:"common.statusOutdated",error:"common.statusAbnormal",deleted:"common.statusDeleted",disk:"common.statusNotIndexed"}},48200:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>S});var n=l(65321),r=l(97109),a=l(86109),s=l(48399),o=l(9137),i=l(11702),c=l(33442),d=l(88762),u=l(68787),m=l(85493),h=l(84253),x=l(85114),g=l(76506),p=l(7576),f=l(38964),w=l(6578),_=l(39507),y=l(85979),k=l(45551),b=l(14569),j=l.n(b),v=l(58690);let{Paragraph:A}=s.A;function C(e){if(!e)return{};try{return JSON.parse(e)}catch(e){return{}}}function N(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 S(){var e,t,l,s,b,S,I,F;let P=(0,_.Vr)(),M=(0,a.useRouter)(),E="string"==typeof M.query.relativePath?M.query.relativePath:"",R="string"==typeof M.query.projectRoot?M.query.projectRoot:void 0,[T,L]=(0,r.useState)(),[z,B]=(0,r.useState)(!1),[D,O]=(0,r.useState)(""),[J,H]=(0,r.useState)(!1),[U,V]=(0,r.useState)("");(0,r.useEffect)(()=>{E&&(B(!0),O(""),(0,w.xC)(E,R).then(L).catch(e=>{L(void 0),O(e instanceof Error?e.message:P("knowledge.fileDetailLoadFailed"))}).finally(()=>B(!1)))},[E,R,P]);let $=(0,r.useMemo)(()=>(function(e){let t=C(null==e?void 0:e.file.metadataJson);return"object"==typeof t.extraction&&t.extraction?t.extraction:t})(T),[T]),W=U.trim().toLowerCase(),q=(0,r.useMemo)(()=>{var e;return T&&W?T.chunks.filter(e=>{let t=C(e.metadataJson);return[e.content,e.sectionTitle,t.rowRange,t.chunkKind,t.parentId,JSON.stringify(t)].some(e=>String(null!=e?e:"").toLowerCase().includes(W))}):null!=(e=null==T?void 0:T.chunks)?e:[]},[T,W]),K=(0,r.useMemo)(()=>{var e;return T&&W?T.parents.filter(e=>[e.content,e.sectionTitle,e.parentId,e.metadataJson].some(e=>String(null!=e?e:"").toLowerCase().includes(W))):null!=(e=null==T?void 0:T.parents)?e:[]},[T,W]),X=async()=>{if(E){H(!0);try{let e=await (0,w.HC)(E,R);e.detail&&L(e.detail),o.Ay.success(P("knowledge.fileReindexed"))}finally{H(!1)}}},G=async e=>{E&&(await (0,w.tn)(E,e,R),o.Ay.success("file"===e?P("knowledge.openFileRequested"):P("knowledge.openDirectoryRequested")))},Q=[{title:P("knowledge.index"),key:"index",width:70,render:(e,t,l)=>l+1},{title:P("knowledge.chunkIndex"),dataIndex:"chunkIndex",width:90,render:e=>String(e)},{title:P("knowledge.chunkType"),width:110,render:(e,t)=>{var l;return(0,n.jsx)(i.A,{children:String(null!=(l=C(t.metadataJson).chunkKind)?l:t.category)})}},{title:P("knowledge.sectionOrRange"),width:220,render:(e,t)=>{let l=C(t.metadataJson),r="string"==typeof l.rowRange?l.rowRange:void 0;return(0,n.jsxs)(c.A,{wrap:!0,children:[t.sectionTitle?(0,n.jsx)(i.A,{color:"cyan",children:t.sectionTitle}):null,r?(0,n.jsxs)(i.A,{color:"gold",children:[P("knowledge.rowPrefix")," ",r]}):null]})}},{title:P("knowledge.tokens"),dataIndex:"tokenCount",width:90},{title:P("knowledge.chunkContent"),render:(e,t)=>(0,n.jsx)(A,{ellipsis:{rows:3,expandable:!0,symbol:P("knowledge.openExpand")},className:j().searchContent,children:N(t.content,U)})}],Y=[{title:P("knowledge.index"),key:"index",width:70,render:(e,t,l)=>l+1},{title:P("knowledge.parentChunkId"),dataIndex:"parentId",width:260,render:e=>(0,n.jsx)("span",{className:"break-all",children:e})},{title:P("knowledge.chunkCount"),dataIndex:"chunkCount",width:90},{title:P("knowledge.section"),dataIndex:"sectionTitle",width:220},{title:P("knowledge.chunkContent"),render:(e,t)=>(0,n.jsx)(A,{ellipsis:{rows:3,expandable:!0,symbol:P("knowledge.openExpand")},className:j().searchContent,children:N(t.content,U)})}];return z?(0,n.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,n.jsx)(d.A,{active:!0,paragraph:{rows:1}}),(0,n.jsx)(u.A,{size:"small",children:(0,n.jsx)(d.A,{active:!0,paragraph:{rows:6}})}),(0,n.jsx)(u.A,{size:"small",children:(0,n.jsx)(d.A,{active:!0,paragraph:{rows:4}})})]}):D?(0,n.jsx)(m.A,{type:"error",showIcon:!0,description:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:P("knowledge.fileDetailLoadFailed")}),(0,n.jsx)("div",{children:D})]})}):T?(0,n.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,n.jsx)(y.k,{backHref:"/knowledge",backLabel:P("knowledge.backToFileList"),title:P("knowledge.fileDetailTitle"),description:P("knowledge.fileDetailDesc"),extra:(0,n.jsxs)(c.A,{wrap:!0,children:[(0,n.jsx)(x.Ay,{size:"small",onClick:()=>{M.push("/knowledge/source-preview?".concat(new URLSearchParams({relativePath:E,...R?{projectRoot:R}:{}})))},children:"解析核查预览"}),(0,n.jsx)(x.Ay,{size:"small",onClick:()=>{G("file")},children:P("assets.openFile")}),(0,n.jsx)(x.Ay,{size:"small",onClick:()=>{G("directory")},children:P("assets.openDirectory")}),(0,n.jsx)(x.Ay,{size:"small",type:"primary",loading:J,onClick:()=>{X()},children:P("knowledge.reindexFile")})]})}),(null==(e=T.parseAttempt)?void 0:e.status)==="error"&&(0,n.jsx)(m.A,{showIcon:!0,type:"error",message:P("knowledge.latestParseFailed"),description:"".concat(null!=(l=T.parseAttempt.error)?l:"").concat(T.parseAttempt.recordRetained?";".concat(P("knowledge.previousParseRetained")):"")}),(null==(t=T.parseAttempt)?void 0:t.status)==="parsing"&&(0,n.jsx)(m.A,{showIcon:!0,type:"info",message:P("knowledge.currentParseInProgress")}),(0,n.jsx)(u.A,{className:"rounded-2xl border-[var(--borderColor)]",title:(0,n.jsx)("span",{className:"font-semibold",children:P("knowledge.basicInfo")}),children:(0,n.jsxs)(g.A,{size:"small",column:{xxl:3,xl:2,lg:2,md:1,sm:1,xs:1},bordered:!0,styles:{label:{width:"120px",background:"var(--colorFillAlter)",color:"var(--colorTextSecondary)"}},children:[(0,n.jsx)(g.A.Item,{label:P("knowledge.path"),span:3,children:(0,n.jsx)("span",{className:"break-all",children:T.file.relativePath})}),(0,n.jsx)(g.A.Item,{label:P("knowledge.originalFile"),span:3,children:(0,n.jsx)("span",{className:"break-all",children:null!=(s=T.absolutePath)?s:"-"})}),(0,n.jsx)(g.A.Item,{label:P("knowledge.directory"),span:3,children:(0,n.jsx)("span",{className:"break-all",children:null!=(b=T.directory)?b:"-"})}),(0,n.jsx)(g.A.Item,{label:P("knowledge.fileCategory"),children:(0,n.jsxs)(c.A,{size:4,children:[(0,n.jsx)(i.A,{className:"m-0 border-0 bg-[var(--colorFillSecondary)]",children:(0,k.Jm)(T.file.category)})," ",(0,n.jsx)(i.A,{className:"m-0 border-0 bg-[var(--colorFillSecondary)]",children:T.file.format})]})}),(0,n.jsx)(g.A.Item,{label:P("knowledge.fileSize"),children:(0,k.z3)(T.file.fileSize)}),(0,n.jsx)(g.A.Item,{label:P("knowledge.chunkCount"),children:T.file.chunkCount}),(0,n.jsx)(g.A.Item,{label:P("knowledge.status"),children:(0,n.jsx)(i.A,{color:"active"===T.file.status?"success":"error"===T.file.status?"error":"outdated"===T.file.status?"warning":"disk"===T.file.status||"deleted"===T.file.status?"default":"processing",className:"m-0",children:P(k.mc[T.file.status]||"common.unknown")})}),(0,n.jsx)(g.A.Item,{label:P("knowledge.extractionMode"),children:String(null!=(S=$.extractionMode)?S:"-")}),(0,n.jsx)(g.A.Item,{label:P("knowledge.contentCoverage"),children:String(null!=(I=$.contentCoverage)?I:"-")}),(0,n.jsx)(g.A.Item,{label:P("knowledge.textLength"),children:String(null!=(F=$.textLength)?F:"-")})]})}),(0,n.jsx)(u.A,{className:"rounded-2xl border-[var(--borderColor)]",title:(0,n.jsx)("span",{className:"font-semibold",children:P("knowledge.detailFilter")}),children:(0,n.jsxs)("div",{className:"flex flex-col w-full gap-4",children:[(0,n.jsx)(p.A,{allowClear:!0,size:"large",value:U,onChange:e=>V(e.target.value),placeholder:P("knowledge.detailFilterPlaceholder"),className:"rounded-xl bg-[var(--colorBgHover)] border-[var(--borderColor)] focus:bg-[var(--colorBgContainer)] hover:bg-[var(--colorBgContainer)] w-full"}),U?(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 items-center bg-[var(--colorFillAlter)] p-3 rounded-xl border border-[var(--colorBorderSecondary)]",children:[(0,n.jsx)("span",{className:"text-sm font-medium text-[var(--colorTextSecondary)] mr-2",children:"过滤结果:"}),(0,n.jsxs)(i.A,{color:"blue",className:"m-0 border-0",children:[P("knowledge.parentMatches")," ",K.length]}),(0,n.jsxs)(i.A,{color:"green",className:"m-0 border-0",children:[P("knowledge.childMatches")," ",q.length]}),(0,n.jsx)("div",{className:"w-[1px] h-3 bg-[var(--colorBorderSecondary)] mx-1"}),(0,n.jsxs)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:[P("knowledge.filterTerm")," ",(0,n.jsx)("strong",{className:"text-[var(--colorText)]",children:U})]})]}):null]})}),(0,n.jsxs)(u.A,{className:"rounded-2xl border-[var(--borderColor)]",title:(0,n.jsxs)("span",{className:"font-semibold",children:[P("knowledge.parentChunks")," ",(0,n.jsxs)(i.A,{className:"ml-2 border-0 bg-[var(--colorFillSecondary)] text-xs font-normal",children:[K.length," / ",T.parents.length]})]}),children:[(0,n.jsx)(m.A,{type:"info",showIcon:!0,description:P("knowledge.parentChunkHint"),className:"mb-4 rounded-xl border-blue-200 bg-blue-50/50"}),(0,n.jsx)(f.A,{rowKey:"id",columns:Y,dataSource:K,pagination:(0,v.B)(P),size:"small",className:"custom-table"})]}),(0,n.jsx)(u.A,{className:"rounded-2xl border-[var(--borderColor)]",title:(0,n.jsxs)("span",{className:"font-semibold",children:[P("knowledge.childChunks")," ",(0,n.jsxs)(i.A,{className:"ml-2 border-0 bg-[var(--colorFillSecondary)] text-xs font-normal",children:[q.length," / ",T.chunks.length]})]}),children:(0,n.jsx)(f.A,{rowKey:"id",columns:Q,dataSource:q,pagination:(0,v.B)(P),size:"small",className:"custom-table"})})]}):(0,n.jsx)(h.A,{description:P("knowledge.selectFile")})}},58690:(e,t,l)=>{"use strict";function n(e){var t,l,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{defaultPageSize:null!=(t=r.pageSize)?t:10,pageSizeOptions:null!=(l=r.pageSizeOptions)?l:[10,20,50,100],showSizeChanger:!0,showTotal:t=>{var l,n;return e(null!=(l=r.totalLabelKey)?l:"common.totalRows",null!=(n=r.totalLabelFallback)?n:"共 {count} 条").replace("{count}",String(t))},hideOnSinglePage:null!=(n=r.hideOnSinglePage)&&n,showQuickJumper:!1}}l.d(t,{B:()=>n})},85979:(e,t,l)=>{"use strict";l.d(t,{k:()=>o});var n=l(65321),r=l(43220),a=l.n(r),s=l(91648);function o(e){let{backHref:t,backLabel:l,title:r,description:o,extra:i}=e;return(0,n.jsx)("div",{className:"mb-6 bg-[var(--colorBgContainer)] rounded-2xl overflow-hidden border border-[var(--borderColor)] p-6",children:(0,n.jsxs)("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-4 md:gap-6",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,n.jsxs)(a(),{href:t,prefetch:!1,className:"detailBack",children:[(0,n.jsx)(s.A,{size:16,strokeWidth:2,"aria-hidden":!0}),(0,n.jsx)("span",{children:l})]}),(0,n.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-[var(--colorText)] m-0 truncate",children:r}),o?(0,n.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0 break-all",children:o}):null]})]}),i?(0,n.jsx)("div",{className:"shrink-0 flex items-center gap-2",children:i}):null]})})}},91648:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});let n=(0,l(1278).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},96538:(e,t,l)=>{"use strict";l.d(t,{a:()=>r,j:()=>a});let n={coarse:function(e,t){let l=Math.floor(e/1e3),n=Math.floor(l/86400),r=Math.floor(l%86400/3600),a=Math.floor(l%3600/60),s="en-US"===t;return n>0?s?"".concat(n,"d ").concat(r,"h"):"".concat(n," 天 ").concat(r," 小时"):r>0?s?"".concat(r,"h ").concat(a,"m"):"".concat(r," 小时 ").concat(a," 分"):a>0?s?"".concat(a,"m"):"".concat(a," 分"):s?"Just now":"刚刚"},fine:function(e){let t=Math.round(e/1e3);if(t<60)return"".concat(t," 秒");let l=Math.floor(t/60);return l<60?"".concat(l," 分 ").concat(t%60," 秒"):"".concat(Math.floor(l/60)," 小时 ").concat(l%60," 分")},"fine-decimal":function(e){return e>=6e4?"".concat(Math.floor(e/6e4)," 分 ").concat(Math.round(e%6e4/1e3)," 秒"):"".concat((e/1e3).toFixed(1)," 秒")},metric:function(e){return e<1e3?"".concat(Math.round(e),"ms"):e<6e4?"".concat((e/1e3).toFixed(1),"s"):"".concat((e/6e4).toFixed(1),"min")}};function r(e,t){var l;return n[t.style](function(e,t){let l="s"===t?1e3*e:e;return Number.isFinite(l)&&l>0?l:0}(e,t.unit),null!=(l=t.locale)?l:"zh-CN")}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return r(e,{unit:"s",style:"coarse",locale:t})}}},e=>{e.O(0,[6409,1210,1702,5544,9551,4665,8399,7576,1499,8569,8338,8787,8964,5046,636,6593,8792],()=>e(e.s=37690)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9028],{45505:(e,u,n)=>{"use strict";n.r(u),n.d(u,{default:()=>s});var _=n(97109),l=n(86109);function s(){let e=(0,l.useRouter)();return(0,_.useEffect)(()=>{e.replace("/knowledge")},[e]),null}},90426:(e,u,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/files",function(){return n(45505)}])}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=90426)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3414],{54178:(e,n,u)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/manage",function(){return u(87277)}])},87277:(e,n,u)=>{"use strict";u.r(n),u.d(n,{default:()=>l});var _=u(97109),t=u(86109);function l(){let e=(0,t.useRouter)();return(0,_.useEffect)(()=>{e.replace("/knowledge")},[e]),null}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=54178)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95],{2232:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>P});var r=s(65321),a=s(97109),l=s(1873),n=s.n(l),c=s(86109),i=s(33442),o=s(14932),d=s(85114),x=s(85493),h=s(48318),m=s(75174),u=s(57271),p=s(42700),j=s(84253),v=s(68787),g=s(11702),f=s(76506),y=s(58569),b=s(88762),N=s(99271),w=s(37510),C=s(99811),k=s(6578),S=s(85979);let A={whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:12.5,lineHeight:1.75};function T(e){let{children:t,maxHeight:s=520}=e;return(0,r.jsx)("div",{className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5",style:{maxHeight:s,overflow:"auto"},children:t})}function z(e){let{zoom:t,onChange:s,viewportRef:a}=e,l=e=>Math.min(4,Math.max(.2,Math.round(100*e)/100));return(0,r.jsxs)(i.A,{size:4,align:"center",children:[(0,r.jsx)(o.A,{title:"缩小(Ctrl/⌘ + 滚轮同效)",children:(0,r.jsx)(d.Ay,{size:"small",icon:(0,r.jsx)(N.A,{}),"aria-label":"缩小",onClick:()=>s(l(t-.1))})}),(0,r.jsxs)("span",{className:"text-xs tabular-nums text-[var(--colorTextSecondary)] w-12 text-center",children:[Math.round(100*t),"%"]}),(0,r.jsx)(o.A,{title:"放大(Ctrl/⌘ + 滚轮同效)",children:(0,r.jsx)(d.Ay,{size:"small",icon:(0,r.jsx)(w.A,{}),"aria-label":"放大",onClick:()=>s(l(t+.1))})}),(0,r.jsx)(d.Ay,{size:"small",onClick:()=>{let e=a.current,r=null==e?void 0:e.firstElementChild;if(!e||!r)return;let n=r.clientWidth/t;n&&s(l((e.clientWidth-2)/n))},children:"适应宽度"}),(0,r.jsx)(d.Ay,{size:"small",disabled:1===t,onClick:()=>s(1),children:"原始比例"})]})}function M(e){let{zoom:t,viewportRef:s,children:a}=e;return(0,r.jsx)("div",{ref:s,className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] p-3 overflow-auto",style:{maxHeight:"68vh"},children:1===t?a:(0,r.jsx)("div",{style:{zoom:t},children:a})})}function R(e){var t,s,a;let{block:l,parts:n}=e;if("undefined"==typeof DOMParser)return(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:l.text})});let c=null!=(a=null==(t=/<[^!?][^>]*?\s([^>]*)>/u.exec(null!=(s=n[l.part])?s:""))?void 0:t[1])?a:'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"',i=new DOMParser().parseFromString("<root ".concat(c,">").concat(l.xml,"</root>"),"application/xml"),o=i.documentElement.firstElementChild;if(!o||i.querySelector("parsererror"))return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.A,{type:"warning",message:"表格XML显示未完成,保留原文及结构供核查"}),(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:l.text})})]});let d=[...o.children].filter(e=>"tr"===e.localName).map(e=>{let t=0;return[...e.children].filter(e=>"tc"===e.localName).map(e=>{var s,r,a;let l=Number(null!=(r=null==(s=e.getElementsByTagName("w:gridSpan")[0])?void 0:s.getAttribute("w:val"))?r:1),n=e.getElementsByTagName("w:vMerge")[0],c={column:t,span:l,merge:n?null!=(a=n.getAttribute("w:val"))?a:"continue":void 0,text:[...e.getElementsByTagName("w:t")].map(e=>{var t;return null!=(t=e.textContent)?t:""}).join("")};return t+=l,c})});return(0,r.jsx)("table",{className:"w-full border-collapse my-3 text-sm",children:(0,r.jsx)("tbody",{children:d.map((e,t)=>(0,r.jsx)("tr",{className:"even:bg-[var(--colorFillAlter)]",children:e.filter(e=>"continue"!==e.merge).map(e=>{var s,a;let l=1;if("restart"===e.merge)for(;(null==(a=d[t+l])||null==(s=a.find(t=>t.column===e.column))?void 0:s.merge)==="continue";)l++;return(0,r.jsx)("td",{className:"border border-[var(--borderColor)] p-2 align-top whitespace-pre-wrap",colSpan:e.span,rowSpan:l,children:e.text},e.column)})},t))})})}function I(e){let{sheet:t,zoom:s,viewportRef:l}=e,[n,c]=(0,a.useState)(1),[i,o]=(0,a.useState)(1),d=t.cells.reduce((e,t)=>Math.max(e,t.row),t.merges.reduce((e,t)=>Math.max(e,t.endRow),1)),x=t.cells.reduce((e,t)=>Math.max(e,t.col),t.merges.reduce((e,t)=>Math.max(e,t.endCol),1)),u=(0,a.useMemo)(()=>new Map(t.cells.map(e=>["".concat(e.row,":").concat(e.col),e])),[t]),p=(n-1)*50+1,j=Math.min(d,p+49),v=Math.min(x,i+19);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mb-3 text-xs text-[var(--colorTextSecondary)]",children:[(0,r.jsx)("span",{children:"原工作表物理坐标;公式使用已保存缓存值"}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:["起始列 ",(0,r.jsx)(h.A,{size:"small",min:1,max:x,value:i,onChange:e=>o(null!=e?e:1)})]})]}),(0,r.jsx)(M,{zoom:s,viewportRef:l,children:(0,r.jsxs)("table",{className:"border-collapse text-xs",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 sticky top-0 left-0 z-[2]",children:"行"}),Array.from({length:v-i+1},(e,t)=>(0,r.jsxs)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 sticky top-0 z-[1] min-w-24",children:["C",i+t]},t))]})}),(0,r.jsx)("tbody",{children:Array.from({length:j-p+1},(e,s)=>{let a=p+s;return(0,r.jsxs)("tr",{className:"even:bg-[var(--colorFillAlter)]",children:[(0,r.jsxs)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 text-[var(--colorTextSecondary)] sticky left-0 z-[1]",children:["R",a]}),Array.from({length:v-i+1},(e,s)=>{var l,n,c;let o=i+s,d=u.get("".concat(a,":").concat(o)),x=t.merges.find(e=>a>=e.startRow&&a<=e.endRow&&o>=e.startCol&&o<=e.endCol);if(x&&(a!==Math.max(p,x.startRow)||o!==Math.max(i,x.startCol)))return null;let h=x?u.get("".concat(x.startRow,":").concat(x.startCol)):d,m=null!=(l=null==h?void 0:h.display)?l:"";return(0,r.jsxs)("td",{className:"border border-[var(--borderColor)] px-2 py-1 whitespace-pre-wrap align-top ".concat("number"==typeof m||"string"==typeof m&&/^-?[\d,]+(\.\d+)?$/u.test(m.trim())?"text-right tabular-nums":""," ").concat(""===m?"bg-[var(--colorFillQuaternary)]":""),rowSpan:x?Math.min(j,x.endRow)-Math.max(p,x.startRow)+1:1,colSpan:x?Math.min(v,x.endCol)-Math.max(i,x.startCol)+1:1,title:"".concat(null!=(n=null==h?void 0:h.address)?n:"R".concat(a,"C").concat(o),"\n原值: ").concat(String(null!=(c=null==h?void 0:h.value)?c:"")).concat((null==h?void 0:h.formula)?"\n公式: =".concat(h.formula):""),children:[m,(null==h?void 0:h.formula)&&(0,r.jsxs)("div",{className:"text-[10px] text-[var(--colorTextTertiary)]",children:["=",h.formula]})]},o)})]},a)})})]})}),(0,r.jsx)("div",{className:"mt-3 flex justify-end",children:(0,r.jsx)(m.A,{size:"small",current:n,pageSize:50,total:d,showSizeChanger:!1,onChange:c})})]})}function F(e){let{frameIds:t,endpoint:s,zoom:l,viewportRef:c}=e,[i,o]=(0,a.useState)(0),[d,h]=(0,a.useState)(""),[m,v]=(0,a.useState)(),[g,f]=(0,a.useState)(""),[y,b]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=!0;h(""),f(""),v(void 0);let r=t[i];if(r)return b(!0),(0,k.x6)("".concat(s,"&frame=").concat(encodeURIComponent(r),"&format=json")).then(t=>{e&&(h(t.image),v(t.receipt))}).catch(t=>{e&&f(String(t))}).finally(()=>{e&&b(!1)}),()=>{e=!1}},[i,t,s]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-3",children:[(0,r.jsx)(u.A,{size:"small",className:"min-w-64",value:i,onChange:o,options:t.map((e,t)=>({value:t,label:e}))}),(0,r.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:"显示实际库内实体与块实例;绘制限制不等同数据丢失。"})]}),(0,r.jsxs)(p.A,{spinning:y,children:[g&&(0,r.jsx)(x.A,{type:"warning",message:"图框显示未完成",description:"".concat(g,";请区分已入库结构和绘制能力,已有库内文字仍可读取。")}),d?(0,r.jsx)(M,{zoom:l,viewportRef:c,children:(0,r.jsx)("div",{className:"bg-white inline-block p-2",children:(0,r.jsx)(n(),{unoptimized:!0,width:2400,height:1800,src:d,alt:"已解析CAD图框",style:{width:"100%",height:"auto",display:"block"}})})}):!y&&!g&&(0,r.jsx)(j.A,{description:"尚未识别到可显示图框"}),void 0!==m&&(0,r.jsxs)("details",{className:"mt-3",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextSecondary)]",children:"本次绘制回执与限制"}),(0,r.jsx)(T,{maxHeight:260,children:(0,r.jsx)("pre",{style:A,children:JSON.stringify(m,null,2)})})]})]})]})}function O(e){let{structure:t,endpoint:s,zoom:l,viewportRef:c}=e,[i,o]=(0,a.useState)(0);if(t.spreadsheet){let e=t.spreadsheet.sheets;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(u.A,{size:"small",className:"min-w-64",value:i,options:e.map((e,t)=>({value:t,label:e.name})),onChange:o})}),e[i]&&(0,r.jsx)(I,{sheet:e[i],zoom:l,viewportRef:c},i)]})}if(t.docx)return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(M,{zoom:l,viewportRef:c,children:(0,r.jsxs)("div",{className:"mx-auto",style:{maxWidth:860},children:[t.docx.blocks.map(e=>(0,r.jsxs)("div",{id:e.id,className:"mb-4",children:[(0,r.jsxs)("div",{className:"mb-1 text-[10px] text-[var(--colorTextTertiary)]",children:[e.part," \xb7 第 ",e.index+1," 块"]}),"table"===e.kind?(0,r.jsx)(R,{block:e,parts:t.docx.parts}):(0,r.jsx)("p",{className:e.headingLevel?"font-semibold text-lg whitespace-pre-wrap mt-2":"whitespace-pre-wrap leading-8 text-sm",children:e.text}),(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextTertiary)]",children:"来源 XML"}),(0,r.jsx)(T,{maxHeight:260,children:(0,r.jsx)("pre",{style:A,children:e.xml})})]})]},e.id)),t.docx.images.map(e=>(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("div",{className:"mb-1 text-xs text-[var(--colorTextSecondary)]",children:e.name}),/^image\/(?:png|jpeg|gif|webp|svg\+xml|bmp)$/u.test(e.mediaType)?(0,r.jsx)(n(),{unoptimized:!0,width:1200,height:900,src:"".concat(s,"&image=").concat(encodeURIComponent(e.name)),alt:e.name,style:{maxWidth:"100%",height:"auto"}}):(0,r.jsx)(x.A,{type:"info",message:"已保留".concat(e.mediaType,"图片数据,浏览器未声明支持显示")})]},e.name))]})})});if(t.pdf){var d,h,p,v;let e=t.pdf.pages,s=e[i],a=null!=(h=null!=(d=null==s?void 0:s.width)?d:null==s?void 0:s.glyphs.reduce((e,t)=>Math.max(e,t.x+t.width+20),600))?h:600,n=null!=(v=null!=(p=null==s?void 0:s.height)?p:null==s?void 0:s.glyphs.reduce((e,t)=>Math.max(e,t.y+t.height+20),800))?v:800;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[(0,r.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:"显示库内已保存文字与位置;可选原版本对照不影响本页及后续生成。"}),(0,r.jsx)(m.A,{size:"small",current:i+1,pageSize:1,total:e.length,showSizeChanger:!1,onChange:e=>o(e-1)})]}),s&&(0,r.jsxs)(M,{zoom:l,viewportRef:c,children:[(0,r.jsx)("div",{className:"mx-auto bg-white shadow-sm border border-[var(--borderColor)]",style:{width:a},children:(0,r.jsx)("svg",{viewBox:"0 0 ".concat(a," ").concat(n),width:"100%",role:"img","aria-label":"解析第".concat(s.page,"页"),children:s.glyphs.map(e=>(0,r.jsx)("text",{x:e.x,y:n-e.y,fontSize:Math.max(6,e.height),children:e.str},e.id))})}),s.ocrText&&(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("div",{className:"mb-1 text-xs text-[var(--colorTextSecondary)]",children:"该页 OCR 文本"}),(0,r.jsx)(T,{maxHeight:260,children:(0,r.jsx)("pre",{style:A,children:s.ocrText})})]}),!s.glyphs.length&&!s.ocrText&&(0,r.jsx)(j.A,{description:"该页没有可展示文字,不能据此断言原页为空"})]})]})}return t.cad?(0,r.jsx)(F,{frameIds:t.cad.frameIds,endpoint:s,zoom:l,viewportRef:c}):(0,r.jsx)(j.A,{description:"此解析结果尚无结构显示适配,完整解析文字仍可查看"})}function E(e){let{data:t}=e,s=t.conservation,a=[{key:"chars",label:"文本覆盖",value:"".concat(s.coveredNonWhitespaceChars," / ").concat(s.sourceNonWhitespaceChars," 个非空白字符"),trouble:s.coveredNonWhitespaceChars!==s.sourceNonWhitespaceChars,...s.uncovered.length?{detail:(0,r.jsxs)(r.Fragment,{children:[s.uncovered.slice(0,5).map((e,t)=>(0,r.jsxs)("div",{className:"mb-1",children:["字符 ",e.start,"–",e.end,":",e.text.slice(0,120)]},t)),s.uncovered.length>5?(0,r.jsxs)("div",{children:["…还有 ",s.uncovered.length-5," 段"]}):null]})}:{}},{key:"chunks",label:"切片数",value:"".concat(t.totalChunks," 块(库内登记 ").concat(s.registeredChunkCount,",与底稿一致:").concat(s.chunkCountMatches?"是":"否",")"),trouble:!s.chunkCountMatches},{key:"stale",label:"身份过期的切片",value:s.staleChunkIdentities.length?"".concat(s.staleChunkIdentities.length," 块"):"无",trouble:s.staleChunkIdentities.length>0,...s.staleChunkIdentities.length?{detail:(0,r.jsxs)("div",{children:["切片序号:",s.staleChunkIdentities.slice(0,20).join(", "),s.staleChunkIdentities.length>20?" …":""]})}:{}},{key:"unmapped",label:"未能映射回底稿的切片",value:s.unmapped.length?"".concat(s.unmapped.length," 块"):"无",trouble:s.unmapped.length>0,...s.unmapped.length?{detail:(0,r.jsxs)(r.Fragment,{children:[s.unmapped.slice(0,5).map(e=>(0,r.jsxs)("div",{className:"mb-1",children:["切片 ",e.chunkIndex,":",e.text.slice(0,120)]},e.chunkIndex)),s.unmapped.length>5?(0,r.jsxs)("div",{children:["…还有 ",s.unmapped.length-5," 块"]}):null]})}:{}},{key:"order",label:"切片顺序",value:s.outOfOrderChunks.length?"乱序 ".concat(s.outOfOrderChunks.length," 块"):"与底稿一致",trouble:s.outOfOrderChunks.length>0,...s.outOfOrderChunks.length?{detail:(0,r.jsxs)("div",{children:["切片序号:",s.outOfOrderChunks.slice(0,20).join(", ")]})}:{}},{key:"repeated",label:"重复上下文跨度",value:"".concat(s.repeatedContextSpans," 处"),trouble:!1}];return(0,r.jsx)("div",{className:"flex flex-col",children:a.map(e=>(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3 py-2 border-b border-[var(--colorBorderSecondary)] last:border-0",children:[(0,r.jsx)("div",{className:"sm:w-44 shrink-0 text-xs text-[var(--colorTextTertiary)] sm:pt-0.5",children:e.label}),(0,r.jsxs)("div",{className:"min-w-0 flex-1 text-sm",children:[(0,r.jsx)("span",{className:e.trouble?"text-[var(--colorError)]":"text-[var(--colorText)]",children:e.value}),e.detail&&(0,r.jsxs)("details",{className:"mt-1",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextSecondary)]",children:"展开明细"}),(0,r.jsx)(T,{maxHeight:220,children:(0,r.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:e.detail})})]})]})]},e.key))})}function P(){let e=(0,c.useRouter)(),t="string"==typeof e.query.relativePath?e.query.relativePath:"",s="string"==typeof e.query.projectRoot?e.query.projectRoot:"",[l,n]=(0,a.useState)(),[o,h]=(0,a.useState)(""),[u,N]=(0,a.useState)(!1),[w,M]=(0,a.useState)(1),[R,I]=(0,a.useState)("structure"),F=(0,a.useRef)(null),P=(0,a.useRef)(0),_=new URLSearchParams({relativePath:t,...s?{projectRoot:s}:{}}),H="/api/kb/files/source-preview?".concat(_),W="".concat(H).concat((null==l?void 0:l.status)==="recorded"?"&snapshotId=".concat(l.identity.snapshotId):""),B=(0,a.useCallback)(async e=>{let t=++P.current;N(!0),h("");try{let s=await (0,k.x6)(e);t===P.current&&n(s)}catch(e){t===P.current&&h(e instanceof Error?e.message:String(e))}finally{t===P.current&&N(!1)}},[]);(0,a.useEffect)(()=>{n(void 0),t&&B(H)},[t,H,B]);let D=null==l?void 0:l.pdfCoverage,q=D&&"complete"!==D.status?(0,r.jsx)(x.A,{showIcon:!0,type:"warning",message:"unmeasured"===D.status?"PDF 页覆盖未记录":"PDF 页覆盖不完整",description:(0,r.jsxs)(i.A,{direction:"vertical",size:2,children:[D.pageCount?(0,r.jsx)("span",{children:"已处理页:".concat(D.processedPages,"/").concat(D.pageCount)}):(0,r.jsx)("span",{children:'没有记录到声明页数,无法据此断言"处理了几页"。'}),D.missingPages.length>0&&(0,r.jsx)("span",{children:"缺少页:".concat(D.missingPages.join(", "))}),D.failedPages.length>0&&(0,r.jsx)("span",{children:"失败页:".concat(D.failedPages.join(", "))}),(0,r.jsx)("span",{children:"这条读数只说明解析侧处理了哪些页,不证明内容、版式或专业采用正确。"})]})}):null;return(0,r.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,r.jsx)(S.k,{backHref:"/knowledge/file-detail?".concat(_),backLabel:"返回切片详情",title:"解析核查预览",description:t,extra:(0,r.jsxs)(i.A,{wrap:!0,children:["structure"===R&&(0,r.jsx)(z,{zoom:w,onChange:M,viewportRef:F}),(0,r.jsx)(d.Ay,{size:"small",icon:(0,r.jsx)(C.A,{}),onClick:()=>{B(H)},loading:u,children:"刷新"})]})}),o&&(0,r.jsx)(x.A,{type:"error",message:o}),(0,r.jsx)(p.A,{spinning:u,children:(null==l?void 0:l.status)==="not-recorded"?(0,r.jsxs)(v.A,{className:"rounded-2xl border-[var(--borderColor)]",children:[(0,r.jsx)(x.A,{type:"warning",message:"独立解析底稿尚未记录",description:l.reason}),q&&(0,r.jsx)("div",{className:"mt-3",children:q}),(0,r.jsx)(d.Ay,{className:"mt-4",onClick:()=>{(async()=>{try{await (0,k.HC)(t,s||void 0),h("重新解析任务已提交,请在处理完成后刷新本页。")}catch(e){h(String(e))}})()},children:"重新解析此文件"}),(0,r.jsx)("p",{className:"mt-4 mb-2 text-sm text-[var(--colorTextSecondary)]",children:"当前实际库内切片(不是独立底稿):"}),l.chunks.map(e=>(0,r.jsxs)("div",{className:"my-3",children:[(0,r.jsxs)(g.A,{children:["切片 ",e.chunkIndex]}),(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:e.content})})]},e.id)),(0,r.jsx)("div",{className:"mt-3 flex justify-end",children:(0,r.jsx)(m.A,{current:Math.floor(l.offset/30)+1,pageSize:30,total:l.totalChunks,showSizeChanger:!1,onChange:e=>{B("".concat(H,"&offset=").concat((e-1)*30))}})})]}):(null==l?void 0:l.status)==="recorded"?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(v.A,{className:"rounded-2xl border-[var(--borderColor)] mb-5",children:[(0,r.jsx)(E,{data:l}),(0,r.jsx)("p",{className:"mt-3 mb-0 text-xs text-[var(--colorTextSecondary)]",children:"这项检查只证明独立解析文字与切片的内容覆盖,不证明原文件解析、版式、工程理解或专业采用全部正确。"}),q&&(0,r.jsx)("div",{className:"mt-3",children:q}),l.identity.limitations.map(e=>(0,r.jsx)("p",{className:"mt-2 mb-0 text-xs text-[var(--colorTextSecondary)]",children:e},e)),(0,r.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[(0,r.jsx)(d.Ay,{size:"small",href:"".concat(W,"&original=1"),target:"_blank",children:"查看/下载入库原版本"}),(0,r.jsx)(d.Ay,{size:"small",onClick:()=>{(0,k.tn)(t,"source-version",s||void 0).catch(e=>h("可选原版本对照不可用:".concat(String(e),";库内数据仍可读取")))},children:"本机打开入库原版本"})]}),(0,r.jsxs)("details",{className:"mt-4",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextSecondary)]",children:"技术详情(原文件哈希 / 解析版本 / 解析身份 / 核查口径)"}),(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsxs)(f.A,{size:"small",column:1,bordered:!0,styles:{label:{width:"120px",background:"var(--colorFillAlter)",color:"var(--colorTextSecondary)"}},children:[(0,r.jsx)(f.A.Item,{label:"原文件SHA256",children:(0,r.jsx)("span",{className:"break-all text-xs",children:l.identity.sourceHash})}),(0,r.jsx)(f.A.Item,{label:"解析版本",children:(0,r.jsx)("span",{className:"text-xs",children:l.identity.parserVersion})}),(0,r.jsx)(f.A.Item,{label:"解析身份",children:(0,r.jsx)("span",{className:"break-all text-xs",children:l.identity.snapshotId})}),(0,r.jsx)(f.A.Item,{label:"核查口径",children:(0,r.jsxs)("span",{className:"text-xs",children:[l.conservation.version," \xb7 ",l.conservation.scope," \xb7 入库状态 ",l.conservation.ingestionStatus]})}),(0,r.jsx)(f.A.Item,{label:"底稿快照",children:(0,r.jsx)("span",{className:"break-all text-xs",children:l.conservation.snapshotId})})]})})]})]}),(0,r.jsx)(y.A,{className:"documents-tabs",activeKey:R,onChange:I,items:[{key:"structure",label:"解析结构",children:(0,r.jsx)(v.A,{className:"rounded-2xl border-[var(--borderColor)]",onWheelCapture:e=>{(e.ctrlKey||e.metaKey)&&(e.preventDefault(),M(t=>Math.min(4,Math.max(.2,Math.round((t-.1*Math.sign(e.deltaY))*100)/100))))},children:(0,r.jsx)(O,{structure:l.structure,endpoint:W,zoom:w,viewportRef:F},l.identity.snapshotId)})},{key:"chunks",label:"实际切片重组",children:(0,r.jsxs)(v.A,{className:"rounded-2xl border-[var(--borderColor)]",children:[(0,r.jsxs)("p",{className:"text-xs text-[var(--colorTextSecondary)]",children:["当前展示切片 ",l.offset+1," 至 ",l.offset+l.chunks.length,",共 ",l.totalChunks," 块;分页不代表其余内容不存在。"]}),l.chunks.map(e=>(0,r.jsxs)("div",{className:"my-4",children:[(0,r.jsxs)(i.A,{size:4,wrap:!0,children:[(0,r.jsxs)(g.A,{children:["切片 ",e.chunkIndex]}),e.sectionTitle?(0,r.jsx)(g.A,{color:"cyan",children:e.sectionTitle}):null]}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:e.content})})}),(0,r.jsxs)("details",{className:"mt-2",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextTertiary)]",children:"库内解析底稿区间"}),(0,r.jsx)(T,{maxHeight:240,children:(0,r.jsx)("pre",{style:A,children:JSON.stringify(e.sourceSpans,null,2)})})]})]},e.id)),(0,r.jsx)("div",{className:"mt-3 flex justify-end",children:(0,r.jsx)(m.A,{current:Math.floor(l.offset/30)+1,pageSize:30,total:l.totalChunks,showSizeChanger:!1,onChange:e=>{B("".concat(W,"&offset=").concat((e-1)*30))}})})]})}]})]}):u?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(b.A,{active:!0,title:!1,paragraph:{rows:3}}),(0,r.jsx)(b.A,{active:!0,title:!1,paragraph:{rows:6}})]}):(0,r.jsx)(j.A,{description:"选择文件后查看解析结果"})})]})}},59528:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/source-preview",function(){return s(2232)}])},85979:(e,t,s)=>{"use strict";s.d(t,{k:()=>c});var r=s(65321),a=s(43220),l=s.n(a),n=s(91648);function c(e){let{backHref:t,backLabel:s,title:a,description:c,extra:i}=e;return(0,r.jsx)("div",{className:"mb-6 bg-[var(--colorBgContainer)] rounded-2xl overflow-hidden border border-[var(--borderColor)] p-6",children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-4 md:gap-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,r.jsxs)(l(),{href:t,prefetch:!1,className:"detailBack",children:[(0,r.jsx)(n.A,{size:16,strokeWidth:2,"aria-hidden":!0}),(0,r.jsx)("span",{children:s})]}),(0,r.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-[var(--colorText)] m-0 truncate",children:a}),c?(0,r.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0 break-all",children:c}):null]})]}),i?(0,r.jsx)("div",{className:"shrink-0 flex items-center gap-2",children:i}):null]})})}}},e=>{e.O(0,[717,551,665,569,499,787,808,318,955,636,593,792],()=>e(e.s=59528)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[95],{2232:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>P});var r=s(65321),a=s(97109),l=s(1873),n=s.n(l),c=s(86109),i=s(33442),o=s(14932),d=s(85114),x=s(85493),h=s(48318),m=s(75174),u=s(57271),p=s(42700),j=s(84253),v=s(68787),g=s(11702),f=s(76506),y=s(58569),b=s(88762),N=s(99271),w=s(37510),C=s(99811),k=s(6578),S=s(85979);let A={whiteSpace:"pre-wrap",overflowWrap:"anywhere",margin:0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:12.5,lineHeight:1.75};function T(e){let{children:t,maxHeight:s=520}=e;return(0,r.jsx)("div",{className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5",style:{maxHeight:s,overflow:"auto"},children:t})}function z(e){let{zoom:t,onChange:s,viewportRef:a}=e,l=e=>Math.min(4,Math.max(.2,Math.round(100*e)/100));return(0,r.jsxs)(i.A,{size:4,align:"center",children:[(0,r.jsx)(o.A,{title:"缩小(Ctrl/⌘ + 滚轮同效)",children:(0,r.jsx)(d.Ay,{size:"small",icon:(0,r.jsx)(N.A,{}),"aria-label":"缩小",onClick:()=>s(l(t-.1))})}),(0,r.jsxs)("span",{className:"text-xs tabular-nums text-[var(--colorTextSecondary)] w-12 text-center",children:[Math.round(100*t),"%"]}),(0,r.jsx)(o.A,{title:"放大(Ctrl/⌘ + 滚轮同效)",children:(0,r.jsx)(d.Ay,{size:"small",icon:(0,r.jsx)(w.A,{}),"aria-label":"放大",onClick:()=>s(l(t+.1))})}),(0,r.jsx)(d.Ay,{size:"small",onClick:()=>{let e=a.current,r=null==e?void 0:e.firstElementChild;if(!e||!r)return;let n=r.clientWidth/t;n&&s(l((e.clientWidth-2)/n))},children:"适应宽度"}),(0,r.jsx)(d.Ay,{size:"small",disabled:1===t,onClick:()=>s(1),children:"原始比例"})]})}function M(e){let{zoom:t,viewportRef:s,children:a}=e;return(0,r.jsx)("div",{ref:s,className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorBgContainer)] p-3 overflow-auto",style:{maxHeight:"68vh"},children:1===t?a:(0,r.jsx)("div",{style:{zoom:t},children:a})})}function R(e){var t,s,a;let{block:l,parts:n}=e;if("undefined"==typeof DOMParser)return(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:l.text})});let c=null!=(a=null==(t=/<[^!?][^>]*?\s([^>]*)>/u.exec(null!=(s=n[l.part])?s:""))?void 0:t[1])?a:'xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"',i=new DOMParser().parseFromString("<root ".concat(c,">").concat(l.xml,"</root>"),"application/xml"),o=i.documentElement.firstElementChild;if(!o||i.querySelector("parsererror"))return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.A,{type:"warning",message:"表格XML显示未完成,保留原文及结构供核查"}),(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:l.text})})]});let d=[...o.children].filter(e=>"tr"===e.localName).map(e=>{let t=0;return[...e.children].filter(e=>"tc"===e.localName).map(e=>{var s,r,a;let l=Number(null!=(r=null==(s=e.getElementsByTagName("w:gridSpan")[0])?void 0:s.getAttribute("w:val"))?r:1),n=e.getElementsByTagName("w:vMerge")[0],c={column:t,span:l,merge:n?null!=(a=n.getAttribute("w:val"))?a:"continue":void 0,text:[...e.getElementsByTagName("w:t")].map(e=>{var t;return null!=(t=e.textContent)?t:""}).join("")};return t+=l,c})});return(0,r.jsx)("table",{className:"w-full border-collapse my-3 text-sm",children:(0,r.jsx)("tbody",{children:d.map((e,t)=>(0,r.jsx)("tr",{className:"even:bg-[var(--colorFillAlter)]",children:e.filter(e=>"continue"!==e.merge).map(e=>{var s,a;let l=1;if("restart"===e.merge)for(;(null==(a=d[t+l])||null==(s=a.find(t=>t.column===e.column))?void 0:s.merge)==="continue";)l++;return(0,r.jsx)("td",{className:"border border-[var(--borderColor)] p-2 align-top whitespace-pre-wrap",colSpan:e.span,rowSpan:l,children:e.text},e.column)})},t))})})}function I(e){let{sheet:t,zoom:s,viewportRef:l}=e,[n,c]=(0,a.useState)(1),[i,o]=(0,a.useState)(1),d=t.cells.reduce((e,t)=>Math.max(e,t.row),t.merges.reduce((e,t)=>Math.max(e,t.endRow),1)),x=t.cells.reduce((e,t)=>Math.max(e,t.col),t.merges.reduce((e,t)=>Math.max(e,t.endCol),1)),u=(0,a.useMemo)(()=>new Map(t.cells.map(e=>["".concat(e.row,":").concat(e.col),e])),[t]),p=(n-1)*50+1,j=Math.min(d,p+49),v=Math.min(x,i+19);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3 mb-3 text-xs text-[var(--colorTextSecondary)]",children:[(0,r.jsx)("span",{children:"原工作表物理坐标;公式使用已保存缓存值"}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-2",children:["起始列 ",(0,r.jsx)(h.A,{size:"small",min:1,max:x,value:i,onChange:e=>o(null!=e?e:1)})]})]}),(0,r.jsx)(M,{zoom:s,viewportRef:l,children:(0,r.jsxs)("table",{className:"border-collapse text-xs",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 sticky top-0 left-0 z-[2]",children:"行"}),Array.from({length:v-i+1},(e,t)=>(0,r.jsxs)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 sticky top-0 z-[1] min-w-24",children:["C",i+t]},t))]})}),(0,r.jsx)("tbody",{children:Array.from({length:j-p+1},(e,s)=>{let a=p+s;return(0,r.jsxs)("tr",{className:"even:bg-[var(--colorFillAlter)]",children:[(0,r.jsxs)("th",{className:"border border-[var(--borderColor)] bg-[var(--colorFillSecondary)] px-2 py-1 text-[var(--colorTextSecondary)] sticky left-0 z-[1]",children:["R",a]}),Array.from({length:v-i+1},(e,s)=>{var l,n,c;let o=i+s,d=u.get("".concat(a,":").concat(o)),x=t.merges.find(e=>a>=e.startRow&&a<=e.endRow&&o>=e.startCol&&o<=e.endCol);if(x&&(a!==Math.max(p,x.startRow)||o!==Math.max(i,x.startCol)))return null;let h=x?u.get("".concat(x.startRow,":").concat(x.startCol)):d,m=null!=(l=null==h?void 0:h.display)?l:"";return(0,r.jsxs)("td",{className:"border border-[var(--borderColor)] px-2 py-1 whitespace-pre-wrap align-top ".concat("number"==typeof m||"string"==typeof m&&/^-?[\d,]+(\.\d+)?$/u.test(m.trim())?"text-right tabular-nums":""," ").concat(""===m?"bg-[var(--colorFillQuaternary)]":""),rowSpan:x?Math.min(j,x.endRow)-Math.max(p,x.startRow)+1:1,colSpan:x?Math.min(v,x.endCol)-Math.max(i,x.startCol)+1:1,title:"".concat(null!=(n=null==h?void 0:h.address)?n:"R".concat(a,"C").concat(o),"\n原值: ").concat(String(null!=(c=null==h?void 0:h.value)?c:"")).concat((null==h?void 0:h.formula)?"\n公式: =".concat(h.formula):""),children:[m,(null==h?void 0:h.formula)&&(0,r.jsxs)("div",{className:"text-[10px] text-[var(--colorTextTertiary)]",children:["=",h.formula]})]},o)})]},a)})})]})}),(0,r.jsx)("div",{className:"mt-3 flex justify-end",children:(0,r.jsx)(m.A,{size:"small",current:n,pageSize:50,total:d,showSizeChanger:!1,onChange:c})})]})}function F(e){let{frameIds:t,endpoint:s,zoom:l,viewportRef:c}=e,[i,o]=(0,a.useState)(0),[d,h]=(0,a.useState)(""),[m,v]=(0,a.useState)(),[g,f]=(0,a.useState)(""),[y,b]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=!0;h(""),f(""),v(void 0);let r=t[i];if(r)return b(!0),(0,k.x6)("".concat(s,"&frame=").concat(encodeURIComponent(r),"&format=json")).then(t=>{e&&(h(t.image),v(t.receipt))}).catch(t=>{e&&f(String(t))}).finally(()=>{e&&b(!1)}),()=>{e=!1}},[i,t,s]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-3",children:[(0,r.jsx)(u.A,{size:"small",className:"min-w-64",value:i,onChange:o,options:t.map((e,t)=>({value:t,label:e}))}),(0,r.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:"显示实际库内实体与块实例;绘制限制不等同数据丢失。"})]}),(0,r.jsxs)(p.A,{spinning:y,children:[g&&(0,r.jsx)(x.A,{type:"warning",message:"图框显示未完成",description:"".concat(g,";请区分已入库结构和绘制能力,已有库内文字仍可读取。")}),d?(0,r.jsx)(M,{zoom:l,viewportRef:c,children:(0,r.jsx)("div",{className:"bg-white inline-block p-2",children:(0,r.jsx)(n(),{unoptimized:!0,width:2400,height:1800,src:d,alt:"已解析CAD图框",style:{width:"100%",height:"auto",display:"block"}})})}):!y&&!g&&(0,r.jsx)(j.A,{description:"尚未识别到可显示图框"}),void 0!==m&&(0,r.jsxs)("details",{className:"mt-3",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextSecondary)]",children:"本次绘制回执与限制"}),(0,r.jsx)(T,{maxHeight:260,children:(0,r.jsx)("pre",{style:A,children:JSON.stringify(m,null,2)})})]})]})]})}function O(e){let{structure:t,endpoint:s,zoom:l,viewportRef:c}=e,[i,o]=(0,a.useState)(0);if(t.spreadsheet){let e=t.spreadsheet.sheets;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(u.A,{size:"small",className:"min-w-64",value:i,options:e.map((e,t)=>({value:t,label:e.name})),onChange:o})}),e[i]&&(0,r.jsx)(I,{sheet:e[i],zoom:l,viewportRef:c},i)]})}if(t.docx)return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(M,{zoom:l,viewportRef:c,children:(0,r.jsxs)("div",{className:"mx-auto",style:{maxWidth:860},children:[t.docx.blocks.map(e=>(0,r.jsxs)("div",{id:e.id,className:"mb-4",children:[(0,r.jsxs)("div",{className:"mb-1 text-[10px] text-[var(--colorTextTertiary)]",children:[e.part," \xb7 第 ",e.index+1," 块"]}),"table"===e.kind?(0,r.jsx)(R,{block:e,parts:t.docx.parts}):(0,r.jsx)("p",{className:e.headingLevel?"font-semibold text-lg whitespace-pre-wrap mt-2":"whitespace-pre-wrap leading-8 text-sm",children:e.text}),(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextTertiary)]",children:"来源 XML"}),(0,r.jsx)(T,{maxHeight:260,children:(0,r.jsx)("pre",{style:A,children:e.xml})})]})]},e.id)),t.docx.images.map(e=>(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("div",{className:"mb-1 text-xs text-[var(--colorTextSecondary)]",children:e.name}),/^image\/(?:png|jpeg|gif|webp|svg\+xml|bmp)$/u.test(e.mediaType)?(0,r.jsx)(n(),{unoptimized:!0,width:1200,height:900,src:"".concat(s,"&image=").concat(encodeURIComponent(e.name)),alt:e.name,style:{maxWidth:"100%",height:"auto"}}):(0,r.jsx)(x.A,{type:"info",message:"已保留".concat(e.mediaType,"图片数据,浏览器未声明支持显示")})]},e.name))]})})});if(t.pdf){var d,h,p,v;let e=t.pdf.pages,s=e[i],a=null!=(h=null!=(d=null==s?void 0:s.width)?d:null==s?void 0:s.glyphs.reduce((e,t)=>Math.max(e,t.x+t.width+20),600))?h:600,n=null!=(v=null!=(p=null==s?void 0:s.height)?p:null==s?void 0:s.glyphs.reduce((e,t)=>Math.max(e,t.y+t.height+20),800))?v:800;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3",children:[(0,r.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:"显示库内已保存文字与位置;可选原版本对照不影响本页及后续生成。"}),(0,r.jsx)(m.A,{size:"small",current:i+1,pageSize:1,total:e.length,showSizeChanger:!1,onChange:e=>o(e-1)})]}),s&&(0,r.jsxs)(M,{zoom:l,viewportRef:c,children:[(0,r.jsx)("div",{className:"mx-auto bg-white shadow-sm border border-[var(--borderColor)]",style:{width:a},children:(0,r.jsx)("svg",{viewBox:"0 0 ".concat(a," ").concat(n),width:"100%",role:"img","aria-label":"解析第".concat(s.page,"页"),children:s.glyphs.map(e=>(0,r.jsx)("text",{x:e.x,y:n-e.y,fontSize:Math.max(6,e.height),children:e.str},e.id))})}),s.ocrText&&(0,r.jsxs)("div",{className:"mt-3",children:[(0,r.jsx)("div",{className:"mb-1 text-xs text-[var(--colorTextSecondary)]",children:"该页 OCR 文本"}),(0,r.jsx)(T,{maxHeight:260,children:(0,r.jsx)("pre",{style:A,children:s.ocrText})})]}),!s.glyphs.length&&!s.ocrText&&(0,r.jsx)(j.A,{description:"该页没有可展示文字,不能据此断言原页为空"})]})]})}return t.cad?(0,r.jsx)(F,{frameIds:t.cad.frameIds,endpoint:s,zoom:l,viewportRef:c}):(0,r.jsx)(j.A,{description:"此解析结果尚无结构显示适配,完整解析文字仍可查看"})}function E(e){let{data:t}=e,s=t.conservation,a=[{key:"chars",label:"文本覆盖",value:"".concat(s.coveredNonWhitespaceChars," / ").concat(s.sourceNonWhitespaceChars," 个非空白字符"),trouble:s.coveredNonWhitespaceChars!==s.sourceNonWhitespaceChars,...s.uncovered.length?{detail:(0,r.jsxs)(r.Fragment,{children:[s.uncovered.slice(0,5).map((e,t)=>(0,r.jsxs)("div",{className:"mb-1",children:["字符 ",e.start,"–",e.end,":",e.text.slice(0,120)]},t)),s.uncovered.length>5?(0,r.jsxs)("div",{children:["…还有 ",s.uncovered.length-5," 段"]}):null]})}:{}},{key:"chunks",label:"切片数",value:"".concat(t.totalChunks," 块(库内登记 ").concat(s.registeredChunkCount,",与底稿一致:").concat(s.chunkCountMatches?"是":"否",")"),trouble:!s.chunkCountMatches},{key:"stale",label:"身份过期的切片",value:s.staleChunkIdentities.length?"".concat(s.staleChunkIdentities.length," 块"):"无",trouble:s.staleChunkIdentities.length>0,...s.staleChunkIdentities.length?{detail:(0,r.jsxs)("div",{children:["切片序号:",s.staleChunkIdentities.slice(0,20).join(", "),s.staleChunkIdentities.length>20?" …":""]})}:{}},{key:"unmapped",label:"未能映射回底稿的切片",value:s.unmapped.length?"".concat(s.unmapped.length," 块"):"无",trouble:s.unmapped.length>0,...s.unmapped.length?{detail:(0,r.jsxs)(r.Fragment,{children:[s.unmapped.slice(0,5).map(e=>(0,r.jsxs)("div",{className:"mb-1",children:["切片 ",e.chunkIndex,":",e.text.slice(0,120)]},e.chunkIndex)),s.unmapped.length>5?(0,r.jsxs)("div",{children:["…还有 ",s.unmapped.length-5," 块"]}):null]})}:{}},{key:"order",label:"切片顺序",value:s.outOfOrderChunks.length?"乱序 ".concat(s.outOfOrderChunks.length," 块"):"与底稿一致",trouble:s.outOfOrderChunks.length>0,...s.outOfOrderChunks.length?{detail:(0,r.jsxs)("div",{children:["切片序号:",s.outOfOrderChunks.slice(0,20).join(", ")]})}:{}},{key:"repeated",label:"重复上下文跨度",value:"".concat(s.repeatedContextSpans," 处"),trouble:!1}];return(0,r.jsx)("div",{className:"flex flex-col",children:a.map(e=>(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3 py-2 border-b border-[var(--colorBorderSecondary)] last:border-0",children:[(0,r.jsx)("div",{className:"sm:w-44 shrink-0 text-xs text-[var(--colorTextTertiary)] sm:pt-0.5",children:e.label}),(0,r.jsxs)("div",{className:"min-w-0 flex-1 text-sm",children:[(0,r.jsx)("span",{className:e.trouble?"text-[var(--colorError)]":"text-[var(--colorText)]",children:e.value}),e.detail&&(0,r.jsxs)("details",{className:"mt-1",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextSecondary)]",children:"展开明细"}),(0,r.jsx)(T,{maxHeight:220,children:(0,r.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:e.detail})})]})]})]},e.key))})}function P(){let e=(0,c.useRouter)(),t="string"==typeof e.query.relativePath?e.query.relativePath:"",s="string"==typeof e.query.projectRoot?e.query.projectRoot:"",[l,n]=(0,a.useState)(),[o,h]=(0,a.useState)(""),[u,N]=(0,a.useState)(!1),[w,M]=(0,a.useState)(1),[R,I]=(0,a.useState)("structure"),F=(0,a.useRef)(null),P=(0,a.useRef)(0),_=new URLSearchParams({relativePath:t,...s?{projectRoot:s}:{}}),H="/api/kb/files/source-preview?".concat(_),W="".concat(H).concat((null==l?void 0:l.status)==="recorded"?"&snapshotId=".concat(l.identity.snapshotId):""),B=(0,a.useCallback)(async e=>{let t=++P.current;N(!0),h("");try{let s=await (0,k.x6)(e);t===P.current&&n(s)}catch(e){t===P.current&&h(e instanceof Error?e.message:String(e))}finally{t===P.current&&N(!1)}},[]);(0,a.useEffect)(()=>{n(void 0),t&&B(H)},[t,H,B]);let D=null==l?void 0:l.pdfCoverage,q=D&&"complete"!==D.status?(0,r.jsx)(x.A,{showIcon:!0,type:"warning",message:"unmeasured"===D.status?"PDF 页覆盖未记录":"PDF 页覆盖不完整",description:(0,r.jsxs)(i.A,{direction:"vertical",size:2,children:[D.pageCount?(0,r.jsx)("span",{children:"已处理页:".concat(D.processedPages,"/").concat(D.pageCount)}):(0,r.jsx)("span",{children:'没有记录到声明页数,无法据此断言"处理了几页"。'}),D.missingPages.length>0&&(0,r.jsx)("span",{children:"缺少页:".concat(D.missingPages.join(", "))}),D.failedPages.length>0&&(0,r.jsx)("span",{children:"失败页:".concat(D.failedPages.join(", "))}),(0,r.jsx)("span",{children:"这条读数只说明解析侧处理了哪些页,不证明内容、版式或专业采用正确。"})]})}):null;return(0,r.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,r.jsx)(S.k,{backHref:"/knowledge/file-detail?".concat(_),backLabel:"返回切片详情",title:"解析核查预览",description:t,extra:(0,r.jsxs)(i.A,{wrap:!0,children:["structure"===R&&(0,r.jsx)(z,{zoom:w,onChange:M,viewportRef:F}),(0,r.jsx)(d.Ay,{size:"small",icon:(0,r.jsx)(C.A,{}),onClick:()=>{B(H)},loading:u,children:"刷新"})]})}),o&&(0,r.jsx)(x.A,{type:"error",message:o}),(0,r.jsx)(p.A,{spinning:u,children:(null==l?void 0:l.status)==="not-recorded"?(0,r.jsxs)(v.A,{className:"rounded-2xl border-[var(--borderColor)]",children:[(0,r.jsx)(x.A,{type:"warning",message:"独立解析底稿尚未记录",description:l.reason}),q&&(0,r.jsx)("div",{className:"mt-3",children:q}),(0,r.jsx)(d.Ay,{className:"mt-4",onClick:()=>{(async()=>{try{await (0,k.HC)(t,s||void 0),h("重新解析任务已提交,请在处理完成后刷新本页。")}catch(e){h(String(e))}})()},children:"重新解析此文件"}),(0,r.jsx)("p",{className:"mt-4 mb-2 text-sm text-[var(--colorTextSecondary)]",children:"当前实际库内切片(不是独立底稿):"}),l.chunks.map(e=>(0,r.jsxs)("div",{className:"my-3",children:[(0,r.jsxs)(g.A,{children:["切片 ",e.chunkIndex]}),(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:e.content})})]},e.id)),(0,r.jsx)("div",{className:"mt-3 flex justify-end",children:(0,r.jsx)(m.A,{current:Math.floor(l.offset/30)+1,pageSize:30,total:l.totalChunks,showSizeChanger:!1,onChange:e=>{B("".concat(H,"&offset=").concat((e-1)*30))}})})]}):(null==l?void 0:l.status)==="recorded"?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(v.A,{className:"rounded-2xl border-[var(--borderColor)] mb-5",children:[(0,r.jsx)(E,{data:l}),(0,r.jsx)("p",{className:"mt-3 mb-0 text-xs text-[var(--colorTextSecondary)]",children:"这项检查只证明独立解析文字与切片的内容覆盖,不证明原文件解析、版式、工程理解或专业采用全部正确。"}),q&&(0,r.jsx)("div",{className:"mt-3",children:q}),l.identity.limitations.map(e=>(0,r.jsx)("p",{className:"mt-2 mb-0 text-xs text-[var(--colorTextSecondary)]",children:e},e)),(0,r.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[(0,r.jsx)(d.Ay,{size:"small",href:"".concat(W,"&original=1"),target:"_blank",children:"查看/下载入库原版本"}),(0,r.jsx)(d.Ay,{size:"small",onClick:()=>{(0,k.tn)(t,"source-version",s||void 0).catch(e=>h("可选原版本对照不可用:".concat(String(e),";库内数据仍可读取")))},children:"本机打开入库原版本"})]}),(0,r.jsxs)("details",{className:"mt-4",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextSecondary)]",children:"技术详情(原文件哈希 / 解析版本 / 解析身份 / 核查口径)"}),(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsxs)(f.A,{size:"small",column:1,bordered:!0,styles:{label:{width:"120px",background:"var(--colorFillAlter)",color:"var(--colorTextSecondary)"}},children:[(0,r.jsx)(f.A.Item,{label:"原文件SHA256",children:(0,r.jsx)("span",{className:"break-all text-xs",children:l.identity.sourceHash})}),(0,r.jsx)(f.A.Item,{label:"解析版本",children:(0,r.jsx)("span",{className:"text-xs",children:l.identity.parserVersion})}),(0,r.jsx)(f.A.Item,{label:"解析身份",children:(0,r.jsx)("span",{className:"break-all text-xs",children:l.identity.snapshotId})}),(0,r.jsx)(f.A.Item,{label:"核查口径",children:(0,r.jsxs)("span",{className:"text-xs",children:[l.conservation.version," \xb7 ",l.conservation.scope," \xb7 入库状态 ",l.conservation.ingestionStatus]})}),(0,r.jsx)(f.A.Item,{label:"底稿快照",children:(0,r.jsx)("span",{className:"break-all text-xs",children:l.conservation.snapshotId})})]})})]})]}),(0,r.jsx)(y.A,{className:"documents-tabs",activeKey:R,onChange:I,items:[{key:"structure",label:"解析结构",children:(0,r.jsx)(v.A,{className:"rounded-2xl border-[var(--borderColor)]",onWheelCapture:e=>{(e.ctrlKey||e.metaKey)&&(e.preventDefault(),M(t=>Math.min(4,Math.max(.2,Math.round((t-.1*Math.sign(e.deltaY))*100)/100))))},children:(0,r.jsx)(O,{structure:l.structure,endpoint:W,zoom:w,viewportRef:F},l.identity.snapshotId)})},{key:"chunks",label:"实际切片重组",children:(0,r.jsxs)(v.A,{className:"rounded-2xl border-[var(--borderColor)]",children:[(0,r.jsxs)("p",{className:"text-xs text-[var(--colorTextSecondary)]",children:["当前展示切片 ",l.offset+1," 至 ",l.offset+l.chunks.length,",共 ",l.totalChunks," 块;分页不代表其余内容不存在。"]}),l.chunks.map(e=>(0,r.jsxs)("div",{className:"my-4",children:[(0,r.jsxs)(i.A,{size:4,wrap:!0,children:[(0,r.jsxs)(g.A,{children:["切片 ",e.chunkIndex]}),e.sectionTitle?(0,r.jsx)(g.A,{color:"cyan",children:e.sectionTitle}):null]}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(T,{children:(0,r.jsx)("pre",{style:A,children:e.content})})}),(0,r.jsxs)("details",{className:"mt-2",children:[(0,r.jsx)("summary",{className:"text-xs cursor-pointer text-[var(--colorTextTertiary)]",children:"库内解析底稿区间"}),(0,r.jsx)(T,{maxHeight:240,children:(0,r.jsx)("pre",{style:A,children:JSON.stringify(e.sourceSpans,null,2)})})]})]},e.id)),(0,r.jsx)("div",{className:"mt-3 flex justify-end",children:(0,r.jsx)(m.A,{current:Math.floor(l.offset/30)+1,pageSize:30,total:l.totalChunks,showSizeChanger:!1,onChange:e=>{B("".concat(W,"&offset=").concat((e-1)*30))}})})]})}]})]}):u?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)(b.A,{active:!0,title:!1,paragraph:{rows:3}}),(0,r.jsx)(b.A,{active:!0,title:!1,paragraph:{rows:6}})]}):(0,r.jsx)(j.A,{description:"选择文件后查看解析结果"})})]})}},59528:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/knowledge/source-preview",function(){return s(2232)}])},85979:(e,t,s)=>{"use strict";s.d(t,{k:()=>c});var r=s(65321),a=s(43220),l=s.n(a),n=s(91648);function c(e){let{backHref:t,backLabel:s,title:a,description:c,extra:i}=e;return(0,r.jsx)("div",{className:"mb-6 bg-[var(--colorBgContainer)] rounded-2xl overflow-hidden border border-[var(--borderColor)] p-6",children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-4 md:gap-6",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,r.jsxs)(l(),{href:t,prefetch:!1,className:"detailBack",children:[(0,r.jsx)(n.A,{size:16,strokeWidth:2,"aria-hidden":!0}),(0,r.jsx)("span",{children:s})]}),(0,r.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-[var(--colorText)] m-0 truncate",children:a}),c?(0,r.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0 break-all",children:c}):null]})]}),i?(0,r.jsx)("div",{className:"shrink-0 flex items-center gap-2",children:i}):null]})})}}},e=>{e.O(0,[6409,1702,5544,9551,4665,1499,8569,8787,5046,8318,7955,636,6593,8792],()=>e(e.s=59528)),_N_E=e.O()}]);
|