drizzle-cube 0.4.28 → 0.4.30

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 (382) hide show
  1. package/dist/adapters/anthropic-BIva8k1r.cjs +1 -0
  2. package/dist/adapters/anthropic-B_rg0BhK.js +140 -0
  3. package/dist/adapters/dist-Boc63-1q.cjs +2 -0
  4. package/dist/adapters/dist-De5fzUEM.js +581 -0
  5. package/dist/adapters/express/index.cjs +2 -10
  6. package/dist/adapters/express/index.js +232 -342
  7. package/dist/adapters/fastify/index.cjs +2 -10
  8. package/dist/adapters/fastify/index.js +275 -424
  9. package/dist/adapters/google-CT4kgmBf.js +154 -0
  10. package/dist/adapters/google-Dgo9-Kb5.cjs +2 -0
  11. package/dist/adapters/handler-B8vuFQYP.cjs +25 -0
  12. package/dist/adapters/handler-D-2-6uLM.js +2951 -0
  13. package/dist/adapters/hono/index.cjs +2 -10
  14. package/dist/adapters/hono/index.js +307 -402
  15. package/dist/adapters/mcp-prompts-BAutSQYA.js +344 -0
  16. package/dist/adapters/mcp-prompts-DsAkafVn.cjs +5 -0
  17. package/dist/adapters/mcp-transport-CuugoG8t.js +7821 -0
  18. package/dist/adapters/mcp-transport-Dpp6hdZe.cjs +253 -0
  19. package/dist/adapters/nextjs/index.cjs +1 -9
  20. package/dist/adapters/nextjs/index.js +377 -600
  21. package/dist/adapters/openai-CjBvA6mK.js +4114 -0
  22. package/dist/adapters/openai-DhLE0A9Z.cjs +1 -0
  23. package/dist/adapters/openai-Zjw4Zo4R.js +153 -0
  24. package/dist/adapters/openai-eJBw3LfQ.cjs +16 -0
  25. package/dist/adapters/types.cjs +0 -1
  26. package/dist/adapters/types.js +0 -1
  27. package/dist/adapters/utils-ChhNGUOF.js +5396 -0
  28. package/dist/adapters/utils-CwJplXR5.cjs +15 -0
  29. package/dist/adapters/utils.cjs +1 -19
  30. package/dist/adapters/utils.js +2 -21333
  31. package/dist/client/charts.js +15 -186
  32. package/dist/client/chunks/DashboardEditModal-C076pscL.js +6678 -0
  33. package/dist/client/chunks/DashboardEditModal-C076pscL.js.map +1 -0
  34. package/dist/client/chunks/FieldSearchModal-C0DjSWk3.js +2631 -0
  35. package/dist/client/chunks/FieldSearchModal-C0DjSWk3.js.map +1 -0
  36. package/dist/client/chunks/RetentionCombinedChart-DuGXc-AP.js +270 -0
  37. package/dist/client/chunks/RetentionCombinedChart-DuGXc-AP.js.map +1 -0
  38. package/dist/client/chunks/RetentionCombinedChart.config-DprbXd1N.js +56 -0
  39. package/dist/client/chunks/RetentionCombinedChart.config-DprbXd1N.js.map +1 -0
  40. package/dist/client/chunks/RetentionHeatmap-BoGY6mlZ.js +193 -0
  41. package/dist/client/chunks/RetentionHeatmap-BoGY6mlZ.js.map +1 -0
  42. package/dist/client/chunks/RetentionHeatmap.config-cbaNExVy.js +25 -0
  43. package/dist/client/chunks/RetentionHeatmap.config-cbaNExVy.js.map +1 -0
  44. package/dist/client/chunks/analysis-builder-DF0XntqC.js +6111 -0
  45. package/dist/client/chunks/analysis-builder-DF0XntqC.js.map +1 -0
  46. package/dist/client/chunks/analysis-builder-shared-2QhKYbs6.js +3114 -0
  47. package/dist/client/chunks/analysis-builder-shared-2QhKYbs6.js.map +1 -0
  48. package/dist/client/chunks/chart-activity-grid-CNES9VBk.js +803 -0
  49. package/dist/client/chunks/chart-activity-grid-CNES9VBk.js.map +1 -0
  50. package/dist/client/chunks/chart-area-CRJc3KOu.js +449 -0
  51. package/dist/client/chunks/chart-area-CRJc3KOu.js.map +1 -0
  52. package/dist/client/chunks/chart-bar-DD2PjJ5n.js +270 -0
  53. package/dist/client/chunks/chart-bar-DD2PjJ5n.js.map +1 -0
  54. package/dist/client/chunks/chart-box-plot-BcqleldJ.js +377 -0
  55. package/dist/client/chunks/chart-box-plot-BcqleldJ.js.map +1 -0
  56. package/dist/client/chunks/chart-bubble-BmQkVk4K.js +273 -0
  57. package/dist/client/chunks/chart-bubble-BmQkVk4K.js.map +1 -0
  58. package/dist/client/chunks/chart-candlestick-C3Rep469.js +306 -0
  59. package/dist/client/chunks/chart-candlestick-C3Rep469.js.map +1 -0
  60. package/dist/client/chunks/chart-config-activity-grid-USo7JrPh.js +51 -0
  61. package/dist/client/chunks/chart-config-activity-grid-USo7JrPh.js.map +1 -0
  62. package/dist/client/chunks/chart-config-area-D_ZufYzg.js +93 -0
  63. package/dist/client/chunks/chart-config-area-D_ZufYzg.js.map +1 -0
  64. package/dist/client/chunks/chart-config-bar-BCi2Wmd6.js +87 -0
  65. package/dist/client/chunks/chart-config-bar-BCi2Wmd6.js.map +1 -0
  66. package/dist/client/chunks/chart-config-box-plot-afKLzJSp.js +35 -0
  67. package/dist/client/chunks/chart-config-box-plot-afKLzJSp.js.map +1 -0
  68. package/dist/client/chunks/chart-config-bubble-CgbBjPv8.js +82 -0
  69. package/dist/client/chunks/chart-config-bubble-CgbBjPv8.js.map +1 -0
  70. package/dist/client/chunks/chart-config-candlestick-7boGjZ-A.js +72 -0
  71. package/dist/client/chunks/chart-config-candlestick-7boGjZ-A.js.map +1 -0
  72. package/dist/client/chunks/chart-config-data-table-Cl7sBasW.js +30 -0
  73. package/dist/client/chunks/chart-config-data-table-Cl7sBasW.js.map +1 -0
  74. package/dist/client/chunks/chart-config-funnel-CXPYQtTl.js +93 -0
  75. package/dist/client/chunks/chart-config-funnel-CXPYQtTl.js.map +1 -0
  76. package/dist/client/chunks/chart-config-gauge-DUNEUCvh.js +64 -0
  77. package/dist/client/chunks/chart-config-gauge-DUNEUCvh.js.map +1 -0
  78. package/dist/client/chunks/chart-config-heat-map-BFf1tO11.js +91 -0
  79. package/dist/client/chunks/chart-config-heat-map-BFf1tO11.js.map +1 -0
  80. package/dist/client/chunks/chart-config-kpi-delta-C5k2waIJ.js +94 -0
  81. package/dist/client/chunks/chart-config-kpi-delta-C5k2waIJ.js.map +1 -0
  82. package/dist/client/chunks/chart-config-kpi-number-DptOyhk0.js +75 -0
  83. package/dist/client/chunks/chart-config-kpi-number-DptOyhk0.js.map +1 -0
  84. package/dist/client/chunks/chart-config-kpi-text-D9DdVWqd.js +47 -0
  85. package/dist/client/chunks/chart-config-kpi-text-D9DdVWqd.js.map +1 -0
  86. package/dist/client/chunks/chart-config-line-B3NgLF7K.js +104 -0
  87. package/dist/client/chunks/chart-config-line-B3NgLF7K.js.map +1 -0
  88. package/dist/client/chunks/chart-config-markdown-tlfivQTt.js +117 -0
  89. package/dist/client/chunks/chart-config-markdown-tlfivQTt.js.map +1 -0
  90. package/dist/client/chunks/chart-config-measure-profile-D7XDwrU2.js +82 -0
  91. package/dist/client/chunks/chart-config-measure-profile-D7XDwrU2.js.map +1 -0
  92. package/dist/client/chunks/chart-config-pie-wY0B52PC.js +68 -0
  93. package/dist/client/chunks/chart-config-pie-wY0B52PC.js.map +1 -0
  94. package/dist/client/chunks/chart-config-radar-DRpJBy1M.js +49 -0
  95. package/dist/client/chunks/chart-config-radar-DRpJBy1M.js.map +1 -0
  96. package/dist/client/chunks/chart-config-radial-bar-DCUpXv9G.js +38 -0
  97. package/dist/client/chunks/chart-config-radial-bar-DCUpXv9G.js.map +1 -0
  98. package/dist/client/chunks/chart-config-sankey-CdOhlm4h.js +66 -0
  99. package/dist/client/chunks/chart-config-sankey-CdOhlm4h.js.map +1 -0
  100. package/dist/client/chunks/chart-config-scatter-B2su_x8f.js +61 -0
  101. package/dist/client/chunks/chart-config-scatter-B2su_x8f.js.map +1 -0
  102. package/dist/client/chunks/chart-config-sunburst-BPdjbk18.js +45 -0
  103. package/dist/client/chunks/chart-config-sunburst-BPdjbk18.js.map +1 -0
  104. package/dist/client/chunks/chart-config-tree-map-Cbsh2fe2.js +51 -0
  105. package/dist/client/chunks/chart-config-tree-map-Cbsh2fe2.js.map +1 -0
  106. package/dist/client/chunks/chart-config-waterfall-DGmuZfQF.js +59 -0
  107. package/dist/client/chunks/chart-config-waterfall-DGmuZfQF.js.map +1 -0
  108. package/dist/client/chunks/chart-data-table-DehW1C1G.js +4088 -0
  109. package/dist/client/chunks/chart-data-table-DehW1C1G.js.map +1 -0
  110. package/dist/client/chunks/chart-funnel-BjkpnG5g.js +447 -0
  111. package/dist/client/chunks/chart-funnel-BjkpnG5g.js.map +1 -0
  112. package/dist/client/chunks/chart-gauge-BWW_HEfg.js +424 -0
  113. package/dist/client/chunks/chart-gauge-BWW_HEfg.js.map +1 -0
  114. package/dist/client/chunks/chart-heat-map-BWuOuDcm.js +236 -0
  115. package/dist/client/chunks/chart-heat-map-BWuOuDcm.js.map +1 -0
  116. package/dist/client/chunks/chart-kpi-delta-D5OHtDJx.js +343 -0
  117. package/dist/client/chunks/chart-kpi-delta-D5OHtDJx.js.map +1 -0
  118. package/dist/client/chunks/chart-kpi-number-C9zH-aKC.js +326 -0
  119. package/dist/client/chunks/chart-kpi-number-C9zH-aKC.js.map +1 -0
  120. package/dist/client/chunks/chart-kpi-text-ChVn3S7j.js +149 -0
  121. package/dist/client/chunks/chart-kpi-text-ChVn3S7j.js.map +1 -0
  122. package/dist/client/chunks/chart-line-DOIMkP0b.js +431 -0
  123. package/dist/client/chunks/chart-line-DOIMkP0b.js.map +1 -0
  124. package/dist/client/chunks/chart-markdown-DXxc43w1.js +3457 -0
  125. package/dist/client/chunks/chart-markdown-DXxc43w1.js.map +1 -0
  126. package/dist/client/chunks/chart-measure-profile-C6wrr9il.js +179 -0
  127. package/dist/client/chunks/chart-measure-profile-C6wrr9il.js.map +1 -0
  128. package/dist/client/chunks/chart-pie-BU_FgwDc.js +172 -0
  129. package/dist/client/chunks/chart-pie-BU_FgwDc.js.map +1 -0
  130. package/dist/client/chunks/chart-radar-DlufwnAX.js +154 -0
  131. package/dist/client/chunks/chart-radar-DlufwnAX.js.map +1 -0
  132. package/dist/client/chunks/chart-radial-bar-B5vS_Aw5.js +148 -0
  133. package/dist/client/chunks/chart-radial-bar-B5vS_Aw5.js.map +1 -0
  134. package/dist/client/chunks/chart-sankey-FChb26UX.js +222 -0
  135. package/dist/client/chunks/chart-sankey-FChb26UX.js.map +1 -0
  136. package/dist/client/chunks/chart-scatter-DW0cAZ2H.js +255 -0
  137. package/dist/client/chunks/chart-scatter-DW0cAZ2H.js.map +1 -0
  138. package/dist/client/chunks/chart-sunburst-Clf-6WxW.js +221 -0
  139. package/dist/client/chunks/chart-sunburst-Clf-6WxW.js.map +1 -0
  140. package/dist/client/chunks/chart-tree-map-p_VwUJPF.js +298 -0
  141. package/dist/client/chunks/chart-tree-map-p_VwUJPF.js.map +1 -0
  142. package/dist/client/chunks/chart-waterfall-jt44IQ-w.js +237 -0
  143. package/dist/client/chunks/chart-waterfall-jt44IQ-w.js.map +1 -0
  144. package/dist/client/chunks/charts-core-CUVzf4cV.js +215 -0
  145. package/dist/client/chunks/charts-core-CUVzf4cV.js.map +1 -0
  146. package/dist/client/chunks/charts-loader-AGpph8_I.js +259 -0
  147. package/dist/client/chunks/charts-loader-AGpph8_I.js.map +1 -0
  148. package/dist/client/chunks/core-D1TOj17W.js +845 -0
  149. package/dist/client/chunks/core-D1TOj17W.js.map +1 -0
  150. package/dist/client/chunks/dist-DDBeV_JI.js +847 -0
  151. package/dist/client/chunks/dist-DDBeV_JI.js.map +1 -0
  152. package/dist/client/chunks/javascript-BBwTSo6e.js +438 -0
  153. package/dist/client/chunks/javascript-BBwTSo6e.js.map +1 -0
  154. package/dist/client/chunks/json-BpTrLZSh.js +38 -0
  155. package/dist/client/chunks/json-BpTrLZSh.js.map +1 -0
  156. package/dist/client/chunks/lazyChartConfigRegistry-BjhxDaSf.js +149 -0
  157. package/dist/client/chunks/lazyChartConfigRegistry-BjhxDaSf.js.map +1 -0
  158. package/dist/client/chunks/providers-DX3Vw5kc.js +7 -0
  159. package/dist/client/chunks/providers-DX3Vw5kc.js.map +1 -0
  160. package/dist/client/chunks/retention-UEXlSdZ-.js +132 -0
  161. package/dist/client/chunks/retention-UEXlSdZ-.js.map +1 -0
  162. package/dist/client/chunks/rolldown-runtime-lc2dmIiU.js +20 -0
  163. package/dist/client/chunks/schema-visualization-ZugB4Io9.js +1073 -0
  164. package/dist/client/chunks/schema-visualization-ZugB4Io9.js.map +1 -0
  165. package/dist/client/chunks/sql-B0chxcEK.js +120 -0
  166. package/dist/client/chunks/sql-B0chxcEK.js.map +1 -0
  167. package/dist/client/chunks/syntaxHighlighting-87bOwTxj.js +30 -0
  168. package/dist/client/chunks/syntaxHighlighting-87bOwTxj.js.map +1 -0
  169. package/dist/client/chunks/useDebounce-BQjNWndQ.js +1394 -0
  170. package/dist/client/chunks/useDebounce-BQjNWndQ.js.map +1 -0
  171. package/dist/client/chunks/useDirtyStateTracking-CgKZWkel.js +66 -0
  172. package/dist/client/chunks/useDirtyStateTracking-CgKZWkel.js.map +1 -0
  173. package/dist/client/chunks/useExplainAI-c_bHxZe5.js +203 -0
  174. package/dist/client/chunks/useExplainAI-c_bHxZe5.js.map +1 -0
  175. package/dist/client/chunks/useNotebookLayout-BFZ_33Kb.js +37 -0
  176. package/dist/client/chunks/useNotebookLayout-BFZ_33Kb.js.map +1 -0
  177. package/dist/client/chunks/utils-A54Ny29G.js +128 -0
  178. package/dist/client/chunks/utils-A54Ny29G.js.map +1 -0
  179. package/dist/client/chunks/vendor-CoPBRumI.js +828 -0
  180. package/dist/client/chunks/vendor-CoPBRumI.js.map +1 -0
  181. package/dist/client/components.js +4 -18
  182. package/dist/client/hooks.js +6 -58
  183. package/dist/client/icons.js +2 -15
  184. package/dist/client/index.js +1061 -1295
  185. package/dist/client/index.js.map +1 -1
  186. package/dist/client/providers.js +3 -9
  187. package/dist/client/styles.css +2 -1
  188. package/dist/client/types.d.ts +1 -0
  189. package/dist/client/utils.js +7 -74
  190. package/dist/client-bundle-stats.html +1 -1
  191. package/dist/server/anthropic-BsNspi1r.js +140 -0
  192. package/dist/server/anthropic-DsCEX6Fm.cjs +1 -0
  193. package/dist/server/dist-CMWZC51B.js +581 -0
  194. package/dist/server/dist-DxegvyZF.cjs +2 -0
  195. package/dist/server/google-BXwMolCu.js +154 -0
  196. package/dist/server/google-DzQWXFwF.cjs +2 -0
  197. package/dist/server/index.cjs +109 -127
  198. package/dist/server/index.d.ts +13 -4
  199. package/dist/server/index.js +15089 -34349
  200. package/dist/server/openai-BPhmb8mi.js +4114 -0
  201. package/dist/server/openai-CLsoLaue.cjs +1 -0
  202. package/dist/server/openai-D1kZ5sdM.js +153 -0
  203. package/dist/server/openai-DkOKbVLC.cjs +16 -0
  204. package/package.json +5 -5
  205. package/dist/adapters/anthropic-BTkjgFpT.cjs +0 -1
  206. package/dist/adapters/anthropic-CTu9E801.js +0 -126
  207. package/dist/adapters/google-BAK9pnQf.cjs +0 -2
  208. package/dist/adapters/google-DficVAsJ.js +0 -146
  209. package/dist/adapters/handler-BV2_dul8.js +0 -2713
  210. package/dist/adapters/handler-LMRPeTNJ.cjs +0 -39
  211. package/dist/adapters/index-BgCeQBuN.cjs +0 -2
  212. package/dist/adapters/index-C3PskWTr.js +0 -5353
  213. package/dist/adapters/index-C45_meK_.js +0 -719
  214. package/dist/adapters/index-ht4NPca9.cjs +0 -23
  215. package/dist/adapters/mcp-transport-B6ZudTSk.js +0 -11010
  216. package/dist/adapters/mcp-transport-DCiSGtp1.cjs +0 -257
  217. package/dist/adapters/openai-BvA6eLs8.cjs +0 -1
  218. package/dist/adapters/openai-mcE24du8.js +0 -131
  219. package/dist/client/charts.js.map +0 -1
  220. package/dist/client/chunks/RetentionCombinedChart--SnU4Y_I.js +0 -256
  221. package/dist/client/chunks/RetentionCombinedChart--SnU4Y_I.js.map +0 -1
  222. package/dist/client/chunks/RetentionCombinedChart.config-Bbp2ghim.js +0 -48
  223. package/dist/client/chunks/RetentionCombinedChart.config-Bbp2ghim.js.map +0 -1
  224. package/dist/client/chunks/RetentionHeatmap-BHYU8MXY.js +0 -178
  225. package/dist/client/chunks/RetentionHeatmap-BHYU8MXY.js.map +0 -1
  226. package/dist/client/chunks/RetentionHeatmap.config-BWf_-vdj.js +0 -29
  227. package/dist/client/chunks/RetentionHeatmap.config-BWf_-vdj.js.map +0 -1
  228. package/dist/client/chunks/analysis-builder-DMFoAkjT.js +0 -6203
  229. package/dist/client/chunks/analysis-builder-DMFoAkjT.js.map +0 -1
  230. package/dist/client/chunks/analysis-builder-shared-CunrT3gi.js +0 -3140
  231. package/dist/client/chunks/analysis-builder-shared-CunrT3gi.js.map +0 -1
  232. package/dist/client/chunks/chart-activity-grid-DCznpK6N.js +0 -347
  233. package/dist/client/chunks/chart-activity-grid-DCznpK6N.js.map +0 -1
  234. package/dist/client/chunks/chart-area-CqKRIUpj.js +0 -234
  235. package/dist/client/chunks/chart-area-CqKRIUpj.js.map +0 -1
  236. package/dist/client/chunks/chart-bar-Bl5jvrU_.js +0 -267
  237. package/dist/client/chunks/chart-bar-Bl5jvrU_.js.map +0 -1
  238. package/dist/client/chunks/chart-box-plot-CzMb00z_.js +0 -322
  239. package/dist/client/chunks/chart-box-plot-CzMb00z_.js.map +0 -1
  240. package/dist/client/chunks/chart-bubble-BF8Z52eW.js +0 -249
  241. package/dist/client/chunks/chart-bubble-BF8Z52eW.js.map +0 -1
  242. package/dist/client/chunks/chart-candlestick-ByWS945g.js +0 -269
  243. package/dist/client/chunks/chart-candlestick-ByWS945g.js.map +0 -1
  244. package/dist/client/chunks/chart-config-activity-grid-CmOqDuOT.js +0 -50
  245. package/dist/client/chunks/chart-config-activity-grid-CmOqDuOT.js.map +0 -1
  246. package/dist/client/chunks/chart-config-area-CK_GVApT.js +0 -77
  247. package/dist/client/chunks/chart-config-area-CK_GVApT.js.map +0 -1
  248. package/dist/client/chunks/chart-config-bar-C8uzktxl.js +0 -71
  249. package/dist/client/chunks/chart-config-bar-C8uzktxl.js.map +0 -1
  250. package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js +0 -38
  251. package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js.map +0 -1
  252. package/dist/client/chunks/chart-config-bubble-q3DoQX5F.js +0 -71
  253. package/dist/client/chunks/chart-config-bubble-q3DoQX5F.js.map +0 -1
  254. package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js +0 -70
  255. package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js.map +0 -1
  256. package/dist/client/chunks/chart-config-data-table-B20Y5JCm.js +0 -28
  257. package/dist/client/chunks/chart-config-data-table-B20Y5JCm.js.map +0 -1
  258. package/dist/client/chunks/chart-config-funnel-3eYnGg8M.js +0 -92
  259. package/dist/client/chunks/chart-config-funnel-3eYnGg8M.js.map +0 -1
  260. package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js +0 -64
  261. package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js.map +0 -1
  262. package/dist/client/chunks/chart-config-heat-map-_wEnTnRA.js +0 -77
  263. package/dist/client/chunks/chart-config-heat-map-_wEnTnRA.js.map +0 -1
  264. package/dist/client/chunks/chart-config-kpi-delta-DLGZ2A3X.js +0 -97
  265. package/dist/client/chunks/chart-config-kpi-delta-DLGZ2A3X.js.map +0 -1
  266. package/dist/client/chunks/chart-config-kpi-number-K-wzviXF.js +0 -75
  267. package/dist/client/chunks/chart-config-kpi-number-K-wzviXF.js.map +0 -1
  268. package/dist/client/chunks/chart-config-kpi-text-BjYqwqaJ.js +0 -47
  269. package/dist/client/chunks/chart-config-kpi-text-BjYqwqaJ.js.map +0 -1
  270. package/dist/client/chunks/chart-config-line-JNagi9tf.js +0 -88
  271. package/dist/client/chunks/chart-config-line-JNagi9tf.js.map +0 -1
  272. package/dist/client/chunks/chart-config-markdown-BWQSjJpy.js +0 -97
  273. package/dist/client/chunks/chart-config-markdown-BWQSjJpy.js.map +0 -1
  274. package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js +0 -70
  275. package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js.map +0 -1
  276. package/dist/client/chunks/chart-config-pie-CNLXb-fr.js +0 -39
  277. package/dist/client/chunks/chart-config-pie-CNLXb-fr.js.map +0 -1
  278. package/dist/client/chunks/chart-config-radar-oxHfRAa3.js +0 -44
  279. package/dist/client/chunks/chart-config-radar-oxHfRAa3.js.map +0 -1
  280. package/dist/client/chunks/chart-config-radial-bar-_Aw3jAEm.js +0 -37
  281. package/dist/client/chunks/chart-config-radial-bar-_Aw3jAEm.js.map +0 -1
  282. package/dist/client/chunks/chart-config-sankey-C8FX9hGF.js +0 -61
  283. package/dist/client/chunks/chart-config-sankey-C8FX9hGF.js.map +0 -1
  284. package/dist/client/chunks/chart-config-scatter-DFKM80eO.js +0 -53
  285. package/dist/client/chunks/chart-config-scatter-DFKM80eO.js.map +0 -1
  286. package/dist/client/chunks/chart-config-sunburst-BmC0NLTU.js +0 -50
  287. package/dist/client/chunks/chart-config-sunburst-BmC0NLTU.js.map +0 -1
  288. package/dist/client/chunks/chart-config-tree-map-DGMbNTaa.js +0 -47
  289. package/dist/client/chunks/chart-config-tree-map-DGMbNTaa.js.map +0 -1
  290. package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js +0 -60
  291. package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js.map +0 -1
  292. package/dist/client/chunks/chart-data-table-HwfF-Ujv.js +0 -293
  293. package/dist/client/chunks/chart-data-table-HwfF-Ujv.js.map +0 -1
  294. package/dist/client/chunks/chart-funnel-WmuoWlCq.js +0 -259
  295. package/dist/client/chunks/chart-funnel-WmuoWlCq.js.map +0 -1
  296. package/dist/client/chunks/chart-gauge-Cot4By-w.js +0 -374
  297. package/dist/client/chunks/chart-gauge-Cot4By-w.js.map +0 -1
  298. package/dist/client/chunks/chart-heat-map-bGNtsZMr.js +0 -231
  299. package/dist/client/chunks/chart-heat-map-bGNtsZMr.js.map +0 -1
  300. package/dist/client/chunks/chart-kpi-delta-DeyKMxgq.js +0 -351
  301. package/dist/client/chunks/chart-kpi-delta-DeyKMxgq.js.map +0 -1
  302. package/dist/client/chunks/chart-kpi-number-D1z1gxXO.js +0 -476
  303. package/dist/client/chunks/chart-kpi-number-D1z1gxXO.js.map +0 -1
  304. package/dist/client/chunks/chart-kpi-text-b7q6KWc0.js +0 -165
  305. package/dist/client/chunks/chart-kpi-text-b7q6KWc0.js.map +0 -1
  306. package/dist/client/chunks/chart-line-3Nf-EPqJ.js +0 -450
  307. package/dist/client/chunks/chart-line-3Nf-EPqJ.js.map +0 -1
  308. package/dist/client/chunks/chart-markdown-BT_-MBq1.js +0 -2721
  309. package/dist/client/chunks/chart-markdown-BT_-MBq1.js.map +0 -1
  310. package/dist/client/chunks/chart-measure-profile-BVjUonqU.js +0 -114
  311. package/dist/client/chunks/chart-measure-profile-BVjUonqU.js.map +0 -1
  312. package/dist/client/chunks/chart-pie-DblG6w7g.js +0 -137
  313. package/dist/client/chunks/chart-pie-DblG6w7g.js.map +0 -1
  314. package/dist/client/chunks/chart-radar-BHZbeeTg.js +0 -129
  315. package/dist/client/chunks/chart-radar-BHZbeeTg.js.map +0 -1
  316. package/dist/client/chunks/chart-radial-bar-AlEJC1Jo.js +0 -119
  317. package/dist/client/chunks/chart-radial-bar-AlEJC1Jo.js.map +0 -1
  318. package/dist/client/chunks/chart-sankey-E8vYKjQF.js +0 -189
  319. package/dist/client/chunks/chart-sankey-E8vYKjQF.js.map +0 -1
  320. package/dist/client/chunks/chart-scatter-Bbxqi0iw.js +0 -202
  321. package/dist/client/chunks/chart-scatter-Bbxqi0iw.js.map +0 -1
  322. package/dist/client/chunks/chart-sunburst-BgnTKolT.js +0 -188
  323. package/dist/client/chunks/chart-sunburst-BgnTKolT.js.map +0 -1
  324. package/dist/client/chunks/chart-tree-map-i9LGCLwl.js +0 -284
  325. package/dist/client/chunks/chart-tree-map-i9LGCLwl.js.map +0 -1
  326. package/dist/client/chunks/chart-waterfall-BeIhCm83.js +0 -191
  327. package/dist/client/chunks/chart-waterfall-BeIhCm83.js.map +0 -1
  328. package/dist/client/chunks/charts-core-BUUO36OM.js +0 -692
  329. package/dist/client/chunks/charts-core-BUUO36OM.js.map +0 -1
  330. package/dist/client/chunks/charts-loader-goTYnavu.js +0 -258
  331. package/dist/client/chunks/charts-loader-goTYnavu.js.map +0 -1
  332. package/dist/client/chunks/components-BFgYvFq6.js +0 -10066
  333. package/dist/client/chunks/components-BFgYvFq6.js.map +0 -1
  334. package/dist/client/chunks/core-Y9e-sNfb.js +0 -1068
  335. package/dist/client/chunks/core-Y9e-sNfb.js.map +0 -1
  336. package/dist/client/chunks/flow-utils-CjQZG5qq.js +0 -16
  337. package/dist/client/chunks/flow-utils-CjQZG5qq.js.map +0 -1
  338. package/dist/client/chunks/funnel-utils-CyonoNeC.js +0 -135
  339. package/dist/client/chunks/funnel-utils-CyonoNeC.js.map +0 -1
  340. package/dist/client/chunks/icons-CwvgmdIP.js +0 -1636
  341. package/dist/client/chunks/icons-CwvgmdIP.js.map +0 -1
  342. package/dist/client/chunks/index-CApFCBF9.js +0 -81
  343. package/dist/client/chunks/index-CApFCBF9.js.map +0 -1
  344. package/dist/client/chunks/index-_2PSgbkC.js +0 -1046
  345. package/dist/client/chunks/index-_2PSgbkC.js.map +0 -1
  346. package/dist/client/chunks/javascript-DII1YQGr.js +0 -659
  347. package/dist/client/chunks/javascript-DII1YQGr.js.map +0 -1
  348. package/dist/client/chunks/json-C_6Prymp.js +0 -39
  349. package/dist/client/chunks/json-C_6Prymp.js.map +0 -1
  350. package/dist/client/chunks/providers-Ds7DRmnO.js +0 -554
  351. package/dist/client/chunks/providers-Ds7DRmnO.js.map +0 -1
  352. package/dist/client/chunks/retention-CzCo8262.js +0 -120
  353. package/dist/client/chunks/retention-CzCo8262.js.map +0 -1
  354. package/dist/client/chunks/schema-visualization-B97a1Ybu.js +0 -772
  355. package/dist/client/chunks/schema-visualization-B97a1Ybu.js.map +0 -1
  356. package/dist/client/chunks/sql-IeKX8fQ8.js +0 -616
  357. package/dist/client/chunks/sql-IeKX8fQ8.js.map +0 -1
  358. package/dist/client/chunks/syntaxHighlighting-DAMSW_A6.js +0 -34
  359. package/dist/client/chunks/syntaxHighlighting-DAMSW_A6.js.map +0 -1
  360. package/dist/client/chunks/theme-Dp3hFed1.js +0 -112
  361. package/dist/client/chunks/theme-Dp3hFed1.js.map +0 -1
  362. package/dist/client/chunks/useDirtyStateTracking-CyAXd07d.js +0 -1231
  363. package/dist/client/chunks/useDirtyStateTracking-CyAXd07d.js.map +0 -1
  364. package/dist/client/chunks/useExplainAI-CfQ_JmF1.js +0 -182
  365. package/dist/client/chunks/useExplainAI-CfQ_JmF1.js.map +0 -1
  366. package/dist/client/chunks/vendor-B2EH3V58.js +0 -2892
  367. package/dist/client/chunks/vendor-B2EH3V58.js.map +0 -1
  368. package/dist/client/components.js.map +0 -1
  369. package/dist/client/hooks.js.map +0 -1
  370. package/dist/client/icons.js.map +0 -1
  371. package/dist/client/providers.js.map +0 -1
  372. package/dist/client/utils.js.map +0 -1
  373. package/dist/server/anthropic-BTkjgFpT.cjs +0 -1
  374. package/dist/server/anthropic-CTu9E801.js +0 -126
  375. package/dist/server/google-BAK9pnQf.cjs +0 -2
  376. package/dist/server/google-DficVAsJ.js +0 -146
  377. package/dist/server/index-BgCeQBuN.cjs +0 -2
  378. package/dist/server/index-C3PskWTr.js +0 -5353
  379. package/dist/server/index-C45_meK_.js +0 -719
  380. package/dist/server/index-ht4NPca9.cjs +0 -23
  381. package/dist/server/openai-BvA6eLs8.cjs +0 -1
  382. package/dist/server/openai-mcE24du8.js +0 -131
