@burdenoff/microfe-bigconsole 2026.712.1 → 2026.713.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.
Files changed (38) hide show
  1. package/dist/bigconsole/assistant/createSandboxAssistantTransport.js +144 -69
  2. package/dist/bigconsole/assistant/createSandboxAssistantTransport.js.map +1 -1
  3. package/dist/bigconsole/components/builder/BuilderCanvas.js +21 -0
  4. package/dist/bigconsole/components/builder/BuilderCanvas.js.map +1 -0
  5. package/dist/bigconsole/components/builder/BuilderTopbar.js +33 -0
  6. package/dist/bigconsole/components/builder/BuilderTopbar.js.map +1 -0
  7. package/dist/bigconsole/components/builder/DashboardEditorShell.js +20 -0
  8. package/dist/bigconsole/components/builder/DashboardEditorShell.js.map +1 -0
  9. package/dist/bigconsole/components/builder/WidgetInspector.js +14 -0
  10. package/dist/bigconsole/components/builder/WidgetInspector.js.map +1 -0
  11. package/dist/bigconsole/components/builder/index.js +4 -0
  12. package/dist/bigconsole/components/builder/inspector/AdvancedSection.js +45 -0
  13. package/dist/bigconsole/components/builder/inspector/AdvancedSection.js.map +1 -0
  14. package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +43 -0
  15. package/dist/bigconsole/components/builder/inspector/AppearanceSection.js.map +1 -0
  16. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +124 -0
  17. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js.map +1 -0
  18. package/dist/bigconsole/components/builder/inspector/GeneralSection.js +50 -0
  19. package/dist/bigconsole/components/builder/inspector/GeneralSection.js.map +1 -0
  20. package/dist/bigconsole/components/builder/inspector/index.js +4 -0
  21. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +221 -199
  22. package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
  23. package/dist/bigconsole/components/dashboard/WidgetPalette.js +145 -102
  24. package/dist/bigconsole/components/dashboard/WidgetPalette.js.map +1 -1
  25. package/dist/bigconsole/components/dashboard/index.js +4 -0
  26. package/dist/bigconsole/components/widgets/PropertiesPanel.js +529 -742
  27. package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
  28. package/dist/bigconsole/components/widgets/WidgetWrapper.js +227 -226
  29. package/dist/bigconsole/components/widgets/WidgetWrapper.js.map +1 -1
  30. package/dist/bigconsole/pages/DashboardBuilderPage.js +221 -316
  31. package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
  32. package/dist/bigconsole/utils/widgetBinding.js +115 -0
  33. package/dist/bigconsole/utils/widgetBinding.js.map +1 -0
  34. package/package.json +2 -2
  35. package/dist/bigconsole/components/widgets/WidgetConfigDialog.js +0 -883
  36. package/dist/bigconsole/components/widgets/WidgetConfigDialog.js.map +0 -1
  37. package/dist/bigconsole/components/widgets/WidgetTypeSelector.js +0 -311
  38. package/dist/bigconsole/components/widgets/WidgetTypeSelector.js.map +0 -1
@@ -7,26 +7,24 @@ import i from "../../hooks/useWidgetActions.js";
7
7
  import a from "../../hooks/useDataSinkOperations.js";
8
8
  import o from "../../hooks/useParserOperations.js";
9
9
  import "../../hooks/index.js";
10
- import s from "./chart/ChartConfig.js";
11
- import c from "./gauge/GaugeConfig.js";
12
- import l from "./list/ListConfig.js";
13
- import u from "./metric-card/MetricCardConfig.js";
14
- import d from "./progress/ProgressConfig.js";
15
- import f from "./table/TableConfig.js";
16
- import ee from "../parser/DataSinkSelector.js";
17
- import te from "../parser/ParserSelector.js";
18
- import ne from "./ActionConfigDialog.js";
19
- import re from "./webhook-config/WebhookConfigPanel.js";
10
+ import { getWidgetBinding as s, getWidgetBindingStatus as c, serializeWidgetBinding as ee } from "../../utils/widgetBinding.js";
11
+ import te from "./ActionConfigDialog.js";
12
+ import ne from "./webhook-config/WebhookConfigPanel.js";
20
13
  import "./webhook-config/index.js";
21
- import ie from "./event-logs/EventLogViewer.js";
14
+ import re from "./event-logs/EventLogViewer.js";
22
15
  import "./event-logs/index.js";
23
- import ae from "./DrilldownConfigPanel.js";
24
- import { memo as p, useCallback as m, useEffect as h, useRef as g, useState as _ } from "react";
25
- import { Check as v, ChevronDown as oe, ChevronUp as se, ExternalLink as y, Info as b, Pencil as ce, Plus as le, Trash2 as ue, X as x } from "lucide-react";
26
- import { Button as S, Card as de, CardContent as fe, Input as C, Label as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Sheet as pe, SheetContent as me, SheetDescription as he, SheetHeader as ge, SheetTitle as _e, Spinner as A, Tabs as ve, TabsContent as j, TabsList as ye, TabsTrigger as M, Textarea as N } from "@burdenoff/fe-libs/ui";
27
- import { Fragment as be, jsx as P, jsxs as F } from "react/jsx-runtime";
16
+ import ie from "./DrilldownConfigPanel.js";
17
+ import { AdvancedSection as ae } from "../builder/inspector/AdvancedSection.js";
18
+ import { AppearanceSection as oe } from "../builder/inspector/AppearanceSection.js";
19
+ import { GeneralSection as se } from "../builder/inspector/GeneralSection.js";
20
+ import { DataBindingSection as ce } from "../builder/inspector/DataBindingSection.js";
21
+ import "../builder/inspector/index.js";
22
+ import { memo as l, useCallback as u, useEffect as d, useRef as le, useState as f } from "react";
23
+ import { Check as p, ChevronDown as ue, ChevronUp as de, ExternalLink as m, Info as h, Pencil as fe, Plus as pe, Trash2 as me, X as g } from "lucide-react";
24
+ import { Button as _, Card as he, CardContent as ge, Input as v, Label as y, Select as b, SelectContent as x, SelectItem as S, SelectTrigger as C, SelectValue as w, Sheet as _e, SheetContent as ve, SheetDescription as ye, SheetHeader as be, SheetTitle as xe, Spinner as T, Tabs as Se, TabsContent as E, TabsList as Ce, TabsTrigger as D, Textarea as O } from "@burdenoff/fe-libs/ui";
25
+ import { Fragment as we, jsx as k, jsxs as A } from "react/jsx-runtime";
28
26
  //#region src/bigconsole/components/widgets/PropertiesPanel.tsx
