react-semaphor 0.1.361 → 0.1.363

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 (35) hide show
  1. package/dist/chunks/{calendar-preferences-dialog-GwtaSN53.js → calendar-preferences-dialog-CCWsI9hQ.js} +1 -1
  2. package/dist/chunks/{calendar-preferences-dialog-BEKBpwMY.js → calendar-preferences-dialog-DCh8LMFL.js} +1 -1
  3. package/dist/chunks/{dashboard-briefing-launcher-D6gGO5wz.js → dashboard-briefing-launcher-BPJcXz59.js} +3 -3
  4. package/dist/chunks/{dashboard-briefing-launcher-DYxd4856.js → dashboard-briefing-launcher-BsWvqsgi.js} +1 -1
  5. package/dist/chunks/{dashboard-controls-C_rExqPw.js → dashboard-controls-7uVDGJgT.js} +1 -1
  6. package/dist/chunks/{dashboard-controls-B4u5RsKl.js → dashboard-controls-Ty36m44I.js} +3 -3
  7. package/dist/chunks/{dashboard-json-CPGTofhm.js → dashboard-json-COqIDBU7.js} +1 -1
  8. package/dist/chunks/{dashboard-json-BWWU6a7V.js → dashboard-json-CVlvQrWF.js} +1 -1
  9. package/dist/chunks/{edit-dashboard-visual-D_jZ-iix.js → edit-dashboard-visual-4wuOgtnP.js} +1 -1
  10. package/dist/chunks/{edit-dashboard-visual-biMO829J.js → edit-dashboard-visual-yfR8agWj.js} +3 -3
  11. package/dist/chunks/{index-Db1XVmfU.js → index-B0Qkb2b3.js} +2 -2
  12. package/dist/chunks/{index-CJ2IEuKz.js → index-DEvjcO2T.js} +11 -5
  13. package/dist/chunks/{resource-management-panel-B9-5VHYe.js → resource-management-panel-BWHj4Red.js} +2 -2
  14. package/dist/chunks/{resource-management-panel-Bam-yvnt.js → resource-management-panel-DO4VOGlS.js} +1 -1
  15. package/dist/chunks/{use-create-flow-overlay-state-DAvEqaJV.js → use-create-flow-overlay-state-CtOJ3KgD.js} +2 -2
  16. package/dist/chunks/{use-create-flow-overlay-state-dhxgdLYo.js → use-create-flow-overlay-state-pwbt_yFw.js} +1 -1
  17. package/dist/chunks/{use-visual-utils-CAKdXsr5.js → use-visual-utils-BQBJEW6P.js} +1 -1
  18. package/dist/chunks/{use-visual-utils-FoHNPwpu.js → use-visual-utils-CzxWsSJL.js} +1 -1
  19. package/dist/chunks/{validation-3nSax_Vs.js → validation-B4_hBuYu.js} +164 -168
  20. package/dist/chunks/validation-CsK42Vbq.js +1 -0
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/data-app-builder/index.cjs +1 -1
  24. package/dist/data-app-builder/index.js +1 -1
  25. package/dist/data-app-sdk/index.cjs +1 -1
  26. package/dist/data-app-sdk/index.js +37 -36
  27. package/dist/data-app-sdk-validation/index.cjs +1 -1
  28. package/dist/data-app-sdk-validation/index.js +1 -1
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +5 -5
  31. package/dist/surfboard/index.cjs +1 -1
  32. package/dist/surfboard/index.js +2 -2
  33. package/dist/types/data-app-sdk.d.ts +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunks/validation-bKtG7HIt.js +0 -1
