\n
\n '.concat(t,"\n
\n ").concat(n.map(e=>'\n
\n
\n \n ').concat(e.name||a,'\n
\n
').concat("number"==typeof e.value?e.value.toLocaleString():e.value,"\n
\n ")).join(""),'\n
\n Click for details • Scroll to zoom\n
\n
\n ')}}}),L=e=>{let t=[{type:"element-active"},{type:"element-highlight"}];return!1!==e.enableZoom&&t.push({type:"view-zoom"},{type:"element-single-selected",cfg:{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]}}),e.enableBrush&&t.push({type:"brush-x",cfg:{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}]}}),{interactions:t}},D=(e,t)=>e.onDataPointClick?{onReady:n=>{t.current=n,n.on("element:click",t=>{var n;let{data:a}=t;null===(n=e.onDataPointClick)||void 0===n||n.call(e,null==a?void 0:a.data,t)})}}:{},P=e=>{let{onZoomIn:t,onZoomOut:n,onReset:a,onToggleFullscreen:r,isFullscreen:o,showZoom:s=!0,showFullscreen:m=!0}=e;return(0,i.jsxs)("div",{className:"chart-toolbar flex items-center gap-1 absolute top-2 right-2 z-10 bg-white/90 dark:bg-gray-800/90 backdrop-blur-sm rounded-lg px-1.5 py-1 shadow-sm border border-gray-200 dark:border-gray-700",children:[s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(k.Z,{title:"Zoom In",children:(0,i.jsx)(v.ZP,{type:"text",size:"small",icon:(0,i.jsx)(l.Z,{}),onClick:t,className:"!w-7 !h-7 !p-0"})}),(0,i.jsx)(k.Z,{title:"Zoom Out",children:(0,i.jsx)(v.ZP,{type:"text",size:"small",icon:(0,i.jsx)(c.Z,{}),onClick:n,className:"!w-7 !h-7 !p-0"})}),(0,i.jsx)(k.Z,{title:"Reset View",children:(0,i.jsx)(v.ZP,{type:"text",size:"small",icon:(0,i.jsx)(d.Z,{}),onClick:a,className:"!w-7 !h-7 !p-0"})})]}),m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"w-px h-4 bg-gray-200 dark:bg-gray-700 mx-0.5"}),(0,i.jsx)(k.Z,{title:o?"Exit Fullscreen":"Fullscreen",children:(0,i.jsx)(v.ZP,{type:"text",size:"small",icon:o?(0,i.jsx)(u.Z,{}):(0,i.jsx)(p.Z,{}),onClick:r,className:"!w-7 !h-7 !p-0"})})]})]})},M=e=>{var t;let{config:n,chartRef:a}=e,r=(0,h.useMemo)(()=>{var e;return{data:n.data,xField:n.xField||"x",yField:n.yField||"y",seriesField:n.seriesField,smooth:null===(t=n.smooth)||void 0===t||t,...I(n),...w(n.showGrid),...R(n.showLegend),...O(n),...L(n),...D(n,a),point:{size:3,shape:"circle",style:{fill:"#ffffff",stroke:(null===(e=n.colors)||void 0===e?void 0:e[0])||N[0],lineWidth:2,cursor:"pointer"}},lineStyle:{lineWidth:2.5},color:n.colors||N,slider:!1!==n.enableZoom?{start:0,end:1}:void 0}},[n,a]);return(0,i.jsx)(m.Z,{...r,height:n.height||300})},F=e=>{let{config:t,chartRef:n}=e,a=(0,h.useMemo)(()=>({data:t.data,xField:t.xField||"x",yField:t.yField||"y",seriesField:t.seriesField,...I(t),...w(t.showGrid),...R(t.showLegend),...O(t),...L(t),...D(t,n),columnWidthRatio:.6,columnStyle:{radius:[4,4,0,0],cursor:"pointer"},color:t.colors||N,label:{position:"top",style:{fill:"#6b7280",fontSize:10}},scrollbar:t.data.length>12?{type:"horizontal"}:void 0}),[t,n]);return(0,i.jsx)(g.Z,{...a,height:t.height||300})},U=e=>{let{config:t,chartRef:n}=e,a=(0,h.useMemo)(()=>({data:t.data,xField:t.yField||"y",yField:t.xField||"x",seriesField:t.seriesField,...I(t),...w(t.showGrid),...R(t.showLegend),...O(t),...L(t),...D(t,n),barWidthRatio:.6,barStyle:{radius:[0,4,4,0],cursor:"pointer"},color:t.colors||N,label:{position:"right",style:{fill:"#6b7280",fontSize:10}},scrollbar:t.data.length>10?{type:"vertical"}:void 0}),[t,n]);return(0,i.jsx)(E,{...a,height:t.height||300})},B=e=>{let{config:t,chartRef:n}=e,a="donut"===t.chartType,r=(0,h.useMemo)(()=>({data:t.data,angleField:t.angleField||t.yField||"value",colorField:t.colorField||t.xField||"type",...I(t),...R(t.showLegend),...O(t),...D(t,n),radius:.9,innerRadius:a?.6:0,color:t.colors||N,label:{type:"outer",content:"{name}: {percentage}",style:{fill:"#6b7280",fontSize:11}},pieStyle:{lineWidth:2,stroke:"#ffffff",cursor:"pointer"},statistic:a?{title:{style:{fontSize:"14px",color:"#6b7280"},content:"Total"},content:{style:{fontSize:"24px",fontWeight:"600",color:"#111827"}}}:void 0,interactions:[{type:"element-active"},{type:"element-selected"},{type:"pie-legend-active"},{type:"pie-statistic-active"}]}),[t,a,n]);return(0,i.jsx)(y.Z,{...r,height:t.height||300})},j=e=>{var t;let{config:n,chartRef:a}=e,r=(0,h.useMemo)(()=>({data:n.data,xField:n.xField||"x",yField:n.yField||"y",seriesField:n.seriesField,smooth:null===(t=n.smooth)||void 0===t||t,...I(n),...w(n.showGrid),...R(n.showLegend),...O(n),...L(n),...D(n,a),areaStyle:()=>({fill:C.blue,fillOpacity:.25}),line:{style:{lineWidth:2}},color:n.colors||N,slider:!1!==n.enableZoom?{start:0,end:1}:void 0}),[n,a]);return(0,i.jsx)(x.Z,{...r,height:n.height||300})},G=e=>{let{config:t,chartRef:n}=e,a=(0,h.useMemo)(()=>({data:t.data,xField:t.xField||"x",yField:t.yField||"y",colorField:t.colorField||t.seriesField,...I(t),...w(t.showGrid),...R(t.showLegend),...O(t),...L(t),...D(t,n),size:5,shape:"circle",pointStyle:{fillOpacity:.8,stroke:"#ffffff",lineWidth:1,cursor:"pointer"},color:t.colors||N,brush:t.enableBrush?{enabled:!0,type:"rect"}:void 0}),[t,n]);return(0,i.jsx)(_,{...a,height:t.height||300})},H=e=>{let{config:t,chartRef:n}=e,a=(0,h.useMemo)(()=>{var e,a;return{data:[t.data,t.data],xField:t.xField||"x",yField:t.yFields||[t.yField||"y1","y2"],...I(t),...O(t),...D(t,n),geometryOptions:t.geometries||[{geometry:"column",columnWidthRatio:.4,color:(null===(e=t.colors)||void 0===e?void 0:e[0])||N[0]},{geometry:"line",smooth:!0,lineStyle:{lineWidth:2},color:(null===(a=t.colors)||void 0===a?void 0:a[1])||N[1]}],legend:{position:"top-right"},interactions:[{type:"element-active"},{type:"element-highlight"}],slider:!1!==t.enableZoom?{start:0,end:1}:void 0}},[t,n]);return(0,i.jsx)(A,{...a,height:t.height||300})},$=(e,t,n)=>{if(!e||0===e.length)return"line";let a=new Set(e.map(e=>e[t])).size,r=e.some(e=>e[n]<0),i=e.some(e=>{let n=e[t];return n instanceof Date||!isNaN(Date.parse(n))});return i?"area":a<=5&&!r&&e.length<=10?"pie":a>5&&a<=15?"column":"line"},z=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.xField||"x",a=t.yField||"y",r=t.chartType||$(e,n,a);return{chartType:r,data:e,xField:n,yField:a,smooth:!0,autoFit:!0,showLegend:!0,showGrid:!0,animate:!0,enableZoom:!0,enableTooltipCrosshairs:!0,showToolbar:!0,enableFullscreen:!0,...t}};var Z=e=>{let{config:t,className:n,style:a}=e,r=(0,h.useRef)(null),o=(0,h.useRef)(null),[s,l]=(0,h.useState)(!1),[c,d]=(0,h.useState)(1),u=(0,h.useCallback)(()=>{var e;if(d(e=>Math.min(1.2*e,3)),null===(e=r.current)||void 0===e?void 0:e.chart){let e=r.current.chart;try{e.zoom(1.2)}catch(e){}}},[]),p=(0,h.useCallback)(()=>{var e;if(d(e=>Math.max(e/1.2,.5)),null===(e=r.current)||void 0===e?void 0:e.chart){let e=r.current.chart;try{e.zoom(.8)}catch(e){}}},[]),m=(0,h.useCallback)(()=>{var e,t;if(d(1),null===(e=r.current)||void 0===e?void 0:e.chart){let e=r.current.chart;try{null===(t=e.resetZoom)||void 0===t||t.call(e),e.render()}catch(t){e.render()}}},[]),g=(0,h.useCallback)(()=>{o.current&&(s?document.exitFullscreen&&document.exitFullscreen():o.current.requestFullscreen&&o.current.requestFullscreen(),l(!s))},[s]);h.useEffect(()=>{let e=()=>{l(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]);let f=!1!==t.showToolbar&&"pie"!==t.chartType&&"donut"!==t.chartType;return(0,i.jsxs)("div",{ref:o,className:"advanced-chart-container relative ".concat(s?"fixed inset-0 z-50 bg-white dark:bg-gray-900 p-6":""," ").concat(n||""),style:a,children:[t.title&&(0,i.jsxs)("div",{className:"chart-header mb-3",children:[(0,i.jsx)("h3",{className:"chart-title text-sm font-semibold text-gray-800 dark:text-gray-200",children:t.title}),t.description&&(0,i.jsx)("p",{className:"chart-description text-xs text-gray-500 dark:text-gray-400 mt-1",children:t.description})]}),f&&(0,i.jsx)(P,{onZoomIn:u,onZoomOut:p,onReset:m,onToggleFullscreen:g,isFullscreen:s,showZoom:!1!==t.enableZoom,showFullscreen:!1!==t.enableFullscreen}),(0,i.jsx)("div",{className:"chart-body transition-transform duration-200",style:{transform:"scale(".concat(c,")"),transformOrigin:"center center"},children:(()=>{switch(t.chartType){case"line":default:return(0,i.jsx)(M,{config:t,chartRef:r});case"column":return(0,i.jsx)(F,{config:t,chartRef:r});case"bar":return(0,i.jsx)(U,{config:t,chartRef:r});case"pie":case"donut":return(0,i.jsx)(B,{config:t,chartRef:r});case"area":return(0,i.jsx)(j,{config:t,chartRef:r});case"scatter":return(0,i.jsx)(G,{config:t,chartRef:r});case"dual-axes":return(0,i.jsx)(H,{config:t,chartRef:r})}})()}),1!==c&&(0,i.jsxs)("div",{className:"absolute bottom-2 left-2 text-xs text-gray-400 bg-white/80 dark:bg-gray-800/80 px-2 py-1 rounded",children:[Math.round(100*c),"%"]})]})},W=n(18102),Y=n(31545),V=n(86548),q=n(9020),K=n(68795),X=n(89035),Q=n(74842),J=n(15360),ee=n(13520),et=n(50888),en=n(89739),ea=n(4340),er=n(97175),ei=n(45699),eo=n(43069),es=n(69243),el=n(15611),ec=n(61086),ed=n(26911),eu=n(99611),ep=n(57132),em=n(80882),eg=n(18073),eh=n(95591),ef=n(41156),eb=n(51046),eE=n(63606),ey=n(24969),ex=n(6171),eT=n(58638),e_=n(24019),eS=n(98165),eA=n(29158),ek=n(48115),ev=n(32975),eN=n(45360),eC=n(39773),eI=n(93967),ew=n.n(eI),eR=n(67421),eO=n(83454);let eL=e=>{if(!e||/^https?:\/\//.test(e))return e;if(e.startsWith("/images/")){let t=eO.env.API_BASE_URL||"";return t?"".concat(t).concat(e):e}return e},eD=e=>{let t=eO.env.API_BASE_URL||"";return t&&e?e.replace(/(src\s*=\s*["'])\/images\//gi,"$1".concat(t,"/images/")):e},eP=e=>{switch(e){case"read":return(0,i.jsx)(Y.Z,{className:"text-emerald-500"});case"edit":case"write":return(0,i.jsx)(V.Z,{className:"text-amber-500"});case"bash":return(0,i.jsx)(q.Z,{className:"text-purple-500"});case"grep":case"glob":return(0,i.jsx)(K.Z,{className:"text-cyan-500"});case"python":return(0,i.jsx)(X.Z,{className:"text-blue-500"});case"html":return(0,i.jsx)(X.Z,{className:"text-orange-500"});case"task":case"skill":return(0,i.jsx)(Q.Z,{className:"text-indigo-500"});case"sql":return(0,i.jsx)(q.Z,{className:"text-emerald-600"});default:return(0,i.jsx)(J.Z,{className:"text-gray-500"})}},eM=e=>{if(!e)return{icon:(0,i.jsx)(ee.Z,{className:"text-gray-500 text-sm"}),label:"Database"};let t=e.toLowerCase();return t.includes("mysql")?{icon:(0,i.jsx)(q.Z,{className:"text-blue-500 text-sm"}),label:"MySQL"}:t.includes("postgre")?{icon:(0,i.jsx)(ee.Z,{className:"text-blue-400 text-sm"}),label:"PostgreSQL"}:t.includes("sqlite")?{icon:(0,i.jsx)(ee.Z,{className:"text-amber-500 text-sm"}),label:"SQLite"}:t.includes("mongo")?{icon:(0,i.jsx)(ee.Z,{className:"text-green-500 text-sm"}),label:"MongoDB"}:t.includes("oracle")?{icon:(0,i.jsx)(ee.Z,{className:"text-red-500 text-sm"}),label:"Oracle"}:t.includes("mssql")||t.includes("sqlserver")?{icon:(0,i.jsx)(ee.Z,{className:"text-indigo-500 text-sm"}),label:"SQL Server"}:{icon:(0,i.jsx)(ee.Z,{className:"text-gray-500 text-sm"}),label:e}},eF=e=>{let{status:t}=e,{t:n}=(0,eR.$G)();switch(t){case"running":return(0,i.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-blue-100 dark:bg-blue-900/50 text-blue-600 dark:text-blue-400 text-[10px] font-medium",children:[(0,i.jsx)(et.Z,{spin:!0,className:"text-xs"}),(0,i.jsx)("span",{children:n("Status")})]});case"completed":return(0,i.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-emerald-100 dark:bg-emerald-900/50 text-emerald-600 dark:text-emerald-400 text-[10px] font-medium",children:[(0,i.jsx)(en.Z,{className:"text-xs"}),(0,i.jsx)("span",{children:n("completed")})]});case"error":return(0,i.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-red-100 dark:bg-red-900/50 text-red-600 dark:text-red-400 text-[10px] font-medium",children:[(0,i.jsx)(ea.Z,{className:"text-xs"}),(0,i.jsx)("span",{children:n("Error_Message")})]});default:return(0,i.jsx)("div",{className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 text-[10px] font-medium",children:(0,i.jsx)("span",{children:n("Process")})})}},eU=(e,t)=>{navigator.clipboard.writeText(e),eN.ZP.success(t)},eB=e=>{switch(e.type){case"file":{let t=e.name.toLowerCase().split(".").pop()||"";if(["xlsx","xls","csv"].includes(t))return(0,i.jsx)(er.Z,{className:"text-green-600 text-lg"});if(["png","jpg","jpeg","gif","webp","svg"].includes(t))return(0,i.jsx)(ei.Z,{className:"text-pink-500 text-lg"});if(["ppt","pptx"].includes(t))return(0,i.jsx)(eo.Z,{className:"text-orange-500 text-lg"});return(0,i.jsx)(J.Z,{className:"text-blue-500 text-lg"})}case"html":return(0,i.jsx)(es.Z,{className:"text-blue-500 text-lg"});case"table":return(0,i.jsx)(el.Z,{className:"text-blue-500 text-lg"});case"chart":return(0,i.jsx)(ec.Z,{className:"text-green-500 text-lg"});case"image":return(0,i.jsx)(ei.Z,{className:"text-pink-500 text-lg"});case"code":return(0,i.jsx)(X.Z,{className:"text-purple-500 text-lg"});case"markdown":return(0,i.jsx)(J.Z,{className:"text-orange-500 text-lg"});case"summary":return(0,i.jsx)(J.Z,{className:"text-emerald-500 text-lg"});default:return(0,i.jsx)(ed.Z,{className:"text-gray-500 text-lg"})}},ej=e=>({file:"bg-gray-50 dark:bg-gray-800",html:"bg-blue-50 dark:bg-blue-900/20",table:"bg-blue-50 dark:bg-blue-900/20",chart:"bg-green-50 dark:bg-green-900/20",image:"bg-pink-50 dark:bg-pink-900/20",code:"bg-purple-50 dark:bg-purple-900/20",markdown:"bg-orange-50 dark:bg-orange-900/20",summary:"bg-emerald-50 dark:bg-emerald-900/20"})[e]||"bg-gray-50 dark:bg-gray-800",eG=e=>({file:"文件",html:"网页报告",table:"数据表",chart:"图表",image:"图片",code:"代码",markdown:"文档",summary:"分析总结"})[e]||"产物",eH=[{key:"all",label:"全部"},{key:"document",label:"文档"},{key:"image",label:"图片"},{key:"code",label:"代码文件"},{key:"link",label:"链接"}],e$=e=>{let t=["all"],n=e.name.toLowerCase().split(".").pop()||"";return("image"===e.type||["png","jpg","jpeg","gif","webp","svg"].includes(n))&&t.push("image"),("code"===e.type||["py","js","ts","tsx","jsx","sql","sh","json","yaml","yml"].includes(n))&&t.push("code"),("html"===e.type||"markdown"===e.type||"summary"===e.type||"table"===e.type||["xlsx","xls","csv","doc","docx","pdf","ppt","pptx","md","txt","html","htm"].includes(n))&&t.push("document"),"file"===e.type&&1===t.length&&t.push("document"),t},ez=e=>{let t=new Date,n=new Date(e),a=t.getTime()-n.getTime(),r=Math.floor(a/864e5);return 0===r?"今天":1===r?"昨天":r<7?["星期日","星期一","星期二","星期三","星期四","星期五","星期六"][n.getDay()]:"".concat(n.getMonth()+1,"月").concat(n.getDate(),"日")},eZ=(0,h.memo)(e=>{let{artifact:t,onClick:n}=e,a="image"===t.type||/\.(png|jpg|jpeg|gif|webp|svg)$/i.test(t.name),r=a&&"string"==typeof t.content?eL(t.content):null;return(0,i.jsxs)("div",{onClick:n,className:"flex items-center gap-3 px-4 py-3.5 cursor-pointer hover:bg-gray-50 dark:hover:bg-[#1f2025] transition-colors border-b border-gray-100 dark:border-gray-800 last:border-b-0",children:[r?(0,i.jsx)("img",{src:r,alt:t.name,className:"w-10 h-10 rounded-lg object-cover flex-shrink-0 border border-gray-200 dark:border-gray-700"}):(0,i.jsx)("div",{className:ew()("w-10 h-10 rounded-lg flex items-center justify-center flex-shrink-0",ej(t.type)),children:eB(t)}),(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-200 truncate",children:t.name}),(0,i.jsxs)("div",{className:"text-[11px] text-gray-400 dark:text-gray-500 flex items-center gap-1.5 mt-0.5",children:[(0,i.jsx)("span",{children:eG(t.type)}),null!=t.size&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"text-gray-300 dark:text-gray-600",children:"\xb7"}),(0,i.jsx)("span",{children:t.size<1024?t.size+" B":t.size<1048576?(t.size/1024).toFixed(1)+" KB":(t.size/1048576).toFixed(1)+" MB"})]})]})]})]})});function eW(e){if(!e||-1===e.indexOf("|"))return e;let t=e;return(t=(t=t.replace(/\|[ \t]*(#{1,6}[ \t])/g,"|\n\n$1")).replace(/(^|\n)([ \t]*#{1,6}[^\n|]*?)[ \t]*\|/g,"$1$2\n|")).split("\n").map(e=>{let t=e.trim();if(!t.startsWith("|")||!/\|\s*:?-{3,}:?\s*\|/.test(t))return e;let n=t.split("|").slice(1,-1).map(e=>e.trim()),a=e=>/^:?-{3,}:?$/.test(e),r=n.findIndex(a);if(r<0)return e;let i=r;for(;i