29
- var xe = [
27
+ var Te = [
30
28
  {
31
29
  value: "BIGCONSOLE",
32
30
  label: "BigConsole Native",
@@ -47,7 +45,7 @@ var xe = [
47
45
  label: "Custom",
48
46
  description: "Custom React component"
49
47
  }
50
- ], Se = [
48
+ ], Ee = [
51
49
  {
52
50
  value: "DATASINK",
53
51
  label: "DataSink",
@@ -78,14 +76,14 @@ var xe = [
78
76
  label: "Sample JSON",
79
77
  description: "Manually enter sample JSON data"
80
78
  }
81
- ], Ce = {
79
+ ], De = {
82
80
  PRIMARY: "bg-action-primary",
83
81
  SECONDARY: "bg-muted-foreground",
84
82
  SUCCESS: "bg-state-success",
85
83
  WARNING: "bg-state-warning",
86
84
  DANGER: "bg-state-error"
87
85
  };
88
- function we(e) {
86
+ function Oe(e) {
89
87
  if (!e) return {};
90
88
  let t = Array.isArray(e) ? e[0] : e;
91
89
  if (!t || typeof t != "object") return {};
@@ -129,30 +127,16 @@ function we(e) {
129
127
  xAxisField: a
130
128
  };
131
129
  }
132
- function Te(e) {
133
- switch (e) {
134
- case "metric_card":
135
- case "kpi_card_comparison": return u;
136
- case "chart":
137
- case "funnel_chart": return s;
138
- case "table":
139
- case "pivot_table": return f;
140
- case "gauge": return c;
141
- case "progress": return d;
142
- case "list": return l;
143
- default: return null;
144
- }
145
- }
146
- var Ee = p(function({ widget: e, onSave: t }) {
147
- let [n, r] = _(""), [i, a] = _(null), o = g(!1);
148
- h(() => {
130
+ var ke = l(function({ widget: e, onSave: t }) {
131
+ let [n, r] = f(""), [i, a] = f(null), o = le(!1);
132
+ d(() => {
149
133
  try {
150
134
  r(e.template && typeof e.template == "object" ? JSON.stringify(e.template, null, 2) : ""), a(null), o.current = !0;
151
135
  } catch {
152
136
  r("");
153
137
  }
154
138
  }, [e.id, e.template]);
155
- let s = m((e) => {
139
+ let s = u((e) => {
156
140
  let n = e.target.value;
157
141
  if (r(n), n.trim() === "") a(null), t({});
158
142
  else try {
@@ -161,7 +145,7 @@ var Ee = p(function({ widget: e, onSave: t }) {
161
145
  } catch (e) {
162
146
  a(e.message);
163
147
  }
164
- }, [t]), c = m(() => {
148
+ }, [t]), c = u(() => {
165
149
  try {
166
150
  let e = JSON.parse(n);
167
151
  r(JSON.stringify(e, null, 2)), a(null), t(e);
@@ -169,27 +153,27 @@ var Ee = p(function({ widget: e, onSave: t }) {
169
153
  a(e.message);
170
154
  }
171
155
  }, [n, t]);
172
- return /* @__PURE__ */ F("div", {
156
+ return /* @__PURE__ */ A("div", {
173
157
  style: {
174
158
  paddingTop: "var(--space-formGap)",
175
159
  borderTop: "1px solid var(--color-border)"
176
160
  },
177
161
  children: [
178
- /* @__PURE__ */ F("div", {
162
+ /* @__PURE__ */ A("div", {
179
163
  style: {
180
164
  display: "flex",
181
165
  alignItems: "center",
182
166
  justifyContent: "space-between",
183
167
  marginBottom: "var(--space-controlGap)"
184
168
  },
185
- children: [/* @__PURE__ */ P("label", {
169
+ children: [/* @__PURE__ */ k("label", {
186
170
  style: {
187
171
  fontSize: "var(--font-size-body-sm)",
188
172
  fontWeight: "var(--font-weight-semibold)",
189
173
  color: "var(--color-text-primary)"
190
174
  },
191
175
  children: "Template (JSON)"
192
- }), i && /* @__PURE__ */ P("span", {
176
+ }), i && /* @__PURE__ */ k("span", {
193
177
  style: {
194
178
  fontSize: "var(--font-size-body-sm)",
195
179
  color: "var(--color-status-error-text)",
@@ -198,7 +182,7 @@ var Ee = p(function({ widget: e, onSave: t }) {
198
182
  children: "Invalid JSON"
199
183
  })]
200
184
  }),
201
- /* @__PURE__ */ P(N, {
185
+ /* @__PURE__ */ k(O, {
202
186
  value: n,
203
187
  onChange: s,
204
188
  spellCheck: !1,
@@ -211,7 +195,7 @@ var Ee = p(function({ widget: e, onSave: t }) {
211
195
  resize: "vertical"
212
196
  }
213
197
  }),
214
- i && /* @__PURE__ */ P("p", {
198
+ i && /* @__PURE__ */ k("p", {
215
199
  style: {
216
200
  fontSize: "var(--font-size-body-sm)",
217
201
  color: "var(--color-status-error-text)",
@@ -222,14 +206,14 @@ var Ee = p(function({ widget: e, onSave: t }) {
222
206
  },
223
207
  children: i
224
208
  }),
225
- /* @__PURE__ */ F("div", {
209
+ /* @__PURE__ */ A("div", {
226
210
  style: {
227
211
  display: "flex",
228
212
  alignItems: "center",
229
213
  gap: "var(--space-controlGap)",
230
214
  marginTop: "var(--space-controlGap)"
231
215
  },
232
- children: [/* @__PURE__ */ P(S, {
216
+ children: [/* @__PURE__ */ k(_, {
233
217
  variant: "outline",
234
218
  size: "sm",
235
219
  onClick: c,
@@ -239,7 +223,7 @@ var Ee = p(function({ widget: e, onSave: t }) {
239
223
  fontWeight: "var(--font-weight-semibold)"
240
224
  },
241
225
  children: "Format"
242
- }), !i && n.trim() !== "" && /* @__PURE__ */ F("span", {
226
+ }), !i && n.trim() !== "" && /* @__PURE__ */ A("span", {
243
227
  style: {
244
228
  fontSize: "var(--font-size-body-sm)",
245
229
  color: "var(--color-status-success-text)",
@@ -247,13 +231,13 @@ var Ee = p(function({ widget: e, onSave: t }) {
247
231
  alignItems: "center",
248
232
  gap: "4px"
249
233
  },
250
- children: [/* @__PURE__ */ P(v, { style: {
234
+ children: [/* @__PURE__ */ k(p, { style: {
251
235
  width: "12px",
252
236
  height: "12px"
253
237
  } }), "Valid JSON"]
254
238
  })]
255
239
  }),
256
- /* @__PURE__ */ F("div", {
240
+ /* @__PURE__ */ A("div", {
257
241
  style: {
258
242
  display: "flex",
259
243
  alignItems: "center",
@@ -265,11 +249,11 @@ var Ee = p(function({ widget: e, onSave: t }) {
265
249
  borderTop: "1px solid var(--color-border)"
266
250
  },
267
251
  children: [
268
- /* @__PURE__ */ P("span", {
252
+ /* @__PURE__ */ k("span", {
269
253
  style: { fontWeight: "var(--font-weight-medium)" },
270
254
  children: "Ctrl+S to save"
271
255
  }),
272
- e.renderer === "ADAPTIVE_CARD" && /* @__PURE__ */ F("a", {
256
+ e.renderer === "ADAPTIVE_CARD" && /* @__PURE__ */ A("a", {
273
257
  href: "https://adaptivecards.io/designer/",
274
258
  target: "_blank",
275
259
  rel: "noopener noreferrer",
@@ -282,12 +266,12 @@ var Ee = p(function({ widget: e, onSave: t }) {
282
266
  fontWeight: "var(--font-weight-medium)",
283
267
  textDecoration: "none"
284
268
  },
285
- children: ["Designer", /* @__PURE__ */ P(y, { style: {
269
+ children: ["Designer", /* @__PURE__ */ k(m, { style: {
286
270
  height: "var(--size-icon-sm)",
287
271
  width: "var(--size-icon-sm)"
288
272
  } })]
289
273
  }),
290
- e.renderer === "BLOCKKIT" && /* @__PURE__ */ F("a", {
274
+ e.renderer === "BLOCKKIT" && /* @__PURE__ */ A("a", {
291
275
  href: "https://app.slack.com/block-kit-builder",
292
276
  target: "_blank",
293
277
  rel: "noopener noreferrer",
@@ -300,7 +284,7 @@ var Ee = p(function({ widget: e, onSave: t }) {
300
284
  fontWeight: "var(--font-weight-medium)",
301
285
  textDecoration: "none"
302
286
  },
303
- children: ["Block Kit Builder", /* @__PURE__ */ P(y, { style: {
287
+ children: ["Block Kit Builder", /* @__PURE__ */ k(m, { style: {
304
288
  height: "var(--size-icon-sm)",
305
289
  width: "var(--size-icon-sm)"
306
290
  } })]
@@ -310,17 +294,21 @@ var Ee = p(function({ widget: e, onSave: t }) {
310
294
  ]
311
295
  });
312
296
  });
313
- function De(e) {
314
- let t = e;
297
+ function Ae(e) {
298
+ let t = e, n = s({
299
+ dataSinkId: t.dataSinkId,
300
+ parserId: t.parserId,
301
+ config: e.config || {}
302
+ });
315
303
  return {
316
304
  title: e.title || "",
317
305
  description: e.description || "",
318
306
  refreshInterval: e.refreshInterval ?? void 0,
319
307
  renderer: e.renderer || "BIGCONSOLE",
320
308
  template: e.template,
321
- dataSinkId: t.dataSinkId ?? void 0,
309
+ dataSinkId: n.source.kind === "DATASINK" ? n.source.ref : void 0,
322
310
  datasetId: t.datasetId ?? void 0,
323
- parserId: t.parserId ?? void 0,
311
+ parserId: n.parserId,
324
312
  parserRules: t.parserRules ?? void 0,
325
313
  config: e.config || {},
326
314
  drilldownConfig: e.drilldown ? {
@@ -334,248 +322,260 @@ function De(e) {
334
322
  } : void 0
335
323
  };
336
324
  }
337
- var I = p(function({ isOpen: s, onClose: c }) {
338
- let [l, u] = _("general"), [d, f] = _("idle"), [p, y] = _(null), [I, L] = _(!1), R = e((e) => e.selectedWidgetId), Oe = e((e) => e.widgets), z = e((e) => e.updateWidget), B = R ? Oe.get(R) : void 0, V = g(null);
339
- h(() => {
340
- if (!R) {
341
- V.current = null, y(null), L(!1), f("idle");
325
+ var je = l(function({ isOpen: l, onClose: m }) {
326
+ let [je, Me] = f("general"), [j, M] = f("idle"), [N, P] = f(null), [F, I] = f(!1), L = e((e) => e.selectedWidgetId), Ne = e((e) => e.widgets), R = e((e) => e.updateWidget), z = L ? Ne.get(L) : void 0, B = le(null);
327
+ d(() => {
328
+ if (!L) {
329
+ B.current = null, P(null), I(!1), M("idle");
342
330
  return;
343
331
  }
344
- let e = V.current !== R;
345
- if (V.current = R, B) {
346
- if (I && !e) return;
347
- y(De(B)), L(!1), f("idle");
348
- } else y(null), L(!1), f("idle");
332
+ let e = B.current !== L;
333
+ if (B.current = L, z) {
334
+ if (F && !e) return;
335
+ P(Ae(z)), I(!1), M("idle");
336
+ } else P(null), I(!1), M("idle");
349
337
  }, [
350
- R,
351
- B,
352
- I
338
+ L,
339
+ z,
340
+ F
353
341
  ]);
354
- let { updateWidget: ke } = n(B?.pageId, B?.dashboardId, { skipFetch: !0 }), { createDrilldown: Ae, updateDrilldown: je, deleteDrilldown: Me } = r(), { dataSinks: H } = a({ skipFetch: !1 }), [U, W] = _(null), { executeParser: G } = o({
355
- consoleId: B?.dashboardId,
342
+ let { updateWidget: Pe } = n(z?.pageId, z?.dashboardId, { skipFetch: !0 }), { createDrilldown: Fe, updateDrilldown: Ie, deleteDrilldown: Le } = r(), { dataSinks: V } = a({ skipFetch: !1 }), [Re, H] = f(null), { executeParser: ze } = o({
343
+ consoleId: z?.dashboardId,
356
344
  skipFetch: !0
357
- }), [Ne, Pe] = _(!1), { actions: K, loading: q, createAction: Fe, updateAction: J, deleteAction: Ie, reorderActions: Y } = i(R || void 0), [Le, X] = _(!1), [Re, Z] = _(void 0), [ze, Be] = _(!1), Ve = m(() => {
345
+ }), [Be, U] = f(!1), [Ve, W] = f(void 0), [He, G] = f(!1), [Ue, K] = f(null);
346
+ d(() => {
347
+ W(void 0), G(!1), K(null), U(!1);
348
+ }, [L]);
349
+ let { actions: q, loading: J, createAction: We, updateAction: Ge, deleteAction: Ke, reorderActions: Y } = i(L || void 0), [qe, X] = f(!1), [Je, Z] = f(void 0), [Ye, Xe] = f(!1), Ze = u(() => {
358
350
  Z(void 0), X(!0);
359
- }, []), He = m((e) => {
351
+ }, []), Qe = u((e) => {
360
352
  Z(e), X(!0);
361
- }, []), Ue = m(async (e) => {
362
- if (R) {
363
- Be(!0);
353
+ }, []), $e = u(async (e) => {
354
+ if (L) {
355
+ Xe(!0);
364
356
  try {
365
357
  let t = null;
366
- if (t = "id" in e ? await J(e) : await Fe(e), t) {
367
- let n = [...K];
358
+ if (t = "id" in e ? await Ge(e) : await We(e), t) {
359
+ let n = [...q];
368
360
  if ("id" in e) {
369
361
  let r = n.findIndex((t) => t.id === e.id);
370
362
  r >= 0 && (n[r] = t);
371
363
  } else n.push(t);
372
- z(R, { actions: n.sort((e, t) => e.order - t.order) });
364
+ R(L, { actions: n.sort((e, t) => e.order - t.order) });
373
365
  }
374
366
  X(!1), Z(void 0);
375
367
  } catch {} finally {
376
- Be(!1);
368
+ Xe(!1);
377
369
  }
378
370
  }
379
371
  }, [
380
- R,
381
- K,
382
- Fe,
383
- J,
384
- z
385
- ]), We = m(async (e) => {
386
- R && window.confirm("Are you sure you want to delete this action?") && await Ie(e) && z(R, { actions: K.filter((t) => t.id !== e) });
372
+ L,
373
+ q,
374
+ We,
375
+ Ge,
376
+ R
377
+ ]), et = u(async (e) => {
378
+ L && window.confirm("Are you sure you want to delete this action?") && await Ke(e) && R(L, { actions: q.filter((t) => t.id !== e) });
387
379
  }, [
388
- R,
389
- K,
390
- Ie,
391
- z
392
- ]), Ge = m(async (e) => {
393
- if (!R || e === 0) return;
394
- let t = [...K].sort((e, t) => e.order - t.order), n = t.map((e) => e.id);
395
- [n[e - 1], n[e]] = [n[e], n[e - 1]], await Y(n) && z(R, { actions: t.map((e, t) => ({
380
+ L,
381
+ q,
382
+ Ke,
383
+ R
384
+ ]), tt = u(async (e) => {
385
+ if (!L || e === 0) return;
386
+ let t = [...q].sort((e, t) => e.order - t.order), n = t.map((e) => e.id);
387
+ [n[e - 1], n[e]] = [n[e], n[e - 1]], await Y(n) && R(L, { actions: t.map((e, t) => ({
396
388
  ...e,
397
389
  order: n.indexOf(e.id)
398
390
  })).sort((e, t) => e.order - t.order) });
399
391
  }, [
400
- R,
401
- K,
392
+ L,
393
+ q,
402
394
  Y,
403
- z
404
- ]), Ke = m(async (e) => {
405
- if (!R) return;
406
- let t = [...K].sort((e, t) => e.order - t.order);
395
+ R
396
+ ]), nt = u(async (e) => {
397
+ if (!L) return;
398
+ let t = [...q].sort((e, t) => e.order - t.order);
407
399
  if (e === t.length - 1) return;
408
400
  let n = t.map((e) => e.id);
409
- [n[e], n[e + 1]] = [n[e + 1], n[e]], await Y(n) && z(R, { actions: t.map((e, t) => ({
401
+ [n[e], n[e + 1]] = [n[e + 1], n[e]], await Y(n) && R(L, { actions: t.map((e, t) => ({
410
402
  ...e,
411
403
  order: n.indexOf(e.id)
412
404
  })).sort((e, t) => e.order - t.order) });
413
405
  }, [
414
- R,
415
- K,
406
+ L,
407
+ q,
416
408
  Y,
417
- z
409
+ R
418
410
  ]);
419
- h(() => {
420
- R && K.length >= 0 && !q && z(R, { actions: K });
411
+ d(() => {
412
+ L && q.length >= 0 && !J && R(L, { actions: q });
421
413
  }, [
422
- R,
423
- K,
414
+ L,
424
415
  q,
425
- z
416
+ J,
417
+ R
426
418
  ]);
427
- let Q = m((e, t) => {
428
- y((n) => n && {
419
+ let Q = u((e, t) => {
420
+ P((n) => n && {
429
421
  ...n,
430
422
  [e]: t
431
- }), L(!0);
432
- }, []), $ = m((e) => {
433
- y((t) => t && {
423
+ }), I(!0);
424
+ }, []), $ = u((e) => {
425
+ P((t) => t && {
434
426
  ...t,
435
427
  config: e
436
- }), L(!0);
428
+ }), I(!0);
437
429
  }, []);
438
- h(() => {
439
- if (p?.dataSinkId && H.length > 0) {
440
- let e = H.find((e) => e.id === p.dataSinkId);
441
- e && W(e.key);
442
- } else W(null);
443
- }, [p?.dataSinkId, H]);
444
- let qe = m((e) => {
445
- if (W(e), e) {
446
- let t = H.find((t) => t.key === e);
447
- t && (Q("dataSinkId", t.id), y((t) => t && {
430
+ d(() => {
431
+ if (N?.dataSinkId && V.length > 0) {
432
+ let e = V.find((e) => e.id === N.dataSinkId);
433
+ e && H(e.key);
434
+ } else H(null);
435
+ }, [N?.dataSinkId, V]);
436
+ let rt = u((e) => {
437
+ if (W(void 0), G(!1), K(null), H(e), e) {
438
+ let t = V.find((t) => t.key === e);
439
+ t && (Q("dataSinkId", t.id), P((t) => t && {
448
440
  ...t,
449
441
  config: {
450
442
  ...t.config,
451
443
  dataSinkKey: e
452
444
  }
453
- }), L(!0));
454
- } else Q("dataSinkId", void 0), y((e) => e && {
445
+ }), I(!0));
446
+ } else Q("dataSinkId", void 0), P((e) => e && {
455
447
  ...e,
456
448
  config: {
457
449
  ...e.config,
458
450
  dataSinkKey: void 0
459
451
  },
460
452
  parserId: void 0
461
- }), L(!0);
462
- }, [H, Q]), Je = m(async (e) => {
463
- if (Q("parserId", e || void 0), e && B) {
464
- Pe(!0);
453
+ }), I(!0);
454
+ }, [V, Q]), it = u(async (e) => {
455
+ if (Q("parserId", e || void 0), W(void 0), G(!1), K(null), e && z) {
456
+ U(!0);
465
457
  try {
466
- let t = await G(e);
467
- if (t?.success && t.output) {
468
- let e = we(t.output);
469
- (e.labelField || e.valueField) && (y((t) => {
458
+ let t = await ze(e);
459
+ if (t?.success) {
460
+ W(t.output), G(!0);
461
+ let e = Oe(t.output);
462
+ (e.labelField || e.valueField) && (P((t) => {
470
463
  if (!t) return t;
471
464
  let n = t.config || {}, r = { ...n };
472
465
  return e.labelField && !n.labelField && (r.labelField = e.labelField), e.valueField && !n.valueField && (r.valueField = e.valueField), e.xAxisField && !n.xAxisField && (r.xAxisField = e.xAxisField), {
473
466
  ...t,
474
467
  config: r
475
468
  };
476
- }), L(!0));
477
- }
469
+ }), I(!0));
470
+ } else G(!0), K(t?.error || "The parser could not produce a preview.");
478
471
  } catch (e) {
479
- console.warn("Failed to auto-detect parser fields:", e);
472
+ G(!0), K(e instanceof Error ? e.message : "The parser could not produce a preview."), console.warn("Failed to auto-detect parser fields:", e);
480
473
  } finally {
481
- Pe(!1);
474
+ U(!1);
482
475
  }
483
476
  }
484
477
  }, [
485
478
  Q,
486
- G,
487
- B
488
- ]), Ye = m(async () => {
489
- if (!(!B || !p)) {
490
- f("saving");
479
+ ze,
480
+ z
481
+ ]), at = u(async () => {
482
+ if (!(!z || !N)) {
483
+ M("saving");
491
484
  try {
492
485
  let e = {
493
- ...B.metadata || {},
494
- description: p.description || ""
495
- }, t = await ke({
496
- id: B.id,
497
- title: p.title,
498
- renderer: p.renderer,
499
- template: p.template,
500
- config: p.config,
501
- refreshInterval: p.refreshInterval,
502
- dataSinkId: p.dataSinkId,
503
- datasetId: p.datasetId,
504
- parserId: p.parserId,
505
- parserRules: p.parserRules,
486
+ ...z.metadata || {},
487
+ description: N.description || ""
488
+ }, t = ee(s({
489
+ dataSinkId: N.dataSinkId,
490
+ parserId: N.parserId,
491
+ config: {
492
+ ...N.config,
493
+ binding: void 0
494
+ }
495
+ }), N.config), n = await Pe({
496
+ id: z.id,
497
+ title: N.title,
498
+ renderer: N.renderer,
499
+ template: N.template,
500
+ config: t.config,
501
+ refreshInterval: N.refreshInterval,
502
+ dataSinkId: t.dataSinkId,
503
+ datasetId: N.datasetId,
504
+ parserId: t.parserId,
505
+ parserRules: N.parserRules,
506
506
  metadata: e
507
- }), n = B.drilldown;
508
- if (p.drilldownConfig) {
509
- let { enabled: e, targetDashboardId: t, navigationMode: r, parameterMapping: i, passGlobalFilters: a, maxDepth: o, openIn: s } = p.drilldownConfig;
510
- if (B.drilldown?.id) {
511
- let c = await je({
512
- id: B.drilldown.id,
507
+ }), r = z.drilldown;
508
+ if (N.drilldownConfig) {
509
+ let { enabled: e, targetDashboardId: t, navigationMode: n, parameterMapping: i, passGlobalFilters: a, maxDepth: o, openIn: s } = N.drilldownConfig;
510
+ if (z.drilldown?.id) {
511
+ let c = await Ie({
512
+ id: z.drilldown.id,
513
513
  targetDashboardId: t,
514
514
  parameterMapping: i,
515
- navigationMode: r,
515
+ navigationMode: n,
516
516
  enabled: e,
517
517
  passGlobalFilters: a,
518
518
  maxDepth: o,
519
519
  openIn: s
520
520
  });
521
- c && (n = c);
521
+ c && (r = c);
522
522
  } else if (t) {
523
- let c = await Ae({
524
- sourceWidgetId: B.id,
523
+ let c = await Fe({
524
+ sourceWidgetId: z.id,
525
525
  targetDashboardId: t,
526
526
  parameterMapping: i || {},
527
- navigationMode: r,
527
+ navigationMode: n,
528
528
  passGlobalFilters: a,
529
529
  maxDepth: o,
530
530
  openIn: s
531
531
  });
532
- c && (n = {
532
+ c && (r = {
533
533
  ...c,
534
534
  enabled: e
535
535
  });
536
536
  }
537
- } else B.drilldown?.id && !p.drilldownConfig && (await Me(B.drilldown.id), n = void 0);
538
- t ? (z(B.id, {
539
- title: p.title,
540
- description: p.description,
541
- renderer: p.renderer,
542
- template: p.template,
543
- config: p.config,
544
- refreshInterval: p.refreshInterval,
545
- dataSinkId: p.dataSinkId,
546
- datasetId: p.datasetId,
547
- parserId: p.parserId,
548
- parserRules: p.parserRules,
549
- drilldown: n,
537
+ } else z.drilldown?.id && !N.drilldownConfig && (await Le(z.drilldown.id), r = void 0);
538
+ n ? (R(z.id, {
539
+ title: N.title,
540
+ description: N.description,
541
+ renderer: N.renderer,
542
+ template: N.template,
543
+ config: t.config,
544
+ refreshInterval: N.refreshInterval,
545
+ dataSinkId: t.dataSinkId,
546
+ datasetId: N.datasetId,
547
+ parserId: t.parserId,
548
+ parserRules: N.parserRules,
549
+ drilldown: r,
550
550
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
551
- }), f("saved"), L(!1), setTimeout(() => f("idle"), 2e3)) : f("error");
551
+ }), M("saved"), I(!1), setTimeout(() => M("idle"), 2e3)) : M("error");
552
552
  } catch {
553
- f("error");
553
+ M("error");
554
554
  }
555
555
  }
556
556
  }, [
557
- B,
558
- p,
559
- ke,
560
557
  z,
561
- Ae,
562
- je,
563
- Me
564
- ]), Xe = m(() => {
565
- B && (y(De(B)), L(!1), f("idle"));
566
- }, [B]), Ze = m((e) => {
558
+ N,
559
+ Pe,
560
+ R,
561
+ Fe,
562
+ Ie,
563
+ Le
564
+ ]), ot = u(() => {
565
+ z && (P(Ae(z)), I(!1), M("idle"));
566
+ }, [z]), st = u((e) => {
567
567
  $(e);
568
- }, [$]), Qe = m((e) => {
569
- y((t) => t && {
568
+ }, [$]), ct = u((e) => {
569
+ P((t) => t && {
570
570
  ...t,
571
571
  drilldownConfig: e
572
- }), L(!0);
573
- }, []), $e = B ? t(B.type) : null, et = B ? Te(B.type) : null;
574
- return /* @__PURE__ */ P(pe, {
575
- open: s,
576
- onOpenChange: (e) => !e && c(),
572
+ }), I(!0);
573
+ }, []), lt = z ? t(z.type) : null;
574
+ return /* @__PURE__ */ k(_e, {
575
+ open: l,
576
+ onOpenChange: (e) => !e && m(),
577
577
  modal: !1,
578
- children: /* @__PURE__ */ F(me, {
578
+ children: /* @__PURE__ */ A(ve, {
579
579
  style: {
580
580
  width: "420px",
581
581
  maxWidth: "90vw",
@@ -586,20 +586,20 @@ var I = p(function({ isOpen: s, onClose: c }) {
586
586
  overflow: "hidden"
587
587
  },
588
588
  children: [
589
- /* @__PURE__ */ P(ge, {
589
+ /* @__PURE__ */ k(be, {
590
590
  style: {
591
591
  padding: "var(--space-cardPadding)",
592
592
  borderBottom: "1px solid var(--color-border)",
593
593
  backgroundColor: "var(--color-bg-surface)",
594
594
  flexShrink: 0
595
595
  },
596
- children: /* @__PURE__ */ F("div", {
596
+ children: /* @__PURE__ */ A("div", {
597
597
  style: {
598
598
  display: "flex",
599
599
  alignItems: "center",
600
600
  gap: "var(--space-controlGap)"
601
601
  },
602
- children: [/* @__PURE__ */ P("div", {
602
+ children: [/* @__PURE__ */ k("div", {
603
603
  style: {
604
604
  display: "flex",
605
605
  height: "var(--size-controlHeight-lg)",
@@ -611,62 +611,62 @@ var I = p(function({ isOpen: s, onClose: c }) {
611
611
  boxShadow: "var(--shadow-elevation-2)",
612
612
  flexShrink: 0
613
613
  },
614
- children: /* @__PURE__ */ P(b, { style: {
614
+ children: /* @__PURE__ */ k(h, { style: {
615
615
  height: "var(--size-icon-md)",
616
616
  width: "var(--size-icon-md)",
617
617
  color: "var(--color-action-primary-text)"
618
618
  } })
619
- }), /* @__PURE__ */ F("div", {
619
+ }), /* @__PURE__ */ A("div", {
620
620
  style: {
621
621
  flex: 1,
622
622
  minWidth: 0
623
623
  },
624
- children: [/* @__PURE__ */ F("div", {
624
+ children: [/* @__PURE__ */ A("div", {
625
625
  style: {
626
626
  display: "flex",
627
627
  alignItems: "center",
628
628
  gap: "var(--space-iconGap)"
629
629
  },
630
630
  children: [
631
- /* @__PURE__ */ P(_e, {
631
+ /* @__PURE__ */ k(xe, {
632
632
  style: {
633
633
  fontSize: "var(--font-size-body-md)",
634
634
  fontWeight: "var(--font-weight-bold)",
635
635
  color: "var(--color-text-primary)",
636
636
  margin: 0
637
637
  },
638
- children: B ? "Widget Properties" : "Properties"
638
+ children: z ? "Widget Properties" : "Properties"
639
639
  }),
640
- d === "saving" && /* @__PURE__ */ P(A, { style: {
640
+ j === "saving" && /* @__PURE__ */ k(T, { style: {
641
641
  height: "var(--size-icon-sm)",
642
642
  width: "var(--size-icon-sm)"
643
643
  } }),
644
- d === "saved" && /* @__PURE__ */ P(v, { style: {
644
+ j === "saved" && /* @__PURE__ */ k(p, { style: {
645
645
  height: "var(--size-icon-sm)",
646
646
  width: "var(--size-icon-sm)",
647
647
  color: "var(--color-status-success-bg)"
648
648
  } }),
649
- d === "error" && /* @__PURE__ */ P(x, { style: {
649
+ j === "error" && /* @__PURE__ */ k(g, { style: {
650
650
  height: "var(--size-icon-sm)",
651
651
  width: "var(--size-icon-sm)",
652
652
  color: "var(--color-status-error-bg)"
653
653
  } })
654
654
  ]
655
- }), $e && /* @__PURE__ */ P(he, {
655
+ }), lt && /* @__PURE__ */ k(ye, {
656
656
  style: {
657
657
  fontSize: "var(--font-size-body-sm)",
658
658
  color: "var(--color-text-secondary)",
659
659
  margin: "var(--space-controlGap) 0 0 0",
660
660
  fontWeight: "var(--font-weight-medium)"
661
661
  },
662
- children: $e.name
662
+ children: lt.name
663
663
  })]
664
664
  })]
665
665
  })
666
666
  }),
667
- B ? /* @__PURE__ */ F(ve, {
668
- value: l,
669
- onValueChange: (e) => u(e),
667
+ z ? /* @__PURE__ */ A(Se, {
668
+ value: je,
669
+ onValueChange: (e) => Me(e),
670
670
  style: {
671
671
  flex: 1,
672
672
  display: "flex",
@@ -674,7 +674,7 @@ var I = p(function({ isOpen: s, onClose: c }) {
674
674
  minHeight: 0,
675
675
  overflow: "hidden"
676
676
  },
677
- children: [/* @__PURE__ */ F(ye, {
677
+ children: [/* @__PURE__ */ A(Ce, {
678
678
  style: {
679
679
  width: "100%",
680
680
  display: "flex",
@@ -689,7 +689,7 @@ var I = p(function({ isOpen: s, onClose: c }) {
689
689
  overflowX: "auto"
690
690
  },
691
691
  children: [
692
- /* @__PURE__ */ P(M, {
692
+ /* @__PURE__ */ k(D, {
693
693
  value: "general",
694
694
  style: {
695
695
  fontWeight: "var(--font-weight-semibold)",
@@ -699,7 +699,7 @@ var I = p(function({ isOpen: s, onClose: c }) {
699
699
  },
700
700
  children: "General"
701
701
  }),
702
- /* @__PURE__ */ P(M, {
702
+ /* @__PURE__ */ k(D, {
703
703
  value: "data",
704
704
  style: {
705
705
  fontWeight: "var(--font-weight-semibold)",
@@ -709,47 +709,17 @@ var I = p(function({ isOpen: s, onClose: c }) {
709
709
  },
710
710
  children: "Data"
711
711
  }),
712
- /* @__PURE__ */ P(M, {
713
- value: "actions",
712
+ /* @__PURE__ */ k(D, {
713
+ value: "advanced",
714
714
  style: {
715
715
  fontWeight: "var(--font-weight-semibold)",
716
716
  fontSize: "12px",
717
717
  padding: "6px 8px",
718
718
  flexShrink: 0
719
719
  },
720
- children: "Actions"
720
+ children: "Advanced"
721
721
  }),
722
- /* @__PURE__ */ P(M, {
723
- value: "drilldown",
724
- style: {
725
- fontWeight: "var(--font-weight-semibold)",
726
- fontSize: "12px",
727
- padding: "6px 8px",
728
- flexShrink: 0
729
- },
730
- children: "Drilldown"
731
- }),
732
- /* @__PURE__ */ P(M, {
733
- value: "webhooks",
734
- style: {
735
- fontWeight: "var(--font-weight-semibold)",
736
- fontSize: "12px",
737
- padding: "6px 8px",
738
- flexShrink: 0
739
- },
740
- children: "Hooks"
741
- }),
742
- /* @__PURE__ */ P(M, {
743
- value: "events",
744
- style: {
745
- fontWeight: "var(--font-weight-semibold)",
746
- fontSize: "12px",
747
- padding: "6px 8px",
748
- flexShrink: 0
749
- },
750
- children: "Events"
751
- }),
752
- /* @__PURE__ */ P(M, {
722
+ /* @__PURE__ */ k(D, {
753
723
  value: "appearance",
754
724
  style: {
755
725
  fontWeight: "var(--font-weight-semibold)",
@@ -760,7 +730,7 @@ var I = p(function({ isOpen: s, onClose: c }) {
760
730
  children: "Style"
761
731
  })
762
732
  ]
763
- }), /* @__PURE__ */ F("div", {
733
+ }), /* @__PURE__ */ A("div", {
764
734
  style: {
765
735
  flex: 1,
766
736
  overflow: "auto",
@@ -768,287 +738,83 @@ var I = p(function({ isOpen: s, onClose: c }) {
768
738
  minHeight: 0
769
739
  },
770
740
  children: [
771
- /* @__PURE__ */ P(j, {
741
+ /* @__PURE__ */ k(E, {
772
742
  value: "general",
773
743
  className: "mt-0",
774
- children: p && /* @__PURE__ */ F("div", {
744
+ children: N && /* @__PURE__ */ k("div", {
775
745
  style: {
776
746
  display: "flex",
777
747
  flexDirection: "column",
778
748
  gap: "var(--space-formGap)"
779
749
  },
780
- children: [
781
- /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
782
- htmlFor: "title",
783
- style: {
784
- display: "block",
785
- fontSize: "var(--font-size-body-sm)",
786
- fontWeight: "var(--font-weight-semibold)",
787
- color: "var(--color-text-primary)",
788
- marginBottom: "var(--space-controlGap)"
789
- },
790
- children: "Title"
791
- }), /* @__PURE__ */ P(C, {
792
- id: "title",
793
- value: p.title,
794
- onChange: (e) => Q("title", e.target.value),
795
- style: {
796
- height: "var(--size-controlHeight-md)",
797
- fontSize: "var(--font-size-body-sm)"
798
- }
799
- })] }),
800
- /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
801
- htmlFor: "description",
802
- style: {
803
- display: "block",
804
- fontSize: "var(--font-size-body-sm)",
805
- fontWeight: "var(--font-weight-semibold)",
806
- color: "var(--color-text-primary)",
807
- marginBottom: "var(--space-controlGap)"
808
- },
809
- children: "Description"
810
- }), /* @__PURE__ */ P(N, {
811
- id: "description",
812
- value: p.description,
813
- onChange: (e) => Q("description", e.target.value),
814
- rows: 3,
815
- style: {
816
- fontSize: "var(--font-size-body-sm)",
817
- resize: "none"
818
- }
819
- })] }),
820
- /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("label", {
821
- htmlFor: "refresh",
822
- style: {
823
- display: "block",
824
- fontSize: "var(--font-size-body-sm)",
825
- fontWeight: "var(--font-weight-semibold)",
826
- color: "var(--color-text-primary)",
827
- marginBottom: "var(--space-controlGap)"
828
- },
829
- children: "Auto-Refresh (seconds)"
830
- }), /* @__PURE__ */ P(C, {
831
- id: "refresh",
832
- type: "number",
833
- value: p.refreshInterval || "",
834
- onChange: (e) => Q("refreshInterval", e.target.value ? Number(e.target.value) : void 0),
835
- min: 0,
836
- placeholder: "No auto-refresh",
837
- style: {
838
- height: "var(--size-controlHeight-md)",
839
- fontSize: "var(--font-size-body-sm)"
840
- }
841
- })] }),
842
- /* @__PURE__ */ F("div", {
843
- style: {
844
- paddingTop: "var(--space-formGap)",
845
- borderTop: "1px solid var(--color-border)"
846
- },
847
- children: [
848
- /* @__PURE__ */ P("label", {
849
- style: {
850
- display: "block",
851
- fontSize: "var(--font-size-body-sm)",
852
- fontWeight: "var(--font-weight-semibold)",
853
- color: "var(--color-text-primary)",
854
- marginBottom: "var(--space-controlGap)"
855
- },
856
- children: "Renderer"
857
- }),
858
- /* @__PURE__ */ F(T, {
859
- value: p.renderer,
860
- onValueChange: (e) => {
861
- let t = e;
862
- Q("renderer", t), t === "BIGCONSOLE" && Q("template", void 0);
863
- },
864
- children: [/* @__PURE__ */ P(O, {
865
- style: {
866
- height: "var(--size-controlHeight-md)",
867
- fontSize: "var(--font-size-body-sm)"
868
- },
869
- children: /* @__PURE__ */ P(k, { placeholder: "Select renderer" })
870
- }), /* @__PURE__ */ P(E, {
871
- position: "popper",
872
- side: "bottom",
873
- sideOffset: 4,
874
- align: "start",
875
- style: {
876
- zIndex: 9999,
877
- maxHeight: "200px",
878
- backgroundColor: "var(--color-overlay-popoverBg, var(--color-bg-surface, #ffffff))",
879
- border: "1px solid var(--color-border)",
880
- boxShadow: "var(--shadow-elevation-3)",
881
- borderRadius: "var(--radius-button)"
882
- },
883
- children: xe.map((e) => /* @__PURE__ */ P(D, {
884
- value: e.value,
885
- children: e.label
886
- }, e.value))
887
- })]
888
- }),
889
- /* @__PURE__ */ P("p", {
890
- style: {
891
- fontSize: "var(--font-size-body-sm)",
892
- color: "var(--color-text-muted)",
893
- marginTop: "var(--space-controlGap)"
894
- },
895
- children: xe.find((e) => e.value === p.renderer)?.description
896
- })
897
- ]
898
- }),
899
- p.renderer && p.renderer !== "BIGCONSOLE" && /* @__PURE__ */ P(Ee, {
900
- widget: {
901
- ...B,
902
- template: p.template,
903
- renderer: p.renderer
904
- },
905
- onSave: (e) => Q("template", e)
906
- })
907
- ]
750
+ children: /* @__PURE__ */ k(se, {
751
+ title: N.title,
752
+ description: N.description,
753
+ refreshInterval: N.refreshInterval,
754
+ onTitleChange: (e) => Q("title", e),
755
+ onDescriptionChange: (e) => Q("description", e),
756
+ onRefreshIntervalChange: (e) => Q("refreshInterval", e)
757
+ })
908
758
  })
909
759
  }),
910
- /* @__PURE__ */ P(j, {
760
+ /* @__PURE__ */ k(E, {
911
761
  value: "data",
912
762
  className: "mt-0 space-y-4",
913
- children: p && /* @__PURE__ */ F(be, { children: [
914
- /* @__PURE__ */ F("div", {
915
- className: "space-y-4",
916
- children: [
917
- /* @__PURE__ */ P("div", {
918
- className: "p-3 bg-bg-sunken rounded-md border border-border-subtle",
919
- children: /* @__PURE__ */ P("p", {
920
- className: "text-xs text-text-secondary",
921
- children: "Connect this widget to a DataSink and Parser to display transformed data."
922
- })
923
- }),
924
- /* @__PURE__ */ F("div", {
925
- className: "space-y-2",
926
- children: [
927
- /* @__PURE__ */ P(w, { children: "DataSink" }),
928
- /* @__PURE__ */ P(ee, {
929
- value: U,
930
- onChange: qe,
931
- placeholder: "Select a DataSink..."
932
- }),
933
- U && /* @__PURE__ */ F("p", {
934
- className: "text-xs text-text-secondary",
935
- children: [
936
- "Key: ",
937
- U,
938
- p.dataSinkId && /* @__PURE__ */ F("span", {
939
- className: "ml-2 text-text-tertiary",
940
- children: [
941
- "ID: ",
942
- p.dataSinkId.slice(0, 8),
943
- "..."
944
- ]
945
- })
946
- ]
947
- })
948
- ]
949
- }),
950
- /* @__PURE__ */ F("div", {
951
- className: "space-y-2",
952
- children: [
953
- /* @__PURE__ */ P(w, { children: "Parser" }),
954
- /* @__PURE__ */ P(te, {
955
- consoleId: B?.dashboardId || "",
956
- value: p.parserId || null,
957
- onChange: Je,
958
- filterInputSinkKey: U || void 0,
959
- filterStatus: void 0,
960
- placeholder: U ? "Select a parser..." : "Select a DataSink first...",
961
- disabled: !U
962
- }),
963
- /* @__PURE__ */ P("p", {
964
- className: "text-xs text-text-secondary",
965
- children: Ne ? /* @__PURE__ */ F("span", {
966
- className: "flex items-center gap-1",
967
- children: [/* @__PURE__ */ P(A, { style: {
968
- width: "12px",
969
- height: "12px"
970
- } }), "Auto-detecting field mappings..."]
971
- }) : U ? "Showing parsers that use this DataSink as input" : "Select a DataSink to see available parsers"
972
- })
973
- ]
974
- }),
975
- !!(p.parserId && (p.config?.labelField || p.config?.valueField)) && /* @__PURE__ */ F("div", {
976
- className: "p-3 bg-green-50 dark:bg-green-950/30 rounded-md border border-green-200 dark:border-green-800",
977
- children: [/* @__PURE__ */ P("p", {
978
- className: "text-xs font-medium text-green-700 dark:text-green-400 mb-2",
979
- children: "✓ Field mappings configured"
980
- }), /* @__PURE__ */ F("div", {
981
- className: "text-xs text-green-600 dark:text-green-500 space-y-1",
982
- children: [
983
- !!p.config?.labelField && /* @__PURE__ */ F("p", { children: [
984
- "Label Field:",
985
- " ",
986
- /* @__PURE__ */ P("code", {
987
- className: "bg-green-100 dark:bg-green-900 px-1 rounded",
988
- children: String(p.config.labelField)
989
- })
990
- ] }),
991
- !!p.config?.valueField && /* @__PURE__ */ F("p", { children: [
992
- "Value Field:",
993
- " ",
994
- /* @__PURE__ */ P("code", {
995
- className: "bg-green-100 dark:bg-green-900 px-1 rounded",
996
- children: String(p.config.valueField)
997
- })
998
- ] }),
999
- !!p.config?.xAxisField && /* @__PURE__ */ F("p", { children: [
1000
- "X-Axis Field:",
1001
- " ",
1002
- /* @__PURE__ */ P("code", {
1003
- className: "bg-green-100 dark:bg-green-900 px-1 rounded",
1004
- children: String(p.config.xAxisField)
1005
- })
1006
- ] })
1007
- ]
1008
- })]
1009
- }),
1010
- /* @__PURE__ */ F("div", {
1011
- className: "space-y-2",
1012
- children: [
1013
- /* @__PURE__ */ P(w, { children: "Data Path (Optional)" }),
1014
- /* @__PURE__ */ P(C, {
1015
- value: p.config?.dataPath || "",
1016
- onChange: (e) => $({
1017
- ...p.config,
1018
- dataPath: e.target.value || void 0
1019
- }),
1020
- placeholder: "e.g., summary.totalRevenue"
1021
- }),
1022
- /* @__PURE__ */ P("p", {
1023
- className: "text-xs text-text-secondary",
1024
- children: "Path to extract specific data from the parser output (dot notation)"
1025
- })
1026
- ]
763
+ children: N && /* @__PURE__ */ A(we, { children: [
764
+ (() => {
765
+ let e = s({
766
+ dataSinkId: N.dataSinkId,
767
+ parserId: N.parserId,
768
+ config: {
769
+ ...N.config,
770
+ binding: void 0
771
+ }
772
+ }), t = c({
773
+ binding: e,
774
+ loading: Be,
775
+ error: Ue,
776
+ preview: Ve,
777
+ previewComplete: He
778
+ });
779
+ return /* @__PURE__ */ k(ce, {
780
+ consoleId: z?.dashboardId || "",
781
+ binding: e,
782
+ dataSinkKey: Re,
783
+ dataPath: typeof N.config.dataPath == "string" ? N.config.dataPath : void 0,
784
+ status: t.status,
785
+ missingFields: t.missingFields,
786
+ preview: Ve,
787
+ error: Ue,
788
+ onDataSinkChange: rt,
789
+ onParserChange: it,
790
+ onDataPathChange: (e) => $({
791
+ ...N.config,
792
+ dataPath: e
1027
793
  })
1028
- ]
1029
- }),
1030
- /* @__PURE__ */ P("div", {
794
+ });
795
+ })(),
796
+ /* @__PURE__ */ k("div", {
1031
797
  className: "border-t border-border-subtle pt-4",
1032
- children: /* @__PURE__ */ P(w, {
798
+ children: /* @__PURE__ */ k(y, {
1033
799
  className: "text-xs text-text-secondary uppercase tracking-wide",
1034
800
  children: "Alternative Data Sources"
1035
801
  })
1036
802
  }),
1037
- /* @__PURE__ */ F("div", {
803
+ /* @__PURE__ */ A("div", {
1038
804
  className: "space-y-2",
1039
- children: [/* @__PURE__ */ P(w, { children: "Data Source Type" }), /* @__PURE__ */ F(T, {
1040
- value: p.config?.dataSourceType || "",
805
+ children: [/* @__PURE__ */ k(y, { children: "Data Source Type" }), /* @__PURE__ */ A(b, {
806
+ value: N.config?.dataSourceType || "",
1041
807
  onValueChange: (e) => $({
1042
- ...p.config,
808
+ ...N.config,
1043
809
  dataSourceType: e || void 0
1044
810
  }),
1045
- children: [/* @__PURE__ */ P(O, {
811
+ children: [/* @__PURE__ */ k(C, {
1046
812
  style: {
1047
813
  height: "var(--size-controlHeight-md)",
1048
814
  fontSize: "var(--font-size-body-sm)"
1049
815
  },
1050
- children: /* @__PURE__ */ P(k, { placeholder: "Select type..." })
1051
- }), /* @__PURE__ */ P(E, {
816
+ children: /* @__PURE__ */ k(w, { placeholder: "Select type..." })
817
+ }), /* @__PURE__ */ k(x, {
1052
818
  position: "popper",
1053
819
  side: "bottom",
1054
820
  sideOffset: 4,
@@ -1061,56 +827,56 @@ var I = p(function({ isOpen: s, onClose: c }) {
1061
827
  boxShadow: "var(--shadow-elevation-3)",
1062
828
  borderRadius: "var(--radius-button)"
1063
829
  },
1064
- children: Se.map((e) => /* @__PURE__ */ P(D, {
830
+ children: Ee.map((e) => /* @__PURE__ */ k(S, {
1065
831
  value: e.value,
1066
832
  children: e.label
1067
833
  }, e.value))
1068
834
  })]
1069
835
  })]
1070
836
  }),
1071
- p.config?.dataSourceType === "REST_API" && /* @__PURE__ */ F("div", {
837
+ N.config?.dataSourceType === "REST_API" && /* @__PURE__ */ A("div", {
1072
838
  className: "space-y-3",
1073
839
  children: [
1074
- /* @__PURE__ */ F("div", {
840
+ /* @__PURE__ */ A("div", {
1075
841
  className: "space-y-2",
1076
- children: [/* @__PURE__ */ P(w, { children: "Endpoint URL *" }), /* @__PURE__ */ P(C, {
1077
- value: p.config?.endpointUrl || "",
842
+ children: [/* @__PURE__ */ k(y, { children: "Endpoint URL *" }), /* @__PURE__ */ k(v, {
843
+ value: N.config?.endpointUrl || "",
1078
844
  onChange: (e) => $({
1079
- ...p.config,
845
+ ...N.config,
1080
846
  endpointUrl: e.target.value || void 0
1081
847
  }),
1082
848
  placeholder: "https://api.example.com/data"
1083
849
  })]
1084
850
  }),
1085
- /* @__PURE__ */ F("div", {
851
+ /* @__PURE__ */ A("div", {
1086
852
  className: "space-y-2",
1087
- children: [/* @__PURE__ */ P(w, { children: "HTTP Method" }), /* @__PURE__ */ F(T, {
1088
- value: p.config?.httpMethod || "GET",
853
+ children: [/* @__PURE__ */ k(y, { children: "HTTP Method" }), /* @__PURE__ */ A(b, {
854
+ value: N.config?.httpMethod || "GET",
1089
855
  onValueChange: (e) => $({
1090
- ...p.config,
856
+ ...N.config,
1091
857
  httpMethod: e
1092
858
  }),
1093
- children: [/* @__PURE__ */ P(O, {
859
+ children: [/* @__PURE__ */ k(C, {
1094
860
  style: { height: "var(--size-controlHeight-md)" },
1095
- children: /* @__PURE__ */ P(k, {})
1096
- }), /* @__PURE__ */ F(E, {
861
+ children: /* @__PURE__ */ k(w, {})
862
+ }), /* @__PURE__ */ A(x, {
1097
863
  position: "popper",
1098
864
  side: "bottom",
1099
865
  sideOffset: 4,
1100
866
  children: [
1101
- /* @__PURE__ */ P(D, {
867
+ /* @__PURE__ */ k(S, {
1102
868
  value: "GET",
1103
869
  children: "GET"
1104
870
  }),
1105
- /* @__PURE__ */ P(D, {
871
+ /* @__PURE__ */ k(S, {
1106
872
  value: "POST",
1107
873
  children: "POST"
1108
874
  }),
1109
- /* @__PURE__ */ P(D, {
875
+ /* @__PURE__ */ k(S, {
1110
876
  value: "PUT",
1111
877
  children: "PUT"
1112
878
  }),
1113
- /* @__PURE__ */ P(D, {
879
+ /* @__PURE__ */ k(S, {
1114
880
  value: "DELETE",
1115
881
  children: "DELETE"
1116
882
  })
@@ -1118,12 +884,12 @@ var I = p(function({ isOpen: s, onClose: c }) {
1118
884
  })]
1119
885
  })]
1120
886
  }),
1121
- /* @__PURE__ */ F("div", {
887
+ /* @__PURE__ */ A("div", {
1122
888
  className: "space-y-2",
1123
- children: [/* @__PURE__ */ P(w, { children: "Headers (JSON)" }), /* @__PURE__ */ P(N, {
1124
- value: p.config?.headers || "",
889
+ children: [/* @__PURE__ */ k(y, { children: "Headers (JSON)" }), /* @__PURE__ */ k(O, {
890
+ value: N.config?.headers || "",
1125
891
  onChange: (e) => $({
1126
- ...p.config,
892
+ ...N.config,
1127
893
  headers: e.target.value || void 0
1128
894
  }),
1129
895
  rows: 3,
@@ -1131,35 +897,35 @@ var I = p(function({ isOpen: s, onClose: c }) {
1131
897
  className: "font-mono text-xs"
1132
898
  })]
1133
899
  }),
1134
- /* @__PURE__ */ F("div", {
900
+ /* @__PURE__ */ A("div", {
1135
901
  className: "space-y-2",
1136
- children: [/* @__PURE__ */ P(w, { children: "Authentication" }), /* @__PURE__ */ F(T, {
1137
- value: p.config?.authType || "none",
902
+ children: [/* @__PURE__ */ k(y, { children: "Authentication" }), /* @__PURE__ */ A(b, {
903
+ value: N.config?.authType || "none",
1138
904
  onValueChange: (e) => $({
1139
- ...p.config,
905
+ ...N.config,
1140
906
  authType: e
1141
907
  }),
1142
- children: [/* @__PURE__ */ P(O, {
908
+ children: [/* @__PURE__ */ k(C, {
1143
909
  style: { height: "var(--size-controlHeight-md)" },
1144
- children: /* @__PURE__ */ P(k, {})
1145
- }), /* @__PURE__ */ F(E, {
910
+ children: /* @__PURE__ */ k(w, {})
911
+ }), /* @__PURE__ */ A(x, {
1146
912
  position: "popper",
1147
913
  side: "bottom",
1148
914
  sideOffset: 4,
1149
915
  children: [
1150
- /* @__PURE__ */ P(D, {
916
+ /* @__PURE__ */ k(S, {
1151
917
  value: "none",
1152
918
  children: "None"
1153
919
  }),
1154
- /* @__PURE__ */ P(D, {
920
+ /* @__PURE__ */ k(S, {
1155
921
  value: "api_key",
1156
922
  children: "API Key"
1157
923
  }),
1158
- /* @__PURE__ */ P(D, {
924
+ /* @__PURE__ */ k(S, {
1159
925
  value: "bearer",
1160
926
  children: "Bearer Token"
1161
927
  }),
1162
- /* @__PURE__ */ P(D, {
928
+ /* @__PURE__ */ k(S, {
1163
929
  value: "basic",
1164
930
  children: "Basic Auth"
1165
931
  })
@@ -1167,24 +933,24 @@ var I = p(function({ isOpen: s, onClose: c }) {
1167
933
  })]
1168
934
  })]
1169
935
  }),
1170
- !!(p.config?.authType && p.config.authType !== "none") && /* @__PURE__ */ F("div", {
936
+ !!(N.config?.authType && N.config.authType !== "none") && /* @__PURE__ */ A("div", {
1171
937
  className: "space-y-2",
1172
- children: [/* @__PURE__ */ P(w, { children: String(p.config.authType) === "basic" ? "Credentials (user:pass)" : "Token/Key" }), /* @__PURE__ */ P(C, {
938
+ children: [/* @__PURE__ */ k(y, { children: String(N.config.authType) === "basic" ? "Credentials (user:pass)" : "Token/Key" }), /* @__PURE__ */ k(v, {
1173
939
  type: "password",
1174
- value: p.config?.authValue || "",
940
+ value: N.config?.authValue || "",
1175
941
  onChange: (e) => $({
1176
- ...p.config,
942
+ ...N.config,
1177
943
  authValue: e.target.value || void 0
1178
944
  }),
1179
- placeholder: p.config.authType === "basic" ? "username:password" : "Enter token or API key"
945
+ placeholder: N.config.authType === "basic" ? "username:password" : "Enter token or API key"
1180
946
  })]
1181
947
  }),
1182
- (p.config?.httpMethod === "POST" || p.config?.httpMethod === "PUT") && /* @__PURE__ */ F("div", {
948
+ (N.config?.httpMethod === "POST" || N.config?.httpMethod === "PUT") && /* @__PURE__ */ A("div", {
1183
949
  className: "space-y-2",
1184
- children: [/* @__PURE__ */ P(w, { children: "Request Body (JSON)" }), /* @__PURE__ */ P(N, {
1185
- value: p.config?.requestBody || "",
950
+ children: [/* @__PURE__ */ k(y, { children: "Request Body (JSON)" }), /* @__PURE__ */ k(O, {
951
+ value: N.config?.requestBody || "",
1186
952
  onChange: (e) => $({
1187
- ...p.config,
953
+ ...N.config,
1188
954
  requestBody: e.target.value || void 0
1189
955
  }),
1190
956
  rows: 4,
@@ -1192,19 +958,19 @@ var I = p(function({ isOpen: s, onClose: c }) {
1192
958
  className: "font-mono text-xs"
1193
959
  })]
1194
960
  }),
1195
- /* @__PURE__ */ F("div", {
961
+ /* @__PURE__ */ A("div", {
1196
962
  className: "space-y-2",
1197
963
  children: [
1198
- /* @__PURE__ */ P(w, { children: "Data Path (optional)" }),
1199
- /* @__PURE__ */ P(C, {
1200
- value: p.config?.dataPath || "",
964
+ /* @__PURE__ */ k(y, { children: "Data Path (optional)" }),
965
+ /* @__PURE__ */ k(v, {
966
+ value: N.config?.dataPath || "",
1201
967
  onChange: (e) => $({
1202
- ...p.config,
968
+ ...N.config,
1203
969
  dataPath: e.target.value || void 0
1204
970
  }),
1205
971
  placeholder: "$.data.items or .data.items"
1206
972
  }),
1207
- /* @__PURE__ */ P("p", {
973
+ /* @__PURE__ */ k("p", {
1208
974
  className: "text-xs text-text-secondary",
1209
975
  children: "JSONPath or dot notation to extract data from response"
1210
976
  })
@@ -1212,26 +978,26 @@ var I = p(function({ isOpen: s, onClose: c }) {
1212
978
  })
1213
979
  ]
1214
980
  }),
1215
- p.config?.dataSourceType === "GRAPHQL" && /* @__PURE__ */ F("div", {
981
+ N.config?.dataSourceType === "GRAPHQL" && /* @__PURE__ */ A("div", {
1216
982
  className: "space-y-3",
1217
983
  children: [
1218
- /* @__PURE__ */ F("div", {
984
+ /* @__PURE__ */ A("div", {
1219
985
  className: "space-y-2",
1220
- children: [/* @__PURE__ */ P(w, { children: "GraphQL Endpoint *" }), /* @__PURE__ */ P(C, {
1221
- value: p.config?.graphqlEndpoint || "",
986
+ children: [/* @__PURE__ */ k(y, { children: "GraphQL Endpoint *" }), /* @__PURE__ */ k(v, {
987
+ value: N.config?.graphqlEndpoint || "",
1222
988
  onChange: (e) => $({
1223
- ...p.config,
989
+ ...N.config,
1224
990
  graphqlEndpoint: e.target.value || void 0
1225
991
  }),
1226
992
  placeholder: "https://api.example.com/graphql"
1227
993
  })]
1228
994
  }),
1229
- /* @__PURE__ */ F("div", {
995
+ /* @__PURE__ */ A("div", {
1230
996
  className: "space-y-2",
1231
- children: [/* @__PURE__ */ P(w, { children: "Query *" }), /* @__PURE__ */ P(N, {
1232
- value: p.config?.graphqlQuery || "",
997
+ children: [/* @__PURE__ */ k(y, { children: "Query *" }), /* @__PURE__ */ k(O, {
998
+ value: N.config?.graphqlQuery || "",
1233
999
  onChange: (e) => $({
1234
- ...p.config,
1000
+ ...N.config,
1235
1001
  graphqlQuery: e.target.value || void 0
1236
1002
  }),
1237
1003
  rows: 6,
@@ -1239,12 +1005,12 @@ var I = p(function({ isOpen: s, onClose: c }) {
1239
1005
  className: "font-mono text-xs"
1240
1006
  })]
1241
1007
  }),
1242
- /* @__PURE__ */ F("div", {
1008
+ /* @__PURE__ */ A("div", {
1243
1009
  className: "space-y-2",
1244
- children: [/* @__PURE__ */ P(w, { children: "Variables (JSON, optional)" }), /* @__PURE__ */ P(N, {
1245
- value: p.config?.graphqlVariables || "",
1010
+ children: [/* @__PURE__ */ k(y, { children: "Variables (JSON, optional)" }), /* @__PURE__ */ k(O, {
1011
+ value: N.config?.graphqlVariables || "",
1246
1012
  onChange: (e) => $({
1247
- ...p.config,
1013
+ ...N.config,
1248
1014
  graphqlVariables: e.target.value || void 0
1249
1015
  }),
1250
1016
  rows: 3,
@@ -1252,12 +1018,12 @@ var I = p(function({ isOpen: s, onClose: c }) {
1252
1018
  className: "font-mono text-xs"
1253
1019
  })]
1254
1020
  }),
1255
- /* @__PURE__ */ F("div", {
1021
+ /* @__PURE__ */ A("div", {
1256
1022
  className: "space-y-2",
1257
- children: [/* @__PURE__ */ P(w, { children: "Headers (JSON, optional)" }), /* @__PURE__ */ P(N, {
1258
- value: p.config?.headers || "",
1023
+ children: [/* @__PURE__ */ k(y, { children: "Headers (JSON, optional)" }), /* @__PURE__ */ k(O, {
1024
+ value: N.config?.headers || "",
1259
1025
  onChange: (e) => $({
1260
- ...p.config,
1026
+ ...N.config,
1261
1027
  headers: e.target.value || void 0
1262
1028
  }),
1263
1029
  rows: 2,
@@ -1265,19 +1031,19 @@ var I = p(function({ isOpen: s, onClose: c }) {
1265
1031
  className: "font-mono text-xs"
1266
1032
  })]
1267
1033
  }),
1268
- /* @__PURE__ */ F("div", {
1034
+ /* @__PURE__ */ A("div", {
1269
1035
  className: "space-y-2",
1270
1036
  children: [
1271
- /* @__PURE__ */ P(w, { children: "Data Path (optional)" }),
1272
- /* @__PURE__ */ P(C, {
1273
- value: p.config?.dataPath || "",
1037
+ /* @__PURE__ */ k(y, { children: "Data Path (optional)" }),
1038
+ /* @__PURE__ */ k(v, {
1039
+ value: N.config?.dataPath || "",
1274
1040
  onChange: (e) => $({
1275
- ...p.config,
1041
+ ...N.config,
1276
1042
  dataPath: e.target.value || void 0
1277
1043
  }),
1278
1044
  placeholder: ".data.items"
1279
1045
  }),
1280
- /* @__PURE__ */ P("p", {
1046
+ /* @__PURE__ */ k("p", {
1281
1047
  className: "text-xs text-text-secondary",
1282
1048
  children: "Path to extract data from GraphQL response"
1283
1049
  })
@@ -1285,12 +1051,12 @@ var I = p(function({ isOpen: s, onClose: c }) {
1285
1051
  })
1286
1052
  ]
1287
1053
  }),
1288
- p.config?.dataSourceType === "MOCK" && /* @__PURE__ */ F("div", {
1054
+ N.config?.dataSourceType === "MOCK" && /* @__PURE__ */ A("div", {
1289
1055
  className: "space-y-2",
1290
- children: [/* @__PURE__ */ P(w, { children: "Sample Data (JSON)" }), /* @__PURE__ */ P(N, {
1291
- value: p.config?.mockData || "",
1056
+ children: [/* @__PURE__ */ k(y, { children: "Sample Data (JSON)" }), /* @__PURE__ */ k(O, {
1057
+ value: N.config?.mockData || "",
1292
1058
  onChange: (e) => $({
1293
- ...p.config,
1059
+ ...N.config,
1294
1060
  mockData: e.target.value || void 0
1295
1061
  }),
1296
1062
  rows: 5,
@@ -1300,144 +1066,165 @@ var I = p(function({ isOpen: s, onClose: c }) {
1300
1066
  })
1301
1067
  ] })
1302
1068
  }),
1303
- /* @__PURE__ */ F(j, {
1304
- value: "actions",
1305
- className: "mt-0 space-y-4",
1306
- children: [/* @__PURE__ */ F("div", {
1307
- className: "flex items-center justify-between",
1308
- children: [/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("h3", {
1309
- className: "text-sm font-medium",
1310
- children: "Widget Actions"
1311
- }), /* @__PURE__ */ P("p", {
1312
- className: "text-xs text-text-secondary",
1313
- children: "Configure buttons on this widget"
1314
- })] }), /* @__PURE__ */ F(S, {
1315
- size: "sm",
1316
- onClick: Ve,
1317
- children: [/* @__PURE__ */ P(le, { className: "size-4" }), "Add"]
1318
- })]
1319
- }), q ? /* @__PURE__ */ P("div", {
1320
- className: "flex justify-center py-8",
1321
- children: /* @__PURE__ */ P(A, { className: "size-6" })
1322
- }) : K.length === 0 ? /* @__PURE__ */ F("div", {
1323
- className: "py-8 text-center",
1324
- children: [/* @__PURE__ */ P(b, { className: "size-10 mx-auto mb-2 text-text-secondary/50" }), /* @__PURE__ */ P("p", {
1325
- className: "text-sm text-text-secondary",
1326
- children: "No actions configured"
1327
- })]
1328
- }) : /* @__PURE__ */ P("div", {
1329
- className: "space-y-2",
1330
- children: [...K].sort((e, t) => e.order - t.order).map((e, t) => /* @__PURE__ */ P(de, {
1331
- className: e.disabled ? "opacity-60" : "",
1332
- children: /* @__PURE__ */ F(fe, {
1333
- className: "p-3 flex items-center gap-2",
1334
- children: [
1335
- /* @__PURE__ */ F("div", {
1336
- className: "flex flex-col gap-0.5",
1337
- children: [/* @__PURE__ */ P(S, {
1338
- variant: "ghost",
1339
- size: "icon-sm",
1340
- onClick: () => Ge(t),
1341
- disabled: t === 0,
1342
- className: "h-5 w-5",
1343
- children: /* @__PURE__ */ P(se, { className: "size-3" })
1344
- }), /* @__PURE__ */ P(S, {
1345
- variant: "ghost",
1346
- size: "icon-sm",
1347
- onClick: () => Ke(t),
1348
- disabled: t === K.length - 1,
1349
- className: "h-5 w-5",
1350
- children: /* @__PURE__ */ P(oe, { className: "size-3" })
1351
- })]
1352
- }),
1353
- /* @__PURE__ */ F("div", {
1354
- className: "flex-1 min-w-0",
1355
- children: [/* @__PURE__ */ F("div", {
1356
- className: "flex items-center gap-2",
1357
- children: [/* @__PURE__ */ P("span", { className: `size-2 rounded-full ${Ce[e.style] || "bg-muted-foreground"}` }), /* @__PURE__ */ P("span", {
1358
- className: "text-sm font-medium truncate",
1359
- children: e.label
1360
- })]
1361
- }), /* @__PURE__ */ F("p", {
1362
- className: "text-xs text-text-secondary",
1363
- children: [
1364
- e.name,
1365
- " • ",
1366
- e.type
1367
- ]
1368
- })]
1369
- }),
1370
- /* @__PURE__ */ F("div", {
1371
- className: "flex gap-1",
1372
- children: [/* @__PURE__ */ P(S, {
1373
- variant: "ghost",
1374
- size: "icon-sm",
1375
- onClick: () => He(e),
1376
- children: /* @__PURE__ */ P(ce, { className: "size-4" })
1377
- }), /* @__PURE__ */ P(S, {
1378
- variant: "ghost",
1379
- size: "icon-sm",
1380
- onClick: () => We(e.id),
1381
- children: /* @__PURE__ */ P(ue, { className: "size-4" })
1382
- })]
1383
- })
1384
- ]
1069
+ /* @__PURE__ */ A(E, {
1070
+ value: "advanced",
1071
+ className: "mt-0 space-y-6",
1072
+ children: [
1073
+ N && /* @__PURE__ */ k(ae, {
1074
+ renderer: N.renderer,
1075
+ rendererOptions: Te,
1076
+ onRendererChange: (e) => {
1077
+ Q("renderer", e), e === "BIGCONSOLE" && Q("template", void 0);
1078
+ },
1079
+ templateEditor: N.renderer === "BIGCONSOLE" ? void 0 : /* @__PURE__ */ k(ke, {
1080
+ widget: {
1081
+ ...z,
1082
+ template: N.template,
1083
+ renderer: N.renderer
1084
+ },
1085
+ onSave: (e) => Q("template", e)
1385
1086
  })
1386
- }, e.id))
1387
- })]
1388
- }),
1389
- /* @__PURE__ */ P(j, {
1390
- value: "drilldown",
1391
- className: "mt-0",
1392
- children: /* @__PURE__ */ P(ae, {
1393
- widget: B,
1394
- onChange: Qe
1395
- })
1396
- }),
1397
- /* @__PURE__ */ P(j, {
1398
- value: "webhooks",
1399
- className: "mt-0",
1400
- children: /* @__PURE__ */ P(re, {
1401
- dashboardId: B.dashboardId,
1402
- widgetId: B.id
1403
- })
1404
- }),
1405
- /* @__PURE__ */ P(j, {
1406
- value: "events",
1407
- className: "mt-0",
1408
- children: /* @__PURE__ */ P(ie, {
1409
- dashboardId: B.dashboardId,
1410
- widgetId: B.id,
1411
- maxHeight: "calc(100vh - 350px)"
1412
- })
1087
+ }),
1088
+ /* @__PURE__ */ A("section", {
1089
+ className: "space-y-4 border-t border-border-default pt-4",
1090
+ children: [/* @__PURE__ */ A("div", {
1091
+ className: "flex items-center justify-between",
1092
+ children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h3", {
1093
+ className: "text-sm font-medium",
1094
+ children: "Widget Actions"
1095
+ }), /* @__PURE__ */ k("p", {
1096
+ className: "text-xs text-text-secondary",
1097
+ children: "Configure buttons on this widget"
1098
+ })] }), /* @__PURE__ */ A(_, {
1099
+ size: "sm",
1100
+ onClick: Ze,
1101
+ children: [/* @__PURE__ */ k(pe, { className: "size-4" }), "Add"]
1102
+ })]
1103
+ }), J ? /* @__PURE__ */ k("div", {
1104
+ className: "flex justify-center py-8",
1105
+ children: /* @__PURE__ */ k(T, { className: "size-6" })
1106
+ }) : q.length === 0 ? /* @__PURE__ */ A("div", {
1107
+ className: "py-8 text-center",
1108
+ children: [/* @__PURE__ */ k(h, { className: "size-10 mx-auto mb-2 text-text-secondary/50" }), /* @__PURE__ */ k("p", {
1109
+ className: "text-sm text-text-secondary",
1110
+ children: "No actions configured"
1111
+ })]
1112
+ }) : /* @__PURE__ */ k("div", {
1113
+ className: "space-y-2",
1114
+ children: [...q].sort((e, t) => e.order - t.order).map((e, t) => /* @__PURE__ */ k(he, {
1115
+ className: e.disabled ? "opacity-60" : "",
1116
+ children: /* @__PURE__ */ A(ge, {
1117
+ className: "p-3 flex items-center gap-2",
1118
+ children: [
1119
+ /* @__PURE__ */ A("div", {
1120
+ className: "flex flex-col gap-0.5",
1121
+ children: [/* @__PURE__ */ k(_, {
1122
+ variant: "ghost",
1123
+ size: "icon-sm",
1124
+ onClick: () => tt(t),
1125
+ disabled: t === 0,
1126
+ className: "h-5 w-5",
1127
+ children: /* @__PURE__ */ k(de, { className: "size-3" })
1128
+ }), /* @__PURE__ */ k(_, {
1129
+ variant: "ghost",
1130
+ size: "icon-sm",
1131
+ onClick: () => nt(t),
1132
+ disabled: t === q.length - 1,
1133
+ className: "h-5 w-5",
1134
+ children: /* @__PURE__ */ k(ue, { className: "size-3" })
1135
+ })]
1136
+ }),
1137
+ /* @__PURE__ */ A("div", {
1138
+ className: "flex-1 min-w-0",
1139
+ children: [/* @__PURE__ */ A("div", {
1140
+ className: "flex items-center gap-2",
1141
+ children: [/* @__PURE__ */ k("span", { className: `size-2 rounded-full ${De[e.style] || "bg-muted-foreground"}` }), /* @__PURE__ */ k("span", {
1142
+ className: "text-sm font-medium truncate",
1143
+ children: e.label
1144
+ })]
1145
+ }), /* @__PURE__ */ A("p", {
1146
+ className: "text-xs text-text-secondary",
1147
+ children: [
1148
+ e.name,
1149
+ " • ",
1150
+ e.type
1151
+ ]
1152
+ })]
1153
+ }),
1154
+ /* @__PURE__ */ A("div", {
1155
+ className: "flex gap-1",
1156
+ children: [/* @__PURE__ */ k(_, {
1157
+ variant: "ghost",
1158
+ size: "icon-sm",
1159
+ onClick: () => Qe(e),
1160
+ children: /* @__PURE__ */ k(fe, { className: "size-4" })
1161
+ }), /* @__PURE__ */ k(_, {
1162
+ variant: "ghost",
1163
+ size: "icon-sm",
1164
+ onClick: () => et(e.id),
1165
+ children: /* @__PURE__ */ k(me, { className: "size-4" })
1166
+ })]
1167
+ })
1168
+ ]
1169
+ })
1170
+ }, e.id))
1171
+ })]
1172
+ }),
1173
+ /* @__PURE__ */ A("section", {
1174
+ className: "space-y-3 border-t border-border-default pt-4",
1175
+ children: [/* @__PURE__ */ k("h3", {
1176
+ className: "text-sm font-semibold text-text-primary",
1177
+ children: "Drilldown"
1178
+ }), /* @__PURE__ */ k(ie, {
1179
+ widget: z,
1180
+ onChange: ct
1181
+ })]
1182
+ }),
1183
+ /* @__PURE__ */ A("section", {
1184
+ className: "space-y-3 border-t border-border-default pt-4",
1185
+ children: [/* @__PURE__ */ k("h3", {
1186
+ className: "text-sm font-semibold text-text-primary",
1187
+ children: "Webhooks"
1188
+ }), /* @__PURE__ */ k(ne, {
1189
+ dashboardId: z.dashboardId,
1190
+ widgetId: z.id
1191
+ })]
1192
+ }),
1193
+ /* @__PURE__ */ A("section", {
1194
+ className: "space-y-3 border-t border-border-default pt-4",
1195
+ children: [/* @__PURE__ */ k("h3", {
1196
+ className: "text-sm font-semibold text-text-primary",
1197
+ children: "Events"
1198
+ }), /* @__PURE__ */ k(re, {
1199
+ dashboardId: z.dashboardId,
1200
+ widgetId: z.id,
1201
+ maxHeight: "calc(100vh - 350px)"
1202
+ })]
1203
+ })
1204
+ ]
1413
1205
  }),
1414
- /* @__PURE__ */ P(j, {
1206
+ /* @__PURE__ */ k(E, {
1415
1207
  value: "appearance",
1416
1208
  className: "mt-0",
1417
- children: et ? /* @__PURE__ */ P(et, {
1418
- config: B.config || {},
1419
- onChange: Ze
1420
- }) : /* @__PURE__ */ P("div", {
1421
- className: "p-4 bg-bg-sunken rounded-lg text-center",
1422
- children: /* @__PURE__ */ P("p", {
1423
- className: "text-sm text-text-secondary",
1424
- children: "No style options for this widget type"
1425
- })
1209
+ children: /* @__PURE__ */ k(oe, {
1210
+ widgetType: z.type,
1211
+ config: z.config || {},
1212
+ onChange: st
1426
1213
  })
1427
1214
  })
1428
1215
  ]
1429
1216
  })]
1430
- }) : /* @__PURE__ */ P("div", {
1217
+ }) : /* @__PURE__ */ k("div", {
1431
1218
  className: "flex-1 flex items-center justify-center p-4",
1432
- children: /* @__PURE__ */ F("div", {
1219
+ children: /* @__PURE__ */ A("div", {
1433
1220
  className: "text-center",
1434
- children: [/* @__PURE__ */ P(b, { className: "size-12 mx-auto mb-3 text-text-secondary" }), /* @__PURE__ */ P("p", {
1221
+ children: [/* @__PURE__ */ k(h, { className: "size-12 mx-auto mb-3 text-text-secondary" }), /* @__PURE__ */ k("p", {
1435
1222
  className: "text-sm text-text-secondary",
1436
1223
  children: "Select a widget to edit"
1437
1224
  })]
1438
1225
  })
1439
1226
  }),
1440
- B && /* @__PURE__ */ F("div", {
1227
+ z && /* @__PURE__ */ A("div", {
1441
1228
  style: {
1442
1229
  padding: "var(--space-cardPadding)",
1443
1230
  borderTop: "1px solid var(--color-border)",
@@ -1445,7 +1232,7 @@ var I = p(function({ isOpen: s, onClose: c }) {
1445
1232
  flexShrink: 0
1446
1233
  },
1447
1234
  children: [
1448
- I && /* @__PURE__ */ F("div", {
1235
+ F && /* @__PURE__ */ A("div", {
1449
1236
  style: {
1450
1237
  display: "flex",
1451
1238
  alignItems: "center",
@@ -1456,13 +1243,13 @@ var I = p(function({ isOpen: s, onClose: c }) {
1456
1243
  borderRadius: "var(--radius-button)",
1457
1244
  border: "1px solid var(--color-status-warning-border, rgba(251, 191, 36, 0.3))"
1458
1245
  },
1459
- children: [/* @__PURE__ */ P("div", { style: {
1246
+ children: [/* @__PURE__ */ k("div", { style: {
1460
1247
  width: "8px",
1461
1248
  height: "8px",
1462
1249
  borderRadius: "50%",
1463
1250
  backgroundColor: "var(--color-status-warning-bg)",
1464
1251
  flexShrink: 0
1465
- } }), /* @__PURE__ */ P("span", {
1252
+ } }), /* @__PURE__ */ k("span", {
1466
1253
  style: {
1467
1254
  fontSize: "var(--font-size-body-sm)",
1468
1255
  color: "var(--color-status-warning-text, #92400e)",
@@ -1471,7 +1258,7 @@ var I = p(function({ isOpen: s, onClose: c }) {
1471
1258
  children: "You have unsaved changes"
1472
1259
  })]
1473
1260
  }),
1474
- d === "saved" && !I && /* @__PURE__ */ F("div", {
1261
+ j === "saved" && !F && /* @__PURE__ */ A("div", {
1475
1262
  style: {
1476
1263
  display: "flex",
1477
1264
  alignItems: "center",
@@ -1482,12 +1269,12 @@ var I = p(function({ isOpen: s, onClose: c }) {
1482
1269
  borderRadius: "var(--radius-button)",
1483
1270
  border: "1px solid var(--color-status-success-border, rgba(34, 197, 94, 0.3))"
1484
1271
  },
1485
- children: [/* @__PURE__ */ P(v, { style: {
1272
+ children: [/* @__PURE__ */ k(p, { style: {
1486
1273
  width: "var(--size-icon-sm)",
1487
1274
  height: "var(--size-icon-sm)",
1488
1275
  color: "var(--color-status-success-text)",
1489
1276
  flexShrink: 0
1490
- } }), /* @__PURE__ */ P("span", {
1277
+ } }), /* @__PURE__ */ k("span", {
1491
1278
  style: {
1492
1279
  fontSize: "var(--font-size-body-sm)",
1493
1280
  color: "var(--color-status-success-text)",
@@ -1496,7 +1283,7 @@ var I = p(function({ isOpen: s, onClose: c }) {
1496
1283
  children: "All changes saved"
1497
1284
  })]
1498
1285
  }),
1499
- d === "error" && /* @__PURE__ */ F("div", {
1286
+ j === "error" && /* @__PURE__ */ A("div", {
1500
1287
  style: {
1501
1288
  display: "flex",
1502
1289
  alignItems: "center",
@@ -1507,12 +1294,12 @@ var I = p(function({ isOpen: s, onClose: c }) {
1507
1294
  borderRadius: "var(--radius-button)",
1508
1295
  border: "1px solid var(--color-status-error-border)"
1509
1296
  },
1510
- children: [/* @__PURE__ */ P(x, { style: {
1297
+ children: [/* @__PURE__ */ k(g, { style: {
1511
1298
  width: "var(--size-icon-sm)",
1512
1299
  height: "var(--size-icon-sm)",
1513
1300
  color: "var(--color-status-error-text)",
1514
1301
  flexShrink: 0
1515
- } }), /* @__PURE__ */ P("span", {
1302
+ } }), /* @__PURE__ */ k("span", {
1516
1303
  style: {
1517
1304
  fontSize: "var(--font-size-body-sm)",
1518
1305
  color: "var(--color-status-error-text)",
@@ -1521,50 +1308,50 @@ var I = p(function({ isOpen: s, onClose: c }) {
1521
1308
  children: "Failed to save changes"
1522
1309
  })]
1523
1310
  }),
1524
- /* @__PURE__ */ F("div", {
1311
+ /* @__PURE__ */ A("div", {
1525
1312
  style: {
1526
1313
  display: "flex",
1527
1314
  gap: "var(--space-controlGap)"
1528
1315
  },
1529
- children: [/* @__PURE__ */ P(S, {
1530
- onClick: Ye,
1531
- disabled: d === "saving" || !I,
1316
+ children: [/* @__PURE__ */ k(_, {
1317
+ onClick: at,
1318
+ disabled: j === "saving" || !F,
1532
1319
  style: {
1533
1320
  flex: 1,
1534
1321
  height: "var(--size-controlHeight-md)",
1535
- backgroundColor: I ? "var(--color-action-primary-bg)" : void 0,
1536
- opacity: I ? 1 : .5
1322
+ backgroundColor: F ? "var(--color-action-primary-bg)" : void 0,
1323
+ opacity: F ? 1 : .5
1537
1324
  },
1538
- children: d === "saving" ? /* @__PURE__ */ F("span", {
1325
+ children: j === "saving" ? /* @__PURE__ */ A("span", {
1539
1326
  style: {
1540
1327
  display: "flex",
1541
1328
  alignItems: "center",
1542
1329
  gap: "var(--space-iconGap)"
1543
1330
  },
1544
- children: [/* @__PURE__ */ P(A, { style: {
1331
+ children: [/* @__PURE__ */ k(T, { style: {
1545
1332
  width: "var(--size-icon-sm)",
1546
1333
  height: "var(--size-icon-sm)"
1547
1334
  } }), "Saving..."]
1548
- }) : /* @__PURE__ */ F("span", {
1335
+ }) : /* @__PURE__ */ A("span", {
1549
1336
  style: {
1550
1337
  display: "flex",
1551
1338
  alignItems: "center",
1552
1339
  gap: "var(--space-iconGap)"
1553
1340
  },
1554
- children: [/* @__PURE__ */ P(v, { style: {
1341
+ children: [/* @__PURE__ */ k(p, { style: {
1555
1342
  width: "var(--size-icon-sm)",
1556
1343
  height: "var(--size-icon-sm)"
1557
1344
  } }), "Save Changes"]
1558
1345
  })
1559
- }), /* @__PURE__ */ F(S, {
1346
+ }), /* @__PURE__ */ A(_, {
1560
1347
  variant: "outline",
1561
- onClick: Xe,
1562
- disabled: d === "saving" || !I,
1348
+ onClick: ot,
1349
+ disabled: j === "saving" || !F,
1563
1350
  style: {
1564
1351
  height: "var(--size-controlHeight-md)",
1565
- opacity: I ? 1 : .5
1352
+ opacity: F ? 1 : .5
1566
1353
  },
1567
- children: [/* @__PURE__ */ P(x, { style: {
1354
+ children: [/* @__PURE__ */ k(g, { style: {
1568
1355
  width: "var(--size-icon-sm)",
1569
1356
  height: "var(--size-icon-sm)"
1570
1357
  } }), "Discard"]
@@ -1572,20 +1359,20 @@ var I = p(function({ isOpen: s, onClose: c }) {
1572
1359
  })
1573
1360
  ]
1574
1361
  }),
1575
- /* @__PURE__ */ P(ne, {
1576
- isOpen: Le,
1577
- action: Re,
1578
- isLoading: ze,
1362
+ /* @__PURE__ */ k(te, {
1363
+ isOpen: qe,
1364
+ action: Je,
1365
+ isLoading: Ye,
1579
1366
  onClose: () => {
1580
1367
  X(!1), Z(void 0);
1581
1368
  },
1582
- onSave: Ue
1369
+ onSave: $e
1583
1370
  })
1584
1371
  ]
1585
1372
  })
1586
1373
  });
1587
1374
  });
1588
1375
  //#endregion
1589
- export { I as default };
1376
+ export { je as default };
1590
1377
 
1591
1378
  //# sourceMappingURL=PropertiesPanel.js.map