react-semaphor 0.1.568 → 0.1.569

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 (126) hide show
  1. package/README.md +0 -7
  2. package/dist/analytics-protocol/index.js +434 -454
  3. package/dist/assistant-context/index.js +1 -1
  4. package/dist/brand-studio/index.js +10 -12
  5. package/dist/briefings/index.js +4 -4
  6. package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → _commonjsHelpers-Bid1ZNYj.js} +271 -222
  7. package/dist/chunks/{assistant-chat-BN5I8KuN.js → assistant-chat-Dzf2Mbph.js} +107 -109
  8. package/dist/chunks/{bookmark-impact-CJ-65omV.js → bookmark-impact-Czg6FGt5.js} +2 -2
  9. package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
  10. package/dist/chunks/{card-filter-builder-BBuB99GZ.js → card-filter-builder-BS982X7x.js} +986 -985
  11. package/dist/chunks/{code-editor-DJNOsgJH.js → code-editor-BsxHzm9u.js} +43 -45
  12. package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-lLTgzOkM.js} +252 -253
  13. package/dist/chunks/{dashboard-YnWZC4dK.js → dashboard-BiYSbxZv.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-BF89TU2h.js → dashboard-briefing-launcher-Bdj7luOr.js} +158 -159
  15. package/dist/chunks/{dashboard-controls-atHc1EjP.js → dashboard-controls-TViDsnb8.js} +17 -19
  16. package/dist/chunks/dashboard-json-Dg9dQd9U.js +66 -0
  17. package/dist/chunks/{dates-CKO05ino.js → dates-BsPrWZIP.js} +8 -8
  18. package/dist/chunks/{edit-dashboard-visual-DdmTfn-J.js → edit-dashboard-visual-C6hoIeEJ.js} +20 -21
  19. package/dist/chunks/{filter-reach-copy-jZGzK_IH.js → filter-reach-copy-hcQ4os0u.js} +695 -699
  20. package/dist/chunks/filter-value-text-CVxEEDVl.js +146 -0
  21. package/dist/chunks/{index-CPNZW0mu.js → index-G4q89J6O.js} +74 -76
  22. package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-BIcoFfdS.js} +1 -1
  23. package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C6tYkHyv.js} +1 -1
  24. package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
  25. package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
  26. package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
  27. package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
  28. package/dist/chunks/{palette-4vf2BEEg.js → palette-NjHOE_6B.js} +1 -1
  29. package/dist/chunks/pivot-result-contract-expectations-DkmueDTW.js +55 -0
  30. package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
  31. package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
  32. package/dist/chunks/{report-preferences-dialog-Mbd-I0wV.js → report-preferences-dialog-Xc8_GFju.js} +26 -28
  33. package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
  34. package/dist/chunks/{resolve-dashboard-input-context-Du0fjN3h.js → resolve-dashboard-input-context-KqvcLcTM.js} +4784 -4764
  35. package/dist/chunks/{save-D6pHmSSP.js → save-C6VmEJTA.js} +1 -1
  36. package/dist/chunks/{saved-dashboard-context-y8N6RvjS.js → saved-dashboard-context-BeXXyoD4.js} +6 -6
  37. package/dist/chunks/{semaphor-ready-indicator-BSEdUq40.js → semaphor-ready-indicator-BNkaANsG.js} +28395 -28384
  38. package/dist/chunks/{shelf-drop-preview-context-D7QqPl36.js → shelf-drop-preview-context-C_issPBA.js} +18 -20
  39. package/dist/chunks/{stored-dashboard-d3xQYxBD.js → stored-dashboard-B6_StAty.js} +263 -265
  40. package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-BWP2joD1.js} +1 -1
  41. package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-scSWQXAB.js} +4 -4
  42. package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
  43. package/dist/chunks/{upload-Cf3wXZT8.js → upload-BRW4Mwrd.js} +1 -1
  44. package/dist/chunks/validators-B8fpdinG.js +3651 -0
  45. package/dist/chunks/{variable-draft-DOX03R4A.js → variable-draft-BQ3OMjvy.js} +4 -4
  46. package/dist/dashboard/index.js +2 -2
  47. package/dist/dashboard-authoring/index.js +1527 -1517
  48. package/dist/format-utils/index.js +230 -231
  49. package/dist/index.js +236 -237
  50. package/dist/report-runtime-context/index.js +1 -1
  51. package/dist/style.css +1 -1
  52. package/dist/surfboard/index.js +2 -2
  53. package/dist/types/components/surfboard/filter/types.d.ts +5 -4
  54. package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
  55. package/dist/types/index.js +9 -9
  56. package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
  57. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  58. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  59. package/dist/types/lib/types/index.d.ts +1 -1
  60. package/dist/types/lib/utils/card-definition.d.ts +7 -7
  61. package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
  62. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
  63. package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
  64. package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
  65. package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
  66. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +4 -4
  67. package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
  68. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
  69. package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
  70. package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
  71. package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
  72. package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
  73. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
  74. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
  75. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
  76. package/dist/types/shared/assistant-protocol/context.d.ts +12 -12
  77. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
  78. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +155 -1753
  79. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
  80. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +74 -74
  81. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
  82. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +3 -0
  83. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
  84. package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
  85. package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
  86. package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
  87. package/dist/types/shared/temporal/index.d.ts +0 -2
  88. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
  89. package/package.json +2 -24
  90. package/DATA_APP_SDK.md +0 -339
  91. package/dist/chunks/dashboard-json-Cxp3inxd.js +0 -68
  92. package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
  93. package/dist/chunks/index-CuHybtft.js +0 -51
  94. package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
  95. package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
  96. package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
  97. package/dist/chunks/operators-B3zZoskU.js +0 -66
  98. package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
  99. package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
  100. package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
  101. package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
  102. package/dist/chunks/validators-wtjw0aw6.js +0 -3332
  103. package/dist/data-app-sdk/index.js +0 -1412
  104. package/dist/data-app-sdk-adapters/index.js +0 -361
  105. package/dist/data-app-sdk-validation/index.js +0 -1031
  106. package/dist/types/data-app-sdk/adapters.d.ts +0 -35
  107. package/dist/types/data-app-sdk/builders.d.ts +0 -62
  108. package/dist/types/data-app-sdk/contracts.d.ts +0 -419
  109. package/dist/types/data-app-sdk/executor.d.ts +0 -5
  110. package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
  111. package/dist/types/data-app-sdk/hooks.d.ts +0 -11
  112. package/dist/types/data-app-sdk/index.d.ts +0 -9
  113. package/dist/types/data-app-sdk/provider.d.ts +0 -8
  114. package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
  115. package/dist/types/data-app-sdk/selection.d.ts +0 -2
  116. package/dist/types/data-app-sdk/validation.d.ts +0 -58
  117. package/dist/types/data-app-sdk-adapters.d.ts +0 -2
  118. package/dist/types/data-app-sdk-validation.d.ts +0 -2
  119. package/dist/types/data-app-sdk.d.ts +0 -2
  120. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
  121. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
  122. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
  123. package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
  124. package/dist/types/shared/temporal/relative-date.d.ts +0 -21
  125. package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
  126. package/src/data-app-sdk/README.md +0 -402
