/home/techb158/balavpn.abdallabala.com/.next/cache/webpack/server-production
NameSizeModeActions
0.pack75919080666editdlrm
1.pack13755910666editdlrm
2.pack2103570666editdlrm
3.pack435023240666editdlrm
4.pack8831030666editdlrm
5.pack2236720666editdlrm
6.pack124000666editdlrm
7.pack1863090666editdlrm
8.pack2143630666editdlrm
9.pack7358150666editdlrm
10.pack2358320666editdlrm
11.pack30785860666editdlrm
12.pack33078460666editdlrm
index.pack85782510666editdlrm
index.pack.old85783080666editdlrm
Edit: /home/techb158/balavpn.abdallabala.com/.next/cache/webpack/server-production/2.pack (210357B)
wpc5webpack/lib/cache/PackFileCacheStrategyPackContentItems Compilation/modules|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-loader\index.js!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[16].oneOf[4].use[0]!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\dashboard\page.jsx|rscCompilation/modules|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\dashboard\page.jsx|ssrFlagDependencyExportsPlugin|javascript/auto|C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\dashboard\page.jsx|ssrwebpack/lib/NormalModulewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceT// This file is generated by the Webpack next-flight-loader. import { registerClientReference } from "react-server-dom-webpack/server"; export default registerClientReference( function() { throw new Error("Attempted to call the default export of \"C:\\\\Users\\\\abd_b\\\\OneDrive\\\\Desktop\\\\COSMIC AI-Risk Dashboard\\\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\\\application\\\\saas-app\\\\src\\\\app\\\\dashboard\\\\page.jsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); }, "C:\\Users\\abd_b\\OneDrive\\Desktop\\COSMIC AI-Risk Dashboard\\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\\application\\saas-app\\src\\app\\dashboard\\page.jsx", "default", ); exportsTypenamespace javascript/autorscC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\dashboardaliasmainFieldsconditionNamesfullySpecified`$server-only$client-only$next/dist/compiled/server-only$next/dist/compiled/client-only$C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\head.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\image.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\constants.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\router.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dynamic.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\script.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\link.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\form.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\navigation.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\headers.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\og.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\server.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\document.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\app.jsreact$react/compiler-runtime$react/jsx-dev-runtime$react/jsx-runtime$react-dom$react-dom/client$react-dom/server$react-dom/server.browser$react-dom/server.edge$react-dom/static$react-dom/static.browser$react-dom/static.edge$react-server-dom-webpack/client$react-server-dom-webpack/server$react-server-dom-webpack/server.node$react-server-dom-webpack/static$@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.tsnextnext/dist/compiled/server-only/emptynext/dist/compiled/client-only/errornext/dist/client/components/noop-headnext/dist/api/imagenext/dist/api/constantsnext/dist/api/routernext/dist/api/app-dynamicnext/dist/api/scriptnext/dist/client/app-dir/linknext/dist/client/app-dir/formnext/dist/api/navigation.react-servernext/dist/api/headersnext/dist/api/ognext/dist/api/servernext/dist/api/documentnext/dist/api/appnext/dist/server/route-modules/app-page/vendored/rsc/reactnext/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtimenext/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtimenext/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtimenext/dist/server/route-modules/app-page/vendored/rsc/react-domnext/dist/compiled/react-dom/clientnext/dist/compiled/react-dom/server.nodenext/dist/compiled/react-dom/server.browsernext/dist/build/webpack/alias/react-dom-server.jsnext/dist/compiled/react-dom/static.nodenext/dist/compiled/react-dom/static.browsernext/dist/compiled/react-dom/static.edgenext/dist/compiled/react-server-dom-webpack/client.nodenext/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-servernext/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-staticnext/dist/client/dev/noop-turbopack-hmrC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\nextmodulemainreact-server... `cacheableparsedfileDependenciescontextDependenciesmissingDependenciesbuildDependenciesvalueDependencieshashassetsassetsInfostrictexportsArgumenttopLevelDeclarationssnapshot webpack/lib/util/LazySetC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-loader\index.jsC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-swc-loader.jswebpack/DefinePlugin_hashb5546dede6530496aff90673typeactionIdsclientRefsclientEntryTypeisClientRefclientdefaultauto  __webpack_exports__*default*webpack/lib/FileSystemInfoSnapshot yyBC:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\src\app\dashboard\page.jsxsafeTimetimestamp!vyBvyBa057250d3bb7785dwebpack/lib/dependencies/HarmonyCompatibilityDependency dwebpack/lib/dependencies/ConstDependency`=@ `Jwebpack/lib/dependencies/HarmonyExportHeaderDependencyARAS webpack/lib/dependencies/HarmonyImportSideEffectDependencyreact-server-dom-webpack/server `Jwebpack/lib/dependencies/HarmonyExportExpressionDependency` webpack/lib/dependencies/HarmonyImportSpecifierDependency registerClientReference A   b&   R/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback, useMemo } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { api } from '../../lib/api-client'; import ErrorBoundary from '../../components/ErrorBoundary'; const TABS = [ 'Overview', 'Projects', 'Risks', 'Mitigations', 'Gate', 'Integrations', 'Audit' ]; const PAGE_SIZE = 20; const DIMENSIONS = [ 'Technical', 'Governance', 'Legal', 'Ethical', 'Operational' ]; const LIFECYCLE_PHASES = [ 'Design', 'Development', 'Testing', 'Deployment' ]; const RISK_STATUSES = [ 'OPEN', 'IN_MITIGATION', 'ACCEPTED', 'CLOSED' ]; const MITIGATION_STATUSES = [ 'NOT_STARTED', 'IN_PROGRESS', 'DONE', 'REJECTED' ]; function useToast() { const [toasts, setToasts] = useState([]); const add = useCallback((message, type = 'success')=>{ const id = Date.now() + Math.random(); setToasts((prev)=>[ ...prev, { id, message, type } ]); setTimeout(()=>setToasts((prev)=>prev.filter((t)=>t.id !== id)), 3000); }, []); return { toasts, add }; } function ToastContainer({ toasts }) { if (!toasts.length) return null; return /*#__PURE__*/ _jsx("div", { className: "toast-container", children: toasts.map((t)=>/*#__PURE__*/ _jsx("div", { className: `toast ${t.type}`, children: t.message }, t.id)) }); } function SearchInput({ value, onChange, placeholder }) { return /*#__PURE__*/ _jsxs("div", { className: "search-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "search-icon", children: "⌕" }), /*#__PURE__*/ _jsx("input", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), placeholder: placeholder || 'Search...' }) ] }); } function sortData(list, sortKey, sortDir) { if (!sortKey) return list; return [ ...list ].sort((a, b)=>{ const va = a[sortKey], vb = b[sortKey]; if (va == null) return 1; if (vb == null) return -1; const cmp = typeof va === 'number' ? va - vb : String(va).localeCompare(String(vb)); return sortDir === 'asc' ? cmp : -cmp; }); } function Badge({ children, className }) { return /*#__PURE__*/ _jsx("span", { className: `badge ${className || ''}`, children: children }); } function FormField({ label, children }) { return /*#__PURE__*/ _jsxs("div", { style: { marginBottom: 10 }, children: [ /*#__PURE__*/ _jsx("label", { style: { display: 'block', fontSize: 12, color: 'var(--muted)', marginBottom: 3 }, children: label }), children ] }); } function InlineInput({ value, onChange, type = 'text', min, max, style: extraStyle }) { return /*#__PURE__*/ _jsx("input", { className: "input", type: type, value: value, onChange: (e)=>onChange(e.target.value), min: min, max: max, style: { width: '100%', ...extraStyle } }); } function InlineSelect({ value, onChange, options }) { const items = options || []; return /*#__PURE__*/ _jsxs("select", { className: "input", value: value, onChange: (e)=>onChange(e.target.value), style: { width: '100%' }, children: [ /*#__PURE__*/ _jsx("option", { value: "", children: "— Select —" }), items.map((o)=>{ const val = typeof o === 'object' ? o.value : o; const lbl = typeof o === 'object' ? o.label : o; return /*#__PURE__*/ _jsx("option", { value: val, children: lbl }, val); }) ] }); } function ConfirmDelete({ label, onConfirm, onCancel, deleting }) { return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onCancel, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ "Delete ", label, "?" ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This cannot be undone." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onCancel, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: onConfirm, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete' }) ] }) ] }) }); } function OverviewTab({ project, dashboard }) { const panels = useMemo(()=>{ if (!dashboard) return []; return [ { label: 'Overall Score', value: dashboard.summary?.overallScore ?? '-', cls: dashboard.summary?.overallScore >= 75 ? 'bad' : dashboard.summary?.overallScore >= 50 ? 'warn' : 'good', sub: `Risk level: ${dashboard.summary?.riskLevel || '-'}` }, { label: 'Deployment Gate', value: dashboard.summary?.gateStatus ?? '-', cls: dashboard.summary?.gateStatus === 'Ready' ? 'good' : dashboard.summary?.gateStatus === 'Warning' ? 'warn' : 'bad', sub: dashboard.gate?.message || '' }, { label: 'Open Risks', value: dashboard.summary?.openRisks ?? 0, cls: (dashboard.summary?.openRisks || 0) > 5 ? 'bad' : (dashboard.summary?.openRisks || 0) > 2 ? 'warn' : 'good', sub: `${dashboard.summary?.totalRisks || 0} total risks` }, { label: 'Mitigation', value: `${dashboard.summary?.mitigationCompletion ?? 0}%`, cls: (dashboard.summary?.mitigationCompletion || 0) < 40 ? 'bad' : (dashboard.summary?.mitigationCompletion || 0) < 70 ? 'warn' : 'good', sub: 'Average active-risk completion' } ]; }, [ dashboard ]); if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading dashboard data..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))' }, children: panels.map((p)=>/*#__PURE__*/ _jsxs("div", { className: "metric-card", children: [ /*#__PURE__*/ _jsx("h3", { children: p.label }), /*#__PURE__*/ _jsx("div", { className: `metric-value ${p.cls}`, children: p.value }), /*#__PURE__*/ _jsx("div", { className: "metric-sub", children: p.sub }) ] }, p.label)) }), /*#__PURE__*/ _jsxs("div", { className: "grid", style: { gridTemplateColumns: '1fr 1fr', marginTop: 18 }, children: [ /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Dimensions" }), (dashboard.dimensions || []).map((dim)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: dim.name }), /*#__PURE__*/ _jsx("strong", { style: { fontSize: 13 }, children: dim.score }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: `${Math.min(dim.score, 100)}%`, background: dim.score >= 50 ? 'var(--danger)' : dim.score >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, dim.name)) ] }), /*#__PURE__*/ _jsxs("div", { className: "panel", children: [ /*#__PURE__*/ _jsx("h2", { children: "Lifecycle" }), (dashboard.lifecycle || []).map((phase)=>/*#__PURE__*/ _jsxs("div", { style: { marginBottom: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginBottom: 4 }, children: [ /*#__PURE__*/ _jsx("span", { style: { fontSize: 13 }, children: phase.name }), /*#__PURE__*/ _jsxs("span", { className: "muted", style: { fontSize: 12 }, children: [ phase.openRisks, " open" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bar-wrap", children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: `${Math.min(phase.riskScore || 0, 100)}%`, background: (phase.riskScore || 0) >= 50 ? 'var(--danger)' : (phase.riskScore || 0) >= 25 ? 'var(--warn)' : 'var(--accent)' } }) }) ] }, phase.name)) ] }) ] }) ] }); } function RiskFormModal({ project, onClose, onSaved, toast }) { const [saving, setSaving] = useState(false); const [form, setForm] = useState({ title: '', description: '', dimension: '', domain: '', lifecyclePhase: '', probability: 50, impact: 50, detectability: 50, ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.dimension) { toast.add('Dimension is required', 'error'); return; } setSaving(true); try { await api.post(`/api/projects/${project.id}/risks`, form); toast.add('Risk created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create risk', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Risk" }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.dimension, onChange: set('dimension'), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.domain, onChange: set('domain') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.lifecyclePhase, onChange: set('lifecyclePhase'), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.probability, onChange: set('probability') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.impact, onChange: set('impact') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.detectability, onChange: set('detectability') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Risk' }) ] }) ] }) }); } function RisksTab({ project, dashboard, toast, onRefresh }) { const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('normalizedScore'); const [sortDir, setSortDir] = useState('desc'); const [page, setPage] = useState(0); const [selectedRisk, setSelectedRisk] = useState(null); const [showCreate, setShowCreate] = useState(false); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const risks = useMemo(()=>{ if (!dashboard?.topRisks) return []; return sortData(dashboard.topRisks, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const filtered = useMemo(()=>{ if (!search) return risks; const q = search.toLowerCase(); return risks.filter((r)=>(r.title || '').toLowerCase().includes(q) || (r.dimension || '').toLowerCase().includes(q) || (r.ownerDisplayName || '').toLowerCase().includes(q)); }, [ risks, search ]); const paged = filtered.slice(0, (page + 1) * PAGE_SIZE); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (risk)=>{ setSelectedRisk(risk); setEditForm({ title: risk.title || '', description: risk.description || '', dimension: risk.dimension || '', domain: risk.domain || '', lifecyclePhase: risk.lifecyclePhase || '', probability: risk.probability ?? 50, impact: risk.impact ?? 50, detectability: risk.detectability ?? 50, ownerDisplayName: risk.ownerDisplayName || '' }); setEditing(false); setConfirmDelete(null); }; const updateStatus = async (riskId, status)=>{ setUpdating(riskId); try { await api.patch(`/api/risks/${riskId}`, { status }); toast.add(`Risk status updated to ${status}`); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message, 'error'); } finally{ setUpdating(null); } }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { await api.patch(`/api/risks/${selectedRisk.id}`, editForm); toast.add('Risk updated'); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del(`/api/risks/${confirmDelete.id}`); toast.add('Risk deleted'); setConfirmDelete(null); setSelectedRisk(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search risks by title, dimension, owner..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Risk" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'id', label: 'ID' }, { key: 'title', label: 'Risk' }, { key: 'dimension', label: 'Dimension' }, { key: 'lifecyclePhase', label: 'Phase' }, { key: 'normalizedScore', label: 'Score' }, { key: 'residualScore', label: 'Residual' }, { key: 'status', label: 'Status' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: paged.map((risk)=>/*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(risk), children: [ /*#__PURE__*/ _jsx("td", { style: { fontFamily: 'monospace', fontSize: 12 }, children: risk.id?.slice(0, 8) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: risk.dimension?.toLowerCase(), children: risk.dimension }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: risk.lifecyclePhase }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: risk.normalizedScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { style: { color: risk.residualScore >= 50 ? 'var(--danger)' : risk.residualScore >= 25 ? 'var(--warn)' : 'var(--accent)' }, children: risk.residualScore }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: risk.status?.toLowerCase().replace(/\s+/g, '-'), children: risk.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: risk.ownerDisplayName || '-' }) }) ] }, risk.id)) }) ] }) }), filtered.length > paged.length && /*#__PURE__*/ _jsx("div", { style: { textAlign: 'center', marginTop: 12 }, children: /*#__PURE__*/ _jsxs("button", { className: "button secondary small", onClick: ()=>setPage((p)=>p + 1), children: [ "Show more (", filtered.length - paged.length, " remaining)" ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No risks match your search" }) }), showCreate && /*#__PURE__*/ _jsx(RiskFormModal, { project: project, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedRisk && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedRisk(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 520 }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: selectedRisk.title }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setEditing(!editing), children: editing ? 'View' : 'Edit' }) ] }), editing ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Dimension", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.dimension, onChange: (v)=>setEditForm((f)=>({ ...f, dimension: v })), options: DIMENSIONS }) }), /*#__PURE__*/ _jsx(FormField, { label: "Domain", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.domain, onChange: (v)=>setEditForm((f)=>({ ...f, domain: v })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Lifecycle Phase", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.lifecyclePhase, onChange: (v)=>setEditForm((f)=>({ ...f, lifecyclePhase: v })), options: LIFECYCLE_PHASES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Probability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.probability, onChange: (v)=>setEditForm((f)=>({ ...f, probability: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Impact", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.impact, onChange: (v)=>setEditForm((f)=>({ ...f, impact: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Detectability", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.detectability, onChange: (v)=>setEditForm((f)=>({ ...f, detectability: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedRisk), children: "Delete" }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12, fontSize: 13, marginTop: 12 }, children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Dimension" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.dimension ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Phase" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.lifecyclePhase ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Probability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.probability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Impact" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.impact ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Detectability" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.detectability ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Score" }), /*#__PURE__*/ _jsx("br", {}), /*#__PURE__*/ _jsx("strong", { children: selectedRisk.normalizedScore }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Residual" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.residualScore ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Owner" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.ownerDisplayName || '-' ] }) ] }), selectedRisk.description && /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, fontSize: 13 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", children: "Description" }), /*#__PURE__*/ _jsx("br", {}), selectedRisk.description ] }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16 }, children: [ /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 12 }, children: "Update status:" }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, marginTop: 6, flexWrap: 'wrap' }, children: RISK_STATUSES.map((s)=>/*#__PURE__*/ _jsx("button", { className: `button small ${s === 'OPEN' ? 'secondary' : ''}`, onClick: ()=>updateStatus(selectedRisk.id, s), disabled: updating === selectedRisk.id, children: s.replace('_', ' ') }, s)) }) ] }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedRisk(null), children: "Close" }) }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this risk", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function MitigationFormModal({ project, risks, onClose, onSaved, toast }) { const [saving, setSaving] = useState(false); const [form, setForm] = useState({ riskId: '', title: '', description: '', status: 'NOT_STARTED', progressPercent: 0, effectivenessPercent: 0, dueDate: '', ownerDisplayName: '' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const handleSave = async ()=>{ if (!form.title.trim()) { toast.add('Title is required', 'error'); return; } if (!form.riskId) { toast.add('Please select a risk', 'error'); return; } setSaving(true); try { const body = { ...form, progressPercent: Number(form.progressPercent), effectivenessPercent: Number(form.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else delete body.dueDate; await api.post(`/api/risks/${form.riskId}/mitigations`, body); toast.add('Mitigation created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create mitigation', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Mitigation" }), /*#__PURE__*/ _jsx(FormField, { label: "Risk *", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.riskId, onChange: set('riskId'), options: (risks || []).map((r)=>({ value: r.id, label: r.title })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.title, onChange: set('title') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>set('description')(e.target.value), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: set('status'), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.progressPercent, onChange: set('progressPercent') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: form.effectivenessPercent, onChange: set('effectivenessPercent') }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: form.dueDate, onChange: set('dueDate') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.ownerDisplayName, onChange: set('ownerDisplayName') }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Mitigation' }) ] }) ] }) }); } function MitigationsTab({ project, dashboard, toast, onRefresh }) { const [search, setSearch] = useState(''); const [sortKey, setSortKey] = useState('progressPercent'); const [sortDir, setSortDir] = useState('asc'); const [showCreate, setShowCreate] = useState(false); const [selectedMitigation, setSelectedMitigation] = useState(null); const [editing, setEditing] = useState(false); const [editForm, setEditForm] = useState({}); const [updating, setUpdating] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [deleting, setDeleting] = useState(false); const mitigations = useMemo(()=>{ if (!dashboard?.mitigations) return []; return sortData(dashboard.mitigations, sortKey, sortDir); }, [ dashboard, sortKey, sortDir ]); const risks = useMemo(()=>{ if (!dashboard?.topRisks) return []; return dashboard.topRisks; }, [ dashboard ]); const filtered = useMemo(()=>{ if (!search) return mitigations; const q = search.toLowerCase(); return mitigations.filter((m)=>(m.title || '').toLowerCase().includes(q) || (m.riskTitle || '').toLowerCase().includes(q)); }, [ mitigations, search ]); const handleSort = (key)=>{ if (sortKey === key) setSortDir((d)=>d === 'asc' ? 'desc' : 'asc'); else { setSortKey(key); setSortDir('asc'); } }; const openDetail = (m)=>{ setSelectedMitigation(m); setEditForm({ title: m.title || '', description: m.description || '', status: m.status || 'NOT_STARTED', progressPercent: m.progressPercent ?? 0, effectivenessPercent: m.effectivenessPercent ?? 0, dueDate: m.dueDate ? m.dueDate.slice(0, 10) : '', ownerDisplayName: m.ownerDisplayName || '' }); setEditing(true); setConfirmDelete(null); }; const saveEdit = async ()=>{ if (!editForm.title.trim()) { toast.add('Title is required', 'error'); return; } setUpdating('edit'); try { const body = { ...editForm, progressPercent: Number(editForm.progressPercent), effectivenessPercent: Number(editForm.effectivenessPercent) }; if (body.dueDate) body.dueDate = new Date(body.dueDate).toISOString(); else body.dueDate = null; await api.patch(`/api/mitigations/${selectedMitigation.id}`, body); toast.add('Mitigation updated'); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to update', 'error'); } finally{ setUpdating(null); } }; const handleDelete = async ()=>{ setDeleting(true); try { await api.del(`/api/mitigations/${confirmDelete.id}`); toast.add('Mitigation deleted'); setConfirmDelete(null); setSelectedMitigation(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete', 'error'); } finally{ setDeleting(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', gap: 8, marginBottom: 12 }, children: [ /*#__PURE__*/ _jsx(SearchInput, { value: search, onChange: setSearch, placeholder: "Search mitigations..." }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Mitigation" }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsx("tr", { children: [ { key: 'title', label: 'Title' }, { key: 'riskTitle', label: 'Risk' }, { key: 'status', label: 'Status' }, { key: 'progressPercent', label: 'Progress' }, { key: 'effectivenessPercent', label: 'Effectiveness' }, { key: 'ownerDisplayName', label: 'Owner' } ].map((col)=>/*#__PURE__*/ _jsxs("th", { className: "sortable", onClick: ()=>handleSort(col.key), children: [ col.label, " ", sortKey === col.key ? sortDir === 'asc' ? '▲' : '▼' : '' ] }, col.key)) }) }), /*#__PURE__*/ _jsx("tbody", { children: filtered.slice(0, 50).map((m)=>/*#__PURE__*/ _jsxs("tr", { onClick: ()=>openDetail(m), style: { cursor: 'pointer' }, children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: m.title }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.riskTitle }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: m.status?.toLowerCase().replace(/\s+/g, '-'), children: m.status }) }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [ /*#__PURE__*/ _jsx("div", { className: "bar-wrap", style: { flex: 1, maxWidth: 80 }, children: /*#__PURE__*/ _jsx("div", { className: "bar-fill", style: { width: `${m.progressPercent || 0}%`, background: (m.progressPercent || 0) >= 80 ? 'var(--accent)' : (m.progressPercent || 0) >= 30 ? 'var(--warn)' : 'var(--danger)' } }) }), m.progressPercent || 0, "%" ] }) }), /*#__PURE__*/ _jsxs("td", { children: [ m.effectivenessPercent || 0, "%" ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("span", { className: "muted", children: m.ownerDisplayName || '-' }) }) ] }, m.id)) }) ] }) }), !filtered.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No mitigations found" }) }), showCreate && /*#__PURE__*/ _jsx(MitigationFormModal, { project: project, risks: risks, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), selectedMitigation && !confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setSelectedMitigation(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 500 }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: editing ? 'Edit Mitigation' : selectedMitigation.title }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Title *", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.title, onChange: (v)=>setEditForm((f)=>({ ...f, title: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: editForm.description, onChange: (e)=>setEditForm((f)=>({ ...f, description: e.target.value })), rows: 2, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: editForm.status, onChange: (v)=>setEditForm((f)=>({ ...f, status: v })), options: MITIGATION_STATUSES }) }), /*#__PURE__*/ _jsxs("div", { style: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 8 }, children: [ /*#__PURE__*/ _jsx(FormField, { label: "Progress %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.progressPercent, onChange: (v)=>setEditForm((f)=>({ ...f, progressPercent: Number(v) })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Effectiveness %", children: /*#__PURE__*/ _jsx(InlineInput, { type: "number", min: 0, max: 100, value: editForm.effectivenessPercent, onChange: (v)=>setEditForm((f)=>({ ...f, effectivenessPercent: Number(v) })) }) }) ] }), /*#__PURE__*/ _jsx(FormField, { label: "Due Date", children: /*#__PURE__*/ _jsx(InlineInput, { type: "date", value: editForm.dueDate, onChange: (v)=>setEditForm((f)=>({ ...f, dueDate: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Owner", children: /*#__PURE__*/ _jsx(InlineInput, { value: editForm.ownerDisplayName, onChange: (v)=>setEditForm((f)=>({ ...f, ownerDisplayName: v })) }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setSelectedMitigation(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: saveEdit, disabled: updating === 'edit', children: updating === 'edit' ? 'Saving...' : 'Save Changes' }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff', marginLeft: 'auto' }, onClick: ()=>setConfirmDelete(selectedMitigation), children: "Delete" }) ] }) ] }) }), confirmDelete && /*#__PURE__*/ _jsx(ConfirmDelete, { label: "this mitigation", onConfirm: handleDelete, onCancel: ()=>setConfirmDelete(null), deleting: deleting }) ] }); } function GateTab({ project, dashboard, toast, onRefresh }) { const [evaluating, setEvaluating] = useState(false); const [showDecision, setShowDecision] = useState(false); const [decisionForm, setDecisionForm] = useState({ decision: 'APPROVED', reviewerName: '', reason: '' }); const [savingDecision, setSavingDecision] = useState(false); const criteria = dashboard?.gate?.criteria || []; const gateStatus = dashboard?.summary?.gateStatus || 'Unknown'; const gateId = dashboard?.gate?.id; const gateCls = gateStatus === 'Ready' ? 'good' : gateStatus === 'Warning' ? 'warn' : 'bad'; const handleEvaluate = async ()=>{ setEvaluating(true); try { await api.post(`/api/projects/${project.id}/gate/evaluate`, {}); toast.add('Gate evaluated'); onRefresh(); } catch (e) { toast.add(e.message || 'Evaluation failed', 'error'); } finally{ setEvaluating(false); } }; const submitDecision = async ()=>{ if (!decisionForm.reviewerName.trim()) { toast.add('Reviewer name is required', 'error'); return; } setSavingDecision(true); try { await api.post(`/api/gates/${gateId}/decisions`, decisionForm); toast.add('Decision submitted'); setShowDecision(false); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to submit decision', 'error'); } finally{ setSavingDecision(false); } }; if (!dashboard) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading..." }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Deployment Gate" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Gate evaluation for AI deployment readiness" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("div", { className: `metric-value ${gateCls}`, style: { fontSize: 28 }, children: gateStatus }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Criterion" }), /*#__PURE__*/ _jsx("th", { children: "Required" }), /*#__PURE__*/ _jsx("th", { children: "Actual" }), /*#__PURE__*/ _jsx("th", { children: "Status" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: criteria.map((c)=>/*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx("strong", { children: c.name }) }), /*#__PURE__*/ _jsx("td", { children: c.required }), /*#__PURE__*/ _jsx("td", { children: c.actual }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: c.status?.toLowerCase(), children: c.status }) }) ] }, c.name)) }) ] }) }), !criteria.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No gate criteria evaluated yet" }) }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 16, display: 'flex', gap: 8, flexWrap: 'wrap' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleEvaluate, disabled: evaluating, children: evaluating ? 'Evaluating...' : 'Evaluate Gate' }), gateId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(true), children: "Add Decision" }), /*#__PURE__*/ _jsx("a", { href: `/api/projects/${project?.id}/gate/history`, className: "button secondary small", target: "_blank", children: "History (API)" }) ] }), showDecision && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setShowDecision(false), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 400 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Gate Decision" }), /*#__PURE__*/ _jsx(FormField, { label: "Decision", children: /*#__PURE__*/ _jsx(InlineSelect, { value: decisionForm.decision, onChange: (v)=>setDecisionForm((f)=>({ ...f, decision: v })), options: [ 'APPROVED', 'REJECTED', 'ACCEPTED', 'NEEDS_CHANGES' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reviewer Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: decisionForm.reviewerName, onChange: (v)=>setDecisionForm((f)=>({ ...f, reviewerName: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Reason", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: decisionForm.reason, onChange: (e)=>setDecisionForm((f)=>({ ...f, reason: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowDecision(false), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: submitDecision, disabled: savingDecision, children: savingDecision ? 'Saving...' : 'Submit Decision' }) ] }) ] }) }) ] }); } function IntegrationFormModal({ project, dashboard, onClose, onSaved, toast }) { const [saving, setSaving] = useState(false); const [form, setForm] = useState({ provider: 'TRELLO', workspaceName: '', baseUrl: '', authMode: 'API_KEY' }); const set = (key)=>(value)=>setForm((f)=>({ ...f, [key]: value })); const wsId = dashboard?.gate?.workspaceId || project?.workspaceId; const handleSave = async ()=>{ if (!form.workspaceName.trim()) { toast.add('Workspace name is required', 'error'); return; } setSaving(true); try { await api.post(`/api/workspaces/${wsId}/integrations`, form); toast.add('Integration created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create integration', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Integration" }), /*#__PURE__*/ _jsx(FormField, { label: "Provider", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.provider, onChange: set('provider'), options: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ] }) }), /*#__PURE__*/ _jsx(FormField, { label: "Workspace Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.workspaceName, onChange: set('workspaceName') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Base URL", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.baseUrl, onChange: set('baseUrl') }) }), /*#__PURE__*/ _jsx(FormField, { label: "Auth Mode", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.authMode, onChange: set('authMode'), options: [ 'API_KEY', 'OAUTH', 'BASIC' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Integration' }) ] }) ] }) }); } function IntegrationsTab({ project, dashboard, toast, onRefresh }) { const [showCreate, setShowCreate] = useState(false); const integrations = dashboard?.integrations || []; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Integrations" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Connect Trello, Jira, Asana, or Microsoft Planner" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreate(true), children: "+ New Integration" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid", style: { gridTemplateColumns: 'repeat(auto-fit, minmax(240px, 1fr))' }, children: [ 'TRELLO', 'JIRA', 'ASANA', 'MICROSOFT_PLANNER' ].map((provider)=>{ const existing = integrations.find((i)=>i.provider === provider); return /*#__PURE__*/ _jsxs("div", { className: "panel", style: { textAlign: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { style: { fontSize: 32, marginBottom: 8 }, children: provider === 'TRELLO' ? '⊞' : provider === 'JIRA' ? '◆' : provider === 'ASANA' ? '◇' : '▣' }), /*#__PURE__*/ _jsx("h3", { style: { margin: '0 0 4px' }, children: provider.replace('_', ' ') }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { fontSize: 12, margin: '0 0 12px' }, children: existing ? existing.workspaceName : 'Not configured' }), /*#__PURE__*/ _jsx("div", { style: { display: 'flex', gap: 6, justifyContent: 'center' }, children: existing ? /*#__PURE__*/ _jsx("a", { href: `/api/integrations/${existing.id}`, className: "button secondary small", target: "_blank", children: "Manage" }) : /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowCreate(true), children: "Configure" }) }) ] }, provider); }) }), showCreate && /*#__PURE__*/ _jsx(IntegrationFormModal, { project: project, dashboard: dashboard, onClose: ()=>setShowCreate(false), onSaved: ()=>{ setShowCreate(false); onRefresh(); }, toast: toast }), !integrations.length && /*#__PURE__*/ _jsx("div", { style: { marginTop: 12 }, children: /*#__PURE__*/ _jsx("a", { href: "/api/integration-providers", className: "button secondary small", target: "_blank", children: "Integration providers (API)" }) }) ] }); } function AuditTab({ project, toast }) { const [events, setEvents] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const load = useCallback(async ()=>{ if (!project) return; setLoading(true); setError(null); try { const resp = await api.get(`/api/projects/${project.id}/audit`); setEvents(resp.auditEvents || []); } catch (e) { setError(e.message || 'Failed to load audit log'); } finally{ setLoading(false); } }, [ project ]); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ load(); }, [ load ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "Loading audit log..." }) }); if (error) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: error }) }); if (!events.length) return /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No audit events recorded yet" }) }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "Audit Log" }), /*#__PURE__*/ _jsx("p", { className: "muted", children: "Project activity history" }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: load, children: "Refresh" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Date" }), /*#__PURE__*/ _jsx("th", { children: "Action" }), /*#__PURE__*/ _jsx("th", { children: "Entity" }), /*#__PURE__*/ _jsx("th", { children: "Actor" }), /*#__PURE__*/ _jsx("th", { children: "Details" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: events.map((e)=>/*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, whiteSpace: 'nowrap' }, children: new Date(e.createdAt).toLocaleString() }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: e.action?.toLowerCase().replace(/\s+/g, '-'), children: e.action }) }), /*#__PURE__*/ _jsxs("td", { style: { fontSize: 12 }, children: [ e.entityType, " ", /*#__PURE__*/ _jsxs("span", { className: "muted", children: [ "(", e.entityId?.slice(0, 8), ")" ] }) ] }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: e.actorUserId || 'system' }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12, maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis' }, children: e.afterJson ? JSON.stringify(e.afterJson).slice(0, 80) : '-' }) ] }, e.id)) }) ] }) }) ] }); } function ProjectsTab({ projects, workspaceId, currentProjectId, onSwitch, onRefresh, toast }) { const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del(`/api/projects/${confirmDelete.id}`); toast.add(`Project "${confirmDelete.name}" deleted`); setConfirmDelete(null); onRefresh(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h1", { children: "All Projects" }), /*#__PURE__*/ _jsxs("p", { className: "muted", children: [ projects.length, " project(s) in workspace" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "dash-actions", children: /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", { children: "Actions" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>/*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '', p.description ? /*#__PURE__*/ _jsx("div", { className: "muted", style: { fontSize: 11 }, children: p.description }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: p.status?.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>onSwitch(p.id), children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "Delete" }) ] }) ] }, p.id)) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet. Create one to get started." }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onRefresh(); }, toast: toast }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }) ] }); } function ProjectSettingsModal({ project, onClose, onSaved, toast }) { const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: project?.name || '', description: project?.description || '', subtitle: project?.subtitle || '', status: project?.status || 'Active' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.patch(`/api/projects/${project.id}`, form); toast.add('Project updated'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to update project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "Project Settings" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Subtitle", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.subtitle, onChange: (v)=>setForm((f)=>({ ...f, subtitle: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Status", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.status, onChange: (v)=>setForm((f)=>({ ...f, status: v })), options: [ 'Active', 'Archived', 'On Hold' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Save Changes' }) ] }) ] }) }); } function NewProjectModal({ workspaceId, onClose, onSaved, toast }) { const [saving, setSaving] = useState(false); const [form, setForm] = useState({ name: '', description: '', projectType: 'AI-Enabler' }); const handleSave = async ()=>{ if (!form.name.trim()) { toast.add('Project name is required', 'error'); return; } setSaving(true); try { await api.post(`/api/workspaces/${workspaceId}/projects`, form); toast.add('Project created'); onSaved(); } catch (e) { toast.add(e.message || 'Failed to create project', 'error'); } finally{ setSaving(false); } }; return /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: onClose, children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 450 }, children: [ /*#__PURE__*/ _jsx("h2", { children: "New Project" }), /*#__PURE__*/ _jsx(FormField, { label: "Name *", children: /*#__PURE__*/ _jsx(InlineInput, { value: form.name, onChange: (v)=>setForm((f)=>({ ...f, name: v })) }) }), /*#__PURE__*/ _jsx(FormField, { label: "Description", children: /*#__PURE__*/ _jsx("textarea", { className: "input", value: form.description, onChange: (e)=>setForm((f)=>({ ...f, description: e.target.value })), rows: 3, style: { width: '100%', resize: 'vertical' } }) }), /*#__PURE__*/ _jsx(FormField, { label: "Project Type", children: /*#__PURE__*/ _jsx(InlineSelect, { value: form.projectType, onChange: (v)=>setForm((f)=>({ ...f, projectType: v })), options: [ 'AI-Enabler', 'GENERATIVE_AI', 'ML-Pipeline', 'Automation' ] }) }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: handleSave, disabled: saving, children: saving ? 'Saving...' : 'Create Project' }) ] }) ] }) }); } function ProjectManagerModal({ projects, workspaceId, currentProjectId, onClose, onSwitch, onSaved, toast }) { const [deleting, setDeleting] = useState(null); const [confirmDelete, setConfirmDelete] = useState(null); const [showNew, setShowNew] = useState(false); const handleDelete = async ()=>{ setDeleting(true); try { await api.del(`/api/projects/${confirmDelete.id}`); toast.add(`Project "${confirmDelete.name}" deleted`); setConfirmDelete(null); onSaved(); } catch (e) { toast.add(e.message || 'Failed to delete project', 'error'); } finally{ setDeleting(false); } }; return /*#__PURE__*/ _jsxs("div", { className: "modal-overlay", onClick: onClose, children: [ /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 700, maxHeight: '80vh', overflow: 'auto' }, children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [ /*#__PURE__*/ _jsx("h2", { style: { margin: 0 }, children: "All Projects" }), /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowNew(true), children: "+ New Project" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "muted", style: { fontSize: 12, marginTop: 4 }, children: [ projects.length, " project(s) in workspace" ] }), /*#__PURE__*/ _jsx("div", { className: "table-wrap", style: { marginTop: 12 }, children: /*#__PURE__*/ _jsxs("table", { className: "table", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { children: "Name" }), /*#__PURE__*/ _jsx("th", { children: "Status" }), /*#__PURE__*/ _jsx("th", { children: "Type" }), /*#__PURE__*/ _jsx("th", { children: "Created" }), /*#__PURE__*/ _jsx("th", {}) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: [ ...projects ].sort((a, b)=>new Date(b.createdAt) - new Date(a.createdAt)).map((p)=>/*#__PURE__*/ _jsxs("tr", { style: { background: p.id === currentProjectId ? 'var(--surface-alt)' : '' }, children: [ /*#__PURE__*/ _jsxs("td", { children: [ /*#__PURE__*/ _jsx("strong", { children: p.name }), p.id === currentProjectId ? /*#__PURE__*/ _jsx("span", { className: "muted", style: { fontSize: 11, marginLeft: 6 }, children: "(current)" }) : '' ] }), /*#__PURE__*/ _jsx("td", { children: /*#__PURE__*/ _jsx(Badge, { className: p.status?.toLowerCase(), children: p.status }) }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: p.projectType }), /*#__PURE__*/ _jsx("td", { style: { fontSize: 12 }, children: new Date(p.createdAt).toLocaleDateString() }), /*#__PURE__*/ _jsxs("td", { style: { textAlign: 'right', whiteSpace: 'nowrap' }, children: [ p.id !== currentProjectId && /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { marginRight: 6 }, onClick: ()=>{ onSwitch(p.id); onClose(); }, children: "Open" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: ()=>setConfirmDelete(p), disabled: deleting === p.id, children: "✕" }) ] }) ] }, p.id)) }) ] }) }), !projects.length && /*#__PURE__*/ _jsx("div", { className: "empty-state", children: /*#__PURE__*/ _jsx("p", { children: "No projects yet" }) }), /*#__PURE__*/ _jsx("div", { className: "modal-actions", children: /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: onClose, children: "Close" }) }) ] }), confirmDelete && /*#__PURE__*/ _jsx("div", { className: "modal-overlay", onClick: ()=>setConfirmDelete(null), children: /*#__PURE__*/ _jsxs("div", { className: "modal", onClick: (e)=>e.stopPropagation(), style: { maxWidth: 380 }, children: [ /*#__PURE__*/ _jsxs("h3", { children: [ 'Delete "', confirmDelete.name, '"?' ] }), /*#__PURE__*/ _jsx("p", { style: { fontSize: 13, color: 'var(--muted)' }, children: "This permanently deletes the project and all its risks, mitigations, and data." }), /*#__PURE__*/ _jsxs("div", { className: "modal-actions", children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setConfirmDelete(null), children: "Cancel" }), /*#__PURE__*/ _jsx("button", { className: "button small", style: { background: 'var(--danger)', color: '#fff' }, onClick: handleDelete, disabled: deleting, children: deleting ? 'Deleting...' : 'Delete Project' }) ] }) ] }) }), showNew && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowNew(false), onSaved: ()=>{ setShowNew(false); onSaved(); }, toast: toast }) ] }); } export default function DashboardPage() { const router = useRouter(); const searchParams = useSearchParams(); const tab = TABS.includes(searchParams.get('tab')) ? searchParams.get('tab') : 'Overview'; const [project, setProject] = useState(null); const [projects, setProjects] = useState([]); const [selectedProjectId, setSelectedProjectId] = useState(searchParams.get('projectId') || null); const [dashboard, setDashboard] = useState(null); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [retryCount, setRetryCount] = useState(0); const [showProjectSettings, setShowProjectSettings] = useState(false); const [showProjectManager, setShowProjectManager] = useState(false); const [workspaceId, setWorkspaceId] = useState(null); const { toasts, add } = useToast(); const onRefresh = useCallback(()=>setRetryCount((c)=>c + 1), []); const loadDashboard = useCallback(async (projectId)=>{ setLoading(true); setError(null); try { const session = await api.get('/api/auth/session'); if (!session?.authenticated) { setError('Not authenticated.'); setLoading(false); return; } const membership = session.memberships?.[0]; if (!membership) { setError('No organization membership found.'); setLoading(false); return; } const orgId = membership.organizationId; const workspacesResp = await api.get(`/api/workspaces?organizationId=${orgId}`); const ws = workspacesResp.workspaces?.[0]; if (!ws) { setError('No workspace found — create one to get started.'); setLoading(false); return; } setWorkspaceId(ws.id); const projectsResp = await api.get(`/api/workspaces/${ws.id}/projects`); const allProjects = projectsResp.projects || []; if (!allProjects.length) { setError('No project found — create a project to get started.'); setLoading(false); return; } setProjects(allProjects); let proj = projectId ? allProjects.find((p)=>p.id === projectId) : null; if (!proj) proj = allProjects[0]; if (proj.id !== (searchParams.get('projectId') || null)) { const currentTab = searchParams.get('tab') || 'Overview'; router.replace(`/dashboard?tab=${currentTab}&projectId=${proj.id}`); } setProject(proj); const dashResp = await api.get(`/api/projects/${proj.id}/dashboard`); setDashboard(dashResp.dashboard); setLoading(false); } catch (e) { setError(e.message || 'Failed to load dashboard data'); setLoading(false); } // eslint-disable-next-line react-hooks/exhaustive-deps }, []); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ loadDashboard(selectedProjectId); }, [ loadDashboard, retryCount, selectedProjectId ]); const switchProject = (pid)=>{ setSelectedProjectId(pid); router.push(`/dashboard?tab=${tab}&projectId=${pid}`); }; const [showCreateOnError, setShowCreateOnError] = useState(false); if (loading && tab !== 'Integrations') return /*#__PURE__*/ _jsx("div", { className: "shell-loading", children: /*#__PURE__*/ _jsx("div", { className: "spinner" }) }); if (error && tab !== 'Integrations') return /*#__PURE__*/ _jsxs("div", { className: "empty-state", children: [ /*#__PURE__*/ _jsx("div", { className: "empty-icon", children: "!" }), /*#__PURE__*/ _jsx("p", { children: error }), /*#__PURE__*/ _jsxs("div", { style: { marginTop: 12, display: 'flex', gap: 8, justifyContent: 'center' }, children: [ /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setRetryCount((c)=>c + 1), children: "Retry" }), error.includes('No project found') && workspaceId && /*#__PURE__*/ _jsx("button", { className: "button small", onClick: ()=>setShowCreateOnError(true), children: "+ Create Project" }) ] }), showCreateOnError && workspaceId && /*#__PURE__*/ _jsx(NewProjectModal, { workspaceId: workspaceId, onClose: ()=>setShowCreateOnError(false), onSaved: ()=>{ setShowCreateOnError(false); setRetryCount((c)=>c + 1); }, toast: { add } }) ] }); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "dash-header", children: [ /*#__PURE__*/ _jsx("div", { style: { display: 'flex', alignItems: 'center', gap: 10 }, children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 6 }, children: [ /*#__PURE__*/ _jsx("select", { className: "input", value: project?.id || '', onChange: (e)=>switchProject(e.target.value), style: { fontSize: 16, fontWeight: 700, width: 'auto', minWidth: 200, border: 'none', background: 'transparent', cursor: 'pointer' }, children: projects.map((p)=>/*#__PURE__*/ _jsxs("option", { value: p.id, children: [ p.name, " ", p.status !== 'Active' ? `(${p.status})` : '' ] }, p.id)) }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", style: { fontSize: 14, padding: '2px 8px' }, onClick: ()=>setShowProjectSettings(true), title: "Project settings", children: "⚙" }), /*#__PURE__*/ _jsx("button", { className: "button secondary small", onClick: ()=>setShowProjectManager(true), children: "Projects" }) ] }), /*#__PURE__*/ _jsx("p", { className: "muted", style: { margin: 0 }, children: project?.subtitle || project?.description || '' }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "dash-actions", children: [ /*#__PURE__*/ _jsx("a", { href: `/api/projects/${project?.id}/reports/executive.html`, className: "button secondary small", target: "_blank", children: "Report" }), /*#__PURE__*/ _jsx("a", { href: `/api/projects/${project?.id}/reports/risk-register.csv`, className: "button secondary small", target: "_blank", children: "CSV" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "tabs", children: TABS.map((t)=>/*#__PURE__*/ _jsx("button", { className: `tab ${tab === t ? 'active' : ''}`, onClick: ()=>router.push(`/dashboard?tab=${t}${project ? `&projectId=${project.id}` : ''}`), children: t }, t)) }), tab === 'Overview' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Overview", children: /*#__PURE__*/ _jsx(OverviewTab, { project: project, dashboard: dashboard }) }, "overview"), tab === 'Projects' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Projects", children: /*#__PURE__*/ _jsx(ProjectsTab, { projects: projects, workspaceId: workspaceId, currentProjectId: project?.id, onSwitch: switchProject, onRefresh: onRefresh, toast: { add } }) }, "projects"), tab === 'Risks' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Risks", children: /*#__PURE__*/ _jsx(RisksTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "risks"), tab === 'Mitigations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Mitigations", children: /*#__PURE__*/ _jsx(MitigationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "mitigations"), tab === 'Gate' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Gate", children: /*#__PURE__*/ _jsx(GateTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "gate"), tab === 'Integrations' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Integrations", children: /*#__PURE__*/ _jsx(IntegrationsTab, { project: project, dashboard: dashboard, toast: { add }, onRefresh: onRefresh }) }, "integrations"), tab === 'Audit' && /*#__PURE__*/ _jsx(ErrorBoundary, { name: "Audit", children: /*#__PURE__*/ _jsx(AuditTab, { project: project, toast: { add } }) }, "audit"), showProjectSettings && /*#__PURE__*/ _jsx(ProjectSettingsModal, { project: project, onClose: ()=>setShowProjectSettings(false), onSaved: ()=>{ setShowProjectSettings(false); onRefresh(); }, toast: { add } }), showProjectManager && /*#__PURE__*/ _jsx(ProjectManagerModal, { projects: projects, workspaceId: workspaceId, currentProjectId: project?.id, onClose: ()=>setShowProjectManager(false), onSwitch: switchProject, onSaved: ()=>{ setShowProjectManager(false); onRefresh(); }, toast: { add } }), /*#__PURE__*/ _jsx(ToastContainer, { toasts: toasts }) ] }); } `  esideEffectFreed  essrf  gjh  `$klnnext/dist/compiled/server-onlynopqrstuvwxyz{|}~next/dist/compiled/server-only/indexnext/dist/compiled/client-only/indexnext/dist/api/navigationnext/dist/server/route-modules/app-page/vendored/ssr/reactnext/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtimenext/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtimenext/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtimenext/dist/server/route-modules/app-page/vendored/ssr/react-domnext/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-clientnext/dist/compiled/react-server-dom-webpack/server.nodenext/dist/compiled/react-server-dom-webpack/static.node    C:\Users\abd_b\OneDrive\Desktop\COSMIC AI-Risk Dashboard\Step 12 is complete Final QA, Demo Readiness, and Submission Freeze\application\saas-app\node_modules\next\dist\build\webpack\loaders\next-flight-client-module-loader.js972bb8875abf7f62    `useToastToastContainerSearchInputsortDataBadgeFormFieldInlineInputInlineSelectConfirmDeleteOverviewTabRiskFormModalRisksTabMitigationFormModalMitigationsTabGateTabIntegrationFormModalIntegrationsTabAuditTabProjectsTabProjectSettingsModalNewProjectModalProjectManagerModalTABSPAGE_SIZEDIMENSIONSLIFECYCLE_PHASESRISK_STATUSESMITIGATION_STATUSESDashboardPage yyB  d `=@ a=@ A `B A `= A@ `+ AA| `; AR AR @ @  @greact/jsx-runtime a=@react `Bnext/navigation `=../../lib/api-client `+../../components/ErrorBoundary `;webpack/lib/dependencies/PureExpressionDependencya A  a A$x  c A  c A0 } c" AN z c#( useState A   t c* *( useCallback A   c++ jsx_jsx A   h c>>  AOS   c@0@4 jsxs_jsxs A!&   ] cGG  A   cJJ  A   cNN  A    P cdd  AX ]    K cjj  A    coo  Ak o    B c}}  A   = @`@`  A   @`@`  A   @`%@`)  A   0 @`@`  A8=   @` @`%  A   @`@`#  A   @`@`"  A   @`@`#  Adh   @`&@`*  AVZ   @`&@`* useMemo A    @`@`  Agk  || @`)@`-  A  xx @` @`$  A!&  tt @`@` Fragment_Fragment A'0 4nn @`@`(  Abf  jj @`@`  AG L   ff @`8@`=  A   bb @`*@`.  A_!c!  ^^ @`*@`.  A-"1"  ZZ @ `*@ `.  A(#-#  VV @`@`  A$$  RR @`"@`' uv A$$  NN @`*@`. |} AY%^%  JJ @`R@`W xy A[&`&  FF @$`6@$`; ij A((  BB @+`>@+`B ef A))  >> @1`>@1`B ab Al+p+  :: @9`6@9`: ]^ A,,  66 @;`D@;`H de A..  22 @G`"@G`' UV A=/A/  .. @J`*@J`. \] A//  ** @M`S@M`X XY A00  && @R`6@R`; IJ A22  "" @Y`>@Y`B PQ A3484   @_`>@_`C AB A7 7   @k`6@k`: => A77   @m`D@m`H .- A::    @` @`( )( A;;   @`@`$ apipost A==  A==     @`@` )* A>>   @`@` 01 A[?`?   @` @`% !" A1@5@   @`@`"  A@@   @`@`"  A@A   @`,@`0  AAA   @`@`"  AB B   @`,@`0  ACC   @`@`#    ADD   @`&@`*  AWE[E   @`4@`8  AtFxF   @`&@`*  AFF   @`4@`8  AGG   @`@`"  AUHYH   @`,@`0  ARIWI   @`@`#  A_JcJ   @`&@`*  AJJ   @`4@`8  ADLHL   @`&@`*  ALL   @`4@`8  ANN   @`&@`*  ANN   @`4@`8  A&P*P   @ `@ `"  APP   @ `,@ `0  AUQZQ   @`@`#  AQQ   @`&@`*  ARR   @`&@`*  ATT   + @'` @'`(  ATT   @(`"@(`*  ATT   @)`"@)`*  AU'U   @*`@*`$  AXU`U   @+`,@+`4  AUU   @,`(@,`0  AUU   @-`"@-`*  AUV   @.`$@.`,  A*V2V  {{ @/`$@/`,  AhVpV  ww @0`.@0`6  AVV  ss @1`$@1`,  AVV  oo @2`@2`  AWW  kk @:`@:` \patchZ A\\  A\\  ii @]`@]` VU A^^  A^^  dd @p`@p` QdelO AB`I`  AB`E`  ^^ @}`@}` {| Aaa  TT @`)@`- wx Ab b  PP @` @`$ ~ Acbhb  LL @`@` Aibrb 4II @`@`( wx Abb  EE @`@` hi Acc  AA @`"@`& de Awd{d  == @`"@`& `a Awe{e  99 @`@` gh Aee  55 @`(@`- XY AUfYf  11 @`&@`* TU Aff  -- @`4@`8 [\ Am m  )) @`;@`@ LM A\o`o  %% @`&@`* ST Aoo  !! @`F@`K DE Aipmp   @`6@`: @A A rr   @`6@`: <= A^rbr  { @`D@`H 89 AEsIs  w @`6@`: 45 Ass  s   @`D@`H 01 Att  o   @`6@`: ,- A2v6v  k @`6@`: () Avv  g @`D@`H $% Atwxw  c @`6@`:  ! Aww  _ @`D@`H  Ayy  [ @`6@`:  Azz  W @`D@`H  Ac{g{  S @`6@`:  A{{  O @`D@`H    A}}  K @`<@`@  AH~M~  G @`(@`-  A  C @ `.@ `2  A59  ? @"`(@"`,  Aǀˀ  ; @&`(@&`,  A  7 @/`<@/`@  A  3 @2`(@2`-  A  / @9`&@9`+  A   + @@`.@@`2  A26  ' @F`.@F`2  A  # @M`0@M`5JK A 4  @M`6@M`?  A   @O`.@O`3  A   @T`6@T`:  A   @V`D@V`H  A   @^`6@^`:  A>B    @``D@``H  AˏЏ   @n`6@n`;  A|   @u`>@u`B  A"&   @w`L@w`P  A   @`>@`B  A]a   @`L@`P  A   @`6@`:  A   @`D@`H  A   @`6@`;  A   @`>@`B  AKO  ~~ @`L@`P  Ako  zz @`>@`B  A  vv @`L@`P  A$(  rr @`>@`B  AΤҤ  nn @`L@`P  ACG  jj @`6@`:  Aը٨  ff @`D@`H  A.3  bb @`.@`3  A  ^^ @`6@`:  A6:  ZZ @`6@`: }~ A  VV @`6@`:  Añȱ  RR @`+@`0 Aɱұ 4OO @`1@`: }~ A,1  KK @`.@`3 yz A  GG @`6@`; jk A  CC @`>@`B fg A  ?? @`>@`B mn A  ;; @`6@`; ^_ A  77 @`>@`B Z[ A&*  33 @ `>@ `B ab A  // @ `6@ `; RS A  ++ @`>@`B NO A  '' @`>@`B UV A  ## @`6@`; FG A   @`>@`B BC A*.   @`>@`B IJ A  } @!`6@!`; :; A  y @#`>@#`B 67 A  u @'`>@'`B => A  q   @+`6@+`; ./ A  m @-`>@-`B *+ A)-  i @1`>@1`B &' Aw{  e @2`>@2`B -. A  a @7`6@7`;  A+/  ] @9`>@9`B  A=A  Y @=`>@=`B !" A(-  U @A`6@A`;  A  Q @C`>@C`B  A  M @G`>@G`B  A  I @M`J@M`O  ACG  E @S`6@S`:  A8<  A @W`6@W`:    A  = @[`.@[`3  A  9 @``6@``:  A  5 @g`6@g`:  A^b  1 @n`[@n`_  A  - @w`.@w`2  AVZ  ) @y`<@y`@  A!%  % @`+@`/  Alt   L @` @`(  A   @`@`$  A  A   @`@`  A   @`@`  A&+   @` @`%  A   @`@`"  Ajn   @`@`"  A   @`,@`0  A?C   @`@`"  A   @`,@`0  AZ^   @`@`"  A   @`,@`0  A|   @`@`"  A   @`,@`0  A   @`@`#  A  }} @`&@`*  AOS  yy @`4@`8  A  uu @`&@`*  A@D  qq @`4@`8  A  mm @ `@ `"  AEI  ii @ `,@ `0  A&*  ee @`@`"  A  aa @`,@`0  AUZ  ]] @`@`#  A  YY @`&@`* |} A  UU @ `&@ `* ml A   RR @-` @-`( hg A  NN @.`"@.`* dc A  JJ @/`"@/`* `_ A6>  FF @0`(@0`0 \[ A  BB @1`8@1`@ XW A  >> @2`"@2`* TS A  :: @3`$@3`, PO A   66 @4`$@4`, LK AV^  22 @5`.@5`6 HG A  .. @6`$@6`,  A  ** @7`@7`  A  && @?`@?`  A '  "" @E`@E`  A1:  A14  !! @p`@p`   A  A   @}`@}` 9: A`d   @`)@`- 56 A   @` @`$ <= A      @`@` A 4 @`@`( 56 ALQ   @`@` &' A+/   @`"@`& "# A    @`"@`&  A   @`@` %& Aot   @`(@`-  A   @`&@`*  A26   @`4@`8  A5:   @`;@`@    A   @`&@`*  A   @`S@`X  A. 2    @`6@`:  A     @`D@`H  Ac g    @`6@`:  A    ~ @`D@`H  A    z @`6@`:  A/ 3   v @`D@`H  Az ~   r @`6@`:  A    n @`D@`I  A  j @`B@`F  AEI  f @`P@`T  A   b @`6@`;  A_c  ^ @`6@`:  A  Z @`D@`H  A  V @`.@`2  A  R @`(@`,  Aos  N @`(@`,  A  J @#`B@#`F  A  F @&`(@&`-  A  B @-`&@-`*  A  > @3`&@3`+  A  : @8`.@8`2  A    6 @:`<@:`@  A    2 @B`.@B`2  AS!W!  . @D`<@D`@  Ap$t$  *{{ @R`.@R`2  A$$  &ww @T`<@T`@  A&'  "ss @]`.@]`3  Aw({(  oo @d`6@d`:  A))  kk @f`D@f`H  A++  gg @q`6@q`:  Az,~,  cc @s`D@s`H  A//  __ @`.@`2  A00   [[ @`<@`@ ~ A22  WW @`.@`2 z{ A22  SS @`<@`@  A44  OO @`&@`+ rs A>5B5  KK @`.@`2 no Ao6s6  GG @`.@`2 jk A77  CC @`.@`2 fg A::  ?? @`+@`/ WV A;;   << @`(@`0 RQ A<$<  88 @`,@`4 NM AY<a<  44 @`,@`4 JI A<<  00 @`0@`8 !"  A_>g>  A_>b>  // @`@`  An@v@  An@q@  ** @`@` GH AAA     @`)@`- CD A5B9B   @` @`$ JK ABB   @`@` ABB 4 @`@`( CD ABB   @`@` ?@ AHCMC     @`"@`' 01 ACC     @`*@`. ,- A8Dyy @`.@`2  Abb  :uu @`.@`2  Add   rr @` @`(  Aee  nn @`@`$ _`^ A:gBg  A:g=g  mm @`@`  Auhyh  cc @`@`  Ahh  __ @` @`%  Aii  [[ @`@`" ~ A&j*j  WW @`@`" z{ Ajj  SS @`,@`0 vw A&l*l  OO @`@`" rs All  KK @`,@`0 no AZm^m  GG @`@`" jk Amm  CC @`,@`0 fg Azn~n  ?? @`@`" bc Ann  ;; @`,@`0 ij ALpQp  77 @`@`# Z[ App  33 @`&@`* VW Aqq  // @`&@`* GF Ass   ,, @`(@`0 XY Ass  && @`@` Ast 4## @`@`( QR A2t7t   @`@` MN Att   @`"@`' >? Au u   @`*@`. :; Auu   @`*@`. 67 Avv   @ `"@ `& 23 Aww     @"`0@"`4 ./ AFxJx   @*`@*` 56 A1z6z   @6`)@6`. &' A&{*{   @<`*@<`. "# A||   @C`*@C`.  A}}   @I`*@I`.  Aqu   @Q`*@Q`.  A   @W`C@W`G  A   @\`3@\`7  A   @f`(@f`,    A    @p`2@p`6  A   @t`(@t`,  A   l @` @`(  A   @`"@`*  AEM   @`@`&  Afq   @`@` get A  A   @`@`& useEffect AAJ   @`7@`@  A   @`&@`*  A   @` @`$  Aei   @`$@`(  A   @` @`$  A!   @`-@`1  Amq   @` @`$  Aڋߋ   @`@`45 A 4 @`@`(  A    @`@`  A   @`"@`'  A   @`*@`.  A|   @`*@`.  Atx   @`"@`&  A   @`0@`4  A   @`@`  A_d   @`(@`-  Aސ   @`&@`*  A"'  || @`4@`9  A  xx @`2@`6  A.2  tt @`2@`6  AВԒ  pp @`2@`6  Arv  ll @`2@`6  A  hh @`2@`6  A   dd @`&@`*  AZ_  `` @`D@`I  AΕҕ  \\ @`6@`:  A  }XX @`6@`: {| Aҗ֗  yTT @`D@`H  A"  uPP @`6@`; ~ A  qLL @`>@`C op A  mHH @`6@`: kl Apt  iDD @ `6@ `: \[ Aġ̡   AA @ `$@ `, WV A   == @ `.@ `6 SR A4<  99 @ `"@ `* *) A  A  88 @ `@ ` `a A  .. @& `@& ` A 4++ @& `@& `( YZ AOT  '' @( `@( ` UV AƤˤ  ## @+ `"@+ `' FG A#'   @- `*@- `. MN A   @0 `*@0 `/ >? A)-   @9 `"@9 `& :; A   @; `0@; `4 67 AŨ   @C `@C ` => A %     @E `(@E `- ./ A   @H `&@H `* 56 A   @I `4@I `9 &' AOS   @K `2@K `6 "# A   @N `2@N `6  A   @Q `2@Q `6  A15   @T `2@T `6  AԬج   @W `2@W `6  Aǭ˭   @] `&@] `*  A   @` `q@` `v  Aίӯ   @e `6@e `;  ARV   @g `>@g `B  A6:   @j `Z@j `^  A^b   @r `N@r `R  A   @{ `6@{ `:  Aҵֵ   @| `D@| `H  A    @ `6@ `:  A\`   @ `6@ `:  A͹ҹ   @ `6@ `;  A[_   @ `[@ `_  A  { @ `>@ `B  ACG  w @ `.@ `2  A  s @ `(@ `,  ACG  o @ `%@ `)  A  k @ `+@ `/  A#  g @ `(@ `-  A,1  c @ `&@ `+  AGK  _ @ `&@ `*  A  [ @ `&@ `+  AQU  W @ `.@ `2  A}  S @ `.@ `2  Aw     @ ` @ `(  A   @ `@ `$ }!| A9B  A9<   @ `@ `  Adh   @ `@ `  A  }} @ ` @ `%  A  yy @ `@ `"  A  uu @ `@ `"  Ay}  qq @ `,@ `0  A  mm @ `@ `"  A  ii @ `,@ `0  AVZ  ee @' `@' `"  A  aa @) `,@) `0  A  ]] @7 `@7 `"  AVZ  YY @9 `,@9 `0  AEJ  UU @F `@F `# xy A  QQ @I `&@I `* tu A  MM @N `&@N `* ed Az   JJ @[ ` @[ `( `_ A  FF @\ `@\ `$ 786 A  A  EE @h `@h ` bc A  ;; @q `@q ` ij A  77 @t ` @t `% Z[ AVZ  33 @{ `@{ `" VW A  // @~ `@~ `" RS A$(  ++ @ `,@ `0 NO A\`  '' @ `@ `" JK A  ## @ `,@ `0 FG A   @ `@ `" BC Abf   @ `,@ `0 IJ A   @ `@ `# :; A   @ `&@ `* 67 A    @ `&@ `* '& A      @ `$@ `, "! A5=   @ `.@ `6  Ago   @ `"@ `*  A  A   @ `@ ` +, A?D   @ `@ ` '( A   @ `@ ` #$ A   @ `"@ `'  A-1   @ `*@ `.  A7;   @ `*@ `.  Aot   @ `"@ `'   A   @ `"@ `&  A   @ `0@ `5  A   @ `.@ `2  A   @ `<@ `A  AGK   @ `:@ `>  A   @ `:@ `>  A   @ `:@ `>  Aqu   @ `:@ `>  A,0   @ `:@ `>  A   @ `.@ `2  A   @ `y@ `~  A%*   @ `>@ `C  A   @ `F@ `J  A   @! `b@! `f  Anr   @+ `>@+ `B  A   @, `L@, `P  A%)   @1 `>@1 `B  A   @7 `>@7 `B  AJO   @= `>@= `C  A    @C `c@C `g  AA E    @N `F@N `J  A   @` `6@` `:  A  ~ @b `0@b `4  A  z @f `"@f `&  A  v @h `0@h `4  A/3  r}} @p `+@p `/  A  nyy @s `(@s `-  A  juu @z `&@z `+  A  fqq @ `&@ `*  A\a  bmm @ `&@ `+  A  ^ii @ `.@ `2  A%)  Zee @ `.@ `2  A  Vaa @ `%@ `)webpack/lib/dependencies/HarmonyExportSpecifierDependency@L @ @  useRouter A2;   ^^ @ `@ ` useSearchParams AXg  YY @ `@ `( ml A  SS @ `"@ `* ih A (  OO @ `$@ `, ed Adl  KK @ `6@ `> a` A  GG @ `&@ `. ]\ A  CC @ `"@ `* YX A#  ?? @ `@ `& UT AS[  ;; @ `(@ `0 QP A  77 @ `:@ `B ML A  33 @ `8@ `@ IH A&  // @ `*@ `2 KJ Alw  ++ @ `@ `! GF A  '' @ `@ `% W A9@  A9<  && @ `"@ `) R A9!@!  A9! ,- A((   @ `@@ `D () A))   @ ` @ `$ /0 A))   @ `>@ `C  ! A))   @ `@ `  Av*z*   @ `@ ` #$ A**   @ `@ `  A++   @ `"@ `&  A,-   @ `W@ `[    A..2.   @ `>@ `B  A//   @) `@) `no A// 4 @) `@) `(    A//   @+ `@+ `  Aq0u0  { @. `"@. `&  An1s1  w @4 `0@4 `5  A11  s @6 `.@6 `3  AB3F3  o @= `6@= `:  A66  k @J `V@J `[  A89  g @S `6@S `:  A;;  c @] `6@] `:  A==  _ @d `.@d `2  A>>  [ @n `"@n `'  Ai?m?  W @q `*@q `.  A@@  S @w `*@w `.  AeBiB  O @ `@ `  ABB  K @ `6@ `:  ADD  G @ `0@ `4 2ErrorBoundary AD*D 4B @ `5@ `B  AxD|D  > @ `(@ `,  A:E>E  : @ `0@ `4 A?ELE 47 @ `5@ `B  AEE  3 @ `(@ `,  A9G=G  / @ `-@ `1 A>GKG 4, @ `2@ `?  AGG  ( @ `(@ `,  AHH  $ @ `3@ `7 AHH 4! @ `8@ `E  A2I6I  xx @ `(@ `,  ApJtJ  tt @ `,@ `0 AuJJ 4yy @ `1@ `>  AJJ  mm @ `(@ `,  ALL  ii @ `4@ `8 A LL 4 nn @ `9@ `F  AhLlL  bb @ `(@ `,  AMM  ^^ @ `-@ `1 AMM 4cc @ `2@ `? ~ AN N  WW @ `(@ `, z{ ANN  SS @ `1@ `5 vw AmPqP  OO @ `0@ `4 rs A\R`R  KK @ `@ ` webpack/lib/ModuleGraphRestoreProvidedData  nameprovidedcanMangleProvideterminalBindingexportsInfo