@burdenoff/microfe-bigconsole 2026.1010.12 → 2026.1012.1

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 (161) hide show
  1. package/README.md +19 -0
  2. package/dist/bigconsole/BigConsoleRoot.js +88 -82
  3. package/dist/bigconsole/BigConsoleRoutes.js +163 -136
  4. package/dist/bigconsole/assistant/assistantProduct.js +1 -4
  5. package/dist/bigconsole/assistant/pageContext.d.ts +0 -14
  6. package/dist/bigconsole/assistant/pageContext.js +1 -6
  7. package/dist/bigconsole/assistant/recordAdapters.js +26 -27
  8. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +31 -31
  9. package/dist/bigconsole/components/common/index.d.ts +0 -1
  10. package/dist/bigconsole/components/common/index.js +0 -1
  11. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +44 -44
  12. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +36 -36
  13. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +59 -59
  14. package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +58 -57
  15. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +30 -30
  16. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +41 -41
  17. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +34 -34
  18. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +34 -34
  19. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +110 -110
  20. package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +21 -21
  21. package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +46 -46
  22. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +164 -173
  23. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +101 -101
  24. package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +31 -31
  25. package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.js +15 -15
  26. package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -1
  27. package/dist/bigconsole/components/dashboard/WidgetPalette.js +165 -163
  28. package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +37 -37
  29. package/dist/bigconsole/components/datasink/AlertRuleEditor.js +66 -66
  30. package/dist/bigconsole/components/datasink/CacheTTLSelector.js +35 -35
  31. package/dist/bigconsole/components/datasink/DataSinkCard.js +50 -51
  32. package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +18 -18
  33. package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +20 -20
  34. package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +47 -47
  35. package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +91 -91
  36. package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +35 -35
  37. package/dist/bigconsole/components/parser/DataSinkSelector.js +40 -40
  38. package/dist/bigconsole/components/parser/ImportParserDialog.js +120 -120
  39. package/dist/bigconsole/components/parser/ParserSelector.js +51 -51
  40. package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +10 -10
  41. package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +76 -77
  42. package/dist/bigconsole/components/preview/AiPreviewPanel.js +95 -96
  43. package/dist/bigconsole/components/widgets/ActionConfigDialog.js +4 -4
  44. package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +93 -93
  45. package/dist/bigconsole/components/widgets/PropertiesPanel.js +499 -507
  46. package/dist/bigconsole/components/widgets/WidgetRegistry.js +0 -1
  47. package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +4 -4
  48. package/dist/bigconsole/components/widgets/chart/ChartConfig.js +48 -48
  49. package/dist/bigconsole/components/widgets/comments/WidgetComments.js +46 -46
  50. package/dist/bigconsole/components/widgets/custom/CustomWidget.js +73 -131
  51. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +61 -61
  52. package/dist/bigconsole/components/widgets/form/FormWidget.js +36 -36
  53. package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +42 -42
  54. package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +25 -25
  55. package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.d.ts +28 -9
  56. package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.js +115 -42
  57. package/dist/bigconsole/components/widgets/iframe-widget/framePolicy.d.ts +20 -0
  58. package/dist/bigconsole/components/widgets/iframe-widget/framePolicy.js +10 -0
  59. package/dist/bigconsole/components/widgets/iframe-widget/index.d.ts +2 -1
  60. package/dist/bigconsole/components/widgets/iframe-widget/index.js +3 -2
  61. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +4 -4
  62. package/dist/bigconsole/components/widgets/list/ListConfig.js +30 -30
  63. package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +38 -38
  64. package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +9 -9
  65. package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +9 -9
  66. package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +49 -49
  67. package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +39 -39
  68. package/dist/bigconsole/components/widgets/table/TableConfig.js +73 -73
  69. package/dist/bigconsole/components/widgets/text-widget/TextWidget.js +110 -27
  70. package/dist/bigconsole/components/widgets/text-widget/textData.d.ts +6 -0
  71. package/dist/bigconsole/components/widgets/text-widget/textData.js +17 -14
  72. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +64 -64
  73. package/dist/bigconsole/components/workflow/WorkflowOpenGuard.js +15 -15
  74. package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +15 -15
  75. package/dist/bigconsole/context/BigConsoleContext.d.ts +10 -0
  76. package/dist/bigconsole/context/BigConsoleContext.js +47 -30
  77. package/dist/bigconsole/context/index.d.ts +1 -1
  78. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +58 -49
  79. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +74 -72
  80. package/dist/bigconsole/customWidget/proposalPreview.d.ts +5 -0
  81. package/dist/bigconsole/customWidget/proposalPreview.js +31 -0
  82. package/dist/bigconsole/hooks/useDataSinkAlerts.d.ts +0 -23
  83. package/dist/bigconsole/hooks/useDataSinkAlerts.js +113 -138
  84. package/dist/bigconsole/hooks/useDataSinkOperations.d.ts +7 -0
  85. package/dist/bigconsole/hooks/useDataSinkOperations.js +109 -98
  86. package/dist/bigconsole/hooks/useDataSinkSubscription.js +0 -1
  87. package/dist/bigconsole/hooks/useDrilldown.js +68 -67
  88. package/dist/bigconsole/hooks/useExportDataSink.js +1 -1
  89. package/dist/bigconsole/hooks/useGlobalFilters.js +3 -3
  90. package/dist/bigconsole/hooks/useImportDataSink.js +102 -90
  91. package/dist/bigconsole/pages/AdminPage.js +130 -130
  92. package/dist/bigconsole/pages/DashboardBuilderPage.js +60 -72
  93. package/dist/bigconsole/pages/DashboardViewPage.js +235 -258
  94. package/dist/bigconsole/pages/DashboardsPage.js +221 -269
  95. package/dist/bigconsole/pages/DataParsersPage.js +157 -180
  96. package/dist/bigconsole/pages/DataSinkAlertsPage.js +55 -62
  97. package/dist/bigconsole/pages/DataSinkBuilderPage.js +318 -295
  98. package/dist/bigconsole/pages/DataSinkViewPage.js +256 -255
  99. package/dist/bigconsole/pages/DataSinksPage.js +216 -251
  100. package/dist/bigconsole/pages/DataSourcesPage.js +5 -5
  101. package/dist/bigconsole/pages/InsightsPage.js +265 -279
  102. package/dist/bigconsole/pages/OverviewPage.js +47 -47
  103. package/dist/bigconsole/pages/ParserBuilderPage.js +213 -229
  104. package/dist/bigconsole/pages/ParserViewPage.js +97 -97
  105. package/dist/bigconsole/pages/PipelineBuilderPage.js +214 -256
  106. package/dist/bigconsole/pages/PipelineViewPage.js +146 -146
  107. package/dist/bigconsole/pages/PipelinesPage.js +88 -107
  108. package/dist/bigconsole/pages/SettingsPage.js +173 -179
  109. package/dist/bigconsole/pages/WidgetDemoPage.js +42 -42
  110. package/dist/bigconsole/pages/WorkflowViewPage.js +1 -1
  111. package/dist/bigconsole/pages/WorkflowsPage.js +141 -141
  112. package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +12 -12
  113. package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +235 -122
  114. package/dist/bigconsole/renderers/adapters/BlockKitRenderer.d.ts +6 -1
  115. package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +151 -151
  116. package/dist/bigconsole/renderers/adapters/CustomRenderer.js +46 -46
  117. package/dist/bigconsole/renderers/adapters/adaptiveCardContent.d.ts +29 -0
  118. package/dist/bigconsole/renderers/adapters/adaptiveCardContent.js +51 -0
  119. package/dist/bigconsole/store/widgetStore.d.ts +0 -12
  120. package/dist/bigconsole/store/widgetStore.js +1 -3
  121. package/dist/bigconsole/types/index.d.ts +17 -2
  122. package/dist/bigconsole/utils/backendError.d.ts +0 -18
  123. package/dist/bigconsole/utils/dataSinkPayload.d.ts +48 -0
  124. package/dist/bigconsole/utils/dataSinkPayload.js +38 -0
  125. package/dist/bigconsole/utils/index.d.ts +2 -0
  126. package/dist/bigconsole/utils/safeUrl.d.ts +79 -0
  127. package/dist/bigconsole/utils/safeUrl.js +93 -0
  128. package/dist/bigconsole/utils/sanitizeHtml.d.ts +16 -0
  129. package/dist/bigconsole/utils/sanitizeHtml.js +67 -0
  130. package/dist/bigconsole/workflowOpen.js +14 -15
  131. package/dist/generated/wspace-operations.d.ts +138 -8
  132. package/dist/generated/wspace-operations.js +281 -240
  133. package/dist/node_modules/dompurify/dist/purify.es.js +800 -0
  134. package/package.json +9 -5
  135. package/dist/bigconsole/assistant/displayCopy.d.ts +0 -32
  136. package/dist/bigconsole/assistant/pageControls.d.ts +0 -81
  137. package/dist/bigconsole/assistant/pageControls.js +0 -169
  138. package/dist/bigconsole/assistant/previewControl.d.ts +0 -16
  139. package/dist/bigconsole/assistant/previewControl.js +0 -10
  140. package/dist/bigconsole/assistant/usePreviewControl.d.ts +0 -2
  141. package/dist/bigconsole/assistant/usePreviewControl.js +0 -20
  142. package/dist/bigconsole/components/common/SortBySelect.d.ts +0 -11
  143. package/dist/bigconsole/components/common/SortBySelect.js +0 -29
  144. package/dist/bigconsole/constants/backendErrors.js +0 -94
  145. package/dist/bigconsole/hooks/useDashboardLayoutBaseline.d.ts +0 -14
  146. package/dist/bigconsole/hooks/useDashboardLayoutBaseline.js +0 -32
  147. package/dist/bigconsole/utils/backendError.js +0 -42
  148. package/dist/bigconsole/utils/dashboardList.d.ts +0 -28
  149. package/dist/bigconsole/utils/dashboardList.js +0 -15
  150. package/dist/bigconsole/utils/dataSinkList.d.ts +0 -15
  151. package/dist/bigconsole/utils/dataSinkList.js +0 -15
  152. package/dist/bigconsole/utils/formDirty.d.ts +0 -82
  153. package/dist/bigconsole/utils/formDirty.js +0 -21
  154. package/dist/bigconsole/utils/insightsDraft.d.ts +0 -29
  155. package/dist/bigconsole/utils/insightsDraft.js +0 -8
  156. package/dist/bigconsole/utils/layoutBaseline.d.ts +0 -130
  157. package/dist/bigconsole/utils/layoutBaseline.js +0 -96
  158. package/dist/bigconsole/utils/listSort.d.ts +0 -80
  159. package/dist/bigconsole/utils/listSort.js +0 -85
  160. package/dist/bigconsole/utils/widgetFormDirty.d.ts +0 -16
  161. package/dist/bigconsole/utils/widgetFormDirty.js +0 -13
