mito-ai 0.1.46__py3-none-any.whl → 0.1.48__py3-none-any.whl
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.
Potentially problematic release.
This version of mito-ai might be problematic. Click here for more details.
- mito_ai/_version.py +1 -1
- mito_ai/app_deploy/handlers.py +98 -77
- mito_ai/app_deploy/models.py +16 -12
- mito_ai/completions/models.py +5 -1
- mito_ai/completions/prompt_builders/agent_execution_prompt.py +10 -1
- mito_ai/completions/prompt_builders/agent_system_message.py +63 -4
- mito_ai/completions/prompt_builders/chat_system_message.py +4 -0
- mito_ai/completions/prompt_builders/prompt_constants.py +1 -0
- mito_ai/completions/prompt_builders/utils.py +14 -0
- mito_ai/path_utils.py +56 -0
- mito_ai/streamlit_conversion/agent_utils.py +4 -201
- mito_ai/streamlit_conversion/prompts/prompt_constants.py +142 -152
- mito_ai/streamlit_conversion/prompts/streamlit_error_correction_prompt.py +3 -3
- mito_ai/streamlit_conversion/prompts/streamlit_finish_todo_prompt.py +2 -2
- mito_ai/streamlit_conversion/prompts/update_existing_app_prompt.py +2 -2
- mito_ai/streamlit_conversion/search_replace_utils.py +94 -0
- mito_ai/streamlit_conversion/streamlit_agent_handler.py +35 -46
- mito_ai/streamlit_conversion/streamlit_utils.py +12 -66
- mito_ai/streamlit_conversion/validate_streamlit_app.py +6 -21
- mito_ai/streamlit_preview/__init__.py +1 -2
- mito_ai/streamlit_preview/handlers.py +53 -85
- mito_ai/streamlit_preview/manager.py +7 -16
- mito_ai/streamlit_preview/utils.py +8 -28
- mito_ai/tests/message_history/test_message_history_utils.py +1 -0
- mito_ai/tests/streamlit_conversion/test_apply_search_replace.py +240 -0
- mito_ai/tests/streamlit_conversion/test_streamlit_agent_handler.py +39 -60
- mito_ai/tests/streamlit_conversion/test_streamlit_utils.py +26 -29
- mito_ai/tests/streamlit_conversion/test_validate_streamlit_app.py +25 -20
- mito_ai/tests/streamlit_preview/test_streamlit_preview_handler.py +81 -56
- mito_ai/tests/streamlit_preview/test_streamlit_preview_manager.py +24 -37
- mito_ai/user/handlers.py +15 -3
- mito_ai/utils/create.py +17 -1
- mito_ai/utils/error_classes.py +42 -0
- mito_ai/utils/message_history_utils.py +3 -1
- mito_ai/utils/telemetry_utils.py +78 -13
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +100 -100
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/package.json +2 -2
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +1 -1
- mito_ai-0.1.46.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.20f12766ecd3d430568e.js → mito_ai-0.1.48.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.5c7d84a45ddeb5704b61.js +1515 -449
- mito_ai-0.1.48.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.5c7d84a45ddeb5704b61.js.map +1 -0
- mito_ai-0.1.46.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.54126ab6511271265443.js → mito_ai-0.1.48.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.045d65d1de6fde3f3b72.js +18 -18
- mito_ai-0.1.46.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.54126ab6511271265443.js.map → mito_ai-0.1.48.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.045d65d1de6fde3f3b72.js.map +1 -1
- {mito_ai-0.1.46.dist-info → mito_ai-0.1.48.dist-info}/METADATA +1 -1
- {mito_ai-0.1.46.dist-info → mito_ai-0.1.48.dist-info}/RECORD +69 -67
- mito_ai/tests/streamlit_conversion/test_apply_patch_to_text.py +0 -368
- mito_ai/tests/streamlit_conversion/test_fix_diff_headers.py +0 -533
- mito_ai-0.1.46.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.20f12766ecd3d430568e.js.map +0 -1
- /mito_ai/streamlit_conversion/{streamlit_system_prompt.py → prompts/streamlit_system_prompt.py} +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/node_modules_process_browser_js.4b128e94d31a81ebd209.js.map +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js.map +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_apis_signOut_mjs-node_module-75790d.688c25857e7b81b1740f.js.map +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_-72f1c8.a917210f057fcfe224ad.js.map +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.4fcecd65bef9e9847609.js.map +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_react-dom_client_js-node_modules_aws-amplify_ui-react_dist_styles_css.b43d4249e4d3dac9ad7b.js.map +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.3f6754ac5116d47de76b.js.map +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
- {mito_ai-0.1.46.data → mito_ai-0.1.48.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map +0 -0
- {mito_ai-0.1.46.dist-info → mito_ai-0.1.48.dist-info}/WHEEL +0 -0
- {mito_ai-0.1.46.dist-info → mito_ai-0.1.48.dist-info}/entry_points.txt +0 -0
- {mito_ai-0.1.46.dist-info → mito_ai-0.1.48.dist-info}/licenses/LICENSE +0 -0
|
@@ -17,15 +17,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
17
17
|
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
|
|
18
18
|
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/notebook */ "webpack/sharing/consume/default/@jupyterlab/notebook");
|
|
19
19
|
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2__);
|
|
20
|
-
/* harmony import */ var
|
|
20
|
+
/* harmony import */ var _ChatWidget__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ChatWidget */ "./lib/Extensions/AiChat/ChatWidget.js");
|
|
21
21
|
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/rendermime */ "webpack/sharing/consume/default/@jupyterlab/rendermime");
|
|
22
22
|
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__);
|
|
23
|
-
/* harmony import */ var
|
|
24
|
-
/* harmony import */ var
|
|
23
|
+
/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
|
|
24
|
+
/* harmony import */ var _token__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./token */ "./lib/Extensions/AiChat/token.js");
|
|
25
25
|
/* harmony import */ var _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ContextManager/ContextManagerPlugin */ "./lib/Extensions/ContextManager/ContextManagerPlugin.js");
|
|
26
|
+
/* harmony import */ var _AppPreview_StreamlitPreviewPlugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../AppPreview/StreamlitPreviewPlugin */ "./lib/Extensions/AppPreview/StreamlitPreviewPlugin.js");
|
|
26
27
|
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/settingregistry */ "webpack/sharing/consume/default/@jupyterlab/settingregistry");
|
|
27
28
|
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__);
|
|
28
|
-
/* harmony import */ var
|
|
29
|
+
/* harmony import */ var _jupyterSettingsManager__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./jupyterSettingsManager */ "./lib/Extensions/AiChat/jupyterSettingsManager.js");
|
|
29
30
|
/* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @jupyterlab/docmanager */ "webpack/sharing/consume/default/@jupyterlab/docmanager");
|
|
30
31
|
/* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_5__);
|
|
31
32
|
/*
|
|
@@ -43,6 +44,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
|
|
47
|
+
|
|
46
48
|
// The Widget Rank determins where the ChatIcon is displayed
|
|
47
49
|
// in the left hand toolbar
|
|
48
50
|
const WIDGET_RANK = 2000;
|
|
@@ -59,22 +61,23 @@ const AiChatPlugin = {
|
|
|
59
61
|
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette,
|
|
60
62
|
_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__.IRenderMimeRegistry,
|
|
61
63
|
_ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_6__.IContextManager,
|
|
64
|
+
_AppPreview_StreamlitPreviewPlugin__WEBPACK_IMPORTED_MODULE_7__.IStreamlitPreviewManager,
|
|
62
65
|
_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.ISettingRegistry,
|
|
63
66
|
_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_5__.IDocumentManager
|
|
64
67
|
],
|
|
65
68
|
optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],
|
|
66
|
-
provides:
|
|
67
|
-
activate: (app, labShell, notebookTracker, palette, rendermime, contextManager, settingRegistry, documentManager, restorer) => {
|
|
69
|
+
provides: _token__WEBPACK_IMPORTED_MODULE_8__.IChatTracker,
|
|
70
|
+
activate: (app, labShell, notebookTracker, palette, rendermime, contextManager, streamlitPreviewManager, settingRegistry, documentManager, restorer) => {
|
|
68
71
|
// Define a widget creator function,
|
|
69
72
|
// then call it to make a new widget
|
|
70
73
|
const newWidget = () => {
|
|
71
74
|
// Create a blank content widget inside of a MainAreaWidget
|
|
72
|
-
const chatWidget = (0,
|
|
75
|
+
const chatWidget = (0,_ChatWidget__WEBPACK_IMPORTED_MODULE_9__.buildChatWidget)(app, notebookTracker, rendermime, contextManager, streamlitPreviewManager);
|
|
73
76
|
return chatWidget;
|
|
74
77
|
};
|
|
75
78
|
let widget = newWidget();
|
|
76
79
|
// Add an application command
|
|
77
|
-
app.commands.addCommand(
|
|
80
|
+
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_10__.COMMAND_MITO_AI_OPEN_CHAT, {
|
|
78
81
|
label: 'Your friendly Python Expert chat bot',
|
|
79
82
|
execute: (args) => {
|
|
80
83
|
// In order for the widget to be accessible, the widget must be:
|
|
@@ -108,14 +111,14 @@ const AiChatPlugin = {
|
|
|
108
111
|
}
|
|
109
112
|
});
|
|
110
113
|
app.commands.addKeyBinding({
|
|
111
|
-
command:
|
|
114
|
+
command: _commands__WEBPACK_IMPORTED_MODULE_10__.COMMAND_MITO_AI_OPEN_CHAT,
|
|
112
115
|
keys: ['Accel E'],
|
|
113
116
|
selector: 'body'
|
|
114
117
|
});
|
|
115
118
|
app.shell.add(widget, 'left', { rank: WIDGET_RANK });
|
|
116
119
|
// Add the command to the palette.
|
|
117
120
|
palette.addItem({
|
|
118
|
-
command:
|
|
121
|
+
command: _commands__WEBPACK_IMPORTED_MODULE_10__.COMMAND_MITO_AI_OPEN_CHAT,
|
|
119
122
|
category: 'AI Chat'
|
|
120
123
|
});
|
|
121
124
|
// Track and restore the widget state
|
|
@@ -139,8 +142,8 @@ const AiChatPlugin = {
|
|
|
139
142
|
labShell.activateById(widget.id);
|
|
140
143
|
});
|
|
141
144
|
// Update jupyter settings to work best with mito-ai
|
|
142
|
-
void (0,
|
|
143
|
-
void (0,
|
|
145
|
+
void (0,_jupyterSettingsManager__WEBPACK_IMPORTED_MODULE_11__.setRenameUntitledFileOnSave)(settingRegistry, documentManager);
|
|
146
|
+
void (0,_jupyterSettingsManager__WEBPACK_IMPORTED_MODULE_11__.setDefaultWindowingMode)(settingRegistry);
|
|
144
147
|
// By returning a tracker token, we can require the token in other
|
|
145
148
|
// plugins. This allows us to force plugin load order. For example,
|
|
146
149
|
// we can ensure that the COMMAND_MITO_AI_OPEN_CHAT is created
|
|
@@ -184,7 +187,7 @@ const CTACarousel = ({ app }) => {
|
|
|
184
187
|
content: (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null,
|
|
185
188
|
"Generate more than just Python code. Talk to your database, no SQL required.",
|
|
186
189
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("br", null),
|
|
187
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "button-base button-gray cta-carousel-button", onClick: () => app.commands.execute(_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_2__.
|
|
190
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "button-base button-gray cta-carousel-button", onClick: () => app.commands.execute(_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_2__.COMMAND_MITO_AI_SETTINGS_DATABASE), "data-testid": "cta-carousel-button" },
|
|
188
191
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, "\uFF0B Add Database"))))
|
|
189
192
|
},
|
|
190
193
|
{
|
|
@@ -242,7 +245,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
242
245
|
Whenever, the chatHistoryManager is updated, it should automatically send a message to the AI.
|
|
243
246
|
*/
|
|
244
247
|
class ChatHistoryManager {
|
|
245
|
-
constructor(contextManager, notebookTracker, initialHistory) {
|
|
248
|
+
constructor(contextManager, notebookTracker, app, streamlitPreviewManager, initialHistory) {
|
|
246
249
|
this._allAssumptions = new Set();
|
|
247
250
|
this.getLastAIMessageIndex = () => {
|
|
248
251
|
// We assume that assistant messages are always separated by user messages.
|
|
@@ -271,9 +274,17 @@ class ChatHistoryManager {
|
|
|
271
274
|
this.contextManager = contextManager;
|
|
272
275
|
// Save the notebook tracker
|
|
273
276
|
this.notebookTracker = notebookTracker;
|
|
277
|
+
// Save the app
|
|
278
|
+
this.app = app;
|
|
279
|
+
// Save the streamlit preview service
|
|
280
|
+
this.streamlitPreviewManager = streamlitPreviewManager;
|
|
274
281
|
// Initialize assumptions from existing history
|
|
275
282
|
this.initializeAssumptionsFromHistory();
|
|
276
283
|
}
|
|
284
|
+
checkIfStreamlitAppIsOpen() {
|
|
285
|
+
// Use the service to check if there's an active preview
|
|
286
|
+
return this.streamlitPreviewManager.hasActivePreview();
|
|
287
|
+
}
|
|
277
288
|
initializeAssumptionsFromHistory() {
|
|
278
289
|
this._allAssumptions.clear();
|
|
279
290
|
this.displayOptimizedChatHistory.forEach(item => {
|
|
@@ -303,7 +314,7 @@ class ChatHistoryManager {
|
|
|
303
314
|
};
|
|
304
315
|
}
|
|
305
316
|
createDuplicateChatHistoryManager() {
|
|
306
|
-
const duplicateManager = new ChatHistoryManager(this.contextManager, this.notebookTracker, this.displayOptimizedChatHistory);
|
|
317
|
+
const duplicateManager = new ChatHistoryManager(this.contextManager, this.notebookTracker, this.app, this.streamlitPreviewManager, this.displayOptimizedChatHistory);
|
|
307
318
|
// Copy the assumptions set to the duplicate
|
|
308
319
|
duplicateManager._allAssumptions = new Set(this._allAssumptions);
|
|
309
320
|
return duplicateManager;
|
|
@@ -346,15 +357,18 @@ class ChatHistoryManager {
|
|
|
346
357
|
addAgentExecutionMessage(activeThreadId, notebookPanel, input, additionalContext) {
|
|
347
358
|
const aiOptimizedCells = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_1__.getAIOptimizedCellsInNotebookPanel)(notebookPanel);
|
|
348
359
|
const notebookContext = this.contextManager.getNotebookContext(notebookPanel.id);
|
|
360
|
+
const streamlitAppIsOpen = this.checkIfStreamlitAppIsOpen();
|
|
349
361
|
const agentExecutionMetadata = {
|
|
350
362
|
promptType: 'agent:execution',
|
|
363
|
+
activeCellId: (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_1__.getActiveCellIDInNotebookPanel)(notebookPanel) || '',
|
|
351
364
|
variables: (notebookContext === null || notebookContext === void 0 ? void 0 : notebookContext.variables) || [],
|
|
352
365
|
files: (notebookContext === null || notebookContext === void 0 ? void 0 : notebookContext.files) || [],
|
|
353
366
|
aiOptimizedCells: aiOptimizedCells,
|
|
354
367
|
input: input || '',
|
|
355
368
|
threadId: activeThreadId,
|
|
356
369
|
isChromeBrowser: (0,_utils_user__WEBPACK_IMPORTED_MODULE_2__.isChromeBasedBrowser)(),
|
|
357
|
-
additionalContext: additionalContext
|
|
370
|
+
additionalContext: additionalContext,
|
|
371
|
+
streamlitAppIsOpen: streamlitAppIsOpen
|
|
358
372
|
};
|
|
359
373
|
// We use this function in two ways:
|
|
360
374
|
// 1. When the user sends the original agent:execution message to start the agent
|
|
@@ -1009,15 +1023,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1009
1023
|
/* harmony export */ });
|
|
1010
1024
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
1011
1025
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1012
|
-
/* harmony import */ var
|
|
1013
|
-
/* harmony import */ var
|
|
1026
|
+
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../utils/classNames */ "./lib/utils/classNames.js");
|
|
1027
|
+
/* harmony import */ var _ChatDropdown__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ChatDropdown */ "./lib/Extensions/AiChat/ChatMessage/ChatDropdown.js");
|
|
1014
1028
|
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/notebook */ "./lib/utils/notebook.js");
|
|
1015
1029
|
/* harmony import */ var _style_ChatInput_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/ChatInput.css */ "./style/ChatInput.css");
|
|
1016
1030
|
/* harmony import */ var _style_ChatDropdown_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../style/ChatDropdown.css */ "./style/ChatDropdown.css");
|
|
1017
|
-
/* harmony import */ var
|
|
1018
|
-
/* harmony import */ var
|
|
1019
|
-
/* harmony import */ var
|
|
1020
|
-
/* harmony import */ var
|
|
1031
|
+
/* harmony import */ var _hooks_useDebouncedFunction__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../hooks/useDebouncedFunction */ "./lib/hooks/useDebouncedFunction.js");
|
|
1032
|
+
/* harmony import */ var _components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../components/SelectedContextContainer */ "./lib/components/SelectedContextContainer.js");
|
|
1033
|
+
/* harmony import */ var _components_AttachFileButton__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../components/AttachFileButton */ "./lib/components/AttachFileButton.js");
|
|
1034
|
+
/* harmony import */ var _components_DatabaseButton__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../components/DatabaseButton */ "./lib/components/DatabaseButton.js");
|
|
1035
|
+
/* harmony import */ var _utils_fileUpload__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../utils/fileUpload */ "./lib/utils/fileUpload.js");
|
|
1021
1036
|
/*
|
|
1022
1037
|
* Copyright (c) Saga Inc.
|
|
1023
1038
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -1032,6 +1047,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1032
1047
|
|
|
1033
1048
|
|
|
1034
1049
|
|
|
1050
|
+
|
|
1035
1051
|
const ChatInput = ({ app, initialContent, onSave, onCancel, isEditing, contextManager, notebookTracker, agentModeEnabled = false, agentExecutionStatus = 'idle', operatingSystem = 'mac', displayOptimizedChatHistoryLength = 0, agentTargetNotebookPanelRef, isSignedUp = true, }) => {
|
|
1036
1052
|
var _a;
|
|
1037
1053
|
const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(initialContent);
|
|
@@ -1042,6 +1058,8 @@ const ChatInput = ({ app, initialContent, onSave, onCancel, isEditing, contextMa
|
|
|
1042
1058
|
const [dropdownFilter, setDropdownFilter] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('');
|
|
1043
1059
|
const [additionalContext, setAdditionalContext] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
|
|
1044
1060
|
const [isDropdownFromButton, setIsDropdownFromButton] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
1061
|
+
const [isDragOver, setIsDragOver] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
1062
|
+
const [isUploading, setIsUploading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
1045
1063
|
const handleFileUpload = (file) => {
|
|
1046
1064
|
let uploadType;
|
|
1047
1065
|
if (file.type.startsWith('image/')) {
|
|
@@ -1062,9 +1080,45 @@ const ChatInput = ({ app, initialContent, onSave, onCancel, isEditing, contextMa
|
|
|
1062
1080
|
}
|
|
1063
1081
|
]);
|
|
1064
1082
|
};
|
|
1083
|
+
// Drag and drop handlers
|
|
1084
|
+
const handleDragOver = (e) => {
|
|
1085
|
+
e.preventDefault();
|
|
1086
|
+
e.stopPropagation();
|
|
1087
|
+
// Only show drag over state if not currently uploading
|
|
1088
|
+
if (!isUploading) {
|
|
1089
|
+
setIsDragOver(true);
|
|
1090
|
+
}
|
|
1091
|
+
};
|
|
1092
|
+
const handleDragLeave = (e) => {
|
|
1093
|
+
e.preventDefault();
|
|
1094
|
+
e.stopPropagation();
|
|
1095
|
+
setIsDragOver(false);
|
|
1096
|
+
};
|
|
1097
|
+
const handleDrop = async (e) => {
|
|
1098
|
+
e.preventDefault();
|
|
1099
|
+
e.stopPropagation();
|
|
1100
|
+
setIsDragOver(false);
|
|
1101
|
+
const files = e.dataTransfer.files;
|
|
1102
|
+
if (files && files.length > 0) {
|
|
1103
|
+
const file = files[0];
|
|
1104
|
+
if (file && !isUploading) {
|
|
1105
|
+
setIsUploading(true);
|
|
1106
|
+
try {
|
|
1107
|
+
// Upload file to backend using the shared utility
|
|
1108
|
+
await (0,_utils_fileUpload__WEBPACK_IMPORTED_MODULE_4__.uploadFileToBackend)(file, notebookTracker, handleFileUpload);
|
|
1109
|
+
}
|
|
1110
|
+
catch (error) {
|
|
1111
|
+
// Error handling is already done in the utility function
|
|
1112
|
+
}
|
|
1113
|
+
finally {
|
|
1114
|
+
setIsUploading(false);
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1065
1119
|
// Debounce the active cell ID change to avoid multiple rerenders.
|
|
1066
1120
|
// We use this to avoid a flickering screen when the active cell changes.
|
|
1067
|
-
const debouncedSetActiveCellID = (0,
|
|
1121
|
+
const debouncedSetActiveCellID = (0,_hooks_useDebouncedFunction__WEBPACK_IMPORTED_MODULE_5__.useDebouncedFunction)((newID) => {
|
|
1068
1122
|
setActiveCellID(newID);
|
|
1069
1123
|
}, 100);
|
|
1070
1124
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
@@ -1292,10 +1346,13 @@ const ChatInput = ({ app, initialContent, onSave, onCancel, isEditing, contextMa
|
|
|
1292
1346
|
}
|
|
1293
1347
|
}
|
|
1294
1348
|
}, [agentModeEnabled, additionalContext, activeCellCode]);
|
|
1295
|
-
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,
|
|
1349
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_6__.classNames)("chat-input-container", {
|
|
1350
|
+
"editing": isEditing,
|
|
1351
|
+
"drag-over": isDragOver
|
|
1352
|
+
}), onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop },
|
|
1296
1353
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'context-container' },
|
|
1297
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
1298
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
1354
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_DatabaseButton__WEBPACK_IMPORTED_MODULE_7__["default"], { app: app }),
|
|
1355
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_AttachFileButton__WEBPACK_IMPORTED_MODULE_8__["default"], { onFileUploaded: handleFileUpload, notebookTracker: notebookTracker }),
|
|
1299
1356
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "context-button", onClick: () => {
|
|
1300
1357
|
var _a;
|
|
1301
1358
|
setDropdownVisible(true);
|
|
@@ -1303,9 +1360,9 @@ const ChatInput = ({ app, initialContent, onSave, onCancel, isEditing, contextMa
|
|
|
1303
1360
|
setIsDropdownFromButton(true);
|
|
1304
1361
|
(_a = textAreaRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1305
1362
|
} }, "\uFF20 Add Context"),
|
|
1306
|
-
additionalContext.map((context, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
1363
|
+
additionalContext.map((context, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_9__["default"], { key: `${context.type}-${context.value}-${index}`, title: context.display || context.value, type: context.type, onRemove: () => setAdditionalContext(additionalContext.filter((_, i) => i !== index)), notebookTracker: notebookTracker, activeCellID: activeCellID })))),
|
|
1307
1364
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'chat-input-text-area-container' },
|
|
1308
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("textarea", { ref: textAreaRef, className: (0,
|
|
1365
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("textarea", { ref: textAreaRef, className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_6__.classNames)("message", "message-user", 'chat-input', { "agent-mode": agentModeEnabled }), placeholder: getPlaceholderText(), value: input, disabled: agentExecutionStatus === 'working' || agentExecutionStatus === 'stopping', onChange: handleInputChange, onKeyDown: (e) => {
|
|
1309
1366
|
// If dropdown is visible, only handle escape to close it
|
|
1310
1367
|
if (isDropdownVisible) {
|
|
1311
1368
|
if (e.key === 'Escape') {
|
|
@@ -1332,7 +1389,7 @@ const ChatInput = ({ app, initialContent, onSave, onCancel, isEditing, contextMa
|
|
|
1332
1389
|
}
|
|
1333
1390
|
}
|
|
1334
1391
|
} }),
|
|
1335
|
-
isDropdownVisible && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
1392
|
+
isDropdownVisible && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatDropdown__WEBPACK_IMPORTED_MODULE_10__["default"], { options: getExpandedVarialbes(), onSelect: handleOptionSelect, filterText: dropdownFilter, isDropdownFromButton: isDropdownFromButton, onFilterChange: setDropdownFilter, onClose: handleDropdownClose }))),
|
|
1336
1393
|
isEditing &&
|
|
1337
1394
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "message-edit-buttons" },
|
|
1338
1395
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: () => onSave(input, undefined, mapAdditionalContext()) }, "Save"),
|
|
@@ -1374,6 +1431,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1374
1431
|
/* harmony import */ var _components_AgentComponents_AssumptionToolUI__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../components/AgentComponents/AssumptionToolUI */ "./lib/components/AgentComponents/AssumptionToolUI.js");
|
|
1375
1432
|
/* harmony import */ var _components_SelectedContextContainer__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../components/SelectedContextContainer */ "./lib/components/SelectedContextContainer.js");
|
|
1376
1433
|
/* harmony import */ var _components_AgentComponents_RunAllCellsToolUI__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../../components/AgentComponents/RunAllCellsToolUI */ "./lib/components/AgentComponents/RunAllCellsToolUI.js");
|
|
1434
|
+
/* harmony import */ var _components_AgentComponents_CreateStreamlitAppToolUI__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../../components/AgentComponents/CreateStreamlitAppToolUI */ "./lib/components/AgentComponents/CreateStreamlitAppToolUI.js");
|
|
1435
|
+
/* harmony import */ var _components_AgentComponents_EditStreamlitAppToolUI__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../../components/AgentComponents/EditStreamlitAppToolUI */ "./lib/components/AgentComponents/EditStreamlitAppToolUI.js");
|
|
1377
1436
|
/*
|
|
1378
1437
|
* Copyright (c) Saga Inc.
|
|
1379
1438
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -1396,6 +1455,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1396
1455
|
|
|
1397
1456
|
|
|
1398
1457
|
|
|
1458
|
+
|
|
1459
|
+
|
|
1399
1460
|
|
|
1400
1461
|
|
|
1401
1462
|
const ChatMessage = ({ app, message, promptType, agentResponse, messageIndex, mitoAIConnectionError, mitoAIConnectionErrorType, notebookTracker, renderMimeRegistry, isLastAiMessage, isLastMessage, operatingSystem, previewAICode, acceptAICode, rejectAICode, onUpdateMessage, contextManager, codeReviewStatus, setNextSteps, agentModeEnabled, additionalContext, }) => {
|
|
@@ -1491,7 +1552,11 @@ const ChatMessage = ({ app, message, promptType, agentResponse, messageIndex, mi
|
|
|
1491
1552
|
(agentResponse === null || agentResponse === void 0 ? void 0 : agentResponse.type) === 'get_cell_output' &&
|
|
1492
1553
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_AgentComponents_GetCellOutputToolUI__WEBPACK_IMPORTED_MODULE_18__["default"], null),
|
|
1493
1554
|
(agentResponse === null || agentResponse === void 0 ? void 0 : agentResponse.type) === 'run_all_cells' && agentModeEnabled &&
|
|
1494
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_AgentComponents_RunAllCellsToolUI__WEBPACK_IMPORTED_MODULE_19__["default"], null)
|
|
1555
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_AgentComponents_RunAllCellsToolUI__WEBPACK_IMPORTED_MODULE_19__["default"], null),
|
|
1556
|
+
(agentResponse === null || agentResponse === void 0 ? void 0 : agentResponse.type) === 'create_streamlit_app' && agentModeEnabled &&
|
|
1557
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_AgentComponents_CreateStreamlitAppToolUI__WEBPACK_IMPORTED_MODULE_20__["default"], { isRunning: isLastMessage }),
|
|
1558
|
+
(agentResponse === null || agentResponse === void 0 ? void 0 : agentResponse.type) === 'edit_streamlit_app' && agentModeEnabled &&
|
|
1559
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_AgentComponents_EditStreamlitAppToolUI__WEBPACK_IMPORTED_MODULE_21__["default"], { isRunning: isLastMessage })));
|
|
1495
1560
|
};
|
|
1496
1561
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatMessage);
|
|
1497
1562
|
|
|
@@ -2028,16 +2093,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2028
2093
|
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
|
|
2029
2094
|
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__);
|
|
2030
2095
|
/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
|
|
2031
|
-
/* harmony import */ var
|
|
2032
|
-
/* harmony import */ var
|
|
2096
|
+
/* harmony import */ var _components_AgentComponents_ErrorFixupToolUI__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../../components/AgentComponents/ErrorFixupToolUI */ "./lib/components/AgentComponents/ErrorFixupToolUI.js");
|
|
2097
|
+
/* harmony import */ var _components_DropdownMenu__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../components/DropdownMenu */ "./lib/components/DropdownMenu.js");
|
|
2033
2098
|
/* harmony import */ var _components_IconButton__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../components/IconButton */ "./lib/components/IconButton.js");
|
|
2034
|
-
/* harmony import */ var
|
|
2099
|
+
/* harmony import */ var _components_LoadingCircle__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../../components/LoadingCircle */ "./lib/components/LoadingCircle.js");
|
|
2035
2100
|
/* harmony import */ var _components_ModelSelector__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../components/ModelSelector */ "./lib/components/ModelSelector.js");
|
|
2036
|
-
/* harmony import */ var
|
|
2037
|
-
/* harmony import */ var
|
|
2038
|
-
/* harmony import */ var
|
|
2039
|
-
/* harmony import */ var
|
|
2040
|
-
/* harmony import */ var
|
|
2101
|
+
/* harmony import */ var _components_NextStepsPills__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../../components/NextStepsPills */ "./lib/components/NextStepsPills.js");
|
|
2102
|
+
/* harmony import */ var _components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../../components/TextAndIconButton */ "./lib/components/TextAndIconButton.js");
|
|
2103
|
+
/* harmony import */ var _components_ToggleButton__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../../components/ToggleButton */ "./lib/components/ToggleButton.js");
|
|
2104
|
+
/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../icons */ "./lib/icons/index.js");
|
|
2105
|
+
/* harmony import */ var _icons_UndoIcon__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../../icons/UndoIcon */ "./lib/icons/UndoIcon.js");
|
|
2041
2106
|
/* harmony import */ var _utils_agentActions__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../utils/agentActions */ "./lib/utils/agentActions.js");
|
|
2042
2107
|
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../utils/classNames */ "./lib/utils/classNames.js");
|
|
2043
2108
|
/* harmony import */ var _utils_blacklistedWords__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../utils/blacklistedWords */ "./lib/utils/blacklistedWords.js");
|
|
@@ -2054,19 +2119,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2054
2119
|
/* harmony import */ var _utils_userSignupState__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/userSignupState */ "./lib/utils/userSignupState.js");
|
|
2055
2120
|
/* harmony import */ var _SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../SettingsManager/SettingsManagerPlugin */ "./lib/Extensions/SettingsManager/SettingsManagerPlugin.js");
|
|
2056
2121
|
/* harmony import */ var _SettingsManager_profiler_ProfilerPage__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../SettingsManager/profiler/ProfilerPage */ "./lib/Extensions/SettingsManager/profiler/ProfilerPage.js");
|
|
2057
|
-
/* harmony import */ var
|
|
2058
|
-
/* harmony import */ var
|
|
2122
|
+
/* harmony import */ var _CTACarousel__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./CTACarousel */ "./lib/Extensions/AiChat/CTACarousel.js");
|
|
2123
|
+
/* harmony import */ var _UsageBadge__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./UsageBadge */ "./lib/Extensions/AiChat/UsageBadge.js");
|
|
2124
|
+
/* harmony import */ var _SignUpForm__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./SignUpForm */ "./lib/Extensions/AiChat/SignUpForm.js");
|
|
2059
2125
|
/* harmony import */ var _CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CodeDiffDisplay */ "./lib/Extensions/AiChat/CodeDiffDisplay.js");
|
|
2060
2126
|
/* harmony import */ var _FirstMessage__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FirstMessage */ "./lib/Extensions/AiChat/FirstMessage.js");
|
|
2061
|
-
/* harmony import */ var
|
|
2062
|
-
/* harmony import */ var
|
|
2063
|
-
/* harmony import */ var
|
|
2064
|
-
/* harmony import */ var
|
|
2127
|
+
/* harmony import */ var _ChatMessage_ChatInput__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./ChatMessage/ChatInput */ "./lib/Extensions/AiChat/ChatMessage/ChatInput.js");
|
|
2128
|
+
/* harmony import */ var _ChatMessage_ChatMessage__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./ChatMessage/ChatMessage */ "./lib/Extensions/AiChat/ChatMessage/ChatMessage.js");
|
|
2129
|
+
/* harmony import */ var _ChatMessage_RevertQuestionnaire__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./ChatMessage/RevertQuestionnaire */ "./lib/Extensions/AiChat/ChatMessage/RevertQuestionnaire.js");
|
|
2130
|
+
/* harmony import */ var _ChatMessage_ScrollableSuggestions__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./ChatMessage/ScrollableSuggestions */ "./lib/Extensions/AiChat/ChatMessage/ScrollableSuggestions.js");
|
|
2065
2131
|
/* harmony import */ var _ChatHistoryManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ChatHistoryManager */ "./lib/Extensions/AiChat/ChatHistoryManager.js");
|
|
2066
2132
|
/* harmony import */ var _style_button_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../style/button.css */ "./style/button.css");
|
|
2067
2133
|
/* harmony import */ var _style_ChatTaskpane_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../style/ChatTaskpane.css */ "./style/ChatTaskpane.css");
|
|
2068
2134
|
/* harmony import */ var _style_TextButton_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../style/TextButton.css */ "./style/TextButton.css");
|
|
2069
|
-
/* harmony import */ var
|
|
2135
|
+
/* harmony import */ var _components_LoadingDots__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../../components/LoadingDots */ "./lib/components/LoadingDots.js");
|
|
2070
2136
|
/*
|
|
2071
2137
|
* Copyright (c) Saga Inc.
|
|
2072
2138
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -2118,19 +2184,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2118
2184
|
|
|
2119
2185
|
|
|
2120
2186
|
|
|
2187
|
+
|
|
2121
2188
|
// Styles
|
|
2122
2189
|
|
|
2123
2190
|
|
|
2124
2191
|
|
|
2125
2192
|
|
|
2126
2193
|
const AGENT_EXECUTION_DEPTH_LIMIT = 20;
|
|
2127
|
-
const getDefaultChatHistoryManager = (notebookTracker, contextManager) => {
|
|
2128
|
-
const chatHistoryManager = new _ChatHistoryManager__WEBPACK_IMPORTED_MODULE_7__.ChatHistoryManager(contextManager, notebookTracker);
|
|
2194
|
+
const getDefaultChatHistoryManager = (notebookTracker, contextManager, app, streamlitPreviewManager) => {
|
|
2195
|
+
const chatHistoryManager = new _ChatHistoryManager__WEBPACK_IMPORTED_MODULE_7__.ChatHistoryManager(contextManager, notebookTracker, app, streamlitPreviewManager);
|
|
2129
2196
|
return chatHistoryManager;
|
|
2130
2197
|
};
|
|
2131
|
-
const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app, operatingSystem, websocketClient, }) => {
|
|
2198
|
+
const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, streamlitPreviewManager, app, operatingSystem, websocketClient, }) => {
|
|
2132
2199
|
const [isSignedUp, setIsSignedUp] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true);
|
|
2133
|
-
const [chatHistoryManager, setChatHistoryManager] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => getDefaultChatHistoryManager(notebookTracker, contextManager));
|
|
2200
|
+
const [chatHistoryManager, setChatHistoryManager] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(() => getDefaultChatHistoryManager(notebookTracker, contextManager, app, streamlitPreviewManager));
|
|
2134
2201
|
const chatHistoryManagerRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(chatHistoryManager);
|
|
2135
2202
|
const [loadingAIResponse, setLoadingAIResponse] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
|
|
2136
2203
|
// Store the original cell before diff so that we can revert to it if the user rejects the AI's code
|
|
@@ -2168,6 +2235,8 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2168
2235
|
// we don't need to handle the undefined case everywhere, we just default to an empty string knowing that
|
|
2169
2236
|
// it will always be set to a valid thread id before it is used.
|
|
2170
2237
|
const activeThreadIdRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)('');
|
|
2238
|
+
// Ref to trigger refresh of the usage badge
|
|
2239
|
+
const usageBadgeRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
|
|
2171
2240
|
/*
|
|
2172
2241
|
Three possible states:
|
|
2173
2242
|
1. working: the agent is working on the task
|
|
@@ -2233,7 +2302,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2233
2302
|
};
|
|
2234
2303
|
const chatHistoryResponse = await websocketClient.sendMessage(fetchHistoryCompletionRequest);
|
|
2235
2304
|
// Create a fresh ChatHistoryManager and add the initial messages
|
|
2236
|
-
const newChatHistoryManager = getDefaultChatHistoryManager(notebookTracker, contextManager);
|
|
2305
|
+
const newChatHistoryManager = getDefaultChatHistoryManager(notebookTracker, contextManager, app, streamlitPreviewManager);
|
|
2237
2306
|
// Each thread only contains agent or chat messages. For now, we enforce this by clearing the chat
|
|
2238
2307
|
// when the user switches mode. When the user reloads a chat, we want to put them back into the same
|
|
2239
2308
|
// chat mode so that we use the correct system message and preserve this one-type of message invariant.
|
|
@@ -2303,7 +2372,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2303
2372
|
// Enable follow mode when starting a new chat
|
|
2304
2373
|
setAutoScrollFollowMode(true);
|
|
2305
2374
|
// Reset frontend chat history
|
|
2306
|
-
const newChatHistoryManager = getDefaultChatHistoryManager(notebookTracker, contextManager);
|
|
2375
|
+
const newChatHistoryManager = getDefaultChatHistoryManager(notebookTracker, contextManager, app, streamlitPreviewManager);
|
|
2307
2376
|
setChatHistoryManager(newChatHistoryManager);
|
|
2308
2377
|
// Notify the backend to request a new chat thread and get its ID
|
|
2309
2378
|
try {
|
|
@@ -2366,7 +2435,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2366
2435
|
}
|
|
2367
2436
|
}
|
|
2368
2437
|
catch (error) {
|
|
2369
|
-
const newChatHistoryManager = getDefaultChatHistoryManager(notebookTracker, contextManager);
|
|
2438
|
+
const newChatHistoryManager = getDefaultChatHistoryManager(notebookTracker, contextManager, app, streamlitPreviewManager);
|
|
2370
2439
|
addAIMessageFromResponseAndUpdateState(error.title ? error.title : `${error}`, 'chat', newChatHistoryManager, false);
|
|
2371
2440
|
addAIMessageFromResponseAndUpdateState(error.hint ? error.hint : `${error}`, 'chat', newChatHistoryManager, true);
|
|
2372
2441
|
}
|
|
@@ -2720,6 +2789,10 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2720
2789
|
if (activeRequestControllerRef.current === abortController) {
|
|
2721
2790
|
activeRequestControllerRef.current = null;
|
|
2722
2791
|
}
|
|
2792
|
+
// Refresh the usage badge to reflect updated usage count
|
|
2793
|
+
if (usageBadgeRef.current) {
|
|
2794
|
+
void usageBadgeRef.current.refresh();
|
|
2795
|
+
}
|
|
2723
2796
|
return true;
|
|
2724
2797
|
};
|
|
2725
2798
|
const addAIMessageFromResponseAndUpdateState = (messageContent, promptType, chatHistoryManager, mitoAIConnectionError = false, mitoAIConnectionErrorType = null) => {
|
|
@@ -2742,9 +2815,9 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2742
2815
|
activeRequestControllerRef.current.abort();
|
|
2743
2816
|
activeRequestControllerRef.current = null;
|
|
2744
2817
|
}
|
|
2745
|
-
// Add feedback message based on reason
|
|
2746
2818
|
const newChatHistoryManager = getDuplicateChatHistoryManager();
|
|
2747
|
-
addAIMessageFromResponseAndUpdateState("Agent stopped by user.", 'chat',
|
|
2819
|
+
addAIMessageFromResponseAndUpdateState("Agent stopped by user.", 'chat', // TODO: This probably should not be type 'chat' because that is reserved for a chat thread!
|
|
2820
|
+
newChatHistoryManager);
|
|
2748
2821
|
// Send stop message to backend
|
|
2749
2822
|
await websocketClient.sendMessage({
|
|
2750
2823
|
type: "stop_agent",
|
|
@@ -2769,6 +2842,13 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2769
2842
|
let isAgentFinished = false;
|
|
2770
2843
|
let agentExecutionDepth = 1;
|
|
2771
2844
|
let sendCellIDOutput = undefined;
|
|
2845
|
+
// Sometimes its useful to send extra information back to the agent. For example,
|
|
2846
|
+
// if the agent tries to create a streamlit app and it errors, we want to let the
|
|
2847
|
+
// orchestrator agent know about the issue.
|
|
2848
|
+
// TODO: Ideally this would be a different type of message that does not show up
|
|
2849
|
+
// as a user message in the chat taskpane, but this is the only mechanism we have
|
|
2850
|
+
// right now.
|
|
2851
|
+
let messageToShareWithAgent = undefined;
|
|
2772
2852
|
// Loop through each message in the plan and send it to the AI
|
|
2773
2853
|
while (!isAgentFinished && agentExecutionDepth <= AGENT_EXECUTION_DEPTH_LIMIT) {
|
|
2774
2854
|
// Check if we should continue execution
|
|
@@ -2782,9 +2862,10 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2782
2862
|
await sendAgentExecutionMessage(input, messageIndex, undefined, additionalContext);
|
|
2783
2863
|
}
|
|
2784
2864
|
else {
|
|
2785
|
-
await sendAgentExecutionMessage('', undefined, sendCellIDOutput);
|
|
2865
|
+
await sendAgentExecutionMessage(messageToShareWithAgent || '', undefined, sendCellIDOutput);
|
|
2786
2866
|
// Reset flag back to false until the agent requests the active cell output again
|
|
2787
2867
|
sendCellIDOutput = undefined;
|
|
2868
|
+
messageToShareWithAgent = undefined;
|
|
2788
2869
|
}
|
|
2789
2870
|
// Iterate the agent execution depth
|
|
2790
2871
|
agentExecutionDepth++;
|
|
@@ -2828,6 +2909,12 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2828
2909
|
isAgentFinished = true;
|
|
2829
2910
|
break;
|
|
2830
2911
|
}
|
|
2912
|
+
// TODO: If we created a validated type in the agent response validation function, then we woulnd't need to do these checks
|
|
2913
|
+
if (agentResponse.type === 'edit_streamlit_app' && (agentResponse.edit_streamlit_app_prompt === undefined || agentResponse.edit_streamlit_app_prompt === null)) {
|
|
2914
|
+
await markAgentForStopping();
|
|
2915
|
+
isAgentFinished = true;
|
|
2916
|
+
break;
|
|
2917
|
+
}
|
|
2831
2918
|
if (agentResponse.type === 'cell_update' && agentResponse.cell_update) {
|
|
2832
2919
|
// Run the code and handle any errors
|
|
2833
2920
|
await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_20__.acceptAndRunCellUpdate)(agentResponse.cell_update, agentTargetNotebookPanelRef.current);
|
|
@@ -2866,6 +2953,28 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
2866
2953
|
}
|
|
2867
2954
|
}
|
|
2868
2955
|
}
|
|
2956
|
+
if (agentResponse.type === 'create_streamlit_app') {
|
|
2957
|
+
// Create new preview using the service
|
|
2958
|
+
const streamlitPreviewResponse = await streamlitPreviewManager.openAppPreview(app, agentTargetNotebookPanelRef.current);
|
|
2959
|
+
if (streamlitPreviewResponse.type === 'error') {
|
|
2960
|
+
messageToShareWithAgent = streamlitPreviewResponse.message;
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
if (agentResponse.type === 'edit_streamlit_app' && agentResponse.edit_streamlit_app_prompt) {
|
|
2964
|
+
// Ensure there is an active preview to edit
|
|
2965
|
+
if (!streamlitPreviewManager.hasActivePreview()) {
|
|
2966
|
+
const streamlitPreviewResponse = await streamlitPreviewManager.openAppPreview(app, agentTargetNotebookPanelRef.current);
|
|
2967
|
+
if (streamlitPreviewResponse.type === 'error') {
|
|
2968
|
+
messageToShareWithAgent = streamlitPreviewResponse.message;
|
|
2969
|
+
continue;
|
|
2970
|
+
}
|
|
2971
|
+
}
|
|
2972
|
+
// Edit the existing preview
|
|
2973
|
+
const streamlitPreviewResponse = await streamlitPreviewManager.editExistingPreview(agentResponse.edit_streamlit_app_prompt, agentTargetNotebookPanelRef.current);
|
|
2974
|
+
if (streamlitPreviewResponse.type === 'error') {
|
|
2975
|
+
messageToShareWithAgent = streamlitPreviewResponse.message;
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2869
2978
|
}
|
|
2870
2979
|
if (agentExecutionDepth > AGENT_EXECUTION_DEPTH_LIMIT) {
|
|
2871
2980
|
addAIMessageFromResponseAndUpdateState("Since I've been working for a while now, give my work a review and then tell me how to continue.", 'agent:execution', chatHistoryManager);
|
|
@@ -3138,14 +3247,15 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
3138
3247
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-taskpane-header-left" },
|
|
3139
3248
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_27__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.settingsIcon.react, null), title: "Mito AI Settings", onClick: () => {
|
|
3140
3249
|
void app.commands.execute(_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_28__.COMMAND_MITO_AI_SETTINGS);
|
|
3141
|
-
} })
|
|
3250
|
+
} }),
|
|
3251
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_UsageBadge__WEBPACK_IMPORTED_MODULE_29__["default"], { app: app, ref: usageBadgeRef })),
|
|
3142
3252
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-taskpane-header-right" },
|
|
3143
3253
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_27__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.addIcon.react, null), title: "Start New Chat", onClick: async () => { await startNewChat(); } }),
|
|
3144
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3254
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_DropdownMenu__WEBPACK_IMPORTED_MODULE_30__["default"], { trigger: react__WEBPACK_IMPORTED_MODULE_1___default().createElement("button", { className: "icon-button", title: "Chat Threads", onClick: fetchChatThreads },
|
|
3145
3255
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.historyIcon.react, null)), items: chatThreads.length > 0
|
|
3146
3256
|
? chatThreads.map(thread => ({
|
|
3147
3257
|
label: thread.name,
|
|
3148
|
-
primaryIcon: activeThreadIdRef.current === thread.thread_id ?
|
|
3258
|
+
primaryIcon: activeThreadIdRef.current === thread.thread_id ? _icons__WEBPACK_IMPORTED_MODULE_31__.OpenIndicatorLabIcon.react : undefined,
|
|
3149
3259
|
onClick: () => fetchChatHistoryAndSetActiveThread(thread.thread_id),
|
|
3150
3260
|
secondaryActions: [
|
|
3151
3261
|
{
|
|
@@ -3163,25 +3273,25 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
3163
3273
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-messages", ref: chatMessagesRef },
|
|
3164
3274
|
displayOptimizedChatHistory.length === 0 &&
|
|
3165
3275
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-empty-message" }, isSignedUp === false
|
|
3166
|
-
? react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3167
|
-
: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3276
|
+
? react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_SignUpForm__WEBPACK_IMPORTED_MODULE_32__["default"], { onSignUpSuccess: refreshUserSignupState })
|
|
3277
|
+
: react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_CTACarousel__WEBPACK_IMPORTED_MODULE_33__["default"], { app: app })),
|
|
3168
3278
|
processedDisplayOptimizedChatHistory.map((displayOptimizedChat, index) => {
|
|
3169
3279
|
if (isGroupedErrorMessages(displayOptimizedChat)) {
|
|
3170
|
-
return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3280
|
+
return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_AgentComponents_ErrorFixupToolUI__WEBPACK_IMPORTED_MODULE_34__["default"], { key: index, messages: displayOptimizedChat, renderMimeRegistry: renderMimeRegistry }));
|
|
3171
3281
|
}
|
|
3172
3282
|
else {
|
|
3173
|
-
return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3283
|
+
return (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ChatMessage__WEBPACK_IMPORTED_MODULE_35__["default"], { key: index, message: displayOptimizedChat.message, promptType: displayOptimizedChat.promptType, agentResponse: displayOptimizedChat.agentResponse, codeCellID: displayOptimizedChat.codeCellID, mitoAIConnectionError: displayOptimizedChat.type === 'connection error', mitoAIConnectionErrorType: displayOptimizedChat.mitoAIConnectionErrorType || null, messageIndex: index, notebookTracker: notebookTracker, renderMimeRegistry: renderMimeRegistry, app: app, isLastAiMessage: index === lastAIMessagesIndex, isLastMessage: index === displayOptimizedChatHistory.length - 1, operatingSystem: operatingSystem, previewAICode: previewAICodeToActiveCell, acceptAICode: acceptAICode, rejectAICode: rejectAICode, onUpdateMessage: handleUpdateMessage, contextManager: contextManager, codeReviewStatus: codeReviewStatus, setNextSteps: setNextSteps, agentModeEnabled: agentModeEnabled, additionalContext: displayOptimizedChat.additionalContext }));
|
|
3174
3284
|
}
|
|
3175
3285
|
}).filter(message => message !== null),
|
|
3176
3286
|
loadingAIResponse &&
|
|
3177
3287
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-loading-message" },
|
|
3178
3288
|
"Thinking ",
|
|
3179
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3289
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_LoadingDots__WEBPACK_IMPORTED_MODULE_36__["default"], null)),
|
|
3180
3290
|
hasCheckpoint &&
|
|
3181
3291
|
agentModeEnabled &&
|
|
3182
3292
|
agentExecutionStatus === 'idle' &&
|
|
3183
3293
|
displayOptimizedChatHistory.length > 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: 'message message-assistant-chat' },
|
|
3184
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3294
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_37__["default"], { text: "Revert changes", icon: _icons_UndoIcon__WEBPACK_IMPORTED_MODULE_38__["default"], title: "Revert changes", onClick: () => {
|
|
3185
3295
|
void (0,_utils_checkpoint__WEBPACK_IMPORTED_MODULE_17__.restoreCheckpoint)(app, notebookTracker, setHasCheckpoint);
|
|
3186
3296
|
setDisplayedNextStepsIfAvailable(false);
|
|
3187
3297
|
setHasCheckpoint(false);
|
|
@@ -3189,9 +3299,9 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
3189
3299
|
(0,_utils_scroll__WEBPACK_IMPORTED_MODULE_13__.scrollToDiv)(chatMessagesRef);
|
|
3190
3300
|
}, variant: "gray", width: "fit-contents", iconPosition: "left" }),
|
|
3191
3301
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("p", { className: "text-muted text-sm" }, "Undo the most recent changes made by the agent"))),
|
|
3192
|
-
showRevertQuestionnaire && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3302
|
+
showRevertQuestionnaire && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_RevertQuestionnaire__WEBPACK_IMPORTED_MODULE_39__["default"], { onDestroy: () => setShowRevertQuestionnaire(false), getDuplicateChatHistoryManager: getDuplicateChatHistoryManager, setChatHistoryManager: setChatHistoryManager }))),
|
|
3193
3303
|
displayOptimizedChatHistory.length === 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "suggestions-container" },
|
|
3194
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3304
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ScrollableSuggestions__WEBPACK_IMPORTED_MODULE_40__["default"], { onSelectSuggestion: (prompt) => {
|
|
3195
3305
|
if (agentModeEnabled) {
|
|
3196
3306
|
void startAgentExecution(prompt);
|
|
3197
3307
|
}
|
|
@@ -3200,11 +3310,11 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
3200
3310
|
}
|
|
3201
3311
|
} }))),
|
|
3202
3312
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: `connected-input-container ${nextSteps.length > 0 ? 'has-next-steps' : ''}` },
|
|
3203
|
-
nextSteps.length > 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3204
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3313
|
+
nextSteps.length > 0 && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_NextStepsPills__WEBPACK_IMPORTED_MODULE_41__["default"], { nextSteps: nextSteps, onSelectNextStep: agentModeEnabled ? startAgentExecution : sendChatInputMessage, displayedNextStepsIfAvailable: displayedNextStepsIfAvailable, setDisplayedNextStepsIfAvailable: setDisplayedNextStepsIfAvailable })),
|
|
3314
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_ChatMessage_ChatInput__WEBPACK_IMPORTED_MODULE_42__["default"], { app: app, initialContent: '', onSave: agentModeEnabled ? startAgentExecution : sendChatInputMessage, onCancel: undefined, isEditing: false, contextManager: contextManager, notebookTracker: notebookTracker, agentModeEnabled: agentModeEnabled, agentExecutionStatus: agentExecutionStatus, operatingSystem: operatingSystem, displayOptimizedChatHistoryLength: displayOptimizedChatHistory.length, agentTargetNotebookPanelRef: agentTargetNotebookPanelRef, isSignedUp: isSignedUp })),
|
|
3205
3315
|
agentExecutionStatus !== 'working' && agentExecutionStatus !== 'stopping' && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-controls" },
|
|
3206
3316
|
react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "chat-controls-left" },
|
|
3207
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3317
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_ToggleButton__WEBPACK_IMPORTED_MODULE_43__["default"], { leftText: "Chat", leftTooltip: "Chat mode suggests an edit to the active cell and let's you decide to accept or reject it.", rightText: "Agent", rightTooltip: "Agent mode writes and executes code until it's finished your request.", isLeftSelected: !agentModeEnabled, onChange: async (isLeftSelected) => {
|
|
3208
3318
|
await startNewChat(); // TODO: delete thread instead of starting new chat
|
|
3209
3319
|
setAgentModeEnabled(!isLeftSelected);
|
|
3210
3320
|
// Clear agent checkpoint when switching modes
|
|
@@ -3240,7 +3350,7 @@ const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app
|
|
|
3240
3350
|
" \u23CE"))),
|
|
3241
3351
|
(agentExecutionStatus === 'working' || agentExecutionStatus === 'stopping') && (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("button", { className: "button-base button-red stop-agent-button", onClick: () => void markAgentForStopping('userStop'), disabled: agentExecutionStatus === 'stopping', "data-testid": "stop-agent-button" }, agentExecutionStatus === 'stopping' ? (react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", { className: "stop-agent-button-content" },
|
|
3242
3352
|
"Stopping",
|
|
3243
|
-
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(
|
|
3353
|
+
react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_components_LoadingCircle__WEBPACK_IMPORTED_MODULE_44__["default"], null),
|
|
3244
3354
|
" ")) : ('Stop Agent')))));
|
|
3245
3355
|
};
|
|
3246
3356
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatTaskpane);
|
|
@@ -3329,7 +3439,7 @@ class ChatWidget extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.React
|
|
|
3329
3439
|
super.dispose();
|
|
3330
3440
|
}
|
|
3331
3441
|
render() {
|
|
3332
|
-
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatTaskpane__WEBPACK_IMPORTED_MODULE_6__["default"], { app: this.options.app, notebookTracker: this.options.notebookTracker, renderMimeRegistry: this.options.renderMimeRegistry, contextManager: this.options.contextManager, operatingSystem: this.options.operatingSystem, websocketClient: this.websocketClient }));
|
|
3442
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatTaskpane__WEBPACK_IMPORTED_MODULE_6__["default"], { app: this.options.app, notebookTracker: this.options.notebookTracker, renderMimeRegistry: this.options.renderMimeRegistry, contextManager: this.options.contextManager, streamlitPreviewManager: this.options.streamlitPreviewManager, operatingSystem: this.options.operatingSystem, websocketClient: this.websocketClient }));
|
|
3333
3443
|
}
|
|
3334
3444
|
onMessage(client, message) {
|
|
3335
3445
|
switch (message.type) {
|
|
@@ -3342,7 +3452,7 @@ class ChatWidget extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.React
|
|
|
3342
3452
|
}
|
|
3343
3453
|
}
|
|
3344
3454
|
}
|
|
3345
|
-
function buildChatWidget(app, notebookTracker, renderMimeRegistry, contextManager) {
|
|
3455
|
+
function buildChatWidget(app, notebookTracker, renderMimeRegistry, contextManager, streamlitPreviewManager) {
|
|
3346
3456
|
// Get the operating system here so we don't have to do it each time the chat changes.
|
|
3347
3457
|
// The operating system won't change, duh.
|
|
3348
3458
|
const operatingSystem = (0,_utils_user__WEBPACK_IMPORTED_MODULE_7__.getOperatingSystem)();
|
|
@@ -3351,6 +3461,7 @@ function buildChatWidget(app, notebookTracker, renderMimeRegistry, contextManage
|
|
|
3351
3461
|
notebookTracker,
|
|
3352
3462
|
renderMimeRegistry,
|
|
3353
3463
|
contextManager,
|
|
3464
|
+
streamlitPreviewManager: streamlitPreviewManager,
|
|
3354
3465
|
operatingSystem
|
|
3355
3466
|
});
|
|
3356
3467
|
chatWidget.id = 'mito_ai';
|
|
@@ -3567,6 +3678,94 @@ const SignUpForm = ({ onSignUpSuccess }) => {
|
|
|
3567
3678
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SignUpForm);
|
|
3568
3679
|
|
|
3569
3680
|
|
|
3681
|
+
/***/ }),
|
|
3682
|
+
|
|
3683
|
+
/***/ "./lib/Extensions/AiChat/UsageBadge.js":
|
|
3684
|
+
/*!*********************************************!*\
|
|
3685
|
+
!*** ./lib/Extensions/AiChat/UsageBadge.js ***!
|
|
3686
|
+
\*********************************************/
|
|
3687
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3688
|
+
|
|
3689
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3690
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3691
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
3692
|
+
/* harmony export */ });
|
|
3693
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
3694
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
3695
|
+
/* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
|
|
3696
|
+
/* harmony import */ var _style_UsageBadge_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../style/UsageBadge.css */ "./style/UsageBadge.css");
|
|
3697
|
+
/* harmony import */ var _SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../SettingsManager/SettingsManagerPlugin */ "./lib/Extensions/SettingsManager/SettingsManagerPlugin.js");
|
|
3698
|
+
/*
|
|
3699
|
+
* Copyright (c) Saga Inc.
|
|
3700
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
3701
|
+
*/
|
|
3702
|
+
|
|
3703
|
+
|
|
3704
|
+
|
|
3705
|
+
|
|
3706
|
+
const MAX_FREE_USAGE = 150;
|
|
3707
|
+
const SVG_SIZE = 16;
|
|
3708
|
+
const CIRCLE_RADIUS = 5.5;
|
|
3709
|
+
const CIRCLE_CENTER = SVG_SIZE / 2; // Center x and y coordinates
|
|
3710
|
+
const UsageBadge = (0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({ app }, ref) => {
|
|
3711
|
+
const [isPro, setIsPro] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
3712
|
+
const [usageCount, setUsageCount] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
|
|
3713
|
+
const getAiMitoApiNumUsages = async () => {
|
|
3714
|
+
const usageCount = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_2__.getUserKey)('ai_mito_api_num_usages');
|
|
3715
|
+
return usageCount ? parseInt(usageCount) : 0;
|
|
3716
|
+
};
|
|
3717
|
+
const fetchIsPro = async () => {
|
|
3718
|
+
const isPro = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_2__.getUserKey)('is_pro');
|
|
3719
|
+
setIsPro(isPro === 'True');
|
|
3720
|
+
};
|
|
3721
|
+
const fetchUsageCount = async () => {
|
|
3722
|
+
const count = await getAiMitoApiNumUsages();
|
|
3723
|
+
setUsageCount(count);
|
|
3724
|
+
};
|
|
3725
|
+
// Expose refresh method to parent component
|
|
3726
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, () => ({
|
|
3727
|
+
refresh: async () => {
|
|
3728
|
+
await Promise.all([fetchIsPro(), fetchUsageCount()]);
|
|
3729
|
+
}
|
|
3730
|
+
}));
|
|
3731
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
3732
|
+
void fetchIsPro();
|
|
3733
|
+
void fetchUsageCount();
|
|
3734
|
+
}, []);
|
|
3735
|
+
// Calculate progress
|
|
3736
|
+
const percentage = Math.min((usageCount / MAX_FREE_USAGE) * 100, 100);
|
|
3737
|
+
const circumference = 2 * Math.PI * CIRCLE_RADIUS;
|
|
3738
|
+
const strokeDashoffset = circumference - (percentage / 100) * circumference;
|
|
3739
|
+
// Determine color based on usage - green to red
|
|
3740
|
+
const getColor = () => {
|
|
3741
|
+
if (percentage < 50)
|
|
3742
|
+
return 'var(--green-600)';
|
|
3743
|
+
if (percentage < 80)
|
|
3744
|
+
return 'var(--yellow-600)';
|
|
3745
|
+
return 'var(--red-500)';
|
|
3746
|
+
};
|
|
3747
|
+
if (isPro) {
|
|
3748
|
+
// If the user is pro, don't show the usage badge
|
|
3749
|
+
return null;
|
|
3750
|
+
}
|
|
3751
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "usage-badge", onClick: () => {
|
|
3752
|
+
void app.commands.execute(_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_3__.COMMAND_MITO_AI_SETTINGS_SUBSCRIPTION);
|
|
3753
|
+
}, title: `${usageCount}/${MAX_FREE_USAGE} free AI messages used` },
|
|
3754
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { className: "usage-badge-svg", width: SVG_SIZE, height: SVG_SIZE },
|
|
3755
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("circle", { className: "usage-badge-circle-background", cx: CIRCLE_CENTER, cy: CIRCLE_CENTER, r: CIRCLE_RADIUS }),
|
|
3756
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("circle", { className: "usage-badge-circle-progress", style: {
|
|
3757
|
+
stroke: getColor(),
|
|
3758
|
+
strokeDasharray: circumference,
|
|
3759
|
+
strokeDashoffset: strokeDashoffset,
|
|
3760
|
+
}, cx: CIRCLE_CENTER, cy: CIRCLE_CENTER, r: CIRCLE_RADIUS })),
|
|
3761
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "usage-badge-text" }, usageCount >= MAX_FREE_USAGE
|
|
3762
|
+
? 'Upgrade to Pro'
|
|
3763
|
+
: `${usageCount}/${MAX_FREE_USAGE}`)));
|
|
3764
|
+
});
|
|
3765
|
+
UsageBadge.displayName = 'UsageBadge';
|
|
3766
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UsageBadge);
|
|
3767
|
+
|
|
3768
|
+
|
|
3570
3769
|
/***/ }),
|
|
3571
3770
|
|
|
3572
3771
|
/***/ "./lib/Extensions/AiChat/jupyterSettingsManager.js":
|
|
@@ -3711,7 +3910,7 @@ function validateAndCorrectAgentResponse(agentResponse) {
|
|
|
3711
3910
|
// Create a copy to avoid mutating the original
|
|
3712
3911
|
const correctedResponse = { ...agentResponse };
|
|
3713
3912
|
// Ensure type is valid. Default to finished_task if not valid.
|
|
3714
|
-
const validTypes = ['cell_update', 'get_cell_output', 'run_all_cells', 'finished_task'];
|
|
3913
|
+
const validTypes = ['cell_update', 'get_cell_output', 'run_all_cells', 'finished_task', 'create_streamlit_app', 'edit_streamlit_app'];
|
|
3715
3914
|
correctedResponse.type = (correctedResponse.type && validTypes.includes(correctedResponse.type))
|
|
3716
3915
|
? correctedResponse.type
|
|
3717
3916
|
: 'finished_task';
|
|
@@ -3732,6 +3931,9 @@ function validateAndCorrectAgentResponse(agentResponse) {
|
|
|
3732
3931
|
// No empty strings in the assumptions
|
|
3733
3932
|
correctedResponse.analysis_assumptions = (_a = correctedResponse.analysis_assumptions) === null || _a === void 0 ? void 0 : _a.filter(assumption => assumption.trim() !== '');
|
|
3734
3933
|
}
|
|
3934
|
+
// Correct edit_streamlit_app_prompt - ensure it's a string when present
|
|
3935
|
+
const editStreamlitAppPromptType = typeof correctedResponse.edit_streamlit_app_prompt;
|
|
3936
|
+
correctedResponse.edit_streamlit_app_prompt = editStreamlitAppPromptType === 'string' ? correctedResponse.edit_streamlit_app_prompt : undefined;
|
|
3735
3937
|
// For now we don't validate the cell_update object itself, as this is more complex and has
|
|
3736
3938
|
// not caused issues thus far.
|
|
3737
3939
|
return correctedResponse;
|
|
@@ -4076,7 +4278,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4076
4278
|
This function generates the requirements.txt file needed to host the streamlit app,
|
|
4077
4279
|
and deploys it!
|
|
4078
4280
|
*/
|
|
4079
|
-
const deployStreamlitApp = async (
|
|
4281
|
+
const deployStreamlitApp = async (notebookPanel, appDeployService, appManagerService) => {
|
|
4080
4282
|
let selectedFiles = [];
|
|
4081
4283
|
let jwtToken = await (0,_auth__WEBPACK_IMPORTED_MODULE_2__.getJWTToken)();
|
|
4082
4284
|
if (!jwtToken) {
|
|
@@ -4097,27 +4299,30 @@ const deployStreamlitApp = async (notebookTracker, appDeployService, appManagerS
|
|
|
4097
4299
|
}
|
|
4098
4300
|
catch (error) {
|
|
4099
4301
|
console.log('Authentication cancelled or failed:', error);
|
|
4302
|
+
const errorMsg = 'Authentication failed: ' + error;
|
|
4303
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.emit(errorMsg, 'error', {
|
|
4304
|
+
autoClose: false
|
|
4305
|
+
});
|
|
4100
4306
|
return; // Exit early if authentication was cancelled
|
|
4101
4307
|
}
|
|
4102
4308
|
}
|
|
4103
|
-
const notebookPanel = notebookTracker.currentWidget;
|
|
4104
|
-
if (!notebookPanel) {
|
|
4105
|
-
console.error('No notebook is currently active');
|
|
4106
|
-
return;
|
|
4107
|
-
}
|
|
4108
4309
|
const notebookPath = notebookPanel.context.path;
|
|
4109
4310
|
const notificationId = _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.emit('Step 1/7: Gathering requirements...', 'in-progress', {
|
|
4110
4311
|
autoClose: false
|
|
4111
4312
|
});
|
|
4112
4313
|
// Build the requirements.txt file
|
|
4113
|
-
const requirementsContent = await (0,_requirementsUtils__WEBPACK_IMPORTED_MODULE_4__.generateRequirementsTxt)(
|
|
4314
|
+
const requirementsContent = await (0,_requirementsUtils__WEBPACK_IMPORTED_MODULE_4__.generateRequirementsTxt)(notebookPanel);
|
|
4114
4315
|
// Save the files to the current directory
|
|
4115
|
-
await (0,_fileUtils__WEBPACK_IMPORTED_MODULE_5__.saveFileWithKernel)(
|
|
4316
|
+
await (0,_fileUtils__WEBPACK_IMPORTED_MODULE_5__.saveFileWithKernel)(notebookPanel, './requirements.txt', requirementsContent);
|
|
4116
4317
|
try {
|
|
4117
4318
|
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.dismiss(notificationId);
|
|
4118
4319
|
selectedFiles = await (0,_FilesSelectorUtils__WEBPACK_IMPORTED_MODULE_6__.fileSelectorPopup)(notebookPath);
|
|
4119
4320
|
}
|
|
4120
4321
|
catch (error) {
|
|
4322
|
+
const errorMsg = 'Files selection failed: ' + error;
|
|
4323
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.emit(errorMsg, 'error', {
|
|
4324
|
+
autoClose: false
|
|
4325
|
+
});
|
|
4121
4326
|
console.log('File selection failed:', error);
|
|
4122
4327
|
return;
|
|
4123
4328
|
}
|
|
@@ -4129,16 +4334,25 @@ const deployStreamlitApp = async (notebookTracker, appDeployService, appManagerS
|
|
|
4129
4334
|
console.log("Sending request to deploy the app");
|
|
4130
4335
|
// Use the JWT token that was already obtained or refreshed above
|
|
4131
4336
|
const response = await appDeployService.client.sendMessage({
|
|
4132
|
-
type: '
|
|
4337
|
+
type: 'deploy_app',
|
|
4133
4338
|
message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.UUID.uuid4(),
|
|
4134
4339
|
notebook_path: notebookPath,
|
|
4135
4340
|
jwt_token: jwtToken,
|
|
4136
4341
|
selected_files: selectedFiles
|
|
4137
4342
|
});
|
|
4138
4343
|
if (response.error) {
|
|
4344
|
+
const errorMsg = response.error;
|
|
4345
|
+
console.group('Deploy App Error:');
|
|
4346
|
+
console.error('Type:', errorMsg.error_type);
|
|
4347
|
+
console.error('Title:', errorMsg.message);
|
|
4348
|
+
console.error('Hint:', errorMsg.hint);
|
|
4349
|
+
let displayMessage = String(errorMsg.message);
|
|
4350
|
+
if (errorMsg.hint) {
|
|
4351
|
+
displayMessage = displayMessage + "\n" + "Hint:" + String(errorMsg.hint);
|
|
4352
|
+
}
|
|
4139
4353
|
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.update({
|
|
4140
4354
|
id: newNotificationId,
|
|
4141
|
-
message:
|
|
4355
|
+
message: displayMessage,
|
|
4142
4356
|
type: 'error',
|
|
4143
4357
|
autoClose: false
|
|
4144
4358
|
});
|
|
@@ -4150,8 +4364,14 @@ const deployStreamlitApp = async (notebookTracker, appDeployService, appManagerS
|
|
|
4150
4364
|
}
|
|
4151
4365
|
}
|
|
4152
4366
|
catch (error) {
|
|
4153
|
-
// TODO:
|
|
4367
|
+
// TODO: In the future, remove this if we dont see any connection errors that need to be caught
|
|
4154
4368
|
console.error("Error deploying app:", error);
|
|
4369
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.update({
|
|
4370
|
+
id: newNotificationId,
|
|
4371
|
+
message: String(error),
|
|
4372
|
+
type: 'error',
|
|
4373
|
+
autoClose: false
|
|
4374
|
+
});
|
|
4155
4375
|
}
|
|
4156
4376
|
};
|
|
4157
4377
|
|
|
@@ -4513,12 +4733,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4513
4733
|
* Copyright (c) Saga Inc.
|
|
4514
4734
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
4515
4735
|
*/
|
|
4516
|
-
const saveFileWithKernel = async (
|
|
4517
|
-
const notebookPanel = notebookTracker.currentWidget;
|
|
4518
|
-
if (!notebookPanel) {
|
|
4519
|
-
console.error('No notebook is currently active');
|
|
4520
|
-
return;
|
|
4521
|
-
}
|
|
4736
|
+
const saveFileWithKernel = async (notebookPanel, filePath, fileContent) => {
|
|
4522
4737
|
try {
|
|
4523
4738
|
// Use the kernel to execute Python code
|
|
4524
4739
|
const session = notebookPanel.sessionContext.session;
|
|
@@ -4582,12 +4797,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4582
4797
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
4583
4798
|
*/
|
|
4584
4799
|
// Function to generate requirements.txt content using the kernel with pipreqs
|
|
4585
|
-
const generateRequirementsTxt = async (
|
|
4586
|
-
const notebookPanel = notebookTracker.currentWidget;
|
|
4587
|
-
if (!notebookPanel) {
|
|
4588
|
-
console.error('No notebook is currently active');
|
|
4589
|
-
return '';
|
|
4590
|
-
}
|
|
4800
|
+
const generateRequirementsTxt = async (notebookPanel) => {
|
|
4591
4801
|
// Initialize with fallback requirements in case kernel execution fails
|
|
4592
4802
|
let requirementsContent = 'streamlit>=1.28.0';
|
|
4593
4803
|
try {
|
|
@@ -5074,6 +5284,7 @@ const ManageAppsPlugin = {
|
|
|
5074
5284
|
|
|
5075
5285
|
__webpack_require__.r(__webpack_exports__);
|
|
5076
5286
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5287
|
+
/* harmony export */ IStreamlitPreviewManager: () => (/* binding */ IStreamlitPreviewManager),
|
|
5077
5288
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
5078
5289
|
/* harmony export */ });
|
|
5079
5290
|
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/notebook */ "webpack/sharing/consume/default/@jupyterlab/notebook");
|
|
@@ -5084,18 +5295,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5084
5295
|
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__);
|
|
5085
5296
|
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/widgets */ "webpack/sharing/consume/default/@lumino/widgets");
|
|
5086
5297
|
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_3__);
|
|
5087
|
-
/* harmony import */ var
|
|
5088
|
-
/* harmony import */ var
|
|
5089
|
-
/* harmony import */ var
|
|
5090
|
-
/* harmony import */ var
|
|
5298
|
+
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
|
|
5299
|
+
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__);
|
|
5300
|
+
/* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
|
|
5301
|
+
/* harmony import */ var _AppDeploy_DeployStreamlitApp__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../AppDeploy/DeployStreamlitApp */ "./lib/Extensions/AppDeploy/DeployStreamlitApp.js");
|
|
5302
|
+
/* harmony import */ var _AppDeploy_AppDeployPlugin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../AppDeploy/AppDeployPlugin */ "./lib/Extensions/AppDeploy/AppDeployPlugin.js");
|
|
5303
|
+
/* harmony import */ var _AppManager_ManageAppsPlugin__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../AppManager/ManageAppsPlugin */ "./lib/Extensions/AppManager/ManageAppsPlugin.js");
|
|
5091
5304
|
/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
|
|
5092
|
-
/* harmony import */ var
|
|
5093
|
-
/* harmony import */ var
|
|
5094
|
-
/* harmony import */ var
|
|
5095
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
5096
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
|
|
5305
|
+
/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../icons */ "./lib/icons/index.js");
|
|
5306
|
+
/* harmony import */ var _style_StreamlitPreviewPlugin_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../style/StreamlitPreviewPlugin.css */ "./style/StreamlitPreviewPlugin.css");
|
|
5307
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils */ "./lib/Extensions/AppPreview/utils.js");
|
|
5097
5308
|
/* harmony import */ var _UpdateAppDropdown__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./UpdateAppDropdown */ "./lib/Extensions/AppPreview/UpdateAppDropdown.js");
|
|
5098
|
-
/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-dom/client */ "./node_modules/react-dom/client.js");
|
|
5099
5309
|
/*
|
|
5100
5310
|
* Copyright (c) Saga Inc.
|
|
5101
5311
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -5115,9 +5325,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5115
5325
|
|
|
5116
5326
|
|
|
5117
5327
|
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5328
|
+
/**
|
|
5329
|
+
* The token for the StreamlitPreview service.
|
|
5330
|
+
*/
|
|
5331
|
+
const IStreamlitPreviewManager = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.Token('mito-ai:IStreamlitPreviewManager', 'Token for the StreamlitPreview service that manages app previews');
|
|
5121
5332
|
/**
|
|
5122
5333
|
* Simple HTML widget for displaying iframe content.
|
|
5123
5334
|
*/
|
|
@@ -5139,164 +5350,180 @@ class IFrameWidget extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_3__.Widget {
|
|
|
5139
5350
|
}
|
|
5140
5351
|
}
|
|
5141
5352
|
}
|
|
5142
|
-
async function showRecreateAppConfirmation(notebookPath) {
|
|
5143
|
-
const result = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({
|
|
5144
|
-
title: 'Recreate App',
|
|
5145
|
-
body: 'This will recreate the app from scratch, discarding all your current edits. This action cannot be undone. Are you sure you want to continue?',
|
|
5146
|
-
buttons: [
|
|
5147
|
-
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton({ label: 'Cancel' }),
|
|
5148
|
-
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.warnButton({ label: 'Recreate App' })
|
|
5149
|
-
],
|
|
5150
|
-
defaultButton: 1
|
|
5151
|
-
});
|
|
5152
|
-
if (result.button.accept) {
|
|
5153
|
-
void (0,_utils__WEBPACK_IMPORTED_MODULE_7__.startStreamlitPreviewAndNotify)(notebookPath, true, undefined, 'Recreating app from scratch...', 'App recreated successfully!');
|
|
5154
|
-
}
|
|
5155
|
-
}
|
|
5156
5353
|
/**
|
|
5157
|
-
*
|
|
5354
|
+
* Manages Streamlit app previews with a single-preview policy.
|
|
5355
|
+
* Ensures only one preview can be open at a time.
|
|
5158
5356
|
*/
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5357
|
+
class StreamlitAppPreviewManager {
|
|
5358
|
+
constructor(appDeployService, appManagerService) {
|
|
5359
|
+
this.currentPreview = null;
|
|
5360
|
+
this.appDeployService = appDeployService;
|
|
5361
|
+
this.appManagerService = appManagerService;
|
|
5164
5362
|
}
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
(0,react_dom_client__WEBPACK_IMPORTED_MODULE_6__.createRoot)(dropdownContainer).render(react__WEBPACK_IMPORTED_MODULE_5__.createElement(_UpdateAppDropdown__WEBPACK_IMPORTED_MODULE_8__["default"], { onSubmit: async (message) => {
|
|
5178
|
-
await (0,_utils__WEBPACK_IMPORTED_MODULE_7__.startStreamlitPreviewAndNotify)(notebookPath, true, message, 'Updating app...', 'App updated successfully!');
|
|
5179
|
-
dropdownContainer.remove();
|
|
5180
|
-
}, onClose: () => {
|
|
5181
|
-
dropdownContainer.remove();
|
|
5182
|
-
} }));
|
|
5183
|
-
// Close dropdown when clicking outside
|
|
5184
|
-
const handleClickOutside = (event) => {
|
|
5185
|
-
if (!dropdownContainer.contains(event.target) &&
|
|
5186
|
-
!buttonElement.contains(event.target)) {
|
|
5187
|
-
dropdownContainer.remove();
|
|
5188
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
5363
|
+
/**
|
|
5364
|
+
* Create a new Streamlit app preview, replacing any existing preview.
|
|
5365
|
+
*/
|
|
5366
|
+
async openAppPreview(app, notebookPanel) {
|
|
5367
|
+
// Close existing preview if any
|
|
5368
|
+
this.closeCurrentPreview();
|
|
5369
|
+
// First save the notebook to ensure the app is up to date
|
|
5370
|
+
await notebookPanel.context.save();
|
|
5371
|
+
const notebookPath = notebookPanel.context.path;
|
|
5372
|
+
const streamlitPreviewResponse = await (0,_utils__WEBPACK_IMPORTED_MODULE_6__.startStreamlitPreviewAndNotify)(notebookPath);
|
|
5373
|
+
if (streamlitPreviewResponse.type === 'error') {
|
|
5374
|
+
return streamlitPreviewResponse;
|
|
5189
5375
|
}
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
*/
|
|
5199
|
-
const StreamlitPreviewPlugin = {
|
|
5200
|
-
id: 'mito-ai:streamlit-preview',
|
|
5201
|
-
autoStart: true,
|
|
5202
|
-
requires: [_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__.INotebookTracker, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette, _AppDeploy_AppDeployPlugin__WEBPACK_IMPORTED_MODULE_9__.IAppDeployService, _AppManager_ManageAppsPlugin__WEBPACK_IMPORTED_MODULE_10__.IAppManagerService],
|
|
5203
|
-
activate: (app, notebookTracker, palette, appDeployService, appManagerService) => {
|
|
5204
|
-
console.log('mito-ai: StreamlitPreviewPlugin activated');
|
|
5205
|
-
// Add command to command palette
|
|
5206
|
-
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_11__.COMMAND_MITO_AI_PREVIEW_AS_STREAMLIT, {
|
|
5207
|
-
label: 'Preview as Streamlit',
|
|
5208
|
-
caption: 'Convert current notebook to Streamlit app and preview it',
|
|
5209
|
-
execute: async () => {
|
|
5210
|
-
await previewNotebookAsStreamlit(app, notebookTracker, appDeployService, appManagerService);
|
|
5211
|
-
}
|
|
5212
|
-
});
|
|
5213
|
-
// Add to command palette
|
|
5214
|
-
palette.addItem({
|
|
5215
|
-
command: _commands__WEBPACK_IMPORTED_MODULE_11__.COMMAND_MITO_AI_PREVIEW_AS_STREAMLIT,
|
|
5216
|
-
category: 'Mito AI'
|
|
5376
|
+
// Create the new preview widget
|
|
5377
|
+
const widget = this.createPreviewWidget(app, notebookPanel, this.appDeployService, this.appManagerService, streamlitPreviewResponse);
|
|
5378
|
+
// Store current preview info
|
|
5379
|
+
this.currentPreview = widget;
|
|
5380
|
+
// Add widget to main area with split-right mode
|
|
5381
|
+
app.shell.add(widget, 'main', {
|
|
5382
|
+
mode: 'split-right',
|
|
5383
|
+
ref: notebookPanel.id
|
|
5217
5384
|
});
|
|
5385
|
+
return streamlitPreviewResponse;
|
|
5218
5386
|
}
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
async
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5387
|
+
/**
|
|
5388
|
+
* Edit the existing Streamlit app preview by updating the app.py file.
|
|
5389
|
+
* The preview will auto-refresh due to --server.runOnSave in manager.py
|
|
5390
|
+
*/
|
|
5391
|
+
async editExistingPreview(editPrompt, notebookPanel) {
|
|
5392
|
+
if (!this.currentPreview) {
|
|
5393
|
+
throw new Error('No active preview to edit');
|
|
5394
|
+
}
|
|
5395
|
+
// First save the notebook to ensure the app is able
|
|
5396
|
+
// to read the most up to date version of the notebook.
|
|
5397
|
+
// Because we are parsing the notebook on the backend by reading
|
|
5398
|
+
// the file system, it only sees the last saved version of the notebook.
|
|
5399
|
+
await notebookPanel.context.save();
|
|
5400
|
+
// Update the app with the edit prompt
|
|
5401
|
+
const streamlitPreviewResponse = await (0,_utils__WEBPACK_IMPORTED_MODULE_6__.startStreamlitPreviewAndNotify)(notebookPanel.context.path, true, // force_recreate
|
|
5402
|
+
editPrompt, 'Editing Streamlit app...', 'Streamlit app updated successfully!');
|
|
5403
|
+
return streamlitPreviewResponse;
|
|
5228
5404
|
}
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5405
|
+
/**
|
|
5406
|
+
* Close the current preview if one exists.
|
|
5407
|
+
*/
|
|
5408
|
+
closeCurrentPreview() {
|
|
5409
|
+
if (this.currentPreview) {
|
|
5410
|
+
console.log('Closing current preview');
|
|
5411
|
+
this.currentPreview.dispose();
|
|
5412
|
+
this.currentPreview = null;
|
|
5237
5413
|
}
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5414
|
+
}
|
|
5415
|
+
/**
|
|
5416
|
+
* Check if there's an active preview.
|
|
5417
|
+
*/
|
|
5418
|
+
hasActivePreview() {
|
|
5419
|
+
return this.currentPreview !== null;
|
|
5420
|
+
}
|
|
5421
|
+
/**
|
|
5422
|
+
* Get the current preview widget.
|
|
5423
|
+
*/
|
|
5424
|
+
getCurrentPreview() {
|
|
5425
|
+
return this.currentPreview;
|
|
5426
|
+
}
|
|
5427
|
+
/**
|
|
5428
|
+
* Create a new preview widget with toolbar buttons.
|
|
5429
|
+
*/
|
|
5430
|
+
createPreviewWidget(app, notebookPanel, appDeployService, appManagerService, previewData) {
|
|
5243
5431
|
const iframeWidget = new IFrameWidget(previewData.url);
|
|
5432
|
+
// Log that the preview is open
|
|
5433
|
+
void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_7__.logEvent)('opened_streamlit_app_preview');
|
|
5244
5434
|
// Create main area widget
|
|
5245
5435
|
const widget = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.MainAreaWidget({ content: iframeWidget });
|
|
5436
|
+
const notebookPath = notebookPanel.context.path;
|
|
5437
|
+
const notebookName = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PathExt.basename(notebookPath, '.ipynb');
|
|
5246
5438
|
widget.title.label = `App Preview (${notebookName})`;
|
|
5247
5439
|
widget.title.closable = true;
|
|
5248
|
-
|
|
5249
|
-
* Create Streamlit App Toolbar Buttons
|
|
5250
|
-
****************************************************** */
|
|
5440
|
+
// Create toolbar buttons
|
|
5251
5441
|
const editAppButton = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ToolbarButton({
|
|
5252
5442
|
className: 'text-button-mito-ai button-base button-small jp-ToolbarButton mito-deploy-button',
|
|
5253
5443
|
onClick: () => {
|
|
5254
|
-
showUpdateAppDropdown(editAppButton.node,
|
|
5444
|
+
(0,_UpdateAppDropdown__WEBPACK_IMPORTED_MODULE_8__.showUpdateAppDropdown)(editAppButton.node, notebookPanel);
|
|
5255
5445
|
},
|
|
5256
5446
|
tooltip: 'Edit Streamlit App',
|
|
5257
5447
|
label: 'Edit App',
|
|
5258
|
-
icon:
|
|
5448
|
+
icon: _icons__WEBPACK_IMPORTED_MODULE_9__.EditLabIcon,
|
|
5259
5449
|
iconClass: 'mito-ai-deploy-icon'
|
|
5260
5450
|
});
|
|
5261
5451
|
const recreateAppButton = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ToolbarButton({
|
|
5262
5452
|
className: 'text-button-mito-ai button-base button-small jp-ToolbarButton mito-deploy-button',
|
|
5263
5453
|
onClick: async () => {
|
|
5264
|
-
await showRecreateAppConfirmation(notebookPath);
|
|
5454
|
+
await (0,_utils__WEBPACK_IMPORTED_MODULE_6__.showRecreateAppConfirmation)(notebookPath);
|
|
5265
5455
|
},
|
|
5266
5456
|
tooltip: 'Recreate new App from scratch based on the current state of the notebook',
|
|
5267
5457
|
label: 'Recreate App',
|
|
5268
|
-
icon:
|
|
5458
|
+
icon: _icons__WEBPACK_IMPORTED_MODULE_9__.ResetCircleLabIcon,
|
|
5269
5459
|
iconClass: 'mito-ai-deploy-icon'
|
|
5270
5460
|
});
|
|
5271
5461
|
const deployButton = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ToolbarButton({
|
|
5272
5462
|
className: 'text-button-mito-ai button-base button-small jp-ToolbarButton mito-deploy-button',
|
|
5273
5463
|
onClick: () => {
|
|
5274
|
-
void (0,
|
|
5464
|
+
void (0,_AppDeploy_DeployStreamlitApp__WEBPACK_IMPORTED_MODULE_10__.deployStreamlitApp)(notebookPanel, appDeployService, appManagerService);
|
|
5275
5465
|
},
|
|
5276
5466
|
tooltip: 'Deploy Streamlit App',
|
|
5277
5467
|
label: 'Deploy App',
|
|
5278
|
-
icon:
|
|
5468
|
+
icon: _icons__WEBPACK_IMPORTED_MODULE_9__.DeployLabIcon,
|
|
5279
5469
|
iconClass: 'mito-ai-deploy-icon'
|
|
5280
5470
|
});
|
|
5281
|
-
// Insert the
|
|
5471
|
+
// Insert the buttons into the toolbar
|
|
5282
5472
|
widget.toolbar.insertAfter('spacer', 'edit-app-button', editAppButton);
|
|
5283
5473
|
widget.toolbar.insertAfter('edit-app-button', 'recreate-app-button', recreateAppButton);
|
|
5284
|
-
|
|
5474
|
+
if (app.commands.hasCommand(_commands__WEBPACK_IMPORTED_MODULE_11__.COMMAND_MITO_AI_BETA_MODE_ENABLED)) {
|
|
5475
|
+
widget.toolbar.insertAfter('recreate-app-button', 'deploy-app-button', deployButton);
|
|
5476
|
+
}
|
|
5285
5477
|
// Handle widget disposal
|
|
5286
5478
|
widget.disposed.connect(() => {
|
|
5287
5479
|
console.log('Widget disposed, stopping preview');
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5480
|
+
if (previewData) {
|
|
5481
|
+
void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_7__.stopStreamlitPreview)(previewData.id);
|
|
5482
|
+
}
|
|
5483
|
+
// Clear our reference when the widget is disposed
|
|
5484
|
+
if (this.currentPreview === widget) {
|
|
5485
|
+
this.currentPreview = null;
|
|
5486
|
+
}
|
|
5294
5487
|
});
|
|
5295
|
-
|
|
5296
|
-
catch (error) {
|
|
5297
|
-
console.error('Error starting streamlit preview:', error);
|
|
5488
|
+
return widget;
|
|
5298
5489
|
}
|
|
5299
5490
|
}
|
|
5491
|
+
/**
|
|
5492
|
+
* The streamlit preview plugin.
|
|
5493
|
+
*/
|
|
5494
|
+
const StreamlitPreviewPlugin = {
|
|
5495
|
+
id: 'mito-ai:streamlit-preview',
|
|
5496
|
+
autoStart: true,
|
|
5497
|
+
requires: [_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__.INotebookTracker, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette, _AppDeploy_AppDeployPlugin__WEBPACK_IMPORTED_MODULE_12__.IAppDeployService, _AppManager_ManageAppsPlugin__WEBPACK_IMPORTED_MODULE_13__.IAppManagerService],
|
|
5498
|
+
provides: IStreamlitPreviewManager,
|
|
5499
|
+
activate: (app, notebookTracker, palette, appDeployService, appManagerService) => {
|
|
5500
|
+
console.log('mito-ai: StreamlitPreviewPlugin activated');
|
|
5501
|
+
// Create the service instance
|
|
5502
|
+
const streamlitPreviewManager = new StreamlitAppPreviewManager(appDeployService, appManagerService);
|
|
5503
|
+
// Add command to command palette
|
|
5504
|
+
app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_11__.COMMAND_MITO_AI_PREVIEW_AS_STREAMLIT, {
|
|
5505
|
+
label: 'Preview as Streamlit',
|
|
5506
|
+
caption: 'Convert current notebook to Streamlit app and preview it',
|
|
5507
|
+
execute: async () => {
|
|
5508
|
+
// Instead of using the notebook tracker, we could pass the notebook panel directly, but this button
|
|
5509
|
+
// is only used in the notebook toolbar, so its okay.
|
|
5510
|
+
if (notebookTracker.currentWidget) {
|
|
5511
|
+
await streamlitPreviewManager.openAppPreview(app, notebookTracker.currentWidget);
|
|
5512
|
+
}
|
|
5513
|
+
else {
|
|
5514
|
+
console.error('No notebook is currently active');
|
|
5515
|
+
}
|
|
5516
|
+
}
|
|
5517
|
+
});
|
|
5518
|
+
// Add to command palette
|
|
5519
|
+
palette.addItem({
|
|
5520
|
+
command: _commands__WEBPACK_IMPORTED_MODULE_11__.COMMAND_MITO_AI_PREVIEW_AS_STREAMLIT,
|
|
5521
|
+
category: 'Mito AI'
|
|
5522
|
+
});
|
|
5523
|
+
// Return the service so other plugins can use it
|
|
5524
|
+
return streamlitPreviewManager;
|
|
5525
|
+
}
|
|
5526
|
+
};
|
|
5300
5527
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StreamlitPreviewPlugin);
|
|
5301
5528
|
|
|
5302
5529
|
|
|
@@ -5310,12 +5537,15 @@ async function previewNotebookAsStreamlit(app, notebookTracker, appDeployService
|
|
|
5310
5537
|
|
|
5311
5538
|
__webpack_require__.r(__webpack_exports__);
|
|
5312
5539
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5313
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
5540
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
5541
|
+
/* harmony export */ showUpdateAppDropdown: () => (/* binding */ showUpdateAppDropdown)
|
|
5314
5542
|
/* harmony export */ });
|
|
5315
5543
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
5316
5544
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5317
5545
|
/* harmony import */ var _style_EditAppDropdown_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../style/EditAppDropdown.css */ "./style/EditAppDropdown.css");
|
|
5318
|
-
/* harmony import */ var
|
|
5546
|
+
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/classNames */ "./lib/utils/classNames.js");
|
|
5547
|
+
/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom/client */ "./node_modules/react-dom/client.js");
|
|
5548
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./lib/Extensions/AppPreview/utils.js");
|
|
5319
5549
|
/*
|
|
5320
5550
|
* Copyright (c) Saga Inc.
|
|
5321
5551
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -5323,41 +5553,85 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5323
5553
|
|
|
5324
5554
|
|
|
5325
5555
|
|
|
5326
|
-
const UpdateAppDropdown = ({ onSubmit, onClose }) => {
|
|
5327
|
-
const [message, setMessage] = react__WEBPACK_IMPORTED_MODULE_0___default().useState('');
|
|
5328
|
-
const handleSubmit = () => {
|
|
5329
|
-
if (message.trim()) {
|
|
5330
|
-
onSubmit(message);
|
|
5331
|
-
onClose();
|
|
5332
|
-
}
|
|
5333
|
-
};
|
|
5334
|
-
const handleKeyDown = (e) => {
|
|
5335
|
-
if (e.key === 'Escape') {
|
|
5336
|
-
onClose();
|
|
5337
|
-
}
|
|
5338
|
-
};
|
|
5339
|
-
const disabled = message.trim() === '';
|
|
5340
|
-
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "update-app-dropdown", onKeyDown: handleKeyDown },
|
|
5341
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "update-app-dropdown-content" },
|
|
5342
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", { htmlFor: "update-description", className: "update-app-dropdown-label" }, "How would you like to modify the app?"),
|
|
5343
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("textarea", { id: "update-description", value: message, onChange: (e) => setMessage(e.target.value), placeholder: "Describe your changes (e.g., Change the title, Remove a plot, etc.)", className: "update-app-dropdown-textarea", autoFocus: true }),
|
|
5344
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "update-app-dropdown-buttons" },
|
|
5345
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: onClose, className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_2__.classNames)("update-app-dropdown-button", "update-app-dropdown-button-cancel") }, "Cancel"),
|
|
5346
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: handleSubmit, disabled: disabled, className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_2__.classNames)('update-app-dropdown-button', 'update-app-dropdown-button-submit', { 'disabled': disabled }) }, "Submit")))));
|
|
5347
|
-
};
|
|
5348
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UpdateAppDropdown);
|
|
5349
|
-
|
|
5350
5556
|
|
|
5351
|
-
/***/ }),
|
|
5352
5557
|
|
|
5353
|
-
|
|
5354
|
-
|
|
5558
|
+
/**
|
|
5559
|
+
* Show the update app dropdown.
|
|
5560
|
+
*/
|
|
5561
|
+
const showUpdateAppDropdown = (buttonElement, notebookPanel) => {
|
|
5562
|
+
// Remove any existing dropdown
|
|
5563
|
+
const existingDropdown = document.querySelector('.update-app-dropdown');
|
|
5564
|
+
if (existingDropdown) {
|
|
5565
|
+
existingDropdown.remove();
|
|
5566
|
+
}
|
|
5567
|
+
const notebookPath = notebookPanel.context.path;
|
|
5568
|
+
// Create dropdown container
|
|
5569
|
+
const dropdownContainer = document.createElement('div');
|
|
5570
|
+
dropdownContainer.className = 'update-app-dropdown';
|
|
5571
|
+
// Position the dropdown below the button
|
|
5572
|
+
const buttonRect = buttonElement.getBoundingClientRect();
|
|
5573
|
+
dropdownContainer.style.top = `${buttonRect.bottom + 4}px`;
|
|
5574
|
+
dropdownContainer.style.left = `${buttonRect.left}px`;
|
|
5575
|
+
// Add to document
|
|
5576
|
+
document.body.appendChild(dropdownContainer);
|
|
5577
|
+
// Render the React component
|
|
5578
|
+
(0,react_dom_client__WEBPACK_IMPORTED_MODULE_2__.createRoot)(dropdownContainer).render(react__WEBPACK_IMPORTED_MODULE_0___default().createElement(UpdateAppDropdown, { onSubmit: async (message) => {
|
|
5579
|
+
// Save the notebook first to ensure app reads up to date version
|
|
5580
|
+
await notebookPanel.context.save();
|
|
5581
|
+
await (0,_utils__WEBPACK_IMPORTED_MODULE_3__.startStreamlitPreviewAndNotify)(notebookPath, true, message, 'Updating app...', 'App updated successfully!');
|
|
5582
|
+
dropdownContainer.remove();
|
|
5583
|
+
}, onClose: () => {
|
|
5584
|
+
dropdownContainer.remove();
|
|
5585
|
+
} }));
|
|
5586
|
+
// Close dropdown when clicking outside
|
|
5587
|
+
const handleClickOutside = (event) => {
|
|
5588
|
+
if (!dropdownContainer.contains(event.target) &&
|
|
5589
|
+
!buttonElement.contains(event.target)) {
|
|
5590
|
+
dropdownContainer.remove();
|
|
5591
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
5592
|
+
}
|
|
5593
|
+
};
|
|
5594
|
+
// Add click outside listener after a small delay to avoid immediate closure
|
|
5595
|
+
setTimeout(() => {
|
|
5596
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
5597
|
+
}, 100);
|
|
5598
|
+
};
|
|
5599
|
+
const UpdateAppDropdown = ({ onSubmit, onClose }) => {
|
|
5600
|
+
const [message, setMessage] = react__WEBPACK_IMPORTED_MODULE_0___default().useState('');
|
|
5601
|
+
const handleSubmit = () => {
|
|
5602
|
+
if (message.trim()) {
|
|
5603
|
+
onSubmit(message);
|
|
5604
|
+
onClose();
|
|
5605
|
+
}
|
|
5606
|
+
};
|
|
5607
|
+
const handleKeyDown = (e) => {
|
|
5608
|
+
if (e.key === 'Escape') {
|
|
5609
|
+
onClose();
|
|
5610
|
+
}
|
|
5611
|
+
};
|
|
5612
|
+
const disabled = message.trim() === '';
|
|
5613
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "update-app-dropdown", onKeyDown: handleKeyDown },
|
|
5614
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "update-app-dropdown-content" },
|
|
5615
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", { htmlFor: "update-description", className: "update-app-dropdown-label" }, "How would you like to modify the app?"),
|
|
5616
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("textarea", { id: "update-description", value: message, onChange: (e) => setMessage(e.target.value), placeholder: "Describe your changes (e.g., Change the title, Remove a plot, etc.)", className: "update-app-dropdown-textarea", autoFocus: true }),
|
|
5617
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "update-app-dropdown-buttons" },
|
|
5618
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: onClose, className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_4__.classNames)("update-app-dropdown-button", "update-app-dropdown-button-cancel") }, "Cancel"),
|
|
5619
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: handleSubmit, disabled: disabled, className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_4__.classNames)('update-app-dropdown-button', 'update-app-dropdown-button-submit', { 'disabled': disabled }) }, "Submit")))));
|
|
5620
|
+
};
|
|
5621
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (UpdateAppDropdown);
|
|
5622
|
+
|
|
5623
|
+
|
|
5624
|
+
/***/ }),
|
|
5625
|
+
|
|
5626
|
+
/***/ "./lib/Extensions/AppPreview/utils.js":
|
|
5627
|
+
/*!********************************************!*\
|
|
5355
5628
|
!*** ./lib/Extensions/AppPreview/utils.js ***!
|
|
5356
5629
|
\********************************************/
|
|
5357
5630
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
5358
5631
|
|
|
5359
5632
|
__webpack_require__.r(__webpack_exports__);
|
|
5360
5633
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5634
|
+
/* harmony export */ showRecreateAppConfirmation: () => (/* binding */ showRecreateAppConfirmation),
|
|
5361
5635
|
/* harmony export */ startStreamlitPreviewAndNotify: () => (/* binding */ startStreamlitPreviewAndNotify)
|
|
5362
5636
|
/* harmony export */ });
|
|
5363
5637
|
/* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
|
|
@@ -5371,8 +5645,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5371
5645
|
|
|
5372
5646
|
const startStreamlitPreviewAndNotify = async (notebookPath, force_recreate = false, edit_prompt = '', start_notification_message = 'Building App Preview...', success_notification_message = 'Streamlit preview started successfully!') => {
|
|
5373
5647
|
const notificationId = _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.emit(start_notification_message, 'in-progress', { autoClose: false });
|
|
5374
|
-
|
|
5375
|
-
|
|
5648
|
+
const previewData = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_1__.startStreamlitPreview)(notebookPath, force_recreate, edit_prompt);
|
|
5649
|
+
if (previewData.type === 'success') {
|
|
5376
5650
|
// Update notification to success
|
|
5377
5651
|
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.update({
|
|
5378
5652
|
id: notificationId,
|
|
@@ -5380,19 +5654,32 @@ const startStreamlitPreviewAndNotify = async (notebookPath, force_recreate = fal
|
|
|
5380
5654
|
type: 'success',
|
|
5381
5655
|
autoClose: 5 * 1000
|
|
5382
5656
|
});
|
|
5383
|
-
return previewData;
|
|
5384
5657
|
}
|
|
5385
|
-
|
|
5658
|
+
else {
|
|
5386
5659
|
// Display error notification
|
|
5387
5660
|
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.update({
|
|
5388
5661
|
id: notificationId,
|
|
5389
|
-
message: "Failed to start app preview: " + String(
|
|
5662
|
+
message: "Failed to start app preview: " + String(previewData.message),
|
|
5390
5663
|
type: 'error',
|
|
5391
5664
|
autoClose: 5 * 1000
|
|
5392
5665
|
});
|
|
5393
|
-
return undefined;
|
|
5394
5666
|
}
|
|
5667
|
+
return previewData;
|
|
5395
5668
|
};
|
|
5669
|
+
async function showRecreateAppConfirmation(notebookPath) {
|
|
5670
|
+
const result = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)({
|
|
5671
|
+
title: 'Recreate App',
|
|
5672
|
+
body: 'This will recreate the app from scratch, discarding all your current edits. This action cannot be undone. Are you sure you want to continue?',
|
|
5673
|
+
buttons: [
|
|
5674
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.cancelButton({ label: 'Cancel' }),
|
|
5675
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.warnButton({ label: 'Recreate App' })
|
|
5676
|
+
],
|
|
5677
|
+
defaultButton: 1
|
|
5678
|
+
});
|
|
5679
|
+
if (result.button.accept) {
|
|
5680
|
+
void startStreamlitPreviewAndNotify(notebookPath, true, undefined, 'Recreating app from scratch...', 'App recreated successfully!');
|
|
5681
|
+
}
|
|
5682
|
+
}
|
|
5396
5683
|
|
|
5397
5684
|
|
|
5398
5685
|
/***/ }),
|
|
@@ -6253,6 +6540,8 @@ const NotebookFooterPlugin = {
|
|
|
6253
6540
|
__webpack_require__.r(__webpack_exports__);
|
|
6254
6541
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
6255
6542
|
/* harmony export */ COMMAND_MITO_AI_SETTINGS: () => (/* binding */ COMMAND_MITO_AI_SETTINGS),
|
|
6543
|
+
/* harmony export */ COMMAND_MITO_AI_SETTINGS_DATABASE: () => (/* binding */ COMMAND_MITO_AI_SETTINGS_DATABASE),
|
|
6544
|
+
/* harmony export */ COMMAND_MITO_AI_SETTINGS_SUBSCRIPTION: () => (/* binding */ COMMAND_MITO_AI_SETTINGS_SUBSCRIPTION),
|
|
6256
6545
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
6257
6546
|
/* harmony export */ });
|
|
6258
6547
|
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/application */ "webpack/sharing/consume/default/@jupyterlab/application");
|
|
@@ -6270,6 +6559,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6270
6559
|
|
|
6271
6560
|
|
|
6272
6561
|
const COMMAND_MITO_AI_SETTINGS = 'mito-ai:open-settings';
|
|
6562
|
+
const COMMAND_MITO_AI_SETTINGS_SUBSCRIPTION = 'mito-ai:open-settings-subscription';
|
|
6563
|
+
const COMMAND_MITO_AI_SETTINGS_DATABASE = 'mito-ai:open-settings-database';
|
|
6273
6564
|
/**
|
|
6274
6565
|
* Initialization data for the mito settings extension.
|
|
6275
6566
|
*/
|
|
@@ -6283,8 +6574,8 @@ const SettingsManagerPlugin = {
|
|
|
6283
6574
|
};
|
|
6284
6575
|
function _activate(app, palette, contextManager, restorer) {
|
|
6285
6576
|
// Create a widget creator function
|
|
6286
|
-
const newWidget = () => {
|
|
6287
|
-
const content = new _SettingsWidget__WEBPACK_IMPORTED_MODULE_3__.SettingsWidget(contextManager);
|
|
6577
|
+
const newWidget = (initialTab) => {
|
|
6578
|
+
const content = new _SettingsWidget__WEBPACK_IMPORTED_MODULE_3__.SettingsWidget(contextManager, initialTab);
|
|
6288
6579
|
const widget = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.MainAreaWidget({ content });
|
|
6289
6580
|
widget.id = 'mito-ai-settings';
|
|
6290
6581
|
widget.title.label = 'Mito AI Settings';
|
|
@@ -6292,24 +6583,33 @@ function _activate(app, palette, contextManager, restorer) {
|
|
|
6292
6583
|
return widget;
|
|
6293
6584
|
};
|
|
6294
6585
|
let widget = newWidget();
|
|
6586
|
+
// Track and restore the widget state
|
|
6587
|
+
const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({
|
|
6588
|
+
namespace: widget.id
|
|
6589
|
+
});
|
|
6590
|
+
// Reusable function to open settings with a specific tab
|
|
6591
|
+
const openSettingsWithTab = (initialTab) => {
|
|
6592
|
+
// Dispose the old widget and create a new one with the specified tab
|
|
6593
|
+
if (widget && !widget.isDisposed) {
|
|
6594
|
+
widget.dispose();
|
|
6595
|
+
}
|
|
6596
|
+
widget = newWidget(initialTab);
|
|
6597
|
+
// Add the widget to the tracker
|
|
6598
|
+
if (!tracker.has(widget)) {
|
|
6599
|
+
void tracker.add(widget);
|
|
6600
|
+
}
|
|
6601
|
+
// Add the widget to the app
|
|
6602
|
+
if (!widget.isAttached) {
|
|
6603
|
+
void app.shell.add(widget, 'main');
|
|
6604
|
+
}
|
|
6605
|
+
// Activate the widget
|
|
6606
|
+
app.shell.activateById(widget.id);
|
|
6607
|
+
};
|
|
6295
6608
|
// Add an application command
|
|
6296
6609
|
app.commands.addCommand(COMMAND_MITO_AI_SETTINGS, {
|
|
6297
6610
|
label: 'Mito AI Settings',
|
|
6298
6611
|
execute: () => {
|
|
6299
|
-
|
|
6300
|
-
if (!widget || widget.isDisposed) {
|
|
6301
|
-
widget = newWidget();
|
|
6302
|
-
}
|
|
6303
|
-
// Add the widget to the tracker if not already there
|
|
6304
|
-
if (!tracker.has(widget)) {
|
|
6305
|
-
void tracker.add(widget);
|
|
6306
|
-
}
|
|
6307
|
-
// Add the widget to the app if not already attached
|
|
6308
|
-
if (!widget.isAttached) {
|
|
6309
|
-
void app.shell.add(widget, 'main');
|
|
6310
|
-
}
|
|
6311
|
-
// Activate the widget
|
|
6312
|
-
app.shell.activateById(widget.id);
|
|
6612
|
+
openSettingsWithTab();
|
|
6313
6613
|
}
|
|
6314
6614
|
});
|
|
6315
6615
|
// Add the command to the palette
|
|
@@ -6317,9 +6617,19 @@ function _activate(app, palette, contextManager, restorer) {
|
|
|
6317
6617
|
command: COMMAND_MITO_AI_SETTINGS,
|
|
6318
6618
|
category: 'Mito AI'
|
|
6319
6619
|
});
|
|
6320
|
-
//
|
|
6321
|
-
|
|
6322
|
-
|
|
6620
|
+
// Add a command to open settings with the subscription tab
|
|
6621
|
+
app.commands.addCommand(COMMAND_MITO_AI_SETTINGS_SUBSCRIPTION, {
|
|
6622
|
+
label: 'Mito AI Settings: Subscription',
|
|
6623
|
+
execute: () => {
|
|
6624
|
+
openSettingsWithTab('subscription');
|
|
6625
|
+
}
|
|
6626
|
+
});
|
|
6627
|
+
// Add a command to open setting with the database tab
|
|
6628
|
+
app.commands.addCommand(COMMAND_MITO_AI_SETTINGS_DATABASE, {
|
|
6629
|
+
label: 'Mito AI Settings: Database',
|
|
6630
|
+
execute: () => {
|
|
6631
|
+
openSettingsWithTab('database');
|
|
6632
|
+
}
|
|
6323
6633
|
});
|
|
6324
6634
|
if (!tracker.has(widget)) {
|
|
6325
6635
|
void tracker.add(widget);
|
|
@@ -6348,11 +6658,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6348
6658
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
6349
6659
|
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
|
|
6350
6660
|
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
|
|
6351
|
-
/* harmony import */ var
|
|
6352
|
-
/* harmony import */ var
|
|
6353
|
-
/* harmony import */ var
|
|
6354
|
-
/* harmony import */ var
|
|
6355
|
-
/* harmony import */ var
|
|
6661
|
+
/* harmony import */ var _database_DatabasePage__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./database/DatabasePage */ "./lib/Extensions/SettingsManager/database/DatabasePage.js");
|
|
6662
|
+
/* harmony import */ var _support_SupportPage__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./support/SupportPage */ "./lib/Extensions/SettingsManager/support/SupportPage.js");
|
|
6663
|
+
/* harmony import */ var _general_GeneralPage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./general/GeneralPage */ "./lib/Extensions/SettingsManager/general/GeneralPage.js");
|
|
6664
|
+
/* harmony import */ var _rules_RulesPage__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./rules/RulesPage */ "./lib/Extensions/SettingsManager/rules/RulesPage.js");
|
|
6665
|
+
/* harmony import */ var _profiler_ProfilerPage__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./profiler/ProfilerPage */ "./lib/Extensions/SettingsManager/profiler/ProfilerPage.js");
|
|
6666
|
+
/* harmony import */ var _subscription_SubscriptionPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./subscription/SubscriptionPage */ "./lib/Extensions/SettingsManager/subscription/SubscriptionPage.js");
|
|
6356
6667
|
/* harmony import */ var _style_SettingsWidget_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../style/SettingsWidget.css */ "./style/SettingsWidget.css");
|
|
6357
6668
|
/*
|
|
6358
6669
|
* Copyright (c) Saga Inc.
|
|
@@ -6366,30 +6677,35 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
6366
6677
|
|
|
6367
6678
|
|
|
6368
6679
|
|
|
6680
|
+
|
|
6369
6681
|
const TABS_CONFIG = (contextManager) => ({
|
|
6370
|
-
database: {
|
|
6371
|
-
label: 'Database',
|
|
6372
|
-
component: _database_DatabasePage__WEBPACK_IMPORTED_MODULE_3__.DatabasePage
|
|
6373
|
-
},
|
|
6374
6682
|
general: {
|
|
6375
6683
|
label: 'General',
|
|
6376
|
-
component:
|
|
6684
|
+
component: _general_GeneralPage__WEBPACK_IMPORTED_MODULE_3__.GeneralPage
|
|
6685
|
+
},
|
|
6686
|
+
subscription: {
|
|
6687
|
+
label: 'Subscription',
|
|
6688
|
+
component: _subscription_SubscriptionPage__WEBPACK_IMPORTED_MODULE_4__.SubscriptionPage
|
|
6689
|
+
},
|
|
6690
|
+
database: {
|
|
6691
|
+
label: 'Database',
|
|
6692
|
+
component: _database_DatabasePage__WEBPACK_IMPORTED_MODULE_5__.DatabasePage
|
|
6377
6693
|
},
|
|
6378
6694
|
rules: {
|
|
6379
6695
|
label: 'Rules',
|
|
6380
|
-
component:
|
|
6696
|
+
component: _rules_RulesPage__WEBPACK_IMPORTED_MODULE_6__.RulesPage
|
|
6381
6697
|
},
|
|
6382
6698
|
profiler: {
|
|
6383
6699
|
label: 'Profiler',
|
|
6384
|
-
component: () => react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
6700
|
+
component: () => react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_profiler_ProfilerPage__WEBPACK_IMPORTED_MODULE_7__.ProfilerPage, { contextManager: contextManager })
|
|
6385
6701
|
},
|
|
6386
6702
|
support: {
|
|
6387
6703
|
label: 'Support',
|
|
6388
|
-
component:
|
|
6704
|
+
component: _support_SupportPage__WEBPACK_IMPORTED_MODULE_8__.SupportPage
|
|
6389
6705
|
},
|
|
6390
6706
|
});
|
|
6391
|
-
const App = ({ contextManager }) => {
|
|
6392
|
-
const [activeTab, setActiveTab] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(
|
|
6707
|
+
const App = ({ contextManager, initialTab = 'general' }) => {
|
|
6708
|
+
const [activeTab, setActiveTab] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(initialTab);
|
|
6393
6709
|
const tabsConfig = TABS_CONFIG(contextManager);
|
|
6394
6710
|
const renderContent = () => {
|
|
6395
6711
|
const TabComponent = tabsConfig[activeTab].component;
|
|
@@ -6403,13 +6719,14 @@ const App = ({ contextManager }) => {
|
|
|
6403
6719
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "settings-main" }, renderContent()))));
|
|
6404
6720
|
};
|
|
6405
6721
|
class SettingsWidget extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ReactWidget {
|
|
6406
|
-
constructor(contextManager) {
|
|
6722
|
+
constructor(contextManager, initialTab) {
|
|
6407
6723
|
super();
|
|
6408
6724
|
this.contextManager = contextManager;
|
|
6725
|
+
this.initialTab = initialTab;
|
|
6409
6726
|
this.addClass('jp-ReactWidget');
|
|
6410
6727
|
}
|
|
6411
6728
|
render() {
|
|
6412
|
-
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(App, { contextManager: this.contextManager });
|
|
6729
|
+
return react__WEBPACK_IMPORTED_MODULE_0___default().createElement(App, { contextManager: this.contextManager, initialTab: this.initialTab });
|
|
6413
6730
|
}
|
|
6414
6731
|
}
|
|
6415
6732
|
|
|
@@ -7408,6 +7725,177 @@ const RulesPage = () => {
|
|
|
7408
7725
|
};
|
|
7409
7726
|
|
|
7410
7727
|
|
|
7728
|
+
/***/ }),
|
|
7729
|
+
|
|
7730
|
+
/***/ "./lib/Extensions/SettingsManager/subscription/FreeTierCard.js":
|
|
7731
|
+
/*!*********************************************************************!*\
|
|
7732
|
+
!*** ./lib/Extensions/SettingsManager/subscription/FreeTierCard.js ***!
|
|
7733
|
+
\*********************************************************************/
|
|
7734
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
7735
|
+
|
|
7736
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7737
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7738
|
+
/* harmony export */ FreeTierCard: () => (/* binding */ FreeTierCard)
|
|
7739
|
+
/* harmony export */ });
|
|
7740
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
7741
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7742
|
+
/* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
|
|
7743
|
+
/* harmony import */ var _utils_stripe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/stripe */ "./lib/utils/stripe.js");
|
|
7744
|
+
/* harmony import */ var _style_SubscriptionPage_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/SubscriptionPage.css */ "./style/SubscriptionPage.css");
|
|
7745
|
+
/*
|
|
7746
|
+
* Copyright (c) Saga Inc.
|
|
7747
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
7748
|
+
*/
|
|
7749
|
+
|
|
7750
|
+
|
|
7751
|
+
|
|
7752
|
+
|
|
7753
|
+
const MAX_FREE_USAGE = 150;
|
|
7754
|
+
const FreeTierCard = () => {
|
|
7755
|
+
const [usageCount, setUsageCount] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
|
|
7756
|
+
const [resetDate, setResetDate] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
|
|
7757
|
+
const percentage = Math.round((usageCount / MAX_FREE_USAGE) * 100);
|
|
7758
|
+
const remainingUsage = MAX_FREE_USAGE - usageCount;
|
|
7759
|
+
const getAiMitoApiNumUsages = async () => {
|
|
7760
|
+
const usageCount = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_2__.getUserKey)('ai_mito_api_num_usages');
|
|
7761
|
+
return usageCount ? parseInt(usageCount) : 0;
|
|
7762
|
+
};
|
|
7763
|
+
const getNextResetDate = async () => {
|
|
7764
|
+
const lastResetDate = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_2__.getUserKey)('mito_ai_last_reset_date');
|
|
7765
|
+
if (!lastResetDate)
|
|
7766
|
+
return null;
|
|
7767
|
+
// Parse the date and add one month
|
|
7768
|
+
const lastReset = new Date(lastResetDate);
|
|
7769
|
+
const nextReset = new Date(lastReset);
|
|
7770
|
+
nextReset.setMonth(nextReset.getMonth() + 1);
|
|
7771
|
+
// Format the date before returning
|
|
7772
|
+
return nextReset.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
|
|
7773
|
+
};
|
|
7774
|
+
// When we first open the page, load the settings from the server
|
|
7775
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
7776
|
+
const fetchSettings = async () => {
|
|
7777
|
+
const count = await getAiMitoApiNumUsages();
|
|
7778
|
+
setUsageCount(count);
|
|
7779
|
+
const nextReset = await getNextResetDate();
|
|
7780
|
+
setResetDate(nextReset);
|
|
7781
|
+
};
|
|
7782
|
+
void fetchSettings();
|
|
7783
|
+
}, []);
|
|
7784
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "subscription-page-card" },
|
|
7785
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "subscription-page-card-content" },
|
|
7786
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h3", { className: "subscription-page-section-title" }, "Free Plan Usage"),
|
|
7787
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "subscription-page-usage-stats" },
|
|
7788
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "subscription-page-usage-count" }, usageCount),
|
|
7789
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "subscription-page-usage-details" },
|
|
7790
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null,
|
|
7791
|
+
"of ",
|
|
7792
|
+
MAX_FREE_USAGE,
|
|
7793
|
+
" messages"),
|
|
7794
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null,
|
|
7795
|
+
"(",
|
|
7796
|
+
percentage,
|
|
7797
|
+
"% used)"))),
|
|
7798
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "subscription-page-progress-bar" },
|
|
7799
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "subscription-page-progress-fill", style: { width: `${Math.min(percentage, 100)}%` } })),
|
|
7800
|
+
remainingUsage > 0 ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", { className: "subscription-page-status-message" }, resetDate ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
|
|
7801
|
+
"Your free usage resets ",
|
|
7802
|
+
resetDate)) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
|
|
7803
|
+
"\u2713 ",
|
|
7804
|
+
remainingUsage,
|
|
7805
|
+
" messages remaining")))) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", { className: "subscription-page-status-warning" }, "You have reached your free usage limit. Upgrade to continue using Mito AI."))),
|
|
7806
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "subscription-page-button-container" },
|
|
7807
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("form", { action: _utils_stripe__WEBPACK_IMPORTED_MODULE_3__.STRIPE_PAYMENT_LINK, method: "POST", target: "_blank" },
|
|
7808
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { type: "submit", className: "button-base button-purple subscription-page-button", onClick: () => {
|
|
7809
|
+
void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_2__.logEvent)('clicked_upgrade_to_pro_from_settings', {
|
|
7810
|
+
usage_count: usageCount,
|
|
7811
|
+
usage_percentage: percentage,
|
|
7812
|
+
});
|
|
7813
|
+
} },
|
|
7814
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, "Upgrade to Pro"))),
|
|
7815
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", { href: "https://www.trymito.io/plans", target: "_blank", rel: "noopener noreferrer", className: "button-base button-gray subscription-page-button", onClick: () => {
|
|
7816
|
+
void (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_2__.logEvent)('clicked_view_plans_from_settings', {
|
|
7817
|
+
usage_count: usageCount,
|
|
7818
|
+
usage_percentage: percentage,
|
|
7819
|
+
});
|
|
7820
|
+
} },
|
|
7821
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("b", null, "View Plans")))));
|
|
7822
|
+
};
|
|
7823
|
+
|
|
7824
|
+
|
|
7825
|
+
/***/ }),
|
|
7826
|
+
|
|
7827
|
+
/***/ "./lib/Extensions/SettingsManager/subscription/ProCard.js":
|
|
7828
|
+
/*!****************************************************************!*\
|
|
7829
|
+
!*** ./lib/Extensions/SettingsManager/subscription/ProCard.js ***!
|
|
7830
|
+
\****************************************************************/
|
|
7831
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
7832
|
+
|
|
7833
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7834
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7835
|
+
/* harmony export */ ProCard: () => (/* binding */ ProCard)
|
|
7836
|
+
/* harmony export */ });
|
|
7837
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
7838
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7839
|
+
/* harmony import */ var _style_SubscriptionPage_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/SubscriptionPage.css */ "./style/SubscriptionPage.css");
|
|
7840
|
+
/*
|
|
7841
|
+
* Copyright (c) Saga Inc.
|
|
7842
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
7843
|
+
*/
|
|
7844
|
+
|
|
7845
|
+
|
|
7846
|
+
const ProCard = () => {
|
|
7847
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
|
|
7848
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, "You are subscribed to Mito Pro."),
|
|
7849
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null,
|
|
7850
|
+
"If you have questions about your subscription, please contact us at ",
|
|
7851
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", { href: "mailto:founders@sagacollab.com " }, "founders@sagacollab.com"))));
|
|
7852
|
+
};
|
|
7853
|
+
|
|
7854
|
+
|
|
7855
|
+
/***/ }),
|
|
7856
|
+
|
|
7857
|
+
/***/ "./lib/Extensions/SettingsManager/subscription/SubscriptionPage.js":
|
|
7858
|
+
/*!*************************************************************************!*\
|
|
7859
|
+
!*** ./lib/Extensions/SettingsManager/subscription/SubscriptionPage.js ***!
|
|
7860
|
+
\*************************************************************************/
|
|
7861
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
7862
|
+
|
|
7863
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7864
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7865
|
+
/* harmony export */ SubscriptionPage: () => (/* binding */ SubscriptionPage)
|
|
7866
|
+
/* harmony export */ });
|
|
7867
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
7868
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7869
|
+
/* harmony import */ var _restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../restAPI/RestAPI */ "./lib/restAPI/RestAPI.js");
|
|
7870
|
+
/* harmony import */ var _FreeTierCard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./FreeTierCard */ "./lib/Extensions/SettingsManager/subscription/FreeTierCard.js");
|
|
7871
|
+
/* harmony import */ var _ProCard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ProCard */ "./lib/Extensions/SettingsManager/subscription/ProCard.js");
|
|
7872
|
+
/* harmony import */ var _style_SubscriptionPage_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/SubscriptionPage.css */ "./style/SubscriptionPage.css");
|
|
7873
|
+
/*
|
|
7874
|
+
* Copyright (c) Saga Inc.
|
|
7875
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
7876
|
+
*/
|
|
7877
|
+
|
|
7878
|
+
|
|
7879
|
+
|
|
7880
|
+
|
|
7881
|
+
|
|
7882
|
+
const SubscriptionPage = () => {
|
|
7883
|
+
const [isPro, setIsPro] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
7884
|
+
// When we first open the page, load the settings from the server
|
|
7885
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
7886
|
+
const fetchSettings = async () => {
|
|
7887
|
+
const proStatus = await (0,_restAPI_RestAPI__WEBPACK_IMPORTED_MODULE_2__.getUserKey)('is_pro');
|
|
7888
|
+
setIsPro(proStatus === 'True');
|
|
7889
|
+
};
|
|
7890
|
+
void fetchSettings();
|
|
7891
|
+
}, []);
|
|
7892
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null,
|
|
7893
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "settings-header" },
|
|
7894
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("h2", null, "Manage Subscription")),
|
|
7895
|
+
isPro ? react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ProCard__WEBPACK_IMPORTED_MODULE_3__.ProCard, null) : react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_FreeTierCard__WEBPACK_IMPORTED_MODULE_4__.FreeTierCard, null)));
|
|
7896
|
+
};
|
|
7897
|
+
|
|
7898
|
+
|
|
7411
7899
|
/***/ }),
|
|
7412
7900
|
|
|
7413
7901
|
/***/ "./lib/Extensions/SettingsManager/support/SupportPage.js":
|
|
@@ -7528,11 +8016,8 @@ const ToolbarButtonsPlugin = {
|
|
|
7528
8016
|
caption: 'Preview notebook as app and turn on App Mode',
|
|
7529
8017
|
className: 'text-button-mito-ai button-base button-purple button-small',
|
|
7530
8018
|
execute: async () => {
|
|
7531
|
-
void app.commands.execute(
|
|
8019
|
+
void app.commands.execute(_commands__WEBPACK_IMPORTED_MODULE_2__.COMMAND_MITO_AI_PREVIEW_AS_STREAMLIT);
|
|
7532
8020
|
},
|
|
7533
|
-
isVisible: () => {
|
|
7534
|
-
return app.commands.hasCommand(_commands__WEBPACK_IMPORTED_MODULE_2__.COMMAND_MITO_AI_BETA_MODE_ENABLED);
|
|
7535
|
-
}
|
|
7536
8021
|
});
|
|
7537
8022
|
// Check if the beta mode is enabled. After checking, tell Jupyter to
|
|
7538
8023
|
// re-evaluate convert-to-streamlit visibility now that we have had the
|
|
@@ -8133,6 +8618,76 @@ const AssumptionToolUI = ({ assumptions, }) => {
|
|
|
8133
8618
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AssumptionToolUI);
|
|
8134
8619
|
|
|
8135
8620
|
|
|
8621
|
+
/***/ }),
|
|
8622
|
+
|
|
8623
|
+
/***/ "./lib/components/AgentComponents/CreateStreamlitAppToolUI.js":
|
|
8624
|
+
/*!********************************************************************!*\
|
|
8625
|
+
!*** ./lib/components/AgentComponents/CreateStreamlitAppToolUI.js ***!
|
|
8626
|
+
\********************************************************************/
|
|
8627
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8628
|
+
|
|
8629
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8630
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8631
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
8632
|
+
/* harmony export */ });
|
|
8633
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
8634
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8635
|
+
/* harmony import */ var _ShimmerWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ShimmerWrapper */ "./lib/components/AgentComponents/ShimmerWrapper.js");
|
|
8636
|
+
/* harmony import */ var _icons_AppIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../icons/AppIcon */ "./lib/icons/AppIcon.js");
|
|
8637
|
+
/* harmony import */ var _style_AgentToolUIComponent_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../style/AgentToolUIComponent.css */ "./style/AgentToolUIComponent.css");
|
|
8638
|
+
/*
|
|
8639
|
+
* Copyright (c) Saga Inc.
|
|
8640
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
8641
|
+
*/
|
|
8642
|
+
|
|
8643
|
+
|
|
8644
|
+
|
|
8645
|
+
|
|
8646
|
+
const CreateStreamlitAppToolUI = ({ isRunning = false }) => {
|
|
8647
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "agent-tool-ui-container" },
|
|
8648
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ShimmerWrapper__WEBPACK_IMPORTED_MODULE_2__["default"], { isActive: isRunning },
|
|
8649
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "agent-tool-ui-content" },
|
|
8650
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_AppIcon__WEBPACK_IMPORTED_MODULE_3__["default"], null),
|
|
8651
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, "Creating Streamlit app")))));
|
|
8652
|
+
};
|
|
8653
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CreateStreamlitAppToolUI);
|
|
8654
|
+
|
|
8655
|
+
|
|
8656
|
+
/***/ }),
|
|
8657
|
+
|
|
8658
|
+
/***/ "./lib/components/AgentComponents/EditStreamlitAppToolUI.js":
|
|
8659
|
+
/*!******************************************************************!*\
|
|
8660
|
+
!*** ./lib/components/AgentComponents/EditStreamlitAppToolUI.js ***!
|
|
8661
|
+
\******************************************************************/
|
|
8662
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8663
|
+
|
|
8664
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8665
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8666
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
8667
|
+
/* harmony export */ });
|
|
8668
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
8669
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8670
|
+
/* harmony import */ var _icons_Pencil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../icons/Pencil */ "./lib/icons/Pencil.js");
|
|
8671
|
+
/* harmony import */ var _ShimmerWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ShimmerWrapper */ "./lib/components/AgentComponents/ShimmerWrapper.js");
|
|
8672
|
+
/* harmony import */ var _style_AgentToolUIComponent_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../style/AgentToolUIComponent.css */ "./style/AgentToolUIComponent.css");
|
|
8673
|
+
/*
|
|
8674
|
+
* Copyright (c) Saga Inc.
|
|
8675
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
8676
|
+
*/
|
|
8677
|
+
|
|
8678
|
+
|
|
8679
|
+
|
|
8680
|
+
|
|
8681
|
+
const EditStreamlitAppToolUI = ({ isRunning = false }) => {
|
|
8682
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "agent-tool-ui-container" },
|
|
8683
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ShimmerWrapper__WEBPACK_IMPORTED_MODULE_2__["default"], { isActive: isRunning },
|
|
8684
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "agent-tool-ui-content" },
|
|
8685
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_Pencil__WEBPACK_IMPORTED_MODULE_3__["default"], null),
|
|
8686
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, "Editing Streamlit app")))));
|
|
8687
|
+
};
|
|
8688
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EditStreamlitAppToolUI);
|
|
8689
|
+
|
|
8690
|
+
|
|
8136
8691
|
/***/ }),
|
|
8137
8692
|
|
|
8138
8693
|
/***/ "./lib/components/AgentComponents/ErrorFixupToolUI.js":
|
|
@@ -8286,10 +8841,10 @@ const RunAllCellsToolUI = ({ inErrorFixup }) => {
|
|
|
8286
8841
|
|
|
8287
8842
|
/***/ }),
|
|
8288
8843
|
|
|
8289
|
-
/***/ "./lib/components/
|
|
8290
|
-
|
|
8291
|
-
!*** ./lib/components/
|
|
8292
|
-
|
|
8844
|
+
/***/ "./lib/components/AgentComponents/ShimmerWrapper.js":
|
|
8845
|
+
/*!**********************************************************!*\
|
|
8846
|
+
!*** ./lib/components/AgentComponents/ShimmerWrapper.js ***!
|
|
8847
|
+
\**********************************************************/
|
|
8293
8848
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8294
8849
|
|
|
8295
8850
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -8298,11 +8853,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8298
8853
|
/* harmony export */ });
|
|
8299
8854
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
8300
8855
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8301
|
-
/* harmony import */ var
|
|
8302
|
-
/* harmony import */ var
|
|
8303
|
-
/* harmony import */ var _restAPI_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../restAPI/utils */ "./lib/restAPI/utils.js");
|
|
8304
|
-
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
|
|
8305
|
-
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
|
|
8856
|
+
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/classNames */ "./lib/utils/classNames.js");
|
|
8857
|
+
/* harmony import */ var _style_ShimmerWrapper_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../style/ShimmerWrapper.css */ "./style/ShimmerWrapper.css");
|
|
8306
8858
|
/*
|
|
8307
8859
|
* Copyright (c) Saga Inc.
|
|
8308
8860
|
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
@@ -8310,23 +8862,41 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
8310
8862
|
|
|
8311
8863
|
|
|
8312
8864
|
|
|
8865
|
+
const ShimmerWrapper = ({ children, isActive = false, className = '' }) => {
|
|
8866
|
+
const shimmerClass = isActive ? 'shimmer-wrapper' : '';
|
|
8867
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_2__.classNames)(shimmerClass, className) }, children));
|
|
8868
|
+
};
|
|
8869
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ShimmerWrapper);
|
|
8870
|
+
|
|
8871
|
+
|
|
8872
|
+
/***/ }),
|
|
8873
|
+
|
|
8874
|
+
/***/ "./lib/components/AttachFileButton.js":
|
|
8875
|
+
/*!********************************************!*\
|
|
8876
|
+
!*** ./lib/components/AttachFileButton.js ***!
|
|
8877
|
+
\********************************************/
|
|
8878
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
8879
|
+
|
|
8880
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8881
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
8882
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
8883
|
+
/* harmony export */ });
|
|
8884
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
8885
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
8886
|
+
/* harmony import */ var _IconButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IconButton */ "./lib/components/IconButton.js");
|
|
8887
|
+
/* harmony import */ var _icons_PaperClipIcon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icons/PaperClipIcon */ "./lib/icons/PaperClipIcon.js");
|
|
8888
|
+
/* harmony import */ var _utils_fileUpload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/fileUpload */ "./lib/utils/fileUpload.js");
|
|
8889
|
+
/*
|
|
8890
|
+
* Copyright (c) Saga Inc.
|
|
8891
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
8892
|
+
*/
|
|
8893
|
+
|
|
8894
|
+
|
|
8313
8895
|
|
|
8314
8896
|
|
|
8315
|
-
// Constants for file handling
|
|
8316
|
-
const CHUNKED_UPLOAD_SIZE_CUTOFF = 25 * 1024 * 1024; // 25MB cutoff for chunked uploads
|
|
8317
|
-
const CHUNK_SIZE = 10 * 1024 * 1024; // 10MB chunks
|
|
8318
8897
|
const AttachFileButton = ({ onFileUploaded, notebookTracker }) => {
|
|
8319
8898
|
const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
8320
8899
|
const [isUploading, setIsUploading] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
8321
|
-
// Helper function to get notebook directory from notebook path
|
|
8322
|
-
const getNotebookDirectory = (notebookPath) => {
|
|
8323
|
-
const lastSlashIndex = notebookPath.lastIndexOf('/');
|
|
8324
|
-
if (lastSlashIndex === -1) {
|
|
8325
|
-
// No directory, just filename (root directory)
|
|
8326
|
-
return '.';
|
|
8327
|
-
}
|
|
8328
|
-
return notebookPath.substring(0, lastSlashIndex);
|
|
8329
|
-
};
|
|
8330
8900
|
const handleClick = () => {
|
|
8331
8901
|
var _a;
|
|
8332
8902
|
// Don't allow clicks if uploading
|
|
@@ -8347,21 +8917,11 @@ const AttachFileButton = ({ onFileUploaded, notebookTracker }) => {
|
|
|
8347
8917
|
return;
|
|
8348
8918
|
setIsUploading(true);
|
|
8349
8919
|
try {
|
|
8350
|
-
//
|
|
8351
|
-
|
|
8352
|
-
console.log(`File ${file.name} is larger than 25MB (${(file.size / (1024 * 1024)).toFixed(2)}MB). Splitting into chunks...`);
|
|
8353
|
-
await handleLargeFile(file);
|
|
8354
|
-
}
|
|
8355
|
-
else {
|
|
8356
|
-
// Upload file directly for files <= 25MB
|
|
8357
|
-
await uploadFile(file);
|
|
8358
|
-
}
|
|
8920
|
+
// Use the shared upload utility
|
|
8921
|
+
await (0,_utils_fileUpload__WEBPACK_IMPORTED_MODULE_1__.uploadFileToBackend)(file, notebookTracker, onFileUploaded);
|
|
8359
8922
|
}
|
|
8360
8923
|
catch (error) {
|
|
8361
|
-
|
|
8362
|
-
autoClose: 5 * 1000 // 5 seconds
|
|
8363
|
-
});
|
|
8364
|
-
console.error('Error during file upload:', error);
|
|
8924
|
+
// Error handling is already done in the utility function
|
|
8365
8925
|
}
|
|
8366
8926
|
finally {
|
|
8367
8927
|
setIsUploading(false);
|
|
@@ -8371,116 +8931,9 @@ const AttachFileButton = ({ onFileUploaded, notebookTracker }) => {
|
|
|
8371
8931
|
}
|
|
8372
8932
|
}
|
|
8373
8933
|
};
|
|
8374
|
-
const handleLargeFile = async (file) => {
|
|
8375
|
-
const totalChunks = Math.ceil(file.size / CHUNK_SIZE);
|
|
8376
|
-
console.log(`Splitting file into ${totalChunks} chunks of ${(CHUNK_SIZE / (1024 * 1024)).toFixed(2)}MB each`);
|
|
8377
|
-
// Get notebook directory path
|
|
8378
|
-
const notebookPanel = notebookTracker.currentWidget;
|
|
8379
|
-
if (!notebookPanel) {
|
|
8380
|
-
console.error('No notebook is currently active');
|
|
8381
|
-
throw new Error('No notebook is currently active');
|
|
8382
|
-
}
|
|
8383
|
-
const notebookPath = notebookPanel.context.path;
|
|
8384
|
-
const notebookDir = getNotebookDirectory(notebookPath);
|
|
8385
|
-
for (let chunkIndex = 0; chunkIndex < totalChunks; chunkIndex++) {
|
|
8386
|
-
const start = chunkIndex * CHUNK_SIZE;
|
|
8387
|
-
const end = Math.min(start + CHUNK_SIZE, file.size);
|
|
8388
|
-
const chunk = file.slice(start, end);
|
|
8389
|
-
console.log(`Uploading chunk ${chunkIndex + 1}/${totalChunks}:`, {
|
|
8390
|
-
chunkNumber: chunkIndex + 1,
|
|
8391
|
-
totalChunks: totalChunks,
|
|
8392
|
-
chunkSize: chunk.size,
|
|
8393
|
-
chunkSizeMB: (chunk.size / (1024 * 1024)).toFixed(2),
|
|
8394
|
-
startByte: start,
|
|
8395
|
-
endByte: end,
|
|
8396
|
-
fileName: file.name,
|
|
8397
|
-
originalFileSize: file.size,
|
|
8398
|
-
originalFileSizeMB: (file.size / (1024 * 1024)).toFixed(2)
|
|
8399
|
-
});
|
|
8400
|
-
// Upload chunk to backend
|
|
8401
|
-
const success = await uploadChunk(chunk, file.name, chunkIndex + 1, totalChunks, notebookDir);
|
|
8402
|
-
if (!success) {
|
|
8403
|
-
console.error(`Failed to upload chunk ${chunkIndex + 1}`);
|
|
8404
|
-
throw new Error(`Failed to upload chunk ${chunkIndex + 1}`);
|
|
8405
|
-
}
|
|
8406
|
-
}
|
|
8407
|
-
console.log(`Successfully uploaded all ${totalChunks} chunks for file: ${file.name}`);
|
|
8408
|
-
// Notify the parent component that the file was uploaded
|
|
8409
|
-
onFileUploaded(file);
|
|
8410
|
-
};
|
|
8411
|
-
const uploadChunk = async (chunk, filename, chunkNumber, totalChunks, notebookDir) => {
|
|
8412
|
-
try {
|
|
8413
|
-
// Create FormData for chunk upload
|
|
8414
|
-
const formData = new FormData();
|
|
8415
|
-
formData.append('file', chunk, filename);
|
|
8416
|
-
formData.append('chunk_number', chunkNumber.toString());
|
|
8417
|
-
formData.append('total_chunks', totalChunks.toString());
|
|
8418
|
-
formData.append('notebook_dir', notebookDir);
|
|
8419
|
-
// Upload chunk to backend
|
|
8420
|
-
const resp = await (0,_restAPI_utils__WEBPACK_IMPORTED_MODULE_2__.requestAPI)('upload', {
|
|
8421
|
-
method: 'POST',
|
|
8422
|
-
body: formData
|
|
8423
|
-
});
|
|
8424
|
-
if (resp.error) {
|
|
8425
|
-
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit(`Upload failed: ${resp.error.message}`, "error", {
|
|
8426
|
-
autoClose: 5 * 1000 // 5 seconds
|
|
8427
|
-
});
|
|
8428
|
-
console.error(`Chunk ${chunkNumber} upload failed:`, resp.error.message);
|
|
8429
|
-
return false;
|
|
8430
|
-
}
|
|
8431
|
-
else if (resp.data) {
|
|
8432
|
-
if (resp.data.chunk_complete) {
|
|
8433
|
-
console.log(`All chunks uploaded successfully. File reconstructed: ${resp.data.filename}`);
|
|
8434
|
-
}
|
|
8435
|
-
else if (resp.data.chunk_received) {
|
|
8436
|
-
console.log(`Chunk ${resp.data.chunk_number}/${resp.data.total_chunks} uploaded successfully`);
|
|
8437
|
-
}
|
|
8438
|
-
return true;
|
|
8439
|
-
}
|
|
8440
|
-
return false;
|
|
8441
|
-
}
|
|
8442
|
-
catch (error) {
|
|
8443
|
-
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit(`Upload failed: ${error}`, "error", {
|
|
8444
|
-
autoClose: 5 * 1000 // 5 seconds
|
|
8445
|
-
});
|
|
8446
|
-
console.error(`Error uploading chunk ${chunkNumber}:`, error);
|
|
8447
|
-
return false;
|
|
8448
|
-
}
|
|
8449
|
-
};
|
|
8450
|
-
const uploadFile = async (file) => {
|
|
8451
|
-
// Get notebook directory path
|
|
8452
|
-
const notebookPanel = notebookTracker.currentWidget;
|
|
8453
|
-
if (!notebookPanel) {
|
|
8454
|
-
console.error('No notebook is currently active');
|
|
8455
|
-
throw new Error('No notebook is currently active');
|
|
8456
|
-
}
|
|
8457
|
-
const notebookPath = notebookPanel.context.path;
|
|
8458
|
-
const notebookDir = getNotebookDirectory(notebookPath);
|
|
8459
|
-
// Create FormData for file upload
|
|
8460
|
-
const formData = new FormData();
|
|
8461
|
-
formData.append('file', file);
|
|
8462
|
-
formData.append('notebook_dir', notebookDir);
|
|
8463
|
-
// Upload file to backend using FormData
|
|
8464
|
-
const resp = await (0,_restAPI_utils__WEBPACK_IMPORTED_MODULE_2__.requestAPI)('upload', {
|
|
8465
|
-
method: 'POST',
|
|
8466
|
-
body: formData
|
|
8467
|
-
});
|
|
8468
|
-
if (resp.error) {
|
|
8469
|
-
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.emit(`Upload failed: ${resp.error.message}`, "error", {
|
|
8470
|
-
autoClose: 5 * 1000 // 5 seconds
|
|
8471
|
-
});
|
|
8472
|
-
console.error('Upload failed:', resp.error.message);
|
|
8473
|
-
}
|
|
8474
|
-
else if (resp.data) {
|
|
8475
|
-
console.log('File uploaded successfully:', resp.data);
|
|
8476
|
-
// Notify the parent component that the file was uploaded,
|
|
8477
|
-
// which will update the context manager.
|
|
8478
|
-
onFileUploaded(file);
|
|
8479
|
-
}
|
|
8480
|
-
};
|
|
8481
8934
|
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { style: { position: 'relative' } },
|
|
8482
8935
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: handleFileSelect, accept: "*" }),
|
|
8483
|
-
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
8936
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_IconButton__WEBPACK_IMPORTED_MODULE_2__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_PaperClipIcon__WEBPACK_IMPORTED_MODULE_3__["default"], null), title: isUploading ? 'Uploading...' : 'Attach File', onClick: handleClick, className: 'icon-button-hover', disabled: isUploading, style: {
|
|
8484
8937
|
...(isUploading && { opacity: 0.5 }),
|
|
8485
8938
|
cursor: isUploading ? 'not-allowed' : 'pointer'
|
|
8486
8939
|
} })));
|
|
@@ -8535,7 +8988,7 @@ const DatabaseButton = ({ app }) => {
|
|
|
8535
8988
|
return Object.keys(databaseConnections).length > 0 ? 'success' : 'warning';
|
|
8536
8989
|
};
|
|
8537
8990
|
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_IconButton__WEBPACK_IMPORTED_MODULE_2__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_DatabaseOutlineIcon__WEBPACK_IMPORTED_MODULE_3__["default"], null), title: 'Add Database', onClick: () => {
|
|
8538
|
-
void app.commands.execute(_Extensions_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_4__.
|
|
8991
|
+
void app.commands.execute(_Extensions_SettingsManager_SettingsManagerPlugin__WEBPACK_IMPORTED_MODULE_4__.COMMAND_MITO_AI_SETTINGS_DATABASE);
|
|
8539
8992
|
setIsIconVisible(false);
|
|
8540
8993
|
}, notificationDotType: getNotificationDotType(), className: 'icon-button-hover', style: {
|
|
8541
8994
|
height: 'var(--chat-context-button-height)'
|
|
@@ -9170,6 +9623,36 @@ const AlertIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElem
|
|
|
9170
9623
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AlertIcon);
|
|
9171
9624
|
|
|
9172
9625
|
|
|
9626
|
+
/***/ }),
|
|
9627
|
+
|
|
9628
|
+
/***/ "./lib/icons/AppIcon.js":
|
|
9629
|
+
/*!******************************!*\
|
|
9630
|
+
!*** ./lib/icons/AppIcon.js ***!
|
|
9631
|
+
\******************************/
|
|
9632
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9633
|
+
|
|
9634
|
+
__webpack_require__.r(__webpack_exports__);
|
|
9635
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9636
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
9637
|
+
/* harmony export */ });
|
|
9638
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
|
|
9639
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
9640
|
+
/*
|
|
9641
|
+
* Copyright (c) Saga Inc.
|
|
9642
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
9643
|
+
*/
|
|
9644
|
+
|
|
9645
|
+
const AppIcon = () => {
|
|
9646
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor" },
|
|
9647
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("rect", { x: "2", y: "2", width: "12", height: "12", rx: "2", stroke: "currentColor", strokeWidth: "1", fill: "none" }),
|
|
9648
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("rect", { x: "4", y: "4", width: "3", height: "3", fill: "currentColor" }),
|
|
9649
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("rect", { x: "9", y: "4", width: "3", height: "3", fill: "currentColor" }),
|
|
9650
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("rect", { x: "4", y: "9", width: "3", height: "3", fill: "currentColor" }),
|
|
9651
|
+
react__WEBPACK_IMPORTED_MODULE_0___default().createElement("rect", { x: "9", y: "9", width: "3", height: "3", fill: "currentColor" })));
|
|
9652
|
+
};
|
|
9653
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AppIcon);
|
|
9654
|
+
|
|
9655
|
+
|
|
9173
9656
|
/***/ }),
|
|
9174
9657
|
|
|
9175
9658
|
/***/ "./lib/icons/CodeIcon.js":
|
|
@@ -9903,7 +10386,11 @@ const startStreamlitPreview = async (notebookPath, force_recreate = false, edit_
|
|
|
9903
10386
|
})
|
|
9904
10387
|
});
|
|
9905
10388
|
if (response.error) {
|
|
9906
|
-
|
|
10389
|
+
const streamlitPreviewReponseError = {
|
|
10390
|
+
type: 'error',
|
|
10391
|
+
message: response.error.message
|
|
10392
|
+
};
|
|
10393
|
+
return streamlitPreviewReponseError;
|
|
9907
10394
|
}
|
|
9908
10395
|
return response.data;
|
|
9909
10396
|
};
|
|
@@ -10958,6 +11445,166 @@ const stripFileEnding = (rule) => {
|
|
|
10958
11445
|
};
|
|
10959
11446
|
|
|
10960
11447
|
|
|
11448
|
+
/***/ }),
|
|
11449
|
+
|
|
11450
|
+
/***/ "./lib/utils/fileUpload.js":
|
|
11451
|
+
/*!*********************************!*\
|
|
11452
|
+
!*** ./lib/utils/fileUpload.js ***!
|
|
11453
|
+
\*********************************/
|
|
11454
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
11455
|
+
|
|
11456
|
+
__webpack_require__.r(__webpack_exports__);
|
|
11457
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11458
|
+
/* harmony export */ uploadFileToBackend: () => (/* binding */ uploadFileToBackend)
|
|
11459
|
+
/* harmony export */ });
|
|
11460
|
+
/* harmony import */ var _restAPI_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../restAPI/utils */ "./lib/restAPI/utils.js");
|
|
11461
|
+
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
|
|
11462
|
+
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);
|
|
11463
|
+
/*
|
|
11464
|
+
* Copyright (c) Saga Inc.
|
|
11465
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
11466
|
+
*/
|
|
11467
|
+
|
|
11468
|
+
|
|
11469
|
+
const CHUNKED_UPLOAD_SIZE_CUTOFF = 25 * 1024 * 1024; // 25MB cutoff for chunked uploads
|
|
11470
|
+
const CHUNK_SIZE = 10 * 1024 * 1024; // 10MB chunks
|
|
11471
|
+
const getNotebookDirectory = (notebookPath) => {
|
|
11472
|
+
const lastSlashIndex = notebookPath.lastIndexOf('/');
|
|
11473
|
+
if (lastSlashIndex === -1) {
|
|
11474
|
+
// No directory, just filename (root directory)
|
|
11475
|
+
return '.';
|
|
11476
|
+
}
|
|
11477
|
+
return notebookPath.substring(0, lastSlashIndex);
|
|
11478
|
+
};
|
|
11479
|
+
const uploadChunk = async (chunk, filename, chunkNumber, totalChunks, notebookDir) => {
|
|
11480
|
+
try {
|
|
11481
|
+
// Create FormData for chunk upload
|
|
11482
|
+
const formData = new FormData();
|
|
11483
|
+
formData.append('file', chunk, filename);
|
|
11484
|
+
formData.append('chunk_number', chunkNumber.toString());
|
|
11485
|
+
formData.append('total_chunks', totalChunks.toString());
|
|
11486
|
+
formData.append('notebook_dir', notebookDir);
|
|
11487
|
+
// Upload chunk to backend
|
|
11488
|
+
const resp = await (0,_restAPI_utils__WEBPACK_IMPORTED_MODULE_1__.requestAPI)('upload', {
|
|
11489
|
+
method: 'POST',
|
|
11490
|
+
body: formData
|
|
11491
|
+
});
|
|
11492
|
+
if (resp.error) {
|
|
11493
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.emit(`Upload failed: ${resp.error.message}`, "error", {
|
|
11494
|
+
autoClose: 5 * 1000 // 5 seconds
|
|
11495
|
+
});
|
|
11496
|
+
console.error(`Chunk ${chunkNumber} upload failed:`, resp.error.message);
|
|
11497
|
+
return false;
|
|
11498
|
+
}
|
|
11499
|
+
else if (resp.data) {
|
|
11500
|
+
if (resp.data.chunk_complete) {
|
|
11501
|
+
console.log(`All chunks uploaded successfully. File reconstructed: ${resp.data.filename}`);
|
|
11502
|
+
}
|
|
11503
|
+
else if (resp.data.chunk_received) {
|
|
11504
|
+
console.log(`Chunk ${resp.data.chunk_number}/${resp.data.total_chunks} uploaded successfully`);
|
|
11505
|
+
}
|
|
11506
|
+
return true;
|
|
11507
|
+
}
|
|
11508
|
+
return false;
|
|
11509
|
+
}
|
|
11510
|
+
catch (error) {
|
|
11511
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.emit(`Upload failed: ${error}`, "error", {
|
|
11512
|
+
autoClose: 5 * 1000 // 5 seconds
|
|
11513
|
+
});
|
|
11514
|
+
console.error(`Error uploading chunk ${chunkNumber}:`, error);
|
|
11515
|
+
return false;
|
|
11516
|
+
}
|
|
11517
|
+
};
|
|
11518
|
+
const handleLargeFile = async (file, notebookTracker, onFileUploaded) => {
|
|
11519
|
+
const totalChunks = Math.ceil(file.size / CHUNK_SIZE);
|
|
11520
|
+
console.log(`Splitting file into ${totalChunks} chunks of ${(CHUNK_SIZE / (1024 * 1024)).toFixed(2)}MB each`);
|
|
11521
|
+
// Get notebook directory path
|
|
11522
|
+
const notebookPanel = notebookTracker.currentWidget;
|
|
11523
|
+
if (!notebookPanel) {
|
|
11524
|
+
console.error('No notebook is currently active');
|
|
11525
|
+
throw new Error('No notebook is currently active');
|
|
11526
|
+
}
|
|
11527
|
+
const notebookPath = notebookPanel.context.path;
|
|
11528
|
+
const notebookDir = getNotebookDirectory(notebookPath);
|
|
11529
|
+
for (let chunkIndex = 0; chunkIndex < totalChunks; chunkIndex++) {
|
|
11530
|
+
const start = chunkIndex * CHUNK_SIZE;
|
|
11531
|
+
const end = Math.min(start + CHUNK_SIZE, file.size);
|
|
11532
|
+
const chunk = file.slice(start, end);
|
|
11533
|
+
console.log(`Uploading chunk ${chunkIndex + 1}/${totalChunks}:`, {
|
|
11534
|
+
chunkNumber: chunkIndex + 1,
|
|
11535
|
+
totalChunks: totalChunks,
|
|
11536
|
+
chunkSize: chunk.size,
|
|
11537
|
+
chunkSizeMB: (chunk.size / (1024 * 1024)).toFixed(2),
|
|
11538
|
+
startByte: start,
|
|
11539
|
+
endByte: end,
|
|
11540
|
+
fileName: file.name,
|
|
11541
|
+
originalFileSize: file.size,
|
|
11542
|
+
originalFileSizeMB: (file.size / (1024 * 1024)).toFixed(2)
|
|
11543
|
+
});
|
|
11544
|
+
// Upload chunk to backend
|
|
11545
|
+
const success = await uploadChunk(chunk, file.name, chunkIndex + 1, totalChunks, notebookDir);
|
|
11546
|
+
if (!success) {
|
|
11547
|
+
console.error(`Failed to upload chunk ${chunkIndex + 1}`);
|
|
11548
|
+
throw new Error(`Failed to upload chunk ${chunkIndex + 1}`);
|
|
11549
|
+
}
|
|
11550
|
+
}
|
|
11551
|
+
console.log(`Successfully uploaded all ${totalChunks} chunks for file: ${file.name}`);
|
|
11552
|
+
// Notify the parent component that the file was uploaded
|
|
11553
|
+
onFileUploaded(file);
|
|
11554
|
+
};
|
|
11555
|
+
const uploadFile = async (file, notebookTracker, onFileUploaded) => {
|
|
11556
|
+
// Get notebook directory path
|
|
11557
|
+
const notebookPanel = notebookTracker.currentWidget;
|
|
11558
|
+
if (!notebookPanel) {
|
|
11559
|
+
console.error('No notebook is currently active');
|
|
11560
|
+
throw new Error('No notebook is currently active');
|
|
11561
|
+
}
|
|
11562
|
+
const notebookPath = notebookPanel.context.path;
|
|
11563
|
+
const notebookDir = getNotebookDirectory(notebookPath);
|
|
11564
|
+
// Create FormData for file upload
|
|
11565
|
+
const formData = new FormData();
|
|
11566
|
+
formData.append('file', file);
|
|
11567
|
+
formData.append('notebook_dir', notebookDir);
|
|
11568
|
+
// Upload file to backend using FormData
|
|
11569
|
+
const resp = await (0,_restAPI_utils__WEBPACK_IMPORTED_MODULE_1__.requestAPI)('upload', {
|
|
11570
|
+
method: 'POST',
|
|
11571
|
+
body: formData
|
|
11572
|
+
});
|
|
11573
|
+
if (resp.error) {
|
|
11574
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.emit(`Upload failed: ${resp.error.message}`, "error", {
|
|
11575
|
+
autoClose: 5 * 1000 // 5 seconds
|
|
11576
|
+
});
|
|
11577
|
+
console.error('Upload failed:', resp.error.message);
|
|
11578
|
+
}
|
|
11579
|
+
else if (resp.data) {
|
|
11580
|
+
console.log('File uploaded successfully:', resp.data);
|
|
11581
|
+
// Notify the parent component that the file was uploaded,
|
|
11582
|
+
// which will update the context manager.
|
|
11583
|
+
onFileUploaded(file);
|
|
11584
|
+
}
|
|
11585
|
+
};
|
|
11586
|
+
const uploadFileToBackend = async (file, notebookTracker, onFileUploaded) => {
|
|
11587
|
+
try {
|
|
11588
|
+
// Check file size and handle accordingly
|
|
11589
|
+
if (file.size > CHUNKED_UPLOAD_SIZE_CUTOFF) {
|
|
11590
|
+
console.log(`File ${file.name} is larger than 25MB (${(file.size / (1024 * 1024)).toFixed(2)}MB). Splitting into chunks...`);
|
|
11591
|
+
await handleLargeFile(file, notebookTracker, onFileUploaded);
|
|
11592
|
+
}
|
|
11593
|
+
else {
|
|
11594
|
+
// Upload file directly for files <= 25MB
|
|
11595
|
+
await uploadFile(file, notebookTracker, onFileUploaded);
|
|
11596
|
+
}
|
|
11597
|
+
}
|
|
11598
|
+
catch (error) {
|
|
11599
|
+
_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.emit(`Upload failed: ${error}`, "error", {
|
|
11600
|
+
autoClose: 5 * 1000 // 5 seconds
|
|
11601
|
+
});
|
|
11602
|
+
console.error('Error during file upload:', error);
|
|
11603
|
+
throw error;
|
|
11604
|
+
}
|
|
11605
|
+
};
|
|
11606
|
+
|
|
11607
|
+
|
|
10961
11608
|
/***/ }),
|
|
10962
11609
|
|
|
10963
11610
|
/***/ "./lib/utils/models.js":
|
|
@@ -12372,10 +13019,10 @@ class AppDeployWebsocketClient extends _BaseWebsocketClient__WEBPACK_IMPORTED_MO
|
|
|
12372
13019
|
if (message.error) {
|
|
12373
13020
|
this._stream.emit({
|
|
12374
13021
|
type: 'chunk',
|
|
12375
|
-
chunk: { content: message.error.hint || message.error.
|
|
13022
|
+
chunk: { content: message.error.hint || message.error.message || "An error occurred" },
|
|
12376
13023
|
done: true,
|
|
12377
13024
|
parent_id: message.parent_id,
|
|
12378
|
-
error: message.error
|
|
13025
|
+
error: message.error.message
|
|
12379
13026
|
});
|
|
12380
13027
|
}
|
|
12381
13028
|
// This will get triggered when streaming and there is an error message.
|
|
@@ -12736,8 +13383,9 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
12736
13383
|
display: flex;
|
|
12737
13384
|
align-items: center;
|
|
12738
13385
|
gap: 10px;
|
|
12739
|
-
}
|
|
12740
|
-
|
|
13386
|
+
}
|
|
13387
|
+
|
|
13388
|
+
`, "",{"version":3,"sources":["webpack://./style/AgentToolUIComponent.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,sBAAsB;IACtB,6BAA6B;IAC7B,aAAa;IACb,+BAA+B;AACnC;;AAEA;IACI,cAAc;IACd,kBAAkB;IAClB,oDAAoD;AACxD;;AAEA;IACI,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,SAAS;AACb","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.agent-tool-ui-container {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: start;\n background-color: transparent;\n padding: 10px;\n color: var(--jp-ui-font-color2);\n}\n\n.agent-tool-ui-container:not(.agent-tool-ui-error-fixup) {\n margin: 10px 0;\n border-radius: 5px;\n border: 1px solid var(--jp-cell-editor-border-color);\n}\n\n.agent-tool-ui-container:not(.agent-tool-ui-error-fixup) .agent-tool-ui-content {\n margin-left: 5px;\n}\n\n.agent-tool-ui-content {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n\n"],"sourceRoot":""}]);
|
|
12741
13389
|
// Exports
|
|
12742
13390
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
12743
13391
|
|
|
@@ -13949,6 +14597,11 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
13949
14597
|
margin-top: 0;
|
|
13950
14598
|
}
|
|
13951
14599
|
|
|
14600
|
+
.chat-input-container.drag-over {
|
|
14601
|
+
border: 2px dashed var(--purple-500);
|
|
14602
|
+
transform: scale(1.02);
|
|
14603
|
+
}
|
|
14604
|
+
|
|
13952
14605
|
.chat-input-text-area-container {
|
|
13953
14606
|
position: relative;
|
|
13954
14607
|
height: min-content;
|
|
@@ -14029,7 +14682,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
14029
14682
|
|
|
14030
14683
|
.context-button:disabled:hover {
|
|
14031
14684
|
background-color: var(--jp-layout-color2);
|
|
14032
|
-
}`, "",{"version":3,"sources":["webpack://./style/ChatInput.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,gBAAgB;EAChB,SAAS;EACT,cAAc;EACd,gBAAgB;EAChB,2DAA2D;EAC3D;;;iCAG+B;EAC/B,WAAW;EACX,mBAAmB;EACnB,iDAAiD;AACnD;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,kBAAkB;EAClB,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,aAAa;EACb,gBAAgB;EAChB,sBAAsB;EACtB,yBAAyB;EACzB,2DAA2D;EAC3D,eAAe;EACf,gBAAgB;EAChB,qCAAqC;EACrC,gBAAgB;EAChB,iDAAiD;AACnD;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,2BAA2B;EAC3B;;;iCAG+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;EAC/B,2BAA2B;AAC7B;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,gBAAgB;EAChB,eAAe;EACf,yCAAyC;EACzC,eAAe;EACf,oCAAoC;EACpC,sCAAsC;AACxC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA,0BAA0B;AAC1B;EACE,YAAY;EACZ,mBAAmB;EACnB,yCAAyC;AAC3C;;AAEA;EACE,YAAY;EACZ,mBAAmB;EACnB,yCAAyC;AAC3C;;AAEA;EACE,yCAAyC;AAC3C","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.chat-input-container {\n position: sticky;\n bottom: 0;\n margin: 10px 0;\n margin-top: auto;\n background-color: var(--chat-user-message-background-color);\n box-shadow: \n 0 4px 12px rgba(0, 0, 0, 0.08),\n 0 2px 4px rgba(0, 0, 0, 0.06),\n 0 0 0 1px rgba(0, 0, 0, 0.02);\n width: 100%;\n border-radius: 12px;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.chat-input-container.editing {\n margin-top: 0;\n}\n\n.chat-input-text-area-container {\n position: relative;\n height: min-content;\n}\n\n.chat-input {\n outline: none;\n border: none;\n resize: none;\n width: 100%;\n padding: 10px;\n overflow-y: auto;\n box-sizing: border-box;\n flex-shrink: 0 !important;\n background-color: var(--chat-user-message-background-color);\n font-size: 12px;\n font-weight: 400;\n font-family: var(--jp-ui-font-family);\n line-height: 1.2;\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.active-cell-preview-container {\n padding: 10px;\n}\n\n.chat-input-container:focus-within {\n transform: translateY(-1px);\n box-shadow: \n 0 2px 8px rgba(0, 0, 0, 0.12),\n 0 8px 16px rgba(0, 0, 0, 0.08),\n 0 0 0 1px rgba(0, 0, 0, 0.04);\n}\n\n.chat-input:focus {\n color: var(--jp-ui-font-color1);\n}\n\n.chat-input::placeholder {\n color: var(--jp-ui-font-color2);\n transition: color 0.2s ease;\n}\n\n.chat-input:focus::placeholder {\n color: var(--jp-ui-font-color3);\n}\n\n.context-button {\n display: flex;\n align-items: center;\n background-color: var(--jp-layout-color2);\n border: 1px solid var(--jp-border-color1);\n border-radius: 3px;\n padding: 4px 8px;\n font-size: 12px;\n height: var(--chat-context-button-height);\n cursor: pointer;\n color: var(--jp-content-font-color1);\n transition: background-color 0.2s ease;\n}\n\n.context-button:hover {\n background-color: var(--jp-layout-color3);\n}\n\n/* Disabled state styles */\n.chat-input:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n background-color: var(--jp-layout-color2);\n}\n\n.context-button:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n background-color: var(--jp-layout-color2);\n}\n\n.context-button:disabled:hover {\n background-color: var(--jp-layout-color2);\n}"],"sourceRoot":""}]);
|
|
14685
|
+
}`, "",{"version":3,"sources":["webpack://./style/ChatInput.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;EACE,gBAAgB;EAChB,SAAS;EACT,cAAc;EACd,gBAAgB;EAChB,2DAA2D;EAC3D;;;iCAG+B;EAC/B,WAAW;EACX,mBAAmB;EACnB,iDAAiD;AACnD;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,oCAAoC;EACpC,sBAAsB;AACxB;;AAEA;EACE,kBAAkB;EAClB,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,aAAa;EACb,gBAAgB;EAChB,sBAAsB;EACtB,yBAAyB;EACzB,2DAA2D;EAC3D,eAAe;EACf,gBAAgB;EAChB,qCAAqC;EACrC,gBAAgB;EAChB,iDAAiD;AACnD;;AAEA;EACE,aAAa;AACf;;AAEA;EACE,2BAA2B;EAC3B;;;iCAG+B;AACjC;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,+BAA+B;EAC/B,2BAA2B;AAC7B;;AAEA;EACE,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,gBAAgB;EAChB,eAAe;EACf,yCAAyC;EACzC,eAAe;EACf,oCAAoC;EACpC,sCAAsC;AACxC;;AAEA;EACE,yCAAyC;AAC3C;;AAEA,0BAA0B;AAC1B;EACE,YAAY;EACZ,mBAAmB;EACnB,yCAAyC;AAC3C;;AAEA;EACE,YAAY;EACZ,mBAAmB;EACnB,yCAAyC;AAC3C;;AAEA;EACE,yCAAyC;AAC3C","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.chat-input-container {\n position: sticky;\n bottom: 0;\n margin: 10px 0;\n margin-top: auto;\n background-color: var(--chat-user-message-background-color);\n box-shadow: \n 0 4px 12px rgba(0, 0, 0, 0.08),\n 0 2px 4px rgba(0, 0, 0, 0.06),\n 0 0 0 1px rgba(0, 0, 0, 0.02);\n width: 100%;\n border-radius: 12px;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.chat-input-container.editing {\n margin-top: 0;\n}\n\n.chat-input-container.drag-over {\n border: 2px dashed var(--purple-500);\n transform: scale(1.02);\n}\n\n.chat-input-text-area-container {\n position: relative;\n height: min-content;\n}\n\n.chat-input {\n outline: none;\n border: none;\n resize: none;\n width: 100%;\n padding: 10px;\n overflow-y: auto;\n box-sizing: border-box;\n flex-shrink: 0 !important;\n background-color: var(--chat-user-message-background-color);\n font-size: 12px;\n font-weight: 400;\n font-family: var(--jp-ui-font-family);\n line-height: 1.2;\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.active-cell-preview-container {\n padding: 10px;\n}\n\n.chat-input-container:focus-within {\n transform: translateY(-1px);\n box-shadow: \n 0 2px 8px rgba(0, 0, 0, 0.12),\n 0 8px 16px rgba(0, 0, 0, 0.08),\n 0 0 0 1px rgba(0, 0, 0, 0.04);\n}\n\n.chat-input:focus {\n color: var(--jp-ui-font-color1);\n}\n\n.chat-input::placeholder {\n color: var(--jp-ui-font-color2);\n transition: color 0.2s ease;\n}\n\n.chat-input:focus::placeholder {\n color: var(--jp-ui-font-color3);\n}\n\n.context-button {\n display: flex;\n align-items: center;\n background-color: var(--jp-layout-color2);\n border: 1px solid var(--jp-border-color1);\n border-radius: 3px;\n padding: 4px 8px;\n font-size: 12px;\n height: var(--chat-context-button-height);\n cursor: pointer;\n color: var(--jp-content-font-color1);\n transition: background-color 0.2s ease;\n}\n\n.context-button:hover {\n background-color: var(--jp-layout-color3);\n}\n\n/* Disabled state styles */\n.chat-input:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n background-color: var(--jp-layout-color2);\n}\n\n.context-button:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n background-color: var(--jp-layout-color2);\n}\n\n.context-button:disabled:hover {\n background-color: var(--jp-layout-color2);\n}"],"sourceRoot":""}]);
|
|
14033
14686
|
// Exports
|
|
14034
14687
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
14035
14688
|
|
|
@@ -15479,7 +16132,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
15479
16132
|
}
|
|
15480
16133
|
|
|
15481
16134
|
.file-list input[type="checkbox"],
|
|
15482
|
-
.select-all input[type="checkbox"]{
|
|
16135
|
+
.files-selector-select-all input[type="checkbox"]{
|
|
15483
16136
|
transform: scale(1.3);
|
|
15484
16137
|
margin-right: 6px;
|
|
15485
16138
|
accent-color: var(--purple-500);
|
|
@@ -15549,7 +16202,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
15549
16202
|
.files-selector-select-all {
|
|
15550
16203
|
margin-bottom: 8px;
|
|
15551
16204
|
}
|
|
15552
|
-
`, "",{"version":3,"sources":["webpack://./style/FilesSelector.css"],"names":[],"mappings":"AAAA;;;EAGE;;;AAGF;EACE,gBAAgB;EAChB,eAAe;EACf,SAAS;AACX;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;EAChB,aAAa;EACb,yBAAyB;AAC3B;;AAEA;EACE,eAAe;EACf,8CAA8C;EAC9C,mCAAmC;EACnC,uBAAuB;EACvB,6BAA6B;EAC7B,2BAA2B;EAC3B,4BAA4B;EAC5B,sBAAsB;EACtB,0BAA0B;EAC1B,iCAAiC;AACnC;;AAEA;EACE,8CAA8C;AAChD;;AAEA;;EAEE,qBAAqB;EACrB,iBAAiB;EACjB,+BAA+B;AACjC;;AAEA;EACE,WAAW;EACX,iBAAiB;EACjB,sBAAsB;AACxB;;AAEA;EACE,gBAAgB;EAChB,aAAa;EACb,mBAAmB;EACnB,QAAQ;AACV;;AAEA,iBAAiB;AACjB;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,QAAQ;EACR,kBAAkB;AACpB;;AAEA;EACE,SAAS;EACT,iBAAiB;AACnB;;;AAGA;EACE,iBAAiB;EACjB,WAAW;EACX,SAAS;EACT,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA,+BAA+B;AAC/B;EACE,aAAa;EACb,mBAAmB;EACnB,QAAQ;AACV;;AAEA,yBAAyB;AACzB;EACE,iBAAiB;EACjB,gBAAgB;EAChB,eAAe;AACjB;;AAEA,oBAAoB;AACpB;EACE,gBAAgB;EAChB,eAAe;EACf,SAAS;AACX;;AAEA,uBAAuB;AACvB;EACE,kBAAkB;AACpB","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n\n.file-list {\n list-style: none;\n padding-left: 0;\n margin: 0;\n}\n\n.file-list li {\n margin-bottom: 6px;\n}\n\n.modal-footer {\n margin-top: 16px;\n display: flex;\n justify-content: flex-end;\n}\n\n.files-selector-submit-button {\n margin-top: 8px;\n background-color: var(--purple-400) !important;\n color: var(--purple-700) !important;\n border: none !important;\n border-radius: 4px !important;\n font-weight: 500 !important;\n padding: 8px 16px !important;\n width: 100% !important;\n max-width: 100% !important;\n box-sizing: border-box !important;\n}\n\n.files-selector-submit-button:hover {\n background-color: var(--purple-500) !important;\n}\n\n.file-list input[type=\"checkbox\"],\n.select-all input[type=\"checkbox\"]{\n transform: scale(1.3);\n margin-right: 6px;\n accent-color: var(--purple-500);\n}\n\n.file-list svg {\n color: grey;\n margin-right: 4px;\n vertical-align: middle;\n}\n\n.select-all label {\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n/* Modal header */\n.modal-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 1px;\n}\n\n.modal-title {\n margin: 0;\n font-size: 1.2rem;\n}\n\n\n.modal-subtext {\n font-size: 0.7rem;\n color: #555;\n margin: 0;\n font-style: italic;\n}\n\n.modal-subheader{\n margin-bottom: 7px;\n}\n\n/* Checkbox label for spacing */\n.checkbox-label {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n/* Scrollable file list */\n.file-list-scrollable {\n max-height: 300px;\n overflow-y: auto;\n margin-top: 8px;\n}\n\n/* File list items */\n.file-list {\n list-style: none;\n padding-left: 0;\n margin: 0;\n}\n\n/* Select all section */\n.files-selector-select-all {\n margin-bottom: 8px;\n}\n"],"sourceRoot":""}]);
|
|
16205
|
+
`, "",{"version":3,"sources":["webpack://./style/FilesSelector.css"],"names":[],"mappings":"AAAA;;;EAGE;;;AAGF;EACE,gBAAgB;EAChB,eAAe;EACf,SAAS;AACX;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,gBAAgB;EAChB,aAAa;EACb,yBAAyB;AAC3B;;AAEA;EACE,eAAe;EACf,8CAA8C;EAC9C,mCAAmC;EACnC,uBAAuB;EACvB,6BAA6B;EAC7B,2BAA2B;EAC3B,4BAA4B;EAC5B,sBAAsB;EACtB,0BAA0B;EAC1B,iCAAiC;AACnC;;AAEA;EACE,8CAA8C;AAChD;;AAEA;;EAEE,qBAAqB;EACrB,iBAAiB;EACjB,+BAA+B;AACjC;;AAEA;EACE,WAAW;EACX,iBAAiB;EACjB,sBAAsB;AACxB;;AAEA;EACE,gBAAgB;EAChB,aAAa;EACb,mBAAmB;EACnB,QAAQ;AACV;;AAEA,iBAAiB;AACjB;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,QAAQ;EACR,kBAAkB;AACpB;;AAEA;EACE,SAAS;EACT,iBAAiB;AACnB;;;AAGA;EACE,iBAAiB;EACjB,WAAW;EACX,SAAS;EACT,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA,+BAA+B;AAC/B;EACE,aAAa;EACb,mBAAmB;EACnB,QAAQ;AACV;;AAEA,yBAAyB;AACzB;EACE,iBAAiB;EACjB,gBAAgB;EAChB,eAAe;AACjB;;AAEA,oBAAoB;AACpB;EACE,gBAAgB;EAChB,eAAe;EACf,SAAS;AACX;;AAEA,uBAAuB;AACvB;EACE,kBAAkB;AACpB","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n\n.file-list {\n list-style: none;\n padding-left: 0;\n margin: 0;\n}\n\n.file-list li {\n margin-bottom: 6px;\n}\n\n.modal-footer {\n margin-top: 16px;\n display: flex;\n justify-content: flex-end;\n}\n\n.files-selector-submit-button {\n margin-top: 8px;\n background-color: var(--purple-400) !important;\n color: var(--purple-700) !important;\n border: none !important;\n border-radius: 4px !important;\n font-weight: 500 !important;\n padding: 8px 16px !important;\n width: 100% !important;\n max-width: 100% !important;\n box-sizing: border-box !important;\n}\n\n.files-selector-submit-button:hover {\n background-color: var(--purple-500) !important;\n}\n\n.file-list input[type=\"checkbox\"],\n.files-selector-select-all input[type=\"checkbox\"]{\n transform: scale(1.3);\n margin-right: 6px;\n accent-color: var(--purple-500);\n}\n\n.file-list svg {\n color: grey;\n margin-right: 4px;\n vertical-align: middle;\n}\n\n.select-all label {\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n/* Modal header */\n.modal-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n margin-bottom: 1px;\n}\n\n.modal-title {\n margin: 0;\n font-size: 1.2rem;\n}\n\n\n.modal-subtext {\n font-size: 0.7rem;\n color: #555;\n margin: 0;\n font-style: italic;\n}\n\n.modal-subheader{\n margin-bottom: 7px;\n}\n\n/* Checkbox label for spacing */\n.checkbox-label {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n/* Scrollable file list */\n.file-list-scrollable {\n max-height: 300px;\n overflow-y: auto;\n margin-top: 8px;\n}\n\n/* File list items */\n.file-list {\n list-style: none;\n padding-left: 0;\n margin: 0;\n}\n\n/* Select all section */\n.files-selector-select-all {\n margin-bottom: 8px;\n}\n"],"sourceRoot":""}]);
|
|
15553
16206
|
// Exports
|
|
15554
16207
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
15555
16208
|
|
|
@@ -16942,6 +17595,74 @@ a {
|
|
|
16942
17595
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
16943
17596
|
|
|
16944
17597
|
|
|
17598
|
+
/***/ }),
|
|
17599
|
+
|
|
17600
|
+
/***/ "./node_modules/css-loader/dist/cjs.js!./style/ShimmerWrapper.css":
|
|
17601
|
+
/*!************************************************************************!*\
|
|
17602
|
+
!*** ./node_modules/css-loader/dist/cjs.js!./style/ShimmerWrapper.css ***!
|
|
17603
|
+
\************************************************************************/
|
|
17604
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
17605
|
+
|
|
17606
|
+
__webpack_require__.r(__webpack_exports__);
|
|
17607
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
17608
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
17609
|
+
/* harmony export */ });
|
|
17610
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
|
|
17611
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
17612
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
|
|
17613
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
17614
|
+
// Imports
|
|
17615
|
+
|
|
17616
|
+
|
|
17617
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
17618
|
+
// Module
|
|
17619
|
+
___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
17620
|
+
* Copyright (c) Saga Inc.
|
|
17621
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
17622
|
+
*/
|
|
17623
|
+
|
|
17624
|
+
/* Shimmer skeleton effect for loading states */
|
|
17625
|
+
.shimmer-wrapper {
|
|
17626
|
+
position: relative;
|
|
17627
|
+
overflow: hidden;
|
|
17628
|
+
}
|
|
17629
|
+
|
|
17630
|
+
.shimmer-wrapper::before {
|
|
17631
|
+
content: '';
|
|
17632
|
+
position: absolute;
|
|
17633
|
+
top: 0;
|
|
17634
|
+
left: -100%;
|
|
17635
|
+
width: 100%;
|
|
17636
|
+
height: 100%;
|
|
17637
|
+
background: linear-gradient(
|
|
17638
|
+
90deg,
|
|
17639
|
+
transparent,
|
|
17640
|
+
var(--chat-background-color),
|
|
17641
|
+
transparent
|
|
17642
|
+
);
|
|
17643
|
+
animation: shimmer 1.5s ease-in-out infinite;
|
|
17644
|
+
z-index: 10;
|
|
17645
|
+
pointer-events: none;
|
|
17646
|
+
}
|
|
17647
|
+
|
|
17648
|
+
.shimmer-wrapper > * {
|
|
17649
|
+
position: relative;
|
|
17650
|
+
z-index: 1;
|
|
17651
|
+
}
|
|
17652
|
+
|
|
17653
|
+
@keyframes shimmer {
|
|
17654
|
+
0% {
|
|
17655
|
+
left: -100%;
|
|
17656
|
+
}
|
|
17657
|
+
100% {
|
|
17658
|
+
left: 100%;
|
|
17659
|
+
}
|
|
17660
|
+
}
|
|
17661
|
+
`, "",{"version":3,"sources":["webpack://./style/ShimmerWrapper.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF,+CAA+C;AAC/C;IACI,kBAAkB;IAClB,gBAAgB;AACpB;;AAEA;IACI,WAAW;IACX,kBAAkB;IAClB,MAAM;IACN,WAAW;IACX,WAAW;IACX,YAAY;IACZ;;;;;KAKC;IACD,4CAA4C;IAC5C,WAAW;IACX,oBAAoB;AACxB;;AAEA;IACI,kBAAkB;IAClB,UAAU;AACd;;AAEA;IACI;QACI,WAAW;IACf;IACA;QACI,UAAU;IACd;AACJ","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n/* Shimmer skeleton effect for loading states */\n.shimmer-wrapper {\n position: relative;\n overflow: hidden;\n}\n\n.shimmer-wrapper::before {\n content: '';\n position: absolute;\n top: 0;\n left: -100%;\n width: 100%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n transparent,\n var(--chat-background-color),\n transparent\n );\n animation: shimmer 1.5s ease-in-out infinite;\n z-index: 10;\n pointer-events: none;\n}\n\n.shimmer-wrapper > * {\n position: relative;\n z-index: 1;\n}\n\n@keyframes shimmer {\n 0% {\n left: -100%;\n }\n 100% {\n left: 100%;\n }\n}\n"],"sourceRoot":""}]);
|
|
17662
|
+
// Exports
|
|
17663
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
17664
|
+
|
|
17665
|
+
|
|
16945
17666
|
/***/ }),
|
|
16946
17667
|
|
|
16947
17668
|
/***/ "./node_modules/css-loader/dist/cjs.js!./style/SignUpForm.css":
|
|
@@ -17102,6 +17823,118 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
17102
17823
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
17103
17824
|
|
|
17104
17825
|
|
|
17826
|
+
/***/ }),
|
|
17827
|
+
|
|
17828
|
+
/***/ "./node_modules/css-loader/dist/cjs.js!./style/SubscriptionPage.css":
|
|
17829
|
+
/*!**************************************************************************!*\
|
|
17830
|
+
!*** ./node_modules/css-loader/dist/cjs.js!./style/SubscriptionPage.css ***!
|
|
17831
|
+
\**************************************************************************/
|
|
17832
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
17833
|
+
|
|
17834
|
+
__webpack_require__.r(__webpack_exports__);
|
|
17835
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
17836
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
17837
|
+
/* harmony export */ });
|
|
17838
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
|
|
17839
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
17840
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
|
|
17841
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
17842
|
+
// Imports
|
|
17843
|
+
|
|
17844
|
+
|
|
17845
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
17846
|
+
// Module
|
|
17847
|
+
___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
17848
|
+
* Copyright (c) Saga Inc.
|
|
17849
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
17850
|
+
*/
|
|
17851
|
+
|
|
17852
|
+
/* Subscription Page Styles */
|
|
17853
|
+
|
|
17854
|
+
.subscription-page-card {
|
|
17855
|
+
background: var(--jp-layout-color1);
|
|
17856
|
+
border: 1px solid var(--jp-border-color2);
|
|
17857
|
+
border-radius: 8px;
|
|
17858
|
+
padding: 24px;
|
|
17859
|
+
margin-bottom: 20px;
|
|
17860
|
+
}
|
|
17861
|
+
|
|
17862
|
+
.subscription-page-card-content {
|
|
17863
|
+
margin-bottom: 20px;
|
|
17864
|
+
}
|
|
17865
|
+
|
|
17866
|
+
.subscription-page-section-title {
|
|
17867
|
+
margin: 0 0 16px 0;
|
|
17868
|
+
font-size: 16px;
|
|
17869
|
+
font-weight: 600;
|
|
17870
|
+
}
|
|
17871
|
+
|
|
17872
|
+
.subscription-page-usage-stats {
|
|
17873
|
+
display: flex;
|
|
17874
|
+
align-items: center;
|
|
17875
|
+
gap: 12px;
|
|
17876
|
+
margin-bottom: 16px;
|
|
17877
|
+
}
|
|
17878
|
+
|
|
17879
|
+
.subscription-page-usage-count {
|
|
17880
|
+
font-size: 32px;
|
|
17881
|
+
font-weight: 700;
|
|
17882
|
+
color: var(--purple-600);
|
|
17883
|
+
}
|
|
17884
|
+
|
|
17885
|
+
.subscription-page-usage-details {
|
|
17886
|
+
font-size: 14px;
|
|
17887
|
+
color: var(--jp-ui-font-color2);
|
|
17888
|
+
}
|
|
17889
|
+
|
|
17890
|
+
.subscription-page-progress-bar {
|
|
17891
|
+
width: 100%;
|
|
17892
|
+
height: 8px;
|
|
17893
|
+
background-color: var(--jp-layout-color2);
|
|
17894
|
+
border-radius: 4px;
|
|
17895
|
+
overflow: hidden;
|
|
17896
|
+
margin-bottom: 12px;
|
|
17897
|
+
}
|
|
17898
|
+
|
|
17899
|
+
.subscription-page-progress-fill {
|
|
17900
|
+
height: 100%;
|
|
17901
|
+
background-color: var(--purple-600);
|
|
17902
|
+
transition: width 0.3s ease;
|
|
17903
|
+
}
|
|
17904
|
+
|
|
17905
|
+
.subscription-page-status-message {
|
|
17906
|
+
margin: 0;
|
|
17907
|
+
font-size: 14px;
|
|
17908
|
+
font-weight: 500;
|
|
17909
|
+
color: var(--jp-ui-font-color1);
|
|
17910
|
+
}
|
|
17911
|
+
|
|
17912
|
+
.subscription-page-status-warning {
|
|
17913
|
+
font-size: 14px;
|
|
17914
|
+
color: var(--red-500);
|
|
17915
|
+
font-weight: 600;
|
|
17916
|
+
}
|
|
17917
|
+
|
|
17918
|
+
.subscription-page-button-container {
|
|
17919
|
+
display: flex;
|
|
17920
|
+
gap: 12px;
|
|
17921
|
+
}
|
|
17922
|
+
|
|
17923
|
+
.subscription-page-button-container form {
|
|
17924
|
+
flex: 1;
|
|
17925
|
+
margin: 0;
|
|
17926
|
+
}
|
|
17927
|
+
|
|
17928
|
+
.subscription-page-button {
|
|
17929
|
+
text-decoration: none;
|
|
17930
|
+
text-align: center;
|
|
17931
|
+
flex: 1;
|
|
17932
|
+
width: 100%;
|
|
17933
|
+
}`, "",{"version":3,"sources":["webpack://./style/SubscriptionPage.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF,6BAA6B;;AAE7B;IACI,mCAAmC;IACnC,yCAAyC;IACzC,kBAAkB;IAClB,aAAa;IACb,mBAAmB;AACvB;;AAEA;IACI,mBAAmB;AACvB;;AAEA;IACI,kBAAkB;IAClB,eAAe;IACf,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,SAAS;IACT,mBAAmB;AACvB;;AAEA;IACI,eAAe;IACf,gBAAgB;IAChB,wBAAwB;AAC5B;;AAEA;IACI,eAAe;IACf,+BAA+B;AACnC;;AAEA;IACI,WAAW;IACX,WAAW;IACX,yCAAyC;IACzC,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;AACvB;;AAEA;IACI,YAAY;IACZ,mCAAmC;IACnC,2BAA2B;AAC/B;;AAEA;IACI,SAAS;IACT,eAAe;IACf,gBAAgB;IAChB,+BAA+B;AACnC;;AAEA;IACI,eAAe;IACf,qBAAqB;IACrB,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,SAAS;AACb;;AAEA;IACI,OAAO;IACP,SAAS;AACb;;AAEA;IACI,qBAAqB;IACrB,kBAAkB;IAClB,OAAO;IACP,WAAW;AACf","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n/* Subscription Page Styles */\n\n.subscription-page-card {\n background: var(--jp-layout-color1);\n border: 1px solid var(--jp-border-color2);\n border-radius: 8px;\n padding: 24px;\n margin-bottom: 20px;\n}\n\n.subscription-page-card-content {\n margin-bottom: 20px;\n}\n\n.subscription-page-section-title {\n margin: 0 0 16px 0;\n font-size: 16px;\n font-weight: 600;\n}\n\n.subscription-page-usage-stats {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 16px;\n}\n\n.subscription-page-usage-count {\n font-size: 32px;\n font-weight: 700;\n color: var(--purple-600);\n}\n\n.subscription-page-usage-details {\n font-size: 14px;\n color: var(--jp-ui-font-color2);\n}\n\n.subscription-page-progress-bar {\n width: 100%;\n height: 8px;\n background-color: var(--jp-layout-color2);\n border-radius: 4px;\n overflow: hidden;\n margin-bottom: 12px;\n}\n\n.subscription-page-progress-fill {\n height: 100%;\n background-color: var(--purple-600);\n transition: width 0.3s ease;\n}\n\n.subscription-page-status-message {\n margin: 0;\n font-size: 14px;\n font-weight: 500;\n color: var(--jp-ui-font-color1);\n}\n\n.subscription-page-status-warning {\n font-size: 14px;\n color: var(--red-500);\n font-weight: 600;\n}\n\n.subscription-page-button-container {\n display: flex;\n gap: 12px;\n}\n\n.subscription-page-button-container form {\n flex: 1;\n margin: 0;\n}\n\n.subscription-page-button {\n text-decoration: none;\n text-align: center;\n flex: 1;\n width: 100%;\n}"],"sourceRoot":""}]);
|
|
17934
|
+
// Exports
|
|
17935
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
17936
|
+
|
|
17937
|
+
|
|
17105
17938
|
/***/ }),
|
|
17106
17939
|
|
|
17107
17940
|
/***/ "./node_modules/css-loader/dist/cjs.js!./style/TextAndIconButton.css":
|
|
@@ -17274,6 +18107,77 @@ ___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
|
17274
18107
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
17275
18108
|
|
|
17276
18109
|
|
|
18110
|
+
/***/ }),
|
|
18111
|
+
|
|
18112
|
+
/***/ "./node_modules/css-loader/dist/cjs.js!./style/UsageBadge.css":
|
|
18113
|
+
/*!********************************************************************!*\
|
|
18114
|
+
!*** ./node_modules/css-loader/dist/cjs.js!./style/UsageBadge.css ***!
|
|
18115
|
+
\********************************************************************/
|
|
18116
|
+
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
18117
|
+
|
|
18118
|
+
__webpack_require__.r(__webpack_exports__);
|
|
18119
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
18120
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
18121
|
+
/* harmony export */ });
|
|
18122
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
|
|
18123
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
18124
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
|
|
18125
|
+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
18126
|
+
// Imports
|
|
18127
|
+
|
|
18128
|
+
|
|
18129
|
+
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
18130
|
+
// Module
|
|
18131
|
+
___CSS_LOADER_EXPORT___.push([module.id, `/*
|
|
18132
|
+
* Copyright (c) Saga Inc.
|
|
18133
|
+
* Distributed under the terms of the GNU Affero General Public License v3.0 License.
|
|
18134
|
+
*/
|
|
18135
|
+
|
|
18136
|
+
.usage-badge {
|
|
18137
|
+
position: relative;
|
|
18138
|
+
display: inline-flex;
|
|
18139
|
+
align-items: center;
|
|
18140
|
+
gap: 6px;
|
|
18141
|
+
padding: 2px 8px 2px 4px;
|
|
18142
|
+
background-color: var(--jp-layout-color2);
|
|
18143
|
+
border-radius: 12px;
|
|
18144
|
+
cursor: pointer;
|
|
18145
|
+
transition: background-color 0.2s ease;
|
|
18146
|
+
margin-bottom: 4px;
|
|
18147
|
+
}
|
|
18148
|
+
|
|
18149
|
+
.usage-badge:hover {
|
|
18150
|
+
background-color: var(--jp-layout-color3);
|
|
18151
|
+
}
|
|
18152
|
+
|
|
18153
|
+
.usage-badge-svg {
|
|
18154
|
+
transform: rotate(-90deg);
|
|
18155
|
+
flex-shrink: 0;
|
|
18156
|
+
}
|
|
18157
|
+
|
|
18158
|
+
.usage-badge-text {
|
|
18159
|
+
font-size: 11px;
|
|
18160
|
+
color: var(--jp-ui-font-color2);
|
|
18161
|
+
white-space: nowrap;
|
|
18162
|
+
line-height: 1;
|
|
18163
|
+
}
|
|
18164
|
+
|
|
18165
|
+
.usage-badge-circle-background {
|
|
18166
|
+
fill: none;
|
|
18167
|
+
stroke: var(--jp-layout-color3);
|
|
18168
|
+
stroke-width: 3.5;
|
|
18169
|
+
}
|
|
18170
|
+
|
|
18171
|
+
.usage-badge-circle-progress {
|
|
18172
|
+
fill: none;
|
|
18173
|
+
stroke-width: 3.5;
|
|
18174
|
+
stroke-linecap: round;
|
|
18175
|
+
transition: stroke-dashoffset 0.5s ease;
|
|
18176
|
+
}`, "",{"version":3,"sources":["webpack://./style/UsageBadge.css"],"names":[],"mappings":"AAAA;;;EAGE;;AAEF;IACI,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;IACnB,QAAQ;IACR,wBAAwB;IACxB,yCAAyC;IACzC,mBAAmB;IACnB,eAAe;IACf,sCAAsC;IACtC,kBAAkB;AACtB;;AAEA;IACI,yCAAyC;AAC7C;;AAEA;IACI,yBAAyB;IACzB,cAAc;AAClB;;AAEA;IACI,eAAe;IACf,+BAA+B;IAC/B,mBAAmB;IACnB,cAAc;AAClB;;AAEA;IACI,UAAU;IACV,+BAA+B;IAC/B,iBAAiB;AACrB;;AAEA;IACI,UAAU;IACV,iBAAiB;IACjB,qBAAqB;IACrB,uCAAuC;AAC3C","sourcesContent":["/*\n * Copyright (c) Saga Inc.\n * Distributed under the terms of the GNU Affero General Public License v3.0 License.\n */\n\n.usage-badge {\n position: relative;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 2px 8px 2px 4px;\n background-color: var(--jp-layout-color2);\n border-radius: 12px;\n cursor: pointer;\n transition: background-color 0.2s ease;\n margin-bottom: 4px;\n}\n\n.usage-badge:hover {\n background-color: var(--jp-layout-color3);\n}\n\n.usage-badge-svg {\n transform: rotate(-90deg);\n flex-shrink: 0;\n}\n\n.usage-badge-text {\n font-size: 11px;\n color: var(--jp-ui-font-color2);\n white-space: nowrap;\n line-height: 1;\n}\n\n.usage-badge-circle-background {\n fill: none;\n stroke: var(--jp-layout-color3);\n stroke-width: 3.5;\n}\n\n.usage-badge-circle-progress {\n fill: none;\n stroke-width: 3.5;\n stroke-linecap: round;\n transition: stroke-dashoffset 0.5s ease;\n}"],"sourceRoot":""}]);
|
|
18177
|
+
// Exports
|
|
18178
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
18179
|
+
|
|
18180
|
+
|
|
17277
18181
|
/***/ }),
|
|
17278
18182
|
|
|
17279
18183
|
/***/ "./node_modules/css-loader/dist/cjs.js!./style/button.css":
|
|
@@ -19143,6 +20047,60 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
|
|
|
19143
20047
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_SettingsWidget_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_SettingsWidget_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_SettingsWidget_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
|
|
19144
20048
|
|
|
19145
20049
|
|
|
20050
|
+
/***/ }),
|
|
20051
|
+
|
|
20052
|
+
/***/ "./style/ShimmerWrapper.css":
|
|
20053
|
+
/*!**********************************!*\
|
|
20054
|
+
!*** ./style/ShimmerWrapper.css ***!
|
|
20055
|
+
\**********************************/
|
|
20056
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
20057
|
+
|
|
20058
|
+
__webpack_require__.r(__webpack_exports__);
|
|
20059
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20060
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
20061
|
+
/* harmony export */ });
|
|
20062
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
|
|
20063
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
20064
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
|
|
20065
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
20066
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
|
|
20067
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
20068
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
|
|
20069
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
20070
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
|
|
20071
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
20072
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
|
|
20073
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
20074
|
+
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ShimmerWrapper_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./ShimmerWrapper.css */ "./node_modules/css-loader/dist/cjs.js!./style/ShimmerWrapper.css");
|
|
20075
|
+
|
|
20076
|
+
|
|
20077
|
+
|
|
20078
|
+
|
|
20079
|
+
|
|
20080
|
+
|
|
20081
|
+
|
|
20082
|
+
|
|
20083
|
+
|
|
20084
|
+
|
|
20085
|
+
|
|
20086
|
+
var options = {};
|
|
20087
|
+
|
|
20088
|
+
options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
|
|
20089
|
+
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
|
|
20090
|
+
|
|
20091
|
+
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
|
|
20092
|
+
|
|
20093
|
+
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
|
|
20094
|
+
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
|
|
20095
|
+
|
|
20096
|
+
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ShimmerWrapper_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);
|
|
20097
|
+
|
|
20098
|
+
|
|
20099
|
+
|
|
20100
|
+
|
|
20101
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ShimmerWrapper_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ShimmerWrapper_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ShimmerWrapper_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
|
|
20102
|
+
|
|
20103
|
+
|
|
19146
20104
|
/***/ }),
|
|
19147
20105
|
|
|
19148
20106
|
/***/ "./style/SignUpForm.css":
|
|
@@ -19251,6 +20209,60 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
|
|
|
19251
20209
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_StreamlitPreviewPlugin_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_StreamlitPreviewPlugin_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_StreamlitPreviewPlugin_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
|
|
19252
20210
|
|
|
19253
20211
|
|
|
20212
|
+
/***/ }),
|
|
20213
|
+
|
|
20214
|
+
/***/ "./style/SubscriptionPage.css":
|
|
20215
|
+
/*!************************************!*\
|
|
20216
|
+
!*** ./style/SubscriptionPage.css ***!
|
|
20217
|
+
\************************************/
|
|
20218
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
20219
|
+
|
|
20220
|
+
__webpack_require__.r(__webpack_exports__);
|
|
20221
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20222
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
20223
|
+
/* harmony export */ });
|
|
20224
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
|
|
20225
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
20226
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
|
|
20227
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
20228
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
|
|
20229
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
20230
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
|
|
20231
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
20232
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
|
|
20233
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
20234
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
|
|
20235
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
20236
|
+
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_SubscriptionPage_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./SubscriptionPage.css */ "./node_modules/css-loader/dist/cjs.js!./style/SubscriptionPage.css");
|
|
20237
|
+
|
|
20238
|
+
|
|
20239
|
+
|
|
20240
|
+
|
|
20241
|
+
|
|
20242
|
+
|
|
20243
|
+
|
|
20244
|
+
|
|
20245
|
+
|
|
20246
|
+
|
|
20247
|
+
|
|
20248
|
+
var options = {};
|
|
20249
|
+
|
|
20250
|
+
options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
|
|
20251
|
+
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
|
|
20252
|
+
|
|
20253
|
+
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
|
|
20254
|
+
|
|
20255
|
+
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
|
|
20256
|
+
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
|
|
20257
|
+
|
|
20258
|
+
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_SubscriptionPage_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);
|
|
20259
|
+
|
|
20260
|
+
|
|
20261
|
+
|
|
20262
|
+
|
|
20263
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_SubscriptionPage_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_SubscriptionPage_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_SubscriptionPage_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
|
|
20264
|
+
|
|
20265
|
+
|
|
19254
20266
|
/***/ }),
|
|
19255
20267
|
|
|
19256
20268
|
/***/ "./style/TextAndIconButton.css":
|
|
@@ -19413,6 +20425,60 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
|
|
|
19413
20425
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ToggleButton_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ToggleButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ToggleButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
|
|
19414
20426
|
|
|
19415
20427
|
|
|
20428
|
+
/***/ }),
|
|
20429
|
+
|
|
20430
|
+
/***/ "./style/UsageBadge.css":
|
|
20431
|
+
/*!******************************!*\
|
|
20432
|
+
!*** ./style/UsageBadge.css ***!
|
|
20433
|
+
\******************************/
|
|
20434
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
20435
|
+
|
|
20436
|
+
__webpack_require__.r(__webpack_exports__);
|
|
20437
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20438
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
20439
|
+
/* harmony export */ });
|
|
20440
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
|
|
20441
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
20442
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
|
|
20443
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
20444
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
|
|
20445
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
20446
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
|
|
20447
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
20448
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
|
|
20449
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
20450
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
|
|
20451
|
+
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
20452
|
+
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_UsageBadge_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./UsageBadge.css */ "./node_modules/css-loader/dist/cjs.js!./style/UsageBadge.css");
|
|
20453
|
+
|
|
20454
|
+
|
|
20455
|
+
|
|
20456
|
+
|
|
20457
|
+
|
|
20458
|
+
|
|
20459
|
+
|
|
20460
|
+
|
|
20461
|
+
|
|
20462
|
+
|
|
20463
|
+
|
|
20464
|
+
var options = {};
|
|
20465
|
+
|
|
20466
|
+
options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
|
|
20467
|
+
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
|
|
20468
|
+
|
|
20469
|
+
options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
|
|
20470
|
+
|
|
20471
|
+
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
|
|
20472
|
+
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
|
|
20473
|
+
|
|
20474
|
+
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_UsageBadge_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);
|
|
20475
|
+
|
|
20476
|
+
|
|
20477
|
+
|
|
20478
|
+
|
|
20479
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_UsageBadge_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_UsageBadge_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_UsageBadge_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
|
|
20480
|
+
|
|
20481
|
+
|
|
19416
20482
|
/***/ }),
|
|
19417
20483
|
|
|
19418
20484
|
/***/ "./style/button.css":
|
|
@@ -19470,4 +20536,4 @@ var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js
|
|
|
19470
20536
|
/***/ })
|
|
19471
20537
|
|
|
19472
20538
|
}]);
|
|
19473
|
-
//# sourceMappingURL=lib_index_js.
|
|
20539
|
+
//# sourceMappingURL=lib_index_js.5c7d84a45ddeb5704b61.js.map
|