drizzle-cube 0.4.13 → 0.4.14

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 (116) hide show
  1. package/README.md +1 -0
  2. package/dist/adapters/express/index.cjs +6 -6
  3. package/dist/adapters/express/index.js +73 -72
  4. package/dist/adapters/fastify/index.cjs +5 -5
  5. package/dist/adapters/fastify/index.js +110 -109
  6. package/dist/adapters/{handler-CQkIwtxp.js → handler-DZnCbydH.js} +719 -272
  7. package/dist/adapters/handler-ZDYlokiM.cjs +25 -0
  8. package/dist/adapters/hono/index.cjs +6 -6
  9. package/dist/adapters/hono/index.js +121 -120
  10. package/dist/adapters/nextjs/index.cjs +5 -5
  11. package/dist/adapters/nextjs/index.js +92 -91
  12. package/dist/client/charts.js +67 -59
  13. package/dist/client/charts.js.map +1 -1
  14. package/dist/client/chunks/{RetentionCombinedChart-CEI8KQ3t.js → RetentionCombinedChart-CLq89aOJ.js} +2 -2
  15. package/dist/client/chunks/{RetentionCombinedChart-CEI8KQ3t.js.map → RetentionCombinedChart-CLq89aOJ.js.map} +1 -1
  16. package/dist/client/chunks/{analysis-builder-BMmWeFPr.js → analysis-builder-C5e52Z3p.js} +419 -411
  17. package/dist/client/chunks/analysis-builder-C5e52Z3p.js.map +1 -0
  18. package/dist/client/chunks/{analysis-builder-shared-D56zYeV0.js → analysis-builder-shared-EnM-8plh.js} +2 -2
  19. package/dist/client/chunks/{analysis-builder-shared-D56zYeV0.js.map → analysis-builder-shared-EnM-8plh.js.map} +1 -1
  20. package/dist/client/chunks/{chart-activity-grid-CE7xGFQo.js → chart-activity-grid-CPGcTSuh.js} +2 -2
  21. package/dist/client/chunks/{chart-activity-grid-CE7xGFQo.js.map → chart-activity-grid-CPGcTSuh.js.map} +1 -1
  22. package/dist/client/chunks/{chart-area-BJAgusst.js → chart-area-ByJQ7NZd.js} +3 -3
  23. package/dist/client/chunks/{chart-area-BJAgusst.js.map → chart-area-ByJQ7NZd.js.map} +1 -1
  24. package/dist/client/chunks/{chart-bar-Blypx8O4.js → chart-bar-dj14frMt.js} +2 -2
  25. package/dist/client/chunks/{chart-bar-Blypx8O4.js.map → chart-bar-dj14frMt.js.map} +1 -1
  26. package/dist/client/chunks/chart-box-plot-ZatBpatq.js +322 -0
  27. package/dist/client/chunks/chart-box-plot-ZatBpatq.js.map +1 -0
  28. package/dist/client/chunks/{chart-bubble-Bf42A1-B.js → chart-bubble-CemotLx-.js} +2 -2
  29. package/dist/client/chunks/{chart-bubble-Bf42A1-B.js.map → chart-bubble-CemotLx-.js.map} +1 -1
  30. package/dist/client/chunks/chart-candlestick-BIR4uGGt.js +269 -0
  31. package/dist/client/chunks/chart-candlestick-BIR4uGGt.js.map +1 -0
  32. package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js +38 -0
  33. package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js.map +1 -0
  34. package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js +70 -0
  35. package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js.map +1 -0
  36. package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js +64 -0
  37. package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js.map +1 -0
  38. package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js +70 -0
  39. package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js.map +1 -0
  40. package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js +60 -0
  41. package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js.map +1 -0
  42. package/dist/client/chunks/{chart-data-table-Ba_6tuJw.js → chart-data-table-D5G8nMnb.js} +2 -2
  43. package/dist/client/chunks/{chart-data-table-Ba_6tuJw.js.map → chart-data-table-D5G8nMnb.js.map} +1 -1
  44. package/dist/client/chunks/{chart-funnel-C9kenCpp.js → chart-funnel-dofnhD24.js} +2 -2
  45. package/dist/client/chunks/{chart-funnel-C9kenCpp.js.map → chart-funnel-dofnhD24.js.map} +1 -1
  46. package/dist/client/chunks/chart-gauge-CKJJ8m3b.js +374 -0
  47. package/dist/client/chunks/chart-gauge-CKJJ8m3b.js.map +1 -0
  48. package/dist/client/chunks/{chart-heat-map-CYGemyPB.js → chart-heat-map-BVuPUKHT.js} +2 -2
  49. package/dist/client/chunks/{chart-heat-map-CYGemyPB.js.map → chart-heat-map-BVuPUKHT.js.map} +1 -1
  50. package/dist/client/chunks/{chart-kpi-delta-D9XJoKuA.js → chart-kpi-delta-Dgg2eYRl.js} +3 -3
  51. package/dist/client/chunks/{chart-kpi-delta-D9XJoKuA.js.map → chart-kpi-delta-Dgg2eYRl.js.map} +1 -1
  52. package/dist/client/chunks/{chart-kpi-number-C29Vj2g8.js → chart-kpi-number-DkoO99c1.js} +2 -2
  53. package/dist/client/chunks/{chart-kpi-number-C29Vj2g8.js.map → chart-kpi-number-DkoO99c1.js.map} +1 -1
  54. package/dist/client/chunks/{chart-kpi-text-CgjjrurK.js → chart-kpi-text-1O6_lmz7.js} +3 -3
  55. package/dist/client/chunks/{chart-kpi-text-CgjjrurK.js.map → chart-kpi-text-1O6_lmz7.js.map} +1 -1
  56. package/dist/client/chunks/{chart-line-zi6olZet.js → chart-line-DzyZkugh.js} +3 -3
  57. package/dist/client/chunks/{chart-line-zi6olZet.js.map → chart-line-DzyZkugh.js.map} +1 -1
  58. package/dist/client/chunks/chart-measure-profile-C2IkBG3V.js +114 -0
  59. package/dist/client/chunks/chart-measure-profile-C2IkBG3V.js.map +1 -0
  60. package/dist/client/chunks/{chart-pie-C4SuxKSN.js → chart-pie-akbfRfb9.js} +2 -2
  61. package/dist/client/chunks/{chart-pie-C4SuxKSN.js.map → chart-pie-akbfRfb9.js.map} +1 -1
  62. package/dist/client/chunks/{chart-radar-BW3Z_-Ly.js → chart-radar-BaN-Kjww.js} +2 -2
  63. package/dist/client/chunks/{chart-radar-BW3Z_-Ly.js.map → chart-radar-BaN-Kjww.js.map} +1 -1
  64. package/dist/client/chunks/{chart-radial-bar-0Fa3aeP5.js → chart-radial-bar-DpptEL3s.js} +2 -2
  65. package/dist/client/chunks/{chart-radial-bar-0Fa3aeP5.js.map → chart-radial-bar-DpptEL3s.js.map} +1 -1
  66. package/dist/client/chunks/{chart-sankey-DBghfbg1.js → chart-sankey-CG-3hHmX.js} +2 -2
  67. package/dist/client/chunks/{chart-sankey-DBghfbg1.js.map → chart-sankey-CG-3hHmX.js.map} +1 -1
  68. package/dist/client/chunks/{chart-scatter-DOVu1TNq.js → chart-scatter-l_yTVxF3.js} +2 -2
  69. package/dist/client/chunks/{chart-scatter-DOVu1TNq.js.map → chart-scatter-l_yTVxF3.js.map} +1 -1
  70. package/dist/client/chunks/{chart-sunburst-LfNthFlZ.js → chart-sunburst-KhDcKhmZ.js} +2 -2
  71. package/dist/client/chunks/{chart-sunburst-LfNthFlZ.js.map → chart-sunburst-KhDcKhmZ.js.map} +1 -1
  72. package/dist/client/chunks/{chart-tree-map-DZtQPyWX.js → chart-tree-map-CBbiaBXV.js} +2 -2
  73. package/dist/client/chunks/{chart-tree-map-DZtQPyWX.js.map → chart-tree-map-CBbiaBXV.js.map} +1 -1
  74. package/dist/client/chunks/chart-waterfall-CX3vx_lI.js +191 -0
  75. package/dist/client/chunks/chart-waterfall-CX3vx_lI.js.map +1 -0
  76. package/dist/client/chunks/{charts-core-DmGfleFz.js → charts-core-CU9u_HtL.js} +2 -1
  77. package/dist/client/chunks/charts-core-CU9u_HtL.js.map +1 -0
  78. package/dist/client/chunks/{charts-loader-CH0_S06T.js → charts-loader-AW3T1nv5.js} +58 -42
  79. package/dist/client/chunks/charts-loader-AW3T1nv5.js.map +1 -0
  80. package/dist/client/chunks/{components-ClQziOcT.js → components-BkeSy9xv.js} +4 -4
  81. package/dist/client/chunks/components-BkeSy9xv.js.map +1 -0
  82. package/dist/client/components/AgenticNotebook/AgentChatPanel.d.ts +10 -0
  83. package/dist/client/components/AgenticNotebook/ChatMessage.d.ts +2 -0
  84. package/dist/client/components/AgenticNotebook/index.d.ts +11 -1
  85. package/dist/client/components/LoadingIndicator.d.ts +2 -2
  86. package/dist/client/components/charts/BoxPlotChart.config.d.ts +1 -7
  87. package/dist/client/components/charts/CandlestickChart.config.d.ts +5 -0
  88. package/dist/client/components/charts/CandlestickChart.d.ts +4 -0
  89. package/dist/client/components/charts/GaugeChart.config.d.ts +5 -0
  90. package/dist/client/components/charts/GaugeChart.d.ts +4 -0
  91. package/dist/client/components/charts/MeasureProfileChart.config.d.ts +5 -0
  92. package/dist/client/components/charts/MeasureProfileChart.d.ts +4 -0
  93. package/dist/client/components/charts/WaterfallChart.config.d.ts +5 -0
  94. package/dist/client/components/charts/WaterfallChart.d.ts +4 -0
  95. package/dist/client/components/charts/index.d.ts +4 -0
  96. package/dist/client/components.js +1 -1
  97. package/dist/client/hooks/useAgentChat.d.ts +20 -2
  98. package/dist/client/index.js +583 -522
  99. package/dist/client/index.js.map +1 -1
  100. package/dist/client/styles.css +1 -1
  101. package/dist/client/types.d.ts +19 -1
  102. package/dist/client/utils.js +4 -4
  103. package/dist/client-bundle-stats.html +1 -1
  104. package/dist/server/index.cjs +47 -45
  105. package/dist/server/index.d.ts +37 -0
  106. package/dist/server/index.js +1745 -1298
  107. package/package.json +4 -1
  108. package/dist/adapters/handler-dnkqpznh.cjs +0 -23
  109. package/dist/client/chunks/analysis-builder-BMmWeFPr.js.map +0 -1
  110. package/dist/client/chunks/chart-box-plot-Dja4LS3O.js +0 -313
  111. package/dist/client/chunks/chart-box-plot-Dja4LS3O.js.map +0 -1
  112. package/dist/client/chunks/chart-config-box-plot-D3DA7_pr.js +0 -85
  113. package/dist/client/chunks/chart-config-box-plot-D3DA7_pr.js.map +0 -1
  114. package/dist/client/chunks/charts-core-DmGfleFz.js.map +0 -1
  115. package/dist/client/chunks/charts-loader-CH0_S06T.js.map +0 -1
  116. package/dist/client/chunks/components-ClQziOcT.js.map +0 -1
