react-semaphor 0.1.584 → 0.1.586

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 (61) hide show
  1. package/dist/analytics-protocol/index.js +474 -435
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/briefings/index.js +2 -2
  4. package/dist/chunks/{assistant-chat-nmycV1Se.js → assistant-chat-BU5gchFy.js} +8 -8
  5. package/dist/chunks/{bookmark-impact-CI3gmxi0.js → bookmark-impact-ZPSGncK6.js} +2 -2
  6. package/dist/chunks/{bookmark-state-D9-RFkDg.js → bookmark-state-CL4WEpgB.js} +2 -2
  7. package/dist/chunks/{card-filter-builder-C7QyPqRy.js → card-filter-builder-HELJWA4D.js} +208 -208
  8. package/dist/chunks/{comparison-window-caption-BAnsTI8y.js → comparison-window-caption-CoART8BC.js} +530 -633
  9. package/dist/chunks/{dashboard-inJy_V78.js → dashboard-BXP-ZxSY.js} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-DXs0XA1O.js → dashboard-briefing-launcher-BGj42whr.js} +9 -9
  11. package/dist/chunks/{dashboard-controls-6Zoo8d8Y.js → dashboard-controls-zvbRp6D2.js} +9 -9
  12. package/dist/chunks/{dashboard-json-D5eJhVA9.js → dashboard-json-CykexgqL.js} +1 -1
  13. package/dist/chunks/{dates-B3_GWc_Y.js → dates-CaqZtq01.js} +6 -6
  14. package/dist/chunks/{edit-dashboard-visual-DR03SYeW.js → edit-dashboard-visual-C82JNxbt.js} +2679 -2614
  15. package/dist/chunks/filter-line-Cu2u1K36.js +131 -0
  16. package/dist/chunks/{filter-reach-copy-CZwzrxBp.js → filter-reach-copy-ZERaFKsN.js} +1640 -1367
  17. package/dist/chunks/{filter-value-text-DtOvqcjn.js → filter-value-text-xefXzZlf.js} +10 -10
  18. package/dist/chunks/{index-BgT1L0p5.js → index-otMIColV.js} +35 -35
  19. package/dist/chunks/{matrix-analytical-definition-Cs2v43FM.js → matrix-analytical-definition-DOVSFFuf.js} +390 -542
  20. package/dist/chunks/{metric-comparison-Be4uS3Ql.js → metric-comparison-ZmurmEIs.js} +2 -2
  21. package/dist/chunks/{pivot-header-presentation-uH06jiZD.js → pivot-header-presentation-CdeTU96P.js} +1 -1
  22. package/dist/chunks/{pivot-result-contract-expectations-DvZY4eJM.js → pivot-result-contract-expectations-Bx_BCu-7.js} +1010 -1005
  23. package/dist/chunks/{pivot-result-identity-BZexMfmL.js → pivot-result-identity-Bvs6Uq3v.js} +1 -1
  24. package/dist/chunks/raw-temporal-value-DH-feMc2.js +322 -0
  25. package/dist/chunks/{report-preferences-dialog-DWeVe2so.js → report-preferences-dialog-B-CoyS1x.js} +119 -119
  26. package/dist/chunks/{resolve-dashboard-input-context-uATCuOP7.js → resolve-dashboard-input-context-BTTdKXH0.js} +10273 -10190
  27. package/dist/chunks/{saved-dashboard-context-DSVV9iqW.js → saved-dashboard-context-B-rosN4W.js} +78 -75
  28. package/dist/chunks/{semaphor-ready-indicator-B9vvRMnJ.js → semaphor-ready-indicator-Cy1n_04D.js} +28208 -27864
  29. package/dist/chunks/{shelf-drop-preview-context-BHOnp5Bo.js → shelf-drop-preview-context-Bmz54WYm.js} +2 -2
  30. package/dist/chunks/{stored-dashboard-xc5iidHL.js → stored-dashboard-rDJ8sw6J.js} +601 -596
  31. package/dist/chunks/{table-export-sheet-Cv_94obr.js → table-export-sheet-Dmtqi5NV.js} +1 -1
  32. package/dist/chunks/{variable-draft-C3CjhsJQ.js → variable-draft-DvngkRMl.js} +3 -3
  33. package/dist/chunks/{visual-choice-JiJ-_3bi.js → visual-choice-BBPizkRo.js} +74 -72
  34. package/dist/dashboard/index.js +2 -2
  35. package/dist/dashboard-authoring/index.js +699 -688
  36. package/dist/format-utils/index.js +145 -142
  37. package/dist/index.js +14 -14
  38. package/dist/style.css +1 -1
  39. package/dist/surfboard/index.js +2 -2
  40. package/dist/types/index.js +2 -2
  41. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +86 -3
  42. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +49 -27
  43. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
  44. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +30 -2
  45. package/dist/types/shared/analytics-protocol/click-reach-filter-id.d.ts +9 -0
  46. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +3 -1
  47. package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
  48. package/dist/types/shared/dashboard-authoring/click-to-filter-card-decision.d.ts +102 -0
  49. package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +13 -1
  50. package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
  51. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +191 -0
  52. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +3 -0
  53. package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +5 -2
  54. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +37 -4
  55. package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +13 -0
  56. package/dist/types/shared/format-utils/semantic-format.d.ts +0 -1
  57. package/dist/types/shared/format-utils/temporal-bucket.d.ts +20 -0
  58. package/dist/types/shared/temporal/calendar-periods.d.ts +15 -0
  59. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +14 -0
  60. package/package.json +2 -2
  61. package/dist/chunks/raw-temporal-value-DdT0s47W.js +0 -159
