@trops/dash-core 0.1.707 → 0.1.708

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -59148,6 +59148,35 @@ function useNarrow(ref, forced) {
59148
59148
  }, [ref, forced]);
59149
59149
  return typeof forced === "boolean" ? forced : narrow;
59150
59150
  }
59151
+
59152
+ /** The view's content width (px), or 0 until measured. */
59153
+ function useContentWidth(ref) {
59154
+ var _useState3 = React.useState(0),
59155
+ _useState4 = _slicedToArray(_useState3, 2),
59156
+ width = _useState4[0],
59157
+ setWidth = _useState4[1];
59158
+ React.useEffect(function () {
59159
+ var el = ref.current;
59160
+ if (!el || typeof ResizeObserver === "undefined") return undefined;
59161
+ var ro = new ResizeObserver(function (_ref3) {
59162
+ var _ref4 = _slicedToArray(_ref3, 1),
59163
+ entry = _ref4[0];
59164
+ setWidth(Math.round(entry.contentRect.width));
59165
+ });
59166
+ ro.observe(el);
59167
+ return function () {
59168
+ return ro.disconnect();
59169
+ };
59170
+ }, [ref]);
59171
+ return width;
59172
+ }
59173
+
59174
+ // The bot panel beside the diagram (TEAM-014): the user drags its edge.
59175
+ // Starts at half; the diagram keeps DIAGRAM_MIN, the panel PANEL_MIN.
59176
+ var PANEL_WIDTH_KEY = "dash:botsView:panelWidth";
59177
+ var PANEL_GAP = 16; // gap-4 between the diagram and the panel
59178
+ var PANEL_MIN = 360;
59179
+ var DIAGRAM_MIN = 320;
59151
59180
  var TABS = ["conversation", "activity", "settings"];
59152
59181
 
59153
59182
  // Diagram / List (TEAM-014), remembered per viewer. Storage can be blocked.
@@ -59166,21 +59195,21 @@ var writeMode = function writeMode(mode) {
59166
59195
  // Not remembered — fine.
59167
59196
  }
59168
59197
  };
