@wso2/am-core-ui 0.0.18 → 0.0.19

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 (45) hide show
  1. package/dist/APIKeysManager-C0phJriD.js +241 -0
  2. package/dist/CatalogKindListing-DtFI2YMG.js +118 -0
  3. package/dist/CodeBlock-mB_Loq7I.js +21736 -0
  4. package/dist/EnvironmentCard-09h1XRxx.js +310 -0
  5. package/dist/EnvironmentSelector-B7Bl93s2.js +48 -0
  6. package/dist/MCPLogo-D9IJzzl7.js +30 -0
  7. package/dist/PolicyListSection-o4k9e8XO.js +2475 -0
  8. package/dist/ResourceListShell-Cx6mdeqv.js +463 -0
  9. package/dist/SwaggerSpecViewer-BvkhoKsi.js +106 -0
  10. package/dist/clipboard-YAzStmkw.js +23 -0
  11. package/dist/debounce-BV83M53b.js +208 -0
  12. package/dist/format-BEZZRyE2.js +29 -0
  13. package/dist/formatDistanceToNow-TErllcH8.js +100 -0
  14. package/dist/gatewayScripts-D8O45W8u.js +72 -0
  15. package/dist/highlight-BsUzxSR3.js +454 -0
  16. package/dist/index-B52h3RHg.js +1290 -0
  17. package/dist/index-BP5drcF2.js +1265 -0
  18. package/dist/index-BZ4vxviI.js +7981 -0
  19. package/dist/index-B_Z0MwXk.js +25012 -0
  20. package/dist/index-BfjzUWDa.js +1397 -0
  21. package/dist/{index-DYV1jEai.js → index-BnV-PkwM.js} +22 -20
  22. package/dist/index-CGDYgUCH.js +711 -0
  23. package/dist/index-COt7nJIf.js +2286 -0
  24. package/dist/index-CWZjOy1h.js +2247 -0
  25. package/dist/index-CezvogTQ.js +116 -0
  26. package/dist/index-CgCWbWzN.js +2342 -0
  27. package/dist/index-CjCkcuuI.js +322 -0
  28. package/dist/index-CjXvuf9m.js +1354 -0
  29. package/dist/index-DD4qF7gq.js +2340 -0
  30. package/dist/index-DeQ-9KTC.js +737 -0
  31. package/dist/index-Df6OBy4E.js +3041 -0
  32. package/dist/index-KRsV2L4V.js +1564 -0
  33. package/dist/index-PUuASE1F.js +2507 -0
  34. package/dist/index-PWsNvJB-.js +546 -0
  35. package/dist/index-UqDmyMSA.js +119 -0
  36. package/dist/index-_0Pj_ZtW.js +459 -0
  37. package/dist/{index-CnXsN5I3.js → index-sr-mWz4T.js} +31 -30
  38. package/dist/index.d.ts +496 -200
  39. package/dist/index.js +462 -439
  40. package/dist/llmProviderPayload-CzihkdNa.js +332 -0
  41. package/dist/schemas-DFScWdSL.js +2969 -0
  42. package/package.json +1 -1
  43. package/dist/index-B47EJCom.js +0 -236
  44. package/dist/index-Bl1Y7Sro.js +0 -3037
  45. package/dist/index-DlS9Lybj.js +0 -80691
