react-semaphor 0.1.602 → 0.1.603
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.
- package/dist/analytics-protocol/index.js +415 -375
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +8 -8
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{add-to-dashboard-ClhEIFst.js → add-to-dashboard-CFF-wFU-.js} +1 -1
- package/dist/chunks/{analytics-base-schemas-DevrgqQb.js → analytics-base-schemas-DsUh5Q3C.js} +14 -12
- package/dist/chunks/{assistant-chat-BWF3GYip.js → assistant-chat-B6hNQI1t.js} +146 -146
- package/dist/chunks/{bookmark-impact-BF3iRx5a.js → bookmark-impact-Ba2PLcGp.js} +3 -3
- package/dist/chunks/{bookmark-state-CBSTdW6q.js → bookmark-state-n7AaNzR_.js} +517 -516
- package/dist/chunks/{card-filter-builder-B8XHwMY6.js → card-filter-builder-Y22HizVx.js} +104 -104
- package/dist/chunks/{comparison-window-caption-W83qB4V5.js → comparison-window-caption-Ck2TIbnR.js} +69 -69
- package/dist/chunks/{context-BJoEFgNl.js → context-UCQ7sere.js} +1 -1
- package/dist/chunks/{dashboard-DG5EIYYB.js → dashboard-BghI99oY.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CBSrhyWZ.js → dashboard-briefing-launcher-DtBAnGiH.js} +103 -103
- package/dist/chunks/{dashboard-controls-D6ECO4N1.js → dashboard-controls-CtFXlyjV.js} +53 -53
- package/dist/chunks/{dashboard-json-DrJftBSL.js → dashboard-json-DfGBUtCd.js} +5 -5
- package/dist/chunks/dates-BnrXF4bb.js +185 -0
- package/dist/chunks/{edit-dashboard-visual-BDYAJIbb.js → edit-dashboard-visual-oxt3x1wb.js} +7976 -8184
- package/dist/chunks/{filter-line-BXT6y303.js → filter-line-Cy5YYqRL.js} +27 -27
- package/dist/chunks/{filter-reach-copy-BukhZmzm.js → filter-reach-copy-CE_ZX147.js} +1590 -1729
- package/dist/chunks/{filter-value-text-D3-bf3_b.js → filter-value-text-fWvSDwkl.js} +11 -11
- package/dist/chunks/{index-BW0yozjs.js → index-D5rxbtS4.js} +24 -24
- package/dist/chunks/{layout-grid-Ds0diMeY.js → layout-grid-9LndRoLa.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CgQgVeeI.js → matrix-analytical-definition-CCp48UCw.js} +496 -425
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +391 -0
- package/dist/chunks/{matrix-operation-contract--DkNCOzd.js → matrix-operation-contract-DPBj69D8.js} +3 -2
- package/dist/chunks/{metric-comparison-zMylnIkc.js → metric-comparison-B0FR-Q8I.js} +184 -125
- package/dist/chunks/{paintbrush-CX8pao1j.js → paintbrush-58FQYY-y.js} +1 -1
- package/dist/chunks/{palette-CuA0HlzF.js → palette-Be62Tkoa.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-C8KL7hPx.js → pivot-result-contract-expectations-BYqAmG9n.js} +1236 -1190
- package/dist/chunks/{pivot-result-identity-C1AOH1PS.js → pivot-result-identity-CAP4--iq.js} +1 -1
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +3778 -0
- package/dist/chunks/{report-preferences-dialog-CbuVNDGi.js → report-preferences-dialog-uJp9GBTM.js} +219 -205
- package/dist/chunks/{report-runtime-context-E7USjN7E.js → report-runtime-context-c77_KF9v.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-CULCE_hM.js → resolve-dashboard-input-context-Rtl1ffmE.js} +7115 -6963
- package/dist/chunks/{save-BKHlDONy.js → save-C5A0JnEV.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-C1WlOx5z.js → saved-dashboard-context-tcyTU8jm.js} +193 -207
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +150 -0
- package/dist/chunks/{semaphor-ready-indicator-CBIRcDWs.js → semaphor-ready-indicator-FBvunj6S.js} +35550 -35273
- package/dist/chunks/{shelf-drop-preview-context-xR69SMA8.js → shelf-drop-preview-context-QKStrcK9.js} +6 -6
- package/dist/chunks/{stored-dashboard-BuM8vnWf.js → stored-dashboard-CHozcAY9.js} +621 -616
- package/dist/chunks/{style-sheet-parts-Bt9ZNre8.js → style-sheet-parts-CDCG-8Ej.js} +258 -251
- package/dist/chunks/{table-export-sheet-DVljtHkG.js → table-export-sheet-ZFIvs6Sj.js} +1 -1
- package/dist/chunks/{token-types-D_xKgyVS.js → token-types-XbM6QByy.js} +1 -1
- package/dist/chunks/{upload-Dll_M7XQ.js → upload-H15d7uHK.js} +1 -1
- package/dist/chunks/{validators-ClWHpYql.js → validators-Baf3VIf5.js} +3 -3
- package/dist/chunks/{variable-draft-CDGGl53R.js → variable-draft-C2y8Jp6Z.js} +3 -3
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2466 -2343
- package/dist/format-utils/index.js +205 -204
- package/dist/index.js +20 -20
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
- package/dist/types/index.js +5 -5
- package/dist/types/lib/document/document-edits.d.ts +0 -4
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/types/common-types.d.ts +0 -2
- package/dist/types/lib/types/explorer-types.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
- package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
- package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
- package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
- package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +3 -0
- package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
- package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
- package/dist/types/shared/temporal/index.d.ts +2 -0
- package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
- package/dist/types/shared/temporal/temporal.d.ts +27 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
- package/dist/usage-events/index.js +1 -1
- package/package.json +3 -2
- package/dist/chunks/dates-Bz-qM5px.js +0 -164
- package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
- package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
- package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { $ as z, F as C } from "./raw-temporal-value-Dg_MTFF7.js";
|
|
2
|
+
import { w as B, q as b, t as M, l as I, L as N, z as y, p as T, s as F, o as L } from "./matrix-analytical-definition-CCp48UCw.js";
|
|
3
|
+
import { b as V } from "./metric-comparison-B0FR-Q8I.js";
|
|
4
|
+
import { m as S } from "./validators-Baf3VIf5.js";
|
|
5
|
+
function U(e) {
|
|
6
|
+
const t = j(e);
|
|
7
|
+
return O(t) ? t : void 0;
|
|
8
|
+
}
|
|
9
|
+
function j(e) {
|
|
10
|
+
if (typeof e != "string" || e.trim().length === 0)
|
|
11
|
+
return;
|
|
12
|
+
const t = e.trim().toLowerCase();
|
|
13
|
+
switch (t) {
|
|
14
|
+
case "=":
|
|
15
|
+
return "=";
|
|
16
|
+
case "!=":
|
|
17
|
+
return "!=";
|
|
18
|
+
case "in":
|
|
19
|
+
return "in";
|
|
20
|
+
case "not_in":
|
|
21
|
+
return "not_in";
|
|
22
|
+
case "contains":
|
|
23
|
+
return "contains";
|
|
24
|
+
case "not_contains":
|
|
25
|
+
return "not_contains";
|
|
26
|
+
case "between":
|
|
27
|
+
return "between";
|
|
28
|
+
case "not_between":
|
|
29
|
+
return "not_between";
|
|
30
|
+
case ">":
|
|
31
|
+
case ">=":
|
|
32
|
+
case "<":
|
|
33
|
+
case "<=":
|
|
34
|
+
return t;
|
|
35
|
+
case "is_null":
|
|
36
|
+
return "is_null";
|
|
37
|
+
case "is_not_null":
|
|
38
|
+
return "is_not_null";
|
|
39
|
+
default:
|
|
40
|
+
return q(e) ? e : void 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function O(e) {
|
|
44
|
+
return e === "=" || e === "!=" || e === "in" || e === "not_in" || e === "contains" || e === "not_contains" || e === "between" || e === "not_between" || e === ">" || e === ">=" || e === "<" || e === "<=";
|
|
45
|
+
}
|
|
46
|
+
function q(e) {
|
|
47
|
+
return O(e) || e === "not_contains" || e === "is_null" || e === "is_not_null";
|
|
48
|
+
}
|
|
49
|
+
function fe(e) {
|
|
50
|
+
switch (e) {
|
|
51
|
+
case "not in":
|
|
52
|
+
return "not_in";
|
|
53
|
+
case "like":
|
|
54
|
+
return "contains";
|
|
55
|
+
case "not like":
|
|
56
|
+
return "not_contains";
|
|
57
|
+
case "not between":
|
|
58
|
+
return "not_between";
|
|
59
|
+
case "is null":
|
|
60
|
+
case "is not null":
|
|
61
|
+
return;
|
|
62
|
+
default:
|
|
63
|
+
return U(e);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const K = [
|
|
67
|
+
"=",
|
|
68
|
+
"!=",
|
|
69
|
+
">",
|
|
70
|
+
"<",
|
|
71
|
+
">=",
|
|
72
|
+
"<=",
|
|
73
|
+
"like",
|
|
74
|
+
"not like",
|
|
75
|
+
"between",
|
|
76
|
+
"not between",
|
|
77
|
+
"in",
|
|
78
|
+
"not in",
|
|
79
|
+
"is null",
|
|
80
|
+
"is not null"
|
|
81
|
+
], Y = /* @__PURE__ */ new Set(["string", "number", "date", "boolean"]);
|
|
82
|
+
function G(e) {
|
|
83
|
+
return typeof e == "string" && K.includes(e);
|
|
84
|
+
}
|
|
85
|
+
function $(e, t) {
|
|
86
|
+
switch (e) {
|
|
87
|
+
case "is null":
|
|
88
|
+
case "is not null":
|
|
89
|
+
return t.length === 0;
|
|
90
|
+
case "between":
|
|
91
|
+
case "not between":
|
|
92
|
+
return t.length === 2;
|
|
93
|
+
case "in":
|
|
94
|
+
case "not in":
|
|
95
|
+
return t.length >= 1;
|
|
96
|
+
default:
|
|
97
|
+
return t.length === 1;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function H(e) {
|
|
101
|
+
if (!e || typeof e != "object" || Array.isArray(e))
|
|
102
|
+
return;
|
|
103
|
+
const t = e, n = {};
|
|
104
|
+
for (const r of Z)
|
|
105
|
+
t[r] !== void 0 && (n[r] = t[r]);
|
|
106
|
+
return n;
|
|
107
|
+
}
|
|
108
|
+
const Z = [
|
|
109
|
+
"operation",
|
|
110
|
+
"values",
|
|
111
|
+
"valueType",
|
|
112
|
+
"temporalBucket",
|
|
113
|
+
"relativeMeta",
|
|
114
|
+
"temporalPrecision"
|
|
115
|
+
];
|
|
116
|
+
function J(e) {
|
|
117
|
+
const t = H(e);
|
|
118
|
+
if (!t) return;
|
|
119
|
+
const { operation: n, values: r } = t;
|
|
120
|
+
if (!G(n) || !Array.isArray(r) || !$(n, r)) return;
|
|
121
|
+
const s = typeof t.valueType == "string" && Y.has(t.valueType) ? t.valueType : void 0;
|
|
122
|
+
return {
|
|
123
|
+
operation: n,
|
|
124
|
+
values: r,
|
|
125
|
+
...s ? { valueType: s } : {},
|
|
126
|
+
...t.temporalBucket !== void 0 ? { temporalBucket: t.temporalBucket } : {},
|
|
127
|
+
...t.relativeMeta !== void 0 ? { relativeMeta: t.relativeMeta } : {},
|
|
128
|
+
...t.temporalPrecision !== void 0 ? { temporalPrecision: t.temporalPrecision } : {}
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function me(e) {
|
|
132
|
+
const t = J(e);
|
|
133
|
+
if (!t)
|
|
134
|
+
throw new Error(
|
|
135
|
+
`Filter operation "${String(e.operation)}" cannot be expressed as predicate semantics.`
|
|
136
|
+
);
|
|
137
|
+
return t;
|
|
138
|
+
}
|
|
139
|
+
function we(e) {
|
|
140
|
+
return e.operation === "is null" || e.operation === "is not null";
|
|
141
|
+
}
|
|
142
|
+
function Q(e, t, n) {
|
|
143
|
+
const r = new Date(e.startInclusive), s = new Date(e.endExclusive);
|
|
144
|
+
if (!Number.isFinite(r.valueOf()) || !Number.isFinite(s.valueOf()) || r >= s) return null;
|
|
145
|
+
try {
|
|
146
|
+
return I({ start: r, endExclusive: s, zone: e.timezone, column: t, basis: n });
|
|
147
|
+
} catch {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function v(e, t) {
|
|
152
|
+
switch (e) {
|
|
153
|
+
case "day":
|
|
154
|
+
return { amount: -t, unit: "day" };
|
|
155
|
+
case "week":
|
|
156
|
+
return { amount: -7 * t, unit: "day" };
|
|
157
|
+
case "month":
|
|
158
|
+
return { amount: -t, unit: "month" };
|
|
159
|
+
case "quarter":
|
|
160
|
+
return { amount: -3 * t, unit: "month" };
|
|
161
|
+
case "year":
|
|
162
|
+
return { amount: -12 * t, unit: "month" };
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function k(e, t, n, r) {
|
|
166
|
+
return { ...F(e, t, n, { toDate: r }), step: v(n, t) };
|
|
167
|
+
}
|
|
168
|
+
function D(e, t, n) {
|
|
169
|
+
const r = n * t;
|
|
170
|
+
return {
|
|
171
|
+
start: e.start.subtract({ milliseconds: r }),
|
|
172
|
+
endExclusive: e.endExclusive.subtract({ milliseconds: r }),
|
|
173
|
+
step: { amount: -Math.round(r / 1e3), unit: "second" }
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function X(e) {
|
|
177
|
+
const t = L(e), n = t.hours || t.minutes || t.seconds || t.milliseconds;
|
|
178
|
+
return Math.max(1, t.days + (n ? 1 : 0));
|
|
179
|
+
}
|
|
180
|
+
const ee = 24 * 60 * 60 * 1e3;
|
|
181
|
+
function te(e) {
|
|
182
|
+
if (e.originalPeriod) return k(e.current, e.offset, e.originalPeriod, e.cut);
|
|
183
|
+
const t = T(e.whole);
|
|
184
|
+
return t < ee || !e.current.start.equals(e.current.start.startOfDay()) ? D(e.current, e.offset, t) : k(e.current, X(e.whole) * e.offset, "day", e.cut);
|
|
185
|
+
}
|
|
186
|
+
function ne(e) {
|
|
187
|
+
if (e.basis.kind === "elapsed") return D(e.current, e.offset, T(e.whole));
|
|
188
|
+
const t = k(e.current, e.basis.n * e.offset, e.basis.unit, e.basis.toDate || e.cut);
|
|
189
|
+
return t.endExclusive.epochMilliseconds > e.current.start.epochMilliseconds ? { ...t, endExclusive: e.current.start } : t;
|
|
190
|
+
}
|
|
191
|
+
function re(e, t) {
|
|
192
|
+
const n = 364 * t;
|
|
193
|
+
return {
|
|
194
|
+
start: b(e.start, -n, "day"),
|
|
195
|
+
endExclusive: b(e.endExclusive, -n, "day"),
|
|
196
|
+
step: { amount: -n, unit: "day" }
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
const _ = (e) => ({
|
|
200
|
+
tz: e.timezone,
|
|
201
|
+
weekStart: e.weekStart,
|
|
202
|
+
...e.fiscalCalendar ? { fiscalCalendar: e.fiscalCalendar } : {}
|
|
203
|
+
});
|
|
204
|
+
function se(e) {
|
|
205
|
+
const { start: t, end: n } = N(
|
|
206
|
+
e.basis.window,
|
|
207
|
+
{ calendar: _(e.calendar), now: e.referenceTime },
|
|
208
|
+
{ spansBack: e.offset }
|
|
209
|
+
), r = e.basis.window, s = r.kind === "periods" ? (r.to - r.from + 1) * e.offset : e.offset, a = r.kind === "periods" ? r.unit : "day";
|
|
210
|
+
return {
|
|
211
|
+
start: y(t, e.calendar.timezone),
|
|
212
|
+
endExclusive: y(C(n), e.calendar.timezone),
|
|
213
|
+
step: v(a, s)
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function oe(e, t) {
|
|
217
|
+
if (e.basis.kind !== "calendar") return;
|
|
218
|
+
const n = e.basis.window;
|
|
219
|
+
if (n.kind !== "periods" || !n.toDate || typeof n.anchor == "object") return;
|
|
220
|
+
const { toDate: r, ...s } = n, { start: a, end: c } = N(
|
|
221
|
+
{ ...s, anchor: "now" },
|
|
222
|
+
{ calendar: _(t), now: new Date(e.endExclusive.epochMilliseconds - 1) }
|
|
223
|
+
);
|
|
224
|
+
return a.getTime() === e.start.epochMilliseconds ? { start: y(a, t.timezone), endExclusive: y(C(c), t.timezone) } : void 0;
|
|
225
|
+
}
|
|
226
|
+
const P = (e) => ({
|
|
227
|
+
startInclusive: new Date(e.start.epochMilliseconds).toISOString(),
|
|
228
|
+
endExclusive: new Date(e.endExclusive.epochMilliseconds).toISOString(),
|
|
229
|
+
timezone: e.start.timeZoneId
|
|
230
|
+
});
|
|
231
|
+
function he(e) {
|
|
232
|
+
if (!e.currentWindow)
|
|
233
|
+
return { status: "unavailable", reason: "finite_current_window_required" };
|
|
234
|
+
const t = Q(e.currentWindow, e.column, e.basis);
|
|
235
|
+
if (!t || !Number.isFinite(e.referenceTime.getTime()))
|
|
236
|
+
return { status: "unavailable", reason: "temporal_binding_invalid" };
|
|
237
|
+
const n = { timezone: e.currentWindow.timezone, weekStart: e.weekStart, fiscalCalendar: e.fiscalCalendar }, r = z(
|
|
238
|
+
new Date(t.start.epochMilliseconds),
|
|
239
|
+
new Date(t.endExclusive.epochMilliseconds),
|
|
240
|
+
_(n)
|
|
241
|
+
), s = B(t, e.referenceTime);
|
|
242
|
+
if (!s)
|
|
243
|
+
return { status: "unavailable", reason: "current_window_not_started" };
|
|
244
|
+
const a = e.basis, c = oe(t, n) ?? t, o = s.endExclusive.epochMilliseconds < t.endExclusive.epochMilliseconds, i = V(e.spec), l = i.offset ?? 1, m = i.unit === "year" && !i.matchWeekdays;
|
|
245
|
+
if (m && r === "day") {
|
|
246
|
+
const f = s.start;
|
|
247
|
+
if (f.month === 2 && f.day === 29 && b(f, -l, "year").day !== 29)
|
|
248
|
+
return { status: "unavailable", reason: "insufficient_history" };
|
|
249
|
+
}
|
|
250
|
+
const u = i.unit === "period" ? void 0 : i.unit, w = (f, p, W) => f === "year" && i.matchWeekdays ? re(p, l) : m ? (
|
|
251
|
+
// A step by years shifts both ends by years and gives the same answer for an anchored window (AO-D6).
|
|
252
|
+
{
|
|
253
|
+
start: b(p.start, -l, "year"),
|
|
254
|
+
endExclusive: b(p.endExclusive, -l, "year"),
|
|
255
|
+
step: v("year", l)
|
|
256
|
+
}
|
|
257
|
+
) : (
|
|
258
|
+
// A calendar unit back: whole months stay whole, any other window moves its last included instant (K6).
|
|
259
|
+
k(p, l, f, W)
|
|
260
|
+
), g = u ? w(u, s, o) : a.kind === "anchored" ? se({ basis: a, referenceTime: e.referenceTime, offset: l, calendar: n }) : a.kind === "calendar" || a.kind === "elapsed" ? ne({ basis: a, current: s, whole: c, cut: o, offset: l }) : te({ current: s, whole: c, originalPeriod: r, cut: o, offset: l }), x = a.kind === "elapsed";
|
|
261
|
+
if (u && M(w(u, c, !1), c, { elapsed: x }).endExclusive.epochMilliseconds > t.start.epochMilliseconds)
|
|
262
|
+
return { status: "unavailable", reason: "overlaps_current_window" };
|
|
263
|
+
const E = M(g, s, { elapsed: x });
|
|
264
|
+
return {
|
|
265
|
+
status: "resolved",
|
|
266
|
+
currentWindow: P(s),
|
|
267
|
+
comparisonWindow: P(E),
|
|
268
|
+
step: E.step
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
const A = "numeric_range", be = 32, ie = (e) => typeof e == "number" && Number.isFinite(e), h = (e) => {
|
|
272
|
+
if (ie(e)) return e;
|
|
273
|
+
if (typeof e == "string" && e.trim() !== "") {
|
|
274
|
+
const t = Number(e);
|
|
275
|
+
return Number.isFinite(t) ? t : null;
|
|
276
|
+
}
|
|
277
|
+
return null;
|
|
278
|
+
};
|
|
279
|
+
function pe(e) {
|
|
280
|
+
if (!e || typeof e != "object") return;
|
|
281
|
+
const t = e;
|
|
282
|
+
if (t.kind !== A) return;
|
|
283
|
+
const n = h(t.min), r = h(t.max), s = h(t.emptyRows) ?? 0, a = t.bucketing === "value" ? "value" : "width", c = h(t.bucketWidth) ?? 0, o = Array.isArray(t.buckets) ? t.buckets.map((i) => Math.max(0, h(i) ?? 0)) : [];
|
|
284
|
+
if (n === null == (r === null) && !(n !== null && r !== null && n > r) && !(o.length > 0 && !(c > 0)))
|
|
285
|
+
return { kind: A, min: n, max: r, emptyRows: s, bucketing: a, buckets: o, bucketWidth: c };
|
|
286
|
+
}
|
|
287
|
+
function R(e) {
|
|
288
|
+
return e.buckets.reduce((t, n) => t + n, 0);
|
|
289
|
+
}
|
|
290
|
+
function ye(e, t) {
|
|
291
|
+
const n = e.min ?? 0;
|
|
292
|
+
return { from: n + t * e.bucketWidth, to: n + (t + 1) * e.bucketWidth };
|
|
293
|
+
}
|
|
294
|
+
function d(e, t, n) {
|
|
295
|
+
const r = R(e);
|
|
296
|
+
if (e.min === null || e.max === null || e.buckets.length === 0)
|
|
297
|
+
return e.min === null ? { rows: 0, exact: !0 } : { rows: (n ? t >= e.min : t > e.min) ? r : 0, exact: !0 };
|
|
298
|
+
if (e.bucketing === "value") {
|
|
299
|
+
let i = 0;
|
|
300
|
+
return e.buckets.forEach((l, m) => {
|
|
301
|
+
const u = e.min + m;
|
|
302
|
+
(n ? u <= t : u < t) && (i += l);
|
|
303
|
+
}), { rows: i, exact: !0 };
|
|
304
|
+
}
|
|
305
|
+
if (t <= e.min) return { rows: 0, exact: !(n && t === e.min) };
|
|
306
|
+
if (t >= e.max) return { rows: r, exact: n || t > e.max };
|
|
307
|
+
const s = (t - e.min) / e.bucketWidth, a = Math.floor(s);
|
|
308
|
+
let c = 0;
|
|
309
|
+
for (let i = 0; i < a; i += 1) c += e.buckets[i] ?? 0;
|
|
310
|
+
const o = s - a;
|
|
311
|
+
return c += (e.buckets[a] ?? 0) * o, { rows: c, exact: o === 0 && !n };
|
|
312
|
+
}
|
|
313
|
+
function ke(e, t, n) {
|
|
314
|
+
const r = R(e), s = (o, ...i) => ({
|
|
315
|
+
rows: Math.round(Math.max(0, Math.min(r, o))),
|
|
316
|
+
exact: i.every(Boolean)
|
|
317
|
+
}), [a, c] = n;
|
|
318
|
+
switch (t) {
|
|
319
|
+
case "is null":
|
|
320
|
+
return { rows: e.emptyRows, exact: !0 };
|
|
321
|
+
case "is not null":
|
|
322
|
+
return { rows: r, exact: !0 };
|
|
323
|
+
case ">=": {
|
|
324
|
+
const o = d(e, a, !1);
|
|
325
|
+
return s(r - o.rows, o.exact);
|
|
326
|
+
}
|
|
327
|
+
case ">": {
|
|
328
|
+
const o = d(e, a, !0);
|
|
329
|
+
return s(r - o.rows, o.exact);
|
|
330
|
+
}
|
|
331
|
+
case "<=": {
|
|
332
|
+
const o = d(e, a, !0);
|
|
333
|
+
return s(o.rows, o.exact);
|
|
334
|
+
}
|
|
335
|
+
case "<": {
|
|
336
|
+
const o = d(e, a, !1);
|
|
337
|
+
return s(o.rows, o.exact);
|
|
338
|
+
}
|
|
339
|
+
case "between":
|
|
340
|
+
case "not between": {
|
|
341
|
+
const o = d(e, c, !0), i = d(e, a, !1), l = o.rows - i.rows;
|
|
342
|
+
return s(t === "between" ? l : r - l, o.exact, i.exact);
|
|
343
|
+
}
|
|
344
|
+
case "=":
|
|
345
|
+
case "!=": {
|
|
346
|
+
if (e.bucketing !== "value" && e.buckets.length > 0) return null;
|
|
347
|
+
const o = d(e, a, !0).rows - d(e, a, !1).rows;
|
|
348
|
+
return s(t === "=" ? o : r - o, !0);
|
|
349
|
+
}
|
|
350
|
+
default:
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function ae(e, t) {
|
|
355
|
+
var r;
|
|
356
|
+
if (t === null) return !0;
|
|
357
|
+
if (t.overrides.length === 0) return e.length <= t.depth;
|
|
358
|
+
const n = S(e);
|
|
359
|
+
return ((r = t.overrides.find((s) => s.path.length === e.length && S(s.path) === n)) == null ? void 0 : r.expanded) ?? e.length <= t.depth;
|
|
360
|
+
}
|
|
361
|
+
function ve(e) {
|
|
362
|
+
var w;
|
|
363
|
+
const { path: t, levelCount: n, expansion: r, total: s, axis: a } = e, c = t.length >= n || ((w = t[t.length - 1]) == null ? void 0 : w.member.kind) === "others", o = !c && !e.childrenEmpty, i = o && ae(t, r), l = a === "rows" && e.rowLayout !== "tabular", m = i && !!e.skipRedundant && !!e.singleChild, u = !!(s != null && s.visible) && !m;
|
|
364
|
+
return {
|
|
365
|
+
expandable: o,
|
|
366
|
+
expanded: i,
|
|
367
|
+
memberVisible: l || !i,
|
|
368
|
+
valueVisible: c || u && (!i || s.position === "before"),
|
|
369
|
+
subtotalBefore: !l && i && u && s.position === "before",
|
|
370
|
+
subtotalAfter: i && u && s.position === "after"
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
export {
|
|
374
|
+
K as N,
|
|
375
|
+
j as a,
|
|
376
|
+
J as b,
|
|
377
|
+
me as c,
|
|
378
|
+
he as d,
|
|
379
|
+
A as e,
|
|
380
|
+
be as f,
|
|
381
|
+
R as g,
|
|
382
|
+
ye as h,
|
|
383
|
+
we as i,
|
|
384
|
+
ke as j,
|
|
385
|
+
ae as k,
|
|
386
|
+
ve as l,
|
|
387
|
+
U as n,
|
|
388
|
+
H as p,
|
|
389
|
+
pe as r,
|
|
390
|
+
fe as t
|
|
391
|
+
};
|
package/dist/chunks/{matrix-operation-contract--DkNCOzd.js → matrix-operation-contract-DPBj69D8.js}
RENAMED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import { z as Ue, P as De, X as qe, Y as Me, a0 as Be, a1 as Ge, s as U, L as $, n as ze, V as Ve, W as le, g as We, r as Ke, N as Xe, E as $e, F as Ze, o as ue, b as de, I as Ye } from "./analytics-base-schemas-
|
|
3
|
-
import { B as v, v as me, K as G, b0 as te, m as _, E as He, aV as Z, w as Qe, o as Je, q as pe, a3 as et, p as tt, a6 as nt, a$ as at } from "./validators-
|
|
2
|
+
import { z as Ue, P as De, X as qe, Y as Me, a0 as Be, a1 as Ge, s as U, L as $, n as ze, V as Ve, W as le, g as We, r as Ke, N as Xe, E as $e, F as Ze, o as ue, b as de, I as Ye } from "./analytics-base-schemas-DsUh5Q3C.js";
|
|
3
|
+
import { B as v, v as me, K as G, b0 as te, m as _, E as He, aV as Z, w as Qe, o as Je, q as pe, a3 as et, p as tt, a6 as nt, a$ as at } from "./validators-Baf3VIf5.js";
|
|
4
4
|
const Y = {
|
|
5
5
|
answerSummary: "string",
|
|
6
6
|
responseDetail: "responseDetail",
|
|
7
7
|
mode: "string",
|
|
8
8
|
comparisonKind: "string",
|
|
9
|
+
comparisonWords: "string",
|
|
9
10
|
executionResult: "executionResult",
|
|
10
11
|
compiledQuery: "unknown",
|
|
11
12
|
data: "unknown",
|