react-semaphor 0.1.568 → 0.1.569

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +0 -7
  2. package/dist/analytics-protocol/index.js +434 -454
  3. package/dist/assistant-context/index.js +1 -1
  4. package/dist/brand-studio/index.js +10 -12
  5. package/dist/briefings/index.js +4 -4
  6. package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → _commonjsHelpers-Bid1ZNYj.js} +271 -222
  7. package/dist/chunks/{assistant-chat-BN5I8KuN.js → assistant-chat-Dzf2Mbph.js} +107 -109
  8. package/dist/chunks/{bookmark-impact-CJ-65omV.js → bookmark-impact-Czg6FGt5.js} +2 -2
  9. package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
  10. package/dist/chunks/{card-filter-builder-BBuB99GZ.js → card-filter-builder-BS982X7x.js} +986 -985
  11. package/dist/chunks/{code-editor-DJNOsgJH.js → code-editor-BsxHzm9u.js} +43 -45
  12. package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-lLTgzOkM.js} +252 -253
  13. package/dist/chunks/{dashboard-YnWZC4dK.js → dashboard-BiYSbxZv.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-BF89TU2h.js → dashboard-briefing-launcher-Bdj7luOr.js} +158 -159
  15. package/dist/chunks/{dashboard-controls-atHc1EjP.js → dashboard-controls-TViDsnb8.js} +17 -19
  16. package/dist/chunks/dashboard-json-Dg9dQd9U.js +66 -0
  17. package/dist/chunks/{dates-CKO05ino.js → dates-BsPrWZIP.js} +8 -8
  18. package/dist/chunks/{edit-dashboard-visual-DdmTfn-J.js → edit-dashboard-visual-C6hoIeEJ.js} +20 -21
  19. package/dist/chunks/{filter-reach-copy-jZGzK_IH.js → filter-reach-copy-hcQ4os0u.js} +695 -699
  20. package/dist/chunks/filter-value-text-CVxEEDVl.js +146 -0
  21. package/dist/chunks/{index-CPNZW0mu.js → index-G4q89J6O.js} +74 -76
  22. package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-BIcoFfdS.js} +1 -1
  23. package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C6tYkHyv.js} +1 -1
  24. package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
  25. package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
  26. package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
  27. package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
  28. package/dist/chunks/{palette-4vf2BEEg.js → palette-NjHOE_6B.js} +1 -1
  29. package/dist/chunks/pivot-result-contract-expectations-DkmueDTW.js +55 -0
  30. package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
  31. package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
  32. package/dist/chunks/{report-preferences-dialog-Mbd-I0wV.js → report-preferences-dialog-Xc8_GFju.js} +26 -28
  33. package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
  34. package/dist/chunks/{resolve-dashboard-input-context-Du0fjN3h.js → resolve-dashboard-input-context-KqvcLcTM.js} +4784 -4764
  35. package/dist/chunks/{save-D6pHmSSP.js → save-C6VmEJTA.js} +1 -1
  36. package/dist/chunks/{saved-dashboard-context-y8N6RvjS.js → saved-dashboard-context-BeXXyoD4.js} +6 -6
  37. package/dist/chunks/{semaphor-ready-indicator-BSEdUq40.js → semaphor-ready-indicator-BNkaANsG.js} +28395 -28384
  38. package/dist/chunks/{shelf-drop-preview-context-D7QqPl36.js → shelf-drop-preview-context-C_issPBA.js} +18 -20
  39. package/dist/chunks/{stored-dashboard-d3xQYxBD.js → stored-dashboard-B6_StAty.js} +263 -265
  40. package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-BWP2joD1.js} +1 -1
  41. package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-scSWQXAB.js} +4 -4
  42. package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
  43. package/dist/chunks/{upload-Cf3wXZT8.js → upload-BRW4Mwrd.js} +1 -1
  44. package/dist/chunks/validators-B8fpdinG.js +3651 -0
  45. package/dist/chunks/{variable-draft-DOX03R4A.js → variable-draft-BQ3OMjvy.js} +4 -4
  46. package/dist/dashboard/index.js +2 -2
  47. package/dist/dashboard-authoring/index.js +1527 -1517
  48. package/dist/format-utils/index.js +230 -231
  49. package/dist/index.js +236 -237
  50. package/dist/report-runtime-context/index.js +1 -1
  51. package/dist/style.css +1 -1
  52. package/dist/surfboard/index.js +2 -2
  53. package/dist/types/components/surfboard/filter/types.d.ts +5 -4
  54. package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
  55. package/dist/types/index.js +9 -9
  56. package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
  57. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  58. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  59. package/dist/types/lib/types/index.d.ts +1 -1
  60. package/dist/types/lib/utils/card-definition.d.ts +7 -7
  61. package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
  62. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
  63. package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
  64. package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
  65. package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
  66. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +4 -4
  67. package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
  68. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
  69. package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
  70. package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
  71. package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
  72. package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
  73. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
  74. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
  75. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
  76. package/dist/types/shared/assistant-protocol/context.d.ts +12 -12
  77. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
  78. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +155 -1753
  79. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
  80. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +74 -74
  81. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
  82. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +3 -0
  83. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
  84. package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
  85. package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
  86. package/dist/types/shared/format-utils/matrix-continuation.d.ts +3 -3
  87. package/dist/types/shared/temporal/index.d.ts +0 -2
  88. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
  89. package/package.json +2 -24
  90. package/DATA_APP_SDK.md +0 -339
  91. package/dist/chunks/dashboard-json-Cxp3inxd.js +0 -68
  92. package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
  93. package/dist/chunks/index-CuHybtft.js +0 -51
  94. package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
  95. package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
  96. package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
  97. package/dist/chunks/operators-B3zZoskU.js +0 -66
  98. package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
  99. package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
  100. package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
  101. package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
  102. package/dist/chunks/validators-wtjw0aw6.js +0 -3332
  103. package/dist/data-app-sdk/index.js +0 -1412
  104. package/dist/data-app-sdk-adapters/index.js +0 -361
  105. package/dist/data-app-sdk-validation/index.js +0 -1031
  106. package/dist/types/data-app-sdk/adapters.d.ts +0 -35
  107. package/dist/types/data-app-sdk/builders.d.ts +0 -62
  108. package/dist/types/data-app-sdk/contracts.d.ts +0 -419
  109. package/dist/types/data-app-sdk/executor.d.ts +0 -5
  110. package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
  111. package/dist/types/data-app-sdk/hooks.d.ts +0 -11
  112. package/dist/types/data-app-sdk/index.d.ts +0 -9
  113. package/dist/types/data-app-sdk/provider.d.ts +0 -8
  114. package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
  115. package/dist/types/data-app-sdk/selection.d.ts +0 -2
  116. package/dist/types/data-app-sdk/validation.d.ts +0 -58
  117. package/dist/types/data-app-sdk-adapters.d.ts +0 -2
  118. package/dist/types/data-app-sdk-validation.d.ts +0 -2
  119. package/dist/types/data-app-sdk.d.ts +0 -2
  120. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
  121. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
  122. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
  123. package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
  124. package/dist/types/shared/temporal/relative-date.d.ts +0 -21
  125. package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
  126. package/src/data-app-sdk/README.md +0 -402
