@burdenoff/microfe-bigconsole 2026.1110.6 → 2026.1110.8

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,456 +1,471 @@
1
1
  import "../contexts/index.js";
2
2
  import { useAppNavigate as e } from "../contexts/NavigationContext.js";
3
- import { isNative as t, nativeCopyText as ee, nativeImpact as n, nativeNotify as r, nativeToast as te } from "../../utils/nativeBridge.js";
3
+ import { isNative as t, nativeCopyText as n, nativeImpact as ee, nativeNotify as r, nativeToast as te } from "../../utils/nativeBridge.js";
4
4
  import { Section as i, SectionStack as ne } from "../components/common/Section.js";
5
5
  import re from "../hooks/useParserOperations.js";
6
6
  import { useParserStore as ie } from "../store/parserStore.js";
7
7
  import ae from "../hooks/useDataSinkOperations.js";
8
- import { ParserStatusBadge as a } from "../components/parser/ParserStatusBadge.js";
9
- import { ParserTypeBadge as o } from "../components/parser/ParserTypeBadge.js";
10
- import { ExpressionEditor as s } from "../components/parser/ExpressionEditor.js";
11
- import { ExportParserDialog as c } from "../components/parser/ExportParserDialog.js";
8
+ import { ParserStatusBadge as oe } from "../components/parser/ParserStatusBadge.js";
9
+ import { ParserTypeBadge as a } from "../components/parser/ParserTypeBadge.js";
10
+ import { ExpressionEditor as se } from "../components/parser/ExpressionEditor.js";
11
+ import { ExportParserDialog as ce } from "../components/parser/ExportParserDialog.js";
12
12
  import "../components/common/index.js";
13
- import { BIGCONSOLE_PERMISSIONS as l } from "../../constants/permissions.js";
14
- import { memo as u, useCallback as d, useEffect as f, useState as p } from "react";
15
- import { useParams as oe } from "react-router";
16
- import { AccessDenied as se, PermissionButton as m } from "@burdenoff/fe-libs/shared/components";
17
- import { usePermissions as ce } from "@burdenoff/fe-libs/shared/providers/shell";
18
- import { AlertCircle as le, AlertTriangle as ue, ArrowDown as de, ArrowLeft as h, Check as g, Copy as _, Database as v, Download as fe, Edit as pe, FileCode2 as me, Loader2 as he, Play as ge, Trash2 as _e } from "lucide-react";
19
- import { Badge as y, Button as b, IllustratedEmptyState as ve, NextSteps as ye, PagePurpose as be, ResponsiveDialog as xe, ResponsiveDialogContent as x, ResponsiveDialogDescription as S, ResponsiveDialogFooter as C, ResponsiveDialogHeader as w, ResponsiveDialogTitle as T } from "@burdenoff/fe-libs/ui";
20
- import { useI18n as E } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
21
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
22
- import { formatDistanceToNow as A } from "date-fns";
13
+ import { BIGCONSOLE_PERMISSIONS as o } from "../../constants/permissions.js";
14
+ import { memo as s, useCallback as c, useEffect as l, useRef as le, useState as u } from "react";
15
+ import { useParams as ue } from "react-router";
16
+ import { AccessDenied as de, PermissionButton as d } from "@burdenoff/fe-libs/shared/components";
17
+ import { usePermissions as fe } from "@burdenoff/fe-libs/shared/providers/shell";
18
+ import { AlertCircle as pe, AlertTriangle as me, ArrowDown as he, ArrowLeft as f, Check as ge, Clock as p, Copy as _e, Database as ve, Download as ye, Edit as be, FileCode2 as xe, KeyRound as Se, Layers as Ce, Loader2 as we, Play as Te, Tag as Ee, Timer as De, Trash2 as Oe } from "lucide-react";
19
+ import { Badge as m, Button as h, IllustratedEmptyState as ke, NextSteps as g, PagePurpose as _, ResponsiveDialog as v, ResponsiveDialogContent as y, ResponsiveDialogDescription as b, ResponsiveDialogFooter as x, ResponsiveDialogHeader as S, ResponsiveDialogTitle as C } from "@burdenoff/fe-libs/ui";
20
+ import { useI18n as w } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
21
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
22
+ import { formatDistanceToNow as O } from "date-fns";
23
23
  // src/bigconsole/pages/ParserViewPage.tsx
