react-semaphor 0.1.470 → 0.1.471

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 (41) hide show
  1. package/README.md +10 -0
  2. package/dist/brand-studio/index.cjs +1 -1
  3. package/dist/brand-studio/index.js +1 -1
  4. package/dist/chunks/{dashboard-briefing-launcher-DEVbQCQE.js → dashboard-briefing-launcher-C2-b7rZU.js} +5 -5
  5. package/dist/chunks/dashboard-briefing-launcher-ChHmLu0F.cjs +26 -0
  6. package/dist/chunks/{dashboard-controls-DPK-CRWL.js → dashboard-controls-Db7VOHdj.js} +4 -4
  7. package/dist/chunks/{dashboard-controls-8D1m_ECN.cjs → dashboard-controls-kw4QQDSz.cjs} +1 -1
  8. package/dist/chunks/dashboard-filter-value-compatibility-Dmh-NaPK.cjs +1 -0
  9. package/dist/chunks/dashboard-filter-value-compatibility-ilbH2A31.js +836 -0
  10. package/dist/chunks/{dashboard-json-DhKOoHwK.cjs → dashboard-json-Cu37kF4Q.cjs} +1 -1
  11. package/dist/chunks/{dashboard-json-DVWLTmIJ.js → dashboard-json-Dp-38lll.js} +2 -2
  12. package/dist/chunks/{edit-dashboard-visual-B6zidwTu.cjs → edit-dashboard-visual-Cbtpwhlp.cjs} +33 -33
  13. package/dist/chunks/{edit-dashboard-visual-CxEC3bPx.js → edit-dashboard-visual-CffII05Z.js} +3609 -3711
  14. package/dist/chunks/{editor-action-buttons-B3S00DsB.cjs → editor-action-buttons-DcTGZa2C.cjs} +1 -1
  15. package/dist/chunks/{editor-action-buttons-HfJ-Bohl.js → editor-action-buttons-DqwDHxFv.js} +2 -2
  16. package/dist/chunks/{index-tsB3LfTQ.js → index-CUf0lwSP.js} +24201 -24259
  17. package/dist/chunks/{index-DVBYvkj0.cjs → index-DUYREWSl.cjs} +227 -227
  18. package/dist/chunks/{pivot-header-presentation-BW0Ay7WV.js → pivot-header-presentation-7XrwJYDm.js} +101 -94
  19. package/dist/chunks/pivot-header-presentation-Cr6pU5JL.cjs +4 -0
  20. package/dist/chunks/{report-preferences-dialog-DvNWNrlj.cjs → report-preferences-dialog-BEe2cTT-.cjs} +1 -1
  21. package/dist/chunks/{report-preferences-dialog-D-VpoQJz.js → report-preferences-dialog-C_FTOmOg.js} +2 -2
  22. package/dist/chunks/{switch-NAbuOQNg.cjs → switch-CQN9Hzho.cjs} +19 -19
  23. package/dist/chunks/{switch-DnbD-yCM.js → switch-n2yUNY8i.js} +383 -370
  24. package/dist/dashboard/index.cjs +1 -1
  25. package/dist/dashboard/index.js +1 -1
  26. package/dist/dashboard-authoring/index.cjs +1 -1
  27. package/dist/dashboard-authoring/index.js +1 -1
  28. package/dist/data-app-builder/index.cjs +1 -1
  29. package/dist/data-app-builder/index.js +2 -2
  30. package/dist/format-utils/index.cjs +3 -3
  31. package/dist/format-utils/index.js +71 -68
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.js +6 -6
  34. package/dist/surfboard/index.cjs +1 -1
  35. package/dist/surfboard/index.js +2 -2
  36. package/dist/types/format-utils.d.ts +9 -0
  37. package/package.json +1 -1
  38. package/dist/chunks/dashboard-briefing-launcher-exfJnSop.cjs +0 -26
  39. package/dist/chunks/dashboard-filter-value-compatibility-BAaqJGjt.js +0 -692
  40. package/dist/chunks/dashboard-filter-value-compatibility-CYrWe1U6.cjs +0 -1
  41. package/dist/chunks/pivot-header-presentation-DVBTHug2.cjs +0 -4
