@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
|
@@ -9,24 +9,25 @@ import { nativeConfirm as f, nativeImpact as p, nativeNotify as m } from "../../
|
|
|
9
9
|
import { useState as h } from "react";
|
|
10
10
|
import { useNavigate as g, useParams as _ } from "react-router-dom";
|
|
11
11
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
12
|
-
import { AlertTriangle as b, ArrowLeft as x, CheckCircle as S, Clock as C, Cloud as w, Info as
|
|
12
|
+
import { AlertTriangle as b, ArrowLeft as x, CheckCircle as S, Clock as C, Cloud as w, Info as ee, Loader2 as T, RefreshCw as E, Trash2 as D, XCircle as O } from "lucide-react";
|
|
13
|
+
import { CTAOverflowMenu as k, ResponsiveTable as A } from "@burdenoff/fe-libs/ui";
|
|
13
14
|
//#region src/security/pages/ProviderDetailPage.tsx
|
|
14
|
-
function
|
|
15
|
-
let { vaultId:
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
if (
|
|
19
|
-
await
|
|
15
|
+
function j() {
|
|
16
|
+
let { vaultId: j, providerId: M } = _(), { basePath: N = "/", navigate: P } = e(), F = g(), { data: I, loading: L, error: R } = l(j), z = (I?.getVaultIntegrations?.items ?? []).find((e) => e.id === M), { data: B, loading: V } = u(M), H = B?.getVaultSyncLogs?.items ?? [], [U, { loading: W }] = s(), [G, { loading: K }] = c(), [q, J] = h(!1), Y = (e) => {
|
|
17
|
+
P ? P(e) : F(e);
|
|
18
|
+
}, X = () => Y(`${N}/providers`), Z = async () => {
|
|
19
|
+
if (M) try {
|
|
20
|
+
await G({ variables: { integrationId: M } });
|
|
20
21
|
} catch (e) {
|
|
21
22
|
console.error("Sync failed:", e);
|
|
22
23
|
}
|
|
23
|
-
},
|
|
24
|
-
if (
|
|
25
|
-
await
|
|
24
|
+
}, Q = async () => {
|
|
25
|
+
if (M) try {
|
|
26
|
+
await U({ variables: { id: M } }), m("success"), X();
|
|
26
27
|
} catch (e) {
|
|
27
28
|
console.error("Delete failed:", e), m("error");
|
|
28
29
|
}
|
|
29
|
-
},
|
|
30
|
+
}, te = async () => {
|
|
30
31
|
p("medium");
|
|
31
32
|
let e = await f({
|
|
32
33
|
title: "Delete Provider",
|
|
@@ -35,33 +36,33 @@ function A() {
|
|
|
35
36
|
cancelButtonTitle: "Cancel"
|
|
36
37
|
});
|
|
37
38
|
if (e === null) {
|
|
38
|
-
|
|
39
|
+
J(!0);
|
|
39
40
|
return;
|
|
40
41
|
}
|
|
41
|
-
e && await
|
|
42
|
+
e && await Q();
|
|
42
43
|
};
|
|
43
|
-
if (
|
|
44
|
+
if (L && !z) return /* @__PURE__ */ v(n, {
|
|
44
45
|
title: "Loading...",
|
|
45
46
|
breadcrumbs: [{
|
|
46
47
|
label: "Security",
|
|
47
|
-
path:
|
|
48
|
+
path: N
|
|
48
49
|
}, {
|
|
49
50
|
label: "Providers",
|
|
50
|
-
path: `${
|
|
51
|
+
path: `${N}/providers`
|
|
51
52
|
}],
|
|
52
53
|
children: /* @__PURE__ */ v("div", {
|
|
53
54
|
className: "flex items-center justify-center py-16",
|
|
54
|
-
children: /* @__PURE__ */ v(
|
|
55
|
+
children: /* @__PURE__ */ v(T, { className: "size-8 animate-spin text-primary" })
|
|
55
56
|
})
|
|
56
57
|
});
|
|
57
|
-
if (
|
|
58
|
+
if (R || !L && !z) return /* @__PURE__ */ v(n, {
|
|
58
59
|
title: "Error",
|
|
59
60
|
breadcrumbs: [{
|
|
60
61
|
label: "Security",
|
|
61
|
-
path:
|
|
62
|
+
path: N
|
|
62
63
|
}, {
|
|
63
64
|
label: "Providers",
|
|
64
|
-
path: `${
|
|
65
|
+
path: `${N}/providers`
|
|
65
66
|
}],
|
|
66
67
|
children: /* @__PURE__ */ v(a, {
|
|
67
68
|
className: "p-6",
|
|
@@ -74,64 +75,59 @@ function A() {
|
|
|
74
75
|
}),
|
|
75
76
|
/* @__PURE__ */ v("p", {
|
|
76
77
|
className: "text-sm text-text-secondary mt-1",
|
|
77
|
-
children:
|
|
78
|
+
children: R?.message ?? "The requested provider could not be found."
|
|
78
79
|
}),
|
|
79
80
|
/* @__PURE__ */ y(i, {
|
|
80
81
|
variant: "outline",
|
|
81
82
|
size: "sm",
|
|
82
83
|
className: "mt-4",
|
|
83
|
-
onClick:
|
|
84
|
+
onClick: X,
|
|
84
85
|
children: [/* @__PURE__ */ v(x, { className: "size-4" }), "Back to Providers"]
|
|
85
86
|
})
|
|
86
87
|
] })]
|
|
87
88
|
})
|
|
88
89
|
})
|
|
89
90
|
});
|
|
90
|
-
let $ = d(
|
|
91
|
+
let $ = d(z.providerType);
|
|
91
92
|
return /* @__PURE__ */ y(n, {
|
|
92
|
-
title:
|
|
93
|
+
title: z.displayName || $.label,
|
|
93
94
|
description: $.description,
|
|
94
95
|
breadcrumbs: [
|
|
95
96
|
{
|
|
96
97
|
label: "Security",
|
|
97
|
-
path:
|
|
98
|
+
path: N
|
|
98
99
|
},
|
|
99
100
|
{
|
|
100
101
|
label: "Providers",
|
|
101
|
-
path: `${
|
|
102
|
+
path: `${N}/providers`
|
|
102
103
|
},
|
|
103
|
-
{ label:
|
|
104
|
+
{ label: z.displayName || $.label }
|
|
104
105
|
],
|
|
105
106
|
actions: /* @__PURE__ */ y("div", {
|
|
106
107
|
className: "flex items-center gap-2",
|
|
107
|
-
children: [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
className: "hidden sm:inline",
|
|
131
|
-
children: "Remove"
|
|
132
|
-
})]
|
|
133
|
-
})
|
|
134
|
-
]
|
|
108
|
+
children: [/* @__PURE__ */ y(i, {
|
|
109
|
+
variant: "outline",
|
|
110
|
+
size: "sm",
|
|
111
|
+
onClick: X,
|
|
112
|
+
children: [/* @__PURE__ */ v(x, { className: "size-4" }), /* @__PURE__ */ v("span", {
|
|
113
|
+
className: "hidden sm:inline",
|
|
114
|
+
children: "Back"
|
|
115
|
+
})]
|
|
116
|
+
}), /* @__PURE__ */ v(k, {
|
|
117
|
+
primary: {
|
|
118
|
+
label: K ? "Syncing..." : "Sync Now",
|
|
119
|
+
icon: /* @__PURE__ */ v(E, { className: t("size-4", K && "animate-spin") }),
|
|
120
|
+
disabled: K,
|
|
121
|
+
onSelect: () => void Z()
|
|
122
|
+
},
|
|
123
|
+
actions: [{
|
|
124
|
+
label: "Remove",
|
|
125
|
+
icon: /* @__PURE__ */ v(D, { className: "size-4" }),
|
|
126
|
+
intent: "destructive",
|
|
127
|
+
disabled: W,
|
|
128
|
+
onSelect: () => void te()
|
|
129
|
+
}]
|
|
130
|
+
})]
|
|
135
131
|
}),
|
|
136
132
|
children: [/* @__PURE__ */ y("div", {
|
|
137
133
|
className: "space-y-6",
|
|
@@ -161,35 +157,35 @@ function A() {
|
|
|
161
157
|
children: "Sync Direction"
|
|
162
158
|
}), /* @__PURE__ */ v("p", {
|
|
163
159
|
className: "font-semibold text-text-primary capitalize",
|
|
164
|
-
children:
|
|
160
|
+
children: z.syncDirection ?? "bidirectional"
|
|
165
161
|
})] }),
|
|
166
162
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
167
163
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
168
164
|
children: "Status"
|
|
169
165
|
}), /* @__PURE__ */ v(r, {
|
|
170
|
-
variant:
|
|
171
|
-
children:
|
|
166
|
+
variant: z.syncEnabled ? "success" : "outline",
|
|
167
|
+
children: z.syncEnabled ? "Enabled" : "Disabled"
|
|
172
168
|
})] }),
|
|
173
169
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
174
170
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
175
171
|
children: "Sync Interval"
|
|
176
172
|
}), /* @__PURE__ */ y("p", {
|
|
177
173
|
className: "font-semibold text-text-primary",
|
|
178
|
-
children: [
|
|
174
|
+
children: [z.syncIntervalMinutes ?? 0, " minutes"]
|
|
179
175
|
})] }),
|
|
180
176
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
181
177
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
182
178
|
children: "Added On"
|
|
183
179
|
}), /* @__PURE__ */ v("p", {
|
|
184
180
|
className: "font-semibold text-text-primary",
|
|
185
|
-
children: new Date(
|
|
181
|
+
children: new Date(z.createdAt).toLocaleDateString()
|
|
186
182
|
})] }),
|
|
187
|
-
|
|
183
|
+
z.lastSyncAt && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
188
184
|
className: "text-xs font-medium text-text-secondary uppercase tracking-wider mb-1",
|
|
189
185
|
children: "Last Successful Sync"
|
|
190
186
|
}), /* @__PURE__ */ y("div", {
|
|
191
187
|
className: "flex items-center gap-1.5 font-semibold text-text-primary",
|
|
192
|
-
children: [/* @__PURE__ */ v(S, { className: "size-3.5 text-status-success-text" }), new Date(
|
|
188
|
+
children: [/* @__PURE__ */ v(S, { className: "size-3.5 text-status-success-text" }), new Date(z.lastSyncAt).toLocaleString()]
|
|
193
189
|
})] })
|
|
194
190
|
]
|
|
195
191
|
})]
|
|
@@ -206,86 +202,70 @@ function A() {
|
|
|
206
202
|
}), /* @__PURE__ */ y(r, {
|
|
207
203
|
variant: "outline",
|
|
208
204
|
className: "bg-bg-sunken",
|
|
209
|
-
children: [
|
|
205
|
+
children: [H.length, " runs"]
|
|
210
206
|
})]
|
|
211
|
-
}),
|
|
207
|
+
}), V ? /* @__PURE__ */ v("div", {
|
|
212
208
|
className: "flex justify-center py-12",
|
|
213
|
-
children: /* @__PURE__ */ v(
|
|
214
|
-
}) :
|
|
215
|
-
className: "
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
children: e.errorMessage ? /* @__PURE__ */ y("div", {
|
|
270
|
-
className: "flex items-center gap-1.5 text-status-error-text max-w-xs truncate",
|
|
271
|
-
children: [/* @__PURE__ */ v(k, { className: "size-3.5" }), /* @__PURE__ */ v("span", {
|
|
272
|
-
className: "truncate",
|
|
273
|
-
title: e.errorMessage,
|
|
274
|
-
children: e.errorMessage
|
|
275
|
-
})]
|
|
276
|
-
}) : /* @__PURE__ */ v("span", {
|
|
277
|
-
className: "text-text-secondary",
|
|
278
|
-
children: "-"
|
|
279
|
-
})
|
|
280
|
-
})
|
|
281
|
-
]
|
|
282
|
-
}, e.id))
|
|
283
|
-
})]
|
|
284
|
-
})
|
|
209
|
+
children: /* @__PURE__ */ v(T, { className: "size-8 animate-spin text-primary/40" })
|
|
210
|
+
}) : H.length > 0 ? /* @__PURE__ */ v(A, {
|
|
211
|
+
className: "border border-border-subtle/60 rounded-lg",
|
|
212
|
+
data: H,
|
|
213
|
+
rowKey: (e) => e.id,
|
|
214
|
+
columns: [
|
|
215
|
+
{
|
|
216
|
+
key: "time",
|
|
217
|
+
header: "Time",
|
|
218
|
+
priority: "primary",
|
|
219
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
220
|
+
className: "whitespace-nowrap",
|
|
221
|
+
children: new Date(e.startedAt).toLocaleString()
|
|
222
|
+
})
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
key: "status",
|
|
226
|
+
header: "Status",
|
|
227
|
+
cell: (e) => /* @__PURE__ */ v(r, {
|
|
228
|
+
variant: e.status === "COMPLETED" ? "success" : e.status === "FAILED" ? "destructive" : "warning",
|
|
229
|
+
className: "text-[10px] uppercase",
|
|
230
|
+
children: e.status
|
|
231
|
+
})
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
key: "synced",
|
|
235
|
+
header: "Synced",
|
|
236
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
237
|
+
className: "font-medium text-text-primary tabular-nums",
|
|
238
|
+
children: e.secretsSynced
|
|
239
|
+
})
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
key: "duration",
|
|
243
|
+
header: "Duration",
|
|
244
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
245
|
+
className: "text-text-secondary tabular-nums",
|
|
246
|
+
children: e.durationMs ? `${e.durationMs}ms` : "-"
|
|
247
|
+
})
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
key: "errors",
|
|
251
|
+
header: "Errors",
|
|
252
|
+
cell: (e) => e.errorMessage ? /* @__PURE__ */ y("div", {
|
|
253
|
+
className: "flex items-center gap-1.5 text-status-error-text max-w-xs truncate",
|
|
254
|
+
children: [/* @__PURE__ */ v(O, { className: "size-3.5" }), /* @__PURE__ */ v("span", {
|
|
255
|
+
className: "truncate",
|
|
256
|
+
title: e.errorMessage,
|
|
257
|
+
children: e.errorMessage
|
|
258
|
+
})]
|
|
259
|
+
}) : /* @__PURE__ */ v("span", {
|
|
260
|
+
className: "text-text-secondary",
|
|
261
|
+
children: "-"
|
|
262
|
+
})
|
|
263
|
+
}
|
|
264
|
+
]
|
|
285
265
|
}) : /* @__PURE__ */ y("div", {
|
|
286
266
|
className: "text-center py-12 border-2 border-dashed border-border-subtle/40 rounded-xl bg-bg-sunken/10",
|
|
287
267
|
children: [
|
|
288
|
-
/* @__PURE__ */ v(
|
|
268
|
+
/* @__PURE__ */ v(ee, { className: "size-12 text-text-secondary/30 mx-auto mb-3" }),
|
|
289
269
|
/* @__PURE__ */ v("p", {
|
|
290
270
|
className: "text-sm text-text-secondary font-medium",
|
|
291
271
|
children: "No sync logs found."
|
|
@@ -298,17 +278,17 @@ function A() {
|
|
|
298
278
|
})]
|
|
299
279
|
})]
|
|
300
280
|
}), /* @__PURE__ */ v(o, {
|
|
301
|
-
isOpen:
|
|
302
|
-
onClose: () =>
|
|
303
|
-
onConfirm:
|
|
281
|
+
isOpen: q,
|
|
282
|
+
onClose: () => J(!1),
|
|
283
|
+
onConfirm: Q,
|
|
304
284
|
title: "Remove Provider",
|
|
305
285
|
description: `Are you sure you want to remove this ${$.label} connection? Synced secrets will remain but will no longer auto-update.`,
|
|
306
|
-
confirmLabel:
|
|
286
|
+
confirmLabel: W ? "Removing..." : "Remove Provider",
|
|
307
287
|
variant: "destructive"
|
|
308
288
|
})]
|
|
309
289
|
});
|
|
310
290
|
}
|
|
311
291
|
//#endregion
|
|
312
|
-
export {
|
|
292
|
+
export { j as ProviderDetailPage };
|
|
313
293
|
|
|
314
294
|
//# sourceMappingURL=ProviderDetailPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderDetailPage.js","names":[],"sources":["../../../src/security/pages/ProviderDetailPage.tsx"],"sourcesContent":["import { useParams, useNavigate } from 'react-router-dom';\nimport {\n ArrowLeft,\n RefreshCw,\n Trash2,\n Cloud,\n Loader2,\n AlertTriangle,\n CheckCircle,\n Clock,\n XCircle,\n Info,\n} from 'lucide-react';\nimport { PageLayout } from '../components/PageLayout';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { Button, Card, Badge } from '../components/ui';\nimport {\n useVaultIntegrations,\n useDeleteIntegration,\n useTriggerSync,\n useVaultSyncLogs,\n} from '../hooks/useProviderQueries';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { getProviderTypeInfo } from '../constants/providers';\nimport { useState } from 'react';\nimport { cn } from '../utils/cn';\nimport type { ProviderType } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\n\nexport function ProviderDetailPage() {\n const { vaultId, providerId } = useParams<{ vaultId: string; providerId: string }>();\n const { basePath = '/', navigate: shellNavigate } = useSecurity();\n const routerNavigate = useNavigate();\n\n const { data, loading, error } = useVaultIntegrations(vaultId);\n const providers = data?.getVaultIntegrations?.items ?? [];\n const provider = providers.find((p: any) => p.id === providerId);\n\n const { data: logsData, loading: logsLoading } = useVaultSyncLogs(providerId);\n const syncLogs = logsData?.getVaultSyncLogs?.items ?? [];\n\n const [deleteProvider, { loading: deleting }] = useDeleteIntegration();\n const [triggerSync, { loading: syncing }] = useTriggerSync();\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n\n const handleNavigate = (path: string) => {\n if (shellNavigate) {\n shellNavigate(path);\n } else {\n routerNavigate(path);\n }\n };\n\n const handleBack = () => handleNavigate(`${basePath}/providers`);\n\n const handleSync = async () => {\n if (!providerId) return;\n try {\n await triggerSync({ variables: { integrationId: providerId } });\n } catch (err) {\n console.error('Sync failed:', err);\n }\n };\n\n const handleDelete = async () => {\n if (!providerId) return;\n try {\n await deleteProvider({ variables: { id: providerId } });\n void nativeNotify('success');\n handleBack();\n } catch (err) {\n console.error('Delete failed:', err);\n void nativeNotify('error');\n }\n };\n\n const requestDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: 'Delete Provider',\n message: 'Delete this provider? 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 if (loading && !provider) {\n return (\n <PageLayout\n title=\"Loading...\"\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\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 || (!loading && !provider)) {\n return (\n <PageLayout\n title=\"Error\"\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\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\">Provider not found</h3>\n <p className=\"text-sm text-text-secondary mt-1\">\n {error?.message ?? 'The requested provider could not be found.'}\n </p>\n <Button variant=\"outline\" size=\"sm\" className=\"mt-4\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n Back to Providers\n </Button>\n </div>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n const typeInfo = getProviderTypeInfo(provider.providerType as ProviderType);\n\n return (\n <PageLayout\n title={(provider.displayName as string) || typeInfo.label}\n description={typeInfo.description}\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\n { label: (provider.displayName as string) || typeInfo.label },\n ]}\n actions={\n <div className=\"flex items-center gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n <span className=\"hidden sm:inline\">Back</span>\n </Button>\n <Button variant=\"outline\" size=\"sm\" onClick={handleSync} disabled={syncing}>\n <RefreshCw className={cn('size-4', syncing && 'animate-spin')} />\n {syncing ? 'Syncing...' : 'Sync Now'}\n </Button>\n <Button\n variant=\"destructive\"\n size=\"sm\"\n onClick={() => void requestDelete()}\n disabled={deleting}\n >\n <Trash2 className=\"size-4\" />\n <span className=\"hidden sm:inline\">Remove</span>\n </Button>\n </div>\n }\n >\n <div className=\"space-y-6\">\n {/* Configuration */}\n <Card className=\"p-6\">\n <div className=\"flex items-center gap-2 mb-6\">\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10 text-primary\">\n <Cloud className=\"size-5\" />\n </div>\n <h2 className=\"text-lg font-bold text-text-primary\">Integration Settings</h2>\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 text-sm\">\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Provider Type\n </p>\n <p className=\"font-semibold text-text-primary\">{typeInfo.label}</p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Sync Direction\n </p>\n <p className=\"font-semibold text-text-primary capitalize\">\n {(provider.syncDirection as string) ?? 'bidirectional'}\n </p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Status\n </p>\n <Badge variant={provider.syncEnabled ? 'success' : 'outline'}>\n {provider.syncEnabled ? 'Enabled' : 'Disabled'}\n </Badge>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Sync Interval\n </p>\n <p className=\"font-semibold text-text-primary\">\n {(provider.syncIntervalMinutes as number) ?? 0} minutes\n </p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Added On\n </p>\n <p className=\"font-semibold text-text-primary\">\n {new Date(provider.createdAt as string).toLocaleDateString()}\n </p>\n </div>\n {provider.lastSyncAt && (\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Last Successful Sync\n </p>\n <div className=\"flex items-center gap-1.5 font-semibold text-text-primary\">\n <CheckCircle className=\"size-3.5 text-status-success-text\" />\n {new Date(provider.lastSyncAt as string).toLocaleString()}\n </div>\n </div>\n )}\n </div>\n </Card>\n\n {/* Sync History */}\n <Card className=\"p-6 shadow-sm border-border-subtle/60\">\n <div className=\"flex items-center justify-between mb-6\">\n <div className=\"flex items-center gap-2\">\n <Clock className=\"size-5 text-primary\" />\n <h2 className=\"text-lg font-bold text-text-primary\">Sync History</h2>\n </div>\n <Badge variant=\"outline\" className=\"bg-bg-sunken\">\n {syncLogs.length} runs\n </Badge>\n </div>\n\n {logsLoading ? (\n <div className=\"flex justify-center py-12\">\n <Loader2 className=\"size-8 animate-spin text-primary/40\" />\n </div>\n ) : syncLogs.length > 0 ? (\n <div className=\"overflow-x-auto border border-border-subtle/60 rounded-lg\">\n <table className=\"w-full text-sm\">\n <thead>\n <tr className=\"bg-bg-sunken/30 border-b border-border-subtle\">\n <th className=\"text-left py-3 px-4 font-semibold text-text-secondary\">\n Time\n </th>\n <th className=\"text-left py-3 px-4 font-semibold text-text-secondary\">\n Status\n </th>\n <th className=\"text-left py-3 px-4 font-semibold text-text-secondary\">\n Synced\n </th>\n <th className=\"text-left py-3 px-4 font-semibold text-text-secondary\">\n Duration\n </th>\n <th className=\"text-left py-3 px-4 font-semibold text-text-secondary\">\n Errors\n </th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border/40\">\n {syncLogs.map((log: any) => (\n <tr key={log.id} className=\"hover:bg-bg-sunken/20 transition-colors\">\n <td className=\"py-3 px-4 whitespace-nowrap\">\n {new Date(log.startedAt).toLocaleString()}\n </td>\n <td className=\"py-3 px-4\">\n <Badge\n variant={\n log.status === 'COMPLETED'\n ? 'success'\n : log.status === 'FAILED'\n ? 'destructive'\n : 'warning'\n }\n className=\"text-[10px] uppercase\"\n >\n {log.status}\n </Badge>\n </td>\n <td className=\"py-3 px-4 font-medium text-text-primary\">{log.secretsSynced}</td>\n <td className=\"py-3 px-4 text-text-secondary\">\n {log.durationMs ? `${log.durationMs}ms` : '-'}\n </td>\n <td className=\"py-3 px-4\">\n {log.errorMessage ? (\n <div className=\"flex items-center gap-1.5 text-status-error-text max-w-xs truncate\">\n <XCircle className=\"size-3.5\" />\n <span className=\"truncate\" title={log.errorMessage}>\n {log.errorMessage}\n </span>\n </div>\n ) : (\n <span className=\"text-text-secondary\">-</span>\n )}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n ) : (\n <div className=\"text-center py-12 border-2 border-dashed border-border-subtle/40 rounded-xl bg-bg-sunken/10\">\n <Info className=\"size-12 text-text-secondary/30 mx-auto mb-3\" />\n <p className=\"text-sm text-text-secondary font-medium\">No sync logs found.</p>\n <p className=\"text-xs text-text-secondary mt-1\">\n Sync history will appear here after the first synchronization run.\n </p>\n </div>\n )}\n </Card>\n </div>\n\n <ConfirmDialog\n isOpen={showDeleteConfirm}\n onClose={() => setShowDeleteConfirm(false)}\n onConfirm={handleDelete}\n title=\"Remove Provider\"\n description={`Are you sure you want to remove this ${typeInfo.label} connection? Synced secrets will remain but will no longer auto-update.`}\n confirmLabel={deleting ? 'Removing...' : 'Remove Provider'}\n variant=\"destructive\"\n />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA6BA,SAAgB,IAAqB;CACnC,IAAM,EAAE,YAAS,kBAAe,GAAoD,EAC9E,EAAE,cAAW,KAAK,UAAU,MAAkB,GAAa,EAC3D,IAAiB,GAAa,EAE9B,EAAE,SAAM,YAAS,aAAU,EAAqB,EAAQ,EAExD,KADY,GAAM,sBAAsB,SAAS,EAAE,EAC9B,MAAM,MAAW,EAAE,OAAO,EAAW,EAE1D,EAAE,MAAM,GAAU,SAAS,MAAgB,EAAiB,EAAW,EACvE,IAAW,GAAU,kBAAkB,SAAS,EAAE,EAElD,CAAC,GAAgB,EAAE,SAAS,OAAc,GAAsB,EAChE,CAAC,GAAa,EAAE,SAAS,OAAa,GAAgB,EACtD,CAAC,GAAmB,KAAwB,EAAS,GAAM,EAE3D,KAAkB,MAAiB;AACvC,EAAI,IACF,EAAc,EAAK,GAEnB,EAAe,EAAK;IAIlB,UAAmB,EAAe,GAAG,EAAS,YAAY,EAE1D,IAAa,YAAY;AACxB,QACL,KAAI;AACF,SAAM,EAAY,EAAE,WAAW,EAAE,eAAe,GAAY,EAAE,CAAC;WACxD,GAAK;AACZ,WAAQ,MAAM,gBAAgB,EAAI;;IAIhC,IAAe,YAAY;AAC1B,QACL,KAAI;AAG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W,OAAO,EAAI;sBACnC,EAAI;YACA,CAAA,CACH;eAEN,kBAAC,QAAD;WAAM,WAAU;qBAAsB;WAAQ,CAAA;UAE7C,CAAA;SACF;UAlCI,EAAI,GAkCR,CACL;OACI,CAAA,CACF;;KACJ,CAAA,GAEN,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,GAAD,EAAM,WAAU,+CAAgD,CAAA;MAChE,kBAAC,KAAD;OAAG,WAAU;iBAA0C;OAAuB,CAAA;MAC9E,kBAAC,KAAD;OAAG,WAAU;iBAAmC;OAE5C,CAAA;MACA;OAEH;MACH;MAEN,kBAAC,GAAD;GACE,QAAQ;GACR,eAAe,EAAqB,GAAM;GAC1C,WAAW;GACX,OAAM;GACN,aAAa,wCAAwC,EAAS,MAAM;GACpE,cAAc,IAAW,gBAAgB;GACzC,SAAQ;GACR,CAAA,CACS"}
|
|
1
|
+
{"version":3,"file":"ProviderDetailPage.js","names":[],"sources":["../../../src/security/pages/ProviderDetailPage.tsx"],"sourcesContent":["import { useParams, useNavigate } from 'react-router-dom';\nimport {\n ArrowLeft,\n RefreshCw,\n Trash2,\n Cloud,\n Loader2,\n AlertTriangle,\n CheckCircle,\n Clock,\n XCircle,\n Info,\n} from 'lucide-react';\nimport {\n ResponsiveTable,\n type ResponsiveTableColumn,\n GlassCard,\n CTAOverflowMenu,\n} from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { Button, Card, Badge } from '../components/ui';\nimport {\n useVaultIntegrations,\n useDeleteIntegration,\n useTriggerSync,\n useVaultSyncLogs,\n} from '../hooks/useProviderQueries';\nimport { useSecurity } from '../providers/SecurityProvider';\nimport { getProviderTypeInfo } from '../constants/providers';\nimport { useState } from 'react';\nimport { cn } from '../utils/cn';\nimport type { ProviderType } from '../types';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\n\nexport function ProviderDetailPage() {\n const { vaultId, providerId } = useParams<{ vaultId: string; providerId: string }>();\n const { basePath = '/', navigate: shellNavigate } = useSecurity();\n const routerNavigate = useNavigate();\n\n const { data, loading, error } = useVaultIntegrations(vaultId);\n const providers = data?.getVaultIntegrations?.items ?? [];\n const provider = providers.find((p: any) => p.id === providerId);\n\n const { data: logsData, loading: logsLoading } = useVaultSyncLogs(providerId);\n const syncLogs = logsData?.getVaultSyncLogs?.items ?? [];\n\n const [deleteProvider, { loading: deleting }] = useDeleteIntegration();\n const [triggerSync, { loading: syncing }] = useTriggerSync();\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\n\n const handleNavigate = (path: string) => {\n if (shellNavigate) {\n shellNavigate(path);\n } else {\n routerNavigate(path);\n }\n };\n\n const handleBack = () => handleNavigate(`${basePath}/providers`);\n\n const handleSync = async () => {\n if (!providerId) return;\n try {\n await triggerSync({ variables: { integrationId: providerId } });\n } catch (err) {\n console.error('Sync failed:', err);\n }\n };\n\n const handleDelete = async () => {\n if (!providerId) return;\n try {\n await deleteProvider({ variables: { id: providerId } });\n void nativeNotify('success');\n handleBack();\n } catch (err) {\n console.error('Delete failed:', err);\n void nativeNotify('error');\n }\n };\n\n const requestDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: 'Delete Provider',\n message: 'Delete this provider? 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 if (loading && !provider) {\n return (\n <PageLayout\n title=\"Loading...\"\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\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 || (!loading && !provider)) {\n return (\n <PageLayout\n title=\"Error\"\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\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\">Provider not found</h3>\n <p className=\"text-sm text-text-secondary mt-1\">\n {error?.message ?? 'The requested provider could not be found.'}\n </p>\n <Button variant=\"outline\" size=\"sm\" className=\"mt-4\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n Back to Providers\n </Button>\n </div>\n </div>\n </Card>\n </PageLayout>\n );\n }\n\n const typeInfo = getProviderTypeInfo(provider.providerType as ProviderType);\n\n return (\n <PageLayout\n title={(provider.displayName as string) || typeInfo.label}\n description={typeInfo.description}\n breadcrumbs={[\n { label: 'Security', path: basePath },\n { label: 'Providers', path: `${basePath}/providers` },\n { label: (provider.displayName as string) || typeInfo.label },\n ]}\n actions={\n // Boff UI 2.0: quiet \"Back\", a single primary CTA (\"Sync Now\"), and the\n // destructive \"Remove\" tucked into the overflow menu.\n <div className=\"flex items-center gap-2\">\n <Button variant=\"outline\" size=\"sm\" onClick={handleBack}>\n <ArrowLeft className=\"size-4\" />\n <span className=\"hidden sm:inline\">Back</span>\n </Button>\n <CTAOverflowMenu\n primary={{\n label: syncing ? 'Syncing...' : 'Sync Now',\n icon: <RefreshCw className={cn('size-4', syncing && 'animate-spin')} />,\n disabled: syncing,\n onSelect: () => void handleSync(),\n }}\n actions={[\n {\n label: 'Remove',\n icon: <Trash2 className=\"size-4\" />,\n intent: 'destructive',\n disabled: deleting,\n onSelect: () => void requestDelete(),\n },\n ]}\n />\n </div>\n }\n >\n <div className=\"space-y-6\">\n {/* Configuration */}\n <Card className=\"p-6\">\n <div className=\"flex items-center gap-2 mb-6\">\n <div className=\"p-2 rounded-lg bg-action-primary-bg/10 text-primary\">\n <Cloud className=\"size-5\" />\n </div>\n <h2 className=\"text-lg font-bold text-text-primary\">Integration Settings</h2>\n </div>\n\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 text-sm\">\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Provider Type\n </p>\n <p className=\"font-semibold text-text-primary\">{typeInfo.label}</p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Sync Direction\n </p>\n <p className=\"font-semibold text-text-primary capitalize\">\n {(provider.syncDirection as string) ?? 'bidirectional'}\n </p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Status\n </p>\n <Badge variant={provider.syncEnabled ? 'success' : 'outline'}>\n {provider.syncEnabled ? 'Enabled' : 'Disabled'}\n </Badge>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Sync Interval\n </p>\n <p className=\"font-semibold text-text-primary\">\n {(provider.syncIntervalMinutes as number) ?? 0} minutes\n </p>\n </div>\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Added On\n </p>\n <p className=\"font-semibold text-text-primary\">\n {new Date(provider.createdAt as string).toLocaleDateString()}\n </p>\n </div>\n {provider.lastSyncAt && (\n <div>\n <p className=\"text-xs font-medium text-text-secondary uppercase tracking-wider mb-1\">\n Last Successful Sync\n </p>\n <div className=\"flex items-center gap-1.5 font-semibold text-text-primary\">\n <CheckCircle className=\"size-3.5 text-status-success-text\" />\n {new Date(provider.lastSyncAt as string).toLocaleString()}\n </div>\n </div>\n )}\n </div>\n </Card>\n\n {/* Sync History */}\n <Card className=\"p-6 shadow-sm border-border-subtle/60\">\n <div className=\"flex items-center justify-between mb-6\">\n <div className=\"flex items-center gap-2\">\n <Clock className=\"size-5 text-primary\" />\n <h2 className=\"text-lg font-bold text-text-primary\">Sync History</h2>\n </div>\n <Badge variant=\"outline\" className=\"bg-bg-sunken\">\n {syncLogs.length} runs\n </Badge>\n </div>\n\n {logsLoading ? (\n <div className=\"flex justify-center py-12\">\n <Loader2 className=\"size-8 animate-spin text-primary/40\" />\n </div>\n ) : syncLogs.length > 0 ? (\n <ResponsiveTable<any>\n className=\"border border-border-subtle/60 rounded-lg\"\n data={syncLogs}\n rowKey={(log) => log.id}\n columns={\n [\n {\n key: 'time',\n header: 'Time',\n priority: 'primary',\n cell: (log) => (\n <span className=\"whitespace-nowrap\">\n {new Date(log.startedAt).toLocaleString()}\n </span>\n ),\n },\n {\n key: 'status',\n header: 'Status',\n cell: (log) => (\n <Badge\n variant={\n log.status === 'COMPLETED'\n ? 'success'\n : log.status === 'FAILED'\n ? 'destructive'\n : 'warning'\n }\n className=\"text-[10px] uppercase\"\n >\n {log.status}\n </Badge>\n ),\n },\n {\n key: 'synced',\n header: 'Synced',\n cell: (log) => (\n <span className=\"font-medium text-text-primary tabular-nums\">\n {log.secretsSynced}\n </span>\n ),\n },\n {\n key: 'duration',\n header: 'Duration',\n cell: (log) => (\n <span className=\"text-text-secondary tabular-nums\">\n {log.durationMs ? `${log.durationMs}ms` : '-'}\n </span>\n ),\n },\n {\n key: 'errors',\n header: 'Errors',\n cell: (log) =>\n log.errorMessage ? (\n <div className=\"flex items-center gap-1.5 text-status-error-text max-w-xs truncate\">\n <XCircle className=\"size-3.5\" />\n <span className=\"truncate\" title={log.errorMessage}>\n {log.errorMessage}\n </span>\n </div>\n ) : (\n <span className=\"text-text-secondary\">-</span>\n ),\n },\n ] satisfies ResponsiveTableColumn<any>[]\n }\n />\n ) : (\n <div className=\"text-center py-12 border-2 border-dashed border-border-subtle/40 rounded-xl bg-bg-sunken/10\">\n <Info className=\"size-12 text-text-secondary/30 mx-auto mb-3\" />\n <p className=\"text-sm text-text-secondary font-medium\">No sync logs found.</p>\n <p className=\"text-xs text-text-secondary mt-1\">\n Sync history will appear here after the first synchronization run.\n </p>\n </div>\n )}\n </Card>\n </div>\n\n <ConfirmDialog\n isOpen={showDeleteConfirm}\n onClose={() => setShowDeleteConfirm(false)}\n onConfirm={handleDelete}\n title=\"Remove Provider\"\n description={`Are you sure you want to remove this ${typeInfo.label} connection? Synced secrets will remain but will no longer auto-update.`}\n confirmLabel={deleting ? 'Removing...' : 'Remove Provider'}\n variant=\"destructive\"\n />\n </PageLayout>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmCA,SAAgB,IAAqB;CACnC,IAAM,EAAE,YAAS,kBAAe,GAAoD,EAC9E,EAAE,cAAW,KAAK,UAAU,MAAkB,GAAa,EAC3D,IAAiB,GAAa,EAE9B,EAAE,SAAM,YAAS,aAAU,EAAqB,EAAQ,EAExD,KADY,GAAM,sBAAsB,SAAS,EAAE,EAC9B,MAAM,MAAW,EAAE,OAAO,EAAW,EAE1D,EAAE,MAAM,GAAU,SAAS,MAAgB,EAAiB,EAAW,EACvE,IAAW,GAAU,kBAAkB,SAAS,EAAE,EAElD,CAAC,GAAgB,EAAE,SAAS,OAAc,GAAsB,EAChE,CAAC,GAAa,EAAE,SAAS,OAAa,GAAgB,EACtD,CAAC,GAAmB,KAAwB,EAAS,GAAM,EAE3D,KAAkB,MAAiB;AACvC,EAAI,IACF,EAAc,EAAK,GAEnB,EAAe,EAAK;IAIlB,UAAmB,EAAe,GAAG,EAAS,YAAY,EAE1D,IAAa,YAAY;AACxB,QACL,KAAI;AACF,SAAM,EAAY,EAAE,WAAW,EAAE,eAAe,GAAY,EAAE,CAAC;WACxD,GAAK;AACZ,WAAQ,MAAM,gBAAgB,EAAI;;IAIhC,IAAe,YAAY;AAC1B,QACL,KAAI;AAGF,GAFA,MAAM,EAAe,EAAE,WAAW,EAAE,IAAI,GAAY,EAAE,CAAC,EAClD,EAAa,UAAU,EAC5B,GAAY;WACL,GAAK;AAEP,GADL,QAAQ,MAAM,kBAAkB,EAAI,EAC/B,EAAa,QAAQ;;IAIxB,KAAgB,YAAY;AAC3B,IAAa,SAAS;EAC3B,IAAM,IAAS,MAAM,EAAc;GACjC,OAAO;GACP,SAAS;GACT,eAAe;GACf,mBAAmB;GACpB,CAAC;AACF,MAAI,MAAW,MAAM;AACnB,KAAqB,GAAK;AAC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