@burdenoff/microfe-bigconsole 2026.1121.4 → 2026.1122.2

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