react-semaphor 0.1.560 → 0.1.562

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/dist/analytics-protocol/index.js +450 -423
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +9 -9
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{analytics-base-schemas-CHLxsPfX.js → analytics-base-schemas-BaIQrEzX.js} +221 -188
  7. package/dist/chunks/{assistant-chat-Bu2fFm_I.js → assistant-chat-R_yT8xH4.js} +116 -117
  8. package/dist/chunks/bookmark-impact-D4Kl4amw.js +75 -0
  9. package/dist/chunks/bookmark-state-CWeoGbrx.js +743 -0
  10. package/dist/chunks/{braces-Da41xfUd.js → braces-DzgoQC64.js} +1 -1
  11. package/dist/chunks/{comparison-window-caption-4FNkMrzE.js → comparison-window-caption-D1EUXzaR.js} +550 -425
  12. package/dist/chunks/{context-BgPDzLHZ.js → context-R31TSL5V.js} +1 -1
  13. package/dist/chunks/{dashboard-_MeBuy67.js → dashboard-Bp1y5oun.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-CEi4Pr_v.js → dashboard-briefing-launcher-S5FB3aUW.js} +236 -236
  15. package/dist/chunks/dashboard-controls-CfC_6Ztn.js +2277 -0
  16. package/dist/chunks/{dashboard-json-B1mU_OMa.js → dashboard-json-gYZT7ZQY.js} +5 -5
  17. package/dist/chunks/dates-DFY7Gfss.js +91 -0
  18. package/dist/chunks/{edit-dashboard-visual-0CJN31Y3.js → edit-dashboard-visual-u7OI_g8Q.js} +7119 -7198
  19. package/dist/chunks/filter-reach-copy-CvV7W5dd.js +3965 -0
  20. package/dist/chunks/{filter-value-text-CRC-K_l_.js → filter-value-text-CPwFkrMz.js} +11 -10
  21. package/dist/chunks/global-date-filter-utils-N1kcsOFE.js +16722 -0
  22. package/dist/chunks/{index-DtHidOPV.js → index-CNGkfUp4.js} +269 -264
  23. package/dist/chunks/{layout-grid-BvsH4RY2.js → layout-grid-BM65viQh.js} +1 -1
  24. package/dist/chunks/{list-filter-Dg0otx5E.js → list-filter-BoeLBfL3.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-CM18W8w6.js → matrix-analytical-definition-hEucouWM.js} +4 -4
  26. package/dist/chunks/{matrix-card-HPskLaPy.js → matrix-card-CCh9JjP1.js} +3 -3
  27. package/dist/chunks/{matrix-member-presentation-Bbrfrke4.js → matrix-member-presentation-DsAUbuoL.js} +1 -1
  28. package/dist/chunks/{matrix-operation-contract-WPv4R-H_.js → matrix-operation-contract-DsLdFdSa.js} +365 -349
  29. package/dist/chunks/{metric-comparison-ljMKYZKa.js → metric-comparison-Bnso1cm1.js} +6 -6
  30. package/dist/chunks/{model-change-Ccn1zaxl.js → model-change-T1cRkh3m.js} +1 -1
  31. package/dist/chunks/{palette-Bsh376zO.js → palette-p1XSJFgB.js} +1 -1
  32. package/dist/chunks/pivot-result-contract-expectations-B53jqszr.js +56 -0
  33. package/dist/chunks/{pivot-result-identity-vS9TSh4f.js → pivot-result-identity-Dq5jm-EC.js} +1 -1
  34. package/dist/chunks/{zoned-wall-clock-B1n_WjW3.js → raw-temporal-value-Bqz8wc7L.js} +97 -46
  35. package/dist/chunks/{report-preferences-dialog-BV8L0SeS.js → report-preferences-dialog-C4RAR8u5.js} +68 -63
  36. package/dist/chunks/{report-runtime-context-BZQh9ywy.js → report-runtime-context-BITkNSDa.js} +2 -2
  37. package/dist/chunks/resolve-dashboard-input-context-DaDrZGuA.js +8214 -0
  38. package/dist/chunks/{save-B5EAsgQF.js → save-CHV1B1fL.js} +1 -1
  39. package/dist/chunks/{saved-dashboard-context-n2Wn11cV.js → saved-dashboard-context-DFYBrE6O.js} +93 -94
  40. package/dist/chunks/{selection-filter-compiler-BKXmyLrS.js → selection-filter-compiler-CUDRnUxc.js} +19 -18
  41. package/dist/chunks/{selection-reducer-D0YnaAD9.js → selection-reducer-Bz5aywT4.js} +1 -1
  42. package/dist/chunks/{semaphor-ready-indicator-XLBLOJ2V.js → semaphor-ready-indicator-Cfuafnem.js} +38188 -40344
  43. package/dist/chunks/{shelf-drop-preview-context-DHMa54a-.js → shelf-drop-preview-context-BR2GEYog.js} +81 -82
  44. package/dist/chunks/{source-entity-resolution-dUG5VWRm.js → source-entity-resolution-DdDVXFB8.js} +6 -6
  45. package/dist/chunks/{switch-ByxH4M7t.js → switch-BW4yXSYs.js} +3 -3
  46. package/dist/chunks/{table-export-sheet-C_GdeTYU.js → table-export-sheet-bSXxGn-v.js} +1 -1
  47. package/dist/chunks/temporal-input-presentation-sk9gqLi6.js +4960 -0
  48. package/dist/chunks/{token-types-CQtXUVMy.js → token-types-BUK06hU2.js} +1 -1
  49. package/dist/chunks/{upload-wbR-NVzq.js → upload-BnmuyPqW.js} +1 -1
  50. package/dist/chunks/{use-create-flow-overlay-state-CEBaLOKC.js → use-create-flow-overlay-state-DyzhWvRJ.js} +6 -6
  51. package/dist/chunks/{validators-CXTneCA4.js → validators-BIM0FE31.js} +774 -895
  52. package/dist/dashboard/index.js +2 -2
  53. package/dist/dashboard-authoring/index.js +2477 -2685
  54. package/dist/data-app-sdk/index.js +30 -30
  55. package/dist/data-app-sdk-adapters/index.js +3 -3
  56. package/dist/data-app-sdk-validation/index.js +25 -25
  57. package/dist/format-utils/index.js +274 -267
  58. package/dist/index.js +59 -59
  59. package/dist/report-runtime-context/index.js +2 -2
  60. package/dist/style.css +1 -1
  61. package/dist/surfboard/index.js +2 -2
  62. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  63. package/dist/types/components/dashboard/dashboard-create-dialog.d.ts +23 -0
  64. package/dist/types/components/dashboard/summary-number-formatter.d.ts +6 -0
  65. package/dist/types/components/index.d.ts +1 -2
  66. package/dist/types/components/surfboard/filter/types.d.ts +3 -1
  67. package/dist/types/index.js +50 -51
  68. package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
  69. package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +59 -2
  70. package/dist/types/lib/interactions/get-click-context-from-matrix.d.ts +5 -0
  71. package/dist/types/lib/interactions/get-click-context-from-table.d.ts +45 -0
  72. package/dist/types/lib/print/print-inputs.d.ts +2 -1
  73. package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -0
  74. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +5 -0
  75. package/dist/types/lib/selection/selection-from-click-context.d.ts +41 -0
  76. package/dist/types/lib/stores/editor-store.d.ts +9 -1
  77. package/dist/types/lib/stores/table-actions.d.ts +0 -2
  78. package/dist/types/lib/types/common-types.d.ts +6 -0
  79. package/dist/types/lib/types/explorer-types.d.ts +7 -1
  80. package/dist/types/lib/types/interaction-types.d.ts +3 -1
  81. package/dist/types/lib/types/token-types.d.ts +0 -1
  82. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +13 -1
  83. package/dist/types/shared/analytics-protocol/contracts.d.ts +9 -40
  84. package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
  85. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +12 -2
  86. package/dist/types/shared/analytics-protocol/validators.d.ts +1 -2
  87. package/dist/types/shared/assistant-protocol/context.d.ts +8 -8
  88. package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +7 -1
  89. package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
  90. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +76 -0
  91. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
  92. package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
  93. package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
  94. package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
  95. package/dist/types/shared/dashboard-authoring/card-settings/column-polarity-write.d.ts +5 -0
  96. package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
  97. package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
  98. package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
  99. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +17 -0
  100. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +117 -0
  101. package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
  102. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
  103. package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
  104. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +51 -0
  105. package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +30 -0
  106. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
  107. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
  108. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +3402 -4313
  109. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +49 -8
  110. package/dist/types/shared/dashboard-authoring/changes/field-ref.d.ts +91 -0
  111. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +7 -0
  112. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +52 -2
  113. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-create.d.ts +26 -0
  114. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +2 -1
  115. package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +1 -8
  116. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +20 -20
  117. package/dist/types/shared/dashboard-authoring/detail-date-presentation.d.ts +9 -0
  118. package/dist/types/shared/dashboard-authoring/index.d.ts +11 -6
  119. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
  120. package/dist/types/shared/dashboard-authoring/measure-calculations/apply.d.ts +8 -0
  121. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +16 -0
  122. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +41 -0
  123. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +17 -0
  124. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +63 -0
  125. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +16 -0
  126. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +79 -0
  127. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +934 -0
  128. package/dist/types/shared/dashboard-authoring/measure-calculations/sentences.d.ts +4 -0
  129. package/dist/types/shared/dashboard-authoring/measure-calculations/set.d.ts +11 -0
  130. package/dist/types/shared/dashboard-authoring/measure-calculations/transform.d.ts +63 -0
  131. package/dist/types/shared/dashboard-authoring/measure-calculations/window-transforms.d.ts +60 -0
  132. package/dist/types/shared/dashboard-authoring/new-card.d.ts +12 -1
  133. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +2 -1
  134. package/dist/types/shared/dashboard-authoring/operations/operation-sentences.d.ts +46 -0
  135. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +73 -3
  136. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -3
  137. package/dist/types/shared/dashboard-authoring/text-card-words/blocks.d.ts +58 -0
  138. package/dist/types/shared/dashboard-authoring/text-card-words/index.d.ts +55 -0
  139. package/dist/types/shared/dashboard-authoring/text-card-words/rich-content.d.ts +18 -0
  140. package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
  141. package/dist/types/shared/format-utils/document-print.d.ts +82 -0
  142. package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +8 -1
  143. package/dist/types/shared/format-utils/index.d.ts +1 -0
  144. package/dist/types/shared/format-utils/raw-temporal.d.ts +18 -7
  145. package/dist/types/shared/temporal/index.d.ts +1 -0
  146. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +19 -0
  147. package/dist/types/shared/temporal/raw-temporal-value.d.ts +29 -0
  148. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +6 -0
  149. package/package.json +2 -2
  150. package/dist/chunks/bookmark-state-BFY9oNmr.js +0 -111
  151. package/dist/chunks/custom-visual-inputs-Dz-enUNR.js +0 -292
  152. package/dist/chunks/dashboard-controls-Bi7fyG-4.js +0 -2339
  153. package/dist/chunks/document-dashboard-inputs-CkWfDB8c.js +0 -3010
  154. package/dist/chunks/filter-reach-copy-BF4w4kI2.js +0 -3738
  155. package/dist/chunks/global-date-filter-utils-D8365uPH.js +0 -12889
  156. package/dist/chunks/pivot-result-contract-expectations-Bl5suy4-.js +0 -1832
  157. package/dist/chunks/raw-temporal-presentation-BHm7s-hz.js +0 -540
  158. package/dist/chunks/resolve-dashboard-input-context-CAMiWvyR.js +0 -5280
  159. package/dist/chunks/table-settings-Imz0FgWi.js +0 -637
  160. package/dist/chunks/temporal-input-presentation-uvNK_tM0.js +0 -3228
  161. package/dist/types/components/dashboard/ai-dashboard-create-dialog.d.ts +0 -38
  162. package/dist/types/components/dashboard/dashboard-create-template.d.ts +0 -10
  163. package/dist/types/lib/hooks/use-dashboard-authoring.d.ts +0 -49
  164. package/dist/types/shared/dashboard-authoring/artifact-compiler.d.ts +0 -6
  165. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -106
  166. package/dist/types/shared/dashboard-authoring/protocol-adapter.d.ts +0 -7
  167. package/dist/types/shared/dashboard-authoring/source-matching.d.ts +0 -34
  168. package/dist/types/shared/dashboard-authoring/validators.d.ts +0 -2
