react-semaphor 0.1.526 → 0.1.528

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 (180) hide show
  1. package/DATA_APP_SDK.md +5 -1
  2. package/dist/analytics-protocol/index.js +1190 -296
  3. package/dist/brand-studio/index.js +15 -15
  4. package/dist/briefings/index.js +50 -49
  5. package/dist/chunks/{calculated-field-identity-D1ofR4KJ.js → calculated-field-identity-DUu-tCQw.js} +66 -65
  6. package/dist/chunks/{card-config-utils-9sv4e-Vb.js → card-config-utils-BdPceiw8.js} +68 -65
  7. package/dist/chunks/{constants-DeLIHVAW.js → constants-DNWVy8Y3.js} +4 -4
  8. package/dist/chunks/dashboard-BkskKMck.js +14 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-DXz1GhFZ.js → dashboard-briefing-launcher-Bb0RhGRC.js} +372 -359
  10. package/dist/chunks/{dashboard-controls-Df8qOSrs.js → dashboard-controls-loWTHPMi.js} +739 -686
  11. package/dist/chunks/{dashboard-json-Xldp0qww.js → dashboard-json-DUci_SOR.js} +10 -10
  12. package/dist/chunks/{edit-dashboard-visual-COHBqyic.js → edit-dashboard-visual-z9WN26w7.js} +6603 -6572
  13. package/dist/chunks/{editor-action-buttons-DahlP57T.js → editor-action-buttons-CGSFK9S-.js} +266 -267
  14. package/dist/chunks/{field-aggregations-BQjogiI1.js → field-aggregations-CdXSo1pb.js} +19 -19
  15. package/dist/chunks/{field-dependencies-v-lJNzC7.js → field-dependencies-CGYic38w.js} +1 -1
  16. package/dist/chunks/{index-CbjuruKe.js → index-CTYnXU85.js} +781 -780
  17. package/dist/chunks/{matrix-analytical-definition-BimC4XIV.js → matrix-analytical-definition-BJyH5-99.js} +1 -1
  18. package/dist/chunks/{matrix-card-CIlz0Dnp.js → matrix-card-DhykwdZs.js} +7 -6
  19. package/dist/chunks/{matrix-control-sources-2VAzGlt8.js → matrix-control-sources-BV9ywFtJ.js} +11 -11
  20. package/dist/chunks/{matrix-definition-E5gXXSTZ.js → matrix-definition-Cdn3LoxW.js} +3 -3
  21. package/dist/chunks/{semantic-format-Baqp8kD_.js → matrix-formatter-1Mm8x8w7.js} +655 -511
  22. package/dist/chunks/{matrix-member-presentation-Bw7-JCrr.js → matrix-member-presentation-BBW0n1iY.js} +1 -1
  23. package/dist/chunks/matrix-operation-contract-Dp7kFpVk.js +1383 -0
  24. package/dist/chunks/{metric-comparison-BphoJ9bq.js → metric-comparison-Crljx_XY.js} +15 -10
  25. package/dist/chunks/{numeric-presentation-VhMUHfrJ.js → numeric-presentation-LvnNY5Ma.js} +68 -68
  26. package/dist/chunks/pivot-header-presentation-CZa3556D.js +618 -0
  27. package/dist/chunks/{pivot-result-identity-BzUQiCEV.js → pivot-result-identity-CY__BuwI.js} +1 -1
  28. package/dist/chunks/{pivot-result-lifecycle-BFO354lk.js → pivot-result-lifecycle-Bqdtknud.js} +259 -204
  29. package/dist/chunks/{raw-temporal-7bFbXd2a.js → raw-temporal-CdnA_OXJ.js} +10 -10
  30. package/dist/chunks/{raw-temporal-contract-BQZIJ1fn.js → raw-temporal-contract-Bc9z83t-.js} +1 -1
  31. package/dist/chunks/relative-date-DAF9J7mt.js +456 -0
  32. package/dist/chunks/{report-preferences-dialog-BcH-0lR-.js → report-preferences-dialog-VV0-Ro6F.js} +131 -132
  33. package/dist/chunks/{report-runtime-context-CxIoGyNM.js → report-runtime-context-CtaGGlit.js} +1 -1
  34. package/dist/chunks/{selection-reducer-NF5C07yM.js → selection-reducer-IZjBSU6Z.js} +47 -26
  35. package/dist/chunks/semantic-format-BBLvfwua.js +192 -0
  36. package/dist/chunks/{semaphor-ready-indicator-BLRDuLr4.js → semaphor-ready-indicator-DbA4mVQL.js} +49909 -46207
  37. package/dist/chunks/{slider-BYIH4icg.js → slider-DpiJG8lv.js} +81 -82
  38. package/dist/chunks/{source-entity-resolution-Bzefiive.js → source-entity-resolution-Bde29mqE.js} +25 -25
  39. package/dist/chunks/switch-C4YH-W1X.js +24003 -0
  40. package/dist/chunks/{temporal-bucket-PcLFSYWX.js → temporal-bucket-DlFuhCnT.js} +6 -6
  41. package/dist/chunks/{temporal-bucket-contract-DTLDRzgV.js → temporal-bucket-contract-C6lUGPS3.js} +1 -1
  42. package/dist/chunks/temporal-input-presentation-DyMWCZYh.js +195 -0
  43. package/dist/chunks/{token-types-BC6RcUY8.js → token-types-UjyNz95-.js} +1 -1
  44. package/dist/chunks/{validators-CsdOtZI6.js → validators-CQcG0EPN.js} +852 -731
  45. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  46. package/dist/dashboard/index.js +1 -1
  47. package/dist/dashboard-authoring/index.js +138 -137
  48. package/dist/data-app-sdk/index.js +12 -12
  49. package/dist/data-app-sdk-adapters/index.js +23 -22
  50. package/dist/data-app-sdk-validation/index.js +27 -26
  51. package/dist/format-utils/index.js +247 -329
  52. package/dist/index.js +165 -168
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +1 -1
  56. package/dist/types/briefings/index.d.ts +3 -0
  57. package/dist/types/components/explorer/filters/card-date-filter.d.ts +13 -5
  58. package/dist/types/components/explorer/filters/card-date-selection.d.ts +28 -0
  59. package/dist/types/components/sharing-and-management/dashboard-actions-menu.d.ts +1 -1
  60. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -1
  61. package/dist/types/components/surfboard/download-settings-dialog.d.ts +8 -0
  62. package/dist/types/components/surfboard/filter/types.d.ts +8 -29
  63. package/dist/types/components/surfboard/filter/use-dashboard-filter-mapping-popover.d.ts +5 -1
  64. package/dist/types/components/ui-custom/date-range-picker.d.ts +18 -2
  65. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -21
  66. package/dist/types/components/ui-custom/report-calendar.d.ts +18 -0
  67. package/dist/types/components/visual/aggregated-table/utils/export-utils.d.ts +3 -5
  68. package/dist/types/components/visual/data-table/data-table-toolbar.d.ts +1 -1
  69. package/dist/types/components/visual/pivot-table/utils/pivot-table-export-utils.d.ts +3 -1
  70. package/dist/types/index.js +5 -5
  71. package/dist/types/lib/api/exports-api.d.ts +3 -0
  72. package/dist/types/lib/csv-download.d.ts +9 -0
  73. package/dist/types/lib/csv-encoding-options.d.ts +6 -0
  74. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +2 -1
  75. package/dist/types/lib/dashboard-navigation/build-carried-click-context.d.ts +0 -1
  76. package/dist/types/lib/document/document-input-runtime.d.ts +2 -1
  77. package/dist/types/lib/export-utils.d.ts +17 -15
  78. package/dist/types/lib/hooks/explorer/use-filter-builder.d.ts +2 -2
  79. package/dist/types/lib/hooks/use-relative-date-summarizer.d.ts +7 -0
  80. package/dist/types/lib/matrix-table/matrix-application-adapter.d.ts +3 -2
  81. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  82. package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +1 -1
  83. package/dist/types/lib/matrix-table/matrix-dataset-history.d.ts +47 -0
  84. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +7 -3
  85. package/dist/types/lib/matrix-table/matrix-execution-context.d.ts +2 -0
  86. package/dist/types/lib/matrix-table/matrix-query-transport.d.ts +4 -1
  87. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +105 -4
  88. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +43 -2
  89. package/dist/types/lib/matrix-table/use-matrix.d.ts +6 -0
  90. package/dist/types/lib/query-context/build-card-query-context.d.ts +5 -1
  91. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +0 -1
  92. package/dist/types/lib/query-context/build-global-date-comparison-context.d.ts +1 -2
  93. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +1 -2
  94. package/dist/types/lib/query-context/dashboard-card-query-key.d.ts +10 -0
  95. package/dist/types/lib/query-context/query-auth-scope.d.ts +5 -0
  96. package/dist/types/lib/stores/dashboard-store.d.ts +9 -4
  97. package/dist/types/lib/temporal-filter/temporal-filter-utils.d.ts +9 -2
  98. package/dist/types/lib/types/common-types.d.ts +5 -0
  99. package/dist/types/lib/types/explorer-types.d.ts +14 -0
  100. package/dist/types/lib/types/semantic-types.d.ts +4 -2
  101. package/dist/types/lib/types/token-types.d.ts +0 -1
  102. package/dist/types/lib/utils/aggregate-expression-utils.d.ts +0 -4
  103. package/dist/types/lib/utils/card-definition.d.ts +1 -1
  104. package/dist/types/lib/utils/date-timezone-utils.d.ts +4 -46
  105. package/dist/types/lib/utils/filter-default-value-utils.d.ts +8 -2
  106. package/dist/types/lib/utils/inline-filter-utils.d.ts +3 -2
  107. package/dist/types/lib/utils/relative-date-description.d.ts +38 -0
  108. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +89 -0
  109. package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +32 -0
  110. package/dist/types/shared/analytics-protocol/contracts.d.ts +48 -7
  111. package/dist/types/shared/analytics-protocol/index.d.ts +15 -1
  112. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +20 -20
  113. package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +10 -10
  114. package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +8 -8
  115. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +61 -6
  116. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +63 -0
  117. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +9 -3
  118. package/dist/types/shared/analytics-protocol/operation-temporal-state.d.ts +64 -0
  119. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +61 -0
  120. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +20 -0
  121. package/dist/types/shared/analytics-protocol/runtime-schemas.d.ts +0 -2
  122. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +314 -0
  123. package/dist/types/shared/analytics-protocol/time-window.d.ts +13 -0
  124. package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +8 -4
  125. package/dist/types/shared/format-utils/exporters/csv-utils.d.ts +46 -15
  126. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -3
  127. package/dist/types/shared/format-utils/flat-table-export-totals.d.ts +2 -1
  128. package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +2 -2
  129. package/dist/types/shared/format-utils/types/format-types.d.ts +0 -42
  130. package/dist/types/shared/temporal/calendar-periods.d.ts +56 -0
  131. package/dist/types/shared/temporal/index.d.ts +5 -0
  132. package/dist/types/shared/temporal/relative-date.d.ts +21 -0
  133. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +73 -0
  134. package/dist/types/shared/temporal/time-window-periods.d.ts +21 -0
  135. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +23 -0
  136. package/package.json +1 -17
  137. package/src/data-app-sdk/README.md +6 -3
  138. package/dist/chunks/code-highlight-994tgM9v.js +0 -22265
  139. package/dist/chunks/dashboard-CsHvEtjN.js +0 -15
  140. package/dist/chunks/dashboard-date-comparison-definition-BqNhECUr.js +0 -183
  141. package/dist/chunks/matrix-formatter-WBgtebUT.js +0 -341
  142. package/dist/chunks/matrix-operation-contract-D32U2CSw.js +0 -1802
  143. package/dist/chunks/mouse-pointer-2-BZvGk45-.js +0 -19
  144. package/dist/chunks/pivot-header-presentation-CGtudHo7.js +0 -661
  145. package/dist/chunks/pre-block-Cq1RqhZX.js +0 -3987
  146. package/dist/chunks/search-CJz-QQ0Q.js +0 -24
  147. package/dist/chunks/switch-XaAACBrJ.js +0 -2234
  148. package/dist/chunks/temporal-input-presentation-2RJrvmYL.js +0 -222
  149. package/dist/chunks/update-policy-DhAUtiC8.js +0 -913
  150. package/dist/data-app-builder/index.js +0 -3666
  151. package/dist/data-app-builder-browser-runtime/index.js +0 -8
  152. package/dist/data-app-codegen/index.js +0 -22
  153. package/dist/data-app-codegen-node/index.js +0 -1807
  154. package/dist/types/components/data-app-runtime/published-data-app-runtime.d.ts +0 -7
  155. package/dist/types/components/surfboard/json-to-csv.d.ts +0 -7
  156. package/dist/types/components/visual/data-table/utils/export-utils.d.ts +0 -31
  157. package/dist/types/data-app-builder/browser-runtime.d.ts +0 -174
  158. package/dist/types/data-app-builder/constants.d.ts +0 -14
  159. package/dist/types/data-app-builder/data-app-builder.d.ts +0 -14
  160. package/dist/types/data-app-builder/index.d.ts +0 -1
  161. package/dist/types/data-app-builder/lib/api.d.ts +0 -36
  162. package/dist/types/data-app-builder/lib/context-select.d.ts +0 -3
  163. package/dist/types/data-app-builder/lib/diagnostics.d.ts +0 -12
  164. package/dist/types/data-app-builder/lib/file-tree.d.ts +0 -2
  165. package/dist/types/data-app-builder/types.d.ts +0 -558
  166. package/dist/types/data-app-builder-browser-runtime.d.ts +0 -2
  167. package/dist/types/data-app-builder.d.ts +0 -2
  168. package/dist/types/data-app-codegen/generate-contract.d.ts +0 -26
  169. package/dist/types/data-app-codegen/generated-contract-files.d.ts +0 -7
  170. package/dist/types/data-app-codegen/generated-contract-validation.d.ts +0 -13
  171. package/dist/types/data-app-codegen/index.d.ts +0 -6
  172. package/dist/types/data-app-codegen/live-execution.d.ts +0 -42
  173. package/dist/types/data-app-codegen/node.d.ts +0 -2
  174. package/dist/types/data-app-codegen/update-policy.d.ts +0 -25
  175. package/dist/types/data-app-codegen/validation.d.ts +0 -8
  176. package/dist/types/data-app-codegen-node.d.ts +0 -2
  177. package/dist/types/data-app-codegen.d.ts +0 -2
  178. package/dist/types/shared/analytics-protocol/data-app-codegen-summary.d.ts +0 -418
  179. package/dist/types/shared/format-utils/exporters/pivot-exporter.d.ts +0 -13
  180. package/dist/types/shared/format-utils/exporters/table-exporter.d.ts +0 -10
