@burdenoff/microfe-bigconsole 2026.1122.3 → 2026.1122.5

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.
@@ -12,49 +12,51 @@ import { useReconcileAgentTool as c } from "../components/reconcile/useReconcile
12
12
  import "../components/common/index.js";
13
13
  import te from "../hooks/usePageOperations.js";
14
14
  import "../components/narrative/index.js";
15
- import { AsOfProvider as ne, HideWhenAsOf as l, useAsOf as re } from "../asof/AsOfProvider.js";
15
+ import { AsOfProvider as l, HideWhenAsOf as u, useAsOf as ne } from "../asof/AsOfProvider.js";
16
16
  import "../store/index.js";
17
17
  import "../hooks/index.js";
18
- import ie, { parseUrlToGlobalFilterValues as ae } from "../hooks/useFilterUrlSync.js";
19
- import oe from "../hooks/useActivePage.js";
20
- import { DashboardCanvas as se } from "../components/dashboard/DashboardCanvas.js";
21
- import { dashboardPageTabs as ce } from "../assistant/pageControls.js";
22
- import { LiveCanvasToggle as le } from "../components/dashboard/LiveCanvasToggle.js";
23
- import { ExportDashboardDialog as ue } from "../components/dashboard/ExportDashboardDialog.js";
24
- import { DrilldownBreadcrumb as de } from "../components/dashboard/DrilldownBreadcrumb.js";
25
- import { PublishToStoreDialog as fe } from "../components/dashboard/PublishToStoreDialog.js";
26
- import { DashboardReviewDialog as pe } from "../components/dashboard/DashboardReviewDialog.js";
27
- import { loadBigConsoleSettings as me } from "../hooks/useBigConsoleSettings.js";
28
- import { LIVE_STRUCTURE_POLL_MS as he, isLiveDataRefreshDue as ge } from "../utils/liveBoardRefresh.js";
29
- import { registerBreadcrumbName as _e, unregisterBreadcrumbName as ve } from "../utils/breadcrumbRegistry.js";
30
- import { DigestPanel as ye } from "../components/narrative/DigestPanel.js";
31
- import { GetWidgetDocument as be } from "../../generated/wspace-operations.js";
32
- import { dashboardSuggestAnchorProps as xe } from "../proactive/entities.js";
33
- import { memo as u, useCallback as d, useEffect as f, useMemo as p, useRef as Se, useState as m } from "react";
34
- import { useLocation as Ce, useParams as we } from "react-router";
35
- import { AccessDenied as Te } from "@burdenoff/fe-libs/shared/components";
36
- import { usePermissions as Ee } from "@burdenoff/fe-libs/shared/providers/shell";
37
- import { ArrowLeft as De, Sparkles as Oe } from "lucide-react";
38
- import { Button as h, IllustratedEmptyState as ke } from "@burdenoff/fe-libs/ui";
39
- import { useI18n as Ae } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
40
- import { useApolloClient as je } from "@apollo/client/react";
41
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
42
- import { useAssistantPageControls as Me } from "@burdenoff/fe-libs/shared/assistant/appControls/useAssistantControl";
18
+ import re, { parseUrlToGlobalFilterValues as ie } from "../hooks/useFilterUrlSync.js";
19
+ import ae from "../hooks/useActivePage.js";
20
+ import { DashboardCanvas as oe } from "../components/dashboard/DashboardCanvas.js";
21
+ import { dashboardPageTabs as se } from "../assistant/pageControls.js";
22
+ import { LiveCanvasToggle as ce } from "../components/dashboard/LiveCanvasToggle.js";
23
+ import { ExportDashboardDialog as le } from "../components/dashboard/ExportDashboardDialog.js";
24
+ import { DrilldownBreadcrumb as ue } from "../components/dashboard/DrilldownBreadcrumb.js";
25
+ import { PublishToStoreDialog as de } from "../components/dashboard/PublishToStoreDialog.js";
26
+ import { DashboardReviewDialog as fe } from "../components/dashboard/DashboardReviewDialog.js";
27
+ import { DashboardPresenceBar as pe } from "../components/dashboard/DashboardPresenceBar.js";
28
+ import { DashboardCommentsDrawer as me } from "../components/dashboard/DashboardCommentsDrawer.js";
29
+ import { loadBigConsoleSettings as he } from "../hooks/useBigConsoleSettings.js";
30
+ import { LIVE_STRUCTURE_POLL_MS as ge, isLiveDataRefreshDue as _e } from "../utils/liveBoardRefresh.js";
31
+ import { registerBreadcrumbName as ve, unregisterBreadcrumbName as ye } from "../utils/breadcrumbRegistry.js";
32
+ import { DigestPanel as be } from "../components/narrative/DigestPanel.js";
33
+ import { GetWidgetDocument as xe } from "../../generated/wspace-operations.js";
34
+ import { dashboardSuggestAnchorProps as Se } from "../proactive/entities.js";
35
+ import { memo as d, useCallback as f, useEffect as p, useMemo as m, useRef as Ce, useState as h } from "react";
36
+ import { useLocation as we, useParams as Te } from "react-router";
37
+ import { AccessDenied as Ee } from "@burdenoff/fe-libs/shared/components";
38
+ import { usePermissions as De } from "@burdenoff/fe-libs/shared/providers/shell";
39
+ import { ArrowLeft as Oe, MessageSquare as ke, Sparkles as Ae } from "lucide-react";
40
+ import { Button as g, IllustratedEmptyState as je } from "@burdenoff/fe-libs/ui";
41
+ import { useI18n as Me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
42
+ import { useApolloClient as Ne } from "@apollo/client/react";
43
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
44
+ import { useAssistantPageControls as Pe } from "@burdenoff/fe-libs/shared/assistant/appControls/useAssistantControl";
43
45
  // src/bigconsole/pages/DashboardViewPage.tsx
44
- var y = u(function() {
45
- let { dashboardId: r } = we(), c = a(), ne = i(), { t: u } = Ae(), y = re().asOf !== null, b = je(), { hasPermission: x, isLoading: S } = Ee(), C = x(n.DASHBOARD_READ), w = x(n.DASHBOARD_UPDATE), Pe = x(n.DASHBOARD_EXPORT), Fe = x(n.DASHBOARD_PUBLISH), [Ie, T] = m(!1), [E, D] = m(!1), [Le, O] = m(!1), [k, Re] = m(!1), [A, ze] = m(!1), { isInDrilldown: j, getContextFromUrl: M, getDrilldownMetadata: N } = ie(), P = t((e) => e.currentDashboard), F = t((e) => e.setCurrentDashboard), I = t((e) => e.setGlobalFilterValue), L = t((e) => e.viewMode), Be = t((e) => e.setViewMode);
46
- f(() => {
47
- y && L === "edit" && Be("view");
46
+ var b = d(function() {
47
+ let { dashboardId: r } = Te(), c = a(), l = i(), { t: d } = Me(), b = ne().asOf !== null, x = Ne(), { hasPermission: S, isLoading: C } = De(), w = S(n.DASHBOARD_READ), Ie = S(n.DASHBOARD_UPDATE), Le = S(n.DASHBOARD_EXPORT), Re = S(n.DASHBOARD_PUBLISH), [ze, Be] = h(!1), [T, E] = h(!1), [Ve, He] = h(!1), [D, Ue] = h(!1), [O, k] = h(!1), [A, j] = h(!1), { isInDrilldown: M, getContextFromUrl: We, getDrilldownMetadata: N } = re(), P = t((e) => e.currentDashboard), F = t((e) => e.setCurrentDashboard), I = t((e) => e.setGlobalFilterValue), L = t((e) => e.viewMode), R = t((e) => e.setViewMode);
48
+ p(() => {
49
+ b && L === "edit" && R("view");
48
50
  }, [
49
- y,
51
+ b,
50
52
  L,
51
- Be
53
+ R
52
54
  ]);
53
- let Ve = e((e) => e.closeConfigPanel);
54
- f(() => {
55
- y && Ve();
56
- }, [y, Ve]);
57
- let R = t((e) => e.clearAllGlobalFilters), He = t((e) => e.setGlobalFilterValues), z = e((e) => e.widgets), Ue = Ce(), { activePageId: B, setActivePage: V } = oe(P?.id === r ? P?.pages : void 0), H = e((e) => e.clipboardWidgetId), U = e((e) => e.clipboardAction), W = e((e) => e.clearClipboard), G = e((e) => e.selectWidget), { loading: K, error: q, fetchDashboard: J, updateDashboard: Y } = ee(), { createWidget: We, deleteWidget: Ge, duplicateWidget: Ke, batchUpdatePositions: qe, refetch: Je } = s(B || void 0, r), { createPage: Ye, updatePage: Xe, deletePage: Ze, duplicatePage: Qe, reorderPages: $e } = te(), et = d((e) => {
55
+ let z = e((e) => e.closeConfigPanel);
56
+ p(() => {
57
+ b && z();
58
+ }, [b, z]);
59
+ let Ge = t((e) => e.clearAllGlobalFilters), Ke = t((e) => e.setGlobalFilterValues), B = e((e) => e.widgets), qe = we(), { activePageId: V, setActivePage: H } = ae(P?.id === r ? P?.pages : void 0), U = e((e) => e.clipboardWidgetId), W = e((e) => e.clipboardAction), G = e((e) => e.clearClipboard), K = e((e) => e.selectWidget), { loading: q, error: J, fetchDashboard: Y, updateDashboard: Je } = ee(), { createWidget: Ye, deleteWidget: Xe, duplicateWidget: Ze, batchUpdatePositions: Qe, refetch: $e } = s(V || void 0, r), { createPage: et, updatePage: tt, deletePage: nt, duplicatePage: rt, reorderPages: it } = te(), at = f((e) => {
58
60
  let t = e?.parentElement;
59
61
  if (!e || !t) return;
60
62
  let n = t;
@@ -73,100 +75,100 @@ var y = u(function() {
73
75
  a.disconnect(), s.disconnect();
74
76
  };
75
77
  }, []);
76
- f(() => {
78
+ p(() => {
77
79
  if (!r) c("/dashboards");
78
- else return He(ae(window.location.search, "filter_")), D(!1), J(r).then((e) => {
79
- e || D(!0);
80
+ else return Ke(ie(window.location.search, "filter_")), E(!1), Y(r).then((e) => {
81
+ e || E(!0);
80
82
  }), () => {
81
- F(null), R(), D(!1);
83
+ F(null), Ge(), E(!1);
82
84
  };
83
85
  }, [
84
86
  r,
85
87
  c,
86
- J,
88
+ Y,
87
89
  F,
88
- R,
89
- He
90
- ]), f(() => {
91
- if (!j) return;
92
- let e = M(), t = N();
90
+ Ge,
91
+ Ke
92
+ ]), p(() => {
93
+ if (!M) return;
94
+ let e = We(), t = N();
93
95
  Object.entries(e).forEach(([e, t]) => {
94
96
  I(`ctx_${e}`, t);
95
97
  }), t.depth > 0 && (I("__drilldown_depth", t.depth), I("__drilldown_parent", t.parent), I("__drilldown_path", t.path)), Object.keys(e).length;
96
98
  }, [
97
- j,
98
99
  M,
100
+ We,
99
101
  N,
100
102
  I,
101
- Ue.search
103
+ qe.search
102
104
  ]);
103
- let tt = Se(Je);
104
- tt.current = Je, f(() => {
105
- if (!k || !r || y) return;
105
+ let ot = Ce($e);
106
+ ot.current = $e, p(() => {
107
+ if (!D || !r || b) return;
106
108
  let e = null, n = () => {
107
109
  if (typeof document < "u" && document.visibilityState !== "visible" || t.getState().viewMode === "edit") return;
108
- J(r, { silent: !0 }), tt.current();
110
+ Y(r, { silent: !0 }), ot.current();
109
111
  let n = Date.now();
110
- ge(e, n) && (e = n, b.refetchQueries({ include: [be] }).catch((e) => {
112
+ _e(e, n) && (e = n, x.refetchQueries({ include: [xe] }).catch((e) => {
111
113
  console.warn("[DashboardViewPage] Live widget data refresh failed", e);
112
114
  }));
113
115
  };
114
116
  n();
115
- let i = window.setInterval(n, he), a = () => {
117
+ let i = window.setInterval(n, ge), a = () => {
116
118
  document.visibilityState === "visible" && (e = null, n());
117
119
  };
118
120
  return document.addEventListener("visibilitychange", a), () => {
119
121
  window.clearInterval(i), document.removeEventListener("visibilitychange", a);
120
122
  };
121
123
  }, [
122
- k,
124
+ D,
123
125
  r,
124
- y,
125
- J,
126
- b
126
+ b,
127
+ Y,
128
+ x
127
129
  ]);
128
- let nt = d(async () => {
129
- if (r && !y) {
130
- T(!0);
130
+ let st = f(async () => {
131
+ if (r && !b) {
132
+ Be(!0);
131
133
  try {
132
- let e = Array.from(z.values());
134
+ let e = Array.from(B.values());
133
135
  if (e.length > 0) {
134
136
  let t = e.map((e) => ({
135
137
  id: e.id,
136
138
  position: e.position
137
139
  }));
138
- await qe(t);
140
+ await Qe(t);
139
141
  }
140
- P && await Y({
142
+ P && await Je({
141
143
  id: r,
142
144
  name: P.name,
143
145
  description: P.description
144
146
  });
145
147
  } catch {} finally {
146
- T(!1);
148
+ Be(!1);
147
149
  }
148
150
  }
149
151
  }, [
150
152
  r,
151
- y,
152
- z,
153
+ b,
154
+ B,
153
155
  P,
154
- qe,
155
- Y
156
- ]), rt = d(() => {
156
+ Qe,
157
+ Je
158
+ ]), ct = f(() => {
157
159
  c("/dashboards");
158
- }, [c]), X = d((e) => {
159
- V(e);
160
- }, [V]), Z = p(() => (P?.pages || []).map((e, t) => ({
160
+ }, [c]), X = f((e) => {
161
+ H(e);
162
+ }, [H]), Z = m(() => (P?.pages || []).map((e, t) => ({
161
163
  id: e.id,
162
- name: e.name || u("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: t + 1 }),
164
+ name: e.name || d("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: t + 1 }),
163
165
  order: e.order ?? 0
164
- })), [P?.pages, u]), Q = P && P.id === r ? P.name : null, $ = B || P?.pages?.[0]?.id || null;
165
- f(() => {
166
- if (r && Q) return _e(r, Q), () => ve(r);
166
+ })), [P?.pages, d]), Q = P && P.id === r ? P.name : null, $ = V || P?.pages?.[0]?.id || null;
167
+ p(() => {
168
+ if (r && Q) return ve(r, Q), () => ye(r);
167
169
  }, [r, Q]);
168
- let it = p(() => !S && C && !q && !E && !K && Q !== null ? ce({
169
- dashboardName: Q || u("bigconsole.dashboards.title", "Dashboards"),
170
+ let lt = m(() => !C && w && !J && !T && !q && Q !== null ? se({
171
+ dashboardName: Q || d("bigconsole.dashboards.title", "Dashboards"),
170
172
  tabs: Z.map((e) => ({
171
173
  id: e.id,
172
174
  label: e.name
@@ -174,39 +176,39 @@ var y = u(function() {
174
176
  current: $,
175
177
  select: X
176
178
  }) : null, [
177
- S,
178
179
  C,
180
+ w,
181
+ J,
182
+ T,
179
183
  q,
180
- E,
181
- K,
182
184
  Q,
183
185
  Z,
184
186
  $,
185
187
  X,
186
- u
188
+ d
187
189
  ]);
188
- Me(it);
189
- let at = d(async () => {
190
- let e = B || P?.pages?.[0]?.id;
191
- if (!H || !r || !e) return;
192
- let t = z.get(H);
190
+ Pe(lt);
191
+ let ut = f(async () => {
192
+ let e = V || P?.pages?.[0]?.id;
193
+ if (!U || !r || !e) return;
194
+ let t = B.get(U);
193
195
  if (!t) {
194
- W();
196
+ G();
195
197
  return;
196
198
  }
197
199
  let n = {
198
200
  x: 0,
199
- y: Array.from(z.values()).reduce((e, t) => {
201
+ y: Array.from(B.values()).reduce((e, t) => {
200
202
  let n = (t.positionY ?? 0) + (t.positionHeight ?? 4);
201
203
  return Math.max(e, n);
202
204
  }, 0),
203
205
  width: Math.min(t.positionWidth ?? 4, P?.pages.find((t) => t.id === e)?.gridColumns ?? 12),
204
206
  height: t.positionHeight ?? 4
205
- }, i = U === "copy" ? u("bigconsole.dashboards.view.widgetCopyTitle", "{{title}} (Copy)", { title: t.title }) : t.title, a = null;
207
+ }, i = W === "copy" ? d("bigconsole.dashboards.view.widgetCopyTitle", "{{title}} (Copy)", { title: t.title }) : t.title, a = null;
206
208
  try {
207
- a = await Ke(H, n, i);
209
+ a = await Ze(U, n, i);
208
210
  } catch {}
209
- a ||= await We({
211
+ a ||= await Ye({
210
212
  pageId: e,
211
213
  dashboardId: r,
212
214
  type: t.type,
@@ -220,49 +222,49 @@ var y = u(function() {
220
222
  position: n,
221
223
  refreshInterval: t.refreshInterval ?? void 0,
222
224
  metadata: t.metadata
223
- }), a && (G(a.id), U === "cut" && await Ge(H)), W();
225
+ }), a && (K(a.id), W === "cut" && await Xe(U)), G();
224
226
  }, [
225
- H,
226
227
  U,
228
+ W,
227
229
  r,
228
- B,
230
+ V,
229
231
  P,
230
- z,
231
- Ke,
232
- We,
233
- Ge,
232
+ B,
233
+ Ze,
234
+ Ye,
235
+ Xe,
236
+ K,
234
237
  G,
235
- W,
236
- u
237
- ]), ot = d(() => {
238
- O(!0);
239
- }, []), [st, ct] = m(!1), lt = d(() => {
240
- ct(!0);
241
- }, []), ut = d(() => {
242
- ct(!1);
243
- }, []), dt = d(() => {
244
- O(!1);
245
- }, []), [ft, pt] = m(!1), mt = d(() => pt(!0), []), ht = d(() => pt(!1), []), gt = d(async () => {
246
- if (!P || !r || y) return;
247
- let e = (P.pages?.length || 0) + 1, t = u("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: e }), n = await Ye({
238
+ d
239
+ ]), dt = f(() => {
240
+ He(!0);
241
+ }, []), [ft, pt] = h(!1), mt = f(() => {
242
+ pt(!0);
243
+ }, []), ht = f(() => {
244
+ pt(!1);
245
+ }, []), gt = f(() => {
246
+ He(!1);
247
+ }, []), [_t, vt] = h(!1), yt = f(() => vt(!0), []), bt = f(() => vt(!1), []), xt = f(async () => {
248
+ if (!P || !r || b) return;
249
+ let e = (P.pages?.length || 0) + 1, t = d("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: e }), n = await et({
248
250
  dashboardId: r,
249
251
  name: t,
250
- gridColumns: me().defaultGridColumns
252
+ gridColumns: he().defaultGridColumns
251
253
  });
252
254
  n && (F({
253
255
  ...P,
254
256
  pages: [...P.pages || [], n]
255
- }), V(n.id));
257
+ }), H(n.id));
256
258
  }, [
257
259
  P,
258
260
  r,
259
- y,
261
+ b,
260
262
  F,
261
- Ye,
262
- V,
263
- u
264
- ]), _t = d(async (e, t) => {
265
- P && !y && await Xe({
263
+ et,
264
+ H,
265
+ d
266
+ ]), St = f(async (e, t) => {
267
+ P && !b && await tt({
266
268
  id: e,
267
269
  name: t
268
270
  }) && F({
@@ -274,28 +276,28 @@ var y = u(function() {
274
276
  });
275
277
  }, [
276
278
  P,
277
- y,
279
+ b,
278
280
  F,
279
- Xe
280
- ]), vt = d(async (e) => {
281
- if (!P || !r || y) return;
281
+ tt
282
+ ]), Ct = f(async (e) => {
283
+ if (!P || !r || b) return;
282
284
  let t = P.pages?.find((t) => t.id === e);
283
285
  if (!t) return;
284
- let n = await Qe(e, u("bigconsole.dashboards.view.pageCopyName", "{{name}} (Copy)", { name: t.name ?? "" }));
286
+ let n = await rt(e, d("bigconsole.dashboards.view.pageCopyName", "{{name}} (Copy)", { name: t.name ?? "" }));
285
287
  n && (F({
286
288
  ...P,
287
289
  pages: [...P.pages || [], n]
288
- }), V(n.id));
290
+ }), H(n.id));
289
291
  }, [
290
292
  P,
291
293
  r,
292
- y,
294
+ b,
293
295
  F,
294
- Qe,
295
- V,
296
- u
297
- ]), yt = d(async (e) => {
298
- if (!(!P || y || (P.pages?.length || 0) <= 1) && await Ze(e)) {
296
+ rt,
297
+ H,
298
+ d
299
+ ]), wt = f(async (e) => {
300
+ if (!(!P || b || (P.pages?.length || 0) <= 1) && await nt(e)) {
299
301
  let t = P.pages?.filter((t) => t.id !== e).map((e, t) => ({
300
302
  ...e,
301
303
  order: t
@@ -305,17 +307,17 @@ var y = u(function() {
305
307
  pages: t
306
308
  });
307
309
  let n = t?.[0]?.id;
308
- B === e && n && V(n, { replace: !0 });
310
+ V === e && n && H(n, { replace: !0 });
309
311
  }
310
312
  }, [
311
313
  P,
312
- y,
314
+ b,
313
315
  F,
314
- B,
315
- Ze,
316
- V
317
- ]), bt = d(async (e) => {
318
- if (!P || !r || y) return;
316
+ V,
317
+ nt,
318
+ H
319
+ ]), Tt = f(async (e) => {
320
+ if (!P || !r || b) return;
319
321
  F({
320
322
  ...P,
321
323
  pages: e.map((e, t) => ({
@@ -324,186 +326,213 @@ var y = u(function() {
324
326
  }))
325
327
  });
326
328
  let t = e.map((e) => e.id);
327
- await $e(r, t);
329
+ await it(r, t);
328
330
  }, [
329
331
  P,
330
332
  r,
331
- y,
333
+ b,
332
334
  F,
333
- $e
335
+ it
334
336
  ]);
335
- return S ? /* @__PURE__ */ _("div", {
337
+ return C ? /* @__PURE__ */ v("div", {
336
338
  className: "flex items-center justify-center h-full",
337
- children: /* @__PURE__ */ _("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
338
- }) : C ? q ? /* @__PURE__ */ _("div", {
339
+ children: /* @__PURE__ */ v("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
340
+ }) : w ? J ? /* @__PURE__ */ v("div", {
339
341
  className: "flex h-full flex-col items-center justify-center",
340
342
  style: { padding: "var(--space-pagePadding)" },
341
- children: /* @__PURE__ */ _(o, {
343
+ children: /* @__PURE__ */ v(o, {
342
344
  headingLevel: 2,
343
345
  tone: "danger",
344
- title: u("bigconsole.dashboards.view.errorTitle", "Error loading dashboard"),
345
- description: /* @__PURE__ */ _("span", {
346
+ title: d("bigconsole.dashboards.view.errorTitle", "Error loading dashboard"),
347
+ description: /* @__PURE__ */ v("span", {
346
348
  className: "break-words",
347
- children: q.message
349
+ children: J.message
348
350
  }),
349
351
  className: "w-full max-w-md",
350
352
  "data-testid": "dashboard-view-error",
351
- actions: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(h, {
353
+ actions: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(g, {
352
354
  size: "sm",
353
- onClick: () => J(r),
354
- children: u("bigconsole.dashboards.view.retry", "Retry")
355
- }), /* @__PURE__ */ _(h, {
355
+ onClick: () => Y(r),
356
+ children: d("bigconsole.dashboards.view.retry", "Retry")
357
+ }), /* @__PURE__ */ v(g, {
356
358
  size: "sm",
357
359
  variant: "outline",
358
360
  onClick: () => c("/dashboards"),
359
- children: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
361
+ children: d("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
360
362
  })] })
361
363
  })
362
- }) : E ? /* @__PURE__ */ _("div", {
364
+ }) : T ? /* @__PURE__ */ v("div", {
363
365
  className: "flex flex-col items-center justify-center h-full",
364
366
  style: { padding: "var(--space-pagePadding)" },
365
- children: /* @__PURE__ */ _(ke, {
367
+ children: /* @__PURE__ */ v(je, {
366
368
  illustration: "empty-data",
367
- title: u("bigconsole.dashboards.view.notFoundTitle", "Dashboard not found"),
368
- description: /* @__PURE__ */ v(g, { children: [u("bigconsole.dashboards.view.notFoundDescription", "The dashboard you're looking for doesn't exist or has been deleted."), /* @__PURE__ */ _("span", {
369
+ title: d("bigconsole.dashboards.view.notFoundTitle", "Dashboard not found"),
370
+ description: /* @__PURE__ */ y(_, { children: [d("bigconsole.dashboards.view.notFoundDescription", "The dashboard you're looking for doesn't exist or has been deleted."), /* @__PURE__ */ v("span", {
369
371
  className: "mt-2 block font-mono text-xs text-text-muted break-all",
370
- children: u("bigconsole.dashboards.view.idLabel", "ID: {{id}}", { id: r ?? "" })
372
+ children: d("bigconsole.dashboards.view.idLabel", "ID: {{id}}", { id: r ?? "" })
371
373
  })] }),
372
- action: /* @__PURE__ */ _(h, {
374
+ action: /* @__PURE__ */ v(g, {
373
375
  onClick: () => c("/dashboards"),
374
- children: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
376
+ children: d("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
375
377
  })
376
378
  })
377
- }) : K || !P ? /* @__PURE__ */ _("div", {
379
+ }) : q || !P ? /* @__PURE__ */ v("div", {
378
380
  className: "flex items-center justify-center h-full",
379
381
  role: "status",
380
382
  "aria-live": "polite",
381
- children: /* @__PURE__ */ v("div", {
383
+ children: /* @__PURE__ */ y("div", {
382
384
  className: "flex flex-col items-center gap-4",
383
- children: [/* @__PURE__ */ _("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" }), /* @__PURE__ */ _("p", {
385
+ children: [/* @__PURE__ */ v("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" }), /* @__PURE__ */ v("p", {
384
386
  className: "text-sm text-text-secondary",
385
- children: u("bigconsole.dashboards.view.loading", "Loading dashboard...")
387
+ children: d("bigconsole.dashboards.view.loading", "Loading dashboard...")
386
388
  })]
387
389
  })
388
- }) : /* @__PURE__ */ v(g, { children: [!y && /* @__PURE__ */ _(Ne, {}), /* @__PURE__ */ v("div", {
389
- ref: et,
390
+ }) : /* @__PURE__ */ y(_, { children: [!b && /* @__PURE__ */ v(Fe, {}), /* @__PURE__ */ y("div", {
391
+ ref: at,
390
392
  className: "h-full flex flex-col overflow-hidden",
391
393
  children: [
392
- /* @__PURE__ */ _(o, {
394
+ /* @__PURE__ */ v(o, {
393
395
  emphasis: "bare",
394
396
  padding: "none",
395
397
  "data-testid": "dashboard-route-header",
396
398
  "aria-label": "Dashboard",
397
399
  className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-3 py-2",
398
400
  headerClassName: "",
399
- header: /* @__PURE__ */ v("div", {
401
+ header: /* @__PURE__ */ y("div", {
400
402
  className: "flex flex-wrap items-center gap-control-gap",
401
403
  children: [
402
- /* @__PURE__ */ v(h, {
403
- onClick: rt,
404
+ /* @__PURE__ */ y(g, {
405
+ onClick: ct,
404
406
  variant: "ghost",
405
407
  size: "sm",
406
- title: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
407
- "aria-label": u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
408
+ title: d("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
409
+ "aria-label": d("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
408
410
  className: "flex-shrink-0",
409
- children: [/* @__PURE__ */ _(De, { className: "w-4 h-4 mr-2" }), u("bigconsole.dashboards.view.back", "Back")]
411
+ children: [/* @__PURE__ */ v(Oe, { className: "w-4 h-4 mr-2" }), d("bigconsole.dashboards.view.back", "Back")]
410
412
  }),
411
- /* @__PURE__ */ _("h1", {
413
+ /* @__PURE__ */ v("h1", {
412
414
  className: "min-w-0 flex-1 truncate text-sm font-semibold text-text-primary",
413
415
  title: P.name,
414
- ...xe(P.id),
416
+ ...Se(P.id),
415
417
  children: P.name
416
418
  }),
417
- !y && /* @__PURE__ */ _("div", {
419
+ !b && /* @__PURE__ */ v(pe, {
420
+ dashboardId: P.id,
421
+ enabled: !b
422
+ }),
423
+ /* @__PURE__ */ v(u, { children: /* @__PURE__ */ v("div", {
418
424
  className: "flex-shrink-0",
419
- children: /* @__PURE__ */ _(le, {
420
- isLive: k,
421
- onToggle: () => Re((e) => !e)
425
+ children: /* @__PURE__ */ y(g, {
426
+ onClick: () => j((e) => !e),
427
+ variant: A ? "secondary" : "ghost",
428
+ size: "sm",
429
+ "aria-pressed": A,
430
+ "data-testid": "dashboard-comments-button",
431
+ title: d("bigconsole.dashboard.comments.openButton", "Console comments"),
432
+ "aria-label": d("bigconsole.dashboard.comments.openButton", "Console comments"),
433
+ children: [/* @__PURE__ */ v(ke, { className: "w-4 h-4 mr-2" }), d("bigconsole.dashboard.comments.buttonLabel", "Comments")]
434
+ })
435
+ }) }),
436
+ !b && /* @__PURE__ */ v("div", {
437
+ className: "flex-shrink-0",
438
+ children: /* @__PURE__ */ v(ce, {
439
+ isLive: D,
440
+ onToggle: () => Ue((e) => !e)
422
441
  })
423
442
  }),
424
- /* @__PURE__ */ _(l, { children: /* @__PURE__ */ _("div", {
443
+ /* @__PURE__ */ v(u, { children: /* @__PURE__ */ v("div", {
425
444
  className: "flex-shrink-0",
426
- children: /* @__PURE__ */ v(h, {
427
- onClick: () => ze((e) => !e),
445
+ children: /* @__PURE__ */ y(g, {
446
+ onClick: () => k((e) => !e),
428
447
  variant: "ghost",
429
448
  size: "sm",
430
- "aria-pressed": A,
431
- title: u("bigconsole.dashboards.view.digest", "Console digest"),
432
- "aria-label": u("bigconsole.dashboards.view.digest", "Console digest"),
433
- children: [/* @__PURE__ */ _(Oe, { className: "w-4 h-4 mr-2" }), u("bigconsole.dashboards.view.digest", "Digest")]
449
+ "aria-pressed": O,
450
+ title: d("bigconsole.dashboards.view.digest", "Console digest"),
451
+ "aria-label": d("bigconsole.dashboards.view.digest", "Console digest"),
452
+ children: [/* @__PURE__ */ v(Ae, { className: "w-4 h-4 mr-2" }), d("bigconsole.dashboards.view.digest", "Digest")]
434
453
  })
435
454
  }) })
436
455
  ]
437
456
  })
438
457
  }),
439
- A && P && /* @__PURE__ */ _(l, { children: /* @__PURE__ */ _("div", {
458
+ O && P && /* @__PURE__ */ v(u, { children: /* @__PURE__ */ v("div", {
440
459
  className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-3 py-2 sm:px-4",
441
- children: /* @__PURE__ */ _("div", {
460
+ children: /* @__PURE__ */ v("div", {
442
461
  className: "mx-auto max-w-3xl",
443
- children: /* @__PURE__ */ _(ye, {
462
+ children: /* @__PURE__ */ v(be, {
444
463
  dashboardId: P.id,
445
- onClose: () => ze(!1)
464
+ onClose: () => k(!1)
446
465
  })
447
466
  })
448
467
  }) }),
449
- j && !y && /* @__PURE__ */ _(de, {
468
+ M && !b && /* @__PURE__ */ v(ue, {
450
469
  currentDashboardId: P.id,
451
470
  currentDashboardName: P.name,
452
- basePath: `${ne}/dashboards`
471
+ basePath: `${l}/dashboards`
453
472
  }),
454
- /* @__PURE__ */ _("div", {
473
+ /* @__PURE__ */ v("div", {
455
474
  className: "flex-1 min-w-0 overflow-hidden",
456
- children: /* @__PURE__ */ _(se, {
475
+ children: /* @__PURE__ */ v(oe, {
457
476
  dashboardId: P.id,
458
- pageId: B || P.pages?.[0]?.id,
477
+ pageId: V || P.pages?.[0]?.id,
459
478
  title: P.name,
460
- onPaste: at,
461
- onSave: w && !y ? nt : void 0,
462
- isSaving: Ie,
463
- onReview: y ? void 0 : mt,
464
- onExport: Pe && !y ? ot : void 0,
465
- onPublishTemplate: Fe && !y ? lt : void 0,
479
+ onPaste: ut,
480
+ onSave: Ie && !b ? st : void 0,
481
+ isSaving: ze,
482
+ onReview: b ? void 0 : yt,
483
+ onExport: Le && !b ? dt : void 0,
484
+ onPublishTemplate: Re && !b ? mt : void 0,
466
485
  pages: Z,
467
486
  activePageId: $ ?? void 0,
468
487
  onPageChange: X,
469
- onPageAdd: gt,
470
- onPageRename: _t,
471
- onPageDuplicate: vt,
472
- onPageDelete: yt,
473
- onPagesReorder: bt,
488
+ onPageAdd: xt,
489
+ onPageRename: St,
490
+ onPageDuplicate: Ct,
491
+ onPageDelete: wt,
492
+ onPagesReorder: Tt,
474
493
  showPageTabs: !0
475
494
  })
476
495
  }),
477
- /* @__PURE__ */ _(pe, {
478
- open: ft && !y,
479
- onClose: ht,
496
+ /* @__PURE__ */ v(fe, {
497
+ open: _t && !b,
498
+ onClose: bt,
480
499
  dashboardId: P.id,
481
500
  pages: Z,
482
- canFix: w && !y
501
+ canFix: Ie && !b
483
502
  }),
484
- /* @__PURE__ */ _(ue, {
485
- isOpen: Le && !y,
503
+ /* @__PURE__ */ v(le, {
504
+ isOpen: Ve && !b,
486
505
  dashboardId: P.id,
487
506
  dashboardName: P.name,
488
- onClose: dt
507
+ onClose: gt
508
+ }),
509
+ !b && /* @__PURE__ */ v(me, {
510
+ dashboardId: P.id,
511
+ isOpen: A && !b,
512
+ onClose: () => j(!1),
513
+ widgets: Array.from(B.values()).map((e) => ({
514
+ id: e.id,
515
+ title: e.title || e.type
516
+ })),
517
+ onSelectWidget: (e) => K(e)
489
518
  }),
490
- /* @__PURE__ */ _(fe, {
491
- isOpen: st && !y,
519
+ /* @__PURE__ */ v(de, {
520
+ isOpen: ft && !b,
492
521
  dashboardId: P.id,
493
522
  dashboardName: P.name,
494
523
  dashboardDescription: P.description,
495
- onClose: ut
524
+ onClose: ht
496
525
  })
497
526
  ]
498
- })] }) : /* @__PURE__ */ _(Te, {
499
- title: u("bigconsole.dashboards.view.accessDeniedTitle", "Access Denied"),
500
- description: u("bigconsole.dashboards.view.accessDeniedDescription", "You don't have permission to view this dashboard.")
527
+ })] }) : /* @__PURE__ */ v(Ee, {
528
+ title: d("bigconsole.dashboards.view.accessDeniedTitle", "Access Denied"),
529
+ description: d("bigconsole.dashboards.view.accessDeniedDescription", "You don't have permission to view this dashboard.")
501
530
  });
502
- }), Ne = () => (c(), null), b = u(function() {
531
+ }), Fe = () => (c(), null), x = d(function() {
503
532
  let { workspaceId: e } = r();
504
- return /* @__PURE__ */ _(ne, {
533
+ return /* @__PURE__ */ v(l, {
505
534
  workspaceId: e,
506
- children: /* @__PURE__ */ _(y, {})
535
+ children: /* @__PURE__ */ v(b, {})
507
536
  });
508
537
  });
509
- export { y as DashboardViewPage, b as default };
538
+ export { b as DashboardViewPage, x as default };