@@ -1,29 +1,28 @@
1
1
  import { useAppNavigate as e } from "../contexts/NavigationContext.js";
2
2
  import "../contexts/index.js";
3
3
  import { reportBigConsoleQuotaError as t } from "../utils/quota.js";
4
- import { Section as n, SectionStack as ee } from "../components/common/Section.js";
4
+ import { Section as n, SectionStack as r } from "../components/common/Section.js";
5
5
  import "../components/common/index.js";
6
- import te from "../hooks/useDataSinkOperations.js";
7
- import { BIGCONSOLE_PERMISSIONS as r } from "../../constants/permissions.js";
8
- import { loadBigConsoleSettings as ne } from "../hooks/useBigConsoleSettings.js";
9
- import { isDirty as re } from "../utils/formDirty.js";
10
- import { isNative as ie, nativeCopyText as ae, nativeToast as oe } from "../../utils/nativeBridge.js";
11
- import se from "../components/datasink/CacheTTLSelector.js";
12
- import ce from "../components/datasink/RefreshTypeSelector.js";
13
- import { memo as i, useCallback as a, useEffect as o, useMemo as le, useState as s } from "react";
6
+ import ee from "../hooks/useDataSinkOperations.js";
7
+ import { BIGCONSOLE_PERMISSIONS as i } from "../../constants/permissions.js";
8
+ import { loadBigConsoleSettings as te } from "../hooks/useBigConsoleSettings.js";
9
+ import { isNative as ne, nativeCopyText as re, nativeToast as ie } from "../../utils/nativeBridge.js";
10
+ import ae from "../components/datasink/CacheTTLSelector.js";
11
+ import oe from "../components/datasink/RefreshTypeSelector.js";
12
+ import { diffPayloadEditor as se, formatPayloadForEditor as ce } from "../utils/dataSinkPayload.js";
13
+ import { memo as a, useCallback as o, useEffect as s, useMemo as le, useState as c } from "react";
14
14
  import { useParams as ue } from "react-router";
15
15
  import { AccessDenied as de, PermissionButton as fe } from "@burdenoff/fe-libs/shared/components";
16
16
  import { usePermissions as pe } from "@burdenoff/fe-libs/shared/providers/shell";
