react-semaphor 0.1.543 → 0.1.545

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 (125) hide show
  1. package/dist/activity/index.js +73 -0
  2. package/dist/analytics-protocol/index.js +35 -34
  3. package/dist/assistant-context/index.js +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/briefings/index.js +56 -52
  6. package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
  7. package/dist/chunks/{apply-dashboard-operations-CG9S7MGt.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
  8. package/dist/chunks/{assistant-chat-BFMRUYoB.js → assistant-chat-D7sWTypJ.js} +26 -27
  9. package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
  10. package/dist/chunks/{comparison-window-caption-Bv18samq.js → comparison-window-caption-D4E6IHPD.js} +462 -456
  11. package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
  12. package/dist/chunks/dashboard-B1tMju0u.js +14 -0
  13. package/dist/chunks/dashboard-briefing-launcher-CePgIu0Z.js +3720 -0
  14. package/dist/chunks/{dashboard-controls-UGpjOM2k.js → dashboard-controls-Cq05n3e0.js} +526 -521
  15. package/dist/chunks/{dashboard-json-DG8dz0eX.js → dashboard-json-CoYRPqxx.js} +3 -3
  16. package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
  17. package/dist/chunks/{edit-dashboard-visual-CDpA4y5e.js → edit-dashboard-visual-JPtNfJRb.js} +5628 -5618
  18. package/dist/chunks/export-file-format-C-tJsxsf.js +111 -0
  19. package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
  20. package/dist/chunks/{index-l5LclZvs.js → index-DRWiuqyd.js} +378 -332
  21. package/dist/chunks/{matrix-formatter-BnsTX90d.js → matrix-formatter-DnCyRXJE.js} +13 -13
  22. package/dist/chunks/{numeric-presentation-F_-H6VAw.js → numeric-presentation-7X_IrD58.js} +2572 -2573
  23. package/dist/chunks/{pivot-result-lifecycle-DupbRk-R.js → pivot-result-lifecycle-DM4CyGKs.js} +285 -393
  24. package/dist/chunks/{raw-temporal-presentation-D-azM_98.js → raw-temporal-presentation-C3mUgnEx.js} +2 -2
  25. package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
  26. package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
  27. package/dist/chunks/{report-preferences-dialog-CPwRwEJx.js → report-preferences-dialog-DUtuUL_5.js} +640 -612
  28. package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
  29. package/dist/chunks/{saved-dashboard-context-BKvMfRfC.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
  30. package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
  31. package/dist/chunks/{semaphor-ready-indicator-CN2AHm2x.js → semaphor-ready-indicator-BxF96Yhv.js} +46859 -47102
  32. package/dist/chunks/shelf-drop-preview-context-CNaM_Gmh.js +2469 -0
  33. package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
  34. package/dist/chunks/{table-export-sheet-BDRXLLdq.js → table-export-sheet-YzMioA7Y.js} +1 -1
  35. package/dist/chunks/{use-create-flow-overlay-state-BnclfB2k.js → use-create-flow-overlay-state-CjB7ig1o.js} +153 -164
  36. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
  37. package/dist/dashboard/index.js +1 -1
  38. package/dist/dashboard-authoring/index.js +553 -541
  39. package/dist/data-app-sdk/index.js +1 -1
  40. package/dist/format-utils/index.js +241 -227
  41. package/dist/index.js +354 -331
  42. package/dist/style.css +1 -1
  43. package/dist/surfboard/index.js +1 -1
  44. package/dist/types/activity.d.ts +2 -0
  45. package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
  46. package/dist/types/briefings/attachments.d.ts +33 -6
  47. package/dist/types/briefings/index.d.ts +6 -5
  48. package/dist/types/components/activity/activity-bell.d.ts +11 -0
  49. package/dist/types/components/activity/activity-instance.d.ts +50 -0
  50. package/dist/types/components/activity/activity-notices.d.ts +7 -0
  51. package/dist/types/components/activity/activity-provider.d.ts +21 -0
  52. package/dist/types/components/activity/activity-types.d.ts +177 -0
  53. package/dist/types/components/activity/index.d.ts +6 -0
  54. package/dist/types/components/activity/use-activity.d.ts +20 -0
  55. package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
  56. package/dist/types/components/briefings/briefing-author.d.ts +14 -12
  57. package/dist/types/components/briefings/dashboard-briefing-launcher.d.ts +5 -0
  58. package/dist/types/components/briefings/use-briefing-run-detail.d.ts +34 -0
  59. package/dist/types/components/index.d.ts +1 -4
  60. package/dist/types/components/surfboard/filter/types.d.ts +0 -14
  61. package/dist/types/lib/activity-identity.d.ts +21 -0
  62. package/dist/types/lib/api/exports-api.d.ts +4 -4
  63. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
  64. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
  65. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
  66. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
  67. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
  68. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
  69. package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
  70. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
  71. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
  72. package/dist/types/lib/download-pdf.d.ts +75 -1
  73. package/dist/types/lib/hooks/index.d.ts +1 -3
  74. package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
  75. package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
  76. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
  77. package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
  78. package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
  79. package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
  80. package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
  81. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
  82. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
  83. package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
  84. package/dist/types/lib/stores/editor-store.d.ts +0 -3
  85. package/dist/types/lib/types/common-types.d.ts +21 -6
  86. package/dist/types/shared/activity/activity-contract.d.ts +84 -0
  87. package/dist/types/shared/activity/index.d.ts +5 -0
  88. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
  89. package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +6 -0
  90. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
  91. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
  92. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
  93. package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
  94. package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
  95. package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
  96. package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
  97. package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
  98. package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
  99. package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
  100. package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
  101. package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
  102. package/dist/types/shared/format-utils/export-policy.d.ts +12 -0
  103. package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
  104. package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
  105. package/package.json +6 -2
  106. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
  107. package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
  108. package/dist/chunks/dashboard-B9mKTJoy.js +0 -14
  109. package/dist/chunks/dashboard-briefing-launcher-Bdmry_oG.js +0 -4248
  110. package/dist/chunks/document-dashboard-inputs-OwqCbrVp.js +0 -8087
  111. package/dist/chunks/document-sheet-utils-BTb3VZxV.js +0 -3619
  112. package/dist/chunks/shelf-drop-preview-context-BGl_rxcW.js +0 -2407
  113. package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
  114. package/dist/types/components/briefings/briefing-author/run-ui.d.ts +0 -81
  115. package/dist/types/components/briefings/use-briefing-run-polling.d.ts +0 -34
  116. package/dist/types/components/notifications/export-notification-item.d.ts +0 -24
  117. package/dist/types/components/notifications/export-notification-list.d.ts +0 -8
  118. package/dist/types/components/notifications/index.d.ts +0 -3
  119. package/dist/types/components/notifications/notification-bell.d.ts +0 -13
  120. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
  121. package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
  122. package/dist/types/lib/exports/bounded-request.d.ts +0 -12
  123. package/dist/types/lib/hooks/use-export-polling.d.ts +0 -32
  124. package/dist/types/lib/hooks/use-export-recovery.d.ts +0 -11
  125. package/dist/types/lib/stores/export-store.d.ts +0 -62
@@ -1,39 +1,41 @@
1
- var Je = Object.defineProperty;
2
- var Qe = (e, t, r) => t in e ? Je(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var fe = (e, t, r) => Qe(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { i as et, j as V, m as tt, Q as oe, f as Ie, F as $e, P as rt, r as nt, M as ot, v as at, c as st, p as it, J as lt, a as j, G as ct, I as ut } from "./temporal-bucket-D7NBrrtL.js";
5
- import { i as _e, m as te, j as De, k as mt, l as Re, a as ge, d as dt, n as $ } from "./matrix-formatter-BnsTX90d.js";
6
- import { j as Z, Y as Pe, a as ft, Q as pe, O as gt, P as ye, g as pt, p as yt, m as ht, I as bt, K as wt, R as vt, a2 as O } from "./pivot-result-lifecycle-DupbRk-R.js";
7
- import { aC as U, l as Tt, w as X, aB as Ct, y as ae, x as xt } from "./validators-DMHTpf7a.js";
1
+ var Qe = Object.defineProperty;
2
+ var et = (e, t, r) => t in e ? Qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var fe = (e, t, r) => et(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { i as tt, j as V, m as rt, Q as ne, f as Ie, F as $e, P as ot, r as nt, M as at, v as st, c as it, p as lt, J as ct, a as j, G as ut, I as mt } from "./temporal-bucket-D7NBrrtL.js";
5
+ import { i as _e, m as te, j as De, k as dt, l as Re, a as ge, d as ft, n as $ } from "./matrix-formatter-DnCyRXJE.js";
6
+ import { h as Z, e as gt, p as pt, k as yt } from "./export-file-format-C-tJsxsf.js";
7
+ import { aC as U, l as ht, w as X, aB as bt, y as ae, x as wt } from "./validators-DMHTpf7a.js";
8
8
  import "./matrix-operation-contract-8OIO4gob.js";
9
9
  import "./analytics-base-schemas-BFAoRlkU.js";
10
10
  import "zod";
11
- import { PDF_SAFETY_LIMIT_EXCEEDED as Ne, getUtf8ByteLength as St, FAST_PDF_POLICY as Et } from "../pdf-export-policy/index.js";
12
- import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as kt } from "../value-format-preferences/index.js";
13
- import { z as At, g as Lt } from "./zoned-wall-clock-MulfA26h.js";
11
+ import { A as Pe, a as vt, t as pe, s as Tt, P as ye, l as Ct, o as xt, v as St, G as O } from "./pivot-result-lifecycle-DM4CyGKs.js";
12
+ import { PDF_SAFETY_LIMIT_EXCEEDED as Ne, getUtf8ByteLength as Et, FAST_PDF_POLICY as kt } from "../pdf-export-policy/index.js";
13
+ import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as At } from "../value-format-preferences/index.js";
14
+ import { z as Lt } from "./zoned-wall-clock-BkxV9jS2.js";
14
15
  import { p as Ft } from "./pivot-header-presentation-DHcx1XGQ.js";
15
16
  import { d as Mt, c as he } from "./pivot-result-identity-DJhXXcns.js";
16
17
  import { v as It } from "./raw-temporal-contract-C51YG48G.js";
17
- function $t(e, t, r) {
18
- const n = {
18
+ import { g as $t } from "./relative-date-label-Bk2j94pA.js";
19
+ function _t(e, t, r) {
20
+ const o = {
19
21
  ...t,
20
22
  locale: t.locale ?? r
21
23
  };
22
- if (n.type === "number")
23
- return V(e, n);
24
- const { prefix: o, suffix: i, ...a } = n;
25
- return `${o ?? ""}${V(e, {
24
+ if (o.type === "number")
25
+ return V(e, o);
26
+ const { prefix: n, suffix: i, ...a } = o;
27
+ return `${n ?? ""}${V(e, {
26
28
  ...a,
27
- negativeStyle: n.type === "currency" ? n.negativeStyle : "minus"
29
+ negativeStyle: o.type === "currency" ? o.negativeStyle : "minus"
28
30
  })}${i ?? ""}`;
29
31
  }
30
32
  function q(e, t, r) {
31
- return e === null ? { value: e, text: null } : !t || !et(t) && t.type !== "duration" ? {
33
+ return e === null ? { value: e, text: null } : !t || !tt(t) && t.type !== "duration" ? {
32
34
  value: e,
33
35
  text: V(e, { type: "number", locale: r })
34
36
  } : t.type === "duration" ? {
35
37
  value: e,
36
- text: tt(e, {
38
+ text: rt(e, {
37
39
  inputUnit: t.inputUnit,
38
40
  outputStyle: t.outputStyle,
39
41
  largestUnit: t.largestUnit,
@@ -43,10 +45,10 @@ function q(e, t, r) {
43
45
  suffix: t.suffix,
44
46
  negativeInParentheses: t.negativeStyle === "parentheses"
45
47
  })
46
- } : { value: e, text: $t(e, t, r) };
48
+ } : { value: e, text: _t(e, t, r) };
47
49
  }
48
- function be(e, t, r, n) {
49
- return e === null ? { value: e, text: null } : n === "percent" ? {
50
+ function be(e, t, r, o) {
51
+ return e === null ? { value: e, text: null } : o === "percent" ? {
50
52
  value: e,
51
53
  text: V(e, {
52
54
  type: "percent",
@@ -72,7 +74,7 @@ function we(e, t) {
72
74
  throw new RangeError("Comparison precision must be an integer from 0 to 6.");
73
75
  return e;
74
76
  }
75
- function un(e, t) {
77
+ function fo(e, t) {
76
78
  const r = {
77
79
  mode: t.displayMode,
78
80
  current: q(
@@ -102,19 +104,19 @@ function un(e, t) {
102
104
  "ratio"
103
105
  )), r;
104
106
  }
105
- const _t = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
106
- function Dt(e) {
107
+ const Dt = /* @__PURE__ */ new Set(["second", "minute", "hour", "day", "month"]);
108
+ function Rt(e) {
107
109
  const { presentation: t } = e;
108
- 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" ? _t.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";
110
+ 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" ? Dt.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";
109
111
  }
110
- function Rt(e) {
111
- const t = (o, i) => Number.isInteger(o) ? Math.min(20, Math.max(0, o)) : i, r = t(e.minimumFractionDigits, 0), n = Math.max(r, t(e.maximumFractionDigits, 2));
112
- return n === 0 ? "" : `.${"0".repeat(n)}`;
112
+ function Pt(e) {
113
+ const t = (n, i) => Number.isInteger(n) ? Math.min(20, Math.max(0, n)) : i, r = t(e.minimumFractionDigits, 0), o = Math.max(r, t(e.maximumFractionDigits, 2));
114
+ return o === 0 ? "" : `.${"0".repeat(o)}`;
113
115
  }
114
116
  function J(e) {
115
117
  return `"${e.replace(/"/g, "")}"`;
116
118
  }
117
- function Pt(e) {
119
+ function Nt(e) {
118
120
  let t;
119
121
  try {
120
122
  t = new Intl.NumberFormat(e.locale ?? "en-US", {
@@ -124,33 +126,33 @@ function Pt(e) {
124
126
  } catch {
125
127
  return;
126
128
  }
127
- const r = t.findIndex((i) => i.type === "currency"), n = t.findIndex((i) => i.type === "integer");
128
- if (r < 0 || n < 0) return;
129
- const o = (i, a) => t.slice(i, a).filter((l) => l.type === "literal").map((l) => l.value.replace(/\s/g, " ")).join("");
130
- return r < n ? { side: "before", text: t[r].value + o(r + 1, n) } : {
129
+ const r = t.findIndex((i) => i.type === "currency"), o = t.findIndex((i) => i.type === "integer");
130
+ if (r < 0 || o < 0) return;
131
+ const n = (i, a) => t.slice(i, a).filter((l) => l.type === "literal").map((l) => l.value.replace(/\s/g, " ")).join("");
132
+ return r < o ? { side: "before", text: t[r].value + n(r + 1, o) } : {
131
133
  side: "after",
132
- text: o(n + 1, r) + t[r].value
134
+ text: n(o + 1, r) + t[r].value
133
135
  };
134
136
  }
135
- function Nt(e) {
136
- const t = Rt(e);
137
+ function Ot(e) {
138
+ const t = Pt(e);
137
139
  let r;
138
140
  if (e.type === "scientific")
139
141
  r = `0${t}E+00`;
140
142
  else {
141
- const n = `${e.useGrouping === !1 ? "0" : "#,##0"}${t}`;
143
+ const o = `${e.useGrouping === !1 ? "0" : "#,##0"}${t}`;
142
144
  if (e.type === "currency") {
143
- const o = Pt(e);
144
- r = o ? o.side === "before" ? `${J(o.text)}${n}` : `${n}${J(o.text)}` : n;
145
- } else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${n}${J("%")}` : `${n}%` : r = n;
145
+ const n = Nt(e);
146
+ r = n ? n.side === "before" ? `${J(n.text)}${o}` : `${o}${J(n.text)}` : o;
147
+ } else e.type === "percent" ? r = e.percentValueMode === "whole" ? `${o}${J("%")}` : `${o}%` : r = o;
146
148
  }
147
149
  return e.negativeStyle === "parentheses" ? `${r};(${r})` : r;
148
150
  }
149
- function Ot(e, t) {
151
+ function Vt(e, t) {
150
152
  if (!e.formattedValues) return;
151
153
  const { presentation: r } = e;
152
154
  if (t === "number" || t === "by_value")
153
- return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : Nt(r.format);
155
+ return (r == null ? void 0 : r.kind) !== "measure" || r.format.type === "duration" ? void 0 : Ot(r.format);
154
156
  if (t === "date") {
155
157
  if ((r == null ? void 0 : r.kind) === "temporal_bucket")
156
158
  return r.grain === "day" ? "yyyy-mm-dd" : r.grain === "month" ? "mmm yyyy" : "yyyy-mm-dd hh:mm";
@@ -159,7 +161,7 @@ function Ot(e, t) {
159
161
  }
160
162
  }
161
163
  function ve(e) {
162
- const t = Dt(e), r = Ot(e, t);
164
+ const t = Rt(e), r = Vt(e, t);
163
165
  return Object.freeze({
164
166
  key: e.key,
165
167
  label: e.label,
@@ -167,18 +169,18 @@ function ve(e) {
167
169
  ...r === void 0 ? {} : { numberFormat: r }
168
170
  });
169
171
  }
170
- const Vt = 15, Ut = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
172
+ const Ut = 15, Kt = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
171
173
  function Oe(e) {
172
- return Ut.test(e) ? e : void 0;
174
+ return Kt.test(e) ? e : void 0;
173
175
  }
174
176
  function Te(e) {
175
177
  const r = e.replace(/^-/, "").replace(/[eE].*$/, "").replace(".", "").replace(/^0+/, "").replace(/0+$/, "");
176
- if (r.length > Vt) return !1;
177
- const n = Number(e);
178
- return Number.isFinite(n) && (n !== 0 || r.length === 0);
178
+ if (r.length > Ut) return !1;
179
+ const o = Number(e);
180
+ return Number.isFinite(o) && (o !== 0 || r.length === 0);
179
181
  }
180
- const Kt = Date.UTC(1900, 2, 1), Bt = Date.UTC(1e4, 0, 1), zt = Date.UTC(1899, 11, 30), jt = 864e5;
181
- function Gt(e) {
182
+ const Bt = Date.UTC(1900, 2, 1), zt = Date.UTC(1e4, 0, 1), jt = Date.UTC(1899, 11, 30), Gt = 864e5;
183
+ function Ht(e) {
182
184
  const t = Date.UTC(
183
185
  e.year,
184
186
  e.month - 1,
@@ -187,8 +189,8 @@ function Gt(e) {
187
189
  e.minute,
188
190
  e.second
189
191
  );
190
- if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < Kt || t >= Bt))
191
- return (t - zt) / jt;
192
+ if (!(e.year < 1900 || !Number.isFinite(t)) && !(t < Bt || t >= zt))
193
+ return (t - jt) / Gt;
192
194
  }
193
195
  function Ce(e, t, r) {
194
196
  if (typeof e == "number")
@@ -196,52 +198,55 @@ function Ce(e, t, r) {
196
198
  if (U(e))
197
199
  return Te(e.value) ? { kind: "number", text: t, value: e } : void 0;
198
200
  if (r && typeof e == "string") {
199
- const n = Oe(e);
200
- return n !== void 0 && Te(n) ? { kind: "number", text: t, value: n } : void 0;
201
+ const o = Oe(e);
202
+ return o !== void 0 && Te(o) ? { kind: "number", text: t, value: o } : void 0;
201
203
  }
202
204
  }
203
205
  function P(e) {
204
- const { value: t, text: r, column: n } = e;
206
+ const { value: t, text: r, column: o } = e;
205
207
  if (r === "") return { kind: "empty" };
206
- const o = { kind: "text", text: r };
207
- switch (n.cellType) {
208
+ const n = { kind: "text", text: r };
209
+ switch (o.cellType) {
208
210
  case "text":
209
- return o;
211
+ return n;
210
212
  case "date": {
211
- const i = e.wallClock ? Gt(e.wallClock) : void 0;
212
- return i === void 0 ? o : { kind: "date", text: r, serial: i };
213
+ const i = e.wallClock ? Ht(e.wallClock) : void 0;
214
+ return i === void 0 ? n : { kind: "date", text: r, serial: i };
213
215
  }
214
216
  case "number":
215
- return Ce(t, r, !0) ?? o;
217
+ return Ce(t, r, !0) ?? n;
216
218
  case "boolean":
217
- return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : o;
219
+ return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : n;
218
220
  case "by_value":
219
- return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : Ce(t, r, !1) ?? o;
221
+ return typeof t == "boolean" ? { kind: "boolean", text: r, value: t } : Ce(t, r, !1) ?? n;
220
222
  }
221
223
  }
222
- function mn(e) {
224
+ function go(e) {
223
225
  return e.kind === "empty" ? "" : e.text;
224
226
  }
225
- const Ht = 1e4, dn = 1e6, fn = 5e6, gn = 1024 ** 3, pn = 1024 ** 3;
226
- function yn(e) {
227
- return e > Ht;
227
+ const Ve = 1e4, Xt = 1e6, po = 5e6, yo = 1024 ** 3, ho = 1024 ** 3;
228
+ function bo(e) {
229
+ return e > Ve;
228
230
  }
229
- const hn = {
231
+ function wo(e) {
232
+ return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= Ve ? "direct" : e.loadedRowCount <= Xt ? "background" : "blocked";
233
+ }
234
+ const vo = {
230
235
  rowLabels: "tabular",
231
236
  subtotals: "after"
232
237
  };
233
- function bn(e, t) {
234
- const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, n = e.totals.rows;
238
+ function To(e, t) {
239
+ const r = t.rowLabels === "outline" ? { kind: "compact" } : e.layout.kind === "tabular" ? e.layout : { kind: "tabular", repeatLabels: !1 }, o = e.totals.rows;
235
240
  return {
236
241
  ...e,
237
242
  layout: r,
238
243
  totals: {
239
244
  ...e.totals,
240
245
  rows: {
241
- ...n,
246
+ ...o,
242
247
  levels: Object.fromEntries(
243
- Object.entries(n.levels).map(([o, i]) => [
244
- o,
248
+ Object.entries(o.levels).map(([n, i]) => [
249
+ n,
245
250
  { ...i, position: t.subtotals }
246
251
  ])
247
252
  )
@@ -249,29 +254,29 @@ function bn(e, t) {
249
254
  }
250
255
  };
251
256
  }
252
- const Xt = 2;
253
- function Wt(e) {
257
+ const Wt = 2;
258
+ function Yt(e) {
254
259
  return typeof e == "number" ? Number.isInteger(e) : U(e) ? !e.value.includes(".") : !0;
255
260
  }
256
- function Yt(e, t, r) {
257
- const n = e.descriptors.measures.filter(
258
- (a) => r.measureFormats[a.id] === void 0 && a.semanticFormat === void 0 && Tt(a.column.dataType) === "number"
261
+ function Zt(e, t, r) {
262
+ const o = e.descriptors.measures.filter(
263
+ (a) => r.measureFormats[a.id] === void 0 && a.semanticFormat === void 0 && ht(a.column.dataType) === "number"
259
264
  );
260
- if (n.length === 0) return r;
261
- const o = /* @__PURE__ */ new Set();
265
+ if (o.length === 0) return r;
266
+ const n = /* @__PURE__ */ new Set();
262
267
  e.columns.forEach((a, l) => {
263
- if (!(a.kind !== "measure" || o.has(a.measureId)))
268
+ if (!(a.kind !== "measure" || n.has(a.measureId)))
264
269
  for (const m of t) {
265
270
  const u = m.values[l];
266
- if ((u == null ? void 0 : u.kind) === "value" && !Wt(u.value)) {
267
- o.add(a.measureId);
271
+ if ((u == null ? void 0 : u.kind) === "value" && !Yt(u.value)) {
272
+ n.add(a.measureId);
268
273
  return;
269
274
  }
270
275
  }
271
276
  });
272
277
  const i = { ...r.measureFormats };
273
- for (const { id: a } of n) {
274
- const l = o.has(a) ? Xt : 0;
278
+ for (const { id: a } of o) {
279
+ const l = n.has(a) ? Wt : 0;
275
280
  i[a] = {
276
281
  type: "number",
277
282
  minimumFractionDigits: l,
@@ -284,21 +289,21 @@ function Yt(e, t, r) {
284
289
  function G(e) {
285
290
  return X(e.slice(0, -1));
286
291
  }
287
- function Zt(e, t) {
292
+ function qt(e, t) {
288
293
  return t.length > e.length && X(t.slice(0, e.length)) === X(e);
289
294
  }
290
- function qt(e) {
295
+ function Jt(e) {
291
296
  return e.map((t, r) => {
292
297
  if (r === 0 || t.kind !== "layout") return !1;
293
- const n = e[r - 1];
294
- if (n.kind !== "layout") return !1;
295
- if (t.role !== "member" || Zt(n.rowPath, t.rowPath)) return !0;
296
- const o = e[r - 2];
297
- return n.role === "member" && (!o || o.kind !== "layout" || o.role !== "member" || G(o.rowPath) !== G(n.rowPath)) && t.rowPath.length === n.rowPath.length && G(t.rowPath) === G(n.rowPath);
298
+ const o = e[r - 1];
299
+ if (o.kind !== "layout") return !1;
300
+ if (t.role !== "member" || qt(o.rowPath, t.rowPath)) return !0;
301
+ const n = e[r - 2];
302
+ return o.role === "member" && (!n || n.kind !== "layout" || n.role !== "member" || G(n.rowPath) !== G(o.rowPath)) && t.rowPath.length === o.rowPath.length && G(t.rowPath) === G(o.rowPath);
298
303
  });
299
304
  }
300
- const Jt = "pdf-group-continuation";
301
- function Qt(e) {
305
+ const Qt = "pdf-group-continuation";
306
+ function er(e) {
302
307
  if (!e.previousRow || e.row.isSubtotal === !0 || e.row.isGrandTotal === !0 || e.previousRow.isSubtotal === !0 || e.previousRow.isGrandTotal === !0)
303
308
  return !0;
304
309
  for (let t = 0; t <= e.levelIndex; t++)
@@ -306,21 +311,21 @@ function Qt(e) {
306
311
  return !0;
307
312
  return !1;
308
313
  }
309
- function Ve(e, t, r) {
314
+ function Ue(e, t, r) {
310
315
  return !(r != null && r.hasTextAffixes) && t.kind === "value" && (typeof t.value == "number" || U(t.value)) ? e : Z(e);
311
316
  }
312
- function er(e, t, r) {
313
- const n = _e(e.descriptors, t.presentation, r), o = e.columns.map((d) => {
317
+ function tr(e, t, r) {
318
+ const o = _e(e.descriptors, t.presentation, r), n = e.columns.map((d) => {
314
319
  var s;
315
- return d.kind === "measure" && ((s = n.measureSemantics.get(d.measureId)) == null ? void 0 : s.isNumeric) === !0;
316
- }), i = (d) => te([d], n.levels), a = (d, s, f) => De(d, s, t.presentation.totals[f], n.levels), l = e.columns.map((d) => {
320
+ return d.kind === "measure" && ((s = o.measureSemantics.get(d.measureId)) == null ? void 0 : s.isNumeric) === !0;
321
+ }), i = (d) => te([d], o.levels), a = (d, s, f) => De(d, s, t.presentation.totals[f], o.levels), l = e.columns.map((d) => {
317
322
  if (d.kind !== "measure") return d.label;
318
323
  const s = d.columnPath.map(i);
319
324
  return d.role !== "member" && s.push(a(d.columnPath, d.role, "columns")), [...s, d.label].join(" / ");
320
325
  }), m = Math.min(t.spec.columns.length, Math.max(
321
326
  0,
322
327
  ...e.columns.map((d) => d.kind === "measure" ? d.columnPath.length + (d.role !== "member" ? 1 : 0) : 0)
323
- )), u = Array.from({ length: m + 1 }, (d, s) => e.columns.map((f) => s === m ? f.label : f.kind !== "measure" ? "" : s < f.columnPath.length ? i(f.columnPath[s]) : s === f.columnPath.length && f.role !== "member" ? a(f.columnPath, f.role, "columns") : "")), g = (d, s) => mt({
328
+ )), u = Array.from({ length: m + 1 }, (d, s) => e.columns.map((f) => s === m ? f.label : f.kind !== "measure" ? "" : s < f.columnPath.length ? i(f.columnPath[s]) : s === f.columnPath.length && f.role !== "member" ? a(f.columnPath, f.role, "columns") : "")), g = (d, s) => dt({
324
329
  path: d.rowPath,
325
330
  role: d.kind === "layout" ? d.role : "member",
326
331
  levelCount: Math.max(1, t.spec.rows.length),
@@ -335,23 +340,23 @@ function er(e, t, r) {
335
340
  return `${" ".repeat(Math.max(0, d.rowPath.length - 1))}${a(d.rowPath, d.role, "rows")}`;
336
341
  if (b.kind === "level") {
337
342
  const C = t.spec.rows.findIndex((F) => F.id === b.levelId), x = f[C];
338
- return x != null && x.visible ? x.total ? a(d.rowPath, d.role, "rows") : te(x.path, n.levels) : "";
343
+ return x != null && x.visible ? x.total ? a(d.rowPath, d.role, "rows") : te(x.path, o.levels) : "";
339
344
  }
340
- const S = d.values[y], w = n.measures.get(b.measureId);
345
+ const S = d.values[y], w = o.measures.get(b.measureId);
341
346
  if (S.kind === "value" && !w)
342
347
  throw new Error("Matrix value is missing its measure descriptor.");
343
348
  return Re(S, w, t.presentation.absence);
344
349
  });
345
350
  }, v = (d, s) => p(d, s).map((f, b) => {
346
351
  const y = e.columns[b];
347
- return y.kind === "measure" ? Ve(f, d.values[b], n.measureSemantics.get(y.measureId)) : Z(f);
352
+ return y.kind === "measure" ? Ue(f, d.values[b], o.measureSemantics.get(y.measureId)) : Z(f);
348
353
  });
349
354
  return {
350
355
  headers: l,
351
356
  headerBands: u,
352
- numericColumns: o,
357
+ numericColumns: n,
353
358
  /** The card's prepared formats this presentation formats with (the Excel form reads its measure formats). */
354
- formatting: n,
359
+ formatting: o,
355
360
  /** A row's cells; after `previous`, a tabular layout prints each label once. */
356
361
  row: (d, s) => p(d, s),
357
362
  /**
@@ -382,37 +387,37 @@ function er(e, t, r) {
382
387
  csvRows: (d, s) => d.map((f, b) => v(f, b ? d[b - 1] : s ?? void 0))
383
388
  };
384
389
  }
385
- function wn(e) {
390
+ function Co(e) {
386
391
  return e.columns.map((t) => Z(t.label));
387
392
  }
388
- function vn(e, t, r) {
389
- return tr(e, t, r).map((n, o) => {
390
- const i = t.columns[o];
391
- return i.kind === "measure" ? Ve(n, e.values[o], r.measureSemantics.get(i.measureId)) : Z(n);
393
+ function xo(e, t, r) {
394
+ return rr(e, t, r).map((o, n) => {
395
+ const i = t.columns[n];
396
+ return i.kind === "measure" ? Ue(o, e.values[n], r.measureSemantics.get(i.measureId)) : Z(o);
392
397
  });
393
398
  }
394
- function tr(e, t, r) {
399
+ function rr(e, t, r) {
395
400
  if (e.kind !== "flat") throw new Error("Flat Matrix CSV requires flat rows.");
396
401
  if (e.values.length !== t.columns.length) throw new Error("Matrix row does not match its frozen layout.");
397
- const n = [...e.rowPath, ...e.columnPath];
398
- return t.columns.map((o, i) => {
399
- if (o.kind === "measure") {
400
- const l = e.values[i], m = r.measures.get(o.measureId);
402
+ const o = [...e.rowPath, ...e.columnPath];
403
+ return t.columns.map((n, i) => {
404
+ if (n.kind === "measure") {
405
+ const l = e.values[i], m = r.measures.get(n.measureId);
401
406
  if (l.kind === "value" && !m) throw new Error("Matrix value is missing its measure descriptor.");
402
407
  return Re(l, m, r.absence);
403
408
  }
404
- const a = o.kind === "level" ? n.find((l) => l.levelId === o.levelId) : void 0;
409
+ const a = n.kind === "level" ? o.find((l) => l.levelId === n.levelId) : void 0;
405
410
  if (!a) throw new Error("Flat Matrix row does not match its frozen layout.");
406
411
  return te([a], r.levels);
407
412
  });
408
413
  }
409
- function rr(e) {
410
- const t = er(e.layout, e.request, e.report), r = e.layout.columns.map((a, l) => ({
414
+ function or(e) {
415
+ const t = tr(e.layout, e.request, e.report), r = e.layout.columns.map((a, l) => ({
411
416
  index: l,
412
417
  columnId: `matrix:${l}`,
413
418
  label: t.headers[l],
414
419
  isNumeric: t.numericColumns[l]
415
- })), n = (a, l, m) => ({
420
+ })), o = (a, l, m) => ({
416
421
  text: a,
417
422
  colspan: 1,
418
423
  rowspan: 1,
@@ -420,15 +425,15 @@ function rr(e) {
420
425
  isHeader: m,
421
426
  isNumeric: r[l].isNumeric,
422
427
  className: r[l].isNumeric ? "numeric" : e.layout.columns[l].kind === "hierarchy" ? "matrix-hierarchy" : ""
423
- }), o = [], i = e.layout.columns.findIndex((a) => a.kind === "measure");
424
- e.request.spec.columns.length && i >= 0 && o.push({
428
+ }), n = [], i = e.layout.columns.findIndex((a) => a.kind === "measure");
429
+ e.request.spec.columns.length && i >= 0 && n.push({
425
430
  repeatHeader: !0,
426
431
  headerType: "pivot-axis",
427
432
  headerRowIndex: 0,
428
433
  cells: [
429
- ...i ? [{ ...n("", 0, !0), colspan: i }] : [],
434
+ ...i ? [{ ...o("", 0, !0), colspan: i }] : [],
430
435
  {
431
- ...n(e.request.spec.columns.map((a) => Pe(a, e.request.presentation)).join(" / "), i, !0),
436
+ ...o(e.request.spec.columns.map((a) => Pe(a, e.request.presentation)).join(" / "), i, !0),
432
437
  colspan: e.layout.columns.length - i,
433
438
  isNumeric: !1,
434
439
  className: ""
@@ -436,14 +441,14 @@ function rr(e) {
436
441
  ]
437
442
  });
438
443
  for (const [a, l] of t.headerBands.entries())
439
- o.push({
444
+ n.push({
440
445
  repeatHeader: !0,
441
446
  headerType: a === t.headerBands.length - 1 ? "metrics" : "pivot-level",
442
- headerRowIndex: o.length,
443
- cells: l.map((m, u) => n(m, u, !0))
447
+ headerRowIndex: n.length,
448
+ cells: l.map((m, u) => o(m, u, !0))
444
449
  });
445
450
  return {
446
- headers: o,
451
+ headers: n,
447
452
  rows: e.rows.map((a, l) => {
448
453
  const m = new Set(t.continuedColumns(a, e.rows[l - 1]));
449
454
  return {
@@ -452,7 +457,7 @@ function rr(e) {
452
457
  subtotalLevel: String(a.rowPath.length),
453
458
  // A tabular layout prints each label once unless it repeats them; the
454
459
  // blank cell continues its group, so a grid draws no rule above it.
455
- cells: t.row(a, e.rows[l - 1]).map((u, g) => m.has(g) ? { ...n(u, g, !1), className: Jt } : n(u, g, !1))
460
+ cells: t.row(a, e.rows[l - 1]).map((u, g) => m.has(g) ? { ...o(u, g, !1), className: Qt } : o(u, g, !1))
456
461
  };
457
462
  }),
458
463
  grandTotal: null,
@@ -470,11 +475,11 @@ function rr(e) {
470
475
  };
471
476
  }
472
477
  function nr(e, t, r) {
473
- const { levels: n } = _e(e.descriptors, t.presentation, r), o = t.spec.columns.length > 0, i = [], a = [], l = e.columns.map((u, g) => {
478
+ const { levels: o } = _e(e.descriptors, t.presentation, r), n = t.spec.columns.length > 0, i = [], a = [], l = e.columns.map((u, g) => {
474
479
  if (u.kind !== "measure") return null;
475
- const p = o ? `${u.role}:${X(u.columnPath)}` : `measure:${g}`;
480
+ const p = n ? `${u.role}:${X(u.columnPath)}` : `measure:${g}`;
476
481
  let v = i.indexOf(p);
477
- return v < 0 && (v = i.push(p) - 1, a.push(o ? De(u.columnPath, u.role, t.presentation.totals.columns, n) : u.label)), v;
482
+ return v < 0 && (v = i.push(p) - 1, a.push(n ? De(u.columnPath, u.role, t.presentation.totals.columns, o) : u.label)), v;
478
483
  }), m = t.spec.columns[t.spec.columns.length - 1];
479
484
  return {
480
485
  columnGroups: l,
@@ -483,18 +488,18 @@ function nr(e, t, r) {
483
488
  groupLevelLabel: m ? Pe(m, t.presentation) : "Measures"
484
489
  };
485
490
  }
486
- function Tn(e) {
487
- const { layout: t, rows: r, report: n } = e, o = {
491
+ function So(e) {
492
+ const { layout: t, rows: r, report: o } = e, n = {
488
493
  ...e.request,
489
- presentation: Yt(t, r, e.request.presentation)
490
- }, i = rr({ layout: t, rows: r, request: o, report: n }), a = qt(r), l = nr(t, o, n), m = {
494
+ presentation: Zt(t, r, e.request.presentation)
495
+ }, i = or({ layout: t, rows: r, request: n, report: o }), a = Jt(r), l = nr(t, n, o), m = {
491
496
  ...i,
492
497
  rows: i.rows.map((u, g) => ({ ...u, keepWithPrevious: a[g] })),
493
498
  metadata: { ...i.metadata, ...l }
494
499
  };
495
- return { request: o, table: m, ...l };
500
+ return { request: n, table: m, ...l };
496
501
  }
497
- class or extends Error {
502
+ class ar extends Error {
498
503
  constructor() {
499
504
  super(...arguments);
500
505
  fe(this, "code", Ne);
@@ -503,37 +508,37 @@ class or extends Error {
503
508
  function xe(e) {
504
509
  if (!e || typeof e != "object")
505
510
  return;
506
- const { error: t, message: r, detail: n } = e;
507
- for (const o of [t, r, n])
508
- if (typeof o == "string" && o.trim())
509
- return o.trim();
511
+ const { error: t, message: r, detail: o } = e;
512
+ for (const n of [t, r, o])
513
+ if (typeof n == "string" && n.trim())
514
+ return n.trim();
510
515
  }
511
- async function ar(e) {
516
+ async function sr(e) {
512
517
  const t = `PDF request failed: ${e.status} ${e.statusText}`.trim(), r = e.headers.get("content-type") || "";
513
518
  try {
514
519
  if (r.includes("application/json")) {
515
- const o = await e.json(), i = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
516
- return { message: xe(o) || t, code: i };
520
+ const n = await e.json(), i = typeof n.code == "string" ? n.code : typeof n.errorCode == "string" ? n.errorCode : void 0;
521
+ return { message: xe(n) || t, code: i };
517
522
  }
518
- const n = await e.text();
519
- if (!n.trim())
523
+ const o = await e.text();
524
+ if (!o.trim())
520
525
  return { message: t };
521
526
  try {
522
- const o = JSON.parse(n), i = typeof o.code == "string" ? o.code : typeof o.errorCode == "string" ? o.errorCode : void 0;
527
+ const n = JSON.parse(o), i = typeof n.code == "string" ? n.code : typeof n.errorCode == "string" ? n.errorCode : void 0;
523
528
  return {
524
- message: xe(o) || n.trim(),
529
+ message: xe(n) || o.trim(),
525
530
  code: i
526
531
  };
527
532
  } catch {
528
- return { message: n.trim() };
533
+ return { message: o.trim() };
529
534
  }
530
535
  } catch {
531
536
  return { message: t };
532
537
  }
533
538
  }
534
- async function Cn(e) {
539
+ async function Eo(e) {
535
540
  if (!e.token) throw new Error("Missing auth token for PDF export");
536
- if (St(e.serializedPayload) > Et.maxRequestBytes)
541
+ if (Et(e.serializedPayload) > kt.maxRequestBytes)
537
542
  throw new Error("Fast-path PDF request exceeds the structured body limit");
538
543
  const t = await (e.fetchImpl ?? fetch)(e.url, {
539
544
  method: "POST",
@@ -542,8 +547,8 @@ async function Cn(e) {
542
547
  signal: e.signal
543
548
  });
544
549
  if (!t.ok) {
545
- const n = await ar(t);
546
- throw n.code === Ne ? new or(n.message) : new Error(n.message);
550
+ const o = await sr(t);
551
+ throw o.code === Ne ? new ar(o.message) : new Error(o.message);
547
552
  }
548
553
  const r = await t.json();
549
554
  if (r != null && r.error) throw new Error(r.error);
@@ -551,36 +556,36 @@ async function Cn(e) {
551
556
  throw new Error("Fast-path PDF response missing download URL");
552
557
  return r;
553
558
  }
554
- const sr = /* @__PURE__ */ new Set(["short", "medium", "long"]), ir = /^(\d{4})-(\d{2})-(\d{2})$/, lr = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, cr = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, se = " – ";
555
- function xn(e) {
556
- if (!rt(e)) return;
559
+ const ir = /* @__PURE__ */ new Set(["short", "medium", "long"]), lr = /^(\d{4})-(\d{2})-(\d{2})$/, cr = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, ur = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, se = " – ";
560
+ function ko(e) {
561
+ if (!ot(e)) return;
557
562
  const t = Object.keys(e);
558
563
  if (e.mode === "period_label" && t.length === 1)
559
564
  return { mode: "period_label" };
560
- if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && sr.has(e.dateStyle))
565
+ if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && ir.has(e.dateStyle))
561
566
  return { mode: "style", dateStyle: e.dateStyle };
562
- if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && ur(e.pattern) === null)
567
+ if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && mr(e.pattern) === null)
563
568
  return {
564
569
  mode: "pattern",
565
570
  dialect: "semaphor_tokens",
566
571
  pattern: e.pattern
567
572
  };
568
573
  }
569
- function ur(e) {
574
+ function mr(e) {
570
575
  try {
571
- return at({ dialect: "semaphor_tokens", pattern: e }), null;
576
+ return st({ dialect: "semaphor_tokens", pattern: e }), null;
572
577
  } catch (t) {
573
578
  return t instanceof Error ? t.message : "The pattern is invalid.";
574
579
  }
575
580
  }
576
- function Sn(e) {
577
- const { value: t, part: r, presentation: n, preferences: o, calendar: i } = e;
578
- if ((n == null ? void 0 : n.mode) === "period_label" && t.periodLabel && r === "range")
581
+ function Ao(e) {
582
+ const { value: t, part: r, presentation: o, preferences: n, calendar: i } = e;
583
+ if ((o == null ? void 0 : o.mode) === "period_label" && t.periodLabel && r === "range")
579
584
  return { ok: !0, text: t.periodLabel };
580
585
  const [a, l] = t.bounds, u = l === void 0 || r === "start" ? [{ raw: a, role: "start" }] : r === "end" ? [{ raw: l, role: "end" }] : [
581
586
  { raw: a, role: "start" },
582
587
  { raw: l, role: "end" }
583
- ], g = u.map(({ raw: s }) => gr(s, i.tz));
588
+ ], g = u.map(({ raw: s }) => pr(s, i.tz));
584
589
  if (g.some((s) => s === null))
585
590
  return {
586
591
  ok: !1,
@@ -591,39 +596,39 @@ function Sn(e) {
591
596
  }
592
597
  };
593
598
  const p = t.precision === "day" ? g.map(
594
- (s, f) => yr(s, u[f].role, i.tz)
599
+ (s, f) => hr(s, u[f].role, i.tz)
595
600
  ) : [], v = p.length > 0 && p.every((s) => s !== null) ? p : null;
596
- return { ok: !0, text: v ? mr(v, n, o, i) : dr(
597
- g.map((s) => pr(s, i.tz)),
598
- n,
601
+ return { ok: !0, text: v ? dr(v, o, n, i) : fr(
602
+ g.map((s) => yr(s, i.tz)),
599
603
  o,
604
+ n,
600
605
  i
601
606
  ) };
602
607
  }
603
- function mr(e, t, r, n) {
604
- const [o, i = o] = e;
608
+ function dr(e, t, r, o) {
609
+ const [n, i = n] = e;
605
610
  if ((t == null ? void 0 : t.mode) === "pattern")
606
- return Be(
611
+ return ze(
607
612
  e.map(
608
- (m) => Ke(re(m), "date", t.pattern, r, n)
613
+ (m) => Be(re(m), "date", t.pattern, r, o)
609
614
  )
610
615
  );
611
616
  const a = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : r.dateStyle;
612
617
  if (!t || t.mode === "period_label") {
613
- const m = hr(o, i, n);
618
+ const m = br(n, i, o);
614
619
  if (m)
615
620
  return Ie({
616
- value: re(o),
621
+ value: re(n),
617
622
  metadata: {
618
623
  kind: "temporal_bucket",
619
624
  granularity: m,
620
- calendar: { tz: n.tz, weekStart: n.weekStart ?? 1 }
625
+ calendar: { tz: o.tz, weekStart: o.weekStart ?? 1 }
621
626
  },
622
627
  format: $e({
623
628
  metadata: {
624
629
  kind: "temporal_bucket",
625
630
  granularity: m,
626
- calendar: { tz: n.tz, weekStart: n.weekStart ?? 1 }
631
+ calendar: { tz: o.tz, weekStart: o.weekStart ?? 1 }
627
632
  },
628
633
  locale: r.locale,
629
634
  styles: { dateStyle: a, dateTime: { ...r.dateTime } }
@@ -635,34 +640,34 @@ function mr(e, t, r, n) {
635
640
  timeZone: "UTC",
636
641
  dateStyle: a
637
642
  });
638
- return wr(o, i) ? l.format(H(o)) : Ue(l, H(o), H(i));
643
+ return vr(n, i) ? l.format(H(n)) : Ke(l, H(n), H(i));
639
644
  }
640
- function dr(e, t, r, n) {
645
+ function fr(e, t, r, o) {
641
646
  if ((t == null ? void 0 : t.mode) === "pattern")
642
- return Be(
647
+ return ze(
643
648
  e.map(
644
- (l) => Ke(
649
+ (l) => Be(
645
650
  l.toISOString(),
646
651
  "instant",
647
652
  t.pattern,
648
653
  r,
649
- n
654
+ o
650
655
  )
651
656
  )
652
657
  );
653
- const o = new Intl.DateTimeFormat(r.locale, {
658
+ const n = new Intl.DateTimeFormat(r.locale, {
654
659
  calendar: "gregory",
655
- timeZone: n.tz,
660
+ timeZone: o.tz,
656
661
  dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : r.dateTime.dateStyle,
657
662
  timeStyle: r.dateTime.timeStyle
658
663
  }), [i, a] = e;
659
- return a && a.getTime() !== i.getTime() ? Ue(o, i, a) : o.format(i);
664
+ return a && a.getTime() !== i.getTime() ? Ke(n, i, a) : n.format(i);
660
665
  }
661
- function Ue(e, t, r) {
662
- const n = e;
663
- return typeof n.formatRange == "function" ? n.formatRange(t, r) : `${e.format(t)}${se}${e.format(r)}`;
666
+ function Ke(e, t, r) {
667
+ const o = e;
668
+ return typeof o.formatRange == "function" ? o.formatRange(t, r) : `${e.format(t)}${se}${e.format(r)}`;
664
669
  }
665
- function Ke(e, t, r, n, o) {
670
+ function Be(e, t, r, o, n) {
666
671
  const i = nt({
667
672
  format: {
668
673
  type: "raw_temporal",
@@ -670,48 +675,48 @@ function Ke(e, t, r, n, o) {
670
675
  },
671
676
  // Temporal formatting reads no currency.
672
677
  preferences: {
673
- ...n,
674
- defaultCurrency: kt.defaultCurrency
678
+ ...o,
679
+ defaultCurrency: At.defaultCurrency
675
680
  },
676
- calendar: { tz: o.tz }
677
- }), a = t === "date" && fr(r) ? "instant" : t;
678
- return ot({
679
- value: a === t ? e : oe(`${e}T00:00:00`, o.tz).toISOString(),
681
+ calendar: { tz: n.tz }
682
+ }), a = t === "date" && gr(r) ? "instant" : t;
683
+ return at({
684
+ value: a === t ? e : ne(`${e}T00:00:00`, n.tz).toISOString(),
680
685
  metadata: { kind: "raw_temporal", valueKind: a },
681
686
  format: i
682
687
  }).text;
683
688
  }
684
- function fr(e) {
689
+ function gr(e) {
685
690
  return /HH|mm|ss/.test(e);
686
691
  }
687
- function Be(e) {
692
+ function ze(e) {
688
693
  return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(se);
689
694
  }
690
- function gr(e, t) {
691
- const r = ir.exec(e);
695
+ function pr(e, t) {
696
+ const r = lr.exec(e);
692
697
  if (r) {
693
- const o = {
698
+ const n = {
694
699
  year: Number(r[1]),
695
700
  month: Number(r[2]),
696
701
  day: Number(r[3])
697
702
  };
698
- return vr(o) ? { kind: "date", date: o } : null;
703
+ return Tr(n) ? { kind: "date", date: n } : null;
699
704
  }
700
- const n = cr.test(e) ? new Date(e.replace(" ", "T")) : lr.test(e) ? oe(e.replace(" ", "T"), t) : null;
701
- return n && !Number.isNaN(n.getTime()) ? { kind: "instant", instant: n } : null;
705
+ const o = ur.test(e) ? new Date(e.replace(" ", "T")) : cr.test(e) ? ne(e.replace(" ", "T"), t) : null;
706
+ return o && !Number.isNaN(o.getTime()) ? { kind: "instant", instant: o } : null;
702
707
  }
703
- function pr(e, t) {
704
- return e.kind === "instant" ? e.instant : oe(`${re(e.date)}T00:00:00`, t);
708
+ function yr(e, t) {
709
+ return e.kind === "instant" ? e.instant : ne(`${re(e.date)}T00:00:00`, t);
705
710
  }
706
- function yr(e, t, r) {
711
+ function hr(e, t, r) {
707
712
  if (e.kind === "date") return e.date;
708
- const n = At(e.instant, r), o = { year: n.year, month: n.month, day: n.day };
709
- if (n.hour === 0 && n.minute === 0 && n.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? o : br(o, -1);
710
- const a = n.hour === 23 && n.minute === 59 && n.second === 59;
711
- return t === "end" && a ? o : null;
713
+ const o = Lt(e.instant, r), n = { year: o.year, month: o.month, day: o.day };
714
+ if (o.hour === 0 && o.minute === 0 && o.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? n : wr(n, -1);
715
+ const a = o.hour === 23 && o.minute === 59 && o.second === 59;
716
+ return t === "end" && a ? n : null;
712
717
  }
713
- function hr(e, t, r) {
714
- return r.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== ze(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
718
+ function br(e, t, r) {
719
+ return r.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== je(t.year, t.month) ? null : e.month === t.month ? "month" : e.month % 3 === 1 && t.month === e.month + 2 ? "quarter" : e.month === 1 && t.month === 12 ? "year" : null;
715
720
  }
716
721
  function re(e) {
717
722
  return `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`;
@@ -720,7 +725,7 @@ function H(e) {
720
725
  const t = /* @__PURE__ */ new Date(0);
721
726
  return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(0, 0, 0, 0), t;
722
727
  }
723
- function br(e, t) {
728
+ function wr(e, t) {
724
729
  const r = H(e);
725
730
  return r.setUTCDate(r.getUTCDate() + t), {
726
731
  year: r.getUTCFullYear(),
@@ -728,87 +733,87 @@ function br(e, t) {
728
733
  day: r.getUTCDate()
729
734
  };
730
735
  }
731
- function wr(e, t) {
736
+ function vr(e, t) {
732
737
  return e.year === t.year && e.month === t.month && e.day === t.day;
733
738
  }
734
- function ze(e, t) {
739
+ function je(e, t) {
735
740
  return new Date(Date.UTC(e, t, 0)).getUTCDate();
736
741
  }
737
- function vr(e) {
738
- return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= ze(e.year, e.month);
742
+ function Tr(e) {
743
+ return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= je(e.year, e.month);
739
744
  }
740
- const Tr = "__TOTAL__";
745
+ const Cr = "__TOTAL__";
741
746
  function W(e) {
742
747
  return typeof e == "object" && e !== null && !Array.isArray(e);
743
748
  }
744
- function ne(e) {
745
- return e === Tr;
749
+ function oe(e) {
750
+ return e === Cr;
746
751
  }
747
- function Cr(e) {
748
- const t = /* @__PURE__ */ new Map(), r = (e.groupByColumns ?? []).map((o, i) => {
752
+ function xr(e) {
753
+ const t = /* @__PURE__ */ new Map(), r = (e.groupByColumns ?? []).map((n, i) => {
749
754
  var u, g, p;
750
- if (!W(o))
755
+ if (!W(n))
751
756
  throw new Error(`Aggregate groupByColumns[${i}] is invalid`);
752
- const a = typeof o.id == "string" && o.id.length > 0 ? o.id : void 0, l = a ? (p = (g = (u = e.columnKeyMap) == null ? void 0 : u.byRole) == null ? void 0 : g.groupby) == null ? void 0 : p[a] : void 0, m = (l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || (typeof o.alias == "string" && o.alias.length > 0 ? o.alias : typeof o.name == "string" && o.name.length > 0 ? o.name : void 0);
757
+ const a = typeof n.id == "string" && n.id.length > 0 ? n.id : void 0, l = a ? (p = (g = (u = e.columnKeyMap) == null ? void 0 : u.byRole) == null ? void 0 : g.groupby) == null ? void 0 : p[a] : void 0, m = (l == null ? void 0 : l.outputKey) || (l == null ? void 0 : l.rawKey) || (typeof n.alias == "string" && n.alias.length > 0 ? n.alias : typeof n.name == "string" && n.name.length > 0 ? n.name : void 0);
753
758
  if (!m)
754
759
  throw new Error(`Aggregate groupByColumns[${i}] has no output key`);
755
- return [a, o.alias, o.name, m].forEach((v) => {
760
+ return [a, n.alias, n.name, m].forEach((v) => {
756
761
  typeof v == "string" && v.length > 0 && t.set(v, m);
757
762
  }), m;
758
- }), n = (e.rowAggregates ?? []).flatMap((o) => !W(o) || typeof o.function != "string" || typeof o.groupLevel != "string" ? [] : [
763
+ }), o = (e.rowAggregates ?? []).flatMap((n) => !W(n) || typeof n.function != "string" || typeof n.groupLevel != "string" ? [] : [
759
764
  {
760
- function: o.function,
761
- groupLevel: o.groupLevel === "ALL" ? "ALL" : t.get(o.groupLevel) || o.groupLevel,
762
- ...typeof o.label == "string" ? { label: o.label } : {}
765
+ function: n.function,
766
+ groupLevel: n.groupLevel === "ALL" ? "ALL" : t.get(n.groupLevel) || n.groupLevel,
767
+ ...typeof n.label == "string" ? { label: n.label } : {}
763
768
  }
764
769
  ]);
765
- return { groupColumnKeys: r, rowAggregates: n };
770
+ return { groupColumnKeys: r, rowAggregates: o };
766
771
  }
767
- function je(e) {
772
+ function Ge(e) {
768
773
  return e === "SUM" ? "Total" : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
769
774
  }
770
- function xr(e) {
775
+ function Sr(e) {
771
776
  var r;
772
777
  if (e.customLabel) return e.customLabel;
773
- const t = je(e.aggregateFunction);
774
- if (e.levelValue !== void 0 && !ne(e.levelValue)) {
778
+ const t = Ge(e.aggregateFunction);
779
+ if (e.levelValue !== void 0 && !oe(e.levelValue)) {
775
780
  if (e.levelValue === null) {
776
- const o = (r = e.formatValue) == null ? void 0 : r.call(e, null);
777
- return o ? `Subtotal ${o}` : `Subtotal ${t}`;
781
+ const n = (r = e.formatValue) == null ? void 0 : r.call(e, null);
782
+ return n ? `Subtotal ${n}` : `Subtotal ${t}`;
778
783
  }
779
- const n = e.formatValue ? e.formatValue(e.levelValue) : String(e.levelValue);
780
- if (n) return `Subtotal (${n})`;
784
+ const o = e.formatValue ? e.formatValue(e.levelValue) : String(e.levelValue);
785
+ if (o) return `Subtotal (${o})`;
781
786
  }
782
787
  return `Subtotal ${t}`;
783
788
  }
784
- function Sr(e, t) {
785
- return t || `Grand ${je(e)}`;
789
+ function Er(e, t) {
790
+ return t || `Grand ${Ge(e)}`;
786
791
  }
787
- function En(e) {
792
+ function Lo(e) {
788
793
  const t = e.context.groupColumnKeys.indexOf(e.columnKey);
789
794
  if (t < 0)
790
795
  throw new Error(
791
796
  `Aggregate group column "${e.columnKey}" is unknown`
792
797
  );
793
- return Qt({
798
+ return er({
794
799
  row: e.row,
795
800
  previousRow: e.previousRow,
796
801
  levelIndex: t,
797
- getValue: (r, n) => r[e.context.groupColumnKeys[n]]
802
+ getValue: (r, o) => r[e.context.groupColumnKeys[o]]
798
803
  });
799
804
  }
800
- function Ge(e) {
801
- var n, o;
805
+ function He(e) {
806
+ var o, n;
802
807
  const t = e.context.groupColumnKeys, r = typeof e.row.aggregate == "string" ? e.row.aggregate : "SUM";
803
808
  if (e.row.isGrandTotal === !0) {
804
- const i = (n = e.context.rowAggregates.find(
809
+ const i = (o = e.context.rowAggregates.find(
805
810
  (a) => a.groupLevel === "ALL"
806
- )) == null ? void 0 : n.label;
811
+ )) == null ? void 0 : o.label;
807
812
  return {
808
813
  kind: "grand-total",
809
814
  cells: t.map((a, l) => ({
810
815
  columnKey: a,
811
- text: l === 0 ? Sr(r, i) : "",
816
+ text: l === 0 ? Er(r, i) : "",
812
817
  placement: l === 0 ? "label" : "empty",
813
818
  colSpan: l === 0 ? t.length : 1
814
819
  }))
@@ -822,9 +827,9 @@ function Ge(e) {
822
827
  throw new Error(
823
828
  `Aggregate subtotal level "${e.row.subtotalLevel}" has no group column`
824
829
  );
825
- const a = W(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = W(a == null ? void 0 : a.groupByValues) ? a.groupByValues : {}, m = (o = e.context.rowAggregates.find(
830
+ const a = W(e.row.subtotalContext) ? e.row.subtotalContext : void 0, l = W(a == null ? void 0 : a.groupByValues) ? a.groupByValues : {}, m = (n = e.context.rowAggregates.find(
826
831
  (u) => u.groupLevel === e.row.subtotalLevel && u.function === r
827
- )) == null ? void 0 : o.label;
832
+ )) == null ? void 0 : n.label;
828
833
  return {
829
834
  kind: "subtotal",
830
835
  cells: t.map((u, g) => {
@@ -839,14 +844,14 @@ function Ge(e) {
839
844
  const p = e.row[u];
840
845
  return {
841
846
  columnKey: u,
842
- text: p === void 0 || ne(p) ? "" : e.formatValue(p, u),
847
+ text: p === void 0 || oe(p) ? "" : e.formatValue(p, u),
843
848
  placement: "value",
844
849
  colSpan: 1
845
850
  };
846
851
  }
847
852
  return {
848
853
  columnKey: u,
849
- text: xr({
854
+ text: Sr({
850
855
  aggregateFunction: r,
851
856
  customLabel: m,
852
857
  levelValue: l[u],
@@ -864,99 +869,99 @@ function Ge(e) {
864
869
  const a = e.row[i];
865
870
  return {
866
871
  columnKey: i,
867
- text: a === void 0 || ne(a) ? "" : e.formatValue(a, i),
872
+ text: a === void 0 || oe(a) ? "" : e.formatValue(a, i),
868
873
  placement: "value",
869
874
  colSpan: 1
870
875
  };
871
876
  })
872
877
  };
873
878
  }
874
- function kn(e) {
875
- const t = Ge(e).cells.find(
879
+ function Fo(e) {
880
+ const t = He(e).cells.find(
876
881
  (r) => r.columnKey === e.columnKey
877
882
  );
878
883
  if (!t)
879
884
  throw new Error(`Aggregate group column "${e.columnKey}" is unknown`);
880
885
  return t.text;
881
886
  }
882
- function Er(e) {
883
- return Ge(e).cells.map((t) => t.text);
884
- }
885
887
  function kr(e) {
888
+ return He(e).cells.map((t) => t.text);
889
+ }
890
+ function Ar(e) {
886
891
  return typeof e == "object" && e !== null && !Array.isArray(e);
887
892
  }
888
- function Ar(e, t) {
893
+ function Lr(e, t) {
889
894
  if ((e == null ? void 0 : e.cardType) !== "aggregateTable") return;
890
- const r = kr(e.cardConfig) ? e.cardConfig : void 0, n = r == null ? void 0 : r.groupByColumns, o = r == null ? void 0 : r.rowAggregates;
891
- if (n !== void 0 && !Array.isArray(n))
892
- throw new Error("Aggregate export groupByColumns is invalid");
895
+ const r = Ar(e.cardConfig) ? e.cardConfig : void 0, o = r == null ? void 0 : r.groupByColumns, n = r == null ? void 0 : r.rowAggregates;
893
896
  if (o !== void 0 && !Array.isArray(o))
897
+ throw new Error("Aggregate export groupByColumns is invalid");
898
+ if (n !== void 0 && !Array.isArray(n))
894
899
  throw new Error("Aggregate export rowAggregates is invalid");
895
- return Cr({
896
- groupByColumns: n,
897
- rowAggregates: o,
900
+ return xr({
901
+ groupByColumns: o,
902
+ rowAggregates: n,
898
903
  columnKeyMap: t
899
904
  });
900
905
  }
901
- function Lr(e) {
906
+ function Fr(e) {
902
907
  if (!e.aggregateContext || !e.useFormattedValues || e.row.isSubtotal !== !0 && e.row.isGrandTotal !== !0)
903
908
  return;
904
- const t = Er({
909
+ const t = kr({
905
910
  row: e.row,
906
911
  context: e.aggregateContext,
907
- formatValue: (r, n) => e.visibleColumnKeys.has(n) ? e.formatGroupValue(r, n) : ""
912
+ formatValue: (r, o) => e.visibleColumnKeys.has(o) ? e.formatGroupValue(r, o) : ""
908
913
  });
909
914
  return new Map(
910
- e.aggregateContext.groupColumnKeys.map((r, n) => [
915
+ e.aggregateContext.groupColumnKeys.map((r, o) => [
911
916
  r,
912
- t[n]
917
+ t[o]
913
918
  ])
914
919
  );
915
920
  }
916
- function Fr(e, t) {
921
+ function Mr(e, t) {
917
922
  return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === void 0;
918
923
  }
919
- function He(e) {
924
+ function Xe(e) {
920
925
  return new Map(
921
926
  e.presentationExecutionSnapshot.resolvedFormats.flatMap(
922
- (t) => t.format.type === "raw_temporal" && t.target.kind === "column" && Fr(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
927
+ (t) => t.format.type === "raw_temporal" && t.target.kind === "column" && Mr(t.scope, e.scope) ? [[t.target.columnKey, t.format]] : []
923
928
  )
924
929
  );
925
930
  }
926
- function Xe(e) {
931
+ function We(e) {
927
932
  const t = e == null ? void 0 : e.sql, r = e == null ? void 0 : e.python;
928
933
  return (e == null ? void 0 : e.resultOwner) === "freeform" && typeof t == "string" && !!t.trim() && (typeof r != "string" || !r.trim());
929
934
  }
930
- function An(e) {
931
- return e.formatting.useFormattedValues !== !1 && Xe(e.queryPayload) && He(e.formatting).size > 0;
935
+ function Mo(e) {
936
+ return e.formatting.useFormattedValues !== !1 && We(e.queryPayload) && Xe(e.formatting).size > 0;
932
937
  }
933
- function Mr(e, t) {
934
- return e.map((r, n) => {
938
+ function Ir(e, t) {
939
+ return e.map((r, o) => {
935
940
  if (!Object.prototype.hasOwnProperty.call(r, t) || r[t] === void 0)
936
941
  throw new Error(
937
- `missing_raw_temporal_result_contract: Row ${n} is missing declared temporal column "${t}".`
942
+ `missing_raw_temporal_result_contract: Row ${o} is missing declared temporal column "${t}".`
938
943
  );
939
- const o = r[t];
940
- return o === null || typeof o == "string" ? o : String(o);
944
+ const n = r[t];
945
+ return n === null || typeof n == "string" ? n : String(n);
941
946
  });
942
947
  }
943
- function Ir(e) {
948
+ function $r(e) {
944
949
  if (e.formatting.useFormattedValues === !1)
945
950
  return {
946
951
  activatedColumnKeys: /* @__PURE__ */ new Set(),
947
952
  byColumnKey: /* @__PURE__ */ new Map()
948
953
  };
949
- const t = He(e.formatting), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
954
+ const t = Xe(e.formatting), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
950
955
  if (t.size === 0)
951
- return { activatedColumnKeys: r, byColumnKey: n };
952
- const o = new Map(
956
+ return { activatedColumnKeys: r, byColumnKey: o };
957
+ const n = new Map(
953
958
  e.columns.flatMap((l) => {
954
959
  const m = l.key || l.field;
955
960
  return m ? [[m, l]] : [];
956
961
  })
957
- ), i = Xe(e.queryPayload), a = /* @__PURE__ */ new Map();
962
+ ), i = We(e.queryPayload), a = /* @__PURE__ */ new Map();
958
963
  for (const [l, m] of t) {
959
- const u = o.get(l);
964
+ const u = n.get(l);
960
965
  let g;
961
966
  if (u != null && u.rawTemporal)
962
967
  g = It(u, {
@@ -964,28 +969,28 @@ function Ir(e) {
964
969
  }), r.add(l);
965
970
  else if (i) {
966
971
  r.add(l);
967
- const p = st({
972
+ const p = it({
968
973
  columnKey: l,
969
- values: Mr(e.records, l)
974
+ values: Ir(e.records, l)
970
975
  });
971
976
  a.set(l, p), p.status === "classified" && (g = p.metadata);
972
977
  } else
973
978
  continue;
974
- g && n.set(l, {
979
+ g && o.set(l, {
975
980
  metadata: g,
976
981
  format: m,
977
- formatValue: it({ metadata: g, format: m })
982
+ formatValue: lt({ metadata: g, format: m })
978
983
  });
979
984
  }
980
985
  return {
981
986
  activatedColumnKeys: r,
982
- byColumnKey: n,
987
+ byColumnKey: o,
983
988
  ...i ? {
984
- sqlChunkEvidence: lt(a)
989
+ sqlChunkEvidence: ct(a)
985
990
  } : {}
986
991
  };
987
992
  }
988
- function $r(e) {
993
+ function _r(e) {
989
994
  if (!e.resolution.activatedColumnKeys.has(e.columnKey))
990
995
  return;
991
996
  if (e.value === void 0)
@@ -1004,7 +1009,7 @@ function Se(e, t) {
1004
1009
  const r = e.byColumnKey.get(t);
1005
1010
  return r ? r.metadata.valueKind === "date" : void 0;
1006
1011
  }
1007
- const _r = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), Dr = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, Rr = /^\d{4}-\d{2}-\d{2}$/, We = "MM/dd/yyyy";
1012
+ const Dr = /* @__PURE__ */ new Set(["string", "number", "boolean", "date", "datetime"]), Rr = /^\d{4}-\d{2}-\d{2}|^\d{2}\/\d{2}\/\d{4}/, Pr = /^\d{4}-\d{2}-\d{2}$/, Ye = "MM/dd/yyyy";
1008
1013
  function Y(e) {
1009
1014
  return typeof e == "object" && e !== null && !Array.isArray(e);
1010
1015
  }
@@ -1015,40 +1020,40 @@ function Q(e) {
1015
1020
  return e == null ? "" : typeof e == "string" ? e : U(e) ? e.value : e instanceof Date ? e.toISOString() : typeof e == "object" ? JSON.stringify(e) : String(e);
1016
1021
  }
1017
1022
  function Ee(e, t) {
1018
- var n;
1019
- const r = (n = e.columnSettings) == null ? void 0 : n[t];
1023
+ var o;
1024
+ const r = (o = e.columnSettings) == null ? void 0 : o[t];
1020
1025
  if (!(!Y(r) || r.type !== "date"))
1021
1026
  return Y(r.dateFormat) ? r.dateFormat : {};
1022
1027
  }
1023
1028
  function ke(e) {
1024
- return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || We;
1029
+ return e.useCustomFormat && e.customFormat ? e.customFormat : e.format || Ye;
1025
1030
  }
1026
1031
  function Ae(e, t) {
1027
1032
  return e && e !== "auto" ? e : t;
1028
1033
  }
1029
- function Pr(e) {
1034
+ function Nr(e) {
1030
1035
  return !/[HhKkmsSa]/.test(e.replace(/'[^']*'/g, ""));
1031
1036
  }
1032
- function Nr(e) {
1037
+ function Or(e) {
1033
1038
  if (typeof e == "number") return Number.isFinite(e) ? e : null;
1034
1039
  if (typeof e != "string" || !e.trim()) return null;
1035
1040
  const t = Number(e);
1036
1041
  return Number.isFinite(t) ? t : null;
1037
1042
  }
1038
- function Or(e) {
1043
+ function Vr(e) {
1039
1044
  const t = Oe(e);
1040
1045
  if (t !== void 0)
1041
1046
  try {
1042
- return Ct(t, /[.eE]/.test(t) ? "decimal" : "integer");
1047
+ return bt(t, /[.eE]/.test(t) ? "decimal" : "integer");
1043
1048
  } catch {
1044
1049
  return;
1045
1050
  }
1046
1051
  }
1047
- function Vr(e) {
1052
+ function Ur(e) {
1048
1053
  return e.calendar.fiscalCalendar && (e.granularity === "quarter" || e.granularity === "year") ? "fiscal" : e.granularity;
1049
1054
  }
1050
- function Ln(e) {
1051
- const { formatting: t, queryPayload: r } = e, n = t.useFormattedValues, o = t.scope, i = (s) => ft({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: s } }), a = (s) => gt({ snapshot: t.presentationExecutionSnapshot, scope: o, target: { kind: "column", columnKey: s } });
1055
+ function Io(e) {
1056
+ const { formatting: t, queryPayload: r } = e, o = t.useFormattedValues, n = t.scope, i = (s) => vt({ snapshot: t.presentationExecutionSnapshot, scope: n, target: { kind: "column", columnKey: s } }), a = (s) => Tt({ snapshot: t.presentationExecutionSnapshot, scope: n, target: { kind: "column", columnKey: s } });
1052
1057
  function l(s) {
1053
1058
  var b;
1054
1059
  if ((b = t.visibleColumns) != null && b.length) return t.visibleColumns;
@@ -1065,13 +1070,13 @@ function Ln(e) {
1065
1070
  return Ft({
1066
1071
  members: y,
1067
1072
  metricLabel: (s == null ? void 0 : s.label) || (s == null ? void 0 : s.headerName),
1068
- mode: n ? "formatted" : "canonical",
1073
+ mode: o ? "formatted" : "canonical",
1069
1074
  resolveTemporalFormat: (S) => {
1070
1075
  const w = y.find((x) => x.fieldId === S);
1071
1076
  if (!(w != null && w.temporalBucket)) return;
1072
1077
  const C = pe({
1073
1078
  snapshot: t.presentationExecutionSnapshot,
1074
- scope: o,
1079
+ scope: n,
1075
1080
  target: { kind: "field", fieldId: S, role: "pivotby" }
1076
1081
  });
1077
1082
  return C ? g(w.temporalBucket, C) : void 0;
@@ -1105,7 +1110,7 @@ function Ln(e) {
1105
1110
  const h = N(c);
1106
1111
  return h ? [[h, c]] : [];
1107
1112
  })
1108
- ), F = new Map(s.resultColumns.map((c) => [c.key, c.dataType])), M = Ir({
1113
+ ), F = new Map(s.resultColumns.map((c) => [c.key, c.dataType])), M = $r({
1109
1114
  records: b,
1110
1115
  columns: y,
1111
1116
  formatting: t,
@@ -1119,29 +1124,29 @@ function Ln(e) {
1119
1124
  for (const c of w) {
1120
1125
  const h = pe({
1121
1126
  snapshot: t.presentationExecutionSnapshot,
1122
- scope: o,
1127
+ scope: n,
1123
1128
  target: { kind: "column", columnKey: c }
1124
1129
  }), T = K.get(c);
1125
- if (n) {
1130
+ if (o) {
1126
1131
  if (h && !T) throw new Error(`Missing temporal bucket metadata for column "${c}"`);
1127
1132
  if (T && !h) throw new Error(`Missing resolved temporal presentation for column "${c}"`);
1128
1133
  }
1129
1134
  h && T && le.set(c, g(T, h));
1130
1135
  }
1131
- const Ze = K.size > 0 && e.cardType === "aggregateTable" ? Ar(r, s.columnKeyMap) : void 0, B = w.map((c) => {
1132
- const h = F.get(c), T = h && _r.has(h) ? h : "unknown", E = n ? v(c, M, K) : void 0, k = m(c, x.get(c)), A = n && M.activatedColumnKeys.has(c) && Se(M, c) === void 0;
1136
+ const qe = K.size > 0 && e.cardType === "aggregateTable" ? Lr(r, s.columnKeyMap) : void 0, B = w.map((c) => {
1137
+ const h = F.get(c), T = h && Dr.has(h) ? h : "unknown", E = o ? v(c, M, K) : void 0, k = m(c, x.get(c)), A = o && M.activatedColumnKeys.has(c) && Se(M, c) === void 0;
1133
1138
  return {
1134
1139
  key: c,
1135
1140
  label: k,
1136
1141
  dataType: T,
1137
1142
  ...E ? { presentation: E } : {},
1138
- xlsx: ve({ key: c, label: k, formattedValues: n, dataType: T, presentation: E }),
1143
+ xlsx: ve({ key: c, label: k, formattedValues: o, dataType: T, presentation: E }),
1139
1144
  ...A ? { xlsxPending: !0 } : {}
1140
1145
  };
1141
1146
  });
1142
1147
  function ce(c, h, T, E) {
1143
- if (!n) return { text: Q(c), value: c };
1144
- const k = $r({ value: c, columnKey: h, rowIndex: T, resolution: M });
1148
+ if (!o) return { text: Q(c), value: c };
1149
+ const k = _r({ value: c, columnKey: h, rowIndex: T, resolution: M });
1145
1150
  if (k !== void 0) return { text: k.text, value: c, ...k.wallClock ? { wallClock: k.wallClock } : {} };
1146
1151
  const A = K.get(h);
1147
1152
  if (A) {
@@ -1149,7 +1154,7 @@ function Ln(e) {
1149
1154
  if (!L) throw new Error(`Missing resolved temporal presentation for column "${h}"`);
1150
1155
  if (c != null && typeof c != "string")
1151
1156
  throw new Error(`Canonical temporal column "${h}" must contain a string or null`);
1152
- const D = c ?? null, R = ct(D, A);
1157
+ const D = c ?? null, R = ut(D, A);
1153
1158
  return {
1154
1159
  text: Ie({ value: D, metadata: A, format: L }),
1155
1160
  value: c,
@@ -1162,7 +1167,7 @@ function Ln(e) {
1162
1167
  return {
1163
1168
  text: ge(
1164
1169
  new Date(c).toISOString(),
1165
- _.pattern || We,
1170
+ _.pattern || Ye,
1166
1171
  Ae(_.timezone, t.timezone),
1167
1172
  "UTC"
1168
1173
  ),
@@ -1174,8 +1179,8 @@ function Ln(e) {
1174
1179
  if (U(c))
1175
1180
  return { text: I ? j(c, I) : c.value, value: c };
1176
1181
  const z = Ee(t, h);
1177
- if (z && (c instanceof Date || typeof c == "string" && Dr.test(c))) {
1178
- const L = c instanceof Date ? c.toISOString() : c, D = typeof c == "string" && Rr.test(c), R = D ? "UTC" : Ae(z.timezone, t.timezone), me = D ? "UTC" : z.sourceTimezone || "auto", de = dt(L, R, me);
1182
+ if (z && (c instanceof Date || typeof c == "string" && Rr.test(c))) {
1183
+ const L = c instanceof Date ? c.toISOString() : c, D = typeof c == "string" && Pr.test(c), R = D ? "UTC" : Ae(z.timezone, t.timezone), me = D ? "UTC" : z.sourceTimezone || "auto", de = ft(L, R, me);
1179
1184
  return {
1180
1185
  text: ge(L, ke(z), R, me),
1181
1186
  value: c,
@@ -1183,16 +1188,16 @@ function Ln(e) {
1183
1188
  };
1184
1189
  }
1185
1190
  if (typeof c == "string" && I && E.dataType === "number") {
1186
- const L = Or(c);
1191
+ const L = Vr(c);
1187
1192
  if (L) return { text: j(L, I), value: c };
1188
1193
  }
1189
1194
  return { text: Q(c), value: c };
1190
1195
  }
1191
- const qe = b.map((c, h) => {
1192
- const T = Lr({
1196
+ const Je = b.map((c, h) => {
1197
+ const T = Fr({
1193
1198
  row: c,
1194
- aggregateContext: Ze,
1195
- useFormattedValues: n,
1199
+ aggregateContext: qe,
1200
+ useFormattedValues: o,
1196
1201
  visibleColumnKeys: C,
1197
1202
  formatGroupValue: (E, k) => {
1198
1203
  const A = B.find((_) => _.key === k);
@@ -1214,7 +1219,7 @@ function Ln(e) {
1214
1219
  return {
1215
1220
  ...ue ? { header: B.map((c) => c.label) } : {},
1216
1221
  columns: B,
1217
- rows: qe,
1222
+ rows: Je,
1218
1223
  ...M.sqlChunkEvidence ? { rawTemporalClassification: M.sqlChunkEvidence } : {}
1219
1224
  };
1220
1225
  }
@@ -1224,10 +1229,10 @@ function Ln(e) {
1224
1229
  return C === void 0 ? { kind: "text" } : { kind: "datetime", dateOnly: C };
1225
1230
  }
1226
1231
  const y = b.get(s);
1227
- if (y) return { kind: "temporal_bucket", grain: Vr(y) };
1232
+ if (y) return { kind: "temporal_bucket", grain: Ur(y) };
1228
1233
  if (a(s)) return { kind: "text" };
1229
1234
  const S = Ee(t, s);
1230
- if (S) return { kind: "datetime", dateOnly: Pr(ke(S)) };
1235
+ if (S) return { kind: "datetime", dateOnly: Nr(ke(S)) };
1231
1236
  const w = i(s);
1232
1237
  return w ? { kind: "measure", format: w } : void 0;
1233
1238
  }
@@ -1235,22 +1240,22 @@ function Ln(e) {
1235
1240
  if (!Number.isInteger(f) || f < 0)
1236
1241
  throw new Error("totalRows must be a non-negative integer");
1237
1242
  return f === 0 ? void 0 : (t.visibleColumns ?? Object.keys(s)).map((y) => {
1238
- const w = Object.prototype.hasOwnProperty.call(s, y) ? s[y] : y === t.tableTotalsLabelColumnKey ? "Total" : null, C = n ? i(y) : void 0, x = ve({
1243
+ const w = Object.prototype.hasOwnProperty.call(s, y) ? s[y] : y === t.tableTotalsLabelColumnKey ? "Total" : null, C = o ? i(y) : void 0, x = ve({
1239
1244
  key: y,
1240
1245
  label: y,
1241
- formattedValues: n,
1246
+ formattedValues: o,
1242
1247
  dataType: "unknown",
1243
1248
  ...C ? { presentation: { kind: "measure", format: C } } : {}
1244
1249
  });
1245
1250
  if (w == null) return { kind: "empty" };
1246
- if (!n) return P({ value: w, text: String(w), column: x });
1247
- const F = C ? Nr(w) : null;
1251
+ if (!o) return P({ value: w, text: String(w), column: x });
1252
+ const F = C ? Or(w) : null;
1248
1253
  return P(C && F !== null ? { value: F, text: j(F, C), column: x } : { value: w, text: String(w), column: x });
1249
1254
  });
1250
1255
  }
1251
1256
  return { format: p, totals: d };
1252
1257
  }
1253
- const Ur = /* @__PURE__ */ new Set([
1258
+ const Kr = /* @__PURE__ */ new Set([
1254
1259
  "scope",
1255
1260
  "useFormattedValues",
1256
1261
  "timezone",
@@ -1275,7 +1280,7 @@ function Le(e, t) {
1275
1280
  return e;
1276
1281
  }
1277
1282
  }
1278
- function Fn(e) {
1283
+ function $o(e) {
1279
1284
  if (!ie(e))
1280
1285
  throw new Error("formatting must be an object");
1281
1286
  const t = ["reportContext", "resolvedFormats"].find(
@@ -1285,23 +1290,23 @@ function Fn(e) {
1285
1290
  throw new ye(
1286
1291
  `formatting.${t} is retired; formatting.presentationExecutionSnapshot is authoritative.`
1287
1292
  );
1288
- const r = Object.keys(e).find((s) => !Ur.has(s));
1293
+ const r = Object.keys(e).find((s) => !Kr.has(s));
1289
1294
  if (r)
1290
1295
  throw new Error(`formatting contains unknown property "${r}"`);
1291
- const n = typeof e.timezone == "string" ? e.timezone.trim() : "";
1292
- if (!n)
1293
- throw new Error("formatting.timezone must be a non-empty string");
1294
- const o = pt(e.delimiter);
1296
+ const o = typeof e.timezone == "string" ? e.timezone.trim() : "";
1295
1297
  if (!o)
1298
+ throw new Error("formatting.timezone must be a non-empty string");
1299
+ const n = gt(e.delimiter);
1300
+ if (!n)
1296
1301
  throw new Error("formatting.delimiter must be a comma, semicolon or tab");
1297
- const i = yt(e.csvEncoding);
1302
+ const i = pt(e.csvEncoding);
1298
1303
  if (!i)
1299
1304
  throw new Error("formatting.csvEncoding must be 'utf-8-bom' or 'utf-8'");
1300
1305
  if (typeof e.includeHeaders != "boolean")
1301
1306
  throw new Error("formatting.includeHeaders must be a boolean");
1302
1307
  if (e.useFormattedValues !== void 0 && typeof e.useFormattedValues != "boolean")
1303
1308
  throw new Error("formatting.useFormattedValues must be a boolean");
1304
- const a = e.fileFormat === void 0 ? void 0 : ht(e.fileFormat);
1309
+ const a = e.fileFormat === void 0 ? void 0 : yt(e.fileFormat);
1305
1310
  if (e.fileFormat !== void 0 && !a)
1306
1311
  throw new Error("formatting.fileFormat must be 'csv' or 'xlsx'");
1307
1312
  if (e.title !== void 0 && typeof e.title != "string")
@@ -1317,16 +1322,16 @@ function Fn(e) {
1317
1322
  throw new Error("formatting.tableTotalsLabelColumnKey must be a non-empty string");
1318
1323
  if (g && !(l != null && l.includes(g)))
1319
1324
  throw new Error("formatting.tableTotalsLabelColumnKey must identify a visible column");
1320
- const p = bt(e.scope, "formatting.scope");
1325
+ const p = Ct(e.scope, "formatting.scope");
1321
1326
  if (!p.cardId || p.attachmentIndex !== void 0)
1322
1327
  throw new Error("formatting.scope must identify exactly one dashboard card");
1323
- const v = e.useFormattedValues !== !1, d = wt(e.presentationExecutionSnapshot);
1324
- if (n !== d.reportContext.calendar.tz)
1328
+ const v = e.useFormattedValues !== !1, d = xt(e.presentationExecutionSnapshot);
1329
+ if (o !== d.reportContext.calendar.tz)
1325
1330
  throw new Error(
1326
1331
  "formatting.timezone must equal presentationExecutionSnapshot.reportContext.calendar.tz"
1327
1332
  );
1328
1333
  try {
1329
- vt({
1334
+ St({
1330
1335
  snapshot: d,
1331
1336
  expectedScope: { dashboardId: p.dashboardId, cardId: p.cardId },
1332
1337
  visibleColumns: l,
@@ -1340,9 +1345,9 @@ function Fn(e) {
1340
1345
  return {
1341
1346
  scope: { dashboardId: p.dashboardId, cardId: p.cardId },
1342
1347
  useFormattedValues: v,
1343
- timezone: n,
1348
+ timezone: o,
1344
1349
  presentationExecutionSnapshot: d,
1345
- delimiter: o,
1350
+ delimiter: n,
1346
1351
  csvEncoding: i,
1347
1352
  includeHeaders: e.includeHeaders,
1348
1353
  ...u ? { columnSettings: u } : {},
@@ -1353,8 +1358,8 @@ function Fn(e) {
1353
1358
  ...typeof e.title == "string" ? { title: e.title } : {}
1354
1359
  };
1355
1360
  }
1356
- function Mn(e) {
1357
- const t = e.formatOptions, r = (n) => ie(n) ? n : void 0;
1361
+ function _o(e) {
1362
+ const t = e.formatOptions, r = (o) => ie(o) ? o : void 0;
1358
1363
  return {
1359
1364
  scope: { dashboardId: e.dashboardId, cardId: e.cardId },
1360
1365
  useFormattedValues: t.useFormattedValues !== !1,
@@ -1371,37 +1376,37 @@ function Mn(e) {
1371
1376
  ...typeof e.title == "string" ? { title: e.title } : {}
1372
1377
  };
1373
1378
  }
1374
- const Kr = /^\d{4}-\d{2}-\d{2}$/;
1375
- function Ye(e) {
1379
+ const Br = /^\d{4}-\d{2}-\d{2}$/;
1380
+ function Ze(e) {
1376
1381
  const t = e.split(".");
1377
- 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(" ");
1382
+ return t[t.length - 1].replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").split(" ").map((n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join(" ");
1378
1383
  }
1379
1384
  const Fe = 10;
1380
1385
  function ee(e, t) {
1381
- const r = e.slice(0, Fe).map(t).join(", "), n = e.length - Fe;
1382
- return n > 0 ? `${r}, and ${n} more` : r;
1386
+ const r = e.slice(0, Fe).map(t).join(", "), o = e.length - Fe;
1387
+ return o > 0 ? `${r}, and ${o} more` : r;
1383
1388
  }
1384
- function Br(e) {
1389
+ function zr(e) {
1385
1390
  if (e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between")
1386
1391
  return;
1387
1392
  const t = ae(e.relativeMeta);
1388
1393
  if (t)
1389
- return xt(t) || t.unit === "quarter" || t.unit === "year" ? t : void 0;
1394
+ return wt(t) || t.unit === "quarter" || t.unit === "year" ? t : void 0;
1390
1395
  }
1391
- function zr(e, t) {
1392
- if (t !== "label") return Br(e);
1396
+ function jr(e, t) {
1397
+ if (t !== "label") return zr(e);
1393
1398
  if (!(e.valueType !== "date" || e.operation !== "between" && e.operation !== "not between"))
1394
1399
  return ae(e.relativeMeta);
1395
1400
  }
1396
1401
  function Me(e, t = {}) {
1397
- const { name: r, operation: n, values: o, valueType: i } = e, a = t.label ?? Ye(r), l = zr(e, t.relativeDates);
1402
+ const { name: r, operation: o, values: n, valueType: i } = e, a = t.label ?? Ze(r), l = jr(e, t.relativeDates);
1398
1403
  if (l) {
1399
- const u = Lt(l);
1404
+ const u = $t(l);
1400
1405
  if (u)
1401
- return n === "between" ? `${a}: ${u}` : `${a} not in ${u}`;
1406
+ return o === "between" ? `${a}: ${u}` : `${a} not in ${u}`;
1402
1407
  }
1403
- if (!o || o.length === 0)
1404
- return n === "is null" ? `${a} is empty` : n === "is not null" ? `${a} is not empty` : "";
1408
+ if (!n || n.length === 0)
1409
+ return o === "is null" ? `${a} is empty` : o === "is not null" ? `${a} is not empty` : "";
1405
1410
  const m = (u) => {
1406
1411
  if (i === "date" && u) {
1407
1412
  const g = e.temporalPrecision === "minute", p = {
@@ -1413,7 +1418,7 @@ function Me(e, t = {}) {
1413
1418
  minute: "2-digit"
1414
1419
  } : {}
1415
1420
  };
1416
- if (typeof u == "string" && Kr.test(u)) {
1421
+ if (typeof u == "string" && Br.test(u)) {
1417
1422
  const [d, s, f] = u.split("-").map(Number);
1418
1423
  return new Intl.DateTimeFormat(void 0, {
1419
1424
  year: "numeric",
@@ -1422,7 +1427,7 @@ function Me(e, t = {}) {
1422
1427
  timeZone: "UTC"
1423
1428
  }).format(new Date(Date.UTC(d, s - 1, f)));
1424
1429
  }
1425
- if (typeof u == "string" && ut(u) === "wall_datetime") {
1430
+ if (typeof u == "string" && mt(u) === "wall_datetime") {
1426
1431
  const [d, s, f, b, y] = u.split(/[-T :.]/).map(Number);
1427
1432
  return new Intl.DateTimeFormat(void 0, {
1428
1433
  ...p,
@@ -1442,100 +1447,100 @@ function Me(e, t = {}) {
1442
1447
  }
1443
1448
  return String(u);
1444
1449
  };
1445
- switch (n) {
1450
+ switch (o) {
1446
1451
  case "=":
1447
- return `${a}: ${m(o[0])}`;
1452
+ return `${a}: ${m(n[0])}`;
1448
1453
  case "!=":
1449
- return `${a} ≠ ${m(o[0])}`;
1454
+ return `${a} ≠ ${m(n[0])}`;
1450
1455
  case ">":
1451
- return `${a} > ${m(o[0])}`;
1456
+ return `${a} > ${m(n[0])}`;
1452
1457
  case "<":
1453
- return `${a} < ${m(o[0])}`;
1458
+ return `${a} < ${m(n[0])}`;
1454
1459
  case ">=":
1455
- return `${a} ≥ ${m(o[0])}`;
1460
+ return `${a} ≥ ${m(n[0])}`;
1456
1461
  case "<=":
1457
- return `${a} ≤ ${m(o[0])}`;
1462
+ return `${a} ≤ ${m(n[0])}`;
1458
1463
  case "between":
1459
1464
  case "not between": {
1460
- const u = `${m(o[0])} - ${m(o[1])}`;
1461
- return n === "between" ? `${a}: ${u}` : `${a} not in ${u}`;
1465
+ const u = `${m(n[0])} - ${m(n[1])}`;
1466
+ return o === "between" ? `${a}: ${u}` : `${a} not in ${u}`;
1462
1467
  }
1463
1468
  case "in":
1464
- return o.length === 1 ? `${a}: ${m(o[0])}` : `${a}: ${ee(o, m)}`;
1469
+ return n.length === 1 ? `${a}: ${m(n[0])}` : `${a}: ${ee(n, m)}`;
1465
1470
  case "not in":
1466
- return `${a} not in (${ee(o, m)})`;
1471
+ return `${a} not in (${ee(n, m)})`;
1467
1472
  case "like":
1468
- return `${a} contains "${o[0]}"`;
1473
+ return `${a} contains "${n[0]}"`;
1469
1474
  case "not like":
1470
- return `${a} doesn't contain "${o[0]}"`;
1475
+ return `${a} doesn't contain "${n[0]}"`;
1471
1476
  default:
1472
- return `${a}: ${ee(o, m)}`;
1477
+ return `${a}: ${ee(n, m)}`;
1473
1478
  }
1474
1479
  }
1475
- function In(e, t = {}) {
1480
+ function Do(e, t = {}) {
1476
1481
  if (!e || e.length === 0)
1477
1482
  return "";
1478
1483
  const r = /* @__PURE__ */ new Map();
1479
- e.forEach((o) => {
1480
- const i = r.get(o.name) || [];
1481
- i.push(o), r.set(o.name, i);
1484
+ e.forEach((n) => {
1485
+ const i = r.get(n.name) || [];
1486
+ i.push(n), r.set(n.name, i);
1482
1487
  });
1483
- const n = [];
1484
- return r.forEach((o, i) => {
1485
- if (o.length === 1) {
1486
- const a = Me(o[0], t);
1487
- a && n.push(a);
1488
+ const o = [];
1489
+ return r.forEach((n, i) => {
1490
+ if (n.length === 1) {
1491
+ const a = Me(n[0], t);
1492
+ a && o.push(a);
1488
1493
  } else {
1489
- const a = Ye(i), l = o.map((m) => Me(m, t).replace(`${a}: `, "").replace(`${a} `, "")).filter(Boolean);
1490
- l.length > 0 && n.push(`${a}: ${l.join(" and ")}`);
1494
+ const a = Ze(i), l = n.map((m) => Me(m, t).replace(`${a}: `, "").replace(`${a} `, "")).filter(Boolean);
1495
+ l.length > 0 && o.push(`${a}: ${l.join(" and ")}`);
1491
1496
  }
1492
- }), n.join(" | ");
1497
+ }), o.join(" | ");
1493
1498
  }
1494
- function $n(e) {
1495
- return ((e == null ? void 0 : e.filterValues) ?? []).filter(jr).map(Gr);
1499
+ function Ro(e) {
1500
+ return ((e == null ? void 0 : e.filterValues) ?? []).filter(Gr).map(Hr);
1496
1501
  }
1497
- function jr(e) {
1502
+ function Gr(e) {
1498
1503
  return !!e && typeof e == "object" && typeof e.name == "string" && Array.isArray(e.values);
1499
1504
  }
1500
- function Gr(e) {
1505
+ function Hr(e) {
1501
1506
  if (!("relativeMeta" in e) || e.relativeMeta === void 0) return e;
1502
- const { relativeMeta: t, ...r } = e, n = ae(t);
1503
- return n ? { ...r, relativeMeta: n } : r;
1507
+ const { relativeMeta: t, ...r } = e, o = ae(t);
1508
+ return o ? { ...r, relativeMeta: o } : r;
1504
1509
  }
1505
- const Hr = /* @__PURE__ */ new Set([
1510
+ const Xr = /* @__PURE__ */ new Set([
1506
1511
  "day",
1507
1512
  "week",
1508
1513
  "month",
1509
1514
  "quarter",
1510
1515
  "year"
1511
1516
  ]);
1512
- function Xr(e, t) {
1517
+ function Wr(e, t) {
1513
1518
  try {
1514
1519
  const r = $(
1515
1520
  O(e),
1516
1521
  t,
1517
1522
  "yyyy-MM-dd"
1518
- ), [n, o, i] = r.split("-").map(Number), a = new Date(Date.UTC(n, o - 1, i));
1523
+ ), [o, n, i] = r.split("-").map(Number), a = new Date(Date.UTC(o, n - 1, i));
1519
1524
  return a.setUTCDate(a.getUTCDate() - 1), $(a, "UTC", "yyyy-MM-dd");
1520
1525
  } catch {
1521
1526
  return;
1522
1527
  }
1523
1528
  }
1524
- function _n(e, t, r, n = !1) {
1525
- const o = Wr(
1529
+ function Po(e, t, r, o = !1) {
1530
+ const n = Yr(
1526
1531
  e,
1527
1532
  t,
1528
1533
  r,
1529
- n
1534
+ o
1530
1535
  );
1531
- return `${o.start} - ${o.end}`;
1536
+ return `${n.start} - ${n.end}`;
1532
1537
  }
1533
- function Wr(e, t, r, n = !1) {
1538
+ function Yr(e, t, r, o = !1) {
1534
1539
  try {
1535
- if (r && Hr.has(r)) {
1536
- const o = Xr(e.end, t);
1537
- if (o) {
1538
- const i = n ? "MMM d" : "MMM d, yyyy";
1540
+ if (r && Xr.has(r)) {
1541
+ const n = Wr(e.end, t);
1542
+ if (n) {
1543
+ const i = o ? "MMM d" : "MMM d, yyyy";
1539
1544
  return {
1540
1545
  start: $(
1541
1546
  O(e.start),
@@ -1543,7 +1548,7 @@ function Wr(e, t, r, n = !1) {
1543
1548
  i
1544
1549
  ),
1545
1550
  end: $(
1546
- O(`${o}T00:00:00Z`),
1551
+ O(`${n}T00:00:00Z`),
1547
1552
  "UTC",
1548
1553
  "MMM d, yyyy"
1549
1554
  )
@@ -1551,13 +1556,13 @@ function Wr(e, t, r, n = !1) {
1551
1556
  }
1552
1557
  }
1553
1558
  if (r === "second" || r === "minute" || r === "hour") {
1554
- const o = n ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
1559
+ const n = o ? "MMM d, h:mm a" : "MMM d, yyyy, h:mm a";
1555
1560
  return {
1556
- start: $(O(e.start), t, o),
1561
+ start: $(O(e.start), t, n),
1557
1562
  end: `before ${$(
1558
1563
  O(e.end),
1559
1564
  t,
1560
- o
1565
+ n
1561
1566
  )}`
1562
1567
  };
1563
1568
  }
@@ -1566,53 +1571,54 @@ function Wr(e, t, r, n = !1) {
1566
1571
  return { start: e.start, end: `before ${e.end}` };
1567
1572
  }
1568
1573
  export {
1569
- Fn as A,
1570
- Mn as B,
1571
- An as C,
1572
- Ht as D,
1573
- Fe as E,
1574
- dn as F,
1575
- Br as G,
1576
- Me as H,
1577
- In as I,
1578
- $n as J,
1579
- Tr as K,
1580
- ne as L,
1581
- fn as M,
1582
- Cr as N,
1574
+ Io as A,
1575
+ $o as B,
1576
+ _o as C,
1577
+ Ve as D,
1578
+ Mo as E,
1579
+ Xt as F,
1580
+ Fe as G,
1581
+ zr as H,
1582
+ Me as I,
1583
+ Do as J,
1584
+ Ro as K,
1585
+ Cr as L,
1586
+ po as M,
1587
+ oe as N,
1583
1588
  xr as O,
1584
- Jt as P,
1589
+ Qt as P,
1585
1590
  Sr as Q,
1586
- En as R,
1587
- Ge as S,
1588
- kn as T,
1589
- Er as U,
1590
- Qt as V,
1591
- Wr as W,
1592
- un as a,
1593
- gn as b,
1594
- pn as c,
1595
- yn as d,
1596
- mn as e,
1597
- _n as f,
1598
- wn as g,
1599
- vn as h,
1600
- rr as i,
1601
- Tn as j,
1602
- hn as k,
1603
- bn as l,
1604
- tr as m,
1605
- Xt as n,
1606
- Yt as o,
1607
- er as p,
1608
- qt as q,
1591
+ Er as R,
1592
+ Lo as S,
1593
+ He as T,
1594
+ Fo as U,
1595
+ kr as V,
1596
+ er as W,
1597
+ Yr as X,
1598
+ fo as a,
1599
+ yo as b,
1600
+ ho as c,
1601
+ bo as d,
1602
+ go as e,
1603
+ Po as f,
1604
+ wo as g,
1605
+ Co as h,
1606
+ xo as i,
1607
+ or as j,
1608
+ So as k,
1609
+ vo as l,
1610
+ rr as m,
1611
+ To as n,
1612
+ Wt as o,
1613
+ tr as p,
1614
+ Zt as q,
1609
1615
  ve as r,
1610
- or as s,
1616
+ Jt as s,
1611
1617
  P as t,
1612
1618
  ar as u,
1613
- Cn as v,
1614
- xn as w,
1615
- ur as x,
1616
- Sn as y,
1617
- Ln as z
1619
+ sr as v,
1620
+ Eo as w,
1621
+ ko as x,
1622
+ mr as y,
1623
+ Ao as z
1618
1624
  };