@estevia/evafusion-agent 1.8.8 → 1.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -56,7 +56,7 @@ ${E.diagram}`)}catch{Y=O}else Y=d(O),O&&typeof O=="object"&&O.diagram&&(Y+=`
56
56
  ### Neural Blueprint
57
57
  ${O.diagram}`);const de={role:"assistant",content:Y,variant:C,timestamp:new Date().toISOString(),rawPayload:I.data,inputData:re,usage:I.data.usage};c(E=>[...E,de])}else Re.error("Neural synthesis failed. Please check payload integrity.")}catch(u){Re.error(`API Error: ${u.message||"Failed to reach EvaFusion"}`)}finally{g(!1)}},[f,A,w,C,b]);return{messages:a,input:f,setInput:m,isProcessing:w,activeVariant:C,setActiveVariant:N,handleSend:me,payloadConfig:b,updatePayloadConfig:k,samples:te.map(D=>({...D,isDataDriven:!!D.data})),selectedSampleId:S,setSelectedSampleId:F,applySample:ae,clearChat:$,isAuthorized:!!A}};function He(...s){return s.filter(Boolean).join(" ")}const Se=({chart:s})=>{r.useRef(null);const[A,n]=r.useState(""),[a,c]=r.useState(null),[f,m]=r.useState(!1);return r.useEffect(()=>{if(window.__EVA_PRIVATE_ENGINE__){m(!0);return}const w=document.createElement("script");w.src="https://cdn.jsdelivr.net/npm/mermaid@10.2.4/dist/mermaid.min.js",w.async=!0,w.onload=()=>{const g=window.mermaid;g&&(window.__EVA_PRIVATE_ENGINE__=g,g.initialize({startOnLoad:!1,theme:"dark",securityLevel:"loose",fontFamily:"Inter, sans-serif",themeVariables:{fontSize:"14px",primaryColor:"#6366f1",primaryTextColor:"#fff",primaryBorderColor:"#6366f1",lineColor:"#818cf8",secondaryColor:"#1e293b",tertiaryColor:"#0f172a"}}),m(!0))},document.body.appendChild(w)},[]),r.useEffect(()=>{if(!f)return;const w=window.__EVA_PRIVATE_ENGINE__;if(!w)return;const g=N=>{if(!N)return"";let b=N.replace(/```mermaid/gi,"").replace(/```/g,"").replace(/#+.*mermaid\.js.*$/gim,"").replace(/#+.*system architecture.*$/gim,"").replace(/here's a .*diagram.*$/gim,"").replace(/this diagram shows.*$/gim,"").replace(/^#+.*$/gm,"").replace(/<[^>]*>/g,"").replace(/^\s*[\r\n]/gm,"").trim();const z=b.split(`
58
58
  `);if(z.length>0){const S=z[0].trim();["graph","sequencediagram","flowchart","erdiagram","classdiagram","statediagram","journey","gantt","pie","timeline","gitgraph","mindmap","quadrantchart","sankey","xychart"].some(te=>S.toLowerCase().startsWith(te))&&(z[0]=S.replace(/;$/,""),b=z.join(`
59
- `))}return b};(async()=>{const N=g(s);if(N)try{c(null);const b=`mermaid-render-${Math.random().toString(36).substr(2,9)}`,{svg:z}=await w.render(b,N);n(z)}catch(b){console.error("Mermaid render error:",b),c("Neural Blueprint Syntax Error")}})()},[s,f]),a?e.jsx("div",{className:"flex flex-col items-center justify-center p-8 bg-rose-500/5 rounded-2xl border border-rose-500/20 text-rose-400 gap-3 my-4",children:e.jsx("p",{className:"text-[10px] font-black uppercase tracking-tight text-center",children:a})}):e.jsxs("div",{className:"relative group w-full my-4",children:[e.jsx("div",{className:"bg-slate-900/40 rounded-2xl border border-white/5 p-6 overflow-hidden max-h-[500px] flex justify-center relative",dangerouslySetInnerHTML:{__html:A}}),!A&&e.jsx("div",{className:"p-8 flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-indigo-500"})})]})},zt=s=>{const A=s.pendingTasks||s.tasks,n=s.resources||s.team;return!A&&!n?null:e.jsxs("div",{className:"space-y-6 mt-6",children:[A&&A.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-amber-500",children:[e.jsx(P.Layout,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Maestro Orchestration Board"})]}),e.jsx("div",{className:"grid gap-2",children:A.map((a,c)=>e.jsxs("div",{className:"bg-white/5 border border-white/10 p-3 rounded-xl flex items-center justify-between group hover:bg-white/[0.08] transition-all",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[11px] font-bold text-white group-hover:text-amber-500 transition-colors",children:a.task||a.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[8px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded uppercase font-black tracking-widest",children:["Sprint ",a.sprint]}),e.jsx("span",{className:He("text-[8px] px-1.5 py-0.5 rounded font-black uppercase tracking-widest",a.priority==="P0"?"bg-rose-500/20 text-rose-500":"bg-blue-500/20 text-blue-500"),children:a.priority})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:a.owner||a.assignedTo}),e.jsxs("div",{className:"text-[10px] font-mono text-amber-500/60",children:[a.points||a.effort," pts"]})]})]},c))})]}),n&&n.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-indigo-400",children:[e.jsx(P.Users,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Team Resonance Map"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:n.map((a,c)=>{var f,m;return e.jsxs("div",{className:"bg-white/5 border border-white/5 p-3 rounded-xl space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-lg bg-indigo-500/20 flex items-center justify-center text-[10px] font-black text-indigo-400",children:((f=a.name)==null?void 0:f[0])||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-bold text-white",children:a.name}),e.jsx("div",{className:"text-[8px] text-slate-500 uppercase font-black",children:a.role})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:(m=a.skills)==null?void 0:m.slice(0,2).map((w,g)=>e.jsx("span",{className:"text-[7px] bg-white/5 text-slate-400 px-1 py-0.5 rounded",children:w},g))})]},c)})})]})]})},Le=({data:s})=>{if(!s||!Array.isArray(s))return null;const A=Object.keys(s[0]||{}).filter(n=>n!=="id");return e.jsx("div",{className:"w-full overflow-hidden rounded-2xl border border-white/5 bg-slate-900/40 my-4",children:e.jsx("div",{className:"overflow-x-auto no-scrollbar",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-white/5 border-b border-white/5",children:A.map(n=>e.jsx("th",{className:"p-3 text-[8px] font-black text-slate-500 uppercase tracking-widest",children:n},n))})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:s.map((n,a)=>e.jsx("tr",{className:"hover:bg-white/[0.02] transition-colors",children:A.map(c=>e.jsx("td",{className:"p-3 text-[10px] font-medium text-slate-300",children:c.toLowerCase()==="status"?e.jsx("span",{className:He("px-1.5 py-0.5 rounded-full text-[8px] font-black uppercase tracking-widest",n[c]==="Nominal"?"bg-emerald-500/20 text-emerald-500":"bg-amber-500/20 text-amber-500"),children:n[c]}):n[c]},c))},a))})]})})})},$e=({data:s})=>s?e.jsxs("div",{className:"space-y-8 my-6 animate-in fade-in slide-in-from-bottom-4 duration-1000",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-black text-white uppercase tracking-tighter italic",children:s.strategicContextTitle||"Neural Strategy"}),e.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest font-bold",children:s.matrixSubtitle})]}),s.phases&&e.jsx("div",{className:"relative space-y-6 pl-6 border-l border-white/5",children:s.phases.map((A,n)=>{var a,c;return e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute -left-[27px] top-1 w-2.5 h-2.5 rounded-full bg-amber-500 shadow-[0_0_10px_rgba(245,158,11,0.4)] group-hover:scale-125 transition-transform"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest",children:A.title}),e.jsx("span",{className:"text-[8px] font-mono text-slate-500",children:A.milestone})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 bg-white/5 rounded-xl p-3 border border-white/5 group-hover:border-amber-500/20 transition-all",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[7px] font-black text-emerald-500/60 uppercase tracking-widest",children:"Growth Points"}),e.jsx("ul",{className:"space-y-1",children:(a=A.growthPoints)==null?void 0:a.map((f,m)=>e.jsxs("li",{className:"text-[9px] text-slate-400 flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-500/40"})," ",f]},m))})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[7px] font-black text-rose-500/60 uppercase tracking-widest",children:"Frictions"}),e.jsx("ul",{className:"space-y-1",children:(c=A.frictions)==null?void 0:c.map((f,m)=>e.jsxs("li",{className:"text-[9px] text-slate-400 flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-rose-500/40"})," ",f]},m))})]})]})]})]},n)})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.riskSimulations&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Neural Risk Assessment"}),e.jsx("div",{className:"space-y-2",children:s.riskSimulations.map((A,n)=>e.jsxs("div",{className:"p-3 rounded-xl bg-black/20 border border-white/5 flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[10px] font-bold text-slate-300",children:A.threat}),e.jsx("div",{className:"text-[8px] text-slate-500 italic",children:A.mitigation})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:He("text-[9px] font-black uppercase",A.impact==="High"?"text-rose-500":"text-amber-500"),children:[A.impact," Impact"]}),e.jsxs("div",{className:"text-[8px] font-mono text-slate-600",children:[A.probability,"% Prob"]})]})]},n))})]}),s.projections&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Market Projections (2026)"}),e.jsx("div",{className:"grid grid-cols-1 gap-2",children:Object.entries(s.projections).map(([A,n],a)=>e.jsxs("div",{className:"p-3 rounded-xl bg-amber-500/5 border border-amber-500/10 flex items-center justify-between group hover:bg-amber-500/10 transition-all",children:[e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:A}),e.jsx("span",{className:"text-[10px] font-mono text-amber-500 font-bold",children:n})]},a))}),e.jsx("div",{className:"p-3 rounded-xl bg-white/5 border border-white/5 italic text-[9px] text-slate-500 leading-relaxed",children:s.trajectorySummary})]})]})]}):null,Ge=({data:s})=>{var A;return s?e.jsxs("div",{className:"space-y-8 my-6 animate-in fade-in slide-in-from-right-4 duration-700",children:[s.okrAlignment&&e.jsx("div",{className:"bg-gradient-to-br from-amber-500/10 to-indigo-500/5 rounded-3xl p-6 border border-white/5 flex items-center justify-between shadow-2xl",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest",children:"Neural OKR Alignment"}),e.jsx("div",{className:"flex gap-2",children:(A=s.okrAlignment.frictionPoints)==null?void 0:A.map((n,a)=>e.jsx("span",{className:"text-[8px] bg-rose-500/10 text-rose-400 px-2 py-0.5 rounded-full border border-rose-500/20",children:n},a))})]})}),e.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[s.sprints&&s.sprints.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Orchestrated Sprints"}),e.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4 no-scrollbar",children:s.sprints.map((n,a)=>{var c;return e.jsxs("div",{className:"min-w-[240px] p-4 rounded-2xl bg-white/5 border border-white/5 space-y-4 shrink-0 hover:border-amber-500/20 transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-2",children:[e.jsxs("span",{className:"text-[10px] font-black text-amber-500",children:["SPRINT ",n.id]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-500",children:n.allocation?`${n.allocation.reduce((f,m)=>f+(m.load||0),0)} pts`:`${n.velocity||0} pts`})]}),e.jsx("div",{className:"space-y-4",children:n.allocation?n.allocation.map((f,m)=>{var w;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest",children:f.role}),e.jsxs("span",{className:"text-[7px] font-mono text-amber-500/60",children:[f.load,"% Load"]})]}),e.jsx("div",{className:"space-y-1 pl-2 border-l border-amber-500/20",children:(w=f.tasks)==null?void 0:w.map((g,C)=>e.jsxs("div",{className:"text-[9px] text-slate-300 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/40"})," ",g]},C))})]},m)}):e.jsx("div",{className:"space-y-2",children:(c=n.tasks)==null?void 0:c.map((f,m)=>e.jsxs("div",{className:"text-[9px] text-slate-300 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500"})," ",f]},m))})})]},a)})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Critical Dependency Chains"}),s.chains&&s.chains.length>0?e.jsx("div",{className:"space-y-3",children:s.chains.map((n,a)=>{const c=n.sequence||n.nodes||[];return e.jsxs("div",{className:"p-4 rounded-xl bg-black/40 border border-white/5 flex items-center gap-4",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-500/10 flex items-center justify-center shrink-0 border border-indigo-500/20",children:e.jsx(P.Activity,{size:14,className:"text-indigo-400"})}),e.jsx("div",{className:"flex-1 flex items-center gap-2 overflow-x-auto no-scrollbar",children:c.map((f,m)=>e.jsxs(r.Fragment,{children:[e.jsx("span",{className:"text-[9px] font-bold text-slate-400 whitespace-nowrap",children:f}),m<c.length-1&&e.jsx("span",{className:"text-slate-700",children:"→"})]},m))})]},a)})}):e.jsx("div",{className:"p-4 rounded-xl bg-white/5 border border-white/5 border-dashed flex items-center justify-center",children:e.jsx("span",{className:"text-[9px] font-black text-slate-600 uppercase tracking-widest italic",children:"No Critical Dependency Chains Detected"})})]})]}),e.jsxs("div",{className:"flex items-center gap-6 pt-4 border-t border-white/5",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-600 uppercase tracking-widest",children:"Compute Load"}),e.jsx("span",{className:"text-[9px] font-mono text-emerald-500",children:s.computeLoad||"IDLE"})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-600 uppercase tracking-widest",children:"Neural Latency"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:s.latency||"0ms"})]})]})]}):null},kt=({data:s,variant:A})=>{if(!s)return null;let n={label:"Generic Matrix",details:"Raw payload detected"};try{const a=typeof s=="string"?JSON.parse(s):s;if(A==="MAESTRO"){const c=(a.pendingTasks||a.tasks||[]).length,f=(a.resources||a.team||[]).length;n={label:"Maestro Orchestration Matrix",details:`${c} Tasks • ${f} Resources`}}else A==="ANALYST"?n={label:"Analyst Data Stream",details:Array.isArray(a)?`${a.length} Records`:"Structured Dataset"}:A==="SENTINEL"?n={label:"Sentinel Telemetry Logs",details:typeof a=="string"?`${a.length} chars`:"Log Stream"}:n={label:"Neural Input Matrix",details:typeof a=="object"?"Structured Data":"Raw Text"}}catch{}return e.jsxs("div",{className:"mt-2 p-3 rounded-xl bg-black/20 border border-white/5 flex items-center gap-3 group hover:border-amber-500/20 transition-all cursor-default",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center border border-amber-500/20",children:e.jsx(P.Database,{size:14,className:"text-amber-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[10px] font-black text-amber-500/80 uppercase tracking-widest truncate",children:n.label}),e.jsx("div",{className:"text-[9px] text-slate-500 font-mono",children:n.details})]})]})},Xt=({isOpen:s,onClose:A,input:n,prompt:a,output:c,variant:f})=>{if(!s)return null;const m=n&&(Array.isArray(n)&&n.length>0||typeof n=="object"&&Object.keys(n).length>0);return e.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center p-4 sm:p-10",children:[e.jsx("div",{className:"absolute inset-0 bg-[#020210]/80 backdrop-blur-xl",onClick:A}),e.jsxs("div",{className:"relative w-full h-full max-w-6xl eva-holographic-glass bg-[#0a0a20]/40 rounded-3xl border border-white/10 flex flex-col overflow-hidden shadow-[0_0_100px_rgba(99,102,241,0.1)]",children:[e.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center justify-between bg-white/5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center",children:e.jsx(P.Activity,{size:20,className:"text-indigo-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-black text-white uppercase tracking-widest italic",children:"Neural Transfer Comparator"}),e.jsxs("p",{className:"text-[9px] text-slate-500 uppercase font-bold tracking-widest",children:[f||"Universal"," Orchestration • Real-time Trace"]})]})]}),e.jsx("button",{onClick:A,className:"p-2 rounded-xl text-slate-400 hover:text-white hover:bg-white/5 transition-all",children:e.jsx(P.X,{size:20})})]}),e.jsxs("div",{className:"flex-1 flex flex-col md:flex-row overflow-hidden",children:[e.jsxs("div",{className:"flex-1 border-r border-white/5 flex flex-col overflow-hidden bg-black/20",children:[e.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(P.Database,{size:12})," ",m?"Source Matrix":"Generative Prompt"]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-600 uppercase",children:m?"Input Stream":"Instruction"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 eva-agent-scrollbar",children:m?e.jsx("pre",{className:"text-[10px] font-mono text-indigo-200/60 leading-relaxed whitespace-pre-wrap",children:typeof n=="string"?n:JSON.stringify(n,null,2)}):e.jsxs("div",{className:"min-h-full flex flex-col items-center justify-center text-center px-10 py-12",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-amber-500/5 flex items-center justify-center mb-4 border border-amber-500/10",children:e.jsx(P.Sparkles,{size:20,className:"text-amber-500/40"})}),e.jsxs("p",{className:"text-xs text-indigo-200/80 font-medium leading-relaxed italic",children:['"',a||"No instruction context captured",'"']}),e.jsx("div",{className:"mt-4 px-3 py-1 rounded-full bg-amber-500/10 border border-amber-500/20 text-[7px] font-black uppercase tracking-[0.2em] text-amber-500/60",children:"Neural Synthesis Mode Active"})]})})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden bg-indigo-500/[0.02]",children:[e.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] font-black text-indigo-400 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(P.Sparkles,{size:12})," Neural Synthesis"]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-600 uppercase",children:"Engine Output"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 eva-agent-scrollbar",children:f==="MAESTRO"?e.jsx(Ge,{data:c}):f==="STRATEGIST"?e.jsx($e,{data:c}):e.jsx("pre",{className:"text-[10px] font-mono text-emerald-400/80 leading-relaxed whitespace-pre-wrap",children:typeof c=="string"?c:JSON.stringify(c,null,2)})})]})]}),e.jsxs("div",{className:"p-4 border-t border-white/5 flex items-center justify-center gap-8 bg-black/40",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Ground Truth"})]}),e.jsx("div",{className:"w-12 h-[1px] bg-white/10 relative",children:e.jsx(le.motion.div,{className:"absolute top-[-2px] w-1.5 h-1.5 rounded-full bg-indigo-500",animate:{left:["0%","100%","0%"]},transition:{duration:2,repeat:1/0,ease:"easeInOut"}})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-indigo-500 shadow-[0_0_8px_rgba(99,102,241,0.5)]"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Synergized Output"})]})]})]})]})},It=({usage:s,rawPayload:A,inputData:n,variant:a,onInspect:c})=>{const[f,m]=r.useState(!1),w=()=>{navigator.clipboard.writeText(JSON.stringify(A,null,2)),m(!0),setTimeout(()=>m(!1),2e3)};return e.jsxs("div",{className:"mt-16 pt-10 pb-4 px-2 border-t border-white/5 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[s&&e.jsxs("div",{className:"flex gap-4 p-2 border-r border-white/5 mr-2",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-500 uppercase tracking-widest",children:"Input Tokens"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:s.inputTokens})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-500 uppercase tracking-widest",children:"Output Tokens"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:s.outputTokens})]})]}),c&&e.jsxs("button",{onClick:c,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-indigo-500/5 border border-indigo-500/10 text-[9px] font-black uppercase tracking-widest text-indigo-400 hover:bg-indigo-500/20 transition-all",children:[e.jsx(P.Activity,{size:12}),"Inspect Neural Transfer"]})]}),e.jsxs("button",{onClick:w,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-white/5 border border-white/10 text-[9px] font-black uppercase tracking-widest text-slate-400 hover:text-amber-500 hover:bg-amber-500/5 hover:border-amber-500/20 transition-all",children:[f?e.jsx(P.Check,{size:12,className:"text-emerald-500"}):e.jsx(P.Copy,{size:12}),f?"Copied":"Copy JSON"]})]})},et={name:"@estevia/evafusion-agent",version:"1.8.8",description:"Premium React-based ChatWizard Agent for EvaFusion Workbench Integration",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",files:["dist"],scripts:{dev:"vite",build:"tsc && vite build",preview:"vite preview"},dependencies:{"framer-motion":"^10.12.16","lucide-react":"^0.244.0",sonner:"^0.3.1"},peerDependencies:{react:"^18.2.0","react-dom":"^18.2.0","@estevia/evafusion-sdk":"^1.6.4"},devDependencies:{"@estevia/evafusion-sdk":"^1.6.4","@types/react":"^18.0.28","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^4.0.0",autoprefixer:"^10.4.14",postcss:"^8.4.24",tailwindcss:"^3.3.2",typescript:"^5.0.2",vite:"^4.3.9","vite-plugin-dts":"^2.3.0"}},Be=Ce.VARIANT_REQUIREMENTS||{ARCHITECT:"OPTIONAL",ANALYST:"MANDATORY",STRATEGIST:"OPTIONAL",RECRUITER:"OPTIONAL",SENTINEL:"MANDATORY",MAESTRO:"HYBRID",COMPLIANCE:"MANDATORY",PULSE:"MANDATORY",NEXUS:"OPTIONAL"},Ht=({onClose:s,onMinimize:A})=>{const n=r.useContext(Ie),[a,c]=r.useState(!1);r.useState(!1);const f=r.useRef(null);if(!n)return null;const{messages:m,input:w,setInput:g,isProcessing:C,activeVariant:N,setActiveVariant:b,handleSend:z,payloadConfig:S,updatePayloadConfig:F,samples:te,selectedSampleId:ae,setSelectedSampleId:$,applySample:k,clearChat:me,isAuthorized:D}=_e(),[v,T]=r.useState(S),[X,ce]=r.useState(N),[u,re]=r.useState(ae),[p,I]=r.useState({isValid:!0,error:null}),[d,O]=r.useState(null),Y=r.useRef(null);r.useEffect(()=>{a&&(T(S),ce(N),re(ae))},[a]),r.useEffect(()=>{const o=Ce.NeuralDataUtils.validatePayload(X,v.data);I(o)},[v.data,X]);const de=o=>{var J;const H=(J=o.target.files)==null?void 0:J[0];if(!H)return;const h=new FileReader;h.onload=se=>{var L;const fe=(L=se.target)==null?void 0:L.result,W=Ce.NeuralDataUtils.parseCSV(fe);T(V=>({...V,data:JSON.stringify(W,null,2)})),re("")},h.readAsText(H)},E=()=>{const o=Ce.NeuralDataUtils.normalizeForWorkbench(X,v.data);T(H=>({...H,data:JSON.stringify(o,null,2)}))},ge=()=>{b(X),F(v),$(u),c(!1)};r.useEffect(()=>{T(o=>({...o,data:null}))},[X]);const ue=[{id:"SOFTWARE_DEV",name:"Software & Cloud"},{id:"FINANCE",name:"Finance & Quants"},{id:"HEALTHCARE",name:"Healthcare & Life"},{id:"MANUFACTURING",name:"Industrial & MFG"},{id:"REAL_ESTATE",name:"Real Estate & Const."},{id:"RETAIL",name:"Retail & Commerce"}],De=()=>{var o;(o=f.current)==null||o.scrollIntoView({behavior:"smooth"})};r.useEffect(()=>{De()},[m,C]);const je=({msg:o})=>{const{content:H,rawPayload:h,usage:J}=o,se=H.split(/(?=### )/g),fe=L=>{const V=L.trim();return V.startsWith("{")&&V.endsWith("}")||V.startsWith("[")&&V.endsWith("]")},W=L=>L.includes("```mermaid")?L.split(/```mermaid([\s\S]*?)```/).map((K,q)=>q%2===1?e.jsx(Se,{chart:K.trim()},q):e.jsx("div",{children:W(K)},q)):L.split(`
59
+ `))}return b};(async()=>{const N=g(s);if(N)try{c(null);const b=`mermaid-render-${Math.random().toString(36).substr(2,9)}`,{svg:z}=await w.render(b,N);n(z)}catch(b){console.error("Mermaid render error:",b),c("Neural Blueprint Syntax Error")}})()},[s,f]),a?e.jsx("div",{className:"flex flex-col items-center justify-center p-8 bg-rose-500/5 rounded-2xl border border-rose-500/20 text-rose-400 gap-3 my-4",children:e.jsx("p",{className:"text-[10px] font-black uppercase tracking-tight text-center",children:a})}):e.jsxs("div",{className:"relative group w-full my-4",children:[e.jsx("div",{className:"bg-slate-900/40 rounded-2xl border border-white/5 p-6 overflow-hidden max-h-[500px] flex justify-center relative",dangerouslySetInnerHTML:{__html:A}}),!A&&e.jsx("div",{className:"p-8 flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-indigo-500"})})]})},zt=s=>{const A=s.pendingTasks||s.tasks,n=s.resources||s.team;return!A&&!n?null:e.jsxs("div",{className:"space-y-6 mt-6",children:[A&&A.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-amber-500",children:[e.jsx(P.Layout,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Maestro Orchestration Board"})]}),e.jsx("div",{className:"grid gap-2",children:A.map((a,c)=>e.jsxs("div",{className:"bg-white/5 border border-white/10 p-3 rounded-xl flex items-center justify-between group hover:bg-white/[0.08] transition-all",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[11px] font-bold text-white group-hover:text-amber-500 transition-colors",children:a.task||a.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-[8px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded uppercase font-black tracking-widest",children:["Sprint ",a.sprint]}),e.jsx("span",{className:He("text-[8px] px-1.5 py-0.5 rounded font-black uppercase tracking-widest",a.priority==="P0"?"bg-rose-500/20 text-rose-500":"bg-blue-500/20 text-blue-500"),children:a.priority})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:a.owner||a.assignedTo}),e.jsxs("div",{className:"text-[10px] font-mono text-amber-500/60",children:[a.points||a.effort," pts"]})]})]},c))})]}),n&&n.length>0&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-indigo-400",children:[e.jsx(P.Users,{size:14}),e.jsx("h5",{className:"text-[10px] font-black uppercase tracking-widest",children:"Team Resonance Map"})]}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:n.map((a,c)=>{var f,m;return e.jsxs("div",{className:"bg-white/5 border border-white/5 p-3 rounded-xl space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-lg bg-indigo-500/20 flex items-center justify-center text-[10px] font-black text-indigo-400",children:((f=a.name)==null?void 0:f[0])||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-bold text-white",children:a.name}),e.jsx("div",{className:"text-[8px] text-slate-500 uppercase font-black",children:a.role})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:(m=a.skills)==null?void 0:m.slice(0,2).map((w,g)=>e.jsx("span",{className:"text-[7px] bg-white/5 text-slate-400 px-1 py-0.5 rounded",children:w},g))})]},c)})})]})]})},Le=({data:s})=>{if(!s||!Array.isArray(s))return null;const A=Object.keys(s[0]||{}).filter(n=>n!=="id");return e.jsx("div",{className:"w-full overflow-hidden rounded-2xl border border-white/5 bg-slate-900/40 my-4",children:e.jsx("div",{className:"overflow-x-auto no-scrollbar",children:e.jsxs("table",{className:"w-full text-left border-collapse",children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-white/5 border-b border-white/5",children:A.map(n=>e.jsx("th",{className:"p-3 text-[8px] font-black text-slate-500 uppercase tracking-widest",children:n},n))})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:s.map((n,a)=>e.jsx("tr",{className:"hover:bg-white/[0.02] transition-colors",children:A.map(c=>e.jsx("td",{className:"p-3 text-[10px] font-medium text-slate-300",children:c.toLowerCase()==="status"?e.jsx("span",{className:He("px-1.5 py-0.5 rounded-full text-[8px] font-black uppercase tracking-widest",n[c]==="Nominal"?"bg-emerald-500/20 text-emerald-500":"bg-amber-500/20 text-amber-500"),children:n[c]}):n[c]},c))},a))})]})})})},$e=({data:s})=>s?e.jsxs("div",{className:"space-y-8 my-6 animate-in fade-in slide-in-from-bottom-4 duration-1000",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-black text-white uppercase tracking-tighter italic",children:s.strategicContextTitle||"Neural Strategy"}),e.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest font-bold",children:s.matrixSubtitle})]}),s.phases&&e.jsx("div",{className:"relative space-y-6 pl-6 border-l border-white/5",children:s.phases.map((A,n)=>{var a,c;return e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute -left-[27px] top-1 w-2.5 h-2.5 rounded-full bg-amber-500 shadow-[0_0_10px_rgba(245,158,11,0.4)] group-hover:scale-125 transition-transform"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest",children:A.title}),e.jsx("span",{className:"text-[8px] font-mono text-slate-500",children:A.milestone})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 bg-white/5 rounded-xl p-3 border border-white/5 group-hover:border-amber-500/20 transition-all",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[7px] font-black text-emerald-500/60 uppercase tracking-widest",children:"Growth Points"}),e.jsx("ul",{className:"space-y-1",children:(a=A.growthPoints)==null?void 0:a.map((f,m)=>e.jsxs("li",{className:"text-[9px] text-slate-400 flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-emerald-500/40"})," ",f]},m))})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("span",{className:"text-[7px] font-black text-rose-500/60 uppercase tracking-widest",children:"Frictions"}),e.jsx("ul",{className:"space-y-1",children:(c=A.frictions)==null?void 0:c.map((f,m)=>e.jsxs("li",{className:"text-[9px] text-slate-400 flex items-center gap-1.5",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-rose-500/40"})," ",f]},m))})]})]})]})]},n)})}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.riskSimulations&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Neural Risk Assessment"}),e.jsx("div",{className:"space-y-2",children:s.riskSimulations.map((A,n)=>e.jsxs("div",{className:"p-3 rounded-xl bg-black/20 border border-white/5 flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-[10px] font-bold text-slate-300",children:A.threat}),e.jsx("div",{className:"text-[8px] text-slate-500 italic",children:A.mitigation})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:He("text-[9px] font-black uppercase",A.impact==="High"?"text-rose-500":"text-amber-500"),children:[A.impact," Impact"]}),e.jsxs("div",{className:"text-[8px] font-mono text-slate-600",children:[A.probability,"% Prob"]})]})]},n))})]}),s.projections&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Market Projections (2026)"}),e.jsx("div",{className:"grid grid-cols-1 gap-2",children:Object.entries(s.projections).map(([A,n],a)=>e.jsxs("div",{className:"p-3 rounded-xl bg-amber-500/5 border border-amber-500/10 flex items-center justify-between group hover:bg-amber-500/10 transition-all",children:[e.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:A}),e.jsx("span",{className:"text-[10px] font-mono text-amber-500 font-bold",children:n})]},a))}),e.jsx("div",{className:"p-3 rounded-xl bg-white/5 border border-white/5 italic text-[9px] text-slate-500 leading-relaxed",children:s.trajectorySummary})]})]})]}):null,Ge=({data:s})=>{var A;return s?e.jsxs("div",{className:"space-y-8 my-6 animate-in fade-in slide-in-from-right-4 duration-700",children:[s.okrAlignment&&e.jsx("div",{className:"bg-gradient-to-br from-amber-500/10 to-indigo-500/5 rounded-3xl p-6 border border-white/5 flex items-center justify-between shadow-2xl",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("h4",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest",children:"Neural OKR Alignment"}),e.jsx("div",{className:"flex gap-2",children:(A=s.okrAlignment.frictionPoints)==null?void 0:A.map((n,a)=>e.jsx("span",{className:"text-[8px] bg-rose-500/10 text-rose-400 px-2 py-0.5 rounded-full border border-rose-500/20",children:n},a))})]})}),e.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[s.sprints&&s.sprints.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Orchestrated Sprints"}),e.jsx("div",{className:"flex gap-4 overflow-x-auto pb-4 no-scrollbar",children:s.sprints.map((n,a)=>{var c;return e.jsxs("div",{className:"min-w-[240px] p-4 rounded-2xl bg-white/5 border border-white/5 space-y-4 shrink-0 hover:border-amber-500/20 transition-all",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-2",children:[e.jsxs("span",{className:"text-[10px] font-black text-amber-500",children:["SPRINT ",n.id]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-500",children:n.allocation?`${n.allocation.reduce((f,m)=>f+(m.load||0),0)} pts`:`${n.velocity||0} pts`})]}),e.jsx("div",{className:"space-y-4",children:n.allocation?n.allocation.map((f,m)=>{var w;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest",children:f.role}),e.jsxs("span",{className:"text-[7px] font-mono text-amber-500/60",children:[f.load,"% Load"]})]}),e.jsx("div",{className:"space-y-1 pl-2 border-l border-amber-500/20",children:(w=f.tasks)==null?void 0:w.map((g,C)=>e.jsxs("div",{className:"text-[9px] text-slate-300 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/40"})," ",g]},C))})]},m)}):e.jsx("div",{className:"space-y-2",children:(c=n.tasks)==null?void 0:c.map((f,m)=>e.jsxs("div",{className:"text-[9px] text-slate-300 flex items-center gap-2",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500"})," ",f]},m))})})]},a)})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Critical Dependency Chains"}),s.chains&&s.chains.length>0?e.jsx("div",{className:"space-y-3",children:s.chains.map((n,a)=>{const c=n.sequence||n.nodes||[];return e.jsxs("div",{className:"p-4 rounded-xl bg-black/40 border border-white/5 flex items-center gap-4",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-indigo-500/10 flex items-center justify-center shrink-0 border border-indigo-500/20",children:e.jsx(P.Activity,{size:14,className:"text-indigo-400"})}),e.jsx("div",{className:"flex-1 flex items-center gap-2 overflow-x-auto no-scrollbar",children:c.map((f,m)=>e.jsxs(r.Fragment,{children:[e.jsx("span",{className:"text-[9px] font-bold text-slate-400 whitespace-nowrap",children:f}),m<c.length-1&&e.jsx("span",{className:"text-slate-700",children:"→"})]},m))})]},a)})}):e.jsx("div",{className:"p-4 rounded-xl bg-white/5 border border-white/5 border-dashed flex items-center justify-center",children:e.jsx("span",{className:"text-[9px] font-black text-slate-600 uppercase tracking-widest italic",children:"No Critical Dependency Chains Detected"})})]})]}),e.jsxs("div",{className:"flex items-center gap-6 pt-4 border-t border-white/5",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-600 uppercase tracking-widest",children:"Compute Load"}),e.jsx("span",{className:"text-[9px] font-mono text-emerald-500",children:s.computeLoad||"IDLE"})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-600 uppercase tracking-widest",children:"Neural Latency"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:s.latency||"0ms"})]})]})]}):null},kt=({data:s,variant:A})=>{if(!s)return null;let n={label:"Generic Matrix",details:"Raw payload detected"};try{const a=typeof s=="string"?JSON.parse(s):s;if(A==="MAESTRO"){const c=(a.pendingTasks||a.tasks||[]).length,f=(a.resources||a.team||[]).length;n={label:"Maestro Orchestration Matrix",details:`${c} Tasks • ${f} Resources`}}else A==="ANALYST"?n={label:"Analyst Data Stream",details:Array.isArray(a)?`${a.length} Records`:"Structured Dataset"}:A==="SENTINEL"?n={label:"Sentinel Telemetry Logs",details:typeof a=="string"?`${a.length} chars`:"Log Stream"}:n={label:"Neural Input Matrix",details:typeof a=="object"?"Structured Data":"Raw Text"}}catch{}return e.jsxs("div",{className:"mt-2 p-3 rounded-xl bg-black/20 border border-white/5 flex items-center gap-3 group hover:border-amber-500/20 transition-all cursor-default",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center border border-amber-500/20",children:e.jsx(P.Database,{size:14,className:"text-amber-500"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[10px] font-black text-amber-500/80 uppercase tracking-widest truncate",children:n.label}),e.jsx("div",{className:"text-[9px] text-slate-500 font-mono",children:n.details})]})]})},Xt=({isOpen:s,onClose:A,input:n,prompt:a,output:c,variant:f})=>{if(!s)return null;const m=n&&(Array.isArray(n)&&n.length>0||typeof n=="object"&&Object.keys(n).length>0);return e.jsxs("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center p-4 sm:p-10",children:[e.jsx("div",{className:"absolute inset-0 bg-[#020210]/80 backdrop-blur-xl",onClick:A}),e.jsxs("div",{className:"relative w-full h-full max-w-6xl eva-holographic-glass bg-[#0a0a20]/40 rounded-3xl border border-white/10 flex flex-col overflow-hidden shadow-[0_0_100px_rgba(99,102,241,0.1)]",children:[e.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center justify-between bg-white/5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-500/10 border border-indigo-500/20 flex items-center justify-center",children:e.jsx(P.Activity,{size:20,className:"text-indigo-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-black text-white uppercase tracking-widest italic",children:"Neural Transfer Comparator"}),e.jsxs("p",{className:"text-[9px] text-slate-500 uppercase font-bold tracking-widest",children:[f||"Universal"," Orchestration • Real-time Trace"]})]})]}),e.jsx("button",{onClick:A,className:"p-2 rounded-xl text-slate-400 hover:text-white hover:bg-white/5 transition-all",children:e.jsx(P.X,{size:20})})]}),e.jsxs("div",{className:"flex-1 flex flex-col md:flex-row overflow-hidden",children:[e.jsxs("div",{className:"flex-1 border-r border-white/5 flex flex-col overflow-hidden bg-black/20",children:[e.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(P.Database,{size:12})," ",m?"Source Matrix":"Generative Prompt"]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-600 uppercase",children:m?"Input Stream":"Instruction"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 eva-agent-scrollbar",children:m?e.jsx("pre",{className:"text-[10px] font-mono text-indigo-200/60 leading-relaxed whitespace-pre-wrap",children:typeof n=="string"?n:JSON.stringify(n,null,2)}):e.jsxs("div",{className:"min-h-full flex flex-col items-center justify-center text-center px-10 py-12",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-amber-500/5 flex items-center justify-center mb-4 border border-amber-500/10",children:e.jsx(P.Sparkles,{size:20,className:"text-amber-500/40"})}),e.jsxs("p",{className:"text-xs text-indigo-200/80 font-medium leading-relaxed italic",children:['"',a||"No instruction context captured",'"']}),e.jsx("div",{className:"mt-4 px-3 py-1 rounded-full bg-amber-500/10 border border-amber-500/20 text-[7px] font-black uppercase tracking-[0.2em] text-amber-500/60",children:"Neural Synthesis Mode Active"})]})})]}),e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden bg-indigo-500/[0.02]",children:[e.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[10px] font-black text-indigo-400 uppercase tracking-widest flex items-center gap-2",children:[e.jsx(P.Sparkles,{size:12})," Neural Synthesis"]}),e.jsx("span",{className:"text-[8px] font-mono text-slate-600 uppercase",children:"Engine Output"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-6 eva-agent-scrollbar",children:f==="MAESTRO"?e.jsx(Ge,{data:c}):f==="STRATEGIST"?e.jsx($e,{data:c}):e.jsx("pre",{className:"text-[10px] font-mono text-emerald-400/80 leading-relaxed whitespace-pre-wrap",children:typeof c=="string"?c:JSON.stringify(c,null,2)})})]})]}),e.jsxs("div",{className:"p-4 border-t border-white/5 flex items-center justify-center gap-8 bg-black/40",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Ground Truth"})]}),e.jsx("div",{className:"w-12 h-[1px] bg-white/10 relative",children:e.jsx(le.motion.div,{className:"absolute top-[-2px] w-1.5 h-1.5 rounded-full bg-indigo-500",animate:{left:["0%","100%","0%"]},transition:{duration:2,repeat:1/0,ease:"easeInOut"}})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-indigo-500 shadow-[0_0_8px_rgba(99,102,241,0.5)]"}),e.jsx("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Synergized Output"})]})]})]})]})},It=({usage:s,rawPayload:A,inputData:n,variant:a,onInspect:c})=>{const[f,m]=r.useState(!1),w=()=>{navigator.clipboard.writeText(JSON.stringify(A,null,2)),m(!0),setTimeout(()=>m(!1),2e3)};return e.jsxs("div",{className:"mt-16 pt-10 pb-4 px-2 border-t border-white/5 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[s&&e.jsxs("div",{className:"flex gap-4 p-2 border-r border-white/5 mr-2",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-500 uppercase tracking-widest",children:"Input Tokens"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:s.inputTokens})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[7px] font-black text-slate-500 uppercase tracking-widest",children:"Output Tokens"}),e.jsx("span",{className:"text-[9px] font-mono text-slate-400",children:s.outputTokens})]})]}),c&&e.jsxs("button",{onClick:c,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-indigo-500/5 border border-indigo-500/10 text-[9px] font-black uppercase tracking-widest text-indigo-400 hover:bg-indigo-500/20 transition-all",children:[e.jsx(P.Activity,{size:12}),"Inspect Neural Transfer"]})]}),e.jsxs("button",{onClick:w,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-white/5 border border-white/10 text-[9px] font-black uppercase tracking-widest text-slate-400 hover:text-amber-500 hover:bg-amber-500/5 hover:border-amber-500/20 transition-all",children:[f?e.jsx(P.Check,{size:12,className:"text-emerald-500"}):e.jsx(P.Copy,{size:12}),f?"Copied":"Copy JSON"]})]})},et={name:"@estevia/evafusion-agent",version:"1.8.9",description:"Premium React-based ChatWizard Agent for EvaFusion Workbench Integration",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",files:["dist"],scripts:{dev:"vite",build:"tsc && vite build",preview:"vite preview"},dependencies:{"framer-motion":"^10.12.16","lucide-react":"^0.244.0",sonner:"^0.3.1"},peerDependencies:{react:"^18.2.0","react-dom":"^18.2.0","@estevia/evafusion-sdk":"^1.6.5"},devDependencies:{"@estevia/evafusion-sdk":"^1.6.5","@types/react":"^18.0.28","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^4.0.0",autoprefixer:"^10.4.14",postcss:"^8.4.24",tailwindcss:"^3.3.2",typescript:"^5.0.2",vite:"^4.3.9","vite-plugin-dts":"^2.3.0"}},Be=Ce.VARIANT_REQUIREMENTS||{ARCHITECT:"OPTIONAL",ANALYST:"MANDATORY",STRATEGIST:"OPTIONAL",RECRUITER:"OPTIONAL",SENTINEL:"MANDATORY",MAESTRO:"HYBRID",COMPLIANCE:"MANDATORY",PULSE:"MANDATORY",NEXUS:"OPTIONAL"},Ht=({onClose:s,onMinimize:A})=>{const n=r.useContext(Ie),[a,c]=r.useState(!1);r.useState(!1);const f=r.useRef(null);if(!n)return null;const{messages:m,input:w,setInput:g,isProcessing:C,activeVariant:N,setActiveVariant:b,handleSend:z,payloadConfig:S,updatePayloadConfig:F,samples:te,selectedSampleId:ae,setSelectedSampleId:$,applySample:k,clearChat:me,isAuthorized:D}=_e(),[v,T]=r.useState(S),[X,ce]=r.useState(N),[u,re]=r.useState(ae),[p,I]=r.useState({isValid:!0,error:null}),[d,O]=r.useState(null),Y=r.useRef(null);r.useEffect(()=>{a&&(T(S),ce(N),re(ae))},[a]),r.useEffect(()=>{const o=Ce.NeuralDataUtils.validatePayload(X,v.data);I(o)},[v.data,X]);const de=o=>{var J;const H=(J=o.target.files)==null?void 0:J[0];if(!H)return;const h=new FileReader;h.onload=se=>{var L;const fe=(L=se.target)==null?void 0:L.result,W=Ce.NeuralDataUtils.parseCSV(fe);T(V=>({...V,data:JSON.stringify(W,null,2)})),re("")},h.readAsText(H)},E=()=>{const o=Ce.NeuralDataUtils.normalizeForWorkbench(X,v.data);T(H=>({...H,data:JSON.stringify(o,null,2)}))},ge=()=>{b(X),F(v),$(u),c(!1)};r.useEffect(()=>{T(o=>({...o,data:null}))},[X]);const ue=[{id:"SOFTWARE_DEV",name:"Software & Cloud"},{id:"FINANCE",name:"Finance & Quants"},{id:"HEALTHCARE",name:"Healthcare & Life"},{id:"MANUFACTURING",name:"Industrial & MFG"},{id:"REAL_ESTATE",name:"Real Estate & Const."},{id:"RETAIL",name:"Retail & Commerce"}],De=()=>{var o;(o=f.current)==null||o.scrollIntoView({behavior:"smooth"})};r.useEffect(()=>{De()},[m,C]);const je=({msg:o})=>{const{content:H,rawPayload:h,usage:J}=o,se=H.split(/(?=### )/g),fe=L=>{const V=L.trim();return V.startsWith("{")&&V.endsWith("}")||V.startsWith("[")&&V.endsWith("]")},W=L=>L.includes("```mermaid")?L.split(/```mermaid([\s\S]*?)```/).map((K,q)=>q%2===1?e.jsx(Se,{chart:K.trim()},q):e.jsx("div",{children:W(K)},q)):L.split(`
60
60
  `).map((V,K)=>{const q=V.trim();if(!q)return e.jsx("div",{className:"h-2"},K);if(q.startsWith("- ")||q.startsWith("* ")||q.match(/^\d+\. /))return e.jsxs("div",{className:"flex gap-2 items-start mb-1.5 pl-2 group",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500/60 mt-1.5 shrink-0 group-hover:scale-125 transition-transform"}),e.jsx("span",{className:"text-[11px] leading-relaxed text-slate-300",children:q.replace(/^- |\* |\d+\. /,"")})]},K);const he=q.split(/(\*\*.*?\*\*)/g);return e.jsx("p",{className:"mb-2 leading-relaxed text-slate-300",children:he.map((_,ve)=>_.startsWith("**")&&_.endsWith("**")?e.jsx("strong",{className:"text-amber-500/90 font-black",children:_.slice(2,-2)},ve):_)},K)});return e.jsxs("div",{className:"space-y-4",children:[se.map((L,V)=>{if(fe(L))return null;if(L.startsWith("### ")){const K=L.split(`
61
61
  `),q=K[0].replace("### ",""),he=K.slice(1).join(`
62
62
  `),_=q.toLowerCase().includes("blueprint"),ve=/^\s*(graph|flowchart|sequenceDiagram|gantt|classDiagram|stateDiagram|erDiagram|pie|journey|C4Context|mindmap|timeline)/i.test(he.trim());return e.jsxs("div",{className:Ae("group relative",_?"p-4 rounded-2xl bg-amber-500/5 border border-amber-500/10 mt-6":""),children:[_&&e.jsx("div",{className:"absolute top-0 right-0 p-2 opacity-20 group-hover:opacity-100 transition-opacity",children:e.jsx(P.Sparkles,{size:12,className:"text-amber-500"})}),e.jsxs("h4",{className:Ae("text-[9px] font-black uppercase tracking-[0.2em] mb-3 flex items-center gap-2",_?"text-amber-500":"text-slate-500"),children:[!_&&e.jsx("div",{className:"w-1 h-3 bg-amber-500/20 rounded-full"}),q,_&&e.jsxs("span",{className:"text-[7px] bg-amber-500/20 px-1.5 py-0.5 rounded text-amber-500 ml-auto",children:["Neural Core v",et.version]})]}),e.jsx("div",{className:Ae("font-sans",_?"font-mono text-[10px] text-amber-500/70":""),children:ve?e.jsx(Se,{chart:he.trim()}):W(he)})]},V)}return e.jsx("div",{children:W(L)},V)}),h&&e.jsxs(e.Fragment,{children:[h.tasks&&e.jsx(zt,{tasks:h.tasks,team:h.team}),h.phases&&e.jsx($e,{data:h}),h.sprints&&e.jsx(Ge,{data:h}),h.chains&&e.jsx(Ge,{data:h}),h.nodes&&e.jsx(Le,{data:h.nodes}),h.metrics&&e.jsx(Le,{data:h.metrics}),Array.isArray(h.data)&&e.jsx(Le,{data:h.data}),h.diagram&&e.jsx(Se,{chart:h.diagram})]}),e.jsx(It,{usage:J,rawPayload:h,inputData:o.inputData,variant:o.variant,onInspect:h?()=>O({input:o.inputData,prompt:o.content,output:h,variant:o.variant}):void 0})]})};return e.jsxs(e.Fragment,{children:[e.jsx(le.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:s,className:"fixed inset-0 bg-black/40 backdrop-blur-sm z-[9990]"}),e.jsxs(le.motion.div,{initial:{x:"100%",opacity:.5},animate:{x:0,opacity:1},exit:{x:"100%",opacity:.5},transition:{type:"spring",damping:25,stiffness:200},className:Ae("fixed top-0 right-0 h-full w-full sm:max-w-[480px] z-[9991] flex flex-col eva-holographic-glass overflow-hidden border-l border-white/10 shadow-2xl",C?"eva-glow-thinking":"eva-glow-listening"),children:[e.jsxs("div",{className:"p-6 flex items-center justify-between shrink-0 bg-[#0a0a20]/90 border-b border-white/5 backdrop-blur-xl",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-500/10 border border-amber-500/20 flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:Ke,alt:"Eva",className:"w-7 h-7 object-contain"})}),e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-black text-white uppercase tracking-widest italic eva-agent-gradient-text",children:["Eva Agent ",e.jsxs("span",{className:"text-indigo-400 font-normal ml-1",children:["v",et.version]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:Ae("w-1.5 h-1.5 rounded-full animate-pulse",D?"bg-emerald-500":"bg-rose-500")}),e.jsx("span",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:D?"Neural Link Active":"Unauthorized Access"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{onClick:me,title:"Clear Neural Context",className:"p-2 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-rose-500/10 transition-all",children:e.jsx(P.Trash2,{size:16})}),e.jsx("button",{onClick:()=>c(!a),className:Ae("p-2 rounded-lg transition-all",a?"bg-amber-500/20 text-amber-500":"text-slate-400 hover:text-white hover:bg-white/5"),children:e.jsx(P.Settings2,{size:16})}),e.jsx("button",{onClick:A,className:"p-2 rounded-lg text-slate-400 hover:text-white hover:bg-white/5 transition-all",children:e.jsx(P.Minimize,{size:16})}),e.jsx("button",{onClick:s,className:"p-2 rounded-lg text-rose-400 hover:text-rose-300 hover:bg-rose-500/10 transition-all",children:e.jsx(P.X,{size:16})})]})]}),e.jsx("div",{className:"px-6 py-2 flex items-center gap-2 overflow-x-auto eva-agent-scrollbar bg-black/20 border-b border-white/5 no-scrollbar",children:["ARCHITECT","STRATEGIST","MAESTRO","ANALYST","PULSE","RECRUITER","SENTINEL","COMPLIANCE"].map(o=>e.jsxs("button",{onClick:()=>b(o),className:Ae("px-3 py-1 rounded-full text-[8px] font-black uppercase tracking-widest transition-all whitespace-nowrap border",N===o?"shadow-[0_0_15px_rgba(212,175,55,0.3)] border-amber-500":"text-slate-400 border-white/5 hover:border-white/20 hover:text-white"),style:{backgroundColor:N===o?"#d4af37":"transparent",color:N===o?"black":void 0},children:[o,Be[o]==="MANDATORY"&&e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500 ml-1.5 shadow-[0_0_5px_rgba(245,158,11,1)]"})]},o))}),e.jsx("div",{className:"flex-1 overflow-y-auto eva-agent-scrollbar p-6 space-y-6 relative",children:D?m.length===0?e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 space-y-8",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 bg-amber-500/5 rounded-full blur-3xl animate-pulse"}),e.jsx(P.Cpu,{size:64,className:"text-amber-500/20 relative z-10"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-lg font-black text-white uppercase tracking-tighter italic",children:"Awaiting Directives"}),e.jsx("p",{className:"text-[9px] text-slate-500 uppercase tracking-[0.2em] font-bold",children:"Invoke Eva Intelligence to process your neural matrix."})]}),e.jsx("div",{className:"grid grid-cols-1 gap-2 w-full max-w-[280px]",children:["Analyze data for anomalies","Synthesize architecture blueprint","Forecast operational trajectory"].map((o,H)=>e.jsx("button",{onClick:()=>z(o),className:"p-3 rounded-xl bg-white/5 border border-white/5 text-[9px] font-black uppercase tracking-widest text-slate-400 hover:text-amber-500 hover:bg-amber-500/5 hover:border-amber-500/20 transition-all text-left",children:o},H))})]}):e.jsxs(e.Fragment,{children:[m.map((o,H)=>e.jsxs("div",{className:Ae("flex flex-col space-y-2",o.role==="user"?"items-end":"items-start"),children:[e.jsx("div",{className:Ae("max-w-[90%] px-7 py-6 rounded-3xl text-[11px] font-medium leading-relaxed whitespace-pre-wrap break-words shadow-xl",o.role==="user"?"bg-gradient-to-br from-amber-500 to-amber-600 text-white rounded-tr-none":"bg-slate-900/80 text-indigo-100/90 border border-white/5 rounded-tl-none backdrop-blur-xl"),style:{color:o.role==="user"?"white":void 0},children:o.role==="user"?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{children:o.content}),o.inputData&&e.jsx(kt,{data:o.inputData,variant:o.variant})]}):e.jsx(je,{msg:o})}),e.jsx("span",{className:"text-[7px] font-black text-slate-500 uppercase tracking-widest px-2",children:o.role==="user"?"Direct Input":`Eva ${o.variant||"Neural"}`})]},H)),C&&e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-6",children:[e.jsxs("div",{className:"relative w-24 h-24",children:[e.jsx(le.motion.div,{className:"absolute inset-0 rounded-full border-2 border-amber-500/10",animate:{scale:[1,1.4,1],opacity:[.1,.3,.1]},transition:{duration:3,repeat:1/0}}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsxs("div",{className:"relative",children:[e.jsx(P.Cpu,{className:"text-amber-500/80",size:32}),e.jsx(le.motion.div,{className:"absolute inset-0 text-amber-500 blur-sm",animate:{opacity:[.2,.6,.2]},transition:{duration:2,repeat:1/0},children:e.jsx(P.Cpu,{size:32})})]})}),e.jsx(le.motion.div,{className:"absolute left-[-20%] right-[-20%] h-[1px] bg-gradient-to-r from-transparent via-amber-500 to-transparent shadow-[0_0_20px_rgba(245,158,11,0.6)] z-10",animate:{top:["10%","90%","10%"]},transition:{duration:2.5,repeat:1/0,ease:"easeInOut"}})]}),e.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] font-black text-amber-500 uppercase tracking-[0.4em] animate-pulse",children:"Neural Synthesis in Progress"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/40 animate-bounce",style:{animationDelay:"0ms"}}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/40 animate-bounce",style:{animationDelay:"150ms"}}),e.jsx("div",{className:"w-1 h-1 rounded-full bg-amber-500/40 animate-bounce",style:{animationDelay:"300ms"}})]})]})]}),e.jsx("div",{ref:f})]}):e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 space-y-4",children:[e.jsx(P.AlertCircle,{size:48,className:"text-rose-500/40 mb-2"}),e.jsx("h4",{className:"text-sm font-black text-white uppercase tracking-widest",children:"Neural Link Restricted"}),e.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-widest leading-relaxed max-w-[240px]",children:"Authentication failed. Please verify your API Key context to re-establish the neural link."})]})}),e.jsx(le.AnimatePresence,{children:a&&e.jsxs(le.motion.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},className:"absolute inset-0 bg-[#0a0a20]/95 backdrop-blur-3xl z-50 flex flex-col border-t border-white/10",children:[e.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center justify-between",children:[e.jsxs("h4",{className:"text-xs font-black text-white uppercase tracking-widest flex items-center gap-2",children:[e.jsx(P.Database,{size:14,className:"text-amber-500"}),"Neural Configuration"]}),e.jsx("button",{onClick:()=>c(!1),className:"text-slate-400 hover:text-white",children:e.jsx(P.X,{size:16})})]}),e.jsxs("div",{className:"flex-1 p-6 space-y-6 overflow-y-auto eva-agent-scrollbar",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest ml-1",children:"Neural Persona (Workbench)"}),e.jsx("select",{value:X,onChange:o=>ce(o.target.value),className:"w-full bg-[#0a0a20] border border-white/10 rounded-xl p-3 text-[10px] font-bold text-white outline-none focus:border-amber-500/40 transition-all appearance-none cursor-pointer",style:{color:"white",backgroundColor:"#0a0a20"},children:["ARCHITECT","STRATEGIST","MAESTRO","ANALYST","PULSE","RECRUITER","SENTINEL","COMPLIANCE"].map(o=>e.jsx("option",{value:o,style:{color:"white",backgroundColor:"#0a0a20"},children:o},o))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest ml-1",children:"Industry Vertical"}),e.jsx("select",{value:v.vertical,onChange:o=>T(H=>({...H,vertical:o.target.value})),className:"w-full bg-[#0a0a20] border border-white/10 rounded-xl p-3 text-[10px] font-bold text-white outline-none focus:border-amber-500/40 transition-all appearance-none cursor-pointer",style:{color:"white",backgroundColor:"#0a0a20"},children:ue.map(o=>e.jsx("option",{value:o.id,style:{color:"white",backgroundColor:"#0a0a20"},children:o.name},o.id))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest ml-1",children:"Focus Mode"}),e.jsxs("select",{value:v.focus,onChange:o=>T(H=>({...H,focus:o.target.value})),className:"w-full bg-[#0a0a20] border border-white/10 rounded-xl p-3 text-[10px] font-bold text-white outline-none focus:border-amber-500/40 transition-all appearance-none cursor-pointer",style:{color:"white",backgroundColor:"#0a0a20"},children:[e.jsx("option",{value:"DISCOVERY",style:{color:"white",backgroundColor:"#0a0a20"},children:"Discovery"}),e.jsx("option",{value:"ROADMAP",style:{color:"white",backgroundColor:"#0a0a20"},children:"Roadmap"}),e.jsx("option",{value:"ORCHESTRATION",style:{color:"white",backgroundColor:"#0a0a20"},children:"Orchestration"}),e.jsx("option",{value:"ANOMALIES",style:{color:"white",backgroundColor:"#0a0a20"},children:"Anomalies"}),e.jsx("option",{value:"FORECAST",style:{color:"white",backgroundColor:"#0a0a20"},children:"Forecast"}),e.jsx("option",{value:"SCORING",style:{color:"white",backgroundColor:"#0a0a20"},children:"Scoring"}),e.jsx("option",{value:"AUDIT",style:{color:"white",backgroundColor:"#0a0a20"},children:"Audit"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest ml-1",children:"Neural Template (Sample)"}),e.jsxs("select",{value:u,onChange:o=>{const H=o.target.value;re(H);const h=ze.find(J=>J.id===H);if(h){let J=h.data;if(h.variant==="MAESTRO"&&h.team&&(h.tasks||h.data)){const se=h.tasks||(typeof h.data=="string"?JSON.parse(h.data):h.data);J={pendingTasks:Array.isArray(se)?se:[],resources:h.team}}T({vertical:h.vertical||"TECH_SaaS",focus:h.focus||"DISCOVERY",data:J}),h.prompt&&g(h.prompt)}},className:"w-full bg-black/40 border border-white/10 rounded-xl px-4 h-11 text-[10px] font-bold text-white outline-none focus:border-amber-500/40 transition-all appearance-none cursor-pointer",children:[e.jsx("option",{value:"",style:{color:"#64748b",backgroundColor:"#0a0a20"},children:"Manual Input (No Template)"}),ze.filter(o=>o.vertical===v.vertical&&o.variant===X).map(o=>e.jsxs("option",{value:o.id,style:{color:"white",backgroundColor:"#0a0a20"},children:[o.name,o.data?" [DATA]":" [PROMPT]"]},o.id))]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P.Database,{size:12,className:"text-amber-500"}),e.jsx("span",{className:"text-[10px] font-black text-slate-500 uppercase tracking-widest",children:"Neural Matrix (JSON)"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("input",{type:"file",accept:".csv",className:"hidden",ref:Y,onChange:de}),e.jsxs("button",{onClick:()=>{var o;return(o=Y.current)==null?void 0:o.click()},className:"flex items-center gap-1.5 px-2 py-1 rounded bg-white/5 border border-white/10 text-[8px] font-black uppercase tracking-widest text-slate-400 hover:text-amber-500 hover:border-amber-500/20 transition-all",children:[e.jsx(P.Upload,{size:10})," Ingest CSV"]}),X==="MAESTRO"&&e.jsxs("button",{onClick:E,className:"flex items-center gap-1.5 px-2 py-1 rounded bg-indigo-500/10 border border-indigo-500/20 text-[8px] font-black uppercase tracking-widest text-indigo-400 hover:bg-indigo-500/20 transition-all",children:[e.jsx(P.Zap,{size:10})," Optimize Maestro"]})]})]}),e.jsx("textarea",{value:v.data?typeof v.data=="string"?v.data:JSON.stringify(v.data,null,2):"",onChange:o=>{T(H=>({...H,data:o.target.value})),re("")},placeholder:'[{"key": "value"}]',className:Ae("w-full bg-black/40 border rounded-xl p-4 text-[10px] font-mono text-indigo-200/60 outline-none h-32 resize-none transition-all",p.isValid?p.warning?"border-amber-500/40":"border-white/10 focus:border-amber-500/40":"border-red-500/40")}),e.jsxs("div",{className:"mt-2 flex items-center justify-between px-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[p.isValid?p.warning?e.jsx(P.AlertTriangle,{size:10,className:"text-amber-500"}):e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}):e.jsx(P.AlertCircle,{size:10,className:"text-red-500"}),e.jsx("span",{className:Ae("text-[8px] font-bold uppercase tracking-widest",p.isValid?p.warning?"text-amber-500":"text-emerald-500":"text-red-500"),children:p.isValid?p.warning?"Validation Warning":"Neural Integrity Established":"Schema Disconnect"})]}),p.schemaDetails&&e.jsx("span",{className:"text-[7px] font-mono text-slate-600 uppercase tracking-tighter truncate max-w-[200px]",children:p.schemaDetails})]}),!p.isValid&&p.error&&e.jsxs("div",{className:"mt-3 p-3 rounded-xl bg-red-500/5 border border-red-500/10 flex items-start gap-2",children:[e.jsx(P.AlertCircle,{size:12,className:"text-red-500 mt-0.5 shrink-0"}),e.jsx("p",{className:"text-[9px] text-red-400/80 leading-relaxed font-medium",children:p.error})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest ml-1",children:"Current Neural Prompt (Preview)"}),e.jsx("div",{className:"w-full bg-amber-500/5 border border-amber-500/10 rounded-xl p-4 text-[10px] font-medium text-slate-300 min-h-[60px] max-h-[120px] overflow-y-auto italic leading-relaxed",children:w||(ae?"Neural template active. Ready for synthesis.":"Type in chat to preview prompt...")})]}),e.jsxs("div",{className:"pt-4 pb-8",children:[e.jsxs("button",{onClick:ge,disabled:Be[X]==="MANDATORY"&&(!v.data||typeof v.data=="string"&&!v.data.trim()),className:Ae("w-full py-4 rounded-xl text-white text-[10px] font-black uppercase tracking-[0.2em] shadow-lg transition-all flex items-center justify-center gap-2",Be[X]==="MANDATORY"&&(!v.data||typeof v.data=="string"&&!v.data.trim())?"bg-white/5 text-white/20 border border-white/10 cursor-not-allowed shadow-none":"bg-amber-500 hover:scale-[1.02] active:scale-[0.98] shadow-amber-500/20"),children:[e.jsx(P.Shield,{size:14}),Be[X]==="MANDATORY"&&(!v.data||typeof v.data=="string"&&!v.data.trim())?"Awaiting Grounding Data":"Confirm Neural Configuration"]}),e.jsx("p",{className:"text-[7px] text-slate-500 text-center mt-3 uppercase tracking-widest font-bold",children:"Settings will be committed to the synthesis engine"})]})]})]})}),e.jsxs("div",{className:"p-6 pb-8 bg-[#0a0a20] border-t border-white/5 relative z-40",children:[Be[N]==="MANDATORY"&&(!S.data||typeof S.data=="string"&&!S.data.trim())&&e.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-[#0a0a20]/80 backdrop-blur-sm px-6 pb-2 animate-in fade-in duration-300",children:e.jsxs("button",{onClick:()=>c(!0),className:"w-full h-12 rounded-xl bg-amber-500/10 border border-amber-500/20 text-amber-500 text-[10px] font-black uppercase tracking-[0.15em] hover:bg-amber-500 hover:text-black transition-all flex items-center justify-center gap-2 shadow-2xl shadow-amber-500/5 group",children:[e.jsx(P.Database,{size:14,className:"group-hover:animate-bounce"}),"Grounding Required: Open Neural Configuration"]})}),e.jsxs("form",{onSubmit:o=>{o.preventDefault(),z()},className:"relative flex items-center gap-3 p-2 rounded-2xl bg-white/5 border border-white/10 group focus-within:border-amber-500/40 focus-within:shadow-[0_0_30px_rgba(212,175,55,0.1)] transition-all duration-500",children:[e.jsx("textarea",{value:w,onChange:o=>g(o.target.value),onKeyDown:o=>{o.key==="Enter"&&!o.shiftKey&&(o.preventDefault(),z())},placeholder:"Invoke neural command...",className:"flex-1 bg-transparent border-none text-white text-[11px] placeholder:text-slate-600 focus:ring-0 min-h-[44px] max-h-[120px] py-3 px-3 resize-none eva-agent-scrollbar outline-none font-medium",disabled:C||!D}),e.jsx("button",{type:"submit",disabled:!w.trim()||C||!D||Be[N]==="MANDATORY"&&(!S.data||typeof S.data=="string"&&!S.data.trim()),className:"w-11 h-11 rounded-xl bg-amber-500 text-white flex items-center justify-center shrink-0 shadow-lg shadow-amber-500/20 disabled:opacity-30 disabled:grayscale transition-all hover:scale-105 active:scale-95",children:e.jsx(P.Send,{size:18,className:"text-white"})})]})]}),e.jsx(Xt,{isOpen:!!d,onClose:()=>O(null),input:d==null?void 0:d.input,prompt:d==null?void 0:d.prompt,output:d==null?void 0:d.output,variant:d==null?void 0:d.variant})]})]})},St={PROD:"https://evafusion-live.esteviatech.com",DEV:"https://api-dev.protrack.esteviatech.com",QA:"https://api-qa.protrack.esteviatech.com",LOCAL:"http://localhost:5001"},Lt=s=>{const{apiKey:A,baseUrl:n,environment:a="PROD",persist:c=!0,theme:f="dark"}=s,[m,w]=r.useState(!1),[g,C]=r.useState(!1),N=r.useMemo(()=>{if(!A)return null;const b=n||St[a];return new Ce.EvaFusionClient({apiKey:A,baseUrl:b,environment:a})},[A,n,a]);return e.jsx(Ie.Provider,{value:{client:N,isOpen:m,setIsOpen:w,isMinimized:g,setIsMinimized:C,config:s},children:e.jsxs("div",{className:"eva-fusion-agent-root",children:[e.jsx(Et,{position:"top-center",richColors:!0}),e.jsx(le.AnimatePresence,{children:(!m||g)&&e.jsx(Mt,{onClick:()=>{w(!0),C(!1)}})}),e.jsx(le.AnimatePresence,{children:m&&!g&&e.jsx(Ht,{onClose:()=>w(!1),onMinimize:()=>C(!0)})})]})})},xa="";ie.EvaFusionAgent=Lt,ie.useEvaAgent=_e,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})});
package/dist/index.mjs CHANGED
@@ -2133,7 +2133,7 @@ const Ue = ({ chart: n }) => {
2133
2133
  }
2134
2134
  )
2135
2135
  ] });
2136
- }, Oa = "@estevia/evafusion-agent", Ta = "1.8.8", Ma = "Premium React-based ChatWizard Agent for EvaFusion Workbench Integration", Ea = "dist/index.js", Ra = "dist/index.mjs", za = "dist/index.d.ts", ka = [
2136
+ }, Oa = "@estevia/evafusion-agent", Ta = "1.8.9", Ma = "Premium React-based ChatWizard Agent for EvaFusion Workbench Integration", Ea = "dist/index.js", Ra = "dist/index.mjs", za = "dist/index.d.ts", ka = [
2137
2137
  "dist"
2138
2138
  ], Xa = {
2139
2139
  dev: "vite",
@@ -2146,9 +2146,9 @@ const Ue = ({ chart: n }) => {
2146
2146
  }, Ha = {
2147
2147
  react: "^18.2.0",
2148
2148
  "react-dom": "^18.2.0",
2149
- "@estevia/evafusion-sdk": "^1.6.4"
2149
+ "@estevia/evafusion-sdk": "^1.6.5"
2150
2150
  }, La = {
2151
- "@estevia/evafusion-sdk": "^1.6.4",
2151
+ "@estevia/evafusion-sdk": "^1.6.5",
2152
2152
  "@types/react": "^18.0.28",
2153
2153
  "@types/react-dom": "^18.0.11",
2154
2154
  "@vitejs/plugin-react": "^4.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estevia/evafusion-agent",
3
- "version": "1.8.8",
3
+ "version": "1.8.9",
4
4
  "description": "Premium React-based ChatWizard Agent for EvaFusion Workbench Integration",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -21,10 +21,10 @@
21
21
  "peerDependencies": {
22
22
  "react": "^18.2.0",
23
23
  "react-dom": "^18.2.0",
24
- "@estevia/evafusion-sdk": "^1.6.4"
24
+ "@estevia/evafusion-sdk": "^1.6.5"
25
25
  },
26
26
  "devDependencies": {
27
- "@estevia/evafusion-sdk": "^1.6.4",
27
+ "@estevia/evafusion-sdk": "^1.6.5",
28
28
  "@types/react": "^18.0.28",
29
29
  "@types/react-dom": "^18.0.11",
30
30
  "@vitejs/plugin-react": "^4.0.0",