react-semaphor 0.1.464 → 0.1.466

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 (96) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +132 -130
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +4 -4
  7. package/dist/chunks/{analyze-result-contract-DROq4vgY.js → analyze-result-contract-CMZDRRwo.js} +1 -1
  8. package/dist/chunks/{analyze-result-contract-DSGoFuXQ.cjs → analyze-result-contract-CMwVg9w2.cjs} +1 -1
  9. package/dist/chunks/{common-types-BHVKgxRR.js → common-types-Co766x6t.js} +1 -1
  10. package/dist/chunks/{common-types-BcV9PD9D.cjs → common-types-o3LJcrpg.cjs} +1 -1
  11. package/dist/chunks/{dashboard-briefing-launcher-CTozRa6c.js → dashboard-briefing-launcher-C_Iy9yvg.js} +9 -9
  12. package/dist/chunks/{dashboard-briefing-launcher-BSMtcAgE.cjs → dashboard-briefing-launcher-DbLc4VV9.cjs} +1 -1
  13. package/dist/chunks/{dashboard-controls-wuo6PrDm.js → dashboard-controls-C25Pk_CY.js} +9 -9
  14. package/dist/chunks/{dashboard-controls-CmK7U1hI.cjs → dashboard-controls-Rotbld-z.cjs} +1 -1
  15. package/dist/chunks/{dashboard-filter-value-compatibility-KXIyvbhc.js → dashboard-filter-value-compatibility-B8ynE_O1.js} +255 -240
  16. package/dist/chunks/dashboard-filter-value-compatibility-Bnl2lsng.cjs +1 -0
  17. package/dist/chunks/{dashboard-input-contract-BkRFQ7Tq.cjs → dashboard-input-contract-12mPNhCF.cjs} +1 -1
  18. package/dist/chunks/{dashboard-input-contract-D5dxTWJ5.js → dashboard-input-contract-Px64VWBL.js} +1 -1
  19. package/dist/chunks/{dashboard-json-C9qvau-c.js → dashboard-json-DjMbADzW.js} +7 -7
  20. package/dist/chunks/{dashboard-json-7BQDKnHy.cjs → dashboard-json-LeJ0JD4L.cjs} +1 -1
  21. package/dist/chunks/{edit-dashboard-visual-CHlsiGOo.js → edit-dashboard-visual-BDNcPoBS.js} +2727 -2709
  22. package/dist/chunks/{edit-dashboard-visual-BSWdyT4u.cjs → edit-dashboard-visual-ryv-jOUA.cjs} +14 -14
  23. package/dist/chunks/{editor-action-buttons-B0o-qU4l.js → editor-action-buttons-CFDC0po3.js} +6 -6
  24. package/dist/chunks/{editor-action-buttons-DMnbVoBJ.cjs → editor-action-buttons-lBwd5Stw.cjs} +1 -1
  25. package/dist/chunks/{index-De_7nrwb.js → index-BlCnNcaB.js} +9 -9
  26. package/dist/chunks/{index-DQvtZ1gG.js → index-Bs9OvwM2.js} +29357 -29207
  27. package/dist/chunks/{index-DjjKJPDy.cjs → index-CQN-X1jN.cjs} +1 -1
  28. package/dist/chunks/{index-DqMJN4lZ.cjs → index-UKhl24L_.cjs} +164 -164
  29. package/dist/chunks/{matrix-result-contract-BTpPuHOc.js → matrix-result-contract-DQ9_UadF.js} +3 -3
  30. package/dist/chunks/{matrix-result-contract-ZRNfeIbI.cjs → matrix-result-contract-DiHDIyQk.cjs} +1 -1
  31. package/dist/chunks/{pivot-header-presentation-DW0gKG8g.js → pivot-header-presentation-CSf6CyOt.js} +2 -2
  32. package/dist/chunks/{pivot-header-presentation-BijPbP33.cjs → pivot-header-presentation-DyV0iOZ_.cjs} +1 -1
  33. package/dist/chunks/{pivot-result-identity-Z9tN2tEV.js → pivot-result-identity-BvT51Nog.js} +1 -1
  34. package/dist/chunks/{pivot-result-identity-DxHtiKVj.cjs → pivot-result-identity-gsOwOjHi.cjs} +1 -1
  35. package/dist/chunks/{pivot-result-lifecycle-g2U-vzQb.js → pivot-result-lifecycle--NNNPUtG.js} +7 -7
  36. package/dist/chunks/{pivot-result-lifecycle-BXzIlQVu.cjs → pivot-result-lifecycle-CEfU43GZ.cjs} +1 -1
  37. package/dist/chunks/{raw-temporal-contract-UtAqoOZO.js → raw-temporal-contract-BqVMduCs.js} +1 -1
  38. package/dist/chunks/{raw-temporal-contract-DfAvqNMo.cjs → raw-temporal-contract-UdblxoVB.cjs} +1 -1
  39. package/dist/chunks/{report-preferences-dialog-CkKbfjRg.cjs → report-preferences-dialog-DzUi-b9O.cjs} +1 -1
  40. package/dist/chunks/{report-preferences-dialog-BP4YC4D_.js → report-preferences-dialog-JCUuGAtd.js} +6 -6
  41. package/dist/chunks/{report-runtime-context-C0NfLPfc.cjs → report-runtime-context-CLtzrZdC.cjs} +1 -1
  42. package/dist/chunks/{report-runtime-context-CNncA3VD.js → report-runtime-context-CrTzKt0C.js} +1 -1
  43. package/dist/chunks/{saved-temporal-bucket-format-3QKveR3v.cjs → saved-temporal-bucket-format-Ca4hUfTo.cjs} +1 -1
  44. package/dist/chunks/{saved-temporal-bucket-format-Dd2eixTH.js → saved-temporal-bucket-format-DfqnCGCz.js} +3 -3
  45. package/dist/chunks/{switch-G_-UwdXX.js → switch-B6rFVSdw.js} +2942 -2892
  46. package/dist/chunks/{switch-CNqDn5b8.cjs → switch-BghC7eOM.cjs} +11 -11
  47. package/dist/chunks/{temporal-bucket-pMfghsLX.cjs → temporal-bucket-BDRcWdVv.cjs} +1 -1
  48. package/dist/chunks/{temporal-bucket-C85rmFmC.js → temporal-bucket-DFYIkexB.js} +18 -18
  49. package/dist/chunks/{temporal-bucket-authoring-BK1UhYpD.cjs → temporal-bucket-authoring-C6sZAVqS.cjs} +1 -1
  50. package/dist/chunks/{temporal-bucket-authoring-1fZuPAVb.js → temporal-bucket-authoring-ZxFzhTmL.js} +12 -12
  51. package/dist/chunks/{temporal-bucket-contract-DXXNZssK.js → temporal-bucket-contract-COPPwwbi.js} +1 -1
  52. package/dist/chunks/{temporal-bucket-contract-xFkvboaw.cjs → temporal-bucket-contract-vrOkax-r.cjs} +1 -1
  53. package/dist/chunks/{token-types-BYYO109W.cjs → token-types-DALtlgbG.cjs} +1 -1
  54. package/dist/chunks/{token-types-BLxc7UwR.js → token-types-p1M3SA2G.js} +1 -1
  55. package/dist/chunks/{update-policy-CB8XJIoY.js → update-policy-BKOA5S76.js} +1 -1
  56. package/dist/chunks/{update-policy-DMjjGjQY.cjs → update-policy-Cyufdviq.cjs} +1 -1
  57. package/dist/chunks/{validators-DVd8s3qY.js → validators-CCpBY1e0.js} +824 -788
  58. package/dist/chunks/validators-DO-YuzgO.cjs +1 -0
  59. package/dist/dashboard/index.cjs +1 -1
  60. package/dist/dashboard/index.js +2 -2
  61. package/dist/dashboard-authoring/index.cjs +2 -2
  62. package/dist/dashboard-authoring/index.js +6 -5
  63. package/dist/data-app-builder/index.cjs +1 -1
  64. package/dist/data-app-builder/index.js +2 -2
  65. package/dist/data-app-codegen/index.cjs +1 -1
  66. package/dist/data-app-codegen/index.js +2 -2
  67. package/dist/data-app-codegen-node/index.cjs +1 -1
  68. package/dist/data-app-codegen-node/index.js +3 -3
  69. package/dist/data-app-sdk/index.cjs +1 -1
  70. package/dist/data-app-sdk/index.js +3 -3
  71. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  72. package/dist/data-app-sdk-adapters/index.js +2 -2
  73. package/dist/data-app-sdk-validation/index.cjs +1 -1
  74. package/dist/data-app-sdk-validation/index.js +3 -3
  75. package/dist/format-utils/index.cjs +1 -1
  76. package/dist/format-utils/index.js +15 -15
  77. package/dist/index.cjs +1 -1
  78. package/dist/index.js +14 -14
  79. package/dist/report-runtime-context/index.cjs +1 -1
  80. package/dist/report-runtime-context/index.js +2 -2
  81. package/dist/surfboard/index.cjs +1 -1
  82. package/dist/surfboard/index.js +3 -3
  83. package/dist/types/analytics-protocol.d.ts +15 -0
  84. package/dist/types/briefings.d.ts +1 -0
  85. package/dist/types/dashboard-assistant.d.ts +1 -0
  86. package/dist/types/dashboard-authoring.d.ts +15 -1
  87. package/dist/types/dashboard.d.ts +1 -0
  88. package/dist/types/index.cjs +1 -1
  89. package/dist/types/index.js +4 -4
  90. package/dist/types/main.d.ts +2 -1
  91. package/dist/types/shared.d.ts +1 -0
  92. package/dist/types/surfboard.d.ts +1 -0
  93. package/dist/types/types.d.ts +1 -0
  94. package/package.json +1 -1
  95. package/dist/chunks/dashboard-filter-value-compatibility-UapptYnn.cjs +0 -1
  96. package/dist/chunks/validators-dJlwubP4.cjs +0 -1
@@ -1,5 +1,5 @@
1
1
  import { z as a } from "zod";
