react-semaphor 0.1.561 → 0.1.562

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 (138) hide show
  1. package/dist/analytics-protocol/index.js +452 -429
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{analytics-base-schemas-CB3oFAXk.js → analytics-base-schemas-BaIQrEzX.js} +139 -134
  7. package/dist/chunks/{assistant-chat-DiVHY3Hw.js → assistant-chat-R_yT8xH4.js} +104 -104
  8. package/dist/chunks/{bookmark-impact-CR09dpkn.js → bookmark-impact-D4Kl4amw.js} +2 -2
  9. package/dist/chunks/{bookmark-state-BusLpkb7.js → bookmark-state-CWeoGbrx.js} +25 -25
  10. package/dist/chunks/{braces-u8VorWJc.js → braces-DzgoQC64.js} +1 -1
  11. package/dist/chunks/{comparison-window-caption-DDsIWJYT.js → comparison-window-caption-D1EUXzaR.js} +562 -437
  12. package/dist/chunks/{context-TUjw9eqr.js → context-R31TSL5V.js} +1 -1
  13. package/dist/chunks/{dashboard-BRdZBPqr.js → dashboard-Bp1y5oun.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-CgvTLndW.js → dashboard-briefing-launcher-S5FB3aUW.js} +155 -154
  15. package/dist/chunks/{dashboard-controls-B4vfSzTF.js → dashboard-controls-CfC_6Ztn.js} +970 -968
  16. package/dist/chunks/{dashboard-json-Y3MF59g7.js → dashboard-json-gYZT7ZQY.js} +5 -5
  17. package/dist/chunks/dates-DFY7Gfss.js +91 -0
  18. package/dist/chunks/{edit-dashboard-visual-DwjZcxj-.js → edit-dashboard-visual-u7OI_g8Q.js} +4636 -4681
  19. package/dist/chunks/{filter-reach-copy-bijwf_-b.js → filter-reach-copy-CvV7W5dd.js} +1470 -1101
  20. package/dist/chunks/{filter-value-text-DFnhwuEW.js → filter-value-text-CPwFkrMz.js} +11 -10
  21. package/dist/chunks/{global-date-filter-utils-BXgCpvQM.js → global-date-filter-utils-N1kcsOFE.js} +8997 -7417
  22. package/dist/chunks/{index-ClwbY3BL.js → index-CNGkfUp4.js} +91 -85
  23. package/dist/chunks/{layout-grid-CtvCBfOm.js → layout-grid-BM65viQh.js} +1 -1
  24. package/dist/chunks/{list-filter-BklYgciR.js → list-filter-BoeLBfL3.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-pU51-JmY.js → matrix-analytical-definition-hEucouWM.js} +4 -4
  26. package/dist/chunks/{matrix-card-CUorIB7Q.js → matrix-card-CCh9JjP1.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-Df5UgCGN.js → matrix-member-presentation-DsAUbuoL.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-BSiGEXVC.js → matrix-operation-contract-DsLdFdSa.js} +339 -330
  29. package/dist/chunks/{metric-comparison-95aC0uEO.js → metric-comparison-Bnso1cm1.js} +2 -2
  30. package/dist/chunks/{model-change-B5wQhg5G.js → model-change-T1cRkh3m.js} +1 -1
  31. package/dist/chunks/{palette-DTnMhipt.js → palette-p1XSJFgB.js} +1 -1
  32. package/dist/chunks/{pivot-result-contract-expectations-Bo-86vwS.js → pivot-result-contract-expectations-B53jqszr.js} +5 -5
  33. package/dist/chunks/{pivot-result-identity-olvXJoB9.js → pivot-result-identity-Dq5jm-EC.js} +1 -1
  34. package/dist/chunks/{zoned-wall-clock-CGLVI40Q.js → raw-temporal-value-Bqz8wc7L.js} +97 -46
  35. package/dist/chunks/{report-preferences-dialog-C2YUIwKG.js → report-preferences-dialog-C4RAR8u5.js} +68 -63
  36. package/dist/chunks/{report-runtime-context-DoIUr3MP.js → report-runtime-context-BITkNSDa.js} +2 -2
  37. package/dist/chunks/{resolve-dashboard-input-context-q_iiNXE1.js → resolve-dashboard-input-context-DaDrZGuA.js} +3455 -1744
  38. package/dist/chunks/{save-DH4RyrnG.js → save-CHV1B1fL.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-8jqfI7hI.js → saved-dashboard-context-DFYBrE6O.js} +94 -95
  40. package/dist/chunks/{selection-filter-compiler-BKXmyLrS.js → selection-filter-compiler-CUDRnUxc.js} +19 -18
  41. package/dist/chunks/{selection-reducer-CV7K4FI6.js → selection-reducer-Bz5aywT4.js} +1 -1
  42. package/dist/chunks/{semaphor-ready-indicator-E2XWyibu.js → semaphor-ready-indicator-Cfuafnem.js} +37067 -38400
  43. package/dist/chunks/{shelf-drop-preview-context-C29EUzDp.js → shelf-drop-preview-context-BR2GEYog.js} +81 -82
  44. package/dist/chunks/{source-entity-resolution-BXI3nQ5Z.js → source-entity-resolution-DdDVXFB8.js} +6 -6
  45. package/dist/chunks/{switch-balDSHc7.js → switch-BW4yXSYs.js} +3 -3
  46. package/dist/chunks/{table-export-sheet-CK8tvh4d.js → table-export-sheet-bSXxGn-v.js} +1 -1
  47. package/dist/chunks/{temporal-input-presentation-B77JsAzU.js → temporal-input-presentation-sk9gqLi6.js} +699 -741
  48. package/dist/chunks/{token-types-DhYH5YKb.js → token-types-BUK06hU2.js} +1 -1
  49. package/dist/chunks/{upload-Ufj8vjyn.js → upload-BnmuyPqW.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-9WsnzEO5.js → use-create-flow-overlay-state-DyzhWvRJ.js} +6 -6
  51. package/dist/chunks/{validators-BtaCFIEB.js → validators-BIM0FE31.js} +764 -885
  52. package/dist/dashboard/index.js +2 -2
  53. package/dist/dashboard-authoring/index.js +2278 -3030
  54. package/dist/data-app-sdk/index.js +43 -43
  55. package/dist/data-app-sdk-adapters/index.js +3 -3
  56. package/dist/data-app-sdk-validation/index.js +22 -22
  57. package/dist/format-utils/index.js +215 -209
  58. package/dist/index.js +225 -224
  59. package/dist/report-runtime-context/index.js +2 -2
  60. package/dist/style.css +1 -1
  61. package/dist/surfboard/index.js +2 -2
  62. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  63. package/dist/types/components/dashboard/dashboard-create-dialog.d.ts +23 -0
  64. package/dist/types/components/index.d.ts +1 -2
  65. package/dist/types/components/surfboard/filter/types.d.ts +3 -1
  66. package/dist/types/index.js +5 -5
  67. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +59 -2
  68. package/dist/types/lib/interactions/get-click-context-from-matrix.d.ts +5 -0
  69. package/dist/types/lib/interactions/get-click-context-from-table.d.ts +45 -0
  70. package/dist/types/lib/print/print-inputs.d.ts +2 -1
  71. package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -0
  72. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +5 -0
  73. package/dist/types/lib/selection/selection-from-click-context.d.ts +41 -0
  74. package/dist/types/lib/types/common-types.d.ts +6 -0
  75. package/dist/types/lib/types/explorer-types.d.ts +7 -1
  76. package/dist/types/lib/types/interaction-types.d.ts +3 -1
  77. package/dist/types/lib/types/token-types.d.ts +0 -1
  78. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +3 -1
  79. package/dist/types/shared/analytics-protocol/contracts.d.ts +9 -40
  80. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +12 -2
  81. package/dist/types/shared/analytics-protocol/validators.d.ts +1 -2
  82. package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
  83. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +7 -1
  84. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +24 -0
  85. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  86. package/dist/types/shared/dashboard-authoring/card-settings/column-polarity-write.d.ts +5 -0
  87. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +4 -2
  88. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +15 -0
  89. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +12 -1
  90. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +5 -3
  91. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +3230 -4658
  92. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +24 -2
  93. package/dist/types/shared/dashboard-authoring/changes/field-ref.d.ts +91 -0
  94. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +7 -0
  95. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +27 -1
  96. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-create.d.ts +26 -0
  97. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +2 -1
  98. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  99. package/dist/types/shared/dashboard-authoring/detail-date-presentation.d.ts +9 -0
  100. package/dist/types/shared/dashboard-authoring/index.d.ts +8 -6
  101. package/dist/types/shared/dashboard-authoring/measure-calculations/apply.d.ts +8 -0
  102. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +16 -0
  103. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +41 -0
  104. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +17 -0
  105. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +63 -0
  106. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +16 -0
  107. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +79 -0
  108. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +934 -0
  109. package/dist/types/shared/dashboard-authoring/measure-calculations/sentences.d.ts +4 -0
  110. package/dist/types/shared/dashboard-authoring/measure-calculations/set.d.ts +11 -0
  111. package/dist/types/shared/dashboard-authoring/measure-calculations/transform.d.ts +63 -0
  112. package/dist/types/shared/dashboard-authoring/measure-calculations/window-transforms.d.ts +60 -0
  113. package/dist/types/shared/dashboard-authoring/new-card.d.ts +12 -1
  114. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +2 -1
  115. package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +46 -0
  116. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +52 -2
  117. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +13 -1
  118. package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +58 -0
  119. package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +55 -0
  120. package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +18 -0
  121. package/dist/types/shared/format-utils/document-print.d.ts +82 -0
  122. package/dist/types/shared/format-utils/index.d.ts +1 -0
  123. package/dist/types/shared/format-utils/raw-temporal.d.ts +2 -7
  124. package/dist/types/shared/temporal/index.d.ts +1 -0
  125. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +19 -0
  126. package/dist/types/shared/temporal/raw-temporal-value.d.ts +29 -0
  127. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +6 -0
  128. package/package.json +1 -1
  129. package/dist/chunks/custom-visual-inputs-DfolidZ9.js +0 -292
  130. package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +0 -1718
  131. package/dist/types/components/dashboard/ai-dashboard-create-dialog.d.ts +0 -38
  132. package/dist/types/components/dashboard/dashboard-create-template.d.ts +0 -10
  133. package/dist/types/lib/hooks/use-dashboard-authoring.d.ts +0 -49
  134. package/dist/types/shared/dashboard-authoring/artifact-compiler.d.ts +0 -6
  135. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -106
  136. package/dist/types/shared/dashboard-authoring/protocol-adapter.d.ts +0 -7
  137. package/dist/types/shared/dashboard-authoring/source-matching.d.ts +0 -34
  138. package/dist/types/shared/dashboard-authoring/validators.d.ts +0 -2