@@ -1,692 +0,0 @@
1
- var O = Object.defineProperty;
2
- var S = (e, n, i) => n in e ? O(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
3
- var C = (e, n, i) => S(e, typeof n != "symbol" ? n + "" : n, i);
4
- import { ai as h, ak as M, h as N, af as q, ah as H, B as I, E as D } from "./validators-B5t1s8oh.js";
5
- import "./analyze-result-contract-B3agc2XU.js";
6
- import "../value-format-preferences/index.js";
7
- function p(e) {
8
- return !!e && typeof e == "object" && !Array.isArray(e);
9
- }
10
- function E(e) {
11
- return p(e) && typeof e.name == "string";
12
- }
13
- function _(e) {
14
- return !p(e) || e.kind !== "semantic" && e.kind !== "physical" || (e.kind === "semantic" ? [e.datasetId, e.datasetName, e.connectionId] : [e.databaseName, e.schemaName]).some(
15
- (i) => i !== void 0 && typeof i != "string"
16
- ) ? !1 : N(
17
- e
18
- );
19
- }
20
- function x(e, n) {
21
- var c, o;
22
- if ((n == null ? void 0 : n.mode) !== "database" && e.type === "dataset" && "domainId" in e && e.domainId) {
23
- const r = e, a = {
24
- kind: "semantic",
25
- domainId: r.domainId,
26
- datasetId: q(r),
27
- datasetName: r.name,
28
- connectionId: r.connectionId || (n == null ? void 0 : n.connectionId),
29
- label: r.label
30
- };
31
- return _(a) ? H(a) : void 0;
32
- }
33
- const i = e.connectionId || (n == null ? void 0 : n.connectionId), d = e.type === "dataset" && "table" in e && e.table ? e.table : e.name;
34
- if (!i || !d)
35
- return;
36
- const t = {
37
- kind: "physical",
38
- connectionId: i,
39
- connectionType: e.connectionType || (n == null ? void 0 : n.connectionType),
40
- tableName: d,
41
- databaseName: e.database || ((c = n == null ? void 0 : n.dbSelection) == null ? void 0 : c.database),
42
- schemaName: e.schema || ((o = n == null ? void 0 : n.dbSelection) == null ? void 0 : o.schema),
43
- dialect: e.dialect
44
- };
45
- return _(t) ? t : void 0;
46
- }
47
- function L(e, n) {
48
- var r, a;
49
- const i = x(e, n);
50
- if (!i) return;
51
- const d = e.type === "dataset" && "table" in e && typeof e.table == "string" ? e.table.trim() : void 0, t = i.kind === "physical" ? i.tableName : d, c = e.connectionId || (n == null ? void 0 : n.connectionId), o = t && c ? {
52
- connectionId: c,
53
- databaseName: e.database || ((r = n == null ? void 0 : n.dbSelection) == null ? void 0 : r.database),
54
- schemaName: e.schema || ((a = n == null ? void 0 : n.dbSelection) == null ? void 0 : a.schema),
55
- tableName: t
56
- } : void 0;
57
- return { source: i, ...o ? { executionTable: o } : {} };
58
- }
59
- function V(e) {
60
- const n = p(e.dataSource) ? e.dataSource : void 0;
61
- if (typeof e.sql == "string" && e.sql.trim()) {
62
- const o = [], r = Array.isArray(n == null ? void 0 : n.selectedEntities) ? n.selectedEntities : [];
63
- for (const a of r) {
64
- if (!E(a)) continue;
65
- const s = L(a, n);
66
- s && !o.some(
67
- (F) => h(
68
- F.source,
69
- s.source
70
- )
71
- ) && o.push(s);
72
- }
73
- return {
74
- cardId: e.id,
75
- kind: "sql",
76
- pinnedCatalogSources: o
77
- };
78
- }
79
- if (!p(e.config))
80
- return { cardId: e.id, kind: "unconfigured" };
81
- const i = [], d = p(e.config.matrixIntent) ? e.config.matrixIntent : void 0, t = e.type === "matrixTable" ? (d == null ? void 0 : d.kind) === "matrix" ? d.source : e.config.source : void 0;
82
- _(t) && i.push(t);
83
- const c = p(e.config.joinPlan) ? e.config.joinPlan : void 0;
84
- if (c) {
85
- const o = Array.isArray(c.joins) ? c.joins : [], r = [c.baseEntity];
86
- for (const a of o)
87
- p(a) && r.push(a.source, a.target);
88
- for (const a of r) {
89
- if (!E(a)) continue;
90
- const s = x(a, n);
91
- s && i.push(s);
92
- }
93
- } else if (e.type !== "matrixTable") {
94
- const o = Array.isArray(n == null ? void 0 : n.selectedEntities) ? n.selectedEntities : [];
95
- if (o.length === 1 && E(o[0])) {
96
- const r = x(o[0], n);
97
- r && i.push(r);
98
- }
99
- }
100
- if (!i.length && !c && e.type !== "matrixTable") {
101
- const o = e.config.queryBaseSource;
102
- _(o) && i.push(o);
103
- }
104
- return {
105
- cardId: e.id,
106
- kind: "config",
107
- executableSources: M(i)
108
- };
109
- }
110
- function U(e, n) {
111
- return (e.kind === "config" ? e.executableSources : e.kind === "sql" ? e.pinnedCatalogSources.map((d) => d.source) : []).some(
112
- (d) => h(d, n)
113
- );
114
- }
115
- function he(e, n) {
116
- if (e.kind === "config")
117
- return e.executableSources.find(
118
- (i) => h(i, n)
119
- );
120
- }
121
- function pe(e, n) {
122
- var i;
123
- return (i = B(e, n)) == null ? void 0 : i.source;
124
- }
125
- function B(e, n) {
126
- if (e.kind === "sql")
127
- return e.pinnedCatalogSources.find(
128
- (i) => h(i.source, n)
129
- );
130
- }
131
- function P(e) {
132
- const n = /* @__PURE__ */ new Set();
133
- for (const i of [e.name, e.sourceField]) {
134
- if (!i) continue;
135
- const d = I(i);
136
- if (!d) continue;
137
- n.add(d);
138
- const t = d.split("."), c = t[t.length - 1];
139
- c && n.add(c);
140
- }
141
- return n;
142
- }
143
- function j(e, n) {
144
- const i = D(e), d = D(n);
145
- return i === "unknown" || d === "unknown" ? !1 : (i === "date" || i === "datetime") && (d === "date" || d === "datetime") ? !0 : i === d;
146
- }
147
- function W(e, n) {
148
- return h(e.field.source, n.field.source) && I(e.field.name) === I(n.field.name) && I(e.field.sourceField || e.field.name) === I(n.field.sourceField || n.field.name);
149
- }
150
- function K(e, n) {
151
- if (e.kind !== "field") return !1;
152
- const i = P(n), d = P(e.field);
153
- return j(n.dataType, e.field.dataType) && [...d].some((t) => i.has(t));
154
- }
155
- function Ie(e) {
156
- const n = e.candidates.filter(
157
- (i) => K(
158
- i,
159
- e.logicalValueField
160
- )
161
- );
162
- return n.length === 1 ? { status: "matched", target: n[0] } : n.length > 1 ? { status: "ambiguous" } : { status: "notApplicable" };
163
- }
164
- function ye(e) {
165
- const n = [];
166
- for (const i of e.acceptedTargets)
167
- !j(
168
- e.logicalValueField.dataType,
169
- i.field.dataType
170
- ) || n.some(
171
- (d) => W(d, i)
172
- ) || n.push(i);
173
- return n.length === 1 ? { status: "matched", target: n[0] } : n.length > 1 ? { status: "ambiguous" } : { status: "notApplicable" };
174
- }
175
- const Y = /\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i, G = /\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i, J = /\bwhere\b/i;
176
- function Q(e) {
177
- return e != null && e.trim() ? Y.test(e) || G.test(e) : !1;
178
- }
179
- function $e(e) {
180
- return !(e != null && e.trim()) || Q(e) ? null : J.test(e) ? {
181
- helper: "{{ filters | and }}",
182
- description: "For queries with an existing WHERE clause."
183
- } : {
184
- helper: "{{ filters | where }}",
185
- description: "For queries without a WHERE clause."
186
- };
187
- }
188
- function X(e) {
189
- return (e.field.sourceField || e.field.name).trim() || void 0;
190
- }
191
- function _e(e) {
192
- if (e.inventory.kind !== "sql" || e.target.kind !== "field")
193
- return { status: "ineligible" };
194
- const n = B(
195
- e.inventory,
196
- e.target.field.source
197
- ), i = X(e.target);
198
- if (!n || !i) return { status: "ineligible" };
199
- if (n.executionTable) {
200
- const o = [
201
- n.executionTable.databaseName,
202
- n.executionTable.schemaName,
203
- n.executionTable.tableName,
204
- i
205
- ].filter(Boolean).join(".");
206
- return {
207
- status: "eligible",
208
- source: n.source,
209
- executionIdentifier: o
210
- };
211
- }
212
- if (e.inventory.pinnedCatalogSources.length !== 1)
213
- return { status: "ineligible" };
214
- const d = I(i), t = (e.candidateTargets || []).filter(
215
- (o) => I(
216
- o.field.sourceField || o.field.name
217
- ) === d
218
- ), c = [];
219
- for (const o of t)
220
- c.some(
221
- (r) => h(r, o.field.source)
222
- ) || c.push(o.field.source);
223
- return c.length > 1 ? { status: "ineligible" } : {
224
- status: "eligible",
225
- source: n.source,
226
- executionIdentifier: i
227
- };
228
- }
229
- class Z extends Error {
230
- constructor(i) {
231
- super(i.map((d) => d.message).join(" "));
232
- C(this, "issues");
233
- this.name = "DashboardFilterMappingContractError", this.issues = i;
234
- }
235
- }
236
- const ee = {
237
- string: !0,
238
- number: !0,
239
- boolean: !0,
240
- date: !0,
241
- datetime: !0
242
- };
243
- function m(e) {
244
- return typeof e == "string" && e.trim().length > 0;
245
- }
246
- function f(e) {
247
- return !!e && typeof e == "object" && !Array.isArray(e);
248
- }
249
- function $(e) {
250
- return Array.isArray(e) && e.every((n) => typeof n == "string");
251
- }
252
- function ne(e) {
253
- if (!f(e)) return !1;
254
- switch (e.kind) {
255
- case "allSheets":
256
- return e.sheetKinds === void 0 || $(e.sheetKinds) && e.sheetKinds.every(
257
- (n) => n === "dashboard" || n === "document"
258
- );
259
- case "sheets":
260
- return $(e.sheetIds);
261
- case "cards":
262
- return $(e.cardIds);
263
- case "documentSections":
264
- return m(e.sheetId) && $(e.sectionIds);
265
- default:
266
- return !1;
267
- }
268
- }
269
- function ie(e) {
270
- return e === "shared" || e === "perSheet" || e === "perCard" || e === "perDocumentSection";
271
- }
272
- function te(e) {
273
- return f(e) ? m(e.id) && m(e.column) && m(e.dataType) : !1;
274
- }
275
- function se(e, n, i, d) {
276
- var r;
277
- if (!f(n)) {
278
- d.push({
279
- code: "invalid_option_source",
280
- path: i,
281
- message: `${i} must be a semantic or physical option source.`,
282
- inputId: e
283
- });
284
- return;
285
- }
286
- const t = n.source, c = [
287
- ["labelField", n.labelField],
288
- ["valueField", n.valueField],
289
- ["searchField", n.searchField]
290
- ];
291
- if (!f(t) || t.kind !== "semantic" && t.kind !== "physical" || !N(t) || !f(n.labelField) || !f(n.valueField) || n.searchField !== void 0 && !f(n.searchField) || n.disambiguationFields !== void 0 && (!Array.isArray(n.disambiguationFields) || !n.disambiguationFields.every(f))) {
292
- d.push({
293
- code: "invalid_option_source",
294
- path: i,
295
- message: `${i} must contain a valid semantic or physical source and field references.`,
296
- inputId: e
297
- });
298
- return;
299
- }
300
- for (const [a, s] of c)
301
- s !== void 0 && f(s) && (!m(s.name) || s.source !== void 0 && !h(
302
- s.source,
303
- t
304
- )) && d.push({
305
- code: "invalid_option_source",
306
- path: `${i}.${a}`,
307
- message: `${i}.${a} must be a named field belonging to the declared option source.`,
308
- inputId: e
309
- });
310
- for (const [a, s] of ((r = n.disambiguationFields) == null ? void 0 : r.entries()) || [])
311
- (!f(s) || !m(s.name) || s.source !== void 0 && !h(
312
- s.source,
313
- t
314
- )) && d.push({
315
- code: "invalid_option_source",
316
- path: `${i}.disambiguationFields[${a}]`,
317
- message: `${i}.disambiguationFields[${a}] must be a named field belonging to the declared option source.`,
318
- inputId: e
319
- });
320
- const o = n.valueField;
321
- ["string", "number", "boolean", "date", "datetime"].includes(
322
- String(o.dataType)
323
- ) || d.push({
324
- code: "invalid_option_source",
325
- path: `${i}.valueField.dataType`,
326
- message: `${i}.valueField.dataType must be a known option-value datatype.`,
327
- inputId: e
328
- });
329
- }
330
- function re(e, n, i, d, t, c) {
331
- var s;
332
- if (m(n.bindingId) || t.push({
333
- code: "invalid_binding_id",
334
- path: `${i}.bindingId`,
335
- message: `${i}.bindingId must be an opaque non-empty id.`,
336
- inputId: e,
337
- cardId: n.cardId
338
- }), ((s = n.target) == null ? void 0 : s.kind) !== "field") {
339
- t.push({
340
- code: "unsupported_target",
341
- path: `${i}.target`,
342
- message: `${i}.target must be one direct field target.`,
343
- inputId: e,
344
- cardId: n.cardId,
345
- bindingId: n.bindingId
346
- });
347
- return;
348
- }
349
- const o = n.target.field;
350
- if (!m(o == null ? void 0 : o.name) || !o.source || o.source.kind !== "semantic" && o.source.kind !== "physical" || !N(o.source)) {
351
- t.push({
352
- code: "invalid_target_field",
353
- path: `${i}.target.field`,
354
- message: `${i}.target.field must have a name and a source-qualified semantic or physical identity.`,
355
- inputId: e,
356
- cardId: n.cardId,
357
- bindingId: n.bindingId
358
- });
359
- return;
360
- }
361
- if (Object.prototype.hasOwnProperty.call(
362
- ee,
363
- o.dataType
364
- ) || t.push({
365
- code: "unknown_target_data_type",
366
- path: `${i}.target.field.dataType`,
367
- message: `${i}.target.field.dataType must be known.`,
368
- inputId: e,
369
- cardId: n.cardId,
370
- bindingId: n.bindingId
371
- }), o.sourceField !== void 0 && !m(o.sourceField) && t.push({
372
- code: "invalid_target_field",
373
- path: `${i}.target.field.sourceField`,
374
- message: `${i}.target.field.sourceField must be a non-empty catalog-grounded column when provided.`,
375
- inputId: e,
376
- cardId: n.cardId,
377
- bindingId: n.bindingId
378
- }), !c) return;
379
- const r = d.get(n.cardId);
380
- if (!r) {
381
- t.push({
382
- code: "unknown_card",
383
- path: `${i}.cardId`,
384
- message: `${i}.cardId '${n.cardId}' does not exist.`,
385
- inputId: e,
386
- cardId: n.cardId,
387
- bindingId: n.bindingId
388
- });
389
- return;
390
- }
391
- const a = V(r);
392
- (a.kind === "unconfigured" || !U(a, o.source)) && t.push({
393
- code: "unavailable_card_source",
394
- path: `${i}.target.field.source`,
395
- message: `${i}.target field source is not declared by card '${r.id}'.`,
396
- inputId: e,
397
- cardId: r.id,
398
- bindingId: n.bindingId
399
- });
400
- }
401
- function oe(e, n, i, d, t, c) {
402
- if (n === void 0) return;
403
- if (!f(n) || n.kind !== "cardMappings" || !Array.isArray(n.cards)) {
404
- t.push({
405
- code: "invalid_application",
406
- path: i,
407
- message: `${i} must be a cardMappings application with a cards array.`,
408
- inputId: e
409
- });
410
- return;
411
- }
412
- const o = /* @__PURE__ */ new Set();
413
- n.cards.forEach((r, a) => {
414
- const s = `${i}.cards[${a}]`;
415
- if (!m(r == null ? void 0 : r.cardId)) {
416
- t.push({
417
- code: "unknown_card",
418
- path: `${s}.cardId`,
419
- message: `${s}.cardId is required.`,
420
- inputId: e
421
- });
422
- return;
423
- }
424
- if (o.has(r.cardId)) {
425
- t.push({
426
- code: "duplicate_card_application",
427
- path: `${s}.cardId`,
428
- message: `${i} contains more than one entry for card '${r.cardId}'.`,
429
- inputId: e,
430
- cardId: r.cardId
431
- });
432
- return;
433
- }
434
- if (o.add(r.cardId), c && !d.has(r.cardId)) {
435
- t.push({
436
- code: "unknown_card",
437
- path: `${s}.cardId`,
438
- message: `${s}.cardId '${r.cardId}' does not exist.`,
439
- inputId: e,
440
- cardId: r.cardId
441
- });
442
- return;
443
- }
444
- r.kind === "bound" ? re(
445
- e,
446
- r,
447
- s,
448
- d,
449
- t,
450
- c
451
- ) : r.kind !== "excluded" && t.push({
452
- code: "invalid_application",
453
- path: s,
454
- message: `${s}.kind must be 'bound' or 'excluded'.`,
455
- inputId: e,
456
- cardId: r.cardId
457
- });
458
- });
459
- }
460
- function de({
461
- inputs: e,
462
- dashboardFilters: n,
463
- cards: i = [],
464
- validateCardTargets: d = !1
465
- }) {
466
- const t = [], c = new Map(
467
- (n || []).map((s) => [s.id, s])
468
- ), o = new Map(
469
- d ? i.map((s) => [s.id, s]) : []
470
- ), r = [], a = /* @__PURE__ */ new Map();
471
- return e != null && !Array.isArray(e) ? (t.push({
472
- code: "invalid_input",
473
- path: "dashboard.inputs",
474
- message: "dashboard.inputs must be an array when present."
475
- }), { ok: !1, inputs: r, issues: t }) : ((Array.isArray(e) ? e : []).forEach((s, F) => {
476
- const u = `dashboard.inputs[${F}]`;
477
- if (!f(s) || s.kind !== "filter" && s.kind !== "control" || !m(s.id) || !m(s.label) || !m(s.variableName) || !ne(s.scope) || !ie(s.runtimeScope)) {
478
- t.push({
479
- code: "invalid_input",
480
- path: u,
481
- message: `${u} must be a complete filter or control Dashboard Input envelope.`,
482
- inputId: f(s) && typeof s.id == "string" ? s.id : void 0
483
- });
484
- return;
485
- }
486
- if (s.kind === "control" && !f(s.control)) {
487
- t.push({
488
- code: "invalid_input",
489
- path: `${u}.control`,
490
- message: `${u}.control must be a control definition.`,
491
- inputId: s.id
492
- });
493
- return;
494
- }
495
- const l = s;
496
- if (l.kind === "control") {
497
- r.push(l);
498
- return;
499
- }
500
- const T = l.filter, g = l.filterReference, y = T !== void 0, R = !!g;
501
- if (y && R) {
502
- t.push({
503
- code: "both_filter_definitions",
504
- path: u,
505
- message: `${u} must contain either filter or filterReference, not both.`,
506
- inputId: l.id
507
- });
508
- return;
509
- }
510
- if (!y && !R) {
511
- t.push({
512
- code: "missing_filter_definition",
513
- path: u,
514
- message: `${u} must contain filter or filterReference.`,
515
- inputId: l.id
516
- });
517
- return;
518
- }
519
- if (y && !te(T)) {
520
- t.push({
521
- code: "invalid_input",
522
- path: `${u}.filter`,
523
- message: `${u}.filter must be a complete dashboard filter definition.`,
524
- inputId: l.id
525
- });
526
- return;
527
- }
528
- let b, k;
529
- if (y)
530
- b = T, k = "embedded";
531
- else {
532
- if ((g == null ? void 0 : g.kind) !== "dashboardFilter") {
533
- t.push({
534
- code: "invalid_filter_reference",
535
- path: `${u}.filterReference.kind`,
536
- message: `${u}.filterReference.kind must be 'dashboardFilter'.`,
537
- inputId: l.id
538
- });
539
- return;
540
- }
541
- const v = typeof (g == null ? void 0 : g.filterId) == "string" ? g.filterId : void 0;
542
- if (b = v ? c.get(v) : void 0, k = "dashboardFilter", !b) {
543
- t.push({
544
- code: "orphaned_filter_reference",
545
- path: `${u}.filterReference.filterId`,
546
- message: `${u}.filterReference cannot resolve dashboard filter '${v || ""}'.`,
547
- inputId: l.id
548
- });
549
- return;
550
- }
551
- if (b.kind === "global-date") {
552
- t.push({
553
- code: "global_date_reference",
554
- path: `${u}.filterReference`,
555
- message: `${u}.filterReference cannot reference the Global Date filter.`,
556
- inputId: l.id
557
- });
558
- return;
559
- }
560
- const w = a.get(b.id);
561
- if (w) {
562
- t.push({
563
- code: "duplicate_filter_reference",
564
- path: `${u}.filterReference.filterId`,
565
- message: `${u}.filterReference duplicates dashboard filter '${b.id}' already owned by Dashboard Input '${w}'.`,
566
- inputId: l.id
567
- });
568
- return;
569
- }
570
- a.set(b.id, l.id);
571
- }
572
- if (!b) return;
573
- if (l.optionSource !== void 0 && se(
574
- l.id,
575
- l.optionSource,
576
- `${u}.optionSource`,
577
- t
578
- ), l.application && b.kind === "global-date") {
579
- t.push({
580
- code: "global_date_reference",
581
- path: `${u}.application`,
582
- message: `${u}.application cannot map the Global Date filter.`,
583
- inputId: l.id
584
- });
585
- return;
586
- }
587
- l.application && l.scope.kind !== "allSheets" && l.scope.kind !== "sheets" && t.push({
588
- code: "unsupported_mapped_scope",
589
- path: `${u}.scope`,
590
- message: `${u}.scope must be allSheets or sheets when cardMappings are present.`,
591
- inputId: l.id
592
- }), oe(
593
- l.id,
594
- l.application,
595
- `${u}.application`,
596
- o,
597
- t,
598
- d
599
- );
600
- const {
601
- filter: le,
602
- filterReference: ue,
603
- // A reference-backed authored input must shadow the generated
604
- // dashboard-filter compatibility input. Older writers may have copied
605
- // the compatibility marker onto the reference; never preserve it.
606
- compatibility: A,
607
- ...z
608
- } = l;
609
- r.push({
610
- ...z,
611
- filter: b,
612
- ...y && A ? { compatibility: A } : {},
613
- ...l.optionSource ? {
614
- optionSource: l.optionSource
615
- } : {},
616
- definitionOrigin: k
617
- });
618
- }), t.length ? { ok: !1, inputs: r, issues: t } : { ok: !0, inputs: r });
619
- }
620
- function Fe(e) {
621
- const n = de(e);
622
- if (!n.ok) throw new Z(n.issues);
623
- return n.inputs;
624
- }
625
- function Te(e = () => globalThis.crypto.randomUUID()) {
626
- return e();
627
- }
628
- const ae = {
629
- date: /* @__PURE__ */ new Set([
630
- "between",
631
- "not between",
632
- "=",
633
- "!=",
634
- ">",
635
- ">=",
636
- "<",
637
- "<=",
638
- "is null",
639
- "is not null"
640
- ]),
641
- number: /* @__PURE__ */ new Set([
642
- "between",
643
- "not between",
644
- "=",
645
- "!=",
646
- ">",
647
- ">=",
648
- "<",
649
- "<=",
650
- "in",
651
- "not in",
652
- "is null",
653
- "is not null"
654
- ]),
655
- string: /* @__PURE__ */ new Set([
656
- "=",
657
- "!=",
658
- "in",
659
- "not in",
660
- "like",
661
- "not like",
662
- "is null",
663
- "is not null"
664
- ]),
665
- boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
666
- };
667
- function ce(e) {
668
- const n = D(e);
669
- return n === "number" || n === "boolean" ? n : n === "date" || n === "datetime" ? "date" : "string";
670
- }
671
- function ke(e, n) {
672
- return typeof n != "string" ? !1 : ae[ce(e)].has(n);
673
- }
674
- export {
675
- Z as D,
676
- pe as a,
677
- V as b,
678
- B as c,
679
- U as d,
680
- K as e,
681
- he as f,
682
- ye as g,
683
- Q as h,
684
- $e as i,
685
- _e as j,
686
- Fe as k,
687
- Te as l,
688
- ce as m,
689
- de as n,
690
- ke as o,
691
- Ie as r
692
- };