react-semaphor 0.1.543 → 0.1.545
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/activity/index.js +73 -0
- package/dist/analytics-protocol/index.js +35 -34
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/briefings/index.js +56 -52
- package/dist/chunks/{class-utils-Df1OVOT1.js → _commonjsHelpers-DimLPMtv.js} +124 -98
- package/dist/chunks/{apply-dashboard-operations-CG9S7MGt.js → apply-dashboard-operations-CZEMsx8E.js} +778 -958
- package/dist/chunks/{assistant-chat-BFMRUYoB.js → assistant-chat-D7sWTypJ.js} +26 -27
- package/dist/chunks/calendar-day-equality-dvoQp1xW.js +410 -0
- package/dist/chunks/{comparison-window-caption-Bv18samq.js → comparison-window-caption-D4E6IHPD.js} +462 -456
- package/dist/chunks/{custom-visual-inputs-DUtpYZOk.js → custom-visual-inputs-DLCD9Y5V.js} +8 -2
- package/dist/chunks/dashboard-B1tMju0u.js +14 -0
- package/dist/chunks/dashboard-briefing-launcher-CePgIu0Z.js +3720 -0
- package/dist/chunks/{dashboard-controls-UGpjOM2k.js → dashboard-controls-Cq05n3e0.js} +526 -521
- package/dist/chunks/{dashboard-json-DG8dz0eX.js → dashboard-json-CoYRPqxx.js} +3 -3
- package/dist/chunks/document-dashboard-inputs-BesAHZvB.js +3112 -0
- package/dist/chunks/{edit-dashboard-visual-CDpA4y5e.js → edit-dashboard-visual-JPtNfJRb.js} +5628 -5618
- package/dist/chunks/export-file-format-C-tJsxsf.js +111 -0
- package/dist/chunks/{filter-value-text-CYsVYPuD.js → filter-value-text-ff7osJr7.js} +1 -1
- package/dist/chunks/{index-l5LclZvs.js → index-DRWiuqyd.js} +378 -332
- package/dist/chunks/{matrix-formatter-BnsTX90d.js → matrix-formatter-DnCyRXJE.js} +13 -13
- package/dist/chunks/{numeric-presentation-F_-H6VAw.js → numeric-presentation-7X_IrD58.js} +2572 -2573
- package/dist/chunks/{pivot-result-lifecycle-DupbRk-R.js → pivot-result-lifecycle-DM4CyGKs.js} +285 -393
- package/dist/chunks/{raw-temporal-presentation-D-azM_98.js → raw-temporal-presentation-C3mUgnEx.js} +2 -2
- package/dist/chunks/{zoned-wall-clock-MulfA26h.js → relative-date-label-Bk2j94pA.js} +21 -64
- package/dist/chunks/rendered-file-D8xEuVVx.js +108 -0
- package/dist/chunks/{report-preferences-dialog-CPwRwEJx.js → report-preferences-dialog-DUtuUL_5.js} +640 -612
- package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +9415 -0
- package/dist/chunks/{saved-dashboard-context-BKvMfRfC.js → saved-dashboard-context-LrF_kW0l.js} +183 -211
- package/dist/chunks/selection-filter-compiler-BKXmyLrS.js +79 -0
- package/dist/chunks/{semaphor-ready-indicator-CN2AHm2x.js → semaphor-ready-indicator-BxF96Yhv.js} +46859 -47102
- package/dist/chunks/shelf-drop-preview-context-CNaM_Gmh.js +2469 -0
- package/dist/chunks/{switch-C3jLxlG0.js → switch-uDtPgQlQ.js} +44 -45
- package/dist/chunks/{table-export-sheet-BDRXLLdq.js → table-export-sheet-YzMioA7Y.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BnclfB2k.js → use-create-flow-overlay-state-CjB7ig1o.js} +153 -164
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +46 -0
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +553 -541
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.js +241 -227
- package/dist/index.js +354 -331
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/activity.d.ts +2 -0
- package/dist/types/briefings/attachment-outcomes.d.ts +1 -1
- package/dist/types/briefings/attachments.d.ts +33 -6
- package/dist/types/briefings/index.d.ts +6 -5
- package/dist/types/components/activity/activity-bell.d.ts +11 -0
- package/dist/types/components/activity/activity-instance.d.ts +50 -0
- package/dist/types/components/activity/activity-notices.d.ts +7 -0
- package/dist/types/components/activity/activity-provider.d.ts +21 -0
- package/dist/types/components/activity/activity-types.d.ts +177 -0
- package/dist/types/components/activity/index.d.ts +6 -0
- package/dist/types/components/activity/use-activity.d.ts +20 -0
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
- package/dist/types/components/briefings/briefing-author.d.ts +14 -12
- package/dist/types/components/briefings/dashboard-briefing-launcher.d.ts +5 -0
- package/dist/types/components/briefings/use-briefing-run-detail.d.ts +34 -0
- package/dist/types/components/index.d.ts +1 -4
- package/dist/types/components/surfboard/filter/types.d.ts +0 -14
- package/dist/types/lib/activity-identity.d.ts +21 -0
- package/dist/types/lib/api/exports-api.d.ts +4 -4
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +68 -82
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +0 -8
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +35 -1
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +199 -0
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +7 -2
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +1 -1
- package/dist/types/lib/dashboard-viewer/captured-runtime-values.d.ts +40 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +16 -16
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +11 -9
- package/dist/types/lib/download-pdf.d.ts +75 -1
- package/dist/types/lib/hooks/index.d.ts +1 -3
- package/dist/types/lib/hooks/use-date-filter.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +5 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +5 -4
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
- package/dist/types/lib/query-context/assemble-card-query.d.ts +158 -0
- package/dist/types/lib/query-context/build-card-query-context.d.ts +3 -3
- package/dist/types/lib/query-context/build-dashboard-card-query-contract.d.ts +15 -6
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +11 -13
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +22 -12
- package/dist/types/lib/stores/dashboard-store.d.ts +39 -55
- package/dist/types/lib/stores/editor-store.d.ts +0 -3
- package/dist/types/lib/types/common-types.d.ts +21 -6
- package/dist/types/shared/activity/activity-contract.d.ts +84 -0
- package/dist/types/shared/activity/index.d.ts +5 -0
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -11
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +12 -12
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +92 -0
- package/dist/types/shared/dashboard-authoring/filter-model/ad-hoc-filter-values.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-definitions.d.ts +29 -0
- package/dist/types/shared/dashboard-authoring/filter-model/filter-values.d.ts +58 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/filter-model/prototype-document-inputs.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/filter-model/read-dashboard-filter-model.d.ts +78 -0
- package/dist/types/shared/dashboard-authoring/filter-model/stored-dashboard.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-model/toolbar-filter-reach.d.ts +23 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
- package/dist/types/shared/format-utils/export-policy.d.ts +12 -0
- package/dist/types/shared/format-utils/exporters/index.d.ts +2 -0
- package/dist/types/shared/format-utils/exporters/rendered-file.d.ts +106 -0
- package/package.json +6 -2
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +0 -28
- package/dist/chunks/calendar-day-equality-BmJAWduY.js +0 -460
- package/dist/chunks/dashboard-B9mKTJoy.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-Bdmry_oG.js +0 -4248
- package/dist/chunks/document-dashboard-inputs-OwqCbrVp.js +0 -8087
- package/dist/chunks/document-sheet-utils-BTb3VZxV.js +0 -3619
- package/dist/chunks/shelf-drop-preview-context-BGl_rxcW.js +0 -2407
- package/dist/chunks/sort-target-MT1WK1vX.js +0 -29
- package/dist/types/components/briefings/briefing-author/run-ui.d.ts +0 -81
- package/dist/types/components/briefings/use-briefing-run-polling.d.ts +0 -34
- package/dist/types/components/notifications/export-notification-item.d.ts +0 -24
- package/dist/types/components/notifications/export-notification-list.d.ts +0 -8
- package/dist/types/components/notifications/index.d.ts +0 -3
- package/dist/types/components/notifications/notification-bell.d.ts +0 -13
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +0 -88
- package/dist/types/lib/dashboard-inputs/dashboard-input-scope.d.ts +0 -10
- package/dist/types/lib/exports/bounded-request.d.ts +0 -12
- package/dist/types/lib/hooks/use-export-polling.d.ts +0 -32
- package/dist/types/lib/hooks/use-export-recovery.d.ts +0 -11
- package/dist/types/lib/stores/export-store.d.ts +0 -62
|
@@ -5,30 +5,29 @@ var xr = (e, t, r) => t.has(e) || yr("Cannot " + r);
|
|
|
5
5
|
var Z = (e, t, r) => (xr(e, t, "read from private field"), r ? r.call(e) : t.get(e)), se = (e, t, r) => t.has(e) ? yr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), J = (e, t, r, n) => (xr(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
|
|
6
6
|
import { jsx as m, jsxs as T, Fragment as Ve } from "react/jsx-runtime";
|
|
7
7
|
import { useCallback as ae, useRef as oe, useMemo as qe, useEffect as ke, useState as L, useLayoutEffect as Ze, useId as fo } from "react";
|
|
8
|
-
import { u as H,
|
|
8
|
+
import { u as H, dj as mo, bZ as ho, b$ as go, b0 as vo, cN as bo, T as yo, dk as xo, dl as wo, aZ as _o, dm as Io, bl as So, dn as Gt, cI as Eo, dp as No, dq as Yt, dr as bn, ds as ko, aT as yn, cc as wr, dt as xn, du as To, dv as Ao, dw as Co, bX as wn, aY as _n, aK as $o, a_ as zo, bk as at, dx as Oo, dy as Mo, dz as Po, dA as Ro, $ as In, c9 as Zo, ca as Do, cb as jo, cg as Fo, dB as Lo, dC as Uo, dD as Bo } from "./semaphor-ready-indicator-BxF96Yhv.js";
|
|
9
9
|
import { i as Vo } from "./conversation-sQiWYUOb.js";
|
|
10
|
-
import { B as te, i as qo, j as Jo, c as Sn, L as Je, P as En, a as Nn, b as kn } from "./switch-
|
|
10
|
+
import { B as te, i as qo, j as Jo, c as Sn, L as Je, P as En, a as Nn, b as kn } from "./switch-uDtPgQlQ.js";
|
|
11
11
|
import "./index-CuHybtft.js";
|
|
12
12
|
import "./validators-DMHTpf7a.js";
|
|
13
13
|
import "./matrix-operation-contract-8OIO4gob.js";
|
|
14
14
|
import "./analytics-base-schemas-BFAoRlkU.js";
|
|
15
15
|
import "zod";
|
|
16
16
|
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as Ko } from "../value-format-preferences/index.js";
|
|
17
|
-
import { c as q } from "./
|
|
17
|
+
import { g as Wo, c as q } from "./_commonjsHelpers-DimLPMtv.js";
|
|
18
18
|
import { f as Tn } from "./editor-draft-sync-BN5qYHPF.js";
|
|
19
|
-
import { A as
|
|
20
|
-
import { l as
|
|
21
|
-
import { p as Ir, a as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { w as
|
|
25
|
-
import { A as
|
|
26
|
-
import { v as Sr } from "./custom-visual-inputs-
|
|
27
|
-
import { g as ss } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
19
|
+
import { A as Go } from "./table-settings-CLZocegs.js";
|
|
20
|
+
import { l as Yo, m as Ke, c as _r, A as We, d as An } from "./context-ClREvqCZ.js";
|
|
21
|
+
import { p as Ir, a as Ho, A as Cn } from "./saved-dashboard-context-LrF_kW0l.js";
|
|
22
|
+
import { ch as Xo, aX as Qo } from "./resolve-dashboard-input-context-DJ2tICwz.js";
|
|
23
|
+
import { d as es } from "./document-dashboard-inputs-BesAHZvB.js";
|
|
24
|
+
import { w as ts, c as $n } from "./visual-choice-JiJ-_3bi.js";
|
|
25
|
+
import { A as rs, v as zn, t as ns, e as ue, d as as, b as os, f as Ht, s as Dt, a as ss } from "./add-to-dashboard-BuAqfA2Y.js";
|
|
26
|
+
import { v as Sr } from "./custom-visual-inputs-DLCD9Y5V.js";
|
|
28
27
|
import { S as Er, U as Nr, V as kr, O as Tr, f as is, F as ls } from "./temporal-bucket-D7NBrrtL.js";
|
|
29
28
|
import { C as cs, a as us } from "./selection-reducer-Dj_8xD69.js";
|
|
30
29
|
import { c as yt, X as Ge } from "./x-4f5U2XwU.js";
|
|
31
|
-
import {
|
|
30
|
+
import { s as ds, t as ps, u as fs, v as ot, w as ms, x as Ar, y as hs } from "./matrix-formatter-DnCyRXJE.js";
|
|
32
31
|
import { L as Cr } from "./layout-grid-Bgzth8vd.js";
|
|
33
32
|
function gs(e, t, r) {
|
|
34
33
|
const n = ds(), a = (r == null ? void 0 : r.locale) ?? n.locale ?? ps, o = fs(e, t);
|
|
@@ -115,7 +114,7 @@ class Mn extends Error {
|
|
|
115
114
|
function ws(e = "dashboard") {
|
|
116
115
|
let t;
|
|
117
116
|
return e === "none" ? () => {
|
|
118
|
-
const r =
|
|
117
|
+
const r = Xo();
|
|
119
118
|
return t && $r(t.reads, [r]) || (t = { reads: [r], sent: { context: Ir({ surface: "none", timeZone: r }) } }), t.sent;
|
|
120
119
|
} : ({ focus: r, snapshot: n, editing: a }) => {
|
|
121
120
|
var _;
|
|
@@ -129,7 +128,7 @@ function ws(e = "dashboard") {
|
|
|
129
128
|
unsavedEdits: !1,
|
|
130
129
|
runtimeValues: {
|
|
131
130
|
dashboardInputValues: o.dashboardInputValues,
|
|
132
|
-
|
|
131
|
+
adHocFilterValues: o.adHocFilterValues,
|
|
133
132
|
controlValues: o.controlValues,
|
|
134
133
|
inlineFilterValuesMap: o.inlineFilterValuesMap,
|
|
135
134
|
cardControlValuesMap: o.cardControlValuesMap,
|
|
@@ -151,7 +150,7 @@ function ws(e = "dashboard") {
|
|
|
151
150
|
s
|
|
152
151
|
];
|
|
153
152
|
if (t && $r(t.reads, y)) return t.sent;
|
|
154
|
-
const u = Ir(i), g = u.selectedCard ?
|
|
153
|
+
const u = Ir(i), g = u.selectedCard ? Ho({
|
|
155
154
|
dashboard: o.dashboard,
|
|
156
155
|
cardId: u.selectedCard.id,
|
|
157
156
|
snapshot: p ?? "pending",
|
|
@@ -173,11 +172,11 @@ function _s(e) {
|
|
|
173
172
|
var C, M;
|
|
174
173
|
const g = H.getState(), I = (C = g.dashboard) == null ? void 0 : C.id, _ = g.selectedSheetId;
|
|
175
174
|
if (!I || !_) throw new dt(Nt);
|
|
176
|
-
const N = { title: y.title, type:
|
|
175
|
+
const N = { title: y.title, type: rs[u], ...y.card }, E = !Is({ ...N, id: "check" }, y, u), b = { ...N, ...E ? { type: "table" } : {}, id: Sr() }, w = { id: Sr(), cards: [b], activeCardId: b.id }, h = await c(w, { reuseLoaded: !0 }).catch((Q) => {
|
|
177
176
|
console.warn("Adding the result without refreshed semantic metadata:", Q);
|
|
178
177
|
}), d = structuredClone(H.getState().semanticExecutionPayload);
|
|
179
178
|
yo(d, h);
|
|
180
|
-
const v =
|
|
179
|
+
const v = ts(
|
|
181
180
|
b.config ?? {},
|
|
182
181
|
Ss(b, _, d, s)
|
|
183
182
|
), f = v === (b.config ?? {}) ? w : { ...w, cards: [{ ...b, config: v }] }, x = H.getState();
|
|
@@ -214,7 +213,7 @@ function Pn(e, t) {
|
|
|
214
213
|
}
|
|
215
214
|
function Ss(e, t, r, n) {
|
|
216
215
|
var s;
|
|
217
|
-
const a = wo(H.getState()), o =
|
|
216
|
+
const a = wo(H.getState()), o = es({
|
|
218
217
|
...a,
|
|
219
218
|
cardId: e.id,
|
|
220
219
|
cardOverride: e,
|
|
@@ -6370,7 +6369,7 @@ function _p(e, t) {
|
|
|
6370
6369
|
};
|
|
6371
6370
|
}
|
|
6372
6371
|
var Ip = _p;
|
|
6373
|
-
const Sp = /* @__PURE__ */
|
|
6372
|
+
const Sp = /* @__PURE__ */ Wo(Ip);
|
|
6374
6373
|
function Ep(e, t) {
|
|
6375
6374
|
return t != null ? Sp(e, t) : e;
|
|
6376
6375
|
}
|
|
@@ -6563,7 +6562,7 @@ function Ap({ throttle: e, experimental_throttle: t, resume: r = !1, ...n } = {}
|
|
|
6563
6562
|
}
|
|
6564
6563
|
class De extends Error {
|
|
6565
6564
|
constructor(t, r = {}) {
|
|
6566
|
-
super(
|
|
6565
|
+
super(Yo(t, r)), this.code = t, this.name = "AssistantTurnRefusedError";
|
|
6567
6566
|
}
|
|
6568
6567
|
}
|
|
6569
6568
|
const ir = async (e, t) => {
|
|
@@ -6642,7 +6641,7 @@ function Rp(e) {
|
|
|
6642
6641
|
} catch (G) {
|
|
6643
6642
|
return i(Fp(G)), G instanceof Cn && t.current.onStaleFocus(), "not_sent";
|
|
6644
6643
|
}
|
|
6645
|
-
if (
|
|
6644
|
+
if (ns(M.context, k).length)
|
|
6646
6645
|
return i(Pp), "not_sent";
|
|
6647
6646
|
const Q = {
|
|
6648
6647
|
turnId: Up(),
|
|
@@ -6753,7 +6752,7 @@ function Mt(e, t) {
|
|
|
6753
6752
|
function Zp(e) {
|
|
6754
6753
|
return e.turns.flatMap((t) => {
|
|
6755
6754
|
var a;
|
|
6756
|
-
const r =
|
|
6755
|
+
const r = as(t.outcome), n = [...t.parts, ...r ? [r] : []].map(os);
|
|
6757
6756
|
return [
|
|
6758
6757
|
{
|
|
6759
6758
|
id: `${t.turnId}-question`,
|
|
@@ -7794,7 +7793,7 @@ function Cf(e, t) {
|
|
|
7794
7793
|
return { text: e.slice(0, n) + e.slice(t), caret: n };
|
|
7795
7794
|
}
|
|
7796
7795
|
const $f = [], zf = { withRequest: !0 };
|
|
7797
|
-
function
|
|
7796
|
+
function hm({
|
|
7798
7797
|
instance: e,
|
|
7799
7798
|
surface: t = "dashboard",
|
|
7800
7799
|
placement: r
|
|
@@ -7803,7 +7802,7 @@ function gm({
|
|
|
7803
7802
|
const n = t === "none", a = zo(), o = at(e.store, (A) => A.focus), s = at(e.store, (A) => A.isOpen), c = at(e.store, (A) => A.askCount), p = at(e.store, (A) => A.layout), i = n ? "full-page" : p, y = r ?? i, u = y === "beside-card", g = H(
|
|
7804
7803
|
(A) => {
|
|
7805
7804
|
var O;
|
|
7806
|
-
return o && A.dashboard ? (O =
|
|
7805
|
+
return o && A.dashboard ? (O = Go(A.dashboard, o.cardId)) == null ? void 0 : O.card : void 0;
|
|
7807
7806
|
}
|
|
7808
7807
|
), I = Rf(n), _ = oe(void 0), [N] = L(() => ws(t)), [E, b] = L([]), w = ae(
|
|
7809
7808
|
(A) => {
|
|
@@ -8145,7 +8144,7 @@ function gm({
|
|
|
8145
8144
|
}
|
|
8146
8145
|
function Of(e) {
|
|
8147
8146
|
try {
|
|
8148
|
-
return
|
|
8147
|
+
return ss(e().context);
|
|
8149
8148
|
} catch {
|
|
8150
8149
|
return [];
|
|
8151
8150
|
}
|
|
@@ -8299,5 +8298,5 @@ function Ff({
|
|
|
8299
8298
|
] });
|
|
8300
8299
|
}
|
|
8301
8300
|
export {
|
|
8302
|
-
|
|
8301
|
+
hm as default
|
|
8303
8302
|
};
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
import { r as B } from "./metric-comparison-DEwi9uc2.js";
|
|
2
|
+
import { l as F } from "./validators-DMHTpf7a.js";
|
|
3
|
+
import { a as W, w as y, z as S } from "./zoned-wall-clock-BkxV9jS2.js";
|
|
4
|
+
function j(t, e) {
|
|
5
|
+
return B({ ...t, role: e });
|
|
6
|
+
}
|
|
7
|
+
function it(t, e) {
|
|
8
|
+
if (e.id) {
|
|
9
|
+
const n = [];
|
|
10
|
+
t.forEach(
|
|
11
|
+
({ fields: s }, o) => s.forEach((r, a) => {
|
|
12
|
+
r.id === e.id && n.push({ group: o, index: a });
|
|
13
|
+
})
|
|
14
|
+
);
|
|
15
|
+
const i = e.alias ? n.find(
|
|
16
|
+
({ group: s, index: o }) => j(t[s].fields[o], t[s].role) === e.alias
|
|
17
|
+
) : void 0;
|
|
18
|
+
if (i) return i;
|
|
19
|
+
if (n.length === 1) return n[0];
|
|
20
|
+
}
|
|
21
|
+
for (let n = 0; n < t.length; n += 1) {
|
|
22
|
+
const i = t[n].fields.findIndex(
|
|
23
|
+
(s) => s.name === e.name && s.entityName === e.entityName && (s.alias === e.alias || !e.alias)
|
|
24
|
+
);
|
|
25
|
+
if (i !== -1) return { group: n, index: i };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function w(t, e) {
|
|
29
|
+
const n = t.split(".").map((a) => a.trim()), i = e.split(".").map((a) => a.trim());
|
|
30
|
+
if (n.length === 0 || i.length === 0 || n.some((a) => !a) || i.some((a) => !a))
|
|
31
|
+
return !1;
|
|
32
|
+
const [s, o] = n.length <= i.length ? [n, i] : [i, n], r = o.length - s.length;
|
|
33
|
+
return s.every((a, c) => a === o[c + r]);
|
|
34
|
+
}
|
|
35
|
+
function P(t, e) {
|
|
36
|
+
const n = t.split("."), i = e.split("."), s = n.pop(), o = i.pop();
|
|
37
|
+
return !!(s && s === o && n.length > 0 && i.length > 0 && w(
|
|
38
|
+
n.join("."),
|
|
39
|
+
i.join(".")
|
|
40
|
+
));
|
|
41
|
+
}
|
|
42
|
+
function R(t) {
|
|
43
|
+
const e = t.map((i) => i.trim()).filter(Boolean);
|
|
44
|
+
if (e.every(
|
|
45
|
+
(i, s) => e.slice(s + 1).every(
|
|
46
|
+
(o) => w(i, o)
|
|
47
|
+
)
|
|
48
|
+
))
|
|
49
|
+
return [...e].sort(
|
|
50
|
+
(i, s) => s.split(".").length - i.split(".").length
|
|
51
|
+
)[0];
|
|
52
|
+
}
|
|
53
|
+
function m(t) {
|
|
54
|
+
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
55
|
+
}
|
|
56
|
+
function M(t) {
|
|
57
|
+
if (typeof t != "string") return "";
|
|
58
|
+
const e = t.split(".").map((n) => n.trim());
|
|
59
|
+
return e.length > 1 && e.every(Boolean) ? e.join(".") : "";
|
|
60
|
+
}
|
|
61
|
+
function _(t) {
|
|
62
|
+
if (typeof t != "string") return "";
|
|
63
|
+
const e = t.split(".").map((n) => n.trim());
|
|
64
|
+
return e.length > 0 && e.every(Boolean) ? e.join(".") : "";
|
|
65
|
+
}
|
|
66
|
+
function d(t) {
|
|
67
|
+
return typeof t == "string" ? t.trim() : "";
|
|
68
|
+
}
|
|
69
|
+
function L(t, e) {
|
|
70
|
+
return t.every(
|
|
71
|
+
(n, i) => t.slice(i + 1).every((s) => e(n, s))
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
function O(t, e) {
|
|
75
|
+
const n = d(t.id), i = d(t.name), s = d(e.entityId), o = d(e.entityName);
|
|
76
|
+
return !i || !s && !o ? !1 : (!s || s === n || s === i) && (!o || o === i);
|
|
77
|
+
}
|
|
78
|
+
function Q(t) {
|
|
79
|
+
const e = m(t.semanticContext) ? t.semanticContext : void 0, n = m(t.fieldMeta) ? t.fieldMeta : void 0, i = d(e == null ? void 0 : e.semanticDomainId), s = Array.isArray(e == null ? void 0 : e.selectedEntities) ? e.selectedEntities.filter(
|
|
80
|
+
(I) => m(I) && I.type === "dataset"
|
|
81
|
+
) : [];
|
|
82
|
+
if (!!!(i || s.length > 0 || (n == null ? void 0 : n.entityType) === "dataset")) return;
|
|
83
|
+
if (!i)
|
|
84
|
+
return { status: "unresolved", reason: "incomplete_source_identity" };
|
|
85
|
+
const r = d(n == null ? void 0 : n.entityId), a = d(n == null ? void 0 : n.entityName), c = !!(r || a), l = c ? s.filter(
|
|
86
|
+
(I) => O(I, {
|
|
87
|
+
entityId: r,
|
|
88
|
+
entityName: a
|
|
89
|
+
})
|
|
90
|
+
) : s;
|
|
91
|
+
if (l.length > 1)
|
|
92
|
+
return { status: "unresolved", reason: "incomplete_source_identity" };
|
|
93
|
+
if (c && s.length > 0 && l.length === 0)
|
|
94
|
+
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
95
|
+
const u = l[0], f = d(u == null ? void 0 : u.domainId), D = d(u == null ? void 0 : u.id), p = d(u == null ? void 0 : u.name);
|
|
96
|
+
if (f && f !== i)
|
|
97
|
+
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
98
|
+
const q = D, A = p || a;
|
|
99
|
+
return A ? {
|
|
100
|
+
status: "resolved",
|
|
101
|
+
source: {
|
|
102
|
+
kind: "semantic",
|
|
103
|
+
domainId: i,
|
|
104
|
+
datasetName: A,
|
|
105
|
+
...q ? { datasetId: q } : {}
|
|
106
|
+
}
|
|
107
|
+
} : { status: "unresolved", reason: "incomplete_source_identity" };
|
|
108
|
+
}
|
|
109
|
+
function Y(t, e) {
|
|
110
|
+
const n = d(t.connectionId), i = m(t.semanticContext) ? t.semanticContext : void 0, s = d(i == null ? void 0 : i.connectionId);
|
|
111
|
+
if (n && s && n !== s)
|
|
112
|
+
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
113
|
+
const o = n || s, r = m(t.fieldMeta) ? t.fieldMeta : void 0, a = e.split(".").slice(0, -1).join("."), c = _(t.qualifiedTableName), l = _(
|
|
114
|
+
r == null ? void 0 : r.qualifiedEntityName
|
|
115
|
+
), u = [
|
|
116
|
+
c,
|
|
117
|
+
l,
|
|
118
|
+
a
|
|
119
|
+
].filter(Boolean), f = R(u);
|
|
120
|
+
return !f && u.length > 0 ? { status: "unresolved", reason: "divergent_source_identity" } : !o || !f ? { status: "unresolved", reason: "incomplete_source_identity" } : {
|
|
121
|
+
status: "resolved",
|
|
122
|
+
source: { kind: "physical", connectionId: o, tableName: f }
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
function H(t, e) {
|
|
126
|
+
const n = m(t.fieldMeta) ? t.fieldMeta : void 0, i = typeof (n == null ? void 0 : n.qualifiedFieldName) == "string" ? n.qualifiedFieldName.trim() : "", s = M(
|
|
127
|
+
n == null ? void 0 : n.qualifiedFieldName
|
|
128
|
+
), o = typeof t.column == "string" ? t.column.trim() : "", r = M(o), a = typeof t.qualifiedTableName == "string" ? t.qualifiedTableName.trim() : "", c = _(
|
|
129
|
+
t.qualifiedTableName
|
|
130
|
+
);
|
|
131
|
+
if (i && !s || e && a && !c || o.includes(".") && !r)
|
|
132
|
+
return { status: "unresolved", reason: "incomplete_field_identity" };
|
|
133
|
+
const l = r.split("."), u = r ? l[l.length - 1] : o, f = e && c && u ? `${c}.${u}` : "", D = [
|
|
134
|
+
s,
|
|
135
|
+
r,
|
|
136
|
+
f
|
|
137
|
+
].filter(Boolean);
|
|
138
|
+
if (!L(
|
|
139
|
+
D,
|
|
140
|
+
P
|
|
141
|
+
))
|
|
142
|
+
return { status: "unresolved", reason: "divergent_field_identity" };
|
|
143
|
+
const p = r || s || f;
|
|
144
|
+
return p ? { status: "resolved", qualifiedFieldName: p } : { status: "unresolved", reason: "incomplete_field_identity" };
|
|
145
|
+
}
|
|
146
|
+
function G(t) {
|
|
147
|
+
if (!m(t))
|
|
148
|
+
return { status: "ineligible", reason: "invalid_input" };
|
|
149
|
+
if (t.kind === "global-date")
|
|
150
|
+
return { status: "eligible", kind: "global_date" };
|
|
151
|
+
const e = F(t.dataType);
|
|
152
|
+
if (e !== "date" && e !== "datetime")
|
|
153
|
+
return { status: "ineligible", reason: "non_date_filter" };
|
|
154
|
+
const n = m(t.fieldMeta) ? t.fieldMeta : void 0, i = F(
|
|
155
|
+
n == null ? void 0 : n.dataType
|
|
156
|
+
);
|
|
157
|
+
if ((n == null ? void 0 : n.dataType) !== void 0 && i !== "date" && i !== "datetime")
|
|
158
|
+
return { status: "ineligible", reason: "non_date_filter" };
|
|
159
|
+
if (t.customFilterPreferences)
|
|
160
|
+
return { status: "ineligible", reason: "custom_filter" };
|
|
161
|
+
if (t.targetColumns !== void 0 && (!Array.isArray(t.targetColumns) || t.targetColumns.length > 0))
|
|
162
|
+
return { status: "ineligible", reason: "multi_target_filter" };
|
|
163
|
+
const s = Q(t), o = H(t, s === void 0);
|
|
164
|
+
if (o.status === "unresolved")
|
|
165
|
+
return { status: "ineligible", reason: o.reason };
|
|
166
|
+
const r = s || Y(t, o.qualifiedFieldName);
|
|
167
|
+
return r.status === "resolved" ? {
|
|
168
|
+
status: "eligible",
|
|
169
|
+
kind: "field_date",
|
|
170
|
+
qualifiedFieldName: o.qualifiedFieldName,
|
|
171
|
+
source: r.source
|
|
172
|
+
} : { status: "ineligible", reason: r.reason };
|
|
173
|
+
}
|
|
174
|
+
function J(t) {
|
|
175
|
+
if (!m(t) || t.kind !== "filter" || !m(t.filter))
|
|
176
|
+
return { status: "ineligible", reason: "invalid_input" };
|
|
177
|
+
const e = G(
|
|
178
|
+
t.filter
|
|
179
|
+
);
|
|
180
|
+
return e.status === "ineligible" ? e : e.kind === "field_date" && m(t.compatibility) && t.compatibility.source === "cardInlineFilter" ? { status: "ineligible", reason: "card_inline_filter" } : e;
|
|
181
|
+
}
|
|
182
|
+
function st(t) {
|
|
183
|
+
return J(t).status === "eligible";
|
|
184
|
+
}
|
|
185
|
+
function ot(t) {
|
|
186
|
+
return `compat-filter:${t}`;
|
|
187
|
+
}
|
|
188
|
+
function rt(t) {
|
|
189
|
+
return `compat-control:${t}`;
|
|
190
|
+
}
|
|
191
|
+
function at(t, e) {
|
|
192
|
+
return `compat-inline-filter:${t}:${e}`;
|
|
193
|
+
}
|
|
194
|
+
function ut(t, e) {
|
|
195
|
+
return `compat-card-control:${t}:${e}`;
|
|
196
|
+
}
|
|
197
|
+
const T = 864e5, E = {
|
|
198
|
+
second: 1e3,
|
|
199
|
+
minute: 6e4,
|
|
200
|
+
hour: 36e5
|
|
201
|
+
};
|
|
202
|
+
function N(t, e) {
|
|
203
|
+
return {
|
|
204
|
+
...S(t, e),
|
|
205
|
+
millisecond: (t.getTime() % 1e3 + 1e3) % 1e3
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function g(t, e) {
|
|
209
|
+
return W(t, e);
|
|
210
|
+
}
|
|
211
|
+
function v(t) {
|
|
212
|
+
const e = new Date(t);
|
|
213
|
+
return {
|
|
214
|
+
year: e.getUTCFullYear(),
|
|
215
|
+
month: e.getUTCMonth() + 1,
|
|
216
|
+
day: e.getUTCDate(),
|
|
217
|
+
hour: e.getUTCHours(),
|
|
218
|
+
minute: e.getUTCMinutes(),
|
|
219
|
+
second: e.getUTCSeconds(),
|
|
220
|
+
millisecond: e.getUTCMilliseconds()
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function U(t, e) {
|
|
224
|
+
const n = /* @__PURE__ */ new Date(0);
|
|
225
|
+
return n.setUTCFullYear(t, e, 0), n.getUTCDate();
|
|
226
|
+
}
|
|
227
|
+
function C(t, e) {
|
|
228
|
+
const n = t.year * 12 + (t.month - 1) + e, i = Math.floor(n / 12), s = n - i * 12 + 1;
|
|
229
|
+
return { ...t, year: i, month: s, day: Math.min(t.day, U(i, s)) };
|
|
230
|
+
}
|
|
231
|
+
function h(t, e, n) {
|
|
232
|
+
if (e === 0) return t;
|
|
233
|
+
switch (n) {
|
|
234
|
+
case "second":
|
|
235
|
+
case "minute":
|
|
236
|
+
case "hour":
|
|
237
|
+
return v(
|
|
238
|
+
y(t) + e * E[n]
|
|
239
|
+
);
|
|
240
|
+
case "day":
|
|
241
|
+
return v(y(t) + e * T);
|
|
242
|
+
case "week":
|
|
243
|
+
return v(y(t) + e * 7 * T);
|
|
244
|
+
case "month":
|
|
245
|
+
return C(t, e);
|
|
246
|
+
case "quarter":
|
|
247
|
+
return C(t, e * 3);
|
|
248
|
+
case "year":
|
|
249
|
+
return C(t, e * 12);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function K(t) {
|
|
253
|
+
return new Date(
|
|
254
|
+
y({ ...t, hour: 0, minute: 0, second: 0 })
|
|
255
|
+
).getUTCDay();
|
|
256
|
+
}
|
|
257
|
+
function k(t) {
|
|
258
|
+
var n;
|
|
259
|
+
const e = (n = t.fiscalCalendar) == null ? void 0 : n.yearStartMonth;
|
|
260
|
+
return e && e >= 1 && e <= 12 ? e : 1;
|
|
261
|
+
}
|
|
262
|
+
function V(t, e, n) {
|
|
263
|
+
const i = { ...t, hour: 0, minute: 0, second: 0, millisecond: 0 };
|
|
264
|
+
switch (e) {
|
|
265
|
+
case "day":
|
|
266
|
+
return i;
|
|
267
|
+
case "week":
|
|
268
|
+
return h(
|
|
269
|
+
i,
|
|
270
|
+
-((K(t) - n.weekStart + 7) % 7),
|
|
271
|
+
"day"
|
|
272
|
+
);
|
|
273
|
+
case "month":
|
|
274
|
+
return { ...i, day: 1 };
|
|
275
|
+
case "quarter": {
|
|
276
|
+
const s = (t.month - k(n) + 12) % 12;
|
|
277
|
+
return C({ ...i, day: 1 }, -(s % 3));
|
|
278
|
+
}
|
|
279
|
+
case "year": {
|
|
280
|
+
const s = k(n);
|
|
281
|
+
return {
|
|
282
|
+
...i,
|
|
283
|
+
year: t.month >= s ? t.year : t.year - 1,
|
|
284
|
+
month: s,
|
|
285
|
+
day: 1
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
function b(t, e, n, i = 0) {
|
|
291
|
+
const s = E[e];
|
|
292
|
+
if (s !== void 0) {
|
|
293
|
+
const a = N(t, n.tz), c = a.millisecond + (e === "second" ? 0 : a.second * 1e3) + (e === "hour" ? a.minute * 6e4 : 0), l = t.getTime() - c + i * s;
|
|
294
|
+
return { start: new Date(l), endExclusive: new Date(l + s) };
|
|
295
|
+
}
|
|
296
|
+
const o = e, r = h(
|
|
297
|
+
V(N(t, n.tz), o, n),
|
|
298
|
+
i,
|
|
299
|
+
e
|
|
300
|
+
);
|
|
301
|
+
return {
|
|
302
|
+
start: g(r, n.tz),
|
|
303
|
+
endExclusive: g(h(r, 1, e), n.tz)
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
function x(t, e, n) {
|
|
307
|
+
return b(t, e, n).start;
|
|
308
|
+
}
|
|
309
|
+
function z(t, e, n) {
|
|
310
|
+
return new Date(b(t, e, n).endExclusive.getTime() - 1);
|
|
311
|
+
}
|
|
312
|
+
function X(t, e, n, i) {
|
|
313
|
+
return e === 0 ? t : g(
|
|
314
|
+
h(N(t, i.tz), e, n),
|
|
315
|
+
i.tz
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
function ct(t, e, n) {
|
|
319
|
+
const i = (s) => {
|
|
320
|
+
const { year: o, month: r, day: a } = S(s, n);
|
|
321
|
+
return y({ year: o, month: r, day: a, hour: 0, minute: 0, second: 0 });
|
|
322
|
+
};
|
|
323
|
+
return Math.round((i(e) - i(t)) / T);
|
|
324
|
+
}
|
|
325
|
+
const Z = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
326
|
+
function dt(t, e) {
|
|
327
|
+
const { year: n, month: i, day: s } = S(t, e);
|
|
328
|
+
return `${String(n).padStart(4, "0")}-${String(i).padStart(2, "0")}-${String(s).padStart(2, "0")}`;
|
|
329
|
+
}
|
|
330
|
+
function $(t) {
|
|
331
|
+
const e = Z.exec(t);
|
|
332
|
+
if (!e) return null;
|
|
333
|
+
const n = Number(e[1]), i = Number(e[2]), s = Number(e[3]);
|
|
334
|
+
return i < 1 || i > 12 || s < 1 || s > U(n, i) ? null : { year: n, month: i, day: s };
|
|
335
|
+
}
|
|
336
|
+
function lt(t, e) {
|
|
337
|
+
const n = $(t);
|
|
338
|
+
if (!n) return null;
|
|
339
|
+
const i = { ...n, hour: 0, minute: 0, second: 0, millisecond: 0 };
|
|
340
|
+
return {
|
|
341
|
+
start: g(i, e),
|
|
342
|
+
endExclusive: g(h(i, 1, "day"), e)
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
function mt(t, e, n) {
|
|
346
|
+
const i = (o) => new Date(b(n, t.unit, e, o).endExclusive.getTime() - 1), s = (o) => b(n, t.unit, e, o).start;
|
|
347
|
+
switch (t.mode) {
|
|
348
|
+
case "last":
|
|
349
|
+
return t.unit === "minute" || t.unit === "hour" ? {
|
|
350
|
+
start: new Date(
|
|
351
|
+
n.getTime() - t.n * E[t.unit]
|
|
352
|
+
),
|
|
353
|
+
end: n
|
|
354
|
+
} : t.complete ? { start: s(-t.n), end: i(-1) } : { start: X(n, -t.n, t.unit, e), end: n };
|
|
355
|
+
case "this": {
|
|
356
|
+
if (t.boundary && t.unit === "month") {
|
|
357
|
+
const o = t.boundary === "first_day" ? x(n, "month", e) : z(n, "month", e);
|
|
358
|
+
return {
|
|
359
|
+
start: x(o, "day", e),
|
|
360
|
+
end: z(o, "day", e)
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
return { start: s(0), end: t.toDate ? n : i(0) };
|
|
364
|
+
}
|
|
365
|
+
case "previous":
|
|
366
|
+
return { start: s(-1), end: i(-1) };
|
|
367
|
+
case "between":
|
|
368
|
+
return { start: s(t.from), end: i(t.to) };
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function ft(t) {
|
|
372
|
+
const { operation: e, values: n, temporalPrecision: i } = t;
|
|
373
|
+
if (e !== "=" && e !== "!=" || i === "minute")
|
|
374
|
+
return null;
|
|
375
|
+
const s = Array.isArray(n) ? n : [n];
|
|
376
|
+
if (s.length !== 1 || typeof s[0] != "string") return null;
|
|
377
|
+
const o = s[0].trim();
|
|
378
|
+
return $(o) ? { operation: e, day: o } : null;
|
|
379
|
+
}
|
|
380
|
+
export {
|
|
381
|
+
P as A,
|
|
382
|
+
w as B,
|
|
383
|
+
E,
|
|
384
|
+
j as a,
|
|
385
|
+
O as b,
|
|
386
|
+
J as c,
|
|
387
|
+
rt as d,
|
|
388
|
+
at as e,
|
|
389
|
+
it as f,
|
|
390
|
+
ot as g,
|
|
391
|
+
ut as h,
|
|
392
|
+
st as i,
|
|
393
|
+
g as j,
|
|
394
|
+
U as k,
|
|
395
|
+
h as l,
|
|
396
|
+
K as m,
|
|
397
|
+
x as n,
|
|
398
|
+
z as o,
|
|
399
|
+
b as p,
|
|
400
|
+
ct as q,
|
|
401
|
+
G as r,
|
|
402
|
+
X as s,
|
|
403
|
+
dt as t,
|
|
404
|
+
$ as u,
|
|
405
|
+
lt as v,
|
|
406
|
+
N as w,
|
|
407
|
+
mt as x,
|
|
408
|
+
ft as y,
|
|
409
|
+
R as z
|
|
410
|
+
};
|