@@ -1,7 +1,7 @@
1
1
  import { z as t } from "zod";
2
- import { x as je, K as Fe, U as Le, V as Ue, Y as qe, Z as De, s as U, I as Z, n as Me, P as Be, Q as ce, g as Ge, r as ze, J as Ve, B as We, C as Ke, b as le, F as Xe } from "./analytics-base-schemas-CB3oFAXk.js";
3
- import { R as w, K as ue, Y as G, a_ as ee, t as A, S as Ze, aU as $, M as $e, s as Ye, H as de, ag as He, r as Qe, aj as Je, m as et } from "./validators-BtaCFIEB.js";
4
- const Y = {
2
+ import { y as Le, L as Ue, V as De, W as qe, Z as Me, _ as Ge, s as U, J as Z, n as Be, Q as ze, U as ce, g as Ve, r as We, K as Ke, C as Xe, D as Ze, m as le, b as ue, G as $e } from "./analytics-base-schemas-BaIQrEzX.js";
3
+ import { W as k, Q as de, a1 as B, aZ as ee, t as A, X as He, aT as $, R as Qe, s as Ye, N as me, G as Je, r as et, H as tt, m as nt } from "./validators-BIM0FE31.js";
4
+ const H = {
5
5
  answerSummary: "string",
6
6
  responseDetail: "responseDetail",
7
7
  mode: "string",
@@ -41,7 +41,7 @@ const Y = {
41
41
  periodRows: "recordArray",
42
42
  sql: "unknown",
43
43
  omitted: "stringArray"
44
- }, me = [
44
+ }, pe = [
45
45
  /** The request can't run as asked (no specific validation code applies). */
46
46
  "invalid_request",
47
47
  /** No authored relationship connects the requested datasets. */
@@ -61,7 +61,7 @@ const Y = {
61
61
  "timeout",
62
62
  "budget_exceeded",
63
63
  "cancelled"
64
- ], tt = {
64
+ ], at = {
65
65
  invalid_request: 400,
66
66
  missing_relationship: 400,
67
67
  ambiguous_relationship: 400,
@@ -74,29 +74,29 @@ const Y = {
74
74
  timeout: 504,
75
75
  budget_exceeded: 413,
76
76
  cancelled: 499
77
- }, nt = /* @__PURE__ */ new Set(["execution_failed", "timeout"]);
78
- function at(e) {
79
- return typeof e == "string" && me.includes(e);
77
+ }, rt = /* @__PURE__ */ new Set(["execution_failed", "timeout"]);
78
+ function st(e) {
79
+ return typeof e == "string" && pe.includes(e);
80
80
  }
81
- function rt(e, n, a = {}) {
81
+ function ot(e, n, a = {}) {
82
82
  return {
83
83
  code: e,
84
84
  message: n,
85
85
  ...a.details ? { details: a.details } : {},
86
86
  ...a.nextStep ? { nextStep: a.nextStep } : {},
87
- retryable: nt.has(e),
88
- status: a.status ?? tt[e]
87
+ retryable: rt.has(e),
88
+ status: a.status ?? at[e]
89
89
  };
90
90
  }
91
- function cn(e) {
91
+ function un(e) {
92
92
  if (!e || typeof e != "object") return;
93
93
  const n = e.refusal ?? e;
94
94
  if (!n || typeof n != "object") return;
95
95
  const { code: a, message: r } = n;
96
- if (!(!at(a) || typeof r != "string"))
96
+ if (!(!st(a) || typeof r != "string"))
97
97
  return n;
98
98
  }
99
- const st = {
99
+ const it = {
100
100
  invalid_request: { message: "This query configuration cannot run.", nextStep: "Check the selected fields, filters and parameters." },
101
101
  missing_relationship: { message: "The selected data is not connected.", nextStep: "Choose related datasets or ask the owner to add a relationship." },
102
102
  ambiguous_relationship: { message: "The selected data has more than one relationship path.", nextStep: "Choose the relationship to use." },
@@ -110,56 +110,56 @@ const st = {
110
110
  budget_exceeded: { message: "The query exceeds this view’s limits.", nextStep: "Request fewer rows, columns or measures." },
111
111
  cancelled: { message: "The query was cancelled.", nextStep: "Reload the view when ready." }
112
112
  };
113
- function ln(e) {
114
- const n = st[e.code], a = rt(e.code, n.message, { nextStep: n.nextStep, status: e.status }), r = e.retryable ?? a.retryable;
113
+ function dn(e) {
114
+ const n = it[e.code], a = ot(e.code, n.message, { nextStep: n.nextStep, status: e.status }), r = e.retryable ?? a.retryable;
115
115
  return {
116
116
  ...a,
117
117
  retryable: r,
118
118
  ...!r && a.retryable ? { nextStep: "Ask the owner to check the query." } : {}
119
119
  };
120
120
  }
121
- const ot = [
122
- ...me,
121
+ const ct = [
122
+ ...pe,
123
123
  "stale_cursor",
124
124
  "source_truncated"
125
- ], un = Object.freeze({
125
+ ], mn = Object.freeze({
126
126
  coordinates: 2e4,
127
127
  responseBytes: 5 * 1024 * 1024
128
- }), O = t.string().uuid(), y = t.string().min(1), it = t.number().int().positive().max(Number.MAX_SAFE_INTEGER);
128
+ }), O = t.string().uuid(), y = t.string().min(1), lt = t.number().int().positive().max(Number.MAX_SAFE_INTEGER);
129
129
  function f(e, n, a) {
130
130
  e.addIssue({ code: "custom", path: n, message: a });
131
131
  }
132
- function v(e, n, a) {
132
+ function T(e, n, a) {
133
133
  new Set(e).size !== e.length && f(n, a, "Duplicate identity.");
134
134
  }
135
- const ct = t.object({
135
+ const ut = t.object({
136
136
  id: y,
137
- axis: ue,
138
- parent: w,
137
+ axis: de,
138
+ parent: k,
139
139
  position: t.union([
140
140
  t.object({ kind: t.literal("first") }).strict(),
141
141
  t.object({ kind: t.enum(["after", "before"]), cursor: y }).strict()
142
142
  ]),
143
- size: it
143
+ size: lt
144
144
  }).strict(), te = t.object({
145
- paths: t.array(w).readonly(),
145
+ paths: t.array(k).readonly(),
146
146
  pageIds: t.array(y).readonly()
147
- }).strict(), lt = t.object({
147
+ }).strict(), dt = t.object({
148
148
  id: y,
149
149
  rows: te,
150
150
  columns: te,
151
151
  measureIds: t.array(O).min(1).readonly()
152
- }).strict(), pe = t.object({
153
- pages: t.array(ct).readonly(),
154
- blocks: t.array(lt).readonly()
152
+ }).strict(), he = t.object({
153
+ pages: t.array(ut).readonly(),
154
+ blocks: t.array(dt).readonly()
155
155
  }).strict().superRefine((e, n) => {
156
- !e.pages.length && !e.blocks.length && f(n, [], "Request at least one page or block."), v(
156
+ !e.pages.length && !e.blocks.length && f(n, [], "Request at least one page or block."), T(
157
157
  [...e.pages, ...e.blocks].map((a) => a.id),
158
158
  n,
159
159
  []
160
160
  );
161
161
  for (const a of e.blocks) {
162
- v(a.measureIds, n, ["blocks", a.id, "measureIds"]);
162
+ T(a.measureIds, n, ["blocks", a.id, "measureIds"]);
163
163
  for (const r of ["rows", "columns"])
164
164
  for (const s of a[r].pageIds)
165
165
  e.pages.some(
@@ -170,7 +170,7 @@ const ct = t.object({
170
170
  "Page reference must name a page on this axis in this operation."
171
171
  );
172
172
  }
173
- }), dn = t.object({ spec: G, request: pe }).strict().superRefine(({ spec: e, request: n }, a) => {
173
+ }), pn = t.object({ spec: B, request: he }).strict().superRefine(({ spec: e, request: n }, a) => {
174
174
  for (const r of n.pages)
175
175
  ee(
176
176
  e,
@@ -190,11 +190,11 @@ const ct = t.object({
190
190
  for (const c of r[s].paths)
191
191
  ee(e, s, c, a, ["blocks", r.id, s]);
192
192
  }
193
- }), ut = t.object({
193
+ }), mt = t.object({
194
194
  requestId: y,
195
- axis: ue,
196
- parent: w,
197
- members: t.array(t.object({ path: w }).strict()).readonly(),
195
+ axis: de,
196
+ parent: k,
197
+ members: t.array(t.object({ path: k }).strict()).readonly(),
198
198
  before: y.nullable(),
199
199
  after: y.nullable(),
200
200
  exactCount: t.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional()
@@ -213,31 +213,31 @@ const ct = t.object({
213
213
  return (s = r.path[r.path.length - 1]) == null ? void 0 : s.levelId;
214
214
  }
215
215
  )
216
- ).size > 1 && f(n, ["members"], "One page must contain one child level."), v(
216
+ ).size > 1 && f(n, ["members"], "One page must contain one child level."), T(
217
217
  e.members.map((r) => A(r.path)),
218
218
  n,
219
219
  ["members"]
220
220
  );
221
221
  for (const r of e.members)
222
222
  (r.path.length !== e.parent.length + 1 || A(r.path.slice(0, -1)) !== A(e.parent)) && f(n, ["members"], "Page members must be immediate children.");
223
- }), he = t.object({
224
- rowPaths: t.array(w).readonly(),
225
- columnPaths: t.array(w).readonly(),
223
+ }), fe = t.object({
224
+ rowPaths: t.array(k).readonly(),
225
+ columnPaths: t.array(k).readonly(),
226
226
  measureIds: t.array(O).readonly()
227
227
  }).strict();
228
- function fe(e, n) {
228
+ function ge(e, n) {
229
229
  const a = e.rowPaths.map(A), r = e.columnPaths.map(A);
230
- return v(a, n, ["coverage", "rowPaths"]), v(r, n, ["coverage", "columnPaths"]), v(e.measureIds, n, ["coverage", "measureIds"]), { rows: a, columns: r };
230
+ return T(a, n, ["coverage", "rowPaths"]), T(r, n, ["coverage", "columnPaths"]), T(e.measureIds, n, ["coverage", "measureIds"]), { rows: a, columns: r };
231
231
  }
232
- const dt = t.object({
232
+ const pt = t.object({
233
233
  requestId: y,
234
- coverage: he,
234
+ coverage: fe,
235
235
  cells: t.array(
236
- Ze.extend({ value: $ }).strict()
236
+ He.extend({ value: $ }).strict()
237
237
  ).readonly()
238
238
  }).strict().superRefine((e, n) => {
239
- const { rows: a, columns: r } = fe(e.coverage, n), s = new Set(a), c = new Set(r), i = new Set(e.coverage.measureIds);
240
- v(
239
+ const { rows: a, columns: r } = ge(e.coverage, n), s = new Set(a), c = new Set(r), i = new Set(e.coverage.measureIds);
240
+ T(
241
241
  e.cells.map(
242
242
  (l) => JSON.stringify([
243
243
  A(l.rowPath),
@@ -250,14 +250,14 @@ const dt = t.object({
250
250
  );
251
251
  for (const l of e.cells)
252
252
  (!s.has(A(l.rowPath)) || !c.has(A(l.columnPath)) || !i.has(l.measureId)) && f(n, ["cells"], "Cell is outside certified coverage.");
253
- }), q = t.number().int().nonnegative(), mt = t.object({
253
+ }), D = t.number().int().nonnegative(), ht = t.object({
254
254
  requestId: y,
255
- coverage: he,
255
+ coverage: fe,
256
256
  values: t.array(
257
- t.tuple([q, q, q, $]).readonly()
257
+ t.tuple([D, D, D, $]).readonly()
258
258
  ).readonly()
259
259
  }).strict().superRefine((e, n) => {
260
- fe(e.coverage, n);
260
+ ge(e.coverage, n);
261
261
  const { rowPaths: a, columnPaths: r, measureIds: s } = e.coverage, c = /* @__PURE__ */ new Set();
262
262
  for (const [i, l, m] of e.values) {
263
263
  if (i >= a.length || l >= r.length || m >= s.length) {
@@ -269,14 +269,14 @@ const dt = t.object({
269
269
  }
270
270
  }), ne = t.object({
271
271
  id: O,
272
- column: Fe,
272
+ column: Ue,
273
273
  nativeDataType: y,
274
- semanticFormat: je.optional()
275
- }).strict(), ge = t.object({
274
+ semanticFormat: Le.optional()
275
+ }).strict(), ye = t.object({
276
276
  levels: t.array(ne).readonly(),
277
277
  measures: t.array(ne).readonly()
278
- }).strict(), H = t.object({
279
- code: t.enum(ot),
278
+ }).strict(), Q = t.object({
279
+ code: t.enum(ct),
280
280
  message: y,
281
281
  /** Technical cause for dashboard owners; never shown as the primary copy. */
282
282
  detail: y.optional(),
@@ -288,18 +288,18 @@ const dt = t.object({
288
288
  t.object({ kind: t.literal("operation") }).strict(),
289
289
  t.object({ kind: t.enum(["page", "block"]), requestId: y }).strict()
290
290
  ])
291
- }).strict(), pt = t.object({
291
+ }).strict(), ft = t.object({
292
292
  dialect: t.enum(["postgres", "clickhouse", "duckdb", "snowflake"]),
293
- aggregates: t.array($e).readonly()
293
+ aggregates: t.array(Qe).readonly()
294
294
  }).strict();
295
- function ye(e) {
295
+ function Se(e) {
296
296
  return t.object({
297
297
  queryIdentity: y,
298
- descriptors: ge,
299
- capabilities: pt,
300
- pages: t.array(ut).readonly(),
298
+ descriptors: ye,
299
+ capabilities: ft,
300
+ pages: t.array(mt).readonly(),
301
301
  blocks: t.array(e).readonly(),
302
- failures: t.array(H).readonly()
302
+ failures: t.array(Q).readonly()
303
303
  }).strict().superRefine((n, a) => {
304
304
  const r = new Set(
305
305
  n.descriptors.levels.map((i) => i.id)
@@ -319,17 +319,17 @@ function ye(e) {
319
319
  a,
320
320
  ["descriptors"],
321
321
  "Acquired paths require level descriptors."
322
- ), v(
322
+ ), T(
323
323
  [...n.descriptors.levels, ...n.descriptors.measures].map(
324
324
  (i) => i.id
325
325
  ),
326
326
  a,
327
327
  ["descriptors"]
328
- ), v(
328
+ ), T(
329
329
  [...n.pages, ...n.blocks].map((i) => i.requestId),
330
330
  a,
331
331
  []
332
- ), v(
332
+ ), T(
333
333
  n.failures.map(
334
334
  (i) => i.scope.kind === "operation" ? "operation" : i.scope.requestId
335
335
  ),
@@ -355,18 +355,18 @@ function ye(e) {
355
355
  }
356
356
  });
357
357
  }
358
- const Se = ye(
359
- dt
360
- ), ht = ye(
361
- mt
358
+ const be = Se(
359
+ pt
360
+ ), gt = Se(
361
+ ht
362
362
  );
363
- function be(e) {
363
+ function Ae(e) {
364
364
  return t.union([
365
365
  t.object({
366
366
  status: t.enum(["success", "partial"]),
367
367
  window: e
368
368
  }).strict(),
369
- t.object({ status: t.literal("failed"), failure: H }).strict()
369
+ t.object({ status: t.literal("failed"), failure: Q }).strict()
370
370
  ]).superRefine((n, a) => {
371
371
  const r = n;
372
372
  if (r.status === "failed") return;
@@ -378,12 +378,12 @@ function be(e) {
378
378
  ), r.status === "success" != (s.failures.length === 0) && f(a, ["status"], "Status must match failure coverage.");
379
379
  });
380
380
  }
381
- const mn = be(
382
- Se
383
- ), pn = be(
384
- ht
381
+ const hn = Ae(
382
+ be
383
+ ), fn = Ae(
384
+ gt
385
385
  );
386
- function ft(e) {
386
+ function yt(e) {
387
387
  const { rowPaths: n, columnPaths: a, measureIds: r } = e.coverage, s = (m) => new Map(m.map((o, d) => [o, d])), c = s(n.map(A)), i = s(a.map(A)), l = s(r);
388
388
  return {
389
389
  requestId: e.requestId,
@@ -396,7 +396,7 @@ function ft(e) {
396
396
  })
397
397
  };
398
398
  }
399
- function gt(e) {
399
+ function St(e) {
400
400
  const { rowPaths: n, columnPaths: a, measureIds: r } = e.coverage;
401
401
  return {
402
402
  requestId: e.requestId,
@@ -409,31 +409,31 @@ function gt(e) {
409
409
  }))
410
410
  };
411
411
  }
412
- function yt(e) {
413
- return { ...e, blocks: e.blocks.map(ft) };
412
+ function bt(e) {
413
+ return { ...e, blocks: e.blocks.map(yt) };
414
414
  }
415
- function hn(e) {
416
- return { ...e, blocks: e.blocks.map(gt) };
415
+ function gn(e) {
416
+ return { ...e, blocks: e.blocks.map(St) };
417
417
  }
418
- function fn(e) {
419
- return e.status === "failed" ? e : { status: e.status, window: yt(e.window) };
418
+ function yn(e) {
419
+ return e.status === "failed" ? e : { status: e.status, window: bt(e.window) };
420
420
  }
421
- const Ae = t.object({
421
+ const Ie = t.object({
422
422
  kind: t.literal("matrix"),
423
- window: Se
424
- }).strict(), Ie = t.enum(["member", "subtotal", "grand_total"]), St = t.discriminatedUnion("kind", [
423
+ window: be
424
+ }).strict(), _e = t.enum(["member", "subtotal", "grand_total"]), At = t.discriminatedUnion("kind", [
425
425
  t.object({ kind: t.literal("hierarchy"), label: t.string() }).strict(),
426
426
  t.object({ kind: t.literal("level"), levelId: O, label: t.string() }).strict(),
427
427
  t.object({
428
428
  kind: t.literal("measure"),
429
429
  measureId: O,
430
- columnPath: w,
431
- role: Ie,
430
+ columnPath: k,
431
+ role: _e,
432
432
  label: t.string()
433
433
  }).strict()
434
- ]), bt = t.object({
435
- columns: t.array(St).readonly(),
436
- descriptors: ge
434
+ ]), It = t.object({
435
+ columns: t.array(At).readonly(),
436
+ descriptors: ye
437
437
  }).strict(), ae = t.union([
438
438
  t.object({
439
439
  kind: t.literal("value"),
@@ -442,37 +442,37 @@ const Ae = t.object({
442
442
  )
443
443
  }).strict(),
444
444
  t.object({ kind: t.enum(["null", "empty"]) }).strict()
445
- ]), At = t.discriminatedUnion("kind", [
445
+ ]), _t = t.discriminatedUnion("kind", [
446
446
  t.object({
447
447
  kind: t.literal("layout"),
448
- rowPath: w,
449
- role: Ie,
448
+ rowPath: k,
449
+ role: _e,
450
450
  values: t.array(ae).readonly()
451
451
  }).strict(),
452
452
  t.object({
453
453
  kind: t.literal("flat"),
454
- rowPath: w,
455
- columnPath: w,
454
+ rowPath: k,
455
+ columnPath: k,
456
456
  values: t.array(ae).readonly()
457
457
  }).strict()
458
- ]), gn = t.discriminatedUnion("kind", [
458
+ ]), Sn = t.discriminatedUnion("kind", [
459
459
  t.object({
460
460
  kind: t.literal("layout"),
461
- layout: bt,
461
+ layout: It,
462
462
  next: y
463
463
  }).strict(),
464
464
  t.object({
465
465
  kind: t.literal("rows"),
466
- rows: t.array(At).readonly(),
466
+ rows: t.array(_t).readonly(),
467
467
  next: y.nullable()
468
468
  }).strict()
469
- ]), It = t.union([
470
- Le,
471
- Ue,
472
- qe,
469
+ ]), wt = t.union([
473
470
  De,
474
- Ae
475
- ]), _t = t.object({
471
+ qe,
472
+ Me,
473
+ Ge,
474
+ Ie
475
+ ]), kt = t.object({
476
476
  status: t.enum([
477
477
  "not_required",
478
478
  "resolved",
@@ -506,7 +506,7 @@ const Ae = t.object({
506
506
  "presentation_incomplete",
507
507
  "query_validation_failed",
508
508
  "unsafe_join"
509
- ]), _e = t.object({
509
+ ]), we = t.object({
510
510
  version: t.literal(1),
511
511
  status: t.enum(["answered", "partial", "blocked"]),
512
512
  summary: t.string(),
@@ -543,11 +543,11 @@ const Ae = t.object({
543
543
  ).optional()
544
544
  }).passthrough(), ke = t.object({
545
545
  scope: t.literal("filtered_query"),
546
- measures: t.record(Me)
547
- }).passthrough(), we = t.object({
546
+ measures: t.record(Be)
547
+ }).passthrough(), Te = t.object({
548
548
  answeredObligations: t.array(t.string()),
549
549
  missingObligations: t.array(t.string()),
550
- warnings: t.array(Be).optional()
550
+ warnings: t.array(ze).optional()
551
551
  }).passthrough(), ve = t.object({
552
552
  intentId: t.string().optional(),
553
553
  queryId: t.string().optional(),
@@ -564,38 +564,38 @@ const Ae = t.object({
564
564
  intent: t.unknown().optional(),
565
565
  compiledQuery: t.unknown().optional(),
566
566
  fieldsUsed: t.array(Z).optional(),
567
- result: It.optional(),
567
+ result: wt.optional(),
568
568
  validation: ce,
569
- coverage: we.optional(),
569
+ coverage: Te.optional(),
570
570
  missingFields: t.array(t.string()).optional(),
571
571
  warnings: t.array(t.string()).optional(),
572
- relationshipDiagnostics: _t.optional(),
573
- diagnosticFeedback: _e.optional(),
572
+ relationshipDiagnostics: kt.optional(),
573
+ diagnosticFeedback: we.optional(),
574
574
  population: ke.optional(),
575
575
  metadata: t.record(t.string(), t.unknown()).optional()
576
- }).passthrough(), kt = ve;
577
- function wt(e) {
576
+ }).passthrough(), Tt = ve;
577
+ function vt(e) {
578
578
  switch (e) {
579
579
  case "boolean":
580
580
  return t.boolean().optional();
581
581
  case "compactExecutionFieldArray":
582
- return t.array(Ve).optional();
582
+ return t.array(Ke).optional();
583
583
  case "coverage":
584
- return we.optional();
584
+ return Te.optional();
585
585
  case "diagnosticFeedback":
586
- return _e.optional();
586
+ return we.optional();
587
587
  case "executionFieldArray":
588
588
  return t.array(Z).optional();
589
589
  case "executionResult":
590
- return kt.optional();
590
+ return Tt.optional();
591
591
  case "number":
592
592
  return t.number().finite().optional();
593
593
  case "population":
594
594
  return ke.optional();
595
595
  case "record":
596
- return ze.optional();
596
+ return We.optional();
597
597
  case "recordArray":
598
- return Ge.optional();
598
+ return Ve.optional();
599
599
  case "responseDetail":
600
600
  return t.enum(["compact", "standard", "debug"]).optional();
601
601
  case "string":
@@ -610,51 +610,51 @@ function wt(e) {
610
610
  return ce.optional();
611
611
  }
612
612
  }
613
- const vt = Object.fromEntries(
614
- Object.entries(Y).map(
615
- ([e, n]) => [e, wt(n)]
613
+ const Et = Object.fromEntries(
614
+ Object.entries(H).map(
615
+ ([e, n]) => [e, vt(n)]
616
616
  )
617
- ), Tt = t.object(vt).strict(), Et = new Set(
618
- Object.keys(Y)
617
+ ), Rt = t.object(Et).strict(), Ct = new Set(
618
+ Object.keys(H)
619
619
  );
620
- function yn() {
620
+ function bn() {
621
621
  return Object.keys(
622
- Y
622
+ H
623
623
  );
624
624
  }
625
- function Rt(e) {
626
- return Et.has(e);
625
+ function Nt(e) {
626
+ return Ct.has(e);
627
627
  }
628
- function Sn(e) {
628
+ function An(e) {
629
629
  if (!e || typeof e != "object" || Array.isArray(e))
630
630
  throw new Error("Semaphor analyze result must be an object.");
631
631
  const a = Object.keys(e).filter(
632
- (r) => !Rt(r)
632
+ (r) => !Nt(r)
633
633
  );
634
634
  if (a.length)
635
635
  throw new Error(
636
636
  `Semaphor analyze result contains unsupported top-level field(s): ${a.join(", ")}.`
637
637
  );
638
- return Tt.parse(e);
638
+ return Rt.parse(e);
639
639
  }
640
- const Te = 100, F = "selection:";
641
- function Ee(e) {
640
+ const Ee = 100, F = "selection:";
641
+ function Re(e) {
642
642
  return [
643
- de(e.source),
644
- He(e.name),
643
+ me(e.source),
644
+ Je(e.name),
645
645
  e.sourceField ?? ""
646
646
  ].join("::");
647
647
  }
648
- function bn(e) {
648
+ function In(e) {
649
649
  return `${F}${e}`;
650
650
  }
651
- function Ct(e) {
651
+ function Ot(e) {
652
652
  return e.startsWith(F) && e.length > F.length;
653
653
  }
654
- function An(e) {
655
- return Ct(e) ? e.slice(F.length) : void 0;
654
+ function _n(e) {
655
+ return Ot(e) ? e.slice(F.length) : void 0;
656
656
  }
657
- function Re(e) {
657
+ function Ce(e) {
658
658
  if (!e) return "";
659
659
  const n = e.calendar.fiscalCalendar;
660
660
  return JSON.stringify([
@@ -664,24 +664,29 @@ function Re(e) {
664
664
  n ? [n.kind, n.yearStartMonth] : null
665
665
  ]);
666
666
  }
667
- function Nt(e) {
667
+ function Ne(e) {
668
+ return e ? JSON.stringify([e.valueKind, e.tz]) : "";
669
+ }
670
+ function xt(e) {
668
671
  return JSON.stringify([
669
- Ee(e.field),
672
+ Re(e.field),
670
673
  e.operator,
671
674
  e.operator === "isNull" ? null : e.value,
672
- Re(e.temporalBucket)
675
+ Ce(e.temporalBucket),
676
+ Ne(e.rawTemporal)
673
677
  ]);
674
678
  }
675
679
  function se(e) {
676
- return JSON.stringify(e.conditions.map(Nt).sort());
680
+ return JSON.stringify(e.conditions.map(xt).sort());
677
681
  }
678
682
  function z(e) {
679
683
  return JSON.stringify([
680
- de(e.field.source),
684
+ me(e.field.source),
681
685
  e.field.name,
682
686
  e.operator,
683
687
  e.operator === "isNull" ? null : e.value,
684
- Re(e.temporalBucket)
688
+ Ce(e.temporalBucket),
689
+ Ne(e.rawTemporal)
685
690
  ]);
686
691
  }
687
692
  function oe(e) {
@@ -689,7 +694,7 @@ function oe(e) {
689
694
  e.conditions.map(z).sort()
690
695
  );
691
696
  }
692
- function In(e) {
697
+ function wn(e) {
693
698
  const n = e.map((a) => a.id);
694
699
  if (new Set(n).size !== n.length)
695
700
  throw new Error("Data App selections require one active selection per id.");
@@ -698,75 +703,78 @@ function In(e) {
698
703
  tuples: a.tuples.map((r) => ({
699
704
  ...r,
700
705
  conditions: [...r.conditions].sort(
701
- (s, c) => D(
706
+ (s, c) => q(
702
707
  z(s),
703
708
  z(c)
704
709
  )
705
710
  )
706
711
  })).sort(
707
- (r, s) => D(
712
+ (r, s) => q(
708
713
  oe(r),
709
714
  oe(s)
710
715
  )
711
716
  )
712
- })).sort((a, r) => D(a.id, r.id));
717
+ })).sort((a, r) => q(a.id, r.id));
713
718
  }
714
- function D(e, n) {
719
+ function q(e, n) {
715
720
  return e < n ? -1 : e > n ? 1 : 0;
716
721
  }
717
- function _n(e, n) {
722
+ function kn(e, n) {
718
723
  return se(e) === se(n);
719
724
  }
720
- const Ot = "(Blank)";
721
- function kn(e) {
722
- return e.conditions.map((n) => n.label ? n.label : n.operator === "isNull" || n.value === null ? Ot : String(n.value)).join(" · ");
725
+ const Pt = "(Blank)";
726
+ function Tn(e) {
727
+ return e.conditions.map((n) => n.label ? n.label : n.operator === "isNull" || n.value === null ? Pt : String(n.value)).join(" · ");
723
728
  }
724
- const xt = t.union([
725
- We,
726
- Ke
727
- ]), Pt = t.object({
729
+ const jt = t.union([
730
+ Xe,
731
+ Ze
732
+ ]), Ft = t.object({
728
733
  name: t.string().min(1),
729
- source: xt,
734
+ source: jt,
730
735
  dataType: t.enum(["string", "number", "boolean", "date", "datetime"]),
731
- sourceField: t.string().min(1).optional()
732
- }).strict(), jt = t.object({
733
- field: Pt,
736
+ sourceField: t.string().min(1).optional(),
737
+ nativeDataType: t.string().min(1).optional()
738
+ }).strict(), Lt = t.object({
739
+ field: Ft,
734
740
  operator: t.enum(["=", "isNull"]),
735
741
  value: t.union([t.string(), t.number().finite(), t.null()]),
736
742
  label: t.string().optional(),
737
- temporalBucket: le.optional()
743
+ temporalBucket: ue.optional(),
744
+ rawTemporal: le.optional()
738
745
  }).strict().superRefine((e, n) => {
739
746
  e.operator === "isNull" != (e.value === null) && n.addIssue({
740
747
  code: t.ZodIssueCode.custom,
741
748
  message: "isNull carries a null value, and only isNull does.",
742
749
  path: ["value"]
743
750
  });
744
- }), Ft = t.object({
745
- conditions: t.array(jt).min(1)
751
+ }), Ut = t.object({
752
+ conditions: t.array(Lt).min(1)
746
753
  }).strict().superRefine((e, n) => {
747
- const a = e.conditions.map((r) => Ee(r.field));
754
+ const a = e.conditions.map((r) => Re(r.field));
748
755
  new Set(a).size !== a.length && n.addIssue({
749
756
  code: t.ZodIssueCode.custom,
750
757
  message: "A tuple holds one condition per field.",
751
758
  path: ["conditions"]
752
759
  });
753
- }), wn = t.object({
760
+ }), vn = t.object({
754
761
  kind: t.literal("selection"),
755
762
  sourceCardId: t.string().min(1),
756
- tuples: t.array(Ft).min(1).max(Te)
757
- }).strict(), Lt = t.object({
758
- field: Xe,
763
+ tuples: t.array(Ut).min(1).max(Ee)
764
+ }).strict(), Dt = t.object({
765
+ field: $e,
759
766
  operator: t.enum(["=", "isNull"]),
760
767
  value: t.union([t.string(), t.number().finite(), t.null()]),
761
- temporalBucket: le.optional()
768
+ temporalBucket: ue.optional(),
769
+ rawTemporal: le.optional()
762
770
  }).strict().superRefine((e, n) => {
763
771
  e.operator === "isNull" != (e.value === null) && n.addIssue({
764
772
  code: t.ZodIssueCode.custom,
765
773
  message: "isNull carries a null value, and only isNull does.",
766
774
  path: ["value"]
767
775
  });
768
- }), Ut = t.object({
769
- conditions: t.array(Lt).min(1)
776
+ }), qt = t.object({
777
+ conditions: t.array(Dt).min(1)
770
778
  }).strict().superRefine((e, n) => {
771
779
  for (let a = 0; a < e.conditions.length; a += 1) {
772
780
  const r = e.conditions[a];
@@ -778,24 +786,24 @@ const xt = t.union([
778
786
  path: ["conditions", a, "field"]
779
787
  });
780
788
  }
781
- }), vn = t.object({
789
+ }), En = t.object({
782
790
  id: t.string().min(1),
783
- tuples: t.array(Ut).min(1).max(Te)
784
- }).strict(), qt = t.object({ key: t.string().min(1), nativeText: t.string().nullable() }).strict(), Dt = t.object({
785
- executionInstant: t.string().refine((e) => Qe(e) !== null, {
791
+ tuples: t.array(qt).min(1).max(Ee)
792
+ }).strict(), Mt = t.object({ key: t.string().min(1), nativeText: t.string().nullable() }).strict(), Gt = t.object({
793
+ executionInstant: t.string().refine((e) => et(e) !== null, {
786
794
  message: "executionInstant must be an ISO instant"
787
795
  }),
788
- dataAnchors: t.array(qt).default([])
796
+ dataAnchors: t.array(Mt).default([])
789
797
  }).strict().refine(
790
798
  (e) => new Set(e.dataAnchors.map((n) => n.key)).size === e.dataAnchors.length,
791
799
  { message: "dataAnchors keys must be unique", path: ["dataAnchors"] }
792
800
  );
793
- function Tn(e) {
801
+ function Rn(e) {
794
802
  if (e == null) return;
795
- const n = Dt.safeParse(e);
803
+ const n = Gt.safeParse(e);
796
804
  return n.success ? n.data : void 0;
797
805
  }
798
- const Ce = {
806
+ const Oe = {
799
807
  COUNT: "count",
800
808
  COUNTIF: "count",
801
809
  COUNT_IF: "count",
@@ -859,16 +867,16 @@ const Ce = {
859
867
  COLLECT_SET: "other",
860
868
  FIRST: "other",
861
869
  LAST: "other"
862
- }, Mt = /(?:_AGG$|^APPROX_[A-Z0-9_]+$|^COUNT_DISTINCT$|^HLL_(?:COUNT|ESTIMATE)$|^REGR_[A-Z_]+$)/;
863
- function Bt(e) {
870
+ }, Bt = /(?:_AGG$|^APPROX_[A-Z0-9_]+$|^COUNT_DISTINCT$|^HLL_(?:COUNT|ESTIMATE)$|^REGR_[A-Z_]+$)/;
871
+ function zt(e) {
864
872
  const n = e.toUpperCase();
865
- return n in Ce || Mt.test(n);
873
+ return n in Oe || Bt.test(n);
866
874
  }
867
- function Ne(e, n = !1) {
868
- const a = Ce[e.toUpperCase()] ?? "other";
875
+ function xe(e, n = !1) {
876
+ const a = Oe[e.toUpperCase()] ?? "other";
869
877
  return n ? a === "count" || a === "count_distinct" ? "count_distinct" : a === "min" || a === "max" ? a : "repeat_safe_other" : a;
870
878
  }
871
- const Gt = /* @__PURE__ */ new Set([
879
+ const Vt = /* @__PURE__ */ new Set([
872
880
  "NULLIF",
873
881
  "COALESCE",
874
882
  "IFNULL",
@@ -883,7 +891,7 @@ const Gt = /* @__PURE__ */ new Set([
883
891
  "CAST",
884
892
  "TRY_CAST",
885
893
  "SAFE_CAST"
886
- ]), zt = /* @__PURE__ */ new Set(["DECIMAL", "NUMERIC", "INTEGER", "INT", "BIGINT", "FLOAT", "DOUBLE", "REAL", "VARCHAR", "TEXT"]), ie = /[A-Za-z_]/, Vt = /[A-Za-z0-9_]/;
894
+ ]), Wt = /* @__PURE__ */ new Set(["DECIMAL", "NUMERIC", "INTEGER", "INT", "BIGINT", "FLOAT", "DOUBLE", "REAL", "VARCHAR", "TEXT"]), ie = /[A-Za-z_]/, Kt = /[A-Za-z0-9_]/;
887
895
  function V(e, n) {
888
896
  const a = e[n];
889
897
  let r = n + 1;
@@ -920,12 +928,12 @@ function j(e, n) {
920
928
  }
921
929
  function M(e, n) {
922
930
  let a = n + 1;
923
- for (; a < e.length && Vt.test(e[a]); ) a += 1;
931
+ for (; a < e.length && Kt.test(e[a]); ) a += 1;
924
932
  return a;
925
933
  }
926
- const Wt = /\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
927
- function Kt(e) {
928
- return Array.from(e.matchAll(Wt), (n) => n[1]);
934
+ const Xt = /\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
935
+ function Zt(e) {
936
+ return Array.from(e.matchAll(Xt), (n) => n[1]);
929
937
  }
930
938
  function W(e, n = /* @__PURE__ */ new Set()) {
931
939
  const a = [], r = [];
@@ -947,25 +955,25 @@ function W(e, n = /* @__PURE__ */ new Set()) {
947
955
  }
948
956
  if (ie.test(m)) {
949
957
  const o = M(e, l), d = e.slice(l, o), p = j(e, o);
950
- if (e[p] === "(" && Bt(d)) {
958
+ if (e[p] === "(" && zt(d)) {
951
959
  let g = P(e, p);
952
960
  const I = g - 1;
953
961
  let R = g;
954
- const T = e.slice(p + 1, g - 1);
955
- let x = T.trim() ? 1 : 0;
962
+ const v = e.slice(p + 1, g - 1);
963
+ let x = v.trim() ? 1 : 0;
956
964
  for (let h = p + 1; h < R - 1; h++)
957
965
  e[h] === "'" || e[h] === '"' ? h = V(e, h) - 1 : e[h] === "(" ? h = P(e, h) - 1 : e[h] === "," && x++;
958
- const C = /^\s*DISTINCT\b/i.test(T);
959
- W(C ? T.replace(/^\s*DISTINCT\b/i, "") : T).calls.length > 0 && (s = !0);
966
+ const C = /^\s*DISTINCT\b/i.test(v);
967
+ W(C ? v.replace(/^\s*DISTINCT\b/i, "") : v).calls.length > 0 && (s = !0);
960
968
  let b = !1, _ = !1;
961
969
  for (; ; ) {
962
970
  const h = j(e, g);
963
971
  if (!ie.test(e[h] || "")) break;
964
972
  const N = M(e, h), E = e.slice(h, N).toUpperCase(), u = j(e, N);
965
973
  if (E === "WITHIN") {
966
- const S = M(e, u), k = j(e, S);
967
- if (e.slice(u, S).toUpperCase() === "GROUP" && e[k] === "(") {
968
- g = P(e, k), R = g;
974
+ const S = M(e, u), w = j(e, S);
975
+ if (e.slice(u, S).toUpperCase() === "GROUP" && e[w] === "(") {
976
+ g = P(e, w), R = g;
969
977
  continue;
970
978
  }
971
979
  }
@@ -977,10 +985,10 @@ function W(e, n = /* @__PURE__ */ new Set()) {
977
985
  }
978
986
  a.push({
979
987
  name: d.toUpperCase(),
980
- kind: Ne(d, C),
988
+ kind: xe(d, C),
981
989
  distinct: C,
982
990
  windowed: b,
983
- tokens: Kt(e.slice(p, g)),
991
+ tokens: Zt(e.slice(p, g)),
984
992
  span: { start: l, end: R, argumentStart: p + 1, argumentEnd: I },
985
993
  argumentCount: x,
986
994
  filtered: _
@@ -997,11 +1005,11 @@ function W(e, n = /* @__PURE__ */ new Set()) {
997
1005
  nestedAggregate: s,
998
1006
  windowed: a.some((m) => m.windowed),
999
1007
  tokensOutsideAggregates: r,
1000
- aggregateInputsComplete: i && Xt(c, n),
1008
+ aggregateInputsComplete: i && $t(c, n),
1001
1009
  skeleton: c
1002
1010
  };
1003
1011
  }
1004
- function Xt(e, n) {
1012
+ function $t(e, n) {
1005
1013
  var m;
1006
1014
  const a = [];
1007
1015
  let r = 0;
@@ -1036,9 +1044,9 @@ function Xt(e, n) {
1036
1044
  }
1037
1045
  if (o.startsWith("@") || o === "'S'" || ["NULL", "TRUE", "FALSE"].includes(o) || /^[0-9.]/.test(o))
1038
1046
  return s++, !0;
1039
- if (!Gt.has(o) || (s++, !c("(") || !i())) return !1;
1047
+ if (!Vt.has(o) || (s++, !c("(") || !i())) return !1;
1040
1048
  if (["CAST", "TRY_CAST", "SAFE_CAST"].includes(o)) {
1041
- if (!c("AS") || !zt.has(a[s++]) || (c("PRECISION"), c("(") && (!/^\d+$/.test(a[s++] || "") || c(",") && !/^\d+$/.test(a[s++] || "") || !c(")"))))
1049
+ if (!c("AS") || !Wt.has(a[s++]) || (c("PRECISION"), c("(") && (!/^\d+$/.test(a[s++] || "") || c(",") && !/^\d+$/.test(a[s++] || "") || !c(")"))))
1042
1050
  return !1;
1043
1051
  } else
1044
1052
  for (; c(","); ) if (!i()) return !1;
@@ -1046,7 +1054,7 @@ function Xt(e, n) {
1046
1054
  };
1047
1055
  return i() && s === a.length;
1048
1056
  }
1049
- function Zt(e) {
1057
+ function Ht(e) {
1050
1058
  const n = [];
1051
1059
  let a = 0;
1052
1060
  for (; a < e.length; ) {
@@ -1090,8 +1098,8 @@ function Zt(e) {
1090
1098
  }
1091
1099
  return n;
1092
1100
  }
1093
- function $t(e) {
1094
- const n = Zt(e), a = n.some((o) => o.type === "op" && o.value === "/");
1101
+ function Qt(e) {
1102
+ const n = Ht(e), a = n.some((o) => o.type === "op" && o.value === "/");
1095
1103
  if (n.some((o) => o.type === "other"))
1096
1104
  return { kind: "other", hasDivision: a };
1097
1105
  let r = 0, s = !0;
@@ -1139,7 +1147,7 @@ function $t(e) {
1139
1147
  }, m = c();
1140
1148
  return !m || r !== n.length ? { kind: "other", hasDivision: a } : m.units.length === 1 && m.degree === 1 && s && !a && n.filter((d) => d.type !== "open" && d.type !== "close").length === 1 ? { kind: "single", unit: m.units[0] } : s && m.degree === 1 ? { kind: "linear", units: m.units } : { kind: "other", hasDivision: a };
1141
1149
  }
1142
- const Oe = /* @__PURE__ */ new Set([
1150
+ const Pe = /* @__PURE__ */ new Set([
1143
1151
  "min",
1144
1152
  "max",
1145
1153
  "count_distinct",
@@ -1147,9 +1155,9 @@ const Oe = /* @__PURE__ */ new Set([
1147
1155
  ]);
1148
1156
  function K(e) {
1149
1157
  if (!(!e || !e.trim()))
1150
- return Ne(e);
1158
+ return xe(e);
1151
1159
  }
1152
- function xe(e) {
1160
+ function je(e) {
1153
1161
  switch (e) {
1154
1162
  case "count":
1155
1163
  case "sum":
@@ -1171,7 +1179,7 @@ function Yt(e) {
1171
1179
  var n, a;
1172
1180
  return ((n = e.derivedField) == null ? void 0 : n.computeStage) || ((a = e.calculatedFormula) == null ? void 0 : a.computeStage);
1173
1181
  }
1174
- const Q = {
1182
+ const Y = {
1175
1183
  stage: "aggregate",
1176
1184
  calls: [],
1177
1185
  windowed: !1,
@@ -1180,27 +1188,27 @@ const Q = {
1180
1188
  outputType: "numeric",
1181
1189
  identity: "unresolved",
1182
1190
  unresolved: !0
1183
- }, Pe = { ...Q, stage: "row" };
1191
+ }, Fe = { ...Y, stage: "row" };
1184
1192
  function X(e) {
1185
1193
  return {
1186
1194
  stage: "row",
1187
1195
  outer: e,
1188
1196
  calls: [{ kind: e, distinct: e === "count_distinct" }],
1189
1197
  windowed: !1,
1190
- repeatSafe: Oe.has(e),
1191
- reaggregation: xe(e),
1198
+ repeatSafe: Pe.has(e),
1199
+ reaggregation: je(e),
1192
1200
  outputType: e === "min" || e === "max" ? "input" : "numeric",
1193
1201
  identity: e,
1194
1202
  unresolved: !1
1195
1203
  };
1196
1204
  }
1197
- function B(e, n) {
1205
+ function G(e, n) {
1198
1206
  var r;
1199
1207
  const a = (r = n.derivedField) == null ? void 0 : r.aggregationBehavior;
1200
1208
  return !a || e.unresolved ? e : a === "additive" ? e.reaggregation.kind === "additive" ? e : { ...e, reaggregation: { kind: "additive" } } : { ...e, reaggregation: { kind: "none", reason: "declared" } };
1201
1209
  }
1202
- function Ht(e, n) {
1203
- if (!e) return Q;
1210
+ function Jt(e, n) {
1211
+ if (!e) return Y;
1204
1212
  if (typeof e.expression == "string" && e.expression.trim()) {
1205
1213
  const r = J(e, n + 1);
1206
1214
  return r === "row_input" ? "raw" : r.unresolved || r.stage === "aggregate" || r.outer ? r : "raw";
@@ -1208,13 +1216,13 @@ function Ht(e, n) {
1208
1216
  const a = K(e.aggregate);
1209
1217
  return a ? X(a) : "raw";
1210
1218
  }
1211
- const Qt = 12;
1219
+ const en = 12;
1212
1220
  function J(e, n) {
1213
1221
  var E;
1214
- if (n > Qt) return Q;
1222
+ if (n > en) return Y;
1215
1223
  const a = typeof e.expression == "string" ? e.expression.trim() : "";
1216
1224
  if (!a)
1217
- return B(
1225
+ return G(
1218
1226
  X(K(e.aggregate) ?? "sum"),
1219
1227
  e
1220
1228
  );
@@ -1223,12 +1231,12 @@ function J(e, n) {
1223
1231
  return S ? s[Number(S[1])] : void 0;
1224
1232
  }, i = /* @__PURE__ */ new Map();
1225
1233
  for (const u of r.tokensOutsideAggregates)
1226
- i.has(u) || i.set(u, Ht(c(u), n));
1234
+ i.has(u) || i.set(u, Jt(c(u), n));
1227
1235
  const l = r.calls.some(
1228
1236
  (u) => u.tokens.some((S) => {
1229
- const k = c(S);
1230
- if (!(k != null && k.expression)) return !1;
1231
- const L = J(k, n + 1);
1237
+ const w = c(S);
1238
+ if (!(w != null && w.expression)) return !1;
1239
+ const L = J(w, n + 1);
1232
1240
  return L !== "row_input" && (L.unresolved || L.stage === "aggregate");
1233
1241
  })
1234
1242
  ), m = Array.from(i.values()).filter(
@@ -1239,25 +1247,25 @@ function J(e, n) {
1239
1247
  ).map(([u]) => u)
1240
1248
  ), g = W(a, p).aggregateInputsComplete;
1241
1249
  if (!d) {
1242
- if (!g) return Pe;
1250
+ if (!g) return Fe;
1243
1251
  const u = K(e.aggregate);
1244
- return u ? B(X(u), e) : "row_input";
1252
+ return u ? G(X(u), e) : "row_input";
1245
1253
  }
1246
1254
  const I = !g || o || r.nestedAggregate || l || m.some((u) => u.unresolved) || r.calls.length === 0 && m.length === 0, R = [
1247
1255
  ...r.calls.map((u) => ({ kind: u.kind, distinct: u.distinct })),
1248
1256
  ...m.flatMap((u) => u.calls)
1249
- ], T = r.windowed || m.some((u) => u.windowed), x = !I && !T && R.every((u) => Oe.has(u.kind)), C = (u) => {
1257
+ ], v = r.windowed || m.some((u) => u.windowed), x = !I && !v && R.every((u) => Pe.has(u.kind)), C = (u) => {
1250
1258
  if (u.kind === "call") {
1251
- const k = r.calls[u.index];
1252
- return k ? xe(k.kind) : { kind: "none", reason: "unresolved" };
1259
+ const w = r.calls[u.index];
1260
+ return w ? je(w.kind) : { kind: "none", reason: "unresolved" };
1253
1261
  }
1254
1262
  const S = i.get(u.token);
1255
1263
  return S && S !== "raw" ? S.reaggregation : { kind: "none", reason: "unresolved" };
1256
- }, b = $t(r.skeleton);
1264
+ }, b = Qt(r.skeleton);
1257
1265
  let _, h, N = "numeric";
1258
1266
  if (I)
1259
1267
  _ = { kind: "none", reason: "unresolved" }, h = "unresolved";
1260
- else if (T)
1268
+ else if (v)
1261
1269
  _ = { kind: "none", reason: "window" }, h = "expression";
1262
1270
  else if (b.kind === "single")
1263
1271
  if (_ = C(b.unit), b.unit.kind === "call") {
@@ -1268,11 +1276,11 @@ function J(e, n) {
1268
1276
  h = u.identity, N = u.outputType;
1269
1277
  }
1270
1278
  else b.kind === "linear" ? (_ = b.units.every((S) => C(S).kind === "additive") ? { kind: "additive" } : { kind: "none", reason: "other" }, h = "linear") : (_ = { kind: "none", reason: b.hasDivision ? "ratio" : "other" }, h = b.hasDivision ? "ratio" : "expression");
1271
- return B(
1279
+ return G(
1272
1280
  {
1273
1281
  stage: "aggregate",
1274
1282
  calls: R,
1275
- windowed: T,
1283
+ windowed: v,
1276
1284
  repeatSafe: x,
1277
1285
  reaggregation: _,
1278
1286
  outputType: N,
@@ -1282,113 +1290,114 @@ function J(e, n) {
1282
1290
  e
1283
1291
  );
1284
1292
  }
1285
- function Jt(e) {
1293
+ function tn(e) {
1286
1294
  const n = J(e, 0);
1287
- return n === "row_input" ? Pe : n;
1295
+ return n === "row_input" ? Fe : n;
1288
1296
  }
1289
- function En(e) {
1290
- const n = Je((e == null ? void 0 : e.dataType) || "number");
1297
+ function Cn(e) {
1298
+ const n = tt((e == null ? void 0 : e.dataType) || "number");
1291
1299
  if (!e) return n;
1292
- const a = Jt(e);
1300
+ const a = tn(e);
1293
1301
  return a.unresolved || a.outputType === "input" ? n : "number";
1294
1302
  }
1295
- const en = t.object({
1296
- intent: et,
1297
- matrixWindowRequest: pe
1298
- }).strict(), tn = t.object({
1299
- runtimeFilters: G.innerType().shape.filters,
1300
- runtimeSorts: G.innerType().shape.sorts.optional()
1303
+ const nn = t.object({
1304
+ intent: nt,
1305
+ matrixWindowRequest: he
1306
+ }).strict(), an = t.object({
1307
+ runtimeFilters: B.innerType().shape.filters,
1308
+ runtimeSorts: B.innerType().shape.sorts.optional()
1301
1309
  });
1302
- function Rn(e) {
1303
- return tn.parse(e);
1310
+ function Nn(e) {
1311
+ return an.parse(e);
1304
1312
  }
1305
- const nn = {
1313
+ const rn = {
1306
1314
  // A window executes a governed statement set, not one compiled query.
1307
1315
  compiledQuery: t.never().optional(),
1308
- intent: en.shape.intent,
1316
+ intent: nn.shape.intent,
1309
1317
  resultShape: t.literal("matrix"),
1310
- result: Ae.optional(),
1311
- metadata: t.object({ rowLimitExceeded: t.boolean(), matrixFailure: H.optional() }).passthrough()
1312
- }, an = ve.extend(nn), Cn = an.superRefine((e, n) => {
1318
+ result: Ie.optional(),
1319
+ metadata: t.object({ rowLimitExceeded: t.boolean(), matrixFailure: Q.optional() }).passthrough()
1320
+ }, sn = ve.extend(rn), On = sn.superRefine((e, n) => {
1313
1321
  e.status === "failed" == !!e.result && n.addIssue({ code: "custom", message: "Only answered or partial Matrix execution carries a window." }), e.result && e.status === "partial" != e.result.window.failures.length > 0 && n.addIssue({ code: "custom", message: "Matrix execution status must match acquired window failures." });
1314
1322
  });
1315
1323
  export {
1316
- dn as $,
1317
- kn as A,
1318
- Pt as B,
1319
- jt as C,
1324
+ dt as $,
1325
+ oe as A,
1326
+ kn as B,
1327
+ Tn as C,
1320
1328
  Ft as D,
1321
- wn as E,
1322
- Lt as F,
1323
- Ut as G,
1329
+ Lt as E,
1330
+ Ut as F,
1331
+ vn as G,
1324
1332
  Dt as H,
1325
- Tn as I,
1326
- Bt as J,
1327
- Ne as K,
1328
- W as L,
1329
- $t as M,
1330
- Jt as N,
1331
- En as O,
1332
- me as P,
1333
- at as Q,
1334
- rt as R,
1335
- Te as S,
1336
- cn as T,
1337
- ln as U,
1338
- ot as V,
1339
- un as W,
1333
+ qt as I,
1334
+ Gt as J,
1335
+ Rn as K,
1336
+ zt as L,
1337
+ xe as M,
1338
+ W as N,
1339
+ Qt as O,
1340
+ tn as P,
1341
+ Cn as Q,
1342
+ pe as R,
1343
+ Ee as S,
1344
+ st as T,
1345
+ ot as U,
1346
+ un as V,
1347
+ dn as W,
1340
1348
  ct as X,
1341
- te as Y,
1342
- lt as Z,
1343
- pe as _,
1344
- vn as a,
1345
- ut as a0,
1346
- dt as a1,
1347
- mt as a2,
1348
- ne as a3,
1349
- H as a4,
1350
- pt as a5,
1351
- Se as a6,
1352
- ht as a7,
1353
- mn as a8,
1354
- pn as a9,
1355
- ft as aa,
1356
- gt as ab,
1357
- yt as ac,
1358
- hn as ad,
1359
- fn as ae,
1360
- St as af,
1361
- bt as ag,
1362
- ae as ah,
1363
- At as ai,
1364
- gn as aj,
1365
- tn as ak,
1366
- Rn as al,
1367
- Cn as am,
1368
- en as an,
1369
- Y as b,
1370
- In as c,
1371
- It as d,
1372
- _t as e,
1373
- _e as f,
1374
- yn as g,
1349
+ mn as Y,
1350
+ ut as Z,
1351
+ te as _,
1352
+ En as a,
1353
+ pn as a0,
1354
+ mt as a1,
1355
+ pt as a2,
1356
+ ht as a3,
1357
+ ne as a4,
1358
+ Q as a5,
1359
+ ft as a6,
1360
+ be as a7,
1361
+ gt as a8,
1362
+ hn as a9,
1363
+ fn as aa,
1364
+ yt as ab,
1365
+ St as ac,
1366
+ bt as ad,
1367
+ gn as ae,
1368
+ yn as af,
1369
+ At as ag,
1370
+ It as ah,
1371
+ ae as ai,
1372
+ _t as aj,
1373
+ Sn as ak,
1374
+ an as al,
1375
+ Nn as am,
1376
+ On as an,
1377
+ nn as ao,
1378
+ H as b,
1379
+ wn as c,
1380
+ wt as d,
1381
+ kt as e,
1382
+ we as f,
1383
+ bn as g,
1375
1384
  ke as h,
1376
- Rt as i,
1377
- we as j,
1385
+ Nt as i,
1386
+ Te as j,
1378
1387
  ve as k,
1379
- kt as l,
1380
- vt as m,
1381
- Tt as n,
1382
- Ae as o,
1383
- Sn as p,
1384
- Ee as q,
1385
- bn as r,
1388
+ Tt as l,
1389
+ he as m,
1390
+ Et as n,
1391
+ Rt as o,
1392
+ An as p,
1393
+ Ie as q,
1394
+ Re as r,
1386
1395
  se as s,
1387
- Ct as t,
1388
- An as u,
1389
- Re as v,
1390
- Nt as w,
1391
- z as x,
1392
- oe as y,
1393
- _n as z
1396
+ In as t,
1397
+ Ot as u,
1398
+ _n as v,
1399
+ Ce as w,
1400
+ Ne as x,
1401
+ xt as y,
1402
+ z
1394
1403
  };