59169
- var BotsView = function BotsView(_ref3) {
59170
- var workspace = _ref3.workspace,
59171
- _ref3$workspaces = _ref3.workspaces,
59172
- workspaces = _ref3$workspaces === void 0 ? [] : _ref3$workspaces,
59173
- team = _ref3.team,
59174
- narrow = _ref3.narrow,
59175
- _ref3$focus = _ref3.focus,
59176
- focus = _ref3$focus === void 0 ? null : _ref3$focus,
59177
- _ref3$onDirtyChange = _ref3.onDirtyChange,
59178
- onDirtyChange = _ref3$onDirtyChange === void 0 ? null : _ref3$onDirtyChange,
59179
- _ref3$onOpenSettings = _ref3.onOpenSettings,
59180
- onOpenSettings = _ref3$onOpenSettings === void 0 ? null : _ref3$onOpenSettings;
59181
- var _ref4 = React.useContext(DashReact.ThemeContext) || {},
59182
- _ref4$currentTheme = _ref4.currentTheme,
59183
- currentTheme = _ref4$currentTheme === void 0 ? {} : _ref4$currentTheme;
59198
+ var BotsView = function BotsView(_ref5) {
59199
+ var workspace = _ref5.workspace,
59200
+ _ref5$workspaces = _ref5.workspaces,
59201
+ workspaces = _ref5$workspaces === void 0 ? [] : _ref5$workspaces,
59202
+ team = _ref5.team,
59203
+ narrow = _ref5.narrow,
59204
+ _ref5$focus = _ref5.focus,
59205
+ focus = _ref5$focus === void 0 ? null : _ref5$focus,
59206
+ _ref5$onDirtyChange = _ref5.onDirtyChange,
59207
+ onDirtyChange = _ref5$onDirtyChange === void 0 ? null : _ref5$onDirtyChange,
59208
+ _ref5$onOpenSettings = _ref5.onOpenSettings,
59209
+ onOpenSettings = _ref5$onOpenSettings === void 0 ? null : _ref5$onOpenSettings;
59210
+ var _ref6 = React.useContext(DashReact.ThemeContext) || {},
59211
+ _ref6$currentTheme = _ref6.currentTheme,
59212
+ currentTheme = _ref6$currentTheme === void 0 ? {} : _ref6$currentTheme;
59184
59213
  var appContext = React.useContext(AppContext);
59185
59214
  var providers = (appContext === null || appContext === void 0 ? void 0 : appContext.providers) || {};
59186
59215
  var muted = currentTheme["text-neutral-medium"] || "text-gray-400";
@@ -59190,6 +59219,17 @@ var BotsView = function BotsView(_ref3) {
59190
59219
  var strong = currentTheme["text-neutral-light"] || "text-gray-200";
59191
59220
  var rootRef = React.useRef(null);
59192
59221
  var isNarrow = useNarrow(rootRef, narrow);
59222
+ var contentWidth = useContentWidth(rootRef);
59223
+ var panelRoom = Math.max(0, contentWidth - PANEL_GAP);
59224
+ var _useResizableWidth = DashReact.useResizableWidth({
59225
+ defaultWidth: Math.round(panelRoom / 2),
59226
+ min: PANEL_MIN,
59227
+ max: panelRoom - DIAGRAM_MIN,
59228
+ edge: "left",
59229
+ storageKey: PANEL_WIDTH_KEY
59230
+ }),
59231
+ panelWidth = _useResizableWidth.width,
59232
+ panelHandle = _useResizableWidth.handleProps;
59193
59233
  var lead = team ? team.lead : null;
59194
59234
  var members = team ? team.members : [];
59195
59235
  var all = [lead].concat(_toConsumableArray(members)).filter(Boolean);
@@ -59197,91 +59237,91 @@ var BotsView = function BotsView(_ref3) {
59197
59237
  var focusTarget = focus && all.some(function (b) {
59198
59238
  return b.id === focus.botId;
59199
59239
  }) ? focus : null;
59200
- var _useState3 = React.useState(function () {
59240
+ var _useState5 = React.useState(function () {
59201
59241
  return focusTarget && focusTarget.botId || lead && lead.id || members[0] && members[0].id || null;
59202
59242
  }),
59203
- _useState4 = _slicedToArray(_useState3, 2),
59204
- selectedId = _useState4[0],
59205
- setSelectedId = _useState4[1];
59206
- var _useState5 = React.useState(function () {
59243
+ _useState6 = _slicedToArray(_useState5, 2),
59244
+ selectedId = _useState6[0],
59245
+ setSelectedId = _useState6[1];
59246
+ var _useState7 = React.useState(function () {
59207
59247
  return focusTarget && TABS.includes(focusTarget.tab) ? focusTarget.tab : "conversation";
59208
59248
  }),
59209
- _useState6 = _slicedToArray(_useState5, 2),
59210
- tab = _useState6[0],
59211
- setTab = _useState6[1];
59212
- var _useState7 = React.useState(false),
59213
59249
  _useState8 = _slicedToArray(_useState7, 2),
59214
- menuOpen = _useState8[0],
59215
- setMenuOpen = _useState8[1];
59250
+ tab = _useState8[0],
59251
+ setTab = _useState8[1];
59252
+ var _useState9 = React.useState(false),
59253
+ _useState0 = _slicedToArray(_useState9, 2),
59254
+ menuOpen = _useState0[0],
59255
+ setMenuOpen = _useState0[1];
59216
59256
  // Team diagram (TEAM-014): the view, and whether the selected bot's
59217
59257
  // Conversation / Activity / Settings is open beside the diagram (else its
59218
59258
  // summary is). A focus request (Open in Bots view) opens it.
59219
- var _useState9 = React.useState(readMode),
59220
- _useState0 = _slicedToArray(_useState9, 2),
59221
- mode = _useState0[0],
59222
- setModeState = _useState0[1];
59223
- var _useState1 = React.useState(function () {
59259
+ var _useState1 = React.useState(readMode),
59260
+ _useState10 = _slicedToArray(_useState1, 2),
59261
+ mode = _useState10[0],
59262
+ setModeState = _useState10[1];
59263
+ var _useState11 = React.useState(function () {
59224
59264
  return !!focusTarget;
59225
59265
  }),
59226
- _useState10 = _slicedToArray(_useState1, 2),
59227
- detailOpen = _useState10[0],
59228
- setDetailOpen = _useState10[1];
59266
+ _useState12 = _slicedToArray(_useState11, 2),
59267
+ detailOpen = _useState12[0],
59268
+ setDetailOpen = _useState12[1];
59229
59269
  var setMode = function setMode(next) {
59230
59270
  setModeState(next);
59231
59271
  writeMode(next);
59232
59272
  };
59233
59273
  // Team export/import (TEAM-006/007, slice 1): the review being shown, and
59234
59274
  // the last outcome ({ text, details?: string[] }).
59235
- var _useState11 = React.useState(null),
59236
- _useState12 = _slicedToArray(_useState11, 2),
59237
- importPreview = _useState12[0],
59238
- setImportPreview = _useState12[1];
59239
- var _useState13 = React.useState(false),
59275
+ var _useState13 = React.useState(null),
59240
59276
  _useState14 = _slicedToArray(_useState13, 2),
59241
- installing = _useState14[0],
59242
- setInstalling = _useState14[1];
59243
- var _useState15 = React.useState(null),
59277
+ importPreview = _useState14[0],
59278
+ setImportPreview = _useState14[1];
59279
+ var _useState15 = React.useState(false),
59244
59280
  _useState16 = _slicedToArray(_useState15, 2),
59245
- importError = _useState16[0],
59246
- setImportError = _useState16[1];
59281
+ installing = _useState16[0],
59282
+ setInstalling = _useState16[1];
59247
59283
  var _useState17 = React.useState(null),
59248
59284
  _useState18 = _slicedToArray(_useState17, 2),
59249
- teamNote = _useState18[0],
59250
- setTeamNote = _useState18[1];
59251
- // Registry install (TEAM-007 slice 3b): the search panel is open.
59252
- var _useState19 = React.useState(false),
59285
+ importError = _useState18[0],
59286
+ setImportError = _useState18[1];
59287
+ var _useState19 = React.useState(null),
59253
59288
  _useState20 = _slicedToArray(_useState19, 2),
59254
- registryOpen = _useState20[0],
59255
- setRegistryOpen = _useState20[1];
59289
+ teamNote = _useState20[0],
59290
+ setTeamNote = _useState20[1];
59291
+ // Registry install (TEAM-007 slice 3b): the search panel is open.
59292
+ var _useState21 = React.useState(false),
59293
+ _useState22 = _slicedToArray(_useState21, 2),
59294
+ registryOpen = _useState22[0],
59295
+ setRegistryOpen = _useState22[1];
59256
59296
  // Registry publish (TEAM-006 slice 3a): what's being published and how
59257
59297
  // it went.
59258
59298
  var _useRegistryAuthGate = useRegistryAuthGate(),
59259
59299
  ensureAuthed = _useRegistryAuthGate.ensureAuthed,
59260
59300
  authGate = _useRegistryAuthGate.authGate;
59261
- var _useState21 = React.useState(null),
59262
- _useState22 = _slicedToArray(_useState21, 2),
59263
- publishTarget = _useState22[0],
59264
- setPublishTarget = _useState22[1];
59265
59301
  var _useState23 = React.useState(null),
59266
59302
  _useState24 = _slicedToArray(_useState23, 2),
59267
- publishPreview = _useState24[0],
59268
- setPublishPreview = _useState24[1];
59269
- var _useState25 = React.useState(false),
59303
+ publishTarget = _useState24[0],
59304
+ setPublishTarget = _useState24[1];
59305
+ var _useState25 = React.useState(null),
59270
59306
  _useState26 = _slicedToArray(_useState25, 2),
59271
- publishing = _useState26[0],
59272
- setPublishing = _useState26[1];
59273
- var _useState27 = React.useState(null),
59307
+ publishPreview = _useState26[0],
59308
+ setPublishPreview = _useState26[1];
59309
+ var _useState27 = React.useState(false),
59274
59310
  _useState28 = _slicedToArray(_useState27, 2),
59275
- publishResult = _useState28[0],
59276
- setPublishResult = _useState28[1];
59311
+ publishing = _useState28[0],
59312
+ setPublishing = _useState28[1];
59277
59313
  var _useState29 = React.useState(null),
59278
59314
  _useState30 = _slicedToArray(_useState29, 2),
59279
- publishError = _useState30[0],
59280
- setPublishError = _useState30[1];
59281
- var _useState31 = React.useState([]),
59315
+ publishResult = _useState30[0],
59316
+ setPublishResult = _useState30[1];
59317
+ var _useState31 = React.useState(null),
59282
59318
  _useState32 = _slicedToArray(_useState31, 2),
59283
- allBots = _useState32[0],
59284
- setAllBots = _useState32[1];
59319
+ publishError = _useState32[0],
59320
+ setPublishError = _useState32[1];
59321
+ var _useState33 = React.useState([]),
59322
+ _useState34 = _slicedToArray(_useState33, 2),
59323
+ allBots = _useState34[0],
59324
+ setAllBots = _useState34[1];
59285
59325
  var _nameOf = React.useMemo(function () {
59286
59326
  var names = new Map(allBots.map(function (b) {
59287
59327
  return [b.id, b.name];
@@ -59301,18 +59341,18 @@ var BotsView = function BotsView(_ref3) {
59301
59341
  if (onDirtyRef.current) onDirtyRef.current(d);
59302
59342
  }, []);
59303
59343
  // Bumped by "Discard changes" to remount the form from the saved bot.
59304
- var _useState33 = React.useState(0),
59305
- _useState34 = _slicedToArray(_useState33, 2),
59306
- formKey = _useState34[0],
59307
- setFormKey = _useState34[1];
59308
- var _useState35 = React.useState(null),
59344
+ var _useState35 = React.useState(0),
59309
59345
  _useState36 = _slicedToArray(_useState35, 2),
59310
- pendingNav = _useState36[0],
59311
- setPendingNav = _useState36[1];
59312
- var _useState37 = React.useState(false),
59346
+ formKey = _useState36[0],
59347
+ setFormKey = _useState36[1];
59348
+ var _useState37 = React.useState(null),
59313
59349
  _useState38 = _slicedToArray(_useState37, 2),
59314
- confirmDelete = _useState38[0],
59315
- setConfirmDelete = _useState38[1];
59350
+ pendingNav = _useState38[0],
59351
+ setPendingNav = _useState38[1];
59352
+ var _useState39 = React.useState(false),
59353
+ _useState40 = _slicedToArray(_useState39, 2),
59354
+ confirmDelete = _useState40[0],
59355
+ setConfirmDelete = _useState40[1];
59316
59356
 
59317
59357
  // All bots (any dashboard) — the form's "Another bot" event source and
59318
59358
  // names for trigger chains. Reloaded when bots change anywhere.
@@ -59333,10 +59373,10 @@ var BotsView = function BotsView(_ref3) {
59333
59373
 
59334
59374
  // Providers' types and tools (TEAM-014): which tool events a bot can
59335
59375
  // trigger others on, in the diagram's trigger popover.
59336
- var _useState39 = React.useState([]),
59337
- _useState40 = _slicedToArray(_useState39, 2),
59338
- toolSources = _useState40[0],
59339
- setToolSources = _useState40[1];
59376
+ var _useState41 = React.useState([]),
59377
+ _useState42 = _slicedToArray(_useState41, 2),
59378
+ toolSources = _useState42[0],
59379
+ setToolSources = _useState42[1];
59340
59380
  var workspaceId = workspace ? workspace.id : null;
59341
59381
  React.useEffect(function () {
59342
59382
  var bots = api$6();
@@ -59462,12 +59502,12 @@ var BotsView = function BotsView(_ref3) {
59462
59502
  }) || null;
59463
59503
  };
59464
59504
  var saveTrigger = /*#__PURE__*/function () {
59465
- var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref5) {
59505
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref7) {
59466
59506
  var mode, sourceId, targetId, oldEventType, event, label, note, bots, source, target, next;
59467
59507
  return _regeneratorRuntime.wrap(function (_context) {
59468
59508
  while (1) switch (_context.prev = _context.next) {
59469
59509
  case 0:
59470
- mode = _ref5.mode, sourceId = _ref5.sourceId, targetId = _ref5.targetId, oldEventType = _ref5.oldEventType, event = _ref5.event, label = _ref5.label, note = _ref5.note;
59510
+ mode = _ref7.mode, sourceId = _ref7.sourceId, targetId = _ref7.targetId, oldEventType = _ref7.oldEventType, event = _ref7.event, label = _ref7.label, note = _ref7.note;
59471
59511
  bots = api$6();
59472
59512
  source = findBot(sourceId);
59473
59513
  _context.next = 1;
@@ -59495,16 +59535,16 @@ var BotsView = function BotsView(_ref3) {
59495
59535
  }, _callee);
59496
59536
  }));
59497
59537
  return function saveTrigger(_x) {
59498
- return _ref6.apply(this, arguments);
59538
+ return _ref8.apply(this, arguments);
59499
59539
  };
59500
59540
  }();
59501
59541
  var removeTriggerFrom = /*#__PURE__*/function () {
59502
- var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref7) {
59542
+ var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref9) {
59503
59543
  var targetId, eventType, bots, target;
59504
59544
  return _regeneratorRuntime.wrap(function (_context2) {
59505
59545
  while (1) switch (_context2.prev = _context2.next) {
59506
59546
  case 0:
59507
- targetId = _ref7.targetId, eventType = _ref7.eventType;
59547
+ targetId = _ref9.targetId, eventType = _ref9.eventType;
59508
59548
  bots = api$6();
59509
59549
  _context2.next = 1;
59510
59550
  return latestBot(targetId);
@@ -59530,13 +59570,13 @@ var BotsView = function BotsView(_ref3) {
59530
59570
  }, _callee2);
59531
59571
  }));
59532
59572
  return function removeTriggerFrom(_x2) {
59533
- return _ref8.apply(this, arguments);
59573
+ return _ref0.apply(this, arguments);
59534
59574
  };
59535
59575
  }();
59536
59576
  // The bot as saved right now (the view's copy can be behind a save made
59537
59577
  // elsewhere); falls back to the view's copy.
59538
59578
  var latestBot = /*#__PURE__*/function () {
59539
- var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
59579
+ var _ref1 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id) {
59540
59580
  var bots, fresh;
59541
59581
  return _regeneratorRuntime.wrap(function (_context3) {
59542
59582
  while (1) switch (_context3.prev = _context3.next) {
@@ -59566,13 +59606,13 @@ var BotsView = function BotsView(_ref3) {
59566
59606
  }, _callee3);
59567
59607
  }));
59568
59608
  return function latestBot(_x3) {
59569
- return _ref9.apply(this, arguments);
59609
+ return _ref1.apply(this, arguments);
59570
59610
  };
59571
59611
  }();
59572
59612
  var status = selected && team ? team.statusOf(selected.id) : "Idle";
59573
59613
  var statusDot = DOT[status] || DOT.Idle;
59574
59614
  var togglePause = /*#__PURE__*/function () {
59575
- var _ref0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
59615
+ var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
59576
59616
  var bots;
59577
59617
  return _regeneratorRuntime.wrap(function (_context4) {
59578
59618
  while (1) switch (_context4.prev = _context4.next) {
@@ -59605,13 +59645,13 @@ var BotsView = function BotsView(_ref3) {
59605
59645
  }, _callee4);
59606
59646
  }));
59607
59647
  return function togglePause() {
59608
- return _ref0.apply(this, arguments);
59648
+ return _ref10.apply(this, arguments);
59609
59649
  };
59610
59650
  }();
59611
59651
 
59612
59652
  // Place a bot widget on this dashboard (TEAM-012) and say how it went.
59613
59653
  var showOnDashboard = /*#__PURE__*/function () {
59614
- var _ref1 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(kind) {
59654
+ var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(kind) {
59615
59655
  var bot,
59616
59656
  bots,
59617
59657
  r,
@@ -59655,11 +59695,11 @@ var BotsView = function BotsView(_ref3) {
59655
59695
  }, _callee5);
59656
59696
  }));
59657
59697
  return function showOnDashboard(_x4) {
59658
- return _ref1.apply(this, arguments);
59698
+ return _ref11.apply(this, arguments);
59659
59699
  };
59660
59700
  }();
59661
59701
  var saveBot = /*#__PURE__*/function () {
59662
- var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(definition) {
59702
+ var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(definition) {
59663
59703
  var opts,
59664
59704
  bots,
59665
59705
  saved,
@@ -59702,21 +59742,21 @@ var BotsView = function BotsView(_ref3) {
59702
59742
  }, _callee6);
59703
59743
  }));
59704
59744
  return function saveBot(_x5) {
59705
- return _ref10.apply(this, arguments);
59745
+ return _ref12.apply(this, arguments);
59706
59746
  };
59707
59747
  }();
59708
59748
 
59709
59749
  // Discarding a draft (row ×, the draft form's button, its banner) asks
59710
59750
  // first; the lead can draft it again if asked.
59711
- var _useState41 = React.useState(null),
59712
- _useState42 = _slicedToArray(_useState41, 2),
59713
- discardTarget = _useState42[0],
59714
- setDiscardTarget = _useState42[1];
59751
+ var _useState43 = React.useState(null),
59752
+ _useState44 = _slicedToArray(_useState43, 2),
59753
+ discardTarget = _useState44[0],
59754
+ setDiscardTarget = _useState44[1];
59715
59755
  var discardDraft = function discardDraft() {
59716
59756
  if (selectedDraft) setDiscardTarget(selectedDraft);
59717
59757
  };
59718
59758
  var confirmDiscardDraft = /*#__PURE__*/function () {
59719
- var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
59759
+ var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
59720
59760
  var d;
59721
59761
  return _regeneratorRuntime.wrap(function (_context7) {
59722
59762
  while (1) switch (_context7.prev = _context7.next) {
@@ -59745,7 +59785,7 @@ var BotsView = function BotsView(_ref3) {
59745
59785
  }, _callee7);
59746
59786
  }));
59747
59787
  return function confirmDiscardDraft() {
59748
- return _ref11.apply(this, arguments);
59788
+ return _ref13.apply(this, arguments);
59749
59789
  };
59750
59790
  }();
59751
59791
  var draftRow = function draftRow(d) {
@@ -59779,7 +59819,7 @@ var BotsView = function BotsView(_ref3) {
59779
59819
  }, id);
59780
59820
  };
59781
59821
  var removeFromTeam = /*#__PURE__*/function () {
59782
- var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
59822
+ var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
59783
59823
  var bots;
59784
59824
  return _regeneratorRuntime.wrap(function (_context8) {
59785
59825
  while (1) switch (_context8.prev = _context8.next) {
@@ -59805,11 +59845,11 @@ var BotsView = function BotsView(_ref3) {
59805
59845
  }, _callee8);
59806
59846
  }));
59807
59847
  return function removeFromTeam() {
59808
- return _ref12.apply(this, arguments);
59848
+ return _ref14.apply(this, arguments);
59809
59849
  };
59810
59850
  }();
59811
59851
  var deleteBot = /*#__PURE__*/function () {
59812
- var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
59852
+ var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
59813
59853
  var bots;
59814
59854
  return _regeneratorRuntime.wrap(function (_context9) {
59815
59855
  while (1) switch (_context9.prev = _context9.next) {
@@ -59834,14 +59874,14 @@ var BotsView = function BotsView(_ref3) {
59834
59874
  }, _callee9);
59835
59875
  }));
59836
59876
  return function deleteBot() {
59837
- return _ref13.apply(this, arguments);
59877
+ return _ref15.apply(this, arguments);
59838
59878
  };
59839
59879
  }();
59840
59880
 
59841
59881
  // ─── Team export/import (TEAM-006/007, slice 1) ───────────────────
59842
59882
 
59843
59883
  var exportTeam = /*#__PURE__*/function () {
59844
- var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0() {
59884
+ var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0() {
59845
59885
  var bots, r, file, _t2;
59846
59886
  return _regeneratorRuntime.wrap(function (_context0) {
59847
59887
  while (1) switch (_context0.prev = _context0.next) {
@@ -59884,7 +59924,7 @@ var BotsView = function BotsView(_ref3) {
59884
59924
  }, _callee0);
59885
59925
  }));
59886
59926
  return function exportTeam() {
59887
- return _ref14.apply(this, arguments);
59927
+ return _ref16.apply(this, arguments);
59888
59928
  };
59889
59929
  }();
59890
59930
  var importTeam = function importTeam() {
@@ -59949,7 +59989,7 @@ var BotsView = function BotsView(_ref3) {
59949
59989
  // A registry package was picked: download, verify and check it in the
59950
59990
  // main process, then review it like an imported file.
59951
59991
  var pickRegistryPackage = /*#__PURE__*/function () {
59952
- var _ref16 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(ref) {
59992
+ var _ref18 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(ref) {
59953
59993
  var bots, r, signedIn, _t4, _t5;
59954
59994
  return _regeneratorRuntime.wrap(function (_context10) {
59955
59995
  while (1) switch (_context10.prev = _context10.next) {
@@ -60020,11 +60060,11 @@ var BotsView = function BotsView(_ref3) {
60020
60060
  }, _callee10);
60021
60061
  }));
60022
60062
  return function pickRegistryPackage(_x6) {
60023
- return _ref16.apply(this, arguments);
60063
+ return _ref18.apply(this, arguments);
60024
60064
  };
60025
60065
  }();
60026
60066
  var installTeam = /*#__PURE__*/function () {
60027
- var _ref17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(choices) {
60067
+ var _ref19 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(choices) {
60028
60068
  var roles,
60029
60069
  bots,
60030
60070
  r,
@@ -60093,11 +60133,11 @@ var BotsView = function BotsView(_ref3) {
60093
60133
  }, _callee11, null, [[2,, 9, 10]]);
60094
60134
  }));
60095
60135
  return function installTeam(_x7) {
60096
- return _ref17.apply(this, arguments);
60136
+ return _ref19.apply(this, arguments);
60097
60137
  };
60098
60138
  }();
60099
60139
  var openPublish = /*#__PURE__*/function () {
60100
- var _ref18 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(kind) {
60140
+ var _ref20 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(kind) {
60101
60141
  var bots, signedIn, target, preview, _t8;
60102
60142
  return _regeneratorRuntime.wrap(function (_context12) {
60103
60143
  while (1) switch (_context12.prev = _context12.next) {
@@ -60161,11 +60201,11 @@ var BotsView = function BotsView(_ref3) {
60161
60201
  }, _callee12);
60162
60202
  }));
60163
60203
  return function openPublish(_x8) {
60164
- return _ref18.apply(this, arguments);
60204
+ return _ref20.apply(this, arguments);
60165
60205
  };
60166
60206
  }();
60167
60207
  var doPublish = /*#__PURE__*/function () {
60168
- var _ref19 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(meta) {
60208
+ var _ref21 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(meta) {
60169
60209
  var bots, r, _t9;
60170
60210
  return _regeneratorRuntime.wrap(function (_context13) {
60171
60211
  while (1) switch (_context13.prev = _context13.next) {
@@ -60210,7 +60250,7 @@ var BotsView = function BotsView(_ref3) {
60210
60250
  }, _callee13, null, [[2,, 5, 6]]);
60211
60251
  }));
60212
60252
  return function doPublish(_x9) {
60213
- return _ref19.apply(this, arguments);
60253
+ return _ref21.apply(this, arguments);
60214
60254
  };
60215
60255
  }();
60216
60256
  var closePublish = function closePublish() {
@@ -60264,7 +60304,7 @@ var BotsView = function BotsView(_ref3) {
60264
60304
  }) : null]
60265
60305
  });
60266
60306
  var turnOffLead = /*#__PURE__*/function () {
60267
- var _ref20 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
60307
+ var _ref22 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
60268
60308
  var bots;
60269
60309
  return _regeneratorRuntime.wrap(function (_context14) {
60270
60310
  while (1) switch (_context14.prev = _context14.next) {
@@ -60288,11 +60328,11 @@ var BotsView = function BotsView(_ref3) {
60288
60328
  }, _callee14);
60289
60329
  }));
60290
60330
  return function turnOffLead() {
60291
- return _ref20.apply(this, arguments);
60331
+ return _ref22.apply(this, arguments);
60292
60332
  };
60293
60333
  }();
60294
60334
  var turnOnLead = /*#__PURE__*/function () {
60295
- var _ref21 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
60335
+ var _ref23 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
60296
60336
  var bots;
60297
60337
  return _regeneratorRuntime.wrap(function (_context15) {
60298
60338
  while (1) switch (_context15.prev = _context15.next) {
@@ -60315,7 +60355,7 @@ var BotsView = function BotsView(_ref3) {
60315
60355
  }, _callee15);
60316
60356
  }));
60317
60357
  return function turnOnLead() {
60318
- return _ref21.apply(this, arguments);
60358
+ return _ref23.apply(this, arguments);
60319
60359
  };
60320
60360
  }();
60321
60361
  var row = function row(b) {
@@ -60478,6 +60518,9 @@ var BotsView = function BotsView(_ref3) {
60478
60518
  // The diagram with the summary / bot detail beside it (wide windows only;
60479
60519
  // narrow windows keep the bot picker).
60480
60520
  var sideBySide = diagramMode && !isNarrow;
60521
+ // Its width is the user's once the view has been measured and has room
60522
+ // for both minimums.
60523
+ var resizable = sideBySide && panelRoom >= PANEL_MIN + DIAGRAM_MIN;
60481
60524
  var picker = /*#__PURE__*/jsxRuntime.jsx("div", {
60482
60525
  className: "flex flex-row items-end gap-2",
60483
60526
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -60542,163 +60585,179 @@ var BotsView = function BotsView(_ref3) {
60542
60585
  },
60543
60586
  onRunNow: runNow
60544
60587
  })
60545
- }) : /*#__PURE__*/jsxRuntime.jsxs("section", {
60546
- "aria-label": "Selected bot",
60547
- className: "".concat(sideBySide ? "w-1/2 flex-shrink-0" : "flex-1", " min-w-0 min-h-0 flex flex-col rounded-xl border ").concat(hairline),
60548
- children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
60549
- className: "flex flex-row items-start justify-between gap-4 px-5 pt-4",
60588
+ }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
60589
+ children: [resizable ?
60590
+ /*#__PURE__*/
60591
+ // Sits in the gap: the negative margins keep the gap 16px.
60592
+ jsxRuntime.jsx("div", {
60593
+ className: "flex flex-row",
60594
+ style: {
60595
+ margin: "0 -12px"
60596
+ },
60597
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.ResizeHandle, _objectSpread$u(_objectSpread$u({}, panelHandle), {}, {
60598
+ ariaLabel: "Resize bot panel"
60599
+ }))
60600
+ }) : null, /*#__PURE__*/jsxRuntime.jsxs("section", {
60601
+ "aria-label": "Selected bot",
60602
+ className: "".concat(resizable ? "flex-shrink-0" : sideBySide ? "w-1/2 flex-shrink-0" : "flex-1", " min-w-0 min-h-0 flex flex-col rounded-xl border ").concat(hairline),
60603
+ style: resizable ? {
60604
+ width: panelWidth
60605
+ } : undefined,
60550
60606
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
60551
- className: "min-w-0",
60607
+ className: "flex flex-row items-start justify-between gap-4 px-5 pt-4",
60552
60608
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
60553
- className: "flex flex-row items-center gap-2",
60554
- children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
60555
- className: "text-lg font-semibold truncate",
60556
- children: selected ? selected.name : selectedDraft ? selectedDraft.definition.name : "New bot"
60557
- }), selected ? /*#__PURE__*/jsxRuntime.jsxs("span", {
60558
- className: "flex flex-row items-center gap-1.5 text-xs ".concat(muted),
60559
- children: [/*#__PURE__*/jsxRuntime.jsx("span", {
60560
- className: "h-2 w-2 rounded-full ".concat(statusDot)
60561
- }), status]
60609
+ className: "min-w-0",
60610
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
60611
+ className: "flex flex-row items-center gap-2",
60612
+ children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
60613
+ className: "text-lg font-semibold truncate",
60614
+ children: selected ? selected.name : selectedDraft ? selectedDraft.definition.name : "New bot"
60615
+ }), selected ? /*#__PURE__*/jsxRuntime.jsxs("span", {
60616
+ className: "flex flex-row items-center gap-1.5 text-xs ".concat(muted),
60617
+ children: [/*#__PURE__*/jsxRuntime.jsx("span", {
60618
+ className: "h-2 w-2 rounded-full ".concat(statusDot)
60619
+ }), status]
60620
+ }) : null]
60621
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
60622
+ className: "text-sm ".concat(muted),
60623
+ children: selected ? isLead ? "Answers questions about this team · costs nothing until asked" : [(selected.mcpServers || []).join(", "), triggerSummary(selected), selected.installedFrom ? "From ".concat(selected.installedFrom["package"], " v").concat(selected.installedFrom.version) : null].filter(Boolean).join(" · ") : "Joins the ".concat(workspace ? workspace.name : "dashboard", " team")
60624
+ })]
60625
+ }), selected ? /*#__PURE__*/jsxRuntime.jsxs("div", {
60626
+ className: "flex flex-row items-center gap-2 flex-shrink-0",
60627
+ children: [!isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
60628
+ title: "Run now",
60629
+ size: "sm",
60630
+ onClick: runNow
60631
+ }) : null, !isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60632
+ title: status === "Paused" ? "Resume" : "Pause",
60633
+ size: "sm",
60634
+ onClick: togglePause
60635
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60636
+ title: "\u22EF",
60637
+ size: "sm",
60638
+ ariaLabel: "More actions",
60639
+ onClick: function onClick() {
60640
+ return setMenuOpen(function (v) {
60641
+ return !v;
60642
+ });
60643
+ }
60644
+ }), sideBySide ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
60645
+ icon: "xmark",
60646
+ size: "sm",
60647
+ ariaLabel: "Back to summary",
60648
+ onClick: closeDetail
60562
60649
  }) : null]