@@ -1,32 +1,33 @@
1
- import { D as J, A as H, e as G, P as X } from "./chunks/components-ClQziOcT.js";
2
- import { i as He, a as Ge, C as Xe, h as Ye, g as Ze, b as et, j as tt, f as st, d as rt, M as at, c as ct, n as nt, T as ot, R as dt, Q as it, O as lt, S as ut, V as mt, I as pt, H as ht, K as ft, W as gt, G as bt, J as yt, X as xt, L as vt, N as Ct, U as kt, Y as Nt, Z as wt, z as St, q as At, x as Dt, t as Tt, s as Mt, w as It, p as Et, v as Bt, o as Lt, r as Rt, y as Pt, u as Qt, k as Ft, l as _t, m as Vt, F as jt, E as qt, B as Ut } from "./chunks/components-ClQziOcT.js";
3
- import { jsx as r, jsxs as y, Fragment as Y } from "react/jsx-runtime";
4
- import R, { useRef as N, createContext as Z, useContext as ee, useState as _, useCallback as f, useEffect as P } from "react";
5
- import { c as te, d as se, e as re, s as ae, f as K } from "./chunks/vendor-AVsJ2ni0.js";
6
- import { a as V } from "./chunks/icons-DAeqv1iX.js";
7
- import { D as Ot, h as $t, i as zt, b as Wt, e as Jt, f as Ht, g as Gt, r as Xt, c as Yt, s as Zt } from "./chunks/icons-DAeqv1iX.js";
8
- import { Q as ce } from "./chunks/chart-markdown-Du4Z2iqK.js";
9
- import { f as ne } from "./chunks/providers-CgxXm6Ll.js";
10
- import { h as ts, a as ss, S as rs, e as as, d as cs, i as ns, b as os, g as ds, u as is, j as ls, c as us, w as ms } from "./chunks/providers-CgxXm6Ll.js";
11
- import { L as hs, u as fs } from "./chunks/charts-core-DmGfleFz.js";
12
- import { L as bs, g as ys, c as xs, b as vs, i as Cs, p as ks, a as Ns } from "./chunks/charts-loader-CH0_S06T.js";
13
- import { E as Ss, a as As, p as Ds, q as Ts, m as Ms, l as Is, r as Es, C as Bs, D as Ls, o as Rs, B as Ps, n as Qs, w as Fs, t as _s, d as Vs, f as js, s as qs, e as Us, i as Ks, c as Os, h as $s, g as zs, u as Ws, b as Js, y as Hs, A as Gs, x as Xs, k as Ys, v as Zs, z as er, j as tr } from "./chunks/analysis-builder-shared-D56zYeV0.js";
14
- import { u as rr } from "./chunks/chart-bubble-Bf42A1-B.js";
15
- import { c as cr, f as nr } from "./chunks/index-CApFCBF9.js";
16
- import { e as dr, c as ir, l as lr, h as ur, k as mr, j as pr, i as hr, m as fr, g as gr, f as br, u as yr, u as xr, d as vr, b as Cr, a as kr, v as Nr } from "./chunks/useDirtyStateTracking-Cu1HSjmo.js";
17
- import { c as Sr, b as Ar, f as Dr, g as Tr, a as Mr, i as Ir, t as Er } from "./chunks/funnel-utils-CyonoNeC.js";
18
- import { T as Lr, c as Rr, g as Pr, a as Qr, i as Fr, r as _r, s as Vr, b as jr, w as qr } from "./chunks/theme-Dp3hFed1.js";
19
- import { createExplainQueryKey as Kr, useDryRunQueries as Or, useDryRunQuery as $r, useExplainAI as zr, useExplainQuery as Wr, useMultiDryRunQueries as Jr } from "./hooks.js";
20
- import { i as Gr, a as Xr } from "./chunks/flow-utils-CjQZG5qq.js";
21
- import { h as Zr } from "./chunks/syntaxHighlighting-BQfjio-i.js";
22
- const $ = () => ({
1
+ import { D as re, A as ae, e as ce, P as ne } from "./chunks/components-BkeSy9xv.js";
2
+ import { i as ot, a as dt, C as it, h as lt, g as ut, b as mt, j as pt, f as ht, d as ft, M as gt, c as bt, n as yt, T as xt, R as vt, Q as Ct, O as kt, S as Nt, V as wt, I as St, H as Dt, K as At, W as Tt, G as Mt, J as It, X as Et, L as Rt, N as Bt, U as Lt, Y as Pt, Z as Qt, z as Ft, q as _t, x as Vt, t as jt, s as qt, w as Ut, p as Kt, v as Ot, o as $t, r as zt, y as Wt, u as Jt, k as Gt, l as Ht, m as Xt, F as Yt, E as Zt, B as es } from "./chunks/components-BkeSy9xv.js";
3
+ import { jsx as r, jsxs as x, Fragment as oe } from "react/jsx-runtime";
4
+ import Q, { useRef as C, createContext as de, useContext as ie, useState as j, useCallback as g, useEffect as P } from "react";
5
+ import { c as le, d as ue, e as me, s as pe, f as O } from "./chunks/vendor-AVsJ2ni0.js";
6
+ import { a as q } from "./chunks/icons-DAeqv1iX.js";
7
+ import { D as ss, h as rs, i as as, b as cs, e as ns, f as os, g as ds, r as is, c as ls, s as us } from "./chunks/icons-DAeqv1iX.js";
8
+ import { Q as he } from "./chunks/chart-markdown-Du4Z2iqK.js";
9
+ import { f as fe } from "./chunks/providers-CgxXm6Ll.js";
10
+ import { h as ps, a as hs, S as fs, e as gs, d as bs, i as ys, b as xs, g as vs, u as Cs, j as ks, c as Ns, w as ws } from "./chunks/providers-CgxXm6Ll.js";
11
+ import { L as ge } from "./chunks/charts-core-CU9u_HtL.js";
12
+ import { u as Ds } from "./chunks/charts-core-CU9u_HtL.js";
13
+ import { L as Ts, g as Ms, c as Is, b as Es, i as Rs, p as Bs, a as Ls } from "./chunks/charts-loader-AW3T1nv5.js";
14
+ import { E as Qs, a as Fs, p as _s, q as Vs, m as js, l as qs, r as Us, C as Ks, D as Os, o as $s, B as zs, n as Ws, w as Js, t as Gs, d as Hs, f as Xs, s as Ys, e as Zs, i as er, c as tr, h as sr, g as rr, u as ar, b as cr, y as nr, A as or, x as dr, k as ir, v as lr, z as ur, j as mr } from "./chunks/analysis-builder-shared-EnM-8plh.js";
15
+ import { u as hr } from "./chunks/chart-bubble-CemotLx-.js";
16
+ import { c as gr, f as br } from "./chunks/index-CApFCBF9.js";
17
+ import { e as xr, c as vr, l as Cr, h as kr, k as Nr, j as wr, i as Sr, m as Dr, g as Ar, f as Tr, u as Mr, u as Ir, d as Er, b as Rr, a as Br, v as Lr } from "./chunks/useDirtyStateTracking-Cu1HSjmo.js";
18
+ import { c as Qr, b as Fr, f as _r, g as Vr, a as jr, i as qr, t as Ur } from "./chunks/funnel-utils-CyonoNeC.js";
19
+ import { T as Or, c as $r, g as zr, a as Wr, i as Jr, r as Gr, s as Hr, b as Xr, w as Yr } from "./chunks/theme-Dp3hFed1.js";
20
+ import { createExplainQueryKey as ea, useDryRunQueries as ta, useDryRunQuery as sa, useExplainAI as ra, useExplainQuery as aa, useMultiDryRunQueries as ca } from "./hooks.js";
21
+ import { i as oa, a as da } from "./chunks/flow-utils-CjQZG5qq.js";
22
+ import { h as la } from "./chunks/syntaxHighlighting-BQfjio-i.js";
23
+ const J = () => ({
23
24
  blocks: [],
24
25
  messages: [],
25
26
  isStreaming: !1,
26
27
  sessionId: null,
27
28
  inputValue: ""
28
29
  });
29
- function oe(e, t) {
30
+ function be(e, t) {
30
31
  return {
31
32
  // Block actions
32
33
  addBlock: (s) => e((c) => ({
@@ -36,7 +37,7 @@ function oe(e, t) {
36
37
  blocks: c.blocks.filter((a) => a.id !== s)
37
38
  })),
38
39
  moveBlock: (s, c) => e((a) => {
39
- const n = a.blocks.findIndex((i) => i.id === s);
40
+ const n = a.blocks.findIndex((d) => d.id === s);
40
41
  if (n === -1) return {};
41
42
  if (c === "up" && n === 0) return {};
42
43
  if (c === "down" && n === a.blocks.length - 1) return {};
@@ -73,7 +74,7 @@ function oe(e, t) {
73
74
  updateLastToolCall: (s) => e((c) => {
74
75
  const a = [...c.messages], n = a[a.length - 1];
75
76
  if (n?.role === "assistant" && n.toolCalls?.length) {
76
- const o = [...n.toolCalls], l = s.id ? o.findIndex((i) => i.id === s.id) : o.length - 1;
77
+ const o = [...n.toolCalls], l = s.id ? o.findIndex((d) => d.id === s.id) : o.length - 1;
77
78
  l !== -1 && (o[l] = { ...o[l], ...s }, a[a.length - 1] = { ...n, toolCalls: o });
78
79
  }
79
80
  return { messages: a };
@@ -95,44 +96,44 @@ function oe(e, t) {
95
96
  messages: s.messages || []
96
97
  }),
97
98
  // Reset
98
- reset: () => e($())
99
+ reset: () => e(J())
99
100
  };
100
101
  }
101
- function de() {
102
- const e = $();
103
- return se()(
104
- re(
105
- ae((t, s) => ({
102
+ function ye() {
103
+ const e = J();
104
+ return ue()(
105
+ me(
106
+ pe((t, s) => ({
106
107
  ...e,
107
- ...oe(t, s)
108
+ ...be(t, s)
108
109
  })),
109
110
  { name: "NotebookStore" }
110
111
  )
111
112
  );
112
113
  }
113
- const z = Z(null);
114
- function ie({
114
+ const G = de(null);
115
+ function xe({
115
116
  children: e,
116
117
  initialConfig: t
117
118
  }) {
118
- const s = N(null);
119
+ const s = C(null);
119
120
  if (!s.current) {
120
- const c = de();
121
+ const c = ye();
121
122
  t && c.getState().load(t), s.current = c;
122
123
  }
123
- return /* @__PURE__ */ r(z.Provider, { value: s.current, children: e });
124
+ return /* @__PURE__ */ r(G.Provider, { value: s.current, children: e });
124
125
  }
125
- function S(e) {
126
- const t = ee(z);
126
+ function A(e) {
127
+ const t = ie(G);
127
128
  if (!t)
128
129
  throw new Error("useNotebookStore must be used within NotebookStoreProvider");
129
- return te(t, e);
130
+ return le(t, e);
130
131
  }
131
- const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, Ue = (e) => e.sessionId, Ke = (e) => e.inputValue, ue = (e) => ({
132
+ const ve = (e) => e.blocks, Ye = (e) => e.messages, Ze = (e) => e.isStreaming, et = (e) => e.sessionId, tt = (e) => e.inputValue, Ce = (e) => ({
132
133
  messages: e.messages,
133
134
  isStreaming: e.isStreaming,
134
135
  inputValue: e.inputValue
135
- }), me = (e) => ({
136
+ }), ke = (e) => ({
136
137
  addMessage: e.addMessage,
137
138
  appendToLastAssistantMessage: e.appendToLastAssistantMessage,
138
139
  setLastAssistantError: e.setLastAssistantError,
@@ -141,12 +142,12 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
141
142
  setIsStreaming: e.setIsStreaming,
142
143
  setInputValue: e.setInputValue,
143
144
  setSessionId: e.setSessionId
144
- }), pe = (e) => ({
145
+ }), Ne = (e) => ({
145
146
  addBlock: e.addBlock,
146
147
  removeBlock: e.removeBlock,
147
148
  moveBlock: e.moveBlock,
148
149
  updateBlock: e.updateBlock
149
- }), j = { width: "16px", height: "16px", color: "currentColor" }, he = V("chevronUp"), fe = V("chevronDown"), ge = V("edit"), be = V("delete"), ye = R.memo(function({
150
+ }), K = { width: "16px", height: "16px", color: "currentColor" }, we = q("chevronUp"), Se = q("chevronDown"), De = q("edit"), Ae = q("delete"), Te = Q.memo(function({
150
151
  block: t,
151
152
  onRemove: s,
152
153
  onMoveUp: c,
@@ -155,33 +156,33 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
155
156
  isFirst: o,
156
157
  isLast: l
157
158
  }) {
158
- const [i, g] = _(null), b = f((v) => {
159
- g(v);
159
+ const [d, w] = j(null), m = g((k) => {
160
+ w(k);
160
161
  }, []);
161
- return /* @__PURE__ */ y("div", { className: "dc:relative dc:mb-4 bg-dc-surface dc:border border-dc-border dc:rounded-lg dc:flex dc:flex-col", children: [
162
- /* @__PURE__ */ y("div", { className: "dc:flex dc:items-center dc:justify-between dc:px-3 dc:py-1.5 dc:border-b border-dc-border dc:shrink-0 bg-dc-surface-secondary dc:rounded-t-lg", children: [
163
- /* @__PURE__ */ y("div", { className: "dc:flex dc:items-center dc:gap-2 dc:flex-1 dc:min-w-0", children: [
162
+ return /* @__PURE__ */ x("div", { className: "dc:relative dc:mb-4 bg-dc-surface dc:border border-dc-border dc:rounded-lg dc:flex dc:flex-col", children: [
163
+ /* @__PURE__ */ x("div", { className: "dc:flex dc:items-center dc:justify-between dc:px-3 dc:py-1.5 dc:border-b border-dc-border dc:shrink-0 bg-dc-surface-secondary dc:rounded-t-lg", children: [
164
+ /* @__PURE__ */ x("div", { className: "dc:flex dc:items-center dc:gap-2 dc:flex-1 dc:min-w-0", children: [
164
165
  /* @__PURE__ */ r("h3", { className: "dc:font-semibold dc:text-sm text-dc-text dc:truncate", children: t.title || "Untitled" }),
165
- i && /* @__PURE__ */ r(
166
- J,
166
+ d && /* @__PURE__ */ r(
167
+ re,
167
168
  {
168
- chartConfig: i.chartConfig,
169
- displayConfig: i.displayConfig,
170
- queryObject: i.queryObject,
171
- data: i.data,
172
- chartType: i.chartType,
173
- cacheInfo: i.cacheInfo ?? void 0
169
+ chartConfig: d.chartConfig,
170
+ displayConfig: d.displayConfig,
171
+ queryObject: d.queryObject,
172
+ data: d.data,
173
+ chartType: d.chartType,
174
+ cacheInfo: d.cacheInfo ?? void 0
174
175
  }
175
176
  )
176
177
  ] }),
177
- /* @__PURE__ */ y("div", { className: "dc:flex dc:items-center dc:gap-1 dc:shrink-0 dc:ml-4 dc:-mr-2", children: [
178
+ /* @__PURE__ */ x("div", { className: "dc:flex dc:items-center dc:gap-1 dc:shrink-0 dc:ml-4 dc:-mr-2", children: [
178
179
  !o && /* @__PURE__ */ r(
179
180
  "button",
180
181
  {
181
182
  onClick: () => c(t.id),
182
183
  className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
183
184
  title: "Move up",
184
- children: /* @__PURE__ */ r(he, { style: j })
185
+ children: /* @__PURE__ */ r(we, { style: K })
185
186
  }
186
187
  ),
187
188
  !l && /* @__PURE__ */ r(
@@ -190,7 +191,7 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
190
191
  onClick: () => a(t.id),
191
192
  className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
192
193
  title: "Move down",
193
- children: /* @__PURE__ */ r(fe, { style: j })
194
+ children: /* @__PURE__ */ r(Se, { style: K })
194
195
  }
195
196
  ),
196
197
  /* @__PURE__ */ r(
@@ -199,7 +200,7 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
199
200
  onClick: () => n(t),
200
201
  className: "dc:p-1 dc:bg-transparent dc:border-none dc:rounded-sm text-dc-text-secondary dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
201
202
  title: "Edit visualization",
202
- children: /* @__PURE__ */ r(ge, { style: j })
203
+ children: /* @__PURE__ */ r(De, { style: K })
203
204
  }
204
205
  ),
205
206
  /* @__PURE__ */ r(
@@ -208,13 +209,13 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
208
209
  onClick: () => s(t.id),
209
210
  className: "dc:p-1 dc:mr-0.5 dc:bg-transparent dc:border-none dc:rounded-sm dc:cursor-pointer dc:hover:bg-dc-danger-bg text-dc-danger dc:transition-colors",
210
211
  title: "Remove",
211
- children: /* @__PURE__ */ r(be, { style: j })
212
+ children: /* @__PURE__ */ r(Ae, { style: K })
212
213
  }
213
214
  )
214
215
  ] })
215
216
  ] }),
216
217
  /* @__PURE__ */ r("div", { className: "dc:flex-1 dc:min-h-0", children: /* @__PURE__ */ r(
217
- H,
218
+ ae,
218
219
  {
219
220
  query: t.query,
220
221
  chartType: t.chartType,
@@ -222,11 +223,11 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
222
223
  displayConfig: t.displayConfig,
223
224
  height: 400,
224
225
  eagerLoad: !0,
225
- onDebugDataReady: b
226
+ onDebugDataReady: m
226
227
  }
227
228
  ) })
228
229
  ] });
229
- }), xe = {
230
+ }), Me = {
230
231
  overrides: {
231
232
  h1: { props: { className: "dc:text-lg dc:font-bold text-dc-text dc:mb-2 dc:mt-3" } },
232
233
  h2: { props: { className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2 dc:mt-3" } },
@@ -247,7 +248,7 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
247
248
  td: { props: { className: "dc:px-3 dc:py-2 dc:text-sm text-dc-text border-dc-border dc:border-b" } },
248
249
  tr: { props: { className: "dc:hover:opacity-80" } }
249
250
  }
250
- }, ve = R.memo(function({
251
+ }, Ie = Q.memo(function({
251
252
  block: t,
252
253
  onRemove: s,
253
254
  onMoveUp: c,
@@ -255,8 +256,8 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
255
256
  isFirst: n,
256
257
  isLast: o
257
258
  }) {
258
- return /* @__PURE__ */ y("div", { className: "dc:group dc:relative dc:mb-4", children: [
259
- /* @__PURE__ */ y("div", { className: "dc:absolute dc:right-2 dc:top-2 dc:z-10 dc:flex dc:gap-1 dc:opacity-0 dc:group-hover:opacity-100 dc:transition-opacity", children: [
259
+ return /* @__PURE__ */ x("div", { className: "dc:group dc:relative dc:mb-4", children: [
260
+ /* @__PURE__ */ x("div", { className: "dc:absolute dc:right-2 dc:top-2 dc:z-10 dc:flex dc:gap-1 dc:opacity-0 dc:group-hover:opacity-100 dc:transition-opacity", children: [
260
261
  !n && /* @__PURE__ */ r(
261
262
  "button",
262
263
  {
@@ -286,66 +287,66 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
286
287
  )
287
288
  ] }),
288
289
  t.title && /* @__PURE__ */ r("h4", { className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2 dc:px-1", children: t.title }),
289
- /* @__PURE__ */ r("div", { className: "dc:rounded-lg dc:p-4 bg-dc-surface border-dc-border dc:border", children: /* @__PURE__ */ r(ce, { options: xe, children: t.content }) })
290
+ /* @__PURE__ */ r("div", { className: "dc:rounded-lg dc:p-4 bg-dc-surface border-dc-border dc:border", children: /* @__PURE__ */ r(he, { options: Me, children: t.content }) })
290
291
  ] });
291
- }), Ce = R.memo(function() {
292
- const t = S(le), { removeBlock: s, moveBlock: c, updateBlock: a } = S(K(pe)), n = N(null), [o, l] = _(null), i = N(t.length);
292
+ }), Ee = Q.memo(function() {
293
+ const t = A(ve), { removeBlock: s, moveBlock: c, updateBlock: a } = A(O(Ne)), n = C(null), [o, l] = j(null), d = C(t.length);
293
294
  P(() => {
294
- t.length > i.current && n.current?.scrollIntoView({ behavior: "smooth" }), i.current = t.length;
295
+ t.length > d.current && n.current?.scrollIntoView({ behavior: "smooth" }), d.current = t.length;
295
296
  }, [t.length]);
296
- const g = f((d) => s(d), [s]), b = f((d) => c(d, "up"), [c]), v = f((d) => c(d, "down"), [c]), m = f((d) => l(d), []), A = f((d) => {
297
+ const w = g((p) => s(p), [s]), m = g((p) => c(p, "up"), [c]), k = g((p) => c(p, "down"), [c]), h = g((p) => l(p), []), N = g((p) => {
297
298
  if (!o) return;
298
- const C = G(d), { analysisConfig: x } = C;
299
- if (x) {
300
- const k = x.charts[x.analysisType];
299
+ const i = ce(p), { analysisConfig: f } = i;
300
+ if (f) {
301
+ const b = f.charts[f.analysisType];
301
302
  a(o.id, {
302
- title: d.title,
303
- query: JSON.stringify(x.query),
304
- chartType: k?.chartType || "bar",
305
- chartConfig: k?.chartConfig,
306
- displayConfig: k?.displayConfig
303
+ title: p.title,
304
+ query: JSON.stringify(f.query),
305
+ chartType: b?.chartType || "bar",
306
+ chartConfig: b?.chartConfig,
307
+ displayConfig: b?.displayConfig
307
308
  });
308
309
  }
309
310
  l(null);
310
311
  }, [o, a]);
311
- return t.length === 0 ? /* @__PURE__ */ r("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */ y("div", { className: "dc:text-center dc:max-w-sm dc:px-6", children: [
312
+ return t.length === 0 ? /* @__PURE__ */ r("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */ x("div", { className: "dc:text-center dc:max-w-sm dc:px-6", children: [
312
313
  /* @__PURE__ */ r("h3", { className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2", children: "Your notebook is empty" }),
313
314
  /* @__PURE__ */ r("p", { className: "dc:text-sm text-dc-text-secondary", children: "Ask the AI assistant a question about your data. Charts and insights will appear here as the assistant analyzes your data." })
314
- ] }) }) : /* @__PURE__ */ y("div", { className: "dc:h-full dc:overflow-y-auto dc:p-4", children: [
315
- t.map((d, C) => {
316
- const x = C === 0, k = C === t.length - 1;
317
- return d.type === "portlet" ? /* @__PURE__ */ r(
318
- ye,
315
+ ] }) }) : /* @__PURE__ */ x("div", { className: "dc:h-full dc:overflow-y-auto dc:p-4", children: [
316
+ t.map((p, i) => {
317
+ const f = i === 0, b = i === t.length - 1;
318
+ return p.type === "portlet" ? /* @__PURE__ */ r(
319
+ Te,
319
320
  {
320
- block: d,
321
- onRemove: g,
322
- onMoveUp: b,
323
- onMoveDown: v,
324
- onEdit: m,
325
- isFirst: x,
326
- isLast: k
321
+ block: p,
322
+ onRemove: w,
323
+ onMoveUp: m,
324
+ onMoveDown: k,
325
+ onEdit: h,
326
+ isFirst: f,
327
+ isLast: b
327
328
  },
328
- d.id
329
- ) : d.type === "markdown" ? /* @__PURE__ */ r(
330
- ve,
329
+ p.id
330
+ ) : p.type === "markdown" ? /* @__PURE__ */ r(
331
+ Ie,
331
332
  {
332
- block: d,
333
- onRemove: g,
334
- onMoveUp: b,
335
- onMoveDown: v,
336
- isFirst: x,
337
- isLast: k
333
+ block: p,
334
+ onRemove: w,
335
+ onMoveUp: m,
336
+ onMoveDown: k,
337
+ isFirst: f,
338
+ isLast: b
338
339
  },
339
- d.id
340
+ p.id
340
341
  ) : null;
341
342
  }),
342
343
  /* @__PURE__ */ r("div", { ref: n }),
343
344
  /* @__PURE__ */ r(
344
- X,
345
+ ne,
345
346
  {
346
347
  isOpen: !!o,
347
348
  onClose: () => l(null),
348
- onSave: A,
349
+ onSave: N,
349
350
  portlet: o ? {
350
351
  id: o.id,
351
352
  title: o.title,
@@ -364,7 +365,7 @@ const le = (e) => e.blocks, je = (e) => e.messages, qe = (e) => e.isStreaming, U
364
365
  )
365
366
  ] });
366
367
  });
367
- function ke(e) {
368
+ function Re(e) {
368
369
  if (e.startsWith("{") || e.includes('"type":"error"'))
369
370
  try {
370
371
  const t = JSON.parse(e.replace(/^Error:\s*/, "")), s = t.error?.type || t.type || "";
@@ -383,144 +384,140 @@ function ke(e) {
383
384
  }
384
385
  return e;
385
386
  }
386
- function Ne(e) {
387
- const {
388
- agentEndpoint: t,
389
- agentApiKey: s,
390
- onAddPortlet: c,
391
- onAddMarkdown: a,
392
- onTextDelta: n,
393
- onToolStart: o,
394
- onToolResult: l,
395
- onTurnComplete: i,
396
- onDone: g,
397
- onError: b
398
- } = e, { cubeApi: v } = ne(), m = N(null), [A, d] = _(!1), C = f(async (k, D) => {
399
- function I(h) {
400
- switch (h.type) {
387
+ function Be(e) {
388
+ const { agentEndpoint: t, agentApiKey: s } = e, { cubeApi: c } = fe(), a = C(null), [n, o] = j(!1), l = C(e);
389
+ l.current = e;
390
+ const d = g(async (m, k, h) => {
391
+ function N(i) {
392
+ const f = l.current;
393
+ switch (i.type) {
401
394
  case "text_delta":
402
- n(h.data);
395
+ f.onTextDelta(i.data);
403
396
  break;
404
397
  case "tool_use_start":
405
- o(h.data.id, h.data.name, h.data.input);
398
+ f.onToolStart(i.data.id, i.data.name, i.data.input);
406
399
  break;
407
400
  case "tool_use_result":
408
- l(h.data.id, h.data.name, h.data.result, h.data.isError);
401
+ f.onToolResult(i.data.id, i.data.name, i.data.result, i.data.isError);
409
402
  break;
410
403
  case "add_portlet":
411
- c({
412
- ...h.data,
404
+ f.onAddPortlet({
405
+ ...i.data,
413
406
  type: "portlet"
414
407
  });
415
408
  break;
416
409
  case "add_markdown":
417
- a({
418
- ...h.data,
410
+ f.onAddMarkdown({
411
+ ...i.data,
419
412
  type: "markdown"
420
413
  });
421
414
  break;
415
+ case "dashboard_saved":
416
+ f.onDashboardSaved?.(i.data);
417
+ break;
422
418
  case "turn_complete":
423
- i?.();
419
+ f.onTurnComplete?.();
424
420
  break;
425
421
  case "done":
426
- g(h.data.sessionId);
422
+ f.onDone(i.data.sessionId);
427
423
  break;
428
424
  case "error":
429
- b(h.data.message);
425
+ f.onError(i.data.message);
430
426
  break;
431
427
  }
432
428
  }
433
- m.current && m.current.abort();
429
+ a.current && a.current.abort();
434
430
  const p = new AbortController();
435
- m.current = p, d(!0);
431
+ a.current = p, o(!0);
436
432
  try {
437
- const h = v.apiUrl || "/cubejs-api/v1", T = t || `${h}/agent/chat`, M = {
433
+ const i = c.apiUrl || "/cubejs-api/v1", f = t || `${i}/agent/chat`, b = {
438
434
  "Content-Type": "application/json",
439
- ...v.headers
435
+ ...c.headers
440
436
  };
441
- s && (M["X-Agent-Api-Key"] = s);
442
- const w = await fetch(T, {
437
+ s && (b["X-Agent-Api-Key"] = s);
438
+ const v = await fetch(f, {
443
439
  method: "POST",
444
- headers: M,
445
- credentials: v.credentials ?? "include",
440
+ headers: b,
441
+ credentials: c.credentials ?? "include",
446
442
  body: JSON.stringify({
447
- message: k,
448
- ...D ? { sessionId: D } : {}
443
+ message: m,
444
+ ...k ? { sessionId: k } : {},
445
+ ...h && h.length > 0 ? { history: h } : {}
449
446
  }),
450
447
  signal: p.signal
451
448
  });
452
- if (!w.ok) {
453
- const B = await w.json().catch(() => ({}));
454
- throw new Error(B.error || `Agent request failed: ${w.status}`);
449
+ if (!v.ok) {
450
+ const D = await v.json().catch(() => ({}));
451
+ throw new Error(D.error || `Agent request failed: ${v.status}`);
455
452
  }
456
- if (!w.body)
453
+ if (!v.body)
457
454
  throw new Error("No response body received");
458
- const Q = w.body.getReader(), q = new TextDecoder();
459
- let E = "";
455
+ const S = v.body.getReader(), R = new TextDecoder();
456
+ let T = "";
460
457
  for (; ; ) {
461
- const { done: B, value: u } = await Q.read();
462
- if (B) break;
463
- E += q.decode(u, { stream: !0 });
464
- const L = E.split(`
458
+ const { done: D, value: y } = await S.read();
459
+ if (D) break;
460
+ T += R.decode(y, { stream: !0 });
461
+ const I = T.split(`
465
462
 
466
463
  `);
467
- E = L.pop() || "";
468
- for (const F of L) {
469
- const U = F.trim().split(`
464
+ T = I.pop() || "";
465
+ for (const L of I) {
466
+ const F = L.trim().split(`
470
467
  `);
471
- for (const O of U)
472
- if (O.startsWith("data: "))
468
+ for (const B of F)
469
+ if (B.startsWith("data: "))
473
470
  try {
474
- const W = JSON.parse(O.slice(6));
475
- I(W);
471
+ const M = JSON.parse(B.slice(6));
472
+ N(M);
476
473
  } catch {
477
474
  }
478
475
  }
479
476
  }
480
- if (E.trim()) {
481
- const B = E.trim().split(`
477
+ if (T.trim()) {
478
+ const D = T.trim().split(`
482
479
  `);
483
- for (const u of B)
484
- if (u.startsWith("data: "))
480
+ for (const y of D)
481
+ if (y.startsWith("data: "))
485
482
  try {
486
- const L = JSON.parse(u.slice(6));
487
- I(L);
483
+ const I = JSON.parse(y.slice(6));
484
+ N(I);
488
485
  } catch {
489
486
  }
490
487
  }
491
- } catch (h) {
492
- if (h.name !== "AbortError") {
493
- const T = h instanceof Error ? h.message : "Stream failed";
494
- b(ke(T));
488
+ } catch (i) {
489
+ if (i.name !== "AbortError") {
490
+ const f = i instanceof Error ? i.message : "Stream failed";
491
+ l.current.onError(Re(f));
495
492
  }
496
493
  } finally {
497
- d(!1), m.current = null;
494
+ o(!1), a.current = null;
498
495
  }
499
- }, [v, t, s, c, a, n, o, l, i, g, b]), x = f(() => {
500
- m.current && (m.current.abort(), m.current = null, d(!1));
496
+ }, [c, t, s]), w = g(() => {
497
+ a.current && (a.current.abort(), a.current = null, o(!1));
501
498
  }, []);
502
499
  return {
503
- sendMessage: C,
504
- isStreaming: A,
505
- abort: x
500
+ sendMessage: d,
501
+ isStreaming: n,
502
+ abort: w
506
503
  };
507
504
  }
508
- function we(e) {
505
+ function Le(e) {
509
506
  const t = [];
510
507
  let s = e, c = 0;
511
508
  for (; s; ) {
512
509
  const a = s.match(/^(.*?)`([^`]+)`(.*)$/);
513
510
  if (a) {
514
- const [, o, l, i] = a;
511
+ const [, o, l, d] = a;
515
512
  o && t.push(/* @__PURE__ */ r("span", { children: o }, c++)), t.push(
516
513
  /* @__PURE__ */ r("code", { className: "dc:px-1 dc:py-0.5 dc:rounded dc:text-xs bg-dc-surface dc:font-mono", children: l }, c++)
517
- ), s = i;
514
+ ), s = d;
518
515
  continue;
519
516
  }
520
517
  const n = s.match(/^(.*?)\*\*([^*]+)\*\*(.*)$/);
521
518
  if (n) {
522
- const [, o, l, i] = n;
523
- o && t.push(/* @__PURE__ */ r("span", { children: o }, c++)), t.push(/* @__PURE__ */ r("strong", { className: "dc:font-semibold", children: l }, c++)), s = i;
519
+ const [, o, l, d] = n;
520
+ o && t.push(/* @__PURE__ */ r("span", { children: o }, c++)), t.push(/* @__PURE__ */ r("strong", { className: "dc:font-semibold", children: l }, c++)), s = d;
524
521
  continue;
525
522
  }
526
523
  t.push(/* @__PURE__ */ r("span", { children: s }, c));
@@ -528,51 +525,60 @@ function we(e) {
528
525
  }
529
526
  return t;
530
527
  }
531
- const Se = {
528
+ const Pe = {
532
529
  discover_cubes: "Discovering cubes",
533
530
  get_cube_metadata: "Reading metadata",
534
531
  execute_query: "Executing query",
535
532
  add_portlet: "Adding visualization",
536
533
  add_markdown: "Adding explanation"
537
534
  };
538
- function Ae({ toolCall: e }) {
539
- const [t, s] = _(!1), c = Se[e.name] || e.name, a = e.status === "running";
540
- return /* @__PURE__ */ y("div", { className: "dc:my-1 dc:text-xs", children: [
541
- /* @__PURE__ */ y(
535
+ function Qe({ toolCall: e, loadingComponent: t }) {
536
+ const [s, c] = j(!1), a = Pe[e.name] || e.name, n = e.status === "running";
537
+ return /* @__PURE__ */ x("div", { className: "dc:my-1 dc:text-xs", children: [
538
+ /* @__PURE__ */ x(
542
539
  "button",
543
540
  {
544
- onClick: () => s(!t),
541
+ onClick: () => c(!s),
545
542
  className: "dc:flex dc:items-center dc:gap-1.5 text-dc-text-secondary dc:hover:opacity-80 dc:transition-opacity",
546
543
  children: [
547
- a ? /* @__PURE__ */ r("span", { className: "dc:inline-block dc:w-3 dc:h-3 dc:border-2 border-dc-accent dc:border-t-transparent dc:rounded-full dc:animate-spin" }) : /* @__PURE__ */ r("span", { className: "dc:text-xs", children: e.status === "error" ? "✗" : "✓" }),
548
- /* @__PURE__ */ y("span", { children: [
549
- c,
550
- a ? "..." : ""
544
+ n ? t ? /* @__PURE__ */ r("span", { className: "dc:inline-flex dc:items-center dc:justify-center dc:h-3 dc:w-3", children: t }) : /* @__PURE__ */ r(ge, { size: "xs" }) : /* @__PURE__ */ r("span", { className: "dc:text-xs", children: e.status === "error" ? "✗" : "✓" }),
545
+ /* @__PURE__ */ x("span", { children: [
546
+ a,
547
+ n ? "..." : ""
551
548
  ] }),
552
- !a && /* @__PURE__ */ r("span", { className: "dc:text-[10px] dc:opacity-60", children: t ? "▲" : "▼" })
549
+ !n && /* @__PURE__ */ r("span", { className: "dc:text-[10px] dc:opacity-60", children: s ? "▲" : "▼" })
553
550
  ]
554
551
  }
555
552
  ),
556
- t && e.result != null && /* @__PURE__ */ r("pre", { className: "dc:mt-1 dc:p-2 dc:rounded dc:text-[11px] dc:overflow-x-auto dc:max-h-32 dc:overflow-y-auto bg-dc-surface-secondary text-dc-text-secondary", children: typeof e.result == "string" ? e.result : JSON.stringify(e.result, null, 2) })
553
+ s && e.result != null && /* @__PURE__ */ r("pre", { className: "dc:mt-1 dc:p-2 dc:rounded dc:text-[11px] dc:overflow-x-auto dc:max-h-32 dc:overflow-y-auto bg-dc-surface-secondary text-dc-text-secondary", children: typeof e.result == "string" ? e.result : JSON.stringify(e.result, null, 2) })
557
554
  ] });
558
555
  }
559
- const De = R.memo(function({ message: t }) {
560
- const s = t.role === "user", c = !!t.content?.trim(), a = !!t.error, n = t.toolCalls && t.toolCalls.length > 0;
561
- return !s && !c && !a && !n ? null : /* @__PURE__ */ r("div", { className: `dc:flex dc:mb-3 ${s ? "dc:justify-end" : "dc:justify-start"}`, children: /* @__PURE__ */ y(
556
+ const Fe = {
557
+ animation: "dc-msg-in 100ms ease-out"
558
+ }, _e = Q.memo(function({ message: t, loadingComponent: s }) {
559
+ const c = t.role === "user", a = !!t.content?.trim(), n = !!t.error, o = t.toolCalls && t.toolCalls.length > 0;
560
+ return !c && !a && !n && !o ? null : /* @__PURE__ */ r(
562
561
  "div",
563
562
  {
564
- className: `dc:max-w-[85%] dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm ${s ? "bg-dc-accent text-dc-accent-text dc:rounded-br-sm" : a && !c ? "bg-dc-warning-bg text-dc-text dc:rounded-bl-sm" : "bg-dc-surface-secondary text-dc-text dc:rounded-bl-sm"}`,
565
- children: [
566
- c && /* @__PURE__ */ r("div", { className: "dc:whitespace-pre-wrap dc:break-words", children: s ? t.content : we(t.content) }),
567
- a && /* @__PURE__ */ y("div", { className: `dc:flex dc:items-start dc:gap-2 ${c ? "dc:mt-2 dc:pt-2 dc:border-t dc:border-current dc:border-opacity-10" : ""}`, children: [
568
- /* @__PURE__ */ r("span", { className: "dc:text-base dc:leading-none dc:mt-0.5 text-dc-warning dc:flex-shrink-0", children: "⚠" }),
569
- /* @__PURE__ */ r("span", { className: "text-dc-text-secondary", children: t.error })
570
- ] }),
571
- n && /* @__PURE__ */ r("div", { className: c || a ? "dc:mt-1 dc:border-t dc:border-current dc:border-opacity-10 dc:pt-1" : "", children: t.toolCalls.map((o, l) => /* @__PURE__ */ r(Ae, { toolCall: o }, o.id || l)) })
572
- ]
563
+ className: `dc:flex dc:mb-3 ${c ? "dc:justify-end" : "dc:justify-start"}`,
564
+ style: Fe,
565
+ children: /* @__PURE__ */ x(
566
+ "div",
567
+ {
568
+ className: `dc:max-w-[85%] dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm ${c ? "bg-dc-accent text-dc-accent-text dc:rounded-br-sm" : n && !a ? "bg-dc-warning-bg text-dc-text dc:rounded-bl-sm" : "bg-dc-surface-secondary text-dc-text dc:rounded-bl-sm"}`,
569
+ children: [
570
+ a && /* @__PURE__ */ r("div", { className: "dc:whitespace-pre-wrap dc:break-words", children: c ? t.content : Le(t.content) }),
571
+ n && /* @__PURE__ */ x("div", { className: `dc:flex dc:items-start dc:gap-2 ${a ? "dc:mt-2 dc:pt-2 dc:border-t dc:border-current dc:border-opacity-10" : ""}`, children: [
572
+ /* @__PURE__ */ r("span", { className: "dc:text-base dc:leading-none dc:mt-0.5 text-dc-warning dc:flex-shrink-0", children: "⚠" }),
573
+ /* @__PURE__ */ r("span", { className: "text-dc-text-secondary", children: t.error })
574
+ ] }),
575
+ o && /* @__PURE__ */ r("div", { className: a || n ? "dc:mt-1 dc:border-t dc:border-current dc:border-opacity-10 dc:pt-1" : "", children: t.toolCalls.map((l, d) => /* @__PURE__ */ r(Qe, { toolCall: l, loadingComponent: s }, l.id || d)) })
576
+ ]
577
+ }
578
+ )
573
579
  }
574
- ) });
575
- }), Te = R.memo(function({
580
+ );
581
+ }), Ve = Q.memo(function({
576
582
  value: t,
577
583
  onChange: s,
578
584
  onSend: c,
@@ -580,30 +586,30 @@ const De = R.memo(function({ message: t }) {
580
586
  onContinue: n,
581
587
  isStreaming: o = !1,
582
588
  showContinue: l = !1,
583
- disabled: i = !1,
584
- placeholder: g = "Ask about your data..."
589
+ disabled: d = !1,
590
+ placeholder: w = "Ask about your data..."
585
591
  }) {
586
- const b = N(null);
592
+ const m = C(null);
587
593
  P(() => {
588
- const m = b.current;
589
- m && (m.style.height = "auto", m.style.height = `${Math.min(m.scrollHeight, 150)}px`);
594
+ const h = m.current;
595
+ h && (h.style.height = "auto", h.style.height = `${Math.min(h.scrollHeight, 150)}px`);
590
596
  }, [t]);
591
- const v = f(
592
- (m) => {
593
- m.key === "Enter" && !m.shiftKey && (m.preventDefault(), !i && t.trim() && c());
597
+ const k = g(
598
+ (h) => {
599
+ h.key === "Enter" && !h.shiftKey && (h.preventDefault(), !d && t.trim() && c());
594
600
  },
595
- [i, t, c]
601
+ [d, t, c]
596
602
  );
597
- return /* @__PURE__ */ y("div", { className: "dc:flex dc:gap-2 dc:items-end dc:p-3 border-dc-border dc:border-t", children: [
603
+ return /* @__PURE__ */ x("div", { className: "dc:flex dc:gap-2 dc:items-end dc:p-3 border-dc-border dc:border-t", children: [
598
604
  /* @__PURE__ */ r(
599
605
  "textarea",
600
606
  {
601
- ref: b,
607
+ ref: m,
602
608
  value: t,
603
- onChange: (m) => s(m.target.value),
604
- onKeyDown: v,
605
- placeholder: g,
606
- disabled: i,
609
+ onChange: (h) => s(h.target.value),
610
+ onKeyDown: k,
611
+ placeholder: w,
612
+ disabled: d,
607
613
  rows: 1,
608
614
  className: "dc:flex-1 dc:resize-none dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm bg-dc-surface-secondary text-dc-text border-dc-border dc:border dc:outline-none dc:focus:ring-1 focus:ring-dc-accent dc:disabled:opacity-50"
609
615
  }
@@ -615,12 +621,12 @@ const De = R.memo(function({ message: t }) {
615
621
  className: "dc:px-4 dc:py-2 dc:rounded-lg dc:text-sm dc:font-medium dc:transition-colors text-dc-error border-dc-border dc:border dc:hover:opacity-80 dc:shrink-0",
616
622
  children: "Stop"
617
623
  }
618
- ) : /* @__PURE__ */ y(Y, { children: [
624
+ ) : /* @__PURE__ */ x(oe, { children: [
619
625
  l && !t.trim() && /* @__PURE__ */ r(
620
626
  "button",
621
627
  {
622
628
  onClick: () => {
623
- n?.(), b.current?.focus();
629
+ n?.(), m.current?.focus();
624
630
  },
625
631
  className: "dc:px-4 dc:py-2 dc:rounded-lg dc:text-sm dc:font-medium dc:transition-colors border-dc-border dc:border text-dc-text-secondary dc:hover:opacity-80 dc:shrink-0",
626
632
  children: "Continue"
@@ -630,212 +636,267 @@ const De = R.memo(function({ message: t }) {
630
636
  "button",
631
637
  {
632
638
  onClick: c,
633
- disabled: i || !t.trim(),
639
+ disabled: d || !t.trim(),
634
640
  className: "dc:px-4 dc:py-2 dc:rounded-lg dc:text-sm dc:font-medium dc:transition-colors bg-dc-accent text-dc-accent-text dc:hover:opacity-90 dc:disabled:opacity-40 dc:disabled:cursor-not-allowed dc:shrink-0",
635
641
  children: "Send"
636
642
  }
637
643
  )
638
644
  ] })
639
645
  ] });
640
- }), Me = R.memo(function({
646
+ }), je = Q.memo(function({
641
647
  agentEndpoint: t,
642
648
  agentApiKey: s,
643
- onClear: c
649
+ onClear: c,
650
+ onDashboardSaved: a,
651
+ loadingComponent: n,
652
+ initialPrompt: o
644
653
  }) {
645
- const a = N(null), n = N(!1), { messages: o, isStreaming: l, inputValue: i } = S(K(ue)), {
646
- addMessage: g,
647
- appendToLastAssistantMessage: b,
648
- setLastAssistantError: v,
649
- addToolCallToLastAssistant: m,
650
- updateLastToolCall: A,
651
- setIsStreaming: d,
652
- setInputValue: C,
653
- setSessionId: x
654
- } = S(K(me)), k = S((u) => u.sessionId), D = S((u) => u.addBlock), I = S((u) => u.reset), p = f(() => {
655
- n.current && (n.current = !1, g({
654
+ const l = C(null), d = C(!1), w = C(!1), { messages: m, isStreaming: k, inputValue: h } = A(O(Ce)), {
655
+ addMessage: N,
656
+ appendToLastAssistantMessage: p,
657
+ setLastAssistantError: i,
658
+ addToolCallToLastAssistant: f,
659
+ updateLastToolCall: b,
660
+ setIsStreaming: v,
661
+ setInputValue: S,
662
+ setSessionId: R
663
+ } = A(O(ke)), T = A((u) => u.sessionId), D = A((u) => u.addBlock), y = A((u) => u.reset), I = A((u) => u.blocks.filter((V) => V.type === "portlet").length), L = C(m);
664
+ L.current = m;
665
+ const F = C(k);
666
+ F.current = k;
667
+ const B = C(T);
668
+ B.current = T;
669
+ const M = g(() => {
670
+ w.current && (w.current = !1, N({
656
671
  id: `msg-${Date.now()}`,
657
672
  role: "assistant",
658
673
  content: "",
659
674
  toolCalls: [],
660
675
  timestamp: Date.now()
661
676
  }));
662
- }, [g]), h = N(o.length);
677
+ }, [N]), $ = C(m.length);
663
678
  P(() => {
664
- o.length > h.current && a.current?.scrollIntoView({ behavior: "smooth" }), h.current = o.length;
665
- }, [o]);
666
- const { sendMessage: T, abort: M } = Ne({
679
+ m.length > $.current && l.current?.scrollIntoView({ behavior: "smooth" }), $.current = m.length;
680
+ }, [m]);
681
+ const { sendMessage: z, abort: U } = Be({
667
682
  agentEndpoint: t,
668
683
  agentApiKey: s,
669
- onTextDelta: f((u) => {
670
- p(), b(u);
671
- }, [p, b]),
672
- onToolStart: f((u, L, F) => {
673
- p(), m({ id: u, name: L, input: F, status: "running" });
674
- }, [p, m]),
675
- onToolResult: f((u, L, F, U) => {
676
- A({ id: u, status: U ? "error" : "complete", result: F });
677
- }, [A]),
678
- onAddPortlet: f((u) => {
684
+ onTextDelta: g((u) => {
685
+ M(), p(u);
686
+ }, [M, p]),
687
+ onToolStart: g((u, V, E) => {
688
+ M(), f({ id: u, name: V, input: E, status: "running" });
689
+ }, [M, f]),
690
+ onToolResult: g((u, V, E, se) => {
691
+ b({ id: u, status: se ? "error" : "complete", result: E });
692
+ }, [b]),
693
+ onAddPortlet: g((u) => {
679
694
  D(u);
680
695
  }, [D]),
681
- onAddMarkdown: f((u) => {
696
+ onAddMarkdown: g((u) => {
682
697
  D(u);
683
698
  }, [D]),
684
- onTurnComplete: f(() => {
685
- n.current = !0;
699
+ onDashboardSaved: a,
700
+ onTurnComplete: g(() => {
701
+ w.current = !0;
686
702
  }, []),
687
- onDone: f((u) => {
688
- n.current = !1, x(u), d(!1);
689
- }, [x, d]),
690
- onError: f((u) => {
691
- p(), v(u), d(!1);
692
- }, [p, v, d])
693
- }), w = f((u) => {
694
- !u || l || (n.current = !1, g({
703
+ onDone: g((u) => {
704
+ w.current = !1, R(u), v(!1);
705
+ }, [R, v]),
706
+ onError: g((u) => {
707
+ M(), i(u), v(!1);
708
+ }, [M, i, v])
709
+ }), _ = g((u) => {
710
+ if (!u || F.current) return;
711
+ w.current = !1;
712
+ const V = L.current.map((E) => ({
713
+ role: E.role,
714
+ content: E.content,
715
+ ...E.toolCalls && E.toolCalls.length > 0 ? { toolCalls: E.toolCalls } : {}
716
+ }));
717
+ N({
695
718
  id: `msg-${Date.now()}`,
696
719
  role: "user",
697
720
  content: u,
698
721
  timestamp: Date.now()
699
- }), g({
722
+ }), N({
700
723
  id: `msg-${Date.now() + 1}`,
701
724
  role: "assistant",
702
725
  content: "",
703
726
  toolCalls: [],
704
727
  timestamp: Date.now()
705
- }), C(""), d(!0), T(u, k));
706
- }, [l, g, C, d, T, k]), Q = f(() => {
707
- w(i.trim());
708
- }, [i, w]), q = f(() => {
709
- M(), d(!1);
710
- }, [M, d]), E = f(() => {
711
- C("");
712
- }, [C]), B = f(() => {
713
- M(), d(!1), I(), c?.();
714
- }, [M, d, I, c]);
715
- return /* @__PURE__ */ y("div", { className: "dc:flex dc:flex-col dc:h-full bg-dc-surface", children: [
716
- /* @__PURE__ */ y("div", { className: "dc:flex dc:items-center dc:justify-between dc:px-4 dc:py-3 border-dc-border dc:border-b", children: [
728
+ }), S(""), v(!0), z(u, B.current, V);
729
+ }, [N, S, v, z]);
730
+ P(() => {
731
+ if (o && !d.current && m.length === 0) {
732
+ d.current = !0;
733
+ const u = setTimeout(() => _(o), 100);
734
+ return () => clearTimeout(u);
735
+ }
736
+ }, [o, m.length, _]);
737
+ const W = C(h);
738
+ W.current = h;
739
+ const H = g(() => {
740
+ _(W.current.trim());
741
+ }, [_]), X = g(() => {
742
+ U(), v(!1);
743
+ }, [U, v]), Y = g(() => {
744
+ S("");
745
+ }, [S]), Z = g(() => {
746
+ U(), v(!1), y(), c?.();
747
+ }, [U, v, y, c]), ee = g(() => {
748
+ _(
749
+ "Save the current notebook as a dashboard with a professional layout, section headers, and appropriate filters."
750
+ );
751
+ }, [_]), te = !!a && !k && I > 0 && m.length > 0;
752
+ return /* @__PURE__ */ x("div", { className: "dc:flex dc:flex-col dc:h-full bg-dc-surface", children: [
753
+ /* @__PURE__ */ x("div", { className: "dc:flex dc:items-center dc:justify-between dc:px-4 dc:py-3 border-dc-border dc:border-b", children: [
717
754
  /* @__PURE__ */ r("h3", { className: "dc:text-sm dc:font-semibold text-dc-text", children: "AI Assistant" }),
718
- o.length > 0 && /* @__PURE__ */ r(
719
- "button",
720
- {
721
- onClick: B,
722
- disabled: l,
723
- className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-text-secondary dc:hover:opacity-80 dc:disabled:opacity-40",
724
- title: "Clear notebook and chat",
725
- children: "Clear"
726
- }
727
- )
755
+ /* @__PURE__ */ x("div", { className: "dc:flex dc:items-center dc:gap-1", children: [
756
+ te && /* @__PURE__ */ r(
757
+ "button",
758
+ {
759
+ onClick: ee,
760
+ className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-accent dc:hover:opacity-80",
761
+ title: "Save notebook as a dashboard",
762
+ children: "Save as Dashboard"
763
+ }
764
+ ),
765
+ m.length > 0 && /* @__PURE__ */ r(
766
+ "button",
767
+ {
768
+ onClick: Z,
769
+ disabled: k,
770
+ className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-text-secondary dc:hover:opacity-80 dc:disabled:opacity-40",
771
+ title: "Clear notebook and chat",
772
+ children: "Clear"
773
+ }
774
+ )
775
+ ] })
728
776
  ] }),
729
- /* @__PURE__ */ y("div", { className: "dc:flex-1 dc:overflow-y-auto dc:px-4 dc:py-3", children: [
730
- o.length === 0 ? /* @__PURE__ */ r(Ie, {}) : o.map((u) => /* @__PURE__ */ r(De, { message: u }, u.id)),
731
- /* @__PURE__ */ r("div", { ref: a })
777
+ /* @__PURE__ */ x("div", { className: "dc:flex-1 dc:overflow-y-auto dc:px-4 dc:py-3", children: [
778
+ m.length === 0 ? /* @__PURE__ */ r(qe, {}) : m.map((u) => /* @__PURE__ */ r(
779
+ _e,
780
+ {
781
+ message: u,
782
+ loadingComponent: n
783
+ },
784
+ u.id
785
+ )),
786
+ /* @__PURE__ */ r("div", { ref: l })
732
787
  ] }),
733
788
  /* @__PURE__ */ r(
734
- Te,
789
+ Ve,
735
790
  {
736
- value: i,
737
- onChange: C,
738
- onSend: Q,
739
- onStop: q,
740
- onContinue: E,
741
- isStreaming: l,
742
- showContinue: !l && o.length > 0
791
+ value: h,
792
+ onChange: S,
793
+ onSend: H,
794
+ onStop: X,
795
+ onContinue: Y,
796
+ isStreaming: k,
797
+ showContinue: !k && m.length > 0
743
798
  }
744
799
  )
745
800
  ] });
746
801
  });
747
- function Ie() {
748
- return /* @__PURE__ */ r("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */ y("div", { className: "dc:text-center dc:max-w-xs", children: [
802
+ function qe() {
803
+ return /* @__PURE__ */ r("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */ x("div", { className: "dc:text-center dc:max-w-xs", children: [
749
804
  /* @__PURE__ */ r("div", { className: "dc:text-lg dc:font-semibold text-dc-text dc:mb-2", children: "Data Analysis Assistant" }),
750
805
  /* @__PURE__ */ r("p", { className: "dc:text-sm text-dc-text-secondary dc:mb-4", children: "Ask me about your data and I'll create visualizations and insights." }),
751
- /* @__PURE__ */ y("div", { className: "dc:space-y-2 dc:text-xs text-dc-text-muted", children: [
806
+ /* @__PURE__ */ x("div", { className: "dc:space-y-2 dc:text-xs text-dc-text-muted", children: [
752
807
  /* @__PURE__ */ r("p", { children: '"Show me employee productivity trends"' }),
753
808
  /* @__PURE__ */ r("p", { children: '"What are the top departments by headcount?"' }),
754
809
  /* @__PURE__ */ r("p", { children: '"Compare revenue across product categories"' })
755
810
  ] })
756
811
  ] }) });
757
812
  }
758
- function Ee({
813
+ function Ue({
759
814
  agentEndpoint: e,
760
815
  agentApiKey: t,
761
816
  onSave: s,
762
817
  onDirtyStateChange: c,
763
- className: a
818
+ onDashboardSaved: a,
819
+ loadingComponent: n,
820
+ className: o,
821
+ initialPrompt: l
764
822
  }) {
765
- const [n, o] = _(60), l = N(null), i = N(!1), g = S((p) => p.blocks.length), b = S((p) => p.messages.length), v = S((p) => p.isStreaming), m = S((p) => p.save), A = N({ blockCount: g, msgCount: b });
823
+ const [d, w] = j(60), m = C(null), k = C(!1), h = A((y) => y.blocks.length), N = A((y) => y.messages.length), p = A((y) => y.isStreaming), i = A((y) => y.save), f = C({ blockCount: h, msgCount: N });
766
824
  P(() => {
767
- const p = g !== A.current.blockCount || b !== A.current.msgCount;
768
- c?.(p);
769
- }, [g, b, c]);
770
- const d = N(), C = N(!1), x = N(s);
771
- x.current = s;
772
- const k = N(g > 0 || b > 0);
825
+ const y = h !== f.current.blockCount || N !== f.current.msgCount;
826
+ c?.(y);
827
+ }, [h, N, c]);
828
+ const b = C(), v = C(!1), S = C(s);
829
+ S.current = s;
830
+ const R = C(h > 0 || N > 0);
773
831
  P(() => {
774
- if ((g > 0 || b > 0) && (k.current = !0), !(!x.current || !k.current)) {
775
- if (v) {
776
- C.current = !0, d.current && clearTimeout(d.current);
832
+ if ((h > 0 || N > 0) && (R.current = !0), !(!S.current || !R.current)) {
833
+ if (p) {
834
+ v.current = !0, b.current && clearTimeout(b.current);
777
835
  return;
778
836
  }
779
- return d.current && clearTimeout(d.current), d.current = setTimeout(() => {
780
- C.current = !1;
781
- const p = m();
782
- x.current?.(p);
837
+ return b.current && clearTimeout(b.current), b.current = setTimeout(() => {
838
+ v.current = !1;
839
+ const y = i();
840
+ S.current?.(y);
783
841
  }, 1e3), () => {
784
- d.current && clearTimeout(d.current);
842
+ b.current && clearTimeout(b.current);
785
843
  };
786
844
  }
787
- }, [g, b, v, m]), P(() => {
788
- !v && C.current && x.current && k.current && (d.current && clearTimeout(d.current), d.current = setTimeout(() => {
789
- C.current = !1;
790
- const p = m();
791
- x.current?.(p);
845
+ }, [h, N, p, i]), P(() => {
846
+ !p && v.current && S.current && R.current && (b.current && clearTimeout(b.current), b.current = setTimeout(() => {
847
+ v.current = !1;
848
+ const y = i();
849
+ S.current?.(y);
792
850
  }, 1e3));
793
- }, [v, m]);
794
- const D = f(() => {
795
- x.current && (d.current && clearTimeout(d.current), x.current({ blocks: [], messages: [] }));
796
- }, []), I = f((p) => {
797
- p.preventDefault(), i.current = !0;
798
- const h = (M) => {
799
- if (!i.current || !l.current) return;
800
- const w = l.current.getBoundingClientRect(), Q = (M.clientX - w.left) / w.width * 100;
801
- o(Math.min(Math.max(Q, 30), 80));
802
- }, T = () => {
803
- i.current = !1, document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", T);
851
+ }, [p, i]);
852
+ const T = g(() => {
853
+ S.current && (b.current && clearTimeout(b.current), S.current({ blocks: [], messages: [] }));
854
+ }, []), D = g((y) => {
855
+ y.preventDefault(), k.current = !0;
856
+ const I = (F) => {
857
+ if (!k.current || !m.current) return;
858
+ const B = m.current.getBoundingClientRect(), M = (F.clientX - B.left) / B.width * 100;
859
+ w(Math.min(Math.max(M, 30), 80));
860
+ }, L = () => {
861
+ k.current = !1, document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", L);
804
862
  };
805
- document.addEventListener("mousemove", h), document.addEventListener("mouseup", T);
863
+ document.addEventListener("mousemove", I), document.addEventListener("mouseup", L);
806
864
  }, []);
807
- return /* @__PURE__ */ y(
865
+ return /* @__PURE__ */ x(
808
866
  "div",
809
867
  {
810
- ref: l,
811
- className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${a || ""}`,
868
+ ref: m,
869
+ className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${o || ""}`,
812
870
  children: [
813
871
  /* @__PURE__ */ r(
814
872
  "div",
815
873
  {
816
874
  className: "dc:h-full dc:overflow-hidden",
817
- style: { width: `${n}%` },
818
- children: /* @__PURE__ */ r(Ce, {})
875
+ style: { width: `${d}%` },
876
+ children: /* @__PURE__ */ r(Ee, {})
819
877
  }
820
878
  ),
821
879
  /* @__PURE__ */ r(
822
880
  "div",
823
881
  {
824
882
  className: "dc:w-1 dc:h-full dc:cursor-col-resize dc:flex-shrink-0 dc:transition-colors bg-dc-border dc:hover:bg-dc-accent",
825
- onMouseDown: I
883
+ onMouseDown: D
826
884
  }
827
885
  ),
828
886
  /* @__PURE__ */ r(
829
887
  "div",
830
888
  {
831
889
  className: "dc:h-full dc:overflow-hidden",
832
- style: { width: `${100 - n}%` },
890
+ style: { width: `${100 - d}%` },
833
891
  children: /* @__PURE__ */ r(
834
- Me,
892
+ je,
835
893
  {
836
894
  agentEndpoint: e,
837
895
  agentApiKey: t,
838
- onClear: D
896
+ onClear: T,
897
+ onDashboardSaved: a,
898
+ loadingComponent: n,
899
+ initialPrompt: l
839
900
  }
840
901
  )
841
902
  }
@@ -844,26 +905,26 @@ function Ee({
844
905
  }
845
906
  );
846
907
  }
847
- const Oe = R.memo(function({
908
+ const st = Q.memo(function({
848
909
  config: t,
849
910
  ...s
850
911
  }) {
851
- return /* @__PURE__ */ r(ie, { initialConfig: t, children: /* @__PURE__ */ r(Ee, { ...s }) });
912
+ return /* @__PURE__ */ r(xe, { initialConfig: t, children: /* @__PURE__ */ r(Ue, { ...s }) });
852
913
  });
853
- function $e() {
914
+ function rt() {
854
915
  return /* @__PURE__ */ r("div", { children: "Analytics Page - Coming in Phase 4" });
855
916
  }
856
- const Be = V("segment");
857
- function ze({
917
+ const Ke = q("segment");
918
+ function at({
858
919
  className: e = ""
859
920
  }) {
860
921
  return /* @__PURE__ */ r(
861
922
  "div",
862
923
  {
863
924
  className: `dc:flex dc:items-center dc:justify-center bg-dc-bg-secondary ${e}`,
864
- children: /* @__PURE__ */ y("div", { className: "dc:text-center", children: [
925
+ children: /* @__PURE__ */ x("div", { className: "dc:text-center", children: [
865
926
  /* @__PURE__ */ r(
866
- Be,
927
+ Ke,
867
928
  {
868
929
  className: "dc:w-8 dc:h-8 dc:mx-auto dc:mb-2 text-dc-text-muted dc:opacity-50"
869
930
  }
@@ -874,178 +935,178 @@ function ze({
874
935
  );
875
936
  }
876
937
  export {
877
- Oe as AgenticNotebook,
878
- He as AnalysisBuilder,
879
- Ge as AnalyticsDashboard,
880
- $e as AnalyticsPage,
881
- H as AnalyticsPortlet,
882
- Xe as ChartErrorBoundary,
883
- Ye as ConfirmModal,
884
- ts as CubeClient,
885
- ss as CubeProvider,
886
- Ot as DEFAULT_ICONS,
887
- Ze as DashboardEditModal,
888
- et as DashboardGrid,
889
- tt as DashboardStoreProvider,
890
- ze as DashboardThumbnailPlaceholder,
891
- st as DrillBreadcrumb,
892
- rt as DrillMenu,
893
- Ss as ExecutionPlanPanel,
894
- As as ExplainAIPanel,
895
- bs as LazyChart,
896
- hs as LoadingIndicator,
897
- at as Modal,
898
- ie as NotebookStoreProvider,
899
- X as PortletAnalysisModal,
900
- ct as PortletContainer,
901
- rs as ScrollContainerProvider,
902
- Lr as THEME_PRESETS,
903
- Rr as applyTheme,
904
- Sr as buildFunnelConfigFromQueries,
905
- Ar as buildServerFunnelQuery,
906
- as as captureThumbnail,
907
- Ds as compressAndEncode,
908
- cs as createCubeClient,
909
- cr as createDashboardLayout,
910
- nt as createDashboardStore,
911
- ot as createDefaultConfig,
912
- dt as createDefaultFlowConfig,
913
- it as createDefaultFunnelConfig,
914
- lt as createDefaultQueryConfig,
915
- ut as createDefaultRetentionConfig,
916
- mt as createDefaultWorkspace,
917
- Kr as createExplainQueryKey,
918
- dr as createFlowQueryKey,
919
- ir as createFunnelQueryKey,
920
- de as createNotebookStore,
921
- Ts as decodeAndDecompress,
922
- Ms as detectAsymmetricDateRanges,
923
- Is as detectMeasureCollisions,
924
- nr as formatChartData,
925
- Dr as formatDuration,
926
- lr as generateQueryLabel,
927
- Es as generateShareUrl,
928
- Bs as getAvailableBindingKeyDimensions,
929
- ys as getAvailableChartTypes,
930
- Tr as getBindingKeyField,
931
- Ls as getBindingKeyLabel,
932
- $t as getChartTypeIcon,
933
- ur as getCombinedFields,
934
- Mr as getCubeNameFromQuery,
935
- zt as getFieldTypeIcon,
936
- V as getIcon,
937
- Wt as getIconData,
938
- Jt as getIconRegistry,
939
- Ht as getIconsByCategory,
940
- Gt as getMeasureTypeIcon,
941
- mr as getQueryIndices,
942
- pr as getQueryLabels,
943
- Pr as getTheme,
944
- Qr as getThemeVariable,
945
- xs as getUnavailableChartTypes,
946
- Rs as getValidationSummary,
947
- Zr as highlightCodeBlocks,
948
- vs as isChartTypeAvailable,
949
- Fr as isDarkMode,
950
- pt as isFlowConfig,
951
- ht as isFunnelConfig,
952
- Ir as isFunnelData,
953
- Ps as isMinimumFunnelConfigValid,
954
- ft as isMultiQuery,
955
- gt as isMultiQueryConfig,
956
- hr as isMultiQueryData,
957
- Qs as isMultiQueryValid,
958
- bt as isQueryConfig,
959
- yt as isRetentionConfig,
960
- Gr as isSankeyData,
961
- Xr as isServerFlowQuery,
962
- xt as isServerFunnelQuery,
963
- Fs as isShareableSize,
964
- vt as isSingleQuery,
965
- ns as isThumbnailCaptureAvailable,
966
- Ct as isValidAnalysisConfig,
967
- kt as isValidAnalysisWorkspace,
968
- Cs as isValidChartType,
969
- fr as mergeQueryResults,
970
- gr as mergeResultsByKey,
971
- br as mergeResultsConcat,
972
- Nt as migrateConfig,
973
- wt as migrateLegacyPortlet,
974
- _s as parseShareUrl,
975
- ks as preloadChart,
976
- Ns as preloadCharts,
977
- Xt as registerIcons,
978
- Yt as resetIcons,
979
- _r as resetTheme,
980
- St as selectAllActions,
981
- pe as selectBlockActions,
982
- le as selectBlocks,
983
- Vs as selectBreakdowns,
984
- js as selectChartConfig,
985
- me as selectChatActions,
986
- ue as selectChatState,
987
- qs as selectCurrentState,
988
- At as selectDebugData,
989
- Dt as selectDebugDataActions,
990
- Tt as selectEditModeActions,
991
- Mt as selectEditModeState,
992
- Us as selectFilters,
993
- Ks as selectFunnelState,
994
- Ke as selectInputValue,
995
- qe as selectIsStreaming,
996
- It as selectLayoutActions,
997
- Et as selectLayoutState,
998
- je as selectMessages,
999
- Os as selectMetrics,
1000
- Bt as selectModalActions,
1001
- Lt as selectModalState,
1002
- $s as selectMultiQueryState,
1003
- Rt as selectPortletDebugData,
1004
- Ue as selectSessionId,
1005
- Pt as selectThumbnailDirty,
1006
- zs as selectUIState,
1007
- Zt as setIcon,
1008
- Vr as setTheme,
1009
- jr as setThemeVariable,
1010
- Er as transformServerFunnelResult,
1011
- Ne as useAgentChat,
1012
- Ws as useAnalysisBuilder,
1013
- Js as useAnalysisBuilderStore,
1014
- ne as useCubeApi,
1015
- os as useCubeContext,
1016
- ds as useCubeFeatures,
1017
- fs as useCubeFieldLabel,
1018
- yr as useCubeLoadQuery,
1019
- is as useCubeMeta,
1020
- ls as useCubeMetaQuery,
1021
- xr as useCubeQuery,
1022
- Qt as useDashboard,
1023
- Ft as useDashboardStore,
1024
- _t as useDashboardStoreApi,
1025
- Vt as useDashboardStoreOptional,
1026
- jt as useDrillInteraction,
1027
- Or as useDryRunQueries,
1028
- $r as useDryRunQuery,
1029
- qt as useElementVisibility,
1030
- zr as useExplainAI,
1031
- Wr as useExplainQuery,
1032
- vr as useFlowQuery,
1033
- Cr as useFunnelQuery,
1034
- kr as useMultiCubeLoadQuery,
1035
- Jr as useMultiDryRunQueries,
1036
- S as useNotebookStore,
1037
- us as useScrollContainer,
1038
- Ut as useScrollDetection,
1039
- rr as useTheme,
1040
- Hs as validateBindingKeyExists,
1041
- Gs as validateBindingKeyForSteps,
1042
- Xs as validateFunnelConfig,
1043
- Nr as validateMergeKey,
1044
- Ys as validateMergeKeys,
1045
- Zs as validateMultiQueryConfig,
1046
- er as validateStepQueries,
1047
- tr as validateTimeDimensionAlignment,
1048
- ms as warnIfScreenshotLibMissing,
1049
- qr as watchThemeChanges
938
+ st as AgenticNotebook,
939
+ ot as AnalysisBuilder,
940
+ dt as AnalyticsDashboard,
941
+ rt as AnalyticsPage,
942
+ ae as AnalyticsPortlet,
943
+ it as ChartErrorBoundary,
944
+ lt as ConfirmModal,
945
+ ps as CubeClient,
946
+ hs as CubeProvider,
947
+ ss as DEFAULT_ICONS,
948
+ ut as DashboardEditModal,
949
+ mt as DashboardGrid,
950
+ pt as DashboardStoreProvider,
951
+ at as DashboardThumbnailPlaceholder,
952
+ ht as DrillBreadcrumb,
953
+ ft as DrillMenu,
954
+ Qs as ExecutionPlanPanel,
955
+ Fs as ExplainAIPanel,
956
+ Ts as LazyChart,
957
+ ge as LoadingIndicator,
958
+ gt as Modal,
959
+ xe as NotebookStoreProvider,
960
+ ne as PortletAnalysisModal,
961
+ bt as PortletContainer,
962
+ fs as ScrollContainerProvider,
963
+ Or as THEME_PRESETS,
964
+ $r as applyTheme,
965
+ Qr as buildFunnelConfigFromQueries,
966
+ Fr as buildServerFunnelQuery,
967
+ gs as captureThumbnail,
968
+ _s as compressAndEncode,
969
+ bs as createCubeClient,
970
+ gr as createDashboardLayout,
971
+ yt as createDashboardStore,
972
+ xt as createDefaultConfig,
973
+ vt as createDefaultFlowConfig,
974
+ Ct as createDefaultFunnelConfig,
975
+ kt as createDefaultQueryConfig,
976
+ Nt as createDefaultRetentionConfig,
977
+ wt as createDefaultWorkspace,
978
+ ea as createExplainQueryKey,
979
+ xr as createFlowQueryKey,
980
+ vr as createFunnelQueryKey,
981
+ ye as createNotebookStore,
982
+ Vs as decodeAndDecompress,
983
+ js as detectAsymmetricDateRanges,
984
+ qs as detectMeasureCollisions,
985
+ br as formatChartData,
986
+ _r as formatDuration,
987
+ Cr as generateQueryLabel,
988
+ Us as generateShareUrl,
989
+ Ks as getAvailableBindingKeyDimensions,
990
+ Ms as getAvailableChartTypes,
991
+ Vr as getBindingKeyField,
992
+ Os as getBindingKeyLabel,
993
+ rs as getChartTypeIcon,
994
+ kr as getCombinedFields,
995
+ jr as getCubeNameFromQuery,
996
+ as as getFieldTypeIcon,
997
+ q as getIcon,
998
+ cs as getIconData,
999
+ ns as getIconRegistry,
1000
+ os as getIconsByCategory,
1001
+ ds as getMeasureTypeIcon,
1002
+ Nr as getQueryIndices,
1003
+ wr as getQueryLabels,
1004
+ zr as getTheme,
1005
+ Wr as getThemeVariable,
1006
+ Is as getUnavailableChartTypes,
1007
+ $s as getValidationSummary,
1008
+ la as highlightCodeBlocks,
1009
+ Es as isChartTypeAvailable,
1010
+ Jr as isDarkMode,
1011
+ St as isFlowConfig,
1012
+ Dt as isFunnelConfig,
1013
+ qr as isFunnelData,
1014
+ zs as isMinimumFunnelConfigValid,
1015
+ At as isMultiQuery,
1016
+ Tt as isMultiQueryConfig,
1017
+ Sr as isMultiQueryData,
1018
+ Ws as isMultiQueryValid,
1019
+ Mt as isQueryConfig,
1020
+ It as isRetentionConfig,
1021
+ oa as isSankeyData,
1022
+ da as isServerFlowQuery,
1023
+ Et as isServerFunnelQuery,
1024
+ Js as isShareableSize,
1025
+ Rt as isSingleQuery,
1026
+ ys as isThumbnailCaptureAvailable,
1027
+ Bt as isValidAnalysisConfig,
1028
+ Lt as isValidAnalysisWorkspace,
1029
+ Rs as isValidChartType,
1030
+ Dr as mergeQueryResults,
1031
+ Ar as mergeResultsByKey,
1032
+ Tr as mergeResultsConcat,
1033
+ Pt as migrateConfig,
1034
+ Qt as migrateLegacyPortlet,
1035
+ Gs as parseShareUrl,
1036
+ Bs as preloadChart,
1037
+ Ls as preloadCharts,
1038
+ is as registerIcons,
1039
+ ls as resetIcons,
1040
+ Gr as resetTheme,
1041
+ Ft as selectAllActions,
1042
+ Ne as selectBlockActions,
1043
+ ve as selectBlocks,
1044
+ Hs as selectBreakdowns,
1045
+ Xs as selectChartConfig,
1046
+ ke as selectChatActions,
1047
+ Ce as selectChatState,
1048
+ Ys as selectCurrentState,
1049
+ _t as selectDebugData,
1050
+ Vt as selectDebugDataActions,
1051
+ jt as selectEditModeActions,
1052
+ qt as selectEditModeState,
1053
+ Zs as selectFilters,
1054
+ er as selectFunnelState,
1055
+ tt as selectInputValue,
1056
+ Ze as selectIsStreaming,
1057
+ Ut as selectLayoutActions,
1058
+ Kt as selectLayoutState,
1059
+ Ye as selectMessages,
1060
+ tr as selectMetrics,
1061
+ Ot as selectModalActions,
1062
+ $t as selectModalState,
1063
+ sr as selectMultiQueryState,
1064
+ zt as selectPortletDebugData,
1065
+ et as selectSessionId,
1066
+ Wt as selectThumbnailDirty,
1067
+ rr as selectUIState,
1068
+ us as setIcon,
1069
+ Hr as setTheme,
1070
+ Xr as setThemeVariable,
1071
+ Ur as transformServerFunnelResult,
1072
+ Be as useAgentChat,
1073
+ ar as useAnalysisBuilder,
1074
+ cr as useAnalysisBuilderStore,
1075
+ fe as useCubeApi,
1076
+ xs as useCubeContext,
1077
+ vs as useCubeFeatures,
1078
+ Ds as useCubeFieldLabel,
1079
+ Mr as useCubeLoadQuery,
1080
+ Cs as useCubeMeta,
1081
+ ks as useCubeMetaQuery,
1082
+ Ir as useCubeQuery,
1083
+ Jt as useDashboard,
1084
+ Gt as useDashboardStore,
1085
+ Ht as useDashboardStoreApi,
1086
+ Xt as useDashboardStoreOptional,
1087
+ Yt as useDrillInteraction,
1088
+ ta as useDryRunQueries,
1089
+ sa as useDryRunQuery,
1090
+ Zt as useElementVisibility,
1091
+ ra as useExplainAI,
1092
+ aa as useExplainQuery,
1093
+ Er as useFlowQuery,
1094
+ Rr as useFunnelQuery,
1095
+ Br as useMultiCubeLoadQuery,
1096
+ ca as useMultiDryRunQueries,
1097
+ A as useNotebookStore,
1098
+ Ns as useScrollContainer,
1099
+ es as useScrollDetection,
1100
+ hr as useTheme,
1101
+ nr as validateBindingKeyExists,
1102
+ or as validateBindingKeyForSteps,
1103
+ dr as validateFunnelConfig,
1104
+ Lr as validateMergeKey,
1105
+ ir as validateMergeKeys,
1106
+ lr as validateMultiQueryConfig,
1107
+ ur as validateStepQueries,
1108
+ mr as validateTimeDimensionAlignment,
1109
+ ws as warnIfScreenshotLibMissing,
1110
+ Yr as watchThemeChanges
1050
1111
  };
1051
1112
  //# sourceMappingURL=index.js.map