react-semaphor 0.1.601 → 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.
Files changed (123) hide show
  1. package/dist/analytics-protocol/index.js +415 -375
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +8 -8
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{add-to-dashboard-ClhEIFst.js → add-to-dashboard-CFF-wFU-.js} +1 -1
  7. package/dist/chunks/{analytics-base-schemas-DevrgqQb.js → analytics-base-schemas-DsUh5Q3C.js} +14 -12
  8. package/dist/chunks/{assistant-chat-BE0XXzZP.js → assistant-chat-B6hNQI1t.js} +146 -146
  9. package/dist/chunks/{bookmark-impact-DXDAN5AY.js → bookmark-impact-Ba2PLcGp.js} +3 -3
  10. package/dist/chunks/{bookmark-state-BMyB3Tb6.js → bookmark-state-n7AaNzR_.js} +517 -516
  11. package/dist/chunks/{card-filter-builder-CE0-YVN5.js → card-filter-builder-Y22HizVx.js} +474 -474
  12. package/dist/chunks/{comparison-window-caption-Dxj2CHOa.js → comparison-window-caption-Ck2TIbnR.js} +69 -69
  13. package/dist/chunks/{context-BJoEFgNl.js → context-UCQ7sere.js} +1 -1
  14. package/dist/chunks/{dashboard-mJKPFRbb.js → dashboard-BghI99oY.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CntwKyiZ.js → dashboard-briefing-launcher-DtBAnGiH.js} +725 -716
  16. package/dist/chunks/{dashboard-controls-XO089DMg.js → dashboard-controls-CtFXlyjV.js} +53 -53
  17. package/dist/chunks/{dashboard-json-CQRiydUv.js → dashboard-json-DfGBUtCd.js} +5 -5
  18. package/dist/chunks/dates-BnrXF4bb.js +185 -0
  19. package/dist/chunks/{edit-dashboard-visual-f-Dm-BLR.js → edit-dashboard-visual-oxt3x1wb.js} +8081 -8268
  20. package/dist/chunks/{filter-line-CKNMyNTQ.js → filter-line-Cy5YYqRL.js} +27 -27
  21. package/dist/chunks/{filter-reach-copy-B8GGyVuR.js → filter-reach-copy-CE_ZX147.js} +1786 -2214
  22. package/dist/chunks/{filter-value-text-CRtKecI5.js → filter-value-text-fWvSDwkl.js} +11 -11
  23. package/dist/chunks/{index-DoPApnxg.js → index-D5rxbtS4.js} +24 -24
  24. package/dist/chunks/{layout-grid-CiSCZdIr.js → layout-grid-9LndRoLa.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-myf3D3Qx.js → matrix-analytical-definition-CCp48UCw.js} +496 -425
  26. package/dist/chunks/matrix-member-presentation-zNehruXR.js +391 -0
  27. package/dist/chunks/{matrix-operation-contract-C1SuOHLZ.js → matrix-operation-contract-DPBj69D8.js} +518 -514
  28. package/dist/chunks/{metric-comparison-Cm0G893W.js → metric-comparison-B0FR-Q8I.js} +184 -125
  29. package/dist/chunks/{paintbrush-DQIwqlck.js → paintbrush-58FQYY-y.js} +1 -1
  30. package/dist/chunks/{palette-Cun747Rg.js → palette-Be62Tkoa.js} +1 -1
  31. package/dist/chunks/{pivot-result-contract-expectations-C1Dyx8du.js → pivot-result-contract-expectations-BYqAmG9n.js} +1236 -1190
  32. package/dist/chunks/{pivot-result-identity-CBS-ssEp.js → pivot-result-identity-CAP4--iq.js} +1 -1
  33. package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +3778 -0
  34. package/dist/chunks/{report-preferences-dialog-SDZEcG2x.js → report-preferences-dialog-uJp9GBTM.js} +219 -205
  35. package/dist/chunks/{report-runtime-context-BbedQdtc.js → report-runtime-context-c77_KF9v.js} +2 -2
  36. package/dist/chunks/{resolve-dashboard-input-context-DRBS0eRa.js → resolve-dashboard-input-context-Rtl1ffmE.js} +8808 -7291
  37. package/dist/chunks/{save-Dj5bjm7P.js → save-C5A0JnEV.js} +1 -1
  38. package/dist/chunks/{saved-dashboard-context-DWVlJcsa.js → saved-dashboard-context-tcyTU8jm.js} +199 -213
  39. package/dist/chunks/selection-filter-compiler-DNijjI5y.js +150 -0
  40. package/dist/chunks/{semaphor-ready-indicator-OFOoAY-A.js → semaphor-ready-indicator-FBvunj6S.js} +37894 -35726
  41. package/dist/chunks/{shelf-drop-preview-context-2swWypXu.js → shelf-drop-preview-context-QKStrcK9.js} +54 -54
  42. package/dist/chunks/{stored-dashboard-NtOuEX6a.js → stored-dashboard-CHozcAY9.js} +770 -743
  43. package/dist/chunks/{style-sheet-parts-Qv4UcLAo.js → style-sheet-parts-CDCG-8Ej.js} +258 -251
  44. package/dist/chunks/{table-export-sheet-Do7ZB0_F.js → table-export-sheet-ZFIvs6Sj.js} +1 -1
  45. package/dist/chunks/{token-types-Dy_aXO-U.js → token-types-XbM6QByy.js} +1 -1
  46. package/dist/chunks/{upload-Bq-puSVy.js → upload-H15d7uHK.js} +1 -1
  47. package/dist/chunks/{validators-C7DFk3QK.js → validators-Baf3VIf5.js} +5 -5
  48. package/dist/chunks/{variable-draft-Cy03qnEi.js → variable-draft-C2y8Jp6Z.js} +27 -28
  49. package/dist/dashboard/index.js +2 -2
  50. package/dist/dashboard-authoring/index.js +3392 -2761
  51. package/dist/format-utils/index.js +205 -204
  52. package/dist/index.js +73 -75
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +2 -2
  56. package/dist/types/components/dashboard/dashboard-web-component.d.ts +7 -0
  57. package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
  58. package/dist/types/index.js +5 -5
  59. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +1 -1
  60. package/dist/types/lib/document/document-edits.d.ts +0 -4
  61. package/dist/types/lib/query-context/assemble-card-query.d.ts +6 -1
  62. package/dist/types/lib/stores/dashboard-store.d.ts +30 -1
  63. package/dist/types/lib/types/common-types.d.ts +0 -2
  64. package/dist/types/lib/types/explorer-types.d.ts +1 -1
  65. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +15 -0
  66. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
  67. package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
  68. package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
  69. package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
  70. package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
  71. package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
  72. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
  73. package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
  74. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  75. package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
  76. package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
  77. package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +52 -0
  78. package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +129 -0
  79. package/dist/types/shared/dashboard-authoring/calculations/resolve-dashboard-field-copies.d.ts +46 -0
  80. package/dist/types/shared/dashboard-authoring/calculations/tokens.d.ts +36 -0
  81. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
  82. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  83. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
  84. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
  85. package/dist/types/shared/dashboard-authoring/changes/calculation-change.d.ts +399 -0
  86. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +165 -360
  87. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +23 -2
  88. package/dist/types/shared/dashboard-authoring/changes/domain-change.d.ts +143 -266
  89. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +2 -0
  90. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +46 -0
  91. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  92. package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
  93. package/dist/types/shared/dashboard-authoring/index.d.ts +7 -1
  94. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
  95. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
  96. package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
  97. package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
  98. package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
  99. package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
  100. package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
  101. package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
  102. package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
  103. package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +158 -0
  104. package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +71 -0
  105. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +17 -6
  106. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -0
  107. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +3 -0
  108. package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
  109. package/dist/types/shared/format-utils/index.d.ts +1 -0
  110. package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
  111. package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
  112. package/dist/types/shared/temporal/index.d.ts +2 -0
  113. package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
  114. package/dist/types/shared/temporal/temporal.d.ts +27 -0
  115. package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
  116. package/dist/types/shared/usage-events/details.d.ts +2 -2
  117. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  118. package/dist/usage-events/index.js +1 -1
  119. package/package.json +3 -2
  120. package/dist/chunks/dates-B-Urp5OD.js +0 -164
  121. package/dist/chunks/matrix-member-presentation-g0c_NpDW.js +0 -258
  122. package/dist/chunks/raw-temporal-value-DN_l-Tss.js +0 -454
  123. package/dist/chunks/selection-filter-compiler-DmAr7yqC.js +0 -131