@@ -1,11 +1,57 @@
1
- import { T as m, a as g, b as C } from "./analytics-base-schemas-BaIQrEzX.js";
2
- import { r as k } from "./validators-wtjw0aw6.js";
3
- function w(e) {
4
- const r = C.safeParse(e);
1
+ import { T as d, a as g, b as k } from "./analytics-base-schemas-BaIQrEzX.js";
2
+ import { p as C } from "./validators-B8fpdinG.js";
3
+ function N(e) {
4
+ switch (e.kind) {
5
+ case "monthDay":
6
+ return {
7
+ subDay: !1,
8
+ dataAnchored: !1,
9
+ bounds: { start: "day", end: "day" },
10
+ comparesBySpan: !1,
11
+ printsByName: !1,
12
+ pickerCategory: "day",
13
+ dayPickerDefault: !0,
14
+ monthPickerDefault: !1
15
+ };
16
+ case "rolling": {
17
+ const r = e.unit === "minute" || e.unit === "hour", o = e.anchor === "latest_data";
18
+ return {
19
+ subDay: r,
20
+ dataAnchored: o,
21
+ bounds: { start: "instant", end: "instant" },
22
+ comparesBySpan: !1,
23
+ printsByName: o || e.unit === "quarter" || e.unit === "year",
24
+ pickerCategory: r ? "time" : e.unit,
25
+ dayPickerDefault: !1,
26
+ monthPickerDefault: !1,
27
+ span: { unit: e.unit, n: e.n, complete: !1 }
28
+ };
29
+ }
30
+ case "periods": {
31
+ const { unit: r, from: o, to: n, toDate: t } = e, a = e.anchor === "latest_data", s = e.anchor === "now", l = !!t && s, m = o === n;
32
+ return {
33
+ subDay: !1,
34
+ dataAnchored: a,
35
+ ...l && o === 0 ? { periodToDate: r } : {},
36
+ // Measured from the end of a complete period, a "to date" window ends on a whole day.
37
+ bounds: { start: "day", end: l ? "instant" : "day" },
38
+ comparesBySpan: typeof e.anchor == "object",
39
+ printsByName: a || r === "quarter" || r === "year",
40
+ pickerCategory: r,
41
+ ...s && !t ? { periodOffsets: { unit: r, from: o, to: n } } : {},
42
+ dayPickerDefault: r === "day" && m && s,
43
+ monthPickerDefault: r === "month" && m && (o === 0 || o === -1) && s && !t,
44
+ span: { unit: r, n: n - o + 1, complete: n < 0 }
45
+ };
46
+ }
47
+ }
48
+ }
49
+ function y(e) {
50
+ const r = k.safeParse(e);
5
51
  return r.success ? { ok: !0, value: r.data } : {
6
52
  ok: !1,
7
53
  error: {
8
- code: m.invalidMetadata,
54
+ code: d.invalidMetadata,
9
55
  message: "Temporal bucket metadata is invalid.",
10
56
  path: "temporalBucket"
11
57
  }
@@ -16,12 +62,12 @@ function f(e, r) {
16
62
  return r.metadataRequired ? {
17
63
  ok: !1,
18
64
  error: {
19
- code: m.missingMetadata,
65
+ code: d.missingMetadata,
20
66
  message: "Activated temporal bucket result is missing metadata.",
21
67
  path: "temporalBucket"
22
68
  }
23
69
  } : { ok: !0 };
24
- const o = w(
70
+ const o = y(
25
71
  e.temporalBucket
26
72
  );
27
73
  if (!o.ok || !o.value)
@@ -32,24 +78,24 @@ function f(e, r) {
32
78
  return e.dataType !== n ? {
33
79
  ok: !1,
34
80
  error: {
35
- code: m.invalidMetadata,
81
+ code: d.invalidMetadata,
36
82
  message: `${o.value.granularity} temporal buckets require dataType ${n}.`,
37
83
  path: "dataType"
38
84
  }
39
85
  } : o;
40
86
  }
41
- function $(e, r) {
42
- var o, n, t, i;
43
- return e.granularity === r.granularity && e.calendar.tz === r.calendar.tz && e.calendar.weekStart === r.calendar.weekStart && ((o = e.calendar.fiscalCalendar) == null ? void 0 : o.kind) === ((n = r.calendar.fiscalCalendar) == null ? void 0 : n.kind) && ((t = e.calendar.fiscalCalendar) == null ? void 0 : t.yearStartMonth) === ((i = r.calendar.fiscalCalendar) == null ? void 0 : i.yearStartMonth);
87
+ function h(e, r) {
88
+ var o, n, t, a;
89
+ return e.granularity === r.granularity && e.calendar.tz === r.calendar.tz && e.calendar.weekStart === r.calendar.weekStart && ((o = e.calendar.fiscalCalendar) == null ? void 0 : o.kind) === ((n = r.calendar.fiscalCalendar) == null ? void 0 : n.kind) && ((t = e.calendar.fiscalCalendar) == null ? void 0 : t.yearStartMonth) === ((a = r.calendar.fiscalCalendar) == null ? void 0 : a.yearStartMonth);
44
90
  }
45
- function I(e, r) {
91
+ function A(e, r) {
46
92
  const o = /* @__PURE__ */ new Map();
47
93
  for (const n of e) {
48
94
  if (o.has(n.key))
49
95
  return {
50
96
  ok: !1,
51
97
  error: {
52
- code: m.invalidMetadata,
98
+ code: d.invalidMetadata,
53
99
  message: `Canonical result contains duplicate column key "${n.key}".`,
54
100
  path: "columns"
55
101
  }
@@ -74,27 +120,27 @@ function I(e, r) {
74
120
  return {
75
121
  ok: !1,
76
122
  error: {
77
- code: m.missingMetadata,
123
+ code: d.missingMetadata,
78
124
  message: `Activated temporal bucket result is missing column "${n.key}".`,
79
125
  path: `columns.${n.key}`
80
126
  }
81
127
  };
82
- const i = f(t, {
128
+ const a = f(t, {
83
129
  metadataRequired: !0
84
130
  });
85
- if (!i.ok)
131
+ if (!a.ok)
86
132
  return {
87
133
  ok: !1,
88
134
  error: {
89
- ...i.error,
90
- path: `columns.${n.key}.${i.error.path || "temporalBucket"}`
135
+ ...a.error,
136
+ path: `columns.${n.key}.${a.error.path || "temporalBucket"}`
91
137
  }
92
138
  };
93
- if (!i.value || !$(i.value, n.metadata))
139
+ if (!a.value || !h(a.value, n.metadata))
94
140
  return {
95
141
  ok: !1,
96
142
  error: {
97
- code: m.invalidMetadata,
143
+ code: d.invalidMetadata,
98
144
  message: `Temporal bucket metadata for column "${n.key}" contradicts the governed query context.`,
99
145
  path: `columns.${n.key}.temporalBucket`
100
146
  }
@@ -102,17 +148,17 @@ function I(e, r) {
102
148
  }
103
149
  return { ok: !0, value: e };
104
150
  }
105
- const h = "higher_is_better", A = {
151
+ const $ = "higher_is_better", I = {
106
152
  displayMode: "difference",
107
153
  showComparison: !0,
108
154
  indicatorStyle: "arrow_badge",
109
155
  showColor: !0,
110
156
  conditionalLabel: !1
111
157
  };
112
- function y(e) {
113
- return k(e) !== null;
158
+ function D(e) {
159
+ return C(e) !== null;
114
160
  }
115
- function N(e) {
161
+ function B(e) {
116
162
  var r, o, n, t;
117
163
  if (((r = e.metricComparison) == null ? void 0 : r.mode) !== "off") {
118
164
  if (((o = e.metricComparison) == null ? void 0 : o.mode) === "explicit")
@@ -125,7 +171,7 @@ function N(e) {
125
171
  };
126
172
  }
127
173
  }
128
- function R(e) {
174
+ function P(e) {
129
175
  if (e.alias) return e.alias;
130
176
  const r = e.entityName && e.entityName !== "SEMAPHOR_CALCULATED_FIELD" ? e.entityName : void 0, o = r && r !== e.name ? `${r}_` : "";
131
177
  if (e.role !== "metric") return `${o}${e.name}`;
@@ -139,16 +185,16 @@ function R(e) {
139
185
  n = n.toLowerCase();
140
186
  return `${o}${e.name}_${n}`;
141
187
  }
142
- function a(e, r, o) {
188
+ function i(e, r, o) {
143
189
  return o ? { code: e, message: r, path: o } : { code: e, message: r };
144
190
  }
145
- function d(e) {
191
+ function p(e) {
146
192
  return !!e && typeof e == "object" && !Array.isArray(e);
147
193
  }
148
- function s(e, r, o, n) {
194
+ function c(e, r, o, n) {
149
195
  Object.keys(e).forEach((t) => {
150
196
  r.includes(t) || n.push(
151
- a(
197
+ i(
152
198
  "invalid_comparison_spec",
153
199
  `Comparison kind does not accept field "${t}".`,
154
200
  `${o}.${t}`
@@ -158,13 +204,13 @@ function s(e, r, o, n) {
158
204
  }
159
205
  function u(e, r, o) {
160
206
  e.alignment !== void 0 && e.alignment !== "calendar" && e.alignment !== "weekday" && o.push(
161
- a(
207
+ i(
162
208
  "invalid_comparison_spec",
163
209
  'Comparison alignment must be "calendar" or "weekday".',
164
210
  `${r}.alignment`
165
211
  )
166
212
  ), e.toDate !== void 0 && typeof e.toDate != "boolean" && o.push(
167
- a(
213
+ i(
168
214
  "invalid_comparison_spec",
169
215
  "Comparison toDate must be a boolean.",
170
216
  `${r}.toDate`
@@ -173,7 +219,7 @@ function u(e, r, o) {
173
219
  }
174
220
  function b(e, r, o) {
175
221
  e !== void 0 && (typeof e != "number" || !Number.isSafeInteger(e) || e <= 0) && o.push(
176
- a(
222
+ i(
177
223
  "invalid_comparison_spec",
178
224
  "Comparison offset must be a positive safe integer.",
179
225
  r
@@ -182,24 +228,24 @@ function b(e, r, o) {
182
228
  }
183
229
  function _(e, r = "comparison") {
184
230
  const o = [];
185
- return d(e) ? (e.kind === "previous_period" ? (s(
231
+ return p(e) ? (e.kind === "previous_period" ? (c(
186
232
  e,
187
233
  ["kind", "offsetPeriods", "alignment", "toDate"],
188
234
  r,
189
235
  o
190
- ), b(e.offsetPeriods, `${r}.offsetPeriods`, o), u(e, r, o)) : e.kind === "previous_year" ? (s(
236
+ ), b(e.offsetPeriods, `${r}.offsetPeriods`, o), u(e, r, o)) : e.kind === "previous_year" ? (c(
191
237
  e,
192
238
  ["kind", "offsetYears", "alignment", "toDate"],
193
239
  r,
194
240
  o
195
- ), b(e.offsetYears, `${r}.offsetYears`, o), u(e, r, o)) : e.kind === "target" ? (s(e, ["kind", "targetValue"], r, o), (typeof e.targetValue != "number" || !Number.isFinite(e.targetValue)) && o.push(
196
- a(
241
+ ), b(e.offsetYears, `${r}.offsetYears`, o), u(e, r, o)) : e.kind === "target" ? (c(e, ["kind", "targetValue"], r, o), (typeof e.targetValue != "number" || !Number.isFinite(e.targetValue)) && o.push(
242
+ i(
197
243
  "invalid_comparison_spec",
198
244
  "Target comparison requires a finite targetValue.",
199
245
  `${r}.targetValue`
200
246
  )
201
247
  )) : o.push(
202
- a(
248
+ i(
203
249
  "invalid_comparison_spec",
204
250
  "Comparison kind must be previous_period, previous_year, or target.",
205
251
  `${r}.kind`
@@ -207,7 +253,7 @@ function _(e, r = "comparison") {
207
253
  ), { ok: o.length === 0, errors: o, warnings: [] }) : {
208
254
  ok: !1,
209
255
  errors: [
210
- a(
256
+ i(
211
257
  "invalid_comparison_spec",
212
258
  "Comparison spec must be an object.",
213
259
  r
@@ -216,12 +262,12 @@ function _(e, r = "comparison") {
216
262
  warnings: []
217
263
  };
218
264
  }
219
- function E(e, r = "comparison") {
220
- if (!d(e))
265
+ function R(e, r = "comparison") {
266
+ if (!p(e))
221
267
  return {
222
268
  ok: !1,
223
269
  errors: [
224
- a(
270
+ i(
225
271
  "invalid_comparison_config",
226
272
  "Comparison config must be an object.",
227
273
  r
@@ -230,20 +276,20 @@ function E(e, r = "comparison") {
230
276
  warnings: []
231
277
  };
232
278
  const o = [];
233
- return e.mode === "off" ? s(e, ["mode"], r, o) : e.mode === "explicit" ? (s(e, ["mode", "spec"], r, o), o.push(..._(e.spec, `${r}.spec`).errors)) : o.push(
234
- a(
279
+ return e.mode === "off" ? c(e, ["mode"], r, o) : e.mode === "explicit" ? (c(e, ["mode", "spec"], r, o), o.push(..._(e.spec, `${r}.spec`).errors)) : o.push(
280
+ i(
235
281
  "invalid_comparison_config",
236
282
  "Comparison mode must be off or explicit.",
237
283
  `${r}.mode`
238
284
  )
239
285
  ), { ok: o.length === 0, errors: o, warnings: [] };
240
286
  }
241
- function T(e, r = "comparisonSelection") {
242
- if (!d(e))
287
+ function w(e, r = "comparisonSelection") {
288
+ if (!p(e))
243
289
  return {
244
290
  ok: !1,
245
291
  errors: [
246
- a(
292
+ i(
247
293
  "invalid_global_date_comparison",
248
294
  "Global Date comparison selection must be an object.",
249
295
  r
@@ -253,12 +299,12 @@ function T(e, r = "comparisonSelection") {
253
299
  };
254
300
  const o = [];
255
301
  if (e.mode === "off")
256
- s(e, ["mode"], r, o);
302
+ c(e, ["mode"], r, o);
257
303
  else if (e.mode === "period") {
258
- s(e, ["mode", "spec"], r, o);
304
+ c(e, ["mode", "spec"], r, o);
259
305
  const n = _(e.spec, `${r}.spec`);
260
- o.push(...n.errors), d(e.spec) && e.spec.kind === "target" && o.push(
261
- a(
306
+ o.push(...n.errors), p(e.spec) && e.spec.kind === "target" && o.push(
307
+ i(
262
308
  "invalid_global_date_comparison",
263
309
  "Global Date comparison supports previous_period or previous_year, not target.",
264
310
  `${r}.spec.kind`
@@ -266,7 +312,7 @@ function T(e, r = "comparisonSelection") {
266
312
  );
267
313
  } else
268
314
  o.push(
269
- a(
315
+ i(
270
316
  "invalid_global_date_comparison",
271
317
  "Global Date comparison mode must be off or period.",
272
318
  `${r}.mode`
@@ -274,12 +320,12 @@ function T(e, r = "comparisonSelection") {
274
320
  );
275
321
  return { ok: o.length === 0, errors: o, warnings: [] };
276
322
  }
277
- function O(e, r = "globalDateComparison") {
278
- if (!d(e))
323
+ function E(e, r = "globalDateComparison") {
324
+ if (!p(e))
279
325
  return {
280
326
  ok: !1,
281
327
  errors: [
282
- a(
328
+ i(
283
329
  "invalid_global_date_comparison",
284
330
  "Global Date comparison context must be an object.",
285
331
  r
@@ -288,68 +334,68 @@ function O(e, r = "globalDateComparison") {
288
334
  warnings: []
289
335
  };
290
336
  const o = [];
291
- return s(
337
+ return c(
292
338
  e,
293
339
  ["selection", "inheritGlobalComparison", "owner", "referenceTime"],
294
340
  r,
295
341
  o
296
342
  ), o.push(
297
- ...T(
343
+ ...w(
298
344
  e.selection,
299
345
  `${r}.selection`
300
346
  ).errors
301
347
  ), e.inheritGlobalComparison !== void 0 && e.inheritGlobalComparison !== !1 && o.push(
302
- a(
348
+ i(
303
349
  "invalid_global_date_comparison",
304
350
  "inheritGlobalComparison may only be false when present.",
305
351
  `${r}.inheritGlobalComparison`
306
352
  )
307
- ), e.owner !== void 0 && (d(e.owner) ? e.owner.kind === "global_date" ? s(e.owner, ["kind"], `${r}.owner`, o) : e.owner.kind === "field_date" ? (s(
353
+ ), e.owner !== void 0 && (p(e.owner) ? e.owner.kind === "global_date" ? c(e.owner, ["kind"], `${r}.owner`, o) : e.owner.kind === "field_date" ? (c(
308
354
  e.owner,
309
355
  ["kind", "filterId", "label"],
310
356
  `${r}.owner`,
311
357
  o
312
358
  ), (typeof e.owner.filterId != "string" || !e.owner.filterId.trim()) && o.push(
313
- a(
359
+ i(
314
360
  "invalid_global_date_comparison",
315
361
  "Field Date comparison owner requires a non-empty filterId.",
316
362
  `${r}.owner.filterId`
317
363
  )
318
364
  ), (typeof e.owner.label != "string" || !e.owner.label.trim()) && o.push(
319
- a(
365
+ i(
320
366
  "invalid_global_date_comparison",
321
367
  "Field Date comparison owner requires a non-empty label.",
322
368
  `${r}.owner.label`
323
369
  )
324
370
  )) : o.push(
325
- a(
371
+ i(
326
372
  "invalid_global_date_comparison",
327
373
  "Comparison owner kind must be global_date or field_date.",
328
374
  `${r}.owner.kind`
329
375
  )
330
376
  ) : o.push(
331
- a(
377
+ i(
332
378
  "invalid_global_date_comparison",
333
379
  "Comparison owner must be an object.",
334
380
  `${r}.owner`
335
381
  )
336
- )), e.referenceTime !== void 0 && (typeof e.referenceTime != "string" || !y(e.referenceTime)) && o.push(
337
- a(
382
+ )), e.referenceTime !== void 0 && (typeof e.referenceTime != "string" || !D(e.referenceTime)) && o.push(
383
+ i(
338
384
  "invalid_global_date_comparison",
339
385
  "referenceTime must be a valid ISO date-time string when present.",
340
386
  `${r}.referenceTime`
341
387
  )
342
388
  ), { ok: o.length === 0, errors: o, warnings: [] };
343
389
  }
344
- function G(e) {
390
+ function O(e) {
345
391
  const { referenceTime: r, ...o } = e;
346
392
  return o;
347
393
  }
348
- function L(e, r = "comparisonPolarity") {
394
+ function G(e, r = "comparisonPolarity") {
349
395
  return e === "higher_is_better" || e === "lower_is_better" || e === "neutral" ? { ok: !0, errors: [], warnings: [] } : {
350
396
  ok: !1,
351
397
  errors: [
352
- a(
398
+ i(
353
399
  "invalid_comparison_polarity",
354
400
  "Comparison polarity must be higher_is_better, lower_is_better, or neutral.",
355
401
  r
@@ -358,12 +404,12 @@ function L(e, r = "comparisonPolarity") {
358
404
  warnings: []
359
405
  };
360
406
  }
361
- function P(e, r = "comparisonPresentation") {
362
- if (!d(e))
407
+ function L(e, r = "comparisonPresentation") {
408
+ if (!p(e))
363
409
  return {
364
410
  ok: !1,
365
411
  errors: [
366
- a(
412
+ i(
367
413
  "invalid_comparison_presentation",
368
414
  "Comparison presentation must be an object.",
369
415
  r
@@ -383,116 +429,117 @@ function P(e, r = "comparisonPresentation") {
383
429
  "conditionalLabels",
384
430
  "colors"
385
431
  ];
386
- return Object.keys(e).forEach((i) => {
387
- n.includes(i) || o.push(
388
- a(
432
+ return Object.keys(e).forEach((a) => {
433
+ n.includes(a) || o.push(
434
+ i(
389
435
  "invalid_comparison_presentation",
390
- `Comparison presentation does not accept field "${i}".`,
391
- `${r}.${i}`
436
+ `Comparison presentation does not accept field "${a}".`,
437
+ `${r}.${a}`
392
438
  )
393
439
  );
394
440
  }), [
395
441
  ["displayMode", ["difference", "percent_change", "both", "ratio"]],
396
442
  ["indicatorStyle", ["arrow_badge", "arrow", "badge", "none"]],
397
443
  ["position", ["left", "right", "top"]]
398
- ].forEach(([i, l]) => {
399
- e[i] !== void 0 && !l.includes(e[i]) && o.push(
400
- a(
444
+ ].forEach(([a, s]) => {
445
+ e[a] !== void 0 && !s.includes(e[a]) && o.push(
446
+ i(
401
447
  "invalid_comparison_presentation",
402
- `Comparison presentation ${i} is invalid.`,
403
- `${r}.${i}`
448
+ `Comparison presentation ${a} is invalid.`,
449
+ `${r}.${a}`
404
450
  )
405
451
  );
406
- }), ["showComparison", "showColor", "conditionalLabel"].forEach((i) => {
407
- e[i] !== void 0 && typeof e[i] != "boolean" && o.push(
408
- a(
452
+ }), ["showComparison", "showColor", "conditionalLabel"].forEach((a) => {
453
+ e[a] !== void 0 && typeof e[a] != "boolean" && o.push(
454
+ i(
409
455
  "invalid_comparison_presentation",
410
- `Comparison presentation ${i} must be a boolean.`,
411
- `${r}.${i}`
456
+ `Comparison presentation ${a} must be a boolean.`,
457
+ `${r}.${a}`
412
458
  )
413
459
  );
414
460
  }), e.precision !== void 0 && (typeof e.precision != "number" || !Number.isInteger(e.precision) || e.precision < 0 || e.precision > 6) && o.push(
415
- a(
461
+ i(
416
462
  "invalid_comparison_presentation",
417
463
  "Comparison presentation precision must be an integer from 0 through 6.",
418
464
  `${r}.precision`
419
465
  )
420
466
  ), e.labelName !== void 0 && typeof e.labelName != "string" && o.push(
421
- a(
467
+ i(
422
468
  "invalid_comparison_presentation",
423
469
  "Comparison presentation labelName must be a string.",
424
470
  `${r}.labelName`
425
471
  )
426
- ), ["conditionalLabels", "colors"].forEach((i) => {
427
- const l = e[i];
428
- if (l !== void 0) {
429
- if (!d(l)) {
472
+ ), ["conditionalLabels", "colors"].forEach((a) => {
473
+ const s = e[a];
474
+ if (s !== void 0) {
475
+ if (!p(s)) {
430
476
  o.push(
431
- a(
477
+ i(
432
478
  "invalid_comparison_presentation",
433
- `Comparison presentation ${i} must be an object.`,
434
- `${r}.${i}`
479
+ `Comparison presentation ${a} must be an object.`,
480
+ `${r}.${a}`
435
481
  )
436
482
  );
437
483
  return;
438
484
  }
439
- Object.keys(l).forEach((c) => {
440
- ["increase", "decrease", "neutral"].includes(c) || o.push(
441
- a(
485
+ Object.keys(s).forEach((l) => {
486
+ ["increase", "decrease", "neutral"].includes(l) || o.push(
487
+ i(
442
488
  "invalid_comparison_presentation",
443
- `Comparison presentation ${i} does not accept field "${c}".`,
444
- `${r}.${i}.${c}`
489
+ `Comparison presentation ${a} does not accept field "${l}".`,
490
+ `${r}.${a}.${l}`
445
491
  )
446
492
  );
447
- }), Object.entries(l).forEach(([c, p]) => {
448
- p !== void 0 && typeof p != "string" && o.push(
449
- a(
493
+ }), Object.entries(s).forEach(([l, m]) => {
494
+ m !== void 0 && typeof m != "string" && o.push(
495
+ i(
450
496
  "invalid_comparison_presentation",
451
- `Comparison presentation ${i}.${c} must be a string.`,
452
- `${r}.${i}.${c}`
497
+ `Comparison presentation ${a}.${l} must be a string.`,
498
+ `${r}.${a}.${l}`
453
499
  )
454
500
  );
455
501
  });
456
502
  }
457
503
  }), { ok: o.length === 0, errors: o, warnings: [] };
458
504
  }
459
- function v(e) {
505
+ function T(e) {
460
506
  return e === null ? "unknown" : e > 0 ? "increase" : e < 0 ? "decrease" : "no_change";
461
507
  }
462
- function M(e, r) {
508
+ function v(e, r) {
463
509
  return e === "unknown" || e === "no_change" || r === "neutral" ? "neutral" : r === "higher_is_better" && e === "increase" || r === "lower_is_better" && e === "decrease" ? "favorable" : "unfavorable";
464
510
  }
465
- function B(e) {
511
+ function j(e) {
466
512
  const {
467
513
  currentValue: r,
468
514
  comparisonValue: o,
469
- polarity: n = h
470
- } = e, i = r !== null && o !== null ? r - o : null, l = i !== null && o !== null && o !== 0 ? i / Math.abs(o) : null, c = r !== null && o !== null && o !== 0 ? r / o : null, p = v(i);
515
+ polarity: n = $
516
+ } = e, a = r !== null && o !== null ? r - o : null, s = a !== null && o !== null && o !== 0 ? a / Math.abs(o) : null, l = r !== null && o !== null && o !== 0 ? r / o : null, m = T(a);
471
517
  return {
472
518
  status: o === null ? "insufficient_history" : "available",
473
519
  currentValue: r,
474
520
  comparisonValue: o,
475
- delta: i,
476
- percentChange: l,
477
- ratio: c,
478
- direction: p,
479
- sentiment: M(p, n)
521
+ delta: a,
522
+ percentChange: s,
523
+ ratio: l,
524
+ direction: m,
525
+ sentiment: v(m, n)
480
526
  };
481
527
  }
482
528
  export {
483
- A as C,
484
- h as D,
529
+ I as C,
530
+ $ as D,
485
531
  N as a,
486
- _ as b,
487
- E as c,
488
- T as d,
489
- O as e,
490
- L as f,
491
- P as g,
492
- B as h,
493
- f as i,
494
- I as j,
495
- R as r,
496
- w as v,
497
- G as w
532
+ B as b,
533
+ _ as c,
534
+ R as d,
535
+ w as e,
536
+ E as f,
537
+ G as g,
538
+ L as h,
539
+ j as i,
540
+ f as j,
541
+ A as k,
542
+ P as r,
543
+ y as v,
544
+ O as w
498
545
  };
@@ -1,4 +1,4 @@
1
- import { c } from "./code-editor-DJNOsgJH.js";
1
+ import { c } from "./code-editor-BsxHzm9u.js";
2
2
  /**
3
3
  * @license lucide-react v0.453.0 - ISC
4
4
  *
@@ -0,0 +1,55 @@
1
+ var c = Object.defineProperty;
2
+ var d = (e, r, t) => r in e ? c(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var l = (e, r, t) => d(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { ad as u } from "./temporal-input-presentation-scSWQXAB.js";
5
+ import "./validators-B8fpdinG.js";
6
+ import "./matrix-operation-contract-DCVinw1o.js";
7
+ import { r as v } from "./metric-comparison-n9NsIa-2.js";
8
+ import "./analytics-base-schemas-BaIQrEzX.js";
9
+ class f extends Error {
10
+ constructor(t, a) {
11
+ super(`${t}: ${a}`);
12
+ l(this, "deliveryBlocking", !0);
13
+ this.code = t, this.name = "PivotHeaderPresentationError";
14
+ }
15
+ }
16
+ function h(e) {
17
+ var i;
18
+ const r = e.mode ?? "formatted", t = e.members.map((o) => {
19
+ var n;
20
+ if (r === "canonical" || !o.temporalBucket)
21
+ return o.value === null ? "" : String(o.value);
22
+ const s = (n = e.resolveTemporalFormat) == null ? void 0 : n.call(e, o.fieldId);
23
+ if (!s)
24
+ throw new f(
25
+ "missing_resolved_temporal_format",
26
+ `Missing resolved temporal presentation for pivot field "${o.fieldId}"`
27
+ );
28
+ return u({
29
+ value: o.value,
30
+ metadata: o.temporalBucket,
31
+ format: s
32
+ });
33
+ }), a = ((i = e.metricLabel) == null ? void 0 : i.trim()) || void 0;
34
+ return {
35
+ memberLabels: t,
36
+ ...a ? { metricLabel: a } : {},
37
+ flattenedLabel: [
38
+ ...t,
39
+ ...a ? [a] : []
40
+ ].join(" / ")
41
+ };
42
+ }
43
+ function k(e) {
44
+ const r = /* @__PURE__ */ new Map();
45
+ return e.forEach((t) => {
46
+ t.id && r.set(t.id, (r.get(t.id) ?? 0) + 1);
47
+ }), e.flatMap(
48
+ (t) => t.id && (r.get(t.id) ?? 0) > 1 ? [v(t)] : []
49
+ );
50
+ }
51
+ export {
52
+ f as P,
53
+ k as d,
54
+ h as p
55
+ };