@burdenoff/microfe-security 2026.624.1 → 2026.625.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/security/components/ConfirmDialog.js +28 -37
- package/dist/security/components/ConfirmDialog.js.map +1 -1
- package/dist/security/components/ImportWizard.js +81 -88
- package/dist/security/components/ImportWizard.js.map +1 -1
- package/dist/security/components/SecretShareDialog.js +75 -86
- package/dist/security/components/SecretShareDialog.js.map +1 -1
- package/dist/security/components/SecurityScoreCard.js +21 -20
- package/dist/security/components/SecurityScoreCard.js.map +1 -1
- package/dist/security/components/VaultShareDialog.js +26 -40
- package/dist/security/components/VaultShareDialog.js.map +1 -1
- package/dist/security/components/ui.js +2 -2
- package/dist/security/components/ui.js.map +1 -1
- package/dist/security/pages/AccessReviewPage.js +52 -67
- package/dist/security/pages/AccessReviewPage.js.map +1 -1
- package/dist/security/pages/ProviderDetailPage.js +122 -142
- package/dist/security/pages/ProviderDetailPage.js.map +1 -1
- package/dist/security/pages/ProvidersPage.js +118 -113
- package/dist/security/pages/ProvidersPage.js.map +1 -1
- package/dist/security/pages/SecretCreatePage.js +73 -68
- package/dist/security/pages/SecretCreatePage.js.map +1 -1
- package/dist/security/pages/SecretDetailPage.js +240 -253
- package/dist/security/pages/SecretDetailPage.js.map +1 -1
- package/dist/security/pages/SecurityDashboardPage.js +89 -85
- package/dist/security/pages/SecurityDashboardPage.js.map +1 -1
- package/dist/security/pages/VaultDetailPage.js +137 -183
- package/dist/security/pages/VaultDetailPage.js.map +1 -1
- package/dist/security/pages/VaultShareViewer.js +61 -59
- package/dist/security/pages/VaultShareViewer.js.map +1 -1
- package/dist/security/pages/VaultsDashboardPage.js +66 -64
- package/dist/security/pages/VaultsDashboardPage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretDetailPage.js","names":[],"sources":["../../../src/security/pages/SecretDetailPage.tsx"],"sourcesContent":["import { useState, useRef } from 'react';\nimport { useParams, useNavigate } from 'react-router-dom';\nimport {\n ArrowLeft,\n Edit2,\n Trash2,\n RefreshCw,\n History,\n Loader2,\n AlertTriangle,\n Clock,\n KeyRound,\n Shield,\n Calendar,\n Share2,\n X,\n} from 'lucide-react';\nimport { PageLayout } from '../components/PageLayout';\nimport { SecretValueDisplay } from '../components/SecretValueDisplay';\nimport { SecretTypeBadge } from '../components/SecretTypeBadge';\nimport { RotationStatusBadge } from '../components/RotationStatusBadge';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { SecretShareDialog } from '../components/SecretShareDialog';\nimport { Button, Card, Badge } from '../components/ui';\nimport {\n useGetSecret,\n useDeleteSecret,\n useRotateSecret,\n useRollbackSecret,\n} from '../hooks/useSecretQueries';\nimport { useSecurityEventEmitter } from '../hooks/useSecurityEventEmitter';\nimport { useGetSecretVersionsQuery } from '../../generated/wspace-operations';\nimport { useSecretValue } from '../hooks/useSecretValue';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { SecurityPermissionGuard } from '../components/SecurityPermissionGuard';\nimport { usePermission } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { cn } from '../utils/cn';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { translateWithFallback } from '../utils/i18n';\nimport { SECURITY_FEATURE_FLAGS } from '../constants/featureFlags';\nimport type { SecretType, RotationStatus } from '../types';\n\nexport function SecretDetailPage() {\n const { vaultId, secretId } = useParams<{ vaultId: string; secretId: string }>();\n const { basePath = '/', navigate: shellNavigate } = useSecurity();\n const { t } = useI18n();\n const routerNavigate = useNavigate();\n\n const { data: secretData, loading, error, refetch } = useGetSecret(secretId ?? null);\n const secret = secretData?.getSecret;\n\n const { data: versionsData, loading: versionsLoading } = useGetSecretVersionsQuery({\n variables: { secretId: secretId ?? '', pagination: { limit: 50 } },\n skip: !secretId,\n fetchPolicy: 'network-only',\n });\n const versions = versionsData?.getSecretVersionsPaginated?.items ?? [];\n\n const {\n value: decryptedValue,\n reveal,\n hide,\n loading: decrypting,\n isRevealed,\n } = useSecretValue(secretId ?? '');\n\n const [deleteSecret, { loading: deletingSecret }] = useDeleteSecret();\n const [rotateSecret, { loading: rotating }] = useRotateSecret();\n const [rollbackSecret, { loading: rollingBack }] = useRollbackSecret();\n const { emit } = useSecurityEventEmitter();\n\n const canDeleteSecret = usePermission('secret:delete');\n const canUpdateSecret = usePermission('secret:update');\n const canDecryptSecret = usePermission('secret:decrypt');\n\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n const [showShareDialog, setShowShareDialog] = useState(false);\n const [showRotatePrompt, setShowRotatePrompt] = useState(false);\n const rotateValueRef = useRef<HTMLTextAreaElement>(null);\n const openRotatePrompt = () => {\n setShowRotatePrompt(true);\n // Focus next frame so the textarea has been mounted by then.\n requestAnimationFrame(() => rotateValueRef.current?.focus());\n };\n const [showHistoryModal, setShowHistoryModal] = useState(false);\n const [newRotationValue, setNewRotationValue] = useState('');\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) =>\n translateWithFallback(t, key, fallback, params);\n\n const handleNavigate = (path: string) => {\n if (shellNavigate) {\n shellNavigate(path);\n } else {\n routerNavigate(path);\n }\n };\n\n const handleBack = () => {\n handleNavigate(`${basePath}/vaults/${vaultId}`);\n };\n\n const handleDelete = async () => {\n if (!secretId) return;\n try {\n await deleteSecret({ variables: { id: secretId } });\n emit('secret.deleted', { secretId, vaultId });\n setShowDeleteConfirm(false);\n void nativeNotify('success');\n handleBack();\n } catch (err) {\n console.error('Failed to delete secret:', err);\n void nativeNotify('error');\n }\n };\n\n const requestDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: 'Delete Secret',\n message: 'Delete this secret? This cannot be undone.',\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n if (result === null) {\n setShowDeleteConfirm(true);\n return;\n }\n if (result) {\n await handleDelete();\n }\n };\n\n const handleRotate = async () => {\n if (!secretId || !newRotationValue.trim()) return;\n try {\n await rotateSecret({ variables: { id: secretId, newValue: newRotationValue.trim() } });\n emit('secret.rotated', { secretId, vaultId });\n setShowRotatePrompt(false);\n setNewRotationValue('');\n refetch();\n } catch (err) {\n console.error('Failed to rotate secret:', err);\n }\n };\n\n const handleRollback = async (version: number) => {\n if (!secretId) return;\n try {\n await rollbackSecret({ variables: { id: secretId, version } });\n emit('secret.rollback', { secretId, vaultId });\n refetch();\n setShowHistoryModal(false);\n } catch (err) {\n console.error('Failed to rollback secret:', err);\n }\n };\n\n if (loading && !secret) {\n return (\n <PageLayout\n title={tx('security.secretDetail.loading.title', 'Loading Secret...')}\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tx('security.common.breadcrumbs.secret', 'Secret') },\n ]}\n >\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 className=\"size-10 animate-spin text-primary/60\" />\n </div>\n </PageLayout>\n );\n }\n\n if (error || !secret) {\n return (\n <PageLayout\n title={tx('security.common.errorPage.title', 'Error')}\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tx('security.common.breadcrumbs.secret', 'Secret') },\n ]}\n >\n <Card className=\"p-8 text-center max-w-lg mx-auto mt-10\">\n <div className=\"flex flex-col items-center gap-4\">\n <div className=\"p-3 rounded-full bg-status-error-bg/10\">\n <AlertTriangle className=\"size-8 text-status-error-text\" />\n </div>\n <div>\n <h3 className=\"text-lg font-bold text-text-primary\">\n {tx('security.secretDetail.error.title', 'Failed to load secret')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-2\">\n {error?.message ??\n tx(\n 'security.secretDetail.error.description',\n 'Secret not found or access denied.'\n )}\n </p>\n </div>\n <Button variant=\"outline\" onClick={handleBack} className=\"mt-4\">\n <ArrowLeft className=\"size-4\" />\n {tx('security.secretDetail.actions.backToVault', 'Go Back to Vault')}\n </Button>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n const versionCount = secret.versionCount ?? 0;\n const rotationStatus: RotationStatus | undefined = secret.lastRotatedAt ? 'healthy' : undefined;\n\n return (\n <PageLayout\n title={secret.name}\n description={\n secret.description ??\n tx('security.secretDetail.description', 'View and manage this secret.')\n }\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n {\n label: tx('security.common.breadcrumbs.vault', 'Vault'),\n path: `${basePath}/vaults/${vaultId}`,\n },\n { label: secret.name },\n ]}\n actions={\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n <span className=\"hidden sm:inline\">\n {tx('security.secretDetail.actions.backToVault', 'Back to Vault')}\n </span>\n <span className=\"sm:hidden\">{tx('security.common.actions.back', 'Back')}</span>\n </Button>\n {canUpdateSecret && (\n <Button variant=\"outline\" size=\"sm\" onClick={() => setShowShareDialog(true)}>\n <Share2 className=\"size-4\" />\n {tx('security.common.actions.share', 'Share')}\n </Button>\n )}\n <SecurityPermissionGuard\n permission=\"secret:update\"\n featureFlagKey={SECURITY_FEATURE_FLAGS.SECRET_ROTATE}\n featureFlagDefault={false}\n >\n <Button variant=\"outline\" size=\"sm\" onClick={openRotatePrompt}>\n <RefreshCw className=\"size-4\" />\n {tx('security.secretDetail.actions.rotate', 'Rotate')}\n </Button>\n </SecurityPermissionGuard>\n {canDeleteSecret && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"text-status-error-text hover:bg-status-error-bg/10 border-status-error-border/20\"\n onClick={() => void requestDelete()}\n >\n <Trash2 className=\"size-4\" />\n {tx('security.common.actions.delete', 'Delete')}\n </Button>\n )}\n </div>\n }\n >\n <div className=\"space-y-6\">\n {/* Status and Info */}\n <div className=\"flex flex-wrap items-center gap-3\">\n <SecretTypeBadge type={secret.type as SecretType} />\n {rotationStatus && <RotationStatusBadge status={rotationStatus} />}\n <Badge variant=\"outline\" className=\"bg-bg-surface/50\">\n {tx('security.secretDetail.status.label', 'Status: {status}', {\n status: secret.status,\n })}\n </Badge>\n {secret.labels?.map((label: any) => (\n <Badge key={label.id} variant=\"outline\" className=\"border-primary/20 text-primary\">\n {label.label}\n </Badge>\n ))}\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n {/* Main Info */}\n <div className=\"md:col-span-2 space-y-6\">\n {/* Secret Value */}\n <Card className=\"p-6 shadow-sm border-border-subtle/60\">\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-bold text-text-primary flex items-center gap-2\">\n <KeyRound className=\"size-5 text-primary\" />\n {tx('security.secretDetail.value.title', 'Secret Value')}\n </h2>\n {secret.expiresAt && (\n <div className=\"flex items-center gap-1.5 text-xs text-warning\">\n <Calendar className=\"size-3.5\" />\n {tx('security.secretDetail.value.expires', 'Expires: {date}', {\n date: new Date(secret.expiresAt).toLocaleDateString(),\n })}\n </div>\n )}\n </div>\n <SecretValueDisplay\n value={decryptedValue ?? ''}\n isRevealed={isRevealed}\n onToggleReveal={\n canDecryptSecret\n ? () => {\n if (isRevealed) {\n hide();\n } else {\n void reveal();\n }\n }\n : undefined\n }\n isLoading={decrypting}\n />\n <p className=\"text-xs text-text-secondary mt-4 italic\">\n {tx(\n 'security.secretDetail.value.note',\n 'Secret values are decrypted on-demand and never stored in plain text.'\n )}\n </p>\n </Card>\n\n {/* Version History Summary */}\n <Card className=\"p-6 shadow-sm border-border-subtle/60\">\n <div className=\"flex items-center justify-between mb-6\">\n <h2 className=\"text-lg font-bold text-text-primary flex items-center gap-2\">\n <History className=\"size-5 text-primary\" />\n {tx('security.secretDetail.history.title', 'Version History')}\n </h2>\n <Badge variant=\"outline\" className=\"bg-bg-sunken font-mono\">\n {tx('security.secretDetail.history.totalVersions', '{count} total versions', {\n count: versionCount,\n })}\n </Badge>\n </div>\n\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between p-4 rounded-lg bg-action-primary-bg/5 border border-primary/10\">\n <div className=\"flex items-center gap-3\">\n <div className=\"size-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center text-primary text-xs font-bold\">\n v{secret.version ?? versionCount}\n </div>\n <div>\n <p className=\"text-sm font-semibold\">\n {tx(\n 'security.secretDetail.history.currentVersion',\n 'Current Active Version'\n )}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {tx('security.secretDetail.history.lastUpdated', 'Last updated {date}', {\n date: new Date(secret.updatedAt).toLocaleString(),\n })}\n </p>\n </div>\n </div>\n <Badge variant=\"success\" className=\"text-[10px] uppercase\">\n {tx('security.common.status.active', 'Active')}\n </Badge>\n </div>\n\n {versionCount > 1 && (\n <div className=\"text-center py-4 border-2 border-dashed border-border-subtle/40 rounded-lg bg-bg-sunken/20\">\n <p className=\"text-sm text-text-secondary\">\n {tx(\n 'security.secretDetail.history.available',\n 'Historical versions are available. You can rollback to a previous state if needed.'\n )}\n </p>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"mt-3\"\n onClick={() => setShowHistoryModal(true)}\n >\n {tx('security.secretDetail.history.viewFull', 'View Full History')}\n </Button>\n </div>\n )}\n </div>\n </Card>\n </div>\n\n {/* Sidebar Info */}\n <div className=\"space-y-6\">\n <Card className=\"p-6 shadow-sm border-border-subtle/60 space-y-4\">\n <h3 className=\"font-bold text-sm uppercase tracking-wider text-text-secondary\">\n {tx('security.secretDetail.details.title', 'Details')}\n </h3>\n\n <div className=\"space-y-3\">\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tx('security.secretDetail.details.keyIdentifier', 'Key Identifier')}\n </p>\n <code className=\"text-xs font-mono bg-bg-sunken px-1.5 py-0.5 rounded block mt-1 overflow-hidden text-ellipsis whitespace-nowrap\">\n {secret.key}\n </code>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tx('security.secretDetail.details.createdBy', 'Created By')}\n </p>\n <p className=\"text-sm font-medium mt-1\">{secret.createdBy}</p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tx('security.secretDetail.details.createdAt', 'Created At')}\n </p>\n <div className=\"flex items-center gap-1.5 text-sm mt-1\">\n <Clock className=\"size-3.5\" />\n {new Date(secret.createdAt).toLocaleDateString()}\n </div>\n </div>\n {secret.lastRotatedAt && (\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tx('security.secretDetail.details.lastRotation', 'Last Rotation')}\n </p>\n <p className=\"text-sm mt-1\">\n {new Date(secret.lastRotatedAt).toLocaleString()}\n </p>\n </div>\n )}\n </div>\n </Card>\n\n <Card className=\"p-6 shadow-sm border-border-subtle/60 space-y-4 bg-action-primary-bg/5 border-primary/10\">\n <h3 className=\"font-bold text-sm text-primary flex items-center gap-2\">\n <Shield className=\"size-4\" />\n {tx('security.secretDetail.security.title', 'Security')}\n </h3>\n <p className=\"text-xs text-text-secondary leading-relaxed\">\n {tx(\n 'security.secretDetail.security.description',\n 'This secret is protected by 256-bit encryption. All access is logged and monitored for suspicious activity.'\n )}\n </p>\n </Card>\n </div>\n </div>\n </div>\n\n {/* Version History Modal */}\n {showHistoryModal && (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n <button\n type=\"button\"\n aria-label=\"Close version history\"\n className=\"absolute inset-0 bg-bg-surface/80 backdrop-blur-sm animate-in fade-in duration-200 cursor-default\"\n onClick={() => setShowHistoryModal(false)}\n />\n <Card className=\"relative z-10 w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-200 border-primary/20 max-h-[80vh] flex flex-col\">\n <div className=\"flex items-center justify-between p-6 border-b border-border-subtle\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-full bg-action-primary-bg/10 text-primary\">\n <History className=\"size-5\" />\n </div>\n <h2 className=\"text-xl font-bold text-text-primary\">\n {tx('security.secretDetail.history.modalTitle', 'Version History')}\n </h2>\n </div>\n <button\n type=\"button\"\n onClick={() => setShowHistoryModal(false)}\n className=\"p-2 rounded-md hover:bg-bg-sunken text-text-secondary transition-colors\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n\n <div className=\"p-6 overflow-y-auto flex-1\">\n {versionsLoading ? (\n <div className=\"flex justify-center py-8\">\n <Loader2 className=\"size-8 animate-spin text-primary/60\" />\n </div>\n ) : (\n <div className=\"space-y-4\">\n {versions.map((v: any) => (\n <div\n key={v.id}\n className={cn(\n 'p-4 rounded-lg border',\n v.version === secret.version\n ? 'bg-action-primary-bg/5 border-primary/20'\n : 'bg-bg-surface border-border-subtle'\n )}\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <div className=\"flex items-center gap-2\">\n <span className=\"font-semibold\">\n {tx(\n 'security.secretDetail.history.versionLabel',\n 'Version {version}',\n {\n version: v.version,\n }\n )}\n </span>\n {v.version === secret.version && (\n <Badge variant=\"success\" className=\"text-[10px] uppercase\">\n {tx('security.common.status.active', 'Active')}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tx(\n 'security.secretDetail.history.versionMeta',\n '{date} by {createdBy}',\n {\n date: new Date(v.createdAt).toLocaleString(),\n createdBy: v.createdBy,\n }\n )}\n </p>\n {v.changeReason && <p className=\"text-sm mt-2\">{v.changeReason}</p>}\n </div>\n {v.version !== secret.version && (\n <SecurityPermissionGuard\n permission=\"secret:update\"\n featureFlagKey={SECURITY_FEATURE_FLAGS.SECRET_ROLLBACK}\n featureFlagDefault={false}\n >\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleRollback(v.version)}\n disabled={rollingBack}\n >\n {tx('security.secretDetail.actions.rollback', 'Rollback')}\n </Button>\n </SecurityPermissionGuard>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n </Card>\n </div>\n )}\n\n {/* Delete confirmation */}\n <ConfirmDialog\n isOpen={showDeleteConfirm}\n onClose={() => setShowDeleteConfirm(false)}\n onConfirm={handleDelete}\n title={tx('security.secretDetail.delete.title', 'Delete Secret')}\n description={tx(\n 'security.secretDetail.delete.description',\n 'Are you sure you want to delete \"{name}\"? This action cannot be undone and will permanently remove this secret from the vault.',\n { name: secret.name }\n )}\n confirmLabel={\n deletingSecret\n ? tx('security.secretDetail.delete.deleting', 'Deleting...')\n : tx('security.secretDetail.delete.confirm', 'Delete Secret')\n }\n variant=\"destructive\"\n />\n\n {/* Rotate prompt */}\n {showRotatePrompt && (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n <button\n type=\"button\"\n aria-label=\"Close rotate dialog\"\n className=\"absolute inset-0 bg-bg-surface/80 backdrop-blur-sm animate-in fade-in duration-200 cursor-default\"\n onClick={() => setShowRotatePrompt(false)}\n />\n <Card className=\"relative z-10 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-200 border-primary/20\">\n <div className=\"p-6 space-y-4\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-full bg-action-primary-bg/10 text-primary\">\n <RefreshCw className=\"size-5\" />\n </div>\n <h2 className=\"text-xl font-bold text-text-primary\">\n {tx('security.secretDetail.rotate.title', 'Rotate Secret')}\n </h2>\n </div>\n\n <p className=\"text-sm text-text-secondary\">\n {tx(\n 'security.secretDetail.rotate.description',\n 'Enter a new value for {name}. The current value will be moved to version history.',\n { name: secret.name }\n )}\n </p>\n\n <div className=\"space-y-2\">\n <label htmlFor=\"new-secret-value\" className=\"text-sm font-medium\">\n {tx('security.secretDetail.rotate.newValue', 'New Secret Value')}\n </label>\n <textarea\n id=\"new-secret-value\"\n aria-label={tx('security.secretDetail.rotate.newValue', 'New Secret Value')}\n ref={rotateValueRef}\n value={newRotationValue}\n onChange={(e) => setNewRotationValue(e.target.value)}\n placeholder={tx(\n 'security.secretDetail.rotate.placeholder',\n 'Enter new secret value...'\n )}\n rows={4}\n className={cn(\n 'w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-mono transition-all',\n 'focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary',\n 'placeholder:text-text-secondary/50'\n )}\n />\n </div>\n\n <div className=\"flex justify-end gap-3 pt-2\">\n <Button\n variant=\"outline\"\n onClick={() => setShowRotatePrompt(false)}\n disabled={rotating}\n >\n {tx('security.common.actions.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleRotate} disabled={rotating || !newRotationValue.trim()}>\n {rotating ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <RefreshCw className=\"size-4\" />\n )}\n {rotating\n ? tx('security.secretDetail.rotate.loading', 'Rotating...')\n : tx('security.secretDetail.rotate.confirm', 'Rotate Secret')}\n </Button>\n </div>\n </div>\n </Card>\n </div>\n )}\n\n {vaultId && secretId && (\n <SecretShareDialog\n isOpen={showShareDialog}\n onClose={() => setShowShareDialog(false)}\n vaultId={vaultId}\n secretId={secretId}\n name={secret.name}\n />\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,IAAmB;CACjC,IAAM,EAAE,YAAS,gBAAa,IAAkD,EAC1E,EAAE,cAAW,KAAK,UAAU,MAAkB,GAAa,EAC3D,EAAE,SAAM,GAAS,EACjB,IAAiB,IAAa,EAE9B,EAAE,MAAM,GAAY,YAAS,UAAO,eAAY,GAAa,KAAY,KAAK,EAC9E,IAAS,GAAY,WAErB,EAAE,MAAM,IAAc,SAAS,OAAoB,GAA0B;EACjF,WAAW;GAAE,UAAU,KAAY;GAAI,YAAY,EAAE,OAAO,IAAI;GAAE;EAClE,MAAM,CAAC;EACP,aAAa;EACd,CAAC,EACI,KAAW,IAAc,4BAA4B,SAAS,EAAE,EAEhE,EACJ,OAAO,IACP,YACA,UACA,SAAS,IACT,kBACE,EAAe,KAAY,GAAG,EAE5B,CAAC,IAAc,EAAE,SAAS,QAAoB,IAAiB,EAC/D,CAAC,IAAc,EAAE,SAAS,OAAc,IAAiB,EACzD,CAAC,IAAgB,EAAE,SAAS,QAAiB,IAAmB,EAChE,EAAE,YAAS,IAAyB,EAEpC,KAAkB,EAAc,gBAAgB,EAChD,KAAkB,EAAc,gBAAgB,EAChD,KAAmB,EAAc,iBAAiB,EAElD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OAEN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,GAAD;SACE,SAAQ;SACR,eAAe,EAAoB,GAAM;SACzC,UAAU;mBAET,EAAG,kCAAkC,SAAS;SACxC,CAAA,EACT,kBAAC,GAAD;SAAQ,SAAS;SAAc,UAAU,KAAY,CAAC,EAAiB,MAAM;mBAA7E,CACG,IACC,kBAAC,GAAD,EAAS,WAAU,uBAAwB,CAAA,GAE3C,kBAAC,GAAD,EAAW,WAAU,UAAW,CAAA,EAEjC,IACG,EAAG,wCAAwC,cAAc,GACzD,EAAG,wCAAwC,gBAAgB,CACxD;WACL;;OACF;;KACD,CAAA,CACH;;GAGP,KAAW,KACV,kBAAC,GAAD;IACE,QAAQ;IACR,eAAe,EAAmB,GAAM;IAC/B;IACC;IACV,MAAM,EAAO;IACb,CAAA;GAEO"}
|
|
1
|
+
{"version":3,"file":"SecretDetailPage.js","names":[],"sources":["../../../src/security/pages/SecretDetailPage.tsx"],"sourcesContent":["import { useState, useRef } from 'react';\nimport { useParams, useNavigate } from 'react-router-dom';\nimport {\n ArrowLeft,\n Edit2,\n Trash2,\n RefreshCw,\n History,\n Loader2,\n AlertTriangle,\n Clock,\n KeyRound,\n Shield,\n Calendar,\n Share2,\n} from 'lucide-react';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n GlassCard,\n CTAOverflowMenu,\n type CTAAction,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { SecretValueDisplay } from '../components/SecretValueDisplay';\nimport { SecretTypeBadge } from '../components/SecretTypeBadge';\nimport { RotationStatusBadge } from '../components/RotationStatusBadge';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { SecretShareDialog } from '../components/SecretShareDialog';\nimport { Button, Card, Badge } from '../components/ui';\nimport {\n useGetSecret,\n useDeleteSecret,\n useRotateSecret,\n useRollbackSecret,\n} from '../hooks/useSecretQueries';\nimport { useSecurityEventEmitter } from '../hooks/useSecurityEventEmitter';\nimport { useGetSecretVersionsQuery } from '../../generated/wspace-operations';\nimport { useSecretValue } from '../hooks/useSecretValue';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { SecurityPermissionGuard } from '../components/SecurityPermissionGuard';\nimport { usePermission, useFeatureFlag } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { cn } from '../utils/cn';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { translateWithFallback } from '../utils/i18n';\nimport { SECURITY_FEATURE_FLAGS } from '../constants/featureFlags';\nimport type { SecretType, RotationStatus } from '../types';\n\nexport function SecretDetailPage() {\n const { vaultId, secretId } = useParams<{ vaultId: string; secretId: string }>();\n const { basePath = '/', navigate: shellNavigate } = useSecurity();\n const { t } = useI18n();\n const routerNavigate = useNavigate();\n\n const { data: secretData, loading, error, refetch } = useGetSecret(secretId ?? null);\n const secret = secretData?.getSecret;\n\n const { data: versionsData, loading: versionsLoading } = useGetSecretVersionsQuery({\n variables: { secretId: secretId ?? '', pagination: { limit: 50 } },\n skip: !secretId,\n fetchPolicy: 'network-only',\n });\n const versions = versionsData?.getSecretVersionsPaginated?.items ?? [];\n\n const {\n value: decryptedValue,\n reveal,\n hide,\n loading: decrypting,\n isRevealed,\n } = useSecretValue(secretId ?? '');\n\n const [deleteSecret, { loading: deletingSecret }] = useDeleteSecret();\n const [rotateSecret, { loading: rotating }] = useRotateSecret();\n const [rollbackSecret, { loading: rollingBack }] = useRollbackSecret();\n const { emit } = useSecurityEventEmitter();\n\n const canDeleteSecret = usePermission('secret:delete');\n const canUpdateSecret = usePermission('secret:update');\n const canDecryptSecret = usePermission('secret:decrypt');\n const featureSecretRotate = useFeatureFlag(SECURITY_FEATURE_FLAGS.SECRET_ROTATE, false);\n\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n const [showShareDialog, setShowShareDialog] = useState(false);\n const [showRotatePrompt, setShowRotatePrompt] = useState(false);\n const rotateValueRef = useRef<HTMLTextAreaElement>(null);\n const openRotatePrompt = () => {\n setShowRotatePrompt(true);\n // Focus next frame so the textarea has been mounted by then.\n requestAnimationFrame(() => rotateValueRef.current?.focus());\n };\n const [showHistoryModal, setShowHistoryModal] = useState(false);\n const [newRotationValue, setNewRotationValue] = useState('');\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) =>\n translateWithFallback(t, key, fallback, params);\n\n const handleNavigate = (path: string) => {\n if (shellNavigate) {\n shellNavigate(path);\n } else {\n routerNavigate(path);\n }\n };\n\n const handleBack = () => {\n handleNavigate(`${basePath}/vaults/${vaultId}`);\n };\n\n const handleDelete = async () => {\n if (!secretId) return;\n try {\n await deleteSecret({ variables: { id: secretId } });\n emit('secret.deleted', { secretId, vaultId });\n setShowDeleteConfirm(false);\n void nativeNotify('success');\n handleBack();\n } catch (err) {\n console.error('Failed to delete secret:', err);\n void nativeNotify('error');\n }\n };\n\n const requestDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: 'Delete Secret',\n message: 'Delete this secret? This cannot be undone.',\n okButtonTitle: 'Delete',\n cancelButtonTitle: 'Cancel',\n });\n if (result === null) {\n setShowDeleteConfirm(true);\n return;\n }\n if (result) {\n await handleDelete();\n }\n };\n\n const handleRotate = async () => {\n if (!secretId || !newRotationValue.trim()) return;\n try {\n await rotateSecret({ variables: { id: secretId, newValue: newRotationValue.trim() } });\n emit('secret.rotated', { secretId, vaultId });\n setShowRotatePrompt(false);\n setNewRotationValue('');\n refetch();\n } catch (err) {\n console.error('Failed to rotate secret:', err);\n }\n };\n\n const handleRollback = async (version: number) => {\n if (!secretId) return;\n try {\n await rollbackSecret({ variables: { id: secretId, version } });\n emit('secret.rollback', { secretId, vaultId });\n refetch();\n setShowHistoryModal(false);\n } catch (err) {\n console.error('Failed to rollback secret:', err);\n }\n };\n\n if (loading && !secret) {\n return (\n <PageLayout\n title={tx('security.secretDetail.loading.title', 'Loading Secret...')}\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tx('security.common.breadcrumbs.secret', 'Secret') },\n ]}\n >\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 className=\"size-10 animate-spin text-primary/60\" />\n </div>\n </PageLayout>\n );\n }\n\n if (error || !secret) {\n return (\n <PageLayout\n title={tx('security.common.errorPage.title', 'Error')}\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n { label: tx('security.common.breadcrumbs.secret', 'Secret') },\n ]}\n >\n <Card className=\"p-8 text-center max-w-lg mx-auto mt-10\">\n <div className=\"flex flex-col items-center gap-4\">\n <div className=\"p-3 rounded-full bg-status-error-bg/10\">\n <AlertTriangle className=\"size-8 text-status-error-text\" />\n </div>\n <div>\n <h3 className=\"text-lg font-bold text-text-primary\">\n {tx('security.secretDetail.error.title', 'Failed to load secret')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-2\">\n {error?.message ??\n tx(\n 'security.secretDetail.error.description',\n 'Secret not found or access denied.'\n )}\n </p>\n </div>\n <Button variant=\"outline\" onClick={handleBack} className=\"mt-4\">\n <ArrowLeft className=\"size-4\" />\n {tx('security.secretDetail.actions.backToVault', 'Go Back to Vault')}\n </Button>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n const versionCount = secret.versionCount ?? 0;\n const rotationStatus: RotationStatus | undefined = secret.lastRotatedAt ? 'healthy' : undefined;\n\n return (\n <PageLayout\n title={secret.name}\n description={\n secret.description ??\n tx('security.secretDetail.description', 'View and manage this secret.')\n }\n breadcrumbs={[\n { label: tx('security.common.breadcrumbs.security', 'Security'), path: basePath },\n {\n label: tx('security.common.breadcrumbs.vault', 'Vault'),\n path: `${basePath}/vaults/${vaultId}`,\n },\n { label: secret.name },\n ]}\n actions={(() => {\n // Boff UI 2.0: keep \"Back\" as a quiet navigation button; collapse the\n // secondary actions (share / rotate / delete) into the overflow menu.\n // Gating preserved: rotate needs secret:update + SECRET_ROTATE flag.\n const overflowActions: CTAAction[] = [];\n if (canUpdateSecret) {\n overflowActions.push({\n label: tx('security.common.actions.share', 'Share'),\n icon: <Share2 className=\"size-4\" />,\n onSelect: () => setShowShareDialog(true),\n });\n }\n if (canUpdateSecret && featureSecretRotate) {\n overflowActions.push({\n label: tx('security.secretDetail.actions.rotate', 'Rotate'),\n icon: <RefreshCw className=\"size-4\" />,\n onSelect: openRotatePrompt,\n });\n }\n if (canDeleteSecret) {\n overflowActions.push({\n label: tx('security.common.actions.delete', 'Delete'),\n icon: <Trash2 className=\"size-4\" />,\n intent: 'destructive',\n onSelect: () => void requestDelete(),\n });\n }\n return (\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n <span className=\"hidden sm:inline\">\n {tx('security.secretDetail.actions.backToVault', 'Back to Vault')}\n </span>\n <span className=\"sm:hidden\">{tx('security.common.actions.back', 'Back')}</span>\n </Button>\n <CTAOverflowMenu actions={overflowActions} />\n </div>\n );\n })()}\n >\n <div className=\"space-y-6\">\n {/* Status and Info */}\n <div className=\"flex flex-wrap items-center gap-3\">\n <SecretTypeBadge type={secret.type as SecretType} />\n {rotationStatus && <RotationStatusBadge status={rotationStatus} />}\n <Badge variant=\"outline\" className=\"bg-bg-surface/50\">\n {tx('security.secretDetail.status.label', 'Status: {status}', {\n status: secret.status,\n })}\n </Badge>\n {secret.labels?.map((label: any) => (\n <Badge key={label.id} variant=\"outline\" className=\"border-primary/20 text-primary\">\n {label.label}\n </Badge>\n ))}\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-6\">\n {/* Main Info */}\n <div className=\"md:col-span-2 space-y-6\">\n {/* Secret Value — the single emphasis zone on this page */}\n <GlassCard treatment=\"glass\" className=\"p-6\">\n <div className=\"flex items-center justify-between mb-4\">\n <h2 className=\"text-lg font-bold text-text-primary flex items-center gap-2\">\n <KeyRound className=\"size-5 text-primary\" />\n {tx('security.secretDetail.value.title', 'Secret Value')}\n </h2>\n {secret.expiresAt && (\n <div className=\"flex items-center gap-1.5 text-xs text-warning\">\n <Calendar className=\"size-3.5\" />\n {tx('security.secretDetail.value.expires', 'Expires: {date}', {\n date: new Date(secret.expiresAt).toLocaleDateString(),\n })}\n </div>\n )}\n </div>\n <SecretValueDisplay\n value={decryptedValue ?? ''}\n isRevealed={isRevealed}\n onToggleReveal={\n canDecryptSecret\n ? () => {\n if (isRevealed) {\n hide();\n } else {\n void reveal();\n }\n }\n : undefined\n }\n isLoading={decrypting}\n />\n <p className=\"text-xs text-text-secondary mt-4 italic\">\n {tx(\n 'security.secretDetail.value.note',\n 'Secret values are decrypted on-demand and never stored in plain text.'\n )}\n </p>\n </GlassCard>\n\n {/* Version History Summary */}\n <Card className=\"p-6 shadow-sm border-border-subtle/60\">\n <div className=\"flex items-center justify-between mb-6\">\n <h2 className=\"text-lg font-bold text-text-primary flex items-center gap-2\">\n <History className=\"size-5 text-primary\" />\n {tx('security.secretDetail.history.title', 'Version History')}\n </h2>\n <Badge variant=\"outline\" className=\"bg-bg-sunken font-mono\">\n {tx('security.secretDetail.history.totalVersions', '{count} total versions', {\n count: versionCount,\n })}\n </Badge>\n </div>\n\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between p-4 rounded-lg bg-action-primary-bg/5 border border-primary/10\">\n <div className=\"flex items-center gap-3\">\n <div className=\"size-8 rounded-full bg-action-primary-bg/10 flex items-center justify-center text-primary text-xs font-bold tabular-nums\">\n v{secret.version ?? versionCount}\n </div>\n <div>\n <p className=\"text-sm font-semibold\">\n {tx(\n 'security.secretDetail.history.currentVersion',\n 'Current Active Version'\n )}\n </p>\n <p className=\"text-xs text-text-secondary\">\n {tx('security.secretDetail.history.lastUpdated', 'Last updated {date}', {\n date: new Date(secret.updatedAt).toLocaleString(),\n })}\n </p>\n </div>\n </div>\n <Badge variant=\"success\" className=\"text-[10px] uppercase\">\n {tx('security.common.status.active', 'Active')}\n </Badge>\n </div>\n\n {versionCount > 1 && (\n <div className=\"text-center py-4 border-2 border-dashed border-border-subtle/40 rounded-lg bg-bg-sunken/20\">\n <p className=\"text-sm text-text-secondary\">\n {tx(\n 'security.secretDetail.history.available',\n 'Historical versions are available. You can rollback to a previous state if needed.'\n )}\n </p>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"mt-3\"\n onClick={() => setShowHistoryModal(true)}\n >\n {tx('security.secretDetail.history.viewFull', 'View Full History')}\n </Button>\n </div>\n )}\n </div>\n </Card>\n </div>\n\n {/* Sidebar Info */}\n <div className=\"space-y-6\">\n <Card className=\"p-6 shadow-sm border-border-subtle/60 space-y-4\">\n <h3 className=\"font-bold text-sm uppercase tracking-wider text-text-secondary\">\n {tx('security.secretDetail.details.title', 'Details')}\n </h3>\n\n <div className=\"space-y-3\">\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tx('security.secretDetail.details.keyIdentifier', 'Key Identifier')}\n </p>\n <code className=\"text-xs font-mono bg-bg-sunken px-1.5 py-0.5 rounded block mt-1 overflow-hidden text-ellipsis whitespace-nowrap\">\n {secret.key}\n </code>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tx('security.secretDetail.details.createdBy', 'Created By')}\n </p>\n <p className=\"text-sm font-medium mt-1\">{secret.createdBy}</p>\n </div>\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tx('security.secretDetail.details.createdAt', 'Created At')}\n </p>\n <div className=\"flex items-center gap-1.5 text-sm mt-1\">\n <Clock className=\"size-3.5\" />\n {new Date(secret.createdAt).toLocaleDateString()}\n </div>\n </div>\n {secret.lastRotatedAt && (\n <div>\n <p className=\"text-xs text-text-secondary\">\n {tx('security.secretDetail.details.lastRotation', 'Last Rotation')}\n </p>\n <p className=\"text-sm mt-1\">\n {new Date(secret.lastRotatedAt).toLocaleString()}\n </p>\n </div>\n )}\n </div>\n </Card>\n\n <GlassCard treatment=\"insight\" className=\"p-6 space-y-4\">\n <h3 className=\"font-bold text-sm text-primary flex items-center gap-2\">\n <Shield className=\"size-4\" />\n {tx('security.secretDetail.security.title', 'Security')}\n </h3>\n <p className=\"text-xs text-text-secondary leading-relaxed\">\n {tx(\n 'security.secretDetail.security.description',\n 'This secret is protected by 256-bit encryption. All access is logged and monitored for suspicious activity.'\n )}\n </p>\n </GlassCard>\n </div>\n </div>\n </div>\n\n {/* Version History Modal */}\n <Dialog\n open={showHistoryModal}\n onOpenChange={(open) => {\n if (!open) setShowHistoryModal(false);\n }}\n >\n <DialogContent className=\"max-w-2xl border-primary/20 max-h-[80vh] flex flex-col gap-0 p-0\">\n <DialogHeader className=\"p-6 border-b border-border-subtle text-left\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-full bg-action-primary-bg/10 text-primary\">\n <History className=\"size-5\" />\n </div>\n <DialogTitle className=\"text-xl font-bold\">\n {tx('security.secretDetail.history.modalTitle', 'Version History')}\n </DialogTitle>\n </div>\n </DialogHeader>\n\n <div className=\"p-6 overflow-y-auto flex-1\">\n {versionsLoading ? (\n <div className=\"flex justify-center py-8\">\n <Loader2 className=\"size-8 animate-spin text-primary/60\" />\n </div>\n ) : (\n <div className=\"space-y-4\">\n {versions.map((v: any) => (\n <div\n key={v.id}\n className={cn(\n 'p-4 rounded-lg border',\n v.version === secret.version\n ? 'bg-action-primary-bg/5 border-primary/20'\n : 'bg-bg-surface border-border-subtle'\n )}\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <div className=\"flex items-center gap-2\">\n <span className=\"font-semibold\">\n {tx(\n 'security.secretDetail.history.versionLabel',\n 'Version {version}',\n {\n version: v.version,\n }\n )}\n </span>\n {v.version === secret.version && (\n <Badge variant=\"success\" className=\"text-[10px] uppercase\">\n {tx('security.common.status.active', 'Active')}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tx(\n 'security.secretDetail.history.versionMeta',\n '{date} by {createdBy}',\n {\n date: new Date(v.createdAt).toLocaleString(),\n createdBy: v.createdBy,\n }\n )}\n </p>\n {v.changeReason && <p className=\"text-sm mt-2\">{v.changeReason}</p>}\n </div>\n {v.version !== secret.version && (\n <SecurityPermissionGuard\n permission=\"secret:update\"\n featureFlagKey={SECURITY_FEATURE_FLAGS.SECRET_ROLLBACK}\n featureFlagDefault={false}\n >\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleRollback(v.version)}\n disabled={rollingBack}\n >\n {tx('security.secretDetail.actions.rollback', 'Rollback')}\n </Button>\n </SecurityPermissionGuard>\n )}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n </DialogContent>\n </Dialog>\n\n {/* Delete confirmation */}\n <ConfirmDialog\n isOpen={showDeleteConfirm}\n onClose={() => setShowDeleteConfirm(false)}\n onConfirm={handleDelete}\n title={tx('security.secretDetail.delete.title', 'Delete Secret')}\n description={tx(\n 'security.secretDetail.delete.description',\n 'Are you sure you want to delete \"{name}\"? This action cannot be undone and will permanently remove this secret from the vault.',\n { name: secret.name }\n )}\n confirmLabel={\n deletingSecret\n ? tx('security.secretDetail.delete.deleting', 'Deleting...')\n : tx('security.secretDetail.delete.confirm', 'Delete Secret')\n }\n variant=\"destructive\"\n />\n\n {/* Rotate prompt */}\n <Dialog\n open={showRotatePrompt}\n onOpenChange={(open) => {\n if (!open) setShowRotatePrompt(false);\n }}\n >\n <DialogContent className=\"max-w-md border-primary/20\">\n <div className=\"space-y-4\">\n <DialogHeader className=\"text-left\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2 rounded-full bg-action-primary-bg/10 text-primary\">\n <RefreshCw className=\"size-5\" />\n </div>\n <DialogTitle className=\"text-xl font-bold\">\n {tx('security.secretDetail.rotate.title', 'Rotate Secret')}\n </DialogTitle>\n </div>\n </DialogHeader>\n\n <p className=\"text-sm text-text-secondary\">\n {tx(\n 'security.secretDetail.rotate.description',\n 'Enter a new value for {name}. The current value will be moved to version history.',\n { name: secret.name }\n )}\n </p>\n\n <div className=\"space-y-2\">\n <label htmlFor=\"new-secret-value\" className=\"text-sm font-medium\">\n {tx('security.secretDetail.rotate.newValue', 'New Secret Value')}\n </label>\n <textarea\n id=\"new-secret-value\"\n aria-label={tx('security.secretDetail.rotate.newValue', 'New Secret Value')}\n ref={rotateValueRef}\n value={newRotationValue}\n onChange={(e) => setNewRotationValue(e.target.value)}\n placeholder={tx(\n 'security.secretDetail.rotate.placeholder',\n 'Enter new secret value...'\n )}\n rows={4}\n className={cn(\n 'w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm font-mono transition-all',\n 'focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary',\n 'placeholder:text-text-secondary/50'\n )}\n />\n </div>\n\n <div className=\"flex justify-end gap-3 pt-2\">\n <Button\n variant=\"outline\"\n onClick={() => setShowRotatePrompt(false)}\n disabled={rotating}\n >\n {tx('security.common.actions.cancel', 'Cancel')}\n </Button>\n <Button onClick={handleRotate} disabled={rotating || !newRotationValue.trim()}>\n {rotating ? (\n <Loader2 className=\"size-4 animate-spin\" />\n ) : (\n <RefreshCw className=\"size-4\" />\n )}\n {rotating\n ? tx('security.secretDetail.rotate.loading', 'Rotating...')\n : tx('security.secretDetail.rotate.confirm', 'Rotate Secret')}\n </Button>\n </div>\n </div>\n </DialogContent>\n </Dialog>\n\n {vaultId && secretId && (\n <SecretShareDialog\n isOpen={showShareDialog}\n onClose={() => setShowShareDialog(false)}\n vaultId={vaultId}\n secretId={secretId}\n name={secret.name}\n />\n )}\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAgB,IAAmB;CACjC,IAAM,EAAE,YAAS,gBAAa,GAAkD,EAC1E,EAAE,cAAW,KAAK,UAAU,MAAkB,GAAa,EAC3D,EAAE,SAAM,GAAS,EACjB,KAAiB,IAAa,EAE9B,EAAE,MAAM,IAAY,aAAS,UAAO,eAAY,GAAa,KAAY,KAAK,EAC9E,IAAS,IAAY,WAErB,EAAE,MAAM,IAAc,SAAS,OAAoB,GAA0B;EACjF,WAAW;GAAE,UA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,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,SAAD;SAAO,SAAQ;SAAmB,WAAU;mBACzC,EAAG,yCAAyC,mBAAmB;SAC1D,CAAA,EACR,kBAAC,YAAD;SACE,IAAG;SACH,cAAY,EAAG,yCAAyC,mBAAmB;SAC3E,KAAK;SACL,OAAO;SACP,WAAW,MAAM,EAAoB,EAAE,OAAO,MAAM;SACpD,aAAa,EACX,4CACA,4BACD;SACD,MAAM;SACN,WAAW,EACT,0GACA,8EACA,qCACD;SACD,CAAA,CACE;;OAEN,kBAAC,OAAD;QAAK,WAAU;kBAAf,CACE,kBAAC,GAAD;SACE,SAAQ;SACR,eAAe,EAAoB,GAAM;SACzC,UAAU;mBAET,EAAG,kCAAkC,SAAS;SACxC,CAAA,EACT,kBAAC,GAAD;SAAQ,SAAS;SAAc,UAAU,KAAY,CAAC,EAAiB,MAAM;mBAA7E,CACG,IACC,kBAAC,GAAD,EAAS,WAAU,uBAAwB,CAAA,GAE3C,kBAAC,GAAD,EAAW,WAAU,UAAW,CAAA,EAEjC,IACG,EAAG,wCAAwC,cAAc,GACzD,EAAG,wCAAwC,gBAAgB,CACxD;WACL;;OACF;;KACM,CAAA;IACT,CAAA;GAER,KAAW,KACV,kBAAC,IAAD;IACE,QAAQ;IACR,eAAe,EAAmB,GAAM;IAC/B;IACC;IACV,MAAM,EAAO;IACb,CAAA;GAEO"}
|
|
@@ -7,110 +7,114 @@ import { ActivityTimeline as o } from "../components/ActivityTimeline.js";
|
|
|
7
7
|
import { useSecurityDashboard as s } from "../hooks/useSecurityDashboard.js";
|
|
8
8
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
9
9
|
import { AlertTriangle as u, KeyRound as d, Loader2 as f, Lock as p, Users as m } from "lucide-react";
|
|
10
|
-
import {
|
|
10
|
+
import { EmphasisPanel as h, GlassCard as g } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
11
12
|
//#region src/security/pages/SecurityDashboardPage.tsx
|
|
12
|
-
function
|
|
13
|
-
let { basePath:
|
|
14
|
-
return
|
|
15
|
-
title:
|
|
13
|
+
function v() {
|
|
14
|
+
let { basePath: v = "/" } = e(), { dashboard: y, loading: b, error: x } = s(), { t: S } = _(), C = (e, t) => i(S, e, t);
|
|
15
|
+
return b ? /* @__PURE__ */ c(t, {
|
|
16
|
+
title: C("security.dashboard.title", "Security Health"),
|
|
16
17
|
breadcrumbs: [{
|
|
17
|
-
label:
|
|
18
|
-
path:
|
|
19
|
-
}, { label:
|
|
18
|
+
label: C("security.nav.security", "Security"),
|
|
19
|
+
path: v
|
|
20
|
+
}, { label: C("security.nav.health", "Health") }],
|
|
20
21
|
children: /* @__PURE__ */ c("div", {
|
|
21
22
|
className: "flex items-center justify-center py-16",
|
|
22
23
|
children: /* @__PURE__ */ c(f, { className: "size-8 animate-spin text-primary" })
|
|
23
24
|
})
|
|
24
|
-
}) :
|
|
25
|
-
title:
|
|
25
|
+
}) : x ? /* @__PURE__ */ c(t, {
|
|
26
|
+
title: C("security.dashboard.title", "Security Health"),
|
|
26
27
|
breadcrumbs: [{
|
|
27
|
-
label:
|
|
28
|
-
path:
|
|
29
|
-
}, { label:
|
|
28
|
+
label: C("security.nav.security", "Security"),
|
|
29
|
+
path: v
|
|
30
|
+
}, { label: C("security.nav.health", "Health") }],
|
|
30
31
|
children: /* @__PURE__ */ c(r, {
|
|
31
32
|
className: "p-6",
|
|
32
33
|
children: /* @__PURE__ */ l("div", {
|
|
33
34
|
className: "flex items-start gap-4",
|
|
34
35
|
children: [/* @__PURE__ */ c(u, { className: "size-6 text-status-error-text" }), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("h3", {
|
|
35
36
|
className: "font-semibold text-status-error-text",
|
|
36
|
-
children:
|
|
37
|
+
children: C("security.dashboard.error", "Failed to load dashboard")
|
|
37
38
|
}), /* @__PURE__ */ c("p", {
|
|
38
39
|
className: "text-sm text-text-secondary mt-1",
|
|
39
|
-
children:
|
|
40
|
+
children: x.message
|
|
40
41
|
})] })]
|
|
41
42
|
})
|
|
42
43
|
})
|
|
43
|
-
}) : /* @__PURE__ */
|
|
44
|
-
title:
|
|
45
|
-
description:
|
|
44
|
+
}) : /* @__PURE__ */ c(t, {
|
|
45
|
+
title: C("security.dashboard.title", "Security Health"),
|
|
46
|
+
description: C("security.dashboard.description", "Overview of your workspace security posture."),
|
|
46
47
|
breadcrumbs: [{
|
|
47
|
-
label:
|
|
48
|
-
path:
|
|
49
|
-
}, { label:
|
|
50
|
-
children:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
label: C("security.nav.security", "Security"),
|
|
49
|
+
path: v
|
|
50
|
+
}, { label: C("security.nav.health", "Health") }],
|
|
51
|
+
children: /* @__PURE__ */ l("div", {
|
|
52
|
+
className: "space-y-6",
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ l("div", {
|
|
55
|
+
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ c(a, { score: y.healthScore }),
|
|
58
|
+
/* @__PURE__ */ l(g, {
|
|
59
|
+
treatment: "metric",
|
|
60
|
+
className: "p-5",
|
|
61
|
+
children: [/* @__PURE__ */ l("div", {
|
|
62
|
+
className: "flex items-center gap-2 text-text-secondary mb-1",
|
|
63
|
+
children: [/* @__PURE__ */ c(p, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
64
|
+
className: "text-xs font-medium uppercase tracking-wider",
|
|
65
|
+
children: C("security.dashboard.vaults", "Vaults")
|
|
66
|
+
})]
|
|
67
|
+
}), /* @__PURE__ */ c("p", {
|
|
68
|
+
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
69
|
+
children: y.totalVaults
|
|
62
70
|
})]
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ l(g, {
|
|
73
|
+
treatment: "metric",
|
|
74
|
+
className: "p-5",
|
|
75
|
+
children: [/* @__PURE__ */ l("div", {
|
|
76
|
+
className: "flex items-center gap-2 text-text-secondary mb-1",
|
|
77
|
+
children: [/* @__PURE__ */ c(d, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
78
|
+
className: "text-xs font-medium uppercase tracking-wider",
|
|
79
|
+
children: C("security.dashboard.secrets", "Secrets")
|
|
80
|
+
})]
|
|
81
|
+
}), /* @__PURE__ */ c("p", {
|
|
82
|
+
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
83
|
+
children: y.totalSecrets
|
|
75
84
|
})]
|
|
76
|
-
}),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ l(g, {
|
|
87
|
+
treatment: "metric",
|
|
88
|
+
className: "p-5",
|
|
89
|
+
children: [/* @__PURE__ */ l("div", {
|
|
90
|
+
className: "flex items-center gap-2 text-text-secondary mb-1",
|
|
91
|
+
children: [/* @__PURE__ */ c(m, { className: "size-4" }), /* @__PURE__ */ c("span", {
|
|
92
|
+
className: "text-xs font-medium uppercase tracking-wider",
|
|
93
|
+
children: C("security.dashboard.members", "Members")
|
|
94
|
+
})]
|
|
95
|
+
}), /* @__PURE__ */ c("p", {
|
|
96
|
+
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
97
|
+
children: y.totalMembers
|
|
88
98
|
})]
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
}),
|
|
96
|
-
_.lockedVaults.length > 0 && /* @__PURE__ */ l(r, {
|
|
97
|
-
className: "p-5",
|
|
98
|
-
children: [/* @__PURE__ */ l("div", {
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
}),
|
|
102
|
+
y.lockedVaults.length > 0 && /* @__PURE__ */ l(h, { children: [/* @__PURE__ */ l("div", {
|
|
99
103
|
className: "flex items-center gap-2 mb-3",
|
|
100
104
|
children: [
|
|
101
105
|
/* @__PURE__ */ c(p, { className: "size-5 text-status-warning-text" }),
|
|
102
106
|
/* @__PURE__ */ c("h3", {
|
|
103
107
|
className: "font-semibold text-text-primary",
|
|
104
|
-
children:
|
|
108
|
+
children: C("security.dashboard.lockedVaults", "Locked Vaults")
|
|
105
109
|
}),
|
|
106
110
|
/* @__PURE__ */ c(n, {
|
|
107
111
|
variant: "warning",
|
|
108
|
-
children:
|
|
112
|
+
children: y.lockedVaults.length
|
|
109
113
|
})
|
|
110
114
|
]
|
|
111
115
|
}), /* @__PURE__ */ c("ul", {
|
|
112
116
|
className: "space-y-2",
|
|
113
|
-
children:
|
|
117
|
+
children: y.lockedVaults.slice(0, 5).map((e) => /* @__PURE__ */ l("li", {
|
|
114
118
|
className: "text-sm text-text-secondary flex items-center gap-2",
|
|
115
119
|
children: [
|
|
116
120
|
/* @__PURE__ */ c(p, { className: "size-3 text-status-warning-text shrink-0" }),
|
|
@@ -119,27 +123,27 @@ function g() {
|
|
|
119
123
|
children: e.name
|
|
120
124
|
}),
|
|
121
125
|
e.lockedAt ? /* @__PURE__ */ l("span", {
|
|
122
|
-
className: "text-xs text-text-secondary ml-auto",
|
|
126
|
+
className: "text-xs text-text-secondary ml-auto tabular-nums",
|
|
123
127
|
children: ["since ", new Date(e.lockedAt).toLocaleDateString()]
|
|
124
128
|
}) : null
|
|
125
129
|
]
|
|
126
130
|
}, e.id))
|
|
127
|
-
})]
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
})
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
})] }),
|
|
132
|
+
/* @__PURE__ */ l(r, {
|
|
133
|
+
className: "p-6",
|
|
134
|
+
children: [/* @__PURE__ */ c("h2", {
|
|
135
|
+
className: "text-lg font-semibold text-text-primary mb-4",
|
|
136
|
+
children: C("security.dashboard.recentActivity", "Recent Activity")
|
|
137
|
+
}), y.recentActivity.length > 0 ? /* @__PURE__ */ c(o, { entries: y.recentActivity }) : /* @__PURE__ */ c("p", {
|
|
138
|
+
className: "text-sm text-text-secondary text-center py-8",
|
|
139
|
+
children: C("security.dashboard.noActivity", "No recent activity to display.")
|
|
140
|
+
})]
|
|
141
|
+
})
|
|
142
|
+
]
|
|
143
|
+
})
|
|
140
144
|
});
|
|
141
145
|
}
|
|
142
146
|
//#endregion
|
|
143
|
-
export {
|
|
147
|
+
export { v as SecurityDashboardPage };
|
|
144
148
|
|
|
145
149
|
//# sourceMappingURL=SecurityDashboardPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityDashboardPage.js","names":[],"sources":["../../../src/security/pages/SecurityDashboardPage.tsx"],"sourcesContent":["import { Shield, AlertTriangle, KeyRound, Lock, Loader2, Users } from 'lucide-react';\nimport { PageLayout } from '../components/PageLayout';\nimport { SecurityScoreCard } from '../components/SecurityScoreCard';\nimport { ActivityTimeline } from '../components/ActivityTimeline';\nimport {
|
|
1
|
+
{"version":3,"file":"SecurityDashboardPage.js","names":[],"sources":["../../../src/security/pages/SecurityDashboardPage.tsx"],"sourcesContent":["import { Shield, AlertTriangle, KeyRound, Lock, Loader2, Users } from 'lucide-react';\nimport { GlassCard, EmphasisPanel } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { SecurityScoreCard } from '../components/SecurityScoreCard';\nimport { ActivityTimeline } from '../components/ActivityTimeline';\nimport { Card, Badge } from '../components/ui';\nimport { useSecurityDashboard } from '../hooks/useSecurityDashboard';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { translateWithFallback } from '../utils/i18n';\n\nexport function SecurityDashboardPage() {\n const { basePath = '/' } = useSecurity();\n const { dashboard, loading, error } = useSecurityDashboard();\n const { t } = useI18n();\n const tr = (key: string, fallback: string) => translateWithFallback(t, key, fallback);\n\n if (loading) {\n return (\n <PageLayout\n title={tr('security.dashboard.title', 'Security Health')}\n breadcrumbs={[\n { label: tr('security.nav.security', 'Security'), path: basePath },\n { label: tr('security.nav.health', 'Health') },\n ]}\n >\n <div className=\"flex items-center justify-center py-16\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n </PageLayout>\n );\n }\n\n if (error) {\n return (\n <PageLayout\n title={tr('security.dashboard.title', 'Security Health')}\n breadcrumbs={[\n { label: tr('security.nav.security', 'Security'), path: basePath },\n { label: tr('security.nav.health', 'Health') },\n ]}\n >\n <Card className=\"p-6\">\n <div className=\"flex items-start gap-4\">\n <AlertTriangle className=\"size-6 text-status-error-text\" />\n <div>\n <h3 className=\"font-semibold text-status-error-text\">\n {tr('security.dashboard.error', 'Failed to load dashboard')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-1\">{error.message}</p>\n </div>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n return (\n <PageLayout\n title={tr('security.dashboard.title', 'Security Health')}\n description={tr(\n 'security.dashboard.description',\n 'Overview of your workspace security posture.'\n )}\n breadcrumbs={[\n { label: tr('security.nav.security', 'Security'), path: basePath },\n { label: tr('security.nav.health', 'Health') },\n ]}\n >\n <div className=\"space-y-6\">\n {/* Score and stats */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n <SecurityScoreCard score={dashboard.healthScore} />\n\n <GlassCard treatment=\"metric\" className=\"p-5\">\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n <Lock className=\"size-4\" />\n <span className=\"text-xs font-medium uppercase tracking-wider\">\n {tr('security.dashboard.vaults', 'Vaults')}\n </span>\n </div>\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">\n {dashboard.totalVaults}\n </p>\n </GlassCard>\n\n <GlassCard treatment=\"metric\" className=\"p-5\">\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n <KeyRound className=\"size-4\" />\n <span className=\"text-xs font-medium uppercase tracking-wider\">\n {tr('security.dashboard.secrets', 'Secrets')}\n </span>\n </div>\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">\n {dashboard.totalSecrets}\n </p>\n </GlassCard>\n\n <GlassCard treatment=\"metric\" className=\"p-5\">\n <div className=\"flex items-center gap-2 text-text-secondary mb-1\">\n <Users className=\"size-4\" />\n <span className=\"text-xs font-medium uppercase tracking-wider\">\n {tr('security.dashboard.members', 'Members')}\n </span>\n </div>\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">\n {dashboard.totalMembers}\n </p>\n </GlassCard>\n </div>\n\n {/* Vault status overview — the one zone that needs attention */}\n {dashboard.lockedVaults.length > 0 && (\n <EmphasisPanel>\n <div className=\"flex items-center gap-2 mb-3\">\n <Lock className=\"size-5 text-status-warning-text\" />\n <h3 className=\"font-semibold text-text-primary\">\n {tr('security.dashboard.lockedVaults', 'Locked Vaults')}\n </h3>\n <Badge variant=\"warning\">{dashboard.lockedVaults.length}</Badge>\n </div>\n <ul className=\"space-y-2\">\n {dashboard.lockedVaults.slice(0, 5).map((v: any) => (\n <li key={v.id} className=\"text-sm text-text-secondary flex items-center gap-2\">\n <Lock className=\"size-3 text-status-warning-text shrink-0\" />\n <span className=\"truncate\">{v.name}</span>\n {v.lockedAt ? (\n <span className=\"text-xs text-text-secondary ml-auto tabular-nums\">\n since {new Date(v.lockedAt).toLocaleDateString()}\n </span>\n ) : null}\n </li>\n ))}\n </ul>\n </EmphasisPanel>\n )}\n\n {/* Recent Activity */}\n <Card className=\"p-6\">\n <h2 className=\"text-lg font-semibold text-text-primary mb-4\">\n {tr('security.dashboard.recentActivity', 'Recent Activity')}\n </h2>\n {dashboard.recentActivity.length > 0 ? (\n <ActivityTimeline entries={dashboard.recentActivity} />\n ) : (\n <p className=\"text-sm text-text-secondary text-center py-8\">\n {tr('security.dashboard.noActivity', 'No recent activity to display.')}\n </p>\n )}\n </Card>\n </div>\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,IAAwB;CACtC,IAAM,EAAE,cAAW,QAAQ,GAAa,EAClC,EAAE,cAAW,YAAS,aAAU,GAAsB,EACtD,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,MAAqB,EAAsB,GAAG,GAAK,EAAS;AA0CrF,QAxCI,IAEA,kBAAC,GAAD;EACE,OAAO,EAAG,4BAA4B,kBAAkB;EACxD,aAAa,CACX;GAAE,OAAO,EAAG,yBAAyB,WAAW;GAAE,MAAM;GAAU,EAClE,EAAE,OAAO,EAAG,uBAAuB,SAAS,EAAE,CAC/C;YAED,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD,EAAS,WAAU,oCAAqC,CAAA;GACpD,CAAA;EACK,CAAA,GAIb,IAEA,kBAAC,GAAD;EACE,OAAO,EAAG,4BAA4B,kBAAkB;EACxD,aAAa,CACX;GAAE,OAAO,EAAG,yBAAyB,WAAW;GAAE,MAAM;GAAU,EAClE,EAAE,OAAO,EAAG,uBAAuB,SAAS,EAAE,CAC/C;YAED,kBAAC,GAAD;GAAM,WAAU;aACd,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD,EAAe,WAAU,iCAAkC,CAAA,EAC3D,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;eACX,EAAG,4BAA4B,2BAA2B;KACxD,CAAA,EACL,kBAAC,KAAD;KAAG,WAAU;eAAoC,EAAM;KAAY,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