@@ -1,8 +1,8 @@
1
- import { v as x } from "./validators-BnLhuIhd.js";
2
- import { s as A, c as F, b } from "./source-identity-qAmkNtEK.js";
3
- function M(e) {
1
+ import { v as C } from "./validators-BnLhuIhd.js";
2
+ import { s as S, c as x, b as A } from "./source-identity-qAmkNtEK.js";
3
+ function b(e) {
4
4
  var r;
5
- const t = R(e);
5
+ const t = P(e);
6
6
  return {
7
7
  version: 1,
8
8
  kind: "metric",
@@ -10,11 +10,11 @@ function M(e) {
10
10
  label: e.label,
11
11
  source: p(e),
12
12
  metrics: t,
13
- primaryMetric: P(e, t),
13
+ primaryMetric: T(e, t),
14
14
  dateField: e.dateField ? a(e.dateField, "date") : void 0,
15
15
  timeGrain: e.timeGrain,
16
- dimensions: (r = e.dimensions) == null ? void 0 : r.map((i) => a(i, "dimension")),
17
- comparison: W(e.comparison),
16
+ dimensions: (r = e.dimensions) == null ? void 0 : r.map((o) => a(o, "dimension")),
17
+ comparison: V(e.comparison),
18
18
  orderBy: e.orderBy ? {
19
19
  field: a(e.orderBy.field),
20
20
  direction: e.orderBy.direction
@@ -23,16 +23,16 @@ function M(e) {
23
23
  limit: e.limit
24
24
  };
25
25
  }
26
- function T(e) {
26
+ function F(e) {
27
27
  var r;
28
28
  return {
29
- ...M(e),
29
+ ...b(e),
30
30
  ...e.timeWindow ? { timeWindow: e.timeWindow } : {},
31
31
  ...(r = e.filters) != null && r.length ? { filters: e.filters } : {},
32
32
  ...e.analysis ? { analysis: e.analysis } : {}
33
33
  };
34
34
  }
35
- function ce(e) {
35
+ function le(e) {
36
36
  return {
37
37
  ...e.chartTitle ? { chartTitle: e.chartTitle } : {},
38
38
  ...e.chartType ? { chartType: e.chartType } : {},
@@ -41,62 +41,62 @@ function ce(e) {
41
41
  ...e.calendarContext ? { calendarContext: e.calendarContext } : {}
42
42
  };
43
43
  }
44
- function P(e, t) {
44
+ function T(e, t) {
45
45
  if (!e.primaryMetric)
46
46
  return t[0] || { name: "", role: "measure" };
47
- const r = a(e.primaryMetric, "measure"), i = H(r, t), o = i.length === 1 ? i[0] : void 0;
48
- return o ? _(r, o) : r;
47
+ const r = a(e.primaryMetric, "measure"), o = D(r, t), i = o.length === 1 ? o[0] : void 0;
48
+ return i ? M(r, i) : r;
49
49
  }
50
- function R(e) {
50
+ function P(e) {
51
51
  const t = [];
52
- for (const r of e.metrics.map((i) => a(i, "measure"))) {
52
+ for (const r of e.metrics.map((o) => a(o, "measure"))) {
53
53
  if (!r.name)
54
54
  continue;
55
- const i = t.findIndex(
56
- (o) => z(o, r)
55
+ const o = t.findIndex(
56
+ (i) => R(i, r)
57
57
  );
58
- if (i === -1) {
58
+ if (o === -1) {
59
59
  t.push(r);
60
60
  continue;
61
61
  }
62
- t[i] = _(t[i], r);
62
+ t[o] = M(t[o], r);
63
63
  }
64
64
  return t;
65
65
  }
66
+ function R(e, t) {
67
+ return S(e, t) && f(e) === f(t);
68
+ }
66
69
  function z(e, t) {
67
- return A(e, t) && f(e) === f(t);
70
+ return f(t) === f(e);
68
71
  }
69
72
  function B(e, t) {
70
- return f(t) === f(e);
73
+ return t.name !== e.name || e.source && !S(t, e) ? !1 : z(e, t);
71
74
  }
72
75
  function D(e, t) {
73
- return t.name !== e.name || e.source && !A(t, e) ? !1 : B(e, t);
74
- }
75
- function H(e, t) {
76
76
  const r = t.filter(
77
- (i) => D(e, i)
77
+ (o) => B(e, o)
78
78
  );
79
79
  return e.aggregate !== void 0, r;
80
80
  }
81
81
  function f(e) {
82
82
  return (e.aggregate || "SUM").toUpperCase();
83
83
  }
84
- function _(e, t) {
84
+ function M(e, t) {
85
85
  if (e.aggregate && t.aggregate && e.aggregate !== t.aggregate)
86
86
  throw new Error(
87
87
  `Metric "${e.name}" was requested with conflicting aggregate semantics: ${e.aggregate} and ${t.aggregate}.`
88
88
  );
89
89
  return {
90
- ...F(e, t),
90
+ ...x(e, t),
91
91
  aggregate: e.aggregate || t.aggregate
92
92
  };
93
93
  }
94
- function N(e) {
94
+ function H(e) {
95
95
  if ("sort" in e)
96
96
  throw new Error(
97
97
  "useSemaphorRecords supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet."
98
98
  );
99
- if (!V(e))
99
+ if (!G(e))
100
100
  throw new Error(
101
101
  "useSemaphorRecords needs at least one field."
102
102
  );
@@ -140,7 +140,7 @@ function j(e) {
140
140
  limit: e.limit
141
141
  };
142
142
  }
143
- function q(e) {
143
+ function N(e) {
144
144
  if ("toAnalyticsInput" in e) {
145
145
  const t = e.toAnalyticsInput();
146
146
  return {
@@ -153,17 +153,17 @@ function q(e) {
153
153
  ...e.field ? { field: e.field } : {}
154
154
  };
155
155
  }
156
- function fe(e) {
156
+ function ce(e) {
157
157
  const t = g(e);
158
158
  return t.length > 0 ? t : void 0;
159
159
  }
160
- function E(e) {
161
- return (e || []).map(G);
160
+ function q(e) {
161
+ return (e || []).map(U);
162
162
  }
163
- function ue(e) {
164
- return E(e).filter((t) => t.isActive);
163
+ function fe(e) {
164
+ return q(e).filter((t) => t.isActive);
165
165
  }
166
- function me(e) {
166
+ function ue(e) {
167
167
  return e.kind === "filter" ? {
168
168
  inputId: e.id,
169
169
  kind: e.kind,
@@ -184,14 +184,14 @@ function he(e = []) {
184
184
  }
185
185
  );
186
186
  }
187
- function U(e) {
187
+ function E(e) {
188
188
  return e == null ? !1 : Array.isArray(e) ? e.length > 0 : typeof e == "string" ? e.trim().length > 0 : !0;
189
189
  }
190
- function G(e) {
190
+ function U(e) {
191
191
  return "toAnalyticsInput" in e ? e.toAnalyticsInput() : "kind" in e && "isActive" in e ? e : {
192
192
  ...e,
193
193
  kind: "filter",
194
- isActive: U(
194
+ isActive: E(
195
195
  e.value
196
196
  ),
197
197
  value: e.value
@@ -200,7 +200,7 @@ function G(e) {
200
200
  function p(e) {
201
201
  return e.source;
202
202
  }
203
- function V(e) {
203
+ function G(e) {
204
204
  var t;
205
205
  return !!((t = e.fields) != null && t.length);
206
206
  }
@@ -211,13 +211,13 @@ function a(e, t) {
211
211
  };
212
212
  }
213
213
  function g(e) {
214
- return (e || []).map(q);
214
+ return (e || []).map(N);
215
215
  }
216
- function W(e) {
216
+ function V(e) {
217
217
  if (e)
218
218
  return e;
219
219
  }
220
- function K(e, t = {}) {
220
+ function W(e, t = {}) {
221
221
  const r = t.pathPrefix || "analysisOptions";
222
222
  if (e === void 0)
223
223
  return { ok: !0 };
@@ -226,42 +226,42 @@ function K(e, t = {}) {
226
226
  r,
227
227
  "Data App analysis options must be an object."
228
228
  );
229
- const i = e, o = {};
230
- if (i.chartTitle !== void 0) {
231
- if (typeof i.chartTitle != "string")
229
+ const o = e, i = {};
230
+ if (o.chartTitle !== void 0) {
231
+ if (typeof o.chartTitle != "string")
232
232
  return s(
233
233
  `${r}.chartTitle`,
234
234
  'Data App analysis option "chartTitle" must be a string.'
235
235
  );
236
- o.chartTitle = i.chartTitle;
236
+ i.chartTitle = o.chartTitle;
237
237
  }
238
- if (i.chartType !== void 0) {
239
- if (typeof i.chartType != "string")
238
+ if (o.chartType !== void 0) {
239
+ if (typeof o.chartType != "string")
240
240
  return s(
241
241
  `${r}.chartType`,
242
242
  'Data App analysis option "chartType" must be a string.'
243
243
  );
244
- o.chartType = i.chartType;
244
+ i.chartType = o.chartType;
245
245
  }
246
- if (i.driverMode !== void 0) {
247
- if (!L(i.driverMode))
246
+ if (o.driverMode !== void 0) {
247
+ if (!Q(o.driverMode))
248
248
  return s(
249
249
  `${r}.driverMode`,
250
250
  'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.'
251
251
  );
252
- o.driverMode = i.driverMode;
252
+ i.driverMode = o.driverMode;
253
253
  }
254
- if (i.includePopulation !== void 0) {
255
- if (typeof i.includePopulation != "boolean")
254
+ if (o.includePopulation !== void 0) {
255
+ if (typeof o.includePopulation != "boolean")
256
256
  return s(
257
257
  `${r}.includePopulation`,
258
258
  'Data App analysis option "includePopulation" must be a boolean.'
259
259
  );
260
- o.includePopulation = i.includePopulation;
260
+ i.includePopulation = o.includePopulation;
261
261
  }
262
- if (i.calendarContext !== void 0) {
263
- const n = X(
264
- i.calendarContext,
262
+ if (o.calendarContext !== void 0) {
263
+ const n = L(
264
+ o.calendarContext,
265
265
  {
266
266
  pathPrefix: `${r}.calendarContext`,
267
267
  validateTimezone: t.validateTimezone
@@ -269,89 +269,89 @@ function K(e, t = {}) {
269
269
  );
270
270
  if (!n.ok)
271
271
  return n;
272
- o.calendarContext = n.calendarContext;
272
+ i.calendarContext = n.calendarContext;
273
273
  }
274
- return { ok: !0, analysisOptions: o };
274
+ return { ok: !0, analysisOptions: i };
275
275
  }
276
- function pe(e) {
276
+ function me(e) {
277
277
  const t = e.hooks.map(
278
- (o, n) => Q(o, n, {
278
+ (i, n) => K(i, n, {
279
279
  fieldCatalogs: e.fieldCatalogs || [],
280
280
  requireFieldCatalog: !!e.requireFieldCatalog,
281
281
  validateTimezone: e.validateTimezone
282
282
  })
283
- ), r = t.flatMap((o) => o.diagnostics), i = t.map((o) => o.executionResult);
283
+ ), r = t.flatMap((i) => i.diagnostics), o = t.map((i) => i.executionResult);
284
284
  return {
285
- ok: r.every((o) => o.severity !== "error"),
285
+ ok: r.every((i) => i.severity !== "error"),
286
286
  diagnostics: r,
287
287
  hooks: t,
288
- intents: t.flatMap((o) => o.intent ? [o.intent] : []),
289
- executionResults: i
288
+ intents: t.flatMap((i) => i.intent ? [i.intent] : []),
289
+ executionResults: o
290
290
  };
291
291
  }
292
- function Q(e, t, r) {
293
- const i = `hooks.${t}`;
292
+ function K(e, t, r) {
293
+ const o = `hooks.${t}`;
294
294
  try {
295
- const o = Y(e), n = se(e, o), d = x(o), l = [
295
+ const i = X(e), n = ae(e, i), d = C(i), l = [
296
296
  ...d.errors.map(
297
- (m) => v(m, {
297
+ (h) => y(h, {
298
298
  hook: e.hook,
299
299
  hookId: n,
300
- pathPrefix: i,
300
+ pathPrefix: o,
301
301
  severity: "error",
302
- intent: o
302
+ intent: i
303
303
  })
304
304
  ),
305
305
  ...d.warnings.map(
306
- (m) => v(m, {
306
+ (h) => y(h, {
307
307
  hook: e.hook,
308
308
  hookId: n,
309
- pathPrefix: i,
309
+ pathPrefix: o,
310
310
  severity: "warning",
311
- intent: o
311
+ intent: i
312
312
  })
313
313
  ),
314
- ...Z({
314
+ ...Y({
315
315
  hookSpec: e,
316
316
  hookId: n,
317
- intent: o,
318
- pathPrefix: i,
317
+ intent: i,
318
+ pathPrefix: o,
319
319
  fieldCatalogs: r.fieldCatalogs,
320
320
  requireFieldCatalog: r.requireFieldCatalog
321
321
  }),
322
- ...re({
322
+ ...te({
323
323
  hookSpec: e,
324
324
  hookId: n,
325
- intent: o,
326
- pathPrefix: i,
325
+ intent: i,
326
+ pathPrefix: o,
327
327
  validateTimezone: r.validateTimezone
328
328
  })
329
- ], c = ae(d, l);
329
+ ], c = ne(d, l);
330
330
  return {
331
331
  hook: e.hook,
332
332
  hookId: n,
333
- intent: o,
333
+ intent: i,
334
334
  diagnostics: l,
335
- executionResult: S({
336
- intent: o,
335
+ executionResult: I({
336
+ intent: i,
337
337
  validation: c,
338
338
  diagnostics: l
339
339
  })
340
340
  };
341
- } catch (o) {
341
+ } catch (i) {
342
342
  const n = {
343
343
  severity: "error",
344
344
  code: "invalid_hook_spec",
345
- message: o instanceof Error ? o.message : String(o),
346
- path: i,
345
+ message: i instanceof Error ? i.message : String(i),
346
+ path: o,
347
347
  hook: e.hook,
348
348
  hookId: $(e.spec)
349
- }, d = C([n]);
349
+ }, d = w([n]);
350
350
  return {
351
351
  hook: e.hook,
352
352
  hookId: n.hookId,
353
353
  diagnostics: [n],
354
- executionResult: S({
354
+ executionResult: I({
355
355
  validation: d,
356
356
  diagnostics: [n]
357
357
  })
@@ -370,21 +370,21 @@ function s(e, t) {
370
370
  ]
371
371
  };
372
372
  }
373
- function L(e) {
373
+ function Q(e) {
374
374
  return e === "absolute_delta" || e === "largest_negative" || e === "largest_positive" || e === "positive_and_negative" || e === "all";
375
375
  }
376
376
  function J(e) {
377
377
  return e.trim().length > 0 && !Number.isNaN(Date.parse(e));
378
378
  }
379
- function X(e, t) {
379
+ function L(e, t) {
380
380
  var c;
381
381
  if (!e || typeof e != "object" || Array.isArray(e))
382
382
  return s(
383
383
  t.pathPrefix,
384
384
  'Data App analysis option "calendarContext" must be an object.'
385
385
  );
386
- const r = e, i = r.tz, o = r.weekStart, n = r.anchor, d = n && typeof n == "object" && !Array.isArray(n) ? n.iso : void 0, l = typeof i == "string" ? ((c = t.validateTimezone) == null ? void 0 : c.call(t, i)) ?? i : null;
387
- return l ? typeof o != "number" || !Number.isInteger(o) || o < 0 || o > 6 ? s(
386
+ const r = e, o = r.tz, i = r.weekStart, n = r.anchor, d = n && typeof n == "object" && !Array.isArray(n) ? n.iso : void 0, l = typeof o == "string" ? ((c = t.validateTimezone) == null ? void 0 : c.call(t, o)) ?? o : null;
387
+ return l ? typeof i != "number" || !Number.isInteger(i) || i < 0 || i > 6 ? s(
388
388
  `${t.pathPrefix}.weekStart`,
389
389
  'Data App analysis option "calendarContext.weekStart" must be an integer from 0 to 6.'
390
390
  ) : n !== "now" && !(typeof d == "string" && J(d)) ? s(
@@ -394,7 +394,7 @@ function X(e, t) {
394
394
  ok: !0,
395
395
  calendarContext: {
396
396
  tz: l,
397
- weekStart: o,
397
+ weekStart: i,
398
398
  anchor: n
399
399
  }
400
400
  } : s(
@@ -402,19 +402,19 @@ function X(e, t) {
402
402
  'Data App analysis option "calendarContext.tz" must be a valid timezone string.'
403
403
  );
404
404
  }
405
- function Y(e) {
406
- return e.hook === "useSemaphorMetric" ? M(e.spec) : e.hook === "useSemaphorAnalysis" ? T(e.spec) : e.hook === "useSemaphorRecords" ? N(e.spec) : j(e.spec);
405
+ function X(e) {
406
+ return e.hook === "useSemaphorMetric" ? b(e.spec) : e.hook === "useSemaphorAnalysis" ? F(e.spec) : e.hook === "useSemaphorRecords" ? H(e.spec) : j(e.spec);
407
407
  }
408
- function Z(e) {
408
+ function Y(e) {
409
409
  if (e.fieldCatalogs.length === 0 && !e.requireFieldCatalog)
410
410
  return [];
411
- const t = oe(e.fieldCatalogs, e.intent.source);
411
+ const t = ie(e.fieldCatalogs, e.intent.source);
412
412
  return t ? [
413
- ...ee({
413
+ ...Z({
414
414
  ...e,
415
415
  catalog: t
416
416
  }),
417
- ...te({
417
+ ...ee({
418
418
  ...e,
419
419
  catalog: t
420
420
  })
@@ -431,8 +431,8 @@ function Z(e) {
431
431
  }
432
432
  ];
433
433
  }
434
- function ee(e) {
435
- return ie(e.intent).flatMap(({ field: t, path: r }) => w(e.catalog, t, e.intent.source) ? [] : [
434
+ function Z(e) {
435
+ return re(e.intent).flatMap(({ field: t, path: r }) => _(e.catalog, t, e.intent.source) ? [] : [
436
436
  {
437
437
  severity: "error",
438
438
  code: "missing_field",
@@ -446,21 +446,21 @@ function ee(e) {
446
446
  }
447
447
  ]);
448
448
  }
449
- function te(e) {
450
- return ("inputs" in e.intent ? e.intent.inputs || [] : []).flatMap((r, i) => {
449
+ function ee(e) {
450
+ return ("inputs" in e.intent ? e.intent.inputs || [] : []).flatMap((r, o) => {
451
451
  if (!r.field)
452
452
  return [];
453
- const o = u(r.field, e.intent.source);
454
- return b(o, e.intent.source) ? w(e.catalog, r.field, e.intent.source) ? [] : [
453
+ const i = u(r.field, e.intent.source);
454
+ return A(i, e.intent.source) ? _(e.catalog, r.field, e.intent.source) ? [] : [
455
455
  {
456
456
  severity: "error",
457
457
  code: "missing_field",
458
458
  message: `Input "${r.inputId}" references field "${r.field.name}", which is not visible on the selected Semaphor source.`,
459
- path: `${e.pathPrefix}.spec.inputs.${i}.field`,
459
+ path: `${e.pathPrefix}.spec.inputs.${o}.field`,
460
460
  hook: e.hookSpec.hook,
461
461
  hookId: e.hookId,
462
462
  intentId: e.intent.id,
463
- source: o,
463
+ source: i,
464
464
  field: r.field
465
465
  }
466
466
  ] : [
@@ -468,20 +468,20 @@ function te(e) {
468
468
  severity: "error",
469
469
  code: "unsupported_input_filter_composition",
470
470
  message: `Input "${r.inputId}" filters a different Semaphor source than the query. Cross-source Data App inputs are not supported yet.`,
471
- path: `${e.pathPrefix}.spec.inputs.${i}.field`,
471
+ path: `${e.pathPrefix}.spec.inputs.${o}.field`,
472
472
  hook: e.hookSpec.hook,
473
473
  hookId: e.hookId,
474
474
  intentId: e.intent.id,
475
- source: o,
475
+ source: i,
476
476
  field: r.field
477
477
  }
478
478
  ];
479
479
  });
480
480
  }
481
- function re(e) {
481
+ function te(e) {
482
482
  if (e.hookSpec.hook !== "useSemaphorAnalysis")
483
483
  return [];
484
- const t = K(e.hookSpec.spec, {
484
+ const t = W(e.hookSpec.spec, {
485
485
  pathPrefix: `${e.pathPrefix}.spec`,
486
486
  validateTimezone: e.validateTimezone
487
487
  });
@@ -496,7 +496,7 @@ function re(e) {
496
496
  source: e.intent.source
497
497
  }));
498
498
  }
499
- function ie(e) {
499
+ function re(e) {
500
500
  return e.kind === "metric" ? [
501
501
  ...e.metrics.map((t, r) => ({
502
502
  field: t,
@@ -522,35 +522,31 @@ function ie(e) {
522
522
  ...e.orderBy ? [{ field: e.orderBy.field, path: "spec.orderBy.field" }] : []
523
523
  ] : e.kind === "inputOptions" ? [{ field: e.field, path: "spec.field" }] : [];
524
524
  }
525
- function oe(e, t) {
526
- return e.find((r) => h(r, t));
525
+ function ie(e, t) {
526
+ return e.find((r) => m(r, t));
527
527
  }
528
- function w(e, t, r) {
529
- const i = u(t, r);
530
- if (h(e, i))
528
+ function _(e, t, r) {
529
+ const o = u(t, r);
530
+ if (m(e, o))
531
531
  return e.fields.find(
532
- (o) => ne(o, t) && h(
532
+ (i) => oe(i, t) && m(
533
533
  e,
534
- u(o, e.source)
534
+ u(i, e.source)
535
535
  )
536
536
  );
537
537
  }
538
- function h(e, t) {
538
+ function m(e, t) {
539
539
  return [e.source, ...e.sourceAliases || []].some(
540
- (r) => b(r, t)
540
+ (r) => A(r, t)
541
541
  );
542
542
  }
543
543
  function u(e, t) {
544
544
  return e.source || t;
545
545
  }
546
- function ne(e, t) {
547
- const r = y(e.name), i = y(t.name);
548
- return !!(r && i && r === i);
549
- }
550
- function y(e) {
551
- return (e || "").trim().toLowerCase();
546
+ function oe(e, t) {
547
+ return !!(e.name && t.name && e.name === t.name);
552
548
  }
553
- function v(e, t) {
549
+ function y(e, t) {
554
550
  return {
555
551
  severity: t.severity,
556
552
  code: e.code || "invalid_analytics_intent",
@@ -562,15 +558,15 @@ function v(e, t) {
562
558
  source: t.intent.source
563
559
  };
564
560
  }
565
- function ae(e, t) {
566
- const r = C(t);
561
+ function ne(e, t) {
562
+ const r = w(t);
567
563
  return {
568
564
  ok: r.ok && e.ok,
569
- errors: I([
565
+ errors: k([
570
566
  ...e.errors,
571
567
  ...r.errors
572
568
  ]),
573
- warnings: I([
569
+ warnings: k([
574
570
  ...e.warnings,
575
571
  ...r.warnings
576
572
  ]),
@@ -580,25 +576,25 @@ function ae(e, t) {
580
576
  ]
581
577
  };
582
578
  }
583
- function C(e) {
584
- const t = e.filter((i) => i.severity === "error").map(k), r = e.filter((i) => i.severity === "warning").map(k);
579
+ function w(e) {
580
+ const t = e.filter((o) => o.severity === "error").map(v), r = e.filter((o) => o.severity === "warning").map(v);
585
581
  return {
586
582
  ok: t.length === 0,
587
583
  errors: t,
588
584
  warnings: r,
589
- repairHints: t.map((i) => {
590
- var o, n;
585
+ repairHints: t.map((o) => {
586
+ var i, n;
591
587
  return {
592
- code: i.code,
593
- message: i.message,
594
- fieldRole: i.fieldRole,
595
- invalidField: (o = i.repairHint) == null ? void 0 : o.invalidField,
596
- recommendedNextStep: ((n = i.repairHint) == null ? void 0 : n.recommendedNextStep) || "Update the Data App SDK hook spec to use visible Semaphor source and field refs."
588
+ code: o.code,
589
+ message: o.message,
590
+ fieldRole: o.fieldRole,
591
+ invalidField: (i = o.repairHint) == null ? void 0 : i.invalidField,
592
+ recommendedNextStep: ((n = o.repairHint) == null ? void 0 : n.recommendedNextStep) || "Update the Data App SDK hook spec to use visible Semaphor source and field refs."
597
593
  };
598
594
  })
599
595
  };
600
596
  }
601
- function k(e) {
597
+ function v(e) {
602
598
  var t;
603
599
  return {
604
600
  code: e.code,
@@ -614,20 +610,20 @@ function k(e) {
614
610
  }
615
611
  };
616
612
  }
617
- function I(e) {
613
+ function k(e) {
618
614
  const t = /* @__PURE__ */ new Set();
619
615
  return e.filter((r) => {
620
- const i = `${r.code}:${r.path || ""}:${r.message}`;
621
- return t.has(i) ? !1 : (t.add(i), !0);
616
+ const o = `${r.code}:${r.path || ""}:${r.message}`;
617
+ return t.has(o) ? !1 : (t.add(o), !0);
622
618
  });
623
619
  }
624
- function S(e) {
625
- var r, i;
626
- const t = e.diagnostics.filter((o) => o.severity === "error");
620
+ function I(e) {
621
+ var r, o;
622
+ const t = e.diagnostics.filter((i) => i.severity === "error");
627
623
  return {
628
624
  intentId: (r = e.intent) == null ? void 0 : r.id,
629
625
  status: t.length ? "failed" : "answered",
630
- resultShape: (i = e.intent) == null ? void 0 : i.kind,
626
+ resultShape: (o = e.intent) == null ? void 0 : o.kind,
631
627
  intent: e.intent,
632
628
  validation: e.validation,
633
629
  coverage: {
@@ -635,17 +631,17 @@ function S(e) {
635
631
  missingObligations: t.length ? ["hook_spec_validation"] : [],
636
632
  warnings: e.validation.warnings
637
633
  },
638
- missingFields: t.filter((o) => o.code === "missing_field").flatMap((o) => {
634
+ missingFields: t.filter((i) => i.code === "missing_field").flatMap((i) => {
639
635
  var n;
640
- return (n = o.field) != null && n.name ? [o.field.name] : [];
636
+ return (n = i.field) != null && n.name ? [i.field.name] : [];
641
637
  }),
642
- warnings: e.diagnostics.filter((o) => o.severity === "warning").map((o) => o.message),
638
+ warnings: e.diagnostics.filter((i) => i.severity === "warning").map((i) => i.message),
643
639
  metadata: {
644
640
  validationKind: "data_app_sdk_hook_spec"
645
641
  }
646
642
  };
647
643
  }
648
- function se(e, t) {
644
+ function ae(e, t) {
649
645
  return t.id || $(e.spec);
650
646
  }
651
647
  function $(e) {
@@ -655,18 +651,18 @@ function $(e) {
655
651
  return typeof t == "string" && t.trim() ? t : void 0;
656
652
  }
657
653
  export {
658
- ce as a,
659
- T as b,
660
- M as c,
661
- N as d,
654
+ le as a,
655
+ F as b,
656
+ b as c,
657
+ H as d,
662
658
  j as e,
663
- me as f,
664
- q as g,
665
- U as h,
666
- fe as i,
667
- E as j,
668
- K as k,
659
+ ue as f,
660
+ N as g,
661
+ E as h,
662
+ ce as i,
663
+ q as j,
664
+ W as k,
669
665
  he as n,
670
- ue as t,
671
- pe as v
666
+ fe as t,
667
+ me as v
672
668
  };