@burdenoff/microfe-bigconsole 2026.1118.5 → 2026.1118.6

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.
@@ -14,45 +14,45 @@ import { WidgetHeader as le } from "./WidgetHeader.js";
14
14
  import { useBigConsoleSettings as ue } from "../../hooks/useBigConsoleSettings.js";
15
15
  import { WidgetLoadingState as de } from "./states/LoadingState.js";
16
16
  import { WidgetErrorState as fe } from "./states/ErrorState.js";
17
- import { WidgetEmptyState as pe } from "./states/EmptyState.js";
18
- import { WidgetErrorBoundary as me } from "./WidgetErrorBoundary.js";
19
- import { hasCustomIframeConfig as he, hasRenderableCustomConfig as ge } from "./custom/config.js";
20
- import { getBindingForWidget as _e } from "../../utils/widgetBinding.js";
21
- import { filterMetaFromDashboard as ve, findInapplicableFilters as ye } from "../../utils/globalFilterMatching.js";
22
- import { applyGlobalFilters as be } from "../../utils/applyGlobalFilters.js";
23
- import { extractOutlierSeries as xe } from "../insights/outlierSeries.js";
24
- import { OutlierSpottingDialog as Se } from "../insights/OutlierSpottingDialog.js";
25
- import { canReconcileWidget as Ce } from "../reconcile/reconcileModel.js";
26
- import { isUsableWidgetData as we, resolveWidgetDisplayData as Te, widgetDataSourcePolicy as Ee, widgetExportRows as De } from "../../utils/widgetDisplayData.js";
27
- import { WidgetRendererFactory as Oe } from "../../renderers/factory/WidgetRendererFactory.js";
28
- import { WidgetActions as ke } from "./widget-actions/WidgetActions.js";
17
+ import { WidgetEmptyState as a } from "./states/EmptyState.js";
18
+ import { WidgetErrorBoundary as pe } from "./WidgetErrorBoundary.js";
19
+ import { hasCustomIframeConfig as me, hasRenderableCustomConfig as he } from "./custom/config.js";
20
+ import { getBindingForWidget as ge } from "../../utils/widgetBinding.js";
21
+ import { filterMetaFromDashboard as _e, findInapplicableFilters as ve } from "../../utils/globalFilterMatching.js";
22
+ import { applyGlobalFilters as ye } from "../../utils/applyGlobalFilters.js";
23
+ import { extractOutlierSeries as be } from "../insights/outlierSeries.js";
24
+ import { OutlierSpottingDialog as xe } from "../insights/OutlierSpottingDialog.js";
25
+ import { canReconcileWidget as Se } from "../reconcile/reconcileModel.js";
26
+ import { isUsableWidgetData as Ce, resolveWidgetDisplayData as we, widgetDataSourcePolicy as Te, widgetExportRows as Ee } from "../../utils/widgetDisplayData.js";
27
+ import { WidgetRendererFactory as De } from "../../renderers/factory/WidgetRendererFactory.js";
28
+ import { WidgetActions as Oe } from "./widget-actions/WidgetActions.js";
29
29
  import "./widget-actions/index.js";
30
- import { dashboardSuggestAnchorProps as Ae } from "../../proactive/entities.js";
31
- import { Suspense as a, lazy as o, memo as s, useCallback as c, useEffect as je, useMemo as l, useRef as u, useState as d } from "react";
32
- import { useI18n as Me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
33
- import { useQuery as Ne } from "@apollo/client/react";
34
- import { jsx as f, jsxs as Pe } from "react/jsx-runtime";
30
+ import { dashboardSuggestAnchorProps as ke } from "../../proactive/entities.js";
31
+ import { Suspense as o, lazy as s, memo as c, useCallback as l, useEffect as Ae, useMemo as u, useRef as d, useState as f } from "react";
32
+ import { useI18n as je } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
33
+ import { useQuery as Me } from "@apollo/client/react";
34
+ import { jsx as p, jsxs as Ne } from "react/jsx-runtime";
35
35
  // src/bigconsole/components/widgets/WidgetWrapper.tsx
36
- var Fe = o(() => import("../reconcile/KpiReconcileDialog.js").then((e) => ({ default: e.KpiReconcileDialog }))), Ie = o(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), Le = o(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), Re = o(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), ze = o(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), Be = o(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), Ve = o(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), He = o(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), Ue = o(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), We = o(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), Ge = o(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Ke = o(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), qe = o(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), Je = o(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Ye = o(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), Xe = o(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Ze = o(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), Qe = o(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget })));
37
- o(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
38
- var $e = o(() => import("./form/index.js").then((e) => ({ default: e.FormWidget }))), et = o(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), tt = o(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), nt = o(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))), rt = o(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments }))), it = /* @__PURE__ */ new Set([
36
+ var Pe = s(() => import("../reconcile/KpiReconcileDialog.js").then((e) => ({ default: e.KpiReconcileDialog }))), Fe = s(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), Ie = s(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), Le = s(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), Re = s(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), ze = s(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), Be = s(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), Ve = s(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), He = s(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), Ue = s(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), We = s(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Ge = s(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), Ke = s(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), qe = s(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Je = s(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), Ye = s(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Xe = s(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), Ze = s(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget })));
37
+ s(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget })));
38
+ var Qe = s(() => import("./form/index.js").then((e) => ({ default: e.FormWidget }))), $e = s(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), et = s(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), tt = s(() => import("./advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))), nt = s(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments }))), rt = /* @__PURE__ */ new Set([
39
39
  "text",
40
40
  "iframe",
41
41
  "form",
42
42
  "adaptive_card"
43
43
  ]);