@@ -5,26 +5,24 @@ var Or = (e, t, r) => t.has(e) || $r("Cannot " + r);
5
5
  var L = (e, t, r) => (Or(e, t, "read from private field"), r ? r.call(e) : t.get(e)), me = (e, t, r) => t.has(e) ? $r("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), ee = (e, t, r, n) => (Or(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
6
6
  import { jsx as p, jsxs as k, Fragment as Le } from "react/jsx-runtime";
7
7
  import { useCallback as te, useRef as ie, useMemo as it, useEffect as ke, useState as D, useLayoutEffect as Ue, useId as As } from "react";
8
- import { u as X, e6 as Cs, aW as $s, be as Os, Y as zs, e7 as Ms, e8 as Ps, Z as zr, aT as Rs, e9 as Zs, bT as js, b9 as Ds, ea as dr, dm as Fs, eb as Ls, ec as Mt, ed as Cn, ee as Us, bN as Pt, c9 as Mr, ef as $n, $ as Bs, c3 as On, bh as Vs, bY as qs, bM as zn, dQ as Mn, eg as Js, cw as Ws, bn as Ks, eh as Gs, ei as Ys, ej as Hs, c6 as Qs, c7 as Xs, dn as eo, c8 as to, ce as ro, ek as no, bV as Lt, cd as ao, ci as so, bX as Pn, aR as Rn, aU as oo, b8 as xt, aP as Zn, el as io, em as lo, en as co, eo as uo, a6 as jn, ep as po } from "./semaphor-ready-indicator-BSEdUq40.js";
9
- import { c as qe, B as Y, X as lt, k as Dn, l as fo, e as mt, L as Be, I as Fn, R as Ln, P as Un, a as Bn, d as Vn } from "./code-editor-DJNOsgJH.js";
10
- import "./index-CuHybtft.js";
11
- import "./validators-wtjw0aw6.js";
12
- import "./matrix-operation-contract-Eb6elidS.js";
8
+ import { u as Q, e5 as Cs, aW as $s, be as Os, Y as zs, e6 as Ms, e7 as Ps, Z as zr, aT as Rs, e8 as Zs, bT as js, b9 as Ds, e9 as dr, dl as Fs, ea as Ls, eb as Mt, ec as Cn, ed as Us, bN as Pt, c9 as Mr, ee as $n, $ as Bs, c3 as On, bh as Vs, bY as qs, bM as zn, dP as Mn, ef as Js, cw as Ws, bn as Ks, eg as Gs, eh as Ys, ei as Hs, c6 as Xs, c7 as Qs, dm as eo, c8 as to, ce as ro, ej as no, bV as Lt, cd as ao, ci as so, bX as Pn, aR as Rn, aU as oo, b8 as xt, aP as Zn, ek as io, el as lo, em as co, en as uo, a6 as jn, eo as po } from "./semaphor-ready-indicator-BNkaANsG.js";
9
+ import { c as qe, B as Y, X as lt, k as Dn, l as fo, e as mt, L as Be, I as Fn, R as Ln, P as Un, a as Bn, d as Vn } from "./code-editor-BsxHzm9u.js";
10
+ import { g as mo, c as B } from "./_commonjsHelpers-Bid1ZNYj.js";
11
+ import "./validators-B8fpdinG.js";
12
+ import "./matrix-operation-contract-DCVinw1o.js";
13
13
  import "./analytics-base-schemas-BaIQrEzX.js";
14
- import "zod";
15
- import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as mo } from "../value-format-preferences/index.js";
16
- import { g as ho, c as B } from "./_commonjsHelpers-DimLPMtv.js";
17
- import { az as go } from "./bookmark-state-Du3s13_V.js";
18
- import { l as bo, m as ct, c as Xt, A as et, d as qn } from "./context-R31TSL5V.js";
19
- import { p as Pr, a as vo, A as Jn } from "./saved-dashboard-context-y8N6RvjS.js";
20
- import { gw as yo, o as xo, g7 as Rr } from "./resolve-dashboard-input-context-Du0fjN3h.js";
21
- import { o as Wn, p as wo } from "./report-preferences-dialog-Mbd-I0wV.js";
22
- import { m as _o } from "./stored-dashboard-d3xQYxBD.js";
14
+ import { DEFAULT_RESOLVED_VALUE_FORMAT_PREFERENCES as ho } from "../value-format-preferences/index.js";
15
+ import { az as go } from "./bookmark-state-CflS88gq.js";
16
+ import { l as bo, m as ct, c as Qt, A as et, d as qn } from "./context-R31TSL5V.js";
17
+ import { p as Pr, a as vo, A as Jn } from "./saved-dashboard-context-BeXXyoD4.js";
18
+ import { gz as yo, o as xo, gb as Rr } from "./resolve-dashboard-input-context-KqvcLcTM.js";
19
+ import { o as Wn, p as wo } from "./report-preferences-dialog-Xc8_GFju.js";
20
+ import { m as _o } from "./stored-dashboard-B6_StAty.js";
23
21
  import { w as Io, c as Kn } from "./visual-choice-JiJ-_3bi.js";
24
22
  import { m as So, v as Gn, t as No, n as ko, k as ve, d as Eo, b as To, l as pr, w as Ao, h as Co, s as er, f as $o, a as Oo } from "./model-change-T1cRkh3m.js";
