react-semaphor 0.1.603 → 0.1.605

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 (208) hide show
  1. package/dist/activity/index.js +1 -73
  2. package/dist/analytics-protocol/index.js +1 -1491
  3. package/dist/appearance/index.js +1 -12
  4. package/dist/appearance-runtime/index.js +1 -5
  5. package/dist/assistant-context/index.js +1 -11
  6. package/dist/assistant-protocol/index.js +1 -152
  7. package/dist/brand-studio/index.js +3 -1598
  8. package/dist/briefings/index.js +1 -70
  9. package/dist/chunks/add-to-dashboard-CEmZUf9o.js +12 -0
  10. package/dist/chunks/analytics-base-schemas-DMFrDqn_.js +1 -0
  11. package/dist/chunks/appearance-provider-CfoAVQuG.js +608 -0
  12. package/dist/chunks/appearance-runtime-provider-Bx8H-moR.js +1 -0
  13. package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
  14. package/dist/chunks/assistant-chat-DgUaCE9k.js +51 -0
  15. package/dist/chunks/attachment-filter-line-C_zHMhGh.js +1 -0
  16. package/dist/chunks/attribution-BEFSsbNn.js +1 -0
  17. package/dist/chunks/availability-3AIOf6Z-.js +1 -0
  18. package/dist/chunks/bookmark-impact-BAtemeyK.js +1 -0
  19. package/dist/chunks/bookmark-state-DScd31KT.js +1 -0
  20. package/dist/chunks/brand-C9APUFaP.js +1 -0
  21. package/dist/chunks/card-filter-builder-ClWrXB7P.js +11 -0
  22. package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
  23. package/dist/chunks/comparison-window-caption-tguyN24S.js +1 -0
  24. package/dist/chunks/context-CntvtZwC.js +2 -0
  25. package/dist/chunks/conversation-JMK2kyTK.js +1 -0
  26. package/dist/chunks/dashboard-ChIcbVTx.js +1 -0
  27. package/dist/chunks/dashboard-briefing-launcher-CwMlhkxV.js +42 -0
  28. package/dist/chunks/dashboard-controls-UCSAFCGA.js +42 -0
  29. package/dist/chunks/dashboard-json-B120hYDa.js +1 -0
  30. package/dist/chunks/dashboard-temporal-snapshot-BFJKbp_6.js +1 -0
  31. package/dist/chunks/edit-dashboard-visual-DvHp03h_.js +73 -0
  32. package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
  33. package/dist/chunks/filter-line-WwUV5JzN.js +1 -0
  34. package/dist/chunks/filter-reach-preview-C5M5_hf_.js +1 -0
  35. package/dist/chunks/filter-value-text-DqTHe_vu.js +1 -0
  36. package/dist/chunks/index-DViPGDFj.js +1 -0
  37. package/dist/chunks/index-bkP6SnYu.js +1 -0
  38. package/dist/chunks/kpi-trend-rule-B87LNzcz.js +1 -0
  39. package/dist/chunks/layout-grid-CFzqJ7GC.js +6 -0
  40. package/dist/chunks/matrix-analytical-definition-5T-2euHZ.js +1 -0
  41. package/dist/chunks/matrix-member-presentation-vVAv-aqg.js +1 -0
  42. package/dist/chunks/matrix-operation-contract-CWvcEsQ0.js +1 -0
  43. package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
  44. package/dist/chunks/numeric-range-options-C8tr-Bls.js +1 -0
  45. package/dist/chunks/palette-NvEIuXHN.js +6 -0
  46. package/dist/chunks/pivot-result-contract-expectations-BNWhS8mv.js +1 -0
  47. package/dist/chunks/pivot-result-identity-B0eWVMXg.js +1 -0
  48. package/dist/chunks/raw-temporal-value-BHQ-ldpW.js +1 -0
  49. package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
  50. package/dist/chunks/report-preferences-dialog-Bseb2Rlg.js +1 -0
  51. package/dist/chunks/report-runtime-context-Cd1b5pku.js +1 -0
  52. package/dist/chunks/resolve-dashboard-input-context-BDY7KwRe.js +8 -0
  53. package/dist/chunks/resolver-CjsW8Rz0.js +1 -0
  54. package/dist/chunks/saved-dashboard-context-C3lWc4Dx.js +1 -0
  55. package/dist/chunks/schema-O1Y3WTGF.js +4 -0
  56. package/dist/chunks/selection-filter-compiler-kYsRugss.js +1 -0
  57. package/dist/chunks/semaphor-ready-indicator-BQarSo6S.js +612 -0
  58. package/dist/chunks/set-6mOnfQeH.js +1 -0
  59. package/dist/chunks/slider-BPnHdMGq.js +4 -0
  60. package/dist/chunks/stored-dashboard-DfrxDLhR.js +1 -0
  61. package/dist/chunks/table-export-sheet-xaczzWZF.js +2 -0
  62. package/dist/chunks/token-types-1vzMWjI-.js +1 -0
  63. package/dist/chunks/validators-Dg2kyF4_.js +1 -0
  64. package/dist/chunks/variable-draft-B4_xqr4Y.js +1 -0
  65. package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
  66. package/dist/dashboard/index.js +1 -7
  67. package/dist/dashboard-authoring/index.js +1 -4614
  68. package/dist/format-utils/index.js +1 -425
  69. package/dist/index.js +1 -554
  70. package/dist/layouts/index.js +1 -7
  71. package/dist/live-channel/index.js +1 -124
  72. package/dist/pdf-export-policy/index.js +1 -92
  73. package/dist/pdf-table-layout/index.js +1 -993
  74. package/dist/report-runtime-context/index.js +1 -9
  75. package/dist/shared/index.js +1 -6
  76. package/dist/style.css +1 -1
  77. package/dist/surfboard/index.js +1 -9
  78. package/dist/types/brand-studio/brand-studio-draft.d.ts +45 -13
  79. package/dist/types/brand-studio/brand-studio-editor.d.ts +13 -2
  80. package/dist/types/components/index.d.ts +1 -0
  81. package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +17 -6
  82. package/dist/types/components/visual/data-table/types/data-table.d.ts +52 -42
  83. package/dist/types/index.js +1 -88
  84. package/dist/types/lib/appearance/aliases.d.ts +3 -0
  85. package/dist/types/lib/appearance/index.d.ts +1 -0
  86. package/dist/types/lib/appearance/table-density.d.ts +18 -0
  87. package/dist/types/lib/appearance/types.d.ts +39 -1
  88. package/dist/types/lib/dashboard-viewer/column-header-actions.d.ts +100 -0
  89. package/dist/types/lib/dashboard-viewer/table-view-edit.d.ts +0 -27
  90. package/dist/types/lib/dashboard-viewer/table-view.d.ts +26 -2
  91. package/dist/types/lib/dashboard-viewer/use-table-view.d.ts +2 -0
  92. package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
  93. package/dist/types/lib/hooks/use-add-new-frame.d.ts +7 -0
  94. package/dist/types/lib/hooks/use-dashboard-card.d.ts +4 -0
  95. package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +8 -0
  96. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
  97. package/dist/types/lib/stores/dashboard-store.d.ts +14 -2
  98. package/dist/types/lib/stores/explorer-actions.d.ts +7 -10
  99. package/dist/types/lib/types/common-types.d.ts +1 -2
  100. package/dist/types/lib/types/semantic-types.d.ts +6 -10
  101. package/dist/types/lib/utils/card-config-utils.d.ts +13 -0
  102. package/dist/types/lib/utils/field-placement.d.ts +17 -0
  103. package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
  104. package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +21 -1
  105. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +7 -4
  106. package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
  107. package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
  108. package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
  109. package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
  110. package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
  111. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
  112. package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +180 -0
  113. package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
  114. package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
  115. package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
  116. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +2 -8
  117. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  118. package/dist/types/shared/dashboard-authoring/card-settings/column-display-values.d.ts +5 -0
  119. package/dist/types/shared/dashboard-authoring/card-settings/column-display.d.ts +52 -0
  120. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -0
  121. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +9 -0
  122. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +4 -0
  123. package/dist/types/shared/dashboard-authoring/card-settings/table-viewer-switches.d.ts +15 -0
  124. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +5 -0
  125. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
  126. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +132 -3
  127. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +3 -1
  128. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  129. package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +10 -1
  130. package/dist/types/shared/dashboard-authoring/field-aggregations.d.ts +9 -2
  131. package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +116 -0
  132. package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
  133. package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
  134. package/dist/types/shared/dashboard-authoring/index.d.ts +7 -1
  135. package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +2 -0
  136. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +7 -2
  137. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +6 -2
  138. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +2 -0
  139. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
  140. package/dist/types/shared/dashboard-authoring/sheet-kinds.d.ts +36 -0
  141. package/dist/types/shared/dashboard-authoring/table-sheet-shape.d.ts +140 -0
  142. package/dist/types/shared/dashboard-viewer/table-column-move.d.ts +15 -0
  143. package/dist/types/shared/dashboard-viewer/table-settings.d.ts +8 -2
  144. package/dist/types/shared/format-utils/types/format-types.d.ts +1 -1
  145. package/dist/usage-events/index.js +1 -285
  146. package/dist/value-format-preferences/index.js +1 -635
  147. package/package.json +5 -2
  148. package/dist/chunks/add-to-dashboard-CFF-wFU-.js +0 -291
  149. package/dist/chunks/analytics-base-schemas-DsUh5Q3C.js +0 -680
  150. package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
  151. package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
  152. package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
  153. package/dist/chunks/assistant-chat-B6hNQI1t.js +0 -6115
  154. package/dist/chunks/attribution-BvoKvhcj.js +0 -32
  155. package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
  156. package/dist/chunks/bookmark-impact-Ba2PLcGp.js +0 -76
  157. package/dist/chunks/bookmark-state-n7AaNzR_.js +0 -1667
  158. package/dist/chunks/brand-BoUV0iHF.js +0 -54
  159. package/dist/chunks/card-filter-builder-Y22HizVx.js +0 -4069
  160. package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
  161. package/dist/chunks/comparison-window-caption-Ck2TIbnR.js +0 -741
  162. package/dist/chunks/context-UCQ7sere.js +0 -369
  163. package/dist/chunks/conversation-sQiWYUOb.js +0 -16
  164. package/dist/chunks/dashboard-BghI99oY.js +0 -14
  165. package/dist/chunks/dashboard-briefing-launcher-DtBAnGiH.js +0 -4875
  166. package/dist/chunks/dashboard-controls-CtFXlyjV.js +0 -2290
  167. package/dist/chunks/dashboard-json-DfGBUtCd.js +0 -66
  168. package/dist/chunks/dates-BnrXF4bb.js +0 -185
  169. package/dist/chunks/edit-9df1zOWe.js +0 -226
  170. package/dist/chunks/edit-dashboard-visual-oxt3x1wb.js +0 -18397
  171. package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
  172. package/dist/chunks/filter-line-Cy5YYqRL.js +0 -703
  173. package/dist/chunks/filter-reach-copy-CE_ZX147.js +0 -5111
  174. package/dist/chunks/filter-value-text-fWvSDwkl.js +0 -153
  175. package/dist/chunks/index-BVKzKl5d.js +0 -90
  176. package/dist/chunks/index-CV_Kzou0.js +0 -595
  177. package/dist/chunks/index-D5rxbtS4.js +0 -2795
  178. package/dist/chunks/layout-grid-9LndRoLa.js +0 -16
  179. package/dist/chunks/matrix-analytical-definition-CCp48UCw.js +0 -1233
  180. package/dist/chunks/matrix-member-presentation-zNehruXR.js +0 -391
  181. package/dist/chunks/matrix-operation-contract-DPBj69D8.js +0 -1413
  182. package/dist/chunks/metric-comparison-B0FR-Q8I.js +0 -600
  183. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
  184. package/dist/chunks/paintbrush-58FQYY-y.js +0 -27
  185. package/dist/chunks/palette-Be62Tkoa.js +0 -23
  186. package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
  187. package/dist/chunks/pivot-result-contract-expectations-BYqAmG9n.js +0 -5092
  188. package/dist/chunks/pivot-result-identity-CAP4--iq.js +0 -77
  189. package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +0 -3778
  190. package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
  191. package/dist/chunks/report-preferences-dialog-uJp9GBTM.js +0 -1651
  192. package/dist/chunks/report-runtime-context-c77_KF9v.js +0 -388
  193. package/dist/chunks/resolve-dashboard-input-context-Rtl1ffmE.js +0 -25324
  194. package/dist/chunks/resolver-DG_tfEpt.js +0 -156
  195. package/dist/chunks/save-C5A0JnEV.js +0 -21
  196. package/dist/chunks/saved-dashboard-context-tcyTU8jm.js +0 -618
  197. package/dist/chunks/schema-C9NPiIru.js +0 -2568
  198. package/dist/chunks/selection-filter-compiler-DNijjI5y.js +0 -150
  199. package/dist/chunks/semaphor-ready-indicator-FBvunj6S.js +0 -145603
  200. package/dist/chunks/shelf-drop-preview-context-QKStrcK9.js +0 -2466
  201. package/dist/chunks/stored-dashboard-CHozcAY9.js +0 -4075
  202. package/dist/chunks/style-sheet-parts-CDCG-8Ej.js +0 -8681
  203. package/dist/chunks/table-export-sheet-ZFIvs6Sj.js +0 -949
  204. package/dist/chunks/token-types-XbM6QByy.js +0 -8
  205. package/dist/chunks/upload-H15d7uHK.js +0 -15
  206. package/dist/chunks/validators-Baf3VIf5.js +0 -3686
  207. package/dist/chunks/variable-draft-C2y8Jp6Z.js +0 -242
  208. package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