@@ -0,0 +1,1265 @@
1
+ import { jsx as t, jsxs as y, Fragment as Le } from "react/jsx-runtime";
2
+ import { useState as re, useRef as Ce, useCallback as Z, memo as je, useEffect as De, useMemo as ee } from "react";
3
+ import { useParams as Ee, useSearchParams as We } from "react-router-dom";
4
+ import { I as ne, h as Je, aK as xe, N as pe, t as Ke, aL as Ge, aH as ze, aM as Ve, aN as Ye, aO as qe, aP as Xe, aQ as Qe, aR as Ze, i as et, z as tt, aS as nt, T as Q, e as rt, aT as Ne, q as Oe, P as ve, n as it, D as at, m as ot, aU as st } from "./index-B_Z0MwXk.js";
5
+ import { ArrowUp as lt, XCircle as ct, CheckCircle as dt, ArrowDown as ut, Workflow as fe, X as ht, Check as pt, Clock as ft, Coins as mt, Package as gt, Brain as bt, Database as vt, Filter as St, Thermometer as xt, ChartArea as wt, Search as yt, ChevronUp as Tt, ChevronDown as kt, Shovel as Ct, Info as Nt, SortDesc as Ot, SortAsc as It, RefreshCcw as At, Download as Lt } from "@wso2/oxygen-ui-icons-react";
6
+ import { c as q } from "react/compiler-runtime";
7
+ import "@tanstack/react-query";
8
+ import { DataGrid as Dt, ListingTable as _, Button as Se, CircularProgress as de, Tooltip as J, Typography as D, Chip as W, Stack as R, useColorScheme as Et, IconButton as ue, Accordion as zt, AccordionSummary as _t, AccordionDetails as Mt, Box as G, Card as V, CardContent as Y, Divider as we, Tab as ce, Tabs as Rt, Skeleton as he, Alert as se, Snackbar as Pt } from "@wso2/oxygen-ui";
9
+ import { F as Bt } from "./index-PWsNvJB-.js";
10
+ import { E as $t } from "./EnvironmentSelector-B7Bl93s2.js";
11
+ const {
12
+ DataGrid: Ft
13
+ } = Dt, Ut = (i) => i / 1e9;
14
+ function Ht(i) {
15
+ const e = q(13), {
16
+ traces: n,
17
+ onTraceSelect: s,
18
+ sortOrder: r,
19
+ selectedTrace: l,
20
+ isLoading: a,
21
+ isLoadingOlder: h,
22
+ isLoadingNewer: p,
23
+ onLoadOlder: m,
24
+ onLoadNewer: c
25
+ } = i, g = r === void 0 ? "desc" : r, f = a === void 0 ? !1 : a, w = h === void 0 ? !1 : h, C = p === void 0 ? !1 : p, v = g === "desc", b = v ? "Load Newer Traces" : "Load Older Traces", A = v ? c : m, T = v ? !c || C : !m || w, S = v ? C : w, N = v ? "Load Older Traces" : "Load Newer Traces", O = v ? m : c, L = v ? !m || w : !c || C, E = v ? w : C;
26
+ let x;
27
+ return e[0] !== L || e[1] !== N || e[2] !== E || e[3] !== O || e[4] !== f || e[5] !== s || e[6] !== l || e[7] !== T || e[8] !== b || e[9] !== S || e[10] !== A || e[11] !== n ? (x = /* @__PURE__ */ t(ne, { children: f ? /* @__PURE__ */ t(Ft, { rows: [], columns: [{
28
+ field: "status",
29
+ headerName: "Status",
30
+ flex: 5
31
+ }, {
32
+ field: "name",
33
+ headerName: "Name",
34
+ flex: 10
35
+ }, {
36
+ field: "input",
37
+ headerName: "Input",
38
+ flex: 18
39
+ }, {
40
+ field: "output",
41
+ headerName: "Output",
42
+ flex: 18
43
+ }, {
44
+ field: "startTime",
45
+ headerName: "Start Time",
46
+ flex: 12
47
+ }, {
48
+ field: "duration",
49
+ headerName: "Duration",
50
+ flex: 8
51
+ }, {
52
+ field: "tokens",
53
+ headerName: "Tokens",
54
+ flex: 8
55
+ }, {
56
+ field: "spans",
57
+ headerName: "Spans",
58
+ flex: 8
59
+ }, {
60
+ field: "score",
61
+ headerName: "Score",
62
+ flex: 8
63
+ }], loading: !0, hideFooter: !0 }) : n.length > 0 ? /* @__PURE__ */ t(_.Container, { children: /* @__PURE__ */ y(_, { children: [
64
+ /* @__PURE__ */ t(_.Head, { children: /* @__PURE__ */ y(_.Row, { children: [
65
+ /* @__PURE__ */ t(_.Cell, { align: "center", width: "5%", sx: {
66
+ maxWidth: 20
67
+ }, children: "Status" }),
68
+ /* @__PURE__ */ t(_.Cell, { align: "left", width: "10%", children: "Name" }),
69
+ /* @__PURE__ */ t(_.Cell, { align: "left", width: "18%", children: "Input" }),
70
+ /* @__PURE__ */ t(_.Cell, { align: "left", width: "18%", children: "Output" }),
71
+ /* @__PURE__ */ t(_.Cell, { align: "center", width: "12%", children: "Start Time" }),
72
+ /* @__PURE__ */ t(_.Cell, { align: "right", width: "8%", children: "Duration" }),
73
+ /* @__PURE__ */ t(_.Cell, { align: "right", width: "8%", children: "Tokens" }),
74
+ /* @__PURE__ */ t(_.Cell, { align: "right", width: "8%", children: "Spans" }),
75
+ /* @__PURE__ */ t(_.Cell, { align: "right", width: "8%", children: "Score" })
76
+ ] }) }),
77
+ /* @__PURE__ */ y(_.Body, { children: [
78
+ /* @__PURE__ */ t(_.Row, { children: /* @__PURE__ */ t(_.Cell, { colSpan: 9, align: "center", children: /* @__PURE__ */ t(Se, { size: "small", variant: "text", disabled: T, onClick: A, startIcon: S ? /* @__PURE__ */ t(de, { size: 16 }) : /* @__PURE__ */ t(lt, { size: 16 }), children: S ? "Loading..." : b }) }) }),
79
+ n.map((u) => /* @__PURE__ */ y(_.Row, { hover: !0, selected: l === u.traceId, clickable: !0, onClick: () => s?.(u.traceId), children: [
80
+ /* @__PURE__ */ t(_.Cell, { align: "center", sx: {
81
+ color: (o) => u.status?.errorCount && u.status.errorCount > 0 ? o.palette.error.main : o.palette.success.main,
82
+ maxWidth: 20
83
+ }, children: /* @__PURE__ */ t(J, { title: `${u.status?.errorCount} errors found`, disableHoverListener: !u.status?.errorCount || u.status?.errorCount === 0, children: u.status?.errorCount && u.status.errorCount > 0 ? /* @__PURE__ */ t(ct, { size: 16 }) : /* @__PURE__ */ t(dt, { size: 16 }) }) }),
84
+ /* @__PURE__ */ t(_.Cell, { align: "left", children: /* @__PURE__ */ t(D, { variant: "caption", component: "span", sx: {
85
+ display: "block",
86
+ textOverflow: "ellipsis",
87
+ overflow: "hidden",
88
+ whiteSpace: "nowrap",
89
+ maxWidth: "300px"
90
+ }, children: u.rootSpanName }) }),
91
+ /* @__PURE__ */ t(_.Cell, { align: "left", sx: {
92
+ maxWidth: 200
93
+ }, children: /* @__PURE__ */ t(J, { title: "Preview only. Open the trace for the full input.", disableHoverListener: !u.input, children: /* @__PURE__ */ t(D, { variant: "caption", component: "span", sx: {
94
+ display: "block",
95
+ textOverflow: "ellipsis",
96
+ overflow: "hidden",
97
+ whiteSpace: "nowrap",
98
+ maxWidth: "100%"
99
+ }, children: u.input }) }) }),
100
+ /* @__PURE__ */ t(_.Cell, { align: "left", sx: {
101
+ maxWidth: 200
102
+ }, children: /* @__PURE__ */ t(J, { title: "Preview only. Open the trace for the full output.", disableHoverListener: !u.output, children: /* @__PURE__ */ t(D, { variant: "caption", component: "span", sx: {
103
+ display: "block",
104
+ textOverflow: "ellipsis",
105
+ overflow: "hidden",
106
+ whiteSpace: "nowrap",
107
+ maxWidth: "100%"
108
+ }, children: u.output }) }) }),
109
+ /* @__PURE__ */ t(_.Cell, { align: "center", children: /* @__PURE__ */ t(D, { variant: "caption", component: "span", sx: {
110
+ display: "block",
111
+ textOverflow: "ellipsis",
112
+ overflow: "hidden",
113
+ whiteSpace: "nowrap",
114
+ maxWidth: "100%"
115
+ }, children: Je(new Date(u.startTime), "yyyy-MM-dd HH:mm:ss") }) }),
116
+ /* @__PURE__ */ t(_.Cell, { align: "right", children: /* @__PURE__ */ y(D, { variant: "caption", component: "span", children: [
117
+ Ut(u.durationInNanos).toFixed(2),
118
+ "s"
119
+ ] }) }),
120
+ /* @__PURE__ */ t(_.Cell, { align: "right", children: (() => {
121
+ const o = u.tokenUsage, k = o?.totalTokens != null, I = k ? o?.partial ? "Approximate total. This trace has more LLM spans than the list view aggregates. Open the trace for the exact total." : `${o?.inputTokens} input tokens, ${o?.outputTokens} output tokens` : "";
122
+ return /* @__PURE__ */ t(J, { disableHoverListener: !k, title: I, children: /* @__PURE__ */ t(D, { variant: "caption", component: "span", children: k ? /* @__PURE__ */ y(Le, { children: [
123
+ o?.totalTokens,
124
+ o?.partial ? "+" : null
125
+ ] }) : "-" }) });
126
+ })() }),
127
+ /* @__PURE__ */ t(_.Cell, { align: "right", children: /* @__PURE__ */ t(D, { variant: "caption", component: "span", children: u.spanCount }) }),
128
+ /* @__PURE__ */ t(_.Cell, { align: "right", children: (() => {
129
+ const o = u.score;
130
+ return !o || o.score == null ? /* @__PURE__ */ t(D, { variant: "caption", component: "span", children: "-" }) : /* @__PURE__ */ t(J, { title: `${o.totalCount} evaluations, ${o.skippedCount} skipped`, children: /* @__PURE__ */ y(D, { variant: "caption", component: "span", sx: {
131
+ color: xe(o.score),
132
+ fontWeight: 600
133
+ }, children: [
134
+ (o.score * 100).toFixed(1),
135
+ "%"
136
+ ] }) });
137
+ })() })
138
+ ] }, u.traceId)),
139
+ /* @__PURE__ */ t(_.Row, { children: /* @__PURE__ */ t(_.Cell, { colSpan: 9, align: "center", children: /* @__PURE__ */ t(Se, { size: "small", variant: "text", disabled: L, onClick: O, startIcon: E ? /* @__PURE__ */ t(de, { size: 16 }) : /* @__PURE__ */ t(ut, { size: 16 }), children: E ? "Loading..." : N }) }) })
140
+ ] })
141
+ ] }) }) : /* @__PURE__ */ t(_.Container, { children: /* @__PURE__ */ t(_.EmptyState, { illustration: /* @__PURE__ */ t(fe, { size: 64 }), title: "No traces found!", description: "Try changing the time range" }) }) }), e[0] = L, e[1] = N, e[2] = E, e[3] = O, e[4] = f, e[5] = s, e[6] = l, e[7] = T, e[8] = b, e[9] = S, e[10] = A, e[11] = n, e[12] = x) : x = e[12], x;
142
+ }
143
+ function jt(i) {
144
+ return i > 1e3 * 1e3 * 1e3 ? `${(i / (1e3 * 1e3 * 1e3)).toFixed(2)}s` : i > 1e3 * 1e3 ? `${(i / (1e3 * 1e3)).toFixed(2)}ms` : `${(i / 1e3).toFixed(2)}μs`;
145
+ }
146
+ function Wt(i) {
147
+ const e = q(39), {
148
+ span: n,
149
+ evaluatorScores: s
150
+ } = i;
151
+ let r;
152
+ e[0] !== n.ampAttributes ? (r = n.ampAttributes || {}, e[0] = n.ampAttributes, e[1] = r) : r = e[1];
153
+ const {
154
+ kind: l,
155
+ data: a
156
+ } = r;
157
+ let h, p, m, c, g, f, w;
158
+ if (l === "llm" && a) {
159
+ const d = a;
160
+ h = d.model, p = d.vendor, m = d.tokenUsage, c = d.temperature;
161
+ } else if (l === "agent" && a) {
162
+ const d = a;
163
+ h = d.model, g = d.framework, m = d.tokenUsage;
164
+ } else if (l === "embedding" && a) {
165
+ const d = a;
166
+ h = d.model, p = d.vendor, m = d.tokenUsage;
167
+ } else if (l === "retriever" && a) {
168
+ const d = a;
169
+ f = d.vectorDB, w = d.topK;
170
+ }
171
+ const C = p && h ? `${p}/${h}` : h;
172
+ let v;
173
+ if (e[2] !== s) {
174
+ if (v = /* @__PURE__ */ new Map(), s?.length)
175
+ for (const d of s)
176
+ v.set(d.evaluatorName, (v.get(d.evaluatorName) ?? 0) + 1);
177
+ e[2] = s, e[3] = v;
178
+ } else
179
+ v = e[3];
180
+ let b;
181
+ e[4] !== v ? (b = (d) => (v.get(d.evaluatorName) ?? 0) > 1 ? `${d.monitorName}/${d.evaluatorName}` : d.evaluatorName, e[4] = v, e[5] = b) : b = e[5];
182
+ const A = b;
183
+ let T;
184
+ e[6] !== n.ampAttributes?.status?.error || e[7] !== n.ampAttributes?.status?.errorType ? (T = n.ampAttributes?.status?.error && /* @__PURE__ */ t(J, { title: n.ampAttributes?.status?.errorType || "Failed to execute the span", children: /* @__PURE__ */ t(W, { icon: /* @__PURE__ */ t(ht, { size: 16 }), size: "small", variant: "outlined", label: n.ampAttributes?.status?.errorType || "Failed", color: "error" }) }), e[6] = n.ampAttributes?.status?.error, e[7] = n.ampAttributes?.status?.errorType, e[8] = T) : T = e[8];
185
+ let S;
186
+ e[9] !== n.ampAttributes?.status?.error ? (S = !n.ampAttributes?.status?.error && /* @__PURE__ */ t(W, { icon: /* @__PURE__ */ t(pt, { size: 16 }), size: "small", variant: "outlined", label: "Success", color: "success" }), e[9] = n.ampAttributes?.status?.error, e[10] = S) : S = e[10];
187
+ let N;
188
+ e[11] !== n.durationInNanos ? (N = n.durationInNanos != null && /* @__PURE__ */ t(J, { title: "Execution duration", children: /* @__PURE__ */ t(W, { icon: /* @__PURE__ */ t(ft, { size: 16 }), size: "small", variant: "outlined", label: jt(n.durationInNanos) }) }), e[11] = n.durationInNanos, e[12] = N) : N = e[12];
189
+ let O;
190
+ e[13] !== g ? (O = g && /* @__PURE__ */ t(J, { title: "Framework", children: /* @__PURE__ */ t(W, { icon: /* @__PURE__ */ t(gt, { size: 16 }), size: "small", variant: "outlined", label: g }) }), e[13] = g, e[14] = O) : O = e[14];
191
+ let L;
192
+ e[15] !== C ? (L = C && /* @__PURE__ */ t(J, { title: "Model used", children: /* @__PURE__ */ t(W, { icon: /* @__PURE__ */ t(bt, { size: 16 }), size: "small", variant: "outlined", label: C }) }), e[15] = C, e[16] = L) : L = e[16];
193
+ let E;
194
+ e[17] !== f ? (E = f && /* @__PURE__ */ t(J, { title: "Vector database", children: /* @__PURE__ */ t(W, { icon: /* @__PURE__ */ t(vt, { size: 16 }), size: "small", variant: "outlined", label: f }) }), e[17] = f, e[18] = E) : E = e[18];
195
+ let x;
196
+ e[19] !== w ? (x = w !== void 0 && /* @__PURE__ */ t(J, { title: "Top K results", children: /* @__PURE__ */ t(W, { icon: /* @__PURE__ */ t(St, { size: 16 }), size: "small", variant: "outlined", label: `Top ${w}` }) }), e[19] = w, e[20] = x) : x = e[20];
197
+ let u;
198
+ e[21] !== m ? (u = m && /* @__PURE__ */ t(J, { title: `${m.inputTokens} input tokens, ${m.outputTokens} output tokens`, children: /* @__PURE__ */ t(W, { icon: /* @__PURE__ */ t(mt, { size: 16 }), size: "small", variant: "outlined", label: m.totalTokens }) }), e[21] = m, e[22] = u) : u = e[22];
199
+ let o;
200
+ e[23] !== c ? (o = c !== void 0 && /* @__PURE__ */ t(J, { title: "Temperature", children: /* @__PURE__ */ t(W, { icon: /* @__PURE__ */ t(xt, { size: 16 }), size: "small", variant: "outlined", label: c }) }), e[23] = c, e[24] = o) : o = e[24];
201
+ let k;
202
+ e[25] !== s || e[26] !== A ? (k = s && s.length > 0 && s.map((d, B) => {
203
+ const F = A(d);
204
+ if (d.score != null) {
205
+ const P = xe(d.score);
206
+ return /* @__PURE__ */ t(J, { title: d.explanation || "No explanation", children: /* @__PURE__ */ t(W, { size: "small", variant: "outlined", label: `${F}: ${(d.score * 100).toFixed(1)}%`, sx: {
207
+ color: P,
208
+ borderColor: P
209
+ } }) }, B);
210
+ }
211
+ return /* @__PURE__ */ t(J, { title: d.skipReason || "Skipped", children: /* @__PURE__ */ t(W, { size: "small", variant: "outlined", label: `${F}: Skipped`, sx: {
212
+ opacity: 0.6,
213
+ fontStyle: "italic"
214
+ } }) }, B);
215
+ }), e[25] = s, e[26] = A, e[27] = k) : k = e[27];
216
+ let I;
217
+ return e[28] !== u || e[29] !== o || e[30] !== k || e[31] !== T || e[32] !== S || e[33] !== N || e[34] !== O || e[35] !== L || e[36] !== E || e[37] !== x ? (I = /* @__PURE__ */ y(R, { spacing: 1, direction: "row", flexWrap: "wrap", useFlexGap: !0, alignItems: "center", children: [
218
+ T,
219
+ S,
220
+ N,
221
+ O,
222
+ L,
223
+ E,
224
+ x,
225
+ u,
226
+ o,
227
+ k
228
+ ] }), e[28] = u, e[29] = o, e[30] = k, e[31] = T, e[32] = S, e[33] = N, e[34] = O, e[35] = L, e[36] = E, e[37] = x, e[38] = I) : I = e[38], I;
229
+ }
230
+ const _e = "custom-dark-transparent", Me = "custom-light-transparent";
231
+ function Jt(i) {
232
+ i.editor.defineTheme(_e, {
233
+ base: "vs-dark",
234
+ inherit: !0,
235
+ rules: [],
236
+ colors: {
237
+ "editor.background": "#00000000",
238
+ // Transparent
239
+ "editor.findMatchBackground": "#fa7b3f",
240
+ // Darker color for current match with opacity
241
+ "editor.findMatchHighlightBackground": "#fa7b3f",
242
+ // Darker color for other matches with opacity
243
+ "editor.findMatchBorder": "#ffffff",
244
+ // White border for current match
245
+ "editor.findMatchHighlightBorder": "#fa7b3f",
246
+ // Semi-transparent white border for other matches
247
+ "editor.selectionBackground": "#fa7b3f",
248
+ // Darker selection color with high opacity
249
+ "editor.selectionForeground": "#ffffff",
250
+ // White text for selected content
251
+ "editor.inactiveSelectionBackground": "#fa7b3f",
252
+ // Selection when editor is not focused
253
+ "editor.selectionHighlightBackground": "#fa7b3f"
254
+ // Background for matching selections
255
+ }
256
+ }), i.editor.defineTheme(Me, {
257
+ base: "vs",
258
+ inherit: !0,
259
+ rules: [],
260
+ colors: {
261
+ // "editor.background": "#00000000", // Transparent
262
+ "editor.findMatchBackground": "#fa7b3f",
263
+ // Darker color for current match with opacity
264
+ "editor.findMatchHighlightBackground": "#fa7b3f",
265
+ // Darker color for other matches with opacity
266
+ "editor.findMatchBorder": "#fa7b3f",
267
+ // Black border for current match
268
+ "editor.findMatchHighlightBorder": "#fa7b3f",
269
+ // Semi-transparent black border for other matches
270
+ "editor.selectionBackground": "#fa7b3f",
271
+ // Darker selection color with high opacity
272
+ "editor.selectionForeground": "#ffffff",
273
+ // White text for selected content
274
+ "editor.inactiveSelectionBackground": "#fa7b3f",
275
+ // Selection when editor is not focused
276
+ "editor.selectionHighlightBackground": "#fa7b3f"
277
+ // Background for matching selections
278
+ }
279
+ });
280
+ }
281
+ function Kt(i) {
282
+ const e = /* @__PURE__ */ new WeakSet(), n = (s, r) => {
283
+ if (typeof r == "bigint")
284
+ return r.toString();
285
+ if (typeof r == "object" && r !== null) {
286
+ if (e.has(r))
287
+ return "[Circular]";
288
+ e.add(r);
289
+ }
290
+ return r === void 0 ? "[undefined]" : r;
291
+ };
292
+ try {
293
+ return JSON.stringify(i, n, 2);
294
+ } catch {
295
+ try {
296
+ const s = {};
297
+ for (const [r, l] of Object.entries(i))
298
+ try {
299
+ typeof l == "bigint" ? s[r] = l.toString() : l === void 0 ? s[r] = "[undefined]" : s[r] = JSON.parse(JSON.stringify(l, n));
300
+ } catch {
301
+ s[r] = "[unserializable]";
302
+ }
303
+ return JSON.stringify(s, null, 2);
304
+ } catch {
305
+ return "<unserializable attributes>";
306
+ }
307
+ }
308
+ }
309
+ function Gt(i) {
310
+ const e = q(36), {
311
+ attributes: n
312
+ } = i, {
313
+ mode: s
314
+ } = Et(), [r, l] = re(""), [a, h] = re(0), [p, m] = re(0), c = Ce(null);
315
+ let g;
316
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (g = [], e[0] = g) : g = e[0];
317
+ const f = Ce(g), w = Vt;
318
+ let C;
319
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (C = (M) => {
320
+ c.current = M;
321
+ }, e[1] = C) : C = e[1];
322
+ const v = C;
323
+ let b;
324
+ e[2] === Symbol.for("react.memo_cache_sentinel") ? (b = (M) => {
325
+ if (!c.current || f.current.length === 0)
326
+ return;
327
+ const j = f.current[M];
328
+ j && (c.current.setPosition({
329
+ lineNumber: j.range.startLineNumber,
330
+ column: j.range.startColumn
331
+ }), c.current.revealLineInCenter(j.range.startLineNumber), c.current.setSelection(j.range), h(M + 1));
332
+ }, e[2] = b) : b = e[2];
333
+ const A = b;
334
+ let T;
335
+ if (e[3] === Symbol.for("react.memo_cache_sentinel")) {
336
+ const M = (j) => {
337
+ if (!c.current || !j.trim()) {
338
+ f.current = [], m(0), h(0);
339
+ return;
340
+ }
341
+ const X = c.current.getModel();
342
+ if (!X)
343
+ return;
344
+ const ae = [], me = j.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), ge = new RegExp(me, "gi"), be = X.getValue();
345
+ let te;
346
+ for (; (te = ge.exec(be)) !== null; ) {
347
+ const ie = X.getPositionAt(te.index), le = X.getPositionAt(te.index + te[0].length);
348
+ ae.push({
349
+ range: {
350
+ startLineNumber: ie.lineNumber,
351
+ startColumn: ie.column,
352
+ endLineNumber: le.lineNumber,
353
+ endColumn: le.column
354
+ }
355
+ });
356
+ }
357
+ f.current = ae, m(ae.length), ae.length > 0 ? (h(1), A(0)) : h(0);
358
+ };
359
+ T = (j) => {
360
+ l(j), M(j);
361
+ }, e[3] = T;
362
+ } else
363
+ T = e[3];
364
+ const S = T;
365
+ let N;
366
+ e[4] !== a ? (N = () => {
367
+ if (f.current.length === 0)
368
+ return;
369
+ const M = a % f.current.length;
370
+ A(M);
371
+ }, e[4] = a, e[5] = N) : N = e[5];
372
+ const O = N;
373
+ let L;
374
+ e[6] !== a ? (L = () => {
375
+ if (f.current.length === 0)
376
+ return;
377
+ const M = a <= 1 ? f.current.length - 1 : a - 2;
378
+ A(M);
379
+ }, e[6] = a, e[7] = L) : L = e[7];
380
+ const E = L;
381
+ if (!n || Object.keys(n).length === 0) {
382
+ let M;
383
+ return e[8] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ t(pe, { message: "No attributes found", iconElement: wt, subtitle: "Try selecting a different span to view attributes", disableBackground: !0 }), e[8] = M) : M = e[8], M;
384
+ }
385
+ let x;
386
+ e[9] === Symbol.for("react.memo_cache_sentinel") ? (x = (M) => S(M.target.value), e[9] = x) : x = e[9];
387
+ let u;
388
+ e[10] !== O ? (u = (M) => {
389
+ M.key === "Enter" && O();
390
+ }, e[10] = O, e[11] = u) : u = e[11];
391
+ let o;
392
+ e[12] !== a || e[13] !== p ? (o = {
393
+ input: {
394
+ endAdornment: p > 0 ? /* @__PURE__ */ t(R, { direction: "row", alignItems: "center", gap: 1, children: /* @__PURE__ */ y(D, { variant: "caption", noWrap: !0, children: [
395
+ a,
396
+ " / ",
397
+ p
398
+ ] }) }) : /* @__PURE__ */ t(yt, { size: 16, "aria-hidden": "true" })
399
+ }
400
+ }, e[12] = a, e[13] = p, e[14] = o) : o = e[14];
401
+ let k;
402
+ e[15] !== r || e[16] !== u || e[17] !== o ? (k = /* @__PURE__ */ t(Ke, { placeholder: "Search...", value: r, onChange: x, size: "small", fullWidth: !0, "aria-label": "Search attributes", onKeyDown: u, slotProps: o }), e[15] = r, e[16] = u, e[17] = o, e[18] = k) : k = e[18];
403
+ let I;
404
+ e[19] !== O || e[20] !== E || e[21] !== p ? (I = p > 0 && /* @__PURE__ */ y(R, { direction: "row", alignItems: "center", gap: 1, children: [
405
+ /* @__PURE__ */ t(ue, { size: "small", onClick: E, "aria-label": "Previous match", title: "Previous match", children: /* @__PURE__ */ t(Tt, { size: 16, "aria-hidden": "true" }) }),
406
+ /* @__PURE__ */ t(ue, { size: "small", onClick: O, "aria-label": "Next match", title: "Next match", children: /* @__PURE__ */ t(kt, { size: 16, "aria-hidden": "true" }) })
407
+ ] }), e[19] = O, e[20] = E, e[21] = p, e[22] = I) : I = e[22];
408
+ let d;
409
+ e[23] !== k || e[24] !== I ? (d = /* @__PURE__ */ y(R, { spacing: 1, pt: 2, direction: "row", justifyContent: "right", alignItems: "center", children: [
410
+ k,
411
+ I
412
+ ] }), e[23] = k, e[24] = I, e[25] = d) : d = e[25];
413
+ const B = s === "dark" ? _e : Me;
414
+ let F;
415
+ e[26] !== n ? (F = Kt(n), e[26] = n, e[27] = F) : F = e[27];
416
+ let P;
417
+ e[28] === Symbol.for("react.memo_cache_sentinel") ? (P = {
418
+ enabled: !1
419
+ }, e[28] = P) : P = e[28];
420
+ let H;
421
+ e[29] === Symbol.for("react.memo_cache_sentinel") ? (H = {
422
+ readOnly: !0,
423
+ contextmenu: !1,
424
+ minimap: P,
425
+ scrollBeyondLastLine: !1,
426
+ scrollbar: {
427
+ horizontal: "auto",
428
+ vertical: "auto"
429
+ },
430
+ wordWrap: "on",
431
+ folding: !0,
432
+ foldingStrategy: "auto",
433
+ showFoldingControls: "always",
434
+ foldingHighlight: !0,
435
+ unfoldOnClickAfterEndOfLine: !0
436
+ }, e[29] = H) : H = e[29];
437
+ let $;
438
+ e[30] !== B || e[31] !== F ? ($ = /* @__PURE__ */ t(Bt, { height: "calc(100vh - 266px)", theme: B, value: F, language: "json", beforeMount: w, onMount: v, options: H }), e[30] = B, e[31] = F, e[32] = $) : $ = e[32];
439
+ let U;
440
+ return e[33] !== d || e[34] !== $ ? (U = /* @__PURE__ */ y(R, { direction: "column", spacing: 2, children: [
441
+ d,
442
+ $
443
+ ] }), e[33] = d, e[34] = $, e[35] = U) : U = e[35], U;
444
+ }
445
+ function Vt(i) {
446
+ Jt(i);
447
+ }
448
+ function Yt({
449
+ tools: i
450
+ }) {
451
+ const [e, n] = re(!1), s = Z((a) => (h, p) => {
452
+ n(p ? a : !1);
453
+ }, []), r = Z((a) => {
454
+ if (a == null) return !1;
455
+ if (typeof a == "object" || Array.isArray(a)) return !0;
456
+ if (typeof a == "string")
457
+ try {
458
+ const h = JSON.parse(a);
459
+ return typeof h == "object" && h !== null;
460
+ } catch {
461
+ return !1;
462
+ }
463
+ return !1;
464
+ }, []), l = Z((a) => {
465
+ if (a === null) return "null";
466
+ if (a === void 0) return "undefined";
467
+ if (typeof a == "object" || Array.isArray(a))
468
+ try {
469
+ return JSON.stringify(a, null, 2);
470
+ } catch {
471
+ return String(a);
472
+ }
473
+ if (typeof a == "string")
474
+ try {
475
+ const h = JSON.parse(a);
476
+ if (typeof h == "object" && h !== null)
477
+ return JSON.stringify(h, null, 2);
478
+ } catch {
479
+ }
480
+ return String(a);
481
+ }, []);
482
+ return !i || i.length === 0 ? /* @__PURE__ */ t(pe, { message: "No tools found", iconElement: Ct, subtitle: "No tools found", disableBackground: !0 }) : /* @__PURE__ */ t(R, { children: i.map((a, h) => {
483
+ const p = typeof a == "string", m = p ? a : a.name, c = m || `tool-${h}`;
484
+ return /* @__PURE__ */ y(zt, { expanded: e === c, onChange: s(c), children: [
485
+ /* @__PURE__ */ t(_t, { children: /* @__PURE__ */ t(D, { variant: "h6", children: m }) }),
486
+ /* @__PURE__ */ t(Mt, { children: /* @__PURE__ */ y(R, { direction: "column", spacing: 2, children: [
487
+ !p && a.description && /* @__PURE__ */ y(G, { children: [
488
+ /* @__PURE__ */ t(D, { variant: "subtitle2", sx: {
489
+ mb: 1
490
+ }, children: "Description" }),
491
+ /* @__PURE__ */ t(V, { variant: "outlined", children: /* @__PURE__ */ t(Y, { sx: {
492
+ "&:last-child": {
493
+ pb: 1.5
494
+ }
495
+ }, children: /* @__PURE__ */ t(D, { variant: "body2", children: a.description }) }) })
496
+ ] }),
497
+ !p && a.parameters && /* @__PURE__ */ y(G, { children: [
498
+ /* @__PURE__ */ t(D, { variant: "subtitle2", sx: {
499
+ mb: 1
500
+ }, children: "Parameters" }),
501
+ /* @__PURE__ */ t(V, { variant: "outlined", sx: {
502
+ maxHeight: r(a.parameters) ? 375 : "auto",
503
+ overflow: "auto"
504
+ }, children: /* @__PURE__ */ t(Y, { sx: {
505
+ "&:last-child": {
506
+ pb: 1.5
507
+ }
508
+ }, children: /* @__PURE__ */ t(D, { variant: "caption", sx: {
509
+ fontFamily: "monospace",
510
+ whiteSpace: "pre-wrap",
511
+ wordBreak: "break-word"
512
+ }, children: l(a.parameters) }) }) })
513
+ ] }),
514
+ p && /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(V, { variant: "outlined", sx: {
515
+ bgcolor: "action.hover"
516
+ }, children: /* @__PURE__ */ t(Y, { sx: {
517
+ "&:last-child": {
518
+ pb: 1.5
519
+ }
520
+ }, children: /* @__PURE__ */ t(D, { variant: "body2", color: "text.secondary", children: "Additional tool details are not available" }) }) }) })
521
+ ] }) })
522
+ ] }, c);
523
+ }) });
524
+ }
525
+ function ye(i) {
526
+ function e(n) {
527
+ if (typeof n == "string")
528
+ try {
529
+ const s = JSON.parse(n);
530
+ return e(s);
531
+ } catch {
532
+ return n;
533
+ }
534
+ if (Array.isArray(n))
535
+ return n.map((s) => e(s));
536
+ if (n !== null && typeof n == "object") {
537
+ const s = {};
538
+ for (const r in n)
539
+ Object.prototype.hasOwnProperty.call(n, r) && (s[r] = e(n[r]));
540
+ return s;
541
+ }
542
+ return n;
543
+ }
544
+ try {
545
+ const n = e(i);
546
+ return JSON.stringify(n, null, 2);
547
+ } catch {
548
+ return i;
549
+ }
550
+ }
551
+ const Ie = je(function(e) {
552
+ const n = q(23), {
553
+ title: s,
554
+ messages: r,
555
+ getRoleColor: l,
556
+ "data-testid": a,
557
+ showEmptyMessage: h
558
+ } = e, p = h === void 0 ? !1 : h;
559
+ if (r.length === 0) {
560
+ if (!p)
561
+ return null;
562
+ let v;
563
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (v = {
564
+ mb: 2
565
+ }, n[0] = v) : v = n[0];
566
+ let b;
567
+ n[1] !== s ? (b = /* @__PURE__ */ t(D, { variant: "h6", sx: v, children: s }), n[1] = s, n[2] = b) : b = n[2];
568
+ let A;
569
+ n[3] === Symbol.for("react.memo_cache_sentinel") ? (A = {
570
+ bgcolor: "action.hover"
571
+ }, n[3] = A) : A = n[3];
572
+ let T;
573
+ n[4] === Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ t(V, { variant: "outlined", sx: A, children: /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(D, { variant: "body2", color: "text.secondary", children: "No data available" }) }) }), n[4] = T) : T = n[4];
574
+ let S;
575
+ return n[5] !== b || n[6] !== a ? (S = /* @__PURE__ */ y(G, { "data-testid": a, children: [
576
+ b,
577
+ T
578
+ ] }), n[5] = b, n[6] = a, n[7] = S) : S = n[7], S;
579
+ }
580
+ let m;
581
+ n[8] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ t(we, { sx: {
582
+ mb: 2
583
+ } }), n[8] = m) : m = n[8];
584
+ let c;
585
+ n[9] === Symbol.for("react.memo_cache_sentinel") ? (c = {
586
+ mb: 2
587
+ }, n[9] = c) : c = n[9];
588
+ let g;
589
+ n[10] !== s ? (g = /* @__PURE__ */ t(D, { variant: "h6", sx: c, children: s }), n[10] = s, n[11] = g) : g = n[11];
590
+ let f;
591
+ if (n[12] !== l || n[13] !== r) {
592
+ let v;
593
+ n[15] !== l ? (v = (b, A) => {
594
+ const T = b.id ?? A;
595
+ return /* @__PURE__ */ t(V, { variant: "outlined", children: /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ y(R, { spacing: 1.5, children: [
596
+ /* @__PURE__ */ t(G, { sx: {
597
+ display: "flex",
598
+ alignItems: "center",
599
+ gap: 1
600
+ }, children: b?.role && b.role !== "unknown" && /* @__PURE__ */ t(W, { label: b.role.charAt(0).toUpperCase() + b.role.slice(1), size: "small", color: l(b.role), variant: "outlined" }) }),
601
+ b.content && !b.role && /* @__PURE__ */ t(Ge, { json: ye(b.content) }),
602
+ b.content && b.role && /* @__PURE__ */ t(ze, { content: b.content }),
603
+ b.toolCalls && b.toolCalls.length > 0 && /* @__PURE__ */ t(G, { children: /* @__PURE__ */ t(R, { spacing: 1, children: b.toolCalls.map(en) }) })
604
+ ] }) }) }, T);
605
+ }, n[15] = l, n[16] = v) : v = n[16], f = r.map(v), n[12] = l, n[13] = r, n[14] = f;
606
+ } else
607
+ f = n[14];
608
+ let w;
609
+ n[17] !== f ? (w = /* @__PURE__ */ t(R, { spacing: 2, children: f }), n[17] = f, n[18] = w) : w = n[18];
610
+ let C;
611
+ return n[19] !== g || n[20] !== w || n[21] !== a ? (C = /* @__PURE__ */ y(R, { pt: 2, "data-testid": a, children: [
612
+ m,
613
+ g,
614
+ w
615
+ ] }), n[19] = g, n[20] = w, n[21] = a, n[22] = C) : C = n[22], C;
616
+ });
617
+ function qt(i) {
618
+ const e = q(29), {
619
+ ampAttributes: n
620
+ } = i, s = Qt;
621
+ n?.input;
622
+ const r = n?.input;
623
+ let l;
624
+ e[0] !== r ? (l = s(r), e[0] = r, e[1] = l) : l = e[1];
625
+ const a = l;
626
+ let h;
627
+ e[2] !== n?.output ? (h = () => s(n?.output), e[2] = n?.output, e[3] = h) : h = e[3], n?.output;
628
+ let p;
629
+ e[4] !== h ? (p = h(), e[4] = h, e[5] = p) : p = e[5];
630
+ const m = p;
631
+ let c;
632
+ e: {
633
+ let x;
634
+ e[6] !== n ? (x = n || {}, e[6] = n, e[7] = x) : x = e[7];
635
+ const {
636
+ kind: u,
637
+ data: o
638
+ } = x;
639
+ if (u === "tool" && o) {
640
+ c = o.name;
641
+ break e;
642
+ } else if (u === "agent" && o) {
643
+ c = o.name;
644
+ break e;
645
+ } else if (u === "crewaitask" && o) {
646
+ c = o.name;
647
+ break e;
648
+ }
649
+ c = void 0;
650
+ }
651
+ const g = c;
652
+ let f;
653
+ e: {
654
+ let x;
655
+ e[8] !== n ? (x = n || {}, e[8] = n, e[9] = x) : x = e[9];
656
+ const {
657
+ kind: u,
658
+ data: o
659
+ } = x;
660
+ if (u === "crewaitask" && o) {
661
+ f = o.description;
662
+ break e;
663
+ }
664
+ f = void 0;
665
+ }
666
+ const w = f;
667
+ let C;
668
+ e: {
669
+ let x;
670
+ e[10] !== n ? (x = n || {}, e[10] = n, e[11] = x) : x = e[11];
671
+ const {
672
+ kind: u,
673
+ data: o
674
+ } = x;
675
+ if (u === "agent" && o) {
676
+ C = o.systemPrompt;
677
+ break e;
678
+ }
679
+ C = void 0;
680
+ }
681
+ const v = C, b = a.length > 0 || m.length > 0, A = Xt;
682
+ if (!b && !g) {
683
+ let x;
684
+ return e[12] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ t(pe, { message: "Failed to extract span details", iconElement: Nt, subtitle: "Try selecting a different span", disableBackground: !0 }), e[12] = x) : x = e[12], x;
685
+ }
686
+ let T;
687
+ e[13] !== g ? (T = g && /* @__PURE__ */ y(R, { children: [
688
+ /* @__PURE__ */ t(D, { variant: "h6", children: "Name" }),
689
+ /* @__PURE__ */ t(V, { variant: "outlined", children: /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(D, { variant: "body2", children: g }) }) })
690
+ ] }), e[13] = g, e[14] = T) : T = e[14];
691
+ let S;
692
+ e[15] !== w ? (S = w && /* @__PURE__ */ y(R, { children: [
693
+ /* @__PURE__ */ t(D, { variant: "h6", children: "Description" }),
694
+ /* @__PURE__ */ t(V, { variant: "outlined", children: /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(D, { variant: "body2", sx: {
695
+ whiteSpace: "pre-wrap",
696
+ wordBreak: "break-word"
697
+ }, children: w }) }) })
698
+ ] }), e[15] = w, e[16] = S) : S = e[16];
699
+ let N;
700
+ e[17] !== v ? (N = v && /* @__PURE__ */ y(R, { children: [
701
+ /* @__PURE__ */ t(D, { variant: "h6", children: "System Prompt" }),
702
+ /* @__PURE__ */ t(V, { variant: "outlined", children: /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(D, { variant: "body2", sx: {
703
+ whiteSpace: "pre-wrap",
704
+ wordBreak: "break-word"
705
+ }, children: ye(v) }) }) })
706
+ ] }), e[17] = v, e[18] = N) : N = e[18];
707
+ let O;
708
+ e[19] !== a ? (O = /* @__PURE__ */ t(Ie, { title: "Input Messages", messages: a, getRoleColor: A, "data-testid": "input-messages", showEmptyMessage: !1 }), e[19] = a, e[20] = O) : O = e[20];
709
+ let L;
710
+ e[21] !== m ? (L = /* @__PURE__ */ t(Ie, { title: "Output Messages", messages: m, getRoleColor: A, "data-testid": "output-messages", showEmptyMessage: !1 }), e[21] = m, e[22] = L) : L = e[22];
711
+ let E;
712
+ return e[23] !== N || e[24] !== O || e[25] !== L || e[26] !== T || e[27] !== S ? (E = /* @__PURE__ */ y(R, { spacing: 3, children: [
713
+ T,
714
+ S,
715
+ N,
716
+ O,
717
+ L
718
+ ] }), e[23] = N, e[24] = O, e[25] = L, e[26] = T, e[27] = S, e[28] = E) : E = e[28], E;
719
+ }
720
+ function Xt(i) {
721
+ switch (i) {
722
+ case "system":
723
+ return "default";
724
+ case "user":
725
+ return "primary";
726
+ case "assistant":
727
+ return "success";
728
+ case "tool":
729
+ return "info";
730
+ default:
731
+ return "default";
732
+ }
733
+ }
734
+ function Qt(i) {
735
+ return i ? typeof i == "string" ? [{
736
+ content: i
737
+ }] : Array.isArray(i) && i.length > 0 && typeof i[0] == "string" ? i.map(Zt) : i : [];
738
+ }
739
+ function Zt(i) {
740
+ return {
741
+ content: i
742
+ };
743
+ }
744
+ function en(i, e) {
745
+ const n = i.id ?? e;
746
+ return /* @__PURE__ */ t(V, { variant: "outlined", children: /* @__PURE__ */ y(Y, { sx: {
747
+ "&:last-child": {
748
+ pb: 1.5
749
+ }
750
+ }, children: [
751
+ /* @__PURE__ */ t(D, { variant: "caption", sx: {
752
+ fontWeight: "bold"
753
+ }, children: i.name }),
754
+ i.arguments && /* @__PURE__ */ t(D, { variant: "caption", sx: {
755
+ display: "block",
756
+ mt: 0.5,
757
+ fontFamily: "monospace",
758
+ whiteSpace: "pre-wrap",
759
+ wordBreak: "break-word"
760
+ }, children: ye(i.arguments) })
761
+ ] }) }, n);
762
+ }
763
+ function tn(i) {
764
+ const e = q(11), {
765
+ evaluatorScores: n
766
+ } = i;
767
+ let s;
768
+ if (e[0] !== n) {
769
+ s = /* @__PURE__ */ new Map();
770
+ for (const p of n)
771
+ s.set(p.evaluatorName, (s.get(p.evaluatorName) ?? 0) + 1);
772
+ e[0] = n, e[1] = s;
773
+ } else
774
+ s = e[1];
775
+ let r;
776
+ e[2] !== s ? (r = (p) => (s.get(p.evaluatorName) ?? 0) > 1 ? `${p.monitorName}/${p.evaluatorName}` : p.evaluatorName, e[2] = s, e[3] = r) : r = e[3];
777
+ const l = r;
778
+ let a;
779
+ if (e[4] !== n || e[5] !== l) {
780
+ let p;
781
+ e[7] !== l ? (p = (m, c) => {
782
+ const g = l(m), f = m.score == null, w = f ? void 0 : xe(m.score);
783
+ return /* @__PURE__ */ t(V, { variant: "outlined", children: /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ y(R, { spacing: 1.5, children: [
784
+ /* @__PURE__ */ y(R, { direction: "row", spacing: 1, alignItems: "center", children: [
785
+ /* @__PURE__ */ t(D, { variant: "subtitle2", children: g }),
786
+ f ? /* @__PURE__ */ t(W, { size: "small", variant: "outlined", label: "Skipped", sx: {
787
+ ml: "auto",
788
+ opacity: 0.6,
789
+ fontStyle: "italic"
790
+ } }) : /* @__PURE__ */ t(W, { size: "small", variant: "outlined", label: `${(m.score * 100).toFixed(1)}%`, sx: {
791
+ ml: "auto",
792
+ color: w,
793
+ borderColor: w
794
+ } })
795
+ ] }),
796
+ m.explanation && /* @__PURE__ */ t(ze, { content: m.explanation }),
797
+ f && m.skipReason && /* @__PURE__ */ t(D, { variant: "body2", color: "text.secondary", sx: {
798
+ fontStyle: "italic"
799
+ }, children: m.skipReason })
800
+ ] }) }) }, c);
801
+ }, e[7] = l, e[8] = p) : p = e[8], a = n.map(p), e[4] = n, e[5] = l, e[6] = a;
802
+ } else
803
+ a = e[6];
804
+ let h;
805
+ return e[9] !== a ? (h = /* @__PURE__ */ t(R, { spacing: 2, pt: 1, children: a }), e[9] = a, e[10] = h) : h = e[10], h;
806
+ }
807
+ function nn(i) {
808
+ const {
809
+ kind: e,
810
+ data: n
811
+ } = i.ampAttributes || {};
812
+ if (e === "llm" && n)
813
+ return n.tools;
814
+ if (e === "agent" && n)
815
+ return n.tools;
816
+ }
817
+ function rn(i) {
818
+ const {
819
+ kind: e,
820
+ data: n,
821
+ input: s,
822
+ output: r
823
+ } = i.ampAttributes || {};
824
+ if (s || r)
825
+ return !0;
826
+ if (e === "agent" && n) {
827
+ const l = n;
828
+ if (l.name || l.systemPrompt)
829
+ return !0;
830
+ }
831
+ if (e === "tool" && n && n.name)
832
+ return !0;
833
+ if (e === "crewaitask" && n) {
834
+ const l = n;
835
+ if (l.name || l.description)
836
+ return !0;
837
+ }
838
+ return !1;
839
+ }
840
+ function an(i) {
841
+ const e = q(73), {
842
+ span: n,
843
+ evaluatorScores: s
844
+ } = i, [r, l] = re("overview");
845
+ let a;
846
+ e[0] !== n ? (a = n ? rn(n) : !1, e[0] = n, e[1] = a) : a = e[1];
847
+ const h = a;
848
+ let p;
849
+ e[2] !== n ? (p = n ? nn(n) : void 0, e[2] = n, e[3] = p) : p = e[3];
850
+ const m = p, c = !!m, g = !!n?.attributes, f = !!(s && s.length > 0);
851
+ let w;
852
+ e[4] !== g || e[5] !== h || e[6] !== f || e[7] !== c || e[8] !== r || e[9] !== n ? (w = () => {
853
+ if (n && !(r === "overview" && h)) {
854
+ {
855
+ if (r === "tools" && c)
856
+ return;
857
+ if (r === "attributes" && g)
858
+ return;
859
+ if (r === "scores" && f)
860
+ return;
861
+ }
862
+ h ? l("overview") : c ? l("tools") : g ? l("attributes") : f && l("scores");
863
+ }
864
+ }, e[4] = g, e[5] = h, e[6] = f, e[7] = c, e[8] = r, e[9] = n, e[10] = w) : w = e[10];
865
+ const C = n?.spanId;
866
+ let v;
867
+ if (e[11] !== g || e[12] !== h || e[13] !== f || e[14] !== c || e[15] !== r || e[16] !== n || e[17] !== C ? (v = [n, C, h, c, g, f, r], e[11] = g, e[12] = h, e[13] = f, e[14] = c, e[15] = r, e[16] = n, e[17] = C, e[18] = v) : v = e[18], De(w, v), !n)
868
+ return null;
869
+ let b;
870
+ e[19] === Symbol.for("react.memo_cache_sentinel") ? (b = {
871
+ height: "100%"
872
+ }, e[19] = b) : b = e[19];
873
+ let A;
874
+ e[20] !== n.name ? (A = /* @__PURE__ */ t(D, { variant: "h4", noWrap: !0, textOverflow: "ellipsis", maxWidth: "70%", overflow: "hidden", children: n.name }), e[20] = n.name, e[21] = A) : A = e[21];
875
+ let T;
876
+ e[22] !== n.ampAttributes?.kind ? (T = n.ampAttributes?.kind && /* @__PURE__ */ t(W, { size: "small", variant: "outlined", label: n.ampAttributes?.kind.toUpperCase() }), e[22] = n.ampAttributes?.kind, e[23] = T) : T = e[23];
877
+ let S;
878
+ e[24] !== A || e[25] !== T ? (S = /* @__PURE__ */ y(R, { direction: "row", spacing: 1, children: [
879
+ A,
880
+ " ",
881
+ T
882
+ ] }), e[24] = A, e[25] = T, e[26] = S) : S = e[26];
883
+ let N;
884
+ e[27] !== s || e[28] !== n ? (N = /* @__PURE__ */ t(Wt, { span: n, evaluatorScores: s }), e[27] = s, e[28] = n, e[29] = N) : N = e[29];
885
+ let O;
886
+ e[30] !== N || e[31] !== S ? (O = /* @__PURE__ */ y(R, { spacing: 2, px: 1, children: [
887
+ S,
888
+ N
889
+ ] }), e[30] = N, e[31] = S, e[32] = O) : O = e[32];
890
+ let L;
891
+ e[33] === Symbol.for("react.memo_cache_sentinel") ? (L = (j, X) => l(X), e[33] = L) : L = e[33];
892
+ const E = !h;
893
+ let x;
894
+ e[34] !== E ? (x = /* @__PURE__ */ t(ce, { label: "Overview", value: "overview", disabled: E }), e[34] = E, e[35] = x) : x = e[35];
895
+ let u;
896
+ e[36] !== c ? (u = c && /* @__PURE__ */ t(ce, { label: "Tools", value: "tools" }), e[36] = c, e[37] = u) : u = e[37];
897
+ let o;
898
+ e[38] !== n.attributes ? (o = n?.attributes && /* @__PURE__ */ t(ce, { label: "Attributes", value: "attributes" }), e[38] = n.attributes, e[39] = o) : o = e[39];
899
+ let k;
900
+ e[40] !== f ? (k = f && /* @__PURE__ */ t(ce, { label: "Scores", value: "scores" }), e[40] = f, e[41] = k) : k = e[41];
901
+ let I;
902
+ e[42] !== r || e[43] !== x || e[44] !== u || e[45] !== o || e[46] !== k ? (I = /* @__PURE__ */ y(Rt, { variant: "fullWidth", value: r, onChange: L, children: [
903
+ x,
904
+ u,
905
+ o,
906
+ k
907
+ ] }), e[42] = r, e[43] = x, e[44] = u, e[45] = o, e[46] = k, e[47] = I) : I = e[47];
908
+ let d;
909
+ e[48] !== O || e[49] !== I ? (d = /* @__PURE__ */ y(R, { spacing: 2, children: [
910
+ O,
911
+ I
912
+ ] }), e[48] = O, e[49] = I, e[50] = d) : d = e[50];
913
+ let B;
914
+ e[51] === Symbol.for("react.memo_cache_sentinel") ? (B = {
915
+ overflowY: "auto",
916
+ flexGrow: 1,
917
+ boxShadow: "inset 0 4px 8px -4px rgba(0, 0, 0, 0.1)"
918
+ }, e[51] = B) : B = e[51];
919
+ let F;
920
+ e[52] !== r || e[53] !== n.attributes ? (F = r === "attributes" && /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ t(Gt, { attributes: n?.attributes }) }), e[52] = r, e[53] = n.attributes, e[54] = F) : F = e[54];
921
+ let P;
922
+ e[55] !== r || e[56] !== m ? (P = r === "tools" && /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ t(Yt, { tools: m || [] }) }), e[55] = r, e[56] = m, e[57] = P) : P = e[57];
923
+ let H;
924
+ e[58] !== r || e[59] !== n.ampAttributes ? (H = r === "overview" && /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ t(qt, { ampAttributes: n.ampAttributes }) }), e[58] = r, e[59] = n.ampAttributes, e[60] = H) : H = e[60];
925
+ let $;
926
+ e[61] !== s || e[62] !== f || e[63] !== r ? ($ = r === "scores" && f && /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ t(tn, { evaluatorScores: s }) }), e[61] = s, e[62] = f, e[63] = r, e[64] = $) : $ = e[64];
927
+ let U;
928
+ e[65] !== F || e[66] !== P || e[67] !== H || e[68] !== $ ? (U = /* @__PURE__ */ y(R, { spacing: 2, px: 1, sx: B, children: [
929
+ F,
930
+ P,
931
+ H,
932
+ $
933
+ ] }), e[65] = F, e[66] = P, e[67] = H, e[68] = $, e[69] = U) : U = e[69];
934
+ let M;
935
+ return e[70] !== d || e[71] !== U ? (M = /* @__PURE__ */ y(R, { sx: b, children: [
936
+ d,
937
+ U
938
+ ] }), e[70] = d, e[71] = U, e[72] = M) : M = e[72], M;
939
+ }
940
+ function on() {
941
+ const i = q(1);
942
+ let e;
943
+ return i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ y(R, { spacing: 2, px: 1, sx: {
944
+ overflowY: "auto",
945
+ flexGrow: 1
946
+ }, children: [
947
+ /* @__PURE__ */ t(he, { variant: "text", width: "100%", height: 40 }),
948
+ /* @__PURE__ */ t(he, { variant: "text", width: "100%", height: 40 })
949
+ ] }), i[0] = e) : e = i[0], e;
950
+ }
951
+ function sn() {
952
+ const i = q(1);
953
+ let e;
954
+ return i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ y(R, { direction: "row", height: "calc(100vh - 64px)", gap: 1, children: [
955
+ /* @__PURE__ */ t(he, { variant: "rounded", width: "55%", height: "100%" }),
956
+ /* @__PURE__ */ t(we, { orientation: "vertical", flexItem: !0 }),
957
+ /* @__PURE__ */ t(he, { variant: "rounded", width: "45%", height: "100%" })
958
+ ] }), i[0] = e) : e = i[0], e;
959
+ }
960
+ function ln(i) {
961
+ return {
962
+ spanId: i.spanId,
963
+ parentSpanId: i.parentSpanId?.trim() || void 0,
964
+ name: i.spanName,
965
+ startTime: i.startTime,
966
+ endTime: i.endTime,
967
+ durationInNanos: i.durationNs,
968
+ ampAttributes: i.spanKind ? {
969
+ kind: i.spanKind
970
+ } : void 0
971
+ };
972
+ }
973
+ function cn({
974
+ traceId: i,
975
+ organization: e,
976
+ project: n,
977
+ component: s,
978
+ environment: r,
979
+ startTime: l,
980
+ endTime: a
981
+ }) {
982
+ const {
983
+ orgId: h = "default",
984
+ projectId: p = "default",
985
+ agentId: m = "default"
986
+ } = Ee(), {
987
+ data: c,
988
+ isPending: g,
989
+ isError: f
990
+ } = Ve(e, n, s, r, i, l, a), [w, C] = re(null), v = ee(() => c?.spans?.map((o) => o.spanId).join(",") ?? "", [c?.spans]);
991
+ De(() => {
992
+ const o = c?.spans;
993
+ if (!o?.length) {
994
+ C(null);
995
+ return;
996
+ }
997
+ C((k) => k && o.some((d) => d.spanId === k) ? k : (o.find((d) => !d.parentSpanId?.trim()) ?? o[0])?.spanId ?? null);
998
+ }, [i, v]);
999
+ const {
1000
+ data: b,
1001
+ isPending: A,
1002
+ isError: T
1003
+ } = Ye(i, w, !!c?.spans?.length && !!w), S = b && b.spanId === w ? b : null, N = ee(() => c?.spans?.length ? c.spans.map((o) => {
1004
+ const k = S?.spanId === o.spanId ? S : ln(o);
1005
+ return o.spanKind ? {
1006
+ ...k,
1007
+ ampAttributes: {
1008
+ ...k.ampAttributes,
1009
+ kind: o.spanKind
1010
+ }
1011
+ } : k;
1012
+ }) : [], [c?.spans, S]), O = ee(() => w ? N.find((o) => o.spanId === w) ?? null : null, [N, w]), L = !!w && !T && (A || b?.spanId !== w), {
1013
+ data: E
1014
+ } = qe({
1015
+ orgName: h,
1016
+ projName: p,
1017
+ agentName: m,
1018
+ traceId: i
1019
+ }), {
1020
+ traceEvalScores: x,
1021
+ spanScoresMap: u
1022
+ } = ee(() => {
1023
+ const o = [], k = /* @__PURE__ */ new Map();
1024
+ for (const I of E?.monitors ?? []) {
1025
+ for (const d of I.evaluators)
1026
+ o.push({
1027
+ ...d,
1028
+ monitorName: I.monitorName
1029
+ });
1030
+ for (const d of I.spans) {
1031
+ const B = k.get(d.spanId) ?? [];
1032
+ for (const F of d.evaluators)
1033
+ B.push({
1034
+ ...F,
1035
+ monitorName: I.monitorName
1036
+ });
1037
+ k.set(d.spanId, B);
1038
+ }
1039
+ }
1040
+ return {
1041
+ traceEvalScores: o,
1042
+ spanScoresMap: k
1043
+ };
1044
+ }, [E]);
1045
+ return g ? /* @__PURE__ */ t(sn, {}) : f ? /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ t(G, { sx: {
1046
+ p: 2
1047
+ }, children: /* @__PURE__ */ t(D, { color: "error", children: "Failed to load trace details. Try again later." }) }) }) : c?.spans?.length == 0 ? /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ t(pe, { message: "No spans found", iconElement: fe, disableBackground: !0, subtitle: "Try changing the time range" }) }) : /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ y(R, { direction: "row", height: "calc(100vh - 72px)", children: [
1048
+ /* @__PURE__ */ t(G, { sx: {
1049
+ width: "45%"
1050
+ }, pr: 1, overflow: "auto", children: i && /* @__PURE__ */ t(Xe, { onOpenAttributesClick: (o) => C(o.spanId), selectedSpan: O, spans: N }) }),
1051
+ /* @__PURE__ */ t(we, { orientation: "vertical", flexItem: !0 }),
1052
+ /* @__PURE__ */ t(G, { sx: {
1053
+ width: "55%"
1054
+ }, children: L ? /* @__PURE__ */ t(on, {}) : T ? /* @__PURE__ */ t(G, { sx: {
1055
+ p: 2
1056
+ }, children: /* @__PURE__ */ t(D, { color: "error", children: "Failed to load span details. Try again later." }) }) : /* @__PURE__ */ t(an, { span: S, evaluatorScores: S ? S.parentSpanId ? u.get(S.spanId) : [...x, ...u.get(S.spanId) ?? []] : void 0 }) })
1057
+ ] }) });
1058
+ }
1059
+ const dn = (i) => {
1060
+ const e = q(10), {
1061
+ traces: n,
1062
+ isLoading: s,
1063
+ sortOrder: r,
1064
+ selectedTrace: l,
1065
+ isLoadingOlder: a,
1066
+ isLoadingNewer: h,
1067
+ onTraceSelect: p,
1068
+ onLoadOlder: m,
1069
+ onLoadNewer: c
1070
+ } = i, g = s === void 0 ? !1 : s, f = r === void 0 ? "desc" : r, w = a === void 0 ? !1 : a, C = h === void 0 ? !1 : h;
1071
+ let v;
1072
+ return e[0] !== g || e[1] !== C || e[2] !== w || e[3] !== c || e[4] !== m || e[5] !== p || e[6] !== l || e[7] !== f || e[8] !== n ? (v = /* @__PURE__ */ t(Ht, { isLoading: g, sortOrder: f, traces: n, onTraceSelect: p, selectedTrace: l, isLoadingOlder: w, isLoadingNewer: C, onLoadOlder: m, onLoadNewer: c }), e[0] = g, e[1] = C, e[2] = w, e[3] = c, e[4] = m, e[5] = p, e[6] = l, e[7] = f, e[8] = n, e[9] = v) : v = e[9], v;
1073
+ }, un = [{
1074
+ value: Q.TEN_MINUTES,
1075
+ label: "10 Minutes"
1076
+ }, {
1077
+ value: Q.THIRTY_MINUTES,
1078
+ label: "30 Minutes"
1079
+ }, {
1080
+ value: Q.ONE_HOUR,
1081
+ label: "1 Hour"
1082
+ }, {
1083
+ value: Q.SIX_HOURS,
1084
+ label: "6 Hours"
1085
+ }, {
1086
+ value: Q.TWELVE_HOURS,
1087
+ label: "12 Hours"
1088
+ }, {
1089
+ value: Q.ONE_DAY,
1090
+ label: "1 Day"
1091
+ }, {
1092
+ value: Q.SEVEN_DAYS,
1093
+ label: "7 Days"
1094
+ }], Ae = () => {
1095
+ const {
1096
+ agentId: i,
1097
+ orgId: e,
1098
+ projectId: n,
1099
+ envId: s
1100
+ } = Ee(), [r, l] = We(), {
1101
+ mutateAsync: a,
1102
+ isPending: h
1103
+ } = Qe(), {
1104
+ data: p,
1105
+ isPending: m,
1106
+ isSuccess: c
1107
+ } = Ze({
1108
+ orgName: e ?? ""
1109
+ }), g = p?.namespace, {
1110
+ data: f,
1111
+ isPending: w,
1112
+ isSuccess: C
1113
+ } = et({
1114
+ orgName: e ?? "",
1115
+ projName: n ?? "",
1116
+ agentName: i ?? ""
1117
+ }), {
1118
+ data: v,
1119
+ isPending: b,
1120
+ isSuccess: A
1121
+ } = tt({
1122
+ orgName: e ?? ""
1123
+ }), S = v?.find((z) => z.name === s)?.name, N = m || w || b, O = c && !g, L = C && !f?.uuid, E = A && v !== void 0 && !S, [x, u] = re(null), [o, k] = re(!1), {
1124
+ customStartTime: I,
1125
+ customEndTime: d,
1126
+ hasCustomRange: B,
1127
+ handleCustomRangeApply: F
1128
+ } = nt(r, l), P = ee(() => B ? void 0 : Object.values(Q).includes(r.get("timeRange") ?? "") ? r.get("timeRange") : Q.ONE_HOUR, [r, B]), H = ee(() => {
1129
+ const z = parseInt(r.get("limit") || "10", 10);
1130
+ return Number.isFinite(z) && z > 0 ? z : 10;
1131
+ }, [r]), $ = ee(() => {
1132
+ const z = r.get("sortOrder");
1133
+ return z === "asc" || z === "desc" ? z : "desc";
1134
+ }, [r]), {
1135
+ data: U,
1136
+ isLoading: M,
1137
+ refetch: j,
1138
+ isRefetching: X,
1139
+ loadOlder: ae,
1140
+ loadNewer: me,
1141
+ isLoadingOlder: ge,
1142
+ isLoadingNewer: be
1143
+ } = rt(g, n, i, S, P, H, $, I, d), te = ee(() => {
1144
+ const z = U?.fetchedRange;
1145
+ return z || (B ? {
1146
+ startTime: I,
1147
+ endTime: d
1148
+ } : P ? Ne(P) : void 0);
1149
+ }, [U, B, I, d, P]), ie = ee(() => r.get("selectedTrace"), [r]), le = Z((z) => {
1150
+ const K = new URLSearchParams(r);
1151
+ K.set("selectedTrace", z), l(K);
1152
+ }, [r, l]), Te = Z(() => {
1153
+ const z = new URLSearchParams(r);
1154
+ z.delete("selectedTrace"), l(z), k(!1);
1155
+ }, [r, l]), Re = Z(async () => {
1156
+ if (!g || !n || !i || !S) {
1157
+ u("Missing required parameters for export");
1158
+ return;
1159
+ }
1160
+ try {
1161
+ u(null);
1162
+ const z = B ? {
1163
+ startTime: I,
1164
+ endTime: d
1165
+ } : P ? Ne(P) : null;
1166
+ if (!z) {
1167
+ u("Invalid time range");
1168
+ return;
1169
+ }
1170
+ const {
1171
+ startTime: K,
1172
+ endTime: Fe
1173
+ } = z, Ue = await a({
1174
+ organization: g,
1175
+ project: n,
1176
+ component: i,
1177
+ environment: S,
1178
+ startTime: K,
1179
+ endTime: Fe,
1180
+ sortOrder: $,
1181
+ limit: H
1182
+ }), He = new Blob([JSON.stringify(Ue, null, 2)], {
1183
+ type: "application/json"
1184
+ }), ke = window.URL.createObjectURL(He), oe = document.createElement("a");
1185
+ oe.href = ke, oe.download = `traces-export-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.json`, document.body.appendChild(oe), oe.click(), document.body.removeChild(oe), window.URL.revokeObjectURL(ke);
1186
+ } catch (z) {
1187
+ console.error("Export failed:", z), u(z instanceof Error ? z.message : "Failed to export traces");
1188
+ }
1189
+ }, [g, n, i, S, P, $, H, a, B, I, d]), Pe = Z((z) => {
1190
+ const K = new URLSearchParams(r);
1191
+ K.set("timeRange", z), K.delete("startTime"), K.delete("endTime"), l(K);
1192
+ }, [r, l]), Be = Z((z) => {
1193
+ const K = new URLSearchParams(r);
1194
+ K.set("sortOrder", z), l(K);
1195
+ }, [r, l]), $e = Z(() => {
1196
+ j();
1197
+ }, [j]);
1198
+ return !Oe.obsApiBaseUrl?.trim() || Oe.obsApiBaseUrl.trim() === "$OBS_API_BASE_URL" ? /* @__PURE__ */ t(ve, { title: "Traces", disableIcon: !0, children: /* @__PURE__ */ y(se, { severity: "error", sx: {
1199
+ mt: 2
1200
+ }, children: [
1201
+ /* @__PURE__ */ t("strong", { children: "Traces service not configured." }),
1202
+ " Set",
1203
+ " ",
1204
+ /* @__PURE__ */ t("code", { children: "OBS_API_BASE_URL" }),
1205
+ " to the traces-observer-service URL. The agent-manager no longer serves trace routes."
1206
+ ] }) }) : O || L || E ? /* @__PURE__ */ y(ve, { title: "Traces", disableIcon: !0, children: [
1207
+ O && /* @__PURE__ */ y(se, { severity: "error", sx: {
1208
+ mt: 2
1209
+ }, children: [
1210
+ /* @__PURE__ */ t("strong", { children: "Organization not found." }),
1211
+ " No organization named",
1212
+ " ",
1213
+ /* @__PURE__ */ t("code", { children: e }),
1214
+ " exists, or it has no organization identifier."
1215
+ ] }),
1216
+ L && /* @__PURE__ */ y(se, { severity: "error", sx: {
1217
+ mt: 2
1218
+ }, children: [
1219
+ /* @__PURE__ */ t("strong", { children: "Agent not found." }),
1220
+ " No agent named",
1221
+ " ",
1222
+ /* @__PURE__ */ t("code", { children: i }),
1223
+ " exists in this project."
1224
+ ] }),
1225
+ E && /* @__PURE__ */ y(se, { severity: "error", sx: {
1226
+ mt: 2
1227
+ }, children: [
1228
+ /* @__PURE__ */ t("strong", { children: "Environment not found." }),
1229
+ " ",
1230
+ /* @__PURE__ */ t("code", { children: s }),
1231
+ " does not match any environment in this organisation. Check the URL or verify the environment name."
1232
+ ] })
1233
+ ] }) : /* @__PURE__ */ y(Le, { children: [
1234
+ /* @__PURE__ */ y(ve, { title: "Traces", disableIcon: !0, actions: /* @__PURE__ */ y(R, { direction: "row", spacing: 2, alignItems: "center", flexWrap: "wrap", children: [
1235
+ /* @__PURE__ */ t($t, {}),
1236
+ /* @__PURE__ */ t(st, { preset: P, customStart: I, customEnd: d, options: un, onPresetChange: Pe, onCustomRangeApply: F }),
1237
+ /* @__PURE__ */ t(ue, { size: "small", onClick: () => Be($ === "desc" ? "asc" : "desc"), "aria-label": $ === "desc" ? "Sort ascending" : "Sort descending", children: $ === "desc" ? /* @__PURE__ */ t(Ot, { size: 16 }) : /* @__PURE__ */ t(It, { size: 16 }) }),
1238
+ /* @__PURE__ */ t(ue, { size: "small", disabled: X, onClick: $e, "aria-label": "Refresh", children: X ? /* @__PURE__ */ t(de, { size: 16 }) : /* @__PURE__ */ t(At, { size: 16 }) }),
1239
+ /* @__PURE__ */ t(Se, { size: "small", variant: "outlined", startIcon: h ? /* @__PURE__ */ t(de, { size: 16 }) : /* @__PURE__ */ t(Lt, { size: 16 }), onClick: Re, disabled: h || N || M || (U?.traces ?? []).length === 0, children: "Export" })
1240
+ ] }), children: [
1241
+ /* @__PURE__ */ t(dn, { traces: U?.traces ?? [], isLoading: N || M, selectedTrace: ie, sortOrder: $, isLoadingOlder: ge, isLoadingNewer: be, onTraceSelect: le, onLoadOlder: ae, onLoadNewer: me }),
1242
+ /* @__PURE__ */ y(it, { open: !!ie, disableScroll: !0, onClose: Te, minWidth: "80vw", fullscreen: o, children: [
1243
+ /* @__PURE__ */ t(at, { title: "Trace Details", icon: /* @__PURE__ */ t(fe, { size: 24 }), onClose: Te, isFullscreen: o, onToggleFullscreen: () => k((z) => !z) }),
1244
+ /* @__PURE__ */ t(ot, { children: ie && te && g && n && i && S ? /* @__PURE__ */ t(cn, { traceId: ie, organization: g, project: n, component: i, environment: S, startTime: te.startTime, endTime: te.endTime }) : null })
1245
+ ] })
1246
+ ] }),
1247
+ /* @__PURE__ */ t(Pt, { open: !!x, autoHideDuration: 6e3, onClose: () => u(null), anchorOrigin: {
1248
+ vertical: "bottom",
1249
+ horizontal: "center"
1250
+ }, children: /* @__PURE__ */ t(se, { onClose: () => u(null), severity: "error", children: x }) })
1251
+ ] });
1252
+ }, Tn = {
1253
+ title: "Traces",
1254
+ description: "A page component for Traces",
1255
+ icon: fe,
1256
+ path: "/traces",
1257
+ component: Ae,
1258
+ levels: {
1259
+ component: Ae
1260
+ }
1261
+ };
1262
+ export {
1263
+ Ae as TracesComponent,
1264
+ Tn as metaData
1265
+ };