17
- import { AlertCircle as c, ArrowLeft as l, Check as u, Copy as d, Database as f, Eye as p, ListChecks as me, Loader2 as m, Save as he, Settings as ge } from "lucide-react";
18
- import { Button as h, IllustratedEmptyState as _e, Input as g, Label as _, PagePurpose as ve, Textarea as v } from "@burdenoff/fe-libs/ui";
19
- import { useUnsavedChanges as ye } from "@burdenoff/fe-libs/shared/hooks";
20
- import { useI18n as be } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
21
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
17
+ import { AlertCircle as l, ArrowLeft as u, Check as me, Copy as he, Database as d, Eye as f, ListChecks as ge, Loader2 as p, Save as _e, Settings as ve } from "lucide-react";
18
+ import { Button as m, IllustratedEmptyState as ye, Input as h, Label as g, PagePurpose as be, Textarea as _ } from "@burdenoff/fe-libs/ui";
19
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
20
+ import { useI18n as xe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
22
21
  //#region src/bigconsole/pages/DataSinkBuilderPage.tsx
23
- function xe(e) {
22
+ function Se(e) {
24
23
  return e.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "").substring(0, 64);
25
24
  }
26
- function Se(e, t) {
25
+ function Ce(e, t) {
27
26
  let n = {};
28
27
  if (e.name.trim() ? e.name.length < 2 ? n.name = t("bigconsole.dataSinks.builder.validation.nameMinLength", "Name must be at least 2 characters") : e.name.length > 100 && (n.name = t("bigconsole.dataSinks.builder.validation.nameMaxLength", "Name must be less than 100 characters")) : n.name = t("bigconsole.dataSinks.builder.validation.nameRequired", "Name is required"), e.key.trim() ? /^[a-z0-9_]+$/.test(e.key) ? e.key.length > 64 && (n.key = t("bigconsole.dataSinks.builder.validation.keyMaxLength", "Key must be less than 64 characters")) : n.key = t("bigconsole.dataSinks.builder.validation.keyFormat", "Key can only contain lowercase letters, numbers, and underscores") : n.key = t("bigconsole.dataSinks.builder.validation.keyRequired", "Key is required"), e.data && e.data.trim()) try {
29
28
  JSON.parse(e.data);
@@ -32,506 +31,530 @@ function Se(e, t) {
32
31
  }
33
32
  return n;
34
33
  }
35
- var S = i(function() {
36
- let { dataSinkId: i } = ue(), S = e(), { t: C } = be(), w = i !== "new" && !!i, { hasPermission: T, isLoading: Ce } = pe(), we = T(r.DATASINK_READ), E = w ? r.DATASINK_UPDATE : r.DATASINK_CREATE, [D, O] = s({
34
+ var x = a(function() {
35
+ let { dataSinkId: a } = ue(), x = e(), { t: S } = xe(), C = a !== "new" && !!a, { hasPermission: we, isLoading: Te } = pe(), Ee = we(i.DATASINK_READ), De = C ? i.DATASINK_UPDATE : i.DATASINK_CREATE, [w, T] = c({
37
36
  name: "",
38
37
  key: "",
39
38
  description: "",
40
39
  ttl: (() => {
41
- let e = ne();
40
+ let e = te();
42
41
  return e.cacheEnabled ? e.cacheTTLSeconds : 0;
43
42
  })(),
44
43
  refresh: { type: "manual" },
45
- data: "{}"
46
- }), [k, A] = s(() => w ? null : D);
47
- ye({
48
- id: "datasink-editor",
49
- label: C("bigconsole.assistant.unsaved.dataSourceForm", "the data source form"),
50
- dirty: re(D, k)
51
- });
52
- let [j, M] = s({}), [N, P] = s(!1), [F, I] = s(!1), [L, R] = s(null), [Te, z] = s(!1), [B, V] = s(!1), [H, U] = s(null), [W, G] = s(null), { loading: Ee, error: K, dataSinks: De, fetchDataSink: q, createDataSink: J, updateDataSink: Y, getDataSinkData: X } = te({ skipFetch: !0 }), Z = w ? De.find((e) => e.id === i) : null;
53
- o(() => {
54
- w && i && !Z && q(i);
44
+ data: C ? "" : "{}"
45
+ }), [E, D] = c({}), [O, Oe] = c(!1), [k, A] = c(!1), [j, M] = c(null), [ke, N] = c(!1), [P, F] = c(!1), [I, L] = c(null), [R, z] = c(null), [B, V] = c("idle"), [H, U] = c(null), { loading: Ae, error: W, dataSinks: je, fetchDataSink: G, fetchDataSinkPayload: K, createDataSink: q, updateDataSink: J, getDataSinkData: Y } = ee({ skipFetch: !0 }), X = C ? je.find((e) => e.id === a) : null;
46
+ s(() => {
47
+ C && a && !X && G(a);
55
48
  }, [
56
- w,
57
- i,
58
- Z,
59
- q
60
- ]);
61
- let [Q, Oe] = s(!1);
62
- o(() => {
63
- if (Z && !Q) {
64
- let e = "";
65
- if (Z.data) try {
66
- if (typeof Z.data == "string") {
67
- let t = JSON.parse(Z.data);
68
- e = JSON.stringify(t, null, 2);
69
- } else e = JSON.stringify(Z.data, null, 2);
70
- } catch {
71
- e = typeof Z.data == "string" ? Z.data : "";
49
+ C,
50
+ a,
51
+ X,
52
+ G
53
+ ]), s(() => {
54
+ if (!C || !a) return;
55
+ let e = !1;
56
+ return V("loading"), U(null), K(a).then((t) => {
57
+ if (e) return;
58
+ if (!t) {
59
+ V("unavailable");
60
+ return;
72
61
  }
73
- let t = {
74
- name: Z.name || "",
75
- key: Z.key || "",
76
- description: Z.description || "",
77
- ttl: Z.ttl ?? 300,
78
- refresh: Z.refresh ? {
79
- type: Z.refresh.type === "scheduled" ? "scheduled" : "manual",
80
- schedule: Z.refresh.schedule ? {
81
- cron: Z.refresh.schedule.cron,
82
- timezone: Z.refresh.schedule.timezone
83
- } : void 0
84
- } : { type: "manual" },
85
- data: e
86
- };
87
- O(t), A(t), P(!0), Oe(!0), M({});
88
- }
89
- }, [Z, Q]);
90
- let ke = a((e) => {
62
+ let n = ce(t.data);
63
+ U(n), T((e) => ({
64
+ ...e,
65
+ data: n
66
+ })), V("loaded");
67
+ }).catch(() => {
68
+ e || V("unavailable");
69
+ }), () => {
70
+ e = !0;
71
+ };
72
+ }, [
73
+ C,
74
+ a,
75
+ K
76
+ ]);
77
+ let [Z, Me] = c(!1);
78
+ s(() => {
79
+ X && !Z && (T((e) => ({
80
+ ...e,
81
+ name: X.name || "",
82
+ key: X.key || "",
83
+ description: X.description || "",
84
+ ttl: X.ttl ?? 300,
85
+ refresh: X.refresh ? {
86
+ type: X.refresh.type === "scheduled" ? "scheduled" : "manual",
87
+ schedule: X.refresh.schedule ? {
88
+ cron: X.refresh.schedule.cron,
89
+ timezone: X.refresh.schedule.timezone
90
+ } : void 0
91
+ } : { type: "manual" }
92
+ })), Oe(!0), Me(!0), D({}));
93
+ }, [X, Z]);
94
+ let Ne = o((e) => {
91
95
  let t = e.target.value;
92
- O((e) => ({
96
+ T((e) => ({
93
97
  ...e,
94
98
  name: t,
95
- key: N ? e.key : xe(t)
96
- })), M((e) => ({
99
+ key: O ? e.key : Se(t)
100
+ })), D((e) => ({
97
101
  ...e,
98
102
  name: void 0
99
103
  }));
100
- }, [N]), Ae = a((e) => {
104
+ }, [O]), Pe = o((e) => {
101
105
  let t = e.target.value.toLowerCase().replace(/[^a-z0-9_]/g, "");
102
- O((e) => ({
106
+ T((e) => ({
103
107
  ...e,
104
108
  key: t
105
- })), P(!0), M((e) => ({
109
+ })), Oe(!0), D((e) => ({
106
110
  ...e,
107
111
  key: void 0
108
112
  }));
109
- }, []), je = a((e) => {
110
- O((t) => ({
113
+ }, []), Fe = o((e) => {
114
+ T((t) => ({
111
115
  ...t,
112
116
  description: e.target.value
113
117
  }));
114
- }, []), Me = a((e) => {
115
- O((t) => ({
118
+ }, []), Ie = o((e) => {
119
+ T((t) => ({
116
120
  ...t,
117
121
  ttl: e || 0
118
122
  }));
119
- }, []), Ne = a((e) => {
120
- O((t) => ({
123
+ }, []), Le = o((e) => {
124
+ T((t) => ({
121
125
  ...t,
122
126
  refresh: e
123
127
  }));
124
- }, []), Pe = a((e) => {
125
- O((t) => ({
128
+ }, []), Re = o((e) => {
129
+ T((t) => ({
126
130
  ...t,
127
131
  data: e.target.value
128
- })), M((e) => ({
132
+ })), D((e) => ({
129
133
  ...e,
130
134
  data: void 0
131
135
  }));
132
- }, []), Fe = a(() => {
136
+ }, []), ze = o(() => {
133
137
  try {
134
- let e = JSON.parse(D.data);
135
- O((t) => ({
138
+ let e = JSON.parse(w.data);
139
+ T((t) => ({
136
140
  ...t,
137
141
  data: JSON.stringify(e, null, 2)
138
- })), M((e) => ({
142
+ })), D((e) => ({
139
143
  ...e,
140
144
  data: void 0
141
145
  }));
142
146
  } catch {
143
- M((e) => ({
147
+ D((e) => ({
144
148
  ...e,
145
- data: C("bigconsole.dataSinks.builder.validation.invalidJson", "Invalid JSON format")
149
+ data: S("bigconsole.dataSinks.builder.validation.invalidJson", "Invalid JSON format")
146
150
  }));
147
151
  }
148
- }, [D.data, C]), Ie = a(async () => {
149
- D.key && (await ae(D.key), z(!0), ie() && oe(C("bigconsole.dataSinks.builder.toolbar.keyCopied", "Key copied")), setTimeout(() => z(!1), 2e3));
150
- }, [D.key, C]), $ = a(() => {
151
- S("/datasinks");
152
- }, [S]), Le = a(async () => {
153
- if (!(!w || !Z)) {
154
- V(!0), G(null);
152
+ }, [w.data, S]), Be = o(async () => {
153
+ w.key && (await re(w.key), N(!0), ne() && ie(S("bigconsole.dataSinks.builder.toolbar.keyCopied", "Key copied")), setTimeout(() => N(!1), 2e3));
154
+ }, [w.key, S]), Q = o(() => {
155
+ x("/datasinks");
156
+ }, [x]), Ve = o(async () => {
157
+ if (!(!C || !X)) {
158
+ F(!0), z(null);
155
159
  try {
156
- let e = await X({ key: Z.key });
157
- e?.raw ? U(Array.isArray(e.raw) ? e.raw.slice(0, 20) : [e.raw]) : U([]);
160
+ let e = await Y({ key: X.key });
161
+ e?.raw ? L(Array.isArray(e.raw) ? e.raw.slice(0, 20) : [e.raw]) : L([]);
158
162
  } catch (e) {
159
- G(e instanceof Error ? e.message : C("bigconsole.dataSinks.builder.errors.loadDataFailed", "Failed to load data"));
163
+ z(e instanceof Error ? e.message : S("bigconsole.dataSinks.builder.errors.loadDataFailed", "Failed to load data"));
160
164
  } finally {
161
- V(!1);
165
+ F(!1);
162
166
  }
163
167
  }
164
168
  }, [
165
- w,
166
- Z,
169
+ C,
167
170
  X,
168
- C
169
- ]), Re = a(async (e) => {
170
- e.preventDefault(), R(null);
171
- let n = Se(D, C);
171
+ Y,
172
+ S
173
+ ]), He = o(async (e) => {
174
+ e.preventDefault(), M(null);
175
+ let n = Ce(w, S);
172
176
  if (Object.keys(n).length > 0) {
173
- M(n);
177
+ D(n);
174
178
  return;
175
179
  }
176
- I(!0);
180
+ let r = () => {
181
+ D((e) => ({
182
+ ...e,
183
+ data: S("bigconsole.dataSinks.builder.validation.invalidJson", "Invalid JSON format")
184
+ }));
185
+ };
186
+ A(!0);
177
187
  try {
178
- let e = {};
179
- if (D.data && D.data.trim()) try {
180
- e = JSON.parse(D.data);
181
- } catch {
182
- M((e) => ({
183
- ...e,
184
- data: C("bigconsole.dataSinks.builder.validation.invalidJson", "Invalid JSON format")
185
- })), I(!1);
186
- return;
187
- }
188
- if (w && Z) {
189
- if (!await Y({
190
- id: Z.id,
191
- version: Z.version,
192
- name: D.name,
193
- description: D.description || void 0,
194
- ttl: D.ttl,
188
+ if (C && X) {
189
+ let e = se(w.data, H);
190
+ if (e.status === "invalid") {
191
+ r();
192
+ return;
193
+ }
194
+ if (!await J({
195
+ id: X.id,
196
+ version: X.version,
197
+ name: w.name,
198
+ description: w.description || void 0,
199
+ ttl: w.ttl,
200
+ refresh: {
201
+ type: w.refresh.type,
202
+ schedule: w.refresh.schedule
203
+ },
204
+ ...e.status === "changed" ? { data: e.payload } : {}
205
+ })) throw Error(S("bigconsole.dataSinks.builder.errors.updateFailed", "Failed to update DataSink"));
206
+ } else {
207
+ let e = {};
208
+ if (w.data && w.data.trim()) try {
209
+ e = JSON.parse(w.data);
210
+ } catch {
211
+ r();
212
+ return;
213
+ }
214
+ if (!await q({
215
+ key: w.key,
216
+ name: w.name,
217
+ description: w.description || void 0,
218
+ ttl: w.ttl,
195
219
  refresh: {
196
- type: D.refresh.type,
197
- schedule: D.refresh.schedule
220
+ type: w.refresh.type,
221
+ schedule: w.refresh.schedule
198
222
  },
199
223
  data: e
200
- })) throw Error(C("bigconsole.dataSinks.builder.errors.updateFailed", "Failed to update DataSink"));
201
- } else if (!await J({
202
- key: D.key,
203
- name: D.name,
204
- description: D.description || void 0,
205
- ttl: D.ttl,
206
- refresh: {
207
- type: D.refresh.type,
208
- schedule: D.refresh.schedule
209
- },
210
- data: e
211
- })) throw Error(C("bigconsole.dataSinks.builder.errors.createFailed", "Failed to create DataSink"));
212
- A(D), S("/datasinks");
224
+ })) throw Error(S("bigconsole.dataSinks.builder.errors.createFailed", "Failed to create DataSink"));
225
+ }
226
+ x("/datasinks");
213
227
  } catch (e) {
214
228
  if (t(e)) return;
215
- R(e instanceof Error ? e.message : C("bigconsole.dataSinks.builder.errors.saveFailed", "Failed to save DataSink"));
229
+ M(e instanceof Error ? e.message : S("bigconsole.dataSinks.builder.errors.saveFailed", "Failed to save DataSink"));
216
230
  } finally {
217
- I(!1);
231
+ A(!1);
218
232
  }
219
233
  }, [
220
- D,
221
234
  w,
222
- Z,
235
+ C,
236
+ X,
237
+ H,
238
+ q,
223
239
  J,
224
- Y,
225
- S,
226
- C
227
- ]), ze = le(() => {
228
- let e = D.name.trim().length >= 2, t = D.key.trim().length > 0, n = !0;
229
- if (D.data && D.data.trim()) try {
230
- JSON.parse(D.data);
240
+ x,
241
+ S
242
+ ]), $ = C && B === "loading", Ue = le(() => {
243
+ let e = w.name.trim().length >= 2, t = w.key.trim().length > 0, n = !0;
244
+ if (w.data && w.data.trim()) try {
245
+ JSON.parse(w.data);
231
246
  } catch {
232
247
  n = !1;
233
248
  }
234
249
  return e && t && n;
235
250
  }, [
236
- D.name,
237
- D.key,
238
- D.data
251
+ w.name,
252
+ w.key,
253
+ w.data
239
254
  ]);
240
- return Ee && w ? /* @__PURE__ */ b("div", {
255
+ return Ae && C ? /* @__PURE__ */ y("div", {
241
256
  className: "flex min-h-[240px] items-center justify-center p-card-padding",
242
- children: /* @__PURE__ */ b(m, { className: "h-icon-lg w-icon-lg animate-spin text-text-secondary" })
243
- }) : K ? /* @__PURE__ */ b("div", {
257
+ children: /* @__PURE__ */ y(p, { className: "h-icon-lg w-icon-lg animate-spin text-text-secondary" })
258
+ }) : W ? /* @__PURE__ */ y("div", {
244
259
  className: "mx-auto w-full max-w-7xl p-card-padding",
245
- children: /* @__PURE__ */ b(n, {
260
+ children: /* @__PURE__ */ y(n, {
246
261
  tone: "danger",
247
262
  headingLevel: 2,
248
- title: C("bigconsole.dataSinks.builder.errors.loadFailed", "Failed to load DataSink"),
249
- description: K.message,
250
- icon: /* @__PURE__ */ b(c, { className: "h-icon-sm w-icon-sm" }),
251
- actions: /* @__PURE__ */ x(h, {
252
- onClick: $,
263
+ title: S("bigconsole.dataSinks.builder.errors.loadFailed", "Failed to load DataSink"),
264
+ description: W.message,
265
+ icon: /* @__PURE__ */ y(l, { className: "h-icon-sm w-icon-sm" }),
266
+ actions: /* @__PURE__ */ b(m, {
267
+ onClick: Q,
253
268
  variant: "secondary",
254
269
  size: "sm",
255
- children: [/* @__PURE__ */ b(l, { className: "w-4 h-4 mr-2" }), C("bigconsole.dataSinks.builder.header.backToDataSinks", "Back to DataSinks")]
270
+ children: [/* @__PURE__ */ y(u, { className: "w-4 h-4 mr-2" }), S("bigconsole.dataSinks.builder.header.backToDataSinks", "Back to DataSinks")]
256
271
  })
257
272
  })
258
- }) : w && !Ce && !we ? /* @__PURE__ */ b(de, {
259
- title: C("bigconsole.dataSinks.builder.accessDenied.title", "Access Denied"),
260
- description: C("bigconsole.dataSinks.builder.accessDenied.description", "You don't have permission to view this data sink.")
261
- }) : /* @__PURE__ */ x("div", {
273
+ }) : C && !Te && !Ee ? /* @__PURE__ */ y(de, {
274
+ title: S("bigconsole.dataSinks.builder.accessDenied.title", "Access Denied"),
275
+ description: S("bigconsole.dataSinks.builder.accessDenied.description", "You don't have permission to view this data sink.")
276
+ }) : /* @__PURE__ */ b("div", {
262
277
  className: "mx-auto w-full min-w-0 max-w-7xl p-card-padding",
263
278
  children: [
264
- /* @__PURE__ */ x("header", {
279
+ /* @__PURE__ */ b("header", {
265
280
  className: "mb-form-gap",
266
281
  children: [
267
- /* @__PURE__ */ x(h, {
268
- onClick: $,
282
+ /* @__PURE__ */ b(m, {
283
+ onClick: Q,
269
284
  variant: "ghost",
270
285
  size: "sm",
271
286
  className: "mb-4",
272
- children: [/* @__PURE__ */ b(l, { className: "w-4 h-4 mr-2" }), C("bigconsole.dataSinks.builder.header.backToDataSinks", "Back to DataSinks")]
287
+ children: [/* @__PURE__ */ y(u, { className: "w-4 h-4 mr-2" }), S("bigconsole.dataSinks.builder.header.backToDataSinks", "Back to DataSinks")]
273
288
  }),
274
- /* @__PURE__ */ b("h1", {
289
+ /* @__PURE__ */ y("h1", {
275
290
  className: "text-2xl font-bold text-text-primary",
276
- children: w ? C("bigconsole.dataSinks.builder.header.editTitle", "Edit DataSink") : C("bigconsole.dataSinks.builder.header.createTitle", "Create DataSink")
291
+ children: C ? S("bigconsole.dataSinks.builder.header.editTitle", "Edit DataSink") : S("bigconsole.dataSinks.builder.header.createTitle", "Create DataSink")
277
292
  }),
278
- /* @__PURE__ */ b("p", {
293
+ /* @__PURE__ */ y("p", {
279
294
  className: "mt-1 text-sm text-text-secondary",
280
- children: w ? C("bigconsole.dataSinks.builder.header.editSubtitle", "Update the DataSink configuration.") : C("bigconsole.dataSinks.builder.header.createSubtitle", "Create a new DataSink to store and cache data. Use the unique key to connect workflows.")
295
+ children: C ? S("bigconsole.dataSinks.builder.header.editSubtitle", "Update the DataSink configuration.") : S("bigconsole.dataSinks.builder.header.createSubtitle", "Create a new DataSink to store and cache data. Use the unique key to connect workflows.")
281
296
  })
282
297
  ]
283
298
  }),
284
- /* @__PURE__ */ b(ve, {
299
+ /* @__PURE__ */ y(be, {
285
300
  className: "mb-section-gap",
286
- children: C("bigconsole.dataSinks.builder.header.purpose", "A data sink is the named, structured store your dashboards read from. Give it a unique key, configure how long data is cached and how it refreshes, then point a workflow at that key to push data in. Get the basics right here and everything downstream connects to it.")
301
+ children: S("bigconsole.dataSinks.builder.header.purpose", "A data sink is the named, structured store your dashboards read from. Give it a unique key, configure how long data is cached and how it refreshes, then point a workflow at that key to push data in. Get the basics right here and everything downstream connects to it.")
287
302
  }),
288
- L && /* @__PURE__ */ b(n, {
303
+ j && /* @__PURE__ */ y(n, {
289
304
  tone: "danger",
290
305
  headingLevel: 2,
291
- title: C("bigconsole.dataSinks.builder.errors.saveFailed", "Failed to save DataSink"),
292
- description: L,
293
- icon: /* @__PURE__ */ b(c, { className: "h-icon-sm w-icon-sm" }),
306
+ title: S("bigconsole.dataSinks.builder.errors.saveFailed", "Failed to save DataSink"),
307
+ description: j,
308
+ icon: /* @__PURE__ */ y(l, { className: "h-icon-sm w-icon-sm" }),
294
309
  className: "mb-section-gap"
295
310
  }),
296
- /* @__PURE__ */ b("form", {
311
+ /* @__PURE__ */ y("form", {
297
312
  "data-tour": "bigconsole-datasink-builder",
298
- onSubmit: Re,
299
- children: /* @__PURE__ */ x(ee, { children: [
300
- /* @__PURE__ */ b(n, {
313
+ onSubmit: He,
314
+ children: /* @__PURE__ */ b(r, { children: [
315
+ /* @__PURE__ */ y(n, {
301
316
  emphasis: "primary",
302
317
  headingLevel: 2,
303
- title: C("bigconsole.dataSinks.builder.basicInfo.title", "Basic Information"),
304
- description: C("bigconsole.dataSinks.builder.basicInfo.subtitle", "Essential details for your DataSink"),
305
- icon: /* @__PURE__ */ b(f, { className: "h-icon-sm w-icon-sm" }),
318
+ title: S("bigconsole.dataSinks.builder.basicInfo.title", "Basic Information"),
319
+ description: S("bigconsole.dataSinks.builder.basicInfo.subtitle", "Essential details for your DataSink"),
320
+ icon: /* @__PURE__ */ y(d, { className: "h-icon-sm w-icon-sm" }),
306
321
  bodyClassName: "grid gap-form-gap md:grid-cols-2",
307
- children: /* @__PURE__ */ x(y, { children: [
308
- /* @__PURE__ */ x("div", {
322
+ children: /* @__PURE__ */ b(v, { children: [
323
+ /* @__PURE__ */ b("div", {
309
324
  className: "space-y-2",
310
325
  children: [
311
- /* @__PURE__ */ x(_, {
326
+ /* @__PURE__ */ b(g, {
312
327
  htmlFor: "name",
313
328
  children: [
314
- C("bigconsole.dataSinks.builder.basicInfo.nameLabel", "Name"),
329
+ S("bigconsole.dataSinks.builder.basicInfo.nameLabel", "Name"),
315
330
  " ",
316
- /* @__PURE__ */ b("span", {
331
+ /* @__PURE__ */ y("span", {
317
332
  className: "text-status-error-text",
318
333
  children: "*"
319
334
  })
320
335
  ]
321
336
  }),
322
- /* @__PURE__ */ b(g, {
337
+ /* @__PURE__ */ y(h, {
323
338
  id: "name",
324
339
  type: "text",
325
- value: D.name,
326
- onChange: ke,
327
- placeholder: C("bigconsole.dataSinks.builder.basicInfo.namePlaceholder", "e.g., Sales Metrics"),
328
- className: j.name ? "border-status-error-border" : ""
340
+ value: w.name,
341
+ onChange: Ne,
342
+ placeholder: S("bigconsole.dataSinks.builder.basicInfo.namePlaceholder", "e.g., Sales Metrics"),
343
+ className: E.name ? "border-status-error-border" : ""
329
344
  }),
330
- j.name && /* @__PURE__ */ b("p", {
345
+ E.name && /* @__PURE__ */ y("p", {
331
346
  className: "text-xs text-status-error-text",
332
- children: j.name
347
+ children: E.name
333
348
  })
334
349
  ]
335
350
  }),
336
- /* @__PURE__ */ x("div", {
351
+ /* @__PURE__ */ b("div", {
337
352
  className: "space-y-2",
338
353
  children: [
339
- /* @__PURE__ */ x(_, {
354
+ /* @__PURE__ */ b(g, {
340
355
  htmlFor: "key",
341
356
  children: [
342
- C("bigconsole.dataSinks.builder.basicInfo.keyLabel", "Unique Key"),
357
+ S("bigconsole.dataSinks.builder.basicInfo.keyLabel", "Unique Key"),
343
358
  " ",
344
- /* @__PURE__ */ b("span", {
359
+ /* @__PURE__ */ y("span", {
345
360
  className: "text-status-error-text",
346
361
  children: "*"
347
362
  })
348
363
  ]
349
364
  }),
350
- /* @__PURE__ */ x("div", {
365
+ /* @__PURE__ */ b("div", {
351
366
  className: "flex gap-2",
352
- children: [/* @__PURE__ */ b(g, {
367
+ children: [/* @__PURE__ */ y(h, {
353
368
  id: "key",
354
369
  type: "text",
355
- value: D.key,
356
- onChange: Ae,
357
- placeholder: C("bigconsole.dataSinks.builder.basicInfo.keyPlaceholder", "sales_metrics"),
358
- disabled: w,
359
- className: `font-mono flex-1 ${j.key ? "border-status-error-border" : ""}`
360
- }), D.key && /* @__PURE__ */ b(h, {
370
+ value: w.key,
371
+ onChange: Pe,
372
+ placeholder: S("bigconsole.dataSinks.builder.basicInfo.keyPlaceholder", "sales_metrics"),
373
+ disabled: C,
374
+ className: `font-mono flex-1 ${E.key ? "border-status-error-border" : ""}`
375
+ }), w.key && /* @__PURE__ */ y(m, {
361
376
  type: "button",
362
- onClick: Ie,
363
- "aria-label": C("bigconsole.dataSinks.builder.basicInfo.copyKey", "Copy unique key"),
377
+ onClick: Be,
378
+ "aria-label": S("bigconsole.dataSinks.builder.basicInfo.copyKey", "Copy unique key"),
364
379
  variant: "outline",
365
380
  size: "sm",
366
381
  className: "px-3",
367
- children: Te ? /* @__PURE__ */ b(u, { className: "w-4 h-4 text-status-success-text" }) : /* @__PURE__ */ b(d, { className: "w-4 h-4" })
382
+ children: ke ? /* @__PURE__ */ y(me, { className: "w-4 h-4 text-status-success-text" }) : /* @__PURE__ */ y(he, { className: "w-4 h-4" })
368
383
  })]
369
384
  }),
370
- j.key && /* @__PURE__ */ b("p", {
385
+ E.key && /* @__PURE__ */ y("p", {
371
386
  className: "text-xs text-status-error-text",
372
- children: j.key
387
+ children: E.key
373
388
  }),
374
- /* @__PURE__ */ b("p", {
389
+ /* @__PURE__ */ y("p", {
375
390
  className: "text-xs text-text-muted",
376
- children: w ? C("bigconsole.dataSinks.builder.basicInfo.keyHelpEdit", "Key cannot be changed. Use this key in your workflows to push data.") : C("bigconsole.dataSinks.builder.basicInfo.keyHelpCreate", "Auto-generated from name. This key will be used by workflows to push data.")
391
+ children: C ? S("bigconsole.dataSinks.builder.basicInfo.keyHelpEdit", "Key cannot be changed. Use this key in your workflows to push data.") : S("bigconsole.dataSinks.builder.basicInfo.keyHelpCreate", "Auto-generated from name. This key will be used by workflows to push data.")
377
392
  })
378
393
  ]
379
394
  }),
380
- /* @__PURE__ */ x("div", {
395
+ /* @__PURE__ */ b("div", {
381
396
  className: "space-y-2 md:col-span-2",
382
- children: [/* @__PURE__ */ b(_, {
397
+ children: [/* @__PURE__ */ y(g, {
383
398
  htmlFor: "description",
384
- children: C("bigconsole.dataSinks.builder.basicInfo.descriptionLabel", "Description")
385
- }), /* @__PURE__ */ b(v, {
399
+ children: S("bigconsole.dataSinks.builder.basicInfo.descriptionLabel", "Description")
400
+ }), /* @__PURE__ */ y(_, {
386
401
  id: "description",
387
- value: D.description,
388
- onChange: je,
389
- placeholder: C("bigconsole.dataSinks.builder.basicInfo.descriptionPlaceholder", "Describe what data this sink stores..."),
402
+ value: w.description,
403
+ onChange: Fe,
404
+ placeholder: S("bigconsole.dataSinks.builder.basicInfo.descriptionPlaceholder", "Describe what data this sink stores..."),
390
405
  rows: 2,
391
406
  className: "resize-none"
392
407
  })]
393
408
  })
394
409
  ] })
395
410
  }),
396
- /* @__PURE__ */ b(n, {
411
+ /* @__PURE__ */ y(n, {
397
412
  headingLevel: 2,
398
- title: C("bigconsole.dataSinks.builder.config.title", "Configuration"),
399
- description: C("bigconsole.dataSinks.builder.config.subtitle", "Cache and refresh settings"),
400
- icon: /* @__PURE__ */ b(ge, { className: "h-icon-sm w-icon-sm" }),
413
+ title: S("bigconsole.dataSinks.builder.config.title", "Configuration"),
414
+ description: S("bigconsole.dataSinks.builder.config.subtitle", "Cache and refresh settings"),
415
+ icon: /* @__PURE__ */ y(ve, { className: "h-icon-sm w-icon-sm" }),
401
416
  bodyClassName: "grid gap-form-gap md:grid-cols-2",
402
- children: /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ x("div", {
417
+ children: /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("div", {
403
418
  className: "space-y-2",
404
419
  children: [
405
- /* @__PURE__ */ b(_, { children: C("bigconsole.dataSinks.builder.config.cacheDurationLabel", "Cache Duration") }),
406
- /* @__PURE__ */ b(se, {
407
- value: D.ttl,
408
- onChange: Me,
420
+ /* @__PURE__ */ y(g, { children: S("bigconsole.dataSinks.builder.config.cacheDurationLabel", "Cache Duration") }),
421
+ /* @__PURE__ */ y(ae, {
422
+ value: w.ttl,
423
+ onChange: Ie,
409
424
  hideLabel: !0
410
425
  }),
411
- /* @__PURE__ */ b("p", {
426
+ /* @__PURE__ */ y("p", {
412
427
  className: "text-xs text-text-muted",
413
- children: C("bigconsole.dataSinks.builder.config.cacheDurationHelp", "How long cached data remains valid before requiring refresh.")
428
+ children: S("bigconsole.dataSinks.builder.config.cacheDurationHelp", "How long cached data remains valid before requiring refresh.")
414
429
  })
415
430
  ]
416
- }), /* @__PURE__ */ b(ce, {
417
- value: D.refresh,
418
- onChange: Ne
431
+ }), /* @__PURE__ */ y(oe, {
432
+ value: w.refresh,
433
+ onChange: Le
419
434
  })] })
420
435
  }),
421
- /* @__PURE__ */ b(n, {
436
+ /* @__PURE__ */ y(n, {
422
437
  headingLevel: 2,
423
- title: C("bigconsole.dataSinks.builder.dataPayload.title", "Data Payload"),
424
- description: w ? C("bigconsole.dataSinks.builder.dataPayload.subtitleEdit", "Edit the JSON data stored in this DataSink") : C("bigconsole.dataSinks.builder.dataPayload.subtitleCreate", "Optional initial data (JSON format)"),
425
- icon: /* @__PURE__ */ b(f, { className: "h-icon-sm w-icon-sm" }),
426
- actions: /* @__PURE__ */ b(h, {
438
+ title: S("bigconsole.dataSinks.builder.dataPayload.title", "Data Payload"),
439
+ description: C ? S("bigconsole.dataSinks.builder.dataPayload.subtitleEdit", "Edit the JSON data stored in this DataSink") : S("bigconsole.dataSinks.builder.dataPayload.subtitleCreate", "Optional initial data (JSON format)"),
440
+ icon: /* @__PURE__ */ y(d, { className: "h-icon-sm w-icon-sm" }),
441
+ actions: /* @__PURE__ */ y(m, {
427
442
  type: "button",
428
- onClick: Fe,
443
+ onClick: ze,
429
444
  variant: "outline",
430
445
  size: "sm",
431
- children: C("bigconsole.dataSinks.builder.dataPayload.formatJson", "Format JSON")
446
+ disabled: $,
447
+ children: S("bigconsole.dataSinks.builder.dataPayload.formatJson", "Format JSON")
432
448
  }),
433
449
  bodyClassName: "space-y-2",
434
- children: /* @__PURE__ */ x(y, { children: [
435
- /* @__PURE__ */ b(v, {
436
- "aria-label": C("bigconsole.dataSinks.builder.dataPayload.title", "Data Payload"),
437
- value: D.data,
438
- onChange: Pe,
439
- placeholder: C("bigconsole.dataSinks.builder.dataPayload.dataPlaceholder", "{\"key\": \"value\"}"),
450
+ children: /* @__PURE__ */ b(v, { children: [
451
+ /* @__PURE__ */ y(_, {
452
+ "aria-label": S("bigconsole.dataSinks.builder.dataPayload.title", "Data Payload"),
453
+ value: w.data,
454
+ onChange: Re,
455
+ disabled: $,
456
+ "aria-busy": $,
457
+ placeholder: $ ? S("bigconsole.dataSinks.builder.dataPayload.loading", "Loading the stored payload…") : S("bigconsole.dataSinks.builder.dataPayload.dataPlaceholder", "{\"key\": \"value\"}"),
440
458
  rows: 10,
441
- className: `resize-y font-mono text-xs ${j.data ? "border-status-error-border" : ""}`
459
+ className: `resize-y font-mono text-xs ${E.data ? "border-status-error-border" : ""}`
442
460
  }),
443
- j.data && /* @__PURE__ */ b("p", {
461
+ E.data && /* @__PURE__ */ y("p", {
444
462
  className: "text-xs text-status-error-text",
445
- children: j.data
463
+ children: E.data
464
+ }),
465
+ C && B === "unavailable" && /* @__PURE__ */ y("p", {
466
+ role: "status",
467
+ className: "text-xs text-status-warning-text",
468
+ children: S("bigconsole.dataSinks.builder.dataPayload.unavailable", "The stored payload could not be loaded. Leave this empty to keep it unchanged, or enter JSON to replace it.")
446
469
  }),
447
- /* @__PURE__ */ b("p", {
470
+ /* @__PURE__ */ y("p", {
448
471
  className: "text-xs text-text-muted",
449
- children: C("bigconsole.dataSinks.builder.dataPayload.help", "Enter valid JSON data. This data will be stored and can be accessed by widgets via parsers.")
472
+ children: S("bigconsole.dataSinks.builder.dataPayload.help", "Enter valid JSON data. This data will be stored and can be accessed by widgets via parsers.")
450
473
  })
451
474
  ] })
452
475
  }),
453
- w && Z && /* @__PURE__ */ b(n, {
476
+ C && X && /* @__PURE__ */ y(n, {
454
477
  emphasis: "muted",
455
478
  headingLevel: 2,
456
- title: C("bigconsole.dataSinks.builder.preview.title", "Data Preview"),
457
- description: C("bigconsole.dataSinks.builder.preview.subtitle", "Preview the first 20 records"),
458
- icon: /* @__PURE__ */ b(p, { className: "h-icon-sm w-icon-sm" }),
459
- actions: /* @__PURE__ */ b(h, {
479
+ title: S("bigconsole.dataSinks.builder.preview.title", "Data Preview"),
480
+ description: S("bigconsole.dataSinks.builder.preview.subtitle", "Preview the first 20 records"),
481
+ icon: /* @__PURE__ */ y(f, { className: "h-icon-sm w-icon-sm" }),
482
+ actions: /* @__PURE__ */ y(m, {
460
483
  type: "button",
461
- onClick: Le,
484
+ onClick: Ve,
462
485
  variant: "outline",
463
486
  size: "sm",
464
- disabled: B,
465
- children: B ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(m, { className: "w-4 h-4 mr-2 animate-spin" }), C("bigconsole.dataSinks.builder.preview.loading", "Loading...")] }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(p, { className: "w-4 h-4 mr-2" }), C("bigconsole.dataSinks.builder.preview.showData", "Show Data")] })
487
+ disabled: P,
488
+ children: P ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(p, { className: "w-4 h-4 mr-2 animate-spin" }), S("bigconsole.dataSinks.builder.preview.loading", "Loading...")] }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(f, { className: "w-4 h-4 mr-2" }), S("bigconsole.dataSinks.builder.preview.showData", "Show Data")] })
466
489
  }),
467
- children: W ? /* @__PURE__ */ b(n, {
490
+ children: R ? /* @__PURE__ */ y(n, {
468
491
  tone: "danger",
469
492
  padding: "compact",
470
493
  headingLevel: 3,
471
494
  title: "Could not load the preview",
472
- children: /* @__PURE__ */ b("p", {
495
+ children: /* @__PURE__ */ y("p", {
473
496
  className: "text-sm text-status-error-text",
474
- children: W
497
+ children: R
475
498
  })
476
- }) : H && H.length > 0 ? /* @__PURE__ */ b("pre", {
499
+ }) : I && I.length > 0 ? /* @__PURE__ */ y("pre", {
477
500
  className: "max-h-[300px] min-w-0 overflow-auto rounded-input bg-bg-surface p-3 font-mono text-xs",
478
- children: JSON.stringify(H, null, 2)
479
- }) : H ? /* @__PURE__ */ b(_e, {
501
+ children: JSON.stringify(I, null, 2)
502
+ }) : I ? /* @__PURE__ */ y(ye, {
480
503
  illustration: "empty-generic",
481
- title: C("bigconsole.dataSinks.builder.preview.emptyTitle", "No data available yet"),
482
- description: C("bigconsole.dataSinks.builder.preview.emptyDescription", "Connect a workflow to this sink's key to start pushing data.")
483
- }) : /* @__PURE__ */ b("p", {
504
+ title: S("bigconsole.dataSinks.builder.preview.emptyTitle", "No data available yet"),
505
+ description: S("bigconsole.dataSinks.builder.preview.emptyDescription", "Connect a workflow to this sink's key to start pushing data.")
506
+ }) : /* @__PURE__ */ y("p", {
484
507
  className: "text-sm text-text-secondary",
485
508
  children: "Select \"Show data\" to load the records this sink currently holds."
486
509
  })
487
510
  }),
488
- !w && /* @__PURE__ */ b(n, {
511
+ !C && /* @__PURE__ */ y(n, {
489
512
  tone: "info",
490
513
  emphasis: "muted",
491
514
  headingLevel: 2,
492
- title: C("bigconsole.dataSinks.builder.whatsNext.title", "What's Next?"),
493
- icon: /* @__PURE__ */ b(me, { className: "h-icon-sm w-icon-sm" }),
494
- children: /* @__PURE__ */ x("ol", {
515
+ title: S("bigconsole.dataSinks.builder.whatsNext.title", "What's Next?"),
516
+ icon: /* @__PURE__ */ y(ge, { className: "h-icon-sm w-icon-sm" }),
517
+ children: /* @__PURE__ */ b("ol", {
495
518
  className: "list-inside list-decimal space-y-1 text-xs text-text-secondary",
496
519
  children: [
497
- /* @__PURE__ */ b("li", { children: C("bigconsole.dataSinks.builder.whatsNext.step1", "Create this DataSink to get your unique key") }),
498
- /* @__PURE__ */ x("li", { children: [
499
- C("bigconsole.dataSinks.builder.whatsNext.step2Prefix", "Go to"),
520
+ /* @__PURE__ */ y("li", { children: S("bigconsole.dataSinks.builder.whatsNext.step1", "Create this DataSink to get your unique key") }),
521
+ /* @__PURE__ */ b("li", { children: [
522
+ S("bigconsole.dataSinks.builder.whatsNext.step2Prefix", "Go to"),
500
523
  " ",
501
- /* @__PURE__ */ b("strong", { children: C("bigconsole.dataSinks.builder.whatsNext.workflows", "Workflows") }),
524
+ /* @__PURE__ */ y("strong", { children: S("bigconsole.dataSinks.builder.whatsNext.workflows", "Workflows") }),
502
525
  " ",
503
- C("bigconsole.dataSinks.builder.whatsNext.step2Suffix", "and create a FluidGrids workflow")
526
+ S("bigconsole.dataSinks.builder.whatsNext.step2Suffix", "and create a FluidGrids workflow")
504
527
  ] }),
505
- /* @__PURE__ */ b("li", { children: C("bigconsole.dataSinks.builder.whatsNext.step3", "Use the unique key in your workflow to push data to this DataSink") }),
506
- /* @__PURE__ */ x("li", { children: [
507
- C("bigconsole.dataSinks.builder.whatsNext.step4Prefix", "Create"),
528
+ /* @__PURE__ */ y("li", { children: S("bigconsole.dataSinks.builder.whatsNext.step3", "Use the unique key in your workflow to push data to this DataSink") }),
529
+ /* @__PURE__ */ b("li", { children: [
530
+ S("bigconsole.dataSinks.builder.whatsNext.step4Prefix", "Create"),
508
531
  " ",
509
- /* @__PURE__ */ b("strong", { children: C("bigconsole.dataSinks.builder.whatsNext.parsers", "Parsers") }),
532
+ /* @__PURE__ */ y("strong", { children: S("bigconsole.dataSinks.builder.whatsNext.parsers", "Parsers") }),
510
533
  " ",
511
- C("bigconsole.dataSinks.builder.whatsNext.step4Suffix", "to transform the data using JQ or JSONata")
534
+ S("bigconsole.dataSinks.builder.whatsNext.step4Suffix", "to transform the data using JQ or JSONata")
512
535
  ] })
513
536
  ]
514
537
  })
515
538
  }),
516
- /* @__PURE__ */ x(n, {
539
+ /* @__PURE__ */ b(n, {
517
540
  emphasis: "bare",
518
541
  padding: "none",
519
542
  "aria-label": "Save or discard this data sink",
520
543
  className: "border-t border-[var(--color-border-subtle)] pt-form-gap",
521
544
  bodyClassName: "flex flex-wrap items-center justify-end gap-control-gap",
522
- children: [/* @__PURE__ */ b(h, {
545
+ children: [/* @__PURE__ */ y(m, {
523
546
  type: "button",
524
- onClick: $,
547
+ onClick: Q,
525
548
  variant: "secondary",
526
- children: C("bigconsole.dataSinks.builder.actions.cancel", "Cancel")
527
- }), /* @__PURE__ */ b(fe, {
528
- permission: E,
549
+ children: S("bigconsole.dataSinks.builder.actions.cancel", "Cancel")
550
+ }), /* @__PURE__ */ y(fe, {
551
+ permission: De,
529
552
  deniedBehavior: "disable",
530
- children: /* @__PURE__ */ b(h, {
553
+ children: /* @__PURE__ */ y(m, {
531
554
  type: "submit",
532
- disabled: !ze || F,
555
+ disabled: !Ue || k,
533
556
  variant: "default",
534
- children: F ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(m, { className: "w-4 h-4 mr-2 animate-spin" }), C("bigconsole.dataSinks.builder.actions.saving", "Saving...")] }) : /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(he, { className: "w-4 h-4 mr-2" }), w ? C("bigconsole.dataSinks.builder.actions.saveChanges", "Save Changes") : C("bigconsole.dataSinks.builder.actions.create", "Create DataSink")] })
557
+ children: k ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(p, { className: "w-4 h-4 mr-2 animate-spin" }), S("bigconsole.dataSinks.builder.actions.saving", "Saving...")] }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(_e, { className: "w-4 h-4 mr-2" }), C ? S("bigconsole.dataSinks.builder.actions.saveChanges", "Save Changes") : S("bigconsole.dataSinks.builder.actions.create", "Create DataSink")] })
535
558
  })
536
559
  })]
537
560
  })
@@ -541,4 +564,4 @@ var S = i(function() {
541
564
  });
542
565
  });
543
566
  //#endregion
544
- export { S as DataSinkBuilderPage, S as default };
567
+ export { x as DataSinkBuilderPage, x as default };