@burdenoff/fe-libs 2026.1114.1 → 2026.1114.2

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.
@@ -1,35 +1,39 @@
1
- import { GET_ADMIN_OVERVIEW_CONTEXT as e, GET_MY_PROJECTS_DOC as t } from "./operations.js";
2
- import { buildHierarchyGraph as n } from "./buildHierarchyGraph.js";
3
- import { useShellNavigate as r } from "../shared/utils/appHelpers.js";
4
- import { AdminOverviewActionsProvider as i } from "./AdminOverviewActionsContext.js";
5
- import { OrganizationNode as a } from "./nodes/OrganizationNode.js";
6
- import { WorkspaceNode as o } from "./nodes/WorkspaceNode.js";
7
- import { TenantNode as s } from "./nodes/TenantNode.js";
8
- import { ProjectNode as c } from "./nodes/ProjectNode.js";
1
+ import { GET_ADMIN_OVERVIEW_CONTEXT as e, GET_ADMIN_OVERVIEW_CONTEXT_WITH_COUNTS as t, GET_MY_PROJECTS_DOC as n } from "./operations.js";
2
+ import { buildHierarchyGraph as r } from "./buildHierarchyGraph.js";
3
+ import { useShellNavigate as i } from "../shared/utils/appHelpers.js";
4
+ import { AdminOverviewActionsProvider as a } from "./AdminOverviewActionsContext.js";
5
+ import { OrganizationNode as o } from "./nodes/OrganizationNode.js";
6
+ import { WorkspaceNode as s } from "./nodes/WorkspaceNode.js";
7
+ import { TenantNode as c } from "./nodes/TenantNode.js";
8
+ import { ProjectNode as l } from "./nodes/ProjectNode.js";
9
+ import { AdminOverviewList as u } from "./AdminOverviewList.js";
10
+ import { summarizeOverview as ee, technicalDetailsText as te } from "./adminOverviewModel.js";
11
+ import { PageTabs as d } from "../ui/page-tabs.js";
9
12
  import "../shared-utils.js";
10
- import { graphqlFetch as l } from "../shared/graphql/fetch.js";
11
- import { useI18n as u } from "../shared/providers/shell/I18nProvider.js";
12
- import { impactFeedback as d, notificationFeedback as ee, selectionFeedback as te } from "../shell-native/feedback.js";
13
- import { showNativeToast as ne } from "../shell-native/toast.js";
13
+ import { graphqlFetch as f } from "../shared/graphql/fetch.js";
14
+ import { useI18n as p } from "../shared/providers/shell/I18nProvider.js";
15
+ import { impactFeedback as m, notificationFeedback as ne, selectionFeedback as re } from "../shell-native/feedback.js";
16
+ import { showNativeToast as ie } from "../shell-native/toast.js";
14
17
  import "../shell-native.js";
15
- import { useCallback as f, useEffect as p, useMemo as m, useReducer as re, useRef as ie, useState as h } from "react";
16
- import { AlertCircle as g, Building as _, Building2 as v, Download as y, Layers as b, LayoutGrid as x, Network as S, Package as C, RefreshCcw as w } from "lucide-react";
17
- import { Fragment as ae, jsx as T, jsxs as E } from "react/jsx-runtime";
18
- import { useQuery as D } from "@apollo/client/react";
19
- import { Background as O, BackgroundVariant as k, Controls as A, MiniMap as j, Panel as M, ReactFlow as N, ReactFlowProvider as P, applyEdgeChanges as F, applyNodeChanges as I, useReactFlow as L } from "@xyflow/react";
18
+ import { useCallback as h, useEffect as g, useMemo as _, useReducer as ae, useRef as oe, useState as v } from "react";
19
+ import { AlertCircle as y, Building as b, Building2 as x, Download as se, Layers as S, LayoutGrid as C, Network as w, Package as T, RefreshCcw as E } from "lucide-react";
20
+ import { Fragment as ce, jsx as D, jsxs as O } from "react/jsx-runtime";
21
+ import { useLocation as k } from "react-router";
22
+ import { useQuery as le } from "@apollo/client/react";
23
+ import { Background as A, BackgroundVariant as j, Controls as M, MiniMap as N, Panel as P, ReactFlow as F, ReactFlowProvider as I, applyEdgeChanges as ue, applyNodeChanges as de, useReactFlow as fe } from "@xyflow/react";
20
24
  import "@xyflow/react/dist/style.css";
21
25
  // src/admin-overview/AdminOverviewPage.tsx
