react-semaphor 0.1.326 → 0.1.328

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +1 -1
  3. package/dist/brand-studio/index.cjs +5 -5
  4. package/dist/brand-studio/index.js +23 -24
  5. package/dist/chunks/_commonjsHelpers-BVfed4GL.js +28 -0
  6. package/dist/chunks/_commonjsHelpers-DwTZ_eVU.js +1 -0
  7. package/dist/chunks/{braces-DVaMJoCd.js → braces-CG8viaD2.js} +1 -1
  8. package/dist/chunks/{braces-dHeaioTd.js → braces-DSaa_4Oc.js} +1 -1
  9. package/dist/chunks/{calendar-preferences-dialog-mqU_uOmY.js → calendar-preferences-dialog-DD_qAthL.js} +1 -1
  10. package/dist/chunks/{calendar-preferences-dialog--2jD-eKu.js → calendar-preferences-dialog-JRmNJptJ.js} +3 -3
  11. package/dist/chunks/{chevrons-up-down-DNQE-uEp.js → chevrons-up-down-CBa0uh0X.js} +1 -1
  12. package/dist/chunks/{chevrons-up-down-CLbzBHoI.js → chevrons-up-down-ChDNqVP7.js} +1 -1
  13. package/dist/chunks/dashboard-briefing-launcher-BKdJFwH5.js +106 -0
  14. package/dist/chunks/{dashboard-briefing-launcher-DsjXUPFq.js → dashboard-briefing-launcher-BfyNkd8i.js} +1106 -1108
  15. package/dist/chunks/{dashboard-controls-DgNkM1yT.js → dashboard-controls-0pZDLvFL.js} +218 -218
  16. package/dist/chunks/{dashboard-controls-XCa9PZuU.js → dashboard-controls-C0xm1QMR.js} +10 -10
  17. package/dist/chunks/dashboard-json-BW5OVZ6m.js +1 -0
  18. package/dist/chunks/{dashboard-json-DkA6Bf0Y.js → dashboard-json-DsruhRPD.js} +14 -13
  19. package/dist/chunks/date-formatter-B4EBSe9C.js +1 -0
  20. package/dist/chunks/date-formatter-CzcPZx39.js +416 -0
  21. package/dist/chunks/edit-dashboard-visual-DQyJ7SSv.js +178 -0
  22. package/dist/chunks/{edit-dashboard-visual-Q5hW5MXk.js → edit-dashboard-visual-g5SZZahJ.js} +8242 -7784
  23. package/dist/chunks/index-1JWDPCun.js +1935 -0
  24. package/dist/chunks/index-BdjXTQt4.js +1444 -0
  25. package/dist/chunks/{index-DwfDwtv2.js → index-BmKr-K7J.js} +117670 -113627
  26. package/dist/chunks/index-C1l78BIx.js +3247 -0
  27. package/dist/chunks/lib-Ce3zosXY.js +38 -0
  28. package/dist/chunks/lib-DFvr9fM4.js +5500 -0
  29. package/dist/chunks/{palette-DtmNws9a.js → palette-D0YmAqBS.js} +1 -1
  30. package/dist/chunks/{palette-DpcvHAiY.js → palette-DQgq3edH.js} +1 -1
  31. package/dist/chunks/{resource-management-panel-CGwWKZOP.js → resource-management-panel-CIfBh46E.js} +1 -1
  32. package/dist/chunks/{resource-management-panel-D2oAQkKi.js → resource-management-panel-Cj19pw9M.js} +145 -145
  33. package/dist/chunks/switch-BvTzw2AW.js +173 -0
  34. package/dist/chunks/{switch-j3AThLFk.js → switch-De31SR3q.js} +2752 -2717
  35. package/dist/chunks/typescript-Cmizj1hi.js +446 -0
  36. package/dist/chunks/typescript-H1EwZsOb.js +159820 -0
  37. package/dist/chunks/use-create-flow-overlay-state-BTQiKRD1.js +26 -0
  38. package/dist/chunks/{use-create-flow-overlay-state-CP6GDQAX.js → use-create-flow-overlay-state-IcHP0l39.js} +150 -151
  39. package/dist/chunks/{use-visual-utils-CSXU-96k.js → use-visual-utils-DQ5zGYD2.js} +13 -13
  40. package/dist/chunks/{use-visual-utils-NpOW5uZ1.js → use-visual-utils-XF-AqV8o.js} +1 -1
  41. package/dist/chunks/{validators-DvTxl9i0.js → validators-DDAweCzB.js} +67 -48
  42. package/dist/chunks/validators-odlRJblR.js +2 -0
  43. package/dist/dashboard/index.cjs +1 -1
  44. package/dist/dashboard/index.js +1 -1
  45. package/dist/dashboard-authoring/index.cjs +3 -3
  46. package/dist/dashboard-authoring/index.js +907 -527
  47. package/dist/data-app-builder/index.cjs +1 -0
  48. package/dist/data-app-builder/index.js +4 -0
  49. package/dist/data-app-builder-browser-runtime/index.cjs +1 -0
  50. package/dist/data-app-builder-browser-runtime/index.js +10 -0
  51. package/dist/data-app-sdk/index.cjs +1 -1
  52. package/dist/data-app-sdk/index.js +208 -196
  53. package/dist/format-utils/index.cjs +4 -4
  54. package/dist/format-utils/index.js +22 -21
  55. package/dist/index.cjs +1 -1
  56. package/dist/index.js +14 -14
  57. package/dist/style.css +1 -1
  58. package/dist/surfboard/index.cjs +1 -1
  59. package/dist/surfboard/index.js +2 -2
  60. package/dist/types/analytics-protocol.d.ts +1 -0
  61. package/dist/types/dashboard-authoring.d.ts +79 -2
  62. package/dist/types/dashboard.d.ts +17 -2
  63. package/dist/types/data-app-builder-browser-runtime.d.ts +185 -0
  64. package/dist/types/data-app-builder.d.ts +630 -0
  65. package/dist/types/data-app-sdk.d.ts +15 -1
  66. package/dist/types/format-utils.d.ts +25 -0
  67. package/dist/types/main.d.ts +67 -10
  68. package/dist/types/shared.d.ts +17 -2
  69. package/dist/types/surfboard.d.ts +17 -2
  70. package/dist/types/types.d.ts +32 -3
  71. package/package.json +11 -1
  72. package/dist/chunks/dashboard-briefing-launcher-DguNfFr8.js +0 -106
  73. package/dist/chunks/dashboard-json-DiBd65Xf.js +0 -1
  74. package/dist/chunks/date-formatter-D9Bvw5Qk.js +0 -1
  75. package/dist/chunks/date-formatter-DyIOb6uC.js +0 -333
  76. package/dist/chunks/edit-dashboard-visual-BC9eOc4U.js +0 -178
  77. package/dist/chunks/index-B1-46PoR.js +0 -1303
  78. package/dist/chunks/save-BY7WF62U.js +0 -21
  79. package/dist/chunks/save-Cv_XRb94.js +0 -6
  80. package/dist/chunks/switch-5aQ_jcLH.js +0 -168
  81. package/dist/chunks/use-create-flow-overlay-state-BQPXP0AM.js +0 -26
  82. package/dist/chunks/validators-DJUMR5An.js +0 -2
