react-semaphor 0.1.537 → 0.1.538

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 (173) hide show
  1. package/dist/analytics-protocol/index.js +352 -341
  2. package/dist/assistant-context/index.js +10 -0
  3. package/dist/assistant-protocol/index.js +104 -0
  4. package/dist/brand-studio/index.js +35 -31
  5. package/dist/briefings/index.js +46 -45
  6. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +28 -0
  7. package/dist/chunks/add-to-dashboard-CxtTfISD.js +56 -0
  8. package/dist/chunks/aggregate-table-row-presentation-Qgpv6_G8.js +979 -0
  9. package/dist/chunks/analytics-base-schemas-BFAoRlkU.js +472 -0
  10. package/dist/chunks/apply-dashboard-operations-C-iahGka.js +402 -0
  11. package/dist/chunks/assistant-chat-BAqUIFp5.js +7966 -0
  12. package/dist/chunks/availability-Bp5Gfu1I.js +44 -0
  13. package/dist/chunks/{bookmark-state-B-I9BDD0.js → bookmark-state-k7y5SNGf.js} +9 -9
  14. package/dist/chunks/{braces-8TRlDwDw.js → braces-o9UiRQes.js} +1 -1
  15. package/dist/chunks/calculated-field-identity-DcBS2NPP.js +2161 -0
  16. package/dist/chunks/calendar-day-equality-Bpl15IBo.js +487 -0
  17. package/dist/chunks/class-utils-Df1OVOT1.js +2315 -0
  18. package/dist/chunks/{field-dependencies-CpRUwr9J.js → common-types-CUf03Htv.js} +65 -58
  19. package/dist/chunks/context-HD9usB1P.js +349 -0
  20. package/dist/chunks/conversation-sQiWYUOb.js +16 -0
  21. package/dist/chunks/csv-utils-GUfKyT1J.js +56 -0
  22. package/dist/chunks/custom-visual-inputs-BrUOIwln.js +3288 -0
  23. package/dist/chunks/{dashboard-BPJo-Fnd.js → dashboard-DTDDFQsS.js} +1 -1
  24. package/dist/chunks/{dashboard-briefing-launcher-A2uVpHCp.js → dashboard-briefing-launcher-Bb2QUqOa.js} +764 -740
  25. package/dist/chunks/{dashboard-controls-DxTuVis_.js → dashboard-controls-FpONU8QV.js} +683 -686
  26. package/dist/chunks/{common-types-g7yS12Cg.js → dashboard-filter-value-compatibility-D95O4nd7.js} +18 -24
  27. package/dist/chunks/dashboard-json-DazPhBU_.js +69 -0
  28. package/dist/chunks/document-dashboard-inputs-D96rlU7S.js +10678 -0
  29. package/dist/chunks/document-sheet-utils-C1eEldxs.js +1076 -0
  30. package/dist/chunks/{edit-dashboard-visual-ByV0OwSp.js → edit-dashboard-visual-CIhZodVH.js} +4744 -4746
  31. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +15 -0
  32. package/dist/chunks/filter-value-text-BhWugPWE.js +163 -0
  33. package/dist/chunks/index-CqMiAkay.js +3164 -0
  34. package/dist/chunks/index-CuHybtft.js +51 -0
  35. package/dist/chunks/layout-grid-Bgzth8vd.js +16 -0
  36. package/dist/chunks/{matrix-analytical-definition-CgBTD6H8.js → matrix-analytical-definition-bcprSe4u.js} +1 -1
  37. package/dist/chunks/{matrix-card-CAdizkUl.js → matrix-card-CJn1hB5V.js} +13 -12
  38. package/dist/chunks/matrix-definition-DQDI2okF.js +206 -0
  39. package/dist/chunks/{matrix-formatter-DJCk8Znf.js → matrix-formatter-Bgw32tb3.js} +648 -457
  40. package/dist/chunks/matrix-member-presentation-BNPSDKBG.js +105 -0
  41. package/dist/chunks/{matrix-operation-contract-BKupLHXL.js → matrix-operation-contract-B8PBF1Gd.js} +134 -133
  42. package/dist/chunks/{metric-comparison-BKHyvnAy.js → metric-comparison-CojWeLqx.js} +1 -1
  43. package/dist/chunks/{palette-Cp1hqZtm.js → palette-D10o_yYX.js} +1 -1
  44. package/dist/chunks/pivot-header-presentation-MkcKnjn3.js +42 -0
  45. package/dist/chunks/{pivot-result-identity-Bs4tLtLo.js → pivot-result-identity-D6hhcRXi.js} +1 -1
  46. package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +804 -0
  47. package/dist/chunks/raw-temporal-D61lr48Y.js +1464 -0
  48. package/dist/chunks/{raw-temporal-contract-mLFS-9wk.js → raw-temporal-contract-C51YG48G.js} +1 -1
  49. package/dist/chunks/report-preferences-dialog-BCGs4-AE.js +1808 -0
  50. package/dist/chunks/{report-runtime-context-CG_I0PPW.js → report-runtime-context-B984Nq1E.js} +8 -7
  51. package/dist/chunks/save-CfJpQQ68.js +21 -0
  52. package/dist/chunks/saved-dashboard-context-BrTkjcod.js +566 -0
  53. package/dist/chunks/{selection-reducer-CiDEtmAq.js → selection-reducer-vKIb_jS6.js} +2 -2
  54. package/dist/chunks/{semaphor-ready-indicator-CHu1L-lo.js → semaphor-ready-indicator-CHHoWhil.js} +65586 -62749
  55. package/dist/chunks/{shelf-drop-preview-context-i-H6DFyU.js → shelf-drop-preview-context-EsayECEC.js} +199 -196
  56. package/dist/chunks/{source-entity-resolution-C-oNyYMp.js → source-entity-resolution-CVA1a85c.js} +8 -8
  57. package/dist/chunks/switch-CvItuC1Q.js +8199 -0
  58. package/dist/chunks/{temporal-bucket-DlFuhCnT.js → temporal-bucket-D8JF7zKz.js} +86 -71
  59. package/dist/chunks/{temporal-bucket-contract-D2OuaVZ7.js → temporal-bucket-contract-DaOajRC7.js} +1 -1
  60. package/dist/chunks/{token-types-DtSJOUjh.js → token-types-bxUxXDX2.js} +1 -1
  61. package/dist/chunks/{upload-CAIpsti1.js → upload-BFX7apKV.js} +1 -1
  62. package/dist/chunks/{use-create-flow-overlay-state-Bj63WwHc.js → use-create-flow-overlay-state-BqA92GkX.js} +331 -339
  63. package/dist/chunks/{validators-DMSH81OM.js → validators-Ej1DdCXa.js} +1050 -1510
  64. package/dist/chunks/visual-choice-JiJ-_3bi.js +204 -0
  65. package/dist/chunks/x-4f5U2XwU.js +100 -0
  66. package/dist/chunks/{zoned-wall-clock-1qlWCE20.js → zoned-wall-clock-MulfA26h.js} +2 -2
  67. package/dist/dashboard/index.js +2 -2
  68. package/dist/dashboard-authoring/index.js +823 -661
  69. package/dist/data-app-sdk/index.js +32 -30
  70. package/dist/data-app-sdk-adapters/index.js +23 -22
  71. package/dist/data-app-sdk-validation/index.js +23 -22
  72. package/dist/format-utils/index.js +173 -168
  73. package/dist/index.js +267 -258
  74. package/dist/layouts/index.js +236 -24
  75. package/dist/report-runtime-context/index.js +2 -2
  76. package/dist/style.css +1 -1
  77. package/dist/surfboard/index.js +2 -2
  78. package/dist/types/assistant-context.d.ts +2 -0
  79. package/dist/types/assistant-protocol.d.ts +2 -0
  80. package/dist/types/components/assistant/assistant-entry-points.d.ts +18 -0
  81. package/dist/types/components/assistant/assistant-provider.d.ts +19 -0
  82. package/dist/types/components/assistant/assistant-store.d.ts +52 -0
  83. package/dist/types/components/assistant/use-assistant.d.ts +38 -0
  84. package/dist/types/components/index.d.ts +5 -1
  85. package/dist/types/components/surfboard/filter/types.d.ts +5 -2
  86. package/dist/types/index.js +50 -51
  87. package/dist/types/lib/api/invalidate-token.d.ts +7 -0
  88. package/dist/types/lib/charts/cartesian-fields.d.ts +64 -0
  89. package/dist/types/lib/charts/types.d.ts +7 -0
  90. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +14 -2
  91. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +5 -6
  92. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +8 -3
  93. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +11 -6
  94. package/dist/types/lib/dashboard-pagination/dashboard-card-pagination.d.ts +7 -0
  95. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +79 -0
  96. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +3 -2
  97. package/dist/types/lib/document/document-table-data-policy.d.ts +15 -0
  98. package/dist/types/lib/filter-values/filter-mode.d.ts +22 -0
  99. package/dist/types/lib/hooks/use-calendar-context.d.ts +5 -0
  100. package/dist/types/lib/hooks/use-text-filter.d.ts +7 -0
  101. package/dist/types/lib/print/print-inputs.d.ts +4 -2
  102. package/dist/types/lib/query-context/build-card-query-context.d.ts +12 -4
  103. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +93 -0
  104. package/dist/types/lib/query-context/card-server-request.d.ts +72 -0
  105. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
  106. package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +56 -0
  107. package/dist/types/lib/query-context/document-section-card-query.d.ts +45 -0
  108. package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +17 -2
  109. package/dist/types/lib/stores/dashboard-store.d.ts +34 -11
  110. package/dist/types/lib/stores/editor-store.d.ts +4 -2
  111. package/dist/types/lib/types/token-types.d.ts +11 -0
  112. package/dist/types/lib/utils/card-type-change.d.ts +30 -0
  113. package/dist/types/lib/utils/comparison-window-caption.d.ts +12 -0
  114. package/dist/types/lib/utils/filter-default-value-utils.d.ts +13 -2
  115. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +74 -0
  116. package/dist/types/shared/analytics-protocol/contracts.d.ts +3 -0
  117. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +43 -0
  118. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  119. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +1 -1
  120. package/dist/types/shared/analytics-protocol/visual-choice.d.ts +75 -0
  121. package/dist/types/shared/assistant-context/index.d.ts +9 -0
  122. package/dist/types/shared/assistant-context/project-context.d.ts +55 -0
  123. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +130 -0
  124. package/dist/types/shared/assistant-protocol/add-to-dashboard.d.ts +17 -0
  125. package/dist/types/shared/assistant-protocol/artifact.d.ts +63 -0
  126. package/dist/types/shared/assistant-protocol/availability.d.ts +39 -0
  127. package/dist/types/shared/assistant-protocol/context.d.ts +952 -0
  128. package/dist/types/shared/assistant-protocol/conversation.d.ts +38 -0
  129. package/dist/types/shared/assistant-protocol/index.d.ts +16 -0
  130. package/dist/types/shared/assistant-protocol/limits.d.ts +53 -0
  131. package/dist/types/shared/assistant-protocol/parts.d.ts +131 -0
  132. package/dist/types/shared/assistant-protocol/request.d.ts +77 -0
  133. package/dist/types/shared/assistant-protocol/sources.d.ts +27 -0
  134. package/dist/types/shared/assistant-protocol/token-config.d.ts +32 -0
  135. package/dist/types/shared/assistant-protocol/transcript.d.ts +40 -0
  136. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +112 -0
  137. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +1794 -0
  138. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
  139. package/dist/types/shared/dashboard-authoring/new-card.d.ts +10 -0
  140. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +40 -0
  141. package/dist/types/shared/dashboard-authoring/resolved-primary-date-field-validation.d.ts +16 -0
  142. package/dist/types/shared/format-utils/filter-detail.d.ts +70 -0
  143. package/dist/types/shared/format-utils/filter-value-text.d.ts +15 -0
  144. package/dist/types/shared/format-utils/index.d.ts +3 -0
  145. package/dist/types/shared/format-utils/raw-temporal.d.ts +7 -0
  146. package/dist/types/shared/format-utils/temporal-bucket.d.ts +7 -0
  147. package/dist/types/shared/layouts/frame-layouts.d.ts +23 -0
  148. package/dist/types/shared/layouts/index.d.ts +1 -0
  149. package/package.json +12 -2
  150. package/dist/chunks/calculated-field-identity-BptYhyOP.js +0 -1326
  151. package/dist/chunks/calendar-day-equality-BRjN1S9h.js +0 -383
  152. package/dist/chunks/card-config-utils-BOM1dxCk.js +0 -1150
  153. package/dist/chunks/constants-DNWVy8Y3.js +0 -9
  154. package/dist/chunks/dashboard-json-B1dEQu98.js +0 -65
  155. package/dist/chunks/field-aggregations-CoLzYHeL.js +0 -1229
  156. package/dist/chunks/index-DTcTAGGM.js +0 -4101
  157. package/dist/chunks/matrix-continuation-C4sRcjZU.js +0 -72
  158. package/dist/chunks/matrix-control-sources-DTqcA2_L.js +0 -636
  159. package/dist/chunks/matrix-definition-D9iShKZI.js +0 -87
  160. package/dist/chunks/matrix-member-presentation-Ct8GuxHt.js +0 -209
  161. package/dist/chunks/numeric-presentation-CWu3gunq.js +0 -537
  162. package/dist/chunks/pivot-header-presentation-CHs2GFrM.js +0 -753
  163. package/dist/chunks/pivot-result-lifecycle-DQz_gjGu.js +0 -789
  164. package/dist/chunks/raw-temporal-iMXRK-Qz.js +0 -930
  165. package/dist/chunks/report-preferences-dialog-DXPjteCU.js +0 -1623
  166. package/dist/chunks/save-kO6cIaob.js +0 -34
  167. package/dist/chunks/semantic-format-DiqYeKwU.js +0 -192
  168. package/dist/chunks/switch-DO8a0EfJ.js +0 -25004
  169. package/dist/chunks/temporal-input-presentation-BD7YNUzu.js +0 -195
  170. package/dist/chunks/x-CXDkqdur.js +0 -149
  171. package/dist/types/lib/class-utils.d.ts +0 -2
  172. package/dist/types/lib/document/document-input-runtime.d.ts +0 -26
  173. package/dist/types/lib/utils.d.ts +0 -51