@@ -1,36 +1,37 @@
1
- var Ke = Object.defineProperty;
2
- var Ve = (e, t, r) => t in e ? Ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var ae = (e, t, r) => Ve(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { ag as Ue, i as je, l as N, o as Be, ah as Ee, c as ze, p as Xe, a8 as He, a as Ge, b as V, T as se, a3 as qe, S as We, a4 as Ye, a5 as Ze, P as ie, K as Je, N as Qe, U as et, a7 as tt, ai as R } from "./temporal-input-presentation-uvNK_tM0.js";
5
- import { j as Se, m as J, n as Fe, o as rt, q as ke, f as le, d as nt, k as ot, s as L } from "./pivot-result-contract-expectations-Bl5suy4-.js";
6
- import { h as X, e as at, p as st, k as it } from "./export-file-format-C-tJsxsf.js";
7
- import { aW as O, aj as lt, t as B, aV as ct, v as Q, u as ut } from "./validators-CXTneCA4.js";
8
- import "./matrix-operation-contract-WPv4R-H_.js";
9
- import "./analytics-base-schemas-CHLxsPfX.js";
1
+ var ze = Object.defineProperty;
2
+ var Xe = (e, t, r) => t in e ? ze(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var le = (e, t, r) => Xe(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { az as He, i as Ge, j as O, m as qe, K as Fe, aA as re, aB as Ie, aC as Ye, aD as Me, au as Le, ah as We, am as Ze, ai as Je, f as Qe, a as V, _ as ue, aa as et, Y as tt, ab as rt, ac as nt, o as me, s as ot, R as de, T as at, V as st, $ as it, aE as k, aF as R } from "./temporal-input-presentation-sk9gqLi6.js";
5
+ import { h as H, e as ct, p as lt, k as ut } from "./export-file-format-C-tJsxsf.js";
6
+ import { aV as U, H as mt, t as z, aU as dt, v as ne, u as ft } from "./validators-BIM0FE31.js";
7
+ import "./matrix-operation-contract-DsLdFdSa.js";
8
+ import "./analytics-base-schemas-BaIQrEzX.js";
10
9
  import "zod";
11
- import { PDF_SAFETY_LIMIT_EXCEEDED as Me, getUtf8ByteLength as mt, FAST_PDF_POLICY as dt } from "../pdf-export-policy/index.js";
12
- import { c as ft, b as ce } from "./pivot-result-identity-vS9TSh4f.js";
13
- import { v as pt, g as yt } from "./zoned-wall-clock-B1n_WjW3.js";
14
- function ht(e, t, r) {
10
+ import { PDF_SAFETY_LIMIT_EXCEEDED as ke, getUtf8ByteLength as pt, FAST_PDF_POLICY as bt } from "../pdf-export-policy/index.js";
11
+ import { p as ht } from "./pivot-result-contract-expectations-B53jqszr.js";
12
+ import { c as yt, b as fe } from "./pivot-result-identity-Dq5jm-EC.js";
13
+ import { v as gt, g as wt, c as vt } from "./raw-temporal-value-Bqz8wc7L.js";
14
+ import "../value-format-preferences/index.js";
15
+ function Ct(e, t, r) {
15
16
  const n = {
16
17
  ...t,
17
18
  locale: t.locale ?? r
18
19
  };
19
20
  if (n.type === "number")
20
- return N(e, n);
21
- const { prefix: o, suffix: l, ...s } = n;
22
- return `${o ?? ""}${N(e, {
21
+ return O(e, n);
22
+ const { prefix: o, suffix: c, ...s } = n;
23
+ return `${o ?? ""}${O(e, {
23
24
  ...s,
24
25
  negativeStyle: n.type === "currency" ? n.negativeStyle : "minus"
25
- })}${l ?? ""}`;
26
+ })}${c ?? ""}`;
26
27
  }
27
28
  function W(e, t, r) {
28
- return e === null ? { value: e, text: null } : !t || !je(t) && t.type !== "duration" ? {
29
+ return e === null ? { value: e, text: null } : !t || !Ge(t) && t.type !== "duration" ? {
29
30
  value: e,
30
- text: N(e, { type: "number", locale: r })
31
+ text: O(e, { type: "number", locale: r })
31
32
  } : t.type === "duration" ? {
32
33
  value: e,
33
- text: Be(e, {
34
+ text: qe(e, {
34
35
  inputUnit: t.inputUnit,
35
36
  outputStyle: t.outputStyle,
36
37
  largestUnit: t.largestUnit,
@@ -40,12 +41,12 @@ function W(e, t, r) {
40
41
  suffix: t.suffix,
41
42
  negativeInParentheses: t.negativeStyle === "parentheses"
42
43
  })
43
- } : { value: e, text: ht(e, t, r) };
44
+ } : { value: e, text: Ct(e, t, r) };
44
45
  }
45
- function ue(e, t, r, n) {
46
+ function pe(e, t, r, n) {
46
47
  return e === null ? { value: e, text: null } : n === "percent" ? {
47
48
  value: e,
48
- text: N(e, {
49
+ text: O(e, {
49
50
  type: "percent",
50
51
  locale: r,
51
52
  minimumFractionDigits: t,
@@ -54,7 +55,7 @@ function ue(e, t, r, n) {
54
55
  })
55
56
  } : {
56
57
  value: e,
57
- text: N(e, {
58
+ text: O(e, {
58
59
  type: "number",
59
60
  locale: r,
60
61
  minimumFractionDigits: t,
@@ -63,13 +64,13 @@ function ue(e, t, r, n) {
63
64
  })
64
65
  };
65
66
  }
66
- function me(e, t) {
67
+ function be(e, t) {
67
68
  if (e === void 0) return t;
68
69
  if (!Number.isInteger(e) || e < 0 || e > 6)
69
70
  throw new RangeError("Comparison precision must be an integer from 0 to 6.");
70
71
  return e;
71
72
  }
72
- function vr(e, t) {
73
+ function Pr(e, t) {
73
74
  const r = {
74
75
  mode: t.displayMode,
75
76
  current: W(
@@ -85,33 +86,33 @@ function vr(e, t) {
85
86
  };
86
87
  return (t.displayMode === "difference" || t.displayMode === "both") && (r.difference = W(
87
88
  e.delta,
88
- Ue(t.metricFormat),
89
+ He(t.metricFormat),
89
90
  t.locale
90
- )), (t.displayMode === "percent_change" || t.displayMode === "both") && (r.percentChange = ue(
91
+ )), (t.displayMode === "percent_change" || t.displayMode === "both") && (r.percentChange = pe(
91
92
  e.percentChange,
92
- me(t.precision, 1),
93
+ be(t.precision, 1),
93
94
  t.locale,
94
95
  "percent"
95
- )), t.displayMode === "ratio" && (r.ratio = ue(
96
+ )), t.displayMode === "ratio" && (r.ratio = pe(
96
97
  e.ratio,
97
- me(t.precision, 2),
98
+ be(t.precision, 2),
98
99
  t.locale,
99
100
  "ratio"
100
101
  )), r;
101
102
  }
102
- const bt = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
103
- function gt(e) {
103
+ const xt = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
104
+ function Tt(e) {
104
105
  const { presentation: t } = e;
105
- return e.formattedValues ? (t == null ? void 0 : t.kind) === "text" || (t == null ? void 0 : t.kind) === "measure" && t.format.type === "duration" ? "text" : (t == null ? void 0 : t.kind) === "temporal_bucket" ? bt.has(t.grain) ? "date" : "text" : (t == null ? void 0 : t.kind) === "datetime" ? "date" : e.dataType === "number" ? "number" : e.dataType === "boolean" ? "boolean" : e.dataType === "unknown" ? "by_value" : "text" : "by_value";
106
+ return e.formattedValues ? (t == null ? void 0 : t.kind) === "text" || (t == null ? void 0 : t.kind) === "measure" && t.format.type === "duration" ? "text" : (t == null ? void 0 : t.kind) === "temporal_bucket" ? xt.has(t.grain) ? "date" : "text" : (t == null ? void 0 : t.kind) === "datetime" ? "date" : e.dataType === "number" ? "number" : e.dataType === "boolean" ? "boolean" : e.dataType === "unknown" ? "by_value" : "text" : "by_value";
106
107
  }
107
- function wt(e) {
108
- const t = (o, l) => Number.isInteger(o) ? Math.min(20, Math.max(0, o)) : l, r = t(e.minimumFractionDigits, 0), n = Math.max(r, t(e.maximumFractionDigits, 2));
108
+ function _t(e) {
109
+ const t = (o, c) => Number.isInteger(o) ? Math.min(20, Math.max(0, o)) : c, r = t(e.minimumFractionDigits, 0), n = Math.max(r, t(e.maximumFractionDigits, 2));
109
110
  return n === 0 ? "" : `.${"0".repeat(n)}`;
110
111
  }
111
- function Y(e) {
112
+ function Z(e) {
112
113
  return `"${e.replace(/"/g, "")}"`;
113
114
  }
114
- function vt(e) {
115
+ function Et(e) {
115
116
  let t;
116
117
  try {
117
118
  t = new Intl.NumberFormat(e.locale ?? "en-US", {
@@ -121,33 +122,33 @@ function vt(e) {
121
122
  } catch {
122
123
  return;
123
124
  }
124
- const r = t.findIndex((l) => l.type === "currency"), n = t.findIndex((l) => l.type === "integer");
125
+ const r = t.findIndex((c) => c.type === "currency"), n = t.findIndex((c) => c.type === "integer");
125
126
  if (r < 0 || n < 0) return;
126
- const o = (l, s) => t.slice(l, s).filter((c) => c.type === "literal").map((c) => c.value.replace(/\s/g, " ")).join("");
127
+ const o = (c, s) => t.slice(c, s).filter((l) => l.type === "literal").map((l) => l.value.replace(/\s/g, " ")).join("");
127
128
  return r < n ? { side: "before", text: t[r].value + o(r + 1, n) } : {
128
129
  side: "after",
129
130
  text: o(n + 1, r) + t[r].value
130
131
  };
131
132
  }
132
- function Ct(e) {
133
- const t = wt(e);
133
+ function St(e) {
134
+ const t = _t(e);
134
135
  let r;
135
136
  if (e.type === "scientific")
136
137
  r = `0${t}E+00`;
137
138
  else {
138
139
  const n = `${e.useGrouping === !1 ? "0" : "#,##0"}${t}`;
139
140
  if (e.type === "currency") {
140
- const o = vt(e);
141
- r = o ? o.side === "before" ? `${Y(o.text)}${n}` : `${n}${Y(o.text)}` : n;
142
- } else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${n}${Y("%")}` : `${n}%` : r = n;
141
+ const o = Et(e);
142
+ r = o ? o.side === "before" ? `${Z(o.text)}${n}` : `${n}${Z(o.text)}` : n;
143
+ } else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${n}${Z("%")}` : `${n}%` : r = n;
143
144
  }
144
145
  return e.negativeStyle === "parentheses" ? `${r};(${r})` : r;
145
146
  }
146
- function xt(e, t) {
147
+ function $t(e, t) {
147
148
  if (!e.formattedValues) return;
148
149
  const { presentation: r } = e;
149
150
  if (t === "number" || t === "by_value")
150
- return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : Ct(r.format);
151
+ return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : St(r.format);
151
152
  if (t === "date") {
152
153
  if ((r == null ? void 0 : r.kind) === "temporal_bucket")
153
154
  return r.grain === "day" ? "yyyy-mm-dd" : r.grain === "month" ? "mmm yyyy" : "yyyy-mm-dd hh:mm";
@@ -155,8 +156,8 @@ function xt(e, t) {
155
156
  return r.dateOnly ? "yyyy-mm-dd" : "yyyy-mm-dd hh:mm:ss";
156
157
  }
157
158
  }
158
- function de(e) {
159
- const t = gt(e), r = xt(e, t);
159
+ function he(e) {
160
+ const t = Tt(e), r = $t(e, t);
160
161
  return Object.freeze({
161
162
  key: e.key,
162
163
  label: e.label,
@@ -164,18 +165,18 @@ function de(e) {
164
165
  ...r === void 0 ? {} : { numberFormat: r }
165
166
  });
166
167
  }
167
- const Tt = 15, Et = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
168
- function Ie(e) {
169
- return Et.test(e) ? e : void 0;
168
+ const Ft = 15, It = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
169
+ function Ae(e) {
170
+ return It.test(e) ? e : void 0;
170
171
  }
171
- function fe(e) {
172
+ function ye(e) {
172
173
  const r = e.replace(/^-/, "").replace(/[eE].*$/, "").replace(".", "").replace(/^0+/, "").replace(/0+$/, "");
173
- if (r.length > Tt) return !1;
174
+ if (r.length > Ft) return !1;
174
175
  const n = Number(e);
175
176
  return Number.isFinite(n) && (n !== 0 || r.length === 0);
176
177
  }
177
- const St = Date.UTC(1900, 2, 1), Ft = Date.UTC(1e4, 0, 1), kt = Date.UTC(1899, 11, 30), Mt = 864e5;
178
- function It(e) {
178
+ const Mt = Date.UTC(1900, 2, 1), Lt = Date.UTC(1e4, 0, 1), kt = Date.UTC(1899, 11, 30), At = 864e5;
179
+ function Pt(e) {
179
180
  const t = Date.UTC(
180
181
  e.year,
181
182
  e.month - 1,
@@ -184,20 +185,20 @@ function It(e) {
184
185
  e.minute,
185
186
  e.second
186
187
  );
187
- if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < St || t >= Ft))
188
- return (t - kt) / Mt;
188
+ if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < Mt || t >= Lt))
189
+ return (t - kt) / At;
189
190
  }
190
- function pe(e, t, r) {
191
+ function ge(e, t, r) {
191
192
  if (typeof e == "number")
192
193
  return Number.isFinite(e) ? { kind: "number", text: t, value: e } : void 0;
193
- if (O(e))
194
- return fe(e.value) ? { kind: "number", text: t, value: e } : void 0;
194
+ if (U(e))
195
+ return ye(e.value) ? { kind: "number", text: t, value: e } : void 0;
195
196
  if (r && typeof e == "string") {
196
- const n = Ie(e);
197
- return n !== void 0 && fe(n) ? { kind: "number", text: t, value: n } : void 0;
197
+ const n = Ae(e);
198
+ return n !== void 0 && ye(n) ? { kind: "number", text: t, value: n } : void 0;
198
199
  }
199
200
  }
200
- function U(e) {
201
+ function j(e) {
201
202
  const { value: t, text: r, column: n } = e;
202
203
  if (r === "") return { kind: "empty" };
203
204
  const o = { kind: "text", text: r };
@@ -205,32 +206,32 @@ function U(e) {
205
206
  case "text":
206
207
  return o;
207
208
  case "date": {
208
- const l = e.wallClock ? It(e.wallClock) : void 0;
209
- return l === void 0 ? o : { kind: "date", text: r, serial: l };
209
+ const c = e.wallClock ? Pt(e.wallClock) : void 0;
210
+ return c === void 0 ? o : { kind: "date", text: r, serial: c };
210
211
  }
211
212
  case "number":
212
- return pe(t, r, !0) ?? o;
213
+ return ge(t, r, !0) ?? o;
213
214
  case "boolean":
214
215
  return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : o;
215
216
  case "by_value":
216
- return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : pe(t, r, !1) ?? o;
217
+ return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : ge(t, r, !1) ?? o;
217
218
  }
218
219
  }
219
- function Cr(e) {
220
+ function Dr(e) {
220
221
  return e.kind === "empty" ? "" : e.text;
221
222
  }
222
- const $e = 1e4, $t = 1e6, xr = 5e6, Tr = 1024 ** 3, Er = 1024 ** 3;
223
- function Sr(e) {
224
- return e > $e;
223
+ const Pe = 1e4, Dt = 1e6, Nr = 5e6, Rr = 1024 ** 3, Or = 1024 ** 3;
224
+ function Ur(e) {
225
+ return e > Pe;
225
226
  }
226
- function Fr(e) {
227
- return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= $e ? "direct" : e.loadedRowCount <= $t ? "background" : "blocked";
227
+ function Kr(e) {
228
+ return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= Pe ? "direct" : e.loadedRowCount <= Dt ? "background" : "blocked";
228
229
  }
229
- const kr = {
230
+ const Vr = {
230
231
  rowLabels: "tabular",
231
232
  subtotals: "after"
232
233
  };
233
- function Mr(e, t) {
234
+ function jr(e, t) {
234
235
  const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, n = e.totals.rows;
235
236
  return {
236
237
  ...e,
@@ -240,79 +241,79 @@ function Mr(e, t) {
240
241
  rows: {
241
242
  ...n,
242
243
  levels: Object.fromEntries(
243
- Object.entries(n.levels).map(([o, l]) => [
244
+ Object.entries(n.levels).map(([o, c]) => [
244
245
  o,
245
- { ...l, position: t.subtotals }
246
+ { ...c, position: t.subtotals }
246
247
  ])
247
248
  )
248
249
  }
249
250
  }
250
251
  };
251
252
  }
252
- const Lt = 2;
253
- function Pt(e) {
254
- return typeof e == "number" ? Number.isInteger(e) : O(e) ? !e.value.includes(".") : !0;
253
+ const Nt = 2;
254
+ function Rt(e) {
255
+ return typeof e == "number" ? Number.isInteger(e) : U(e) ? !e.value.includes(".") : !0;
255
256
  }
256
- function Dt(e, t, r) {
257
+ function Ot(e, t, r) {
257
258
  const n = e.descriptors.measures.filter(
258
- (s) => r.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 && lt(s.column.dataType) === "number"
259
+ (s) => r.measureFormats[s.id] === void 0 && s.semanticFormat === void 0 && mt(s.column.dataType) === "number"
259
260
  );
260
261
  if (n.length === 0) return r;
261
262
  const o = /* @__PURE__ */ new Set();
262
- e.columns.forEach((s, c) => {
263
+ e.columns.forEach((s, l) => {
263
264
  if (!(s.kind !== "measure" || o.has(s.measureId)))
264
265
  for (const f of t) {
265
- const d = f.values[c];
266
- if ((d == null ? void 0 : d.kind) === "value" && !Pt(d.value)) {
266
+ const d = f.values[l];
267
+ if ((d == null ? void 0 : d.kind) === "value" && !Rt(d.value)) {
267
268
  o.add(s.measureId);
268
269
  return;
269
270
  }
270
271
  }
271
272
  });
272
- const l = { ...r.measureFormats };
273
+ const c = { ...r.measureFormats };
273
274
  for (const { id: s } of n) {
274
- const c = o.has(s) ? Lt : 0;
275
- l[s] = {
275
+ const l = o.has(s) ? Nt : 0;
276
+ c[s] = {
276
277
  type: "number",
277
- minimumFractionDigits: c,
278
- maximumFractionDigits: c,
278
+ minimumFractionDigits: l,
279
+ maximumFractionDigits: l,
279
280
  useGrouping: !0
280
281
  };
281
282
  }
282
- return { ...r, measureFormats: l };
283
+ return { ...r, measureFormats: c };
283
284
  }
284
- function j(e) {
285
- return B(e.slice(0, -1));
285
+ function B(e) {
286
+ return z(e.slice(0, -1));
286
287
  }
287
- function _t(e, t) {
288
- return t.length > e.length && B(t.slice(0, e.length)) === B(e);
288
+ function Ut(e, t) {
289
+ return t.length > e.length && z(t.slice(0, e.length)) === z(e);
289
290
  }
290
- function At(e) {
291
+ function Kt(e) {
291
292
  return e.map((t, r) => {
292
293
  if (r === 0 || t.kind !== "layout") return !1;
293
294
  const n = e[r - 1];
294
295
  if (n.kind !== "layout") return !1;
295
- if (t.role !== "member" || _t(n.rowPath, t.rowPath)) return !0;
296
+ if (t.role !== "member" || Ut(n.rowPath, t.rowPath)) return !0;
296
297
  const o = e[r - 2];
297
- return n.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || j(o.rowPath) !== j(n.rowPath)) && t.rowPath.length === n.rowPath.length && j(t.rowPath) === j(n.rowPath);
298
+ return n.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || B(o.rowPath) !== B(n.rowPath)) && t.rowPath.length === n.rowPath.length && B(t.rowPath) === B(n.rowPath);
298
299
  });
299
300
  }
300
- const Rt = "pdf-group-continuation";
301
- function Le(e, t, r) {
302
- return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || O(t.value)) ? e : X(e);
301
+ const Vt = "pdf-group-continuation";
302
+ function De(e, t, r) {
303
+ return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || U(t.value)) ? e : H(e);
303
304
  }
304
- function Nt(e, t, r) {
305
- const n = Se(e.descriptors, t.presentation, r), o = e.columns.map((u) => {
305
+ function jt(e, t, r) {
306
+ const n = Fe(e.descriptors, t.presentation, r), o = e.columns.map((u) => {
306
307
  var a;
307
308
  return u.kind === "measure" && ((a = n.measureSemantics.get(u.measureId)) == null ? void 0 : a.isNumeric) === !0;
308
- }), l = (u) => J([u], n.levels), s = (u, a, m) => Fe(u, a, t.presentation.totals[m], n.levels), c = e.columns.map((u) => {
309
+ }), c = (u) => re([u], n.levels), s = (u, a, m) => Ie(u, a, t.presentation.totals[m], n.levels), l = e.columns.map((u) => {
309
310
  if (u.kind !== "measure") return u.label;
310
- const a = u.columnPath.map(l);
311
+ const a = u.columnPath.map(c);
311
312
  return u.role !== "member" && a.push(s(u.columnPath, u.role, "columns")), [...a, u.label].join(" / ");
312
313
  }), f = Math.min(t.spec.columns.length, Math.max(
313
314
  0,
314
315
  ...e.columns.map((u) => u.kind === "measure" ? u.columnPath.length + (u.role !== "member" ? 1 : 0) : 0)
315
- )), d = Array.from({ length: f + 1 }, (u, a) => e.columns.map((m) => a === f ? m.label : m.kind !== "measure" ? "" : a < m.columnPath.length ? l(m.columnPath[a]) : a === m.columnPath.length && m.role !== "member" ? s(m.columnPath, m.role, "columns") : "")), b = (u, a) => rt({
316
+ )), d = Array.from({ length: f + 1 }, (u, a) => e.columns.map((m) => a === f ? m.label : m.kind !== "measure" ? "" : a < m.columnPath.length ? c(m.columnPath[a]) : a === m.columnPath.length && m.role !== "member" ? s(m.columnPath, m.role, "columns") : "")), y = (u, a) => Ye({
316
317
  path: u.rowPath,
317
318
  role: u.kind === "layout" ? u.role : "member",
318
319
  levelCount: Math.max(1, t.spec.rows.length),
@@ -321,25 +322,25 @@ function Nt(e, t, r) {
321
322
  }), w = (u, a) => {
322
323
  if (u.kind !== "layout") throw new Error("Layout presentation requires layout rows.");
323
324
  if (u.values.length !== e.columns.length) throw new Error("Matrix row does not match its frozen layout.");
324
- const m = b(u, a);
325
+ const m = y(u, a);
325
326
  return e.columns.map((h, p) => {
326
327
  if (h.kind === "hierarchy")
327
328
  return `${" ".repeat(Math.max(0, u.rowPath.length - 1))}${s(u.rowPath, u.role, "rows")}`;
328
329
  if (h.kind === "level") {
329
- const v = t.spec.rows.findIndex((F) => F.id === h.levelId), C = m[v];
330
- return C != null && C.visible ? C.total ? s(u.rowPath, u.role, "rows") : J(C.path, n.levels) : "";
330
+ const v = t.spec.rows.findIndex((S) => S.id === h.levelId), C = m[v];
331
+ return C != null && C.visible ? C.total ? s(u.rowPath, u.role, "rows") : re(C.path, n.levels) : "";
331
332
  }
332
333
  const T = u.values[p], g = n.measures.get(h.measureId);
333
334
  if (T.kind === "value" && !g)
334
335
  throw new Error("Matrix value is missing its measure descriptor.");
335
- return ke(T, g, t.presentation.absence);
336
+ return Me(T, g, t.presentation.absence);
336
337
  });
337
338
  }, x = (u, a) => w(u, a).map((m, h) => {
338
339
  const p = e.columns[h];
339
- return p.kind === "measure" ? Le(m, u.values[h], n.measureSemantics.get(p.measureId)) : X(m);
340
+ return p.kind === "measure" ? De(m, u.values[h], n.measureSemantics.get(p.measureId)) : H(m);
340
341
  });
341
342
  return {
342
- headers: c,
343
+ headers: l,
343
344
  headerBands: d,
344
345
  numericColumns: o,
345
346
  /** The card's prepared formats this presentation formats with (the Excel form reads its measure formats). */
@@ -355,7 +356,7 @@ function Nt(e, t, r) {
355
356
  continuedColumns: (u, a) => {
356
357
  const m = (p) => (p == null ? void 0 : p.kind) === "layout" && p.role === "member";
357
358
  if (!m(u) || !m(a)) return [];
358
- const h = b(u, a);
359
+ const h = y(u, a);
359
360
  return e.columns.flatMap((p, T) => {
360
361
  var v;
361
362
  if (p.kind !== "level") return [];
@@ -374,77 +375,77 @@ function Nt(e, t, r) {
374
375
  csvRows: (u, a) => u.map((m, h) => x(m, h ? u[h - 1] : a ?? void 0))
375
376
  };
376
377
  }
377
- function Ir(e) {
378
- return e.columns.map((t) => X(t.label));
378
+ function Br(e) {
379
+ return e.columns.map((t) => H(t.label));
379
380
  }
380
- function $r(e, t, r) {
381
- return Ot(e, t, r).map((n, o) => {
382
- const l = t.columns[o];
383
- return l.kind === "measure" ? Le(n, e.values[o], r.measureSemantics.get(l.measureId)) : X(n);
381
+ function zr(e, t, r) {
382
+ return Bt(e, t, r).map((n, o) => {
383
+ const c = t.columns[o];
384
+ return c.kind === "measure" ? De(n, e.values[o], r.measureSemantics.get(c.measureId)) : H(n);
384
385
  });
385
386
  }
386
- function Ot(e, t, r) {
387
+ function Bt(e, t, r) {
387
388
  if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
388
389
  if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
389
390
  const n = [...e.rowPath, ...e.columnPath];
390
- return t.columns.map((o, l) => {
391
+ return t.columns.map((o, c) => {
391
392
  if (o.kind === "measure") {
392
- const c = e.values[l], f = r.measures.get(o.measureId);
393
- if (c.kind === "value" && !f) throw new Error("Matrix value is missing its measure descriptor.");
394
- return ke(c, f, r.absence);
393
+ const l = e.values[c], f = r.measures.get(o.measureId);
394
+ if (l.kind === "value" && !f) throw new Error("Matrix value is missing its measure descriptor.");
395
+ return Me(l, f, r.absence);
395
396
  }
396
- const s = o.kind === "level" ? n.find((c) => c.levelId === o.levelId) : void 0;
397
+ const s = o.kind === "level" ? n.find((l) => l.levelId === o.levelId) : void 0;
397
398
  if (!s) throw new Error("Flat Matrix row does not match its frozen layout.");
398
- return J([s], r.levels);
399
+ return re([s], r.levels);
399
400
  });
400
401
  }
401
- function Kt(e) {
402
- const t = Nt(e.layout, e.request, e.report), r = e.layout.columns.map((s, c) => ({
403
- index: c,
404
- columnId: `matrix:${c}`,
405
- label: t.headers[c],
406
- isNumeric: t.numericColumns[c]
407
- })), n = (s, c, f) => ({
402
+ function zt(e) {
403
+ const t = jt(e.layout, e.request, e.report), r = e.layout.columns.map((s, l) => ({
404
+ index: l,
405
+ columnId: `matrix:${l}`,
406
+ label: t.headers[l],
407
+ isNumeric: t.numericColumns[l]
408
+ })), n = (s, l, f) => ({
408
409
  text: s,
409
410
  colspan: 1,
410
411
  rowspan: 1,
411
- columnId: r[c].columnId,
412
+ columnId: r[l].columnId,
412
413
  isHeader: f,
413
- isNumeric: r[c].isNumeric,
414
- className: r[c].isNumeric ? "numeric" : e.layout.columns[c].kind === "hierarchy" ? "matrix-hierarchy" : ""
415
- }), o = [], l = e.layout.columns.findIndex((s) => s.kind === "measure");
416
- e.request.spec.columns.length && l >= 0 && o.push({
414
+ isNumeric: r[l].isNumeric,
415
+ className: r[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
416
+ }), o = [], c = e.layout.columns.findIndex((s) => s.kind === "measure");
417
+ e.request.spec.columns.length && c >= 0 && o.push({
417
418
  repeatHeader: !0,
418
419
  headerType: "pivot-axis",
419
420
  headerRowIndex: 0,
420
421
  cells: [
421
- ...l ? [{ ...n("", 0, !0), colspan: l }] : [],
422
+ ...c ? [{ ...n("", 0, !0), colspan: c }] : [],
422
423
  {
423
- ...n(e.request.spec.columns.map((s) => Ee(s, e.request.presentation)).join(" / "), l, !0),
424
- colspan: e.layout.columns.length - l,
424
+ ...n(e.request.spec.columns.map((s) => Le(s, e.request.presentation)).join(" / "), c, !0),
425
+ colspan: e.layout.columns.length - c,
425
426
  isNumeric: !1,
426
427
  className: ""
427
428
  }
428
429
  ]
429
430
  });
430
- for (const [s, c] of t.headerBands.entries())
431
+ for (const [s, l] of t.headerBands.entries())
431
432
  o.push({
432
433
  repeatHeader: !0,
433
434
  headerType: s === t.headerBands.length - 1 ? "metrics" : "pivot-level",
434
435
  headerRowIndex: o.length,
435
- cells: c.map((f, d) => n(f, d, !0))
436
+ cells: l.map((f, d) => n(f, d, !0))
436
437
  });
437
438
  return {
438
439
  headers: o,
439
- rows: e.rows.map((s, c) => {
440
- const f = new Set(t.continuedColumns(s, e.rows[c - 1]));
440
+ rows: e.rows.map((s, l) => {
441
+ const f = new Set(t.continuedColumns(s, e.rows[l - 1]));
441
442
  return {
442
- index: c,
443
+ index: l,
443
444
  type: s.kind === "layout" && s.role !== "member" ? "subtotal" : "data",
444
445
  subtotalLevel: String(s.rowPath.length),
445
446
  // A tabular layout prints each label once unless it repeats them; the
446
447
  // blank cell continues its group, so a grid draws no rule above it.
447
- cells: t.row(s, e.rows[c - 1]).map((d, b) => f.has(b) ? { ...n(d, b, !1), className: Rt } : n(d, b, !1))
448
+ cells: t.row(s, e.rows[l - 1]).map((d, y) => f.has(y) ? { ...n(d, y, !1), className: Vt } : n(d, y, !1))
448
449
  };
449
450
  }),
450
451
  grandTotal: null,
@@ -461,38 +462,38 @@ function Kt(e) {
461
462
  }
462
463
  };
463
464
  }
464
- function Vt(e, t, r) {
465
- const { levels: n } = Se(e.descriptors, t.presentation, r), o = t.spec.columns.length > 0, l = [], s = [], c = e.columns.map((d, b) => {
465
+ function Xt(e, t, r) {
466
+ const { levels: n } = Fe(e.descriptors, t.presentation, r), o = t.spec.columns.length > 0, c = [], s = [], l = e.columns.map((d, y) => {
466
467
  if (d.kind !== "measure") return null;
467
- const w = o ? `${d.role}:${B(d.columnPath)}` : `measure:${b}`;
468
- let x = l.indexOf(w);
469
- return x < 0 && (x = l.push(w) - 1, s.push(o ? Fe(d.columnPath, d.role, t.presentation.totals.columns, n) : d.label)), x;
468
+ const w = o ? `${d.role}:${z(d.columnPath)}` : `measure:${y}`;
469
+ let x = c.indexOf(w);
470
+ return x < 0 && (x = c.push(w) - 1, s.push(o ? Ie(d.columnPath, d.role, t.presentation.totals.columns, n) : d.label)), x;
470
471
  }), f = t.spec.columns[t.spec.columns.length - 1];
471
472
  return {
472
- columnGroups: c,
473
+ columnGroups: l,
473
474
  groupLabels: s,
474
475
  /** What bands name their groups by: the innermost column level, or "Measures". */
475
- groupLevelLabel: f ? Ee(f, t.presentation) : "Measures"
476
+ groupLevelLabel: f ? Le(f, t.presentation) : "Measures"
476
477
  };
477
478
  }
478
- function Lr(e) {
479
+ function Xr(e) {
479
480
  const { layout: t, rows: r, report: n } = e, o = {
480
481
  ...e.request,
481
- presentation: Dt(t, r, e.request.presentation)
482
- }, l = Kt({ layout: t, rows: r, request: o, report: n }), s = At(r), c = Vt(t, o, n), f = {
483
- ...l,
484
- rows: l.rows.map((d, b) => ({ ...d, keepWithPrevious: s[b] })),
485
- metadata: { ...l.metadata, ...c }
482
+ presentation: Ot(t, r, e.request.presentation)
483
+ }, c = zt({ layout: t, rows: r, request: o, report: n }), s = Kt(r), l = Xt(t, o, n), f = {
484
+ ...c,
485
+ rows: c.rows.map((d, y) => ({ ...d, keepWithPrevious: s[y] })),
486
+ metadata: { ...c.metadata, ...l }
486
487
  };
487
- return { request: o, table: f, ...c };
488
+ return { request: o, table: f, ...l };
488
489
  }
489
- class Ut extends Error {
490
+ class Ht extends Error {
490
491
  constructor() {
491
492
  super(...arguments);
492
- ae(this, "code", Me);
493
+ le(this, "code", ke);
493
494
  }
494
495
  }
495
- function ye(e) {
496
+ function we(e) {
496
497
  if (!e || typeof e != "object")
497
498
  return;
498
499
  const { error: t, message: r, detail: n } = e;
@@ -500,21 +501,21 @@ function ye(e) {
500
501
  if (typeof o == "string" && o.trim())
501
502
  return o.trim();
502
503
  }
503
- async function jt(e) {
504
+ async function Gt(e) {
504
505
  const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), r = e.headers.get("content-type") || "";
505
506
  try {
506
507
  if (r.includes("application/json")) {
507
- const o = await e.json(), l = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
508
- return { message: ye(o) || t, code: l };
508
+ const o = await e.json(), c = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
509
+ return { message: we(o) || t, code: c };
509
510
  }
510
511
  const n = await e.text();
511
512
  if (!n.trim())
512
513
  return { message: t };
513
514
  try {
514
- const o = JSON.parse(n), l = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
515
+ const o = JSON.parse(n), c = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
515
516
  return {
516
- message: ye(o) || n.trim(),
517
- code: l
517
+ message: we(o) || n.trim(),
518
+ code: c
518
519
  };
519
520
  } catch {
520
521
  return { message: n.trim() };
@@ -523,9 +524,9 @@ async function jt(e) {
523
524
  return { message: t };
524
525
  }
525
526
  }
526
- async function Pr(e) {
527
+ async function Hr(e) {
527
528
  if (!e.token) throw new Error("Missing auth token for PDF export");
528
- if (mt(e.serializedPayload) > dt.maxRequestBytes)
529
+ if (pt(e.serializedPayload) > bt.maxRequestBytes)
529
530
  throw new Error("Fast-path PDF request exceeds the structured body limit");
530
531
  const t = await (e.fetchImpl ?? fetch)(e.url, {
531
532
  method: "POST",
@@ -534,8 +535,8 @@ async function Pr(e) {
534
535
  signal: e.signal
535
536
  });
536
537
  if (!t.ok) {
537
- const n = await jt(t);
538
- throw n.code === Me ? new Ut(n.message) : new Error(n.message);
538
+ const n = await Gt(t);
539
+ throw n.code === ke ? new Ht(n.message) : new Error(n.message);
539
540
  }
540
541
  const r = await t.json();
541
542
  if (r != null && r.error) throw new Error(r.error);
@@ -543,24 +544,142 @@ async function Pr(e) {
543
544
  throw new Error("Fast-path PDF response missing download URL");
544
545
  return r;
545
546
  }
546
- function Bt(e, t) {
547
+ const Gr = 1, Ne = ["loading", "measuring", "checking", "laidOut"], qt = [
548
+ // Already emitted before these contracts; names kept.
549
+ "document_matrix_too_large",
550
+ "document_matrix_unavailable",
551
+ "document_matrix_too_wide",
552
+ "document_kpi_value_overflow",
553
+ "print_inputs_not_captured",
554
+ // New.
555
+ "document_section_setup",
556
+ "document_input_missing",
557
+ "document_section_query_failed",
558
+ "document_table_completeness_unverified",
559
+ "document_row_limit_exceeded",
560
+ "document_section_render_failed",
561
+ "document_page_overflow",
562
+ "document_sheet_not_found",
563
+ "document_print_timed_out"
564
+ ];
565
+ function qr(e) {
566
+ return qt.includes(e);
567
+ }
568
+ const Yt = 64, Wt = 120, Zt = 3, Jt = 80, Qt = [...Ne, "noPageStack", "unknown"];
569
+ function J(e, t) {
570
+ return typeof e != "string" ? void 0 : e.trim().slice(0, t).trim() || void 0;
571
+ }
572
+ function F(e, t) {
573
+ return typeof e == "number" && Number.isInteger(e) && e >= t ? e : void 0;
574
+ }
575
+ function Q(e, t) {
576
+ return t.includes(e) ? e : void 0;
577
+ }
578
+ function er(e) {
579
+ let t = e;
580
+ if (typeof e == "string")
581
+ try {
582
+ t = JSON.parse(e);
583
+ } catch {
584
+ return {};
585
+ }
586
+ if (!t || typeof t != "object" || Array.isArray(t)) return {};
587
+ const r = t, n = Array.isArray(r.inputLabels) ? r.inputLabels.map((c) => J(c, Jt)).filter((c) => c !== void 0).slice(0, Zt) : [], o = {
588
+ sectionId: J(r.sectionId, Yt),
589
+ sectionTitle: J(r.sectionTitle, Wt),
590
+ pageNumber: F(r.pageNumber, 1),
591
+ rowCount: F(r.rowCount, 0),
592
+ rowLimit: F(r.rowLimit, 1),
593
+ inputLabels: n.length ? n : void 0,
594
+ overflowAxis: Q(r.overflowAxis, ["height", "width"]),
595
+ overflowPx: F(r.overflowPx, 0),
596
+ matrixLimit: Q(r.matrixLimit, ["rows", "bytes"]),
597
+ layoutStage: Q(r.layoutStage, Qt),
598
+ loadingSectionCount: F(r.loadingSectionCount, 0),
599
+ measuredRowCount: F(r.measuredRowCount, 0),
600
+ totalRowCount: F(r.totalRowCount, 0),
601
+ pageCount: F(r.pageCount, 0)
602
+ };
603
+ return Object.fromEntries(
604
+ Object.entries(o).filter(([, c]) => c !== void 0)
605
+ );
606
+ }
607
+ function Yr(e) {
608
+ const t = er(e.facts), r = t.sectionTitle ? `Section "${t.sectionTitle}"` : t.sectionId ? `Section ${t.sectionId}` : "A section", n = t.pageNumber !== void 0 ? ` on page ${t.pageNumber}` : "";
609
+ switch (e.code) {
610
+ case "document_section_setup":
611
+ return `${r} is not set up to print.`;
612
+ case "document_input_missing":
613
+ return t.inputLabels ? `${r} needs a value for ${t.inputLabels.join(", ")}.` : `${r} needs a value for a required input.`;
614
+ case "document_section_query_failed":
615
+ return `${r}: its data could not be loaded.`;
616
+ case "document_table_completeness_unverified":
617
+ return `${r}: the query returned no total row count, so the table could not be confirmed complete.`;
618
+ case "document_row_limit_exceeded":
619
+ return t.rowCount !== void 0 && t.rowLimit !== void 0 ? `${r} has ${t.rowCount} rows; a document table prints up to ${t.rowLimit}.` : `${r} has more rows than a document table prints.`;
620
+ case "document_section_render_failed":
621
+ return `${r} could not be drawn.`;
622
+ case "document_page_overflow":
623
+ return `${r}${n} does not fit the page${t.overflowAxis ? ` (${t.overflowAxis}` : ""}${t.overflowAxis && t.overflowPx !== void 0 ? `, ${t.overflowPx} px over` : ""}${t.overflowAxis ? ")" : ""}.`;
624
+ case "document_matrix_too_large":
625
+ return t.matrixLimit === "rows" && t.rowLimit !== void 0 ? `${r}: the Matrix has more than ${t.rowLimit} rows, the most a report prints.` : `${r}: the Matrix is too large to print.`;
626
+ case "document_matrix_unavailable":
627
+ return `${r}: the Matrix result could not be loaded.`;
628
+ case "document_matrix_too_wide":
629
+ return `${r}: the Matrix is wider than the page.`;
630
+ case "document_kpi_value_overflow":
631
+ return `${r}: a KPI value does not fit its tile.`;
632
+ case "print_inputs_not_captured":
633
+ return t.inputLabels ? `The report's input values were not saved: ${t.inputLabels.join(", ")}.` : "The report's input values were not saved.";
634
+ case "document_sheet_not_found":
635
+ return "The requested Document sheet is not in the dashboard.";
636
+ case "document_print_timed_out":
637
+ return [
638
+ `The Document did not finish preparing in time (stage ${t.layoutStage ?? "unknown"}`,
639
+ t.measuredRowCount !== void 0 ? `; ${t.measuredRowCount} of ${t.totalRowCount ?? "unknown"} rows measured` : "",
640
+ t.pageCount !== void 0 ? `; ${t.pageCount} pages` : "",
641
+ t.loadingSectionCount ? `; ${t.loadingSectionCount} sections loading` : "",
642
+ ")."
643
+ ].join("");
644
+ }
645
+ }
646
+ function tr(e) {
647
+ return Ne.includes(e);
648
+ }
649
+ function ee(e) {
650
+ return typeof e == "number" && Number.isInteger(e) && e >= 0;
651
+ }
652
+ function Wr(e) {
653
+ let t = e;
654
+ if (typeof e == "string")
655
+ try {
656
+ t = JSON.parse(e);
657
+ } catch {
658
+ return;
659
+ }
660
+ if (!t || typeof t != "object" || Array.isArray(t)) return;
661
+ const { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: c } = t;
662
+ if (!(!tr(r) || !ee(n) || o !== null && !ee(o) || c !== null && !ee(c)))
663
+ return { stage: r, measuredRowCount: n, totalRowCount: o, pageCount: c };
664
+ }
665
+ function rr(e, t) {
547
666
  return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === void 0;
548
667
  }
549
- function Pe(e) {
668
+ function Re(e) {
550
669
  return new Map(
551
670
  e.presentationExecutionSnapshot.resolvedFormats.flatMap(
552
- (t) => t.format.type === "raw_temporal" && t.target.kind === "column" && Bt(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
671
+ (t) => t.format.type === "raw_temporal" && t.target.kind === "column" && rr(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
553
672
  )
554
673
  );
555
674
  }
556
- function De(e) {
675
+ function Oe(e) {
557
676
  const t = e == null ? void 0 : e.sql, r = e == null ? void 0 : e.python;
558
677
  return (e == null ? void 0 : e.resultOwner) === "freeform" && typeof t == "string" && !!t.trim() && (typeof r != "string" || !r.trim());
559
678
  }
560
- function Dr(e) {
561
- return e.formatting.useFormattedValues !== !1 && De(e.queryPayload) && Pe(e.formatting).size > 0;
679
+ function Zr(e) {
680
+ return e.formatting.useFormattedValues !== !1 && Oe(e.queryPayload) && Re(e.formatting).size > 0;
562
681
  }
563
- function zt(e, t) {
682
+ function nr(e, t) {
564
683
  return e.map((r, n) => {
565
684
  if (!Object.prototype.hasOwnProperty.call(r, t) || r[t] === void 0)
566
685
  throw new Error(
@@ -570,52 +689,52 @@ function zt(e, t) {
570
689
  return o === null || typeof o == "string" ? o : String(o);
571
690
  });
572
691
  }
573
- function Xt(e) {
692
+ function or(e) {
574
693
  if (e.formatting.useFormattedValues === !1)
575
694
  return {
576
695
  activatedColumnKeys: /* @__PURE__ */ new Set(),
577
696
  byColumnKey: /* @__PURE__ */ new Map()
578
697
  };
579
- const t = Pe(e.formatting), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
698
+ const t = Re(e.formatting), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
580
699
  if (t.size === 0)
581
700
  return { activatedColumnKeys: r, byColumnKey: n };
582
701
  const o = new Map(
583
- e.columns.flatMap((c) => {
584
- const f = c.key || c.field;
585
- return f ? [[f, c]] : [];
702
+ e.columns.flatMap((l) => {
703
+ const f = l.key || l.field;
704
+ return f ? [[f, l]] : [];
586
705
  })
587
- ), l = De(e.queryPayload), s = /* @__PURE__ */ new Map();
588
- for (const [c, f] of t) {
589
- const d = o.get(c);
590
- let b;
706
+ ), c = Oe(e.queryPayload), s = /* @__PURE__ */ new Map();
707
+ for (const [l, f] of t) {
708
+ const d = o.get(l);
709
+ let y;
591
710
  if (d != null && d.rawTemporal)
592
- b = pt(d, {
711
+ y = gt(d, {
593
712
  metadataRequired: !0
594
- }), r.add(c);
595
- else if (l) {
596
- r.add(c);
597
- const w = ze({
598
- columnKey: c,
599
- values: zt(e.records, c)
713
+ }), r.add(l);
714
+ else if (c) {
715
+ r.add(l);
716
+ const w = We({
717
+ columnKey: l,
718
+ values: nr(e.records, l)
600
719
  });
601
- s.set(c, w), w.status === "classified" && (b = w.metadata);
720
+ s.set(l, w), w.status === "classified" && (y = w.metadata);
602
721
  } else
603
722
  continue;
604
- b && n.set(c, {
605
- metadata: b,
723
+ y && n.set(l, {
724
+ metadata: y,
606
725
  format: f,
607
- formatValue: Xe({ metadata: b, format: f })
726
+ formatValue: Ze({ metadata: y, format: f })
608
727
  });
609
728
  }
610
729
  return {
611
730
  activatedColumnKeys: r,
612
731
  byColumnKey: n,
613
- ...l ? {
614
- sqlChunkEvidence: He(s)
732
+ ...c ? {
733
+ sqlChunkEvidence: Je(s)
615
734
  } : {}
616
735
  };
617
736
  }
618
- function Ht(e) {
737
+ function ar(e) {
619
738
  if (!e.resolution.activatedColumnKeys.has(e.columnKey))
620
739
  return;
621
740
  if (e.value === void 0)
@@ -630,59 +749,59 @@ function Ht(e) {
630
749
  const r = t.formatValue(e.value);
631
750
  return r.ok && r.wallClock ? { text: r.text, wallClock: r.wallClock } : { text: r.text };
632
751
  }
633
- function he(e, t) {
752
+ function ve(e, t) {
634
753
  const r = e.byColumnKey.get(t);
635
754
  return r ? r.metadata.valueKind === "date" : void 0;
636
755
  }
637
- const Gt = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), qt = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, Wt = /^\d{4}-\d{2}-\d{2}$/, _e = "MM/dd/yyyy";
638
- function z(e) {
756
+ const sr = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), ir = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, cr = /^\d{4}-\d{2}-\d{2}$/, Ue = "MM/dd/yyyy";
757
+ function X(e) {
639
758
  return typeof e == "object" && e !== null && !Array.isArray(e);
640
759
  }
641
- function A(e) {
760
+ function N(e) {
642
761
  return e.key || e.field || void 0;
643
762
  }
644
- function be(e) {
645
- return e == null ? "" : typeof e == "string" ? e : O(e) ? e.value : e instanceof Date ? e.toISOString() : typeof e == "object" ? JSON.stringify(e) : String(e);
763
+ function Ce(e) {
764
+ return e == null ? "" : typeof e == "string" ? e : U(e) ? e.value : e instanceof Date ? e.toISOString() : typeof e == "object" ? JSON.stringify(e) : String(e);
646
765
  }
647
- function ge(e, t) {
766
+ function xe(e, t) {
648
767
  var n;
649
768
  const r = (n = e.columnSettings) == null ? void 0 : n[t];
650
- if (!(!z(r) || r.type !== "date"))
651
- return z(r.dateFormat) ? r.dateFormat : {};
769
+ if (!(!X(r) || r.type !== "date"))
770
+ return X(r.dateFormat) ? r.dateFormat : {};
652
771
  }
653
- function we(e) {
654
- return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || _e;
772
+ function Te(e) {
773
+ return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || Ue;
655
774
  }
656
- function ve(e, t) {
775
+ function _e(e, t) {
657
776
  return e && e !== "auto" ? e : t;
658
777
  }
659
- function Yt(e) {
778
+ function lr(e) {
660
779
  return !/[HhKkmsSa]/.test(e.replace(/'[^']*'/g, ""));
661
780
  }
662
- function Zt(e) {
781
+ function ur(e) {
663
782
  if (typeof e == "number") return Number.isFinite(e) ? e : null;
664
783
  if (typeof e != "string" || !e.trim()) return null;
665
784
  const t = Number(e);
666
785
  return Number.isFinite(t) ? t : null;
667
786
  }
668
- function Jt(e) {
669
- const t = Ie(e);
787
+ function mr(e) {
788
+ const t = Ae(e);
670
789
  if (t !== void 0)
671
790
  try {
672
- return ct(t, /[.eE]/.test(t) ? "decimal" : "integer");
791
+ return dt(t, /[.eE]/.test(t) ? "decimal" : "integer");
673
792
  } catch {
674
793
  return;
675
794
  }
676
795
  }
677
- function Qt(e) {
796
+ function dr(e) {
678
797
  return e.calendar.fiscalCalendar && (e.granularity === "quarter" || e.granularity === "year") ? "fiscal" : e.granularity;
679
798
  }
680
- function _r(e) {
681
- const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope, l = (a) => Ge({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } }), s = (a) => We({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } });
682
- function c(a) {
799
+ function Jr(e) {
800
+ const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope, c = (a) => Qe({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } }), s = (a) => tt({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: a } });
801
+ function l(a) {
683
802
  var h;
684
803
  if ((h = t.visibleColumns) != null && h.length) return t.visibleColumns;
685
- const m = a.columns.map(A).filter((p) => !!p);
804
+ const m = a.columns.map(N).filter((p) => !!p);
686
805
  return m.length > 0 ? m : a.records[0] ? Object.keys(a.records[0]) : [];
687
806
  }
688
807
  function f(a, m) {
@@ -691,25 +810,25 @@ function _r(e) {
691
810
  function d(a, m) {
692
811
  const h = a == null ? void 0 : a.pivotIdentity;
693
812
  if (!h || !h.members || h.members.length === 0) return;
694
- const p = ce({ identity: h, columnKey: (a == null ? void 0 : a.key) || (a == null ? void 0 : a.field) || "" });
695
- return ot({
813
+ const p = fe({ identity: h, columnKey: (a == null ? void 0 : a.key) || (a == null ? void 0 : a.field) || "" });
814
+ return ht({
696
815
  members: p,
697
816
  metricLabel: (a == null ? void 0 : a.label) || (a == null ? void 0 : a.headerName),
698
817
  mode: n ? "formatted" : "canonical",
699
818
  resolveTemporalFormat: (T) => {
700
819
  const g = p.find((C) => C.fieldId === T);
701
820
  if (!(g != null && g.temporalBucket)) return;
702
- const v = se({
821
+ const v = ue({
703
822
  snapshot: t.presentationExecutionSnapshot,
704
823
  scope: o,
705
824
  target: { kind: "field", fieldId: T, role: "pivotby" }
706
825
  });
707
- return v ? b(g.temporalBucket, v) : void 0;
826
+ return v ? y(g.temporalBucket, v) : void 0;
708
827
  }
709
828
  }).flattenedLabel;
710
829
  }
711
- function b(a, m) {
712
- return qe({
830
+ function y(a, m) {
831
+ return et({
713
832
  metadata: a,
714
833
  cardFormat: m,
715
834
  locale: m.locale,
@@ -717,137 +836,137 @@ function _r(e) {
717
836
  }).format;
718
837
  }
719
838
  function w(a, m) {
720
- const { records: h, columns: p } = a, T = z(r.cardConfig) ? r.cardConfig : void 0, g = T == null ? void 0 : T.pivotByColumns, v = Array.isArray(g) ? g.flatMap(
721
- (i) => z(i) && typeof i.id == "string" && i.id ? [i.id] : []
839
+ const { records: h, columns: p } = a, T = X(r.cardConfig) ? r.cardConfig : void 0, g = T == null ? void 0 : T.pivotByColumns, v = Array.isArray(g) ? g.flatMap(
840
+ (i) => X(i) && typeof i.id == "string" && i.id ? [i.id] : []
722
841
  ) : [];
723
- ft(
724
- p.map((i) => ({ key: A(i) || "<unknown>", pivotIdentity: i.pivotIdentity })),
842
+ yt(
843
+ p.map((i) => ({ key: N(i) || "<unknown>", pivotIdentity: i.pivotIdentity })),
725
844
  { expectedPivotFieldIds: v }
726
845
  );
727
- const C = c(a), F = new Map(
846
+ const C = l(a), S = new Map(
728
847
  p.flatMap((i) => {
729
- const y = A(i);
730
- return y ? [[y, i]] : [];
848
+ const b = N(i);
849
+ return b ? [[b, i]] : [];
731
850
  })
732
- ), Re = new Map(a.resultColumns.map((i) => [i.key, i.dataType])), I = Xt({
851
+ ), Ve = new Map(a.resultColumns.map((i) => [i.key, i.dataType])), M = or({
733
852
  records: h,
734
853
  columns: p,
735
854
  formatting: t,
736
855
  queryPayload: r
737
- }), H = new Map(
856
+ }), G = new Map(
738
857
  p.flatMap((i) => {
739
- const y = A(i);
740
- return y && i.temporalBucket ? [[y, i.temporalBucket]] : [];
858
+ const b = N(i);
859
+ return b && i.temporalBucket ? [[b, i.temporalBucket]] : [];
741
860
  })
742
- ), te = /* @__PURE__ */ new Map();
861
+ ), ae = /* @__PURE__ */ new Map();
743
862
  for (const i of C) {
744
- const y = se({
863
+ const b = ue({
745
864
  snapshot: t.presentationExecutionSnapshot,
746
865
  scope: o,
747
866
  target: { kind: "column", columnKey: i }
748
- }), E = H.get(i);
867
+ }), _ = G.get(i);
749
868
  if (n) {
750
- if (y && !E) throw new Error(`Missing temporal bucket metadata for column "${i}"`);
751
- if (E && !y) throw new Error(`Missing resolved temporal presentation for column "${i}"`);
869
+ if (b && !_) throw new Error(`Missing temporal bucket metadata for column "${i}"`);
870
+ if (_ && !b) throw new Error(`Missing resolved temporal presentation for column "${i}"`);
752
871
  }
753
- y && E && te.set(i, b(E, y));
872
+ b && _ && ae.set(i, y(_, b));
754
873
  }
755
- const G = C.map((i) => {
756
- const y = Re.get(i), E = y && Gt.has(y) ? y : "unknown", S = n ? x(i, I, H) : void 0, M = f(i, F.get(i)), P = n && I.activatedColumnKeys.has(i) && he(I, i) === void 0;
874
+ const q = C.map((i) => {
875
+ const b = Ve.get(i), _ = b && sr.has(b) ? b : "unknown", E = n ? x(i, M, G) : void 0, I = f(i, S.get(i)), A = n && M.activatedColumnKeys.has(i) && ve(M, i) === void 0;
757
876
  return {
758
877
  key: i,
759
- label: M,
760
- dataType: E,
761
- ...S ? { presentation: S } : {},
762
- xlsx: de({ key: i, label: M, formattedValues: n, dataType: E, presentation: S }),
763
- ...P ? { xlsxPending: !0 } : {}
878
+ label: I,
879
+ dataType: _,
880
+ ...E ? { presentation: E } : {},
881
+ xlsx: he({ key: i, label: I, formattedValues: n, dataType: _, presentation: E }),
882
+ ...A ? { xlsxPending: !0 } : {}
764
883
  };
765
884
  });
766
- function Ne(i, y, E, S) {
767
- if (!n) return { text: be(i), value: i };
768
- const M = Ht({ value: i, columnKey: y, rowIndex: E, resolution: I });
769
- if (M !== void 0) return { text: M.text, value: i, ...M.wallClock ? { wallClock: M.wallClock } : {} };
770
- const P = H.get(y);
771
- if (P) {
772
- const k = te.get(y);
773
- if (!k) throw new Error(`Missing resolved temporal presentation for column "${y}"`);
885
+ function je(i, b, _, E) {
886
+ if (!n) return { text: Ce(i), value: i };
887
+ const I = ar({ value: i, columnKey: b, rowIndex: _, resolution: M });
888
+ if (I !== void 0) return { text: I.text, value: i, ...I.wallClock ? { wallClock: I.wallClock } : {} };
889
+ const A = G.get(b);
890
+ if (A) {
891
+ const $ = ae.get(b);
892
+ if (!$) throw new Error(`Missing resolved temporal presentation for column "${b}"`);
774
893
  if (i != null && typeof i != "string")
775
- throw new Error(`Canonical temporal column "${y}" must contain a string or null`);
776
- const D = i ?? null, _ = Ye(D, P);
894
+ throw new Error(`Canonical temporal column "${b}" must contain a string or null`);
895
+ const P = i ?? null, D = rt(P, A);
777
896
  return {
778
- text: Ze({ value: D, metadata: P, format: k }),
897
+ text: nt({ value: P, metadata: A, format: $ }),
779
898
  value: i,
780
- ..._ ? { wallClock: _ } : {}
899
+ ...D ? { wallClock: D } : {}
781
900
  };
782
901
  }
783
902
  if (i == null) return { text: "", value: i };
784
- const q = s(y);
785
- if (q && typeof i == "number" && Number.isFinite(i))
903
+ const Y = s(b);
904
+ if (Y && typeof i == "number" && Number.isFinite(i))
786
905
  return {
787
- text: le(
906
+ text: me(
788
907
  new Date(i).toISOString(),
789
- q.pattern || _e,
790
- ve(q.timezone, t.timezone),
908
+ Y.pattern || Ue,
909
+ _e(Y.timezone, t.timezone),
791
910
  "UTC"
792
911
  ),
793
912
  value: i
794
913
  };
795
- const $ = l(y);
914
+ const L = c(b);
796
915
  if (typeof i == "number")
797
- return { text: $ ? V(i, $) : String(i), value: i };
798
- if (O(i))
799
- return { text: $ ? V(i, $) : i.value, value: i };
800
- const K = ge(t, y);
801
- if (K && (i instanceof Date || typeof i == "string" && qt.test(i))) {
802
- const k = i instanceof Date ? i.toISOString() : i, D = typeof i == "string" && Wt.test(i), _ = D ? "UTC" : ve(K.timezone, t.timezone), ne = D ? "UTC" : K.sourceTimezone || "auto", oe = nt(k, _, ne);
916
+ return { text: L ? V(i, L) : String(i), value: i };
917
+ if (U(i))
918
+ return { text: L ? V(i, L) : i.value, value: i };
919
+ const K = xe(t, b);
920
+ if (K && (i instanceof Date || typeof i == "string" && ir.test(i))) {
921
+ const $ = i instanceof Date ? i.toISOString() : i, P = typeof i == "string" && cr.test(i), D = P ? "UTC" : _e(K.timezone, t.timezone), ie = P ? "UTC" : K.sourceTimezone || "auto", ce = ot($, D, ie);
803
922
  return {
804
- text: le(k, we(K), _, ne),
923
+ text: me($, Te(K), D, ie),
805
924
  value: i,
806
- ...oe ? { wallClock: oe } : {}
925
+ ...ce ? { wallClock: ce } : {}
807
926
  };
808
927
  }
809
- if (typeof i == "string" && $ && S.dataType === "number") {
810
- const k = Jt(i);
811
- if (k) return { text: V(k, $), value: i };
928
+ if (typeof i == "string" && L && E.dataType === "number") {
929
+ const $ = mr(i);
930
+ if ($) return { text: V($, L), value: i };
812
931
  }
813
- return { text: be(i), value: i };
932
+ return { text: Ce(i), value: i };
814
933
  }
815
- const Oe = h.map(
816
- (i, y) => G.map((E) => {
817
- const S = Ne(i[E.key], E.key, y, E);
818
- return U({ value: S.value, text: S.text, column: E.xlsx, wallClock: S.wallClock });
934
+ const Be = h.map(
935
+ (i, b) => q.map((_) => {
936
+ const E = je(i[_.key], _.key, b, _);
937
+ return j({ value: E.value, text: E.text, column: _.xlsx, wallClock: E.wallClock });
819
938
  })
820
- ), re = (m == null ? void 0 : m.withHeader) !== !1 && t.includeHeaders;
821
- if (re)
939
+ ), se = (m == null ? void 0 : m.withHeader) !== !1 && t.includeHeaders;
940
+ if (se)
822
941
  for (const i of C) {
823
- const y = F.get(i);
824
- y != null && y.pivotIdentity && ce({ identity: y.pivotIdentity, columnKey: A(y) || i });
942
+ const b = S.get(i);
943
+ b != null && b.pivotIdentity && fe({ identity: b.pivotIdentity, columnKey: N(b) || i });
825
944
  }
826
945
  return {
827
- ...re ? { header: G.map((i) => i.label) } : {},
828
- columns: G,
829
- rows: Oe,
830
- ...I.sqlChunkEvidence ? { rawTemporalClassification: I.sqlChunkEvidence } : {}
946
+ ...se ? { header: q.map((i) => i.label) } : {},
947
+ columns: q,
948
+ rows: Be,
949
+ ...M.sqlChunkEvidence ? { rawTemporalClassification: M.sqlChunkEvidence } : {}
831
950
  };
832
951
  }
833
952
  function x(a, m, h) {
834
953
  if (m.activatedColumnKeys.has(a)) {
835
- const v = he(m, a);
954
+ const v = ve(m, a);
836
955
  return v === void 0 ? { kind: "text" } : { kind: "datetime", dateOnly: v };
837
956
  }
838
957
  const p = h.get(a);
839
- if (p) return { kind: "temporal_bucket", grain: Qt(p) };
958
+ if (p) return { kind: "temporal_bucket", grain: dr(p) };
840
959
  if (s(a)) return { kind: "text" };
841
- const T = ge(t, a);
842
- if (T) return { kind: "datetime", dateOnly: Yt(we(T)) };
843
- const g = l(a);
960
+ const T = xe(t, a);
961
+ if (T) return { kind: "datetime", dateOnly: lr(Te(T)) };
962
+ const g = c(a);
844
963
  return g ? { kind: "measure", format: g } : void 0;
845
964
  }
846
965
  function u(a, m) {
847
966
  if (!Number.isInteger(m) || m < 0)
848
967
  throw new Error("totalRows must be a non-negative integer");
849
968
  return m === 0 ? void 0 : (t.visibleColumns ?? Object.keys(a)).map((p) => {
850
- const g = Object.prototype.hasOwnProperty.call(a, p) ? a[p] : p === t.tableTotalsLabelColumnKey ? "Total" : null, v = n ? l(p) : void 0, C = de({
969
+ const g = Object.prototype.hasOwnProperty.call(a, p) ? a[p] : p === t.tableTotalsLabelColumnKey ? "Total" : null, v = n ? c(p) : void 0, C = he({
851
970
  key: p,
852
971
  label: p,
853
972
  formattedValues: n,
@@ -855,14 +974,14 @@ function _r(e) {
855
974
  ...v ? { presentation: { kind: "measure", format: v } } : {}
856
975
  });
857
976
  if (g == null) return { kind: "empty" };
858
- if (!n) return U({ value: g, text: String(g), column: C });
859
- const F = v ? Zt(g) : null;
860
- return U(v && F !== null ? { value: F, text: V(F, v), column: C } : { value: g, text: String(g), column: C });
977
+ if (!n) return j({ value: g, text: String(g), column: C });
978
+ const S = v ? ur(g) : null;
979
+ return j(v && S !== null ? { value: S, text: V(S, v), column: C } : { value: g, text: String(g), column: C });
861
980
  });
862
981
  }
863
982
  return { format: w, totals: u };
864
983
  }
865
- const er = /* @__PURE__ */ new Set([
984
+ const fr = /* @__PURE__ */ new Set([
866
985
  "scope",
867
986
  "useFormattedValues",
868
987
  "timezone",
@@ -877,75 +996,75 @@ const er = /* @__PURE__ */ new Set([
877
996
  "fileFormat",
878
997
  "title"
879
998
  ]);
880
- function ee(e) {
999
+ function oe(e) {
881
1000
  return e !== null && typeof e == "object" && !Array.isArray(e);
882
1001
  }
883
- function Ce(e, t) {
1002
+ function Ee(e, t) {
884
1003
  if (e !== void 0) {
885
- if (!ee(e))
1004
+ if (!oe(e))
886
1005
  throw new Error(`formatting.${t} must be an object`);
887
1006
  return e;
888
1007
  }
889
1008
  }
890
- function Ar(e) {
891
- if (!ee(e))
1009
+ function Qr(e) {
1010
+ if (!oe(e))
892
1011
  throw new Error("formatting must be an object");
893
1012
  const t = ["reportContext", "resolvedFormats"].find(
894
1013
  (a) => Object.prototype.hasOwnProperty.call(e, a)
895
1014
  );
896
1015
  if (t)
897
- throw new ie(
1016
+ throw new de(
898
1017
  `formatting.${t} is retired; formatting.presentationExecutionSnapshot is authoritative.`
899
1018
  );
900
- const r = Object.keys(e).find((a) => !er.has(a));
1019
+ const r = Object.keys(e).find((a) => !fr.has(a));
901
1020
  if (r)
902
1021
  throw new Error(`formatting contains unknown property "${r}"`);
903
1022
  const n = typeof e.timezone == "string" ? e.timezone.trim() : "";
904
1023
  if (!n)
905
1024
  throw new Error("formatting.timezone must be a non-empty string");
906
- const o = at(e.delimiter);
1025
+ const o = ct(e.delimiter);
907
1026
  if (!o)
908
1027
  throw new Error("formatting.delimiter must be a comma, semicolon or tab");
909
- const l = st(e.csvEncoding);
910
- if (!l)
1028
+ const c = lt(e.csvEncoding);
1029
+ if (!c)
911
1030
  throw new Error("formatting.csvEncoding must be 'utf-8-bom' or 'utf-8'");
912
1031
  if (typeof e.includeHeaders != "boolean")
913
1032
  throw new Error("formatting.includeHeaders must be a boolean");
914
1033
  if (e.useFormattedValues !== void 0 && typeof e.useFormattedValues != "boolean")
915
1034
  throw new Error("formatting.useFormattedValues must be a boolean");
916
- const s = e.fileFormat === void 0 ? void 0 : it(e.fileFormat);
1035
+ const s = e.fileFormat === void 0 ? void 0 : ut(e.fileFormat);
917
1036
  if (e.fileFormat !== void 0 && !s)
918
1037
  throw new Error("formatting.fileFormat must be 'csv' or 'xlsx'");
919
1038
  if (e.title !== void 0 && typeof e.title != "string")
920
1039
  throw new Error("formatting.title must be a string");
921
- const c = e.visibleColumns === void 0 ? void 0 : Array.isArray(e.visibleColumns) && e.visibleColumns.every((a) => typeof a == "string") ? e.visibleColumns : void 0;
922
- if (e.visibleColumns !== void 0 && !c)
1040
+ const l = e.visibleColumns === void 0 ? void 0 : Array.isArray(e.visibleColumns) && e.visibleColumns.every((a) => typeof a == "string") ? e.visibleColumns : void 0;
1041
+ if (e.visibleColumns !== void 0 && !l)
923
1042
  throw new Error("formatting.visibleColumns must be an array of strings");
924
- const f = Ce(e.columnLabels, "columnLabels");
1043
+ const f = Ee(e.columnLabels, "columnLabels");
925
1044
  if (f && Object.values(f).some((a) => typeof a != "string"))
926
1045
  throw new Error("formatting.columnLabels values must be strings");
927
- const d = Ce(e.columnSettings, "columnSettings"), b = e.tableTotalsLabelColumnKey === void 0 ? void 0 : typeof e.tableTotalsLabelColumnKey == "string" && e.tableTotalsLabelColumnKey.trim() ? e.tableTotalsLabelColumnKey : null;
928
- if (b === null)
1046
+ const d = Ee(e.columnSettings, "columnSettings"), y = e.tableTotalsLabelColumnKey === void 0 ? void 0 : typeof e.tableTotalsLabelColumnKey == "string" && e.tableTotalsLabelColumnKey.trim() ? e.tableTotalsLabelColumnKey : null;
1047
+ if (y === null)
929
1048
  throw new Error("formatting.tableTotalsLabelColumnKey must be a non-empty string");
930
- if (b && !(c != null && c.includes(b)))
1049
+ if (y && !(l != null && l.includes(y)))
931
1050
  throw new Error("formatting.tableTotalsLabelColumnKey must identify a visible column");
932
- const w = Je(e.scope, "formatting.scope");
1051
+ const w = at(e.scope, "formatting.scope");
933
1052
  if (!w.cardId || w.attachmentIndex !== void 0)
934
1053
  throw new Error("formatting.scope must identify exactly one dashboard card");
935
- const x = e.useFormattedValues !== !1, u = Qe(e.presentationExecutionSnapshot);
1054
+ const x = e.useFormattedValues !== !1, u = st(e.presentationExecutionSnapshot);
936
1055
  if (n !== u.reportContext.calendar.tz)
937
1056
  throw new Error(
938
1057
  "formatting.timezone must equal presentationExecutionSnapshot.reportContext.calendar.tz"
939
1058
  );
940
1059
  try {
941
- et({
1060
+ it({
942
1061
  snapshot: u,
943
1062
  expectedScope: { dashboardId: w.dashboardId, cardId: w.cardId },
944
- visibleColumns: c,
1063
+ visibleColumns: l,
945
1064
  useFormattedValues: x
946
1065
  });
947
1066
  } catch (a) {
948
- throw new ie(
1067
+ throw new de(
949
1068
  `formatting.presentationExecutionSnapshot.${a instanceof Error ? a.message : String(a)}`
950
1069
  );
951
1070
  }
@@ -955,18 +1074,18 @@ function Ar(e) {
955
1074
  timezone: n,
956
1075
  presentationExecutionSnapshot: u,
957
1076
  delimiter: o,
958
- csvEncoding: l,
1077
+ csvEncoding: c,
959
1078
  includeHeaders: e.includeHeaders,
960
1079
  ...d ? { columnSettings: d } : {},
961
- ...c ? { visibleColumns: c } : {},
1080
+ ...l ? { visibleColumns: l } : {},
962
1081
  ...f ? { columnLabels: f } : {},
963
- ...b ? { tableTotalsLabelColumnKey: b } : {},
1082
+ ...y ? { tableTotalsLabelColumnKey: y } : {},
964
1083
  ...s ? { fileFormat: s } : {},
965
1084
  ...typeof e.title == "string" ? { title: e.title } : {}
966
1085
  };
967
1086
  }
968
- function Rr(e) {
969
- const t = e.formatOptions, r = (n) => ee(n) ? n : void 0;
1087
+ function en(e) {
1088
+ const t = e.formatOptions, r = (n) => oe(n) ? n : void 0;
970
1089
  return {
971
1090
  scope: { dashboardId: e.dashboardId, cardId: e.cardId },
972
1091
  useFormattedValues: t.useFormattedValues !== !1,
@@ -983,49 +1102,49 @@ function Rr(e) {
983
1102
  ...typeof e.title == "string" ? { title: e.title } : {}
984
1103
  };
985
1104
  }
986
- const tr = /^\d{4}-\d{2}-\d{2}$/;
987
- function Ae(e) {
1105
+ const pr = /^\d{4}-\d{2}-\d{2}$/;
1106
+ function Ke(e) {
988
1107
  const t = e.split(".");
989
1108
  return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((o) => o.charAt(0).toUpperCase() + o.slice(1).toLowerCase()).join(" ");
990
1109
  }
991
- const xe = 10;
992
- function Z(e, t) {
993
- const r = e.slice(0, xe).map(t).join(", "), n = e.length - xe;
1110
+ const Se = 10;
1111
+ function te(e, t) {
1112
+ const r = e.slice(0, Se).map(t).join(", "), n = e.length - Se;
994
1113
  return n > 0 ? `${r}, and ${n} more` : r;
995
1114
  }
996
- function rr(e) {
1115
+ function br(e) {
997
1116
  if (e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between")
998
1117
  return;
999
- const t = Q(e.relativeMeta);
1118
+ const t = ne(e.relativeMeta);
1000
1119
  if (t)
1001
- return ut(t) || t.unit === "quarter" || t.unit === "year" ? t : void 0;
1120
+ return ft(t) || t.unit === "quarter" || t.unit === "year" ? t : void 0;
1002
1121
  }
1003
- function nr(e, t) {
1004
- if (t !== "label") return rr(e);
1122
+ function hr(e, t) {
1123
+ if (t !== "label") return br(e);
1005
1124
  if (!(e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between"))
1006
- return Q(e.relativeMeta);
1125
+ return ne(e.relativeMeta);
1007
1126
  }
1008
- function Te(e, t = {}) {
1009
- const { name: r, operation: n, values: o, valueType: l } = e, s = t.label ?? Ae(r), c = nr(e, t.relativeDates);
1010
- if (c) {
1011
- const d = yt(c);
1127
+ function $e(e, t = {}) {
1128
+ const { name: r, operation: n, values: o, valueType: c } = e, s = t.label ?? Ke(r), l = hr(e, t.relativeDates);
1129
+ if (l) {
1130
+ const d = wt(l);
1012
1131
  if (d)
1013
1132
  return n === "between" ? `${s}: ${d}` : `${s} not in ${d}`;
1014
1133
  }
1015
1134
  if (!o || o.length === 0)
1016
1135
  return n === "is null" ? `${s} is empty` : n === "is not null" ? `${s} is not empty` : "";
1017
1136
  const f = (d) => {
1018
- if (l === "date" && d) {
1019
- const b = e.temporalPrecision === "minute", w = {
1137
+ if (c === "date" && d) {
1138
+ const y = e.temporalPrecision === "minute", w = {
1020
1139
  year: "numeric",
1021
1140
  month: "short",
1022
1141
  day: "numeric",
1023
- ...b ? {
1142
+ ...y ? {
1024
1143
  hour: "numeric",
1025
1144
  minute: "2-digit"
1026
1145
  } : {}
1027
1146
  };
1028
- if (typeof d == "string" && tr.test(d)) {
1147
+ if (typeof d == "string" && pr.test(d)) {
1029
1148
  const [u, a, m] = d.split("-").map(Number);
1030
1149
  return new Intl.DateTimeFormat(void 0, {
1031
1150
  year: "numeric",
@@ -1034,7 +1153,7 @@ function Te(e, t = {}) {
1034
1153
  timeZone: "UTC"
1035
1154
  }).format(new Date(Date.UTC(u, a - 1, m)));
1036
1155
  }
1037
- if (typeof d == "string" && tt(d) === "wall_datetime") {
1156
+ if (typeof d == "string" && vt(d) === "wall_datetime") {
1038
1157
  const [u, a, m, h, p] = d.split(/[-T :.]/).map(Number);
1039
1158
  return new Intl.DateTimeFormat(void 0, {
1040
1159
  ...w,
@@ -1049,7 +1168,7 @@ function Te(e, t = {}) {
1049
1168
  ...t.timezone ? { timeZone: t.timezone } : {}
1050
1169
  }).format(x);
1051
1170
  } catch {
1052
- return b ? x.toLocaleString(void 0, w) : x.toLocaleDateString(void 0, w);
1171
+ return y ? x.toLocaleString(void 0, w) : x.toLocaleDateString(void 0, w);
1053
1172
  }
1054
1173
  }
1055
1174
  return String(d);
@@ -1073,68 +1192,68 @@ function Te(e, t = {}) {
1073
1192
  return n === "between" ? `${s}: ${d}` : `${s} not in ${d}`;
1074
1193
  }
1075
1194
  case "in":
1076
- return o.length === 1 ? `${s}: ${f(o[0])}` : `${s}: ${Z(o, f)}`;
1195
+ return o.length === 1 ? `${s}: ${f(o[0])}` : `${s}: ${te(o, f)}`;
1077
1196
  case "not in":
1078
- return `${s} not in (${Z(o, f)})`;
1197
+ return `${s} not in (${te(o, f)})`;
1079
1198
  case "like":
1080
1199
  return `${s} contains "${o[0]}"`;
1081
1200
  case "not like":
1082
1201
  return `${s} doesn't contain "${o[0]}"`;
1083
1202
  default:
1084
- return `${s}: ${Z(o, f)}`;
1203
+ return `${s}: ${te(o, f)}`;
1085
1204
  }
1086
1205
  }
1087
- function Nr(e, t = {}) {
1206
+ function tn(e, t = {}) {
1088
1207
  if (!e || e.length === 0)
1089
1208
  return "";
1090
1209
  const r = /* @__PURE__ */ new Map();
1091
1210
  e.forEach((o) => {
1092
- const l = r.get(o.name) || [];
1093
- l.push(o), r.set(o.name, l);
1211
+ const c = r.get(o.name) || [];
1212
+ c.push(o), r.set(o.name, c);
1094
1213
  });
1095
1214
  const n = [];
1096
- return r.forEach((o, l) => {
1215
+ return r.forEach((o, c) => {
1097
1216
  if (o.length === 1) {
1098
- const s = Te(o[0], t);
1217
+ const s = $e(o[0], t);
1099
1218
  s && n.push(s);
1100
1219
  } else {
1101
- const s = Ae(l), c = o.map((f) => Te(f, t).replace(`${s}: `, "").replace(`${s} `, "")).filter(Boolean);
1102
- c.length > 0 && n.push(`${s}: ${c.join(" and ")}`);
1220
+ const s = Ke(c), l = o.map((f) => $e(f, t).replace(`${s}: `, "").replace(`${s} `, "")).filter(Boolean);
1221
+ l.length > 0 && n.push(`${s}: ${l.join(" and ")}`);
1103
1222
  }
1104
1223
  }), n.join(" | ");
1105
1224
  }
1106
- function Or(e) {
1107
- return ((e == null ? void 0 : e.filterValues) ?? []).filter(or).map(ar);
1225
+ function rn(e) {
1226
+ return ((e == null ? void 0 : e.filterValues) ?? []).filter(yr).map(gr);
1108
1227
  }
1109
- function or(e) {
1228
+ function yr(e) {
1110
1229
  return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
1111
1230
  }
1112
- function ar(e) {
1231
+ function gr(e) {
1113
1232
  if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
1114
- const { relativeMeta: t, ...r } = e, n = Q(t);
1233
+ const { relativeMeta: t, ...r } = e, n = ne(t);
1115
1234
  return n ? { ...r, relativeMeta: n } : r;
1116
1235
  }
1117
- const sr = /* @__PURE__ */ new Set([
1236
+ const wr = /* @__PURE__ */ new Set([
1118
1237
  "day",
1119
1238
  "week",
1120
1239
  "month",
1121
1240
  "quarter",
1122
1241
  "year"
1123
1242
  ]);
1124
- function ir(e, t) {
1243
+ function vr(e, t) {
1125
1244
  try {
1126
- const r = L(
1245
+ const r = k(
1127
1246
  R(e),
1128
1247
  t,
1129
1248
  "yyyy-MM-dd"
1130
- ), [n, o, l] = r.split("-").map(Number), s = new Date(Date.UTC(n, o - 1, l));
1131
- return s.setUTCDate(s.getUTCDate() - 1), L(s, "UTC", "yyyy-MM-dd");
1249
+ ), [n, o, c] = r.split("-").map(Number), s = new Date(Date.UTC(n, o - 1, c));
1250
+ return s.setUTCDate(s.getUTCDate() - 1), k(s, "UTC", "yyyy-MM-dd");
1132
1251
  } catch {
1133
1252
  return;
1134
1253
  }
1135
1254
  }
1136
- function Kr(e, t, r, n = !1) {
1137
- const o = lr(
1255
+ function nn(e, t, r, n = !1) {
1256
+ const o = Cr(
1138
1257
  e,
1139
1258
  t,
1140
1259
  r,
@@ -1142,19 +1261,19 @@ function Kr(e, t, r, n = !1) {
1142
1261
  );
1143
1262
  return `${o.start} - ${o.end}`;
1144
1263
  }
1145
- function lr(e, t, r, n = !1) {
1264
+ function Cr(e, t, r, n = !1) {
1146
1265
  try {
1147
- if (r && sr.has(r)) {
1148
- const o = ir(e.end, t);
1266
+ if (r && wr.has(r)) {
1267
+ const o = vr(e.end, t);
1149
1268
  if (o) {
1150
- const l = n ? "MMM d" : "MMM d, yyyy";
1269
+ const c = n ? "MMM d" : "MMM d, yyyy";
1151
1270
  return {
1152
- start: L(
1271
+ start: k(
1153
1272
  R(e.start),
1154
1273
  t,
1155
- l
1274
+ c
1156
1275
  ),
1157
- end: L(
1276
+ end: k(
1158
1277
  R(`${o}T00:00:00Z`),
1159
1278
  "UTC",
1160
1279
  "MMM d, yyyy"
@@ -1165,8 +1284,8 @@ function lr(e, t, r, n = !1) {
1165
1284
  if (r === "second" || r === "minute" || r === "hour") {
1166
1285
  const o = n ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
1167
1286
  return {
1168
- start: L(R(e.start), t, o),
1169
- end: `before ${L(
1287
+ start: k(R(e.start), t, o),
1288
+ end: `before ${k(
1170
1289
  R(e.end),
1171
1290
  t,
1172
1291
  o
@@ -1178,41 +1297,47 @@ function lr(e, t, r, n = !1) {
1178
1297
  return { start: e.start, end: `before ${e.end}` };
1179
1298
  }
1180
1299
  export {
1181
- Dr as A,
1182
- xe as B,
1183
- rr as C,
1184
- $e as D,
1185
- Te as E,
1186
- $t as F,
1187
- Nr as G,
1188
- Or as H,
1189
- lr as I,
1190
- xr as M,
1191
- Rt as P,
1192
- vr as a,
1193
- Tr as b,
1194
- Er as c,
1195
- Sr as d,
1196
- Cr as e,
1197
- Kr as f,
1198
- Fr as g,
1199
- Ir as h,
1200
- $r as i,
1201
- Kt as j,
1202
- Lr as k,
1203
- kr as l,
1204
- Ot as m,
1205
- Mr as n,
1206
- Lt as o,
1207
- Nt as p,
1208
- Dt as q,
1209
- de as r,
1210
- At as s,
1211
- U as t,
1212
- Ut as u,
1213
- jt as v,
1214
- Pr as w,
1215
- _r as x,
1216
- Ar as y,
1217
- Rr as z
1300
+ er as A,
1301
+ Yr as B,
1302
+ Wr as C,
1303
+ Pe as D,
1304
+ Jr as E,
1305
+ Dt as F,
1306
+ Qr as G,
1307
+ en as H,
1308
+ Zr as I,
1309
+ Se as J,
1310
+ br as K,
1311
+ $e as L,
1312
+ Nr as M,
1313
+ tn as N,
1314
+ rn as O,
1315
+ Vt as P,
1316
+ Cr as Q,
1317
+ Pr as a,
1318
+ Rr as b,
1319
+ Or as c,
1320
+ Ur as d,
1321
+ Dr as e,
1322
+ nn as f,
1323
+ Kr as g,
1324
+ Br as h,
1325
+ zr as i,
1326
+ zt as j,
1327
+ Xr as k,
1328
+ Vr as l,
1329
+ Bt as m,
1330
+ jr as n,
1331
+ Nt as o,
1332
+ jt as p,
1333
+ Ot as q,
1334
+ he as r,
1335
+ Kt as s,
1336
+ j as t,
1337
+ Ht as u,
1338
+ Gt as v,
1339
+ Hr as w,
1340
+ Gr as x,
1341
+ qt as y,
1342
+ qr as z
1218
1343
  };