60563
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
60564
- className: "text-sm ".concat(muted),
60565
- children: selected ? isLead ? "Answers questions about this team · costs nothing until asked" : [(selected.mcpServers || []).join(", "), triggerSummary(selected), selected.installedFrom ? "From ".concat(selected.installedFrom["package"], " v").concat(selected.installedFrom.version) : null].filter(Boolean).join(" · ") : "Joins the ".concat(workspace ? workspace.name : "dashboard", " team")
60566
- })]
60567
- }), selected ? /*#__PURE__*/jsxRuntime.jsxs("div", {
60568
- className: "flex flex-row items-center gap-2 flex-shrink-0",
60569
- children: [!isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
60570
- title: "Run now",
60571
- size: "sm",
60572
- onClick: runNow
60573
- }) : null, !isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60574
- title: status === "Paused" ? "Resume" : "Pause",
60575
- size: "sm",
60576
- onClick: togglePause
60577
- }) : null, /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60578
- title: "\u22EF",
60579
- size: "sm",
60580
- ariaLabel: "More actions",
60581
- onClick: function onClick() {
60582
- return setMenuOpen(function (v) {
60583
- return !v;
60584
- });
60585
- }
60586
- }), sideBySide ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
60650
+ }) : sideBySide ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
60587
60651
  icon: "xmark",
