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.
- package/dist/analytics-protocol/index.js +415 -375
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +8 -8
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{add-to-dashboard-ClhEIFst.js → add-to-dashboard-CFF-wFU-.js} +1 -1
- package/dist/chunks/{analytics-base-schemas-DevrgqQb.js → analytics-base-schemas-DsUh5Q3C.js} +14 -12
- package/dist/chunks/{assistant-chat-BE0XXzZP.js → assistant-chat-B6hNQI1t.js} +146 -146
- package/dist/chunks/{bookmark-impact-DXDAN5AY.js → bookmark-impact-Ba2PLcGp.js} +3 -3
- package/dist/chunks/{bookmark-state-BMyB3Tb6.js → bookmark-state-n7AaNzR_.js} +517 -516
- package/dist/chunks/{card-filter-builder-CE0-YVN5.js → card-filter-builder-Y22HizVx.js} +474 -474
- package/dist/chunks/{comparison-window-caption-Dxj2CHOa.js → comparison-window-caption-Ck2TIbnR.js} +69 -69
- package/dist/chunks/{context-BJoEFgNl.js → context-UCQ7sere.js} +1 -1
- package/dist/chunks/{dashboard-mJKPFRbb.js → dashboard-BghI99oY.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CntwKyiZ.js → dashboard-briefing-launcher-DtBAnGiH.js} +725 -716
- package/dist/chunks/{dashboard-controls-XO089DMg.js → dashboard-controls-CtFXlyjV.js} +53 -53
- package/dist/chunks/{dashboard-json-CQRiydUv.js → dashboard-json-DfGBUtCd.js} +5 -5
- package/dist/chunks/dates-BnrXF4bb.js +185 -0
- package/dist/chunks/{edit-dashboard-visual-f-Dm-BLR.js → edit-dashboard-visual-oxt3x1wb.js} +8081 -8268
- package/dist/chunks/{filter-line-CKNMyNTQ.js → filter-line-Cy5YYqRL.js} +27 -27
- package/dist/chunks/{filter-reach-copy-B8GGyVuR.js → filter-reach-copy-CE_ZX147.js} +1786 -2214
- package/dist/chunks/{filter-value-text-CRtKecI5.js → filter-value-text-fWvSDwkl.js} +11 -11
- package/dist/chunks/{index-DoPApnxg.js → index-D5rxbtS4.js} +24 -24
- package/dist/chunks/{layout-grid-CiSCZdIr.js → layout-grid-9LndRoLa.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-myf3D3Qx.js → matrix-analytical-definition-CCp48UCw.js} +496 -425
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +391 -0
- package/dist/chunks/{matrix-operation-contract-C1SuOHLZ.js → matrix-operation-contract-DPBj69D8.js} +518 -514
- package/dist/chunks/{metric-comparison-Cm0G893W.js → metric-comparison-B0FR-Q8I.js} +184 -125
- package/dist/chunks/{paintbrush-DQIwqlck.js → paintbrush-58FQYY-y.js} +1 -1
- package/dist/chunks/{palette-Cun747Rg.js → palette-Be62Tkoa.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-C1Dyx8du.js → pivot-result-contract-expectations-BYqAmG9n.js} +1236 -1190
- package/dist/chunks/{pivot-result-identity-CBS-ssEp.js → pivot-result-identity-CAP4--iq.js} +1 -1
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +3778 -0
- package/dist/chunks/{report-preferences-dialog-SDZEcG2x.js → report-preferences-dialog-uJp9GBTM.js} +219 -205
- package/dist/chunks/{report-runtime-context-BbedQdtc.js → report-runtime-context-c77_KF9v.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-DRBS0eRa.js → resolve-dashboard-input-context-Rtl1ffmE.js} +8808 -7291
- package/dist/chunks/{save-Dj5bjm7P.js → save-C5A0JnEV.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-DWVlJcsa.js → saved-dashboard-context-tcyTU8jm.js} +199 -213
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +150 -0
- package/dist/chunks/{semaphor-ready-indicator-OFOoAY-A.js → semaphor-ready-indicator-FBvunj6S.js} +37894 -35726
- package/dist/chunks/{shelf-drop-preview-context-2swWypXu.js → shelf-drop-preview-context-QKStrcK9.js} +54 -54
- package/dist/chunks/{stored-dashboard-NtOuEX6a.js → stored-dashboard-CHozcAY9.js} +770 -743
- package/dist/chunks/{style-sheet-parts-Qv4UcLAo.js → style-sheet-parts-CDCG-8Ej.js} +258 -251
- package/dist/chunks/{table-export-sheet-Do7ZB0_F.js → table-export-sheet-ZFIvs6Sj.js} +1 -1
- package/dist/chunks/{token-types-Dy_aXO-U.js → token-types-XbM6QByy.js} +1 -1
- package/dist/chunks/{upload-Bq-puSVy.js → upload-H15d7uHK.js} +1 -1
- package/dist/chunks/{validators-C7DFk3QK.js → validators-Baf3VIf5.js} +5 -5
- package/dist/chunks/{variable-draft-Cy03qnEi.js → variable-draft-C2y8Jp6Z.js} +27 -28
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +3392 -2761
- package/dist/format-utils/index.js +205 -204
- package/dist/index.js +73 -75
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/dashboard/dashboard-web-component.d.ts +7 -0
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +1 -1
- package/dist/types/lib/document/document-edits.d.ts +0 -4
- package/dist/types/lib/query-context/assemble-card-query.d.ts +6 -1
- package/dist/types/lib/stores/dashboard-store.d.ts +30 -1
- package/dist/types/lib/types/common-types.d.ts +0 -2
- package/dist/types/lib/types/explorer-types.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +15 -0
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
- package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
- package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
- package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +129 -0
- package/dist/types/shared/dashboard-authoring/calculations/resolve-dashboard-field-copies.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/calculations/tokens.d.ts +36 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
- package/dist/types/shared/dashboard-authoring/changes/calculation-change.d.ts +399 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +165 -360
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +23 -2
- package/dist/types/shared/dashboard-authoring/changes/domain-change.d.ts +143 -266
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
- package/dist/types/shared/dashboard-authoring/index.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
- package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +158 -0
- package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +71 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +17 -6
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +21 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +3 -0
- package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
- package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
- package/dist/types/shared/temporal/index.d.ts +2 -0
- package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
- package/dist/types/shared/temporal/temporal.d.ts +27 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
- package/dist/types/shared/usage-events/details.d.ts +2 -2
- package/dist/types/shared/usage-events/envelope.d.ts +2 -2
- package/dist/usage-events/index.js +1 -1
- package/package.json +3 -2
- package/dist/chunks/dates-B-Urp5OD.js +0 -164
- package/dist/chunks/matrix-member-presentation-g0c_NpDW.js +0 -258
- package/dist/chunks/raw-temporal-value-DN_l-Tss.js +0 -454
- package/dist/chunks/selection-filter-compiler-DmAr7yqC.js +0 -131
|
@@ -5,26 +5,26 @@ var Qt = (e, t, a) => t.has(e) || Yt("Cannot " + a);
|
|
|
5
5
|
var B = (e, t, a) => (Qt(e, t, "read from private field"), a ? a.call(e) : t.get(e)), oe = (e, t, a) => t.has(e) ? Yt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), W = (e, t, a, s) => (Qt(e, t, "write to private field"), s ? s.call(e, a) : t.set(e, a), a);
|
|
6
6
|
import { jsx as d, jsxs as b, Fragment as xe } from "react/jsx-runtime";
|
|
7
7
|
import { useCallback as G, useRef as te, useMemo as We, useEffect as ve, useState as $, useLayoutEffect as _e, useId as Xs } from "react";
|
|
8
|
-
import { u as H,
|
|
9
|
-
import { c as Re, B as q, X as He, p as Ua, q as $r, j as Pe, L as we, I as $t, R as jr, e as za, f as qa, h as Va } from "./style-sheet-parts-
|
|
8
|
+
import { u as H, dp as er, ba as tr, bu as ar, ac as sr, dq as rr, dr as nr, ad as Xt, b7 as or, ds as ir, bP as lr, dt as dr, du as Rt, dv as cr, dw as ur, dx as dt, dy as _a, dz as pr, bT as qe, d5 as ea, dA as Oa, af as mr, c$ as Ra, bx as fr, cU as Pt, dB as hr, b_ as Pa, dC as Da, dD as Dt, bQ as gr, dE as $a, dF as yr, bS as br, bV as vr, dG as xr, dH as wr, d2 as Nr, d3 as Ir, dI as Sr, d4 as Ar, da as Cr, dJ as Er, cS as pt, d9 as Tr, de as Mr, bM as ja, b5 as Fa, b8 as kr, bo as tt, b3 as La, dK as _r, dL as Or, dM as Rr, dN as Pr, am as Ba, dO as Dr } from "./semaphor-ready-indicator-FBvunj6S.js";
|
|
9
|
+
import { c as Re, B as q, X as He, p as Ua, q as $r, j as Pe, L as we, I as $t, R as jr, e as za, f as qa, h as Va } from "./style-sheet-parts-CDCG-8Ej.js";
|
|
10
10
|
import { g as Fr, c as F } from "./pickers-DkqmtnTL.js";
|
|
11
|
-
import "./validators-
|
|
12
|
-
import "./matrix-operation-contract-
|
|
13
|
-
import "./analytics-base-schemas-
|
|
11
|
+
import "./validators-Baf3VIf5.js";
|
|
12
|
+
import "./matrix-operation-contract-DPBj69D8.js";
|
|
13
|
+
import "./analytics-base-schemas-DsUh5Q3C.js";
|
|
14
14
|
import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as Lr } from "../value-format-preferences/index.js";
|
|
15
|
-
import {
|
|
16
|
-
import { n as Ur, o as Ge, c as It, A as ze, d as Za } from "./context-
|
|
17
|
-
import { p as ta, a as zr, A as Ja } from "./saved-dashboard-context-
|
|
18
|
-
import {
|
|
19
|
-
import { u as Ka, d as Zr } from "./report-preferences-dialog-
|
|
20
|
-
import { i as Jr } from "./stored-dashboard-
|
|
21
|
-
import {
|
|
15
|
+
import { L as Br } from "./bookmark-state-n7AaNzR_.js";
|
|
16
|
+
import { n as Ur, o as Ge, c as It, A as ze, d as Za } from "./context-UCQ7sere.js";
|
|
17
|
+
import { p as ta, a as zr, A as Ja } from "./saved-dashboard-context-tcyTU8jm.js";
|
|
18
|
+
import { ia as qr, q as Vr, ib as aa } from "./resolve-dashboard-input-context-Rtl1ffmE.js";
|
|
19
|
+
import { u as Ka, d as Zr } from "./report-preferences-dialog-uJp9GBTM.js";
|
|
20
|
+
import { i as Jr } from "./stored-dashboard-CHozcAY9.js";
|
|
21
|
+
import { b as Kr } from "./selection-filter-compiler-DNijjI5y.js";
|
|
22
22
|
import { c as Wa } from "./visual-choice-DDfHfHvY.js";
|
|
23
|
-
import { n as Wr, v as Ha, o as Hr, t as Gr, x as jt, l as ce, d as Yr, b as Qr, m as Ft, M as mt, r as Xr, w as en, h as tn, j as an, s as St, f as sn, a as rn } from "./add-to-dashboard-
|
|
23
|
+
import { n as Wr, v as Ha, o as Hr, t as Gr, x as jt, l as ce, d as Yr, b as Qr, m as Ft, M as mt, r as Xr, w as en, h as tn, j as an, s as St, f as sn, a as rn } from "./add-to-dashboard-CFF-wFU-.js";
|
|
24
24
|
import { safeParseAsync as nn, lazy as on, unknown as ln, union as dn, string as cn, record as un, object as pn, number as mn, null as fn, never as hn, looseObject as gn, literal as yn, instanceof as bn, enum as vn, discriminatedUnion as xn, custom as wn, boolean as Nn, array as In } from "zod/v4";
|
|
25
25
|
import { toJSONSchema as Sn } from "zod/v4/core";
|
|
26
|
-
import {
|
|
27
|
-
import { L as la } from "./layout-grid-
|
|
26
|
+
import { aY as An, aZ as Cn, a_ as En, a$ as at, b0 as Tn, b1 as sa, b2 as ra, b3 as na, b4 as oa, b5 as ia, b6 as Mn, ap as kn, an as _n } from "./pivot-result-contract-expectations-BYqAmG9n.js";
|
|
27
|
+
import { L as la } from "./layout-grid-9LndRoLa.js";
|
|
28
28
|
function On(e, t, a) {
|
|
29
29
|
const s = An(), r = (a == null ? void 0 : a.locale) ?? s.locale ?? Cn, l = En(e, t);
|
|
30
30
|
if (isNaN(l))
|
|
@@ -58,7 +58,7 @@ function On(e, t, a) {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function Rn(e, t) {
|
|
61
|
-
return On(e,
|
|
61
|
+
return On(e, Mn(e), t);
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -201,22 +201,22 @@ function Bn(e) {
|
|
|
201
201
|
}), r = H((n) => n.isVisualEditing), l = tr(), i = ar();
|
|
202
202
|
return { add: G(
|
|
203
203
|
async (n, h) => {
|
|
204
|
-
var I,
|
|
204
|
+
var I, k;
|
|
205
205
|
const c = H.getState(), m = (I = c.dashboard) == null ? void 0 : I.id, x = c.selectedSheetId;
|
|
206
206
|
if (!m || !x) throw new Ke(ft);
|
|
207
|
-
const C = { title: n.title, type: Wr[h], ...n.card }, w = !zn({ ...C, id: "check" }, n, h), A = { ...C, ...w ? { type: "table" } : {}, id: aa() }, T = { id: aa(), cards: [A], activeCardId: A.id },
|
|
207
|
+
const C = { title: n.title, type: Wr[h], ...n.card }, w = !zn({ ...C, id: "check" }, n, h), A = { ...C, ...w ? { type: "table" } : {}, id: aa() }, T = { id: aa(), cards: [A], activeCardId: A.id }, M = await i(T, { reuseLoaded: !0 }).catch((L) => {
|
|
208
208
|
console.warn("Adding the result without refreshed semantic metadata:", L);
|
|
209
209
|
}), N = structuredClone(H.getState().semanticExecutionPayload);
|
|
210
|
-
sr(N,
|
|
210
|
+
sr(N, M);
|
|
211
211
|
const u = Kr(
|
|
212
212
|
A.config ?? {},
|
|
213
213
|
qn(A, x, N, l)
|
|
214
214
|
), y = u === (A.config ?? {}) ? T : { ...T, cards: [{ ...A, config: u }] }, f = H.getState();
|
|
215
|
-
if (((
|
|
215
|
+
if (((k = f.dashboard) == null ? void 0 : k.id) !== m || f.selectedSheetId !== x || f.isVisualEditing)
|
|
216
216
|
throw new Ke(ft);
|
|
217
217
|
if (!a()) throw new Ke(Un);
|
|
218
218
|
const { actions: v } = f;
|
|
219
|
-
if (v.setIsDashboardEditing(!0), v.addFrame(x, y, { semanticExecutionPayload:
|
|
219
|
+
if (v.setIsDashboardEditing(!0), v.addFrame(x, y, { semanticExecutionPayload: M }), !Xa(H.getState().dashboard, y.id))
|
|
220
220
|
throw f.isDashboardEditing || v.setIsDashboardEditing(!1), new Ke(ft);
|
|
221
221
|
return { frameId: y.id, asTable: w };
|
|
222
222
|
},
|
|
@@ -446,7 +446,7 @@ function to(e) {
|
|
|
446
446
|
}
|
|
447
447
|
const I = y.charCodeAt(f);
|
|
448
448
|
if (ma(y, f, I)) {
|
|
449
|
-
const
|
|
449
|
+
const k = y.charCodeAt(f + 5) === Ae ? f + 6 : f + 5, L = y.slice(k, v);
|
|
450
450
|
if (c === 0 && y.charCodeAt(v + 1) === pa) {
|
|
451
451
|
t({ id: n, event: m, data: L }), n = void 0, h = "", m = void 0, f = v + 2, v = y.indexOf(`
|
|
452
452
|
`, f);
|
|
@@ -466,10 +466,10 @@ ${L}`, c++;
|
|
|
466
466
|
for (; f < y.length; ) {
|
|
467
467
|
const v = y.indexOf("\r", f), I = y.indexOf(`
|
|
468
468
|
`, f);
|
|
469
|
-
let
|
|
470
|
-
if (v !== -1 && I !== -1 ?
|
|
469
|
+
let k = -1;
|
|
470
|
+
if (v !== -1 && I !== -1 ? k = v < I ? v : I : v !== -1 ? v === y.length - 1 ? k = -1 : k = v : I !== -1 && (k = I), k === -1)
|
|
471
471
|
break;
|
|
472
|
-
T(y, f,
|
|
472
|
+
T(y, f, k), f = k + 1, y.charCodeAt(f - 1) === eo && y.charCodeAt(f) === pa && f++;
|
|
473
473
|
}
|
|
474
474
|
return y.slice(f);
|
|
475
475
|
}
|
|
@@ -501,15 +501,15 @@ ${ue}`, c++;
|
|
|
501
501
|
}
|
|
502
502
|
return;
|
|
503
503
|
}
|
|
504
|
-
const
|
|
504
|
+
const k = y.slice(f, v), L = k.indexOf(":");
|
|
505
505
|
if (L === -1) {
|
|
506
|
-
k
|
|
506
|
+
M(k, "", k);
|
|
507
507
|
return;
|
|
508
508
|
}
|
|
509
|
-
const V =
|
|
510
|
-
|
|
509
|
+
const V = k.slice(0, L), De = k.charCodeAt(L + 1) === Ae ? 2 : 1, $e = k.slice(L + De);
|
|
510
|
+
M(V, $e, k);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function M(y, f, v) {
|
|
513
513
|
switch (y) {
|
|
514
514
|
case "event":
|
|
515
515
|
m = f || void 0;
|
|
@@ -1102,7 +1102,7 @@ const Ct = {
|
|
|
1102
1102
|
ZodBoolean: "boolean",
|
|
1103
1103
|
ZodNull: "null"
|
|
1104
1104
|
};
|
|
1105
|
-
function
|
|
1105
|
+
function Mo(e, t) {
|
|
1106
1106
|
const a = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
1107
1107
|
if (a.every((s) => s._def.typeName in Ct && (!s._def.checks || !s._def.checks.length))) {
|
|
1108
1108
|
const s = a.reduce((r, l) => {
|
|
@@ -1137,9 +1137,9 @@ function ko(e, t) {
|
|
|
1137
1137
|
type: "string",
|
|
1138
1138
|
enum: a.reduce((s, r) => [...s, ...r._def.values.filter((l) => !s.includes(l))], [])
|
|
1139
1139
|
};
|
|
1140
|
-
return
|
|
1140
|
+
return ko(e, t);
|
|
1141
1141
|
}
|
|
1142
|
-
const
|
|
1142
|
+
const ko = (e, t) => {
|
|
1143
1143
|
const a = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((s, r) => j(s._def, {
|
|
1144
1144
|
...t,
|
|
1145
1145
|
currentPath: [
|
|
@@ -1338,7 +1338,7 @@ const qo = (e, t) => j(e.innerType._def, t), Vo = (e, t, a) => {
|
|
|
1338
1338
|
return po(e, a);
|
|
1339
1339
|
case "ZodUnion":
|
|
1340
1340
|
case "ZodDiscriminatedUnion":
|
|
1341
|
-
return
|
|
1341
|
+
return Mo(e, a);
|
|
1342
1342
|
case "ZodIntersection":
|
|
1343
1343
|
return wo(e, a);
|
|
1344
1344
|
case "ZodTuple":
|
|
@@ -1877,7 +1877,7 @@ const o = {
|
|
|
1877
1877
|
})
|
|
1878
1878
|
]))
|
|
1879
1879
|
})
|
|
1880
|
-
]),
|
|
1880
|
+
]), Ms = o.object({
|
|
1881
1881
|
type: o.literal("tool-result"),
|
|
1882
1882
|
toolCallId: o.string(),
|
|
1883
1883
|
toolName: o.string(),
|
|
@@ -1917,13 +1917,13 @@ const o = {
|
|
|
1917
1917
|
di,
|
|
1918
1918
|
ui,
|
|
1919
1919
|
pi,
|
|
1920
|
-
|
|
1920
|
+
Ms,
|
|
1921
1921
|
fi
|
|
1922
1922
|
]))]),
|
|
1923
1923
|
providerOptions: O.optional()
|
|
1924
1924
|
}), vi = o.object({
|
|
1925
1925
|
role: o.literal("tool"),
|
|
1926
|
-
content: o.array(o.union([
|
|
1926
|
+
content: o.array(o.union([Ms, hi])),
|
|
1927
1927
|
providerOptions: O.optional()
|
|
1928
1928
|
});
|
|
1929
1929
|
o.union([
|
|
@@ -2374,10 +2374,10 @@ function Si(e) {
|
|
|
2374
2374
|
function de(e) {
|
|
2375
2375
|
return it(e) || Si(e);
|
|
2376
2376
|
}
|
|
2377
|
-
function
|
|
2377
|
+
function Mt(e) {
|
|
2378
2378
|
return e.type.split("-").slice(1).join("-");
|
|
2379
2379
|
}
|
|
2380
|
-
function
|
|
2380
|
+
function ks({ lastMessage: e, messageId: t }) {
|
|
2381
2381
|
const a = (e == null ? void 0 : e.role) === "assistant" ? e : {
|
|
2382
2382
|
id: t,
|
|
2383
2383
|
metadata: void 0,
|
|
@@ -2391,7 +2391,7 @@ function Ms({ lastMessage: e, messageId: t }) {
|
|
|
2391
2391
|
it(i) && l++, i.state === "input-streaming" && (s[i.toolCallId] = {
|
|
2392
2392
|
text: i.rawInput ?? "",
|
|
2393
2393
|
index: p,
|
|
2394
|
-
toolName: i.type === "dynamic-tool" ? i.toolName :
|
|
2394
|
+
toolName: i.type === "dynamic-tool" ? i.toolName : Mt(i),
|
|
2395
2395
|
dynamic: i.type === "dynamic-tool",
|
|
2396
2396
|
title: i.title,
|
|
2397
2397
|
toolMetadata: i.toolMetadata
|
|
@@ -2448,15 +2448,15 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2448
2448
|
return y;
|
|
2449
2449
|
}
|
|
2450
2450
|
function T(u, y) {
|
|
2451
|
-
const f = y ?? x().find((
|
|
2451
|
+
const f = y ?? x().find((k) => it(k) && k.toolCallId === u.toolCallId), v = u, I = f;
|
|
2452
2452
|
if (f != null) {
|
|
2453
2453
|
f.state = u.state, I.input = v.input, I.output = v.output, I.errorText = v.errorText, I.rawInput = v.rawInput, I.preliminary = v.preliminary, u.title !== void 0 && (I.title = u.title), u.toolMetadata !== void 0 && (I.toolMetadata = u.toolMetadata), I.providerExecuted = v.providerExecuted ?? f.providerExecuted;
|
|
2454
|
-
const
|
|
2455
|
-
if (
|
|
2454
|
+
const k = v.providerMetadata;
|
|
2455
|
+
if (k != null)
|
|
2456
2456
|
if (u.state === "output-available" || u.state === "output-error") {
|
|
2457
2457
|
const L = f;
|
|
2458
|
-
L.resultProviderMetadata =
|
|
2459
|
-
} else f.callProviderMetadata =
|
|
2458
|
+
L.resultProviderMetadata = k;
|
|
2459
|
+
} else f.callProviderMetadata = k;
|
|
2460
2460
|
} else c.message.parts.push({
|
|
2461
2461
|
type: `tool-${u.toolName}`,
|
|
2462
2462
|
toolCallId: u.toolCallId,
|
|
@@ -2473,16 +2473,16 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2473
2473
|
...v.providerMetadata != null && !(u.state === "output-available" || u.state === "output-error") ? { callProviderMetadata: v.providerMetadata } : {}
|
|
2474
2474
|
});
|
|
2475
2475
|
}
|
|
2476
|
-
function
|
|
2477
|
-
const f = y ?? x().find((
|
|
2476
|
+
function M(u, y) {
|
|
2477
|
+
const f = y ?? x().find((k) => k.type === "dynamic-tool" && k.toolCallId === u.toolCallId), v = u, I = f;
|
|
2478
2478
|
if (f != null) {
|
|
2479
2479
|
f.state = u.state, I.toolName = u.toolName, I.input = v.input, I.output = v.output, I.errorText = v.errorText, I.rawInput = v.rawInput, I.preliminary = v.preliminary, u.title !== void 0 && (I.title = u.title), u.toolMetadata !== void 0 && (I.toolMetadata = u.toolMetadata), I.providerExecuted = v.providerExecuted ?? f.providerExecuted;
|
|
2480
|
-
const
|
|
2481
|
-
if (
|
|
2480
|
+
const k = v.providerMetadata;
|
|
2481
|
+
if (k != null)
|
|
2482
2482
|
if (u.state === "output-available" || u.state === "output-error") {
|
|
2483
2483
|
const L = f;
|
|
2484
|
-
L.resultProviderMetadata =
|
|
2485
|
-
} else f.callProviderMetadata =
|
|
2484
|
+
L.resultProviderMetadata = k;
|
|
2485
|
+
} else f.callProviderMetadata = k;
|
|
2486
2486
|
} else c.message.parts.push({
|
|
2487
2487
|
type: "dynamic-tool",
|
|
2488
2488
|
toolName: u.toolName,
|
|
@@ -2620,7 +2620,7 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2620
2620
|
dynamic: n.dynamic,
|
|
2621
2621
|
title: n.title,
|
|
2622
2622
|
toolMetadata: n.toolMetadata
|
|
2623
|
-
}, n.dynamic ?
|
|
2623
|
+
}, n.dynamic ? M({
|
|
2624
2624
|
toolCallId: n.toolCallId,
|
|
2625
2625
|
toolName: n.toolName,
|
|
2626
2626
|
state: "input-streaming",
|
|
@@ -2650,7 +2650,7 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2650
2650
|
});
|
|
2651
2651
|
u.text += n.inputTextDelta;
|
|
2652
2652
|
const { value: y } = await wi(u.text);
|
|
2653
|
-
u.dynamic ?
|
|
2653
|
+
u.dynamic ? M({
|
|
2654
2654
|
toolCallId: n.toolCallId,
|
|
2655
2655
|
toolName: u.toolName,
|
|
2656
2656
|
state: "input-streaming",
|
|
@@ -2670,7 +2670,7 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2670
2670
|
break;
|
|
2671
2671
|
}
|
|
2672
2672
|
case "tool-input-available":
|
|
2673
|
-
n.dynamic ?
|
|
2673
|
+
n.dynamic ? M({
|
|
2674
2674
|
toolCallId: n.toolCallId,
|
|
2675
2675
|
toolName: n.toolName,
|
|
2676
2676
|
state: "input-available",
|
|
@@ -2692,7 +2692,7 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2692
2692
|
break;
|
|
2693
2693
|
case "tool-input-error": {
|
|
2694
2694
|
const u = x().filter(de).find((y) => y.toolCallId === n.toolCallId);
|
|
2695
|
-
(u != null ? u.type === "dynamic-tool" : n.dynamic) ?
|
|
2695
|
+
(u != null ? u.type === "dynamic-tool" : n.dynamic) ? M({
|
|
2696
2696
|
toolCallId: n.toolCallId,
|
|
2697
2697
|
toolName: n.toolName,
|
|
2698
2698
|
state: "output-error",
|
|
@@ -2742,7 +2742,7 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2742
2742
|
}
|
|
2743
2743
|
case "tool-output-available": {
|
|
2744
2744
|
const u = w(n.toolCallId);
|
|
2745
|
-
u.type === "dynamic-tool" ?
|
|
2745
|
+
u.type === "dynamic-tool" ? M({
|
|
2746
2746
|
toolCallId: n.toolCallId,
|
|
2747
2747
|
toolName: u.toolName,
|
|
2748
2748
|
state: "output-available",
|
|
@@ -2755,7 +2755,7 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2755
2755
|
toolMetadata: n.toolMetadata ?? u.toolMetadata
|
|
2756
2756
|
}, u) : T({
|
|
2757
2757
|
toolCallId: n.toolCallId,
|
|
2758
|
-
toolName:
|
|
2758
|
+
toolName: Mt(u),
|
|
2759
2759
|
state: "output-available",
|
|
2760
2760
|
input: u.input,
|
|
2761
2761
|
output: n.output,
|
|
@@ -2769,7 +2769,7 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2769
2769
|
}
|
|
2770
2770
|
case "tool-output-error": {
|
|
2771
2771
|
const u = w(n.toolCallId);
|
|
2772
|
-
u.type === "dynamic-tool" ?
|
|
2772
|
+
u.type === "dynamic-tool" ? M({
|
|
2773
2773
|
toolCallId: n.toolCallId,
|
|
2774
2774
|
toolName: u.toolName,
|
|
2775
2775
|
state: "output-error",
|
|
@@ -2781,7 +2781,7 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2781
2781
|
toolMetadata: n.toolMetadata ?? u.toolMetadata
|
|
2782
2782
|
}, u) : T({
|
|
2783
2783
|
toolCallId: n.toolCallId,
|
|
2784
|
-
toolName:
|
|
2784
|
+
toolName: Mt(u),
|
|
2785
2785
|
state: "output-error",
|
|
2786
2786
|
input: u.input,
|
|
2787
2787
|
rawInput: u.rawInput,
|
|
@@ -2804,7 +2804,7 @@ function Ai({ stream: e, messageMetadataSchema: t, dataPartSchemas: a, runUpdate
|
|
|
2804
2804
|
break;
|
|
2805
2805
|
}
|
|
2806
2806
|
case "start":
|
|
2807
|
-
n.messageId != null && (g || p && n.messageId !== c.message.id) && Object.assign(c,
|
|
2807
|
+
n.messageId != null && (g || p && n.messageId !== c.message.id) && Object.assign(c, ks({
|
|
2808
2808
|
lastMessage: void 0,
|
|
2809
2809
|
messageId: n.messageId
|
|
2810
2810
|
}), { finishReason: void 0 }), n.messageId != null && (c.message.id = n.messageId), await N(n.messageMetadata), (n.messageId != null || n.messageMetadata != null) && m({ updateStatus: !1 });
|
|
@@ -2988,7 +2988,7 @@ async function va({ response: e, url: t, fallbackMessage: a }) {
|
|
|
2988
2988
|
responseBody: s
|
|
2989
2989
|
});
|
|
2990
2990
|
}
|
|
2991
|
-
async function
|
|
2991
|
+
async function Mi(e) {
|
|
2992
2992
|
if (e == null) return [];
|
|
2993
2993
|
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw new Xn({
|
|
2994
2994
|
functionality: "FileList",
|
|
@@ -3010,7 +3010,7 @@ async function ki(e) {
|
|
|
3010
3010
|
};
|
|
3011
3011
|
}));
|
|
3012
3012
|
}
|
|
3013
|
-
function
|
|
3013
|
+
function ki(e, t) {
|
|
3014
3014
|
const a = e.search(/[?#]/), s = a === -1 ? e : e.slice(0, a), r = a === -1 ? "" : e.slice(a);
|
|
3015
3015
|
return `${s.endsWith("/") && t.startsWith("/") ? s.slice(0, -1) : s}${t}${r}`;
|
|
3016
3016
|
}
|
|
@@ -3084,7 +3084,7 @@ var _i = class {
|
|
|
3084
3084
|
value: e.chatId,
|
|
3085
3085
|
message: 'Chat IDs must not be "." or ".." when using the default reconnect URL.'
|
|
3086
3086
|
});
|
|
3087
|
-
i =
|
|
3087
|
+
i = ki(this.api, `/${encodeURIComponent(e.chatId)}/stream`);
|
|
3088
3088
|
}
|
|
3089
3089
|
const p = (l == null ? void 0 : l.headers) !== void 0 ? je(l.headers) : r, g = (l == null ? void 0 : l.credentials) ?? s, n = await (this.fetch ?? globalThis.fetch)(i, {
|
|
3090
3090
|
method: "GET",
|
|
@@ -3123,9 +3123,9 @@ var _i = class {
|
|
|
3123
3123
|
if (w == null) {
|
|
3124
3124
|
w = (C = this.lastMessage) == null ? void 0 : C.id;
|
|
3125
3125
|
for (let T = this.state.messages.length - 1; T >= 0; T--) {
|
|
3126
|
-
const
|
|
3127
|
-
if (
|
|
3128
|
-
w =
|
|
3126
|
+
const M = this.state.messages[T];
|
|
3127
|
+
if (M.role === "assistant" && M.parts.some((N) => de(N) && N.state === "approval-responded")) {
|
|
3128
|
+
w = M.id;
|
|
3129
3129
|
break;
|
|
3130
3130
|
}
|
|
3131
3131
|
}
|
|
@@ -3144,7 +3144,7 @@ var _i = class {
|
|
|
3144
3144
|
this.pendingMessagePreparations.add(w);
|
|
3145
3145
|
let A;
|
|
3146
3146
|
try {
|
|
3147
|
-
A = Array.isArray(c.files) ? c.files : await
|
|
3147
|
+
A = Array.isArray(c.files) ? c.files : await Mi(c.files);
|
|
3148
3148
|
} finally {
|
|
3149
3149
|
this.pendingMessagePreparations.delete(w);
|
|
3150
3150
|
}
|
|
@@ -3203,26 +3203,26 @@ var _i = class {
|
|
|
3203
3203
|
}, this.clearError = () => {
|
|
3204
3204
|
this.status === "error" && (this.state.error = void 0, this.setStatus({ status: "ready" }));
|
|
3205
3205
|
}, this.addToolApprovalResponse = async ({ id: c, approved: m, reason: x, options: C }) => this.jobExecutor.run(async () => {
|
|
3206
|
-
const w = this.state.messages, A = (
|
|
3207
|
-
...
|
|
3206
|
+
const w = this.state.messages, A = (M) => de(M) && M.state === "approval-requested" && M.approval.id === c ? {
|
|
3207
|
+
...M,
|
|
3208
3208
|
state: "approval-responded",
|
|
3209
3209
|
approval: {
|
|
3210
|
-
...
|
|
3210
|
+
...M.approval,
|
|
3211
3211
|
id: c,
|
|
3212
3212
|
approved: m,
|
|
3213
3213
|
reason: x
|
|
3214
3214
|
}
|
|
3215
|
-
} :
|
|
3215
|
+
} : M, T = w.findIndex((M) => M.parts.some((N) => de(N) && N.state === "approval-requested" && N.approval.id === c));
|
|
3216
3216
|
if (T !== -1) {
|
|
3217
|
-
const
|
|
3217
|
+
const M = w[T];
|
|
3218
3218
|
this.state.replaceMessage(T, {
|
|
3219
|
-
...
|
|
3220
|
-
parts:
|
|
3221
|
-
}), this.pendingApprovalMessageId =
|
|
3219
|
+
...M,
|
|
3220
|
+
parts: M.parts.map(A)
|
|
3221
|
+
}), this.pendingApprovalMessageId = M.id;
|
|
3222
3222
|
}
|
|
3223
3223
|
if (this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(A)), T !== -1 && this.status !== "streaming" && this.status !== "submitted" && this.sendAutomaticallyWhen) {
|
|
3224
|
-
const
|
|
3225
|
-
|
|
3224
|
+
const M = await this.shouldSendAutomatically();
|
|
3225
|
+
M && this.runAutomaticRequest(() => {
|
|
3226
3226
|
var u;
|
|
3227
3227
|
const N = T === -1 ? (u = this.lastMessage) == null ? void 0 : u.id : w[T].id;
|
|
3228
3228
|
return this.makeRequestForToolApproval({
|
|
@@ -3230,10 +3230,10 @@ var _i = class {
|
|
|
3230
3230
|
messageIndex: T,
|
|
3231
3231
|
...C
|
|
3232
3232
|
});
|
|
3233
|
-
},
|
|
3233
|
+
}, M);
|
|
3234
3234
|
}
|
|
3235
3235
|
}), this.addToolOutput = async ({ state: c, toolCallId: m, output: x, errorText: C, options: w }) => this.jobExecutor.run(async () => {
|
|
3236
|
-
const A = this.state.messages, T = A[A.length - 1],
|
|
3236
|
+
const A = this.state.messages, T = A[A.length - 1], M = (N) => {
|
|
3237
3237
|
if (!de(N) || N.toolCallId !== m) return N;
|
|
3238
3238
|
const { approval: u, ...y } = N, f = (u == null ? void 0 : u.approved) === !0 ? { approval: {
|
|
3239
3239
|
...u,
|
|
@@ -3257,8 +3257,8 @@ var _i = class {
|
|
|
3257
3257
|
};
|
|
3258
3258
|
if (this.state.replaceMessage(A.length - 1, {
|
|
3259
3259
|
...T,
|
|
3260
|
-
parts: T.parts.map(
|
|
3261
|
-
}), this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(
|
|
3260
|
+
parts: T.parts.map(M)
|
|
3261
|
+
}), this.activeResponse && (this.activeResponse.state.message.parts = this.activeResponse.state.message.parts.map(M)), this.status !== "streaming" && this.status !== "submitted" && this.sendAutomaticallyWhen) {
|
|
3262
3262
|
const N = await this.shouldSendAutomatically();
|
|
3263
3263
|
N && this.runAutomaticRequest(() => {
|
|
3264
3264
|
var u;
|
|
@@ -3389,10 +3389,10 @@ var _i = class {
|
|
|
3389
3389
|
error: void 0
|
|
3390
3390
|
});
|
|
3391
3391
|
const c = this.lastMessage, m = e === "submit-message" && r != null ? this.state.messages.findIndex((f) => f.id === r) : this.state.messages.length - 1, x = m === -1 ? c : this.state.messages[m], C = e === "resume-stream" && (x == null ? void 0 : x.role) === "assistant" && x.parts.some((f) => de(f) && (f.state === "input-streaming" || f.state === "input-available" && f.providerExecuted || f.state === "approval-responded")) ? this.state.snapshot(x) : void 0, w = m !== -1 && m < this.state.messages.length - 1 && (x == null ? void 0 : x.role) === "assistant";
|
|
3392
|
-
let A = !1, T = !1,
|
|
3392
|
+
let A = !1, T = !1, M = !1, N;
|
|
3393
3393
|
try {
|
|
3394
3394
|
const f = {
|
|
3395
|
-
state: e === "resume-stream" && this.resumableStreamState != null ? this.resumableStreamState :
|
|
3395
|
+
state: e === "resume-stream" && this.resumableStreamState != null ? this.resumableStreamState : ks({
|
|
3396
3396
|
lastMessage: e === "resume-stream" ? C : e === "regenerate-message" ? void 0 : this.state.snapshot(x),
|
|
3397
3397
|
messageId: this.generateId()
|
|
3398
3398
|
}),
|
|
@@ -3413,7 +3413,7 @@ var _i = class {
|
|
|
3413
3413
|
trigger: e,
|
|
3414
3414
|
messageId: r
|
|
3415
3415
|
});
|
|
3416
|
-
const I = (
|
|
3416
|
+
const I = (k) => this.jobExecutor.run(() => f.abortController.signal.aborted ? Promise.resolve() : k({
|
|
3417
3417
|
state: f.state,
|
|
3418
3418
|
write: ({ updateStatus: L = !0 } = {}) => {
|
|
3419
3419
|
var V;
|
|
@@ -3430,13 +3430,13 @@ var _i = class {
|
|
|
3430
3430
|
messageMetadataSchema: this.messageMetadataSchema,
|
|
3431
3431
|
dataPartSchemas: this.dataPartSchemas,
|
|
3432
3432
|
runUpdateMessageJob: I,
|
|
3433
|
-
onError: (
|
|
3434
|
-
throw
|
|
3433
|
+
onError: (k) => {
|
|
3434
|
+
throw k;
|
|
3435
3435
|
}
|
|
3436
3436
|
}),
|
|
3437
3437
|
abortSignal: f.abortController.signal,
|
|
3438
|
-
onError: (
|
|
3439
|
-
throw
|
|
3438
|
+
onError: (k) => {
|
|
3439
|
+
throw k;
|
|
3440
3440
|
}
|
|
3441
3441
|
}), A)
|
|
3442
3442
|
return g() && (this.setStatus({ status: "ready" }), this.resumableStreamState === f.state && (this.resumableStreamState = void 0)), null;
|
|
@@ -3445,7 +3445,7 @@ var _i = class {
|
|
|
3445
3445
|
if (A || f.name === "AbortError")
|
|
3446
3446
|
return A = !0, g() && (this.setStatus({ status: "ready" }), this.resumableStreamState === (N == null ? void 0 : N.state) && (this.resumableStreamState = void 0)), null;
|
|
3447
3447
|
if (!g()) return null;
|
|
3448
|
-
if (
|
|
3448
|
+
if (M = !0, f instanceof TypeError) {
|
|
3449
3449
|
const v = f.message.toLowerCase();
|
|
3450
3450
|
T = v.includes("fetch") || v.includes("network") || v === "load failed";
|
|
3451
3451
|
}
|
|
@@ -3460,14 +3460,14 @@ var _i = class {
|
|
|
3460
3460
|
messages: this.state.messages,
|
|
3461
3461
|
isAbort: A,
|
|
3462
3462
|
isDisconnect: T,
|
|
3463
|
-
isError:
|
|
3463
|
+
isError: M,
|
|
3464
3464
|
finishReason: N.state.finishReason
|
|
3465
3465
|
}));
|
|
3466
3466
|
} finally {
|
|
3467
3467
|
this.activeResponse === N && (this.activeResponse = void 0), n();
|
|
3468
3468
|
}
|
|
3469
3469
|
}
|
|
3470
|
-
!A && !
|
|
3470
|
+
!A && !M && await this.runAutomaticRequest(() => {
|
|
3471
3471
|
var f;
|
|
3472
3472
|
return this.makeRequest({
|
|
3473
3473
|
trigger: "submit-message",
|
|
@@ -3499,18 +3499,18 @@ function $i(e, t) {
|
|
|
3499
3499
|
function ji(e) {
|
|
3500
3500
|
return Array.isArray(e) ? [...e] : e != null && typeof e == "object" && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null) ? { ...e } : e;
|
|
3501
3501
|
}
|
|
3502
|
-
var re, Be, Ue, Ee, Te,
|
|
3502
|
+
var re, Be, Ue, Ee, Te, Me, be, Ye, Qe, Ma, Fi = (Ma = class {
|
|
3503
3503
|
constructor(e = []) {
|
|
3504
3504
|
oe(this, re);
|
|
3505
3505
|
oe(this, Be);
|
|
3506
3506
|
oe(this, Ue);
|
|
3507
3507
|
oe(this, Ee);
|
|
3508
3508
|
oe(this, Te);
|
|
3509
|
-
oe(this,
|
|
3509
|
+
oe(this, Me);
|
|
3510
3510
|
oe(this, be);
|
|
3511
3511
|
oe(this, Ye);
|
|
3512
3512
|
oe(this, Qe);
|
|
3513
|
-
W(this, Be, "ready"), W(this, Ue, void 0), W(this, Ee, /* @__PURE__ */ new Set()), W(this, Te, /* @__PURE__ */ new Set()), W(this,
|
|
3513
|
+
W(this, Be, "ready"), W(this, Ue, void 0), W(this, Ee, /* @__PURE__ */ new Set()), W(this, Te, /* @__PURE__ */ new Set()), W(this, Me, /* @__PURE__ */ new Set()), this.pushMessage = (t) => {
|
|
3514
3514
|
W(this, re, B(this, re).concat(t)), B(this, be).call(this);
|
|
3515
3515
|
}, this.popMessage = () => {
|
|
3516
3516
|
W(this, re, B(this, re).slice(0, -1)), B(this, be).call(this);
|
|
@@ -3534,14 +3534,14 @@ var re, Be, Ue, Ee, Te, ke, be, Ye, Qe, ka, Fi = (ka = class {
|
|
|
3534
3534
|
};
|
|
3535
3535
|
}, this["~registerStatusCallback"] = (t) => (B(this, Te).add(t), () => {
|
|
3536
3536
|
B(this, Te).delete(t);
|
|
3537
|
-
}), this["~registerErrorCallback"] = (t) => (B(this,
|
|
3538
|
-
B(this,
|
|
3537
|
+
}), this["~registerErrorCallback"] = (t) => (B(this, Me).add(t), () => {
|
|
3538
|
+
B(this, Me).delete(t);
|
|
3539
3539
|
}), W(this, be, () => {
|
|
3540
3540
|
B(this, Ee).forEach((t) => t());
|
|
3541
3541
|
}), W(this, Ye, () => {
|
|
3542
3542
|
B(this, Te).forEach((t) => t());
|
|
3543
3543
|
}), W(this, Qe, () => {
|
|
3544
|
-
B(this,
|
|
3544
|
+
B(this, Me).forEach((t) => t());
|
|
3545
3545
|
}), W(this, re, e);
|
|
3546
3546
|
}
|
|
3547
3547
|
get status() {
|
|
@@ -3562,17 +3562,17 @@ var re, Be, Ue, Ee, Te, ke, be, Ye, Qe, ka, Fi = (ka = class {
|
|
|
3562
3562
|
set messages(e) {
|
|
3563
3563
|
W(this, re, [...e]), B(this, be).call(this);
|
|
3564
3564
|
}
|
|
3565
|
-
}, re = new WeakMap(), Be = new WeakMap(), Ue = new WeakMap(), Ee = new WeakMap(), Te = new WeakMap(),
|
|
3565
|
+
}, re = new WeakMap(), Be = new WeakMap(), Ue = new WeakMap(), Ee = new WeakMap(), Te = new WeakMap(), Me = new WeakMap(), be = new WeakMap(), Ye = new WeakMap(), Qe = new WeakMap(), Ma), ke, ka, _s = (ka = class extends Oi {
|
|
3566
3566
|
constructor({ messages: t, ...a }) {
|
|
3567
3567
|
const s = new Fi(t);
|
|
3568
3568
|
super({
|
|
3569
3569
|
...a,
|
|
3570
3570
|
state: s
|
|
3571
3571
|
});
|
|
3572
|
-
oe(this,
|
|
3573
|
-
this["~registerMessagesCallback"] = (r, l) => B(this,
|
|
3572
|
+
oe(this, ke);
|
|
3573
|
+
this["~registerMessagesCallback"] = (r, l) => B(this, ke)["~registerMessagesCallback"](r, l), this["~registerStatusCallback"] = (r) => B(this, ke)["~registerStatusCallback"](r), this["~registerErrorCallback"] = (r) => B(this, ke)["~registerErrorCallback"](r), W(this, ke, s);
|
|
3574
3574
|
}
|
|
3575
|
-
},
|
|
3575
|
+
}, ke = new WeakMap(), ka);
|
|
3576
3576
|
const vt = /* @__PURE__ */ new WeakMap();
|
|
3577
3577
|
function Li({ chat: e, registration: t }) {
|
|
3578
3578
|
let a = vt.get(e);
|
|
@@ -3656,7 +3656,7 @@ function Bi({ throttle: e, experimental_throttle: t, resume: a = !1, ...s } = {}
|
|
|
3656
3656
|
N = !1, y.forEach((v) => v());
|
|
3657
3657
|
};
|
|
3658
3658
|
}, [c, r]);
|
|
3659
|
-
const { messages: w, status: A, error: T } = x,
|
|
3659
|
+
const { messages: w, status: A, error: T } = x, M = G((N) => {
|
|
3660
3660
|
typeof N == "function" && (N = N(c.messages)), c.messages = N;
|
|
3661
3661
|
}, [c]);
|
|
3662
3662
|
return ve(() => {
|
|
@@ -3667,7 +3667,7 @@ function Bi({ throttle: e, experimental_throttle: t, resume: a = !1, ...s } = {}
|
|
|
3667
3667
|
}, [a, c]), {
|
|
3668
3668
|
id: c.id,
|
|
3669
3669
|
messages: w,
|
|
3670
|
-
setMessages:
|
|
3670
|
+
setMessages: M,
|
|
3671
3671
|
sendMessage: c.sendMessage,
|
|
3672
3672
|
regenerate: c.regenerate,
|
|
3673
3673
|
clearError: c.clearError,
|
|
@@ -3697,7 +3697,7 @@ const zt = async (e, t) => {
|
|
|
3697
3697
|
r,
|
|
3698
3698
|
Number.isInteger(l) && l > 0 ? { dailyLimit: l } : {}
|
|
3699
3699
|
);
|
|
3700
|
-
},
|
|
3700
|
+
}, kt = (e) => ["assistant", "recent-conversations", e], Os = (e) => ["assistant", "addable-sources", e];
|
|
3701
3701
|
async function _t(e, t) {
|
|
3702
3702
|
await e.cancelQueries({ queryKey: t }), await e.invalidateQueries({ queryKey: t });
|
|
3703
3703
|
}
|
|
@@ -3819,7 +3819,7 @@ function el(e) {
|
|
|
3819
3819
|
}), [m]);
|
|
3820
3820
|
const { messages: C, status: w, error: A } = Bi({ chat: m.chat });
|
|
3821
3821
|
ve(() => () => void m.chat.stop(), [m]);
|
|
3822
|
-
const [T,
|
|
3822
|
+
const [T, M] = $(), [N, u] = $([]), y = te(void 0), [f, v] = $(!1);
|
|
3823
3823
|
ve(() => () => {
|
|
3824
3824
|
var R;
|
|
3825
3825
|
return (R = y.current) == null ? void 0 : R.abort();
|
|
@@ -3827,7 +3827,7 @@ function el(e) {
|
|
|
3827
3827
|
const I = G(() => {
|
|
3828
3828
|
var R;
|
|
3829
3829
|
(R = y.current) == null || R.abort(), y.current = void 0, v(!1);
|
|
3830
|
-
}, []),
|
|
3830
|
+
}, []), k = G(
|
|
3831
3831
|
(R, E = []) => {
|
|
3832
3832
|
var J, K, se;
|
|
3833
3833
|
const _ = R.trim();
|
|
@@ -3836,10 +3836,10 @@ function el(e) {
|
|
|
3836
3836
|
try {
|
|
3837
3837
|
D = t.current.readContext();
|
|
3838
3838
|
} catch (he) {
|
|
3839
|
-
return
|
|
3839
|
+
return M(nl(he)), he instanceof Ja && t.current.onStaleFocus(), "not_sent";
|
|
3840
3840
|
}
|
|
3841
3841
|
if (Gr(D.context, E).length)
|
|
3842
|
-
return
|
|
3842
|
+
return M(Xi), "not_sent";
|
|
3843
3843
|
const Z = {
|
|
3844
3844
|
turnId: ol(),
|
|
3845
3845
|
context: D.context,
|
|
@@ -3848,8 +3848,8 @@ function el(e) {
|
|
|
3848
3848
|
...E.length ? { taggedFields: E } : {}
|
|
3849
3849
|
};
|
|
3850
3850
|
if (It({ ...Z, message: _ }) > ze.requestBytes)
|
|
3851
|
-
return
|
|
3852
|
-
|
|
3851
|
+
return M(new Za(It(Z)).message), "not_sent";
|
|
3852
|
+
M(void 0);
|
|
3853
3853
|
const ae = (J = D.context.selectedCard) == null ? void 0 : J.id;
|
|
3854
3854
|
ae && (m.aboutCardId = ae);
|
|
3855
3855
|
const U = tl(D.context, ((se = (K = t.current).canChangeOpenDashboard) == null ? void 0 : se.call(K)) ?? !1);
|
|
@@ -3863,9 +3863,9 @@ function el(e) {
|
|
|
3863
3863
|
(R) => {
|
|
3864
3864
|
var _;
|
|
3865
3865
|
const E = m.chat.messages.find((D) => D.id === R && D.role === "user");
|
|
3866
|
-
return E ?
|
|
3866
|
+
return E ? k(Rs(E), ((_ = E.metadata) == null ? void 0 : _.taggedFields) ?? []) : "not_sent";
|
|
3867
3867
|
},
|
|
3868
|
-
[m,
|
|
3868
|
+
[m, k]
|
|
3869
3869
|
), V = G(
|
|
3870
3870
|
(R) => {
|
|
3871
3871
|
const E = H.getState().actions.undoProposal(R);
|
|
@@ -3899,7 +3899,7 @@ function el(e) {
|
|
|
3899
3899
|
},
|
|
3900
3900
|
[m, c, l]
|
|
3901
3901
|
), z = G(() => void m.chat.stop(), [m]), ue = G(() => {
|
|
3902
|
-
I(),
|
|
3902
|
+
I(), M(void 0), x(xt(c)), u([]);
|
|
3903
3903
|
}, [I, c]), Ne = G(
|
|
3904
3904
|
(R, E) => {
|
|
3905
3905
|
E.beside && m.aboutCardId !== R && ue();
|
|
@@ -3918,12 +3918,12 @@ function el(e) {
|
|
|
3918
3918
|
return I(), "opened";
|
|
3919
3919
|
(_ = y.current) == null || _.abort();
|
|
3920
3920
|
const E = new AbortController();
|
|
3921
|
-
y.current = E, v(!0),
|
|
3921
|
+
y.current = E, v(!0), M(void 0);
|
|
3922
3922
|
try {
|
|
3923
3923
|
const D = await wa(c.connection(), R, E.signal);
|
|
3924
3924
|
return E.signal.aborted ? "not_opened" : (x(xt(c, D)), u(D.addedSources), D.allows && h(D.allows), "opened");
|
|
3925
3925
|
} catch (D) {
|
|
3926
|
-
return E.signal.aborted ||
|
|
3926
|
+
return E.signal.aborted || M(
|
|
3927
3927
|
D instanceof Ve && D.code !== "model_unavailable" ? D.message : Qi
|
|
3928
3928
|
), "not_opened";
|
|
3929
3929
|
} finally {
|
|
@@ -3959,8 +3959,8 @@ function el(e) {
|
|
|
3959
3959
|
/** What went wrong with the last send, in plain words; never a raw error. */
|
|
3960
3960
|
failure: A ? rl(A) : void 0,
|
|
3961
3961
|
notice: T,
|
|
3962
|
-
clearNotice: () =>
|
|
3963
|
-
send:
|
|
3962
|
+
clearNotice: () => M(void 0),
|
|
3963
|
+
send: k,
|
|
3964
3964
|
askAgain: L,
|
|
3965
3965
|
stop: z,
|
|
3966
3966
|
startNew: ue,
|
|
@@ -4072,7 +4072,7 @@ function Zt(e, t, a) {
|
|
|
4072
4072
|
if (e == null) return "";
|
|
4073
4073
|
if (t.temporalBucket && typeof e == "string")
|
|
4074
4074
|
try {
|
|
4075
|
-
return
|
|
4075
|
+
return kn({
|
|
4076
4076
|
value: e,
|
|
4077
4077
|
metadata: t.temporalBucket,
|
|
4078
4078
|
format: js(t.temporalBucket, a).format
|
|
@@ -4730,14 +4730,14 @@ function Tl({
|
|
|
4730
4730
|
}
|
|
4731
4731
|
);
|
|
4732
4732
|
}
|
|
4733
|
-
const
|
|
4734
|
-
function
|
|
4733
|
+
const Ml = "You’ve changed the dashboard since. Undo in the toolbar goes back to before editing.";
|
|
4734
|
+
function kl({
|
|
4735
4735
|
proposal: e,
|
|
4736
4736
|
state: t,
|
|
4737
4737
|
onUndo: a,
|
|
4738
4738
|
onAskAgain: s
|
|
4739
4739
|
}) {
|
|
4740
|
-
const r = H((h) => mr(h, e.proposalId)), l = H((h) => h.isVisualEditing), i = Ol(t, r), p = i.kind === "undone" || i.kind === "refused", g = !p && i.kind !== "settled", n = i.kind === "changed_since" ?
|
|
4740
|
+
const r = H((h) => mr(h, e.proposalId)), l = H((h) => h.isVisualEditing), i = Ol(t, r), p = i.kind === "undone" || i.kind === "refused", g = !p && i.kind !== "settled", n = i.kind === "changed_since" ? Ml : i.kind === "undone" ? "Undone." : i.kind === "refused" ? i.message : void 0;
|
|
4741
4741
|
return /* @__PURE__ */ b(
|
|
4742
4742
|
Ze,
|
|
4743
4743
|
{
|
|
@@ -4822,7 +4822,7 @@ function $l({ change: e, state: t, busy: a, onAdd: s, onDismiss: r, onNextStep:
|
|
|
4822
4822
|
var N, u, y;
|
|
4823
4823
|
const i = e.links ?? [], p = ((N = e.outcome) == null ? void 0 : N.status) === "applied" ? { status: "added", links: e.outcome.links } : ((u = e.outcome) == null ? void 0 : u.status) === "dismissed" ? { status: "dismissed" } : ((y = e.outcome) == null ? void 0 : y.status) === "refused" ? { status: "refused", message: jt(e.outcome.code) } : void 0;
|
|
4824
4824
|
t = p && (!t || t.status === "offered") ? p : t;
|
|
4825
|
-
const g = (t == null ? void 0 : t.status) ?? "settled", n = g === "offered" || g === "adding" || g === "dismissing", h = g === "adding" || g === "dismissing", c = i.length > 1, [m, x] = $(() => i.map((f, v) => v)), C = (t == null ? void 0 : t.status) === "adding" ? t.links ?? m : m, w = (t == null ? void 0 : t.status) === "added" ? t.links : void 0, A = i.length > 0 ? C.length : 1, T = w ? Bl(w) : void 0,
|
|
4825
|
+
const g = (t == null ? void 0 : t.status) ?? "settled", n = g === "offered" || g === "adding" || g === "dismissing", h = g === "adding" || g === "dismissing", c = i.length > 1, [m, x] = $(() => i.map((f, v) => v)), C = (t == null ? void 0 : t.status) === "adding" ? t.links ?? m : m, w = (t == null ? void 0 : t.status) === "added" ? t.links : void 0, A = i.length > 0 ? C.length : 1, T = w ? Bl(w) : void 0, M = T ? T.added + T.existing > 0 : !1;
|
|
4826
4826
|
return /* @__PURE__ */ b(
|
|
4827
4827
|
Ze,
|
|
4828
4828
|
{
|
|
@@ -4830,7 +4830,7 @@ function $l({ change: e, state: t, busy: a, onAdd: s, onDismiss: r, onNextStep:
|
|
|
4830
4830
|
title: i.length > 1 ? "Data model changes" : "Data model change",
|
|
4831
4831
|
testId: "assistant-model-change",
|
|
4832
4832
|
"data-model-change-state": g,
|
|
4833
|
-
action: g === "adding" ? /* @__PURE__ */ d(lt, { icon: /* @__PURE__ */ d(we, { className: "h-3 w-3 animate-spin" }), children: "Adding" }) : T ? /* @__PURE__ */ d(lt, { icon:
|
|
4833
|
+
action: g === "adding" ? /* @__PURE__ */ d(lt, { icon: /* @__PURE__ */ d(we, { className: "h-3 w-3 animate-spin" }), children: "Adding" }) : T ? /* @__PURE__ */ d(lt, { icon: M ? /* @__PURE__ */ d(Pe, { className: "h-3 w-3" }) : /* @__PURE__ */ d(Pt, { className: "h-3 w-3 text-amber-500" }), children: M ? T.refused > 0 ? "Partly added" : "Added" : "Not added" }) : null,
|
|
4834
4834
|
children: [
|
|
4835
4835
|
i.length > 0 ? /* @__PURE__ */ d("ul", { className: "space-y-1.5", children: i.map((f, v) => /* @__PURE__ */ d(
|
|
4836
4836
|
Fl,
|
|
@@ -4840,7 +4840,7 @@ function $l({ change: e, state: t, busy: a, onAdd: s, onDismiss: r, onNextStep:
|
|
|
4840
4840
|
tick: n && c ? {
|
|
4841
4841
|
checked: C.includes(v),
|
|
4842
4842
|
disabled: h || a,
|
|
4843
|
-
onChange: (I) => x((
|
|
4843
|
+
onChange: (I) => x((k) => I ? [...k, v].sort((L, V) => L - V) : k.filter((L) => L !== v))
|
|
4844
4844
|
} : void 0,
|
|
4845
4845
|
outcome: w == null ? void 0 : w[v],
|
|
4846
4846
|
muted: g === "dismissed"
|
|
@@ -4894,7 +4894,7 @@ function $l({ change: e, state: t, busy: a, onAdd: s, onDismiss: r, onNextStep:
|
|
|
4894
4894
|
] }) : null,
|
|
4895
4895
|
g === "dismissed" || g === "refused" || T ? /* @__PURE__ */ b("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-border pt-2", children: [
|
|
4896
4896
|
/* @__PURE__ */ d("span", { className: "text-[11.5px] leading-[1.5] text-muted-foreground", children: (t == null ? void 0 : t.status) === "refused" ? t.message : g === "dismissed" ? "Not added." : Ul(T, i.length, e.domainLabel) }),
|
|
4897
|
-
|
|
4897
|
+
M && e.nextStep && l ? /* @__PURE__ */ b(q, { size: "xs", className: "h-[26px] gap-1 px-2 text-[11.5px]", disabled: a, onClick: () => l(e.nextStep), children: [
|
|
4898
4898
|
e.nextStep,
|
|
4899
4899
|
/* @__PURE__ */ d(Dt, { className: "h-3 w-3" })
|
|
4900
4900
|
] }) : null
|
|
@@ -5107,7 +5107,7 @@ function Kl({
|
|
|
5107
5107
|
var N;
|
|
5108
5108
|
const x = e.parts.find(Hl), C = (N = e.parts.find(Gl)) == null ? void 0 : N.data, w = e.parts.filter(Yl).map((u) => u.data), A = en(e.parts, Wl), T = e.parts.filter(
|
|
5109
5109
|
(u) => u.type === "text" ? !A.has(u) : u.type.startsWith("data-") && tn(u.type.slice(5))
|
|
5110
|
-
),
|
|
5110
|
+
), M = t ? [...w].reverse().find((u) => u.state === "live") : void 0;
|
|
5111
5111
|
return /* @__PURE__ */ b("div", { className: "space-y-2", "data-testid": "assistant-answer", "data-message-id": e.id, children: [
|
|
5112
5112
|
T.map(
|
|
5113
5113
|
(u, y) => u.type === "text" ? /* @__PURE__ */ d(nd, { text: u.text }, y) : u.type === "data-refusal" ? /* @__PURE__ */ d("p", { className: "text-[12.5px] leading-[1.6] text-muted-foreground", children: u.data.message }, y) : u.type === "data-artifact" ? /* @__PURE__ */ d(
|
|
@@ -5119,7 +5119,7 @@ function Kl({
|
|
|
5119
5119
|
},
|
|
5120
5120
|
y
|
|
5121
5121
|
) : u.type === "data-proposal" ? /* @__PURE__ */ d(
|
|
5122
|
-
|
|
5122
|
+
kl,
|
|
5123
5123
|
{
|
|
5124
5124
|
proposal: u.data,
|
|
5125
5125
|
state: l[u.data.proposalId],
|
|
@@ -5149,7 +5149,7 @@ function Kl({
|
|
|
5149
5149
|
y
|
|
5150
5150
|
) : null
|
|
5151
5151
|
),
|
|
5152
|
-
t ? /* @__PURE__ */ d(Ws, { step:
|
|
5152
|
+
t ? /* @__PURE__ */ d(Ws, { step: M }) : null,
|
|
5153
5153
|
!t && (w.length > 0 || x || C) ? /* @__PURE__ */ d(td, { stages: w, using: x == null ? void 0 : x.data, trace: C }) : null
|
|
5154
5154
|
] });
|
|
5155
5155
|
}
|
|
@@ -5356,7 +5356,7 @@ function id({
|
|
|
5356
5356
|
/* @__PURE__ */ d(Tr, {})
|
|
5357
5357
|
] }) : null,
|
|
5358
5358
|
/* @__PURE__ */ b(pt, { className: "text-[12.5px]", disabled: !s, onSelect: () => g("conversation"), children: [
|
|
5359
|
-
/* @__PURE__ */ d(
|
|
5359
|
+
/* @__PURE__ */ d(Mr, { className: "mr-2 h-3.5 w-3.5 text-muted-foreground" }),
|
|
5360
5360
|
"Copy conversation"
|
|
5361
5361
|
] }),
|
|
5362
5362
|
a != null && a.toolCalls ? /* @__PURE__ */ b(pt, { className: "text-[12.5px]", disabled: !s, onSelect: () => g("tool_calls"), children: [
|
|
@@ -5385,17 +5385,17 @@ function dd({
|
|
|
5385
5385
|
answeringId: l,
|
|
5386
5386
|
header: i
|
|
5387
5387
|
}) {
|
|
5388
|
-
var
|
|
5388
|
+
var M;
|
|
5389
5389
|
const p = ja({
|
|
5390
|
-
queryKey:
|
|
5390
|
+
queryKey: kt(e),
|
|
5391
5391
|
queryFn: ({ signal: N }) => zi(t(), N),
|
|
5392
5392
|
staleTime: 0,
|
|
5393
5393
|
// A failed read says so at once, whichever client the host mounted.
|
|
5394
5394
|
retry: !1
|
|
5395
|
-
}), g = Fa(), [n, h] = $(), [c, m] = $(() => /* @__PURE__ */ new Set()), [x, C] = $(), w = (
|
|
5395
|
+
}), g = Fa(), [n, h] = $(), [c, m] = $(() => /* @__PURE__ */ new Set()), [x, C] = $(), w = (M = p.data) == null ? void 0 : M.filter((N) => !c.has(N.conversationId)), A = async (N) => {
|
|
5396
5396
|
h(N);
|
|
5397
5397
|
const u = await s(N);
|
|
5398
|
-
h((y) => y === N ? void 0 : y), u === "not_opened" && _t(g,
|
|
5398
|
+
h((y) => y === N ? void 0 : y), u === "not_opened" && _t(g, kt(e));
|
|
5399
5399
|
}, T = async (N) => {
|
|
5400
5400
|
C(void 0), m((u) => new Set(u).add(N)), r(N);
|
|
5401
5401
|
try {
|
|
@@ -5626,12 +5626,12 @@ function Gd({
|
|
|
5626
5626
|
placement: a
|
|
5627
5627
|
}) {
|
|
5628
5628
|
var Ht, Gt;
|
|
5629
|
-
const s = t === "none", r =
|
|
5629
|
+
const s = t === "none", r = kr(), l = tt(e.store, (S) => S.focus), i = tt(e.store, (S) => S.isOpen), p = tt(e.store, (S) => S.askCount), g = tt(e.store, (S) => S.layout), n = s ? "full-page" : g, h = a ?? n, c = h === "beside-card", m = H(
|
|
5630
5630
|
(S) => {
|
|
5631
5631
|
var P;
|
|
5632
5632
|
return l && S.dashboard ? (P = Br(S.dashboard, l.cardId)) == null ? void 0 : P.card : void 0;
|
|
5633
5633
|
}
|
|
5634
|
-
), x = wd(s), C = te(void 0), [w] = $(() => Ln(t)), [A, T] = $([]),
|
|
5634
|
+
), x = wd(s), C = te(void 0), [w] = $(() => Ln(t)), [A, T] = $([]), M = G(
|
|
5635
5635
|
(S) => {
|
|
5636
5636
|
C.current = S;
|
|
5637
5637
|
const P = bd(
|
|
@@ -5652,13 +5652,13 @@ function Gd({
|
|
|
5652
5652
|
readContext: () => w({ focus: e.store.getState().focus, snapshot: C.current, editing: Nd(s) }),
|
|
5653
5653
|
connection: u,
|
|
5654
5654
|
onStaleFocus: e.clearFocus,
|
|
5655
|
-
onTurnFinished: () => void _t(N,
|
|
5655
|
+
onTurnFinished: () => void _t(N, kt(e.id)),
|
|
5656
5656
|
// A refused context may name an added source the caller can no longer add:
|
|
5657
5657
|
// reading the catalog again marks it (D3c-10).
|
|
5658
5658
|
onFailed: (S) => {
|
|
5659
5659
|
S instanceof Ve && S.code === "context_invalid" && _t(N, Os(e.id));
|
|
5660
5660
|
}
|
|
5661
|
-
}), [
|
|
5661
|
+
}), [k, L] = $(""), V = te(null);
|
|
5662
5662
|
ve(() => {
|
|
5663
5663
|
var S;
|
|
5664
5664
|
(i || s) && ((S = V.current) == null || S.focus());
|
|
@@ -5674,13 +5674,13 @@ function Gd({
|
|
|
5674
5674
|
_e(() => {
|
|
5675
5675
|
var S;
|
|
5676
5676
|
R.current !== void 0 && ((S = V.current) == null || S.setSelectionRange(R.current, R.current), R.current = void 0);
|
|
5677
|
-
}, [
|
|
5677
|
+
}, [k]);
|
|
5678
5678
|
const E = (S) => {
|
|
5679
5679
|
z.add(S);
|
|
5680
|
-
const P = V.current, X = hd(
|
|
5681
|
-
X.text !==
|
|
5680
|
+
const P = V.current, X = hd(k, (P == null ? void 0 : P.selectionStart) ?? k.length);
|
|
5681
|
+
X.text !== k && (R.current = X.caret, L(X.text)), Ie(void 0), P == null || P.focus();
|
|
5682
5682
|
}, _ = (S) => {
|
|
5683
|
-
S == null || S.preventDefault(), I.send(
|
|
5683
|
+
S == null || S.preventDefault(), I.send(k, z.shown) === "sent" && (L(""), z.clear());
|
|
5684
5684
|
}, D = (S) => {
|
|
5685
5685
|
var X;
|
|
5686
5686
|
const P = I.send(S) === "sent";
|
|
@@ -5706,7 +5706,7 @@ function Gd({
|
|
|
5706
5706
|
S.preventDefault(), Ie(void 0);
|
|
5707
5707
|
return;
|
|
5708
5708
|
}
|
|
5709
|
-
if (S.key === "Backspace" && !
|
|
5709
|
+
if (S.key === "Backspace" && !k && z.shown.length) {
|
|
5710
5710
|
z.remove(z.shown[z.shown.length - 1]);
|
|
5711
5711
|
return;
|
|
5712
5712
|
}
|
|
@@ -5797,7 +5797,7 @@ function Gd({
|
|
|
5797
5797
|
ref: V,
|
|
5798
5798
|
"aria-label": "Message",
|
|
5799
5799
|
placeholder: x ? "Ask about this visual" : m ? "Ask about this card" : s ? "Ask about your data" : "Ask about this dashboard",
|
|
5800
|
-
value:
|
|
5800
|
+
value: k,
|
|
5801
5801
|
maxLength: ze.messageChars,
|
|
5802
5802
|
rows: 2,
|
|
5803
5803
|
onChange: (S) => {
|
|
@@ -5860,7 +5860,7 @@ function Gd({
|
|
|
5860
5860
|
className: "h-7 w-7 shrink-0 p-0",
|
|
5861
5861
|
"aria-label": "Send",
|
|
5862
5862
|
title: "Send",
|
|
5863
|
-
disabled: !
|
|
5863
|
+
disabled: !k.trim() || I.loading,
|
|
5864
5864
|
children: /* @__PURE__ */ d(dt, { className: "h-3.5 w-3.5" })
|
|
5865
5865
|
}
|
|
5866
5866
|
)
|
|
@@ -5973,8 +5973,8 @@ function Gd({
|
|
|
5973
5973
|
),
|
|
5974
5974
|
x ? (
|
|
5975
5975
|
// The draft runs as the editor's preview does: its authority and inline values.
|
|
5976
|
-
/* @__PURE__ */ d(Rr, { children: /* @__PURE__ */ d(Ta, { card: x, draft: !0, onSnapshot:
|
|
5977
|
-
) : m ? /* @__PURE__ */ d(Ta, { card: m, draft: !1, onSnapshot:
|
|
5976
|
+
/* @__PURE__ */ d(Rr, { children: /* @__PURE__ */ d(Ta, { card: x, draft: !0, onSnapshot: M }, `draft:${x.id}`) })
|
|
5977
|
+
) : m ? /* @__PURE__ */ d(Ta, { card: m, draft: !1, onSnapshot: M }, m.id) : null
|
|
5978
5978
|
]
|
|
5979
5979
|
}
|
|
5980
5980
|
)
|