@@ -1,1316 +1,1082 @@
1
- import { D as ve, A as Ce, e as we, g as Ne, P as ke } from "./chunks/components-BFgYvFq6.js";
2
- import { j as Lt, a as Ft, C as Qt, i as _t, h as Vt, b as jt, k as Ut, f as Ot, d as $t, M as qt, c as Kt, o as zt, U as Wt, S as Jt, R as Xt, Q as Yt, T as Gt, W as Ht, J as Zt, I as es, L as ts, X as ss, H as cs, K as rs, Y as ns, N as as, O as os, V as ds, Z as ls, _ as is, B as us, r as ms, y as hs, v as fs, s as ps, x as gs, q as bs, w as xs, p as ys, t as vs, z as Cs, u as ws, l as Ns, m as ks, n as Ss, G as Ts, F as Ds, E as As } from "./chunks/components-BFgYvFq6.js";
3
- import { jsx as e, jsxs as u, Fragment as ae } from "react/jsx-runtime";
4
- import G, { useRef as x, createContext as Se, useContext as Te, useState as _, useCallback as p, useEffect as Q } from "react";
5
- import { e as De, f as Ae, h as Ie, s as Me, i as le } from "./chunks/vendor-B2EH3V58.js";
6
- import { g as M, b as Ee } from "./chunks/icons-CwvgmdIP.js";
7
- import { D as Ms, i as Es, c as Rs, f as Bs, h as Ps, a as Ls, r as Fs, e as Qs, s as _s } from "./chunks/icons-CwvgmdIP.js";
8
- import { N as Re } from "./chunks/chart-markdown-BT_-MBq1.js";
9
- import { f as Be } from "./chunks/providers-Ds7DRmnO.js";
10
- import { h as js, b as Us, S as Os, e as $s, d as qs, i as Ks, u as zs, g as Ws, a as Js, j as Xs, c as Ys, w as Gs } from "./chunks/providers-Ds7DRmnO.js";
11
- import { L as he } from "./chunks/charts-core-BUUO36OM.js";
12
- import { u as Zs } from "./chunks/charts-core-BUUO36OM.js";
13
- import { useNotebookLayout as Pe } from "./hooks.js";
14
- import { L as tc, g as sc, c as cc, b as rc, i as nc, p as ac, a as oc } from "./chunks/charts-loader-goTYnavu.js";
15
- import { E as lc, a as ic, p as uc, q as mc, m as hc, l as fc, r as pc, C as gc, D as bc, o as xc, B as yc, n as vc, w as Cc, t as wc, d as Nc, f as kc, s as Sc, e as Tc, i as Dc, c as Ac, h as Ic, g as Mc, u as Ec, b as Rc, y as Bc, A as Pc, x as Lc, k as Fc, v as Qc, z as _c, j as Vc } from "./chunks/analysis-builder-shared-CunrT3gi.js";
16
- import { S as Uc } from "./chunks/schema-visualization-B97a1Ybu.js";
17
- import { u as $c } from "./chunks/chart-bubble-BF8Z52eW.js";
18
- import { c as Kc, f as zc } from "./chunks/index-CApFCBF9.js";
19
- import { f as Jc, d as Xc, n as Yc, j as Gc, l as Hc, k as Zc, i as er, m as tr, h as sr, g as cr, u as rr, u as nr, e as ar, b as or, a as dr, v as lr } from "./chunks/useDirtyStateTracking-CyAXd07d.js";
20
- import { c as ur, b as mr, f as hr, g as fr, a as pr, i as gr, t as br } from "./chunks/funnel-utils-CyonoNeC.js";
21
- import { T as yr, c as vr, g as Cr, a as wr, i as Nr, r as kr, s as Sr, b as Tr, w as Dr } from "./chunks/theme-Dp3hFed1.js";
22
- import { d as Ir, b as Mr, u as Er, e as Rr, c as Br, a as Pr } from "./chunks/useExplainAI-CfQ_JmF1.js";
23
- import { i as Fr, a as Qr } from "./chunks/flow-utils-CjQZG5qq.js";
24
- import { h as Vr } from "./chunks/syntaxHighlighting-DAMSW_A6.js";
25
- const fe = () => ({
26
- blocks: [],
27
- messages: [],
28
- isStreaming: !1,
29
- sessionId: null,
30
- inputValue: ""
1
+ import { a as e, n as t, o as n, r, s as i } from "./chunks/vendor-CoPBRumI.js";
2
+ import { A as a, C as o, D as s, E as c, O as l, S as u, _ as d, c as f, d as p, f as m, g as h, h as g, j as _, k as v, l as y, m as b, p as x, s as S, u as C, v as w, y as T } from "./chunks/chart-data-table-DehW1C1G.js";
3
+ import { _ as E, a as D, b as O, d as k, f as A, g as j, h as M, i as N, l as P, m as F, o as I, p as L, s as R, u as z, v as B } from "./chunks/useDebounce-BQjNWndQ.js";
4
+ import { a as V, i as H, n as ee, o as te, r as ne, t as re } from "./chunks/useExplainAI-c_bHxZe5.js";
5
+ import { a as ie, c as ae, i as oe, l as se, o as ce, r as le, s as ue } from "./chunks/chart-funnel-BjkpnG5g.js";
6
+ import { n as de, r as fe } from "./chunks/chart-sankey-FChb26UX.js";
7
+ import { n as pe, t as me } from "./chunks/providers-DX3Vw5kc.js";
8
+ import { A as he, _ as ge, c as _e, d as ve, f as ye, g as be, h as xe, l as Se, m as Ce, p as we, u as Te } from "./chunks/chart-activity-grid-CNES9VBk.js";
9
+ import { A as Ee, C as De, D as Oe, E as ke, M as Ae, N as je, O as Me, S as Ne, T as Pe, _ as Fe, a as Ie, b as Le, c as Re, d as ze, f as Be, g as Ve, h as He, i as Ue, j as We, k as Ge, l as Ke, m as qe, n as Je, o as Ye, p as Xe, r as Ze, s as Qe, t as $e, u as et, v as tt, w as nt, x as rt, y as it } from "./chunks/DashboardEditModal-C076pscL.js";
10
+ import { u as at } from "./chunks/chart-area-CRJc3KOu.js";
11
+ import { a as ot, i as st, n as ct, o as lt, r as ut, s as dt, t as ft } from "./chunks/charts-loader-AGpph8_I.js";
12
+ import { A as pt, C as mt, D as ht, E as gt, F as _t, I as vt, L as yt, M as bt, N as xt, O as St, P as Ct, R as wt, S as Tt, T as Et, h as Dt, j as Ot, k as kt, p as At, r as jt, w as Mt } from "./chunks/FieldSearchModal-C0DjSWk3.js";
13
+ import { r as Nt } from "./chunks/syntaxHighlighting-87bOwTxj.js";
14
+ import { A as Pt, D as Ft, E as It, F as Lt, M as Rt, O as zt, P as Bt, S as Vt, T as Ht, _ as Ut, a as Wt, b as Gt, c as Kt, d as qt, f as Jt, g as Yt, h as Xt, i as Zt, j as Qt, k as $t, l as en, n as tn, o as nn, p as rn, r as an, s as on, t as sn, v as cn, w as ln, x as un, y as dn } from "./chunks/analysis-builder-shared-2QhKYbs6.js";
15
+ import { r as fn } from "./chunks/chart-markdown-DXxc43w1.js";
16
+ import { t as pn } from "./chunks/useNotebookLayout-BFZ_33Kb.js";
17
+ import { n as mn } from "./chunks/schema-visualization-ZugB4Io9.js";
18
+ import { n as hn } from "./chunks/chart-bubble-BmQkVk4K.js";
19
+ import { i as gn, t as _n } from "./chunks/utils-A54Ny29G.js";
20
+ import U, { createContext as vn, useCallback as W, useContext as yn, useEffect as G, useRef as K, useState as q } from "react";
21
+ import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
22
+ //#region src/client/stores/notebookStore.tsx
23
+ var bn = () => ({
24
+ blocks: [],
25
+ messages: [],
26
+ isStreaming: !1,
27
+ sessionId: null,
28
+ inputValue: ""
31
29
  });
32
- function Le(t, s) {
33
- return {
34
- // Block actions
35
- addBlock: (c) => t((n) => ({
36
- blocks: [...n.blocks, c]
37
- })),
38
- removeBlock: (c) => t((n) => ({
39
- blocks: n.blocks.filter((a) => a.id !== c)
40
- })),
41
- moveBlock: (c, n) => t((a) => {
42
- const r = a.blocks.findIndex((l) => l.id === c);
43
- if (r === -1) return {};
44
- if (n === "up" && r === 0) return {};
45
- if (n === "down" && r === a.blocks.length - 1) return {};
46
- const o = [...a.blocks], i = n === "up" ? r - 1 : r + 1;
47
- return [o[r], o[i]] = [o[i], o[r]], { blocks: o };
48
- }),
49
- updateBlock: (c, n) => t((a) => ({
50
- blocks: a.blocks.map(
51
- (r) => r.id === c && r.type === "portlet" ? { ...r, ...n } : r
52
- )
53
- })),
54
- // Chat actions
55
- addMessage: (c) => t((n) => ({
56
- messages: [...n.messages, c]
57
- })),
58
- appendToLastAssistantMessage: (c) => t((n) => {
59
- const a = [...n.messages], r = a[a.length - 1];
60
- return r && r.role === "assistant" && (a[a.length - 1] = {
61
- ...r,
62
- content: r.content + c
63
- }), { messages: a };
64
- }),
65
- setLastAssistantError: (c) => t((n) => {
66
- const a = [...n.messages], r = a[a.length - 1];
67
- return r && r.role === "assistant" && (a[a.length - 1] = { ...r, error: c }), { messages: a };
68
- }),
69
- addToolCallToLastAssistant: (c) => t((n) => {
70
- const a = [...n.messages], r = a[a.length - 1];
71
- return r && r.role === "assistant" && (a[a.length - 1] = {
72
- ...r,
73
- toolCalls: [...r.toolCalls || [], c]
74
- }), { messages: a };
75
- }),
76
- updateLastToolCall: (c) => t((n) => {
77
- const a = [...n.messages], r = a[a.length - 1];
78
- if (r?.role === "assistant" && r.toolCalls?.length) {
79
- const o = [...r.toolCalls], i = c.id ? o.findIndex((l) => l.id === c.id) : o.length - 1;
80
- i !== -1 && (o[i] = { ...o[i], ...c }, a[a.length - 1] = { ...r, toolCalls: o });
81
- }
82
- return { messages: a };
83
- }),
84
- // Session/UI actions
85
- setIsStreaming: (c) => t({ isStreaming: c }),
86
- setSessionId: (c) => t({ sessionId: c }),
87
- setInputValue: (c) => t({ inputValue: c }),
88
- // Persistence
89
- save: () => {
90
- const c = s();
91
- return {
92
- blocks: c.blocks,
93
- messages: c.messages
94
- };
95
- },
96
- load: (c) => t({
97
- blocks: c.blocks || [],
98
- messages: c.messages || []
99
- }),
100
- // Reset
101
- reset: () => t(fe())
102
- };
30
+ function xn(e, t) {
31
+ return {
32
+ addBlock: (t) => e((e) => ({ blocks: [...e.blocks, t] })),
33
+ removeBlock: (t) => e((e) => ({ blocks: e.blocks.filter((e) => e.id !== t) })),
34
+ moveBlock: (t, n) => e((e) => {
35
+ let r = e.blocks.findIndex((e) => e.id === t);
36
+ if (r === -1 || n === "up" && r === 0 || n === "down" && r === e.blocks.length - 1) return {};
37
+ let i = [...e.blocks], a = n === "up" ? r - 1 : r + 1;
38
+ return [i[r], i[a]] = [i[a], i[r]], { blocks: i };
39
+ }),
40
+ updateBlock: (t, n) => e((e) => ({ blocks: e.blocks.map((e) => e.id === t && e.type === "portlet" ? {
41
+ ...e,
42
+ ...n
43
+ } : e) })),
44
+ addMessage: (t) => e((e) => ({ messages: [...e.messages, t] })),
45
+ appendToLastAssistantMessage: (t) => e((e) => {
46
+ let n = [...e.messages], r = n[n.length - 1];
47
+ return r && r.role === "assistant" && (n[n.length - 1] = {
48
+ ...r,
49
+ content: r.content + t
50
+ }), { messages: n };
51
+ }),
52
+ setLastAssistantError: (t) => e((e) => {
53
+ let n = [...e.messages], r = n[n.length - 1];
54
+ return r && r.role === "assistant" && (n[n.length - 1] = {
55
+ ...r,
56
+ error: t
57
+ }), { messages: n };
58
+ }),
59
+ addToolCallToLastAssistant: (t) => e((e) => {
60
+ let n = [...e.messages], r = n[n.length - 1];
61
+ return r && r.role === "assistant" && (n[n.length - 1] = {
62
+ ...r,
63
+ toolCalls: [...r.toolCalls || [], t]
64
+ }), { messages: n };
65
+ }),
66
+ updateLastToolCall: (t) => e((e) => {
67
+ let n = [...e.messages], r = n[n.length - 1];
68
+ if (r?.role === "assistant" && r.toolCalls?.length) {
69
+ let e = [...r.toolCalls], i = t.id ? e.findIndex((e) => e.id === t.id) : e.length - 1;
70
+ i !== -1 && (e[i] = {
71
+ ...e[i],
72
+ ...t
73
+ }, n[n.length - 1] = {
74
+ ...r,
75
+ toolCalls: e
76
+ });
77
+ }
78
+ return { messages: n };
79
+ }),
80
+ setIsStreaming: (t) => e({ isStreaming: t }),
81
+ setSessionId: (t) => e({ sessionId: t }),
82
+ setInputValue: (t) => e({ inputValue: t }),
83
+ save: () => {
84
+ let e = t();
85
+ return {
86
+ blocks: e.blocks,
87
+ messages: e.messages
88
+ };
89
+ },
90
+ load: (t) => e({
91
+ blocks: t.blocks || [],
92
+ messages: t.messages || []
93
+ }),
94
+ reset: () => e(bn())
95
+ };
103
96
  }
104
- function Fe() {
105
- const t = fe();
106
- return Ae()(
107
- Ie(
108
- Me((s, c) => ({
109
- ...t,
110
- ...Le(s, c)
111
- })),
112
- { name: "NotebookStore" }
113
- )
114
- );
97
+ function Sn() {
98
+ let t = bn();
99
+ return i()(r(e((e, n) => ({
100
+ ...t,
101
+ ...xn(e, n)
102
+ })), { name: "NotebookStore" }));
115
103
  }
116
- const pe = Se(null);
117
- function Qe({
118
- children: t,
119
- initialConfig: s
120
- }) {
121
- const c = x(null);
122
- if (!c.current) {
123
- const n = Fe();
124
- s && n.getState().load(s), c.current = n;
125
- }
126
- return /* @__PURE__ */ e(pe.Provider, { value: c.current, children: t });
104
+ var Cn = vn(null);
105
+ function wn({ children: e, initialConfig: t }) {
106
+ let n = K(null);
107
+ if (!n.current) {
108
+ let e = Sn();
109
+ t && e.getState().load(t), n.current = e;
110
+ }
111
+ return /* @__PURE__ */ Y(Cn.Provider, {
112
+ value: n.current,
113
+ children: e
114
+ });
127
115
  }
128
- function B(t) {
129
- const s = Te(pe);
130
- if (!s)
131
- throw new Error("useNotebookStore must be used within NotebookStoreProvider");
132
- return De(s, t);
116
+ function Z(e) {
117
+ let t = yn(Cn);
118
+ if (!t) throw Error("useNotebookStore must be used within NotebookStoreProvider");
119
+ return n(t, e);
133
120
  }
134
- const _e = (t) => t.blocks, Tt = (t) => t.messages, Dt = (t) => t.isStreaming, At = (t) => t.sessionId, It = (t) => t.inputValue, Ve = (t) => ({
135
- messages: t.messages,
136
- isStreaming: t.isStreaming,
137
- inputValue: t.inputValue
138
- }), je = (t) => ({
139
- addMessage: t.addMessage,
140
- appendToLastAssistantMessage: t.appendToLastAssistantMessage,
141
- setLastAssistantError: t.setLastAssistantError,
142
- addToolCallToLastAssistant: t.addToolCallToLastAssistant,
143
- updateLastToolCall: t.updateLastToolCall,
144
- setIsStreaming: t.setIsStreaming,
145
- setInputValue: t.setInputValue,
146
- setSessionId: t.setSessionId
147
- }), Ue = (t) => ({
148
- addBlock: t.addBlock,
149
- removeBlock: t.removeBlock,
150
- moveBlock: t.moveBlock,
151
- updateBlock: t.updateBlock
152
- }), re = { width: "16px", height: "16px", color: "currentColor" }, Oe = M("chevronUp"), $e = M("chevronDown"), qe = M("edit"), Ke = M("delete"), ze = G.memo(function({
153
- block: s,
154
- colorPalette: c,
155
- onRemove: n,
156
- onMoveUp: a,
157
- onMoveDown: r,
158
- onEdit: o,
159
- isFirst: i,
160
- isLast: l
161
- }) {
162
- const [y, N] = _(null), S = p((v) => {
163
- N(v);
164
- }, []);
165
- return /* @__PURE__ */ u("div", { className: "dc:relative dc:mb-4 bg-dc-surface dc:border border-dc-border dc:rounded-lg dc:flex dc:flex-col", children: [
166
- /* @__PURE__ */ u("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: [
167
- /* @__PURE__ */ u("div", { className: "dc:flex dc:items-center dc:gap-2 dc:flex-1 dc:min-w-0", children: [
168
- /* @__PURE__ */ e("h3", { className: "dc:font-semibold dc:text-sm text-dc-text dc:truncate", children: s.title || "Untitled" }),
169
- y && /* @__PURE__ */ e(
170
- ve,
171
- {
172
- chartConfig: y.chartConfig,
173
- displayConfig: y.displayConfig,
174
- queryObject: y.queryObject,
175
- data: y.data,
176
- chartType: y.chartType,
177
- cacheInfo: y.cacheInfo ?? void 0
178
- }
179
- )
180
- ] }),
181
- /* @__PURE__ */ u("div", { className: "dc:flex dc:items-center dc:gap-1 dc:shrink-0 dc:ml-4 dc:-mr-2", children: [
182
- !i && /* @__PURE__ */ e(
183
- "button",
184
- {
185
- onClick: () => a(s.id),
186
- 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",
187
- title: "Move up",
188
- children: /* @__PURE__ */ e(Oe, { style: re })
189
- }
190
- ),
191
- !l && /* @__PURE__ */ e(
192
- "button",
193
- {
194
- onClick: () => r(s.id),
195
- 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",
196
- title: "Move down",
197
- children: /* @__PURE__ */ e($e, { style: re })
198
- }
199
- ),
200
- /* @__PURE__ */ e(
201
- "button",
202
- {
203
- onClick: () => o(s),
204
- 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",
205
- title: "Edit visualization",
206
- children: /* @__PURE__ */ e(qe, { style: re })
207
- }
208
- ),
209
- /* @__PURE__ */ e(
210
- "button",
211
- {
212
- onClick: () => n(s.id),
213
- 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",
214
- title: "Remove",
215
- children: /* @__PURE__ */ e(Ke, { style: re })
216
- }
217
- )
218
- ] })
219
- ] }),
220
- /* @__PURE__ */ e("div", { className: "dc:flex-1 dc:min-h-0", children: /* @__PURE__ */ e(
221
- Ce,
222
- {
223
- query: s.query,
224
- chartType: s.chartType,
225
- chartConfig: s.chartConfig,
226
- displayConfig: s.displayConfig,
227
- colorPalette: c,
228
- height: 400,
229
- eagerLoad: !0,
230
- onDebugDataReady: S
231
- }
232
- ) })
233
- ] });
234
- }), ne = { width: "16px", height: "16px", color: "currentColor" }, We = M("documentText"), Je = M("chevronUp"), Xe = M("chevronDown"), Ye = M("delete");
235
- function Ge({ children: t, ...s }) {
236
- return /* @__PURE__ */ e("div", { className: "dc:overflow-x-auto dc:my-2", children: /* @__PURE__ */ e("table", { ...s, children: t }) });
121
+ var Tn = (e) => e.blocks, En = (e) => e.messages, Dn = (e) => e.isStreaming, On = (e) => e.sessionId, kn = (e) => e.inputValue, An = (e) => ({
122
+ messages: e.messages,
123
+ isStreaming: e.isStreaming,
124
+ inputValue: e.inputValue
125
+ }), jn = (e) => ({
126
+ addMessage: e.addMessage,
127
+ appendToLastAssistantMessage: e.appendToLastAssistantMessage,
128
+ setLastAssistantError: e.setLastAssistantError,
129
+ addToolCallToLastAssistant: e.addToolCallToLastAssistant,
130
+ updateLastToolCall: e.updateLastToolCall,
131
+ setIsStreaming: e.setIsStreaming,
132
+ setInputValue: e.setInputValue,
133
+ setSessionId: e.setSessionId
134
+ }), Mn = (e) => ({
135
+ addBlock: e.addBlock,
136
+ removeBlock: e.removeBlock,
137
+ moveBlock: e.moveBlock,
138
+ updateBlock: e.updateBlock
139
+ }), Q = {
140
+ width: "16px",
141
+ height: "16px",
142
+ color: "currentColor"
143
+ }, Nn = p("chevronUp"), Pn = p("chevronDown"), Fn = p("edit"), In = p("delete"), Ln = U.memo(function({ block: e, colorPalette: t, onRemove: n, onMoveUp: r, onMoveDown: i, onEdit: a, isFirst: o, isLast: s }) {
144
+ let [c, l] = q(null), u = W((e) => {
145
+ l(e);
146
+ }, []);
147
+ return /* @__PURE__ */ X("div", {
148
+ className: "dc:relative dc:mb-4 bg-dc-surface dc:border border-dc-border dc:rounded-lg dc:flex dc:flex-col",
149
+ children: [/* @__PURE__ */ X("div", {
150
+ 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",
151
+ children: [/* @__PURE__ */ X("div", {
152
+ className: "dc:flex dc:items-center dc:gap-2 dc:flex-1 dc:min-w-0",
153
+ children: [/* @__PURE__ */ Y("h3", {
154
+ className: "dc:font-semibold dc:text-sm text-dc-text dc:truncate",
155
+ children: e.title || "Untitled"
156
+ }), c && /* @__PURE__ */ Y(nt, {
157
+ chartConfig: c.chartConfig,
158
+ displayConfig: c.displayConfig,
159
+ queryObject: c.queryObject,
160
+ data: c.data,
161
+ chartType: c.chartType,
162
+ cacheInfo: c.cacheInfo ?? void 0
163
+ })]
164
+ }), /* @__PURE__ */ X("div", {
165
+ className: "dc:flex dc:items-center dc:gap-1 dc:shrink-0 dc:ml-4 dc:-mr-2",
166
+ children: [
167
+ !o && /* @__PURE__ */ Y("button", {
168
+ onClick: () => r(e.id),
169
+ 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",
170
+ title: "Move up",
171
+ children: /* @__PURE__ */ Y(Nn, { style: Q })
172
+ }),
173
+ !s && /* @__PURE__ */ Y("button", {
174
+ onClick: () => i(e.id),
175
+ 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",
176
+ title: "Move down",
177
+ children: /* @__PURE__ */ Y(Pn, { style: Q })
178
+ }),
179
+ /* @__PURE__ */ Y("button", {
180
+ onClick: () => a(e),
181
+ 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",
182
+ title: "Edit visualization",
183
+ children: /* @__PURE__ */ Y(Fn, { style: Q })
184
+ }),
185
+ /* @__PURE__ */ Y("button", {
186
+ onClick: () => n(e.id),
187
+ 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",
188
+ title: "Remove",
189
+ children: /* @__PURE__ */ Y(In, { style: Q })
190
+ })
191
+ ]
192
+ })]
193
+ }), /* @__PURE__ */ Y("div", {
194
+ className: "dc:flex-1 dc:min-h-0",
195
+ children: /* @__PURE__ */ Y(Oe, {
196
+ query: e.query,
197
+ chartType: e.chartType,
198
+ chartConfig: e.chartConfig,
199
+ displayConfig: e.displayConfig,
200
+ colorPalette: t,
201
+ height: 400,
202
+ eagerLoad: !0,
203
+ onDebugDataReady: u
204
+ })
205
+ })]
206
+ });
207
+ }), $ = {
208
+ width: "16px",
209
+ height: "16px",
210
+ color: "currentColor"
211
+ }, Rn = p("documentText"), zn = p("chevronUp"), Bn = p("chevronDown"), Vn = p("delete");
212
+ function Hn({ children: e, ...t }) {
213
+ return /* @__PURE__ */ Y("div", {
214
+ className: "dc:overflow-x-auto dc:my-2",
215
+ children: /* @__PURE__ */ Y("table", {
216
+ ...t,
217
+ children: e
218
+ })
219
+ });
237
220
  }
238
- const He = {
239
- overrides: {
240
- h1: { props: { className: "dc:text-lg dc:font-bold text-dc-text dc:mb-2 dc:mt-3" } },
241
- h2: { props: { className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2 dc:mt-3" } },
242
- h3: { props: { className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2 dc:mt-3" } },
243
- p: { props: { className: "dc:text-sm dc:leading-relaxed text-dc-text dc:mb-2" } },
244
- strong: { props: { className: "dc:font-semibold" } },
245
- a: { props: { className: "text-dc-accent dc:hover:underline", target: "_blank", rel: "noopener noreferrer" } },
246
- code: { props: { className: "dc:px-1 dc:py-0.5 dc:rounded dc:text-xs bg-dc-surface-secondary text-dc-accent dc:font-mono" } },
247
- pre: { props: { className: "dc:rounded-lg dc:p-3 dc:my-2 dc:overflow-x-auto dc:text-xs bg-dc-surface-secondary text-dc-text dc:font-mono" } },
248
- ul: { props: { className: "dc:list-disc dc:ml-5 dc:mb-2 dc:text-sm text-dc-text dc:space-y-1" } },
249
- ol: { props: { className: "dc:list-decimal dc:ml-5 dc:mb-2 dc:text-sm text-dc-text dc:space-y-1" } },
250
- li: { props: { className: "dc:text-sm text-dc-text" } },
251
- hr: { props: { className: "dc:my-3 border-dc-border" } },
252
- blockquote: { props: { className: "dc:border-l-4 border-dc-accent dc:pl-3 dc:my-2 dc:italic text-dc-text-secondary dc:text-sm" } },
253
- table: { component: Ge, props: { className: "dc:w-full dc:border-collapse dc:text-sm" } },
254
- thead: { props: { className: "bg-dc-surface-secondary" } },
255
- th: { props: { className: "dc:px-3 dc:py-2 dc:text-left dc:font-semibold dc:text-xs text-dc-text-secondary dc:uppercase dc:tracking-wider border-dc-border dc:border-b" } },
256
- td: { props: { className: "dc:px-3 dc:py-2 dc:text-sm text-dc-text border-dc-border dc:border-b" } },
257
- tr: { props: { className: "dc:hover:opacity-80" } }
258
- }
259
- }, Ze = G.memo(function({
260
- block: s,
261
- onRemove: c,
262
- onMoveUp: n,
263
- onMoveDown: a,
264
- isFirst: r,
265
- isLast: o
266
- }) {
267
- return /* @__PURE__ */ u("div", { className: "dc:relative dc:mb-4 bg-dc-surface dc:border border-dc-border dc:rounded-lg dc:flex dc:flex-col", children: [
268
- /* @__PURE__ */ u("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: [
269
- /* @__PURE__ */ u("div", { className: "dc:flex dc:items-center dc:gap-2 dc:flex-1 dc:min-w-0", children: [
270
- /* @__PURE__ */ e(We, { style: ne }),
271
- /* @__PURE__ */ e("h3", { className: "dc:font-semibold dc:text-sm text-dc-text dc:truncate", children: s.title || "Markdown" })
272
- ] }),
273
- /* @__PURE__ */ u("div", { className: "dc:flex dc:items-center dc:gap-1 dc:shrink-0 dc:ml-4 dc:-mr-2", children: [
274
- !r && /* @__PURE__ */ e(
275
- "button",
276
- {
277
- onClick: () => n(s.id),
278
- 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",
279
- title: "Move up",
280
- children: /* @__PURE__ */ e(Je, { style: ne })
281
- }
282
- ),
283
- !o && /* @__PURE__ */ e(
284
- "button",
285
- {
286
- onClick: () => a(s.id),
287
- 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",
288
- title: "Move down",
289
- children: /* @__PURE__ */ e(Xe, { style: ne })
290
- }
291
- ),
292
- /* @__PURE__ */ e(
293
- "button",
294
- {
295
- onClick: () => c(s.id),
296
- 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",
297
- title: "Remove",
298
- children: /* @__PURE__ */ e(Ye, { style: ne })
299
- }
300
- )
301
- ] })
302
- ] }),
303
- /* @__PURE__ */ e("div", { className: "dc:p-4 dc:min-w-0 dc:overflow-hidden", children: /* @__PURE__ */ e(Re, { options: He, children: s.content }) })
304
- ] });
305
- }), me = G.memo(function({ colorPalette: s }) {
306
- const c = s ?? Ne(), n = B(_e), { removeBlock: a, moveBlock: r, updateBlock: o } = B(le(Ue)), i = x(null), [l, y] = _(null), N = x(n.length);
307
- Q(() => {
308
- n.length > N.current && i.current?.scrollIntoView({ behavior: "smooth" }), N.current = n.length;
309
- }, [n.length]);
310
- const S = p((g) => a(g), [a]), v = p((g) => r(g, "up"), [r]), k = p((g) => r(g, "down"), [r]), O = p((g) => y(g), []), R = p((g) => {
311
- if (!l) return;
312
- const A = we(g), { analysisConfig: d } = A;
313
- if (d) {
314
- const m = d.charts[d.analysisType];
315
- o(l.id, {
316
- title: g.title,
317
- query: JSON.stringify(d.query),
318
- chartType: m?.chartType || "bar",
319
- chartConfig: m?.chartConfig,
320
- displayConfig: m?.displayConfig
321
- });
322
- }
323
- y(null);
324
- }, [l, o]);
325
- return n.length === 0 ? /* @__PURE__ */ e("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */ u("div", { className: "dc:text-center dc:max-w-sm dc:px-6", children: [
326
- /* @__PURE__ */ e("h3", { className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2", children: "Your notebook is empty" }),
327
- /* @__PURE__ */ e("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." })
328
- ] }) }) : /* @__PURE__ */ u("div", { className: "dc:h-full dc:overflow-y-auto dc:p-4", children: [
329
- n.map((g, A) => {
330
- const d = A === 0, m = A === n.length - 1;
331
- return g.type === "portlet" ? /* @__PURE__ */ e(
332
- ze,
333
- {
334
- block: g,
335
- colorPalette: c,
336
- onRemove: S,
337
- onMoveUp: v,
338
- onMoveDown: k,
339
- onEdit: O,
340
- isFirst: d,
341
- isLast: m
342
- },
343
- g.id
344
- ) : g.type === "markdown" ? /* @__PURE__ */ e(
345
- Ze,
346
- {
347
- block: g,
348
- onRemove: S,
349
- onMoveUp: v,
350
- onMoveDown: k,
351
- isFirst: d,
352
- isLast: m
353
- },
354
- g.id
355
- ) : null;
356
- }),
357
- /* @__PURE__ */ e("div", { ref: i }),
358
- /* @__PURE__ */ e(
359
- ke,
360
- {
361
- isOpen: !!l,
362
- onClose: () => y(null),
363
- onSave: R,
364
- colorPalette: c,
365
- portlet: l ? {
366
- id: l.id,
367
- title: l.title,
368
- query: l.query,
369
- chartType: l.chartType,
370
- chartConfig: l.chartConfig,
371
- displayConfig: l.displayConfig,
372
- w: 5,
373
- h: 4,
374
- x: 0,
375
- y: 0
376
- } : null,
377
- title: "Edit Visualization",
378
- submitText: "Update"
379
- }
380
- )
381
- ] });
221
+ var Un = { overrides: {
222
+ h1: { props: { className: "dc:text-lg dc:font-bold text-dc-text dc:mb-2 dc:mt-3" } },
223
+ h2: { props: { className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2 dc:mt-3" } },
224
+ h3: { props: { className: "dc:text-sm dc:font-semibold text-dc-text dc:mb-2 dc:mt-3" } },
225
+ p: { props: { className: "dc:text-sm dc:leading-relaxed text-dc-text dc:mb-2" } },
226
+ strong: { props: { className: "dc:font-semibold" } },
227
+ a: { props: {
228
+ className: "text-dc-accent dc:hover:underline",
229
+ target: "_blank",
230
+ rel: "noopener noreferrer"
231
+ } },
232
+ code: { props: { className: "dc:px-1 dc:py-0.5 dc:rounded dc:text-xs bg-dc-surface-secondary text-dc-accent dc:font-mono" } },
233
+ pre: { props: { className: "dc:rounded-lg dc:p-3 dc:my-2 dc:overflow-x-auto dc:text-xs bg-dc-surface-secondary text-dc-text dc:font-mono" } },
234
+ ul: { props: { className: "dc:list-disc dc:ml-5 dc:mb-2 dc:text-sm text-dc-text dc:space-y-1" } },
235
+ ol: { props: { className: "dc:list-decimal dc:ml-5 dc:mb-2 dc:text-sm text-dc-text dc:space-y-1" } },
236
+ li: { props: { className: "dc:text-sm text-dc-text" } },
237
+ hr: { props: { className: "dc:my-3 border-dc-border" } },
238
+ blockquote: { props: { className: "dc:border-l-4 border-dc-accent dc:pl-3 dc:my-2 dc:italic text-dc-text-secondary dc:text-sm" } },
239
+ table: {
240
+ component: Hn,
241
+ props: { className: "dc:w-full dc:border-collapse dc:text-sm" }
242
+ },
243
+ thead: { props: { className: "bg-dc-surface-secondary" } },
244
+ th: { props: { className: "dc:px-3 dc:py-2 dc:text-left dc:font-semibold dc:text-xs text-dc-text-secondary dc:uppercase dc:tracking-wider border-dc-border dc:border-b" } },
245
+ td: { props: { className: "dc:px-3 dc:py-2 dc:text-sm text-dc-text border-dc-border dc:border-b" } },
246
+ tr: { props: { className: "dc:hover:opacity-80" } }
247
+ } }, Wn = U.memo(function({ block: e, onRemove: t, onMoveUp: n, onMoveDown: r, isFirst: i, isLast: a }) {
248
+ return /* @__PURE__ */ X("div", {
249
+ className: "dc:relative dc:mb-4 bg-dc-surface dc:border border-dc-border dc:rounded-lg dc:flex dc:flex-col",
250
+ children: [/* @__PURE__ */ X("div", {
251
+ 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",
252
+ children: [/* @__PURE__ */ X("div", {
253
+ className: "dc:flex dc:items-center dc:gap-2 dc:flex-1 dc:min-w-0",
254
+ children: [/* @__PURE__ */ Y(Rn, { style: $ }), /* @__PURE__ */ Y("h3", {
255
+ className: "dc:font-semibold dc:text-sm text-dc-text dc:truncate",
256
+ children: e.title || "Markdown"
257
+ })]
258
+ }), /* @__PURE__ */ X("div", {
259
+ className: "dc:flex dc:items-center dc:gap-1 dc:shrink-0 dc:ml-4 dc:-mr-2",
260
+ children: [
261
+ !i && /* @__PURE__ */ Y("button", {
262
+ onClick: () => n(e.id),
263
+ 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",
264
+ title: "Move up",
265
+ children: /* @__PURE__ */ Y(zn, { style: $ })
266
+ }),
267
+ !a && /* @__PURE__ */ Y("button", {
268
+ onClick: () => r(e.id),
269
+ 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",
270
+ title: "Move down",
271
+ children: /* @__PURE__ */ Y(Bn, { style: $ })
272
+ }),
273
+ /* @__PURE__ */ Y("button", {
274
+ onClick: () => t(e.id),
275
+ 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",
276
+ title: "Remove",
277
+ children: /* @__PURE__ */ Y(Vn, { style: $ })
278
+ })
279
+ ]
280
+ })]
281
+ }), /* @__PURE__ */ Y("div", {
282
+ className: "dc:p-4 dc:min-w-0 dc:overflow-hidden",
283
+ children: /* @__PURE__ */ Y(fn, {
284
+ options: Un,
285
+ children: e.content
286
+ })
287
+ })]
288
+ });
289
+ }), Gn = U.memo(function({ colorPalette: e }) {
290
+ let n = e ?? Dt(), r = Z(Tn), { removeBlock: i, moveBlock: a, updateBlock: o } = Z(t(Mn)), s = K(null), [c, l] = q(null), u = K(r.length);
291
+ G(() => {
292
+ r.length > u.current && s.current?.scrollIntoView({ behavior: "smooth" }), u.current = r.length;
293
+ }, [r.length]);
294
+ let d = W((e) => i(e), [i]), f = W((e) => a(e, "up"), [a]), p = W((e) => a(e, "down"), [a]), m = W((e) => l(e), []), h = W((e) => {
295
+ if (!c) return;
296
+ let { analysisConfig: t } = Tt(e);
297
+ if (t) {
298
+ let n = t.charts[t.analysisType];
299
+ o(c.id, {
300
+ title: e.title,
301
+ query: JSON.stringify(t.query),
302
+ chartType: n?.chartType || "bar",
303
+ chartConfig: n?.chartConfig,
304
+ displayConfig: n?.displayConfig
305
+ });
306
+ }
307
+ l(null);
308
+ }, [c, o]);
309
+ return r.length === 0 ? /* @__PURE__ */ Y("div", {
310
+ className: "dc:flex dc:items-center dc:justify-center dc:h-full",
311
+ children: /* @__PURE__ */ X("div", {
312
+ className: "dc:text-center dc:max-w-sm dc:px-6",
313
+ children: [/* @__PURE__ */ Y("h3", {
314
+ className: "dc:text-base dc:font-semibold text-dc-text dc:mb-2",
315
+ children: "Your notebook is empty"
316
+ }), /* @__PURE__ */ Y("p", {
317
+ className: "dc:text-sm text-dc-text-secondary",
318
+ children: "Ask the AI assistant a question about your data. Charts and insights will appear here as the assistant analyzes your data."
319
+ })]
320
+ })
321
+ }) : /* @__PURE__ */ X("div", {
322
+ className: "dc:h-full dc:overflow-y-auto dc:p-4",
323
+ children: [
324
+ r.map((e, t) => {
325
+ let i = t === 0, a = t === r.length - 1;
326
+ return e.type === "portlet" ? /* @__PURE__ */ Y(Ln, {
327
+ block: e,
328
+ colorPalette: n,
329
+ onRemove: d,
330
+ onMoveUp: f,
331
+ onMoveDown: p,
332
+ onEdit: m,
333
+ isFirst: i,
334
+ isLast: a
335
+ }, e.id) : e.type === "markdown" ? /* @__PURE__ */ Y(Wn, {
336
+ block: e,
337
+ onRemove: d,
338
+ onMoveUp: f,
339
+ onMoveDown: p,
340
+ isFirst: i,
341
+ isLast: a
342
+ }, e.id) : null;
343
+ }),
344
+ /* @__PURE__ */ Y("div", { ref: s }),
345
+ /* @__PURE__ */ Y(Ye, {
346
+ isOpen: !!c,
347
+ onClose: () => l(null),
348
+ onSave: h,
349
+ colorPalette: n,
350
+ portlet: c ? {
351
+ id: c.id,
352
+ title: c.title,
353
+ query: c.query,
354
+ chartType: c.chartType,
355
+ chartConfig: c.chartConfig,
356
+ displayConfig: c.displayConfig,
357
+ w: 5,
358
+ h: 4,
359
+ x: 0,
360
+ y: 0
361
+ } : null,
362
+ title: "Edit Visualization",
363
+ submitText: "Update"
364
+ })
365
+ ]
366
+ });
382
367
  });
383
- function et(t) {
384
- if (t.startsWith("{") || t.includes('"type":"error"'))
385
- try {
386
- const s = JSON.parse(t.replace(/^Error:\s*/, "")), c = s.error?.type || s.type || "";
387
- return {
388
- overloaded_error: "The AI service is temporarily busy. Please try again in a moment.",
389
- rate_limit_error: "Too many requests. Please wait a moment and try again.",
390
- api_error: "The AI service encountered an error. Please try again.",
391
- authentication_error: "Authentication failed. Please check your configuration."
392
- }[c] || "The AI service encountered an error. Please try again.";
393
- } catch {
394
- return "The AI service encountered an error. Please try again.";
395
- }
396
- if (t.startsWith("Agent request failed:")) {
397
- const s = t.match(/\d+/)?.[0];
398
- return s === "429" ? "Too many requests. Please wait a moment and try again." : s === "503" || s === "529" ? "The AI service is temporarily busy. Please try again in a moment." : "The AI service is temporarily unavailable. Please try again.";
399
- }
400
- return t;
368
+ //#endregion
369
+ //#region src/client/hooks/useAgentChat.ts
370
+ function Kn(e) {
371
+ if (e.startsWith("{") || e.includes("\"type\":\"error\"")) try {
372
+ let t = JSON.parse(e.replace(/^Error:\s*/, ""));
373
+ return {
374
+ overloaded_error: "The AI service is temporarily busy. Please try again in a moment.",
375
+ rate_limit_error: "Too many requests. Please wait a moment and try again.",
376
+ api_error: "The AI service encountered an error. Please try again.",
377
+ authentication_error: "Authentication failed. Please check your configuration."
378
+ }[t.error?.type || t.type || ""] || "The AI service encountered an error. Please try again.";
379
+ } catch {
380
+ return "The AI service encountered an error. Please try again.";
381
+ }
382
+ if (e.startsWith("Agent request failed:")) {
383
+ let t = e.match(/\d+/)?.[0];
384
+ return t === "429" ? "Too many requests. Please wait a moment and try again." : t === "503" || t === "529" ? "The AI service is temporarily busy. Please try again in a moment." : "The AI service is temporarily unavailable. Please try again.";
385
+ }
386
+ return e;
401
387
  }
402
- function tt(t) {
403
- const { agentEndpoint: s, agentApiKey: c, agentProvider: n, agentModel: a, agentProviderEndpoint: r } = t, { cubeApi: o } = Be(), i = x(null), [l, y] = _(!1), N = x(t);
404
- N.current = t;
405
- const S = p(async (k, O, R) => {
406
- function g(d) {
407
- const m = N.current;
408
- switch (d.type) {
409
- case "text_delta":
410
- m.onTextDelta(d.data);
411
- break;
412
- case "tool_use_start":
413
- m.onToolStart(d.data.id, d.data.name, d.data.input);
414
- break;
415
- case "tool_use_result":
416
- m.onToolResult(d.data.id, d.data.name, d.data.result, d.data.isError);
417
- break;
418
- case "add_portlet":
419
- m.onAddPortlet({
420
- ...d.data,
421
- type: "portlet"
422
- });
423
- break;
424
- case "add_markdown":
425
- m.onAddMarkdown({
426
- ...d.data,
427
- type: "markdown"
428
- });
429
- break;
430
- case "dashboard_saved":
431
- m.onDashboardSaved?.(d.data);
432
- break;
433
- case "turn_complete":
434
- m.onTurnComplete?.();
435
- break;
436
- case "done":
437
- m.onDone(d.data.sessionId, d.data.traceId);
438
- break;
439
- case "error":
440
- m.onError(d.data.message);
441
- break;
442
- }
443
- }
444
- i.current && i.current.abort();
445
- const A = new AbortController();
446
- i.current = A, y(!0);
447
- try {
448
- const d = o.apiUrl || "/cubejs-api/v1", m = s || `${d}/agent/chat`, b = {
449
- "Content-Type": "application/json",
450
- ...o.headers
451
- };
452
- c && (b["X-Agent-Api-Key"] = c), n && (b["X-Agent-Provider"] = n), a && (b["X-Agent-Model"] = a), r && (b["X-Agent-Provider-Endpoint"] = r);
453
- const T = await fetch(m, {
454
- method: "POST",
455
- headers: b,
456
- credentials: o.credentials ?? "include",
457
- body: JSON.stringify({
458
- message: k,
459
- ...O ? { sessionId: O } : {},
460
- ...R && R.length > 0 ? { history: R } : {}
461
- }),
462
- signal: A.signal
463
- });
464
- if (!T.ok) {
465
- const L = await T.json().catch(() => ({}));
466
- throw new Error(L.error || `Agent request failed: ${T.status}`);
467
- }
468
- if (!T.body)
469
- throw new Error("No response body received");
470
- const K = T.body.getReader(), $ = new TextDecoder();
471
- let P = "";
472
- for (; ; ) {
473
- const { done: L, value: E } = await K.read();
474
- if (L) break;
475
- P += $.decode(E, { stream: !0 });
476
- const C = P.split(`
477
-
478
- `);
479
- P = C.pop() || "";
480
- for (const w of C) {
481
- const I = w.trim().split(`
482
- `);
483
- for (const V of I)
484
- if (V.startsWith("data: "))
485
- try {
486
- const W = JSON.parse(V.slice(6));
487
- g(W);
488
- } catch {
489
- }
490
- }
491
- }
492
- if (P.trim()) {
493
- const L = P.trim().split(`
494
- `);
495
- for (const E of L)
496
- if (E.startsWith("data: "))
497
- try {
498
- const C = JSON.parse(E.slice(6));
499
- g(C);
500
- } catch {
501
- }
502
- }
503
- } catch (d) {
504
- if (d.name !== "AbortError") {
505
- const m = d instanceof Error ? d.message : "Stream failed";
506
- N.current.onError(et(m));
507
- }
508
- } finally {
509
- y(!1), i.current = null;
510
- }
511
- }, [o, s, c, n, a, r]), v = p(() => {
512
- i.current && (i.current.abort(), i.current = null, y(!1));
513
- }, []);
514
- return {
515
- sendMessage: S,
516
- isStreaming: l,
517
- abort: v
518
- };
388
+ function qn(e) {
389
+ let { agentEndpoint: t, agentApiKey: n, agentProvider: r, agentModel: i, agentProviderEndpoint: a } = e, { cubeApi: o } = v(), s = K(null), [c, l] = q(!1), u = K(e);
390
+ return u.current = e, {
391
+ sendMessage: W(async (e, c, d) => {
392
+ function f(e) {
393
+ let t = u.current;
394
+ switch (e.type) {
395
+ case "text_delta":
396
+ t.onTextDelta(e.data);
397
+ break;
398
+ case "tool_use_start":
399
+ t.onToolStart(e.data.id, e.data.name, e.data.input);
400
+ break;
401
+ case "tool_use_result":
402
+ t.onToolResult(e.data.id, e.data.name, e.data.result, e.data.isError);
403
+ break;
404
+ case "add_portlet":
405
+ t.onAddPortlet({
406
+ ...e.data,
407
+ type: "portlet"
408
+ });
409
+ break;
410
+ case "add_markdown":
411
+ t.onAddMarkdown({
412
+ ...e.data,
413
+ type: "markdown"
414
+ });
415
+ break;
416
+ case "dashboard_saved":
417
+ t.onDashboardSaved?.(e.data);
418
+ break;
419
+ case "turn_complete":
420
+ t.onTurnComplete?.();
421
+ break;
422
+ case "done":
423
+ t.onDone(e.data.sessionId, e.data.traceId);
424
+ break;
425
+ case "error":
426
+ t.onError(e.data.message);
427
+ break;
428
+ }
429
+ }
430
+ s.current && s.current.abort();
431
+ let p = new AbortController();
432
+ s.current = p, l(!0);
433
+ try {
434
+ let s = t || `${o.apiUrl || "/cubejs-api/v1"}/agent/chat`, l = {
435
+ "Content-Type": "application/json",
436
+ ...o.headers
437
+ };
438
+ n && (l["X-Agent-Api-Key"] = n), r && (l["X-Agent-Provider"] = r), i && (l["X-Agent-Model"] = i), a && (l["X-Agent-Provider-Endpoint"] = a);
439
+ let u = await fetch(s, {
440
+ method: "POST",
441
+ headers: l,
442
+ credentials: o.credentials ?? "include",
443
+ body: JSON.stringify({
444
+ message: e,
445
+ ...c ? { sessionId: c } : {},
446
+ ...d && d.length > 0 ? { history: d } : {}
447
+ }),
448
+ signal: p.signal
449
+ });
450
+ if (!u.ok) {
451
+ let e = await u.json().catch(() => ({}));
452
+ throw Error(e.error || `Agent request failed: ${u.status}`);
453
+ }
454
+ if (!u.body) throw Error("No response body received");
455
+ let m = u.body.getReader(), h = new TextDecoder(), g = "";
456
+ for (;;) {
457
+ let { done: e, value: t } = await m.read();
458
+ if (e) break;
459
+ g += h.decode(t, { stream: !0 });
460
+ let n = g.split("\n\n");
461
+ g = n.pop() || "";
462
+ for (let e of n) {
463
+ let t = e.trim().split("\n");
464
+ for (let e of t) if (e.startsWith("data: ")) try {
465
+ f(JSON.parse(e.slice(6)));
466
+ } catch {}
467
+ }
468
+ }
469
+ if (g.trim()) {
470
+ let e = g.trim().split("\n");
471
+ for (let t of e) if (t.startsWith("data: ")) try {
472
+ f(JSON.parse(t.slice(6)));
473
+ } catch {}
474
+ }
475
+ } catch (e) {
476
+ if (e.name !== "AbortError") {
477
+ let t = e instanceof Error ? e.message : "Stream failed";
478
+ u.current.onError(Kn(t));
479
+ }
480
+ } finally {
481
+ l(!1), s.current = null;
482
+ }
483
+ }, [
484
+ o,
485
+ t,
486
+ n,
487
+ r,
488
+ i,
489
+ a
490
+ ]),
491
+ isStreaming: c,
492
+ abort: W(() => {
493
+ s.current && (s.current.abort(), s.current = null, l(!1));
494
+ }, [])
495
+ };
519
496
  }
520
- function st(t) {
521
- const s = [];
522
- let c = t, n = 0;
523
- for (; c; ) {
524
- const a = c.match(/^(.*?)`([^`]+)`(.*)$/);
525
- if (a) {
526
- const [, o, i, l] = a;
527
- o && s.push(/* @__PURE__ */ e("span", { children: o }, n++)), s.push(
528
- /* @__PURE__ */ e("code", { className: "dc:px-1 dc:py-0.5 dc:rounded dc:text-xs bg-dc-surface dc:font-mono", children: i }, n++)
529
- ), c = l;
530
- continue;
531
- }
532
- const r = c.match(/^(.*?)\*\*([^*]+)\*\*(.*)$/);
533
- if (r) {
534
- const [, o, i, l] = r;
535
- o && s.push(/* @__PURE__ */ e("span", { children: o }, n++)), s.push(/* @__PURE__ */ e("strong", { className: "dc:font-semibold", children: i }, n++)), c = l;
536
- continue;
537
- }
538
- s.push(/* @__PURE__ */ e("span", { children: c }, n));
539
- break;
540
- }
541
- return s;
497
+ //#endregion
498
+ //#region src/client/components/AgenticNotebook/ChatMessage.tsx
499
+ function Jn(e) {
500
+ let t = [], n = e, r = 0;
501
+ for (; n;) {
502
+ let e = n.match(/^(.*?)`([^`]+)`(.*)$/);
503
+ if (e) {
504
+ let [, i, a, o] = e;
505
+ i && t.push(/* @__PURE__ */ Y("span", { children: i }, r++)), t.push(/* @__PURE__ */ Y("code", {
506
+ className: "dc:px-1 dc:py-0.5 dc:rounded dc:text-xs bg-dc-surface dc:font-mono",
507
+ children: a
508
+ }, r++)), n = o;
509
+ continue;
510
+ }
511
+ let i = n.match(/^(.*?)\*\*([^*]+)\*\*(.*)$/);
512
+ if (i) {
513
+ let [, e, a, o] = i;
514
+ e && t.push(/* @__PURE__ */ Y("span", { children: e }, r++)), t.push(/* @__PURE__ */ Y("strong", {
515
+ className: "dc:font-semibold",
516
+ children: a
517
+ }, r++)), n = o;
518
+ continue;
519
+ }
520
+ t.push(/* @__PURE__ */ Y("span", { children: n }, r));
521
+ break;
522
+ }
523
+ return t;
542
524
  }
543
- const ct = {
544
- discover_cubes: "Discovering cubes",
545
- get_cube_metadata: "Reading metadata",
546
- execute_query: "Executing query",
547
- add_portlet: "Adding visualization",
548
- add_markdown: "Adding explanation"
525
+ var Yn = {
526
+ discover_cubes: "Discovering cubes",
527
+ get_cube_metadata: "Reading metadata",
528
+ execute_query: "Executing query",
529
+ add_portlet: "Adding visualization",
530
+ add_markdown: "Adding explanation"
549
531
  };
550
- function rt({ toolCall: t, loadingComponent: s }) {
551
- const [c, n] = _(!1), a = ct[t.name] || t.name, r = t.status === "running";
552
- return /* @__PURE__ */ u("div", { className: "dc:my-1 dc:text-xs", children: [
553
- /* @__PURE__ */ u(
554
- "button",
555
- {
556
- onClick: () => n(!c),
557
- className: "dc:flex dc:items-center dc:gap-1.5 text-dc-text-secondary dc:hover:opacity-80 dc:transition-opacity",
558
- children: [
559
- r ? s ? /* @__PURE__ */ e("span", { className: "dc:inline-flex dc:items-center dc:justify-center dc:h-3 dc:w-3", children: s }) : /* @__PURE__ */ e(he, { size: "xs" }) : /* @__PURE__ */ e("span", { className: "dc:text-xs", children: t.status === "error" ? "✗" : "✓" }),
560
- /* @__PURE__ */ u("span", { children: [
561
- a,
562
- r ? "..." : ""
563
- ] }),
564
- !r && /* @__PURE__ */ e("span", { className: "dc:text-[10px] dc:opacity-60", children: c ? "▲" : "▼" })
565
- ]
566
- }
567
- ),
568
- c && t.result != null && /* @__PURE__ */ e("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 t.result == "string" ? t.result : JSON.stringify(t.result, null, 2) })
569
- ] });
532
+ function Xn({ toolCall: e, loadingComponent: t }) {
533
+ let [n, r] = q(!1), i = Yn[e.name] || e.name, a = e.status === "running";
534
+ return /* @__PURE__ */ X("div", {
535
+ className: "dc:my-1 dc:text-xs",
536
+ children: [/* @__PURE__ */ X("button", {
537
+ onClick: () => r(!n),
538
+ className: "dc:flex dc:items-center dc:gap-1.5 text-dc-text-secondary dc:hover:opacity-80 dc:transition-opacity",
539
+ children: [
540
+ a ? t ? /* @__PURE__ */ Y("span", {
541
+ className: "dc:inline-flex dc:items-center dc:justify-center dc:h-3 dc:w-3",
542
+ children: t
543
+ }) : /* @__PURE__ */ Y(at, { size: "xs" }) : /* @__PURE__ */ Y("span", {
544
+ className: "dc:text-xs",
545
+ children: e.status === "error" ? "✗" : "✓"
546
+ }),
547
+ /* @__PURE__ */ X("span", { children: [i, a ? "..." : ""] }),
548
+ !a && /* @__PURE__ */ Y("span", {
549
+ className: "dc:text-[10px] dc:opacity-60",
550
+ children: n ? "" : ""
551
+ })
552
+ ]
553
+ }), n && e.result != null && /* @__PURE__ */ Y("pre", {
554
+ 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",
555
+ children: typeof e.result == "string" ? e.result : JSON.stringify(e.result, null, 2)
556
+ })]
557
+ });
570
558
  }
571
- const nt = {
572
- animation: "dc-msg-in 100ms ease-out"
573
- }, at = G.memo(function({ message: s, loadingComponent: c }) {
574
- const n = s.role === "user", a = !!s.content?.trim(), r = !!s.error, o = s.toolCalls && s.toolCalls.length > 0;
575
- return !n && !a && !r && !o ? null : /* @__PURE__ */ e(
576
- "div",
577
- {
578
- className: `dc:flex dc:mb-3 ${n ? "dc:justify-end" : "dc:justify-start"}`,
579
- style: nt,
580
- children: /* @__PURE__ */ u(
581
- "div",
582
- {
583
- className: `dc:max-w-[85%] dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm ${n ? "bg-dc-accent text-dc-accent-text dc:rounded-br-sm" : r && !a ? "bg-dc-warning-bg text-dc-text dc:rounded-bl-sm" : "bg-dc-surface-secondary text-dc-text dc:rounded-bl-sm"}`,
584
- children: [
585
- a && /* @__PURE__ */ e("div", { className: "dc:whitespace-pre-wrap dc:break-words", children: n ? s.content : st(s.content) }),
586
- r && /* @__PURE__ */ u("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: [
587
- /* @__PURE__ */ e("span", { className: "dc:text-base dc:leading-none dc:mt-0.5 text-dc-warning dc:flex-shrink-0", children: "⚠" }),
588
- /* @__PURE__ */ e("span", { className: "text-dc-text-secondary", children: s.error })
589
- ] }),
590
- o && /* @__PURE__ */ e("div", { className: a || r ? "dc:mt-1 dc:border-t dc:border-current dc:border-opacity-10 dc:pt-1" : "", children: s.toolCalls.map((i, l) => /* @__PURE__ */ e(rt, { toolCall: i, loadingComponent: c }, i.id || l)) })
591
- ]
592
- }
593
- )
594
- }
595
- );
596
- }), ot = G.memo(function({
597
- value: s,
598
- onChange: c,
599
- onSend: n,
600
- onStop: a,
601
- onContinue: r,
602
- isStreaming: o = !1,
603
- showContinue: i = !1,
604
- disabled: l = !1,
605
- placeholder: y = "Ask about your data..."
606
- }) {
607
- const N = x(null);
608
- Q(() => {
609
- const v = N.current;
610
- v && (v.style.height = "auto", v.style.height = `${Math.min(v.scrollHeight, 150)}px`);
611
- }, [s]);
612
- const S = p(
613
- (v) => {
614
- v.key === "Enter" && !v.shiftKey && (v.preventDefault(), !l && s.trim() && n());
615
- },
616
- [l, s, n]
617
- );
618
- return /* @__PURE__ */ u("div", { className: "dc:flex dc:gap-2 dc:items-end dc:p-3 border-dc-border dc:border-t", children: [
619
- /* @__PURE__ */ e(
620
- "textarea",
621
- {
622
- ref: N,
623
- value: s,
624
- onChange: (v) => c(v.target.value),
625
- onKeyDown: S,
626
- placeholder: y,
627
- disabled: l,
628
- rows: 1,
629
- 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"
630
- }
631
- ),
632
- o ? /* @__PURE__ */ e(
633
- "button",
634
- {
635
- onClick: a,
636
- 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",
637
- children: "Stop"
638
- }
639
- ) : /* @__PURE__ */ u(ae, { children: [
640
- i && !s.trim() && /* @__PURE__ */ e(
641
- "button",
642
- {
643
- onClick: () => {
644
- r?.(), N.current?.focus();
645
- },
646
- 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",
647
- children: "Continue"
648
- }
649
- ),
650
- /* @__PURE__ */ e(
651
- "button",
652
- {
653
- onClick: n,
654
- disabled: l || !s.trim(),
655
- 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",
656
- children: "Send"
657
- }
658
- )
659
- ] })
660
- ] });
661
- }), dt = M("thumbUp"), lt = M("thumbDown"), it = G.memo(function({
662
- agentEndpoint: s,
663
- agentApiKey: c,
664
- agentProvider: n,
665
- agentModel: a,
666
- agentProviderEndpoint: r,
667
- onClear: o,
668
- onDashboardSaved: i,
669
- onScore: l,
670
- loadingComponent: y,
671
- initialPrompt: N
672
- }) {
673
- const S = x(null), v = x(!1), [k, O] = _(null), [R, g] = _(/* @__PURE__ */ new Set()), [A, d] = _(!1), m = x(!1), { messages: b, isStreaming: T, inputValue: K } = B(le(Ve)), {
674
- addMessage: $,
675
- appendToLastAssistantMessage: P,
676
- setLastAssistantError: L,
677
- addToolCallToLastAssistant: E,
678
- updateLastToolCall: C,
679
- setIsStreaming: w,
680
- setInputValue: I,
681
- setSessionId: V
682
- } = B(le(je)), W = B((h) => h.sessionId), z = B((h) => h.addBlock), H = B((h) => h.reset), Z = B((h) => h.blocks.filter((F) => F.type === "portlet").length), D = x(b);
683
- D.current = b;
684
- const J = x(T);
685
- J.current = T;
686
- const j = x(W);
687
- j.current = W;
688
- const U = p(() => {
689
- m.current && (m.current = !1, $({
690
- id: `msg-${Date.now()}`,
691
- role: "assistant",
692
- content: "",
693
- toolCalls: [],
694
- timestamp: Date.now()
695
- }));
696
- }, [$]), ee = x(b.length);
697
- Q(() => {
698
- b.length > ee.current && S.current?.scrollIntoView({ behavior: "smooth" }), ee.current = b.length;
699
- }, [b]), Q(() => {
700
- A && S.current?.scrollIntoView({ behavior: "smooth" });
701
- }, [A]);
702
- const { sendMessage: te, abort: X } = tt({
703
- agentEndpoint: s,
704
- agentApiKey: c,
705
- agentProvider: n,
706
- agentModel: a,
707
- agentProviderEndpoint: r,
708
- onTextDelta: p((h) => {
709
- d(!1), U(), P(h);
710
- }, [U, P]),
711
- onToolStart: p((h, F, q) => {
712
- d(!1), U(), E({ id: h, name: F, input: q, status: "running" });
713
- }, [U, E]),
714
- onToolResult: p((h, F, q, ye) => {
715
- C({ id: h, status: ye ? "error" : "complete", result: q });
716
- }, [C]),
717
- onAddPortlet: p((h) => {
718
- z(h);
719
- }, [z]),
720
- onAddMarkdown: p((h) => {
721
- z(h);
722
- }, [z]),
723
- onDashboardSaved: i,
724
- onTurnComplete: p(() => {
725
- m.current = !0, d(!0);
726
- }, []),
727
- onDone: p((h, F) => {
728
- m.current = !1, V(h), w(!1), d(!1), F && O(F);
729
- }, [V, w]),
730
- onError: p((h) => {
731
- d(!1), U(), L(h), w(!1);
732
- }, [U, L, w])
733
- }), f = p((h) => {
734
- if (!h || J.current) return;
735
- m.current = !1;
736
- const F = D.current.map((q) => ({
737
- role: q.role,
738
- content: q.content,
739
- ...q.toolCalls && q.toolCalls.length > 0 ? { toolCalls: q.toolCalls } : {}
740
- }));
741
- $({
742
- id: `msg-${Date.now()}`,
743
- role: "user",
744
- content: h,
745
- timestamp: Date.now()
746
- }), $({
747
- id: `msg-${Date.now() + 1}`,
748
- role: "assistant",
749
- content: "",
750
- toolCalls: [],
751
- timestamp: Date.now()
752
- }), I(""), w(!0), d(!0), te(h, j.current, F);
753
- }, [$, I, w, te]);
754
- Q(() => {
755
- if (N && !v.current && b.length === 0) {
756
- v.current = !0;
757
- const h = setTimeout(() => f(N), 100);
758
- return () => {
759
- clearTimeout(h), v.current = !1;
760
- };
761
- }
762
- }, [N, b.length, f]);
763
- const Y = x(K);
764
- Y.current = K;
765
- const se = p(() => {
766
- f(Y.current.trim());
767
- }, [f]), oe = p(() => {
768
- X(), w(!1);
769
- }, [X, w]), ce = p(() => {
770
- I("");
771
- }, [I]), de = p(() => {
772
- X(), w(!1), d(!1), H(), O(null), g(/* @__PURE__ */ new Set()), o?.();
773
- }, [X, w, H, o]), ge = p(() => {
774
- f(
775
- "Save the current notebook as a dashboard with a professional layout, section headers, and appropriate filters."
776
- );
777
- }, [f]), ie = p((h) => {
778
- !k || !l || (l({ traceId: k, value: h }), g((F) => new Set(F).add(k)));
779
- }, [k, l]), be = !!i && !T && Z > 0 && b.length > 0, xe = !!l && !T && k && b.length > 0 && !R.has(k), ue = k ? R.has(k) : !1;
780
- return /* @__PURE__ */ u("div", { className: "dc:flex dc:flex-col dc:h-full bg-dc-surface", children: [
781
- /* @__PURE__ */ u("div", { className: "dc:flex dc:items-center dc:justify-between dc:px-4 dc:py-3 border-dc-border dc:border-b", children: [
782
- /* @__PURE__ */ e("h3", { className: "dc:text-sm dc:font-semibold text-dc-text", children: "AI Assistant" }),
783
- /* @__PURE__ */ u("div", { className: "dc:flex dc:items-center dc:gap-1", children: [
784
- be && /* @__PURE__ */ e(
785
- "button",
786
- {
787
- onClick: ge,
788
- className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-accent dc:hover:opacity-80",
789
- title: "Save notebook as a dashboard",
790
- children: "Save as Dashboard"
791
- }
792
- ),
793
- b.length > 0 && /* @__PURE__ */ e(
794
- "button",
795
- {
796
- onClick: de,
797
- disabled: T,
798
- className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-text-secondary dc:hover:opacity-80 dc:disabled:opacity-40",
799
- title: "Clear notebook and chat",
800
- children: "Clear"
801
- }
802
- )
803
- ] })
804
- ] }),
805
- /* @__PURE__ */ u("div", { className: "dc:flex-1 dc:overflow-y-auto dc:px-4 dc:py-3", children: [
806
- b.length === 0 ? /* @__PURE__ */ e(mt, {}) : b.map((h) => /* @__PURE__ */ e(
807
- at,
808
- {
809
- message: h,
810
- loadingComponent: y
811
- },
812
- h.id
813
- )),
814
- A && /* @__PURE__ */ e(ut, { loadingComponent: y }),
815
- (xe || ue) && /* @__PURE__ */ e("div", { className: "dc:flex dc:items-center dc:justify-center dc:gap-3 dc:py-4 dc:mt-2", children: ue ? /* @__PURE__ */ e("span", { className: "dc:text-sm text-dc-text-secondary", children: "Thanks for your feedback!" }) : /* @__PURE__ */ u(ae, { children: [
816
- /* @__PURE__ */ e("span", { className: "dc:text-sm text-dc-text-secondary", children: "Was this helpful?" }),
817
- /* @__PURE__ */ u("div", { className: "dc:flex dc:items-center dc:gap-2", children: [
818
- /* @__PURE__ */ u(
819
- "button",
820
- {
821
- onClick: () => ie(1),
822
- className: "dc:flex dc:items-center dc:gap-1.5 dc:px-3 dc:py-1.5 dc:rounded-lg dc:text-sm dc:font-medium border-dc-border dc:border text-dc-success hover:bg-dc-success-bg dc:transition-colors bg-dc-surface dc:cursor-pointer",
823
- children: [
824
- /* @__PURE__ */ e(dt, { className: "dc:w-4 dc:h-4" }),
825
- "Yes"
826
- ]
827
- }
828
- ),
829
- /* @__PURE__ */ u(
830
- "button",
831
- {
832
- onClick: () => ie(0),
833
- className: "dc:flex dc:items-center dc:gap-1.5 dc:px-3 dc:py-1.5 dc:rounded-lg dc:text-sm dc:font-medium border-dc-border dc:border text-dc-error hover:bg-dc-danger-bg dc:transition-colors bg-dc-surface dc:cursor-pointer",
834
- children: [
835
- /* @__PURE__ */ e(lt, { className: "dc:w-4 dc:h-4" }),
836
- "No"
837
- ]
838
- }
839
- )
840
- ] })
841
- ] }) }),
842
- /* @__PURE__ */ e("div", { ref: S })
843
- ] }),
844
- /* @__PURE__ */ e(
845
- ot,
846
- {
847
- value: K,
848
- onChange: I,
849
- onSend: se,
850
- onStop: oe,
851
- onContinue: ce,
852
- isStreaming: T,
853
- showContinue: !T && b.length > 0
854
- }
855
- )
856
- ] });
559
+ var Zn = { animation: "dc-msg-in 100ms ease-out" }, Qn = U.memo(function({ message: e, loadingComponent: t }) {
560
+ let n = e.role === "user", r = !!e.content?.trim(), i = !!e.error, a = e.toolCalls && e.toolCalls.length > 0;
561
+ return !n && !r && !i && !a ? null : /* @__PURE__ */ Y("div", {
562
+ className: `dc:flex dc:mb-3 ${n ? "dc:justify-end" : "dc:justify-start"}`,
563
+ style: Zn,
564
+ children: /* @__PURE__ */ X("div", {
565
+ className: `dc:max-w-[85%] dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm ${n ? "bg-dc-accent text-dc-accent-text dc:rounded-br-sm" : i && !r ? "bg-dc-warning-bg text-dc-text dc:rounded-bl-sm" : "bg-dc-surface-secondary text-dc-text dc:rounded-bl-sm"}`,
566
+ children: [
567
+ r && /* @__PURE__ */ Y("div", {
568
+ className: "dc:whitespace-pre-wrap dc:break-words",
569
+ children: n ? e.content : Jn(e.content)
570
+ }),
571
+ i && /* @__PURE__ */ X("div", {
572
+ className: `dc:flex dc:items-start dc:gap-2 ${r ? "dc:mt-2 dc:pt-2 dc:border-t dc:border-current dc:border-opacity-10" : ""}`,
573
+ children: [/* @__PURE__ */ Y("span", {
574
+ className: "dc:text-base dc:leading-none dc:mt-0.5 text-dc-warning dc:flex-shrink-0",
575
+ children: "⚠"
576
+ }), /* @__PURE__ */ Y("span", {
577
+ className: "text-dc-text-secondary",
578
+ children: e.error
579
+ })]
580
+ }),
581
+ a && /* @__PURE__ */ Y("div", {
582
+ className: r || i ? "dc:mt-1 dc:border-t dc:border-current dc:border-opacity-10 dc:pt-1" : "",
583
+ children: e.toolCalls.map((e, n) => /* @__PURE__ */ Y(Xn, {
584
+ toolCall: e,
585
+ loadingComponent: t
586
+ }, e.id || n))
587
+ })
588
+ ]
589
+ })
590
+ });
591
+ }), $n = U.memo(function({ value: e, onChange: t, onSend: n, onStop: r, onContinue: i, isStreaming: a = !1, showContinue: o = !1, disabled: s = !1, placeholder: c = "Ask about your data..." }) {
592
+ let l = K(null);
593
+ return G(() => {
594
+ let e = l.current;
595
+ e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 150)}px`);
596
+ }, [e]), /* @__PURE__ */ X("div", {
597
+ className: "dc:flex dc:gap-2 dc:items-end dc:p-3 border-dc-border dc:border-t",
598
+ children: [/* @__PURE__ */ Y("textarea", {
599
+ ref: l,
600
+ value: e,
601
+ onChange: (e) => t(e.target.value),
602
+ onKeyDown: W((t) => {
603
+ t.key === "Enter" && !t.shiftKey && (t.preventDefault(), !s && e.trim() && n());
604
+ }, [
605
+ s,
606
+ e,
607
+ n
608
+ ]),
609
+ placeholder: c,
610
+ disabled: s,
611
+ rows: 1,
612
+ 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"
613
+ }), a ? /* @__PURE__ */ Y("button", {
614
+ onClick: r,
615
+ 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
+ children: "Stop"
617
+ }) : /* @__PURE__ */ X(J, { children: [o && !e.trim() && /* @__PURE__ */ Y("button", {
618
+ onClick: () => {
619
+ i?.(), l.current?.focus();
620
+ },
621
+ 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",
622
+ children: "Continue"
623
+ }), /* @__PURE__ */ Y("button", {
624
+ onClick: n,
625
+ disabled: s || !e.trim(),
626
+ 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",
627
+ children: "Send"
628
+ })] })]
629
+ });
630
+ }), er = p("thumbUp"), tr = p("thumbDown"), nr = U.memo(function({ agentEndpoint: e, agentApiKey: n, agentProvider: r, agentModel: i, agentProviderEndpoint: a, onClear: o, onDashboardSaved: s, onScore: c, loadingComponent: l, initialPrompt: u }) {
631
+ let d = K(null), f = K(!1), [p, m] = q(null), [h, g] = q(/* @__PURE__ */ new Set()), [_, v] = q(!1), y = K(!1), { messages: b, isStreaming: x, inputValue: S } = Z(t(An)), { addMessage: C, appendToLastAssistantMessage: w, setLastAssistantError: T, addToolCallToLastAssistant: E, updateLastToolCall: D, setIsStreaming: O, setInputValue: k, setSessionId: A } = Z(t(jn)), j = Z((e) => e.sessionId), M = Z((e) => e.addBlock), N = Z((e) => e.reset), P = Z((e) => e.blocks.filter((e) => e.type === "portlet").length), F = K(b);
632
+ F.current = b;
633
+ let I = K(x);
634
+ I.current = x;
635
+ let L = K(j);
636
+ L.current = j;
637
+ let R = W(() => {
638
+ y.current && (y.current = !1, C({
639
+ id: `msg-${Date.now()}`,
640
+ role: "assistant",
641
+ content: "",
642
+ toolCalls: [],
643
+ timestamp: Date.now()
644
+ }));
645
+ }, [C]), z = K(b.length);
646
+ G(() => {
647
+ b.length > z.current && d.current?.scrollIntoView({ behavior: "smooth" }), z.current = b.length;
648
+ }, [b]), G(() => {
649
+ _ && d.current?.scrollIntoView({ behavior: "smooth" });
650
+ }, [_]);
651
+ let { sendMessage: B, abort: V } = qn({
652
+ agentEndpoint: e,
653
+ agentApiKey: n,
654
+ agentProvider: r,
655
+ agentModel: i,
656
+ agentProviderEndpoint: a,
657
+ onTextDelta: W((e) => {
658
+ v(!1), R(), w(e);
659
+ }, [R, w]),
660
+ onToolStart: W((e, t, n) => {
661
+ v(!1), R(), E({
662
+ id: e,
663
+ name: t,
664
+ input: n,
665
+ status: "running"
666
+ });
667
+ }, [R, E]),
668
+ onToolResult: W((e, t, n, r) => {
669
+ D({
670
+ id: e,
671
+ status: r ? "error" : "complete",
672
+ result: n
673
+ });
674
+ }, [D]),
675
+ onAddPortlet: W((e) => {
676
+ M(e);
677
+ }, [M]),
678
+ onAddMarkdown: W((e) => {
679
+ M(e);
680
+ }, [M]),
681
+ onDashboardSaved: s,
682
+ onTurnComplete: W(() => {
683
+ y.current = !0, v(!0);
684
+ }, []),
685
+ onDone: W((e, t) => {
686
+ y.current = !1, A(e), O(!1), v(!1), t && m(t);
687
+ }, [A, O]),
688
+ onError: W((e) => {
689
+ v(!1), R(), T(e), O(!1);
690
+ }, [
691
+ R,
692
+ T,
693
+ O
694
+ ])
695
+ }), H = W((e) => {
696
+ if (!e || I.current) return;
697
+ y.current = !1;
698
+ let t = F.current.map((e) => ({
699
+ role: e.role,
700
+ content: e.content,
701
+ ...e.toolCalls && e.toolCalls.length > 0 ? { toolCalls: e.toolCalls } : {}
702
+ }));
703
+ C({
704
+ id: `msg-${Date.now()}`,
705
+ role: "user",
706
+ content: e,
707
+ timestamp: Date.now()
708
+ }), C({
709
+ id: `msg-${Date.now() + 1}`,
710
+ role: "assistant",
711
+ content: "",
712
+ toolCalls: [],
713
+ timestamp: Date.now()
714
+ }), k(""), O(!0), v(!0), B(e, L.current, t);
715
+ }, [
716
+ C,
717
+ k,
718
+ O,
719
+ B
720
+ ]);
721
+ G(() => {
722
+ if (u && !f.current && b.length === 0) {
723
+ f.current = !0;
724
+ let e = setTimeout(() => H(u), 100);
725
+ return () => {
726
+ clearTimeout(e), f.current = !1;
727
+ };
728
+ }
729
+ }, [
730
+ u,
731
+ b.length,
732
+ H
733
+ ]);
734
+ let ee = K(S);
735
+ ee.current = S;
736
+ let te = W(() => {
737
+ H(ee.current.trim());
738
+ }, [H]), ne = W(() => {
739
+ V(), O(!1);
740
+ }, [V, O]), re = W(() => {
741
+ k("");
742
+ }, [k]), ie = W(() => {
743
+ V(), O(!1), v(!1), N(), m(null), g(/* @__PURE__ */ new Set()), o?.();
744
+ }, [
745
+ V,
746
+ O,
747
+ N,
748
+ o
749
+ ]), ae = W(() => {
750
+ H("Save the current notebook as a dashboard with a professional layout, section headers, and appropriate filters.");
751
+ }, [H]), oe = W((e) => {
752
+ !p || !c || (c({
753
+ traceId: p,
754
+ value: e
755
+ }), g((e) => new Set(e).add(p)));
756
+ }, [p, c]), se = !!s && !x && P > 0 && b.length > 0, ce = !!c && !x && p && b.length > 0 && !h.has(p), le = p ? h.has(p) : !1;
757
+ return /* @__PURE__ */ X("div", {
758
+ className: "dc:flex dc:flex-col dc:h-full bg-dc-surface",
759
+ children: [
760
+ /* @__PURE__ */ X("div", {
761
+ className: "dc:flex dc:items-center dc:justify-between dc:px-4 dc:py-3 border-dc-border dc:border-b",
762
+ children: [/* @__PURE__ */ Y("h3", {
763
+ className: "dc:text-sm dc:font-semibold text-dc-text",
764
+ children: "AI Assistant"
765
+ }), /* @__PURE__ */ X("div", {
766
+ className: "dc:flex dc:items-center dc:gap-1",
767
+ children: [se && /* @__PURE__ */ Y("button", {
768
+ onClick: ae,
769
+ className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-accent dc:hover:opacity-80",
770
+ title: "Save notebook as a dashboard",
771
+ children: "Save as Dashboard"
772
+ }), b.length > 0 && /* @__PURE__ */ Y("button", {
773
+ onClick: ie,
774
+ disabled: x,
775
+ className: "dc:text-xs dc:px-2 dc:py-1 dc:rounded text-dc-text-secondary dc:hover:opacity-80 dc:disabled:opacity-40",
776
+ title: "Clear notebook and chat",
777
+ children: "Clear"
778
+ })]
779
+ })]
780
+ }),
781
+ /* @__PURE__ */ X("div", {
782
+ className: "dc:flex-1 dc:overflow-y-auto dc:px-4 dc:py-3",
783
+ children: [
784
+ b.length === 0 ? /* @__PURE__ */ Y(ir, {}) : b.map((e) => /* @__PURE__ */ Y(Qn, {
785
+ message: e,
786
+ loadingComponent: l
787
+ }, e.id)),
788
+ _ && /* @__PURE__ */ Y(rr, { loadingComponent: l }),
789
+ (ce || le) && /* @__PURE__ */ Y("div", {
790
+ className: "dc:flex dc:items-center dc:justify-center dc:gap-3 dc:py-4 dc:mt-2",
791
+ children: le ? /* @__PURE__ */ Y("span", {
792
+ className: "dc:text-sm text-dc-text-secondary",
793
+ children: "Thanks for your feedback!"
794
+ }) : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("span", {
795
+ className: "dc:text-sm text-dc-text-secondary",
796
+ children: "Was this helpful?"
797
+ }), /* @__PURE__ */ X("div", {
798
+ className: "dc:flex dc:items-center dc:gap-2",
799
+ children: [/* @__PURE__ */ X("button", {
800
+ onClick: () => oe(1),
801
+ className: "dc:flex dc:items-center dc:gap-1.5 dc:px-3 dc:py-1.5 dc:rounded-lg dc:text-sm dc:font-medium border-dc-border dc:border text-dc-success hover:bg-dc-success-bg dc:transition-colors bg-dc-surface dc:cursor-pointer",
802
+ children: [/* @__PURE__ */ Y(er, { className: "dc:w-4 dc:h-4" }), "Yes"]
803
+ }), /* @__PURE__ */ X("button", {
804
+ onClick: () => oe(0),
805
+ className: "dc:flex dc:items-center dc:gap-1.5 dc:px-3 dc:py-1.5 dc:rounded-lg dc:text-sm dc:font-medium border-dc-border dc:border text-dc-error hover:bg-dc-danger-bg dc:transition-colors bg-dc-surface dc:cursor-pointer",
806
+ children: [/* @__PURE__ */ Y(tr, { className: "dc:w-4 dc:h-4" }), "No"]
807
+ })]
808
+ })] })
809
+ }),
810
+ /* @__PURE__ */ Y("div", { ref: d })
811
+ ]
812
+ }),
813
+ /* @__PURE__ */ Y($n, {
814
+ value: S,
815
+ onChange: k,
816
+ onSend: te,
817
+ onStop: ne,
818
+ onContinue: re,
819
+ isStreaming: x,
820
+ showContinue: !x && b.length > 0
821
+ })
822
+ ]
823
+ });
857
824
  });
858
- function ut({ loadingComponent: t }) {
859
- return /* @__PURE__ */ e(
860
- "div",
861
- {
862
- className: "dc:flex dc:mb-3 dc:justify-start",
863
- style: { animation: "dc-msg-in 100ms ease-out" },
864
- children: /* @__PURE__ */ u("div", { className: "dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm bg-dc-surface-secondary text-dc-text-secondary dc:rounded-bl-sm dc:flex dc:items-center dc:gap-2", children: [
865
- t ? /* @__PURE__ */ e("span", { className: "dc:inline-flex dc:items-center dc:justify-center dc:h-4 dc:w-4", children: t }) : /* @__PURE__ */ e(he, { size: "xs" }),
866
- /* @__PURE__ */ e("span", { children: "Thinking..." })
867
- ] })
868
- }
869
- );
825
+ function rr({ loadingComponent: e }) {
826
+ return /* @__PURE__ */ Y("div", {
827
+ className: "dc:flex dc:mb-3 dc:justify-start",
828
+ style: { animation: "dc-msg-in 100ms ease-out" },
829
+ children: /* @__PURE__ */ X("div", {
830
+ className: "dc:rounded-lg dc:px-3 dc:py-2 dc:text-sm bg-dc-surface-secondary text-dc-text-secondary dc:rounded-bl-sm dc:flex dc:items-center dc:gap-2",
831
+ children: [e ? /* @__PURE__ */ Y("span", {
832
+ className: "dc:inline-flex dc:items-center dc:justify-center dc:h-4 dc:w-4",
833
+ children: e
834
+ }) : /* @__PURE__ */ Y(at, { size: "xs" }), /* @__PURE__ */ Y("span", { children: "Thinking..." })]
835
+ })
836
+ });
870
837
  }
871
- function mt() {
872
- return /* @__PURE__ */ e("div", { className: "dc:flex dc:items-center dc:justify-center dc:h-full", children: /* @__PURE__ */ u("div", { className: "dc:text-center dc:max-w-xs", children: [
873
- /* @__PURE__ */ e("div", { className: "dc:text-lg dc:font-semibold text-dc-text dc:mb-2", children: "Data Analysis Assistant" }),
874
- /* @__PURE__ */ e("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." }),
875
- /* @__PURE__ */ u("div", { className: "dc:space-y-2 dc:text-xs text-dc-text-muted", children: [
876
- /* @__PURE__ */ e("p", { children: '"Show me employee productivity trends"' }),
877
- /* @__PURE__ */ e("p", { children: '"What are the top departments by headcount?"' }),
878
- /* @__PURE__ */ e("p", { children: '"Compare revenue across product categories"' })
879
- ] })
880
- ] }) });
838
+ function ir() {
839
+ return /* @__PURE__ */ Y("div", {
840
+ className: "dc:flex dc:items-center dc:justify-center dc:h-full",
841
+ children: /* @__PURE__ */ X("div", {
842
+ className: "dc:text-center dc:max-w-xs",
843
+ children: [
844
+ /* @__PURE__ */ Y("div", {
845
+ className: "dc:text-lg dc:font-semibold text-dc-text dc:mb-2",
846
+ children: "Data Analysis Assistant"
847
+ }),
848
+ /* @__PURE__ */ Y("p", {
849
+ className: "dc:text-sm text-dc-text-secondary dc:mb-4",
850
+ children: "Ask me about your data and I'll create visualizations and insights."
851
+ }),
852
+ /* @__PURE__ */ X("div", {
853
+ className: "dc:space-y-2 dc:text-xs text-dc-text-muted",
854
+ children: [
855
+ /* @__PURE__ */ Y("p", { children: "\"Show me employee productivity trends\"" }),
856
+ /* @__PURE__ */ Y("p", { children: "\"What are the top departments by headcount?\"" }),
857
+ /* @__PURE__ */ Y("p", { children: "\"Compare revenue across product categories\"" })
858
+ ]
859
+ })
860
+ ]
861
+ })
862
+ });
881
863
  }
882
- function ht({
883
- blocks: t,
884
- pulsingBlockId: s,
885
- nudge: c,
886
- onExpand: n
887
- }) {
888
- const a = M("bookOpen"), r = M("documentText");
889
- return /* @__PURE__ */ u(
890
- "button",
891
- {
892
- type: "button",
893
- onClick: n,
894
- className: "dc:h-full dc:flex-shrink-0 dc:flex dc:flex-col dc:items-center dc:pt-3 dc:gap-2 bg-dc-surface border-dc-border dc:border-r dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
895
- style: c ? { animation: "dc-strip-nudge 0.8s ease-in-out 2", width: 48 } : { width: 48 },
896
- title: "Expand notebook",
897
- children: [
898
- /* @__PURE__ */ e(a, { className: "dc:w-5 dc:h-5 text-dc-text-muted" }),
899
- /* @__PURE__ */ e(
900
- "div",
901
- {
902
- className: "dc:flex dc:flex-col dc:items-center dc:gap-1.5 dc:flex-1 dc:overflow-y-auto dc:py-1",
903
- style: { scrollbarWidth: "none" },
904
- children: t.length === 0 ? /* @__PURE__ */ e(
905
- "span",
906
- {
907
- className: "dc:text-[9px] text-dc-text-disabled dc:writing-vertical-lr dc:mt-2",
908
- style: { writingMode: "vertical-lr" },
909
- children: "No blocks"
910
- }
911
- ) : t.map((o) => {
912
- const i = o.id === s;
913
- let l;
914
- return o.type === "portlet" ? l = Ee(o.chartType) : l = r, /* @__PURE__ */ e(
915
- "div",
916
- {
917
- className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded",
918
- style: i ? { animation: "dc-icon-pulse 0.6s ease-in-out 3" } : void 0,
919
- title: o.type === "portlet" ? o.title : o.title || "Markdown",
920
- children: /* @__PURE__ */ e(l, { className: "dc:w-4 dc:h-4 text-dc-text-muted" })
921
- },
922
- o.id
923
- );
924
- })
925
- }
926
- )
927
- ]
928
- }
929
- );
864
+ //#endregion
865
+ //#region src/client/components/AgenticNotebook/index.tsx
866
+ function ar({ blocks: e, pulsingBlockId: t, nudge: n, onExpand: r }) {
867
+ let i = p("bookOpen"), a = p("documentText");
868
+ return /* @__PURE__ */ X("button", {
869
+ type: "button",
870
+ onClick: r,
871
+ className: "dc:h-full dc:flex-shrink-0 dc:flex dc:flex-col dc:items-center dc:pt-3 dc:gap-2 bg-dc-surface border-dc-border dc:border-r dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
872
+ style: n ? {
873
+ animation: "dc-strip-nudge 0.8s ease-in-out 2",
874
+ width: 48
875
+ } : { width: 48 },
876
+ title: "Expand notebook",
877
+ children: [/* @__PURE__ */ Y(i, { className: "dc:w-5 dc:h-5 text-dc-text-muted" }), /* @__PURE__ */ Y("div", {
878
+ className: "dc:flex dc:flex-col dc:items-center dc:gap-1.5 dc:flex-1 dc:overflow-y-auto dc:py-1",
879
+ style: { scrollbarWidth: "none" },
880
+ children: e.length === 0 ? /* @__PURE__ */ Y("span", {
881
+ className: "dc:text-[9px] text-dc-text-disabled dc:writing-vertical-lr dc:mt-2",
882
+ style: { writingMode: "vertical-lr" },
883
+ children: "No blocks"
884
+ }) : e.map((e) => {
885
+ let n = e.id === t, r;
886
+ return r = e.type === "portlet" ? y(e.chartType) : a, /* @__PURE__ */ Y("div", {
887
+ className: "dc:w-6 dc:h-6 dc:flex dc:items-center dc:justify-center dc:rounded",
888
+ style: n ? { animation: "dc-icon-pulse 0.6s ease-in-out 3" } : void 0,
889
+ title: e.type === "portlet" ? e.title : e.title || "Markdown",
890
+ children: /* @__PURE__ */ Y(r, { className: "dc:w-4 dc:h-4 text-dc-text-muted" })
891
+ }, e.id);
892
+ })
893
+ })]
894
+ });
930
895
  }
931
- function ft({ onExpand: t }) {
932
- const s = M("sparkles");
933
- return /* @__PURE__ */ u(
934
- "button",
935
- {
936
- type: "button",
937
- onClick: t,
938
- className: "dc:w-12 dc:h-full dc:flex-shrink-0 dc:flex dc:flex-col dc:items-center dc:pt-3 dc:gap-2 bg-dc-surface border-dc-border dc:border-l dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
939
- title: "Expand AI chat",
940
- children: [
941
- /* @__PURE__ */ e(s, { className: "dc:w-5 dc:h-5 text-dc-accent" }),
942
- /* @__PURE__ */ e(
943
- "span",
944
- {
945
- className: "dc:text-[10px] dc:font-medium text-dc-text-muted",
946
- style: { writingMode: "vertical-lr" },
947
- children: "AI Chat"
948
- }
949
- )
950
- ]
951
- }
952
- );
896
+ function or({ onExpand: e }) {
897
+ return /* @__PURE__ */ X("button", {
898
+ type: "button",
899
+ onClick: e,
900
+ className: "dc:w-12 dc:h-full dc:flex-shrink-0 dc:flex dc:flex-col dc:items-center dc:pt-3 dc:gap-2 bg-dc-surface border-dc-border dc:border-l dc:cursor-pointer dc:hover:bg-dc-surface-hover dc:transition-colors",
901
+ title: "Expand AI chat",
902
+ children: [/* @__PURE__ */ Y(p("sparkles"), { className: "dc:w-5 dc:h-5 text-dc-accent" }), /* @__PURE__ */ Y("span", {
903
+ className: "dc:text-[10px] dc:font-medium text-dc-text-muted",
904
+ style: { writingMode: "vertical-lr" },
905
+ children: "AI Chat"
906
+ })]
907
+ });
953
908
  }
954
- function pt({
955
- agentEndpoint: t,
956
- agentApiKey: s,
957
- agentProvider: c,
958
- agentModel: n,
959
- agentProviderEndpoint: a,
960
- onSave: r,
961
- onDirtyStateChange: o,
962
- onDashboardSaved: i,
963
- onScore: l,
964
- colorPalette: y,
965
- loadingComponent: N,
966
- className: S,
967
- initialPrompt: v
968
- }) {
969
- const [k, O] = _(60), R = x(null), g = x(!1), { containerRef: A, layoutMode: d } = Pe(), [m, b] = _("chat"), [T, K] = _(null), [$, P] = _(!1), L = x(d), E = B((f) => f.blocks), C = E.length, w = B((f) => f.messages.length), I = B((f) => f.isStreaming), V = B((f) => f.save);
970
- Q(() => {
971
- L.current === "narrow" && d === "wide" && b("chat"), L.current = d;
972
- }, [d]);
973
- const W = x(C);
974
- Q(() => {
975
- if (d === "narrow" && m === "chat" && C > W.current) {
976
- const f = E[E.length - 1];
977
- if (f) {
978
- K(f.id);
979
- const Y = setTimeout(() => K(null), 2e3);
980
- return () => clearTimeout(Y);
981
- }
982
- }
983
- W.current = C;
984
- }, [C, E, d, m]);
985
- const z = x(!1);
986
- Q(() => {
987
- if (I)
988
- z.current = !0;
989
- else if (z.current && d === "narrow" && m === "chat" && C > 0) {
990
- z.current = !1, P(!0);
991
- const f = setTimeout(() => P(!1), 1700);
992
- return () => clearTimeout(f);
993
- }
994
- }, [I, d, m, C]);
995
- const H = p(
996
- (f) => {
997
- A(f), R.current = f;
998
- },
999
- [A]
1000
- ), Z = x({ blockCount: C, msgCount: w });
1001
- Q(() => {
1002
- const f = C !== Z.current.blockCount || w !== Z.current.msgCount;
1003
- o?.(f);
1004
- }, [C, w, o]);
1005
- const D = x(), J = x(!1), j = x(r);
1006
- j.current = r;
1007
- const U = x(C > 0 || w > 0);
1008
- Q(() => {
1009
- if ((C > 0 || w > 0) && (U.current = !0), !(!j.current || !U.current)) {
1010
- if (I) {
1011
- J.current = !0, D.current && clearTimeout(D.current);
1012
- return;
1013
- }
1014
- return D.current && clearTimeout(D.current), D.current = setTimeout(() => {
1015
- J.current = !1;
1016
- const f = V();
1017
- j.current?.(f);
1018
- }, 1e3), () => {
1019
- D.current && clearTimeout(D.current);
1020
- };
1021
- }
1022
- }, [C, w, I, V]), Q(() => {
1023
- !I && J.current && j.current && U.current && (D.current && clearTimeout(D.current), D.current = setTimeout(() => {
1024
- J.current = !1;
1025
- const f = V();
1026
- j.current?.(f);
1027
- }, 1e3));
1028
- }, [I, V]);
1029
- const ee = p(() => {
1030
- j.current && (D.current && clearTimeout(D.current), j.current({ blocks: [], messages: [] }));
1031
- }, []), te = p((f) => {
1032
- f.preventDefault(), g.current = !0;
1033
- const Y = (oe) => {
1034
- if (!g.current || !R.current) return;
1035
- const ce = R.current.getBoundingClientRect(), de = (oe.clientX - ce.left) / ce.width * 100;
1036
- O(Math.min(Math.max(de, 30), 80));
1037
- }, se = () => {
1038
- g.current = !1, document.removeEventListener("mousemove", Y), document.removeEventListener("mouseup", se);
1039
- };
1040
- document.addEventListener("mousemove", Y), document.addEventListener("mouseup", se);
1041
- }, []), X = /* @__PURE__ */ e(
1042
- it,
1043
- {
1044
- agentEndpoint: t,
1045
- agentApiKey: s,
1046
- agentProvider: c,
1047
- agentModel: n,
1048
- agentProviderEndpoint: a,
1049
- onClear: ee,
1050
- onDashboardSaved: i,
1051
- onScore: l,
1052
- loadingComponent: N,
1053
- initialPrompt: v
1054
- }
1055
- );
1056
- return d === "narrow" ? /* @__PURE__ */ e(
1057
- "div",
1058
- {
1059
- ref: H,
1060
- className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${S || ""}`,
1061
- children: m === "chat" ? /* @__PURE__ */ u(ae, { children: [
1062
- /* @__PURE__ */ e(
1063
- ht,
1064
- {
1065
- blocks: E,
1066
- pulsingBlockId: T,
1067
- nudge: $,
1068
- onExpand: () => b("notebook")
1069
- }
1070
- ),
1071
- /* @__PURE__ */ e("div", { className: "dc:h-full dc:overflow-hidden dc:flex-1", children: X })
1072
- ] }) : /* @__PURE__ */ u(ae, { children: [
1073
- /* @__PURE__ */ e("div", { className: "dc:h-full dc:overflow-hidden dc:flex-1", children: /* @__PURE__ */ e(me, { colorPalette: y }) }),
1074
- /* @__PURE__ */ e(ft, { onExpand: () => b("chat") })
1075
- ] })
1076
- }
1077
- ) : /* @__PURE__ */ u(
1078
- "div",
1079
- {
1080
- ref: H,
1081
- className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${S || ""}`,
1082
- children: [
1083
- /* @__PURE__ */ e(
1084
- "div",
1085
- {
1086
- className: "dc:h-full dc:overflow-hidden",
1087
- style: { width: `${k}%` },
1088
- children: /* @__PURE__ */ e(me, { colorPalette: y })
1089
- }
1090
- ),
1091
- /* @__PURE__ */ e(
1092
- "div",
1093
- {
1094
- 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",
1095
- onMouseDown: te
1096
- }
1097
- ),
1098
- /* @__PURE__ */ e(
1099
- "div",
1100
- {
1101
- className: "dc:h-full dc:overflow-hidden",
1102
- style: { width: `${100 - k}%` },
1103
- children: X
1104
- }
1105
- )
1106
- ]
1107
- }
1108
- );
909
+ function sr({ agentEndpoint: e, agentApiKey: t, agentProvider: n, agentModel: r, agentProviderEndpoint: i, onSave: a, onDirtyStateChange: o, onDashboardSaved: s, onScore: c, colorPalette: l, loadingComponent: u, className: d, initialPrompt: f }) {
910
+ let [p, m] = q(60), h = K(null), g = K(!1), { containerRef: _, layoutMode: v } = pn(), [y, b] = q("chat"), [x, S] = q(null), [C, w] = q(!1), T = K(v), E = Z((e) => e.blocks), D = E.length, O = Z((e) => e.messages.length), k = Z((e) => e.isStreaming), A = Z((e) => e.save);
911
+ G(() => {
912
+ T.current === "narrow" && v === "wide" && b("chat"), T.current = v;
913
+ }, [v]);
914
+ let j = K(D);
915
+ G(() => {
916
+ if (v === "narrow" && y === "chat" && D > j.current) {
917
+ let e = E[E.length - 1];
918
+ if (e) {
919
+ S(e.id);
920
+ let t = setTimeout(() => S(null), 2e3);
921
+ return () => clearTimeout(t);
922
+ }
923
+ }
924
+ j.current = D;
925
+ }, [
926
+ D,
927
+ E,
928
+ v,
929
+ y
930
+ ]);
931
+ let M = K(!1);
932
+ G(() => {
933
+ if (k) M.current = !0;
934
+ else if (M.current && v === "narrow" && y === "chat" && D > 0) {
935
+ M.current = !1, w(!0);
936
+ let e = setTimeout(() => w(!1), 1700);
937
+ return () => clearTimeout(e);
938
+ }
939
+ }, [
940
+ k,
941
+ v,
942
+ y,
943
+ D
944
+ ]);
945
+ let N = W((e) => {
946
+ _(e), h.current = e;
947
+ }, [_]), P = K({
948
+ blockCount: D,
949
+ msgCount: O
950
+ });
951
+ G(() => {
952
+ o?.(D !== P.current.blockCount || O !== P.current.msgCount);
953
+ }, [
954
+ D,
955
+ O,
956
+ o
957
+ ]);
958
+ let F = K(), I = K(!1), L = K(a);
959
+ L.current = a;
960
+ let R = K(D > 0 || O > 0);
961
+ G(() => {
962
+ if ((D > 0 || O > 0) && (R.current = !0), !(!L.current || !R.current)) {
963
+ if (k) {
964
+ I.current = !0, F.current && clearTimeout(F.current);
965
+ return;
966
+ }
967
+ return F.current && clearTimeout(F.current), F.current = setTimeout(() => {
968
+ I.current = !1;
969
+ let e = A();
970
+ L.current?.(e);
971
+ }, 1e3), () => {
972
+ F.current && clearTimeout(F.current);
973
+ };
974
+ }
975
+ }, [
976
+ D,
977
+ O,
978
+ k,
979
+ A
980
+ ]), G(() => {
981
+ !k && I.current && L.current && R.current && (F.current && clearTimeout(F.current), F.current = setTimeout(() => {
982
+ I.current = !1;
983
+ let e = A();
984
+ L.current?.(e);
985
+ }, 1e3));
986
+ }, [k, A]);
987
+ let z = W(() => {
988
+ L.current && (F.current && clearTimeout(F.current), L.current({
989
+ blocks: [],
990
+ messages: []
991
+ }));
992
+ }, []), B = W((e) => {
993
+ e.preventDefault(), g.current = !0;
994
+ let t = (e) => {
995
+ if (!g.current || !h.current) return;
996
+ let t = h.current.getBoundingClientRect(), n = (e.clientX - t.left) / t.width * 100;
997
+ m(Math.min(Math.max(n, 30), 80));
998
+ }, n = () => {
999
+ g.current = !1, document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
1000
+ };
1001
+ document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
1002
+ }, []), V = /* @__PURE__ */ Y(nr, {
1003
+ agentEndpoint: e,
1004
+ agentApiKey: t,
1005
+ agentProvider: n,
1006
+ agentModel: r,
1007
+ agentProviderEndpoint: i,
1008
+ onClear: z,
1009
+ onDashboardSaved: s,
1010
+ onScore: c,
1011
+ loadingComponent: u,
1012
+ initialPrompt: f
1013
+ });
1014
+ return v === "narrow" ? /* @__PURE__ */ Y("div", {
1015
+ ref: N,
1016
+ className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${d || ""}`,
1017
+ children: y === "chat" ? /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(ar, {
1018
+ blocks: E,
1019
+ pulsingBlockId: x,
1020
+ nudge: C,
1021
+ onExpand: () => b("notebook")
1022
+ }), /* @__PURE__ */ Y("div", {
1023
+ className: "dc:h-full dc:overflow-hidden dc:flex-1",
1024
+ children: V
1025
+ })] }) : /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("div", {
1026
+ className: "dc:h-full dc:overflow-hidden dc:flex-1",
1027
+ children: /* @__PURE__ */ Y(Gn, { colorPalette: l })
1028
+ }), /* @__PURE__ */ Y(or, { onExpand: () => b("chat") })] })
1029
+ }) : /* @__PURE__ */ X("div", {
1030
+ ref: N,
1031
+ className: `dc:flex dc:h-full dc:w-full dc:overflow-hidden bg-dc-surface-secondary ${d || ""}`,
1032
+ children: [
1033
+ /* @__PURE__ */ Y("div", {
1034
+ className: "dc:h-full dc:overflow-hidden",
1035
+ style: { width: `${p}%` },
1036
+ children: /* @__PURE__ */ Y(Gn, { colorPalette: l })
1037
+ }),
1038
+ /* @__PURE__ */ Y("div", {
1039
+ 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",
1040
+ onMouseDown: B
1041
+ }),
1042
+ /* @__PURE__ */ Y("div", {
1043
+ className: "dc:h-full dc:overflow-hidden",
1044
+ style: { width: `${100 - p}%` },
1045
+ children: V
1046
+ })
1047
+ ]
1048
+ });
1109
1049
  }
1110
- const Mt = G.memo(function({
1111
- config: s,
1112
- colorPalette: c,
1113
- ...n
1114
- }) {
1115
- return /* @__PURE__ */ e(Qe, { initialConfig: s, children: /* @__PURE__ */ e(pt, { ...n, colorPalette: c }) });
1050
+ var cr = U.memo(function({ config: e, colorPalette: t, ...n }) {
1051
+ return /* @__PURE__ */ Y(wn, {
1052
+ initialConfig: e,
1053
+ children: /* @__PURE__ */ Y(sr, {
1054
+ ...n,
1055
+ colorPalette: t
1056
+ })
1057
+ });
1116
1058
  });
1117
- function Et() {
1118
- return /* @__PURE__ */ e("div", { children: "Analytics Page - Coming in Phase 4" });
1059
+ //#endregion
1060
+ //#region src/client/components/AnalyticsPage.tsx
1061
+ function lr() {
1062
+ return /* @__PURE__ */ Y("div", { children: "Analytics Page - Coming in Phase 4" });
1119
1063
  }
1120
- const gt = M("segment");
1121
- function Rt({
1122
- className: t = ""
1123
- }) {
1124
- return /* @__PURE__ */ e(
1125
- "div",
1126
- {
1127
- className: `dc:flex dc:items-center dc:justify-center bg-dc-bg-secondary ${t}`,
1128
- children: /* @__PURE__ */ u("div", { className: "dc:text-center", children: [
1129
- /* @__PURE__ */ e(
1130
- gt,
1131
- {
1132
- className: "dc:w-8 dc:h-8 dc:mx-auto dc:mb-2 text-dc-text-muted dc:opacity-50"
1133
- }
1134
- ),
1135
- /* @__PURE__ */ e("span", { className: "dc:text-xs text-dc-text-muted", children: "No preview" })
1136
- ] })
1137
- }
1138
- );
1064
+ //#endregion
1065
+ //#region src/client/components/DashboardThumbnailPlaceholder.tsx
1066
+ var ur = p("segment");
1067
+ function dr({ className: e = "" }) {
1068
+ return /* @__PURE__ */ Y("div", {
1069
+ className: `dc:flex dc:items-center dc:justify-center bg-dc-bg-secondary ${e}`,
1070
+ children: /* @__PURE__ */ X("div", {
1071
+ className: "dc:text-center",
1072
+ children: [/* @__PURE__ */ Y(ur, { className: "dc:w-8 dc:h-8 dc:mx-auto dc:mb-2 text-dc-text-muted dc:opacity-50" }), /* @__PURE__ */ Y("span", {
1073
+ className: "dc:text-xs text-dc-text-muted",
1074
+ children: "No preview"
1075
+ })]
1076
+ })
1077
+ });
1139
1078
  }
1140
- export {
1141
- Mt as AgenticNotebook,
1142
- Lt as AnalysisBuilder,
1143
- Ft as AnalyticsDashboard,
1144
- Et as AnalyticsPage,
1145
- Ce as AnalyticsPortlet,
1146
- Qt as ChartErrorBoundary,
1147
- _t as ConfirmModal,
1148
- js as CubeClient,
1149
- Us as CubeProvider,
1150
- Ms as DEFAULT_ICONS,
1151
- Vt as DashboardEditModal,
1152
- jt as DashboardGrid,
1153
- Ut as DashboardStoreProvider,
1154
- Rt as DashboardThumbnailPlaceholder,
1155
- Ot as DrillBreadcrumb,
1156
- $t as DrillMenu,
1157
- lc as ExecutionPlanPanel,
1158
- ic as ExplainAIPanel,
1159
- tc as LazyChart,
1160
- he as LoadingIndicator,
1161
- qt as Modal,
1162
- Qe as NotebookStoreProvider,
1163
- ke as PortletAnalysisModal,
1164
- Kt as PortletContainer,
1165
- Uc as SchemaVisualization,
1166
- Os as ScrollContainerProvider,
1167
- yr as THEME_PRESETS,
1168
- vr as applyTheme,
1169
- ur as buildFunnelConfigFromQueries,
1170
- mr as buildServerFunnelQuery,
1171
- $s as captureThumbnail,
1172
- uc as compressAndEncode,
1173
- qs as createCubeClient,
1174
- Kc as createDashboardLayout,
1175
- zt as createDashboardStore,
1176
- Wt as createDefaultConfig,
1177
- Jt as createDefaultFlowConfig,
1178
- Xt as createDefaultFunnelConfig,
1179
- Yt as createDefaultQueryConfig,
1180
- Gt as createDefaultRetentionConfig,
1181
- Ht as createDefaultWorkspace,
1182
- Ir as createExplainQueryKey,
1183
- Jc as createFlowQueryKey,
1184
- Xc as createFunnelQueryKey,
1185
- Fe as createNotebookStore,
1186
- mc as decodeAndDecompress,
1187
- hc as detectAsymmetricDateRanges,
1188
- fc as detectMeasureCollisions,
1189
- zc as formatChartData,
1190
- hr as formatDuration,
1191
- Yc as generateQueryLabel,
1192
- pc as generateShareUrl,
1193
- gc as getAvailableBindingKeyDimensions,
1194
- sc as getAvailableChartTypes,
1195
- fr as getBindingKeyField,
1196
- bc as getBindingKeyLabel,
1197
- Ee as getChartTypeIcon,
1198
- Gc as getCombinedFields,
1199
- pr as getCubeNameFromQuery,
1200
- Es as getFieldTypeIcon,
1201
- M as getIcon,
1202
- Rs as getIconData,
1203
- Bs as getIconRegistry,
1204
- Ps as getIconsByCategory,
1205
- Ls as getMeasureTypeIcon,
1206
- Hc as getQueryIndices,
1207
- Zc as getQueryLabels,
1208
- Cr as getTheme,
1209
- wr as getThemeVariable,
1210
- cc as getUnavailableChartTypes,
1211
- xc as getValidationSummary,
1212
- Vr as highlightCodeBlocks,
1213
- rc as isChartTypeAvailable,
1214
- Nr as isDarkMode,
1215
- Zt as isFlowConfig,
1216
- es as isFunnelConfig,
1217
- gr as isFunnelData,
1218
- yc as isMinimumFunnelConfigValid,
1219
- ts as isMultiQuery,
1220
- ss as isMultiQueryConfig,
1221
- er as isMultiQueryData,
1222
- vc as isMultiQueryValid,
1223
- cs as isQueryConfig,
1224
- rs as isRetentionConfig,
1225
- Fr as isSankeyData,
1226
- Qr as isServerFlowQuery,
1227
- ns as isServerFunnelQuery,
1228
- Cc as isShareableSize,
1229
- as as isSingleQuery,
1230
- Ks as isThumbnailCaptureAvailable,
1231
- os as isValidAnalysisConfig,
1232
- ds as isValidAnalysisWorkspace,
1233
- nc as isValidChartType,
1234
- tr as mergeQueryResults,
1235
- sr as mergeResultsByKey,
1236
- cr as mergeResultsConcat,
1237
- ls as migrateConfig,
1238
- is as migrateLegacyPortlet,
1239
- wc as parseShareUrl,
1240
- ac as preloadChart,
1241
- oc as preloadCharts,
1242
- Fs as registerIcons,
1243
- Qs as resetIcons,
1244
- kr as resetTheme,
1245
- us as selectAllActions,
1246
- Ue as selectBlockActions,
1247
- _e as selectBlocks,
1248
- Nc as selectBreakdowns,
1249
- kc as selectChartConfig,
1250
- je as selectChatActions,
1251
- Ve as selectChatState,
1252
- Sc as selectCurrentState,
1253
- ms as selectDebugData,
1254
- hs as selectDebugDataActions,
1255
- fs as selectEditModeActions,
1256
- ps as selectEditModeState,
1257
- Tc as selectFilters,
1258
- Dc as selectFunnelState,
1259
- It as selectInputValue,
1260
- Dt as selectIsStreaming,
1261
- gs as selectLayoutActions,
1262
- bs as selectLayoutState,
1263
- Tt as selectMessages,
1264
- Ac as selectMetrics,
1265
- xs as selectModalActions,
1266
- ys as selectModalState,
1267
- Ic as selectMultiQueryState,
1268
- vs as selectPortletDebugData,
1269
- At as selectSessionId,
1270
- Cs as selectThumbnailDirty,
1271
- Mc as selectUIState,
1272
- _s as setIcon,
1273
- Sr as setTheme,
1274
- Tr as setThemeVariable,
1275
- br as transformServerFunnelResult,
1276
- tt as useAgentChat,
1277
- Ec as useAnalysisBuilder,
1278
- Rc as useAnalysisBuilderStore,
1279
- Be as useCubeApi,
1280
- zs as useCubeContext,
1281
- Ws as useCubeFeatures,
1282
- Zs as useCubeFieldLabel,
1283
- rr as useCubeLoadQuery,
1284
- Js as useCubeMeta,
1285
- Xs as useCubeMetaQuery,
1286
- nr as useCubeQuery,
1287
- ws as useDashboard,
1288
- Ns as useDashboardStore,
1289
- ks as useDashboardStoreApi,
1290
- Ss as useDashboardStoreOptional,
1291
- Ts as useDrillInteraction,
1292
- Mr as useDryRunQueries,
1293
- Er as useDryRunQuery,
1294
- Ds as useElementVisibility,
1295
- Rr as useExplainAI,
1296
- Br as useExplainQuery,
1297
- ar as useFlowQuery,
1298
- or as useFunnelQuery,
1299
- dr as useMultiCubeLoadQuery,
1300
- Pr as useMultiDryRunQueries,
1301
- B as useNotebookStore,
1302
- Ys as useScrollContainer,
1303
- As as useScrollDetection,
1304
- $c as useTheme,
1305
- Bc as validateBindingKeyExists,
1306
- Pc as validateBindingKeyForSteps,
1307
- Lc as validateFunnelConfig,
1308
- lr as validateMergeKey,
1309
- Fc as validateMergeKeys,
1310
- Qc as validateMultiQueryConfig,
1311
- _c as validateStepQueries,
1312
- Vc as validateTimeDimensionAlignment,
1313
- Gs as warnIfScreenshotLibMissing,
1314
- Dr as watchThemeChanges
1315
- };
1316
- //# sourceMappingURL=index.js.map
1079
+ //#endregion
1080
+ export { cr as AgenticNotebook, Qe as AnalysisBuilder, Ze as AnalyticsDashboard, lr as AnalyticsPage, Oe as AnalyticsPortlet, je as ChartErrorBoundary, jt as ConfirmModal, a as CubeClient, S as CubeProvider, T as DEFAULT_ICONS, $e as DashboardEditModal, Ue as DashboardGrid, Re as DashboardStoreProvider, dr as DashboardThumbnailPlaceholder, We as DrillBreadcrumb, Ae as DrillMenu, Bt as ExecutionPlanPanel, Lt as ExplainAIPanel, ft as LazyChart, at as LoadingIndicator, At as Modal, wn as NotebookStoreProvider, Ye as PortletAnalysisModal, Je as PortletContainer, mn as SchemaVisualization, me as ScrollContainerProvider, _e as THEME_PRESETS, Se as applyTheme, le as buildFunnelConfigFromQueries, oe as buildServerFunnelQuery, o as captureThumbnail, en as compressAndEncode, _ as createCubeClient, _n as createDashboardLayout, Ke as createDashboardStore, Et as createDefaultConfig, gt as createDefaultFlowConfig, ht as createDefaultFunnelConfig, St as createDefaultQueryConfig, kt as createDefaultRetentionConfig, pt as createDefaultWorkspace, ee as createExplainQueryKey, N as createFlowQueryKey, I as createFunnelQueryKey, Sn as createNotebookStore, qt as decodeAndDecompress, Yt as detectAsymmetricDateRanges, Ut as detectMeasureCollisions, gn as formatChartData, ie as formatDuration, z as generateQueryLabel, Jt as generateShareUrl, sn as getAvailableBindingKeyDimensions, ct as getAvailableChartTypes, ce as getBindingKeyField, tn as getBindingKeyLabel, y as getChartTypeIcon, k as getCombinedFields, ue as getCubeNameFromQuery, C as getFieldTypeIcon, p as getIcon, m as getIconData, x as getIconRegistry, b as getIconsByCategory, g as getMeasureTypeIcon, A as getQueryIndices, L as getQueryLabels, Te as getTheme, ve as getThemeVariable, ut as getUnavailableChartTypes, cn as getValidationSummary, Nt as highlightCodeBlocks, st as isChartTypeAvailable, ye as isDarkMode, Ot as isFlowConfig, bt as isFunnelConfig, ae as isFunnelData, an as isMinimumFunnelConfigValid, xt as isMultiQuery, Me as isMultiQueryConfig, F as isMultiQueryData, dn as isMultiQueryValid, Ct as isQueryConfig, _t as isRetentionConfig, de as isSankeyData, fe as isServerFlowQuery, Ge as isServerFunnelQuery, rn as isShareableSize, vt as isSingleQuery, c as isThumbnailCaptureAvailable, yt as isValidAnalysisConfig, wt as isValidAnalysisWorkspace, ot as isValidChartType, M as mergeQueryResults, j as mergeResultsByKey, E as mergeResultsConcat, mt as migrateConfig, Mt as migrateLegacyPortlet, Xt as parseShareUrl, lt as preloadChart, dt as preloadCharts, h as registerIcons, d as resetIcons, we as resetTheme, et as selectAllActions, Mn as selectBlockActions, Tn as selectBlocks, ln as selectBreakdowns, Ht as selectChartConfig, jn as selectChatActions, An as selectChatState, It as selectCurrentState, ze as selectDebugData, Be as selectDebugDataActions, Xe as selectEditModeActions, qe as selectEditModeState, Ft as selectFilters, zt as selectFunnelState, kn as selectInputValue, Dn as selectIsStreaming, He as selectLayoutActions, Ve as selectLayoutState, En as selectMessages, $t as selectMetrics, Fe as selectModalActions, tt as selectModalState, Pt as selectMultiQueryState, it as selectPortletDebugData, On as selectSessionId, Le as selectThumbnailDirty, Qt as selectUIState, w as setIcon, Ce as setTheme, xe as setThemeVariable, se as transformServerFunnelResult, qn as useAgentChat, Kt as useAnalysisBuilder, Rt as useAnalysisBuilderStore, v as useCubeApi, f as useCubeContext, u as useCubeFeatures, ge as useCubeFieldLabel, O as useCubeLoadQuery, O as useCubeQuery, he as useCubeMeta, l as useCubeMetaQuery, Ie as useDashboard, rt as useDashboardStore, Ne as useDashboardStoreApi, De as useDashboardStoreOptional, Ee as useDrillInteraction, H as useDryRunQueries, V as useDryRunQuery, Pe as useElementVisibility, re as useExplainAI, ne as useExplainQuery, D as useFlowQuery, R as useFunnelQuery, P as useMultiCubeLoadQuery, te as useMultiDryRunQueries, Z as useNotebookStore, pe as useScrollContainer, ke as useScrollDetection, hn as useTheme, Zt as validateBindingKeyExists, Wt as validateBindingKeyForSteps, nn as validateFunnelConfig, B as validateMergeKey, Gt as validateMergeKeys, un as validateMultiQueryConfig, on as validateStepQueries, Vt as validateTimeDimensionAlignment, s as warnIfScreenshotLibMissing, be as watchThemeChanges };
1081
+
1082
+ //# sourceMappingURL=index.js.map