@markus-global/cli 0.9.9-rc.0 → 0.9.9-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/markus.mjs +1 -1
  2. package/dist/web-ui/assets/{CommentInput-BRkHjDZN.js → CommentInput-CidSogOF.js} +1 -1
  3. package/dist/web-ui/assets/{ContentRenderer-BHf4qoQ8.js → ContentRenderer-BsmttX9l.js} +2 -2
  4. package/dist/web-ui/assets/{DeliverableShareModal-BuGiP0iO.js → DeliverableShareModal-Ck-iPMFP.js} +3 -3
  5. package/dist/web-ui/assets/{Deliverables-CCRw1-G6.js → Deliverables-DhciZGmH.js} +1 -1
  6. package/dist/web-ui/assets/{Notifications-V3K-Jh5R.js → Notifications-kiOr1WLO.js} +1 -1
  7. package/dist/web-ui/assets/{Search-Yq4GtqtT.js → Search-R51lNgNR.js} +1 -1
  8. package/dist/web-ui/assets/{Settings-DSLj6wZd.js → Settings-CEpDPzDi.js} +1 -1
  9. package/dist/web-ui/assets/{Store-C8MuiBYk.js → Store-CdvKtaTQ.js} +1 -1
  10. package/dist/web-ui/assets/{Team-C9CW4uI_.js → Team-CxcNwa5O.js} +4 -4
  11. package/dist/web-ui/assets/{Work-gqXPqaqb.js → Work-C_8_ZUiW.js} +1 -1
  12. package/dist/web-ui/assets/{arc-4Un3epQ-.js → arc-QfptBfyf.js} +1 -1
  13. package/dist/web-ui/assets/{architectureDiagram-3BPJPVTR-P9JLPAFD.js → architectureDiagram-3BPJPVTR-BwaTd39l.js} +1 -1
  14. package/dist/web-ui/assets/{blockDiagram-GPEHLZMM-DMVZw0je.js → blockDiagram-GPEHLZMM-F6uVkCU-.js} +1 -1
  15. package/dist/web-ui/assets/{c4Diagram-AAUBKEIU-CUm_kG8b.js → c4Diagram-AAUBKEIU-CLkZF07J.js} +1 -1
  16. package/dist/web-ui/assets/channel-G3UyRMO9.js +1 -0
  17. package/dist/web-ui/assets/{chunk-2J33WTMH-CO16L8Rv.js → chunk-2J33WTMH-xJTx1LaK.js} +1 -1
  18. package/dist/web-ui/assets/{chunk-4BX2VUAB-CX7Icsih.js → chunk-4BX2VUAB-CgzeJPH6.js} +1 -1
  19. package/dist/web-ui/assets/{chunk-55IACEB6-BXo53Ksk.js → chunk-55IACEB6-CSEwSjbc.js} +1 -1
  20. package/dist/web-ui/assets/{chunk-727SXJPM-l-dLi7wm.js → chunk-727SXJPM-CCP8OjW9.js} +1 -1
  21. package/dist/web-ui/assets/{chunk-AQP2D5EJ-CVn9n6_W.js → chunk-AQP2D5EJ-DYfEEGkD.js} +1 -1
  22. package/dist/web-ui/assets/{chunk-FMBD7UC4-DUmAAOWu.js → chunk-FMBD7UC4-BqyWUvsM.js} +1 -1
  23. package/dist/web-ui/assets/{chunk-ND2GUHAM-DMzyCujK.js → chunk-ND2GUHAM-BE4yiTgV.js} +1 -1
  24. package/dist/web-ui/assets/{chunk-QZHKN3VN-BN56eR92.js → chunk-QZHKN3VN-DRj_Bv-t.js} +1 -1
  25. package/dist/web-ui/assets/classDiagram-4FO5ZUOK-D0EQckXG.js +1 -0
  26. package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-D0EQckXG.js +1 -0
  27. package/dist/web-ui/assets/{cose-bilkent-S5V4N54A-Cp0hhUPC.js → cose-bilkent-S5V4N54A-BX2qCzYu.js} +1 -1
  28. package/dist/web-ui/assets/{dagre-BM42HDAG-d7vcGaj6.js → dagre-BM42HDAG-pifgwsOY.js} +1 -1
  29. package/dist/web-ui/assets/{diagram-2AECGRRQ-j-e6bNLc.js → diagram-2AECGRRQ-CuEM3W8S.js} +1 -1
  30. package/dist/web-ui/assets/{diagram-5GNKFQAL-aBO68Kr1.js → diagram-5GNKFQAL-BlbUk4AS.js} +1 -1
  31. package/dist/web-ui/assets/{diagram-KO2AKTUF-JjKTZ0q4.js → diagram-KO2AKTUF-ClaQFeIf.js} +1 -1
  32. package/dist/web-ui/assets/{diagram-LMA3HP47-D8_a-FKC.js → diagram-LMA3HP47-XGsIGJ4b.js} +1 -1
  33. package/dist/web-ui/assets/{diagram-OG6HWLK6-CWlPPlog.js → diagram-OG6HWLK6-BdNtMUBa.js} +1 -1
  34. package/dist/web-ui/assets/{docx-preview-D9tDSXmy.js → docx-preview-B4TYzKVe.js} +1 -1
  35. package/dist/web-ui/assets/{erDiagram-TEJ5UH35-BxU-hkOq.js → erDiagram-TEJ5UH35-DDYsF1UT.js} +1 -1
  36. package/dist/web-ui/assets/{flowDiagram-I6XJVG4X-DiOr2xDD.js → flowDiagram-I6XJVG4X-Ca4Prfb_.js} +1 -1
  37. package/dist/web-ui/assets/{ganttDiagram-6RSMTGT7-Bzzg-s51.js → ganttDiagram-6RSMTGT7-CpAWp7CX.js} +1 -1
  38. package/dist/web-ui/assets/{gitGraphDiagram-PVQCEYII-C4dRhtxr.js → gitGraphDiagram-PVQCEYII-NbgB-War.js} +1 -1
  39. package/dist/web-ui/assets/{index-C-JeUF8o.js → index-ByDm2R2Q.js} +4 -4
  40. package/dist/web-ui/assets/{infoDiagram-5YYISTIA-D7J6SUW3.js → infoDiagram-5YYISTIA-raIYdtwN.js} +1 -1
  41. package/dist/web-ui/assets/{ishikawaDiagram-YF4QCWOH-DLkxtd74.js → ishikawaDiagram-YF4QCWOH-DgldiO9i.js} +1 -1
  42. package/dist/web-ui/assets/{journeyDiagram-JHISSGLW-Du67A9Yw.js → journeyDiagram-JHISSGLW-C0Ggun7y.js} +1 -1
  43. package/dist/web-ui/assets/{kanban-definition-UN3LZRKU-NjM-JWNB.js → kanban-definition-UN3LZRKU-Dv28stos.js} +1 -1
  44. package/dist/web-ui/assets/{mermaid.core-DZ44f5S6.js → mermaid.core-CKl3afmE.js} +5 -5
  45. package/dist/web-ui/assets/{mindmap-definition-RKZ34NQL-jzJVxMGu.js → mindmap-definition-RKZ34NQL-ClLrKr92.js} +1 -1
  46. package/dist/web-ui/assets/{pieDiagram-4H26LBE5-Bji1NMKi.js → pieDiagram-4H26LBE5-B17e_RsX.js} +1 -1
  47. package/dist/web-ui/assets/{quadrantDiagram-W4KKPZXB-CVn-a7Se.js → quadrantDiagram-W4KKPZXB-UsM2h5vg.js} +1 -1
  48. package/dist/web-ui/assets/{requirementDiagram-4Y6WPE33-C0NfgW04.js → requirementDiagram-4Y6WPE33-Bk8JUCl8.js} +1 -1
  49. package/dist/web-ui/assets/{sankeyDiagram-5OEKKPKP-YU6cIInr.js → sankeyDiagram-5OEKKPKP-DJTiJaZJ.js} +1 -1
  50. package/dist/web-ui/assets/{sequenceDiagram-3UESZ5HK-D2tlIr4X.js → sequenceDiagram-3UESZ5HK-CeSW5rTy.js} +1 -1
  51. package/dist/web-ui/assets/{stateDiagram-AJRCARHV-YlXSGJww.js → stateDiagram-AJRCARHV-BZrwgveS.js} +1 -1
  52. package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-DhFW_GeR.js +1 -0
  53. package/dist/web-ui/assets/{timeline-definition-PNZ67QCA-vHgUjj7M.js → timeline-definition-PNZ67QCA-CC6erNUi.js} +1 -1
  54. package/dist/web-ui/assets/{vennDiagram-CIIHVFJN-D98-iHMN.js → vennDiagram-CIIHVFJN-Dq3XTEho.js} +1 -1
  55. package/dist/web-ui/assets/{wardley-L42UT6IY-BExY05R5.js → wardley-L42UT6IY-0QJodPho.js} +1 -1
  56. package/dist/web-ui/assets/{wardleyDiagram-YWT4CUSO-hUWvRAhb.js → wardleyDiagram-YWT4CUSO-D8GA1BsQ.js} +1 -1
  57. package/dist/web-ui/assets/{xychartDiagram-2RQKCTM6-B0zLuKau.js → xychartDiagram-2RQKCTM6-D2jxDEwf.js} +1 -1
  58. package/dist/web-ui/index.html +1 -1
  59. package/package.json +1 -1
  60. package/dist/web-ui/assets/channel-CrGHeOxn.js +0 -1
  61. package/dist/web-ui/assets/classDiagram-4FO5ZUOK-h8nFueDV.js +0 -1
  62. package/dist/web-ui/assets/classDiagram-v2-Q7XG4LA2-h8nFueDV.js +0 -1
  63. package/dist/web-ui/assets/stateDiagram-v2-BHNVJYJU-Dk-B40e3.js +0 -1
package/dist/markus.mjs CHANGED
@@ -357190,7 +357190,7 @@ data: ${JSON.stringify({ error: msg })}
357190
357190
  this.json(res, 404, { ok: false, error: `Provider "${providerName}" not found or not configured`, code: "PROVIDER_NOT_FOUND" });
357191
357191
  return;
357192
357192
  }