@@ -1,680 +0,0 @@
1
- import { z as e } from "zod";
2
- const Z = [
3
- "missing_dependency",
4
- "missing_relationship",
5
- "population_required",
6
- "ambiguous_relationship"
7
- ];
8
- function Re(t) {
9
- return Z.includes(
10
- t
11
- );
12
- }
13
- const Ie = 200, D = [
14
- "second",
15
- "minute",
16
- "hour",
17
- "day",
18
- "week",
19
- "month",
20
- "quarter",
21
- "year"
22
- ];
23
- function xe(t) {
24
- return typeof t == "string" && D.includes(t);
25
- }
26
- const B = [
27
- "week_of_short",
28
- "week_of_long",
29
- "quarter_short",
30
- "quarter_long",
31
- "fiscal_quarter_short",
32
- "fiscal_year",
33
- // Named presets per grain (column formats CF-D16).
34
- "short",
35
- "long",
36
- "numeric",
37
- "iso"
38
- ], G = ["hour", "day", "week", "month", "quarter", "year"], De = {
39
- invalidMetadata: "invalid_raw_temporal_metadata"
40
- };
41
- function z(t) {
42
- return t === "second" || t === "minute" || t === "hour" ? "datetime" : "date";
43
- }
44
- const we = {
45
- missingMetadata: "missing_temporal_bucket_metadata",
46
- invalidMetadata: "invalid_temporal_bucket_metadata",
47
- invalidValue: "invalid_temporal_bucket_value"
48
- }, je = "__auto_count__";
49
- function w(t) {
50
- try {
51
- return new Intl.DateTimeFormat("en-US", { timeZone: t }).format(), !0;
52
- } catch {
53
- return !1;
54
- }
55
- }
56
- const L = 20;
57
- function d(t) {
58
- if (!(typeof t != "number" || !Number.isFinite(t)))
59
- return Math.max(0, Math.min(L, Math.trunc(t)));
60
- }
61
- function s(t) {
62
- return typeof t == "string" ? t : void 0;
63
- }
64
- function S(t) {
65
- return typeof t == "string" && t.trim() ? t : void 0;
66
- }
67
- function _(t) {
68
- return typeof t == "boolean" ? t : void 0;
69
- }
70
- function $(t) {
71
- if (typeof t != "string") return;
72
- const a = t.trim().toUpperCase();
73
- return /^[A-Z]{3}$/.test(a) ? a : void 0;
74
- }
75
- function H(t) {
76
- return typeof t == "number" && Number.isFinite(t) ? t : void 0;
77
- }
78
- function c(t) {
79
- return Object.fromEntries(
80
- Object.entries(t).filter(([, a]) => a !== void 0)
81
- );
82
- }
83
- const K = /* @__PURE__ */ new Set(["number", "currency", "percent", "percentage", "scientific"]), W = /* @__PURE__ */ new Set(["millisecond", "second", "minute", "hour", "day"]);
84
- function v(t) {
85
- return typeof t == "string" && W.has(t) ? t : void 0;
86
- }
87
- function X(t) {
88
- const a = t.percentValueMode ?? "fraction";
89
- if (t.scale === 1 && a === "whole") {
90
- const { scale: i, ...f } = t;
91
- return { ...f, percentValueMode: "whole" };
92
- }
93
- const o = t.minimumFractionDigits ?? (t.maximumFractionDigits === void 0 ? 1 : 0), n = t.maximumFractionDigits ?? Math.max(o, 1);
94
- return c({
95
- type: "number",
96
- scale: a === "whole" ? t.scale : t.scale * 100,
97
- minimumFractionDigits: o,
98
- maximumFractionDigits: n,
99
- useGrouping: t.useGrouping,
100
- prefix: t.prefix,
101
- suffix: `%${t.suffix ?? ""}`,
102
- negativeStyle: t.negativeStyle,
103
- signDisplay: t.signDisplay
104
- });
105
- }
106
- function Y(t) {
107
- const a = t.type === "percentage" ? "percent" : t.type;
108
- let o = d(t.minimumFractionDigits), n = d(t.maximumFractionDigits);
109
- const i = d(t.decimals);
110
- o === void 0 && n === void 0 && i !== void 0 && (o = i, n = i), o !== void 0 && n !== void 0 && o > n && ([o, n] = [n, o]);
111
- const f = t.negativeStyle === "parentheses" || t.negativeStyle === "minus" ? t.negativeStyle : void 0, P = t.signDisplay === "auto" || t.signDisplay === "always" || t.signDisplay === "exceptZero" || t.signDisplay === "never" ? t.signDisplay : void 0, m = c({
112
- type: a,
113
- currency: a === "currency" ? $(t.currency) : void 0,
114
- minimumFractionDigits: o,
115
- maximumFractionDigits: n,
116
- useGrouping: _(t.useGrouping) ?? _(t.thousandsSeparator),
117
- prefix: s(t.prefix),
118
- // Intl adds the % of a percent; a stored '%' suffix on one is the same sign.
119
- suffix: a === "percent" && t.suffix === "%" ? void 0 : s(t.suffix),
120
- negativeStyle: f,
121
- compact: _(t.compact),
122
- scale: H(t.scale),
123
- percentValueMode: a === "percent" ? t.percentValueMode === "whole" ? "whole" : "fraction" : void 0,
124
- signDisplay: P
125
- });
126
- return m.type === "percent" && m.scale !== void 0 ? X(m) : m;
127
- }
128
- function J(t) {
129
- if (!t || typeof t != "object" || Array.isArray(t)) return;
130
- const a = t;
131
- if (a.type === "temporal_bucket") {
132
- const o = a.presentation;
133
- return o && typeof o == "object" && !Array.isArray(o) ? { type: "temporal_bucket", presentation: o } : void 0;
134
- }
135
- if (typeof a.type == "string" && K.has(a.type))
136
- return Y(a);
137
- if (a.type === "date" || a.type === "datetime") {
138
- const o = S(a.pattern), n = a.preset === "short" || a.preset === "long" || a.preset === "numeric" || a.preset === "iso" ? a.preset : void 0, i = o && (a.dialect === "date_fns" || a.dialect === "semaphor_tokens") ? a.dialect : void 0;
139
- return c({
140
- type: "date",
141
- pattern: o,
142
- dialect: i,
143
- preset: o ? void 0 : n,
144
- relative: a.relative === !0 ? !0 : void 0,
145
- timezone: S(a.timezone),
146
- sourceTimezone: S(a.sourceTimezone),
147
- prefix: s(a.prefix),
148
- suffix: s(a.suffix)
149
- });
150
- }
151
- if (a.type === "duration") {
152
- const o = d(a.maxUnits);
153
- return c({
154
- type: "duration",
155
- inputUnit: v(a.inputUnit),
156
- outputStyle: a.outputStyle === "compact" || a.outputStyle === "digital" || a.outputStyle === "long" ? a.outputStyle : void 0,
157
- largestUnit: v(a.largestUnit),
158
- smallestUnit: v(a.smallestUnit),
159
- maxUnits: o === void 0 ? void 0 : Math.min(o, 10),
160
- prefix: s(a.prefix),
161
- suffix: s(a.suffix),
162
- negativeStyle: a.negativeStyle === "parentheses" || a.negativeStyle === "minus" ? a.negativeStyle : void 0
163
- });
164
- }
165
- if (a.type === "string")
166
- return c({ type: "string", prefix: s(a.prefix), suffix: s(a.suffix) });
167
- }
168
- const Q = e.record(e.string(), e.unknown()), p = e.array(Q), u = e.enum([
169
- "SUM",
170
- "COUNT",
171
- "AVG",
172
- "MIN",
173
- "MAX",
174
- "MEDIAN",
175
- "DISTINCT"
176
- ]), g = e.enum([
177
- "postgres",
178
- "mysql",
179
- "mssql",
180
- "snowflake",
181
- "clickhouse",
182
- "bigquery",
183
- "redshift",
184
- "duckdb",
185
- "sqlite",
186
- "unknown"
187
- ]), ee = e.enum(D), h = e.enum([
188
- "dimension",
189
- "measure",
190
- "date",
191
- "id",
192
- "unknown"
193
- ]), y = e.enum([
194
- "string",
195
- "number",
196
- "boolean",
197
- "date",
198
- "datetime",
199
- "unknown"
200
- ]), T = e.union([e.number(), e.string(), e.null()]), k = e.enum([
201
- "millisecond",
202
- "second",
203
- "minute",
204
- "hour",
205
- "day"
206
- ]), te = e.enum(B), ae = e.discriminatedUnion("mode", [
207
- e.object({ mode: e.literal("auto") }).strict(),
208
- e.object({
209
- mode: e.literal("preset"),
210
- preset: te
211
- }).strict(),
212
- e.object({
213
- mode: e.literal("pattern"),
214
- pattern: e.string().min(1)
215
- }).strict()
216
- ]), j = e.object({
217
- type: e.literal("temporal_bucket"),
218
- presentation: ae
219
- }).strict(), oe = e.object({
220
- tz: e.string().min(1).refine(w, {
221
- message: "tz must be a valid IANA timezone"
222
- }),
223
- weekStart: e.number().int().min(0).max(6),
224
- fiscalCalendar: e.object({
225
- kind: e.literal("month_aligned"),
226
- yearStartMonth: e.number().int().min(1).max(12)
227
- }).strict().optional()
228
- }).strict(), R = e.object({
229
- kind: e.literal("temporal_bucket"),
230
- granularity: ee,
231
- calendar: oe
232
- }).strict(), ne = e.object({
233
- grainSource: e.enum(["automatic", "card"]),
234
- window: e.object({ startInclusive: e.string(), endExclusive: e.string() }).strict().optional(),
235
- automaticGrain: e.enum(G),
236
- holdsTime: e.boolean()
237
- }).strict(), ie = e.object({
238
- kind: e.literal("raw_temporal"),
239
- valueKind: e.enum(["date", "wall_datetime", "instant"])
240
- }).strict(), Ae = e.object({
241
- kind: e.literal("raw_temporal"),
242
- valueKind: e.enum(["date", "wall_datetime", "instant"]),
243
- tz: e.string().min(1).refine(w, "tz must be an IANA timezone.")
244
- }).strict(), r = e.string(), I = e.number().int().min(0).max(20), A = e.object({
245
- type: e.enum(["number", "currency", "percent", "scientific"]),
246
- currency: e.string().regex(/^[A-Z]{3}$/, "Expected an ISO 4217 currency code.").optional(),
247
- minimumFractionDigits: I.optional(),
248
- maximumFractionDigits: I.optional(),
249
- useGrouping: e.boolean().optional(),
250
- prefix: r.optional(),
251
- suffix: r.optional(),
252
- negativeStyle: e.enum(["minus", "parentheses"]).optional(),
253
- compact: e.boolean().optional(),
254
- scale: e.number().finite().optional(),
255
- percentValueMode: e.enum(["fraction", "whole"]).optional(),
256
- signDisplay: e.enum(["auto", "always", "exceptZero", "never"]).optional()
257
- }).strict().superRefine((t, a) => {
258
- const { minimumFractionDigits: o, maximumFractionDigits: n } = t;
259
- o !== void 0 && n !== void 0 && o > n && a.addIssue({
260
- code: e.ZodIssueCode.custom,
261
- path: ["minimumFractionDigits"],
262
- message: "minimumFractionDigits must not exceed maximumFractionDigits."
263
- }), t.currency !== void 0 && t.type !== "currency" && a.addIssue({
264
- code: e.ZodIssueCode.custom,
265
- path: ["currency"],
266
- message: "Only a currency format names a currency."
267
- }), t.type === "percent" ? (t.percentValueMode === void 0 && a.addIssue({
268
- code: e.ZodIssueCode.custom,
269
- path: ["percentValueMode"],
270
- message: "A percent format states percentValueMode: fraction (0.25 is 25%) or whole (25 is 25%)."
271
- }), t.scale !== void 0 && a.addIssue({
272
- code: e.ZodIssueCode.custom,
273
- path: ["scale"],
274
- message: "A percent format has no scale; percentValueMode says how the value is read."
275
- })) : t.percentValueMode !== void 0 && a.addIssue({
276
- code: e.ZodIssueCode.custom,
277
- path: ["percentValueMode"],
278
- message: "Only a percent format has percentValueMode."
279
- });
280
- }), se = ["short", "long", "numeric", "iso"], F = e.object({
281
- type: e.literal("date"),
282
- pattern: e.string().min(1).optional(),
283
- dialect: e.enum(["semaphor_tokens", "date_fns"]).optional(),
284
- preset: e.enum(se).optional(),
285
- relative: e.boolean().optional(),
286
- timezone: e.string().min(1).optional(),
287
- sourceTimezone: e.string().min(1).optional(),
288
- prefix: r.optional(),
289
- suffix: r.optional()
290
- }).strict().superRefine((t, a) => {
291
- t.pattern !== void 0 && t.preset !== void 0 && a.addIssue({
292
- code: e.ZodIssueCode.custom,
293
- path: ["preset"],
294
- message: "A date format has a pattern or a preset, not both."
295
- }), t.dialect !== void 0 && t.pattern === void 0 && a.addIssue({
296
- code: e.ZodIssueCode.custom,
297
- path: ["dialect"],
298
- message: "dialect names the token set of a pattern."
299
- });
300
- }), C = e.object({
301
- type: e.literal("duration"),
302
- inputUnit: k.optional(),
303
- outputStyle: e.enum(["compact", "digital", "long"]).optional(),
304
- largestUnit: k.optional(),
305
- smallestUnit: k.optional(),
306
- maxUnits: e.number().int().min(0).max(10).optional(),
307
- prefix: r.optional(),
308
- suffix: r.optional(),
309
- negativeStyle: e.enum(["minus", "parentheses"]).optional()
310
- }).strict(), M = e.object({
311
- type: e.literal("string"),
312
- prefix: r.optional(),
313
- suffix: r.optional()
314
- }).strict(), O = e.union([
315
- A,
316
- F,
317
- C,
318
- M
319
- ]), re = e.unknown().superRefine((t, a) => {
320
- t && typeof t == "object" && "locale" in t && ["number", "currency", "percent", "percentage", "scientific"].includes(
321
- String(t.type)
322
- ) && a.addIssue({
323
- code: e.ZodIssueCode.custom,
324
- path: ["locale"],
325
- message: "Numeric semantic formats inherit locale from viewer preferences."
326
- });
327
- }).transform((t) => J(t) ?? t).pipe(O), Fe = e.union([
328
- O,
329
- j
330
- ]), Ce = ["number", "currency", "percent", "scientific", "duration", "date", "string", "temporal_bucket"];
331
- function ce(t) {
332
- switch (t) {
333
- case "number":
334
- case "currency":
335
- case "percent":
336
- case "scientific":
337
- return A;
338
- case "date":
339
- return F;
340
- case "duration":
341
- return C;
342
- case "string":
343
- return M;
344
- case "temporal_bucket":
345
- return j;
346
- default:
347
- return;
348
- }
349
- }
350
- function Me(t) {
351
- let a = ce(t);
352
- for (; a && !(a instanceof e.ZodObject); )
353
- a = a instanceof e.ZodEffects ? a.innerType() : void 0;
354
- return a ? Object.keys(a.shape) : void 0;
355
- }
356
- function le(t, a) {
357
- return e.object(t).passthrough().superRefine((o, n) => {
358
- for (const i of a)
359
- Object.prototype.hasOwnProperty.call(o, i) || n.addIssue({
360
- code: "custom",
361
- path: [i],
362
- message: `Required field "${i}" is missing.`
363
- });
364
- });
365
- }
366
- const E = e.object({
367
- kind: e.literal("semantic"),
368
- domainId: e.string(),
369
- datasetName: e.string(),
370
- datasetId: e.string().optional(),
371
- label: e.string().optional(),
372
- connectionId: e.string().optional()
373
- }).passthrough(), pe = e.object({
374
- kind: e.literal("physical"),
375
- connectionId: e.string(),
376
- connectionType: e.string().optional(),
377
- tableName: e.string(),
378
- databaseName: e.string().optional(),
379
- schemaName: e.string().optional(),
380
- label: e.string().optional(),
381
- dialect: g.optional()
382
- }).passthrough(), ue = e.object({
383
- kind: e.literal("sql"),
384
- connectionId: e.string(),
385
- dialect: g.optional(),
386
- label: e.string().optional()
387
- }).passthrough(), N = e.union([
388
- E,
389
- pe,
390
- ue
391
- ]), me = e.object({
392
- name: e.string(),
393
- label: e.string().optional(),
394
- role: h.optional(),
395
- dataType: y.optional(),
396
- source: N.optional(),
397
- aggregate: u.optional()
398
- }).passthrough(), V = me, de = e.object({
399
- kind: e.literal("field"),
400
- field: V,
401
- aggregate: u.optional()
402
- }).passthrough(), ge = e.object({
403
- kind: e.literal("derived_field"),
404
- name: e.string(),
405
- label: e.string(),
406
- description: e.string().optional(),
407
- resultRole: h,
408
- dataType: y,
409
- computeStage: e.enum(["row", "aggregate"]),
410
- expression: e.string(),
411
- expressionLanguage: e.literal("semaphor_sql_template").optional(),
412
- inputs: e.record(de),
413
- defaultAggregate: u.optional(),
414
- aggregationBehavior: e.enum([
415
- "additive",
416
- "non_additive",
417
- "ratio_of_sums",
418
- "weighted",
419
- "pre_aggregated",
420
- "snapshot"
421
- ]).optional(),
422
- aggregationStrategy: e.enum([
423
- "default",
424
- "symmetric_aggregate",
425
- "aggregate_then_join",
426
- "weighted"
427
- ]).optional(),
428
- format: re.optional(),
429
- tags: e.array(e.string()).optional()
430
- }).passthrough(), U = ge, Oe = V.and(
431
- e.object({
432
- derivedField: U.optional()
433
- }).passthrough()
434
- ), he = E, ye = e.object({
435
- kind: e.literal("physical"),
436
- connectionId: e.string().optional(),
437
- connectionType: e.string().optional(),
438
- tableName: e.string(),
439
- databaseName: e.string().optional(),
440
- schemaName: e.string().optional(),
441
- label: e.string().optional(),
442
- dialect: g.optional()
443
- }).passthrough(), be = e.object({
444
- kind: e.literal("sql"),
445
- connectionId: e.string().optional(),
446
- dialect: g.optional(),
447
- label: e.string().optional()
448
- }).passthrough(), fe = e.union([
449
- he,
450
- ye,
451
- be
452
- ]), Ee = e.object({
453
- key: e.string().optional(),
454
- name: e.string(),
455
- label: e.string().optional(),
456
- role: h.optional(),
457
- dataType: y.optional(),
458
- source: fe.optional(),
459
- aggregate: u.optional(),
460
- derivedField: e.never().optional()
461
- }).passthrough(), l = e.object({
462
- key: e.string(),
463
- name: e.string(),
464
- label: e.string(),
465
- role: h.optional(),
466
- dataType: y.optional(),
467
- aggregate: u.optional(),
468
- source: N.optional(),
469
- derivedField: U.optional(),
470
- temporalBucket: R.optional(),
471
- rawTemporal: ie.optional(),
472
- dateGrain: ne.optional(),
473
- pivotIdentity: e.object({
474
- metricId: e.string().min(1),
475
- metricAlias: e.string().min(1),
476
- members: e.array(
477
- e.object({
478
- fieldId: e.string().min(1),
479
- value: e.string().nullable(),
480
- temporalBucket: R.optional()
481
- }).strict()
482
- )
483
- }).strict().optional()
484
- }).passthrough().superRefine((t, a) => {
485
- if (t.temporalBucket && t.rawTemporal && a.addIssue({
486
- code: e.ZodIssueCode.custom,
487
- path: ["rawTemporal"],
488
- message: "A result column cannot carry both temporalBucket and rawTemporal metadata."
489
- }), t.temporalBucket) {
490
- const o = z(
491
- t.temporalBucket.granularity
492
- );
493
- t.dataType !== o && a.addIssue({
494
- code: e.ZodIssueCode.custom,
495
- path: ["dataType"],
496
- message: `${t.temporalBucket.granularity} temporal buckets require dataType ${o}.`
497
- });
498
- }
499
- if (t.rawTemporal) {
500
- const o = t.rawTemporal.valueKind === "date" ? "date" : "datetime";
501
- t.dataType !== o && a.addIssue({
502
- code: e.ZodIssueCode.custom,
503
- path: ["dataType"],
504
- message: `${t.rawTemporal.valueKind} raw temporal values require dataType ${o}.`
505
- });
506
- }
507
- }), Ne = e.object({
508
- records: p,
509
- columns: e.array(l).optional()
510
- }).passthrough(), Ve = e.object({
511
- records: p,
512
- columns: e.array(l)
513
- }).passthrough(), q = e.object({
514
- code: e.string(),
515
- message: e.string().optional(),
516
- invalidField: e.string().optional(),
517
- fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
518
- validMeasureCandidates: e.array(e.string()).optional(),
519
- validDateCandidates: e.array(e.string()).optional(),
520
- validDimensionCandidates: e.array(e.string()).optional(),
521
- recommendedNextStep: e.string()
522
- }).passthrough(), x = e.object({
523
- code: e.string(),
524
- message: e.string(),
525
- path: e.string().optional(),
526
- fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
527
- repairHint: q.optional()
528
- }).passthrough(), Ue = e.object({
529
- ok: e.boolean(),
530
- errors: e.array(x),
531
- warnings: e.array(x),
532
- repairHints: e.array(q)
533
- }).passthrough(), Se = e.object({
534
- page: e.number(),
535
- pageSize: e.number(),
536
- pageCount: e.number(),
537
- totalCount: e.number(),
538
- hasNextPage: e.boolean(),
539
- hasPrevPage: e.boolean()
540
- }).passthrough(), b = {
541
- intentId: e.string().optional(),
542
- queryPath: e.enum(["query_spec", "sql", "sql_python"]),
543
- warnings: e.array(e.string()).optional(),
544
- rowCount: e.number().optional(),
545
- rowLimitExceeded: e.boolean().optional(),
546
- limit: e.number().optional(),
547
- pagination: Se.optional()
548
- }, qe = e.object({
549
- ...b,
550
- kind: e.literal("metric"),
551
- primaryValue: T,
552
- measures: e.record(T).optional(),
553
- missingMeasures: e.array(e.string()).optional(),
554
- comparison: e.object({
555
- kind: e.enum(["previous_period", "previous_year", "target"]),
556
- /** What it compared with, as a card names it (compare-with CW-D24). */
557
- words: e.string().optional(),
558
- value: T.optional(),
559
- delta: e.union([e.number(), e.null()]).optional(),
560
- deltaPercent: e.union([e.number(), e.null()]).optional()
561
- }).passthrough().optional(),
562
- records: p.optional()
563
- }).passthrough(), Pe = e.object({
564
- ...b,
565
- kind: e.literal("records"),
566
- columns: e.array(l),
567
- records: p,
568
- totals: e.object({
569
- mode: e.literal("server"),
570
- scope: e.literal("filtered_result"),
571
- row: e.record(e.string(), e.unknown()),
572
- columns: e.array(l).optional()
573
- }).passthrough().optional()
574
- }).passthrough(), _e = e.object({
575
- inputId: e.string().min(1),
576
- status: e.enum(["applied", "inactive", "skipped", "overridden", "error"]),
577
- reason: e.enum([
578
- "unrelated",
579
- "population_required",
580
- "missing_dependency",
581
- "missing_relationship",
582
- "ambiguous_relationship",
583
- "invalid_metadata",
584
- "unsupported_dependency",
585
- "override_not_eligible"
586
- ]).optional()
587
- }), ve = e.object({
588
- complete: e.boolean(),
589
- reason: e.enum(["unsupported", "truncated"]).optional()
590
- }), Te = e.object({
591
- kind: e.literal("standardCursor"),
592
- pageSize: e.number().int().positive(),
593
- hasMore: e.boolean(),
594
- nextCursor: e.string().min(1).optional()
595
- }), Ze = e.object({
596
- ...b,
597
- kind: e.literal("inputOptions"),
598
- dependencyOutcomes: e.array(_e).optional(),
599
- match: ve.optional(),
600
- page: Te.optional(),
601
- options: e.array(
602
- le(
603
- {
604
- label: e.string(),
605
- value: e.unknown(),
606
- count: e.number().optional(),
607
- disambiguation: e.array(e.string()).optional()
608
- },
609
- ["value"]
610
- )
611
- )
612
- }).passthrough(), Be = e.object({
613
- ...b,
614
- kind: e.literal("sql"),
615
- columns: e.array(l),
616
- records: p,
617
- sqlShape: e.object({
618
- statementType: e.string().optional(),
619
- explicitLimit: e.number().optional(),
620
- hasPythonCode: e.boolean().optional()
621
- }).passthrough().optional()
622
- }).passthrough();
623
- export {
624
- Te as $,
625
- G as A,
626
- Ce as B,
627
- ce as C,
628
- Me as D,
629
- E,
630
- pe as F,
631
- ue as G,
632
- me as H,
633
- V as I,
634
- ge as J,
635
- U as K,
636
- Oe as L,
637
- Ie as M,
638
- Ee as N,
639
- Z as O,
640
- l as P,
641
- Ne as Q,
642
- De as R,
643
- je as S,
644
- we as T,
645
- Ve as U,
646
- x as V,
647
- Ue as W,
648
- qe as X,
649
- Pe as Y,
650
- _e as Z,
651
- ve as _,
652
- z as a,
653
- Ze as a0,
654
- Be as a1,
655
- R as b,
656
- Re as c,
657
- D as d,
658
- xe as e,
659
- B as f,
660
- p as g,
661
- u as h,
662
- w as i,
663
- ee as j,
664
- j as k,
665
- ne as l,
666
- ie as m,
667
- T as n,
668
- Ae as o,
669
- A as p,
670
- se as q,
671
- Q as r,
672
- N as s,
673
- J as t,
674
- F as u,
675
- C as v,
676
- M as w,
677
- O as x,
678
- re as y,
679
- Fe as z
680
- };