60588
60652
  size: "sm",
60589
- ariaLabel: "Back to summary",
60653
+ ariaLabel: "Close",
60590
60654
  onClick: closeDetail
60591
60655
  }) : null]
60592
- }) : sideBySide ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
60593
- icon: "xmark",
60594
- size: "sm",
60595
- ariaLabel: "Close",
60596
- onClick: closeDetail
60597
- }) : null]
60598
- }), menuOpen && selected ? /*#__PURE__*/jsxRuntime.jsx("div", {
60599
- className: "flex flex-row justify-end gap-2 px-5 pt-2",
60600
- children: isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60601
- title: "Turn off lead",
60602
- size: "xs",
60603
- onClick: turnOffLead
60604
- }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
60605
- children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60606
- title: "Show on dashboard",
60656
+ }), menuOpen && selected ? /*#__PURE__*/jsxRuntime.jsx("div", {
60657
+ className: "flex flex-row justify-end gap-2 px-5 pt-2",
60658
+ children: isLead ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60659
+ title: "Turn off lead",
60607
60660
  size: "xs",
60608
- onClick: function onClick() {
60609
- return showOnDashboard("results", selected);
60610
- }
60611
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60612
- title: "Publish bot\u2026",
60613
- size: "xs",
60614
- onClick: function onClick() {
60615
- return openPublish("bot");
60616
- }
60617
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60618
- title: "Remove from team",
60619
- size: "xs",
60620
- onClick: removeFromTeam
60621
- }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60622
- title: "Delete",
60623
- size: "xs",
60624
- onClick: function onClick() {
60625
- return setConfirmDelete(true);
60626
- }
60627
- })]
60628
- })
60629
- }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
60630
- role: "tablist",
60631
- className: "flex flex-row gap-6 px-5 mt-3 border-b ".concat(hairline),
60632
- children: tabs.map(function (_ref22) {
60633
- var _ref23 = _slicedToArray(_ref22, 2),
60634
- id = _ref23[0],
60635
- label = _ref23[1];
60636
- return /*#__PURE__*/jsxRuntime.jsx("button", {
60637
- type: "button",
60638
- role: "tab",
60639
- "aria-selected": tab === id,
60640
- onClick: function onClick() {
60641
- return switchTab(id);
60642
- },
60643
- className: "py-2.5 text-sm font-medium -mb-px border-b-2 ".concat(tab === id ? "border-indigo-400" : "border-transparent ".concat(muted)),
60644
- children: label
60645
- }, id);
60646
- })
60647
- }), /*#__PURE__*/jsxRuntime.jsxs("div", {
60648
- className: "flex-1 min-h-0 flex flex-col",
60649
- children: [tab === "conversation" && selected ? /*#__PURE__*/jsxRuntime.jsx(BotChat, {
60650
- bot: selected,
60651
- isLead: isLead,
60652
- approvals: team ? team.approvalsFor(selected.id) : [],
60653
- onApprove: team ? team.approve : null,
60654
- nameOf: _nameOf,
60655
- onOpenSettings: onOpenSettings,
60656
- onChangeModel: function onChangeModel() {
60657
- return switchTab("settings");
60658
- },
60659
- drafts: isLead ? drafts : undefined,
60660
- onOpenDraft: isLead ? function (id) {
60661
- return select(DRAFT_PREFIX + id);
60662
- } : null
60663
- }) : null, tab === "activity" && selected ? /*#__PURE__*/jsxRuntime.jsx(BotRunHistory, {
60664
- bot: selected,
60665
- isLead: isLead,
60666
- nameOf: _nameOf,
60667
- onOpenSettings: onOpenSettings,
60668
- onChangeModel: function onChangeModel() {
60669
- return switchTab("settings");
60670
- }
60671
- }) : null, tab === "settings" ? /*#__PURE__*/jsxRuntime.jsx("div", {
60661
+ onClick: turnOffLead
60662
+ }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
60663
+ children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60664
+ title: "Show on dashboard",
60665
+ size: "xs",
60666
+ onClick: function onClick() {
60667
+ return showOnDashboard("results", selected);
60668
+ }
60669
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60670
+ title: "Publish bot\u2026",
60671
+ size: "xs",
60672
+ onClick: function onClick() {
60673
+ return openPublish("bot");
60674
+ }
60675
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60676
+ title: "Remove from team",
60677
+ size: "xs",
60678
+ onClick: removeFromTeam
60679
+ }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
60680
+ title: "Delete",
60681
+ size: "xs",
60682
+ onClick: function onClick() {
60683
+ return setConfirmDelete(true);
60684
+ }
60685
+ })]
60686
+ })
60687
+ }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
60688
+ role: "tablist",
60689
+ className: "flex flex-row gap-6 px-5 mt-3 border-b ".concat(hairline),
60690
+ children: tabs.map(function (_ref24) {
60691
+ var _ref25 = _slicedToArray(_ref24, 2),
60692
+ id = _ref25[0],
60693
+ label = _ref25[1];
60694
+ return /*#__PURE__*/jsxRuntime.jsx("button", {
60695
+ type: "button",
60696
+ role: "tab",
60697
+ "aria-selected": tab === id,
60698
+ onClick: function onClick() {
60699
+ return switchTab(id);
60700
+ },
60701
+ className: "py-2.5 text-sm font-medium -mb-px border-b-2 ".concat(tab === id ? "border-indigo-400" : "border-transparent ".concat(muted)),
60702
+ children: label
60703
+ }, id);
60704
+ })
60705
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
60672
60706
  className: "flex-1 min-h-0 flex flex-col",
