@customize-agent/server 4.60.31 → 4.60.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +34 -31
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/required-server-files.json +1 -1
  5. package/.next/server/chunks/1243.js +1 -1
  6. package/.next/server/chunks/1936.js +8 -8
  7. package/.next/server/chunks/2328.js +1 -1
  8. package/.next/server/chunks/6321.js +1 -1
  9. package/.next/server/chunks/6822.js +1 -1
  10. package/.next/server/chunks/{4722.js → 7848.js} +27 -27
  11. package/.next/server/chunks/8204.js +1 -1
  12. package/.next/server/chunks/9666.js +56 -55
  13. package/.next/server/instrumentation.js +1 -1
  14. package/.next/server/instrumentation.js.nft.json +1 -1
  15. package/.next/server/middleware-build-manifest.js +1 -1
  16. package/.next/server/pages/404.html +1 -1
  17. package/.next/server/pages/500.html +1 -1
  18. package/.next/server/pages/api/config/embedding/healthCheck.js +2 -1
  19. package/.next/server/pages/api/config/embedding.js +2 -1
  20. package/.next/server/pages/api/config/healthCheck.js +2 -1
  21. package/.next/server/pages/api/config/models.js +2 -1
  22. package/.next/server/pages/api/config/providers/[provider].js +2 -1
  23. package/.next/server/pages/api/config/providers.js +2 -1
  24. package/.next/server/pages/api/config/reset.js +3 -0
  25. package/.next/server/pages/api/config/reset.js.nft.json +1 -0
  26. package/.next/server/pages/api/config/web-access.js +2 -1
  27. package/.next/server/pages/api/documents/export.js +1 -1
  28. package/.next/server/pages/api/documents/generate/preview.js +1 -1
  29. package/.next/server/pages/api/documents/generate.js +1 -1
  30. package/.next/server/pages/api/documents/generated/[id]/repair/[rid]/confirm.js +1 -1
  31. package/.next/server/pages/api/health.js +1 -1
  32. package/.next/server/pages/api/kb/features.js +2 -1
  33. package/.next/server/pages/api/prompt/chat.js +3 -2
  34. package/.next/server/pages/api/system/reset.js +1 -1
  35. package/.next/server/pages/canvas/[id].html +1 -1
  36. package/.next/server/pages/canvas.html +1 -1
  37. package/.next/server/pages/documents.html +1 -1
  38. package/.next/server/pages/guide.html +1 -1
  39. package/.next/server/pages/index.html +1 -1
  40. package/.next/server/pages/jobs.html +1 -1
  41. package/.next/server/pages/knowledge/file-detail.html +1 -1
  42. package/.next/server/pages/knowledge/files.html +1 -1
  43. package/.next/server/pages/knowledge/manage.html +1 -1
  44. package/.next/server/pages/knowledge/source-preview.html +1 -1
  45. package/.next/server/pages/knowledge.html +1 -1
  46. package/.next/server/pages/models.html +1 -1
  47. package/.next/server/pages/overview.html +1 -1
  48. package/.next/server/pages/prompt.html +1 -1
  49. package/.next/server/pages/settings.html +1 -1
  50. package/.next/server/pages/skills/[id]/edit.html +1 -1
  51. package/.next/server/pages/skills/[id]/edit.js.nft.json +1 -1
  52. package/.next/server/pages/skills/[id].html +1 -1
  53. package/.next/server/pages/skills/[id].js.nft.json +1 -1
  54. package/.next/server/pages/skills/new.html +1 -1
  55. package/.next/server/pages/skills/new.js.nft.json +1 -1
  56. package/.next/server/pages/skills.html +1 -1
  57. package/.next/server/pages/system/logs.html +1 -1
  58. package/.next/server/pages-manifest.json +34 -33
  59. package/.next/static/84adacede7ff442362a497aa3e621351f0c7ab051b72c5c491f09a03bf4751e3/_buildManifest.js +1 -0
  60. package/.next/static/chunks/1141-d420a7685bc3623c.js +1 -0
  61. package/.next/static/chunks/2864-b040f2bffa08c139.js +6 -0
  62. package/.next/static/chunks/3456-70bb03a39473f693.js +1 -0
  63. package/.next/static/chunks/3980-73841c40d55ddfa1.js +1 -0
  64. package/.next/static/chunks/4337-a670a1a94ab505d9.js +1 -0
  65. package/.next/static/chunks/4530-8b9788da40548ec6.js +1 -0
  66. package/.next/static/chunks/6506-ac0ba7338cc84b7d.js +1 -0
  67. package/.next/static/chunks/6748-07b0b05bf03c72f0.js +1 -0
  68. package/.next/static/chunks/9937-e4b2deadd24e3962.js +1 -0
  69. package/.next/static/chunks/pages/{_app-73e5b40b24a7fe7d.js → _app-51c48c5efcf5c721.js} +13 -13
  70. package/.next/static/chunks/pages/canvas/{[id]-45da860b862e0743.js → [id]-18865f1b7e3a4696.js} +1 -1
  71. package/.next/static/chunks/pages/canvas-1d3589790493e955.js +1 -0
  72. package/.next/static/chunks/pages/knowledge/file-detail-3d1ffd43f4f0e47b.js +1 -0
  73. package/.next/static/chunks/pages/knowledge/{source-preview-40ff4936b832787e.js → source-preview-24936b9a746ed07f.js} +1 -1
  74. package/.next/static/chunks/pages/models-8a89dd5bf0f81242.js +1 -0
  75. package/.next/static/chunks/pages/skills/[id]/{edit-35892def57c4975f.js → edit-99e616d5019e80b1.js} +1 -1
  76. package/.next/static/chunks/pages/skills/[id]-71f696be252bbf0d.js +1 -0
  77. package/.next/static/chunks/pages/skills/{new-a279e6ca2f7aded7.js → new-00886ea4c676f927.js} +1 -1
  78. package/.next/static/css/9eb02c1a401fd278.css +1 -0
  79. package/messages/en-US.json +13 -1
  80. package/messages/zh-CN.json +13 -1
  81. package/package.json +4 -4
  82. package/scripts/brand-moon-fit.cjs +0 -47
  83. package/scripts/generate-brand-assets.cjs +0 -41
  84. package/scripts/half-built-scan.allow.json +16 -6
  85. package/scripts/half-built-scan.baseline.json +2 -17
  86. package/scripts/half-built-scan.mjs +1 -84
  87. package/.next/server/chunks/6021.js +0 -1
  88. package/.next/static/0fdab21c22b65a3042c22ee4ac8e49fbfd22e365df64d5e9b709ccb05aecf02e/_buildManifest.js +0 -1
  89. package/.next/static/chunks/2378-c6d25abe02815666.js +0 -1
  90. package/.next/static/chunks/2864-67ba808c5092c2f9.js +0 -6
  91. package/.next/static/chunks/3456-8b609f8475ae5030.js +0 -1
  92. package/.next/static/chunks/4530-e73bdd645bb7a953.js +0 -1
  93. package/.next/static/chunks/5046-abead1022185a99a.js +0 -1
  94. package/.next/static/chunks/5257-915621e439b56580.js +0 -1
  95. package/.next/static/chunks/6505-012e90937e1e8dae.js +0 -1
  96. package/.next/static/chunks/6748-04b5429330e1451e.js +0 -1
  97. package/.next/static/chunks/7955-3a7ee8cda4f857b9.js +0 -1
  98. package/.next/static/chunks/pages/canvas-a15773d02c97b7a6.js +0 -1
  99. package/.next/static/chunks/pages/knowledge/file-detail-5859f0c25af34ffe.js +0 -1
  100. package/.next/static/chunks/pages/models-0aaff5bfadc7b62f.js +0 -1
  101. package/.next/static/chunks/pages/skills/[id]-19c352e150e05c27.js +0 -1
  102. package/.next/static/css/837ac5def44e2eba.css +0 -1
  103. package/scripts/capture-baseline.mjs +0 -353
  104. /package/.next/static/{0fdab21c22b65a3042c22ee4ac8e49fbfd22e365df64d5e9b709ccb05aecf02e → 84adacede7ff442362a497aa3e621351f0c7ab051b72c5c491f09a03bf4751e3}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4530],{8090:(e,t,n)=>{n.d(t,{EL:()=>et,zT:()=>ee,II:()=>$,bJ:()=>eo,Jr:()=>V,O0:()=>eh,uj:()=>H,GC:()=>U,qj:()=>es,x8:()=>Z,Kg:()=>el,uH:()=>ep,Qs:()=>J,PI:()=>ei,dB:()=>eg,Jy:()=>em,uv:()=>O,vp:()=>Q,m_:()=>P,kH:()=>K,z9:()=>X,Aq:()=>ed,RV:()=>ec,Kq:()=>en});var r=n(97109),l=n(84662),a=n(30486),o=n(4527),i=n(80042),c=n(99650),s=n(25345),u=n(7851),d=n(33555),m=n(43240),p=n(26619),f=n(23216),h=n(46791),g=n(8579),v=n(26631),x=n(35459),y=n(64629),w=n(76824),b=n(83374),k=n(81668),j=n(39356),A=n(8263),I=n(61024),S=n(32919),M=n(96538);let C=["failed","paused","repairing","blocked","running","pending","completed"],E=["chars","costUsd"];function R(e,t){return e.seq!==t.seq?e.seq-t.seq:e.id===t.id?0:e.id<t.id?-1:1}function N(e){let t=new Map;for(let n of e){if(void 0===n.parentId)continue;let e=t.get(n.parentId);e?e.push(n):t.set(n.parentId,[n])}for(let e of t.values())e.sort(R);return t}function _(e){let t=new Map(e.map(e=>[e.id,e])),n=new Map;for(let r of e){let e=0,l=r,a=new Set([r.id]);for(;(null==l?void 0:l.parentId)!==void 0;){let n=t.get(l.parentId);if(!n||a.has(n.id))break;a.add(n.id),e+=1,l=n}n.set(r.id,e)}return n}let T=new Set(["prepare","understand","plan","blueprint","write","close","deliver","chapter","block","turn","round","round.decide","round.fix","repair.request","repair.localize","repair.impact","repair.transaction","repair.recheck","supervisor","resume.plan","skill.load"]),B=new Set(["failed","paused","repairing","blocked","running","pending","completed"]);var D=n(94394);let q={pending:{key:"common.statusWaiting",text:"等待中",color:"default"},running:{key:"common.statusRunning",text:D.uh.running,color:"processing"},completed:{key:"common.statusCompleted",text:D.uh.success,color:"success"},paused:{key:"common.statusPaused",text:"已暂停",color:"gold"},repairing:{key:"common.statusRepairing",text:"修复中",color:"warning"},blocked:{key:"common.statusBlocked",text:"已放弃(阻塞)",color:"warning"},failed:{key:"common.statusAbnormal",text:"异常",color:"error"}};function z(e,t,n,r){let l=e[t];if(!l)return"未知".concat(n,"(").concat(t||"空",")");if(l.key&&r){let e=r(l.key);if(e&&e!==l.key)return e}return l.text}function P(e,t){return z(q,e,"状态",t)}function O(e){var t,n;return null!=(n=null==(t=q[e])?void 0:t.color)?n:"default"}let F={queued:{key:"common.statusWaiting",text:"排队中",color:"default"},generating:{key:"common.statusRunning",text:"生成中",color:"processing"},paused:{key:"common.statusPaused",text:"已暂停",color:"gold"},completed:{key:"common.statusCompleted",text:"已完成",color:"success"},completed_with_issues:{key:"common.statusReview",text:"完成(有需复核项)",color:"warning"},warning:{key:"common.statusReview",text:"需复核",color:"warning"},failed:{key:"common.statusAbnormal",text:"失败",color:"error"},aborted:{key:"common.statusAbnormal",text:"已中止",color:"default"}};function U(e,t){return z(F,e,"记录状态",t)}function H(e){var t,n;return null!=(n=null==(t=F[e])?void 0:t.color)?n:"default"}let L=["failed","paused","repairing","blocked","running","pending","completed"];function Q(e){let t=L.indexOf(e);return t>=0?t:L.length}let Y={prepare:"生成准备",understand:"资料理解",plan:"规划",blueprint:"蓝图",write:"正文撰写",close:"收口",deliver:"交付",chapter:"章节",block:"块",turn:"轮次",round:"收口轮","round.decide":"收口\xb7判定","round.fix":"收口\xb7修复","repair.request":"修复\xb7请求","repair.localize":"修复\xb7定位","repair.impact":"修复\xb7影响面","repair.transaction":"修复\xb7事务","repair.recheck":"修复\xb7复检","skill.load":"技能命中",supervisor:"调度决策","resume.plan":"续跑任务书"};function X(e){var t;return e?null!=(t=Y[e])?t:e:"未知节点"}let G={role_binding:(0,r.createElement)(l.A),knowledge_retrieval:(0,r.createElement)(a.A),file_understanding:(0,r.createElement)(o.A),fact_extraction:(0,r.createElement)(i.A),chapter_generation:(0,r.createElement)(c.A),llm_review:(0,r.createElement)(s.A),validation:(0,r.createElement)(u.A),reference:(0,r.createElement)(d.A),prepare:(0,r.createElement)(m.A),understand:(0,r.createElement)(p.A),plan:(0,r.createElement)(f.A),blueprint:(0,r.createElement)(h.A),write:(0,r.createElement)(g.A),chapter:(0,r.createElement)(v.A),block:(0,r.createElement)(x.A),turn:(0,r.createElement)(y.A),round:(0,r.createElement)(w.A),close:(0,r.createElement)(b.A),deliver:(0,r.createElement)(k.A),repair:(0,r.createElement)(j.A),skill:(0,r.createElement)(A.A),supervisor:(0,r.createElement)(I.A),resume:(0,r.createElement)(S.A),default:(0,r.createElement)(m.A)};function K(e){var t;return null!=(t=G[e.split(".")[0]||e])?t:G.default}function J(e){var t;return null!=(t=G[e])?t:G.default}function W(e){var t,n;let r=e.issues;return{id:e.id,...void 0!==e.parentId?{parentId:e.parentId}:{},type:e.type||"block",title:null!=(t=e.title)?t:"",seq:"number"==typeof e.seq&&Number.isFinite(e.seq)?e.seq:0,status:"string"==typeof(n=e.status)&&B.has(n)?e.status:"failed",startedAt:"number"==typeof e.startedAt&&Number.isFinite(e.startedAt)&&e.startedAt>0?e.startedAt:0,...void 0!==e.completedAt?{completedAt:e.completedAt}:{},...e.progress?{progress:e.progress}:{},...e.metrics?{metrics:e.metrics}:{},...Array.isArray(r)&&r.length>0?{issues:r}:{},...void 0!==e.payloadRef?{payloadRef:e.payloadRef}:{}}}function V(e,t){let n=new Map(e.map(e=>[e.id,e]));return(function(e,t){let n=function(e){let t=N(e),n=_(e),r=[...e].sort((e,t)=>{var r,l;return(null!=(r=n.get(t.id))?r:0)-(null!=(l=n.get(e.id))?l:0)||R(e,t)}),l=new Map(e.map(e=>[e.id,e]));for(let e of r){let n=t.get(e.id);if(!n||0===n.length)continue;let r=n.map(e=>{var t;return null!=(t=l.get(e.id))?t:e});l.set(e.id,function(e,t){var n,r,l;if(0===t.length)return{...e};let a=[...t].sort(R),o={...null!=(r=e.metrics)?r:{}};for(let t of E){let n=function(e,t,n){var r,l;let a=0,o=!1,i=null==(r=e.metrics)?void 0:r[n];for(let e of("number"==typeof i&&Number.isFinite(i)&&(a+=i,o=!0),t)){let t=null==(l=e.metrics)?void 0:l[n];"number"==typeof t&&Number.isFinite(t)&&(a+=t,o=!0)}return o?a:void 0}(e,a,t);void 0===n?delete o[t]:o[t]=n}let i=null==(n=e.progress)?void 0:n.label,c={current:a.filter(e=>"completed"===e.status).length,total:a.length,...void 0!==i?{label:i}:{}},s=function(e){let t=new Set,n=[];for(let l of e){var r;let e=null==(r=l.provenance)?void 0:r.fingerprint;if("string"==typeof e&&e.length>0){if(t.has(e))continue;t.add(e)}n.push(l)}return n}(a.flatMap(e=>{var t;return null!=(t=e.issues)?t:[]})),u=null!=(l=function(e){let t,n=1/0;for(let r of e){let e=function(e){let t=C.indexOf(e);return t>=0?t:0}(r);e<n&&(n=e,t=r)}return t}(a.map(e=>e.status)))?l:e.status;return{...e,status:u,progress:c,...Object.keys(o).length>0?{metrics:o}:{},...s.length>0?{issues:s}:{}}}(e,r))}return[...e].sort(R).map(e=>{var t;return null!=(t=l.get(e.id))?t:e})}(e),r=N(n),l=new Set(n.map(e=>e.id)),a=1/0,o=(e,t)=>{var n;let l=t+1<a?(null!=(n=r.get(e.id))?n:[]).filter(t=>t.id!==e.id).map(e=>o(e,t+1)):[];return{...e,children:l}},i=n.filter(e=>void 0===e.parentId||!l.has(e.parentId)).sort(R).map(e=>o(e,0)),c=new Set,s=e=>{for(let t of e)c.add(t.id),s(t.children)};for(let e of(s(i),n))c.has(e.id)||i.push(o(e,0));return i})(function(e,t){if(void 0===t)return[...e];let n=_(e),r=Math.max(0,Math.floor(t));return e.filter(e=>{var t;return(null!=(t=n.get(e.id))?t:0)<r})}(e.map(W),t)).map(e=>(function e(t,n){var r,l;let a=n.get(t.id),o=null!=(r=null==a?void 0:a.type)?r:String(t.type),i=t.issues;return{id:t.id,...void 0!==t.parentId?{parentId:t.parentId}:{},type:o,unknownType:!("string"==typeof o&&T.has(o)),title:t.title||X(o),seq:t.seq,status:t.status,..."number"==typeof t.startedAt&&t.startedAt>0?{startedAt:t.startedAt}:{},...void 0!==t.completedAt?{completedAt:t.completedAt}:{},...t.progress?{progress:t.progress}:{},metrics:null!=(l=t.metrics)?l:{},issues:Array.isArray(i)?i:[],...void 0!==t.payloadRef?{payloadRef:t.payloadRef}:{},children:t.children.map(t=>e(t,n))}})(e,n))}function Z(e){let t=[],n=e=>{for(let r of e)t.push(r),n(r.children)};return n(e),t.sort(R)}function $(e,t){let n=[],r=(e,l)=>{for(let a of e){if(a.id===t)return n.push(...l),!0;if(r(a.children,[...l,a.id]))return!0}return!1};return r(e,[]),n}let ee=236,et=76;function en(e,t){var n;if(!t)return e;let r=new Map(e),l=null!=(n=r.get(t.id))?n:{dx:0,dy:0};return r.set(t.id,{dx:l.dx+t.dx,dy:l.dy+t.dy}),r}let er=new Set(["running","repairing"]);function el(e){let t=new Set(e.nodes.filter(e=>er.has(e.node.status)).map(e=>e.node.id));if(0===t.size)return ea;let n=new Set;for(let r of e.edges)t.has(r.fromId)&&n.add(r.id);return n}let ea=new Set;function eo(e,t){if(0===t.size)return e;let n=e.nodes.map(e=>{let n=t.get(e.node.id);return n?{...e,x:e.x+n.dx,y:e.y+n.dy}:e}),r=e.edges.map(e=>{var n,r,l,a;let o=t.get(e.fromId),i=t.get(e.toId);return o||i?{...e,x1:e.x1+(null!=(n=null==o?void 0:o.dx)?n:0),y1:e.y1+(null!=(r=null==o?void 0:o.dy)?r:0),x2:e.x2+(null!=(l=null==i?void 0:i.dx)?l:0),y2:e.y2+(null!=(a=null==i?void 0:i.dy)?a:0)}:e});return{...e,nodes:n,edges:r}}function ei(e){let t=[],n=[],r=0,l=(e,a)=>{let o,i=e.children,c=40+a*(ee+72),s=i.map(e=>({id:e.id,...l(e,a+1)}));for(let l of(0===s.length?(o=40+r*(et+22),r+=1):o=(s[0].y+s[s.length-1].y)/2,t.push({node:e,x:c,y:o,depth:a}),s))n.push({id:"".concat(e.id,"->").concat(l.id),fromId:e.id,toId:l.id,x1:c+ee/2,y1:o+et,x2:l.x+ee/2,y2:l.y});return{x:c,y:o}};for(let t of e)l(t,0),r+=1;let a=t.reduce((e,t)=>Math.max(e,t.x+ee),0),o=t.reduce((e,t)=>Math.max(e,t.y+et),0);return{nodes:t,edges:n,width:a+40,height:o+40}}function ec(e,t){let n=["影响面:".concat(t.kind),"波及 ".concat(t.affectedNodeIds.length," 个节点"),...t.escalate?["超出阈值需人工确认"]:[],...t.rollbackable?[]:["不可回滚:按 11.1 需回滚或重新校准,不得当普通改动提交"]];return"请修复节点「".concat(e,"」(").concat(n.join(","),")")}function es(e,t){let n=t>0?t:1;return{dx:e.dx/n,dy:e.dy/n}}let eu=(e,t)=>e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top;function ed(e){var t;let{node:n,view:r,box:l,panelWidth:a,panelHeight:o,gap:i=12,margin:c=8,obstacles:s=[]}=e,u=(e,t,n)=>Math.min(Math.max(e,t),Math.max(t,n)),d=Math.min(a,Math.max(0,l.width-2*c)),m=n.x*r.k+r.x,p=n.y*r.k+r.y,f=p+et*r.k,h={left:m,top:p,right:m+ee*r.k,bottom:f},g=l.width-d-c,v=(e,t)=>{let n=s.filter(n=>n.top>=t&&n.left<e+d&&n.right>e).map(e=>e.top-i);return Math.max(0,Math.min(l.height-c,...n,l.height-c)-t)},x=e=>{let t=l.height-e-c,n=(n,r)=>{if(n<c||r<c||n>g||r>t)return!1;let l={left:n,top:r,right:n+d,bottom:r+e};return!s.some(e=>eu(l,e))},a=m+(ee+i)*r.k,o=m-d-i*r.k,x=f+i,y=p-e-i;for(let[e,t]of[[a,x],[a,y],[o,x],[o,y]])if(n(e,t))return{left:e,top:t,maxHeight:Math.max(0,Math.min(v(e,t),l.height-t-c))};let w=[a,o,c,g],b=[x,y,c,t,...s.flatMap(t=>[t.bottom+i,t.top-e-i])],k=null,j=1/0;for(let r of w)for(let l of b){let a=u(r,c,g),o=u(l,c,Math.max(c,t));if(!n(a,o))continue;let i={left:a,top:o,right:a+d,bottom:o+e},s=Math.max(Math.max(0,h.left-i.right,i.left-h.right),Math.max(0,h.top-i.bottom,i.top-h.bottom))+1e3*!!eu(i,h);s<j&&(j=s,k={left:a,top:o})}return k?{...k,maxHeight:v(k.left,k.top)}:null};if(e.pin){let t=u(e.pin.left,c,g),n=u(e.pin.top,c,Math.max(c,l.height-2*c));return{left:t,top:n,maxHeight:Math.max(0,Math.min(v(t,n),l.height-n-c))}}let y=Math.min(o,Math.max(0,l.height-2*c)),w=x(y);if(w)return w;let b=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=e.height-n,l=t.map(e=>({start:Math.max(n,e.top),end:Math.min(r,e.bottom)})).filter(e=>e.end>e.start).sort((e,t)=>e.start-t.start),a=0,o=n;for(let e of l)e.start>o&&(a=Math.max(a,e.start-o)),o=Math.max(o,e.end);return Math.max(a,r-o)}(l,s,c)-i;if(b>0&&b<y){let e=x(Math.max(120,b));if(e)return e}return null!=(t=null!=w?w:x(Math.max(120,b)))?t:{left:u(m+(ee+i)*r.k,c,g),top:c,maxHeight:Math.max(0,l.height-2*c)}}function em(e){var t;if("number"!=typeof e.startedAt||(null==(t=e.metrics)?void 0:t.instantEvent)===!0)return;let n=("number"==typeof e.completedAt?e.completedAt:Date.now())-e.startedAt;return n>=0?n:void 0}function ep(e){return void 0===e?"—":(0,M.a)(e,{unit:"ms",style:"fine"})}let ef=[{key:"note",format:e=>String(e)},{key:"chars",format:e=>"".concat(Number(e).toLocaleString()," 字")},{key:"turn",format:e=>"第 ".concat(e," 轮")},{key:"residual",format:e=>"残余 ".concat(e)},{key:"toolCalls",format:e=>"工具 ".concat(e," 次")},{key:"attempt",format:e=>"第 ".concat(e," 次尝试")},{key:"failureKinds",format:e=>String(e)},{key:"chapters",format:e=>"".concat(e," 章")},{key:"facts",format:e=>"".concat(e," 条事实")}];function eh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=[];for(let{key:r,format:l}of ef){let a=e[r];if(void 0===a||""===a||!1===a)continue;let o=l(a);if(o.trim()&&(n.push(o),n.length>=t))break}return n}function eg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6;return Object.entries(e).slice(0,t).map(e=>{let[t,n]=e;return{key:t,text:"number"==typeof n?"".concat(t,": ").concat(Number.isInteger(n)?n:n.toFixed(2)):"".concat(t,": ").concat(String(n))}})}},8665:(e,t,n)=>{n.d(t,{_:()=>x});var r=n(65321),l=n(97109),a=n(48399),o=n(33442),i=n(14932),c=n(11702),s=n(85114),u=n(55897),d=n(57271),m=n(7576),p=n(96651),f=n(60470),h=n(54746),g=n(7492);let{Text:v}=a.A;function x(e){let{value:t,onChange:n,onSend:a,generating:x,submitting:y,disabled:w,disabledReason:b,selectedNode:k,onMentionSelected:j,resumable:A,onContinue:I,quickActions:S,requireGenerationSetup:M=!1,promptOptions:C=[],projectOptions:E=[],selectedPrompts:R=[],selectedProject:N=null,onSelectPrompts:_,onSelectProject:T,onPreviewStructure:B,collapsed:D=!1,onToggleCollapsed:q}=e,[z,P]=(0,l.useState)(!D);(0,l.useEffect)(()=>{if(!D)return void P(!0);let e=window.setTimeout(()=>P(!1),200);return()=>window.clearTimeout(e)},[D]);let O=(0,l.useRef)(null);(0,l.useEffect)(()=>{var e;D||null==(e=O.current)||e.focus()},[D,z]);let[F,U]=(0,l.useState)(!1),H=M?[0===R.length?"提示词":"",!N?"项目":""].filter(Boolean):[],L=H.length>0,Q=w?b||"当前不可发起生成":L?"请先用左侧「+」选择".concat(H.join(" 与 "),"——未选齐时不能发起生成"):x?"有任务正在运行:发送将加入生成队列(前面任务完成后自动开始)":"发送后将创建生成任务,画布随节点日志实时增长";return(0,r.jsxs)("div",{className:"canvasInputBar".concat(D&&!z?" canvasInputBarCollapsed":""),children:[(0,r.jsx)("div",{className:"canvasInputHandleRow",children:(0,r.jsx)("button",{type:"button",className:"canvasInputHandle","aria-expanded":!D||!!z,"aria-label":D&&!z?"展开输入框":"收起输入框",onClick:()=>null==q?void 0:q(!(D&&!z)),children:D&&!z?(0,r.jsx)(p.A,{}):(0,r.jsx)(f.A,{})})}),z&&(0,r.jsxs)("div",{className:"canvasInputPanel".concat(D?" isLeaving":""),children:[(0,r.jsxs)(o.A,{wrap:!0,size:6,style:{marginBottom:6},children:[k&&(0,r.jsx)(i.A,{title:"把「@".concat(k.title,"」插入输入框(可见文本,可自行修改)"),children:(0,r.jsx)(c.A,{color:"blue",style:{cursor:"pointer"},onClick:j,children:"@ ".concat(k.title)})}),!k&&(0,r.jsx)(v,{type:"secondary",style:{fontSize:12},children:"点选一个节点后可 @ 提及它"}),A&&!x&&(0,r.jsx)(s.Ay,{size:"small",type:"link",onClick:I,children:"继续生成"}),null==S?void 0:S.map(e=>(0,r.jsx)(s.Ay,{size:"small",type:"link",onClick:e.onClick,children:e.label},e.key))]}),(0,r.jsxs)(o.A,{wrap:!0,size:10,style:{marginBottom:8},children:[(0,r.jsx)(u.A,{trigger:"click",placement:"topLeft",open:F,onOpenChange:U,content:(0,r.jsxs)("div",{style:{width:360,display:"flex",flexDirection:"column",gap:8},children:[M&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(v,{strong:!0,style:{fontSize:13},children:"提示词"}),(0,r.jsx)(d.A,{mode:"multiple",style:{width:"100%",marginTop:4},value:R.map(e=>e.value),placeholder:0===C.length?"该项目暂无提示词":"选择提示词(至少一份;可多选)",options:C,onChange:e=>null==_?void 0:_(e)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(v,{strong:!0,style:{fontSize:13},children:"项目"}),(0,r.jsx)(d.A,{style:{width:"100%",marginTop:4},value:null==N?void 0:N.value,showSearch:!0,optionFilterProp:"label",placeholder:0===E.length?"本项目知识库里还没有资料:先到知识库页上传并入库":"选择项目(= 知识库里这个项目的资料,决定本次用哪份材料)",options:E,onChange:e=>null==T?void 0:T(e)})]}),(0,r.jsx)(v,{type:"secondary",style:{fontSize:12},children:"两者选齐后才能点「生成」。「项目」选的是入库到本地知识库的那份项目资料(清单/图纸/招标文件都在其中)——本次生成只用它,不会把库里别的项目材料混进来。提示词的正文按名字进入对应链路(总控/写作 → 写作链,清单/图纸/提取 → 事实抽取链,排版 → 格式链);章节大纲取自其中带 <OUTLINE> 的那一份,且只能有一份声明大纲。"})]}),!M&&(0,r.jsx)(v,{type:"secondary",style:{fontSize:12},children:"提示词与项目取自这条记录本身(章节结构由记录里那份提示词的大纲派生),不需要在这里再选。"}),(0,r.jsx)("div",{children:(0,r.jsx)(s.Ay,{size:"small",block:!0,disabled:L,onClick:()=>{U(!1),null==B||B()},children:"结构预览(章清单与小节)"})})]}),children:(0,r.jsx)(s.Ay,{style:{marginLeft:"5px"},size:"small",icon:(0,r.jsx)(h.A,{}),type:L?"primary":"default",children:"提示词 / 项目"})}),R.map(e=>(0,r.jsx)(c.A,{color:"blue",closable:!0,onClose:t=>{t.preventDefault(),null==_||_(R.filter(t=>t.value!==e.value).map(e=>e.value))},children:"提示词:".concat(e.label)},e.value)),N&&(0,r.jsx)(c.A,{color:"geekblue",closable:!0,onClose:e=>{e.preventDefault(),null==T||T("")},children:"项目:".concat(N.label)})]}),(0,r.jsxs)(o.A.Compact,{style:{width:"100%"},children:[(0,r.jsx)(m.A.TextArea,{ref:O,value:t,onChange:e=>n(e.target.value),onPressEnter:e=>{!e.shiftKey&&(e.preventDefault(),w||y||a())},autoSize:{minRows:1,maxRows:5},placeholder:"描述你的需求;可用上面的 @ 提及把节点带进正文(Enter 发送,Shift+Enter 换行)。篇幅由招标文件页数上限与标书类型自动决定:需求里写字数/页数不会改变篇幅目标",disabled:w}),(0,r.jsx)(i.A,{title:Q,children:(0,r.jsx)(s.Ay,{type:"primary",icon:(0,r.jsx)(g.A,{}),loading:y,disabled:w||L||!t.trim(),onClick:a,style:{alignSelf:"stretch",height:"auto"},children:x?"排队提交":"生成"})})]})]})]})}},28629:(e,t,n)=>{n.d(t,{p:()=>r});function r(e,t){let n="/canvas/".concat(encodeURIComponent(e));return t?"".concat(n,"?projectRoot=").concat(encodeURIComponent(t)):n}},34038:(e,t,n)=>{n.d(t,{B:()=>u});var r=n(65321),l=n(48399),a=n(25258),o=n(85114),i=n(85493),c=n(38332);let{Paragraph:s}=l.A;function u(e){let{open:t,title:n,chapters:l,outlineSource:u,materialScope:d,onClose:m}=e,p=l.length>0?"结构预览:".concat(n,"(").concat(l.length," 章").concat(u?",大纲来源:".concat(u):"",")"):"结构预览:".concat(n);return(0,r.jsxs)(a.A,{open:t,title:p,centered:!0,onCancel:m,width:640,styles:{container:{maxHeight:"calc(100vh - 48px)",display:"flex",flexDirection:"column"},body:{overflowY:"auto",flex:1,minHeight:0}},footer:(0,r.jsx)(o.Ay,{type:"primary",onClick:m,children:"知道了"}),children:[(0,r.jsx)(s,{type:"secondary",style:{fontSize:12,marginBottom:8},children:"章和已声明小节来自用户提示词大纲。技能候选尚未确定位置;生成时会结合真实资料和技术职责进行专业规划,可能合并、调整或归入其他章节。 最终目录以完成规划后的文档为准。"}),d&&(0,r.jsx)(i.A,{type:"info",showIcon:!0,style:{marginBottom:8},message:"本次项目资料:".concat(d.root||"(未指定)","(").concat(d.fileCount," 份文件)"),description:"资料范围已锁定在所选项目资料内:库里其它项目的材料不会进入本篇。"}),0===l.length&&(0,r.jsx)(i.A,{type:"info",showIcon:!0,message:"本次没有派生出章清单",description:"派生的硬约束是提示词(或输入框要求)里要有 ≥2 章的显式大纲;缺大纲时服务端会直接拒绝这次生成,并在提示里说清缺什么。"}),(0,r.jsx)(c.A,{size:"small",dataSource:l,renderItem:(e,t)=>{var n;return(0,r.jsx)(c.A.Item,{children:(0,r.jsx)(c.A.Item.Meta,{title:"".concat(t+1,". ").concat(e.title),description:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:["用户声明:",(0,r.jsx)("span",{children:e.sections.length>0?e.sections.join("、"):"(未声明小节)"})]}),(null==(n=e.candidateSections)?void 0:n.length)?(0,r.jsxs)("div",{children:["技能候选(待规划):",(0,r.jsx)("span",{children:e.candidateSections.join("、")})]}):null]})})})}})]})}},45551:(e,t,n)=>{n.d(t,{Jm:()=>c,fw:()=>a,je:()=>r.j,mc:()=>s,z3:()=>l});var r=n(96538);function l(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024)),n=e/Math.pow(1024,t);return"".concat(n.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 n=Math.floor(Math.floor((Date.now()-e)/1e3)/60),r=Math.floor(n/60),l=Math.floor(r/24);return l>30?new Date(e).toLocaleDateString(t):"en-US"===t?l>0?"".concat(l,"d ago"):r>0?"".concat(r,"h ago"):n>0?"".concat(n,"m ago"):"Just now":l>0?"".concat(l," 天前"):r>0?"".concat(r," 小时前"):n>0?"".concat(n," 分钟前"):"刚刚"}let o={document:"文档",spreadsheet:"表格",image:"图片",cad:"图纸",code:"代码",data:"数据",web:"网页",diagram:"图表",archive:"压缩包",other:"其他"},i={document:"Document",spreadsheet:"Spreadsheet",image:"Image",cad:"CAD",code:"Code",data:"Data",web:"Web",diagram:"Diagram",archive:"Archive",other:"Other"};function c(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return null!=(t=("en-US"===n?i:o)[e])?t:e}let s={active:"common.statusIndexed",outdated:"common.statusOutdated",error:"common.statusAbnormal",deleted:"common.statusDeleted",disk:"common.statusNotIndexed"}},52057:(e,t,n)=>{n.d(t,{B:()=>s,VF:()=>a,WF:()=>i,be:()=>c,s_:()=>u,xA:()=>o});var r=n(97109),l=n(8090);let a=24;function o(e,t,n,r){let l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.15,a=r&&r.right>r.left&&r.bottom>r.top?r:{left:0,top:0,right:n.width,bottom:n.height},o=Math.max(1,a.right-a.left),i=Math.max(1,a.bottom-a.top),c=e.x*t.k+t.x,s=e.y*t.k+t.y,u=c+e.width*t.k,d=s+e.height*t.k,m=a.left+o*l,p=a.right-o*l,f=a.top+i*l,h=a.bottom-i*l;return c<m||s<f||u>p||d>h}let i=12e3;function c(e){if(!e.following)return{label:"跟随最新",title:"跟随已关闭:点一下重新打开(打开后会跟着当前活跃节点走)",paused:!1};if(e.pausedUntil>e.now){let t=Math.max(1,Math.ceil((e.pausedUntil-e.now)/1e3));return{label:"跟随暂停中",title:"跟随暂停:".concat(t,"s 后自动恢复(你刚动过视口;不是关掉了)"),paused:!0}}return e.node?{label:"跟随中",title:"正在跟随:".concat(e.node.title).concat(void 0!==e.node.round?"(第 ".concat(e.node.round," 轮)"):""),paused:!1}:{label:"跟随中",title:"跟随中:当前没有活跃节点可跟(生成开始后会自动跟上)",paused:!1}}function s(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:24,l=t.x,a=t.y,o=t.x+e.width*t.k,i=t.y+e.height*t.k,c=Math.min(o,n.right)-Math.max(l,n.left),s=Math.min(i,n.bottom)-Math.max(a,n.top);return c>=r&&s>=r?{dx:0,dy:0}:{dx:n.left+r-l,dy:n.top+r-a}}function u(){let[e,t]=(0,r.useState)({x:0,y:0,k:1}),n=(0,r.useRef)(null),a=(0,r.useRef)(null),o=(0,r.useRef)(e);(0,r.useEffect)(()=>{o.current=e},[e]);let i=(0,r.useCallback)((e,r,l)=>{t(t=>{var a;let o=Math.min(2,Math.max(.1,t.k*e)),i=null==(a=n.current)?void 0:a.getBoundingClientRect();if(!i||void 0===r||void 0===l)return{...t,k:o};let c=(r-i.left-t.x)/t.k,s=(l-i.top-t.y)/t.k;return{k:o,x:r-i.left-c*o,y:l-i.top-s*o}})},[]),[c,s]=(0,r.useState)(null);(0,r.useEffect)(()=>{var e,t;let r=null!=(t=null==(e=n.current)?void 0:e.parentElement)?t:n.current;r&&r!==c&&s(r)}),(0,r.useEffect)(()=>{if(!c)return;let e=e=>{(e=>{for(let t=e;t&&t!==c;t=t.parentElement)if(t.scrollHeight>t.clientHeight+1){let e=getComputedStyle(t).overflowY;if("auto"===e||"scroll"===e)return!0}return!1})(e.target)||(e.preventDefault(),i(Math.exp(-e.deltaY/320),e.clientX,e.clientY))};return c.addEventListener("wheel",e,{passive:!1}),()=>c.removeEventListener("wheel",e)},[c,i]);let u=(0,r.useCallback)(e=>{if(0!==e.button)return;e.currentTarget.setPointerCapture(e.pointerId);let t=o.current;a.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,originX:t.x,originY:t.y}},[]),d=(0,r.useCallback)(e=>{let n=a.current;n&&n.pointerId===e.pointerId&&t(t=>({...t,x:n.originX+(e.clientX-n.startX),y:n.originY+(e.clientY-n.startY)}))},[]),m=(0,r.useCallback)(()=>{a.current=null},[]),p=(0,r.useCallback)(()=>t({x:0,y:0,k:1}),[]),f=(e,t)=>null!=t?t:{left:0,top:0,right:e.width,bottom:e.height},h=(0,r.useCallback)((e,r,l)=>{t(t=>{var a;let o=null==(a=n.current)?void 0:a.getBoundingClientRect();if(!o||e<=0||r<=0)return{...t,x:0,y:0};let i=f(o,l),c=Math.max(1,i.right-i.left),s=Math.max(1,i.bottom-i.top),u=Math.min(2,Math.max(.1,Math.min(c/e,s/r)));return{k:u,x:i.left+(c-e*u)/2,y:i.top+(s-r*u)/2}})},[]),g=(0,r.useCallback)((e,r,a,o)=>{t(t=>{var i;let c=null==(i=n.current)?void 0:i.getBoundingClientRect();if(!c)return t;let s=f(c,o),u=null!=a?a:t.k,d=(s.left+s.right)/2,m=(s.top+s.bottom)/2;return{k:u,x:d-(e+l.zT/2)*u,y:m-(r+l.EL/2)*u}})},[]);return{view:e,containerRef:n,zoomAt:i,onPointerDown:u,onPointerMove:d,endDrag:m,reset:p,fit:h,centerOn:g,panBy:(0,r.useCallback)((e,n)=>{(0!==e||0!==n)&&t(t=>({...t,x:t.x+e,y:t.y+n}))},[])}}},57481:(e,t,n)=>{n.d(t,{_:()=>x});var r=n(65321),l=n(97109),a=n(17807),o=n(42700),i=n(84253),c=n(32965),s=n(14932),u=n(75174),d=n(1310),m=n(58209),p=n(39507),f=n(6578),h=n(93533),g=n(45551);let v="canvas:recordsBallPos";function x(e){let{currentDocumentId:t,projectRoot:n,onSelect:x,onCurrentDeleted:w}=e,b=(0,p.Vr)(),{message:k}=a.A.useApp(),j=(0,l.useRef)(null),[A,I]=(0,l.useState)([]),[S,M]=(0,l.useState)(!1),[C,E]=(0,l.useState)(!1),[R,N]=(0,l.useState)(1),[_,T]=(0,l.useState)(!1),[B,D]=(0,l.useState)([]),[q,z]=(0,l.useState)(!1),[P,O]=(0,l.useState)(null),[F,U]=(0,l.useState)(!0),H=(0,l.useRef)(null);(0,l.useEffect)(()=>{var e,t;let n=function(){try{let e=window.localStorage.getItem(v);if(!e)return null;let t=JSON.parse(e);return"number"==typeof(null==t?void 0:t.left)&&"number"==typeof(null==t?void 0:t.top)?{left:t.left,top:t.top}:null}catch(e){return null}}();if(!n)return;let r=null==(t=j.current)||null==(e=t.parentElement)?void 0:e.getBoundingClientRect();if(!r)return void O(n);O({left:Math.min(Math.max(8,n.left),Math.max(8,r.width-44-8)),top:Math.min(Math.max(8,n.top),Math.max(8,r.height-44-8))})},[]);let L=(0,l.useCallback)(async()=>{M(!0);try{let e=await (0,f.cQ)(n||void 0);I(e.documents||[])}catch(e){I([])}finally{M(!1)}},[n]);(0,l.useEffect)(()=>{L()},[L]),(0,l.useEffect)(()=>{C&&L()},[C,L]),(0,l.useEffect)(()=>{let e=setInterval(()=>{L()},3e3);return()=>clearInterval(e)},[L]),(0,l.useEffect)(()=>{N(1),D([])},[C]);let Q=(0,l.useMemo)(()=>A.slice((R-1)*8,8*R),[A,R]),Y=(0,l.useCallback)(e=>!(0,h.Ce)(e.status),[]),X=Q.filter(Y).map(e=>e.id),G=()=>{if(!C){var e,t,n;let r=null==(t=j.current)||null==(e=t.parentElement)?void 0:e.getBoundingClientRect(),l=null==(n=j.current)?void 0:n.getBoundingClientRect();U(!r||!l||l.top-r.top>252)}E(e=>!e)},K=async e=>{try{await (0,f.QG)(e.id,e.projectRoot||n||void 0),k.success(b("common.success")),D(t=>t.filter(t=>t!==e.id)),e.id===t&&w(),await L()}catch(e){k.error(b("common.error"))}},J=async()=>{let e=A.filter(e=>B.includes(e.id)&&Y(e));if(0!==e.length){z(!0);try{await Promise.all(e.map(e=>(0,f.QG)(e.id,e.projectRoot||n||void 0))),k.success(b("records.deletedCount").replace("{count}",String(e.length))),t&&e.some(e=>e.id===t)&&w(),D([]),T(!1),await L()}catch(e){k.error(b("common.error"))}finally{z(!1)}}},W=P?{left:P.left,top:P.top}:{right:24,bottom:96};return(0,r.jsxs)("div",{className:"canvasRecordsBall",ref:j,style:{position:"absolute",zIndex:3,...W},children:[C&&(0,r.jsxs)("div",{className:"canvasRecordsPanel",style:{position:"absolute",right:0,width:320,maxHeight:420,display:"flex",flexDirection:"column",...F?{bottom:52}:{top:52}},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-[var(--canvasSectionBorder)] shrink-0",children:[(0,r.jsxs)("span",{className:"text-[13px] font-semibold text-[var(--colorText)]",children:[b("records.title"),(0,r.jsx)("span",{className:"ml-2 font-normal text-xs text-[var(--colorTextTertiary)]",children:A.length})]}),(0,r.jsx)("button",{type:"button",className:"canvasRecordsLink",onClick:()=>{T(e=>!e),D([])},children:_?b("common.cancel"):b("records.batch")})]}),(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:S&&0===A.length?(0,r.jsx)("div",{className:"py-10 text-center",children:(0,r.jsx)(o.A,{size:"small"})}):0===A.length?(0,r.jsx)("div",{className:"py-8",children:(0,r.jsx)(i.A,{image:i.A.PRESENTED_IMAGE_SIMPLE,description:(0,r.jsx)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:b("records.empty")})})}):Q.map(e=>{var n;let l=e.id===t,a=Y(e);return(0,r.jsxs)("div",{className:"group flex items-start gap-2 px-3 py-2 border-b border-[var(--canvasSectionBorder)] last:border-b-0 transition-colors ".concat(l?"bg-[var(--colorBgSelected)]":"hover:bg-[var(--colorBgHover)]"),children:[_&&(0,r.jsx)("input",{type:"checkbox",className:"mt-1 shrink-0",disabled:!a,checked:B.includes(e.id),onChange:t=>D(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id))}),(0,r.jsxs)("button",{type:"button",className:"min-w-0 flex-1 text-left bg-transparent border-0 p-0 cursor-pointer",title:e.title,onClick:()=>{x(e),E(!1)},children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"w-1.5 h-1.5 shrink-0 rounded-full ".concat(null!=(n=y[e.status])?n:"bg-[var(--colorTextTertiary)]")}),(0,r.jsx)("span",{className:"truncate text-[13px] ".concat(l?"font-semibold text-[var(--colorText)]":"text-[var(--colorText)]"),children:e.title}),l&&(0,r.jsx)("span",{className:"shrink-0 text-[10px] text-[var(--colorTextTertiary)]",children:b("records.current")})]}),(0,r.jsxs)("div",{className:"mt-0.5 pl-3 text-[11px] text-[var(--colorTextTertiary)]",children:[(0,r.jsx)(d.A,{className:"mr-1"}),(0,g.fw)(e.updatedAt,"zh-CN")]})]}),!_&&a&&(0,r.jsx)(c.A,{title:b("records.confirmDelete"),description:b("records.deleteHint"),onConfirm:()=>{K(e)},okText:b("common.confirm"),cancelText:b("common.cancel"),children:(0,r.jsx)("button",{type:"button",className:"canvasRecordsDelete",title:b("common.delete"),children:(0,r.jsx)(m.A,{})})}),!_&&!a&&(0,r.jsx)(s.A,{title:b("records.inFlightHint"),children:(0,r.jsx)("span",{className:"canvasRecordsDelete isDisabled",children:(0,r.jsx)(m.A,{})})})]},e.id)})}),A.length>8&&(0,r.jsx)("div",{className:"flex justify-center px-3 py-2 border-t border-[var(--canvasSectionBorder)] shrink-0",children:(0,r.jsx)(u.A,{size:"small",simple:!0,current:R,total:A.length,pageSize:8,onChange:N})}),_&&(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-t border-[var(--canvasSectionBorder)] shrink-0",children:[(0,r.jsx)("span",{className:"text-xs text-[var(--colorTextSecondary)]",children:b("records.checkedCount").replace("{count}",String(B.length))}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("button",{type:"button",className:"canvasRecordsLink",onClick:()=>D(B.length===X.length?[]:X),children:B.length===X.length&&X.length>0?b("records.clearSelect"):b("records.selectPage")}),(0,r.jsx)(c.A,{title:b("records.confirmDeleteSelected").replace("{count}",String(B.length)),description:b("records.deleteHint"),disabled:0===B.length,onConfirm:()=>{J()},okText:b("common.confirm"),cancelText:b("common.cancel"),children:(0,r.jsxs)("button",{type:"button",className:"canvasRecordsDanger",disabled:0===B.length||q,children:[(0,r.jsx)(m.A,{className:"mr-1"}),b("records.deleteSelected")]})})]})]})]}),(0,r.jsxs)("div",{className:"canvasRecordsBallBtn",role:"button",tabIndex:0,"aria-label":"".concat(b("records.title"),"(").concat(A.length,")"),style:{width:44,height:44},onPointerDown:e=>{var t,n,r;let l=null==(n=j.current)||null==(t=n.parentElement)?void 0:t.getBoundingClientRect(),a=null==(r=j.current)?void 0:r.getBoundingClientRect();if(l&&a){H.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,originLeft:a.left-l.left,originTop:a.top-l.top,moved:!1};try{e.currentTarget.setPointerCapture(e.pointerId)}catch(e){}}},onPointerMove:e=>{var t,n;let r=H.current,l=null==(n=j.current)||null==(t=n.parentElement)?void 0:t.getBoundingClientRect();if(!r||r.pointerId!==e.pointerId||!l)return;let a=e.clientX-r.startX,o=e.clientY-r.startY;!r.moved&&5>Math.hypot(a,o)||(r.moved=!0,O({left:Math.min(Math.max(8,r.originLeft+a),Math.max(8,l.width-44-8)),top:Math.min(Math.max(8,r.originTop+o),Math.max(8,l.height-44-8))}))},onPointerUp:e=>{let t=H.current;H.current=null;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch(e){}if(t){if(t.moved)return void O(e=>{if(e)try{window.localStorage.setItem(v,JSON.stringify(e))}catch(e){}return e});G()}},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),G())},children:[(0,r.jsx)(d.A,{}),(0,r.jsx)("span",{className:"canvasRecordsBallBadge".concat(0===A.length?" isZero":""),children:A.length>99?"99+":A.length})]})]})}let y={completed:"bg-[var(--colorOk)]",completed_with_issues:"bg-[var(--colorDanger)]",warning:"bg-[var(--colorWarning)]",failed:"bg-[var(--colorDanger)]",aborted:"bg-[var(--colorTextTertiary)]",generating:"bg-[var(--colorAccent)]",queued:"bg-[var(--colorTextTertiary)]",paused:"bg-[var(--colorWarning)]"}},93533:(e,t,n)=>{n.d(t,{Ce:()=>k,tl:()=>A});var r=n(97109),l=n(96538),a=n(94394),o=n(23216),i=n(26619),c=n(8263),s=n(16285),u=n(8579),d=n(29071),m=n(7851),p=n(1310),f=n(26631),h=n(83914),g=n(6578);async function v(e){let t,n=0;for(;;){var r,l;let a;if(e.cancelled())throw Error("用户中止");try{a=await e.read(t)}catch(t){if(e.cancelled())throw Error("用户中止",{cause:t});1===(n+=1)&&(null==(r=e.connectionInterrupted)||r.call(e,t)),await e.delay(Math.min(2e3*n,15e3));continue}n=0;let o=a.document;if(!o){if(!a.unchanged&&!a.status)throw Error("未找到生成记录,无法读取该任务进度");["paused","failed","aborted","completed","completed_with_issues","warning"].includes(null!=(l=a.status)?l:"")&&(t=void 0),await e.delay(1500);continue}if(t=o.updatedAt,e.apply(o),"paused"===o.status)return o;if("failed"===o.status||"aborted"===o.status)throw Error(o.error||("aborted"===o.status?"生成已中止":"生成失败"));if(["completed","completed_with_issues","warning"].includes(o.status)){if(o.draft)return o;throw Error(o.error||"服务任务已结束,但最终成稿未完成;已保存的正文可在生成记录中查看")}await e.delay(1500)}}let x=null,y=!1;function w(){null==x||x.listeners.forEach(e=>e())}let b=a.i_;function k(e){return"completed"!==e&&"completed_with_issues"!==e&&"warning"!==e&&"failed"!==e&&"aborted"!==e&&"paused"!==e}function j(e){var t,n,l,a,h,g,v,x,y;let w=null==(t=e.agentWorkflow)?void 0:t.nodes;if(!w||0===w.length)return null;let k=[...w].sort((e,t)=>{var n,r;return(null!=(n=e.seq)?n:0)-(null!=(r=t.seq)?r:0)}).map(e=>{let t=b[e.type]||e.title||e.type||"节点",n="failed"===e.status||"blocked"===e.status?"error":"paused"===e.status||"repairing"===e.status?"warning":"running"===e.status?"process":"pending"===e.status?"wait":"finish",l=Object.entries(e.metrics||{}).slice(0,4).map(e=>{let[t,n]=e;return"".concat(t,":").concat(String(n))}).join(" ");return{key:e.id,title:t,subtitle:e.progress?"".concat(e.progress.label||"进度",":").concat(e.progress.current,"/").concat(e.progress.total):"",description:l,status:n,icon:function(e){let t=e.split(".")[0]||e;return"role_binding"===e||"prepare"===t?(0,r.createElement)(o.A):"knowledge_retrieval"===e||"understand"===t?(0,r.createElement)(i.A):"file_understanding"===e||"skill"===t?(0,r.createElement)(c.A):"fact_extraction"===e?(0,r.createElement)(s.A):"chapter_generation"===e||"chapter"===t||"write"===t?(0,r.createElement)(u.A):"llm_review"===e||"turn"===t||"round"===t?(0,r.createElement)(d.A):"validation"===e||"repair"===t||"recheck"===t?(0,r.createElement)(m.A):"plan"===t||"blueprint"===t?(0,r.createElement)(o.A):"rollback"===t||"snapshot"===t?(0,r.createElement)(p.A):(0,r.createElement)(f.A)}(e.type),subSteps:[]}}),j="generating"===e.status||"queued"===e.status?null!=(v=null!=(g=null==(n=k.find(e=>"process"===e.status))?void 0:n.key)?g:null==(l=k.at(-1))?void 0:l.key)?v:null:("failed"===e.status||"aborted"===e.status)&&null!=(y=null!=(x=null==(a=k.find(e=>"error"===e.status))?void 0:a.key)?x:null==(h=k.at(-1))?void 0:h.key)?y:null;return{steps:k,activeKey:j}}function A(){var e,t;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{projectRoot:a,documents:o,onNotice:i,t:c,onGenerated:s}=n,[u,d]=(0,r.useState)([]),[m,p]=(0,r.useState)(null),[f,b]=(0,r.useState)(!1),[A,I]=(0,r.useState)(null),[S,M]=(0,r.useState)(""),[C,E]=(0,r.useState)(null),[R,N]=(0,r.useState)(null!=(e=n.documentId)?e:null),[_,T]=(0,r.useState)(null),[B,D]=(0,r.useState)(null!=o?o:[]),[q,z]=(0,r.useState)(0),[P,O]=(0,r.useState)(null),[F,U]=(0,r.useState)([]),[H,L]=(0,r.useState)(null),[Q,Y]=(0,r.useState)(null),X=(0,r.useRef)(""),G=(0,r.useRef)(new Map),K=(0,r.useRef)(new Map),J=(0,r.useRef)(!1),W=(0,r.useRef)(a),V=(0,r.useRef)(R),Z=(0,r.useRef)(u),$=(0,r.useRef)(m),ee=(0,r.useRef)(f),et=(0,r.useRef)(c),en=(0,r.useRef)(i),er=(0,r.useRef)(s);(0,r.useEffect)(()=>{W.current=a},[a]),(0,r.useEffect)(()=>{V.current=R},[R]),(0,r.useEffect)(()=>{Z.current=u},[u]),(0,r.useEffect)(()=>{$.current=m},[m]),(0,r.useEffect)(()=>{ee.current=f},[f]),(0,r.useEffect)(()=>{et.current=c},[c]),(0,r.useEffect)(()=>{en.current=i},[i]),(0,r.useEffect)(()=>{er.current=s},[s]);let el=(0,r.useMemo)(()=>"activeGenDocId:".concat(a||"default"),[a]),ea=(0,r.useCallback)(e=>{var t;null==(t=en.current)||t.call(en,e)},[]),eo=(0,r.useCallback)((e,t)=>{var n,r;return null!=(r=null==(n=et.current)?void 0:n.call(et,e))?r:t},[]);(0,r.useEffect)(()=>{let e=()=>{let e=x;e&&(d(e.flowSteps),p(e.activeFlowKey),b(e.loading),e.documentId&&N(e.documentId),e.draft&&I(e.draft),void 0!==e.content&&M(e.content))},t=x;return null==t||t.listeners.add(e),e(),()=>{null==t||t.listeners.delete(e)}},[]);let ei=(0,r.useRef)(!1),ec=(0,r.useCallback)(async()=>{try{D((await (0,g.cQ)(W.current||void 0)).documents),ei.current=!1}catch(e){ei.current||(ei.current=!0,ea({kind:"error",text:"生成记录列表读取失败——界面显示的可能不是最新内容,请稍后重试或查看服务端日志"}))}},[ea]);(0,r.useEffect)(()=>{o&&D(o)},[o]),(0,r.useEffect)(()=>{void 0!==n.documentId&&null!==n.documentId&&N(n.documentId)},[n.documentId]);let es=(0,r.useCallback)(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ee.current;(null==x?void 0:x.loading)&&(x.flowSteps=e,x.activeFlowKey=t,x.loading=n,w())},[]),eu=(0,r.useCallback)(e=>{let t=Date.now();for(let n of e){let e=G.current.get(n.key);"process"!==n.status||e?("finish"===n.status||"error"===n.status||"warning"===n.status)&&e&&!e.endedAt&&G.current.set(n.key,{...e,endedAt:t}):G.current.set(n.key,{startedAt:t})}},[]),ed=(0,r.useCallback)(e=>{var t,n,r,l,a,o,i,c,s,u,m;let f=(null==(t=e.agentWorkflow)?void 0:t.nodes)||[],h="".concat(e.id,"|").concat(e.updatedAt,"|").concat(e.status,"|").concat(e.error||"","|n").concat(f.length,":").concat(f.map(e=>{var t,n,r,l;return"".concat(e.id,"=").concat(e.status,":").concat(null!=(r=null==(t=e.progress)?void 0:t.current)?r:0,"/").concat(null!=(l=null==(n=e.progress)?void 0:n.total)?l:0)}).join(","));if(X.current===h)return;X.current=h,E(e);let{steps:g,activeKey:v}=function(e){var t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1],null!=(t=j(e))?t:{steps:[],activeKey:null}}(e);eu(g);let x=k(e.status);d(g),p(v),b(x),es(g,v,x),T("failed"===e.status||"aborted"===e.status?e.error||("aborted"===e.status?"生成已中止":"生成失败"):null),("completed"===e.status||"completed_with_issues"===e.status||"warning"===e.status)&&(e.draft&&I(e.draft),M(e.editedMarkdown||e.markdown),U(e.exportReports||[]),Y({docId:e.id,...(null==(n=e.deliveryQuality)?void 0:n.receipt)||(null==(r=e.reviewMetadata)?void 0:r.contractQuality)?{contractQuality:null!=(u=null==(l=e.deliveryQuality)?void 0:l.receipt)?u:e.reviewMetadata.contractQuality}:{},...(null==(a=e.deliveryQuality)?void 0:a.stale)||(null==(o=e.reviewMetadata)?void 0:o.contractQualityStale)?{contractQualityStale:null!=(m=null==(i=e.deliveryQuality)?void 0:i.stale)?m:e.reviewMetadata.contractQualityStale}:{},...e.projectRoot?{projectRoot:e.projectRoot}:{},...(null==(s=e.reviewMetadata)||null==(c=s.telemetry)?void 0:c.repairChainNetChars)?{netChars:e.reviewMetadata.telemetry.repairChainNetChars}:{}}))},[es,eu]),em=(0,r.useCallback)(e=>{e.id&&N(e.id),ed(e)},[ed]),ep=(0,r.useCallback)((e,t)=>v({cancelled:()=>!!(null==t?void 0:t.aborted),apply:ed,delay:e=>new Promise(t=>window.setTimeout(t,e)),connectionInterrupted:()=>ea({kind:"warning",text:"暂时无法读取生成进度,正在重新连接;生成状态以服务端回执为准"}),read:async n=>{let r=new AbortController;t&&(t.pollController=r);try{return await (0,g.v7)(e,!0,W.current||void 0,r.signal,n)}finally{(null==t?void 0:t.pollController)===r&&(t.pollController=void 0)}}}),[ed,ea]),ef=(0,r.useCallback)(async(e,t)=>{if(!e.specId)return;let n=e.title,l=e.promptIds,a=e.projectRoot||W.current;if((null==x?void 0:x.aborted)&&(x=null),null==x?void 0:x.loading){if(J.current)return;if(!a)return void ea({kind:"error",text:"未识别当前项目,请先选择或打开项目后再生成文件"});J.current=!0;try{let e=await (0,g.OX)({promptIds:l,...n?{title:n}:{},requirement:t,projectRoot:a});await ec(),ea({kind:"info",text:e.queuePosition?"已加入生成队列(第 ".concat(e.queuePosition," 位):前面任务完成后将自动开始"):"生成任务已创建"})}catch(e){ea({kind:"error",text:e instanceof Error?e.message:"创建生成任务失败"})}finally{J.current=!1}return}if(!a)return void ea({kind:"error",text:"未识别当前项目,请先选择或打开项目后再生成文件"});b(!0);let o=Z.current,i=o.length>0?o:[{key:"prepare",title:"正在创建生成任务",description:"系统正在创建后台生成任务,请稍候。",status:"process",icon:(0,r.createElement)(h.A),subSteps:[{key:"start",title:"准备生成任务",status:"process"}]}],c=$.current||"prepare";d(i),p(c);let s=(0,g.OX)({promptIds:l,...n?{title:n}:{},requirement:t,projectRoot:a});x={id:Date.now(),specId:e.specId,loading:!0,flowSteps:i,activeFlowKey:c,promise:s,listeners:new Set};try{var u,m,f,v,k,A;let t=await s;t.documentId&&(localStorage.setItem(el,t.documentId),N(t.documentId),(null==x?void 0:x.promise)===s&&(x.documentId=t.documentId)),await ec(),t.queuePosition&&ea({kind:"info",text:"已加入生成队列(第 ".concat(t.queuePosition," 位):前面任务完成后将自动开始")});let n=t.documentId?await ep(t.documentId,(null==x?void 0:x.promise)===s?x:void 0):void 0;if((null==n?void 0:n.status)==="paused"){(null==x?void 0:x.promise)===s&&(x.loading=!1,w(),x=null),localStorage.removeItem(el),await ec(),ea({kind:"info",text:"生成已在节点边界暂停,已保存实际正文和执行状态"});return}let r=t.draft||(null==n?void 0:n.draft);if(!r)throw Error("生成结果为空");(t.documentId||(null==n?void 0:n.id))&&N(t.documentId||n.id),I(r),M((null==n?void 0:n.editedMarkdown)||(null==n?void 0:n.markdown)||r.markdown),(null==x?void 0:x.promise)===s&&(x.draft=r,x.content=(null==n?void 0:n.editedMarkdown)||(null==n?void 0:n.markdown)||r.markdown);let l=n||{id:t.documentId||"draft-".concat(Date.now()),templateId:(null==(u=t.record)?void 0:u.templateId)||(null==(m=t.documentSpec)?void 0:m.id)||e.specId,templateName:(null==(f=t.record)?void 0:f.templateName)||(null==(v=t.documentSpec)?void 0:v.title),title:r.title,requirement:r.requirement,projectRoot:r.projectRoot||W.current,projectId:r.projectId,markdown:r.markdown,status:r.validationIssues.some(e=>"error"===e.level||"warning"===e.level)||!r.exportGate.passed?"completed_with_issues":"completed",draft:r,executionStages:r.executionStages,assets:r.assets||[],createdAt:r.generatedAt,updatedAt:Date.now()},{steps:a}=null!=(A=j(l))?A:{steps:[],activeKey:null};d(a),es(a,"done",!1),p("done"),(null==x?void 0:x.promise)===s&&(x.activeFlowKey="done",x.loading=!1,w(),x=null),localStorage.removeItem(el),await ec(),ea("completed"===l.status?{kind:"success",text:"生成完成,专业交付检查已通过"}:{kind:"warning",text:"本轮运行已结束,实际稿仍有问题待复核,可导出审阅稿"}),(t.documentId||(null==n?void 0:n.id))&&(null==(k=er.current)||k.call(er,t.documentId||n.id))}catch(r){localStorage.removeItem(el);let e=r instanceof Error?r.message:eo("common.error","出错了"),t=y;y=!1;let n=!t&&"用户中止"===e;T(e),t||d(t=>{let n=t.map(t=>"process"===t.status?{...t,status:"error",description:e,subSteps:t.subSteps.map((e,t)=>({...e,status:0===t?"error":e.status}))}:t);return es(n,$.current,!1),n}),(null==x?void 0:x.promise)===s&&(x.loading=!1,x.error=e,w(),x=null),await ec(),n?ea({kind:"warning",text:"生成任务已被中止(可能来自其他窗口):可在列表中点击「继续生成」恢复"}):t||ea({kind:"error",text:e})}finally{b(!1),y=!1,(null==x?void 0:x.promise)===s&&(x.loading=!1,w())}},[ea,ec,es,el,eo,ep]),eh=(0,r.useCallback)(e=>{let t=K.current.get(e);t&&(clearInterval(t),K.current.delete(e))},[]),eg=(0,r.useCallback)((e,t)=>{eh(e);let n=setInterval(()=>{(async()=>{try{let{document:n}=await (0,g.v7)(e,!0,t||W.current||void 0);if(!n)return;ed(n),await ec(),k(n.status)||(eh(e),localStorage.removeItem(el))}catch(e){}})()},2e3);K.current.set(e,n)},[ed,ec,eh,el]);(0,r.useEffect)(()=>()=>{for(let e of K.current.values())clearInterval(e);K.current.clear()},[]),(0,r.useEffect)(()=>{if(0===B.length)return;let e=localStorage.getItem(el);if(!e)return;if(!B.find(t=>t.id===e&&("generating"===t.status||"queued"===t.status)))return void localStorage.removeItem(el);N(e);let t=setInterval(()=>{(async()=>{try{let{document:n}=await (0,g.v7)(e,!1,W.current||void 0);if(!n)return;await ec(),"generating"!==n.status&&"queued"!==n.status&&(localStorage.removeItem(el),clearInterval(t))}catch(e){clearInterval(t)}})()},3e3);return()=>clearInterval(t)},[B,ec,el]),(0,r.useEffect)(()=>{var e;if(!R)return;let t=B.find(e=>e.id===R),n=null!=(e=null==t?void 0:t.status)?e:null==C?void 0:C.status;n&&k(n)?eg(R,(null==t?void 0:t.projectRoot)||W.current):eh(R)},[R,B,eg,eh,null==C?void 0:C.status]),(0,r.useEffect)(()=>{if(!f||!m)return;let e=window.setInterval(()=>d(e=>{let t=e.map(e=>{if(e.key!==m||"process"!==e.status)return e;let t=e.subSteps.findIndex(e=>"process"===e.status),n=t<0?0:Math.min(t+1,e.subSteps.length-1);return{...e,subSteps:e.subSteps.map((e,t)=>t<n?{...e,status:"finish"}:t===n?{...e,status:"process"}:{...e,status:"wait"})}});return es(t,m),t}),1400);return()=>window.clearInterval(e)},[m,f,es]),(0,r.useEffect)(()=>{if(!f)return;let e=window.setInterval(()=>z(e=>e+1),1e3);return()=>window.clearInterval(e)},[f]);let ev=(0,r.useCallback)(e=>{var t;let n=G.current.get(e);if(!n)return null;let r=null!=(t=n.endedAt)?t:Date.now(),a=(0,l.a)(r-n.startedAt,{unit:"ms",style:"fine"});return n.endedAt?a:"".concat(a,"(运行中)")},[q]),ex=(0,r.useCallback)(async e=>{x&&(y=!0);let t=V.current,n=null;if(t&&await (0,g.r)(t,e||W.current||void 0).catch(e=>{n=e}),x){var r;x.aborted=!0,null==(r=x.pollController)||r.abort(),x.loading=!1,x.error="用户中止",w(),x=null}for(let e of(localStorage.removeItem(el),K.current.values()))clearInterval(e);K.current.clear(),b(!1),d([]),p(null),T("用户中止"),await ec(),ea(n?{kind:"error",text:"本地已停止跟踪,但服务端未确认中止(".concat(n instanceof Error?n.message:String(n),")——任务可能仍在后台运行,请稍后重试或查看服务端日志")}:{kind:"success",text:"已中止生成任务"})},[ea,ec,el]),ey=(0,r.useCallback)(async e=>{if((null==x?void 0:x.loading)&&x.documentId===e.id){var t;y=!0,x.aborted=!0,null==(t=x.pollController)||t.abort(),x.loading=!1,x.error="用户中止",w(),x=null,b(!1)}localStorage.removeItem(el),eh(e.id);try{await (0,g.r)(e.id,e.projectRoot||W.current||void 0),ea({kind:"success",text:"queued"===e.status?"已取消排队任务":"已中止生成任务"})}catch(e){ea({kind:"info",text:"任务已不在运行,已刷新状态"})}finally{await ec(),V.current===e.id&&(N(null),E(null),I(null),M(""))}},[ea,ec,eh,el]),ew=(0,r.useCallback)(async e=>{try{N(e.id),b(!0);let t=await (0,g.UQ)(e.id,e.projectRoot||W.current||void 0);localStorage.setItem(el,t.documentId),await ec();let n=await ep(t.documentId);n.draft&&(I(n.draft),M(n.editedMarkdown||n.markdown||n.draft.markdown)),localStorage.removeItem(el),await ec(),ea("paused"===n.status?{kind:"info",text:"生成已暂停,实际稿已保存"}:"completed"===n.status?{kind:"success",text:"已继续生成并通过专业交付检查"}:{kind:"warning",text:"继续生成已结束,实际稿仍待复核,可导出审阅稿"})}catch(e){ea({kind:"error",text:e instanceof Error?e.message:"继续生成失败"})}finally{b(!1)}},[ea,ec,el,ep]),eb=(0,r.useCallback)(async(e,t)=>{let n=await fetch("/api/documents/generated/".concat(encodeURIComponent(e),"/pause"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:t||W.current||void 0})});if(!n.ok)throw Error(await n.text()||"HTTP ".concat(n.status));let r=await n.json();return ea({kind:"success",text:r.message||"已请求暂停:正在取消模型调用并保存已完成正文"}),await ec(),eg(e,t),r},[ea,ec,eg]),ek=(0,r.useCallback)(async(e,t)=>{let n=await fetch("/api/documents/generated/".concat(encodeURIComponent(e),"/resume-generate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectRoot:t||W.current||void 0})});if(!n.ok)throw Error(await n.text()||"HTTP ".concat(n.status));let r=await n.json().catch(()=>void 0),l=null==r?void 0:r.resumeReuse;ea(l?{kind:0===l.blockers.length?"info":"warning",text:"已请求继续:".concat(l.reason)}:{kind:"info",text:"已请求继续:将复用已保存的检查点"}),await ec()},[ea,ec]),ej=(0,r.useCallback)((e,t,n)=>{let r=new Blob([e],{type:n}),l=URL.createObjectURL(r),a=document.createElement("a");a.href=l,a.download=t,a.target="_self",a.rel="noopener",a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),a.remove(),window.setTimeout(()=>URL.revokeObjectURL(l),1e3)},[]),eA=(0,r.useCallback)(async(e,t)=>{let n=await (0,g.hU)(e,t);ej(n.blob,n.filename,"application/json;charset=utf-8")},[ej]),eI=(0,r.useCallback)(async(e,t,n)=>{try{let{blob:r,filename:l,receipt:a,gateIssues:o}=await (0,g.UE)(e);ej(r,l||t,n),L("review"===a.exportPurpose?{at:Date.now(),count:o.length,issues:o}:null),a.issuesReport&&await eA(e,a.issuesReport)}catch(t){throw t instanceof g.GA&&t.receipt.issuesReport&&await eA(e,t.receipt.issuesReport),t}},[ej,eA]),eS=(0,r.useMemo)(()=>({markdown:"text/markdown;charset=utf-8",html:"text/html;charset=utf-8",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}),[]),eM=(0,r.useCallback)(async(e,t)=>{var n,r;let l=void 0!==e.editedMarkdown?e.editedMarkdown:e.markdown||(null==(n=e.draft)?void 0:n.markdown)||"",a=void 0===e.editedMarkdown&&(null==(r=e.checkpointChapters)?void 0:r.some(e=>{var t;return null==(t=e.content)?void 0:t.trim()}));if(!l.trim()&&!a)return void ea({kind:"warning",text:"该记录暂无可导出的正文内容"});O(t);let o={exportPurpose:"review",documentId:e.id,title:e.title,format:t,projectRoot:e.projectRoot||W.current||void 0};try{await eI(o,"".concat(e.title,".").concat(t),eS[t])}catch(e){ea({kind:"error",text:e instanceof Error?e.message:"导出失败"})}finally{O(null)}},[eI,eS,ea]),eC=(0,r.useCallback)(async e=>{if(!A)return;O(e);let t={exportPurpose:"review",documentId:V.current||void 0,title:A.title,markdown:S,format:e,exportGate:A.exportGate,useClientMarkdown:!0,projectRoot:A.projectRoot||W.current||void 0};try{if(await eI(t,"".concat(A.title,".").concat("markdown"===e?"md":e),eS[e]),V.current)try{let{document:e}=await (0,g.v7)(V.current,!1,A.projectRoot||W.current||void 0);e&&U(e.exportReports||[])}catch(e){}}catch(e){ea({kind:"error",text:e instanceof Error?e.message:"导出失败"})}finally{O(null)}},[S,eI,A,eS,ea]),eE=R&&null!=(t=B.find(e=>e.id===R))?t:C,eR=function(e,t){if(!e)return t?"running":"idle";switch(e){case"queued":return"queued";case"generating":return"running";case"paused":return"paused";case"failed":case"aborted":return"stopped";case"completed_with_issues":case"warning":return"issues";case"completed":return"done";default:return"idle"}}(null==eE?void 0:eE.status,f);return{flowSteps:u,activeFlowKey:m,loading:f,draft:A,content:S,workflowRecord:C,documentId:R,documents:B,error:_,phase:eR,flowTick:q,boundRecord:eE,canResume:function(e){var t,n,r,l,a,o,i,c;if(!e)return{resumable:!1,kind:"not-resumable",reason:"记录不存在"};let s=String(e.status||""),u=null!=(r=null==(t=e.checkpointChapters)?void 0:t.length)?r:0,d=u>0,m="number"==typeof e.interruptedAt||!!e.interruptionReason;if(null!=(l=e.running)?l:"generating"===s||"queued"===s)return{resumable:!1,kind:"not-resumable",reason:"这次生成还在跑(续跑入口不该在运行态出现)"};if("paused"===s)return{resumable:!0,kind:"paused",reason:"暂停是可逆的:从检查点接着跑,未受影响的章会被复用"};if(m)return d?{resumable:!0,kind:"interrupted",reason:"上次运行被中断(".concat(null!=(a=e.interruptionReason)?a:"中断标记",")且留有 ").concat(u," 个检查点章:续跑只补未完成的章")}:{resumable:!1,kind:"not-resumable",reason:"这次运行被中断且**没有检查点章**:续跑等于全量重跑,请用新建生成(这里不伪装成续跑)"};if("warning"===s)return d?{resumable:!0,kind:"interrupted",reason:"上次运行留下了 ".concat(u," 个检查点章(状态 warning):续跑只补未完成的章")}:{resumable:!1,kind:"not-resumable",reason:"warning 且没有检查点章:没有可接着跑的东西,请用新建生成"};let p=null!=(o=null==(n=e.draft)?void 0:n.exportGate)?o:e.exportGate;if((null==p?void 0:p.passed)===!1){let e=null!=(c=null==(i=p.blockingIssues)?void 0:i.length)?c:0;return{resumable:!0,kind:"gate-blocked-repair",reason:"门禁未过(".concat(e>0?"".concat(e," 项阻断"):"阻断清单未随记录落盘","):续跑把阻断项交回生成侧修复(回源修复,不是重新生成)")}}return"completed"===s?{resumable:!1,kind:"not-resumable",reason:'这份稿已完成:要再跑请新建生成("继续"会把已定的交付物再推一遍)'}:"completed_with_issues"===s||"failed"===s||"aborted"===s?{resumable:!0,kind:"resumable-terminal",reason:"completed_with_issues"===s?"已收口但有未过项:续跑把未过项交回生成侧修复(回源修复,不是重新生成)".concat(d?";复用 ".concat(u," 个检查点章"):""):"aborted"===s?"这份稿被中止过:续跑从中断处接着跑".concat(d?"(复用 ".concat(u," 个检查点章)"):"(无检查点 ⇒ 全量重跑)"):"上次生成失败:续跑接着跑".concat(d?"(复用 ".concat(u," 个检查点章)"):"(无检查点 ⇒ 全量重跑)")}:{resumable:!1,kind:"not-resumable",reason:"当前状态(".concat(s||"未知",")没有可续跑的线索")}}(eE).resumable,startGeneration:ef,abortGeneration:ex,abortDocument:ey,resumeDocument:ew,pauseDocument:eb,resumePausedDocument:ek,applyRecord:em,refreshDocuments:ec,waitForDoc:ep,stepDurationText:ev,setDraft:I,setContent:M,setExportReports:U,export:{exporting:P,nonDeliverableExport:H,exportRecord:eM,exportEditor:eC,downloadExport:eI,exportReports:F},deliveryReadings:Q}}},94394:(e,t,n)=>{n.d(t,{i_:()=>r,uh:()=>l});let r={role_binding:"项目角色配置绑定",knowledge_retrieval:"知识库证据检索",file_understanding:"项目资料理解",fact_extraction:"事实抽取",chapter_generation:"章节正文生成",llm_review:"独立复核",validation:"规则与准入校验",reference:"资料增强"},l={success:"完成",running:"进行中",failed:"失败",skipped:"跳过",partial:"部分生效",pending:"等待中"}},96538:(e,t,n)=>{n.d(t,{a:()=>l,j:()=>a});let r={coarse:function(e,t){let n=Math.floor(e/1e3),r=Math.floor(n/86400),l=Math.floor(n%86400/3600),a=Math.floor(n%3600/60),o="en-US"===t;return r>0?o?"".concat(r,"d ").concat(l,"h"):"".concat(r," 天 ").concat(l," 小时"):l>0?o?"".concat(l,"h ").concat(a,"m"):"".concat(l," 小时 ").concat(a," 分"):a>0?o?"".concat(a,"m"):"".concat(a," 分"):o?"Just now":"刚刚"},fine:function(e){let t=Math.round(e/1e3);if(t<60)return"".concat(t," 秒");let n=Math.floor(t/60);return n<60?"".concat(n," 分 ").concat(t%60," 秒"):"".concat(Math.floor(n/60)," 小时 ").concat(n%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 l(e,t){var n;return r[t.style](function(e,t){let n="s"===t?1e3*e:e;return Number.isFinite(n)&&n>0?n:0}(e,t.unit),null!=(n=t.locale)?n:"zh-CN")}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zh-CN";return l(e,{unit:"s",style:"coarse",locale:t})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5046],{76506:(e,t,n)=>{n.d(t,{A:()=>S});var l=n(97109),o=n(3638),r=n(92162),a=n(26047),i=n(19135),s=n(74567),c=n(27273),d=n(59609);let m={xxxl:4,xxl:3,xl:3,lg:3,md:3,sm:2,xs:1},p=l.createContext(null);var $=n(42644);let u=e=>{let{itemPrefixCls:t,component:n,span:i,className:s,style:c,labelStyle:d,contentStyle:m,bordered:$,label:u,content:b,colon:g,type:h,styles:f,classNames:y}=e,{classNames:E,styles:v}=l.useContext(p),[x,S]=(0,r.AV)([E,y],[v,f],{props:e}),w={...d,...S.label},A={...m,...S.content};if($){let e;"label"===h&&(e=w),"content"===h&&(e=A);let r=e?{...c,...e}:c;return l.createElement(n,{colSpan:i,style:r,className:(0,o.$)(s,{[`${t}-item-${h}`]:"label"===h||"content"===h,[x.label]:x.label&&"label"===h,[x.content]:x.content&&"content"===h})},(0,a.AZ)(u)&&l.createElement("span",null,u),(0,a.AZ)(b)&&l.createElement("span",null,b))}return l.createElement(n,{className:(0,o.$)(`${t}-item`,s),style:c,colSpan:i},l.createElement("div",{className:`${t}-item-container`},(0,a.AZ)(u)&&l.createElement("span",{style:w,className:(0,o.$)(`${t}-item-label`,x.label,{[`${t}-item-no-colon`]:!g})},u),(0,a.AZ)(b)&&l.createElement("span",{style:A,className:(0,o.$)(`${t}-item-content`,x.content)},b)))};function b(e,{colon:t,prefixCls:n,bordered:o},{component:r,type:a,showLabel:i,showContent:s,labelStyle:c,contentStyle:d,styles:m}){return e.map(({label:e,children:p,prefixCls:$=n,className:b,style:g,labelStyle:h,contentStyle:f,span:y=1,key:E,styles:v,classNames:x},S)=>{if("string"==typeof r)return l.createElement(u,{key:`${a}-${E||S}`,className:b,style:g,classNames:x,styles:{label:{...c,...m?.label,...h,...v?.label},content:{...d,...m?.content,...f,...v?.content}},span:y,colon:t,component:r,itemPrefixCls:$,bordered:o,label:i?e:null,content:s?p:null,type:a});let w={label:{...c,...m?.label,...h,...v?.label},content:{...d,...m?.content,...f,...v?.content}};return[l.createElement(u,{key:`label-${E||S}`,className:b,style:g,classNames:x,styles:w,span:1,colon:t,component:r[0],itemPrefixCls:$,bordered:o,label:e,type:"label"}),l.createElement(u,{key:`content-${E||S}`,className:b,style:g,classNames:x,styles:w,span:2*y-1,component:r[1],itemPrefixCls:$,bordered:o,content:p,type:"content"})]})}let g=e=>{let t=l.useContext(p),{prefixCls:n,vertical:o,row:r,index:a,bordered:i}=e;return o?l.createElement(l.Fragment,null,l.createElement("tr",{key:`label-${a}`,className:`${n}-row`},b(r,e,{component:"th",type:"label",showLabel:!0,...t})),l.createElement("tr",{key:`content-${a}`,className:`${n}-row`},b(r,e,{component:"td",type:"content",showContent:!0,...t}))):l.createElement("tr",{key:a,className:`${n}-row`},b(r,e,{component:i?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0,...t}))};var h=n(15561),f=n(7961),y=n(10540),E=n(28403);let v=(0,y.OF)("Descriptions",e=>(e=>{let{componentCls:t,extraColor:n,itemPaddingBottom:l,itemPaddingEnd:o,colonMarginRight:r,colonMarginLeft:a,titleMarginBottom:i}=e;return{[t]:{...(0,f.dF)(e),...(e=>{let{componentCls:t,labelBg:n}=e;return{[`&${t}-bordered`]:{[`> ${t}-view`]:{border:`${(0,h.zA)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:"auto"},[`${t}-row`]:{borderBottom:`${(0,h.zA)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:first-child":{"> th:first-child, > td:first-child":{borderStartStartRadius:e.borderRadiusLG}},"&:last-child":{borderBottom:"none","> th:first-child, > td:first-child":{borderEndStartRadius:e.borderRadiusLG}},[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,h.zA)(e.padding)} ${(0,h.zA)(e.paddingLG)}`,borderInlineEnd:`${(0,h.zA)(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:"none"}},[`> ${t}-item-label`]:{color:e.colorTextSecondary,backgroundColor:n,"&::after":{display:"none"}}}},[`&${t}-medium`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,h.zA)(e.paddingSM)} ${(0,h.zA)(e.paddingLG)}`}}},[`&${t}-small`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${(0,h.zA)(e.paddingXS)} ${(0,h.zA)(e.padding)}`}}}}}})(e),"&-rtl":{direction:"rtl"},[`${t}-header`]:{display:"flex",alignItems:"center",marginBottom:i},[`${t}-title`]:{...f.L9,flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG},[`${t}-extra`]:{marginInlineStart:"auto",color:n,fontSize:e.fontSize},[`${t}-view`]:{width:0,minWidth:"100%",borderRadius:e.borderRadiusLG,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},[`${t}-row`]:{"> th, > td":{paddingBottom:l,paddingInlineEnd:o},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},[`${t}-item-label`]:{color:e.labelColor,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:`${(0,h.zA)(a)} ${(0,h.zA)(r)}`},[`&${t}-item-no-colon::after`]:{content:'""'}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:'""'}},[`${t}-item-content`]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},[`${t}-item`]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",[`${t}-item-label`]:{display:"inline-flex",alignItems:"baseline"},[`${t}-item-content`]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-medium":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}}}})((0,E.oX)(e,{})),e=>({labelBg:e.colorFillAlter,labelColor:e.colorTextTertiary,titleColor:e.colorText,titleMarginBottom:e.fontSizeSM*e.lineHeightSM,itemPaddingBottom:e.padding,itemPaddingEnd:e.padding,colonMarginRight:e.marginXS,colonMarginLeft:e.marginXXS/2,contentColor:e.colorText,extraColor:e.colorText})),x=e=>{let{prefixCls:t,title:n,extra:u,column:b,colon:h=!0,bordered:f,layout:y,children:E,className:x,rootClassName:S,style:w,size:A,labelStyle:C,contentStyle:N,styles:z,items:I,classNames:k,...M}=e,{getPrefixCls:B,direction:L,className:H,style:T,classNames:R,styles:P}=(0,s.TP)("descriptions"),W=B("descriptions",t),X=(0,d.A)(),G=l.useMemo(()=>(0,a.Et)(b)?b:(0,i.ko)(X,b)??(0,i.ko)(X,m)??3,[X,b]),D=function(e,t,n){let o=l.useMemo(()=>t||(0,$.$r)(n).map(e=>({...e?.props,key:e.key})),[t,n]);return l.useMemo(()=>o.map(({span:t,...n})=>"filled"===t?{...n,filled:!0}:{...n,span:(0,a.Et)(t)?t:(0,i.ko)(e,t)}),[o,e])}(X,I,E),F=(0,c.A)(A),Q=((e,t)=>{let[n,o]=(0,l.useMemo)(()=>(function(e,t){let n=[],l=[],o=!1,r=0;return e.filter(e=>e).forEach(e=>{let{filled:a,...i}=e;if(a){l.push(i),n.push(l),l=[],r=0;return}let s=t-r;(r+=e.span||1)>=t?(r>t?(o=!0,l.push({...i,span:s})):l.push(i),n.push(l),l=[],r=0):l.push(i)}),l.length>0&&n.push(l),[n=n.map(e=>{let n=e.reduce((e,t)=>e+(t.span||1),0);if(n<t){let l=e[e.length-1];l.span=t-(n-(l.span||1))}return e}),o]})(t,e),[t,e]);return n})(G,D),[K,V]=v(W),Z={...e,column:G,items:D,size:F},_=(0,r.XT)(T),O=(0,r.XT)(w),[j,q]=(0,r.AV)([R,k],[P,_,z,O],{props:Z}),J=l.useMemo(()=>({labelStyle:C,contentStyle:N,styles:{label:q.label,content:q.content},classNames:{label:j.label,content:j.content}}),[C,N,q.label,q.content,j.label,j.content]);return l.createElement(p.Provider,{value:J},l.createElement("div",{className:(0,o.$)(W,H,j.root,{[`${W}-medium`]:"medium"===F||"middle"===F,[`${W}-small`]:"small"===F,[`${W}-bordered`]:!!f,[`${W}-rtl`]:"rtl"===L},x,S,K,V),style:q.root,...M},(n||u)&&l.createElement("div",{className:(0,o.$)(`${W}-header`,j.header),style:q.header},n&&l.createElement("div",{className:(0,o.$)(`${W}-title`,j.title),style:q.title},n),u&&l.createElement("div",{className:(0,o.$)(`${W}-extra`,j.extra),style:q.extra},u)),l.createElement("div",{className:`${W}-view`},l.createElement("table",null,l.createElement("tbody",null,Q.map((e,t)=>l.createElement(g,{key:t,index:t,colon:h,prefixCls:W,vertical:"vertical"===y,bordered:f,row:e})))))))};x.Item=e=>e.children;let S=x},85493:(e,t,n)=>{n.d(t,{A:()=>k});var l=n(97109),o=n(59188),r=n(4216),a=n(45042),i=n(97137),s=n(62188),c=n(67189),d=n(42644),m=n(3638),p=n(92162),$=n(26047),u=n(74567),b=n(15561),g=n(7961),h=n(10540);let f=(e,t,n)=>({background:e,[`${n}-icon`]:{color:t}}),y=(0,h.OF)("Alert",e=>[(e=>{let{componentCls:t,motionDurationSlow:n,marginXS:l,marginSM:o,fontSize:r,fontSizeLG:a,lineHeight:i,borderRadiusLG:s,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:m,colorTextHeading:p,withDescriptionPadding:$,defaultPadding:u,lineWidth:h,lineType:f,colorSuccessBorder:y,colorWarningBorder:E,colorErrorBorder:v,colorInfoBorder:x}=e;return{[t]:{...(0,g.dF)(e),position:"relative",display:"flex",alignItems:"center",padding:u,wordWrap:"break-word",borderRadius:s,borderWidth:(0,b.zA)(h),borderStyle:f,[`&${t}-success`]:{borderColor:y},[`&${t}-info`]:{borderColor:x},[`&${t}-warning`]:{borderColor:E},[`&${t}-error`]:{borderColor:v},[`&${t}-filled`]:{borderColor:"transparent"},[`&${t}-rtl`]:{direction:"rtl"},[`${t}-section`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:l,lineHeight:0},"&-description":{display:"none",fontSize:r,lineHeight:i},"&-title":{color:p},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:["max-height","opacity","padding-top","padding-bottom","margin-bottom"].map(e=>`${e} ${n} ${c}`).join(", ")},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0},[`&${t}-with-description`]:{alignItems:"flex-start",padding:$,[`${t}-icon`]:{marginInlineEnd:o,fontSize:d,lineHeight:0},[`${t}-title`]:{display:"block",marginBottom:l,color:p,fontSize:a},[`${t}-description`]:{display:"block",color:m}},[`&${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}}})(e),(e=>{let{componentCls:t,colorSuccess:n,colorSuccessBg:l,colorWarning:o,colorWarningBg:r,colorError:a,colorErrorBg:i,colorInfo:s,colorInfoBg:c}=e;return{[t]:{"&-success":f(l,n,t),"&-info":f(c,s,t),"&-warning":f(r,o,t),"&-error":{...f(i,a,t),[`${t}-description > pre`]:{margin:0,padding:0}}}}})(e),(e=>{let{componentCls:t,iconCls:n,motionDurationMid:l,marginXS:o,fontSizeIcon:r,colorIcon:a,colorIconHover:i}=e;return{[t]:{[`${t}-actions`]:{marginInlineStart:o},[`${t}-close-icon`]:{marginInlineStart:o,padding:0,overflow:"hidden",fontSize:r,lineHeight:(0,b.zA)(r),backgroundColor:"transparent",border:"none",cursor:"pointer",...(0,g.K8)(e),[`${n}-close`]:{color:a,transition:`color ${l}`,"&:hover":{color:i}}},"&-close-text":{color:a,transition:`color ${l}`,"&:hover":{color:i}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),E=e=>{let{icon:t,type:n,className:a,style:c,successIcon:d,infoIcon:m,warningIcon:p,errorIcon:$}=e,u={success:d??l.createElement(o.A,null),info:m??l.createElement(s.A,null),error:$??l.createElement(r.A,null),warning:p??l.createElement(i.A,null)};return l.createElement("span",{className:a,style:c},t??u[n])},v=e=>{let{isClosable:t,prefixCls:n,closeIcon:o,handleClose:r,ariaProps:i,className:s,style:c}=e,d=!0===o||void 0===o?l.createElement(a.A,null):o;return t?l.createElement("button",{type:"button",onClick:r,className:(0,m.$)(`${n}-close-icon`,s),tabIndex:0,style:c,...i},d):null},x=l.forwardRef((e,t)=>{let{description:n,prefixCls:o,message:r,title:a,banner:i,className:s,rootClassName:b,style:g,onMouseEnter:h,onMouseLeave:f,onClick:x,afterClose:S,showIcon:w,closable:A,closeText:C,closeIcon:N,action:z,id:I,styles:k,classNames:M,...B}=e,L=a??r,[H,T]=l.useState(!1),R=l.useRef(null);l.useImperativeHandle(t,()=>({nativeElement:R.current}));let{getPrefixCls:P,direction:W,variant:X,closable:G,closeIcon:D,className:F,style:Q,classNames:K,styles:V,successIcon:Z,infoIcon:_,warningIcon:O,errorIcon:j}=(0,u.TP)("alert"),q=P("alert",o),[J,U]=y(q),{onClose:Y,afterClose:ee}=(0,$.Qd)(A)?A:{},et=t=>{T(!0),(Y??e.onClose)?.(t)},en=l.useMemo(()=>void 0!==e.type?e.type:i?"warning":"info",[e.type,i]),el=e.variant??X??"outlined",eo=l.useMemo(()=>!!(0,$.Qd)(A)&&!!A.closeIcon||!!C||("boolean"==typeof A?A:!!(!1!==N&&(0,$.R)(N))||!!G),[C,N,A,G]),er=!!i&&void 0===w||w,ea={...e,prefixCls:q,variant:el,type:en,showIcon:er,closable:eo},ei=(0,p.XT)(Q),es=(0,p.XT)(g),[ec,ed]=(0,p.AV)([K,M],[V,ei,k,es],{props:ea}),em=(0,m.$)(q,`${q}-${en}`,`${q}-${el}`,{[`${q}-with-description`]:!!n,[`${q}-no-icon`]:!er,[`${q}-banner`]:!!i,[`${q}-rtl`]:"rtl"===W},F,s,b,ec.root,U,J),ep=(0,d.KE)(B,{aria:!0,data:!0}),e$=l.useMemo(()=>(0,$.Qd)(A)&&A.closeIcon?A.closeIcon:C||(void 0!==N?N:(0,$.Qd)(G)&&G.closeIcon?G.closeIcon:D),[N,A,G,C,D]),eu=l.useMemo(()=>{let e=A??G;return(0,$.Qd)(e)?(0,d.KE)(e,{data:!0,aria:!0}):{}},[A,G]);return l.createElement(c.Ay,{visible:!H,motionName:`${q}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:ee??S},({className:t,style:o},r)=>l.createElement("div",{id:I,ref:(0,d.K4)(R,r),"data-show":!H,className:(0,m.$)(em,t),style:{...ed.root,...o},onMouseEnter:h,onMouseLeave:f,onClick:x,role:"alert",...ep},er?l.createElement(E,{className:(0,m.$)(`${q}-icon`,ec.icon),style:ed.icon,description:n,icon:e.icon,prefixCls:q,type:en,successIcon:Z,infoIcon:_,warningIcon:O,errorIcon:j}):null,l.createElement("div",{className:(0,m.$)(`${q}-section`,ec.section),style:ed.section},L?l.createElement("div",{className:(0,m.$)(`${q}-title`,ec.title),style:ed.title},L):null,n?l.createElement("div",{className:(0,m.$)(`${q}-description`,ec.description),style:ed.description},n):null),z?l.createElement("div",{className:(0,m.$)(`${q}-actions`,ec.actions),style:ed.actions},z):null,l.createElement(v,{className:ec.close,style:ed.close,isClosable:eo,prefixCls:q,closeIcon:e$,handleClose:et,ariaProps:eu})))});var S=n(41113),w=n(49939),A=n(90218),C=n(13076),N=n(83784),z=n(15472);let I=function(e){function t(){var e,n,l;return(0,S.A)(this,t),n=t,l=arguments,n=(0,A.A)(n),(e=(0,N.A)(this,(0,C.A)()?Reflect.construct(n,l||[],(0,A.A)(this).constructor):n.apply(this,l))).state={error:void 0,info:{}},e}return(0,z.A)(t,e),(0,w.A)(t,[{key:"componentDidCatch",value:function(e,t){this.setState({error:e,info:t})}},{key:"render",value:function(){let{message:e,title:t,description:n,id:o,children:r}=this.props,{error:a,info:i}=this.state,s=t??e,c=i?.componentStack||null,d=(0,$.R)(s)?s:a?.toString(),m=(0,$.R)(n)?n:c;return a?l.createElement(x,{id:o,type:"error",title:d,description:l.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},m)}):r}}])}(l.PureComponent);x.ErrorBoundary=I;let k=x}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5257],{75257:(e,s,l)=>{l.d(s,{q:()=>F});var a=l(65321),r=l(97109),i=l(86109),t=l(48399),c=l(17807),n=l(63455),d=l(88762),o=l(85493),m=l(84253),x=l(85114),h=l(33442),p=l(99650),j=l(67547),u=l(43220),g=l.n(u),A=l(85979),b=l(7576),k=l(44534),f=l(57271),v=l(54746),y=l(39507),N=l(14524);let{Text:I}=t.A;function w(e){var s,l;let{form:r,options:i,idLocked:t}=e,c=(0,y.Vr)(),d=i.chapterDomains.map(e=>({value:e.value,label:e.label,title:e.note})),o=i.projectTypes.map(e=>({value:e.value,label:e.label})),m=i.factSources.map(e=>({value:e.value,label:e.label})),h=i.processCards.map(e=>({value:e.value,label:e.label}));return(0,a.jsxs)(n.A,{form:r,layout:"vertical",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 items-start",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)(N.PZ,{title:"基本信息",description:"技能的身份与启停;ID 是落盘文件名,新建后不再改。",children:[(0,a.jsx)(n.A.Item,{name:"id",label:"技能 ID",rules:[{required:!0,message:"技能 ID 必填"}],extra:"使用小写字母、数字和连字符,以字母开头。",children:(0,a.jsx)(b.A,{disabled:t,placeholder:"例如 c02-major-content-building"})}),(0,a.jsx)(n.A.Item,{name:"enabled",label:"启用",valuePropName:"checked",extra:"停用后本条技能不参与本次生成的技能匹配。",className:"!mb-0",children:(0,a.jsx)(k.A,{checkedChildren:"启用",unCheckedChildren:"停用"})})]}),(0,a.jsxs)(N.PZ,{title:"匹配条件",description:"决定这条技能在什么章域、什么工程类型、什么样的章节标题下被选用。",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-4",children:[(0,a.jsx)(n.A.Item,{name:["match","chapterDomain"],label:"章域",rules:[{required:!0,message:"章域必选"}],extra:"本章所属的专业内容范围。",children:(0,a.jsx)(f.A,{options:d,placeholder:"选择本章所属的内容域"})}),(0,a.jsx)(n.A.Item,{name:["match","projectTypes"],label:"适用工程类型",extra:"留空表示不限定工程类型。",children:(0,a.jsx)(f.A,{mode:"multiple",allowClear:!0,options:o,placeholder:"全类型"})})]}),(0,a.jsx)(n.A.Item,{name:["match","sectionKeywords"],label:"小节标题关键词",extra:"用于匹配相关小节标题,可输入多个关键词。",children:(0,a.jsx)(f.A,{mode:"tags",tokenSeparators:[",",","," "],placeholder:"输入后回车,例如:主要施工 / 分部分项"})}),(0,a.jsx)(n.A.Item,{name:["match","sectionRegex"],label:"小节标题匹配表达式(可选)",extra:"填写正则表达式文本;复杂或不安全的表达式会被校验拒绝。",className:"!mb-0",children:(0,a.jsx)(b.A,{placeholder:"例如 交通导改|导行|管线保护"})})]}),(0,a.jsx)(N.PZ,{title:"禁写项",description:"这条技能明确要求避免的内容或表达;没有就留空。",children:(0,a.jsx)(n.A.Item,{name:"forbidden",extra:"填错一条会挡住真实存在的内容,宁可留空。",className:"!mb-0",children:(0,a.jsx)(f.A,{mode:"tags",tokenSeparators:[",",","],placeholder:"输入后回车,例如:管道闭水试验"})})}),(0,a.jsx)(N.PZ,{title:"相关专业主题",description:"本条技能提供的专业内容主题;主题下的小标签写这一主题要覆盖的工序、条件、控制点或验收要求。",children:(0,a.jsx)(n.A.List,{name:"structure",children:(e,s)=>{let{add:l,remove:r}=s;return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[e.map(e=>{let{key:s,name:l,...i}=e;return(0,a.jsxs)(N.jT,{onRemove:()=>r(l),columns:"md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]",children:[(0,a.jsx)(n.A.Item,{...i,name:[l,"title"],rules:[{required:!0,message:"专业主题标题必填"}],className:"!mb-0",children:(0,a.jsx)(b.A,{placeholder:"专业主题标题"})}),(0,a.jsx)(n.A.Item,{...i,name:[l,"required"],extra:"按实际对象选用",className:"!mb-0",children:(0,a.jsx)(f.A,{mode:"tags",className:"w-full",placeholder:"工序、适用条件、控制要点或验收要求"})})]},s)}),(0,a.jsxs)(x.Ay,{type:"dashed",block:!0,icon:(0,a.jsx)(v.A,{}),onClick:()=>l({required:[]}),children:[c("common.add"),"专业主题"]})]})}})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(N.PZ,{title:"所需项目资料",description:"本条技能要求本次任务先查证的项目事实(事实键来自服务端闭集);标为必需而查不到时会被上游拦下。",children:(0,a.jsx)(n.A.List,{name:"requires",children:(e,s)=>{let{add:l,remove:r}=s;return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[e.map(e=>{let{key:s,name:l,...i}=e;return(0,a.jsxs)(N.jT,{onRemove:()=>r(l),columns:"md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)_auto]",children:[(0,a.jsx)(n.A.Item,{...i,name:[l,"key"],rules:[{required:!0,message:"事实键必填"}],className:"!mb-0",children:(0,a.jsx)(b.A,{placeholder:"事实键,如 boq.divisions"})}),(0,a.jsx)(n.A.Item,{...i,name:[l,"source"],rules:[{required:!0,message:"来源必选"}],className:"!mb-0",children:(0,a.jsx)(f.A,{options:m,placeholder:"事实来源"})}),(0,a.jsx)(n.A.Item,{...i,name:[l,"required"],valuePropName:"checked",className:"!mb-0",children:(0,a.jsx)(k.A,{checkedChildren:"必需",unCheckedChildren:"可选"})})]},s)}),(0,a.jsxs)(x.Ay,{type:"dashed",block:!0,icon:(0,a.jsx)(v.A,{}),onClick:()=>l({source:"boq",required:!1}),children:[c("common.add"),"事实需求"]})]})}})}),(0,a.jsxs)(N.PZ,{title:"文档业务提示",description:"给本次规划的建议:文档名称、本章职责与资料检索提示。实际章节职责由本次规划确定,专业主题在上面的卡片里单独填写。",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-4",children:[(0,a.jsx)(n.A.Item,{name:"outputTitle",label:"文档名称建议",extra:"提供文档名称建议,实际名称由本次生成配置确定。",children:(0,a.jsx)(b.A,{placeholder:"留空 = 本技能不对文档名称表态"})}),(0,a.jsx)(n.A.Item,{name:["chapterChecklist","purpose"],label:"章级内容提示",extra:"说明本章关注的专业内容。",children:(0,a.jsx)(b.A,{placeholder:"例如:说明本工程的安全管理目标与危大工程清单"})})]}),(0,a.jsxs)("div",{className:"mt-1 mb-3 border-t border-[var(--colorBorderSecondary)] pt-3",children:[(0,a.jsx)(I,{strong:!0,className:"text-sm",children:"章级清单"}),(0,a.jsx)(I,{type:"secondary",className:"text-xs ml-2",children:"章级候选内容与资料检索提示;实际职责由本次规划确定。"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-4",children:[(0,a.jsx)(n.A.Item,{name:["chapterChecklist","queries"],label:"资料检索词",extra:"帮助定位相关资料。",children:(0,a.jsx)(f.A,{mode:"tags",tokenSeparators:[",",","],className:"w-full",placeholder:"回车添加"})}),(0,a.jsx)(n.A.Item,{name:["chapterChecklist","requiredFacts"],label:"待核事实提示",extra:"提示应查证的项目事实。",children:(0,a.jsx)(f.A,{mode:"tags",tokenSeparators:[",",","],className:"w-full",placeholder:"回车添加"})}),(0,a.jsx)(n.A.Item,{name:["chapterChecklist","tableSections"],label:"成表内容建议",extra:"提示适合用表格表达的内容。",children:(0,a.jsx)(f.A,{mode:"tags",tokenSeparators:[",",","],className:"w-full",placeholder:"回车添加"})}),(0,a.jsx)(n.A.Item,{name:["chapterChecklist","tableRequirements"],label:"表格表达提示",extra:"提示表格列项与表达方式。",children:(0,a.jsx)(f.A,{mode:"tags",tokenSeparators:[",",","],className:"w-full",placeholder:"回车添加"})})]}),(0,a.jsx)(n.A.Item,{name:["chapterChecklist","pinnedEvidenceFilePaths"],label:"相关证据文件",extra:"填写需要关注的文件名;实际读取范围和来源资格仍由本次任务核对。",className:"!mb-0",children:(0,a.jsx)(f.A,{mode:"tags",tokenSeparators:[",",","],placeholder:"回车添加文件名"})}),(null!=(l=null==(s=i.absentCarriers)?void 0:s.length)?l:0)>0&&(0,a.jsxs)("div",{className:"mt-4 rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-4 py-3",children:[(0,a.jsx)("div",{className:"text-xs font-semibold mb-1",children:"不在这里配置的事项"}),(0,a.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)]",children:i.absentCarriers.map(e=>(0,a.jsxs)("div",{children:[e.label,":","formatting"===e.id?"排版要求由招标资料与导出设置管理,技能编辑器提供专业内容。":e.note]},e.id))})]})]}),(0,a.jsx)(N.PZ,{title:"可加载工艺知识",description:"选用后,这些工艺卡会作为专业参考进入本次写作;引用是否存在由保存前的校验核对。",children:(0,a.jsx)(n.A.List,{name:"knowledge",children:(e,s)=>{let{add:l,remove:r}=s;return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[e.map(e=>{let{key:s,name:l,...i}=e;return(0,a.jsxs)(N.jT,{onRemove:()=>r(l),columns:"md:grid-cols-[minmax(0,1fr)]",children:[(0,a.jsx)(n.A.Item,{...i,name:[l,"ids"],rules:[{required:!0,type:"array",min:1,message:"请选择实际工艺卡"}],className:"!mb-0",children:(0,a.jsx)(f.A,{mode:"multiple",showSearch:!0,optionFilterProp:"label",options:h,placeholder:"按工艺卡名称搜索"})}),(0,a.jsx)(n.A.Item,{...i,name:[l,"note"],className:"!mb-0 mt-2",children:(0,a.jsx)(b.A,{placeholder:"适用条件说明(可选):什么情况下加载这些工艺卡"})})]},s)}),(0,a.jsxs)(x.Ay,{type:"dashed",block:!0,icon:(0,a.jsx)(v.A,{}),onClick:()=>l({kind:"processCard",ids:[]}),children:[c("common.add"),"工艺知识"]})]})}})}),(0,a.jsx)(N.PZ,{title:"专业写作核对提示",description:"写清适用对象、方法和检验注意。提示供作者按具体任务选用,不构成评分、字数或参数数量要求。",children:(0,a.jsx)(n.A.List,{name:"acceptance",children:(e,s)=>{let{add:l,remove:r}=s;return(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[e.map(e=>{let{key:s,name:l,...i}=e;return(0,a.jsx)(N.jT,{onRemove:()=>r(l),columns:"md:grid-cols-[minmax(0,1fr)]",children:(0,a.jsx)(n.A.Item,{...i,name:[l,"checklistItems"],rules:[{required:!0,type:"array",min:1,message:"请输入专业注意事项"}],className:"!mb-0",children:(0,a.jsx)(f.A,{mode:"tags",className:"w-full",placeholder:"例如:保留实际检验对象、触发条件和转序要求"})})},s)}),(0,a.jsxs)(x.Ay,{type:"dashed",block:!0,icon:(0,a.jsx)(v.A,{}),onClick:()=>l({kind:"llmChecklist",checklistItems:[]}),children:[c("common.add"),"专业提示"]})]})}})})]})]}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(N.PZ,{title:"资料与采用边界",description:"以下边界由软件统一执行,技能不能扩大或豁免。",children:(0,a.jsx)("div",{className:"flex flex-col gap-2",children:i.isolationRules.map(e=>(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-baseline gap-1 sm:gap-2",children:[(0,a.jsx)(I,{className:"text-sm shrink-0",children:e.label}),(0,a.jsx)(I,{type:"secondary",className:"text-xs",children:e.note})]},e.id))})})})]})}var C=l(33061),S=l(35071);let{Text:q}=t.A;function F(e){let{mode:s,skillId:l}=e,{message:t}=c.A.useApp(),u=(0,i.useRouter)(),[b]=n.A.useForm(),k=(0,C.G)(),[f,v]=(0,r.useState)(!1),[y,N]=(0,r.useState)([]),I=(0,r.useMemo)(()=>"edit"===s&&l?k.skills.find(e=>e.id===l):void 0,[s,l,k.skills]),F="edit"===s&&!l,P="edit"===s&&!k.loading&&!k.failed&&!I&&void 0!==k.options,[T,R]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(T||k.loading||!k.options)return;if("create"===s){b.resetFields(),b.setFieldsValue((0,S.Ie)()),R(!0);return}if(!I)return;let e=I.promptBindings;Array.isArray(e)&&e.length>0&&t.warning("「".concat(I.id,"」里还留着 ").concat(e.length," 条已退休的提示词绑定(promptBindings):该字段已随角色配置页删除,本次保存会把它从技能里移除。")),b.resetFields(),b.setFieldsValue((0,S.m6)(I)),R(!0)},[T,k.loading,k.options,s,I,b,t]);let L=async()=>{let e;if(!k.options)return;try{e=await b.validateFields()}catch(e){return}let s=(0,S.RW)(e,k.options.contractVersion,null==I?void 0:I.examples);v(!0),N([]);try{var l,a,r;let i=await (0,S.SS)("/api/skills/validate",{method:"POST",headers:S.eT,body:JSON.stringify(s)});if(!i.ok){t.error("校验请求失败:".concat(i.message)),N(i.issues);return}if(!i.data.ok){N(i.data.errors),t.error("校验未通过:".concat(i.data.errors.length," 处问题,请核对技能字段和工艺卡引用。"));return}let c=I?await (0,S.SS)("/api/skills/".concat(encodeURIComponent(I.id)),{method:"PUT",headers:S.eT,body:JSON.stringify(s)}):await (0,S.SS)("/api/skills",{method:"POST",headers:S.eT,body:JSON.stringify(s)});if(!c.ok){N(c.issues),t.error("保存失败:".concat(c.message));return}(null==(l=c.data.warnings)?void 0:l.length)&&t.warning("已保存,但有 ".concat(c.data.warnings.length," 条提示:").concat(c.data.warnings.map(e=>e.message).join(";"))),t.success("已保存"),await u.push("/skills/".concat(encodeURIComponent(null!=(r=null==(a=c.data.skill)?void 0:a.id)?r:e.id)))}finally{v(!1)}};return F||k.loading?(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)(d.A,{active:!0,title:!0,paragraph:{rows:2}}),(0,a.jsx)(d.A,{active:!0,paragraph:{rows:12}})]}):k.failed?(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)(A.k,{backHref:"/skills",backLabel:"返回技能库",title:"create"===s?"新建技能":"编辑技能"}),(0,a.jsx)(o.A,{type:"error",showIcon:!0,message:"技能库读取失败",description:"".concat(k.failed,';这不是"技能不存在",请核对服务端状态后重试。')})]}):P?(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)(A.k,{backHref:"/skills",backLabel:"返回技能库",title:"编辑技能"}),(0,a.jsx)(m.A,{description:"技能库里没有「".concat(l,"」这条技能(可能已被删除或改名)"),children:(0,a.jsx)(g(),{href:"/skills",children:(0,a.jsx)(x.Ay,{type:"primary",children:"返回技能库"})})})]}):k.options?(null==I?void 0:I.builtIn)?(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)(A.k,{backHref:"/skills",backLabel:"返回技能库",title:"编辑技能 \xb7 ".concat(I.displayName),description:"内置技能随应用版本更新,不能在这里修改。",extra:(0,a.jsx)(g(),{href:"/skills/".concat(encodeURIComponent(I.id)),children:(0,a.jsx)(x.Ay,{icon:(0,a.jsx)(p.A,{}),children:"查看预览"})})}),(0,a.jsx)(o.A,{type:"info",showIcon:!0,message:"内置技能",description:S.F}),(0,a.jsx)("div",{children:(0,a.jsx)(g(),{href:"/skills/new",children:(0,a.jsx)(x.Ay,{type:"primary",children:"新建用户技能"})})})]}):(0,a.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,a.jsx)(A.k,{backHref:"/skills",backLabel:"返回技能库",title:I?"编辑技能 \xb7 ".concat(I.displayName):"新建技能",description:I?"改动会在保存前做一次字段与工艺卡引用校验,通过后写入技能文件。":"技能提供专业主题、资料需求、工艺知识和写作核对提示;保存前同样会做引用校验。",extra:(0,a.jsxs)(a.Fragment,{children:[I?(0,a.jsx)(g(),{href:"/skills/".concat(encodeURIComponent(I.id)),children:(0,a.jsx)(x.Ay,{children:"放弃改动并返回预览"})}):(0,a.jsx)(g(),{href:"/skills",children:(0,a.jsx)(x.Ay,{children:"取消"})}),(0,a.jsxs)(h.A,{size:4,children:[(0,a.jsx)(q,{type:"secondary",className:"text-xs",children:"保存后自动进入预览"}),(0,a.jsx)(x.Ay,{type:"primary",icon:(0,a.jsx)(j.A,{}),loading:f,onClick:()=>{L()},children:"保存"})]})]})}),(null==I?void 0:I.examples)&&(0,a.jsx)(o.A,{type:"info",showIcon:!0,message:"该技能带表达示例",description:"示例供理解专业表达,不能作为本项目事实;本编辑器不修改示例,保存时原样保留。"}),y.length>0&&(0,a.jsx)(o.A,{type:"error",showIcon:!0,message:"校验未通过:".concat(y.length," 处"),description:(0,a.jsx)("div",{className:"text-xs",children:y.map((e,s)=>{var l;return(0,a.jsxs)("div",{children:[(0,a.jsx)(q,{code:!0,children:e.path||"(root)"})," ",e.message]},"".concat(null!=(l=e.path)?l:"root","-").concat(s))})})}),(0,a.jsx)(w,{form:b,options:k.options,idLocked:!!I})]}):null}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6505],{10218:(e,t,o)=>{o.d(t,{A:()=>g,H:()=>h});var n=o(97109),r=o(4932),l=o(42644);let i=e=>"object"==typeof e&&null!=e&&1===e.nodeType,a=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,c=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let o=getComputedStyle(e,null);return a(o.overflowY,t)||a(o.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},s=(e,t,o,n,r,l,i,a)=>l<e&&i>t||l>e&&i<t?0:l<=e&&a<=o||i>=t&&a>=o?l-e-n:i>t&&a<o||l<e&&a>o?i-t+r:0,d=e=>{let t=e.parentElement;return null==t?e.getRootNode().host||null:t},u=(e,t)=>{var o,n,r,l;if("undefined"==typeof document)return[];let{scrollMode:a,block:u,inline:p,boundary:f,skipOverflowHiddenElements:h}=t,m="function"==typeof f?f:e=>e!==f;if(!i(e))throw TypeError("Invalid target");let g=document.scrollingElement||document.documentElement,v=[],b=e;for(;i(b)&&m(b);){if((b=d(b))===g){v.push(b);break}null!=b&&b===document.body&&c(b)&&!c(document.documentElement)||null!=b&&c(b,h)&&v.push(b)}let $=null!=(n=null==(o=window.visualViewport)?void 0:o.width)?n:innerWidth,y=null!=(l=null==(r=window.visualViewport)?void 0:r.height)?l:innerHeight,{scrollX:w,scrollY:E}=window,{height:A,width:I,top:H,right:M,bottom:C,left:N}=e.getBoundingClientRect(),{top:k,right:x,bottom:S,left:R}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),W="start"===u||"nearest"===u?H-k:"end"===u?C+S:H+A/2-k+S,z="center"===p?N+I/2-R+x:"end"===p?M+x:N-R,_=[];for(let e=0;e<v.length;e++){let t=v[e],{height:o,width:n,top:r,right:l,bottom:i,left:d}=t.getBoundingClientRect();if("if-needed"===a&&H>=0&&N>=0&&C<=y&&M<=$&&(t===g&&!c(t)||H>=r&&C<=i&&N>=d&&M<=l))break;let f=getComputedStyle(t),h=parseInt(f.borderLeftWidth,10),m=parseInt(f.borderTopWidth,10),b=parseInt(f.borderRightWidth,10),k=parseInt(f.borderBottomWidth,10),x=0,S=0,R="offsetWidth"in t?t.offsetWidth-t.clientWidth-h-b:0,F="offsetHeight"in t?t.offsetHeight-t.clientHeight-m-k:0,j="offsetWidth"in t?0===t.offsetWidth?0:n/t.offsetWidth:0,B="offsetHeight"in t?0===t.offsetHeight?0:o/t.offsetHeight:0;if(g===t)x="start"===u?W:"end"===u?W-y:"nearest"===u?s(E,E+y,y,m,k,E+W,E+W+A,A):W-y/2,S="start"===p?z:"center"===p?z-$/2:"end"===p?z-$:s(w,w+$,$,h,b,w+z,w+z+I,I),x=Math.max(0,x+E),S=Math.max(0,S+w);else{x="start"===u?W-r-m:"end"===u?W-i+k+F:"nearest"===u?s(r,i,o,m,k+F,W,W+A,A):W-(r+o/2)+F/2,S="start"===p?z-d-h:"center"===p?z-(d+n/2)+R/2:"end"===p?z-l+b+R:s(d,l,n,h,b+R,z,z+I,I);let{scrollLeft:e,scrollTop:a}=t;x=0===B?0:Math.max(0,Math.min(a+x/B,t.scrollHeight-o/B+F)),S=0===j?0:Math.max(0,Math.min(e+S/j,t.scrollWidth-n/j+R)),W+=a-x,z+=e-S}_.push({el:t,top:x,left:S})}return _};var p=o(26047),f=o(44624);function h(e){return(0,f.$r)(e).join("_")}function m(e,t){let o=t.getFieldInstance(e),n=(0,l.rb)(o);if(n)return n;let r=(0,f.kV)((0,f.$r)(e),t.__INTERNAL__.name);if(r)return document.getElementById(r)}function g(e){let[t]=(0,r.mN)(),o=n.useRef({}),l=n.useMemo(()=>e??{...t,__INTERNAL__:{itemRef:e=>t=>{let n=h(e);t?o.current[n]=t:delete o.current[n]}},scrollToField:(e,t={})=>{let{focus:o,...n}=t,r=m(e,l);r&&(!function(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let o=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if("object"==typeof t&&"function"==typeof t.behavior)return t.behavior(u(e,t));let n="boolean"==typeof t||null==t?void 0:t.behavior;for(let{el:r,top:l,left:i}of u(e,!1===t?{block:"end",inline:"nearest"}:t===Object(t)&&0!==Object.keys(t).length?t:{block:"start",inline:"nearest"})){let e=l-o.top+o.bottom,t=i-o.left+o.right;r.scroll({top:e,left:t,behavior:n})}}(r,{scrollMode:"if-needed",block:"nearest",...n}),o&&l.focusField(e))},focusField:e=>{let t=l.getFieldInstance(e);(0,p.Tn)(t?.focus)?t.focus():m(e,l)?.focus?.()},getFieldInstance:e=>{let t=h(e);return o.current[t]}},[e,t]);return[l]}},15437:(e,t,o)=>{o.d(t,{A:()=>n});let n=e=>{let{componentCls:t,antCls:o,motionDurationMid:n,motionEaseInOut:r}=e;return{[t]:{[`${o}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`${["height","opacity"].map(e=>`${e} ${n} ${r}`).join(", ")} !important`}},[`${o}-motion-collapse`]:{overflow:"hidden",transition:`${["height","opacity"].map(e=>`${e} ${n} ${r}`).join(", ")} !important`}}}}},23793:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"}},44624:(e,t,o)=>{o.d(t,{$r:()=>r,BS:()=>i,kV:()=>l});let n=["parentNode"];function r(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function l(e,t){if(!e.length)return;let o=e.join("_");return t?`${t}_${o}`:n.includes(o)?`form_item_${o}`:o}function i(e,t,o,n,r,l){let i=n;return void 0!==l?i=l:o.validating?i="validating":e.length?i="error":t.length?i="warning":(o.touched||r&&o.validated)&&(i="success"),i}},51307:(e,t)=>{t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z"}}]},name:"save",theme:"outlined"}},58209:(e,t,o)=>{o.d(t,{A:()=>a});var n=o(97109),r=o(23793),l=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 a=n.forwardRef((e,t)=>n.createElement(l.A,i({},e,{ref:t,icon:r.A})))},67547:(e,t,o)=>{o.d(t,{A:()=>a});var n=o(97109),r=o(51307),l=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 a=n.forwardRef((e,t)=>n.createElement(l.A,i({},e,{ref:t,icon:r.A})))},85493:(e,t,o)=>{o.d(t,{A:()=>x});var n=o(97109),r=o(59188),l=o(4216),i=o(45042),a=o(97137),c=o(62188),s=o(67189),d=o(42644),u=o(3638),p=o(92162),f=o(26047),h=o(74567),m=o(15561),g=o(7961),v=o(10540);let b=(e,t,o)=>({background:e,[`${o}-icon`]:{color:t}}),$=(0,v.OF)("Alert",e=>[(e=>{let{componentCls:t,motionDurationSlow:o,marginXS:n,marginSM:r,fontSize:l,fontSizeLG:i,lineHeight:a,borderRadiusLG:c,motionEaseInOutCirc:s,withDescriptionIconSize:d,colorText:u,colorTextHeading:p,withDescriptionPadding:f,defaultPadding:h,lineWidth:v,lineType:b,colorSuccessBorder:$,colorWarningBorder:y,colorErrorBorder:w,colorInfoBorder:E}=e;return{[t]:{...(0,g.dF)(e),position:"relative",display:"flex",alignItems:"center",padding:h,wordWrap:"break-word",borderRadius:c,borderWidth:(0,m.zA)(v),borderStyle:b,[`&${t}-success`]:{borderColor:$},[`&${t}-info`]:{borderColor:E},[`&${t}-warning`]:{borderColor:y},[`&${t}-error`]:{borderColor:w},[`&${t}-filled`]:{borderColor:"transparent"},[`&${t}-rtl`]:{direction:"rtl"},[`${t}-section`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:n,lineHeight:0},"&-description":{display:"none",fontSize:l,lineHeight:a},"&-title":{color:p},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:["max-height","opacity","padding-top","padding-bottom","margin-bottom"].map(e=>`${e} ${o} ${s}`).join(", ")},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0},[`&${t}-with-description`]:{alignItems:"flex-start",padding:f,[`${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:l,colorError:i,colorErrorBg:a,colorInfo:c,colorInfoBg:s}=e;return{[t]:{"&-success":b(n,o,t),"&-info":b(s,c,t),"&-warning":b(l,r,t),"&-error":{...b(a,i,t),[`${t}-description > pre`]:{margin:0,padding:0}}}}})(e),(e=>{let{componentCls:t,iconCls:o,motionDurationMid:n,marginXS:r,fontSizeIcon:l,colorIcon:i,colorIconHover:a}=e;return{[t]:{[`${t}-actions`]:{marginInlineStart:r},[`${t}-close-icon`]:{marginInlineStart:r,padding:0,overflow:"hidden",fontSize:l,lineHeight:(0,m.zA)(l),backgroundColor:"transparent",border:"none",cursor:"pointer",...(0,g.K8)(e),[`${o}-close`]:{color:i,transition:`color ${n}`,"&:hover":{color:a}}},"&-close-text":{color:i,transition:`color ${n}`,"&:hover":{color:a}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),y=e=>{let{icon:t,type:o,className:i,style:s,successIcon:d,infoIcon:u,warningIcon:p,errorIcon:f}=e,h={success:d??n.createElement(r.A,null),info:u??n.createElement(c.A,null),error:f??n.createElement(l.A,null),warning:p??n.createElement(a.A,null)};return n.createElement("span",{className:i,style:s},t??h[o])},w=e=>{let{isClosable:t,prefixCls:o,closeIcon:r,handleClose:l,ariaProps:a,className:c,style:s}=e,d=!0===r||void 0===r?n.createElement(i.A,null):r;return t?n.createElement("button",{type:"button",onClick:l,className:(0,u.$)(`${o}-close-icon`,c),tabIndex:0,style:s,...a},d):null},E=n.forwardRef((e,t)=>{let{description:o,prefixCls:r,message:l,title:i,banner:a,className:c,rootClassName:m,style:g,onMouseEnter:v,onMouseLeave:b,onClick:E,afterClose:A,showIcon:I,closable:H,closeText:M,closeIcon:C,action:N,id:k,styles:x,classNames:S,...R}=e,W=i??l,[z,_]=n.useState(!1),F=n.useRef(null);n.useImperativeHandle(t,()=>({nativeElement:F.current}));let{getPrefixCls:j,direction:B,variant:T,closable:V,closeIcon:L,className:O,style:D,classNames:P,styles:Q,successIcon:X,infoIcon:K,warningIcon:G,errorIcon:Y}=(0,h.TP)("alert"),q=j("alert",r),[J,U]=$(q),{onClose:Z,afterClose:ee}=(0,f.Qd)(H)?H:{},et=t=>{_(!0),(Z??e.onClose)?.(t)},eo=n.useMemo(()=>void 0!==e.type?e.type:a?"warning":"info",[e.type,a]),en=e.variant??T??"outlined",er=n.useMemo(()=>!!(0,f.Qd)(H)&&!!H.closeIcon||!!M||("boolean"==typeof H?H:!!(!1!==C&&(0,f.R)(C))||!!V),[M,C,H,V]),el=!!a&&void 0===I||I,ei={...e,prefixCls:q,variant:en,type:eo,showIcon:el,closable:er},ea=(0,p.XT)(D),ec=(0,p.XT)(g),[es,ed]=(0,p.AV)([P,S],[Q,ea,x,ec],{props:ei}),eu=(0,u.$)(q,`${q}-${eo}`,`${q}-${en}`,{[`${q}-with-description`]:!!o,[`${q}-no-icon`]:!el,[`${q}-banner`]:!!a,[`${q}-rtl`]:"rtl"===B},O,c,m,es.root,U,J),ep=(0,d.KE)(R,{aria:!0,data:!0}),ef=n.useMemo(()=>(0,f.Qd)(H)&&H.closeIcon?H.closeIcon:M||(void 0!==C?C:(0,f.Qd)(V)&&V.closeIcon?V.closeIcon:L),[C,H,V,M,L]),eh=n.useMemo(()=>{let e=H??V;return(0,f.Qd)(e)?(0,d.KE)(e,{data:!0,aria:!0}):{}},[H,V]);return n.createElement(s.Ay,{visible:!z,motionName:`${q}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:ee??A},({className:t,style:r},l)=>n.createElement("div",{id:k,ref:(0,d.K4)(F,l),"data-show":!z,className:(0,u.$)(eu,t),style:{...ed.root,...r},onMouseEnter:v,onMouseLeave:b,onClick:E,role:"alert",...ep},el?n.createElement(y,{className:(0,u.$)(`${q}-icon`,es.icon),style:ed.icon,description:o,icon:e.icon,prefixCls:q,type:eo,successIcon:X,infoIcon:K,warningIcon:G,errorIcon:Y}):null,n.createElement("div",{className:(0,u.$)(`${q}-section`,es.section),style:ed.section},W?n.createElement("div",{className:(0,u.$)(`${q}-title`,es.title),style:ed.title},W):null,o?n.createElement("div",{className:(0,u.$)(`${q}-description`,es.description),style:ed.description},o):null),N?n.createElement("div",{className:(0,u.$)(`${q}-actions`,es.actions),style:ed.actions},N):null,n.createElement(w,{className:es.close,style:ed.close,isClosable:er,prefixCls:q,closeIcon:ef,handleClose:et,ariaProps:eh})))});var A=o(41113),I=o(49939),H=o(90218),M=o(13076),C=o(83784),N=o(15472);let k=function(e){function t(){var e,o,n;return(0,A.A)(this,t),o=t,n=arguments,o=(0,H.A)(o),(e=(0,C.A)(this,(0,M.A)()?Reflect.construct(o,n||[],(0,H.A)(this).constructor):o.apply(this,n))).state={error:void 0,info:{}},e}return(0,N.A)(t,e),(0,I.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:l}=this.props,{error:i,info:a}=this.state,c=t??e,s=a?.componentStack||null,d=(0,f.R)(c)?c:i?.toString(),u=(0,f.R)(o)?o:s;return i?n.createElement(E,{id:r,type:"error",title:d,description:n.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},u)}):l}}])}(n.PureComponent);E.ErrorBoundary=k;let x=E},91648:(e,t,o)=>{o.d(t,{A:()=>n});let n=(0,o(1278).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6748],{14524:(e,t,r)=>{r.d(t,{PZ:()=>d,RU:()=>u,jT:()=>p,n$:()=>m});var l=r(65321),s=r(48399),n=r(68787),i=r(33442),a=r(85114),c=r(58209);let{Text:o}=s.A;function d(e){let{title:t,description:r,hint:s,className:i,children:a}=e;return(0,l.jsxs)(n.A,{className:"rounded-2xl border-[var(--borderColor)] ".concat(null!=i?i:""),title:(0,l.jsx)("span",{className:"font-semibold",children:t}),extra:s?(0,l.jsx)("span",{className:"text-xs text-[var(--colorTextTertiary)]",children:s}):null,children:[r&&(0,l.jsx)("p",{className:"text-xs text-[var(--colorTextSecondary)] mb-4 mt-0 leading-relaxed",children:r}),a]})}function u(e){let{label:t,children:r,empty:s}=e,n=null==r||!1===r;return(0,l.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-[132px_minmax(0,1fr)] gap-x-4 gap-y-1 py-2 border-b border-[var(--colorBorderSecondary)] last:border-0",children:[(0,l.jsx)("div",{className:"text-xs text-[var(--colorTextTertiary)] sm:pt-1",children:t}),(0,l.jsx)("div",{className:"min-w-0 text-sm leading-6",children:n?(0,l.jsx)(o,{type:"secondary",className:"text-xs",children:null!=s?s:"未声明"}):r})]})}function m(e){let{items:t,empty:r}=e;return 0===t.length?(0,l.jsx)(o,{type:"secondary",className:"text-xs",children:null!=r?r:"未声明"}):(0,l.jsx)("div",{className:"tagWrap flex flex-wrap gap-1 min-w-0",children:t.map((e,t)=>(0,l.jsx)("span",{className:"min-w-0",children:e},t))})}function p(e){let{children:t,columns:r="md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",onRemove:s,removeLabel:n="删除这一行"}=e;return(0,l.jsxs)("div",{className:"flex items-start gap-3 rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-4 py-3 transition-colors hover:bg-[var(--colorBgHover)]",children:[(0,l.jsx)("div",{className:"min-w-0 flex-1 grid grid-cols-1 ".concat(r," gap-x-3 gap-y-1 items-start"),children:t}),(0,l.jsx)(i.A,{size:0,className:"self-center",children:(0,l.jsx)(a.Ay,{type:"text",danger:!0,size:"small",icon:(0,l.jsx)(c.A,{}),"aria-label":n,title:n,onClick:s})})]})}},33061:(e,t,r)=>{r.d(t,{G:()=>n});var l=r(97109),s=r(35071);function n(){let[e,t]=(0,l.useState)([]),[r,n]=(0,l.useState)(),[i,a]=(0,l.useState)([]),[c,o]=(0,l.useState)(!0),[d,u]=(0,l.useState)(""),m=(0,l.useCallback)(async()=>{o(!0);let e=await (0,s.SS)("/api/skills");if(e.ok){var r;t(e.data.skills),n(e.data.options),a(null!=(r=e.data.invalid)?r:[]),u("")}else u(e.message);o(!1)},[]);return(0,l.useEffect)(()=>{m()},[m]),{skills:e,options:r,invalid:i,loading:c,failed:d,reload:m,applySkills:t}}},35071:(e,t,r)=>{r.d(t,{F:()=>n,Ie:()=>o,Oz:()=>a,RW:()=>m,SS:()=>s,eT:()=>l,m6:()=>c});let l={"Content-Type":"application/json"};async function s(e,t){try{let l,s=await fetch(e,t),n=await s.text();try{l=n?JSON.parse(n):void 0}catch(e){l=void 0}if(!s.ok){var r;let e=null!=l?l:{};return{ok:!1,status:s.status,message:null!=(r=e.error)?r:"HTTP ".concat(s.status),issues:Array.isArray(e.errors)?e.errors:[]}}return{ok:!0,data:l}}catch(e){return{ok:!1,status:0,message:e instanceof Error?e.message:"网络请求失败",issues:[]}}}let n="内置技能只读,随应用版本更新。可新建用户技能进行配置。";function i(e){return[...new Set((null!=e?e:[]).map(e=>e.trim()).filter(e=>e.length>0))]}function a(e){return"string"==typeof e?e:e.phrase}function c(e){return{id:e.id,enabled:e.enabled,match:{chapterDomain:e.match.chapterDomain,projectTypes:[...e.match.projectTypes],sectionKeywords:[...e.match.sectionKeywords],...e.match.sectionRegex?{sectionRegex:e.match.sectionRegex}:{}},requires:e.requires.map(e=>({...e})),structure:e.structure.map(e=>{var t;return{title:e.title,required:[...null!=(t=e.required)?t:[]]}}),forbidden:e.forbidden.map(a),knowledge:e.knowledge.map(e=>({kind:e.kind,...e.ids?{ids:[...e.ids]}:{},...e.note?{note:e.note}:{}})),acceptance:e.acceptance.map(e=>({kind:"llmChecklist",checklistItems:[...e.items]})),...void 0!==e.outputTitle?{outputTitle:e.outputTitle}:{},...e.chapterChecklist?{chapterChecklist:{...e.chapterChecklist,...e.chapterChecklist.sections?{sections:[...e.chapterChecklist.sections]}:{}}}:{}}}function o(){return{id:"skill-".concat(Date.now()),enabled:!0,match:{projectTypes:[],sectionKeywords:[]},requires:[{source:"boq",required:!1}],structure:[{}],forbidden:[],knowledge:[],acceptance:[{kind:"llmChecklist",checklistItems:[]}]}}function d(e){var t;return(null!=(t=e.ids)?t:[]).length>0}function u(e){var t;return(null!=(t=e.checklistItems)?t:[]).length>0}function m(e,t,r){var l,s,n,a,c,o,m,p,h,x;let v={chapterDomain:null==(l=e.match)?void 0:l.chapterDomain,projectTypes:[...null!=(o=null==(s=e.match)?void 0:s.projectTypes)?o:[]],sectionKeywords:i(null==(n=e.match)?void 0:n.sectionKeywords),...(null==(c=e.match)||null==(a=c.sectionRegex)?void 0:a.trim())?{sectionRegex:e.match.sectionRegex.trim()}:{}},f=(null!=(m=e.requires)?m:[]).filter(e=>{var t;return(null!=(t=e.key)?t:"").trim().length>0}).map(e=>{var t;return{key:(null!=(t=e.key)?t:"").trim(),source:e.source,required:!0===e.required}}),g=(null!=(p=e.structure)?p:[]).filter(e=>{var t;return(null!=(t=e.title)?t:"").trim().length>0}).map(e=>{var t;return{title:(null!=(t=e.title)?t:"").trim(),required:i(e.required)}}),k=(null!=(h=e.knowledge)?h:[]).filter(d).map(e=>{var t;return{kind:"processCard",ids:i(e.ids),...(null==(t=e.note)?void 0:t.trim())?{note:e.note.trim()}:{}}}),b=(null!=(x=e.acceptance)?x:[]).filter(u).map(e=>({kind:"llmChecklist",items:i(e.checklistItems),nonDeterministic:!0}));return{id:e.id.trim(),version:t,source:"user",enabled:!1!==e.enabled,match:v,requires:f,structure:g,forbidden:i(e.forbidden),knowledge:k,acceptance:b,...function(e){var t,r,l,s;let n=null!=(s=null==(t=e.outputTitle)?void 0:t.trim())?s:"",a=e.chapterChecklist,c={sections:i(null==a?void 0:a.sections),queries:i(null==a?void 0:a.queries),requiredFacts:i(null==a?void 0:a.requiredFacts),tableSections:i(null==a?void 0:a.tableSections),tableRequirements:i(null==a?void 0:a.tableRequirements),pinnedEvidenceFilePaths:i(null==a?void 0:a.pinnedEvidenceFilePaths)},o=!!(null==a||null==(r=a.purpose)?void 0:r.trim())||Object.values(c).some(e=>e.length>0);return{...n?{outputTitle:n}:{},...o?{chapterChecklist:{...(null==a||null==(l=a.purpose)?void 0:l.trim())?{purpose:a.purpose.trim()}:{},...Object.fromEntries(Object.entries(c).filter(e=>{let[,t]=e;return t.length>0}))}}:{}}}(e),...r?{examples:r}:{}}}},85979:(e,t,r)=>{r.d(t,{k:()=>a});var l=r(65321),s=r(43220),n=r.n(s),i=r(91648);function a(e){let{backHref:t,backLabel:r,title:s,description:a,extra:c}=e;return(0,l.jsx)("div",{className:"mb-6 bg-[var(--colorBgContainer)] rounded-2xl overflow-hidden border border-[var(--borderColor)] p-6",children:(0,l.jsxs)("div",{className:"flex flex-col md:flex-row md:items-end justify-between gap-4 md:gap-6",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,l.jsxs)(n(),{href:t,prefetch:!1,className:"detailBack",children:[(0,l.jsx)(i.A,{size:16,strokeWidth:2,"aria-hidden":!0}),(0,l.jsx)("span",{children:r})]}),(0,l.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-[var(--colorText)] m-0 truncate",children:s}),a?(0,l.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0 break-all",children:a}):null]})]}),c?(0,l.jsx)("div",{className:"shrink-0 flex items-center gap-2",children:c}):null]})})}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7955],{1873:(e,t,r)=>{e.exports=r(91952)},4632:(e,t)=>{"use strict";function r(e){var t;let{config:r,src:i,width:o,quality:n}=e,s=n||(null==(t=r.qualities)?void 0:t.reduce((e,t)=>Math.abs(t-75)<Math.abs(e-75)?t:e))||75;return r.path+"?url="+encodeURIComponent(i)+"&w="+o+"&q="+s+(i.startsWith("/_next/static/media/"),"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}}),r.__next_img_default=!0;let i=r},6710:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-in",theme:"outlined"}},14995:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"}},37510:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var i=r(97109),o=r(6710),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}let l=i.forwardRef((e,t)=>i.createElement(n.A,s({},e,{ref:t,icon:o.A})))},39415:(e,t)=>{"use strict";t.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"}}]},name:"zoom-out",theme:"outlined"}},49952:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return y}});let i=r(34007),o=r(26908),n=r(65321),s=o._(r(97109)),l=i._(r(61222)),a=i._(r(64041)),c=r(62956),u=r(83149),d=r(65059);r(28965);let f=r(99318),g=i._(r(4632)),p=r(47503),h={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function m(e,t,r,i,o,n,s){let l=null==e?void 0:e.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&o(!0),null==r?void 0:r.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let i=!1,o=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>i,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{i=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}(null==i?void 0:i.current)&&i.current(e)}}))}function v(e){return s.use?{fetchPriority:e}:{fetchpriority:e}}let b=(0,s.forwardRef)((e,t)=>{let{src:r,srcSet:i,sizes:o,height:l,width:a,decoding:c,className:u,style:d,fetchPriority:f,placeholder:g,loading:h,unoptimized:b,fill:w,onLoadRef:y,onLoadingCompleteRef:_,setBlurComplete:j,setShowAltText:O,sizesInput:E,onLoad:z,onError:x,...S}=e,C=(0,s.useCallback)(e=>{e&&(x&&(e.src=e.src),e.complete&&m(e,g,y,_,j,b,E))},[r,g,y,_,j,x,b,E]),R=(0,p.useMergedRef)(t,C);return(0,n.jsx)("img",{...S,...v(f),loading:h,width:a,height:l,decoding:c,"data-nimg":w?"fill":"1",className:u,style:d,sizes:o,srcSet:i,src:r,ref:R,onLoad:e=>{m(e.currentTarget,g,y,_,j,b,E)},onError:e=>{O(!0),"empty"!==g&&j(!0),x&&x(e)}})});function w(e){let{isAppRouter:t,imgAttributes:r}=e,i={as:"image",imageSrcSet:r.srcSet,imageSizes:r.sizes,crossOrigin:r.crossOrigin,referrerPolicy:r.referrerPolicy,...v(r.fetchPriority)};return t&&l.default.preload?(l.default.preload(r.src,i),null):(0,n.jsx)(a.default,{children:(0,n.jsx)("link",{rel:"preload",href:r.srcSet?void 0:r.src,...i},"__nimg-"+r.src+r.srcSet+r.sizes)})}let y=(0,s.forwardRef)((e,t)=>{let r=(0,s.useContext)(f.RouterContext),i=(0,s.useContext)(d.ImageConfigContext),o=(0,s.useMemo)(()=>{var e;let t=h||i||u.imageConfigDefault,r=[...t.deviceSizes,...t.imageSizes].sort((e,t)=>e-t),o=t.deviceSizes.sort((e,t)=>e-t),n=null==(e=t.qualities)?void 0:e.sort((e,t)=>e-t);return{...t,allSizes:r,deviceSizes:o,qualities:n}},[i]),{onLoad:l,onLoadingComplete:a}=e,p=(0,s.useRef)(l);(0,s.useEffect)(()=>{p.current=l},[l]);let m=(0,s.useRef)(a);(0,s.useEffect)(()=>{m.current=a},[a]);let[v,y]=(0,s.useState)(!1),[_,j]=(0,s.useState)(!1),{props:O,meta:E}=(0,c.getImgProps)(e,{defaultLoader:g.default,imgConf:o,blurComplete:v,showAltText:_});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b,{...O,unoptimized:E.unoptimized,placeholder:E.placeholder,fill:E.fill,onLoadRef:p,onLoadingCompleteRef:m,setBlurComplete:y,setShowAltText:j,sizesInput:e.sizes,ref:t}),E.priority?(0,n.jsx)(w,{isAppRouter:!r,imgAttributes:O}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},62956:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return a}}),r(28965);let i=r(65545),o=r(83149),n=["-moz-initial","fill","none","scale-down",void 0];function s(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function a(e,t){var r,a;let c,u,d,{src:f,sizes:g,unoptimized:p=!1,priority:h=!1,loading:m,className:v,quality:b,width:w,height:y,fill:_=!1,style:j,overrideSrc:O,onLoad:E,onLoadingComplete:z,placeholder:x="empty",blurDataURL:S,fetchPriority:C,decoding:R="async",layout:P,objectFit:A,objectPosition:M,lazyBoundary:I,lazyRoot:k,...N}=e,{imgConf:D,showAltText:B,blurComplete:L,defaultLoader:F}=t,G=D||o.imageConfigDefault;if("allSizes"in G)c=G;else{let e=[...G.deviceSizes,...G.imageSizes].sort((e,t)=>e-t),t=G.deviceSizes.sort((e,t)=>e-t),i=null==(r=G.qualities)?void 0:r.sort((e,t)=>e-t);c={...G,allSizes:e,deviceSizes:t,qualities:i}}if(void 0===F)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let T=N.loader||F;delete N.loader,delete N.srcSet;let W="__next_img_default"in T;if(W){if("custom"===c.loader)throw Object.defineProperty(Error('Image with src "'+f+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader'),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=T;T=t=>{let{config:r,...i}=t;return e(i)}}if(P){"fill"===P&&(_=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[P];e&&(j={...j,...e});let t={responsive:"100vw",fill:"100vw"}[P];t&&!g&&(g=t)}let q="",H=l(w),V=l(y);if((a=f)&&"object"==typeof a&&(s(a)||void 0!==a.src)){let e=s(f)?f.default:f;if(!e.src)throw Object.defineProperty(Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e)),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!e.height||!e.width)throw Object.defineProperty(Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e)),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(u=e.blurWidth,d=e.blurHeight,S=S||e.blurDataURL,q=e.src,!_)if(H||V){if(H&&!V){let t=H/e.width;V=Math.round(e.height*t)}else if(!H&&V){let t=V/e.height;H=Math.round(e.width*t)}}else H=e.width,V=e.height}let X=!h&&("lazy"===m||void 0===m);(!(f="string"==typeof f?f:q)||f.startsWith("data:")||f.startsWith("blob:"))&&(p=!0,X=!1),c.unoptimized&&(p=!0),W&&!c.dangerouslyAllowSVG&&f.split("?",1)[0].endsWith(".svg")&&(p=!0);let U=l(b),J=Object.assign(_?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:A,objectPosition:M}:{},B?{}:{color:"transparent"},j),Y=L||"empty"===x?null:"blur"===x?'url("data:image/svg+xml;charset=utf-8,'+(0,i.getImageBlurSvg)({widthInt:H,heightInt:V,blurWidth:u,blurHeight:d,blurDataURL:S||"",objectFit:J.objectFit})+'")':'url("'+x+'")',$=n.includes(J.objectFit)?"fill"===J.objectFit?"100% 100%":"cover":J.objectFit,K=Y?{backgroundSize:$,backgroundPosition:J.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:Y}:{},Q=function(e){let{config:t,src:r,unoptimized:i,width:o,quality:n,sizes:s,loader:l}=e;if(i)return{src:r,srcSet:void 0,sizes:void 0};let{widths:a,kind:c}=function(e,t,r){let{deviceSizes:i,allSizes:o}=e;if(r){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let i;i=e.exec(r);)t.push(parseInt(i[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=i[0]*e),kind:"w"}}return{widths:o,kind:"w"}}return"number"!=typeof t?{widths:i,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))],kind:"x"}}(t,o,s),u=a.length-1;return{sizes:s||"w"!==c?s:"100vw",srcSet:a.map((e,i)=>l({config:t,src:r,quality:n,width:e})+" "+("w"===c?e:i+1)+c).join(", "),src:l({config:t,src:r,quality:n,width:a[u]})}}({config:c,src:f,unoptimized:p,width:H,quality:U,sizes:g,loader:T});return{props:{...N,loading:X?"lazy":m,fetchPriority:C,width:H,height:V,decoding:R,className:v,style:{...J,...K},sizes:Q.sizes,srcSet:Q.srcSet,src:O||Q.src},meta:{unoptimized:p,priority:h,placeholder:x,fill:_}}}},65545:(e,t)=>{"use strict";function r(e){let{widthInt:t,heightInt:r,blurWidth:i,blurHeight:o,blurDataURL:n,objectFit:s}=e,l=i?40*i:t,a=o?40*o:r,c=l&&a?"viewBox='0 0 "+l+" "+a+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+c+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(c?"none":"contain"===s?"xMidYMid":"cover"===s?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+n+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},91648:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(1278).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},91952:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return a},getImageProps:function(){return l}});let i=r(34007),o=r(62956),n=r(49952),s=i._(r(4632));function l(e){let{props:t}=(0,o.getImgProps)(e,{defaultLoader:s.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let a=n.Image},99271:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var i=r(97109),o=r(39415),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}let l=i.forwardRef((e,t)=>i.createElement(n.A,s({},e,{ref:t,icon:o.A})))},99811:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var i=r(97109),o=r(14995),n=r(88483);function s(){return(s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(this,arguments)}let l=i.forwardRef((e,t)=>i.createElement(n.A,s({},e,{ref:t,icon:o.A})))}}]);
@@ -1 +0,0 @@
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()}]);
@@ -1 +0,0 @@
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()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4046],{22708:(e,a,l)=>{"use strict";l.r(a),l.d(a,{default:()=>D});var r=l(65321),s=l(97109),o=l(39507),t=l(93360),n=l(17807),i=l(88762),d=l(85114),c=l(84253),m=l(88278),x=l(33442),p=l(32965),v=l(11702),h=l(57271),u=l(7576),b=l(48318),g=l(34052),j=l(63455),y=l(56985),f=l(44534),N=l(54746),A=l(29071),w=l(59188),C=l(4216),S=l(13114),k=l(99650),T=l(58209),E=l(76981),K=l(61825),P=l(6578),I=l(85310),B=l(82238);let H=[{labelKey:"models.openAICompatible",value:"openai"},{labelKey:"models.anthropic",value:"anthropic"},{labelKey:"models.google",value:"google"},{labelKey:"models.ollama",value:"ollama"},{labelKey:"models.openRouter",value:"openrouter"}],U=[{key:"imageGeneration",labelKey:"models.imageGeneration"},{key:"imageUnderstanding",labelKey:"models.imageUnderstanding"},{key:"fileUnderstanding",labelKey:"models.fileUnderstanding"},{key:"audio",labelKey:"models.audioCapability"},{key:"video",labelKey:"models.videoCapability"}],_="••••••••",z=e=>e.includes("•");function D(){let e=(0,o.Vr)(),{message:a}=n.A.useApp(),[l,D]=(0,s.useState)(!0),[F,R]=(0,s.useState)([]),[Z,G]=(0,s.useState)(null),[L,O]=(0,s.useState)(!1),[X,q]=(0,s.useState)(null),[M,V]=(0,s.useState)(!1),[J,Q]=(0,s.useState)(!1),[W,Y]=(0,s.useState)(null),[$,ee]=(0,s.useState)(null),[ea,el]=(0,s.useState)({}),[er,es]=(0,s.useState)(!1),[eo,et]=(0,s.useState)(!1),[en,ei]=(0,s.useState)(""),[ed,ec]=(0,s.useState)(""),[em,ex]=(0,s.useState)(""),[ep,ev]=(0,s.useState)(""),[eh,eu]=(0,s.useState)(""),[eb,eg]=(0,s.useState)("openai"),[ej,ey]=(0,s.useState)(!1),[ef,eN]=(0,s.useState)({}),[eA,ew]=(0,s.useState)(!1),[eC,eS]=(0,s.useState)(!1),[ek,eT]=(0,s.useState)([]),eE=async()=>{D(!0);try{let e=[],a=(a,l,r)=>l.catch(()=>(e.push(a),r)),[l,r,s]=await Promise.all([a("模型供应商",(0,P.Z3)(),null),a("生成模型",(0,P.zr)(),null),a("嵌入配置",(0,P.II)(),null)]);eT(e),l&&R(l),r&&G(r),s&&q(s)}catch(l){a.error(e("common.error"))}finally{D(!1)}};(0,s.useEffect)(()=>{eE()},[]);let eK=ek.includes("模型供应商"),eP=ek.includes("生成模型"),eI=async e=>{var a,l,r,s;et(!0),ei(e.name),ec(e.name),ex(null!=(r=null==Z||null==(a=Z.list.find(a=>a.provider===e.name))?void 0:a.name)?r:e.name),ev(""),eu(e.baseUrl||""),ey(!0===e.directEndpoint),eg(e.protocol||e.detectedProtocol||"openai"),eN(e.capabilities||{}),ew(!!(null==(l=e.capabilities)?void 0:l.webSearch));try{let a=await (0,P.Bh)(e.name);ev(a.apiKey?_:""),eu(a.baseUrl||""),eN(a.capabilities||{}),ey(!0===a.directEndpoint),ew(!!(null==(s=a.capabilities)?void 0:s.webSearch))}catch(e){}es(!0)},eB=async()=>{if(ed.trim()){eS(!0);try{let l=eo&&z(ep)?void 0:ep||void 0,r={...ef,webSearch:eA};await (0,P._m)(ed.trim(),{modelName:em.trim()||ed.trim(),oldName:eo?en:void 0,apiKey:l,baseUrl:eh||void 0,protocol:eb,directEndpoint:ej,capabilities:r}),es(!1),await eE(),a.success(e("common.success"))}catch(l){a.error(e("common.error"))}finally{eS(!1)}}},eH=async l=>{try{await (0,P.h1)(l),await eE(),a.success(e("common.success"))}catch(l){a.error(e("common.error"))}},eU=async l=>{ee(l);try{let r=await (0,P.bZ)(l);el(e=>({...e,[l]:r.success}));let s=r.success?e("models.connected"):"".concat(e("models.connectionFailed")).concat(r.message?":".concat(r.message):"").concat(r.requestId?" (".concat(r.requestId,")"):"");a[r.success?"success":"error"](s)}catch(r){el(e=>({...e,[l]:!1})),a.error(r instanceof Error?r.message:e("models.connectionFailed"))}finally{ee(null)}},e_=async l=>{if(L)return!1;O(!0);try{let e=await (0,P.aP)(l);return G(e.models),!0}catch(l){return a.error(l instanceof Error?l.message:e("common.error")),!1}finally{O(!1)}},ez=async e=>{if(!Z)return;let a=Z.list.find(a=>a.provider===e),l=null!=a?a:{provider:e,name:e};await e_({active:{provider:l.provider,name:l.name},list:a?Z.list:[...Z.list,l]})},eD=async()=>{if(X){V(!0);try{let l=await (0,P.dd)(X);q(l),Y(null),a.success(e("common.success"))}catch(l){a.error(e("common.error"))}finally{V(!1)}}},eF=async()=>{Q(!0);try{let l=await (0,P.u6)();Y(l.success),a[l.success?"success":"error"](l.message||(l.success?e("models.connected"):e("models.connectionFailed")))}catch(e){Y(!1)}finally{Q(!1)}};return l?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(i.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,r.jsx)("div",{className:"p-4 bg-[var(--colorBgHover)] rounded-xl border border-[var(--borderColor)]",children:(0,r.jsx)(i.A,{active:!0,paragraph:{rows:6}})}),(0,r.jsx)("div",{className:"p-4 bg-[var(--colorBgHover)] rounded-xl border border-[var(--borderColor)]",children:(0,r.jsx)(i.A,{active:!0,paragraph:{rows:4}})}),(0,r.jsx)("div",{className:"p-4 bg-[var(--colorBgHover)] rounded-xl border border-[var(--borderColor)]",children:(0,r.jsx)(i.A,{active:!0,paragraph:{rows:3}})})]}):(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)(B.X,{failures:ek}),(0,r.jsx)(t.z,{title:e("models.title"),description:e("models.description"),extra:(0,r.jsx)(d.Ay,{type:"primary",icon:(0,r.jsx)(N.A,{}),onClick:()=>{et(!1),ei(""),ec(""),ex(""),ev(""),eu(""),eg("openai"),ey(!1),eN({}),ew(!1),es(!0)},children:e("models.addProvider")})}),(0,r.jsx)(I.Zk,{title:e("models.modelList"),count:eK?void 0:F.length,description:e("models.modelListDesc"),children:eK?(0,r.jsx)("div",{className:"py-10 rounded-xl border border-dashed border-[var(--borderColorStrong)] bg-[var(--colorBgHover)] text-center",children:(0,r.jsx)("span",{className:"text-sm text-[var(--colorTextTertiary)]",children:"—"})}):0===F.length?(0,r.jsx)("div",{className:"py-10 rounded-xl border border-dashed border-[var(--borderColorStrong)] bg-[var(--colorBgHover)]",children:(0,r.jsx)(c.A,{image:c.A.PRESENTED_IMAGE_SIMPLE,description:(0,r.jsx)("span",{className:"text-[var(--colorTextTertiary)] text-sm",children:e("models.noProviders")})})}):(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:F.map(a=>{var l,s,o;let t=null==Z?void 0:Z.list.find(e=>e.provider===a.name),n=null!=(o=null==t?void 0:t.name)?o:a.name,i=(null==Z||null==(l=Z.active)?void 0:l.provider)===a.name&&Z.active.name===n;return(0,r.jsxs)("div",{role:"group","aria-label":a.name,className:"group p-5 ".concat(I.wD," flex flex-col"),children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-4 min-w-0",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)(m.Ay,{name:"generation-model-service",checked:i,disabled:eP||!Z||L,onChange:()=>{ez(a.name)},children:(0,r.jsx)("span",{className:"font-bold text-base text-[var(--colorText)]",children:a.name})}),n!==a.name&&(0,r.jsx)("div",{className:"text-xs text-[var(--colorTextSecondary)] mt-1 break-all",children:n}),(0,r.jsxs)("div",{className:"text-xs text-[var(--colorTextTertiary)] flex items-center gap-1 uppercase tracking-wider font-semibold",children:[(0,r.jsx)(A.A,{})," ",a.protocol||a.detectedProtocol||"openai"]})]}),(0,r.jsxs)(x.A,{size:0,className:"-mr-2 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity",children:[(0,r.jsx)(d.Ay,{type:"text",size:"small",loading:$===a.name,title:e("models.testConnection"),"aria-label":e("models.testConnection"),onClick:e=>{e.stopPropagation(),eU(a.name)},icon:!0===ea[a.name]?(0,r.jsx)(w.A,{className:"text-[var(--colorOk)]"}):!1===ea[a.name]?(0,r.jsx)(C.A,{className:"text-[var(--colorDanger)]"}):(0,r.jsx)(S.A,{className:"text-[var(--colorTextSecondary)]"})}),(0,r.jsx)(d.Ay,{type:"text",size:"small",title:e("common.edit"),icon:(0,r.jsx)(k.A,{className:"text-[var(--colorTextSecondary)]"}),onClick:e=>{e.stopPropagation(),eI(a)}}),(0,r.jsx)(p.A,{title:e("models.deleteProviderConfirm"),onConfirm:e=>{null==e||e.stopPropagation(),eH(a.name)},onCancel:e=>null==e?void 0:e.stopPropagation(),children:(0,r.jsx)(d.Ay,{type:"text",size:"small",danger:!0,title:e("common.delete"),icon:(0,r.jsx)(T.A,{}),onClick:e=>e.stopPropagation()})})]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 mt-auto pt-4 border-t border-[var(--borderColor)]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs text-[var(--colorTextSecondary)]",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(E.A,{})," ",e("models.apiKey")]}),(0,r.jsx)("span",{className:"font-mono text-[var(--colorTextTertiary)]",children:a.hasApiKey?_:e("models.none")})]}),a.baseUrl&&(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs text-[var(--colorTextSecondary)]",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)(K.A,{})," URL"]}),(0,r.jsx)("span",{className:"truncate max-w-[120px] font-mono text-[var(--colorTextTertiary)]",title:a.baseUrl,children:a.baseUrl.replace(/^https?:\/\//,"")})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[U.filter(e=>{var l;return null==(l=a.capabilities)?void 0:l[e.key]}).map(a=>(0,r.jsx)(v.A,{color:"blue",bordered:!1,className:"m-0 text-[10px] bg-[var(--colorBrand)]/5 text-[var(--colorBrand)] leading-[18px]",children:e(a.labelKey)},a.key)),(null==(s=a.capabilities)?void 0:s.webSearch)&&(0,r.jsx)(v.A,{color:"green",bordered:!1,className:"m-0 text-[10px] leading-[18px]",children:e("models.webEnhancement")})]})]})]},a.name)})})}),(0,r.jsx)(I.Zk,{title:e("models.embeddingConfig"),description:e("models.embeddingConfigDesc"),extra:(0,r.jsxs)(x.A,{size:6,children:[X?(0,r.jsx)(v.A,{color:"blue",bordered:!1,className:"m-0",children:"transformers-local"===X.provider?e("models.localEmbedding"):e("models.openAICompatible")}):(0,r.jsx)(v.A,{bordered:!1,className:"m-0",children:"—"}),!0===W&&(0,r.jsx)(v.A,{color:"success",bordered:!1,className:"m-0",icon:(0,r.jsx)(w.A,{}),children:e("models.connected")}),!1===W&&(0,r.jsx)(v.A,{color:"error",bordered:!1,className:"m-0",icon:(0,r.jsx)(C.A,{}),children:e("models.connectionFailed")})]}),children:X?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(I.dh,{children:e("models.embeddingProvider")}),(0,r.jsx)(h.A,{value:X.provider,className:"w-full h-10",variant:"borderless",style:{background:"var(--colorBgHover)",borderRadius:"8px"},options:[{label:e("models.localRecommended"),value:"transformers-local"},{label:e("models.externalAdvanced"),value:"openai-compatible"}],onChange:e=>q(a=>a?{...a,provider:e,model:"transformers-local"===e?a.model||"BAAI/bge-small-zh-v1.5":a.model,dimensions:"transformers-local"===e?512:a.dimensions||1024}:a)})]}),"openai-compatible"===X.provider&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(I.dh,{children:e("models.baseUrl")}),(0,r.jsx)(u.A,{className:"h-10 px-4 bg-[var(--colorBgHover)]",value:X.baseUrl,onChange:e=>q(a=>a?{...a,baseUrl:e.target.value}:a),placeholder:"http://localhost:11434/v1"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(I.dh,{children:e("models.model")}),(0,r.jsx)(u.A,{className:"h-10 px-4 bg-[var(--colorBgHover)]",value:X.model,onChange:e=>q(a=>a?{...a,model:e.target.value}:a),placeholder:"bge-m3"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(I.dh,{children:e("models.apiKey")}),(0,r.jsx)(u.A.Password,{className:"h-10 px-4 bg-[var(--colorBgHover)]",value:X.apiKey,onFocus:()=>{X.apiKey&&z(X.apiKey)&&q(e=>e?{...e,apiKey:""}:e)},onChange:e=>q(a=>a?{...a,apiKey:e.target.value}:a),placeholder:e("models.optional")})]})]}),"transformers-local"===X.provider&&(0,r.jsxs)("div",{children:[(0,r.jsx)(I.dh,{children:e("models.model")}),(0,r.jsx)(u.A,{className:"h-10 px-4 bg-[var(--colorBgHover)]",disabled:!0,value:X.model,placeholder:"BAAI/bge-small-zh-v1.5"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(I.dh,{children:e("models.dimensions")}),(0,r.jsx)(b.A,{className:"w-full h-10 px-2 bg-[var(--colorBgHover)] border-transparent flex items-center",min:1,value:X.dimensions,onChange:e=>q(a=>a?{...a,dimensions:Number(e||("transformers-local"===a.provider?512:1024))}:a)})]})]}),(0,r.jsxs)("div",{className:"mt-6 flex flex-wrap gap-3",children:[(0,r.jsx)(d.Ay,{type:"primary",className:"h-10 px-6 font-medium shadow-none",loading:M,onClick:()=>{eD()},children:e("models.saveEmbedding")}),(0,r.jsx)(d.Ay,{className:"h-10 px-6 font-medium shadow-none bg-[var(--colorBgHover)] border-transparent hover:border-[var(--borderColorStrong)]",loading:J,onClick:()=>{eF()},children:e("models.testEmbedding")})]})]}):(0,r.jsx)("div",{className:"text-sm text-[var(--colorTextTertiary)]",children:"—"})}),(0,r.jsx)(g.A,{title:eo?e("models.editProvider"):e("models.addProvider"),open:er,onClose:()=>es(!1),size:"large",styles:{body:{padding:"24px 32px"},header:{padding:"16px 32px",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,r.jsx)(x.A,{children:(0,r.jsx)(d.Ay,{type:"primary",loading:eC,onClick:()=>{eB()},children:e("common.save")})}),children:(0,r.jsxs)(j.A,{layout:"vertical",children:[(0,r.jsx)(j.A.Item,{label:e("models.providerName"),children:(0,r.jsx)(u.A,{value:ed,onChange:e=>ec(e.target.value),placeholder:e("models.providerNamePlaceholder")})}),(0,r.jsx)(j.A.Item,{label:e("models.modelIdentifier"),help:e("models.modelIdentifierHint"),children:(0,r.jsx)(u.A,{value:em,onChange:e=>ex(e.target.value),placeholder:ed||e("models.modelIdentifierPlaceholder")})}),(0,r.jsx)(j.A.Item,{label:e("models.apiKey"),help:eo?e("models.apiKeyEditHint"):void 0,children:(0,r.jsx)(u.A.Password,{value:ep,onFocus:()=>{eo&&z(ep)&&ev("")},onChange:e=>ev(e.target.value),placeholder:eo?e("models.apiKeyEditPlaceholder"):"sk-..."})}),(0,r.jsx)(j.A.Item,{label:e("models.baseUrl"),children:(0,r.jsx)(u.A,{value:eh,onChange:e=>eu(e.target.value),placeholder:"https://api.openai.com/v1"})}),(0,r.jsx)(j.A.Item,{label:e("models.protocol"),children:(0,r.jsx)(h.A,{value:eb,onChange:eg,options:H.map(a=>({label:e(a.labelKey),value:a.value}))})}),(0,r.jsx)(j.A.Item,{label:e("models.directEndpoint"),children:(0,r.jsx)(y.A,{checked:ej,onChange:e=>ey(e.target.checked),children:e("models.directEndpointDesc")})}),(0,r.jsxs)(j.A.Item,{label:e("models.webEnhancement"),children:[(0,r.jsx)(f.A,{checked:eA,onChange:ew}),(0,r.jsx)("span",{className:"ml-3 text-xs text-[var(--colorTextSecondary)]",children:e("models.webEnhancementDesc")})]}),(0,r.jsx)(j.A.Item,{label:e("models.capabilities"),children:(0,r.jsx)(y.A.Group,{value:U.filter(e=>ef[e.key]).map(e=>e.key),options:U.map(a=>({label:e(a.labelKey),value:a.key})),onChange:e=>eN(Object.fromEntries(U.map(a=>[a.key,e.includes(a.key)])))})})]})})]})}},77305:(e,a,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/models",function(){return l(22708)}])},82238:(e,a,l)=>{"use strict";l.d(a,{X:()=>s});var r=l(65321);function s(e){let{failures:a,note:l}=e;return 0===a.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(a.length," 项数据读取失败:").concat(a.join("、"),"——相关读数显示为「—」(未知),**不代表 0**;请稍后重试或查看服务端日志。"),l?(0,r.jsx)("div",{className:"mt-1 text-xs opacity-90",children:l}):null]})}},85310:(e,a,l)=>{"use strict";l.d(a,{Zk:()=>o,dh:()=>t,wD:()=>s});var r=l(65321);l(97109);let s="rounded-xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)] hover:shadow-[var(--shadowSurfaceHover)] transition-shadow";function o(e){let{title:a,count:l,description:s,extra:o,className:t,children:n}=e;return(0,r.jsxs)("section",{className:"rounded-2xl bg-[var(--colorBgContainer)] shadow-[var(--shadowSurface)] p-6 animateFadeIn ".concat(null!=t?t:""),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:[a,void 0!==l&&(0,r.jsx)("span",{className:"text-[var(--colorTextTertiary)] font-normal text-sm",children:l})]}),s&&(0,r.jsx)("p",{className:"text-xs text-[var(--colorTextTertiary)] mt-1.5 mb-0 leading-relaxed max-w-3xl",children:s})]}),o]}),n]})}function t(e){let{children:a}=e;return(0,r.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wider mb-2 text-[var(--colorTextTertiary)]",children:a})}},93360:(e,a,l)=>{"use strict";l.d(a,{z:()=>o});var r=l(65321);l(97109);var s=l(33442);function o(e){let{title:a,description:l,extra:o,bottomContent:t}=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:a}),l&&(0,r.jsx)("p",{className:"text-sm text-[var(--colorTextSecondary)] m-0",children:l})]}),o&&(0,r.jsx)(s.A,{className:"w-full sm:w-auto overflow-x-auto pb-1 sm:pb-0 shrink-0",size:"middle",wrap:!1,children:o})]}),t&&(0,r.jsx)("div",{className:"mt-6",children:t})]})}}},e=>{e.O(0,[6409,1210,1702,5544,9551,7576,8338,5061,2864,4052,8318,2378,636,6593,8792],()=>e(e.s=77305)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9388],{23793:(e,l)=>{"use strict";l.A={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"}},58209:(e,l,t)=>{"use strict";t.d(l,{A:()=>i});var s=t(97109),n=t(23793),r=t(88483);function a(){return(a=Object.assign?Object.assign.bind():function(e){for(var l=1;l<arguments.length;l++){var t=arguments[l];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e}).apply(this,arguments)}let i=s.forwardRef((e,l)=>s.createElement(r.A,a({},e,{ref:l,icon:n.A})))},71922:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>A});var s=t(65321),n=t(86109),r=t(43220),a=t.n(r),i=t(88762),o=t(85493),c=t(84253),d=t(85114),m=t(99650),p=t(97109),x=t(85979),u=t(48399),h=t(68787),v=t(11702),g=t(14524),j=t(35071);let{Text:b}=u.A;function f(e){let{label:l,children:t}=e;return(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-xs text-[var(--colorTextTertiary)] mb-1",children:l}),(0,s.jsx)("div",{className:"text-sm font-medium text-[var(--colorText)] break-words",children:t})]})}function y(e){var l,t,n,r,a;let{skill:i,options:o,labelMap:c}=e,d=e=>{var l;return null!=(l=c.get(e))?l:e},m=i.chapterChecklist,p=m?[{label:"章内检索词",values:null!=(l=m.queries)?l:[]},{label:"必含事实",values:null!=(t=m.requiredFacts)?t:[]},{label:"要求成表的小节",values:null!=(n=m.tableSections)?n:[]},{label:"表格形态要求",values:null!=(r=m.tableRequirements)?r:[]},{label:"钉住的证据文件",values:null!=(a=m.pinnedEvidenceFilePaths)?a:[]}].filter(e=>e.values.length>0):[];return(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(h.A,{className:"rounded-2xl border-[var(--borderColor)]",children:(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 xl:grid-cols-4 gap-x-6 gap-y-4",children:[(0,s.jsx)(f,{label:"技能 ID",children:(0,s.jsx)(b,{code:!0,className:"text-xs",children:i.id})}),(0,s.jsxs)(f,{label:"来源",children:[i.builtIn?(0,s.jsx)(v.A,{color:"gold",className:"m-0",children:"内置"}):(0,s.jsx)(v.A,{className:"m-0",children:"用户"}),(0,s.jsxs)(b,{type:"secondary",className:"text-xs ml-2",children:["技能格式 v",i.version]})]}),(0,s.jsx)(f,{label:"状态",children:(0,s.jsx)(v.A,{color:i.enabled?"green":"default",className:"m-0 border-0",children:i.enabled?"已启用":"已停用"})}),(0,s.jsx)(f,{label:"章域",children:(0,s.jsx)(v.A,{color:"blue",className:"m-0",children:d(i.match.chapterDomain)})}),(0,s.jsx)(f,{label:"适用工程类型",children:0===i.match.projectTypes.length?(0,s.jsx)(b,{type:"secondary",className:"text-xs",children:"全类型(不限定工程类型)"}):(0,s.jsx)("div",{className:"tagWrap flex flex-wrap gap-1 min-w-0",children:i.match.projectTypes.map(e=>(0,s.jsx)(v.A,{className:"m-0",children:d(e)},e))})}),(0,s.jsx)(f,{label:"文档名称建议",children:i.outputTitle?(0,s.jsx)("span",{children:i.outputTitle}):(0,s.jsx)(b,{type:"secondary",className:"text-xs",children:"未声明(不对文档名称表态)"})}),(0,s.jsx)(f,{label:"章职责",children:(null==m?void 0:m.purpose)?(0,s.jsx)("span",{children:m.purpose}):(0,s.jsx)(b,{type:"secondary",className:"text-xs",children:"未声明"})}),(0,s.jsx)(f,{label:"提供内容",children:(0,s.jsxs)("div",{className:"tagWrap flex flex-wrap gap-1 min-w-0",children:[(0,s.jsxs)(v.A,{className:"m-0",children:[i.structure.length," 个专业主题"]}),(0,s.jsxs)(v.A,{color:"green",className:"m-0",children:[i.acceptance.reduce((e,l)=>e+l.items.length,0)," 条核对提示"]})]})})]})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 items-start",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(g.PZ,{title:"相关专业主题",description:"本条技能提供的专业内容主题。",hint:"".concat(i.structure.length," 项"),children:0===i.structure.length?(0,s.jsx)(b,{type:"secondary",className:"text-xs",children:"未声明专业主题"}):(0,s.jsx)("ol",{className:"m-0 pl-5 text-sm leading-7",children:i.structure.map((e,l)=>{var t;return(0,s.jsxs)("li",{children:[e.title,(0,s.jsx)(b,{type:"secondary",className:"text-xs ml-2",children:(null==(t=e.required)?void 0:t.join(";"))||"按具体对象组织内容"})]},"".concat(e.title,"-").concat(l))})})}),(0,s.jsxs)(g.PZ,{title:"匹配条件",description:"这条技能在什么章域、工程类型与章节标题下被选用。",children:[(0,s.jsx)(g.RU,{label:"小节标题关键词",children:(0,s.jsx)(g.n$,{empty:"未限定小节标题关键词",items:i.match.sectionKeywords.map(e=>(0,s.jsx)(v.A,{className:"m-0 border-0 bg-[var(--colorFillSecondary)]",children:e},e))})}),(0,s.jsx)(g.RU,{label:"小节标题匹配表达式",children:i.match.sectionRegex?(0,s.jsx)(b,{code:!0,className:"text-xs",children:i.match.sectionRegex}):void 0})]}),(0,s.jsx)(g.PZ,{title:"工艺知识引用",description:"写作时可加载的专业参考(按工艺卡名称显示)。",children:0===i.knowledge.length?(0,s.jsx)(b,{type:"secondary",className:"text-xs",children:"未声明知识引用"}):(0,s.jsx)("div",{className:"flex flex-col gap-2",children:i.knowledge.map((e,l)=>{var t,n,r,a;return(0,s.jsxs)("div",{className:"rounded-xl border border-[var(--borderColor)] bg-[var(--colorFillAlter)] px-3 py-2.5",children:[(0,s.jsxs)("div",{className:"tagWrap flex flex-wrap items-center gap-1.5 min-w-0",children:[(0,s.jsx)(v.A,{color:"blue",className:"m-0",children:(n=e.kind,null!=(a=null==o||null==(r=o.knowledgeKinds.find(e=>e.value===n))?void 0:r.label)?a:n)}),(null!=(t=e.ids)?t:[]).map(e=>{var l,t;return(0,s.jsx)(v.A,{className:"m-0 border-0 bg-[var(--colorFillSecondary)]",children:null!=(t=null==o||null==(l=o.processCards.find(l=>l.value===e))?void 0:l.label)?t:e},e)})]}),e.note?(0,s.jsx)("p",{className:"m-0 mt-2 text-xs leading-relaxed text-[var(--colorTextSecondary)]",children:e.note}):null]},"".concat(e.kind,"-").concat(l))})})}),o&&o.isolationRules.length>0&&(0,s.jsx)(g.PZ,{title:"资料与采用边界",description:"以下边界由软件统一执行,技能不能扩大或豁免。",children:(0,s.jsx)("div",{className:"flex flex-col gap-2",children:o.isolationRules.map(e=>(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-baseline gap-1 sm:gap-2",children:[(0,s.jsx)(b,{className:"text-sm shrink-0",children:e.label}),(0,s.jsx)(b,{type:"secondary",className:"text-xs",children:e.note})]},e.id))})})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)(g.PZ,{title:"所需项目资料",description:"本次任务要先查证的项目事实;标为必需而查不到时会被上游拦下。",children:(0,s.jsx)(g.n$,{empty:"未声明必需事实",items:i.requires.map(e=>(0,s.jsxs)(v.A,{color:e.required?"red":"default",className:"mb-1",children:[e.key," \xb7 ",d(e.source),e.required?" \xb7 必需":" \xb7 可选"]},e.key))})}),(0,s.jsx)(g.PZ,{title:"文档业务提示",description:"给本次规划的章级候选内容与资料检索提示。",children:0===p.length?(0,s.jsx)(b,{type:"secondary",className:"text-xs",children:"未声明章级清单"}):p.map(e=>(0,s.jsx)(g.RU,{label:e.label,children:(0,s.jsx)(g.n$,{items:e.values.map(e=>(0,s.jsx)(v.A,{className:"m-0 border-0 bg-[var(--colorFillSecondary)]",children:e},e))})},e.label))}),(0,s.jsx)(g.PZ,{title:"禁写项",description:"这条技能明确要求避免的内容或表达。",children:(0,s.jsx)(g.n$,{empty:"没有禁写项",items:i.forbidden.map(e=>(0,s.jsx)(v.A,{color:"red",className:"m-0 border-0",children:(0,j.Oz)(e)},(0,j.Oz)(e)))})}),(0,s.jsx)(g.PZ,{title:"专业写作核对提示",description:"按本任务对象和工况选用,不是数量要求或验收通过证明。",children:0===i.acceptance.flatMap(e=>e.items).length?(0,s.jsx)(b,{type:"secondary",className:"text-xs",children:"没有核对提示"}):(0,s.jsx)("ul",{className:"m-0 pl-5 text-sm leading-7",children:i.acceptance.flatMap(e=>e.items).map(e=>(0,s.jsx)("li",{children:e},e))})}),(0,s.jsx)(g.PZ,{title:"表达示例",description:"示例供理解专业表达,不能作为本项目事实。",children:(0,s.jsx)(g.RU,{label:"是否带示例",children:i.examples?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.A,{color:"green",className:"m-0 border-0",children:"带正例/反例"}),(0,s.jsx)(b,{type:"secondary",className:"text-xs ml-2",children:"本编辑器保留原示例。"})]}):void 0})})]})]})]})}var N=t(33061);function $(e){let{skillId:l}=e,t=(0,N.G)(),n=(0,p.useMemo)(()=>l?t.skills.find(e=>e.id===l):void 0,[t.skills,l]),r=(0,p.useMemo)(()=>{var e,l,s,n,r,a;return new Map([...null!=(n=null==(e=t.options)?void 0:e.chapterDomains)?n:[],...null!=(r=null==(l=t.options)?void 0:l.projectTypes)?r:[],...null!=(a=null==(s=t.options)?void 0:s.factSources)?a:[]].map(e=>[e.value,e.label]))},[t.options]),u=!l,h=!t.loading&&!t.failed&&!!t.options&&!n;return u||t.loading?(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)(i.A,{active:!0,title:!0,paragraph:{rows:2}}),(0,s.jsx)(i.A,{active:!0,paragraph:{rows:10}})]}):t.failed?(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)(x.k,{backHref:"/skills",backLabel:"返回技能库",title:"技能预览"}),(0,s.jsx)(o.A,{type:"error",showIcon:!0,message:"技能库读取失败",description:"".concat(t.failed,';这不是"技能不存在",请核对服务端状态后重试。')})]}):h||!n?(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)(x.k,{backHref:"/skills",backLabel:"返回技能库",title:"技能预览"}),(0,s.jsx)(c.A,{description:"技能库里没有「".concat(l,"」这条技能(可能已被删除或改名)"),children:(0,s.jsx)(a(),{href:"/skills",children:(0,s.jsx)(d.Ay,{type:"primary",children:"返回技能库"})})})]}):(0,s.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,s.jsx)(x.k,{backHref:"/skills",backLabel:"返回技能库",title:"技能预览 \xb7 ".concat(n.displayName),description:"只读查看这条技能声明了什么;要改内容进编辑页,保存前会做字段与引用校验。",extra:(0,s.jsx)(a(),{href:"/skills/".concat(encodeURIComponent(n.id),"/edit"),children:(0,s.jsx)(d.Ay,{type:"primary",icon:(0,s.jsx)(m.A,{}),disabled:n.builtIn,title:n.builtIn?j.F:void 0,children:"编辑"})})}),n.builtIn&&(0,s.jsx)(o.A,{type:"info",showIcon:!0,message:j.F}),(0,s.jsx)(y,{skill:n,options:t.options,labelMap:r})]})}function A(){let e=(0,n.useRouter)(),l="string"==typeof e.query.id?e.query.id:void 0;return(0,s.jsx)($,{skillId:l})}},85493:(e,l,t)=>{"use strict";t.d(l,{A:()=>S});var s=t(97109),n=t(59188),r=t(4216),a=t(45042),i=t(97137),o=t(62188),c=t(67189),d=t(42644),m=t(3638),p=t(92162),x=t(26047),u=t(74567),h=t(15561),v=t(7961),g=t(10540);let j=(e,l,t)=>({background:e,[`${t}-icon`]:{color:l}}),b=(0,g.OF)("Alert",e=>[(e=>{let{componentCls:l,motionDurationSlow:t,marginXS:s,marginSM:n,fontSize:r,fontSizeLG:a,lineHeight:i,borderRadiusLG:o,motionEaseInOutCirc:c,withDescriptionIconSize:d,colorText:m,colorTextHeading:p,withDescriptionPadding:x,defaultPadding:u,lineWidth:g,lineType:j,colorSuccessBorder:b,colorWarningBorder:f,colorErrorBorder:y,colorInfoBorder:N}=e;return{[l]:{...(0,v.dF)(e),position:"relative",display:"flex",alignItems:"center",padding:u,wordWrap:"break-word",borderRadius:o,borderWidth:(0,h.zA)(g),borderStyle:j,[`&${l}-success`]:{borderColor:b},[`&${l}-info`]:{borderColor:N},[`&${l}-warning`]:{borderColor:f},[`&${l}-error`]:{borderColor:y},[`&${l}-filled`]:{borderColor:"transparent"},[`&${l}-rtl`]:{direction:"rtl"},[`${l}-section`]:{flex:1,minWidth:0},[`${l}-icon`]:{marginInlineEnd:s,lineHeight:0},"&-description":{display:"none",fontSize:r,lineHeight:i},"&-title":{color:p},[`&${l}-motion-leave`]:{overflow:"hidden",opacity:1,transition:["max-height","opacity","padding-top","padding-bottom","margin-bottom"].map(e=>`${e} ${t} ${c}`).join(", ")},[`&${l}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0},[`&${l}-with-description`]:{alignItems:"flex-start",padding:x,[`${l}-icon`]:{marginInlineEnd:n,fontSize:d,lineHeight:0},[`${l}-title`]:{display:"block",marginBottom:s,color:p,fontSize:a},[`${l}-description`]:{display:"block",color:m}},[`&${l}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}}})(e),(e=>{let{componentCls:l,colorSuccess:t,colorSuccessBg:s,colorWarning:n,colorWarningBg:r,colorError:a,colorErrorBg:i,colorInfo:o,colorInfoBg:c}=e;return{[l]:{"&-success":j(s,t,l),"&-info":j(c,o,l),"&-warning":j(r,n,l),"&-error":{...j(i,a,l),[`${l}-description > pre`]:{margin:0,padding:0}}}}})(e),(e=>{let{componentCls:l,iconCls:t,motionDurationMid:s,marginXS:n,fontSizeIcon:r,colorIcon:a,colorIconHover:i}=e;return{[l]:{[`${l}-actions`]:{marginInlineStart:n},[`${l}-close-icon`]:{marginInlineStart:n,padding:0,overflow:"hidden",fontSize:r,lineHeight:(0,h.zA)(r),backgroundColor:"transparent",border:"none",cursor:"pointer",...(0,v.K8)(e),[`${t}-close`]:{color:a,transition:`color ${s}`,"&:hover":{color:i}}},"&-close-text":{color:a,transition:`color ${s}`,"&:hover":{color:i}}}}})(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),f=e=>{let{icon:l,type:t,className:a,style:c,successIcon:d,infoIcon:m,warningIcon:p,errorIcon:x}=e,u={success:d??s.createElement(n.A,null),info:m??s.createElement(o.A,null),error:x??s.createElement(r.A,null),warning:p??s.createElement(i.A,null)};return s.createElement("span",{className:a,style:c},l??u[t])},y=e=>{let{isClosable:l,prefixCls:t,closeIcon:n,handleClose:r,ariaProps:i,className:o,style:c}=e,d=!0===n||void 0===n?s.createElement(a.A,null):n;return l?s.createElement("button",{type:"button",onClick:r,className:(0,m.$)(`${t}-close-icon`,o),tabIndex:0,style:c,...i},d):null},N=s.forwardRef((e,l)=>{let{description:t,prefixCls:n,message:r,title:a,banner:i,className:o,rootClassName:h,style:v,onMouseEnter:g,onMouseLeave:j,onClick:N,afterClose:$,showIcon:A,closable:w,closeText:k,closeIcon:I,action:E,id:C,styles:S,classNames:R,...P}=e,H=a??r,[M,z]=s.useState(!1),F=s.useRef(null);s.useImperativeHandle(l,()=>({nativeElement:F.current}));let{getPrefixCls:T,direction:_,variant:q,closable:L,closeIcon:O,className:Z,style:D,classNames:B,styles:K,successIcon:W,infoIcon:Q,warningIcon:U,errorIcon:X}=(0,u.TP)("alert"),G=T("alert",n),[V,J]=b(G),{onClose:Y,afterClose:ee}=(0,x.Qd)(w)?w:{},el=l=>{z(!0),(Y??e.onClose)?.(l)},et=s.useMemo(()=>void 0!==e.type?e.type:i?"warning":"info",[e.type,i]),es=e.variant??q??"outlined",en=s.useMemo(()=>!!(0,x.Qd)(w)&&!!w.closeIcon||!!k||("boolean"==typeof w?w:!!(!1!==I&&(0,x.R)(I))||!!L),[k,I,w,L]),er=!!i&&void 0===A||A,ea={...e,prefixCls:G,variant:es,type:et,showIcon:er,closable:en},ei=(0,p.XT)(D),eo=(0,p.XT)(v),[ec,ed]=(0,p.AV)([B,R],[K,ei,S,eo],{props:ea}),em=(0,m.$)(G,`${G}-${et}`,`${G}-${es}`,{[`${G}-with-description`]:!!t,[`${G}-no-icon`]:!er,[`${G}-banner`]:!!i,[`${G}-rtl`]:"rtl"===_},Z,o,h,ec.root,J,V),ep=(0,d.KE)(P,{aria:!0,data:!0}),ex=s.useMemo(()=>(0,x.Qd)(w)&&w.closeIcon?w.closeIcon:k||(void 0!==I?I:(0,x.Qd)(L)&&L.closeIcon?L.closeIcon:O),[I,w,L,k,O]),eu=s.useMemo(()=>{let e=w??L;return(0,x.Qd)(e)?(0,d.KE)(e,{data:!0,aria:!0}):{}},[w,L]);return s.createElement(c.Ay,{visible:!M,motionName:`${G}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:ee??$},({className:l,style:n},r)=>s.createElement("div",{id:C,ref:(0,d.K4)(F,r),"data-show":!M,className:(0,m.$)(em,l),style:{...ed.root,...n},onMouseEnter:g,onMouseLeave:j,onClick:N,role:"alert",...ep},er?s.createElement(f,{className:(0,m.$)(`${G}-icon`,ec.icon),style:ed.icon,description:t,icon:e.icon,prefixCls:G,type:et,successIcon:W,infoIcon:Q,warningIcon:U,errorIcon:X}):null,s.createElement("div",{className:(0,m.$)(`${G}-section`,ec.section),style:ed.section},H?s.createElement("div",{className:(0,m.$)(`${G}-title`,ec.title),style:ed.title},H):null,t?s.createElement("div",{className:(0,m.$)(`${G}-description`,ec.description),style:ed.description},t):null),E?s.createElement("div",{className:(0,m.$)(`${G}-actions`,ec.actions),style:ed.actions},E):null,s.createElement(y,{className:ec.close,style:ed.close,isClosable:en,prefixCls:G,closeIcon:ex,handleClose:el,ariaProps:eu})))});var $=t(41113),A=t(49939),w=t(90218),k=t(13076),I=t(83784),E=t(15472);let C=function(e){function l(){var e,t,s;return(0,$.A)(this,l),t=l,s=arguments,t=(0,w.A)(t),(e=(0,I.A)(this,(0,k.A)()?Reflect.construct(t,s||[],(0,w.A)(this).constructor):t.apply(this,s))).state={error:void 0,info:{}},e}return(0,E.A)(l,e),(0,A.A)(l,[{key:"componentDidCatch",value:function(e,l){this.setState({error:e,info:l})}},{key:"render",value:function(){let{message:e,title:l,description:t,id:n,children:r}=this.props,{error:a,info:i}=this.state,o=l??e,c=i?.componentStack||null,d=(0,x.R)(o)?o:a?.toString(),m=(0,x.R)(t)?t:c;return a?s.createElement(N,{id:n,type:"error",title:d,description:s.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},m)}):r}}])}(s.PureComponent);N.ErrorBoundary=C;let S=N},91648:(e,l,t)=>{"use strict";t.d(l,{A:()=>s});let s=(0,t(1278).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},95195:(e,l,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/skills/[id]",function(){return t(71922)}])}},e=>{e.O(0,[6409,1210,1702,5544,4665,8399,8569,8787,6748,636,6593,8792],()=>e(e.s=95195)),_N_E=e.O()}]);