44
- function p(e, t) {
44
+ function m(e, t) {
45
45
  return e.previewOnly === t.previewOnly && e.widget.id === t.widget.id && e.widget.updatedAt === t.widget.updatedAt && e.isLoading === t.isLoading && e.error === t.error && e.actions === t.actions && e.data === t.data && JSON.stringify(e.filterValues) === JSON.stringify(t.filterValues) && e.narrativeOpen === t.narrativeOpen && e.narrativePanel === t.narrativePanel;
46
46
  }
47
- var m = s(function({ widget: o, children: s, data: p, className: m = "", isLoading: at, error: ot, onRefresh: h, onDrilldown: st, actions: g, onAction: _, filterValues: v, onToggleNarrative: ct, narrativeOpen: y = !1, narrativePanel: lt, previewOnly: b = !1 }) {
48
- let x = ue(), ut = r((e) => e.viewMode === "edit"), S = !b && ut, C = t((e) => e.selectWidget), w = e(o.id), dt = n(o.id), T = ee(), { t: ft } = Me(), E = o.dashboardId, { data: pt } = Ne(ne, {
49
- variables: { id: E ?? "" },
50
- skip: !E,
47
+ var h = c(function({ widget: s, children: c, data: m, className: h = "", isLoading: it, error: g, onRefresh: _, onDrilldown: at, actions: v, onAction: y, filterValues: b, onToggleNarrative: ot, narrativeOpen: st = !1, narrativePanel: ct, previewOnly: x = !1 }) {
48
+ let S = ue(), lt = r((e) => e.viewMode === "edit"), C = !x && lt, w = t((e) => e.selectWidget), T = e(s.id), E = n(s.id), D = ee(), { t: ut } = je(), O = s.dashboardId, { data: dt } = Me(ne, {
49
+ variables: { id: O ?? "" },
50
+ skip: !O,
51
51
  fetchPolicy: "cache-only"
52
- }), D = pt?.getDashboard?.globalFilters, O = l(() => ve(D), [D]), k = l(() => Object.fromEntries(Object.entries(O).map(([e, t]) => [e, t.field])), [O]), A = l(() => _e(o), [o]), { hasDataSource: j, allowSamples: M, mockSource: N } = Ee(o, A), { data: P, loading: mt, error: ht } = te(o.id, {
53
- skip: b || !j,
54
- pollInterval: (o.refreshInterval ?? 0) * 1e3 || 0
55
- }), F = l(() => {
52
+ }), k = dt?.getDashboard?.globalFilters, A = u(() => _e(k), [k]), j = u(() => Object.fromEntries(Object.entries(A).map(([e, t]) => [e, t.field])), [A]), M = u(() => ge(s), [s]), { hasDataSource: N, allowSamples: P, mockSource: F } = Te(s, M), { data: I, loading: ft, error: pt } = te(s.id, {
53
+ skip: x || !N,
54
+ pollInterval: (s.refreshInterval ?? 0) * 1e3 || 0
55
+ }), L = u(() => {
56
56
  if (typeof window > "u") return {};
57
57
  let e = new URLSearchParams(window.location.search), t = {};
58
58
  return e.forEach((e, n) => {
@@ -61,101 +61,101 @@ var m = s(function({ widget: o, children: s, data: p, className: m = "", isLoadi
61
61
  r.startsWith("__") || (t[r] = e);
62
62
  }
63
63
  }), t;
64
- }, []), I = l(() => {
64
+ }, []), R = u(() => {
65
65
  let e = {};
66
- return F && Object.keys(F).length > 0 && Object.assign(e, F), T && Object.keys(T).length > 0 && Object.assign(e, T), v && Object.keys(v).length > 0 && Object.assign(e, v), e;
66
+ return L && Object.keys(L).length > 0 && Object.assign(e, L), D && Object.keys(D).length > 0 && Object.assign(e, D), b && Object.keys(b).length > 0 && Object.assign(e, b), e;
67
67
  }, [
68
- F,
69
- T,
70
- v
71
- ]), L = Object.keys(I).length > 0, R = at ?? (mt && !P) ?? dt.isLoading, z = ot ?? ht?.message ?? dt.errorMessage, gt = ce(o.type), B = u(h);
72
- je(() => {
73
- B.current = h;
74
- }, [h]);
75
- let _t = c(async () => {
76
- B.current && await B.current();
77
- }, []), { timeUntilRefresh: vt, isPaused: yt } = ie({
78
- widgetId: o.id,
79
- refreshInterval: o.refreshInterval,
80
- onRefresh: _t,
81
- enabled: !b && !S && !!o.refreshInterval
82
- }), V = u(null), [H, U] = d(!1), [W, bt] = d(!1), { count: xt } = ae(o.id, W), St = c(() => {
83
- bt(!0), U((e) => !e);
84
- }, []), G = l(() => Te({
85
- explicit: p,
86
- fetched: P,
87
- persisted: o.data,
88
- config: o.config,
89
- allowSamples: M,
90
- mockSource: N,
91
- widgetType: o.type
68
+ L,
69
+ D,
70
+ b
71
+ ]), z = Object.keys(R).length > 0, B = it ?? (ft && !I) ?? E.isLoading, V = g ?? pt?.message ?? E.errorMessage, mt = ce(s.type), H = d(_);
72
+ Ae(() => {
73
+ H.current = _;
74
+ }, [_]);
75
+ let ht = l(async () => {
76
+ H.current && await H.current();
77
+ }, []), { timeUntilRefresh: gt, isPaused: _t } = ie({
78
+ widgetId: s.id,
79
+ refreshInterval: s.refreshInterval,
80
+ onRefresh: ht,
81
+ enabled: !x && !C && !!s.refreshInterval
82
+ }), U = d(null), [W, vt] = f(!1), [yt, bt] = f(!1), { count: xt } = ae(s.id, yt), St = l(() => {
83
+ bt(!0), vt((e) => !e);
84
+ }, []), G = u(() => we({
85
+ explicit: m,
86
+ fetched: I,
87
+ persisted: s.data,
88
+ config: s.config,
89
+ allowSamples: P,
90
+ mockSource: F,
91
+ widgetType: s.type
92
92
  }), [
93
- p,
93
+ m,
94
+ I,
95
+ s,
94
96
  P,
95
- o,
96
- M,
97
- N
98
- ]), K = l(() => {
97
+ F
98
+ ]), K = u(() => {
99
99
  let e = G.data;
100
100
  if (e && typeof e == "object" && !Array.isArray(e)) {
101
- let t = o.config, n = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
101
+ let t = s.config, n = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
102
102
  if (n && typeof n == "string") {
103
103
  let t = n.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
104
- t != null && we(t) && (e = t);
104
+ t != null && Ce(t) && (e = t);
105
105
  }
106
106
  }
107
107
  return e;
108
- }, [G, o.config]), q = l(() => L ? be(K, {
109
- filterValues: I,
110
- filterFieldMap: k,
111
- widgetType: o.type
108
+ }, [G, s.config]), q = u(() => z ? ye(K, {
109
+ filterValues: R,
110
+ filterFieldMap: j,
111
+ widgetType: s.type
112
112
  }) : K, [
113
113
  K,
114
- L,
115
- I,
116
- k,
117
- o.type
118
- ]), Ct = q !== null && G.isSample, wt = l(() => it.has(o.type) ? [] : ye(K, O, I, o.type), [
114
+ z,
115
+ R,
116
+ j,
117
+ s.type
118
+ ]), Ct = q !== null && G.isSample, wt = u(() => rt.has(s.type) ? [] : ve(K, A, R, s.type), [
119
119
  K,
120
- O,
121
- I,
122
- o.type
123
- ]), Tt = l(() => De(q, o.type), [q, o.type]), Et = l(() => {
124
- let e = o.config;
125
- return xe(q, {
120
+ A,
121
+ R,
122
+ s.type
123
+ ]), Tt = u(() => Ee(q, s.type), [q, s.type]), Et = u(() => {
124
+ let e = s.config;
125
+ return be(q, {
126
126
  xAxisKey: typeof e?.xAxisKey == "string" ? e.xAxisKey : void 0,
127
127
  selectedFields: Array.isArray(e?.selectedFields) ? e.selectedFields.filter((e) => typeof e == "string") : void 0
128
128
  });
129
- }, [q, o.config]), [Dt, Ot] = d(!1), [kt, At] = d(!1), jt = Ce(o.type, b), { exportCSV: Mt, exportPNG: Nt } = oe(o, {
129
+ }, [q, s.config]), [Dt, Ot] = f(!1), [kt, At] = f(!1), jt = Se(s.type, x), { exportCSV: Mt, exportPNG: Nt } = oe(s, {
130
130
  data: Tt,
131
- containerRef: V
131
+ containerRef: U
132
132
  }), { executeDrilldown: Pt, canDrilldown: Ft } = se({ onDrilldown: (e, t) => {
133
- st?.(e);
134
- } }), J = l(() => Ft(o), [o, Ft]), It = c((e) => {
135
- if (!o.drilldown?.enabled) return;
133
+ at?.(e);
134
+ } }), J = u(() => Ft(s), [s, Ft]), It = l((e) => {
135
+ if (!s.drilldown?.enabled) return;
136
136
  let t = {
137
137
  selectedData: e || {},
138
- globalFilters: T || {},
138
+ globalFilters: D || {},
139
139
  widgetData: q || {},
140
140
  metadata: {
141
- widgetId: o.id,
142
- widgetType: o.type,
143
- widgetTitle: o.title
141
+ widgetId: s.id,
142
+ widgetType: s.type,
143
+ widgetTitle: s.title
144
144
  },
145
- sourceDashboardId: o.dashboardId
145
+ sourceDashboardId: s.dashboardId
146
146
  };
147
- Pt(o.drilldown, t);
147
+ Pt(s.drilldown, t);
148
148
  }, [
149
- o,
149
+ s,
150
150
  q,
151
- T,
151
+ D,
152
152
  Pt
153
- ]), Y = J && !S ? It : void 0, X = u(null), Lt = c((e) => {
153
+ ]), Y = J && !C ? It : void 0, X = d(null), Lt = l((e) => {
154
154
  X.current = {
155
155
  x: e.clientX,
156
156
  y: e.clientY
157
157
  };
158
- }, []), Rt = c((e) => {
158
+ }, []), Rt = l((e) => {
159
159
  if (e.stopPropagation(), X.current) {
160
160
  let t = Math.abs(e.clientX - X.current.x), n = Math.abs(e.clientY - X.current.y);
161
161
  if (t > 5 || n > 5) {
@@ -163,44 +163,44 @@ var m = s(function({ widget: o, children: s, data: p, className: m = "", isLoadi
163
163
  return;
164
164
  }
165
165
  }
166
- X.current = null, S && C(o.id);
166
+ X.current = null, C && w(s.id);
167
167
  }, [
168
- S,
169
168
  C,
170
- o.id
171
- ]), zt = c((e) => {
172
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), S && C(o.id));
169
+ w,
170
+ s.id
171
+ ]), zt = l((e) => {
172
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), C && w(s.id));
173
173
  }, [
174
- S,
175
174
  C,
176
- o.id
177
- ]), Bt = l(() => o.type === "custom" && ge(o.config), [o.type, o.config]), Vt = l(() => o.type === "custom" && he(o.config), [o.type, o.config]), Z = J && !Vt, Ht = l(() => o.type === "text" && i(o.config, q).hasContent, [
178
- o.type,
179
- o.config,
175
+ w,
176
+ s.id
177
+ ]), Bt = u(() => s.type === "custom" && he(s.config), [s.type, s.config]), Vt = u(() => s.type === "custom" && me(s.config), [s.type, s.config]), Z = J && !Vt, Ht = u(() => s.type === "text" && i(s.config, q).hasContent, [
178
+ s.type,
179
+ s.config,
180
180
  q
181
- ]), Ut = !R && !z && !q && !Bt && !Ht, Q = l(() => o.renderer, [o]), Wt = l(() => Q && Q !== "BIGCONSOLE", [Q]), Gt = l(() => ({
182
- widgetId: o.id,
181
+ ]), Ut = !B && !V && !q && !Bt && !Ht, Q = u(() => s.renderer, [s]), Wt = u(() => Q && Q !== "BIGCONSOLE", [Q]), Gt = u(() => ({
182
+ widgetId: s.id,
183
183
  data: q || {}
184
- }), [o.id, q]), $ = c((e, t) => {
185
- if (!_) return;
186
- let n = g?.find((t) => t.name === e.name);
187
- _(n || e, t);
188
- }, [_, g]), Kt = c(() => {
184
+ }), [s.id, q]), $ = l((e, t) => {
185
+ if (!y) return;
186
+ let n = v?.find((t) => t.name === e.name);
187
+ y(n || e, t);
188
+ }, [y, v]), Kt = l(() => {
189
189
  let e = (() => {
190
190
  if (!q) return q;
191
- if (o.type === "pivot_table") {
191
+ if (s.type === "pivot_table") {
192
192
  if (Array.isArray(q)) return q;
193
193
  if (q && typeof q == "object" && "rows" in q) return q.rows;
194
194
  }
195
- if (o.type === "list") {
195
+ if (s.type === "list") {
196
196
  if (Array.isArray(q)) return q;
197
197
  if (q && typeof q == "object" && "items" in q) return q.items;
198
198
  }
199
- if (o.type === "funnel_chart") {
199
+ if (s.type === "funnel_chart") {
200
200
  if (Array.isArray(q)) return q;
201
201
  if (q && typeof q == "object" && "stages" in q) return q.stages;
202
202
  }
203
- if (o.type === "chart") {
203
+ if (s.type === "chart") {
204
204
  if (Array.isArray(q)) return q;
205
205
  if (q && typeof q == "object" && "datasets" in q) {
206
206
  let e = q;
@@ -212,269 +212,269 @@ var m = s(function({ widget: o, children: s, data: p, className: m = "", isLoadi
212
212
  });
213
213
  }
214
214
  }
215
- if (o.type === "text") {
216
- let e = i(o.config, q);
215
+ if (s.type === "text") {
216
+ let e = i(s.config, q);
217
217
  return {
218
218
  content: e.content,
219
219
  format: e.format,
220
220
  alignment: e.alignment
221
221
  };
222
222
  }
223
- if (o.type === "custom") {
224
- let e = o.config?.valueField;
223
+ if (s.type === "custom") {
224
+ let e = s.config?.valueField;
225
225
  if (e && q && typeof q == "object" && !Array.isArray(q)) {
226
226
  let t = q;
227
227
  if (e in t) return {
228
228
  value: t[e],
229
- label: o.title,
229
+ label: s.title,
230
230
  data: t
231
231
  };
232
232
  }
233
233
  }
234
234
  return q;
235
235
  })(), t = {
236
- widget: o,
236
+ widget: s,
237
237
  onDrilldown: Y
238
238
  };
239
239
  if (Wt) {
240
240
  let e = {};
241
- if (q && typeof q == "object" && !Array.isArray(q) && Object.keys(q).length > 0 && (e = { ...q }), o.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
242
- let t = o.config?.valueField;
241
+ if (q && typeof q == "object" && !Array.isArray(q) && Object.keys(q).length > 0 && (e = { ...q }), s.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
242
+ let t = s.config?.valueField;
243
243
  if (t && t in e) {
244
244
  let n = e[t], r = typeof n == "number" ? n.toLocaleString() : String(n);
245
245
  e = {
246
246
  ...e,
247
247
  value: n,
248
248
  title: e.title || r,
249
- description: e.description || o.title || "",
249
+ description: e.description || s.title || "",
250
250
  text: e.text || r
251
251
  };
252
252
  }
253
253
  }
254
- return /* @__PURE__ */ f(Oe, {
255
- widget: o,
254
+ return /* @__PURE__ */ p(De, {
255
+ widget: s,
256
256
  data: e,
257
- isEditMode: S,
258
- isSelected: w,
259
- isLoading: R,
260
- error: z,
257
+ isEditMode: C,
258
+ isSelected: T,
259
+ isLoading: B,
260
+ error: V,
261
261
  onDrilldown: Y,
262
262
  onAction: $
263
263
  });
264
264
  }
265
- switch (o.type?.toLowerCase() || "") {
266
- case "metric_card": return /* @__PURE__ */ f(Ie, {
265
+ switch (s.type?.toLowerCase() || "") {
266
+ case "metric_card": return /* @__PURE__ */ p(Fe, {
267
267
  ...t,
268
268
  data: e
269
269
  });
270
- case "kpi_card_comparison": return /* @__PURE__ */ f(Je, {
270
+ case "kpi_card_comparison": return /* @__PURE__ */ p(qe, {
271
271
  ...t,
272
272
  data: e
273
273
  });
274
274
  case "chart":
275
- case "funnel_chart": return /* @__PURE__ */ f(Le, {
275
+ case "funnel_chart": return /* @__PURE__ */ p(Ie, {
276
276
  ...t,
277
277
  data: e
278
278
  });
279
- case "waterfall": return /* @__PURE__ */ f(nt, {
279
+ case "waterfall": return /* @__PURE__ */ p(tt, {
280
280
  ...t,
281
281
  data: e
282
282
  });
283
- case "sankey": return /* @__PURE__ */ f(et, {
283
+ case "sankey": return /* @__PURE__ */ p($e, {
284
284
  ...t,
285
285
  data: e
286
286
  });
287
- case "box_plot": return /* @__PURE__ */ f(tt, {
287
+ case "box_plot": return /* @__PURE__ */ p(et, {
288
288
  ...t,
289
289
  data: e
290
290
  });
291
- case "table": return /* @__PURE__ */ f(Re, {
291
+ case "table": return /* @__PURE__ */ p(Le, {
292
292
  ...t,
293
293
  data: e
294
294
  });
295
- case "pivot_table": return /* @__PURE__ */ f(ze, {
295
+ case "pivot_table": return /* @__PURE__ */ p(Re, {
296
296
  ...t,
297
297
  data: e
298
298
  });
299
- case "gauge": return /* @__PURE__ */ f(Be, {
299
+ case "gauge": return /* @__PURE__ */ p(ze, {
300
300
  ...t,
301
301
  data: e
302
302
  });
303
- case "progress": return /* @__PURE__ */ f(Ve, {
303
+ case "progress": return /* @__PURE__ */ p(Be, {
304
304
  ...t,
305
305
  data: e
306
306
  });
307
- case "list": return /* @__PURE__ */ f(He, {
307
+ case "list": return /* @__PURE__ */ p(Ve, {
308
308
  ...t,
309
309
  data: e
310
310
  });
311
- case "heatmap": return /* @__PURE__ */ f(Ue, {
311
+ case "heatmap": return /* @__PURE__ */ p(He, {
312
312
  ...t,
313
313
  data: e
314
314
  });
315
- case "retention": return /* @__PURE__ */ f(We, {
315
+ case "retention": return /* @__PURE__ */ p(Ue, {
316
316
  ...t,
317
317
  data: e
318
318
  });
319
- case "calendar": return /* @__PURE__ */ f(Ge, {
319
+ case "calendar": return /* @__PURE__ */ p(We, {
320
320
  ...t,
321
321
  data: e
322
322
  });
323
- case "timeline": return /* @__PURE__ */ f(qe, {
323
+ case "timeline": return /* @__PURE__ */ p(Ke, {
324
324
  ...t,
325
325
  data: e
326
326
  });
327
- case "kanban": return /* @__PURE__ */ f(Ke, {
327
+ case "kanban": return /* @__PURE__ */ p(Ge, {
328
328
  ...t,
329
329
  data: e
330
330
  });
331
- case "form": return /* @__PURE__ */ f($e, {
331
+ case "form": return /* @__PURE__ */ p(Qe, {
332
332
  ...t,
333
333
  data: e
334
334
  });
335
- case "text": return /* @__PURE__ */ f(Ye, {
335
+ case "text": return /* @__PURE__ */ p(Je, {
336
336
  ...t,
337
337
  data: e
338
338
  });
339
- case "iframe": return /* @__PURE__ */ f(Ze, {
339
+ case "iframe": return /* @__PURE__ */ p(Xe, {
340
340
  ...t,
341
341
  data: e
342
342
  });
343
- case "map": return /* @__PURE__ */ f(Xe, {
343
+ case "map": return /* @__PURE__ */ p(Ye, {
344
344
  ...t,
345
345
  data: e
346
346
  });
347
- case "custom": return /* @__PURE__ */ f(Qe, {
347
+ case "custom": return /* @__PURE__ */ p(Ze, {
348
348
  ...t,
349
349
  data: e
350
350
  });
351
- default: return s || /* @__PURE__ */ f(pe, { widgetType: o.type });
351
+ default: return c || /* @__PURE__ */ p(a, { widgetType: s.type });
352
352
  }
353
353
  }, [
354
- o,
355
- q,
356
354
  s,
355
+ q,
356
+ c,
357
357
  Y,
358
358
  Wt,
359
- S,
360
- w,
361
- R,
362
- z,
359
+ C,
360
+ T,
361
+ B,
362
+ V,
363
363
  $
364
364
  ]), qt = () => {
365
- if (R) return /* @__PURE__ */ f(de, {});
366
- if (z) return /* @__PURE__ */ f(fe, {
367
- error: z,
368
- onRetry: h
365
+ if (B) return /* @__PURE__ */ p(de, {});
366
+ if (V) return /* @__PURE__ */ p(fe, {
367
+ error: V,
368
+ onRetry: _
369
369
  });
370
- if (Ut && !s) return /* @__PURE__ */ f(pe, {
371
- widgetType: o.type,
372
- hideEditHint: b,
373
- hasDataSource: j,
374
- compact: (o.position?.height ?? o.positionHeight ?? 4) <= 2,
375
- templateSlot: typeof o.metadata?.templateDataSinkSlot == "string" ? o.metadata.templateDataSinkSlot : null
370
+ if (Ut && !c) return /* @__PURE__ */ p(a, {
371
+ widgetType: s.type,
372
+ hideEditHint: x,
373
+ hasDataSource: N,
374
+ compact: (s.position?.height ?? s.positionHeight ?? 4) <= 2,
375
+ templateSlot: typeof s.metadata?.templateDataSinkSlot == "string" ? s.metadata.templateDataSinkSlot : null
376
376
  });
377
- let e = `${A.source.kind}|${A.source.ref ?? ""}|${A.parserId ?? ""}|${o.updatedAt ?? ""}`;
378
- return /* @__PURE__ */ f(me, {
379
- widgetId: o.id,
380
- widgetType: o.type,
381
- widgetTitle: o.title,
377
+ let e = `${M.source.kind}|${M.source.ref ?? ""}|${M.parserId ?? ""}|${s.updatedAt ?? ""}`;
378
+ return /* @__PURE__ */ p(pe, {
379
+ widgetId: s.id,
380
+ widgetType: s.type,
381
+ widgetTitle: s.title,
382
382
  resetKey: e,
383
- children: s ?? /* @__PURE__ */ f(a, {
384
- fallback: /* @__PURE__ */ f(de, {}),
383
+ children: c ?? /* @__PURE__ */ p(o, {
384
+ fallback: /* @__PURE__ */ p(de, {}),
385
385
  children: Kt()
386
386
  })
387
387
  });
388
388
  };
389
- return /* @__PURE__ */ Pe("div", {
390
- ref: V,
391
- ...b ? {} : Ae(o.dashboardId, o.id),
389
+ return /* @__PURE__ */ Ne("div", {
390
+ ref: U,
391
+ ...x ? {} : ke(s.dashboardId, s.id),
392
392
  className: `
393
393
  group relative flex flex-col
394
394
  h-full w-full min-w-0
395
395
  rounded-card border
396
396
  bg-bg-surface
397
397
  shadow-[var(--shadow-elevation-1)]
398
- ${x.animationsEnabled ? "motion-safe:transition-[box-shadow,border-color] motion-safe:duration-200" : ""}
399
- ${w && S ? "border-[var(--color-action-primary-border)] ring-2 ring-[var(--color-action-primary-border)]/30 shadow-[var(--shadow-elevation-2)]" : x.showWidgetBorders ? "border-[var(--color-border-subtle)] hover:border-action-primary-bg hover:shadow-[var(--shadow-elevation-2)]" : "border-transparent"}
400
- ${S ? "cursor-pointer" : ""}
401
- ${m}
398
+ ${S.animationsEnabled ? "motion-safe:transition-[box-shadow,border-color] motion-safe:duration-200" : ""}
399
+ ${T && C ? "border-[var(--color-action-primary-border)] ring-2 ring-[var(--color-action-primary-border)]/30 shadow-[var(--shadow-elevation-2)]" : S.showWidgetBorders ? "border-[var(--color-border-subtle)] hover:border-action-primary-bg hover:shadow-[var(--shadow-elevation-2)]" : "border-transparent"}
400
+ ${C ? "cursor-pointer" : ""}
401
+ ${h}
402
402
  `,
403
403
  onMouseDown: Lt,
404
404
  onClick: Rt,
405
405
  onKeyDown: zt,
406
- tabIndex: S ? 0 : -1,
407
- role: S ? "button" : void 0,
408
- "aria-selected": w,
409
- "aria-label": `Widget: ${o.title}`,
410
- "data-widget-id": o.id,
411
- "data-widget-type": o.type,
406
+ tabIndex: C ? 0 : -1,
407
+ role: C ? "button" : void 0,
408
+ "aria-selected": T,
409
+ "aria-label": `Widget: ${s.title}`,
410
+ "data-widget-id": s.id,
411
+ "data-widget-type": s.type,
412
412
  children: [
413
- /* @__PURE__ */ f(le, {
414
- widget: o,
415
- previewOnly: b,
416
- definition: gt,
417
- isSelected: w,
418
- isEditMode: S,
419
- isLoading: R,
413
+ /* @__PURE__ */ p(le, {
414
+ widget: s,
415
+ previewOnly: x,
416
+ definition: mt,
417
+ isSelected: T,
418
+ isEditMode: C,
419
+ isLoading: B,
420
420
  isSampleData: Ct,
421
- timeUntilRefresh: o.refreshInterval && !yt ? re(vt) : void 0,
421
+ timeUntilRefresh: s.refreshInterval && !_t ? re(gt) : void 0,
422
422
  hasDrilldown: J,
423
- onRefresh: h,
423
+ onRefresh: _,
424
424
  onExportCSV: Tt ? Mt : void 0,
425
425
  onExportPNG: Nt,
426
426
  onDrilldown: Y ? () => Y() : void 0,
427
- onToggleComments: b ? void 0 : St,
428
- commentsOpen: H,
429
- commentCount: W ? xt : void 0,
430
- onExplain: b ? void 0 : ct,
431
- explainOpen: y,
427
+ onToggleComments: x ? void 0 : St,
428
+ commentsOpen: W,
429
+ commentCount: yt ? xt : void 0,
430
+ onExplain: x ? void 0 : ot,
431
+ explainOpen: st,
432
432
  onSpotOutliers: Et.length > 0 ? () => Ot(!0) : void 0,
433
433
  onReconcile: jt ? () => At(!0) : void 0
434
434
  }),
435
- y && lt,
436
- wt.length > 0 && /* @__PURE__ */ f("div", {
435
+ st && ct,
436
+ wt.length > 0 && /* @__PURE__ */ p("div", {
437
437
  role: "status",
438
438
  "data-testid": "widget-filter-not-applicable",
439
439
  className: "mx-3 mt-2 rounded bg-status-warning-bg-subtle px-2 py-1 text-xs text-status-warning-text",
440
- children: wt.map((e) => ft("bigconsole.widget.filterNotApplicable", "Filter '{{name}}' does not apply to this widget (no field '{{field}}')", {
440
+ children: wt.map((e) => ut("bigconsole.widget.filterNotApplicable", "Filter '{{name}}' does not apply to this widget (no field '{{field}}')", {
441
441
  name: e.name,
442
442
  field: e.field
443
443
  })).join(" ")
444
444
  }),
445
- /* @__PURE__ */ f("div", {
445
+ /* @__PURE__ */ p("div", {
446
446
  className: `
447
447
  flex-1 overflow-hidden min-h-0 min-w-0
448
- ${x.compactMode ? "p-2" : "p-3 sm:p-4"}
449
- ${Z && !S ? "cursor-pointer" : ""}
448
+ ${S.compactMode ? "p-2" : "p-3 sm:p-4"}
449
+ ${Z && !C ? "cursor-pointer" : ""}
450
450
  `,
451
- title: Z && !S ? "Click data to drill down" : void 0,
452
- children: /* @__PURE__ */ f("div", {
451
+ title: Z && !C ? "Click data to drill down" : void 0,
452
+ children: /* @__PURE__ */ p("div", {
453
453
  className: "h-full min-w-0 overflow-auto",
454
454
  children: qt()
455
455
  })
456
456
  }),
457
- g && g.length > 0 && !R && !z && /* @__PURE__ */ f("div", {
457
+ v && v.length > 0 && !B && !V && /* @__PURE__ */ p("div", {
458
458
  className: "min-w-0 border-t border-[var(--color-border-subtle)] bg-bg-sunken px-3 py-2 sm:px-4",
459
459
  style: { flexShrink: 0 },
460
- children: /* @__PURE__ */ f(ke, {
461
- actions: g,
460
+ children: /* @__PURE__ */ p(Oe, {
461
+ actions: v,
462
462
  context: Gt,
463
- onAction: _,
464
- disabled: S,
463
+ onAction: y,
464
+ disabled: C,
465
465
  layout: "horizontal",
466
466
  size: "sm"
467
467
  })
468
468
  }),
469
- Z && !S && /* @__PURE__ */ f("div", {
469
+ Z && !C && /* @__PURE__ */ p("div", {
470
470
  className: "\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n ",
471
471
  title: "Click to drill down",
472
- children: /* @__PURE__ */ f("svg", {
472
+ children: /* @__PURE__ */ p("svg", {
473
473
  className: "w-4 h-4 text-text-secondary",
474
474
  fill: "none",
475
475
  stroke: "currentColor",
476
476
  viewBox: "0 0 24 24",
477
- children: /* @__PURE__ */ f("path", {
477
+ children: /* @__PURE__ */ p("path", {
478
478
  strokeLinecap: "round",
479
479
  strokeLinejoin: "round",
480
480
  strokeWidth: 2,
@@ -482,28 +482,37 @@ var m = s(function({ widget: o, children: s, data: p, className: m = "", isLoadi
482
482
  })
483
483
  })
484
484
  }),
485
- H && /* @__PURE__ */ f(a, {
485
+ W && /* @__PURE__ */ p(o, {
486
486
  fallback: null,
487
- children: /* @__PURE__ */ f(rt, {
488
- widgetId: o.id,
489
- onClose: () => U(!1)
487
+ children: /* @__PURE__ */ p(nt, {
488
+ widgetId: s.id,
489
+ onClose: () => vt(!1)
490
490
  })
491
491
  }),
492
- /* @__PURE__ */ f(Se, {
492
+ /* @__PURE__ */ p(xe, {
493
493
  open: Dt,
494
494
  onClose: () => Ot(!1),
495
- widgetTitle: o.title,
495
+ widgetTitle: s.title,
496
496
  series: Et
497
497
  }),
498
- kt && /* @__PURE__ */ f(a, {
498
+ kt && /* @__PURE__ */ p(o, {
499
499
  fallback: null,
500
- children: /* @__PURE__ */ f(Fe, {
500
+ children: /* @__PURE__ */ p(Pe, {
501
501
  open: kt,
502
502
  onClose: () => At(!1),
503
- widget: o
503
+ widget: s
504
504
  })
505
505
  })
506
506
  ]
507
507
  });
508
- }, p);
509
- export { m as WidgetWrapper, m as default };
508
+ }, m), it = s(() => import("../explore/SavedQueryWidget.js").then((e) => ({ default: e.SavedQueryWidget }))), g = (e) => e.widget.savedQueryId ? /* @__PURE__ */ p(o, {
509
+ fallback: /* @__PURE__ */ p("span", {
510
+ role: "status",
511
+ children: "Loading widget…"
512
+ }),
513
+ children: /* @__PURE__ */ p(it, {
514
+ id: e.widget.id,
515
+ title: e.widget.title
516
+ })
517
+ }) : /* @__PURE__ */ p(h, { ...e });
518
+ export { g as WidgetWrapper, g as default };