diff --git a/strix/viewer/viewer_dist/assets/index-ApSY-bBm.js b/strix/viewer/viewer_dist/assets/index-DMIqFbyp.js similarity index 99% rename from strix/viewer/viewer_dist/assets/index-ApSY-bBm.js rename to strix/viewer/viewer_dist/assets/index-DMIqFbyp.js index 8d9073fb..403b56df 100644 --- a/strix/viewer/viewer_dist/assets/index-ApSY-bBm.js +++ b/strix/viewer/viewer_dist/assets/index-DMIqFbyp.js @@ -487,6 +487,6 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Ht=ye,ft=ze),Qe===void ... more content available`:"")})})()]})}function q9({args:e,result:t}){const i=(e.method??"GET").toUpperCase(),a=e.url??"",s=e.headers,l=e.body,c=typeof l=="string"?l:"",d=t,h=d?d.error??null:null,f=d?d.status_code??null:null,m=d?d.response_time_ms??null:null,p=d?d.body:null,y=typeof p=="string"?p:null;return g.jsxs("div",{children:[g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:"request"}),g.jsxs("div",{className:"mt-1.5 font-mono text-[13px] space-y-0.5",children:[g.jsxs("div",{children:[g.jsx("span",{className:"text-[#555] select-none mr-1",children:">>"}),g.jsx("span",{className:`font-bold ${RN[i]??"text-[#888]"}`,children:i}),g.jsx("span",{className:"text-[#888] ml-1 break-all",children:Fi(a,180)})]}),s&&typeof s=="object"&&Object.entries(s).slice(0,5).map(([x,_])=>g.jsxs("div",{className:"text-[#555] pl-5",children:[x,": ",Jm(String(_),150)]},x))]}),c&&g.jsx(xr,{className:"text-[#888]",children:ep(c,4)}),h&&g.jsx("div",{className:"text-red-400/70 text-[13px] mt-1.5",children:Jm(h,150)}),f!=null&&g.jsxs("div",{className:"font-mono text-[13px] mt-1.5",children:[g.jsx("span",{className:"text-[#555] select-none mr-1",children:"<<"}),g.jsx("span",{className:`font-bold ${Jp(f)}`,children:f}),m!=null&&g.jsxs("span",{className:"text-[#555] ml-2",children:[m,"ms"]})]}),y&&g.jsx(xr,{className:"text-[#666]",children:ep(y,6)})]})}function P9({args:e,result:t}){const i=e.request_id,a=e.modifications,s=t,l=s?s.status_code??null:null,c=s?s.response_time_ms??null:null,d=s?s.body:null,h=typeof d=="string"?d:null;return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:"repeating request"}),i!=null&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["#",i]})]}),a&&typeof a=="object"&&Object.keys(a).length>0&&g.jsx("div",{className:"mt-1.5 font-mono text-[13px] space-y-0.5",children:Object.entries(a).slice(0,5).map(([f,m])=>g.jsxs("div",{children:[g.jsxs("span",{className:"text-orange-400/60",children:[f,":"]})," ",g.jsx("span",{className:"text-[#777]",children:Jm(typeof m=="string"?m:JSON.stringify(m),150)})]},f))}),l!=null&&g.jsxs("div",{className:"font-mono text-[13px] mt-1.5",children:[g.jsx("span",{className:"text-[#555] select-none mr-1",children:"<<"}),g.jsx("span",{className:`font-bold ${Jp(l)}`,children:l}),c!=null&&g.jsxs("span",{className:"text-[#555] ml-2",children:[c,"ms"]})]}),h&&g.jsx(xr,{className:"text-[#666]",children:ep(h,5)})]})}const F9={get:"getting",list:"listing",create:"creating",update:"updating",delete:"deleting"};function G9({args:e}){const t=e.action??"",i=e.scope_name??"",a=F9[t]??(t||"managing");return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("span",{className:"text-purple-400/80 font-semibold text-sm",children:[a," proxy scope"]}),i&&g.jsx("span",{className:"text-[#888] text-[13px]",children:Fi(i,50)})]})}function V9({args:e}){const t=e.parent_id;return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:"listing sitemap"}),t&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["under #",Fi(String(t),20)]})]})}function Y9({args:e}){const t=e.entry_id;return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:"viewing sitemap entry"}),t&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["#",Fi(String(t),20)]})]})}function X9(e){switch(e.toolName){case"list_requests":return g.jsx(H9,{...e});case"view_request":return g.jsx($9,{...e});case"send_request":return g.jsx(q9,{...e});case"repeat_request":return g.jsx(P9,{...e});case"scope_rules":return g.jsx(G9,{...e});case"list_sitemap":return g.jsx(V9,{...e});case"view_sitemap_entry":return g.jsx(Y9,{...e});default:return g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:e.toolName.replace(/_/g," ")})}}function K9({args:e}){const t=e.thought??e.content??"";return t?g.jsxs("div",{children:[g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:"Agent is thinking"}),g.jsx("div",{className:"mt-1.5 italic text-[#888]",children:g.jsx(Ln,{text:t,maxLines:20})})]}):null}function Z9({toolName:e,args:t}){if(e==="create_agent"){const i=t.name??t.agent_name??"",a=t.task??"";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-cyan-400/80 font-semibold text-sm",children:"spawning"}),i&&g.jsx("span",{className:"text-cyan-400 font-semibold text-sm",children:i})]}),a&&g.jsx("div",{className:"mt-1.5",children:g.jsx(Ln,{text:a,maxLines:15})})]})}if(e==="agent_finish"){const i=t.result_summary??"",a=t.success,s=t.findings,l=Array.isArray(s)?s:void 0;return g.jsxs("div",{children:[g.jsx("span",{className:`font-semibold text-sm ${a===!1?"text-red-400/80":"text-emerald-400/80"}`,children:a===!1?"Agent failed":"Agent completed"}),i&&g.jsx("div",{className:"mt-1.5",children:g.jsx(Ln,{text:i,maxLines:20})}),l&&l.length>0&&g.jsx("div",{className:"mt-1.5 space-y-0.5",children:l.map((c,d)=>g.jsxs("div",{className:"text-[13px] text-[#888]",children:[g.jsx("span",{className:"text-red-400/50 mr-1",children:"•"}),typeof c=="string"?c:JSON.stringify(c)]},d))})]})}if(e==="send_message_to_agent"){const i=t.message??"",a=t.target_agent_id??t.agent_id??"";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-cyan-400/80 font-semibold text-sm",children:"message"}),a&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["to ",a.slice(0,16)]})]}),i&&g.jsx("div",{className:"mt-1.5",children:g.jsx(Ln,{text:i,maxLines:20})})]})}if(e==="wait_for_message"){const i=t.reason??"";return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-cyan-400/80 font-semibold text-sm",children:"waiting"}),i&&g.jsx("span",{className:"text-[#888] text-[13px] truncate",children:i})]})}if(e==="stop_agent"){const i=t.target_agent_id??"",a=t.cascade!==!1,s=t.reason??"";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[g.jsx("span",{className:"text-red-400/80 font-semibold text-sm",children:"stopping"}),i&&g.jsx("span",{className:"text-[#888] text-[13px]",children:i.slice(0,16)}),a&&g.jsx("span",{className:"text-[#555] text-[13px] italic",children:"+ descendants"})]}),s&&g.jsx("div",{className:"mt-1.5 text-[#888] text-[13px]",children:s})]})}return e==="view_agent_graph"?g.jsx("span",{className:"text-cyan-400/80 font-semibold text-sm",children:"viewing agents graph"}):g.jsx("span",{className:"text-cyan-400/80 font-semibold text-sm",children:e.replace(/_/g," ")})}function Q9({args:e,result:t}){const i=e.query??e.search_query??"",a=t,s=a?a.content??null:null,l=a&&!a.success?a.message??null:null;return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"Searching the web"}),i&&g.jsx("div",{className:"text-[#888] text-[13px] mt-0.5",children:i}),l&&g.jsx("div",{className:"text-red-400/70 text-[13px] mt-1.5",children:l}),s&&g.jsx("div",{className:"mt-2",children:g.jsx(Ln,{text:s,maxLines:15})})]})}const W9=50,V1=200,Y1=25,X1=24,J9=/\x1b(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~]|\][^\x07]*\x07)/g,eU=/\.\.\. \[(stdout|stderr|result|output|error) truncated at \d+k? chars\]/g;function tU(e){return e.replace(J9,"")}function _m(e){const t=tU(e);return t.length>V1?t.slice(0,V1-3)+"...":t}function nU(e){return e.replace(eU,"").trim()}function iU(e){const t=e.split(` `);if(t.length<=W9)return t.map(_m).join(` `);const i=t.length-Y1-X1;return[...t.slice(0,Y1).map(_m),`... ${i} lines truncated ...`,...t.slice(-X1).map(_m)].join(` -`)}function rU({args:e,result:t}){const i=e.action??"",a=e.code??e.script??"",s=t;let l=null;s&&typeof s=="object"?l=typeof s.stdout=="string"?s.stdout:null:typeof s=="string"&&(l=s);const c=i==="new_session"?"new session":i==="close"?"close session":i==="list_sessions"?"list sessions":null,d=l?iU(nU(l)):null;return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-yellow-400/80 font-semibold text-sm",children:"Python"}),c&&g.jsx("span",{className:"text-[#888] text-[13px]",children:c})]}),a&&g.jsx(Qp,{code:a,language:"python",collapsible:!0}),d&&g.jsx(xr,{className:"text-[#666]",children:d})]})}function aU({args:e}){const t=e.targets,a=(Array.isArray(t)?t:[]).map(s=>typeof s=="object"&&s?s.original??null:null).filter(Boolean);return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Starting penetration test"}),a.length===1&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["on ",a[0]]})]}),a.length>1&&g.jsx("div",{className:"mt-1.5 space-y-0.5",children:a.map((s,l)=>g.jsxs("div",{className:"text-[13px] text-[#888]",children:[g.jsx("span",{className:"text-[#555] mr-1",children:"•"}),s]},l))})]})}function sU({args:e}){const t=e.name??"Unknown Agent",i=e.task??"";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-[#888] text-[13px]",children:"subagent"}),g.jsx("span",{className:"text-purple-400 font-semibold text-sm",children:t})]}),i&&g.jsx("div",{className:"mt-1.5",children:g.jsx(Ln,{text:i,maxLines:15})})]})}function oU(e){return e.toolName==="subagent_start_info"?g.jsx(sU,{...e}):g.jsx(aU,{...e})}function lU({args:e}){const t=e.executive_summary??"",i=e.methodology??"",a=e.technical_analysis??"",s=e.recommendations??"";return g.jsxs("div",{className:"space-y-3",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Penetration test completed"}),t&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Executive Summary"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:t,maxLines:25})})]}),i&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Methodology"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:i,maxLines:25})})]}),a&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Technical Analysis"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:a,maxLines:25})})]}),s&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Recommendations"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:s,maxLines:25})})]}),!t&&!i&&!a&&!s&&g.jsx("div",{className:"text-[#555] text-xs",children:"Generating final report..."})]})}function cU({toolName:e,args:t,result:i}){if(e==="create_note"){const a=t.title??"",s=t.content??"",l=t.category??"general";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note"}),g.jsxs("span",{className:"text-[#555] text-[13px]",children:["(",l,")"]})]}),a&&g.jsx("div",{className:"mt-1.5 text-[#999] text-[13px]",children:a}),s&&g.jsx("div",{className:"mt-1",children:g.jsx(Os,{text:s})})]})}if(e==="delete_note")return g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note removed"});if(e==="update_note"){const a=t.title??"",s=t.content??"";return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note updated"}),a&&g.jsx("div",{className:"mt-1.5 text-[#999] text-[13px]",children:a}),s&&g.jsx("div",{className:"mt-1",children:g.jsx(Os,{text:s})})]})}if(e==="get_note"){const a=i,s=a&&typeof a=="object"&&a.success?a.note:void 0;return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note read"}),s&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mt-1.5 text-[#999] text-[13px]",children:[s.title??"(untitled)",g.jsxs("span",{className:"text-[#555] ml-1",children:["(",s.category??"general",")"]})]}),s.content&&g.jsx("div",{className:"mt-1",children:g.jsx(Os,{text:s.content})})]})]})}if(e==="list_notes"){const a=i;let s=[];if(a&&typeof a=="object"&&a.success){const l=a.notes;s=Array.isArray(l)?l:[]}return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"notes"}),s.length>0?g.jsx("div",{className:"mt-1.5 space-y-0.5",children:s.map((l,c)=>g.jsxs("div",{className:"text-[13px]",children:[g.jsx("span",{className:"text-[#555] mr-1",children:"-"}),g.jsx("span",{className:"text-[#999]",children:l.title??"(untitled)"}),g.jsxs("span",{className:"text-[#555] ml-1",children:["(",l.category??"general",")"]}),l.content&&g.jsx("div",{className:"ml-3",children:g.jsx(Os,{text:l.content})})]},c))}):g.jsx("div",{className:"mt-1 text-[#555] text-xs",children:"No notes"})]})}return g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note"})}const uU={create_todo:{label:"Task added",Icon:vT},list_todos:{label:"Plan",Icon:g2},update_todo:{label:"Task updated",Icon:xT},mark_todo_done:{label:"Task completed",Icon:c_},mark_todo_pending:{label:"Task reopened",Icon:MT},delete_todo:{label:"Task removed",Icon:UT}};function dU({status:e}){return e==="done"?g.jsx(c_,{className:"w-3.5 h-3.5 text-emerald-400/70 shrink-0"}):e==="in_progress"?g.jsx(k2,{className:"w-3.5 h-3.5 text-purple-400/70 shrink-0 animate-pulse"}):g.jsx(A2,{className:"w-3.5 h-3.5 text-[#444] shrink-0"})}function fU({todos:e,highlightId:t}){return g.jsx("div",{className:"space-y-0",children:e.map((i,a)=>{const s=i.status??"pending",l=t&&i.id===t;return g.jsxs("div",{className:`flex items-start gap-2.5 py-1.5 px-2 -mx-2 rounded-md transition-colors ${l?"bg-purple-500/[0.08]":""}`,children:[g.jsx("div",{className:"mt-[1px]",children:g.jsx(dU,{status:s})}),g.jsx("span",{className:`text-[13px] leading-snug ${s==="done"?"text-[#555] line-through":s==="in_progress"?"text-[#bbb]":"text-[#999]"}`,children:i.title??"(untitled)"})]},i.id??a)})})}function hU({toolName:e,args:t,result:i}){const a=uU[e]??{label:"Plan",Icon:kT},s=a.Icon,l=i;if(typeof l=="string"&&l.trim())return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}),g.jsx("div",{className:"mt-1.5 text-[#888] text-[13px]",children:l.trim()})]});let c=[],d=null,h;if(l&&typeof l=="object"){if(d=l.error??null,l.success){const m=l.todos;c=Array.isArray(m)?m:[]}h=l.id??t.todo_id??void 0}const f=e!=="list_todos"?h:void 0;return c.length===0&&!d?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}):g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}),d&&g.jsx("div",{className:"text-red-400/70 text-[13px] mb-2",children:d}),c.length>0&&g.jsx("div",{className:"rounded-lg border border-white/[0.06] bg-white/[0.015] px-3 py-2",children:g.jsx(fU,{todos:c,highlightId:f})})]})}function K1(e){if(e==null)return null;if(typeof e=="string")return e.trim()?e:null;if(typeof e=="object"){const t=e;if(typeof t.__raw=="string")return t.__raw;if(Object.keys(t).length===0)return null;try{return JSON.stringify(e,null,2)}catch{return String(e)}}return String(e)}function DN({toolName:e,args:t,result:i}){const a=K1(t),s=K1(i);return g.jsxs("div",{children:[g.jsx("span",{className:"text-[#888] font-semibold text-sm",children:e.replace(/_/g," ")}),a&&g.jsx(xr,{className:"text-[#777]",children:a}),s&&g.jsx(xr,{className:"text-[#666]",children:s})]})}function mU({args:e}){const i=(e.skills??"").split(",").map(a=>a.trim()).filter(Boolean);return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Loading skill"}),i.length>0&&g.jsx("span",{className:"text-[#888] text-[13px]",children:i.join(", ")})]})}const Vu={terminal:{renderer:k9,icon:g_,color:"text-emerald-400"},python:{renderer:rU,icon:O2,color:"text-yellow-400"},browser:{renderer:A9,icon:rp,color:"text-blue-400"},filesystem:{renderer:C9,icon:d_,color:"text-sky-400"},proxy:{renderer:X9,icon:zs,color:"text-purple-400",match:/request|sitemap|scope/},reporting:{renderer:U9,icon:DT,color:"text-red-400"},thinking:{renderer:K9,icon:a_,color:"text-purple-400"},agents:{renderer:Z9,icon:np,color:"text-cyan-400",match:/agent/},search:{renderer:Q9,icon:p_,color:"text-amber-400"},lifecycle:{renderer:oU,icon:f_,color:"text-emerald-400"},notes:{renderer:cU,icon:jT,color:"text-amber-400",match:/note/},skills:{renderer:mU,icon:cu,color:"text-emerald-400"},todos:{renderer:hU,icon:aT,color:"text-purple-400",match:/todo/},telemetry:{renderer:DN,icon:cu,color:"text-[#555]"}},pU={terminal:["exec_command","write_stdin","terminal_execute"],python:["python_action"],browser:["browser_action"],filesystem:["apply_patch","view_image","str_replace_editor","list_files","search_files"],proxy:["list_requests","view_request","repeat_request","list_sitemap","view_sitemap_entry","scope_rules","send_request"],reporting:["create_vulnerability_report"],thinking:["think"],agents:["create_agent","agent_finish","send_message_to_agent","wait_for_message","view_agent_graph","stop_agent"],search:["web_search"],lifecycle:["scan_start_info","subagent_start_info","finish_scan"],notes:["create_note","delete_note","update_note","list_notes","get_note"],skills:["load_skill"],todos:["create_todo","list_todos","update_todo","mark_todo_done","mark_todo_pending","delete_todo"],telemetry:["sandbox_error_details","llm_error_details"]},gU=Object.fromEntries(Object.entries(pU).flatMap(([e,t])=>t.map(i=>[i,e]))),bU={finish_scan:lU,apply_patch:j9,view_image:I9},xU={agent_finish:{icon:f_,color:"text-cyan-400"},send_message_to_agent:{icon:$x,color:"text-cyan-400"},wait_for_message:{icon:$x,color:"text-cyan-400"},view_agent_graph:{icon:B2,color:"text-cyan-400"},stop_agent:{icon:r_,color:"text-red-400"},scan_start_info:{icon:L2,color:"text-emerald-400"},subagent_start_info:{icon:np,color:"text-purple-400"},view_image:{icon:J2,color:"text-sky-400"}},yU=Vu.telemetry;function LN(e){var i;const t=gU[e];if(t)return t;for(const[a,s]of Object.entries(Vu))if((i=s.match)!=null&&i.test(e))return a;return null}function vU(e){const t=bU[e];if(t)return t;const i=LN(e);return i?Vu[i].renderer:DN}function _U(e){const t=xU[e];if(t)return t;const i=LN(e),a=i?Vu[i]:yU;return{icon:a.icon,color:a.color}}const wU=30;function EU({role:e,content:t}){const i=e==="user"||e==="human";return g.jsxs("div",{children:[g.jsx("span",{className:`font-semibold text-sm ${i?"text-blue-400/80":"text-purple-400/80"}`,children:i?"User":"Thinking"}),g.jsx("div",{className:"mt-1.5 italic text-[#888]",children:g.jsx(Ln,{text:t,maxLines:wU})})]})}class NU extends re.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?g.jsx("span",{className:"text-[#555] font-semibold text-sm",children:this.props.toolName.replace(/_/g," ")}):this.props.children}}function SU(e){const t=vU(e.toolName);return g.jsx(NU,{toolName:e.toolName,children:g.jsx(t,{...e})})}function zN(e){if(e==null||typeof e!="string")return e;const t=e.trim();if(!t)return e;try{return JSON.parse(t)}catch{}try{const i=t.replace(/\bNone\b/g,"null").replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/'/g,'"');return JSON.parse(i)}catch{return{__raw:e}}}function jN(e){const t=zN(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:t==null?{}:{__raw:typeof t=="string"?t:JSON.stringify(t)}}function Z1(e){const t=/(\d+)$/.exec(e);return t?parseInt(t[1],10):0}function IN(e){var i;const t=(i=e.data)==null?void 0:i.role;return e.type==="chat"&&(t==="user"||t==="human")}const kU={completed:"text-emerald-400 border-emerald-500/30 bg-emerald-500/10",running:"text-blue-400 border-blue-500/30 bg-blue-500/10",waiting:"text-yellow-400 border-yellow-500/30 bg-yellow-500/10",stopped:"text-[#aaa] border-[#333] bg-[#1a1a1a]",crashed:"text-red-400 border-red-500/30 bg-red-500/10",failed:"text-red-400 border-red-500/30 bg-red-500/10"};function TU(e){return e==="completed"?"completed":e==="running"?"running":e==="failed"||e==="crashed"?"failed":e}function AU(e,t){var d;const i=new Map;for(const h of e)if(h.parent_id){const f=i.get(h.parent_id)??[];f.push(h.id),i.set(h.parent_id,f)}const a=new Map,s=new Map,l=new Map;for(const h of t)if(h.type==="tool"){if(a.set(h.agent_id,(a.get(h.agent_id)??0)+1),((d=h.data)==null?void 0:d.tool_name)==="create_agent"){const f=jN(h.data.args),m=f.name??f.agent_name??"",p=f.task??"";m&&p&&l.set(m,p)}}else IN(h)||s.set(h.agent_id,(s.get(h.agent_id)??0)+1);const c=new Map;for(const h of e)c.set(h.id,{id:h.id,name:h.name,task:l.get(h.name)??"",status:TU(h.status),parentId:h.parent_id,children:i.get(h.id)??[],createdAt:h.created_at,toolCount:a.get(h.id)??0,messageCount:s.get(h.id)??0});return c}function CU({agent:e,events:t,showHeader:i=!0}){const a=re.useMemo(()=>t.filter(c=>c.agent_id===e.id&&!IN(c)).sort((c,d)=>Z1(c.id)-Z1(d.id)),[t,e.id]),s=a.filter(c=>c.type==="tool").length,l=a.length-s;return g.jsxs("div",{children:[i&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[g.jsx("span",{className:"text-base font-semibold text-white truncate",children:e.name}),g.jsx("span",{className:`flex-shrink-0 text-xs font-medium capitalize px-2 py-0.5 rounded-full border ${kU[e.status]??"text-[#aaa] border-[#333] bg-[#1a1a1a]"}`,children:e.status}),g.jsx("span",{className:"font-mono text-xs text-[#555]",children:e.id})]}),g.jsxs("p",{className:"text-xs text-[#666] mb-4",children:[l," message",l===1?"":"s"," · ",s," tool call",s===1?"":"s"]})]}),a.length===0?g.jsx("p",{className:"text-sm text-[#666]",children:"No recorded activity for this agent."}):g.jsx("div",{className:"py-1",children:a.map((c,d)=>{var N,S,w,k,E,O;const h=d===a.length-1,f=c.type==="tool",m=f?String(((N=c.data)==null?void 0:N.tool_name)??"tool"):"",p=f?"":String(((S=c.data)==null?void 0:S.role)??"assistant");let y,x;if(f){const I=_U(m);y=I.icon,x=I.color}else{const I=p==="user"||p==="human";y=I?np:a_,x=I?"text-blue-400":"text-purple-400"}const _=f?String(((w=c.data)==null?void 0:w.status)??"completed"):"completed";return g.jsxs("div",{className:"flex gap-3",children:[g.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[g.jsx("div",{className:`w-[30px] h-[30px] rounded-full bg-black border flex items-center justify-center shrink-0 ${f&&_==="running"?"border-blue-500/40 animate-pulse":f&&_==="failed"?"border-red-500/30":"border-[#222]"}`,children:g.jsx(y,{className:`w-3.5 h-3.5 ${x}`})}),!h&&g.jsx("div",{className:"w-px flex-1 bg-[#1a1a1a] mt-1"})]}),g.jsx("div",{className:"flex-1 min-w-0 pt-[5px] pb-6",children:f?g.jsx(SU,{toolName:m,args:jN((k=c.data)==null?void 0:k.args),result:zN((E=c.data)==null?void 0:E.result)??null,status:_}):g.jsx(EU,{role:p,content:String(((O=c.data)==null?void 0:O.content)??"")})})]},c.id)})})]})}const MU={completed:"bg-emerald-400",running:"bg-blue-400",waiting:"bg-yellow-400",stopped:"bg-[#888]",crashed:"bg-red-400",failed:"bg-red-400"},OU=80;function RU({agent:e,events:t,onClose:i}){const a=re.useRef(null),s=re.useRef(!1),l=re.useCallback(()=>{const c=a.current;c&&(s.current=c.scrollHeight-c.scrollTop-c.clientHeight{const c=a.current;!c||!s.current||requestAnimationFrame(()=>{c.scrollTo({top:c.scrollHeight,behavior:"smooth"})})},[t]),re.useEffect(()=>{const c=h=>{h.key==="Escape"&&i()};document.addEventListener("keydown",c);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=d}},[i]),g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4 sm:p-8",onClick:i,role:"dialog","aria-modal":"true","aria-label":`Agent ${e.name}`,children:g.jsxs("div",{className:"relative flex h-[80vh] w-full max-w-5xl flex-col rounded-xl border border-[#222] bg-[#0a0a0a] shadow-2xl",onClick:c=>c.stopPropagation(),children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[#222] px-5 py-3.5",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("span",{className:`h-2 w-2 flex-shrink-0 rounded-full ${MU[e.status]??"bg-[#888]"}`}),g.jsx("span",{className:"truncate text-sm font-semibold text-white",children:e.name}),g.jsx("span",{className:"flex-shrink-0 font-mono text-xs text-[#555]",children:e.id})]}),g.jsx("button",{type:"button",onClick:i,"aria-label":"Close",className:"flex-shrink-0 rounded-md p-1 text-[#888] transition-colors hover:bg-[#1a1a1a] hover:text-white",children:g.jsx(XT,{className:"h-4 w-4"})})]}),g.jsx("div",{ref:a,onScroll:l,className:"flex-1 overflow-y-auto p-5",children:g.jsx(CU,{agent:e,events:t,showHeader:!1})}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t border-[#222] px-5 py-3",children:[g.jsx("span",{className:"text-xs text-[#888]",children:"Steer agents live from your terminal."}),g.jsx("a",{href:gr(Vs,"steer_agent"),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("steer_agent","agents"),className:"text-xs font-medium text-[#60a5fa] hover:underline",children:"Upgrade to Pro to steer agents from the web →"})]})]})})}class Tu extends Error{constructor(t){super(t),this.name="RunParseError"}}const DU=["critical","high","medium","low"];function LU(e){const t=String(e??"").toLowerCase().trim();return DU.includes(t)?t:"low"}function zU(e){if(typeof e=="string"&&e.trim()){const t=e.trim().replace(" UTC","Z").replace(" ","T"),i=new Date(t);if(!Number.isNaN(i.getTime()))return i.toISOString();const a=new Date(e);if(!Number.isNaN(a.getTime()))return a.toISOString()}return new Date().toISOString()}function Ot(e){return typeof e=="string"&&e.length>0?e:null}function jU(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function BN(e,t){try{return JSON.parse(e)}catch{throw new Tu(`${t} isn't valid JSON. Make sure you selected a Strix run directory.`)}}function IU(e){const t=BN(e,"run.json");if(!t||typeof t!="object"||Array.isArray(t))throw new Tu("run.json is not an object.");const i=t,a=[],s=i.targets_info;if(Array.isArray(s)){for(const x of s)if(x&&typeof x=="object"){const _=x.original;typeof _=="string"&&_&&a.push(_)}}const l=Ot(i.start_time),c=Ot(i.end_time);let d=null;if(l&&c){const x=new Date(l).getTime(),_=new Date(c).getTime();!Number.isNaN(x)&&!Number.isNaN(_)&&_>=x&&(d=Math.round((_-x)/1e3))}let h=null,f=null,m=null,p=null;const y=i.scan_results;if(y&&typeof y=="object"){const x=y;h=Ot(x.executive_summary),f=Ot(x.technical_analysis),m=Ot(x.methodology),p=Ot(x.recommendations)}return{runId:Ot(i.run_id),runName:Ot(i.run_name),targets:a,scanMode:Ot(i.scan_mode),status:Ot(i.status),startTime:l,endTime:c,durationSeconds:d,executiveSummary:h,technicalAnalysis:f,methodology:m,recommendations:p}}function BU(){return{pr_review_id:null,cve:null,cvss:null,potential_risk_saving:null,risk_saving_description:null,impact:null,endpoint:null,method:null,target:null,technical_analysis:null,poc_description:null,poc_script_code:null,code_diff:null,code_file:null,code_before:null,code_after:null,cwe:null,code_locations:null,remediation_steps:null,fix_pr_body:null,evidence:null,assumptions:null,fix_effort:null,cvss_breakdown:null,status_changed_at:null,status_changed_by:null,status_note:null,snoozed_until:null,reopened_at:null,reopened_by:null,original_severity:null,severity_changed_at:null,severity_changed_by:null,severity_override_reason:null,retest_of_vulnerability_id:null}}function UU(e,t,i){const a=e.cwe,s=typeof a=="string"&&a.trim()?[a.trim()]:Array.isArray(a)?a.filter(c=>typeof c=="string"&&c):null;return{...BU(),id:Ot(e.id)??`vuln-${t+1}`,scan_id:i,title:Ot(e.title)??"Untitled finding",description:Ot(e.description)??"",severity:LU(e.severity),status:"open",created_at:zU(e.timestamp),cve:Ot(e.cve),cvss:jU(e.cvss),impact:Ot(e.impact),endpoint:Ot(e.endpoint),method:Ot(e.method),target:Ot(e.target),technical_analysis:Ot(e.technical_analysis),poc_description:Ot(e.poc_description),poc_script_code:Ot(e.poc_script_code),cwe:s,code_locations:Array.isArray(e.code_locations)?e.code_locations:null,remediation_steps:Ot(e.remediation_steps),fix_pr_body:Ot(e.fix_pr_body),evidence:Ot(e.evidence),assumptions:Ot(e.assumptions),fix_effort:Ot(e.fix_effort)??null,cvss_breakdown:e.cvss_breakdown??null}}function HU(e,t=null){const i=BN(e,"vulnerabilities.json");if(!Array.isArray(i))throw new Tu("vulnerabilities.json is not a JSON array.");return i.map((a,s)=>{if(!a||typeof a!="object")throw new Tu(`vulnerabilities.json entry #${s+1} is not an object.`);return UU(a,s,t)})}function $U(e){const t={critical:0,high:0,medium:0,low:0};for(const i of e)t[i.severity]+=1;return t}async function Ks(e){const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`${e} responded ${t.status}`);return t.json()}function Yu(e){return e?`?run=${encodeURIComponent(e)}`:""}async function UN(e){const t=await Ks("/api/run"+Yu(e)),i=IU(JSON.stringify(t)),a=t.finished===!0;return{summary:i,raw:t,finished:a}}async function HN(e,t){const i=await Ks("/api/vulnerabilities"+Yu(t));return HU(JSON.stringify(i),e)}async function qU(e){const t=await Ks("/api/report"+Yu(e));return(t==null?void 0:t.markdown)??null}async function $N(e){const t=await Ks("/api/transcript"+Yu(e));return{agents:Array.isArray(t==null?void 0:t.agents)?t.agents:[],events:Array.isArray(t==null?void 0:t.events)?t.events:[]}}async function Q1(e){const{summary:t,raw:i,finished:a}=await UN(e),[s,l,c]=await Promise.all([HN(t.runId,e).catch(()=>[]),qU(e).catch(()=>null),$N(e).catch(()=>({agents:[],events:[]}))]);return{summary:t,raw:i,finished:a,vulnerabilities:s,reportMarkdown:l,transcript:c}}async function Xu(e,t){const i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),cache:"no-store"});let a={};try{const s=await i.json();s&&typeof s=="object"&&(a=s)}catch{}return{ok:i.ok,status:i.status,data:a}}async function PU(){const e=await Ks("/api/runs");return{locked:(e==null?void 0:e.locked)??!0,count:typeof(e==null?void 0:e.count)=="number"?e.count:0,runs:Array.isArray(e==null?void 0:e.runs)?e.runs:[]}}async function FU(){const e=await Ks("/api/auth/status");return{verified:(e==null?void 0:e.verified)===!0,email:(e==null?void 0:e.email)??null}}async function GU(e){const{ok:t,data:i}=await Xu("/api/auth/otp/start",{email:e});return t&&i.ok===!0?{ok:!0}:{ok:!1,error:String(i.error??"unavailable")}}async function VU(e,t){const{ok:i,data:a}=await Xu("/api/auth/otp/verify",{email:e,code:t});return i&&a.verified===!0?{verified:!0,email:String(a.email??e)}:{verified:!1,error:String(a.error??"invalid_code")}}async function YU(){await Xu("/api/auth/forget",{})}async function XU(e){const{ok:t,data:i}=await Xu("/api/report/send",e?{run:e}:{});return t&&i.ok===!0?{ok:!0,password:String(i.password??""),filename:String(i.filename??"strix-report.pdf")}:{ok:!1,error:String(i.error??"unavailable")}}const KU=[{slug:"pr_reviews",title:"PR Reviews",icon:ip,tier:"Pro",navDesc:"Pentest every pull request",headline:"Pentest every pull request",description:"Strix reviews every pull request your team opens and catches exploitable changes before they merge."},{slug:"repositories",title:"Repositories",icon:tT,tier:"Pro",navDesc:"Connect your team's repos",headline:"Connect your team's repositories",description:"Link your org's repositories so Strix can scan them continuously and track findings over time."},{slug:"domains",title:"Domains",icon:rp,tier:"Pro",navDesc:"Cover the domains you own",headline:"Cover every domain you own",description:"Add the domains your team owns and let Strix watch them for newly exposed paths and drift."},{slug:"integrations",title:"Integrations",icon:h_,tier:"Pro",navDesc:"Sync to Jira, Linear, Slack",headline:"Sync findings to your tools",description:"Two-way sync findings to Jira, Linear, and Slack so fixes happen where your team already works."},{slug:"members",title:"Members",icon:b_,tier:"Pro",navDesc:"Invite your team, set roles",headline:"Bring your whole team",description:"Invite your team, set roles, and share findings and run history across your org."},{slug:"pentests",title:"Pentests",icon:p_,tier:"Pro",navDesc:"Deeper scans on managed infra",headline:"Launch deeper pentests",description:"Run deeper, longer pentests on managed infrastructure whenever you need them."},{slug:"dashboard",title:"Dashboard",icon:iT,tier:"Pro",navDesc:"Everything in one place",headline:"See everything in one place",description:"Track every project, run, and finding across your org from a single dashboard."},{slug:"platform_issues",title:"Issues",icon:$T,tier:"Pro",navDesc:"Triage across your org",headline:"Triage findings across your org",description:"Manage and triage findings across every project and repository in one queue."},{slug:"chat",title:"Chat",icon:mT,tier:"Pro",navDesc:"Ask about any finding",headline:"Ask Strix anything",description:"Ask the agents about any finding, run, or part of your app in natural language."},{slug:"networks",title:"Networks",icon:gT,tier:"Enterprise",navDesc:"Reach internal, VPN-only targets",headline:"Scan internal networks",description:"Connect private networks to scan internal applications, VPN-only services, and RFC1918 targets."},{slug:"knowledge",title:"Knowledge",icon:j2,tier:"Pro",navDesc:"Give agents context",headline:"Give agents context",description:"Teach Strix about your systems and business logic so every run gets smarter."}],tp=Object.fromEntries(KU.map(e=>[e.slug,e])),ZU=["pr_reviews","repositories","domains","integrations","members","pentests","networks","chat","dashboard","platform_issues","knowledge"];function QU({view:e,onSelectView:t,activeFeature:i,onSelectFeature:a,issuesCount:s,agentCount:l,runCount:c,verified:d,email:h,onOpenEmail:f,onOpenHistory:m,onForget:p}){return g.jsx("aside",{className:"hidden w-72 flex-shrink-0 border-r border-[#222] lg:block",children:g.jsxs("div",{className:"sticky top-0 flex h-screen flex-col overflow-y-auto px-3 py-4",children:[g.jsxs("div",{className:"px-1.5",children:[g.jsxs("a",{href:gr("https://app.strix.ai","logo"),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("logo","sidebar"),className:"flex items-center gap-1.5 opacity-90 transition-opacity hover:opacity-100",title:"Open Strix Cloud",children:[g.jsx("img",{src:"./logo.png",alt:"Strix",className:"h-8 w-10 object-cover"}),g.jsx("span",{className:"text-base font-medium tracking-tight text-white",children:"Strix"})]}),g.jsxs("a",{href:gr(Vs,"sidebar_start_free"),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("sidebar_start_free","sidebar"),className:"mt-3 flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-white px-3 py-2 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:["Explore full platform",g.jsx(zs,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),d&&h&&g.jsxs("div",{className:"mt-2.5 flex items-center gap-2 rounded-lg px-2.5 py-2",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsx(sp,{className:"h-3.5 w-3.5 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("p",{className:"truncate text-[11px] text-[#666]",children:"Linked email"}),g.jsx("p",{className:"truncate text-xs text-[#aaa]",title:h,children:h})]}),g.jsx("button",{onClick:p,title:"Forget this email on this machine",className:"flex-shrink-0 cursor-pointer text-[#666] transition-colors hover:text-white","aria-label":"Forget",children:g.jsx(uT,{className:"h-3.5 w-3.5"})})]})]}),g.jsxs("div",{className:"mt-6 space-y-0.5",children:[g.jsx(Zo,{icon:d_,label:"Overview",desc:"This run's executive report",active:e==="overview",onClick:()=>t("overview")}),g.jsx(Zo,{icon:h2,label:"Issues",desc:"Findings from this run",count:s>0?s:void 0,active:e==="issues",onClick:()=>t("issues")}),l>0&&g.jsx(Zo,{icon:x_,label:"Agents",desc:"What each agent did",count:l,active:e==="agents",onClick:()=>t("agents")}),g.jsx(Zo,{icon:Is,label:"Past runs",desc:"Every run on this machine",count:c>0?c:void 0,active:e==="history",onClick:m}),g.jsx(Zo,{icon:ap,label:"Email report",desc:"Get an encrypted PDF by email",active:e==="email",onClick:f}),ZU.map(y=>{const x=tp[y];return x?g.jsx(nA,{feature:x,active:e==="feature"&&i===y,onClick:()=>a(y)},y):null})]})]})})}function Zo({icon:e,label:t,desc:i,count:a,active:s,onClick:l}){return g.jsxs("button",{onClick:l,className:`flex w-full cursor-pointer items-start gap-2.5 rounded-md px-2.5 py-1.5 text-left transition-colors ${s?"text-white":"text-[#888] hover:bg-[rgba(255,255,255,0.06)] hover:text-white"}`,style:s?{background:"rgba(255,255,255,0.12)"}:void 0,children:[g.jsx(e,{className:"mt-0.5 h-4 w-4 flex-shrink-0","aria-hidden":"true"}),g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsxs("span",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"flex-1 truncate text-sm",children:t}),a!=null&&g.jsx("span",{className:"text-xs text-[#666] tabular-nums",children:a})]}),g.jsx("span",{className:"mt-0.5 block text-[11px] leading-snug text-[#666]",children:i})]})]})}const WU=[{key:"critical",dot:"bg-red-500",text:"text-red-500"},{key:"high",dot:"bg-orange-500",text:"text-orange-500"},{key:"medium",dot:"bg-yellow-500",text:"text-yellow-500"},{key:"low",dot:"bg-blue-500",text:"text-blue-500"}];function JU({counts:e}){const t=WU.filter(i=>e[i.key]>0);return t.length===0?g.jsx("span",{className:"text-xs text-[#555]",children:"No findings"}):g.jsx("div",{className:"flex items-center gap-3",children:t.map(i=>g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:`h-2 w-2 rounded-full ${i.dot}`,"aria-hidden":"true"}),g.jsx("span",{className:`text-xs tabular-nums ${i.text}`,children:e[i.key]})]},i.key))})}function W1(e){if(!e)return null;const t=e.trim().replace(" UTC","Z").replace(" ","T"),i=new Date(t);return Number.isNaN(i.getTime())?null:i.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function eH({runs:e,activeRun:t,onSelectRun:i,onVerifyClick:a}){const s=(e==null?void 0:e.count)??0;return!e||e.locked?g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center",children:[g.jsx("div",{className:"mx-auto mb-4 flex h-11 w-11 items-center justify-center rounded-xl",style:{border:"1px solid #2a2a2a",background:"rgba(255,255,255,0.04)"},children:g.jsx(Is,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"})}),g.jsx("h2",{className:"text-base font-semibold text-white",children:"Browse every run on this machine"}),g.jsxs("p",{className:"mx-auto mt-1.5 max-w-md text-sm text-[#888]",children:["You have ",s," past ",s===1?"run":"runs"," on this machine."]}),g.jsx("button",{onClick:a,className:"mt-4 cursor-pointer rounded-lg bg-white px-4 py-2 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:"View runs"}),g.jsxs("p",{className:"mt-4 flex items-center justify-center gap-1.5 text-xs text-[#555]",children:[g.jsx(g_,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Or open one from the CLI with"," ",g.jsx("code",{className:"font-mono text-[#888]",children:"strix view "})]})]}):e.runs.length===0?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center text-sm text-[#888]",children:"No past runs found on this machine yet."}):g.jsx("div",{className:"space-y-2",children:e.runs.map(l=>{const c=l.name===t,d=W1(l.start_time)??W1(l.end_time);return g.jsxs("button",{onClick:()=>i(l.name),className:`group flex w-full cursor-pointer items-center gap-4 rounded-lg border px-4 py-3 text-left transition-colors ${c?"border-[#444] bg-[rgba(255,255,255,0.04)]":"border-[#222] bg-[rgba(255,255,255,0.02)] hover:border-[#444]"}`,children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"truncate text-sm font-medium text-white",children:l.name}),c&&g.jsx("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-400",style:{border:"1px solid rgba(16,185,129,0.3)"},children:"Active"})]}),g.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-[#666]",children:[l.target&&g.jsx("span",{className:"truncate font-mono text-[#888]",children:l.target}),l.target&&(l.scan_mode||d||l.status)&&g.jsx("span",{className:"text-[#333]",children:"·"}),l.scan_mode&&g.jsx("span",{className:"capitalize",children:l.scan_mode}),d&&g.jsx("span",{className:"text-[#333]",children:"·"}),d&&g.jsx("span",{children:d}),l.status&&g.jsx("span",{className:"text-[#333]",children:"·"}),l.status&&g.jsx("span",{className:"capitalize",children:l.status})]})]}),g.jsx(JU,{counts:l.severity_counts}),g.jsx(v2,{className:"h-4 w-4 flex-shrink-0 text-[#555] transition-colors group-hover:text-[#aaa]","aria-hidden":"true"})]},l.name)})})}const J1={work_email_required:"Please use your work email, not a personal one.",rate_limited:"Too many requests. Wait a minute and try again.",invalid_email:"That email does not look right. Check it and try again.",unavailable:"The email service is unavailable right now. Try again shortly."},tH={forbidden:"This email was unsubscribed from Strix, so we cannot send to it.",too_large:"This report is too large to email. Try a smaller run.",unavailable:"The email service is unavailable right now. Try again shortly."},nH=new Set(["gmail.com","googlemail.com","yahoo.com","ymail.com","outlook.com","hotmail.com","live.com","icloud.com","me.com","aol.com","proton.me","protonmail.com","gmx.com","mail.com"]);function iH({activeRun:e,auth:t,purpose:i,skipDisclosure:a=!1,onAuthChanged:s,onExit:l}){const c=(t==null?void 0:t.verified)===!0,d=i==="verify",[h,f]=re.useState(()=>d?"email":a?c?"sending":"email":"disclosure"),[m,p]=re.useState((t==null?void 0:t.email)??""),[y,x]=re.useState(""),[_,N]=re.useState(!1),[S,w]=re.useState(null),[k,E]=re.useState(null),[O,I]=re.useState(""),[R,H]=re.useState(""),[j,Z]=re.useState(!1),[z,q]=re.useState(""),K=re.useRef(!1),Y=async()=>{f("sending"),w(null);const F=await XU(e);if(F.ok){Ts("report_sent"),I(F.password),H(F.filename),f("password");return}if(F.error==="reverify"||F.error==="unverified"){E("Your verification expired. Enter your email to verify again."),f("email");return}w(tH[F.error]??"Could not send the report. Try again."),f("disclosure")},C=()=>{w(null),E(null),c?Y():f("email")};re.useEffect(()=>{!d&&a&&c&&!K.current&&(K.current=!0,Y())},[]);const $=async()=>{const F=m.trim();if(!F){w("Enter your email to continue.");return}const A=F.slice(F.lastIndexOf("@")+1).toLowerCase();if(nH.has(A)){Ts("work_email_required"),w(J1.work_email_required);return}N(!0),w(null);const L=await GU(F);N(!1),L.ok?(Ts("email_submitted",{purpose:i}),E(`We sent a 6-digit code to ${F}.`),f("code")):(L.error==="work_email_required"&&Ts("work_email_required"),w(J1[L.error]??"Could not send a code. Try again."))},M=async()=>{const F=y.trim();if(F.length<4){w("Enter the 6-digit code from your email.");return}N(!0),w(null);const A=await VU(m.trim(),F);if(N(!1),!A.verified){w("That code did not match. Check it and try again.");return}Ts("email_verified",{purpose:i}),q(A.email),s(),d?l("history"):Y()},B=async()=>{try{await navigator.clipboard.writeText(O),Z(!0),setTimeout(()=>Z(!1),1500)}catch{}},X=z||(t==null?void 0:t.email)||m.trim();return g.jsxs("div",{className:"mx-auto max-w-md space-y-4",children:[g.jsxs("button",{onClick:()=>l(d?"history":"overview"),className:"cursor-pointer inline-flex items-center gap-1.5 text-sm text-[#888] transition-colors hover:text-white",children:[g.jsx(i_,{className:"h-4 w-4"}),d?"Back to past runs":"Back to results"]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ap,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"}),g.jsx("h1",{className:"text-2xl font-semibold text-white",children:d?"Verify your email":"Email report"})]}),g.jsxs("div",{className:"w-full rounded-2xl bg-[rgba(255,255,255,0.02)] p-6",style:{border:"1px solid #2a2a2a"},children:[g.jsx("p",{className:"mb-4 text-xs text-[#666]",children:d?"We send a one-time code to confirm it is you.":"Verified by a one-time code sent to your email"}),S&&g.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-3 py-2",children:[g.jsx(l_,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-red-400","aria-hidden":"true"}),g.jsx("p",{className:"text-xs text-red-300",children:S})]}),k&&!S&&h!=="password"&&g.jsx("p",{className:"mb-4 text-xs text-[#888]",children:k}),h==="disclosure"&&g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2.5 rounded-lg p-3.5",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsxs("div",{className:"flex items-start gap-2.5",children:[g.jsx(sp,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("p",{className:"text-xs leading-relaxed text-[#aaa]",children:["Viewing stays local and nothing is uploaded. Emailing is an explicit opt-in: we send an ",g.jsx("span",{className:"text-white",children:"encrypted PDF"}),"."]})]}),g.jsxs("div",{className:"flex items-start gap-2.5",children:[g.jsx(lT,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-[#888]","aria-hidden":"true"}),g.jsx("p",{className:"text-xs leading-relaxed text-[#aaa]",children:"The report is encrypted with a password that only you hold. Strix cannot read it and never stores it. We collect only your email so we can send it."})]})]}),g.jsx("button",{onClick:C,className:"w-full cursor-pointer rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:c?"Email me the encrypted PDF":"Continue with your email"}),c&&(t==null?void 0:t.email)&&g.jsxs("p",{className:"text-center text-xs text-[#666]",children:["Sending to ",t.email]})]}),h==="email"&&g.jsxs("form",{className:"space-y-4",onSubmit:F=>{F.preventDefault(),$()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your work email"}),g.jsx("input",{type:"email",autoFocus:!0,value:m,onChange:F=>p(F.target.value),placeholder:"you@company.com",className:"w-full rounded-lg bg-black px-3 py-2.5 text-sm text-white outline-none transition-colors focus:border-[#444]",style:{border:"1px solid #2a2a2a"}}),g.jsx("span",{className:"mt-1.5 block text-[11px] text-[#666]",children:"Use your work email."})]}),g.jsxs("button",{type:"submit",disabled:_,className:"flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90 disabled:opacity-60",children:[_&&g.jsx(nh,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Send me a code"]})]}),h==="code"&&g.jsxs("form",{className:"space-y-4",onSubmit:F=>{F.preventDefault(),M()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"6-digit code"}),g.jsx("input",{inputMode:"numeric",autoFocus:!0,value:y,onChange:F=>x(F.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"123456",className:"w-full rounded-lg bg-black px-3 py-2.5 text-center text-lg font-mono tracking-[0.4em] text-white outline-none transition-colors focus:border-[#444]",style:{border:"1px solid #2a2a2a"}})]}),g.jsxs("button",{type:"submit",disabled:_,className:"flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90 disabled:opacity-60",children:[_&&g.jsx(nh,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),d?"Verify":"Verify and send"]}),g.jsx("button",{type:"button",onClick:()=>{f("email"),w(null),E(null)},className:"w-full cursor-pointer text-center text-xs text-[#666] transition-colors hover:text-[#aaa]",children:"Use a different email"})]}),h==="sending"&&g.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[g.jsx(nh,{className:"h-6 w-6 animate-spin text-white","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-[#aaa]",children:"Generating and encrypting locally..."})]}),h==="password"&&g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2.5",children:[g.jsx(js,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("p",{className:"text-xs text-emerald-200",children:["Sent to ",X,". Open the attached PDF with this password."]})]}),g.jsxs("div",{children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your one-time password"}),g.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-black p-3",style:{border:"1px solid #2a2a2a"},children:[g.jsx("code",{className:"flex-1 break-all font-mono text-base text-white",children:O}),g.jsxs("button",{onClick:B,className:"flex cursor-pointer items-center gap-1 rounded-md px-2 py-1 text-xs text-[#aaa] transition-colors hover:bg-[rgba(255,255,255,0.06)] hover:text-white",style:{border:"1px solid #2a2a2a"},children:[j?g.jsx(js,{className:"h-3.5 w-3.5"}):g.jsx(rl,{className:"h-3.5 w-3.5"}),j?"Copied":"Copy"]})]}),g.jsxs("p",{className:"mt-2 text-xs text-[#666]",children:["Save this now. Strix never stores it, so we cannot show it again. File:"," ",g.jsx("span",{className:"font-mono text-[#888]",children:R})]})]}),g.jsx("button",{onClick:()=>l("overview"),className:"w-full cursor-pointer rounded-lg px-4 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-[rgba(255,255,255,0.06)]",style:{border:"1px solid #2a2a2a"},children:"Done"})]})]})]})}const rH=[{icon:s_,text:"Continuous coverage: scheduled pentests and attack surface monitoring"},{icon:FT,text:"One-click autofix that opens a retested pull request"},{icon:h_,text:"Two-way sync to Jira, Linear, and Slack"},{icon:b_,text:"Your whole team, with roles and shared history"}];function aH({feature:e}){const t=e.icon;return g.jsx("div",{className:"mx-auto w-full max-w-lg",children:g.jsxs("div",{className:"rounded-2xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center",children:[g.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-xl",style:{border:"1px solid #2a2a2a",background:"rgba(255,255,255,0.04)"},children:g.jsx(t,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"})}),g.jsx("div",{className:"mt-4 flex justify-center",children:g.jsx(Au,{label:e.tier})}),g.jsx("h2",{className:"mt-3 text-2xl font-semibold text-white",children:e.headline}),g.jsx("p",{className:"mx-auto mt-2 max-w-md text-sm text-[#888]",children:e.description}),g.jsxs("div",{className:"mt-6 rounded-xl p-4 text-left",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsx("p",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-[#666]",children:"Included in Strix Pro"}),g.jsx("ul",{className:"space-y-2.5",children:rH.map(i=>{const a=i.icon;return g.jsxs("li",{className:"flex items-start gap-2.5",children:[g.jsx(a,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-[#888]","aria-hidden":"true"}),g.jsx("span",{className:"text-sm text-[#aaa]",children:i.text})]},i.text)})})]}),g.jsxs("div",{className:"mt-6 flex flex-col items-center gap-3",children:[g.jsxs("a",{href:gr(Vs,e.slug),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi(e.slug,"feature_page"),className:"inline-flex w-full items-center justify-center gap-1.5 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:["Start free",g.jsx(zs,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),g.jsxs("a",{href:gr(JT,e.slug),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi(e.slug,"feature_page_plans"),className:"inline-flex items-center gap-1 text-xs text-[#888] transition-colors hover:text-white",children:["View all plans",g.jsx(zs,{className:"h-3 w-3","aria-hidden":"true"})]})]})]})})}const sH="Your findings stay on your machine. They're rendered here locally in your browser and never uploaded or stored by Strix. Emailing a report is an explicit opt-in that sends an encrypted copy only you can open.",e_=["critical","high","medium","low"],oH=500,lH=[{title:"One-click autofix + open a fix PR",desc:"Fix it for you and open a PR, retested.",slug:"autofix",icon:cu},{title:"Export SOC 2 / ISO 27001 report",desc:"Share an auditor-ready report with your team.",slug:"compliance",icon:H2}],cH=[{title:"Scheduled pentesting",desc:"Continuous coverage for your whole org.",slug:"scheduled",icon:s_},{title:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",icon:m_},{title:"PR reviews",desc:"Pentest every pull request your team opens.",slug:"pr_reviews",icon:ip}];function uH(){const[e,t]=re.useState(null),[i,a]=re.useState(null),[s,l]=re.useState(null),[c,d]=re.useState(null),[h,f]=re.useState("overview"),[m,p]=re.useState(null),[y,x]=re.useState(null),[_,N]=re.useState(null),[S,w]=re.useState("report"),[k,E]=re.useState(!1),O=re.useCallback(async()=>{try{x(await FU())}catch{}},[]),I=re.useCallback(async()=>{try{N(await PU())}catch{}},[]);re.useEffect(()=>{O(),I()},[O,I]);const R=re.useRef(!1);re.useEffect(()=>{let F=!1,A;R.current=!1;const L=()=>{A=setTimeout(V,oH)},V=async()=>{if(!F)try{const{summary:D,raw:G,finished:U}=await UN(e);if(F)return;if(U&&!R.current){R.current=!0;const Q=await Q1(e);F||a(Q);return}const[W,J]=await Promise.all([$N(e).catch(()=>({agents:[],events:[]})),HN(D.runId,e).catch(()=>[])]);if(F)return;a(Q=>({summary:D,raw:G,finished:U,transcript:W,vulnerabilities:J,reportMarkdown:(Q==null?void 0:Q.reportMarkdown)??null})),L()}catch(D){if(F)return;l(D instanceof Error?D.message:"Could not load run data."),L()}};return(async()=>{try{const D=await Q1(e);if(F)return;a(D),D.finished?R.current=!0:L()}catch(D){if(F)return;l(D instanceof Error?D.message:"Could not load run data."),L()}})(),()=>{F=!0,A&&clearTimeout(A)}},[e]);const H=re.useMemo(()=>i?$U(i.vulnerabilities):null,[i]),j=(i==null?void 0:i.vulnerabilities.find(F=>F.id===c))??null,Z=(i==null?void 0:i.transcript.agents.length)??0,z=(y==null?void 0:y.verified)===!0,q=re.useCallback(F=>{t(F),d(null),a(null),l(null),f("overview")},[]),K=re.useCallback((F,A)=>{gi("email_report",A),w("report"),E(F),f("email")},[]),Y=re.useCallback(()=>K(!1,"sidebar"),[K]),C=re.useCallback(()=>K(!0,"overview"),[K]),$=re.useCallback(()=>{gi("history_unlock","past_runs"),w("verify"),E(!1),f("email")},[]),M=re.useCallback(()=>{I(),f("history")},[I]),B=re.useCallback(F=>{gi(F,"sidebar_nav"),p(F),f("feature")},[]),X=re.useCallback(async()=>{await YU(),await O(),await I()},[O,I]);return g.jsxs("div",{className:"min-h-screen bg-black text-white flex",children:[g.jsx(QU,{view:h,onSelectView:F=>{F==="history"?M():f(F)},activeFeature:m,onSelectFeature:B,issuesCount:(i==null?void 0:i.vulnerabilities.length)??0,agentCount:Z,runCount:(_==null?void 0:_.count)??0,verified:z,email:(y==null?void 0:y.email)??null,onOpenEmail:Y,onOpenHistory:M,onForget:()=>void X()}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"border-b border-[#222]",children:g.jsxs("div",{className:"max-w-[72rem] mx-auto px-6 py-4 flex items-center gap-1.5",children:[g.jsxs("a",{href:gr("https://app.strix.ai","logo"),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("logo","topbar"),className:"flex items-center gap-1.5 opacity-90 transition-opacity hover:opacity-100 lg:hidden",title:"Open Strix Cloud",children:[g.jsx("img",{src:"./logo.png",alt:"Strix",className:"w-10 h-8 object-cover"}),g.jsx("div",{className:"text-base text-white font-medium tracking-tight",children:"Strix"})]}),g.jsx("span",{className:"text-xs text-[#666]",children:"Local results"}),i&&g.jsx(fH,{finished:i.finished}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[z&&_&&!_.locked&&_.runs.length>0&&g.jsx(dH,{runs:_,activeRun:e,launchedName:(i==null?void 0:i.summary.runName)??(i==null?void 0:i.summary.runId)??"Current run",onSelect:q}),g.jsxs("a",{href:gr(Vs,"run_in_cloud"),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("run_in_cloud","topbar"),className:"inline-flex items-center gap-1 rounded-lg bg-white px-3 py-1.5 text-xs font-semibold text-black transition-opacity hover:opacity-90",children:["Run in the cloud",g.jsx(zs,{className:"w-3 h-3","aria-hidden":"true"})]})]})]})}),g.jsxs("div",{className:"max-w-[72rem] mx-auto px-6 py-8 space-y-6",children:[h!=="feature"&&h!=="email"&&g.jsxs("div",{className:"rounded-lg px-4 py-3 flex gap-3 items-start",style:{border:"1px solid rgba(255,255,255,0.08)"},children:[g.jsx(sp,{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-emerald-400","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-[#aaa] leading-relaxed",children:sH})]}),s&&!i&&h!=="history"&&h!=="email"&&h!=="feature"&&g.jsxs("div",{className:"rounded-lg px-4 py-3 flex gap-3 items-start border border-red-500/30 bg-red-500/5",children:[g.jsx(l_,{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-red-400","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-red-300",children:s})]}),h==="email"?g.jsx(iH,{activeRun:e,auth:y,purpose:S,skipDisclosure:k,onAuthChanged:()=>{O(),I()},onExit:F=>f(F==="history"?"history":"overview")}):h==="feature"&&m&&tp[m]?g.jsx(aH,{feature:tp[m]}):h==="history"?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Is,{className:"w-5 h-5 text-[#888]","aria-hidden":"true"}),g.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Past runs"})]}),g.jsx(eH,{runs:_,activeRun:e,onSelectRun:q,onVerifyClick:$})]}):!i&&!s?g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-10 text-center",children:[g.jsx("div",{className:"w-6 h-6 mx-auto mb-3 rounded-full border-2 border-[#333] border-t-white animate-spin"}),g.jsx("p",{className:"text-sm text-[#888]",children:"Loading run data…"})]}):i&&H?g.jsxs(g.Fragment,{children:[g.jsx(mH,{summary:i.summary}),g.jsxs("div",{className:"flex gap-5 border-b border-[#2a2a2a] lg:hidden",children:[g.jsx(Em,{active:h==="overview",onClick:()=>f("overview"),children:"Overview"}),g.jsxs(Em,{active:h==="issues",onClick:()=>f("issues"),children:["Issues",i.vulnerabilities.length>0?` (${i.vulnerabilities.length})`:""]}),Z>0&&g.jsxs(Em,{active:h==="agents",onClick:()=>f("agents"),children:["Agents (",Z,")"]})]}),h==="overview"?g.jsx(yH,{summary:i.summary,counts:H,total:i.vulnerabilities.length,reportMarkdown:i.reportMarkdown,onOpenEmail:C}):h==="agents"&&Z>0?g.jsx(vH,{run:i}):j?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("button",{onClick:()=>d(null),className:"cursor-pointer inline-flex items-center gap-1.5 text-sm text-[#888] hover:text-white transition-colors",children:[g.jsx(i_,{className:"w-4 h-4"})," Back to all findings"]}),g.jsx(T4,{vulnerability:j})]}):g.jsx(pH,{vulnerabilities:i.vulnerabilities,finished:i.finished,onSelect:F=>d(F)})]}):null]})]})]})}function dH({runs:e,activeRun:t,launchedName:i,onSelect:a}){const[s,l]=re.useState(!1),c=t??i;return g.jsxs("div",{className:"relative",children:[g.jsxs("button",{onClick:()=>l(d=>!d),onBlur:()=>setTimeout(()=>l(!1),150),className:"flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs text-[#aaa] transition-colors hover:text-white",style:{border:"1px solid #2a2a2a"},children:[g.jsx(Is,{className:"w-3.5 h-3.5","aria-hidden":"true"}),g.jsx("span",{className:"max-w-[160px] truncate",children:c}),g.jsx(o_,{className:"w-3.5 h-3.5","aria-hidden":"true"})]}),s&&g.jsx("div",{className:"absolute right-0 z-50 mt-1.5 max-h-80 w-64 overflow-y-auto rounded-lg py-1 shadow-xl",style:{border:"1px solid #2a2a2a",background:"#0a0a0a"},children:e.runs.map(d=>{const h=d.name===t;return g.jsxs("button",{onMouseDown:()=>a(d.name),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-[rgba(255,255,255,0.06)] ${h?"text-white":"text-[#aaa]"}`,children:[g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsx("span",{className:"block truncate",children:d.name}),d.target&&g.jsx("span",{className:"block truncate font-mono text-[#666]",children:d.target})]}),h&&g.jsx("span",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-emerald-400"})]},d.name)})})]})}function fH({finished:e}){return e?g.jsxs("span",{className:"ml-3 inline-flex items-center gap-1.5 text-xs text-[#888]",children:[g.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#555]"}),"Complete"]}):g.jsxs("span",{className:"ml-3 inline-flex items-center gap-1.5 text-xs text-emerald-400",children:[g.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[g.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75 animate-ping"}),g.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-400"})]}),"Live"]})}function hH(e){if(e==null)return null;if(e<60)return`${e}s`;const t=Math.floor(e/60);return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function mH({summary:e}){const t=hH(e.durationSeconds);return g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:e.runName??e.runId??"Scan results"}),g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-[#888]",children:[e.targets.length>0&&g.jsx("span",{className:"font-mono text-[#aaa]",children:e.targets.join(", ")}),e.scanMode&&g.jsx(wm,{label:e.scanMode}),t&&g.jsx(wm,{label:t}),e.status&&g.jsx(wm,{label:e.status})]})]})}function wm({label:e}){return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-[#333]",children:"·"}),g.jsx("span",{className:"capitalize",children:e})]})}function pH({vulnerabilities:e,finished:t,onSelect:i}){const a=[...e].sort((s,l)=>e_.indexOf(s.severity)-e_.indexOf(l.severity));return a.length===0?g.jsxs("div",{className:"space-y-4",children:[g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center text-sm text-[#888]",children:t?"No findings in this run.":"No findings yet. The scan is still running…"}),t&&g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsx("p",{className:"text-sm font-medium text-white",children:"Stay ahead of new exposures"}),g.jsx("p",{className:"mt-0.5 mb-3 text-xs text-[#666]",children:"Attack surface monitoring catches new exposures for your org over time."}),g.jsx(Rs,{label:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",icon:m_})]})]}):g.jsx("div",{className:"space-y-2",children:a.map(s=>g.jsxs("button",{onClick:()=>i(s.id),className:"cursor-pointer w-full text-left rounded-lg border border-[#222] hover:border-[#444] bg-[rgba(255,255,255,0.02)] px-4 py-3 transition-colors flex items-center gap-3",children:[g.jsx("span",{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${op(s.severity)}`,"aria-hidden":"true"}),g.jsxs("span",{className:"flex-1 min-w-0",children:[g.jsx("span",{className:"block text-sm font-medium text-white truncate",children:s.title}),s.target&&g.jsx("span",{className:"block text-xs text-[#666] font-mono truncate",children:s.target})]}),g.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full border capitalize ${y_[s.severity]}`,children:s.severity})]},s.id))})}function gH(e){return e.replace(/^\s*#{1,6}[ \t]+.*(?:\r?\n)+/,"").trimStart()}function bH(e){const t=[];let i=null;for(const a of e.split(` +`)}function rU({args:e,result:t}){const i=e.action??"",a=e.code??e.script??"",s=t;let l=null;s&&typeof s=="object"?l=typeof s.stdout=="string"?s.stdout:null:typeof s=="string"&&(l=s);const c=i==="new_session"?"new session":i==="close"?"close session":i==="list_sessions"?"list sessions":null,d=l?iU(nU(l)):null;return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-yellow-400/80 font-semibold text-sm",children:"Python"}),c&&g.jsx("span",{className:"text-[#888] text-[13px]",children:c})]}),a&&g.jsx(Qp,{code:a,language:"python",collapsible:!0}),d&&g.jsx(xr,{className:"text-[#666]",children:d})]})}function aU({args:e}){const t=e.targets,a=(Array.isArray(t)?t:[]).map(s=>typeof s=="object"&&s?s.original??null:null).filter(Boolean);return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Starting penetration test"}),a.length===1&&g.jsxs("span",{className:"text-[#888] text-[13px]",children:["on ",a[0]]})]}),a.length>1&&g.jsx("div",{className:"mt-1.5 space-y-0.5",children:a.map((s,l)=>g.jsxs("div",{className:"text-[13px] text-[#888]",children:[g.jsx("span",{className:"text-[#555] mr-1",children:"•"}),s]},l))})]})}function sU({args:e}){const t=e.name??"Unknown Agent",i=e.task??"";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-[#888] text-[13px]",children:"subagent"}),g.jsx("span",{className:"text-purple-400 font-semibold text-sm",children:t})]}),i&&g.jsx("div",{className:"mt-1.5",children:g.jsx(Ln,{text:i,maxLines:15})})]})}function oU(e){return e.toolName==="subagent_start_info"?g.jsx(sU,{...e}):g.jsx(aU,{...e})}function lU({args:e}){const t=e.executive_summary??"",i=e.methodology??"",a=e.technical_analysis??"",s=e.recommendations??"";return g.jsxs("div",{className:"space-y-3",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Penetration test completed"}),t&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Executive Summary"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:t,maxLines:25})})]}),i&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Methodology"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:i,maxLines:25})})]}),a&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Technical Analysis"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:a,maxLines:25})})]}),s&&g.jsxs("div",{children:[g.jsx("span",{className:"text-emerald-400/60 text-sm font-semibold",children:"Recommendations"}),g.jsx("div",{className:"mt-1",children:g.jsx(Ln,{text:s,maxLines:25})})]}),!t&&!i&&!a&&!s&&g.jsx("div",{className:"text-[#555] text-xs",children:"Generating final report..."})]})}function cU({toolName:e,args:t,result:i}){if(e==="create_note"){const a=t.title??"",s=t.content??"",l=t.category??"general";return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note"}),g.jsxs("span",{className:"text-[#555] text-[13px]",children:["(",l,")"]})]}),a&&g.jsx("div",{className:"mt-1.5 text-[#999] text-[13px]",children:a}),s&&g.jsx("div",{className:"mt-1",children:g.jsx(Os,{text:s})})]})}if(e==="delete_note")return g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note removed"});if(e==="update_note"){const a=t.title??"",s=t.content??"";return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note updated"}),a&&g.jsx("div",{className:"mt-1.5 text-[#999] text-[13px]",children:a}),s&&g.jsx("div",{className:"mt-1",children:g.jsx(Os,{text:s})})]})}if(e==="get_note"){const a=i,s=a&&typeof a=="object"&&a.success?a.note:void 0;return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note read"}),s&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mt-1.5 text-[#999] text-[13px]",children:[s.title??"(untitled)",g.jsxs("span",{className:"text-[#555] ml-1",children:["(",s.category??"general",")"]})]}),s.content&&g.jsx("div",{className:"mt-1",children:g.jsx(Os,{text:s.content})})]})]})}if(e==="list_notes"){const a=i;let s=[];if(a&&typeof a=="object"&&a.success){const l=a.notes;s=Array.isArray(l)?l:[]}return g.jsxs("div",{children:[g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"notes"}),s.length>0?g.jsx("div",{className:"mt-1.5 space-y-0.5",children:s.map((l,c)=>g.jsxs("div",{className:"text-[13px]",children:[g.jsx("span",{className:"text-[#555] mr-1",children:"-"}),g.jsx("span",{className:"text-[#999]",children:l.title??"(untitled)"}),g.jsxs("span",{className:"text-[#555] ml-1",children:["(",l.category??"general",")"]}),l.content&&g.jsx("div",{className:"ml-3",children:g.jsx(Os,{text:l.content})})]},c))}):g.jsx("div",{className:"mt-1 text-[#555] text-xs",children:"No notes"})]})}return g.jsx("span",{className:"text-amber-400/80 font-semibold text-sm",children:"note"})}const uU={create_todo:{label:"Task added",Icon:vT},list_todos:{label:"Plan",Icon:g2},update_todo:{label:"Task updated",Icon:xT},mark_todo_done:{label:"Task completed",Icon:c_},mark_todo_pending:{label:"Task reopened",Icon:MT},delete_todo:{label:"Task removed",Icon:UT}};function dU({status:e}){return e==="done"?g.jsx(c_,{className:"w-3.5 h-3.5 text-emerald-400/70 shrink-0"}):e==="in_progress"?g.jsx(k2,{className:"w-3.5 h-3.5 text-purple-400/70 shrink-0 animate-pulse"}):g.jsx(A2,{className:"w-3.5 h-3.5 text-[#444] shrink-0"})}function fU({todos:e,highlightId:t}){return g.jsx("div",{className:"space-y-0",children:e.map((i,a)=>{const s=i.status??"pending",l=t&&i.id===t;return g.jsxs("div",{className:`flex items-start gap-2.5 py-1.5 px-2 -mx-2 rounded-md transition-colors ${l?"bg-purple-500/[0.08]":""}`,children:[g.jsx("div",{className:"mt-[1px]",children:g.jsx(dU,{status:s})}),g.jsx("span",{className:`text-[13px] leading-snug ${s==="done"?"text-[#555] line-through":s==="in_progress"?"text-[#bbb]":"text-[#999]"}`,children:i.title??"(untitled)"})]},i.id??a)})})}function hU({toolName:e,args:t,result:i}){const a=uU[e]??{label:"Plan",Icon:kT},s=a.Icon,l=i;if(typeof l=="string"&&l.trim())return g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}),g.jsx("div",{className:"mt-1.5 text-[#888] text-[13px]",children:l.trim()})]});let c=[],d=null,h;if(l&&typeof l=="object"){if(d=l.error??null,l.success){const m=l.todos;c=Array.isArray(m)?m:[]}h=l.id??t.todo_id??void 0}const f=e!=="list_todos"?h:void 0;return c.length===0&&!d?g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}):g.jsxs("div",{children:[g.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[g.jsx(s,{className:"w-3.5 h-3.5 text-purple-400/60"}),g.jsx("span",{className:"text-purple-400/80 font-semibold text-sm",children:a.label})]}),d&&g.jsx("div",{className:"text-red-400/70 text-[13px] mb-2",children:d}),c.length>0&&g.jsx("div",{className:"rounded-lg border border-white/[0.06] bg-white/[0.015] px-3 py-2",children:g.jsx(fU,{todos:c,highlightId:f})})]})}function K1(e){if(e==null)return null;if(typeof e=="string")return e.trim()?e:null;if(typeof e=="object"){const t=e;if(typeof t.__raw=="string")return t.__raw;if(Object.keys(t).length===0)return null;try{return JSON.stringify(e,null,2)}catch{return String(e)}}return String(e)}function DN({toolName:e,args:t,result:i}){const a=K1(t),s=K1(i);return g.jsxs("div",{children:[g.jsx("span",{className:"text-[#888] font-semibold text-sm",children:e.replace(/_/g," ")}),a&&g.jsx(xr,{className:"text-[#777]",children:a}),s&&g.jsx(xr,{className:"text-[#666]",children:s})]})}function mU({args:e}){const i=(e.skills??"").split(",").map(a=>a.trim()).filter(Boolean);return g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"text-emerald-400/80 font-semibold text-sm",children:"Loading skill"}),i.length>0&&g.jsx("span",{className:"text-[#888] text-[13px]",children:i.join(", ")})]})}const Vu={terminal:{renderer:k9,icon:g_,color:"text-emerald-400"},python:{renderer:rU,icon:O2,color:"text-yellow-400"},browser:{renderer:A9,icon:rp,color:"text-blue-400"},filesystem:{renderer:C9,icon:d_,color:"text-sky-400"},proxy:{renderer:X9,icon:zs,color:"text-purple-400",match:/request|sitemap|scope/},reporting:{renderer:U9,icon:DT,color:"text-red-400"},thinking:{renderer:K9,icon:a_,color:"text-purple-400"},agents:{renderer:Z9,icon:np,color:"text-cyan-400",match:/agent/},search:{renderer:Q9,icon:p_,color:"text-amber-400"},lifecycle:{renderer:oU,icon:f_,color:"text-emerald-400"},notes:{renderer:cU,icon:jT,color:"text-amber-400",match:/note/},skills:{renderer:mU,icon:cu,color:"text-emerald-400"},todos:{renderer:hU,icon:aT,color:"text-purple-400",match:/todo/},telemetry:{renderer:DN,icon:cu,color:"text-[#555]"}},pU={terminal:["exec_command","write_stdin","terminal_execute"],python:["python_action"],browser:["browser_action"],filesystem:["apply_patch","view_image","str_replace_editor","list_files","search_files"],proxy:["list_requests","view_request","repeat_request","list_sitemap","view_sitemap_entry","scope_rules","send_request"],reporting:["create_vulnerability_report"],thinking:["think"],agents:["create_agent","agent_finish","send_message_to_agent","wait_for_message","view_agent_graph","stop_agent"],search:["web_search"],lifecycle:["scan_start_info","subagent_start_info","finish_scan"],notes:["create_note","delete_note","update_note","list_notes","get_note"],skills:["load_skill"],todos:["create_todo","list_todos","update_todo","mark_todo_done","mark_todo_pending","delete_todo"],telemetry:["sandbox_error_details","llm_error_details"]},gU=Object.fromEntries(Object.entries(pU).flatMap(([e,t])=>t.map(i=>[i,e]))),bU={finish_scan:lU,apply_patch:j9,view_image:I9},xU={agent_finish:{icon:f_,color:"text-cyan-400"},send_message_to_agent:{icon:$x,color:"text-cyan-400"},wait_for_message:{icon:$x,color:"text-cyan-400"},view_agent_graph:{icon:B2,color:"text-cyan-400"},stop_agent:{icon:r_,color:"text-red-400"},scan_start_info:{icon:L2,color:"text-emerald-400"},subagent_start_info:{icon:np,color:"text-purple-400"},view_image:{icon:J2,color:"text-sky-400"}},yU=Vu.telemetry;function LN(e){var i;const t=gU[e];if(t)return t;for(const[a,s]of Object.entries(Vu))if((i=s.match)!=null&&i.test(e))return a;return null}function vU(e){const t=bU[e];if(t)return t;const i=LN(e);return i?Vu[i].renderer:DN}function _U(e){const t=xU[e];if(t)return t;const i=LN(e),a=i?Vu[i]:yU;return{icon:a.icon,color:a.color}}const wU=30;function EU({role:e,content:t}){const i=e==="user"||e==="human";return g.jsxs("div",{children:[g.jsx("span",{className:`font-semibold text-sm ${i?"text-blue-400/80":"text-purple-400/80"}`,children:i?"User":"Thinking"}),g.jsx("div",{className:"mt-1.5 italic text-[#888]",children:g.jsx(Ln,{text:t,maxLines:wU})})]})}class NU extends re.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?g.jsx("span",{className:"text-[#555] font-semibold text-sm",children:this.props.toolName.replace(/_/g," ")}):this.props.children}}function SU(e){const t=vU(e.toolName);return g.jsx(NU,{toolName:e.toolName,children:g.jsx(t,{...e})})}function zN(e){if(e==null||typeof e!="string")return e;const t=e.trim();if(!t)return e;try{return JSON.parse(t)}catch{}try{const i=t.replace(/\bNone\b/g,"null").replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/'/g,'"');return JSON.parse(i)}catch{return{__raw:e}}}function jN(e){const t=zN(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:t==null?{}:{__raw:typeof t=="string"?t:JSON.stringify(t)}}function Z1(e){const t=/(\d+)$/.exec(e);return t?parseInt(t[1],10):0}function IN(e){var i;const t=(i=e.data)==null?void 0:i.role;return e.type==="chat"&&(t==="user"||t==="human")}const kU={completed:"text-emerald-400 border-emerald-500/30 bg-emerald-500/10",running:"text-blue-400 border-blue-500/30 bg-blue-500/10",waiting:"text-yellow-400 border-yellow-500/30 bg-yellow-500/10",stopped:"text-[#aaa] border-[#333] bg-[#1a1a1a]",crashed:"text-red-400 border-red-500/30 bg-red-500/10",failed:"text-red-400 border-red-500/30 bg-red-500/10"};function TU(e){return e==="completed"?"completed":e==="running"?"running":e==="failed"||e==="crashed"?"failed":e}function AU(e,t){var d;const i=new Map;for(const h of e)if(h.parent_id){const f=i.get(h.parent_id)??[];f.push(h.id),i.set(h.parent_id,f)}const a=new Map,s=new Map,l=new Map;for(const h of t)if(h.type==="tool"){if(a.set(h.agent_id,(a.get(h.agent_id)??0)+1),((d=h.data)==null?void 0:d.tool_name)==="create_agent"){const f=jN(h.data.args),m=f.name??f.agent_name??"",p=f.task??"";m&&p&&l.set(m,p)}}else IN(h)||s.set(h.agent_id,(s.get(h.agent_id)??0)+1);const c=new Map;for(const h of e)c.set(h.id,{id:h.id,name:h.name,task:l.get(h.name)??"",status:TU(h.status),parentId:h.parent_id,children:i.get(h.id)??[],createdAt:h.created_at,toolCount:a.get(h.id)??0,messageCount:s.get(h.id)??0});return c}function CU({agent:e,events:t,showHeader:i=!0}){const a=re.useMemo(()=>t.filter(c=>c.agent_id===e.id&&!IN(c)).sort((c,d)=>Z1(c.id)-Z1(d.id)),[t,e.id]),s=a.filter(c=>c.type==="tool").length,l=a.length-s;return g.jsxs("div",{children:[i&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[g.jsx("span",{className:"text-base font-semibold text-white truncate",children:e.name}),g.jsx("span",{className:`flex-shrink-0 text-xs font-medium capitalize px-2 py-0.5 rounded-full border ${kU[e.status]??"text-[#aaa] border-[#333] bg-[#1a1a1a]"}`,children:e.status}),g.jsx("span",{className:"font-mono text-xs text-[#555]",children:e.id})]}),g.jsxs("p",{className:"text-xs text-[#666] mb-4",children:[l," message",l===1?"":"s"," · ",s," tool call",s===1?"":"s"]})]}),a.length===0?g.jsx("p",{className:"text-sm text-[#666]",children:"No recorded activity for this agent."}):g.jsx("div",{className:"py-1",children:a.map((c,d)=>{var N,S,w,k,E,O;const h=d===a.length-1,f=c.type==="tool",m=f?String(((N=c.data)==null?void 0:N.tool_name)??"tool"):"",p=f?"":String(((S=c.data)==null?void 0:S.role)??"assistant");let y,x;if(f){const I=_U(m);y=I.icon,x=I.color}else{const I=p==="user"||p==="human";y=I?np:a_,x=I?"text-blue-400":"text-purple-400"}const _=f?String(((w=c.data)==null?void 0:w.status)??"completed"):"completed";return g.jsxs("div",{className:"flex gap-3",children:[g.jsxs("div",{className:"flex flex-col items-center shrink-0",children:[g.jsx("div",{className:`w-[30px] h-[30px] rounded-full bg-black border flex items-center justify-center shrink-0 ${f&&_==="running"?"border-blue-500/40 animate-pulse":f&&_==="failed"?"border-red-500/30":"border-[#222]"}`,children:g.jsx(y,{className:`w-3.5 h-3.5 ${x}`})}),!h&&g.jsx("div",{className:"w-px flex-1 bg-[#1a1a1a] mt-1"})]}),g.jsx("div",{className:"flex-1 min-w-0 pt-[5px] pb-6",children:f?g.jsx(SU,{toolName:m,args:jN((k=c.data)==null?void 0:k.args),result:zN((E=c.data)==null?void 0:E.result)??null,status:_}):g.jsx(EU,{role:p,content:String(((O=c.data)==null?void 0:O.content)??"")})})]},c.id)})})]})}const MU={completed:"bg-emerald-400",running:"bg-blue-400",waiting:"bg-yellow-400",stopped:"bg-[#888]",crashed:"bg-red-400",failed:"bg-red-400"},OU=80;function RU({agent:e,events:t,onClose:i}){const a=re.useRef(null),s=re.useRef(!1),l=re.useCallback(()=>{const c=a.current;c&&(s.current=c.scrollHeight-c.scrollTop-c.clientHeight{const c=a.current;!c||!s.current||requestAnimationFrame(()=>{c.scrollTo({top:c.scrollHeight,behavior:"smooth"})})},[t]),re.useEffect(()=>{const c=h=>{h.key==="Escape"&&i()};document.addEventListener("keydown",c);const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",c),document.body.style.overflow=d}},[i]),g.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4 sm:p-8",onClick:i,role:"dialog","aria-modal":"true","aria-label":`Agent ${e.name}`,children:g.jsxs("div",{className:"relative flex h-[80vh] w-full max-w-5xl flex-col rounded-xl border border-[#222] bg-[#0a0a0a] shadow-2xl",onClick:c=>c.stopPropagation(),children:[g.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[#222] px-5 py-3.5",children:[g.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[g.jsx("span",{className:`h-2 w-2 flex-shrink-0 rounded-full ${MU[e.status]??"bg-[#888]"}`}),g.jsx("span",{className:"truncate text-sm font-semibold text-white",children:e.name}),g.jsx("span",{className:"flex-shrink-0 font-mono text-xs text-[#555]",children:e.id})]}),g.jsx("button",{type:"button",onClick:i,"aria-label":"Close",className:"flex-shrink-0 rounded-md p-1 text-[#888] transition-colors hover:bg-[#1a1a1a] hover:text-white",children:g.jsx(XT,{className:"h-4 w-4"})})]}),g.jsx("div",{ref:a,onScroll:l,className:"flex-1 overflow-y-auto p-5",children:g.jsx(CU,{agent:e,events:t,showHeader:!1})}),g.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t border-[#222] px-5 py-3",children:[g.jsx("span",{className:"text-xs text-[#888]",children:"Steer agents live from your terminal."}),g.jsx("a",{href:gr(Vs,"steer_agent"),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("steer_agent","agents"),className:"text-xs font-medium text-[#60a5fa] hover:underline",children:"Upgrade to Pro to steer agents from the web →"})]})]})})}class Tu extends Error{constructor(t){super(t),this.name="RunParseError"}}const DU=["critical","high","medium","low"];function LU(e){const t=String(e??"").toLowerCase().trim();return DU.includes(t)?t:"low"}function zU(e){if(typeof e=="string"&&e.trim()){const t=e.trim().replace(" UTC","Z").replace(" ","T"),i=new Date(t);if(!Number.isNaN(i.getTime()))return i.toISOString();const a=new Date(e);if(!Number.isNaN(a.getTime()))return a.toISOString()}return new Date().toISOString()}function Ot(e){return typeof e=="string"&&e.length>0?e:null}function jU(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function BN(e,t){try{return JSON.parse(e)}catch{throw new Tu(`${t} isn't valid JSON. Make sure you selected a Strix run directory.`)}}function IU(e){const t=BN(e,"run.json");if(!t||typeof t!="object"||Array.isArray(t))throw new Tu("run.json is not an object.");const i=t,a=[],s=i.targets_info;if(Array.isArray(s)){for(const x of s)if(x&&typeof x=="object"){const _=x.original;typeof _=="string"&&_&&a.push(_)}}const l=Ot(i.start_time),c=Ot(i.end_time);let d=null;if(l&&c){const x=new Date(l).getTime(),_=new Date(c).getTime();!Number.isNaN(x)&&!Number.isNaN(_)&&_>=x&&(d=Math.round((_-x)/1e3))}let h=null,f=null,m=null,p=null;const y=i.scan_results;if(y&&typeof y=="object"){const x=y;h=Ot(x.executive_summary),f=Ot(x.technical_analysis),m=Ot(x.methodology),p=Ot(x.recommendations)}return{runId:Ot(i.run_id),runName:Ot(i.run_name),targets:a,scanMode:Ot(i.scan_mode),status:Ot(i.status),startTime:l,endTime:c,durationSeconds:d,executiveSummary:h,technicalAnalysis:f,methodology:m,recommendations:p}}function BU(){return{pr_review_id:null,cve:null,cvss:null,potential_risk_saving:null,risk_saving_description:null,impact:null,endpoint:null,method:null,target:null,technical_analysis:null,poc_description:null,poc_script_code:null,code_diff:null,code_file:null,code_before:null,code_after:null,cwe:null,code_locations:null,remediation_steps:null,fix_pr_body:null,evidence:null,assumptions:null,fix_effort:null,cvss_breakdown:null,status_changed_at:null,status_changed_by:null,status_note:null,snoozed_until:null,reopened_at:null,reopened_by:null,original_severity:null,severity_changed_at:null,severity_changed_by:null,severity_override_reason:null,retest_of_vulnerability_id:null}}function UU(e,t,i){const a=e.cwe,s=typeof a=="string"&&a.trim()?[a.trim()]:Array.isArray(a)?a.filter(c=>typeof c=="string"&&c):null;return{...BU(),id:Ot(e.id)??`vuln-${t+1}`,scan_id:i,title:Ot(e.title)??"Untitled finding",description:Ot(e.description)??"",severity:LU(e.severity),status:"open",created_at:zU(e.timestamp),cve:Ot(e.cve),cvss:jU(e.cvss),impact:Ot(e.impact),endpoint:Ot(e.endpoint),method:Ot(e.method),target:Ot(e.target),technical_analysis:Ot(e.technical_analysis),poc_description:Ot(e.poc_description),poc_script_code:Ot(e.poc_script_code),cwe:s,code_locations:Array.isArray(e.code_locations)?e.code_locations:null,remediation_steps:Ot(e.remediation_steps),fix_pr_body:Ot(e.fix_pr_body),evidence:Ot(e.evidence),assumptions:Ot(e.assumptions),fix_effort:Ot(e.fix_effort)??null,cvss_breakdown:e.cvss_breakdown??null}}function HU(e,t=null){const i=BN(e,"vulnerabilities.json");if(!Array.isArray(i))throw new Tu("vulnerabilities.json is not a JSON array.");return i.map((a,s)=>{if(!a||typeof a!="object")throw new Tu(`vulnerabilities.json entry #${s+1} is not an object.`);return UU(a,s,t)})}function $U(e){const t={critical:0,high:0,medium:0,low:0};for(const i of e)t[i.severity]+=1;return t}async function Ks(e){const t=await fetch(e,{cache:"no-store"});if(!t.ok)throw new Error(`${e} responded ${t.status}`);return t.json()}function Yu(e){return e?`?run=${encodeURIComponent(e)}`:""}async function UN(e){const t=await Ks("/api/run"+Yu(e)),i=IU(JSON.stringify(t)),a=t.finished===!0;return{summary:i,raw:t,finished:a}}async function HN(e,t){const i=await Ks("/api/vulnerabilities"+Yu(t));return HU(JSON.stringify(i),e)}async function qU(e){const t=await Ks("/api/report"+Yu(e));return(t==null?void 0:t.markdown)??null}async function $N(e){const t=await Ks("/api/transcript"+Yu(e));return{agents:Array.isArray(t==null?void 0:t.agents)?t.agents:[],events:Array.isArray(t==null?void 0:t.events)?t.events:[]}}async function Q1(e){const{summary:t,raw:i,finished:a}=await UN(e),[s,l,c]=await Promise.all([HN(t.runId,e).catch(()=>[]),qU(e).catch(()=>null),$N(e).catch(()=>({agents:[],events:[]}))]);return{summary:t,raw:i,finished:a,vulnerabilities:s,reportMarkdown:l,transcript:c}}async function Xu(e,t){const i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),cache:"no-store"});let a={};try{const s=await i.json();s&&typeof s=="object"&&(a=s)}catch{}return{ok:i.ok,status:i.status,data:a}}async function PU(){const e=await Ks("/api/runs");return{locked:(e==null?void 0:e.locked)??!0,count:typeof(e==null?void 0:e.count)=="number"?e.count:0,runs:Array.isArray(e==null?void 0:e.runs)?e.runs:[]}}async function FU(){const e=await Ks("/api/auth/status");return{verified:(e==null?void 0:e.verified)===!0,email:(e==null?void 0:e.email)??null}}async function GU(e){const{ok:t,data:i}=await Xu("/api/auth/otp/start",{email:e});return t&&i.ok===!0?{ok:!0}:{ok:!1,error:String(i.error??"unavailable")}}async function VU(e,t){const{ok:i,data:a}=await Xu("/api/auth/otp/verify",{email:e,code:t});return i&&a.verified===!0?{verified:!0,email:String(a.email??e)}:{verified:!1,error:String(a.error??"invalid_code")}}async function YU(){await Xu("/api/auth/forget",{})}async function XU(e){const{ok:t,data:i}=await Xu("/api/report/send",e?{run:e}:{});return t&&i.ok===!0?{ok:!0,password:String(i.password??""),filename:String(i.filename??"strix-report.pdf")}:{ok:!1,error:String(i.error??"unavailable")}}const KU=[{slug:"pr_reviews",title:"PR Reviews",icon:ip,tier:"Pro",navDesc:"Pentest every pull request",headline:"Pentest every pull request",description:"Strix reviews every pull request your team opens and catches exploitable changes before they merge."},{slug:"repositories",title:"Repositories",icon:tT,tier:"Pro",navDesc:"Connect your team's repos",headline:"Connect your team's repositories",description:"Link your org's repositories so Strix can scan them continuously and track findings over time."},{slug:"domains",title:"Domains",icon:rp,tier:"Pro",navDesc:"Cover the domains you own",headline:"Cover every domain you own",description:"Add the domains your team owns and let Strix watch them for newly exposed paths and drift."},{slug:"integrations",title:"Integrations",icon:h_,tier:"Pro",navDesc:"Sync to Jira, Linear, Slack",headline:"Sync findings to your tools",description:"Two-way sync findings to Jira, Linear, and Slack so fixes happen where your team already works."},{slug:"members",title:"Members",icon:b_,tier:"Pro",navDesc:"Invite your team, set roles",headline:"Bring your whole team",description:"Invite your team, set roles, and share findings and run history across your org."},{slug:"pentests",title:"Pentests",icon:p_,tier:"Pro",navDesc:"Deeper scans on managed infra",headline:"Launch deeper pentests",description:"Run deeper, longer pentests on managed infrastructure whenever you need them."},{slug:"dashboard",title:"Dashboard",icon:iT,tier:"Pro",navDesc:"Everything in one place",headline:"See everything in one place",description:"Track every project, run, and finding across your org from a single dashboard."},{slug:"platform_issues",title:"Issues",icon:$T,tier:"Pro",navDesc:"Triage across your org",headline:"Triage findings across your org",description:"Manage and triage findings across every project and repository in one queue."},{slug:"chat",title:"Chat",icon:mT,tier:"Pro",navDesc:"Ask about any finding",headline:"Ask Strix anything",description:"Ask the agents about any finding, run, or part of your app in natural language."},{slug:"networks",title:"Networks",icon:gT,tier:"Enterprise",navDesc:"Reach internal, VPN-only targets",headline:"Scan internal networks",description:"Connect private networks to scan internal applications, VPN-only services, and RFC1918 targets."},{slug:"knowledge",title:"Knowledge",icon:j2,tier:"Pro",navDesc:"Give agents context",headline:"Give agents context",description:"Teach Strix about your systems and business logic so every run gets smarter."}],tp=Object.fromEntries(KU.map(e=>[e.slug,e])),ZU=["pr_reviews","repositories","domains","integrations","members","pentests","networks","chat","dashboard","platform_issues","knowledge"];function QU({view:e,onSelectView:t,activeFeature:i,onSelectFeature:a,issuesCount:s,agentCount:l,runCount:c,verified:d,email:h,onOpenEmail:f,onOpenHistory:m,onForget:p}){return g.jsx("aside",{className:"hidden w-72 flex-shrink-0 border-r border-[#222] lg:block",children:g.jsxs("div",{className:"sticky top-0 flex h-screen flex-col overflow-y-auto px-3 py-4",children:[g.jsxs("div",{className:"px-1.5",children:[g.jsxs("a",{href:gr("https://app.strix.ai","logo"),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("logo","sidebar"),className:"flex items-center gap-1.5 opacity-90 transition-opacity hover:opacity-100",title:"Open Strix Cloud",children:[g.jsx("img",{src:"./logo.png",alt:"Strix",className:"h-8 w-10 object-cover"}),g.jsx("span",{className:"text-base font-medium tracking-tight text-white",children:"Strix"})]}),g.jsxs("a",{href:gr(Vs,"sidebar_start_free"),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("sidebar_start_free","sidebar"),className:"mt-3 flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-white px-3 py-2 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:["Explore full platform",g.jsx(zs,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),d&&h&&g.jsxs("div",{className:"mt-2.5 flex items-center gap-2 rounded-lg px-2.5 py-2",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsx(sp,{className:"h-3.5 w-3.5 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("p",{className:"truncate text-[11px] text-[#666]",children:"Linked email"}),g.jsx("p",{className:"truncate text-xs text-[#aaa]",title:h,children:h})]}),g.jsx("button",{onClick:p,title:"Forget this email on this machine",className:"flex-shrink-0 cursor-pointer text-[#666] transition-colors hover:text-white","aria-label":"Forget",children:g.jsx(uT,{className:"h-3.5 w-3.5"})})]})]}),g.jsxs("div",{className:"mt-6 space-y-0.5",children:[g.jsx(Zo,{icon:d_,label:"Overview",desc:"This run's executive report",active:e==="overview",onClick:()=>t("overview")}),g.jsx(Zo,{icon:h2,label:"Issues",desc:"Findings from this run",count:s>0?s:void 0,active:e==="issues",onClick:()=>t("issues")}),l>0&&g.jsx(Zo,{icon:x_,label:"Agents",desc:"What each agent did",count:l,active:e==="agents",onClick:()=>t("agents")}),g.jsx(Zo,{icon:Is,label:"Past runs",desc:"Every run on this machine",count:c>0?c:void 0,active:e==="history",onClick:m}),g.jsx(Zo,{icon:ap,label:"Email report",desc:"Get an encrypted PDF by email",active:e==="email",onClick:f}),ZU.map(y=>{const x=tp[y];return x?g.jsx(nA,{feature:x,active:e==="feature"&&i===y,onClick:()=>a(y)},y):null})]})]})})}function Zo({icon:e,label:t,desc:i,count:a,active:s,onClick:l}){return g.jsxs("button",{onClick:l,className:`flex w-full cursor-pointer items-start gap-2.5 rounded-md px-2.5 py-1.5 text-left transition-colors ${s?"text-white":"text-[#888] hover:bg-[rgba(255,255,255,0.06)] hover:text-white"}`,style:s?{background:"rgba(255,255,255,0.12)"}:void 0,children:[g.jsx(e,{className:"mt-0.5 h-4 w-4 flex-shrink-0","aria-hidden":"true"}),g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsxs("span",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:"flex-1 truncate text-sm",children:t}),a!=null&&g.jsx("span",{className:"text-xs text-[#666] tabular-nums",children:a})]}),g.jsx("span",{className:"mt-0.5 block text-[11px] leading-snug text-[#666]",children:i})]})]})}const WU=[{key:"critical",dot:"bg-red-500",text:"text-red-500"},{key:"high",dot:"bg-orange-500",text:"text-orange-500"},{key:"medium",dot:"bg-yellow-500",text:"text-yellow-500"},{key:"low",dot:"bg-blue-500",text:"text-blue-500"}];function JU({counts:e}){const t=WU.filter(i=>e[i.key]>0);return t.length===0?g.jsx("span",{className:"text-xs text-[#555]",children:"No findings"}):g.jsx("div",{className:"flex items-center gap-3",children:t.map(i=>g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("span",{className:`h-2 w-2 rounded-full ${i.dot}`,"aria-hidden":"true"}),g.jsx("span",{className:`text-xs tabular-nums ${i.text}`,children:e[i.key]})]},i.key))})}function W1(e){if(!e)return null;const t=e.trim().replace(" UTC","Z").replace(" ","T"),i=new Date(t);return Number.isNaN(i.getTime())?null:i.toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function eH({runs:e,activeRun:t,onSelectRun:i,onVerifyClick:a}){const s=(e==null?void 0:e.count)??0;return!e||e.locked?g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center",children:[g.jsx("div",{className:"mx-auto mb-4 flex h-11 w-11 items-center justify-center rounded-xl",style:{border:"1px solid #2a2a2a",background:"rgba(255,255,255,0.04)"},children:g.jsx(Is,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"})}),g.jsx("h2",{className:"text-base font-semibold text-white",children:"Browse every run on this machine"}),g.jsxs("p",{className:"mx-auto mt-1.5 max-w-md text-sm text-[#888]",children:["You have ",s," past ",s===1?"run":"runs"," on this machine."]}),g.jsx("button",{onClick:a,className:"mt-4 cursor-pointer rounded-lg bg-white px-4 py-2 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:"View runs"}),g.jsxs("p",{className:"mt-4 flex items-center justify-center gap-1.5 text-xs text-[#555]",children:[g.jsx(g_,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Or open one from the CLI with"," ",g.jsx("code",{className:"font-mono text-[#888]",children:"strix view "})]})]}):e.runs.length===0?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center text-sm text-[#888]",children:"No past runs found on this machine yet."}):g.jsx("div",{className:"space-y-2",children:e.runs.map(l=>{const c=l.name===t,d=W1(l.start_time)??W1(l.end_time);return g.jsxs("button",{onClick:()=>i(l.name),className:`group flex w-full cursor-pointer items-center gap-4 rounded-lg border px-4 py-3 text-left transition-colors ${c?"border-[#444] bg-[rgba(255,255,255,0.04)]":"border-[#222] bg-[rgba(255,255,255,0.02)] hover:border-[#444]"}`,children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx("span",{className:"truncate text-sm font-medium text-white",children:l.name}),c&&g.jsx("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-400",style:{border:"1px solid rgba(16,185,129,0.3)"},children:"Active"})]}),g.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-[#666]",children:[l.target&&g.jsx("span",{className:"truncate font-mono text-[#888]",children:l.target}),l.target&&(l.scan_mode||d||l.status)&&g.jsx("span",{className:"text-[#333]",children:"·"}),l.scan_mode&&g.jsx("span",{className:"capitalize",children:l.scan_mode}),d&&g.jsx("span",{className:"text-[#333]",children:"·"}),d&&g.jsx("span",{children:d}),l.status&&g.jsx("span",{className:"text-[#333]",children:"·"}),l.status&&g.jsx("span",{className:"capitalize",children:l.status})]})]}),g.jsx(JU,{counts:l.severity_counts}),g.jsx(v2,{className:"h-4 w-4 flex-shrink-0 text-[#555] transition-colors group-hover:text-[#aaa]","aria-hidden":"true"})]},l.name)})})}const J1={work_email_required:"Please use your work email, not a personal one.",rate_limited:"Too many requests. Wait a minute and try again.",invalid_email:"That email does not look right. Check it and try again.",unavailable:"The email service is unavailable right now. Try again shortly."},tH={forbidden:"This email was unsubscribed from Strix, so we cannot send to it.",too_large:"This report is too large to email. Try a smaller run.",unavailable:"The email service is unavailable right now. Try again shortly."},nH=new Set(["gmail.com","googlemail.com","yahoo.com","ymail.com","outlook.com","hotmail.com","live.com","icloud.com","me.com","aol.com","proton.me","protonmail.com","gmx.com","mail.com"]);function iH({activeRun:e,auth:t,purpose:i,skipDisclosure:a=!1,onAuthChanged:s,onExit:l}){const c=(t==null?void 0:t.verified)===!0,d=i==="verify",[h,f]=re.useState(()=>d?"email":a?c?"sending":"email":"disclosure"),[m,p]=re.useState((t==null?void 0:t.email)??""),[y,x]=re.useState(""),[_,N]=re.useState(!1),[S,w]=re.useState(null),[k,E]=re.useState(null),[O,I]=re.useState(""),[R,H]=re.useState(""),[j,Z]=re.useState(!1),[z,q]=re.useState(""),K=re.useRef(!1),Y=async()=>{f("sending"),w(null);const F=await XU(e);if(F.ok){Ts("report_sent"),I(F.password),H(F.filename),f("password");return}if(F.error==="reverify"||F.error==="unverified"){E("Your verification expired. Enter your email to verify again."),f("email");return}w(tH[F.error]??"Could not send the report. Try again."),f("disclosure")},C=()=>{w(null),E(null),c?Y():f("email")};re.useEffect(()=>{!d&&a&&c&&!K.current&&(K.current=!0,Y())},[]);const $=async()=>{const F=m.trim();if(!F){w("Enter your email to continue.");return}const A=F.slice(F.lastIndexOf("@")+1).toLowerCase();if(nH.has(A)){Ts("work_email_required"),w(J1.work_email_required);return}N(!0),w(null);const L=await GU(F);N(!1),L.ok?(Ts("email_submitted",{purpose:i}),E(`We sent a 6-digit code to ${F}.`),f("code")):(L.error==="work_email_required"&&Ts("work_email_required"),w(J1[L.error]??"Could not send a code. Try again."))},M=async()=>{const F=y.trim();if(F.length<4){w("Enter the 6-digit code from your email.");return}N(!0),w(null);const A=await VU(m.trim(),F);if(N(!1),!A.verified){w("That code did not match. Check it and try again.");return}Ts("email_verified",{purpose:i}),q(A.email),s(),d?l("history"):Y()},B=async()=>{try{await navigator.clipboard.writeText(O),Z(!0),setTimeout(()=>Z(!1),1500)}catch{}},X=z||(t==null?void 0:t.email)||m.trim();return g.jsxs("div",{className:"mx-auto max-w-md space-y-4",children:[g.jsxs("button",{onClick:()=>l(d?"history":"overview"),className:"cursor-pointer inline-flex items-center gap-1.5 text-sm text-[#888] transition-colors hover:text-white",children:[g.jsx(i_,{className:"h-4 w-4"}),d?"Back to past runs":"Back to results"]}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(ap,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"}),g.jsx("h1",{className:"text-2xl font-semibold text-white",children:d?"Verify your email":"Email report"})]}),g.jsxs("div",{className:"w-full rounded-2xl bg-[rgba(255,255,255,0.02)] p-6",style:{border:"1px solid #2a2a2a"},children:[g.jsx("p",{className:"mb-4 text-xs text-[#666]",children:d?"We send a one-time code to confirm it is you.":"Verified by a one-time code sent to your email"}),S&&g.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-red-500/30 bg-red-500/5 px-3 py-2",children:[g.jsx(l_,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-red-400","aria-hidden":"true"}),g.jsx("p",{className:"text-xs text-red-300",children:S})]}),k&&!S&&h!=="password"&&g.jsx("p",{className:"mb-4 text-xs text-[#888]",children:k}),h==="disclosure"&&g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-2.5 rounded-lg p-3.5",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsxs("div",{className:"flex items-start gap-2.5",children:[g.jsx(sp,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("p",{className:"text-xs leading-relaxed text-[#aaa]",children:["Viewing stays local and nothing is uploaded. Emailing is an explicit opt-in: we send an ",g.jsx("span",{className:"text-white",children:"encrypted PDF"}),"."]})]}),g.jsxs("div",{className:"flex items-start gap-2.5",children:[g.jsx(lT,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-[#888]","aria-hidden":"true"}),g.jsx("p",{className:"text-xs leading-relaxed text-[#aaa]",children:"The report is encrypted with a password that only you hold. Strix cannot read it and never stores it. We collect only your email so we can send it."})]})]}),g.jsx("button",{onClick:C,className:"w-full cursor-pointer rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:c?"Email me the encrypted PDF":"Continue with your email"}),c&&(t==null?void 0:t.email)&&g.jsxs("p",{className:"text-center text-xs text-[#666]",children:["Sending to ",t.email]})]}),h==="email"&&g.jsxs("form",{className:"space-y-4",onSubmit:F=>{F.preventDefault(),$()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your work email"}),g.jsx("input",{type:"email",autoFocus:!0,value:m,onChange:F=>p(F.target.value),placeholder:"you@company.com",className:"w-full rounded-lg bg-black px-3 py-2.5 text-sm text-white outline-none transition-colors focus:border-[#444]",style:{border:"1px solid #2a2a2a"}}),g.jsx("span",{className:"mt-1.5 block text-[11px] text-[#666]",children:"Use your work email."})]}),g.jsxs("button",{type:"submit",disabled:_,className:"flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90 disabled:opacity-60",children:[_&&g.jsx(nh,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Send me a code"]})]}),h==="code"&&g.jsxs("form",{className:"space-y-4",onSubmit:F=>{F.preventDefault(),M()},children:[g.jsxs("label",{className:"block",children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"6-digit code"}),g.jsx("input",{inputMode:"numeric",autoFocus:!0,value:y,onChange:F=>x(F.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"123456",className:"w-full rounded-lg bg-black px-3 py-2.5 text-center text-lg font-mono tracking-[0.4em] text-white outline-none transition-colors focus:border-[#444]",style:{border:"1px solid #2a2a2a"}})]}),g.jsxs("button",{type:"submit",disabled:_,className:"flex w-full cursor-pointer items-center justify-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90 disabled:opacity-60",children:[_&&g.jsx(nh,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),d?"Verify":"Verify and send"]}),g.jsx("button",{type:"button",onClick:()=>{f("email"),w(null),E(null)},className:"w-full cursor-pointer text-center text-xs text-[#666] transition-colors hover:text-[#aaa]",children:"Use a different email"})]}),h==="sending"&&g.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[g.jsx(nh,{className:"h-6 w-6 animate-spin text-white","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-[#aaa]",children:"Generating and encrypting locally..."})]}),h==="password"&&g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2.5",children:[g.jsx(js,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-emerald-400","aria-hidden":"true"}),g.jsxs("p",{className:"text-xs text-emerald-200",children:["Sent to ",X,". Open the attached PDF with this password."]})]}),g.jsxs("div",{children:[g.jsx("span",{className:"mb-1.5 block text-xs text-[#888]",children:"Your one-time password"}),g.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-black p-3",style:{border:"1px solid #2a2a2a"},children:[g.jsx("code",{className:"flex-1 break-all font-mono text-base text-white",children:O}),g.jsxs("button",{onClick:B,className:"flex cursor-pointer items-center gap-1 rounded-md px-2 py-1 text-xs text-[#aaa] transition-colors hover:bg-[rgba(255,255,255,0.06)] hover:text-white",style:{border:"1px solid #2a2a2a"},children:[j?g.jsx(js,{className:"h-3.5 w-3.5"}):g.jsx(rl,{className:"h-3.5 w-3.5"}),j?"Copied":"Copy"]})]}),g.jsxs("p",{className:"mt-2 text-xs text-[#666]",children:["Save this now. Strix never stores it, so we cannot show it again. File:"," ",g.jsx("span",{className:"font-mono text-[#888]",children:R})]})]}),g.jsx("button",{onClick:()=>l("overview"),className:"w-full cursor-pointer rounded-lg px-4 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-[rgba(255,255,255,0.06)]",style:{border:"1px solid #2a2a2a"},children:"Done"})]})]})]})}const rH=[{icon:s_,text:"Continuous coverage: scheduled pentests and attack surface monitoring"},{icon:FT,text:"One-click autofix that opens a retested pull request"},{icon:h_,text:"Two-way sync to Jira, Linear, and Slack"},{icon:b_,text:"Your whole team, with roles and shared history"}];function aH({feature:e}){const t=e.icon;return g.jsx("div",{className:"mx-auto w-full max-w-lg",children:g.jsxs("div",{className:"rounded-2xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center",children:[g.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-xl",style:{border:"1px solid #2a2a2a",background:"rgba(255,255,255,0.04)"},children:g.jsx(t,{className:"h-5 w-5 text-[#888]","aria-hidden":"true"})}),g.jsx("div",{className:"mt-4 flex justify-center",children:g.jsx(Au,{label:e.tier})}),g.jsx("h2",{className:"mt-3 text-2xl font-semibold text-white",children:e.headline}),g.jsx("p",{className:"mx-auto mt-2 max-w-md text-sm text-[#888]",children:e.description}),g.jsxs("div",{className:"mt-6 rounded-xl p-4 text-left",style:{border:"1px solid #222",background:"rgba(255,255,255,0.02)"},children:[g.jsx("p",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-[#666]",children:"Included in Strix Pro"}),g.jsx("ul",{className:"space-y-2.5",children:rH.map(i=>{const a=i.icon;return g.jsxs("li",{className:"flex items-start gap-2.5",children:[g.jsx(a,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-[#888]","aria-hidden":"true"}),g.jsx("span",{className:"text-sm text-[#aaa]",children:i.text})]},i.text)})})]}),g.jsxs("div",{className:"mt-6 flex flex-col items-center gap-3",children:[g.jsxs("a",{href:gr(Vs,e.slug),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi(e.slug,"feature_page"),className:"inline-flex w-full items-center justify-center gap-1.5 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-black transition-opacity hover:opacity-90",children:["Start free",g.jsx(zs,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),g.jsxs("a",{href:gr(JT,e.slug),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi(e.slug,"feature_page_plans"),className:"inline-flex items-center gap-1 text-xs text-[#888] transition-colors hover:text-white",children:["View all plans",g.jsx(zs,{className:"h-3 w-3","aria-hidden":"true"})]})]})]})})}const sH="Your findings stay on your machine. They're rendered here locally in your browser and never uploaded or stored by Strix. Emailing a report is an explicit opt-in that sends an encrypted copy only you can open.",e_=["critical","high","medium","low"],oH=500,lH=[{title:"One-click autofix + open a fix PR",desc:"Fix it for you and open a PR, retested.",slug:"autofix",icon:cu},{title:"Export SOC 2 / ISO 27001 report",desc:"Share an auditor-ready report with your team.",slug:"compliance",icon:H2}],cH=[{title:"Scheduled pentesting",desc:"Continuous coverage for your whole org.",slug:"scheduled",icon:s_},{title:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",icon:m_},{title:"PR reviews",desc:"Pentest every pull request your team opens.",slug:"pr_reviews",icon:ip}];function uH(){const[e,t]=re.useState(null),[i,a]=re.useState(null),[s,l]=re.useState(null),[c,d]=re.useState(null),[h,f]=re.useState("overview"),[m,p]=re.useState(null),[y,x]=re.useState(null),[_,N]=re.useState(null),[S,w]=re.useState("report"),[k,E]=re.useState(!1),O=re.useCallback(async()=>{try{x(await FU())}catch{}},[]),I=re.useCallback(async()=>{try{N(await PU())}catch{}},[]);re.useEffect(()=>{O(),I()},[O,I]);const R=re.useRef(!1);re.useEffect(()=>{let F=!1,A;R.current=!1;const L=()=>{A=setTimeout(V,oH)},V=async()=>{if(!F)try{const{summary:D,raw:G,finished:U}=await UN(e);if(F)return;if(U&&!R.current){R.current=!0;const Q=await Q1(e);F||a(Q);return}const[W,J]=await Promise.all([$N(e).catch(()=>({agents:[],events:[]})),HN(D.runId,e).catch(()=>[])]);if(F)return;a(Q=>({summary:D,raw:G,finished:U,transcript:W,vulnerabilities:J,reportMarkdown:(Q==null?void 0:Q.reportMarkdown)??null})),L()}catch(D){if(F)return;l(D instanceof Error?D.message:"Could not load run data."),L()}};return(async()=>{try{const D=await Q1(e);if(F)return;a(D),D.finished?R.current=!0:L()}catch(D){if(F)return;l(D instanceof Error?D.message:"Could not load run data."),L()}})(),()=>{F=!0,A&&clearTimeout(A)}},[e]);const H=re.useMemo(()=>i?$U(i.vulnerabilities):null,[i]),j=(i==null?void 0:i.vulnerabilities.find(F=>F.id===c))??null,Z=(i==null?void 0:i.transcript.agents.length)??0,z=(y==null?void 0:y.verified)===!0,q=re.useCallback(F=>{t(F),d(null),a(null),l(null),f("overview")},[]),K=re.useCallback((F,A)=>{gi("email_report",A),w("report"),E(F),f("email")},[]),Y=re.useCallback(()=>K(!1,"sidebar"),[K]),C=re.useCallback(()=>K(!0,"overview"),[K]),$=re.useCallback(()=>{gi("history_unlock","past_runs"),w("verify"),E(!1),f("email")},[]),M=re.useCallback(()=>{I(),f("history")},[I]),B=re.useCallback(F=>{gi(F,"sidebar_nav"),p(F),f("feature")},[]),X=re.useCallback(async()=>{await YU(),await O(),await I()},[O,I]);return g.jsxs("div",{className:"min-h-screen bg-black text-white flex",children:[g.jsx(QU,{view:h,onSelectView:F=>{F==="history"?M():f(F)},activeFeature:m,onSelectFeature:B,issuesCount:(i==null?void 0:i.vulnerabilities.length)??0,agentCount:Z,runCount:(_==null?void 0:_.count)??0,verified:z,email:(y==null?void 0:y.email)??null,onOpenEmail:Y,onOpenHistory:M,onForget:()=>void X()}),g.jsxs("div",{className:"flex-1 min-w-0",children:[g.jsx("div",{className:"border-b border-[#222]",children:g.jsxs("div",{className:"max-w-[72rem] mx-auto px-6 py-4 flex items-center gap-1.5",children:[g.jsxs("a",{href:gr("https://app.strix.ai","logo"),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("logo","topbar"),className:"flex items-center gap-1.5 opacity-90 transition-opacity hover:opacity-100 lg:hidden",title:"Open Strix Cloud",children:[g.jsx("img",{src:"./logo.png",alt:"Strix",className:"w-10 h-8 object-cover"}),g.jsx("div",{className:"text-base text-white font-medium tracking-tight",children:"Strix"})]}),g.jsx("span",{className:"text-xs text-[#666]",children:"Local results"}),i&&g.jsx(fH,{finished:i.finished}),g.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[z&&_&&!_.locked&&_.runs.length>0&&g.jsx(dH,{runs:_,activeRun:e,launchedName:(i==null?void 0:i.summary.runName)??(i==null?void 0:i.summary.runId)??"Current run",onSelect:q}),g.jsxs("a",{href:gr(Vs,"run_in_cloud"),target:"_blank",rel:"noopener noreferrer",onClick:()=>gi("run_in_cloud","topbar"),className:"inline-flex items-center gap-1 rounded-lg bg-white px-3 py-1.5 text-xs font-semibold text-black transition-opacity hover:opacity-90",children:["Run in the cloud",g.jsx(zs,{className:"w-3 h-3","aria-hidden":"true"})]})]})]})}),g.jsxs("div",{className:"max-w-[72rem] mx-auto px-6 py-8 space-y-6",children:[h!=="feature"&&h!=="email"&&g.jsxs("div",{className:"rounded-lg px-4 py-3 flex gap-3 items-start",style:{border:"1px solid rgba(255,255,255,0.08)"},children:[g.jsx(sp,{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-emerald-400","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-[#aaa] leading-relaxed",children:sH})]}),s&&!i&&h!=="history"&&h!=="email"&&h!=="feature"&&g.jsxs("div",{className:"rounded-lg px-4 py-3 flex gap-3 items-start border border-red-500/30 bg-red-500/5",children:[g.jsx(l_,{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-red-400","aria-hidden":"true"}),g.jsx("p",{className:"text-sm text-red-300",children:s})]}),h==="email"?g.jsx(iH,{activeRun:e,auth:y,purpose:S,skipDisclosure:k,onAuthChanged:()=>{O(),I()},onExit:F=>f(F==="history"?"history":"overview")}):h==="feature"&&m&&tp[m]?g.jsx(aH,{feature:tp[m]}):h==="history"?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(Is,{className:"w-5 h-5 text-[#888]","aria-hidden":"true"}),g.jsx("h1",{className:"text-2xl font-semibold text-white",children:"Past runs"})]}),g.jsx(eH,{runs:_,activeRun:e,onSelectRun:q,onVerifyClick:$})]}):!i&&!s?g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-10 text-center",children:[g.jsx("div",{className:"w-6 h-6 mx-auto mb-3 rounded-full border-2 border-[#333] border-t-white animate-spin"}),g.jsx("p",{className:"text-sm text-[#888]",children:"Loading run data…"})]}):i&&H?g.jsxs(g.Fragment,{children:[g.jsx(mH,{summary:i.summary}),g.jsxs("div",{className:"flex gap-5 border-b border-[#2a2a2a] lg:hidden",children:[g.jsx(Em,{active:h==="overview",onClick:()=>f("overview"),children:"Overview"}),g.jsxs(Em,{active:h==="issues",onClick:()=>f("issues"),children:["Issues",i.vulnerabilities.length>0?` (${i.vulnerabilities.length})`:""]}),Z>0&&g.jsxs(Em,{active:h==="agents",onClick:()=>f("agents"),children:["Agents (",Z,")"]})]}),h==="overview"?g.jsx(yH,{summary:i.summary,counts:H,total:i.vulnerabilities.length,reportMarkdown:i.reportMarkdown,onOpenEmail:C}):h==="agents"&&Z>0?g.jsx(vH,{run:i}):j?g.jsxs("div",{className:"space-y-4",children:[g.jsxs("button",{onClick:()=>d(null),className:"cursor-pointer inline-flex items-center gap-1.5 text-sm text-[#888] hover:text-white transition-colors",children:[g.jsx(i_,{className:"w-4 h-4"})," Back to all findings"]}),g.jsx(T4,{vulnerability:j})]}):g.jsx(pH,{vulnerabilities:i.vulnerabilities,finished:i.finished,onSelect:F=>d(F)})]}):null]})]})]})}function dH({runs:e,activeRun:t,launchedName:i,onSelect:a}){const[s,l]=re.useState(!1),c=t??i;return g.jsxs("div",{className:"relative",children:[g.jsxs("button",{onClick:()=>l(d=>!d),onBlur:()=>setTimeout(()=>l(!1),150),className:"flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs text-[#aaa] transition-colors hover:text-white",style:{border:"1px solid #2a2a2a"},children:[g.jsx(Is,{className:"w-3.5 h-3.5","aria-hidden":"true"}),g.jsx("span",{className:"max-w-[160px] truncate",children:c}),g.jsx(o_,{className:"w-3.5 h-3.5","aria-hidden":"true"})]}),s&&g.jsx("div",{className:"absolute right-0 z-50 mt-1.5 max-h-80 w-64 overflow-y-auto rounded-lg py-1 shadow-xl",style:{border:"1px solid #2a2a2a",background:"#0a0a0a"},children:e.runs.map(d=>{const h=d.name===t;return g.jsxs("button",{onMouseDown:()=>a(d.name),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-[rgba(255,255,255,0.06)] ${h?"text-white":"text-[#aaa]"}`,children:[g.jsxs("span",{className:"min-w-0 flex-1",children:[g.jsx("span",{className:"block truncate",children:d.name}),d.target&&g.jsx("span",{className:"block truncate font-mono text-[#666]",children:d.target})]}),h&&g.jsx("span",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-emerald-400"})]},d.name)})})]})}function fH({finished:e}){return e?g.jsxs("span",{className:"ml-3 inline-flex items-center gap-1.5 text-xs text-[#888]",children:[g.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[#555]"}),"Complete"]}):g.jsxs("span",{className:"ml-3 inline-flex items-center gap-1.5 text-xs text-emerald-400",children:[g.jsxs("span",{className:"relative flex h-1.5 w-1.5",children:[g.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75 animate-ping"}),g.jsx("span",{className:"relative inline-flex h-1.5 w-1.5 rounded-full bg-emerald-400"})]}),"Live"]})}function hH(e){if(e==null)return null;if(e<60)return`${e}s`;const t=Math.floor(e/60);return t<60?`${t}m`:`${Math.floor(t/60)}h ${t%60}m`}function mH({summary:e}){const t=hH(e.durationSeconds);return g.jsxs("div",{children:[g.jsx("h1",{className:"text-2xl font-semibold text-white",children:e.runName??e.runId??"Scan results"}),g.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-[#888]",children:[e.targets.length>0&&g.jsx("span",{className:"font-mono text-[#aaa]",children:e.targets.join(", ")}),e.scanMode&&g.jsx(wm,{label:e.scanMode}),t&&g.jsx(wm,{label:t}),e.status&&g.jsx(wm,{label:e.status})]})]})}function wm({label:e}){return g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"text-[#333]",children:"·"}),g.jsx("span",{className:"capitalize",children:e})]})}function pH({vulnerabilities:e,finished:t,onSelect:i}){const a=[...e].sort((s,l)=>e_.indexOf(s.severity)-e_.indexOf(l.severity));return a.length===0?g.jsxs("div",{className:"space-y-4",children:[g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-8 text-center text-sm text-[#888]",children:t?"No findings in this run.":"No findings yet. The scan is still running…"}),t&&g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsx("p",{className:"text-sm font-medium text-white",children:"Stay ahead of new exposures"}),g.jsx("p",{className:"mt-0.5 mb-3 text-xs text-[#666]",children:"Attack surface monitoring catches new exposures for your org over time."}),g.jsx(Rs,{label:"Attack surface monitoring",desc:"Continuous coverage for your whole org.",slug:"asm",surface:"empty_state",icon:m_})]})]}):g.jsx("div",{className:"space-y-2",children:a.map(s=>g.jsxs("button",{onClick:()=>i(s.id),className:"cursor-pointer w-full text-left rounded-lg border border-[#222] hover:border-[#444] bg-[rgba(255,255,255,0.02)] px-4 py-3 transition-colors flex items-center gap-3",children:[g.jsx("span",{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${op(s.severity)}`,"aria-hidden":"true"}),g.jsxs("span",{className:"flex-1 min-w-0",children:[g.jsx("span",{className:"block text-sm font-medium text-white truncate",children:s.title}),s.target&&g.jsx("span",{className:"block text-xs text-[#666] font-mono truncate",children:s.target})]}),g.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full border capitalize ${y_[s.severity]}`,children:s.severity})]},s.id))})}function gH(e){return e.replace(/^\s*#{1,6}[ \t]+.*(?:\r?\n)+/,"").trimStart()}function bH(e){const t=[];let i=null;for(const a of e.split(` `)){const s=a.match(/^#{1,6}\s+(.*)$/);if(s){const l=s[1].trim().toLowerCase();if(l===i)continue;i=l}else a.trim()!==""&&(i=null);t.push(a)}return t.join(` -`)}function xH({onOpenEmail:e}){return g.jsx("button",{onClick:e,className:"group w-full cursor-pointer rounded-xl border border-emerald-500/25 bg-emerald-500/[0.06] p-4 text-left transition-colors hover:border-emerald-500/40",children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-lg",style:{border:"1px solid rgba(16,185,129,0.3)",background:"rgba(16,185,129,0.08)"},children:g.jsx(ap,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"})}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("p",{className:"text-sm font-semibold text-white",children:"Email an encrypted PDF report of this run"}),g.jsx("p",{className:"mt-0.5 text-xs text-[#888]",children:"Encrypted with a key only you can see, email verified with a one-time code before sending."})]}),g.jsx("span",{className:"flex-shrink-0 rounded-lg bg-white px-3 py-1.5 text-xs font-semibold text-black transition-opacity group-hover:opacity-90",children:"Email report"})]})})}function yH({summary:e,counts:t,total:i,reportMarkdown:a,onOpenEmail:s}){const l=[["Executive Summary",e.executiveSummary],["Technical Analysis",e.technicalAnalysis],["Methodology",e.methodology],["Recommendations",e.recommendations]].filter(([,c])=>!!c).map(([c,d])=>({title:c,content:gH(d)}));return g.jsxs("div",{className:"space-y-6",children:[i>0&&g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:g.jsx(A4,{findings:{total:i,...t}})}),g.jsx(xH,{onOpenEmail:s}),l.length>0?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5 space-y-8",children:l.map(c=>g.jsx(ia,{title:c.title,content:c.content},c.title))}):a?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:g.jsx(ia,{content:bH(a)})}):i===0&&g.jsx("p",{className:"text-sm text-[#888]",children:"No summary available for this run yet."}),g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:lH.map(c=>g.jsx(qx,{item:c,surface:"overview"},c.slug))}),g.jsxs("div",{children:[g.jsx("p",{className:"mb-2 text-sm font-semibold text-white",children:"Continuous coverage for your org"}),g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:cH.map(c=>g.jsx(qx,{item:c,surface:"overview"},c.slug))})]})]})}function Em({active:e,onClick:t,children:i}){return g.jsxs("button",{onClick:t,className:`cursor-pointer relative pb-2.5 text-sm font-semibold transition-colors ${e?"text-white":"text-[#666] hover:text-white"}`,children:[i,e&&g.jsx("span",{className:"absolute bottom-0 inset-x-0 h-0.5 bg-white rounded-full"})]})}function vH({run:e}){const{agents:t,events:i}=e.transcript,a=re.useMemo(()=>AU(t,i),[t,i]),[s,l]=re.useState(null),c=s?t.find(d=>d.id===s)??null:null;return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(x_,{className:"w-4 h-4 text-[#888]","aria-hidden":"true"}),g.jsx("h2",{className:"text-sm font-semibold text-white",children:"Agent graph"}),g.jsxs("span",{className:"text-xs text-[#666]",children:[t.length," agent",t.length===1?"":"s"]})]}),g.jsx("p",{className:"mt-1 mb-4 text-xs text-[#666]",children:"Click an agent to open its full transcript."}),g.jsx("div",{className:"h-[480px] rounded-lg border border-[#1a1a1a] overflow-hidden",children:g.jsx(b9,{agents:a,selectedAgentId:s,onSelectAgent:d=>l(d),eventsLoaded:!0,eventsEmpty:a.size===0,scanCompleted:e.finished})})]}),g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsx("p",{className:"text-sm font-semibold text-white",children:"Drive the agents live"}),g.jsx("p",{className:"mt-0.5 text-xs text-[#666]",children:"Steer and re-run this scan from the web."}),g.jsxs("div",{className:"mt-3 flex flex-wrap gap-2.5",children:[g.jsx(Rs,{label:"Steer agents from the web",desc:"Guide the agents live while they scan.",slug:"live_scan_prompt",icon:NT}),g.jsx(Rs,{label:"Re-run in Strix Cloud with more depth",desc:"Run this scan on managed infra with more depth.",slug:"live_scan",icon:AT})]})]}),c&&g.jsx(RU,{agent:c,events:i,onClose:()=>l(null)})]})}Jk.createRoot(document.getElementById("root")).render(g.jsx(re.StrictMode,{children:g.jsx(uH,{})})); +`)}function xH({onOpenEmail:e}){return g.jsx("button",{onClick:e,className:"group w-full cursor-pointer rounded-xl border border-emerald-500/25 bg-emerald-500/[0.06] p-4 text-left transition-colors hover:border-emerald-500/40",children:g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("div",{className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-lg",style:{border:"1px solid rgba(16,185,129,0.3)",background:"rgba(16,185,129,0.08)"},children:g.jsx(ap,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"})}),g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("p",{className:"text-sm font-semibold text-white",children:"Email an encrypted PDF report of this run"}),g.jsx("p",{className:"mt-0.5 text-xs text-[#888]",children:"Encrypted with a key only you can see, email verified with a one-time code before sending."})]}),g.jsx("span",{className:"flex-shrink-0 rounded-lg bg-white px-3 py-1.5 text-xs font-semibold text-black transition-opacity group-hover:opacity-90",children:"Email report"})]})})}function yH({summary:e,counts:t,total:i,reportMarkdown:a,onOpenEmail:s}){const l=[["Executive Summary",e.executiveSummary],["Technical Analysis",e.technicalAnalysis],["Methodology",e.methodology],["Recommendations",e.recommendations]].filter(([,c])=>!!c).map(([c,d])=>({title:c,content:gH(d)}));return g.jsxs("div",{className:"space-y-6",children:[i>0&&g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:g.jsx(A4,{findings:{total:i,...t}})}),g.jsx(xH,{onOpenEmail:s}),l.length>0?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5 space-y-8",children:l.map(c=>g.jsx(ia,{title:c.title,content:c.content},c.title))}):a?g.jsx("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:g.jsx(ia,{content:bH(a)})}):i===0&&g.jsx("p",{className:"text-sm text-[#888]",children:"No summary available for this run yet."}),g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:lH.map(c=>g.jsx(qx,{item:c,surface:"overview"},c.slug))}),g.jsxs("div",{children:[g.jsx("p",{className:"mb-2 text-sm font-semibold text-white",children:"Continuous coverage for your org"}),g.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:cH.map(c=>g.jsx(qx,{item:c,surface:"overview"},c.slug))})]})]})}function Em({active:e,onClick:t,children:i}){return g.jsxs("button",{onClick:t,className:`cursor-pointer relative pb-2.5 text-sm font-semibold transition-colors ${e?"text-white":"text-[#666] hover:text-white"}`,children:[i,e&&g.jsx("span",{className:"absolute bottom-0 inset-x-0 h-0.5 bg-white rounded-full"})]})}function vH({run:e}){const{agents:t,events:i}=e.transcript,a=re.useMemo(()=>AU(t,i),[t,i]),[s,l]=re.useState(null),c=s?t.find(d=>d.id===s)??null:null;return g.jsxs("div",{className:"space-y-5",children:[g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsx(x_,{className:"w-4 h-4 text-[#888]","aria-hidden":"true"}),g.jsx("h2",{className:"text-sm font-semibold text-white",children:"Agent graph"}),g.jsxs("span",{className:"text-xs text-[#666]",children:[t.length," agent",t.length===1?"":"s"]})]}),g.jsx("p",{className:"mt-1 mb-4 text-xs text-[#666]",children:"Click an agent to open its full transcript."}),g.jsx("div",{className:"h-[480px] rounded-lg border border-[#1a1a1a] overflow-hidden",children:g.jsx(b9,{agents:a,selectedAgentId:s,onSelectAgent:d=>l(d),eventsLoaded:!0,eventsEmpty:a.size===0,scanCompleted:e.finished})})]}),g.jsxs("div",{className:"rounded-xl border border-[#222] bg-[rgba(255,255,255,0.02)] p-5",children:[g.jsx("p",{className:"text-sm font-semibold text-white",children:"Drive the agents live"}),g.jsx("p",{className:"mt-0.5 text-xs text-[#666]",children:"Steer and re-run this scan from the web."}),g.jsxs("div",{className:"mt-3 flex flex-wrap gap-2.5",children:[g.jsx(Rs,{label:"Steer agents from the web",desc:"Guide the agents live while they scan.",slug:"live_scan_prompt",surface:"agents",icon:NT}),g.jsx(Rs,{label:"Re-run in Strix Cloud with more depth",desc:"Run this scan on managed infra with more depth.",slug:"live_scan",surface:"agents",icon:AT})]})]}),c&&g.jsx(RU,{agent:c,events:i,onClose:()=>l(null)})]})}Jk.createRoot(document.getElementById("root")).render(g.jsx(re.StrictMode,{children:g.jsx(uH,{})})); diff --git a/strix/viewer/viewer_dist/index.html b/strix/viewer/viewer_dist/index.html index 14fa2608..8e887cea 100644 --- a/strix/viewer/viewer_dist/index.html +++ b/strix/viewer/viewer_dist/index.html @@ -6,7 +6,7 @@ Strix Results - + diff --git a/strix/viewer_src/src/App.tsx b/strix/viewer_src/src/App.tsx index ce0ec421..74ce7e2c 100644 --- a/strix/viewer_src/src/App.tsx +++ b/strix/viewer_src/src/App.tsx @@ -520,6 +520,7 @@ function FindingsList({ label="Attack surface monitoring" desc="Continuous coverage for your whole org." slug="asm" + surface="empty_state" icon={Radar} /> @@ -738,12 +739,14 @@ function AgentsTab({ run }: { run: LoadedRun }) { label="Steer agents from the web" desc="Guide the agents live while they scan." slug="live_scan_prompt" + surface="agents" icon={Radio} />