22
- var R = {
23
- organization: a,
24
- workspace: o,
25
- tenant: s,
26
- project: c
27
- }, z = {
26
+ var L = "graph", R = {
27
+ organization: o,
28
+ workspace: s,
29
+ tenant: c,
30
+ project: l
31
+ }, pe = {
28
32
  byWorkspace: {},
29
33
  loadingFor: /* @__PURE__ */ new Set(),
30
34
  error: null
31
35
  };
32
- function B(e, t) {
36
+ function me(e, t) {
33
37
  switch (t.type) {
34
38
  case "loadStart": {
35
39
  let n = new Set(e.loadingFor);
@@ -66,124 +70,124 @@ function B(e, t) {
66
70
  default: return e;
67
71
  }
68
72
  }
69
- function V(e) {
70
- return /* @__PURE__ */ T(P, { children: /* @__PURE__ */ T(H, { ...e }) });
73
+ function z(e) {
74
+ return /* @__PURE__ */ D(I, { children: /* @__PURE__ */ D(B, { ...e }) });
71
75
  }
72
- function H({ authToken: i }) {
73
- let a = r(), { fitView: o } = L(), { t: s } = u(), c = f((e, t) => {
74
- let n = s(e);
76
+ function B({ authToken: a, variant: o = "default" }) {
77
+ let s = o === "fluidgrids", c = i(), { fitView: l } = fe(), { t: d } = p(), y = h((e, t) => {
78
+ let n = d(e);
75
79
  return n === e ? t : n;
76
- }, [s]), g = D(e, {
80
+ }, [d]), b = le(s ? t : e, {
77
81
  variables: {
78
82
  limit: 100,
79
83
  offset: 0
80
84
  },
81
85
  fetchPolicy: "cache-and-network"
82
- }), _ = m(() => !!(g.data?.myOrganizations?.hasMore || g.data?.myWorkspaces?.hasMore || g.data?.myTenants?.hasMore), [g.data]), [v, y] = re(B, z), { byWorkspace: b, loadingFor: x, error: S } = v, [C, w] = h(null), O = m(() => g.data?.myOrganizations?.items ?? [], [g.data]), k = m(() => g.data?.myWorkspaces?.items ?? [], [g.data]), A = m(() => g.data?.myTenants?.items ?? [], [g.data]), j = ie({}), M = f(async (e) => {
83
- y({
86
+ }), x = _(() => !!(b.data?.myOrganizations?.hasMore || b.data?.myWorkspaces?.hasMore || b.data?.myTenants?.hasMore), [b.data]), [se, S] = ae(me, pe), { byWorkspace: C, loadingFor: w, error: T } = se, [E, k] = v(null), A = _(() => b.data?.myOrganizations?.items ?? [], [b.data]), j = _(() => b.data?.myWorkspaces?.items ?? [], [b.data]), M = _(() => b.data?.myTenants?.items ?? [], [b.data]), N = oe({}), P = h(async (e) => {
87
+ S({
84
88
  type: "loadStart",
85
89
  workspaceId: e
86
90
  });
87
91
  try {
88
- let n = k.find((t) => t.id === e);
89
- if (!n) throw Error("Workspace not found in current context");
90
- let r = n.organizationId ?? n.tenantId;
92
+ let t = j.find((t) => t.id === e);
93
+ if (!t) throw Error("Workspace not found in current context");
94
+ let r = t.organizationId ?? t.tenantId;
91
95
  if (!r) throw Error("Workspace is missing organization/tenant context and cannot be scoped");
92
- let a = j.current[e];
93
- if (!a) {
94
- let t = await l({
96
+ let i = N.current[e];
97
+ if (!i) {
98
+ let t = await f({
95
99
  gateway: "workspace",
96
100
  query: "mutation AdminOverviewIssueWorkspaceToken($input: IssueWorkspaceTokenInput!) {\n issueWorkspaceToken(input: $input) { success token }\n }",
97
101
  variables: { input: {
98
102
  organizationId: r,
99
103
  workspaceId: e
100
104
  } },
101
- authToken: i
105
+ authToken: a
102
106
  });
103
107
  if (t.errors && t.errors.length > 0) throw Error(`Token issue failed: ${t.errors.map((e) => e.message).join("; ")}`);
104
108
  let n = t.data?.issueWorkspaceToken;
105
109
  if (!n?.success || !n.token) throw Error("Could not issue workspace token");
106
- a = n.token, j.current[e] = a;
110
+ i = n.token, N.current[e] = i;
107
111
  }
108
- let o = await l({
112
+ let o = await f({
109
113
  gateway: "workspace",
110
- query: t,
114
+ query: n,
111
115
  variables: { pagination: { limit: 100 } },
112
- authToken: i,
113
- workspaceToken: a,
116
+ authToken: a,
117
+ workspaceToken: i,
114
118
  workspaceId: e,
115
119
  organizationId: r
116
120
  });
117
- if (o.errors && o.errors.length > 0) throw o.errors.some((e) => e.extensions?.code === "TOKEN_EXPIRED") && delete j.current[e], Error(o.errors.map((e) => e.message).join("; "));
121
+ if (o.errors && o.errors.length > 0) throw o.errors.some((e) => e.extensions?.code === "TOKEN_EXPIRED") && delete N.current[e], Error(o.errors.map((e) => e.message).join("; "));
118
122
  let s = o.data?.myProjects?.items ?? [];
119
- y({
123
+ S({
120
124
  type: "loadSuccess",
121
125
  workspaceId: e,
122
126
  projects: s
123
127
  });
124
128
  } catch (t) {
125
129
  let n = t instanceof Error ? t.message : String(t);
126
- y({
130
+ S({
127
131
  type: "loadFailure",
128
132
  workspaceId: e,
129
133
  error: `Failed to load projects: ${n}`
130
- }), ee("error"), ne(c("adminOverviewPage.errorLoadProjects", "Failed to load projects"), "long");
134
+ }), ne("error"), ie(y("adminOverviewPage.errorLoadProjects", "Failed to load projects"), "long");
131
135
  }
132
136
  }, [
133
- i,
134
- k,
135
- c
136
- ]), N = f((e) => {
137
- d("light"), a(`/workspaces/${e}`);
138
- }, [a]), P = f(() => {
139
- d("light"), g.refetch(), y({ type: "reset" }), w(null), j.current = {};
140
- }, [g]), R = f(() => {
141
- d("medium"), k.forEach((e) => {
142
- !b[e.id] && !x.has(e.id) && M(e.id);
137
+ a,
138
+ j,
139
+ y
140
+ ]), F = h((e) => {
141
+ m("light"), c(`/workspaces/${e}`);
142
+ }, [c]), I = h(() => {
143
+ m("light"), b.refetch(), S({ type: "reset" }), k(null), N.current = {};
144
+ }, [b]), L = h(() => {
145
+ m("medium"), j.forEach((e) => {
146
+ !C[e.id] && !w.has(e.id) && P(e.id);
143
147
  });
144
148
  }, [
145
- k,
146
- b,
147
- x,
148
- M
149
- ]), V = f((e, t) => {
150
- te(), w(t.id);
151
- }, []), { nodes: H, edges: W } = m(() => n({
152
- organizations: O,
153
- workspaces: k,
154
- tenants: A,
155
- projectsByWorkspace: b,
156
- loadingProjectsFor: x,
157
- selectedId: C
149
+ j,
150
+ C,
151
+ w,
152
+ P
153
+ ]), R = h((e, t) => {
154
+ re(), k(t.id);
155
+ }, []), { nodes: z, edges: B } = _(() => r({
156
+ organizations: A,
157
+ workspaces: j,
158
+ tenants: M,
159
+ projectsByWorkspace: C,
160
+ loadingProjectsFor: w,
161
+ selectedId: E
158
162
  }), [
159
- O,
160
- k,
161
163
  A,
162
- b,
163
- x,
164
- C
165
- ]), G = m(() => ({
166
- onLoadProjects: M,
167
- onManageWorkspace: N
168
- }), [M, N]), [K, q] = h(H), [Y, X] = h(W);
169
- p(() => {
170
- queueMicrotask(() => q(H));
171
- }, [H]), p(() => {
172
- queueMicrotask(() => X(W));
173
- }, [W]);
174
- let ce = f((e) => q((t) => I(e, t)), []), le = f((e) => X((t) => F(e, t)), []), ue = Object.keys(b).length, Z = H.length;
175
- p(() => {
176
- if (Z === 0) return;
164
+ j,
165
+ M,
166
+ C,
167
+ w,
168
+ E
169
+ ]), W = _(() => ({
170
+ onLoadProjects: P,
171
+ onManageWorkspace: F
172
+ }), [P, F]), [G, K] = v(z), [q, Y] = v(B);
173
+ g(() => {
174
+ queueMicrotask(() => K(z));
175
+ }, [z]), g(() => {
176
+ queueMicrotask(() => Y(B));
177
+ }, [B]);
178
+ let ge = h((e) => K((t) => de(e, t)), []), _e = h((e) => Y((t) => ue(e, t)), []), ve = Object.keys(C).length, X = z.length;
179
+ g(() => {
180
+ if (X === 0) return;
177
181
  let e = 0, t = window.requestAnimationFrame(() => {
178
182
  e = window.requestAnimationFrame(() => {
179
- o({
183
+ l({
180
184
  padding: .2,
181
185
  duration: 500,
182
186
  includeHiddenNodes: !1
183
187
  });
184
188
  });
185
189
  }), n = window.setTimeout(() => {
186
- o({
190
+ l({
187
191
  padding: .2,
188
192
  duration: 500,
189
193
  includeHiddenNodes: !1
@@ -193,89 +197,132 @@ function H({ authToken: i }) {
193
197
  window.cancelAnimationFrame(t), e && window.cancelAnimationFrame(e), window.clearTimeout(n);
194
198
  };
195
199
  }, [
196
- o,
197
- Z,
198
- ue
200
+ l,
201
+ X,
202
+ ve
203
+ ]);
204
+ let Z = b.loading && !b.data, Q = b.error?.message || T, ye = _(() => Object.values(C).reduce((e, t) => e + (t?.length ?? 0), 0), [C]), $ = !Z && A.length === 0 && j.length === 0 && M.length === 0, be = h(() => k(null), []), xe = _(() => ee(A, j), [A, j]), Se = _(() => te(M, A, j), [
205
+ M,
206
+ A,
207
+ j
199
208
  ]);
200
- let Q = g.loading && !g.data, $ = g.error?.message || S, de = m(() => Object.values(b).reduce((e, t) => e + (t?.length ?? 0), 0), [b]), fe = !Q && O.length === 0 && k.length === 0 && A.length === 0, pe = f(() => w(null), []);
201
- return /* @__PURE__ */ T("div", {
209
+ return s ? /* @__PURE__ */ D(he, {
210
+ tr: y,
211
+ isInitialLoading: Z,
212
+ isEmpty: $,
213
+ list: /* @__PURE__ */ D(u, {
214
+ summary: xe,
215
+ technicalDetails: Se,
216
+ tr: y
217
+ }),
218
+ banners: /* @__PURE__ */ O(ce, { children: [Q ? /* @__PURE__ */ D(H, { message: Q }) : null, x ? /* @__PURE__ */ D(H, { message: y("adminOverviewPage.truncatedWarning", "Some lists are truncated (more than 100 items). Not all organizations, workspaces or tenants are shown.") }) : null] }),
219
+ graph: /* @__PURE__ */ O("div", {
220
+ className: "flex flex-col overflow-hidden rounded-card border border-border-subtle",
221
+ style: { height: "clamp(560px, calc(100dvh - 16rem), 900px)" },
222
+ "data-testid": "admin-overview-page",
223
+ children: [/* @__PURE__ */ D(V, {
224
+ organizationsCount: A.length,
225
+ workspacesCount: j.length,
226
+ tenantsCount: M.length,
227
+ totalProjects: ye,
228
+ onLoadAllProjects: L,
229
+ onRefresh: I,
230
+ headingLevel: 2
231
+ }), /* @__PURE__ */ D(U, {
232
+ nodes: G,
233
+ edges: q,
234
+ onNodesChange: ge,
235
+ onEdgesChange: _e,
236
+ onNodeClick: R,
237
+ onPaneClick: be,
238
+ selectedId: E,
239
+ actions: W,
240
+ isInitialLoading: Z,
241
+ isEmpty: $
242
+ })]
243
+ })
244
+ }) : /* @__PURE__ */ D("div", {
202
245
  className: "flex flex-col",
203
246
  style: {
204
247
  height: "clamp(640px, calc(100dvh - 11rem), 980px)",
205
248
  background: "var(--color-bg-page, var(--color-bg-surface))"
206
249
  },
207
250
  "data-testid": "admin-overview-page",
208
- children: Q ? /* @__PURE__ */ T("div", {
251
+ children: Z ? /* @__PURE__ */ D("div", {
209
252
  className: "flex flex-1 items-center justify-center",
210
- children: /* @__PURE__ */ T(J, {})
211
- }) : /* @__PURE__ */ E(ae, { children: [
212
- /* @__PURE__ */ T(oe, {
213
- organizationsCount: O.length,
214
- workspacesCount: k.length,
215
- tenantsCount: A.length,
216
- totalProjects: de,
217
- onLoadAllProjects: R,
218
- onRefresh: P
253
+ children: /* @__PURE__ */ D(J, {})
254
+ }) : /* @__PURE__ */ O(ce, { children: [
255
+ /* @__PURE__ */ D(V, {
256
+ organizationsCount: A.length,
257
+ workspacesCount: j.length,
258
+ tenantsCount: M.length,
259
+ totalProjects: ye,
260
+ onLoadAllProjects: L,
261
+ onRefresh: I
219
262
  }),
220
- $ ? /* @__PURE__ */ T(U, { message: $ }) : null,
221
- _ ? /* @__PURE__ */ T(U, { message: c("adminOverviewPage.truncatedWarning", "Some lists are truncated (more than 100 items). Not all organizations, workspaces or tenants are shown.") }) : null,
222
- /* @__PURE__ */ T(se, {
223
- nodes: K,
224
- edges: Y,
225
- onNodesChange: ce,
226
- onEdgesChange: le,
227
- onNodeClick: V,
228
- onPaneClick: pe,
229
- selectedId: C,
230
- actions: G,
231
- isInitialLoading: Q,
232
- isEmpty: fe
263
+ Q ? /* @__PURE__ */ D(H, { message: Q }) : null,
264
+ x ? /* @__PURE__ */ D(H, { message: y("adminOverviewPage.truncatedWarning", "Some lists are truncated (more than 100 items). Not all organizations, workspaces or tenants are shown.") }) : null,
265
+ /* @__PURE__ */ D(U, {
266
+ nodes: G,
267
+ edges: q,
268
+ onNodesChange: ge,
269
+ onEdgesChange: _e,
270
+ onNodeClick: R,
271
+ onPaneClick: be,
272
+ selectedId: E,
273
+ actions: W,
274
+ isInitialLoading: Z,
275
+ isEmpty: $
233
276
  })
234
277
  ] })
235
278
  });
236
279
  }
237
- function oe({ organizationsCount: e, workspacesCount: t, tenantsCount: n, totalProjects: r, onLoadAllProjects: i, onRefresh: a }) {
238
- let { t: o } = u(), s = (e, t) => {
239
- let n = o(e);
280
+ function V({ headingLevel: e = 1, organizationsCount: t, workspacesCount: n, tenantsCount: r, totalProjects: i, onLoadAllProjects: a, onRefresh: o }) {
281
+ let { t: s } = p(), c = (e, t) => {
282
+ let n = s(e);
240
283
  return n === e ? t : n;
241
284
  };
242
- return /* @__PURE__ */ E("header", {
243
- className: "flex items-center justify-between px-6 py-4 border-b shrink-0",
285
+ return /* @__PURE__ */ O("header", {
286
+ className: e === 1 ? "flex items-center justify-between px-6 py-4 border-b shrink-0" : "flex flex-wrap items-center justify-between gap-3 px-4 py-3 border-b shrink-0",
244
287
  style: {
245
288
  borderColor: "var(--color-border-default)",
246
289
  background: "var(--color-bg-surface)"
247
290
  },
248
- children: [/* @__PURE__ */ E("div", {
291
+ children: [/* @__PURE__ */ O("div", {
249
292
  className: "flex items-center gap-3",
250
- children: [/* @__PURE__ */ T("div", {
293
+ children: [/* @__PURE__ */ D("div", {
251
294
  className: "p-2 rounded-lg",
252
295
  style: {
253
296
  background: "var(--color-bg-subtle, var(--color-bg-surface))",
254
297
  color: "var(--color-action-primary-bg)"
255
298
  },
256
- children: /* @__PURE__ */ T(S, { size: 20 })
257
- }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h1", {
299
+ children: /* @__PURE__ */ D(w, { size: 20 })
300
+ }), /* @__PURE__ */ O("div", { children: [e === 1 ? /* @__PURE__ */ D("h1", {
301
+ className: "text-lg font-semibold",
302
+ style: { color: "var(--color-text-primary)" },
303
+ children: c("adminOverviewPage.title", "Administration Overview")
304
+ }) : /* @__PURE__ */ D("h2", {
258
305
  className: "text-lg font-semibold",
259
306
  style: { color: "var(--color-text-primary)" },
260
- children: s("adminOverviewPage.title", "Administration Overview")
261
- }), /* @__PURE__ */ T("p", {
307
+ children: c("adminOverviewPage.graphTitle", "Organization graph")
308
+ }), /* @__PURE__ */ D("p", {
262
309
  className: "text-xs",
263
310
  style: { color: "var(--color-text-secondary)" },
264
- children: s("adminOverviewPage.subtitle", "Organization → Workspace → Project hierarchy, with tenant placement")
311
+ children: c("adminOverviewPage.subtitle", "Organization → Workspace → Project hierarchy, with tenant placement")
265
312
  })] })]
266
- }), /* @__PURE__ */ E("div", {
267
- className: "flex items-center gap-4",
313
+ }), /* @__PURE__ */ O("div", {
314
+ className: e === 1 ? "flex items-center gap-4" : "flex flex-wrap items-center gap-2",
268
315
  children: [
269
- /* @__PURE__ */ T(W, {
270
- organizations: e,
271
- workspaces: t,
272
- tenants: n,
273
- projects: r
316
+ /* @__PURE__ */ D(W, {
317
+ organizations: t,
318
+ workspaces: n,
319
+ tenants: r,
320
+ projects: i
274
321
  }),
275
- /* @__PURE__ */ E("button", {
322
+ /* @__PURE__ */ O("button", {
276
323
  type: "button",
277
- onClick: i,
278
- disabled: t === 0,
324
+ onClick: a,
325
+ disabled: n === 0,
279
326
  className: "inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md border text-sm cursor-pointer transition-all duration-150 hover:bg-[color:var(--color-action-primary-bg)]/10 disabled:opacity-50 disabled:cursor-not-allowed whitespace-nowrap",
280
327
  style: {
281
328
  borderColor: "var(--color-action-primary-bg)",
@@ -283,12 +330,12 @@ function oe({ organizationsCount: e, workspacesCount: t, tenantsCount: n, totalP
283
330
  background: "transparent"
284
331
  },
285
332
  "data-testid": "admin-overview-load-all-projects",
286
- title: s("adminOverviewPage.loadAllProjectsTooltip", "Load projects for every workspace"),
287
- children: [/* @__PURE__ */ T(y, { size: 14 }), s("adminOverviewPage.loadAllProjects", "Load all projects")]
333
+ title: c("adminOverviewPage.loadAllProjectsTooltip", "Load projects for every workspace"),
334
+ children: [/* @__PURE__ */ D(se, { size: 14 }), c("adminOverviewPage.loadAllProjects", "Load all projects")]
288
335
  }),
289
- /* @__PURE__ */ E("button", {
336
+ /* @__PURE__ */ O("button", {
290
337
  type: "button",
291
- onClick: a,
338
+ onClick: o,
292
339
  className: "inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md border text-sm cursor-pointer transition-all duration-150 hover:bg-action-ghost-bgHover whitespace-nowrap",
293
340
  style: {
294
341
  borderColor: "var(--color-border-default)",
@@ -296,14 +343,14 @@ function oe({ organizationsCount: e, workspacesCount: t, tenantsCount: n, totalP
296
343
  background: "var(--color-bg-surface)"
297
344
  },
298
345
  "data-testid": "admin-overview-refresh",
299
- children: [/* @__PURE__ */ T(w, { size: 14 }), s("adminOverviewPage.refresh", "Refresh")]
346
+ children: [/* @__PURE__ */ D(E, { size: 14 }), c("adminOverviewPage.refresh", "Refresh")]
300
347
  })
301
348
  ]
302
349
  })]
303
350
  });
304
351
  }
305
- function U({ message: e }) {
306
- return /* @__PURE__ */ E("div", {
352
+ function H({ message: e }) {
353
+ return /* @__PURE__ */ O("div", {
307
354
  className: "flex items-center gap-2 px-6 py-2 border-b text-sm",
308
355
  style: {
309
356
  borderColor: "var(--color-border-default)",
@@ -311,15 +358,15 @@ function U({ message: e }) {
311
358
  color: "var(--color-status-error-text)"
312
359
  },
313
360
  "data-testid": "admin-overview-error",
314
- children: [/* @__PURE__ */ T(g, { size: 14 }), /* @__PURE__ */ T("span", { children: e })]
361
+ children: [/* @__PURE__ */ D(y, { size: 14 }), /* @__PURE__ */ D("span", { children: e })]
315
362
  });
316
363
  }
317
- function se({ nodes: e, edges: t, onNodesChange: n, onEdgesChange: r, onNodeClick: a, onPaneClick: o, selectedId: s, actions: c, isInitialLoading: l, isEmpty: u }) {
318
- return /* @__PURE__ */ E("div", {
364
+ function U({ nodes: e, edges: t, onNodesChange: n, onEdgesChange: r, onNodeClick: i, onPaneClick: o, selectedId: s, actions: c, isInitialLoading: l, isEmpty: u }) {
365
+ return /* @__PURE__ */ O("div", {
319
366
  className: "flex-1 min-h-0 relative",
320
- children: [l ? /* @__PURE__ */ T(J, {}) : u ? /* @__PURE__ */ T(Y, {}) : null, /* @__PURE__ */ T(i, {
367
+ children: [l ? /* @__PURE__ */ D(J, {}) : u ? /* @__PURE__ */ D(Y, {}) : null, /* @__PURE__ */ D(a, {
321
368
  actions: c,
322
- children: /* @__PURE__ */ E(N, {
369
+ children: /* @__PURE__ */ O(F, {
323
370
  nodes: e,
324
371
  edges: t,
325
372
  onNodesChange: n,
@@ -329,24 +376,24 @@ function se({ nodes: e, edges: t, onNodesChange: n, onEdgesChange: r, onNodeClic
329
376
  fitViewOptions: { padding: .25 },
330
377
  minZoom: .15,
331
378
  maxZoom: 1.5,
332
- onNodeClick: a,
379
+ onNodeClick: i,
333
380
  onPaneClick: o,
334
381
  proOptions: { hideAttribution: !0 },
335
382
  defaultEdgeOptions: { type: "smoothstep" },
336
383
  children: [
337
- /* @__PURE__ */ T(O, {
338
- variant: k.Dots,
384
+ /* @__PURE__ */ D(A, {
385
+ variant: j.Dots,
339
386
  gap: 20,
340
387
  size: 1,
341
388
  color: "var(--color-border-default)"
342
389
  }),
343
- /* @__PURE__ */ T(A, { style: {
390
+ /* @__PURE__ */ D(M, { style: {
344
391
  background: "var(--color-bg-surface)",
345
392
  border: "1px solid var(--color-border-default)",
346
393
  borderRadius: 8,
347
394
  overflow: "hidden"
348
395
  } }),
349
- /* @__PURE__ */ T(j, {
396
+ /* @__PURE__ */ D(N, {
350
397
  pannable: !0,
351
398
  zoomable: !0,
352
399
  style: {
@@ -364,13 +411,13 @@ function se({ nodes: e, edges: t, onNodesChange: n, onEdgesChange: r, onNodeClic
364
411
  }
365
412
  }
366
413
  }),
367
- /* @__PURE__ */ T(M, {
414
+ /* @__PURE__ */ D(P, {
368
415
  position: "top-left",
369
- children: /* @__PURE__ */ T(K, {})
416
+ children: /* @__PURE__ */ D(K, {})
370
417
  }),
371
- s ? /* @__PURE__ */ T(M, {
418
+ s ? /* @__PURE__ */ D(P, {
372
419
  position: "bottom-center",
373
- children: /* @__PURE__ */ T("div", {
420
+ children: /* @__PURE__ */ D("div", {
374
421
  className: "px-3 py-1.5 rounded-full border text-xs shadow-sm",
375
422
  style: {
376
423
  background: "var(--color-bg-surface)",
@@ -386,34 +433,34 @@ function se({ nodes: e, edges: t, onNodesChange: n, onEdgesChange: r, onNodeClic
386
433
  });
387
434
  }
388
435
  function W({ organizations: e, workspaces: t, tenants: n, projects: r }) {
389
- let { t: i } = u(), a = (e, t) => {
436
+ let { t: i } = p(), a = (e, t) => {
390
437
  let n = i(e);
391
438
  return n === e ? t : n;
392
439
  };
393
- return /* @__PURE__ */ E("div", {
440
+ return /* @__PURE__ */ O("div", {
394
441
  className: "flex items-center gap-2 text-xs",
395
442
  children: [
396
- /* @__PURE__ */ T(G, {
397
- icon: /* @__PURE__ */ T(_, { size: 12 }),
443
+ /* @__PURE__ */ D(G, {
444
+ icon: /* @__PURE__ */ D(b, { size: 12 }),
398
445
  label: `${e} ${a("adminOverviewPage.statsOrgs", "orgs")}`
399
446
  }),
400
- /* @__PURE__ */ T(G, {
401
- icon: /* @__PURE__ */ T(x, { size: 12 }),
447
+ /* @__PURE__ */ D(G, {
448
+ icon: /* @__PURE__ */ D(C, { size: 12 }),
402
449
  label: `${t} ${a("adminOverviewPage.statsWorkspaces", "workspaces")}`
403
450
  }),
404
- /* @__PURE__ */ T(G, {
405
- icon: /* @__PURE__ */ T(v, { size: 12 }),
451
+ /* @__PURE__ */ D(G, {
452
+ icon: /* @__PURE__ */ D(x, { size: 12 }),
406
453
  label: `${n} ${a("adminOverviewPage.statsTenants", "tenants")}`
407
454
  }),
408
- r > 0 ? /* @__PURE__ */ T(G, {
409
- icon: /* @__PURE__ */ T(C, { size: 12 }),
455
+ r > 0 ? /* @__PURE__ */ D(G, {
456
+ icon: /* @__PURE__ */ D(T, { size: 12 }),
410
457
  label: `${r} ${a("adminOverviewPage.statsProjects", "projects")}`
411
458
  }) : null
412
459
  ]
413
460
  });
414
461
  }
415
462
  function G({ icon: e, label: t }) {
416
- return /* @__PURE__ */ E("span", {
463
+ return /* @__PURE__ */ O("span", {
417
464
  className: "inline-flex items-center gap-1 px-2 py-1 rounded-md border whitespace-nowrap",
418
465
  style: {
419
466
  borderColor: "var(--color-border-default)",
@@ -424,11 +471,11 @@ function G({ icon: e, label: t }) {
424
471
  });
425
472
  }
426
473
  function K() {
427
- let { t: e } = u(), t = (t, n) => {
474
+ let { t: e } = p(), t = (t, n) => {
428
475
  let r = e(t);
429
476
  return r === t ? n : r;
430
477
  };
431
- return /* @__PURE__ */ E("div", {
478
+ return /* @__PURE__ */ O("div", {
432
479
  className: "p-3 rounded-lg border shadow-sm text-xs",
433
480
  style: {
434
481
  background: "var(--color-bg-surface)",
@@ -437,31 +484,31 @@ function K() {
437
484
  },
438
485
  "data-testid": "admin-overview-legend",
439
486
  children: [
440
- /* @__PURE__ */ E("div", {
487
+ /* @__PURE__ */ O("div", {
441
488
  className: "flex items-center gap-1.5 mb-2",
442
489
  style: { color: "var(--color-text-primary)" },
443
- children: [/* @__PURE__ */ T(b, { size: 12 }), /* @__PURE__ */ T("span", {
490
+ children: [/* @__PURE__ */ D(S, { size: 12 }), /* @__PURE__ */ D("span", {
444
491
  className: "font-semibold",
445
492
  children: t("adminOverviewPage.legend", "Legend")
446
493
  })]
447
494
  }),
448
- /* @__PURE__ */ T(q, {
449
- icon: /* @__PURE__ */ T(_, { size: 11 }),
495
+ /* @__PURE__ */ D(q, {
496
+ icon: /* @__PURE__ */ D(b, { size: 11 }),
450
497
  label: t("adminOverviewPage.legendOrganization", "Organization")
451
498
  }),
452
- /* @__PURE__ */ T(q, {
453
- icon: /* @__PURE__ */ T(x, { size: 11 }),
499
+ /* @__PURE__ */ D(q, {
500
+ icon: /* @__PURE__ */ D(C, { size: 11 }),
454
501
  label: t("adminOverviewPage.legendWorkspace", "Workspace")
455
502
  }),
456
- /* @__PURE__ */ T(q, {
457
- icon: /* @__PURE__ */ T(C, { size: 11 }),
503
+ /* @__PURE__ */ D(q, {
504
+ icon: /* @__PURE__ */ D(T, { size: 11 }),
458
505
  label: t("adminOverviewPage.legendProject", "Project")
459
506
  }),
460
- /* @__PURE__ */ T(q, {
461
- icon: /* @__PURE__ */ T(v, { size: 11 }),
507
+ /* @__PURE__ */ D(q, {
508
+ icon: /* @__PURE__ */ D(x, { size: 11 }),
462
509
  label: t("adminOverviewPage.legendTenant", "Tenant (dashed link)")
463
510
  }),
464
- /* @__PURE__ */ T("div", {
511
+ /* @__PURE__ */ D("div", {
465
512
  className: "mt-2 pt-2 border-t text-[10px] leading-tight",
466
513
  style: { borderColor: "var(--color-border-default)" },
467
514
  children: t("adminOverviewPage.legendHint", "Click any node to highlight its connections.")
@@ -470,22 +517,22 @@ function K() {
470
517
  });
471
518
  }
472
519
  function q({ icon: e, label: t }) {
473
- return /* @__PURE__ */ E("div", {
520
+ return /* @__PURE__ */ O("div", {
474
521
  className: "flex items-center gap-1.5 py-0.5",
475
- children: [/* @__PURE__ */ T("span", {
522
+ children: [/* @__PURE__ */ D("span", {
476
523
  style: { color: "var(--color-action-primary-bg)" },
477
524
  children: e
478
- }), /* @__PURE__ */ T("span", { children: t })]
525
+ }), /* @__PURE__ */ D("span", { children: t })]
479
526
  });
480
527
  }
481
528
  function J() {
482
- let { t: e } = u();
483
- return /* @__PURE__ */ T("div", {
529
+ let { t: e } = p();
530
+ return /* @__PURE__ */ D("div", {
484
531
  className: "absolute inset-0 flex items-center justify-center text-sm pointer-events-none z-10",
485
532
  style: { color: "var(--color-text-secondary)" },
486
- children: /* @__PURE__ */ E("div", {
533
+ children: /* @__PURE__ */ O("div", {
487
534
  className: "flex items-center gap-2",
488
- children: [/* @__PURE__ */ T("div", {
535
+ children: [/* @__PURE__ */ D("div", {
489
536
  className: "animate-spin rounded-full size-4 border-2 border-t-transparent",
490
537
  style: {
491
538
  borderColor: "var(--color-action-primary-bg)",
@@ -499,22 +546,22 @@ function J() {
499
546
  });
500
547
  }
501
548
  function Y() {
502
- let { t: e } = u(), t = (t, n) => {
549
+ let { t: e } = p(), t = (t, n) => {
503
550
  let r = e(t);
504
551
  return r === t ? n : r;
505
552
  };
506
- return /* @__PURE__ */ T("div", {
553
+ return /* @__PURE__ */ D("div", {
507
554
  className: "absolute inset-0 flex items-center justify-center pointer-events-none z-10",
508
555
  style: { color: "var(--color-text-secondary)" },
509
- children: /* @__PURE__ */ E("div", {
556
+ children: /* @__PURE__ */ O("div", {
510
557
  className: "flex flex-col items-center gap-2 text-center max-w-sm",
511
558
  children: [
512
- /* @__PURE__ */ T(S, { size: 32 }),
513
- /* @__PURE__ */ T("div", {
559
+ /* @__PURE__ */ D(w, { size: 32 }),
560
+ /* @__PURE__ */ D("div", {
514
561
  className: "text-base font-medium",
515
562
  children: t("adminOverviewPage.emptyTitle", "No resources found")
516
563
  }),
517
- /* @__PURE__ */ T("div", {
564
+ /* @__PURE__ */ D("div", {
518
565
  className: "text-xs",
519
566
  children: t("adminOverviewPage.emptyDescription", "You don't have access to any organizations, workspaces, or tenants yet.")
520
567
  })
@@ -522,4 +569,44 @@ function Y() {
522
569
  })
523
570
  });
524
571
  }
525
- export { V as AdminOverviewPage };
572
+ function he({ tr: e, isInitialLoading: t, isEmpty: n, banners: r, list: i, graph: a }) {
573
+ let o = k(), s = new URLSearchParams(o.search).get("view") === L, c = [{
574
+ id: "list",
575
+ label: e("adminOverviewPage.tabList", "List"),
576
+ href: o.pathname
577
+ }, {
578
+ id: "graph",
579
+ label: e("adminOverviewPage.tabGraph", "Graph"),
580
+ href: `${o.pathname}?view=${L}`
581
+ }];
582
+ return /* @__PURE__ */ O("div", {
583
+ className: "mx-auto flex w-full max-w-5xl flex-col gap-4 px-4 py-6 sm:px-6",
584
+ "data-testid": "admin-overview-fluidgrids",
585
+ children: [
586
+ /* @__PURE__ */ O("header", {
587
+ className: "flex flex-col gap-1",
588
+ children: [/* @__PURE__ */ D("h1", {
589
+ className: "text-2xl font-semibold text-text-primary",
590
+ children: e("adminOverviewPage.headingFluidGrids", "Administration")
591
+ }), /* @__PURE__ */ D("p", {
592
+ className: "text-sm text-text-secondary",
593
+ children: e("adminOverviewPage.helpLine", "Organization → Workspace → Project: an organization holds your workspaces, and each workspace holds its projects.")
594
+ })]
595
+ }),
596
+ /* @__PURE__ */ D(d, {
597
+ tabs: c,
598
+ activeId: s ? "graph" : "list",
599
+ ariaLabel: e("adminOverviewPage.tabsLabel", "Administration views")
600
+ }),
601
+ r,
602
+ s ? a : t ? /* @__PURE__ */ D("div", {
603
+ className: "relative min-h-[200px]",
604
+ children: /* @__PURE__ */ D(J, {})
605
+ }) : n ? /* @__PURE__ */ D("div", {
606
+ className: "relative min-h-[200px]",
607
+ children: /* @__PURE__ */ D(Y, {})
608
+ }) : i
609
+ ]
610
+ });
611
+ }
612
+ export { z as AdminOverviewPage };