25
- import { aL as zo, aM as Mo, aN as Po, aO as wt, aP as Ro, aQ as Zr, aR as jr, aS as Dr, aT as Fr, aU as Lr, aV as Zo, ad as jo, ab as Do } from "./temporal-input-presentation--2r9BLr0.js";
26
- import { L as Fo } from "./list-filter-DkgoCeBm.js";
27
- import { L as Ur } from "./layout-grid-0hIlqEtk.js";
23
+ import { aL as zo, aM as Mo, aN as Po, aO as wt, aP as Ro, aQ as Zr, aR as jr, aS as Dr, aT as Fr, aU as Lr, aV as Zo, ad as jo, ab as Do } from "./temporal-input-presentation-scSWQXAB.js";
24
+ import { L as Fo } from "./list-filter-C6tYkHyv.js";
25
+ import { L as Ur } from "./layout-grid-BIcoFfdS.js";
28
26
  function Lo(e, t, r) {
29
27
  const n = zo(), a = (r == null ? void 0 : r.locale) ?? n.locale ?? Mo, s = Po(e, t);
30
28
  if (isNaN(s))
@@ -149,7 +147,7 @@ function Go(e = "dashboard") {
149
147
  return t && Br(t.reads, [r]) || (t = { reads: [r], sent: { context: Pr({ surface: "none", timeZone: r }) } }), t.sent;
150
148
  } : ({ focus: r, snapshot: n, editing: a }) => {
151
149
  var I;
152
- const s = X.getState(), o = (I = s.reportContext) == null ? void 0 : I.calendar;
150
+ const s = Q.getState(), o = (I = s.reportContext) == null ? void 0 : I.calendar;
153
151
  if (!o) throw new Hn();
154
152
  const c = a ? a.card.id : r == null ? void 0 : r.cardId, f = c ? (n == null ? void 0 : n.cardId) === c && n.draft === !!a && (!a || n.card === a.card) ? n.snapshot : "pending" : void 0, i = {
155
153
  surface: "dashboard",
@@ -194,29 +192,29 @@ function Br(e, t) {
194
192
  return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
195
193
  }
196
194
  function Yo(e) {
197
- const { canChange: t, canChangeNow: r } = Wn(e.surface === "dashboard"), n = X((i) => {
195
+ const { canChange: t, canChangeNow: r } = Wn(e.surface === "dashboard"), n = Q((i) => {
198
196
  var u, m;
199
197
  const g = (m = (u = i.dashboard) == null ? void 0 : u.sheets) == null ? void 0 : m.find((w) => w.id === i.selectedSheetId);
200
198
  return !!g && !xo(g);
201
- }), a = X((i) => i.isVisualEditing), s = $s(), o = Os();
199
+ }), a = Q((i) => i.isVisualEditing), s = $s(), o = Os();
202
200
  return { add: te(
203
201
  async (i, g) => {
204
202
  var T, O;
205
- const u = X.getState(), m = (T = u.dashboard) == null ? void 0 : T.id, w = u.selectedSheetId;
203
+ const u = Q.getState(), m = (T = u.dashboard) == null ? void 0 : T.id, w = u.selectedSheetId;
206
204
  if (!m || !w) throw new at(Ut);
207
- const I = { title: i.title, type: So[g], ...i.card }, E = !Qo({ ...I, id: "check" }, i, g), _ = { ...I, ...E ? { type: "table" } : {}, id: Rr() }, x = { id: Rr(), cards: [_], activeCardId: _.id }, y = await o(x, { reuseLoaded: !0 }).catch((W) => {
205
+ const I = { title: i.title, type: So[g], ...i.card }, E = !Xo({ ...I, id: "check" }, i, g), _ = { ...I, ...E ? { type: "table" } : {}, id: Rr() }, x = { id: Rr(), cards: [_], activeCardId: _.id }, y = await o(x, { reuseLoaded: !0 }).catch((W) => {
208
206
  console.warn("Adding the result without refreshed semantic metadata:", W);
209
- }), h = structuredClone(X.getState().semanticExecutionPayload);
207
+ }), h = structuredClone(Q.getState().semanticExecutionPayload);
210
208
  zs(h, y);
211
209
  const d = Io(
212
210
  _.config ?? {},
213
- Xo(_, w, h, s)
214
- ), v = d === (_.config ?? {}) ? x : { ...x, cards: [{ ..._, config: d }] }, b = X.getState();
211
+ Qo(_, w, h, s)
212
+ ), v = d === (_.config ?? {}) ? x : { ...x, cards: [{ ..._, config: d }] }, b = Q.getState();
215
213
  if (((O = b.dashboard) == null ? void 0 : O.id) !== m || b.selectedSheetId !== w || b.isVisualEditing)
216
214
  throw new at(Ut);
217
215
  if (!r()) throw new at(Ho);
218
216
  const { actions: N } = b;
219
- if (N.setIsDashboardEditing(!0), N.addFrame(w, v, { semanticExecutionPayload: y }), !Qn(X.getState().dashboard, v.id))
217
+ if (N.setIsDashboardEditing(!0), N.addFrame(w, v, { semanticExecutionPayload: y }), !Xn(Q.getState().dashboard, v.id))
220
218
  throw b.isDashboardEditing || N.setIsDashboardEditing(!1), new at(Ut);
221
219
  return { frameId: v.id, asTable: E };
222
220
  },
@@ -224,7 +222,7 @@ function Yo(e) {
224
222
  ), available: t && n && !a };
225
223
  }
226
224
  const Ut = "The dashboard changed while this was being added. Try again.", Ho = "Changes to this dashboard can't be saved here, so the card wasn't added.";
227
- function Qo(e, t, r) {
225
+ function Xo(e, t, r) {
228
226
  if (r !== "line" && r !== "bar" && r !== "stackedBar") return !0;
229
227
  const n = Kn(Gn(t), r);
230
228
  if (!n.ok) return !1;
@@ -236,16 +234,16 @@ class at extends Error {
236
234
  super(t), this.name = "AddToDashboardRefusedError";
237
235
  }
238
236
  }
239
- function Qn(e, t) {
237
+ function Xn(e, t) {
240
238
  var r;
241
239
  return !!((r = e == null ? void 0 : e.sheets) != null && r.some((n) => {
242
240
  var a;
243
241
  return (a = n.frames) == null ? void 0 : a.some((s) => s.id === t);
244
242
  }));
245
243
  }
246
- function Xo(e, t, r, n) {
244
+ function Qo(e, t, r, n) {
247
245
  var o;
248
- const a = Ps(X.getState()), s = _o({
246
+ const a = Ps(Q.getState()), s = _o({
249
247
  ...a,
250
248
  cardId: e.id,
251
249
  cardOverride: e,
@@ -258,7 +256,7 @@ function Xo(e, t, r, n) {
258
256
  (c) => c.dateOwner !== "global_date"
259
257
  );
260
258
  }
261
- const Xn = "vercel.ai.error", ei = Symbol.for(Xn);
259
+ const Qn = "vercel.ai.error", ei = Symbol.for(Qn);
262
260
  var re = class ea extends Error {
263
261
  /**
264
262
  * Creates an AI SDK Error.
@@ -277,7 +275,7 @@ var re = class ea extends Error {
277
275
  * @returns {boolean} True if the error is an AI SDK Error, false otherwise.
278
276
  */
279
277
  static isInstance(t) {
280
- return ea.hasMarker(t, Xn);
278
+ return ea.hasMarker(t, Qn);
281
279
  }
282
280
  static hasMarker(t, r) {
283
281
  const n = Symbol.for(r);
@@ -777,7 +775,7 @@ function Ki(e) {
777
775
  const Gi = (e) => {
778
776
  const t = e ? `[\\s\\S]{${(e == null ? void 0 : e.minimum) ?? 0},${(e == null ? void 0 : e.maximum) ?? ""}}` : "[\\s\\S]*";
779
777
  return new RegExp(`^${t}$`);
780
- }, Yi = /^\d+$/, Hi = /^-?\d+(?:\.\d+)?/i, Qi = /true|false/i, Xi = /null/i, el = /^[^A-Z]*$/, tl = /^[^a-z]*$/, le = /* @__PURE__ */ S("$ZodCheck", (e, t) => {
778
+ }, Yi = /^\d+$/, Hi = /^-?\d+(?:\.\d+)?/i, Xi = /true|false/i, Qi = /null/i, el = /^[^A-Z]*$/, tl = /^[^a-z]*$/, le = /* @__PURE__ */ S("$ZodCheck", (e, t) => {
781
779
  var r;
782
780
  e._zod ?? (e._zod = {}), e._zod.def = t, (r = e._zod).onattach ?? (r.onattach = []);
783
781
  }), Na = {
@@ -1370,7 +1368,7 @@ const Fl = /* @__PURE__ */ S("$ZodJWT", (e, t) => {
1370
1368
  }), Ll = /* @__PURE__ */ S("$ZodNumber", (e, t) => {
1371
1369
  nl.init(e, t), Aa.init(e, t);
1372
1370
  }), Ul = /* @__PURE__ */ S("$ZodBoolean", (e, t) => {
1373
- U.init(e, t), e._zod.pattern = Qi, e._zod.parse = (r, n) => {
1371
+ U.init(e, t), e._zod.pattern = Xi, e._zod.parse = (r, n) => {
1374
1372
  if (t.coerce)
1375
1373
  try {
1376
1374
  r.value = !!r.value;
@@ -1385,7 +1383,7 @@ const Fl = /* @__PURE__ */ S("$ZodJWT", (e, t) => {
1385
1383
  }), r;
1386
1384
  };
1387
1385
  }), Bl = /* @__PURE__ */ S("$ZodNull", (e, t) => {
1388
- U.init(e, t), e._zod.pattern = Xi, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (r, n) => {
1386
+ U.init(e, t), e._zod.pattern = Qi, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (r, n) => {
1389
1387
  const a = r.value;
1390
1388
  return a === null || r.issues.push({
1391
1389
  expected: "null",
@@ -1762,7 +1760,7 @@ const Yl = /* @__PURE__ */ S("$ZodRecord", (e, t) => {
1762
1760
  inst: e
1763
1761
  }), n;
1764
1762
  };
1765
- }), Ql = /* @__PURE__ */ S("$ZodLiteral", (e, t) => {
1763
+ }), Xl = /* @__PURE__ */ S("$ZodLiteral", (e, t) => {
1766
1764
  U.init(e, t), e._zod.values = new Set(t.values), e._zod.pattern = new RegExp(`^(${t.values.map((r) => typeof r == "string" ? ht(r) : r ? r.toString() : String(r)).join("|")})$`), e._zod.parse = (r, n) => {
1767
1765
  const a = r.value;
1768
1766
  return e._zod.values.has(a) || r.issues.push({
@@ -1772,7 +1770,7 @@ const Yl = /* @__PURE__ */ S("$ZodRecord", (e, t) => {
1772
1770
  inst: e
1773
1771
  }), r;
1774
1772
  };
1775
- }), Xl = /* @__PURE__ */ S("$ZodTransform", (e, t) => {
1773
+ }), Ql = /* @__PURE__ */ S("$ZodTransform", (e, t) => {
1776
1774
  U.init(e, t), e._zod.parse = (r, n) => {
1777
1775
  const a = t.transform(r.value, r);
1778
1776
  if (n.async)
@@ -1810,10 +1808,10 @@ const nc = /* @__PURE__ */ S("$ZodPrefault", (e, t) => {
1810
1808
  return r ? new Set([...r].filter((n) => n !== void 0)) : void 0;
1811
1809
  }), e._zod.parse = (r, n) => {
1812
1810
  const a = t.innerType._zod.run(r, n);
1813
- return a instanceof Promise ? a.then((s) => Qr(s, e)) : Qr(a, e);
1811
+ return a instanceof Promise ? a.then((s) => Xr(s, e)) : Xr(a, e);
1814
1812
  };
1815
1813
  });
1816
- function Qr(e, t) {
1814
+ function Xr(e, t) {
1817
1815
  return !e.issues.length && e.value === void 0 && e.issues.push({
1818
1816
  code: "invalid_type",
1819
1817
  expected: "nonoptional",
@@ -1841,10 +1839,10 @@ const sc = /* @__PURE__ */ S("$ZodCatch", (e, t) => {
1841
1839
  }), oc = /* @__PURE__ */ S("$ZodPipe", (e, t) => {
1842
1840
  U.init(e, t), j(e._zod, "values", () => t.in._zod.values), j(e._zod, "optin", () => t.in._zod.optin), j(e._zod, "optout", () => t.out._zod.optout), e._zod.parse = (r, n) => {
1843
1841
  const a = t.in._zod.run(r, n);
1844
- return a instanceof Promise ? a.then((s) => Xr(s, t, n)) : Xr(a, t, n);
1842
+ return a instanceof Promise ? a.then((s) => Qr(s, t, n)) : Qr(a, t, n);
1845
1843
  };
1846
1844
  });
1847
- function Xr(e, t, r) {
1845
+ function Qr(e, t, r) {
1848
1846
  return ot(e) ? e : t.out._zod.run({ value: e.value, issues: e.issues }, r);
1849
1847
  }
1850
1848
  const ic = /* @__PURE__ */ S("$ZodReadonly", (e, t) => {
@@ -2320,10 +2318,10 @@ function Yc() {
2320
2318
  function Hc() {
2321
2319
  return gt((e) => e.toLowerCase());
2322
2320
  }
2323
- function Qc() {
2321
+ function Xc() {
2324
2322
  return gt((e) => e.toUpperCase());
2325
2323
  }
2326
- function Xc(e, t, r) {
2324
+ function Qc(e, t, r) {
2327
2325
  return new e({
2328
2326
  type: "array",
2329
2327
  element: t,
@@ -2938,7 +2936,7 @@ const du = (e, t) => {
2938
2936
  }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), Pa = /* @__PURE__ */ S("_ZodString", (e, t) => {
2939
2937
  br.init(e, t), q.init(e, t);
2940
2938
  const r = e._zod.bag;
2941
- e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(Bc(...n)), e.includes = (...n) => e.check(Jc(...n)), e.startsWith = (...n) => e.check(Wc(...n)), e.endsWith = (...n) => e.check(Kc(...n)), e.min = (...n) => e.check($t(...n)), e.max = (...n) => e.check(Oa(...n)), e.length = (...n) => e.check(za(...n)), e.nonempty = (...n) => e.check($t(1, ...n)), e.lowercase = (n) => e.check(Vc(n)), e.uppercase = (n) => e.check(qc(n)), e.trim = () => e.check(Yc()), e.normalize = (...n) => e.check(Gc(...n)), e.toLowerCase = () => e.check(Hc()), e.toUpperCase = () => e.check(Qc());
2939
+ e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(Bc(...n)), e.includes = (...n) => e.check(Jc(...n)), e.startsWith = (...n) => e.check(Wc(...n)), e.endsWith = (...n) => e.check(Kc(...n)), e.min = (...n) => e.check($t(...n)), e.max = (...n) => e.check(Oa(...n)), e.length = (...n) => e.check(za(...n)), e.nonempty = (...n) => e.check($t(1, ...n)), e.lowercase = (n) => e.check(Vc(n)), e.uppercase = (n) => e.check(qc(n)), e.trim = () => e.check(Yc()), e.normalize = (...n) => e.check(Gc(...n)), e.toLowerCase = () => e.check(Hc()), e.toUpperCase = () => e.check(Xc());
2942
2940
  }), hu = /* @__PURE__ */ S("ZodString", (e, t) => {
2943
2941
  br.init(e, t), Pa.init(e, t), e.email = (r) => e.check(pc(bu, r)), e.url = (r) => e.check(bc(vu, r)), e.jwt = (r) => e.check(Oc(zu, r)), e.emoji = (r) => e.check(vc(yu, r)), e.guid = (r) => e.check(rn(ln, r)), e.uuid = (r) => e.check(fc(St, r)), e.uuidv4 = (r) => e.check(mc(St, r)), e.uuidv6 = (r) => e.check(hc(St, r)), e.uuidv7 = (r) => e.check(gc(St, r)), e.nanoid = (r) => e.check(yc(xu, r)), e.guid = (r) => e.check(rn(ln, r)), e.cuid = (r) => e.check(xc(wu, r)), e.cuid2 = (r) => e.check(wc(_u, r)), e.ulid = (r) => e.check(_c(Iu, r)), e.base64 = (r) => e.check(Ac(Cu, r)), e.base64url = (r) => e.check(Cc($u, r)), e.xid = (r) => e.check(Ic(Su, r)), e.ksuid = (r) => e.check(Sc(Nu, r)), e.ipv4 = (r) => e.check(Nc(ku, r)), e.ipv6 = (r) => e.check(kc(Eu, r)), e.cidrv4 = (r) => e.check(Ec(Tu, r)), e.cidrv6 = (r) => e.check(Tc(Au, r)), e.e164 = (r) => e.check($c(Ou, r)), e.datetime = (r) => e.check(au(r)), e.date = (r) => e.check(ou(r)), e.time = (r) => e.check(lu(r)), e.duration = (r) => e.check(uu(r));
2944
2942
  });
@@ -3027,7 +3025,7 @@ const Uu = /* @__PURE__ */ S("ZodArray", (e, t) => {
3027
3025
  Jl.init(e, t), q.init(e, t), e.element = t.element, e.min = (r, n) => e.check($t(r, n)), e.nonempty = (r) => e.check($t(1, r)), e.max = (r, n) => e.check(Oa(r, n)), e.length = (r, n) => e.check(za(r, n)), e.unwrap = () => e.element;
3028
3026
  });
3029
3027
  function ja(e, t) {
3030
- return Xc(Uu, e, t);
3028
+ return Qc(Uu, e, t);
3031
3029
  }
3032
3030
  const Da = /* @__PURE__ */ S("ZodObject", (e, t) => {
3033
3031
  Wl.init(e, t), q.init(e, t), j(e, "shape", () => t.shape), e.keyof = () => Ua(Object.keys(e._zod.def.shape)), e.catchall = (r) => e.clone({ ...e._zod.def, catchall: r }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Ot() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Ot() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Za() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (r) => vi(e, r), e.merge = (r) => yi(e, r), e.pick = (r) => gi(e, r), e.omit = (r) => bi(e, r), e.partial = (...r) => xi(Ba, e, r[0]), e.required = (...r) => wi(Va, e, r[0]);
@@ -3134,7 +3132,7 @@ function Ua(e, t) {
3134
3132
  });
3135
3133
  }
3136
3134
  const Hu = /* @__PURE__ */ S("ZodLiteral", (e, t) => {
3137
- Ql.init(e, t), q.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
3135
+ Xl.init(e, t), q.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", {
3138
3136
  get() {
3139
3137
  if (t.values.length > 1)
3140
3138
  throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
@@ -3142,15 +3140,15 @@ const Hu = /* @__PURE__ */ S("ZodLiteral", (e, t) => {
3142
3140
  }
3143
3141
  });
3144
3142
  });
3145
- function Qu(e, t) {
3143
+ function Xu(e, t) {
3146
3144
  return new Hu({
3147
3145
  type: "literal",
3148
3146
  values: Array.isArray(e) ? e : [e],
3149
3147
  ...$(t)
3150
3148
  });
3151
3149
  }
3152
- const Xu = /* @__PURE__ */ S("ZodTransform", (e, t) => {
3153
- Xl.init(e, t), q.init(e, t), e._zod.parse = (r, n) => {
3150
+ const Qu = /* @__PURE__ */ S("ZodTransform", (e, t) => {
3151
+ Ql.init(e, t), q.init(e, t), e._zod.parse = (r, n) => {
3154
3152
  r.addIssue = (s) => {
3155
3153
  if (typeof s == "string")
3156
3154
  r.issues.push(dt(s, r.value, t));
@@ -3164,7 +3162,7 @@ const Xu = /* @__PURE__ */ S("ZodTransform", (e, t) => {
3164
3162
  };
3165
3163
  });
3166
3164
  function ed(e) {
3167
- return new Xu({
3165
+ return new Qu({
3168
3166
  type: "transform",
3169
3167
  transform: e
3170
3168
  });
@@ -4103,7 +4101,7 @@ function Hd(e, t) {
4103
4101
  for (const o in a) {
4104
4102
  let c = a[o];
4105
4103
  if (c === void 0 || c._def === void 0) continue;
4106
- const f = Xd(c), i = F(c._def, {
4104
+ const f = Qd(c), i = F(c._def, {
4107
4105
  ...t,
4108
4106
  currentPath: [
4109
4107
  ...t.currentPath,
@@ -4119,10 +4117,10 @@ function Hd(e, t) {
4119
4117
  i !== void 0 && (r.properties[o] = i, f || n.push(o));
4120
4118
  }
4121
4119
  n.length && (r.required = n);
4122
- const s = Qd(e, t);
4120
+ const s = Xd(e, t);
4123
4121
  return s !== void 0 && (r.additionalProperties = s), r;
4124
4122
  }
4125
- function Qd(e, t) {
4123
+ function Xd(e, t) {
4126
4124
  if (e.catchall._def.typeName !== "ZodNever") return F(e.catchall._def, {
4127
4125
  ...t,
4128
4126
  currentPath: [...t.currentPath, "additionalProperties"]
@@ -4136,7 +4134,7 @@ function Qd(e, t) {
4136
4134
  return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
4137
4135
  }
4138
4136
  }
4139
- function Xd(e) {
4137
+ function Qd(e) {
4140
4138
  try {
4141
4139
  return e.isOptional();
4142
4140
  } catch {
@@ -4556,7 +4554,7 @@ async function Ye(e) {
4556
4554
  return typeof e == "function" && (e = e()), e;
4557
4555
  }
4558
4556
  new TextDecoder();
4559
- const Ha = "AI_InvalidArgumentError", Qa = `vercel.ai.error.${Ha}`, Ip = Symbol.for(Qa);
4557
+ const Ha = "AI_InvalidArgumentError", Xa = `vercel.ai.error.${Ha}`, Ip = Symbol.for(Xa);
4560
4558
  var Et = class extends re {
4561
4559
  constructor({ parameter: e, value: t, message: r }) {
4562
4560
  super({
@@ -4565,14 +4563,14 @@ var Et = class extends re {
4565
4563
  }), this[Ip] = !0, this.parameter = e, this.value = t;
4566
4564
  }
4567
4565
  static isInstance(e) {
4568
- return re.hasMarker(e, Qa);
4566
+ return re.hasMarker(e, Xa);
4569
4567
  }
4570
4568
  };
4571
- const Xa = "AI_UIMessageStreamError", es = `vercel.ai.error.${Xa}`, Sp = Symbol.for(es);
4569
+ const Qa = "AI_UIMessageStreamError", es = `vercel.ai.error.${Qa}`, Sp = Symbol.for(es);
4572
4570
  var Me = class extends re {
4573
4571
  constructor({ chunkType: e, chunkId: t, message: r }) {
4574
4572
  super({
4575
- name: Xa,
4573
+ name: Qa,
4576
4574
  message: r
4577
4575
  }), this[Sp] = !0, this.chunkType = e, this.chunkId = t;
4578
4576
  }
@@ -4602,7 +4600,7 @@ const l = {
4602
4600
  enum: Ua,
4603
4601
  instanceof: vd,
4604
4602
  lazy: fd,
4605
- literal: Qu,
4603
+ literal: Xu,
4606
4604
  looseObject: Vu,
4607
4605
  never: Za,
4608
4606
  null: Du,
@@ -6400,26 +6398,26 @@ function Hp(e, t) {
6400
6398
  }, f);
6401
6399
  };
6402
6400
  }
6403
- var Qp = Hp;
6404
- const Xp = /* @__PURE__ */ ho(Qp);
6401
+ var Xp = Hp;
6402
+ const Qp = /* @__PURE__ */ mo(Xp);
6405
6403
  function ef(e, t) {
6406
- return t != null ? Xp(e, t) : e;
6404
+ return t != null ? Qp(e, t) : e;
6407
6405
  }
6408
6406
  function tf(e) {
6409
6407
  return Array.isArray(e) ? [...e] : e != null && typeof e == "object" && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null) ? { ...e } : e;
6410
6408
  }
6411
- var ce, Qe, Xe, Ze, je, De, Ne, pt, ft, Tn, rf = (Tn = class {
6409
+ var ce, Xe, Qe, Ze, je, De, Ne, pt, ft, Tn, rf = (Tn = class {
6412
6410
  constructor(e = []) {
6413
6411
  me(this, ce);
6414
- me(this, Qe);
6415
6412
  me(this, Xe);
6413
+ me(this, Qe);
6416
6414
  me(this, Ze);
6417
6415
  me(this, je);
6418
6416
  me(this, De);
6419
6417
  me(this, Ne);
6420
6418
  me(this, pt);
6421
6419
  me(this, ft);
6422
- ee(this, Qe, "ready"), ee(this, Xe, void 0), ee(this, Ze, /* @__PURE__ */ new Set()), ee(this, je, /* @__PURE__ */ new Set()), ee(this, De, /* @__PURE__ */ new Set()), this.pushMessage = (t) => {
6420
+ ee(this, Xe, "ready"), ee(this, Qe, void 0), ee(this, Ze, /* @__PURE__ */ new Set()), ee(this, je, /* @__PURE__ */ new Set()), ee(this, De, /* @__PURE__ */ new Set()), this.pushMessage = (t) => {
6423
6421
  ee(this, ce, L(this, ce).concat(t)), L(this, Ne).call(this);
6424
6422
  }, this.popMessage = () => {
6425
6423
  ee(this, ce, L(this, ce).slice(0, -1)), L(this, Ne).call(this);
@@ -6454,16 +6452,16 @@ var ce, Qe, Xe, Ze, je, De, Ne, pt, ft, Tn, rf = (Tn = class {
6454
6452
  }), ee(this, ce, e);
6455
6453
  }
6456
6454
  get status() {
6457
- return L(this, Qe);
6455
+ return L(this, Xe);
6458
6456
  }
6459
6457
  set status(e) {
6460
- ee(this, Qe, e), L(this, pt).call(this);
6458
+ ee(this, Xe, e), L(this, pt).call(this);
6461
6459
  }
6462
6460
  get error() {
6463
- return L(this, Xe);
6461
+ return L(this, Qe);
6464
6462
  }
6465
6463
  set error(e) {
6466
- ee(this, Xe, e), L(this, ft).call(this);
6464
+ ee(this, Qe, e), L(this, ft).call(this);
6467
6465
  }
6468
6466
  get messages() {
6469
6467
  return L(this, ce);
@@ -6471,7 +6469,7 @@ var ce, Qe, Xe, Ze, je, De, Ne, pt, ft, Tn, rf = (Tn = class {
6471
6469
  set messages(e) {
6472
6470
  ee(this, ce, [...e]), L(this, Ne).call(this);
6473
6471
  }
6474
- }, ce = new WeakMap(), Qe = new WeakMap(), Xe = new WeakMap(), Ze = new WeakMap(), je = new WeakMap(), De = new WeakMap(), Ne = new WeakMap(), pt = new WeakMap(), ft = new WeakMap(), Tn), Fe, An, is = (An = class extends Yp {
6472
+ }, ce = new WeakMap(), Xe = new WeakMap(), Qe = new WeakMap(), Ze = new WeakMap(), je = new WeakMap(), De = new WeakMap(), Ne = new WeakMap(), pt = new WeakMap(), ft = new WeakMap(), Tn), Fe, An, is = (An = class extends Yp {
6475
6473
  constructor({ messages: t, ...r }) {
6476
6474
  const n = new rf(t);
6477
6475
  super({
@@ -6682,12 +6680,12 @@ function hf(e) {
6682
6680
  const Z = t.current.applyProposal;
6683
6681
  if (r.current !== C || !Z) return;
6684
6682
  const de = C.proposals.has(M.proposalId), pe = C.proposals.get(M.proposalId) ?? null;
6685
- R(C, 1), a((Q) => Pe(Q, C.chat.id, M.proposalId, { status: "applying" })), C.applying = C.applying.then(async () => {
6686
- const Q = de ? pe === null ? C.answerBase : C.appliedAfter.get(pe) : void 0, fe = de && pe !== null ? { ok: !1, reason: "previous_not_applied", message: zr.previous_not_applied } : { ok: !1, reason: "dashboard_changed", message: zr.dashboard_changed };
6683
+ R(C, 1), a((X) => Pe(X, C.chat.id, M.proposalId, { status: "applying" })), C.applying = C.applying.then(async () => {
6684
+ const X = de ? pe === null ? C.answerBase : C.appliedAfter.get(pe) : void 0, fe = de && pe !== null ? { ok: !1, reason: "previous_not_applied", message: zr.previous_not_applied } : { ok: !1, reason: "dashboard_changed", message: zr.dashboard_changed };
6687
6685
  let ae;
6688
6686
  try {
6689
- ae = Q ? await Z(
6690
- { proposalId: M.proposalId, operations: M.operations, context: M.context, basedOn: Q },
6687
+ ae = X ? await Z(
6688
+ { proposalId: M.proposalId, operations: M.operations, context: M.context, basedOn: X },
6691
6689
  { stillWanted: () => r.current === C }
6692
6690
  ) : fe;
6693
6691
  } catch (Ie) {
@@ -6733,15 +6731,15 @@ function hf(e) {
6733
6731
  ...Z.cardReplay ?? {},
6734
6732
  ...C.length ? { taggedFields: C } : {}
6735
6733
  };
6736
- if (Xt({ ...de, message: M }) > et.requestBytes)
6737
- return y(new qn(Xt(de)).message), "not_sent";
6734
+ if (Qt({ ...de, message: M }) > et.requestBytes)
6735
+ return y(new qn(Qt(de)).message), "not_sent";
6738
6736
  y(void 0);
6739
6737
  const pe = (fe = Z.context.selectedCard) == null ? void 0 : fe.id;
6740
6738
  pe && (m.aboutCardId = pe);
6741
- const Q = gf(Z.context, (($e = (ae = t.current).canChangeOpenDashboard) == null ? void 0 : $e.call(ae)) ?? !1);
6742
- return m.answerBase = Q, m.proposals.clear(), m.appliedAfter.clear(), m.chat.sendMessage(
6739
+ const X = gf(Z.context, (($e = (ae = t.current).canChangeOpenDashboard) == null ? void 0 : $e.call(ae)) ?? !1);
6740
+ return m.answerBase = X, m.proposals.clear(), m.appliedAfter.clear(), m.chat.sendMessage(
6743
6741
  { text: M, ...C.length ? { metadata: { taggedFields: C } } : {} },
6744
- { body: Q ? { ...de, openDashboard: Q } : de }
6742
+ { body: X ? { ...de, openDashboard: X } : de }
6745
6743
  ), "sent";
6746
6744
  },
6747
6745
  [m, h]
@@ -6754,7 +6752,7 @@ function hf(e) {
6754
6752
  [m, O]
6755
6753
  ), H = te(
6756
6754
  (R) => {
6757
- const C = X.getState().actions.undoProposal(R);
6755
+ const C = Q.getState().actions.undoProposal(R);
6758
6756
  return C.ok && a((M) => Pe(M, m.chat.id, R, { status: "undone" })), C.ok;
6759
6757
  },
6760
6758
  [m]
@@ -6763,9 +6761,9 @@ function hf(e) {
6763
6761
  var pe;
6764
6762
  const C = m.chat.id, M = (pe = s[C]) == null ? void 0 : pe[R];
6765
6763
  if ((M == null ? void 0 : M.status) !== "offered") return;
6766
- o((Q) => Pe(Q, C, R, { status: "adding" }));
6767
- const Z = await cf(u.connection(), R).catch((Q) => (console.warn("The relationship could not be added:", Q), { ok: !1, code: void 0 })), de = Z.ok ? { status: "added" } : { status: "refused", message: ko(Z.code) };
6768
- o((Q) => Pe(Q, C, R, de));
6764
+ o((X) => Pe(X, C, R, { status: "adding" }));
6765
+ const Z = await cf(u.connection(), R).catch((X) => (console.warn("The relationship could not be added:", X), { ok: !1, code: void 0 })), de = Z.ok ? { status: "added" } : { status: "refused", message: ko(Z.code) };
6766
+ o((X) => Pe(X, C, R, de));
6769
6767
  },
6770
6768
  [m, u, s]
6771
6769
  ), Ke = te(
@@ -6846,9 +6844,9 @@ function hf(e) {
6846
6844
  function gf(e, t) {
6847
6845
  var n;
6848
6846
  if (!t || e.surface !== "dashboard") return;
6849
- const r = X.getState().dashboard;
6847
+ const r = Q.getState().dashboard;
6850
6848
  if (!(!(r != null && r.id) || r.id !== ((n = e.dashboard) == null ? void 0 : n.id)))
6851
- return Xt(r) <= et.openDashboardBytes ? r : void 0;
6849
+ return Qt(r) <= et.openDashboardBytes ? r : void 0;
6852
6850
  }
6853
6851
  function Yt(e, t) {
6854
6852
  const r = {
@@ -6931,7 +6929,7 @@ function ps({ children: e, className: t }) {
6931
6929
  return /* @__PURE__ */ p("td", { className: B("border-b border-border/60 px-2 py-1.5 align-top", t), children: e });
6932
6930
  }
6933
6931
  function Sr() {
6934
- return Rs() ?? mo;
6932
+ return Rs() ?? ho;
6935
6933
  }
6936
6934
  function fs(e, t) {
6937
6935
  return Do({
@@ -7071,8 +7069,8 @@ function Tf({
7071
7069
  ] });
7072
7070
  }
7073
7071
  function Af(e, t, r) {
7074
- const [n, a] = D({ status: "idle" }), s = X(
7075
- (c) => n.status === "added" ? Qn(c.dashboard, n.frameId) : !1
7072
+ const [n, a] = D({ status: "idle" }), s = Q(
7073
+ (c) => n.status === "added" ? Xn(c.dashboard, n.frameId) : !1
7076
7074
  );
7077
7075
  if (!r || !e.card) return { action: null, note: null };
7078
7076
  if (n.status === "added" && s)
@@ -7167,7 +7165,7 @@ function $f({ artifact: e, onClose: t }) {
7167
7165
  );
7168
7166
  }
7169
7167
  function ms(e, t) {
7170
- const [r, n] = D(t), a = it(() => Of(e, r), [e, r]), s = X(Ds((i) => ({ themeStyle: i.themeStyle, theme: i.theme }))), o = Sr(), c = it(
7168
+ const [r, n] = D(t), a = it(() => Of(e, r), [e, r]), s = Q(Ds((i) => ({ themeStyle: i.themeStyle, theme: i.theme }))), o = Sr(), c = it(
7171
7169
  () => If(e, a, o, s),
7172
7170
  [e, a, o, s]
7173
7171
  ), f = a.kind === "table" || a.kind !== "number" && !c ? "table" : a.kind;
@@ -7321,11 +7319,11 @@ function Zf({ trace: e, stages: t }) {
7321
7319
  we(r("check"))
7322
7320
  ] }),
7323
7321
  /* @__PURE__ */ k("p", { children: [
7324
- Qt(n),
7322
+ Xt(n),
7325
7323
  " tokens in (",
7326
- Qt(a),
7324
+ Xt(a),
7327
7325
  " cached) · ",
7328
- Qt(s),
7326
+ Xt(s),
7329
7327
  " out · ",
7330
7328
  e.model
7331
7329
  ] })
@@ -7364,7 +7362,7 @@ function Df({ trace: e, stages: t }) {
7364
7362
  ] })
7365
7363
  ] });
7366
7364
  }
7367
- function Qt(e) {
7365
+ function Xt(e) {
7368
7366
  return e.toLocaleString("en-US");
7369
7367
  }
7370
7368
  function vt({
@@ -7612,7 +7610,7 @@ function qf({
7612
7610
  onUndo: r,
7613
7611
  onAskAgain: n
7614
7612
  }) {
7615
- const a = X((g) => Bs(g, e.proposalId)), s = X((g) => g.isVisualEditing), o = Kf(t, a), c = o.kind === "undone" || o.kind === "refused", f = !c && o.kind !== "settled", i = o.kind === "changed_since" ? Vf : o.kind === "undone" ? "Undone." : o.kind === "refused" ? o.message : void 0;
7613
+ const a = Q((g) => Bs(g, e.proposalId)), s = Q((g) => g.isVisualEditing), o = Kf(t, a), c = o.kind === "undone" || o.kind === "refused", f = !c && o.kind !== "settled", i = o.kind === "changed_since" ? Vf : o.kind === "undone" ? "Undone." : o.kind === "refused" ? o.message : void 0;
7616
7614
  return /* @__PURE__ */ k(
7617
7615
  vt,
7618
7616
  {
@@ -7780,9 +7778,9 @@ function Hf({
7780
7778
  onAdd: a,
7781
7779
  onPick: s,
7782
7780
  onAskAgain: o,
7783
- proposalStates: c = Qf,
7781
+ proposalStates: c = Xf,
7784
7782
  onUndoProposal: f,
7785
- modelChangeStates: i = Xf,
7783
+ modelChangeStates: i = Qf,
7786
7784
  onAddModelChange: g,
7787
7785
  onDismissModelChange: u
7788
7786
  }) {
@@ -7814,7 +7812,7 @@ function Hf({
7814
7812
  r ? /* @__PURE__ */ p("p", { role: "alert", className: "text-[12.5px] leading-[1.6] text-destructive", children: r }) : null
7815
7813
  ] });
7816
7814
  }
7817
- const Qf = {}, Xf = {};
7815
+ const Xf = {}, Qf = {};
7818
7816
  function em(e) {
7819
7817
  return e.parts.map((t) => t.type === "text" ? t.text : "").join("");
7820
7818
  }
@@ -8050,8 +8048,8 @@ function gm({
8050
8048
  s.ok ? /* @__PURE__ */ p(mt, { className: "h-3 w-3" }) : null,
8051
8049
  s.ok ? "Copied" : "Couldn’t copy"
8052
8050
  ] }) : null,
8053
- /* @__PURE__ */ k(Qs, { children: [
8054
- /* @__PURE__ */ p(Xs, { asChild: !0, children: /* @__PURE__ */ p(
8051
+ /* @__PURE__ */ k(Xs, { children: [
8052
+ /* @__PURE__ */ p(Qs, { asChild: !0, children: /* @__PURE__ */ p(
8055
8053
  Y,
8056
8054
  {
8057
8055
  variant: "ghost",
@@ -8354,13 +8352,13 @@ function Sm(e, t) {
8354
8352
  return { text: e.slice(0, n) + e.slice(t), caret: n };
8355
8353
  }
8356
8354
  const Nm = [], km = { withRequest: !0 };
8357
- function sh({
8355
+ function nh({
8358
8356
  instance: e,
8359
8357
  surface: t = "dashboard",
8360
8358
  placement: r
8361
8359
  }) {
8362
8360
  var Ar, Cr;
8363
- const n = t === "none", a = oo(), s = xt(e.store, (A) => A.focus), o = xt(e.store, (A) => A.isOpen), c = xt(e.store, (A) => A.askCount), f = xt(e.store, (A) => A.layout), i = n ? "full-page" : f, g = r ?? i, u = g === "beside-card", m = X(
8361
+ const n = t === "none", a = oo(), s = xt(e.store, (A) => A.focus), o = xt(e.store, (A) => A.isOpen), c = xt(e.store, (A) => A.askCount), f = xt(e.store, (A) => A.layout), i = n ? "full-page" : f, g = r ?? i, u = g === "beside-card", m = Q(
8364
8362
  (A) => {
8365
8363
  var P;
8366
8364
  return s && A.dashboard ? (P = go(A.dashboard, s.cardId)) == null ? void 0 : P.card : void 0;
@@ -8445,7 +8443,7 @@ function sh({
8445
8443
  return;
8446
8444
  }
8447
8445
  A.key === "Enter" && !A.shiftKey && !A.nativeEvent.isComposing && M(A);
8448
- }, Q = T.messages.length === 0, [fe, ae] = D(), $e = (fe == null ? void 0 : fe.sessionKey) === T.sessionKey ? Am(T.messages, fe.artifactId) : void 0, Ie = (A) => {
8446
+ }, X = T.messages.length === 0, [fe, ae] = D(), $e = (fe == null ? void 0 : fe.sessionKey) === T.sessionKey ? Am(T.messages, fe.artifactId) : void 0, Ie = (A) => {
8449
8447
  ae((P) => ({ sessionKey: T.sessionKey, artifactId: A, opened: ((P == null ? void 0 : P.opened) ?? 0) + 1 })), e.leaveBeside(), i !== "full-page" && e.setLayout("full-page");
8450
8448
  }, Oe = g === "full-page", Er = /* @__PURE__ */ p(
8451
8449
  Y,
@@ -8455,7 +8453,7 @@ function sh({
8455
8453
  className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
8456
8454
  "aria-label": "New conversation",
8457
8455
  title: "New conversation",
8458
- disabled: Q && !T.busy && !T.loading,
8456
+ disabled: X && !T.busy && !T.loading,
8459
8457
  onClick: () => {
8460
8458
  var A;
8461
8459
  T.startNew(), (A = H.current) == null || A.focus();
@@ -8483,7 +8481,7 @@ function sh({
8483
8481
  T.readForCopy(A).then((P) => $o(P, { assistantName: e.assistantName, toolCalls: A }))
8484
8482
  )
8485
8483
  }
8486
- ), yt = Q && Oe && !T.loading, Ts = /* @__PURE__ */ k("footer", { className: B("shrink-0 space-y-2", yt ? "px-0" : "p-3"), children: [
8484
+ ), yt = X && Oe && !T.loading, Ts = /* @__PURE__ */ k("footer", { className: B("shrink-0 space-y-2", yt ? "px-0" : "p-3"), children: [
8487
8485
  m && !w && !u ? /* @__PURE__ */ k("div", { className: "flex items-center gap-1.5", children: [
8488
8486
  /* @__PURE__ */ k(
8489
8487
  "span",
@@ -8691,7 +8689,7 @@ function sh({
8691
8689
  Mm,
8692
8690
  {
8693
8691
  conversation: T,
8694
- empty: Q,
8692
+ empty: X,
8695
8693
  layout: g,
8696
8694
  onExpand: Ie,
8697
8695
  onAdd: v,
@@ -8746,15 +8744,15 @@ function En({
8746
8744
  }, [e, t, n, r]), null;
8747
8745
  }
8748
8746
  function Cm(e) {
8749
- const t = X((n) => n.isVisualEditing), r = jn((n) => n.card);
8747
+ const t = Q((n) => n.isVisualEditing), r = jn((n) => n.card);
8750
8748
  return !e && t ? r : void 0;
8751
8749
  }
8752
8750
  function $m(e) {
8753
- if (!(e || !X.getState().isVisualEditing))
8751
+ if (!(e || !Q.getState().isVisualEditing))
8754
8752
  return Zn(), Es(e);
8755
8753
  }
8756
8754
  function Es(e) {
8757
- if (e || !X.getState().isVisualEditing) return;
8755
+ if (e || !Q.getState().isVisualEditing) return;
8758
8756
  const t = jn.getState();
8759
8757
  return { card: t.card, mode: t.isDevMode ? "sql" : "visual" };
8760
8758
  }
@@ -8845,5 +8843,5 @@ function Mm({
8845
8843
  ] });
8846
8844
  }
8847
8845
  export {
8848
- sh as default
8846
+ nh as default
8849
8847
  };
@@ -1,5 +1,5 @@
1
- import { x as g, z as $ } from "./bookmark-state-Du3s13_V.js";
2
- import { l as F, h as C, a as O, b as v, i as S, f as T } from "./stored-dashboard-d3xQYxBD.js";
1
+ import { x as g, z as $ } from "./bookmark-state-CflS88gq.js";
2
+ import { l as F, h as C, a as O, b as v, i as S, f as T } from "./stored-dashboard-B6_StAty.js";
3
3
  function D(e) {
4
4
  var d, c, f;
5
5
  const { saved: s, draft: a, usage: l } = e, b = [], j = F(s);