357193
- if (this.llmRouter.isProviderDisabled(providerName)) {
357193
+ if (this.llmRouter.isProviderDisabled?.(providerName)) {
357194
357194
  this.json(res, 200, {
357195
357195
  ok: false,
357196
357196
  error: `Provider "${providerName}" is disabled`,
@@ -1 +1 @@
1
- import{j as t,u as T,r as a,k as ee}from"./index-C-JeUF8o.js";const te=1920,ne=10*1024*1024,W=5,se=.8;function re(l,u,i){return new Promise((b,f)=>{const w=new Image;w.onload=()=>{let{width:r,height:s}=w;if(r<=u&&s<=u){b(l);return}r>s?(s=Math.round(s*(u/r)),r=u):(r=Math.round(r*(u/s)),s=u);const h=document.createElement("canvas");h.width=r,h.height=s;const g=h.getContext("2d");if(!g){f(new Error("Failed to get canvas context"));return}g.drawImage(w,0,0,r,s),b(h.toDataURL("image/jpeg",i))},w.onerror=()=>f(new Error("Failed to load image")),w.src=l})}function ae({candidates:l,filter:u,anchorRef:i,onSelect:b,selectedIndex:f,onIndexChange:w}){const{t:r}=T("common"),[s,h]=a.useState(null),g=a.useRef(null),y=l.filter(d=>d.name.toLowerCase().includes(u));return a.useEffect(()=>{const d=i.current;if(!d)return;const x=d.getBoundingClientRect();h({top:x.top+window.scrollY-4,left:x.left+window.scrollX+8})},[i,u]),a.useEffect(()=>{if(!g.current||!s)return;if(g.current.getBoundingClientRect().top<8){const x=i.current;if(!x)return;const c=x.getBoundingClientRect();h({top:c.bottom+window.scrollY+4,left:s.left})}},[s,i]),a.useEffect(()=>{f>=y.length&&w(Math.max(0,y.length-1))},[y.length,f,w]),a.useEffect(()=>{if(!g.current)return;g.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"nearest"})},[f]),!s||y.length===0?null:ee.createPortal(t.jsxs("div",{ref:g,style:{position:"absolute",top:s.top,left:s.left,transform:"translateY(-100%)"},className:"w-60 bg-surface-overlay border border-border-default rounded-lg shadow-xl z-[9999] max-h-48 overflow-y-auto",children:[t.jsx("div",{className:"px-2.5 py-1.5 text-[10px] text-fg-tertiary font-medium uppercase tracking-wider border-b border-border-default",children:r("commentInput.mentionHeading")}),y.map((d,x)=>t.jsxs("button",{"data-selected":x===f,onMouseDown:c=>{c.preventDefault(),b(d)},onMouseEnter:()=>w(x),className:`w-full text-left px-3 py-2 text-xs flex items-center gap-2 transition-colors ${x===f?"bg-brand-500/15 text-brand-500":"hover:bg-surface-elevated"}`,children:[t.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold shrink-0 ${d.type==="human"?"bg-green-500/20 text-green-500":"bg-brand-500/20 text-brand-500"}`,children:d.name.slice(0,2).toUpperCase()}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("span",{className:"text-fg-primary font-medium",children:d.name}),t.jsx("span",{className:"text-fg-tertiary text-[10px] ml-1.5",children:d.subtitle??d.type})]}),d.type==="agent"&&t.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${d.online?"bg-green-400":"bg-gray-500"}`})]},d.id))]}),document.body)}function oe(l){return/^\w+$/.test(l)?`@${l}`:`@[${l}]`}const K=/@\[([^\]]+)\]|@([\w\p{L}\p{N}]+)/gu;function ie(l){const u=[];let i;for(K.lastIndex=0;(i=K.exec(l))!==null;)u.push(i[1]??i[2]);return u}function ce(l,u,i){const b=[];let f=0;const w=u.map(s=>s.name).sort((s,h)=>h.length-s.length);let r=0;for(;r<l.length;){const s=l.indexOf("@",r);if(s<0){b.push(t.jsx("span",{children:l.slice(r)},f++));break}if(s>r&&b.push(t.jsx("span",{children:l.slice(r,s)},f++)),l[s+1]==="["){const c=l.indexOf("]",s+2);if(c>s+2){const m=l.slice(s+2,c),j=u.find(k=>k.name.toLowerCase()===m.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&j?"cursor-pointer hover:underline":""}`,onClick:i&&j?k=>i(j,k):void 0,title:j?`${j.name} (${j.role})`:void 0,children:["@",m]},f++)),r=c+1;continue}}const h=l.slice(s+1),g=h.toLowerCase(),y=w.find(c=>g.startsWith(c.toLowerCase()));if(y){const c=u.find(m=>m.name.toLowerCase()===y.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&c?"cursor-pointer hover:underline":""}`,onClick:i&&c?m=>i(c,m):void 0,title:c?`${c.name} (${c.role})`:void 0,children:["@",y]},f++)),r=s+1+y.length;continue}const d=/^([\w\p{L}\p{N}]+)/u,x=h.match(d);if(x){const c=x[1],m=u.find(j=>j.name.toLowerCase()===c.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&m?"cursor-pointer hover:underline":""}`,onClick:i&&m?j=>i(m,j):void 0,title:m?`${m.name} (${m.role})`:void 0,children:["@",c]},f++)),r=s+1+c.length;continue}b.push(t.jsx("span",{children:"@"},f++)),r=s+1}return b.length>0?b:[t.jsx("span",{children:l},0)]}function de({agents:l,humans:u,onSubmit:i,placeholder:b,replyTo:f,onCancelReply:w}){const{t:r}=T("common"),[s,h]=a.useState(""),[g,y]=a.useState(!1),[d,x]=a.useState(null),[c,m]=a.useState(!1),[j,k]=a.useState(""),[C,S]=a.useState([]),[B,I]=a.useState(0),[N,M]=a.useState([]),[z,A]=a.useState(!1),F=a.useRef(null),U=a.useRef(null),L=a.useRef(null),$=a.useMemo(()=>{const e=(u??[]).map(n=>({id:n.id,name:n.name,type:"human",subtitle:n.role}));for(const n of l)e.push({id:n.id,name:n.name,type:"agent",subtitle:n.role,online:n.status==="idle"||n.status==="working"});return e},[l,u]),D=$.filter(e=>e.name.toLowerCase().includes(j)),E=a.useCallback(e=>{const n=Array.from(e).filter(o=>o.type.startsWith("image/"));if(n.length!==0)for(const o of n){if(o.size>ne)continue;const p=new FileReader;p.onload=()=>{const R=p.result;re(R,te,se).then(v=>{M(_=>_.length>=W?_:[..._,{id:`img_${Date.now()}_${Math.random().toString(36).slice(2,6)}`,dataUrl:v,name:o.name}])})},p.readAsDataURL(o)}},[]),X=a.useCallback(e=>{M(n=>n.filter(o=>o.id!==e))},[]),Y=a.useCallback(e=>{const n=e.clipboardData?.files;if(n&&n.length>0){const o=Array.from(n).filter(p=>p.type.startsWith("image/"));o.length>0&&(e.preventDefault(),E(o))}},[E]),q=a.useCallback(e=>{e.preventDefault(),A(!1);const n=e.dataTransfer?.files;n&&n.length>0&&E(Array.from(n).filter(o=>o.type.startsWith("image/")))},[E]),H=a.useCallback(e=>{e.preventDefault(),A(!0)},[]),G=a.useCallback(()=>{A(!1)},[]),O=async()=>{if(!(!s.trim()&&N.length===0)){y(!0),x(null),L.current={content:s,mentions:[...C],images:[...N]};try{await i(s,C,[...N],f?.id),h(""),S([]),M([]),L.current=null,w?.()}catch(e){x(String(e instanceof Error?e.message:e)||r("commentInput.sendFailed"))}y(!1)}},Q=async()=>{if(!L.current)return;const{content:e,mentions:n,images:o}=L.current;y(!0),x(null);try{await i(e,n,o),h(""),S([]),M([]),L.current=null}catch(p){x(String(p instanceof Error?p.message:p)||r("commentInput.sendFailed"))}y(!1)},P=a.useCallback(e=>{h(n=>{const o=n.lastIndexOf("@"),p=oe(e.name);return o>=0?n.slice(0,o)+p+" ":n+p+" "}),C.includes(e.id)||S(n=>[...n,e.id]),m(!1),k(""),I(0),F.current?.focus()},[C]),V=e=>{h(e),x(null);const n=e.lastIndexOf("@");if(n>=0&&(n===0||e[n-1]===" ")){const p=e.slice(n+1).toLowerCase();if($.some(v=>v.name.toLowerCase().includes(p))){k(p),m(!0),I(0);return}}m(!1)},Z=e=>{if(c&&D.length>0){const n=e.key==="ArrowUp"||e.ctrlKey&&e.key==="p",o=e.key==="ArrowDown"||e.ctrlKey&&e.key==="n",p=e.key==="Enter"||e.key==="Tab",R=e.key==="Escape";if(n){e.preventDefault(),I(v=>(v-1+D.length)%D.length);return}if(o){e.preventDefault(),I(v=>(v+1)%D.length);return}if(p){e.preventDefault();const v=D[B];v&&P(v);return}if(R){e.preventDefault(),m(!1);return}}e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),O())},J=a.useCallback(()=>{setTimeout(()=>m(!1),200)},[]);return t.jsxs("div",{className:"relative",onDragOver:H,onDragLeave:G,onDrop:q,children:[z&&t.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-brand-500/10 rounded-lg border-2 border-dashed border-brand-500",children:t.jsx("span",{className:"text-sm text-brand-500 font-medium",children:r("commentInput.dragDropHint")})}),c&&t.jsx(ae,{candidates:$,filter:j,anchorRef:F,onSelect:P,selectedIndex:B,onIndexChange:I}),t.jsxs("div",{className:"border border-border-default rounded-lg bg-surface-elevated",children:[f&&t.jsxs("div",{className:"flex items-center gap-2 px-2.5 pt-2 pb-1 border-b border-border-default/50",children:[t.jsxs("div",{className:"flex-1 min-w-0 pl-2 border-l-2 border-brand-500/50",children:[t.jsx("span",{className:"text-[10px] font-medium text-brand-500",children:f.authorName}),t.jsx("p",{className:"text-[10px] text-fg-tertiary truncate",children:f.content})]}),t.jsx("button",{onClick:w,className:"text-fg-tertiary hover:text-fg-secondary shrink-0 p-0.5",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),C.length>0&&t.jsx("div",{className:"flex gap-1 px-2.5 pt-2 flex-wrap",children:C.map(e=>{const n=$.find(o=>o.id===e);return t.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded-full ${n?.type==="human"?"bg-green-500/15 text-green-500":"bg-brand-500/15 text-brand-500"}`,children:["@",n?.name??e,t.jsx("button",{onClick:()=>S(o=>o.filter(p=>p!==e)),className:"hover:text-red-400",children:"×"})]},e)})}),t.jsx("textarea",{ref:F,value:s,onChange:e=>V(e.target.value),onKeyDown:Z,onBlur:J,onPaste:Y,placeholder:b??r("commentInput.placeholder"),rows:2,className:"w-full px-2.5 py-2 text-xs bg-transparent text-fg-primary placeholder-fg-tertiary outline-none resize-none"}),N.length>0&&t.jsx("div",{className:"flex items-center gap-1.5 px-2.5 pb-1.5 overflow-x-auto",children:N.map(e=>t.jsxs("div",{className:"relative group/img shrink-0",children:[t.jsx("img",{src:e.dataUrl,alt:e.name,className:"w-12 h-12 rounded-lg object-cover border border-border-default"}),t.jsx("button",{onClick:()=>X(e.id),className:"absolute -top-1.5 -right-1.5 w-4 h-4 bg-surface-secondary border border-gray-600 rounded-full flex items-center justify-center text-fg-secondary hover:text-red-500 hover:border-red-500 text-[10px] opacity-0 group-hover/img:opacity-100 transition-opacity",title:r("commentInput.removeImage"),children:"×"})]},e.id))}),d&&t.jsxs("div",{className:"flex items-center gap-2 px-2.5 pb-1.5",children:[t.jsx("span",{className:"text-[11px] text-red-400 flex-1 truncate",children:d}),t.jsxs("button",{onClick:Q,disabled:g,className:"text-[11px] text-amber-500 hover:text-amber-400 font-medium transition-colors flex items-center gap-1",children:[t.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("polyline",{points:"23 4 23 10 17 10"}),t.jsx("path",{d:"M20.49 15a9 9 0 11-2.12-9.36L23 10"})]}),r("commentInput.retry")]})]}),t.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2",children:[t.jsx("button",{type:"button",onClick:()=>U.current?.click(),disabled:g||N.length>=W,className:"p-1 text-fg-tertiary hover:text-brand-500 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:r("commentInput.attachImage"),children:t.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("polyline",{points:"21 15 16 10 5 21"})]})}),t.jsx("input",{ref:U,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&E(e.target.files),e.target.value=""}}),t.jsx("button",{onClick:O,disabled:!s.trim()&&N.length===0||g,className:"px-3 py-1 text-[11px] font-medium bg-brand-500 text-white rounded-md hover:bg-brand-600 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:r(g?"commentInput.sending":"commentInput.submit")})]})]}),s.trim()&&!g&&t.jsx("div",{className:"mt-0.5 -mb-0.5 flex justify-end px-2.5 pointer-events-none select-none",children:t.jsx("span",{className:"text-[10px] text-fg-tertiary/80",children:r("common:shiftEnterHint")})}),t.jsx("p",{className:"mt-1 text-center text-[10px] text-fg-tertiary/80 select-none",children:r("aiDisclaimer")})]})}export{de as C,ie as p,ce as r};
1
+ import{j as t,u as T,r as a,k as ee}from"./index-ByDm2R2Q.js";const te=1920,ne=10*1024*1024,W=5,se=.8;function re(l,u,i){return new Promise((b,f)=>{const w=new Image;w.onload=()=>{let{width:r,height:s}=w;if(r<=u&&s<=u){b(l);return}r>s?(s=Math.round(s*(u/r)),r=u):(r=Math.round(r*(u/s)),s=u);const h=document.createElement("canvas");h.width=r,h.height=s;const g=h.getContext("2d");if(!g){f(new Error("Failed to get canvas context"));return}g.drawImage(w,0,0,r,s),b(h.toDataURL("image/jpeg",i))},w.onerror=()=>f(new Error("Failed to load image")),w.src=l})}function ae({candidates:l,filter:u,anchorRef:i,onSelect:b,selectedIndex:f,onIndexChange:w}){const{t:r}=T("common"),[s,h]=a.useState(null),g=a.useRef(null),y=l.filter(d=>d.name.toLowerCase().includes(u));return a.useEffect(()=>{const d=i.current;if(!d)return;const x=d.getBoundingClientRect();h({top:x.top+window.scrollY-4,left:x.left+window.scrollX+8})},[i,u]),a.useEffect(()=>{if(!g.current||!s)return;if(g.current.getBoundingClientRect().top<8){const x=i.current;if(!x)return;const c=x.getBoundingClientRect();h({top:c.bottom+window.scrollY+4,left:s.left})}},[s,i]),a.useEffect(()=>{f>=y.length&&w(Math.max(0,y.length-1))},[y.length,f,w]),a.useEffect(()=>{if(!g.current)return;g.current.querySelector('[data-selected="true"]')?.scrollIntoView({block:"nearest"})},[f]),!s||y.length===0?null:ee.createPortal(t.jsxs("div",{ref:g,style:{position:"absolute",top:s.top,left:s.left,transform:"translateY(-100%)"},className:"w-60 bg-surface-overlay border border-border-default rounded-lg shadow-xl z-[9999] max-h-48 overflow-y-auto",children:[t.jsx("div",{className:"px-2.5 py-1.5 text-[10px] text-fg-tertiary font-medium uppercase tracking-wider border-b border-border-default",children:r("commentInput.mentionHeading")}),y.map((d,x)=>t.jsxs("button",{"data-selected":x===f,onMouseDown:c=>{c.preventDefault(),b(d)},onMouseEnter:()=>w(x),className:`w-full text-left px-3 py-2 text-xs flex items-center gap-2 transition-colors ${x===f?"bg-brand-500/15 text-brand-500":"hover:bg-surface-elevated"}`,children:[t.jsx("span",{className:`w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold shrink-0 ${d.type==="human"?"bg-green-500/20 text-green-500":"bg-brand-500/20 text-brand-500"}`,children:d.name.slice(0,2).toUpperCase()}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("span",{className:"text-fg-primary font-medium",children:d.name}),t.jsx("span",{className:"text-fg-tertiary text-[10px] ml-1.5",children:d.subtitle??d.type})]}),d.type==="agent"&&t.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${d.online?"bg-green-400":"bg-gray-500"}`})]},d.id))]}),document.body)}function oe(l){return/^\w+$/.test(l)?`@${l}`:`@[${l}]`}const K=/@\[([^\]]+)\]|@([\w\p{L}\p{N}]+)/gu;function ie(l){const u=[];let i;for(K.lastIndex=0;(i=K.exec(l))!==null;)u.push(i[1]??i[2]);return u}function ce(l,u,i){const b=[];let f=0;const w=u.map(s=>s.name).sort((s,h)=>h.length-s.length);let r=0;for(;r<l.length;){const s=l.indexOf("@",r);if(s<0){b.push(t.jsx("span",{children:l.slice(r)},f++));break}if(s>r&&b.push(t.jsx("span",{children:l.slice(r,s)},f++)),l[s+1]==="["){const c=l.indexOf("]",s+2);if(c>s+2){const m=l.slice(s+2,c),j=u.find(k=>k.name.toLowerCase()===m.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&j?"cursor-pointer hover:underline":""}`,onClick:i&&j?k=>i(j,k):void 0,title:j?`${j.name} (${j.role})`:void 0,children:["@",m]},f++)),r=c+1;continue}}const h=l.slice(s+1),g=h.toLowerCase(),y=w.find(c=>g.startsWith(c.toLowerCase()));if(y){const c=u.find(m=>m.name.toLowerCase()===y.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&c?"cursor-pointer hover:underline":""}`,onClick:i&&c?m=>i(c,m):void 0,title:c?`${c.name} (${c.role})`:void 0,children:["@",y]},f++)),r=s+1+y.length;continue}const d=/^([\w\p{L}\p{N}]+)/u,x=h.match(d);if(x){const c=x[1],m=u.find(j=>j.name.toLowerCase()===c.toLowerCase());b.push(t.jsxs("span",{className:`text-brand-500 font-medium ${i&&m?"cursor-pointer hover:underline":""}`,onClick:i&&m?j=>i(m,j):void 0,title:m?`${m.name} (${m.role})`:void 0,children:["@",c]},f++)),r=s+1+c.length;continue}b.push(t.jsx("span",{children:"@"},f++)),r=s+1}return b.length>0?b:[t.jsx("span",{children:l},0)]}function de({agents:l,humans:u,onSubmit:i,placeholder:b,replyTo:f,onCancelReply:w}){const{t:r}=T("common"),[s,h]=a.useState(""),[g,y]=a.useState(!1),[d,x]=a.useState(null),[c,m]=a.useState(!1),[j,k]=a.useState(""),[C,S]=a.useState([]),[B,I]=a.useState(0),[N,M]=a.useState([]),[z,A]=a.useState(!1),F=a.useRef(null),U=a.useRef(null),L=a.useRef(null),$=a.useMemo(()=>{const e=(u??[]).map(n=>({id:n.id,name:n.name,type:"human",subtitle:n.role}));for(const n of l)e.push({id:n.id,name:n.name,type:"agent",subtitle:n.role,online:n.status==="idle"||n.status==="working"});return e},[l,u]),D=$.filter(e=>e.name.toLowerCase().includes(j)),E=a.useCallback(e=>{const n=Array.from(e).filter(o=>o.type.startsWith("image/"));if(n.length!==0)for(const o of n){if(o.size>ne)continue;const p=new FileReader;p.onload=()=>{const R=p.result;re(R,te,se).then(v=>{M(_=>_.length>=W?_:[..._,{id:`img_${Date.now()}_${Math.random().toString(36).slice(2,6)}`,dataUrl:v,name:o.name}])})},p.readAsDataURL(o)}},[]),X=a.useCallback(e=>{M(n=>n.filter(o=>o.id!==e))},[]),Y=a.useCallback(e=>{const n=e.clipboardData?.files;if(n&&n.length>0){const o=Array.from(n).filter(p=>p.type.startsWith("image/"));o.length>0&&(e.preventDefault(),E(o))}},[E]),q=a.useCallback(e=>{e.preventDefault(),A(!1);const n=e.dataTransfer?.files;n&&n.length>0&&E(Array.from(n).filter(o=>o.type.startsWith("image/")))},[E]),H=a.useCallback(e=>{e.preventDefault(),A(!0)},[]),G=a.useCallback(()=>{A(!1)},[]),O=async()=>{if(!(!s.trim()&&N.length===0)){y(!0),x(null),L.current={content:s,mentions:[...C],images:[...N]};try{await i(s,C,[...N],f?.id),h(""),S([]),M([]),L.current=null,w?.()}catch(e){x(String(e instanceof Error?e.message:e)||r("commentInput.sendFailed"))}y(!1)}},Q=async()=>{if(!L.current)return;const{content:e,mentions:n,images:o}=L.current;y(!0),x(null);try{await i(e,n,o),h(""),S([]),M([]),L.current=null}catch(p){x(String(p instanceof Error?p.message:p)||r("commentInput.sendFailed"))}y(!1)},P=a.useCallback(e=>{h(n=>{const o=n.lastIndexOf("@"),p=oe(e.name);return o>=0?n.slice(0,o)+p+" ":n+p+" "}),C.includes(e.id)||S(n=>[...n,e.id]),m(!1),k(""),I(0),F.current?.focus()},[C]),V=e=>{h(e),x(null);const n=e.lastIndexOf("@");if(n>=0&&(n===0||e[n-1]===" ")){const p=e.slice(n+1).toLowerCase();if($.some(v=>v.name.toLowerCase().includes(p))){k(p),m(!0),I(0);return}}m(!1)},Z=e=>{if(c&&D.length>0){const n=e.key==="ArrowUp"||e.ctrlKey&&e.key==="p",o=e.key==="ArrowDown"||e.ctrlKey&&e.key==="n",p=e.key==="Enter"||e.key==="Tab",R=e.key==="Escape";if(n){e.preventDefault(),I(v=>(v-1+D.length)%D.length);return}if(o){e.preventDefault(),I(v=>(v+1)%D.length);return}if(p){e.preventDefault();const v=D[B];v&&P(v);return}if(R){e.preventDefault(),m(!1);return}}e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),O())},J=a.useCallback(()=>{setTimeout(()=>m(!1),200)},[]);return t.jsxs("div",{className:"relative",onDragOver:H,onDragLeave:G,onDrop:q,children:[z&&t.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-brand-500/10 rounded-lg border-2 border-dashed border-brand-500",children:t.jsx("span",{className:"text-sm text-brand-500 font-medium",children:r("commentInput.dragDropHint")})}),c&&t.jsx(ae,{candidates:$,filter:j,anchorRef:F,onSelect:P,selectedIndex:B,onIndexChange:I}),t.jsxs("div",{className:"border border-border-default rounded-lg bg-surface-elevated",children:[f&&t.jsxs("div",{className:"flex items-center gap-2 px-2.5 pt-2 pb-1 border-b border-border-default/50",children:[t.jsxs("div",{className:"flex-1 min-w-0 pl-2 border-l-2 border-brand-500/50",children:[t.jsx("span",{className:"text-[10px] font-medium text-brand-500",children:f.authorName}),t.jsx("p",{className:"text-[10px] text-fg-tertiary truncate",children:f.content})]}),t.jsx("button",{onClick:w,className:"text-fg-tertiary hover:text-fg-secondary shrink-0 p-0.5",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),C.length>0&&t.jsx("div",{className:"flex gap-1 px-2.5 pt-2 flex-wrap",children:C.map(e=>{const n=$.find(o=>o.id===e);return t.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded-full ${n?.type==="human"?"bg-green-500/15 text-green-500":"bg-brand-500/15 text-brand-500"}`,children:["@",n?.name??e,t.jsx("button",{onClick:()=>S(o=>o.filter(p=>p!==e)),className:"hover:text-red-400",children:"×"})]},e)})}),t.jsx("textarea",{ref:F,value:s,onChange:e=>V(e.target.value),onKeyDown:Z,onBlur:J,onPaste:Y,placeholder:b??r("commentInput.placeholder"),rows:2,className:"w-full px-2.5 py-2 text-xs bg-transparent text-fg-primary placeholder-fg-tertiary outline-none resize-none"}),N.length>0&&t.jsx("div",{className:"flex items-center gap-1.5 px-2.5 pb-1.5 overflow-x-auto",children:N.map(e=>t.jsxs("div",{className:"relative group/img shrink-0",children:[t.jsx("img",{src:e.dataUrl,alt:e.name,className:"w-12 h-12 rounded-lg object-cover border border-border-default"}),t.jsx("button",{onClick:()=>X(e.id),className:"absolute -top-1.5 -right-1.5 w-4 h-4 bg-surface-secondary border border-gray-600 rounded-full flex items-center justify-center text-fg-secondary hover:text-red-500 hover:border-red-500 text-[10px] opacity-0 group-hover/img:opacity-100 transition-opacity",title:r("commentInput.removeImage"),children:"×"})]},e.id))}),d&&t.jsxs("div",{className:"flex items-center gap-2 px-2.5 pb-1.5",children:[t.jsx("span",{className:"text-[11px] text-red-400 flex-1 truncate",children:d}),t.jsxs("button",{onClick:Q,disabled:g,className:"text-[11px] text-amber-500 hover:text-amber-400 font-medium transition-colors flex items-center gap-1",children:[t.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("polyline",{points:"23 4 23 10 17 10"}),t.jsx("path",{d:"M20.49 15a9 9 0 11-2.12-9.36L23 10"})]}),r("commentInput.retry")]})]}),t.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2",children:[t.jsx("button",{type:"button",onClick:()=>U.current?.click(),disabled:g||N.length>=W,className:"p-1 text-fg-tertiary hover:text-brand-500 disabled:opacity-30 disabled:cursor-not-allowed transition-colors",title:r("commentInput.attachImage"),children:t.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("polyline",{points:"21 15 16 10 5 21"})]})}),t.jsx("input",{ref:U,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&E(e.target.files),e.target.value=""}}),t.jsx("button",{onClick:O,disabled:!s.trim()&&N.length===0||g,className:"px-3 py-1 text-[11px] font-medium bg-brand-500 text-white rounded-md hover:bg-brand-600 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:r(g?"commentInput.sending":"commentInput.submit")})]})]}),s.trim()&&!g&&t.jsx("div",{className:"mt-0.5 -mb-0.5 flex justify-end px-2.5 pointer-events-none select-none",children:t.jsx("span",{className:"text-[10px] text-fg-tertiary/80",children:r("common:shiftEnterHint")})}),t.jsx("p",{className:"mt-1 text-center text-[10px] text-fg-tertiary/80 select-none",children:r("aiDisclaimer")})]})}export{de as C,ie as p,ce as r};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C-JeUF8o.js","assets/index-BfGY_nvu.css"])))=>i.map(i=>d[i]);
2
- import{j as a,r as i,_ as f}from"./index-C-JeUF8o.js";const x=i.lazy(()=>f(()=>import("./index-C-JeUF8o.js").then(e=>e.aH),__vite__mapDeps([0,1])).then(e=>({default:e.MarkdownMessage}))),b=new Set(["ts","tsx","js","jsx","mjs","cjs","py","go","rs","java","kt","kts","c","cc","cpp","cxx","h","hpp","hxx","cs","rb","php","swift","scala","sh","bash","zsh","fish","ps1","sql","yaml","yml","toml","xml","css","scss","less","vue","svelte","graphql","gql","proto","dockerfile","makefile","cmake","rsx","r","lua","pl","pm","ex","exs","erl","hs","clj","zig","nim","dart","gradle","tf","hcl"]);function v(e){const t=e.split(/[/\\]/).pop()?.toLowerCase()||"";if(t==="dockerfile"||t==="makefile")return"code";const r=t.includes(".")?t.split(".").pop():"";switch(r){case"md":case"markdown":return"markdown";case"html":case"htm":return"html";case"json":case"jsonc":return"json";case"csv":case"tsv":return"csv";default:return r&&b.has(r)?"code":r?"text":void 0}}function w(e){const t=e.trimStart();if(/^<!doctype\s+html/i.test(t)||/^<html[\s>]/i.test(t))return"html";if(t.startsWith("{")||t.startsWith("["))try{return JSON.parse(e),"json"}catch{}}function S(e){if(e.format)return e.format;if(e.reference){const t=v(e.reference);if(t)return t}if(e.content){const t=w(e.content);if(t)return t}return e.reference?"text":"markdown"}function y({content:e,className:t,onSelection:r}){const c=i.useRef(null),[l,p]=i.useState(null);i.useEffect(()=>{const o=d=>{d.data?.type==="__htmlpreview_height"&&typeof d.data.height=="number"&&p(d.data.height),d.data?.type==="__htmlpreview_selection"&&r&&r(d.data)};return window.addEventListener("message",o),()=>window.removeEventListener("message",o)},[r]);const h=`<script>
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-ByDm2R2Q.js","assets/index-BfGY_nvu.css"])))=>i.map(i=>d[i]);
2
+ import{j as a,r as i,_ as f}from"./index-ByDm2R2Q.js";const x=i.lazy(()=>f(()=>import("./index-ByDm2R2Q.js").then(e=>e.aH),__vite__mapDeps([0,1])).then(e=>({default:e.MarkdownMessage}))),b=new Set(["ts","tsx","js","jsx","mjs","cjs","py","go","rs","java","kt","kts","c","cc","cpp","cxx","h","hpp","hxx","cs","rb","php","swift","scala","sh","bash","zsh","fish","ps1","sql","yaml","yml","toml","xml","css","scss","less","vue","svelte","graphql","gql","proto","dockerfile","makefile","cmake","rsx","r","lua","pl","pm","ex","exs","erl","hs","clj","zig","nim","dart","gradle","tf","hcl"]);function v(e){const t=e.split(/[/\\]/).pop()?.toLowerCase()||"";if(t==="dockerfile"||t==="makefile")return"code";const r=t.includes(".")?t.split(".").pop():"";switch(r){case"md":case"markdown":return"markdown";case"html":case"htm":return"html";case"json":case"jsonc":return"json";case"csv":case"tsv":return"csv";default:return r&&b.has(r)?"code":r?"text":void 0}}function w(e){const t=e.trimStart();if(/^<!doctype\s+html/i.test(t)||/^<html[\s>]/i.test(t))return"html";if(t.startsWith("{")||t.startsWith("["))try{return JSON.parse(e),"json"}catch{}}function S(e){if(e.format)return e.format;if(e.reference){const t=v(e.reference);if(t)return t}if(e.content){const t=w(e.content);if(t)return t}return e.reference?"text":"markdown"}function y({content:e,className:t,onSelection:r}){const c=i.useRef(null),[l,p]=i.useState(null);i.useEffect(()=>{const o=d=>{d.data?.type==="__htmlpreview_height"&&typeof d.data.height=="number"&&p(d.data.height),d.data?.type==="__htmlpreview_selection"&&r&&r(d.data)};return window.addEventListener("message",o),()=>window.removeEventListener("message",o)},[r]);const h=`<script>
3
3
  (function(){
4
4
  function getXPath(el){
5
5
  if(!el||el.nodeType!==1)return'';
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/docx-preview-D9tDSXmy.js","assets/index-C-JeUF8o.js","assets/index-BfGY_nvu.css"])))=>i.map(i=>d[i]);
2
- import{u as D,r as d,l as E,j as r,_ as z,h as F,o as pe,t as xe}from"./index-C-JeUF8o.js";const J=new Set(["pdf","docx","xlsx"]),be=30*1024*1024;function De({data:e,reference:s,onFallback:n}){const{t:a}=D("deliverables"),t=(e.format||"").toLowerCase().replace(/^\./,""),i=d.useRef(null),[o,c]=d.useState("loading"),[u,f]=d.useState(""),[h,b]=d.useState(0),[m,M]=d.useState(null),[y,V]=d.useState(1),[v,$]=d.useState(1),g=d.useCallback(()=>{n?.()},[n]),S=d.useCallback(async()=>{if(s)try{await E.files.reveal(s);return}catch{}g()},[s,g]),w=d.useCallback(p=>{const j=i.current?.querySelector(`canvas[data-page="${p}"]`);j&&(j.scrollIntoView({behavior:"smooth",block:"start"}),V(p))},[]);d.useEffect(()=>{const p=i.current;if(!p||!J.has(t)){c("ready");return}let j=!1,k;return c("loading"),f(""),p.innerHTML="",(async()=>{try{t==="pdf"?k=await we(e.streamUrl,p,{onReady:I=>{M(I),V(1)},zoom:v}):t==="docx"?k=await je(e.streamUrl,p):t==="xlsx"&&(k=await ke(e.streamUrl,p)),j||c("ready")}catch(I){j||(c("error"),f(String(I)))}})(),()=>{j=!0,k&&k(),p.innerHTML=""}},[e.streamUrl,t,h,v]);const A=!J.has(t);return r.jsx("div",{className:"flex flex-col h-full min-h-0",children:A?r.jsx(me,{format:t,size:e.size,onOpenSystem:S,onDownload:()=>g()}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-3 py-1.5 border-b border-border-default/60 bg-surface-elevated/40",children:[r.jsx("span",{className:"text-[10px] font-medium text-fg-tertiary uppercase tracking-wide",children:t}),e.name&&r.jsx("span",{className:"text-[11px] text-fg-secondary truncate flex-1 min-w-0",title:e.name,children:e.name}),e.size!=null&&e.size>be&&r.jsx("span",{className:"text-[10px] text-amber-500 shrink-0",children:a("officeLargeFile")}),t==="pdf"&&m!=null&&r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>w(Math.max(1,y-1)),disabled:y<=1,className:"w-6 h-6 flex items-center justify-center rounded-md text-fg-tertiary hover:text-fg-secondary disabled:opacity-30",children:"‹"}),r.jsxs("span",{className:"text-[10px] text-fg-tertiary tabular-nums",children:[y,"/",m]}),r.jsx("button",{onClick:()=>w(Math.min(m??1,y+1)),disabled:y>=(m??1),className:"w-6 h-6 flex items-center justify-center rounded-md text-fg-tertiary hover:text-fg-secondary disabled:opacity-30",children:"›"})]}),t==="pdf"&&r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>$(p=>Math.max(.5,+(p-.25).toFixed(2))),disabled:v<=.5,className:"w-6 h-6 flex items-center justify-center rounded-md text-fg-tertiary hover:text-fg-secondary disabled:opacity-30",children:"−"}),r.jsxs("span",{className:"text-[10px] text-fg-tertiary tabular-nums",children:[Math.round(v*100),"%"]}),r.jsx("button",{onClick:()=>$(p=>Math.min(3,+(p+.25).toFixed(2))),disabled:v>=3,className:"w-6 h-6 flex items-center justify-center rounded-md text-fg-tertiary hover:text-fg-secondary disabled:opacity-30",children:"+"})]}),r.jsx("button",{onClick:S,className:"shrink-0 text-[10px] text-fg-tertiary hover:text-fg-secondary px-1.5 py-0.5 rounded hover:bg-surface-overlay transition-colors",children:a("officeOpenSystem")})]}),r.jsxs("div",{className:"flex-1 min-h-0 overflow-auto p-3",children:[o==="loading"&&r.jsxs("div",{className:"flex items-center justify-center h-full text-fg-tertiary",children:[r.jsxs("svg",{className:"animate-spin w-4 h-4 mr-2",viewBox:"0 0 24 24",fill:"none",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),r.jsx("span",{className:"text-xs",children:a("officeLoading")})]}),o==="error"&&r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-center px-4",children:[r.jsx("span",{className:"text-[11px] text-fg-tertiary",children:a("officeFailed")}),r.jsx("span",{className:"text-[10px] text-fg-quaternary max-w-xs truncate",children:u}),r.jsxs("div",{className:"flex gap-2 mt-1",children:[r.jsx("button",{onClick:()=>b(p=>p+1),className:"px-3 py-1.5 text-xs bg-brand-600 text-white rounded-lg hover:bg-brand-500 transition-colors",children:a("officeRetry")}),r.jsx("button",{onClick:S,className:"px-3 py-1.5 text-xs border border-border-default text-fg-secondary rounded-lg hover:bg-surface-elevated transition-colors",children:a("officeOpenSystem")})]})]}),r.jsx("div",{ref:i,className:o==="loading"?"hidden":""})]})]})})}function me({format:e,size:s,onOpenSystem:n,onDownload:a}){const{t}=D("deliverables");return r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-center px-6",children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-surface-elevated flex items-center justify-center text-xl",children:"📄"}),r.jsx("div",{className:"text-xs text-fg-secondary",children:t("officeNoInlinePreview",{format:e})}),s!=null&&r.jsx("div",{className:"text-[10px] text-fg-tertiary",children:t("officeSize",{size:ge(s)})}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{onClick:n,className:"px-3 py-1.5 text-xs bg-brand-600 text-white rounded-lg hover:bg-brand-500 transition-colors",children:t("officeOpenSystem")}),r.jsx("button",{onClick:a,className:"px-3 py-1.5 text-xs border border-border-default text-fg-secondary rounded-lg hover:bg-surface-elevated transition-colors",children:t("officeDownload")})]})]})}function ge(e){return e==null||!Number.isFinite(e)?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function ye(){const e=Uint8Array.prototype;typeof e.toHex!="function"&&(e.toHex=function(){let t="",i=0,o=this.length,c;for(;i<o;++i)c=this[i],t+=(c>>>4).toString(16)+(c&15).toString(16);return t});const s=Map.prototype;typeof s.getOrInsertComputed!="function"&&(s.getOrInsertComputed=function(t,i){if(this.has(t))return this.get(t);const o=i(t);return this.set(t,o),o}),typeof s.getOrInsert!="function"&&(s.getOrInsert=function(t,i){return this.has(t)?this.get(t):(this.set(t,i),i)});const n=Promise;typeof n.try!="function"&&(n.try=function(t){return new Promise(i=>i(t()))});const a=typeof Iterator<"u"?Iterator.prototype:null;a&&typeof a.join!="function"&&(a.join=function(t=","){let i="",o=!0;for(const c of this)o||(i+=t),i+=String(c),o=!1;return i})}ye();let U=null;function ve(){if(!U){const s=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/docx-preview-B4TYzKVe.js","assets/index-ByDm2R2Q.js","assets/index-BfGY_nvu.css"])))=>i.map(i=>d[i]);
2
+ import{u as D,r as d,l as E,j as r,_ as z,h as F,o as pe,t as xe}from"./index-ByDm2R2Q.js";const J=new Set(["pdf","docx","xlsx"]),be=30*1024*1024;function De({data:e,reference:s,onFallback:n}){const{t:a}=D("deliverables"),t=(e.format||"").toLowerCase().replace(/^\./,""),i=d.useRef(null),[o,c]=d.useState("loading"),[u,f]=d.useState(""),[h,b]=d.useState(0),[m,M]=d.useState(null),[y,V]=d.useState(1),[v,$]=d.useState(1),g=d.useCallback(()=>{n?.()},[n]),S=d.useCallback(async()=>{if(s)try{await E.files.reveal(s);return}catch{}g()},[s,g]),w=d.useCallback(p=>{const j=i.current?.querySelector(`canvas[data-page="${p}"]`);j&&(j.scrollIntoView({behavior:"smooth",block:"start"}),V(p))},[]);d.useEffect(()=>{const p=i.current;if(!p||!J.has(t)){c("ready");return}let j=!1,k;return c("loading"),f(""),p.innerHTML="",(async()=>{try{t==="pdf"?k=await we(e.streamUrl,p,{onReady:I=>{M(I),V(1)},zoom:v}):t==="docx"?k=await je(e.streamUrl,p):t==="xlsx"&&(k=await ke(e.streamUrl,p)),j||c("ready")}catch(I){j||(c("error"),f(String(I)))}})(),()=>{j=!0,k&&k(),p.innerHTML=""}},[e.streamUrl,t,h,v]);const A=!J.has(t);return r.jsx("div",{className:"flex flex-col h-full min-h-0",children:A?r.jsx(me,{format:t,size:e.size,onOpenSystem:S,onDownload:()=>g()}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-3 py-1.5 border-b border-border-default/60 bg-surface-elevated/40",children:[r.jsx("span",{className:"text-[10px] font-medium text-fg-tertiary uppercase tracking-wide",children:t}),e.name&&r.jsx("span",{className:"text-[11px] text-fg-secondary truncate flex-1 min-w-0",title:e.name,children:e.name}),e.size!=null&&e.size>be&&r.jsx("span",{className:"text-[10px] text-amber-500 shrink-0",children:a("officeLargeFile")}),t==="pdf"&&m!=null&&r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>w(Math.max(1,y-1)),disabled:y<=1,className:"w-6 h-6 flex items-center justify-center rounded-md text-fg-tertiary hover:text-fg-secondary disabled:opacity-30",children:"‹"}),r.jsxs("span",{className:"text-[10px] text-fg-tertiary tabular-nums",children:[y,"/",m]}),r.jsx("button",{onClick:()=>w(Math.min(m??1,y+1)),disabled:y>=(m??1),className:"w-6 h-6 flex items-center justify-center rounded-md text-fg-tertiary hover:text-fg-secondary disabled:opacity-30",children:"›"})]}),t==="pdf"&&r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>$(p=>Math.max(.5,+(p-.25).toFixed(2))),disabled:v<=.5,className:"w-6 h-6 flex items-center justify-center rounded-md text-fg-tertiary hover:text-fg-secondary disabled:opacity-30",children:"−"}),r.jsxs("span",{className:"text-[10px] text-fg-tertiary tabular-nums",children:[Math.round(v*100),"%"]}),r.jsx("button",{onClick:()=>$(p=>Math.min(3,+(p+.25).toFixed(2))),disabled:v>=3,className:"w-6 h-6 flex items-center justify-center rounded-md text-fg-tertiary hover:text-fg-secondary disabled:opacity-30",children:"+"})]}),r.jsx("button",{onClick:S,className:"shrink-0 text-[10px] text-fg-tertiary hover:text-fg-secondary px-1.5 py-0.5 rounded hover:bg-surface-overlay transition-colors",children:a("officeOpenSystem")})]}),r.jsxs("div",{className:"flex-1 min-h-0 overflow-auto p-3",children:[o==="loading"&&r.jsxs("div",{className:"flex items-center justify-center h-full text-fg-tertiary",children:[r.jsxs("svg",{className:"animate-spin w-4 h-4 mr-2",viewBox:"0 0 24 24",fill:"none",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),r.jsx("span",{className:"text-xs",children:a("officeLoading")})]}),o==="error"&&r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-center px-4",children:[r.jsx("span",{className:"text-[11px] text-fg-tertiary",children:a("officeFailed")}),r.jsx("span",{className:"text-[10px] text-fg-quaternary max-w-xs truncate",children:u}),r.jsxs("div",{className:"flex gap-2 mt-1",children:[r.jsx("button",{onClick:()=>b(p=>p+1),className:"px-3 py-1.5 text-xs bg-brand-600 text-white rounded-lg hover:bg-brand-500 transition-colors",children:a("officeRetry")}),r.jsx("button",{onClick:S,className:"px-3 py-1.5 text-xs border border-border-default text-fg-secondary rounded-lg hover:bg-surface-elevated transition-colors",children:a("officeOpenSystem")})]})]}),r.jsx("div",{ref:i,className:o==="loading"?"hidden":""})]})]})})}function me({format:e,size:s,onOpenSystem:n,onDownload:a}){const{t}=D("deliverables");return r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3 text-center px-6",children:[r.jsx("div",{className:"w-12 h-12 rounded-xl bg-surface-elevated flex items-center justify-center text-xl",children:"📄"}),r.jsx("div",{className:"text-xs text-fg-secondary",children:t("officeNoInlinePreview",{format:e})}),s!=null&&r.jsx("div",{className:"text-[10px] text-fg-tertiary",children:t("officeSize",{size:ge(s)})}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{onClick:n,className:"px-3 py-1.5 text-xs bg-brand-600 text-white rounded-lg hover:bg-brand-500 transition-colors",children:t("officeOpenSystem")}),r.jsx("button",{onClick:a,className:"px-3 py-1.5 text-xs border border-border-default text-fg-secondary rounded-lg hover:bg-surface-elevated transition-colors",children:t("officeDownload")})]})]})}function ge(e){return e==null||!Number.isFinite(e)?"":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function ye(){const e=Uint8Array.prototype;typeof e.toHex!="function"&&(e.toHex=function(){let t="",i=0,o=this.length,c;for(;i<o;++i)c=this[i],t+=(c>>>4).toString(16)+(c&15).toString(16);return t});const s=Map.prototype;typeof s.getOrInsertComputed!="function"&&(s.getOrInsertComputed=function(t,i){if(this.has(t))return this.get(t);const o=i(t);return this.set(t,o),o}),typeof s.getOrInsert!="function"&&(s.getOrInsert=function(t,i){return this.has(t)?this.get(t):(this.set(t,i),i)});const n=Promise;typeof n.try!="function"&&(n.try=function(t){return new Promise(i=>i(t()))});const a=typeof Iterator<"u"?Iterator.prototype:null;a&&typeof a.join!="function"&&(a.join=function(t=","){let i="",o=!0;for(const c of this)o||(i+=t),i+=String(c),o=!1;return i})}ye();let U=null;function ve(){if(!U){const s=`
3
3
  if (typeof Uint8Array.prototype.toHex !== 'function') {
4
4
  Uint8Array.prototype.toHex = function() {
5
5
  var s = '', i = 0, n = this.length, b;
@@ -32,7 +32,7 @@ if (ip && typeof ip.join !== 'function') {
32
32
  };
33
33
  }
34
34
  await import("${new URL("/assets/pdf.worker.min-CHFwMXne.mjs",import.meta.url).toString()}");
35
- `;U=URL.createObjectURL(new Blob([s],{type:"text/javascript"}))}return U}async function we(e,s,n){const a=await z(()=>import("./pdf-DMRcuM1e.js"),[]);a.GlobalWorkerOptions.workerSrc=ve();const t=await a.getDocument({url:e}).promise,i=[];for(let o=1;o<=t.numPages;o++){const c=await t.getPage(o),u=c.getViewport({scale:1.5*n.zoom}),f=document.createElement("canvas");f.width=Math.floor(u.width),f.height=Math.floor(u.height),f.style.width=`${Math.floor(u.width)}px`,f.style.height=`${Math.floor(u.height)}px`,f.style.marginBottom="8px",f.style.boxShadow="0 1px 4px rgba(0,0,0,0.15)",f.style.borderRadius="2px";const h=f.getContext("2d");if(!h)throw new Error("canvas 2d context unavailable");await c.render({canvas:f,canvasContext:h,viewport:u}).promise,f.dataset.page=String(o),s.appendChild(f),i.push(f)}return n.onReady(t.numPages),()=>{for(const o of i)o.remove();t.cleanup()}}async function je(e,s){const{renderAsync:n}=await z(async()=>{const{renderAsync:t}=await import("./docx-preview-D9tDSXmy.js");return{renderAsync:t}},__vite__mapDeps([0,1,2])),a=await fetch(e).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.blob()});if(a.size===0)throw new Error("empty docx");return await n(a,s,void 0,{inWrapper:!0,ignoreWidth:!0,ignoreHeight:!1,breakPages:!0,className:"office-docx"}),()=>{s.innerHTML=""}}async function ke(e,s){const n=await z(()=>import("./xlsx-CNerDvZX.js"),[]),a=await fetch(e).then(c=>{if(!c.ok)throw new Error(`HTTP ${c.status}`);return c.arrayBuffer()});if(a.byteLength===0)throw new Error("empty xlsx");const t=n.read(a,{type:"array"});if(!t.SheetNames||t.SheetNames.length===0)throw new Error("no sheets");const i=n.utils.sheet_to_html(t.Sheets[t.SheetNames[0]],{id:"office-xlsx-sheet",editable:!1});s.innerHTML=i;const o=document.createElement("style");return o.textContent=`
35
+ `;U=URL.createObjectURL(new Blob([s],{type:"text/javascript"}))}return U}async function we(e,s,n){const a=await z(()=>import("./pdf-DMRcuM1e.js"),[]);a.GlobalWorkerOptions.workerSrc=ve();const t=await a.getDocument({url:e}).promise,i=[];for(let o=1;o<=t.numPages;o++){const c=await t.getPage(o),u=c.getViewport({scale:1.5*n.zoom}),f=document.createElement("canvas");f.width=Math.floor(u.width),f.height=Math.floor(u.height),f.style.width=`${Math.floor(u.width)}px`,f.style.height=`${Math.floor(u.height)}px`,f.style.marginBottom="8px",f.style.boxShadow="0 1px 4px rgba(0,0,0,0.15)",f.style.borderRadius="2px";const h=f.getContext("2d");if(!h)throw new Error("canvas 2d context unavailable");await c.render({canvas:f,canvasContext:h,viewport:u}).promise,f.dataset.page=String(o),s.appendChild(f),i.push(f)}return n.onReady(t.numPages),()=>{for(const o of i)o.remove();t.cleanup()}}async function je(e,s){const{renderAsync:n}=await z(async()=>{const{renderAsync:t}=await import("./docx-preview-B4TYzKVe.js");return{renderAsync:t}},__vite__mapDeps([0,1,2])),a=await fetch(e).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.blob()});if(a.size===0)throw new Error("empty docx");return await n(a,s,void 0,{inWrapper:!0,ignoreWidth:!0,ignoreHeight:!1,breakPages:!0,className:"office-docx"}),()=>{s.innerHTML=""}}async function ke(e,s){const n=await z(()=>import("./xlsx-CNerDvZX.js"),[]),a=await fetch(e).then(c=>{if(!c.ok)throw new Error(`HTTP ${c.status}`);return c.arrayBuffer()});if(a.byteLength===0)throw new Error("empty xlsx");const t=n.read(a,{type:"array"});if(!t.SheetNames||t.SheetNames.length===0)throw new Error("no sheets");const i=n.utils.sheet_to_html(t.Sheets[t.SheetNames[0]],{id:"office-xlsx-sheet",editable:!1});s.innerHTML=i;const o=document.createElement("style");return o.textContent=`
36
36
  #office-xlsx-sheet { border-collapse: collapse; font-size: 12px; color: var(--fg-primary, #333); }
37
37
  #office-xlsx-sheet td, #office-xlsx-sheet th {
38
38
  border: 1px solid var(--border-default, #ddd); padding: 4px 8px; white-space: nowrap;
@@ -1,3 +1,3 @@
1
- import{u as Ke,j as e,r as a,a as vs,b as js,m as ks,d as ws,c as Ns,l as p,w as xt,o as Jt,p as Ss,P,n as ee,M as Cs,q as Ue,h as Is,i as Xt,s as Ls}from"./index-C-JeUF8o.js";import{resolveFormat as Rs,ContentRenderer as Es}from"./ContentRenderer-BHf4qoQ8.js";import{c as Ts,a as Ps,O as Bs,D as Ms}from"./DeliverableShareModal-BuGiP0iO.js";function $(d){return Array.isArray(d)?d.map(o=>String(o).trim()).filter(Boolean):typeof d=="string"&&d?d.split(",").map(o=>o.trim()).filter(Boolean):[]}function As(d){return d.files&&typeof d.files=="object"&&!Array.isArray(d.files)?d.files:null}function te({label:d,value:o}){return o?e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:d}),e.jsx("div",{className:"text-xs text-fg-secondary mt-0.5",children:o})]}):null}function de({label:d,value:o,color:c}){if(!o)return null;const r={purple:"bg-brand-500/15 text-brand-500",cyan:"bg-blue-500/15 text-blue-600",indigo:"bg-brand-500/15 text-brand-500",gray:"bg-gray-500/15 text-fg-secondary",emerald:"bg-green-500/15 text-green-600"};return e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:d}),e.jsx("div",{className:`mt-0.5 px-2 py-0.5 rounded-full text-[10px] font-medium ${r[c]??r.gray} capitalize inline-block`,children:o})]})}function ft({files:d}){const{t:o}=Ke(["builder","common"]),[c,r]=a.useState(Object.keys(d)[0]??""),u=Object.keys(d);return u.length===0?null:e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:o("builder:artifact.files",{count:u.length})}),e.jsxs("div",{className:"mt-1 bg-surface-elevated/50 rounded-lg border border-border-default/30 overflow-hidden",children:[e.jsx("div",{className:"flex gap-0.5 px-1.5 py-1 border-b border-border-default/30 overflow-x-auto",children:u.map(v=>e.jsx("button",{onClick:()=>r(v),className:`px-2 py-0.5 text-[10px] rounded whitespace-nowrap transition-colors ${c===v?"bg-brand-600/30 text-brand-500":"text-fg-tertiary hover:text-fg-secondary"}`,children:v},v))}),c&&d[c]!=null&&e.jsx("pre",{className:"p-2 text-[10px] text-fg-secondary max-h-[120px] overflow-auto whitespace-pre-wrap font-mono",children:d[c]})]})]})}function $s({artifact:d,mode:o}){const{t:c}=Ke(["builder","common"]),r=As(d),u=d.agent,v=d.team,S=d.dependencies,N=d.displayName??d.name;if(o==="agent"){const j=u?.roleName,E=u?.agentRole,k=u?.llmProvider,L=u?.llmModel,g=$(S?.env),R=$(S?.skills);return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(te,{label:c("builder:artifact.name"),value:N}),e.jsx(te,{label:c("builder:artifact.description"),value:d.description}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[j&&e.jsx(de,{label:c("builder:artifact.baseTemplate"),value:j,color:"indigo"}),e.jsx(de,{label:c("builder:artifact.agentRole"),value:E,color:E==="manager"?"purple":"cyan"})]}),$(d.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:$(d.tags).map(w=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:w},w))}),(k||L)&&e.jsxs("div",{className:"flex gap-2",children:[k&&e.jsx(de,{label:c("builder:artifact.llmProvider"),value:k,color:"gray"}),L&&e.jsx(de,{label:c("builder:artifact.llmModel"),value:L,color:"gray"})]}),g.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:c("builder:artifact.requiredEnv")}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:g.map(w=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-amber-500/10 text-amber-600 rounded font-mono",children:w},w))})]}),R.length>0&&e.jsx(te,{label:c("builder:artifact.skills"),value:R.join(", ")}),r&&e.jsx(ft,{files:r})]})}if(o==="team"){const E=v?.members??[];return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(te,{label:c("builder:artifact.name"),value:N}),e.jsx(te,{label:c("builder:artifact.description"),value:d.description}),e.jsx("div",{className:"flex flex-wrap gap-2",children:e.jsx(de,{label:c("builder:artifact.category"),value:d.category,color:"indigo"})}),$(d.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:$(d.tags).map(k=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:k},k))}),r&&e.jsx(ft,{files:r}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:c("builder:artifact.members",{count:E.length})}),e.jsx("div",{className:"mt-1.5 space-y-1.5",children:E.map((k,L)=>e.jsxs("div",{className:"bg-surface-elevated/30 rounded-lg px-2 py-1.5 border border-border-default/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center text-[10px] font-bold ${k.role==="manager"?"bg-brand-500/20 text-brand-500":"bg-blue-500/20 text-blue-600"}`,children:k.role==="manager"?"★":L+1}),e.jsx("span",{className:"text-xs text-fg-secondary flex-1 truncate",children:k.name}),typeof k.roleName=="string"&&k.roleName&&e.jsx("span",{className:"text-[10px] text-brand-500/70 font-mono",children:k.roleName}),e.jsxs("span",{className:"text-[10px] text-fg-tertiary",children:["x",String(k.count??1)]})]}),$(k.skills).length>0&&e.jsx("div",{className:"mt-1 ml-7 flex flex-wrap gap-1",children:$(k.skills).map(g=>e.jsx("span",{className:"px-1 py-0.5 text-[9px] bg-green-500/10 text-green-600 rounded font-mono",children:g},g))})]},L))})]})]})}return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(te,{label:c("builder:artifact.name"),value:N}),e.jsx(te,{label:c("builder:artifact.description"),value:d.description}),e.jsx("div",{className:"flex gap-2",children:e.jsx(de,{label:c("builder:artifact.category"),value:d.category,color:"indigo"})}),r&&e.jsx(ft,{files:r}),$(d.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:$(d.tags).map(j=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:j},j))})]})}const ue={file:{icon:"📄",color:"bg-green-500/10 text-green-600"},directory:{icon:"📁",color:"bg-blue-500/10 text-blue-600"}},Ds=["file","directory"];function Oe(d){return/^https?:\/\//i.test(d)}function I(d){return d?.shareStatus??null}function Vs(d,o){const c=Date.now(),r=new Date(d).getTime(),u=c-r,v=Math.floor(u/6e4);if(v<1)return o("time.justNow");if(v<60)return o("time.minutesAgo",{count:v});const S=Math.floor(v/60);if(S<24)return o("time.hoursAgo",{count:S});const N=Math.floor(S/24);if(N===1)return o("time.yesterday");if(N<30)return o("time.daysAgo",{count:N});const j=Math.floor(N/30);return j<12?o("time.monthsAgo",{count:j}):o("time.yearsAgo",{count:Math.floor(j/12)})}const z={agent:{icon:"✦",color:"bg-brand-500/10 text-brand-500"},team:{icon:"◈",color:"bg-blue-500/10 text-blue-600"},skill:{icon:"⬡",color:"bg-amber-500/10 text-amber-600"}};function Us({authUser:d,previewMode:o,previewData:c}={}){const{t:r}=Ke(["deliverables","common"]),u=vs(),v=js(P.DELIVERABLES),S=ks({side:"left",defaultWidth:384,minWidth:280,maxWidth:600,storageKey:"markus_deliverables_list"}),[N,j]=a.useState(!1),E=a.useRef(N);E.current=N,a.useEffect(()=>{if(!u)return;const t=()=>{E.current&&j(!1)};return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)},[u]);const k=100,L=5e3,[g,R]=a.useState(c?.items??[]),[w,D]=a.useState(c?.items?.length??0),[m,se]=a.useState(!1),[ze,ht]=a.useState(c?.projects??[]),[mt,pt]=a.useState(c?.agents??[]),[gt,es]=a.useState([]),[G,bt]=a.useState(!c),[Ie,Le]=a.useState(""),[fe,Re]=a.useState(""),[V,he]=a.useState(""),[W,me]=a.useState(""),[F,H]=a.useState(""),[re,Ee]=a.useState(""),[ts,Ge]=a.useState(!1),[B,yt]=a.useState("date"),[n,T]=a.useState(()=>c?.initialSelectedId&&c.items?c.items.find(t=>t.id===c.initialSelectedId)??c.items[0]??null:c?.items?.[0]??null),[qe,vt]=a.useState(null),[jt,kt]=a.useState(""),[q,ss]=a.useState(!0),[Ye,pe]=a.useState(()=>{const t=new Date,s=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;return new Set([s])}),[Qe,rs]=a.useState(!1),[Je,wt]=a.useState(!1),ns=a.useMemo(()=>[{id:"date"},{id:"project"},{id:"team"},{id:"agent"}],[]),as=a.useCallback(t=>{yt(t)},[]),Nt=ws(ns,B,as),Y=a.useRef(null),[Te,Pe]=a.useState(null),[Be,St]=a.useState("markdown"),[ge,Ct]=a.useState(null),[be,It]=a.useState(null),[ne,Lt]=a.useState(null),[Rt,Et]=a.useState(!1),[Tt,ye]=a.useState(!1),[Me,Pt]=a.useState(!1),[Xe,Ae]=a.useState(null),[ls,Ze]=a.useState(!1),[et,is]=a.useState(""),[Bt,os]=a.useState(new Set),ve=ne&&n?.type==="file",[_,Q]=a.useState(!1),M=Ns(),ae=M?.keyboardPane??"content",[je,le]=a.useState(null),[ie,J]=a.useState(!1),[ke,tt]=a.useState(""),[U,X]=a.useState(!1),[st,Mt]=a.useState(!1),[rt,Z]=a.useState(null),nt=a.useRef(null),At=a.useCallback(t=>{t&&(t.style.height="auto",t.style.height=t.scrollHeight+"px")},[]),$t=a.useRef(void 0);a.useEffect(()=>{At(nt.current)},[ke,ie,At]);const A=(t,s)=>{vt({type:t,text:s}),setTimeout(()=>vt(null),3e3)},Dt=async t=>{await Ls(t)?(Pt(!0),setTimeout(()=>Pt(!1),1500)):A("error",r("detail.copyFailed"))},$e=a.useMemo(()=>new Map(mt.map(t=>[t.id,t])),[mt]),at=a.useMemo(()=>new Map(ze.map(t=>[t.id,t])),[ze]),Vt=a.useMemo(()=>new Map(gt.map(t=>[t.id,t])),[gt]),we=a.useCallback(t=>{if(!t||t==="default")return null;const s=at.get(t)?.name;return!s||s==="default"?null:s},[at]);a.useEffect(()=>{o||(p.projects.list().then(t=>ht(t.projects)).catch(()=>{}),p.agents.list().then(t=>pt(t.agents??[])).catch(()=>{}),p.teams.list().then(t=>es(t.teams??[])).catch(()=>{}),p.system.storage().then(t=>is(t.dataDir+"/shared")).catch(()=>{}),p.deliverables.checkHealth().then(t=>os(new Set(t.missingFiles))).catch(()=>{}))},[o]),a.useEffect(()=>($t.current=setTimeout(()=>Re(Ie),300),()=>clearTimeout($t.current)),[Ie]);const oe=a.useMemo(()=>({q:fe||void 0,projectId:re||void 0,type:V||void 0,artifactType:W||void 0,source:F||void 0}),[fe,V,W,re,F]),ce=B==="date"?k:L,lt=a.useCallback((t,s)=>s?{...s,hubShareId:s.hubShareId!=null?s.hubShareId:t.hubShareId??null,shareStatus:s.shareStatus!=null?s.shareStatus:t.shareStatus??null,shareUrl:s.shareUrl!=null?s.shareUrl:t.shareUrl??null,shareVisibility:s.shareVisibility!=null?s.shareVisibility:t.shareVisibility??null,shareReason:s.shareReason!=null?s.shareReason:t.shareReason}:t,[]),De=a.useCallback(async()=>{try{const{results:t,total:s}=await p.deliverables.search({...oe,offset:0,limit:ce});R(i=>i.map(l=>{const f=t.find(x=>x.id===l.id);return f?lt(l,f):l})),D(s),T(i=>{if(!i)return null;const l=t.find(f=>f.id===i.id);return l?lt(i,l):i})}catch{}},[oe,ce,lt]),O=a.useCallback(async()=>{bt(!0),Y.current?.scrollTo({top:0,behavior:"instant"});try{const{results:t,total:s}=await p.deliverables.search({...oe,offset:0,limit:ce});R(t),D(s),T(i=>i&&t.some(l=>l.id===i.id)?i:null)}catch{R([]),D(0),T(null)}bt(!1)},[oe,ce]),Ve=a.useCallback(async()=>{if(!(m||g.length>=w)){se(!0);try{const{results:t,total:s}=await p.deliverables.search({...oe,offset:g.length,limit:ce});R(i=>[...i,...t]),D(s)}catch{}se(!1)}},[oe,ce,g.length,w,m]);a.useEffect(()=>{o||O()},[O,o]),a.useEffect(()=>{!o||!c||(R(c.items??[]),D(c.items?.length??0),ht(c.projects??[]),pt(c.agents??[]),c.initialSelectedId&&T(c.items?.find(t=>t.id===c.initialSelectedId)??c.items?.[0]??null))},[o,c]);const it=a.useRef(n);it.current=n,a.useEffect(()=>{if(o||!v)return;const t=xt.on("deliverable:created",()=>O()),s=xt.on("deliverable:updated",l=>{De();const f=l.payload?.deliverableId;f&&it.current?.id===f&&p.deliverables.get(f).then(x=>{x.deliverable&&(T(h=>({...h??x.deliverable,...x.deliverable,hubShareId:h?.hubShareId??x.deliverable.hubShareId??null,shareStatus:h?.shareStatus??x.deliverable.shareStatus??null,shareUrl:h?.shareUrl??x.deliverable.shareUrl??null,shareVisibility:h?.shareVisibility??x.deliverable.shareVisibility??null,shareReason:h?.shareReason??x.deliverable.shareReason??null})),Ht(x.deliverable))}).catch(()=>{})}),i=xt.on("deliverable:removed",()=>O());return()=>{t(),s(),i()}},[De,v,o]);const Wt=a.useMemo(()=>Ts(Jt,Is.getUrl()),[]);a.useEffect(()=>{if(o||!v||!Jt())return;let t=!1;const s=async()=>{try{const l=await Wt.listMine();if(t)return;const f=new Map,x=new Map;for(const b of l)b.id&&f.set(b.id,b),b.localId&&x.set(b.localId,b);const h=new Map;R(b=>b.map(y=>{const C=y.hubShareId&&f.get(y.hubShareId)||x.get(y.id);if(!C)return y;const Ce={hubShareId:y.hubShareId??C.id??null,shareStatus:C.status??null,shareUrl:C.url??null,shareVisibility:y.shareVisibility??C.visibility??null,...C.reason!=null?{shareReason:C.reason}:{}};return h.set(y.id,Ce),{...y,...Ce}})),T(b=>{if(!b)return b;const y=h.get(b.id);return y?{...b,...y}:b});for(const[b,y]of h)p.deliverables.update(b,y).catch(C=>{console.warn("[deliverables] Hub 分享状态本地持久化失败:",C)})}catch{}};s();const i=setInterval(s,3e4);return()=>{t=!0,clearInterval(i)}},[Wt,v,o]);const We=a.useRef(null),ot=a.useRef(g);ot.current=g;const Ne=a.useCallback(t=>{const s=l=>{T(l),u&&(j(!0),history.pushState({mobileDetail:P.DELIVERABLES},"",window.location.hash))},i=ot.current.find(l=>l.id===t);if(i){s(i);return}p.deliverables.get(t).then(l=>{l.deliverable&&s(l.deliverable)}).catch(()=>{})},[u]);a.useEffect(()=>{if(o)return;const t=window.location.hash.slice(1).split("/"),s=Ss(t[0])===P.DELIVERABLES?t[1]:void 0,i=localStorage.getItem("markus_nav_projectId"),l=localStorage.getItem("markus_nav_source");i&&(localStorage.removeItem("markus_nav_projectId"),Ee(i)),(l==="knowledge"||l==="agent")&&(localStorage.removeItem("markus_nav_source"),H(l));const f=localStorage.getItem("markus_nav_openDeliverable")||s;f&&(localStorage.removeItem("markus_nav_openDeliverable"),ot.current.length>0?Ne(f):We.current=f);const x=h=>{const y=h.detail?.params;y?.projectId&&Ee(y.projectId),(y?.source==="knowledge"||y?.source==="agent")&&H(y.source),y?.openDeliverable&&(localStorage.removeItem("markus_nav_openDeliverable"),Ne(y.openDeliverable))};return window.addEventListener("markus:navigate",x),()=>window.removeEventListener("markus:navigate",x)},[Ne,o]),a.useEffect(()=>{const t=We.current;!t||g.length===0||(We.current=null,Ne(t))},[g,Ne]);const Ft=a.useCallback(()=>{const t=Y.current;!t||G||m||g.length>=w||t.scrollHeight<=t.clientHeight+100&&Ve()},[G,m,g.length,w,Ve]);a.useEffect(()=>{const t=Y.current;if(!t)return;const s=()=>{t.scrollTop+t.clientHeight>=t.scrollHeight-100&&Ve()};return t.addEventListener("scroll",s,{passive:!0}),()=>t.removeEventListener("scroll",s)},[Ve]),a.useEffect(()=>{Ft()},[Ft,q,Ye]);const K=a.useMemo(()=>{const t=new Map;for(const i of g){let l,f;if(B==="project"){const x=we(i.projectId);l=x?i.projectId??"_none":"_none",f=x??r("noProject")}else if(B==="team"){const h=(i.agentId?$e.get(i.agentId):void 0)?.teamId??"_none";l=h,f=h!=="_none"?Vt.get(h)?.name??h:r("noTeam")}else if(B==="agent")l=i.agentId??"_none",f=i.agentId?$e.get(i.agentId)?.name??i.agentId:r("common:unknown");else{const x=new Date(i.updatedAt);l=`${x.getFullYear()}-${String(x.getMonth()+1).padStart(2,"0")}-${String(x.getDate()).padStart(2,"0")}`,f=l}t.has(l)||t.set(l,{label:f,items:[]}),t.get(l).items.push(i)}const s=[...t.entries()];return B==="date"?s.sort((i,l)=>l[0].localeCompare(i[0])):s.sort((i,l)=>i[1].label.localeCompare(l[1].label)),s},[g,B,at,$e,Vt,r]);a.useEffect(()=>{if(B==="date"&&q){const t=new Date,s=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;pe(new Set([s]))}else pe(new Set)},[B]);const cs=async t=>{kt("remove");try{await p.deliverables.remove(t.id),A("success",r("removed")),T(null),O()}catch(s){A("error",r("common:error",{message:String(s)}))}kt("")},ds=a.useCallback(t=>{const s=it.current,i=s?.id;if(!i)return;const l={hubShareId:t.id??null,shareStatus:t.status??null,shareUrl:t.url??null,shareVisibility:t.visibility??null,...t.reason!=null||t.status==="rejected"?{shareReason:t.reason??s?.shareReason??null}:{}},f={...l,shareStatus:l.shareStatus??s?.shareStatus??null};T(x=>x&&x.id===i?{...x,...f}:x),R(x=>x.map(h=>h.id===i?{...h,...f}:h)),(async()=>{try{await p.deliverables.update(i,l)}catch(x){console.warn("[deliverables] 分享状态本地回写失败,将由 Hub 轮询补偿:",x)}De()})()},[De]),us=()=>{ee.navigate(P.BUILDER)},Ht=async t=>{if(t.reference&&!Oe(t.reference)){if(t.type==="directory"){ye(!0);return}Et(!0);try{const s=await p.files.preview(t.reference);if(s.type==="image"&&s.mimeType){const i=s.streamUrl||(s.path?p.files.streamUrl(s.path):p.files.streamUrl(t.reference));Ct({src:i,name:s.name})}else if(s.type==="audio"||s.type==="video"){const i=s.streamUrl||(s.path?p.files.streamUrl(s.path):p.files.streamUrl(t.reference));It({kind:s.type,src:i,name:s.name})}else if(s.type==="office"){const i=s.streamUrl||(s.path?p.files.streamUrl(s.path):p.files.streamUrl(t.reference));Lt({format:s.format||String(s.extension||"").replace(/^\./,"")||"pdf",streamUrl:i,name:s.name,size:s.size,reference:s.path||t.reference})}else s.type==="binary"?ye(!0):typeof s.content=="string"?(Pe(s.content),St(Rs({format:t.format,reference:t.reference,content:s.content}))):ye(!0)}catch{Pe(null),t.type==="file"&&ye(!0)}Et(!1)}};a.useEffect(()=>{o||(Pe(null),St("markdown"),Ct(null),It(null),Lt(null),ye(!1),n&&Ht(n))},[n?.id,o]);const _t=a.useCallback(t=>q!==Ye.has(t),[q,Ye]),Ut=K.length>0&&K.every(([t])=>_t(t)),xs=a.useCallback(t=>{pe(s=>{const i=new Set(s);return i.has(t)?i.delete(t):i.add(t),i})},[]),Ot=a.useCallback(t=>{pe(s=>{if(s.has(t)===q)return s;const i=new Set(s);return q?i.add(t):i.delete(t),i})},[q]),fs=a.useCallback(()=>{ss(t=>!t),pe(new Set)},[]),Fe=!!(V||W||F||re||fe),Kt=a.useCallback(()=>{he(""),me(""),H(""),Ee(""),Le(""),Re("")},[]),Se=a.useMemo(()=>K.flatMap(([,t])=>t.items),[K]);a.useEffect(()=>{o||u||G||n||We.current||Se.length!==0&&T(Se[0])},[o,u,G,n,Se]);const ct=a.useRef(null);a.useEffect(()=>{if(!n){ct.current=null;return}if(ct.current===n.id)return;const t=K.find(([,s])=>s.items.some(i=>i.id===n.id));t&&(ct.current=n.id,Ot(t[0]))},[n?.id,K,Ot]);const zt=a.useRef(null),Gt=a.useRef(null),He=a.useRef(!1),qt=a.useRef(ae);a.useEffect(()=>{if(o||u||!v)return;const t=qt.current;qt.current=ae,!(ae!=="l1"||t==="l1")&&_&&(He.current=!0,Q(!1))},[ae,o,u,v,_]),a.useEffect(()=>{if(o||u||!v)return;const t=s=>{if(s.metaKey||s.ctrlKey){if(s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement){s.key==="Escape"&&(s.target.blur(),s.preventDefault());return}if(Xt(s.target))return;if(s.key==="f"){s.preventDefault(),zt.current?.focus();return}if(s.key.toLowerCase()==="b"){s.preventDefault(),Q(C=>{const Ce=!C;return Ce&&(He.current=!0,M?.setKeyboardPane("l1"),requestAnimationFrame(()=>Gt.current?.focus())),Ce});return}if(s.key.toLowerCase()==="l"){s.preventDefault(),ut();return}return s.altKey,void 0}if(M?.keyboardPane==="l0")return;if(s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement){s.key==="Escape"&&(s.target.blur(),s.preventDefault());return}if(Xt(s.target)||s.metaKey||s.ctrlKey||s.altKey)return;const l=s.key.length===1?s.key.toLowerCase():s.key;if(l==="h"||l==="ArrowLeft"){s.preventDefault(),_&&Q(!1),M?.setL0FocusPageId(P.DELIVERABLES),M?.setLeftCollapsed(!1),M?.setKeyboardPane("l0");return}if(l==="l"||l==="ArrowRight"){s.preventDefault(),_&&Q(!1),M?.keyboardPane!=="l1"&&M?.setKeyboardPane("l1");return}const f=l==="j"||l==="ArrowDown"?1:l==="k"||l==="ArrowUp"?-1:0;if(!f)return;s.preventDefault(),M?.setKeyboardPane("l1"),_&&(He.current=!0,Q(!1));const x=Se;if(x.length===0)return;const h=n?x.findIndex(C=>C.id===n.id):-1,b=h<0?f>0?-1:0:h,y=Math.max(0,Math.min(x.length-1,b+f));Yt(x[y]),requestAnimationFrame(()=>{document.querySelector(`[data-deliverable-id="${x[y].id}"]`)?.scrollIntoView({block:"nearest"})})};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[Se,n,o,u,v,M,_]);const _e=a.useRef(null),hs=a.useCallback(t=>{if(!u)return;const s=Y.current;!s||s.scrollTop>0||(_e.current={y:t.touches[0].clientY,scrollTop:s.scrollTop})},[u]),ms=a.useCallback(t=>{if(!u||!_e.current||Je)return;const s=t.changedTouches[0].clientY-_e.current.y;_e.current=null,s>80&&Y.current&&Y.current.scrollTop<=0&&(wt(!0),O().finally(()=>wt(!1)))},[u,Je,O]),Yt=t=>{const s=()=>{T(t),Ze(!1),J(!1),X(!1),u&&(j(!0),history.pushState({mobileDetail:P.DELIVERABLES},"",window.location.hash))};U?Z({action:s}):s()},ps=()=>{if(!U){const t=Te??n?.summary??"";tt(t)}J(!0)},gs=()=>{U?Z({action:()=>{J(!1),X(!1)}}):J(!1)},Qt=async()=>{if(!(!n?.reference||st)){Mt(!0);try{await p.files.write(n.reference,ke),Pe(ke),X(!1),J(!1),A("success",r("detail.saved"))}catch(t){A("error",r("detail.saveFailed")+": "+String(t))}Mt(!1)}},bs=()=>{J(!1),X(!1),Z(null)};a.useEffect(()=>{if(!U)return;const t=s=>{s.preventDefault()};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[U]),a.useEffect(()=>{if(!U)return;const t=s=>{s.preventDefault(),s.stopImmediatePropagation(),Z({action:()=>{J(!1),X(!1);const{page:i,params:l}=s.detail||{};i&&ee.navigate(i,l)}})};return window.addEventListener("markus:navigate",t),()=>window.removeEventListener("markus:navigate",t)},[U]);const dt=a.useRef(null),ut=a.useCallback((t,s)=>{const i=n?.agentId??"",l=n?.id??"",f={};l&&(f.openDeliverable=l);const x=[];if(l){const h=n?.title?.trim()||l,b=h.length>40?`${h.slice(0,24)}…${h.slice(-12)}`:h;x.push({label:`📄 ${b}`,content:["[deliverable]",`ID: ${l}`,`Title: ${n?.title??""}`,n?.reference?`Reference: ${n.reference}`:"",n?.taskId?`Task: ${n.taskId}`:"",n?.projectId?`Project: ${n.projectId}`:""].filter(Boolean).join(`
1
+ import{u as Ke,j as e,r as a,a as vs,b as js,m as ks,d as ws,c as Ns,l as p,w as xt,o as Jt,p as Ss,P,n as ee,M as Cs,q as Ue,h as Is,i as Xt,s as Ls}from"./index-ByDm2R2Q.js";import{resolveFormat as Rs,ContentRenderer as Es}from"./ContentRenderer-BsmttX9l.js";import{c as Ts,a as Ps,O as Bs,D as Ms}from"./DeliverableShareModal-Ck-iPMFP.js";function $(d){return Array.isArray(d)?d.map(o=>String(o).trim()).filter(Boolean):typeof d=="string"&&d?d.split(",").map(o=>o.trim()).filter(Boolean):[]}function As(d){return d.files&&typeof d.files=="object"&&!Array.isArray(d.files)?d.files:null}function te({label:d,value:o}){return o?e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:d}),e.jsx("div",{className:"text-xs text-fg-secondary mt-0.5",children:o})]}):null}function de({label:d,value:o,color:c}){if(!o)return null;const r={purple:"bg-brand-500/15 text-brand-500",cyan:"bg-blue-500/15 text-blue-600",indigo:"bg-brand-500/15 text-brand-500",gray:"bg-gray-500/15 text-fg-secondary",emerald:"bg-green-500/15 text-green-600"};return e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:d}),e.jsx("div",{className:`mt-0.5 px-2 py-0.5 rounded-full text-[10px] font-medium ${r[c]??r.gray} capitalize inline-block`,children:o})]})}function ft({files:d}){const{t:o}=Ke(["builder","common"]),[c,r]=a.useState(Object.keys(d)[0]??""),u=Object.keys(d);return u.length===0?null:e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:o("builder:artifact.files",{count:u.length})}),e.jsxs("div",{className:"mt-1 bg-surface-elevated/50 rounded-lg border border-border-default/30 overflow-hidden",children:[e.jsx("div",{className:"flex gap-0.5 px-1.5 py-1 border-b border-border-default/30 overflow-x-auto",children:u.map(v=>e.jsx("button",{onClick:()=>r(v),className:`px-2 py-0.5 text-[10px] rounded whitespace-nowrap transition-colors ${c===v?"bg-brand-600/30 text-brand-500":"text-fg-tertiary hover:text-fg-secondary"}`,children:v},v))}),c&&d[c]!=null&&e.jsx("pre",{className:"p-2 text-[10px] text-fg-secondary max-h-[120px] overflow-auto whitespace-pre-wrap font-mono",children:d[c]})]})]})}function $s({artifact:d,mode:o}){const{t:c}=Ke(["builder","common"]),r=As(d),u=d.agent,v=d.team,S=d.dependencies,N=d.displayName??d.name;if(o==="agent"){const j=u?.roleName,E=u?.agentRole,k=u?.llmProvider,L=u?.llmModel,g=$(S?.env),R=$(S?.skills);return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(te,{label:c("builder:artifact.name"),value:N}),e.jsx(te,{label:c("builder:artifact.description"),value:d.description}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[j&&e.jsx(de,{label:c("builder:artifact.baseTemplate"),value:j,color:"indigo"}),e.jsx(de,{label:c("builder:artifact.agentRole"),value:E,color:E==="manager"?"purple":"cyan"})]}),$(d.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:$(d.tags).map(w=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:w},w))}),(k||L)&&e.jsxs("div",{className:"flex gap-2",children:[k&&e.jsx(de,{label:c("builder:artifact.llmProvider"),value:k,color:"gray"}),L&&e.jsx(de,{label:c("builder:artifact.llmModel"),value:L,color:"gray"})]}),g.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:c("builder:artifact.requiredEnv")}),e.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:g.map(w=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-amber-500/10 text-amber-600 rounded font-mono",children:w},w))})]}),R.length>0&&e.jsx(te,{label:c("builder:artifact.skills"),value:R.join(", ")}),r&&e.jsx(ft,{files:r})]})}if(o==="team"){const E=v?.members??[];return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(te,{label:c("builder:artifact.name"),value:N}),e.jsx(te,{label:c("builder:artifact.description"),value:d.description}),e.jsx("div",{className:"flex flex-wrap gap-2",children:e.jsx(de,{label:c("builder:artifact.category"),value:d.category,color:"indigo"})}),$(d.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:$(d.tags).map(k=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:k},k))}),r&&e.jsx(ft,{files:r}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider",children:c("builder:artifact.members",{count:E.length})}),e.jsx("div",{className:"mt-1.5 space-y-1.5",children:E.map((k,L)=>e.jsxs("div",{className:"bg-surface-elevated/30 rounded-lg px-2 py-1.5 border border-border-default/20",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`w-5 h-5 rounded flex items-center justify-center text-[10px] font-bold ${k.role==="manager"?"bg-brand-500/20 text-brand-500":"bg-blue-500/20 text-blue-600"}`,children:k.role==="manager"?"★":L+1}),e.jsx("span",{className:"text-xs text-fg-secondary flex-1 truncate",children:k.name}),typeof k.roleName=="string"&&k.roleName&&e.jsx("span",{className:"text-[10px] text-brand-500/70 font-mono",children:k.roleName}),e.jsxs("span",{className:"text-[10px] text-fg-tertiary",children:["x",String(k.count??1)]})]}),$(k.skills).length>0&&e.jsx("div",{className:"mt-1 ml-7 flex flex-wrap gap-1",children:$(k.skills).map(g=>e.jsx("span",{className:"px-1 py-0.5 text-[9px] bg-green-500/10 text-green-600 rounded font-mono",children:g},g))})]},L))})]})]})}return e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsx(te,{label:c("builder:artifact.name"),value:N}),e.jsx(te,{label:c("builder:artifact.description"),value:d.description}),e.jsx("div",{className:"flex gap-2",children:e.jsx(de,{label:c("builder:artifact.category"),value:d.category,color:"indigo"})}),r&&e.jsx(ft,{files:r}),$(d.tags).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:$(d.tags).map(j=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] bg-surface-elevated text-fg-tertiary rounded",children:j},j))})]})}const ue={file:{icon:"📄",color:"bg-green-500/10 text-green-600"},directory:{icon:"📁",color:"bg-blue-500/10 text-blue-600"}},Ds=["file","directory"];function Oe(d){return/^https?:\/\//i.test(d)}function I(d){return d?.shareStatus??null}function Vs(d,o){const c=Date.now(),r=new Date(d).getTime(),u=c-r,v=Math.floor(u/6e4);if(v<1)return o("time.justNow");if(v<60)return o("time.minutesAgo",{count:v});const S=Math.floor(v/60);if(S<24)return o("time.hoursAgo",{count:S});const N=Math.floor(S/24);if(N===1)return o("time.yesterday");if(N<30)return o("time.daysAgo",{count:N});const j=Math.floor(N/30);return j<12?o("time.monthsAgo",{count:j}):o("time.yearsAgo",{count:Math.floor(j/12)})}const z={agent:{icon:"✦",color:"bg-brand-500/10 text-brand-500"},team:{icon:"◈",color:"bg-blue-500/10 text-blue-600"},skill:{icon:"⬡",color:"bg-amber-500/10 text-amber-600"}};function Us({authUser:d,previewMode:o,previewData:c}={}){const{t:r}=Ke(["deliverables","common"]),u=vs(),v=js(P.DELIVERABLES),S=ks({side:"left",defaultWidth:384,minWidth:280,maxWidth:600,storageKey:"markus_deliverables_list"}),[N,j]=a.useState(!1),E=a.useRef(N);E.current=N,a.useEffect(()=>{if(!u)return;const t=()=>{E.current&&j(!1)};return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)},[u]);const k=100,L=5e3,[g,R]=a.useState(c?.items??[]),[w,D]=a.useState(c?.items?.length??0),[m,se]=a.useState(!1),[ze,ht]=a.useState(c?.projects??[]),[mt,pt]=a.useState(c?.agents??[]),[gt,es]=a.useState([]),[G,bt]=a.useState(!c),[Ie,Le]=a.useState(""),[fe,Re]=a.useState(""),[V,he]=a.useState(""),[W,me]=a.useState(""),[F,H]=a.useState(""),[re,Ee]=a.useState(""),[ts,Ge]=a.useState(!1),[B,yt]=a.useState("date"),[n,T]=a.useState(()=>c?.initialSelectedId&&c.items?c.items.find(t=>t.id===c.initialSelectedId)??c.items[0]??null:c?.items?.[0]??null),[qe,vt]=a.useState(null),[jt,kt]=a.useState(""),[q,ss]=a.useState(!0),[Ye,pe]=a.useState(()=>{const t=new Date,s=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;return new Set([s])}),[Qe,rs]=a.useState(!1),[Je,wt]=a.useState(!1),ns=a.useMemo(()=>[{id:"date"},{id:"project"},{id:"team"},{id:"agent"}],[]),as=a.useCallback(t=>{yt(t)},[]),Nt=ws(ns,B,as),Y=a.useRef(null),[Te,Pe]=a.useState(null),[Be,St]=a.useState("markdown"),[ge,Ct]=a.useState(null),[be,It]=a.useState(null),[ne,Lt]=a.useState(null),[Rt,Et]=a.useState(!1),[Tt,ye]=a.useState(!1),[Me,Pt]=a.useState(!1),[Xe,Ae]=a.useState(null),[ls,Ze]=a.useState(!1),[et,is]=a.useState(""),[Bt,os]=a.useState(new Set),ve=ne&&n?.type==="file",[_,Q]=a.useState(!1),M=Ns(),ae=M?.keyboardPane??"content",[je,le]=a.useState(null),[ie,J]=a.useState(!1),[ke,tt]=a.useState(""),[U,X]=a.useState(!1),[st,Mt]=a.useState(!1),[rt,Z]=a.useState(null),nt=a.useRef(null),At=a.useCallback(t=>{t&&(t.style.height="auto",t.style.height=t.scrollHeight+"px")},[]),$t=a.useRef(void 0);a.useEffect(()=>{At(nt.current)},[ke,ie,At]);const A=(t,s)=>{vt({type:t,text:s}),setTimeout(()=>vt(null),3e3)},Dt=async t=>{await Ls(t)?(Pt(!0),setTimeout(()=>Pt(!1),1500)):A("error",r("detail.copyFailed"))},$e=a.useMemo(()=>new Map(mt.map(t=>[t.id,t])),[mt]),at=a.useMemo(()=>new Map(ze.map(t=>[t.id,t])),[ze]),Vt=a.useMemo(()=>new Map(gt.map(t=>[t.id,t])),[gt]),we=a.useCallback(t=>{if(!t||t==="default")return null;const s=at.get(t)?.name;return!s||s==="default"?null:s},[at]);a.useEffect(()=>{o||(p.projects.list().then(t=>ht(t.projects)).catch(()=>{}),p.agents.list().then(t=>pt(t.agents??[])).catch(()=>{}),p.teams.list().then(t=>es(t.teams??[])).catch(()=>{}),p.system.storage().then(t=>is(t.dataDir+"/shared")).catch(()=>{}),p.deliverables.checkHealth().then(t=>os(new Set(t.missingFiles))).catch(()=>{}))},[o]),a.useEffect(()=>($t.current=setTimeout(()=>Re(Ie),300),()=>clearTimeout($t.current)),[Ie]);const oe=a.useMemo(()=>({q:fe||void 0,projectId:re||void 0,type:V||void 0,artifactType:W||void 0,source:F||void 0}),[fe,V,W,re,F]),ce=B==="date"?k:L,lt=a.useCallback((t,s)=>s?{...s,hubShareId:s.hubShareId!=null?s.hubShareId:t.hubShareId??null,shareStatus:s.shareStatus!=null?s.shareStatus:t.shareStatus??null,shareUrl:s.shareUrl!=null?s.shareUrl:t.shareUrl??null,shareVisibility:s.shareVisibility!=null?s.shareVisibility:t.shareVisibility??null,shareReason:s.shareReason!=null?s.shareReason:t.shareReason}:t,[]),De=a.useCallback(async()=>{try{const{results:t,total:s}=await p.deliverables.search({...oe,offset:0,limit:ce});R(i=>i.map(l=>{const f=t.find(x=>x.id===l.id);return f?lt(l,f):l})),D(s),T(i=>{if(!i)return null;const l=t.find(f=>f.id===i.id);return l?lt(i,l):i})}catch{}},[oe,ce,lt]),O=a.useCallback(async()=>{bt(!0),Y.current?.scrollTo({top:0,behavior:"instant"});try{const{results:t,total:s}=await p.deliverables.search({...oe,offset:0,limit:ce});R(t),D(s),T(i=>i&&t.some(l=>l.id===i.id)?i:null)}catch{R([]),D(0),T(null)}bt(!1)},[oe,ce]),Ve=a.useCallback(async()=>{if(!(m||g.length>=w)){se(!0);try{const{results:t,total:s}=await p.deliverables.search({...oe,offset:g.length,limit:ce});R(i=>[...i,...t]),D(s)}catch{}se(!1)}},[oe,ce,g.length,w,m]);a.useEffect(()=>{o||O()},[O,o]),a.useEffect(()=>{!o||!c||(R(c.items??[]),D(c.items?.length??0),ht(c.projects??[]),pt(c.agents??[]),c.initialSelectedId&&T(c.items?.find(t=>t.id===c.initialSelectedId)??c.items?.[0]??null))},[o,c]);const it=a.useRef(n);it.current=n,a.useEffect(()=>{if(o||!v)return;const t=xt.on("deliverable:created",()=>O()),s=xt.on("deliverable:updated",l=>{De();const f=l.payload?.deliverableId;f&&it.current?.id===f&&p.deliverables.get(f).then(x=>{x.deliverable&&(T(h=>({...h??x.deliverable,...x.deliverable,hubShareId:h?.hubShareId??x.deliverable.hubShareId??null,shareStatus:h?.shareStatus??x.deliverable.shareStatus??null,shareUrl:h?.shareUrl??x.deliverable.shareUrl??null,shareVisibility:h?.shareVisibility??x.deliverable.shareVisibility??null,shareReason:h?.shareReason??x.deliverable.shareReason??null})),Ht(x.deliverable))}).catch(()=>{})}),i=xt.on("deliverable:removed",()=>O());return()=>{t(),s(),i()}},[De,v,o]);const Wt=a.useMemo(()=>Ts(Jt,Is.getUrl()),[]);a.useEffect(()=>{if(o||!v||!Jt())return;let t=!1;const s=async()=>{try{const l=await Wt.listMine();if(t)return;const f=new Map,x=new Map;for(const b of l)b.id&&f.set(b.id,b),b.localId&&x.set(b.localId,b);const h=new Map;R(b=>b.map(y=>{const C=y.hubShareId&&f.get(y.hubShareId)||x.get(y.id);if(!C)return y;const Ce={hubShareId:y.hubShareId??C.id??null,shareStatus:C.status??null,shareUrl:C.url??null,shareVisibility:y.shareVisibility??C.visibility??null,...C.reason!=null?{shareReason:C.reason}:{}};return h.set(y.id,Ce),{...y,...Ce}})),T(b=>{if(!b)return b;const y=h.get(b.id);return y?{...b,...y}:b});for(const[b,y]of h)p.deliverables.update(b,y).catch(C=>{console.warn("[deliverables] Hub 分享状态本地持久化失败:",C)})}catch{}};s();const i=setInterval(s,3e4);return()=>{t=!0,clearInterval(i)}},[Wt,v,o]);const We=a.useRef(null),ot=a.useRef(g);ot.current=g;const Ne=a.useCallback(t=>{const s=l=>{T(l),u&&(j(!0),history.pushState({mobileDetail:P.DELIVERABLES},"",window.location.hash))},i=ot.current.find(l=>l.id===t);if(i){s(i);return}p.deliverables.get(t).then(l=>{l.deliverable&&s(l.deliverable)}).catch(()=>{})},[u]);a.useEffect(()=>{if(o)return;const t=window.location.hash.slice(1).split("/"),s=Ss(t[0])===P.DELIVERABLES?t[1]:void 0,i=localStorage.getItem("markus_nav_projectId"),l=localStorage.getItem("markus_nav_source");i&&(localStorage.removeItem("markus_nav_projectId"),Ee(i)),(l==="knowledge"||l==="agent")&&(localStorage.removeItem("markus_nav_source"),H(l));const f=localStorage.getItem("markus_nav_openDeliverable")||s;f&&(localStorage.removeItem("markus_nav_openDeliverable"),ot.current.length>0?Ne(f):We.current=f);const x=h=>{const y=h.detail?.params;y?.projectId&&Ee(y.projectId),(y?.source==="knowledge"||y?.source==="agent")&&H(y.source),y?.openDeliverable&&(localStorage.removeItem("markus_nav_openDeliverable"),Ne(y.openDeliverable))};return window.addEventListener("markus:navigate",x),()=>window.removeEventListener("markus:navigate",x)},[Ne,o]),a.useEffect(()=>{const t=We.current;!t||g.length===0||(We.current=null,Ne(t))},[g,Ne]);const Ft=a.useCallback(()=>{const t=Y.current;!t||G||m||g.length>=w||t.scrollHeight<=t.clientHeight+100&&Ve()},[G,m,g.length,w,Ve]);a.useEffect(()=>{const t=Y.current;if(!t)return;const s=()=>{t.scrollTop+t.clientHeight>=t.scrollHeight-100&&Ve()};return t.addEventListener("scroll",s,{passive:!0}),()=>t.removeEventListener("scroll",s)},[Ve]),a.useEffect(()=>{Ft()},[Ft,q,Ye]);const K=a.useMemo(()=>{const t=new Map;for(const i of g){let l,f;if(B==="project"){const x=we(i.projectId);l=x?i.projectId??"_none":"_none",f=x??r("noProject")}else if(B==="team"){const h=(i.agentId?$e.get(i.agentId):void 0)?.teamId??"_none";l=h,f=h!=="_none"?Vt.get(h)?.name??h:r("noTeam")}else if(B==="agent")l=i.agentId??"_none",f=i.agentId?$e.get(i.agentId)?.name??i.agentId:r("common:unknown");else{const x=new Date(i.updatedAt);l=`${x.getFullYear()}-${String(x.getMonth()+1).padStart(2,"0")}-${String(x.getDate()).padStart(2,"0")}`,f=l}t.has(l)||t.set(l,{label:f,items:[]}),t.get(l).items.push(i)}const s=[...t.entries()];return B==="date"?s.sort((i,l)=>l[0].localeCompare(i[0])):s.sort((i,l)=>i[1].label.localeCompare(l[1].label)),s},[g,B,at,$e,Vt,r]);a.useEffect(()=>{if(B==="date"&&q){const t=new Date,s=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;pe(new Set([s]))}else pe(new Set)},[B]);const cs=async t=>{kt("remove");try{await p.deliverables.remove(t.id),A("success",r("removed")),T(null),O()}catch(s){A("error",r("common:error",{message:String(s)}))}kt("")},ds=a.useCallback(t=>{const s=it.current,i=s?.id;if(!i)return;const l={hubShareId:t.id??null,shareStatus:t.status??null,shareUrl:t.url??null,shareVisibility:t.visibility??null,...t.reason!=null||t.status==="rejected"?{shareReason:t.reason??s?.shareReason??null}:{}},f={...l,shareStatus:l.shareStatus??s?.shareStatus??null};T(x=>x&&x.id===i?{...x,...f}:x),R(x=>x.map(h=>h.id===i?{...h,...f}:h)),(async()=>{try{await p.deliverables.update(i,l)}catch(x){console.warn("[deliverables] 分享状态本地回写失败,将由 Hub 轮询补偿:",x)}De()})()},[De]),us=()=>{ee.navigate(P.BUILDER)},Ht=async t=>{if(t.reference&&!Oe(t.reference)){if(t.type==="directory"){ye(!0);return}Et(!0);try{const s=await p.files.preview(t.reference);if(s.type==="image"&&s.mimeType){const i=s.streamUrl||(s.path?p.files.streamUrl(s.path):p.files.streamUrl(t.reference));Ct({src:i,name:s.name})}else if(s.type==="audio"||s.type==="video"){const i=s.streamUrl||(s.path?p.files.streamUrl(s.path):p.files.streamUrl(t.reference));It({kind:s.type,src:i,name:s.name})}else if(s.type==="office"){const i=s.streamUrl||(s.path?p.files.streamUrl(s.path):p.files.streamUrl(t.reference));Lt({format:s.format||String(s.extension||"").replace(/^\./,"")||"pdf",streamUrl:i,name:s.name,size:s.size,reference:s.path||t.reference})}else s.type==="binary"?ye(!0):typeof s.content=="string"?(Pe(s.content),St(Rs({format:t.format,reference:t.reference,content:s.content}))):ye(!0)}catch{Pe(null),t.type==="file"&&ye(!0)}Et(!1)}};a.useEffect(()=>{o||(Pe(null),St("markdown"),Ct(null),It(null),Lt(null),ye(!1),n&&Ht(n))},[n?.id,o]);const _t=a.useCallback(t=>q!==Ye.has(t),[q,Ye]),Ut=K.length>0&&K.every(([t])=>_t(t)),xs=a.useCallback(t=>{pe(s=>{const i=new Set(s);return i.has(t)?i.delete(t):i.add(t),i})},[]),Ot=a.useCallback(t=>{pe(s=>{if(s.has(t)===q)return s;const i=new Set(s);return q?i.add(t):i.delete(t),i})},[q]),fs=a.useCallback(()=>{ss(t=>!t),pe(new Set)},[]),Fe=!!(V||W||F||re||fe),Kt=a.useCallback(()=>{he(""),me(""),H(""),Ee(""),Le(""),Re("")},[]),Se=a.useMemo(()=>K.flatMap(([,t])=>t.items),[K]);a.useEffect(()=>{o||u||G||n||We.current||Se.length!==0&&T(Se[0])},[o,u,G,n,Se]);const ct=a.useRef(null);a.useEffect(()=>{if(!n){ct.current=null;return}if(ct.current===n.id)return;const t=K.find(([,s])=>s.items.some(i=>i.id===n.id));t&&(ct.current=n.id,Ot(t[0]))},[n?.id,K,Ot]);const zt=a.useRef(null),Gt=a.useRef(null),He=a.useRef(!1),qt=a.useRef(ae);a.useEffect(()=>{if(o||u||!v)return;const t=qt.current;qt.current=ae,!(ae!=="l1"||t==="l1")&&_&&(He.current=!0,Q(!1))},[ae,o,u,v,_]),a.useEffect(()=>{if(o||u||!v)return;const t=s=>{if(s.metaKey||s.ctrlKey){if(s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement){s.key==="Escape"&&(s.target.blur(),s.preventDefault());return}if(Xt(s.target))return;if(s.key==="f"){s.preventDefault(),zt.current?.focus();return}if(s.key.toLowerCase()==="b"){s.preventDefault(),Q(C=>{const Ce=!C;return Ce&&(He.current=!0,M?.setKeyboardPane("l1"),requestAnimationFrame(()=>Gt.current?.focus())),Ce});return}if(s.key.toLowerCase()==="l"){s.preventDefault(),ut();return}return s.altKey,void 0}if(M?.keyboardPane==="l0")return;if(s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement){s.key==="Escape"&&(s.target.blur(),s.preventDefault());return}if(Xt(s.target)||s.metaKey||s.ctrlKey||s.altKey)return;const l=s.key.length===1?s.key.toLowerCase():s.key;if(l==="h"||l==="ArrowLeft"){s.preventDefault(),_&&Q(!1),M?.setL0FocusPageId(P.DELIVERABLES),M?.setLeftCollapsed(!1),M?.setKeyboardPane("l0");return}if(l==="l"||l==="ArrowRight"){s.preventDefault(),_&&Q(!1),M?.keyboardPane!=="l1"&&M?.setKeyboardPane("l1");return}const f=l==="j"||l==="ArrowDown"?1:l==="k"||l==="ArrowUp"?-1:0;if(!f)return;s.preventDefault(),M?.setKeyboardPane("l1"),_&&(He.current=!0,Q(!1));const x=Se;if(x.length===0)return;const h=n?x.findIndex(C=>C.id===n.id):-1,b=h<0?f>0?-1:0:h,y=Math.max(0,Math.min(x.length-1,b+f));Yt(x[y]),requestAnimationFrame(()=>{document.querySelector(`[data-deliverable-id="${x[y].id}"]`)?.scrollIntoView({block:"nearest"})})};return document.addEventListener("keydown",t,!0),()=>document.removeEventListener("keydown",t,!0)},[Se,n,o,u,v,M,_]);const _e=a.useRef(null),hs=a.useCallback(t=>{if(!u)return;const s=Y.current;!s||s.scrollTop>0||(_e.current={y:t.touches[0].clientY,scrollTop:s.scrollTop})},[u]),ms=a.useCallback(t=>{if(!u||!_e.current||Je)return;const s=t.changedTouches[0].clientY-_e.current.y;_e.current=null,s>80&&Y.current&&Y.current.scrollTop<=0&&(wt(!0),O().finally(()=>wt(!1)))},[u,Je,O]),Yt=t=>{const s=()=>{T(t),Ze(!1),J(!1),X(!1),u&&(j(!0),history.pushState({mobileDetail:P.DELIVERABLES},"",window.location.hash))};U?Z({action:s}):s()},ps=()=>{if(!U){const t=Te??n?.summary??"";tt(t)}J(!0)},gs=()=>{U?Z({action:()=>{J(!1),X(!1)}}):J(!1)},Qt=async()=>{if(!(!n?.reference||st)){Mt(!0);try{await p.files.write(n.reference,ke),Pe(ke),X(!1),J(!1),A("success",r("detail.saved"))}catch(t){A("error",r("detail.saveFailed")+": "+String(t))}Mt(!1)}},bs=()=>{J(!1),X(!1),Z(null)};a.useEffect(()=>{if(!U)return;const t=s=>{s.preventDefault()};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[U]),a.useEffect(()=>{if(!U)return;const t=s=>{s.preventDefault(),s.stopImmediatePropagation(),Z({action:()=>{J(!1),X(!1);const{page:i,params:l}=s.detail||{};i&&ee.navigate(i,l)}})};return window.addEventListener("markus:navigate",t),()=>window.removeEventListener("markus:navigate",t)},[U]);const dt=a.useRef(null),ut=a.useCallback((t,s)=>{const i=n?.agentId??"",l=n?.id??"",f={};l&&(f.openDeliverable=l);const x=[];if(l){const h=n?.title?.trim()||l,b=h.length>40?`${h.slice(0,24)}…${h.slice(-12)}`:h;x.push({label:`📄 ${b}`,content:["[deliverable]",`ID: ${l}`,`Title: ${n?.title??""}`,n?.reference?`Reference: ${n.reference}`:"",n?.taskId?`Task: ${n.taskId}`:"",n?.projectId?`Project: ${n.projectId}`:""].filter(Boolean).join(`
2
2
  `)})}if(t?.trim()){const h=t.trim().length>40?`${t.trim().slice(0,24)}…${t.trim().slice(-12)}`:t.trim();if(s){const b=n?.reference??"";x.push({label:`🌐 ${h}`,content:["[html-selection]",`Text: "${t.trim()}"`,`CSS Selector: ${s.cssSelector}`,`XPath: ${s.xpath}`,b?`File: ${b}`:""].filter(Boolean).join(`
