react-semaphor 0.1.391 → 0.1.392
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +120 -252
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +7 -7
- package/dist/chunks/analyze-result-contract-C9Gv2_qW.js +1585 -0
- package/dist/chunks/analyze-result-contract-Zgg-Bbpj.js +1 -0
- package/dist/chunks/{braces--20GzUQh.js → braces-8TRlDwDw.js} +1 -1
- package/dist/chunks/{braces-C0Vh_Mft.js → braces-D2tStQjF.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-B-VsxhsA.js → calendar-preferences-dialog-49fcEPXS.js} +4 -4
- package/dist/chunks/{calendar-preferences-dialog-DE67Z3oQ.js → calendar-preferences-dialog-DwLeBLy2.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-CgkSKkZR.js +80 -0
- package/dist/chunks/{dashboard-briefing-launcher-BIj3X7b3.js → dashboard-briefing-launcher-cgPKz1yX.js} +252 -252
- package/dist/chunks/dashboard-controls-D12ZSUP_.js +52 -0
- package/dist/chunks/{dashboard-controls-BXxucM4f.js → dashboard-controls-VMFm3OP4.js} +87 -87
- package/dist/chunks/{dashboard-json-C6oZuipD.js → dashboard-json-C-GG5yC7.js} +4 -4
- package/dist/chunks/{dashboard-json-BNwshkK2.js → dashboard-json-CvK0oI24.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CmfrI_L3.js → edit-dashboard-visual-B5KB7dx4.js} +977 -977
- package/dist/chunks/edit-dashboard-visual-ql99faTz.js +178 -0
- package/dist/chunks/{index-icb12JV1.js → index-CQmKDEbe.js} +735 -741
- package/dist/chunks/{index-4W_ElSBJ.js → index-DXCBPLDu.js} +218 -223
- package/dist/chunks/{layout-grid-B7-klXiK.js → layout-grid-C0OI-MRn.js} +1 -1
- package/dist/chunks/{layout-grid-DV89AC9_.js → layout-grid-CiubineE.js} +1 -1
- package/dist/chunks/{palette-Dj-dgPYh.js → palette-C4KTXOug.js} +1 -1
- package/dist/chunks/{palette-5IwhMbSF.js → palette-Cp1hqZtm.js} +1 -1
- package/dist/chunks/{save-C5fwVdTF.js → save-C__QggEE.js} +1 -1
- package/dist/chunks/{save-16C6YSW2.js → save-DgMfP0j8.js} +1 -1
- package/dist/chunks/{search-0LmWwZzW.js → search-BHsQIWBV.js} +17 -7
- package/dist/chunks/{search-Dq1Mbb03.js → search-DNCejM7Z.js} +9 -4
- package/dist/chunks/source-identity-uMaUe036.js +1 -0
- package/dist/chunks/{source-identity-CN4xiyKJ.js → source-identity-y0VSSreA.js} +33 -15
- package/dist/chunks/{switch-bdJp0Bkw.js → switch-B79Hn4Qh.js} +27 -32
- package/dist/chunks/{switch-DUdaHFZQ.js → switch-BXQAlSuW.js} +637 -647
- package/dist/chunks/use-create-flow-overlay-state-7MFN3PWX.js +21 -0
- package/dist/chunks/{use-create-flow-overlay-state-YvqCp6Zo.js → use-create-flow-overlay-state-Bw5LRkf9.js} +93 -92
- package/dist/chunks/{validators-CHPH6ORs.js → validators-4EGCWWga.js} +1 -1
- package/dist/chunks/{validators-lWo8m0Q7.js → validators-CPtkrola.js} +1 -1
- package/dist/chunks/{x-B_cx7LwM.js → x-B6ghREd2.js} +10 -5
- package/dist/chunks/{x-IdR_js6f.js → x-CXDkqdur.js} +28 -18
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +3 -3
- package/dist/data-app-builder/index.cjs +13 -13
- package/dist/data-app-builder/index.js +11 -11
- package/dist/data-app-sdk/index.cjs +5 -5
- package/dist/data-app-sdk/index.js +1589 -1234
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +6 -7
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +13 -13
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +2107 -43
- package/dist/types/dashboard-assistant.d.ts +3 -1
- package/dist/types/data-app-sdk-adapters.d.ts +1 -1
- package/dist/types/data-app-sdk-validation.d.ts +4 -2
- package/dist/types/data-app-sdk.d.ts +73 -5
- package/package.json +2 -1
- package/src/data-app-sdk/README.md +55 -0
- package/dist/chunks/analyze-result-contract-CtXfp3nv.js +0 -1
- package/dist/chunks/analyze-result-contract-DuhlklhI.js +0 -102
- package/dist/chunks/dashboard-briefing-launcher-Czx6BcXW.js +0 -80
- package/dist/chunks/dashboard-controls-BP-DcPFs.js +0 -52
- package/dist/chunks/edit-dashboard-visual-BAprin3J.js +0 -178
- package/dist/chunks/source-identity-C-xaeE_I.js +0 -1
- package/dist/chunks/use-create-flow-overlay-state-BIHKf_XK.js +0 -21
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { toSemaphorInputSnapshots as
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import "../chunks/
|
|
8
|
-
|
|
1
|
+
import { toSemaphorInputSnapshots as Nr, toSemaphorInputBinding as Fr, toSemaphorActiveInputSnapshots as Z, toSemaphorMatrixIntent as zr, toSemaphorSqlIntent as Mr, toSemaphorInputOptionsIntent as Hr, toSemaphorRecordsIntent as jr, toSemaphorAnalysisQueryOptions as Pr, toSemaphorAnalysisIntent as Qr, toSemaphorMetricIntent as Vr, hasSemaphorInputValue as ce, normalizeSemaphorInputOptions as cr, toSemaphorInputSpec as fr } from "../data-app-sdk-adapters/index.js";
|
|
2
|
+
import { jsxs as p, Fragment as pr, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as we, useContext as V, useState as M, useRef as D, useEffect as $, useMemo as w, Fragment as Ur, useId as gr, useCallback as O, useReducer as Gr } from "react";
|
|
4
|
+
import { a as Jr, m as Yr } from "../chunks/source-identity-y0VSSreA.js";
|
|
5
|
+
import "../chunks/analyze-result-contract-C9Gv2_qW.js";
|
|
6
|
+
import { M as Xr, a as Zr, S as et, E as rt, C as tt } from "../chunks/search-BHsQIWBV.js";
|
|
7
|
+
import { X as nt, C as it, j as ot } from "../chunks/x-CXDkqdur.js";
|
|
8
|
+
import { b as st } from "../chunks/validators-4EGCWWga.js";
|
|
9
|
+
function ge(e, r, t = {}) {
|
|
9
10
|
return {
|
|
10
11
|
...t,
|
|
11
12
|
name: e,
|
|
12
13
|
role: r
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function Ti(e) {
|
|
16
17
|
return e;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function Ci(e) {
|
|
19
20
|
return e;
|
|
20
21
|
}
|
|
21
|
-
const
|
|
22
|
+
const ki = {
|
|
22
23
|
source: {
|
|
23
24
|
semantic(e) {
|
|
24
25
|
return {
|
|
@@ -35,16 +36,16 @@ const di = {
|
|
|
35
36
|
},
|
|
36
37
|
field: {
|
|
37
38
|
measure(e, r) {
|
|
38
|
-
return
|
|
39
|
+
return ge(e, "measure", r);
|
|
39
40
|
},
|
|
40
41
|
dimension(e, r) {
|
|
41
|
-
return
|
|
42
|
+
return ge(e, "dimension", r);
|
|
42
43
|
},
|
|
43
44
|
date(e, r) {
|
|
44
|
-
return
|
|
45
|
+
return ge(e, "date", r);
|
|
45
46
|
},
|
|
46
47
|
id(e, r) {
|
|
47
|
-
return
|
|
48
|
+
return ge(e, "id", r);
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
51
|
filter(e) {
|
|
@@ -56,7 +57,7 @@ const di = {
|
|
|
56
57
|
bindInput(e, r) {
|
|
57
58
|
return {
|
|
58
59
|
toAnalyticsInput() {
|
|
59
|
-
const [t] =
|
|
60
|
+
const [t] = Nr([e]), n = Fr({
|
|
60
61
|
...r,
|
|
61
62
|
inputId: r.inputId || t.inputId
|
|
62
63
|
});
|
|
@@ -128,316 +129,320 @@ const di = {
|
|
|
128
129
|
queryKind: "matrix"
|
|
129
130
|
};
|
|
130
131
|
}
|
|
131
|
-
},
|
|
132
|
+
}, Te = 10, Ce = 100, at = 25, dt = 500, mr = {
|
|
132
133
|
enabled: !1,
|
|
133
134
|
queries: [],
|
|
135
|
+
issues: [],
|
|
134
136
|
getQuery: () => {
|
|
135
137
|
},
|
|
136
138
|
getQueries: () => []
|
|
137
|
-
},
|
|
139
|
+
}, ze = we(null), Me = we(null), He = we(
|
|
138
140
|
void 0
|
|
139
|
-
),
|
|
140
|
-
function
|
|
141
|
+
), Q = [];
|
|
142
|
+
function lt({
|
|
141
143
|
debug: e,
|
|
142
144
|
children: r
|
|
143
145
|
}) {
|
|
144
|
-
const t = w(() =>
|
|
145
|
-
|
|
146
|
+
const t = w(() => vn(e), [e]), [n, i] = Gr(
|
|
147
|
+
dn,
|
|
146
148
|
t,
|
|
147
|
-
|
|
148
|
-
),
|
|
149
|
-
|
|
149
|
+
Cr
|
|
150
|
+
), o = D(n), u = gr(), [f, d] = M({ open: !1 });
|
|
151
|
+
o.current = n, $(() => {
|
|
150
152
|
i({ type: "config", config: t });
|
|
151
|
-
}, [t]),
|
|
153
|
+
}, [t]), $(() => {
|
|
152
154
|
if (!n.enabled || !n.exposeWindowBridge || typeof window > "u")
|
|
153
155
|
return;
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
ownerId:
|
|
157
|
-
bridge:
|
|
156
|
+
const b = gn(() => o.current);
|
|
157
|
+
return ut({
|
|
158
|
+
ownerId: u,
|
|
159
|
+
bridge: b
|
|
158
160
|
}), () => {
|
|
159
|
-
|
|
161
|
+
ct(u);
|
|
160
162
|
};
|
|
161
|
-
}, [
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
}, []),
|
|
165
|
-
|
|
166
|
-
}, []),
|
|
167
|
-
|
|
163
|
+
}, [u, n.enabled, n.exposeWindowBridge]);
|
|
164
|
+
const c = w(() => ({ state: n, dispatch: i }), [n]), m = O((b) => {
|
|
165
|
+
d({ open: !0, focus: b });
|
|
166
|
+
}, []), v = O(() => {
|
|
167
|
+
d((b) => ({ ...b, open: !1 }));
|
|
168
|
+
}, []), S = O((b) => {
|
|
169
|
+
d({ open: !0, focus: b });
|
|
168
170
|
}, []), g = w(
|
|
169
171
|
() => ({
|
|
170
|
-
open:
|
|
171
|
-
focus:
|
|
172
|
-
openDevtools:
|
|
173
|
-
closeDevtools:
|
|
174
|
-
focusTrace:
|
|
172
|
+
open: f.open,
|
|
173
|
+
focus: f.focus,
|
|
174
|
+
openDevtools: m,
|
|
175
|
+
closeDevtools: v,
|
|
176
|
+
focusTrace: S
|
|
175
177
|
}),
|
|
176
178
|
[
|
|
177
|
-
y,
|
|
178
179
|
v,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
S,
|
|
181
|
+
m,
|
|
182
|
+
f.focus,
|
|
183
|
+
f.open
|
|
182
184
|
]
|
|
183
185
|
);
|
|
184
|
-
return /* @__PURE__ */
|
|
186
|
+
return /* @__PURE__ */ a(ze.Provider, { value: c, children: /* @__PURE__ */ a(Me.Provider, { value: g, children: r }) });
|
|
185
187
|
}
|
|
186
|
-
function
|
|
187
|
-
const r =
|
|
188
|
+
function ut(e) {
|
|
189
|
+
const r = Q.findIndex(
|
|
188
190
|
(t) => t.ownerId === e.ownerId
|
|
189
191
|
);
|
|
190
|
-
r >= 0 &&
|
|
192
|
+
r >= 0 && Q.splice(r, 1), Q.push(e), yr();
|
|
191
193
|
}
|
|
192
|
-
function
|
|
193
|
-
const r =
|
|
194
|
+
function ct(e) {
|
|
195
|
+
const r = Q.findIndex(
|
|
194
196
|
(t) => t.ownerId === e
|
|
195
197
|
);
|
|
196
|
-
r >= 0 &&
|
|
198
|
+
r >= 0 && Q.splice(r, 1), yr();
|
|
197
199
|
}
|
|
198
|
-
function
|
|
200
|
+
function yr() {
|
|
199
201
|
if (typeof window > "u")
|
|
200
202
|
return;
|
|
201
|
-
const e =
|
|
203
|
+
const e = Q[Q.length - 1];
|
|
202
204
|
e ? window.__SEMAPHOR_DEVTOOLS__ = e.bridge : delete window.__SEMAPHOR_DEVTOOLS__;
|
|
203
205
|
}
|
|
204
|
-
function
|
|
206
|
+
function Ri({
|
|
205
207
|
id: e,
|
|
206
208
|
title: r,
|
|
207
209
|
children: t
|
|
208
210
|
}) {
|
|
209
211
|
const n = w(() => ({ id: e, title: r }), [e, r]);
|
|
210
|
-
return /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ a(He.Provider, { value: n, children: t });
|
|
211
213
|
}
|
|
212
|
-
function
|
|
214
|
+
function ft({
|
|
213
215
|
buttonPosition: e = "bottom-right",
|
|
214
216
|
initialIsOpen: r = !1,
|
|
215
217
|
panelPosition: t = "right",
|
|
216
218
|
className: n,
|
|
217
219
|
style: i
|
|
218
220
|
} = {}) {
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}, []),
|
|
223
|
-
r &&
|
|
224
|
-
}, [r,
|
|
225
|
-
if (!
|
|
221
|
+
const o = hr(), u = V(Me), [f, d] = M(""), [c, m] = M(!1), v = D(null), S = D(null), g = u == null ? void 0 : u.openDevtools, b = u == null ? void 0 : u.closeDevtools, k = (u == null ? void 0 : u.open) === !0;
|
|
222
|
+
$(() => {
|
|
223
|
+
Tr();
|
|
224
|
+
}, []), $(() => {
|
|
225
|
+
r && o.enabled && (g == null || g());
|
|
226
|
+
}, [r, o.enabled, g]), $(() => {
|
|
227
|
+
if (!k || !b)
|
|
226
228
|
return;
|
|
227
|
-
const
|
|
228
|
-
var
|
|
229
|
-
const
|
|
230
|
-
|
|
229
|
+
const h = (I) => {
|
|
230
|
+
var q, A;
|
|
231
|
+
const R = I.target;
|
|
232
|
+
R instanceof Node && ((q = v.current) != null && q.contains(R) || (A = S.current) != null && A.contains(R) || b());
|
|
231
233
|
};
|
|
232
|
-
return document.addEventListener("pointerdown",
|
|
233
|
-
document.removeEventListener("pointerdown",
|
|
234
|
+
return document.addEventListener("pointerdown", h, !0), document.addEventListener("mousedown", h, !0), document.addEventListener("click", h, !0), () => {
|
|
235
|
+
document.removeEventListener("pointerdown", h, !0), document.removeEventListener("mousedown", h, !0), document.removeEventListener("click", h, !0);
|
|
234
236
|
};
|
|
235
|
-
}, [
|
|
236
|
-
const
|
|
237
|
-
() =>
|
|
238
|
-
[
|
|
239
|
-
),
|
|
240
|
-
() =>
|
|
241
|
-
[
|
|
242
|
-
),
|
|
243
|
-
() =>
|
|
244
|
-
[
|
|
237
|
+
}, [b, k]);
|
|
238
|
+
const l = w(
|
|
239
|
+
() => Lt(o.queries),
|
|
240
|
+
[o.queries]
|
|
241
|
+
), y = w(
|
|
242
|
+
() => je(o.queries),
|
|
243
|
+
[o.queries]
|
|
244
|
+
), K = Ot(l), E = w(
|
|
245
|
+
() => Bt(o.queries, f),
|
|
246
|
+
[o.queries, f]
|
|
245
247
|
), W = w(
|
|
246
|
-
() =>
|
|
247
|
-
[
|
|
248
|
-
),
|
|
249
|
-
() =>
|
|
250
|
-
[
|
|
248
|
+
() => $t(E),
|
|
249
|
+
[E]
|
|
250
|
+
), L = w(
|
|
251
|
+
() => vr(E, u == null ? void 0 : u.focus) || E[0],
|
|
252
|
+
[E, u == null ? void 0 : u.focus]
|
|
251
253
|
);
|
|
252
|
-
return !
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
+
return !o.enabled || !u ? null : /* @__PURE__ */ p(pr, { children: [
|
|
255
|
+
/* @__PURE__ */ p(
|
|
254
256
|
"button",
|
|
255
257
|
{
|
|
256
|
-
ref:
|
|
258
|
+
ref: v,
|
|
257
259
|
type: "button",
|
|
258
260
|
"aria-label": "Open Semaphor Inspector",
|
|
259
|
-
title:
|
|
260
|
-
className: n ? `${
|
|
261
|
+
title: K,
|
|
262
|
+
className: n ? `${N} ${n}` : N,
|
|
261
263
|
style: {
|
|
262
|
-
...
|
|
263
|
-
...
|
|
264
|
-
...
|
|
264
|
+
...s.launcher,
|
|
265
|
+
...en(e),
|
|
266
|
+
...rn(l.severity),
|
|
265
267
|
...i
|
|
266
268
|
},
|
|
267
269
|
onClick: () => {
|
|
268
|
-
var
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
traceId:
|
|
273
|
-
queryId:
|
|
274
|
-
viewId:
|
|
270
|
+
var I;
|
|
271
|
+
const h = (I = y[0]) == null ? void 0 : I.trace;
|
|
272
|
+
u.openDevtools(
|
|
273
|
+
h ? {
|
|
274
|
+
traceId: h.traceId,
|
|
275
|
+
queryId: h.queryId,
|
|
276
|
+
viewId: h.viewId
|
|
275
277
|
} : void 0
|
|
276
278
|
);
|
|
277
279
|
},
|
|
278
280
|
children: [
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
|
|
282
|
-
|
|
281
|
+
/* @__PURE__ */ a(gt, {}),
|
|
282
|
+
/* @__PURE__ */ a("span", { style: s.launcherText, children: l.total }),
|
|
283
|
+
l.issueCount > 0 ? /* @__PURE__ */ p("span", { style: s.launcherIssueCount, children: [
|
|
284
|
+
l.issueCount,
|
|
283
285
|
" issue",
|
|
284
|
-
|
|
286
|
+
l.issueCount === 1 ? "" : "s"
|
|
285
287
|
] }) : null
|
|
286
288
|
]
|
|
287
289
|
}
|
|
288
290
|
),
|
|
289
|
-
|
|
291
|
+
u.open ? /* @__PURE__ */ p(
|
|
290
292
|
"div",
|
|
291
293
|
{
|
|
292
|
-
ref:
|
|
294
|
+
ref: S,
|
|
293
295
|
role: "dialog",
|
|
294
296
|
"aria-label": "Semaphor Inspector",
|
|
295
297
|
"aria-modal": "false",
|
|
296
|
-
className:
|
|
298
|
+
className: N,
|
|
297
299
|
style: {
|
|
298
|
-
...
|
|
299
|
-
...
|
|
300
|
-
...
|
|
300
|
+
...s.panel,
|
|
301
|
+
...tn(t),
|
|
302
|
+
...c ? s.panelFullscreen : null
|
|
301
303
|
},
|
|
302
304
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
|
|
305
|
+
/* @__PURE__ */ p("div", { style: s.panelHeader, children: [
|
|
306
|
+
/* @__PURE__ */ p("div", { style: s.panelTitleBlock, children: [
|
|
307
|
+
/* @__PURE__ */ a("div", { style: s.panelTitle, children: "Semaphor Inspector" }),
|
|
308
|
+
/* @__PURE__ */ p("div", { style: s.panelSubtitle, children: [
|
|
309
|
+
l.total,
|
|
308
310
|
" queries · ",
|
|
309
|
-
|
|
311
|
+
l.loading,
|
|
310
312
|
" loading ·",
|
|
311
313
|
" ",
|
|
312
|
-
|
|
314
|
+
l.failed,
|
|
313
315
|
" failed · ",
|
|
314
|
-
|
|
316
|
+
l.errorCount,
|
|
317
|
+
" errors ·",
|
|
318
|
+
" ",
|
|
319
|
+
l.warningCount,
|
|
315
320
|
" warnings"
|
|
316
321
|
] })
|
|
317
322
|
] }),
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ p("div", { style: s.panelActions, children: [
|
|
324
|
+
/* @__PURE__ */ a(
|
|
320
325
|
"button",
|
|
321
326
|
{
|
|
322
327
|
type: "button",
|
|
323
|
-
"aria-label":
|
|
324
|
-
title:
|
|
325
|
-
style:
|
|
326
|
-
onClick: () =>
|
|
327
|
-
children:
|
|
328
|
+
"aria-label": c ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
|
|
329
|
+
title: c ? "Exit fullscreen Semaphor Inspector" : "Enter fullscreen Semaphor Inspector",
|
|
330
|
+
style: s.iconButton,
|
|
331
|
+
onClick: () => m((h) => !h),
|
|
332
|
+
children: c ? /* @__PURE__ */ a(Xr, { size: 15 }) : /* @__PURE__ */ a(Zr, { size: 15 })
|
|
328
333
|
}
|
|
329
334
|
),
|
|
330
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ a(
|
|
331
336
|
"button",
|
|
332
337
|
{
|
|
333
338
|
type: "button",
|
|
334
339
|
"aria-label": "Close Semaphor Inspector",
|
|
335
|
-
style:
|
|
336
|
-
onClick:
|
|
337
|
-
children: /* @__PURE__ */
|
|
340
|
+
style: s.iconButton,
|
|
341
|
+
onClick: u.closeDevtools,
|
|
342
|
+
children: /* @__PURE__ */ a(nt, { size: 15 })
|
|
338
343
|
}
|
|
339
344
|
)
|
|
340
345
|
] })
|
|
341
346
|
] }),
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ p("label", { style: s.searchBox, children: [
|
|
348
|
+
/* @__PURE__ */ a(et, { size: 14 }),
|
|
349
|
+
/* @__PURE__ */ a(
|
|
345
350
|
"input",
|
|
346
351
|
{
|
|
347
352
|
"aria-label": "Search Semaphor traces",
|
|
348
|
-
value:
|
|
349
|
-
onChange: (
|
|
353
|
+
value: f,
|
|
354
|
+
onChange: (h) => d(h.currentTarget.value),
|
|
350
355
|
placeholder: "Search traces",
|
|
351
|
-
style:
|
|
356
|
+
style: s.searchInput
|
|
352
357
|
}
|
|
353
358
|
)
|
|
354
359
|
] }),
|
|
355
|
-
|
|
356
|
-
|
|
360
|
+
y.length ? /* @__PURE__ */ a(
|
|
361
|
+
yt,
|
|
357
362
|
{
|
|
358
|
-
issues:
|
|
359
|
-
onSelect: (
|
|
360
|
-
traceId:
|
|
361
|
-
queryId:
|
|
362
|
-
viewId:
|
|
363
|
+
issues: y,
|
|
364
|
+
onSelect: (h) => u.focusTrace({
|
|
365
|
+
traceId: h.traceId,
|
|
366
|
+
queryId: h.queryId,
|
|
367
|
+
viewId: h.viewId
|
|
363
368
|
})
|
|
364
369
|
}
|
|
365
370
|
) : null,
|
|
366
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ p(
|
|
367
372
|
"div",
|
|
368
373
|
{
|
|
369
374
|
style: {
|
|
370
|
-
...
|
|
371
|
-
...
|
|
375
|
+
...s.panelBody,
|
|
376
|
+
...nn(t)
|
|
372
377
|
},
|
|
373
378
|
children: [
|
|
374
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ a(
|
|
375
380
|
"div",
|
|
376
381
|
{
|
|
377
382
|
style: {
|
|
378
|
-
...
|
|
379
|
-
...
|
|
383
|
+
...s.queryList,
|
|
384
|
+
...on()
|
|
380
385
|
},
|
|
381
386
|
"aria-label": "Registered queries",
|
|
382
|
-
children:
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
387
|
+
children: E.length ? W.map((h) => /* @__PURE__ */ p("div", { style: s.queryGroup, children: [
|
|
388
|
+
/* @__PURE__ */ p("div", { style: s.queryGroupHeader, children: [
|
|
389
|
+
/* @__PURE__ */ a("span", { children: h.title }),
|
|
390
|
+
/* @__PURE__ */ a("span", { style: s.queryGroupCount, children: h.traces.length })
|
|
386
391
|
] }),
|
|
387
|
-
|
|
388
|
-
var
|
|
389
|
-
const
|
|
390
|
-
return /* @__PURE__ */
|
|
392
|
+
h.traces.length ? h.traces.map((I) => {
|
|
393
|
+
var ie;
|
|
394
|
+
const R = br(I, L), q = qe(I), A = wr(I), U = qr(I), te = _t(I, q, U), ne = te.join(" · "), T = Sr(A), H = Dt(y, I);
|
|
395
|
+
return /* @__PURE__ */ p(
|
|
391
396
|
"button",
|
|
392
397
|
{
|
|
393
398
|
type: "button",
|
|
394
|
-
title: `${
|
|
399
|
+
title: `${q} · ${A} · ${ne}`,
|
|
395
400
|
style: {
|
|
396
|
-
...
|
|
397
|
-
...
|
|
401
|
+
...s.queryListItem,
|
|
402
|
+
...R ? s.queryListItemSelected : null
|
|
398
403
|
},
|
|
399
|
-
onClick: () =>
|
|
400
|
-
traceId:
|
|
401
|
-
queryId:
|
|
402
|
-
viewId:
|
|
404
|
+
onClick: () => u.focusTrace({
|
|
405
|
+
traceId: I.traceId,
|
|
406
|
+
queryId: I.queryId,
|
|
407
|
+
viewId: I.viewId
|
|
403
408
|
}),
|
|
404
409
|
children: [
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ p("span", { style: s.queryListItemHeader, children: [
|
|
411
|
+
/* @__PURE__ */ a(ht, { status: (ie = I.latestAttempt) == null ? void 0 : ie.status }),
|
|
412
|
+
/* @__PURE__ */ a("span", { style: s.queryListTitle, title: q, children: q }),
|
|
413
|
+
/* @__PURE__ */ a(
|
|
409
414
|
"span",
|
|
410
415
|
{
|
|
411
416
|
style: {
|
|
412
|
-
...
|
|
413
|
-
...
|
|
417
|
+
...s.queryListKindChip,
|
|
418
|
+
...Ir(T)
|
|
414
419
|
},
|
|
415
|
-
children:
|
|
420
|
+
children: A
|
|
416
421
|
}
|
|
417
422
|
),
|
|
418
|
-
|
|
423
|
+
H > 0 ? /* @__PURE__ */ a("span", { style: s.queryListIssueBadge, children: H }) : null
|
|
419
424
|
] }),
|
|
420
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ a(
|
|
421
426
|
"span",
|
|
422
427
|
{
|
|
423
|
-
className: `${
|
|
424
|
-
style:
|
|
425
|
-
title:
|
|
426
|
-
children:
|
|
427
|
-
|
|
428
|
-
/* @__PURE__ */
|
|
429
|
-
] }, `${
|
|
428
|
+
className: `${N}-source`,
|
|
429
|
+
style: s.queryListSource,
|
|
430
|
+
title: ne,
|
|
431
|
+
children: te.map((oe, se) => /* @__PURE__ */ p(Ur, { children: [
|
|
432
|
+
se > 0 ? /* @__PURE__ */ a("span", { style: s.queryListSubtitleSep, children: " · " }) : null,
|
|
433
|
+
/* @__PURE__ */ a("span", { children: oe })
|
|
434
|
+
] }, `${oe}:${se}`))
|
|
430
435
|
}
|
|
431
436
|
)
|
|
432
437
|
]
|
|
433
438
|
},
|
|
434
|
-
|
|
439
|
+
We(I)
|
|
435
440
|
);
|
|
436
|
-
}) : /* @__PURE__ */
|
|
437
|
-
] },
|
|
441
|
+
}) : /* @__PURE__ */ a("div", { style: s.queryGroupEmpty, children: "No input traces" })
|
|
442
|
+
] }, h.title)) : /* @__PURE__ */ a("div", { style: s.emptyState, children: "No matching traces" })
|
|
438
443
|
}
|
|
439
444
|
),
|
|
440
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ a(mt, { trace: L })
|
|
441
446
|
]
|
|
442
447
|
}
|
|
443
448
|
)
|
|
@@ -446,229 +451,229 @@ function et({
|
|
|
446
451
|
) : null
|
|
447
452
|
] });
|
|
448
453
|
}
|
|
449
|
-
function
|
|
454
|
+
function Di({
|
|
450
455
|
queryId: e,
|
|
451
456
|
viewId: r,
|
|
452
457
|
label: t,
|
|
453
458
|
className: n,
|
|
454
459
|
style: i
|
|
455
460
|
} = {}) {
|
|
456
|
-
var
|
|
457
|
-
const
|
|
458
|
-
|
|
459
|
-
|
|
461
|
+
var v, S;
|
|
462
|
+
const o = hr(), u = V(Me), f = V(He);
|
|
463
|
+
$(() => {
|
|
464
|
+
Tr();
|
|
460
465
|
}, []);
|
|
461
|
-
const
|
|
462
|
-
() =>
|
|
466
|
+
const d = r || (f == null ? void 0 : f.id), c = w(
|
|
467
|
+
() => Kt(o.queries, {
|
|
463
468
|
queryId: e,
|
|
464
|
-
viewId:
|
|
469
|
+
viewId: d
|
|
465
470
|
}),
|
|
466
471
|
[
|
|
467
|
-
|
|
472
|
+
o.queries,
|
|
468
473
|
e,
|
|
469
|
-
|
|
474
|
+
d
|
|
470
475
|
]
|
|
471
476
|
);
|
|
472
|
-
if (!
|
|
477
|
+
if (!o.enabled || !u || !c)
|
|
473
478
|
return null;
|
|
474
|
-
const
|
|
475
|
-
return /* @__PURE__ */
|
|
479
|
+
const m = t || `Inspect ${Nt(c, !!e)}`;
|
|
480
|
+
return /* @__PURE__ */ p(
|
|
476
481
|
"button",
|
|
477
482
|
{
|
|
478
483
|
type: "button",
|
|
479
|
-
"aria-label":
|
|
480
|
-
title:
|
|
481
|
-
className: n ? `${
|
|
484
|
+
"aria-label": m,
|
|
485
|
+
title: m,
|
|
486
|
+
className: n ? `${N} ${n}` : N,
|
|
482
487
|
style: {
|
|
483
|
-
...
|
|
484
|
-
...
|
|
488
|
+
...s.inspectButton,
|
|
489
|
+
...sn((v = c.latestAttempt) == null ? void 0 : v.status),
|
|
485
490
|
...i
|
|
486
491
|
},
|
|
487
|
-
onClick: () =>
|
|
488
|
-
traceId:
|
|
489
|
-
queryId:
|
|
490
|
-
viewId:
|
|
492
|
+
onClick: () => u.openDevtools({
|
|
493
|
+
traceId: c.traceId,
|
|
494
|
+
queryId: c.queryId,
|
|
495
|
+
viewId: c.viewId
|
|
491
496
|
}),
|
|
492
497
|
children: [
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ a(rt, { size: 13 }),
|
|
499
|
+
/* @__PURE__ */ a("span", { style: s.inspectButtonText, children: ((S = c.latestAttempt) == null ? void 0 : S.status) || "idle" })
|
|
495
500
|
]
|
|
496
501
|
}
|
|
497
502
|
);
|
|
498
503
|
}
|
|
499
|
-
function
|
|
500
|
-
const e = V(
|
|
501
|
-
return !e || !e.state.enabled ?
|
|
504
|
+
function hr() {
|
|
505
|
+
const e = V(ze);
|
|
506
|
+
return !e || !e.state.enabled ? mr : le(e.state);
|
|
502
507
|
}
|
|
503
|
-
function
|
|
508
|
+
function pt({
|
|
504
509
|
spec: e,
|
|
505
510
|
queryKind: r,
|
|
506
511
|
queryKey: t,
|
|
507
512
|
intent: n,
|
|
508
513
|
activeInputs: i,
|
|
509
|
-
debug:
|
|
514
|
+
debug: o
|
|
510
515
|
}) {
|
|
511
|
-
const
|
|
516
|
+
const u = V(ze), f = V(He), d = !!(u != null && u.state.enabled), c = u == null ? void 0 : u.dispatch, m = Sn(e), v = e.label, S = w(
|
|
512
517
|
() => JSON.stringify(e),
|
|
513
518
|
[e]
|
|
514
519
|
), g = w(
|
|
515
520
|
() => JSON.stringify(i || []),
|
|
516
521
|
[i]
|
|
517
|
-
),
|
|
522
|
+
), b = w(
|
|
518
523
|
() => JSON.stringify(n || null),
|
|
519
524
|
[n]
|
|
520
|
-
),
|
|
521
|
-
|
|
522
|
-
const
|
|
523
|
-
() =>
|
|
524
|
-
[t,
|
|
525
|
-
),
|
|
525
|
+
), k = D(e), l = D(S), y = D(n), K = D(b), E = D(i), W = D(g), L = bn(o), h = JSON.stringify(L || []), I = D(L), R = D(h);
|
|
526
|
+
l.current !== S && (l.current = S, k.current = e), K.current !== b && (K.current = b, y.current = n), W.current !== g && (W.current = g, E.current = i), R.current !== h && (R.current = h, I.current = L);
|
|
527
|
+
const q = k.current, A = y.current, U = E.current, te = I.current, ne = gr(), T = w(
|
|
528
|
+
() => m || `query_${Lr(t)}`,
|
|
529
|
+
[t, m]
|
|
530
|
+
), H = (o == null ? void 0 : o.viewId) || (f == null ? void 0 : f.id), ie = (o == null ? void 0 : o.viewTitle) || (o == null ? void 0 : o.title) || (f == null ? void 0 : f.title), oe = o == null ? void 0 : o.visualType, se = o == null ? void 0 : o.sectionTitle, j = w(
|
|
526
531
|
() => [
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
532
|
+
H || "unscoped-view",
|
|
533
|
+
T,
|
|
534
|
+
ne
|
|
530
535
|
].join("::"),
|
|
531
|
-
[
|
|
532
|
-
),
|
|
536
|
+
[T, ne, H]
|
|
537
|
+
), Ge = w(
|
|
533
538
|
() => ({
|
|
534
|
-
traceKey:
|
|
535
|
-
spec:
|
|
536
|
-
queryId:
|
|
537
|
-
queryLabel:
|
|
539
|
+
traceKey: j,
|
|
540
|
+
spec: q,
|
|
541
|
+
queryId: T,
|
|
542
|
+
queryLabel: v,
|
|
538
543
|
queryKind: r,
|
|
539
|
-
builder:
|
|
540
|
-
viewId:
|
|
541
|
-
viewTitle:
|
|
542
|
-
visualType:
|
|
543
|
-
sectionTitle:
|
|
544
|
-
sourceHints:
|
|
545
|
-
intent:
|
|
544
|
+
builder: In(r),
|
|
545
|
+
viewId: H,
|
|
546
|
+
viewTitle: ie,
|
|
547
|
+
visualType: oe,
|
|
548
|
+
sectionTitle: se,
|
|
549
|
+
sourceHints: te,
|
|
550
|
+
intent: A,
|
|
546
551
|
activeInputs: U,
|
|
547
|
-
clientWarnings:
|
|
552
|
+
clientWarnings: m ? [] : ["Query spec is missing an explicit id; using an opaque internal id."]
|
|
548
553
|
}),
|
|
549
554
|
[
|
|
550
|
-
|
|
555
|
+
T,
|
|
551
556
|
r,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
557
|
+
m,
|
|
558
|
+
v,
|
|
559
|
+
q,
|
|
555
560
|
U,
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
561
|
+
A,
|
|
562
|
+
te,
|
|
563
|
+
se,
|
|
564
|
+
j,
|
|
559
565
|
H,
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
ie
|
|
566
|
+
ie,
|
|
567
|
+
oe
|
|
563
568
|
]
|
|
564
569
|
);
|
|
565
|
-
|
|
566
|
-
if (!(!
|
|
567
|
-
return
|
|
568
|
-
|
|
570
|
+
$(() => {
|
|
571
|
+
if (!(!d || !c))
|
|
572
|
+
return c({ type: "register", descriptor: Ge }), () => {
|
|
573
|
+
c({ type: "unregister", traceKey: j });
|
|
569
574
|
};
|
|
570
|
-
}, [
|
|
575
|
+
}, [Ge, c, d, j]);
|
|
571
576
|
const F = O(
|
|
572
|
-
(
|
|
573
|
-
!
|
|
577
|
+
(C, G) => {
|
|
578
|
+
!d || !c || c({ type: "event", traceKey: j, event: C, latestAttempt: G });
|
|
574
579
|
},
|
|
575
|
-
[
|
|
576
|
-
),
|
|
580
|
+
[c, d, j]
|
|
581
|
+
), Je = O(() => {
|
|
577
582
|
F(
|
|
578
583
|
{
|
|
579
584
|
type: "query_started",
|
|
580
|
-
queryId:
|
|
581
|
-
at:
|
|
585
|
+
queryId: T,
|
|
586
|
+
at: ve()
|
|
582
587
|
},
|
|
583
588
|
{ status: "loading" }
|
|
584
589
|
);
|
|
585
|
-
}, [F,
|
|
586
|
-
(
|
|
587
|
-
const
|
|
590
|
+
}, [F, T]), Ye = O(
|
|
591
|
+
(C, G) => {
|
|
592
|
+
const ae = dr(C), de = kn(C), _r = Rn(C);
|
|
588
593
|
F(
|
|
589
594
|
{
|
|
590
595
|
type: "query_succeeded",
|
|
591
|
-
queryId:
|
|
592
|
-
requestId:
|
|
593
|
-
at:
|
|
594
|
-
rowCount:
|
|
596
|
+
queryId: T,
|
|
597
|
+
requestId: ae,
|
|
598
|
+
at: ve(),
|
|
599
|
+
rowCount: de,
|
|
595
600
|
durationMs: G
|
|
596
601
|
},
|
|
597
602
|
{
|
|
598
|
-
requestId:
|
|
603
|
+
requestId: ae,
|
|
599
604
|
status: "success",
|
|
600
605
|
durationMs: G,
|
|
601
|
-
rowCount:
|
|
602
|
-
columnCount:
|
|
603
|
-
executionResult:
|
|
606
|
+
rowCount: de,
|
|
607
|
+
columnCount: _r,
|
|
608
|
+
executionResult: ar(C)
|
|
604
609
|
}
|
|
605
610
|
);
|
|
606
611
|
},
|
|
607
|
-
[F,
|
|
608
|
-
),
|
|
609
|
-
(
|
|
610
|
-
const
|
|
612
|
+
[F, T]
|
|
613
|
+
), pe = O(
|
|
614
|
+
(C, G) => {
|
|
615
|
+
const ae = dr(C), de = C instanceof Error ? C.message : String(C);
|
|
611
616
|
F(
|
|
612
617
|
{
|
|
613
618
|
type: "query_failed",
|
|
614
|
-
queryId:
|
|
615
|
-
requestId:
|
|
616
|
-
at:
|
|
617
|
-
errorMessage:
|
|
619
|
+
queryId: T,
|
|
620
|
+
requestId: ae,
|
|
621
|
+
at: ve(),
|
|
622
|
+
errorMessage: de
|
|
618
623
|
},
|
|
619
624
|
{
|
|
620
|
-
requestId:
|
|
625
|
+
requestId: ae,
|
|
621
626
|
status: "error",
|
|
622
627
|
durationMs: G,
|
|
623
|
-
errorMessage:
|
|
624
|
-
executionResult:
|
|
628
|
+
errorMessage: de,
|
|
629
|
+
executionResult: ar(C)
|
|
625
630
|
}
|
|
626
631
|
);
|
|
627
632
|
},
|
|
628
|
-
[F,
|
|
629
|
-
),
|
|
630
|
-
(
|
|
633
|
+
[F, T]
|
|
634
|
+
), Xe = O(
|
|
635
|
+
(C) => {
|
|
631
636
|
F(
|
|
632
637
|
{
|
|
633
638
|
type: "query_ignored_stale",
|
|
634
|
-
queryId:
|
|
635
|
-
at:
|
|
636
|
-
reason:
|
|
639
|
+
queryId: T,
|
|
640
|
+
at: ve(),
|
|
641
|
+
reason: C
|
|
637
642
|
}
|
|
638
643
|
);
|
|
639
644
|
},
|
|
640
|
-
[F,
|
|
641
|
-
),
|
|
642
|
-
(
|
|
643
|
-
|
|
645
|
+
[F, T]
|
|
646
|
+
), Ze = O(
|
|
647
|
+
(C) => {
|
|
648
|
+
pe(C, 0);
|
|
644
649
|
},
|
|
645
|
-
[
|
|
646
|
-
),
|
|
650
|
+
[pe]
|
|
651
|
+
), Ee = d ? u == null ? void 0 : u.state.entries[j] : void 0;
|
|
647
652
|
return w(
|
|
648
653
|
() => ({
|
|
649
|
-
enabled:
|
|
650
|
-
queryId:
|
|
651
|
-
trace:
|
|
652
|
-
start:
|
|
653
|
-
success:
|
|
654
|
-
failure:
|
|
655
|
-
ignored:
|
|
656
|
-
validationFailure:
|
|
654
|
+
enabled: d,
|
|
655
|
+
queryId: T,
|
|
656
|
+
trace: Ee ? be(Ee) : void 0,
|
|
657
|
+
start: Je,
|
|
658
|
+
success: Ye,
|
|
659
|
+
failure: pe,
|
|
660
|
+
ignored: Xe,
|
|
661
|
+
validationFailure: Ze
|
|
657
662
|
}),
|
|
658
663
|
[
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
664
|
+
d,
|
|
665
|
+
pe,
|
|
666
|
+
Xe,
|
|
667
|
+
T,
|
|
668
|
+
Je,
|
|
669
|
+
Ye,
|
|
670
|
+
Ee,
|
|
671
|
+
Ze
|
|
667
672
|
]
|
|
668
673
|
);
|
|
669
674
|
}
|
|
670
|
-
function
|
|
671
|
-
return /* @__PURE__ */
|
|
675
|
+
function gt() {
|
|
676
|
+
return /* @__PURE__ */ a("span", { style: s.logoMark, "aria-hidden": !0, children: /* @__PURE__ */ p(
|
|
672
677
|
"svg",
|
|
673
678
|
{
|
|
674
679
|
viewBox: "0 0 100 100",
|
|
@@ -677,243 +682,263 @@ function tt() {
|
|
|
677
682
|
height: "16",
|
|
678
683
|
focusable: "false",
|
|
679
684
|
children: [
|
|
680
|
-
/* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
685
|
+
/* @__PURE__ */ a("rect", { x: "20", y: "15", width: "60", height: "12", rx: "6", fill: "currentColor" }),
|
|
686
|
+
/* @__PURE__ */ a("rect", { x: "20", y: "35", width: "40", height: "12", rx: "6", fill: "currentColor" }),
|
|
687
|
+
/* @__PURE__ */ a("rect", { x: "40", y: "55", width: "40", height: "12", rx: "6", fill: "currentColor" }),
|
|
688
|
+
/* @__PURE__ */ a("rect", { x: "20", y: "75", width: "60", height: "12", rx: "6", fill: "currentColor" })
|
|
684
689
|
]
|
|
685
690
|
}
|
|
686
691
|
) });
|
|
687
692
|
}
|
|
688
|
-
function
|
|
693
|
+
function mt({
|
|
689
694
|
trace: e
|
|
690
695
|
}) {
|
|
691
|
-
var W,
|
|
696
|
+
var W, L, h, I, R, q;
|
|
692
697
|
if (!e)
|
|
693
|
-
return /* @__PURE__ */
|
|
694
|
-
const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n =
|
|
698
|
+
return /* @__PURE__ */ a("div", { style: s.detailsPane, children: /* @__PURE__ */ a("div", { style: s.emptyState, children: "No traces registered yet" }) });
|
|
699
|
+
const r = e.latestAttempt, t = r == null ? void 0 : r.executionResult, n = Re(
|
|
695
700
|
(W = t == null ? void 0 : t.validation) == null ? void 0 : W.warnings
|
|
696
|
-
), i =
|
|
697
|
-
(
|
|
698
|
-
),
|
|
699
|
-
(
|
|
700
|
-
),
|
|
701
|
+
), i = Re((L = t == null ? void 0 : t.validation) == null ? void 0 : L.errors), o = xr(
|
|
702
|
+
(h = t == null ? void 0 : t.coverage) == null ? void 0 : h.missingObligations
|
|
703
|
+
), u = Re(
|
|
704
|
+
(I = t == null ? void 0 : t.coverage) == null ? void 0 : I.warnings
|
|
705
|
+
), f = t == null ? void 0 : t.compiledQuery, d = Zt(t), c = ((R = e.server) == null ? void 0 : R.compiledSql) || d.compiledSql, m = [
|
|
706
|
+
...r != null && r.errorMessage ? [r.errorMessage] : [],
|
|
707
|
+
...i
|
|
708
|
+
], v = [
|
|
701
709
|
...e.clientWarnings,
|
|
702
710
|
...n,
|
|
703
|
-
...
|
|
704
|
-
...
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
/* @__PURE__ */ s(
|
|
711
|
+
...o,
|
|
712
|
+
...u
|
|
713
|
+
], S = e.inputsApplied.length > 0, g = !!(f || c), b = Mt(e), k = Qt(r == null ? void 0 : r.rowCount), l = Vt(r == null ? void 0 : r.durationMs), y = e.sourceRefs.length, K = wr(e), E = Sr(K);
|
|
714
|
+
return /* @__PURE__ */ p("div", { style: s.detailsPane, children: [
|
|
715
|
+
/* @__PURE__ */ p("div", { style: s.detailsHeader, children: [
|
|
716
|
+
/* @__PURE__ */ p("div", { style: s.detailsHeaderTopRow, children: [
|
|
717
|
+
/* @__PURE__ */ a(
|
|
711
718
|
"span",
|
|
712
719
|
{
|
|
713
720
|
"aria-hidden": !0,
|
|
714
721
|
style: {
|
|
715
|
-
...
|
|
716
|
-
...
|
|
722
|
+
...s.detailsHeaderStatusDot,
|
|
723
|
+
...Er(r == null ? void 0 : r.status)
|
|
717
724
|
}
|
|
718
725
|
}
|
|
719
726
|
),
|
|
720
|
-
/* @__PURE__ */
|
|
721
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ a("span", { style: s.detailsTitle, children: qe(e) }),
|
|
728
|
+
/* @__PURE__ */ a(
|
|
722
729
|
"span",
|
|
723
730
|
{
|
|
724
731
|
style: {
|
|
725
|
-
...
|
|
726
|
-
...
|
|
732
|
+
...s.detailsKindChip,
|
|
733
|
+
...Ir(E)
|
|
727
734
|
},
|
|
728
|
-
children:
|
|
735
|
+
children: K
|
|
729
736
|
}
|
|
730
737
|
)
|
|
731
738
|
] }),
|
|
732
|
-
/* @__PURE__ */
|
|
733
|
-
/* @__PURE__ */
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
-
|
|
739
|
+
/* @__PURE__ */ p("div", { style: s.metaStrip, children: [
|
|
740
|
+
/* @__PURE__ */ a("span", { style: s.metaStripItem, children: b }),
|
|
741
|
+
/* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
|
|
742
|
+
/* @__PURE__ */ p("span", { style: s.metaStripItem, children: [
|
|
743
|
+
k,
|
|
737
744
|
" rows"
|
|
738
745
|
] }),
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
/* @__PURE__ */
|
|
741
|
-
|
|
742
|
-
/* @__PURE__ */
|
|
743
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
|
|
747
|
+
/* @__PURE__ */ a("span", { style: s.metaStripItem, children: l }),
|
|
748
|
+
y > 0 ? /* @__PURE__ */ p(pr, { children: [
|
|
749
|
+
/* @__PURE__ */ a("span", { style: s.metaStripDot, children: "·" }),
|
|
750
|
+
/* @__PURE__ */ a("span", { style: s.metaStripItem, children: y === 1 ? "1 source" : `${y} sources` })
|
|
744
751
|
] }) : null
|
|
745
752
|
] })
|
|
746
753
|
] }),
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
(
|
|
752
|
-
|
|
753
|
-
g ? /* @__PURE__ */
|
|
754
|
-
|
|
754
|
+
m.length ? /* @__PURE__ */ a(er, { tone: "error", title: "Error", items: m }) : null,
|
|
755
|
+
v.length ? /* @__PURE__ */ a(er, { tone: "warning", title: "Warnings", items: v }) : null,
|
|
756
|
+
/* @__PURE__ */ a(vt, { trace: e }),
|
|
757
|
+
/* @__PURE__ */ a(It, { trace: e }),
|
|
758
|
+
(q = e.sourceHints) != null && q.length ? /* @__PURE__ */ a(wt, { hints: e.sourceHints }) : null,
|
|
759
|
+
S ? /* @__PURE__ */ a(Et, { inputs: e.inputsApplied }) : null,
|
|
760
|
+
g ? /* @__PURE__ */ a(ue, { title: "Compiled Query", defaultOpen: !0, children: /* @__PURE__ */ a(
|
|
761
|
+
Tt,
|
|
755
762
|
{
|
|
756
|
-
compiledQuery:
|
|
757
|
-
compiledSql:
|
|
763
|
+
compiledQuery: f,
|
|
764
|
+
compiledSql: c
|
|
758
765
|
}
|
|
759
766
|
) }) : null,
|
|
760
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ a(ue, { title: "Lifecycle Events", children: e.recentEvents.length ? /* @__PURE__ */ a("div", { style: s.eventList, children: e.recentEvents.slice(-5).map((A, U) => /* @__PURE__ */ p(
|
|
761
768
|
"div",
|
|
762
769
|
{
|
|
763
|
-
style:
|
|
770
|
+
style: s.eventRow,
|
|
764
771
|
children: [
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ a("span", { style: s.eventType, children: Gt(A) }),
|
|
773
|
+
/* @__PURE__ */ a("span", { style: s.eventMeta, children: Jt(A) })
|
|
767
774
|
]
|
|
768
775
|
},
|
|
769
|
-
`${
|
|
770
|
-
)) }) : /* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */
|
|
776
|
+
`${A.type}:${A.at}:${U}`
|
|
777
|
+
)) }) : /* @__PURE__ */ a("div", { style: s.mutedText, children: "No attempts recorded" }) }),
|
|
778
|
+
/* @__PURE__ */ a(ue, { title: "Raw Trace", children: /* @__PURE__ */ a("pre", { style: s.codeBlock, children: Ut(e) }) })
|
|
772
779
|
] });
|
|
773
780
|
}
|
|
774
|
-
function
|
|
781
|
+
function er({
|
|
775
782
|
tone: e,
|
|
776
783
|
title: r,
|
|
777
784
|
items: t
|
|
778
785
|
}) {
|
|
779
|
-
const n = e === "error" ?
|
|
780
|
-
return /* @__PURE__ */
|
|
781
|
-
/* @__PURE__ */
|
|
782
|
-
t.length > 1 ? /* @__PURE__ */
|
|
786
|
+
const n = e === "error" ? s.alertCardError : s.alertCardWarning;
|
|
787
|
+
return /* @__PURE__ */ p("div", { style: { ...s.alertCard, ...n }, children: [
|
|
788
|
+
/* @__PURE__ */ a("div", { style: s.alertCardTitle, children: r }),
|
|
789
|
+
t.length > 1 ? /* @__PURE__ */ a("ul", { style: s.alertCardList, children: t.map((i, o) => /* @__PURE__ */ a("li", { children: i }, `${e}-${o}`)) }) : /* @__PURE__ */ a("div", { children: t[0] })
|
|
783
790
|
] });
|
|
784
791
|
}
|
|
785
|
-
function
|
|
792
|
+
function yt({
|
|
786
793
|
issues: e,
|
|
787
794
|
onSelect: r
|
|
788
795
|
}) {
|
|
789
|
-
const t = e.slice(0, 6),
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
796
|
+
const [t, n] = M(!1), i = e.slice(0, 6), o = e.length - i.length, u = e.filter((c) => c.tone === "error").length, f = e.length - u, d = [
|
|
797
|
+
u ? `${u} error${u === 1 ? "" : "s"}` : "",
|
|
798
|
+
f ? `${f} warning${f === 1 ? "" : "s"}` : ""
|
|
799
|
+
].filter(Boolean);
|
|
800
|
+
return /* @__PURE__ */ p("section", { style: s.issueSummary, "aria-label": "Semaphor trace issues", children: [
|
|
801
|
+
/* @__PURE__ */ p(
|
|
802
|
+
"button",
|
|
803
|
+
{
|
|
804
|
+
type: "button",
|
|
805
|
+
"aria-expanded": t,
|
|
806
|
+
style: s.issueSummaryToggle,
|
|
807
|
+
onClick: () => n((c) => !c),
|
|
808
|
+
children: [
|
|
809
|
+
/* @__PURE__ */ p("span", { style: s.issueSummaryHeaderLabel, children: [
|
|
810
|
+
t ? /* @__PURE__ */ a(it, { size: 13 }) : /* @__PURE__ */ a(tt, { size: 13 }),
|
|
811
|
+
/* @__PURE__ */ a("span", { children: "Issues" })
|
|
812
|
+
] }),
|
|
813
|
+
/* @__PURE__ */ a("span", { style: s.issueSummaryCount, children: e.length })
|
|
814
|
+
]
|
|
815
|
+
}
|
|
816
|
+
),
|
|
817
|
+
t ? /* @__PURE__ */ p("div", { style: s.issueSummaryList, children: [
|
|
818
|
+
i.map((c, m) => /* @__PURE__ */ p(
|
|
797
819
|
"button",
|
|
798
820
|
{
|
|
799
821
|
type: "button",
|
|
800
|
-
title: `${
|
|
801
|
-
style:
|
|
802
|
-
onClick: () => r(
|
|
822
|
+
title: `${c.title}: ${c.message}`,
|
|
823
|
+
style: s.issueSummaryItem,
|
|
824
|
+
onClick: () => r(c.trace),
|
|
803
825
|
children: [
|
|
804
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ a(
|
|
805
827
|
"span",
|
|
806
828
|
{
|
|
807
829
|
style: {
|
|
808
|
-
...
|
|
809
|
-
...
|
|
830
|
+
...s.issueSummaryBadge,
|
|
831
|
+
...c.tone === "error" ? s.issueSummaryBadgeError : s.issueSummaryBadgeWarning
|
|
810
832
|
},
|
|
811
|
-
children:
|
|
833
|
+
children: c.tone === "error" ? "Error" : "Warning"
|
|
812
834
|
}
|
|
813
835
|
),
|
|
814
|
-
/* @__PURE__ */
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ p("span", { style: s.issueSummaryText, children: [
|
|
837
|
+
/* @__PURE__ */ a("span", { style: s.issueSummaryTitle, children: c.title }),
|
|
838
|
+
/* @__PURE__ */ a("span", { style: s.issueSummaryMessage, children: c.message })
|
|
817
839
|
] })
|
|
818
840
|
]
|
|
819
841
|
},
|
|
820
|
-
`${
|
|
842
|
+
`${c.trace.traceId}:${c.title}:${m}`
|
|
821
843
|
)),
|
|
822
|
-
|
|
823
|
-
|
|
844
|
+
o > 0 ? /* @__PURE__ */ p("div", { style: s.issueSummaryMore, children: [
|
|
845
|
+
o,
|
|
824
846
|
" more issue",
|
|
825
|
-
|
|
847
|
+
o === 1 ? "" : "s",
|
|
826
848
|
" in traces"
|
|
827
849
|
] }) : null
|
|
850
|
+
] }) : /* @__PURE__ */ p("div", { style: s.issueSummaryCollapsed, children: [
|
|
851
|
+
d.join(" · "),
|
|
852
|
+
" across traces"
|
|
828
853
|
] })
|
|
829
854
|
] });
|
|
830
855
|
}
|
|
831
|
-
function
|
|
856
|
+
function ht({
|
|
832
857
|
status: e
|
|
833
858
|
}) {
|
|
834
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ a(
|
|
835
860
|
"span",
|
|
836
861
|
{
|
|
837
862
|
"aria-hidden": !0,
|
|
838
863
|
style: {
|
|
839
|
-
...
|
|
840
|
-
...
|
|
864
|
+
...s.statusDot,
|
|
865
|
+
...Er(e)
|
|
841
866
|
}
|
|
842
867
|
}
|
|
843
868
|
);
|
|
844
869
|
}
|
|
845
|
-
function
|
|
870
|
+
function ue({
|
|
846
871
|
title: e,
|
|
847
872
|
children: r,
|
|
848
873
|
defaultOpen: t = !1
|
|
849
874
|
}) {
|
|
850
|
-
const [n, i] =
|
|
851
|
-
return /* @__PURE__ */
|
|
875
|
+
const [n, i] = M(t);
|
|
876
|
+
return /* @__PURE__ */ p(
|
|
852
877
|
"details",
|
|
853
878
|
{
|
|
854
|
-
style:
|
|
879
|
+
style: s.disclosure,
|
|
855
880
|
open: n,
|
|
856
|
-
onToggle: (
|
|
881
|
+
onToggle: (o) => i(o.currentTarget.open),
|
|
857
882
|
children: [
|
|
858
|
-
/* @__PURE__ */
|
|
859
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ a("summary", { style: s.disclosureSummary, children: e }),
|
|
884
|
+
/* @__PURE__ */ a("div", { style: s.disclosureBody, children: r })
|
|
860
885
|
]
|
|
861
886
|
}
|
|
862
887
|
);
|
|
863
888
|
}
|
|
864
|
-
function
|
|
889
|
+
function vt({
|
|
865
890
|
trace: e
|
|
866
891
|
}) {
|
|
867
892
|
var i;
|
|
868
|
-
const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n =
|
|
869
|
-
return /* @__PURE__ */
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
-
|
|
893
|
+
const r = (i = e.projectionFieldRefs) != null && i.length ? e.projectionFieldRefs : e.fieldRefs, t = e.inputFieldRefs || [], n = zt(r);
|
|
894
|
+
return /* @__PURE__ */ p("div", { style: s.recipe, children: [
|
|
895
|
+
/* @__PURE__ */ a(bt, { sources: e.sourceRefs }),
|
|
896
|
+
/* @__PURE__ */ a(P, { title: "Measures", fields: n.measures }),
|
|
897
|
+
/* @__PURE__ */ a(P, { title: "Time fields", fields: n.timeFields }),
|
|
898
|
+
/* @__PURE__ */ a(
|
|
899
|
+
P,
|
|
875
900
|
{
|
|
876
901
|
title: "Dimensions",
|
|
877
902
|
fields: n.dimensions,
|
|
878
903
|
emptyText: "No dimensions selected"
|
|
879
904
|
}
|
|
880
905
|
),
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
/* @__PURE__ */
|
|
883
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ a(P, { title: "Identifiers", fields: n.identifiers }),
|
|
907
|
+
/* @__PURE__ */ a(P, { title: "Other fields", fields: n.other }),
|
|
908
|
+
/* @__PURE__ */ a(P, { title: "Input bindings", fields: t })
|
|
884
909
|
] });
|
|
885
910
|
}
|
|
886
|
-
function
|
|
911
|
+
function bt({
|
|
887
912
|
sources: e
|
|
888
913
|
}) {
|
|
889
|
-
return e.length ? /* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
892
|
-
/* @__PURE__ */
|
|
914
|
+
return e.length ? /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
915
|
+
/* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
|
|
916
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupTitle, children: "From" }),
|
|
917
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: e.length })
|
|
893
918
|
] }),
|
|
894
|
-
/* @__PURE__ */
|
|
895
|
-
|
|
919
|
+
/* @__PURE__ */ a("div", { style: s.sourcePillRow, children: e.map((r, t) => /* @__PURE__ */ a(
|
|
920
|
+
St,
|
|
896
921
|
{
|
|
897
922
|
source: r
|
|
898
923
|
},
|
|
899
|
-
`${
|
|
924
|
+
`${z(r)}:${t}`
|
|
900
925
|
)) })
|
|
901
926
|
] }) : null;
|
|
902
927
|
}
|
|
903
|
-
function
|
|
904
|
-
const r =
|
|
905
|
-
return /* @__PURE__ */
|
|
906
|
-
/* @__PURE__ */
|
|
907
|
-
/* @__PURE__ */
|
|
928
|
+
function St({ source: e }) {
|
|
929
|
+
const r = z(e);
|
|
930
|
+
return /* @__PURE__ */ p("span", { style: s.sourcePill, title: r, children: [
|
|
931
|
+
/* @__PURE__ */ a("span", { style: s.sourcePillLabel, children: r }),
|
|
932
|
+
/* @__PURE__ */ a("span", { style: s.sourcePillRole, children: e.kind })
|
|
908
933
|
] });
|
|
909
934
|
}
|
|
910
|
-
function
|
|
935
|
+
function It({
|
|
911
936
|
trace: e
|
|
912
937
|
}) {
|
|
913
|
-
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
|
|
938
|
+
return !e.sourceRefs.length && !e.fieldRefs.length ? null : /* @__PURE__ */ a(ue, { title: "Sources and field refs", children: /* @__PURE__ */ p("div", { style: s.traceLineage, children: [
|
|
939
|
+
/* @__PURE__ */ a(qt, { sources: e.sourceRefs }),
|
|
940
|
+
/* @__PURE__ */ a(
|
|
941
|
+
P,
|
|
917
942
|
{
|
|
918
943
|
title: "All field refs",
|
|
919
944
|
fields: e.fieldRefs,
|
|
@@ -922,86 +947,86 @@ function lt({
|
|
|
922
947
|
)
|
|
923
948
|
] }) });
|
|
924
949
|
}
|
|
925
|
-
function
|
|
950
|
+
function wt({
|
|
926
951
|
hints: e
|
|
927
952
|
}) {
|
|
928
|
-
return /* @__PURE__ */
|
|
929
|
-
const n =
|
|
953
|
+
return /* @__PURE__ */ a(ue, { title: "Source hints", children: /* @__PURE__ */ a("div", { style: s.recipeFieldList, children: e.map((r, t) => {
|
|
954
|
+
const n = Pt(r), i = r.component || r.exportName || n || "Source hint", o = [
|
|
930
955
|
r.exportName && r.exportName !== i ? r.exportName : void 0,
|
|
931
956
|
n,
|
|
932
957
|
r.note
|
|
933
958
|
].filter(Boolean).join(" · ");
|
|
934
|
-
return /* @__PURE__ */
|
|
959
|
+
return /* @__PURE__ */ p(
|
|
935
960
|
"div",
|
|
936
961
|
{
|
|
937
|
-
style:
|
|
938
|
-
title:
|
|
962
|
+
style: s.recipeFieldRow,
|
|
963
|
+
title: o || i,
|
|
939
964
|
children: [
|
|
940
|
-
/* @__PURE__ */
|
|
941
|
-
|
|
965
|
+
/* @__PURE__ */ a("span", { style: s.recipeFieldName, children: i }),
|
|
966
|
+
o ? /* @__PURE__ */ a("span", { style: s.recipeFieldMeta, children: o }) : null
|
|
942
967
|
]
|
|
943
968
|
},
|
|
944
969
|
`${i}:${n}:${t}`
|
|
945
970
|
);
|
|
946
971
|
}) }) });
|
|
947
972
|
}
|
|
948
|
-
function
|
|
973
|
+
function qt({
|
|
949
974
|
sources: e
|
|
950
975
|
}) {
|
|
951
|
-
return /* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
/* @__PURE__ */
|
|
954
|
-
/* @__PURE__ */
|
|
976
|
+
return /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
977
|
+
/* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
|
|
978
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupTitle, children: "Sources" }),
|
|
979
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: e.length })
|
|
955
980
|
] }),
|
|
956
|
-
e.length ? /* @__PURE__ */
|
|
981
|
+
e.length ? /* @__PURE__ */ a("div", { style: s.recipeFieldList, children: e.map((r, t) => /* @__PURE__ */ p(
|
|
957
982
|
"div",
|
|
958
983
|
{
|
|
959
|
-
style:
|
|
960
|
-
title:
|
|
984
|
+
style: s.recipeFieldRow,
|
|
985
|
+
title: z(r),
|
|
961
986
|
children: [
|
|
962
|
-
/* @__PURE__ */
|
|
963
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ a("span", { style: s.recipeFieldName, children: z(r) }),
|
|
988
|
+
/* @__PURE__ */ a("span", { style: s.recipeFieldMeta, children: r.kind })
|
|
964
989
|
]
|
|
965
990
|
},
|
|
966
|
-
`${
|
|
967
|
-
)) }) : /* @__PURE__ */
|
|
991
|
+
`${z(r)}:${t}`
|
|
992
|
+
)) }) : /* @__PURE__ */ a("div", { style: s.recipeEmptyText, children: "No sources captured" })
|
|
968
993
|
] });
|
|
969
994
|
}
|
|
970
|
-
function
|
|
995
|
+
function P({
|
|
971
996
|
title: e,
|
|
972
997
|
fields: r,
|
|
973
998
|
emptyText: t
|
|
974
999
|
}) {
|
|
975
|
-
return !r.length && !t ? null : /* @__PURE__ */
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */
|
|
1000
|
+
return !r.length && !t ? null : /* @__PURE__ */ p("div", { style: s.recipeGroup, children: [
|
|
1001
|
+
/* @__PURE__ */ p("div", { style: s.recipeGroupHeader, children: [
|
|
1002
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupTitle, children: e }),
|
|
1003
|
+
/* @__PURE__ */ a("span", { style: s.recipeGroupCount, children: r.length })
|
|
979
1004
|
] }),
|
|
980
|
-
r.length ? /* @__PURE__ */
|
|
981
|
-
|
|
1005
|
+
r.length ? /* @__PURE__ */ a("div", { style: s.fieldChipList, children: r.map((n, i) => /* @__PURE__ */ a(
|
|
1006
|
+
xt,
|
|
982
1007
|
{
|
|
983
1008
|
field: n,
|
|
984
1009
|
groupTitle: e
|
|
985
1010
|
},
|
|
986
|
-
`${
|
|
987
|
-
)) }) : /* @__PURE__ */
|
|
1011
|
+
`${Pe(n)}:${i}`
|
|
1012
|
+
)) }) : /* @__PURE__ */ a("div", { style: s.recipeEmptyText, children: t })
|
|
988
1013
|
] });
|
|
989
1014
|
}
|
|
990
|
-
function
|
|
1015
|
+
function xt({
|
|
991
1016
|
field: e,
|
|
992
1017
|
groupTitle: r
|
|
993
1018
|
}) {
|
|
994
|
-
const t =
|
|
995
|
-
return /* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
e.aggregate ? /* @__PURE__ */
|
|
998
|
-
/* @__PURE__ */
|
|
999
|
-
i ? /* @__PURE__ */
|
|
1000
|
-
i &&
|
|
1001
|
-
|
|
1019
|
+
const t = Ht(e), n = e.label || e.name, i = e.dataType && e.dataType !== "unknown" ? e.dataType : void 0, o = e.source ? z(e.source) : void 0, u = [t, i, o].filter(Boolean).join(" · "), f = At(e, r);
|
|
1020
|
+
return /* @__PURE__ */ p("div", { style: s.fieldChip, title: u, children: [
|
|
1021
|
+
/* @__PURE__ */ a("span", { style: { ...s.fieldGlyph, ...f.style }, children: f.text }),
|
|
1022
|
+
e.aggregate ? /* @__PURE__ */ a("span", { style: s.fieldAggBadge, children: e.aggregate }) : null,
|
|
1023
|
+
/* @__PURE__ */ a("span", { style: s.fieldChipName, children: n }),
|
|
1024
|
+
i ? /* @__PURE__ */ a("span", { style: s.fieldChipMeta, children: i }) : null,
|
|
1025
|
+
i && o ? /* @__PURE__ */ a("span", { style: s.fieldChipMetaDot, children: "·" }) : null,
|
|
1026
|
+
o ? /* @__PURE__ */ a("span", { style: s.fieldChipMeta, children: o }) : null
|
|
1002
1027
|
] });
|
|
1003
1028
|
}
|
|
1004
|
-
function
|
|
1029
|
+
function At(e, r) {
|
|
1005
1030
|
const t = e.dataType, n = e.role;
|
|
1006
1031
|
return !!e.aggregate || n === "measure" || r === "Measures" ? {
|
|
1007
1032
|
text: "Σ",
|
|
@@ -1040,28 +1065,28 @@ function pt(e, r) {
|
|
|
1040
1065
|
}
|
|
1041
1066
|
};
|
|
1042
1067
|
}
|
|
1043
|
-
function
|
|
1068
|
+
function Et({
|
|
1044
1069
|
inputs: e
|
|
1045
1070
|
}) {
|
|
1046
|
-
return /* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
/* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */
|
|
1071
|
+
return /* @__PURE__ */ p("div", { style: s.inputsAppliedBlock, children: [
|
|
1072
|
+
/* @__PURE__ */ p("div", { style: s.inputsAppliedHeader, children: [
|
|
1073
|
+
/* @__PURE__ */ a("span", { style: s.inputsAppliedTitle, children: "Active Inputs" }),
|
|
1074
|
+
/* @__PURE__ */ a("span", { style: s.inputsAppliedCount, children: e.length })
|
|
1050
1075
|
] }),
|
|
1051
|
-
/* @__PURE__ */
|
|
1052
|
-
const t =
|
|
1053
|
-
return /* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ a("div", { style: s.inputRecipeList, children: e.map((r) => {
|
|
1077
|
+
const t = jt(r);
|
|
1078
|
+
return /* @__PURE__ */ p(
|
|
1054
1079
|
"div",
|
|
1055
1080
|
{
|
|
1056
|
-
style:
|
|
1081
|
+
style: s.inputRecipeRow,
|
|
1057
1082
|
title: t.title,
|
|
1058
1083
|
children: [
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
/* @__PURE__ */
|
|
1061
|
-
t.operator ? /* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1084
|
+
/* @__PURE__ */ p("div", { style: s.inputRecipeHeader, children: [
|
|
1085
|
+
/* @__PURE__ */ a("span", { style: s.inputRecipeId, title: r.inputId, children: r.inputId }),
|
|
1086
|
+
t.operator ? /* @__PURE__ */ a("span", { style: s.inputOperatorBadge, children: t.operator }) : null,
|
|
1087
|
+
/* @__PURE__ */ a("span", { style: s.inputValuePreview, title: t.value, children: t.value })
|
|
1063
1088
|
] }),
|
|
1064
|
-
t.binding ? /* @__PURE__ */
|
|
1089
|
+
t.binding ? /* @__PURE__ */ a("div", { style: s.inputRecipeBinding, title: t.binding, children: t.binding }) : null
|
|
1065
1090
|
]
|
|
1066
1091
|
},
|
|
1067
1092
|
r.inputId
|
|
@@ -1069,41 +1094,41 @@ function gt({
|
|
|
1069
1094
|
}) })
|
|
1070
1095
|
] });
|
|
1071
1096
|
}
|
|
1072
|
-
function
|
|
1097
|
+
function Tt({
|
|
1073
1098
|
compiledQuery: e,
|
|
1074
1099
|
compiledSql: r
|
|
1075
1100
|
}) {
|
|
1076
|
-
return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */
|
|
1077
|
-
/* @__PURE__ */
|
|
1078
|
-
e.pythonCode ? /* @__PURE__ */
|
|
1079
|
-
e.parameters ? /* @__PURE__ */
|
|
1080
|
-
|
|
1101
|
+
return (e == null ? void 0 : e.kind) === "sql" ? /* @__PURE__ */ p("div", { style: s.compiledQuery, children: [
|
|
1102
|
+
/* @__PURE__ */ a(rr, { label: "SQL", value: e.sql }),
|
|
1103
|
+
e.pythonCode ? /* @__PURE__ */ a(ke, { label: "Python", value: e.pythonCode }) : null,
|
|
1104
|
+
e.parameters ? /* @__PURE__ */ a(
|
|
1105
|
+
ke,
|
|
1081
1106
|
{
|
|
1082
1107
|
label: "Parameters",
|
|
1083
|
-
value:
|
|
1108
|
+
value: _e(e.parameters)
|
|
1084
1109
|
}
|
|
1085
1110
|
) : null
|
|
1086
|
-
] }) : r ? /* @__PURE__ */
|
|
1111
|
+
] }) : r ? /* @__PURE__ */ a(rr, { label: "SQL", value: r }) : /* @__PURE__ */ a(ke, { label: "Compiled Query", value: _e(e) });
|
|
1087
1112
|
}
|
|
1088
|
-
function
|
|
1113
|
+
function ke({
|
|
1089
1114
|
label: e,
|
|
1090
1115
|
value: r
|
|
1091
1116
|
}) {
|
|
1092
|
-
return /* @__PURE__ */
|
|
1093
|
-
/* @__PURE__ */
|
|
1094
|
-
/* @__PURE__ */
|
|
1117
|
+
return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
|
|
1118
|
+
/* @__PURE__ */ a("div", { style: s.codeBlockLabel, children: e }),
|
|
1119
|
+
/* @__PURE__ */ a("pre", { style: s.codeBlock, children: r })
|
|
1095
1120
|
] });
|
|
1096
1121
|
}
|
|
1097
|
-
function
|
|
1122
|
+
function rr({
|
|
1098
1123
|
label: e,
|
|
1099
1124
|
value: r
|
|
1100
1125
|
}) {
|
|
1101
|
-
return /* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1126
|
+
return /* @__PURE__ */ p("div", { style: s.codeBlockGroup, children: [
|
|
1127
|
+
/* @__PURE__ */ a("div", { style: s.codeBlockLabel, children: e }),
|
|
1128
|
+
/* @__PURE__ */ a("pre", { style: s.codeBlock, children: kt(r) })
|
|
1104
1129
|
] });
|
|
1105
1130
|
}
|
|
1106
|
-
const
|
|
1131
|
+
const Ct = /* @__PURE__ */ new Set([
|
|
1107
1132
|
"SELECT",
|
|
1108
1133
|
"FROM",
|
|
1109
1134
|
"JOIN",
|
|
@@ -1141,77 +1166,93 @@ const yt = /* @__PURE__ */ new Set([
|
|
|
1141
1166
|
"ALL",
|
|
1142
1167
|
"WITH"
|
|
1143
1168
|
]);
|
|
1144
|
-
function
|
|
1169
|
+
function kt(e) {
|
|
1145
1170
|
return e.split(/(\s+|,|\(|\))/).map((t, n) => {
|
|
1146
1171
|
if (!t) return null;
|
|
1147
1172
|
const i = t.toUpperCase();
|
|
1148
|
-
return
|
|
1173
|
+
return Ct.has(i) ? /* @__PURE__ */ a("span", { style: s.sqlKeyword, children: t }, n) : t.startsWith("$") || t.startsWith(":") || t.startsWith("?") ? /* @__PURE__ */ a("span", { style: s.sqlBindParam, children: t }, n) : /* @__PURE__ */ a("span", { children: t }, n);
|
|
1149
1174
|
});
|
|
1150
1175
|
}
|
|
1151
|
-
function
|
|
1176
|
+
function je(e) {
|
|
1152
1177
|
return e.flatMap((r) => {
|
|
1153
|
-
var
|
|
1154
|
-
const t = r.latestAttempt, n = t == null ? void 0 : t.executionResult, i =
|
|
1155
|
-
(
|
|
1156
|
-
),
|
|
1157
|
-
(
|
|
1158
|
-
),
|
|
1159
|
-
(
|
|
1160
|
-
),
|
|
1178
|
+
var m, v, S, g;
|
|
1179
|
+
const t = r.latestAttempt, n = t == null ? void 0 : t.executionResult, i = De(
|
|
1180
|
+
(m = n == null ? void 0 : n.validation) == null ? void 0 : m.warnings
|
|
1181
|
+
), o = De(
|
|
1182
|
+
(v = n == null ? void 0 : n.validation) == null ? void 0 : v.errors
|
|
1183
|
+
), u = xr(
|
|
1184
|
+
(S = n == null ? void 0 : n.coverage) == null ? void 0 : S.missingObligations
|
|
1185
|
+
), f = De(
|
|
1161
1186
|
(g = n == null ? void 0 : n.coverage) == null ? void 0 : g.warnings
|
|
1162
|
-
),
|
|
1163
|
-
(t == null ? void 0 : t.status) === "error" &&
|
|
1187
|
+
), d = [], c = qe(r);
|
|
1188
|
+
(t == null ? void 0 : t.status) === "error" && d.push({
|
|
1164
1189
|
trace: r,
|
|
1165
1190
|
tone: "error",
|
|
1166
|
-
title:
|
|
1191
|
+
title: c,
|
|
1167
1192
|
message: t.errorMessage || "Query attempt failed."
|
|
1168
1193
|
});
|
|
1169
|
-
for (const
|
|
1170
|
-
|
|
1171
|
-
for (const
|
|
1172
|
-
|
|
1173
|
-
for (const
|
|
1174
|
-
|
|
1175
|
-
for (const
|
|
1176
|
-
|
|
1177
|
-
for (const
|
|
1178
|
-
|
|
1179
|
-
return
|
|
1194
|
+
for (const b of r.clientWarnings)
|
|
1195
|
+
d.push({ trace: r, tone: "warning", title: c, message: b });
|
|
1196
|
+
for (const b of i)
|
|
1197
|
+
d.push({ trace: r, tone: "warning", title: c, ...b });
|
|
1198
|
+
for (const b of o)
|
|
1199
|
+
d.push({ trace: r, tone: "error", title: c, ...b });
|
|
1200
|
+
for (const b of u)
|
|
1201
|
+
d.push({ trace: r, tone: "warning", title: c, message: b });
|
|
1202
|
+
for (const b of f)
|
|
1203
|
+
d.push({ trace: r, tone: "warning", title: c, ...b });
|
|
1204
|
+
return d;
|
|
1180
1205
|
});
|
|
1181
1206
|
}
|
|
1182
|
-
function
|
|
1183
|
-
return
|
|
1207
|
+
function Rt(e) {
|
|
1208
|
+
return {
|
|
1209
|
+
traceId: e.trace.traceId,
|
|
1210
|
+
queryId: e.trace.queryId,
|
|
1211
|
+
viewId: e.trace.viewId,
|
|
1212
|
+
viewTitle: e.trace.viewTitle,
|
|
1213
|
+
queryLabel: e.trace.queryLabel,
|
|
1214
|
+
severity: e.tone,
|
|
1215
|
+
title: e.title,
|
|
1216
|
+
message: e.message,
|
|
1217
|
+
code: e.code,
|
|
1218
|
+
path: e.path
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
1221
|
+
function Dt(e, r) {
|
|
1222
|
+
return e.filter((t) => br(t.trace, r)).length;
|
|
1184
1223
|
}
|
|
1185
|
-
function
|
|
1186
|
-
const r =
|
|
1187
|
-
(
|
|
1188
|
-
var
|
|
1189
|
-
return ((
|
|
1224
|
+
function Lt(e) {
|
|
1225
|
+
const r = je(e), t = e.filter(
|
|
1226
|
+
(u) => {
|
|
1227
|
+
var f;
|
|
1228
|
+
return ((f = u.latestAttempt) == null ? void 0 : f.status) === "error";
|
|
1190
1229
|
}
|
|
1191
1230
|
).length, n = e.filter(
|
|
1192
|
-
(
|
|
1193
|
-
var
|
|
1194
|
-
return ((
|
|
1231
|
+
(u) => {
|
|
1232
|
+
var f;
|
|
1233
|
+
return ((f = u.latestAttempt) == null ? void 0 : f.status) === "loading";
|
|
1195
1234
|
}
|
|
1196
|
-
).length, i = r.filter((
|
|
1235
|
+
).length, i = r.filter((u) => u.tone === "error").length, o = r.filter((u) => u.tone === "warning").length;
|
|
1197
1236
|
return {
|
|
1198
1237
|
total: e.length,
|
|
1199
1238
|
failed: t,
|
|
1200
1239
|
loading: n,
|
|
1201
|
-
|
|
1240
|
+
errorCount: i,
|
|
1241
|
+
warningCount: o,
|
|
1202
1242
|
issueCount: r.length,
|
|
1203
|
-
severity: t ? "error" :
|
|
1243
|
+
severity: t || i ? "error" : o ? "warning" : n ? "loading" : "ok"
|
|
1204
1244
|
};
|
|
1205
1245
|
}
|
|
1206
|
-
function
|
|
1246
|
+
function Ot(e) {
|
|
1207
1247
|
return [
|
|
1208
1248
|
`${e.total} ${e.total === 1 ? "trace" : "traces"}`,
|
|
1209
1249
|
`${e.loading} loading`,
|
|
1210
1250
|
`${e.failed} failed`,
|
|
1251
|
+
`${e.errorCount} error${e.errorCount === 1 ? "" : "s"}`,
|
|
1211
1252
|
`${e.warningCount} warning${e.warningCount === 1 ? "" : "s"}`
|
|
1212
1253
|
].join(" · ");
|
|
1213
1254
|
}
|
|
1214
|
-
function
|
|
1255
|
+
function Bt(e, r) {
|
|
1215
1256
|
const t = r.trim().toLowerCase();
|
|
1216
1257
|
return t ? e.filter(
|
|
1217
1258
|
(n) => [
|
|
@@ -1223,36 +1264,36 @@ function wt(e, r) {
|
|
|
1223
1264
|
n.sectionTitle,
|
|
1224
1265
|
n.builder,
|
|
1225
1266
|
n.queryKind,
|
|
1226
|
-
|
|
1267
|
+
qr(n)
|
|
1227
1268
|
].filter(Boolean).join(" ").toLowerCase().includes(t)
|
|
1228
1269
|
) : e;
|
|
1229
1270
|
}
|
|
1230
|
-
function
|
|
1231
|
-
const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(
|
|
1271
|
+
function $t(e) {
|
|
1272
|
+
const r = e.filter((i) => i.queryKind === "inputOptions"), t = new Set(r.map(We));
|
|
1232
1273
|
return [
|
|
1233
|
-
{ title: "Views", traces: e.filter((i) => !t.has(
|
|
1274
|
+
{ title: "Views", traces: e.filter((i) => !t.has(We(i))) },
|
|
1234
1275
|
{ title: "Inputs", traces: r }
|
|
1235
1276
|
];
|
|
1236
1277
|
}
|
|
1237
|
-
function
|
|
1278
|
+
function vr(e, r) {
|
|
1238
1279
|
if (!(!(r != null && r.traceId) && !(r != null && r.queryId) && !(r != null && r.viewId)))
|
|
1239
1280
|
return r.traceId ? e.find((t) => t.traceId === r.traceId) : e.find((t) => !(r.queryId && t.queryId !== r.queryId || r.viewId && t.viewId !== r.viewId));
|
|
1240
1281
|
}
|
|
1241
|
-
function
|
|
1282
|
+
function Kt(e, r) {
|
|
1242
1283
|
if (r.queryId)
|
|
1243
|
-
return
|
|
1284
|
+
return vr(e, r);
|
|
1244
1285
|
if (!r.viewId)
|
|
1245
1286
|
return;
|
|
1246
1287
|
const t = e.filter((n) => n.viewId === r.viewId);
|
|
1247
1288
|
return t.length === 1 ? t[0] : void 0;
|
|
1248
1289
|
}
|
|
1249
|
-
function
|
|
1290
|
+
function br(e, r) {
|
|
1250
1291
|
return !!(e && r && e.traceId === r.traceId);
|
|
1251
1292
|
}
|
|
1252
|
-
function
|
|
1293
|
+
function We(e) {
|
|
1253
1294
|
return e.traceId;
|
|
1254
1295
|
}
|
|
1255
|
-
function
|
|
1296
|
+
function Wt(e) {
|
|
1256
1297
|
switch (e) {
|
|
1257
1298
|
case "metric":
|
|
1258
1299
|
return "metric";
|
|
@@ -1267,14 +1308,14 @@ function qt(e) {
|
|
|
1267
1308
|
case "sql":
|
|
1268
1309
|
return "sql";
|
|
1269
1310
|
default:
|
|
1270
|
-
return
|
|
1311
|
+
return xe(e);
|
|
1271
1312
|
}
|
|
1272
1313
|
}
|
|
1273
|
-
function
|
|
1314
|
+
function Sr(e) {
|
|
1274
1315
|
const r = e.trim().toLowerCase();
|
|
1275
1316
|
return r === "metric" || r === "kpi" ? "metric" : r === "records" || r === "table" ? "records" : r === "matrix" || r === "pivot" ? "matrix" : r === "analysis" ? "analysis" : r === "inputs" || r === "input options" ? "inputs" : r === "sql" ? "sql" : "default";
|
|
1276
1317
|
}
|
|
1277
|
-
function
|
|
1318
|
+
function Ir(e) {
|
|
1278
1319
|
switch (e) {
|
|
1279
1320
|
case "metric":
|
|
1280
1321
|
return {
|
|
@@ -1306,28 +1347,28 @@ function gr(e) {
|
|
|
1306
1347
|
};
|
|
1307
1348
|
}
|
|
1308
1349
|
}
|
|
1309
|
-
function
|
|
1350
|
+
function qe(e) {
|
|
1310
1351
|
return e.viewTitle || e.queryLabel || e.viewId || e.queryId;
|
|
1311
1352
|
}
|
|
1312
|
-
function
|
|
1353
|
+
function _t(e, r, t) {
|
|
1313
1354
|
const n = [];
|
|
1314
1355
|
return e.queryLabel && e.queryLabel !== r && n.push(e.queryLabel), e.queryId && e.queryId !== r && e.queryId !== e.queryLabel ? n.push(e.queryId) : e.viewId && e.viewId !== r && e.viewId !== e.queryLabel && n.push(e.viewId), n.push(t), n;
|
|
1315
1356
|
}
|
|
1316
|
-
function
|
|
1317
|
-
return
|
|
1357
|
+
function wr(e) {
|
|
1358
|
+
return Ft(e.visualType) || Wt(e.queryKind);
|
|
1318
1359
|
}
|
|
1319
|
-
function
|
|
1320
|
-
return r ? e.queryLabel || e.queryId :
|
|
1360
|
+
function Nt(e, r) {
|
|
1361
|
+
return r ? e.queryLabel || e.queryId : qe(e);
|
|
1321
1362
|
}
|
|
1322
|
-
function
|
|
1363
|
+
function Ft(e) {
|
|
1323
1364
|
if (e)
|
|
1324
1365
|
return e.replace(/[_-]+/g, " ").replace(/\b\w/g, (r) => r.toUpperCase());
|
|
1325
1366
|
}
|
|
1326
|
-
function
|
|
1327
|
-
const r = e.sourceRefs.map(
|
|
1367
|
+
function qr(e) {
|
|
1368
|
+
const r = e.sourceRefs.map(z);
|
|
1328
1369
|
return r.length ? r.length === 1 ? r[0] : `${r[0]} + ${r.length - 1} more` : "No source";
|
|
1329
1370
|
}
|
|
1330
|
-
function
|
|
1371
|
+
function zt(e) {
|
|
1331
1372
|
return e.reduce(
|
|
1332
1373
|
(r, t) => (t.role === "measure" ? r.measures.push(t) : t.role === "date" ? r.timeFields.push(t) : t.role === "dimension" ? r.dimensions.push(t) : t.role === "id" ? r.identifiers.push(t) : r.other.push(t), r),
|
|
1333
1374
|
{
|
|
@@ -1339,7 +1380,7 @@ function Rt(e) {
|
|
|
1339
1380
|
}
|
|
1340
1381
|
);
|
|
1341
1382
|
}
|
|
1342
|
-
function
|
|
1383
|
+
function Mt(e) {
|
|
1343
1384
|
var r, t;
|
|
1344
1385
|
if (e.queryKind === "records" && ((r = e.projectionFieldRefs) != null && r.length) && e.projectionFieldRefs.every((n) => n.role === "measure") && ((t = e.latestAttempt) == null ? void 0 : t.rowCount) === 1)
|
|
1345
1386
|
return "KPI query";
|
|
@@ -1357,15 +1398,15 @@ function Ct(e) {
|
|
|
1357
1398
|
case "sql":
|
|
1358
1399
|
return "SQL query";
|
|
1359
1400
|
default:
|
|
1360
|
-
return
|
|
1401
|
+
return xe(e.queryKind);
|
|
1361
1402
|
}
|
|
1362
1403
|
}
|
|
1363
|
-
function
|
|
1404
|
+
function Ht(e) {
|
|
1364
1405
|
return [e.aggregate, e.label || e.name].filter(Boolean).join(" ");
|
|
1365
1406
|
}
|
|
1366
|
-
function
|
|
1367
|
-
var
|
|
1368
|
-
const r = e.valuePreview || "redacted", t = ((
|
|
1407
|
+
function jt(e) {
|
|
1408
|
+
var u, f, d;
|
|
1409
|
+
const r = e.valuePreview || "redacted", t = ((u = e.fieldRef) == null ? void 0 : u.label) || ((f = e.fieldRef) == null ? void 0 : f.name), n = (d = e.fieldRef) != null && d.source ? z(e.fieldRef.source) : void 0, i = [t ? `on ${t}` : void 0, n].filter(Boolean).join(" · "), o = [
|
|
1369
1410
|
e.inputId,
|
|
1370
1411
|
e.operator,
|
|
1371
1412
|
r,
|
|
@@ -1375,32 +1416,32 @@ function Lt(e) {
|
|
|
1375
1416
|
operator: e.operator,
|
|
1376
1417
|
value: r,
|
|
1377
1418
|
binding: i,
|
|
1378
|
-
title:
|
|
1419
|
+
title: o
|
|
1379
1420
|
};
|
|
1380
1421
|
}
|
|
1381
|
-
function
|
|
1422
|
+
function z(e) {
|
|
1382
1423
|
return e.kind === "semantic" ? e.datasetName || e.datasetId || e.domainId : e.kind === "physical" ? [
|
|
1383
1424
|
e.schemaName,
|
|
1384
1425
|
e.tableName
|
|
1385
1426
|
].filter(Boolean).join(".") || e.tableName : e.connectionId ? `SQL ${e.connectionId}` : "SQL source";
|
|
1386
1427
|
}
|
|
1387
|
-
function
|
|
1428
|
+
function Pt(e) {
|
|
1388
1429
|
if (e.file)
|
|
1389
1430
|
return e.line && e.column ? `${e.file}:${e.line}:${e.column}` : e.line ? `${e.file}:${e.line}` : e.file;
|
|
1390
1431
|
}
|
|
1391
|
-
function
|
|
1432
|
+
function Qt(e) {
|
|
1392
1433
|
return typeof e == "number" ? e.toLocaleString() : "-";
|
|
1393
1434
|
}
|
|
1394
|
-
function
|
|
1435
|
+
function Vt(e) {
|
|
1395
1436
|
return typeof e == "number" ? `${Math.round(e)}ms` : "-";
|
|
1396
1437
|
}
|
|
1397
|
-
function
|
|
1398
|
-
return
|
|
1438
|
+
function Ut(e) {
|
|
1439
|
+
return _e(e);
|
|
1399
1440
|
}
|
|
1400
|
-
function
|
|
1441
|
+
function _e(e) {
|
|
1401
1442
|
return JSON.stringify(e, null, 2) ?? "undefined";
|
|
1402
1443
|
}
|
|
1403
|
-
function
|
|
1444
|
+
function Gt(e) {
|
|
1404
1445
|
switch (e.type) {
|
|
1405
1446
|
case "query_started":
|
|
1406
1447
|
return "Started";
|
|
@@ -1413,10 +1454,10 @@ function Wt(e) {
|
|
|
1413
1454
|
case "input_changed":
|
|
1414
1455
|
return "Input changed";
|
|
1415
1456
|
default:
|
|
1416
|
-
return
|
|
1457
|
+
return Yt(e);
|
|
1417
1458
|
}
|
|
1418
1459
|
}
|
|
1419
|
-
function
|
|
1460
|
+
function Jt(e) {
|
|
1420
1461
|
return [
|
|
1421
1462
|
e.at,
|
|
1422
1463
|
"durationMs" in e && typeof e.durationMs == "number" ? `${Math.round(e.durationMs)}ms` : void 0,
|
|
@@ -1425,31 +1466,44 @@ function Nt(e) {
|
|
|
1425
1466
|
"errorMessage" in e ? e.errorMessage : void 0
|
|
1426
1467
|
].filter(Boolean).join(" - ");
|
|
1427
1468
|
}
|
|
1428
|
-
function
|
|
1469
|
+
function Yt(e) {
|
|
1429
1470
|
throw new Error(`Unsupported Semaphor trace event: ${JSON.stringify(e)}`);
|
|
1430
1471
|
}
|
|
1431
|
-
function
|
|
1472
|
+
function xr(e) {
|
|
1432
1473
|
return Array.isArray(e) ? e.filter((r) => typeof r == "string") : [];
|
|
1433
1474
|
}
|
|
1434
|
-
function
|
|
1435
|
-
return Array.isArray(e) ? e.map((r) =>
|
|
1475
|
+
function Re(e) {
|
|
1476
|
+
return Array.isArray(e) ? e.map((r) => Xt(r)).filter((r) => !!r) : [];
|
|
1436
1477
|
}
|
|
1437
|
-
function
|
|
1478
|
+
function De(e) {
|
|
1479
|
+
return Array.isArray(e) ? e.map((r) => Ar(r)).filter(
|
|
1480
|
+
(r) => !!r
|
|
1481
|
+
) : [];
|
|
1482
|
+
}
|
|
1483
|
+
function Xt(e) {
|
|
1484
|
+
var r;
|
|
1485
|
+
return (r = Ar(e)) == null ? void 0 : r.message;
|
|
1486
|
+
}
|
|
1487
|
+
function Ar(e) {
|
|
1438
1488
|
if (typeof e == "string")
|
|
1439
|
-
return e;
|
|
1489
|
+
return { message: e };
|
|
1440
1490
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1441
1491
|
return;
|
|
1442
1492
|
const r = e, t = typeof r.message == "string" ? r.message : "", n = typeof r.code == "string" ? r.code : "", i = typeof r.path == "string" ? r.path : "";
|
|
1443
|
-
return t && n ?
|
|
1493
|
+
return t && n ? {
|
|
1494
|
+
message: i ? `${t} (${n}, ${i})` : `${t} (${n})`,
|
|
1495
|
+
code: n,
|
|
1496
|
+
...i ? { path: i } : {}
|
|
1497
|
+
} : t ? { message: t } : n ? { message: n, code: n } : void 0;
|
|
1444
1498
|
}
|
|
1445
|
-
function
|
|
1499
|
+
function Zt(e) {
|
|
1446
1500
|
const r = e == null ? void 0 : e.metadata, t = r && typeof r == "object" && !Array.isArray(r) && "dataAppDebug" in r && r.dataAppDebug && typeof r.dataAppDebug == "object" && !Array.isArray(r.dataAppDebug) ? r.dataAppDebug : void 0;
|
|
1447
1501
|
return {
|
|
1448
1502
|
compiledSql: typeof (t == null ? void 0 : t.compiledSql) == "string" ? t.compiledSql : void 0,
|
|
1449
1503
|
queryHash: typeof (t == null ? void 0 : t.queryHash) == "string" ? t.queryHash : void 0
|
|
1450
1504
|
};
|
|
1451
1505
|
}
|
|
1452
|
-
function
|
|
1506
|
+
function en(e) {
|
|
1453
1507
|
return e === "relative" ? {
|
|
1454
1508
|
position: "relative",
|
|
1455
1509
|
top: "auto",
|
|
@@ -1463,7 +1517,7 @@ function zt(e) {
|
|
|
1463
1517
|
left: e.endsWith("left") ? 20 : "auto"
|
|
1464
1518
|
};
|
|
1465
1519
|
}
|
|
1466
|
-
function
|
|
1520
|
+
function rn(e) {
|
|
1467
1521
|
return e === "error" ? {
|
|
1468
1522
|
borderColor: "var(--sd-error-border)",
|
|
1469
1523
|
background: "var(--sd-error-bg)",
|
|
@@ -1482,7 +1536,7 @@ function Mt(e) {
|
|
|
1482
1536
|
color: "var(--sd-success-fg)"
|
|
1483
1537
|
};
|
|
1484
1538
|
}
|
|
1485
|
-
function
|
|
1539
|
+
function tn(e) {
|
|
1486
1540
|
return e === "right" ? {
|
|
1487
1541
|
top: 16,
|
|
1488
1542
|
right: 16,
|
|
@@ -1501,23 +1555,23 @@ function Ht(e) {
|
|
|
1501
1555
|
borderRadius: 6
|
|
1502
1556
|
};
|
|
1503
1557
|
}
|
|
1504
|
-
function
|
|
1558
|
+
function nn(e) {
|
|
1505
1559
|
return e === "right" ? {
|
|
1506
1560
|
gridTemplateColumns: "minmax(210px, 280px) minmax(0, 1fr)"
|
|
1507
1561
|
} : {
|
|
1508
1562
|
gridTemplateColumns: "minmax(260px, 340px) minmax(0, 1fr)"
|
|
1509
1563
|
};
|
|
1510
1564
|
}
|
|
1511
|
-
function
|
|
1565
|
+
function on(e) {
|
|
1512
1566
|
return {
|
|
1513
1567
|
borderRight: "1px solid var(--sd-border)",
|
|
1514
1568
|
borderBottom: 0
|
|
1515
1569
|
};
|
|
1516
1570
|
}
|
|
1517
|
-
function
|
|
1571
|
+
function Er(e) {
|
|
1518
1572
|
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)" };
|
|
1519
1573
|
}
|
|
1520
|
-
function
|
|
1574
|
+
function sn(e) {
|
|
1521
1575
|
return e === "error" ? {
|
|
1522
1576
|
borderColor: "var(--sd-error-border)",
|
|
1523
1577
|
color: "var(--sd-error-fg)"
|
|
@@ -1532,8 +1586,8 @@ function Vt(e) {
|
|
|
1532
1586
|
color: "var(--sd-fg-muted)"
|
|
1533
1587
|
};
|
|
1534
1588
|
}
|
|
1535
|
-
const
|
|
1536
|
-
.${
|
|
1589
|
+
const tr = "semaphor-devtools-stylesheet", N = "semaphor-devtools", an = `
|
|
1590
|
+
.${N} {
|
|
1537
1591
|
--sd-bg: #ffffff;
|
|
1538
1592
|
--sd-bg-muted: #fafafa;
|
|
1539
1593
|
--sd-bg-raised: #ffffff;
|
|
@@ -1582,7 +1636,7 @@ const Ue = "semaphor-devtools-stylesheet", K = "semaphor-devtools", Qt = `
|
|
|
1582
1636
|
}
|
|
1583
1637
|
|
|
1584
1638
|
@media (prefers-color-scheme: dark) {
|
|
1585
|
-
.${
|
|
1639
|
+
.${N} {
|
|
1586
1640
|
--sd-bg: #09090b;
|
|
1587
1641
|
--sd-bg-muted: #18181b;
|
|
1588
1642
|
--sd-bg-raised: #18181b;
|
|
@@ -1626,7 +1680,7 @@ const Ue = "semaphor-devtools-stylesheet", K = "semaphor-devtools", Qt = `
|
|
|
1626
1680
|
}
|
|
1627
1681
|
}
|
|
1628
1682
|
|
|
1629
|
-
.${
|
|
1683
|
+
.${N}-source {
|
|
1630
1684
|
display: -webkit-box;
|
|
1631
1685
|
-webkit-line-clamp: 2;
|
|
1632
1686
|
-webkit-box-orient: vertical;
|
|
@@ -1634,19 +1688,19 @@ const Ue = "semaphor-devtools-stylesheet", K = "semaphor-devtools", Qt = `
|
|
|
1634
1688
|
word-break: break-all;
|
|
1635
1689
|
}
|
|
1636
1690
|
`;
|
|
1637
|
-
function
|
|
1638
|
-
if (typeof document > "u" || document.getElementById(
|
|
1691
|
+
function Tr() {
|
|
1692
|
+
if (typeof document > "u" || document.getElementById(tr))
|
|
1639
1693
|
return;
|
|
1640
1694
|
const e = document.createElement("style");
|
|
1641
|
-
e.id =
|
|
1695
|
+
e.id = tr, e.textContent = an, document.head.appendChild(e);
|
|
1642
1696
|
}
|
|
1643
|
-
const
|
|
1697
|
+
const me = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', _ = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace", ye = {
|
|
1644
1698
|
color: "var(--sd-fg-muted)",
|
|
1645
1699
|
fontSize: 10,
|
|
1646
1700
|
fontWeight: 600,
|
|
1647
1701
|
textTransform: "uppercase",
|
|
1648
1702
|
letterSpacing: "0.08em"
|
|
1649
|
-
},
|
|
1703
|
+
}, s = {
|
|
1650
1704
|
launcher: {
|
|
1651
1705
|
position: "fixed",
|
|
1652
1706
|
bottom: 20,
|
|
@@ -1661,7 +1715,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1661
1715
|
borderStyle: "solid",
|
|
1662
1716
|
borderRadius: 6,
|
|
1663
1717
|
boxShadow: "var(--sd-shadow)",
|
|
1664
|
-
font: `600 12px/1.2 ${
|
|
1718
|
+
font: `600 12px/1.2 ${me}`,
|
|
1665
1719
|
cursor: "pointer"
|
|
1666
1720
|
},
|
|
1667
1721
|
launcherText: {
|
|
@@ -1706,7 +1760,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1706
1760
|
background: "var(--sd-bg)",
|
|
1707
1761
|
color: "var(--sd-fg)",
|
|
1708
1762
|
boxShadow: "var(--sd-shadow)",
|
|
1709
|
-
font: `13px/1.4 ${
|
|
1763
|
+
font: `13px/1.4 ${me}`
|
|
1710
1764
|
},
|
|
1711
1765
|
panelFullscreen: {
|
|
1712
1766
|
top: 0,
|
|
@@ -1775,7 +1829,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1775
1829
|
outline: 0,
|
|
1776
1830
|
background: "transparent",
|
|
1777
1831
|
color: "var(--sd-fg)",
|
|
1778
|
-
font: `12px/1.4 ${
|
|
1832
|
+
font: `12px/1.4 ${me}`
|
|
1779
1833
|
},
|
|
1780
1834
|
issueSummary: {
|
|
1781
1835
|
margin: "0 10px 10px",
|
|
@@ -1787,17 +1841,33 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1787
1841
|
color: "var(--sd-warning-fg)",
|
|
1788
1842
|
overflow: "hidden"
|
|
1789
1843
|
},
|
|
1790
|
-
|
|
1844
|
+
issueSummaryToggle: {
|
|
1791
1845
|
display: "flex",
|
|
1792
1846
|
alignItems: "center",
|
|
1793
1847
|
justifyContent: "space-between",
|
|
1794
1848
|
gap: 8,
|
|
1849
|
+
width: "100%",
|
|
1795
1850
|
padding: "7px 9px 5px",
|
|
1796
|
-
|
|
1851
|
+
border: 0,
|
|
1852
|
+
background: "transparent",
|
|
1853
|
+
color: "inherit",
|
|
1854
|
+
cursor: "pointer",
|
|
1855
|
+
...ye
|
|
1856
|
+
},
|
|
1857
|
+
issueSummaryHeaderLabel: {
|
|
1858
|
+
display: "inline-flex",
|
|
1859
|
+
alignItems: "center",
|
|
1860
|
+
gap: 4,
|
|
1861
|
+
minWidth: 0
|
|
1797
1862
|
},
|
|
1798
1863
|
issueSummaryCount: {
|
|
1799
1864
|
fontVariantNumeric: "tabular-nums"
|
|
1800
1865
|
},
|
|
1866
|
+
issueSummaryCollapsed: {
|
|
1867
|
+
padding: "0 9px 8px 26px",
|
|
1868
|
+
color: "var(--sd-fg-muted)",
|
|
1869
|
+
fontSize: 11
|
|
1870
|
+
},
|
|
1801
1871
|
issueSummaryList: {
|
|
1802
1872
|
display: "grid",
|
|
1803
1873
|
gap: 1,
|
|
@@ -1889,7 +1959,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1889
1959
|
alignItems: "center",
|
|
1890
1960
|
justifyContent: "space-between",
|
|
1891
1961
|
padding: "4px 6px 3px",
|
|
1892
|
-
...
|
|
1962
|
+
...ye
|
|
1893
1963
|
},
|
|
1894
1964
|
queryGroupCount: {
|
|
1895
1965
|
color: "var(--sd-fg-subtle)",
|
|
@@ -1952,7 +2022,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
1952
2022
|
borderRadius: 3,
|
|
1953
2023
|
background: "var(--sd-bg-accent)",
|
|
1954
2024
|
color: "var(--sd-fg-muted)",
|
|
1955
|
-
fontFamily:
|
|
2025
|
+
fontFamily: _,
|
|
1956
2026
|
fontSize: 9,
|
|
1957
2027
|
fontWeight: 600,
|
|
1958
2028
|
textTransform: "uppercase",
|
|
@@ -2030,7 +2100,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2030
2100
|
borderRadius: 3,
|
|
2031
2101
|
background: "var(--sd-bg-accent)",
|
|
2032
2102
|
color: "var(--sd-fg-muted)",
|
|
2033
|
-
fontFamily:
|
|
2103
|
+
fontFamily: _,
|
|
2034
2104
|
fontSize: 10,
|
|
2035
2105
|
fontWeight: 600,
|
|
2036
2106
|
textTransform: "uppercase",
|
|
@@ -2071,7 +2141,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2071
2141
|
color: "var(--sd-fg)"
|
|
2072
2142
|
},
|
|
2073
2143
|
sourcePillLabel: {
|
|
2074
|
-
fontFamily:
|
|
2144
|
+
fontFamily: _,
|
|
2075
2145
|
fontSize: 11,
|
|
2076
2146
|
color: "var(--sd-fg)"
|
|
2077
2147
|
},
|
|
@@ -2083,7 +2153,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2083
2153
|
borderRadius: 3,
|
|
2084
2154
|
background: "var(--sd-bg-accent)",
|
|
2085
2155
|
color: "var(--sd-fg-subtle)",
|
|
2086
|
-
fontFamily:
|
|
2156
|
+
fontFamily: _,
|
|
2087
2157
|
fontSize: 9,
|
|
2088
2158
|
textTransform: "uppercase",
|
|
2089
2159
|
letterSpacing: "0.06em"
|
|
@@ -2115,7 +2185,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2115
2185
|
borderWidth: 1,
|
|
2116
2186
|
borderStyle: "solid",
|
|
2117
2187
|
borderRadius: 4,
|
|
2118
|
-
fontFamily:
|
|
2188
|
+
fontFamily: _,
|
|
2119
2189
|
fontSize: 11,
|
|
2120
2190
|
fontWeight: 700,
|
|
2121
2191
|
lineHeight: 1
|
|
@@ -2128,7 +2198,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2128
2198
|
borderRadius: 3,
|
|
2129
2199
|
background: "var(--sd-bg-accent)",
|
|
2130
2200
|
color: "var(--sd-fg)",
|
|
2131
|
-
fontFamily:
|
|
2201
|
+
fontFamily: _,
|
|
2132
2202
|
fontSize: 10,
|
|
2133
2203
|
fontWeight: 600,
|
|
2134
2204
|
letterSpacing: "0.04em"
|
|
@@ -2145,7 +2215,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2145
2215
|
},
|
|
2146
2216
|
fieldChipMeta: {
|
|
2147
2217
|
flex: "0 0 auto",
|
|
2148
|
-
fontFamily:
|
|
2218
|
+
fontFamily: _,
|
|
2149
2219
|
fontSize: 10,
|
|
2150
2220
|
color: "var(--sd-fg-subtle)"
|
|
2151
2221
|
},
|
|
@@ -2165,7 +2235,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2165
2235
|
},
|
|
2166
2236
|
disclosureSummary: {
|
|
2167
2237
|
cursor: "pointer",
|
|
2168
|
-
...
|
|
2238
|
+
...ye
|
|
2169
2239
|
},
|
|
2170
2240
|
disclosureBody: {
|
|
2171
2241
|
marginTop: 8
|
|
@@ -2321,7 +2391,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2321
2391
|
textOverflow: "ellipsis",
|
|
2322
2392
|
whiteSpace: "nowrap",
|
|
2323
2393
|
color: "var(--sd-fg)",
|
|
2324
|
-
fontFamily:
|
|
2394
|
+
fontFamily: _,
|
|
2325
2395
|
fontSize: 11,
|
|
2326
2396
|
fontWeight: 600
|
|
2327
2397
|
},
|
|
@@ -2334,7 +2404,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2334
2404
|
borderRadius: 3,
|
|
2335
2405
|
background: "var(--sd-bg-accent)",
|
|
2336
2406
|
color: "var(--sd-fg-muted)",
|
|
2337
|
-
fontFamily:
|
|
2407
|
+
fontFamily: _,
|
|
2338
2408
|
fontSize: 10,
|
|
2339
2409
|
textTransform: "uppercase",
|
|
2340
2410
|
letterSpacing: "0.06em"
|
|
@@ -2393,7 +2463,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2393
2463
|
gap: 5
|
|
2394
2464
|
},
|
|
2395
2465
|
codeBlockLabel: {
|
|
2396
|
-
...
|
|
2466
|
+
...ye
|
|
2397
2467
|
},
|
|
2398
2468
|
codeBlock: {
|
|
2399
2469
|
maxHeight: 260,
|
|
@@ -2404,7 +2474,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2404
2474
|
borderRadius: 5,
|
|
2405
2475
|
background: "var(--sd-bg-muted)",
|
|
2406
2476
|
color: "var(--sd-fg)",
|
|
2407
|
-
fontFamily:
|
|
2477
|
+
fontFamily: _,
|
|
2408
2478
|
fontSize: 11,
|
|
2409
2479
|
lineHeight: 1.5,
|
|
2410
2480
|
whiteSpace: "pre-wrap"
|
|
@@ -2426,7 +2496,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2426
2496
|
borderStyle: "solid",
|
|
2427
2497
|
borderRadius: 5,
|
|
2428
2498
|
background: "var(--sd-bg)",
|
|
2429
|
-
font: `600 11px/1 ${
|
|
2499
|
+
font: `600 11px/1 ${me}`,
|
|
2430
2500
|
cursor: "pointer"
|
|
2431
2501
|
},
|
|
2432
2502
|
inspectButtonText: {
|
|
@@ -2435,7 +2505,7 @@ const pe = 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe
|
|
|
2435
2505
|
whiteSpace: "nowrap"
|
|
2436
2506
|
}
|
|
2437
2507
|
};
|
|
2438
|
-
function
|
|
2508
|
+
function Cr(e) {
|
|
2439
2509
|
return {
|
|
2440
2510
|
...e,
|
|
2441
2511
|
order: [],
|
|
@@ -2443,29 +2513,29 @@ function Sr(e) {
|
|
|
2443
2513
|
sequence: 0
|
|
2444
2514
|
};
|
|
2445
2515
|
}
|
|
2446
|
-
function
|
|
2516
|
+
function dn(e, r) {
|
|
2447
2517
|
if (r.type === "config")
|
|
2448
2518
|
return r.config.enabled ? {
|
|
2449
2519
|
...e,
|
|
2450
2520
|
...r.config
|
|
2451
|
-
} :
|
|
2521
|
+
} : Cr(r.config);
|
|
2452
2522
|
if (!e.enabled)
|
|
2453
2523
|
return e;
|
|
2454
2524
|
switch (r.type) {
|
|
2455
2525
|
case "register":
|
|
2456
|
-
return
|
|
2526
|
+
return fn(ln(e, r.descriptor));
|
|
2457
2527
|
case "unregister":
|
|
2458
|
-
return
|
|
2528
|
+
return un(e, r.traceKey);
|
|
2459
2529
|
case "event":
|
|
2460
|
-
return
|
|
2530
|
+
return cn(e, r);
|
|
2461
2531
|
default:
|
|
2462
2532
|
return e;
|
|
2463
2533
|
}
|
|
2464
2534
|
}
|
|
2465
|
-
function
|
|
2466
|
-
const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i =
|
|
2467
|
-
...t ||
|
|
2468
|
-
...
|
|
2535
|
+
function ln(e, r) {
|
|
2536
|
+
const t = e.entries[r.traceKey], n = t ? e.sequence : e.sequence + 1, i = Qe(), o = {
|
|
2537
|
+
...t || pn(r),
|
|
2538
|
+
...kr(r),
|
|
2469
2539
|
traceKey: r.traceKey,
|
|
2470
2540
|
latestAttempt: (t == null ? void 0 : t.latestAttempt) || { status: "idle" },
|
|
2471
2541
|
recentEvents: (t == null ? void 0 : t.recentEvents) || [],
|
|
@@ -2479,11 +2549,11 @@ function Gt(e, r) {
|
|
|
2479
2549
|
order: t ? e.order : [...e.order, r.traceKey],
|
|
2480
2550
|
entries: {
|
|
2481
2551
|
...e.entries,
|
|
2482
|
-
[r.traceKey]:
|
|
2552
|
+
[r.traceKey]: o
|
|
2483
2553
|
}
|
|
2484
2554
|
};
|
|
2485
2555
|
}
|
|
2486
|
-
function
|
|
2556
|
+
function un(e, r) {
|
|
2487
2557
|
const t = e.entries[r];
|
|
2488
2558
|
return t ? {
|
|
2489
2559
|
...e,
|
|
@@ -2496,11 +2566,11 @@ function Jt(e, r) {
|
|
|
2496
2566
|
}
|
|
2497
2567
|
} : e;
|
|
2498
2568
|
}
|
|
2499
|
-
function
|
|
2569
|
+
function cn(e, r) {
|
|
2500
2570
|
const t = e.entries[r.traceKey];
|
|
2501
2571
|
if (!t)
|
|
2502
2572
|
return e;
|
|
2503
|
-
const n =
|
|
2573
|
+
const n = Qe(), i = [
|
|
2504
2574
|
...t.recentEvents,
|
|
2505
2575
|
r.event
|
|
2506
2576
|
].slice(-e.maxEventsPerQuery);
|
|
@@ -2520,10 +2590,10 @@ function Yt(e, r) {
|
|
|
2520
2590
|
}
|
|
2521
2591
|
};
|
|
2522
2592
|
}
|
|
2523
|
-
function
|
|
2593
|
+
function fn(e) {
|
|
2524
2594
|
if (e.order.length <= e.maxQueries)
|
|
2525
2595
|
return e;
|
|
2526
|
-
const r = e.order.map((i) => e.entries[i]).filter((i) => !!i).sort((i,
|
|
2596
|
+
const r = 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), t = e.order.length - e.maxQueries, n = new Set(
|
|
2527
2597
|
r.slice(0, t).map((i) => i.traceKey)
|
|
2528
2598
|
);
|
|
2529
2599
|
return n.size ? {
|
|
@@ -2534,10 +2604,10 @@ function Xt(e) {
|
|
|
2534
2604
|
)
|
|
2535
2605
|
} : e;
|
|
2536
2606
|
}
|
|
2537
|
-
function
|
|
2538
|
-
const r =
|
|
2607
|
+
function pn(e) {
|
|
2608
|
+
const r = Qe();
|
|
2539
2609
|
return {
|
|
2540
|
-
...
|
|
2610
|
+
...kr(e),
|
|
2541
2611
|
traceKey: e.traceKey,
|
|
2542
2612
|
latestAttempt: { status: "idle" },
|
|
2543
2613
|
recentEvents: [],
|
|
@@ -2546,14 +2616,14 @@ function Zt(e) {
|
|
|
2546
2616
|
lastEventAt: r
|
|
2547
2617
|
};
|
|
2548
2618
|
}
|
|
2549
|
-
function
|
|
2619
|
+
function kr(e) {
|
|
2550
2620
|
var n;
|
|
2551
|
-
const r =
|
|
2621
|
+
const r = An(e.spec), t = En(
|
|
2552
2622
|
e.spec,
|
|
2553
2623
|
e.activeInputs
|
|
2554
2624
|
);
|
|
2555
2625
|
return {
|
|
2556
|
-
traceId:
|
|
2626
|
+
traceId: Lr(e.traceKey),
|
|
2557
2627
|
viewId: e.viewId,
|
|
2558
2628
|
viewTitle: e.viewTitle,
|
|
2559
2629
|
visualType: e.visualType,
|
|
@@ -2562,92 +2632,98 @@ function wr(e) {
|
|
|
2562
2632
|
queryLabel: e.queryLabel,
|
|
2563
2633
|
queryKind: e.queryKind,
|
|
2564
2634
|
builder: e.builder,
|
|
2565
|
-
sourceRefs:
|
|
2635
|
+
sourceRefs: xn(e.intent),
|
|
2566
2636
|
sourceHints: (n = e.sourceHints) != null && n.length ? e.sourceHints : void 0,
|
|
2567
2637
|
projectionFieldRefs: r,
|
|
2568
2638
|
inputFieldRefs: t,
|
|
2569
|
-
fieldRefs:
|
|
2639
|
+
fieldRefs: Tn(e.intent),
|
|
2570
2640
|
inputsApplied: (e.activeInputs || []).map((i) => ({
|
|
2571
2641
|
inputId: i.inputId,
|
|
2572
2642
|
fieldRef: i.field,
|
|
2573
2643
|
operator: i.operator,
|
|
2574
|
-
valuePreview:
|
|
2644
|
+
valuePreview: wn(i)
|
|
2575
2645
|
})),
|
|
2576
2646
|
recentEvents: [],
|
|
2577
2647
|
clientWarnings: e.clientWarnings
|
|
2578
2648
|
};
|
|
2579
2649
|
}
|
|
2580
|
-
function
|
|
2650
|
+
function be(e) {
|
|
2581
2651
|
const {
|
|
2582
2652
|
traceKey: r,
|
|
2583
2653
|
mounted: t,
|
|
2584
2654
|
registeredAt: n,
|
|
2585
2655
|
lastEventAt: i,
|
|
2586
|
-
...
|
|
2656
|
+
...o
|
|
2587
2657
|
} = e;
|
|
2588
|
-
return
|
|
2658
|
+
return o;
|
|
2589
2659
|
}
|
|
2590
|
-
function
|
|
2591
|
-
|
|
2660
|
+
function le(e) {
|
|
2661
|
+
if (!e.enabled)
|
|
2662
|
+
return mr;
|
|
2663
|
+
const r = e.order.map((n) => e.entries[n]).filter((n) => !!n).map(be), t = je(r).map(Rt);
|
|
2664
|
+
return {
|
|
2592
2665
|
enabled: !0,
|
|
2593
|
-
queries:
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2666
|
+
queries: r,
|
|
2667
|
+
issues: t,
|
|
2668
|
+
getQuery: (n) => {
|
|
2669
|
+
const i = Object.values(e.entries).find(
|
|
2670
|
+
(o) => o.queryId === n
|
|
2597
2671
|
);
|
|
2598
|
-
return
|
|
2672
|
+
return i ? be(i) : void 0;
|
|
2599
2673
|
},
|
|
2600
|
-
getQueries: (
|
|
2601
|
-
}
|
|
2674
|
+
getQueries: (n) => Object.values(e.entries).filter((i) => i.queryId === n).map(be)
|
|
2675
|
+
};
|
|
2602
2676
|
}
|
|
2603
|
-
function
|
|
2677
|
+
function gn(e) {
|
|
2604
2678
|
return {
|
|
2605
|
-
snapshot: () =>
|
|
2606
|
-
getQuery: (r) =>
|
|
2607
|
-
getQueries: (r) =>
|
|
2679
|
+
snapshot: () => mn(le(e())),
|
|
2680
|
+
getQuery: (r) => nr(le(e()).getQuery(r)),
|
|
2681
|
+
getQueries: (r) => le(e()).getQueries(r).map((t) => nr(t)).filter((t) => !!t),
|
|
2682
|
+
getIssues: () => le(e()).issues
|
|
2608
2683
|
};
|
|
2609
2684
|
}
|
|
2610
|
-
function
|
|
2685
|
+
function mn(e) {
|
|
2611
2686
|
if (!e.enabled)
|
|
2612
2687
|
return e;
|
|
2613
|
-
const r = e.queries.map(
|
|
2688
|
+
const r = e.queries.map(Rr);
|
|
2614
2689
|
return {
|
|
2615
2690
|
enabled: e.enabled,
|
|
2616
2691
|
queries: r,
|
|
2692
|
+
issues: e.issues,
|
|
2617
2693
|
getQuery: (t) => r.find((n) => n.queryId === t),
|
|
2618
2694
|
getQueries: (t) => r.filter((n) => n.queryId === t)
|
|
2619
2695
|
};
|
|
2620
2696
|
}
|
|
2621
|
-
function
|
|
2622
|
-
return e ?
|
|
2697
|
+
function nr(e) {
|
|
2698
|
+
return e ? Rr(e) : void 0;
|
|
2623
2699
|
}
|
|
2624
|
-
function
|
|
2700
|
+
function Rr(e) {
|
|
2625
2701
|
var r;
|
|
2626
2702
|
return (r = e == null ? void 0 : e.latestAttempt) != null && r.executionResult ? {
|
|
2627
2703
|
...e,
|
|
2628
2704
|
latestAttempt: {
|
|
2629
2705
|
...e.latestAttempt,
|
|
2630
|
-
executionResult:
|
|
2706
|
+
executionResult: yn(
|
|
2631
2707
|
e.latestAttempt.executionResult
|
|
2632
2708
|
)
|
|
2633
2709
|
}
|
|
2634
2710
|
} : e;
|
|
2635
2711
|
}
|
|
2636
|
-
function
|
|
2712
|
+
function yn(e) {
|
|
2637
2713
|
const {
|
|
2638
2714
|
compiledQuery: r,
|
|
2639
2715
|
intent: t,
|
|
2640
2716
|
result: n,
|
|
2641
2717
|
...i
|
|
2642
|
-
} = e,
|
|
2718
|
+
} = e, o = hn(
|
|
2643
2719
|
i.metadata
|
|
2644
2720
|
);
|
|
2645
2721
|
return {
|
|
2646
2722
|
...i,
|
|
2647
|
-
...
|
|
2723
|
+
...o ? { metadata: o } : {}
|
|
2648
2724
|
};
|
|
2649
2725
|
}
|
|
2650
|
-
function
|
|
2726
|
+
function hn(e) {
|
|
2651
2727
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
2652
2728
|
return e;
|
|
2653
2729
|
const r = e.dataAppDebug;
|
|
@@ -2659,64 +2735,64 @@ function nn(e) {
|
|
|
2659
2735
|
dataAppDebug: n
|
|
2660
2736
|
};
|
|
2661
2737
|
}
|
|
2662
|
-
function
|
|
2738
|
+
function vn(e) {
|
|
2663
2739
|
return e === void 0 || e === !1 ? {
|
|
2664
2740
|
enabled: !1,
|
|
2665
2741
|
exposeWindowBridge: !1,
|
|
2666
|
-
maxEventsPerQuery:
|
|
2667
|
-
maxQueries:
|
|
2742
|
+
maxEventsPerQuery: Te,
|
|
2743
|
+
maxQueries: Ce
|
|
2668
2744
|
} : e === !0 ? {
|
|
2669
2745
|
enabled: !0,
|
|
2670
2746
|
exposeWindowBridge: !1,
|
|
2671
|
-
maxEventsPerQuery:
|
|
2672
|
-
maxQueries:
|
|
2747
|
+
maxEventsPerQuery: Te,
|
|
2748
|
+
maxQueries: Ce
|
|
2673
2749
|
} : {
|
|
2674
2750
|
enabled: e.enabled !== !1,
|
|
2675
2751
|
exposeWindowBridge: e.exposeWindowBridge === !0,
|
|
2676
|
-
maxEventsPerQuery:
|
|
2752
|
+
maxEventsPerQuery: or(
|
|
2677
2753
|
e.maxEventsPerQuery,
|
|
2678
|
-
|
|
2679
|
-
|
|
2754
|
+
Te,
|
|
2755
|
+
at
|
|
2680
2756
|
),
|
|
2681
|
-
maxQueries:
|
|
2757
|
+
maxQueries: or(
|
|
2682
2758
|
e.maxQueries,
|
|
2683
|
-
|
|
2684
|
-
|
|
2759
|
+
Ce,
|
|
2760
|
+
dt
|
|
2685
2761
|
)
|
|
2686
2762
|
};
|
|
2687
2763
|
}
|
|
2688
|
-
function
|
|
2764
|
+
function bn(e) {
|
|
2689
2765
|
const t = [
|
|
2690
2766
|
e == null ? void 0 : e.sourceHint,
|
|
2691
2767
|
...(e == null ? void 0 : e.sourceHints) || []
|
|
2692
2768
|
].filter((n) => !!n).map((n) => ({
|
|
2693
|
-
file:
|
|
2694
|
-
line:
|
|
2695
|
-
column:
|
|
2696
|
-
exportName:
|
|
2697
|
-
component:
|
|
2698
|
-
note:
|
|
2769
|
+
file: he(n.file),
|
|
2770
|
+
line: ir(n.line),
|
|
2771
|
+
column: ir(n.column),
|
|
2772
|
+
exportName: he(n.exportName),
|
|
2773
|
+
component: he(n.component),
|
|
2774
|
+
note: he(n.note)
|
|
2699
2775
|
})).filter(
|
|
2700
2776
|
(n) => !!(n.file || n.line || n.column || n.exportName || n.component || n.note)
|
|
2701
2777
|
);
|
|
2702
2778
|
return t.length ? t : void 0;
|
|
2703
2779
|
}
|
|
2704
|
-
function
|
|
2780
|
+
function he(e) {
|
|
2705
2781
|
if (typeof e != "string")
|
|
2706
2782
|
return;
|
|
2707
2783
|
const r = e.trim();
|
|
2708
2784
|
return r || void 0;
|
|
2709
2785
|
}
|
|
2710
|
-
function
|
|
2786
|
+
function ir(e) {
|
|
2711
2787
|
return typeof e == "number" && Number.isInteger(e) && e > 0 ? e : void 0;
|
|
2712
2788
|
}
|
|
2713
|
-
function
|
|
2789
|
+
function or(e, r, t) {
|
|
2714
2790
|
return e === void 0 || !Number.isFinite(e) || !Number.isInteger(e) || e <= 0 ? r : Math.min(e, t);
|
|
2715
2791
|
}
|
|
2716
|
-
function
|
|
2792
|
+
function Sn(e) {
|
|
2717
2793
|
return typeof e.id == "string" && e.id.trim() ? e.id : void 0;
|
|
2718
2794
|
}
|
|
2719
|
-
function
|
|
2795
|
+
function In(e) {
|
|
2720
2796
|
switch (e) {
|
|
2721
2797
|
case "metric":
|
|
2722
2798
|
return "semaphor.metric";
|
|
@@ -2731,14 +2807,14 @@ function dn(e) {
|
|
|
2731
2807
|
case "sql":
|
|
2732
2808
|
return "semaphor.sql";
|
|
2733
2809
|
default:
|
|
2734
|
-
return
|
|
2810
|
+
return xe(e);
|
|
2735
2811
|
}
|
|
2736
2812
|
}
|
|
2737
|
-
function
|
|
2813
|
+
function xe(e) {
|
|
2738
2814
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
2739
2815
|
}
|
|
2740
|
-
function
|
|
2741
|
-
if (
|
|
2816
|
+
function wn(e) {
|
|
2817
|
+
if (qn(e))
|
|
2742
2818
|
return;
|
|
2743
2819
|
const r = e.value;
|
|
2744
2820
|
if (r !== void 0) {
|
|
@@ -2748,17 +2824,17 @@ function ln(e) {
|
|
|
2748
2824
|
).map((n) => String(n));
|
|
2749
2825
|
if (t.length === r.length && t.length > 0) {
|
|
2750
2826
|
const n = t.slice(0, 3).join(", "), i = t.length > 3 ? `, +${t.length - 3} more` : "";
|
|
2751
|
-
return
|
|
2827
|
+
return sr(`${n}${i}`);
|
|
2752
2828
|
}
|
|
2753
2829
|
return `${r.length} selected`;
|
|
2754
2830
|
}
|
|
2755
|
-
return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ?
|
|
2831
|
+
return typeof r == "number" || typeof r == "boolean" ? String(r) : typeof r == "string" ? sr(r) : r && typeof r == "object" ? `object(${Object.keys(r).slice(0, 5).join(",")})` : String(r);
|
|
2756
2832
|
}
|
|
2757
2833
|
}
|
|
2758
|
-
function
|
|
2834
|
+
function sr(e) {
|
|
2759
2835
|
return e.length > 80 ? `${e.slice(0, 77)}...` : e;
|
|
2760
2836
|
}
|
|
2761
|
-
function
|
|
2837
|
+
function qn(e) {
|
|
2762
2838
|
var t;
|
|
2763
2839
|
const r = [
|
|
2764
2840
|
e.inputId,
|
|
@@ -2769,177 +2845,180 @@ function un(e) {
|
|
|
2769
2845
|
(n) => r.includes(n)
|
|
2770
2846
|
);
|
|
2771
2847
|
}
|
|
2772
|
-
function
|
|
2773
|
-
const r =
|
|
2774
|
-
return
|
|
2775
|
-
|
|
2776
|
-
}),
|
|
2848
|
+
function xn(e) {
|
|
2849
|
+
const r = [];
|
|
2850
|
+
return Ie(e, (t) => {
|
|
2851
|
+
Cn(t) && r.push(t);
|
|
2852
|
+
}), Yr(r);
|
|
2777
2853
|
}
|
|
2778
|
-
function
|
|
2854
|
+
function An(e) {
|
|
2779
2855
|
switch (e.queryKind) {
|
|
2780
2856
|
case "metric":
|
|
2781
2857
|
case "analysis":
|
|
2782
|
-
return
|
|
2858
|
+
return X([
|
|
2783
2859
|
...e.measures || [],
|
|
2784
2860
|
e.primaryMeasure,
|
|
2785
2861
|
e.dateField,
|
|
2786
2862
|
...e.dimensions || []
|
|
2787
2863
|
]);
|
|
2788
2864
|
case "records":
|
|
2789
|
-
return
|
|
2865
|
+
return X(e.fields || []);
|
|
2790
2866
|
case "inputOptions":
|
|
2791
|
-
return
|
|
2867
|
+
return X([
|
|
2792
2868
|
e.labelField,
|
|
2793
2869
|
e.valueField,
|
|
2794
2870
|
e.searchField,
|
|
2795
2871
|
...e.disambiguationFields || []
|
|
2796
2872
|
]);
|
|
2797
2873
|
case "sql":
|
|
2798
|
-
return
|
|
2874
|
+
return X(e.fields || []);
|
|
2799
2875
|
case "matrix":
|
|
2800
|
-
return
|
|
2801
|
-
...(e.rows || []).map(
|
|
2802
|
-
...(e.columns || []).map(
|
|
2803
|
-
...(e.values || []).map(
|
|
2876
|
+
return X([
|
|
2877
|
+
...(e.rows || []).map(Le),
|
|
2878
|
+
...(e.columns || []).map(Le),
|
|
2879
|
+
...(e.values || []).map(Le)
|
|
2804
2880
|
]);
|
|
2805
2881
|
default:
|
|
2806
|
-
return
|
|
2882
|
+
return xe(e);
|
|
2807
2883
|
}
|
|
2808
2884
|
}
|
|
2809
|
-
function
|
|
2885
|
+
function En(e, r) {
|
|
2810
2886
|
const t = [
|
|
2811
|
-
...(e.inputs || []).map(
|
|
2887
|
+
...(e.inputs || []).map(Dr),
|
|
2812
2888
|
...(r || []).map((n) => n.field)
|
|
2813
2889
|
];
|
|
2814
|
-
return
|
|
2890
|
+
return X(t);
|
|
2815
2891
|
}
|
|
2816
|
-
function
|
|
2892
|
+
function X(e) {
|
|
2817
2893
|
const r = /* @__PURE__ */ new Map();
|
|
2818
2894
|
return e.forEach((t) => {
|
|
2819
|
-
t &&
|
|
2895
|
+
t && fe(t) && r.set(Pe(t), t);
|
|
2820
2896
|
}), [...r.values()];
|
|
2821
2897
|
}
|
|
2822
|
-
function
|
|
2898
|
+
function Dr(e) {
|
|
2823
2899
|
if (!e || typeof e != "object")
|
|
2824
2900
|
return;
|
|
2825
2901
|
const r = e.toAnalyticsInput;
|
|
2826
2902
|
if (typeof r == "function") {
|
|
2827
2903
|
const n = r.call(e);
|
|
2828
|
-
return
|
|
2904
|
+
return Dr(n);
|
|
2829
2905
|
}
|
|
2830
2906
|
const t = e.field;
|
|
2831
|
-
return
|
|
2907
|
+
return fe(t) ? t : void 0;
|
|
2832
2908
|
}
|
|
2833
|
-
function
|
|
2834
|
-
if (
|
|
2909
|
+
function Le(e) {
|
|
2910
|
+
if (fe(e))
|
|
2835
2911
|
return e;
|
|
2836
2912
|
if (!e || typeof e != "object")
|
|
2837
2913
|
return;
|
|
2838
2914
|
const r = e.field;
|
|
2839
|
-
return
|
|
2915
|
+
return fe(r) ? r : void 0;
|
|
2840
2916
|
}
|
|
2841
|
-
function
|
|
2917
|
+
function Tn(e) {
|
|
2842
2918
|
const r = /* @__PURE__ */ new Map();
|
|
2843
|
-
return
|
|
2844
|
-
|
|
2919
|
+
return Ie(e, (t) => {
|
|
2920
|
+
fe(t) && r.set(Pe(t), t);
|
|
2845
2921
|
}), [...r.values()];
|
|
2846
2922
|
}
|
|
2847
|
-
function
|
|
2923
|
+
function Ie(e, r) {
|
|
2848
2924
|
if (!(!e || typeof e != "object")) {
|
|
2849
2925
|
if (r(e), Array.isArray(e)) {
|
|
2850
|
-
e.forEach((t) =>
|
|
2926
|
+
e.forEach((t) => Ie(t, r));
|
|
2851
2927
|
return;
|
|
2852
2928
|
}
|
|
2853
2929
|
Object.values(e).forEach(
|
|
2854
|
-
(t) =>
|
|
2930
|
+
(t) => Ie(t, r)
|
|
2855
2931
|
);
|
|
2856
2932
|
}
|
|
2857
2933
|
}
|
|
2858
|
-
function
|
|
2934
|
+
function Cn(e) {
|
|
2859
2935
|
if (!e || typeof e != "object")
|
|
2860
2936
|
return !1;
|
|
2861
2937
|
const r = e;
|
|
2862
2938
|
return r.kind === "semantic" ? typeof r.domainId == "string" && typeof r.datasetName == "string" : r.kind === "physical" ? typeof r.connectionId == "string" && typeof r.tableName == "string" : r.kind === "sql" ? typeof r.connectionId == "string" : !1;
|
|
2863
2939
|
}
|
|
2864
|
-
function
|
|
2940
|
+
function fe(e) {
|
|
2865
2941
|
if (!e || typeof e != "object")
|
|
2866
2942
|
return !1;
|
|
2867
2943
|
const r = e;
|
|
2868
2944
|
return typeof r.name == "string" && (r.source !== void 0 || r.role !== void 0 || r.dataType !== void 0 || r.aggregate !== void 0);
|
|
2869
2945
|
}
|
|
2870
|
-
function
|
|
2871
|
-
return e.kind === "semantic" ? [
|
|
2872
|
-
e.kind,
|
|
2873
|
-
e.domainId,
|
|
2874
|
-
e.datasetId || e.datasetName
|
|
2875
|
-
].join(":") : e.kind === "physical" ? [
|
|
2876
|
-
e.kind,
|
|
2877
|
-
e.connectionId,
|
|
2878
|
-
e.databaseName,
|
|
2879
|
-
e.schemaName,
|
|
2880
|
-
e.tableName
|
|
2881
|
-
].join(":") : [e.kind, e.connectionId].join(":");
|
|
2882
|
-
}
|
|
2883
|
-
function Ke(e) {
|
|
2946
|
+
function Pe(e) {
|
|
2884
2947
|
return [
|
|
2885
2948
|
e.name,
|
|
2886
2949
|
e.role,
|
|
2887
2950
|
e.aggregate,
|
|
2888
|
-
e.source ?
|
|
2951
|
+
e.source ? Jr(e.source) : ""
|
|
2889
2952
|
].join(":");
|
|
2890
2953
|
}
|
|
2891
|
-
function
|
|
2954
|
+
function kn(e) {
|
|
2892
2955
|
const r = e;
|
|
2893
2956
|
return typeof (r == null ? void 0 : r.rowCount) == "number" ? r.rowCount : Array.isArray(r == null ? void 0 : r.records) ? r.records.length : void 0;
|
|
2894
2957
|
}
|
|
2895
|
-
function
|
|
2958
|
+
function Rn(e) {
|
|
2896
2959
|
const r = e;
|
|
2897
2960
|
return Array.isArray(r == null ? void 0 : r.columns) ? r.columns.length : void 0;
|
|
2898
2961
|
}
|
|
2899
|
-
function
|
|
2962
|
+
function ar(e) {
|
|
2900
2963
|
const r = e;
|
|
2901
2964
|
return r == null ? void 0 : r.executionResult;
|
|
2902
2965
|
}
|
|
2903
|
-
function
|
|
2966
|
+
function dr(e) {
|
|
2904
2967
|
const r = e;
|
|
2905
2968
|
return typeof (r == null ? void 0 : r.requestId) == "string" ? r.requestId : void 0;
|
|
2906
2969
|
}
|
|
2907
|
-
function
|
|
2970
|
+
function Lr(e) {
|
|
2908
2971
|
let r = 2166136261;
|
|
2909
2972
|
for (let t = 0; t < e.length; t += 1)
|
|
2910
2973
|
r ^= e.charCodeAt(t), r = Math.imul(r, 16777619);
|
|
2911
2974
|
return (r >>> 0).toString(36);
|
|
2912
2975
|
}
|
|
2913
|
-
function
|
|
2976
|
+
function ve() {
|
|
2914
2977
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
2915
2978
|
}
|
|
2916
|
-
function
|
|
2979
|
+
function Qe() {
|
|
2917
2980
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
2918
2981
|
}
|
|
2919
|
-
const
|
|
2982
|
+
const Dn = [
|
|
2983
|
+
"primary",
|
|
2984
|
+
"comparisons",
|
|
2985
|
+
"contributors",
|
|
2986
|
+
"segments",
|
|
2987
|
+
"periodChanges",
|
|
2920
2988
|
"records",
|
|
2921
2989
|
"changes",
|
|
2922
2990
|
"drivers",
|
|
2991
|
+
"absoluteDeltaDrivers",
|
|
2923
2992
|
"largestNegativeChanges",
|
|
2924
2993
|
"largestPositiveChanges",
|
|
2925
2994
|
"largestNegativeDrivers",
|
|
2926
2995
|
"largestPositiveDrivers"
|
|
2927
|
-
],
|
|
2996
|
+
], Ln = [
|
|
2997
|
+
"primary",
|
|
2928
2998
|
"records",
|
|
2999
|
+
"periodChanges",
|
|
2929
3000
|
"changes",
|
|
3001
|
+
"comparisons",
|
|
3002
|
+
"contributors",
|
|
3003
|
+
"segments",
|
|
2930
3004
|
"drivers",
|
|
3005
|
+
"absoluteDeltaDrivers",
|
|
2931
3006
|
"largestNegativeChanges",
|
|
2932
3007
|
"largestPositiveChanges",
|
|
2933
3008
|
"largestNegativeDrivers",
|
|
2934
3009
|
"largestPositiveDrivers"
|
|
2935
3010
|
];
|
|
2936
|
-
function
|
|
3011
|
+
function Or(e) {
|
|
2937
3012
|
if (!e)
|
|
2938
3013
|
return {};
|
|
2939
|
-
const r =
|
|
3014
|
+
const r = _n(e.executionResult), t = On(e, r), n = Kn(t), i = Br(
|
|
3015
|
+
Ue(e.analysisWarnings),
|
|
3016
|
+
zn(t)
|
|
3017
|
+
);
|
|
2940
3018
|
return {
|
|
2941
3019
|
...e,
|
|
2942
3020
|
...Object.keys(t).length ? { resultSets: t } : {},
|
|
3021
|
+
...i.length ? { analysisWarnings: i } : {},
|
|
2943
3022
|
...n ? {
|
|
2944
3023
|
columns: n.columns,
|
|
2945
3024
|
records: n.records,
|
|
@@ -2947,84 +3026,121 @@ function Ar(e) {
|
|
|
2947
3026
|
} : {}
|
|
2948
3027
|
};
|
|
2949
3028
|
}
|
|
2950
|
-
function
|
|
2951
|
-
const t =
|
|
2952
|
-
for (const i of
|
|
2953
|
-
if (t[i])
|
|
2954
|
-
t[i] = Er(t[i]);
|
|
3029
|
+
function On(e, r) {
|
|
3030
|
+
const t = Bn(e.resultSets);
|
|
3031
|
+
for (const i of Dn) {
|
|
3032
|
+
if (t[i])
|
|
2955
3033
|
continue;
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
if (!a.length)
|
|
3034
|
+
const o = Nn(e[i]);
|
|
3035
|
+
if (!o.length)
|
|
2959
3036
|
continue;
|
|
2960
|
-
const
|
|
3037
|
+
const u = r.length ? r : Fn(o);
|
|
2961
3038
|
t[i] = {
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
3039
|
+
id: i,
|
|
3040
|
+
role: i,
|
|
3041
|
+
...Ve({
|
|
3042
|
+
records: o,
|
|
3043
|
+
columns: u,
|
|
3044
|
+
resultSetKey: i
|
|
3045
|
+
}),
|
|
3046
|
+
columns: u,
|
|
3047
|
+
rowCount: o.length
|
|
2965
3048
|
};
|
|
2966
3049
|
}
|
|
2967
|
-
const n =
|
|
3050
|
+
const n = Wn(e.executionResult);
|
|
2968
3051
|
return n && n.records.length > 0 && !t.records && (t.records = n), t;
|
|
2969
3052
|
}
|
|
2970
|
-
function
|
|
3053
|
+
function Bn(e) {
|
|
2971
3054
|
return Object.fromEntries(
|
|
2972
3055
|
Object.entries(e || {}).map(([r, t]) => [
|
|
2973
3056
|
r,
|
|
2974
|
-
|
|
3057
|
+
$n(t, r)
|
|
2975
3058
|
])
|
|
2976
3059
|
);
|
|
2977
3060
|
}
|
|
2978
|
-
function
|
|
2979
|
-
var
|
|
3061
|
+
function $n(e, r = e.id || e.role || "resultSet") {
|
|
3062
|
+
var n;
|
|
3063
|
+
const t = Ve({
|
|
3064
|
+
records: e.records || [],
|
|
3065
|
+
columns: e.columns || [],
|
|
3066
|
+
resultSetKey: r
|
|
3067
|
+
});
|
|
2980
3068
|
return {
|
|
2981
3069
|
...e,
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
3070
|
+
...t,
|
|
3071
|
+
...e.warnings || t.warnings ? {
|
|
3072
|
+
warnings: Br(
|
|
3073
|
+
Ue(e.warnings),
|
|
3074
|
+
t.warnings
|
|
3075
|
+
)
|
|
3076
|
+
} : {},
|
|
3077
|
+
rowCount: e.rowCount ?? ((n = e.records) == null ? void 0 : n.length) ?? 0
|
|
2987
3078
|
};
|
|
2988
3079
|
}
|
|
2989
|
-
function
|
|
3080
|
+
function Kn(e) {
|
|
2990
3081
|
var r;
|
|
2991
|
-
for (const t of
|
|
3082
|
+
for (const t of Ln)
|
|
2992
3083
|
if ((r = e[t]) != null && r.records.length)
|
|
2993
3084
|
return e[t];
|
|
2994
3085
|
return Object.values(e).find((t) => t.records.length) || Object.values(e)[0];
|
|
2995
3086
|
}
|
|
2996
|
-
function
|
|
3087
|
+
function Wn(e) {
|
|
2997
3088
|
const r = e == null ? void 0 : e.result;
|
|
2998
3089
|
if (!(!r || r.kind !== "records" && r.kind !== "sql"))
|
|
2999
3090
|
return {
|
|
3000
|
-
|
|
3091
|
+
id: "records",
|
|
3092
|
+
role: "records",
|
|
3093
|
+
...Ve({
|
|
3094
|
+
records: r.records,
|
|
3095
|
+
columns: r.columns,
|
|
3096
|
+
resultSetKey: "records"
|
|
3097
|
+
}),
|
|
3001
3098
|
columns: r.columns,
|
|
3002
3099
|
rowCount: r.rowCount ?? r.records.length
|
|
3003
3100
|
};
|
|
3004
3101
|
}
|
|
3005
|
-
function
|
|
3102
|
+
function _n(e) {
|
|
3006
3103
|
const r = e == null ? void 0 : e.result;
|
|
3007
3104
|
return !r || r.kind !== "records" && r.kind !== "sql" ? [] : r.columns;
|
|
3008
3105
|
}
|
|
3009
|
-
function
|
|
3106
|
+
function Nn(e) {
|
|
3010
3107
|
return Array.isArray(e) ? e.filter(
|
|
3011
3108
|
(r) => !!(r && typeof r == "object" && !Array.isArray(r))
|
|
3012
3109
|
) : [];
|
|
3013
3110
|
}
|
|
3014
|
-
function
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3111
|
+
function Ve({
|
|
3112
|
+
records: e,
|
|
3113
|
+
columns: r,
|
|
3114
|
+
resultSetKey: t
|
|
3115
|
+
}) {
|
|
3116
|
+
if (!r.length)
|
|
3117
|
+
return { records: e };
|
|
3118
|
+
const n = [];
|
|
3119
|
+
return {
|
|
3120
|
+
records: e.map((o, u) => {
|
|
3121
|
+
const f = {};
|
|
3122
|
+
return r.forEach((d) => {
|
|
3123
|
+
if (Object.prototype.hasOwnProperty.call(o, d.key)) {
|
|
3124
|
+
f[d.key] = o[d.key];
|
|
3125
|
+
return;
|
|
3126
|
+
}
|
|
3127
|
+
n.push({
|
|
3128
|
+
code: "missing_analysis_result_key",
|
|
3129
|
+
severity: "warning",
|
|
3130
|
+
resultSetKey: t,
|
|
3131
|
+
rowIndex: u,
|
|
3132
|
+
columnKey: d.key,
|
|
3133
|
+
...d.name ? { columnName: d.name } : {},
|
|
3134
|
+
...d.label ? { columnLabel: d.label } : {},
|
|
3135
|
+
availableKeys: Object.keys(o),
|
|
3136
|
+
message: `Analysis result set "${t}" row ${u} is missing column key "${d.key}". Rows must expose values by column.key; labels and column names are display metadata only.`
|
|
3137
|
+
});
|
|
3138
|
+
}), f;
|
|
3139
|
+
}),
|
|
3140
|
+
...n.length ? { warnings: n } : {}
|
|
3141
|
+
};
|
|
3026
3142
|
}
|
|
3027
|
-
function
|
|
3143
|
+
function Fn(e) {
|
|
3028
3144
|
return Array.from(
|
|
3029
3145
|
new Set(e.flatMap((t) => Object.keys(t)))
|
|
3030
3146
|
).map((t) => ({
|
|
@@ -3033,338 +3149,329 @@ function An(e) {
|
|
|
3033
3149
|
label: t
|
|
3034
3150
|
}));
|
|
3035
3151
|
}
|
|
3036
|
-
function
|
|
3037
|
-
|
|
3038
|
-
r.
|
|
3039
|
-
|
|
3040
|
-
...r.fallbackNames || []
|
|
3041
|
-
].filter((n) => !!n);
|
|
3042
|
-
for (const n of t)
|
|
3043
|
-
if (Object.prototype.hasOwnProperty.call(e, n))
|
|
3044
|
-
return e[n];
|
|
3045
|
-
}
|
|
3046
|
-
function Rn() {
|
|
3047
|
-
return {
|
|
3048
|
-
executeAnalysis: (e, r, t) => J(
|
|
3049
|
-
e,
|
|
3050
|
-
r,
|
|
3051
|
-
t ?? {}
|
|
3052
|
-
).then(Ar),
|
|
3053
|
-
executeMetric: (e, r) => J(e, r),
|
|
3054
|
-
executeRecords: (e, r) => J(e, r),
|
|
3055
|
-
executeInputOptions: (e, r) => J(e, r),
|
|
3056
|
-
executeSql: (e, r) => J(e, r),
|
|
3057
|
-
executeMatrix: (e, r) => J(e, r)
|
|
3058
|
-
};
|
|
3059
|
-
}
|
|
3060
|
-
async function J(e, r, t) {
|
|
3061
|
-
if (!r.token)
|
|
3062
|
-
throw new Error(
|
|
3063
|
-
"SemaphorDataAppProvider needs a token to execute queries."
|
|
3064
|
-
);
|
|
3065
|
-
const n = Wn(r), i = Ln(e, n);
|
|
3066
|
-
let a;
|
|
3067
|
-
try {
|
|
3068
|
-
a = await fetch(n, {
|
|
3069
|
-
method: "POST",
|
|
3070
|
-
headers: {
|
|
3071
|
-
"Content-Type": "application/json",
|
|
3072
|
-
Authorization: `Bearer ${r.token}`
|
|
3073
|
-
},
|
|
3074
|
-
body: JSON.stringify({
|
|
3075
|
-
intent: e,
|
|
3076
|
-
activeInputs: r.activeInputs,
|
|
3077
|
-
...t ? { analysisOptions: t } : {},
|
|
3078
|
-
resultShape: e.kind,
|
|
3079
|
-
...kn(r) ? { debug: { responseDetail: "debug" } } : {}
|
|
3080
|
-
})
|
|
3081
|
-
});
|
|
3082
|
-
} catch (p) {
|
|
3083
|
-
throw new Error(
|
|
3084
|
-
`${i}: ${p instanceof Error ? p.message : String(p)}`
|
|
3085
|
-
);
|
|
3086
|
-
}
|
|
3087
|
-
const l = await Bn(a);
|
|
3088
|
-
if (!a.ok || l.error)
|
|
3089
|
-
throw Cn(
|
|
3090
|
-
`${i}: ${l.error || `Semaphor Data App execution failed with status ${a.status}.`}`,
|
|
3091
|
-
l
|
|
3092
|
-
);
|
|
3093
|
-
return l;
|
|
3094
|
-
}
|
|
3095
|
-
function Cn(e, r) {
|
|
3096
|
-
const t = new Error(e);
|
|
3097
|
-
return r.requestId && (t.requestId = r.requestId), r.details !== void 0 && (t.details = r.details), r.executionResult !== void 0 && (t.executionResult = r.executionResult), t;
|
|
3098
|
-
}
|
|
3099
|
-
function kn(e) {
|
|
3100
|
-
const r = e.debug;
|
|
3101
|
-
return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
|
|
3102
|
-
}
|
|
3103
|
-
function Ln(e, r) {
|
|
3104
|
-
return [
|
|
3105
|
-
`Semaphor ${e.kind} query`,
|
|
3106
|
-
e.id ? `id=${e.id}` : void 0,
|
|
3107
|
-
e.label ? `label=${e.label}` : void 0,
|
|
3108
|
-
Dn(e),
|
|
3109
|
-
`endpoint=${On(r)}`
|
|
3110
|
-
].filter((t) => !!t).join(" ");
|
|
3111
|
-
}
|
|
3112
|
-
function Dn(e) {
|
|
3113
|
-
const r = "source" in e ? e.source : void 0;
|
|
3114
|
-
if (!(!r || typeof r != "object")) {
|
|
3115
|
-
if (r.kind === "semantic")
|
|
3116
|
-
return `source=${[
|
|
3117
|
-
r.domainId,
|
|
3118
|
-
r.datasetId || r.datasetName
|
|
3119
|
-
].filter(Boolean).join("/")}`;
|
|
3120
|
-
if (r.kind === "physical")
|
|
3121
|
-
return `source=${[
|
|
3122
|
-
r.connectionId,
|
|
3123
|
-
r.databaseName,
|
|
3124
|
-
r.schemaName,
|
|
3125
|
-
r.tableName
|
|
3126
|
-
].filter(Boolean).join("/")}`;
|
|
3127
|
-
if (r.kind === "sql")
|
|
3128
|
-
return r.connectionId ? `source=${r.connectionId}` : void 0;
|
|
3129
|
-
}
|
|
3130
|
-
}
|
|
3131
|
-
function On(e) {
|
|
3132
|
-
if (!e)
|
|
3133
|
-
return "/api/v1/data-app/execute";
|
|
3134
|
-
try {
|
|
3135
|
-
return new URL(e, "http://localhost").pathname;
|
|
3136
|
-
} catch {
|
|
3137
|
-
return e;
|
|
3138
|
-
}
|
|
3139
|
-
}
|
|
3140
|
-
async function Bn(e) {
|
|
3141
|
-
const r = await e.text().catch(() => "");
|
|
3142
|
-
if (!r.trim())
|
|
3143
|
-
return e.ok ? {
|
|
3144
|
-
error: "Semaphor Data App execution returned an empty response."
|
|
3145
|
-
} : {};
|
|
3146
|
-
try {
|
|
3147
|
-
return JSON.parse(r);
|
|
3148
|
-
} catch {
|
|
3149
|
-
return e.ok ? {
|
|
3150
|
-
error: "Semaphor Data App execution returned invalid JSON.",
|
|
3151
|
-
details: r
|
|
3152
|
-
} : {
|
|
3153
|
-
error: $n(e, r),
|
|
3154
|
-
details: r
|
|
3155
|
-
};
|
|
3156
|
-
}
|
|
3152
|
+
function zn(e) {
|
|
3153
|
+
return Object.values(e).flatMap(
|
|
3154
|
+
(r) => Ue(r.warnings)
|
|
3155
|
+
);
|
|
3157
3156
|
}
|
|
3158
|
-
function
|
|
3159
|
-
|
|
3160
|
-
return n ? `Semaphor Data App execution failed with status ${e.status}${t}: ${n.slice(0, 240)}` : `Semaphor Data App execution failed with status ${e.status}${t}.`;
|
|
3157
|
+
function Ue(e) {
|
|
3158
|
+
return Array.isArray(e) ? e.filter(Mn) : [];
|
|
3161
3159
|
}
|
|
3162
|
-
function
|
|
3163
|
-
|
|
3164
|
-
return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
3160
|
+
function Mn(e) {
|
|
3161
|
+
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
3165
3162
|
}
|
|
3166
|
-
function
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
try {
|
|
3172
|
-
return Qr(e.token).apiServiceUrl || "";
|
|
3173
|
-
} catch {
|
|
3174
|
-
return "";
|
|
3163
|
+
function Br(...e) {
|
|
3164
|
+
const r = /* @__PURE__ */ new Set(), t = [];
|
|
3165
|
+
for (const n of e.flatMap((i) => i || [])) {
|
|
3166
|
+
const i = Hn(n);
|
|
3167
|
+
r.has(i) || (r.add(i), t.push(n));
|
|
3175
3168
|
}
|
|
3169
|
+
return t;
|
|
3176
3170
|
}
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3171
|
+
function Hn(e) {
|
|
3172
|
+
return e.code === "missing_analysis_result_key" ? [
|
|
3173
|
+
e.code,
|
|
3174
|
+
e.resultSetKey,
|
|
3175
|
+
e.rowIndex,
|
|
3176
|
+
e.columnKey
|
|
3177
|
+
].join(":") : Ne(e);
|
|
3178
|
+
}
|
|
3179
|
+
function Ne(e) {
|
|
3180
|
+
if (!e || typeof e != "object")
|
|
3181
|
+
return JSON.stringify(e);
|
|
3182
|
+
if (Array.isArray(e))
|
|
3183
|
+
return `[${e.map((t) => Ne(t)).join(",")}]`;
|
|
3184
|
+
const r = e;
|
|
3185
|
+
return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${Ne(r[t])}`).join(",")}}`;
|
|
3184
3186
|
}
|
|
3185
|
-
const
|
|
3186
|
-
function
|
|
3187
|
-
const r = Z(e.inputs), t =
|
|
3187
|
+
const Oe = { value: null }, Be = {}, jn = { records: [] }, $e = { options: [] }, Pn = { records: [] }, Ke = {};
|
|
3188
|
+
function Qn(e) {
|
|
3189
|
+
const r = Z(e.inputs), t = Pr(e);
|
|
3188
3190
|
try {
|
|
3189
|
-
const n =
|
|
3191
|
+
const n = Qr(e), i = re(n, "analysis");
|
|
3190
3192
|
return i ? {
|
|
3191
3193
|
error: i,
|
|
3192
3194
|
activeInputs: r,
|
|
3193
3195
|
analysisOptions: t,
|
|
3194
|
-
queryKey:
|
|
3196
|
+
queryKey: x(
|
|
3195
3197
|
void 0,
|
|
3196
3198
|
r,
|
|
3197
3199
|
i,
|
|
3198
3200
|
t
|
|
3199
3201
|
),
|
|
3200
|
-
idleData:
|
|
3202
|
+
idleData: Be
|
|
3201
3203
|
} : {
|
|
3202
3204
|
intent: n,
|
|
3203
3205
|
error: null,
|
|
3204
3206
|
activeInputs: r,
|
|
3205
3207
|
analysisOptions: t,
|
|
3206
|
-
queryKey:
|
|
3207
|
-
idleData:
|
|
3208
|
+
queryKey: x(n, r, void 0, t),
|
|
3209
|
+
idleData: Be
|
|
3208
3210
|
};
|
|
3209
3211
|
} catch (n) {
|
|
3210
|
-
const i =
|
|
3212
|
+
const i = ee(n, "analysis");
|
|
3211
3213
|
return {
|
|
3212
3214
|
error: i,
|
|
3213
3215
|
activeInputs: r,
|
|
3214
3216
|
analysisOptions: t,
|
|
3215
|
-
queryKey:
|
|
3217
|
+
queryKey: x(
|
|
3216
3218
|
void 0,
|
|
3217
3219
|
r,
|
|
3218
3220
|
i,
|
|
3219
3221
|
t
|
|
3220
3222
|
),
|
|
3221
|
-
idleData:
|
|
3223
|
+
idleData: Be
|
|
3222
3224
|
};
|
|
3223
3225
|
}
|
|
3224
3226
|
}
|
|
3225
|
-
function
|
|
3227
|
+
function Vn(e) {
|
|
3226
3228
|
const r = Z(e.inputs);
|
|
3227
3229
|
try {
|
|
3228
|
-
const t =
|
|
3230
|
+
const t = Vr(e), n = re(t);
|
|
3229
3231
|
return n ? {
|
|
3230
3232
|
error: n,
|
|
3231
3233
|
activeInputs: r,
|
|
3232
|
-
queryKey:
|
|
3233
|
-
idleData:
|
|
3234
|
+
queryKey: x(void 0, r, n),
|
|
3235
|
+
idleData: Oe
|
|
3234
3236
|
} : {
|
|
3235
3237
|
intent: t,
|
|
3236
3238
|
error: null,
|
|
3237
3239
|
activeInputs: r,
|
|
3238
|
-
queryKey:
|
|
3239
|
-
idleData:
|
|
3240
|
+
queryKey: x(t, r),
|
|
3241
|
+
idleData: Oe
|
|
3240
3242
|
};
|
|
3241
3243
|
} catch (t) {
|
|
3242
|
-
const n =
|
|
3244
|
+
const n = ee(t, "metric");
|
|
3243
3245
|
return {
|
|
3244
3246
|
error: n,
|
|
3245
3247
|
activeInputs: r,
|
|
3246
|
-
queryKey:
|
|
3247
|
-
idleData:
|
|
3248
|
+
queryKey: x(void 0, r, n),
|
|
3249
|
+
idleData: Oe
|
|
3248
3250
|
};
|
|
3249
3251
|
}
|
|
3250
3252
|
}
|
|
3251
|
-
function
|
|
3252
|
-
const r = Z(e.inputs), t =
|
|
3253
|
+
function Un(e) {
|
|
3254
|
+
const r = Z(e.inputs), t = jn;
|
|
3253
3255
|
try {
|
|
3254
|
-
const n =
|
|
3256
|
+
const n = jr(e), i = re(n);
|
|
3255
3257
|
return i ? {
|
|
3256
3258
|
error: i,
|
|
3257
3259
|
activeInputs: r,
|
|
3258
|
-
queryKey:
|
|
3260
|
+
queryKey: x(void 0, r, i),
|
|
3259
3261
|
idleData: t
|
|
3260
3262
|
} : {
|
|
3261
3263
|
intent: n,
|
|
3262
3264
|
error: null,
|
|
3263
3265
|
activeInputs: r,
|
|
3264
|
-
queryKey:
|
|
3266
|
+
queryKey: x(n, r),
|
|
3265
3267
|
idleData: t
|
|
3266
3268
|
};
|
|
3267
3269
|
} catch (n) {
|
|
3268
|
-
const i =
|
|
3270
|
+
const i = ee(n, "records");
|
|
3269
3271
|
return {
|
|
3270
3272
|
error: i,
|
|
3271
3273
|
activeInputs: r,
|
|
3272
|
-
queryKey:
|
|
3274
|
+
queryKey: x(void 0, r, i),
|
|
3273
3275
|
idleData: t
|
|
3274
3276
|
};
|
|
3275
3277
|
}
|
|
3276
3278
|
}
|
|
3277
|
-
function
|
|
3279
|
+
function Gn(e) {
|
|
3278
3280
|
const r = Z(e.inputs);
|
|
3279
3281
|
try {
|
|
3280
|
-
const t =
|
|
3282
|
+
const t = Hr(e), n = re(t);
|
|
3281
3283
|
return n ? {
|
|
3282
3284
|
error: n,
|
|
3283
3285
|
activeInputs: r,
|
|
3284
|
-
queryKey:
|
|
3285
|
-
idleData:
|
|
3286
|
+
queryKey: x(void 0, r, n),
|
|
3287
|
+
idleData: $e
|
|
3286
3288
|
} : {
|
|
3287
3289
|
intent: t,
|
|
3288
3290
|
error: null,
|
|
3289
3291
|
activeInputs: r,
|
|
3290
|
-
queryKey:
|
|
3291
|
-
idleData:
|
|
3292
|
+
queryKey: x(t, r),
|
|
3293
|
+
idleData: $e
|
|
3292
3294
|
};
|
|
3293
3295
|
} catch (t) {
|
|
3294
|
-
const n =
|
|
3296
|
+
const n = ee(t, "inputOptions");
|
|
3295
3297
|
return {
|
|
3296
3298
|
error: n,
|
|
3297
3299
|
activeInputs: r,
|
|
3298
|
-
queryKey:
|
|
3299
|
-
idleData:
|
|
3300
|
+
queryKey: x(void 0, r, n),
|
|
3301
|
+
idleData: $e
|
|
3300
3302
|
};
|
|
3301
3303
|
}
|
|
3302
3304
|
}
|
|
3303
|
-
function
|
|
3304
|
-
const r = Z(e.inputs), t =
|
|
3305
|
+
function Jn(e) {
|
|
3306
|
+
const r = Z(e.inputs), t = Pn;
|
|
3305
3307
|
try {
|
|
3306
|
-
const n =
|
|
3308
|
+
const n = Mr(e), i = re(n);
|
|
3307
3309
|
return i ? {
|
|
3308
3310
|
error: i,
|
|
3309
3311
|
activeInputs: r,
|
|
3310
|
-
queryKey:
|
|
3312
|
+
queryKey: x(void 0, r, i),
|
|
3311
3313
|
idleData: t
|
|
3312
3314
|
} : {
|
|
3313
3315
|
intent: n,
|
|
3314
3316
|
error: null,
|
|
3315
3317
|
activeInputs: r,
|
|
3316
|
-
queryKey:
|
|
3318
|
+
queryKey: x(n, r),
|
|
3317
3319
|
idleData: t
|
|
3318
3320
|
};
|
|
3319
3321
|
} catch (n) {
|
|
3320
|
-
const i =
|
|
3322
|
+
const i = ee(n, "sql");
|
|
3321
3323
|
return {
|
|
3322
3324
|
error: i,
|
|
3323
3325
|
activeInputs: r,
|
|
3324
|
-
queryKey:
|
|
3326
|
+
queryKey: x(void 0, r, i),
|
|
3325
3327
|
idleData: t
|
|
3326
3328
|
};
|
|
3327
3329
|
}
|
|
3328
3330
|
}
|
|
3329
|
-
function
|
|
3331
|
+
function Yn(e) {
|
|
3330
3332
|
const r = Z(e.inputs);
|
|
3331
3333
|
try {
|
|
3332
|
-
const t =
|
|
3334
|
+
const t = zr(e), n = re(t);
|
|
3333
3335
|
return n ? {
|
|
3334
3336
|
error: n,
|
|
3335
3337
|
activeInputs: r,
|
|
3336
|
-
queryKey:
|
|
3337
|
-
idleData:
|
|
3338
|
+
queryKey: x(void 0, r, n),
|
|
3339
|
+
idleData: Ke
|
|
3338
3340
|
} : {
|
|
3339
3341
|
intent: t,
|
|
3340
3342
|
error: null,
|
|
3341
3343
|
activeInputs: r,
|
|
3342
|
-
queryKey:
|
|
3343
|
-
idleData:
|
|
3344
|
+
queryKey: x(t, r),
|
|
3345
|
+
idleData: Ke
|
|
3344
3346
|
};
|
|
3345
3347
|
} catch (t) {
|
|
3346
|
-
const n =
|
|
3348
|
+
const n = ee(t, "matrix");
|
|
3347
3349
|
return {
|
|
3348
3350
|
error: n,
|
|
3349
3351
|
activeInputs: r,
|
|
3350
|
-
queryKey:
|
|
3351
|
-
idleData:
|
|
3352
|
+
queryKey: x(void 0, r, n),
|
|
3353
|
+
idleData: Ke
|
|
3352
3354
|
};
|
|
3353
3355
|
}
|
|
3354
3356
|
}
|
|
3355
|
-
function
|
|
3356
|
-
|
|
3357
|
+
function Fe(e) {
|
|
3358
|
+
var o;
|
|
3359
|
+
if (Xn(e))
|
|
3360
|
+
return e;
|
|
3361
|
+
const r = e instanceof Error ? e : void 0, t = e, n = t == null ? void 0 : t.executionResult, i = Ae(
|
|
3362
|
+
(r == null ? void 0 : r.message) ?? String(e),
|
|
3363
|
+
{
|
|
3364
|
+
requestId: typeof (t == null ? void 0 : t.requestId) == "string" ? t.requestId : void 0,
|
|
3365
|
+
details: t == null ? void 0 : t.details,
|
|
3366
|
+
executionResult: n,
|
|
3367
|
+
validation: (t == null ? void 0 : t.validation) ?? (n == null ? void 0 : n.validation),
|
|
3368
|
+
validationIssues: (t == null ? void 0 : t.validationIssues) ?? ((o = n == null ? void 0 : n.validation) == null ? void 0 : o.errors)
|
|
3369
|
+
}
|
|
3370
|
+
);
|
|
3371
|
+
return i.name = (r == null ? void 0 : r.name) || i.name, i.stack = r == null ? void 0 : r.stack, i;
|
|
3372
|
+
}
|
|
3373
|
+
function ee(e, r) {
|
|
3374
|
+
const t = Fe(e);
|
|
3375
|
+
if (t.executionResult || t.validation)
|
|
3376
|
+
return t;
|
|
3377
|
+
const n = {
|
|
3378
|
+
ok: !1,
|
|
3379
|
+
errors: [
|
|
3380
|
+
{
|
|
3381
|
+
code: "invalid_query_spec",
|
|
3382
|
+
message: t.message,
|
|
3383
|
+
path: "spec"
|
|
3384
|
+
}
|
|
3385
|
+
],
|
|
3386
|
+
warnings: [],
|
|
3387
|
+
repairHints: [
|
|
3388
|
+
{
|
|
3389
|
+
code: "invalid_query_spec",
|
|
3390
|
+
message: t.message,
|
|
3391
|
+
recommendedNextStep: "Update the Data App query spec to satisfy the SDK builder contract."
|
|
3392
|
+
}
|
|
3393
|
+
]
|
|
3394
|
+
}, i = $r(
|
|
3395
|
+
void 0,
|
|
3396
|
+
r,
|
|
3397
|
+
n
|
|
3398
|
+
), o = Ae(t.message, {
|
|
3399
|
+
executionResult: i,
|
|
3400
|
+
validation: n,
|
|
3401
|
+
validationIssues: n.errors
|
|
3402
|
+
});
|
|
3403
|
+
return o.stack = t.stack, o;
|
|
3404
|
+
}
|
|
3405
|
+
function Ae(e, r = {}) {
|
|
3406
|
+
var i, o, u;
|
|
3407
|
+
const t = new Error(e);
|
|
3408
|
+
t.name = "SemaphorDataAppQueryError", t.kind = "data_app_query_error", r.requestId && (t.requestId = r.requestId), r.details !== void 0 && (t.details = r.details), r.executionResult !== void 0 && (t.executionResult = r.executionResult), r.validation !== void 0 && (t.validation = r.validation);
|
|
3409
|
+
const n = r.validationIssues ?? ((i = r.validation) == null ? void 0 : i.errors) ?? ((u = (o = r.executionResult) == null ? void 0 : o.validation) == null ? void 0 : u.errors);
|
|
3410
|
+
return n !== void 0 && (t.validationIssues = n), t;
|
|
3357
3411
|
}
|
|
3358
|
-
function
|
|
3359
|
-
|
|
3360
|
-
|
|
3412
|
+
function Xn(e) {
|
|
3413
|
+
return e instanceof Error && e.kind === "data_app_query_error";
|
|
3414
|
+
}
|
|
3415
|
+
function re(e, r = e.kind) {
|
|
3416
|
+
const t = st(e);
|
|
3417
|
+
if (t.ok)
|
|
3361
3418
|
return null;
|
|
3362
|
-
const
|
|
3363
|
-
(
|
|
3364
|
-
).join("; ")
|
|
3365
|
-
|
|
3419
|
+
const n = t.errors.map(
|
|
3420
|
+
(o) => o.path ? `${o.code} at ${o.path}: ${o.message}` : `${o.code}: ${o.message}`
|
|
3421
|
+
).join("; "), i = $r(
|
|
3422
|
+
e,
|
|
3423
|
+
r,
|
|
3424
|
+
t
|
|
3425
|
+
);
|
|
3426
|
+
return Ae(
|
|
3427
|
+
`Invalid Semaphor analytics intent. ${n}`,
|
|
3428
|
+
{
|
|
3429
|
+
executionResult: i,
|
|
3430
|
+
validation: t,
|
|
3431
|
+
validationIssues: t.errors
|
|
3432
|
+
}
|
|
3433
|
+
);
|
|
3434
|
+
}
|
|
3435
|
+
function $r(e, r, t) {
|
|
3436
|
+
return {
|
|
3437
|
+
...e != null && e.id ? { intentId: e.id } : {},
|
|
3438
|
+
...e ? { intent: e } : {},
|
|
3439
|
+
status: "failed",
|
|
3440
|
+
resultShape: r,
|
|
3441
|
+
validation: t,
|
|
3442
|
+
coverage: {
|
|
3443
|
+
answeredObligations: [],
|
|
3444
|
+
missingObligations: ["query_spec_validation"],
|
|
3445
|
+
warnings: t.warnings
|
|
3446
|
+
},
|
|
3447
|
+
missingFields: t.errors.filter((n) => n.code === "missing_field").flatMap((n) => {
|
|
3448
|
+
var o;
|
|
3449
|
+
const i = n.path || ((o = n.repairHint) == null ? void 0 : o.invalidField);
|
|
3450
|
+
return i ? [i] : [];
|
|
3451
|
+
}),
|
|
3452
|
+
warnings: t.warnings.map((n) => n.message),
|
|
3453
|
+
diagnosticFeedback: {
|
|
3454
|
+
version: 1,
|
|
3455
|
+
status: "blocked",
|
|
3456
|
+
summary: "Data App query spec validation failed.",
|
|
3457
|
+
answered: [],
|
|
3458
|
+
blocked: t.errors.map((n) => {
|
|
3459
|
+
var o, u;
|
|
3460
|
+
const i = {
|
|
3461
|
+
reasonCode: "query_validation_failed",
|
|
3462
|
+
message: n.message
|
|
3463
|
+
};
|
|
3464
|
+
return n.code === "missing_field" && (i.missingFields = [
|
|
3465
|
+
n.path || ((o = n.repairHint) == null ? void 0 : o.invalidField) || n.message
|
|
3466
|
+
]), (u = n.repairHint) != null && u.recommendedNextStep && (i.recommendedNextStep = n.repairHint.recommendedNextStep), i;
|
|
3467
|
+
})
|
|
3468
|
+
},
|
|
3469
|
+
metadata: {
|
|
3470
|
+
validationKind: "data_app_sdk_query_spec"
|
|
3471
|
+
}
|
|
3472
|
+
};
|
|
3366
3473
|
}
|
|
3367
|
-
function
|
|
3474
|
+
function x(e, r, t, n) {
|
|
3368
3475
|
return JSON.stringify({
|
|
3369
3476
|
intent: e,
|
|
3370
3477
|
activeInputs: r,
|
|
@@ -3372,54 +3479,198 @@ function q(e, r, t, n) {
|
|
|
3372
3479
|
error: t == null ? void 0 : t.message
|
|
3373
3480
|
});
|
|
3374
3481
|
}
|
|
3375
|
-
function
|
|
3376
|
-
|
|
3377
|
-
() =>
|
|
3482
|
+
function Zn() {
|
|
3483
|
+
return {
|
|
3484
|
+
executeAnalysis: (e, r, t) => J(
|
|
3485
|
+
e,
|
|
3486
|
+
r,
|
|
3487
|
+
t ?? {}
|
|
3488
|
+
).then(Or),
|
|
3489
|
+
executeMetric: (e, r) => J(e, r),
|
|
3490
|
+
executeRecords: (e, r) => J(e, r),
|
|
3491
|
+
executeInputOptions: (e, r) => J(e, r),
|
|
3492
|
+
executeSql: (e, r) => J(e, r),
|
|
3493
|
+
executeMatrix: (e, r) => J(e, r)
|
|
3494
|
+
};
|
|
3495
|
+
}
|
|
3496
|
+
async function J(e, r, t) {
|
|
3497
|
+
if (!r.token)
|
|
3498
|
+
throw new Error(
|
|
3499
|
+
"SemaphorDataAppProvider needs a token to execute queries."
|
|
3500
|
+
);
|
|
3501
|
+
const n = ai(r), i = ti(e, n);
|
|
3502
|
+
let o;
|
|
3503
|
+
try {
|
|
3504
|
+
o = await fetch(n, {
|
|
3505
|
+
method: "POST",
|
|
3506
|
+
headers: {
|
|
3507
|
+
"Content-Type": "application/json",
|
|
3508
|
+
Authorization: `Bearer ${r.token}`
|
|
3509
|
+
},
|
|
3510
|
+
body: JSON.stringify({
|
|
3511
|
+
intent: e,
|
|
3512
|
+
activeInputs: r.activeInputs,
|
|
3513
|
+
...t ? { analysisOptions: t } : {},
|
|
3514
|
+
resultShape: e.kind,
|
|
3515
|
+
...ri(r) ? { debug: { responseDetail: "debug" } } : {}
|
|
3516
|
+
})
|
|
3517
|
+
});
|
|
3518
|
+
} catch (f) {
|
|
3519
|
+
throw new Error(
|
|
3520
|
+
`${i}: ${f instanceof Error ? f.message : String(f)}`
|
|
3521
|
+
);
|
|
3522
|
+
}
|
|
3523
|
+
const u = await oi(o);
|
|
3524
|
+
if (!o.ok || u.error)
|
|
3525
|
+
throw ei(
|
|
3526
|
+
`${i}: ${u.error || `Semaphor Data App execution failed with status ${o.status}.`}`,
|
|
3527
|
+
u
|
|
3528
|
+
);
|
|
3529
|
+
return u;
|
|
3530
|
+
}
|
|
3531
|
+
function ei(e, r) {
|
|
3532
|
+
var t;
|
|
3533
|
+
return Ae(e, {
|
|
3534
|
+
requestId: r.requestId,
|
|
3535
|
+
details: r.details,
|
|
3536
|
+
executionResult: r.executionResult,
|
|
3537
|
+
validation: (t = r.executionResult) == null ? void 0 : t.validation
|
|
3538
|
+
});
|
|
3539
|
+
}
|
|
3540
|
+
function ri(e) {
|
|
3541
|
+
const r = e.debug;
|
|
3542
|
+
return r ? r === !0 ? !0 : r.enabled !== !1 && r.requestServerDebug !== !1 : !1;
|
|
3543
|
+
}
|
|
3544
|
+
function ti(e, r) {
|
|
3545
|
+
return [
|
|
3546
|
+
`Semaphor ${e.kind} query`,
|
|
3547
|
+
e.id ? `id=${e.id}` : void 0,
|
|
3548
|
+
e.label ? `label=${e.label}` : void 0,
|
|
3549
|
+
ni(e),
|
|
3550
|
+
`endpoint=${ii(r)}`
|
|
3551
|
+
].filter((t) => !!t).join(" ");
|
|
3552
|
+
}
|
|
3553
|
+
function ni(e) {
|
|
3554
|
+
const r = "source" in e ? e.source : void 0;
|
|
3555
|
+
if (!(!r || typeof r != "object")) {
|
|
3556
|
+
if (r.kind === "semantic")
|
|
3557
|
+
return `source=${[
|
|
3558
|
+
r.domainId,
|
|
3559
|
+
r.datasetId || r.datasetName
|
|
3560
|
+
].filter(Boolean).join("/")}`;
|
|
3561
|
+
if (r.kind === "physical")
|
|
3562
|
+
return `source=${[
|
|
3563
|
+
r.connectionId,
|
|
3564
|
+
r.databaseName,
|
|
3565
|
+
r.schemaName,
|
|
3566
|
+
r.tableName
|
|
3567
|
+
].filter(Boolean).join("/")}`;
|
|
3568
|
+
if (r.kind === "sql")
|
|
3569
|
+
return r.connectionId ? `source=${r.connectionId}` : void 0;
|
|
3570
|
+
}
|
|
3571
|
+
}
|
|
3572
|
+
function ii(e) {
|
|
3573
|
+
if (!e)
|
|
3574
|
+
return "/api/v1/data-app/execute";
|
|
3575
|
+
try {
|
|
3576
|
+
return new URL(e, "http://localhost").pathname;
|
|
3577
|
+
} catch {
|
|
3578
|
+
return e;
|
|
3579
|
+
}
|
|
3580
|
+
}
|
|
3581
|
+
async function oi(e) {
|
|
3582
|
+
const r = await e.text().catch(() => "");
|
|
3583
|
+
if (!r.trim())
|
|
3584
|
+
return e.ok ? {
|
|
3585
|
+
error: "Semaphor Data App execution returned an empty response."
|
|
3586
|
+
} : {};
|
|
3587
|
+
try {
|
|
3588
|
+
return JSON.parse(r);
|
|
3589
|
+
} catch {
|
|
3590
|
+
return e.ok ? {
|
|
3591
|
+
error: "Semaphor Data App execution returned invalid JSON.",
|
|
3592
|
+
details: r
|
|
3593
|
+
} : {
|
|
3594
|
+
error: si(e, r),
|
|
3595
|
+
details: r
|
|
3596
|
+
};
|
|
3597
|
+
}
|
|
3598
|
+
}
|
|
3599
|
+
function si(e, r) {
|
|
3600
|
+
const t = e.statusText ? ` ${e.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
|
|
3601
|
+
return n ? `Semaphor Data App execution failed with status ${e.status}${t}: ${n.slice(0, 240)}` : `Semaphor Data App execution failed with status ${e.status}${t}.`;
|
|
3602
|
+
}
|
|
3603
|
+
function ai(e) {
|
|
3604
|
+
const r = di(e).replace(/\/+$/, "");
|
|
3605
|
+
return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
3606
|
+
}
|
|
3607
|
+
function di(e) {
|
|
3608
|
+
if (e.apiBaseUrl)
|
|
3609
|
+
return e.apiBaseUrl;
|
|
3610
|
+
if (!e.token)
|
|
3611
|
+
return "";
|
|
3612
|
+
try {
|
|
3613
|
+
return ot(e.token).apiServiceUrl || "";
|
|
3614
|
+
} catch {
|
|
3615
|
+
return "";
|
|
3616
|
+
}
|
|
3617
|
+
}
|
|
3618
|
+
const Kr = we({});
|
|
3619
|
+
function li() {
|
|
3620
|
+
if (!(typeof window > "u"))
|
|
3621
|
+
return window.__SEMAPHOR_DATA_APP_RUNTIME__;
|
|
3622
|
+
}
|
|
3623
|
+
function ui() {
|
|
3624
|
+
return V(Kr);
|
|
3625
|
+
}
|
|
3626
|
+
function Li(e) {
|
|
3627
|
+
const [r, t] = M(e.defaultValue), n = Object.prototype.hasOwnProperty.call(e, "value"), i = n ? e.value : r, o = w(
|
|
3628
|
+
() => cr(e.options),
|
|
3378
3629
|
[e.options]
|
|
3379
|
-
),
|
|
3380
|
-
(
|
|
3381
|
-
var
|
|
3382
|
-
const
|
|
3383
|
-
(
|
|
3630
|
+
), u = O(
|
|
3631
|
+
(d) => {
|
|
3632
|
+
var m;
|
|
3633
|
+
const c = d;
|
|
3634
|
+
(m = e.onValueChange) == null || m.call(e, c), n || t(c);
|
|
3384
3635
|
},
|
|
3385
3636
|
[n, e]
|
|
3386
|
-
),
|
|
3637
|
+
), f = O(() => u(void 0), [u]);
|
|
3387
3638
|
return w(() => {
|
|
3388
|
-
const
|
|
3639
|
+
const d = fr(e);
|
|
3389
3640
|
return {
|
|
3390
3641
|
id: e.id,
|
|
3391
3642
|
kind: e.kind,
|
|
3392
3643
|
label: e.label,
|
|
3393
|
-
field:
|
|
3394
|
-
operator:
|
|
3395
|
-
relationshipHint:
|
|
3644
|
+
field: d.field,
|
|
3645
|
+
operator: d.operator,
|
|
3646
|
+
relationshipHint: d.relationshipHint,
|
|
3396
3647
|
controlRole: e.kind === "control" ? e.role : void 0,
|
|
3397
3648
|
value: i,
|
|
3398
|
-
options:
|
|
3399
|
-
isActive:
|
|
3400
|
-
setValue:
|
|
3401
|
-
clear:
|
|
3649
|
+
options: o,
|
|
3650
|
+
isActive: ce(i),
|
|
3651
|
+
setValue: u,
|
|
3652
|
+
clear: f,
|
|
3402
3653
|
toAnalyticsInput: () => ({
|
|
3403
|
-
inputId:
|
|
3404
|
-
field:
|
|
3654
|
+
inputId: d.inputId,
|
|
3655
|
+
field: d.field,
|
|
3405
3656
|
kind: e.kind,
|
|
3406
3657
|
label: e.label,
|
|
3407
3658
|
value: i,
|
|
3408
|
-
isActive:
|
|
3409
|
-
operator:
|
|
3410
|
-
relationshipHint:
|
|
3659
|
+
isActive: ce(i),
|
|
3660
|
+
operator: d.operator,
|
|
3661
|
+
relationshipHint: d.relationshipHint,
|
|
3411
3662
|
controlRole: e.kind === "control" ? e.role : void 0
|
|
3412
3663
|
})
|
|
3413
3664
|
};
|
|
3414
|
-
}, [
|
|
3665
|
+
}, [f, o, u, e, i]);
|
|
3415
3666
|
}
|
|
3416
|
-
function
|
|
3417
|
-
const [r, t] =
|
|
3418
|
-
return
|
|
3667
|
+
function Oi(e) {
|
|
3668
|
+
const [r, t] = M(() => hi(e));
|
|
3669
|
+
return $(() => {
|
|
3419
3670
|
t((n) => {
|
|
3420
3671
|
let i = n;
|
|
3421
|
-
for (const
|
|
3422
|
-
!Object.prototype.hasOwnProperty.call(i,
|
|
3672
|
+
for (const o of e)
|
|
3673
|
+
!Object.prototype.hasOwnProperty.call(i, o.id) && o.defaultValue !== void 0 && (i = { ...i, [o.id]: o.defaultValue });
|
|
3423
3674
|
return i;
|
|
3424
3675
|
});
|
|
3425
3676
|
}, [e]), w(
|
|
@@ -3427,35 +3678,35 @@ function fi(e) {
|
|
|
3427
3678
|
const i = Object.prototype.hasOwnProperty.call(
|
|
3428
3679
|
n,
|
|
3429
3680
|
"value"
|
|
3430
|
-
),
|
|
3431
|
-
var
|
|
3432
|
-
(
|
|
3433
|
-
...
|
|
3434
|
-
[n.id]:
|
|
3681
|
+
), o = i ? n.value : r[n.id], u = cr(n.options), f = (m) => {
|
|
3682
|
+
var v;
|
|
3683
|
+
(v = n.onValueChange) == null || v.call(n, m), i || t((S) => ({
|
|
3684
|
+
...S,
|
|
3685
|
+
[n.id]: m
|
|
3435
3686
|
}));
|
|
3436
|
-
},
|
|
3687
|
+
}, d = () => f(void 0), c = fr(n);
|
|
3437
3688
|
return {
|
|
3438
3689
|
id: n.id,
|
|
3439
3690
|
kind: n.kind,
|
|
3440
3691
|
label: n.label,
|
|
3441
|
-
field:
|
|
3442
|
-
operator:
|
|
3443
|
-
relationshipHint:
|
|
3692
|
+
field: c.field,
|
|
3693
|
+
operator: c.operator,
|
|
3694
|
+
relationshipHint: c.relationshipHint,
|
|
3444
3695
|
controlRole: n.kind === "control" ? n.role : void 0,
|
|
3445
|
-
value:
|
|
3446
|
-
options:
|
|
3447
|
-
isActive:
|
|
3448
|
-
setValue:
|
|
3449
|
-
clear:
|
|
3696
|
+
value: o,
|
|
3697
|
+
options: u,
|
|
3698
|
+
isActive: ce(o),
|
|
3699
|
+
setValue: f,
|
|
3700
|
+
clear: d,
|
|
3450
3701
|
toAnalyticsInput: () => ({
|
|
3451
|
-
inputId:
|
|
3452
|
-
field:
|
|
3702
|
+
inputId: c.inputId,
|
|
3703
|
+
field: c.field,
|
|
3453
3704
|
kind: n.kind,
|
|
3454
3705
|
label: n.label,
|
|
3455
|
-
value:
|
|
3456
|
-
isActive:
|
|
3457
|
-
operator:
|
|
3458
|
-
relationshipHint:
|
|
3706
|
+
value: o,
|
|
3707
|
+
isActive: ce(o),
|
|
3708
|
+
operator: c.operator,
|
|
3709
|
+
relationshipHint: c.relationshipHint,
|
|
3459
3710
|
controlRole: n.kind === "control" ? n.role : void 0
|
|
3460
3711
|
})
|
|
3461
3712
|
};
|
|
@@ -3463,29 +3714,29 @@ function fi(e) {
|
|
|
3463
3714
|
[e, r]
|
|
3464
3715
|
);
|
|
3465
3716
|
}
|
|
3466
|
-
function
|
|
3467
|
-
const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = w(() =>
|
|
3468
|
-
|
|
3469
|
-
|
|
3717
|
+
function Bi(e, r) {
|
|
3718
|
+
const t = (r == null ? void 0 : r.status) === "success" ? r.options : void 0, n = w(() => fi(t), [t]);
|
|
3719
|
+
$(() => {
|
|
3720
|
+
ci(e.value, t) || e.clear();
|
|
3470
3721
|
}, [e, n, r == null ? void 0 : r.status, t]);
|
|
3471
3722
|
}
|
|
3472
|
-
function
|
|
3473
|
-
if (!
|
|
3723
|
+
function ci(e, r) {
|
|
3724
|
+
if (!ce(e) || r === void 0)
|
|
3474
3725
|
return !0;
|
|
3475
3726
|
const t = new Set(
|
|
3476
|
-
r.map((i) =>
|
|
3727
|
+
r.map((i) => lr(i.value))
|
|
3477
3728
|
);
|
|
3478
3729
|
return (Array.isArray(e) ? e : [e]).every(
|
|
3479
|
-
(i) => t.has(
|
|
3730
|
+
(i) => t.has(lr(i))
|
|
3480
3731
|
);
|
|
3481
3732
|
}
|
|
3482
|
-
function
|
|
3733
|
+
function fi(e) {
|
|
3483
3734
|
return JSON.stringify((e || []).map((r) => r.value));
|
|
3484
3735
|
}
|
|
3485
|
-
function
|
|
3736
|
+
function lr(e) {
|
|
3486
3737
|
return `${typeof e}:${String(e)}`;
|
|
3487
3738
|
}
|
|
3488
|
-
function
|
|
3739
|
+
function $i(e, r = {}) {
|
|
3489
3740
|
const t = w(
|
|
3490
3741
|
() => r.inputs ? {
|
|
3491
3742
|
...e,
|
|
@@ -3497,44 +3748,44 @@ function gi(e, r = {}) {
|
|
|
3497
3748
|
case "metric":
|
|
3498
3749
|
return {
|
|
3499
3750
|
queryKind: t.queryKind,
|
|
3500
|
-
request:
|
|
3751
|
+
request: Vn(t)
|
|
3501
3752
|
};
|
|
3502
3753
|
case "analysis":
|
|
3503
3754
|
return {
|
|
3504
3755
|
queryKind: t.queryKind,
|
|
3505
|
-
request:
|
|
3756
|
+
request: Qn(t)
|
|
3506
3757
|
};
|
|
3507
3758
|
case "records":
|
|
3508
3759
|
return {
|
|
3509
3760
|
queryKind: t.queryKind,
|
|
3510
|
-
request:
|
|
3761
|
+
request: Un(t)
|
|
3511
3762
|
};
|
|
3512
3763
|
case "inputOptions":
|
|
3513
3764
|
return {
|
|
3514
3765
|
queryKind: t.queryKind,
|
|
3515
|
-
request:
|
|
3766
|
+
request: Gn(t)
|
|
3516
3767
|
};
|
|
3517
3768
|
case "sql":
|
|
3518
3769
|
return {
|
|
3519
3770
|
queryKind: t.queryKind,
|
|
3520
|
-
request:
|
|
3771
|
+
request: Jn(t)
|
|
3521
3772
|
};
|
|
3522
3773
|
case "matrix":
|
|
3523
3774
|
return {
|
|
3524
3775
|
queryKind: t.queryKind,
|
|
3525
|
-
request:
|
|
3776
|
+
request: Yn(t)
|
|
3526
3777
|
};
|
|
3527
3778
|
default:
|
|
3528
|
-
return
|
|
3779
|
+
return Se(t);
|
|
3529
3780
|
}
|
|
3530
|
-
}, [t]), i =
|
|
3781
|
+
}, [t]), i = pt({
|
|
3531
3782
|
spec: t,
|
|
3532
3783
|
queryKind: n.queryKind,
|
|
3533
3784
|
queryKey: n.request.queryKey,
|
|
3534
3785
|
intent: n.request.intent,
|
|
3535
3786
|
activeInputs: n.request.activeInputs,
|
|
3536
3787
|
debug: r.debug
|
|
3537
|
-
}),
|
|
3788
|
+
}), o = D(null), u = w(
|
|
3538
3789
|
() => ({
|
|
3539
3790
|
start: i.start,
|
|
3540
3791
|
success: i.success,
|
|
@@ -3547,232 +3798,336 @@ function gi(e, r = {}) {
|
|
|
3547
3798
|
i.start,
|
|
3548
3799
|
i.success
|
|
3549
3800
|
]
|
|
3550
|
-
),
|
|
3551
|
-
(
|
|
3552
|
-
var
|
|
3553
|
-
const
|
|
3554
|
-
if (
|
|
3801
|
+
), f = O(
|
|
3802
|
+
(l) => {
|
|
3803
|
+
var K, E, W, L, h, I, R, q, A;
|
|
3804
|
+
const y = n.request;
|
|
3805
|
+
if (y.intent)
|
|
3555
3806
|
switch (n.queryKind) {
|
|
3556
3807
|
case "metric":
|
|
3557
|
-
return (
|
|
3558
|
-
|
|
3559
|
-
|
|
3808
|
+
return (K = l.executor) == null ? void 0 : K.executeMetric(
|
|
3809
|
+
y.intent,
|
|
3810
|
+
l
|
|
3560
3811
|
);
|
|
3561
3812
|
case "analysis":
|
|
3562
|
-
return (W = (
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3813
|
+
return (W = (E = l.executor) == null ? void 0 : E.executeAnalysis) == null ? void 0 : W.call(
|
|
3814
|
+
E,
|
|
3815
|
+
y.intent,
|
|
3816
|
+
l,
|
|
3817
|
+
y.analysisOptions
|
|
3567
3818
|
);
|
|
3568
3819
|
case "records":
|
|
3569
|
-
return (
|
|
3570
|
-
|
|
3571
|
-
|
|
3820
|
+
return (L = l.executor) == null ? void 0 : L.executeRecords(
|
|
3821
|
+
y.intent,
|
|
3822
|
+
l
|
|
3572
3823
|
);
|
|
3573
3824
|
case "inputOptions":
|
|
3574
|
-
return (
|
|
3575
|
-
|
|
3576
|
-
|
|
3825
|
+
return (h = l.executor) == null ? void 0 : h.executeInputOptions(
|
|
3826
|
+
y.intent,
|
|
3827
|
+
l
|
|
3577
3828
|
);
|
|
3578
3829
|
case "sql":
|
|
3579
|
-
return (
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3830
|
+
return (R = (I = l.executor) == null ? void 0 : I.executeSql) == null ? void 0 : R.call(
|
|
3831
|
+
I,
|
|
3832
|
+
y.intent,
|
|
3833
|
+
l
|
|
3583
3834
|
);
|
|
3584
3835
|
case "matrix":
|
|
3585
|
-
return (
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3836
|
+
return (A = (q = l.executor) == null ? void 0 : q.executeMatrix) == null ? void 0 : A.call(
|
|
3837
|
+
q,
|
|
3838
|
+
y.intent,
|
|
3839
|
+
l
|
|
3589
3840
|
);
|
|
3590
3841
|
default:
|
|
3591
|
-
return
|
|
3842
|
+
return Se(n);
|
|
3592
3843
|
}
|
|
3593
3844
|
},
|
|
3594
3845
|
[n]
|
|
3595
|
-
),
|
|
3846
|
+
), d = yi(
|
|
3596
3847
|
n.request.queryKey,
|
|
3597
|
-
|
|
3848
|
+
f,
|
|
3598
3849
|
n.request.idleData,
|
|
3599
3850
|
n.request.activeInputs,
|
|
3600
|
-
|
|
3601
|
-
),
|
|
3602
|
-
|
|
3603
|
-
const
|
|
3604
|
-
if (!
|
|
3605
|
-
|
|
3851
|
+
u
|
|
3852
|
+
), c = i.queryId, m = i.validationFailure;
|
|
3853
|
+
$(() => {
|
|
3854
|
+
const l = n.request.error;
|
|
3855
|
+
if (!l) {
|
|
3856
|
+
o.current = null;
|
|
3606
3857
|
return;
|
|
3607
3858
|
}
|
|
3608
|
-
const
|
|
3609
|
-
|
|
3859
|
+
const y = `${c}:${l.message}`;
|
|
3860
|
+
o.current !== y && (o.current = y, m(l));
|
|
3610
3861
|
}, [
|
|
3611
3862
|
n.request.error,
|
|
3612
3863
|
n.request.queryKey,
|
|
3613
|
-
|
|
3614
|
-
|
|
3864
|
+
c,
|
|
3865
|
+
m
|
|
3615
3866
|
]);
|
|
3616
|
-
const
|
|
3867
|
+
const v = n.request.error ? n.request.idleData : d.data, S = n.request.error ? "error" : d.status, g = !n.request.error && d.status === "loading", b = n.request.error || d.error, k = i.trace;
|
|
3617
3868
|
switch (n.queryKind) {
|
|
3618
3869
|
case "metric": {
|
|
3619
|
-
const
|
|
3870
|
+
const l = v, y = Y({
|
|
3871
|
+
queryKind: n.queryKind,
|
|
3872
|
+
status: S,
|
|
3873
|
+
isLoading: g,
|
|
3874
|
+
error: b,
|
|
3875
|
+
trace: k,
|
|
3876
|
+
payload: l,
|
|
3877
|
+
activeInputs: n.request.activeInputs,
|
|
3878
|
+
isStale: d.isStale
|
|
3879
|
+
});
|
|
3620
3880
|
return {
|
|
3621
3881
|
id: t.id,
|
|
3622
3882
|
intent: n.request.intent,
|
|
3623
|
-
value: (
|
|
3624
|
-
measures:
|
|
3625
|
-
comparisonValue:
|
|
3626
|
-
delta:
|
|
3627
|
-
deltaPercent:
|
|
3628
|
-
records:
|
|
3629
|
-
|
|
3630
|
-
status: v,
|
|
3631
|
-
isLoading: g,
|
|
3632
|
-
error: h,
|
|
3633
|
-
trace: C
|
|
3883
|
+
value: (l == null ? void 0 : l.value) ?? null,
|
|
3884
|
+
measures: l == null ? void 0 : l.measures,
|
|
3885
|
+
comparisonValue: l == null ? void 0 : l.comparisonValue,
|
|
3886
|
+
delta: l == null ? void 0 : l.delta,
|
|
3887
|
+
deltaPercent: l == null ? void 0 : l.deltaPercent,
|
|
3888
|
+
records: l == null ? void 0 : l.records,
|
|
3889
|
+
...y
|
|
3634
3890
|
};
|
|
3635
3891
|
}
|
|
3636
3892
|
case "analysis": {
|
|
3637
|
-
const
|
|
3893
|
+
const l = Or(v), y = Y({
|
|
3894
|
+
queryKind: n.queryKind,
|
|
3895
|
+
status: S,
|
|
3896
|
+
isLoading: g,
|
|
3897
|
+
error: b,
|
|
3898
|
+
trace: k,
|
|
3899
|
+
payload: l,
|
|
3900
|
+
activeInputs: n.request.activeInputs,
|
|
3901
|
+
isStale: d.isStale
|
|
3902
|
+
});
|
|
3638
3903
|
return {
|
|
3639
3904
|
id: t.id,
|
|
3640
3905
|
intent: n.request.intent,
|
|
3641
|
-
...
|
|
3642
|
-
|
|
3643
|
-
isLoading: g,
|
|
3644
|
-
error: h,
|
|
3645
|
-
trace: C
|
|
3906
|
+
...l || {},
|
|
3907
|
+
...y
|
|
3646
3908
|
};
|
|
3647
3909
|
}
|
|
3648
3910
|
case "records": {
|
|
3649
|
-
const
|
|
3911
|
+
const l = v, y = Y({
|
|
3912
|
+
queryKind: n.queryKind,
|
|
3913
|
+
status: S,
|
|
3914
|
+
isLoading: g,
|
|
3915
|
+
error: b,
|
|
3916
|
+
trace: k,
|
|
3917
|
+
payload: l,
|
|
3918
|
+
activeInputs: n.request.activeInputs,
|
|
3919
|
+
isStale: d.isStale
|
|
3920
|
+
});
|
|
3650
3921
|
return {
|
|
3651
3922
|
id: t.id,
|
|
3652
3923
|
intent: n.request.intent,
|
|
3653
|
-
records: (
|
|
3654
|
-
columns:
|
|
3655
|
-
rowCount:
|
|
3656
|
-
pagination:
|
|
3657
|
-
|
|
3658
|
-
status: v,
|
|
3659
|
-
isLoading: g,
|
|
3660
|
-
error: h,
|
|
3661
|
-
trace: C
|
|
3924
|
+
records: (l == null ? void 0 : l.records) || [],
|
|
3925
|
+
columns: l == null ? void 0 : l.columns,
|
|
3926
|
+
rowCount: l == null ? void 0 : l.rowCount,
|
|
3927
|
+
pagination: l == null ? void 0 : l.pagination,
|
|
3928
|
+
...y
|
|
3662
3929
|
};
|
|
3663
3930
|
}
|
|
3664
3931
|
case "inputOptions": {
|
|
3665
|
-
const
|
|
3932
|
+
const l = v, y = Y({
|
|
3933
|
+
queryKind: n.queryKind,
|
|
3934
|
+
status: S,
|
|
3935
|
+
isLoading: g,
|
|
3936
|
+
error: b,
|
|
3937
|
+
trace: k,
|
|
3938
|
+
payload: l,
|
|
3939
|
+
activeInputs: n.request.activeInputs,
|
|
3940
|
+
isStale: d.isStale
|
|
3941
|
+
});
|
|
3666
3942
|
return {
|
|
3667
3943
|
id: t.id,
|
|
3668
3944
|
intent: n.request.intent,
|
|
3669
|
-
options: (
|
|
3670
|
-
|
|
3671
|
-
status: v,
|
|
3672
|
-
isLoading: g,
|
|
3673
|
-
error: h,
|
|
3674
|
-
trace: C
|
|
3945
|
+
options: (l == null ? void 0 : l.options) || [],
|
|
3946
|
+
...y
|
|
3675
3947
|
};
|
|
3676
3948
|
}
|
|
3677
3949
|
case "sql": {
|
|
3678
|
-
const
|
|
3950
|
+
const l = v, y = Y({
|
|
3951
|
+
queryKind: n.queryKind,
|
|
3952
|
+
status: S,
|
|
3953
|
+
isLoading: g,
|
|
3954
|
+
error: b,
|
|
3955
|
+
trace: k,
|
|
3956
|
+
payload: l,
|
|
3957
|
+
activeInputs: n.request.activeInputs,
|
|
3958
|
+
isStale: d.isStale
|
|
3959
|
+
});
|
|
3679
3960
|
return {
|
|
3680
3961
|
id: t.id,
|
|
3681
3962
|
intent: n.request.intent,
|
|
3682
|
-
records: (
|
|
3683
|
-
columns:
|
|
3684
|
-
rowCount:
|
|
3685
|
-
pagination:
|
|
3686
|
-
output:
|
|
3687
|
-
rowLimitExceeded:
|
|
3688
|
-
|
|
3689
|
-
status: v,
|
|
3690
|
-
isLoading: g,
|
|
3691
|
-
error: h,
|
|
3692
|
-
trace: C
|
|
3963
|
+
records: (l == null ? void 0 : l.records) || [],
|
|
3964
|
+
columns: l == null ? void 0 : l.columns,
|
|
3965
|
+
rowCount: l == null ? void 0 : l.rowCount,
|
|
3966
|
+
pagination: l == null ? void 0 : l.pagination,
|
|
3967
|
+
output: l == null ? void 0 : l.output,
|
|
3968
|
+
rowLimitExceeded: l == null ? void 0 : l.rowLimitExceeded,
|
|
3969
|
+
...y
|
|
3693
3970
|
};
|
|
3694
3971
|
}
|
|
3695
3972
|
case "matrix": {
|
|
3696
|
-
const
|
|
3973
|
+
const l = v, y = Y({
|
|
3974
|
+
queryKind: n.queryKind,
|
|
3975
|
+
status: S,
|
|
3976
|
+
isLoading: g,
|
|
3977
|
+
error: b,
|
|
3978
|
+
trace: k,
|
|
3979
|
+
payload: l,
|
|
3980
|
+
activeInputs: n.request.activeInputs,
|
|
3981
|
+
isStale: d.isStale
|
|
3982
|
+
});
|
|
3697
3983
|
return {
|
|
3698
3984
|
id: t.id,
|
|
3699
3985
|
intent: n.request.intent,
|
|
3700
|
-
matrixResult:
|
|
3701
|
-
grid:
|
|
3702
|
-
expansion:
|
|
3703
|
-
|
|
3704
|
-
status: v,
|
|
3705
|
-
isLoading: g,
|
|
3706
|
-
error: h,
|
|
3707
|
-
trace: C
|
|
3986
|
+
matrixResult: l == null ? void 0 : l.matrixResult,
|
|
3987
|
+
grid: l == null ? void 0 : l.grid,
|
|
3988
|
+
expansion: l == null ? void 0 : l.expansion,
|
|
3989
|
+
...y
|
|
3708
3990
|
};
|
|
3709
3991
|
}
|
|
3710
3992
|
default:
|
|
3711
|
-
return
|
|
3993
|
+
return Se(n);
|
|
3712
3994
|
}
|
|
3713
3995
|
}
|
|
3714
|
-
function
|
|
3715
|
-
|
|
3996
|
+
function Y(e) {
|
|
3997
|
+
var o, u, f;
|
|
3998
|
+
const r = pi(e.payload) ?? ((o = e.error) == null ? void 0 : o.executionResult), t = ((u = e.error) == null ? void 0 : u.validation) ?? (r == null ? void 0 : r.validation), n = r == null ? void 0 : r.coverage, i = r == null ? void 0 : r.diagnosticFeedback;
|
|
3999
|
+
return {
|
|
4000
|
+
status: e.status,
|
|
4001
|
+
executionStatus: r == null ? void 0 : r.status,
|
|
4002
|
+
executionResult: r,
|
|
4003
|
+
validation: t,
|
|
4004
|
+
coverage: n,
|
|
4005
|
+
diagnosticFeedback: i,
|
|
4006
|
+
isLoading: e.isLoading,
|
|
4007
|
+
isEmpty: mi(e.queryKind, e.payload, e.status),
|
|
4008
|
+
isPartial: gi(e.payload, r),
|
|
4009
|
+
isFiltered: !!((f = e.activeInputs) != null && f.some(
|
|
4010
|
+
(d) => d.kind === "filter" && d.isActive
|
|
4011
|
+
)),
|
|
4012
|
+
isStale: e.isStale,
|
|
4013
|
+
isValidated: !!t,
|
|
4014
|
+
error: e.error,
|
|
4015
|
+
trace: e.trace
|
|
4016
|
+
};
|
|
4017
|
+
}
|
|
4018
|
+
function pi(e) {
|
|
4019
|
+
const r = e;
|
|
4020
|
+
return r == null ? void 0 : r.executionResult;
|
|
4021
|
+
}
|
|
4022
|
+
function gi(e, r) {
|
|
4023
|
+
var n, i;
|
|
4024
|
+
const t = !!(e != null && e.rowLimitExceeded);
|
|
4025
|
+
return !!((r == null ? void 0 : r.status) === "partial" || ((n = r == null ? void 0 : r.diagnosticFeedback) == null ? void 0 : n.status) === "partial" || (r == null ? void 0 : r.status) !== "failed" && ((i = r == null ? void 0 : r.coverage) != null && i.missingObligations.length) || t);
|
|
4026
|
+
}
|
|
4027
|
+
function mi(e, r, t) {
|
|
4028
|
+
var n, i, o, u, f;
|
|
4029
|
+
if (t !== "success")
|
|
4030
|
+
return !1;
|
|
4031
|
+
switch (e) {
|
|
4032
|
+
case "metric": {
|
|
4033
|
+
const d = r;
|
|
4034
|
+
return (d == null ? void 0 : d.value) == null && !B(d == null ? void 0 : d.records);
|
|
4035
|
+
}
|
|
4036
|
+
case "analysis": {
|
|
4037
|
+
const d = r;
|
|
4038
|
+
return d ? !d.answerSummary && !B(d.records) && !B(d.changes) && !B(d.drivers) && !B(d.largestNegativeChanges) && !B(d.largestPositiveChanges) && !B(d.largestNegativeDrivers) && !B(d.largestPositiveDrivers) && !Object.values(d.resultSets || {}).some(
|
|
4039
|
+
(c) => B(c.records)
|
|
4040
|
+
) : !0;
|
|
4041
|
+
}
|
|
4042
|
+
case "records": {
|
|
4043
|
+
const d = r;
|
|
4044
|
+
return !B(d == null ? void 0 : d.records);
|
|
4045
|
+
}
|
|
4046
|
+
case "sql": {
|
|
4047
|
+
const d = r;
|
|
4048
|
+
return !B(d == null ? void 0 : d.records) && (d == null ? void 0 : d.output) === void 0;
|
|
4049
|
+
}
|
|
4050
|
+
case "inputOptions": {
|
|
4051
|
+
const d = r;
|
|
4052
|
+
return !((n = d == null ? void 0 : d.options) != null && n.length);
|
|
4053
|
+
}
|
|
4054
|
+
case "matrix": {
|
|
4055
|
+
const d = r;
|
|
4056
|
+
return !((o = (i = d == null ? void 0 : d.matrixResult) == null ? void 0 : i.cells) != null && o.length) && !((f = (u = d == null ? void 0 : d.grid) == null ? void 0 : u.cells) != null && f.length);
|
|
4057
|
+
}
|
|
4058
|
+
default:
|
|
4059
|
+
return Se(e);
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
function B(e) {
|
|
4063
|
+
return Array.isArray(e) && e.length > 0;
|
|
4064
|
+
}
|
|
4065
|
+
function yi(e, r, t, n, i) {
|
|
4066
|
+
const o = ui(), u = D(r), f = D(n), [d, c] = M({
|
|
3716
4067
|
status: "idle",
|
|
3717
4068
|
data: t,
|
|
3718
|
-
error: null
|
|
4069
|
+
error: null,
|
|
4070
|
+
isStale: !1
|
|
3719
4071
|
});
|
|
3720
|
-
return
|
|
3721
|
-
let
|
|
4072
|
+
return u.current = r, f.current = n, $(() => {
|
|
4073
|
+
let m;
|
|
3722
4074
|
try {
|
|
3723
|
-
|
|
3724
|
-
...
|
|
3725
|
-
activeInputs:
|
|
4075
|
+
m = u.current({
|
|
4076
|
+
...o,
|
|
4077
|
+
activeInputs: f.current
|
|
3726
4078
|
});
|
|
3727
4079
|
} catch (g) {
|
|
3728
|
-
i == null || i.failure(g, 0),
|
|
4080
|
+
i == null || i.failure(g, 0), c({
|
|
3729
4081
|
status: "error",
|
|
3730
4082
|
data: t,
|
|
3731
|
-
error:
|
|
4083
|
+
error: Fe(g),
|
|
4084
|
+
isStale: !1
|
|
3732
4085
|
});
|
|
3733
4086
|
return;
|
|
3734
4087
|
}
|
|
3735
|
-
if (!
|
|
3736
|
-
|
|
4088
|
+
if (!m) {
|
|
4089
|
+
c({ status: "idle", data: t, error: null, isStale: !1 });
|
|
3737
4090
|
return;
|
|
3738
4091
|
}
|
|
3739
|
-
let
|
|
3740
|
-
const
|
|
3741
|
-
return i == null || i.start(),
|
|
4092
|
+
let v = !1;
|
|
4093
|
+
const S = Wr();
|
|
4094
|
+
return i == null || i.start(), c((g) => ({
|
|
3742
4095
|
status: "loading",
|
|
3743
4096
|
data: g.data,
|
|
3744
|
-
error: null
|
|
3745
|
-
|
|
3746
|
-
|
|
4097
|
+
error: null,
|
|
4098
|
+
isStale: g.isStale || g.status === "success"
|
|
4099
|
+
})), m.then((g) => {
|
|
4100
|
+
v ? i == null || i.ignored("superseded") : (i == null || i.success(g, ur(S)), c({ status: "success", data: g, error: null, isStale: !1 }));
|
|
3747
4101
|
}).catch((g) => {
|
|
3748
|
-
|
|
4102
|
+
v ? i == null || i.ignored("superseded") : (i == null || i.failure(g, ur(S)), c({
|
|
3749
4103
|
status: "error",
|
|
3750
4104
|
data: t,
|
|
3751
|
-
error:
|
|
4105
|
+
error: Fe(g),
|
|
4106
|
+
isStale: !1
|
|
3752
4107
|
}));
|
|
3753
4108
|
}), () => {
|
|
3754
|
-
|
|
4109
|
+
v = !0;
|
|
3755
4110
|
};
|
|
3756
|
-
}, [t, e,
|
|
4111
|
+
}, [t, e, o, i]), d;
|
|
3757
4112
|
}
|
|
3758
|
-
function
|
|
4113
|
+
function Wr() {
|
|
3759
4114
|
return typeof performance < "u" && performance.now ? performance.now() : Date.now();
|
|
3760
4115
|
}
|
|
3761
|
-
function
|
|
3762
|
-
return Math.max(0, Math.round(
|
|
4116
|
+
function ur(e) {
|
|
4117
|
+
return Math.max(0, Math.round(Wr() - e));
|
|
3763
4118
|
}
|
|
3764
|
-
function
|
|
4119
|
+
function hi(e) {
|
|
3765
4120
|
return Object.fromEntries(
|
|
3766
4121
|
e.filter((r) => r.defaultValue !== void 0).map((r) => [r.id, r.defaultValue])
|
|
3767
4122
|
);
|
|
3768
4123
|
}
|
|
3769
|
-
function
|
|
4124
|
+
function Se(e) {
|
|
3770
4125
|
throw new Error(`Unsupported Semaphor query kind: ${JSON.stringify(e)}`);
|
|
3771
4126
|
}
|
|
3772
|
-
function
|
|
4127
|
+
function vi(e) {
|
|
3773
4128
|
return !e || typeof e == "boolean" || e.enabled === !1 ? null : e.autoRenderDevtools === !0 ? {} : e.autoRenderDevtools ? e.autoRenderDevtools : null;
|
|
3774
4129
|
}
|
|
3775
|
-
function
|
|
4130
|
+
function Ki({
|
|
3776
4131
|
token: e,
|
|
3777
4132
|
apiBaseUrl: r,
|
|
3778
4133
|
executor: t,
|
|
@@ -3780,33 +4135,33 @@ function mi({
|
|
|
3780
4135
|
children: i
|
|
3781
4136
|
}) {
|
|
3782
4137
|
var g;
|
|
3783
|
-
const
|
|
4138
|
+
const o = li(), u = ((g = o == null ? void 0 : o.authToken) == null ? void 0 : g.accessToken) || e, f = (o == null ? void 0 : o.dataApiBaseUrl) || (o == null ? void 0 : o.apiBaseUrl) || r, d = (o == null ? void 0 : o.debug) ?? n, c = vi(d), m = w(() => Zn(), []), v = t || m, S = w(
|
|
3784
4139
|
() => ({
|
|
3785
|
-
token:
|
|
3786
|
-
apiBaseUrl:
|
|
3787
|
-
executor:
|
|
3788
|
-
debug:
|
|
4140
|
+
token: u,
|
|
4141
|
+
apiBaseUrl: f,
|
|
4142
|
+
executor: v,
|
|
4143
|
+
debug: d
|
|
3789
4144
|
}),
|
|
3790
|
-
[
|
|
4145
|
+
[f, d, v, u]
|
|
3791
4146
|
);
|
|
3792
|
-
return /* @__PURE__ */
|
|
4147
|
+
return /* @__PURE__ */ a(lt, { debug: d, children: /* @__PURE__ */ p(Kr.Provider, { value: S, children: [
|
|
3793
4148
|
i,
|
|
3794
|
-
|
|
4149
|
+
c ? /* @__PURE__ */ a(ft, { ...c }) : null
|
|
3795
4150
|
] }) });
|
|
3796
4151
|
}
|
|
3797
4152
|
export {
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
4153
|
+
Ki as SemaphorDataAppProvider,
|
|
4154
|
+
ft as SemaphorDevtools,
|
|
4155
|
+
Di as SemaphorDevtoolsInspectButton,
|
|
4156
|
+
Ri as SemaphorViewBoundary,
|
|
4157
|
+
Zn as createSemaphorQueryExecutor,
|
|
4158
|
+
Ti as defineSemaphorDataApp,
|
|
4159
|
+
Ci as defineSemaphorInput,
|
|
4160
|
+
ci as isSemaphorInputValueValidForOptions,
|
|
4161
|
+
ki as semaphor,
|
|
4162
|
+
Bi as useClearInvalidSemaphorInputValue,
|
|
4163
|
+
hr as useSemaphorDevtools,
|
|
4164
|
+
Li as useSemaphorInput,
|
|
4165
|
+
Oi as useSemaphorInputs,
|
|
4166
|
+
$i as useSemaphorQuery
|
|
3812
4167
|
};
|