react-semaphor 0.1.567 → 0.1.569
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/README.md +0 -7
- package/dist/analytics-protocol/index.js +434 -454
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +10 -12
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → _commonjsHelpers-Bid1ZNYj.js} +271 -222
- package/dist/chunks/{assistant-chat-D-IuHHwh.js → assistant-chat-Dzf2Mbph.js} +107 -109
- package/dist/chunks/{bookmark-impact-B0estCHn.js → bookmark-impact-Czg6FGt5.js} +2 -2
- package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
- package/dist/chunks/{card-filter-builder-DbSmzvem.js → card-filter-builder-BS982X7x.js} +1001 -1000
- package/dist/chunks/{code-editor-DJNOsgJH.js → code-editor-BsxHzm9u.js} +43 -45
- package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-lLTgzOkM.js} +252 -253
- package/dist/chunks/{dashboard-f8J9DHh5.js → dashboard-BiYSbxZv.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DunvZYsU.js → dashboard-briefing-launcher-Bdj7luOr.js} +119 -120
- package/dist/chunks/{dashboard-controls-B09cN2Dz.js → dashboard-controls-TViDsnb8.js} +17 -19
- package/dist/chunks/dashboard-json-Dg9dQd9U.js +66 -0
- package/dist/chunks/{dates-BsJcyoC_.js → dates-BsPrWZIP.js} +8 -8
- package/dist/chunks/{edit-dashboard-visual-Cwzbpty8.js → edit-dashboard-visual-C6hoIeEJ.js} +20 -21
- package/dist/chunks/{filter-reach-copy-P-kDwUpY.js → filter-reach-copy-hcQ4os0u.js} +862 -852
- package/dist/chunks/filter-value-text-CVxEEDVl.js +146 -0
- package/dist/chunks/{index-BcXw0CpM.js → index-G4q89J6O.js} +74 -76
- package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-BIcoFfdS.js} +1 -1
- package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C6tYkHyv.js} +1 -1
- package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
- package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
- package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
- package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
- package/dist/chunks/{palette-4vf2BEEg.js → palette-NjHOE_6B.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-DkmueDTW.js +55 -0
- package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
- package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
- package/dist/chunks/{report-preferences-dialog-CbgmdWeZ.js → report-preferences-dialog-Xc8_GFju.js} +26 -28
- package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
- package/dist/chunks/{resolve-dashboard-input-context-DPKSF3qj.js → resolve-dashboard-input-context-KqvcLcTM.js} +5956 -5880
- package/dist/chunks/{save-D6pHmSSP.js → save-C6VmEJTA.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-CNudmm9U.js → saved-dashboard-context-BeXXyoD4.js} +6 -6
- package/dist/chunks/{semaphor-ready-indicator-CQd-PCCZ.js → semaphor-ready-indicator-BNkaANsG.js} +31011 -30850
- package/dist/chunks/{shelf-drop-preview-context-CWS3e20y.js → shelf-drop-preview-context-C_issPBA.js} +18 -20
- package/dist/chunks/{stored-dashboard-CrQFT27O.js → stored-dashboard-B6_StAty.js} +232 -234
- package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-BWP2joD1.js} +1 -1
- package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-scSWQXAB.js} +4 -4
- package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
- package/dist/chunks/{upload-Cf3wXZT8.js → upload-BRW4Mwrd.js} +1 -1
- package/dist/chunks/validators-B8fpdinG.js +3651 -0
- package/dist/chunks/{variable-draft-BDxlD0dM.js → variable-draft-BQ3OMjvy.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1778 -1741
- package/dist/format-utils/index.js +230 -231
- package/dist/index.js +236 -237
- package/dist/report-runtime-context/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +5 -4
- package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
- package/dist/types/index.js +9 -9
- package/dist/types/lib/document/document-edits.d.ts +8 -3
- package/dist/types/lib/document/document-text-style.d.ts +54 -0
- package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
- package/dist/types/lib/types/explorer-types.d.ts +2 -2
- package/dist/types/lib/types/index.d.ts +1 -1
- package/dist/types/lib/utils/card-definition.d.ts +7 -7
- package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
- package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +4 -4
- package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
- package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
- package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
- package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
- package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
- package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
- package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
- package/dist/types/shared/assistant-protocol/context.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +176 -1756
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +74 -74
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +8 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
- package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
- package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
- package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
- package/dist/types/shared/temporal/index.d.ts +0 -2
- package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
- package/package.json +2 -24
- package/DATA_APP_SDK.md +0 -339
- package/dist/chunks/dashboard-json-BNNCaKEc.js +0 -68
- package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
- package/dist/chunks/index-CuHybtft.js +0 -51
- package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
- package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
- package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
- package/dist/chunks/operators-B3zZoskU.js +0 -66
- package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
- package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
- package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
- package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
- package/dist/chunks/validators-wtjw0aw6.js +0 -3332
- package/dist/data-app-sdk/index.js +0 -1412
- package/dist/data-app-sdk-adapters/index.js +0 -361
- package/dist/data-app-sdk-validation/index.js +0 -1031
- package/dist/types/data-app-sdk/adapters.d.ts +0 -35
- package/dist/types/data-app-sdk/builders.d.ts +0 -62
- package/dist/types/data-app-sdk/contracts.d.ts +0 -419
- package/dist/types/data-app-sdk/executor.d.ts +0 -5
- package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
- package/dist/types/data-app-sdk/hooks.d.ts +0 -11
- package/dist/types/data-app-sdk/index.d.ts +0 -9
- package/dist/types/data-app-sdk/provider.d.ts +0 -8
- package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
- package/dist/types/data-app-sdk/selection.d.ts +0 -2
- package/dist/types/data-app-sdk/validation.d.ts +0 -58
- package/dist/types/data-app-sdk-adapters.d.ts +0 -2
- package/dist/types/data-app-sdk-validation.d.ts +0 -2
- package/dist/types/data-app-sdk.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
- package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
- package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
- package/dist/types/shared/temporal/relative-date.d.ts +0 -21
- package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
- package/src/data-app-sdk/README.md +0 -402
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
import { n as y } from "../chunks/operators-B3zZoskU.js";
|
|
2
|
-
import { m as v, s as m, p as I, a as S } from "../chunks/validators-wtjw0aw6.js";
|
|
3
|
-
import { a as F, c as b } from "../chunks/matrix-operation-contract-Eb6elidS.js";
|
|
4
|
-
import "../chunks/analytics-base-schemas-BaIQrEzX.js";
|
|
5
|
-
import "zod";
|
|
6
|
-
function w(i) {
|
|
7
|
-
var n, r, o;
|
|
8
|
-
const t = R(i);
|
|
9
|
-
return {
|
|
10
|
-
version: 1,
|
|
11
|
-
kind: "metric",
|
|
12
|
-
id: i.id,
|
|
13
|
-
label: i.label,
|
|
14
|
-
source: s(i),
|
|
15
|
-
measures: t,
|
|
16
|
-
primaryMeasure: M(i, t),
|
|
17
|
-
dateField: i.dateField ? a(i.dateField, "date") : void 0,
|
|
18
|
-
timeGrain: i.timeGrain,
|
|
19
|
-
dimensions: (n = i.dimensions) == null ? void 0 : n.map((e) => a(e, "dimension")),
|
|
20
|
-
comparison: x(i.comparison),
|
|
21
|
-
orderBy: i.orderBy ? {
|
|
22
|
-
field: a(i.orderBy.field),
|
|
23
|
-
direction: i.orderBy.direction
|
|
24
|
-
} : void 0,
|
|
25
|
-
inputs: d(i.inputs),
|
|
26
|
-
...(r = i.filters) != null && r.length ? { filters: i.filters } : {},
|
|
27
|
-
...i.relationshipHint ? { relationshipHint: i.relationshipHint } : {},
|
|
28
|
-
limit: i.limit,
|
|
29
|
-
...(o = i.derivedFields) != null && o.length ? { derivedFields: i.derivedFields } : {}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function j(i) {
|
|
33
|
-
return {
|
|
34
|
-
...w(i),
|
|
35
|
-
...i.timeWindow ? { timeWindow: i.timeWindow } : {},
|
|
36
|
-
...i.analysis ? { analysis: i.analysis } : {}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function K(i) {
|
|
40
|
-
return {
|
|
41
|
-
...i.chartTitle ? { chartTitle: i.chartTitle } : {},
|
|
42
|
-
...i.chartType ? { chartType: i.chartType } : {},
|
|
43
|
-
...i.driverMode ? { driverMode: i.driverMode } : {},
|
|
44
|
-
...i.includePopulation !== void 0 ? { includePopulation: i.includePopulation } : {},
|
|
45
|
-
...i.calendarContext ? { calendarContext: i.calendarContext } : {}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
function M(i, t) {
|
|
49
|
-
if (!i.primaryMeasure)
|
|
50
|
-
return t[0] || { name: "", role: "measure" };
|
|
51
|
-
const n = a(i.primaryMeasure, "measure"), r = B(n, t), o = r.length === 1 ? r[0] : void 0;
|
|
52
|
-
return o ? f(n, o) : n;
|
|
53
|
-
}
|
|
54
|
-
function R(i) {
|
|
55
|
-
const t = [];
|
|
56
|
-
for (const n of i.measures.map(
|
|
57
|
-
(r) => a(r, "measure")
|
|
58
|
-
)) {
|
|
59
|
-
if (!n.name)
|
|
60
|
-
continue;
|
|
61
|
-
const r = t.findIndex(
|
|
62
|
-
(o) => k(o, n)
|
|
63
|
-
);
|
|
64
|
-
if (r === -1) {
|
|
65
|
-
t.push(n);
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
t[r] = f(
|
|
69
|
-
t[r],
|
|
70
|
-
n
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
return t;
|
|
74
|
-
}
|
|
75
|
-
function k(i, t) {
|
|
76
|
-
return m(i, t) && l(i) === l(t);
|
|
77
|
-
}
|
|
78
|
-
function H(i, t) {
|
|
79
|
-
return l(t) === l(i);
|
|
80
|
-
}
|
|
81
|
-
function A(i, t) {
|
|
82
|
-
return t.name !== i.name || i.source && !m(t, i) ? !1 : H(i, t);
|
|
83
|
-
}
|
|
84
|
-
function B(i, t) {
|
|
85
|
-
const n = t.filter(
|
|
86
|
-
(r) => A(i, r)
|
|
87
|
-
);
|
|
88
|
-
return i.aggregate !== void 0, n;
|
|
89
|
-
}
|
|
90
|
-
function l(i) {
|
|
91
|
-
return S(i);
|
|
92
|
-
}
|
|
93
|
-
function f(i, t) {
|
|
94
|
-
if (i.aggregate && t.aggregate && i.aggregate !== t.aggregate)
|
|
95
|
-
throw new Error(
|
|
96
|
-
`Measure "${i.name}" was requested with conflicting aggregate semantics: ${i.aggregate} and ${t.aggregate}.`
|
|
97
|
-
);
|
|
98
|
-
return {
|
|
99
|
-
...I(i, t),
|
|
100
|
-
aggregate: i.aggregate || t.aggregate
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function V(i) {
|
|
104
|
-
var n, r;
|
|
105
|
-
if ("sort" in i)
|
|
106
|
-
throw new Error(
|
|
107
|
-
"semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet."
|
|
108
|
-
);
|
|
109
|
-
if (!q(i))
|
|
110
|
-
throw new Error("semaphor.records needs at least one field.");
|
|
111
|
-
const t = O(i.fields);
|
|
112
|
-
return {
|
|
113
|
-
version: 1,
|
|
114
|
-
kind: "records",
|
|
115
|
-
id: i.id,
|
|
116
|
-
label: i.label,
|
|
117
|
-
source: s(i),
|
|
118
|
-
fields: t,
|
|
119
|
-
dateField: i.dateField ? a(i.dateField, "date") : void 0,
|
|
120
|
-
timeGrain: i.timeGrain,
|
|
121
|
-
...i.timeWindow ? { timeWindow: i.timeWindow } : {},
|
|
122
|
-
...(n = i.filters) != null && n.length ? { filters: i.filters } : {},
|
|
123
|
-
orderBy: i.orderBy ? {
|
|
124
|
-
field: a(i.orderBy.field),
|
|
125
|
-
direction: i.orderBy.direction
|
|
126
|
-
} : void 0,
|
|
127
|
-
inputs: d(i.inputs),
|
|
128
|
-
...i.relationshipHint ? { relationshipHint: i.relationshipHint } : {},
|
|
129
|
-
limit: i.limit,
|
|
130
|
-
...i.pagination ? { pagination: i.pagination } : {},
|
|
131
|
-
...i.totals ? {
|
|
132
|
-
totals: {
|
|
133
|
-
mode: "server",
|
|
134
|
-
measures: i.totals.measures.map(
|
|
135
|
-
(o) => a(o, "measure")
|
|
136
|
-
)
|
|
137
|
-
}
|
|
138
|
-
} : {},
|
|
139
|
-
...(r = i.derivedFields) != null && r.length ? { derivedFields: i.derivedFields } : {}
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
function O(i) {
|
|
143
|
-
return i.map((t) => {
|
|
144
|
-
const n = a(t);
|
|
145
|
-
if (!n.role)
|
|
146
|
-
throw new Error(
|
|
147
|
-
`semaphor.records field "${n.name}" needs an explicit role.`
|
|
148
|
-
);
|
|
149
|
-
return n;
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
function Q(i) {
|
|
153
|
-
var n, r, o;
|
|
154
|
-
const t = s(i);
|
|
155
|
-
if (t.kind === "sql")
|
|
156
|
-
throw new Error(
|
|
157
|
-
"semaphor.inputOptions requires a semantic or physical option source."
|
|
158
|
-
);
|
|
159
|
-
return {
|
|
160
|
-
version: 1,
|
|
161
|
-
kind: "inputOptions",
|
|
162
|
-
id: i.id,
|
|
163
|
-
label: i.label,
|
|
164
|
-
inputId: i.inputId,
|
|
165
|
-
source: t,
|
|
166
|
-
labelField: a(i.labelField, "dimension"),
|
|
167
|
-
valueField: a(i.valueField, "dimension"),
|
|
168
|
-
...i.searchField ? { searchField: a(i.searchField, "dimension") } : {},
|
|
169
|
-
...(n = i.disambiguationFields) != null && n.length ? {
|
|
170
|
-
disambiguationFields: i.disambiguationFields.map(
|
|
171
|
-
(e) => a(e, "dimension")
|
|
172
|
-
)
|
|
173
|
-
} : {},
|
|
174
|
-
...i.population ? { population: i.population } : {},
|
|
175
|
-
...i.dependencies ? { dependencies: i.dependencies } : {},
|
|
176
|
-
search: i.search,
|
|
177
|
-
limit: i.limit,
|
|
178
|
-
...(r = i.inputs) != null && r.length ? { inputs: i.inputs.map((e) => h(e)) } : {},
|
|
179
|
-
...(o = i.derivedFields) != null && o.length ? { derivedFields: i.derivedFields } : {}
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
function D(i) {
|
|
183
|
-
var t;
|
|
184
|
-
return {
|
|
185
|
-
version: 1,
|
|
186
|
-
kind: "sql",
|
|
187
|
-
id: i.id,
|
|
188
|
-
label: i.label,
|
|
189
|
-
source: i.source,
|
|
190
|
-
sql: i.sql,
|
|
191
|
-
...i.defaultParameters ? { defaultParameters: i.defaultParameters } : {},
|
|
192
|
-
...i.pythonCode ? { pythonCode: i.pythonCode } : {},
|
|
193
|
-
...(t = i.fields) != null && t.length ? { fields: i.fields.map((n) => a(n)) } : {},
|
|
194
|
-
inputs: d(i.inputs),
|
|
195
|
-
limit: i.limit,
|
|
196
|
-
...i.pagination ? { pagination: i.pagination } : {},
|
|
197
|
-
rationale: i.rationale
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
function J(i) {
|
|
201
|
-
const { id: t, label: n, inputs: r, matrixWindowRequest: o, ...e } = i, { queryKind: T, ...p } = e;
|
|
202
|
-
return v.parse({ ...p, kind: "matrix" });
|
|
203
|
-
}
|
|
204
|
-
function h(i) {
|
|
205
|
-
if ("toAnalyticsInput" in i) {
|
|
206
|
-
const e = i.toAnalyticsInput();
|
|
207
|
-
return {
|
|
208
|
-
inputId: e.inputId,
|
|
209
|
-
kind: e.kind,
|
|
210
|
-
...e.controlRole ? { controlRole: e.controlRole } : {},
|
|
211
|
-
...e.operator ? { operator: e.operator } : {},
|
|
212
|
-
...e.field ? { field: e.field } : {},
|
|
213
|
-
...e.relationshipHint ? { relationshipHint: e.relationshipHint } : {}
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
if ("id" in i) {
|
|
217
|
-
const e = g(i);
|
|
218
|
-
return {
|
|
219
|
-
inputId: e.inputId,
|
|
220
|
-
kind: e.kind,
|
|
221
|
-
...e.controlRole ? { controlRole: e.controlRole } : {},
|
|
222
|
-
...e.operator ? { operator: e.operator } : {},
|
|
223
|
-
...e.field ? { field: e.field } : {},
|
|
224
|
-
...e.relationshipHint ? { relationshipHint: e.relationshipHint } : {}
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
const t = "kind" in i ? i.kind : void 0, n = "operator" in i ? c(i.operator, i.inputId) : void 0, r = "controlRole" in i ? i.controlRole : "role" in i ? i.role : void 0, o = z(r) ? r : void 0;
|
|
228
|
-
return {
|
|
229
|
-
inputId: i.inputId,
|
|
230
|
-
...t ? { kind: t } : {},
|
|
231
|
-
...o ? { controlRole: o } : {},
|
|
232
|
-
...n ? { operator: n } : {},
|
|
233
|
-
...i.field ? { field: i.field } : {},
|
|
234
|
-
...i.relationshipHint ? { relationshipHint: i.relationshipHint } : {}
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
function z(i) {
|
|
238
|
-
return i === "grain" || i === "measure" || i === "dimension" || i === "aggregation" || i === "sqlParam";
|
|
239
|
-
}
|
|
240
|
-
function L(i) {
|
|
241
|
-
const t = d(i);
|
|
242
|
-
return t.length > 0 ? t : void 0;
|
|
243
|
-
}
|
|
244
|
-
function C(i) {
|
|
245
|
-
return (i || []).map(P);
|
|
246
|
-
}
|
|
247
|
-
function N(i) {
|
|
248
|
-
return C(i).filter((t) => t.isActive);
|
|
249
|
-
}
|
|
250
|
-
function U(i) {
|
|
251
|
-
const t = (i || []).flatMap((n) => {
|
|
252
|
-
const r = "toAnalyticsSelection" in n ? n.toAnalyticsSelection() : n;
|
|
253
|
-
return r ? [F.parse(r)] : [];
|
|
254
|
-
});
|
|
255
|
-
return b(t);
|
|
256
|
-
}
|
|
257
|
-
function g(i) {
|
|
258
|
-
if (i.kind === "filter") {
|
|
259
|
-
const t = c(i.operator, i.id);
|
|
260
|
-
return {
|
|
261
|
-
inputId: i.id,
|
|
262
|
-
kind: i.kind,
|
|
263
|
-
label: i.label,
|
|
264
|
-
field: a(i.field, "dimension"),
|
|
265
|
-
operator: t || "in",
|
|
266
|
-
...i.relationshipHint ? { relationshipHint: i.relationshipHint } : {}
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
return {
|
|
270
|
-
inputId: i.id,
|
|
271
|
-
kind: i.kind,
|
|
272
|
-
label: i.label,
|
|
273
|
-
controlRole: i.role
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
function X(i = []) {
|
|
277
|
-
return i.map(
|
|
278
|
-
(t) => typeof t == "object" ? t : {
|
|
279
|
-
label: String(t),
|
|
280
|
-
value: t
|
|
281
|
-
}
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
function u(i) {
|
|
285
|
-
return i == null ? !1 : Array.isArray(i) ? i.length > 0 : typeof i == "string" ? i.trim().length > 0 : !0;
|
|
286
|
-
}
|
|
287
|
-
function P(i) {
|
|
288
|
-
if ("toAnalyticsInput" in i)
|
|
289
|
-
return i.toAnalyticsInput();
|
|
290
|
-
if ("kind" in i && "isActive" in i)
|
|
291
|
-
return i;
|
|
292
|
-
if ("id" in i) {
|
|
293
|
-
const t = g(i), n = Object.prototype.hasOwnProperty.call(i, "value") ? i.value : i.defaultValue;
|
|
294
|
-
return {
|
|
295
|
-
inputId: t.inputId,
|
|
296
|
-
kind: t.kind,
|
|
297
|
-
label: t.label,
|
|
298
|
-
...t.field ? { field: t.field } : {},
|
|
299
|
-
...t.operator ? { operator: t.operator } : {},
|
|
300
|
-
...t.controlRole ? { controlRole: t.controlRole } : {},
|
|
301
|
-
...t.relationshipHint ? { relationshipHint: t.relationshipHint } : {},
|
|
302
|
-
value: n,
|
|
303
|
-
isActive: u(n)
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
return {
|
|
307
|
-
...i,
|
|
308
|
-
kind: "filter",
|
|
309
|
-
isActive: u(
|
|
310
|
-
i.value
|
|
311
|
-
),
|
|
312
|
-
value: i.value
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
function s(i) {
|
|
316
|
-
return i.source;
|
|
317
|
-
}
|
|
318
|
-
function q(i) {
|
|
319
|
-
var t;
|
|
320
|
-
return !!((t = i.fields) != null && t.length);
|
|
321
|
-
}
|
|
322
|
-
function a(i, t) {
|
|
323
|
-
return {
|
|
324
|
-
...i,
|
|
325
|
-
role: i.role || t
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
function d(i) {
|
|
329
|
-
return (i || []).map(h);
|
|
330
|
-
}
|
|
331
|
-
function x(i) {
|
|
332
|
-
if (i)
|
|
333
|
-
return i;
|
|
334
|
-
}
|
|
335
|
-
function c(i, t) {
|
|
336
|
-
if (i === void 0)
|
|
337
|
-
return;
|
|
338
|
-
const n = y(i);
|
|
339
|
-
if (!n)
|
|
340
|
-
throw new Error(
|
|
341
|
-
`useSemaphorInput "${t}" uses unsupported filter operator "${i}".`
|
|
342
|
-
);
|
|
343
|
-
return n;
|
|
344
|
-
}
|
|
345
|
-
export {
|
|
346
|
-
u as hasSemaphorInputValue,
|
|
347
|
-
X as normalizeSemaphorInputOptions,
|
|
348
|
-
N as toSemaphorActiveInputSnapshots,
|
|
349
|
-
j as toSemaphorAnalysisIntent,
|
|
350
|
-
K as toSemaphorAnalysisQueryOptions,
|
|
351
|
-
h as toSemaphorInputBinding,
|
|
352
|
-
L as toSemaphorInputBindings,
|
|
353
|
-
Q as toSemaphorInputOptionsIntent,
|
|
354
|
-
C as toSemaphorInputSnapshots,
|
|
355
|
-
g as toSemaphorInputSpec,
|
|
356
|
-
J as toSemaphorMatrixIntent,
|
|
357
|
-
w as toSemaphorMetricIntent,
|
|
358
|
-
V as toSemaphorRecordsIntent,
|
|
359
|
-
U as toSemaphorSelectionSnapshots,
|
|
360
|
-
D as toSemaphorSqlIntent
|
|
361
|
-
};
|