24
- var j = "default", M = u(function() {
25
- let { parserId: u, consoleId: M } = oe(), N = e(), { t: P } = E(), Se = M || j, { hasPermission: Ce, isLoading: we } = ce(), Te = Ce(l.PARSER_READ), [F, I] = p(!1), [Ee, L] = p(!1), [De, R] = p(!1), [z, B] = p(!1), [Oe, V] = p(!1), [H, U] = p(null), W = ie((e) => u ? e.parsers.get(u) : void 0), { loading: ke, error: G, fetchParser: K, deleteParser: q, executeParser: J } = re({
26
- consoleId: Se,
24
+ var k = s(function({ icon: e, label: t, children: n }) {
25
+ return /* @__PURE__ */ D("div", {
26
+ className: "flex items-center justify-between gap-3 py-3 first:pt-0 last:pb-0",
27
+ children: [/* @__PURE__ */ D("dt", {
28
+ className: "flex shrink-0 items-center gap-2 text-text-secondary",
29
+ children: [/* @__PURE__ */ E(e, {
30
+ "aria-hidden": "true",
31
+ className: "h-4 w-4 text-text-muted"
32
+ }), t]
33
+ }), /* @__PURE__ */ E("dd", {
34
+ className: "flex min-w-0 justify-end text-right",
35
+ children: n
36
+ })]
37
+ });
38
+ }), Ae = "default", A = s(function() {
39
+ let { parserId: s, consoleId: A } = ue(), j = e(), { t: M } = w(), N = A || Ae, { hasPermission: je, isLoading: Me } = fe(), Ne = je(o.PARSER_READ), [P, F] = u(!1), [Pe, I] = u(!1), [Fe, L] = u(!1), [R, z] = u(!1), [Ie, B] = u(!1), [V, H] = u(null), U = ie((e) => s ? e.parsers.get(s) : void 0), { loading: Le, error: W, fetchParser: G, deleteParser: K, executeParser: q } = re({
40
+ consoleId: N,
27
41
  skipFetch: !0
28
- }), { dataSinks: Ae, fetchDataSinks: Y } = ae({ skipFetch: !0 });
29
- f(() => {
30
- u && K(u);
31
- }, [u, K]), f(() => {
32
- Y();
33
- }, [Y]);
34
- let X = W?.inputSinkKey ? Ae.find((e) => e.key === W.inputSinkKey) : null, Z = d(() => {
35
- N(M ? `/dashboards/${M}/parsers` : "/parsers");
36
- }, [N, M]), Q = d(() => {
37
- N(M ? `/dashboards/${M}/parsers/${u}/edit` : `/parsers/${u}/edit`);
42
+ }), { dataSinks: Re, fetchDataSinks: J } = ae({ skipFetch: !0 });
43
+ l(() => {
44
+ s && G(s);
45
+ }, [s, G]), l(() => {
46
+ J();
47
+ }, [J]);
48
+ let Y = U?.inputSinkKey ? Re.find((e) => e.key === U.inputSinkKey) : null, X = c(() => {
49
+ j(A ? `/dashboards/${A}/parsers` : "/parsers");
50
+ }, [j, A]), Z = c(() => {
51
+ j(A ? `/dashboards/${A}/parsers/${s}/edit` : `/parsers/${s}/edit`);
38
52
  }, [
39
- N,
40
- u,
41
- M
42
- ]), je = d(async () => {
43
- if (u) {
44
- I(!0);
53
+ j,
54
+ s,
55
+ A
56
+ ]), ze = c(async () => {
57
+ if (s) {
58
+ F(!0);
45
59
  try {
46
- await q(u) ? (t() && r("success"), N(M ? `/dashboards/${M}/parsers` : "/parsers")) : t() && r("error");
60
+ await K(s) ? (t() && r("success"), j(A ? `/dashboards/${A}/parsers` : "/parsers")) : t() && r("error");
47
61
  } catch {
48
62
  t() && r("error");
49
63
  } finally {
50
- I(!1), L(!1);
64
+ F(!1), I(!1);
51
65
  }
52
66
  }
53
67
  }, [
54
- u,
55
- q,
56
- N,
57
- M
58
- ]), Me = d(async () => {
59
- if (W?.expression) try {
60
- await ee(W.expression), R(!0), t() && te(P("bigconsole.parsers.view.expressionCopied", "Expression copied")), setTimeout(() => R(!1), 2e3);
68
+ s,
69
+ K,
70
+ j,
71
+ A
72
+ ]), Q = le(null);
73
+ l(() => () => {
74
+ Q.current && clearTimeout(Q.current);
75
+ }, []);
76
+ let Be = c(async () => {
77
+ if (U?.expression) try {
78
+ await n(U.expression), L(!0), t() && te(M("bigconsole.parsers.view.expressionCopied", "Expression copied")), Q.current && clearTimeout(Q.current), Q.current = setTimeout(() => L(!1), 2e3);
61
79
  } catch {}
62
- }, [W?.expression, P]), $ = d(async () => {
63
- if (u) {
64
- B(!0), U(null);
80
+ }, [U?.expression, M]), $ = c(async () => {
81
+ if (s) {
82
+ z(!0), H(null);
65
83
  try {
66
- let e = await J(u);
67
- e && U({
84
+ let e = await q(s);
85
+ e && H({
68
86
  success: e.success,
69
87
  output: e.output,
70
88
  error: e.error,
71
89
  executionTimeMs: e.executionTimeMs
72
90
  });
73
91
  } catch (e) {
74
- U({
92
+ H({
75
93
  success: !1,
76
94
  output: null,
77
- error: e instanceof Error ? e.message : P("bigconsole.parsers.view.executionFailed", "Execution failed"),
95
+ error: e instanceof Error ? e.message : M("bigconsole.parsers.view.executionFailed", "Execution failed"),
78
96
  executionTimeMs: 0
79
97
  });
80
98
  } finally {
81
- B(!1);
99
+ z(!1);
82
100
  }
83
101
  }
84
102
  }, [
85
- u,
86
- J,
87
- P
88
- ]), Ne = d(() => {
89
- X && N(`/datasinks/${X.id}`);
90
- }, [N, X]), Pe = d(() => {
91
- V(!0);
92
- }, []), Fe = d(() => {
93
- V(!1);
103
+ s,
104
+ q,
105
+ M
106
+ ]), Ve = c(() => {
107
+ Y && j(`/datasinks/${Y.id}`);
108
+ }, [j, Y]), He = c(() => {
109
+ B(!0);
110
+ }, []), Ue = c(() => {
111
+ B(!1);
94
112
  }, []);
95
- if (ke && !W || we) return /* @__PURE__ */ O("div", {
113
+ if (Le && !U || Me) return /* @__PURE__ */ E("div", {
96
114
  className: "flex items-center justify-center min-h-[400px]",
97
- children: /* @__PURE__ */ O(he, { className: "w-8 h-8 text-text-secondary animate-spin" })
115
+ children: /* @__PURE__ */ E(we, { className: "w-8 h-8 text-text-secondary animate-spin" })
98
116
  });
99
- if (!Te) return /* @__PURE__ */ O(se, {
100
- title: P("bigconsole.parsers.accessDenied.title", "Access Denied"),
101
- description: P("bigconsole.parsers.accessDenied.view", "You don't have permission to view this parser.")
117
+ if (!Ne) return /* @__PURE__ */ E(de, {
118
+ title: M("bigconsole.parsers.accessDenied.title", "Access Denied"),
119
+ description: M("bigconsole.parsers.accessDenied.view", "You don't have permission to view this parser.")
102
120
  });
103
- if (G) return /* @__PURE__ */ O("div", {
121
+ if (W) return /* @__PURE__ */ E("div", {
104
122
  className: "p-card-padding",
105
- children: /* @__PURE__ */ O(i, {
123
+ children: /* @__PURE__ */ E(i, {
106
124
  tone: "danger",
107
125
  headingLevel: 2,
108
- title: P("bigconsole.parsers.errors.viewLoadFailed", "Failed to load Parser"),
126
+ title: M("bigconsole.parsers.errors.viewLoadFailed", "Failed to load Parser"),
109
127
  description: "The parser could not be fetched. Go back to the list and try again.",
110
- icon: /* @__PURE__ */ O(le, { className: "h-icon-md w-icon-md text-[var(--color-status-error-text)]" }),
111
- actions: /* @__PURE__ */ k(b, {
112
- onClick: Z,
128
+ icon: /* @__PURE__ */ E(pe, { className: "h-icon-md w-icon-md text-[var(--color-status-error-text)]" }),
129
+ actions: /* @__PURE__ */ D(h, {
130
+ onClick: X,
113
131
  variant: "secondary",
114
132
  size: "sm",
115
- children: [/* @__PURE__ */ O(h, { className: "w-4 h-4 mr-2" }), P("bigconsole.parsers.actions.goBack", "Go back")]
133
+ children: [/* @__PURE__ */ E(f, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.actions.goBack", "Go back")]
116
134
  }),
117
135
  "data-testid": "parser-load-error",
118
- children: /* @__PURE__ */ O("p", {
136
+ children: /* @__PURE__ */ E("p", {
119
137
  className: "font-mono text-xs break-words text-text-secondary",
120
- children: G.message
138
+ children: W.message
121
139
  })
122
140
  })
123
141
  });
124
- if (!W) return /* @__PURE__ */ O("div", {
142
+ if (!U) return /* @__PURE__ */ E("div", {
125
143
  className: "flex items-center justify-center min-h-[400px] p-card-padding",
126
- children: /* @__PURE__ */ O(ve, {
144
+ children: /* @__PURE__ */ E(ke, {
127
145
  illustration: "empty-data",
128
- title: P("bigconsole.parsers.view.notFoundTitle", "Parser not found"),
129
- description: P("bigconsole.parsers.view.notFoundDescription", "The Parser you're looking for doesn't exist or has been deleted."),
130
- action: /* @__PURE__ */ k(b, {
131
- onClick: Z,
146
+ title: M("bigconsole.parsers.view.notFoundTitle", "Parser not found"),
147
+ description: M("bigconsole.parsers.view.notFoundDescription", "The Parser you're looking for doesn't exist or has been deleted."),
148
+ action: /* @__PURE__ */ D(h, {
149
+ onClick: X,
132
150
  variant: "default",
133
151
  size: "default",
134
- children: [/* @__PURE__ */ O(h, { className: "w-4 h-4 mr-2" }), P("bigconsole.parsers.actions.goBackToParsers", "Go back to Parsers")]
152
+ children: [/* @__PURE__ */ E(f, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.actions.goBackToParsers", "Go back to Parsers")]
135
153
  })
136
154
  })
137
155
  });
138
- let Ie = H !== null;
139
- return /* @__PURE__ */ k("div", {
156
+ let We = V !== null;
157
+ return /* @__PURE__ */ D("div", {
140
158
  className: "p-card-padding",
141
159
  children: [
142
- /* @__PURE__ */ k(ne, { children: [
143
- /* @__PURE__ */ k("div", {
160
+ /* @__PURE__ */ D(ne, { children: [
161
+ /* @__PURE__ */ D("div", {
144
162
  className: "flex flex-col gap-form-gap border-b border-[var(--color-border-subtle)] pb-form-gap sm:flex-row sm:items-start sm:justify-between",
145
- children: [/* @__PURE__ */ k("div", {
163
+ children: [/* @__PURE__ */ D("div", {
146
164
  className: "min-w-0 flex-1",
147
165
  children: [
148
- /* @__PURE__ */ k(b, {
149
- onClick: Z,
166
+ /* @__PURE__ */ D(h, {
167
+ onClick: X,
150
168
  variant: "ghost",
151
169
  size: "sm",
152
- className: "mb-4",
153
- children: [/* @__PURE__ */ O(h, { className: "w-4 h-4 mr-2" }), P("bigconsole.parsers.view.backToParsers", "Back to Parsers")]
170
+ className: "mb-4 min-h-11 sm:min-h-9",
171
+ children: [/* @__PURE__ */ E(f, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.view.backToParsers", "Back to Parsers")]
154
172
  }),
155
- /* @__PURE__ */ k("div", {
173
+ /* @__PURE__ */ D("div", {
156
174
  className: "flex items-center gap-2 flex-wrap",
157
175
  children: [
158
- /* @__PURE__ */ O("h1", {
176
+ /* @__PURE__ */ E("h1", {
159
177
  className: "text-2xl font-bold text-text-primary sm:text-3xl",
160
- children: W.name || P("bigconsole.parsers.view.untitled", "Untitled")
178
+ children: U.name || M("bigconsole.parsers.view.untitled", "Untitled")
161
179
  }),
162
- /* @__PURE__ */ O(o, { type: W.type }),
163
- /* @__PURE__ */ O(a, { status: W.status })
180
+ /* @__PURE__ */ E(a, { type: U.type }),
181
+ /* @__PURE__ */ E(oe, { status: U.status })
164
182
  ]
165
183
  }),
166
- W.description && /* @__PURE__ */ O("p", {
184
+ U.description && /* @__PURE__ */ E("p", {
167
185
  className: "text-sm text-text-secondary mt-2",
168
- children: W.description
186
+ children: U.description
169
187
  })
170
188
  ]
171
- }), /* @__PURE__ */ k("div", {
189
+ }), /* @__PURE__ */ D("div", {
172
190
  className: "flex shrink-0 flex-wrap items-center gap-control-gap",
173
191
  children: [
174
- /* @__PURE__ */ O(m, {
175
- permission: l.PARSER_EXECUTE,
192
+ /* @__PURE__ */ E(d, {
193
+ permission: o.PARSER_EXECUTE,
176
194
  deniedBehavior: "disable",
177
- children: /* @__PURE__ */ k(b, {
195
+ children: /* @__PURE__ */ D(h, {
178
196
  onClick: $,
179
- disabled: z,
197
+ disabled: R,
180
198
  variant: "default",
181
199
  size: "default",
182
- children: [/* @__PURE__ */ O(ge, { className: "w-4 h-4 mr-2" }), z ? P("bigconsole.parsers.view.running", "Running...") : P("bigconsole.parsers.actions.execute", "Execute")]
200
+ className: "min-h-11 sm:min-h-9",
201
+ children: [/* @__PURE__ */ E(Te, { className: "w-4 h-4 mr-2" }), R ? M("bigconsole.parsers.view.running", "Running...") : M("bigconsole.parsers.actions.execute", "Execute")]
183
202
  })
184
203
  }),
185
- /* @__PURE__ */ k(b, {
186
- onClick: Pe,
204
+ /* @__PURE__ */ D(h, {
205
+ onClick: He,
187
206
  variant: "secondary",
188
207
  size: "default",
189
- children: [/* @__PURE__ */ O(fe, { className: "w-4 h-4 mr-2" }), P("bigconsole.parsers.actions.export", "Export")]
208
+ className: "min-h-11 sm:min-h-9",
209
+ children: [/* @__PURE__ */ E(ye, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.actions.export", "Export")]
190
210
  }),
191
- /* @__PURE__ */ O(m, {
192
- permission: l.PARSER_UPDATE,
211
+ /* @__PURE__ */ E(d, {
212
+ permission: o.PARSER_UPDATE,
193
213
  deniedBehavior: "disable",
194
- children: /* @__PURE__ */ k(b, {
195
- onClick: Q,
214
+ children: /* @__PURE__ */ D(h, {
215
+ onClick: Z,
196
216
  variant: "secondary",
197
217
  size: "default",
198
- children: [/* @__PURE__ */ O(pe, { className: "w-4 h-4 mr-2" }), P("bigconsole.parsers.actions.edit", "Edit")]
218
+ className: "min-h-11 sm:min-h-9",
219
+ children: [/* @__PURE__ */ E(be, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.actions.edit", "Edit")]
199
220
  })
200
221
  }),
201
- /* @__PURE__ */ O(m, {
202
- permission: l.PARSER_DELETE,
222
+ /* @__PURE__ */ E(d, {
223
+ permission: o.PARSER_DELETE,
203
224
  deniedBehavior: "hide",
204
- children: /* @__PURE__ */ k(b, {
205
- onClick: () => L(!0),
206
- disabled: F,
225
+ children: /* @__PURE__ */ D(h, {
226
+ onClick: () => I(!0),
227
+ disabled: P,
207
228
  variant: "destructive",
208
229
  size: "default",
209
- children: [/* @__PURE__ */ O(_e, { className: "w-4 h-4 mr-2" }), P("bigconsole.parsers.actions.delete", "Delete")]
230
+ className: "min-h-11 sm:min-h-9",
231
+ children: [/* @__PURE__ */ E(Oe, { className: "w-4 h-4 mr-2" }), M("bigconsole.parsers.actions.delete", "Delete")]
210
232
  })
211
233
  })
212
234
  ]
213
235
  })]
214
236
  }),
215
- /* @__PURE__ */ O(be, {
237
+ /* @__PURE__ */ E(_, {
216
238
  className: "max-w-[80ch]",
217
- children: P("bigconsole.parsers.view.purpose", "A parser turns raw input into structured fields using its expression. Review or copy the expression, run it against a sample to see the output, then edit it or use it inside a pipeline to shape incoming data.")
239
+ children: M("bigconsole.parsers.view.purpose", "A parser turns raw input into structured fields using its expression. Review or copy the expression, run it against a sample to see the output, then edit it or use it inside a pipeline to shape incoming data.")
218
240
  }),
219
- /* @__PURE__ */ k("div", {
220
- className: "grid gap-section-gap md:grid-cols-2 lg:grid-cols-3",
221
- children: [/* @__PURE__ */ k("div", {
241
+ /* @__PURE__ */ D("div", {
242
+ className: "grid items-start gap-section-gap md:grid-cols-2 xl:grid-cols-3",
243
+ children: [/* @__PURE__ */ D("div", {
222
244
  className: "flex min-w-0 flex-col gap-section-gap md:col-span-2",
223
- children: [H && /* @__PURE__ */ O(i, {
245
+ children: [V && /* @__PURE__ */ E(i, {
224
246
  id: "parser-execution-result",
225
247
  emphasis: "primary",
226
- tone: H.success ? "success" : "danger",
248
+ tone: V.success ? "success" : "danger",
227
249
  headingLevel: 2,
228
- title: P("bigconsole.parsers.view.executionResult", "Execution Result"),
229
- description: H.success ? "Output produced by the latest run of this parser." : "The latest run did not complete. Fix the expression or the input and run again.",
230
- meta: /* @__PURE__ */ O(y, {
231
- variant: H.success ? "default" : "destructive",
232
- children: H.success ? P("bigconsole.parsers.view.success", "Success") : P("bigconsole.parsers.view.failed", "Failed")
250
+ title: M("bigconsole.parsers.view.executionResult", "Execution Result"),
251
+ description: V.success ? "Output produced by the latest run of this parser." : "The latest run did not complete. Fix the expression or the input and run again.",
252
+ meta: /* @__PURE__ */ E(m, {
253
+ variant: V.success ? "default" : "destructive",
254
+ children: V.success ? M("bigconsole.parsers.view.success", "Success") : M("bigconsole.parsers.view.failed", "Failed")
233
255
  }),
234
- actions: /* @__PURE__ */ k(y, {
256
+ actions: /* @__PURE__ */ D(m, {
235
257
  variant: "secondary",
236
258
  className: "text-xs",
237
- children: [H.executionTimeMs, "ms"]
259
+ children: [V.executionTimeMs, "ms"]
238
260
  }),
239
261
  "data-testid": "parser-execution-result",
240
- children: /* @__PURE__ */ O("pre", {
262
+ children: /* @__PURE__ */ E("pre", {
241
263
  className: "max-h-[300px] min-w-0 overflow-auto rounded-md bg-bg-sunken p-4 font-mono text-sm text-text-primary",
242
- children: H.error ?? JSON.stringify(H.output, null, 2)
264
+ children: V.error ?? JSON.stringify(V.output, null, 2)
243
265
  })
244
- }), /* @__PURE__ */ O(i, {
245
- emphasis: Ie ? "standard" : "primary",
266
+ }), /* @__PURE__ */ D(i, {
267
+ emphasis: We ? "standard" : "primary",
246
268
  headingLevel: 2,
247
- title: P("bigconsole.parsers.view.expression", "Expression"),
269
+ title: M("bigconsole.parsers.view.expression", "Expression"),
248
270
  description: "The JQ or JSONata program this parser runs against every input record.",
249
- icon: /* @__PURE__ */ O(me, { className: "h-icon-sm w-icon-sm" }),
250
- meta: /* @__PURE__ */ O(y, {
271
+ icon: /* @__PURE__ */ E(xe, { className: "h-icon-sm w-icon-sm" }),
272
+ meta: /* @__PURE__ */ E(m, {
251
273
  variant: "secondary",
252
274
  className: "text-xs uppercase",
253
- children: W.type
275
+ children: U.type
254
276
  }),
255
- actions: /* @__PURE__ */ O(b, {
256
- onClick: Me,
277
+ actions: /* @__PURE__ */ E(h, {
278
+ onClick: Be,
257
279
  variant: "ghost",
258
280
  size: "sm",
259
- children: De ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(g, { className: "w-3.5 h-3.5 text-status-success-text mr-2" }), P("bigconsole.parsers.view.copied", "Copied!")] }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(_, { className: "w-3.5 h-3.5 mr-2" }), P("bigconsole.parsers.actions.copy", "Copy")] })
281
+ className: "min-h-11 shrink-0 sm:min-h-9",
282
+ "aria-live": "polite",
283
+ children: Fe ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(ge, { className: "w-3.5 h-3.5 text-status-success-text mr-2" }), M("bigconsole.parsers.view.copied", "Copied!")] }) : /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E(_e, { className: "w-3.5 h-3.5 mr-2" }), M("bigconsole.parsers.actions.copy", "Copy")] })
260
284
  }),
261
285
  "data-testid": "parser-expression",
262
- children: /* @__PURE__ */ O(s, {
263
- value: W.expression,
264
- type: W.type,
286
+ children: [/* @__PURE__ */ E(se, {
287
+ value: U.expression,
288
+ type: U.type,
265
289
  readOnly: !0,
266
290
  height: "clamp(180px, 40vh, 300px)"
267
- })
268
- })]
269
- }), /* @__PURE__ */ k("div", {
270
- className: "grid min-w-0 gap-section-gap md:col-span-2 md:grid-cols-2 lg:col-span-1 lg:grid-cols-1",
271
- children: [
272
- /* @__PURE__ */ O(i, {
273
- headingLevel: 2,
274
- title: P("bigconsole.parsers.view.dataFlow", "Data Flow"),
275
- description: "Where this parser reads from and what it writes.",
276
- "data-testid": "parser-data-flow",
277
- children: /* @__PURE__ */ k("dl", {
278
- className: "space-y-3",
291
+ }), /* @__PURE__ */ D("div", {
292
+ className: "mt-3 flex flex-wrap items-center justify-between gap-3 border-t border-[var(--color-border-subtle)] pt-3 text-xs text-text-secondary",
293
+ children: [/* @__PURE__ */ D("span", {
294
+ className: "inline-flex min-w-0 items-center gap-1.5",
295
+ children: [/* @__PURE__ */ E(he, {
296
+ "aria-hidden": "true",
297
+ className: "h-3.5 w-3.5 shrink-0 -rotate-90"
298
+ }), /* @__PURE__ */ D("span", {
299
+ className: "truncate",
300
+ children: [
301
+ M("bigconsole.parsers.view.outputKey", "Output Key"),
302
+ ":",
303
+ " ",
304
+ /* @__PURE__ */ E("span", {
305
+ className: "font-mono text-text-primary",
306
+ children: U.outputKey || M("bigconsole.parsers.view.notConfigured", "Not configured")
307
+ })
308
+ ]
309
+ })]
310
+ }), /* @__PURE__ */ D("span", {
311
+ className: "tabular-nums",
279
312
  children: [
280
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("dt", {
281
- className: "text-xs font-medium uppercase tracking-wide text-text-muted",
282
- children: P("bigconsole.parsers.view.sourceDataSink", "Source DataSink")
283
- }), W.inputSinkKey ? /* @__PURE__ */ k("dd", {
284
- className: "mt-1",
285
- children: [/* @__PURE__ */ O("p", {
286
- className: "break-words font-mono text-sm font-medium text-text-primary",
287
- children: W.inputSinkKey
288
- }), X && /* @__PURE__ */ k(b, {
289
- onClick: Ne,
290
- variant: "link",
291
- size: "sm",
292
- className: "mt-1 p-0 h-auto",
293
- children: [/* @__PURE__ */ O(v, { className: "w-3 h-3 mr-1" }), P("bigconsole.parsers.view.viewDataSink", "View {{name}}", { name: X.name || P("bigconsole.parsers.view.dataSinkFallback", "DataSink") })]
294
- })]
295
- }) : /* @__PURE__ */ O("dd", {
296
- className: "mt-1 text-sm text-text-muted",
297
- children: P("bigconsole.parsers.view.noneConfigured", "None configured")
298
- })] }),
299
- /* @__PURE__ */ O("div", {
300
- "aria-hidden": "true",
301
- className: "flex items-center justify-center py-1",
302
- children: /* @__PURE__ */ O(de, { className: "w-4 h-4 text-text-muted" })
303
- }),
304
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("dt", {
305
- className: "text-xs font-medium uppercase tracking-wide text-text-muted",
306
- children: P("bigconsole.parsers.view.outputKey", "Output Key")
307
- }), /* @__PURE__ */ O("dd", {
308
- className: "mt-1 break-words font-mono text-sm font-medium text-text-primary",
309
- children: W.outputKey || P("bigconsole.parsers.view.notConfigured", "Not configured")
310
- })] })
313
+ M("bigconsole.parsers.view.version", "Version"),
314
+ " v",
315
+ U.version || 1
311
316
  ]
312
- })
313
- }),
314
- /* @__PURE__ */ O(i, {
315
- headingLevel: 2,
316
- title: P("bigconsole.parsers.view.configuration", "Configuration"),
317
- "data-testid": "parser-configuration",
318
- children: /* @__PURE__ */ k("dl", {
319
- className: "space-y-4 text-sm",
320
- children: [
321
- /* @__PURE__ */ k("div", {
322
- className: "flex flex-wrap items-center justify-between gap-2",
323
- children: [/* @__PURE__ */ O("dt", {
324
- className: "text-text-secondary",
325
- children: P("bigconsole.parsers.view.status", "Status")
326
- }), /* @__PURE__ */ O("dd", { children: /* @__PURE__ */ O(a, { status: W.status }) })]
327
- }),
328
- /* @__PURE__ */ k("div", {
329
- className: "flex flex-wrap items-center justify-between gap-2",
330
- children: [/* @__PURE__ */ O("dt", {
331
- className: "text-text-secondary",
332
- children: P("bigconsole.parsers.view.type", "Type")
333
- }), /* @__PURE__ */ O("dd", { children: /* @__PURE__ */ O(o, { type: W.type }) })]
334
- }),
335
- /* @__PURE__ */ k("div", {
336
- className: "flex flex-wrap items-center justify-between gap-2",
337
- children: [/* @__PURE__ */ O("dt", {
338
- className: "text-text-secondary",
339
- children: P("bigconsole.parsers.view.cacheTtl", "Cache TTL")
340
- }), /* @__PURE__ */ O("dd", {
341
- className: "text-text-primary font-medium",
342
- children: W.ttl ? P("bigconsole.parsers.view.ttlSeconds", "{{ttl}}s", { ttl: W.ttl }) : P("bigconsole.parsers.view.noCaching", "No caching")
343
- })]
344
- }),
345
- /* @__PURE__ */ k("div", {
346
- className: "flex flex-wrap items-center justify-between gap-2",
347
- children: [/* @__PURE__ */ O("dt", {
348
- className: "text-text-secondary",
349
- children: P("bigconsole.parsers.view.version", "Version")
350
- }), /* @__PURE__ */ O("dd", {
351
- className: "text-text-primary font-medium",
352
- children: W.version || 1
353
- })]
317
+ })]
318
+ })]
319
+ })]
320
+ }), /* @__PURE__ */ D("div", {
321
+ className: "grid min-w-0 items-start gap-section-gap md:col-span-2 md:grid-cols-2 xl:col-span-1 xl:grid-cols-1",
322
+ children: [/* @__PURE__ */ E(i, {
323
+ headingLevel: 2,
324
+ title: M("bigconsole.parsers.view.details", "Details"),
325
+ "data-testid": "parser-details",
326
+ children: /* @__PURE__ */ D("dl", {
327
+ className: "divide-y divide-border-subtle text-sm",
328
+ children: [
329
+ /* @__PURE__ */ E(k, {
330
+ icon: Ee,
331
+ label: M("bigconsole.parsers.view.type", "Type"),
332
+ children: /* @__PURE__ */ E(a, { type: U.type })
333
+ }),
334
+ /* @__PURE__ */ E(k, {
335
+ icon: Se,
336
+ label: M("bigconsole.parsers.view.outputKey", "Output Key"),
337
+ children: /* @__PURE__ */ E("span", {
338
+ className: "truncate font-mono text-text-primary",
339
+ title: U.outputKey || void 0,
340
+ children: U.outputKey || M("bigconsole.parsers.view.notConfigured", "Not configured")
354
341
  })
355
- ]
356
- })
357
- }),
358
- /* @__PURE__ */ O(i, {
359
- emphasis: "muted",
360
- padding: "compact",
361
- headingLevel: 2,
362
- title: P("bigconsole.parsers.view.timestamps", "Timestamps"),
363
- "data-testid": "parser-history",
364
- children: /* @__PURE__ */ k("dl", {
365
- className: "space-y-4 text-sm",
366
- children: [/* @__PURE__ */ k("div", {
367
- className: "flex flex-wrap items-center justify-between gap-2",
368
- children: [/* @__PURE__ */ O("dt", {
369
- className: "text-text-secondary",
370
- children: P("bigconsole.parsers.view.created", "Created")
371
- }), /* @__PURE__ */ O("dd", {
372
- className: "text-text-primary font-medium",
373
- children: W.createdAt ? A(new Date(W.createdAt), { addSuffix: !0 }) : P("bigconsole.parsers.view.unknown", "Unknown")
374
- })]
375
- }), /* @__PURE__ */ k("div", {
376
- className: "flex flex-wrap items-center justify-between gap-2",
377
- children: [/* @__PURE__ */ O("dt", {
378
- className: "text-text-secondary",
379
- children: P("bigconsole.parsers.view.updated", "Updated")
380
- }), /* @__PURE__ */ O("dd", {
381
- className: "text-text-primary font-medium",
382
- children: W.updatedAt ? A(new Date(W.updatedAt), { addSuffix: !0 }) : P("bigconsole.parsers.view.unknown", "Unknown")
383
- })]
384
- })]
385
- })
342
+ }),
343
+ /* @__PURE__ */ E(k, {
344
+ icon: ve,
345
+ label: M("bigconsole.parsers.view.sourceDataSink", "Source DataSink"),
346
+ children: U.inputSinkKey ? Y ? /* @__PURE__ */ E(h, {
347
+ onClick: Ve,
348
+ variant: "link",
349
+ size: "sm",
350
+ className: "h-auto min-h-11 min-w-0 max-w-full shrink p-0 font-mono sm:min-h-0",
351
+ title: M("bigconsole.parsers.view.viewDataSink", "View {{name}}", { name: Y.name || M("bigconsole.parsers.view.dataSinkFallback", "DataSink") }),
352
+ children: /* @__PURE__ */ E("span", {
353
+ className: "truncate",
354
+ children: U.inputSinkKey
355
+ })
356
+ }) : /* @__PURE__ */ E("span", {
357
+ className: "truncate font-mono text-text-primary",
358
+ title: U.inputSinkKey,
359
+ children: U.inputSinkKey
360
+ }) : /* @__PURE__ */ E("span", {
361
+ className: "text-text-muted",
362
+ children: M("bigconsole.parsers.view.noneConfigured", "None configured")
363
+ })
364
+ }),
365
+ /* @__PURE__ */ E(k, {
366
+ icon: De,
367
+ label: M("bigconsole.parsers.view.cacheTtl", "Cache TTL"),
368
+ children: /* @__PURE__ */ E("span", {
369
+ className: "font-medium tabular-nums text-text-primary",
370
+ children: U.ttl ? M("bigconsole.parsers.view.ttlSeconds", "{{ttl}}s", { ttl: U.ttl }) : M("bigconsole.parsers.view.noCaching", "No caching")
371
+ })
372
+ }),
373
+ /* @__PURE__ */ E(k, {
374
+ icon: Ce,
375
+ label: M("bigconsole.parsers.view.version", "Version"),
376
+ children: /* @__PURE__ */ D("span", {
377
+ className: "font-medium tabular-nums text-text-primary",
378
+ children: ["v", U.version || 1]
379
+ })
380
+ }),
381
+ /* @__PURE__ */ E(k, {
382
+ icon: p,
383
+ label: M("bigconsole.parsers.view.updated", "Updated"),
384
+ children: /* @__PURE__ */ E("span", {
385
+ className: "font-medium text-text-primary",
386
+ title: U.updatedAt ? new Date(U.updatedAt).toLocaleString() : void 0,
387
+ children: U.updatedAt ? O(new Date(U.updatedAt), { addSuffix: !0 }) : M("bigconsole.parsers.view.unknown", "Unknown")
388
+ })
389
+ }),
390
+ /* @__PURE__ */ E(k, {
391
+ icon: p,
392
+ label: M("bigconsole.parsers.view.created", "Created"),
393
+ children: /* @__PURE__ */ E("span", {
394
+ className: "font-medium text-text-primary",
395
+ title: U.createdAt ? new Date(U.createdAt).toLocaleString() : void 0,
396
+ children: U.createdAt ? O(new Date(U.createdAt), { addSuffix: !0 }) : M("bigconsole.parsers.view.unknown", "Unknown")
397
+ })
398
+ })
399
+ ]
386
400
  })
387
- ]
401
+ }), /* @__PURE__ */ E(g, {
402
+ storageKey: "bigconsole-parser-view",
403
+ steps: [
404
+ {
405
+ id: "execute",
406
+ label: M("bigconsole.parsers.view.nextSteps.executeLabel", "Run a test execution"),
407
+ description: M("bigconsole.parsers.view.nextSteps.executeDescription", "Check the expression produces the fields you expect."),
408
+ onClick: $
409
+ },
410
+ {
411
+ id: "edit",
412
+ label: M("bigconsole.parsers.view.nextSteps.editLabel", "Edit the expression"),
413
+ description: M("bigconsole.parsers.view.nextSteps.editDescription", "Refine how this parser maps your input."),
414
+ onClick: Z
415
+ },
416
+ {
417
+ id: "pipeline",
418
+ label: M("bigconsole.parsers.view.nextSteps.pipelineLabel", "Use it in a pipeline"),
419
+ description: M("bigconsole.parsers.view.nextSteps.pipelineDescription", "Chain this parser with a data sink to process data end to end."),
420
+ onClick: () => j("/pipelines")
421
+ }
422
+ ]
423
+ })]
388
424
  })]
389
- }),
390
- /* @__PURE__ */ O(ye, {
391
- storageKey: "bigconsole-parser-view",
392
- steps: [
393
- {
394
- id: "execute",
395
- label: P("bigconsole.parsers.view.nextSteps.executeLabel", "Run a test execution"),
396
- description: P("bigconsole.parsers.view.nextSteps.executeDescription", "Check the expression produces the fields you expect."),
397
- onClick: $
398
- },
399
- {
400
- id: "edit",
401
- label: P("bigconsole.parsers.view.nextSteps.editLabel", "Edit the expression"),
402
- description: P("bigconsole.parsers.view.nextSteps.editDescription", "Refine how this parser maps your input."),
403
- onClick: Q
404
- },
405
- {
406
- id: "pipeline",
407
- label: P("bigconsole.parsers.view.nextSteps.pipelineLabel", "Use it in a pipeline"),
408
- description: P("bigconsole.parsers.view.nextSteps.pipelineDescription", "Chain this parser with a data sink to process data end to end."),
409
- onClick: () => N("/pipelines")
410
- }
411
- ]
412
425
  })
413
426
  ] }),
414
- /* @__PURE__ */ O(xe, {
415
- open: Ee,
416
- onOpenChange: L,
417
- children: /* @__PURE__ */ k(x, { children: [
418
- /* @__PURE__ */ k(w, { children: [/* @__PURE__ */ O(T, { children: P("bigconsole.parsers.view.deleteDialogTitle", "Delete Parser") }), /* @__PURE__ */ k(S, { children: [
419
- P("bigconsole.parsers.view.deleteConfirmPrefix", "Are you sure you want to delete"),
427
+ /* @__PURE__ */ E(v, {
428
+ open: Pe,
429
+ onOpenChange: I,
430
+ children: /* @__PURE__ */ D(y, { children: [
431
+ /* @__PURE__ */ D(S, { children: [/* @__PURE__ */ E(C, { children: M("bigconsole.parsers.view.deleteDialogTitle", "Delete Parser") }), /* @__PURE__ */ D(b, { children: [
432
+ M("bigconsole.parsers.view.deleteConfirmPrefix", "Are you sure you want to delete"),
420
433
  " ",
421
- /* @__PURE__ */ O("strong", { children: W.name }),
422
- P("bigconsole.parsers.view.deleteConfirmSuffix", "? This action cannot be undone.")
434
+ /* @__PURE__ */ E("strong", { children: U.name }),
435
+ M("bigconsole.parsers.view.deleteConfirmSuffix", "? This action cannot be undone.")
423
436
  ] })] }),
424
- /* @__PURE__ */ O(i, {
437
+ /* @__PURE__ */ E(i, {
425
438
  tone: "warning",
426
439
  padding: "compact",
427
440
  headingLevel: 3,
428
441
  title: "Check dependents first",
429
- description: P("bigconsole.parsers.view.deleteWarning", "Widgets and pipelines using this parser may stop working correctly after deletion."),
430
- icon: /* @__PURE__ */ O(ue, { className: "h-icon-sm w-icon-sm text-[var(--color-status-warning-text)]" }),
442
+ description: M("bigconsole.parsers.view.deleteWarning", "Widgets and pipelines using this parser may stop working correctly after deletion."),
443
+ icon: /* @__PURE__ */ E(me, { className: "h-icon-sm w-icon-sm text-[var(--color-status-warning-text)]" }),
431
444
  "data-testid": "parser-delete-warning"
432
445
  }),
433
- /* @__PURE__ */ k(C, { children: [/* @__PURE__ */ O(b, {
434
- onClick: () => L(!1),
446
+ /* @__PURE__ */ D(x, { children: [/* @__PURE__ */ E(h, {
447
+ onClick: () => I(!1),
435
448
  variant: "secondary",
436
- children: P("bigconsole.parsers.actions.cancel", "Cancel")
437
- }), /* @__PURE__ */ O(b, {
449
+ className: "min-h-11 sm:min-h-9",
450
+ children: M("bigconsole.parsers.actions.cancel", "Cancel")
451
+ }), /* @__PURE__ */ E(h, {
438
452
  onClick: () => {
439
- n("medium"), je();
453
+ ee("medium"), ze();
440
454
  },
441
- disabled: F,
455
+ disabled: P,
442
456
  variant: "destructive",
443
- children: F ? P("bigconsole.parsers.view.deleting", "Deleting...") : P("bigconsole.parsers.view.deleteDialogTitle", "Delete Parser")
457
+ className: "min-h-11 sm:min-h-9",
458
+ children: P ? M("bigconsole.parsers.view.deleting", "Deleting...") : M("bigconsole.parsers.view.deleteDialogTitle", "Delete Parser")
444
459
  })] })
445
460
  ] })
446
461
  }),
447
- /* @__PURE__ */ O(c, {
448
- isOpen: Oe,
449
- parserId: u || null,
450
- parserName: W.name,
451
- onClose: Fe
462
+ /* @__PURE__ */ E(ce, {
463
+ isOpen: Ie,
464
+ parserId: s || null,
465
+ parserName: U.name,
466
+ onClose: Ue
452
467
  })
453
468
  ]
454
469
  });
455
470
  });
456
- export { M as ParserViewPage, M as default };
471
+ export { A as ParserViewPage, A as default };