1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AssessmentsListPage-Dmqdk3xw.js","assets/index-sy1_3QS7.js","assets/index-D_3p_Qv0.css","assets/RowActionsMenu-Bu6iQBX3.js","assets/PageHeader-CmmBonTW.js","assets/Breadcrumbs-qrbEhwT8.js","assets/FilterBar-NRzmk6UT.js","assets/SearchableSelect-CmHQIO9H.js","assets/HeaderActions-CxbjF3py.js","assets/NoOrganizationState-VmrP6Ou0.js","assets/breadcrumbHelper-iVarpcvw.js","assets/useAssessments-D7akjgf5.js","assets/assessmentService-CqWiZtmS.js","assets/git-merge-DJ5IUTsX.js","assets/pencil-CjUDLyw_.js"])))=>i.map(i=>d[i]); 2import{f as $,g as F,r as n,b1 as N,j as e,dH as b,bA as y,aq as _,be as R,cb as S,bF as U,aA as W,bq as C,av as q,bn as G,_ as J,o as A,n as K,aY as V,k as Y,dJ as Q}from"./index-sy1_3QS7.js";import{R as X}from"./RowActionsMenu-Bu6iQBX3.js";import{L as Z}from"./LoadingSpinner-1_m_pQct.js";import{E as ee}from"./EmptyState-DbVuECwp.js";import{P as te}from"./PageHeader-CmmBonTW.js";import{H as ae}from"./HeaderActions-CxbjF3py.js";import{T as re}from"./Tabs-BqiVQUum.js";import{u as se}from"./useTabSync-UIXE_0Hh.js";import{E as ne}from"./EmbeddedPageWrapper-CbniC2fz.js";import{c as ie,t as de}from"./useAgentArena-BLfYk1DH.js";import{u as le}from"./useOrganizationListener-KYaoF98f.js";import{b as oe}from"./breadcrumbHelper-iVarpcvw.js";import{N as ce}from"./NoOrganizationState-VmrP6Ou0.js";import{u as me}from"./useResolvedPlanIds-UeyVG6jG.js";import"./Breadcrumbs-qrbEhwT8.js";import"./readOnlyRegionPolicy-BAPRmXma.js";const xe=n.lazy(()=>J(()=>import("./AssessmentsListPage-Dmqdk3xw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])));function Ee(){const s=$(),d=F().pathname.startsWith("/intelligence-hub"),[l,I]=se("arena"),p=d?"arena":l;n.useEffect(()=>{!d&&l==="scenarios"&&s("/intelligence-hub?tab=scenarios",{replace:!0})},[d,l,s]);const[i,h]=n.useState(()=>localStorage.getItem("last_org_id")||null),[ue,f]=n.useState(()=>localStorage.getItem("last_org_name")||""),{resolvedPlanIds:w}=me(i),[E,x]=n.useState(!1),[o,k]=n.useState(null);le(()=>{const t=localStorage.getItem("last_org_id"),a=localStorage.getItem("last_org_name")||"";t&&t!=="all"&&t!==i&&(h(t),f(a))}),n.useEffect(()=>{const t=localStorage.getItem("last_org_id"),a=localStorage.getItem("last_org_name")||"";t&&t!=="all"&&(h(t),f(a))},[]);const{data:v=[],isLoading:D}=ie(i||"",void 0),c=w?v.filter(t=>w.has(t.strategic_plan_id)):v,j=de(),r=N(i,{feature:"ai_assistant",minRole:"MEMBER"}),g=N(i,{minRole:"MEMBER"}),[u,m]=n.useState(null),P=(t,a)=>{g.allowed&&(k({id:t,planName:a}),m(null),x(!0))},T=()=>{o&&i&&g.allowed&&(m(null),j.mutate({runId:o.id,organizationId:i},{onSuccess:()=>{x(!1),k(null)},onError:t=>{m(Q(t)??"Could not delete the review.")}}))},L=t=>{const a={pending:{variant:"default",icon:Y},running:{variant:"info",icon:V},completed:{variant:"success",icon:K},failed:{variant:"error",icon:A},cancelled:{variant:"warning",icon:A}},{variant:B,icon:H}=a[t]||a.pending;return e.jsx(C,{variant:B,icon:e.jsx(H,{className:"w-3 h-3"}),children:t.charAt(0).toUpperCase()+t.slice(1)})},z=t=>{if(t==null)return e.jsx("span",{className:"text-sm text-brand-text-muted dark:text-brand-dark-text-muted",children:"N/A"});let a="text-green-600 dark:text-green-400";return t<40?a="text-red-600 dark:text-red-400":t<60?a="text-orange-600 dark:text-orange-400":t<80&&(a="text-amber-600 dark:text-amber-400"),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`text-lg font-semibold ${a}`,children:Math.round(t)}),e.jsx("span",{className:"text-xs text-brand-text-muted dark:text-brand-dark-text-muted",children:"/ 100"})]})},M=t=>{if(!t)return"N/A";const a=t.includes("T")?t:`${t}T12:00:00`;return new Date(a).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})};if(!i)return e.jsx(ce,{variant:"none-selected",pageTitle:"Strategic Review",pageSubtitle:"Multi-agent strategic plan analysis",pageIcon:e.jsx(b,{className:"w-8 h-8 text-brand-primary"})});const O=D;return e.jsxs(e.Fragment,{children:[!d&&e.jsx("header",{className:"bg-white dark:bg-brand-dark-bg-card border-b border-gray-200 dark:border-brand-dark-border px-6 py-4",children:e.jsx(te,{icon:e.jsx(b,{className:"w-8 h-8 text-brand-primary"}),title:"Strategic Review",subtitle:"Multi-agent strategic plan analysis and recommendations",breadcrumbs:oe(),actions:p==="arena"?e.jsx(ae,{secondary:[e.jsx(R,{variant:"secondary",leftIcon:e.jsx(S,{className:"w-4 h-4"}),onClick:()=>s("/intelligence-hub?tab=scenarios"),children:"Scenario Planning"},"scenarios")],primary:e.jsx(y,{reason:r.reason,disabled:!r.allowed,children:e.jsx("button",{onClick:()=>r.allowed&&s("/agent-arena/new"),disabled:!r.allowed,className:"p-2 bg-amber-700 dark:bg-ai-accent text-white dark:text-brand-dark-text-inverse rounded-md hover:bg-amber-800 dark:hover:bg-ai-accent-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:r.allowed?"New Review":void 0,"aria-label":"New Review","data-tour":"arena-new-btn",children:e.jsx(_,{className:"w-5 h-5"})})})}):void 0})}),!d&&e.jsx(re,{items:[{key:"arena",label:"Reviews"},{key:"assessments",label:"Assessments"}],activeKey:l,onChange:I}),!d&&l==="assessments"&&e.jsx(ne,{children:e.jsx(n.Suspense,{fallback:e.jsx(U,{}),children:e.jsx(xe,{})})}),p==="arena"&&e.jsxs("main",{className:"flex-1 overflow-y-auto p-6",children:[d&&e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("span",{className:"text-xs text-gray-400 dark:text-brand-dark-text-muted",children:[c.length," review",c.length!==1?"s":""]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(R,{variant:"secondary",leftIcon:e.jsx(S,{className:"w-4 h-4"}),onClick:()=>s("/intelligence-hub?tab=scenarios"),children:"Scenario Planning"}),e.jsx(y,{reason:r.reason,disabled:!r.allowed,children:e.jsx("button",{onClick:()=>r.allowed&&s("/agent-arena/new"),disabled:!r.allowed,title:r.allowed?"New Review":void 0,"aria-label":"New Review","data-tour":"arena-new-btn",className:"p-2 bg-amber-700 dark:bg-ai-accent text-white dark:text-brand-dark-text-inverse rounded-md hover:bg-amber-800 dark:hover:bg-ai-accent-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:e.jsx(_,{className:"w-5 h-5"})})})]})]}),O?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(Z,{size:"lg"})}):c.length===0?e.jsx(ee,{icon:e.jsx(b,{className:"w-12 h-12"}),title:"No reviews yet",description:"Start your first Strategic Review to get strategic insights from multiple AI agents.",action:{label:"New Review",onClick:()=>r.allowed&&s("/agent-arena/new"),disabled:!r.allowed,disabledReason:r.reason??void 0}}):e.jsx("div",{className:"bg-white dark:bg-brand-dark-bg-card rounded-lg shadow overflow-hidden","data-tour":"arena-list",children:e.jsx("div",{className:"overflow-x-auto overscroll-x-contain",children:e.jsxs("table",{className:"min-w-full",children:[e.jsx("thead",{className:"soft-amber-surface border-b soft-amber-border",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-brand-text-muted dark:text-brand-dark-text-muted uppercase tracking-wider",children:"Plan"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-brand-text-muted dark:text-brand-dark-text-muted uppercase tracking-wider",children:"Status"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-brand-text-muted dark:text-brand-dark-text-muted uppercase tracking-wider",children:"Date"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-brand-text-muted dark:text-brand-dark-text-muted uppercase tracking-wider",children:"Health Score"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-brand-text-muted dark:text-brand-dark-text-muted uppercase tracking-wider",children:"Findings"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-brand-text-muted dark:text-brand-dark-text-muted uppercase tracking-wider",children:"Recommendations"}),e.jsx("th",{className:"w-12 px-2 py-3","aria-hidden":"true"})]})}),e.jsx("tbody",{className:"bg-white dark:bg-brand-dark-bg-card divide-y divide-gray-200 dark:divide-brand-dark-border",children:c.map(t=>e.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-brand-dark-bg-hover cursor-pointer transition-colors",onClick:()=>{t.status==="running"?s(`/agent-arena/runs/${t.id}/progress`):s(`/agent-arena/runs/${t.id}`)},children:[e.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[e.jsx("div",{className:"text-sm font-medium text-brand-text-primary dark:text-brand-dark-text-primary",children:t.strategic_plan_name||"Unknown Plan"}),e.jsxs("div",{className:"text-xs text-brand-text-muted dark:text-brand-dark-text-muted",children:[t.selected_agents.length," agents"]})]}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:L(t.status)}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-brand-text-muted dark:text-brand-dark-text-muted",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(W,{className:"w-4 h-4"}),M(t.completed_at||t.started_at||t.created_at)]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:z(t.overall_health_score)}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-brand-text-primary dark:text-brand-dark-text-primary",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:t.total_findings}),t.critical_findings_count>0&&e.jsxs(C,{variant:"error",size:"sm",children:[t.critical_findings_count," critical"]})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-brand-text-primary dark:text-brand-dark-text-primary",children:t.total_recommendations}),e.jsx("td",{className:"px-2 py-4 text-right",children:g.allowed&&e.jsx(X,{actions:[{label:"Delete",icon:e.jsx(q,{className:"w-4 h-4"}),onClick:a=>{a.stopPropagation(),P(t.id,t.strategic_plan_name||"Unknown Plan")},variant:"danger"}]})})]},t.id))})]})})}),e.jsx(G,{isOpen:E,onClose:()=>{x(!1),m(null)},onConfirm:T,title:"Delete Review",message:u?`Error: ${u} 3 4Would you like to try again?`:`Are you sure you want to delete this review for "${o==null?void 0:o.planName}"? This action cannot be undone.`,confirmText:u?"Retry Delete":"Delete",isLoading:j.isPending})]})]})}export{Ee as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.