@@ -1,31 +1,31 @@
1
- import { j as x } from "../chunks/index-CuHybtft.js";
2
- import { jsx as $ } from "react/jsx-runtime";
3
- import { createContext as O, useMemo as f, useContext as K, useState as q, useCallback as p, useRef as E, useEffect as C } from "react";
4
- import { v as B } from "../chunks/validators-DvTxl9i0.js";
5
- function T(t) {
1
+ import { j as $ } from "../chunks/index-CuHybtft.js";
2
+ import { createContext as w, useContext as O, useMemo as p, useState as x, useCallback as h, useRef as b, useEffect as _ } from "react";
3
+ import { jsx as B } from "react/jsx-runtime";
4
+ import { v as T } from "../chunks/validators-DDAweCzB.js";
5
+ function K(t) {
6
6
  var r;
7
7
  return {
8
8
  version: 1,
9
9
  kind: "metric",
10
10
  id: t.id,
11
11
  label: t.label,
12
- source: g(t),
12
+ source: k(t),
13
13
  metric: t.metric,
14
14
  metrics: t.metrics,
15
- dateField: t.dateField ? d(t.dateField, "date") : void 0,
15
+ dateField: t.dateField ? f(t.dateField, "date") : void 0,
16
16
  timeGrain: t.timeGrain,
17
- dimensions: (r = t.dimensions) == null ? void 0 : r.map((n) => d(n, "dimension")),
17
+ dimensions: (r = t.dimensions) == null ? void 0 : r.map((o) => f(o, "dimension")),
18
18
  comparison: Q(t.comparison),
19
- inputs: D(t.inputs),
19
+ inputs: g(t.inputs),
20
20
  limit: t.limit
21
21
  };
22
22
  }
23
- function _(t) {
23
+ function C(t) {
24
24
  if ("sort" in t)
25
25
  throw new Error(
26
26
  "useSemaphorRecords supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet."
27
27
  );
28
- if (!L(t))
28
+ if (!j(t))
29
29
  throw new Error(
30
30
  "useSemaphorRecords needs at least one field, dimension, or measure."
31
31
  );
@@ -39,29 +39,29 @@ function _(t) {
39
39
  kind: "records",
40
40
  id: t.id,
41
41
  label: t.label,
42
- source: g(t),
42
+ source: k(t),
43
43
  fields: r,
44
44
  measures: t.measures,
45
- dateField: t.dateField ? d(t.dateField, "date") : void 0,
45
+ dateField: t.dateField ? f(t.dateField, "date") : void 0,
46
46
  timeGrain: t.timeGrain,
47
47
  orderBy: t.orderBy,
48
- inputs: D(t.inputs),
48
+ inputs: g(t.inputs),
49
49
  limit: t.limit
50
50
  };
51
51
  }
52
- function F(t) {
52
+ function P(t) {
53
53
  return {
54
54
  version: 1,
55
55
  kind: "inputOptions",
56
56
  id: t.id,
57
57
  label: t.label,
58
- source: g(t),
59
- field: d(t.field, "dimension"),
58
+ source: k(t),
59
+ field: f(t.field, "dimension"),
60
60
  search: t.search,
61
61
  limit: t.limit
62
62
  };
63
63
  }
64
- function M(t) {
64
+ function U(t) {
65
65
  if ("toAnalyticsInput" in t) {
66
66
  const r = t.toAnalyticsInput();
67
67
  return {
@@ -74,22 +74,22 @@ function M(t) {
74
74
  field: t.field
75
75
  };
76
76
  }
77
- function ut(t) {
78
- const r = D(t);
77
+ function st(t) {
78
+ const r = g(t);
79
79
  return r.length > 0 ? r : void 0;
80
80
  }
81
- function N(t) {
82
- return (t || []).map(V);
81
+ function M(t) {
82
+ return (t || []).map(F);
83
83
  }
84
- function w(t) {
85
- return N(t).filter((r) => r.isActive);
84
+ function R(t) {
85
+ return M(t).filter((r) => r.isActive);
86
86
  }
87
- function P(t) {
87
+ function N(t) {
88
88
  return t.kind === "filter" ? {
89
89
  inputId: t.id,
90
90
  kind: t.kind,
91
91
  label: t.label,
92
- field: d(t.field, "dimension"),
92
+ field: f(t.field, "dimension"),
93
93
  operator: t.operator || "in",
94
94
  source: t.source
95
95
  } : {
@@ -98,7 +98,7 @@ function P(t) {
98
98
  label: t.label
99
99
  };
100
100
  }
101
- function j(t = []) {
101
+ function V(t = []) {
102
102
  return t.map(
103
103
  (r) => typeof r == "object" ? r : {
104
104
  label: String(r),
@@ -109,7 +109,7 @@ function j(t = []) {
109
109
  function A(t) {
110
110
  return t == null ? !1 : Array.isArray(t) ? t.length > 0 : typeof t == "string" ? t.trim().length > 0 : !0;
111
111
  }
112
- function V(t) {
112
+ function F(t) {
113
113
  return "toAnalyticsInput" in t ? t.toAnalyticsInput() : "kind" in t && "isActive" in t ? t : {
114
114
  ...t,
115
115
  kind: "filter",
@@ -119,7 +119,7 @@ function V(t) {
119
119
  value: t.value
120
120
  };
121
121
  }
122
- function g(t) {
122
+ function k(t) {
123
123
  if ("source" in t && t.source)
124
124
  return t.source;
125
125
  const r = t.datasetName || t.dataset;
@@ -134,28 +134,28 @@ function g(t) {
134
134
  label: t.sourceLabel
135
135
  };
136
136
  }
137
- function L(t) {
138
- var r, n, e;
139
- return !!((r = t.fields) != null && r.length || (n = t.dimensions) != null && n.length || (e = t.measures) != null && e.length);
137
+ function j(t) {
138
+ var r, o, n;
139
+ return !!((r = t.fields) != null && r.length || (o = t.dimensions) != null && o.length || (n = t.measures) != null && n.length);
140
140
  }
141
- function U(t) {
141
+ function L(t) {
142
142
  return !!(t != null && t.length);
143
143
  }
144
- function z(t, r, n) {
145
- const e = [], o = /* @__PURE__ */ new Set(), a = (i) => {
146
- const l = `${i.role || ""}:${i.name}`;
147
- o.has(l) || (o.add(l), e.push(i));
144
+ function z(t, r, o) {
145
+ const n = [], e = /* @__PURE__ */ new Set(), a = (i) => {
146
+ const s = `${i.role || ""}:${i.name}`;
147
+ e.has(s) || (e.add(s), n.push(i));
148
148
  };
149
- return U(t) && t.map((i) => d(i)).forEach(a), r == null || r.map((i) => d(i, "dimension")).forEach(a), n == null || n.map((i) => d(i, "measure")).forEach(a), e;
149
+ return L(t) && t.map((i) => f(i)).forEach(a), r == null || r.map((i) => f(i, "dimension")).forEach(a), o == null || o.map((i) => f(i, "measure")).forEach(a), n;
150
150
  }
151
- function d(t, r) {
151
+ function f(t, r) {
152
152
  return typeof t == "string" ? r ? { name: t, role: r } : { name: t } : {
153
153
  ...t,
154
154
  role: t.role || r
155
155
  };
156
156
  }
157
- function D(t) {
158
- return (t || []).map(M);
157
+ function g(t) {
158
+ return (t || []).map(U);
159
159
  }
160
160
  function Q(t) {
161
161
  if (!(!t || t === "none"))
@@ -171,7 +171,7 @@ function G() {
171
171
  async function v(t, r) {
172
172
  if (!r.token)
173
173
  throw new Error("SemaphorDataAppProvider needs a token to execute queries.");
174
- const n = await fetch(W(r), {
174
+ const o = await fetch(W(r), {
175
175
  method: "POST",
176
176
  headers: {
177
177
  "Content-Type": "application/json",
@@ -182,24 +182,24 @@ async function v(t, r) {
182
182
  activeInputs: r.activeInputs,
183
183
  resultShape: t.kind
184
184
  })
185
- }), e = await J(n);
186
- if (!n.ok || e.error)
185
+ }), n = await J(o);
186
+ if (!o.ok || n.error)
187
187
  throw new Error(
188
- e.error || `Semaphor Data App query failed with status ${n.status}.`
188
+ n.error || `Semaphor Data App execution failed with status ${o.status}.`
189
189
  );
190
- return e;
190
+ return n;
191
191
  }
192
192
  async function J(t) {
193
193
  const r = await t.text().catch(() => "");
194
194
  if (!r.trim())
195
195
  return t.ok ? {
196
- error: "Semaphor Data App query returned an empty response."
196
+ error: "Semaphor Data App execution returned an empty response."
197
197
  } : {};
198
198
  try {
199
199
  return JSON.parse(r);
200
200
  } catch {
201
201
  return t.ok ? {
202
- error: "Semaphor Data App query returned invalid JSON.",
202
+ error: "Semaphor Data App execution returned invalid JSON.",
203
203
  details: r
204
204
  } : {
205
205
  error: H(t, r),
@@ -208,12 +208,12 @@ async function J(t) {
208
208
  }
209
209
  }
210
210
  function H(t, r) {
211
- const n = t.statusText ? ` ${t.statusText}` : "", e = r.replace(/\s+/g, " ").trim();
212
- return e ? `Semaphor Data App query failed with status ${t.status}${n}: ${e.slice(0, 240)}` : `Semaphor Data App query failed with status ${t.status}${n}.`;
211
+ const o = t.statusText ? ` ${t.statusText}` : "", n = r.replace(/\s+/g, " ").trim();
212
+ return n ? `Semaphor Data App execution failed with status ${t.status}${o}: ${n.slice(0, 240)}` : `Semaphor Data App execution failed with status ${t.status}${o}.`;
213
213
  }
214
214
  function W(t) {
215
215
  const r = X(t).replace(/\/+$/, "");
216
- return r ? r.endsWith("/api") ? `${r}/v1/data-app/query` : `${r}/api/v1/data-app/query` : "/api/v1/data-app/query";
216
+ return r ? r.endsWith("/api") ? `${r}/v1/data-app/execute` : `${r}/api/v1/data-app/execute` : "/api/v1/data-app/execute";
217
217
  }
218
218
  function X(t) {
219
219
  if (t.apiBaseUrl)
@@ -221,134 +221,144 @@ function X(t) {
221
221
  if (!t.token)
222
222
  return "";
223
223
  try {
224
- return x(t.token).apiServiceUrl || "";
224
+ return $(t.token).apiServiceUrl || "";
225
225
  } catch {
226
226
  return "";
227
227
  }
228
228
  }
229
- const R = O({});
230
- function st({
229
+ const q = w({});
230
+ function Y() {
231
+ if (!(typeof window > "u"))
232
+ return window.__SEMAPHOR_DATA_APP_RUNTIME__;
233
+ }
234
+ function Z() {
235
+ return O(q);
236
+ }
237
+ function dt({
231
238
  token: t,
232
239
  apiBaseUrl: r,
233
- executor: n,
234
- children: e
240
+ executor: o,
241
+ children: n
235
242
  }) {
236
- const o = f(() => G(), []), a = n || o, i = f(
237
- () => ({ token: t, apiBaseUrl: r, executor: a }),
238
- [r, a, t]
243
+ var d;
244
+ const e = Y(), a = ((d = e == null ? void 0 : e.authToken) == null ? void 0 : d.accessToken) || t, i = (e == null ? void 0 : e.dataApiBaseUrl) || (e == null ? void 0 : e.apiBaseUrl) || r, s = p(() => G(), []), u = o || s, c = p(
245
+ () => ({
246
+ token: a,
247
+ apiBaseUrl: i,
248
+ executor: u
249
+ }),
250
+ [i, u, a]
239
251
  );
240
- return /* @__PURE__ */ $(R.Provider, { value: i, children: e });
241
- }
242
- function Y() {
243
- return K(R);
252
+ return /* @__PURE__ */ B(q.Provider, { value: c, children: n });
244
253
  }
245
- const I = { value: null }, Z = { records: [] }, S = { options: [] };
246
- function tt(t) {
247
- const r = w(t.inputs);
254
+ const I = { value: null }, tt = { records: [] }, S = { options: [] };
255
+ function rt(t) {
256
+ const r = R(t.inputs);
248
257
  try {
249
- const n = T(t), e = k(n);
250
- return e ? {
251
- error: e,
258
+ const o = K(t), n = D(o);
259
+ return n ? {
260
+ error: n,
252
261
  activeInputs: r,
253
- queryKey: s(void 0, r, e),
262
+ queryKey: l(void 0, r, n),
254
263
  idleData: I
255
264
  } : {
256
- intent: n,
265
+ intent: o,
257
266
  error: null,
258
267
  activeInputs: r,
259
- queryKey: s(n, r),
268
+ queryKey: l(o, r),
260
269
  idleData: I
261
270
  };
262
- } catch (n) {
263
- const e = h(n);
271
+ } catch (o) {
272
+ const n = y(o);
264
273
  return {
265
- error: e,
274
+ error: n,
266
275
  activeInputs: r,
267
- queryKey: s(void 0, r, e),
276
+ queryKey: l(void 0, r, n),
268
277
  idleData: I
269
278
  };
270
279
  }
271
280
  }
272
- function rt(t) {
273
- const r = w(t.inputs), n = Z;
281
+ function et(t) {
282
+ const r = R(t.inputs), o = tt;
274
283
  try {
275
- const e = _(t), o = k(e);
276
- return o ? {
277
- error: o,
284
+ const n = C(t), e = D(n);
285
+ return e ? {
286
+ error: e,
278
287
  activeInputs: r,
279
- queryKey: s(void 0, r, o),
280
- idleData: n
288
+ queryKey: l(void 0, r, e),
289
+ idleData: o
281
290
  } : {
282
- intent: e,
291
+ intent: n,
283
292
  error: null,
284
293
  activeInputs: r,
285
- queryKey: s(e, r),
286
- idleData: n
294
+ queryKey: l(n, r),
295
+ idleData: o
287
296
  };
288
- } catch (e) {
289
- const o = h(e);
297
+ } catch (n) {
298
+ const e = y(n);
290
299
  return {
291
- error: o,
300
+ error: e,
292
301
  activeInputs: r,
293
- queryKey: s(void 0, r, o),
294
- idleData: n
302
+ queryKey: l(void 0, r, e),
303
+ idleData: o
295
304
  };
296
305
  }
297
306
  }
298
- function et(t) {
307
+ function nt(t) {
299
308
  try {
300
- const r = F(t), n = k(r);
301
- return n ? {
302
- error: n,
303
- queryKey: s(void 0, void 0, n),
309
+ const r = P(t), o = D(r);
310
+ return o ? {
311
+ error: o,
312
+ queryKey: l(void 0, void 0, o),
304
313
  idleData: S
305
314
  } : {
306
315
  intent: r,
307
316
  error: null,
308
- queryKey: s(r),
317
+ queryKey: l(r),
309
318
  idleData: S
310
319
  };
311
320
  } catch (r) {
312
- const n = h(r);
321
+ const o = y(r);
313
322
  return {
314
- error: n,
315
- queryKey: s(void 0, void 0, n),
323
+ error: o,
324
+ queryKey: l(void 0, void 0, o),
316
325
  idleData: S
317
326
  };
318
327
  }
319
328
  }
320
- function h(t) {
329
+ function y(t) {
321
330
  return t instanceof Error ? t : new Error(String(t));
322
331
  }
323
- function k(t) {
324
- const r = B(t);
332
+ function D(t) {
333
+ const r = T(t);
325
334
  if (r.ok)
326
335
  return null;
327
- const n = r.errors.map(
328
- (e) => e.path ? `${e.code} at ${e.path}: ${e.message}` : `${e.code}: ${e.message}`
336
+ const o = r.errors.map(
337
+ (n) => n.path ? `${n.code} at ${n.path}: ${n.message}` : `${n.code}: ${n.message}`
329
338
  ).join("; ");
330
- return new Error(`Invalid Semaphor analytics intent. ${n}`);
339
+ return new Error(`Invalid Semaphor analytics intent. ${o}`);
331
340
  }
332
- function s(t, r, n) {
341
+ function l(t, r, o) {
333
342
  return JSON.stringify({
334
343
  intent: t,
335
344
  activeInputs: r,
336
- error: n == null ? void 0 : n.message
345
+ error: o == null ? void 0 : o.message
337
346
  });
338
347
  }
339
- function dt(t) {
340
- const [r, n] = q(t.defaultValue), e = Object.prototype.hasOwnProperty.call(t, "value"), o = e ? t.value : r, a = f(
341
- () => j(t.options),
348
+ function lt(t) {
349
+ const [r, o] = x(t.defaultValue), n = Object.prototype.hasOwnProperty.call(t, "value"), e = n ? t.value : r, a = p(
350
+ () => V(t.options),
342
351
  [t.options]
343
- ), i = p(
352
+ ), i = h(
344
353
  (u) => {
345
- var m;
346
- (m = t.onValueChange) == null || m.call(t, u), e || n(u);
354
+ var d;
355
+ const c = u;
356
+ (d = t.onValueChange) == null || d.call(t, c), n || o(c);
347
357
  },
348
- [e, t]
349
- ), l = p(() => i(void 0), [i]);
350
- return f(() => {
351
- const u = P(t);
358
+ [n, t]
359
+ ), s = h(() => i(void 0), [i]);
360
+ return p(() => {
361
+ const u = N(t);
352
362
  return {
353
363
  id: t.id,
354
364
  kind: t.kind,
@@ -357,156 +367,158 @@ function dt(t) {
357
367
  operator: u.operator,
358
368
  source: u.source,
359
369
  controlRole: t.kind === "control" ? t.role : void 0,
360
- value: o,
370
+ value: e,
361
371
  options: a,
362
- isActive: A(o),
372
+ isActive: A(e),
363
373
  setValue: i,
364
- clear: l,
374
+ clear: s,
365
375
  toAnalyticsInput: () => ({
366
376
  inputId: u.inputId,
367
377
  field: u.field,
368
378
  kind: t.kind,
369
379
  label: t.label,
370
- value: o,
371
- isActive: A(o),
380
+ value: e,
381
+ isActive: A(e),
372
382
  operator: u.operator,
373
383
  source: u.source,
374
384
  controlRole: t.kind === "control" ? t.role : void 0
375
385
  })
376
386
  };
377
- }, [l, a, i, t, o]);
387
+ }, [s, a, i, t, e]);
378
388
  }
379
- function lt(t) {
380
- const r = f(() => tt(t), [t]), n = p(
389
+ function ct(t) {
390
+ const r = p(() => rt(t), [t]), o = h(
381
391
  (a) => {
382
392
  var i;
383
393
  return r.intent ? (i = a.executor) == null ? void 0 : i.executeMetric(r.intent, a) : void 0;
384
394
  },
385
395
  [r.intent]
386
- ), e = b(
396
+ ), n = E(
387
397
  r.queryKey,
388
- n,
398
+ o,
389
399
  r.idleData,
390
400
  r.activeInputs
391
- ), o = r.error ? r.idleData : e.data;
401
+ ), e = r.error ? r.idleData : n.data;
392
402
  return {
393
403
  id: t.id,
394
404
  intent: r.intent,
395
- value: (o == null ? void 0 : o.value) ?? null,
396
- metrics: o == null ? void 0 : o.metrics,
397
- comparisonValue: o == null ? void 0 : o.comparisonValue,
398
- delta: o == null ? void 0 : o.delta,
399
- deltaPercent: o == null ? void 0 : o.deltaPercent,
400
- records: o == null ? void 0 : o.records,
401
- status: r.error ? "error" : e.status,
402
- isLoading: !r.error && e.status === "loading",
403
- error: r.error || e.error
405
+ value: (e == null ? void 0 : e.value) ?? null,
406
+ metrics: e == null ? void 0 : e.metrics,
407
+ comparisonValue: e == null ? void 0 : e.comparisonValue,
408
+ delta: e == null ? void 0 : e.delta,
409
+ deltaPercent: e == null ? void 0 : e.deltaPercent,
410
+ records: e == null ? void 0 : e.records,
411
+ status: r.error ? "error" : n.status,
412
+ isLoading: !r.error && n.status === "loading",
413
+ error: r.error || n.error
404
414
  };
405
415
  }
406
- function ct(t) {
407
- const r = f(() => rt(t), [t]), n = p(
416
+ function ft(t) {
417
+ const r = p(() => et(t), [t]), o = h(
408
418
  (a) => {
409
419
  var i;
410
420
  return r.intent ? (i = a.executor) == null ? void 0 : i.executeRecords(r.intent, a) : void 0;
411
421
  },
412
422
  [r.intent]
413
- ), e = b(
423
+ ), n = E(
414
424
  r.queryKey,
415
- n,
425
+ o,
416
426
  r.idleData,
417
427
  r.activeInputs
418
- ), o = r.error ? r.idleData : e.data;
428
+ ), e = r.error ? r.idleData : n.data;
419
429
  return {
420
430
  id: t.id,
421
431
  intent: r.intent,
422
- records: (o == null ? void 0 : o.records) || [],
423
- columns: o == null ? void 0 : o.columns,
424
- rowCount: o == null ? void 0 : o.rowCount,
425
- status: r.error ? "error" : e.status,
426
- isLoading: !r.error && e.status === "loading",
427
- error: r.error || e.error
432
+ records: (e == null ? void 0 : e.records) || [],
433
+ columns: e == null ? void 0 : e.columns,
434
+ rowCount: e == null ? void 0 : e.rowCount,
435
+ status: r.error ? "error" : n.status,
436
+ isLoading: !r.error && n.status === "loading",
437
+ error: r.error || n.error
428
438
  };
429
439
  }
430
- function ft(t) {
431
- const r = f(() => et(t), [t]), n = p(
440
+ function mt(t) {
441
+ const r = p(() => nt(t), [t]), o = h(
432
442
  (a) => {
433
443
  var i;
434
444
  return r.intent ? (i = a.executor) == null ? void 0 : i.executeInputOptions(r.intent, a) : void 0;
435
445
  },
436
446
  [r.intent]
437
- ), e = b(
447
+ ), n = E(
438
448
  r.queryKey,
439
- n,
449
+ o,
440
450
  r.idleData
441
- ), o = r.error ? r.idleData : e.data;
451
+ ), e = r.error ? r.idleData : n.data;
442
452
  return {
443
453
  id: t.id,
444
454
  intent: r.intent,
445
- options: (o == null ? void 0 : o.options) || [],
446
- status: r.error ? "error" : e.status,
447
- isLoading: !r.error && e.status === "loading",
448
- error: r.error || e.error
455
+ options: (e == null ? void 0 : e.options) || [],
456
+ status: r.error ? "error" : n.status,
457
+ isLoading: !r.error && n.status === "loading",
458
+ error: r.error || n.error
449
459
  };
450
460
  }
451
- function b(t, r, n, e) {
452
- const o = Y(), a = E(r), i = E(e), [l, u] = q({
461
+ function E(t, r, o, n) {
462
+ const e = Z(), a = b(r), i = b(n), [s, u] = x({
453
463
  status: "idle",
454
- data: n,
464
+ data: o,
455
465
  error: null
456
466
  });
457
- return a.current = r, i.current = e, C(() => {
458
- let m;
467
+ return a.current = r, i.current = n, _(() => {
468
+ let c;
459
469
  try {
460
- m = a.current({
461
- ...o,
470
+ c = a.current({
471
+ ...e,
462
472
  activeInputs: i.current
463
473
  });
464
- } catch (c) {
474
+ } catch (m) {
465
475
  u({
466
476
  status: "error",
467
- data: n,
468
- error: h(c)
477
+ data: o,
478
+ error: y(m)
469
479
  });
470
480
  return;
471
481
  }
472
- if (!m) {
473
- u({ status: "idle", data: n, error: null });
482
+ if (!c) {
483
+ u({ status: "idle", data: o, error: null });
474
484
  return;
475
485
  }
476
- let y = !1;
477
- return u((c) => ({
486
+ let d = !1;
487
+ return u((m) => ({
478
488
  status: "loading",
479
- data: c.data,
489
+ data: m.data,
480
490
  error: null
481
- })), m.then((c) => {
482
- y || u({ status: "success", data: c, error: null });
483
- }).catch((c) => {
484
- y || u({
491
+ })), c.then((m) => {
492
+ d || u({ status: "success", data: m, error: null });
493
+ }).catch((m) => {
494
+ d || u({
485
495
  status: "error",
486
- data: n,
487
- error: h(c)
496
+ data: o,
497
+ error: y(m)
488
498
  });
489
499
  }), () => {
490
- y = !0;
500
+ d = !0;
491
501
  };
492
- }, [n, t, o]), l;
502
+ }, [o, t, e]), s;
493
503
  }
494
504
  export {
495
- st as SemaphorDataAppProvider,
505
+ q as SemaphorDataAppContext,
506
+ dt as SemaphorDataAppProvider,
496
507
  G as createSemaphorDataAppExecutor,
497
508
  A as hasSemaphorInputValue,
498
- j as normalizeSemaphorInputOptions,
499
- w as toSemaphorActiveInputSnapshots,
500
- M as toSemaphorInputBinding,
501
- ut as toSemaphorInputBindings,
502
- F as toSemaphorInputOptionsIntent,
503
- N as toSemaphorInputSnapshots,
504
- P as toSemaphorInputSpec,
505
- T as toSemaphorMetricIntent,
506
- _ as toSemaphorRecordsIntent,
507
- Y as useSemaphorDataAppRuntime,
508
- dt as useSemaphorInput,
509
- ft as useSemaphorInputOptions,
510
- lt as useSemaphorMetric,
511
- ct as useSemaphorRecords
509
+ V as normalizeSemaphorInputOptions,
510
+ Y as readWindowRuntime,
511
+ R as toSemaphorActiveInputSnapshots,
512
+ U as toSemaphorInputBinding,
513
+ st as toSemaphorInputBindings,
514
+ P as toSemaphorInputOptionsIntent,
515
+ M as toSemaphorInputSnapshots,
516
+ N as toSemaphorInputSpec,
517
+ K as toSemaphorMetricIntent,
518
+ C as toSemaphorRecordsIntent,
519
+ Z as useSemaphorDataAppRuntime,
520
+ lt as useSemaphorInput,
521
+ mt as useSemaphorInputOptions,
522
+ ct as useSemaphorMetric,
523
+ ft as useSemaphorRecords
512
524
  };