3
3
  `)})}else x.push({label:`📝 ${h}`,content:t.trim()})}x.length>0&&(f.chatChips=JSON.stringify(x)),i&&(f.agentId=i),le(null),window.getSelection()?.removeAllRanges(),ee.navigate(P.TEAM,f)},[n]),ys=a.useCallback(t=>{if(!t.text.trim())return;const i=dt.current?.querySelector("iframe")?.getBoundingClientRect(),l=(i?.left??0)+t.rect.x+t.rect.width/2,f=(i?.top??0)+t.rect.y;le({x:l,y:f,text:t.text,htmlMeta:{xpath:t.xpath,cssSelector:t.cssSelector}})},[]);return a.useEffect(()=>{const t=dt.current;if(!t)return;const s=()=>{requestAnimationFrame(()=>{const l=window.getSelection(),f=l?.toString().trim();if(!f||!l?.rangeCount){le(null);return}const x=l.getRangeAt(0);if(!t.contains(x.commonAncestorContainer)){le(null);return}const h=x.getBoundingClientRect();le({x:h.left+h.width/2,y:h.top,text:f})})},i=l=>{const f=document.getElementById("selection-toolbar");f&&f.contains(l.target)||le(null)};return t.addEventListener("mouseup",s),document.addEventListener("mousedown",i),()=>{t.removeEventListener("mouseup",s),document.removeEventListener("mousedown",i)}},[]),e.jsxs("div",{className:"flex-1 overflow-hidden flex",children:[e.jsxs("div",{ref:Gt,tabIndex:-1,"data-keyboard-pane":"l1",className:`${u?"flex-1 min-w-0":"shrink-0"} flex flex-col bg-surface-secondary rounded-xl m-1 mr-0 outline-none ${!u&&ae==="l1"?"ring-1 ring-inset ring-brand-500/30":""}`,style:u?N?{display:"none"}:void 0:_?{display:"none"}:{width:S.width},children:[e.jsxs("div",{"data-electron-drag":!0,className:"p-4 space-y-3",children:[e.jsx("div",{className:"flex items-center justify-between gap-2",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u&&e.jsx(Cs,{}),!u&&e.jsx("button",{onClick:()=>Q(!0),className:"w-8 h-8 flex items-center justify-center rounded-lg transition-colors shrink-0 bg-brand-500/15 text-brand-500 hover:bg-brand-500/25",title:r("sidebar.collapse"),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]})}),e.jsxs("h2",{className:"text-sm font-semibold text-fg-secondary truncate",children:[r("title"),w>0&&e.jsxs("span",{className:"ml-1.5 text-fg-tertiary font-normal",children:["(",w,")"]})]})]})}),e.jsxs("div",{className:"relative",children:[e.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-fg-muted pointer-events-none",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{ref:zt,value:Ie,onChange:t=>Le(t.target.value),placeholder:r("searchPlaceholder"),className:"w-full bg-surface-elevated border border-border-default rounded-lg pl-8 pr-8 py-2 text-sm text-fg-primary focus:border-brand-500 focus:outline-none transition-colors"}),Ie&&e.jsx("button",{onClick:()=>{Le(""),Re("")},className:"absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 flex items-center justify-center rounded-full bg-surface-overlay text-fg-tertiary hover:text-fg-secondary transition-colors",children:e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),et&&!u&&e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 bg-surface-elevated rounded-lg text-[10px] text-fg-tertiary",children:[e.jsx("span",{className:"truncate font-mono",children:et}),e.jsx("button",{onClick:()=>{p.system.openPath(et)},className:"shrink-0 underline hover:text-fg-secondary transition-colors",children:r("common:open")})]}),u&&e.jsxs("button",{onClick:()=>rs(t=>!t),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors ${Qe||Fe?"bg-brand-500/15 text-brand-500":"bg-surface-elevated text-fg-secondary"}`,children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),e.jsx("line",{x1:"8",y1:"12",x2:"20",y2:"12"}),e.jsx("line",{x1:"12",y1:"18",x2:"20",y2:"18"})]}),r("filters.filtersLabel"),Fe&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-brand-500"}),e.jsx("svg",{className:`w-3 h-3 ml-auto transition-transform ${Qe?"rotate-180":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),e.jsxs("div",{className:u&&!Qe?"hidden":"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto scrollbar-hide filter-pills-fade",children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary shrink-0",children:r("filters.source")}),e.jsx(xe,{label:r("filters.allSources"),value:"",current:F,onClick:()=>H("")}),e.jsx(xe,{label:r("filters.sourceAgent"),value:"agent",current:F,onClick:t=>H(t||"")}),e.jsx(xe,{label:r("filters.sourceKnowledge"),value:"knowledge",current:F,onClick:t=>H(t||"")}),e.jsxs("button",{type:"button",onClick:()=>Ge(!0),className:"ml-auto shrink-0 flex items-center gap-1 px-2 py-1 rounded text-[10px] text-fg-tertiary hover:text-brand-500 hover:bg-surface-elevated transition-colors",title:r("filters.bindKnowledgeBase"),children:[e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),r("filters.bindKnowledgeBase")]})]}),e.jsxs("div",{className:"flex gap-1 overflow-x-auto scrollbar-hide filter-pills-fade",children:[e.jsx(xe,{label:r("filters.allTypes"),value:"",current:V||W||"",onClick:()=>{he(""),me("")}}),Ds.map(t=>e.jsx(xe,{label:`${ue[t]?.icon??""} ${t}`,value:t,current:V,onClick:s=>{he(s),me("")}},t)),["agent","team","skill"].map(t=>e.jsx(xe,{label:`${z[t].icon} ${r(`artifactTypes.${t}`)}`,value:t,current:W,onClick:s=>{me(s),he("")}},t))]}),e.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary",children:r("filters.group")}),["date","project","team","agent"].map(t=>e.jsx("button",{onClick:()=>{yt(t)},className:`px-2 py-1 rounded text-xs transition-colors ${B===t?"bg-brand-600 text-white":"bg-surface-elevated text-fg-secondary hover:bg-surface-overlay"}`,children:r(`groupBy.${t}`)},t)),K.length>1&&e.jsx("button",{onClick:fs,className:"ml-auto px-1.5 py-1 rounded text-[10px] text-fg-tertiary hover:text-fg-secondary hover:bg-surface-elevated transition-colors",title:r(Ut?"expandAllTooltip":"collapseAllTooltip"),children:r(Ut?"expandAll":"collapseAll")})]})]}),Fe&&e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[fe&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:["“",fe,"”",e.jsx("button",{onClick:()=>{Le(""),Re("")},className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),V&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:[ue[V]?.icon," ",V,e.jsx("button",{onClick:()=>he(""),className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),W&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:[z[W]?.icon," ",r(`artifactTypes.${W}`),e.jsx("button",{onClick:()=>me(""),className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),F&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:[r(F==="knowledge"?"filters.sourceKnowledge":"filters.sourceAgent"),e.jsx("button",{onClick:()=>H(""),className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),re&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-brand-500/10 text-brand-500 text-[10px]",children:[we(re)??re,e.jsx("button",{onClick:()=>Ee(""),className:"hover:text-brand-400",children:e.jsxs("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),e.jsx("button",{onClick:Kt,className:"text-[10px] text-fg-tertiary hover:text-brand-500 ml-auto transition-colors",children:r("filters.clearAll")})]})]}),qe&&e.jsx("div",{className:`mx-4 mt-2 px-3 py-1.5 text-xs rounded-lg ${qe.type==="success"?"bg-green-500/15 text-green-600":"bg-red-500/15 text-red-500"}`,children:qe.text}),e.jsxs("div",{ref:Y,className:"flex-1 overflow-y-auto p-2 space-y-1 transition-opacity duration-150",style:{opacity:G?.5:1},onTouchStart:u?t=>{Nt.onTouchStart(t),hs(t)}:void 0,onTouchEnd:u?t=>{Nt.onTouchEnd(t),ms(t)}:void 0,children:[Je&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2 text-brand-500",children:[e.jsx(Zt,{})," ",e.jsx("span",{className:"text-[10px]",children:r("filters.refreshing")})]}),G?e.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(t=>e.jsxs("div",{className:"animate-pulse space-y-2",children:[e.jsx("div",{className:"h-4 bg-surface-elevated rounded w-3/4"}),e.jsx("div",{className:"h-3 bg-surface-elevated rounded w-1/2"})]},t))}):g.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 px-6 text-center",children:[e.jsx("svg",{className:"w-12 h-12 text-fg-muted mb-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})}),Fe?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:r("empty.noResults")}),e.jsx("p",{className:"text-xs text-fg-tertiary mt-1 mb-3",children:r("empty.noResultsHint")}),e.jsx("button",{onClick:Kt,className:"text-xs px-3 py-1.5 rounded-lg bg-brand-600 hover:bg-brand-500 text-white transition-colors",children:r("filters.clearAll")})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:r("empty.title")}),e.jsx("p",{className:"text-xs text-fg-tertiary mt-1 mb-3",children:r("empty.subtitle")}),e.jsx("button",{onClick:()=>ee.navigate(P.WORK),className:"text-xs px-3 py-1.5 rounded-lg bg-brand-600 hover:bg-brand-500 text-white transition-colors",children:r("empty.goToWork")})]})]}):K.map(([t,s])=>{const i=_t(t);return e.jsxs("div",{className:"mb-1",children:[e.jsxs("button",{onClick:()=>xs(t),className:"w-full flex items-center gap-1.5 px-2 py-2 rounded-md hover:bg-surface-elevated/50 transition-colors group/header border-b border-border-subtle/50",children:[e.jsx("svg",{className:`w-3 h-3 text-fg-tertiary transition-transform duration-200 shrink-0 ${i?"":"rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),e.jsx("span",{className:"text-[11px] font-semibold text-fg-tertiary uppercase tracking-wider truncate",children:s.label}),e.jsxs("span",{className:"text-[10px] text-fg-muted bg-surface-elevated px-1.5 py-0.5 rounded-full shrink-0",children:[s.items.length,g.length<w?"+":""]})]}),e.jsx("div",{className:`overflow-hidden transition-all duration-200 ${i?"max-h-0 opacity-0":"max-h-[5000px] opacity-100"}`,children:s.items.map(l=>e.jsx("button",{"data-deliverable-id":l.id,onClick:()=>Yt(l),className:`w-full text-left px-3 py-2 rounded-lg transition-all duration-150 ${n?.id===l.id?ae==="l1"?"bg-brand-500/25 ring-1 ring-inset ring-brand-500/40 border-l-2 border-l-brand-500 border-y border-r border-y-brand-500/20 border-r-brand-500/20":"bg-brand-600/15 border-l-2 border-l-brand-500 border-y border-r border-y-brand-500/20 border-r-brand-500/20":"hover:bg-surface-elevated/60 border-l-2 border-l-transparent border-y border-r border-transparent"}`,children:e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[l.artifactType&&z[l.artifactType]?e.jsx("span",{className:`text-[10px] px-1 py-0.5 rounded font-medium shrink-0 ${z[l.artifactType].color}`,children:z[l.artifactType].icon}):e.jsx("span",{className:`text-[10px] px-1 py-0.5 rounded font-medium uppercase shrink-0 ${ue[l.type]?.color??"bg-surface-overlay text-fg-secondary"}`,children:ue[l.type]?.icon??l.type.charAt(0)}),e.jsx("span",{className:"text-sm font-medium text-fg-primary truncate flex-1",children:l.title}),I(l)==="published"&&e.jsxs("svg",{className:"shrink-0 text-green-500",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":r("share.published",{defaultValue:"已发布到 Hub"}),children:[e.jsx("title",{children:r("share.published",{defaultValue:"已发布到 Hub"})}),e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),I(l)==="pending_review"&&e.jsxs("svg",{className:"shrink-0 text-amber-500 animate-pulse",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":r("share.pendingReview",{defaultValue:"Hub 审核中"}),children:[e.jsx("title",{children:r("share.pendingReview",{defaultValue:"Hub 审核中"})}),e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),I(l)==="rejected"&&e.jsxs("svg",{className:"shrink-0 text-red-500",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":r("share.rejected",{defaultValue:"Hub 已拒绝"}),children:[e.jsx("title",{children:r("share.rejected",{defaultValue:"Hub 已拒绝"})}),e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),Bt.has(l.id)&&e.jsx("span",{className:"shrink-0 text-amber-500",title:r("detail.fileMissing"),children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}),e.jsx("span",{className:"text-[10px] text-fg-muted shrink-0",children:Vs(l.updatedAt,r)})]})},l.id))})]},t)}),m&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-3 text-fg-tertiary",children:[e.jsx(Zt,{})," ",e.jsx("span",{className:"text-[10px]",children:r("common:loadingMore")})]}),!G&&g.length>0&&e.jsx("div",{className:"text-center text-[10px] text-fg-tertiary py-2",children:g.length<w?r("count.partial",{loaded:g.length,total:w}):r("count.total",{total:w})})]})]}),!u&&e.jsx("div",{className:"w-2 shrink-0 cursor-col-resize group relative flex items-center justify-center hover:bg-brand-500/5 transition-colors",onMouseDown:S.onResizeStart,children:e.jsxs("div",{className:"flex flex-col gap-1 items-center opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-fg-muted"}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-fg-muted"}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-fg-muted"})]})}),(!u||N)&&e.jsxs("div",{"data-no-drag":!0,className:"flex-1 overflow-hidden min-w-0 flex relative self-stretch",children:[e.jsxs("div",{ref:dt,className:"flex-1 overflow-y-auto min-w-0 h-full",children:[_&&!u&&e.jsxs("div",{className:"sticky top-0 z-10 bg-surface-primary/80 backdrop-blur-sm px-4 py-2 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{He.current=!0,Q(!1)},className:"w-8 h-8 flex items-center justify-center rounded-lg transition-colors shrink-0 text-fg-tertiary hover:text-fg-secondary hover:bg-surface-elevated",title:r("sidebar.expand"),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]})}),e.jsx("span",{className:"text-sm font-medium text-fg-secondary truncate",children:n?.title??r("detail.details")})]}),u&&e.jsxs("div",{className:"sticky top-0 z-10 bg-surface-secondary px-4 py-2.5 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>history.back(),className:"text-fg-secondary hover:text-fg-primary transition-colors p-1 -ml-1",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})})}),e.jsx("span",{className:"text-sm font-medium truncate",children:n?.title??r("detail.details")})]}),n?e.jsxs("div",{className:`p-6 space-y-4 ${ve?"flex flex-col min-h-0 h-full":""}`,children:[!o&&Bt.has(n.id)&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-amber-500/10 border border-amber-500/20 rounded-lg text-amber-600 text-xs",children:[e.jsxs("svg",{className:"w-4 h-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),e.jsx("span",{children:r("detail.fileMissing")})]}),e.jsxs("div",{className:`space-y-3 ${ve?"shrink-0":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h2",{className:"text-xl font-semibold text-fg-primary",children:n.title}),!o&&e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[Ps(n?.format)&&e.jsxs("button",{onClick:()=>Ze(!0),title:r("share.title",{defaultValue:"分享到 Markus Hub"}),"aria-label":r("share.title",{defaultValue:"分享到 Markus Hub"}),className:`relative p-1.5 rounded-lg transition-colors ${I(n)==="published"?"text-green-500 hover:text-green-400 hover:bg-green-500/10":I(n)==="pending_review"?"text-amber-500 hover:text-amber-400 hover:bg-amber-500/10":"text-fg-tertiary hover:text-fg-secondary hover:bg-surface-elevated"}`,children:[e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),I(n)==="published"||I(n)==="pending_review"||I(n)==="rejected"?e.jsx("span",{className:`absolute top-0.5 right-0.5 w-2 h-2 rounded-full border border-surface-primary ${I(n)==="published"?"bg-green-500":I(n)==="pending_review"?"bg-amber-500 animate-pulse":"bg-red-500"}`,"aria-hidden":!0}):null]}),e.jsx("button",{onClick:()=>Ae(n),disabled:!!jt,className:"p-1.5 rounded-lg text-fg-tertiary hover:text-red-500 hover:bg-red-500/10 transition-colors disabled:opacity-50 shrink-0",title:r("common:remove"),children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:`px-2 py-0.5 rounded text-xs font-medium uppercase ${ue[n.type]?.color??"bg-surface-overlay text-fg-secondary"}`,children:[ue[n.type]?.icon??""," ",n.type]}),n.artifactType&&z[n.artifactType]&&e.jsxs("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${z[n.artifactType].color}`,children:[z[n.artifactType].icon," ",r("detail.builderWithType",{type:r(`artifactTypes.${n.artifactType}`)})]}),n.tags.length>0&&n.tags.map(t=>e.jsx("span",{className:"px-2 py-0.5 text-xs bg-surface-elevated text-fg-secondary rounded",children:t},t)),I(n)==="published"&&e.jsxs("a",{href:n.shareUrl??void 0,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium bg-green-500/15 text-green-600 hover:bg-green-500/25 hover:underline",title:n.shareUrl??void 0,children:[e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"18",cy:"5",r:"3"}),e.jsx("circle",{cx:"6",cy:"12",r:"3"}),e.jsx("circle",{cx:"18",cy:"19",r:"3"}),e.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]}),r("share.published",{defaultValue:"已发布"})]}),I(n)==="pending_review"&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium bg-amber-500/15 text-amber-500",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 animate-pulse"}),r("share.pendingReview",{defaultValue:"审核中"})]}),I(n)==="rejected"&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium bg-red-500/15 text-red-500",title:n.shareReason??void 0,children:[r("share.rejected",{defaultValue:"已拒绝"}),n.shareReason?e.jsxs("span",{className:"text-red-400/90 font-normal",children:["— ",n.shareReason]}):null]})]}),(n.taskId||n.agentId||we(n.projectId))&&e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.taskId&&e.jsx("button",{onClick:()=>ee.navigate(P.WORK,{openTask:n.taskId}),className:"text-xs text-brand-500 hover:underline bg-brand-500/10 px-2 py-0.5 rounded",children:r("links.task",{id:`${n.taskId.slice(0,12)}...`})}),n.agentId&&e.jsx("button",{onClick:()=>ee.navigate(P.TEAM,{selectAgent:n.agentId}),className:"text-xs text-blue-600 hover:underline bg-blue-500/10 px-2 py-0.5 rounded",children:r("links.agent",{name:$e.get(n.agentId)?.name??n.agentId.slice(0,12)})}),we(n.projectId)&&e.jsx("button",{onClick:()=>ee.navigate(P.WORK,{projectId:n.projectId}),className:"text-xs text-blue-600 hover:underline bg-blue-500/10 px-2 py-0.5 rounded",children:r("links.project",{name:we(n.projectId)})})]}),(n.diffStats||n.testResults)&&e.jsxs("div",{className:"flex gap-3 flex-wrap",children:[n.diffStats&&e.jsxs("div",{className:"bg-surface-elevated rounded-lg px-3 py-2 text-xs flex items-center gap-2",children:[e.jsxs("span",{className:"text-fg-tertiary font-medium",children:[r("diffStats.title"),":"]}),e.jsx("span",{className:"text-fg-secondary",children:r("diffStats.files",{count:n.diffStats.filesChanged})}),e.jsxs("span",{className:"text-green-600",children:["+",n.diffStats.additions]}),e.jsxs("span",{className:"text-red-500",children:["-",n.diffStats.deletions]})]}),n.testResults&&e.jsxs("div",{className:"bg-surface-elevated rounded-lg px-3 py-2 text-xs flex items-center gap-2",children:[e.jsxs("span",{className:"text-fg-tertiary font-medium",children:[r("testResults.title"),":"]}),e.jsx("span",{className:"text-green-600",children:r("testResults.passed",{count:n.testResults.passed})}),e.jsx("span",{className:"text-red-500",children:r("testResults.failed",{count:n.testResults.failed})}),e.jsx("span",{className:"text-fg-secondary",children:r("testResults.skipped",{count:n.testResults.skipped})})]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-fg-tertiary flex-wrap",children:[e.jsxs("span",{children:[r("metadata.created")," ",new Date(n.createdAt).toLocaleString()]}),e.jsxs("span",{children:[r("metadata.updated")," ",new Date(n.updatedAt).toLocaleString()]}),e.jsx("span",{className:"text-fg-muted select-all",children:n.id.slice(0,12)})]}),n.reference&&!Oe(n.reference)&&n.type==="file"&&e.jsxs("div",{className:"flex items-center gap-2 bg-surface-elevated rounded-lg px-3 py-2",children:[e.jsx("button",{onClick:()=>{p.files.reveal(n.reference).catch(()=>A("error",r("detail.failedToOpenBrowser")))},className:"text-xs font-mono text-brand-500 hover:text-brand-500 hover:underline truncate flex-1 text-left cursor-pointer",title:r("detail.openInFileBrowser"),children:n.reference}),e.jsx("button",{onClick:()=>{p.files.reveal(n.reference).catch(()=>A("error",r("detail.failedToOpenBrowser")))},className:"px-2 py-1 text-[10px] rounded bg-brand-600/20 text-brand-500 hover:bg-brand-600/30 transition-colors shrink-0",title:r("detail.revealInFinder"),children:r("common:open")}),e.jsx("button",{onClick:()=>Dt(n.reference),className:`px-2 py-1 text-[10px] rounded transition-colors shrink-0 ${Me?"bg-green-500/20 text-green-600":"bg-surface-overlay/50 text-fg-secondary hover:bg-surface-overlay"}`,title:r("detail.copyPath"),children:r(Me?"common:copied":"common:copy")})]}),n.reference&&!Oe(n.reference)&&n.type!=="file"&&n.type!=="directory"&&e.jsx("span",{className:"text-xs text-fg-tertiary font-mono break-all",children:n.reference})]}),n.artifactType&&n.artifactData?e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx($s,{artifact:n.artifactData,mode:n.artifactType})}),n.reference&&e.jsxs("div",{className:"px-3 py-2 bg-surface-elevated rounded-lg",children:[e.jsx("span",{className:"text-[10px] text-fg-tertiary uppercase tracking-wider block mb-1",children:r("detail.artifactDirectory")}),e.jsx("span",{className:"text-xs text-fg-secondary font-mono break-all",children:n.reference})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx("button",{onClick:us,className:"flex-1 px-4 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors",children:r("detail.openInBuilder")})}),n.summary&&e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx(Ue,{content:n.summary,className:"text-fg-secondary text-sm"})})]}):n.reference&&Oe(n.reference)?e.jsxs("div",{className:"space-y-4",children:[n.summary&&e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx(Ue,{content:n.summary,className:"text-fg-secondary text-sm"})}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-10",children:[e.jsxs("svg",{className:"w-10 h-10 text-fg-muted mb-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),e.jsx("polyline",{points:"15 3 21 3 21 9"}),e.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),e.jsx("p",{className:"text-xs text-fg-tertiary font-mono mb-4 px-4 text-center break-all select-all",children:n.reference}),e.jsx("button",{onClick:()=>window.open(n.reference,"_blank","noopener,noreferrer"),className:"px-6 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors",children:r("detail.openUrl")})]})]}):n.type==="directory"&&n.reference?e.jsxs("div",{className:"space-y-4",children:[n.summary&&e.jsx("div",{className:"bg-surface-elevated rounded-xl p-5",children:e.jsx(Ue,{content:n.summary,className:"text-fg-secondary text-sm"})}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-10",children:[e.jsx("svg",{className:"w-10 h-10 text-fg-muted mb-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),e.jsx("p",{className:"text-xs text-fg-tertiary font-mono mb-4 px-4 text-center break-all select-all",children:n.reference}),e.jsx("button",{onClick:()=>{p.files.reveal(n.reference).catch(()=>A("error",r("detail.failedToOpenBrowser")))},className:"px-6 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-sm font-medium rounded-lg transition-colors",children:r("detail.openInFileBrowser")})]})]}):e.jsxs("div",{className:`bg-surface-elevated rounded-xl overflow-hidden ${ve?"flex flex-col h-full":""}`,children:[(Te||n.summary)&&!Rt&&!ge&&!Tt&&n.reference&&n.type==="file"&&(Be==="markdown"||Be==="text"||Be==="html")&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border-subtle bg-surface-secondary/50",children:[e.jsx("button",{onClick:gs,className:`px-3 py-1 rounded text-xs font-medium transition-colors ${ie?"text-fg-tertiary hover:text-fg-secondary":"bg-brand-600/20 text-brand-500"}`,children:r("detail.preview")}),e.jsx("button",{onClick:ps,className:`px-3 py-1 rounded text-xs font-medium transition-colors ${ie?"bg-brand-600/20 text-brand-500":"text-fg-tertiary hover:text-fg-secondary"}`,children:r("detail.edit")}),e.jsx("div",{className:"flex-1"}),ie&&e.jsx("button",{onClick:Qt,disabled:!U||st,className:"px-3 py-1 rounded text-xs font-medium bg-brand-600 hover:bg-brand-500 text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:r(st?"detail.saving":"detail.save")})]}),e.jsx("div",{className:ve?"flex-1 min-h-0 p-5 flex flex-col":"p-5",children:Rt?e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-full"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-5/6"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-4/6"}),e.jsx("div",{className:"h-32 bg-surface-overlay/40 rounded-lg w-full mt-2"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-3/4"}),e.jsx("div",{className:"h-4 bg-surface-overlay/60 rounded w-2/3"})]}):ge?e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("img",{src:ge.src,alt:ge.name,className:"max-w-full max-h-[60vh] rounded-lg object-contain"}),e.jsx("span",{className:"text-xs text-fg-tertiary",children:ge.name})]}):ne?e.jsx("div",{className:ve?"flex-1 min-h-0":"h-[55vh]",children:e.jsx(Bs,{data:ne,reference:ne.reference,onFallback:ne.reference?()=>{p.files.reveal(ne.reference).catch(()=>{})}:void 0})}):be?e.jsxs("div",{className:"flex flex-col gap-3 py-4",children:[be.kind==="audio"?e.jsx("audio",{controls:!0,preload:"metadata",src:be.src,className:"w-full"}):e.jsx("video",{controls:!0,preload:"metadata",src:be.src,className:"w-full max-h-[60vh] rounded-lg bg-black"}),e.jsx("span",{className:"text-xs text-fg-tertiary",children:be.name})]}):Te?ie?e.jsx("div",{className:"animate-fadeIn",children:e.jsx("textarea",{ref:nt,value:ke,onChange:t=>{tt(t.target.value),X(!0)},className:"w-full min-h-[120px] p-3 text-sm font-mono bg-surface-primary border border-border-subtle rounded-lg text-fg-secondary focus:outline-none focus:ring-1 focus:ring-brand-500/50 overflow-hidden",style:{resize:"none"},spellCheck:!1})},"edit"):e.jsx("div",{className:"animate-fadeIn",children:e.jsx(Es,{content:Te,format:Be,className:"text-fg-secondary text-sm",onHtmlSelection:ys,basePath:n?.reference?n.reference.replace(/[/\\][^/\\]+$/,""):void 0})},"preview"):Tt?e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-fg-secondary",children:r("detail.cannotPreview",{type:n.type})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{p.files.reveal(n.reference).catch(()=>A("error",r("detail.failedToOpen")))},className:"text-xs bg-surface-elevated px-3 py-2 rounded text-brand-500 hover:text-brand-500 hover:underline flex-1 truncate text-left cursor-pointer font-mono",title:r("detail.openInFileBrowser"),children:n.reference}),e.jsx("button",{onClick:()=>{p.files.reveal(n.reference).catch(()=>A("error",r("detail.failedToOpen")))},className:"px-3 py-2 text-xs rounded-lg bg-brand-600/20 text-brand-500 hover:bg-brand-600/30 transition-colors shrink-0",children:r("common:open")}),e.jsx("button",{onClick:()=>Dt(n.reference),className:`px-3 py-2 text-xs rounded-lg transition-colors shrink-0 ${Me?"bg-green-500/20 text-green-600":"bg-surface-overlay/50 text-fg-secondary hover:bg-surface-overlay"}`,children:r(Me?"common:copied":"common:copy")})]})]}):n.summary?ie?e.jsx("textarea",{ref:nt,value:ke,onChange:t=>{tt(t.target.value),X(!0)},className:"w-full min-h-[120px] p-3 text-sm font-mono bg-surface-primary border border-border-subtle rounded-lg text-fg-secondary focus:outline-none focus:ring-1 focus:ring-brand-500/50 overflow-hidden",style:{resize:"none"},spellCheck:!1}):e.jsx(Ue,{content:n.summary,className:"text-fg-secondary text-sm"}):e.jsx("p",{className:"text-sm text-fg-tertiary italic",children:r("detail.noContent")})})]})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center text-fg-tertiary space-y-3 max-w-xs",children:[e.jsx("div",{className:"w-16 h-16 mx-auto rounded-2xl bg-surface-elevated/60 flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-fg-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}),e.jsx("p",{className:"text-sm text-fg-secondary",children:r("detail.selectToView")}),!u&&e.jsx("p",{className:"text-[10px] text-fg-muted",children:r("detail.keyboardHint")})]})})]}),n?.agentId&&!u&&e.jsx("button",{type:"button",onClick:()=>ut(),className:"absolute bottom-6 right-6 z-20 w-12 h-12 rounded-full bg-brand-600 hover:bg-brand-500 text-white shadow-lg shadow-black/20 flex items-center justify-center transition-transform hover:scale-105 animate-fab-in",title:r("chat.openChat",{defaultValue:"Open in Team Chat"}),children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})})]}),je&&e.jsx("div",{id:"selection-toolbar",className:"fixed z-50 -translate-x-1/2 -translate-y-full bg-surface-elevated border border-border-default rounded-lg shadow-xl overflow-hidden",style:{left:je.x,top:je.y-8},children:e.jsxs("button",{onMouseDown:t=>{t.preventDefault(),t.stopPropagation(),ut(je.text,je.htmlMeta)},className:"px-3 py-1.5 text-xs text-fg-secondary hover:bg-surface-overlay hover:text-fg-primary transition-colors flex items-center gap-1.5 whitespace-nowrap",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),r("contextMenu.addToConversation")]})}),ls&&n&&e.jsx(Ms,{item:n,onClose:()=>Ze(!1),onShared:ds}),ts&&e.jsx(Ws,{projects:ze,onClose:()=>Ge(!1),onBound:()=>{Ge(!1),H("knowledge"),O()}}),Xe&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>Ae(null),children:e.jsxs("div",{className:"bg-surface-secondary border border-border-default rounded-xl p-6 max-w-sm mx-4 shadow-2xl",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{className:"w-5 h-5 text-red-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary",children:r("detail.confirmRemoveTitle")}),e.jsx("div",{className:"text-xs text-fg-secondary mt-0.5",children:r("detail.confirmRemoveMessage",{name:Xe.title})})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>Ae(null),className:"px-4 py-1.5 text-xs text-fg-secondary hover:text-fg-primary border border-border-default hover:border-gray-600 rounded-lg transition-colors",children:r("common:cancel")}),e.jsx("button",{onClick:()=>{const t=Xe;Ae(null),cs(t)},disabled:!!jt,className:"px-4 py-1.5 text-xs bg-red-600 hover:bg-red-500 text-white rounded-lg transition-colors disabled:opacity-50",children:r("common:remove")})]})]})}),rt&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>Z(null),children:e.jsxs("div",{className:"bg-surface-secondary border border-border-default rounded-xl p-6 max-w-sm mx-4 shadow-2xl",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-500/15 flex items-center justify-center shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-amber-500",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary",children:r("detail.unsavedTitle")}),e.jsx("div",{className:"text-xs text-fg-secondary mt-0.5",children:r("detail.unsavedMessage")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>Z(null),className:"px-4 py-1.5 text-xs text-fg-secondary hover:text-fg-primary border border-border-default hover:border-gray-600 rounded-lg transition-colors",children:r("common:cancel")}),e.jsx("button",{onClick:()=>{bs(),rt.action()},className:"px-4 py-1.5 text-xs text-fg-secondary hover:text-fg-primary border border-border-default hover:border-gray-600 rounded-lg transition-colors",children:r("detail.discard")}),e.jsx("button",{onClick:async()=>{await Qt(),rt.action(),Z(null)},className:"px-4 py-1.5 text-xs bg-brand-600 hover:bg-brand-500 text-white rounded-lg transition-colors",children:r("detail.saveAndLeave")})]})]})})]})}function Ws({projects:d,onClose:o,onBound:c}){const{t:r}=Ke("deliverables"),[u,v]=a.useState(""),[S,N]=a.useState(""),[j,E]=a.useState(!1),[k,L]=a.useState(""),g=d.find(m=>m.id===u),R=typeof window<"u"&&!!window.markusDesktop?.selectDirectory,w=async()=>{try{const m=await window.markusDesktop?.selectDirectory?.(r("bindBrowseTitle",{defaultValue:"Select knowledge base directory"}));m&&N(m)}catch(m){L(String(m))}},D=async()=>{if(!(!u||!S.trim()||j)){E(!0),L("");try{const m=S.trim(),se=[...new Set([...g?.knowledgeBasePaths??[],m])];await p.projects.update(u,{knowledgeBasePaths:se}),await p.projects.syncKnowledge(u),c()}catch(m){L(String(m))}finally{E(!1)}}};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>{j||o()},children:e.jsxs("div",{className:"bg-surface-secondary border border-border-default rounded-xl p-6 max-w-md w-full mx-4 shadow-2xl",onClick:m=>m.stopPropagation(),children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary mb-1",children:r("bindKnowledgeBase")}),e.jsx("p",{className:"text-xs text-fg-secondary mb-4",children:r("bindKnowledgeBaseHint")}),e.jsx("label",{className:"block text-[10px] text-fg-tertiary mb-1",children:r("bindProject")}),e.jsxs("select",{value:u,onChange:m=>v(m.target.value),className:"w-full mb-3 px-2.5 py-2 text-xs bg-surface-primary border border-border-default rounded-lg text-fg-primary",children:[e.jsx("option",{value:"",children:r("bindProjectSelect")}),d.map(m=>e.jsx("option",{value:m.id,children:m.name},m.id))]}),e.jsx("label",{className:"block text-[10px] text-fg-tertiary mb-1",children:r("bindPath")}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx("input",{value:S,onChange:m=>N(m.target.value),onKeyDown:m=>{m.key==="Enter"&&D()},placeholder:r("bindPathPlaceholder"),className:"flex-1 min-w-0 px-2.5 py-2 text-xs bg-surface-primary border border-border-default rounded-lg text-fg-primary placeholder:text-fg-tertiary font-mono"}),R&&e.jsx("button",{type:"button",onClick:()=>{w()},disabled:j,title:r("bindBrowse",{defaultValue:"Browse…"}),className:"shrink-0 px-3 py-2 text-xs bg-surface-overlay text-fg-secondary hover:text-fg-primary rounded-lg disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:r("bindBrowse",{defaultValue:"Browse…"})})]}),g&&(g.knowledgeBasePaths??[]).length>0&&e.jsxs("div",{className:"mb-3 space-y-1",children:[e.jsx("div",{className:"text-[10px] text-fg-tertiary",children:r("bindCurrentPaths")}),(g.knowledgeBasePaths??[]).map((m,se)=>e.jsxs("div",{className:"text-[11px] text-fg-secondary font-mono truncate",title:m,children:["• ",m]},`${m}-${se}`))]}),k&&e.jsx("div",{className:"mb-3 px-2.5 py-1.5 text-[11px] rounded-md bg-red-500/15 text-red-500",children:k}),e.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[e.jsx("button",{onClick:o,disabled:j,className:"px-3 py-1.5 text-xs text-fg-tertiary hover:text-fg-secondary rounded-lg transition-colors",children:r("common:cancel",{defaultValue:"Cancel"})}),e.jsx("button",{onClick:()=>{D()},disabled:j||!u||!S.trim(),className:"px-3 py-1.5 text-xs bg-brand-600 text-white rounded-lg hover:bg-brand-500 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:j?r("bindSaving",{defaultValue:"Saving…"}):r("bindSave",{defaultValue:"Bind directory"})})]})]})})}function xe({label:d,value:o,current:c,onClick:r}){return e.jsx("button",{onClick:()=>r(c===o?"":o),className:`px-2 py-1 rounded text-xs whitespace-nowrap shrink-0 transition-colors ${c===o?"bg-brand-600 text-white":"bg-surface-elevated text-fg-secondary hover:bg-surface-overlay"}`,children:d})}function Zt(){return e.jsxs("svg",{className:"animate-spin h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}export{Us as DeliverablesPage};
@@ -1 +1 @@
1
- import{u as o,a as l,j as e,M as t,N as n}from"./index-C-JeUF8o.js";function r({authUser:s}){const{t:a}=o("nav"),i=l();return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("div",{"data-electron-drag":!0,className:"flex items-center gap-2 px-4 h-14",children:[i&&e.jsx(t,{}),e.jsx("h2",{className:"text-base font-bold",children:a("notifications")})]}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(n,{collapsed:!1,userId:s?.id,embeddedMode:!0})})]})}export{r as NotificationsPage};
1
+ import{u as o,a as l,j as e,M as t,N as n}from"./index-ByDm2R2Q.js";function r({authUser:s}){const{t:a}=o("nav"),i=l();return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("div",{"data-electron-drag":!0,className:"flex items-center gap-2 px-4 h-14",children:[i&&e.jsx(t,{}),e.jsx("h2",{className:"text-base font-bold",children:a("notifications")})]}),e.jsx("div",{className:"flex-1 overflow-hidden",children:e.jsx(n,{collapsed:!1,userId:s?.id,embeddedMode:!0})})]})}export{r as NotificationsPage};
@@ -1 +1 @@
1
- import{u as I,r as i,l as c,j as e,n as d,P as x,A as O}from"./index-C-JeUF8o.js";function D(){const{t:l}=I(["common","home","work"]),[u,y]=i.useState(""),[r,o]=i.useState("all"),[t,m]=i.useState({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),[h,b]=i.useState(!1),[w,p]=i.useState(!1),v=i.useRef(null),j=i.useRef(void 0);i.useEffect(()=>{setTimeout(()=>v.current?.focus(),100)},[]);const W=i.useCallback(async s=>{if(!s.trim()){m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),p(!1);return}b(!0),p(!0);const n=s.toLowerCase();try{const[N,C,V,R,L,A]=await Promise.allSettled([c.agents.list(),c.tasks.list({search:s,pageSize:20}),c.requirements.list(),c.projects.list(),c.deliverables.search({q:s,limit:20}),c.teams.list()]),E=N.status==="fulfilled"?N.value.agents.filter(a=>a.name?.toLowerCase().includes(n)||a.role?.toLowerCase().includes(n)):[],M=C.status==="fulfilled"?C.value.tasks:[],H=V.status==="fulfilled"?V.value.requirements.filter(a=>a.title?.toLowerCase().includes(n)||a.description?.toLowerCase().includes(n)):[],T=R.status==="fulfilled"?R.value.projects.filter(a=>a.name?.toLowerCase().includes(n)||a.description?.toLowerCase().includes(n)):[],z=L.status==="fulfilled"?L.value.results:[],S=[];if(A.status==="fulfilled"){const a=await Promise.allSettled(A.value.teams.map(f=>c.workflows.list(f.id)));for(const f of a)if(f.status==="fulfilled")for(const g of f.value.workflows)(g.name.toLowerCase().includes(n)||(g.displayName||"").toLowerCase().includes(n)||g.description?.toLowerCase().includes(n))&&S.push(g)}m({agents:E,tasks:M,requirements:H,projects:T,deliverables:z,workflows:S})}catch{m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]})}finally{b(!1)}},[]),B=s=>{y(s),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>W(s),400)},q=[{id:"all",label:l("common:all",{defaultValue:"全部"})},{id:"agents",label:l("common:agents",{defaultValue:"智能体"})},{id:"tasks",label:l("common:tasks",{defaultValue:"任务"})},{id:"requirements",label:l("common:requirements",{defaultValue:"需求"})},{id:"projects",label:l("common:projects",{defaultValue:"项目"})},{id:"deliverables",label:l("common:deliverables",{defaultValue:"交付物"})},{id:"workflows",label:l("common:workflows",{defaultValue:"工作流"})}],k=t.agents.length>0||t.tasks.length>0||t.requirements.length>0||t.projects.length>0||t.deliverables.length>0||t.workflows.length>0;return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 px-4 pt-4 pb-2 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>d.navigate(x.HOME),className:"p-1.5 rounded-lg hover:bg-surface-overlay transition-colors shrink-0",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 12H5"}),e.jsx("polyline",{points:"12 19 5 12 12 5"})]})}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-fg-tertiary",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{ref:v,value:u,onChange:s=>B(s.target.value),placeholder:l("common:search"),className:"w-full bg-surface-elevated border border-border-default rounded-xl pl-9 pr-3 py-2.5 text-sm text-fg-primary placeholder:text-fg-tertiary focus:border-brand-500 focus:outline-none transition-colors"}),u&&e.jsx("button",{onClick:()=>{y(""),m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),p(!1),v.current?.focus()},className:"absolute right-3 top-1/2 -translate-y-1/2 text-fg-tertiary hover:text-fg-secondary",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsx("div",{className:"flex gap-1 overflow-x-auto scrollbar-hide",children:q.map(s=>e.jsx("button",{onClick:()=>o(s.id),className:`px-3 py-1.5 text-xs rounded-lg whitespace-nowrap transition-colors ${r===s.id?"bg-brand-600 text-white":"bg-surface-elevated text-fg-secondary hover:text-fg-primary"}`,children:s.label},s.id))})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:[h&&e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"text-fg-tertiary text-sm animate-pulse",children:l("common:loading")})}),!h&&w&&!k&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-fg-tertiary mb-3",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("p",{className:"text-sm text-fg-tertiary",children:l("common:noResults",{defaultValue:"没有找到相关结果"})})]}),!h&&k&&e.jsxs("div",{className:"space-y-4",children:[(r==="all"||r==="agents")&&t.agents.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:agents",{defaultValue:"智能体"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.agents.slice(0,8):t.agents).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.TEAM,{agentId:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx(O,{name:s.name||"Agent",avatarUrl:s.avatarUrl,size:32}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary truncate",children:s.name}),e.jsx("div",{className:"text-xs text-fg-tertiary truncate",children:s.role||s.status})]}),e.jsx(P,{status:s.status})]},s.id))}),r==="all"&&t.agents.length>8&&e.jsxs("button",{onClick:()=>o("agents"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.agents.length,")"]})]}),(r==="all"||r==="tasks")&&t.tasks.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:tasks",{defaultValue:"任务"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.tasks.slice(0,8):t.tasks).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{openTask:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx(K,{status:s.status}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.status," · ",s.priority||""]})]})]},s.id))}),r==="all"&&t.tasks.length>8&&e.jsxs("button",{onClick:()=>o("tasks"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.tasks.length,")"]})]}),(r==="all"||r==="requirements")&&t.requirements.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:requirements",{defaultValue:"需求"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.requirements.slice(0,8):t.requirements).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{openRequirement:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${s.status==="approved"?"text-green-500 bg-green-500/15":s.status==="pending"?"text-amber-500 bg-amber-500/15":s.status==="rejected"?"text-red-500 bg-red-500/15":"text-fg-tertiary bg-surface-elevated"}`,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.status," · ",s.priority||""]})]})]},s.id))}),r==="all"&&t.requirements.length>8&&e.jsxs("button",{onClick:()=>o("requirements"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.requirements.length,")"]})]}),(r==="all"||r==="projects")&&t.projects.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:projects",{defaultValue:"项目"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.projects.slice(0,8):t.projects).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{projectId:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-brand-500/15 flex items-center justify-center shrink-0",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-brand-500",children:e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.name}),s.description&&e.jsx("div",{className:"text-xs text-fg-tertiary truncate",children:s.description})]})]},s.id))}),r==="all"&&t.projects.length>8&&e.jsxs("button",{onClick:()=>o("projects"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.projects.length,")"]})]}),(r==="all"||r==="deliverables")&&t.deliverables.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:deliverables",{defaultValue:"交付物"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.deliverables.slice(0,8):t.deliverables).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.DELIVERABLES,{openDeliverable:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-purple-500",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.type," · ",s.status]})]})]},s.id))}),r==="all"&&t.deliverables.length>8&&e.jsxs("button",{onClick:()=>o("deliverables"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.deliverables.length,")"]})]}),(r==="all"||r==="workflows")&&t.workflows.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:workflows",{defaultValue:"工作流"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.workflows.slice(0,8):t.workflows).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{boardType:"workflows"}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-teal-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-teal-500",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.displayName||s.name}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.stepCount," steps · v",s.version]})]})]},s.name))}),r==="all"&&t.workflows.length>8&&e.jsxs("button",{onClick:()=>o("workflows"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.workflows.length,")"]})]})]}),!h&&!w&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-fg-tertiary mb-3",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("p",{className:"text-sm text-fg-tertiary",children:l("common:search")})]})]})]})}function P({status:l}){const u=l==="active"||l==="idle"?"bg-green-500":l==="working"||l==="busy"?"bg-blue-500":"bg-gray-400";return e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${u}`})}function K({status:l}){const u=l==="completed"?"text-green-500 bg-green-500/15":l==="in_progress"?"text-blue-500 bg-blue-500/15":l==="pending"?"text-amber-500 bg-amber-500/15":"text-fg-tertiary bg-surface-elevated";return e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${u}`,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M9 11l3 3L22 4"}),e.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})})}export{D as SearchPage};
1
+ import{u as I,r as i,l as c,j as e,n as d,P as x,A as O}from"./index-ByDm2R2Q.js";function D(){const{t:l}=I(["common","home","work"]),[u,y]=i.useState(""),[r,o]=i.useState("all"),[t,m]=i.useState({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),[h,b]=i.useState(!1),[w,p]=i.useState(!1),v=i.useRef(null),j=i.useRef(void 0);i.useEffect(()=>{setTimeout(()=>v.current?.focus(),100)},[]);const W=i.useCallback(async s=>{if(!s.trim()){m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),p(!1);return}b(!0),p(!0);const n=s.toLowerCase();try{const[N,C,V,R,L,A]=await Promise.allSettled([c.agents.list(),c.tasks.list({search:s,pageSize:20}),c.requirements.list(),c.projects.list(),c.deliverables.search({q:s,limit:20}),c.teams.list()]),E=N.status==="fulfilled"?N.value.agents.filter(a=>a.name?.toLowerCase().includes(n)||a.role?.toLowerCase().includes(n)):[],M=C.status==="fulfilled"?C.value.tasks:[],H=V.status==="fulfilled"?V.value.requirements.filter(a=>a.title?.toLowerCase().includes(n)||a.description?.toLowerCase().includes(n)):[],T=R.status==="fulfilled"?R.value.projects.filter(a=>a.name?.toLowerCase().includes(n)||a.description?.toLowerCase().includes(n)):[],z=L.status==="fulfilled"?L.value.results:[],S=[];if(A.status==="fulfilled"){const a=await Promise.allSettled(A.value.teams.map(f=>c.workflows.list(f.id)));for(const f of a)if(f.status==="fulfilled")for(const g of f.value.workflows)(g.name.toLowerCase().includes(n)||(g.displayName||"").toLowerCase().includes(n)||g.description?.toLowerCase().includes(n))&&S.push(g)}m({agents:E,tasks:M,requirements:H,projects:T,deliverables:z,workflows:S})}catch{m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]})}finally{b(!1)}},[]),B=s=>{y(s),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>W(s),400)},q=[{id:"all",label:l("common:all",{defaultValue:"全部"})},{id:"agents",label:l("common:agents",{defaultValue:"智能体"})},{id:"tasks",label:l("common:tasks",{defaultValue:"任务"})},{id:"requirements",label:l("common:requirements",{defaultValue:"需求"})},{id:"projects",label:l("common:projects",{defaultValue:"项目"})},{id:"deliverables",label:l("common:deliverables",{defaultValue:"交付物"})},{id:"workflows",label:l("common:workflows",{defaultValue:"工作流"})}],k=t.agents.length>0||t.tasks.length>0||t.requirements.length>0||t.projects.length>0||t.deliverables.length>0||t.workflows.length>0;return e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 px-4 pt-4 pb-2 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>d.navigate(x.HOME),className:"p-1.5 rounded-lg hover:bg-surface-overlay transition-colors shrink-0",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M19 12H5"}),e.jsx("polyline",{points:"12 19 5 12 12 5"})]})}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsxs("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-fg-tertiary",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("input",{ref:v,value:u,onChange:s=>B(s.target.value),placeholder:l("common:search"),className:"w-full bg-surface-elevated border border-border-default rounded-xl pl-9 pr-3 py-2.5 text-sm text-fg-primary placeholder:text-fg-tertiary focus:border-brand-500 focus:outline-none transition-colors"}),u&&e.jsx("button",{onClick:()=>{y(""),m({agents:[],tasks:[],requirements:[],projects:[],deliverables:[],workflows:[]}),p(!1),v.current?.focus()},className:"absolute right-3 top-1/2 -translate-y-1/2 text-fg-tertiary hover:text-fg-secondary",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsx("div",{className:"flex gap-1 overflow-x-auto scrollbar-hide",children:q.map(s=>e.jsx("button",{onClick:()=>o(s.id),className:`px-3 py-1.5 text-xs rounded-lg whitespace-nowrap transition-colors ${r===s.id?"bg-brand-600 text-white":"bg-surface-elevated text-fg-secondary hover:text-fg-primary"}`,children:s.label},s.id))})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:[h&&e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"text-fg-tertiary text-sm animate-pulse",children:l("common:loading")})}),!h&&w&&!k&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-fg-tertiary mb-3",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("p",{className:"text-sm text-fg-tertiary",children:l("common:noResults",{defaultValue:"没有找到相关结果"})})]}),!h&&k&&e.jsxs("div",{className:"space-y-4",children:[(r==="all"||r==="agents")&&t.agents.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:agents",{defaultValue:"智能体"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.agents.slice(0,8):t.agents).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.TEAM,{agentId:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx(O,{name:s.name||"Agent",avatarUrl:s.avatarUrl,size:32}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary truncate",children:s.name}),e.jsx("div",{className:"text-xs text-fg-tertiary truncate",children:s.role||s.status})]}),e.jsx(P,{status:s.status})]},s.id))}),r==="all"&&t.agents.length>8&&e.jsxs("button",{onClick:()=>o("agents"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.agents.length,")"]})]}),(r==="all"||r==="tasks")&&t.tasks.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:tasks",{defaultValue:"任务"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.tasks.slice(0,8):t.tasks).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{openTask:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx(K,{status:s.status}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.status," · ",s.priority||""]})]})]},s.id))}),r==="all"&&t.tasks.length>8&&e.jsxs("button",{onClick:()=>o("tasks"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.tasks.length,")"]})]}),(r==="all"||r==="requirements")&&t.requirements.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:requirements",{defaultValue:"需求"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.requirements.slice(0,8):t.requirements).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{openRequirement:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${s.status==="approved"?"text-green-500 bg-green-500/15":s.status==="pending"?"text-amber-500 bg-amber-500/15":s.status==="rejected"?"text-red-500 bg-red-500/15":"text-fg-tertiary bg-surface-elevated"}`,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.status," · ",s.priority||""]})]})]},s.id))}),r==="all"&&t.requirements.length>8&&e.jsxs("button",{onClick:()=>o("requirements"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.requirements.length,")"]})]}),(r==="all"||r==="projects")&&t.projects.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:projects",{defaultValue:"项目"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.projects.slice(0,8):t.projects).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{projectId:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-brand-500/15 flex items-center justify-center shrink-0",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-brand-500",children:e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.name}),s.description&&e.jsx("div",{className:"text-xs text-fg-tertiary truncate",children:s.description})]})]},s.id))}),r==="all"&&t.projects.length>8&&e.jsxs("button",{onClick:()=>o("projects"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.projects.length,")"]})]}),(r==="all"||r==="deliverables")&&t.deliverables.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:deliverables",{defaultValue:"交付物"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.deliverables.slice(0,8):t.deliverables).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.DELIVERABLES,{openDeliverable:s.id}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-purple-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-purple-500",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.title}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.type," · ",s.status]})]})]},s.id))}),r==="all"&&t.deliverables.length>8&&e.jsxs("button",{onClick:()=>o("deliverables"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.deliverables.length,")"]})]}),(r==="all"||r==="workflows")&&t.workflows.length>0&&e.jsxs("section",{children:[e.jsx("h3",{className:"text-xs font-medium text-fg-tertiary uppercase mb-2",children:l("common:workflows",{defaultValue:"工作流"})}),e.jsx("div",{className:"space-y-1",children:(r==="all"?t.workflows.slice(0,8):t.workflows).map(s=>e.jsxs("button",{onClick:()=>d.navigate(x.WORK,{boardType:"workflows"}),className:"w-full flex items-center gap-3 px-3 py-2.5 rounded-xl hover:bg-surface-overlay transition-colors text-left",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-teal-500/15 flex items-center justify-center shrink-0",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-teal-500",children:[e.jsx("circle",{cx:"12",cy:"12",r:"3"}),e.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-fg-primary truncate",children:s.displayName||s.name}),e.jsxs("div",{className:"text-xs text-fg-tertiary truncate",children:[s.stepCount," steps · v",s.version]})]})]},s.name))}),r==="all"&&t.workflows.length>8&&e.jsxs("button",{onClick:()=>o("workflows"),className:"mt-1 w-full text-xs text-brand-500 hover:text-brand-400 py-1.5 rounded-lg hover:bg-surface-overlay transition-colors",children:[l("common:showAll",{defaultValue:"查看全部"})," (",t.workflows.length,")"]})]})]}),!h&&!w&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"text-fg-tertiary mb-3",children:[e.jsx("circle",{cx:"11",cy:"11",r:"8"}),e.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),e.jsx("p",{className:"text-sm text-fg-tertiary",children:l("common:search")})]})]})]})}function P({status:l}){const u=l==="active"||l==="idle"?"bg-green-500":l==="working"||l==="busy"?"bg-blue-500":"bg-gray-400";return e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${u}`})}function K({status:l}){const u=l==="completed"?"text-green-500 bg-green-500/15":l==="in_progress"?"text-blue-500 bg-blue-500/15":l==="pending"?"text-amber-500 bg-amber-500/15":"text-fg-tertiary bg-surface-elevated";return e.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${u}`,children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("path",{d:"M9 11l3 3L22 4"}),e.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})})}export{D as SearchPage};