@@ -1,16 +1,56 @@
1
- var E = Object.defineProperty;
2
- var _ = (e, o, t) => o in e ? E(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
3
- var f = (e, o, t) => _(e, typeof o != "symbol" ? o + "" : o, t);
4
- import { p as K, i as S } from "./raw-temporal-7bFbXd2a.js";
5
- import { b as F } from "./report-runtime-context-CxIoGyNM.js";
6
- import { k as j } from "./numeric-presentation-VhMUHfrJ.js";
7
- import { i as u, d as M } from "./temporal-bucket-PcLFSYWX.js";
8
- import { a7 as P } from "./validators-CsdOtZI6.js";
9
- import "./matrix-operation-contract-D32U2CSw.js";
10
- import { a as T } from "./metric-comparison-BphoJ9bq.js";
11
- import { a as O } from "./temporal-bucket-contract-DTLDRzgV.js";
12
- import { d as U, P as q } from "./pivot-result-identity-BzUQiCEV.js";
13
- class I extends Error {
1
+ var _ = Object.defineProperty;
2
+ var K = (e, o, t) => o in e ? _(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
3
+ var f = (e, o, t) => K(e, typeof o != "symbol" ? o + "" : o, t);
4
+ import { p as F, i as j } from "./raw-temporal-CdnA_OXJ.js";
5
+ import { b as M } from "./report-runtime-context-CtaGGlit.js";
6
+ import { k as T } from "./numeric-presentation-LvnNY5Ma.js";
7
+ import { d as u, b as P } from "./temporal-bucket-DlFuhCnT.js";
8
+ import { S as O } from "./validators-CQcG0EPN.js";
9
+ import "./matrix-operation-contract-Dp7kFpVk.js";
10
+ import { r as U } from "./metric-comparison-Crljx_XY.js";
11
+ import "zod";
12
+ import { a as q } from "./temporal-bucket-contract-C6lUGPS3.js";
13
+ import { d as N, P as D } from "./pivot-result-identity-CY__BuwI.js";
14
+ const B = ["utf-8-bom", "utf-8"], V = "utf-8-bom", z = [",", ";", " "], J = `\r
15
+ `, Ee = "text/csv; charset=utf-8";
16
+ function Ae(e) {
17
+ return e == null || typeof e == "string" || typeof e == "number" ? e : typeof e == "object" ? JSON.stringify(e) : String(e);
18
+ }
19
+ const L = "\uFEFF";
20
+ function I(e) {
21
+ return B.find((o) => o === e);
22
+ }
23
+ function ke(e) {
24
+ return z.find((o) => o === e);
25
+ }
26
+ function $e(e) {
27
+ return I(e.requested) ?? I(e.dashboardDefault) ?? V;
28
+ }
29
+ function G(e) {
30
+ return e === "utf-8-bom" ? L : "";
31
+ }
32
+ function Se(e) {
33
+ const o = e.trimStart().charAt(0);
34
+ return ["=", "+", "-", "@"].includes(o) || [" ", "\r", `
35
+ `].includes(e.charAt(0)) ? `'${e}` : e;
36
+ }
37
+ function Y(e, o = ",") {
38
+ if (e == null)
39
+ return "";
40
+ const t = String(e);
41
+ return t.includes(o) || t.includes('"') || t.includes(`
42
+ `) || t.includes("\r") ? `"${t.replace(/"/g, '""')}"` : t;
43
+ }
44
+ function S(e, o) {
45
+ return e.map((t) => Y(t, o)).join(o) + J;
46
+ }
47
+ function H(e, o) {
48
+ return e.map((t) => S(t, o)).join("");
49
+ }
50
+ function _e(e) {
51
+ return G(e.encoding) + (e.header ? S(e.header, e.delimiter) : "") + H(e.rows, e.delimiter);
52
+ }
53
+ class C extends Error {
14
54
  constructor(t) {
15
55
  super(
16
56
  `invalid_presentation_execution_snapshot: ${t} Resave this report before running it again.`
@@ -20,7 +60,7 @@ class I extends Error {
20
60
  this.name = "PresentationExecutionSnapshotError";
21
61
  }
22
62
  }
23
- class pe extends Error {
63
+ class Ke extends Error {
24
64
  constructor(t) {
25
65
  super(
26
66
  `missing_resolved_raw_temporal_format: Column "${t}" has no captured presentation. Resave this report before running it again.`
@@ -31,11 +71,11 @@ class pe extends Error {
31
71
  }
32
72
  }
33
73
  function v(e, o, t) {
34
- const s = new Set(o), r = Object.keys(e).find((i) => !s.has(i));
74
+ const n = new Set(o), r = Object.keys(e).find((s) => !n.has(s));
35
75
  if (r)
36
76
  throw new Error(`${t} contains unknown property "${r}"`);
37
77
  }
38
- function N(e, o = "scope") {
78
+ function Q(e, o = "scope") {
39
79
  if (!u(e))
40
80
  throw new Error(`${o} must be an object`);
41
81
  v(
@@ -46,8 +86,8 @@ function N(e, o = "scope") {
46
86
  const t = typeof e.dashboardId == "string" ? e.dashboardId.trim() : "";
47
87
  if (!t)
48
88
  throw new Error(`${o}.dashboardId is required`);
49
- const s = typeof e.cardId == "string" ? e.cardId.trim() : void 0;
50
- if (e.cardId !== void 0 && !s)
89
+ const n = typeof e.cardId == "string" ? e.cardId.trim() : void 0;
90
+ if (e.cardId !== void 0 && !n)
51
91
  throw new Error(`${o}.cardId must be a non-empty string`);
52
92
  const r = e.attachmentIndex;
53
93
  if (r !== void 0 && (typeof r != "number" || !Number.isInteger(r) || r < 0))
@@ -56,25 +96,25 @@ function N(e, o = "scope") {
56
96
  );
57
97
  return {
58
98
  dashboardId: t,
59
- ...s ? { cardId: s } : {},
99
+ ...n ? { cardId: n } : {},
60
100
  ...typeof r == "number" ? { attachmentIndex: r } : {}
61
101
  };
62
102
  }
63
- function y(e, o, t, s) {
103
+ function y(e, o, t, n) {
64
104
  if (e.kind !== o) return;
65
- v(e, ["kind", t], s);
105
+ v(e, ["kind", t], n);
66
106
  const r = typeof e[t] == "string" ? e[t].trim() : "";
67
107
  if (!r)
68
- throw new Error(`${s}.${t} is required`);
108
+ throw new Error(`${n}.${t} is required`);
69
109
  return r;
70
110
  }
71
- function k(e, o) {
111
+ function R(e, o) {
72
112
  if (!u(e))
73
113
  throw new Error(`${o} must be an object`);
74
114
  const t = y(e, "metric", "metricId", o);
75
115
  if (t) return { kind: "metric", metricId: t };
76
- const s = y(e, "column", "columnKey", o);
77
- if (s) return { kind: "column", columnKey: s };
116
+ const n = y(e, "column", "columnKey", o);
117
+ if (n) return { kind: "column", columnKey: n };
78
118
  const r = y(
79
119
  e,
80
120
  "matrix_measure",
@@ -84,7 +124,7 @@ function k(e, o) {
84
124
  if (r) return { kind: "matrix_measure", measureId: r };
85
125
  throw new Error(`${o} is not a valid numeric presentation target`);
86
126
  }
87
- const B = [
127
+ const W = [
88
128
  "type",
89
129
  "inputUnit",
90
130
  "outputStyle",
@@ -95,23 +135,23 @@ const B = [
95
135
  "suffix",
96
136
  "negativeStyle"
97
137
  ];
98
- function D(e) {
138
+ function X(e) {
99
139
  return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
100
140
  }
101
- function z(e, o) {
102
- v(e, B, o);
103
- for (const i of ["inputUnit", "largestUnit", "smallestUnit"])
104
- if (e[i] !== void 0 && !D(e[i]))
105
- throw new Error(`${o}.${i} must be a duration unit`);
141
+ function Z(e, o) {
142
+ v(e, W, o);
143
+ for (const s of ["inputUnit", "largestUnit", "smallestUnit"])
144
+ if (e[s] !== void 0 && !X(e[s]))
145
+ throw new Error(`${o}.${s} must be a duration unit`);
106
146
  const t = e.outputStyle;
107
147
  if (t !== void 0 && t !== "compact" && t !== "digital" && t !== "long")
108
148
  throw new Error(`${o}.outputStyle must be compact, digital, or long`);
109
- const s = e.maxUnits;
110
- if (s !== void 0 && (typeof s != "number" || !Number.isInteger(s) || s < 0 || s > 10))
149
+ const n = e.maxUnits;
150
+ if (n !== void 0 && (typeof n != "number" || !Number.isInteger(n) || n < 0 || n > 10))
111
151
  throw new Error(`${o}.maxUnits must be an integer from 0 to 10`);
112
- for (const i of ["prefix", "suffix"])
113
- if (e[i] !== void 0 && typeof e[i] != "string")
114
- throw new Error(`${o}.${i} must be a string`);
152
+ for (const s of ["prefix", "suffix"])
153
+ if (e[s] !== void 0 && typeof e[s] != "string")
154
+ throw new Error(`${o}.${s} must be a string`);
115
155
  const r = e.negativeStyle;
116
156
  if (r !== void 0 && r !== "minus" && r !== "parentheses")
117
157
  throw new Error(`${o}.negativeStyle must be minus or parentheses`);
@@ -121,13 +161,13 @@ function z(e, o) {
121
161
  ...t !== void 0 ? { outputStyle: t } : {},
122
162
  ...e.largestUnit !== void 0 ? { largestUnit: e.largestUnit } : {},
123
163
  ...e.smallestUnit !== void 0 ? { smallestUnit: e.smallestUnit } : {},
124
- ...s !== void 0 ? { maxUnits: s } : {},
164
+ ...n !== void 0 ? { maxUnits: n } : {},
125
165
  ...e.prefix !== void 0 ? { prefix: e.prefix } : {},
126
166
  ...e.suffix !== void 0 ? { suffix: e.suffix } : {},
127
167
  ...r !== void 0 ? { negativeStyle: r } : {}
128
168
  };
129
169
  }
130
- function J(e, o) {
170
+ function ee(e, o) {
131
171
  if (!u(e))
132
172
  throw new Error(`${o} must be an object`);
133
173
  if (e.kind === "field") {
@@ -135,27 +175,27 @@ function J(e, o) {
135
175
  const r = typeof e.fieldId == "string" ? e.fieldId.trim() : "";
136
176
  if (!r)
137
177
  throw new Error(`${o}.fieldId is required`);
138
- const i = e.role;
139
- if (i !== void 0 && i !== "groupby" && i !== "pivotby")
178
+ const s = e.role;
179
+ if (s !== void 0 && s !== "groupby" && s !== "pivotby")
140
180
  throw new Error(`${o}.role must be groupby or pivotby`);
141
181
  return {
142
182
  kind: "field",
143
183
  fieldId: r,
144
- ...i ? { role: i } : {}
184
+ ...s ? { role: s } : {}
145
185
  };
146
186
  }
147
187
  const t = y(e, "column", "columnKey", o);
148
188
  if (t) return { kind: "column", columnKey: t };
149
- const s = y(
189
+ const n = y(
150
190
  e,
151
191
  "matrix_axis",
152
192
  "axisInstanceId",
153
193
  o
154
194
  );
155
- if (s) return { kind: "matrix_axis", axisInstanceId: s };
195
+ if (n) return { kind: "matrix_axis", axisInstanceId: n };
156
196
  throw new Error(`${o} is not a valid temporal bucket presentation target`);
157
197
  }
158
- function L(e, o) {
198
+ function te(e, o) {
159
199
  if (!u(e))
160
200
  throw new Error(`${o} must be an object`);
161
201
  const t = y(e, "column", "columnKey", o);
@@ -163,7 +203,7 @@ function L(e, o) {
163
203
  throw new Error(`${o} must identify a column`);
164
204
  return { kind: "column", columnKey: t };
165
205
  }
166
- function V(e) {
206
+ function oe(e) {
167
207
  return [
168
208
  e.dashboardId,
169
209
  e.cardId ?? null,
@@ -188,65 +228,65 @@ function b(e, o) {
188
228
  return e.dashboardId === o.dashboardId && e.cardId === o.cardId && e.attachmentIndex === o.attachmentIndex;
189
229
  }
190
230
  function g(e, o) {
191
- const t = h(e), s = h(o);
192
- return t.length === s.length && t.every((r, i) => r === s[i]);
231
+ const t = h(e), n = h(o);
232
+ return t.length === n.length && t.every((r, s) => r === n[s]);
193
233
  }
194
- function G(e) {
234
+ function re(e) {
195
235
  if (!Array.isArray(e))
196
236
  throw new Error("resolvedFormats must be an array");
197
237
  const o = /* @__PURE__ */ new Set();
198
- return e.map((t, s) => {
238
+ return e.map((t, n) => {
199
239
  var m, p;
200
- const r = `resolvedFormats.${s}`;
240
+ const r = `resolvedFormats.${n}`;
201
241
  if (!u(t))
202
242
  throw new Error(`${r} must be an object`);
203
243
  v(t, ["scope", "target", "format"], r);
204
- const i = N(t.scope, `${r}.scope`);
244
+ const s = Q(t.scope, `${r}.scope`);
205
245
  if (!u(t.format))
206
246
  throw new Error(`${r}.format must be an object`);
207
- let n;
247
+ let i;
208
248
  switch (t.format.type) {
209
249
  case "temporal_bucket": {
210
- const l = M(t.format);
250
+ const l = P(t.format);
211
251
  if (!l.ok)
212
252
  throw new Error(
213
253
  `${r}.format is invalid: ${((m = l.issues[0]) == null ? void 0 : m.message) ?? "invalid value"}`
214
254
  );
215
- n = {
216
- scope: i,
217
- target: J(t.target, `${r}.target`),
255
+ i = {
256
+ scope: s,
257
+ target: ee(t.target, `${r}.target`),
218
258
  format: l.value
219
259
  };
220
260
  break;
221
261
  }
222
262
  case "raw_temporal":
223
- n = {
224
- scope: i,
225
- target: L(t.target, `${r}.target`),
226
- format: K(t.format)
263
+ i = {
264
+ scope: s,
265
+ target: te(t.target, `${r}.target`),
266
+ format: F(t.format)
227
267
  };
228
268
  break;
229
269
  case "number":
230
270
  case "currency":
231
271
  case "percent":
232
272
  case "scientific": {
233
- const l = j(t.format);
273
+ const l = T(t.format);
234
274
  if (!l.ok)
235
275
  throw new Error(
236
276
  `${r}.format is invalid: ${((p = l.issues[0]) == null ? void 0 : p.message) ?? "invalid value"}`
237
277
  );
238
- n = {
239
- scope: i,
240
- target: k(t.target, `${r}.target`),
278
+ i = {
279
+ scope: s,
280
+ target: R(t.target, `${r}.target`),
241
281
  format: l.value
242
282
  };
243
283
  break;
244
284
  }
245
285
  case "duration":
246
- n = {
247
- scope: i,
248
- target: k(t.target, `${r}.target`),
249
- format: z(
286
+ i = {
287
+ scope: s,
288
+ target: R(t.target, `${r}.target`),
289
+ format: Z(
250
290
  t.format,
251
291
  `${r}.format`
252
292
  )
@@ -256,17 +296,17 @@ function G(e) {
256
296
  throw new Error(`${r}.format.type is unsupported`);
257
297
  }
258
298
  const c = JSON.stringify([
259
- ...V(n.scope),
260
- ...h(n.target)
299
+ ...oe(i.scope),
300
+ ...h(i.target)
261
301
  ]);
262
302
  if (o.has(c))
263
303
  throw new Error(
264
304
  `${r} duplicates a scoped presentation target`
265
305
  );
266
- return o.add(c), n;
306
+ return o.add(c), i;
267
307
  });
268
308
  }
269
- function H(e) {
309
+ function ne(e) {
270
310
  try {
271
311
  if (!u(e))
272
312
  throw new Error("presentation execution snapshot must be an object");
@@ -276,7 +316,7 @@ function H(e) {
276
316
  "presentation execution snapshot"
277
317
  ), e.version !== 1)
278
318
  throw new Error("presentation execution snapshot version must be 1");
279
- const o = F(e.reportContext);
319
+ const o = M(e.reportContext);
280
320
  if (!o.ok) {
281
321
  const t = o.issues[0];
282
322
  throw new Error(
@@ -286,82 +326,82 @@ function H(e) {
286
326
  return {
287
327
  version: 1,
288
328
  reportContext: o.value,
289
- resolvedFormats: G(e.resolvedFormats)
329
+ resolvedFormats: re(e.resolvedFormats)
290
330
  };
291
331
  } catch (o) {
292
- throw o instanceof I ? o : new I(
332
+ throw o instanceof C ? o : new C(
293
333
  o instanceof Error ? o.message : "Snapshot is invalid."
294
334
  );
295
335
  }
296
336
  }
297
- function ye(e) {
298
- return H({
337
+ function Fe(e) {
338
+ return ne({
299
339
  version: 1,
300
340
  reportContext: e.reportContext,
301
341
  resolvedFormats: [...e.resolvedFormats]
302
342
  });
303
343
  }
304
- function ve(e) {
305
- const o = Y(e);
306
- return S(o) ? o : void 0;
344
+ function je(e) {
345
+ const o = se(e);
346
+ return j(o) ? o : void 0;
307
347
  }
308
- function Y(e) {
348
+ function se(e) {
309
349
  const o = e.snapshot.resolvedFormats.find(
310
350
  (t) => t.format.type !== "temporal_bucket" && t.format.type !== "raw_temporal" && b(t.scope, e.scope) && g(t.target, e.target)
311
351
  );
312
352
  return o == null ? void 0 : o.format;
313
353
  }
314
- function we(e) {
354
+ function Me(e) {
315
355
  const o = e.snapshot.resolvedFormats.find(
316
356
  (t) => t.format.type === "raw_temporal" && b(t.scope, e.scope) && g(t.target, e.target)
317
357
  );
318
358
  return o == null ? void 0 : o.format;
319
359
  }
320
- function he(e) {
360
+ function Te(e) {
321
361
  const o = e.snapshot.resolvedFormats.find(
322
362
  (t) => t.format.type === "temporal_bucket" && b(t.scope, e.scope) && g(t.target, e.target)
323
363
  );
324
364
  return o == null ? void 0 : o.format;
325
365
  }
326
- function be(e) {
366
+ function Pe(e) {
327
367
  var r;
328
368
  const o = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
329
- if (e.snapshot.resolvedFormats.forEach((i, n) => {
330
- if (i.scope.attachmentIndex !== void 0)
369
+ if (e.snapshot.resolvedFormats.forEach((s, i) => {
370
+ if (s.scope.attachmentIndex !== void 0)
331
371
  throw new Error(
332
- `resolvedFormats.${n}.scope.attachmentIndex is not valid for a card export`
372
+ `resolvedFormats.${i}.scope.attachmentIndex is not valid for a card export`
333
373
  );
334
- if (i.scope.dashboardId !== e.expectedScope.dashboardId || i.scope.cardId !== e.expectedScope.cardId)
374
+ if (s.scope.dashboardId !== e.expectedScope.dashboardId || s.scope.cardId !== e.expectedScope.cardId)
335
375
  throw new Error(
336
- `resolvedFormats.${n}.scope must match the executing dashboard/card`
376
+ `resolvedFormats.${i}.scope must match the executing dashboard/card`
337
377
  );
338
- if (i.target.kind === "field" && i.format.type === "temporal_bucket") {
339
- const c = JSON.stringify(h(i.target));
378
+ if (s.target.kind === "field" && s.format.type === "temporal_bucket") {
379
+ const c = JSON.stringify(h(s.target));
340
380
  if (t.has(c))
341
381
  throw new Error(
342
- `resolvedFormats.${n} duplicates export field "${i.target.fieldId}"`
382
+ `resolvedFormats.${i} duplicates export field "${s.target.fieldId}"`
343
383
  );
344
384
  t.add(c);
345
385
  return;
346
386
  }
347
- if (i.target.kind !== "column")
387
+ if (s.target.kind !== "column")
348
388
  throw new Error(
349
- `resolvedFormats.${n}.target must identify an export column or temporal pivot field`
389
+ `resolvedFormats.${i}.target must identify an export column or temporal pivot field`
350
390
  );
351
- if (o.has(i.target.columnKey))
391
+ if (o.has(s.target.columnKey))
352
392
  throw new Error(
353
- `resolvedFormats.${n} duplicates export column "${i.target.columnKey}"`
393
+ `resolvedFormats.${i} duplicates export column "${s.target.columnKey}"`
354
394
  );
355
- o.add(i.target.columnKey);
395
+ o.add(s.target.columnKey);
356
396
  }), !e.useFormattedValues) return;
357
397
  if (!((r = e.visibleColumns) != null && r.length))
358
398
  throw new Error("visibleColumns must identify every formatted export column");
359
- const s = e.visibleColumns.find(
360
- (i) => !o.has(i)
399
+ const n = e.visibleColumns.find(
400
+ (s) => !o.has(s)
361
401
  );
362
- if (s)
402
+ if (n)
363
403
  throw new Error(
364
- `resolvedFormats is missing visible export column "${s}"`
404
+ `resolvedFormats is missing visible export column "${n}"`
365
405
  );
366
406
  }
367
407
  function w(e) {
@@ -373,35 +413,35 @@ function w(e) {
373
413
  )
374
414
  );
375
415
  }
376
- function Q(e) {
416
+ function ie(e) {
377
417
  const o = /* @__PURE__ */ new Map();
378
418
  return e.forEach((t) => {
379
419
  t.id && o.set(t.id, (o.get(t.id) ?? 0) + 1);
380
420
  }), e.flatMap(
381
- (t) => t.id && (o.get(t.id) ?? 0) > 1 ? [T(t)] : []
421
+ (t) => t.id && (o.get(t.id) ?? 0) > 1 ? [U(t)] : []
382
422
  );
383
423
  }
384
- function ge(e) {
424
+ function Oe(e) {
385
425
  const o = e.metricFields ?? [], t = w(o);
386
426
  return {
387
427
  expectedRoleFieldIds: {
388
428
  groupby: w(e.groupByFields),
389
- metric: t.length > 0 ? t : [P],
429
+ metric: t.length > 0 ? t : [O],
390
430
  pivotby: w(e.pivotByFields),
391
431
  detail: w(e.detailFields)
392
432
  },
393
- expectedMetricAliases: Q(o)
433
+ expectedMetricAliases: ie(o)
394
434
  };
395
435
  }
396
436
  class a extends Error {
397
- constructor(t, s) {
437
+ constructor(t, n) {
398
438
  super(`invalid_pivot_result_lifecycle: ${t}`);
399
439
  f(this, "code", "invalid_pivot_result_lifecycle");
400
440
  f(this, "deliveryBlocking", !0);
401
- this.cause = s, this.name = "PivotResultLifecycleError";
441
+ this.cause = n, this.name = "PivotResultLifecycleError";
402
442
  }
403
443
  }
404
- function W(e) {
444
+ function ae(e) {
405
445
  if (!Array.isArray(e) || e.some(
406
446
  (t) => !t || typeof t != "object" || Array.isArray(t) || typeof t.key != "string" || !t.key || typeof t.name != "string" || typeof t.label != "string"
407
447
  ))
@@ -414,31 +454,31 @@ function W(e) {
414
454
  "Canonical pivot column keys must be unique."
415
455
  );
416
456
  for (const t of o) {
417
- const s = O(t, {
457
+ const n = q(t, {
418
458
  metadataRequired: !1
419
459
  });
420
- if (!s.ok)
460
+ if (!n.ok)
421
461
  throw new a(
422
- `Canonical pivot column "${t.key}" has invalid temporal metadata: ${s.error.message}`
462
+ `Canonical pivot column "${t.key}" has invalid temporal metadata: ${n.error.message}`
423
463
  );
424
464
  }
425
465
  return o;
426
466
  }
427
- function R(e) {
467
+ function E(e) {
428
468
  if (!e || typeof e != "object" || Array.isArray(e) || e.version !== 1 || e.source !== "explorer" || !e.byRole || typeof e.byRole != "object" || Array.isArray(e.byRole))
429
469
  throw new a(
430
470
  "A loaded canonical pivot result requires its role-scoped column key map."
431
471
  );
432
472
  const o = e, t = /* @__PURE__ */ new Set(["groupby", "metric", "pivotby", "detail"]);
433
- for (const [s, r] of Object.entries(o.byRole)) {
434
- if (!t.has(s) || !r || typeof r != "object" || Array.isArray(r))
473
+ for (const [n, r] of Object.entries(o.byRole)) {
474
+ if (!t.has(n) || !r || typeof r != "object" || Array.isArray(r))
435
475
  throw new a(
436
- `Canonical pivot role map contains invalid "${s}" bindings.`
476
+ `Canonical pivot role map contains invalid "${n}" bindings.`
437
477
  );
438
- for (const [i, n] of Object.entries(r))
439
- if (!i || !n || typeof n != "object" || Array.isArray(n) || n.role !== s || typeof n.rawKey != "string" || !n.rawKey || n.outputKey !== void 0 && (typeof n.outputKey != "string" || !n.outputKey))
478
+ for (const [s, i] of Object.entries(r))
479
+ if (!s || !i || typeof i != "object" || Array.isArray(i) || i.role !== n || typeof i.rawKey != "string" || !i.rawKey || i.outputKey !== void 0 && (typeof i.outputKey != "string" || !i.outputKey))
440
480
  throw new a(
441
- `Canonical pivot role map contains an invalid "${s}:${i}" binding.`
481
+ `Canonical pivot role map contains an invalid "${n}:${s}" binding.`
442
482
  );
443
483
  }
444
484
  if (o.byMetricAlias !== void 0) {
@@ -446,17 +486,17 @@ function R(e) {
446
486
  throw new a(
447
487
  "Canonical pivot metric-alias bindings must be an object."
448
488
  );
449
- for (const [s, r] of Object.entries(
489
+ for (const [n, r] of Object.entries(
450
490
  o.byMetricAlias
451
491
  ))
452
- if (!s || !r || typeof r != "object" || Array.isArray(r) || r.role !== "metric" || typeof r.rawKey != "string" || !r.rawKey || r.outputKey !== void 0 && (typeof r.outputKey != "string" || !r.outputKey))
492
+ if (!n || !r || typeof r != "object" || Array.isArray(r) || r.role !== "metric" || typeof r.rawKey != "string" || !r.rawKey || r.outputKey !== void 0 && (typeof r.outputKey != "string" || !r.outputKey))
453
493
  throw new a(
454
- `Canonical pivot metric-alias map contains an invalid "${s}" binding.`
494
+ `Canonical pivot metric-alias map contains an invalid "${n}" binding.`
455
495
  );
456
496
  }
457
497
  return o;
458
498
  }
459
- function X(e) {
499
+ function ce(e) {
460
500
  if (e === void 0) return {};
461
501
  if (!e || typeof e != "object" || Array.isArray(e))
462
502
  throw new a(
@@ -467,32 +507,32 @@ function X(e) {
467
507
  throw new a(
468
508
  `Canonical pivot column metadata contains an invalid "${o}" classification.`
469
509
  );
470
- const { isSubtotal: s, subtotalScope: r } = t;
471
- if (s !== void 0 && typeof s != "boolean" || r !== void 0 && r !== "base" && r !== "pivot-value" && r !== "grand-total" || s === !0 && r !== "pivot-value" && r !== "grand-total" || (r === "pivot-value" || r === "grand-total") && s !== !0 || r === "base" && s === !0)
510
+ const { isSubtotal: n, subtotalScope: r } = t;
511
+ if (n !== void 0 && typeof n != "boolean" || r !== void 0 && r !== "base" && r !== "pivot-value" && r !== "grand-total" || n === !0 && r !== "pivot-value" && r !== "grand-total" || (r === "pivot-value" || r === "grand-total") && n !== !0 || r === "base" && n === !0)
472
512
  throw new a(
473
513
  `Canonical pivot column metadata contains an incoherent "${o}" subtotal classification.`
474
514
  );
475
515
  }
476
516
  return e;
477
517
  }
478
- function $(e, o) {
518
+ function A(e, o) {
479
519
  if (!Array.isArray(e) || e.some((t) => typeof t != "string" || !t) || new Set(e).size !== e.length)
480
520
  throw new a(
481
521
  `Canonical pivot contract ${o} must be an array of unique field identities.`
482
522
  );
483
523
  return e;
484
524
  }
485
- function Z(e, o) {
525
+ function le(e, o) {
486
526
  if (!e || typeof e != "object" || Array.isArray(e) || e.version !== 1)
487
527
  throw new a(
488
528
  "A canonical pivot result requires its versioned result contract."
489
529
  );
490
- const t = e, s = t.expectedRoleFieldIds;
491
- if (!s || typeof s != "object" || Array.isArray(s))
530
+ const t = e, n = t.expectedRoleFieldIds;
531
+ if (!n || typeof n != "object" || Array.isArray(n))
492
532
  throw new a(
493
533
  "Canonical pivot contract role identities must be an object."
494
534
  );
495
- const i = Object.fromEntries(
535
+ const s = Object.fromEntries(
496
536
  [
497
537
  "groupby",
498
538
  "metric",
@@ -500,12 +540,12 @@ function Z(e, o) {
500
540
  "detail"
501
541
  ].map((d) => [
502
542
  d,
503
- $(
504
- s[d],
543
+ A(
544
+ n[d],
505
545
  `expectedRoleFieldIds.${d}`
506
546
  )
507
547
  ])
508
- ), n = $(
548
+ ), i = A(
509
549
  t.expectedMetricAliases,
510
550
  "expectedMetricAliases"
511
551
  ), c = t.columnKinds;
@@ -526,7 +566,7 @@ function Z(e, o) {
526
566
  throw new a(
527
567
  "Canonical pivot contract must classify every authoritative result column exactly once."
528
568
  );
529
- const x = X(
569
+ const x = ce(
530
570
  t.columnClassifications
531
571
  );
532
572
  if (Object.keys(x).some(
@@ -537,33 +577,33 @@ function Z(e, o) {
537
577
  );
538
578
  return {
539
579
  version: 1,
540
- expectedRoleFieldIds: i,
541
- expectedMetricAliases: n,
580
+ expectedRoleFieldIds: s,
581
+ expectedMetricAliases: i,
542
582
  columnKinds: c,
543
583
  columnClassifications: x
544
584
  };
545
585
  }
546
- function A(e, o) {
586
+ function k(e, o) {
547
587
  const t = [
548
588
  "groupby",
549
589
  "metric",
550
590
  "pivotby",
551
591
  "detail"
552
592
  ];
553
- for (const i of t) {
554
- const n = new Set(o.expectedRoleFieldIds[i] ?? []), c = Object.keys(e.byRole[i] ?? {});
555
- if (c.length !== n.size || c.some((m) => !n.has(m)))
593
+ for (const s of t) {
594
+ const i = new Set(o.expectedRoleFieldIds[s] ?? []), c = Object.keys(e.byRole[s] ?? {});
595
+ if (c.length !== i.size || c.some((m) => !i.has(m)))
556
596
  throw new a(
557
- `The role-scoped ${i} bindings do not match the authored result fields.`
597
+ `The role-scoped ${s} bindings do not match the authored result fields.`
558
598
  );
559
599
  }
560
- const s = new Set(o.expectedMetricAliases), r = Object.keys(e.byMetricAlias ?? {});
561
- if (r.length !== s.size || r.some((i) => !s.has(i)))
600
+ const n = new Set(o.expectedMetricAliases), r = Object.keys(e.byMetricAlias ?? {});
601
+ if (r.length !== n.size || r.some((s) => !n.has(s)))
562
602
  throw new a(
563
603
  "The metric-alias bindings do not match the authored metric instances."
564
604
  );
565
605
  }
566
- function ee(e) {
606
+ function de(e) {
567
607
  if (!Array.isArray(e) || e.some(
568
608
  (o) => !o || typeof o != "object" || Array.isArray(o)
569
609
  ))
@@ -572,67 +612,67 @@ function ee(e) {
572
612
  );
573
613
  return e;
574
614
  }
575
- function te(e, o) {
576
- e.forEach((t, s) => {
615
+ function me(e, o) {
616
+ e.forEach((t, n) => {
577
617
  o.forEach((r) => {
578
618
  if (!Object.prototype.hasOwnProperty.call(t, r.key) || t[r.key] === void 0)
579
619
  throw new a(
580
- `Canonical pivot column "${r.key}" is absent from row ${s}.`
620
+ `Canonical pivot column "${r.key}" is absent from row ${n}.`
581
621
  );
582
622
  });
583
623
  });
584
624
  }
585
- function oe(e, o, t) {
586
- const s = new Set(o.map((r) => r.key));
625
+ function fe(e, o, t) {
626
+ const n = new Set(o.map((r) => r.key));
587
627
  ["groupby", "detail"].forEach((r) => {
588
628
  Object.entries(e.byRole[r] ?? {}).forEach(
589
- ([i, n]) => {
590
- const c = n.outputKey || n.rawKey;
591
- if (!s.has(c) || t.columnKinds[c] !== "row")
629
+ ([s, i]) => {
630
+ const c = i.outputKey || i.rawKey;
631
+ if (!n.has(c) || t.columnKinds[c] !== "row")
592
632
  throw new a(
593
- `The role-scoped ${r} binding for "${i}" does not name an authoritative result column.`
633
+ `The role-scoped ${r} binding for "${s}" does not name an authoritative result column.`
594
634
  );
595
635
  }
596
636
  );
597
637
  });
598
638
  }
599
- function C(e, o) {
639
+ function $(e, o) {
600
640
  o.forEach((t) => {
601
- const s = e.columnKinds[t.key];
602
- if (s === "pivot_metric" && t.pivotIdentity === void 0)
641
+ const n = e.columnKinds[t.key];
642
+ if (n === "pivot_metric" && t.pivotIdentity === void 0)
603
643
  throw new a(
604
644
  `Physical pivot result column "${t.key}" is missing its identity.`
605
645
  );
606
- if (s !== "pivot_metric" && t.pivotIdentity !== void 0)
646
+ if (n !== "pivot_metric" && t.pivotIdentity !== void 0)
607
647
  throw new a(
608
648
  `Canonical pivot result column "${t.key}" carries pivot identity outside the physical pivot projection.`
609
649
  );
610
650
  });
611
651
  }
612
- function re(e) {
613
- const o = ee(e.records), t = W(e.columns), s = Z(
652
+ function ue(e) {
653
+ const o = de(e.records), t = ae(e.columns), n = le(
614
654
  e.pivotResultContract,
615
655
  t
616
- ), r = s.expectedRoleFieldIds.pivotby ?? [];
656
+ ), r = n.expectedRoleFieldIds.pivotby ?? [];
617
657
  if (e.pivotResultState === "loaded_empty") {
618
658
  if (o.length !== 0)
619
659
  throw new a(
620
660
  "A loaded_empty pivot result cannot carry records."
621
661
  );
622
662
  if (t.some(
623
- (m) => s.columnKinds[m.key] === "pivot_metric"
663
+ (m) => n.columnKinds[m.key] === "pivot_metric"
624
664
  ))
625
665
  throw new a(
626
666
  "A loaded_empty pivot result cannot carry physical pivot columns."
627
667
  );
628
- C(s, t);
629
- const c = R(e.columnKeyMap);
630
- return A(c, s), {
668
+ $(n, t);
669
+ const c = E(e.columnKeyMap);
670
+ return k(c, n), {
631
671
  pivotResultState: "loaded_empty",
632
672
  records: [],
633
673
  columns: t,
634
674
  columnKeyMap: c,
635
- pivotResultContract: s
675
+ pivotResultContract: n
636
676
  };
637
677
  }
638
678
  if (e.pivotResultState !== "loaded_valid")
@@ -643,40 +683,40 @@ function re(e) {
643
683
  throw new a(
644
684
  "A loaded_valid pivot result must carry at least one record."
645
685
  );
646
- const i = R(e.columnKeyMap);
647
- A(i, s), oe(i, t, s), C(s, t);
648
- const n = t.filter(
649
- (c) => s.columnKinds[c.key] === "pivot_metric"
686
+ const s = E(e.columnKeyMap);
687
+ k(s, n), fe(s, t, n), $(n, t);
688
+ const i = t.filter(
689
+ (c) => n.columnKinds[c.key] === "pivot_metric"
650
690
  );
651
- if (r.length > 0 && n.length === 0)
691
+ if (r.length > 0 && i.length === 0)
652
692
  throw new a(
653
693
  "A loaded_valid pivot result is missing its physical pivot columns."
654
694
  );
655
695
  try {
656
- U(n, {
696
+ N(i, {
657
697
  expectedPivotFieldIds: r,
658
- columnClassifications: s.columnClassifications
698
+ columnClassifications: n.columnClassifications
659
699
  });
660
700
  } catch (c) {
661
- throw c instanceof q ? new a(c.message, c) : c;
701
+ throw c instanceof D ? new a(c.message, c) : c;
662
702
  }
663
- return te(o, t), {
703
+ return me(o, t), {
664
704
  pivotResultState: "loaded_valid",
665
705
  records: o,
666
706
  columns: t,
667
- columnKeyMap: i,
668
- pivotResultContract: s
707
+ columnKeyMap: s,
708
+ pivotResultContract: n
669
709
  };
670
710
  }
671
- function xe(e) {
711
+ function Ue(e) {
672
712
  const o = /* @__PURE__ */ new Set();
673
- ["groupby", "detail"].forEach((i) => {
674
- Object.values(e.columnKeyMap.byRole[i] ?? {}).forEach((n) => {
675
- o.add(n.outputKey || n.rawKey);
713
+ ["groupby", "detail"].forEach((s) => {
714
+ Object.values(e.columnKeyMap.byRole[s] ?? {}).forEach((i) => {
715
+ o.add(i.outputKey || i.rawKey);
676
716
  });
677
717
  });
678
- const t = new Set(e.physicalPivotColumnKeys), s = new Set(
679
- e.columns.map((i) => i.key)
718
+ const t = new Set(e.physicalPivotColumnKeys), n = new Set(
719
+ e.columns.map((s) => s.key)
680
720
  ), r = {
681
721
  version: 1,
682
722
  expectedRoleFieldIds: {
@@ -695,18 +735,18 @@ function xe(e) {
695
735
  },
696
736
  expectedMetricAliases: [...e.expectedMetricAliases ?? []],
697
737
  columnKinds: Object.fromEntries(
698
- e.columns.map((i) => [
699
- i.key,
700
- o.has(i.key) ? "row" : t.has(i.key) ? "pivot_metric" : "value"
738
+ e.columns.map((s) => [
739
+ s.key,
740
+ o.has(s.key) ? "row" : t.has(s.key) ? "pivot_metric" : "value"
701
741
  ])
702
742
  ),
703
743
  columnClassifications: Object.fromEntries(
704
744
  Object.entries(e.columnMetadata ?? {}).filter(
705
- ([i]) => s.has(i)
745
+ ([s]) => n.has(s)
706
746
  )
707
747
  )
708
748
  };
709
- return re({
749
+ return ue({
710
750
  pivotResultState: e.records.length === 0 ? "loaded_empty" : "loaded_valid",
711
751
  pivotResultContract: r,
712
752
  records: e.records,
@@ -715,20 +755,35 @@ function xe(e) {
715
755
  });
716
756
  }
717
757
  export {
718
- pe as M,
719
- I as P,
720
- G as a,
721
- H as b,
722
- ye as c,
723
- ve as d,
724
- we as e,
725
- Y as f,
726
- he as g,
727
- Q as h,
728
- ge as i,
729
- a as j,
730
- re as k,
731
- xe as l,
732
- N as p,
733
- be as v
758
+ Ue as A,
759
+ B as C,
760
+ V as D,
761
+ Ke as M,
762
+ C as P,
763
+ z as a,
764
+ J as b,
765
+ S as c,
766
+ Ee as d,
767
+ ke as e,
768
+ se as f,
769
+ G as g,
770
+ Y as h,
771
+ Se as i,
772
+ H as j,
773
+ _e as k,
774
+ Q as l,
775
+ re as m,
776
+ ne as n,
777
+ Fe as o,
778
+ I as p,
779
+ je as q,
780
+ $e as r,
781
+ Me as s,
782
+ Ae as t,
783
+ Te as u,
784
+ Pe as v,
785
+ ie as w,
786
+ Oe as x,
787
+ a as y,
788
+ ue as z
734
789
  };