@motiadev/plugin-observability 0.8.2-beta.140-428722 → 0.8.3-beta.141-694167
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.
- package/dist/index.cjs +74 -4
- package/dist/index.js +1139 -359
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useStreamItem as
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
5
|
-
import { create as ye } from "zustand";
|
|
6
|
-
import { formatDistanceToNow as Se } from "date-fns";
|
|
7
|
-
var w = { exports: {} }, g = {};
|
|
1
|
+
import C, { forwardRef as de, createElement as X, useState as G, useEffect as ue, memo as D, useMemo as J } from "react";
|
|
2
|
+
import { useStreamItem as Se, useStreamGroup as me } from "@motiadev/stream-client-react";
|
|
3
|
+
import { cn as U, LevelDot as Pe, Sidebar as Re, Badge as fe, Button as q, Input as Ce } from "@motiadev/ui";
|
|
4
|
+
var A = { exports: {} }, E = {};
|
|
8
5
|
/**
|
|
9
6
|
* @license React
|
|
10
7
|
* react-jsx-runtime.production.js
|
|
@@ -14,29 +11,29 @@ var w = { exports: {} }, g = {};
|
|
|
14
11
|
* This source code is licensed under the MIT license found in the
|
|
15
12
|
* LICENSE file in the root directory of this source tree.
|
|
16
13
|
*/
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
var
|
|
22
|
-
function
|
|
23
|
-
var
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
for (var
|
|
27
|
-
|
|
28
|
-
} else
|
|
29
|
-
return o =
|
|
30
|
-
$$typeof:
|
|
14
|
+
var re;
|
|
15
|
+
function De() {
|
|
16
|
+
if (re) return E;
|
|
17
|
+
re = 1;
|
|
18
|
+
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
19
|
+
function r(a, o, c) {
|
|
20
|
+
var l = null;
|
|
21
|
+
if (c !== void 0 && (l = "" + c), o.key !== void 0 && (l = "" + o.key), "key" in o) {
|
|
22
|
+
c = {};
|
|
23
|
+
for (var i in o)
|
|
24
|
+
i !== "key" && (c[i] = o[i]);
|
|
25
|
+
} else c = o;
|
|
26
|
+
return o = c.ref, {
|
|
27
|
+
$$typeof: e,
|
|
31
28
|
type: a,
|
|
32
|
-
key:
|
|
29
|
+
key: l,
|
|
33
30
|
ref: o !== void 0 ? o : null,
|
|
34
|
-
props:
|
|
31
|
+
props: c
|
|
35
32
|
};
|
|
36
33
|
}
|
|
37
|
-
return
|
|
34
|
+
return E.Fragment = t, E.jsx = r, E.jsxs = r, E;
|
|
38
35
|
}
|
|
39
|
-
var
|
|
36
|
+
var S = {};
|
|
40
37
|
/**
|
|
41
38
|
* @license React
|
|
42
39
|
* react-jsx-runtime.development.js
|
|
@@ -46,477 +43,1260 @@ var T = {};
|
|
|
46
43
|
* This source code is licensed under the MIT license found in the
|
|
47
44
|
* LICENSE file in the root directory of this source tree.
|
|
48
45
|
*/
|
|
49
|
-
var
|
|
46
|
+
var ae;
|
|
50
47
|
function Ae() {
|
|
51
|
-
return
|
|
52
|
-
function
|
|
53
|
-
if (
|
|
54
|
-
if (typeof
|
|
55
|
-
return
|
|
56
|
-
if (typeof
|
|
57
|
-
switch (
|
|
58
|
-
case
|
|
48
|
+
return ae || (ae = 1, process.env.NODE_ENV !== "production" && function() {
|
|
49
|
+
function e(s) {
|
|
50
|
+
if (s == null) return null;
|
|
51
|
+
if (typeof s == "function")
|
|
52
|
+
return s.$$typeof === Me ? null : s.displayName || s.name || null;
|
|
53
|
+
if (typeof s == "string") return s;
|
|
54
|
+
switch (s) {
|
|
55
|
+
case M:
|
|
59
56
|
return "Fragment";
|
|
60
|
-
case
|
|
57
|
+
case ge:
|
|
61
58
|
return "Profiler";
|
|
62
|
-
case
|
|
59
|
+
case be:
|
|
63
60
|
return "StrictMode";
|
|
64
|
-
case
|
|
61
|
+
case we:
|
|
65
62
|
return "Suspense";
|
|
66
|
-
case
|
|
63
|
+
case Ne:
|
|
67
64
|
return "SuspenseList";
|
|
68
|
-
case
|
|
65
|
+
case ke:
|
|
69
66
|
return "Activity";
|
|
70
67
|
}
|
|
71
|
-
if (typeof
|
|
72
|
-
switch (typeof
|
|
68
|
+
if (typeof s == "object")
|
|
69
|
+
switch (typeof s.tag == "number" && console.error(
|
|
73
70
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
74
|
-
),
|
|
75
|
-
case
|
|
71
|
+
), s.$$typeof) {
|
|
72
|
+
case j:
|
|
76
73
|
return "Portal";
|
|
77
|
-
case
|
|
78
|
-
return (
|
|
79
|
-
case
|
|
80
|
-
return (
|
|
81
|
-
case
|
|
82
|
-
var
|
|
83
|
-
return
|
|
84
|
-
case
|
|
85
|
-
return
|
|
86
|
-
case
|
|
87
|
-
|
|
74
|
+
case ye:
|
|
75
|
+
return (s.displayName || "Context") + ".Provider";
|
|
76
|
+
case ve:
|
|
77
|
+
return (s._context.displayName || "Context") + ".Consumer";
|
|
78
|
+
case je:
|
|
79
|
+
var d = s.render;
|
|
80
|
+
return s = s.displayName, s || (s = d.displayName || d.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
81
|
+
case Te:
|
|
82
|
+
return d = s.displayName || null, d !== null ? d : e(s.type) || "Memo";
|
|
83
|
+
case H:
|
|
84
|
+
d = s._payload, s = s._init;
|
|
88
85
|
try {
|
|
89
|
-
return
|
|
86
|
+
return e(s(d));
|
|
90
87
|
} catch {
|
|
91
88
|
}
|
|
92
89
|
}
|
|
93
90
|
return null;
|
|
94
91
|
}
|
|
95
|
-
function s
|
|
96
|
-
return "" +
|
|
92
|
+
function t(s) {
|
|
93
|
+
return "" + s;
|
|
97
94
|
}
|
|
98
|
-
function
|
|
95
|
+
function r(s) {
|
|
99
96
|
try {
|
|
100
|
-
s
|
|
101
|
-
var
|
|
97
|
+
t(s);
|
|
98
|
+
var d = !1;
|
|
102
99
|
} catch {
|
|
103
|
-
|
|
100
|
+
d = !0;
|
|
104
101
|
}
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
var
|
|
108
|
-
return
|
|
109
|
-
|
|
102
|
+
if (d) {
|
|
103
|
+
d = console;
|
|
104
|
+
var f = d.error, b = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
105
|
+
return f.call(
|
|
106
|
+
d,
|
|
110
107
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
111
|
-
|
|
112
|
-
), s
|
|
108
|
+
b
|
|
109
|
+
), t(s);
|
|
113
110
|
}
|
|
114
111
|
}
|
|
115
|
-
function a(
|
|
116
|
-
if (
|
|
117
|
-
if (typeof
|
|
112
|
+
function a(s) {
|
|
113
|
+
if (s === M) return "<>";
|
|
114
|
+
if (typeof s == "object" && s !== null && s.$$typeof === H)
|
|
118
115
|
return "<...>";
|
|
119
116
|
try {
|
|
120
|
-
var
|
|
121
|
-
return
|
|
117
|
+
var d = e(s);
|
|
118
|
+
return d ? "<" + d + ">" : "<...>";
|
|
122
119
|
} catch {
|
|
123
120
|
return "<...>";
|
|
124
121
|
}
|
|
125
122
|
}
|
|
126
123
|
function o() {
|
|
127
|
-
var
|
|
128
|
-
return
|
|
124
|
+
var s = W.A;
|
|
125
|
+
return s === null ? null : s.getOwner();
|
|
129
126
|
}
|
|
130
|
-
function
|
|
127
|
+
function c() {
|
|
131
128
|
return Error("react-stack-top-frame");
|
|
132
129
|
}
|
|
133
|
-
function
|
|
134
|
-
if (
|
|
135
|
-
var
|
|
136
|
-
if (
|
|
130
|
+
function l(s) {
|
|
131
|
+
if (Q.call(s, "key")) {
|
|
132
|
+
var d = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
133
|
+
if (d && d.isReactWarning) return !1;
|
|
137
134
|
}
|
|
138
|
-
return
|
|
135
|
+
return s.key !== void 0;
|
|
139
136
|
}
|
|
140
|
-
function
|
|
141
|
-
function
|
|
142
|
-
|
|
137
|
+
function i(s, d) {
|
|
138
|
+
function f() {
|
|
139
|
+
Z || (Z = !0, console.error(
|
|
143
140
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
144
|
-
|
|
141
|
+
d
|
|
145
142
|
));
|
|
146
143
|
}
|
|
147
|
-
|
|
148
|
-
get:
|
|
144
|
+
f.isReactWarning = !0, Object.defineProperty(s, "key", {
|
|
145
|
+
get: f,
|
|
149
146
|
configurable: !0
|
|
150
147
|
});
|
|
151
148
|
}
|
|
152
|
-
function
|
|
153
|
-
var
|
|
154
|
-
return
|
|
149
|
+
function u() {
|
|
150
|
+
var s = e(this.type);
|
|
151
|
+
return K[s] || (K[s] = !0, console.error(
|
|
155
152
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
156
|
-
)),
|
|
153
|
+
)), s = this.props.ref, s !== void 0 ? s : null;
|
|
157
154
|
}
|
|
158
|
-
function
|
|
159
|
-
return
|
|
160
|
-
$$typeof:
|
|
161
|
-
type:
|
|
162
|
-
key:
|
|
163
|
-
props:
|
|
164
|
-
_owner:
|
|
165
|
-
}, (
|
|
155
|
+
function m(s, d, f, b, T, w, L, Y) {
|
|
156
|
+
return f = w.ref, s = {
|
|
157
|
+
$$typeof: y,
|
|
158
|
+
type: s,
|
|
159
|
+
key: d,
|
|
160
|
+
props: w,
|
|
161
|
+
_owner: T
|
|
162
|
+
}, (f !== void 0 ? f : null) !== null ? Object.defineProperty(s, "ref", {
|
|
166
163
|
enumerable: !1,
|
|
167
|
-
get:
|
|
168
|
-
}) : Object.defineProperty(
|
|
164
|
+
get: u
|
|
165
|
+
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
169
166
|
configurable: !1,
|
|
170
167
|
enumerable: !1,
|
|
171
168
|
writable: !0,
|
|
172
169
|
value: 0
|
|
173
|
-
}), Object.defineProperty(
|
|
170
|
+
}), Object.defineProperty(s, "_debugInfo", {
|
|
174
171
|
configurable: !1,
|
|
175
172
|
enumerable: !1,
|
|
176
173
|
writable: !0,
|
|
177
174
|
value: null
|
|
178
|
-
}), Object.defineProperty(
|
|
175
|
+
}), Object.defineProperty(s, "_debugStack", {
|
|
179
176
|
configurable: !1,
|
|
180
177
|
enumerable: !1,
|
|
181
178
|
writable: !0,
|
|
182
|
-
value:
|
|
183
|
-
}), Object.defineProperty(
|
|
179
|
+
value: L
|
|
180
|
+
}), Object.defineProperty(s, "_debugTask", {
|
|
184
181
|
configurable: !1,
|
|
185
182
|
enumerable: !1,
|
|
186
183
|
writable: !0,
|
|
187
|
-
value:
|
|
188
|
-
}), Object.freeze && (Object.freeze(
|
|
184
|
+
value: Y
|
|
185
|
+
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
189
186
|
}
|
|
190
|
-
function
|
|
191
|
-
var
|
|
192
|
-
if (
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
for (
|
|
196
|
-
|
|
197
|
-
Object.freeze && Object.freeze(
|
|
187
|
+
function x(s, d, f, b, T, w, L, Y) {
|
|
188
|
+
var g = d.children;
|
|
189
|
+
if (g !== void 0)
|
|
190
|
+
if (b)
|
|
191
|
+
if (_e(g)) {
|
|
192
|
+
for (b = 0; b < g.length; b++)
|
|
193
|
+
v(g[b]);
|
|
194
|
+
Object.freeze && Object.freeze(g);
|
|
198
195
|
} else
|
|
199
196
|
console.error(
|
|
200
197
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
201
198
|
);
|
|
202
|
-
else
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
var
|
|
206
|
-
return
|
|
199
|
+
else v(g);
|
|
200
|
+
if (Q.call(d, "key")) {
|
|
201
|
+
g = e(s);
|
|
202
|
+
var _ = Object.keys(d).filter(function(Ee) {
|
|
203
|
+
return Ee !== "key";
|
|
207
204
|
});
|
|
208
|
-
|
|
205
|
+
b = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", ne[g + b] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
206
|
`A props object containing a "key" prop is being spread into JSX:
|
|
210
207
|
let props = %s;
|
|
211
208
|
<%s {...props} />
|
|
212
209
|
React keys must be passed directly to JSX without using spread:
|
|
213
210
|
let props = %s;
|
|
214
211
|
<%s key={someKey} {...props} />`,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
),
|
|
212
|
+
b,
|
|
213
|
+
g,
|
|
214
|
+
_,
|
|
215
|
+
g
|
|
216
|
+
), ne[g + b] = !0);
|
|
220
217
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
for (var
|
|
224
|
-
|
|
225
|
-
} else
|
|
226
|
-
return
|
|
227
|
-
c,
|
|
228
|
-
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
229
|
-
), k(
|
|
230
|
-
t,
|
|
218
|
+
if (g = null, f !== void 0 && (r(f), g = "" + f), l(d) && (r(d.key), g = "" + d.key), "key" in d) {
|
|
219
|
+
f = {};
|
|
220
|
+
for (var V in d)
|
|
221
|
+
V !== "key" && (f[V] = d[V]);
|
|
222
|
+
} else f = d;
|
|
223
|
+
return g && i(
|
|
231
224
|
f,
|
|
232
|
-
|
|
233
|
-
|
|
225
|
+
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
226
|
+
), m(
|
|
227
|
+
s,
|
|
228
|
+
g,
|
|
229
|
+
w,
|
|
230
|
+
T,
|
|
234
231
|
o(),
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
232
|
+
f,
|
|
233
|
+
L,
|
|
234
|
+
Y
|
|
238
235
|
);
|
|
239
236
|
}
|
|
240
|
-
function
|
|
241
|
-
typeof
|
|
237
|
+
function v(s) {
|
|
238
|
+
typeof s == "object" && s !== null && s.$$typeof === y && s._store && (s._store.validated = 1);
|
|
242
239
|
}
|
|
243
|
-
var
|
|
240
|
+
var h = C, y = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), M = Symbol.for("react.fragment"), be = Symbol.for("react.strict_mode"), ge = Symbol.for("react.profiler"), ve = Symbol.for("react.consumer"), ye = Symbol.for("react.context"), je = Symbol.for("react.forward_ref"), we = Symbol.for("react.suspense"), Ne = Symbol.for("react.suspense_list"), Te = Symbol.for("react.memo"), H = Symbol.for("react.lazy"), ke = Symbol.for("react.activity"), Me = Symbol.for("react.client.reference"), W = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Q = Object.prototype.hasOwnProperty, _e = Array.isArray, $ = console.createTask ? console.createTask : function() {
|
|
244
241
|
return null;
|
|
245
242
|
};
|
|
246
|
-
|
|
247
|
-
react_stack_bottom_frame: function(
|
|
248
|
-
return
|
|
243
|
+
h = {
|
|
244
|
+
react_stack_bottom_frame: function(s) {
|
|
245
|
+
return s();
|
|
249
246
|
}
|
|
250
247
|
};
|
|
251
|
-
var
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
)(),
|
|
255
|
-
|
|
256
|
-
var
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
248
|
+
var Z, K = {}, ee = h.react_stack_bottom_frame.bind(
|
|
249
|
+
h,
|
|
250
|
+
c
|
|
251
|
+
)(), te = $(a(c)), ne = {};
|
|
252
|
+
S.Fragment = M, S.jsx = function(s, d, f, b, T) {
|
|
253
|
+
var w = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return x(
|
|
255
|
+
s,
|
|
256
|
+
d,
|
|
257
|
+
f,
|
|
261
258
|
!1,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
259
|
+
b,
|
|
260
|
+
T,
|
|
261
|
+
w ? Error("react-stack-top-frame") : ee,
|
|
262
|
+
w ? $(a(s)) : te
|
|
266
263
|
);
|
|
267
|
-
},
|
|
268
|
-
var
|
|
269
|
-
return
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
264
|
+
}, S.jsxs = function(s, d, f, b, T) {
|
|
265
|
+
var w = 1e4 > W.recentlyCreatedOwnerStacks++;
|
|
266
|
+
return x(
|
|
267
|
+
s,
|
|
268
|
+
d,
|
|
269
|
+
f,
|
|
273
270
|
!0,
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
271
|
+
b,
|
|
272
|
+
T,
|
|
273
|
+
w ? Error("react-stack-top-frame") : ee,
|
|
274
|
+
w ? $(a(s)) : te
|
|
278
275
|
);
|
|
279
276
|
};
|
|
280
|
-
}()),
|
|
277
|
+
}()), S;
|
|
281
278
|
}
|
|
282
|
-
var
|
|
283
|
-
function
|
|
284
|
-
return
|
|
279
|
+
var se;
|
|
280
|
+
function Oe() {
|
|
281
|
+
return se || (se = 1, process.env.NODE_ENV === "production" ? A.exports = De() : A.exports = Ae()), A.exports;
|
|
285
282
|
}
|
|
286
|
-
var
|
|
287
|
-
|
|
283
|
+
var n = Oe();
|
|
284
|
+
/**
|
|
285
|
+
* @license lucide-react v0.545.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/
|
|
290
|
+
const Ie = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Fe = (e) => e.replace(
|
|
291
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
292
|
+
(t, r, a) => a ? a.toUpperCase() : r.toLowerCase()
|
|
293
|
+
), oe = (e) => {
|
|
294
|
+
const t = Fe(e);
|
|
295
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
296
|
+
}, he = (...e) => e.filter((t, r, a) => !!t && t.trim() !== "" && a.indexOf(t) === r).join(" ").trim(), We = (e) => {
|
|
297
|
+
for (const t in e)
|
|
298
|
+
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
299
|
+
return !0;
|
|
300
|
+
};
|
|
301
|
+
/**
|
|
302
|
+
* @license lucide-react v0.545.0 - ISC
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the ISC license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/
|
|
307
|
+
var $e = {
|
|
308
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
309
|
+
width: 24,
|
|
310
|
+
height: 24,
|
|
311
|
+
viewBox: "0 0 24 24",
|
|
312
|
+
fill: "none",
|
|
313
|
+
stroke: "currentColor",
|
|
314
|
+
strokeWidth: 2,
|
|
315
|
+
strokeLinecap: "round",
|
|
316
|
+
strokeLinejoin: "round"
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* @license lucide-react v0.545.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/
|
|
324
|
+
const Le = de(
|
|
325
|
+
({
|
|
326
|
+
color: e = "currentColor",
|
|
327
|
+
size: t = 24,
|
|
328
|
+
strokeWidth: r = 2,
|
|
329
|
+
absoluteStrokeWidth: a,
|
|
330
|
+
className: o = "",
|
|
331
|
+
children: c,
|
|
332
|
+
iconNode: l,
|
|
333
|
+
...i
|
|
334
|
+
}, u) => X(
|
|
335
|
+
"svg",
|
|
336
|
+
{
|
|
337
|
+
ref: u,
|
|
338
|
+
...$e,
|
|
339
|
+
width: t,
|
|
340
|
+
height: t,
|
|
341
|
+
stroke: e,
|
|
342
|
+
strokeWidth: a ? Number(r) * 24 / Number(t) : r,
|
|
343
|
+
className: he("lucide", o),
|
|
344
|
+
...!c && !We(i) && { "aria-hidden": "true" },
|
|
345
|
+
...i
|
|
346
|
+
},
|
|
347
|
+
[
|
|
348
|
+
...l.map(([m, x]) => X(m, x)),
|
|
349
|
+
...Array.isArray(c) ? c : [c]
|
|
350
|
+
]
|
|
351
|
+
)
|
|
352
|
+
);
|
|
353
|
+
/**
|
|
354
|
+
* @license lucide-react v0.545.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/
|
|
359
|
+
const N = (e, t) => {
|
|
360
|
+
const r = de(
|
|
361
|
+
({ className: a, ...o }, c) => X(Le, {
|
|
362
|
+
ref: c,
|
|
363
|
+
iconNode: t,
|
|
364
|
+
className: he(
|
|
365
|
+
`lucide-${Ie(oe(e))}`,
|
|
366
|
+
`lucide-${e}`,
|
|
367
|
+
a
|
|
368
|
+
),
|
|
369
|
+
...o
|
|
370
|
+
})
|
|
371
|
+
);
|
|
372
|
+
return r.displayName = oe(e), r;
|
|
373
|
+
};
|
|
374
|
+
/**
|
|
375
|
+
* @license lucide-react v0.545.0 - ISC
|
|
376
|
+
*
|
|
377
|
+
* This source code is licensed under the ISC license.
|
|
378
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
+
*/
|
|
380
|
+
const Ye = [
|
|
381
|
+
["path", { d: "M6 5h12", key: "fvfigv" }],
|
|
382
|
+
["path", { d: "M4 12h10", key: "oujl3d" }],
|
|
383
|
+
["path", { d: "M12 19h8", key: "baeox8" }]
|
|
384
|
+
], Ve = N("chart-no-axes-gantt", Ye);
|
|
385
|
+
/**
|
|
386
|
+
* @license lucide-react v0.545.0 - ISC
|
|
387
|
+
*
|
|
388
|
+
* This source code is licensed under the ISC license.
|
|
389
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
+
*/
|
|
391
|
+
const ze = [
|
|
392
|
+
[
|
|
393
|
+
"path",
|
|
394
|
+
{
|
|
395
|
+
d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",
|
|
396
|
+
key: "1sd12s"
|
|
397
|
+
}
|
|
398
|
+
]
|
|
399
|
+
], Xe = N("message-circle", ze);
|
|
400
|
+
/**
|
|
401
|
+
* @license lucide-react v0.545.0 - ISC
|
|
402
|
+
*
|
|
403
|
+
* This source code is licensed under the ISC license.
|
|
404
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
+
*/
|
|
406
|
+
const qe = [["path", { d: "M5 12h14", key: "1ays0h" }]], Ge = N("minus", qe);
|
|
407
|
+
/**
|
|
408
|
+
* @license lucide-react v0.545.0 - ISC
|
|
409
|
+
*
|
|
410
|
+
* This source code is licensed under the ISC license.
|
|
411
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
+
*/
|
|
413
|
+
const Je = [
|
|
414
|
+
[
|
|
415
|
+
"path",
|
|
416
|
+
{
|
|
417
|
+
d: "M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",
|
|
418
|
+
key: "1a0edw"
|
|
419
|
+
}
|
|
420
|
+
],
|
|
421
|
+
["path", { d: "M12 22V12", key: "d0xqtd" }],
|
|
422
|
+
["polyline", { points: "3.29 7 12 12 20.71 7", key: "ousv84" }],
|
|
423
|
+
["path", { d: "m7.5 4.27 9 5.15", key: "1c824w" }]
|
|
424
|
+
], Ue = N("package", Je);
|
|
425
|
+
/**
|
|
426
|
+
* @license lucide-react v0.545.0 - ISC
|
|
427
|
+
*
|
|
428
|
+
* This source code is licensed under the ISC license.
|
|
429
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
+
*/
|
|
431
|
+
const Be = [
|
|
432
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
433
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
434
|
+
], He = N("plus", Be);
|
|
435
|
+
/**
|
|
436
|
+
* @license lucide-react v0.545.0 - ISC
|
|
437
|
+
*
|
|
438
|
+
* This source code is licensed under the ISC license.
|
|
439
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
+
*/
|
|
441
|
+
const Qe = [
|
|
442
|
+
["path", { d: "M16.247 7.761a6 6 0 0 1 0 8.478", key: "1fwjs5" }],
|
|
443
|
+
["path", { d: "M19.075 4.933a10 10 0 0 1 0 14.134", key: "ehdyv1" }],
|
|
444
|
+
["path", { d: "M4.925 19.067a10 10 0 0 1 0-14.134", key: "1q22gi" }],
|
|
445
|
+
["path", { d: "M7.753 16.239a6 6 0 0 1 0-8.478", key: "r2q7qm" }],
|
|
446
|
+
["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }]
|
|
447
|
+
], Ze = N("radio", Qe);
|
|
448
|
+
/**
|
|
449
|
+
* @license lucide-react v0.545.0 - ISC
|
|
450
|
+
*
|
|
451
|
+
* This source code is licensed under the ISC license.
|
|
452
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
453
|
+
*/
|
|
454
|
+
const Ke = [
|
|
455
|
+
["path", { d: "M15 12h-5", key: "r7krc0" }],
|
|
456
|
+
["path", { d: "M15 8h-5", key: "1khuty" }],
|
|
457
|
+
["path", { d: "M19 17V5a2 2 0 0 0-2-2H4", key: "zz82l3" }],
|
|
458
|
+
[
|
|
459
|
+
"path",
|
|
460
|
+
{
|
|
461
|
+
d: "M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",
|
|
462
|
+
key: "1ph1d7"
|
|
463
|
+
}
|
|
464
|
+
]
|
|
465
|
+
], et = N("scroll-text", Ke);
|
|
466
|
+
/**
|
|
467
|
+
* @license lucide-react v0.545.0 - ISC
|
|
468
|
+
*
|
|
469
|
+
* This source code is licensed under the ISC license.
|
|
470
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
+
*/
|
|
472
|
+
const tt = [
|
|
473
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
474
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
475
|
+
], nt = N("search", tt);
|
|
476
|
+
/**
|
|
477
|
+
* @license lucide-react v0.545.0 - ISC
|
|
478
|
+
*
|
|
479
|
+
* This source code is licensed under the ISC license.
|
|
480
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
481
|
+
*/
|
|
482
|
+
const rt = [
|
|
483
|
+
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
484
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
485
|
+
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
486
|
+
], at = N("trash", rt);
|
|
487
|
+
/**
|
|
488
|
+
* @license lucide-react v0.545.0 - ISC
|
|
489
|
+
*
|
|
490
|
+
* This source code is licensed under the ISC license.
|
|
491
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
492
|
+
*/
|
|
493
|
+
const st = [
|
|
494
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
495
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
496
|
+
], xe = N("x", st), ie = (e) => {
|
|
497
|
+
let t;
|
|
498
|
+
const r = /* @__PURE__ */ new Set(), a = (m, x) => {
|
|
499
|
+
const v = typeof m == "function" ? m(t) : m;
|
|
500
|
+
if (!Object.is(v, t)) {
|
|
501
|
+
const h = t;
|
|
502
|
+
t = x ?? (typeof v != "object" || v === null) ? v : Object.assign({}, t, v), r.forEach((y) => y(t, h));
|
|
503
|
+
}
|
|
504
|
+
}, o = () => t, i = { setState: a, getState: o, getInitialState: () => u, subscribe: (m) => (r.add(m), () => r.delete(m)) }, u = t = e(a, o, i);
|
|
505
|
+
return i;
|
|
506
|
+
}, ot = (e) => e ? ie(e) : ie, it = (e) => e;
|
|
507
|
+
function ct(e, t = it) {
|
|
508
|
+
const r = C.useSyncExternalStore(
|
|
509
|
+
e.subscribe,
|
|
510
|
+
C.useCallback(() => t(e.getState()), [e, t]),
|
|
511
|
+
C.useCallback(() => t(e.getInitialState()), [e, t])
|
|
512
|
+
);
|
|
513
|
+
return C.useDebugValue(r), r;
|
|
514
|
+
}
|
|
515
|
+
const lt = (e) => {
|
|
516
|
+
const t = ot(e), r = (a) => ct(t, a);
|
|
517
|
+
return Object.assign(r, t), r;
|
|
518
|
+
}, dt = (e) => lt, F = dt()((e) => ({
|
|
288
519
|
selectedTraceGroupId: void 0,
|
|
289
520
|
selectedTraceId: void 0,
|
|
290
|
-
selectTraceGroupId: (
|
|
291
|
-
selectTraceId: (
|
|
292
|
-
})),
|
|
293
|
-
const
|
|
294
|
-
return
|
|
295
|
-
if (
|
|
296
|
-
a(
|
|
521
|
+
selectTraceGroupId: (t) => e({ selectedTraceGroupId: t }),
|
|
522
|
+
selectTraceId: (t) => e({ selectedTraceId: t })
|
|
523
|
+
})), ut = (e) => {
|
|
524
|
+
const t = e?.endTime, [r, a] = G(t || Date.now());
|
|
525
|
+
return ue(() => {
|
|
526
|
+
if (t)
|
|
527
|
+
a(t);
|
|
297
528
|
else {
|
|
298
529
|
const o = setInterval(() => a(Date.now()), 50);
|
|
299
530
|
return () => clearInterval(o);
|
|
300
531
|
}
|
|
301
|
-
}, [
|
|
302
|
-
},
|
|
532
|
+
}, [t]), r;
|
|
533
|
+
}, k = (e) => e == null ? "N/A" : e < 1e3 ? `${e}ms` : e < 6e4 ? `${(e / 1e3).toFixed(1)}s` : e < 36e5 ? `${(e / 6e4).toFixed(1)}min` : `${(e / 36e5).toFixed(1)}h`, mt = ({ trace: e, group: t, groupEndTime: r, onExpand: a }) => /* @__PURE__ */ n.jsxs(
|
|
303
534
|
"div",
|
|
304
535
|
{
|
|
305
536
|
className: "flex hover:bg-muted-foreground/10 relative cursor-pointer",
|
|
306
|
-
onClick: () => a(
|
|
537
|
+
onClick: () => a(e.id),
|
|
307
538
|
"data-testid": "trace-timeline-item",
|
|
308
539
|
children: [
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ n.jsx("div", { className: "flex items-center min-w-[200px] max-w-[200px] h-[32px] max-h-[32px] py-4 px-2 text-sm font-semibold text-foreground truncate sticky left-0 bg-card z-9", children: e.name }),
|
|
541
|
+
/* @__PURE__ */ n.jsx("div", { className: "flex w-full flex-row items-center hover:bg-muted/50 rounded-md", children: /* @__PURE__ */ n.jsx("div", { className: "relative w-full h-[32px] flex items-center", children: /* @__PURE__ */ n.jsx(
|
|
311
542
|
"div",
|
|
312
543
|
{
|
|
313
|
-
className:
|
|
314
|
-
"bg-[repeating-linear-gradient(140deg,#BEFE29,#BEFE29_8px,#ABE625_8px,#ABE625_16px)]":
|
|
315
|
-
"bg-[repeating-linear-gradient(140deg,#2862FE,#2862FE_8px,#2358E5_8px,#2358E5_16px)]":
|
|
316
|
-
"bg-[repeating-linear-gradient(140deg,#EA2069,#EA2069_8px,#D41E60_8px,#D41E60_16px)]":
|
|
544
|
+
className: U("h-[24px] rounded-[4px] hover:opacity-80 transition-all duration-200", {
|
|
545
|
+
"bg-[repeating-linear-gradient(140deg,#BEFE29,#BEFE29_8px,#ABE625_8px,#ABE625_16px)]": e.status === "running",
|
|
546
|
+
"bg-[repeating-linear-gradient(140deg,#2862FE,#2862FE_8px,#2358E5_8px,#2358E5_16px)]": e.status === "completed",
|
|
547
|
+
"bg-[repeating-linear-gradient(140deg,#EA2069,#EA2069_8px,#D41E60_8px,#D41E60_16px)]": e.status === "failed"
|
|
317
548
|
}),
|
|
318
549
|
style: {
|
|
319
|
-
marginLeft: `${(
|
|
320
|
-
width:
|
|
550
|
+
marginLeft: `${(e.startTime - t.startTime) / (r - t.startTime) * 100}%`,
|
|
551
|
+
width: e.endTime ? `${(e.endTime - e.startTime) / (r - t.startTime) * 100}%` : `${(Date.now() - e.startTime) / (r - t.startTime) * 100}%`
|
|
321
552
|
}
|
|
322
553
|
}
|
|
323
554
|
) }) })
|
|
324
555
|
]
|
|
325
556
|
}
|
|
326
|
-
),
|
|
327
|
-
if (
|
|
328
|
-
return /* @__PURE__ */
|
|
329
|
-
if (
|
|
330
|
-
return /* @__PURE__ */
|
|
331
|
-
if (
|
|
332
|
-
return /* @__PURE__ */
|
|
333
|
-
if (
|
|
334
|
-
return /* @__PURE__ */
|
|
335
|
-
},
|
|
336
|
-
if (typeof
|
|
337
|
-
return /* @__PURE__ */
|
|
557
|
+
), ft = ({ event: e }) => {
|
|
558
|
+
if (e.type === "log")
|
|
559
|
+
return /* @__PURE__ */ n.jsx(et, { className: "w-4 h-4 text-muted-foreground" });
|
|
560
|
+
if (e.type === "emit")
|
|
561
|
+
return /* @__PURE__ */ n.jsx(Xe, { className: "w-4 h-4 text-muted-foreground" });
|
|
562
|
+
if (e.type === "state")
|
|
563
|
+
return /* @__PURE__ */ n.jsx(Ue, { className: "w-4 h-4 text-muted-foreground" });
|
|
564
|
+
if (e.type === "stream")
|
|
565
|
+
return /* @__PURE__ */ n.jsx(Ze, { className: "w-4 h-4 text-muted-foreground" });
|
|
566
|
+
}, pe = ({ arg: e }) => {
|
|
567
|
+
if (typeof e == "string")
|
|
568
|
+
return /* @__PURE__ */ n.jsxs("span", { className: "font-mono text-blue-500", children: [
|
|
338
569
|
"'",
|
|
339
|
-
|
|
570
|
+
e,
|
|
340
571
|
"'"
|
|
341
572
|
] });
|
|
342
|
-
if (
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
-
const
|
|
345
|
-
return /* @__PURE__ */
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
/* @__PURE__ */
|
|
573
|
+
if (e === !1)
|
|
574
|
+
return /* @__PURE__ */ n.jsx("span", { className: "font-mono text-blue-100 font-bold bg-blue-500/50 px-2 rounded-md", children: "value" });
|
|
575
|
+
const t = Object.entries(e);
|
|
576
|
+
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
577
|
+
/* @__PURE__ */ n.jsx("span", { className: "font-mono text-green-500", children: "{ " }),
|
|
578
|
+
t.map(([r, a], o) => /* @__PURE__ */ n.jsxs("span", { children: [
|
|
579
|
+
/* @__PURE__ */ n.jsx("span", { className: "font-mono text-green-500", children: r }),
|
|
580
|
+
/* @__PURE__ */ n.jsx("span", { className: "font-mono text-muted-foreground", children: ":" }),
|
|
350
581
|
" ",
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
o <
|
|
353
|
-
] },
|
|
354
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ n.jsx(pe, { arg: a }),
|
|
583
|
+
o < t.length - 1 && /* @__PURE__ */ n.jsx(n.Fragment, { children: ", " })
|
|
584
|
+
] }, r)),
|
|
585
|
+
/* @__PURE__ */ n.jsx("span", { className: "font-mono text-green-500", children: " }" })
|
|
355
586
|
] });
|
|
356
|
-
},
|
|
357
|
-
const
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
-
|
|
360
|
-
/* @__PURE__ */
|
|
587
|
+
}, B = ({ topLevelClassName: e, objectName: t, functionName: r, args: a, callsQuantity: o }) => {
|
|
588
|
+
const c = o && o > 1, l = a.filter((i) => i !== void 0);
|
|
589
|
+
return /* @__PURE__ */ n.jsxs("div", { children: [
|
|
590
|
+
e && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
591
|
+
/* @__PURE__ */ n.jsx("span", { className: "font-mono text-pink-500", children: e }),
|
|
361
592
|
"."
|
|
362
593
|
] }),
|
|
363
|
-
|
|
364
|
-
/* @__PURE__ */
|
|
594
|
+
t && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
595
|
+
/* @__PURE__ */ n.jsx("span", { className: "font-mono text-pink-500", children: t }),
|
|
365
596
|
"."
|
|
366
597
|
] }),
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
-
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
-
|
|
372
|
-
] },
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
|
|
598
|
+
/* @__PURE__ */ n.jsx("span", { className: "font-mono text-pink-500", children: r }),
|
|
599
|
+
/* @__PURE__ */ n.jsx("span", { className: "font-mono text-emerald-500", children: "(" }),
|
|
600
|
+
l.map((i, u) => /* @__PURE__ */ n.jsxs("span", { children: [
|
|
601
|
+
/* @__PURE__ */ n.jsx(pe, { arg: i }),
|
|
602
|
+
u < l.length - 1 && /* @__PURE__ */ n.jsx(n.Fragment, { children: ", " })
|
|
603
|
+
] }, u)),
|
|
604
|
+
/* @__PURE__ */ n.jsx("span", { className: "font-mono text-emerald-500", children: ")" }),
|
|
605
|
+
c && /* @__PURE__ */ n.jsxs("span", { className: "font-mono text-muted-foreground", children: [
|
|
375
606
|
" x",
|
|
376
607
|
o
|
|
377
608
|
] })
|
|
378
609
|
] });
|
|
379
|
-
},
|
|
380
|
-
/* @__PURE__ */
|
|
610
|
+
}, ht = ({ event: e }) => /* @__PURE__ */ n.jsx(B, { functionName: "emit", args: [{ topic: e.topic, data: !1 }] }), xt = ({ event: e }) => /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
611
|
+
/* @__PURE__ */ n.jsx(Pe, { level: e.level }),
|
|
381
612
|
" ",
|
|
382
|
-
|
|
383
|
-
] }),
|
|
384
|
-
|
|
613
|
+
e.message
|
|
614
|
+
] }), pt = ({ event: e }) => /* @__PURE__ */ n.jsx(
|
|
615
|
+
B,
|
|
385
616
|
{
|
|
386
617
|
objectName: "state",
|
|
387
|
-
functionName:
|
|
388
|
-
args: [
|
|
618
|
+
functionName: e.operation,
|
|
619
|
+
args: [e.data.traceId, e.data.key, e.data.value ? !1 : void 0]
|
|
389
620
|
}
|
|
390
|
-
),
|
|
391
|
-
|
|
621
|
+
), bt = ({ event: e }) => /* @__PURE__ */ n.jsx(
|
|
622
|
+
B,
|
|
392
623
|
{
|
|
393
624
|
topLevelClassName: "streams",
|
|
394
|
-
objectName:
|
|
395
|
-
functionName:
|
|
396
|
-
args: [
|
|
397
|
-
callsQuantity:
|
|
625
|
+
objectName: e.streamName,
|
|
626
|
+
functionName: e.operation,
|
|
627
|
+
args: [e.data.groupId, e.data.id, e.data.data ? !1 : void 0],
|
|
628
|
+
callsQuantity: e.calls
|
|
398
629
|
}
|
|
399
|
-
),
|
|
400
|
-
if (
|
|
401
|
-
return /* @__PURE__ */
|
|
402
|
-
if (
|
|
403
|
-
return /* @__PURE__ */
|
|
404
|
-
if (
|
|
405
|
-
return /* @__PURE__ */
|
|
406
|
-
if (
|
|
407
|
-
return /* @__PURE__ */
|
|
408
|
-
}),
|
|
409
|
-
|
|
630
|
+
), gt = D(({ event: e }) => {
|
|
631
|
+
if (e.type === "log")
|
|
632
|
+
return /* @__PURE__ */ n.jsx(xt, { event: e });
|
|
633
|
+
if (e.type === "emit")
|
|
634
|
+
return /* @__PURE__ */ n.jsx(ht, { event: e });
|
|
635
|
+
if (e.type === "state")
|
|
636
|
+
return /* @__PURE__ */ n.jsx(pt, { event: e });
|
|
637
|
+
if (e.type === "stream")
|
|
638
|
+
return /* @__PURE__ */ n.jsx(bt, { event: e });
|
|
639
|
+
}), vt = D(({ trace: e, onClose: t }) => /* @__PURE__ */ n.jsxs(
|
|
640
|
+
Re,
|
|
410
641
|
{
|
|
411
|
-
onClose:
|
|
642
|
+
onClose: t,
|
|
412
643
|
title: "Trace Details",
|
|
413
|
-
subtitle: `Viewing details from step ${
|
|
414
|
-
actions: [{ icon: /* @__PURE__ */
|
|
644
|
+
subtitle: `Viewing details from step ${e.name}`,
|
|
645
|
+
actions: [{ icon: /* @__PURE__ */ n.jsx(xe, {}), onClick: t, label: "Close" }],
|
|
415
646
|
children: [
|
|
416
|
-
/* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
|
|
647
|
+
/* @__PURE__ */ n.jsxs("div", { className: "px-2 w-[800px] overflow-auto", children: [
|
|
648
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-4 text-sm text-muted-foreground mb-4", children: [
|
|
649
|
+
e.endTime && /* @__PURE__ */ n.jsxs("span", { children: [
|
|
419
650
|
"Duration: ",
|
|
420
|
-
|
|
651
|
+
k(e.endTime - e.startTime)
|
|
421
652
|
] }),
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
|
|
653
|
+
/* @__PURE__ */ n.jsx("div", { className: "bg-blue-500 font-bold text-xs px-[4px] py-[2px] rounded-sm text-blue-100", children: e.entryPoint.type }),
|
|
654
|
+
e.correlationId && /* @__PURE__ */ n.jsxs(fe, { variant: "outline", children: [
|
|
424
655
|
"Correlated: ",
|
|
425
|
-
|
|
656
|
+
e.correlationId
|
|
426
657
|
] })
|
|
427
658
|
] }),
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ n.jsx("div", { className: "pl-6 border-l-1 border-gray-500/40 font-mono text-xs flex flex-col gap-3", children: e.events.map((r, a) => /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
|
|
660
|
+
/* @__PURE__ */ n.jsx("div", { className: "absolute -left-[26px] top-[8px] w-1 h-1 rounded-full bg-emerald-500 outline outline-2 outline-emerald-500/50" }),
|
|
661
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
662
|
+
/* @__PURE__ */ n.jsx(ft, { event: r }),
|
|
663
|
+
/* @__PURE__ */ n.jsxs("span", { className: "text-sm font-mono text-muted-foreground", children: [
|
|
433
664
|
"+",
|
|
434
|
-
|
|
665
|
+
k(Math.floor(r.timestamp - e.startTime))
|
|
435
666
|
] }),
|
|
436
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ n.jsx(gt, { event: r })
|
|
437
668
|
] })
|
|
438
669
|
] }, a)) })
|
|
439
670
|
] }),
|
|
440
|
-
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
/* @__PURE__ */
|
|
671
|
+
e.error && /* @__PURE__ */ n.jsxs("div", { className: "p-4 bg-red-800/10", children: [
|
|
672
|
+
/* @__PURE__ */ n.jsx("div", { className: "text-sm text-red-800 dark:text-red-400 font-semibold", children: e.error.message }),
|
|
673
|
+
/* @__PURE__ */ n.jsx("div", { className: "text-sm text-red-800 dark:text-red-400 pl-4", children: e.error.stack })
|
|
443
674
|
] })
|
|
444
675
|
]
|
|
445
676
|
}
|
|
446
|
-
)),
|
|
447
|
-
const { data:
|
|
677
|
+
)), yt = D(({ groupId: e }) => {
|
|
678
|
+
const { data: t } = Se({
|
|
448
679
|
streamName: "motia-trace-group",
|
|
449
680
|
groupId: "default",
|
|
450
|
-
id:
|
|
451
|
-
}), { data:
|
|
452
|
-
o > 0.5 &&
|
|
681
|
+
id: e
|
|
682
|
+
}), { data: r } = me({ streamName: "motia-trace", groupId: e }), a = ut(t), [o, c] = G(1), l = F((x) => x.selectedTraceId), i = F((x) => x.selectTraceId), u = J(() => r?.find((x) => x.id === l), [r, l]), m = () => {
|
|
683
|
+
o > 0.5 && c(o - 0.1);
|
|
453
684
|
};
|
|
454
|
-
return
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */
|
|
685
|
+
return t ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
686
|
+
/* @__PURE__ */ n.jsx("div", { className: "flex flex-col flex-1 overflow-x-auto h-full relative", children: /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col items-center min-w-full sticky top-0", style: { width: `${o * 1e3}px` }, children: [
|
|
687
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex flex-1 w-full sticky top-0 bg-background z-10", children: [
|
|
688
|
+
/* @__PURE__ */ n.jsxs("div", { className: "w-full min-h-[37px] h-[37px] min-w-[200px] max-w-[200px] flex items-center justify-center gap-2 sticky left-0 top-0 bg-card backdrop-blur-[4px] backdrop-filter", children: [
|
|
689
|
+
/* @__PURE__ */ n.jsx(q, { variant: "icon", size: "sm", className: "px-2", onClick: m, children: /* @__PURE__ */ n.jsx(Ge, { className: "w-4 h-4 cursor-pointer" }) }),
|
|
690
|
+
/* @__PURE__ */ n.jsxs("span", { className: "text-sm font-bold text-muted-foreground", children: [
|
|
460
691
|
Math.floor(o * 100),
|
|
461
692
|
"%"
|
|
462
693
|
] }),
|
|
463
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ n.jsx(q, { variant: "icon", size: "sm", className: "px-2", onClick: () => c(o + 0.1), children: /* @__PURE__ */ n.jsx(He, { className: "w-4 h-4 cursor-pointer" }) })
|
|
464
695
|
] }),
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
/* @__PURE__ */
|
|
469
|
-
/* @__PURE__ */
|
|
470
|
-
/* @__PURE__ */
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex justify-between font-mono p-2 w-full text-xs text-muted-foreground bg-card", children: [
|
|
697
|
+
/* @__PURE__ */ n.jsx("span", { children: k(0) }),
|
|
698
|
+
/* @__PURE__ */ n.jsx("span", { children: k(Math.floor((a - t.startTime) * 0.25)) }),
|
|
699
|
+
/* @__PURE__ */ n.jsx("span", { children: k(Math.floor((a - t.startTime) * 0.5)) }),
|
|
700
|
+
/* @__PURE__ */ n.jsx("span", { children: k(Math.floor((a - t.startTime) * 0.75)) }),
|
|
701
|
+
/* @__PURE__ */ n.jsx("span", { children: k(Math.floor(a - t.startTime)) }),
|
|
702
|
+
/* @__PURE__ */ n.jsxs("div", { className: "absolute bottom-[-4px] w-full flex justify-between", children: [
|
|
703
|
+
/* @__PURE__ */ n.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
|
|
704
|
+
/* @__PURE__ */ n.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
|
|
705
|
+
/* @__PURE__ */ n.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
|
|
706
|
+
/* @__PURE__ */ n.jsx("span", { className: "w-[1px] h-full bg-blue-500" }),
|
|
707
|
+
/* @__PURE__ */ n.jsx("span", { className: "w-[1px] h-full bg-blue-500" })
|
|
477
708
|
] })
|
|
478
709
|
] })
|
|
479
710
|
] }),
|
|
480
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ n.jsx("div", { className: "flex flex-col w-full h-full", children: r?.map((x) => /* @__PURE__ */ n.jsx(mt, { trace: x, group: t, groupEndTime: a, onExpand: i }, x.id)) })
|
|
481
712
|
] }) }),
|
|
482
|
-
|
|
713
|
+
u && /* @__PURE__ */ n.jsx(vt, { trace: u, onClose: () => i(void 0) })
|
|
483
714
|
] }) : null;
|
|
484
|
-
})
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
715
|
+
});
|
|
716
|
+
function p(e) {
|
|
717
|
+
const t = Object.prototype.toString.call(e);
|
|
718
|
+
return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
|
|
719
|
+
}
|
|
720
|
+
function jt(e, t) {
|
|
721
|
+
return e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
722
|
+
}
|
|
723
|
+
const O = 43200, ce = 1440;
|
|
724
|
+
let wt = {};
|
|
725
|
+
function Nt() {
|
|
726
|
+
return wt;
|
|
727
|
+
}
|
|
728
|
+
function le(e) {
|
|
729
|
+
const t = p(e), r = new Date(
|
|
730
|
+
Date.UTC(
|
|
731
|
+
t.getFullYear(),
|
|
732
|
+
t.getMonth(),
|
|
733
|
+
t.getDate(),
|
|
734
|
+
t.getHours(),
|
|
735
|
+
t.getMinutes(),
|
|
736
|
+
t.getSeconds(),
|
|
737
|
+
t.getMilliseconds()
|
|
738
|
+
)
|
|
739
|
+
);
|
|
740
|
+
return r.setUTCFullYear(t.getFullYear()), +e - +r;
|
|
741
|
+
}
|
|
742
|
+
function I(e, t) {
|
|
743
|
+
const r = p(e), a = p(t), o = r.getTime() - a.getTime();
|
|
744
|
+
return o < 0 ? -1 : o > 0 ? 1 : o;
|
|
745
|
+
}
|
|
746
|
+
function Tt(e) {
|
|
747
|
+
return jt(e, Date.now());
|
|
748
|
+
}
|
|
749
|
+
function kt(e, t) {
|
|
750
|
+
const r = p(e), a = p(t), o = r.getFullYear() - a.getFullYear(), c = r.getMonth() - a.getMonth();
|
|
751
|
+
return o * 12 + c;
|
|
752
|
+
}
|
|
753
|
+
function Mt(e) {
|
|
754
|
+
return (t) => {
|
|
755
|
+
const r = Math.trunc, a = r(t);
|
|
756
|
+
return a === 0 ? 0 : a;
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
function _t(e, t) {
|
|
760
|
+
return +p(e) - +p(t);
|
|
761
|
+
}
|
|
762
|
+
function Et(e) {
|
|
763
|
+
const t = p(e);
|
|
764
|
+
return t.setHours(23, 59, 59, 999), t;
|
|
765
|
+
}
|
|
766
|
+
function St(e) {
|
|
767
|
+
const t = p(e), r = t.getMonth();
|
|
768
|
+
return t.setFullYear(t.getFullYear(), r + 1, 0), t.setHours(23, 59, 59, 999), t;
|
|
769
|
+
}
|
|
770
|
+
function Pt(e) {
|
|
771
|
+
const t = p(e);
|
|
772
|
+
return +Et(t) == +St(t);
|
|
773
|
+
}
|
|
774
|
+
function Rt(e, t) {
|
|
775
|
+
const r = p(e), a = p(t), o = I(r, a), c = Math.abs(
|
|
776
|
+
kt(r, a)
|
|
777
|
+
);
|
|
778
|
+
let l;
|
|
779
|
+
if (c < 1)
|
|
780
|
+
l = 0;
|
|
781
|
+
else {
|
|
782
|
+
r.getMonth() === 1 && r.getDate() > 27 && r.setDate(30), r.setMonth(r.getMonth() - o * c);
|
|
783
|
+
let i = I(r, a) === -o;
|
|
784
|
+
Pt(p(e)) && c === 1 && I(e, a) === 1 && (i = !1), l = o * (c - Number(i));
|
|
785
|
+
}
|
|
786
|
+
return l === 0 ? 0 : l;
|
|
787
|
+
}
|
|
788
|
+
function Ct(e, t, r) {
|
|
789
|
+
const a = _t(e, t) / 1e3;
|
|
790
|
+
return Mt()(a);
|
|
791
|
+
}
|
|
792
|
+
const Dt = {
|
|
793
|
+
lessThanXSeconds: {
|
|
794
|
+
one: "less than a second",
|
|
795
|
+
other: "less than {{count}} seconds"
|
|
796
|
+
},
|
|
797
|
+
xSeconds: {
|
|
798
|
+
one: "1 second",
|
|
799
|
+
other: "{{count}} seconds"
|
|
800
|
+
},
|
|
801
|
+
halfAMinute: "half a minute",
|
|
802
|
+
lessThanXMinutes: {
|
|
803
|
+
one: "less than a minute",
|
|
804
|
+
other: "less than {{count}} minutes"
|
|
805
|
+
},
|
|
806
|
+
xMinutes: {
|
|
807
|
+
one: "1 minute",
|
|
808
|
+
other: "{{count}} minutes"
|
|
809
|
+
},
|
|
810
|
+
aboutXHours: {
|
|
811
|
+
one: "about 1 hour",
|
|
812
|
+
other: "about {{count}} hours"
|
|
813
|
+
},
|
|
814
|
+
xHours: {
|
|
815
|
+
one: "1 hour",
|
|
816
|
+
other: "{{count}} hours"
|
|
817
|
+
},
|
|
818
|
+
xDays: {
|
|
819
|
+
one: "1 day",
|
|
820
|
+
other: "{{count}} days"
|
|
821
|
+
},
|
|
822
|
+
aboutXWeeks: {
|
|
823
|
+
one: "about 1 week",
|
|
824
|
+
other: "about {{count}} weeks"
|
|
825
|
+
},
|
|
826
|
+
xWeeks: {
|
|
827
|
+
one: "1 week",
|
|
828
|
+
other: "{{count}} weeks"
|
|
829
|
+
},
|
|
830
|
+
aboutXMonths: {
|
|
831
|
+
one: "about 1 month",
|
|
832
|
+
other: "about {{count}} months"
|
|
833
|
+
},
|
|
834
|
+
xMonths: {
|
|
835
|
+
one: "1 month",
|
|
836
|
+
other: "{{count}} months"
|
|
837
|
+
},
|
|
838
|
+
aboutXYears: {
|
|
839
|
+
one: "about 1 year",
|
|
840
|
+
other: "about {{count}} years"
|
|
841
|
+
},
|
|
842
|
+
xYears: {
|
|
843
|
+
one: "1 year",
|
|
844
|
+
other: "{{count}} years"
|
|
845
|
+
},
|
|
846
|
+
overXYears: {
|
|
847
|
+
one: "over 1 year",
|
|
848
|
+
other: "over {{count}} years"
|
|
849
|
+
},
|
|
850
|
+
almostXYears: {
|
|
851
|
+
one: "almost 1 year",
|
|
852
|
+
other: "almost {{count}} years"
|
|
853
|
+
}
|
|
854
|
+
}, At = (e, t, r) => {
|
|
855
|
+
let a;
|
|
856
|
+
const o = Dt[e];
|
|
857
|
+
return typeof o == "string" ? a = o : t === 1 ? a = o.one : a = o.other.replace("{{count}}", t.toString()), r?.addSuffix ? r.comparison && r.comparison > 0 ? "in " + a : a + " ago" : a;
|
|
858
|
+
};
|
|
859
|
+
function z(e) {
|
|
860
|
+
return (t = {}) => {
|
|
861
|
+
const r = t.width ? String(t.width) : e.defaultWidth;
|
|
862
|
+
return e.formats[r] || e.formats[e.defaultWidth];
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
const Ot = {
|
|
866
|
+
full: "EEEE, MMMM do, y",
|
|
867
|
+
long: "MMMM do, y",
|
|
868
|
+
medium: "MMM d, y",
|
|
869
|
+
short: "MM/dd/yyyy"
|
|
870
|
+
}, It = {
|
|
871
|
+
full: "h:mm:ss a zzzz",
|
|
872
|
+
long: "h:mm:ss a z",
|
|
873
|
+
medium: "h:mm:ss a",
|
|
874
|
+
short: "h:mm a"
|
|
875
|
+
}, Ft = {
|
|
876
|
+
full: "{{date}} 'at' {{time}}",
|
|
877
|
+
long: "{{date}} 'at' {{time}}",
|
|
878
|
+
medium: "{{date}}, {{time}}",
|
|
879
|
+
short: "{{date}}, {{time}}"
|
|
880
|
+
}, Wt = {
|
|
881
|
+
date: z({
|
|
882
|
+
formats: Ot,
|
|
883
|
+
defaultWidth: "full"
|
|
884
|
+
}),
|
|
885
|
+
time: z({
|
|
886
|
+
formats: It,
|
|
887
|
+
defaultWidth: "full"
|
|
888
|
+
}),
|
|
889
|
+
dateTime: z({
|
|
890
|
+
formats: Ft,
|
|
891
|
+
defaultWidth: "full"
|
|
892
|
+
})
|
|
893
|
+
}, $t = {
|
|
894
|
+
lastWeek: "'last' eeee 'at' p",
|
|
895
|
+
yesterday: "'yesterday at' p",
|
|
896
|
+
today: "'today at' p",
|
|
897
|
+
tomorrow: "'tomorrow at' p",
|
|
898
|
+
nextWeek: "eeee 'at' p",
|
|
899
|
+
other: "P"
|
|
900
|
+
}, Lt = (e, t, r, a) => $t[e];
|
|
901
|
+
function P(e) {
|
|
902
|
+
return (t, r) => {
|
|
903
|
+
const a = r?.context ? String(r.context) : "standalone";
|
|
904
|
+
let o;
|
|
905
|
+
if (a === "formatting" && e.formattingValues) {
|
|
906
|
+
const l = e.defaultFormattingWidth || e.defaultWidth, i = r?.width ? String(r.width) : l;
|
|
907
|
+
o = e.formattingValues[i] || e.formattingValues[l];
|
|
908
|
+
} else {
|
|
909
|
+
const l = e.defaultWidth, i = r?.width ? String(r.width) : e.defaultWidth;
|
|
910
|
+
o = e.values[i] || e.values[l];
|
|
911
|
+
}
|
|
912
|
+
const c = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
913
|
+
return o[c];
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
const Yt = {
|
|
917
|
+
narrow: ["B", "A"],
|
|
918
|
+
abbreviated: ["BC", "AD"],
|
|
919
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
920
|
+
}, Vt = {
|
|
921
|
+
narrow: ["1", "2", "3", "4"],
|
|
922
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
923
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
924
|
+
}, zt = {
|
|
925
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
926
|
+
abbreviated: [
|
|
927
|
+
"Jan",
|
|
928
|
+
"Feb",
|
|
929
|
+
"Mar",
|
|
930
|
+
"Apr",
|
|
931
|
+
"May",
|
|
932
|
+
"Jun",
|
|
933
|
+
"Jul",
|
|
934
|
+
"Aug",
|
|
935
|
+
"Sep",
|
|
936
|
+
"Oct",
|
|
937
|
+
"Nov",
|
|
938
|
+
"Dec"
|
|
939
|
+
],
|
|
940
|
+
wide: [
|
|
941
|
+
"January",
|
|
942
|
+
"February",
|
|
943
|
+
"March",
|
|
944
|
+
"April",
|
|
945
|
+
"May",
|
|
946
|
+
"June",
|
|
947
|
+
"July",
|
|
948
|
+
"August",
|
|
949
|
+
"September",
|
|
950
|
+
"October",
|
|
951
|
+
"November",
|
|
952
|
+
"December"
|
|
953
|
+
]
|
|
954
|
+
}, Xt = {
|
|
955
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
956
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
957
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
958
|
+
wide: [
|
|
959
|
+
"Sunday",
|
|
960
|
+
"Monday",
|
|
961
|
+
"Tuesday",
|
|
962
|
+
"Wednesday",
|
|
963
|
+
"Thursday",
|
|
964
|
+
"Friday",
|
|
965
|
+
"Saturday"
|
|
966
|
+
]
|
|
967
|
+
}, qt = {
|
|
968
|
+
narrow: {
|
|
969
|
+
am: "a",
|
|
970
|
+
pm: "p",
|
|
971
|
+
midnight: "mi",
|
|
972
|
+
noon: "n",
|
|
973
|
+
morning: "morning",
|
|
974
|
+
afternoon: "afternoon",
|
|
975
|
+
evening: "evening",
|
|
976
|
+
night: "night"
|
|
977
|
+
},
|
|
978
|
+
abbreviated: {
|
|
979
|
+
am: "AM",
|
|
980
|
+
pm: "PM",
|
|
981
|
+
midnight: "midnight",
|
|
982
|
+
noon: "noon",
|
|
983
|
+
morning: "morning",
|
|
984
|
+
afternoon: "afternoon",
|
|
985
|
+
evening: "evening",
|
|
986
|
+
night: "night"
|
|
987
|
+
},
|
|
988
|
+
wide: {
|
|
989
|
+
am: "a.m.",
|
|
990
|
+
pm: "p.m.",
|
|
991
|
+
midnight: "midnight",
|
|
992
|
+
noon: "noon",
|
|
993
|
+
morning: "morning",
|
|
994
|
+
afternoon: "afternoon",
|
|
995
|
+
evening: "evening",
|
|
996
|
+
night: "night"
|
|
997
|
+
}
|
|
998
|
+
}, Gt = {
|
|
999
|
+
narrow: {
|
|
1000
|
+
am: "a",
|
|
1001
|
+
pm: "p",
|
|
1002
|
+
midnight: "mi",
|
|
1003
|
+
noon: "n",
|
|
1004
|
+
morning: "in the morning",
|
|
1005
|
+
afternoon: "in the afternoon",
|
|
1006
|
+
evening: "in the evening",
|
|
1007
|
+
night: "at night"
|
|
1008
|
+
},
|
|
1009
|
+
abbreviated: {
|
|
1010
|
+
am: "AM",
|
|
1011
|
+
pm: "PM",
|
|
1012
|
+
midnight: "midnight",
|
|
1013
|
+
noon: "noon",
|
|
1014
|
+
morning: "in the morning",
|
|
1015
|
+
afternoon: "in the afternoon",
|
|
1016
|
+
evening: "in the evening",
|
|
1017
|
+
night: "at night"
|
|
1018
|
+
},
|
|
1019
|
+
wide: {
|
|
1020
|
+
am: "a.m.",
|
|
1021
|
+
pm: "p.m.",
|
|
1022
|
+
midnight: "midnight",
|
|
1023
|
+
noon: "noon",
|
|
1024
|
+
morning: "in the morning",
|
|
1025
|
+
afternoon: "in the afternoon",
|
|
1026
|
+
evening: "in the evening",
|
|
1027
|
+
night: "at night"
|
|
1028
|
+
}
|
|
1029
|
+
}, Jt = (e, t) => {
|
|
1030
|
+
const r = Number(e), a = r % 100;
|
|
1031
|
+
if (a > 20 || a < 10)
|
|
1032
|
+
switch (a % 10) {
|
|
1033
|
+
case 1:
|
|
1034
|
+
return r + "st";
|
|
1035
|
+
case 2:
|
|
1036
|
+
return r + "nd";
|
|
1037
|
+
case 3:
|
|
1038
|
+
return r + "rd";
|
|
1039
|
+
}
|
|
1040
|
+
return r + "th";
|
|
1041
|
+
}, Ut = {
|
|
1042
|
+
ordinalNumber: Jt,
|
|
1043
|
+
era: P({
|
|
1044
|
+
values: Yt,
|
|
1045
|
+
defaultWidth: "wide"
|
|
1046
|
+
}),
|
|
1047
|
+
quarter: P({
|
|
1048
|
+
values: Vt,
|
|
1049
|
+
defaultWidth: "wide",
|
|
1050
|
+
argumentCallback: (e) => e - 1
|
|
1051
|
+
}),
|
|
1052
|
+
month: P({
|
|
1053
|
+
values: zt,
|
|
1054
|
+
defaultWidth: "wide"
|
|
1055
|
+
}),
|
|
1056
|
+
day: P({
|
|
1057
|
+
values: Xt,
|
|
1058
|
+
defaultWidth: "wide"
|
|
1059
|
+
}),
|
|
1060
|
+
dayPeriod: P({
|
|
1061
|
+
values: qt,
|
|
1062
|
+
defaultWidth: "wide",
|
|
1063
|
+
formattingValues: Gt,
|
|
1064
|
+
defaultFormattingWidth: "wide"
|
|
1065
|
+
})
|
|
1066
|
+
};
|
|
1067
|
+
function R(e) {
|
|
1068
|
+
return (t, r = {}) => {
|
|
1069
|
+
const a = r.width, o = a && e.matchPatterns[a] || e.matchPatterns[e.defaultMatchWidth], c = t.match(o);
|
|
1070
|
+
if (!c)
|
|
1071
|
+
return null;
|
|
1072
|
+
const l = c[0], i = a && e.parsePatterns[a] || e.parsePatterns[e.defaultParseWidth], u = Array.isArray(i) ? Ht(i, (v) => v.test(l)) : (
|
|
1073
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
1074
|
+
Bt(i, (v) => v.test(l))
|
|
1075
|
+
);
|
|
1076
|
+
let m;
|
|
1077
|
+
m = e.valueCallback ? e.valueCallback(u) : u, m = r.valueCallback ? (
|
|
1078
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
1079
|
+
r.valueCallback(m)
|
|
1080
|
+
) : m;
|
|
1081
|
+
const x = t.slice(l.length);
|
|
1082
|
+
return { value: m, rest: x };
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
function Bt(e, t) {
|
|
1086
|
+
for (const r in e)
|
|
1087
|
+
if (Object.prototype.hasOwnProperty.call(e, r) && t(e[r]))
|
|
1088
|
+
return r;
|
|
1089
|
+
}
|
|
1090
|
+
function Ht(e, t) {
|
|
1091
|
+
for (let r = 0; r < e.length; r++)
|
|
1092
|
+
if (t(e[r]))
|
|
1093
|
+
return r;
|
|
1094
|
+
}
|
|
1095
|
+
function Qt(e) {
|
|
1096
|
+
return (t, r = {}) => {
|
|
1097
|
+
const a = t.match(e.matchPattern);
|
|
1098
|
+
if (!a) return null;
|
|
1099
|
+
const o = a[0], c = t.match(e.parsePattern);
|
|
1100
|
+
if (!c) return null;
|
|
1101
|
+
let l = e.valueCallback ? e.valueCallback(c[0]) : c[0];
|
|
1102
|
+
l = r.valueCallback ? r.valueCallback(l) : l;
|
|
1103
|
+
const i = t.slice(o.length);
|
|
1104
|
+
return { value: l, rest: i };
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
const Zt = /^(\d+)(th|st|nd|rd)?/i, Kt = /\d+/i, en = {
|
|
1108
|
+
narrow: /^(b|a)/i,
|
|
1109
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
1110
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
1111
|
+
}, tn = {
|
|
1112
|
+
any: [/^b/i, /^(a|c)/i]
|
|
1113
|
+
}, nn = {
|
|
1114
|
+
narrow: /^[1234]/i,
|
|
1115
|
+
abbreviated: /^q[1234]/i,
|
|
1116
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1117
|
+
}, rn = {
|
|
1118
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1119
|
+
}, an = {
|
|
1120
|
+
narrow: /^[jfmasond]/i,
|
|
1121
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1122
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1123
|
+
}, sn = {
|
|
1124
|
+
narrow: [
|
|
1125
|
+
/^j/i,
|
|
1126
|
+
/^f/i,
|
|
1127
|
+
/^m/i,
|
|
1128
|
+
/^a/i,
|
|
1129
|
+
/^m/i,
|
|
1130
|
+
/^j/i,
|
|
1131
|
+
/^j/i,
|
|
1132
|
+
/^a/i,
|
|
1133
|
+
/^s/i,
|
|
1134
|
+
/^o/i,
|
|
1135
|
+
/^n/i,
|
|
1136
|
+
/^d/i
|
|
1137
|
+
],
|
|
1138
|
+
any: [
|
|
1139
|
+
/^ja/i,
|
|
1140
|
+
/^f/i,
|
|
1141
|
+
/^mar/i,
|
|
1142
|
+
/^ap/i,
|
|
1143
|
+
/^may/i,
|
|
1144
|
+
/^jun/i,
|
|
1145
|
+
/^jul/i,
|
|
1146
|
+
/^au/i,
|
|
1147
|
+
/^s/i,
|
|
1148
|
+
/^o/i,
|
|
1149
|
+
/^n/i,
|
|
1150
|
+
/^d/i
|
|
1151
|
+
]
|
|
1152
|
+
}, on = {
|
|
1153
|
+
narrow: /^[smtwf]/i,
|
|
1154
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1155
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1156
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1157
|
+
}, cn = {
|
|
1158
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1159
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1160
|
+
}, ln = {
|
|
1161
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1162
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1163
|
+
}, dn = {
|
|
1164
|
+
any: {
|
|
1165
|
+
am: /^a/i,
|
|
1166
|
+
pm: /^p/i,
|
|
1167
|
+
midnight: /^mi/i,
|
|
1168
|
+
noon: /^no/i,
|
|
1169
|
+
morning: /morning/i,
|
|
1170
|
+
afternoon: /afternoon/i,
|
|
1171
|
+
evening: /evening/i,
|
|
1172
|
+
night: /night/i
|
|
1173
|
+
}
|
|
1174
|
+
}, un = {
|
|
1175
|
+
ordinalNumber: Qt({
|
|
1176
|
+
matchPattern: Zt,
|
|
1177
|
+
parsePattern: Kt,
|
|
1178
|
+
valueCallback: (e) => parseInt(e, 10)
|
|
1179
|
+
}),
|
|
1180
|
+
era: R({
|
|
1181
|
+
matchPatterns: en,
|
|
1182
|
+
defaultMatchWidth: "wide",
|
|
1183
|
+
parsePatterns: tn,
|
|
1184
|
+
defaultParseWidth: "any"
|
|
1185
|
+
}),
|
|
1186
|
+
quarter: R({
|
|
1187
|
+
matchPatterns: nn,
|
|
1188
|
+
defaultMatchWidth: "wide",
|
|
1189
|
+
parsePatterns: rn,
|
|
1190
|
+
defaultParseWidth: "any",
|
|
1191
|
+
valueCallback: (e) => e + 1
|
|
1192
|
+
}),
|
|
1193
|
+
month: R({
|
|
1194
|
+
matchPatterns: an,
|
|
1195
|
+
defaultMatchWidth: "wide",
|
|
1196
|
+
parsePatterns: sn,
|
|
1197
|
+
defaultParseWidth: "any"
|
|
1198
|
+
}),
|
|
1199
|
+
day: R({
|
|
1200
|
+
matchPatterns: on,
|
|
1201
|
+
defaultMatchWidth: "wide",
|
|
1202
|
+
parsePatterns: cn,
|
|
1203
|
+
defaultParseWidth: "any"
|
|
1204
|
+
}),
|
|
1205
|
+
dayPeriod: R({
|
|
1206
|
+
matchPatterns: ln,
|
|
1207
|
+
defaultMatchWidth: "any",
|
|
1208
|
+
parsePatterns: dn,
|
|
1209
|
+
defaultParseWidth: "any"
|
|
1210
|
+
})
|
|
1211
|
+
}, mn = {
|
|
1212
|
+
code: "en-US",
|
|
1213
|
+
formatDistance: At,
|
|
1214
|
+
formatLong: Wt,
|
|
1215
|
+
formatRelative: Lt,
|
|
1216
|
+
localize: Ut,
|
|
1217
|
+
match: un,
|
|
1218
|
+
options: {
|
|
1219
|
+
weekStartsOn: 0,
|
|
1220
|
+
firstWeekContainsDate: 1
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
function fn(e, t, r) {
|
|
1224
|
+
const a = Nt(), o = r?.locale ?? a.locale ?? mn, c = 2520, l = I(e, t);
|
|
1225
|
+
if (isNaN(l))
|
|
1226
|
+
throw new RangeError("Invalid time value");
|
|
1227
|
+
const i = Object.assign({}, r, {
|
|
1228
|
+
addSuffix: r?.addSuffix,
|
|
1229
|
+
comparison: l
|
|
1230
|
+
});
|
|
1231
|
+
let u, m;
|
|
1232
|
+
l > 0 ? (u = p(t), m = p(e)) : (u = p(e), m = p(t));
|
|
1233
|
+
const x = Ct(m, u), v = (le(m) - le(u)) / 1e3, h = Math.round((x - v) / 60);
|
|
1234
|
+
let y;
|
|
1235
|
+
if (h < 2)
|
|
1236
|
+
return h === 0 ? o.formatDistance("lessThanXMinutes", 1, i) : o.formatDistance("xMinutes", h, i);
|
|
1237
|
+
if (h < 45)
|
|
1238
|
+
return o.formatDistance("xMinutes", h, i);
|
|
1239
|
+
if (h < 90)
|
|
1240
|
+
return o.formatDistance("aboutXHours", 1, i);
|
|
1241
|
+
if (h < ce) {
|
|
1242
|
+
const j = Math.round(h / 60);
|
|
1243
|
+
return o.formatDistance("aboutXHours", j, i);
|
|
1244
|
+
} else {
|
|
1245
|
+
if (h < c)
|
|
1246
|
+
return o.formatDistance("xDays", 1, i);
|
|
1247
|
+
if (h < O) {
|
|
1248
|
+
const j = Math.round(h / ce);
|
|
1249
|
+
return o.formatDistance("xDays", j, i);
|
|
1250
|
+
} else if (h < O * 2)
|
|
1251
|
+
return y = Math.round(h / O), o.formatDistance("aboutXMonths", y, i);
|
|
1252
|
+
}
|
|
1253
|
+
if (y = Rt(m, u), y < 12) {
|
|
1254
|
+
const j = Math.round(h / O);
|
|
1255
|
+
return o.formatDistance("xMonths", j, i);
|
|
1256
|
+
} else {
|
|
1257
|
+
const j = y % 12, M = Math.trunc(y / 12);
|
|
1258
|
+
return j < 3 ? o.formatDistance("aboutXYears", M, i) : j < 9 ? o.formatDistance("overXYears", M, i) : o.formatDistance("almostXYears", M + 1, i);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
function hn(e, t) {
|
|
1262
|
+
return fn(e, Tt(e), t);
|
|
1263
|
+
}
|
|
1264
|
+
const xn = ({ status: e, duration: t }) => {
|
|
1265
|
+
const r = J(() => e === "running" ? "info" : e === "completed" ? "success" : e === "failed" ? "error" : "default", [e]);
|
|
1266
|
+
return /* @__PURE__ */ n.jsx(fe, { variant: r, children: t && e !== "failed" ? t : e });
|
|
1267
|
+
}, pn = D(({ groups: e, selectedGroupId: t, onGroupSelect: r }) => /* @__PURE__ */ n.jsx("div", { className: "overflow-auto", children: e.length > 0 && /* @__PURE__ */ n.jsx("div", { children: [...e].reverse().map((a) => /* @__PURE__ */ n.jsx(
|
|
488
1268
|
"div",
|
|
489
1269
|
{
|
|
490
1270
|
"data-testid": `trace-${a.id}`,
|
|
491
|
-
className:
|
|
1271
|
+
className: U(
|
|
492
1272
|
"motia-trace-group cursor-pointer transition-colors",
|
|
493
|
-
|
|
1273
|
+
t === a.id ? "bg-muted-foreground/10" : "hover:bg-muted/70"
|
|
494
1274
|
),
|
|
495
|
-
onClick: () =>
|
|
496
|
-
children: /* @__PURE__ */
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
/* @__PURE__ */
|
|
500
|
-
|
|
1275
|
+
onClick: () => r(a),
|
|
1276
|
+
children: /* @__PURE__ */ n.jsxs("div", { className: "p-3 flex flex-col gap-1", children: [
|
|
1277
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex flex-row justify-between items-center gap-2", children: [
|
|
1278
|
+
/* @__PURE__ */ n.jsx("span", { className: "font-semibold text-lg", children: a.name }),
|
|
1279
|
+
/* @__PURE__ */ n.jsx(
|
|
1280
|
+
xn,
|
|
501
1281
|
{
|
|
502
1282
|
status: a.status,
|
|
503
|
-
duration: a.endTime ?
|
|
1283
|
+
duration: a.endTime ? k(a.endTime - a.startTime) : void 0
|
|
504
1284
|
}
|
|
505
1285
|
)
|
|
506
1286
|
] }),
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
/* @__PURE__ */
|
|
1287
|
+
/* @__PURE__ */ n.jsxs("div", { className: "text-xs text-muted-foreground space-y-1", children: [
|
|
1288
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex justify-between", children: [
|
|
1289
|
+
/* @__PURE__ */ n.jsx("div", { "data-testid": "trace-id", className: "text-xs text-muted-foreground font-mono tracking-[1px]", children: a.id }),
|
|
1290
|
+
/* @__PURE__ */ n.jsxs("span", { children: [
|
|
511
1291
|
a.metadata.totalSteps,
|
|
512
1292
|
" steps"
|
|
513
1293
|
] })
|
|
514
1294
|
] }),
|
|
515
|
-
/* @__PURE__ */
|
|
516
|
-
|
|
1295
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex justify-between", children: [
|
|
1296
|
+
hn(a.startTime),
|
|
517
1297
|
" ago"
|
|
518
1298
|
] }),
|
|
519
|
-
a.metadata.activeSteps > 0 && /* @__PURE__ */
|
|
1299
|
+
a.metadata.activeSteps > 0 && /* @__PURE__ */ n.jsxs("div", { className: "text-blue-600", children: [
|
|
520
1300
|
a.metadata.activeSteps,
|
|
521
1301
|
" active"
|
|
522
1302
|
] })
|
|
@@ -524,65 +1304,65 @@ const _ = ye()((r) => ({
|
|
|
524
1304
|
] })
|
|
525
1305
|
},
|
|
526
1306
|
a.id
|
|
527
|
-
)) }) })),
|
|
528
|
-
const
|
|
529
|
-
() =>
|
|
530
|
-
(
|
|
1307
|
+
)) }) })), jn = () => {
|
|
1308
|
+
const e = F((u) => u.selectedTraceGroupId), t = F((u) => u.selectTraceGroupId), { data: r } = me({ streamName: "motia-trace-group", groupId: "default" }), a = (u) => t(u.id), [o, c] = G(""), l = () => fetch("/__motia/trace/clear", { method: "POST" }), i = J(
|
|
1309
|
+
() => r?.filter(
|
|
1310
|
+
(u) => u.name.toLowerCase().includes(o.toLowerCase()) || u.id.toLowerCase().includes(o.toLowerCase())
|
|
531
1311
|
),
|
|
532
|
-
[
|
|
1312
|
+
[r, o]
|
|
533
1313
|
);
|
|
534
|
-
return
|
|
535
|
-
if (
|
|
536
|
-
const
|
|
537
|
-
|
|
538
|
-
} else
|
|
539
|
-
}, [
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
/* @__PURE__ */
|
|
543
|
-
|
|
1314
|
+
return ue(() => {
|
|
1315
|
+
if (i && i.length > 0) {
|
|
1316
|
+
const u = i[i.length - 1];
|
|
1317
|
+
u && u.status === "running" && u.id !== e && t(u.id);
|
|
1318
|
+
} else e && t(void 0);
|
|
1319
|
+
}, [i]), /* @__PURE__ */ n.jsxs("div", { className: "grid grid-rows-[auto_1fr] h-full", children: [
|
|
1320
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex p-2 border-b gap-2", "data-testid": "logs-search-container", children: [
|
|
1321
|
+
/* @__PURE__ */ n.jsxs("div", { className: "flex-1 relative", children: [
|
|
1322
|
+
/* @__PURE__ */ n.jsx(
|
|
1323
|
+
Ce,
|
|
544
1324
|
{
|
|
545
1325
|
variant: "shade",
|
|
546
1326
|
value: o,
|
|
547
|
-
onChange: (
|
|
1327
|
+
onChange: (u) => c(u.target.value),
|
|
548
1328
|
className: "px-9 font-medium",
|
|
549
1329
|
placeholder: "Search by Trace ID or Step Name"
|
|
550
1330
|
}
|
|
551
1331
|
),
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
|
|
1332
|
+
/* @__PURE__ */ n.jsx(nt, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50" }),
|
|
1333
|
+
/* @__PURE__ */ n.jsx(
|
|
1334
|
+
xe,
|
|
555
1335
|
{
|
|
556
|
-
className:
|
|
1336
|
+
className: U(
|
|
557
1337
|
"cursor-pointer absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/50 hover:text-muted-foreground",
|
|
558
1338
|
{
|
|
559
1339
|
visible: o !== "",
|
|
560
1340
|
invisible: o === ""
|
|
561
1341
|
}
|
|
562
1342
|
),
|
|
563
|
-
onClick: () =>
|
|
1343
|
+
onClick: () => c("")
|
|
564
1344
|
}
|
|
565
1345
|
)
|
|
566
1346
|
] }),
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
/* @__PURE__ */
|
|
1347
|
+
/* @__PURE__ */ n.jsxs(q, { variant: "default", onClick: l, className: "h-[34px]", children: [
|
|
1348
|
+
/* @__PURE__ */ n.jsx(at, {}),
|
|
569
1349
|
" Clear"
|
|
570
1350
|
] })
|
|
571
1351
|
] }),
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
-
|
|
576
|
-
!
|
|
1352
|
+
/* @__PURE__ */ n.jsxs("div", { className: "grid grid-cols-[300px_1fr] overflow-hidden", children: [
|
|
1353
|
+
/* @__PURE__ */ n.jsx("div", { className: "w-[300px] border-r border-border overflow-auto h-full", "data-testid": "traces-container", children: /* @__PURE__ */ n.jsx(pn, { groups: i, selectedGroupId: e, onGroupSelect: a }) }),
|
|
1354
|
+
/* @__PURE__ */ n.jsxs("div", { className: "overflow-auto", "data-testid": "trace-details", children: [
|
|
1355
|
+
e && /* @__PURE__ */ n.jsx(yt, { groupId: e }),
|
|
1356
|
+
!e && /* @__PURE__ */ n.jsx("div", { className: "flex items-center justify-center h-full text-muted-foreground", children: "Select a trace or trace group to view the timeline" })
|
|
577
1357
|
] })
|
|
578
1358
|
] })
|
|
579
1359
|
] });
|
|
580
|
-
},
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
1360
|
+
}, bn = D(() => /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
1361
|
+
/* @__PURE__ */ n.jsx(Ve, { "aria-hidden": "true" }),
|
|
1362
|
+
/* @__PURE__ */ n.jsx("span", { children: "Tracing" })
|
|
583
1363
|
] }));
|
|
584
|
-
|
|
1364
|
+
bn.displayName = "ObservabilityTabLabel";
|
|
585
1365
|
export {
|
|
586
|
-
|
|
587
|
-
|
|
1366
|
+
jn as ObservabilityPage,
|
|
1367
|
+
bn as ObservabilityTabLabel
|
|
588
1368
|
};
|