import{i as e}from"./chunk-B3pr0VN8.js";import{n as t,t as n}from"./jsx-runtime-wTfS3W87.js";import{r}from"./norm-CeclA1Tu.js";import{t as i}from"./ThinkingPanel-DWgqEvqz.js";import{t as a}from"./MarkdownText-PFZ-Hr7C.js";var o=e(t(),1),s=n(),c=e=>{let t=String(e||``).split(`
`).map(e=>r(e).replace(/^[-*#>\s]+/,``).replace(/\*\*/g,``)).filter(Boolean)[0]||``;return t?t.length<=64?t:`${t.slice(0,64)}…`:``};function l({assistantLabel:e,busy:t,streamText:n,streamThinking:l,streamStage:u,streamActor:d,stageText:f,agentMode:p=!1,agentText:m,agentSteps:h=[],stepLabels:g,emptyText:_=`正在等待可读输出…`,fullWidth:v=!1}){let y=r(p&&m||n),b=r(l),x=r(f)||[r(u),r(d)].filter(Boolean).join(` · `),S=p&&h.length>0,C=!!(t||y||b||S),w=!!y||!t,T=(0,o.useMemo)(()=>h.map((e,t)=>({key:`${e.tool}_${t}`,label:r(g?.[e.tool])||r(e.tool)||`步骤 ${t+1}`,status:e.status})),[h,g]);return C?(0,s.jsx)(`div`,{style:{display:`flex`,justifyContent:`flex-start`,margin:`8px 0 12px`},children:(0,s.jsxs)(`div`,{style:{maxWidth:v?`100%`:`88%`,width:`100%`,padding:`12px 14px`,borderRadius:18,border:`1px solid rgba(148,163,184,0.24)`,background:`color-mix(in srgb, var(--surface) 98%, transparent)`,boxShadow:`0 10px 26px rgba(15,23,42,0.05)`},children:[(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:12,flexWrap:`wrap`},children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`div`,{style:{fontSize:12,fontWeight:700,color:`var(--text-1)`},children:e}),x?(0,s.jsx)(`div`,{className:`he-muted`,style:{marginTop:4,fontSize:11},children:x}):null]}),t?(0,s.jsx)(`span`,{className:`he-chip`,style:{background:`rgba(59,130,246,0.08)`,borderColor:`rgba(59,130,246,0.2)`,color:`var(--accent)`,animation:`pulse 2s infinite`},children:`处理中`}):null]}),T.length?(0,s.jsx)(`div`,{style:{marginTop:10,paddingLeft:4},children:T.map((e,t)=>(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:t<T.length-1?2:0},children:[(0,s.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,minWidth:16},children:[(0,s.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:e.status===`done`?`rgba(34,197,94,0.7)`:`rgba(244,136,53,0.7)`,marginTop:7}}),t<T.length-1?(0,s.jsx)(`div`,{style:{width:1,height:14,background:e.status===`done`?`rgba(34,197,94,0.3)`:`rgba(148,163,184,0.2)`,marginTop:2}}):null]}),(0,s.jsxs)(`div`,{style:{flex:1,minHeight:20,display:`flex`,alignItems:`center`,gap:6},children:[(0,s.jsx)(`span`,{style:{fontSize:12,fontWeight:500,color:e.status===`done`?`var(--success)`:`var(--accent)`},children:e.label}),(0,s.jsx)(`span`,{style:{fontSize:10,color:e.status===`done`?`rgba(34,197,94,0.7)`:`rgba(59,130,246,0.6)`},children:e.status===`done`?`✓`:`●`})]})]},e.key))}):null,b?(0,s.jsx)(`div`,{style:{marginTop:10},children:(0,s.jsx)(i,{thinking:b,title:`思考过程`,stageText:x,defaultCollapsed:w,maxHeight:180,fontSize:11,lineHeight:1.4,embedded:!0,collapsedPreview:c(b)})}):null,y?(0,s.jsx)(`div`,{style:{marginTop:10,fontSize:13},children:(0,s.jsx)(a,{text:y,style:{lineHeight:1.75}})}):(0,s.jsx)(`div`,{className:`he-muted`,style:{marginTop:10,fontSize:12,lineHeight:1.7},children:_})]})}):null}export{l as t};