@@ -1,84 +1,84 @@
1
- var Cn = Object.defineProperty;
2
- var Pn = (e, t, n) => t in e ? Cn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var $ = (e, t, n) => Pn(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { z as w } from "zod";
5
- import { E as Ut, l as Lt } from "./export-file-format-C-tJsxsf.js";
6
- import { a$ as Wt, b0 as Yn, aU as zn, m as nt, a5 as An, M as Rn, b1 as Un, b2 as Ln, R as Wn, I as X, S as jn } from "./validators-CJ8Jh0E8.js";
1
+ var Yn = Object.defineProperty;
2
+ var zn = (e, t, n) => t in e ? Yn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var $ = (e, t, n) => zn(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { z as p } from "zod";
5
+ import { E as Wt, l as jt } from "./export-file-format-C-tJsxsf.js";
6
+ import { a$ as Ht, b0 as An, aU as Rn, m as rt, a5 as Un, M as Ln, b1 as Wn, b2 as jn, R as Hn, I as X, S as qn } from "./validators-CJ8Jh0E8.js";
7
7
  import "./matrix-operation-contract-BM5TveR3.js";
8
- import { k as Hn, i as he } from "./analytics-base-schemas-BaIQrEzX.js";
9
- import { b as qn } from "./report-runtime-context-NlOXwyRB.js";
10
- import { canonicalizeSupportedLocale as Q, canonicalizeSupportedCurrencyCode as Ae, DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as Zn } from "../value-format-preferences/index.js";
11
- import { p as Xn, a as Vn, c as Kn, b as Bn } from "./raw-temporal-value-DdT0s47W.js";
12
- import { r as Gn } from "./metric-comparison-Be4uS3Ql.js";
8
+ import { k as Zn, i as he } from "./analytics-base-schemas-BaIQrEzX.js";
9
+ import { b as Xn } from "./report-runtime-context-NlOXwyRB.js";
10
+ import { canonicalizeSupportedLocale as Q, canonicalizeSupportedCurrencyCode as Re, DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as Vn } from "../value-format-preferences/index.js";
11
+ import { p as Bn, a as Kn, c as Gn, s as qt, h as Qn, i as at, b as Jn } from "./raw-temporal-value-DH-feMc2.js";
12
+ import { a as er } from "./metric-comparison-ZmurmEIs.js";
13
13
  function J(e) {
14
14
  if (!e || typeof e != "object") return !1;
15
15
  const t = e.type;
16
16
  return t === "number" || t === "currency" || t === "percent" || t === "scientific";
17
17
  }
18
- function Ss(e) {
18
+ function ks(e) {
19
19
  return J(e) || !!e && typeof e == "object" && e.type === "duration";
20
20
  }
21
- const jt = [
21
+ const Zt = [
22
22
  "day",
23
23
  "hour",
24
24
  "minute",
25
25
  "second",
26
26
  "millisecond"
27
- ], Re = {
27
+ ], Ue = {
28
28
  day: 864e5,
29
29
  hour: 36e5,
30
30
  minute: 6e4,
31
31
  second: 1e3,
32
32
  millisecond: 1
33
- }, Qn = {
33
+ }, tr = {
34
34
  day: "d",
35
35
  hour: "hr",
36
36
  minute: "min",
37
37
  second: "s",
38
38
  millisecond: "ms"
39
- }, Jn = {
39
+ }, nr = {
40
40
  day: ["day", "days"],
41
41
  hour: ["hour", "hours"],
42
42
  minute: ["minute", "minutes"],
43
43
  second: ["second", "seconds"],
44
44
  millisecond: ["millisecond", "milliseconds"]
45
45
  };
46
- function er(e) {
46
+ function rr(e) {
47
47
  return e === "day" || e === "hour" || e === "minute" || e === "second" || e === "millisecond";
48
48
  }
49
- function Ht(e, t) {
50
- return er(e) ? e : t;
49
+ function Xt(e, t) {
50
+ return rr(e) ? e : t;
51
51
  }
52
- function rt(e, t) {
53
- return jt.indexOf(Ht(e, t));
52
+ function it(e, t) {
53
+ return Zt.indexOf(Xt(e, t));
54
54
  }
55
- function tr(e, t) {
56
- const n = rt(e, "day"), r = rt(t, "second"), a = Math.min(n, r), i = Math.max(n, r);
57
- return jt.slice(a, i + 1);
55
+ function ar(e, t) {
56
+ const n = it(e, "day"), r = it(t, "second"), a = Math.min(n, r), i = Math.max(n, r);
57
+ return Zt.slice(a, i + 1);
58
58
  }
59
- function nr(e, t) {
60
- return e * Re[Ht(t, "second")];
59
+ function ir(e, t) {
60
+ return e * Ue[Xt(t, "second")];
61
61
  }
62
- function rr(e, t) {
63
- const n = tr(t.largestUnit, t.smallestUnit), r = n[n.length - 1], a = Re[r];
62
+ function or(e, t) {
63
+ const n = ar(t.largestUnit, t.smallestUnit), r = n[n.length - 1], a = Ue[r];
64
64
  let i = Math.round(e / a) * a;
65
65
  return n.map((o) => {
66
- const s = Re[o], c = Math.floor(i / s);
66
+ const s = Ue[o], c = Math.floor(i / s);
67
67
  return i -= c * s, { unit: o, value: c };
68
68
  });
69
69
  }
70
- function ar(e, t) {
70
+ function sr(e, t) {
71
71
  const n = e.filter((i) => i.value !== 0), r = n.length > 0 ? n : [e[e.length - 1]], a = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : r.length;
72
- return r.slice(0, a).map((i) => `${i.value}${Qn[i.unit]}`).join(" ");
72
+ return r.slice(0, a).map((i) => `${i.value}${tr[i.unit]}`).join(" ");
73
73
  }
74
- function ir(e, t) {
74
+ function cr(e, t) {
75
75
  const n = e.filter((i) => i.value !== 0), r = n.length > 0 ? n : [e[e.length - 1]], a = typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.trunc(t)) : r.length;
76
76
  return r.slice(0, a).map((i) => {
77
- const [o, s] = Jn[i.unit];
77
+ const [o, s] = nr[i.unit];
78
78
  return `${i.value} ${i.value === 1 ? o : s}`;
79
79
  }).join(" ");
80
80
  }
81
- function or(e) {
81
+ function ur(e) {
82
82
  const t = e.some(
83
83
  (c) => c.unit === "day" && c.value !== 0
84
84
  ), n = e.some((c) => c.unit === "millisecond"), r = e.findIndex((c) => c.value !== 0), a = Math.max(0, e.length - 2), i = t ? 0 : r === -1 ? a : Math.min(r, a), o = r === -1 ? e.slice(a) : e.slice(i);
@@ -87,21 +87,21 @@ function or(e) {
87
87
  const s = o.map((c, u) => c.unit === "millisecond" ? String(c.value).padStart(3, "0") : u === 0 ? String(c.value) : String(c.value).padStart(2, "0")).join(":");
88
88
  return n ? s.replace(/:(\d{3})$/, ".$1") : s;
89
89
  }
90
- function sr(e, t, n) {
90
+ function lr(e, t, n) {
91
91
  const r = `${n.prefix || ""}${e}${n.suffix || ""}`;
92
92
  return t ? n.negativeInParentheses ? `(${r})` : `-${r}` : r;
93
93
  }
94
- function qt(e, t = {}) {
94
+ function Vt(e, t = {}) {
95
95
  if (e == null)
96
96
  return "";
97
97
  const n = typeof e == "number" ? e : typeof e == "string" && e.trim() ? Number(e) : NaN;
98
98
  if (!Number.isFinite(n))
99
99
  return "";
100
- const r = t.inputUnit || "second", a = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", i = n < 0, o = Math.abs(nr(n, r)), s = rr(o, t), c = a === "digital" ? or(s) : a === "long" ? ir(s, t.maxUnits) : ar(s, t.maxUnits);
101
- return sr(c, i, t);
100
+ const r = t.inputUnit || "second", a = t.outputStyle === "digital" || t.outputStyle === "long" ? t.outputStyle : "compact", i = n < 0, o = Math.abs(ir(n, r)), s = or(o, t), c = a === "digital" ? ur(s) : a === "long" ? cr(s, t.maxUnits) : sr(s, t.maxUnits);
101
+ return lr(c, i, t);
102
102
  }
103
- function Zt(e, t) {
104
- return qt(
103
+ function Bt(e, t) {
104
+ return Vt(
105
105
  e !== null && typeof e == "object" ? e.value : e,
106
106
  {
107
107
  inputUnit: t.inputUnit,
@@ -115,21 +115,21 @@ function Zt(e, t) {
115
115
  }
116
116
  );
117
117
  }
118
- let at;
119
- function it(e, t) {
118
+ let ot;
119
+ function st(e, t) {
120
120
  const n = e.format;
121
121
  return n(t);
122
122
  }
123
- function cr(e, t) {
124
- if (at ?? (at = it(
123
+ function mr(e, t) {
124
+ if (ot ?? (ot = st(
125
125
  new Intl.NumberFormat("en-US", { useGrouping: !1, maximumFractionDigits: 6 }),
126
126
  "9007199254740993.000009"
127
- ) === "9007199254740993.000009"), !at)
127
+ ) === "9007199254740993.000009"), !ot)
128
128
  throw new RangeError("This runtime cannot format exact decimal strings.");
129
129
  const n = Number(e);
130
130
  if (!Number.isFinite(n) || n === 0 && e !== "0")
131
131
  throw new RangeError("Exact value is outside the Intl formatting range; use raw text.");
132
- return it(t, e);
132
+ return st(t, e);
133
133
  }
134
134
  function ee(e) {
135
135
  return typeof e == "number" ? e < 0 : e.value.startsWith("-");
@@ -137,50 +137,50 @@ function ee(e) {
137
137
  function V(e) {
138
138
  return typeof e == "number" ? Math.abs(e) : ee(e) ? { ...e, value: e.value.slice(1) } : e;
139
139
  }
140
- function ur(e) {
140
+ function fr(e) {
141
141
  return typeof e == "number" ? e === 0 : /^-?0*(\.0*)?$/.test(e.value);
142
142
  }
143
- function Xt(e, t) {
143
+ function Kt(e, t) {
144
144
  return typeof e == "number" ? e * t : {
145
145
  kind: "exact_number",
146
146
  type: "decimal",
147
- value: Wt(e.value, t)
147
+ value: Ht(e.value, t)
148
148
  };
149
149
  }
150
150
  function ge(e, t) {
151
151
  return t === 0 ? e : typeof e == "number" ? e / 10 ** t : {
152
152
  kind: "exact_number",
153
153
  type: "decimal",
154
- value: Wt(e.value, `1e-${t}`)
154
+ value: Ht(e.value, `1e-${t}`)
155
155
  };
156
156
  }
157
157
  function A(e, t) {
158
- return typeof e == "number" ? t.format(e) : cr(e.value, t);
158
+ return typeof e == "number" ? t.format(e) : mr(e.value, t);
159
159
  }
160
- function ot(e) {
160
+ function ct(e) {
161
161
  if (!e) return !1;
162
162
  const t = e.toLowerCase().replace("_", "-");
163
163
  return t === "en-in" || t.startsWith("en-in-");
164
164
  }
165
- function st(e, t) {
166
- const n = V(e), r = (a) => typeof n == "number" ? n >= a : Yn(n.value, String(a)) >= 0;
167
- return r(1e12) ? { power: 12, suffix: "T" } : r(1e9) ? { power: 9, suffix: "B" } : ot(t) && r(1e7) ? { power: 7, suffix: "Cr" } : r(1e6) ? { power: 6, suffix: "M" } : ot(t) && r(1e5) ? { power: 5, suffix: "L" } : r(1e3) ? { power: 3, suffix: "K" } : { power: 0, suffix: "" };
165
+ function ut(e, t) {
166
+ const n = V(e), r = (a) => typeof n == "number" ? n >= a : An(n.value, String(a)) >= 0;
167
+ return r(1e12) ? { power: 12, suffix: "T" } : r(1e9) ? { power: 9, suffix: "B" } : ct(t) && r(1e7) ? { power: 7, suffix: "Cr" } : r(1e6) ? { power: 6, suffix: "M" } : ct(t) && r(1e5) ? { power: 5, suffix: "L" } : r(1e3) ? { power: 3, suffix: "K" } : { power: 0, suffix: "" };
168
168
  }
169
- function Ue(e, t) {
169
+ function Le(e, t) {
170
170
  try {
171
171
  const n = W(t);
172
- return st(e, n);
172
+ return ut(e, n);
173
173
  } catch {
174
- return st(e, "en-US");
174
+ return ut(e, "en-US");
175
175
  }
176
176
  }
177
- const Vt = 500, re = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map();
177
+ const Gt = 500, re = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map();
178
178
  function _(e, t = {}) {
179
179
  const n = `${e}|${JSON.stringify(t)}`;
180
180
  let r = re.get(n);
181
- return r || (r = new Intl.NumberFormat(e, t), re.size >= Vt && re.clear(), re.set(n, r)), r;
181
+ return r || (r = new Intl.NumberFormat(e, t), re.size >= Gt && re.clear(), re.set(n, r)), r;
182
182
  }
183
- function lr(e) {
183
+ function dr(e) {
184
184
  let t = ae.get(e);
185
185
  if (t === void 0) {
186
186
  try {
@@ -188,20 +188,20 @@ function lr(e) {
188
188
  } catch {
189
189
  t = !1;
190
190
  }
191
- ae.size >= Vt && ae.clear(), ae.set(e, t);
191
+ ae.size >= Gt && ae.clear(), ae.set(e, t);
192
192
  }
193
193
  return t;
194
194
  }
195
195
  function W(e) {
196
- return e && lr(e) ? e : "en-US";
196
+ return e && dr(e) ? e : "en-US";
197
197
  }
198
- function qe(e, t) {
198
+ function Ze(e, t) {
199
199
  if (e == null || Number.isNaN(e))
200
200
  return "";
201
201
  const n = W(t == null ? void 0 : t.locale);
202
202
  let r = e;
203
- if (t != null && t.multiplyBy && (r = Xt(r, t.multiplyBy)), t != null && t.useSuffix) {
204
- const { power: i, suffix: o } = Ue(r, n);
203
+ if (t != null && t.multiplyBy && (r = Kt(r, t.multiplyBy)), t != null && t.useSuffix) {
204
+ const { power: i, suffix: o } = Le(r, n);
205
205
  r = ge(r, i);
206
206
  const s = A(r, _(n, {
207
207
  minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
@@ -221,13 +221,13 @@ function qe(e, t) {
221
221
  }
222
222
  return `${(t == null ? void 0 : t.prefix) ?? ""}${a}${(t == null ? void 0 : t.suffix) ?? ""}`;
223
223
  }
224
- function Kt(e, t) {
224
+ function Qt(e, t) {
225
225
  if (e == null || Number.isNaN(e))
226
226
  return "";
227
227
  const n = W(t == null ? void 0 : t.locale), r = (t == null ? void 0 : t.currency) || "USD", a = ee(e), i = !!(t != null && t.negativeInParentheses && a), o = i ? V(e) : e;
228
228
  try {
229
229
  if (t != null && t.useSuffix) {
230
- const { power: c, suffix: u } = Ue(o, n), l = ge(o, c), m = `${A(l, _(n, {
230
+ const { power: c, suffix: u } = Le(o, n), l = ge(o, c), m = `${A(l, _(n, {
231
231
  style: "currency",
232
232
  currency: r,
233
233
  minimumFractionDigits: (t == null ? void 0 : t.minimumFractionDigits) ?? 0,
@@ -245,7 +245,7 @@ function Kt(e, t) {
245
245
  }));
246
246
  return i ? `(${s})` : s;
247
247
  } catch {
248
- const s = V(e), c = t != null && t.useSuffix ? Ue(s, n) : { power: 0, suffix: "" }, u = qe(
248
+ const s = V(e), c = t != null && t.useSuffix ? Le(s, n) : { power: 0, suffix: "" }, u = Ze(
249
249
  ge(s, c.power),
250
250
  {
251
251
  locale: n,
@@ -257,7 +257,7 @@ function Kt(e, t) {
257
257
  return a ? t != null && t.negativeInParentheses ? `(${l})` : `-${l}` : l;
258
258
  }
259
259
  }
260
- function Bt(e, t) {
260
+ function Jt(e, t) {
261
261
  if (e == null || Number.isNaN(e))
262
262
  return "";
263
263
  const n = W(t == null ? void 0 : t.locale), a = (t == null ? void 0 : t.alreadyPercent) ?? (t == null ? void 0 : t.percentValueMode) === "whole" ? ge(e, 2) : e;
@@ -268,7 +268,7 @@ function Bt(e, t) {
268
268
  useGrouping: (t == null ? void 0 : t.useGrouping) ?? !0
269
269
  }));
270
270
  }
271
- function Gt(e, t) {
271
+ function en(e, t) {
272
272
  if (e == null || Number.isNaN(e))
273
273
  return "";
274
274
  const n = W(t == null ? void 0 : t.locale);
@@ -278,19 +278,19 @@ function Gt(e, t) {
278
278
  maximumFractionDigits: (t == null ? void 0 : t.maximumFractionDigits) ?? 2
279
279
  }));
280
280
  }
281
- function mr(e, t) {
282
- const n = t ?? "auto", r = n === "never" ? V(e) : e, a = !ee(r) && (n === "always" || n === "exceptZero" && !ur(r));
281
+ function hr(e, t) {
282
+ const n = t ?? "auto", r = n === "never" ? V(e) : e, a = !ee(r) && (n === "always" || n === "exceptZero" && !fr(r));
283
283
  return { value: r, plus: a };
284
284
  }
285
- function Ms(e) {
285
+ function _s(e) {
286
286
  if (!e || !("signDisplay" in e)) return e;
287
287
  const { signDisplay: t, ...n } = e;
288
288
  return n;
289
289
  }
290
- function Ze(e, t) {
290
+ function Xe(e, t) {
291
291
  if (e == null || Number.isNaN(e))
292
292
  return "";
293
- const n = t.scale === void 0 ? e : Xt(e, t.scale), r = mr(n, t.signDisplay), a = r.value, i = r.plus ? "+" : "", o = t.negativeStyle === "parentheses" && ee(a), s = o ? V(a) : a, c = {
293
+ const n = t.scale === void 0 ? e : Kt(e, t.scale), r = hr(n, t.signDisplay), a = r.value, i = r.plus ? "+" : "", o = t.negativeStyle === "parentheses" && ee(a), s = o ? V(a) : a, c = {
294
294
  style: t.type === "number" ? "decimal" : t.type,
295
295
  locale: t.locale,
296
296
  currency: t.currency,
@@ -303,29 +303,29 @@ function Ze(e, t) {
303
303
  let u;
304
304
  switch (t.type) {
305
305
  case "currency":
306
- u = Kt(s, c);
306
+ u = Qt(s, c);
307
307
  break;
308
308
  case "percent":
309
- u = Bt(s, c);
309
+ u = Jt(s, c);
310
310
  break;
311
311
  case "scientific":
312
- u = Gt(s, c);
312
+ u = en(s, c);
313
313
  break;
314
314
  default:
315
- u = qe(s, c);
315
+ u = Ze(s, c);
316
316
  break;
317
317
  }
318
318
  const l = `${t.prefix ?? ""}${i}${u}${t.suffix ?? ""}`;
319
319
  return o ? `(${l})` : l;
320
320
  }
321
- function ks(e, t) {
322
- return t.type === "duration" ? e == null ? "" : Zt(e, t) : Ze(e, t);
321
+ function Ns(e, t) {
322
+ return t.type === "duration" ? e == null ? "" : Bt(e, t) : Xe(e, t);
323
323
  }
324
- function fr(e, t, n = "en-US") {
324
+ function gr(e, t, n = "en-US") {
325
325
  if (e == null || typeof e == "number" && isNaN(e))
326
326
  return "";
327
327
  if ((t == null ? void 0 : t.style) === "duration")
328
- return Zt(e, {
328
+ return Bt(e, {
329
329
  ...t.duration,
330
330
  prefix: t.prefix,
331
331
  suffix: t.suffix,
@@ -335,7 +335,7 @@ function fr(e, t, n = "en-US") {
335
335
  return i === "currency" && _(r, {
336
336
  style: "currency",
337
337
  currency: (t == null ? void 0 : t.currency) || "USD"
338
- }), Ze(e, {
338
+ }), Xe(e, {
339
339
  type: i,
340
340
  locale: r,
341
341
  currency: i === "currency" ? (t == null ? void 0 : t.currency) || "USD" : void 0,
@@ -350,7 +350,7 @@ function fr(e, t, n = "en-US") {
350
350
  suffix: t == null ? void 0 : t.suffix
351
351
  });
352
352
  }
353
- function _s(e, t, n) {
353
+ function $s(e, t, n) {
354
354
  const r = {
355
355
  style: t === "currency" ? "currency" : t === "percent" ? "percent" : "decimal",
356
356
  locale: n == null ? void 0 : n.locale,
@@ -365,49 +365,49 @@ function _s(e, t, n) {
365
365
  };
366
366
  switch (t) {
367
367
  case "currency":
368
- return Kt(e, r);
368
+ return Qt(e, r);
369
369
  case "percent":
370
- return Bt(e, r);
370
+ return Jt(e, r);
371
371
  case "scientific":
372
- return Gt(e, r);
372
+ return en(e, r);
373
373
  default:
374
- return qe(e, r);
374
+ return Ze(e, r);
375
375
  }
376
376
  }
377
- function p(e) {
377
+ function w(e) {
378
378
  const t = Object.prototype.toString.call(e);
379
379
  return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
380
380
  }
381
381
  function N(e, t) {
382
382
  return e instanceof Date ? new e.constructor(t) : new Date(t);
383
383
  }
384
- const Qt = 6048e5, dr = 864e5, Jt = 6e4, en = 36e5, Ns = 525600, ie = 43200, ct = 1440;
385
- let hr = {};
384
+ const tn = 6048e5, yr = 864e5, nn = 6e4, rn = 36e5, Es = 525600, ie = 43200, lt = 1440;
385
+ let wr = {};
386
386
  function j() {
387
- return hr;
387
+ return wr;
388
388
  }
389
- function K(e, t) {
389
+ function B(e, t) {
390
390
  var s, c, u, l;
391
- const n = j(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = p(e), i = a.getDay(), o = (i < r ? 7 : 0) + i - r;
391
+ const n = j(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = w(e), i = a.getDay(), o = (i < r ? 7 : 0) + i - r;
392
392
  return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
393
393
  }
394
394
  function ye(e) {
395
- return K(e, { weekStartsOn: 1 });
395
+ return B(e, { weekStartsOn: 1 });
396
396
  }
397
- function tn(e) {
398
- const t = p(e), n = t.getFullYear(), r = N(e, 0);
397
+ function an(e) {
398
+ const t = w(e), n = t.getFullYear(), r = N(e, 0);
399
399
  r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
400
400
  const a = ye(r), i = N(e, 0);
401
401
  i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0);
402
402
  const o = ye(i);
403
403
  return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= o.getTime() ? n : n - 1;
404
404
  }
405
- function ut(e) {
406
- const t = p(e);
405
+ function mt(e) {
406
+ const t = w(e);
407
407
  return t.setHours(0, 0, 0, 0), t;
408
408
  }
409
- function pe(e) {
410
- const t = p(e), n = new Date(
409
+ function we(e) {
410
+ const t = w(e), n = new Date(
411
411
  Date.UTC(
412
412
  t.getFullYear(),
413
413
  t.getMonth(),
@@ -420,58 +420,58 @@ function pe(e) {
420
420
  );
421
421
  return n.setUTCFullYear(t.getFullYear()), +e - +n;
422
422
  }
423
- function gr(e, t) {
424
- const n = ut(e), r = ut(t), a = +n - pe(n), i = +r - pe(r);
425
- return Math.round((a - i) / dr);
423
+ function pr(e, t) {
424
+ const n = mt(e), r = mt(t), a = +n - we(n), i = +r - we(r);
425
+ return Math.round((a - i) / yr);
426
426
  }
427
- function yr(e) {
428
- const t = tn(e), n = N(e, 0);
427
+ function Tr(e) {
428
+ const t = an(e), n = N(e, 0);
429
429
  return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), ye(n);
430
430
  }
431
431
  function ue(e, t) {
432
- const n = p(e), r = p(t), a = n.getTime() - r.getTime();
432
+ const n = w(e), r = w(t), a = n.getTime() - r.getTime();
433
433
  return a < 0 ? -1 : a > 0 ? 1 : a;
434
434
  }
435
- function pr(e) {
435
+ function xr(e) {
436
436
  return N(e, Date.now());
437
437
  }
438
- function wr(e) {
438
+ function Dr(e) {
439
439
  return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
440
440
  }
441
- function Tr(e) {
442
- if (!wr(e) && typeof e != "number")
441
+ function br(e) {
442
+ if (!Dr(e) && typeof e != "number")
443
443
  return !1;
444
- const t = p(e);
444
+ const t = w(e);
445
445
  return !isNaN(Number(t));
446
446
  }
447
- function Dr(e, t) {
448
- const n = p(e), r = p(t), a = n.getFullYear() - r.getFullYear(), i = n.getMonth() - r.getMonth();
447
+ function vr(e, t) {
448
+ const n = w(e), r = w(t), a = n.getFullYear() - r.getFullYear(), i = n.getMonth() - r.getMonth();
449
449
  return a * 12 + i;
450
450
  }
451
- function br(e) {
451
+ function Sr(e) {
452
452
  return (t) => {
453
453
  const r = (e ? Math[e] : Math.trunc)(t);
454
454
  return r === 0 ? 0 : r;
455
455
  };
456
456
  }
457
- function xr(e, t) {
458
- return +p(e) - +p(t);
457
+ function Mr(e, t) {
458
+ return +w(e) - +w(t);
459
459
  }
460
- function vr(e) {
461
- const t = p(e);
460
+ function kr(e) {
461
+ const t = w(e);
462
462
  return t.setHours(23, 59, 59, 999), t;
463
463
  }
464
- function Sr(e) {
465
- const t = p(e), n = t.getMonth();
464
+ function _r(e) {
465
+ const t = w(e), n = t.getMonth();
466
466
  return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
467
467
  }
468
- function Mr(e) {
469
- const t = p(e);
470
- return +vr(t) == +Sr(t);
468
+ function Nr(e) {
469
+ const t = w(e);
470
+ return +kr(t) == +_r(t);
471
471
  }
472
- function kr(e, t) {
473
- const n = p(e), r = p(t), a = ue(n, r), i = Math.abs(
474
- Dr(n, r)
472
+ function $r(e, t) {
473
+ const n = w(e), r = w(t), a = ue(n, r), i = Math.abs(
474
+ vr(n, r)
475
475
  );
476
476
  let o;
477
477
  if (i < 1)
@@ -479,19 +479,19 @@ function kr(e, t) {
479
479
  else {
480
480
  n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a * i);
481
481
  let s = ue(n, r) === -a;
482
- Mr(p(e)) && i === 1 && ue(e, r) === 1 && (s = !1), o = a * (i - Number(s));
482
+ Nr(w(e)) && i === 1 && ue(e, r) === 1 && (s = !1), o = a * (i - Number(s));
483
483
  }
484
484
  return o === 0 ? 0 : o;
485
485
  }
486
- function _r(e, t, n) {
487
- const r = xr(e, t) / 1e3;
488
- return br(n == null ? void 0 : n.roundingMethod)(r);
486
+ function Er(e, t, n) {
487
+ const r = Mr(e, t) / 1e3;
488
+ return Sr(n == null ? void 0 : n.roundingMethod)(r);
489
489
  }
490
- function Nr(e) {
491
- const t = p(e), n = N(e, 0);
490
+ function Ir(e) {
491
+ const t = w(e), n = N(e, 0);
492
492
  return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
493
493
  }
494
- const $r = {
494
+ const Or = {
495
495
  lessThanXSeconds: {
496
496
  one: "less than a second",
497
497
  other: "less than {{count}} seconds"
@@ -553,53 +553,53 @@ const $r = {
553
553
  one: "almost 1 year",
554
554
  other: "almost {{count}} years"
555
555
  }
556
- }, Er = (e, t, n) => {
556
+ }, Fr = (e, t, n) => {
557
557
  let r;
558
- const a = $r[e];
558
+ const a = Or[e];
559
559
  return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
560
560
  };
561
- function ke(e) {
561
+ function _e(e) {
562
562
  return (t = {}) => {
563
563
  const n = t.width ? String(t.width) : e.defaultWidth;
564
564
  return e.formats[n] || e.formats[e.defaultWidth];
565
565
  };
566
566
  }
567
- const Or = {
567
+ const Cr = {
568
568
  full: "EEEE, MMMM do, y",
569
569
  long: "MMMM do, y",
570
570
  medium: "MMM d, y",
571
571
  short: "MM/dd/yyyy"
572
- }, Ir = {
572
+ }, Pr = {
573
573
  full: "h:mm:ss a zzzz",
574
574
  long: "h:mm:ss a z",
575
575
  medium: "h:mm:ss a",
576
576
  short: "h:mm a"
577
- }, Fr = {
577
+ }, Yr = {
578
578
  full: "{{date}} 'at' {{time}}",
579
579
  long: "{{date}} 'at' {{time}}",
580
580
  medium: "{{date}}, {{time}}",
581
581
  short: "{{date}}, {{time}}"
582
- }, Cr = {
583
- date: ke({
584
- formats: Or,
582
+ }, zr = {
583
+ date: _e({
584
+ formats: Cr,
585
585
  defaultWidth: "full"
586
586
  }),
587
- time: ke({
588
- formats: Ir,
587
+ time: _e({
588
+ formats: Pr,
589
589
  defaultWidth: "full"
590
590
  }),
591
- dateTime: ke({
592
- formats: Fr,
591
+ dateTime: _e({
592
+ formats: Yr,
593
593
  defaultWidth: "full"
594
594
  })
595
- }, Pr = {
595
+ }, Ar = {
596
596
  lastWeek: "'last' eeee 'at' p",
597
597
  yesterday: "'yesterday at' p",
598
598
  today: "'today at' p",
599
599
  tomorrow: "'tomorrow at' p",
600
600
  nextWeek: "eeee 'at' p",
601
601
  other: "P"
602
- }, Yr = (e, t, n, r) => Pr[e];
602
+ }, Rr = (e, t, n, r) => Ar[e];
603
603
  function H(e) {
604
604
  return (t, n) => {
605
605
  const r = n != null && n.context ? String(n.context) : "standalone";
@@ -615,15 +615,15 @@ function H(e) {
615
615
  return a[i];
616
616
  };
617
617
  }
618
- const zr = {
618
+ const Ur = {
619
619
  narrow: ["B", "A"],
620
620
  abbreviated: ["BC", "AD"],
621
621
  wide: ["Before Christ", "Anno Domini"]
622
- }, Ar = {
622
+ }, Lr = {
623
623
  narrow: ["1", "2", "3", "4"],
624
624
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
625
625
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
626
- }, Rr = {
626
+ }, Wr = {
627
627
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
628
628
  abbreviated: [
629
629
  "Jan",
@@ -653,7 +653,7 @@ const zr = {
653
653
  "November",
654
654
  "December"
655
655
  ]
656
- }, Ur = {
656
+ }, jr = {
657
657
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
658
658
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
659
659
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -666,7 +666,7 @@ const zr = {
666
666
  "Friday",
667
667
  "Saturday"
668
668
  ]
669
- }, Lr = {
669
+ }, Hr = {
670
670
  narrow: {
671
671
  am: "a",
672
672
  pm: "p",
@@ -697,7 +697,7 @@ const zr = {
697
697
  evening: "evening",
698
698
  night: "night"
699
699
  }
700
- }, Wr = {
700
+ }, qr = {
701
701
  narrow: {
702
702
  am: "a",
703
703
  pm: "p",
@@ -728,7 +728,7 @@ const zr = {
728
728
  evening: "in the evening",
729
729
  night: "at night"
730
730
  }
731
- }, jr = (e, t) => {
731
+ }, Zr = (e, t) => {
732
732
  const n = Number(e), r = n % 100;
733
733
  if (r > 20 || r < 10)
734
734
  switch (r % 10) {
@@ -740,29 +740,29 @@ const zr = {
740
740
  return n + "rd";
741
741
  }
742
742
  return n + "th";
743
- }, Hr = {
744
- ordinalNumber: jr,
743
+ }, Xr = {
744
+ ordinalNumber: Zr,
745
745
  era: H({
746
- values: zr,
746
+ values: Ur,
747
747
  defaultWidth: "wide"
748
748
  }),
749
749
  quarter: H({
750
- values: Ar,
750
+ values: Lr,
751
751
  defaultWidth: "wide",
752
752
  argumentCallback: (e) => e - 1
753
753
  }),
754
754
  month: H({
755
- values: Rr,
755
+ values: Wr,
756
756
  defaultWidth: "wide"
757
757
  }),
758
758
  day: H({
759
- values: Ur,
759
+ values: jr,
760
760
  defaultWidth: "wide"
761
761
  }),
762
762
  dayPeriod: H({
763
- values: Lr,
763
+ values: Hr,
764
764
  defaultWidth: "wide",
765
- formattingValues: Wr,
765
+ formattingValues: qr,
766
766
  defaultFormattingWidth: "wide"
767
767
  })
768
768
  };
@@ -771,9 +771,9 @@ function q(e) {
771
771
  const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], i = t.match(a);
772
772
  if (!i)
773
773
  return null;
774
- const o = i[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? Zr(s, (f) => f.test(o)) : (
774
+ const o = i[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? Br(s, (f) => f.test(o)) : (
775
775
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
776
- qr(s, (f) => f.test(o))
776
+ Vr(s, (f) => f.test(o))
777
777
  );
778
778
  let u;
779
779
  u = e.valueCallback ? e.valueCallback(c) : c, u = n.valueCallback ? (
@@ -784,17 +784,17 @@ function q(e) {
784
784
  return { value: u, rest: l };
785
785
  };
786
786
  }
787
- function qr(e, t) {
787
+ function Vr(e, t) {
788
788
  for (const n in e)
789
789
  if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
790
790
  return n;
791
791
  }
792
- function Zr(e, t) {
792
+ function Br(e, t) {
793
793
  for (let n = 0; n < e.length; n++)
794
794
  if (t(e[n]))
795
795
  return n;
796
796
  }
797
- function Xr(e) {
797
+ function Kr(e) {
798
798
  return (t, n = {}) => {
799
799
  const r = t.match(e.matchPattern);
800
800
  if (!r) return null;
@@ -806,23 +806,23 @@ function Xr(e) {
806
806
  return { value: o, rest: s };
807
807
  };
808
808
  }
809
- const Vr = /^(\d+)(th|st|nd|rd)?/i, Kr = /\d+/i, Br = {
809
+ const Gr = /^(\d+)(th|st|nd|rd)?/i, Qr = /\d+/i, Jr = {
810
810
  narrow: /^(b|a)/i,
811
811
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
812
812
  wide: /^(before christ|before common era|anno domini|common era)/i
813
- }, Gr = {
813
+ }, ea = {
814
814
  any: [/^b/i, /^(a|c)/i]
815
- }, Qr = {
815
+ }, ta = {
816
816
  narrow: /^[1234]/i,
817
817
  abbreviated: /^q[1234]/i,
818
818
  wide: /^[1234](th|st|nd|rd)? quarter/i
819
- }, Jr = {
819
+ }, na = {
820
820
  any: [/1/i, /2/i, /3/i, /4/i]
821
- }, ea = {
821
+ }, ra = {
822
822
  narrow: /^[jfmasond]/i,
823
823
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
824
824
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
825
- }, ta = {
825
+ }, aa = {
826
826
  narrow: [
827
827
  /^j/i,
828
828
  /^f/i,
@@ -851,18 +851,18 @@ const Vr = /^(\d+)(th|st|nd|rd)?/i, Kr = /\d+/i, Br = {
851
851
  /^n/i,
852
852
  /^d/i
853
853
  ]
854
- }, na = {
854
+ }, ia = {
855
855
  narrow: /^[smtwf]/i,
856
856
  short: /^(su|mo|tu|we|th|fr|sa)/i,
857
857
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
858
858
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
859
- }, ra = {
859
+ }, oa = {
860
860
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
861
861
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
862
- }, aa = {
862
+ }, sa = {
863
863
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
864
864
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
865
- }, ia = {
865
+ }, ca = {
866
866
  any: {
867
867
  am: /^a/i,
868
868
  pm: /^p/i,
@@ -873,80 +873,80 @@ const Vr = /^(\d+)(th|st|nd|rd)?/i, Kr = /\d+/i, Br = {
873
873
  evening: /evening/i,
874
874
  night: /night/i
875
875
  }
876
- }, oa = {
877
- ordinalNumber: Xr({
878
- matchPattern: Vr,
879
- parsePattern: Kr,
876
+ }, ua = {
877
+ ordinalNumber: Kr({
878
+ matchPattern: Gr,
879
+ parsePattern: Qr,
880
880
  valueCallback: (e) => parseInt(e, 10)
881
881
  }),
882
882
  era: q({
883
- matchPatterns: Br,
883
+ matchPatterns: Jr,
884
884
  defaultMatchWidth: "wide",
885
- parsePatterns: Gr,
885
+ parsePatterns: ea,
886
886
  defaultParseWidth: "any"
887
887
  }),
888
888
  quarter: q({
889
- matchPatterns: Qr,
889
+ matchPatterns: ta,
890
890
  defaultMatchWidth: "wide",
891
- parsePatterns: Jr,
891
+ parsePatterns: na,
892
892
  defaultParseWidth: "any",
893
893
  valueCallback: (e) => e + 1
894
894
  }),
895
895
  month: q({
896
- matchPatterns: ea,
896
+ matchPatterns: ra,
897
897
  defaultMatchWidth: "wide",
898
- parsePatterns: ta,
898
+ parsePatterns: aa,
899
899
  defaultParseWidth: "any"
900
900
  }),
901
901
  day: q({
902
- matchPatterns: na,
902
+ matchPatterns: ia,
903
903
  defaultMatchWidth: "wide",
904
- parsePatterns: ra,
904
+ parsePatterns: oa,
905
905
  defaultParseWidth: "any"
906
906
  }),
907
907
  dayPeriod: q({
908
- matchPatterns: aa,
908
+ matchPatterns: sa,
909
909
  defaultMatchWidth: "any",
910
- parsePatterns: ia,
910
+ parsePatterns: ca,
911
911
  defaultParseWidth: "any"
912
912
  })
913
- }, nn = {
913
+ }, on = {
914
914
  code: "en-US",
915
- formatDistance: Er,
916
- formatLong: Cr,
917
- formatRelative: Yr,
918
- localize: Hr,
919
- match: oa,
915
+ formatDistance: Fr,
916
+ formatLong: zr,
917
+ formatRelative: Rr,
918
+ localize: Xr,
919
+ match: ua,
920
920
  options: {
921
921
  weekStartsOn: 0,
922
922
  firstWeekContainsDate: 1
923
923
  }
924
924
  };
925
- function sa(e) {
926
- const t = p(e);
927
- return gr(t, Nr(t)) + 1;
925
+ function la(e) {
926
+ const t = w(e);
927
+ return pr(t, Ir(t)) + 1;
928
928
  }
929
- function ca(e) {
930
- const t = p(e), n = +ye(t) - +yr(t);
931
- return Math.round(n / Qt) + 1;
929
+ function ma(e) {
930
+ const t = w(e), n = +ye(t) - +Tr(t);
931
+ return Math.round(n / tn) + 1;
932
932
  }
933
- function rn(e, t) {
933
+ function sn(e, t) {
934
934
  var l, f, m, h;
935
- const n = p(e), r = n.getFullYear(), a = j(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (l = t == null ? void 0 : t.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((h = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, o = N(e, 0);
935
+ const n = w(e), r = n.getFullYear(), a = j(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (l = t == null ? void 0 : t.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((h = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, o = N(e, 0);
936
936
  o.setFullYear(r + 1, 0, i), o.setHours(0, 0, 0, 0);
937
- const s = K(o, t), c = N(e, 0);
937
+ const s = B(o, t), c = N(e, 0);
938
938
  c.setFullYear(r, 0, i), c.setHours(0, 0, 0, 0);
939
- const u = K(c, t);
939
+ const u = B(c, t);
940
940
  return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= u.getTime() ? r : r - 1;
941
941
  }
942
- function ua(e, t) {
942
+ function fa(e, t) {
943
943
  var s, c, u, l;
944
- const n = j(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = rn(e, t), i = N(e, 0);
945
- return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), K(i, t);
944
+ const n = j(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((l = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = sn(e, t), i = N(e, 0);
945
+ return i.setFullYear(a, 0, r), i.setHours(0, 0, 0, 0), B(i, t);
946
946
  }
947
- function la(e, t) {
948
- const n = p(e), r = +K(n, t) - +ua(n, t);
949
- return Math.round(r / Qt) + 1;
947
+ function da(e, t) {
948
+ const n = w(e), r = +B(n, t) - +fa(n, t);
949
+ return Math.round(r / tn) + 1;
950
950
  }
951
951
  function y(e, t) {
952
952
  const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
@@ -1013,7 +1013,7 @@ const k = {
1013
1013
  afternoon: "afternoon",
1014
1014
  evening: "evening",
1015
1015
  night: "night"
1016
- }, lt = {
1016
+ }, ft = {
1017
1017
  // Era
1018
1018
  G: function(e, t, n) {
1019
1019
  const r = e.getFullYear() > 0 ? 1 : 0;
@@ -1039,7 +1039,7 @@ const k = {
1039
1039
  },
1040
1040
  // Local week-numbering year
1041
1041
  Y: function(e, t, n, r) {
1042
- const a = rn(e, r), i = a > 0 ? a : 1 - a;
1042
+ const a = sn(e, r), i = a > 0 ? a : 1 - a;
1043
1043
  if (t === "YY") {
1044
1044
  const o = i % 100;
1045
1045
  return y(o, 2);
@@ -1048,7 +1048,7 @@ const k = {
1048
1048
  },
1049
1049
  // ISO week-numbering year
1050
1050
  R: function(e, t) {
1051
- const n = tn(e);
1051
+ const n = an(e);
1052
1052
  return y(n, t.length);
1053
1053
  },
1054
1054
  // Extended year. This is a single number designating the year of this calendar system.
@@ -1171,12 +1171,12 @@ const k = {
1171
1171
  },
1172
1172
  // Local week of year
1173
1173
  w: function(e, t, n, r) {
1174
- const a = la(e, r);
1174
+ const a = da(e, r);
1175
1175
  return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : y(a, t.length);
1176
1176
  },
1177
1177
  // ISO week of year
1178
1178
  I: function(e, t, n) {
1179
- const r = ca(e);
1179
+ const r = ma(e);
1180
1180
  return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : y(r, t.length);
1181
1181
  },
1182
1182
  // Day of the month
@@ -1185,7 +1185,7 @@ const k = {
1185
1185
  },
1186
1186
  // Day of year
1187
1187
  D: function(e, t, n) {
1188
- const r = sa(e);
1188
+ const r = la(e);
1189
1189
  return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : y(r, t.length);
1190
1190
  },
1191
1191
  // Day of week
@@ -1439,14 +1439,14 @@ const k = {
1439
1439
  return "Z";
1440
1440
  switch (t) {
1441
1441
  case "X":
1442
- return ft(r);
1442
+ return ht(r);
1443
1443
  case "XXXX":
1444
1444
  case "XX":
1445
- return O(r);
1445
+ return I(r);
1446
1446
  case "XXXXX":
1447
1447
  case "XXX":
1448
1448
  default:
1449
- return O(r, ":");
1449
+ return I(r, ":");
1450
1450
  }
1451
1451
  },
1452
1452
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
@@ -1454,14 +1454,14 @@ const k = {
1454
1454
  const r = e.getTimezoneOffset();
1455
1455
  switch (t) {
1456
1456
  case "x":
1457
- return ft(r);
1457
+ return ht(r);
1458
1458
  case "xxxx":
1459
1459
  case "xx":
1460
- return O(r);
1460
+ return I(r);
1461
1461
  case "xxxxx":
1462
1462
  case "xxx":
1463
1463
  default:
1464
- return O(r, ":");
1464
+ return I(r, ":");
1465
1465
  }
1466
1466
  },
1467
1467
  // Timezone (GMT)
@@ -1471,10 +1471,10 @@ const k = {
1471
1471
  case "O":
1472
1472
  case "OO":
1473
1473
  case "OOO":
1474
- return "GMT" + mt(r, ":");
1474
+ return "GMT" + dt(r, ":");
1475
1475
  case "OOOO":
1476
1476
  default:
1477
- return "GMT" + O(r, ":");
1477
+ return "GMT" + I(r, ":");
1478
1478
  }
1479
1479
  },
1480
1480
  // Timezone (specific non-location)
@@ -1484,10 +1484,10 @@ const k = {
1484
1484
  case "z":
1485
1485
  case "zz":
1486
1486
  case "zzz":
1487
- return "GMT" + mt(r, ":");
1487
+ return "GMT" + dt(r, ":");
1488
1488
  case "zzzz":
1489
1489
  default:
1490
- return "GMT" + O(r, ":");
1490
+ return "GMT" + I(r, ":");
1491
1491
  }
1492
1492
  },
1493
1493
  // Seconds timestamp
@@ -1501,18 +1501,18 @@ const k = {
1501
1501
  return y(r, t.length);
1502
1502
  }
1503
1503
  };
1504
- function mt(e, t = "") {
1504
+ function dt(e, t = "") {
1505
1505
  const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), i = r % 60;
1506
1506
  return i === 0 ? n + String(a) : n + String(a) + t + y(i, 2);
1507
1507
  }
1508
- function ft(e, t) {
1509
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + y(Math.abs(e) / 60, 2) : O(e, t);
1508
+ function ht(e, t) {
1509
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + y(Math.abs(e) / 60, 2) : I(e, t);
1510
1510
  }
1511
- function O(e, t = "") {
1511
+ function I(e, t = "") {
1512
1512
  const n = e > 0 ? "-" : "+", r = Math.abs(e), a = y(Math.trunc(r / 60), 2), i = y(r % 60, 2);
1513
1513
  return n + a + t + i;
1514
1514
  }
1515
- const dt = (e, t) => {
1515
+ const gt = (e, t) => {
1516
1516
  switch (e) {
1517
1517
  case "P":
1518
1518
  return t.date({ width: "short" });
@@ -1524,7 +1524,7 @@ const dt = (e, t) => {
1524
1524
  default:
1525
1525
  return t.date({ width: "full" });
1526
1526
  }
1527
- }, an = (e, t) => {
1527
+ }, cn = (e, t) => {
1528
1528
  switch (e) {
1529
1529
  case "p":
1530
1530
  return t.time({ width: "short" });
@@ -1536,10 +1536,10 @@ const dt = (e, t) => {
1536
1536
  default:
1537
1537
  return t.time({ width: "full" });
1538
1538
  }
1539
- }, ma = (e, t) => {
1539
+ }, ha = (e, t) => {
1540
1540
  const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1541
1541
  if (!a)
1542
- return dt(e, t);
1542
+ return gt(e, t);
1543
1543
  let i;
1544
1544
  switch (r) {
1545
1545
  case "P":
@@ -1556,49 +1556,49 @@ const dt = (e, t) => {
1556
1556
  i = t.dateTime({ width: "full" });
1557
1557
  break;
1558
1558
  }
1559
- return i.replace("{{date}}", dt(r, t)).replace("{{time}}", an(a, t));
1560
- }, fa = {
1561
- p: an,
1562
- P: ma
1563
- }, da = /^D+$/, ha = /^Y+$/, ga = ["D", "DD", "YY", "YYYY"];
1564
- function ya(e) {
1565
- return da.test(e);
1566
- }
1567
- function pa(e) {
1568
- return ha.test(e);
1569
- }
1570
- function wa(e, t, n) {
1571
- const r = Ta(e, t, n);
1572
- if (console.warn(r), ga.includes(e)) throw new RangeError(r);
1573
- }
1574
- function Ta(e, t, n) {
1559
+ return i.replace("{{date}}", gt(r, t)).replace("{{time}}", cn(a, t));
1560
+ }, ga = {
1561
+ p: cn,
1562
+ P: ha
1563
+ }, ya = /^D+$/, wa = /^Y+$/, pa = ["D", "DD", "YY", "YYYY"];
1564
+ function Ta(e) {
1565
+ return ya.test(e);
1566
+ }
1567
+ function xa(e) {
1568
+ return wa.test(e);
1569
+ }
1570
+ function Da(e, t, n) {
1571
+ const r = ba(e, t, n);
1572
+ if (console.warn(r), pa.includes(e)) throw new RangeError(r);
1573
+ }
1574
+ function ba(e, t, n) {
1575
1575
  const r = e[0] === "Y" ? "years" : "days of the month";
1576
1576
  return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1577
1577
  }
1578
- const Da = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, ba = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, xa = /^'([^]*?)'?$/, va = /''/g, Sa = /[a-zA-Z]/;
1579
- function Xe(e, t, n) {
1580
- var l, f, m, h, d, S, et, tt;
1581
- const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? nn, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((f = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, o = (n == null ? void 0 : n.weekStartsOn) ?? ((S = (d = n == null ? void 0 : n.locale) == null ? void 0 : d.options) == null ? void 0 : S.weekStartsOn) ?? r.weekStartsOn ?? ((tt = (et = r.locale) == null ? void 0 : et.options) == null ? void 0 : tt.weekStartsOn) ?? 0, s = p(e);
1582
- if (!Tr(s))
1578
+ const va = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Sa = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ma = /^'([^]*?)'?$/, ka = /''/g, _a = /[a-zA-Z]/;
1579
+ function Ve(e, t, n) {
1580
+ var l, f, m, h, d, S, tt, nt;
1581
+ const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? on, i = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((f = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : f.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, o = (n == null ? void 0 : n.weekStartsOn) ?? ((S = (d = n == null ? void 0 : n.locale) == null ? void 0 : d.options) == null ? void 0 : S.weekStartsOn) ?? r.weekStartsOn ?? ((nt = (tt = r.locale) == null ? void 0 : tt.options) == null ? void 0 : nt.weekStartsOn) ?? 0, s = w(e);
1582
+ if (!br(s))
1583
1583
  throw new RangeError("Invalid time value");
1584
- let c = t.match(ba).map((v) => {
1585
- const x = v[0];
1586
- if (x === "p" || x === "P") {
1587
- const Me = fa[x];
1588
- return Me(v, a.formatLong);
1584
+ let c = t.match(Sa).map((v) => {
1585
+ const b = v[0];
1586
+ if (b === "p" || b === "P") {
1587
+ const ke = ga[b];
1588
+ return ke(v, a.formatLong);
1589
1589
  }
1590
1590
  return v;
1591
- }).join("").match(Da).map((v) => {
1591
+ }).join("").match(va).map((v) => {
1592
1592
  if (v === "''")
1593
1593
  return { isToken: !1, value: "'" };
1594
- const x = v[0];
1595
- if (x === "'")
1596
- return { isToken: !1, value: Ma(v) };
1597
- if (lt[x])
1594
+ const b = v[0];
1595
+ if (b === "'")
1596
+ return { isToken: !1, value: Na(v) };
1597
+ if (ft[b])
1598
1598
  return { isToken: !0, value: v };
1599
- if (x.match(Sa))
1599
+ if (b.match(_a))
1600
1600
  throw new RangeError(
1601
- "Format string contains an unescaped latin alphabet character `" + x + "`"
1601
+ "Format string contains an unescaped latin alphabet character `" + b + "`"
1602
1602
  );
1603
1603
  return { isToken: !1, value: v };
1604
1604
  });
@@ -1610,18 +1610,18 @@ function Xe(e, t, n) {
1610
1610
  };
1611
1611
  return c.map((v) => {
1612
1612
  if (!v.isToken) return v.value;
1613
- const x = v.value;
1614
- (!(n != null && n.useAdditionalWeekYearTokens) && pa(x) || !(n != null && n.useAdditionalDayOfYearTokens) && ya(x)) && wa(x, t, String(e));
1615
- const Me = lt[x[0]];
1616
- return Me(s, x, a.localize, u);
1613
+ const b = v.value;
1614
+ (!(n != null && n.useAdditionalWeekYearTokens) && xa(b) || !(n != null && n.useAdditionalDayOfYearTokens) && Ta(b)) && Da(b, t, String(e));
1615
+ const ke = ft[b[0]];
1616
+ return ke(s, b, a.localize, u);
1617
1617
  }).join("");
1618
1618
  }
1619
- function Ma(e) {
1620
- const t = e.match(xa);
1621
- return t ? t[1].replace(va, "'") : e;
1619
+ function Na(e) {
1620
+ const t = e.match(Ma);
1621
+ return t ? t[1].replace(ka, "'") : e;
1622
1622
  }
1623
- function ka(e, t, n) {
1624
- const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? nn, i = 2520, o = ue(e, t);
1623
+ function $a(e, t, n) {
1624
+ const r = j(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? on, i = 2520, o = ue(e, t);
1625
1625
  if (isNaN(o))
1626
1626
  throw new RangeError("Invalid time value");
1627
1627
  const s = Object.assign({}, n, {
@@ -1629,8 +1629,8 @@ function ka(e, t, n) {
1629
1629
  comparison: o
1630
1630
  });
1631
1631
  let c, u;
1632
- o > 0 ? (c = p(t), u = p(e)) : (c = p(e), u = p(t));
1633
- const l = _r(u, c), f = (pe(u) - pe(c)) / 1e3, m = Math.round((l - f) / 60);
1632
+ o > 0 ? (c = w(t), u = w(e)) : (c = w(e), u = w(t));
1633
+ const l = Er(u, c), f = (we(u) - we(c)) / 1e3, m = Math.round((l - f) / 60);
1634
1634
  let h;
1635
1635
  if (m < 2)
1636
1636
  return n != null && n.includeSeconds ? l < 5 ? a.formatDistance("lessThanXSeconds", 5, s) : l < 10 ? a.formatDistance("lessThanXSeconds", 10, s) : l < 20 ? a.formatDistance("lessThanXSeconds", 20, s) : l < 40 ? a.formatDistance("halfAMinute", 0, s) : l < 60 ? a.formatDistance("lessThanXMinutes", 1, s) : a.formatDistance("xMinutes", 1, s) : m === 0 ? a.formatDistance("lessThanXMinutes", 1, s) : a.formatDistance("xMinutes", m, s);
@@ -1638,19 +1638,19 @@ function ka(e, t, n) {
1638
1638
  return a.formatDistance("xMinutes", m, s);
1639
1639
  if (m < 90)
1640
1640
  return a.formatDistance("aboutXHours", 1, s);
1641
- if (m < ct) {
1641
+ if (m < lt) {
1642
1642
  const d = Math.round(m / 60);
1643
1643
  return a.formatDistance("aboutXHours", d, s);
1644
1644
  } else {
1645
1645
  if (m < i)
1646
1646
  return a.formatDistance("xDays", 1, s);
1647
1647
  if (m < ie) {
1648
- const d = Math.round(m / ct);
1648
+ const d = Math.round(m / lt);
1649
1649
  return a.formatDistance("xDays", d, s);
1650
1650
  } else if (m < ie * 2)
1651
1651
  return h = Math.round(m / ie), a.formatDistance("aboutXMonths", h, s);
1652
1652
  }
1653
- if (h = kr(u, c), h < 12) {
1653
+ if (h = $r(u, c), h < 12) {
1654
1654
  const d = Math.round(m / ie);
1655
1655
  return a.formatDistance("xMonths", d, s);
1656
1656
  } else {
@@ -1658,27 +1658,27 @@ function ka(e, t, n) {
1658
1658
  return d < 3 ? a.formatDistance("aboutXYears", S, s) : d < 9 ? a.formatDistance("overXYears", S, s) : a.formatDistance("almostXYears", S + 1, s);
1659
1659
  }
1660
1660
  }
1661
- function _a(e, t) {
1662
- return ka(e, pr(e), t);
1661
+ function Ea(e, t) {
1662
+ return $a(e, xr(e), t);
1663
1663
  }
1664
- function Na() {
1664
+ function Ia() {
1665
1665
  return Object.assign({}, j());
1666
1666
  }
1667
- function $s(e, t) {
1668
- const r = Ia(e);
1667
+ function Is(e, t) {
1668
+ const r = Pa(e);
1669
1669
  let a;
1670
1670
  if (r.date) {
1671
- const c = Fa(r.date, 2);
1672
- a = Ca(c.restDateString, c.year);
1671
+ const c = Ya(r.date, 2);
1672
+ a = za(c.restDateString, c.year);
1673
1673
  }
1674
1674
  if (!a || isNaN(a.getTime()))
1675
1675
  return /* @__PURE__ */ new Date(NaN);
1676
1676
  const i = a.getTime();
1677
1677
  let o = 0, s;
1678
- if (r.time && (o = Pa(r.time), isNaN(o)))
1678
+ if (r.time && (o = Aa(r.time), isNaN(o)))
1679
1679
  return /* @__PURE__ */ new Date(NaN);
1680
1680
  if (r.timezone) {
1681
- if (s = Ya(r.timezone), isNaN(s))
1681
+ if (s = Ra(r.timezone), isNaN(s))
1682
1682
  return /* @__PURE__ */ new Date(NaN);
1683
1683
  } else {
1684
1684
  const c = new Date(i + o), u = /* @__PURE__ */ new Date(0);
@@ -1699,8 +1699,8 @@ const oe = {
1699
1699
  dateTimeDelimiter: /[T ]/,
1700
1700
  timeZoneDelimiter: /[Z ]/i,
1701
1701
  timezone: /([Z+-].*)$/
1702
- }, $a = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, Ea = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, Oa = /^([+-])(\d{2})(?::?(\d{2}))?$/;
1703
- function Ia(e) {
1702
+ }, Oa = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, Fa = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, Ca = /^([+-])(\d{2})(?::?(\d{2}))?$/;
1703
+ function Pa(e) {
1704
1704
  const t = {}, n = e.split(oe.dateTimeDelimiter);
1705
1705
  let r;
1706
1706
  if (n.length > 2)
@@ -1714,7 +1714,7 @@ function Ia(e) {
1714
1714
  }
1715
1715
  return t;
1716
1716
  }
1717
- function Fa(e, t) {
1717
+ function Ya(e, t) {
1718
1718
  const n = new RegExp(
1719
1719
  "^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|[+-]\\d{" + (2 + t) + "})$)"
1720
1720
  ), r = e.match(n);
@@ -1725,87 +1725,87 @@ function Fa(e, t) {
1725
1725
  restDateString: e.slice((r[1] || r[2]).length)
1726
1726
  };
1727
1727
  }
1728
- function Ca(e, t) {
1728
+ function za(e, t) {
1729
1729
  if (t === null) return /* @__PURE__ */ new Date(NaN);
1730
- const n = e.match($a);
1730
+ const n = e.match(Oa);
1731
1731
  if (!n) return /* @__PURE__ */ new Date(NaN);
1732
1732
  const r = !!n[4], a = Z(n[1]), i = Z(n[2]) - 1, o = Z(n[3]), s = Z(n[4]), c = Z(n[5]) - 1;
1733
1733
  if (r)
1734
- return La(t, s, c) ? za(t, s, c) : /* @__PURE__ */ new Date(NaN);
1734
+ return Ha(t, s, c) ? Ua(t, s, c) : /* @__PURE__ */ new Date(NaN);
1735
1735
  {
1736
1736
  const u = /* @__PURE__ */ new Date(0);
1737
- return !Ra(t, i, o) || !Ua(t, a) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(t, i, Math.max(a, o)), u);
1737
+ return !Wa(t, i, o) || !ja(t, a) ? /* @__PURE__ */ new Date(NaN) : (u.setUTCFullYear(t, i, Math.max(a, o)), u);
1738
1738
  }
1739
1739
  }
1740
1740
  function Z(e) {
1741
1741
  return e ? parseInt(e) : 1;
1742
1742
  }
1743
- function Pa(e) {
1744
- const t = e.match(Ea);
1743
+ function Aa(e) {
1744
+ const t = e.match(Fa);
1745
1745
  if (!t) return NaN;
1746
- const n = _e(t[1]), r = _e(t[2]), a = _e(t[3]);
1747
- return Wa(n, r, a) ? n * en + r * Jt + a * 1e3 : NaN;
1746
+ const n = Ne(t[1]), r = Ne(t[2]), a = Ne(t[3]);
1747
+ return qa(n, r, a) ? n * rn + r * nn + a * 1e3 : NaN;
1748
1748
  }
1749
- function _e(e) {
1749
+ function Ne(e) {
1750
1750
  return e && parseFloat(e.replace(",", ".")) || 0;
1751
1751
  }
1752
- function Ya(e) {
1752
+ function Ra(e) {
1753
1753
  if (e === "Z") return 0;
1754
- const t = e.match(Oa);
1754
+ const t = e.match(Ca);
1755
1755
  if (!t) return 0;
1756
1756
  const n = t[1] === "+" ? -1 : 1, r = parseInt(t[2]), a = t[3] && parseInt(t[3]) || 0;
1757
- return ja(r, a) ? n * (r * en + a * Jt) : NaN;
1757
+ return Za(r, a) ? n * (r * rn + a * nn) : NaN;
1758
1758
  }
1759
- function za(e, t, n) {
1759
+ function Ua(e, t, n) {
1760
1760
  const r = /* @__PURE__ */ new Date(0);
1761
1761
  r.setUTCFullYear(e, 0, 4);
1762
1762
  const a = r.getUTCDay() || 7, i = (t - 1) * 7 + n + 1 - a;
1763
1763
  return r.setUTCDate(r.getUTCDate() + i), r;
1764
1764
  }
1765
- const Aa = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1766
- function on(e) {
1765
+ const La = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1766
+ function un(e) {
1767
1767
  return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
1768
1768
  }
1769
- function Ra(e, t, n) {
1770
- return t >= 0 && t <= 11 && n >= 1 && n <= (Aa[t] || (on(e) ? 29 : 28));
1769
+ function Wa(e, t, n) {
1770
+ return t >= 0 && t <= 11 && n >= 1 && n <= (La[t] || (un(e) ? 29 : 28));
1771
1771
  }
1772
- function Ua(e, t) {
1773
- return t >= 1 && t <= (on(e) ? 366 : 365);
1772
+ function ja(e, t) {
1773
+ return t >= 1 && t <= (un(e) ? 366 : 365);
1774
1774
  }
1775
- function La(e, t, n) {
1775
+ function Ha(e, t, n) {
1776
1776
  return t >= 1 && t <= 53 && n >= 0 && n <= 6;
1777
1777
  }
1778
- function Wa(e, t, n) {
1778
+ function qa(e, t, n) {
1779
1779
  return e === 24 ? t === 0 && n === 0 : n >= 0 && n < 60 && t >= 0 && t < 60 && e >= 0 && e < 25;
1780
1780
  }
1781
- function ja(e, t) {
1781
+ function Za(e, t) {
1782
1782
  return t >= 0 && t <= 59;
1783
1783
  }
1784
- function ht(e, t, n) {
1785
- const r = Na(), a = Za(e, n.timeZone, n.locale ?? r.locale);
1786
- return "formatToParts" in a ? Ha(a, t) : qa(a, t);
1784
+ function yt(e, t, n) {
1785
+ const r = Ia(), a = Ba(e, n.timeZone, n.locale ?? r.locale);
1786
+ return "formatToParts" in a ? Xa(a, t) : Va(a, t);
1787
1787
  }
1788
- function Ha(e, t) {
1788
+ function Xa(e, t) {
1789
1789
  const n = e.formatToParts(t);
1790
1790
  for (let r = n.length - 1; r >= 0; --r)
1791
1791
  if (n[r].type === "timeZoneName")
1792
1792
  return n[r].value;
1793
1793
  }
1794
- function qa(e, t) {
1794
+ function Va(e, t) {
1795
1795
  const n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
1796
1796
  return r ? r[0].substr(1) : "";
1797
1797
  }
1798
- function Za(e, t, n) {
1798
+ function Ba(e, t, n) {
1799
1799
  return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
1800
1800
  timeZone: t,
1801
1801
  timeZoneName: e
1802
1802
  });
1803
1803
  }
1804
- function Xa(e, t) {
1805
- const n = Qa(t);
1806
- return "formatToParts" in n ? Ka(n, e) : Ba(n, e);
1804
+ function Ka(e, t) {
1805
+ const n = ti(t);
1806
+ return "formatToParts" in n ? Qa(n, e) : Ja(n, e);
1807
1807
  }
1808
- const Va = {
1808
+ const Ga = {
1809
1809
  year: 0,
1810
1810
  month: 1,
1811
1811
  day: 2,
@@ -1813,11 +1813,11 @@ const Va = {
1813
1813
  minute: 4,
1814
1814
  second: 5
1815
1815
  };
1816
- function Ka(e, t) {
1816
+ function Qa(e, t) {
1817
1817
  try {
1818
1818
  const n = e.formatToParts(t), r = [];
1819
1819
  for (let a = 0; a < n.length; a++) {
1820
- const i = Va[n[a].type];
1820
+ const i = Ga[n[a].type];
1821
1821
  i !== void 0 && (r[i] = parseInt(n[a].value, 10));
1822
1822
  }
1823
1823
  return r;
@@ -1827,7 +1827,7 @@ function Ka(e, t) {
1827
1827
  throw n;
1828
1828
  }
1829
1829
  }
1830
- function Ba(e, t) {
1830
+ function Ja(e, t) {
1831
1831
  const n = e.format(t), r = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);
1832
1832
  return [
1833
1833
  parseInt(r[3], 10),
@@ -1838,7 +1838,7 @@ function Ba(e, t) {
1838
1838
  parseInt(r[6], 10)
1839
1839
  ];
1840
1840
  }
1841
- const Ne = {}, gt = new Intl.DateTimeFormat("en-US", {
1841
+ const $e = {}, wt = new Intl.DateTimeFormat("en-US", {
1842
1842
  hourCycle: "h23",
1843
1843
  timeZone: "America/New_York",
1844
1844
  year: "numeric",
@@ -1847,9 +1847,9 @@ const Ne = {}, gt = new Intl.DateTimeFormat("en-US", {
1847
1847
  hour: "2-digit",
1848
1848
  minute: "2-digit",
1849
1849
  second: "2-digit"
1850
- }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), Ga = gt === "06/25/2014, 00:00:00" || gt === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
1851
- function Qa(e) {
1852
- return Ne[e] || (Ne[e] = Ga ? new Intl.DateTimeFormat("en-US", {
1850
+ }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), ei = wt === "06/25/2014, 00:00:00" || wt === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
1851
+ function ti(e) {
1852
+ return $e[e] || ($e[e] = ei ? new Intl.DateTimeFormat("en-US", {
1853
1853
  hourCycle: "h23",
1854
1854
  timeZone: e,
1855
1855
  year: "numeric",
@@ -1867,13 +1867,13 @@ function Qa(e) {
1867
1867
  hour: "2-digit",
1868
1868
  minute: "2-digit",
1869
1869
  second: "2-digit"
1870
- })), Ne[e];
1870
+ })), $e[e];
1871
1871
  }
1872
- function Ve(e, t, n, r, a, i, o) {
1872
+ function Be(e, t, n, r, a, i, o) {
1873
1873
  const s = /* @__PURE__ */ new Date(0);
1874
1874
  return s.setUTCFullYear(e, t, n), s.setUTCHours(r, a, i, o), s;
1875
1875
  }
1876
- const yt = 36e5, Ja = 6e4, $e = {
1876
+ const pt = 36e5, ni = 6e4, Ee = {
1877
1877
  timezoneZ: /^(Z)$/,
1878
1878
  timezoneHH: /^([+-]\d{2})$/,
1879
1879
  timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
@@ -1881,64 +1881,64 @@ const yt = 36e5, Ja = 6e4, $e = {
1881
1881
  function ve(e, t, n) {
1882
1882
  if (!e)
1883
1883
  return 0;
1884
- let r = $e.timezoneZ.exec(e);
1884
+ let r = Ee.timezoneZ.exec(e);
1885
1885
  if (r)
1886
1886
  return 0;
1887
1887
  let a, i;
1888
- if (r = $e.timezoneHH.exec(e), r)
1889
- return a = parseInt(r[1], 10), pt(a) ? -(a * yt) : NaN;
1890
- if (r = $e.timezoneHHMM.exec(e), r) {
1888
+ if (r = Ee.timezoneHH.exec(e), r)
1889
+ return a = parseInt(r[1], 10), Tt(a) ? -(a * pt) : NaN;
1890
+ if (r = Ee.timezoneHHMM.exec(e), r) {
1891
1891
  a = parseInt(r[2], 10);
1892
1892
  const o = parseInt(r[3], 10);
1893
- return pt(a, o) ? (i = Math.abs(a) * yt + o * Ja, r[1] === "+" ? -i : i) : NaN;
1893
+ return Tt(a, o) ? (i = Math.abs(a) * pt + o * ni, r[1] === "+" ? -i : i) : NaN;
1894
1894
  }
1895
- if (ni(e)) {
1895
+ if (ii(e)) {
1896
1896
  t = new Date(t || Date.now());
1897
- const o = n ? t : ei(t), s = Le(o, e);
1898
- return -(n ? s : ti(t, s, e));
1897
+ const o = n ? t : ri(t), s = We(o, e);
1898
+ return -(n ? s : ai(t, s, e));
1899
1899
  }
1900
1900
  return NaN;
1901
1901
  }
1902
- function ei(e) {
1903
- return Ve(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
1902
+ function ri(e) {
1903
+ return Be(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
1904
1904
  }
1905
- function Le(e, t) {
1906
- const n = Xa(e, t), r = Ve(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
1905
+ function We(e, t) {
1906
+ const n = Ka(e, t), r = Be(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
1907
1907
  let a = e.getTime();
1908
1908
  const i = a % 1e3;
1909
1909
  return a -= i >= 0 ? i : 1e3 + i, r - a;
1910
1910
  }
1911
- function ti(e, t, n) {
1911
+ function ai(e, t, n) {
1912
1912
  let a = e.getTime() - t;
1913
- const i = Le(new Date(a), n);
1913
+ const i = We(new Date(a), n);
1914
1914
  if (t === i)
1915
1915
  return t;
1916
1916
  a -= i - t;
1917
- const o = Le(new Date(a), n);
1917
+ const o = We(new Date(a), n);
1918
1918
  return i === o ? i : Math.max(i, o);
1919
1919
  }
1920
- function pt(e, t) {
1920
+ function Tt(e, t) {
1921
1921
  return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
1922
1922
  }
1923
- const wt = {};
1924
- function ni(e) {
1925
- if (wt[e])
1923
+ const xt = {};
1924
+ function ii(e) {
1925
+ if (xt[e])
1926
1926
  return !0;
1927
1927
  try {
1928
- return new Intl.DateTimeFormat(void 0, { timeZone: e }), wt[e] = !0, !0;
1928
+ return new Intl.DateTimeFormat(void 0, { timeZone: e }), xt[e] = !0, !0;
1929
1929
  } catch {
1930
1930
  return !1;
1931
1931
  }
1932
1932
  }
1933
- const ri = 60 * 1e3, ai = {
1933
+ const oi = 60 * 1e3, si = {
1934
1934
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1935
1935
  X: function(e, t, n) {
1936
- const r = Ee(n.timeZone, e);
1936
+ const r = Ie(n.timeZone, e);
1937
1937
  if (r === 0)
1938
1938
  return "Z";
1939
1939
  switch (t) {
1940
1940
  case "X":
1941
- return Tt(r);
1941
+ return Dt(r);
1942
1942
  case "XXXX":
1943
1943
  case "XX":
1944
1944
  return C(r);
@@ -1950,10 +1950,10 @@ const ri = 60 * 1e3, ai = {
1950
1950
  },
1951
1951
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1952
1952
  x: function(e, t, n) {
1953
- const r = Ee(n.timeZone, e);
1953
+ const r = Ie(n.timeZone, e);
1954
1954
  switch (t) {
1955
1955
  case "x":
1956
- return Tt(r);
1956
+ return Dt(r);
1957
1957
  case "xxxx":
1958
1958
  case "xx":
1959
1959
  return C(r);
@@ -1965,12 +1965,12 @@ const ri = 60 * 1e3, ai = {
1965
1965
  },
1966
1966
  // Timezone (GMT)
1967
1967
  O: function(e, t, n) {
1968
- const r = Ee(n.timeZone, e);
1968
+ const r = Ie(n.timeZone, e);
1969
1969
  switch (t) {
1970
1970
  case "O":
1971
1971
  case "OO":
1972
1972
  case "OOO":
1973
- return "GMT" + ii(r, ":");
1973
+ return "GMT" + ci(r, ":");
1974
1974
  case "OOOO":
1975
1975
  default:
1976
1976
  return "GMT" + C(r, ":");
@@ -1982,20 +1982,20 @@ const ri = 60 * 1e3, ai = {
1982
1982
  case "z":
1983
1983
  case "zz":
1984
1984
  case "zzz":
1985
- return ht("short", e, n);
1985
+ return yt("short", e, n);
1986
1986
  case "zzzz":
1987
1987
  default:
1988
- return ht("long", e, n);
1988
+ return yt("long", e, n);
1989
1989
  }
1990
1990
  }
1991
1991
  };
1992
- function Ee(e, t) {
1993
- const n = e ? ve(e, t, !0) / ri : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
1992
+ function Ie(e, t) {
1993
+ const n = e ? ve(e, t, !0) / oi : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
1994
1994
  if (Number.isNaN(n))
1995
1995
  throw new RangeError("Invalid time zone specified: " + e);
1996
1996
  return n;
1997
1997
  }
1998
- function we(e, t) {
1998
+ function pe(e, t) {
1999
1999
  const n = e < 0 ? "-" : "";
2000
2000
  let r = Math.abs(e).toString();
2001
2001
  for (; r.length < t; )
@@ -2003,21 +2003,21 @@ function we(e, t) {
2003
2003
  return n + r;
2004
2004
  }
2005
2005
  function C(e, t = "") {
2006
- const n = e > 0 ? "-" : "+", r = Math.abs(e), a = we(Math.floor(r / 60), 2), i = we(Math.floor(r % 60), 2);
2006
+ const n = e > 0 ? "-" : "+", r = Math.abs(e), a = pe(Math.floor(r / 60), 2), i = pe(Math.floor(r % 60), 2);
2007
2007
  return n + a + t + i;
2008
2008
  }
2009
- function Tt(e, t) {
2010
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + we(Math.abs(e) / 60, 2) : C(e, t);
2009
+ function Dt(e, t) {
2010
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + pe(Math.abs(e) / 60, 2) : C(e, t);
2011
2011
  }
2012
- function ii(e, t = "") {
2012
+ function ci(e, t = "") {
2013
2013
  const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60), i = r % 60;
2014
- return i === 0 ? n + String(a) : n + String(a) + t + we(i, 2);
2014
+ return i === 0 ? n + String(a) : n + String(a) + t + pe(i, 2);
2015
2015
  }
2016
- function Dt(e) {
2016
+ function bt(e) {
2017
2017
  const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
2018
2018
  return t.setUTCFullYear(e.getFullYear()), +e - +t;
2019
2019
  }
2020
- const sn = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Oe = 36e5, bt = 6e4, oi = 2, b = {
2020
+ const ln = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, Oe = 36e5, vt = 6e4, ui = 2, D = {
2021
2021
  dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
2022
2022
  datePattern: /^([0-9W+-]+)(.*)/,
2023
2023
  // year tokens
@@ -2049,14 +2049,14 @@ const sn = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)
2049
2049
  HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
2050
2050
  HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
2051
2051
  // time zone tokens (to identify the presence of a tz)
2052
- timeZone: sn
2052
+ timeZone: ln
2053
2053
  };
2054
2054
  function Te(e, t = {}) {
2055
2055
  if (arguments.length < 1)
2056
2056
  throw new TypeError("1 argument required, but only " + arguments.length + " present");
2057
2057
  if (e === null)
2058
2058
  return /* @__PURE__ */ new Date(NaN);
2059
- const n = t.additionalDigits == null ? oi : Number(t.additionalDigits);
2059
+ const n = t.additionalDigits == null ? ui : Number(t.additionalDigits);
2060
2060
  if (n !== 2 && n !== 1 && n !== 0)
2061
2061
  throw new RangeError("additionalDigits must be 0, 1 or 2");
2062
2062
  if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
@@ -2065,36 +2065,36 @@ function Te(e, t = {}) {
2065
2065
  return new Date(e);
2066
2066
  if (Object.prototype.toString.call(e) !== "[object String]")
2067
2067
  return /* @__PURE__ */ new Date(NaN);
2068
- const r = si(e), { year: a, restDateString: i } = ci(r.date, n), o = ui(i, a);
2068
+ const r = li(e), { year: a, restDateString: i } = mi(r.date, n), o = fi(i, a);
2069
2069
  if (o === null || isNaN(o.getTime()))
2070
2070
  return /* @__PURE__ */ new Date(NaN);
2071
2071
  if (o) {
2072
2072
  const s = o.getTime();
2073
2073
  let c = 0, u;
2074
- if (r.time && (c = li(r.time), c === null || isNaN(c)))
2074
+ if (r.time && (c = di(r.time), c === null || isNaN(c)))
2075
2075
  return /* @__PURE__ */ new Date(NaN);
2076
2076
  if (r.timeZone || t.timeZone) {
2077
2077
  if (u = ve(r.timeZone || t.timeZone, new Date(s + c)), isNaN(u))
2078
2078
  return /* @__PURE__ */ new Date(NaN);
2079
2079
  } else
2080
- u = Dt(new Date(s + c)), u = Dt(new Date(s + c + u));
2080
+ u = bt(new Date(s + c)), u = bt(new Date(s + c + u));
2081
2081
  return new Date(s + c + u);
2082
2082
  } else
2083
2083
  return /* @__PURE__ */ new Date(NaN);
2084
2084
  }
2085
- function si(e) {
2085
+ function li(e) {
2086
2086
  const t = {};
2087
- let n = b.dateTimePattern.exec(e), r;
2088
- if (n ? (t.date = n[1], r = n[3]) : (n = b.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
2089
- const a = b.timeZone.exec(r);
2087
+ let n = D.dateTimePattern.exec(e), r;
2088
+ if (n ? (t.date = n[1], r = n[3]) : (n = D.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
2089
+ const a = D.timeZone.exec(r);
2090
2090
  a ? (t.time = r.replace(a[1], ""), t.timeZone = a[1].trim()) : t.time = r;
2091
2091
  }
2092
2092
  return t;
2093
2093
  }
2094
- function ci(e, t) {
2094
+ function mi(e, t) {
2095
2095
  if (e) {
2096
- const n = b.YYY[t], r = b.YYYYY[t];
2097
- let a = b.YYYY.exec(e) || r.exec(e);
2096
+ const n = D.YYY[t], r = D.YYYYY[t];
2097
+ let a = D.YYYY.exec(e) || r.exec(e);
2098
2098
  if (a) {
2099
2099
  const i = a[1];
2100
2100
  return {
@@ -2102,7 +2102,7 @@ function ci(e, t) {
2102
2102
  restDateString: e.slice(i.length)
2103
2103
  };
2104
2104
  }
2105
- if (a = b.YY.exec(e) || n.exec(e), a) {
2105
+ if (a = D.YY.exec(e) || n.exec(e), a) {
2106
2106
  const i = a[1];
2107
2107
  return {
2108
2108
  year: parseInt(i, 10) * 100,
@@ -2114,120 +2114,120 @@ function ci(e, t) {
2114
2114
  year: null
2115
2115
  };
2116
2116
  }
2117
- function ui(e, t) {
2117
+ function fi(e, t) {
2118
2118
  if (t === null)
2119
2119
  return null;
2120
2120
  let n, r, a;
2121
2121
  if (!e || !e.length)
2122
2122
  return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
2123
- let i = b.MM.exec(e);
2123
+ let i = D.MM.exec(e);
2124
2124
  if (i)
2125
- return n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1, vt(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
2126
- if (i = b.DDD.exec(e), i) {
2125
+ return n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1, Mt(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
2126
+ if (i = D.DDD.exec(e), i) {
2127
2127
  n = /* @__PURE__ */ new Date(0);
2128
2128
  const o = parseInt(i[1], 10);
2129
- return di(t, o) ? (n.setUTCFullYear(t, 0, o), n) : /* @__PURE__ */ new Date(NaN);
2129
+ return yi(t, o) ? (n.setUTCFullYear(t, 0, o), n) : /* @__PURE__ */ new Date(NaN);
2130
2130
  }
2131
- if (i = b.MMDD.exec(e), i) {
2131
+ if (i = D.MMDD.exec(e), i) {
2132
2132
  n = /* @__PURE__ */ new Date(0), r = parseInt(i[1], 10) - 1;
2133
2133
  const o = parseInt(i[2], 10);
2134
- return vt(t, r, o) ? (n.setUTCFullYear(t, r, o), n) : /* @__PURE__ */ new Date(NaN);
2134
+ return Mt(t, r, o) ? (n.setUTCFullYear(t, r, o), n) : /* @__PURE__ */ new Date(NaN);
2135
2135
  }
2136
- if (i = b.Www.exec(e), i)
2137
- return a = parseInt(i[1], 10) - 1, St(a) ? xt(t, a) : /* @__PURE__ */ new Date(NaN);
2138
- if (i = b.WwwD.exec(e), i) {
2136
+ if (i = D.Www.exec(e), i)
2137
+ return a = parseInt(i[1], 10) - 1, kt(a) ? St(t, a) : /* @__PURE__ */ new Date(NaN);
2138
+ if (i = D.WwwD.exec(e), i) {
2139
2139
  a = parseInt(i[1], 10) - 1;
2140
2140
  const o = parseInt(i[2], 10) - 1;
2141
- return St(a, o) ? xt(t, a, o) : /* @__PURE__ */ new Date(NaN);
2141
+ return kt(a, o) ? St(t, a, o) : /* @__PURE__ */ new Date(NaN);
2142
2142
  }
2143
2143
  return null;
2144
2144
  }
2145
- function li(e) {
2146
- let t, n, r = b.HH.exec(e);
2145
+ function di(e) {
2146
+ let t, n, r = D.HH.exec(e);
2147
2147
  if (r)
2148
- return t = parseFloat(r[1].replace(",", ".")), Ie(t) ? t % 24 * Oe : NaN;
2149
- if (r = b.HHMM.exec(e), r)
2150
- return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Ie(t, n) ? t % 24 * Oe + n * bt : NaN;
2151
- if (r = b.HHMMSS.exec(e), r) {
2148
+ return t = parseFloat(r[1].replace(",", ".")), Fe(t) ? t % 24 * Oe : NaN;
2149
+ if (r = D.HHMM.exec(e), r)
2150
+ return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), Fe(t, n) ? t % 24 * Oe + n * vt : NaN;
2151
+ if (r = D.HHMMSS.exec(e), r) {
2152
2152
  t = parseInt(r[1], 10), n = parseInt(r[2], 10);
2153
2153
  const a = parseFloat(r[3].replace(",", "."));
2154
- return Ie(t, n, a) ? t % 24 * Oe + n * bt + a * 1e3 : NaN;
2154
+ return Fe(t, n, a) ? t % 24 * Oe + n * vt + a * 1e3 : NaN;
2155
2155
  }
2156
2156
  return null;
2157
2157
  }
2158
- function xt(e, t, n) {
2158
+ function St(e, t, n) {
2159
2159
  t = t || 0, n = n || 0;
2160
2160
  const r = /* @__PURE__ */ new Date(0);
2161
2161
  r.setUTCFullYear(e, 0, 4);
2162
2162
  const a = r.getUTCDay() || 7, i = t * 7 + n + 1 - a;
2163
2163
  return r.setUTCDate(r.getUTCDate() + i), r;
2164
2164
  }
2165
- const mi = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], fi = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2166
- function cn(e) {
2165
+ const hi = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], gi = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
2166
+ function mn(e) {
2167
2167
  return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
2168
2168
  }
2169
- function vt(e, t, n) {
2169
+ function Mt(e, t, n) {
2170
2170
  if (t < 0 || t > 11)
2171
2171
  return !1;
2172
2172
  if (n != null) {
2173
2173
  if (n < 1)
2174
2174
  return !1;
2175
- const r = cn(e);
2176
- if (r && n > fi[t] || !r && n > mi[t])
2175
+ const r = mn(e);
2176
+ if (r && n > gi[t] || !r && n > hi[t])
2177
2177
  return !1;
2178
2178
  }
2179
2179
  return !0;
2180
2180
  }
2181
- function di(e, t) {
2181
+ function yi(e, t) {
2182
2182
  if (t < 1)
2183
2183
  return !1;
2184
- const n = cn(e);
2184
+ const n = mn(e);
2185
2185
  return !(n && t > 366 || !n && t > 365);
2186
2186
  }
2187
- function St(e, t) {
2187
+ function kt(e, t) {
2188
2188
  return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
2189
2189
  }
2190
- function Ie(e, t, n) {
2190
+ function Fe(e, t, n) {
2191
2191
  return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || n != null && (n < 0 || n >= 60));
2192
2192
  }
2193
- const hi = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
2194
- function gi(e, t, n = {}) {
2193
+ const wi = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
2194
+ function pi(e, t, n = {}) {
2195
2195
  t = String(t);
2196
- const r = t.match(hi);
2196
+ const r = t.match(wi);
2197
2197
  if (r) {
2198
2198
  const a = Te(n.originalDate || e, n);
2199
2199
  t = r.reduce(function(i, o) {
2200
2200
  if (o[0] === "'")
2201
2201
  return i;
2202
- const s = i.indexOf(o), c = i[s - 1] === "'", u = i.replace(o, "'" + ai[o[0]](a, o, n) + "'");
2202
+ const s = i.indexOf(o), c = i[s - 1] === "'", u = i.replace(o, "'" + si[o[0]](a, o, n) + "'");
2203
2203
  return c ? u.substring(0, s - 1) + u.substring(s + 1) : u;
2204
2204
  }, t);
2205
2205
  }
2206
- return Xe(e, t, n);
2206
+ return Ve(e, t, n);
2207
2207
  }
2208
- function yi(e, t, n) {
2208
+ function Ti(e, t, n) {
2209
2209
  e = Te(e, n);
2210
2210
  const r = ve(t, e, !0), a = new Date(e.getTime() - r), i = /* @__PURE__ */ new Date(0);
2211
2211
  return i.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), i.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), i;
2212
2212
  }
2213
- function un(e, t, n, r) {
2213
+ function fn(e, t, n, r) {
2214
2214
  return r = {
2215
2215
  ...r,
2216
2216
  timeZone: t,
2217
2217
  originalDate: e
2218
- }, gi(yi(e, t, { timeZone: r.timeZone }), n, r);
2218
+ }, pi(Ti(e, t, { timeZone: r.timeZone }), n, r);
2219
2219
  }
2220
2220
  function te(e, t, n) {
2221
- if (typeof e == "string" && !e.match(sn))
2221
+ if (typeof e == "string" && !e.match(ln))
2222
2222
  return Te(e, { ...n, timeZone: t });
2223
2223
  e = Te(e, n);
2224
- const r = Ve(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), a = ve(t, new Date(r));
2224
+ const r = Be(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), a = ve(t, new Date(r));
2225
2225
  return new Date(r + a);
2226
2226
  }
2227
- function Es(e, t) {
2227
+ function Os(e, t) {
2228
2228
  return e && e !== "auto" ? e : t;
2229
2229
  }
2230
- function Os(e, t = /* @__PURE__ */ new Date()) {
2230
+ function Fs(e, t = /* @__PURE__ */ new Date()) {
2231
2231
  try {
2232
2232
  const n = {
2233
2233
  timeZone: e,
@@ -2238,7 +2238,7 @@ function Os(e, t = /* @__PURE__ */ new Date()) {
2238
2238
  return e;
2239
2239
  }
2240
2240
  }
2241
- function Is(e) {
2241
+ function Cs(e) {
2242
2242
  try {
2243
2243
  const t = {
2244
2244
  timeZone: e,
@@ -2265,71 +2265,71 @@ function Ke(e, t = "auto") {
2265
2265
  return new Date(e);
2266
2266
  } else return t === "UTC" ? n ? new Date(e) : r ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || r || a ? new Date(e) : te(e, t);
2267
2267
  }
2268
- const pi = "MM/dd/yyyy", wi = (e, t, n, r = "auto") => {
2268
+ const xi = "MM/dd/yyyy", Di = (e, t, n, r = "auto") => {
2269
2269
  if (!e)
2270
2270
  return "";
2271
2271
  try {
2272
2272
  const a = Ke(e, r);
2273
2273
  if (isNaN(a.getTime()))
2274
2274
  return e;
2275
- const o = (t && t.trim() ? t : pi).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
2276
- return n && n !== "auto" ? un(a, n, o) : Xe(a, o);
2275
+ const o = (t && t.trim() ? t : xi).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
2276
+ return n && n !== "auto" ? fn(a, n, o) : Ve(a, o);
2277
2277
  } catch (a) {
2278
2278
  return console.error("Date formatting error:", a), e;
2279
2279
  }
2280
2280
  };
2281
- function Fs(e, t, n = "auto") {
2281
+ function Ps(e, t, n = "auto") {
2282
2282
  if (e)
2283
2283
  try {
2284
2284
  const r = Ke(e, n);
2285
2285
  if (isNaN(r.getTime())) return;
2286
- const a = "yyyy M d H m s", i = t && t !== "auto" ? un(r, t, a) : Xe(r, a), [o, s, c, u, l, f] = i.split(" ").map(Number);
2286
+ const a = "yyyy M d H m s", i = t && t !== "auto" ? fn(r, t, a) : Ve(r, a), [o, s, c, u, l, f] = i.split(" ").map(Number);
2287
2287
  return { year: o, month: s, day: c, hour: u, minute: l, second: f };
2288
2288
  } catch {
2289
2289
  return;
2290
2290
  }
2291
2291
  }
2292
- const Ti = (e, t = "auto") => {
2292
+ const bi = (e, t = "auto") => {
2293
2293
  if (!e)
2294
2294
  return "";
2295
2295
  try {
2296
2296
  const n = Ke(e, t);
2297
- return isNaN(n.getTime()) ? e : _a(n, { addSuffix: !0 });
2297
+ return isNaN(n.getTime()) ? e : Ea(n, { addSuffix: !0 });
2298
2298
  } catch (n) {
2299
2299
  return console.error("Relative time formatting error:", n), e;
2300
2300
  }
2301
2301
  };
2302
- function Di(e, t, n, r) {
2302
+ function vi(e, t, n, r) {
2303
2303
  const a = e instanceof Date ? e.toISOString() : String(e), i = (r == null ? void 0 : r.browserTimezone) || n, o = (r == null ? void 0 : r.isSqlCard) ?? !1;
2304
2304
  if (t != null && t.useRelativeTime)
2305
- return Ti(
2305
+ return bi(
2306
2306
  a,
2307
2307
  (t == null ? void 0 : t.sourceTimezone) || "auto"
2308
2308
  );
2309
2309
  const s = t != null && t.useCustomFormat && (t != null && t.customFormat) ? t.customFormat : (t == null ? void 0 : t.format) || "MM/dd/yyyy";
2310
- return wi(
2310
+ return Di(
2311
2311
  a,
2312
2312
  s,
2313
2313
  t != null && t.timezone && (t == null ? void 0 : t.timezone) !== "auto" ? t.timezone : o ? i : n,
2314
2314
  (t == null ? void 0 : t.sourceTimezone) || "auto"
2315
2315
  );
2316
2316
  }
2317
- function ln(e, t, n) {
2317
+ function dn(e, t, n) {
2318
2318
  var o, s;
2319
2319
  if (e == null)
2320
2320
  return e === null ? ((o = n.absence) == null ? void 0 : o.nullText) ?? "" : ((s = n.absence) == null ? void 0 : s.emptyText) ?? "";
2321
- const r = zn(e) ? e : void 0, a = r ? r.value : e, i = r ?? (typeof e == "number" ? e : void 0);
2321
+ const r = Rn(e) ? e : void 0, a = r ? r.value : e, i = r ?? (typeof e == "number" ? e : void 0);
2322
2322
  if (!n.useFormattedValues || !t)
2323
2323
  return String(a);
2324
2324
  switch (t.type) {
2325
2325
  case "number":
2326
- return i !== void 0 ? fr(
2326
+ return i !== void 0 ? gr(
2327
2327
  i,
2328
2328
  t.numberFormat,
2329
2329
  n.locale
2330
2330
  ) : String(a);
2331
2331
  case "date":
2332
- return Di(
2332
+ return vi(
2333
2333
  a,
2334
2334
  t.dateFormat,
2335
2335
  n.timezone,
@@ -2348,60 +2348,60 @@ function ln(e, t, n) {
2348
2348
  return String(a);
2349
2349
  }
2350
2350
  }
2351
- function Cs(e, t) {
2351
+ function Ys(e, t) {
2352
2352
  return t.visibleColumns.map((n) => {
2353
2353
  const r = e[n], a = t.columnSettings[n];
2354
- return ln(r, a, {
2354
+ return dn(r, a, {
2355
2355
  useFormattedValues: t.useFormattedValues,
2356
2356
  timezone: t.timezone,
2357
2357
  locale: t.locale
2358
2358
  });
2359
2359
  });
2360
2360
  }
2361
- const mn = 1e4, bi = 1e6, Ps = 5e6, Ys = 1024 ** 3, zs = 1024 ** 3;
2362
- function As(e) {
2363
- return e > mn;
2361
+ const hn = 1e4, Si = 1e6, zs = 5e6, As = 1024 ** 3, Rs = 1024 ** 3;
2362
+ function Us(e) {
2363
+ return e > hn;
2364
2364
  }
2365
- function Rs(e) {
2366
- return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= mn ? "direct" : e.loadedRowCount <= bi ? "background" : "blocked";
2365
+ function Ls(e) {
2366
+ return e.cardType === "matrixTable" ? "try-direct" : e.loadedRowCount === null || e.loadedRowCount <= hn ? "direct" : e.loadedRowCount <= Si ? "background" : "blocked";
2367
2367
  }
2368
- const xi = 5 * 1024 * 1024, Us = 64 * 1024 * 1024, De = w.number().int().positive().max(Number.MAX_SAFE_INTEGER), le = w.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER), be = le.refine((e) => e > 0), vi = (e) => !!e && e !== "." && e !== ".." && !e.includes("/") && !e.includes("\\");
2368
+ const Mi = 5 * 1024 * 1024, Ws = 64 * 1024 * 1024, xe = p.number().int().positive().max(Number.MAX_SAFE_INTEGER), le = p.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER), De = le.refine((e) => e > 0), ki = (e) => !!e && e !== "." && e !== ".." && !e.includes("/") && !e.includes("\\");
2369
2369
  function P(e, t) {
2370
2370
  const n = t.split("/");
2371
- if (n.length !== 5 || n[0] !== "exports" || n[1] !== e || n[2] !== "attempts" || !n.every(vi))
2371
+ if (n.length !== 5 || n[0] !== "exports" || n[1] !== e || n[2] !== "attempts" || !n.every(ki))
2372
2372
  throw new Error("Invalid Matrix export artifact namespace.");
2373
2373
  return { attemptId: n[3], filename: n[4] };
2374
2374
  }
2375
- function Ls(e, t, n) {
2375
+ function js(e, t, n) {
2376
2376
  const r = `exports/${e}/attempts/${t}/${n}`;
2377
2377
  return P(e, r), r;
2378
2378
  }
2379
- const Ws = w.object({
2380
- acquisition: w.literal("continuation"),
2381
- jobId: w.string().min(1),
2382
- sequence: be,
2383
- deadlineAt: De
2384
- }), Si = [
2379
+ const Hs = p.object({
2380
+ acquisition: p.literal("continuation"),
2381
+ jobId: p.string().min(1),
2382
+ sequence: De,
2383
+ deadlineAt: xe
2384
+ }), _i = [
2385
2385
  "application/json",
2386
- ...Ut.map((e) => Lt(e).partContentType)
2387
- ], Mi = w.object({
2388
- key: w.string(),
2389
- content: w.string(),
2390
- contentType: w.enum(Si),
2391
- encoding: w.literal("gzip-base64").optional()
2386
+ ...Wt.map((e) => jt(e).partContentType)
2387
+ ], Ni = p.object({
2388
+ key: p.string(),
2389
+ content: p.string(),
2390
+ contentType: p.enum(_i),
2391
+ encoding: p.literal("gzip-base64").optional()
2392
2392
  // Transport-only compression: JSON (layout, sheet layout) and Excel rows. CSV travels as it always has.
2393
- }).refine((e) => !e.encoding || e.contentType === "application/json" || e.contentType === Lt("xlsx").partContentType, "Unsupported Matrix artifact encoding."), ki = w.discriminatedUnion("kind", [
2394
- w.object({ kind: w.literal("work"), sequence: be, checkpointKey: w.string(), objects: w.array(Mi).min(2).max(4), deadlineAt: De }),
2395
- w.object({ kind: w.literal("committed"), sequence: be, done: w.boolean(), deadlineAt: De })
2393
+ }).refine((e) => !e.encoding || e.contentType === "application/json" || e.contentType === jt("xlsx").partContentType, "Unsupported Matrix artifact encoding."), $i = p.discriminatedUnion("kind", [
2394
+ p.object({ kind: p.literal("work"), sequence: De, checkpointKey: p.string(), objects: p.array(Ni).min(2).max(4), deadlineAt: xe }),
2395
+ p.object({ kind: p.literal("committed"), sequence: De, done: p.boolean(), deadlineAt: xe })
2396
2396
  ]);
2397
- function _i(e) {
2397
+ function Ei(e) {
2398
2398
  const t = JSON.stringify(e);
2399
- if (t === void 0 || new TextEncoder().encode(t).byteLength > xi)
2399
+ if (t === void 0 || new TextEncoder().encode(t).byteLength > Mi)
2400
2400
  throw new RangeError("Matrix export batch exceeds its transport byte limit.");
2401
2401
  }
2402
- function js(e, t) {
2403
- const n = ki.parse(e);
2404
- if (_i(e), n.deadlineAt !== t.deadlineAt) throw new Error("Matrix deadline does not match the job.");
2402
+ function qs(e, t) {
2403
+ const n = $i.parse(e);
2404
+ if (Ei(e), n.deadlineAt !== t.deadlineAt) throw new Error("Matrix deadline does not match the job.");
2405
2405
  if (n.sequence !== t.sequence + (n.kind === "committed" ? 1 : 0))
2406
2406
  throw new Error("Invalid Matrix batch sequence.");
2407
2407
  if (n.kind === "work") {
@@ -2411,44 +2411,29 @@ function js(e, t) {
2411
2411
  }
2412
2412
  return n;
2413
2413
  }
2414
- const Ni = w.object({
2415
- acquisition: w.literal("continuation"),
2416
- deadlineAt: De,
2417
- chunks: w.array(w.object({ chunkNumber: be, dataKey: w.string() })).min(1),
2414
+ const Ii = p.object({
2415
+ acquisition: p.literal("continuation"),
2416
+ deadlineAt: xe,
2417
+ chunks: p.array(p.object({ chunkNumber: De, dataKey: p.string() })).min(1),
2418
2418
  totalRows: le,
2419
2419
  totalBytes: le,
2420
- fileKey: w.string().min(1).optional(),
2420
+ fileKey: p.string().min(1).optional(),
2421
2421
  fileSize: le.optional(),
2422
2422
  /** The file the job writes; absent means CSV (manifests from before Excel). */
2423
- format: w.enum(Ut).optional(),
2423
+ format: p.enum(Wt).optional(),
2424
2424
  /** Excel only: the sheet layout the layout batch stored, which compaction wraps the rows in. */
2425
- sheetKey: w.string().min(1).optional()
2425
+ sheetKey: p.string().min(1).optional()
2426
2426
  }).refine((e) => e.fileKey === void 0 == (e.fileSize === void 0), "Incomplete published Matrix artifact.").refine((e) => e.format === "xlsx" == (e.sheetKey !== void 0), "An Excel Matrix manifest names its sheet layout, and only it does.");
2427
- function Hs(e, t, n) {
2428
- const r = Ni.parse(e);
2427
+ function Zs(e, t, n) {
2428
+ const r = Ii.parse(e);
2429
2429
  if (r.deadlineAt !== n) throw new Error("Matrix deadline does not match the job.");
2430
2430
  return r.chunks.forEach((a, i) => {
2431
2431
  if (a.chunkNumber !== i + 1) throw new Error("Invalid committed Matrix chunk order.");
2432
2432
  P(t, a.dataKey);
2433
2433
  }), r.fileKey !== void 0 && P(t, r.fileKey), r.sheetKey !== void 0 && P(t, r.sheetKey), r;
2434
2434
  }
2435
- const $i = "en-US", Mt = [
2436
- "compact",
2437
- "maximumFractionDigits",
2438
- "minimumFractionDigits",
2439
- "negativeStyle",
2440
- "type",
2441
- "useGrouping"
2442
- ];
2443
- function Ei(e) {
2444
- if (e.type !== "currency" || Object.prototype.hasOwnProperty.call(e, "currency") || Object.prototype.hasOwnProperty.call(e, "locale"))
2445
- return !1;
2446
- const t = Object.keys(e).sort();
2447
- return t.length === Mt.length && Mt.every(
2448
- (n, r) => t[r] === n
2449
- ) && typeof e.minimumFractionDigits == "number" && typeof e.maximumFractionDigits == "number" && e.useGrouping === !0 && e.negativeStyle === "minus" && typeof e.compact == "boolean";
2450
- }
2451
- function kt(e) {
2435
+ const Oi = "en-US";
2436
+ function _t(e) {
2452
2437
  if (typeof e != "string")
2453
2438
  return;
2454
2439
  const t = e.trim();
@@ -2459,10 +2444,10 @@ function me(e) {
2459
2444
  if (!(typeof e != "number" || !Number.isFinite(e)))
2460
2445
  return Math.max(0, Math.min(10, Math.trunc(e)));
2461
2446
  }
2462
- function Oi(e) {
2447
+ function Fi(e) {
2463
2448
  return e === "currency" ? 2 : e === "percent" ? 1 : e === "scientific" ? 2 : 0;
2464
2449
  }
2465
- function Ii(e, t, n) {
2450
+ function Ci(e, t, n) {
2466
2451
  const r = me(t.minimumFractionDigits), a = me(t.maximumFractionDigits);
2467
2452
  if (typeof r == "number" || typeof a == "number") {
2468
2453
  const s = r ?? 0, c = a ?? Math.max(s, 2);
@@ -2479,18 +2464,18 @@ function Ii(e, t, n) {
2479
2464
  };
2480
2465
  if (n != null && n.preserveOmittedProperties)
2481
2466
  return {};
2482
- const o = Oi(e);
2467
+ const o = Fi(e);
2483
2468
  return {
2484
2469
  minimumFractionDigits: o,
2485
2470
  maximumFractionDigits: o
2486
2471
  };
2487
2472
  }
2488
- function Fi(e, t) {
2473
+ function Pi(e, t) {
2489
2474
  if (!(typeof t != "string" || e === "percent" && t === "%"))
2490
2475
  return t;
2491
2476
  }
2492
- function _t(e) {
2493
- const t = kt(e.locale), n = kt(e.currency), r = Fi(e.type, e.suffix);
2477
+ function Nt(e) {
2478
+ const t = _t(e.locale), n = _t(e.currency), r = Pi(e.type, e.suffix);
2494
2479
  return {
2495
2480
  ...e,
2496
2481
  ...t !== e.locale ? { locale: t } : {},
@@ -2501,8 +2486,8 @@ function _t(e) {
2501
2486
  function E(e, t, n) {
2502
2487
  const r = { ...t, type: e };
2503
2488
  if ((n == null ? void 0 : n.numericInput) === "canonical" && J(r))
2504
- return _t(r);
2505
- const a = Ii(e, t, n), i = typeof t.prefix == "string" ? t.prefix : void 0, o = {
2489
+ return Nt(r);
2490
+ const a = Ci(e, t, n), i = typeof t.prefix == "string" ? t.prefix : void 0, o = {
2506
2491
  type: e,
2507
2492
  locale: t.locale,
2508
2493
  minimumFractionDigits: a.minimumFractionDigits,
@@ -2515,12 +2500,12 @@ function E(e, t, n) {
2515
2500
  scale: typeof t.scale == "number" ? t.scale : void 0,
2516
2501
  ...t.signDisplay ? { signDisplay: t.signDisplay } : {}
2517
2502
  };
2518
- return e === "currency" && t.currency && (o.currency = t.currency), e === "percent" && (o.percentValueMode = t.percentValueMode || "fraction"), _t(o);
2503
+ return e === "currency" && t.currency && (o.currency = t.currency), e === "percent" && (o.percentValueMode = t.percentValueMode || "fraction"), Nt(o);
2519
2504
  }
2520
- function Nt(e) {
2505
+ function $t(e) {
2521
2506
  return {
2522
2507
  type: "date",
2523
- locale: e.locale || $i,
2508
+ locale: e.locale || Oi,
2524
2509
  pattern: e.pattern,
2525
2510
  // A stored pattern's token set and a preset carry to every reader (column formats ledger P5-45).
2526
2511
  ...e.dialect ? { dialect: e.dialect } : {},
@@ -2532,31 +2517,31 @@ function Nt(e) {
2532
2517
  suffix: e.suffix
2533
2518
  };
2534
2519
  }
2535
- function Fe(e) {
2520
+ function Ce(e) {
2536
2521
  return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
2537
2522
  }
2538
- function $t(e) {
2523
+ function Et(e) {
2539
2524
  const t = me(e.maxUnits);
2540
2525
  return {
2541
2526
  type: "duration",
2542
- inputUnit: Fe(e.inputUnit) ? e.inputUnit : "second",
2527
+ inputUnit: Ce(e.inputUnit) ? e.inputUnit : "second",
2543
2528
  outputStyle: e.outputStyle === "digital" || e.outputStyle === "long" ? e.outputStyle : "compact",
2544
- largestUnit: Fe(e.largestUnit) ? e.largestUnit : void 0,
2545
- smallestUnit: Fe(e.smallestUnit) ? e.smallestUnit : "second",
2529
+ largestUnit: Ce(e.largestUnit) ? e.largestUnit : void 0,
2530
+ smallestUnit: Ce(e.smallestUnit) ? e.smallestUnit : "second",
2546
2531
  maxUnits: t,
2547
2532
  prefix: e.prefix,
2548
2533
  suffix: e.suffix,
2549
2534
  negativeStyle: e.negativeStyle || "minus"
2550
2535
  };
2551
2536
  }
2552
- function Et(e) {
2537
+ function It(e) {
2553
2538
  return {
2554
2539
  type: "string",
2555
2540
  prefix: e.prefix,
2556
2541
  suffix: e.suffix
2557
2542
  };
2558
2543
  }
2559
- function Ci(e, t) {
2544
+ function Yi(e, t) {
2560
2545
  if (!e)
2561
2546
  return;
2562
2547
  if (typeof e == "string") {
@@ -2576,14 +2561,14 @@ function Ci(e, t) {
2576
2561
  "scientific",
2577
2562
  { type: "scientific" },
2578
2563
  t
2579
- ) : r === "date" ? Nt({}) : r === "duration" ? $t({}) : r === "string" ? Et({}) : r === "number" ? E(
2564
+ ) : r === "date" ? $t({}) : r === "duration" ? Et({}) : r === "string" ? It({}) : r === "number" ? E(
2580
2565
  "number",
2581
2566
  { type: "number" },
2582
2567
  t
2583
2568
  ) : void 0;
2584
2569
  }
2585
2570
  if ("type" in e && e.type === "temporal_bucket") {
2586
- const r = Hn.safeParse(e);
2571
+ const r = Zn.safeParse(e);
2587
2572
  return r.success ? r.data : void 0;
2588
2573
  }
2589
2574
  const n = e;
@@ -2601,23 +2586,17 @@ function Ci(e, t) {
2601
2586
  },
2602
2587
  t
2603
2588
  );
2604
- if (n.type === "number" || n.type === "currency" || n.type === "percent" || n.type === "scientific") {
2605
- const r = E(
2606
- n.type,
2607
- n,
2608
- t
2609
- );
2610
- return Ei(n) ? { ...r, currency: "USD" } : r;
2611
- }
2589
+ if (n.type === "number" || n.type === "currency" || n.type === "percent" || n.type === "scientific")
2590
+ return E(n.type, n, t);
2612
2591
  if (n.type === "date")
2613
- return Nt(n);
2614
- if (n.type === "duration")
2615
2592
  return $t(n);
2616
- if (n.type === "string")
2593
+ if (n.type === "duration")
2617
2594
  return Et(n);
2595
+ if (n.type === "string")
2596
+ return It(n);
2618
2597
  }
2619
- const Pi = Object.freeze({ source: "automatic" });
2620
- function Yi(e, t) {
2598
+ const zi = Object.freeze({ source: "automatic" });
2599
+ function Ai(e, t) {
2621
2600
  var r, a;
2622
2601
  const n = e.preferences;
2623
2602
  switch (t) {
@@ -2640,11 +2619,11 @@ function Ot(e, t) {
2640
2619
  ...n.pivotByColumns ?? []
2641
2620
  ].find((r) => r.id === t);
2642
2621
  }
2643
- function zi(e, t) {
2622
+ function Ri(e, t) {
2644
2623
  if (t.kind === "field") return Ot(e, t.fieldId);
2645
2624
  if (t.kind === "pivot") return Ot(e, t.metricId);
2646
2625
  }
2647
- function Ai(e, t, n) {
2626
+ function Ui(e, t, n) {
2648
2627
  var r, a, i, o, s, c, u, l, f;
2649
2628
  switch (t.kind) {
2650
2629
  case "field":
@@ -2660,50 +2639,50 @@ function Ai(e, t, n) {
2660
2639
  return (f = (l = e.config) == null ? void 0 : l.matrix) == null ? void 0 : f.presentation.levelFormats[t.levelId];
2661
2640
  }
2662
2641
  }
2663
- function Ri(e) {
2642
+ function Li(e) {
2664
2643
  if (!e) return;
2665
2644
  if (e.format && e.formatOrigin !== "override") return e.format;
2666
2645
  const t = e.semanticTemporalPresentation;
2667
2646
  return t && t.granularity === e.granularity ? t.format : void 0;
2668
2647
  }
2669
- function Be(e) {
2670
- return e.surface ? { format: e.surface, source: "surface" } : e.override ? { format: e.override, source: "override" } : e.model ? { format: e.model, source: "model" } : e.snapshot ? { format: e.snapshot, source: "snapshot" } : Pi;
2648
+ function Ge(e) {
2649
+ return e.surface ? { format: e.surface, source: "surface" } : e.override ? { format: e.override, source: "override" } : e.model ? { format: e.model, source: "model" } : e.snapshot ? { format: e.snapshot, source: "snapshot" } : zi;
2671
2650
  }
2672
- function Ui(e) {
2651
+ function Wi(e) {
2673
2652
  var o;
2674
- const { card: t, column: n, surface: r } = e, a = zi(t, n), i = n.kind === "field" ? n.fieldId : n.kind === "pivot" ? n.metricId : void 0;
2675
- return Be({
2676
- surface: r ? Yi(t, r) : void 0,
2677
- override: Ai(t, n, a),
2653
+ const { card: t, column: n, surface: r } = e, a = Ri(t, n), i = n.kind === "field" ? n.fieldId : n.kind === "pivot" ? n.metricId : void 0;
2654
+ return Ge({
2655
+ surface: r ? Ai(t, r) : void 0,
2656
+ override: Ui(t, n, a),
2678
2657
  model: (i !== void 0 ? (o = e.modelFormats) == null ? void 0 : o[i] : void 0) ?? e.catalogFormat,
2679
- snapshot: Ri(a)
2658
+ snapshot: Li(a)
2680
2659
  });
2681
2660
  }
2682
- function Li(e, t) {
2661
+ function ji(e, t) {
2683
2662
  const n = (r) => r && typeof r == "object" && !Array.isArray(r) ? Object.fromEntries(
2684
2663
  Object.keys(r).sort().map((a) => [a, n(r[a])])
2685
2664
  ) : r;
2686
2665
  return JSON.stringify(n(e)) === JSON.stringify(n(t));
2687
2666
  }
2688
- const Wi = ["metricColumns", "groupByColumns", "detailColumns", "pivotByColumns"], It = /* @__PURE__ */ new WeakMap();
2689
- function qs(e, t) {
2667
+ const Hi = ["metricColumns", "groupByColumns", "detailColumns", "pivotByColumns"], Ft = /* @__PURE__ */ new WeakMap();
2668
+ function Xs(e, t) {
2690
2669
  const n = t == null ? void 0 : t.modelFormats;
2691
2670
  if (!e || !n || Object.keys(n).length === 0) return e;
2692
- let r = It.get(e);
2693
- if (r || It.set(e, r = /* @__PURE__ */ new WeakMap()), r.has(n)) return r.get(n);
2694
- const a = ji(e, n);
2671
+ let r = Ft.get(e);
2672
+ if (r || Ft.set(e, r = /* @__PURE__ */ new WeakMap()), r.has(n)) return r.get(n);
2673
+ const a = qi(e, n);
2695
2674
  return r.set(n, a), a;
2696
2675
  }
2697
- function ji(e, t) {
2676
+ function qi(e, t) {
2698
2677
  const n = { config: e };
2699
2678
  let r;
2700
- for (const a of Wi) {
2679
+ for (const a of Hi) {
2701
2680
  const i = e[a];
2702
2681
  if (!(i != null && i.length)) continue;
2703
2682
  let o = !1;
2704
2683
  const s = i.map((c) => {
2705
- const u = Ui({ card: n, column: { kind: "field", fieldId: c.id }, modelFormats: t });
2706
- return u.source !== "model" || Li(u.format, c.format) ? c : (o = !0, { ...c, format: u.format });
2684
+ const u = Wi({ card: n, column: { kind: "field", fieldId: c.id }, modelFormats: t });
2685
+ return u.source !== "model" || ji(u.format, c.format) ? c : (o = !0, { ...c, format: u.format });
2707
2686
  });
2708
2687
  o && ((r ?? (r = { ...e }))[a] = s);
2709
2688
  }
@@ -2720,7 +2699,7 @@ function T(e) {
2720
2699
  ) ? t.constructor : void 0;
2721
2700
  return typeof n == "function" && Function.prototype.toString.call(n) === Function.prototype.toString.call(Object);
2722
2701
  }
2723
- const Hi = [
2702
+ const Zi = [
2724
2703
  "type",
2725
2704
  "locale",
2726
2705
  "minimumFractionDigits",
@@ -2735,13 +2714,13 @@ const Hi = [
2735
2714
  "percentValueMode",
2736
2715
  "signDisplay"
2737
2716
  ];
2738
- function qi(e) {
2717
+ function Xi(e) {
2739
2718
  if (!T(e))
2740
2719
  return {
2741
2720
  ok: !1,
2742
2721
  issues: [{ path: "$", message: "Numeric format must be an object." }]
2743
2722
  };
2744
- const t = [], n = new Set(Hi);
2723
+ const t = [], n = new Set(Zi);
2745
2724
  Object.keys(e).filter((i) => !n.has(i)).forEach(
2746
2725
  (i) => t.push({ path: i, message: `Unknown property "${i}".` })
2747
2726
  ), e.type !== "number" && e.type !== "currency" && e.type !== "percent" && e.type !== "scientific" && t.push({
@@ -2750,7 +2729,7 @@ function qi(e) {
2750
2729
  });
2751
2730
  const r = e.locale === void 0 ? void 0 : Q(e.locale);
2752
2731
  e.locale !== void 0 && !r && t.push({ path: "locale", message: "Expected a supported BCP 47 locale." });
2753
- const a = e.currency === void 0 ? void 0 : Ae(e.currency);
2732
+ const a = e.currency === void 0 ? void 0 : Re(e.currency);
2754
2733
  e.currency !== void 0 && !a && t.push({
2755
2734
  path: "currency",
2756
2735
  message: "Expected a supported ISO 4217 currency code."
@@ -2804,8 +2783,8 @@ function qi(e) {
2804
2783
  }
2805
2784
  };
2806
2785
  }
2807
- function Zi(e) {
2808
- const t = qi(e);
2786
+ function Vi(e) {
2787
+ const t = Xi(e);
2809
2788
  if (!t.ok)
2810
2789
  return t;
2811
2790
  const n = [];
@@ -2823,7 +2802,7 @@ function Zi(e) {
2823
2802
  message: "Resolved currency formats require an explicit currency."
2824
2803
  }), n.length > 0 ? { ok: !1, issues: n } : t;
2825
2804
  }
2826
- function Zs(e) {
2805
+ function Vs(e) {
2827
2806
  var r;
2828
2807
  const t = /* @__PURE__ */ new Set();
2829
2808
  if (e.snapshot.resolvedFormats.forEach((a, i) => {
@@ -2860,7 +2839,7 @@ function Zs(e) {
2860
2839
  `resolvedFormats is missing visible export column "${n}"`
2861
2840
  );
2862
2841
  }
2863
- function Xi(e, t) {
2842
+ function Bi(e, t) {
2864
2843
  const n = new Intl.NumberFormat(e, {
2865
2844
  style: "currency",
2866
2845
  currency: t
@@ -2870,7 +2849,7 @@ function Xi(e, t) {
2870
2849
  maximumFractionDigits: n.maximumFractionDigits
2871
2850
  };
2872
2851
  }
2873
- function Vi(e) {
2852
+ function Ki(e) {
2874
2853
  if (e.minimumFractionDigits !== void 0 || e.maximumFractionDigits !== void 0) {
2875
2854
  const n = e.minimumFractionDigits ?? 0;
2876
2855
  return {
@@ -2884,15 +2863,15 @@ function Vi(e) {
2884
2863
  maximumFractionDigits: t
2885
2864
  };
2886
2865
  }
2887
- function Ki(e, t, n) {
2888
- const r = Q(e.locale) ?? t.locale, a = e.type === "number" || e.type === "currency" ? Ae(n) : void 0;
2866
+ function Gi(e, t, n) {
2867
+ const r = Q(e.locale) ?? t.locale, a = e.type === "number" || e.type === "currency" ? Re(n) : void 0;
2889
2868
  if (!(e.type === "currency" || a !== void 0))
2890
2869
  return {
2891
2870
  ...e,
2892
2871
  locale: r,
2893
- ...Vi(e)
2872
+ ...Ki(e)
2894
2873
  };
2895
- const o = a ?? Ae(e.currency) ?? t.defaultCurrency, s = Xi(
2874
+ const o = a ?? Re(e.currency) ?? t.defaultCurrency, s = Bi(
2896
2875
  r,
2897
2876
  o
2898
2877
  ), c = s.minimumFractionDigits ?? 0, u = s.maximumFractionDigits ?? c, l = e.minimumFractionDigits ?? Math.min(
@@ -2911,7 +2890,7 @@ function Ki(e, t, n) {
2911
2890
  maximumFractionDigits: f
2912
2891
  };
2913
2892
  }
2914
- const Bi = [
2893
+ const Qi = [
2915
2894
  "YYYY",
2916
2895
  "MMMM",
2917
2896
  "MMM",
@@ -2921,13 +2900,13 @@ const Bi = [
2921
2900
  "HH",
2922
2901
  "mm",
2923
2902
  "ss"
2924
- ], Gi = /* @__PURE__ */ new Set([" ", "-", "/", ":", ".", ",", "T"]), se = [
2903
+ ], Ji = /* @__PURE__ */ new Set([" ", "-", "/", ":", ".", ",", "T"]), se = [
2925
2904
  "day",
2926
2905
  "week",
2927
2906
  "month",
2928
2907
  "quarter",
2929
2908
  "year"
2930
- ], fn = {
2909
+ ], gn = {
2931
2910
  week_of_short: ["week"],
2932
2911
  week_of_long: ["week"],
2933
2912
  quarter_short: ["quarter"],
@@ -2939,11 +2918,11 @@ const Bi = [
2939
2918
  numeric: se,
2940
2919
  iso: se
2941
2920
  };
2942
- function Qi(e) {
2943
- return typeof e == "string" && Object.prototype.hasOwnProperty.call(fn, e);
2921
+ function eo(e) {
2922
+ return typeof e == "string" && Object.prototype.hasOwnProperty.call(gn, e);
2944
2923
  }
2945
- function Ji(e, t) {
2946
- return Bi.find(
2924
+ function to(e, t) {
2925
+ return Qi.find(
2947
2926
  (n) => e.startsWith(n, t)
2948
2927
  );
2949
2928
  }
@@ -2958,7 +2937,7 @@ function ne(e) {
2958
2937
  const t = [];
2959
2938
  let n = 0, r = !1;
2960
2939
  for (; n < e.length; ) {
2961
- const i = Ji(e, n);
2940
+ const i = to(e, n);
2962
2941
  if (i) {
2963
2942
  if (r)
2964
2943
  return {
@@ -2970,7 +2949,7 @@ function ne(e) {
2970
2949
  continue;
2971
2950
  }
2972
2951
  const o = e[n];
2973
- if (!Gi.has(o))
2952
+ if (!Ji.has(o))
2974
2953
  return {
2975
2954
  ok: !1,
2976
2955
  code: "invalid_temporal_bucket_pattern",
@@ -2991,23 +2970,23 @@ function ne(e) {
2991
2970
  message: "Temporal bucket patterns cannot end with a separator."
2992
2971
  } : { ok: !0, segments: t };
2993
2972
  }
2994
- function eo(e) {
2973
+ function no(e) {
2995
2974
  return e.flatMap(
2996
2975
  (t) => t.kind === "token" ? [t.value] : []
2997
2976
  );
2998
2977
  }
2999
- function Ft(e, t) {
2978
+ function Ct(e, t) {
3000
2979
  return e.filter((n) => t.includes(n)).length === 1;
3001
2980
  }
3002
2981
  function ce(e, t) {
3003
2982
  return e.some((n) => t.includes(n));
3004
2983
  }
3005
- function to(e) {
2984
+ function ro(e) {
3006
2985
  return new Set(e).size !== e.length;
3007
2986
  }
3008
- function no(e, t) {
3009
- if (to(e)) return !1;
3010
- const n = ["YYYY", "YY"], r = ["MMMM", "MMM", "MM"], a = ["HH", "mm", "ss"], i = Ft(e, n), o = Ft(e, r), s = e.includes("DD"), c = ce(e, a);
2987
+ function ao(e, t) {
2988
+ if (ro(e)) return !1;
2989
+ const n = ["YYYY", "YY"], r = ["MMMM", "MMM", "MM"], a = ["HH", "mm", "ss"], i = Ct(e, n), o = Ct(e, r), s = e.includes("DD"), c = ce(e, a);
3011
2990
  switch (t) {
3012
2991
  case "second":
3013
2992
  return e.includes("HH") && e.includes("mm") && e.includes("ss") && (!ce(e, [...n, ...r, "DD"]) || i && o && s);
@@ -3026,11 +3005,11 @@ function no(e, t) {
3026
3005
  return i && !o && !s && !c;
3027
3006
  }
3028
3007
  }
3029
- function dn(e, t) {
3008
+ function yn(e, t) {
3030
3009
  if (e.presentation.mode === "auto")
3031
3010
  return { ok: !0 };
3032
3011
  if (e.presentation.mode === "preset") {
3033
- const r = fn[e.presentation.preset];
3012
+ const r = gn[e.presentation.preset];
3034
3013
  return r.includes(t) ? { ok: !0 } : {
3035
3014
  ok: !1,
3036
3015
  code: "incompatible_temporal_bucket_preset",
@@ -3038,8 +3017,8 @@ function dn(e, t) {
3038
3017
  };
3039
3018
  }
3040
3019
  const n = ne(e.presentation.pattern);
3041
- return n.ok ? no(
3042
- eo(n.segments),
3020
+ return n.ok ? ao(
3021
+ no(n.segments),
3043
3022
  t
3044
3023
  ) ? { ok: !0, segments: n.segments } : {
3045
3024
  ok: !1,
@@ -3047,11 +3026,11 @@ function dn(e, t) {
3047
3026
  message: `Pattern ${e.presentation.pattern} is not compatible with ${t} granularity.`
3048
3027
  } : n;
3049
3028
  }
3050
- function Xs(e, t) {
3029
+ function Bs(e, t) {
3051
3030
  if (!(!e || !t))
3052
- return dn(e, t).ok ? e : void 0;
3031
+ return yn(e, t).ok ? e : void 0;
3053
3032
  }
3054
- function ro(e) {
3033
+ function io(e) {
3055
3034
  return e.preset ? { mode: "preset", preset: e.preset } : e.pattern ? { mode: "pattern", dialect: e.dialect ?? "semaphor_tokens", pattern: e.pattern } : { mode: "auto" };
3056
3035
  }
3057
3036
  class R extends Error {
@@ -3061,7 +3040,7 @@ class R extends Error {
3061
3040
  this.name = "RawTemporalFormatContractError", this.code = n;
3062
3041
  }
3063
3042
  }
3064
- const ao = [
3043
+ const oo = [
3065
3044
  "SSSSSSSSS",
3066
3045
  "SSSSSSSS",
3067
3046
  "SSSSSSS",
@@ -3071,7 +3050,7 @@ const ao = [
3071
3050
  "SSS",
3072
3051
  "SS",
3073
3052
  "S"
3074
- ], io = [
3053
+ ], so = [
3075
3054
  "yyyy",
3076
3055
  "MMMM",
3077
3056
  "LLLL",
@@ -3093,7 +3072,7 @@ const ao = [
3093
3072
  "m",
3094
3073
  "s",
3095
3074
  "a"
3096
- ], oo = /* @__PURE__ */ new Set([
3075
+ ], co = /* @__PURE__ */ new Set([
3097
3076
  "HH",
3098
3077
  "H",
3099
3078
  "hh",
@@ -3103,8 +3082,8 @@ const ao = [
3103
3082
  "ss",
3104
3083
  "s",
3105
3084
  "a",
3106
- ...ao
3107
- ]), so = /* @__PURE__ */ new Set(["zzz", "XXX"]), Ce = /* @__PURE__ */ new Set(["short", "medium", "long"]);
3085
+ ...oo
3086
+ ]), uo = /* @__PURE__ */ new Set(["zzz", "XXX"]), Pe = /* @__PURE__ */ new Set(["short", "medium", "long"]);
3108
3087
  function M(e, t) {
3109
3088
  return Object.keys(e).length === t.length && t.every((r) => r in e);
3110
3089
  }
@@ -3114,7 +3093,7 @@ function g(e) {
3114
3093
  e
3115
3094
  );
3116
3095
  }
3117
- function hn(e) {
3096
+ function wn(e) {
3118
3097
  if (!e || e.trim() !== e || e.length > 256)
3119
3098
  return g(
3120
3099
  "date_fns patterns must be non-empty, trimmed, and at most 256 characters."
@@ -3161,7 +3140,7 @@ function hn(e) {
3161
3140
  }), r = o;
3162
3141
  continue;
3163
3142
  }
3164
- const a = io.find(
3143
+ const a = so.find(
3165
3144
  (o) => e.startsWith(o, r)
3166
3145
  );
3167
3146
  if (a) {
@@ -3177,16 +3156,16 @@ function hn(e) {
3177
3156
  }
3178
3157
  return t.some((a) => a.kind === "token") ? t : g("date_fns patterns must contain at least one token.");
3179
3158
  }
3180
- function gn(e, t) {
3159
+ function pn(e, t) {
3181
3160
  if (e === "semaphor_tokens") {
3182
3161
  const n = ne(t);
3183
3162
  n.ok || g(n.message);
3184
3163
  return;
3185
3164
  }
3186
- hn(t);
3165
+ wn(t);
3187
3166
  }
3188
- function co(e) {
3189
- return !T(e) || !M(e, ["dateStyle", "dateTime"]) ? g("Automatic raw temporal styles are incomplete.") : Ce.has(e.dateStyle) ? !T(e.dateTime) || !M(e.dateTime, ["dateStyle", "timeStyle"]) || !Ce.has(e.dateTime.dateStyle) || !Ce.has(e.dateTime.timeStyle) ? g(
3167
+ function lo(e) {
3168
+ return !T(e) || !M(e, ["dateStyle", "dateTime"]) ? g("Automatic raw temporal styles are incomplete.") : Pe.has(e.dateStyle) ? !T(e.dateTime) || !M(e.dateTime, ["dateStyle", "timeStyle"]) || !Pe.has(e.dateTime.dateStyle) || !Pe.has(e.dateTime.timeStyle) ? g(
3190
3169
  "Automatic dateTime styles are incomplete or invalid."
3191
3170
  ) : {
3192
3171
  dateStyle: e.dateStyle,
@@ -3196,7 +3175,7 @@ function co(e) {
3196
3175
  }
3197
3176
  } : g("Automatic dateStyle is invalid.");
3198
3177
  }
3199
- function Ge(e) {
3178
+ function Qe(e) {
3200
3179
  const t = ["type", "locale", "calendarTimezone", "presentation"], n = [...t, "sourceTimezone"];
3201
3180
  if (!T(e) || !M(e, t) && !M(e, n) || e.type !== "raw_temporal")
3202
3181
  return g("Resolved raw temporal format has an invalid shape.");
@@ -3212,11 +3191,11 @@ function Ge(e) {
3212
3191
  ...e.sourceTimezone ? { sourceTimezone: e.sourceTimezone } : {},
3213
3192
  presentation: {
3214
3193
  mode: "auto",
3215
- styles: co(e.presentation.styles)
3194
+ styles: lo(e.presentation.styles)
3216
3195
  }
3217
3196
  } : g(
3218
3197
  "Automatic raw temporal presentation has unknown fields."
3219
- ) : e.presentation.mode === "preset" ? !M(e.presentation, ["mode", "preset"]) || !Dn(e.presentation.preset) ? g("Preset raw temporal presentation has an invalid shape.") : {
3198
+ ) : e.presentation.mode === "preset" ? !M(e.presentation, ["mode", "preset"]) || !vn(e.presentation.preset) ? g("Preset raw temporal presentation has an invalid shape.") : {
3220
3199
  type: "raw_temporal",
3221
3200
  locale: r,
3222
3201
  calendarTimezone: e.calendarTimezone,
@@ -3224,7 +3203,7 @@ function Ge(e) {
3224
3203
  presentation: { mode: "preset", preset: e.presentation.preset }
3225
3204
  } : e.presentation.mode !== "pattern" || !M(e.presentation, ["mode", "dialect", "pattern"]) || e.presentation.dialect !== "semaphor_tokens" && e.presentation.dialect !== "date_fns" || typeof e.presentation.pattern != "string" ? g(
3226
3205
  "Pattern raw temporal presentation has an invalid shape."
3227
- ) : (gn(e.presentation.dialect, e.presentation.pattern), {
3206
+ ) : (pn(e.presentation.dialect, e.presentation.pattern), {
3228
3207
  type: "raw_temporal",
3229
3208
  locale: r,
3230
3209
  calendarTimezone: e.calendarTimezone,
@@ -3236,7 +3215,7 @@ function Ge(e) {
3236
3215
  }
3237
3216
  }) : g("Raw temporal presentation must be an object.") : g("Raw temporal locale is invalid or unsupported.");
3238
3217
  }
3239
- function yn(e) {
3218
+ function Tn(e) {
3240
3219
  var s, c, u;
3241
3220
  if (e.format) {
3242
3221
  if (!T(e.format))
@@ -3257,14 +3236,14 @@ function yn(e) {
3257
3236
  "Automatic authored raw temporal format has unknown fields."
3258
3237
  );
3259
3238
  } else if (f.mode === "preset") {
3260
- if (!M(f, ["mode", "preset"]) || !Dn(f.preset))
3239
+ if (!M(f, ["mode", "preset"]) || !vn(f.preset))
3261
3240
  return g("Authored raw temporal preset has an invalid shape.");
3262
3241
  } else {
3263
3242
  if (f.mode !== "pattern" || !M(f, ["mode", "dialect", "pattern"]) || f.dialect !== "semaphor_tokens" && f.dialect !== "date_fns" || typeof f.pattern != "string")
3264
3243
  return g(
3265
3244
  "Authored raw temporal pattern has an invalid shape."
3266
3245
  );
3267
- gn(f.dialect, f.pattern);
3246
+ pn(f.dialect, f.pattern);
3268
3247
  }
3269
3248
  }
3270
3249
  const t = (s = e.format) == null ? void 0 : s.timezone, n = (c = e.format) == null ? void 0 : c.sourceTimezone, r = t && t !== "auto" ? t : e.calendar.tz, a = n && n !== "auto" ? n === "local" ? Intl.DateTimeFormat().resolvedOptions().timeZone : n : void 0;
@@ -3283,15 +3262,15 @@ function yn(e) {
3283
3262
  }
3284
3263
  }
3285
3264
  };
3286
- return Ge(o);
3265
+ return Qe(o);
3287
3266
  }
3288
- function Vs(e) {
3267
+ function Ks(e) {
3289
3268
  const t = /* @__PURE__ */ new Set();
3290
3269
  let n = !1;
3291
3270
  for (const r of e.values) {
3292
3271
  if (r === null) continue;
3293
3272
  n = !0;
3294
- const a = Kn(r);
3273
+ const a = Gn(r);
3295
3274
  a && t.add(a);
3296
3275
  }
3297
3276
  if (!n) return { status: "empty" };
@@ -3309,7 +3288,7 @@ function Vs(e) {
3309
3288
  }
3310
3289
  };
3311
3290
  }
3312
- function Ks(e) {
3291
+ function Gs(e) {
3313
3292
  return {
3314
3293
  version: 1,
3315
3294
  columns: Object.fromEntries(
@@ -3320,7 +3299,7 @@ function Ks(e) {
3320
3299
  )
3321
3300
  };
3322
3301
  }
3323
- function uo(e) {
3302
+ function mo(e) {
3324
3303
  if (!T(e) || e.version !== 1 || !T(e.columns) || Object.keys(e).some((r) => r !== "version" && r !== "columns"))
3325
3304
  throw new R(
3326
3305
  "invalid_raw_temporal_format",
@@ -3343,9 +3322,9 @@ function uo(e) {
3343
3322
  }
3344
3323
  return { version: 1, columns: t };
3345
3324
  }
3346
- function Bs(e) {
3325
+ function Qs(e) {
3347
3326
  if (e.length === 0) return;
3348
- const t = e.map(uo), n = Object.keys(t[0].columns).sort();
3327
+ const t = e.map(mo), n = Object.keys(t[0].columns).sort();
3349
3328
  for (let r = 1; r < t.length; r += 1) {
3350
3329
  const a = Object.keys(t[r].columns).sort();
3351
3330
  if (a.length !== n.length || a.some((i, o) => i !== n[o]))
@@ -3365,18 +3344,18 @@ function Bs(e) {
3365
3344
  `Declared SQL temporal column "${r}" has inconsistent semantics across export chunks. Normalize it to one kind.`
3366
3345
  );
3367
3346
  }
3368
- function We(e) {
3347
+ function je(e) {
3369
3348
  const t = /* @__PURE__ */ new Date(0);
3370
3349
  return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, 0), t;
3371
3350
  }
3372
- function Qe(e, t) {
3351
+ function Je(e, t) {
3373
3352
  const n = e.fraction ? `.${e.fraction.padEnd(3, "0").slice(0, 3)}` : "";
3374
3353
  return te(
3375
3354
  `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}T${String(e.hour).padStart(2, "0")}:${String(e.minute).padStart(2, "0")}:${String(e.second).padStart(2, "0")}${n}`,
3376
3355
  t
3377
3356
  );
3378
3357
  }
3379
- function pn(e, t) {
3358
+ function xn(e, t) {
3380
3359
  const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
3381
3360
  let a, i, o, s;
3382
3361
  return {
@@ -3461,7 +3440,7 @@ function pn(e, t) {
3461
3440
  }
3462
3441
  };
3463
3442
  }
3464
- function lo(e, t, n, r, a) {
3443
+ function fo(e, t, n, r, a) {
3465
3444
  if (/^S{1,9}$/.test(e)) {
3466
3445
  const i = t.fraction.padEnd(e.length, "0").slice(0, e.length);
3467
3446
  return r.number(Number(i), e.length);
@@ -3522,47 +3501,47 @@ function lo(e, t, n, r, a) {
3522
3501
  );
3523
3502
  }
3524
3503
  }
3525
- function mo(e, t, n, r) {
3526
- const a = We(t);
3504
+ function ho(e, t, n, r) {
3505
+ const a = je(t);
3527
3506
  return e.map(
3528
- (i) => i.kind === "literal" ? i.value : lo(i.value, t, a, n, r)
3507
+ (i) => i.kind === "literal" ? i.value : fo(i.value, t, a, n, r)
3529
3508
  ).join("");
3530
3509
  }
3531
- function wn(e, t, n) {
3532
- const r = t === "date_fns" ? hn(n) : (() => {
3510
+ function Dn(e, t, n) {
3511
+ const r = t === "date_fns" ? wn(n) : (() => {
3533
3512
  const i = ne(n);
3534
3513
  return i.ok ? i.segments : g(i.message);
3535
3514
  })(), a = r.filter((i) => i.kind === "token").map((i) => i.value);
3536
- return e === "date" && a.some((i) => oo.has(i)) ? g("Date patterns cannot contain time tokens.") : e !== "instant" && a.some((i) => so.has(i)) ? g("Timezone pattern tokens require an instant value.") : r;
3515
+ return e === "date" && a.some((i) => co.has(i)) ? g("Date patterns cannot contain time tokens.") : e !== "instant" && a.some((i) => uo.has(i)) ? g("Timezone pattern tokens require an instant value.") : r;
3537
3516
  }
3538
- function fo(e) {
3539
- wn(
3517
+ function go(e) {
3518
+ Dn(
3540
3519
  e.valueKind ?? "instant",
3541
3520
  e.dialect,
3542
3521
  e.pattern
3543
3522
  );
3544
3523
  }
3545
- function ho(e, t, n, r) {
3546
- const a = wn(
3524
+ function yo(e, t, n, r) {
3525
+ const a = Dn(
3547
3526
  e.valueKind,
3548
3527
  n,
3549
3528
  r
3550
- ), i = pn(t.locale, t.calendarTimezone);
3529
+ ), i = xn(t.locale, t.calendarTimezone);
3551
3530
  return (o) => {
3552
- const s = e.valueKind === "wall_datetime" && t.sourceTimezone ? Qe(o.fields, t.sourceTimezone) : void 0, c = e.valueKind === "instant" ? {
3531
+ const s = e.valueKind === "wall_datetime" && t.sourceTimezone ? Je(o.fields, t.sourceTimezone) : void 0, c = e.valueKind === "instant" ? {
3553
3532
  ...i.instantFields(o.instant),
3554
3533
  fraction: o.fields.fraction
3555
3534
  } : s ? {
3556
3535
  ...i.instantFields(s),
3557
3536
  fraction: o.fields.fraction
3558
3537
  } : o.fields;
3559
- return mo(a, c, i, o.instant ?? s);
3538
+ return ho(a, c, i, o.instant ?? s);
3560
3539
  };
3561
3540
  }
3562
- function Tn(e, t) {
3563
- const n = pn(t.locale, t.calendarTimezone);
3541
+ function bn(e, t) {
3542
+ const n = xn(t.locale, t.calendarTimezone);
3564
3543
  return (r) => {
3565
- const a = e.valueKind === "instant" ? n.instantFields(r.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? n.instantFields(Qe(r.fields, t.sourceTimezone)) : r.fields;
3544
+ const a = e.valueKind === "instant" ? n.instantFields(r.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? n.instantFields(Je(r.fields, t.sourceTimezone)) : r.fields;
3566
3545
  return {
3567
3546
  year: a.year,
3568
3547
  month: a.month,
@@ -3573,12 +3552,12 @@ function Tn(e, t) {
3573
3552
  };
3574
3553
  };
3575
3554
  }
3576
- const go = /* @__PURE__ */ new Set(["short", "long", "numeric", "iso"]);
3577
- function Dn(e) {
3578
- return typeof e == "string" && go.has(e);
3555
+ const wo = /* @__PURE__ */ new Set(["short", "long", "numeric", "iso"]);
3556
+ function vn(e) {
3557
+ return typeof e == "string" && wo.has(e);
3579
3558
  }
3580
- function yo(e, t, n) {
3581
- const r = Tn(e, t), a = e.valueKind !== "date", i = (s, c = 2) => String(s).padStart(c, "0");
3559
+ function po(e, t, n) {
3560
+ const r = bn(e, t), a = e.valueKind !== "date", i = (s, c = 2) => String(s).padStart(c, "0");
3582
3561
  if (n === "iso")
3583
3562
  return (s) => {
3584
3563
  const c = r(s), u = `${i(c.year, 4)}-${i(c.month)}-${i(c.day)}`;
@@ -3597,7 +3576,7 @@ function yo(e, t, n) {
3597
3576
  return u.setUTCFullYear(c.year, c.month - 1, c.day), u.setUTCHours(c.hour, c.minute, c.second, 0), o.format(u);
3598
3577
  };
3599
3578
  }
3600
- function po(e, t) {
3579
+ function To(e, t) {
3601
3580
  const n = t.presentation.mode === "auto" ? t.presentation.styles : g("Automatic raw temporal formatting requires styles.");
3602
3581
  if (e.valueKind === "date") {
3603
3582
  const o = new Intl.DateTimeFormat(t.locale, {
@@ -3605,7 +3584,7 @@ function po(e, t) {
3605
3584
  timeZone: "UTC",
3606
3585
  dateStyle: n.dateStyle
3607
3586
  });
3608
- return (s) => o.format(We(s.fields));
3587
+ return (s) => o.format(je(s.fields));
3609
3588
  }
3610
3589
  const r = e.valueKind === "instant", a = !r && n.dateTime.timeStyle === "long" ? "medium" : n.dateTime.timeStyle, i = new Intl.DateTimeFormat(t.locale, {
3611
3590
  calendar: "gregory",
@@ -3613,9 +3592,9 @@ function po(e, t) {
3613
3592
  dateStyle: n.dateTime.dateStyle,
3614
3593
  timeStyle: a
3615
3594
  });
3616
- return (o) => r ? i.format(o.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? i.format(Qe(o.fields, t.sourceTimezone)) : i.format(We(o.fields));
3595
+ return (o) => r ? i.format(o.instant) : e.valueKind === "wall_datetime" && t.sourceTimezone ? i.format(Je(o.fields, t.sourceTimezone)) : i.format(je(o.fields));
3617
3596
  }
3618
- function Ct(e, t, n) {
3597
+ function Pt(e, t, n) {
3619
3598
  return {
3620
3599
  ok: !1,
3621
3600
  text: e,
@@ -3625,18 +3604,18 @@ function Ct(e, t, n) {
3625
3604
  }
3626
3605
  };
3627
3606
  }
3628
- function bn(e) {
3629
- const t = Xn(e.metadata), n = Ge(e.format), r = n.presentation.mode === "auto" ? po(t, n) : n.presentation.mode === "preset" ? yo(t, n, n.presentation.preset) : ho(
3607
+ function Sn(e) {
3608
+ const t = Bn(e.metadata), n = Qe(e.format), r = n.presentation.mode === "auto" ? To(t, n) : n.presentation.mode === "preset" ? po(t, n, n.presentation.preset) : yo(
3630
3609
  t,
3631
3610
  n,
3632
3611
  n.presentation.dialect,
3633
3612
  n.presentation.pattern
3634
- ), a = Tn(t, n);
3613
+ ), a = bn(t, n);
3635
3614
  return (i) => {
3636
3615
  if (i === null)
3637
3616
  return { ok: !0, text: "", status: "empty" };
3638
- const o = Vn(i, t.valueKind);
3639
- return o.status === "invalid_shape" ? Ct(i, t, "invalid_raw_temporal_value") : o.status === "out_of_range" ? Ct(i, t, "out_of_range_raw_temporal_value") : {
3617
+ const o = Kn(i, t.valueKind);
3618
+ return o.status === "invalid_shape" ? Pt(i, t, "invalid_raw_temporal_value") : o.status === "out_of_range" ? Pt(i, t, "out_of_range_raw_temporal_value") : {
3640
3619
  ok: !0,
3641
3620
  text: r(o),
3642
3621
  status: "formatted",
@@ -3644,17 +3623,17 @@ function bn(e) {
3644
3623
  };
3645
3624
  };
3646
3625
  }
3647
- function wo(e) {
3648
- return bn({
3626
+ function xo(e) {
3627
+ return Sn({
3649
3628
  metadata: e.metadata,
3650
3629
  format: e.format
3651
3630
  })(e.value);
3652
3631
  }
3653
- function To(e) {
3654
- const t = yn({ format: e.authored, preferences: e.preferences, calendar: e.calendar });
3655
- return { format: t, formatValue: bn({ metadata: e.metadata, format: t }) };
3632
+ function Do(e) {
3633
+ const t = Tn({ format: e.authored, preferences: e.preferences, calendar: e.calendar });
3634
+ return { format: t, formatValue: Sn({ metadata: e.metadata, format: t }) };
3656
3635
  }
3657
- const Do = {
3636
+ const bo = {
3658
3637
  dateStyle: "short",
3659
3638
  dateTime: { dateStyle: "short", timeStyle: "short" }
3660
3639
  };
@@ -3665,7 +3644,7 @@ class fe extends Error {
3665
3644
  this.name = "TemporalBucketContractError", this.code = n;
3666
3645
  }
3667
3646
  }
3668
- const bo = [
3647
+ const vo = [
3669
3648
  "Jan",
3670
3649
  "Feb",
3671
3650
  "Mar",
@@ -3678,7 +3657,7 @@ const bo = [
3678
3657
  "Oct",
3679
3658
  "Nov",
3680
3659
  "Dec"
3681
- ], xo = [
3660
+ ], So = [
3682
3661
  "January",
3683
3662
  "February",
3684
3663
  "March",
@@ -3692,19 +3671,19 @@ const bo = [
3692
3671
  "November",
3693
3672
  "December"
3694
3673
  ];
3695
- function Pe(e) {
3674
+ function Ye(e) {
3696
3675
  return {
3697
3676
  ok: !1,
3698
3677
  error: { code: "invalid_temporal_bucket_value", message: e }
3699
3678
  };
3700
3679
  }
3701
- function vo(e) {
3680
+ function Mo(e) {
3702
3681
  return e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0);
3703
3682
  }
3704
- function So(e, t) {
3705
- return t === 2 ? vo(e) ? 29 : 28 : [4, 6, 9, 11].includes(t) ? 30 : 31;
3683
+ function ko(e, t) {
3684
+ return t === 2 ? Mo(e) ? 29 : 28 : [4, 6, 9, 11].includes(t) ? 30 : 31;
3706
3685
  }
3707
- function Mo(e, t, n) {
3686
+ function _o(e, t, n) {
3708
3687
  const r = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4], a = t < 3 ? e - 1 : e;
3709
3688
  return (a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) + r[t - 1] + n) % 7;
3710
3689
  }
@@ -3712,10 +3691,10 @@ function Se(e) {
3712
3691
  var t;
3713
3692
  return (t = e.calendar.fiscalCalendar) == null ? void 0 : t.yearStartMonth;
3714
3693
  }
3715
- function ko(e, t) {
3694
+ function No(e, t) {
3716
3695
  return (e - t + 12) % 12 % 3 === 0;
3717
3696
  }
3718
- function _o(e, t) {
3697
+ function $o(e, t) {
3719
3698
  const { granularity: n } = t, r = Se(t) ?? 1;
3720
3699
  switch (n) {
3721
3700
  case "second":
@@ -3727,20 +3706,20 @@ function _o(e, t) {
3727
3706
  case "day":
3728
3707
  return !0;
3729
3708
  case "week":
3730
- return Mo(e.year, e.month, e.day) === t.calendar.weekStart;
3709
+ return _o(e.year, e.month, e.day) === t.calendar.weekStart;
3731
3710
  case "month":
3732
3711
  return e.day === 1;
3733
3712
  case "quarter":
3734
- return e.day === 1 && ko(e.month, r);
3713
+ return e.day === 1 && No(e.month, r);
3735
3714
  case "year":
3736
3715
  return e.day === 1 && e.month === r;
3737
3716
  }
3738
3717
  }
3739
- function xn(e, t) {
3718
+ function Me(e, t) {
3740
3719
  if (e === null) return { ok: !0, value: null };
3741
3720
  const n = t.granularity === "second" || t.granularity === "minute" || t.granularity === "hour", r = n ? /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/.exec(e) : /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
3742
3721
  if (!r)
3743
- return Pe(
3722
+ return Ye(
3744
3723
  `Expected ${n ? "YYYY-MM-DDTHH:mm:ss" : "YYYY-MM-DD"} for ${t.granularity} granularity.`
3745
3724
  );
3746
3725
  const a = {
@@ -3751,17 +3730,42 @@ function xn(e, t) {
3751
3730
  minute: n ? Number(r[5]) : 0,
3752
3731
  second: n ? Number(r[6]) : 0
3753
3732
  };
3754
- return a.year < 1 || a.month < 1 || a.month > 12 || a.day < 1 || a.day > So(a.year, a.month) || a.hour > 23 || a.minute > 59 || a.second > 59 ? Pe(`Invalid canonical ${t.granularity} bucket value ${e}.`) : _o(a, t) ? { ok: !0, value: a } : Pe(
3733
+ return a.year < 1 || a.month < 1 || a.month > 12 || a.day < 1 || a.day > ko(a.year, a.month) || a.hour > 23 || a.minute > 59 || a.second > 59 ? Ye(`Invalid canonical ${t.granularity} bucket value ${e}.`) : $o(a, t) ? { ok: !0, value: a } : Ye(
3755
3734
  `Canonical value ${e} is not aligned to ${t.granularity} granularity and its governed Calendar.`
3756
3735
  );
3757
3736
  }
3758
- function Gs(e) {
3737
+ const Yt = (e) => `${x(e.year, 4)}-${x(e.month)}-${x(e.day)}`;
3738
+ function Js(e, t, n) {
3739
+ const r = Me(e, t);
3740
+ if (!r.ok || !r.value) return;
3741
+ const a = qt({ ...r.value, millisecond: 0 }, n.amount, n.unit), { granularity: i } = t;
3742
+ if (i === "second" || i === "minute" || i === "hour") {
3743
+ const o = {
3744
+ ...a,
3745
+ second: i === "second" ? a.second : 0,
3746
+ minute: i === "hour" ? 0 : a.minute
3747
+ };
3748
+ return `${Yt(o)}T${x(o.hour)}:${x(o.minute)}:${x(o.second)}`;
3749
+ }
3750
+ return Yt(Qn(a, i, t.calendar));
3751
+ }
3752
+ function ec(e, t) {
3753
+ const n = Me(e, t);
3754
+ if (!n.ok || !n.value) return;
3755
+ const r = { ...n.value, millisecond: 0 }, a = t.calendar.tz;
3756
+ return {
3757
+ startInclusive: at(r, a).toISOString(),
3758
+ endExclusive: at(qt(r, 1, t.granularity), a).toISOString(),
3759
+ timezone: a
3760
+ };
3761
+ }
3762
+ function tc(e) {
3759
3763
  const { granularity: t, calendar: n } = e, r = (o, s) => new Intl.DateTimeFormat("en-US", { ...o, timeZone: "UTC" }).format(s), a = [`by ${t} in the ${n.tz} calendar`];
3760
3764
  t === "week" && a.push(`weeks starting on ${r({ weekday: "long" }, new Date(Date.UTC(2023, 0, 1 + n.weekStart)))}`);
3761
3765
  const i = Se(e);
3762
3766
  return i && (t === "quarter" || t === "year") && a.push(`the fiscal year starting in ${r({ month: "long" }, new Date(Date.UTC(2e3, i - 1, 1)))}`), `${a.join(", ")}; each value is a bucket's start`;
3763
3767
  }
3764
- function vn(e) {
3768
+ function Mn(e) {
3765
3769
  if (!T(e))
3766
3770
  return {
3767
3771
  ok: !1,
@@ -3782,7 +3786,7 @@ function vn(e) {
3782
3786
  message: `Unknown property "${c}".`
3783
3787
  });
3784
3788
  if (o === "preset")
3785
- Qi(r.preset) || t.push({ path: "presentation.preset", message: "Expected a supported preset." });
3789
+ eo(r.preset) || t.push({ path: "presentation.preset", message: "Expected a supported preset." });
3786
3790
  else if (o === "pattern")
3787
3791
  if (typeof r.pattern != "string" || !r.pattern)
3788
3792
  t.push({ path: "presentation.pattern", message: "Expected a non-empty pattern." });
@@ -3848,18 +3852,18 @@ function vn(e) {
3848
3852
  }
3849
3853
  };
3850
3854
  }
3851
- function No(e, t) {
3855
+ function Eo(e, t) {
3852
3856
  const n = !!t.calendar.fiscalCalendar;
3853
- return e === "fiscal_quarter_short" || e === "fiscal_year" ? n : e === "quarter_short" || e === "quarter_long" || Nn(e) && (t.granularity === "quarter" || t.granularity === "year") ? !n : !0;
3857
+ return e === "fiscal_quarter_short" || e === "fiscal_year" ? n : e === "quarter_short" || e === "quarter_long" || En(e) && (t.granularity === "quarter" || t.granularity === "year") ? !n : !0;
3854
3858
  }
3855
- function Sn(e, t) {
3856
- return dn(e, t.granularity).ok ? e.presentation.mode === "preset" ? No(e.presentation.preset, t) : !(e.presentation.mode === "pattern" && t.calendar.fiscalCalendar && (t.granularity === "quarter" || t.granularity === "year")) : !1;
3859
+ function kn(e, t) {
3860
+ return yn(e, t.granularity).ok ? e.presentation.mode === "preset" ? Eo(e.presentation.preset, t) : !(e.presentation.mode === "pattern" && t.calendar.fiscalCalendar && (t.granularity === "quarter" || t.granularity === "year")) : !1;
3857
3861
  }
3858
- function Pt(e, t) {
3862
+ function zt(e, t) {
3859
3863
  if (!(!e || e.presentation.mode === "auto"))
3860
- return Sn(e, t) ? { type: "temporal_bucket", presentation: e.presentation } : void 0;
3864
+ return kn(e, t) ? { type: "temporal_bucket", presentation: e.presentation } : void 0;
3861
3865
  }
3862
- function Mn(e) {
3866
+ function _n(e) {
3863
3867
  var a;
3864
3868
  const t = Q(e.locale);
3865
3869
  if (!t)
@@ -3867,28 +3871,28 @@ function Mn(e) {
3867
3871
  "invalid_temporal_bucket_format",
3868
3872
  "Temporal bucket locale must be a supported base BCP 47 locale."
3869
3873
  );
3870
- const n = Pt(e.cardFormat, e.metadata);
3874
+ const n = zt(e.cardFormat, e.metadata);
3871
3875
  if (n)
3872
3876
  return { format: { ...n, locale: t }, source: "card" };
3873
- const r = ((a = e.semanticFormat) == null ? void 0 : a.granularity) === e.metadata.granularity ? Pt(e.semanticFormat.format, e.metadata) : void 0;
3877
+ const r = ((a = e.semanticFormat) == null ? void 0 : a.granularity) === e.metadata.granularity ? zt(e.semanticFormat.format, e.metadata) : void 0;
3874
3878
  return r ? { format: { ...r, locale: t }, source: "semantic" } : {
3875
3879
  format: {
3876
3880
  type: "temporal_bucket",
3877
3881
  locale: t,
3878
3882
  presentation: {
3879
3883
  mode: "auto",
3880
- styles: e.styles ?? Do
3884
+ styles: e.styles ?? bo
3881
3885
  }
3882
3886
  },
3883
3887
  source: "automatic"
3884
3888
  };
3885
3889
  }
3886
- function D(e, t = 2) {
3890
+ function x(e, t = 2) {
3887
3891
  return String(e).padStart(t, "0");
3888
3892
  }
3889
- function B(e, t, n) {
3893
+ function K(e, t, n) {
3890
3894
  if (t === "en-US")
3891
- return (n === "short" ? bo : xo)[e - 1];
3895
+ return (n === "short" ? vo : So)[e - 1];
3892
3896
  const r = new Date(Date.UTC(2e3, e - 1, 15));
3893
3897
  return new Intl.DateTimeFormat(t, {
3894
3898
  calendar: "gregory",
@@ -3896,50 +3900,50 @@ function B(e, t, n) {
3896
3900
  timeZone: "UTC"
3897
3901
  }).format(r);
3898
3902
  }
3899
- function $o(e, t, n) {
3903
+ function Io(e, t, n) {
3900
3904
  return t.map((r) => {
3901
3905
  if (r.kind === "literal") return r.value;
3902
3906
  switch (r.value) {
3903
3907
  case "YYYY":
3904
- return D(e.year, 4);
3908
+ return x(e.year, 4);
3905
3909
  case "YY":
3906
- return D(e.year % 100);
3910
+ return x(e.year % 100);
3907
3911
  case "MMMM":
3908
- return B(e.month, n, "long");
3912
+ return K(e.month, n, "long");
3909
3913
  case "MMM":
3910
- return B(e.month, n, "short");
3914
+ return K(e.month, n, "short");
3911
3915
  case "MM":
3912
- return D(e.month);
3916
+ return x(e.month);
3913
3917
  case "DD":
3914
- return D(e.day);
3918
+ return x(e.day);
3915
3919
  case "HH":
3916
- return D(e.hour);
3920
+ return x(e.hour);
3917
3921
  case "mm":
3918
- return D(e.minute);
3922
+ return x(e.minute);
3919
3923
  case "ss":
3920
- return D(e.second);
3924
+ return x(e.second);
3921
3925
  }
3922
3926
  }).join("");
3923
3927
  }
3924
- const Yt = /* @__PURE__ */ new Map();
3928
+ const At = /* @__PURE__ */ new Map();
3925
3929
  function Y(e, t) {
3926
- const n = `${e}:${JSON.stringify(t)}`, r = Yt.get(n);
3930
+ const n = `${e}:${JSON.stringify(t)}`, r = At.get(n);
3927
3931
  if (r) return r;
3928
3932
  const a = new Intl.DateTimeFormat(e, t);
3929
- return Yt.set(n, a), a;
3933
+ return At.set(n, a), a;
3930
3934
  }
3931
3935
  function G(e) {
3932
3936
  const t = /* @__PURE__ */ new Date(0);
3933
3937
  return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(e.hour, e.minute, e.second, 0), t;
3934
3938
  }
3935
- function zt(e, t, n) {
3939
+ function Rt(e, t, n) {
3936
3940
  return Y(t, {
3937
3941
  calendar: "gregory",
3938
3942
  dateStyle: n,
3939
3943
  timeZone: "UTC"
3940
3944
  }).format(G(e));
3941
3945
  }
3942
- function Eo(e, t, n) {
3946
+ function Oo(e, t, n) {
3943
3947
  return Y(t, {
3944
3948
  calendar: "gregory",
3945
3949
  dateStyle: n.dateStyle,
@@ -3949,7 +3953,7 @@ function Eo(e, t, n) {
3949
3953
  timeZone: "UTC"
3950
3954
  }).format(G(e));
3951
3955
  }
3952
- function Oo(e, t, n) {
3956
+ function Fo(e, t, n) {
3953
3957
  var a;
3954
3958
  if (n === "short") {
3955
3959
  const i = G(e), o = Y(t, {
@@ -3974,20 +3978,20 @@ function Oo(e, t, n) {
3974
3978
  year: "numeric"
3975
3979
  }).format(G(e));
3976
3980
  }
3977
- function kn(e, t) {
3981
+ function Nn(e, t) {
3978
3982
  return Math.floor((e.month - t + 12) % 12 / 3) + 1;
3979
3983
  }
3980
- function At(e, t) {
3984
+ function Ut(e, t) {
3981
3985
  return t === 1 || e.month < t ? e.year : e.year + 1;
3982
3986
  }
3983
- function _n(e) {
3987
+ function $n(e) {
3984
3988
  return e === 1 ? "1st" : e === 2 ? "2nd" : e === 3 ? "3rd" : `${e}th`;
3985
3989
  }
3986
- function Nn(e) {
3990
+ function En(e) {
3987
3991
  return e === "short" || e === "long" || e === "numeric" || e === "iso";
3988
3992
  }
3989
- function Ye(e, t, n) {
3990
- return t === "iso" ? `${D(e.year, 4)}-${D(e.month)}-${D(e.day)}` : Y(n, {
3993
+ function ze(e, t, n) {
3994
+ return t === "iso" ? `${x(e.year, 4)}-${x(e.month)}-${x(e.day)}` : Y(n, {
3991
3995
  calendar: "gregory",
3992
3996
  month: t === "numeric" ? "numeric" : t === "long" ? "long" : "short",
3993
3997
  day: "numeric",
@@ -3995,80 +3999,80 @@ function Ye(e, t, n) {
3995
3999
  timeZone: "UTC"
3996
4000
  }).format(G(e));
3997
4001
  }
3998
- function Io(e, t, n, r) {
3999
- const a = kn(e, 1);
4002
+ function Co(e, t, n, r) {
4003
+ const a = Nn(e, 1);
4000
4004
  switch (r) {
4001
4005
  case "week":
4002
- return t === "numeric" || t === "iso" ? Ye(e, t, n) : `Week of ${Ye(e, t, n)}`;
4006
+ return t === "numeric" || t === "iso" ? ze(e, t, n) : `Week of ${ze(e, t, n)}`;
4003
4007
  case "month":
4004
- return t === "iso" ? `${D(e.year, 4)}-${D(e.month)}` : t === "numeric" ? `${D(e.month)}/${D(e.year, 4)}` : `${B(e.month, n, t === "long" ? "long" : "short")} ${e.year}`;
4008
+ return t === "iso" ? `${x(e.year, 4)}-${x(e.month)}` : t === "numeric" ? `${x(e.month)}/${x(e.year, 4)}` : `${K(e.month, n, t === "long" ? "long" : "short")} ${e.year}`;
4005
4009
  case "quarter":
4006
- return t === "iso" ? `${D(e.year, 4)}-Q${a}` : t === "long" ? `${_n(a)} Quarter ${e.year}` : `Q${a} ${e.year}`;
4010
+ return t === "iso" ? `${x(e.year, 4)}-Q${a}` : t === "long" ? `${$n(a)} Quarter ${e.year}` : `Q${a} ${e.year}`;
4007
4011
  case "year":
4008
4012
  return String(e.year);
4009
4013
  default:
4010
- return Ye(e, t, n);
4014
+ return ze(e, t, n);
4011
4015
  }
4012
4016
  }
4013
- function je(e, t, n, r) {
4014
- if (Nn(t))
4015
- return Io(e, t, n, r.granularity);
4016
- const a = Se(r) ?? 1, i = kn(e, a);
4017
+ function He(e, t, n, r) {
4018
+ if (En(t))
4019
+ return Co(e, t, n, r.granularity);
4020
+ const a = Se(r) ?? 1, i = Nn(e, a);
4017
4021
  switch (t) {
4018
4022
  case "week_of_short":
4019
- return `Week of ${B(e.month, n, "short")} ${e.day}, ${e.year}`;
4023
+ return `Week of ${K(e.month, n, "short")} ${e.day}, ${e.year}`;
4020
4024
  case "week_of_long":
4021
- return `Week of ${B(e.month, n, "long")} ${e.day}, ${e.year}`;
4025
+ return `Week of ${K(e.month, n, "long")} ${e.day}, ${e.year}`;
4022
4026
  case "quarter_short":
4023
4027
  return `Q${i} ${e.year}`;
4024
4028
  case "quarter_long":
4025
- return `${_n(i)} Quarter ${e.year}`;
4029
+ return `${$n(i)} Quarter ${e.year}`;
4026
4030
  case "fiscal_quarter_short":
4027
- return `Q${i} FY${At(e, a)}`;
4031
+ return `Q${i} FY${Ut(e, a)}`;
4028
4032
  case "fiscal_year":
4029
- return `FY${At(e, a)}`;
4033
+ return `FY${Ut(e, a)}`;
4030
4034
  }
4031
4035
  }
4032
- function Fo(e, t, n, r) {
4036
+ function Po(e, t, n, r) {
4033
4037
  const a = Se(t);
4034
4038
  switch (t.granularity) {
4035
4039
  case "second":
4036
4040
  case "minute":
4037
4041
  case "hour":
4038
- return Eo(e, n, r.dateTime);
4042
+ return Oo(e, n, r.dateTime);
4039
4043
  case "day":
4040
- return zt(e, n, r.dateStyle);
4044
+ return Rt(e, n, r.dateStyle);
4041
4045
  case "week":
4042
- return `Week of ${zt(e, n, r.dateStyle)}`;
4046
+ return `Week of ${Rt(e, n, r.dateStyle)}`;
4043
4047
  case "month":
4044
- return Oo(e, n, r.dateStyle);
4048
+ return Fo(e, n, r.dateStyle);
4045
4049
  case "quarter":
4046
- return je(
4050
+ return He(
4047
4051
  e,
4048
4052
  a ? "fiscal_quarter_short" : "quarter_short",
4049
4053
  n,
4050
4054
  t
4051
4055
  );
4052
4056
  case "year":
4053
- return a ? je(e, "fiscal_year", n, t) : String(e.year);
4057
+ return a ? He(e, "fiscal_year", n, t) : String(e.year);
4054
4058
  }
4055
4059
  }
4056
- function Qs(e, t) {
4060
+ function nc(e, t) {
4057
4061
  if (t.granularity !== "second" && t.granularity !== "minute" && t.granularity !== "hour" && t.granularity !== "day" && t.granularity !== "month")
4058
4062
  return;
4059
- const n = xn(e, t);
4063
+ const n = Me(e, t);
4060
4064
  if (!n.ok || n.value === null) return;
4061
4065
  const { year: r, month: a, day: i, hour: o, minute: s, second: c } = n.value;
4062
4066
  return { year: r, month: a, day: i, hour: o, minute: s, second: c };
4063
4067
  }
4064
- function $n(e) {
4065
- const t = vn(e.format);
4066
- if (!t.ok || !Sn(t.value, e.metadata))
4068
+ function In(e) {
4069
+ const t = Mn(e.format);
4070
+ if (!t.ok || !kn(t.value, e.metadata))
4067
4071
  throw new fe(
4068
4072
  "invalid_temporal_bucket_format",
4069
4073
  "Resolved temporal bucket format is invalid or inapplicable to its metadata."
4070
4074
  );
4071
- const n = xn(e.value, e.metadata);
4075
+ const n = Me(e.value, e.metadata);
4072
4076
  if (!n.ok)
4073
4077
  throw new fe(
4074
4078
  n.error.code,
@@ -4077,14 +4081,14 @@ function $n(e) {
4077
4081
  if (n.value === null) return "(Blank)";
4078
4082
  const { presentation: r, locale: a } = t.value;
4079
4083
  if (r.mode === "auto")
4080
- return Fo(
4084
+ return Po(
4081
4085
  n.value,
4082
4086
  e.metadata,
4083
4087
  a,
4084
4088
  r.styles
4085
4089
  );
4086
4090
  if (r.mode === "preset")
4087
- return je(
4091
+ return He(
4088
4092
  n.value,
4089
4093
  r.preset,
4090
4094
  a,
@@ -4096,9 +4100,9 @@ function $n(e) {
4096
4100
  "invalid_temporal_bucket_format",
4097
4101
  i.message
4098
4102
  );
4099
- return $o(n.value, i.segments, a);
4103
+ return Io(n.value, i.segments, a);
4100
4104
  }
4101
- function Co(e, t) {
4105
+ function Yo(e, t) {
4102
4106
  var a;
4103
4107
  const n = e[e.length - 1];
4104
4108
  if (!n) return "";
@@ -4106,21 +4110,21 @@ function Co(e, t) {
4106
4110
  const r = n.member.value;
4107
4111
  return r === null ? "(Blank)" : ((a = t == null ? void 0 : t.get(n.levelId)) == null ? void 0 : a(r)) ?? (typeof r == "object" ? r.value : String(r));
4108
4112
  }
4109
- function Po(e, t, n) {
4110
- return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(Rn).join(t)) ?? `${t} Total` : t;
4113
+ function zo(e, t, n) {
4114
+ return e === "grand_total" ? n ?? "Grand Total" : e === "subtotal" ? (n == null ? void 0 : n.split(Ln).join(t)) ?? `${t} Total` : t;
4111
4115
  }
4112
- function Js(e, t, n, r) {
4116
+ function rc(e, t, n, r) {
4113
4117
  var o;
4114
4118
  const a = e[e.length - 1], i = t === "grand_total" ? n.grand.label : a ? (o = n.levels[a.levelId]) == null ? void 0 : o.label : void 0;
4115
- return Po(t, Co(e, r), i);
4119
+ return zo(t, Yo(e, r), i);
4116
4120
  }
4117
- function ec(e, t, n) {
4121
+ function ac(e, t, n) {
4118
4122
  return e.kind === "value" ? (t == null ? void 0 : t(e.value)) ?? "" : e.kind === "null" ? n.nullText : n.emptyText;
4119
4123
  }
4120
- function tc(e) {
4124
+ function ic(e) {
4121
4125
  const { path: t, previousPath: n, role: r, repeatLabels: a, levelCount: i } = e;
4122
4126
  return Array.from({ length: i }, (o, s) => {
4123
- const c = t.slice(0, s + 1), u = r === "grand_total" ? s === 0 : r === "subtotal" && s === t.length - 1, l = n && n.length > s && nt(n.slice(0, s + 1)) === nt(c);
4127
+ const c = t.slice(0, s + 1), u = r === "grand_total" ? s === 0 : r === "subtotal" && s === t.length - 1, l = n && n.length > s && rt(n.slice(0, s + 1)) === rt(c);
4124
4128
  return {
4125
4129
  path: c,
4126
4130
  total: u,
@@ -4128,42 +4132,42 @@ function tc(e) {
4128
4132
  };
4129
4133
  });
4130
4134
  }
4131
- function Yo(e) {
4132
- return (e == null ? void 0 : e.type) === "date" ? { type: "raw_temporal", timezone: e.timezone, sourceTimezone: e.sourceTimezone, presentation: ro(e) } : void 0;
4135
+ function Ao(e) {
4136
+ return (e == null ? void 0 : e.type) === "date" ? { type: "raw_temporal", timezone: e.timezone, sourceTimezone: e.sourceTimezone, presentation: io(e) } : void 0;
4133
4137
  }
4134
- function zo(e, t) {
4135
- return Ci(Be({ override: e, model: t }).format, {
4138
+ function Ro(e, t) {
4139
+ return Yi(Ge({ override: e, model: t }).format, {
4136
4140
  preserveOmittedProperties: !0,
4137
4141
  numericInput: "canonical"
4138
4142
  });
4139
4143
  }
4140
- function nc(e, t, n) {
4144
+ function oc(e, t, n) {
4141
4145
  const r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = (o, s) => {
4142
- const c = (s === "levels" ? t.levelFormats : t.measureFormats)[o.id], u = o.semanticFormat, l = zo(c, u);
4146
+ const c = (s === "levels" ? t.levelFormats : t.measureFormats)[o.id], u = o.semanticFormat, l = Ro(c, u);
4143
4147
  s === "measures" && r.set(o.id, {
4144
- isNumeric: An(o.column.dataType) === "number",
4148
+ isNumeric: Un(o.column.dataType) === "number",
4145
4149
  // Use normalized affixes: a redundant percent suffix is already removed.
4146
4150
  hasTextAffixes: !!l && !!("prefix" in l && l.prefix || "suffix" in l && l.suffix)
4147
4151
  });
4148
- const f = (m) => ln(m, void 0, {
4152
+ const f = (m) => dn(m, void 0, {
4149
4153
  useFormattedValues: !0,
4150
4154
  timezone: n.calendar.tz,
4151
4155
  locale: n.valueFormat.locale,
4152
4156
  absence: t.absence
4153
4157
  });
4154
4158
  if (o.column.temporalBucket) {
4155
- const m = o.column.temporalBucket, h = Mn({
4159
+ const m = o.column.temporalBucket, h = _n({
4156
4160
  metadata: m,
4157
4161
  cardFormat: (c == null ? void 0 : c.type) === "temporal_bucket" ? c : void 0,
4158
4162
  semanticFormat: (u == null ? void 0 : u.type) === "temporal_bucket" ? { granularity: m.granularity, format: u } : void 0,
4159
4163
  locale: n.valueFormat.locale,
4160
4164
  styles: { dateStyle: n.valueFormat.dateStyle, dateTime: n.valueFormat.dateTime }
4161
4165
  });
4162
- return (d) => typeof d == "string" ? $n({ value: d, metadata: m, format: h.format }) : f(d);
4166
+ return (d) => typeof d == "string" ? In({ value: d, metadata: m, format: h.format }) : f(d);
4163
4167
  }
4164
4168
  if (o.column.rawTemporal) {
4165
- const m = Be({ override: c, model: u }).format, { formatValue: h } = To({
4166
- authored: Yo(m),
4169
+ const m = Ge({ override: c, model: u }).format, { formatValue: h } = Do({
4170
+ authored: Ao(m),
4167
4171
  metadata: o.column.rawTemporal,
4168
4172
  preferences: n.valueFormat,
4169
4173
  calendar: n.calendar
@@ -4175,10 +4179,10 @@ function nc(e, t, n) {
4175
4179
  };
4176
4180
  }
4177
4181
  if (J(l)) {
4178
- const m = Ki(l, n.valueFormat);
4179
- return s === "measures" && a.set(o.id, m), (h) => typeof h == "number" || typeof h == "object" && h !== null ? Ze(h, m) : f(h);
4182
+ const m = Gi(l, n.valueFormat);
4183
+ return s === "measures" && a.set(o.id, m), (h) => typeof h == "number" || typeof h == "object" && h !== null ? Xe(h, m) : f(h);
4180
4184
  }
4181
- return (l == null ? void 0 : l.type) === "duration" && s === "measures" && a.set(o.id, l), (l == null ? void 0 : l.type) === "duration" ? (m) => typeof m == "number" || typeof m == "string" || typeof m == "object" && m !== null ? qt(
4185
+ return (l == null ? void 0 : l.type) === "duration" && s === "measures" && a.set(o.id, l), (l == null ? void 0 : l.type) === "duration" ? (m) => typeof m == "number" || typeof m == "string" || typeof m == "object" && m !== null ? Vt(
4182
4186
  typeof m == "object" ? m.value : m,
4183
4187
  l
4184
4188
  ) : f(m) : (l == null ? void 0 : l.type) === "string" ? (m) => m === null ? f(m) : `${l.prefix ?? ""}${f(m)}${l.suffix ?? ""}` : f;
@@ -4195,17 +4199,17 @@ function nc(e, t, n) {
4195
4199
  absence: t.absence
4196
4200
  };
4197
4201
  }
4198
- function rc(e, t) {
4202
+ function sc(e, t) {
4199
4203
  return t.levelLabels[e.id] ?? e.field.label ?? e.field.name;
4200
4204
  }
4201
- function ac(e, t) {
4205
+ function cc(e, t) {
4202
4206
  return t.measureLabels[e.id] ?? (e.kind === "aggregate" ? e.field.label ?? e.field.name : e.definition.label);
4203
4207
  }
4204
- function ic(e) {
4205
- return jn.parse(Ao(e));
4208
+ function uc(e) {
4209
+ return qn.parse(Uo(e));
4206
4210
  }
4207
- function Ao(e) {
4208
- const t = Un.parse(e), n = (r) => ({
4211
+ function Uo(e) {
4212
+ const t = Wn.parse(e), n = (r) => ({
4209
4213
  grand: { visible: !0, position: "after" },
4210
4214
  levels: Object.fromEntries(
4211
4215
  r.map((a) => [
@@ -4214,7 +4218,7 @@ function Ao(e) {
4214
4218
  ])
4215
4219
  )
4216
4220
  });
4217
- return Ln.parse({
4221
+ return jn.parse({
4218
4222
  version: 1,
4219
4223
  spec: t,
4220
4224
  presentation: {
@@ -4232,14 +4236,14 @@ function Ao(e) {
4232
4236
  }
4233
4237
  });
4234
4238
  }
4235
- function Ro(e, t) {
4239
+ function Lo(e, t) {
4236
4240
  const n = new Map(e.map((r) => [X(r), r]));
4237
4241
  for (const r of t ?? []) n.set(X(r), r);
4238
4242
  return [...n.values()];
4239
4243
  }
4240
- function oc(e) {
4241
- const { spec: t, presentation: n, defaults: r, session: a } = Wn.parse(e), i = new Map(
4242
- Ro(t.sorts, a == null ? void 0 : a.sorts).map((s) => [X(s), s])
4244
+ function lc(e) {
4245
+ const { spec: t, presentation: n, defaults: r, session: a } = Hn.parse(e), i = new Map(
4246
+ Lo(t.sorts, a == null ? void 0 : a.sorts).map((s) => [X(s), s])
4243
4247
  );
4244
4248
  for (const s of ["rows", "columns"])
4245
4249
  for (const c of t[s]) {
@@ -4273,7 +4277,7 @@ function oc(e) {
4273
4277
  }
4274
4278
  };
4275
4279
  }
4276
- class Rt extends Error {
4280
+ class Lt extends Error {
4277
4281
  constructor(n) {
4278
4282
  super(
4279
4283
  `invalid_presentation_execution_snapshot: ${n} Resave this report before running it again.`
@@ -4283,7 +4287,7 @@ class Rt extends Error {
4283
4287
  this.name = "PresentationExecutionSnapshotError";
4284
4288
  }
4285
4289
  }
4286
- class sc extends Error {
4290
+ class mc extends Error {
4287
4291
  constructor(n) {
4288
4292
  super(
4289
4293
  `missing_resolved_raw_temporal_format: Column "${n}" has no captured presentation. Resave this report before running it again.`
@@ -4293,15 +4297,15 @@ class sc extends Error {
4293
4297
  this.name = "MissingResolvedRawTemporalFormatError";
4294
4298
  }
4295
4299
  }
4296
- function I(e, t, n) {
4300
+ function O(e, t, n) {
4297
4301
  const r = new Set(t), a = Object.keys(e).find((i) => !r.has(i));
4298
4302
  if (a)
4299
4303
  throw new Error(`${n} contains unknown property "${a}"`);
4300
4304
  }
4301
- function Uo(e, t = "scope") {
4305
+ function Wo(e, t = "scope") {
4302
4306
  if (!T(e))
4303
4307
  throw new Error(`${t} must be an object`);
4304
- I(
4308
+ O(
4305
4309
  e,
4306
4310
  ["dashboardId", "cardId", "attachmentIndex"],
4307
4311
  t
@@ -4325,13 +4329,13 @@ function Uo(e, t = "scope") {
4325
4329
  }
4326
4330
  function z(e, t, n, r) {
4327
4331
  if (e.kind !== t) return;
4328
- I(e, ["kind", n], r);
4332
+ O(e, ["kind", n], r);
4329
4333
  const a = e[n];
4330
4334
  if (typeof a != "string" || !a.trim())
4331
4335
  throw new Error(`${r}.${n} is required`);
4332
4336
  return a;
4333
4337
  }
4334
- function ze(e, t) {
4338
+ function Ae(e, t) {
4335
4339
  if (!T(e))
4336
4340
  throw new Error(`${t} must be an object`);
4337
4341
  const n = z(e, "metric", "metricId", t);
@@ -4347,7 +4351,7 @@ function ze(e, t) {
4347
4351
  if (a) return { kind: "matrix_measure", measureId: a };
4348
4352
  throw new Error(`${t} is not a valid numeric presentation target`);
4349
4353
  }
4350
- const Lo = [
4354
+ const jo = [
4351
4355
  "type",
4352
4356
  "inputUnit",
4353
4357
  "outputStyle",
@@ -4358,12 +4362,12 @@ const Lo = [
4358
4362
  "suffix",
4359
4363
  "negativeStyle"
4360
4364
  ];
4361
- function Wo(e) {
4365
+ function Ho(e) {
4362
4366
  return e === "millisecond" || e === "second" || e === "minute" || e === "hour" || e === "day";
4363
4367
  }
4364
- const jo = ["type", "locale", "pattern", "timezone", "sourceTimezone"];
4365
- function Ho(e, t) {
4366
- if (I(e, jo, t), typeof e.locale != "string" || !e.locale.trim())
4368
+ const qo = ["type", "locale", "pattern", "timezone", "sourceTimezone"];
4369
+ function Zo(e, t) {
4370
+ if (O(e, qo, t), typeof e.locale != "string" || !e.locale.trim())
4367
4371
  throw new Error(`${t}.locale must be a non-empty string`);
4368
4372
  for (const n of ["pattern", "timezone", "sourceTimezone"])
4369
4373
  if (e[n] !== void 0 && typeof e[n] != "string")
@@ -4376,10 +4380,10 @@ function Ho(e, t) {
4376
4380
  ...typeof e.sourceTimezone == "string" ? { sourceTimezone: e.sourceTimezone } : {}
4377
4381
  };
4378
4382
  }
4379
- function qo(e, t) {
4380
- I(e, Lo, t);
4383
+ function Xo(e, t) {
4384
+ O(e, jo, t);
4381
4385
  for (const i of ["inputUnit", "largestUnit", "smallestUnit"])
4382
- if (e[i] !== void 0 && !Wo(e[i]))
4386
+ if (e[i] !== void 0 && !Ho(e[i]))
4383
4387
  throw new Error(`${t}.${i} must be a duration unit`);
4384
4388
  const n = e.outputStyle;
4385
4389
  if (n !== void 0 && n !== "compact" && n !== "digital" && n !== "long")
@@ -4405,11 +4409,11 @@ function qo(e, t) {
4405
4409
  ...a !== void 0 ? { negativeStyle: a } : {}
4406
4410
  };
4407
4411
  }
4408
- function Zo(e, t) {
4412
+ function Vo(e, t) {
4409
4413
  if (!T(e))
4410
4414
  throw new Error(`${t} must be an object`);
4411
4415
  if (e.kind === "field") {
4412
- I(e, ["kind", "fieldId", "role"], t);
4416
+ O(e, ["kind", "fieldId", "role"], t);
4413
4417
  const a = typeof e.fieldId == "string" ? e.fieldId.trim() : "";
4414
4418
  if (!a)
4415
4419
  throw new Error(`${t}.fieldId is required`);
@@ -4433,7 +4437,7 @@ function Zo(e, t) {
4433
4437
  if (r) return { kind: "matrix_axis", axisInstanceId: r };
4434
4438
  throw new Error(`${t} is not a valid temporal bucket presentation target`);
4435
4439
  }
4436
- function Xo(e, t) {
4440
+ function Bo(e, t) {
4437
4441
  if (!T(e))
4438
4442
  throw new Error(`${t} must be an object`);
4439
4443
  const n = z(e, "column", "columnKey", t);
@@ -4441,14 +4445,14 @@ function Xo(e, t) {
4441
4445
  throw new Error(`${t} must identify a column`);
4442
4446
  return { kind: "column", columnKey: n };
4443
4447
  }
4444
- function Vo(e) {
4448
+ function Ko(e) {
4445
4449
  return [
4446
4450
  e.dashboardId,
4447
4451
  e.cardId ?? null,
4448
4452
  e.attachmentIndex ?? null
4449
4453
  ];
4450
4454
  }
4451
- function xe(e) {
4455
+ function be(e) {
4452
4456
  switch (e.kind) {
4453
4457
  case "metric":
4454
4458
  return [e.kind, e.metricId];
@@ -4466,10 +4470,10 @@ function U(e, t) {
4466
4470
  return e.dashboardId === t.dashboardId && e.cardId === t.cardId && e.attachmentIndex === t.attachmentIndex;
4467
4471
  }
4468
4472
  function L(e, t) {
4469
- const n = xe(e), r = xe(t);
4473
+ const n = be(e), r = be(t);
4470
4474
  return n.length === r.length && n.every((a, i) => a === r[i]);
4471
4475
  }
4472
- function Ko(e) {
4476
+ function Go(e) {
4473
4477
  if (!Array.isArray(e))
4474
4478
  throw new Error("resolvedFormats must be an array");
4475
4479
  const t = /* @__PURE__ */ new Set();
@@ -4478,21 +4482,21 @@ function Ko(e) {
4478
4482
  const a = `resolvedFormats.${r}`;
4479
4483
  if (!T(n))
4480
4484
  throw new Error(`${a} must be an object`);
4481
- I(n, ["scope", "target", "format"], a);
4482
- const i = Uo(n.scope, `${a}.scope`);
4485
+ O(n, ["scope", "target", "format"], a);
4486
+ const i = Wo(n.scope, `${a}.scope`);
4483
4487
  if (!T(n.format))
4484
4488
  throw new Error(`${a}.format must be an object`);
4485
4489
  let o;
4486
4490
  switch (n.format.type) {
4487
4491
  case "temporal_bucket": {
4488
- const l = vn(n.format);
4492
+ const l = Mn(n.format);
4489
4493
  if (!l.ok)
4490
4494
  throw new Error(
4491
4495
  `${a}.format is invalid: ${((c = l.issues[0]) == null ? void 0 : c.message) ?? "invalid value"}`
4492
4496
  );
4493
4497
  o = {
4494
4498
  scope: i,
4495
- target: Zo(n.target, `${a}.target`),
4499
+ target: Vo(n.target, `${a}.target`),
4496
4500
  format: l.value
4497
4501
  };
4498
4502
  break;
@@ -4500,42 +4504,42 @@ function Ko(e) {
4500
4504
  case "raw_temporal":
4501
4505
  o = {
4502
4506
  scope: i,
4503
- target: Xo(n.target, `${a}.target`),
4504
- format: Ge(n.format)
4507
+ target: Bo(n.target, `${a}.target`),
4508
+ format: Qe(n.format)
4505
4509
  };
4506
4510
  break;
4507
4511
  case "number":
4508
4512
  case "currency":
4509
4513
  case "percent":
4510
4514
  case "scientific": {
4511
- const l = Zi(n.format);
4515
+ const l = Vi(n.format);
4512
4516
  if (!l.ok)
4513
4517
  throw new Error(
4514
4518
  `${a}.format is invalid: ${((u = l.issues[0]) == null ? void 0 : u.message) ?? "invalid value"}`
4515
4519
  );
4516
4520
  o = {
4517
4521
  scope: i,
4518
- target: ze(n.target, `${a}.target`),
4522
+ target: Ae(n.target, `${a}.target`),
4519
4523
  format: l.value
4520
4524
  };
4521
4525
  break;
4522
4526
  }
4523
4527
  case "date": {
4524
- const l = ze(n.target, `${a}.target`);
4528
+ const l = Ae(n.target, `${a}.target`);
4525
4529
  if (l.kind !== "column")
4526
4530
  throw new Error(`${a}.target must identify a column for a date format`);
4527
4531
  o = {
4528
4532
  scope: i,
4529
4533
  target: l,
4530
- format: Ho(n.format, `${a}.format`)
4534
+ format: Zo(n.format, `${a}.format`)
4531
4535
  };
4532
4536
  break;
4533
4537
  }
4534
4538
  case "duration":
4535
4539
  o = {
4536
4540
  scope: i,
4537
- target: ze(n.target, `${a}.target`),
4538
- format: qo(
4541
+ target: Ae(n.target, `${a}.target`),
4542
+ format: Xo(
4539
4543
  n.format,
4540
4544
  `${a}.format`
4541
4545
  )
@@ -4545,8 +4549,8 @@ function Ko(e) {
4545
4549
  throw new Error(`${a}.format.type is unsupported`);
4546
4550
  }
4547
4551
  const s = JSON.stringify([
4548
- ...Vo(o.scope),
4549
- ...xe(o.target)
4552
+ ...Ko(o.scope),
4553
+ ...be(o.target)
4550
4554
  ]);
4551
4555
  if (t.has(s))
4552
4556
  throw new Error(
@@ -4555,17 +4559,17 @@ function Ko(e) {
4555
4559
  return t.add(s), o;
4556
4560
  });
4557
4561
  }
4558
- function Bo(e) {
4562
+ function Qo(e) {
4559
4563
  try {
4560
4564
  if (!T(e))
4561
4565
  throw new Error("presentation execution snapshot must be an object");
4562
- if (I(
4566
+ if (O(
4563
4567
  e,
4564
4568
  ["version", "reportContext", "resolvedFormats"],
4565
4569
  "presentation execution snapshot"
4566
4570
  ), e.version !== 1)
4567
4571
  throw new Error("presentation execution snapshot version must be 1");
4568
- const t = qn(e.reportContext);
4572
+ const t = Xn(e.reportContext);
4569
4573
  if (!t.ok) {
4570
4574
  const n = t.issues[0];
4571
4575
  throw new Error(
@@ -4575,22 +4579,22 @@ function Bo(e) {
4575
4579
  return {
4576
4580
  version: 1,
4577
4581
  reportContext: t.value,
4578
- resolvedFormats: Ko(e.resolvedFormats)
4582
+ resolvedFormats: Go(e.resolvedFormats)
4579
4583
  };
4580
4584
  } catch (t) {
4581
- throw t instanceof Rt ? t : new Rt(
4585
+ throw t instanceof Lt ? t : new Lt(
4582
4586
  t instanceof Error ? t.message : "Snapshot is invalid."
4583
4587
  );
4584
4588
  }
4585
4589
  }
4586
- function Go(e) {
4587
- return Bo({
4590
+ function Jo(e) {
4591
+ return Qo({
4588
4592
  version: 1,
4589
4593
  reportContext: e.reportContext,
4590
4594
  resolvedFormats: [...e.resolvedFormats]
4591
4595
  });
4592
4596
  }
4593
- function cc(e, t) {
4597
+ function fc(e, t) {
4594
4598
  const n = t.filter(
4595
4599
  (r, a) => !e.resolvedFormats.some(
4596
4600
  (i) => U(i.scope, r.scope) && L(i.target, r.target)
@@ -4599,40 +4603,40 @@ function cc(e, t) {
4599
4603
  (i) => U(i.scope, r.scope) && L(i.target, r.target)
4600
4604
  ) === a
4601
4605
  );
4602
- return n.length === 0 ? e : Go({
4606
+ return n.length === 0 ? e : Jo({
4603
4607
  reportContext: e.reportContext,
4604
4608
  resolvedFormats: [...e.resolvedFormats, ...n]
4605
4609
  });
4606
4610
  }
4607
- function uc(e) {
4608
- const t = Qo(e);
4611
+ function dc(e) {
4612
+ const t = es(e);
4609
4613
  return J(t) ? t : void 0;
4610
4614
  }
4611
- function Qo(e) {
4615
+ function es(e) {
4612
4616
  const t = e.snapshot.resolvedFormats.find(
4613
4617
  (n) => n.format.type !== "temporal_bucket" && n.format.type !== "raw_temporal" && n.format.type !== "date" && U(n.scope, e.scope) && L(n.target, e.target)
4614
4618
  );
4615
4619
  return t == null ? void 0 : t.format;
4616
4620
  }
4617
- function lc(e) {
4621
+ function hc(e) {
4618
4622
  const t = e.snapshot.resolvedFormats.find(
4619
4623
  (n) => n.format.type === "date" && U(n.scope, e.scope) && L(n.target, e.target)
4620
4624
  );
4621
4625
  return t == null ? void 0 : t.format;
4622
4626
  }
4623
- function mc(e) {
4627
+ function gc(e) {
4624
4628
  const t = e.snapshot.resolvedFormats.find(
4625
4629
  (n) => n.format.type === "raw_temporal" && U(n.scope, e.scope) && L(n.target, e.target)
4626
4630
  );
4627
4631
  return t == null ? void 0 : t.format;
4628
4632
  }
4629
- function fc(e) {
4633
+ function yc(e) {
4630
4634
  const t = e.snapshot.resolvedFormats.find(
4631
4635
  (n) => n.format.type === "temporal_bucket" && U(n.scope, e.scope) && L(n.target, e.target)
4632
4636
  );
4633
4637
  return t == null ? void 0 : t.format;
4634
4638
  }
4635
- function dc(e) {
4639
+ function wc(e) {
4636
4640
  var a;
4637
4641
  const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
4638
4642
  if (e.snapshot.resolvedFormats.forEach((i, o) => {
@@ -4645,7 +4649,7 @@ function dc(e) {
4645
4649
  `resolvedFormats.${o}.scope must match the executing dashboard/card`
4646
4650
  );
4647
4651
  if (i.target.kind === "field" && i.format.type === "temporal_bucket") {
4648
- const s = JSON.stringify(xe(i.target));
4652
+ const s = JSON.stringify(be(i.target));
4649
4653
  if (n.has(s))
4650
4654
  throw new Error(
4651
4655
  `resolvedFormats.${o} duplicates export field "${i.target.fieldId}"`
@@ -4673,75 +4677,75 @@ function dc(e) {
4673
4677
  `resolvedFormats is missing visible export column "${r}"`
4674
4678
  );
4675
4679
  }
4676
- const Jo = /* @__PURE__ */ new Set(["short", "medium", "long"]), es = /^(\d{4})-(\d{2})-(\d{2})$/, ts = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, ns = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, Je = " – ";
4677
- function hc(e) {
4680
+ const ts = /* @__PURE__ */ new Set(["short", "medium", "long"]), ns = /^(\d{4})-(\d{2})-(\d{2})$/, rs = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?$/, as = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,9})?)?(?:Z|[+-]\d{2}:\d{2})$/, et = " – ";
4681
+ function pc(e) {
4678
4682
  if (!T(e)) return;
4679
4683
  const t = Object.keys(e);
4680
4684
  if (e.mode === "period_label" && t.length === 1)
4681
4685
  return { mode: "period_label" };
4682
- if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && Jo.has(e.dateStyle))
4686
+ if (e.mode === "style" && t.length === 2 && typeof e.dateStyle == "string" && ts.has(e.dateStyle))
4683
4687
  return { mode: "style", dateStyle: e.dateStyle };
4684
- if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && rs(e.pattern) === null)
4688
+ if (e.mode === "pattern" && t.length === 3 && e.dialect === "semaphor_tokens" && typeof e.pattern == "string" && is(e.pattern) === null)
4685
4689
  return {
4686
4690
  mode: "pattern",
4687
4691
  dialect: "semaphor_tokens",
4688
4692
  pattern: e.pattern
4689
4693
  };
4690
4694
  }
4691
- function rs(e) {
4695
+ function is(e) {
4692
4696
  try {
4693
- return fo({ dialect: "semaphor_tokens", pattern: e }), null;
4697
+ return go({ dialect: "semaphor_tokens", pattern: e }), null;
4694
4698
  } catch (t) {
4695
4699
  return t instanceof Error ? t.message : "The pattern is invalid.";
4696
4700
  }
4697
4701
  }
4698
- function gc(e) {
4702
+ function Tc(e) {
4699
4703
  const { value: t, part: n, presentation: r, preferences: a, calendar: i } = e;
4700
4704
  if ((r == null ? void 0 : r.mode) === "period_label" && t.periodLabel && n === "range")
4701
4705
  return { ok: !0, text: t.periodLabel };
4702
4706
  const [o, s] = t.bounds, u = s === void 0 || n === "start" ? [{ raw: o, role: "start" }] : n === "end" ? [{ raw: s, role: "end" }] : [
4703
4707
  { raw: o, role: "start" },
4704
4708
  { raw: s, role: "end" }
4705
- ], l = u.map(({ raw: d }) => ss(d, i.tz));
4709
+ ], l = u.map(({ raw: d }) => us(d, i.tz));
4706
4710
  if (l.some((d) => d === null))
4707
4711
  return {
4708
4712
  ok: !1,
4709
- text: u.map(({ raw: d }) => d).join(Je),
4713
+ text: u.map(({ raw: d }) => d).join(et),
4710
4714
  diagnostic: {
4711
4715
  code: "invalid_temporal_input_value",
4712
4716
  message: "A date input bound is not a date or an instant."
4713
4717
  }
4714
4718
  };
4715
4719
  const f = t.precision === "day" ? l.map(
4716
- (d, S) => us(d, u[S].role, i.tz)
4720
+ (d, S) => ms(d, u[S].role, i.tz)
4717
4721
  ) : [], m = f.length > 0 && f.every((d) => d !== null) ? f : null;
4718
- return { ok: !0, text: m ? as(m, r, a, i) : is(
4719
- l.map((d) => cs(d, i.tz)),
4722
+ return { ok: !0, text: m ? os(m, r, a, i) : ss(
4723
+ l.map((d) => ls(d, i.tz)),
4720
4724
  r,
4721
4725
  a,
4722
4726
  i
4723
4727
  ) };
4724
4728
  }
4725
- function as(e, t, n, r) {
4729
+ function os(e, t, n, r) {
4726
4730
  const [a, i = a] = e;
4727
4731
  if ((t == null ? void 0 : t.mode) === "pattern")
4728
- return In(
4732
+ return Cn(
4729
4733
  e.map(
4730
- (c) => On(He(c), "date", t.pattern, n, r)
4734
+ (c) => Fn(qe(c), "date", t.pattern, n, r)
4731
4735
  )
4732
4736
  );
4733
4737
  const o = (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : n.dateStyle;
4734
4738
  if (!t || t.mode === "period_label") {
4735
- const c = ls(a, i, r);
4739
+ const c = fs(a, i, r);
4736
4740
  if (c)
4737
- return $n({
4738
- value: He(a),
4741
+ return In({
4742
+ value: qe(a),
4739
4743
  metadata: {
4740
4744
  kind: "temporal_bucket",
4741
4745
  granularity: c,
4742
4746
  calendar: { tz: r.tz, weekStart: r.weekStart ?? 1 }
4743
4747
  },
4744
- format: Mn({
4748
+ format: _n({
4745
4749
  metadata: {
4746
4750
  kind: "temporal_bucket",
4747
4751
  granularity: c,
@@ -4757,13 +4761,13 @@ function as(e, t, n, r) {
4757
4761
  timeZone: "UTC",
4758
4762
  dateStyle: o
4759
4763
  });
4760
- return fs(a, i) ? s.format(de(a)) : En(s, de(a), de(i));
4764
+ return hs(a, i) ? s.format(de(a)) : On(s, de(a), de(i));
4761
4765
  }
4762
- function is(e, t, n, r) {
4766
+ function ss(e, t, n, r) {
4763
4767
  if ((t == null ? void 0 : t.mode) === "pattern")
4764
- return In(
4768
+ return Cn(
4765
4769
  e.map(
4766
- (s) => On(
4770
+ (s) => Fn(
4767
4771
  s.toISOString(),
4768
4772
  "instant",
4769
4773
  t.pattern,
@@ -4778,14 +4782,14 @@ function is(e, t, n, r) {
4778
4782
  dateStyle: (t == null ? void 0 : t.mode) === "style" ? t.dateStyle : n.dateTime.dateStyle,
4779
4783
  timeStyle: n.dateTime.timeStyle
4780
4784
  }), [i, o] = e;
4781
- return o && o.getTime() !== i.getTime() ? En(a, i, o) : a.format(i);
4785
+ return o && o.getTime() !== i.getTime() ? On(a, i, o) : a.format(i);
4782
4786
  }
4783
- function En(e, t, n) {
4787
+ function On(e, t, n) {
4784
4788
  const r = e;
4785
- return typeof r.formatRange == "function" ? r.formatRange(t, n) : `${e.format(t)}${Je}${e.format(n)}`;
4789
+ return typeof r.formatRange == "function" ? r.formatRange(t, n) : `${e.format(t)}${et}${e.format(n)}`;
4786
4790
  }
4787
- function On(e, t, n, r, a) {
4788
- const i = yn({
4791
+ function Fn(e, t, n, r, a) {
4792
+ const i = Tn({
4789
4793
  format: {
4790
4794
  type: "raw_temporal",
4791
4795
  presentation: { mode: "pattern", dialect: "semaphor_tokens", pattern: n }
@@ -4793,56 +4797,56 @@ function On(e, t, n, r, a) {
4793
4797
  // Temporal formatting reads no currency.
4794
4798
  preferences: {
4795
4799
  ...r,
4796
- defaultCurrency: Zn.defaultCurrency
4800
+ defaultCurrency: Vn.defaultCurrency
4797
4801
  },
4798
4802
  calendar: { tz: a.tz }
4799
- }), o = t === "date" && os(n) ? "instant" : t;
4800
- return wo({
4803
+ }), o = t === "date" && cs(n) ? "instant" : t;
4804
+ return xo({
4801
4805
  value: o === t ? e : te(`${e}T00:00:00`, a.tz).toISOString(),
4802
4806
  metadata: { kind: "raw_temporal", valueKind: o },
4803
4807
  format: i
4804
4808
  }).text;
4805
4809
  }
4806
- function os(e) {
4810
+ function cs(e) {
4807
4811
  return /HH|mm|ss/.test(e);
4808
4812
  }
4809
- function In(e) {
4810
- return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(Je);
4813
+ function Cn(e) {
4814
+ return e[1] === void 0 || e[0] === e[1] ? e[0] : e.join(et);
4811
4815
  }
4812
- function ss(e, t) {
4813
- const n = es.exec(e);
4816
+ function us(e, t) {
4817
+ const n = ns.exec(e);
4814
4818
  if (n) {
4815
4819
  const a = {
4816
4820
  year: Number(n[1]),
4817
4821
  month: Number(n[2]),
4818
4822
  day: Number(n[3])
4819
4823
  };
4820
- return ds(a) ? { kind: "date", date: a } : null;
4824
+ return gs(a) ? { kind: "date", date: a } : null;
4821
4825
  }
4822
- const r = ns.test(e) ? new Date(e.replace(" ", "T")) : ts.test(e) ? te(e.replace(" ", "T"), t) : null;
4826
+ const r = as.test(e) ? new Date(e.replace(" ", "T")) : rs.test(e) ? te(e.replace(" ", "T"), t) : null;
4823
4827
  return r && !Number.isNaN(r.getTime()) ? { kind: "instant", instant: r } : null;
4824
4828
  }
4825
- function cs(e, t) {
4826
- return e.kind === "instant" ? e.instant : te(`${He(e.date)}T00:00:00`, t);
4829
+ function ls(e, t) {
4830
+ return e.kind === "instant" ? e.instant : te(`${qe(e.date)}T00:00:00`, t);
4827
4831
  }
4828
- function us(e, t, n) {
4832
+ function ms(e, t, n) {
4829
4833
  if (e.kind === "date") return e.date;
4830
- const r = Bn(e.instant, n), a = { year: r.year, month: r.month, day: r.day };
4831
- if (r.hour === 0 && r.minute === 0 && r.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? a : ms(a, -1);
4834
+ const r = Jn(e.instant, n), a = { year: r.year, month: r.month, day: r.day };
4835
+ if (r.hour === 0 && r.minute === 0 && r.second === 0 && e.instant.getUTCMilliseconds() === 0) return t === "start" ? a : ds(a, -1);
4832
4836
  const o = r.hour === 23 && r.minute === 59 && r.second === 59;
4833
4837
  return t === "end" && o ? a : null;
4834
4838
  }
4835
- function ls(e, t, n) {
4836
- return n.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== Fn(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;
4839
+ function fs(e, t, n) {
4840
+ return n.fiscalCalendar || e.day !== 1 || e.year !== t.year || t.day !== Pn(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;
4837
4841
  }
4838
- function He(e) {
4842
+ function qe(e) {
4839
4843
  return `${String(e.year).padStart(4, "0")}-${String(e.month).padStart(2, "0")}-${String(e.day).padStart(2, "0")}`;
4840
4844
  }
4841
4845
  function de(e) {
4842
4846
  const t = /* @__PURE__ */ new Date(0);
4843
4847
  return t.setUTCFullYear(e.year, e.month - 1, e.day), t.setUTCHours(0, 0, 0, 0), t;
4844
4848
  }
4845
- function ms(e, t) {
4849
+ function ds(e, t) {
4846
4850
  const n = de(e);
4847
4851
  return n.setUTCDate(n.getUTCDate() + t), {
4848
4852
  year: n.getUTCFullYear(),
@@ -4850,150 +4854,151 @@ function ms(e, t) {
4850
4854
  day: n.getUTCDate()
4851
4855
  };
4852
4856
  }
4853
- function fs(e, t) {
4857
+ function hs(e, t) {
4854
4858
  return e.year === t.year && e.month === t.month && e.day === t.day;
4855
4859
  }
4856
- function Fn(e, t) {
4860
+ function Pn(e, t) {
4857
4861
  return new Date(Date.UTC(e, t, 0)).getUTCDate();
4858
4862
  }
4859
- function ds(e) {
4860
- return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= Fn(e.year, e.month);
4863
+ function gs(e) {
4864
+ return e.year >= 1 && e.month >= 1 && e.month <= 12 && e.day >= 1 && e.day <= Pn(e.year, e.month);
4861
4865
  }
4862
- function yc(e) {
4866
+ function xc(e) {
4863
4867
  const t = /* @__PURE__ */ new Map();
4864
4868
  return e.forEach((n) => {
4865
4869
  n.id && t.set(n.id, (t.get(n.id) ?? 0) + 1);
4866
4870
  }), e.flatMap(
4867
- (n) => n.id && (t.get(n.id) ?? 0) > 1 ? [Gn(n)] : []
4871
+ (n) => n.id && (t.get(n.id) ?? 0) > 1 ? [er(n)] : []
4868
4872
  );
4869
4873
  }
4870
4874
  export {
4871
- Uo as $,
4872
- Cs as A,
4873
- Ys as B,
4874
- zs as C,
4875
- mn as D,
4876
- As as E,
4877
- bi as F,
4878
- Rs as G,
4879
- xi as H,
4880
- Us as I,
4881
- De as J,
4875
+ Wo as $,
4876
+ Ys as A,
4877
+ As as B,
4878
+ Rs as C,
4879
+ hn as D,
4880
+ Us as E,
4881
+ Si as F,
4882
+ Ls as G,
4883
+ Mi as H,
4884
+ Ws as I,
4885
+ xe as J,
4882
4886
  P as K,
4883
- Ls as L,
4884
- Ps as M,
4885
- Ws as N,
4886
- ki as O,
4887
- _i as P,
4888
- js as Q,
4889
- Ni as R,
4890
- Hs as S,
4891
- nc as T,
4892
- qi as U,
4893
- Zi as V,
4894
- Zs as W,
4895
- Xi as X,
4896
- Ki as Y,
4897
- Rt as Z,
4898
- sc as _,
4899
- Qo as a,
4900
- ka as a$,
4901
- Ko as a0,
4902
- Bo as a1,
4903
- Go as a2,
4904
- cc as a3,
4905
- uc as a4,
4906
- lc as a5,
4907
- mc as a6,
4908
- fc as a7,
4909
- dc as a8,
4910
- Bi as a9,
4911
- yc as aA,
4912
- oc as aB,
4913
- Ms as aC,
4914
- Co as aD,
4915
- Js as aE,
4916
- tc as aF,
4917
- ec as aG,
4918
- rc as aH,
4919
- un as aI,
4920
- $s as aJ,
4921
- Ei as aK,
4922
- ac as aL,
4923
- ic as aM,
4924
- Ao as aN,
4925
- Ro as aO,
4926
- Xe as aP,
4927
- j as aQ,
4928
- nn as aR,
4929
- ue as aS,
4930
- p as aT,
4931
- br as aU,
4932
- pe as aV,
4933
- ct as aW,
4934
- ie as aX,
4935
- Ns as aY,
4936
- Jt as aZ,
4937
- pr as a_,
4938
- Qi as aa,
4887
+ js as L,
4888
+ zs as M,
4889
+ Hs as N,
4890
+ $i as O,
4891
+ Ei as P,
4892
+ qs as Q,
4893
+ Ii as R,
4894
+ Zs as S,
4895
+ oc as T,
4896
+ Xi as U,
4897
+ Vi as V,
4898
+ Vs as W,
4899
+ Bi as X,
4900
+ Gi as Y,
4901
+ Lt as Z,
4902
+ mc as _,
4903
+ es as a,
4904
+ xr as a$,
4905
+ Go as a0,
4906
+ Qo as a1,
4907
+ Jo as a2,
4908
+ fc as a3,
4909
+ dc as a4,
4910
+ hc as a5,
4911
+ gc as a6,
4912
+ yc as a7,
4913
+ wc as a8,
4914
+ Qi as a9,
4915
+ is as aA,
4916
+ Tc as aB,
4917
+ xc as aC,
4918
+ lc as aD,
4919
+ _s as aE,
4920
+ Yo as aF,
4921
+ rc as aG,
4922
+ ic as aH,
4923
+ ac as aI,
4924
+ sc as aJ,
4925
+ fn as aK,
4926
+ Is as aL,
4927
+ cc as aM,
4928
+ uc as aN,
4929
+ Uo as aO,
4930
+ Lo as aP,
4931
+ Ve as aQ,
4932
+ j as aR,
4933
+ on as aS,
4934
+ ue as aT,
4935
+ w as aU,
4936
+ Sr as aV,
4937
+ we as aW,
4938
+ lt as aX,
4939
+ ie as aY,
4940
+ Es as aZ,
4941
+ nn as a_,
4942
+ eo as aa,
4939
4943
  ne as ab,
4940
- dn as ac,
4941
- Xs as ad,
4942
- Do as ae,
4944
+ yn as ac,
4945
+ Bs as ad,
4946
+ bo as ae,
4943
4947
  fe as af,
4944
- xn as ag,
4945
- Gs as ah,
4946
- vn as ai,
4947
- Mn as aj,
4948
- Qs as ak,
4949
- ro as al,
4950
- R as am,
4951
- Ge as an,
4952
- yn as ao,
4953
- Vs as ap,
4954
- Ks as aq,
4955
- uo as ar,
4956
- Bs as as,
4957
- fo as at,
4958
- bn as au,
4959
- wo as av,
4960
- To as aw,
4961
- hc as ax,
4962
- rs as ay,
4963
- gc as az,
4964
- ks as b,
4965
- $i as b0,
4966
- mr as b1,
4967
- zo as b2,
4968
- $t as b3,
4969
- E as b4,
4970
- Nt as b5,
4971
- kt as b6,
4972
- Yo as b7,
4973
- Po as b8,
4974
- te as b9,
4975
- Ci as c,
4976
- Ss as d,
4977
- qe as e,
4978
- $n as f,
4979
- Kt as g,
4980
- Bt as h,
4948
+ Me as ag,
4949
+ Js as ah,
4950
+ ec as ai,
4951
+ tc as aj,
4952
+ Mn as ak,
4953
+ _n as al,
4954
+ nc as am,
4955
+ io as an,
4956
+ R as ao,
4957
+ Qe as ap,
4958
+ Tn as aq,
4959
+ Ks as ar,
4960
+ Gs as as,
4961
+ mo as at,
4962
+ Qs as au,
4963
+ go as av,
4964
+ Sn as aw,
4965
+ xo as ax,
4966
+ Do as ay,
4967
+ pc as az,
4968
+ Ns as b,
4969
+ $a as b0,
4970
+ Oi as b1,
4971
+ hr as b2,
4972
+ Ro as b3,
4973
+ Et as b4,
4974
+ E as b5,
4975
+ $t as b6,
4976
+ _t as b7,
4977
+ Ao as b8,
4978
+ zo as b9,
4979
+ te as ba,
4980
+ Yi as c,
4981
+ ks as d,
4982
+ Ze as e,
4983
+ In as f,
4984
+ Qt as g,
4985
+ Jt as h,
4981
4986
  J as i,
4982
- Gt as j,
4983
- Ze as k,
4984
- fr as l,
4985
- _s as m,
4986
- qt as n,
4987
- Zt as o,
4988
- Be as p,
4989
- wi as q,
4990
- Ui as r,
4991
- Ti as s,
4992
- Fs as t,
4993
- Es as u,
4994
- Os as v,
4995
- qs as w,
4996
- Is as x,
4987
+ en as j,
4988
+ Xe as k,
4989
+ gr as l,
4990
+ $s as m,
4991
+ Vt as n,
4992
+ Bt as o,
4993
+ Ge as p,
4994
+ Di as q,
4995
+ Wi as r,
4996
+ bi as s,
4997
+ Ps as t,
4998
+ Os as u,
4999
+ Fs as v,
5000
+ Xs as w,
5001
+ Cs as x,
4997
5002
  Ke as y,
4998
- ln as z
5003
+ dn as z
4999
5004
  };