2
- const O = [
2
+ const P = [
3
3
  "second",
4
4
  "minute",
5
5
  "hour",
@@ -9,39 +9,39 @@ const O = [
9
9
  "quarter",
10
10
  "year"
11
11
  ];
12
- function Ii(e) {
13
- return typeof e == "string" && O.includes(e);
12
+ function Ri(e) {
13
+ return typeof e == "string" && P.includes(e);
14
14
  }
15
- const [, , ...fe] = O;
16
- function xi(e) {
17
- return Ii(e) && fe.includes(e);
15
+ const [, , ...ge] = P;
16
+ function Mi(e) {
17
+ return Ri(e) && ge.includes(e);
18
18
  }
19
- const Ai = [
19
+ const Ti = [
20
20
  "week_of_short",
21
21
  "week_of_long",
22
22
  "quarter_short",
23
23
  "quarter_long",
24
24
  "fiscal_quarter_short",
25
25
  "fiscal_year"
26
- ], An = {
26
+ ], Tn = {
27
27
  invalidMetadata: "invalid_raw_temporal_metadata"
28
28
  };
29
- function Ri(e) {
29
+ function ji(e) {
30
30
  return e === "second" || e === "minute" || e === "hour" ? "datetime" : "date";
31
31
  }
32
- const Rn = {
32
+ const jn = {
33
33
  missingMetadata: "missing_temporal_bucket_metadata",
34
34
  invalidMetadata: "invalid_temporal_bucket_metadata",
35
35
  invalidValue: "invalid_temporal_bucket_value"
36
- }, Mn = "__auto_count__";
37
- function Mi(e) {
36
+ }, En = "__auto_count__";
37
+ function Ei(e) {
38
38
  try {
39
39
  return new Intl.DateTimeFormat("en-US", { timeZone: e }).format(), !0;
40
40
  } catch {
41
41
  return !1;
42
42
  }
43
43
  }
44
- const Ti = {
44
+ const Ci = {
45
45
  answerSummary: "string",
46
46
  responseDetail: "responseDetail",
47
47
  mode: "string",
@@ -81,19 +81,41 @@ const Ti = {
81
81
  periodRows: "recordArray",
82
82
  sql: "unknown",
83
83
  omitted: "stringArray"
84
- }, ji = "SUM";
85
- function x(e) {
84
+ }, Fi = "SUM";
85
+ function S(e) {
86
86
  return typeof e == "string" && e.trim().length > 0;
87
87
  }
88
- function Tn(e) {
89
- return e ? e.kind === "semantic" ? !!(x(e.domainId) && (x(e.datasetId) || x(e.datasetName))) : e.kind === "physical" ? x(e.connectionId) && x(e.tableName) : x(e.connectionId) : !1;
88
+ function Ae(e) {
89
+ return S(e) ? e.trim().toLowerCase() : "";
90
90
  }
91
- function ae(e) {
92
- return e ? e.kind === "semantic" ? [
93
- e.kind,
94
- e.domainId,
95
- e.datasetId ? `datasetId:${e.datasetId}` : `datasetName:${e.datasetName}`
96
- ].join(":") : e.kind === "physical" ? [
91
+ function A(e) {
92
+ const i = S(e.datasetId) ? e.datasetId.trim() : void 0;
93
+ if (i)
94
+ return Ae(i) === Ae(e.datasetName) ? void 0 : i;
95
+ }
96
+ function Ue(e) {
97
+ if (e.kind !== "semantic") return e;
98
+ const i = A(e), { datasetId: t, ...n } = e;
99
+ return {
100
+ ...n,
101
+ ...i ? { datasetId: i } : {}
102
+ };
103
+ }
104
+ function Cn(e) {
105
+ return e ? e.kind === "semantic" ? !!(S(e.domainId) && (S(e.datasetId) || S(e.datasetName))) : e.kind === "physical" ? S(e.connectionId) && S(e.tableName) : S(e.connectionId) : !1;
106
+ }
107
+ function ne(e) {
108
+ if (!e)
109
+ return "";
110
+ if (e.kind === "semantic") {
111
+ const i = A(e);
112
+ return [
113
+ e.kind,
114
+ e.domainId,
115
+ i ? `datasetId:${i}` : `datasetName:${e.datasetName}`
116
+ ].join(":");
117
+ }
118
+ return e.kind === "physical" ? [
97
119
  e.kind,
98
120
  e.connectionId,
99
121
  e.databaseName || "",
@@ -104,77 +126,89 @@ function ae(e) {
104
126
  e.connectionId,
105
127
  e.dialect || "",
106
128
  e.label || ""
107
- ].join(":") : "";
129
+ ].join(":");
108
130
  }
109
- function ge(e, i) {
110
- return !e || !i ? e === i : e.kind !== i.kind ? !1 : e.kind === "semantic" && i.kind === "semantic" ? e.domainId !== i.domainId ? !1 : e.datasetId && i.datasetId ? e.datasetId === i.datasetId : e.datasetName === i.datasetName : ae(e) === ae(i);
131
+ function he(e, i) {
132
+ if (!e || !i)
133
+ return e === i;
134
+ if (e.kind !== i.kind)
135
+ return !1;
136
+ if (e.kind === "semantic" && i.kind === "semantic") {
137
+ if (e.domainId !== i.domainId)
138
+ return !1;
139
+ const t = A(e), n = A(i);
140
+ return t && n ? t === n : e.datasetName === i.datasetName;
141
+ }
142
+ return ne(e) === ne(i);
111
143
  }
112
- function Le(e, i) {
113
- return e.kind !== "semantic" || i.kind !== "semantic" ? e : {
144
+ function Ge(e, i) {
145
+ return e.kind !== "semantic" || i.kind !== "semantic" ? e : Ue({
114
146
  ...e,
115
147
  datasetName: e.datasetName || i.datasetName,
116
- datasetId: e.datasetId || i.datasetId,
148
+ datasetId: A(e) || A(i),
117
149
  label: e.label || i.label,
118
150
  connectionId: e.connectionId || i.connectionId
119
- };
151
+ });
120
152
  }
121
- function jn(e) {
153
+ function Fn(e) {
122
154
  const i = [];
123
155
  for (const t of e) {
124
- const n = i.findIndex(
125
- (s) => ge(s, t)
156
+ const n = Ue(
157
+ t
158
+ ), s = i.findIndex(
159
+ (r) => he(r, n)
126
160
  );
127
- if (n === -1) {
128
- i.push(t);
161
+ if (s === -1) {
162
+ i.push(n);
129
163
  continue;
130
164
  }
131
- i[n] = Le(
132
- i[n],
133
- t
165
+ i[s] = Ge(
166
+ i[s],
167
+ n
134
168
  );
135
169
  }
136
170
  return i;
137
171
  }
138
- function Ei(e, i) {
139
- return e.name === i.name && ge(e.source, i.source);
172
+ function Di(e, i) {
173
+ return e.name === i.name && he(e.source, i.source);
140
174
  }
141
- function Ci(e) {
175
+ function Ni(e) {
142
176
  return [
143
- e.source ? ae(e.source) : "unknown",
144
- he(e),
177
+ e.source ? ne(e.source) : "unknown",
178
+ ye(e),
145
179
  e.name
146
180
  ].filter(Boolean).join(":");
147
181
  }
148
- function he(e) {
149
- return Fi(
150
- e.aggregate || ji
182
+ function ye(e) {
183
+ return qi(
184
+ e.aggregate || Fi
151
185
  );
152
186
  }
153
- function Fi(e) {
187
+ function qi(e) {
154
188
  return e.trim().toUpperCase();
155
189
  }
156
- function En(e, i) {
190
+ function Dn(e, i) {
157
191
  return {
158
192
  ...e,
159
193
  label: e.label || i.label,
160
194
  role: e.role || i.role,
161
195
  dataType: e.dataType || i.dataType,
162
- source: e.source && i.source ? Le(e.source, i.source) : e.source || i.source
196
+ source: e.source && i.source ? Ge(e.source, i.source) : e.source || i.source
163
197
  };
164
198
  }
165
- const ne = "semaphor-data-app-codegen-summary/v1", Cn = "semaphor-data-app-codegen-summary-validator/v2", Di = /* @__PURE__ */ new Set([
199
+ const se = "semaphor-data-app-codegen-summary/v1", Nn = "semaphor-data-app-codegen-summary-validator/v2", Oi = /* @__PURE__ */ new Set([
166
200
  "metric",
167
201
  "records",
168
202
  "matrix",
169
203
  "analysis",
170
204
  "sql_fallback"
171
- ]), Ni = /* @__PURE__ */ new Set([
205
+ ]), Pi = /* @__PURE__ */ new Set([
172
206
  "semaphor.metric",
173
207
  "semaphor.records",
174
208
  "semaphor.matrix",
175
209
  "semaphor.analysis",
176
210
  "semaphor.sql"
177
- ]), qi = /* @__PURE__ */ new Set([
211
+ ]), Bi = /* @__PURE__ */ new Set([
178
212
  "SUM",
179
213
  "COUNT",
180
214
  "AVG",
@@ -182,13 +216,13 @@ const ne = "semaphor-data-app-codegen-summary/v1", Cn = "semaphor-data-app-codeg
182
216
  "MAX",
183
217
  "MEDIAN",
184
218
  "DISTINCT"
185
- ]), Oi = /* @__PURE__ */ new Set([
219
+ ]), Ki = /* @__PURE__ */ new Set([
186
220
  "absolute_delta",
187
221
  "largest_negative",
188
222
  "largest_positive",
189
223
  "positive_and_negative",
190
224
  "all"
191
- ]), He = /* @__PURE__ */ new Set([
225
+ ]), ze = /* @__PURE__ */ new Set([
192
226
  "source",
193
227
  "id",
194
228
  "label",
@@ -203,8 +237,8 @@ const ne = "semaphor-data-app-codegen-summary/v1", Cn = "semaphor-data-app-codeg
203
237
  "relationshipHint",
204
238
  "limit",
205
239
  "derivedFields"
206
- ]), Bi = /* @__PURE__ */ new Set([
207
- ...He,
240
+ ]), Vi = /* @__PURE__ */ new Set([
241
+ ...ze,
208
242
  "analysis",
209
243
  "timeWindow",
210
244
  "filters",
@@ -213,7 +247,7 @@ const ne = "semaphor-data-app-codegen-summary/v1", Cn = "semaphor-data-app-codeg
213
247
  "calendarContext",
214
248
  "chartTitle",
215
249
  "chartType"
216
- ]), Pi = /* @__PURE__ */ new Set([
250
+ ]), Li = /* @__PURE__ */ new Set([
217
251
  "source",
218
252
  "id",
219
253
  "label",
@@ -228,7 +262,7 @@ const ne = "semaphor-data-app-codegen-summary/v1", Cn = "semaphor-data-app-codeg
228
262
  "pagination",
229
263
  "totals",
230
264
  "derivedFields"
231
- ]), Ki = /* @__PURE__ */ new Set([
265
+ ]), Hi = /* @__PURE__ */ new Set([
232
266
  "source",
233
267
  "id",
234
268
  "label",
@@ -242,7 +276,7 @@ const ne = "semaphor-data-app-codegen-summary/v1", Cn = "semaphor-data-app-codeg
242
276
  "expansion",
243
277
  "layout",
244
278
  "displayLimits"
245
- ]), Vi = /* @__PURE__ */ new Set([
279
+ ]), Ui = /* @__PURE__ */ new Set([
246
280
  "source",
247
281
  "id",
248
282
  "label",
@@ -253,7 +287,7 @@ const ne = "semaphor-data-app-codegen-summary/v1", Cn = "semaphor-data-app-codeg
253
287
  "limit",
254
288
  "pagination",
255
289
  "rationale"
256
- ]), Li = /* @__PURE__ */ new Set([
290
+ ]), Gi = /* @__PURE__ */ new Set([
257
291
  "kpi",
258
292
  "line_chart",
259
293
  "bar_chart",
@@ -266,7 +300,7 @@ const ne = "semaphor-data-app-codegen-summary/v1", Cn = "semaphor-data-app-codeg
266
300
  "narrative",
267
301
  "text_block",
268
302
  "custom"
269
- ]), Hi = /* @__PURE__ */ new Set([
303
+ ]), zi = /* @__PURE__ */ new Set([
270
304
  "missing_measure",
271
305
  "missing_dimension",
272
306
  "missing_date",
@@ -283,47 +317,47 @@ const ne = "semaphor-data-app-codegen-summary/v1", Cn = "semaphor-data-app-codeg
283
317
  "requires_sql_escape_hatch",
284
318
  "unsupported_sdk_capability"
285
319
  ]);
286
- function Fn(e) {
287
- return Ue(e).ok;
320
+ function qn(e) {
321
+ return Ye(e).ok;
288
322
  }
289
- function Ue(e) {
323
+ function Ye(e) {
290
324
  const i = [];
291
325
  if (!e || typeof e != "object")
292
326
  return { ok: !1, issues: ["Summary must be an object."] };
293
327
  const t = e;
294
- return t.schemaVersion !== ne && i.push(
295
- `schemaVersion must be ${ne}.`
328
+ return t.schemaVersion !== se && i.push(
329
+ `schemaVersion must be ${se}.`
296
330
  ), (typeof t.title != "string" || !t.title.trim()) && i.push("title is required."), Array.isArray(t.sources) || i.push("sources must be an array."), Array.isArray(t.inputs) || i.push("inputs must be an array."), Array.isArray(t.views) || i.push("views must be an array."), Array.isArray(t.filterContracts) || i.push("filterContracts must be an array."), (!t.implementationChecklist || typeof t.implementationChecklist != "object") && i.push("implementationChecklist must be an object."), t.implementationChecklist && typeof t.implementationChecklist == "object" && i.push(
297
- ...Gi(t.implementationChecklist)
331
+ ...Qi(t.implementationChecklist)
298
332
  ), Array.isArray(t.sources) && t.sources.forEach((n, s) => {
299
333
  i.push(...B(n, `sources.${s}`));
300
334
  }), Array.isArray(t.inputs) && t.inputs.forEach((n, s) => {
301
- i.push(...zi(n, `inputs.${s}`));
335
+ i.push(...Zi(n, `inputs.${s}`));
302
336
  }), Array.isArray(t.views) && t.views.forEach((n, s) => {
303
- i.push(...Yi(n, `views.${s}`));
337
+ i.push(...Xi(n, `views.${s}`));
304
338
  }), Array.isArray(t.filterContracts) && t.filterContracts.forEach((n, s) => {
305
339
  i.push(
306
- ...nt(n, `filterContracts.${s}`)
340
+ ...rt(n, `filterContracts.${s}`)
307
341
  );
308
342
  }), t.unsupportedInsights !== void 0 && (Array.isArray(t.unsupportedInsights) ? t.unsupportedInsights.forEach((n, s) => {
309
343
  i.push(
310
- ...kt(
344
+ ...At(
311
345
  n,
312
346
  `unsupportedInsights.${s}`
313
347
  )
314
348
  );
315
- }) : i.push("unsupportedInsights must be an array.")), i.push(...Ui(t)), { ok: i.length === 0, issues: i };
349
+ }) : i.push("unsupportedInsights must be an array.")), i.push(...Yi(t)), { ok: i.length === 0, issues: i };
316
350
  }
317
- function Ui(e) {
351
+ function Yi(e) {
318
352
  const i = Array.isArray(e.unsupportedInsights) && e.unsupportedInsights.some(
319
353
  (l) => {
320
354
  var d;
321
- return xe.has((d = c(l)) == null ? void 0 : d.reason);
355
+ return Re.has((d = c(l)) == null ? void 0 : d.reason);
322
356
  }
323
357
  ), t = Array.isArray(e.views) && e.views.some((l) => {
324
358
  var u;
325
359
  const d = c((u = c(l)) == null ? void 0 : u.computation);
326
- return (d == null ? void 0 : d.kind) === "unsupported" && xe.has(d.reason);
360
+ return (d == null ? void 0 : d.kind) === "unsupported" && Re.has(d.reason);
327
361
  });
328
362
  if (!i && !t)
329
363
  return [];
@@ -336,7 +370,7 @@ function Ui(e) {
336
370
  "nextRequiredTool.name must be semaphor_propose_semantic_model_change when semantic model repair gaps are present."
337
371
  ), n;
338
372
  }
339
- const xe = /* @__PURE__ */ new Set([
373
+ const Re = /* @__PURE__ */ new Set([
340
374
  "missing_relationship",
341
375
  "raw_identifier_filter_options"
342
376
  ]);
@@ -344,7 +378,7 @@ function B(e, i) {
344
378
  const t = c(e);
345
379
  return t ? t.kind === "semantic" ? typeof t.domainId == "string" && t.domainId.trim() && typeof t.datasetName == "string" && t.datasetName.trim() ? [] : [`${i} must include sourceKey or a supported source identity.`] : typeof t.sourceKey == "string" && t.sourceKey.trim() ? [] : t.kind === "physical" && typeof t.tableName == "string" && t.tableName.trim() && typeof t.connectionId == "string" && t.connectionId.trim() ? [] : t.kind === "sql" && typeof t.connectionId == "string" && t.connectionId.trim() ? [] : [`${i} must include sourceKey or a supported source identity.`] : [`${i} must be an object.`];
346
380
  }
347
- function Gi(e) {
381
+ function Qi(e) {
348
382
  const i = c(e);
349
383
  if (!i)
350
384
  return ["implementationChecklist must be an object."];
@@ -369,12 +403,12 @@ function Gi(e) {
369
403
  "implementationChecklist.browserSmokeChecks must be an array of strings."
370
404
  ), t;
371
405
  }
372
- function zi(e, i) {
406
+ function Zi(e, i) {
373
407
  const t = c(e);
374
408
  if (!t)
375
409
  return [`${i} must be an object.`];
376
410
  const n = [];
377
- return (typeof t.id != "string" || !t.id.trim()) && n.push(`${i}.id is required.`), t.fieldRef && n.push(...h(t.fieldRef, `${i}.fieldRef`)), n.push(...ze(t.optionQuery, `${i}.optionQuery`)), $(t.appliesToViewIds) || n.push(`${i}.appliesToViewIds must be an array of strings.`), t.bindings !== void 0 && !Array.isArray(t.bindings) && n.push(`${i}.bindings must be an array.`), Array.isArray(t.bindings) && t.bindings.forEach((s, r) => {
411
+ return (typeof t.id != "string" || !t.id.trim()) && n.push(`${i}.id is required.`), t.fieldRef && n.push(...h(t.fieldRef, `${i}.fieldRef`)), n.push(...Ze(t.optionQuery, `${i}.optionQuery`)), $(t.appliesToViewIds) || n.push(`${i}.appliesToViewIds must be an array of strings.`), t.bindings !== void 0 && !Array.isArray(t.bindings) && n.push(`${i}.bindings must be an array.`), Array.isArray(t.bindings) && t.bindings.forEach((s, r) => {
378
412
  const l = c(s);
379
413
  if (!l) {
380
414
  n.push(`${i}.bindings.${r} must be an object.`);
@@ -390,15 +424,15 @@ function zi(e, i) {
390
424
  );
391
425
  }), n;
392
426
  }
393
- function Yi(e, i) {
427
+ function Xi(e, i) {
394
428
  const t = c(e);
395
429
  if (!t)
396
430
  return [`${i} must be an object.`];
397
431
  const n = [];
398
- if ((typeof t.id != "string" || !t.id.trim()) && n.push(`${i}.id is required.`), t.visualSpec !== void 0 && n.push(...yt(t.visualSpec, `${i}.visualSpec`)), t.computation !== void 0 && n.push(
399
- ...St(t.computation, `${i}.computation`)
400
- ), ht(t))
401
- return n.push(...X(t, `${i}`)), t.fields !== void 0 && (Array.isArray(t.fields) ? t.fields.forEach((u, p) => {
432
+ if ((typeof t.id != "string" || !t.id.trim()) && n.push(`${i}.id is required.`), t.visualSpec !== void 0 && n.push(...vt(t.visualSpec, `${i}.visualSpec`)), t.computation !== void 0 && n.push(
433
+ ...xt(t.computation, `${i}.computation`)
434
+ ), _t(t))
435
+ return n.push(...W(t, `${i}`)), t.fields !== void 0 && (Array.isArray(t.fields) ? t.fields.forEach((u, p) => {
402
436
  n.push(
403
437
  ...h(u, `${i}.fields.${p}`)
404
438
  );
@@ -406,30 +440,30 @@ function Yi(e, i) {
406
440
  `${i}.sdkBuilder is not allowed for non-executable views.`
407
441
  ), t.sdkSpec !== void 0 && n.push(`${i}.sdkSpec is not allowed for non-executable views.`), n;
408
442
  if (!Array.isArray(t.fields))
409
- return n.push(`${i}.fields must be an array.`), (t.sdkSpec !== void 0 || t.sdkBuilder !== void 0) && n.push(`${i}.fields must be an array for executable views.`), n.push(...X(t, `${i}`)), n;
443
+ return n.push(`${i}.fields must be an array.`), (t.sdkSpec !== void 0 || t.sdkBuilder !== void 0) && n.push(`${i}.fields must be an array for executable views.`), n.push(...W(t, `${i}`)), n;
410
444
  t.fields.forEach((u, p) => {
411
445
  n.push(...h(u, `${i}.fields.${p}`));
412
- }), C(t.queryKind) || n.push(`${i}.queryKind must be a supported codegen query kind.`), t.sdkBuilder !== void 0 && !Ze(t.sdkBuilder) && n.push(`${i}.sdkBuilder must be a supported SDK builder.`), t.metricBindingKeys !== void 0 && (Array.isArray(t.metricBindingKeys) ? t.metricBindingKeys.some(
446
+ }), F(t.queryKind) || n.push(`${i}.queryKind must be a supported codegen query kind.`), t.sdkBuilder !== void 0 && !Je(t.sdkBuilder) && n.push(`${i}.sdkBuilder must be a supported SDK builder.`), t.metricBindingKeys !== void 0 && (Array.isArray(t.metricBindingKeys) ? t.metricBindingKeys.some(
413
447
  (u) => typeof u != "string" || u.trim().length === 0
414
448
  ) && n.push(`${i}.metricBindingKeys must be an array of strings.`) : n.push(`${i}.metricBindingKeys must be an array of strings.`));
415
449
  const s = c(t.sdkSpec), r = (s == null ? void 0 : s.builder) === "semaphor.metric";
416
450
  r && (!Array.isArray(t.metricBindingKeys) || t.metricBindingKeys.length === 0) && n.push(`${i}.metricBindingKeys is required for metric views.`);
417
- const l = Qi(t);
451
+ const l = Wi(t);
418
452
  r && Array.isArray(t.metricBindingKeys) && l && JSON.stringify(t.metricBindingKeys) !== JSON.stringify(l) && n.push(
419
453
  `${i}.metricBindingKeys must match the generated metric field binding keys in order.`
420
454
  );
421
455
  const d = c(t.computation);
422
- return (d == null ? void 0 : d.kind) === "server_query" && C(t.queryKind) && C(d.queryKind) && d.queryKind !== t.queryKind && n.push(`${i}.computation.queryKind must match queryKind.`), n.push(
423
- ...st({
456
+ return (d == null ? void 0 : d.kind) === "server_query" && F(t.queryKind) && F(d.queryKind) && d.queryKind !== t.queryKind && n.push(`${i}.computation.queryKind must match queryKind.`), n.push(
457
+ ...lt({
424
458
  value: t.sdkSpec,
425
459
  path: `${i}.sdkSpec`,
426
460
  queryKind: typeof t.queryKind == "string" ? t.queryKind : void 0,
427
461
  sdkBuilder: typeof t.sdkBuilder == "string" ? t.sdkBuilder : void 0
428
462
  }),
429
- ...X(t, `${i}`)
463
+ ...W(t, `${i}`)
430
464
  ), n;
431
465
  }
432
- function Qi(e) {
466
+ function Wi(e) {
433
467
  const i = c(e.sdkSpec);
434
468
  if ((i == null ? void 0 : i.builder) !== "semaphor.metric")
435
469
  return;
@@ -439,28 +473,28 @@ function Qi(e) {
439
473
  const s = [
440
474
  t.primaryMeasure,
441
475
  ...Array.isArray(t.measures) ? t.measures : []
442
- ].map(Zi).filter(
476
+ ].map(Ji).filter(
443
477
  (r) => !!r
444
478
  );
445
479
  return Array.from(
446
480
  new Map(s.map((r) => [r.identity, r.bindingKey])).values()
447
481
  );
448
482
  }
449
- function Zi(e) {
483
+ function Ji(e) {
450
484
  const i = c(e);
451
485
  if (!i || typeof i.name != "string" || !i.name.trim())
452
486
  return;
453
- const t = Xi(i);
487
+ const t = et(i);
454
488
  return t ? {
455
489
  identity: JSON.stringify({
456
490
  source: t,
457
491
  name: i.name,
458
- aggregate: Ge(i)
492
+ aggregate: Qe(i)
459
493
  }),
460
- bindingKey: Wi(i)
494
+ bindingKey: it(i)
461
495
  } : void 0;
462
496
  }
463
- function Xi(e) {
497
+ function et(e) {
464
498
  if (typeof e.sourceKey == "string" && e.sourceKey.trim())
465
499
  return { sourceKey: e.sourceKey };
466
500
  const i = c(e.source);
@@ -473,13 +507,13 @@ function Xi(e) {
473
507
  name: i.name
474
508
  };
475
509
  }
476
- function Wi(e) {
477
- return typeof e.sourceKey == "string" && e.sourceKey.trim() ? [e.sourceKey, Ge(e), e.name].filter(Boolean).join(":") : Ci(e);
510
+ function it(e) {
511
+ return typeof e.sourceKey == "string" && e.sourceKey.trim() ? [e.sourceKey, Qe(e), e.name].filter(Boolean).join(":") : Ni(e);
478
512
  }
479
- function Ge(e) {
480
- return he(e);
513
+ function Qe(e) {
514
+ return ye(e);
481
515
  }
482
- function X(e, i) {
516
+ function W(e, i) {
483
517
  var p;
484
518
  const t = c((p = c(e.visualSpec)) == null ? void 0 : p.tableBehavior), n = c(e.sdkSpec), s = c(n == null ? void 0 : n.spec), r = typeof (n == null ? void 0 : n.builder) == "string" ? n.builder : void 0, l = r === "semaphor.records" ? c(s == null ? void 0 : s.totals) : void 0, d = [];
485
519
  if (!t)
@@ -492,7 +526,7 @@ function X(e, i) {
492
526
  ), !l || l.mode !== "server" ? d.push(
493
527
  `${i}.sdkSpec.spec.totals.mode must be server when tableBehavior.totals.mode is server.`
494
528
  ) : d.push(
495
- ...Ji({
529
+ ...tt({
496
530
  left: u.measures,
497
531
  right: l.measures,
498
532
  leftPath: `${i}.visualSpec.tableBehavior.totals.measures`,
@@ -508,7 +542,7 @@ function X(e, i) {
508
542
  `${i}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`
509
543
  ), d);
510
544
  }
511
- function Ji({
545
+ function tt({
512
546
  left: e,
513
547
  right: i,
514
548
  leftPath: t,
@@ -518,20 +552,20 @@ function Ji({
518
552
  return [`${n} must match ${t}.`];
519
553
  const s = [];
520
554
  return e.length !== i.length ? (s.push(`${n} must match ${t}.`), s) : (e.forEach((r, l) => {
521
- et(c(r), c(i[l])) || s.push(`${n}.${l} must match ${t}.${l}.`);
555
+ at(c(r), c(i[l])) || s.push(`${n}.${l} must match ${t}.${l}.`);
522
556
  }), s);
523
557
  }
524
- function et(e, i) {
525
- return !e || !i ? !1 : e.name === i.name && (e.role || "measure") === (i.role || "measure") && Ae(e) === Ae(i) && it(e, i);
558
+ function at(e, i) {
559
+ return !e || !i ? !1 : e.name === i.name && (e.role || "measure") === (i.role || "measure") && Me(e) === Me(i) && nt(e, i);
526
560
  }
527
- function Ae(e) {
561
+ function Me(e) {
528
562
  return typeof e.aggregate == "string" ? e.aggregate.toUpperCase() : "SUM";
529
563
  }
530
- function it(e, i) {
564
+ function nt(e, i) {
531
565
  const t = c(e.source), n = c(i.source);
532
- if (tt(t, n))
566
+ if (st(t, n))
533
567
  return !1;
534
- const s = Re(e), r = Re(i);
568
+ const s = Te(e), r = Te(i);
535
569
  if (s.size > 0 || r.size > 0) {
536
570
  for (const l of s)
537
571
  if (r.has(l))
@@ -540,17 +574,17 @@ function it(e, i) {
540
574
  }
541
575
  return !t || !n || t.kind !== n.kind ? !1 : t.kind === "semantic" ? t.domainId === n.domainId && t.datasetName === n.datasetName && (t.datasetId === void 0 || n.datasetId === void 0 || t.datasetId === n.datasetId) : t.kind === "physical" ? t.connectionId === n.connectionId && t.tableName === n.tableName : t.kind === "sql" ? t.connectionId === n.connectionId : !1;
542
576
  }
543
- function tt(e, i) {
577
+ function st(e, i) {
544
578
  if (!e || !i || e.kind !== "semantic" || i.kind !== "semantic")
545
579
  return !1;
546
580
  const t = typeof e.datasetId == "string" ? e.datasetId.trim() : "", n = typeof i.datasetId == "string" ? i.datasetId.trim() : "";
547
581
  return !!(t && n && t !== n);
548
582
  }
549
- function Re(e) {
583
+ function Te(e) {
550
584
  const i = typeof e.sourceKey == "string" ? e.sourceKey.trim() : "";
551
- return i ? /* @__PURE__ */ new Set([i]) : at(c(e.source));
585
+ return i ? /* @__PURE__ */ new Set([i]) : ot(c(e.source));
552
586
  }
553
- function at(e) {
587
+ function ot(e) {
554
588
  const i = /* @__PURE__ */ new Set();
555
589
  if (!e)
556
590
  return i;
@@ -573,7 +607,7 @@ function at(e) {
573
607
  }
574
608
  return i;
575
609
  }
576
- function nt(e, i) {
610
+ function rt(e, i) {
577
611
  const t = c(e);
578
612
  if (!t)
579
613
  return [`${i} must be an object.`];
@@ -581,7 +615,7 @@ function nt(e, i) {
581
615
  if (t.fieldRef && n.push(
582
616
  ...h(t.fieldRef, `${i}.fieldRef`)
583
617
  ), (typeof t.inputId != "string" || !t.inputId.trim()) && n.push(`${i}.inputId is required.`), n.push(
584
- ...ze(t.optionQuery, `${i}.optionQuery`)
618
+ ...Ze(t.optionQuery, `${i}.optionQuery`)
585
619
  ), $(t.appliesToViewIds) || n.push(`${i}.appliesToViewIds must be an array of strings.`), $(t.notAppliedToViewIds) || n.push(`${i}.notAppliedToViewIds must be an array of strings.`), !Array.isArray(t.bindings))
586
620
  n.push(`${i}.bindings must be an array.`);
587
621
  else {
@@ -608,7 +642,7 @@ function nt(e, i) {
608
642
  }
609
643
  return n;
610
644
  }
611
- function ze(e, i) {
645
+ function Ze(e, i) {
612
646
  if (e === void 0)
613
647
  return [];
614
648
  const t = c(e);
@@ -634,28 +668,28 @@ function ze(e, i) {
634
668
  }
635
669
  return c(t.valueFieldRef) || n.push(`${i}.valueFieldRef is required.`), c(t.labelFieldRef) || n.push(`${i}.labelFieldRef is required.`), t.limit !== void 0 && (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit <= 0) && n.push(`${i}.limit must be a positive integer.`), n;
636
670
  }
637
- function st(e) {
671
+ function lt(e) {
638
672
  var s;
639
673
  const i = c(e.value);
640
674
  if (!i)
641
675
  return [`${e.path} is required for executable views.`];
642
676
  const t = [];
643
- if (!Ze(i.builder))
677
+ if (!Je(i.builder))
644
678
  return t.push(`${e.path}.builder must be a supported SDK builder.`), t;
645
- e.sdkBuilder && i.builder !== e.sdkBuilder && t.push(`${e.path}.builder must match sdkBuilder.`), e.queryKind && C(e.queryKind) && i.builder !== gt(e.queryKind) && t.push(`${e.path}.builder must match queryKind.`);
679
+ e.sdkBuilder && i.builder !== e.sdkBuilder && t.push(`${e.path}.builder must match sdkBuilder.`), e.queryKind && F(e.queryKind) && i.builder !== bt(e.queryKind) && t.push(`${e.path}.builder must match queryKind.`);
646
680
  const n = c(i.spec);
647
681
  if (!n)
648
682
  return t.push(`${e.path}.spec must be an object.`), t;
649
683
  switch (i.builder) {
650
684
  case "semaphor.metric":
651
685
  t.push(
652
- ...E(
686
+ ...C(
653
687
  n,
654
- He,
688
+ ze,
655
689
  `${e.path}.spec`
656
690
  ),
657
- ...V(n, e.path),
658
- ...W(n.measures, `${e.path}.spec.measures`),
691
+ ...L(n, e.path),
692
+ ...J(n.measures, `${e.path}.spec.measures`),
659
693
  ...w(
660
694
  n.primaryMeasure,
661
695
  `${e.path}.spec.primaryMeasure`
@@ -664,23 +698,23 @@ function st(e) {
664
698
  n.dateField,
665
699
  `${e.path}.spec.dateField`
666
700
  ),
667
- ...J(
701
+ ...ee(
668
702
  n.dimensions,
669
703
  `${e.path}.spec.dimensions`
670
704
  ),
671
- ...ee(n.orderBy, `${e.path}.spec.orderBy`),
672
- ...L(n.filters, `${e.path}.spec.filters`)
705
+ ...ie(n.orderBy, `${e.path}.spec.orderBy`),
706
+ ...H(n.filters, `${e.path}.spec.filters`)
673
707
  );
674
708
  break;
675
709
  case "semaphor.analysis":
676
710
  t.push(
677
- ...E(
711
+ ...C(
678
712
  n,
679
- Bi,
713
+ Vi,
680
714
  `${e.path}.spec`
681
715
  ),
682
- ...V(n, e.path),
683
- ...W(n.measures, `${e.path}.spec.measures`),
716
+ ...L(n, e.path),
717
+ ...J(n.measures, `${e.path}.spec.measures`),
684
718
  ...w(
685
719
  n.primaryMeasure,
686
720
  `${e.path}.spec.primaryMeasure`
@@ -689,31 +723,31 @@ function st(e) {
689
723
  n.dateField,
690
724
  `${e.path}.spec.dateField`
691
725
  ),
692
- ...J(
726
+ ...ee(
693
727
  n.dimensions,
694
728
  `${e.path}.spec.dimensions`
695
729
  ),
696
- ...ee(n.orderBy, `${e.path}.spec.orderBy`),
697
- ...L(n.filters, `${e.path}.spec.filters`),
698
- ...rt(n, `${e.path}.spec`)
730
+ ...ie(n.orderBy, `${e.path}.spec.orderBy`),
731
+ ...H(n.filters, `${e.path}.spec.filters`),
732
+ ...ut(n, `${e.path}.spec`)
699
733
  );
700
734
  break;
701
735
  case "semaphor.records":
702
736
  t.push(
703
- ...E(
737
+ ...C(
704
738
  n,
705
- Pi,
739
+ Li,
706
740
  `${e.path}.spec`
707
741
  ),
708
- ...V(n, e.path),
709
- ...W(n.fields, `${e.path}.spec.fields`),
742
+ ...L(n, e.path),
743
+ ...J(n.fields, `${e.path}.spec.fields`),
710
744
  ...w(
711
745
  n.dateField,
712
746
  `${e.path}.spec.dateField`
713
747
  ),
714
- ...ee(n.orderBy, `${e.path}.spec.orderBy`),
715
- ...L(n.filters, `${e.path}.spec.filters`),
716
- ...lt(
748
+ ...ie(n.orderBy, `${e.path}.spec.orderBy`),
749
+ ...H(n.filters, `${e.path}.spec.filters`),
750
+ ...ct(
717
751
  n.totals,
718
752
  `${e.path}.spec.totals`
719
753
  )
@@ -721,21 +755,21 @@ function st(e) {
721
755
  break;
722
756
  case "semaphor.matrix":
723
757
  t.push(
724
- ...E(
758
+ ...C(
725
759
  n,
726
- Ki,
760
+ Hi,
727
761
  `${e.path}.spec`
728
762
  ),
729
- ...dt(n, e.path),
730
- ...ut(n.rows, `${e.path}.spec.rows`),
731
- ...ct(
763
+ ...pt(n, e.path),
764
+ ...mt(n.rows, `${e.path}.spec.rows`),
765
+ ...ft(
732
766
  n.columns,
733
767
  `${e.path}.spec.columns`
734
768
  ),
735
- ...pt(n.values, `${e.path}.spec.values`),
736
- ...mt(n.sort, `${e.path}.spec.sort`),
737
- ...L(n.filters, `${e.path}.spec.filters`),
738
- ...ot(
769
+ ...gt(n.values, `${e.path}.spec.values`),
770
+ ...ht(n.sort, `${e.path}.spec.sort`),
771
+ ...H(n.filters, `${e.path}.spec.filters`),
772
+ ...dt(
739
773
  n.displayLimits,
740
774
  `${e.path}.spec.displayLimits`
741
775
  )
@@ -743,14 +777,14 @@ function st(e) {
743
777
  break;
744
778
  case "semaphor.sql":
745
779
  t.push(
746
- ...E(
780
+ ...C(
747
781
  n,
748
- Vi,
782
+ Ui,
749
783
  `${e.path}.spec`
750
784
  ),
751
- ...V(n, e.path)
785
+ ...L(n, e.path)
752
786
  ), ((s = c(n.source)) == null ? void 0 : s.kind) !== "sql" && t.push(`${e.path}.spec.source.kind must be sql.`), (typeof n.sql != "string" || !n.sql.trim()) && t.push(`${e.path}.spec.sql is required.`), t.push(
753
- ...J(
787
+ ...ee(
754
788
  n.fields,
755
789
  `${e.path}.spec.fields`
756
790
  )
@@ -759,7 +793,7 @@ function st(e) {
759
793
  }
760
794
  return t;
761
795
  }
762
- function ot(e, i) {
796
+ function dt(e, i) {
763
797
  if (e === void 0)
764
798
  return [];
765
799
  const t = c(e);
@@ -767,11 +801,11 @@ function ot(e, i) {
767
801
  return [`${i} must be an object.`];
768
802
  const n = [];
769
803
  n.push(
770
- ...Me(
804
+ ...je(
771
805
  t.rows,
772
806
  `${i}.rows`
773
807
  ),
774
- ...Me(
808
+ ...je(
775
809
  t.columns,
776
810
  `${i}.columns`
777
811
  )
@@ -780,7 +814,7 @@ function ot(e, i) {
780
814
  s === "rows" || s === "columns" || n.push(`${i}.${s} is not supported.`);
781
815
  return n;
782
816
  }
783
- function Me(e, i) {
817
+ function je(e, i) {
784
818
  if (e === void 0)
785
819
  return [];
786
820
  const t = c(e);
@@ -794,9 +828,9 @@ function Me(e, i) {
794
828
  );
795
829
  return n;
796
830
  }
797
- function rt(e, i) {
831
+ function ut(e, i) {
798
832
  const t = [];
799
- if (e.driverMode !== void 0 && !Oi.has(e.driverMode) && t.push(`${i}.driverMode must be a supported analysis driver mode.`), e.includePopulation !== void 0 && typeof e.includePopulation != "boolean" && t.push(`${i}.includePopulation must be a boolean.`), e.calendarContext !== void 0) {
833
+ if (e.driverMode !== void 0 && !Ki.has(e.driverMode) && t.push(`${i}.driverMode must be a supported analysis driver mode.`), e.includePopulation !== void 0 && typeof e.includePopulation != "boolean" && t.push(`${i}.includePopulation must be a boolean.`), e.calendarContext !== void 0) {
800
834
  const n = c(e.calendarContext);
801
835
  if (!n)
802
836
  t.push(`${i}.calendarContext must be an object.`);
@@ -813,7 +847,7 @@ function rt(e, i) {
813
847
  }
814
848
  return t;
815
849
  }
816
- function lt(e, i) {
850
+ function ct(e, i) {
817
851
  if (e === void 0)
818
852
  return [];
819
853
  const t = c(e);
@@ -823,36 +857,36 @@ function lt(e, i) {
823
857
  return t.mode !== "server" && n.push(`${i}.mode must be server.`), !Array.isArray(t.measures) || t.measures.length === 0 ? n.push(`${i}.measures must include at least one measure.`) : t.measures.forEach((s, r) => {
824
858
  var l;
825
859
  n.push(
826
- ...Xe(
860
+ ...ei(
827
861
  s,
828
862
  `${i}.measures.${r}`
829
863
  )
830
864
  ), ((l = c(s)) == null ? void 0 : l.role) !== "measure" && n.push(`${i}.measures.${r}.role must be measure.`);
831
865
  }), n;
832
866
  }
833
- function E(e, i, t) {
867
+ function C(e, i, t) {
834
868
  const n = [];
835
869
  return Object.keys(e).forEach((s) => {
836
870
  i.has(s) || n.push(`${t}.${s} is not supported for this SDK builder.`);
837
871
  }), n;
838
872
  }
839
- function V(e, i) {
873
+ function L(e, i) {
840
874
  return c(e.source) ? B(e.source, `${i}.spec.source`) : [`${i}.spec.source must be an object.`];
841
875
  }
842
- function dt(e, i) {
876
+ function pt(e, i) {
843
877
  const t = c(e.source);
844
878
  if (!t)
845
879
  return [`${i}.spec.source must be an object.`];
846
880
  const n = B(e.source, `${i}.spec.source`);
847
881
  return t.kind !== "semantic" && t.kind !== "physical" && n.push(`${i}.spec.source.kind must be semantic or physical.`), n;
848
882
  }
849
- function W(e, i) {
850
- const t = ye(e, i);
883
+ function J(e, i) {
884
+ const t = be(e, i);
851
885
  return Array.isArray(e) && e.forEach((n, s) => {
852
886
  t.push(...h(n, `${i}.${s}`));
853
887
  }), t;
854
888
  }
855
- function J(e, i) {
889
+ function ee(e, i) {
856
890
  if (e === void 0)
857
891
  return [];
858
892
  if (!Array.isArray(e))
@@ -862,17 +896,17 @@ function J(e, i) {
862
896
  t.push(...h(n, `${i}.${s}`));
863
897
  }), t;
864
898
  }
865
- function ee(e, i) {
899
+ function ie(e, i) {
866
900
  if (e === void 0)
867
901
  return [];
868
902
  const t = c(e);
869
903
  return t ? [
870
904
  ...h(t.field, `${i}.field`),
871
- ...Ye(t.direction, `${i}.direction`)
905
+ ...Xe(t.direction, `${i}.direction`)
872
906
  ] : [`${i} must be an object.`];
873
907
  }
874
- function ut(e, i) {
875
- const t = ye(e, i);
908
+ function mt(e, i) {
909
+ const t = be(e, i);
876
910
  return Array.isArray(e) && e.forEach((n, s) => {
877
911
  const r = c(n);
878
912
  if (!r) {
@@ -884,7 +918,7 @@ function ut(e, i) {
884
918
  );
885
919
  }), t;
886
920
  }
887
- function ct(e, i) {
921
+ function ft(e, i) {
888
922
  if (e === void 0)
889
923
  return [];
890
924
  const t = [];
@@ -899,8 +933,8 @@ function ct(e, i) {
899
933
  );
900
934
  }), t) : [`${i} must be an array.`];
901
935
  }
902
- function pt(e, i) {
903
- const t = ye(e, i);
936
+ function gt(e, i) {
937
+ const t = be(e, i);
904
938
  return Array.isArray(e) && e.forEach((n, s) => {
905
939
  const r = c(n);
906
940
  if (!r) {
@@ -912,7 +946,7 @@ function pt(e, i) {
912
946
  );
913
947
  }), t;
914
948
  }
915
- function mt(e, i) {
949
+ function ht(e, i) {
916
950
  if (e === void 0)
917
951
  return [];
918
952
  if (!Array.isArray(e))
@@ -925,15 +959,15 @@ function mt(e, i) {
925
959
  return;
926
960
  }
927
961
  r.axis !== "row" && r.axis !== "column" && t.push(`${i}.${s}.axis must be row or column.`), t.push(
928
- ...Ye(
962
+ ...Xe(
929
963
  r.direction,
930
964
  `${i}.${s}.direction`
931
965
  ),
932
- ...ft(r.by, `${i}.${s}.by`)
966
+ ...yt(r.by, `${i}.${s}.by`)
933
967
  );
934
968
  }), t;
935
969
  }
936
- function ft(e, i) {
970
+ function yt(e, i) {
937
971
  const t = c(e);
938
972
  if (!t)
939
973
  return [`${i} must be an object.`];
@@ -948,10 +982,10 @@ function ft(e, i) {
948
982
  return [`${i}.kind must be member, field, or value.`];
949
983
  }
950
984
  }
951
- function Ye(e, i) {
985
+ function Xe(e, i) {
952
986
  return e === "asc" || e === "desc" ? [] : [`${i} must be asc or desc.`];
953
987
  }
954
- function L(e, i) {
988
+ function H(e, i) {
955
989
  if (e === void 0)
956
990
  return [];
957
991
  if (!Array.isArray(e))
@@ -968,10 +1002,10 @@ function L(e, i) {
968
1002
  );
969
1003
  }), t;
970
1004
  }
971
- function ye(e, i) {
1005
+ function be(e, i) {
972
1006
  return !Array.isArray(e) || e.length === 0 ? [`${i} must be a non-empty array.`] : [];
973
1007
  }
974
- function gt(e) {
1008
+ function bt(e) {
975
1009
  switch (e) {
976
1010
  case "metric":
977
1011
  return "semaphor.metric";
@@ -985,56 +1019,56 @@ function gt(e) {
985
1019
  return "semaphor.sql";
986
1020
  }
987
1021
  }
988
- function ht(e) {
1022
+ function _t(e) {
989
1023
  const i = c(e.computation), t = c(e.visualSpec);
990
1024
  return (i == null ? void 0 : i.kind) === "presentation_only" || (i == null ? void 0 : i.kind) === "derived" || (i == null ? void 0 : i.kind) === "unsupported" || e.visual === "text_block" || (t == null ? void 0 : t.visualType) === "text_block";
991
1025
  }
992
- function yt(e, i) {
1026
+ function vt(e, i) {
993
1027
  const t = c(e);
994
1028
  if (!t)
995
1029
  return [`${i} must be an object.`];
996
1030
  const n = [];
997
- return Li.has(t.visualType) || n.push(`${i}.visualType must be a supported visual type.`), t.limit !== void 0 && (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit <= 0) && n.push(`${i}.limit must be a positive integer.`), t.tableBehavior !== void 0 && n.push(
998
- ...bt(
1031
+ return Gi.has(t.visualType) || n.push(`${i}.visualType must be a supported visual type.`), t.limit !== void 0 && (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit <= 0) && n.push(`${i}.limit must be a positive integer.`), t.tableBehavior !== void 0 && n.push(
1032
+ ...$t(
999
1033
  t.tableBehavior,
1000
1034
  `${i}.tableBehavior`
1001
1035
  )
1002
1036
  ), n;
1003
1037
  }
1004
- function bt(e, i) {
1038
+ function $t(e, i) {
1005
1039
  const t = c(e);
1006
1040
  if (!t)
1007
1041
  return [`${i} must be an object.`];
1008
1042
  const n = [];
1009
1043
  return t.tableMode !== "bounded" && t.tableMode !== "server_paginated" && t.tableMode !== "server_windowed" && n.push(`${i}.tableMode must be a supported table mode.`), n.push(
1010
- ..._t(t.height, `${i}.height`),
1011
- ...vt(t.pagination, `${i}.pagination`),
1012
- ...$t(t.sorting, `${i}.sorting`),
1013
- ...wt(t.totals, `${i}.totals`)
1044
+ ...St(t.height, `${i}.height`),
1045
+ ...wt(t.pagination, `${i}.pagination`),
1046
+ ...kt(t.sorting, `${i}.sorting`),
1047
+ ...It(t.totals, `${i}.totals`)
1014
1048
  ), typeof t.serverSideRequired != "boolean" && n.push(`${i}.serverSideRequired must be a boolean.`), n;
1015
1049
  }
1016
- function _t(e, i) {
1050
+ function St(e, i) {
1017
1051
  const t = c(e);
1018
1052
  if (!t)
1019
1053
  return [`${i} must be an object.`];
1020
1054
  const n = [];
1021
1055
  return (typeof t.maxPx != "number" || !Number.isInteger(t.maxPx) || t.maxPx <= 0) && n.push(`${i}.maxPx must be a positive integer.`), t.scroll !== "vertical" && t.scroll !== "both" && n.push(`${i}.scroll must be vertical or both.`), typeof t.stickyHeader != "boolean" && n.push(`${i}.stickyHeader must be a boolean.`), n;
1022
1056
  }
1023
- function vt(e, i) {
1057
+ function wt(e, i) {
1024
1058
  const t = c(e);
1025
1059
  if (!t)
1026
1060
  return [`${i} must be an object.`];
1027
1061
  const n = [];
1028
1062
  return t.mode !== "none" && t.mode !== "server" && t.mode !== "client_for_bounded_rows" && n.push(`${i}.mode must be a supported pagination mode.`), t.pageSize !== void 0 && (typeof t.pageSize != "number" || !Number.isInteger(t.pageSize) || t.pageSize <= 0) && n.push(`${i}.pageSize must be a positive integer.`), t.readsFrom !== void 0 && t.readsFrom !== "result.pagination" && n.push(`${i}.readsFrom must be result.pagination.`), n;
1029
1063
  }
1030
- function $t(e, i) {
1064
+ function kt(e, i) {
1031
1065
  const t = c(e);
1032
1066
  if (!t)
1033
1067
  return [`${i} must be an object.`];
1034
1068
  const n = [];
1035
1069
  return t.mode !== "server" && t.mode !== "client_for_bounded_rows" && n.push(`${i}.mode must be a supported sorting mode.`), t.defaultField !== void 0 && (typeof t.defaultField != "string" || !t.defaultField.trim()) && n.push(`${i}.defaultField must be a non-empty string.`), t.defaultDirection !== void 0 && t.defaultDirection !== "asc" && t.defaultDirection !== "desc" && n.push(`${i}.defaultDirection must be asc or desc.`), t.resetPageOnChange !== void 0 && typeof t.resetPageOnChange != "boolean" && n.push(`${i}.resetPageOnChange must be a boolean.`), n;
1036
1070
  }
1037
- function wt(e, i) {
1071
+ function It(e, i) {
1038
1072
  const t = c(e);
1039
1073
  if (!t)
1040
1074
  return [`${i} must be an object.`];
@@ -1044,7 +1078,7 @@ function wt(e, i) {
1044
1078
  ) : t.measures.forEach((s, r) => {
1045
1079
  var l;
1046
1080
  n.push(
1047
- ...Xe(
1081
+ ...ei(
1048
1082
  s,
1049
1083
  `${i}.measures.${r}`
1050
1084
  )
@@ -1053,14 +1087,14 @@ function wt(e, i) {
1053
1087
  `${i}.label must be Displayed rows or Current page when mode is local.`
1054
1088
  ), t.measures !== void 0 && n.push(`${i}.measures is not allowed when mode is local.`)), n);
1055
1089
  }
1056
- function St(e, i) {
1090
+ function xt(e, i) {
1057
1091
  const t = c(e);
1058
1092
  if (!t)
1059
1093
  return [`${i} must be an object.`];
1060
1094
  const n = [];
1061
1095
  switch (t.kind) {
1062
1096
  case "server_query":
1063
- C(t.queryKind) || n.push(
1097
+ F(t.queryKind) || n.push(
1064
1098
  `${i}.queryKind must be a supported codegen query kind.`
1065
1099
  ), t.queryOwnership !== void 0 && t.queryOwnership !== "view_owned" && t.queryOwnership !== "shared_query" && n.push(
1066
1100
  `${i}.queryOwnership must be view_owned or shared_query.`
@@ -1079,36 +1113,36 @@ function St(e, i) {
1079
1113
  }
1080
1114
  return n;
1081
1115
  }
1082
- function kt(e, i) {
1116
+ function At(e, i) {
1083
1117
  const t = c(e);
1084
1118
  if (!t)
1085
1119
  return [`${i} must be an object.`];
1086
1120
  const n = [];
1087
1121
  for (const r of ["title", "requestedQuestion", "suggestedModelingFix"])
1088
1122
  (typeof t[r] != "string" || !t[r].trim()) && n.push(`${i}.${r} is required.`);
1089
- return Hi.has(t.reason) || n.push(
1123
+ return zi.has(t.reason) || n.push(
1090
1124
  `${i}.reason must be a supported unsupported insight reason.`
1091
1125
  ), (t.relationshipCandidate !== void 0 || t.nextRepairAction !== void 0) && t.reason !== "missing_relationship" && n.push(
1092
1126
  `${i} relationship repair metadata is only valid for missing_relationship unsupported insights.`
1093
1127
  ), t.diagnostic !== void 0 && n.push(
1094
- ...It(
1128
+ ...Rt(
1095
1129
  t.diagnostic,
1096
1130
  `${i}.diagnostic`,
1097
1131
  t.reason
1098
1132
  )
1099
1133
  ), t.relationshipCandidate !== void 0 && n.push(
1100
- ...At(
1134
+ ...Tt(
1101
1135
  t.relationshipCandidate,
1102
1136
  `${i}.relationshipCandidate`
1103
1137
  )
1104
1138
  ), t.nextRepairAction !== void 0 && n.push(
1105
- ...xt(
1139
+ ...Mt(
1106
1140
  t.nextRepairAction,
1107
1141
  `${i}.nextRepairAction`
1108
1142
  )
1109
1143
  ), n;
1110
1144
  }
1111
- function It(e, i, t) {
1145
+ function Rt(e, i, t) {
1112
1146
  const n = c(e);
1113
1147
  if (!n)
1114
1148
  return [`${i} must be an object.`];
@@ -1130,12 +1164,12 @@ function It(e, i, t) {
1130
1164
  for (const d of ["inputId", "inputLabel"])
1131
1165
  (typeof n[d] != "string" || !n[d].trim()) && s.push(`${i}.${d} must be a non-empty string.`);
1132
1166
  s.push(
1133
- ...se(
1167
+ ...oe(
1134
1168
  n.optionSource,
1135
1169
  `${i}.optionSource`
1136
1170
  )
1137
1171
  ), s.push(
1138
- ...Qe(
1172
+ ...We(
1139
1173
  n.optionField,
1140
1174
  `${i}.optionField`
1141
1175
  )
@@ -1150,7 +1184,7 @@ function It(e, i, t) {
1150
1184
  );
1151
1185
  }), s;
1152
1186
  }
1153
- function xt(e, i) {
1187
+ function Mt(e, i) {
1154
1188
  const t = c(e);
1155
1189
  if (!t)
1156
1190
  return [`${i} must be an object.`];
@@ -1161,7 +1195,7 @@ function xt(e, i) {
1161
1195
  );
1162
1196
  }), t.tool !== "semaphor_propose_semantic_model_change" && n.push(`${i}.tool must be semaphor_propose_semantic_model_change.`), t.reason !== "missing_relationship" && n.push(`${i}.reason must be missing_relationship.`), n;
1163
1197
  }
1164
- function At(e, i) {
1198
+ function Tt(e, i) {
1165
1199
  const t = c(e);
1166
1200
  if (!t)
1167
1201
  return [`${i} must be an object.`];
@@ -1176,9 +1210,9 @@ function At(e, i) {
1176
1210
  `${i}.${r} is not supported; relationship candidates support only source, sourceFields, target, and targetFields.`
1177
1211
  );
1178
1212
  }), n.push(
1179
- ...se(t.source, `${i}.source`)
1213
+ ...oe(t.source, `${i}.source`)
1180
1214
  ), n.push(
1181
- ...se(t.target, `${i}.target`)
1215
+ ...oe(t.target, `${i}.target`)
1182
1216
  );
1183
1217
  for (const r of ["sourceFields", "targetFields"]) {
1184
1218
  const l = t[r];
@@ -1188,13 +1222,13 @@ function At(e, i) {
1188
1222
  }
1189
1223
  l.forEach((d, u) => {
1190
1224
  n.push(
1191
- ...Qe(d, `${i}.${r}.${u}`)
1225
+ ...We(d, `${i}.${r}.${u}`)
1192
1226
  );
1193
1227
  });
1194
1228
  }
1195
1229
  return n;
1196
1230
  }
1197
- function Qe(e, i) {
1231
+ function We(e, i) {
1198
1232
  const t = c(e);
1199
1233
  if (!t)
1200
1234
  return [`${i} must be an object.`];
@@ -1211,7 +1245,7 @@ function Qe(e, i) {
1211
1245
  `${i}.dataType must be string, number, boolean, date, datetime, or unknown.`
1212
1246
  ), n;
1213
1247
  }
1214
- function se(e, i) {
1248
+ function oe(e, i) {
1215
1249
  const t = c(e);
1216
1250
  if (!t)
1217
1251
  return [`${i} must be an object.`];
@@ -1229,11 +1263,11 @@ function se(e, i) {
1229
1263
  );
1230
1264
  }), t.kind !== "semantic" && n.push(`${i} must use semantic source identity.`), (typeof t.domainId != "string" || !t.domainId.trim() || typeof t.datasetName != "string" || !t.datasetName.trim()) && n.push(`${i} must include semantic domainId and datasetName.`), n;
1231
1265
  }
1232
- function C(e) {
1233
- return Di.has(e);
1266
+ function F(e) {
1267
+ return Oi.has(e);
1234
1268
  }
1235
- function Ze(e) {
1236
- return Ni.has(e);
1269
+ function Je(e) {
1270
+ return Pi.has(e);
1237
1271
  }
1238
1272
  function w(e, i) {
1239
1273
  return e === void 0 ? [] : h(e, i);
@@ -1243,9 +1277,9 @@ function h(e, i) {
1243
1277
  if (!t)
1244
1278
  return [`${i} must be an object.`];
1245
1279
  const n = [];
1246
- return (typeof t.name != "string" || !t.name.trim()) && n.push(`${i}.name is required.`), !t.source && typeof t.sourceKey != "string" && n.push(`${i} must include source or sourceKey.`), t.aggregate !== void 0 && !qi.has(t.aggregate) && n.push(`${i}.aggregate must be a supported aggregate function.`), n;
1280
+ return (typeof t.name != "string" || !t.name.trim()) && n.push(`${i}.name is required.`), !t.source && typeof t.sourceKey != "string" && n.push(`${i} must include source or sourceKey.`), t.aggregate !== void 0 && !Bi.has(t.aggregate) && n.push(`${i}.aggregate must be a supported aggregate function.`), n;
1247
1281
  }
1248
- function Xe(e, i) {
1282
+ function ei(e, i) {
1249
1283
  const t = c(e), n = h(e, i);
1250
1284
  if (!t || typeof t.sourceKey == "string" && t.sourceKey.trim())
1251
1285
  return n;
@@ -1264,7 +1298,7 @@ function c(e) {
1264
1298
  function $(e) {
1265
1299
  return Array.isArray(e) && e.every((i) => typeof i == "string");
1266
1300
  }
1267
- const b = a.record(a.string(), a.unknown()), R = a.array(b), _ = a.enum([
1301
+ const b = a.record(a.string(), a.unknown()), M = a.array(b), _ = a.enum([
1268
1302
  "SUM",
1269
1303
  "COUNT",
1270
1304
  "AVG",
@@ -1272,7 +1306,7 @@ const b = a.record(a.string(), a.unknown()), R = a.array(b), _ = a.enum([
1272
1306
  "MAX",
1273
1307
  "MEDIAN",
1274
1308
  "DISTINCT"
1275
- ]), Y = a.enum([
1309
+ ]), Q = a.enum([
1276
1310
  "postgres",
1277
1311
  "mysql",
1278
1312
  "mssql",
@@ -1283,40 +1317,40 @@ const b = a.record(a.string(), a.unknown()), R = a.array(b), _ = a.enum([
1283
1317
  "duckdb",
1284
1318
  "sqlite",
1285
1319
  "unknown"
1286
- ]), Rt = a.enum(O), We = a.enum(fe), Q = a.enum([
1320
+ ]), jt = a.enum(P), ii = a.enum(ge), Z = a.enum([
1287
1321
  "dimension",
1288
1322
  "measure",
1289
1323
  "date",
1290
1324
  "id",
1291
1325
  "unknown"
1292
- ]), Z = a.enum([
1326
+ ]), X = a.enum([
1293
1327
  "string",
1294
1328
  "number",
1295
1329
  "boolean",
1296
1330
  "date",
1297
1331
  "datetime",
1298
1332
  "unknown"
1299
- ]), G = a.union([a.number(), a.string(), a.null()]), ie = a.enum([
1333
+ ]), z = a.union([a.number(), a.string(), a.null()]), te = a.enum([
1300
1334
  "millisecond",
1301
1335
  "second",
1302
1336
  "minute",
1303
1337
  "hour",
1304
1338
  "day"
1305
- ]), Mt = a.enum(Ai), Tt = a.discriminatedUnion("mode", [
1339
+ ]), Et = a.enum(Ti), Ct = a.discriminatedUnion("mode", [
1306
1340
  a.object({ mode: a.literal("auto") }).strict(),
1307
1341
  a.object({
1308
1342
  mode: a.literal("preset"),
1309
- preset: Mt
1343
+ preset: Et
1310
1344
  }).strict(),
1311
1345
  a.object({
1312
1346
  mode: a.literal("pattern"),
1313
1347
  pattern: a.string().min(1)
1314
1348
  }).strict()
1315
- ]), oe = a.object({
1349
+ ]), re = a.object({
1316
1350
  type: a.literal("temporal_bucket"),
1317
- presentation: Tt
1318
- }).strict(), jt = a.object({
1319
- tz: a.string().min(1).refine(Mi, {
1351
+ presentation: Ct
1352
+ }).strict(), Ft = a.object({
1353
+ tz: a.string().min(1).refine(Ei, {
1320
1354
  message: "tz must be a valid IANA timezone"
1321
1355
  }),
1322
1356
  weekStart: a.number().int().min(0).max(6),
@@ -1324,14 +1358,14 @@ const b = a.record(a.string(), a.unknown()), R = a.array(b), _ = a.enum([
1324
1358
  kind: a.literal("month_aligned"),
1325
1359
  yearStartMonth: a.number().int().min(1).max(12)
1326
1360
  }).strict().optional()
1327
- }).strict(), re = a.object({
1361
+ }).strict(), le = a.object({
1328
1362
  kind: a.literal("temporal_bucket"),
1329
- granularity: Rt,
1330
- calendar: jt
1331
- }).strict(), Et = a.object({
1363
+ granularity: jt,
1364
+ calendar: Ft
1365
+ }).strict(), Dt = a.object({
1332
1366
  kind: a.literal("raw_temporal"),
1333
1367
  valueKind: a.enum(["date", "wall_datetime", "instant"])
1334
- }).strict(), Je = a.union([
1368
+ }).strict(), ti = a.union([
1335
1369
  a.object({
1336
1370
  type: a.enum([
1337
1371
  "number",
@@ -1370,10 +1404,10 @@ const b = a.record(a.string(), a.unknown()), R = a.array(b), _ = a.enum([
1370
1404
  }).passthrough(),
1371
1405
  a.object({
1372
1406
  type: a.literal("duration"),
1373
- inputUnit: ie.optional(),
1407
+ inputUnit: te.optional(),
1374
1408
  outputStyle: a.enum(["compact", "digital", "long"]).optional(),
1375
- largestUnit: ie.optional(),
1376
- smallestUnit: ie.optional(),
1409
+ largestUnit: te.optional(),
1410
+ smallestUnit: te.optional(),
1377
1411
  maxUnits: a.number().optional(),
1378
1412
  prefix: a.string().optional(),
1379
1413
  suffix: a.string().optional(),
@@ -1384,7 +1418,7 @@ const b = a.record(a.string(), a.unknown()), R = a.array(b), _ = a.enum([
1384
1418
  prefix: a.string().optional(),
1385
1419
  suffix: a.string().optional()
1386
1420
  }).passthrough()
1387
- ]), Ct = a.union([
1421
+ ]), Nt = a.union([
1388
1422
  a.object({ kind: a.literal("defaultAggregate") }).passthrough(),
1389
1423
  a.object({ kind: a.literal("blank") }).passthrough(),
1390
1424
  a.object({
@@ -1402,7 +1436,7 @@ const b = a.record(a.string(), a.unknown()), R = a.array(b), _ = a.enum([
1402
1436
  expressionId: a.string()
1403
1437
  }).passthrough()
1404
1438
  ]);
1405
- function P(e, i) {
1439
+ function K(e, i) {
1406
1440
  return a.object(e).passthrough().superRefine((t, n) => {
1407
1441
  for (const s of i)
1408
1442
  Object.prototype.hasOwnProperty.call(t, s) || n.addIssue({
@@ -1412,14 +1446,14 @@ function P(e, i) {
1412
1446
  });
1413
1447
  });
1414
1448
  }
1415
- const ei = a.object({
1449
+ const ai = a.object({
1416
1450
  kind: a.literal("semantic"),
1417
1451
  domainId: a.string(),
1418
1452
  datasetName: a.string(),
1419
1453
  datasetId: a.string().optional(),
1420
1454
  label: a.string().optional(),
1421
1455
  connectionId: a.string().optional()
1422
- }).passthrough(), Ft = a.object({
1456
+ }).passthrough(), qt = a.object({
1423
1457
  kind: a.literal("physical"),
1424
1458
  connectionId: a.string(),
1425
1459
  connectionType: a.string().optional(),
@@ -1427,38 +1461,38 @@ const ei = a.object({
1427
1461
  databaseName: a.string().optional(),
1428
1462
  schemaName: a.string().optional(),
1429
1463
  label: a.string().optional(),
1430
- dialect: Y.optional()
1431
- }).passthrough(), Dt = a.object({
1464
+ dialect: Q.optional()
1465
+ }).passthrough(), Ot = a.object({
1432
1466
  kind: a.literal("sql"),
1433
1467
  connectionId: a.string(),
1434
- dialect: Y.optional(),
1468
+ dialect: Q.optional(),
1435
1469
  label: a.string().optional()
1436
- }).passthrough(), F = a.union([
1437
- ei,
1438
- Ft,
1439
- Dt
1440
- ]), M = a.object({
1470
+ }).passthrough(), D = a.union([
1471
+ ai,
1472
+ qt,
1473
+ Ot
1474
+ ]), T = a.object({
1441
1475
  name: a.string(),
1442
1476
  label: a.string().optional(),
1443
- role: Q.optional(),
1444
- dataType: Z.optional(),
1445
- source: F.optional(),
1477
+ role: Z.optional(),
1478
+ dataType: X.optional(),
1479
+ source: D.optional(),
1446
1480
  aggregate: _.optional()
1447
- }).passthrough(), Nt = a.object({
1481
+ }).passthrough(), Pt = a.object({
1448
1482
  kind: a.literal("field"),
1449
- field: M,
1483
+ field: T,
1450
1484
  aggregate: _.optional()
1451
- }).passthrough(), ii = a.object({
1485
+ }).passthrough(), ni = a.object({
1452
1486
  kind: a.literal("derived_field"),
1453
1487
  name: a.string(),
1454
1488
  label: a.string(),
1455
1489
  description: a.string().optional(),
1456
- resultRole: Q,
1457
- dataType: Z,
1490
+ resultRole: Z,
1491
+ dataType: X,
1458
1492
  computeStage: a.enum(["row", "aggregate"]),
1459
1493
  expression: a.string(),
1460
1494
  expressionLanguage: a.literal("semaphor_sql_template").optional(),
1461
- inputs: a.record(Nt),
1495
+ inputs: a.record(Pt),
1462
1496
  defaultAggregate: _.optional(),
1463
1497
  aggregationBehavior: a.enum([
1464
1498
  "additive",
@@ -1474,13 +1508,13 @@ const ei = a.object({
1474
1508
  "aggregate_then_join",
1475
1509
  "weighted"
1476
1510
  ]).optional(),
1477
- format: Je.optional(),
1511
+ format: ti.optional(),
1478
1512
  tags: a.array(a.string()).optional()
1479
- }).passthrough(), be = M.and(
1513
+ }).passthrough(), _e = T.and(
1480
1514
  a.object({
1481
- derivedField: ii.optional()
1515
+ derivedField: ni.optional()
1482
1516
  }).passthrough()
1483
- ), qt = ei, Ot = a.object({
1517
+ ), Bt = ai, Kt = a.object({
1484
1518
  kind: a.literal("physical"),
1485
1519
  connectionId: a.string().optional(),
1486
1520
  connectionType: a.string().optional(),
@@ -1488,36 +1522,36 @@ const ei = a.object({
1488
1522
  databaseName: a.string().optional(),
1489
1523
  schemaName: a.string().optional(),
1490
1524
  label: a.string().optional(),
1491
- dialect: Y.optional()
1492
- }).passthrough(), Bt = a.object({
1525
+ dialect: Q.optional()
1526
+ }).passthrough(), Vt = a.object({
1493
1527
  kind: a.literal("sql"),
1494
1528
  connectionId: a.string().optional(),
1495
- dialect: Y.optional(),
1529
+ dialect: Q.optional(),
1496
1530
  label: a.string().optional()
1497
- }).passthrough(), Pt = a.union([
1498
- qt,
1499
- Ot,
1500
- Bt
1501
- ]), Kt = a.object({
1531
+ }).passthrough(), Lt = a.union([
1532
+ Bt,
1533
+ Kt,
1534
+ Vt
1535
+ ]), Ht = a.object({
1502
1536
  key: a.string().optional(),
1503
1537
  name: a.string(),
1504
1538
  label: a.string().optional(),
1505
- role: Q.optional(),
1506
- dataType: Z.optional(),
1507
- source: Pt.optional(),
1539
+ role: Z.optional(),
1540
+ dataType: X.optional(),
1541
+ source: Lt.optional(),
1508
1542
  aggregate: _.optional(),
1509
1543
  derivedField: a.never().optional()
1510
- }).passthrough(), N = a.object({
1544
+ }).passthrough(), q = a.object({
1511
1545
  key: a.string(),
1512
1546
  name: a.string(),
1513
1547
  label: a.string(),
1514
- role: Q.optional(),
1515
- dataType: Z.optional(),
1548
+ role: Z.optional(),
1549
+ dataType: X.optional(),
1516
1550
  aggregate: _.optional(),
1517
- source: F.optional(),
1518
- derivedField: ii.optional(),
1519
- temporalBucket: re.optional(),
1520
- rawTemporal: Et.optional(),
1551
+ source: D.optional(),
1552
+ derivedField: ni.optional(),
1553
+ temporalBucket: le.optional(),
1554
+ rawTemporal: Dt.optional(),
1521
1555
  pivotIdentity: a.object({
1522
1556
  metricId: a.string().min(1),
1523
1557
  metricAlias: a.string().min(1),
@@ -1525,7 +1559,7 @@ const ei = a.object({
1525
1559
  a.object({
1526
1560
  fieldId: a.string().min(1),
1527
1561
  value: a.string().nullable(),
1528
- temporalBucket: re.optional()
1562
+ temporalBucket: le.optional()
1529
1563
  }).strict()
1530
1564
  )
1531
1565
  }).strict().optional()
@@ -1535,7 +1569,7 @@ const ei = a.object({
1535
1569
  path: ["rawTemporal"],
1536
1570
  message: "A result column cannot carry both temporalBucket and rawTemporal metadata."
1537
1571
  }), e.temporalBucket) {
1538
- const t = Ri(
1572
+ const t = ji(
1539
1573
  e.temporalBucket.granularity
1540
1574
  );
1541
1575
  e.dataType !== t && i.addIssue({
@@ -1552,13 +1586,13 @@ const ei = a.object({
1552
1586
  message: `${e.rawTemporal.valueKind} raw temporal values require dataType ${t}.`
1553
1587
  });
1554
1588
  }
1555
- }), Dn = a.object({
1556
- records: R,
1557
- columns: a.array(N).optional()
1558
- }).passthrough(), Nn = a.object({
1559
- records: R,
1560
- columns: a.array(N)
1561
- }).passthrough(), ti = a.object({
1589
+ }), On = a.object({
1590
+ records: M,
1591
+ columns: a.array(q).optional()
1592
+ }).passthrough(), Pn = a.object({
1593
+ records: M,
1594
+ columns: a.array(q)
1595
+ }).passthrough(), si = a.object({
1562
1596
  code: a.string(),
1563
1597
  message: a.string().optional(),
1564
1598
  invalidField: a.string().optional(),
@@ -1567,61 +1601,61 @@ const ei = a.object({
1567
1601
  validDateCandidates: a.array(a.string()).optional(),
1568
1602
  validDimensionCandidates: a.array(a.string()).optional(),
1569
1603
  recommendedNextStep: a.string()
1570
- }).passthrough(), le = a.object({
1604
+ }).passthrough(), de = a.object({
1571
1605
  code: a.string(),
1572
1606
  message: a.string(),
1573
1607
  path: a.string().optional(),
1574
1608
  fieldRole: a.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
1575
- repairHint: ti.optional()
1576
- }).passthrough(), ai = a.object({
1609
+ repairHint: si.optional()
1610
+ }).passthrough(), oi = a.object({
1577
1611
  ok: a.boolean(),
1578
- errors: a.array(le),
1579
- warnings: a.array(le),
1580
- repairHints: a.array(ti)
1581
- }).passthrough(), Vt = a.object({
1612
+ errors: a.array(de),
1613
+ warnings: a.array(de),
1614
+ repairHints: a.array(si)
1615
+ }).passthrough(), Ut = a.object({
1582
1616
  page: a.number(),
1583
1617
  pageSize: a.number(),
1584
1618
  pageCount: a.number(),
1585
1619
  totalCount: a.number(),
1586
1620
  hasNextPage: a.boolean(),
1587
1621
  hasPrevPage: a.boolean()
1588
- }).passthrough(), K = {
1622
+ }).passthrough(), V = {
1589
1623
  intentId: a.string().optional(),
1590
1624
  queryPath: a.enum(["query_spec", "sql", "sql_python"]),
1591
1625
  warnings: a.array(a.string()).optional(),
1592
1626
  rowCount: a.number().optional(),
1593
1627
  rowLimitExceeded: a.boolean().optional(),
1594
1628
  limit: a.number().optional(),
1595
- pagination: Vt.optional()
1596
- }, Lt = a.object({
1597
- ...K,
1629
+ pagination: Ut.optional()
1630
+ }, Gt = a.object({
1631
+ ...V,
1598
1632
  kind: a.literal("metric"),
1599
- primaryValue: G,
1600
- measures: a.record(G).optional(),
1633
+ primaryValue: z,
1634
+ measures: a.record(z).optional(),
1601
1635
  missingMeasures: a.array(a.string()).optional(),
1602
1636
  comparison: a.object({
1603
1637
  kind: a.enum(["previous_period", "previous_year", "target"]),
1604
- value: G.optional(),
1638
+ value: z.optional(),
1605
1639
  delta: a.union([a.number(), a.null()]).optional(),
1606
1640
  deltaPercent: a.union([a.number(), a.null()]).optional()
1607
1641
  }).passthrough().optional(),
1608
- records: R.optional()
1609
- }).passthrough(), Ht = a.object({
1610
- ...K,
1642
+ records: M.optional()
1643
+ }).passthrough(), zt = a.object({
1644
+ ...V,
1611
1645
  kind: a.literal("records"),
1612
- columns: a.array(N),
1613
- records: R,
1646
+ columns: a.array(q),
1647
+ records: M,
1614
1648
  totals: a.object({
1615
1649
  mode: a.literal("server"),
1616
1650
  scope: a.literal("filtered_result"),
1617
1651
  row: a.record(a.string(), a.unknown()),
1618
- columns: a.array(N).optional()
1652
+ columns: a.array(q).optional()
1619
1653
  }).passthrough().optional()
1620
- }).passthrough(), Ut = a.object({
1621
- ...K,
1654
+ }).passthrough(), Yt = a.object({
1655
+ ...V,
1622
1656
  kind: a.literal("inputOptions"),
1623
1657
  options: a.array(
1624
- P(
1658
+ K(
1625
1659
  {
1626
1660
  label: a.string(),
1627
1661
  value: a.unknown(),
@@ -1631,35 +1665,35 @@ const ei = a.object({
1631
1665
  ["value"]
1632
1666
  )
1633
1667
  )
1634
- }).passthrough(), Gt = a.object({
1635
- ...K,
1668
+ }).passthrough(), Qt = a.object({
1669
+ ...V,
1636
1670
  kind: a.literal("sql"),
1637
- columns: a.array(N),
1638
- records: R,
1671
+ columns: a.array(q),
1672
+ records: M,
1639
1673
  sqlShape: a.object({
1640
1674
  statementType: a.string().optional(),
1641
1675
  explicitLimit: a.number().optional(),
1642
1676
  hasPythonCode: a.boolean().optional()
1643
1677
  }).passthrough().optional()
1644
- }).passthrough(), zt = a.object({
1678
+ }).passthrough(), Zt = a.object({
1645
1679
  enabled: a.boolean().optional(),
1646
1680
  position: a.enum(["before", "after"]).optional(),
1647
1681
  label: a.string().optional()
1648
- }).passthrough(), Te = a.object({
1682
+ }).passthrough(), Ee = a.object({
1649
1683
  id: a.enum(["rows", "columns"]),
1650
1684
  levels: a.array(
1651
1685
  a.object({
1652
1686
  instanceId: a.string(),
1653
1687
  fieldKey: a.string(),
1654
1688
  label: a.string(),
1655
- field: M,
1656
- grain: We.optional(),
1657
- temporalBucket: re.optional(),
1658
- subtotal: zt.optional()
1689
+ field: T,
1690
+ grain: ii.optional(),
1691
+ temporalBucket: le.optional(),
1692
+ subtotal: Zt.optional()
1659
1693
  }).passthrough()
1660
1694
  ),
1661
1695
  nodeIds: a.array(a.string())
1662
- }).passthrough(), A = P(
1696
+ }).passthrough(), R = K(
1663
1697
  {
1664
1698
  instanceId: a.string(),
1665
1699
  fieldKey: a.string(),
@@ -1667,25 +1701,25 @@ const ei = a.object({
1667
1701
  label: a.string().optional()
1668
1702
  },
1669
1703
  ["value"]
1670
- ), Yt = a.union([
1704
+ ), Xt = a.union([
1671
1705
  a.object({ kind: a.literal("member") }).passthrough(),
1672
1706
  a.object({
1673
1707
  kind: a.literal("field"),
1674
- field: M,
1708
+ field: T,
1675
1709
  aggregate: _.optional()
1676
1710
  }).passthrough(),
1677
1711
  a.object({
1678
1712
  kind: a.literal("value"),
1679
1713
  valueId: a.string(),
1680
- rowPath: a.array(A).optional(),
1681
- columnPath: a.array(A).optional()
1714
+ rowPath: a.array(R).optional(),
1715
+ columnPath: a.array(R).optional()
1682
1716
  }).passthrough()
1683
- ]), Qt = a.enum([
1717
+ ]), Wt = a.enum([
1684
1718
  "present",
1685
1719
  "presentNull",
1686
1720
  "missing",
1687
1721
  "densified"
1688
- ]), Zt = a.enum([
1722
+ ]), Jt = a.enum([
1689
1723
  "value",
1690
1724
  "rowSubtotal",
1691
1725
  "columnSubtotal",
@@ -1693,13 +1727,13 @@ const ei = a.object({
1693
1727
  "rowGrandTotal",
1694
1728
  "columnGrandTotal",
1695
1729
  "matrixGrandTotal"
1696
- ]), Xt = a.object({
1730
+ ]), ea = a.object({
1697
1731
  instanceId: a.string(),
1698
1732
  fieldKey: a.string(),
1699
- field: M,
1733
+ field: T,
1700
1734
  role: a.enum(["row", "column", "measure", "sort", "filter"]),
1701
1735
  label: a.string().optional()
1702
- }).passthrough(), Wt = a.union([
1736
+ }).passthrough(), ia = a.union([
1703
1737
  a.object({
1704
1738
  kind: a.literal("additive"),
1705
1739
  aggregate: _.optional()
@@ -1707,7 +1741,7 @@ const ei = a.object({
1707
1741
  a.object({
1708
1742
  kind: a.literal("semiAdditive"),
1709
1743
  aggregate: _.optional(),
1710
- grain: We.optional()
1744
+ grain: ii.optional()
1711
1745
  }).passthrough(),
1712
1746
  a.object({
1713
1747
  kind: a.literal("nonAdditive"),
@@ -1722,16 +1756,16 @@ const ei = a.object({
1722
1756
  kind: a.literal("custom"),
1723
1757
  expressionId: a.string().optional()
1724
1758
  }).passthrough()
1725
- ]), Jt = a.object({
1759
+ ]), ta = a.object({
1726
1760
  instanceId: a.string(),
1727
1761
  fieldKey: a.string(),
1728
1762
  label: a.string(),
1729
- field: M,
1763
+ field: T,
1730
1764
  aggregate: _.optional(),
1731
- format: Je.optional(),
1732
- totalBehavior: Ct.optional(),
1733
- semantics: Wt
1734
- }).passthrough(), ea = a.object({
1765
+ format: ti.optional(),
1766
+ totalBehavior: Nt.optional(),
1767
+ semantics: ia
1768
+ }).passthrough(), aa = a.object({
1735
1769
  id: a.string(),
1736
1770
  measureId: a.string(),
1737
1771
  aggregate: _.optional(),
@@ -1752,15 +1786,15 @@ const ei = a.object({
1752
1786
  rowNodeId: a.string().optional(),
1753
1787
  columnNodeId: a.string().optional()
1754
1788
  }).passthrough().optional()
1755
- }).passthrough(), ia = a.object({
1789
+ }).passthrough(), na = a.object({
1756
1790
  kind: a.string(),
1757
1791
  label: a.string().optional(),
1758
1792
  payload: a.record(a.string(), a.unknown()).optional()
1759
- }).passthrough(), ta = P(
1793
+ }).passthrough(), sa = K(
1760
1794
  {
1761
1795
  id: a.string(),
1762
1796
  axis: a.enum(["row", "column"]),
1763
- path: a.array(A),
1797
+ path: a.array(R),
1764
1798
  level: a.number(),
1765
1799
  label: a.string().optional(),
1766
1800
  value: a.unknown(),
@@ -1771,10 +1805,10 @@ const ei = a.object({
1771
1805
  isGrandTotal: a.boolean().optional(),
1772
1806
  subtotalFunction: _.optional(),
1773
1807
  childCount: a.number().optional(),
1774
- actions: a.array(ia).optional()
1808
+ actions: a.array(na).optional()
1775
1809
  },
1776
1810
  ["value"]
1777
- ), aa = a.object({
1811
+ ), oa = a.object({
1778
1812
  rowHeaderLevels: a.array(
1779
1813
  a.object({
1780
1814
  id: a.string(),
@@ -1798,7 +1832,7 @@ const ei = a.object({
1798
1832
  ]),
1799
1833
  colSpan: a.number(),
1800
1834
  rowSpan: a.number(),
1801
- columnPath: a.array(A),
1835
+ columnPath: a.array(R),
1802
1836
  measureInstanceId: a.string().optional()
1803
1837
  }).passthrough()
1804
1838
  )
@@ -1809,19 +1843,19 @@ const ei = a.object({
1809
1843
  id: a.string(),
1810
1844
  label: a.string().optional(),
1811
1845
  columnNodeId: a.string().optional(),
1812
- columnPath: a.array(A),
1846
+ columnPath: a.array(R),
1813
1847
  measureInstanceId: a.string(),
1814
1848
  role: a.enum(["value", "columnSubtotal", "columnGrandTotal"])
1815
1849
  }).passthrough()
1816
1850
  )
1817
- }).passthrough(), na = P(
1851
+ }).passthrough(), ra = K(
1818
1852
  {
1819
1853
  rowId: a.string(),
1820
1854
  columnId: a.string().optional(),
1821
1855
  measureId: a.string(),
1822
1856
  value: a.unknown(),
1823
- presence: Qt,
1824
- role: Zt,
1857
+ presence: Wt,
1858
+ role: Jt,
1825
1859
  calculationId: a.string().optional()
1826
1860
  },
1827
1861
  ["value"]
@@ -1831,7 +1865,7 @@ const ei = a.object({
1831
1865
  path: ["formattedValue"],
1832
1866
  message: "Matrix result cells carry typed values; formattedValue is not supported."
1833
1867
  });
1834
- }), sa = a.object({
1868
+ }), la = a.object({
1835
1869
  rows: a.boolean().optional(),
1836
1870
  columns: a.boolean().optional(),
1837
1871
  grandTotal: a.union([
@@ -1841,7 +1875,7 @@ const ei = a.object({
1841
1875
  columns: a.boolean().optional()
1842
1876
  }).passthrough()
1843
1877
  ]).optional()
1844
- }).passthrough(), oa = P(
1878
+ }).passthrough(), da = K(
1845
1879
  {
1846
1880
  id: a.string(),
1847
1881
  axis: a.enum(["row", "column"]),
@@ -1849,27 +1883,27 @@ const ei = a.object({
1849
1883
  direction: a.enum(["asc", "desc"]),
1850
1884
  nulls: a.enum(["warehouseDefault", "first", "last"]).optional(),
1851
1885
  scope: a.enum(["global", "withinParent"]).optional(),
1852
- by: Yt
1886
+ by: Xt
1853
1887
  },
1854
1888
  ["by"]
1855
- ), ra = a.object({
1889
+ ), ua = a.object({
1856
1890
  rowOffset: a.number().optional(),
1857
1891
  rowLimit: a.number().optional(),
1858
1892
  columnOffset: a.number().optional(),
1859
1893
  columnLimit: a.number().optional(),
1860
1894
  hasMoreRows: a.boolean().optional(),
1861
1895
  hasMoreColumns: a.boolean().optional()
1862
- }).passthrough(), la = a.object({
1896
+ }).passthrough(), ca = a.object({
1863
1897
  axis: a.enum(["row", "column"]),
1864
- path: a.array(A),
1898
+ path: a.array(R),
1865
1899
  depth: a.number().optional()
1866
- }).passthrough(), da = a.object({
1900
+ }).passthrough(), pa = a.object({
1867
1901
  rowLazyLoading: a.boolean().optional(),
1868
1902
  columnLazyLoading: a.boolean().optional(),
1869
1903
  expandableRowNodeIds: a.array(a.string()).optional(),
1870
1904
  expandableColumnNodeIds: a.array(a.string()).optional(),
1871
- nextRequests: a.array(la).optional()
1872
- }).passthrough(), ua = a.object({
1905
+ nextRequests: a.array(ca).optional()
1906
+ }).passthrough(), ma = a.object({
1873
1907
  domains: a.record(
1874
1908
  a.object({
1875
1909
  min: a.number().optional(),
@@ -1877,35 +1911,35 @@ const ei = a.object({
1877
1911
  }).passthrough()
1878
1912
  ).optional(),
1879
1913
  rules: a.array(a.record(a.string(), a.unknown())).optional()
1880
- }).passthrough(), ca = a.object({
1881
- ...K,
1914
+ }).passthrough(), fa = a.object({
1915
+ ...V,
1882
1916
  kind: a.literal("matrix"),
1883
1917
  schemaVersion: a.literal(2),
1884
1918
  shape: a.enum(["hierarchical", "pivot"]),
1885
1919
  capabilities: a.array(a.string()),
1886
1920
  executionMetadata: a.record(a.string(), a.unknown()),
1887
- fieldsById: a.record(a.string(), Xt),
1888
- measuresById: a.record(a.string(), Jt),
1889
- calculationsById: a.record(a.string(), ea).optional(),
1921
+ fieldsById: a.record(a.string(), ea),
1922
+ measuresById: a.record(a.string(), ta),
1923
+ calculationsById: a.record(a.string(), aa).optional(),
1890
1924
  axes: a.object({
1891
- rows: Te,
1892
- columns: Te
1925
+ rows: Ee,
1926
+ columns: Ee
1893
1927
  }).passthrough(),
1894
- nodesById: a.record(a.string(), ta),
1895
- layout: aa,
1896
- cells: a.array(na),
1897
- totals: sa,
1898
- sort: a.array(oa),
1899
- formattingContext: ua,
1900
- pageInfo: ra.optional(),
1901
- expansion: da.optional()
1902
- }).passthrough(), pa = a.union([
1903
- Lt,
1904
- Ht,
1905
- Ut,
1928
+ nodesById: a.record(a.string(), sa),
1929
+ layout: oa,
1930
+ cells: a.array(ra),
1931
+ totals: la,
1932
+ sort: a.array(da),
1933
+ formattingContext: ma,
1934
+ pageInfo: ua.optional(),
1935
+ expansion: pa.optional()
1936
+ }).passthrough(), ga = a.union([
1906
1937
  Gt,
1907
- ca
1908
- ]), ma = a.object({
1938
+ zt,
1939
+ Yt,
1940
+ Qt,
1941
+ fa
1942
+ ]), ha = a.object({
1909
1943
  status: a.enum([
1910
1944
  "not_required",
1911
1945
  "resolved",
@@ -1914,22 +1948,22 @@ const ei = a.object({
1914
1948
  "fanout_risk",
1915
1949
  "unknown"
1916
1950
  ]),
1917
- requiredSources: a.array(F).optional(),
1951
+ requiredSources: a.array(D).optional(),
1918
1952
  relationshipsUsed: a.array(a.string()).optional(),
1919
1953
  missingSources: a.array(a.string()).optional(),
1920
1954
  warnings: a.array(a.string()).optional(),
1921
1955
  message: a.string().optional(),
1922
1956
  recommendedNextStep: a.string().optional(),
1923
1957
  joinPlanSummary: a.object({
1924
- baseSource: F.optional(),
1925
- joinedSources: a.array(F).optional(),
1958
+ baseSource: D.optional(),
1959
+ joinedSources: a.array(D).optional(),
1926
1960
  joinCount: a.number().optional()
1927
1961
  }).passthrough().optional(),
1928
1962
  fanoutRisk: a.object({
1929
1963
  status: a.enum(["none", "warning", "error", "unknown"]),
1930
1964
  message: a.string().optional()
1931
1965
  }).passthrough().optional()
1932
- }).passthrough(), je = a.enum([
1966
+ }).passthrough(), Ce = a.enum([
1933
1967
  "ambiguous_fields",
1934
1968
  "empty_result",
1935
1969
  "missing_grounded_fields",
@@ -1939,7 +1973,7 @@ const ei = a.object({
1939
1973
  "presentation_incomplete",
1940
1974
  "query_validation_failed",
1941
1975
  "unsafe_join"
1942
- ]), ni = a.object({
1976
+ ]), ri = a.object({
1943
1977
  version: a.literal(1),
1944
1978
  status: a.enum(["answered", "partial", "blocked"]),
1945
1979
  summary: a.string(),
@@ -1949,14 +1983,14 @@ const ei = a.object({
1949
1983
  queryId: a.string().optional(),
1950
1984
  summary: a.string(),
1951
1985
  evidenceIds: a.array(a.string()).optional(),
1952
- fieldsUsed: a.array(be).optional()
1986
+ fieldsUsed: a.array(_e).optional()
1953
1987
  }).passthrough()
1954
1988
  ),
1955
1989
  blocked: a.array(
1956
1990
  a.object({
1957
1991
  slotId: a.string().optional(),
1958
1992
  queryId: a.string().optional(),
1959
- reasonCode: je,
1993
+ reasonCode: Ce,
1960
1994
  message: a.string(),
1961
1995
  missingFields: a.array(a.string()).optional(),
1962
1996
  availableFields: a.array(a.string()).optional(),
@@ -1969,19 +2003,19 @@ const ei = a.object({
1969
2003
  ),
1970
2004
  semanticModelRecommendations: a.array(
1971
2005
  a.object({
1972
- reasonCode: je,
2006
+ reasonCode: Ce,
1973
2007
  message: a.string(),
1974
2008
  recommendedNextStep: a.string().optional()
1975
2009
  }).passthrough()
1976
2010
  ).optional()
1977
- }).passthrough(), si = a.object({
2011
+ }).passthrough(), li = a.object({
1978
2012
  scope: a.literal("filtered_query"),
1979
- measures: a.record(G)
1980
- }).passthrough(), oi = a.object({
2013
+ measures: a.record(z)
2014
+ }).passthrough(), di = a.object({
1981
2015
  answeredObligations: a.array(a.string()),
1982
2016
  missingObligations: a.array(a.string()),
1983
- warnings: a.array(le).optional()
1984
- }).passthrough(), fa = a.object({
2017
+ warnings: a.array(de).optional()
2018
+ }).passthrough(), ya = a.object({
1985
2019
  intentId: a.string().optional(),
1986
2020
  queryId: a.string().optional(),
1987
2021
  status: a.enum(["answered", "partial", "failed"]),
@@ -1996,39 +2030,39 @@ const ei = a.object({
1996
2030
  ]).optional(),
1997
2031
  intent: a.unknown().optional(),
1998
2032
  compiledQuery: a.unknown().optional(),
1999
- fieldsUsed: a.array(be).optional(),
2000
- result: pa.optional(),
2001
- validation: ai,
2002
- coverage: oi.optional(),
2033
+ fieldsUsed: a.array(_e).optional(),
2034
+ result: ga.optional(),
2035
+ validation: oi,
2036
+ coverage: di.optional(),
2003
2037
  missingFields: a.array(a.string()).optional(),
2004
2038
  warnings: a.array(a.string()).optional(),
2005
- relationshipDiagnostics: ma.optional(),
2006
- diagnosticFeedback: ni.optional(),
2007
- population: si.optional(),
2039
+ relationshipDiagnostics: ha.optional(),
2040
+ diagnosticFeedback: ri.optional(),
2041
+ population: li.optional(),
2008
2042
  metadata: a.record(a.string(), a.unknown()).optional()
2009
2043
  }).passthrough();
2010
- function ga(e) {
2044
+ function ba(e) {
2011
2045
  switch (e) {
2012
2046
  case "boolean":
2013
2047
  return a.boolean().optional();
2014
2048
  case "compactExecutionFieldArray":
2015
- return a.array(Kt).optional();
2049
+ return a.array(Ht).optional();
2016
2050
  case "coverage":
2017
- return oi.optional();
2051
+ return di.optional();
2018
2052
  case "diagnosticFeedback":
2019
- return ni.optional();
2053
+ return ri.optional();
2020
2054
  case "executionFieldArray":
2021
- return a.array(be).optional();
2055
+ return a.array(_e).optional();
2022
2056
  case "executionResult":
2023
- return fa.optional();
2057
+ return ya.optional();
2024
2058
  case "number":
2025
2059
  return a.number().finite().optional();
2026
2060
  case "population":
2027
- return si.optional();
2061
+ return li.optional();
2028
2062
  case "record":
2029
2063
  return b.optional();
2030
2064
  case "recordArray":
2031
- return R.optional();
2065
+ return M.optional();
2032
2066
  case "responseDetail":
2033
2067
  return a.enum(["compact", "standard", "debug"]).optional();
2034
2068
  case "string":
@@ -2040,14 +2074,14 @@ function ga(e) {
2040
2074
  case "unknownArray":
2041
2075
  return a.array(a.unknown()).optional();
2042
2076
  case "validationResult":
2043
- return ai.optional();
2077
+ return oi.optional();
2044
2078
  }
2045
2079
  }
2046
- const ha = Object.fromEntries(
2047
- Object.entries(Ti).map(
2048
- ([e, i]) => [e, ga(i)]
2080
+ const _a = Object.fromEntries(
2081
+ Object.entries(Ci).map(
2082
+ ([e, i]) => [e, ba(i)]
2049
2083
  )
2050
- ), qn = a.object(ha).strict(), _e = a.object({
2084
+ ), Bn = a.object(_a).strict(), ve = a.object({
2051
2085
  sourceKey: a.string().optional(),
2052
2086
  kind: a.enum(["semantic", "physical", "sql"]).optional(),
2053
2087
  domainId: a.string().optional(),
@@ -2056,44 +2090,44 @@ const ha = Object.fromEntries(
2056
2090
  connectionId: a.string().optional(),
2057
2091
  tableName: a.string().optional(),
2058
2092
  label: a.string().optional()
2059
- }).passthrough(), S = a.object({
2093
+ }).passthrough(), k = a.object({
2060
2094
  name: a.string(),
2061
2095
  label: a.string().optional(),
2062
2096
  role: a.enum(["dimension", "measure", "date", "id", "unknown"]).optional(),
2063
2097
  dataType: a.enum(["string", "number", "boolean", "date", "datetime", "unknown"]).optional(),
2064
2098
  aggregate: _.optional(),
2065
2099
  sourceKey: a.string().optional(),
2066
- source: _e.optional()
2067
- }).passthrough(), ri = a.object({
2100
+ source: ve.optional()
2101
+ }).passthrough(), ui = a.object({
2068
2102
  id: a.string().optional(),
2069
2103
  builder: a.literal("semaphor.inputOptions"),
2070
- source: _e.optional(),
2104
+ source: ve.optional(),
2071
2105
  sourceKey: a.string().optional(),
2072
- valueFieldRef: S,
2073
- labelFieldRef: S,
2074
- filterFieldRef: S.optional(),
2106
+ valueFieldRef: k,
2107
+ labelFieldRef: k,
2108
+ filterFieldRef: k.optional(),
2075
2109
  population: a.unknown().optional(),
2076
2110
  dependencies: a.unknown().optional(),
2077
2111
  limit: a.number().int().positive().optional(),
2078
2112
  spec: b.optional()
2079
- }).passthrough(), li = a.object({
2113
+ }).passthrough(), ci = a.object({
2080
2114
  appliesToViewIds: a.array(a.string()).optional(),
2081
2115
  viewId: a.string().optional(),
2082
- fieldRef: S,
2116
+ fieldRef: k,
2083
2117
  relationshipHint: a.unknown().optional(),
2084
2118
  relationshipsUsed: a.array(b).optional()
2085
- }).passthrough(), ya = a.object({
2119
+ }).passthrough(), va = a.object({
2086
2120
  id: a.string(),
2087
2121
  label: a.string().optional(),
2088
2122
  type: a.string().optional(),
2089
2123
  serverSide: a.boolean().optional(),
2090
- fieldRef: S.optional(),
2091
- optionQuery: ri.optional(),
2092
- bindings: a.array(li).optional(),
2124
+ fieldRef: k.optional(),
2125
+ optionQuery: ui.optional(),
2126
+ bindings: a.array(ci).optional(),
2093
2127
  appliesToViewIds: a.array(a.string()),
2094
2128
  relationshipHint: a.unknown().optional(),
2095
2129
  relationshipsUsed: a.array(b).optional()
2096
- }).passthrough(), ba = a.object({
2130
+ }).passthrough(), $a = a.object({
2097
2131
  builder: a.enum([
2098
2132
  "semaphor.metric",
2099
2133
  "semaphor.records",
@@ -2103,7 +2137,7 @@ const ha = Object.fromEntries(
2103
2137
  ]),
2104
2138
  spec: b,
2105
2139
  fallbackReason: b.optional()
2106
- }).passthrough(), _a = a.object({
2140
+ }).passthrough(), Sa = a.object({
2107
2141
  id: a.string(),
2108
2142
  title: a.string().optional(),
2109
2143
  purpose: a.string().optional(),
@@ -2121,31 +2155,31 @@ const ha = Object.fromEntries(
2121
2155
  "semaphor.analysis",
2122
2156
  "semaphor.sql"
2123
2157
  ]).optional(),
2124
- sdkSpec: ba.optional(),
2125
- fields: a.array(S).optional(),
2158
+ sdkSpec: $a.optional(),
2159
+ fields: a.array(k).optional(),
2126
2160
  computation: b.optional(),
2127
2161
  uxExpectations: a.array(a.string()).optional(),
2128
2162
  validation: b.optional()
2129
- }).passthrough(), va = a.object({
2163
+ }).passthrough(), wa = a.object({
2130
2164
  inputId: a.string(),
2131
2165
  label: a.string().optional(),
2132
2166
  type: a.string().optional(),
2133
2167
  serverSide: a.boolean().optional(),
2134
- fieldRef: S.optional(),
2135
- optionQuery: ri.optional(),
2136
- bindings: a.array(li),
2168
+ fieldRef: k.optional(),
2169
+ optionQuery: ui.optional(),
2170
+ bindings: a.array(ci),
2137
2171
  appliesToViewIds: a.array(a.string()),
2138
2172
  notAppliedToViewIds: a.array(a.string())
2139
- }).passthrough(), On = a.object({
2140
- schemaVersion: a.literal(ne),
2173
+ }).passthrough(), Kn = a.object({
2174
+ schemaVersion: a.literal(se),
2141
2175
  title: a.string(),
2142
2176
  purpose: a.string().optional(),
2143
2177
  userGoal: a.string().optional(),
2144
2178
  nextStep: a.string().optional(),
2145
- sources: a.array(_e),
2146
- inputs: a.array(ya),
2147
- views: a.array(_a),
2148
- filterContracts: a.array(va),
2179
+ sources: a.array(ve),
2180
+ inputs: a.array(va),
2181
+ views: a.array(Sa),
2182
+ filterContracts: a.array(wa),
2149
2183
  implementationChecklist: a.object({
2150
2184
  schemaVersion: a.string().optional(),
2151
2185
  requiredDevtools: a.object({
@@ -2175,22 +2209,22 @@ const ha = Object.fromEntries(
2175
2209
  assumptions: a.array(a.string()).optional(),
2176
2210
  validation: b.optional()
2177
2211
  }).passthrough().superRefine((e, i) => {
2178
- const t = Ue(e);
2212
+ const t = Ye(e);
2179
2213
  for (const n of t.issues)
2180
2214
  i.addIssue({
2181
2215
  code: a.ZodIssueCode.custom,
2182
2216
  message: n
2183
2217
  });
2184
2218
  });
2185
- function ve(e) {
2219
+ function $e(e) {
2186
2220
  return typeof e == "string" ? e.trim().toLowerCase() : "";
2187
2221
  }
2188
- function $a(e) {
2222
+ function ka(e) {
2189
2223
  return String(
2190
2224
  e.column_name || e.name || e.qualifiedFieldName || ""
2191
2225
  );
2192
2226
  }
2193
- function wa(e) {
2227
+ function Ia(e) {
2194
2228
  return Array.from(
2195
2229
  new Set(
2196
2230
  [e.column_name, e.name, e.qualifiedFieldName, e.alias].filter(
@@ -2199,11 +2233,11 @@ function wa(e) {
2199
2233
  )
2200
2234
  );
2201
2235
  }
2202
- function $e(e) {
2203
- const i = xa(e);
2204
- return i ? Ia(i) ? "number" : i.includes("timestamp") || i.includes("datetime") || i.startsWith("time") ? "datetime" : i.includes("date") ? "date" : i.includes("bool") ? "boolean" : "string" : "unknown";
2236
+ function Se(e) {
2237
+ const i = Ma(e);
2238
+ return i ? Ra(i) ? "number" : i.includes("timestamp") || i.includes("datetime") || i.startsWith("time") ? "datetime" : i.includes("date") ? "date" : i.includes("bool") ? "boolean" : "string" : "unknown";
2205
2239
  }
2206
- const Sa = /* @__PURE__ */ new Set([
2240
+ const xa = /* @__PURE__ */ new Set([
2207
2241
  "int",
2208
2242
  "uint",
2209
2243
  "integer",
@@ -2219,71 +2253,71 @@ const Sa = /* @__PURE__ */ new Set([
2219
2253
  "money",
2220
2254
  "currency",
2221
2255
  "percent"
2222
- ]), ka = [
2256
+ ]), Aa = [
2223
2257
  "int",
2224
2258
  "uint",
2225
2259
  "decimal",
2226
2260
  "float"
2227
2261
  ];
2228
- function Ia(e) {
2262
+ function Ra(e) {
2229
2263
  const i = e.split(/[\s(]/, 1)[0] || "";
2230
- return Sa.has(i) ? !0 : ka.some((t) => {
2264
+ return xa.has(i) ? !0 : Aa.some((t) => {
2231
2265
  if (!i.startsWith(t)) return !1;
2232
2266
  const n = i.slice(t.length);
2233
2267
  return n.length > 0 && Array.from(n).every((s) => s >= "0" && s <= "9");
2234
2268
  });
2235
2269
  }
2236
- function xa(e) {
2237
- let i = ve(e), t = "";
2270
+ function Ma(e) {
2271
+ let i = $e(e), t = "";
2238
2272
  for (; i && i !== t; )
2239
- t = i, i = Ee(i, "nullable"), i = Ee(i, "lowcardinality");
2273
+ t = i, i = Fe(i, "nullable"), i = Fe(i, "lowcardinality");
2240
2274
  return i;
2241
2275
  }
2242
- function Ee(e, i) {
2276
+ function Fe(e, i) {
2243
2277
  const t = `${i}(`;
2244
2278
  return !e.startsWith(t) || !e.endsWith(")") ? e : e.slice(t.length, -1).trim();
2245
2279
  }
2246
- function Aa(e) {
2247
- const i = $e(e);
2280
+ function Ta(e) {
2281
+ const i = Se(e);
2248
2282
  return i === "date" || i === "datetime";
2249
2283
  }
2250
- function di(e) {
2251
- return Aa(e.dataType || e.data_type);
2284
+ function pi(e) {
2285
+ return Ta(e.dataType || e.data_type);
2252
2286
  }
2253
- function ui(e) {
2254
- const i = ci(e);
2287
+ function mi(e) {
2288
+ const i = fi(e);
2255
2289
  return i === "id" || i === "row_id";
2256
2290
  }
2257
- function Ce(e) {
2258
- const i = ci(e);
2259
- return ui(e) || i.endsWith("_id") || i.endsWith("_key") || i.endsWith("_number");
2291
+ function De(e) {
2292
+ const i = fi(e);
2293
+ return mi(e) || i.endsWith("_id") || i.endsWith("_key") || i.endsWith("_number");
2260
2294
  }
2261
- function ci(e) {
2262
- return ve(
2263
- $a(e) || e.name || e.alias
2295
+ function fi(e) {
2296
+ return $e(
2297
+ ka(e) || e.name || e.alias
2264
2298
  ).replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
2265
2299
  }
2266
- function pi(e, i = {}) {
2267
- const t = ve(e.role);
2268
- return t === "metric" || t === "measure" ? !i.excludeIdentifiers || !Ce(e) : t === "groupby" || t === "dimension" || t === "date" || t === "id" ? !1 : $e(
2300
+ function gi(e, i = {}) {
2301
+ const t = $e(e.role);
2302
+ return t === "metric" || t === "measure" ? !i.excludeIdentifiers || !De(e) : t === "groupby" || t === "dimension" || t === "date" || t === "id" ? !1 : Se(
2269
2303
  e.dataType || e.data_type
2270
- ) === "number" && (!i.excludeIdentifiers || !Ce(e));
2304
+ ) === "number" && (!i.excludeIdentifiers || !De(e));
2271
2305
  }
2272
- function Bn(e) {
2273
- return !pi(e) && !di(e);
2306
+ function Vn(e) {
2307
+ return !gi(e) && !pi(e);
2274
2308
  }
2275
- function Pn(e) {
2309
+ function Ln(e) {
2276
2310
  const i = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
2277
2311
  for (const s of e) {
2278
- if (ui(s))
2312
+ if (mi(s))
2279
2313
  continue;
2280
- const r = wa(s);
2314
+ const r = Ia(s);
2281
2315
  if (r.length !== 0) {
2282
- if (di(s)) {
2316
+ if (pi(s)) {
2283
2317
  r.forEach((l) => t.add(l));
2284
2318
  continue;
2285
2319
  }
2286
- if (pi(s, { excludeIdentifiers: !0 })) {
2320
+ if (gi(s, { excludeIdentifiers: !0 })) {
2287
2321
  r.forEach((l) => i.add(l));
2288
2322
  continue;
2289
2323
  }
@@ -2296,7 +2330,7 @@ function Pn(e) {
2296
2330
  validDimensionCandidates: Array.from(n).sort()
2297
2331
  };
2298
2332
  }
2299
- const Ra = [
2333
+ const ja = [
2300
2334
  "YYYY",
2301
2335
  "MMMM",
2302
2336
  "MMM",
@@ -2306,7 +2340,7 @@ const Ra = [
2306
2340
  "HH",
2307
2341
  "mm",
2308
2342
  "ss"
2309
- ], Ma = /* @__PURE__ */ new Set([" ", "-", "/", ":", ".", ",", "T"]), mi = {
2343
+ ], Ea = /* @__PURE__ */ new Set([" ", "-", "/", ":", ".", ",", "T"]), hi = {
2310
2344
  week_of_short: "week",
2311
2345
  week_of_long: "week",
2312
2346
  quarter_short: "quarter",
@@ -2314,15 +2348,15 @@ const Ra = [
2314
2348
  fiscal_quarter_short: "quarter",
2315
2349
  fiscal_year: "year"
2316
2350
  };
2317
- function Kn(e) {
2318
- return typeof e == "string" && Object.prototype.hasOwnProperty.call(mi, e);
2351
+ function Hn(e) {
2352
+ return typeof e == "string" && Object.prototype.hasOwnProperty.call(hi, e);
2319
2353
  }
2320
- function Ta(e, i) {
2321
- return Ra.find(
2354
+ function Ca(e, i) {
2355
+ return ja.find(
2322
2356
  (t) => e.startsWith(t, i)
2323
2357
  );
2324
2358
  }
2325
- function ja(e) {
2359
+ function Fa(e) {
2326
2360
  var s;
2327
2361
  if (!e || e.trim() !== e)
2328
2362
  return {
@@ -2333,7 +2367,7 @@ function ja(e) {
2333
2367
  const i = [];
2334
2368
  let t = 0, n = !1;
2335
2369
  for (; t < e.length; ) {
2336
- const r = Ta(e, t);
2370
+ const r = Ca(e, t);
2337
2371
  if (r) {
2338
2372
  if (n)
2339
2373
  return {
@@ -2345,7 +2379,7 @@ function ja(e) {
2345
2379
  continue;
2346
2380
  }
2347
2381
  const l = e[t];
2348
- if (!Ma.has(l))
2382
+ if (!Ea.has(l))
2349
2383
  return {
2350
2384
  ok: !1,
2351
2385
  code: "invalid_temporal_bucket_pattern",
@@ -2366,30 +2400,30 @@ function ja(e) {
2366
2400
  message: "Temporal bucket patterns cannot end with a separator."
2367
2401
  } : { ok: !0, segments: i };
2368
2402
  }
2369
- function Ea(e) {
2403
+ function Da(e) {
2370
2404
  return e.flatMap(
2371
2405
  (i) => i.kind === "token" ? [i.value] : []
2372
2406
  );
2373
2407
  }
2374
- function Fe(e, i) {
2408
+ function Ne(e, i) {
2375
2409
  return e.filter((t) => i.includes(t)).length === 1;
2376
2410
  }
2377
- function H(e, i) {
2411
+ function U(e, i) {
2378
2412
  return e.some((t) => i.includes(t));
2379
2413
  }
2380
- function Ca(e) {
2414
+ function Na(e) {
2381
2415
  return new Set(e).size !== e.length;
2382
2416
  }
2383
- function Fa(e, i) {
2384
- if (Ca(e)) return !1;
2385
- const t = ["YYYY", "YY"], n = ["MMMM", "MMM", "MM"], s = ["HH", "mm", "ss"], r = Fe(e, t), l = Fe(e, n), d = e.includes("DD"), u = H(e, s);
2417
+ function qa(e, i) {
2418
+ if (Na(e)) return !1;
2419
+ const t = ["YYYY", "YY"], n = ["MMMM", "MMM", "MM"], s = ["HH", "mm", "ss"], r = Ne(e, t), l = Ne(e, n), d = e.includes("DD"), u = U(e, s);
2386
2420
  switch (i) {
2387
2421
  case "second":
2388
- return e.includes("HH") && e.includes("mm") && e.includes("ss") && (!H(e, [...t, ...n, "DD"]) || r && l && d);
2422
+ return e.includes("HH") && e.includes("mm") && e.includes("ss") && (!U(e, [...t, ...n, "DD"]) || r && l && d);
2389
2423
  case "minute":
2390
- return e.includes("HH") && e.includes("mm") && (!H(e, [...t, ...n, "DD"]) || r && l && d);
2424
+ return e.includes("HH") && e.includes("mm") && (!U(e, [...t, ...n, "DD"]) || r && l && d);
2391
2425
  case "hour":
2392
- return e.includes("HH") && (!H(e, [...t, ...n, "DD"]) || r && l && d);
2426
+ return e.includes("HH") && (!U(e, [...t, ...n, "DD"]) || r && l && d);
2393
2427
  case "day":
2394
2428
  case "week":
2395
2429
  return r && l && d && !u;
@@ -2401,20 +2435,20 @@ function Fa(e, i) {
2401
2435
  return r && !l && !d && !u;
2402
2436
  }
2403
2437
  }
2404
- function de(e, i) {
2438
+ function ue(e, i) {
2405
2439
  if (e.presentation.mode === "auto")
2406
2440
  return { ok: !0 };
2407
2441
  if (e.presentation.mode === "preset") {
2408
- const n = mi[e.presentation.preset];
2442
+ const n = hi[e.presentation.preset];
2409
2443
  return n === i ? { ok: !0 } : {
2410
2444
  ok: !1,
2411
2445
  code: "incompatible_temporal_bucket_preset",
2412
2446
  message: `Preset ${e.presentation.preset} requires ${n} granularity.`
2413
2447
  };
2414
2448
  }
2415
- const t = ja(e.presentation.pattern);
2416
- return t.ok ? Fa(
2417
- Ea(t.segments),
2449
+ const t = Fa(e.presentation.pattern);
2450
+ return t.ok ? qa(
2451
+ Da(t.segments),
2418
2452
  i
2419
2453
  ) ? { ok: !0, segments: t.segments } : {
2420
2454
  ok: !1,
@@ -2422,36 +2456,36 @@ function de(e, i) {
2422
2456
  message: `Pattern ${e.presentation.pattern} is not compatible with ${i} granularity.`
2423
2457
  } : t;
2424
2458
  }
2425
- function Vn(e, i) {
2459
+ function Un(e, i) {
2426
2460
  if (!(!e || !i))
2427
- return de(e, i).ok ? e : void 0;
2461
+ return ue(e, i).ok ? e : void 0;
2428
2462
  }
2429
2463
  function o(e, i, t) {
2430
2464
  return t ? { code: e, message: i, path: t } : { code: e, message: i };
2431
2465
  }
2432
- function Da(e) {
2466
+ function Oa(e) {
2433
2467
  for (let i = 0; i < e.length; i += 1) {
2434
2468
  const t = e[i];
2435
2469
  if (e.some(
2436
- (n, s) => s !== i && gi(n, t)
2470
+ (n, s) => s !== i && bi(n, t)
2437
2471
  ))
2438
2472
  return !1;
2439
2473
  }
2440
2474
  return !0;
2441
2475
  }
2442
- function fi(e, i) {
2443
- return Ei(e, i);
2476
+ function yi(e, i) {
2477
+ return Di(e, i);
2444
2478
  }
2445
- function gi(e, i) {
2446
- return fi(e, i) && q(e) === q(i);
2479
+ function bi(e, i) {
2480
+ return yi(e, i) && O(e) === O(i);
2447
2481
  }
2448
- function Na(e) {
2449
- return `Metric intent has duplicate measure "${e.name}" with the same aggregate (${q(e)}). Use different aggregates to request both, or remove one entry.`;
2482
+ function Pa(e) {
2483
+ return `Metric intent has duplicate measure "${e.name}" with the same aggregate (${O(e)}). Use different aggregates to request both, or remove one entry.`;
2450
2484
  }
2451
- function De(e) {
2485
+ function qe(e) {
2452
2486
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
2453
2487
  }
2454
- function qa(e, i, t) {
2488
+ function Ba(e, i, t) {
2455
2489
  if (e !== void 0) {
2456
2490
  if (!e || typeof e != "object" || Array.isArray(e)) {
2457
2491
  t.push(
@@ -2474,7 +2508,7 @@ function qa(e, i, t) {
2474
2508
  );
2475
2509
  return;
2476
2510
  }
2477
- (Array.isArray(s) ? s.every(De) : De(s)) || t.push(
2511
+ (Array.isArray(s) ? s.every(qe) : qe(s)) || t.push(
2478
2512
  o(
2479
2513
  "invalid_sql_default_parameter_value",
2480
2514
  "SQL defaultParameters values must be strings, numbers, booleans, nulls, or arrays of those scalar values.",
@@ -2484,77 +2518,77 @@ function qa(e, i, t) {
2484
2518
  });
2485
2519
  }
2486
2520
  }
2487
- function Oa(e, i) {
2521
+ function Ka(e, i) {
2488
2522
  return we(e, i).length === 1;
2489
2523
  }
2490
- function Ba(e, i) {
2524
+ function Va(e, i) {
2491
2525
  return we(e, i).length === 1;
2492
2526
  }
2493
2527
  function we(e, i) {
2494
2528
  return i.filter(
2495
- (n) => Pa(e, n)
2529
+ (n) => La(e, n)
2496
2530
  );
2497
2531
  }
2498
- function Pa(e, i) {
2499
- return Ka(e, i) ? e.source ? fi(i, e) : !0 : !1;
2532
+ function La(e, i) {
2533
+ return Ha(e, i) ? e.source ? yi(i, e) : !0 : !1;
2500
2534
  }
2501
- function Ka(e, i) {
2502
- return !(i.name !== e.name || e.role !== void 0 && i.role !== void 0 && i.role !== e.role || Va(e, i) && q(i) !== q(e));
2535
+ function Ha(e, i) {
2536
+ return !(i.name !== e.name || e.role !== void 0 && i.role !== void 0 && i.role !== e.role || Ua(e, i) && O(i) !== O(e));
2503
2537
  }
2504
- function Va(e, i) {
2538
+ function Ua(e, i) {
2505
2539
  return e.role === "measure" || i.role === "measure" || e.aggregate !== void 0 || i.aggregate !== void 0;
2506
2540
  }
2507
- function q(e) {
2508
- return he(e);
2541
+ function O(e) {
2542
+ return ye(e);
2509
2543
  }
2510
- const La = /^(\d{4})-(\d{2})-(\d{2})$/, hi = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|[+-]\d{2}:\d{2})$/;
2511
- function ue(e) {
2544
+ const Ga = /^(\d{4})-(\d{2})-(\d{2})$/, _i = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|[+-]\d{2}:\d{2})$/;
2545
+ function ce(e) {
2512
2546
  if (typeof e != "string")
2513
2547
  return null;
2514
- const i = e.trim(), t = La.exec(i);
2548
+ const i = e.trim(), t = Ga.exec(i);
2515
2549
  if (t) {
2516
- const [, v, T, j] = t;
2517
- return Ne(v, T, j) ? new Date(Date.UTC(Number(v), Number(T) - 1, Number(j))) : null;
2550
+ const [, v, j, E] = t;
2551
+ return Oe(v, j, E) ? new Date(Date.UTC(Number(v), Number(j) - 1, Number(E))) : null;
2518
2552
  }
2519
- const n = hi.exec(i);
2553
+ const n = _i.exec(i);
2520
2554
  if (!n)
2521
2555
  return null;
2522
2556
  const [, s, r, l, d, u, p = "00", , y] = n;
2523
- if (!Ne(s, r, l) || !D(d, 0, 23) || !D(u, 0, 59) || !D(p, 0, 59) || !Ha(y))
2557
+ if (!Oe(s, r, l) || !N(d, 0, 23) || !N(u, 0, 59) || !N(p, 0, 59) || !za(y))
2524
2558
  return null;
2525
- const I = new Date(i);
2526
- return Number.isFinite(I.getTime()) ? I : null;
2559
+ const x = new Date(i);
2560
+ return Number.isFinite(x.getTime()) ? x : null;
2527
2561
  }
2528
- function Ln(e) {
2529
- return typeof e != "string" || !hi.test(e.trim()) ? null : ue(e);
2562
+ function Gn(e) {
2563
+ return typeof e != "string" || !_i.test(e.trim()) ? null : ce(e);
2530
2564
  }
2531
- function Ne(e, i, t) {
2565
+ function Oe(e, i, t) {
2532
2566
  const n = Number(e), s = Number(i), r = Number(t);
2533
2567
  if (!Number.isInteger(n) || !Number.isInteger(s) || !Number.isInteger(r) || s < 1 || s > 12)
2534
2568
  return !1;
2535
2569
  const l = new Date(Date.UTC(n, s - 1, r));
2536
2570
  return l.getUTCFullYear() === n && l.getUTCMonth() === s - 1 && l.getUTCDate() === r;
2537
2571
  }
2538
- function D(e, i, t) {
2572
+ function N(e, i, t) {
2539
2573
  const n = Number(e);
2540
2574
  return Number.isInteger(n) && n >= i && n <= t;
2541
2575
  }
2542
- function Ha(e) {
2576
+ function za(e) {
2543
2577
  if (e === "Z")
2544
2578
  return !0;
2545
2579
  const i = /^([+-])(\d{2}):(\d{2})$/.exec(e);
2546
- return !!(i && D(i[2], 0, 23) && D(i[3], 0, 59));
2580
+ return !!(i && N(i[2], 0, 23) && N(i[3], 0, 59));
2547
2581
  }
2548
2582
  function f(e) {
2549
2583
  return typeof e == "string" && e.trim().length > 0;
2550
2584
  }
2551
- function Ua(e) {
2585
+ function Ya(e) {
2552
2586
  const i = /* @__PURE__ */ new Set();
2553
2587
  let t = 0;
2554
2588
  for (; t < e.length; ) {
2555
2589
  const n = e[t];
2556
2590
  if (n === "'" || n === '"') {
2557
- t = Ga(e, t);
2591
+ t = Qa(e, t);
2558
2592
  continue;
2559
2593
  }
2560
2594
  if (n === "{") {
@@ -2571,7 +2605,7 @@ function Ua(e) {
2571
2605
  }
2572
2606
  return Array.from(i);
2573
2607
  }
2574
- function Ga(e, i) {
2608
+ function Qa(e, i) {
2575
2609
  const t = e[i];
2576
2610
  let n = i + 1;
2577
2611
  for (; n < e.length; ) {
@@ -2589,7 +2623,7 @@ function Ga(e, i) {
2589
2623
  function m(e) {
2590
2624
  return !!(e && typeof e == "object" && !Array.isArray(e));
2591
2625
  }
2592
- function qe(e, i, t) {
2626
+ function Pe(e, i, t) {
2593
2627
  if (e !== void 0) {
2594
2628
  if (!m(e)) {
2595
2629
  t.push(
@@ -2616,7 +2650,7 @@ function qe(e, i, t) {
2616
2650
  );
2617
2651
  }
2618
2652
  }
2619
- function ce(e) {
2653
+ function pe(e) {
2620
2654
  const i = /* @__PURE__ */ new Set();
2621
2655
  for (const t of e) {
2622
2656
  if (i.has(t))
@@ -2625,8 +2659,8 @@ function ce(e) {
2625
2659
  }
2626
2660
  return null;
2627
2661
  }
2628
- function te(e, i, t, n) {
2629
- ce(
2662
+ function ae(e, i, t, n) {
2663
+ pe(
2630
2664
  e.filter((r) => f(r))
2631
2665
  ) && n.push(
2632
2666
  o(
@@ -2636,7 +2670,7 @@ function te(e, i, t, n) {
2636
2670
  )
2637
2671
  );
2638
2672
  }
2639
- const za = /* @__PURE__ */ new Set([
2673
+ const Za = /* @__PURE__ */ new Set([
2640
2674
  "SUM",
2641
2675
  "COUNT",
2642
2676
  "AVG",
@@ -2645,7 +2679,7 @@ const za = /* @__PURE__ */ new Set([
2645
2679
  "MEDIAN",
2646
2680
  "DISTINCT"
2647
2681
  ]);
2648
- function Se(e, i, t) {
2682
+ function ke(e, i, t) {
2649
2683
  if (!e || typeof e != "object") {
2650
2684
  t.push(
2651
2685
  o("missing_source", "Analytics intent needs a source.", i)
@@ -2711,9 +2745,9 @@ function g(e, i, t, n = {}) {
2711
2745
  "Field reference needs a name.",
2712
2746
  `${i}.name`
2713
2747
  )
2714
- ), e.source !== void 0 && Se(e.source, `${i}.source`, t), k(e.aggregate, `${i}.aggregate`, t);
2748
+ ), e.source !== void 0 && ke(e.source, `${i}.source`, t), I(e.aggregate, `${i}.aggregate`, t);
2715
2749
  }
2716
- function Ya(e, i, t) {
2750
+ function Xa(e, i, t) {
2717
2751
  if (!m(e)) {
2718
2752
  t.push(
2719
2753
  o(
@@ -2736,13 +2770,13 @@ function Ya(e, i, t) {
2736
2770
  "Input binding kind must be filter or control.",
2737
2771
  `${i}.kind`
2738
2772
  )
2739
- ), e.field !== void 0 && g(e.field, `${i}.field`, t), e.relationshipHint !== void 0 && ke(
2773
+ ), e.field !== void 0 && g(e.field, `${i}.field`, t), e.relationshipHint !== void 0 && Ie(
2740
2774
  e.relationshipHint,
2741
2775
  `${i}.relationshipHint`,
2742
2776
  t
2743
2777
  );
2744
2778
  }
2745
- function ke(e, i, t) {
2779
+ function Ie(e, i, t) {
2746
2780
  if (!m(e)) {
2747
2781
  t.push(
2748
2782
  o(
@@ -2761,7 +2795,7 @@ function ke(e, i, t) {
2761
2795
  )
2762
2796
  );
2763
2797
  }
2764
- function Qa(e, i) {
2798
+ function Wa(e, i) {
2765
2799
  var n, s;
2766
2800
  if (((n = e.source) == null ? void 0 : n.kind) !== "semantic" && ((s = e.source) == null ? void 0 : s.kind) !== "physical" && i.push(
2767
2801
  o(
@@ -2824,7 +2858,7 @@ function Qa(e, i) {
2824
2858
  path: `disambiguationFields.${l}`
2825
2859
  })) : []
2826
2860
  ].forEach(({ field: r, path: l }) => {
2827
- r != null && r.source && !ge(r.source, e.source) && i.push(
2861
+ r != null && r.source && !he(r.source, e.source) && i.push(
2828
2862
  o(
2829
2863
  "input_options_field_source_mismatch",
2830
2864
  "Input option fields must belong to the declared option source.",
@@ -2849,17 +2883,17 @@ function Qa(e, i) {
2849
2883
  "Input options dependencies mode must be independent or explicit.",
2850
2884
  "dependencies.mode"
2851
2885
  )
2852
- ), Oe(
2886
+ ), Be(
2853
2887
  r.includeInputIds,
2854
2888
  "dependencies.includeInputIds",
2855
2889
  i,
2856
2890
  "Input options includeInputIds must be non-empty strings."
2857
- ), Oe(
2891
+ ), Be(
2858
2892
  r.excludeInputIds,
2859
2893
  "dependencies.excludeInputIds",
2860
2894
  i,
2861
2895
  "Input options excludeInputIds must be non-empty strings."
2862
- ), Xa(e, i);
2896
+ ), en(e, i);
2863
2897
  }
2864
2898
  }
2865
2899
  if (e.population !== void 0) {
@@ -2892,11 +2926,11 @@ function Qa(e, i) {
2892
2926
  "Input options population relationshipHint is only valid for related_population.",
2893
2927
  "population.relationshipHint"
2894
2928
  )
2895
- ), l === "related_population" && (Se(
2929
+ ), l === "related_population" && (ke(
2896
2930
  r.baseSource,
2897
2931
  "population.baseSource",
2898
2932
  i
2899
- ), r.relationshipHint !== void 0 && ke(
2933
+ ), r.relationshipHint !== void 0 && Ie(
2900
2934
  r.relationshipHint,
2901
2935
  "population.relationshipHint",
2902
2936
  i
@@ -2904,7 +2938,7 @@ function Qa(e, i) {
2904
2938
  }
2905
2939
  }
2906
2940
  }
2907
- function Za(e, i) {
2941
+ function Ja(e, i) {
2908
2942
  if (!(!("inputs" in e) || e.inputs === void 0)) {
2909
2943
  if (!Array.isArray(e.inputs)) {
2910
2944
  i.push(
@@ -2917,11 +2951,11 @@ function Za(e, i) {
2917
2951
  return;
2918
2952
  }
2919
2953
  e.inputs.forEach(
2920
- (t, n) => Ya(t, `inputs.${n}`, i)
2954
+ (t, n) => Xa(t, `inputs.${n}`, i)
2921
2955
  );
2922
2956
  }
2923
2957
  }
2924
- function Xa(e, i) {
2958
+ function en(e, i) {
2925
2959
  var n, s;
2926
2960
  const t = new Set(
2927
2961
  Array.isArray(e.inputs) ? e.inputs.map((r) => m(r) ? r.inputId : void 0).filter((r) => typeof r == "string") : []
@@ -2943,11 +2977,11 @@ function Xa(e, i) {
2943
2977
  )
2944
2978
  );
2945
2979
  }
2946
- function Oe(e, i, t, n) {
2980
+ function Be(e, i, t, n) {
2947
2981
  e !== void 0 && (!Array.isArray(e) || e.some((s) => !f(s))) && t.push(o("invalid_input_options_dependencies", n, i));
2948
2982
  }
2949
- function k(e, i, t) {
2950
- e !== void 0 && (typeof e != "string" || !za.has(e)) && t.push(
2983
+ function I(e, i, t) {
2984
+ e !== void 0 && (typeof e != "string" || !Za.has(e)) && t.push(
2951
2985
  o(
2952
2986
  "invalid_aggregate",
2953
2987
  "Field aggregate must be SUM, COUNT, AVG, MIN, MAX, MEDIAN, or DISTINCT.",
@@ -2955,20 +2989,20 @@ function k(e, i, t) {
2955
2989
  )
2956
2990
  );
2957
2991
  }
2958
- const Wa = /* @__PURE__ */ new Set([
2992
+ const tn = /* @__PURE__ */ new Set([
2959
2993
  "measure",
2960
2994
  "dimension",
2961
2995
  "date",
2962
2996
  "id",
2963
2997
  "unknown"
2964
- ]), Ja = /* @__PURE__ */ new Set(["row", "aggregate"]), yi = /* @__PURE__ */ new Set([
2998
+ ]), an = /* @__PURE__ */ new Set(["row", "aggregate"]), vi = /* @__PURE__ */ new Set([
2965
2999
  "string",
2966
3000
  "number",
2967
3001
  "boolean",
2968
3002
  "date",
2969
3003
  "datetime",
2970
3004
  "unknown"
2971
- ]), en = /* @__PURE__ */ new Set([
3005
+ ]), nn = /* @__PURE__ */ new Set([
2972
3006
  "number",
2973
3007
  "currency",
2974
3008
  "percent",
@@ -2979,14 +3013,14 @@ const Wa = /* @__PURE__ */ new Set([
2979
3013
  "duration",
2980
3014
  "string",
2981
3015
  "temporal_bucket"
2982
- ]), tn = new Set(O), an = /* @__PURE__ */ new Set([
3016
+ ]), sn = new Set(P), on = /* @__PURE__ */ new Set([
2983
3017
  "millisecond",
2984
3018
  "second",
2985
3019
  "minute",
2986
3020
  "hour",
2987
3021
  "day"
2988
- ]), nn = /* @__PURE__ */ new Set(["compact", "digital", "long"]);
2989
- function bi(e, i, t) {
3022
+ ]), rn = /* @__PURE__ */ new Set(["compact", "digital", "long"]);
3023
+ function $i(e, i, t) {
2990
3024
  if (e === void 0)
2991
3025
  return;
2992
3026
  if (!m(e)) {
@@ -3000,13 +3034,13 @@ function bi(e, i, t) {
3000
3034
  return;
3001
3035
  }
3002
3036
  const n = e;
3003
- (typeof n.type != "string" || !en.has(n.type)) && t.push(
3037
+ (typeof n.type != "string" || !nn.has(n.type)) && t.push(
3004
3038
  o(
3005
3039
  "invalid_value_format_type",
3006
3040
  "Value format type must be number, currency, percent, percentage, scientific, date, datetime, duration, string, or temporal_bucket.",
3007
3041
  `${i}.type`
3008
3042
  )
3009
- ), n.type === "temporal_bucket" && !oe.safeParse(e).success && t.push(
3043
+ ), n.type === "temporal_bucket" && !re.safeParse(e).success && t.push(
3010
3044
  o(
3011
3045
  "invalid_temporal_bucket_format",
3012
3046
  "Temporal bucket format must contain a valid auto, preset, or pattern presentation.",
@@ -3018,15 +3052,15 @@ function bi(e, i, t) {
3018
3052
  "Numeric value formats cannot define viewer locale.",
3019
3053
  `${i}.locale`
3020
3054
  )
3021
- ), U(
3055
+ ), G(
3022
3056
  e.minimumFractionDigits,
3023
3057
  `${i}.minimumFractionDigits`,
3024
3058
  t
3025
- ), U(
3059
+ ), G(
3026
3060
  e.maximumFractionDigits,
3027
3061
  `${i}.maximumFractionDigits`,
3028
3062
  t
3029
- ), U(e.scale, `${i}.scale`, t), U(e.maxUnits, `${i}.maxUnits`, t), e.useGrouping !== void 0 && typeof e.useGrouping != "boolean" && t.push(
3063
+ ), G(e.scale, `${i}.scale`, t), G(e.maxUnits, `${i}.maxUnits`, t), e.useGrouping !== void 0 && typeof e.useGrouping != "boolean" && t.push(
3030
3064
  o(
3031
3065
  "invalid_value_format_use_grouping",
3032
3066
  "Value format useGrouping must be boolean.",
@@ -3047,7 +3081,7 @@ function bi(e, i, t) {
3047
3081
  );
3048
3082
  for (const s of ["inputUnit", "largestUnit", "smallestUnit"]) {
3049
3083
  const r = e[s];
3050
- r !== void 0 && (typeof r != "string" || !an.has(r)) && t.push(
3084
+ r !== void 0 && (typeof r != "string" || !on.has(r)) && t.push(
3051
3085
  o(
3052
3086
  "invalid_value_format_duration_unit",
3053
3087
  "Duration format units must be millisecond, second, minute, hour, or day.",
@@ -3055,7 +3089,7 @@ function bi(e, i, t) {
3055
3089
  )
3056
3090
  );
3057
3091
  }
3058
- e.outputStyle !== void 0 && (typeof e.outputStyle != "string" || !nn.has(e.outputStyle)) && t.push(
3092
+ e.outputStyle !== void 0 && (typeof e.outputStyle != "string" || !rn.has(e.outputStyle)) && t.push(
3059
3093
  o(
3060
3094
  "invalid_value_format_duration_style",
3061
3095
  "Duration format outputStyle must be compact, digital, or long.",
@@ -3063,7 +3097,7 @@ function bi(e, i, t) {
3063
3097
  )
3064
3098
  );
3065
3099
  }
3066
- function _i(e, i, t) {
3100
+ function Si(e, i, t) {
3067
3101
  if (m(e) && e.type === "temporal_bucket") {
3068
3102
  t.push(
3069
3103
  o(
@@ -3074,9 +3108,9 @@ function _i(e, i, t) {
3074
3108
  );
3075
3109
  return;
3076
3110
  }
3077
- bi(e, i, t);
3111
+ $i(e, i, t);
3078
3112
  }
3079
- function U(e, i, t) {
3113
+ function G(e, i, t) {
3080
3114
  e !== void 0 && (typeof e != "number" || !Number.isFinite(e)) && t.push(
3081
3115
  o(
3082
3116
  "invalid_value_format_number",
@@ -3085,20 +3119,20 @@ function U(e, i, t) {
3085
3119
  )
3086
3120
  );
3087
3121
  }
3088
- const sn = /* @__PURE__ */ new Set([
3122
+ const ln = /* @__PURE__ */ new Set([
3089
3123
  "additive",
3090
3124
  "non_additive",
3091
3125
  "ratio_of_sums",
3092
3126
  "weighted",
3093
3127
  "pre_aggregated",
3094
3128
  "snapshot"
3095
- ]), on = /* @__PURE__ */ new Set([
3129
+ ]), dn = /* @__PURE__ */ new Set([
3096
3130
  "default",
3097
3131
  "symmetric_aggregate",
3098
3132
  "aggregate_then_join",
3099
3133
  "weighted"
3100
3134
  ]);
3101
- function rn(e, i, t) {
3135
+ function un(e, i, t) {
3102
3136
  if (!e || !m(e)) {
3103
3137
  t.push(
3104
3138
  o(
@@ -3110,7 +3144,7 @@ function rn(e, i, t) {
3110
3144
  return;
3111
3145
  }
3112
3146
  if (e.kind === "field") {
3113
- g(e.field, `${i}.field`, t, { required: !0 }), k(e.aggregate, `${i}.aggregate`, t);
3147
+ g(e.field, `${i}.field`, t, { required: !0 }), I(e.aggregate, `${i}.aggregate`, t);
3114
3148
  return;
3115
3149
  }
3116
3150
  t.push(
@@ -3121,7 +3155,7 @@ function rn(e, i, t) {
3121
3155
  )
3122
3156
  );
3123
3157
  }
3124
- function Be(e, i, t) {
3158
+ function Ke(e, i, t) {
3125
3159
  if (!m(e)) {
3126
3160
  t.push(
3127
3161
  o(
@@ -3147,7 +3181,7 @@ function Be(e, i, t) {
3147
3181
  required: !0
3148
3182
  });
3149
3183
  }
3150
- function ln(e, i, t) {
3184
+ function cn(e, i, t) {
3151
3185
  if (!m(e)) {
3152
3186
  t.push(
3153
3187
  o(
@@ -3164,27 +3198,27 @@ function ln(e, i, t) {
3164
3198
  "Result calculation output needs a stable key.",
3165
3199
  `${i}.key`
3166
3200
  )
3167
- ), e.dataType !== void 0 && (typeof e.dataType != "string" || !yi.has(e.dataType)) && t.push(
3201
+ ), e.dataType !== void 0 && (typeof e.dataType != "string" || !vi.has(e.dataType)) && t.push(
3168
3202
  o(
3169
3203
  "invalid_result_calculation_output",
3170
3204
  "Result calculation output dataType must be string, number, boolean, date, datetime, or unknown.",
3171
3205
  `${i}.dataType`
3172
3206
  )
3173
- ), _i(e.format, `${i}.format`, t);
3207
+ ), Si(e.format, `${i}.format`, t);
3174
3208
  }
3175
- function dn(e, i, t) {
3176
- e !== void 0 && (xi(e) || t.push(
3209
+ function pn(e, i, t) {
3210
+ e !== void 0 && (Mi(e) || t.push(
3177
3211
  o(
3178
3212
  "invalid_time_grain",
3179
- `Matrix time grain must be one of: ${fe.join(", ")}.`,
3213
+ `Matrix time grain must be one of: ${ge.join(", ")}.`,
3180
3214
  i
3181
3215
  )
3182
3216
  ));
3183
3217
  }
3184
- function vi(e, i, t, n) {
3218
+ function wi(e, i, t, n) {
3185
3219
  e !== "asc" && e !== "desc" && t.push(o(n, "Sort direction must be asc or desc.", i));
3186
3220
  }
3187
- function $i(e, i, t, n) {
3221
+ function ki(e, i, t, n) {
3188
3222
  e !== void 0 && e !== "warehouseDefault" && e !== "first" && e !== "last" && t.push(
3189
3223
  o(
3190
3224
  n,
@@ -3193,12 +3227,12 @@ function $i(e, i, t, n) {
3193
3227
  )
3194
3228
  );
3195
3229
  }
3196
- function wi(e, i, t, n) {
3230
+ function Ii(e, i, t, n) {
3197
3231
  e !== void 0 && e !== "global" && e !== "withinParent" && t.push(
3198
3232
  o(n, "Sort scope must be global or withinParent.", i)
3199
3233
  );
3200
3234
  }
3201
- function un(e, i, t) {
3235
+ function mn(e, i, t) {
3202
3236
  e.enabled !== void 0 && typeof e.enabled != "boolean" && t.push(
3203
3237
  o(
3204
3238
  "invalid_matrix_subtotal",
@@ -3219,18 +3253,18 @@ function un(e, i, t) {
3219
3253
  )
3220
3254
  );
3221
3255
  }
3222
- function cn(e, i, t) {
3223
- if (vi(
3256
+ function fn(e, i, t) {
3257
+ if (wi(
3224
3258
  e.direction,
3225
3259
  `${i}.direction`,
3226
3260
  t,
3227
3261
  "invalid_matrix_sort_direction"
3228
- ), $i(
3262
+ ), ki(
3229
3263
  e.nulls,
3230
3264
  `${i}.nulls`,
3231
3265
  t,
3232
3266
  "invalid_matrix_sort_nulls"
3233
- ), wi(
3267
+ ), Ii(
3234
3268
  e.scope,
3235
3269
  `${i}.scope`,
3236
3270
  t,
@@ -3249,7 +3283,7 @@ function cn(e, i, t) {
3249
3283
  if (e.by.kind === "field") {
3250
3284
  g(e.by.field, `${i}.by.field`, t, {
3251
3285
  required: !0
3252
- }), k(e.by.aggregate, `${i}.by.aggregate`, t);
3286
+ }), I(e.by.aggregate, `${i}.by.aggregate`, t);
3253
3287
  return;
3254
3288
  }
3255
3289
  t.push(
@@ -3261,7 +3295,7 @@ function cn(e, i, t) {
3261
3295
  );
3262
3296
  }
3263
3297
  }
3264
- function Pe(e, i, t, n) {
3298
+ function Ve(e, i, t, n) {
3265
3299
  if (!Array.isArray(e))
3266
3300
  return n.required ? t.push(
3267
3301
  o(
@@ -3285,7 +3319,7 @@ function Pe(e, i, t, n) {
3285
3319
  );
3286
3320
  const s = [];
3287
3321
  return e.forEach((r, l) => {
3288
- var T, j;
3322
+ var j, E;
3289
3323
  const d = `${i}.${l}`;
3290
3324
  if (!m(r)) {
3291
3325
  t.push(
@@ -3306,29 +3340,29 @@ function Pe(e, i, t, n) {
3306
3340
  )
3307
3341
  ), g(u.field, `${d}.field`, t, {
3308
3342
  required: !0
3309
- }), dn(u.grain, `${d}.grain`, t);
3310
- const p = $e(
3311
- (T = u.field) == null ? void 0 : T.dataType
3312
- ), y = ((j = u.field) == null ? void 0 : j.role) === "date" || p === "date" || p === "datetime", I = p === "string" || p === "number" || p === "boolean";
3343
+ }), pn(u.grain, `${d}.grain`, t);
3344
+ const p = Se(
3345
+ (j = u.field) == null ? void 0 : j.dataType
3346
+ ), y = ((E = u.field) == null ? void 0 : E.role) === "date" || p === "date" || p === "datetime", x = p === "string" || p === "number" || p === "boolean";
3313
3347
  y && !u.grain && t.push(
3314
3348
  o(
3315
3349
  "missing_matrix_temporal_grain",
3316
3350
  "Temporal Matrix axis levels require an explicit supported grain.",
3317
3351
  `${d}.grain`
3318
3352
  )
3319
- ), I && u.grain && t.push(
3353
+ ), x && u.grain && t.push(
3320
3354
  o(
3321
3355
  "invalid_matrix_temporal_grain",
3322
3356
  "Matrix grain is valid only for temporal axis fields.",
3323
3357
  `${d}.grain`
3324
3358
  )
3325
- ), u.format !== void 0 && (!u.grain || !oe.safeParse(u.format).success ? t.push(
3359
+ ), u.format !== void 0 && (!u.grain || !re.safeParse(u.format).success ? t.push(
3326
3360
  o(
3327
3361
  "invalid_matrix_temporal_format",
3328
3362
  "Matrix temporal presentation requires a valid structured format and explicit grain.",
3329
3363
  `${d}.format`
3330
3364
  )
3331
- ) : de(
3365
+ ) : ue(
3332
3366
  u.format,
3333
3367
  u.grain
3334
3368
  ).ok || t.push(
@@ -3340,15 +3374,15 @@ function Pe(e, i, t, n) {
3340
3374
  ));
3341
3375
  const v = u.semanticTemporalPresentation;
3342
3376
  if (v !== void 0) {
3343
- const Ie = v == null ? void 0 : v.format;
3344
- !u.grain || (v == null ? void 0 : v.granularity) !== u.grain || !oe.safeParse(Ie).success ? t.push(
3377
+ const xe = v == null ? void 0 : v.format;
3378
+ !u.grain || (v == null ? void 0 : v.granularity) !== u.grain || !re.safeParse(xe).success ? t.push(
3345
3379
  o(
3346
3380
  "invalid_matrix_temporal_format",
3347
3381
  "Matrix semantic temporal presentation must match the selected grain.",
3348
3382
  `${d}.semanticTemporalPresentation`
3349
3383
  )
3350
- ) : de(
3351
- Ie,
3384
+ ) : ue(
3385
+ xe,
3352
3386
  u.grain
3353
3387
  ).ok || t.push(
3354
3388
  o(
@@ -3364,7 +3398,7 @@ function Pe(e, i, t, n) {
3364
3398
  "Matrix axis level label must be a string.",
3365
3399
  `${d}.label`
3366
3400
  )
3367
- ), u.subtotal !== void 0 && typeof u.subtotal != "boolean" && (m(u.subtotal) ? un(
3401
+ ), u.subtotal !== void 0 && typeof u.subtotal != "boolean" && (m(u.subtotal) ? mn(
3368
3402
  u.subtotal,
3369
3403
  `${d}.subtotal`,
3370
3404
  t
@@ -3374,7 +3408,7 @@ function Pe(e, i, t, n) {
3374
3408
  "Matrix subtotal must be a boolean or structured options object.",
3375
3409
  `${d}.subtotal`
3376
3410
  )
3377
- )), u.sortBy !== void 0 && (m(u.sortBy) ? cn(
3411
+ )), u.sortBy !== void 0 && (m(u.sortBy) ? fn(
3378
3412
  u.sortBy,
3379
3413
  `${d}.sortBy`,
3380
3414
  t
@@ -3387,7 +3421,7 @@ function Pe(e, i, t, n) {
3387
3421
  ));
3388
3422
  }), s;
3389
3423
  }
3390
- function pn(e, i, t) {
3424
+ function gn(e, i, t) {
3391
3425
  if (!m(e)) {
3392
3426
  t.push(
3393
3427
  o(
@@ -3408,7 +3442,7 @@ function pn(e, i, t) {
3408
3442
  );
3409
3443
  return;
3410
3444
  }
3411
- e.kind === "customAggregate" && (Object.prototype.hasOwnProperty.call(e, "aggregate") ? k(e.aggregate, `${i}.aggregate`, t) : t.push(
3445
+ e.kind === "customAggregate" && (Object.prototype.hasOwnProperty.call(e, "aggregate") ? I(e.aggregate, `${i}.aggregate`, t) : t.push(
3412
3446
  o(
3413
3447
  "invalid_matrix_total_behavior",
3414
3448
  "Custom matrix total behavior needs an aggregate.",
@@ -3428,7 +3462,7 @@ function pn(e, i, t) {
3428
3462
  )
3429
3463
  );
3430
3464
  }
3431
- function mn(e, i, t) {
3465
+ function hn(e, i, t) {
3432
3466
  if (!Array.isArray(e) || e.length === 0)
3433
3467
  return t.push(
3434
3468
  o(
@@ -3459,11 +3493,11 @@ function mn(e, i, t) {
3459
3493
  )
3460
3494
  ), g(d.field, `${l}.field`, t, {
3461
3495
  required: !0
3462
- }), k(
3496
+ }), I(
3463
3497
  d.aggregate,
3464
3498
  `${l}.aggregate`,
3465
3499
  t
3466
- ), _i(
3500
+ ), Si(
3467
3501
  d.format,
3468
3502
  `${l}.format`,
3469
3503
  t
@@ -3473,14 +3507,14 @@ function mn(e, i, t) {
3473
3507
  "Matrix value label must be a string.",
3474
3508
  `${l}.label`
3475
3509
  )
3476
- ), d.totalBehavior !== void 0 && pn(
3510
+ ), d.totalBehavior !== void 0 && gn(
3477
3511
  d.totalBehavior,
3478
3512
  `${l}.totalBehavior`,
3479
3513
  t
3480
3514
  );
3481
3515
  }), n;
3482
3516
  }
3483
- function fn(e, i, t) {
3517
+ function yn(e, i, t) {
3484
3518
  if (!m(e)) {
3485
3519
  t.push(
3486
3520
  o(
@@ -3535,7 +3569,7 @@ function fn(e, i, t) {
3535
3569
  )
3536
3570
  );
3537
3571
  }
3538
- function pe(e, i, t, n) {
3572
+ function me(e, i, t, n) {
3539
3573
  if (!Array.isArray(e)) {
3540
3574
  n.push(
3541
3575
  o(
@@ -3584,7 +3618,7 @@ function pe(e, i, t, n) {
3584
3618
  );
3585
3619
  });
3586
3620
  }
3587
- function Ke(e, i, t, n) {
3621
+ function Le(e, i, t, n) {
3588
3622
  if (!m(e)) {
3589
3623
  n.push(
3590
3624
  o(
@@ -3608,7 +3642,7 @@ function Ke(e, i, t, n) {
3608
3642
  `${i}.lazy`
3609
3643
  )
3610
3644
  ), e.expandedPaths !== void 0 && (Array.isArray(e.expandedPaths) ? e.expandedPaths.forEach((s, r) => {
3611
- pe(
3645
+ me(
3612
3646
  s,
3613
3647
  `${i}.expandedPaths.${r}`,
3614
3648
  t,
@@ -3622,7 +3656,7 @@ function Ke(e, i, t, n) {
3622
3656
  )
3623
3657
  ));
3624
3658
  }
3625
- function gn(e, i, t, n) {
3659
+ function bn(e, i, t, n) {
3626
3660
  if (e !== void 0) {
3627
3661
  if (!m(e)) {
3628
3662
  n.push(
@@ -3634,12 +3668,12 @@ function gn(e, i, t, n) {
3634
3668
  );
3635
3669
  return;
3636
3670
  }
3637
- e.rows !== void 0 && Ke(
3671
+ e.rows !== void 0 && Le(
3638
3672
  e.rows,
3639
3673
  "expansion.rows",
3640
3674
  i,
3641
3675
  n
3642
- ), e.columns !== void 0 && Ke(
3676
+ ), e.columns !== void 0 && Le(
3643
3677
  e.columns,
3644
3678
  "expansion.columns",
3645
3679
  t,
@@ -3647,7 +3681,7 @@ function gn(e, i, t, n) {
3647
3681
  );
3648
3682
  }
3649
3683
  }
3650
- function hn(e, i, t, n, s) {
3684
+ function _n(e, i, t, n, s) {
3651
3685
  if (e !== void 0) {
3652
3686
  if (!Array.isArray(e)) {
3653
3687
  s.push(
@@ -3686,17 +3720,17 @@ function hn(e, i, t, n, s) {
3686
3720
  "Matrix sort targetId must reference an explicit public axis level id.",
3687
3721
  `${d}.targetId`
3688
3722
  )
3689
- ), vi(
3723
+ ), wi(
3690
3724
  u.direction,
3691
3725
  `${d}.direction`,
3692
3726
  s,
3693
3727
  "invalid_matrix_sort_direction"
3694
- ), $i(
3728
+ ), ki(
3695
3729
  u.nulls,
3696
3730
  `${d}.nulls`,
3697
3731
  s,
3698
3732
  "invalid_matrix_sort_nulls"
3699
- ), wi(
3733
+ ), Ii(
3700
3734
  u.scope,
3701
3735
  `${d}.scope`,
3702
3736
  s,
@@ -3715,7 +3749,7 @@ function hn(e, i, t, n, s) {
3715
3749
  if (u.by.kind === "field") {
3716
3750
  g(u.by.field, `${d}.by.field`, s, {
3717
3751
  required: !0
3718
- }), k(
3752
+ }), I(
3719
3753
  u.by.aggregate,
3720
3754
  `${d}.by.aggregate`,
3721
3755
  s
@@ -3729,12 +3763,12 @@ function hn(e, i, t, n, s) {
3729
3763
  "Matrix value sort must reference an explicit public value id.",
3730
3764
  `${d}.by.valueId`
3731
3765
  )
3732
- ), u.by.rowPath !== void 0 && pe(
3766
+ ), u.by.rowPath !== void 0 && me(
3733
3767
  u.by.rowPath,
3734
3768
  `${d}.by.rowPath`,
3735
3769
  i,
3736
3770
  s
3737
- ), u.by.columnPath !== void 0 && pe(
3771
+ ), u.by.columnPath !== void 0 && me(
3738
3772
  u.by.columnPath,
3739
3773
  `${d}.by.columnPath`,
3740
3774
  t,
@@ -3753,7 +3787,7 @@ function hn(e, i, t, n, s) {
3753
3787
  });
3754
3788
  }
3755
3789
  }
3756
- function yn(e, i) {
3790
+ function vn(e, i) {
3757
3791
  if (e !== void 0) {
3758
3792
  if (!m(e)) {
3759
3793
  i.push(
@@ -3792,7 +3826,7 @@ function yn(e, i) {
3792
3826
  );
3793
3827
  }
3794
3828
  }
3795
- function Ve(e, i, t) {
3829
+ function He(e, i, t) {
3796
3830
  if (!m(e)) {
3797
3831
  t.push(
3798
3832
  o(
@@ -3819,7 +3853,7 @@ function Ve(e, i, t) {
3819
3853
  )
3820
3854
  );
3821
3855
  }
3822
- function bn(e, i) {
3856
+ function $n(e, i) {
3823
3857
  if (e !== void 0) {
3824
3858
  if (!m(e)) {
3825
3859
  i.push(
@@ -3831,11 +3865,11 @@ function bn(e, i) {
3831
3865
  );
3832
3866
  return;
3833
3867
  }
3834
- e.rows !== void 0 && Ve(
3868
+ e.rows !== void 0 && He(
3835
3869
  e.rows,
3836
3870
  "displayLimits.rows",
3837
3871
  i
3838
- ), e.columns !== void 0 && Ve(
3872
+ ), e.columns !== void 0 && He(
3839
3873
  e.columns,
3840
3874
  "displayLimits.columns",
3841
3875
  i
@@ -3850,7 +3884,7 @@ function bn(e, i) {
3850
3884
  );
3851
3885
  }
3852
3886
  }
3853
- function _n(e, i) {
3887
+ function Sn(e, i) {
3854
3888
  var u;
3855
3889
  ((u = e.source) == null ? void 0 : u.kind) === "sql" && i.push(
3856
3890
  o(
@@ -3859,22 +3893,22 @@ function _n(e, i) {
3859
3893
  "source.kind"
3860
3894
  )
3861
3895
  );
3862
- const t = Pe(e.rows, "rows", i, {
3896
+ const t = Ve(e.rows, "rows", i, {
3863
3897
  required: !0
3864
- }), n = Pe(e.columns, "columns", i, {
3898
+ }), n = Ve(e.columns, "columns", i, {
3865
3899
  required: !1
3866
- }), s = mn(e.values, "values", i);
3867
- z(e.filters, "filters", i), e.totals !== void 0 && fn(e.totals, "totals", i), te(
3900
+ }), s = hn(e.values, "values", i);
3901
+ Y(e.filters, "filters", i), e.totals !== void 0 && yn(e.totals, "totals", i), ae(
3868
3902
  t.map((p) => p.id),
3869
3903
  "rows",
3870
3904
  "row axis level",
3871
3905
  i
3872
- ), te(
3906
+ ), ae(
3873
3907
  n.map((p) => p.id),
3874
3908
  "columns",
3875
3909
  "column axis level",
3876
3910
  i
3877
- ), te(
3911
+ ), ae(
3878
3912
  s.map((p) => p.id),
3879
3913
  "values",
3880
3914
  "value",
@@ -3887,20 +3921,20 @@ function _n(e, i) {
3887
3921
  ), d = new Set(
3888
3922
  s.map((p) => p.id).filter((p) => f(p))
3889
3923
  );
3890
- hn(
3924
+ _n(
3891
3925
  e.sort,
3892
3926
  r,
3893
3927
  l,
3894
3928
  d,
3895
3929
  i
3896
- ), gn(
3930
+ ), bn(
3897
3931
  e.expansion,
3898
3932
  r,
3899
3933
  l,
3900
3934
  i
3901
- ), yn(e.layout, i), bn(e.displayLimits, i);
3935
+ ), vn(e.layout, i), $n(e.displayLimits, i);
3902
3936
  }
3903
- function vn(e, i) {
3937
+ function wn(e, i) {
3904
3938
  if (e.analysis === void 0)
3905
3939
  return;
3906
3940
  if (!m(e.analysis)) {
@@ -3943,9 +3977,9 @@ function vn(e, i) {
3943
3977
  )
3944
3978
  );
3945
3979
  const { timeWindow: t } = e.analysis;
3946
- t !== void 0 && me(t, "analysis.timeWindow", i);
3980
+ t !== void 0 && fe(t, "analysis.timeWindow", i);
3947
3981
  }
3948
- function me(e, i, t) {
3982
+ function fe(e, i, t) {
3949
3983
  if (!m(e)) {
3950
3984
  t.push(
3951
3985
  o(
@@ -3976,7 +4010,7 @@ function me(e, i, t) {
3976
4010
  `${i}.end`
3977
4011
  )
3978
4012
  ), f(e.start) && f(e.end)) {
3979
- const n = ue(e.start), s = ue(e.end);
4013
+ const n = ce(e.start), s = ce(e.end);
3980
4014
  n || t.push(
3981
4015
  o(
3982
4016
  "invalid_time_window",
@@ -3999,10 +4033,10 @@ function me(e, i, t) {
3999
4033
  }
4000
4034
  return;
4001
4035
  }
4002
- (typeof e.unit != "string" || !tn.has(e.unit)) && t.push(
4036
+ (typeof e.unit != "string" || !sn.has(e.unit)) && t.push(
4003
4037
  o(
4004
4038
  "invalid_time_window",
4005
- `Time window unit must be one of: ${O.join(", ")}.`,
4039
+ `Time window unit must be one of: ${P.join(", ")}.`,
4006
4040
  `${i}.unit`
4007
4041
  )
4008
4042
  ), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) && t.push(
@@ -4025,7 +4059,7 @@ function me(e, i, t) {
4025
4059
  )
4026
4060
  );
4027
4061
  }
4028
- function z(e, i, t) {
4062
+ function Y(e, i, t) {
4029
4063
  if (e !== void 0) {
4030
4064
  if (!Array.isArray(e)) {
4031
4065
  t.push(
@@ -4122,7 +4156,7 @@ function z(e, i, t) {
4122
4156
  });
4123
4157
  }
4124
4158
  }
4125
- function $n(e) {
4159
+ function kn(e) {
4126
4160
  const i = [];
4127
4161
  if (!m(e))
4128
4162
  return i.push(
@@ -4149,19 +4183,19 @@ function $n(e) {
4149
4183
  "Derived field needs a label.",
4150
4184
  "label"
4151
4185
  )
4152
- ), Wa.has(e.resultRole) || i.push(
4186
+ ), tn.has(e.resultRole) || i.push(
4153
4187
  o(
4154
4188
  "invalid_derived_field_role",
4155
4189
  "Derived field resultRole must be measure, dimension, date, id, or unknown.",
4156
4190
  "resultRole"
4157
4191
  )
4158
- ), yi.has(e.dataType) || i.push(
4192
+ ), vi.has(e.dataType) || i.push(
4159
4193
  o(
4160
4194
  "invalid_derived_field_data_type",
4161
4195
  "Derived field dataType must be string, number, boolean, date, datetime, or unknown.",
4162
4196
  "dataType"
4163
4197
  )
4164
- ), Ja.has(e.computeStage) || i.push(
4198
+ ), an.has(e.computeStage) || i.push(
4165
4199
  o(
4166
4200
  "invalid_derived_field_compute_stage",
4167
4201
  "Derived field computeStage must be row or aggregate.",
@@ -4185,11 +4219,11 @@ function $n(e) {
4185
4219
  "Row-stage measure derived fields must declare defaultAggregate so row results have explicit rollup semantics.",
4186
4220
  "defaultAggregate"
4187
4221
  )
4188
- ), k(
4222
+ ), I(
4189
4223
  e.defaultAggregate,
4190
4224
  "defaultAggregate",
4191
4225
  i
4192
- ), e.aggregationBehavior !== void 0 && !sn.has(
4226
+ ), e.aggregationBehavior !== void 0 && !ln.has(
4193
4227
  e.aggregationBehavior
4194
4228
  ) && i.push(
4195
4229
  o(
@@ -4197,7 +4231,7 @@ function $n(e) {
4197
4231
  "Derived field aggregationBehavior is not supported.",
4198
4232
  "aggregationBehavior"
4199
4233
  )
4200
- ), e.aggregationStrategy !== void 0 && !on.has(
4234
+ ), e.aggregationStrategy !== void 0 && !dn.has(
4201
4235
  e.aggregationStrategy
4202
4236
  ) && i.push(
4203
4237
  o(
@@ -4234,13 +4268,13 @@ function $n(e) {
4234
4268
  );
4235
4269
  return;
4236
4270
  }
4237
- rn(
4271
+ un(
4238
4272
  s,
4239
4273
  `inputs.${n}`,
4240
4274
  i
4241
4275
  );
4242
4276
  }), f(e.expression) && m(e.inputs)) {
4243
- const n = Ua(
4277
+ const n = Ya(
4244
4278
  e.expression
4245
4279
  ), s = new Set(n), r = Object.keys(e.inputs).filter(
4246
4280
  (l) => f(l)
@@ -4270,7 +4304,7 @@ function $n(e) {
4270
4304
  "Derived field computation metadata cannot own temporal bucket presentation; declare grain and format on the grouped field.",
4271
4305
  "format"
4272
4306
  )
4273
- ) : bi(t, "format", i), e.tags !== void 0 && (!Array.isArray(e.tags) || e.tags.some((n) => !f(n))) && i.push(
4307
+ ) : $i(t, "format", i), e.tags !== void 0 && (!Array.isArray(e.tags) || e.tags.some((n) => !f(n))) && i.push(
4274
4308
  o(
4275
4309
  "invalid_derived_field_tags",
4276
4310
  "Derived field tags must be non-empty strings.",
@@ -4278,7 +4312,7 @@ function $n(e) {
4278
4312
  )
4279
4313
  ), { ok: i.length === 0, errors: i, warnings: [] };
4280
4314
  }
4281
- function Hn(e) {
4315
+ function zn(e) {
4282
4316
  const i = [];
4283
4317
  if (!m(e))
4284
4318
  return i.push(
@@ -4305,11 +4339,11 @@ function Hn(e) {
4305
4339
  "Result calculation kind must be percent_of_total, rank, running_total, or previous_row_delta.",
4306
4340
  "kind"
4307
4341
  )
4308
- ), Be(e.input, "input", i), ln(e.output, "output", i), e.kind === "percent_of_total") {
4342
+ ), Ke(e.input, "input", i), cn(e.output, "output", i), e.kind === "percent_of_total") {
4309
4343
  const t = e.denominator;
4310
4344
  t !== void 0 && (m(t) ? t.scope === "population" ? (g(t.metric, "denominator.metric", i, {
4311
4345
  required: !0
4312
- }), z(
4346
+ }), Y(
4313
4347
  t.filters,
4314
4348
  "denominator.filters",
4315
4349
  i
@@ -4333,9 +4367,9 @@ function Hn(e) {
4333
4367
  "Rank result calculation order must be asc or desc.",
4334
4368
  "order"
4335
4369
  )
4336
- ), (e.kind === "running_total" || e.kind === "previous_row_delta") && e.orderBy !== void 0 && Be(e.orderBy, "orderBy", i), { ok: i.length === 0, errors: i, warnings: [] };
4370
+ ), (e.kind === "running_total" || e.kind === "previous_row_delta") && e.orderBy !== void 0 && Ke(e.orderBy, "orderBy", i), { ok: i.length === 0, errors: i, warnings: [] };
4337
4371
  }
4338
- function Si(e) {
4372
+ function xi(e) {
4339
4373
  var n;
4340
4374
  const i = [], t = [];
4341
4375
  if (!e || typeof e != "object")
@@ -4361,7 +4395,7 @@ function Si(e) {
4361
4395
  "Analytics intent version must be 1.",
4362
4396
  "version"
4363
4397
  )
4364
- ), Se(e.source, "source", i), wn(e, i), Za(e, i), "relationshipHint" in e && e.relationshipHint !== void 0 && ke(
4398
+ ), ke(e.source, "source", i), In(e, i), Ja(e, i), "relationshipHint" in e && e.relationshipHint !== void 0 && Ie(
4365
4399
  e.relationshipHint,
4366
4400
  "relationshipHint",
4367
4401
  i
@@ -4387,16 +4421,16 @@ function Si(e) {
4387
4421
  g(r, `measures.${l}`, i, {
4388
4422
  required: !0
4389
4423
  });
4390
- }), s.length > 0 && !Da(s)) {
4424
+ }), s.length > 0 && !Oa(s)) {
4391
4425
  const r = s.find(
4392
4426
  (l, d) => s.some(
4393
- (u, p) => p !== d && gi(u, l)
4427
+ (u, p) => p !== d && bi(u, l)
4394
4428
  )
4395
4429
  );
4396
4430
  r && i.push(
4397
4431
  o(
4398
4432
  "duplicate_measure",
4399
- Na(r),
4433
+ Pa(r),
4400
4434
  "measures"
4401
4435
  )
4402
4436
  );
@@ -4412,7 +4446,7 @@ function Si(e) {
4412
4446
  )
4413
4447
  ), e.primaryMeasure !== void 0 && (g(e.primaryMeasure, "primaryMeasure", i, {
4414
4448
  required: !0
4415
- }), m(e.primaryMeasure) && f(e.primaryMeasure.name) && s.length > 0 && !Oa(
4449
+ }), m(e.primaryMeasure) && f(e.primaryMeasure.name) && s.length > 0 && !Ka(
4416
4450
  e.primaryMeasure,
4417
4451
  s
4418
4452
  ) && i.push(
@@ -4435,13 +4469,13 @@ function Si(e) {
4435
4469
  "Metric intent dimensions must be an array of field references with names.",
4436
4470
  "dimensions"
4437
4471
  )
4438
- ), e.dateField !== void 0 && g(e.dateField, "dateField", i), e.timeWindow !== void 0 && (me(e.timeWindow, "timeWindow", i), e.dateField || i.push(
4472
+ ), e.dateField !== void 0 && g(e.dateField, "dateField", i), e.timeWindow !== void 0 && (fe(e.timeWindow, "timeWindow", i), e.dateField || i.push(
4439
4473
  o(
4440
4474
  "missing_time_window_date_field",
4441
4475
  "Metric timeWindow needs a dateField.",
4442
4476
  "dateField"
4443
4477
  )
4444
- )), z(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((r, l) => {
4478
+ )), Y(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((r, l) => {
4445
4479
  g(r, `dimensions.${l}`, i);
4446
4480
  }), e.orderBy !== void 0) {
4447
4481
  if (!m(e.orderBy))
@@ -4468,7 +4502,7 @@ function Si(e) {
4468
4502
  (l) => m(l) && f(l.name)
4469
4503
  ) : []
4470
4504
  ];
4471
- r.length > 0 && !Ba(
4505
+ r.length > 0 && !Va(
4472
4506
  e.orderBy.field,
4473
4507
  r
4474
4508
  ) && i.push(
@@ -4480,7 +4514,7 @@ function Si(e) {
4480
4514
  );
4481
4515
  }
4482
4516
  }
4483
- vn(e, i);
4517
+ wn(e, i);
4484
4518
  } else if (e.kind === "records") {
4485
4519
  if (!Array.isArray(e.fields) || e.fields.length === 0 ? i.push(
4486
4520
  o(
@@ -4498,13 +4532,13 @@ function Si(e) {
4498
4532
  )
4499
4533
  ), Array.isArray(e.fields) && e.fields.forEach((s, r) => {
4500
4534
  g(s, `fields.${r}`, i);
4501
- }), e.dateField !== void 0 && g(e.dateField, "dateField", i), qe(e.pagination, "pagination", i), e.timeWindow !== void 0 && (me(e.timeWindow, "timeWindow", i), e.dateField || i.push(
4535
+ }), e.dateField !== void 0 && g(e.dateField, "dateField", i), Pe(e.pagination, "pagination", i), e.timeWindow !== void 0 && (fe(e.timeWindow, "timeWindow", i), e.dateField || i.push(
4502
4536
  o(
4503
4537
  "missing_time_window_date_field",
4504
4538
  "Records timeWindow needs a dateField.",
4505
4539
  "dateField"
4506
4540
  )
4507
- )), z(e.filters, "filters", i), Array.isArray(e.filters) && e.filters.forEach((s, r) => {
4541
+ )), Y(e.filters, "filters", i), Array.isArray(e.filters) && e.filters.forEach((s, r) => {
4508
4542
  m(s) && s.scope === "aggregate" && i.push(
4509
4543
  o(
4510
4544
  "unsupported_record_filter_scope",
@@ -4562,7 +4596,7 @@ function Si(e) {
4562
4596
  );
4563
4597
  });
4564
4598
  }
4565
- } else e.kind === "inputOptions" ? Qa(e, i) : e.kind === "matrix" ? _n(e, i) : e.kind === "sql" ? (((n = e.source) == null ? void 0 : n.kind) !== "sql" && i.push(
4599
+ } else e.kind === "inputOptions" ? Wa(e, i) : e.kind === "matrix" ? Sn(e, i) : e.kind === "sql" ? (((n = e.source) == null ? void 0 : n.kind) !== "sql" && i.push(
4566
4600
  o(
4567
4601
  "invalid_sql_source",
4568
4602
  "SQL analytics intent must use a SQL execution source.",
@@ -4570,13 +4604,13 @@ function Si(e) {
4570
4604
  )
4571
4605
  ), f(e.sql) || i.push(
4572
4606
  o("missing_sql", "SQL analytics intent needs SQL text.", "sql")
4573
- ), qa(
4607
+ ), Ba(
4574
4608
  e.defaultParameters,
4575
4609
  "defaultParameters",
4576
4610
  i
4577
4611
  ), Array.isArray(e.fields) && e.fields.forEach((s, r) => {
4578
4612
  g(s, `fields.${r}`, i);
4579
- }), qe(e.pagination, "pagination", i)) : i.push(
4613
+ }), Pe(e.pagination, "pagination", i)) : i.push(
4580
4614
  o(
4581
4615
  "invalid_analytics_kind",
4582
4616
  "Analytics kind is not supported.",
@@ -4587,10 +4621,10 @@ function Si(e) {
4587
4621
  ok: i.length === 0,
4588
4622
  errors: i,
4589
4623
  warnings: t,
4590
- repairHints: kn(i)
4624
+ repairHints: An(i)
4591
4625
  };
4592
4626
  }
4593
- function wn(e, i) {
4627
+ function In(e, i) {
4594
4628
  if (!(!("derivedFields" in e) || e.derivedFields === void 0)) {
4595
4629
  if (!Array.isArray(e.derivedFields)) {
4596
4630
  i.push(
@@ -4603,7 +4637,7 @@ function wn(e, i) {
4603
4637
  return;
4604
4638
  }
4605
4639
  e.derivedFields.forEach((t, n) => {
4606
- $n(
4640
+ kn(
4607
4641
  t
4608
4642
  ).errors.forEach((r) => {
4609
4643
  i.push({
@@ -4614,7 +4648,7 @@ function wn(e, i) {
4614
4648
  });
4615
4649
  }
4616
4650
  }
4617
- function Sn(e) {
4651
+ function xn(e) {
4618
4652
  const i = [], t = [];
4619
4653
  if (!e || typeof e != "object")
4620
4654
  return {
@@ -4669,7 +4703,7 @@ function Sn(e) {
4669
4703
  "instruction"
4670
4704
  )
4671
4705
  ), e.analyticsIntent) {
4672
- const n = Si(
4706
+ const n = xi(
4673
4707
  e.analyticsIntent
4674
4708
  );
4675
4709
  i.push(...n.errors), t.push(...n.warnings);
@@ -4686,10 +4720,10 @@ function Sn(e) {
4686
4720
  ok: i.length === 0,
4687
4721
  errors: i,
4688
4722
  warnings: t,
4689
- repairHints: ki(i)
4723
+ repairHints: Ai(i)
4690
4724
  };
4691
4725
  }
4692
- function Un(e) {
4726
+ function Yn(e) {
4693
4727
  const i = [], t = [];
4694
4728
  if (!e || typeof e != "object")
4695
4729
  return {
@@ -4717,7 +4751,7 @@ function Un(e) {
4717
4751
  "kind"
4718
4752
  )
4719
4753
  );
4720
- const n = Sn(
4754
+ const n = xn(
4721
4755
  e.operationIntent
4722
4756
  );
4723
4757
  return i.push(...n.errors), t.push(...n.warnings), Array.isArray(e.plannedToolCalls) || i.push(
@@ -4730,16 +4764,16 @@ function Un(e) {
4730
4764
  ok: i.length === 0,
4731
4765
  errors: i,
4732
4766
  warnings: t,
4733
- repairHints: ki(i)
4767
+ repairHints: Ai(i)
4734
4768
  };
4735
4769
  }
4736
- function ki(e) {
4770
+ function Ai(e) {
4737
4771
  return e.map((i) => ({
4738
4772
  code: i.code,
4739
4773
  recommendedNextStep: i.code === "missing_obligations" ? "Normalize the user request into one or more typed analytics obligations before recovery planning." : "Correct the operation/recovery contract shape before planning execution."
4740
4774
  }));
4741
4775
  }
4742
- function kn(e) {
4776
+ function An(e) {
4743
4777
  return e.map((i) => {
4744
4778
  switch (i.code) {
4745
4779
  case "missing_source":
@@ -4822,7 +4856,7 @@ function kn(e) {
4822
4856
  }
4823
4857
  }).filter((i) => !!i);
4824
4858
  }
4825
- function In(e, i, t, n) {
4859
+ function Rn(e, i, t, n) {
4826
4860
  if (!e || typeof e != "object") {
4827
4861
  t.push(
4828
4862
  o("invalid_view", "Dashboard view must be an object.", i)
@@ -4868,7 +4902,7 @@ function In(e, i, t, n) {
4868
4902
  `${i}.analytics.kind`
4869
4903
  )
4870
4904
  );
4871
- const s = Si(e.analytics);
4905
+ const s = xi(e.analytics);
4872
4906
  for (const r of s.errors)
4873
4907
  t.push(
4874
4908
  o(
@@ -4886,7 +4920,7 @@ function In(e, i, t, n) {
4886
4920
  )
4887
4921
  );
4888
4922
  }
4889
- function Gn(e) {
4923
+ function Qn(e) {
4890
4924
  const i = [], t = [];
4891
4925
  if (!e || typeof e != "object")
4892
4926
  return {
@@ -4906,7 +4940,7 @@ function Gn(e) {
4906
4940
  ), f(e.title) || i.push(
4907
4941
  o("missing_title", "Dashboard intent needs a title.", "title")
4908
4942
  );
4909
- const n = Array.isArray(e.inputs) ? e.inputs : [], s = ce(
4943
+ const n = Array.isArray(e.inputs) ? e.inputs : [], s = pe(
4910
4944
  n.filter(m).map((u) => u.id).filter((u) => typeof u == "string")
4911
4945
  );
4912
4946
  s && i.push(
@@ -4942,7 +4976,7 @@ function Gn(e) {
4942
4976
  );
4943
4977
  const l = r.flatMap(
4944
4978
  (u) => u && typeof u == "object" && Array.isArray(u.views) ? u.views.filter(m).map((p) => p.id).filter((p) => !!p) : []
4945
- ), d = ce(l);
4979
+ ), d = pe(l);
4946
4980
  d && i.push(
4947
4981
  o(
4948
4982
  "duplicate_view_id",
@@ -4978,10 +5012,10 @@ function Gn(e) {
4978
5012
  );
4979
5013
  continue;
4980
5014
  }
4981
- for (const [I, v] of p.views.entries())
4982
- In(
5015
+ for (const [x, v] of p.views.entries())
5016
+ Rn(
4983
5017
  v,
4984
- `${y}.views.${I}`,
5018
+ `${y}.views.${x}`,
4985
5019
  i,
4986
5020
  t
4987
5021
  );
@@ -4989,82 +5023,84 @@ function Gn(e) {
4989
5023
  return { ok: i.length === 0, errors: i, warnings: t };
4990
5024
  }
4991
5025
  export {
4992
- Dn as $,
4993
- Un as A,
4994
- Gn as B,
4995
- ve as C,
4996
- $a as D,
4997
- wa as E,
4998
- $e as F,
4999
- Aa as G,
5000
- di as H,
5001
- ui as I,
5002
- Ce as J,
5003
- pi as K,
5004
- Bn as L,
5005
- Pn as M,
5006
- Rt as N,
5007
- oe as O,
5008
- Et as P,
5009
- ei as Q,
5010
- An as R,
5011
- ne as S,
5012
- Rn as T,
5013
- Ft as U,
5014
- Dt as V,
5015
- F as W,
5016
- M as X,
5017
- ii as Y,
5018
- be as Z,
5019
- N as _,
5020
- Cn as a,
5021
- Nn as a0,
5022
- le as a1,
5023
- ai as a2,
5024
- Lt as a3,
5025
- Ht as a4,
5026
- Ut as a5,
5027
- Gt as a6,
5028
- pa as a7,
5029
- ma as a8,
5030
- ni as a9,
5031
- si as aa,
5032
- oi as ab,
5033
- fa as ac,
5034
- ha as ad,
5035
- On as ae,
5036
- ge as af,
5037
- Le as ag,
5038
- jn as ah,
5039
- Ci as ai,
5040
- de as aj,
5041
- Kn as ak,
5042
- ja as al,
5043
- Ra as am,
5044
- Vn as an,
5045
- Mi as b,
5046
- he as c,
5047
- ca as d,
5048
- Ri as e,
5049
- Ti as f,
5050
- qn as g,
5051
- Ln as h,
5052
- Fn as i,
5053
- Tn as j,
5054
- ae as k,
5055
- O as l,
5056
- Ii as m,
5057
- fe as n,
5058
- xi as o,
5059
- En as p,
5060
- Ai as q,
5061
- Mn as r,
5062
- Ei as s,
5063
- re as t,
5064
- ue as u,
5065
- Ue as v,
5066
- $n as w,
5067
- Hn as x,
5068
- Si as y,
5069
- Sn as z
5026
+ On as $,
5027
+ Yn as A,
5028
+ Qn as B,
5029
+ $e as C,
5030
+ ka as D,
5031
+ Ia as E,
5032
+ Se as F,
5033
+ Ta as G,
5034
+ pi as H,
5035
+ mi as I,
5036
+ De as J,
5037
+ gi as K,
5038
+ Vn as L,
5039
+ Ln as M,
5040
+ jt as N,
5041
+ re as O,
5042
+ Dt as P,
5043
+ ai as Q,
5044
+ Tn as R,
5045
+ se as S,
5046
+ jn as T,
5047
+ qt as U,
5048
+ Ot as V,
5049
+ D as W,
5050
+ T as X,
5051
+ ni as Y,
5052
+ _e as Z,
5053
+ q as _,
5054
+ Nn as a,
5055
+ Pn as a0,
5056
+ de as a1,
5057
+ oi as a2,
5058
+ Gt as a3,
5059
+ zt as a4,
5060
+ Yt as a5,
5061
+ Qt as a6,
5062
+ ga as a7,
5063
+ ha as a8,
5064
+ ri as a9,
5065
+ li as aa,
5066
+ di as ab,
5067
+ ya as ac,
5068
+ _a as ad,
5069
+ Kn as ae,
5070
+ A as af,
5071
+ Ue as ag,
5072
+ he as ah,
5073
+ Ge as ai,
5074
+ Fn as aj,
5075
+ Ni as ak,
5076
+ ue as al,
5077
+ Hn as am,
5078
+ Fa as an,
5079
+ ja as ao,
5080
+ Un as ap,
5081
+ Ei as b,
5082
+ ye as c,
5083
+ fa as d,
5084
+ ji as e,
5085
+ Ci as f,
5086
+ Bn as g,
5087
+ Gn as h,
5088
+ qn as i,
5089
+ Cn as j,
5090
+ ne as k,
5091
+ P as l,
5092
+ Ri as m,
5093
+ ge as n,
5094
+ Mi as o,
5095
+ Dn as p,
5096
+ Ti as q,
5097
+ En as r,
5098
+ Di as s,
5099
+ le as t,
5100
+ ce as u,
5101
+ Ye as v,
5102
+ kn as w,
5103
+ zn as x,
5104
+ xi as y,
5105
+ xn as z
5070
5106
  };