@burdenoff/microfe-bigconsole 2026.1124.2 → 2026.1124.3

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