@@ -1,1150 +0,0 @@
1
- import { v as q, am as G, B as L, G as T, t as N } from "./validators-DMSH81OM.js";
2
- import { ak as V } from "./matrix-operation-contract-BKupLHXL.js";
3
- import "zod";
4
- import "./matrix-continuation-C4sRcjZU.js";
5
- import "../value-format-preferences/index.js";
6
- import { v as F } from "./temporal-bucket-DlFuhCnT.js";
7
- import { A as b, f as A } from "./field-aggregations-CoLzYHeL.js";
8
- import { S as W, a as k } from "./color-CJvdlFM_.js";
9
- import { g as j, a as Q, b as H } from "./matrix-definition-D9iShKZI.js";
10
- import { i as K } from "./matrix-card-CAdizkUl.js";
11
- let v;
12
- const $ = new Uint8Array(16);
13
- function z() {
14
- if (!v && (v = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !v))
15
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
16
- return v($);
17
- }
18
- const g = [];
19
- for (let e = 0; e < 256; ++e)
20
- g.push((e + 256).toString(16).slice(1));
21
- function J(e, t = 0) {
22
- return g[e[t + 0]] + g[e[t + 1]] + g[e[t + 2]] + g[e[t + 3]] + "-" + g[e[t + 4]] + g[e[t + 5]] + "-" + g[e[t + 6]] + g[e[t + 7]] + "-" + g[e[t + 8]] + g[e[t + 9]] + "-" + g[e[t + 10]] + g[e[t + 11]] + g[e[t + 12]] + g[e[t + 13]] + g[e[t + 14]] + g[e[t + 15]];
23
- }
24
- const Z = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), M = {
25
- randomUUID: Z
26
- };
27
- function ke(e, t, a) {
28
- if (M.randomUUID && !e)
29
- return M.randomUUID();
30
- e = e || {};
31
- const r = e.random || (e.rng || z)();
32
- return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, J(r);
33
- }
34
- function Me(e) {
35
- return e.format != null || e.dateFormat != null;
36
- }
37
- const B = {
38
- "Week of MMM DD, YYYY": {
39
- type: "temporal_bucket",
40
- presentation: { mode: "preset", preset: "week_of_short" }
41
- },
42
- "Week of MMMM DD, YYYY": {
43
- type: "temporal_bucket",
44
- presentation: { mode: "preset", preset: "week_of_long" }
45
- },
46
- "Q1 YYYY": {
47
- type: "temporal_bucket",
48
- presentation: { mode: "preset", preset: "quarter_short" }
49
- },
50
- "1st Quarter YYYY": {
51
- type: "temporal_bucket",
52
- presentation: { mode: "preset", preset: "quarter_long" }
53
- },
54
- "YYYY Q1": void 0,
55
- "YYYY-Q1": void 0,
56
- "Quarter 1, YYYY": void 0,
57
- "YYYY-WW": void 0
58
- };
59
- function X(e, t, a, r) {
60
- return {
61
- code: t,
62
- severity: "warning",
63
- fieldId: e.fieldId,
64
- ...r ? { ignoredPattern: r } : {},
65
- effectiveFormat: a
66
- };
67
- }
68
- function ee(e, t) {
69
- if (e.dateFormat === void 0 || e.dateFormat === null)
70
- return { format: b };
71
- if (typeof e.dateFormat != "string")
72
- return {
73
- format: b,
74
- repairCode: "unsupported_pattern"
75
- };
76
- const a = e.dateFormat === "custom" ? typeof e.customFormat == "string" ? e.customFormat.trim() : "" : e.dateFormat.trim();
77
- if (!a)
78
- return {
79
- format: b,
80
- repairCode: "missing_custom_pattern"
81
- };
82
- if (Object.prototype.hasOwnProperty.call(B, a)) {
83
- const i = B[a];
84
- return i ? F(
85
- i,
86
- t
87
- ).ok ? { format: i } : {
88
- format: b,
89
- repairCode: "grain_incompatible_pattern",
90
- ignoredPattern: a
91
- } : {
92
- format: b,
93
- repairCode: "unsupported_pattern",
94
- ignoredPattern: a
95
- };
96
- }
97
- const r = {
98
- type: "temporal_bucket",
99
- presentation: { mode: "pattern", pattern: a }
100
- }, n = F(
101
- r,
102
- t
103
- );
104
- return n.ok ? { format: r } : {
105
- format: b,
106
- repairCode: n.code === "incompatible_temporal_bucket_pattern" || n.code === "incompatible_temporal_bucket_preset" ? "grain_incompatible_pattern" : "unsupported_pattern",
107
- ignoredPattern: a
108
- };
109
- }
110
- function te(e) {
111
- if (G(e.granularity))
112
- return { granularity: e.granularity, assumedDay: !1 };
113
- if (!(e.granularity !== void 0 && e.granularity !== null))
114
- return L(e.dataType) === "date" ? { granularity: "day", assumedDay: !0 } : void 0;
115
- }
116
- function Be(e) {
117
- const t = te(e);
118
- if (!t)
119
- return {
120
- ok: !1,
121
- error: { code: "ambiguous_temporal_grain", fieldId: e.fieldId }
122
- };
123
- let a, r, n;
124
- if (e.format !== void 0 && e.format !== null) {
125
- const f = q.safeParse(e.format);
126
- if (!f.success)
127
- a = b, r = "unsupported_pattern";
128
- else {
129
- const d = F(
130
- f.data,
131
- t.granularity
132
- );
133
- a = d.ok ? f.data : b, d.ok || (r = d.code === "invalid_temporal_bucket_pattern" ? "unsupported_pattern" : "grain_incompatible_pattern", n = f.data.presentation.mode === "pattern" ? f.data.presentation.pattern : f.data.presentation.mode === "preset" ? f.data.presentation.preset : void 0);
134
- }
135
- } else
136
- ({ format: a, repairCode: r, ignoredPattern: n } = ee(
137
- e,
138
- t.granularity
139
- ));
140
- const i = t.assumedDay ? "missing_grain_assumed_day" : r;
141
- return {
142
- ok: !0,
143
- format: a,
144
- ...i ? {
145
- diagnostic: X(
146
- e,
147
- i,
148
- a,
149
- n
150
- )
151
- } : {}
152
- };
153
- }
154
- var Re = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
155
- function re(e) {
156
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
157
- }
158
- function Ye(e) {
159
- if (e.__esModule) return e;
160
- var t = e.default;
161
- if (typeof t == "function") {
162
- var a = function r() {
163
- return this instanceof r ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
164
- };
165
- a.prototype = t.prototype;
166
- } else a = {};
167
- return Object.defineProperty(a, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
168
- var n = Object.getOwnPropertyDescriptor(e, r);
169
- Object.defineProperty(a, r, n.get ? n : {
170
- enumerable: !0,
171
- get: function() {
172
- return e[r];
173
- }
174
- });
175
- }), a;
176
- }
177
- var Y = {}, x = {}, E = { exports: {} }, s = String, P = function() {
178
- return { isColorSupported: !1, reset: s, bold: s, dim: s, italic: s, underline: s, inverse: s, hidden: s, strikethrough: s, black: s, red: s, green: s, yellow: s, blue: s, magenta: s, cyan: s, white: s, gray: s, bgBlack: s, bgRed: s, bgGreen: s, bgYellow: s, bgBlue: s, bgMagenta: s, bgCyan: s, bgWhite: s, blackBright: s, redBright: s, greenBright: s, yellowBright: s, blueBright: s, magentaBright: s, cyanBright: s, whiteBright: s, bgBlackBright: s, bgRedBright: s, bgGreenBright: s, bgYellowBright: s, bgBlueBright: s, bgMagentaBright: s, bgCyanBright: s, bgWhiteBright: s };
179
- };
180
- E.exports = P();
181
- E.exports.createColors = P;
182
- var ae = E.exports;
183
- (function(e) {
184
- Object.defineProperty(e, "__esModule", {
185
- value: !0
186
- });
187
- function t(o, u) {
188
- for (var p in u) Object.defineProperty(o, p, {
189
- enumerable: !0,
190
- get: u[p]
191
- });
192
- }
193
- t(e, {
194
- dim: function() {
195
- return f;
196
- },
197
- default: function() {
198
- return d;
199
- }
200
- });
201
- const a = /* @__PURE__ */ r(ae);
202
- function r(o) {
203
- return o && o.__esModule ? o : {
204
- default: o
205
- };
206
- }
207
- let n = /* @__PURE__ */ new Set();
208
- function i(o, u, p) {
209
- typeof process < "u" && process.env.JEST_WORKER_ID || p && n.has(p) || (p && n.add(p), console.warn(""), u.forEach((c) => console.warn(o, "-", c)));
210
- }
211
- function f(o) {
212
- return a.default.dim(o);
213
- }
214
- const d = {
215
- info(o, u) {
216
- i(a.default.bold(a.default.cyan("info")), ...Array.isArray(o) ? [
217
- o
218
- ] : [
219
- u,
220
- o
221
- ]);
222
- },
223
- warn(o, u) {
224
- i(a.default.bold(a.default.yellow("warn")), ...Array.isArray(o) ? [
225
- o
226
- ] : [
227
- u,
228
- o
229
- ]);
230
- },
231
- risk(o, u) {
232
- i(a.default.bold(a.default.magenta("risk")), ...Array.isArray(o) ? [
233
- o
234
- ] : [
235
- u,
236
- o
237
- ]);
238
- }
239
- };
240
- })(x);
241
- (function(e) {
242
- Object.defineProperty(e, "__esModule", {
243
- value: !0
244
- }), Object.defineProperty(e, "default", {
245
- enumerable: !0,
246
- get: function() {
247
- return n;
248
- }
249
- });
250
- const t = /* @__PURE__ */ a(x);
251
- function a(i) {
252
- return i && i.__esModule ? i : {
253
- default: i
254
- };
255
- }
256
- function r({ version: i, from: f, to: d }) {
257
- t.default.warn(`${f}-color-renamed`, [
258
- `As of Tailwind CSS ${i}, \`${f}\` has been renamed to \`${d}\`.`,
259
- "Update your configuration file to silence this warning."
260
- ]);
261
- }
262
- const n = {
263
- inherit: "inherit",
264
- current: "currentColor",
265
- transparent: "transparent",
266
- black: "#000",
267
- white: "#fff",
268
- slate: {
269
- 50: "#f8fafc",
270
- 100: "#f1f5f9",
271
- 200: "#e2e8f0",
272
- 300: "#cbd5e1",
273
- 400: "#94a3b8",
274
- 500: "#64748b",
275
- 600: "#475569",
276
- 700: "#334155",
277
- 800: "#1e293b",
278
- 900: "#0f172a",
279
- 950: "#020617"
280
- },
281
- gray: {
282
- 50: "#f9fafb",
283
- 100: "#f3f4f6",
284
- 200: "#e5e7eb",
285
- 300: "#d1d5db",
286
- 400: "#9ca3af",
287
- 500: "#6b7280",
288
- 600: "#4b5563",
289
- 700: "#374151",
290
- 800: "#1f2937",
291
- 900: "#111827",
292
- 950: "#030712"
293
- },
294
- zinc: {
295
- 50: "#fafafa",
296
- 100: "#f4f4f5",
297
- 200: "#e4e4e7",
298
- 300: "#d4d4d8",
299
- 400: "#a1a1aa",
300
- 500: "#71717a",
301
- 600: "#52525b",
302
- 700: "#3f3f46",
303
- 800: "#27272a",
304
- 900: "#18181b",
305
- 950: "#09090b"
306
- },
307
- neutral: {
308
- 50: "#fafafa",
309
- 100: "#f5f5f5",
310
- 200: "#e5e5e5",
311
- 300: "#d4d4d4",
312
- 400: "#a3a3a3",
313
- 500: "#737373",
314
- 600: "#525252",
315
- 700: "#404040",
316
- 800: "#262626",
317
- 900: "#171717",
318
- 950: "#0a0a0a"
319
- },
320
- stone: {
321
- 50: "#fafaf9",
322
- 100: "#f5f5f4",
323
- 200: "#e7e5e4",
324
- 300: "#d6d3d1",
325
- 400: "#a8a29e",
326
- 500: "#78716c",
327
- 600: "#57534e",
328
- 700: "#44403c",
329
- 800: "#292524",
330
- 900: "#1c1917",
331
- 950: "#0c0a09"
332
- },
333
- red: {
334
- 50: "#fef2f2",
335
- 100: "#fee2e2",
336
- 200: "#fecaca",
337
- 300: "#fca5a5",
338
- 400: "#f87171",
339
- 500: "#ef4444",
340
- 600: "#dc2626",
341
- 700: "#b91c1c",
342
- 800: "#991b1b",
343
- 900: "#7f1d1d",
344
- 950: "#450a0a"
345
- },
346
- orange: {
347
- 50: "#fff7ed",
348
- 100: "#ffedd5",
349
- 200: "#fed7aa",
350
- 300: "#fdba74",
351
- 400: "#fb923c",
352
- 500: "#f97316",
353
- 600: "#ea580c",
354
- 700: "#c2410c",
355
- 800: "#9a3412",
356
- 900: "#7c2d12",
357
- 950: "#431407"
358
- },
359
- amber: {
360
- 50: "#fffbeb",
361
- 100: "#fef3c7",
362
- 200: "#fde68a",
363
- 300: "#fcd34d",
364
- 400: "#fbbf24",
365
- 500: "#f59e0b",
366
- 600: "#d97706",
367
- 700: "#b45309",
368
- 800: "#92400e",
369
- 900: "#78350f",
370
- 950: "#451a03"
371
- },
372
- yellow: {
373
- 50: "#fefce8",
374
- 100: "#fef9c3",
375
- 200: "#fef08a",
376
- 300: "#fde047",
377
- 400: "#facc15",
378
- 500: "#eab308",
379
- 600: "#ca8a04",
380
- 700: "#a16207",
381
- 800: "#854d0e",
382
- 900: "#713f12",
383
- 950: "#422006"
384
- },
385
- lime: {
386
- 50: "#f7fee7",
387
- 100: "#ecfccb",
388
- 200: "#d9f99d",
389
- 300: "#bef264",
390
- 400: "#a3e635",
391
- 500: "#84cc16",
392
- 600: "#65a30d",
393
- 700: "#4d7c0f",
394
- 800: "#3f6212",
395
- 900: "#365314",
396
- 950: "#1a2e05"
397
- },
398
- green: {
399
- 50: "#f0fdf4",
400
- 100: "#dcfce7",
401
- 200: "#bbf7d0",
402
- 300: "#86efac",
403
- 400: "#4ade80",
404
- 500: "#22c55e",
405
- 600: "#16a34a",
406
- 700: "#15803d",
407
- 800: "#166534",
408
- 900: "#14532d",
409
- 950: "#052e16"
410
- },
411
- emerald: {
412
- 50: "#ecfdf5",
413
- 100: "#d1fae5",
414
- 200: "#a7f3d0",
415
- 300: "#6ee7b7",
416
- 400: "#34d399",
417
- 500: "#10b981",
418
- 600: "#059669",
419
- 700: "#047857",
420
- 800: "#065f46",
421
- 900: "#064e3b",
422
- 950: "#022c22"
423
- },
424
- teal: {
425
- 50: "#f0fdfa",
426
- 100: "#ccfbf1",
427
- 200: "#99f6e4",
428
- 300: "#5eead4",
429
- 400: "#2dd4bf",
430
- 500: "#14b8a6",
431
- 600: "#0d9488",
432
- 700: "#0f766e",
433
- 800: "#115e59",
434
- 900: "#134e4a",
435
- 950: "#042f2e"
436
- },
437
- cyan: {
438
- 50: "#ecfeff",
439
- 100: "#cffafe",
440
- 200: "#a5f3fc",
441
- 300: "#67e8f9",
442
- 400: "#22d3ee",
443
- 500: "#06b6d4",
444
- 600: "#0891b2",
445
- 700: "#0e7490",
446
- 800: "#155e75",
447
- 900: "#164e63",
448
- 950: "#083344"
449
- },
450
- sky: {
451
- 50: "#f0f9ff",
452
- 100: "#e0f2fe",
453
- 200: "#bae6fd",
454
- 300: "#7dd3fc",
455
- 400: "#38bdf8",
456
- 500: "#0ea5e9",
457
- 600: "#0284c7",
458
- 700: "#0369a1",
459
- 800: "#075985",
460
- 900: "#0c4a6e",
461
- 950: "#082f49"
462
- },
463
- blue: {
464
- 50: "#eff6ff",
465
- 100: "#dbeafe",
466
- 200: "#bfdbfe",
467
- 300: "#93c5fd",
468
- 400: "#60a5fa",
469
- 500: "#3b82f6",
470
- 600: "#2563eb",
471
- 700: "#1d4ed8",
472
- 800: "#1e40af",
473
- 900: "#1e3a8a",
474
- 950: "#172554"
475
- },
476
- indigo: {
477
- 50: "#eef2ff",
478
- 100: "#e0e7ff",
479
- 200: "#c7d2fe",
480
- 300: "#a5b4fc",
481
- 400: "#818cf8",
482
- 500: "#6366f1",
483
- 600: "#4f46e5",
484
- 700: "#4338ca",
485
- 800: "#3730a3",
486
- 900: "#312e81",
487
- 950: "#1e1b4b"
488
- },
489
- violet: {
490
- 50: "#f5f3ff",
491
- 100: "#ede9fe",
492
- 200: "#ddd6fe",
493
- 300: "#c4b5fd",
494
- 400: "#a78bfa",
495
- 500: "#8b5cf6",
496
- 600: "#7c3aed",
497
- 700: "#6d28d9",
498
- 800: "#5b21b6",
499
- 900: "#4c1d95",
500
- 950: "#2e1065"
501
- },
502
- purple: {
503
- 50: "#faf5ff",
504
- 100: "#f3e8ff",
505
- 200: "#e9d5ff",
506
- 300: "#d8b4fe",
507
- 400: "#c084fc",
508
- 500: "#a855f7",
509
- 600: "#9333ea",
510
- 700: "#7e22ce",
511
- 800: "#6b21a8",
512
- 900: "#581c87",
513
- 950: "#3b0764"
514
- },
515
- fuchsia: {
516
- 50: "#fdf4ff",
517
- 100: "#fae8ff",
518
- 200: "#f5d0fe",
519
- 300: "#f0abfc",
520
- 400: "#e879f9",
521
- 500: "#d946ef",
522
- 600: "#c026d3",
523
- 700: "#a21caf",
524
- 800: "#86198f",
525
- 900: "#701a75",
526
- 950: "#4a044e"
527
- },
528
- pink: {
529
- 50: "#fdf2f8",
530
- 100: "#fce7f3",
531
- 200: "#fbcfe8",
532
- 300: "#f9a8d4",
533
- 400: "#f472b6",
534
- 500: "#ec4899",
535
- 600: "#db2777",
536
- 700: "#be185d",
537
- 800: "#9d174d",
538
- 900: "#831843",
539
- 950: "#500724"
540
- },
541
- rose: {
542
- 50: "#fff1f2",
543
- 100: "#ffe4e6",
544
- 200: "#fecdd3",
545
- 300: "#fda4af",
546
- 400: "#fb7185",
547
- 500: "#f43f5e",
548
- 600: "#e11d48",
549
- 700: "#be123c",
550
- 800: "#9f1239",
551
- 900: "#881337",
552
- 950: "#4c0519"
553
- },
554
- get lightBlue() {
555
- return r({
556
- version: "v2.2",
557
- from: "lightBlue",
558
- to: "sky"
559
- }), this.sky;
560
- },
561
- get warmGray() {
562
- return r({
563
- version: "v3.0",
564
- from: "warmGray",
565
- to: "stone"
566
- }), this.stone;
567
- },
568
- get trueGray() {
569
- return r({
570
- version: "v3.0",
571
- from: "trueGray",
572
- to: "neutral"
573
- }), this.neutral;
574
- },
575
- get coolGray() {
576
- return r({
577
- version: "v3.0",
578
- from: "coolGray",
579
- to: "gray"
580
- }), this.gray;
581
- },
582
- get blueGray() {
583
- return r({
584
- version: "v3.0",
585
- from: "blueGray",
586
- to: "slate"
587
- }), this.slate;
588
- }
589
- };
590
- })(Y);
591
- let C = Y;
592
- var oe = (C.__esModule ? C : { default: C }).default;
593
- const l = /* @__PURE__ */ re(oe), ne = ".semaphor-scope";
594
- function ie(e) {
595
- return e ? e.closest(ne) : null;
596
- }
597
- function se(e) {
598
- if (!e) return "light";
599
- const t = e.dataset.semaphorTheme;
600
- return t === "dark" || t === "light" ? t : e.classList.contains("dark") ? "dark" : "light";
601
- }
602
- const xe = [
603
- "table",
604
- "view",
605
- "materialized view"
606
- ], Pe = ["_forecast"], De = "dm", Ie = "semaphor_calculated_fields", Oe = "calculated_fields", Ue = ["lg", "md", "sm", "xs", "xxs"], qe = {
607
- // dashboardHeader: ' font-mono border-b-2 border-red-700',
608
- default: {
609
- dashboardPanel: "",
610
- dashboardTabsContainer: "",
611
- // dashboard: '',
612
- gridLayout: {
613
- // margin: [2, 2],
614
- className: ""
615
- },
616
- chart: {
617
- font: {
618
- family: W
619
- // family:
620
- // 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
621
- },
622
- dataset: {
623
- // backgroundColor: [
624
- // colors.blue[500],
625
- // colors.teal[500],
626
- // colors.amber[500],
627
- // colors.red[500],
628
- // colors.indigo[500],
629
- // colors.green[500],
630
- // ],
631
- // borderColor: [
632
- // colors.blue[500],
633
- // colors.teal[500],
634
- // colors.amber[500],
635
- // colors.red[500],
636
- // colors.indigo[500],
637
- // colors.green[500],
638
- // ],
639
- backgroundColor: [
640
- // colors.teal[900],
641
- // colors.teal[700],
642
- l.teal[500],
643
- l.teal[300],
644
- l.gray[700],
645
- l.gray[500],
646
- l.gray[300]
647
- ],
648
- borderColor: [
649
- // colors.teal[900],
650
- // colors.teal[700],
651
- l.teal[500],
652
- l.teal[300],
653
- l.gray[700],
654
- l.gray[500],
655
- l.gray[300]
656
- ]
657
- },
658
- options: {
659
- // onClick: onClickFunction,
660
- interaction: {
661
- // intersect: false,
662
- mode: "index"
663
- },
664
- plugins: {
665
- datalabels: {
666
- display: !1,
667
- color: R
668
- },
669
- title: {
670
- display: !0
671
- // text: 'Chart.js Line Chart',
672
- },
673
- tooltip: {
674
- backgroundColor: "#fff",
675
- bodyColor: "#000",
676
- borderWidth: 0.25,
677
- titleColor: "#000",
678
- borderColor: "rgb(128,131,139)",
679
- cornerRadius: 4,
680
- usePointStyle: !0,
681
- pointStyle: "rectRounded",
682
- boxPadding: 4
683
- // mode: 'index',
684
- // intersect: false,
685
- },
686
- legend: {
687
- position: "top",
688
- align: "center",
689
- maxHeight: 0,
690
- labels: {
691
- useBorderRadius: !0,
692
- borderRadius: 2
693
- }
694
- }
695
- },
696
- scales: {
697
- y: {
698
- grid: {
699
- display: !0
700
- },
701
- title: {
702
- display: !0,
703
- text: ""
704
- },
705
- beginAtZero: !0,
706
- ticks: {
707
- precision: 0
708
- }
709
- },
710
- x: {
711
- grid: {
712
- display: !0
713
- },
714
- title: {
715
- display: !0
716
- }
717
- }
718
- },
719
- layout: {
720
- padding: {
721
- top: -40
722
- }
723
- },
724
- borderRadius: 2,
725
- responsive: !0,
726
- //This is the key to getting the chart to resize to fit the parent container.
727
- maintainAspectRatio: !1
728
- //This is the key to getting the chart to resize to fit the parent container.
729
- }
730
- }
731
- },
732
- dark: {
733
- // gridLayout: {
734
- // margin: [2, 2],
735
- // },
736
- chart: {
737
- // font: {
738
- // family:
739
- // 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',
740
- // },
741
- dataset: {
742
- // backgroundColor: [
743
- // colors.blue[500],
744
- // colors.teal[500],
745
- // colors.amber[500],
746
- // colors.red[500],
747
- // colors.indigo[500],
748
- // colors.green[500],
749
- // ],
750
- // borderColor: [
751
- // colors.blue[500],
752
- // colors.teal[500],
753
- // colors.amber[500],
754
- // colors.red[500],
755
- // colors.indigo[500],
756
- // colors.green[500],
757
- // ],
758
- datalables: {
759
- color: R
760
- },
761
- backgroundColor: [
762
- // colors.teal[900],
763
- // colors.teal[700],
764
- l.teal[500],
765
- l.teal[300],
766
- l.gray[700],
767
- l.gray[500],
768
- l.gray[300]
769
- ],
770
- borderColor: [
771
- // colors.teal[900],
772
- // colors.teal[700],
773
- l.teal[500],
774
- l.teal[300],
775
- l.gray[700],
776
- l.gray[500],
777
- l.gray[300]
778
- ]
779
- // backgroundColor: [
780
- // colors.teal[100],
781
- // // colors.blue[500],
782
- // colors.purple[100],
783
- // colors.amber[100],
784
- // colors.orange[100],
785
- // colors.rose[100],
786
- // ],
787
- // borderColor: [
788
- // colors.teal[400],
789
- // // colors.blue[500],
790
- // colors.purple[400],
791
- // colors.amber[400],
792
- // colors.orange[300],
793
- // colors.rose[400],
794
- // ],
795
- // backgroundColor: [
796
- // 'rgb(139, 232, 229)',
797
- // 'rgb(213, 255, 228)',
798
- // 'rgb(210, 224, 251)',
799
- // 'rgb(142, 172, 205)',
800
- // ],
801
- // borderColor: [
802
- // 'rgb(139, 232, 229)',
803
- // 'rgb(213, 255, 228)',
804
- // 'rgb(210, 224, 251)',
805
- // 'rgb(142, 172, 205)',
806
- // ],
807
- },
808
- options: {
809
- plugins: {
810
- tooltip: {
811
- backgroundColor: "#000",
812
- bodyColor: "#fff",
813
- borderWidth: 0.25,
814
- titleColor: "#fff",
815
- borderColor: "rgb(128,131,139)",
816
- cornerRadius: 2,
817
- boxPadding: 4
818
- }
819
- },
820
- datalabels: {
821
- display: !1
822
- },
823
- scales: {
824
- x: {
825
- grid: {
826
- display: !0,
827
- color: l.slate[800]
828
- }
829
- },
830
- y: {
831
- grid: {
832
- display: !0,
833
- color: l.slate[800]
834
- }
835
- }
836
- }
837
- }
838
- }
839
- }
840
- };
841
- function R(e) {
842
- var r, n, i, f, d, o, u, p, c;
843
- const t = (d = (f = (i = (n = (r = e == null ? void 0 : e.chart) == null ? void 0 : r.config) == null ? void 0 : n._config) == null ? void 0 : i.options) == null ? void 0 : f.plugins) == null ? void 0 : d.datalabels;
844
- let a = (o = e == null ? void 0 : e.dataset) == null ? void 0 : o.backgroundColor;
845
- return (t == null ? void 0 : t.align) === "end" && (t == null ? void 0 : t.anchor) === "end" && (a = w((u = e == null ? void 0 : e.chart) == null ? void 0 : u.canvas)), (t == null ? void 0 : t.align) === "start" && (t == null ? void 0 : t.anchor) === "start" && (a = w((p = e == null ? void 0 : e.chart) == null ? void 0 : p.canvas)), fe(a, {
846
- baseColor: w((c = e == null ? void 0 : e.chart) == null ? void 0 : c.canvas)
847
- });
848
- }
849
- function w(e) {
850
- if (typeof document < "u") {
851
- const t = ie(e);
852
- if (t) {
853
- const r = window.getComputedStyle(t).getPropertyValue("--semaphor-background").trim();
854
- return r ? `hsl(${r})` : se(t) === "dark" ? "#000000" : "#FFFFFF";
855
- }
856
- const a = document.documentElement;
857
- if (a.classList.contains("dark"))
858
- return "#000000";
859
- if (a.classList.contains("light"))
860
- return "#FFFFFF";
861
- }
862
- return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "#000000" : "#FFFFFF";
863
- }
864
- function fe(e, t = {}) {
865
- let a = 0, r = 0, n = 0, i = 0;
866
- const f = t.baseColor ? k(t.baseColor) : null, d = (m) => {
867
- if (!m) return l.gray[500];
868
- const y = k(m);
869
- if (!y) return l.gray[500];
870
- const h = D(y, f);
871
- a += h.r, r += h.g, n += h.b, i++;
872
- };
873
- if (Array.isArray(e) ? e.forEach((m) => {
874
- d(m);
875
- }) : d(e), i === 0) return l.gray[500];
876
- const o = a / i, u = r / i, p = n / i;
877
- return (o * 299 + u * 587 + p * 114) / 1e3 >= 180 ? "black" : "white";
878
- }
879
- function D(e, t) {
880
- if (e.alpha >= 1)
881
- return e;
882
- const a = t ? D(t, null) : de;
883
- return {
884
- r: e.r * e.alpha + a.r * (1 - e.alpha),
885
- g: e.g * e.alpha + a.g * (1 - e.alpha),
886
- b: e.b * e.alpha + a.b * (1 - e.alpha)
887
- };
888
- }
889
- const de = {
890
- r: 255,
891
- g: 255,
892
- b: 255
893
- };
894
- function Ge(e) {
895
- const { spec: t, window: a, queryContext: r, reportContext: n } = e;
896
- if (!e.cardId) throw new Error("Matrix query requires its card identity.");
897
- return {
898
- cardId: e.cardId,
899
- cardType: "matrixTable",
900
- cardConfig: { matrix: { spec: t } },
901
- matrixWindowRequest: a,
902
- ...V({ runtimeFilters: r.resolvedFilters, runtimeSorts: e.runtimeSorts }),
903
- active_filters: r.cardFilterValues,
904
- calendarContext: n.calendar,
905
- controlDefinitions: r.controlDefinitions,
906
- cardControlDefinitions: r.cardControlDefinitions,
907
- controlBindings: r.controlBindings,
908
- controlValues: r.controlValues,
909
- // Every request after the acquisition's first carries its state (K14).
910
- ...e.temporalState ? { temporalState: e.temporalState } : {}
911
- };
912
- }
913
- function le(e) {
914
- return (t, a) => {
915
- const r = e.filter((n) => n.field.name === t.name && !!n.field.source && T(n.field.source, t.source ?? a));
916
- return r.length === 1 ? r[0] : void 0;
917
- };
918
- }
919
- function I(e) {
920
- const t = le(e);
921
- return (a, r) => {
922
- var n;
923
- return (n = t(a, r)) == null ? void 0 : n.resolvedField;
924
- };
925
- }
926
- function Le(e) {
927
- const t = I(e);
928
- return (a, r) => a.derivedField ? void 0 : t(a, r);
929
- }
930
- function ce(e, t, a) {
931
- if (e.derivedField) return e.derivedField.dataType;
932
- const r = a.filter((i) => !i.derivedField && i.name === e.name && T(i.source ?? t, e.source ?? t));
933
- return r.length ? new Set(r.map((i) => i.dataType)).size === 1 ? r[0].dataType ?? e.dataType : void 0 : e.dataType;
934
- }
935
- function S(e, t, a) {
936
- var d;
937
- const r = (d = e.config) == null ? void 0 : d.matrix;
938
- if (!r) return [];
939
- const n = I(a), i = (o, u, p) => {
940
- const c = n(o, r.spec.source);
941
- return {
942
- ...c,
943
- source: o.source ?? r.spec.source,
944
- id: u,
945
- name: o.name,
946
- label: p,
947
- dataType: ce(
948
- o,
949
- r.spec.source,
950
- a.map((m) => m.field)
951
- ) ?? "unknown",
952
- qualifiedFieldName: (c == null ? void 0 : c.qualifiedFieldName) ?? o.name,
953
- entityId: (c == null ? void 0 : c.entityId) ?? "",
954
- entityName: (c == null ? void 0 : c.entityName) ?? "",
955
- entityType: (c == null ? void 0 : c.entityType) ?? "table",
956
- ...o.derivedField ? { derivedField: o.derivedField } : {}
957
- };
958
- }, f = t === "groupBy" ? "rows" : t === "pivotBy" ? "columns" : void 0;
959
- return f ? r.spec[f].map((o) => ({
960
- ...i(
961
- o.field,
962
- o.id,
963
- j(o, r.presentation)
964
- ),
965
- granularity: o.grain,
966
- role: f === "rows" ? "groupby" : "pivotby"
967
- })) : t !== "metrics" ? [] : r.spec.measures.map((o) => ({
968
- ...i(
969
- o.kind === "aggregate" ? o.field : {
970
- name: o.definition.name,
971
- derivedField: o.definition
972
- },
973
- o.id,
974
- Q(o, r.presentation)
975
- ),
976
- role: "metric",
977
- ...o.kind === "aggregate" ? { aggregate: o.aggregate } : {}
978
- }));
979
- }
980
- function ue(e) {
981
- return K(e, { authoringDraft: !0 });
982
- }
983
- function pe(e) {
984
- return e.type !== "matrixTable";
985
- }
986
- function O(e) {
987
- var t, a, r, n;
988
- return {
989
- rows: ((t = e.config) == null ? void 0 : t.groupByColumns) ?? [],
990
- columns: ((a = e.config) == null ? void 0 : a.pivotByColumns) ?? [],
991
- metrics: ((r = e.config) == null ? void 0 : r.metricColumns) ?? [],
992
- details: ((n = e.config) == null ? void 0 : n.detailColumns) ?? []
993
- };
994
- }
995
- function _(e, t = []) {
996
- var i, f, d, o, u, p, c, m;
997
- if (pe(e)) {
998
- const y = O(e);
999
- return {
1000
- kind: "shelf",
1001
- status: e.config ? "ready" : "absent",
1002
- fields: y,
1003
- filters: (i = e.config) == null ? void 0 : i.filters,
1004
- joinPlan: (f = e.config) == null ? void 0 : f.joinPlan,
1005
- configured: Object.values(y).some((h) => h.length > 0),
1006
- supportsSql: !0
1007
- };
1008
- }
1009
- const a = ue(e), r = a.status === "ready" ? a.config : void 0, n = { config: { matrix: r } };
1010
- return {
1011
- kind: "matrix",
1012
- status: a.status,
1013
- matrix: r,
1014
- error: a.status === "invalid" ? a.error : void 0,
1015
- get fields() {
1016
- return r ? {
1017
- rows: S(n, "groupBy", t),
1018
- columns: S(n, "pivotBy", t),
1019
- metrics: S(n, "metrics", t),
1020
- details: []
1021
- } : { rows: [], columns: [], metrics: [], details: [] };
1022
- },
1023
- // Repair surfaces must still see authored predicates/joins on an invalid
1024
- // draft. Validity is reported separately; execution uses its strict boundary.
1025
- filters: (u = (o = (d = e.config) == null ? void 0 : d.matrix) == null ? void 0 : o.spec) == null ? void 0 : u.filters,
1026
- joinPlan: (m = (c = (p = e.config) == null ? void 0 : p.matrix) == null ? void 0 : c.spec) == null ? void 0 : m.joinPlan,
1027
- get configured() {
1028
- return N.safeParse(r).success;
1029
- },
1030
- supportsSql: !1
1031
- };
1032
- }
1033
- function ge(e) {
1034
- return e ? Object.values(O({ config: e })).some((t) => t.length > 0) : !1;
1035
- }
1036
- function U(e, t) {
1037
- var n, i;
1038
- if ((n = e.config) != null && n.matrix) return e.config.matrix;
1039
- const a = ((i = e.dataSource) == null ? void 0 : i.selectedEntities) ?? [], r = t ?? (a.length === 1 ? A(a[0], e.dataSource) : void 0);
1040
- if (!r) throw new Error("Select a base dataset before configuring Matrix fields or filters.");
1041
- return H({ source: r, rows: [], columns: [], measures: [], sorts: [], rankings: [] });
1042
- }
1043
- function Ne(e) {
1044
- return _({ type: e }).supportsSql;
1045
- }
1046
- const me = /* @__PURE__ */ new Set([
1047
- "table",
1048
- "pivotTable",
1049
- "aggregateTable",
1050
- "detailTable",
1051
- "matrixTable",
1052
- "kpi"
1053
- ]);
1054
- function Ve(e) {
1055
- return !me.has(e);
1056
- }
1057
- const be = /* @__PURE__ */ new Set(["kpi", "matrixTable"]);
1058
- function We(e) {
1059
- return !be.has(e);
1060
- }
1061
- function je(e, t) {
1062
- return e.type !== t && (e.type === "matrixTable" || t === "matrixTable") ? { config: {}, controlBindings: [], sql: "", python: "" } : {};
1063
- }
1064
- function Qe(e, t) {
1065
- var n, i;
1066
- const a = e.type === "matrixTable" ? (i = (n = e.config) == null ? void 0 : n.matrix) == null ? void 0 : i.spec.source : void 0;
1067
- return !a || (t.selectedEntities ?? []).some((f) => {
1068
- const d = A(f, t);
1069
- return d && T(a, d);
1070
- }) ? { dataSource: t } : { dataSource: t, config: {}, controlBindings: [] };
1071
- }
1072
- function He(e) {
1073
- return _(e).joinPlan;
1074
- }
1075
- function Ke(e, t) {
1076
- var i;
1077
- if (e.type !== "matrixTable") return { ...e.config, joinPlan: t };
1078
- const a = (i = e.config) == null ? void 0 : i.matrix, r = t ? A(t.baseEntity, e.dataSource) : a == null ? void 0 : a.spec.source;
1079
- if (!r) {
1080
- if (!t) return e.config ?? {};
1081
- throw new Error("Matrix joins require a configured base source.");
1082
- }
1083
- const n = U(e, r);
1084
- return { matrix: { ...n, spec: { ...n.spec, source: r, joinPlan: t } } };
1085
- }
1086
- function $e(e) {
1087
- return e ? _(e).filters : void 0;
1088
- }
1089
- function ze(e, t) {
1090
- var r;
1091
- if (e.type !== "matrixTable") return { ...e.config, filters: t };
1092
- if (!t && !((r = e.config) != null && r.matrix)) return e.config ?? {};
1093
- const a = U(e);
1094
- return { matrix: { ...a, spec: { ...a.spec, filters: t } } };
1095
- }
1096
- function ye(e, t) {
1097
- return e ? t ? _({ type: t, config: e }).configured : ge(e) : !1;
1098
- }
1099
- function Je(e, t) {
1100
- var f, d, o;
1101
- if (t != null && t.skipSetupCheck || e.type === "text")
1102
- return !1;
1103
- const a = _(e);
1104
- if (!a.supportsSql) return !a.configured;
1105
- if ((f = e.customCardPreferences) != null && f.url)
1106
- return !1;
1107
- const r = !!(e.connectionId || (d = e.dataSource) != null && d.connectionId), n = !!((o = e.sql) != null && o.trim()), i = ye(e.config);
1108
- return !r || !i && !n;
1109
- }
1110
- export {
1111
- Ye as A,
1112
- Ue as B,
1113
- Oe as C,
1114
- De as D,
1115
- Le as E,
1116
- I as F,
1117
- R as G,
1118
- xe as H,
1119
- O as I,
1120
- S as J,
1121
- U as K,
1122
- Ie as L,
1123
- Pe as M,
1124
- Me as a,
1125
- Je as b,
1126
- _ as c,
1127
- Qe as d,
1128
- je as e,
1129
- qe as f,
1130
- re as g,
1131
- ye as h,
1132
- pe as i,
1133
- Re as j,
1134
- He as k,
1135
- Ke as l,
1136
- ce as m,
1137
- l as n,
1138
- ue as o,
1139
- fe as p,
1140
- w as q,
1141
- Be as r,
1142
- Ne as s,
1143
- $e as t,
1144
- We as u,
1145
- ke as v,
1146
- ze as w,
1147
- Ve as x,
1148
- Ge as y,
1149
- le as z
1150
- };