@@ -1,164 +0,0 @@
1
- import { d as p, h as D, e as F, r as b, a as m, j as g } from "./resolve-dashboard-input-context-DRBS0eRa.js";
2
- import { d as y, e as T } from "./filter-reach-copy-B8GGyVuR.js";
3
- import "./validators-C7DFk3QK.js";
4
- import "./matrix-operation-contract-C1SuOHLZ.js";
5
- import "./analytics-base-schemas-DevrgqQb.js";
6
- import "zod";
7
- import "./pivot-result-contract-expectations-C1Dyx8du.js";
8
- import "../value-format-preferences/index.js";
9
- import { D as N } from "./bookmark-state-BMyB3Tb6.js";
10
- import "./schema-C9NPiIru.js";
11
- import "./index-CV_Kzou0.js";
12
- import "./context-BJoEFgNl.js";
13
- import { p as P, r as w } from "./stored-dashboard-NtOuEX6a.js";
14
- import { g as C } from "./saved-dashboard-context-DWVlJcsa.js";
15
- function H(e, a, r) {
16
- const t = e.findIndex((o) => o.id === a);
17
- if (t === -1) return e;
18
- const n = e.filter((o, s) => s !== t), i = Math.max(0, Math.min(Math.trunc(r), n.length));
19
- return i === t ? e : [...n.slice(0, i), e[t], ...n.slice(i)];
20
- }
21
- const I = /* @__PURE__ */ new Set([
22
- "bar",
23
- "line",
24
- "pie",
25
- "doughnut",
26
- "table",
27
- "detailTable",
28
- "stackedBar",
29
- "stackedLine",
30
- "horizontalBar",
31
- "radar",
32
- "polarArea",
33
- "scatter",
34
- "bubble",
35
- "funnel",
36
- "custom"
37
- ]);
38
- function U(e) {
39
- return !!(e && I.has(e));
40
- }
41
- const k = 250;
42
- function Y(e) {
43
- return {
44
- id: e.id,
45
- ...p(e.field, {
46
- dataSource: e.dataSource,
47
- connectionId: e.connectionId
48
- }),
49
- width: k
50
- };
51
- }
52
- function J(e, a, r) {
53
- const t = e.flatMap((n) => {
54
- if (r !== void 0 && n.id !== r) return [];
55
- const i = (n.inlineFilters ?? []).findIndex((o) => o.id === a);
56
- return i === -1 ? [] : [{ card: n, filter: n.inlineFilters[i], index: i }];
57
- });
58
- return t.length === 1 ? { kind: "found", ...t[0] } : t.length > 1 ? { kind: "ambiguous", cards: t.map((n) => n.card) } : { kind: "none" };
59
- }
60
- const X = ["hour", "day", "week", "month", "quarter", "year"], Z = 12, R = {
61
- automatic: "Automatic",
62
- card: "Set on this card",
63
- trend_by: "From Trend By"
64
- };
65
- function G(e, a, r = {}) {
66
- if (!e) return;
67
- const t = e.granularity;
68
- if (e.skipped)
69
- return {
70
- head: `Too many points by ${t}`,
71
- // A Trend By sets the grain, so the fix is there (ledger P3-05).
72
- detail: e.grainSource === "trend_by" ? "Pick a coarser grain on the Trend By." : "Pick a coarser grain, or Automatic."
73
- };
74
- const n = R[e.grainSource], i = e.span === "recent" ? `The last 12 ${t}s: no date range` : e.span === "history" ? `The 12 ${t}s ending with this one` : e.window ? y({ ...e.window, timezone: e.calendar.tz }, r.now) : void 0;
75
- return {
76
- head: `By ${t} · ${a} ${a === 1 ? "point" : "points"}`,
77
- detail: i ? `${i} · ${n}` : n
78
- };
79
- }
80
- function S(e, a) {
81
- var t;
82
- if (a.status === "blocked" || (t = e.sql) != null && t.trim()) return !1;
83
- const r = new Set(
84
- a.mappingDispositions.flatMap(
85
- (n) => n.status === "apply" ? [n.filterValue.filterId] : []
86
- )
87
- );
88
- return a.cardFilterValues.some((n) => {
89
- const i = a.queryFilterDefinitions.find(
90
- (d) => d.id === n.filterId
91
- );
92
- if (!D(n)) return !1;
93
- if (!(r.has(n.filterId) || (i == null ? void 0 : i.kind) === "global-date"))
94
- return !!(i && q(
95
- [i],
96
- a.resolvedPrimaryDateField,
97
- [n]
98
- ));
99
- const s = F(n);
100
- return !!(s && b({
101
- card: e,
102
- filter: s,
103
- filterValue: n,
104
- effectiveFilterValue: n,
105
- temporalBinding: a.resolvedPrimaryDateField
106
- }).status === "eligible");
107
- });
108
- }
109
- function q(e, a, r) {
110
- if (!a) return !1;
111
- const t = a.qualifiedFieldName, n = a.qualifiedEntityName, i = n && a.name ? `${n}.${a.name}` : t;
112
- return e.some((o) => {
113
- if (!(m(o.dataType || "") === "date")) return !1;
114
- const d = T(o, r), l = d.split("."), c = l[l.length - 1] || d, h = l.length > 1 ? l.slice(0, -1).join(".") : void 0, f = o.qualifiedTableName || h, u = f ? `${f}.${c}` : void 0;
115
- return t ? u ? u === i || u.endsWith(`.${t}`) : c === a.name : u ? u === i : c === a.name;
116
- });
117
- }
118
- function _(e, a) {
119
- const r = (i) => {
120
- const o = i.field;
121
- return o ? a.id && o.id === a.id ? !0 : a.qualifiedFieldName && o.qualifiedFieldName ? o.qualifiedFieldName === a.qualifiedFieldName : o.name === a.name : !1;
122
- }, t = (i) => i.conditions.some((o) => {
123
- var s;
124
- return m(((s = o.field) == null ? void 0 : s.dataType) || "") === "date" && r(o);
125
- }) || i.groups.some(t), n = g(e);
126
- return n ? t(n) : !1;
127
- }
128
- function v(e, a) {
129
- var s, d;
130
- const r = (d = (s = e.config) == null ? void 0 : s.groupByColumns) == null ? void 0 : d.find((l) => m(l.dataType || "") === "date"), t = a.resolvedPrimaryDateField, n = r ? { id: r.id, name: r.name, label: r.label || r.name, qualifiedFieldName: r.qualifiedFieldName } : t ? { name: t.name, label: t.name, qualifiedFieldName: t.qualifiedFieldName } : void 0;
131
- if (!n) return { comparisonDate: null, dateWindow: a.status === "ready" ? "none" : "unknown" };
132
- const i = { name: n.name, label: n.label };
133
- if (_(e, n)) return { comparisonDate: i, dateWindow: "applies" };
134
- if (a.status !== "ready") return { comparisonDate: i, dateWindow: "unknown" };
135
- const o = S(e, { status: "ready", ...a.compiledFilters });
136
- return { comparisonDate: i, dateWindow: o ? "applies" : "none" };
137
- }
138
- function ee(e) {
139
- const a = P(e.dashboard), r = N(a).find((o) => o.cardId === e.cardId);
140
- if (!r || r.kind === "documentSectionCard") return { comparisonDate: null, dateWindow: "unknown" };
141
- const { runtimeValues: t, transientContexts: n } = w({ dashboard: a, capture: {}, calendar: e.calendar }), i = C({
142
- dashboard: a,
143
- location: r,
144
- runtimeValues: t,
145
- semanticExecutionPayload: e.semanticExecutionPayload,
146
- calendar: e.calendar,
147
- transientContexts: n
148
- });
149
- return v(
150
- r.card,
151
- (i == null ? void 0 : i.status) === "ready" ? { status: "ready", compiledFilters: i.compiledFilters, resolvedPrimaryDateField: i.resolvedPrimaryDateField } : { status: "blocked", resolvedPrimaryDateField: i == null ? void 0 : i.resolvedPrimaryDateField }
152
- );
153
- }
154
- export {
155
- X as K,
156
- Z as a,
157
- Y as b,
158
- U as c,
159
- G as d,
160
- ee as e,
161
- J as f,
162
- H as m,
163
- v as r
164
- };
@@ -1,258 +0,0 @@
1
- import { m as p } from "./validators-C7DFk3QK.js";
2
- function _(t) {
3
- const e = y(t);
4
- return h(e) ? e : void 0;
5
- }
6
- function y(t) {
7
- if (typeof t != "string" || t.trim().length === 0)
8
- return;
9
- const e = t.trim().toLowerCase();
10
- switch (e) {
11
- case "=":
12
- return "=";
13
- case "!=":
14
- return "!=";
15
- case "in":
16
- return "in";
17
- case "not_in":
18
- return "not_in";
19
- case "contains":
20
- return "contains";
21
- case "not_contains":
22
- return "not_contains";
23
- case "between":
24
- return "between";
25
- case "not_between":
26
- return "not_between";
27
- case ">":
28
- case ">=":
29
- case "<":
30
- case "<=":
31
- return e;
32
- case "is_null":
33
- return "is_null";
34
- case "is_not_null":
35
- return "is_not_null";
36
- default:
37
- return x(t) ? t : void 0;
38
- }
39
- }
40
- function h(t) {
41
- return t === "=" || t === "!=" || t === "in" || t === "not_in" || t === "contains" || t === "not_contains" || t === "between" || t === "not_between" || t === ">" || t === ">=" || t === "<" || t === "<=";
42
- }
43
- function x(t) {
44
- return h(t) || t === "not_contains" || t === "is_null" || t === "is_not_null";
45
- }
46
- function O(t) {
47
- switch (t) {
48
- case "not in":
49
- return "not_in";
50
- case "like":
51
- return "contains";
52
- case "not like":
53
- return "not_contains";
54
- case "not between":
55
- return "not_between";
56
- case "is null":
57
- case "is not null":
58
- return;
59
- default:
60
- return _(t);
61
- }
62
- }
63
- const E = [
64
- "=",
65
- "!=",
66
- ">",
67
- "<",
68
- ">=",
69
- "<=",
70
- "like",
71
- "not like",
72
- "between",
73
- "not between",
74
- "in",
75
- "not in",
76
- "is null",
77
- "is not null"
78
- ], N = /* @__PURE__ */ new Set(["string", "number", "date", "boolean"]);
79
- function A(t) {
80
- return typeof t == "string" && E.includes(t);
81
- }
82
- function P(t, e) {
83
- switch (t) {
84
- case "is null":
85
- case "is not null":
86
- return e.length === 0;
87
- case "between":
88
- case "not between":
89
- return e.length === 2;
90
- case "in":
91
- case "not in":
92
- return e.length >= 1;
93
- default:
94
- return e.length === 1;
95
- }
96
- }
97
- function R(t) {
98
- if (!t || typeof t != "object" || Array.isArray(t))
99
- return;
100
- const e = t, n = {};
101
- for (const o of S)
102
- e[o] !== void 0 && (n[o] = e[o]);
103
- return n;
104
- }
105
- const S = [
106
- "operation",
107
- "values",
108
- "valueType",
109
- "temporalBucket",
110
- "relativeMeta",
111
- "temporalPrecision"
112
- ];
113
- function M(t) {
114
- const e = R(t);
115
- if (!e) return;
116
- const { operation: n, values: o } = e;
117
- if (!A(n) || !Array.isArray(o) || !P(n, o)) return;
118
- const i = typeof e.valueType == "string" && N.has(e.valueType) ? e.valueType : void 0;
119
- return {
120
- operation: n,
121
- values: o,
122
- ...i ? { valueType: i } : {},
123
- ...e.temporalBucket !== void 0 ? { temporalBucket: e.temporalBucket } : {},
124
- ...e.relativeMeta !== void 0 ? { relativeMeta: e.relativeMeta } : {},
125
- ...e.temporalPrecision !== void 0 ? { temporalPrecision: e.temporalPrecision } : {}
126
- };
127
- }
128
- function B(t) {
129
- const e = M(t);
130
- if (!e)
131
- throw new Error(
132
- `Filter operation "${String(t.operation)}" cannot be expressed as predicate semantics.`
133
- );
134
- return e;
135
- }
136
- function I(t) {
137
- return t.operation === "is null" || t.operation === "is not null";
138
- }
139
- const w = "numeric_range", F = 32, T = (t) => typeof t == "number" && Number.isFinite(t), f = (t) => {
140
- if (T(t)) return t;
141
- if (typeof t == "string" && t.trim() !== "") {
142
- const e = Number(t);
143
- return Number.isFinite(e) ? e : null;
144
- }
145
- return null;
146
- };
147
- function V(t) {
148
- if (!t || typeof t != "object") return;
149
- const e = t;
150
- if (e.kind !== w) return;
151
- const n = f(e.min), o = f(e.max), i = f(e.emptyRows) ?? 0, c = e.bucketing === "value" ? "value" : "width", u = f(e.bucketWidth) ?? 0, r = Array.isArray(e.buckets) ? e.buckets.map((s) => Math.max(0, f(s) ?? 0)) : [];
152
- if (n === null == (o === null) && !(n !== null && o !== null && n > o) && !(r.length > 0 && !(u > 0)))
153
- return { kind: w, min: n, max: o, emptyRows: i, bucketing: c, buckets: r, bucketWidth: u };
154
- }
155
- function k(t) {
156
- return t.buckets.reduce((e, n) => e + n, 0);
157
- }
158
- function U(t, e) {
159
- const n = t.min ?? 0;
160
- return { from: n + e * t.bucketWidth, to: n + (e + 1) * t.bucketWidth };
161
- }
162
- function a(t, e, n) {
163
- const o = k(t);
164
- if (t.min === null || t.max === null || t.buckets.length === 0)
165
- return t.min === null ? { rows: 0, exact: !0 } : { rows: (n ? e >= t.min : e > t.min) ? o : 0, exact: !0 };
166
- if (t.bucketing === "value") {
167
- let s = 0;
168
- return t.buckets.forEach((l, d) => {
169
- const m = t.min + d;
170
- (n ? m <= e : m < e) && (s += l);
171
- }), { rows: s, exact: !0 };
172
- }
173
- if (e <= t.min) return { rows: 0, exact: !(n && e === t.min) };
174
- if (e >= t.max) return { rows: o, exact: n || e > t.max };
175
- const i = (e - t.min) / t.bucketWidth, c = Math.floor(i);
176
- let u = 0;
177
- for (let s = 0; s < c; s += 1) u += t.buckets[s] ?? 0;
178
- const r = i - c;
179
- return u += (t.buckets[c] ?? 0) * r, { rows: u, exact: r === 0 && !n };
180
- }
181
- function j(t, e, n) {
182
- const o = k(t), i = (r, ...s) => ({
183
- rows: Math.round(Math.max(0, Math.min(o, r))),
184
- exact: s.every(Boolean)
185
- }), [c, u] = n;
186
- switch (e) {
187
- case "is null":
188
- return { rows: t.emptyRows, exact: !0 };
189
- case "is not null":
190
- return { rows: o, exact: !0 };
191
- case ">=": {
192
- const r = a(t, c, !1);
193
- return i(o - r.rows, r.exact);
194
- }
195
- case ">": {
196
- const r = a(t, c, !0);
197
- return i(o - r.rows, r.exact);
198
- }
199
- case "<=": {
200
- const r = a(t, c, !0);
201
- return i(r.rows, r.exact);
202
- }
203
- case "<": {
204
- const r = a(t, c, !1);
205
- return i(r.rows, r.exact);
206
- }
207
- case "between":
208
- case "not between": {
209
- const r = a(t, u, !0), s = a(t, c, !1), l = r.rows - s.rows;
210
- return i(e === "between" ? l : o - l, r.exact, s.exact);
211
- }
212
- case "=":
213
- case "!=": {
214
- if (t.bucketing !== "value" && t.buckets.length > 0) return null;
215
- const r = a(t, c, !0).rows - a(t, c, !1).rows;
216
- return i(e === "=" ? r : o - r, !0);
217
- }
218
- default:
219
- return null;
220
- }
221
- }
222
- function C(t, e) {
223
- var o;
224
- if (e === null) return !0;
225
- if (e.overrides.length === 0) return t.length <= e.depth;
226
- const n = p(t);
227
- return ((o = e.overrides.find((i) => i.path.length === t.length && p(i.path) === n)) == null ? void 0 : o.expanded) ?? t.length <= e.depth;
228
- }
229
- function W(t) {
230
- var b;
231
- const { path: e, levelCount: n, expansion: o, total: i, axis: c } = t, u = e.length >= n || ((b = e[e.length - 1]) == null ? void 0 : b.member.kind) === "others", r = !u && !t.childrenEmpty, s = r && C(e, o), l = c === "rows" && t.rowLayout !== "tabular", d = s && !!t.skipRedundant && !!t.singleChild, m = !!(i != null && i.visible) && !d;
232
- return {
233
- expandable: r,
234
- expanded: s,
235
- memberVisible: l || !s,
236
- valueVisible: u || m && (!s || i.position === "before"),
237
- subtotalBefore: !l && s && m && i.position === "before",
238
- subtotalAfter: s && m && i.position === "after"
239
- };
240
- }
241
- export {
242
- E as N,
243
- y as a,
244
- M as b,
245
- B as c,
246
- w as d,
247
- F as e,
248
- k as f,
249
- U as g,
250
- j as h,
251
- I as i,
252
- C as j,
253
- W as k,
254
- _ as n,
255
- R as p,
256
- V as r,
257
- O as t
258
- };