react-semaphor 0.1.344 → 0.1.346
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 +1 -1
- package/dist/chunks/validators-8R9pr2K9.js +1 -0
- package/dist/chunks/{validators-BqEnmlC6.js → validators-yMB7Tm4j.js} +120 -109
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +1 -1
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +233 -220
- package/dist/types/analytics-protocol.d.ts +22 -6
- package/dist/types/dashboard-authoring.d.ts +1 -0
- package/dist/types/dashboard.d.ts +1 -0
- package/dist/types/data-app-sdk.d.ts +205 -190
- package/dist/types/main.d.ts +1 -0
- package/dist/types/shared.d.ts +1 -0
- package/dist/types/surfboard.d.ts +1 -0
- package/dist/types/types.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/validators-v8WAqhaN.js +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { e as
|
|
2
|
-
import { j as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { jsx as
|
|
5
|
-
function
|
|
6
|
-
var
|
|
7
|
-
const e =
|
|
1
|
+
import { e as x, f as O, v as q } from "../chunks/validators-yMB7Tm4j.js";
|
|
2
|
+
import { j as T } from "../chunks/index-CuHybtft.js";
|
|
3
|
+
import { createContext as U, useContext as _, useMemo as m, useState as b, useCallback as h, useRef as R, useEffect as C } from "react";
|
|
4
|
+
import { jsx as K } from "react/jsx-runtime";
|
|
5
|
+
function P(t) {
|
|
6
|
+
var r;
|
|
7
|
+
const e = z(t);
|
|
8
8
|
return {
|
|
9
9
|
version: 1,
|
|
10
10
|
kind: "metric",
|
|
11
11
|
id: t.id,
|
|
12
12
|
label: t.label,
|
|
13
|
-
source:
|
|
13
|
+
source: k(t),
|
|
14
14
|
metrics: e,
|
|
15
|
-
primaryMetric:
|
|
15
|
+
primaryMetric: F(t, e),
|
|
16
16
|
dateField: t.dateField ? s(t.dateField, "date") : void 0,
|
|
17
17
|
timeGrain: t.timeGrain,
|
|
18
|
-
dimensions: (
|
|
19
|
-
comparison:
|
|
18
|
+
dimensions: (r = t.dimensions) == null ? void 0 : r.map((n) => s(n, "dimension")),
|
|
19
|
+
comparison: et(t.comparison),
|
|
20
20
|
orderBy: t.orderBy ? {
|
|
21
21
|
field: s(t.orderBy.field),
|
|
22
22
|
direction: t.orderBy.direction
|
|
@@ -25,59 +25,72 @@ function C(t) {
|
|
|
25
25
|
limit: t.limit
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function F(t, e) {
|
|
29
29
|
if (!t.primaryMetric)
|
|
30
30
|
return e[0] || { name: "", role: "measure" };
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
(i) => i.name === n.name
|
|
34
|
-
);
|
|
35
|
-
return r.length === 1 ? r[0] : void 0;
|
|
36
|
-
})();
|
|
37
|
-
return o ? M(n, o) : n;
|
|
31
|
+
const r = s(t.primaryMetric, "measure"), n = L(r, e), o = n.length === 1 ? n[0] : void 0;
|
|
32
|
+
return o ? w(r, o) : r;
|
|
38
33
|
}
|
|
39
|
-
function
|
|
34
|
+
function z(t) {
|
|
40
35
|
const e = [];
|
|
41
|
-
for (const
|
|
42
|
-
if (!
|
|
36
|
+
for (const r of t.metrics.map((n) => s(n, "measure"))) {
|
|
37
|
+
if (!r.name)
|
|
43
38
|
continue;
|
|
44
|
-
const
|
|
45
|
-
(
|
|
39
|
+
const n = e.findIndex(
|
|
40
|
+
(o) => V(o, r)
|
|
46
41
|
);
|
|
47
|
-
if (
|
|
48
|
-
e.push(
|
|
42
|
+
if (n === -1) {
|
|
43
|
+
e.push(r);
|
|
49
44
|
continue;
|
|
50
45
|
}
|
|
51
|
-
e[
|
|
46
|
+
e[n] = w(e[n], r);
|
|
52
47
|
}
|
|
53
48
|
return e;
|
|
54
49
|
}
|
|
55
|
-
function
|
|
50
|
+
function V(t, e) {
|
|
51
|
+
return x(t, e) && g(t) === g(e);
|
|
52
|
+
}
|
|
53
|
+
function j(t, e) {
|
|
54
|
+
return g(e) === g(t);
|
|
55
|
+
}
|
|
56
|
+
function N(t, e) {
|
|
57
|
+
return e.name !== t.name || t.source && !x(e, t) ? !1 : j(t, e);
|
|
58
|
+
}
|
|
59
|
+
function L(t, e) {
|
|
60
|
+
const r = e.filter(
|
|
61
|
+
(n) => N(t, n)
|
|
62
|
+
);
|
|
63
|
+
return t.aggregate !== void 0, r;
|
|
64
|
+
}
|
|
65
|
+
function g(t) {
|
|
66
|
+
return (t.aggregate || "SUM").toUpperCase();
|
|
67
|
+
}
|
|
68
|
+
function w(t, e) {
|
|
56
69
|
if (t.aggregate && e.aggregate && t.aggregate !== e.aggregate)
|
|
57
70
|
throw new Error(
|
|
58
71
|
`Metric "${t.name}" was requested with conflicting aggregate semantics: ${t.aggregate} and ${e.aggregate}.`
|
|
59
72
|
);
|
|
60
73
|
return {
|
|
61
|
-
|
|
74
|
+
...O(t, e),
|
|
62
75
|
aggregate: t.aggregate || e.aggregate
|
|
63
76
|
};
|
|
64
77
|
}
|
|
65
|
-
function
|
|
78
|
+
function Q(t) {
|
|
66
79
|
if ("sort" in t)
|
|
67
80
|
throw new Error(
|
|
68
81
|
"useSemaphorRecords supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet."
|
|
69
82
|
);
|
|
70
|
-
if (!
|
|
83
|
+
if (!tt(t))
|
|
71
84
|
throw new Error(
|
|
72
85
|
"useSemaphorRecords needs at least one field."
|
|
73
86
|
);
|
|
74
|
-
const e =
|
|
87
|
+
const e = G(t.fields);
|
|
75
88
|
return {
|
|
76
89
|
version: 1,
|
|
77
90
|
kind: "records",
|
|
78
91
|
id: t.id,
|
|
79
92
|
label: t.label,
|
|
80
|
-
source:
|
|
93
|
+
source: k(t),
|
|
81
94
|
fields: e,
|
|
82
95
|
dateField: t.dateField ? s(t.dateField, "date") : void 0,
|
|
83
96
|
timeGrain: t.timeGrain,
|
|
@@ -89,29 +102,29 @@ function z(t) {
|
|
|
89
102
|
limit: t.limit
|
|
90
103
|
};
|
|
91
104
|
}
|
|
92
|
-
function
|
|
105
|
+
function G(t) {
|
|
93
106
|
return t.map((e) => {
|
|
94
|
-
const
|
|
95
|
-
if (!
|
|
107
|
+
const r = s(e);
|
|
108
|
+
if (!r.role)
|
|
96
109
|
throw new Error(
|
|
97
|
-
`useSemaphorRecords field "${
|
|
110
|
+
`useSemaphorRecords field "${r.name}" needs an explicit role.`
|
|
98
111
|
);
|
|
99
|
-
return
|
|
112
|
+
return r;
|
|
100
113
|
});
|
|
101
114
|
}
|
|
102
|
-
function
|
|
115
|
+
function J(t) {
|
|
103
116
|
return {
|
|
104
117
|
version: 1,
|
|
105
118
|
kind: "inputOptions",
|
|
106
119
|
id: t.id,
|
|
107
120
|
label: t.label,
|
|
108
|
-
source:
|
|
121
|
+
source: k(t),
|
|
109
122
|
field: s(t.field, "dimension"),
|
|
110
123
|
search: t.search,
|
|
111
124
|
limit: t.limit
|
|
112
125
|
};
|
|
113
126
|
}
|
|
114
|
-
function
|
|
127
|
+
function H(t) {
|
|
115
128
|
if ("toAnalyticsInput" in t) {
|
|
116
129
|
const e = t.toAnalyticsInput();
|
|
117
130
|
return {
|
|
@@ -124,17 +137,17 @@ function N(t) {
|
|
|
124
137
|
...t.field ? { field: t.field } : {}
|
|
125
138
|
};
|
|
126
139
|
}
|
|
127
|
-
function
|
|
140
|
+
function gt(t) {
|
|
128
141
|
const e = D(t);
|
|
129
142
|
return e.length > 0 ? e : void 0;
|
|
130
143
|
}
|
|
131
|
-
function
|
|
132
|
-
return (t || []).map(
|
|
144
|
+
function W(t) {
|
|
145
|
+
return (t || []).map(Z);
|
|
133
146
|
}
|
|
134
|
-
function
|
|
135
|
-
return
|
|
147
|
+
function B(t) {
|
|
148
|
+
return W(t).filter((e) => e.isActive);
|
|
136
149
|
}
|
|
137
|
-
function
|
|
150
|
+
function X(t) {
|
|
138
151
|
return t.kind === "filter" ? {
|
|
139
152
|
inputId: t.id,
|
|
140
153
|
kind: t.kind,
|
|
@@ -147,7 +160,7 @@ function Q(t) {
|
|
|
147
160
|
label: t.label
|
|
148
161
|
};
|
|
149
162
|
}
|
|
150
|
-
function
|
|
163
|
+
function Y(t = []) {
|
|
151
164
|
return t.map(
|
|
152
165
|
(e) => typeof e == "object" ? e : {
|
|
153
166
|
label: String(e),
|
|
@@ -155,23 +168,23 @@ function G(t = []) {
|
|
|
155
168
|
}
|
|
156
169
|
);
|
|
157
170
|
}
|
|
158
|
-
function
|
|
171
|
+
function A(t) {
|
|
159
172
|
return t == null ? !1 : Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim().length > 0 : !0;
|
|
160
173
|
}
|
|
161
|
-
function
|
|
174
|
+
function Z(t) {
|
|
162
175
|
return "toAnalyticsInput" in t ? t.toAnalyticsInput() : "kind" in t && "isActive" in t ? t : {
|
|
163
176
|
...t,
|
|
164
177
|
kind: "filter",
|
|
165
|
-
isActive:
|
|
178
|
+
isActive: A(
|
|
166
179
|
t.value
|
|
167
180
|
),
|
|
168
181
|
value: t.value
|
|
169
182
|
};
|
|
170
183
|
}
|
|
171
|
-
function
|
|
184
|
+
function k(t) {
|
|
172
185
|
return t.source;
|
|
173
186
|
}
|
|
174
|
-
function
|
|
187
|
+
function tt(t) {
|
|
175
188
|
var e;
|
|
176
189
|
return !!((e = t.fields) != null && e.length);
|
|
177
190
|
}
|
|
@@ -182,13 +195,13 @@ function s(t, e) {
|
|
|
182
195
|
};
|
|
183
196
|
}
|
|
184
197
|
function D(t) {
|
|
185
|
-
return (t || []).map(
|
|
198
|
+
return (t || []).map(H);
|
|
186
199
|
}
|
|
187
|
-
function
|
|
200
|
+
function et(t) {
|
|
188
201
|
if (t)
|
|
189
202
|
return t;
|
|
190
203
|
}
|
|
191
|
-
function
|
|
204
|
+
function rt() {
|
|
192
205
|
return {
|
|
193
206
|
executeMetric: (t, e) => v(t, e),
|
|
194
207
|
executeRecords: (t, e) => v(t, e),
|
|
@@ -198,7 +211,7 @@ function X() {
|
|
|
198
211
|
async function v(t, e) {
|
|
199
212
|
if (!e.token)
|
|
200
213
|
throw new Error("SemaphorDataAppProvider needs a token to execute queries.");
|
|
201
|
-
const
|
|
214
|
+
const r = await fetch(it(e), {
|
|
202
215
|
method: "POST",
|
|
203
216
|
headers: {
|
|
204
217
|
"Content-Type": "application/json",
|
|
@@ -209,14 +222,14 @@ async function v(t, e) {
|
|
|
209
222
|
activeInputs: e.activeInputs,
|
|
210
223
|
resultShape: t.kind
|
|
211
224
|
})
|
|
212
|
-
}),
|
|
213
|
-
if (!
|
|
225
|
+
}), n = await nt(r);
|
|
226
|
+
if (!r.ok || n.error)
|
|
214
227
|
throw new Error(
|
|
215
|
-
|
|
228
|
+
n.error || `Semaphor Data App execution failed with status ${r.status}.`
|
|
216
229
|
);
|
|
217
|
-
return
|
|
230
|
+
return n;
|
|
218
231
|
}
|
|
219
|
-
async function
|
|
232
|
+
async function nt(t) {
|
|
220
233
|
const e = await t.text().catch(() => "");
|
|
221
234
|
if (!e.trim())
|
|
222
235
|
return t.ok ? {
|
|
@@ -229,163 +242,163 @@ async function Y(t) {
|
|
|
229
242
|
error: "Semaphor Data App execution returned invalid JSON.",
|
|
230
243
|
details: e
|
|
231
244
|
} : {
|
|
232
|
-
error:
|
|
245
|
+
error: ot(t, e),
|
|
233
246
|
details: e
|
|
234
247
|
};
|
|
235
248
|
}
|
|
236
249
|
}
|
|
237
|
-
function
|
|
238
|
-
const
|
|
239
|
-
return
|
|
250
|
+
function ot(t, e) {
|
|
251
|
+
const r = t.statusText ? ` ${t.statusText}` : "", n = e.replace(/\s+/g, " ").trim();
|
|
252
|
+
return n ? `Semaphor Data App execution failed with status ${t.status}${r}: ${n.slice(0, 240)}` : `Semaphor Data App execution failed with status ${t.status}${r}.`;
|
|
240
253
|
}
|
|
241
|
-
function
|
|
242
|
-
const e =
|
|
254
|
+
function it(t) {
|
|
255
|
+
const e = at(t).replace(/\/+$/, "");
|
|
243
256
|
return e ? e.endsWith("/api") ? `${e}/v1/data-app/execute` : `${e}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
|
|
244
257
|
}
|
|
245
|
-
function
|
|
258
|
+
function at(t) {
|
|
246
259
|
if (t.apiBaseUrl)
|
|
247
260
|
return t.apiBaseUrl;
|
|
248
261
|
if (!t.token)
|
|
249
262
|
return "";
|
|
250
263
|
try {
|
|
251
|
-
return
|
|
264
|
+
return T(t.token).apiServiceUrl || "";
|
|
252
265
|
} catch {
|
|
253
266
|
return "";
|
|
254
267
|
}
|
|
255
268
|
}
|
|
256
|
-
const
|
|
257
|
-
function
|
|
269
|
+
const $ = U({});
|
|
270
|
+
function ut() {
|
|
258
271
|
if (!(typeof window > "u"))
|
|
259
272
|
return window.__SEMAPHOR_DATA_APP_RUNTIME__;
|
|
260
273
|
}
|
|
261
|
-
function
|
|
262
|
-
return _(
|
|
274
|
+
function st() {
|
|
275
|
+
return _($);
|
|
263
276
|
}
|
|
264
|
-
function
|
|
277
|
+
function vt({
|
|
265
278
|
token: t,
|
|
266
279
|
apiBaseUrl: e,
|
|
267
|
-
executor:
|
|
268
|
-
children:
|
|
280
|
+
executor: r,
|
|
281
|
+
children: n
|
|
269
282
|
}) {
|
|
270
283
|
var l;
|
|
271
|
-
const
|
|
284
|
+
const o = ut(), a = ((l = o == null ? void 0 : o.authToken) == null ? void 0 : l.accessToken) || t, i = (o == null ? void 0 : o.dataApiBaseUrl) || (o == null ? void 0 : o.apiBaseUrl) || e, p = m(() => rt(), []), u = r || p, c = m(
|
|
272
285
|
() => ({
|
|
273
|
-
token:
|
|
274
|
-
apiBaseUrl:
|
|
286
|
+
token: a,
|
|
287
|
+
apiBaseUrl: i,
|
|
275
288
|
executor: u
|
|
276
289
|
}),
|
|
277
|
-
[
|
|
290
|
+
[i, u, a]
|
|
278
291
|
);
|
|
279
|
-
return /* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ K($.Provider, { value: c, children: n });
|
|
280
293
|
}
|
|
281
|
-
const
|
|
282
|
-
function
|
|
283
|
-
const e =
|
|
294
|
+
const S = { value: null }, lt = { records: [] }, I = { options: [] };
|
|
295
|
+
function dt(t) {
|
|
296
|
+
const e = B(t.inputs);
|
|
284
297
|
try {
|
|
285
|
-
const
|
|
286
|
-
return
|
|
287
|
-
error:
|
|
298
|
+
const r = P(t), n = E(r);
|
|
299
|
+
return n ? {
|
|
300
|
+
error: n,
|
|
288
301
|
activeInputs: e,
|
|
289
|
-
queryKey: d(void 0, e,
|
|
290
|
-
idleData:
|
|
302
|
+
queryKey: d(void 0, e, n),
|
|
303
|
+
idleData: S
|
|
291
304
|
} : {
|
|
292
|
-
intent:
|
|
305
|
+
intent: r,
|
|
293
306
|
error: null,
|
|
294
307
|
activeInputs: e,
|
|
295
|
-
queryKey: d(
|
|
296
|
-
idleData:
|
|
308
|
+
queryKey: d(r, e),
|
|
309
|
+
idleData: S
|
|
297
310
|
};
|
|
298
|
-
} catch (
|
|
299
|
-
const
|
|
311
|
+
} catch (r) {
|
|
312
|
+
const n = y(r);
|
|
300
313
|
return {
|
|
301
|
-
error:
|
|
314
|
+
error: n,
|
|
302
315
|
activeInputs: e,
|
|
303
|
-
queryKey: d(void 0, e,
|
|
304
|
-
idleData:
|
|
316
|
+
queryKey: d(void 0, e, n),
|
|
317
|
+
idleData: S
|
|
305
318
|
};
|
|
306
319
|
}
|
|
307
320
|
}
|
|
308
|
-
function
|
|
309
|
-
const e =
|
|
321
|
+
function ct(t) {
|
|
322
|
+
const e = B(t.inputs), r = lt;
|
|
310
323
|
try {
|
|
311
|
-
const
|
|
312
|
-
return
|
|
313
|
-
error:
|
|
324
|
+
const n = Q(t), o = E(n);
|
|
325
|
+
return o ? {
|
|
326
|
+
error: o,
|
|
314
327
|
activeInputs: e,
|
|
315
|
-
queryKey: d(void 0, e,
|
|
316
|
-
idleData:
|
|
328
|
+
queryKey: d(void 0, e, o),
|
|
329
|
+
idleData: r
|
|
317
330
|
} : {
|
|
318
|
-
intent:
|
|
331
|
+
intent: n,
|
|
319
332
|
error: null,
|
|
320
333
|
activeInputs: e,
|
|
321
|
-
queryKey: d(
|
|
322
|
-
idleData:
|
|
334
|
+
queryKey: d(n, e),
|
|
335
|
+
idleData: r
|
|
323
336
|
};
|
|
324
|
-
} catch (
|
|
325
|
-
const
|
|
337
|
+
} catch (n) {
|
|
338
|
+
const o = y(n);
|
|
326
339
|
return {
|
|
327
|
-
error:
|
|
340
|
+
error: o,
|
|
328
341
|
activeInputs: e,
|
|
329
|
-
queryKey: d(void 0, e,
|
|
330
|
-
idleData:
|
|
342
|
+
queryKey: d(void 0, e, o),
|
|
343
|
+
idleData: r
|
|
331
344
|
};
|
|
332
345
|
}
|
|
333
346
|
}
|
|
334
|
-
function
|
|
347
|
+
function ft(t) {
|
|
335
348
|
try {
|
|
336
|
-
const e =
|
|
337
|
-
return
|
|
338
|
-
error:
|
|
339
|
-
queryKey: d(void 0, void 0,
|
|
340
|
-
idleData:
|
|
349
|
+
const e = J(t), r = E(e);
|
|
350
|
+
return r ? {
|
|
351
|
+
error: r,
|
|
352
|
+
queryKey: d(void 0, void 0, r),
|
|
353
|
+
idleData: I
|
|
341
354
|
} : {
|
|
342
355
|
intent: e,
|
|
343
356
|
error: null,
|
|
344
357
|
queryKey: d(e),
|
|
345
|
-
idleData:
|
|
358
|
+
idleData: I
|
|
346
359
|
};
|
|
347
360
|
} catch (e) {
|
|
348
|
-
const
|
|
361
|
+
const r = y(e);
|
|
349
362
|
return {
|
|
350
|
-
error:
|
|
351
|
-
queryKey: d(void 0, void 0,
|
|
352
|
-
idleData:
|
|
363
|
+
error: r,
|
|
364
|
+
queryKey: d(void 0, void 0, r),
|
|
365
|
+
idleData: I
|
|
353
366
|
};
|
|
354
367
|
}
|
|
355
368
|
}
|
|
356
369
|
function y(t) {
|
|
357
370
|
return t instanceof Error ? t : new Error(String(t));
|
|
358
371
|
}
|
|
359
|
-
function
|
|
372
|
+
function E(t) {
|
|
360
373
|
const e = q(t);
|
|
361
374
|
if (e.ok)
|
|
362
375
|
return null;
|
|
363
|
-
const
|
|
364
|
-
(
|
|
376
|
+
const r = e.errors.map(
|
|
377
|
+
(n) => n.path ? `${n.code} at ${n.path}: ${n.message}` : `${n.code}: ${n.message}`
|
|
365
378
|
).join("; ");
|
|
366
|
-
return new Error(`Invalid Semaphor analytics intent. ${
|
|
379
|
+
return new Error(`Invalid Semaphor analytics intent. ${r}`);
|
|
367
380
|
}
|
|
368
|
-
function d(t, e,
|
|
381
|
+
function d(t, e, r) {
|
|
369
382
|
return JSON.stringify({
|
|
370
383
|
intent: t,
|
|
371
384
|
activeInputs: e,
|
|
372
|
-
error:
|
|
385
|
+
error: r == null ? void 0 : r.message
|
|
373
386
|
});
|
|
374
387
|
}
|
|
375
|
-
function
|
|
376
|
-
const [e,
|
|
377
|
-
() =>
|
|
388
|
+
function St(t) {
|
|
389
|
+
const [e, r] = b(t.defaultValue), n = Object.prototype.hasOwnProperty.call(t, "value"), o = n ? t.value : e, a = m(
|
|
390
|
+
() => Y(t.options),
|
|
378
391
|
[t.options]
|
|
379
|
-
),
|
|
392
|
+
), i = h(
|
|
380
393
|
(u) => {
|
|
381
394
|
var l;
|
|
382
395
|
const c = u;
|
|
383
|
-
(l = t.onValueChange) == null || l.call(t, c),
|
|
396
|
+
(l = t.onValueChange) == null || l.call(t, c), n || r(c);
|
|
384
397
|
},
|
|
385
|
-
[
|
|
386
|
-
),
|
|
387
|
-
return
|
|
388
|
-
const u =
|
|
398
|
+
[n, t]
|
|
399
|
+
), p = h(() => i(void 0), [i]);
|
|
400
|
+
return m(() => {
|
|
401
|
+
const u = X(t);
|
|
389
402
|
return {
|
|
390
403
|
id: t.id,
|
|
391
404
|
kind: t.kind,
|
|
@@ -393,119 +406,119 @@ function mt(t) {
|
|
|
393
406
|
field: u.field,
|
|
394
407
|
operator: u.operator,
|
|
395
408
|
controlRole: t.kind === "control" ? t.role : void 0,
|
|
396
|
-
value:
|
|
397
|
-
options:
|
|
398
|
-
isActive:
|
|
399
|
-
setValue:
|
|
400
|
-
clear:
|
|
409
|
+
value: o,
|
|
410
|
+
options: a,
|
|
411
|
+
isActive: A(o),
|
|
412
|
+
setValue: i,
|
|
413
|
+
clear: p,
|
|
401
414
|
toAnalyticsInput: () => ({
|
|
402
415
|
inputId: u.inputId,
|
|
403
416
|
field: u.field,
|
|
404
417
|
kind: t.kind,
|
|
405
418
|
label: t.label,
|
|
406
|
-
value:
|
|
407
|
-
isActive:
|
|
419
|
+
value: o,
|
|
420
|
+
isActive: A(o),
|
|
408
421
|
operator: u.operator,
|
|
409
422
|
controlRole: t.kind === "control" ? t.role : void 0
|
|
410
423
|
})
|
|
411
424
|
};
|
|
412
|
-
}, [
|
|
425
|
+
}, [p, a, i, t, o]);
|
|
413
426
|
}
|
|
414
|
-
function
|
|
415
|
-
const e =
|
|
416
|
-
(
|
|
417
|
-
var
|
|
418
|
-
return e.intent ? (
|
|
427
|
+
function It(t) {
|
|
428
|
+
const e = m(() => dt(t), [t]), r = h(
|
|
429
|
+
(a) => {
|
|
430
|
+
var i;
|
|
431
|
+
return e.intent ? (i = a.executor) == null ? void 0 : i.executeMetric(e.intent, a) : void 0;
|
|
419
432
|
},
|
|
420
433
|
[e.intent]
|
|
421
|
-
),
|
|
434
|
+
), n = M(
|
|
422
435
|
e.queryKey,
|
|
423
|
-
|
|
436
|
+
r,
|
|
424
437
|
e.idleData,
|
|
425
438
|
e.activeInputs
|
|
426
|
-
),
|
|
439
|
+
), o = e.error ? e.idleData : n.data;
|
|
427
440
|
return {
|
|
428
441
|
id: t.id,
|
|
429
442
|
intent: e.intent,
|
|
430
|
-
value: (
|
|
431
|
-
metrics:
|
|
432
|
-
comparisonValue:
|
|
433
|
-
delta:
|
|
434
|
-
deltaPercent:
|
|
435
|
-
records:
|
|
436
|
-
status: e.error ? "error" :
|
|
437
|
-
isLoading: !e.error &&
|
|
438
|
-
error: e.error ||
|
|
443
|
+
value: (o == null ? void 0 : o.value) ?? null,
|
|
444
|
+
metrics: o == null ? void 0 : o.metrics,
|
|
445
|
+
comparisonValue: o == null ? void 0 : o.comparisonValue,
|
|
446
|
+
delta: o == null ? void 0 : o.delta,
|
|
447
|
+
deltaPercent: o == null ? void 0 : o.deltaPercent,
|
|
448
|
+
records: o == null ? void 0 : o.records,
|
|
449
|
+
status: e.error ? "error" : n.status,
|
|
450
|
+
isLoading: !e.error && n.status === "loading",
|
|
451
|
+
error: e.error || n.error
|
|
439
452
|
};
|
|
440
453
|
}
|
|
441
|
-
function
|
|
442
|
-
const e =
|
|
443
|
-
(
|
|
444
|
-
var
|
|
445
|
-
return e.intent ? (
|
|
454
|
+
function At(t) {
|
|
455
|
+
const e = m(() => ct(t), [t]), r = h(
|
|
456
|
+
(a) => {
|
|
457
|
+
var i;
|
|
458
|
+
return e.intent ? (i = a.executor) == null ? void 0 : i.executeRecords(e.intent, a) : void 0;
|
|
446
459
|
},
|
|
447
460
|
[e.intent]
|
|
448
|
-
),
|
|
461
|
+
), n = M(
|
|
449
462
|
e.queryKey,
|
|
450
|
-
|
|
463
|
+
r,
|
|
451
464
|
e.idleData,
|
|
452
465
|
e.activeInputs
|
|
453
|
-
),
|
|
466
|
+
), o = e.error ? e.idleData : n.data;
|
|
454
467
|
return {
|
|
455
468
|
id: t.id,
|
|
456
469
|
intent: e.intent,
|
|
457
|
-
records: (
|
|
458
|
-
columns:
|
|
459
|
-
rowCount:
|
|
460
|
-
status: e.error ? "error" :
|
|
461
|
-
isLoading: !e.error &&
|
|
462
|
-
error: e.error ||
|
|
470
|
+
records: (o == null ? void 0 : o.records) || [],
|
|
471
|
+
columns: o == null ? void 0 : o.columns,
|
|
472
|
+
rowCount: o == null ? void 0 : o.rowCount,
|
|
473
|
+
status: e.error ? "error" : n.status,
|
|
474
|
+
isLoading: !e.error && n.status === "loading",
|
|
475
|
+
error: e.error || n.error
|
|
463
476
|
};
|
|
464
477
|
}
|
|
465
|
-
function
|
|
466
|
-
const e =
|
|
467
|
-
(
|
|
468
|
-
var
|
|
469
|
-
return e.intent ? (
|
|
478
|
+
function kt(t) {
|
|
479
|
+
const e = m(() => ft(t), [t]), r = h(
|
|
480
|
+
(a) => {
|
|
481
|
+
var i;
|
|
482
|
+
return e.intent ? (i = a.executor) == null ? void 0 : i.executeInputOptions(e.intent, a) : void 0;
|
|
470
483
|
},
|
|
471
484
|
[e.intent]
|
|
472
|
-
),
|
|
485
|
+
), n = M(
|
|
473
486
|
e.queryKey,
|
|
474
|
-
|
|
487
|
+
r,
|
|
475
488
|
e.idleData
|
|
476
|
-
),
|
|
489
|
+
), o = e.error ? e.idleData : n.data;
|
|
477
490
|
return {
|
|
478
491
|
id: t.id,
|
|
479
492
|
intent: e.intent,
|
|
480
|
-
options: (
|
|
481
|
-
status: e.error ? "error" :
|
|
482
|
-
isLoading: !e.error &&
|
|
483
|
-
error: e.error ||
|
|
493
|
+
options: (o == null ? void 0 : o.options) || [],
|
|
494
|
+
status: e.error ? "error" : n.status,
|
|
495
|
+
isLoading: !e.error && n.status === "loading",
|
|
496
|
+
error: e.error || n.error
|
|
484
497
|
};
|
|
485
498
|
}
|
|
486
|
-
function
|
|
487
|
-
const
|
|
499
|
+
function M(t, e, r, n) {
|
|
500
|
+
const o = st(), a = R(e), i = R(n), [p, u] = b({
|
|
488
501
|
status: "idle",
|
|
489
|
-
data:
|
|
502
|
+
data: r,
|
|
490
503
|
error: null
|
|
491
504
|
});
|
|
492
|
-
return
|
|
505
|
+
return a.current = e, i.current = n, C(() => {
|
|
493
506
|
let c;
|
|
494
507
|
try {
|
|
495
|
-
c =
|
|
496
|
-
...
|
|
497
|
-
activeInputs:
|
|
508
|
+
c = a.current({
|
|
509
|
+
...o,
|
|
510
|
+
activeInputs: i.current
|
|
498
511
|
});
|
|
499
512
|
} catch (f) {
|
|
500
513
|
u({
|
|
501
514
|
status: "error",
|
|
502
|
-
data:
|
|
515
|
+
data: r,
|
|
503
516
|
error: y(f)
|
|
504
517
|
});
|
|
505
518
|
return;
|
|
506
519
|
}
|
|
507
520
|
if (!c) {
|
|
508
|
-
u({ status: "idle", data:
|
|
521
|
+
u({ status: "idle", data: r, error: null });
|
|
509
522
|
return;
|
|
510
523
|
}
|
|
511
524
|
let l = !1;
|
|
@@ -518,32 +531,32 @@ function E(t, e, n, o) {
|
|
|
518
531
|
}).catch((f) => {
|
|
519
532
|
l || u({
|
|
520
533
|
status: "error",
|
|
521
|
-
data:
|
|
534
|
+
data: r,
|
|
522
535
|
error: y(f)
|
|
523
536
|
});
|
|
524
537
|
}), () => {
|
|
525
538
|
l = !0;
|
|
526
539
|
};
|
|
527
|
-
}, [
|
|
540
|
+
}, [r, t, o]), p;
|
|
528
541
|
}
|
|
529
542
|
export {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
543
|
+
$ as SemaphorDataAppContext,
|
|
544
|
+
vt as SemaphorDataAppProvider,
|
|
545
|
+
rt as createSemaphorQueryExecutor,
|
|
546
|
+
A as hasSemaphorInputValue,
|
|
547
|
+
Y as normalizeSemaphorInputOptions,
|
|
548
|
+
ut as readWindowRuntime,
|
|
549
|
+
B as toSemaphorActiveInputSnapshots,
|
|
550
|
+
H as toSemaphorInputBinding,
|
|
551
|
+
gt as toSemaphorInputBindings,
|
|
552
|
+
J as toSemaphorInputOptionsIntent,
|
|
553
|
+
W as toSemaphorInputSnapshots,
|
|
554
|
+
X as toSemaphorInputSpec,
|
|
555
|
+
P as toSemaphorMetricIntent,
|
|
556
|
+
Q as toSemaphorRecordsIntent,
|
|
557
|
+
st as useSemaphorDataAppRuntime,
|
|
558
|
+
St as useSemaphorInput,
|
|
559
|
+
kt as useSemaphorInputOptions,
|
|
560
|
+
It as useSemaphorMetric,
|
|
561
|
+
At as useSemaphorRecords
|
|
549
562
|
};
|