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