60673
- children: /*#__PURE__*/jsxRuntime.jsx(BotDetail
60674
- // The lead's banner scrolls with the form (not pinned).
60675
- , {
60676
- header: selectedDraft ? /*#__PURE__*/jsxRuntime.jsx(DraftBanner, {
60677
- draft: selectedDraft,
60678
- onDiscard: discardDraft,
60679
- onOpenSettings: onOpenSettings
60680
- }) : null,
60681
- bot: selected || selectedDraft && selectedDraft.definition || null,
60682
- isCreating: !selected,
60683
- suggestions: selectedDraft ? selectedDraft.suggestions : null,
60684
- gaps: selectedDraft ? selectedDraft.gaps : null,
60685
- defaultWorkspaceId: workspace ? workspace.id : null,
60686
- providers: providers,
60687
- workspaces: workspaces,
60688
- getWidgetConfig: getWidgetConfig$4,
60689
- bots: allBots,
60690
- onSave: saveBot,
60691
- canShowOnDashboard: !!workspace,
60692
- onDirtyChange: setDirty,
60693
- onDiscardDraft: selectedDraft ? discardDraft : null,
60694
- onDiscard: function onDiscard() {
60695
- setDirty(false);
60696
- setFormKey(function (k) {
60697
- return k + 1;
60698
- });
60707
+ children: [tab === "conversation" && selected ? /*#__PURE__*/jsxRuntime.jsx(BotChat, {
60708
+ bot: selected,
60709
+ isLead: isLead,
60710
+ approvals: team ? team.approvalsFor(selected.id) : [],
60711
+ onApprove: team ? team.approve : null,
60712
+ nameOf: _nameOf,
60713
+ onOpenSettings: onOpenSettings,
60714
+ onChangeModel: function onChangeModel() {
60715
+ return switchTab("settings");
60716
+ },
60717
+ drafts: isLead ? drafts : undefined,
60718
+ onOpenDraft: isLead ? function (id) {
60719
+ return select(DRAFT_PREFIX + id);
60720
+ } : null
60721
+ }) : null, tab === "activity" && selected ? /*#__PURE__*/jsxRuntime.jsx(BotRunHistory, {
60722
+ bot: selected,
60723
+ isLead: isLead,
60724
+ nameOf: _nameOf,
60725
+ onOpenSettings: onOpenSettings,
60726
+ onChangeModel: function onChangeModel() {
60727
+ return switchTab("settings");
60699
60728
  }
60700
- }, "".concat(selected ? selected.id : selectedId || NEW_BOT, "-").concat(formKey))
60701
- }) : null]
60729
+ }) : null, tab === "settings" ? /*#__PURE__*/jsxRuntime.jsx("div", {
60730
+ className: "flex-1 min-h-0 flex flex-col",
60731
+ children: /*#__PURE__*/jsxRuntime.jsx(BotDetail
60732
+ // The lead's banner scrolls with the form (not pinned).
60733
+ , {
60734
+ header: selectedDraft ? /*#__PURE__*/jsxRuntime.jsx(DraftBanner, {
60735
+ draft: selectedDraft,
60736
+ onDiscard: discardDraft,
60737
+ onOpenSettings: onOpenSettings
60738
+ }) : null,
60739
+ bot: selected || selectedDraft && selectedDraft.definition || null,
60740
+ isCreating: !selected,
60741
+ suggestions: selectedDraft ? selectedDraft.suggestions : null,
60742
+ gaps: selectedDraft ? selectedDraft.gaps : null,
60743
+ defaultWorkspaceId: workspace ? workspace.id : null,
60744
+ providers: providers,
60745
+ workspaces: workspaces,
60746
+ getWidgetConfig: getWidgetConfig$4,
60747
+ bots: allBots,
60748
+ onSave: saveBot,
60749
+ canShowOnDashboard: !!workspace,
60750
+ onDirtyChange: setDirty,
60751
+ onDiscardDraft: selectedDraft ? discardDraft : null,
60752
+ onDiscard: function onDiscard() {
60753
+ setDirty(false);
60754
+ setFormKey(function (k) {
60755
+ return k + 1;
60756
+ });
60757
+ }
60758
+ }, "".concat(selected ? selected.id : selectedId || NEW_BOT, "-").concat(formKey))
60759
+ }) : null]
60760
+ })]
60702
60761
  })]
60703
60762
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.ConfirmationModal, {
60704
60763
  isOpen: !!pendingNav,