react-semaphor 0.1.386 → 0.1.387
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/DATA_APP_SDK.md +67 -0
- package/dist/data-app-sdk/index.cjs +5 -5
- package/dist/data-app-sdk/index.js +1167 -1122
- package/dist/types/data-app-sdk.d.ts +6 -0
- package/package.json +1 -1
- package/src/data-app-sdk/README.md +67 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { toSemaphorInputSnapshots as
|
|
2
|
-
import { jsxs as p, Fragment as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { M as
|
|
5
|
-
import { X as
|
|
6
|
-
import { b as
|
|
1
|
+
import { toSemaphorInputSnapshots as Rt, toSemaphorInputBinding as Et, toSemaphorActiveInputSnapshots as U, toSemaphorMatrixIntent as kt, toSemaphorSqlIntent as Ct, toSemaphorInputOptionsIntent as Dt, toSemaphorRecordsIntent as Lt, toSemaphorAnalysisQueryOptions as Ot, toSemaphorAnalysisIntent as Bt, toSemaphorMetricIntent as Kt, hasSemaphorInputValue as re, normalizeSemaphorInputOptions as tt, toSemaphorInputSpec as rt } from "../data-app-sdk-adapters/index.js";
|
|
2
|
+
import { jsxs as p, Fragment as $t, jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as pe, useContext as z, useState as Q, useRef as C, useEffect as B, useMemo as b, useId as nt, useCallback as D, useReducer as _t } from "react";
|
|
4
|
+
import { M as Nt, a as Ft, S as Wt, E as Mt } from "../chunks/search-0LmWwZzW.js";
|
|
5
|
+
import { X as zt, j as jt } from "../chunks/x-IdR_js6f.js";
|
|
6
|
+
import { b as Ht } from "../chunks/validators-CHPH6ORs.js";
|
|
7
7
|
import "../chunks/analyze-result-contract-DuhlklhI.js";
|
|
8
|
-
function
|
|
8
|
+
function oe(e, t, r = {}) {
|
|
9
9
|
return {
|
|
10
|
-
...
|
|
10
|
+
...r,
|
|
11
11
|
name: e,
|
|
12
|
-
role:
|
|
12
|
+
role: t
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function Qn(e) {
|
|
16
16
|
return e;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Un(e) {
|
|
19
19
|
return e;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const Gn = {
|
|
22
22
|
source: {
|
|
23
23
|
semantic(e) {
|
|
24
24
|
return {
|
|
@@ -34,17 +34,17 @@ const jn = {
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
field: {
|
|
37
|
-
measure(e,
|
|
38
|
-
return
|
|
37
|
+
measure(e, t) {
|
|
38
|
+
return oe(e, "measure", t);
|
|
39
39
|
},
|
|
40
|
-
dimension(e,
|
|
41
|
-
return
|
|
40
|
+
dimension(e, t) {
|
|
41
|
+
return oe(e, "dimension", t);
|
|
42
42
|
},
|
|
43
|
-
date(e,
|
|
44
|
-
return
|
|
43
|
+
date(e, t) {
|
|
44
|
+
return oe(e, "date", t);
|
|
45
45
|
},
|
|
46
|
-
id(e,
|
|
47
|
-
return
|
|
46
|
+
id(e, t) {
|
|
47
|
+
return oe(e, "id", t);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
filter(e) {
|
|
@@ -53,15 +53,15 @@ const jn = {
|
|
|
53
53
|
kind: "filter"
|
|
54
54
|
};
|
|
55
55
|
},
|
|
56
|
-
bindInput(e,
|
|
56
|
+
bindInput(e, t) {
|
|
57
57
|
return {
|
|
58
58
|
toAnalyticsInput() {
|
|
59
|
-
const [
|
|
60
|
-
...
|
|
61
|
-
inputId:
|
|
59
|
+
const [r] = Rt([e]), n = Et({
|
|
60
|
+
...t,
|
|
61
|
+
inputId: t.inputId || r.inputId
|
|
62
62
|
});
|
|
63
63
|
return {
|
|
64
|
-
...
|
|
64
|
+
...r,
|
|
65
65
|
inputId: n.inputId,
|
|
66
66
|
...n.kind ? { kind: n.kind } : {},
|
|
67
67
|
...n.controlRole ? { controlRole: n.controlRole } : {},
|
|
@@ -128,144 +128,144 @@ const jn = {
|
|
|
128
128
|
queryKind: "matrix"
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
},
|
|
131
|
+
}, he = 10, ve = 100, Pt = 25, Vt = 500, it = {
|
|
132
132
|
enabled: !1,
|
|
133
133
|
queries: [],
|
|
134
134
|
getQuery: () => {
|
|
135
135
|
},
|
|
136
136
|
getQueries: () => []
|
|
137
|
-
},
|
|
137
|
+
}, ke = pe(null), Ce = pe(null), De = pe(
|
|
138
138
|
void 0
|
|
139
|
-
),
|
|
140
|
-
function
|
|
139
|
+
), M = [];
|
|
140
|
+
function Qt({
|
|
141
141
|
debug: e,
|
|
142
|
-
children:
|
|
142
|
+
children: t
|
|
143
143
|
}) {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
),
|
|
149
|
-
|
|
150
|
-
i({ type: "config", config:
|
|
151
|
-
}, [
|
|
144
|
+
const r = b(() => Vr(e), [e]), [n, i] = _t(
|
|
145
|
+
$r,
|
|
146
|
+
r,
|
|
147
|
+
yt
|
|
148
|
+
), o = C(n), u = nt(), [c, d] = Q({ open: !1 });
|
|
149
|
+
o.current = n, B(() => {
|
|
150
|
+
i({ type: "config", config: r });
|
|
151
|
+
}, [r]), B(() => {
|
|
152
152
|
if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
|
|
153
153
|
return;
|
|
154
|
-
const S =
|
|
155
|
-
return
|
|
154
|
+
const S = zr(() => o.current);
|
|
155
|
+
return Ut({
|
|
156
156
|
ownerId: u,
|
|
157
157
|
bridge: S
|
|
158
158
|
}), () => {
|
|
159
|
-
|
|
159
|
+
Gt(u);
|
|
160
160
|
};
|
|
161
161
|
}, [u, n.enabled, n.exposeWindowBridge]);
|
|
162
|
-
const f = b(() => ({ state: n, dispatch: i }), [n]),
|
|
162
|
+
const f = b(() => ({ state: n, dispatch: i }), [n]), y = D((S) => {
|
|
163
163
|
d({ open: !0, focus: S });
|
|
164
|
-
}, []),
|
|
164
|
+
}, []), g = D(() => {
|
|
165
165
|
d((S) => ({ ...S, open: !1 }));
|
|
166
|
-
}, []), h =
|
|
166
|
+
}, []), h = D((S) => {
|
|
167
167
|
d({ open: !0, focus: S });
|
|
168
168
|
}, []), m = b(
|
|
169
169
|
() => ({
|
|
170
170
|
open: c.open,
|
|
171
171
|
focus: c.focus,
|
|
172
|
-
openDevtools:
|
|
173
|
-
closeDevtools:
|
|
172
|
+
openDevtools: y,
|
|
173
|
+
closeDevtools: g,
|
|
174
174
|
focusTrace: h
|
|
175
175
|
}),
|
|
176
176
|
[
|
|
177
|
-
y,
|
|
178
|
-
h,
|
|
179
177
|
g,
|
|
178
|
+
h,
|
|
179
|
+
y,
|
|
180
180
|
c.focus,
|
|
181
181
|
c.open
|
|
182
182
|
]
|
|
183
183
|
);
|
|
184
|
-
return /* @__PURE__ */ s(
|
|
184
|
+
return /* @__PURE__ */ s(ke.Provider, { value: f, children: /* @__PURE__ */ s(Ce.Provider, { value: m, children: t }) });
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
const
|
|
188
|
-
(
|
|
186
|
+
function Ut(e) {
|
|
187
|
+
const t = M.findIndex(
|
|
188
|
+
(r) => r.ownerId === e.ownerId
|
|
189
189
|
);
|
|
190
|
-
|
|
190
|
+
t >= 0 && M.splice(t, 1), M.push(e), ot();
|
|
191
191
|
}
|
|
192
|
-
function
|
|
193
|
-
const
|
|
194
|
-
(
|
|
192
|
+
function Gt(e) {
|
|
193
|
+
const t = M.findIndex(
|
|
194
|
+
(r) => r.ownerId === e
|
|
195
195
|
);
|
|
196
|
-
|
|
196
|
+
t >= 0 && M.splice(t, 1), ot();
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function ot() {
|
|
199
199
|
if (typeof window > "u")
|
|
200
200
|
return;
|
|
201
|
-
const e =
|
|
201
|
+
const e = M[M.length - 1];
|
|
202
202
|
e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function Jn({
|
|
205
205
|
id: e,
|
|
206
|
-
title:
|
|
207
|
-
children:
|
|
206
|
+
title: t,
|
|
207
|
+
children: r
|
|
208
208
|
}) {
|
|
209
|
-
const n = b(() => ({ id: e, title:
|
|
210
|
-
return /* @__PURE__ */ s(
|
|
209
|
+
const n = b(() => ({ id: e, title: t }), [e, t]);
|
|
210
|
+
return /* @__PURE__ */ s(De.Provider, { value: n, children: r });
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function Jt({
|
|
213
213
|
buttonPosition: e = "bottom-right",
|
|
214
|
-
initialIsOpen:
|
|
215
|
-
panelPosition:
|
|
214
|
+
initialIsOpen: t = !1,
|
|
215
|
+
panelPosition: r = "right",
|
|
216
216
|
className: n,
|
|
217
217
|
style: i
|
|
218
218
|
} = {}) {
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}, []),
|
|
223
|
-
|
|
224
|
-
}, [
|
|
225
|
-
if (!
|
|
219
|
+
const o = st(), u = z(Ce), [c, d] = Q(""), [f, y] = Q(!1), g = C(null), h = C(null), m = u == null ? void 0 : u.openDevtools, S = u == null ? void 0 : u.closeDevtools, T = (u == null ? void 0 : u.open) === !0;
|
|
220
|
+
B(() => {
|
|
221
|
+
mt();
|
|
222
|
+
}, []), B(() => {
|
|
223
|
+
t && o.enabled && (m == null || m());
|
|
224
|
+
}, [t, o.enabled, m]), B(() => {
|
|
225
|
+
if (!T || !S)
|
|
226
226
|
return;
|
|
227
227
|
const v = (I) => {
|
|
228
|
-
var
|
|
229
|
-
const
|
|
230
|
-
|
|
228
|
+
var R, O;
|
|
229
|
+
const L = I.target;
|
|
230
|
+
L instanceof Node && ((R = g.current) != null && R.contains(L) || (O = h.current) != null && O.contains(L) || S());
|
|
231
231
|
};
|
|
232
232
|
return document.addEventListener("pointerdown", v, !0), document.addEventListener("mousedown", v, !0), document.addEventListener("click", v, !0), () => {
|
|
233
233
|
document.removeEventListener("pointerdown", v, !0), document.removeEventListener("mousedown", v, !0), document.removeEventListener("click", v, !0);
|
|
234
234
|
};
|
|
235
|
-
}, [S,
|
|
236
|
-
const
|
|
237
|
-
() =>
|
|
238
|
-
[
|
|
239
|
-
),
|
|
240
|
-
() =>
|
|
241
|
-
[
|
|
242
|
-
),
|
|
243
|
-
() =>
|
|
244
|
-
[
|
|
245
|
-
),
|
|
246
|
-
() =>
|
|
247
|
-
[
|
|
235
|
+
}, [S, T]);
|
|
236
|
+
const a = b(
|
|
237
|
+
() => ar(o.queries),
|
|
238
|
+
[o.queries]
|
|
239
|
+
), w = b(
|
|
240
|
+
() => lr(o.queries, c),
|
|
241
|
+
[o.queries, c]
|
|
242
|
+
), K = b(
|
|
243
|
+
() => ur(w),
|
|
244
|
+
[w]
|
|
245
|
+
), E = b(
|
|
246
|
+
() => at(w, u == null ? void 0 : u.focus) || w[0],
|
|
247
|
+
[w, u == null ? void 0 : u.focus]
|
|
248
248
|
);
|
|
249
|
-
return !
|
|
249
|
+
return !o.enabled || !u ? null : /* @__PURE__ */ p($t, { children: [
|
|
250
250
|
/* @__PURE__ */ p(
|
|
251
251
|
"button",
|
|
252
252
|
{
|
|
253
|
-
ref:
|
|
253
|
+
ref: g,
|
|
254
254
|
type: "button",
|
|
255
255
|
"aria-label": "Open Semaphor DevTools",
|
|
256
256
|
title: "Open Semaphor DevTools",
|
|
257
257
|
className: n ? `${$} ${n}` : $,
|
|
258
258
|
style: {
|
|
259
|
-
...
|
|
260
|
-
...
|
|
261
|
-
...
|
|
259
|
+
...l.launcher,
|
|
260
|
+
...kr(e),
|
|
261
|
+
...Cr(a.severity),
|
|
262
262
|
...i
|
|
263
263
|
},
|
|
264
264
|
onClick: () => u.openDevtools(),
|
|
265
265
|
children: [
|
|
266
|
-
/* @__PURE__ */ s(
|
|
267
|
-
/* @__PURE__ */ s("span", { style:
|
|
268
|
-
|
|
266
|
+
/* @__PURE__ */ s(Xt, {}),
|
|
267
|
+
/* @__PURE__ */ s("span", { style: l.launcherText, children: a.total }),
|
|
268
|
+
a.issueCount > 0 ? /* @__PURE__ */ s("span", { style: l.launcherIssueCount, children: a.issueCount }) : null
|
|
269
269
|
]
|
|
270
270
|
}
|
|
271
271
|
),
|
|
@@ -278,34 +278,34 @@ function Qr({
|
|
|
278
278
|
"aria-modal": "false",
|
|
279
279
|
className: $,
|
|
280
280
|
style: {
|
|
281
|
-
...
|
|
282
|
-
...
|
|
283
|
-
...f ?
|
|
281
|
+
...l.panel,
|
|
282
|
+
...Dr(r),
|
|
283
|
+
...f ? l.panelFullscreen : null
|
|
284
284
|
},
|
|
285
285
|
children: [
|
|
286
|
-
/* @__PURE__ */ p("div", { style:
|
|
287
|
-
/* @__PURE__ */ p("div", { style:
|
|
288
|
-
/* @__PURE__ */ s("div", { style:
|
|
289
|
-
/* @__PURE__ */ p("div", { style:
|
|
290
|
-
|
|
286
|
+
/* @__PURE__ */ p("div", { style: l.panelHeader, children: [
|
|
287
|
+
/* @__PURE__ */ p("div", { style: l.panelTitleBlock, children: [
|
|
288
|
+
/* @__PURE__ */ s("div", { style: l.panelTitle, children: "Semaphor DevTools" }),
|
|
289
|
+
/* @__PURE__ */ p("div", { style: l.panelSubtitle, children: [
|
|
290
|
+
a.total,
|
|
291
291
|
" queries · ",
|
|
292
|
-
|
|
292
|
+
a.loading,
|
|
293
293
|
" loading ·",
|
|
294
294
|
" ",
|
|
295
|
-
|
|
295
|
+
a.failed,
|
|
296
296
|
" failed"
|
|
297
297
|
] })
|
|
298
298
|
] }),
|
|
299
|
-
/* @__PURE__ */ p("div", { style:
|
|
299
|
+
/* @__PURE__ */ p("div", { style: l.panelActions, children: [
|
|
300
300
|
/* @__PURE__ */ s(
|
|
301
301
|
"button",
|
|
302
302
|
{
|
|
303
303
|
type: "button",
|
|
304
304
|
"aria-label": f ? "Exit fullscreen Semaphor DevTools" : "Enter fullscreen Semaphor DevTools",
|
|
305
305
|
title: f ? "Exit fullscreen Semaphor DevTools" : "Enter fullscreen Semaphor DevTools",
|
|
306
|
-
style:
|
|
307
|
-
onClick: () =>
|
|
308
|
-
children: f ? /* @__PURE__ */ s(
|
|
306
|
+
style: l.iconButton,
|
|
307
|
+
onClick: () => y((v) => !v),
|
|
308
|
+
children: f ? /* @__PURE__ */ s(Nt, { size: 15 }) : /* @__PURE__ */ s(Ft, { size: 15 })
|
|
309
309
|
}
|
|
310
310
|
),
|
|
311
311
|
/* @__PURE__ */ s(
|
|
@@ -313,15 +313,15 @@ function Qr({
|
|
|
313
313
|
{
|
|
314
314
|
type: "button",
|
|
315
315
|
"aria-label": "Close Semaphor DevTools",
|
|
316
|
-
style:
|
|
316
|
+
style: l.iconButton,
|
|
317
317
|
onClick: u.closeDevtools,
|
|
318
|
-
children: /* @__PURE__ */ s(
|
|
318
|
+
children: /* @__PURE__ */ s(zt, { size: 15 })
|
|
319
319
|
}
|
|
320
320
|
)
|
|
321
321
|
] })
|
|
322
322
|
] }),
|
|
323
|
-
/* @__PURE__ */ p("label", { style:
|
|
324
|
-
/* @__PURE__ */ s(
|
|
323
|
+
/* @__PURE__ */ p("label", { style: l.searchBox, children: [
|
|
324
|
+
/* @__PURE__ */ s(Wt, { size: 14 }),
|
|
325
325
|
/* @__PURE__ */ s(
|
|
326
326
|
"input",
|
|
327
327
|
{
|
|
@@ -329,7 +329,7 @@ function Qr({
|
|
|
329
329
|
value: c,
|
|
330
330
|
onChange: (v) => d(v.currentTarget.value),
|
|
331
331
|
placeholder: "Search traces",
|
|
332
|
-
style:
|
|
332
|
+
style: l.searchInput
|
|
333
333
|
}
|
|
334
334
|
)
|
|
335
335
|
] }),
|
|
@@ -337,34 +337,34 @@ function Qr({
|
|
|
337
337
|
"div",
|
|
338
338
|
{
|
|
339
339
|
style: {
|
|
340
|
-
...
|
|
341
|
-
...
|
|
340
|
+
...l.panelBody,
|
|
341
|
+
...Lr(r)
|
|
342
342
|
},
|
|
343
343
|
children: [
|
|
344
344
|
/* @__PURE__ */ s(
|
|
345
345
|
"div",
|
|
346
346
|
{
|
|
347
347
|
style: {
|
|
348
|
-
...
|
|
349
|
-
...
|
|
348
|
+
...l.queryList,
|
|
349
|
+
...Or()
|
|
350
350
|
},
|
|
351
351
|
"aria-label": "Registered queries",
|
|
352
|
-
children:
|
|
353
|
-
/* @__PURE__ */ p("div", { style:
|
|
352
|
+
children: w.length ? K.map((v) => /* @__PURE__ */ p("div", { style: l.queryGroup, children: [
|
|
353
|
+
/* @__PURE__ */ p("div", { style: l.queryGroupHeader, children: [
|
|
354
354
|
/* @__PURE__ */ s("span", { children: v.title }),
|
|
355
|
-
/* @__PURE__ */ s("span", { style:
|
|
355
|
+
/* @__PURE__ */ s("span", { style: l.queryGroupCount, children: v.traces.length })
|
|
356
356
|
] }),
|
|
357
357
|
v.traces.length ? v.traces.map((I) => {
|
|
358
|
-
var
|
|
359
|
-
const
|
|
358
|
+
var J;
|
|
359
|
+
const L = cr(I, E), R = Le(I), O = ut(I), x = lt(I), k = me(I);
|
|
360
360
|
return /* @__PURE__ */ p(
|
|
361
361
|
"button",
|
|
362
362
|
{
|
|
363
363
|
type: "button",
|
|
364
|
-
title: `${
|
|
364
|
+
title: `${R} · ${O} · ${k}`,
|
|
365
365
|
style: {
|
|
366
|
-
...
|
|
367
|
-
...
|
|
366
|
+
...l.queryListItem,
|
|
367
|
+
...L ? l.queryListItemSelected : null
|
|
368
368
|
},
|
|
369
369
|
onClick: () => u.focusTrace({
|
|
370
370
|
traceId: I.traceId,
|
|
@@ -372,29 +372,38 @@ function Qr({
|
|
|
372
372
|
viewId: I.viewId
|
|
373
373
|
}),
|
|
374
374
|
children: [
|
|
375
|
-
/* @__PURE__ */ p("span", { style:
|
|
376
|
-
/* @__PURE__ */ s(
|
|
377
|
-
/* @__PURE__ */ s("span", { style:
|
|
378
|
-
/* @__PURE__ */ s("span", { style:
|
|
375
|
+
/* @__PURE__ */ p("span", { style: l.queryListItemHeader, children: [
|
|
376
|
+
/* @__PURE__ */ s(er, { status: (J = I.latestAttempt) == null ? void 0 : J.status }),
|
|
377
|
+
/* @__PURE__ */ s("span", { style: l.queryListTitle, title: R, children: R }),
|
|
378
|
+
/* @__PURE__ */ s("span", { style: l.queryListKindChip, children: O })
|
|
379
379
|
] }),
|
|
380
380
|
/* @__PURE__ */ s(
|
|
381
381
|
"span",
|
|
382
382
|
{
|
|
383
383
|
className: `${$}-source`,
|
|
384
|
-
style:
|
|
385
|
-
title:
|
|
386
|
-
children:
|
|
384
|
+
style: l.queryListSource,
|
|
385
|
+
title: `${x} · ${k}`,
|
|
386
|
+
children: x
|
|
387
|
+
}
|
|
388
|
+
),
|
|
389
|
+
/* @__PURE__ */ s(
|
|
390
|
+
"span",
|
|
391
|
+
{
|
|
392
|
+
className: `${$}-source`,
|
|
393
|
+
style: l.queryListSourceSecondary,
|
|
394
|
+
title: k,
|
|
395
|
+
children: k
|
|
387
396
|
}
|
|
388
397
|
)
|
|
389
398
|
]
|
|
390
399
|
},
|
|
391
400
|
Re(I)
|
|
392
401
|
);
|
|
393
|
-
}) : /* @__PURE__ */ s("div", { style:
|
|
394
|
-
] }, v.title)) : /* @__PURE__ */ s("div", { style:
|
|
402
|
+
}) : /* @__PURE__ */ s("div", { style: l.queryGroupEmpty, children: "No input traces" })
|
|
403
|
+
] }, v.title)) : /* @__PURE__ */ s("div", { style: l.emptyState, children: "No matching traces" })
|
|
395
404
|
}
|
|
396
405
|
),
|
|
397
|
-
/* @__PURE__ */ s(
|
|
406
|
+
/* @__PURE__ */ s(Zt, { trace: E })
|
|
398
407
|
]
|
|
399
408
|
}
|
|
400
409
|
)
|
|
@@ -403,42 +412,42 @@ function Qr({
|
|
|
403
412
|
) : null
|
|
404
413
|
] });
|
|
405
414
|
}
|
|
406
|
-
function
|
|
415
|
+
function Yn({
|
|
407
416
|
queryId: e,
|
|
408
|
-
viewId:
|
|
409
|
-
label:
|
|
417
|
+
viewId: t,
|
|
418
|
+
label: r,
|
|
410
419
|
className: n,
|
|
411
420
|
style: i
|
|
412
421
|
} = {}) {
|
|
413
|
-
var
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
|
|
422
|
+
var g, h;
|
|
423
|
+
const o = st(), u = z(Ce), c = z(De);
|
|
424
|
+
B(() => {
|
|
425
|
+
mt();
|
|
417
426
|
}, []);
|
|
418
|
-
const d =
|
|
419
|
-
() =>
|
|
427
|
+
const d = t || (c == null ? void 0 : c.id), f = b(
|
|
428
|
+
() => dr(o.queries, {
|
|
420
429
|
queryId: e,
|
|
421
430
|
viewId: d
|
|
422
431
|
}),
|
|
423
432
|
[
|
|
424
|
-
|
|
433
|
+
o.queries,
|
|
425
434
|
e,
|
|
426
435
|
d
|
|
427
436
|
]
|
|
428
437
|
);
|
|
429
|
-
if (!
|
|
438
|
+
if (!o.enabled || !u || !f)
|
|
430
439
|
return null;
|
|
431
|
-
const
|
|
440
|
+
const y = r || `Inspect ${pr(f, !!e)}`;
|
|
432
441
|
return /* @__PURE__ */ p(
|
|
433
442
|
"button",
|
|
434
443
|
{
|
|
435
444
|
type: "button",
|
|
436
|
-
"aria-label":
|
|
437
|
-
title:
|
|
445
|
+
"aria-label": y,
|
|
446
|
+
title: y,
|
|
438
447
|
className: n ? `${$} ${n}` : $,
|
|
439
448
|
style: {
|
|
440
|
-
...
|
|
441
|
-
...
|
|
449
|
+
...l.inspectButton,
|
|
450
|
+
...Br((g = f.latestAttempt) == null ? void 0 : g.status),
|
|
442
451
|
...i
|
|
443
452
|
},
|
|
444
453
|
onClick: () => u.openDevtools({
|
|
@@ -447,25 +456,25 @@ function Pn({
|
|
|
447
456
|
viewId: f.viewId
|
|
448
457
|
}),
|
|
449
458
|
children: [
|
|
450
|
-
/* @__PURE__ */ s(
|
|
451
|
-
/* @__PURE__ */ s("span", { style:
|
|
459
|
+
/* @__PURE__ */ s(Mt, { size: 13 }),
|
|
460
|
+
/* @__PURE__ */ s("span", { style: l.inspectButtonText, children: ((h = f.latestAttempt) == null ? void 0 : h.status) || "idle" })
|
|
452
461
|
]
|
|
453
462
|
}
|
|
454
463
|
);
|
|
455
464
|
}
|
|
456
|
-
function
|
|
457
|
-
const e = z(
|
|
458
|
-
return !e || !e.state.enabled ?
|
|
465
|
+
function st() {
|
|
466
|
+
const e = z(ke);
|
|
467
|
+
return !e || !e.state.enabled ? it : ce(e.state);
|
|
459
468
|
}
|
|
460
|
-
function
|
|
469
|
+
function Yt({
|
|
461
470
|
spec: e,
|
|
462
|
-
queryKind:
|
|
463
|
-
queryKey:
|
|
471
|
+
queryKind: t,
|
|
472
|
+
queryKey: r,
|
|
464
473
|
intent: n,
|
|
465
474
|
activeInputs: i,
|
|
466
|
-
debug:
|
|
475
|
+
debug: o
|
|
467
476
|
}) {
|
|
468
|
-
const u = z(
|
|
477
|
+
const u = z(ke), c = z(De), d = !!(u != null && u.state.enabled), f = u == null ? void 0 : u.dispatch, y = Qr(e), g = e.label, h = b(
|
|
469
478
|
() => JSON.stringify(e),
|
|
470
479
|
[e]
|
|
471
480
|
), m = b(
|
|
@@ -474,159 +483,163 @@ function Ur({
|
|
|
474
483
|
), S = b(
|
|
475
484
|
() => JSON.stringify(n || null),
|
|
476
485
|
[n]
|
|
477
|
-
),
|
|
478
|
-
|
|
479
|
-
const I =
|
|
480
|
-
() =>
|
|
481
|
-
[
|
|
482
|
-
),
|
|
483
|
-
() =>
|
|
486
|
+
), T = C(e), a = C(h), w = C(n), K = C(S), E = C(i), v = C(m);
|
|
487
|
+
a.current !== h && (a.current = h, T.current = e), K.current !== S && (K.current = S, w.current = n), v.current !== m && (v.current = m, E.current = i);
|
|
488
|
+
const I = T.current, L = w.current, R = E.current, O = nt(), x = b(
|
|
489
|
+
() => y || `query_${St(r)}`,
|
|
490
|
+
[r, y]
|
|
491
|
+
), k = (o == null ? void 0 : o.viewId) || (c == null ? void 0 : c.id), J = (o == null ? void 0 : o.viewTitle) || (o == null ? void 0 : o.title) || (c == null ? void 0 : c.title), $e = o == null ? void 0 : o.visualType, _e = o == null ? void 0 : o.sectionTitle, At = JSON.stringify(Qe(o) || []), Ne = b(
|
|
492
|
+
() => Qe(o),
|
|
484
493
|
// Keep inline debug={{ sourceHint: ... }} objects from re-registering every render.
|
|
485
494
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
486
|
-
[
|
|
495
|
+
[At]
|
|
487
496
|
), F = b(
|
|
488
497
|
() => [
|
|
489
|
-
|
|
490
|
-
|
|
498
|
+
k || "unscoped-view",
|
|
499
|
+
x,
|
|
491
500
|
O
|
|
492
501
|
].join("::"),
|
|
493
|
-
[
|
|
494
|
-
),
|
|
502
|
+
[x, O, k]
|
|
503
|
+
), Fe = b(
|
|
495
504
|
() => ({
|
|
496
505
|
traceKey: F,
|
|
497
506
|
spec: I,
|
|
498
|
-
queryId:
|
|
499
|
-
queryLabel:
|
|
500
|
-
queryKind:
|
|
501
|
-
builder:
|
|
502
|
-
viewId:
|
|
503
|
-
viewTitle:
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
507
|
+
queryId: x,
|
|
508
|
+
queryLabel: g,
|
|
509
|
+
queryKind: t,
|
|
510
|
+
builder: Ur(t),
|
|
511
|
+
viewId: k,
|
|
512
|
+
viewTitle: J,
|
|
513
|
+
visualType: $e,
|
|
514
|
+
sectionTitle: _e,
|
|
515
|
+
sourceHints: Ne,
|
|
516
|
+
intent: L,
|
|
517
|
+
activeInputs: R,
|
|
518
|
+
clientWarnings: y ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
|
|
508
519
|
}),
|
|
509
520
|
[
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
g,
|
|
521
|
+
x,
|
|
522
|
+
t,
|
|
513
523
|
y,
|
|
524
|
+
g,
|
|
514
525
|
I,
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
526
|
+
R,
|
|
527
|
+
L,
|
|
528
|
+
Ne,
|
|
529
|
+
_e,
|
|
518
530
|
F,
|
|
519
|
-
|
|
520
|
-
|
|
531
|
+
k,
|
|
532
|
+
J,
|
|
533
|
+
$e
|
|
521
534
|
]
|
|
522
535
|
);
|
|
523
|
-
|
|
536
|
+
B(() => {
|
|
524
537
|
if (!(!d || !f))
|
|
525
|
-
return f({ type: "register", descriptor:
|
|
538
|
+
return f({ type: "register", descriptor: Fe }), () => {
|
|
526
539
|
f({ type: "unregister", traceKey: F });
|
|
527
540
|
};
|
|
528
|
-
}, [
|
|
529
|
-
const _ =
|
|
541
|
+
}, [Fe, f, d, F]);
|
|
542
|
+
const _ = D(
|
|
530
543
|
(A, j) => {
|
|
531
544
|
!d || !f || f({ type: "event", traceKey: F, event: A, latestAttempt: j });
|
|
532
545
|
},
|
|
533
546
|
[f, d, F]
|
|
534
|
-
),
|
|
547
|
+
), We = D(() => {
|
|
535
548
|
_(
|
|
536
549
|
{
|
|
537
550
|
type: "query_started",
|
|
538
|
-
queryId:
|
|
539
|
-
at:
|
|
551
|
+
queryId: x,
|
|
552
|
+
at: ue()
|
|
540
553
|
},
|
|
541
554
|
{ status: "loading" }
|
|
542
555
|
);
|
|
543
|
-
}, [_,
|
|
556
|
+
}, [_, x]), Me = D(
|
|
544
557
|
(A, j) => {
|
|
545
|
-
const
|
|
558
|
+
const Y = Xe(A), X = rn(A), Tt = nn(A);
|
|
546
559
|
_(
|
|
547
560
|
{
|
|
548
561
|
type: "query_succeeded",
|
|
549
|
-
queryId:
|
|
550
|
-
requestId:
|
|
551
|
-
at:
|
|
552
|
-
rowCount:
|
|
562
|
+
queryId: x,
|
|
563
|
+
requestId: Y,
|
|
564
|
+
at: ue(),
|
|
565
|
+
rowCount: X,
|
|
553
566
|
durationMs: j
|
|
554
567
|
},
|
|
555
568
|
{
|
|
556
|
-
requestId:
|
|
569
|
+
requestId: Y,
|
|
557
570
|
status: "success",
|
|
558
571
|
durationMs: j,
|
|
559
|
-
rowCount:
|
|
560
|
-
columnCount:
|
|
561
|
-
executionResult:
|
|
572
|
+
rowCount: X,
|
|
573
|
+
columnCount: Tt,
|
|
574
|
+
executionResult: Ye(A)
|
|
562
575
|
}
|
|
563
576
|
);
|
|
564
577
|
},
|
|
565
|
-
[_,
|
|
566
|
-
),
|
|
578
|
+
[_, x]
|
|
579
|
+
), ie = D(
|
|
567
580
|
(A, j) => {
|
|
568
|
-
const
|
|
581
|
+
const Y = Xe(A), X = A instanceof Error ? A.message : String(A);
|
|
569
582
|
_(
|
|
570
583
|
{
|
|
571
584
|
type: "query_failed",
|
|
572
|
-
queryId:
|
|
573
|
-
requestId:
|
|
574
|
-
at:
|
|
575
|
-
errorMessage:
|
|
585
|
+
queryId: x,
|
|
586
|
+
requestId: Y,
|
|
587
|
+
at: ue(),
|
|
588
|
+
errorMessage: X
|
|
576
589
|
},
|
|
577
590
|
{
|
|
578
|
-
requestId:
|
|
591
|
+
requestId: Y,
|
|
579
592
|
status: "error",
|
|
580
593
|
durationMs: j,
|
|
581
|
-
errorMessage:
|
|
582
|
-
executionResult:
|
|
594
|
+
errorMessage: X,
|
|
595
|
+
executionResult: Ye(A)
|
|
583
596
|
}
|
|
584
597
|
);
|
|
585
598
|
},
|
|
586
|
-
[_,
|
|
587
|
-
),
|
|
599
|
+
[_, x]
|
|
600
|
+
), ze = D(
|
|
588
601
|
(A) => {
|
|
589
602
|
_(
|
|
590
603
|
{
|
|
591
604
|
type: "query_ignored_stale",
|
|
592
|
-
queryId:
|
|
593
|
-
at:
|
|
605
|
+
queryId: x,
|
|
606
|
+
at: ue(),
|
|
594
607
|
reason: A
|
|
595
608
|
}
|
|
596
609
|
);
|
|
597
610
|
},
|
|
598
|
-
[_,
|
|
599
|
-
),
|
|
611
|
+
[_, x]
|
|
612
|
+
), je = D(
|
|
600
613
|
(A) => {
|
|
601
|
-
|
|
614
|
+
ie(A, 0);
|
|
602
615
|
},
|
|
603
|
-
[
|
|
616
|
+
[ie]
|
|
604
617
|
), ge = d ? u == null ? void 0 : u.state.entries[F] : void 0;
|
|
605
618
|
return b(
|
|
606
619
|
() => ({
|
|
607
620
|
enabled: d,
|
|
608
|
-
queryId:
|
|
609
|
-
trace: ge ?
|
|
610
|
-
start:
|
|
611
|
-
success:
|
|
612
|
-
failure:
|
|
613
|
-
ignored:
|
|
614
|
-
validationFailure:
|
|
621
|
+
queryId: x,
|
|
622
|
+
trace: ge ? de(ge) : void 0,
|
|
623
|
+
start: We,
|
|
624
|
+
success: Me,
|
|
625
|
+
failure: ie,
|
|
626
|
+
ignored: ze,
|
|
627
|
+
validationFailure: je
|
|
615
628
|
}),
|
|
616
629
|
[
|
|
617
630
|
d,
|
|
618
|
-
|
|
631
|
+
ie,
|
|
632
|
+
ze,
|
|
633
|
+
x,
|
|
634
|
+
We,
|
|
619
635
|
Me,
|
|
620
|
-
w,
|
|
621
|
-
Ne,
|
|
622
|
-
Fe,
|
|
623
636
|
ge,
|
|
624
|
-
|
|
637
|
+
je
|
|
625
638
|
]
|
|
626
639
|
);
|
|
627
640
|
}
|
|
628
|
-
function
|
|
629
|
-
return /* @__PURE__ */ s("span", { style:
|
|
641
|
+
function Xt() {
|
|
642
|
+
return /* @__PURE__ */ s("span", { style: l.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
|
|
630
643
|
"svg",
|
|
631
644
|
{
|
|
632
645
|
viewBox: "0 0 100 100",
|
|
@@ -643,99 +656,105 @@ function Gr() {
|
|
|
643
656
|
}
|
|
644
657
|
) });
|
|
645
658
|
}
|
|
646
|
-
function
|
|
659
|
+
function Zt({
|
|
647
660
|
trace: e
|
|
648
661
|
}) {
|
|
649
|
-
var
|
|
662
|
+
var T, a, w, K, E;
|
|
650
663
|
if (!e)
|
|
651
|
-
return /* @__PURE__ */ s("div", { style:
|
|
652
|
-
const
|
|
653
|
-
(
|
|
654
|
-
), i =
|
|
655
|
-
(
|
|
656
|
-
), u =
|
|
664
|
+
return /* @__PURE__ */ s("div", { style: l.detailsPane, children: /* @__PURE__ */ s("div", { style: l.emptyState, children: "No traces registered yet" }) });
|
|
665
|
+
const t = e.latestAttempt, r = t == null ? void 0 : t.executionResult, n = be(
|
|
666
|
+
(T = r == null ? void 0 : r.validation) == null ? void 0 : T.warnings
|
|
667
|
+
), i = be((a = r == null ? void 0 : r.validation) == null ? void 0 : a.errors), o = be(
|
|
668
|
+
(w = r == null ? void 0 : r.coverage) == null ? void 0 : w.missingObligations
|
|
669
|
+
), u = r == null ? void 0 : r.compiledQuery, c = Er(r), d = ((K = e.server) == null ? void 0 : K.compiledSql) || c.compiledSql, f = t != null && t.errorMessage ? [t.errorMessage] : [], y = [
|
|
657
670
|
...e.clientWarnings,
|
|
658
671
|
...n,
|
|
659
672
|
...i,
|
|
660
|
-
...
|
|
661
|
-
],
|
|
662
|
-
return /* @__PURE__ */ p("div", { style:
|
|
663
|
-
/* @__PURE__ */ p("div", { style:
|
|
664
|
-
/* @__PURE__ */ p("div", { style:
|
|
673
|
+
...o
|
|
674
|
+
], g = me(e), h = lt(e), m = e.inputsApplied.length > 0, S = !!(u || d);
|
|
675
|
+
return /* @__PURE__ */ p("div", { style: l.detailsPane, children: [
|
|
676
|
+
/* @__PURE__ */ p("div", { style: l.detailsHeader, children: [
|
|
677
|
+
/* @__PURE__ */ p("div", { style: l.detailsHeaderTopRow, children: [
|
|
665
678
|
/* @__PURE__ */ s(
|
|
666
679
|
"span",
|
|
667
680
|
{
|
|
668
681
|
"aria-hidden": !0,
|
|
669
682
|
style: {
|
|
670
|
-
...
|
|
671
|
-
...
|
|
683
|
+
...l.detailsHeaderStatusDot,
|
|
684
|
+
...pt(t == null ? void 0 : t.status)
|
|
672
685
|
}
|
|
673
686
|
}
|
|
674
687
|
),
|
|
675
|
-
/* @__PURE__ */ s("span", { style:
|
|
676
|
-
/* @__PURE__ */ s("span", { style:
|
|
688
|
+
/* @__PURE__ */ s("span", { style: l.detailsTitle, children: Le(e) }),
|
|
689
|
+
/* @__PURE__ */ s("span", { style: l.detailsKindChip, children: ut(e) })
|
|
677
690
|
] }),
|
|
678
|
-
/* @__PURE__ */ p("div", { style:
|
|
679
|
-
/* @__PURE__ */
|
|
680
|
-
"span",
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
691
|
+
/* @__PURE__ */ p("div", { style: l.detailsCaption, children: [
|
|
692
|
+
/* @__PURE__ */ p("span", { style: l.detailsCaptionItem, children: [
|
|
693
|
+
/* @__PURE__ */ s("span", { style: l.detailsCaptionLabel, children: "Query" }),
|
|
694
|
+
/* @__PURE__ */ s(
|
|
695
|
+
"span",
|
|
696
|
+
{
|
|
697
|
+
style: {
|
|
698
|
+
...l.detailsCaptionValue,
|
|
699
|
+
...l.detailsCaptionItemMono
|
|
700
|
+
},
|
|
701
|
+
children: h
|
|
702
|
+
}
|
|
703
|
+
)
|
|
704
|
+
] }),
|
|
705
|
+
/* @__PURE__ */ p("span", { style: l.detailsCaptionItem, children: [
|
|
706
|
+
/* @__PURE__ */ s("span", { style: l.detailsCaptionLabel, children: "Source" }),
|
|
707
|
+
/* @__PURE__ */ s("span", { style: l.detailsCaptionValue, children: g })
|
|
689
708
|
] }),
|
|
690
|
-
/* @__PURE__ */ p("span", { style:
|
|
691
|
-
/* @__PURE__ */ s("span", { style:
|
|
692
|
-
/* @__PURE__ */ s("span", { style:
|
|
709
|
+
/* @__PURE__ */ p("span", { style: l.detailsCaptionItem, children: [
|
|
710
|
+
/* @__PURE__ */ s("span", { style: l.detailsCaptionLabel, children: "Rows" }),
|
|
711
|
+
/* @__PURE__ */ s("span", { style: l.detailsCaptionValue, children: xr(t == null ? void 0 : t.rowCount) })
|
|
693
712
|
] }),
|
|
694
|
-
/* @__PURE__ */ p("span", { style:
|
|
695
|
-
/* @__PURE__ */ s("span", { style:
|
|
696
|
-
/* @__PURE__ */ s("span", { style:
|
|
713
|
+
/* @__PURE__ */ p("span", { style: l.detailsCaptionItem, children: [
|
|
714
|
+
/* @__PURE__ */ s("span", { style: l.detailsCaptionLabel, children: "Duration" }),
|
|
715
|
+
/* @__PURE__ */ s("span", { style: l.detailsCaptionValue, children: Ir(t == null ? void 0 : t.durationMs) })
|
|
697
716
|
] })
|
|
698
717
|
] })
|
|
699
718
|
] }),
|
|
700
|
-
f.length ? /* @__PURE__ */ s(
|
|
701
|
-
|
|
702
|
-
/* @__PURE__ */ s(
|
|
703
|
-
/* @__PURE__ */ s(
|
|
704
|
-
(
|
|
705
|
-
m ? /* @__PURE__ */ s(
|
|
706
|
-
S ? /* @__PURE__ */ s(
|
|
707
|
-
|
|
719
|
+
f.length ? /* @__PURE__ */ s(He, { tone: "error", title: "Error", items: f }) : null,
|
|
720
|
+
y.length ? /* @__PURE__ */ s(He, { tone: "warning", title: "Warnings", items: y }) : null,
|
|
721
|
+
/* @__PURE__ */ s(tr, { trace: e }),
|
|
722
|
+
/* @__PURE__ */ s(rr, { trace: e }),
|
|
723
|
+
(E = e.sourceHints) != null && E.length ? /* @__PURE__ */ s(nr, { hints: e.sourceHints }) : null,
|
|
724
|
+
m ? /* @__PURE__ */ s(or, { inputs: e.inputsApplied }) : null,
|
|
725
|
+
S ? /* @__PURE__ */ s(te, { title: "Compiled query", children: /* @__PURE__ */ s(
|
|
726
|
+
sr,
|
|
708
727
|
{
|
|
709
728
|
compiledQuery: u,
|
|
710
729
|
compiledSql: d
|
|
711
730
|
}
|
|
712
731
|
) }) : null,
|
|
713
|
-
/* @__PURE__ */ s(
|
|
732
|
+
/* @__PURE__ */ s(te, { title: "Lifecycle events", children: e.recentEvents.length ? /* @__PURE__ */ s("div", { style: l.eventList, children: e.recentEvents.slice(-5).map((v, I) => /* @__PURE__ */ p(
|
|
714
733
|
"div",
|
|
715
734
|
{
|
|
716
|
-
style:
|
|
735
|
+
style: l.eventRow,
|
|
717
736
|
children: [
|
|
718
|
-
/* @__PURE__ */ s("span", { style:
|
|
719
|
-
/* @__PURE__ */ s("span", { style:
|
|
737
|
+
/* @__PURE__ */ s("span", { style: l.eventType, children: Ar(v) }),
|
|
738
|
+
/* @__PURE__ */ s("span", { style: l.eventMeta, children: Tr(v) })
|
|
720
739
|
]
|
|
721
740
|
},
|
|
722
741
|
`${v.type}:${v.at}:${I}`
|
|
723
|
-
)) }) : /* @__PURE__ */ s("div", { style:
|
|
724
|
-
/* @__PURE__ */ s(
|
|
742
|
+
)) }) : /* @__PURE__ */ s("div", { style: l.mutedText, children: "No attempts recorded" }) }),
|
|
743
|
+
/* @__PURE__ */ s(te, { title: "Raw trace JSON", children: /* @__PURE__ */ s("pre", { style: l.codeBlock, children: qr(e) }) })
|
|
725
744
|
] });
|
|
726
745
|
}
|
|
727
|
-
function
|
|
746
|
+
function He({
|
|
728
747
|
tone: e,
|
|
729
|
-
title:
|
|
730
|
-
items:
|
|
748
|
+
title: t,
|
|
749
|
+
items: r
|
|
731
750
|
}) {
|
|
732
|
-
const n = e === "error" ?
|
|
733
|
-
return /* @__PURE__ */ p("div", { style: { ...
|
|
734
|
-
/* @__PURE__ */ s("div", { style:
|
|
735
|
-
|
|
751
|
+
const n = e === "error" ? l.alertCardError : l.alertCardWarning;
|
|
752
|
+
return /* @__PURE__ */ p("div", { style: { ...l.alertCard, ...n }, children: [
|
|
753
|
+
/* @__PURE__ */ s("div", { style: l.alertCardTitle, children: t }),
|
|
754
|
+
r.length > 1 ? /* @__PURE__ */ s("ul", { style: l.alertCardList, children: r.map((i, o) => /* @__PURE__ */ s("li", { children: i }, `${e}-${o}`)) }) : /* @__PURE__ */ s("div", { children: r[0] })
|
|
736
755
|
] });
|
|
737
756
|
}
|
|
738
|
-
function
|
|
757
|
+
function er({
|
|
739
758
|
status: e
|
|
740
759
|
}) {
|
|
741
760
|
return /* @__PURE__ */ s(
|
|
@@ -743,53 +762,53 @@ function Yr({
|
|
|
743
762
|
{
|
|
744
763
|
"aria-hidden": !0,
|
|
745
764
|
style: {
|
|
746
|
-
...
|
|
747
|
-
...
|
|
765
|
+
...l.statusDot,
|
|
766
|
+
...pt(e)
|
|
748
767
|
}
|
|
749
768
|
}
|
|
750
769
|
);
|
|
751
770
|
}
|
|
752
|
-
function
|
|
771
|
+
function te({
|
|
753
772
|
title: e,
|
|
754
|
-
children:
|
|
773
|
+
children: t
|
|
755
774
|
}) {
|
|
756
|
-
return /* @__PURE__ */ p("details", { style:
|
|
757
|
-
/* @__PURE__ */ s("summary", { style:
|
|
758
|
-
/* @__PURE__ */ s("div", { style:
|
|
775
|
+
return /* @__PURE__ */ p("details", { style: l.disclosure, children: [
|
|
776
|
+
/* @__PURE__ */ s("summary", { style: l.disclosureSummary, children: e }),
|
|
777
|
+
/* @__PURE__ */ s("div", { style: l.disclosureBody, children: t })
|
|
759
778
|
] });
|
|
760
779
|
}
|
|
761
|
-
function
|
|
780
|
+
function tr({
|
|
762
781
|
trace: e
|
|
763
782
|
}) {
|
|
764
|
-
var
|
|
765
|
-
const
|
|
766
|
-
return /* @__PURE__ */ p("div", { style:
|
|
767
|
-
/* @__PURE__ */ s("div", { style:
|
|
768
|
-
/* @__PURE__ */ s("span", { style:
|
|
769
|
-
/* @__PURE__ */ s("span", { style:
|
|
783
|
+
var o;
|
|
784
|
+
const t = (o = e.projectionFieldRefs) != null && o.length ? e.projectionFieldRefs : e.fieldRefs, r = e.inputFieldRefs || [], n = yr(t), i = gr(e, n, t);
|
|
785
|
+
return /* @__PURE__ */ p("div", { style: l.recipe, children: [
|
|
786
|
+
/* @__PURE__ */ s("div", { style: l.recipeSummary, children: i.map((u) => /* @__PURE__ */ p("div", { style: l.recipeSummaryRow, children: [
|
|
787
|
+
/* @__PURE__ */ s("span", { style: l.recipeSummaryLabel, children: u.label }),
|
|
788
|
+
/* @__PURE__ */ s("span", { style: l.recipeSummaryValue, title: u.value, children: u.value })
|
|
770
789
|
] }, u.label)) }),
|
|
771
|
-
/* @__PURE__ */ s(
|
|
772
|
-
/* @__PURE__ */ s(
|
|
790
|
+
/* @__PURE__ */ s(W, { title: "Measures", fields: n.measures }),
|
|
791
|
+
/* @__PURE__ */ s(W, { title: "Time fields", fields: n.timeFields }),
|
|
773
792
|
/* @__PURE__ */ s(
|
|
774
|
-
|
|
793
|
+
W,
|
|
775
794
|
{
|
|
776
795
|
title: "Dimensions",
|
|
777
796
|
fields: n.dimensions,
|
|
778
797
|
emptyText: "No dimensions selected"
|
|
779
798
|
}
|
|
780
799
|
),
|
|
781
|
-
/* @__PURE__ */ s(
|
|
782
|
-
/* @__PURE__ */ s(
|
|
783
|
-
/* @__PURE__ */ s(
|
|
800
|
+
/* @__PURE__ */ s(W, { title: "Identifiers", fields: n.identifiers }),
|
|
801
|
+
/* @__PURE__ */ s(W, { title: "Other fields", fields: n.other }),
|
|
802
|
+
/* @__PURE__ */ s(W, { title: "Input bindings", fields: r })
|
|
784
803
|
] });
|
|
785
804
|
}
|
|
786
|
-
function
|
|
805
|
+
function rr({
|
|
787
806
|
trace: e
|
|
788
807
|
}) {
|
|
789
|
-
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ s(
|
|
790
|
-
/* @__PURE__ */ s(
|
|
808
|
+
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ s(te, { title: "Sources and field refs", children: /* @__PURE__ */ p("div", { style: l.traceLineage, children: [
|
|
809
|
+
/* @__PURE__ */ s(ir, { sources: e.sourceRefs }),
|
|
791
810
|
/* @__PURE__ */ s(
|
|
792
|
-
|
|
811
|
+
W,
|
|
793
812
|
{
|
|
794
813
|
title: "All field refs",
|
|
795
814
|
fields: e.fieldRefs,
|
|
@@ -798,201 +817,204 @@ function Zr({
|
|
|
798
817
|
)
|
|
799
818
|
] }) });
|
|
800
819
|
}
|
|
801
|
-
function
|
|
820
|
+
function nr({
|
|
802
821
|
hints: e
|
|
803
822
|
}) {
|
|
804
|
-
return /* @__PURE__ */ s(
|
|
805
|
-
const n =
|
|
806
|
-
|
|
823
|
+
return /* @__PURE__ */ s(te, { title: "Source hints", children: /* @__PURE__ */ s("div", { style: l.recipeFieldList, children: e.map((t, r) => {
|
|
824
|
+
const n = wr(t), i = t.component || t.exportName || n || "Source hint", o = [
|
|
825
|
+
t.exportName && t.exportName !== i ? t.exportName : void 0,
|
|
807
826
|
n,
|
|
808
|
-
|
|
827
|
+
t.note
|
|
809
828
|
].filter(Boolean).join(" · ");
|
|
810
829
|
return /* @__PURE__ */ p(
|
|
811
830
|
"div",
|
|
812
831
|
{
|
|
813
|
-
style:
|
|
814
|
-
title:
|
|
832
|
+
style: l.recipeFieldRow,
|
|
833
|
+
title: o || i,
|
|
815
834
|
children: [
|
|
816
|
-
/* @__PURE__ */ s("span", { style:
|
|
817
|
-
|
|
835
|
+
/* @__PURE__ */ s("span", { style: l.recipeFieldName, children: i }),
|
|
836
|
+
o ? /* @__PURE__ */ s("span", { style: l.recipeFieldMeta, children: o }) : null
|
|
818
837
|
]
|
|
819
838
|
},
|
|
820
|
-
`${i}:${n}:${
|
|
839
|
+
`${i}:${n}:${r}`
|
|
821
840
|
);
|
|
822
841
|
}) }) });
|
|
823
842
|
}
|
|
824
|
-
function
|
|
843
|
+
function ir({
|
|
825
844
|
sources: e
|
|
826
845
|
}) {
|
|
827
|
-
return /* @__PURE__ */ p("div", { style:
|
|
828
|
-
/* @__PURE__ */ p("div", { style:
|
|
829
|
-
/* @__PURE__ */ s("span", { style:
|
|
830
|
-
/* @__PURE__ */ s("span", { style:
|
|
846
|
+
return /* @__PURE__ */ p("div", { style: l.recipeGroup, children: [
|
|
847
|
+
/* @__PURE__ */ p("div", { style: l.recipeGroupHeader, children: [
|
|
848
|
+
/* @__PURE__ */ s("span", { style: l.recipeGroupTitle, children: "Sources" }),
|
|
849
|
+
/* @__PURE__ */ s("span", { style: l.recipeGroupCount, children: e.length })
|
|
831
850
|
] }),
|
|
832
|
-
e.length ? /* @__PURE__ */ s("div", { style:
|
|
851
|
+
e.length ? /* @__PURE__ */ s("div", { style: l.recipeFieldList, children: e.map((t, r) => /* @__PURE__ */ p(
|
|
833
852
|
"div",
|
|
834
853
|
{
|
|
835
|
-
style:
|
|
836
|
-
title: V(
|
|
854
|
+
style: l.recipeFieldRow,
|
|
855
|
+
title: V(t),
|
|
837
856
|
children: [
|
|
838
|
-
/* @__PURE__ */ s("span", { style:
|
|
839
|
-
/* @__PURE__ */ s("span", { style:
|
|
857
|
+
/* @__PURE__ */ s("span", { style: l.recipeFieldName, children: V(t) }),
|
|
858
|
+
/* @__PURE__ */ s("span", { style: l.recipeFieldMeta, children: t.kind })
|
|
840
859
|
]
|
|
841
860
|
},
|
|
842
|
-
`${V(
|
|
843
|
-
)) }) : /* @__PURE__ */ s("div", { style:
|
|
861
|
+
`${V(t)}:${r}`
|
|
862
|
+
)) }) : /* @__PURE__ */ s("div", { style: l.recipeEmptyText, children: "No sources captured" })
|
|
844
863
|
] });
|
|
845
864
|
}
|
|
846
|
-
function
|
|
865
|
+
function W({
|
|
847
866
|
title: e,
|
|
848
|
-
fields:
|
|
849
|
-
emptyText:
|
|
867
|
+
fields: t,
|
|
868
|
+
emptyText: r
|
|
850
869
|
}) {
|
|
851
|
-
return !
|
|
852
|
-
/* @__PURE__ */ p("div", { style:
|
|
853
|
-
/* @__PURE__ */ s("span", { style:
|
|
854
|
-
/* @__PURE__ */ s("span", { style:
|
|
870
|
+
return !t.length && !r ? null : /* @__PURE__ */ p("div", { style: l.recipeGroup, children: [
|
|
871
|
+
/* @__PURE__ */ p("div", { style: l.recipeGroupHeader, children: [
|
|
872
|
+
/* @__PURE__ */ s("span", { style: l.recipeGroupTitle, children: e }),
|
|
873
|
+
/* @__PURE__ */ s("span", { style: l.recipeGroupCount, children: t.length })
|
|
855
874
|
] }),
|
|
856
|
-
|
|
857
|
-
const
|
|
875
|
+
t.length ? /* @__PURE__ */ s("div", { style: l.recipeFieldList, children: t.map((n, i) => {
|
|
876
|
+
const o = ct(n), u = n.dataType && n.dataType !== "unknown" ? n.dataType : void 0, c = n.source ? V(n.source) : void 0, d = [o, u, c].filter(Boolean).join(" · ");
|
|
858
877
|
return /* @__PURE__ */ p(
|
|
859
878
|
"div",
|
|
860
879
|
{
|
|
861
|
-
style:
|
|
880
|
+
style: l.recipeFieldRow,
|
|
862
881
|
title: d,
|
|
863
882
|
children: [
|
|
864
|
-
/* @__PURE__ */ s("span", { style:
|
|
865
|
-
/* @__PURE__ */ p("span", { style:
|
|
883
|
+
/* @__PURE__ */ s("span", { style: l.recipeFieldName, children: o }),
|
|
884
|
+
/* @__PURE__ */ p("span", { style: l.recipeFieldMeta, children: [
|
|
866
885
|
u ? /* @__PURE__ */ s("span", { children: u }) : null,
|
|
867
|
-
u && c ? /* @__PURE__ */ s("span", { style:
|
|
886
|
+
u && c ? /* @__PURE__ */ s("span", { style: l.recipeFieldMetaDivider, children: " · " }) : null,
|
|
868
887
|
c ? /* @__PURE__ */ s("span", { children: c }) : null
|
|
869
888
|
] })
|
|
870
889
|
]
|
|
871
890
|
},
|
|
872
891
|
`${Oe(n)}:${i}`
|
|
873
892
|
);
|
|
874
|
-
}) }) : /* @__PURE__ */ s("div", { style:
|
|
893
|
+
}) }) : /* @__PURE__ */ s("div", { style: l.recipeEmptyText, children: r })
|
|
875
894
|
] });
|
|
876
895
|
}
|
|
877
|
-
function
|
|
896
|
+
function or({
|
|
878
897
|
inputs: e
|
|
879
898
|
}) {
|
|
880
|
-
return /* @__PURE__ */ p("div", { style:
|
|
881
|
-
/* @__PURE__ */ p("div", { style:
|
|
882
|
-
/* @__PURE__ */ s("span", { style:
|
|
883
|
-
/* @__PURE__ */ s("span", { style:
|
|
899
|
+
return /* @__PURE__ */ p("div", { style: l.inputsAppliedBlock, children: [
|
|
900
|
+
/* @__PURE__ */ p("div", { style: l.inputsAppliedHeader, children: [
|
|
901
|
+
/* @__PURE__ */ s("span", { style: l.inputsAppliedTitle, children: "Inputs applied" }),
|
|
902
|
+
/* @__PURE__ */ s("span", { style: l.inputsAppliedCount, children: e.length })
|
|
884
903
|
] }),
|
|
885
|
-
/* @__PURE__ */ s("div", { style:
|
|
886
|
-
const
|
|
904
|
+
/* @__PURE__ */ s("div", { style: l.inputRecipeList, children: e.map((t) => {
|
|
905
|
+
const r = ft(t);
|
|
887
906
|
return /* @__PURE__ */ p(
|
|
888
907
|
"div",
|
|
889
908
|
{
|
|
890
|
-
style:
|
|
891
|
-
title:
|
|
909
|
+
style: l.inputRecipeRow,
|
|
910
|
+
title: r.title,
|
|
892
911
|
children: [
|
|
893
|
-
/* @__PURE__ */ p("div", { style:
|
|
894
|
-
/* @__PURE__ */ s("span", { style:
|
|
895
|
-
|
|
896
|
-
/* @__PURE__ */ s("span", { style:
|
|
912
|
+
/* @__PURE__ */ p("div", { style: l.inputRecipeHeader, children: [
|
|
913
|
+
/* @__PURE__ */ s("span", { style: l.inputRecipeId, title: t.inputId, children: t.inputId }),
|
|
914
|
+
r.operator ? /* @__PURE__ */ s("span", { style: l.inputOperatorBadge, children: r.operator }) : null,
|
|
915
|
+
/* @__PURE__ */ s("span", { style: l.inputValuePreview, title: r.value, children: r.value })
|
|
897
916
|
] }),
|
|
898
|
-
|
|
917
|
+
r.binding ? /* @__PURE__ */ s("div", { style: l.inputRecipeBinding, title: r.binding, children: r.binding }) : null
|
|
899
918
|
]
|
|
900
919
|
},
|
|
901
|
-
|
|
920
|
+
t.inputId
|
|
902
921
|
);
|
|
903
922
|
}) })
|
|
904
923
|
] });
|
|
905
924
|
}
|
|
906
|
-
function
|
|
925
|
+
function sr({
|
|
907
926
|
compiledQuery: e,
|
|
908
|
-
compiledSql:
|
|
927
|
+
compiledSql: t
|
|
909
928
|
}) {
|
|
910
|
-
return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style:
|
|
911
|
-
/* @__PURE__ */ s(
|
|
912
|
-
e.pythonCode ? /* @__PURE__ */ s(
|
|
929
|
+
return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: l.compiledQuery, children: [
|
|
930
|
+
/* @__PURE__ */ s(Z, { label: "SQL", value: e.sql }),
|
|
931
|
+
e.pythonCode ? /* @__PURE__ */ s(Z, { label: "Python", value: e.pythonCode }) : null,
|
|
913
932
|
e.parameters ? /* @__PURE__ */ s(
|
|
914
|
-
|
|
933
|
+
Z,
|
|
915
934
|
{
|
|
916
935
|
label: "Parameters",
|
|
917
936
|
value: Ee(e.parameters)
|
|
918
937
|
}
|
|
919
938
|
) : null
|
|
920
|
-
] }) :
|
|
939
|
+
] }) : t ? /* @__PURE__ */ s(Z, { label: "SQL", value: t }) : /* @__PURE__ */ s(Z, { label: "Compiled query", value: Ee(e) });
|
|
921
940
|
}
|
|
922
|
-
function
|
|
941
|
+
function Z({
|
|
923
942
|
label: e,
|
|
924
|
-
value:
|
|
943
|
+
value: t
|
|
925
944
|
}) {
|
|
926
|
-
return /* @__PURE__ */ p("div", { style:
|
|
927
|
-
/* @__PURE__ */ s("div", { style:
|
|
928
|
-
/* @__PURE__ */ s("pre", { style:
|
|
945
|
+
return /* @__PURE__ */ p("div", { style: l.codeBlockGroup, children: [
|
|
946
|
+
/* @__PURE__ */ s("div", { style: l.codeBlockLabel, children: e }),
|
|
947
|
+
/* @__PURE__ */ s("pre", { style: l.codeBlock, children: t })
|
|
929
948
|
] });
|
|
930
949
|
}
|
|
931
|
-
function
|
|
932
|
-
const
|
|
950
|
+
function ar(e) {
|
|
951
|
+
const t = e.filter(
|
|
933
952
|
(i) => {
|
|
934
|
-
var
|
|
935
|
-
return ((
|
|
953
|
+
var o;
|
|
954
|
+
return ((o = i.latestAttempt) == null ? void 0 : o.status) === "error";
|
|
936
955
|
}
|
|
937
|
-
).length,
|
|
956
|
+
).length, r = e.filter(
|
|
938
957
|
(i) => {
|
|
939
|
-
var
|
|
940
|
-
return ((
|
|
958
|
+
var o;
|
|
959
|
+
return ((o = i.latestAttempt) == null ? void 0 : o.status) === "loading";
|
|
941
960
|
}
|
|
942
961
|
).length, n = e.filter(
|
|
943
962
|
(i) => {
|
|
944
|
-
var
|
|
945
|
-
return i.clientWarnings.length > 0 || !!((d = (c = (u = (
|
|
963
|
+
var o, u, c, d;
|
|
964
|
+
return i.clientWarnings.length > 0 || !!((d = (c = (u = (o = i.latestAttempt) == null ? void 0 : o.executionResult) == null ? void 0 : u.validation) == null ? void 0 : c.warnings) != null && d.length);
|
|
946
965
|
}
|
|
947
966
|
).length;
|
|
948
967
|
return {
|
|
949
968
|
total: e.length,
|
|
950
|
-
failed:
|
|
951
|
-
loading:
|
|
969
|
+
failed: t,
|
|
970
|
+
loading: r,
|
|
952
971
|
warningCount: n,
|
|
953
|
-
issueCount:
|
|
954
|
-
severity:
|
|
972
|
+
issueCount: t + n,
|
|
973
|
+
severity: t ? "error" : n ? "warning" : "ok"
|
|
955
974
|
};
|
|
956
975
|
}
|
|
957
|
-
function
|
|
958
|
-
const
|
|
959
|
-
return
|
|
976
|
+
function lr(e, t) {
|
|
977
|
+
const r = t.trim().toLowerCase();
|
|
978
|
+
return r ? e.filter(
|
|
960
979
|
(n) => [
|
|
961
980
|
n.queryId,
|
|
962
981
|
n.queryLabel,
|
|
963
982
|
n.viewId,
|
|
983
|
+
n.viewTitle,
|
|
984
|
+
n.visualType,
|
|
985
|
+
n.sectionTitle,
|
|
964
986
|
n.builder,
|
|
965
987
|
n.queryKind,
|
|
966
|
-
|
|
967
|
-
].filter(Boolean).join(" ").toLowerCase().includes(
|
|
988
|
+
me(n)
|
|
989
|
+
].filter(Boolean).join(" ").toLowerCase().includes(r)
|
|
968
990
|
) : e;
|
|
969
991
|
}
|
|
970
|
-
function
|
|
971
|
-
const
|
|
992
|
+
function ur(e) {
|
|
993
|
+
const t = e.filter((i) => i.queryKind === "inputOptions"), r = new Set(t.map(Re));
|
|
972
994
|
return [
|
|
973
|
-
{ title: "Cards", traces: e.filter((i) => !
|
|
974
|
-
{ title: "Inputs", traces:
|
|
995
|
+
{ title: "Cards", traces: e.filter((i) => !r.has(Re(i))) },
|
|
996
|
+
{ title: "Inputs", traces: t }
|
|
975
997
|
];
|
|
976
998
|
}
|
|
977
|
-
function
|
|
978
|
-
if (!(!(
|
|
979
|
-
return
|
|
999
|
+
function at(e, t) {
|
|
1000
|
+
if (!(!(t != null && t.traceId) && !(t != null && t.queryId) && !(t != null && t.viewId)))
|
|
1001
|
+
return t.traceId ? e.find((r) => r.traceId === t.traceId) : e.find((r) => !(t.queryId && r.queryId !== t.queryId || t.viewId && r.viewId !== t.viewId));
|
|
980
1002
|
}
|
|
981
|
-
function
|
|
982
|
-
if (
|
|
983
|
-
return
|
|
984
|
-
if (!
|
|
1003
|
+
function dr(e, t) {
|
|
1004
|
+
if (t.queryId)
|
|
1005
|
+
return at(e, t);
|
|
1006
|
+
if (!t.viewId)
|
|
985
1007
|
return;
|
|
986
|
-
const
|
|
987
|
-
return
|
|
1008
|
+
const r = e.filter((n) => n.viewId === t.viewId);
|
|
1009
|
+
return r.length === 1 ? r[0] : void 0;
|
|
988
1010
|
}
|
|
989
|
-
function
|
|
990
|
-
return !!(e &&
|
|
1011
|
+
function cr(e, t) {
|
|
1012
|
+
return !!(e && t && e.traceId === t.traceId);
|
|
991
1013
|
}
|
|
992
1014
|
function Re(e) {
|
|
993
1015
|
return e.traceId;
|
|
994
1016
|
}
|
|
995
|
-
function
|
|
1017
|
+
function fr(e) {
|
|
996
1018
|
switch (e) {
|
|
997
1019
|
case "metric":
|
|
998
1020
|
return "metric";
|
|
@@ -1007,19 +1029,32 @@ function sr(e) {
|
|
|
1007
1029
|
case "sql":
|
|
1008
1030
|
return "sql";
|
|
1009
1031
|
default:
|
|
1010
|
-
return
|
|
1032
|
+
return ye(e);
|
|
1011
1033
|
}
|
|
1012
1034
|
}
|
|
1013
|
-
function
|
|
1014
|
-
return e.queryLabel || e.viewId || e.queryId;
|
|
1035
|
+
function Le(e) {
|
|
1036
|
+
return e.viewTitle || e.queryLabel || e.viewId || e.queryId;
|
|
1015
1037
|
}
|
|
1016
|
-
function
|
|
1017
|
-
|
|
1018
|
-
return r.length ? r.length === 1 ? r[0] : `${r[0]} + ${r.length - 1} more` : "No source";
|
|
1038
|
+
function lt(e) {
|
|
1039
|
+
return e.viewTitle && e.queryLabel && e.queryLabel !== e.viewTitle ? `${e.queryLabel} · ${e.queryId}` : e.viewTitle || e.queryLabel ? e.queryId : e.viewId ? `${e.viewId} · ${e.queryId}` : e.queryId;
|
|
1019
1040
|
}
|
|
1020
1041
|
function ut(e) {
|
|
1042
|
+
return mr(e.visualType) || fr(e.queryKind);
|
|
1043
|
+
}
|
|
1044
|
+
function pr(e, t) {
|
|
1045
|
+
return t ? e.queryLabel || e.queryId : Le(e);
|
|
1046
|
+
}
|
|
1047
|
+
function mr(e) {
|
|
1048
|
+
if (e)
|
|
1049
|
+
return e.replace(/[_-]+/g, " ").replace(/\b\w/g, (t) => t.toUpperCase());
|
|
1050
|
+
}
|
|
1051
|
+
function me(e) {
|
|
1052
|
+
const t = e.sourceRefs.map(V);
|
|
1053
|
+
return t.length ? t.length === 1 ? t[0] : `${t[0]} + ${t.length - 1} more` : "No source";
|
|
1054
|
+
}
|
|
1055
|
+
function yr(e) {
|
|
1021
1056
|
return e.reduce(
|
|
1022
|
-
(
|
|
1057
|
+
(t, r) => (r.role === "measure" ? t.measures.push(r) : r.role === "date" ? t.timeFields.push(r) : r.role === "dimension" ? t.dimensions.push(r) : r.role === "id" ? t.identifiers.push(r) : t.other.push(r), t),
|
|
1023
1058
|
{
|
|
1024
1059
|
measures: [],
|
|
1025
1060
|
timeFields: [],
|
|
@@ -1029,31 +1064,31 @@ function ut(e) {
|
|
|
1029
1064
|
}
|
|
1030
1065
|
);
|
|
1031
1066
|
}
|
|
1032
|
-
function
|
|
1067
|
+
function gr(e, t, r) {
|
|
1033
1068
|
const n = [
|
|
1034
1069
|
{
|
|
1035
1070
|
label: "Operation",
|
|
1036
|
-
value:
|
|
1071
|
+
value: hr(e)
|
|
1037
1072
|
}
|
|
1038
|
-
], i =
|
|
1073
|
+
], i = vr(e, t, r);
|
|
1039
1074
|
i && n.push(i);
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1075
|
+
const o = br(t);
|
|
1076
|
+
o && n.push({
|
|
1042
1077
|
label: "Grouped by",
|
|
1043
|
-
value:
|
|
1078
|
+
value: o
|
|
1044
1079
|
});
|
|
1045
|
-
const u =
|
|
1080
|
+
const u = Sr(e.inputsApplied);
|
|
1046
1081
|
return u && n.push({
|
|
1047
1082
|
label: "Filtered by",
|
|
1048
1083
|
value: u
|
|
1049
1084
|
}), n.push({
|
|
1050
1085
|
label: "Source",
|
|
1051
|
-
value:
|
|
1086
|
+
value: me(e)
|
|
1052
1087
|
}), n;
|
|
1053
1088
|
}
|
|
1054
|
-
function
|
|
1055
|
-
var
|
|
1056
|
-
if (e.queryKind === "records" && ((
|
|
1089
|
+
function hr(e) {
|
|
1090
|
+
var t, r;
|
|
1091
|
+
if (e.queryKind === "records" && ((t = e.projectionFieldRefs) != null && t.length) && e.projectionFieldRefs.every((n) => n.role === "measure") && ((r = e.latestAttempt) == null ? void 0 : r.rowCount) === 1)
|
|
1057
1092
|
return "KPI query";
|
|
1058
1093
|
switch (e.queryKind) {
|
|
1059
1094
|
case "metric":
|
|
@@ -1069,29 +1104,29 @@ function ct(e) {
|
|
|
1069
1104
|
case "sql":
|
|
1070
1105
|
return "SQL query";
|
|
1071
1106
|
default:
|
|
1072
|
-
return
|
|
1107
|
+
return ye(e.queryKind);
|
|
1073
1108
|
}
|
|
1074
1109
|
}
|
|
1075
|
-
function
|
|
1110
|
+
function vr(e, t, r) {
|
|
1076
1111
|
if (e.queryKind === "records")
|
|
1077
1112
|
return {
|
|
1078
|
-
label:
|
|
1079
|
-
value:
|
|
1113
|
+
label: t.measures.length ? "Computes" : "Selects",
|
|
1114
|
+
value: ee(r)
|
|
1080
1115
|
};
|
|
1081
1116
|
if (e.queryKind === "inputOptions")
|
|
1082
1117
|
return {
|
|
1083
1118
|
label: "Options from",
|
|
1084
|
-
value:
|
|
1119
|
+
value: ee(r)
|
|
1085
1120
|
};
|
|
1086
|
-
if (
|
|
1121
|
+
if (t.measures.length)
|
|
1087
1122
|
return {
|
|
1088
1123
|
label: "Computes",
|
|
1089
|
-
value:
|
|
1124
|
+
value: ee(t.measures)
|
|
1090
1125
|
};
|
|
1091
|
-
if (
|
|
1126
|
+
if (r.length)
|
|
1092
1127
|
return {
|
|
1093
1128
|
label: "Uses",
|
|
1094
|
-
value:
|
|
1129
|
+
value: ee(r)
|
|
1095
1130
|
};
|
|
1096
1131
|
if (e.queryKind === "sql")
|
|
1097
1132
|
return {
|
|
@@ -1099,49 +1134,49 @@ function ft(e, r, t) {
|
|
|
1099
1134
|
value: "Open compiled query for SQL or Python."
|
|
1100
1135
|
};
|
|
1101
1136
|
}
|
|
1102
|
-
function
|
|
1103
|
-
const
|
|
1137
|
+
function br(e) {
|
|
1138
|
+
const t = [
|
|
1104
1139
|
...e.dimensions,
|
|
1105
1140
|
...e.timeFields
|
|
1106
1141
|
];
|
|
1107
|
-
return
|
|
1142
|
+
return t.length ? ee(t) : void 0;
|
|
1108
1143
|
}
|
|
1109
|
-
function
|
|
1144
|
+
function Sr(e) {
|
|
1110
1145
|
if (e.length)
|
|
1111
|
-
return
|
|
1112
|
-
e.map((
|
|
1113
|
-
const
|
|
1146
|
+
return dt(
|
|
1147
|
+
e.map((t) => {
|
|
1148
|
+
const r = ft(t);
|
|
1114
1149
|
return [
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1150
|
+
t.inputId,
|
|
1151
|
+
r.operator,
|
|
1152
|
+
r.value
|
|
1118
1153
|
].filter(Boolean).join(" ");
|
|
1119
1154
|
})
|
|
1120
1155
|
);
|
|
1121
1156
|
}
|
|
1122
|
-
function
|
|
1123
|
-
return
|
|
1157
|
+
function ee(e) {
|
|
1158
|
+
return dt(e.map(ct));
|
|
1124
1159
|
}
|
|
1125
|
-
function
|
|
1126
|
-
const
|
|
1127
|
-
return
|
|
1160
|
+
function dt(e) {
|
|
1161
|
+
const t = e.filter(Boolean);
|
|
1162
|
+
return t.length === 0 ? "-" : t.length === 1 ? t[0] : t.length === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[t.length - 1]}`;
|
|
1128
1163
|
}
|
|
1129
|
-
function
|
|
1164
|
+
function ct(e) {
|
|
1130
1165
|
return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
|
|
1131
1166
|
}
|
|
1132
|
-
function
|
|
1167
|
+
function ft(e) {
|
|
1133
1168
|
var u, c, d;
|
|
1134
|
-
const
|
|
1169
|
+
const t = e.valuePreview || "redacted", r = ((u = e.fieldRef) == null ? void 0 : u.label) || ((c = e.fieldRef) == null ? void 0 : c.name), n = (d = e.fieldRef) != null && d.source ? V(e.fieldRef.source) : void 0, i = [r ? `on ${r}` : void 0, n].filter(Boolean).join(" · "), o = [
|
|
1135
1170
|
e.inputId,
|
|
1136
1171
|
e.operator,
|
|
1137
|
-
|
|
1172
|
+
t,
|
|
1138
1173
|
i
|
|
1139
1174
|
].filter(Boolean).join(" - ");
|
|
1140
1175
|
return {
|
|
1141
1176
|
operator: e.operator,
|
|
1142
|
-
value:
|
|
1177
|
+
value: t,
|
|
1143
1178
|
binding: i,
|
|
1144
|
-
title:
|
|
1179
|
+
title: o
|
|
1145
1180
|
};
|
|
1146
1181
|
}
|
|
1147
1182
|
function V(e) {
|
|
@@ -1150,23 +1185,23 @@ function V(e) {
|
|
|
1150
1185
|
e.tableName
|
|
1151
1186
|
].filter(Boolean).join(".") || e.tableName : e.connectionId ? `SQL ${e.connectionId}` : "SQL source";
|
|
1152
1187
|
}
|
|
1153
|
-
function
|
|
1188
|
+
function wr(e) {
|
|
1154
1189
|
if (e.file)
|
|
1155
1190
|
return e.line && e.column ? `${e.file}:${e.line}:${e.column}` : e.line ? `${e.file}:${e.line}` : e.file;
|
|
1156
1191
|
}
|
|
1157
|
-
function
|
|
1192
|
+
function xr(e) {
|
|
1158
1193
|
return typeof e == "number" ? e.toLocaleString() : "-";
|
|
1159
1194
|
}
|
|
1160
|
-
function
|
|
1195
|
+
function Ir(e) {
|
|
1161
1196
|
return typeof e == "number" ? `${Math.round(e)}ms` : "-";
|
|
1162
1197
|
}
|
|
1163
|
-
function
|
|
1198
|
+
function qr(e) {
|
|
1164
1199
|
return Ee(e);
|
|
1165
1200
|
}
|
|
1166
1201
|
function Ee(e) {
|
|
1167
1202
|
return JSON.stringify(e, null, 2) ?? "undefined";
|
|
1168
1203
|
}
|
|
1169
|
-
function
|
|
1204
|
+
function Ar(e) {
|
|
1170
1205
|
switch (e.type) {
|
|
1171
1206
|
case "query_started":
|
|
1172
1207
|
return "Started";
|
|
@@ -1179,10 +1214,10 @@ function bt(e) {
|
|
|
1179
1214
|
case "input_changed":
|
|
1180
1215
|
return "Input changed";
|
|
1181
1216
|
default:
|
|
1182
|
-
return
|
|
1217
|
+
return Rr(e);
|
|
1183
1218
|
}
|
|
1184
1219
|
}
|
|
1185
|
-
function
|
|
1220
|
+
function Tr(e) {
|
|
1186
1221
|
return [
|
|
1187
1222
|
e.at,
|
|
1188
1223
|
"durationMs" in e && typeof e.durationMs == "number" ? `${Math.round(e.durationMs)}ms` : void 0,
|
|
@@ -1191,20 +1226,20 @@ function St(e) {
|
|
|
1191
1226
|
"errorMessage" in e ? e.errorMessage : void 0
|
|
1192
1227
|
].filter(Boolean).join(" - ");
|
|
1193
1228
|
}
|
|
1194
|
-
function
|
|
1229
|
+
function Rr(e) {
|
|
1195
1230
|
throw new Error(`Unsupported Semaphor trace event: ${JSON.stringify(e)}`);
|
|
1196
1231
|
}
|
|
1197
|
-
function
|
|
1198
|
-
return Array.isArray(e) ? e.filter((
|
|
1232
|
+
function be(e) {
|
|
1233
|
+
return Array.isArray(e) ? e.filter((t) => typeof t == "string") : [];
|
|
1199
1234
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const
|
|
1235
|
+
function Er(e) {
|
|
1236
|
+
const t = e == null ? void 0 : e.metadata, r = t && typeof t == "object" && !Array.isArray(t) && "dataAppDebug" in t && t.dataAppDebug && typeof t.dataAppDebug == "object" && !Array.isArray(t.dataAppDebug) ? t.dataAppDebug : void 0;
|
|
1202
1237
|
return {
|
|
1203
|
-
compiledSql: typeof (
|
|
1204
|
-
queryHash: typeof (
|
|
1238
|
+
compiledSql: typeof (r == null ? void 0 : r.compiledSql) == "string" ? r.compiledSql : void 0,
|
|
1239
|
+
queryHash: typeof (r == null ? void 0 : r.queryHash) == "string" ? r.queryHash : void 0
|
|
1205
1240
|
};
|
|
1206
1241
|
}
|
|
1207
|
-
function
|
|
1242
|
+
function kr(e) {
|
|
1208
1243
|
return e === "relative" ? {
|
|
1209
1244
|
position: "relative",
|
|
1210
1245
|
top: "auto",
|
|
@@ -1218,7 +1253,7 @@ function It(e) {
|
|
|
1218
1253
|
left: e.endsWith("left") ? 20 : "auto"
|
|
1219
1254
|
};
|
|
1220
1255
|
}
|
|
1221
|
-
function
|
|
1256
|
+
function Cr(e) {
|
|
1222
1257
|
return e === "error" ? {
|
|
1223
1258
|
borderColor: "var(--sd-error-border)",
|
|
1224
1259
|
background: "var(--sd-error-bg)",
|
|
@@ -1233,7 +1268,7 @@ function qt(e) {
|
|
|
1233
1268
|
color: "var(--sd-success-fg)"
|
|
1234
1269
|
};
|
|
1235
1270
|
}
|
|
1236
|
-
function
|
|
1271
|
+
function Dr(e) {
|
|
1237
1272
|
return e === "right" ? {
|
|
1238
1273
|
top: 16,
|
|
1239
1274
|
right: 16,
|
|
@@ -1252,23 +1287,23 @@ function At(e) {
|
|
|
1252
1287
|
borderRadius: 6
|
|
1253
1288
|
};
|
|
1254
1289
|
}
|
|
1255
|
-
function
|
|
1290
|
+
function Lr(e) {
|
|
1256
1291
|
return e === "right" ? {
|
|
1257
1292
|
gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
|
|
1258
1293
|
} : {
|
|
1259
1294
|
gridTemplateColumns: "minmax(260px, 340px) minmax(0, 1fr)"
|
|
1260
1295
|
};
|
|
1261
1296
|
}
|
|
1262
|
-
function
|
|
1297
|
+
function Or(e) {
|
|
1263
1298
|
return {
|
|
1264
1299
|
borderRight: "1px solid var(--sd-border)",
|
|
1265
1300
|
borderBottom: 0
|
|
1266
1301
|
};
|
|
1267
1302
|
}
|
|
1268
|
-
function
|
|
1303
|
+
function pt(e) {
|
|
1269
1304
|
return e === "error" ? { background: "var(--sd-error-dot)" } : e === "success" ? { background: "var(--sd-success-dot)" } : e === "loading" ? { background: "var(--sd-loading-dot)" } : { background: "var(--sd-idle-dot)" };
|
|
1270
1305
|
}
|
|
1271
|
-
function
|
|
1306
|
+
function Br(e) {
|
|
1272
1307
|
return e === "error" ? {
|
|
1273
1308
|
borderColor: "var(--sd-error-border)",
|
|
1274
1309
|
color: "var(--sd-error-fg)"
|
|
@@ -1283,7 +1318,7 @@ function Tt(e) {
|
|
|
1283
1318
|
color: "var(--sd-fg-muted)"
|
|
1284
1319
|
};
|
|
1285
1320
|
}
|
|
1286
|
-
const
|
|
1321
|
+
const Pe = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", Kr = `
|
|
1287
1322
|
.${$} {
|
|
1288
1323
|
--sd-bg: #ffffff;
|
|
1289
1324
|
--sd-bg-muted: #fafafa;
|
|
@@ -1351,19 +1386,19 @@ const je = "semaphor-devtools-stylesheet", $ = "semaphor-devtools", kt = `
|
|
|
1351
1386
|
word-break: break-all;
|
|
1352
1387
|
}
|
|
1353
1388
|
`;
|
|
1354
|
-
function
|
|
1355
|
-
if (typeof document > "u" || document.getElementById(
|
|
1389
|
+
function mt() {
|
|
1390
|
+
if (typeof document > "u" || document.getElementById(Pe))
|
|
1356
1391
|
return;
|
|
1357
1392
|
const e = document.createElement("style");
|
|
1358
|
-
e.id =
|
|
1393
|
+
e.id = Pe, e.textContent = Kr, document.head.appendChild(e);
|
|
1359
1394
|
}
|
|
1360
|
-
const
|
|
1395
|
+
const se = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', ae = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", Se = {
|
|
1361
1396
|
color: "var(--sd-fg-muted)",
|
|
1362
1397
|
fontSize: 10,
|
|
1363
1398
|
fontWeight: 600,
|
|
1364
1399
|
textTransform: "uppercase",
|
|
1365
1400
|
letterSpacing: "0.08em"
|
|
1366
|
-
},
|
|
1401
|
+
}, l = {
|
|
1367
1402
|
launcher: {
|
|
1368
1403
|
position: "fixed",
|
|
1369
1404
|
bottom: 20,
|
|
@@ -1378,7 +1413,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1378
1413
|
borderStyle: "solid",
|
|
1379
1414
|
borderRadius: 6,
|
|
1380
1415
|
boxShadow: "var(--sd-shadow)",
|
|
1381
|
-
font: `600 12px/1.2 ${
|
|
1416
|
+
font: `600 12px/1.2 ${se}`,
|
|
1382
1417
|
cursor: "pointer"
|
|
1383
1418
|
},
|
|
1384
1419
|
launcherText: {
|
|
@@ -1420,7 +1455,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1420
1455
|
background: "var(--sd-bg)",
|
|
1421
1456
|
color: "var(--sd-fg)",
|
|
1422
1457
|
boxShadow: "var(--sd-shadow)",
|
|
1423
|
-
font: `13px/1.4 ${
|
|
1458
|
+
font: `13px/1.4 ${se}`
|
|
1424
1459
|
},
|
|
1425
1460
|
panelFullscreen: {
|
|
1426
1461
|
top: 0,
|
|
@@ -1489,7 +1524,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1489
1524
|
outline: 0,
|
|
1490
1525
|
background: "transparent",
|
|
1491
1526
|
color: "var(--sd-fg)",
|
|
1492
|
-
font: `12px/1.4 ${
|
|
1527
|
+
font: `12px/1.4 ${se}`
|
|
1493
1528
|
},
|
|
1494
1529
|
panelBody: {
|
|
1495
1530
|
display: "grid",
|
|
@@ -1515,7 +1550,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1515
1550
|
alignItems: "center",
|
|
1516
1551
|
justifyContent: "space-between",
|
|
1517
1552
|
padding: "4px 6px 3px",
|
|
1518
|
-
...
|
|
1553
|
+
...Se
|
|
1519
1554
|
},
|
|
1520
1555
|
queryGroupCount: {
|
|
1521
1556
|
color: "var(--sd-fg-subtle)",
|
|
@@ -1581,6 +1616,13 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1581
1616
|
fontSize: 11,
|
|
1582
1617
|
lineHeight: 1.35
|
|
1583
1618
|
},
|
|
1619
|
+
queryListSourceSecondary: {
|
|
1620
|
+
minWidth: 0,
|
|
1621
|
+
paddingLeft: 14,
|
|
1622
|
+
color: "var(--sd-fg-subtle)",
|
|
1623
|
+
fontSize: 10,
|
|
1624
|
+
lineHeight: 1.3
|
|
1625
|
+
},
|
|
1584
1626
|
detailsPane: {
|
|
1585
1627
|
minHeight: 0,
|
|
1586
1628
|
overflowY: "auto",
|
|
@@ -1639,7 +1681,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1639
1681
|
gap: 4
|
|
1640
1682
|
},
|
|
1641
1683
|
detailsCaptionItemMono: {
|
|
1642
|
-
fontFamily:
|
|
1684
|
+
fontFamily: ae
|
|
1643
1685
|
},
|
|
1644
1686
|
detailsCaptionLabel: {
|
|
1645
1687
|
color: "var(--sd-fg-subtle)"
|
|
@@ -1653,7 +1695,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1653
1695
|
},
|
|
1654
1696
|
disclosureSummary: {
|
|
1655
1697
|
cursor: "pointer",
|
|
1656
|
-
...
|
|
1698
|
+
...Se
|
|
1657
1699
|
},
|
|
1658
1700
|
disclosureBody: {
|
|
1659
1701
|
marginTop: 8
|
|
@@ -1845,7 +1887,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1845
1887
|
textOverflow: "ellipsis",
|
|
1846
1888
|
whiteSpace: "nowrap",
|
|
1847
1889
|
color: "var(--sd-fg)",
|
|
1848
|
-
fontFamily:
|
|
1890
|
+
fontFamily: ae,
|
|
1849
1891
|
fontSize: 11,
|
|
1850
1892
|
fontWeight: 600
|
|
1851
1893
|
},
|
|
@@ -1858,7 +1900,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1858
1900
|
borderRadius: 3,
|
|
1859
1901
|
background: "var(--sd-bg-accent)",
|
|
1860
1902
|
color: "var(--sd-fg-muted)",
|
|
1861
|
-
fontFamily:
|
|
1903
|
+
fontFamily: ae,
|
|
1862
1904
|
fontSize: 10,
|
|
1863
1905
|
textTransform: "uppercase",
|
|
1864
1906
|
letterSpacing: "0.06em"
|
|
@@ -1917,7 +1959,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1917
1959
|
gap: 5
|
|
1918
1960
|
},
|
|
1919
1961
|
codeBlockLabel: {
|
|
1920
|
-
...
|
|
1962
|
+
...Se
|
|
1921
1963
|
},
|
|
1922
1964
|
codeBlock: {
|
|
1923
1965
|
maxHeight: 260,
|
|
@@ -1928,7 +1970,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1928
1970
|
borderRadius: 5,
|
|
1929
1971
|
background: "var(--sd-bg-muted)",
|
|
1930
1972
|
color: "var(--sd-fg)",
|
|
1931
|
-
fontFamily:
|
|
1973
|
+
fontFamily: ae,
|
|
1932
1974
|
fontSize: 11,
|
|
1933
1975
|
lineHeight: 1.5,
|
|
1934
1976
|
whiteSpace: "pre-wrap"
|
|
@@ -1950,7 +1992,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1950
1992
|
borderStyle: "solid",
|
|
1951
1993
|
borderRadius: 5,
|
|
1952
1994
|
background: "var(--sd-bg)",
|
|
1953
|
-
font: `600 11px/1 ${
|
|
1995
|
+
font: `600 11px/1 ${se}`,
|
|
1954
1996
|
cursor: "pointer"
|
|
1955
1997
|
},
|
|
1956
1998
|
inspectButtonText: {
|
|
@@ -1959,7 +2001,7 @@ const oe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1959
2001
|
whiteSpace: "nowrap"
|
|
1960
2002
|
}
|
|
1961
2003
|
};
|
|
1962
|
-
function
|
|
2004
|
+
function yt(e) {
|
|
1963
2005
|
return {
|
|
1964
2006
|
...e,
|
|
1965
2007
|
order: [],
|
|
@@ -1967,88 +2009,88 @@ function fr(e) {
|
|
|
1967
2009
|
sequence: 0
|
|
1968
2010
|
};
|
|
1969
2011
|
}
|
|
1970
|
-
function
|
|
1971
|
-
if (
|
|
1972
|
-
return
|
|
2012
|
+
function $r(e, t) {
|
|
2013
|
+
if (t.type === "config")
|
|
2014
|
+
return t.config.enabled ? {
|
|
1973
2015
|
...e,
|
|
1974
|
-
...
|
|
1975
|
-
} :
|
|
2016
|
+
...t.config
|
|
2017
|
+
} : yt(t.config);
|
|
1976
2018
|
if (!e.enabled)
|
|
1977
2019
|
return e;
|
|
1978
|
-
switch (
|
|
2020
|
+
switch (t.type) {
|
|
1979
2021
|
case "register":
|
|
1980
|
-
return
|
|
2022
|
+
return Wr(_r(e, t.descriptor));
|
|
1981
2023
|
case "unregister":
|
|
1982
|
-
return
|
|
2024
|
+
return Nr(e, t.traceKey);
|
|
1983
2025
|
case "event":
|
|
1984
|
-
return
|
|
2026
|
+
return Fr(e, t);
|
|
1985
2027
|
default:
|
|
1986
2028
|
return e;
|
|
1987
2029
|
}
|
|
1988
2030
|
}
|
|
1989
|
-
function
|
|
1990
|
-
const
|
|
1991
|
-
...
|
|
1992
|
-
...
|
|
1993
|
-
traceKey:
|
|
1994
|
-
latestAttempt: (
|
|
1995
|
-
recentEvents: (
|
|
2031
|
+
function _r(e, t) {
|
|
2032
|
+
const r = e.entries[t.traceKey], n = r ? e.sequence : e.sequence + 1, i = Be(), o = {
|
|
2033
|
+
...r || Mr(t),
|
|
2034
|
+
...gt(t),
|
|
2035
|
+
traceKey: t.traceKey,
|
|
2036
|
+
latestAttempt: (r == null ? void 0 : r.latestAttempt) || { status: "idle" },
|
|
2037
|
+
recentEvents: (r == null ? void 0 : r.recentEvents) || [],
|
|
1996
2038
|
mounted: !0,
|
|
1997
|
-
registeredAt: (
|
|
1998
|
-
lastEventAt: (
|
|
2039
|
+
registeredAt: (r == null ? void 0 : r.registeredAt) || n,
|
|
2040
|
+
lastEventAt: (r == null ? void 0 : r.lastEventAt) || i
|
|
1999
2041
|
};
|
|
2000
2042
|
return {
|
|
2001
2043
|
...e,
|
|
2002
2044
|
sequence: n,
|
|
2003
|
-
order:
|
|
2045
|
+
order: r ? e.order : [...e.order, t.traceKey],
|
|
2004
2046
|
entries: {
|
|
2005
2047
|
...e.entries,
|
|
2006
|
-
[
|
|
2048
|
+
[t.traceKey]: o
|
|
2007
2049
|
}
|
|
2008
2050
|
};
|
|
2009
2051
|
}
|
|
2010
|
-
function
|
|
2011
|
-
const
|
|
2012
|
-
return
|
|
2052
|
+
function Nr(e, t) {
|
|
2053
|
+
const r = e.entries[t];
|
|
2054
|
+
return r ? {
|
|
2013
2055
|
...e,
|
|
2014
2056
|
entries: {
|
|
2015
2057
|
...e.entries,
|
|
2016
|
-
[
|
|
2017
|
-
...
|
|
2058
|
+
[t]: {
|
|
2059
|
+
...r,
|
|
2018
2060
|
mounted: !1
|
|
2019
2061
|
}
|
|
2020
2062
|
}
|
|
2021
2063
|
} : e;
|
|
2022
2064
|
}
|
|
2023
|
-
function
|
|
2024
|
-
const
|
|
2025
|
-
if (!
|
|
2065
|
+
function Fr(e, t) {
|
|
2066
|
+
const r = e.entries[t.traceKey];
|
|
2067
|
+
if (!r)
|
|
2026
2068
|
return e;
|
|
2027
|
-
const n =
|
|
2028
|
-
...
|
|
2029
|
-
|
|
2069
|
+
const n = Be(), i = [
|
|
2070
|
+
...r.recentEvents,
|
|
2071
|
+
t.event
|
|
2030
2072
|
].slice(-e.maxEventsPerQuery);
|
|
2031
2073
|
return {
|
|
2032
2074
|
...e,
|
|
2033
2075
|
entries: {
|
|
2034
2076
|
...e.entries,
|
|
2035
|
-
[
|
|
2036
|
-
...
|
|
2037
|
-
latestAttempt:
|
|
2038
|
-
...
|
|
2039
|
-
...
|
|
2040
|
-
} :
|
|
2077
|
+
[t.traceKey]: {
|
|
2078
|
+
...r,
|
|
2079
|
+
latestAttempt: t.latestAttempt ? {
|
|
2080
|
+
...r.latestAttempt,
|
|
2081
|
+
...t.latestAttempt
|
|
2082
|
+
} : r.latestAttempt,
|
|
2041
2083
|
recentEvents: i,
|
|
2042
2084
|
lastEventAt: n
|
|
2043
2085
|
}
|
|
2044
2086
|
}
|
|
2045
2087
|
};
|
|
2046
2088
|
}
|
|
2047
|
-
function
|
|
2089
|
+
function Wr(e) {
|
|
2048
2090
|
if (e.order.length <= e.maxQueries)
|
|
2049
2091
|
return e;
|
|
2050
|
-
const
|
|
2051
|
-
|
|
2092
|
+
const t = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i, o) => i.mounted !== o.mounted ? i.mounted ? 1 : -1 : i.lastEventAt - o.lastEventAt), r = e.order.length - e.maxQueries, n = new Set(
|
|
2093
|
+
t.slice(0, r).map((i) => i.traceKey)
|
|
2052
2094
|
);
|
|
2053
2095
|
return n.size ? {
|
|
2054
2096
|
...e,
|
|
@@ -2058,186 +2100,189 @@ function Bt(e) {
|
|
|
2058
2100
|
)
|
|
2059
2101
|
} : e;
|
|
2060
2102
|
}
|
|
2061
|
-
function
|
|
2062
|
-
const
|
|
2103
|
+
function Mr(e) {
|
|
2104
|
+
const t = Be();
|
|
2063
2105
|
return {
|
|
2064
|
-
...
|
|
2106
|
+
...gt(e),
|
|
2065
2107
|
traceKey: e.traceKey,
|
|
2066
2108
|
latestAttempt: { status: "idle" },
|
|
2067
2109
|
recentEvents: [],
|
|
2068
2110
|
mounted: !0,
|
|
2069
2111
|
registeredAt: 0,
|
|
2070
|
-
lastEventAt:
|
|
2112
|
+
lastEventAt: t
|
|
2071
2113
|
};
|
|
2072
2114
|
}
|
|
2073
|
-
function
|
|
2115
|
+
function gt(e) {
|
|
2074
2116
|
var n;
|
|
2075
|
-
const
|
|
2117
|
+
const t = Xr(e.spec), r = Zr(
|
|
2076
2118
|
e.spec,
|
|
2077
2119
|
e.activeInputs
|
|
2078
2120
|
);
|
|
2079
2121
|
return {
|
|
2080
|
-
traceId:
|
|
2122
|
+
traceId: St(e.traceKey),
|
|
2081
2123
|
viewId: e.viewId,
|
|
2124
|
+
viewTitle: e.viewTitle,
|
|
2125
|
+
visualType: e.visualType,
|
|
2126
|
+
sectionTitle: e.sectionTitle,
|
|
2082
2127
|
queryId: e.queryId,
|
|
2083
|
-
queryLabel: e.queryLabel
|
|
2128
|
+
queryLabel: e.queryLabel,
|
|
2084
2129
|
queryKind: e.queryKind,
|
|
2085
2130
|
builder: e.builder,
|
|
2086
|
-
sourceRefs:
|
|
2131
|
+
sourceRefs: Yr(e.intent),
|
|
2087
2132
|
sourceHints: (n = e.sourceHints) != null && n.length ? e.sourceHints : void 0,
|
|
2088
|
-
projectionFieldRefs:
|
|
2089
|
-
inputFieldRefs:
|
|
2090
|
-
fieldRefs:
|
|
2133
|
+
projectionFieldRefs: t,
|
|
2134
|
+
inputFieldRefs: r,
|
|
2135
|
+
fieldRefs: en(e.intent),
|
|
2091
2136
|
inputsApplied: (e.activeInputs || []).map((i) => ({
|
|
2092
2137
|
inputId: i.inputId,
|
|
2093
2138
|
fieldRef: i.field,
|
|
2094
2139
|
operator: i.operator,
|
|
2095
|
-
valuePreview:
|
|
2140
|
+
valuePreview: Gr(i)
|
|
2096
2141
|
})),
|
|
2097
2142
|
recentEvents: [],
|
|
2098
2143
|
clientWarnings: e.clientWarnings
|
|
2099
2144
|
};
|
|
2100
2145
|
}
|
|
2101
|
-
function
|
|
2146
|
+
function de(e) {
|
|
2102
2147
|
const {
|
|
2103
|
-
traceKey:
|
|
2104
|
-
mounted:
|
|
2148
|
+
traceKey: t,
|
|
2149
|
+
mounted: r,
|
|
2105
2150
|
registeredAt: n,
|
|
2106
2151
|
lastEventAt: i,
|
|
2107
|
-
...
|
|
2152
|
+
...o
|
|
2108
2153
|
} = e;
|
|
2109
|
-
return
|
|
2154
|
+
return o;
|
|
2110
2155
|
}
|
|
2111
|
-
function
|
|
2156
|
+
function ce(e) {
|
|
2112
2157
|
return e.enabled ? {
|
|
2113
2158
|
enabled: !0,
|
|
2114
|
-
queries: e.order.map((
|
|
2115
|
-
getQuery: (
|
|
2159
|
+
queries: e.order.map((r) => e.entries[r]).filter((r) => !!r).map(de),
|
|
2160
|
+
getQuery: (r) => {
|
|
2116
2161
|
const n = Object.values(e.entries).find(
|
|
2117
|
-
(i) => i.queryId ===
|
|
2162
|
+
(i) => i.queryId === r
|
|
2118
2163
|
);
|
|
2119
|
-
return n ?
|
|
2164
|
+
return n ? de(n) : void 0;
|
|
2120
2165
|
},
|
|
2121
|
-
getQueries: (
|
|
2122
|
-
} :
|
|
2166
|
+
getQueries: (r) => Object.values(e.entries).filter((n) => n.queryId === r).map(de)
|
|
2167
|
+
} : it;
|
|
2123
2168
|
}
|
|
2124
|
-
function
|
|
2169
|
+
function zr(e) {
|
|
2125
2170
|
return {
|
|
2126
|
-
snapshot: () =>
|
|
2127
|
-
getQuery: (
|
|
2128
|
-
getQueries: (
|
|
2171
|
+
snapshot: () => jr(ce(e())),
|
|
2172
|
+
getQuery: (t) => Ve(ce(e()).getQuery(t)),
|
|
2173
|
+
getQueries: (t) => ce(e()).getQueries(t).map((r) => Ve(r)).filter((r) => !!r)
|
|
2129
2174
|
};
|
|
2130
2175
|
}
|
|
2131
|
-
function
|
|
2176
|
+
function jr(e) {
|
|
2132
2177
|
if (!e.enabled)
|
|
2133
2178
|
return e;
|
|
2134
|
-
const
|
|
2179
|
+
const t = e.queries.map(ht);
|
|
2135
2180
|
return {
|
|
2136
2181
|
enabled: e.enabled,
|
|
2137
|
-
queries:
|
|
2138
|
-
getQuery: (
|
|
2139
|
-
getQueries: (
|
|
2182
|
+
queries: t,
|
|
2183
|
+
getQuery: (r) => t.find((n) => n.queryId === r),
|
|
2184
|
+
getQueries: (r) => t.filter((n) => n.queryId === r)
|
|
2140
2185
|
};
|
|
2141
2186
|
}
|
|
2142
|
-
function
|
|
2143
|
-
return e ?
|
|
2187
|
+
function Ve(e) {
|
|
2188
|
+
return e ? ht(e) : void 0;
|
|
2144
2189
|
}
|
|
2145
|
-
function
|
|
2146
|
-
var
|
|
2147
|
-
return (
|
|
2190
|
+
function ht(e) {
|
|
2191
|
+
var t;
|
|
2192
|
+
return (t = e == null ? void 0 : e.latestAttempt) != null && t.executionResult ? {
|
|
2148
2193
|
...e,
|
|
2149
2194
|
latestAttempt: {
|
|
2150
2195
|
...e.latestAttempt,
|
|
2151
|
-
executionResult:
|
|
2196
|
+
executionResult: Hr(
|
|
2152
2197
|
e.latestAttempt.executionResult
|
|
2153
2198
|
)
|
|
2154
2199
|
}
|
|
2155
2200
|
} : e;
|
|
2156
2201
|
}
|
|
2157
|
-
function
|
|
2202
|
+
function Hr(e) {
|
|
2158
2203
|
const {
|
|
2159
|
-
compiledQuery:
|
|
2160
|
-
intent:
|
|
2204
|
+
compiledQuery: t,
|
|
2205
|
+
intent: r,
|
|
2161
2206
|
result: n,
|
|
2162
2207
|
...i
|
|
2163
|
-
} = e,
|
|
2208
|
+
} = e, o = Pr(
|
|
2164
2209
|
i.metadata
|
|
2165
2210
|
);
|
|
2166
2211
|
return {
|
|
2167
2212
|
...i,
|
|
2168
|
-
...
|
|
2213
|
+
...o ? { metadata: o } : {}
|
|
2169
2214
|
};
|
|
2170
2215
|
}
|
|
2171
|
-
function
|
|
2216
|
+
function Pr(e) {
|
|
2172
2217
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2173
2218
|
return e;
|
|
2174
|
-
const
|
|
2175
|
-
if (!
|
|
2219
|
+
const t = e.dataAppDebug;
|
|
2220
|
+
if (!t || typeof t != "object" || Array.isArray(t))
|
|
2176
2221
|
return e;
|
|
2177
|
-
const { compiledSql:
|
|
2222
|
+
const { compiledSql: r, ...n } = t;
|
|
2178
2223
|
return {
|
|
2179
2224
|
...e,
|
|
2180
2225
|
dataAppDebug: n
|
|
2181
2226
|
};
|
|
2182
2227
|
}
|
|
2183
|
-
function
|
|
2228
|
+
function Vr(e) {
|
|
2184
2229
|
return e === void 0 || e === !1 ? {
|
|
2185
2230
|
enabled: !1,
|
|
2186
2231
|
exposeWindowBridge: !1,
|
|
2187
|
-
maxEventsPerQuery:
|
|
2188
|
-
maxQueries:
|
|
2232
|
+
maxEventsPerQuery: he,
|
|
2233
|
+
maxQueries: ve
|
|
2189
2234
|
} : e === !0 ? {
|
|
2190
2235
|
enabled: !0,
|
|
2191
2236
|
exposeWindowBridge: !1,
|
|
2192
|
-
maxEventsPerQuery:
|
|
2193
|
-
maxQueries:
|
|
2237
|
+
maxEventsPerQuery: he,
|
|
2238
|
+
maxQueries: ve
|
|
2194
2239
|
} : {
|
|
2195
2240
|
enabled: e.enabled !== !1,
|
|
2196
2241
|
exposeWindowBridge: e.exposeWindowBridge === !0,
|
|
2197
|
-
maxEventsPerQuery:
|
|
2242
|
+
maxEventsPerQuery: Ge(
|
|
2198
2243
|
e.maxEventsPerQuery,
|
|
2199
|
-
|
|
2200
|
-
|
|
2244
|
+
he,
|
|
2245
|
+
Pt
|
|
2201
2246
|
),
|
|
2202
|
-
maxQueries:
|
|
2247
|
+
maxQueries: Ge(
|
|
2203
2248
|
e.maxQueries,
|
|
2204
|
-
|
|
2205
|
-
|
|
2249
|
+
ve,
|
|
2250
|
+
Vt
|
|
2206
2251
|
)
|
|
2207
2252
|
};
|
|
2208
2253
|
}
|
|
2209
|
-
function
|
|
2210
|
-
const
|
|
2254
|
+
function Qe(e) {
|
|
2255
|
+
const r = [
|
|
2211
2256
|
e == null ? void 0 : e.sourceHint,
|
|
2212
2257
|
...(e == null ? void 0 : e.sourceHints) || []
|
|
2213
2258
|
].filter((n) => !!n).map((n) => ({
|
|
2214
|
-
file:
|
|
2215
|
-
line:
|
|
2216
|
-
column:
|
|
2217
|
-
exportName:
|
|
2218
|
-
component:
|
|
2219
|
-
note:
|
|
2259
|
+
file: le(n.file),
|
|
2260
|
+
line: Ue(n.line),
|
|
2261
|
+
column: Ue(n.column),
|
|
2262
|
+
exportName: le(n.exportName),
|
|
2263
|
+
component: le(n.component),
|
|
2264
|
+
note: le(n.note)
|
|
2220
2265
|
})).filter(
|
|
2221
2266
|
(n) => !!(n.file || n.line || n.column || n.exportName || n.component || n.note)
|
|
2222
2267
|
);
|
|
2223
|
-
return
|
|
2268
|
+
return r.length ? r : void 0;
|
|
2224
2269
|
}
|
|
2225
|
-
function
|
|
2270
|
+
function le(e) {
|
|
2226
2271
|
if (typeof e != "string")
|
|
2227
2272
|
return;
|
|
2228
|
-
const
|
|
2229
|
-
return
|
|
2273
|
+
const t = e.trim();
|
|
2274
|
+
return t || void 0;
|
|
2230
2275
|
}
|
|
2231
|
-
function
|
|
2276
|
+
function Ue(e) {
|
|
2232
2277
|
return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
|
|
2233
2278
|
}
|
|
2234
|
-
function
|
|
2235
|
-
return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ?
|
|
2279
|
+
function Ge(e, t, r) {
|
|
2280
|
+
return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? t : Math.min(e, r);
|
|
2236
2281
|
}
|
|
2237
|
-
function
|
|
2282
|
+
function Qr(e) {
|
|
2238
2283
|
return typeof e.id == "string" && e.id.trim() ? e.id : void 0;
|
|
2239
2284
|
}
|
|
2240
|
-
function
|
|
2285
|
+
function Ur(e) {
|
|
2241
2286
|
switch (e) {
|
|
2242
2287
|
case "metric":
|
|
2243
2288
|
return "semaphor.metric";
|
|
@@ -2252,51 +2297,51 @@ function zt(e) {
|
|
|
2252
2297
|
case "sql":
|
|
2253
2298
|
return "semaphor.sql";
|
|
2254
2299
|
default:
|
|
2255
|
-
return
|
|
2300
|
+
return ye(e);
|
|
2256
2301
|
}
|
|
2257
2302
|
}
|
|
2258
|
-
function
|
|
2303
|
+
function ye(e) {
|
|
2259
2304
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
2260
2305
|
}
|
|
2261
|
-
function
|
|
2262
|
-
if (
|
|
2306
|
+
function Gr(e) {
|
|
2307
|
+
if (Jr(e))
|
|
2263
2308
|
return;
|
|
2264
|
-
const
|
|
2265
|
-
if (
|
|
2266
|
-
if (Array.isArray(
|
|
2267
|
-
const
|
|
2309
|
+
const t = e.value;
|
|
2310
|
+
if (t !== void 0) {
|
|
2311
|
+
if (Array.isArray(t)) {
|
|
2312
|
+
const r = t.filter(
|
|
2268
2313
|
(n) => typeof n == "string" || typeof n == "number" || typeof n == "boolean"
|
|
2269
2314
|
).map((n) => String(n));
|
|
2270
|
-
if (
|
|
2271
|
-
const n =
|
|
2272
|
-
return
|
|
2315
|
+
if (r.length === t.length && r.length > 0) {
|
|
2316
|
+
const n = r.slice(0, 3).join(", "), i = r.length > 3 ? `, +${r.length - 3} more` : "";
|
|
2317
|
+
return Je(`${n}${i}`);
|
|
2273
2318
|
}
|
|
2274
|
-
return `${
|
|
2319
|
+
return `${t.length} selected`;
|
|
2275
2320
|
}
|
|
2276
|
-
return typeof
|
|
2321
|
+
return typeof t == "number" || typeof t == "boolean" ? String(t) : typeof t == "string" ? Je(t) : t && typeof t == "object" ? `object(${Object.keys(t).slice(0, 5).join(",")})` : String(t);
|
|
2277
2322
|
}
|
|
2278
2323
|
}
|
|
2279
|
-
function
|
|
2324
|
+
function Je(e) {
|
|
2280
2325
|
return e.length > 80 ? `${e.slice(0, 77)}...` : e;
|
|
2281
2326
|
}
|
|
2282
|
-
function
|
|
2283
|
-
var
|
|
2284
|
-
const
|
|
2327
|
+
function Jr(e) {
|
|
2328
|
+
var r;
|
|
2329
|
+
const t = [
|
|
2285
2330
|
e.inputId,
|
|
2286
2331
|
e.label,
|
|
2287
|
-
(
|
|
2332
|
+
(r = e.field) == null ? void 0 : r.name
|
|
2288
2333
|
].filter(Boolean).join(" ").toLowerCase();
|
|
2289
2334
|
return ["token", "secret", "password", "email", "phone", "ssn"].some(
|
|
2290
|
-
(n) =>
|
|
2335
|
+
(n) => t.includes(n)
|
|
2291
2336
|
);
|
|
2292
2337
|
}
|
|
2293
|
-
function
|
|
2294
|
-
const
|
|
2295
|
-
return
|
|
2296
|
-
|
|
2297
|
-
}), [...
|
|
2338
|
+
function Yr(e) {
|
|
2339
|
+
const t = /* @__PURE__ */ new Map();
|
|
2340
|
+
return fe(e, (r) => {
|
|
2341
|
+
tn(r) && t.set(bt(r), r);
|
|
2342
|
+
}), [...t.values()];
|
|
2298
2343
|
}
|
|
2299
|
-
function
|
|
2344
|
+
function Xr(e) {
|
|
2300
2345
|
switch (e.queryKind) {
|
|
2301
2346
|
case "metric":
|
|
2302
2347
|
case "analysis":
|
|
@@ -2319,76 +2364,76 @@ function Vt(e) {
|
|
|
2319
2364
|
return P(e.fields || []);
|
|
2320
2365
|
case "matrix":
|
|
2321
2366
|
return P([
|
|
2322
|
-
...(e.rows || []).map(
|
|
2323
|
-
...(e.columns || []).map(
|
|
2324
|
-
...(e.values || []).map(
|
|
2367
|
+
...(e.rows || []).map(we),
|
|
2368
|
+
...(e.columns || []).map(we),
|
|
2369
|
+
...(e.values || []).map(we)
|
|
2325
2370
|
]);
|
|
2326
2371
|
default:
|
|
2327
|
-
return
|
|
2372
|
+
return ye(e);
|
|
2328
2373
|
}
|
|
2329
2374
|
}
|
|
2330
|
-
function
|
|
2331
|
-
const
|
|
2332
|
-
...(e.inputs || []).map(
|
|
2333
|
-
...(
|
|
2375
|
+
function Zr(e, t) {
|
|
2376
|
+
const r = [
|
|
2377
|
+
...(e.inputs || []).map(vt),
|
|
2378
|
+
...(t || []).map((n) => n.field)
|
|
2334
2379
|
];
|
|
2335
|
-
return P(
|
|
2380
|
+
return P(r);
|
|
2336
2381
|
}
|
|
2337
2382
|
function P(e) {
|
|
2338
|
-
const
|
|
2339
|
-
return e.forEach((
|
|
2340
|
-
|
|
2341
|
-
}), [...
|
|
2383
|
+
const t = /* @__PURE__ */ new Map();
|
|
2384
|
+
return e.forEach((r) => {
|
|
2385
|
+
r && ne(r) && t.set(Oe(r), r);
|
|
2386
|
+
}), [...t.values()];
|
|
2342
2387
|
}
|
|
2343
|
-
function
|
|
2388
|
+
function vt(e) {
|
|
2344
2389
|
if (!e || typeof e != "object")
|
|
2345
2390
|
return;
|
|
2346
|
-
const
|
|
2347
|
-
if (typeof
|
|
2348
|
-
const n =
|
|
2349
|
-
return
|
|
2391
|
+
const t = e.toAnalyticsInput;
|
|
2392
|
+
if (typeof t == "function") {
|
|
2393
|
+
const n = t.call(e);
|
|
2394
|
+
return vt(n);
|
|
2350
2395
|
}
|
|
2351
|
-
const
|
|
2352
|
-
return
|
|
2396
|
+
const r = e.field;
|
|
2397
|
+
return ne(r) ? r : void 0;
|
|
2353
2398
|
}
|
|
2354
|
-
function
|
|
2355
|
-
if (
|
|
2399
|
+
function we(e) {
|
|
2400
|
+
if (ne(e))
|
|
2356
2401
|
return e;
|
|
2357
2402
|
if (!e || typeof e != "object")
|
|
2358
2403
|
return;
|
|
2359
|
-
const
|
|
2360
|
-
return
|
|
2404
|
+
const t = e.field;
|
|
2405
|
+
return ne(t) ? t : void 0;
|
|
2361
2406
|
}
|
|
2362
|
-
function
|
|
2363
|
-
const
|
|
2364
|
-
return
|
|
2365
|
-
|
|
2366
|
-
}), [...
|
|
2407
|
+
function en(e) {
|
|
2408
|
+
const t = /* @__PURE__ */ new Map();
|
|
2409
|
+
return fe(e, (r) => {
|
|
2410
|
+
ne(r) && t.set(Oe(r), r);
|
|
2411
|
+
}), [...t.values()];
|
|
2367
2412
|
}
|
|
2368
|
-
function
|
|
2413
|
+
function fe(e, t) {
|
|
2369
2414
|
if (!(!e || typeof e != "object")) {
|
|
2370
|
-
if (
|
|
2371
|
-
e.forEach((
|
|
2415
|
+
if (t(e), Array.isArray(e)) {
|
|
2416
|
+
e.forEach((r) => fe(r, t));
|
|
2372
2417
|
return;
|
|
2373
2418
|
}
|
|
2374
2419
|
Object.values(e).forEach(
|
|
2375
|
-
(
|
|
2420
|
+
(r) => fe(r, t)
|
|
2376
2421
|
);
|
|
2377
2422
|
}
|
|
2378
2423
|
}
|
|
2379
|
-
function
|
|
2424
|
+
function tn(e) {
|
|
2380
2425
|
if (!e || typeof e != "object")
|
|
2381
2426
|
return !1;
|
|
2382
|
-
const
|
|
2383
|
-
return
|
|
2427
|
+
const t = e;
|
|
2428
|
+
return t.kind === "semantic" ? typeof t.domainId == "string" && typeof t.datasetName == "string" : t.kind === "physical" ? typeof t.connectionId == "string" && typeof t.tableName == "string" : t.kind === "sql" ? typeof t.connectionId == "string" : !1;
|
|
2384
2429
|
}
|
|
2385
|
-
function
|
|
2430
|
+
function ne(e) {
|
|
2386
2431
|
if (!e || typeof e != "object")
|
|
2387
2432
|
return !1;
|
|
2388
|
-
const
|
|
2389
|
-
return typeof
|
|
2433
|
+
const t = e;
|
|
2434
|
+
return typeof t.name == "string" && (t.source !== void 0 || t.role !== void 0 || t.dataType !== void 0 || t.aggregate !== void 0);
|
|
2390
2435
|
}
|
|
2391
|
-
function
|
|
2436
|
+
function bt(e) {
|
|
2392
2437
|
return e.kind === "semantic" ? [
|
|
2393
2438
|
e.kind,
|
|
2394
2439
|
e.domainId,
|
|
@@ -2406,38 +2451,38 @@ function Oe(e) {
|
|
|
2406
2451
|
e.name,
|
|
2407
2452
|
e.role,
|
|
2408
2453
|
e.aggregate,
|
|
2409
|
-
e.source ?
|
|
2454
|
+
e.source ? bt(e.source) : ""
|
|
2410
2455
|
].join(":");
|
|
2411
2456
|
}
|
|
2412
|
-
function
|
|
2413
|
-
const
|
|
2414
|
-
return typeof (
|
|
2457
|
+
function rn(e) {
|
|
2458
|
+
const t = e;
|
|
2459
|
+
return typeof (t == null ? void 0 : t.rowCount) == "number" ? t.rowCount : Array.isArray(t == null ? void 0 : t.records) ? t.records.length : void 0;
|
|
2415
2460
|
}
|
|
2416
|
-
function
|
|
2417
|
-
const
|
|
2418
|
-
return Array.isArray(
|
|
2461
|
+
function nn(e) {
|
|
2462
|
+
const t = e;
|
|
2463
|
+
return Array.isArray(t == null ? void 0 : t.columns) ? t.columns.length : void 0;
|
|
2419
2464
|
}
|
|
2420
|
-
function
|
|
2421
|
-
const
|
|
2422
|
-
return
|
|
2465
|
+
function Ye(e) {
|
|
2466
|
+
const t = e;
|
|
2467
|
+
return t == null ? void 0 : t.executionResult;
|
|
2423
2468
|
}
|
|
2424
|
-
function
|
|
2425
|
-
const
|
|
2426
|
-
return typeof (
|
|
2469
|
+
function Xe(e) {
|
|
2470
|
+
const t = e;
|
|
2471
|
+
return typeof (t == null ? void 0 : t.requestId) == "string" ? t.requestId : void 0;
|
|
2427
2472
|
}
|
|
2428
|
-
function
|
|
2429
|
-
let
|
|
2430
|
-
for (let
|
|
2431
|
-
|
|
2432
|
-
return (
|
|
2473
|
+
function St(e) {
|
|
2474
|
+
let t = 2166136261;
|
|
2475
|
+
for (let r = 0; r < e.length; r += 1)
|
|
2476
|
+
t ^= e.charCodeAt(r), t = Math.imul(t, 16777619);
|
|
2477
|
+
return (t >>> 0).toString(36);
|
|
2433
2478
|
}
|
|
2434
|
-
function
|
|
2479
|
+
function ue() {
|
|
2435
2480
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
2436
2481
|
}
|
|
2437
|
-
function
|
|
2482
|
+
function Be() {
|
|
2438
2483
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
2439
2484
|
}
|
|
2440
|
-
const
|
|
2485
|
+
const on = [
|
|
2441
2486
|
"records",
|
|
2442
2487
|
"changes",
|
|
2443
2488
|
"drivers",
|
|
@@ -2445,7 +2490,7 @@ const Xt = [
|
|
|
2445
2490
|
"largestPositiveChanges",
|
|
2446
2491
|
"largestNegativeDrivers",
|
|
2447
2492
|
"largestPositiveDrivers"
|
|
2448
|
-
],
|
|
2493
|
+
], sn = [
|
|
2449
2494
|
"records",
|
|
2450
2495
|
"changes",
|
|
2451
2496
|
"drivers",
|
|
@@ -2454,13 +2499,13 @@ const Xt = [
|
|
|
2454
2499
|
"largestNegativeDrivers",
|
|
2455
2500
|
"largestPositiveDrivers"
|
|
2456
2501
|
];
|
|
2457
|
-
function
|
|
2502
|
+
function wt(e) {
|
|
2458
2503
|
if (!e)
|
|
2459
2504
|
return {};
|
|
2460
|
-
const
|
|
2505
|
+
const t = cn(e.executionResult), r = an(e, t), n = un(r);
|
|
2461
2506
|
return {
|
|
2462
2507
|
...e,
|
|
2463
|
-
...Object.keys(
|
|
2508
|
+
...Object.keys(r).length ? { resultSets: r } : {},
|
|
2464
2509
|
...n ? {
|
|
2465
2510
|
columns: n.columns,
|
|
2466
2511
|
records: n.records,
|
|
@@ -2468,136 +2513,136 @@ function vr(e) {
|
|
|
2468
2513
|
} : {}
|
|
2469
2514
|
};
|
|
2470
2515
|
}
|
|
2471
|
-
function
|
|
2472
|
-
const
|
|
2473
|
-
for (const i of
|
|
2474
|
-
if (
|
|
2475
|
-
|
|
2516
|
+
function an(e, t) {
|
|
2517
|
+
const r = ln(e.resultSets);
|
|
2518
|
+
for (const i of on) {
|
|
2519
|
+
if (r[i]) {
|
|
2520
|
+
r[i] = xt(r[i]);
|
|
2476
2521
|
continue;
|
|
2477
2522
|
}
|
|
2478
|
-
const
|
|
2479
|
-
if (!
|
|
2523
|
+
const o = fn(e[i]);
|
|
2524
|
+
if (!o.length)
|
|
2480
2525
|
continue;
|
|
2481
|
-
const u =
|
|
2482
|
-
|
|
2483
|
-
records:
|
|
2526
|
+
const u = t.length ? t : pn(o);
|
|
2527
|
+
r[i] = {
|
|
2528
|
+
records: Ke(o, u),
|
|
2484
2529
|
columns: u,
|
|
2485
|
-
rowCount:
|
|
2530
|
+
rowCount: o.length
|
|
2486
2531
|
};
|
|
2487
2532
|
}
|
|
2488
|
-
const n =
|
|
2489
|
-
return n && n.records.length > 0 && !
|
|
2533
|
+
const n = dn(e.executionResult);
|
|
2534
|
+
return n && n.records.length > 0 && !r.records && (r.records = n), r;
|
|
2490
2535
|
}
|
|
2491
|
-
function
|
|
2536
|
+
function ln(e) {
|
|
2492
2537
|
return Object.fromEntries(
|
|
2493
|
-
Object.entries(e || {}).map(([
|
|
2494
|
-
|
|
2495
|
-
|
|
2538
|
+
Object.entries(e || {}).map(([t, r]) => [
|
|
2539
|
+
t,
|
|
2540
|
+
xt(r)
|
|
2496
2541
|
])
|
|
2497
2542
|
);
|
|
2498
2543
|
}
|
|
2499
|
-
function
|
|
2500
|
-
var
|
|
2544
|
+
function xt(e) {
|
|
2545
|
+
var t;
|
|
2501
2546
|
return {
|
|
2502
2547
|
...e,
|
|
2503
|
-
records:
|
|
2548
|
+
records: Ke(
|
|
2504
2549
|
e.records || [],
|
|
2505
2550
|
e.columns || []
|
|
2506
2551
|
),
|
|
2507
|
-
rowCount: e.rowCount ?? ((
|
|
2552
|
+
rowCount: e.rowCount ?? ((t = e.records) == null ? void 0 : t.length) ?? 0
|
|
2508
2553
|
};
|
|
2509
2554
|
}
|
|
2510
|
-
function
|
|
2511
|
-
var
|
|
2512
|
-
for (const
|
|
2513
|
-
if ((
|
|
2514
|
-
return e[
|
|
2515
|
-
return Object.values(e).find((
|
|
2516
|
-
}
|
|
2517
|
-
function
|
|
2518
|
-
const
|
|
2519
|
-
if (!(!
|
|
2555
|
+
function un(e) {
|
|
2556
|
+
var t;
|
|
2557
|
+
for (const r of sn)
|
|
2558
|
+
if ((t = e[r]) != null && t.records.length)
|
|
2559
|
+
return e[r];
|
|
2560
|
+
return Object.values(e).find((r) => r.records.length) || Object.values(e)[0];
|
|
2561
|
+
}
|
|
2562
|
+
function dn(e) {
|
|
2563
|
+
const t = e == null ? void 0 : e.result;
|
|
2564
|
+
if (!(!t || t.kind !== "records" && t.kind !== "sql"))
|
|
2520
2565
|
return {
|
|
2521
|
-
records:
|
|
2522
|
-
columns:
|
|
2523
|
-
rowCount:
|
|
2566
|
+
records: Ke(t.records, t.columns),
|
|
2567
|
+
columns: t.columns,
|
|
2568
|
+
rowCount: t.rowCount ?? t.records.length
|
|
2524
2569
|
};
|
|
2525
2570
|
}
|
|
2526
|
-
function
|
|
2527
|
-
const
|
|
2528
|
-
return !
|
|
2571
|
+
function cn(e) {
|
|
2572
|
+
const t = e == null ? void 0 : e.result;
|
|
2573
|
+
return !t || t.kind !== "records" && t.kind !== "sql" ? [] : t.columns;
|
|
2529
2574
|
}
|
|
2530
|
-
function
|
|
2575
|
+
function fn(e) {
|
|
2531
2576
|
return Array.isArray(e) ? e.filter(
|
|
2532
|
-
(
|
|
2577
|
+
(t) => !!(t && typeof t == "object" && !Array.isArray(t))
|
|
2533
2578
|
) : [];
|
|
2534
2579
|
}
|
|
2535
|
-
function
|
|
2536
|
-
return
|
|
2580
|
+
function Ke(e, t) {
|
|
2581
|
+
return t.length ? e.map((r) => {
|
|
2537
2582
|
const n = {};
|
|
2538
|
-
return
|
|
2539
|
-
const u =
|
|
2583
|
+
return t.forEach((i, o) => {
|
|
2584
|
+
const u = mn(r, {
|
|
2540
2585
|
name: i.key,
|
|
2541
2586
|
label: i.label,
|
|
2542
|
-
fallbackNames: [i.name, Object.keys(
|
|
2587
|
+
fallbackNames: [i.name, Object.keys(r)[o]]
|
|
2543
2588
|
});
|
|
2544
2589
|
u !== void 0 && (n[i.key] = u);
|
|
2545
|
-
}), Object.keys(n).length ? n :
|
|
2590
|
+
}), Object.keys(n).length ? n : r;
|
|
2546
2591
|
}) : e;
|
|
2547
2592
|
}
|
|
2548
|
-
function
|
|
2593
|
+
function pn(e) {
|
|
2549
2594
|
return Array.from(
|
|
2550
|
-
new Set(e.flatMap((
|
|
2551
|
-
).map((
|
|
2552
|
-
key:
|
|
2553
|
-
name:
|
|
2554
|
-
label:
|
|
2595
|
+
new Set(e.flatMap((r) => Object.keys(r)))
|
|
2596
|
+
).map((r) => ({
|
|
2597
|
+
key: r,
|
|
2598
|
+
name: r,
|
|
2599
|
+
label: r
|
|
2555
2600
|
}));
|
|
2556
2601
|
}
|
|
2557
|
-
function
|
|
2558
|
-
const
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
...
|
|
2602
|
+
function mn(e, t) {
|
|
2603
|
+
const r = [
|
|
2604
|
+
t.name,
|
|
2605
|
+
t.label,
|
|
2606
|
+
...t.fallbackNames || []
|
|
2562
2607
|
].filter((n) => !!n);
|
|
2563
|
-
for (const n of
|
|
2608
|
+
for (const n of r)
|
|
2564
2609
|
if (Object.prototype.hasOwnProperty.call(e, n))
|
|
2565
2610
|
return e[n];
|
|
2566
2611
|
}
|
|
2567
|
-
function
|
|
2612
|
+
function yn() {
|
|
2568
2613
|
return {
|
|
2569
|
-
executeAnalysis: (e,
|
|
2614
|
+
executeAnalysis: (e, t, r) => H(
|
|
2570
2615
|
e,
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
).then(
|
|
2574
|
-
executeMetric: (e,
|
|
2575
|
-
executeRecords: (e,
|
|
2576
|
-
executeInputOptions: (e,
|
|
2577
|
-
executeSql: (e,
|
|
2578
|
-
executeMatrix: (e,
|
|
2616
|
+
t,
|
|
2617
|
+
r ?? {}
|
|
2618
|
+
).then(wt),
|
|
2619
|
+
executeMetric: (e, t) => H(e, t),
|
|
2620
|
+
executeRecords: (e, t) => H(e, t),
|
|
2621
|
+
executeInputOptions: (e, t) => H(e, t),
|
|
2622
|
+
executeSql: (e, t) => H(e, t),
|
|
2623
|
+
executeMatrix: (e, t) => H(e, t)
|
|
2579
2624
|
};
|
|
2580
2625
|
}
|
|
2581
|
-
async function H(e,
|
|
2582
|
-
if (!
|
|
2626
|
+
async function H(e, t, r) {
|
|
2627
|
+
if (!t.token)
|
|
2583
2628
|
throw new Error(
|
|
2584
2629
|
"SemaphorDataAppProvider needs a token to execute queries."
|
|
2585
2630
|
);
|
|
2586
|
-
const n =
|
|
2587
|
-
let
|
|
2631
|
+
const n = In(t), i = vn(e, n);
|
|
2632
|
+
let o;
|
|
2588
2633
|
try {
|
|
2589
|
-
|
|
2634
|
+
o = await fetch(n, {
|
|
2590
2635
|
method: "POST",
|
|
2591
2636
|
headers: {
|
|
2592
2637
|
"Content-Type": "application/json",
|
|
2593
|
-
Authorization: `Bearer ${
|
|
2638
|
+
Authorization: `Bearer ${t.token}`
|
|
2594
2639
|
},
|
|
2595
2640
|
body: JSON.stringify({
|
|
2596
2641
|
intent: e,
|
|
2597
|
-
activeInputs:
|
|
2598
|
-
...
|
|
2642
|
+
activeInputs: t.activeInputs,
|
|
2643
|
+
...r ? { analysisOptions: r } : {},
|
|
2599
2644
|
resultShape: e.kind,
|
|
2600
|
-
...
|
|
2645
|
+
...hn(t) ? { debug: { responseDetail: "debug" } } : {}
|
|
2601
2646
|
})
|
|
2602
2647
|
});
|
|
2603
2648
|
} catch (c) {
|
|
@@ -2605,51 +2650,51 @@ async function H(e, r, t) {
|
|
|
2605
2650
|
`${i}: ${c instanceof Error ? c.message : String(c)}`
|
|
2606
2651
|
);
|
|
2607
2652
|
}
|
|
2608
|
-
const u = await
|
|
2609
|
-
if (!
|
|
2610
|
-
throw
|
|
2611
|
-
`${i}: ${u.error || `Semaphor Data App execution failed with status ${
|
|
2653
|
+
const u = await wn(o);
|
|
2654
|
+
if (!o.ok || u.error)
|
|
2655
|
+
throw gn(
|
|
2656
|
+
`${i}: ${u.error || `Semaphor Data App execution failed with status ${o.status}.`}`,
|
|
2612
2657
|
u
|
|
2613
2658
|
);
|
|
2614
2659
|
return u;
|
|
2615
2660
|
}
|
|
2616
|
-
function
|
|
2617
|
-
const
|
|
2618
|
-
return
|
|
2661
|
+
function gn(e, t) {
|
|
2662
|
+
const r = new Error(e);
|
|
2663
|
+
return t.requestId && (r.requestId = t.requestId), t.details !== void 0 && (r.details = t.details), t.executionResult !== void 0 && (r.executionResult = t.executionResult), r;
|
|
2619
2664
|
}
|
|
2620
|
-
function
|
|
2621
|
-
const
|
|
2622
|
-
return
|
|
2665
|
+
function hn(e) {
|
|
2666
|
+
const t = e.debug;
|
|
2667
|
+
return t ? t === !0 ? !0 : t.enabled !== !1 && t.requestServerDebug !== !1 : !1;
|
|
2623
2668
|
}
|
|
2624
|
-
function
|
|
2669
|
+
function vn(e, t) {
|
|
2625
2670
|
return [
|
|
2626
2671
|
`Semaphor ${e.kind} query`,
|
|
2627
2672
|
e.id ? `id=${e.id}` : void 0,
|
|
2628
2673
|
e.label ? `label=${e.label}` : void 0,
|
|
2629
|
-
|
|
2630
|
-
`endpoint=${
|
|
2631
|
-
].filter((
|
|
2632
|
-
}
|
|
2633
|
-
function
|
|
2634
|
-
const
|
|
2635
|
-
if (!(!
|
|
2636
|
-
if (
|
|
2674
|
+
bn(e),
|
|
2675
|
+
`endpoint=${Sn(t)}`
|
|
2676
|
+
].filter((r) => !!r).join(" ");
|
|
2677
|
+
}
|
|
2678
|
+
function bn(e) {
|
|
2679
|
+
const t = "source" in e ? e.source : void 0;
|
|
2680
|
+
if (!(!t || typeof t != "object")) {
|
|
2681
|
+
if (t.kind === "semantic")
|
|
2637
2682
|
return `source=${[
|
|
2638
|
-
|
|
2639
|
-
|
|
2683
|
+
t.domainId,
|
|
2684
|
+
t.datasetId || t.datasetName
|
|
2640
2685
|
].filter(Boolean).join("/")}`;
|
|
2641
|
-
if (
|
|
2686
|
+
if (t.kind === "physical")
|
|
2642
2687
|
return `source=${[
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2688
|
+
t.connectionId,
|
|
2689
|
+
t.databaseName,
|
|
2690
|
+
t.schemaName,
|
|
2691
|
+
t.tableName
|
|
2647
2692
|
].filter(Boolean).join("/")}`;
|
|
2648
|
-
if (
|
|
2649
|
-
return
|
|
2693
|
+
if (t.kind === "sql")
|
|
2694
|
+
return t.connectionId ? `source=${t.connectionId}` : void 0;
|
|
2650
2695
|
}
|
|
2651
2696
|
}
|
|
2652
|
-
function
|
|
2697
|
+
function Sn(e) {
|
|
2653
2698
|
if (!e)
|
|
2654
2699
|
return "/api/v1/data-app/execute";
|
|
2655
2700
|
try {
|
|
@@ -2658,218 +2703,218 @@ function mn(e) {
|
|
|
2658
2703
|
return e;
|
|
2659
2704
|
}
|
|
2660
2705
|
}
|
|
2661
|
-
async function
|
|
2662
|
-
const
|
|
2663
|
-
if (!
|
|
2706
|
+
async function wn(e) {
|
|
2707
|
+
const t = await e.text().catch(() => "");
|
|
2708
|
+
if (!t.trim())
|
|
2664
2709
|
return e.ok ? {
|
|
2665
2710
|
error: "Semaphor Data App execution returned an empty response."
|
|
2666
2711
|
} : {};
|
|
2667
2712
|
try {
|
|
2668
|
-
return JSON.parse(
|
|
2713
|
+
return JSON.parse(t);
|
|
2669
2714
|
} catch {
|
|
2670
2715
|
return e.ok ? {
|
|
2671
2716
|
error: "Semaphor Data App execution returned invalid JSON.",
|
|
2672
|
-
details:
|
|
2717
|
+
details: t
|
|
2673
2718
|
} : {
|
|
2674
|
-
error:
|
|
2675
|
-
details:
|
|
2719
|
+
error: xn(e, t),
|
|
2720
|
+
details: t
|
|
2676
2721
|
};
|
|
2677
2722
|
}
|
|
2678
2723
|
}
|
|
2679
|
-
function
|
|
2680
|
-
const
|
|
2681
|
-
return n ? `Semaphor Data App execution failed with status ${e.status}${
|
|
2724
|
+
function xn(e, t) {
|
|
2725
|
+
const r = e.statusText ? ` ${e.statusText}` : "", n = t.replace(/\s+/g, " ").trim();
|
|
2726
|
+
return n ? `Semaphor Data App execution failed with status ${e.status}${r}: ${n.slice(0, 240)}` : `Semaphor Data App execution failed with status ${e.status}${r}.`;
|
|
2682
2727
|
}
|
|
2683
|
-
function
|
|
2684
|
-
const
|
|
2685
|
-
return
|
|
2728
|
+
function In(e) {
|
|
2729
|
+
const t = qn(e).replace(/\/+$/, "");
|
|
2730
|
+
return t ? t.endsWith("/api") ? `${t}/v1/data-app/execute` : `${t}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
2686
2731
|
}
|
|
2687
|
-
function
|
|
2732
|
+
function qn(e) {
|
|
2688
2733
|
if (e.apiBaseUrl)
|
|
2689
2734
|
return e.apiBaseUrl;
|
|
2690
2735
|
if (!e.token)
|
|
2691
2736
|
return "";
|
|
2692
2737
|
try {
|
|
2693
|
-
return
|
|
2738
|
+
return jt(e.token).apiServiceUrl || "";
|
|
2694
2739
|
} catch {
|
|
2695
2740
|
return "";
|
|
2696
2741
|
}
|
|
2697
2742
|
}
|
|
2698
|
-
const
|
|
2699
|
-
function
|
|
2743
|
+
const It = pe({});
|
|
2744
|
+
function An() {
|
|
2700
2745
|
if (!(typeof window > "u"))
|
|
2701
2746
|
return window.__SEMAPHOR_DATA_APP_RUNTIME__;
|
|
2702
2747
|
}
|
|
2703
|
-
function
|
|
2704
|
-
return z(
|
|
2748
|
+
function Tn() {
|
|
2749
|
+
return z(It);
|
|
2705
2750
|
}
|
|
2706
|
-
const xe = { value: null },
|
|
2707
|
-
function
|
|
2708
|
-
const
|
|
2751
|
+
const xe = { value: null }, Ie = {}, Rn = { records: [] }, qe = { options: [] }, En = { records: [] }, Ae = {};
|
|
2752
|
+
function kn(e) {
|
|
2753
|
+
const t = U(e.inputs), r = Ot(e);
|
|
2709
2754
|
try {
|
|
2710
|
-
const n =
|
|
2755
|
+
const n = Bt(e), i = G(n);
|
|
2711
2756
|
return i ? {
|
|
2712
2757
|
error: i,
|
|
2713
|
-
activeInputs:
|
|
2714
|
-
analysisOptions:
|
|
2758
|
+
activeInputs: t,
|
|
2759
|
+
analysisOptions: r,
|
|
2715
2760
|
queryKey: q(
|
|
2716
2761
|
void 0,
|
|
2717
|
-
|
|
2762
|
+
t,
|
|
2718
2763
|
i,
|
|
2719
|
-
|
|
2764
|
+
r
|
|
2720
2765
|
),
|
|
2721
|
-
idleData:
|
|
2766
|
+
idleData: Ie
|
|
2722
2767
|
} : {
|
|
2723
2768
|
intent: n,
|
|
2724
2769
|
error: null,
|
|
2725
|
-
activeInputs:
|
|
2726
|
-
analysisOptions:
|
|
2727
|
-
queryKey: q(n,
|
|
2728
|
-
idleData:
|
|
2770
|
+
activeInputs: t,
|
|
2771
|
+
analysisOptions: r,
|
|
2772
|
+
queryKey: q(n, t, void 0, r),
|
|
2773
|
+
idleData: Ie
|
|
2729
2774
|
};
|
|
2730
2775
|
} catch (n) {
|
|
2731
2776
|
const i = N(n);
|
|
2732
2777
|
return {
|
|
2733
2778
|
error: i,
|
|
2734
|
-
activeInputs:
|
|
2735
|
-
analysisOptions:
|
|
2779
|
+
activeInputs: t,
|
|
2780
|
+
analysisOptions: r,
|
|
2736
2781
|
queryKey: q(
|
|
2737
2782
|
void 0,
|
|
2738
|
-
|
|
2783
|
+
t,
|
|
2739
2784
|
i,
|
|
2740
|
-
|
|
2785
|
+
r
|
|
2741
2786
|
),
|
|
2742
|
-
idleData:
|
|
2787
|
+
idleData: Ie
|
|
2743
2788
|
};
|
|
2744
2789
|
}
|
|
2745
2790
|
}
|
|
2746
|
-
function
|
|
2747
|
-
const
|
|
2791
|
+
function Cn(e) {
|
|
2792
|
+
const t = U(e.inputs);
|
|
2748
2793
|
try {
|
|
2749
|
-
const
|
|
2794
|
+
const r = Kt(e), n = G(r);
|
|
2750
2795
|
return n ? {
|
|
2751
2796
|
error: n,
|
|
2752
|
-
activeInputs:
|
|
2753
|
-
queryKey: q(void 0,
|
|
2797
|
+
activeInputs: t,
|
|
2798
|
+
queryKey: q(void 0, t, n),
|
|
2754
2799
|
idleData: xe
|
|
2755
2800
|
} : {
|
|
2756
|
-
intent:
|
|
2801
|
+
intent: r,
|
|
2757
2802
|
error: null,
|
|
2758
|
-
activeInputs:
|
|
2759
|
-
queryKey: q(
|
|
2803
|
+
activeInputs: t,
|
|
2804
|
+
queryKey: q(r, t),
|
|
2760
2805
|
idleData: xe
|
|
2761
2806
|
};
|
|
2762
|
-
} catch (
|
|
2763
|
-
const n = N(
|
|
2807
|
+
} catch (r) {
|
|
2808
|
+
const n = N(r);
|
|
2764
2809
|
return {
|
|
2765
2810
|
error: n,
|
|
2766
|
-
activeInputs:
|
|
2767
|
-
queryKey: q(void 0,
|
|
2811
|
+
activeInputs: t,
|
|
2812
|
+
queryKey: q(void 0, t, n),
|
|
2768
2813
|
idleData: xe
|
|
2769
2814
|
};
|
|
2770
2815
|
}
|
|
2771
2816
|
}
|
|
2772
|
-
function
|
|
2773
|
-
const
|
|
2817
|
+
function Dn(e) {
|
|
2818
|
+
const t = U(e.inputs), r = Rn;
|
|
2774
2819
|
try {
|
|
2775
|
-
const n =
|
|
2820
|
+
const n = Lt(e), i = G(n);
|
|
2776
2821
|
return i ? {
|
|
2777
2822
|
error: i,
|
|
2778
|
-
activeInputs:
|
|
2779
|
-
queryKey: q(void 0,
|
|
2780
|
-
idleData:
|
|
2823
|
+
activeInputs: t,
|
|
2824
|
+
queryKey: q(void 0, t, i),
|
|
2825
|
+
idleData: r
|
|
2781
2826
|
} : {
|
|
2782
2827
|
intent: n,
|
|
2783
2828
|
error: null,
|
|
2784
|
-
activeInputs:
|
|
2785
|
-
queryKey: q(n,
|
|
2786
|
-
idleData:
|
|
2829
|
+
activeInputs: t,
|
|
2830
|
+
queryKey: q(n, t),
|
|
2831
|
+
idleData: r
|
|
2787
2832
|
};
|
|
2788
2833
|
} catch (n) {
|
|
2789
2834
|
const i = N(n);
|
|
2790
2835
|
return {
|
|
2791
2836
|
error: i,
|
|
2792
|
-
activeInputs:
|
|
2793
|
-
queryKey: q(void 0,
|
|
2794
|
-
idleData:
|
|
2837
|
+
activeInputs: t,
|
|
2838
|
+
queryKey: q(void 0, t, i),
|
|
2839
|
+
idleData: r
|
|
2795
2840
|
};
|
|
2796
2841
|
}
|
|
2797
2842
|
}
|
|
2798
|
-
function
|
|
2799
|
-
const
|
|
2843
|
+
function Ln(e) {
|
|
2844
|
+
const t = U(e.inputs);
|
|
2800
2845
|
try {
|
|
2801
|
-
const
|
|
2846
|
+
const r = Dt(e), n = G(r);
|
|
2802
2847
|
return n ? {
|
|
2803
2848
|
error: n,
|
|
2804
|
-
activeInputs:
|
|
2805
|
-
queryKey: q(void 0,
|
|
2806
|
-
idleData:
|
|
2849
|
+
activeInputs: t,
|
|
2850
|
+
queryKey: q(void 0, t, n),
|
|
2851
|
+
idleData: qe
|
|
2807
2852
|
} : {
|
|
2808
|
-
intent:
|
|
2853
|
+
intent: r,
|
|
2809
2854
|
error: null,
|
|
2810
|
-
activeInputs:
|
|
2811
|
-
queryKey: q(
|
|
2812
|
-
idleData:
|
|
2855
|
+
activeInputs: t,
|
|
2856
|
+
queryKey: q(r, t),
|
|
2857
|
+
idleData: qe
|
|
2813
2858
|
};
|
|
2814
|
-
} catch (
|
|
2815
|
-
const n = N(
|
|
2859
|
+
} catch (r) {
|
|
2860
|
+
const n = N(r);
|
|
2816
2861
|
return {
|
|
2817
2862
|
error: n,
|
|
2818
|
-
activeInputs:
|
|
2819
|
-
queryKey: q(void 0,
|
|
2820
|
-
idleData:
|
|
2863
|
+
activeInputs: t,
|
|
2864
|
+
queryKey: q(void 0, t, n),
|
|
2865
|
+
idleData: qe
|
|
2821
2866
|
};
|
|
2822
2867
|
}
|
|
2823
2868
|
}
|
|
2824
|
-
function
|
|
2825
|
-
const
|
|
2869
|
+
function On(e) {
|
|
2870
|
+
const t = U(e.inputs), r = En;
|
|
2826
2871
|
try {
|
|
2827
|
-
const n =
|
|
2872
|
+
const n = Ct(e), i = G(n);
|
|
2828
2873
|
return i ? {
|
|
2829
2874
|
error: i,
|
|
2830
|
-
activeInputs:
|
|
2831
|
-
queryKey: q(void 0,
|
|
2832
|
-
idleData:
|
|
2875
|
+
activeInputs: t,
|
|
2876
|
+
queryKey: q(void 0, t, i),
|
|
2877
|
+
idleData: r
|
|
2833
2878
|
} : {
|
|
2834
2879
|
intent: n,
|
|
2835
2880
|
error: null,
|
|
2836
|
-
activeInputs:
|
|
2837
|
-
queryKey: q(n,
|
|
2838
|
-
idleData:
|
|
2881
|
+
activeInputs: t,
|
|
2882
|
+
queryKey: q(n, t),
|
|
2883
|
+
idleData: r
|
|
2839
2884
|
};
|
|
2840
2885
|
} catch (n) {
|
|
2841
2886
|
const i = N(n);
|
|
2842
2887
|
return {
|
|
2843
2888
|
error: i,
|
|
2844
|
-
activeInputs:
|
|
2845
|
-
queryKey: q(void 0,
|
|
2846
|
-
idleData:
|
|
2889
|
+
activeInputs: t,
|
|
2890
|
+
queryKey: q(void 0, t, i),
|
|
2891
|
+
idleData: r
|
|
2847
2892
|
};
|
|
2848
2893
|
}
|
|
2849
2894
|
}
|
|
2850
|
-
function
|
|
2851
|
-
const
|
|
2895
|
+
function Bn(e) {
|
|
2896
|
+
const t = U(e.inputs);
|
|
2852
2897
|
try {
|
|
2853
|
-
const
|
|
2898
|
+
const r = kt(e), n = G(r);
|
|
2854
2899
|
return n ? {
|
|
2855
2900
|
error: n,
|
|
2856
|
-
activeInputs:
|
|
2857
|
-
queryKey: q(void 0,
|
|
2858
|
-
idleData:
|
|
2901
|
+
activeInputs: t,
|
|
2902
|
+
queryKey: q(void 0, t, n),
|
|
2903
|
+
idleData: Ae
|
|
2859
2904
|
} : {
|
|
2860
|
-
intent:
|
|
2905
|
+
intent: r,
|
|
2861
2906
|
error: null,
|
|
2862
|
-
activeInputs:
|
|
2863
|
-
queryKey: q(
|
|
2864
|
-
idleData:
|
|
2907
|
+
activeInputs: t,
|
|
2908
|
+
queryKey: q(r, t),
|
|
2909
|
+
idleData: Ae
|
|
2865
2910
|
};
|
|
2866
|
-
} catch (
|
|
2867
|
-
const n = N(
|
|
2911
|
+
} catch (r) {
|
|
2912
|
+
const n = N(r);
|
|
2868
2913
|
return {
|
|
2869
2914
|
error: n,
|
|
2870
|
-
activeInputs:
|
|
2871
|
-
queryKey: q(void 0,
|
|
2872
|
-
idleData:
|
|
2915
|
+
activeInputs: t,
|
|
2916
|
+
queryKey: q(void 0, t, n),
|
|
2917
|
+
idleData: Ae
|
|
2873
2918
|
};
|
|
2874
2919
|
}
|
|
2875
2920
|
}
|
|
@@ -2877,36 +2922,36 @@ function N(e) {
|
|
|
2877
2922
|
return e instanceof Error ? e : new Error(String(e));
|
|
2878
2923
|
}
|
|
2879
2924
|
function G(e) {
|
|
2880
|
-
const
|
|
2881
|
-
if (
|
|
2925
|
+
const t = Ht(e);
|
|
2926
|
+
if (t.ok)
|
|
2882
2927
|
return null;
|
|
2883
|
-
const
|
|
2928
|
+
const r = t.errors.map(
|
|
2884
2929
|
(n) => n.path ? `${n.code} at ${n.path}: ${n.message}` : `${n.code}: ${n.message}`
|
|
2885
2930
|
).join("; ");
|
|
2886
|
-
return new Error(`Invalid Semaphor analytics intent. ${
|
|
2931
|
+
return new Error(`Invalid Semaphor analytics intent. ${r}`);
|
|
2887
2932
|
}
|
|
2888
|
-
function q(e,
|
|
2933
|
+
function q(e, t, r, n) {
|
|
2889
2934
|
return JSON.stringify({
|
|
2890
2935
|
intent: e,
|
|
2891
|
-
activeInputs:
|
|
2936
|
+
activeInputs: t,
|
|
2892
2937
|
analysisOptions: n,
|
|
2893
|
-
error:
|
|
2938
|
+
error: r == null ? void 0 : r.message
|
|
2894
2939
|
});
|
|
2895
2940
|
}
|
|
2896
|
-
function
|
|
2897
|
-
const [
|
|
2898
|
-
() =>
|
|
2941
|
+
function Xn(e) {
|
|
2942
|
+
const [t, r] = Q(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : t, o = b(
|
|
2943
|
+
() => tt(e.options),
|
|
2899
2944
|
[e.options]
|
|
2900
|
-
), u =
|
|
2945
|
+
), u = D(
|
|
2901
2946
|
(d) => {
|
|
2902
|
-
var
|
|
2947
|
+
var y;
|
|
2903
2948
|
const f = d;
|
|
2904
|
-
(
|
|
2949
|
+
(y = e.onValueChange) == null || y.call(e, f), n || r(f);
|
|
2905
2950
|
},
|
|
2906
2951
|
[n, e]
|
|
2907
|
-
), c =
|
|
2952
|
+
), c = D(() => u(void 0), [u]);
|
|
2908
2953
|
return b(() => {
|
|
2909
|
-
const d =
|
|
2954
|
+
const d = rt(e);
|
|
2910
2955
|
return {
|
|
2911
2956
|
id: e.id,
|
|
2912
2957
|
kind: e.kind,
|
|
@@ -2916,7 +2961,7 @@ function Vn(e) {
|
|
|
2916
2961
|
relationshipHint: d.relationshipHint,
|
|
2917
2962
|
controlRole: e.kind === "control" ? e.role : void 0,
|
|
2918
2963
|
value: i,
|
|
2919
|
-
options:
|
|
2964
|
+
options: o,
|
|
2920
2965
|
isActive: re(i),
|
|
2921
2966
|
setValue: u,
|
|
2922
2967
|
clear: c,
|
|
@@ -2932,15 +2977,15 @@ function Vn(e) {
|
|
|
2932
2977
|
controlRole: e.kind === "control" ? e.role : void 0
|
|
2933
2978
|
})
|
|
2934
2979
|
};
|
|
2935
|
-
}, [c,
|
|
2980
|
+
}, [c, o, u, e, i]);
|
|
2936
2981
|
}
|
|
2937
|
-
function
|
|
2938
|
-
const [
|
|
2939
|
-
return
|
|
2940
|
-
|
|
2982
|
+
function Zn(e) {
|
|
2983
|
+
const [t, r] = Q(() => Nn(e));
|
|
2984
|
+
return B(() => {
|
|
2985
|
+
r((n) => {
|
|
2941
2986
|
let i = n;
|
|
2942
|
-
for (const
|
|
2943
|
-
!Object.prototype.hasOwnProperty.call(i,
|
|
2987
|
+
for (const o of e)
|
|
2988
|
+
!Object.prototype.hasOwnProperty.call(i, o.id) && o.defaultValue !== void 0 && (i = { ...i, [o.id]: o.defaultValue });
|
|
2944
2989
|
return i;
|
|
2945
2990
|
});
|
|
2946
2991
|
}, [e]), b(
|
|
@@ -2948,13 +2993,13 @@ function Qn(e) {
|
|
|
2948
2993
|
const i = Object.prototype.hasOwnProperty.call(
|
|
2949
2994
|
n,
|
|
2950
2995
|
"value"
|
|
2951
|
-
),
|
|
2952
|
-
var
|
|
2953
|
-
(
|
|
2996
|
+
), o = i ? n.value : t[n.id], u = tt(n.options), c = (y) => {
|
|
2997
|
+
var g;
|
|
2998
|
+
(g = n.onValueChange) == null || g.call(n, y), i || r((h) => ({
|
|
2954
2999
|
...h,
|
|
2955
|
-
[n.id]:
|
|
3000
|
+
[n.id]: y
|
|
2956
3001
|
}));
|
|
2957
|
-
}, d = () => c(void 0), f =
|
|
3002
|
+
}, d = () => c(void 0), f = rt(n);
|
|
2958
3003
|
return {
|
|
2959
3004
|
id: n.id,
|
|
2960
3005
|
kind: n.kind,
|
|
@@ -2963,9 +3008,9 @@ function Qn(e) {
|
|
|
2963
3008
|
operator: f.operator,
|
|
2964
3009
|
relationshipHint: f.relationshipHint,
|
|
2965
3010
|
controlRole: n.kind === "control" ? n.role : void 0,
|
|
2966
|
-
value:
|
|
3011
|
+
value: o,
|
|
2967
3012
|
options: u,
|
|
2968
|
-
isActive: re(
|
|
3013
|
+
isActive: re(o),
|
|
2969
3014
|
setValue: c,
|
|
2970
3015
|
clear: d,
|
|
2971
3016
|
toAnalyticsInput: () => ({
|
|
@@ -2973,89 +3018,89 @@ function Qn(e) {
|
|
|
2973
3018
|
field: f.field,
|
|
2974
3019
|
kind: n.kind,
|
|
2975
3020
|
label: n.label,
|
|
2976
|
-
value:
|
|
2977
|
-
isActive: re(
|
|
3021
|
+
value: o,
|
|
3022
|
+
isActive: re(o),
|
|
2978
3023
|
operator: f.operator,
|
|
2979
3024
|
relationshipHint: f.relationshipHint,
|
|
2980
3025
|
controlRole: n.kind === "control" ? n.role : void 0
|
|
2981
3026
|
})
|
|
2982
3027
|
};
|
|
2983
3028
|
}),
|
|
2984
|
-
[e,
|
|
3029
|
+
[e, t]
|
|
2985
3030
|
);
|
|
2986
3031
|
}
|
|
2987
|
-
function
|
|
2988
|
-
const
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
}, [e, n,
|
|
3032
|
+
function ei(e, t) {
|
|
3033
|
+
const r = (t == null ? void 0 : t.status) === "success" ? t.options : void 0, n = b(() => $n(r), [r]);
|
|
3034
|
+
B(() => {
|
|
3035
|
+
Kn(e.value, r) || e.clear();
|
|
3036
|
+
}, [e, n, t == null ? void 0 : t.status, r]);
|
|
2992
3037
|
}
|
|
2993
|
-
function
|
|
2994
|
-
if (!re(e) ||
|
|
3038
|
+
function Kn(e, t) {
|
|
3039
|
+
if (!re(e) || t === void 0)
|
|
2995
3040
|
return !0;
|
|
2996
|
-
const
|
|
2997
|
-
|
|
3041
|
+
const r = new Set(
|
|
3042
|
+
t.map((i) => Ze(i.value))
|
|
2998
3043
|
);
|
|
2999
3044
|
return (Array.isArray(e) ? e : [e]).every(
|
|
3000
|
-
(i) =>
|
|
3045
|
+
(i) => r.has(Ze(i))
|
|
3001
3046
|
);
|
|
3002
3047
|
}
|
|
3003
|
-
function
|
|
3004
|
-
return JSON.stringify((e || []).map((
|
|
3048
|
+
function $n(e) {
|
|
3049
|
+
return JSON.stringify((e || []).map((t) => t.value));
|
|
3005
3050
|
}
|
|
3006
|
-
function
|
|
3051
|
+
function Ze(e) {
|
|
3007
3052
|
return `${typeof e}:${String(e)}`;
|
|
3008
3053
|
}
|
|
3009
|
-
function
|
|
3010
|
-
const
|
|
3011
|
-
() =>
|
|
3054
|
+
function ti(e, t = {}) {
|
|
3055
|
+
const r = b(
|
|
3056
|
+
() => t.inputs ? {
|
|
3012
3057
|
...e,
|
|
3013
|
-
inputs:
|
|
3058
|
+
inputs: t.inputs
|
|
3014
3059
|
} : e,
|
|
3015
|
-
[
|
|
3060
|
+
[t.inputs, e]
|
|
3016
3061
|
), n = b(() => {
|
|
3017
|
-
switch (
|
|
3062
|
+
switch (r.queryKind) {
|
|
3018
3063
|
case "metric":
|
|
3019
3064
|
return {
|
|
3020
|
-
queryKind:
|
|
3021
|
-
request:
|
|
3065
|
+
queryKind: r.queryKind,
|
|
3066
|
+
request: Cn(r)
|
|
3022
3067
|
};
|
|
3023
3068
|
case "analysis":
|
|
3024
3069
|
return {
|
|
3025
|
-
queryKind:
|
|
3026
|
-
request:
|
|
3070
|
+
queryKind: r.queryKind,
|
|
3071
|
+
request: kn(r)
|
|
3027
3072
|
};
|
|
3028
3073
|
case "records":
|
|
3029
3074
|
return {
|
|
3030
|
-
queryKind:
|
|
3031
|
-
request:
|
|
3075
|
+
queryKind: r.queryKind,
|
|
3076
|
+
request: Dn(r)
|
|
3032
3077
|
};
|
|
3033
3078
|
case "inputOptions":
|
|
3034
3079
|
return {
|
|
3035
|
-
queryKind:
|
|
3036
|
-
request:
|
|
3080
|
+
queryKind: r.queryKind,
|
|
3081
|
+
request: Ln(r)
|
|
3037
3082
|
};
|
|
3038
3083
|
case "sql":
|
|
3039
3084
|
return {
|
|
3040
|
-
queryKind:
|
|
3041
|
-
request:
|
|
3085
|
+
queryKind: r.queryKind,
|
|
3086
|
+
request: On(r)
|
|
3042
3087
|
};
|
|
3043
3088
|
case "matrix":
|
|
3044
3089
|
return {
|
|
3045
|
-
queryKind:
|
|
3046
|
-
request:
|
|
3090
|
+
queryKind: r.queryKind,
|
|
3091
|
+
request: Bn(r)
|
|
3047
3092
|
};
|
|
3048
3093
|
default:
|
|
3049
|
-
return
|
|
3094
|
+
return Te(r);
|
|
3050
3095
|
}
|
|
3051
|
-
}, [
|
|
3052
|
-
spec:
|
|
3096
|
+
}, [r]), i = Yt({
|
|
3097
|
+
spec: r,
|
|
3053
3098
|
queryKind: n.queryKind,
|
|
3054
3099
|
queryKey: n.request.queryKey,
|
|
3055
3100
|
intent: n.request.intent,
|
|
3056
3101
|
activeInputs: n.request.activeInputs,
|
|
3057
|
-
debug:
|
|
3058
|
-
}),
|
|
3102
|
+
debug: t.debug
|
|
3103
|
+
}), o = C(null), u = b(
|
|
3059
3104
|
() => ({
|
|
3060
3105
|
start: i.start,
|
|
3061
3106
|
success: i.success,
|
|
@@ -3068,266 +3113,266 @@ function Gn(e, r = {}) {
|
|
|
3068
3113
|
i.start,
|
|
3069
3114
|
i.success
|
|
3070
3115
|
]
|
|
3071
|
-
), c =
|
|
3072
|
-
(
|
|
3073
|
-
var
|
|
3074
|
-
const
|
|
3075
|
-
if (
|
|
3116
|
+
), c = D(
|
|
3117
|
+
(a) => {
|
|
3118
|
+
var K, E, v, I, L, R, O, x, k;
|
|
3119
|
+
const w = n.request;
|
|
3120
|
+
if (w.intent)
|
|
3076
3121
|
switch (n.queryKind) {
|
|
3077
3122
|
case "metric":
|
|
3078
|
-
return (
|
|
3079
|
-
|
|
3080
|
-
|
|
3123
|
+
return (K = a.executor) == null ? void 0 : K.executeMetric(
|
|
3124
|
+
w.intent,
|
|
3125
|
+
a
|
|
3081
3126
|
);
|
|
3082
3127
|
case "analysis":
|
|
3083
|
-
return (v = (
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3128
|
+
return (v = (E = a.executor) == null ? void 0 : E.executeAnalysis) == null ? void 0 : v.call(
|
|
3129
|
+
E,
|
|
3130
|
+
w.intent,
|
|
3131
|
+
a,
|
|
3132
|
+
w.analysisOptions
|
|
3088
3133
|
);
|
|
3089
3134
|
case "records":
|
|
3090
|
-
return (I =
|
|
3091
|
-
|
|
3092
|
-
|
|
3135
|
+
return (I = a.executor) == null ? void 0 : I.executeRecords(
|
|
3136
|
+
w.intent,
|
|
3137
|
+
a
|
|
3093
3138
|
);
|
|
3094
3139
|
case "inputOptions":
|
|
3095
|
-
return (
|
|
3096
|
-
|
|
3097
|
-
|
|
3140
|
+
return (L = a.executor) == null ? void 0 : L.executeInputOptions(
|
|
3141
|
+
w.intent,
|
|
3142
|
+
a
|
|
3098
3143
|
);
|
|
3099
3144
|
case "sql":
|
|
3100
|
-
return (O = (
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3145
|
+
return (O = (R = a.executor) == null ? void 0 : R.executeSql) == null ? void 0 : O.call(
|
|
3146
|
+
R,
|
|
3147
|
+
w.intent,
|
|
3148
|
+
a
|
|
3104
3149
|
);
|
|
3105
3150
|
case "matrix":
|
|
3106
|
-
return (
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3151
|
+
return (k = (x = a.executor) == null ? void 0 : x.executeMatrix) == null ? void 0 : k.call(
|
|
3152
|
+
x,
|
|
3153
|
+
w.intent,
|
|
3154
|
+
a
|
|
3110
3155
|
);
|
|
3111
3156
|
default:
|
|
3112
|
-
return
|
|
3157
|
+
return Te(n);
|
|
3113
3158
|
}
|
|
3114
3159
|
},
|
|
3115
3160
|
[n]
|
|
3116
|
-
), d =
|
|
3161
|
+
), d = _n(
|
|
3117
3162
|
n.request.queryKey,
|
|
3118
3163
|
c,
|
|
3119
3164
|
n.request.idleData,
|
|
3120
3165
|
n.request.activeInputs,
|
|
3121
3166
|
u
|
|
3122
|
-
), f = i.queryId,
|
|
3123
|
-
|
|
3124
|
-
const
|
|
3125
|
-
if (!
|
|
3126
|
-
|
|
3167
|
+
), f = i.queryId, y = i.validationFailure;
|
|
3168
|
+
B(() => {
|
|
3169
|
+
const a = n.request.error;
|
|
3170
|
+
if (!a) {
|
|
3171
|
+
o.current = null;
|
|
3127
3172
|
return;
|
|
3128
3173
|
}
|
|
3129
|
-
const
|
|
3130
|
-
|
|
3174
|
+
const w = `${f}:${a.message}`;
|
|
3175
|
+
o.current !== w && (o.current = w, y(a));
|
|
3131
3176
|
}, [
|
|
3132
3177
|
n.request.error,
|
|
3133
3178
|
n.request.queryKey,
|
|
3134
3179
|
f,
|
|
3135
|
-
|
|
3180
|
+
y
|
|
3136
3181
|
]);
|
|
3137
|
-
const
|
|
3182
|
+
const g = n.request.error ? n.request.idleData : d.data, h = n.request.error ? "error" : d.status, m = !n.request.error && d.status === "loading", S = n.request.error || d.error, T = i.trace;
|
|
3138
3183
|
switch (n.queryKind) {
|
|
3139
3184
|
case "metric": {
|
|
3140
|
-
const
|
|
3185
|
+
const a = g;
|
|
3141
3186
|
return {
|
|
3142
|
-
id:
|
|
3187
|
+
id: r.id,
|
|
3143
3188
|
intent: n.request.intent,
|
|
3144
|
-
value: (
|
|
3145
|
-
measures:
|
|
3146
|
-
comparisonValue:
|
|
3147
|
-
delta:
|
|
3148
|
-
deltaPercent:
|
|
3149
|
-
records:
|
|
3150
|
-
executionResult:
|
|
3189
|
+
value: (a == null ? void 0 : a.value) ?? null,
|
|
3190
|
+
measures: a == null ? void 0 : a.measures,
|
|
3191
|
+
comparisonValue: a == null ? void 0 : a.comparisonValue,
|
|
3192
|
+
delta: a == null ? void 0 : a.delta,
|
|
3193
|
+
deltaPercent: a == null ? void 0 : a.deltaPercent,
|
|
3194
|
+
records: a == null ? void 0 : a.records,
|
|
3195
|
+
executionResult: a == null ? void 0 : a.executionResult,
|
|
3151
3196
|
status: h,
|
|
3152
3197
|
isLoading: m,
|
|
3153
3198
|
error: S,
|
|
3154
|
-
trace:
|
|
3199
|
+
trace: T
|
|
3155
3200
|
};
|
|
3156
3201
|
}
|
|
3157
3202
|
case "analysis": {
|
|
3158
|
-
const
|
|
3203
|
+
const a = wt(g);
|
|
3159
3204
|
return {
|
|
3160
|
-
id:
|
|
3205
|
+
id: r.id,
|
|
3161
3206
|
intent: n.request.intent,
|
|
3162
|
-
...
|
|
3207
|
+
...a || {},
|
|
3163
3208
|
status: h,
|
|
3164
3209
|
isLoading: m,
|
|
3165
3210
|
error: S,
|
|
3166
|
-
trace:
|
|
3211
|
+
trace: T
|
|
3167
3212
|
};
|
|
3168
3213
|
}
|
|
3169
3214
|
case "records": {
|
|
3170
|
-
const
|
|
3215
|
+
const a = g;
|
|
3171
3216
|
return {
|
|
3172
|
-
id:
|
|
3217
|
+
id: r.id,
|
|
3173
3218
|
intent: n.request.intent,
|
|
3174
|
-
records: (
|
|
3175
|
-
columns:
|
|
3176
|
-
rowCount:
|
|
3177
|
-
pagination:
|
|
3178
|
-
executionResult:
|
|
3219
|
+
records: (a == null ? void 0 : a.records) || [],
|
|
3220
|
+
columns: a == null ? void 0 : a.columns,
|
|
3221
|
+
rowCount: a == null ? void 0 : a.rowCount,
|
|
3222
|
+
pagination: a == null ? void 0 : a.pagination,
|
|
3223
|
+
executionResult: a == null ? void 0 : a.executionResult,
|
|
3179
3224
|
status: h,
|
|
3180
3225
|
isLoading: m,
|
|
3181
3226
|
error: S,
|
|
3182
|
-
trace:
|
|
3227
|
+
trace: T
|
|
3183
3228
|
};
|
|
3184
3229
|
}
|
|
3185
3230
|
case "inputOptions": {
|
|
3186
|
-
const
|
|
3231
|
+
const a = g;
|
|
3187
3232
|
return {
|
|
3188
|
-
id:
|
|
3233
|
+
id: r.id,
|
|
3189
3234
|
intent: n.request.intent,
|
|
3190
|
-
options: (
|
|
3191
|
-
executionResult:
|
|
3235
|
+
options: (a == null ? void 0 : a.options) || [],
|
|
3236
|
+
executionResult: a == null ? void 0 : a.executionResult,
|
|
3192
3237
|
status: h,
|
|
3193
3238
|
isLoading: m,
|
|
3194
3239
|
error: S,
|
|
3195
|
-
trace:
|
|
3240
|
+
trace: T
|
|
3196
3241
|
};
|
|
3197
3242
|
}
|
|
3198
3243
|
case "sql": {
|
|
3199
|
-
const
|
|
3244
|
+
const a = g;
|
|
3200
3245
|
return {
|
|
3201
|
-
id:
|
|
3246
|
+
id: r.id,
|
|
3202
3247
|
intent: n.request.intent,
|
|
3203
|
-
records: (
|
|
3204
|
-
columns:
|
|
3205
|
-
rowCount:
|
|
3206
|
-
pagination:
|
|
3207
|
-
output:
|
|
3208
|
-
rowLimitExceeded:
|
|
3209
|
-
executionResult:
|
|
3248
|
+
records: (a == null ? void 0 : a.records) || [],
|
|
3249
|
+
columns: a == null ? void 0 : a.columns,
|
|
3250
|
+
rowCount: a == null ? void 0 : a.rowCount,
|
|
3251
|
+
pagination: a == null ? void 0 : a.pagination,
|
|
3252
|
+
output: a == null ? void 0 : a.output,
|
|
3253
|
+
rowLimitExceeded: a == null ? void 0 : a.rowLimitExceeded,
|
|
3254
|
+
executionResult: a == null ? void 0 : a.executionResult,
|
|
3210
3255
|
status: h,
|
|
3211
3256
|
isLoading: m,
|
|
3212
3257
|
error: S,
|
|
3213
|
-
trace:
|
|
3258
|
+
trace: T
|
|
3214
3259
|
};
|
|
3215
3260
|
}
|
|
3216
3261
|
case "matrix": {
|
|
3217
|
-
const
|
|
3262
|
+
const a = g;
|
|
3218
3263
|
return {
|
|
3219
|
-
id:
|
|
3264
|
+
id: r.id,
|
|
3220
3265
|
intent: n.request.intent,
|
|
3221
|
-
matrixResult:
|
|
3222
|
-
grid:
|
|
3223
|
-
expansion:
|
|
3224
|
-
executionResult:
|
|
3266
|
+
matrixResult: a == null ? void 0 : a.matrixResult,
|
|
3267
|
+
grid: a == null ? void 0 : a.grid,
|
|
3268
|
+
expansion: a == null ? void 0 : a.expansion,
|
|
3269
|
+
executionResult: a == null ? void 0 : a.executionResult,
|
|
3225
3270
|
status: h,
|
|
3226
3271
|
isLoading: m,
|
|
3227
3272
|
error: S,
|
|
3228
|
-
trace:
|
|
3273
|
+
trace: T
|
|
3229
3274
|
};
|
|
3230
3275
|
}
|
|
3231
3276
|
default:
|
|
3232
|
-
return
|
|
3277
|
+
return Te(n);
|
|
3233
3278
|
}
|
|
3234
3279
|
}
|
|
3235
|
-
function
|
|
3236
|
-
const
|
|
3280
|
+
function _n(e, t, r, n, i) {
|
|
3281
|
+
const o = Tn(), u = C(t), c = C(n), [d, f] = Q({
|
|
3237
3282
|
status: "idle",
|
|
3238
|
-
data:
|
|
3283
|
+
data: r,
|
|
3239
3284
|
error: null
|
|
3240
3285
|
});
|
|
3241
|
-
return u.current =
|
|
3242
|
-
let
|
|
3286
|
+
return u.current = t, c.current = n, B(() => {
|
|
3287
|
+
let y;
|
|
3243
3288
|
try {
|
|
3244
|
-
|
|
3245
|
-
...
|
|
3289
|
+
y = u.current({
|
|
3290
|
+
...o,
|
|
3246
3291
|
activeInputs: c.current
|
|
3247
3292
|
});
|
|
3248
3293
|
} catch (m) {
|
|
3249
3294
|
i == null || i.failure(m, 0), f({
|
|
3250
3295
|
status: "error",
|
|
3251
|
-
data:
|
|
3296
|
+
data: r,
|
|
3252
3297
|
error: N(m)
|
|
3253
3298
|
});
|
|
3254
3299
|
return;
|
|
3255
3300
|
}
|
|
3256
|
-
if (!
|
|
3257
|
-
f({ status: "idle", data:
|
|
3301
|
+
if (!y) {
|
|
3302
|
+
f({ status: "idle", data: r, error: null });
|
|
3258
3303
|
return;
|
|
3259
3304
|
}
|
|
3260
|
-
let
|
|
3261
|
-
const h =
|
|
3305
|
+
let g = !1;
|
|
3306
|
+
const h = qt();
|
|
3262
3307
|
return i == null || i.start(), f((m) => ({
|
|
3263
3308
|
status: "loading",
|
|
3264
3309
|
data: m.data,
|
|
3265
3310
|
error: null
|
|
3266
|
-
})),
|
|
3267
|
-
|
|
3311
|
+
})), y.then((m) => {
|
|
3312
|
+
g ? i == null || i.ignored("superseded") : (i == null || i.success(m, et(h)), f({ status: "success", data: m, error: null }));
|
|
3268
3313
|
}).catch((m) => {
|
|
3269
|
-
|
|
3314
|
+
g ? i == null || i.ignored("superseded") : (i == null || i.failure(m, et(h)), f({
|
|
3270
3315
|
status: "error",
|
|
3271
|
-
data:
|
|
3316
|
+
data: r,
|
|
3272
3317
|
error: N(m)
|
|
3273
3318
|
}));
|
|
3274
3319
|
}), () => {
|
|
3275
|
-
|
|
3320
|
+
g = !0;
|
|
3276
3321
|
};
|
|
3277
|
-
}, [
|
|
3322
|
+
}, [r, e, o, i]), d;
|
|
3278
3323
|
}
|
|
3279
|
-
function
|
|
3324
|
+
function qt() {
|
|
3280
3325
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
3281
3326
|
}
|
|
3282
|
-
function
|
|
3283
|
-
return Math.max(0, Math.round(
|
|
3327
|
+
function et(e) {
|
|
3328
|
+
return Math.max(0, Math.round(qt() - e));
|
|
3284
3329
|
}
|
|
3285
|
-
function
|
|
3330
|
+
function Nn(e) {
|
|
3286
3331
|
return Object.fromEntries(
|
|
3287
|
-
e.filter((
|
|
3332
|
+
e.filter((t) => t.defaultValue !== void 0).map((t) => [t.id, t.defaultValue])
|
|
3288
3333
|
);
|
|
3289
3334
|
}
|
|
3290
|
-
function
|
|
3335
|
+
function Te(e) {
|
|
3291
3336
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
3292
3337
|
}
|
|
3293
|
-
function
|
|
3338
|
+
function Fn(e) {
|
|
3294
3339
|
return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
|
|
3295
3340
|
}
|
|
3296
|
-
function
|
|
3341
|
+
function ri({
|
|
3297
3342
|
token: e,
|
|
3298
|
-
apiBaseUrl:
|
|
3299
|
-
executor:
|
|
3343
|
+
apiBaseUrl: t,
|
|
3344
|
+
executor: r,
|
|
3300
3345
|
debug: n,
|
|
3301
3346
|
children: i
|
|
3302
3347
|
}) {
|
|
3303
3348
|
var m;
|
|
3304
|
-
const
|
|
3349
|
+
const o = An(), u = ((m = o == null ? void 0 : o.authToken) == null ? void 0 : m.accessToken) || e, c = (o == null ? void 0 : o.dataApiBaseUrl) || (o == null ? void 0 : o.apiBaseUrl) || t, d = (o == null ? void 0 : o.debug) ?? n, f = Fn(d), y = b(() => yn(), []), g = r || y, h = b(
|
|
3305
3350
|
() => ({
|
|
3306
3351
|
token: u,
|
|
3307
3352
|
apiBaseUrl: c,
|
|
3308
|
-
executor:
|
|
3353
|
+
executor: g,
|
|
3309
3354
|
debug: d
|
|
3310
3355
|
}),
|
|
3311
|
-
[c, d,
|
|
3356
|
+
[c, d, g, u]
|
|
3312
3357
|
);
|
|
3313
|
-
return /* @__PURE__ */ s(
|
|
3358
|
+
return /* @__PURE__ */ s(Qt, { debug: d, children: /* @__PURE__ */ p(It.Provider, { value: h, children: [
|
|
3314
3359
|
i,
|
|
3315
|
-
f ? /* @__PURE__ */ s(
|
|
3360
|
+
f ? /* @__PURE__ */ s(Jt, { ...f }) : null
|
|
3316
3361
|
] }) });
|
|
3317
3362
|
}
|
|
3318
3363
|
export {
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3364
|
+
ri as SemaphorDataAppProvider,
|
|
3365
|
+
Jt as SemaphorDevtools,
|
|
3366
|
+
Yn as SemaphorDevtoolsInspectButton,
|
|
3367
|
+
Jn as SemaphorViewBoundary,
|
|
3368
|
+
yn as createSemaphorQueryExecutor,
|
|
3369
|
+
Qn as defineSemaphorDataApp,
|
|
3370
|
+
Un as defineSemaphorInput,
|
|
3371
|
+
Kn as isSemaphorInputValueValidForOptions,
|
|
3372
|
+
Gn as semaphor,
|
|
3373
|
+
ei as useClearInvalidSemaphorInputValue,
|
|
3374
|
+
st as useSemaphorDevtools,
|
|
3375
|
+
Xn as useSemaphorInput,
|
|
3376
|
+
Zn as useSemaphorInputs,
|
|
3377
|
+
ti as useSemaphorQuery
|
|
3333
3378
|
};
|