@burdenoff/microfe-bigconsole 2026.1012.2 → 2026.1012.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,136 +1,148 @@
1
- import { reportBigConsoleQuotaError as e } from "../../utils/quota.js";
2
- import { Section as t } from "../common/Section.js";
1
+ import { useBigConsole as e } from "../../context/BigConsoleContext.js";
2
+ import "../../context/index.js";
3
+ import { reportBigConsoleQuotaError as t } from "../../utils/quota.js";
4
+ import { Section as n } from "../common/Section.js";
3
5
  import "../common/index.js";
4
- import n from "../../hooks/useBigConsoleAnalytics.js";
5
- import r from "../../hooks/useImportDashboard.js";
6
+ import r from "../../hooks/useBigConsoleAnalytics.js";
7
+ import i from "../../hooks/useImportDashboard.js";
6
8
  import "../../hooks/index.js";
7
- import { memo as i, useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
8
- import { AlertTriangle as l, ArrowLeft as ee, Check as u, FileJson as te, Info as d, RefreshCw as ne, Upload as f, XCircle as p } from "lucide-react";
9
- import { Badge as m, Button as h, Card as g, CardContent as _, Checkbox as v, Dialog as y, DialogContent as b, DialogDescription as x, DialogFooter as S, DialogHeader as re, DialogTitle as ie, Input as ae, Label as C, Spinner as w } from "@burdenoff/fe-libs/ui";
10
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
11
- import { useI18n as O } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
9
+ import { memo as a, useCallback as o, useLayoutEffect as s, useRef as c, useState as l } from "react";
10
+ import { AlertTriangle as ee, ArrowLeft as te, Check as ne, FileJson as re, Info as u, Upload as d, XCircle as ie } from "lucide-react";
11
+ import { Badge as f, Button as p, Card as ae, CardContent as m, Checkbox as h, Dialog as g, DialogContent as _, DialogDescription as oe, DialogFooter as se, DialogHeader as ce, DialogTitle as le, Input as v, Label as y, Spinner as b } from "@burdenoff/fe-libs/ui";
12
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
13
+ import { useI18n as w } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
14
  //#region src/bigconsole/components/dashboard/ImportDashboardDialog.tsx
13
- function k(e) {
14
- if (!e) return null;
15
- try {
16
- let t = JSON.parse(e);
17
- return t.exportedFrom?.dashboardId || t.dashboard?.id || null;
18
- } catch {
19
- return null;
20
- }
21
- }
22
- var A = i(function({ isOpen: i, onClose: A, onSuccess: j }) {
23
- let { t: M } = O(), [N, P] = c("select"), [, F] = c(null), [I, L] = c(null), [R, z] = c(""), [B, V] = c("PRIVATE"), [H, U] = c(!1), W = s(null), { loading: G, error: K, validationResult: q, importResult: J, validateImport: Y, importDashboard: X, clearState: Z } = r(), Q = n();
24
- o(() => {
25
- i && (P("select"), F(null), L(null), z(""), V("PRIVATE"), U(!1), Z());
26
- }, [i, Z]);
27
- let oe = a(async (e) => {
15
+ var T = a(function({ isOpen: a, onClose: T, onSuccess: E }) {
16
+ let { t: D } = w(), [O, k] = l("select"), [A, j] = l(null), M = c(0), { currentUser: N, workspaceId: P } = e(), F = `${N?.id ?? ""}|${P ?? ""}`, [I, L] = l(null), [R, z] = l(""), [B, V] = l("PRIVATE"), [H, U] = l(!1), W = c(null), { loading: G, error: K, validationResult: q, importResult: J, validateImport: Y, importDashboard: X, clearState: Z } = i(), Q = r();
17
+ s(() => (M.current++, Z(), a && (k("select"), j(null), L(null), z(""), V("PRIVATE"), U(!1)), () => {
18
+ M.current++;
19
+ }), [
20
+ a,
21
+ F,
22
+ Z
23
+ ]);
24
+ let ue = o((e) => {
28
25
  let t = e.target.files?.[0];
29
26
  if (!t) return;
30
- if (!t.name.endsWith(".json")) {
31
- alert(M("bigconsole.dashboards.import.selectJsonFile", "Please select a JSON file"));
27
+ let n = ++M.current, r = () => M.current === n;
28
+ if (Z(), k("select"), j(null), L(null), z(""), V("PRIVATE"), U(!1), !t.name.toLowerCase().endsWith(".json")) {
29
+ j(D("bigconsole.dashboards.import.selectJsonFile", "Please select a JSON file"));
32
30
  return;
33
31
  }
34
- F(t);
35
- let n = new FileReader();
36
- n.onload = async (e) => {
32
+ let i = new FileReader();
33
+ i.onload = async (e) => {
34
+ if (!r()) return;
37
35
  let t = e.target?.result;
36
+ if (typeof t != "string") {
37
+ j(D("bigconsole.dashboards.import.failedToReadFile", "Failed to read file"));
38
+ return;
39
+ }
38
40
  L(t);
39
41
  let n = await Y(t);
40
- n && (P("preview"), n.dashboardInfo?.name && z(n.dashboardInfo.name));
41
- }, n.onerror = () => {
42
- alert(M("bigconsole.dashboards.import.failedToReadFile", "Failed to read file"));
43
- }, n.readAsText(t);
44
- }, [Y, M]), se = a((e) => {
42
+ r() && (n ? (k("preview"), z(n.dashboardInfo?.name ?? "")) : W.current && (W.current.value = ""));
43
+ }, i.onerror = () => {
44
+ r() && j(D("bigconsole.dashboards.import.failedToReadFile", "Failed to read file"));
45
+ }, i.readAsText(t);
46
+ }, [
47
+ Z,
48
+ Y,
49
+ D
50
+ ]), de = o((e) => {
45
51
  e.preventDefault();
46
52
  let t = e.dataTransfer.files?.[0];
47
53
  if (t) {
48
54
  let e = new DataTransfer();
49
55
  e.items.add(t), W.current && (W.current.files = e.files, W.current.dispatchEvent(new Event("change", { bubbles: !0 })));
50
56
  }
51
- }, []), ce = a(async () => {
57
+ }, []), fe = o(async () => {
52
58
  if (!I) return;
53
- P("importing");
54
- let t = {
59
+ let e = M.current;
60
+ k("importing");
61
+ let n = {
55
62
  name: R.trim() || void 0,
56
63
  visibility: B,
57
64
  skipWarnings: H
58
65
  };
59
66
  Q("bigconsole.dashboard.import_clicked", { source: "import" });
60
67
  try {
61
- let e = await X(I, t);
62
- e?.success && e.dashboard ? (P("complete"), Q("bigconsole.dashboard.imported", {
63
- dashboardId: e.dashboard.id,
68
+ let t = await X(I, n);
69
+ if (M.current !== e) return;
70
+ t?.success && t.dashboard ? (k("complete"), Q("bigconsole.dashboard.imported", {
71
+ dashboardId: t.dashboard.id,
64
72
  source: "import",
65
- originalUpdated: e.originalUpdated ?? !1
66
- }), j?.(e.dashboard.id, e.dashboard.name, e.originalUpdated ?? !1)) : P("preview");
67
- } catch (t) {
68
- if (e(t, "project")) {
69
- A();
73
+ originalUpdated: !1
74
+ }), E?.(t.dashboard.id, t.dashboard.name, !1)) : k("preview");
75
+ } catch (n) {
76
+ if (M.current !== e) return;
77
+ if (t(n, "project")) {
78
+ T();
70
79
  return;
71
80
  }
72
- P("preview");
81
+ k("preview");
73
82
  }
74
83
  }, [
75
84
  Q,
76
85
  I,
77
86
  X,
78
87
  R,
79
- A,
80
- j,
88
+ T,
89
+ E,
81
90
  H,
82
91
  B
83
- ]), $ = !G && N !== "importing";
84
- return /* @__PURE__ */ E(y, {
85
- open: i,
86
- onOpenChange: (e) => !e && $ && A(),
87
- children: /* @__PURE__ */ D(b, {
88
- className: "sm:max-w-lg max-h-[85vh] flex flex-col",
92
+ ]), $ = !G && O !== "importing";
93
+ return /* @__PURE__ */ S(g, {
94
+ open: a,
95
+ onOpenChange: (e) => !e && $ && T(),
96
+ children: /* @__PURE__ */ C(_, {
97
+ className: "sm:max-w-lg flex max-h-[calc(100dvh-3rem)] flex-col overflow-hidden",
89
98
  children: [
90
- /* @__PURE__ */ D(re, { children: [/* @__PURE__ */ D("div", {
91
- className: "flex items-center gap-3",
92
- children: [/* @__PURE__ */ E("div", {
93
- className: "flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10",
94
- children: /* @__PURE__ */ E(f, { className: "size-5 text-primary" })
95
- }), /* @__PURE__ */ E(ie, { children: M("bigconsole.dashboards.import.title", "Import Dashboard") })]
96
- }), /* @__PURE__ */ E(x, { children: M("bigconsole.dashboards.import.description", "Upload a Dashboard export file to restore it into this workspace.") })] }),
97
- /* @__PURE__ */ D("div", {
98
- className: "flex-1 overflow-y-auto py-4 space-y-4",
99
+ /* @__PURE__ */ C(ce, {
100
+ className: "shrink-0",
101
+ children: [/* @__PURE__ */ C("div", {
102
+ className: "flex items-center gap-3",
103
+ children: [/* @__PURE__ */ S("div", {
104
+ className: "flex size-10 items-center justify-center rounded-lg bg-action-primary-bg/10",
105
+ children: /* @__PURE__ */ S(d, { className: "size-5 text-primary" })
106
+ }), /* @__PURE__ */ S(le, { children: D("bigconsole.dashboards.import.title", "Import Dashboard") })]
107
+ }), /* @__PURE__ */ S(oe, { children: D("bigconsole.dashboards.import.description", "Upload a Dashboard export file to create a new copy in this workspace.") })]
108
+ }),
109
+ /* @__PURE__ */ C("div", {
110
+ className: "min-h-0 flex-1 overflow-y-auto py-4 space-y-4",
99
111
  children: [
100
- N === "select" && /* @__PURE__ */ D("div", {
112
+ O === "select" && /* @__PURE__ */ C("div", {
101
113
  onDragOver: (e) => e.preventDefault(),
102
- onDrop: se,
114
+ onDrop: de,
103
115
  className: "border-2 border-dashed rounded-lg p-8 text-center hover:border-primary transition-colors",
104
116
  children: [
105
- /* @__PURE__ */ E(te, { className: "size-12 mx-auto text-text-secondary mb-4" }),
106
- /* @__PURE__ */ E("p", {
117
+ /* @__PURE__ */ S(re, { className: "size-12 mx-auto text-text-secondary mb-4" }),
118
+ /* @__PURE__ */ S("p", {
107
119
  className: "text-sm mb-2",
108
- children: M("bigconsole.dashboards.import.dropzoneTitle", "Drag and drop a dashboard export file here")
120
+ children: D("bigconsole.dashboards.import.dropzoneTitle", "Drag and drop a dashboard export file here")
109
121
  }),
110
- /* @__PURE__ */ E("p", {
122
+ /* @__PURE__ */ S("p", {
111
123
  className: "text-xs text-text-secondary mb-4",
112
- children: M("bigconsole.dashboards.import.or", "or")
124
+ children: D("bigconsole.dashboards.import.or", "or")
113
125
  }),
114
- /* @__PURE__ */ E("input", {
126
+ /* @__PURE__ */ S("input", {
115
127
  ref: W,
116
128
  type: "file",
117
129
  accept: ".json",
118
- onChange: oe,
130
+ onChange: ue,
119
131
  className: "hidden"
120
132
  }),
121
- /* @__PURE__ */ E(h, {
133
+ /* @__PURE__ */ S(p, {
122
134
  onClick: () => W.current?.click(),
123
135
  disabled: G,
124
- children: M("bigconsole.dashboards.import.browseFiles", "Browse Files")
136
+ children: D("bigconsole.dashboards.import.browseFiles", "Browse Files")
125
137
  }),
126
- /* @__PURE__ */ E("p", {
138
+ /* @__PURE__ */ S("p", {
127
139
  className: "text-xs text-text-secondary mt-4",
128
- children: M("bigconsole.dashboards.import.supportedFilesHint", "Only .json files exported from BigConsole are supported")
140
+ children: D("bigconsole.dashboards.import.supportedFilesHint", "Only .json files exported from BigConsole are supported")
129
141
  })
130
142
  ]
131
143
  }),
132
- (N === "preview" || N === "importing") && q && /* @__PURE__ */ D(T, { children: [
133
- /* @__PURE__ */ D(t, {
144
+ (O === "preview" || O === "importing") && q && /* @__PURE__ */ C(x, { children: [
145
+ /* @__PURE__ */ C(n, {
134
146
  headingLevel: 3,
135
147
  emphasis: "muted",
136
148
  padding: "compact",
@@ -138,80 +150,80 @@ var A = i(function({ isOpen: i, onClose: A, onSuccess: j }) {
138
150
  "data-testid": "import-summary",
139
151
  bodyClassName: "space-y-2",
140
152
  children: [
141
- /* @__PURE__ */ D("div", {
153
+ /* @__PURE__ */ C("div", {
142
154
  className: "flex items-center justify-between",
143
- children: [/* @__PURE__ */ E("span", {
155
+ children: [/* @__PURE__ */ S("span", {
144
156
  className: "text-sm text-text-secondary",
145
- children: M("bigconsole.dashboards.import.fieldDashboard", "Dashboard")
146
- }), /* @__PURE__ */ E("span", {
157
+ children: D("bigconsole.dashboards.import.fieldDashboard", "Dashboard")
158
+ }), /* @__PURE__ */ S("span", {
147
159
  className: "text-sm font-medium",
148
160
  children: q.dashboardInfo.name
149
161
  })]
150
162
  }),
151
- q.dashboardInfo.description && /* @__PURE__ */ D("div", {
163
+ q.dashboardInfo.description && /* @__PURE__ */ C("div", {
152
164
  className: "flex items-start justify-between",
153
- children: [/* @__PURE__ */ E("span", {
165
+ children: [/* @__PURE__ */ S("span", {
154
166
  className: "text-sm text-text-secondary",
155
- children: M("bigconsole.dashboards.import.fieldDescription", "Description")
156
- }), /* @__PURE__ */ E("span", {
167
+ children: D("bigconsole.dashboards.import.fieldDescription", "Description")
168
+ }), /* @__PURE__ */ S("span", {
157
169
  className: "text-sm text-right max-w-[60%] truncate",
158
170
  children: q.dashboardInfo.description
159
171
  })]
160
172
  }),
161
- /* @__PURE__ */ D("div", {
173
+ /* @__PURE__ */ C("div", {
162
174
  className: "flex items-center justify-between",
163
- children: [/* @__PURE__ */ E("span", {
175
+ children: [/* @__PURE__ */ S("span", {
164
176
  className: "text-sm text-text-secondary",
165
- children: M("bigconsole.dashboards.import.fieldPages", "Pages")
166
- }), /* @__PURE__ */ E(m, {
177
+ children: D("bigconsole.dashboards.import.fieldPages", "Pages")
178
+ }), /* @__PURE__ */ S(f, {
167
179
  variant: "secondary",
168
180
  children: q.dashboardInfo.pageCount
169
181
  })]
170
182
  }),
171
- /* @__PURE__ */ D("div", {
183
+ /* @__PURE__ */ C("div", {
172
184
  className: "flex items-center justify-between",
173
- children: [/* @__PURE__ */ E("span", {
185
+ children: [/* @__PURE__ */ S("span", {
174
186
  className: "text-sm text-text-secondary",
175
- children: M("bigconsole.dashboards.import.fieldWidgets", "Widgets")
176
- }), /* @__PURE__ */ E(m, {
187
+ children: D("bigconsole.dashboards.import.fieldWidgets", "Widgets")
188
+ }), /* @__PURE__ */ S(f, {
177
189
  variant: "secondary",
178
190
  children: q.dashboardInfo.widgetCount
179
191
  })]
180
192
  }),
181
- q.dashboardInfo.exportedFrom && /* @__PURE__ */ D("div", {
193
+ q.dashboardInfo.exportedFrom && /* @__PURE__ */ C("div", {
182
194
  className: "flex items-center justify-between",
183
- children: [/* @__PURE__ */ E("span", {
195
+ children: [/* @__PURE__ */ S("span", {
184
196
  className: "text-sm text-text-secondary",
185
- children: M("bigconsole.dashboards.import.fieldSourceId", "Source ID")
186
- }), /* @__PURE__ */ E("span", {
197
+ children: D("bigconsole.dashboards.import.fieldSourceId", "Source ID")
198
+ }), /* @__PURE__ */ S("span", {
187
199
  className: "text-xs text-text-secondary font-mono truncate max-w-[180px]",
188
200
  children: q.dashboardInfo.exportedFrom
189
201
  })]
190
202
  }),
191
- /* @__PURE__ */ D("div", {
203
+ /* @__PURE__ */ C("div", {
192
204
  className: "flex flex-wrap items-center justify-between gap-x-4",
193
- children: [/* @__PURE__ */ E("span", {
205
+ children: [/* @__PURE__ */ S("span", {
194
206
  className: "text-sm text-text-secondary",
195
- children: M("bigconsole.dashboards.import.fieldSchemaVersion", "Schema Version")
196
- }), /* @__PURE__ */ E("span", {
207
+ children: D("bigconsole.dashboards.import.fieldSchemaVersion", "Schema Version")
208
+ }), /* @__PURE__ */ S("span", {
197
209
  className: "text-xs text-text-secondary",
198
210
  children: q.dashboardInfo.schemaVersion
199
211
  })]
200
212
  })
201
213
  ]
202
214
  }),
203
- q.errors.length > 0 && /* @__PURE__ */ E(t, {
215
+ q.errors.length > 0 && /* @__PURE__ */ S(n, {
204
216
  headingLevel: 3,
205
217
  tone: "danger",
206
218
  padding: "compact",
207
- icon: /* @__PURE__ */ E(p, { className: "size-4" }),
208
- title: M("bigconsole.dashboards.import.errorsCount", "Errors ({{count}})", { count: q.errors.length }),
219
+ icon: /* @__PURE__ */ S(ie, { className: "size-4" }),
220
+ title: D("bigconsole.dashboards.import.errorsCount", "Errors ({{count}})", { count: q.errors.length }),
209
221
  description: "These must be fixed in the export file before it can be imported.",
210
222
  "data-testid": "import-errors",
211
- children: /* @__PURE__ */ E("ul", {
223
+ children: /* @__PURE__ */ S("ul", {
212
224
  className: "space-y-1 text-xs text-status-error-text",
213
- children: q.errors.map((e) => /* @__PURE__ */ D("li", { children: [
214
- /* @__PURE__ */ D("span", {
225
+ children: q.errors.map((e) => /* @__PURE__ */ C("li", { children: [
226
+ /* @__PURE__ */ C("span", {
215
227
  className: "font-mono",
216
228
  children: [
217
229
  "[",
@@ -224,211 +236,173 @@ var A = i(function({ isOpen: i, onClose: A, onSuccess: j }) {
224
236
  ] }, `${e.code}-${e.message}`))
225
237
  })
226
238
  }),
227
- q.warnings.length > 0 && /* @__PURE__ */ E(t, {
239
+ q.warnings.length > 0 && /* @__PURE__ */ S(n, {
228
240
  headingLevel: 3,
229
241
  tone: "warning",
230
242
  padding: "compact",
231
- icon: /* @__PURE__ */ E(l, { className: "size-4" }),
232
- title: M("bigconsole.dashboards.import.warningsCount", "Warnings ({{count}})", { count: q.warnings.length }),
243
+ icon: /* @__PURE__ */ S(ee, { className: "size-4" }),
244
+ title: D("bigconsole.dashboards.import.warningsCount", "Warnings ({{count}})", { count: q.warnings.length }),
233
245
  description: "Advisory only — acknowledge them below to continue.",
234
246
  "data-testid": "import-warnings",
235
- children: /* @__PURE__ */ E("ul", {
247
+ children: /* @__PURE__ */ S("ul", {
236
248
  className: "space-y-1 text-xs text-[var(--color-status-warning-text)]",
237
- children: q.warnings.map((e) => /* @__PURE__ */ D("li", { children: [
238
- /* @__PURE__ */ D("span", {
239
- className: "font-mono",
240
- children: [
241
- "[",
242
- e.code,
243
- "]"
244
- ]
245
- }),
246
- " ",
247
- e.message
248
- ] }, `${e.code}-${e.message}`))
249
+ children: q.warnings.map((e) => /* @__PURE__ */ C("li", {
250
+ className: "break-words",
251
+ children: [
252
+ /* @__PURE__ */ C("span", {
253
+ className: "font-mono",
254
+ children: [
255
+ "[",
256
+ e.code,
257
+ "]"
258
+ ]
259
+ }),
260
+ " ",
261
+ e.message,
262
+ e.suggestion && /* @__PURE__ */ S("p", {
263
+ className: "mt-1",
264
+ children: e.suggestion
265
+ })
266
+ ]
267
+ }, `${e.code}-${e.message}`))
249
268
  })
250
269
  }),
251
- q.isValid && /* @__PURE__ */ D(t, {
270
+ q.isValid && /* @__PURE__ */ C(n, {
252
271
  headingLevel: 3,
253
- title: M("bigconsole.dashboards.import.optionsTitle", "Import Options"),
272
+ title: D("bigconsole.dashboards.import.optionsTitle", "Import Options"),
254
273
  description: "How this file lands in the workspace.",
255
274
  "data-testid": "import-options",
256
275
  bodyClassName: "space-y-4",
257
276
  children: [
258
- /* @__PURE__ */ E(t, {
277
+ /* @__PURE__ */ S(n, {
259
278
  headingLevel: 4,
260
279
  tone: "info",
261
- "aria-label": M("bigconsole.dashboards.import.infoRegionLabel", "What this import will do"),
280
+ "aria-label": D("bigconsole.dashboards.import.infoRegionLabel", "What this import will do"),
262
281
  padding: "compact",
263
282
  "data-testid": "import-info",
264
- children: /* @__PURE__ */ D("div", {
283
+ children: /* @__PURE__ */ C("div", {
265
284
  className: "flex items-start gap-2",
266
- children: [/* @__PURE__ */ E(d, { className: "size-4 mt-0.5 shrink-0 text-[var(--color-status-info-text)]" }), /* @__PURE__ */ E("div", {
285
+ children: [/* @__PURE__ */ S(u, { className: "size-4 mt-0.5 shrink-0 text-[var(--color-status-info-text)]" }), /* @__PURE__ */ C("div", {
267
286
  className: "text-xs text-[var(--color-status-info-text)]",
268
- children: k(I) ? /* @__PURE__ */ D(T, { children: [
269
- /* @__PURE__ */ E("p", {
270
- className: "font-medium mb-1",
271
- children: M("bigconsole.dashboards.import.checkExistingTitle", "Import will check for existing dashboard")
272
- }),
273
- /* @__PURE__ */ D("p", { children: [
274
- M("bigconsole.dashboards.import.checkExistingIdPrefix", "If the original dashboard (ID:"),
275
- " ",
276
- /* @__PURE__ */ D("code", {
277
- className: "rounded bg-bg-surface px-1 font-mono",
278
- children: [k(I)?.slice(0, 8), "..."]
279
- }),
280
- M("bigconsole.dashboards.import.checkExistingIdSuffix", ") exists:")
281
- ] }),
282
- /* @__PURE__ */ D("ul", {
283
- className: "list-disc list-inside mt-1 space-y-0.5",
284
- children: [/* @__PURE__ */ E("li", { children: M("bigconsole.dashboards.import.checkExistingWithChanges", "With changes → Update the existing dashboard") }), /* @__PURE__ */ E("li", { children: M("bigconsole.dashboards.import.checkExistingNoChanges", "No changes → Show \"already exists\" message") })]
285
- }),
286
- /* @__PURE__ */ E("p", {
287
- className: "mt-1",
288
- children: M("bigconsole.dashboards.import.checkExistingNotFound", "If original doesn't exist → Create a new dashboard")
289
- })
290
- ] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("p", {
287
+ children: [/* @__PURE__ */ S("p", {
291
288
  className: "font-medium mb-1",
292
- children: M("bigconsole.dashboards.import.newDashboardTitle", "A new dashboard will be created")
293
- }), /* @__PURE__ */ E("p", { children: M("bigconsole.dashboards.import.newDashboardBody", "Import as a new dashboard with the specified configuration.") })] })
289
+ children: D("bigconsole.dashboards.import.newDashboardTitle", "A new dashboard will be created")
290
+ }), /* @__PURE__ */ S("p", { children: D("bigconsole.dashboards.import.newDashboardBody", "Import as a new dashboard with the specified configuration.") })]
294
291
  })]
295
292
  })
296
293
  }),
297
- /* @__PURE__ */ D("div", {
294
+ /* @__PURE__ */ C("div", {
298
295
  className: "space-y-2",
299
- children: [/* @__PURE__ */ E(C, {
296
+ children: [/* @__PURE__ */ S(y, {
300
297
  htmlFor: "import-name",
301
- children: M("bigconsole.dashboards.import.dashboardNameLabel", "Dashboard Name")
302
- }), /* @__PURE__ */ E(ae, {
298
+ children: D("bigconsole.dashboards.import.dashboardNameLabel", "Dashboard Name")
299
+ }), /* @__PURE__ */ S(v, {
303
300
  id: "import-name",
304
301
  type: "text",
305
302
  value: R,
306
303
  onChange: (e) => z(e.target.value),
307
304
  placeholder: q.dashboardInfo.name,
308
- disabled: N === "importing"
305
+ disabled: O === "importing"
309
306
  })]
310
307
  }),
311
- /* @__PURE__ */ D("div", {
308
+ /* @__PURE__ */ C("div", {
312
309
  className: "space-y-2",
313
- children: [/* @__PURE__ */ E(C, { children: M("bigconsole.dashboards.import.visibilityLabel", "Visibility") }), /* @__PURE__ */ E("div", {
314
- className: "flex gap-2",
310
+ children: [/* @__PURE__ */ S(y, { children: D("bigconsole.dashboards.import.visibilityLabel", "Visibility") }), /* @__PURE__ */ S("div", {
311
+ className: "flex flex-wrap gap-2",
315
312
  children: [
316
313
  "PRIVATE",
317
- "TEAM",
314
+ "WORKSPACE",
318
315
  "PUBLIC"
319
- ].map((e) => /* @__PURE__ */ E(h, {
316
+ ].map((e) => /* @__PURE__ */ S(p, {
320
317
  type: "button",
321
318
  variant: B === e ? "default" : "outline",
322
319
  size: "sm",
323
320
  onClick: () => V(e),
324
- disabled: N === "importing",
325
- children: e === "PRIVATE" ? M("bigconsole.dashboards.import.visibilityPrivate", "Private") : e === "TEAM" ? M("bigconsole.dashboards.import.visibilityTeam", "Team") : M("bigconsole.dashboards.import.visibilityPublic", "Public")
321
+ disabled: O === "importing",
322
+ children: e === "PRIVATE" ? D("bigconsole.dashboards.import.visibilityPrivate", "Private") : e === "WORKSPACE" ? D("bigconsole.dashboards.import.visibilityWorkspace", "Workspace") : D("bigconsole.dashboards.import.visibilityPublic", "Public")
326
323
  }, e))
327
324
  })]
328
325
  }),
329
- q.warnings.length > 0 && /* @__PURE__ */ D("div", {
326
+ q.warnings.length > 0 && /* @__PURE__ */ C("div", {
330
327
  className: "flex items-start space-x-3",
331
- children: [/* @__PURE__ */ E(v, {
328
+ children: [/* @__PURE__ */ S(h, {
332
329
  id: "skipWarnings",
333
330
  checked: H,
334
331
  onCheckedChange: (e) => U(e === !0),
335
- disabled: N === "importing"
336
- }), /* @__PURE__ */ E("div", {
332
+ disabled: O === "importing"
333
+ }), /* @__PURE__ */ S("div", {
337
334
  className: "grid gap-1.5 leading-none",
338
- children: /* @__PURE__ */ E(C, {
335
+ children: /* @__PURE__ */ S(y, {
339
336
  htmlFor: "skipWarnings",
340
337
  className: "cursor-pointer",
341
- children: M("bigconsole.dashboards.import.acknowledgeWarnings", "Acknowledge warnings and proceed")
338
+ children: D("bigconsole.dashboards.import.acknowledgeWarnings", "Acknowledge warnings and proceed")
342
339
  })
343
340
  })]
344
341
  })
345
342
  ]
346
343
  })
347
344
  ] }),
348
- N === "complete" && J?.success && /* @__PURE__ */ D("div", {
345
+ O === "complete" && J?.success && /* @__PURE__ */ S("div", {
349
346
  className: "text-center py-6",
350
- children: [
351
- J.alreadyExists && /* @__PURE__ */ D(T, { children: [
352
- /* @__PURE__ */ E("div", {
353
- className: "mx-auto mb-4 flex size-16 items-center justify-center rounded-full bg-[var(--color-status-info-bgSubtle)]",
354
- children: /* @__PURE__ */ E(d, { className: "size-8 text-[var(--color-status-info-text)]" })
355
- }),
356
- /* @__PURE__ */ E("h3", {
357
- className: "text-lg font-medium mb-2",
358
- children: M("bigconsole.dashboards.import.alreadyExistsTitle", "Dashboard Already Exists")
359
- }),
360
- /* @__PURE__ */ E("p", {
361
- className: "text-sm text-text-secondary mb-4",
362
- children: M("bigconsole.dashboards.import.alreadyExistsBody", "Dashboard \"{{name}}\" already exists with the same data. No changes were made.", { name: J.dashboard?.name ?? "" })
363
- })
364
- ] }),
365
- J.originalUpdated && !J.alreadyExists && /* @__PURE__ */ D(T, { children: [
366
- /* @__PURE__ */ E("div", {
367
- className: "mx-auto mb-4 flex size-16 items-center justify-center rounded-full bg-[var(--color-status-success-bgSubtle)]",
368
- children: /* @__PURE__ */ E(ne, { className: "size-8 text-status-success-text" })
369
- }),
370
- /* @__PURE__ */ E("h3", {
371
- className: "text-lg font-medium mb-2",
372
- children: M("bigconsole.dashboards.import.updatedTitle", "Dashboard Updated!")
373
- }),
374
- /* @__PURE__ */ E("p", {
375
- className: "text-sm text-text-secondary mb-4",
376
- children: M("bigconsole.dashboards.import.updatedBody", "Dashboard \"{{name}}\" has been updated with the imported data.", { name: J.dashboard?.name ?? "" })
377
- })
378
- ] }),
379
- !J.originalUpdated && !J.alreadyExists && /* @__PURE__ */ D(T, { children: [
380
- /* @__PURE__ */ E("div", {
381
- className: "mx-auto mb-4 flex size-16 items-center justify-center rounded-full bg-[var(--color-status-success-bgSubtle)]",
382
- children: /* @__PURE__ */ E(u, { className: "size-8 text-status-success-text" })
383
- }),
384
- /* @__PURE__ */ E("h3", {
385
- className: "text-lg font-medium mb-2",
386
- children: M("bigconsole.dashboards.import.successTitle", "Import Successful!")
387
- }),
388
- /* @__PURE__ */ E("p", {
389
- className: "text-sm text-text-secondary mb-4",
390
- children: M("bigconsole.dashboards.import.successBody", "Dashboard \"{{name}}\" has been created.", { name: J.dashboard?.name ?? "" })
391
- }),
392
- J.stats && /* @__PURE__ */ E(g, {
393
- className: "inline-block text-left",
394
- children: /* @__PURE__ */ D(_, {
395
- className: "p-4",
396
- children: [/* @__PURE__ */ E("p", {
397
- className: "text-xs font-medium text-text-secondary mb-2",
398
- children: M("bigconsole.dashboards.import.summaryTitle", "Import Summary")
399
- }), /* @__PURE__ */ D("div", {
400
- className: "grid grid-cols-2 gap-x-6 gap-y-1 text-xs",
401
- children: [
402
- /* @__PURE__ */ E("span", {
403
- className: "text-text-secondary",
404
- children: M("bigconsole.dashboards.import.summaryPages", "Pages:")
405
- }),
406
- /* @__PURE__ */ E("span", { children: J.stats.pagesCreated }),
407
- /* @__PURE__ */ E("span", {
408
- className: "text-text-secondary",
409
- children: M("bigconsole.dashboards.import.summaryWidgets", "Widgets:")
410
- }),
411
- /* @__PURE__ */ E("span", { children: J.stats.widgetsCreated }),
412
- /* @__PURE__ */ E("span", {
413
- className: "text-text-secondary",
414
- children: M("bigconsole.dashboards.import.summaryActions", "Actions:")
415
- }),
416
- /* @__PURE__ */ E("span", { children: J.stats.actionsCreated })
417
- ]
418
- })]
419
- })
347
+ children: /* @__PURE__ */ C(x, { children: [
348
+ /* @__PURE__ */ S("div", {
349
+ className: "mx-auto mb-4 flex size-16 items-center justify-center rounded-full bg-[var(--color-status-success-bgSubtle)]",
350
+ children: /* @__PURE__ */ S(ne, { className: "size-8 text-status-success-text" })
351
+ }),
352
+ /* @__PURE__ */ S("h3", {
353
+ className: "text-lg font-medium mb-2",
354
+ children: D("bigconsole.dashboards.import.successTitle", "Import Successful!")
355
+ }),
356
+ /* @__PURE__ */ S("p", {
357
+ className: "text-sm text-text-secondary mb-4",
358
+ children: D("bigconsole.dashboards.import.successBody", "Dashboard \"{{name}}\" has been created.", { name: J.dashboard?.name ?? "" })
359
+ }),
360
+ J.stats && /* @__PURE__ */ S(ae, {
361
+ className: "inline-block text-left",
362
+ children: /* @__PURE__ */ C(m, {
363
+ className: "p-4",
364
+ children: [/* @__PURE__ */ S("p", {
365
+ className: "text-xs font-medium text-text-secondary mb-2",
366
+ children: D("bigconsole.dashboards.import.summaryTitle", "Import Summary")
367
+ }), /* @__PURE__ */ C("div", {
368
+ className: "grid grid-cols-2 gap-x-6 gap-y-1 text-xs",
369
+ children: [
370
+ /* @__PURE__ */ S("span", {
371
+ className: "text-text-secondary",
372
+ children: D("bigconsole.dashboards.import.summaryPages", "Pages:")
373
+ }),
374
+ /* @__PURE__ */ S("span", { children: J.stats.pagesCreated }),
375
+ /* @__PURE__ */ S("span", {
376
+ className: "text-text-secondary",
377
+ children: D("bigconsole.dashboards.import.summaryWidgets", "Widgets:")
378
+ }),
379
+ /* @__PURE__ */ S("span", { children: J.stats.widgetsCreated }),
380
+ /* @__PURE__ */ S("span", {
381
+ className: "text-text-secondary",
382
+ children: D("bigconsole.dashboards.import.summaryActions", "Actions:")
383
+ }),
384
+ /* @__PURE__ */ S("span", { children: J.stats.actionsCreated })
385
+ ]
386
+ })]
420
387
  })
421
- ] })
422
- ]
388
+ })
389
+ ] })
390
+ }),
391
+ A && /* @__PURE__ */ S(n, {
392
+ headingLevel: 3,
393
+ tone: "danger",
394
+ padding: "compact",
395
+ title: "Import failed",
396
+ description: A
423
397
  }),
424
- K && /* @__PURE__ */ E(t, {
398
+ K && /* @__PURE__ */ S(n, {
425
399
  headingLevel: 3,
426
400
  tone: "danger",
427
401
  padding: "compact",
428
402
  title: "Import failed",
429
403
  description: K.message
430
404
  }),
431
- J && !J.success && J.errorMessage && /* @__PURE__ */ E(t, {
405
+ J && !J.success && J.errorMessage && /* @__PURE__ */ S(n, {
432
406
  headingLevel: 3,
433
407
  tone: "danger",
434
408
  padding: "compact",
@@ -437,36 +411,36 @@ var A = i(function({ isOpen: i, onClose: A, onSuccess: j }) {
437
411
  })
438
412
  ]
439
413
  }),
440
- /* @__PURE__ */ D(S, {
441
- className: "flex-row justify-between sm:justify-between",
442
- children: [/* @__PURE__ */ E("div", { children: N === "preview" && /* @__PURE__ */ D(h, {
414
+ /* @__PURE__ */ C(se, {
415
+ className: "shrink-0 flex-wrap gap-2 sm:justify-between",
416
+ children: [/* @__PURE__ */ S("div", { children: O === "preview" && /* @__PURE__ */ C(p, {
443
417
  variant: "ghost",
444
418
  onClick: () => {
445
- P("select"), F(null), L(null), Z();
419
+ M.current++, k("select"), j(null), z(""), V("PRIVATE"), U(!1), L(null), Z();
446
420
  },
447
421
  disabled: G,
448
- children: [/* @__PURE__ */ E(ee, { className: "size-4" }), M("bigconsole.dashboards.import.back", "Back")]
449
- }) }), /* @__PURE__ */ D("div", {
450
- className: "flex items-center gap-2",
422
+ children: [/* @__PURE__ */ S(te, { className: "size-4" }), D("bigconsole.dashboards.import.back", "Back")]
423
+ }) }), /* @__PURE__ */ C("div", {
424
+ className: "flex flex-wrap items-center gap-2",
451
425
  children: [
452
- N !== "complete" && /* @__PURE__ */ E(h, {
426
+ O !== "complete" && /* @__PURE__ */ S(p, {
453
427
  variant: "outline",
454
- onClick: A,
428
+ onClick: T,
455
429
  disabled: !$,
456
- children: M("bigconsole.dashboards.import.cancel", "Cancel")
430
+ children: D("bigconsole.dashboards.import.cancel", "Cancel")
457
431
  }),
458
- N === "preview" && q?.isValid && /* @__PURE__ */ D(h, {
459
- onClick: ce,
432
+ O === "preview" && q?.isValid && /* @__PURE__ */ C(p, {
433
+ onClick: fe,
460
434
  disabled: G || q.warnings.length > 0 && !H,
461
- children: [/* @__PURE__ */ E(f, { className: "size-4" }), M("bigconsole.dashboards.import.importButton", "Import Dashboard")]
435
+ children: [/* @__PURE__ */ S(d, { className: "size-4" }), D("bigconsole.dashboards.import.importButton", "Import Dashboard")]
462
436
  }),
463
- N === "importing" && /* @__PURE__ */ D("div", {
437
+ O === "importing" && /* @__PURE__ */ C("div", {
464
438
  className: "flex items-center gap-2 text-sm text-text-secondary",
465
- children: [/* @__PURE__ */ E(w, { className: "size-4" }), M("bigconsole.dashboards.import.importing", "Importing...")]
439
+ children: [/* @__PURE__ */ S(b, { className: "size-4" }), D("bigconsole.dashboards.import.importing", "Importing...")]
466
440
  }),
467
- N === "complete" && /* @__PURE__ */ E(h, {
468
- onClick: A,
469
- children: M("bigconsole.dashboards.import.done", "Done")
441
+ O === "complete" && /* @__PURE__ */ S(p, {
442
+ onClick: T,
443
+ children: D("bigconsole.dashboards.import.done", "Done")
470
444
  })
471
445
  ]
472
446
  })]
@@ -476,4 +450,4 @@ var A = i(function({ isOpen: i, onClose: A, onSuccess: j }) {
476
450
  });
477
451
  });
478
452
  //#endregion
479
- export { A as default };
453
+ export { T as default };