@sourcegraph/cody-web 0.38.0 → 0.40.0

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
@@ -3,8 +3,8 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  var _a;
5
5
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
6
- import { dn as getDefaultExportFromCjs, aY as FILE_CONTEXT_MENTION_PROVIDER, aZ as SYMBOL_CONTEXT_MENTION_PROVIDER, b0 as REMOTE_REPOSITORY_PROVIDER_URI, b1 as REMOTE_FILE_PROVIDER_URI, b2 as REMOTE_DIRECTORY_PROVIDER_URI, b3 as WEB_PROVIDER_URI, b8 as RULES_PROVIDER_URI, T as displayPath, m as displayLineRange, Y as displayPathDirname, W as displayPathBasename, I as IGNORED_FILE_WARNING_LABEL, L as LARGE_FILE_WARNING_LABEL, dp as object, dq as literal, dr as string$2, V as displayPathWithLines, c as URI, ds as is$3, c5 as serializeContextItem, c3 as CONTEXT_ITEM_MENTION_NODE_TYPE, cb as contextItemMentionNodeDisplayText, c4 as TEMPLATE_INPUT_NODE_TYPE, aU as parseMentionQuery, N as NO_SYMBOL_MATCHES_HELP_LABEL, F as FILE_RANGE_TOOLTIP_LABEL, dt as Observable, cd as createExtensionAPI, bb as createMessageAPIForWebview, du as debounce$1, C as ContextItemSource, cu as memoizeLastValue, bW as toSerializedPromptEditorValue$1, dv as isEqual, aV as scanForMentionTriggerInUserTextInput, c9 as getMentionOperations, ct as combineLatest, dw as map$3, a0 as forceHydration, a1 as hydrateAfterPostMessage, ag as isDotCom, be as isWorkspaceInstance, au as isAuthError, av as isAvailabilityError, dx as isSourcegraphToken, dy as trace, dz as context$1, dA as SpanStatusCode, dm as commonjsGlobal, dB as svg, dC as html$2, dD as whitespace, dE as find, dF as stringify, dG as stringify$1, dH as ccount, bT as CodyIDE, dI as CodyTaskState, dJ as cryptoJsExports, a6 as GuardrailsCheckStatus, dK as LRUCache, a as isError, aq as RateLimitError, a2 as FeatureFlag, r as reformatBotMessageForChat, at as isAbortErrorOrSocketHangUp, M as ModelTag, dL as DeepCodyAgentID, bY as serializedPromptEditorStateFromChatMessage, bZ as contextItemsFromPromptEditorValue, b$ as filterContextItemsFromPromptEditorValue, dM as View, E as isMacOS, dN as ToolCodyModelName, g as CustomCommandType, c0 as textContentFromSerializedLexicalNode, ci as firstValueFrom, d0 as skipPendingOperation, bO as FAST_CHAT_INPUT_TOKEN_BUDGET, f as webviewOpenURIForContextItem, l as pluralize, dk as UIToolStatus, dO as getFileDiff, dP as diffWithLineNum, dl as UITerminalOutputType, dQ as isCodeSearchContextItem, dR as v4, dS as lodashExports, c6 as deserializeContextItem, d1 as firstResultFromOperation, dT as ChatHistoryType, dU as ACCOUNT_USAGE_URL, dV as CODY_DOC_QUICKSTART_URL, b as isDefined, dW as browser, bU as CodyAutoSuggestionMode, _ as setDisplayPathEnvInfo, k as isErrorLike, bE as PromptString, a4 as createGuardrailsImpl, U as Uri } from "./vscode-shim-CdmSM8Q0.mjs";
7
- import { bh, bg } from "./vscode-shim-CdmSM8Q0.mjs";
6
+ import { dn as getDefaultExportFromCjs, aY as FILE_CONTEXT_MENTION_PROVIDER, aZ as SYMBOL_CONTEXT_MENTION_PROVIDER, b0 as REMOTE_REPOSITORY_PROVIDER_URI, b1 as REMOTE_FILE_PROVIDER_URI, b2 as REMOTE_DIRECTORY_PROVIDER_URI, b3 as WEB_PROVIDER_URI, b8 as RULES_PROVIDER_URI, T as displayPath, m as displayLineRange, Y as displayPathDirname, W as displayPathBasename, I as IGNORED_FILE_WARNING_LABEL, L as LARGE_FILE_WARNING_LABEL, dp as object, dq as literal, dr as string$2, V as displayPathWithLines, c as URI, ds as is$3, c5 as serializeContextItem, c3 as CONTEXT_ITEM_MENTION_NODE_TYPE, cb as contextItemMentionNodeDisplayText, c4 as TEMPLATE_INPUT_NODE_TYPE, aU as parseMentionQuery, N as NO_SYMBOL_MATCHES_HELP_LABEL, F as FILE_RANGE_TOOLTIP_LABEL, dt as Observable, cd as createExtensionAPI, bb as createMessageAPIForWebview, du as debounce$1, C as ContextItemSource, cu as memoizeLastValue, bW as toSerializedPromptEditorValue$1, dv as isEqual, aV as scanForMentionTriggerInUserTextInput, c9 as getMentionOperations, ct as combineLatest, dw as map$3, a0 as forceHydration, a1 as hydrateAfterPostMessage, ag as isDotCom, be as isWorkspaceInstance, au as isAuthError, av as isAvailabilityError, dx as isSourcegraphToken, dy as trace, dz as context$1, dA as SpanStatusCode, dm as commonjsGlobal, dB as svg, dC as html$2, dD as whitespace, dE as find, dF as stringify, dG as stringify$1, dH as ccount, bT as CodyIDE, dI as CodyTaskState, dJ as cryptoJsExports, a6 as GuardrailsCheckStatus, dK as LRUCache, a as isError, aq as RateLimitError, a2 as FeatureFlag, r as reformatBotMessageForChat, at as isAbortErrorOrSocketHangUp, M as ModelTag, dL as DeepCodyAgentID, bY as serializedPromptEditorStateFromChatMessage, bZ as contextItemsFromPromptEditorValue, b$ as filterContextItemsFromPromptEditorValue, dM as View, E as isMacOS, dN as ToolCodyModelName, g as CustomCommandType, c0 as textContentFromSerializedLexicalNode, ci as firstValueFrom, d0 as skipPendingOperation, bO as FAST_CHAT_INPUT_TOKEN_BUDGET, f as webviewOpenURIForContextItem, l as pluralize, dk as UIToolStatus, dO as getFileDiff, dP as diffWithLineNum, dl as UITerminalOutputType, dQ as isCodeSearchContextItem, dR as v4, dS as lodashExports, c6 as deserializeContextItem, d1 as firstResultFromOperation, dT as ChatHistoryType, dU as ACCOUNT_USAGE_URL, dV as CODY_DOC_QUICKSTART_URL, b as isDefined, dW as browser, bU as CodyAutoSuggestionMode, _ as setDisplayPathEnvInfo, k as isErrorLike, bE as PromptString, a4 as createGuardrailsImpl, U as Uri } from "./vscode-shim-BM22pmQn.mjs";
7
+ import { bh, bg } from "./vscode-shim-BM22pmQn.mjs";
8
8
  import * as React$2 from "react";
9
9
  import React__default, { createContext, useContext, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, useEffect as useEffect$2, forwardRef, useState as useState$1, useCallback, useRef as useRef$1, Suspense, createElement, memo as memo$2, useImperativeHandle, Children, isValidElement, cloneElement, Fragment as Fragment$2, useReducer, useId as useId$2, useInsertionEffect as useInsertionEffect$1, Component } from "react";
10
10
  var classnames = { exports: {} };
@@ -11593,7 +11593,7 @@ const editor$4 = "_editor_s4gjm_1";
11593
11593
  const contentEditable = "_content-editable_s4gjm_6";
11594
11594
  const placeholder = "_placeholder_s4gjm_14";
11595
11595
  const themeParagraph = "_theme-paragraph_s4gjm_29";
11596
- const styles$w = {
11596
+ const styles$x = {
11597
11597
  editor: editor$4,
11598
11598
  contentEditable,
11599
11599
  placeholder,
@@ -12683,7 +12683,7 @@ const title = "_title_ql6r4_5";
12683
12683
  const description = "_description_ql6r4_5";
12684
12684
  const warning = "_warning_ql6r4_5";
12685
12685
  const row$1 = "_row_ql6r4_13";
12686
- const styles$v = {
12686
+ const styles$w = {
12687
12687
  title,
12688
12688
  description,
12689
12689
  warning,
@@ -12741,22 +12741,22 @@ const MentionMenuContextItemContent = ({ query, item: item2, badge: badge2 }) =>
12741
12741
  warning2 = "";
12742
12742
  }
12743
12743
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
12744
- /* @__PURE__ */ jsxs("div", { className: styles$v.row, children: [
12745
- Icon2 && /* @__PURE__ */ jsxs("div", { className: styles$v.row, title: isSymbol ? item2.kind : "", children: [
12744
+ /* @__PURE__ */ jsxs("div", { className: styles$w.row, children: [
12745
+ Icon2 && /* @__PURE__ */ jsxs("div", { className: styles$w.row, title: isSymbol ? item2.kind : "", children: [
12746
12746
  /* @__PURE__ */ jsx(Icon2, { size: 16, strokeWidth: 1.75 }),
12747
12747
  isSymbol ? item2.kind : ""
12748
12748
  ] }),
12749
- /* @__PURE__ */ jsx("span", { className: clsx$1(styles$v.title, warning2 && styles$v.titleWithWarning), title: title2, children: displayName }),
12750
- description2 && /* @__PURE__ */ jsx("span", { className: styles$v.description, title: description2, children: description2 }),
12749
+ /* @__PURE__ */ jsx("span", { className: clsx$1(styles$w.title, warning2 && styles$w.titleWithWarning), title: title2, children: displayName }),
12750
+ description2 && /* @__PURE__ */ jsx("span", { className: styles$w.description, title: description2, children: description2 }),
12751
12751
  badge2,
12752
12752
  isLink && /* @__PURE__ */ jsx(ExternalLink, { size: 16, strokeWidth: 1.25, style: { opacity: "0.5" } })
12753
12753
  ] }),
12754
- warning2 && /* @__PURE__ */ jsx("span", { className: styles$v.warning, children: warning2 })
12754
+ warning2 && /* @__PURE__ */ jsx("span", { className: styles$w.warning, children: warning2 })
12755
12755
  ] });
12756
12756
  };
12757
12757
  const MentionMenuProviderItemContent = ({ provider }) => {
12758
12758
  const Icon2 = iconForProvider[provider.id] ?? Database;
12759
- return /* @__PURE__ */ jsxs("div", { className: styles$v.row, title: provider.id, children: [
12759
+ return /* @__PURE__ */ jsxs("div", { className: styles$w.row, title: provider.id, children: [
12760
12760
  /* @__PURE__ */ jsx(Icon2, { size: 16, strokeWidth: 1.75 }),
12761
12761
  provider.title ?? provider.id,
12762
12762
  /* @__PURE__ */ jsx(ArrowRight, { size: 16, strokeWidth: 1.25, style: { opacity: "0.5" } })
@@ -12806,7 +12806,7 @@ const contextItemMentionNode = "_context-item-mention-node_1eamp_1";
12806
12806
  const icon$1 = "_icon_1eamp_14";
12807
12807
  const contextItemMentionChipNodeFocused = "_context-item-mention-chip-node--focused_1eamp_28";
12808
12808
  const isTooLargeOrIgnored$1 = "_is-too-large-or-ignored_1eamp_33";
12809
- const styles$u = {
12809
+ const styles$v = {
12810
12810
  contextItemMentionNode,
12811
12811
  icon: icon$1,
12812
12812
  contextItemMentionChipNodeFocused,
@@ -13083,7 +13083,7 @@ function tooltipForContextItem(item2) {
13083
13083
  }
13084
13084
  return void 0;
13085
13085
  }
13086
- const MENTION_CLASS_NAME = styles$u.contextItemMentionNode;
13086
+ const MENTION_CLASS_NAME = styles$v.contextItemMentionNode;
13087
13087
  function convertContextItemMentionElement(domNode) {
13088
13088
  const data = domNode.getAttribute(DOM_DATA_ATTR);
13089
13089
  if (data !== null) {
@@ -13175,8 +13175,8 @@ class ContextItemMentionNode extends gs {
13175
13175
  className: `${MENTION_NODE_CLASS_NAME} ${extraClassNamesForContextItem(
13176
13176
  this.contextItem
13177
13177
  )}`,
13178
- focusedClassName: styles$u.contextItemMentionChipNodeFocused,
13179
- iconClassName: styles$u.icon
13178
+ focusedClassName: styles$v.contextItemMentionChipNodeFocused,
13179
+ iconClassName: styles$v.icon
13180
13180
  }
13181
13181
  );
13182
13182
  }
@@ -13195,7 +13195,7 @@ function $createContextItemMentionNode(contextItem2, { isFromInitialContext } =
13195
13195
  function extraClassNamesForContextItem(contextItem2) {
13196
13196
  const classNames2 = [];
13197
13197
  if (contextItem2.isTooLarge || contextItem2.isIgnored) {
13198
- classNames2.push(styles$u.isTooLargeOrIgnored);
13198
+ classNames2.push(styles$v.isTooLargeOrIgnored);
13199
13199
  }
13200
13200
  return classNames2.join(" ");
13201
13201
  }
@@ -13266,7 +13266,7 @@ const TemplateInputComponent = ({ editor: editor2, nodeKey, node: node2, classNa
13266
13266
  };
13267
13267
  const templateInputNode = "_template-input-node_14yoh_1";
13268
13268
  const templateInputNodeFocused = "_template-input-node--focused_14yoh_16";
13269
- const styles$t = {
13269
+ const styles$u = {
13270
13270
  templateInputNode,
13271
13271
  templateInputNodeFocused
13272
13272
  };
@@ -13299,8 +13299,8 @@ class TemplateInputNode extends gs {
13299
13299
  editor: editor2,
13300
13300
  nodeKey: this.getKey(),
13301
13301
  node: this,
13302
- className: `${styles$t.templateInputNode}`,
13303
- focusedClassName: `${styles$t.templateInputNodeFocused}`
13302
+ className: `${styles$u.templateInputNode}`,
13303
+ focusedClassName: `${styles$u.templateInputNodeFocused}`
13304
13304
  }
13305
13305
  );
13306
13306
  }
@@ -13507,7 +13507,7 @@ function L({ options: e2, onQueryChange: n2, onSelectOption: o2, onOpen: r2, onC
13507
13507
  const popoverContainer = "_popover-container_11l09_1";
13508
13508
  const popoverDimensions$1 = "_popover-dimensions_11l09_15";
13509
13509
  const popover$1 = "_popover_11l09_1";
13510
- const styles$s = {
13510
+ const styles$t = {
13511
13511
  popoverContainer,
13512
13512
  popoverDimensions: popoverDimensions$1,
13513
13513
  popover: popover$1
@@ -13522,12 +13522,12 @@ function contextItemID(item2) {
13522
13522
  item2.range ? `${item2.range.start.line}:${item2.range.start.character}-${item2.range.end.line}:${item2.range.end.character}` : ""
13523
13523
  ]);
13524
13524
  }
13525
- const container$4 = "_container_fr158_1";
13525
+ const container$5 = "_container_fr158_1";
13526
13526
  const item$1 = "_item_fr158_8";
13527
13527
  const contextItem$1 = "_context-item_fr158_9";
13528
13528
  const experimental = "_experimental_fr158_17";
13529
- const styles$r = {
13530
- container: container$4,
13529
+ const styles$s = {
13530
+ container: container$5,
13531
13531
  item: item$1,
13532
13532
  contextItem: contextItem$1,
13533
13533
  experimental
@@ -13682,7 +13682,7 @@ const MentionMenu = ({
13682
13682
  {
13683
13683
  value: commandRowValue$1(provider),
13684
13684
  onSelect: onProviderSelect,
13685
- className: clsx$1(styles$r.item, COMMAND_ROW_CLASS_NAME),
13685
+ className: clsx$1(styles$s.item, COMMAND_ROW_CLASS_NAME),
13686
13686
  children: /* @__PURE__ */ jsx(MentionMenuProviderItemContent, { provider })
13687
13687
  },
13688
13688
  commandRowValue$1(provider)
@@ -13695,7 +13695,7 @@ const MentionMenu = ({
13695
13695
  shouldFilter: false,
13696
13696
  value: effectiveValueRow ? commandRowValue$1(effectiveValueRow) : void 0,
13697
13697
  onValueChange: setValue,
13698
- className: styles$r.container,
13698
+ className: styles$s.container,
13699
13699
  label: "@-mention context",
13700
13700
  ref,
13701
13701
  "data-testid": "mention-menu",
@@ -13710,8 +13710,8 @@ const MentionMenu = ({
13710
13710
  disabled: item2.isIgnored,
13711
13711
  onSelect: onCommandSelect,
13712
13712
  className: clsx$1(
13713
- styles$r.item,
13714
- styles$r.contextItem,
13713
+ styles$s.item,
13714
+ styles$s.contextItem,
13715
13715
  COMMAND_ROW_CLASS_NAME
13716
13716
  ),
13717
13717
  children: /* @__PURE__ */ jsx(
@@ -13794,7 +13794,7 @@ function getItemsHeading$1(parentItem, mentionQuery) {
13794
13794
  {
13795
13795
  className: clsx$1(
13796
13796
  "tw-text-xs tw-rounded tw-px-2 tw-text-foreground",
13797
- styles$r.experimental
13797
+ styles$s.experimental
13798
13798
  ),
13799
13799
  children: "Experimental"
13800
13800
  }
@@ -14008,7 +14008,7 @@ function createMentionMenuOption(item2) {
14008
14008
  function scanForMentionTriggerInLexicalInput(text2) {
14009
14009
  return scanForMentionTriggerInUserTextInput({ textBeforeCursor: text2, includeWhitespace: true });
14010
14010
  }
14011
- const MentionsPlugin = memo$2(({ contextWindowSizeInTokens, openExternalLink }) => {
14011
+ const MentionsPlugin = memo$2(({ contextWindowSizeInTokens, openExternalLink, mentionPortalContainer }) => {
14012
14012
  const [editor2] = u$5();
14013
14013
  const [tokenAdded, setTokenAdded] = useState$1(0);
14014
14014
  const { params, updateQuery, updateMentionMenuParams } = useMentionMenuParams();
@@ -14115,6 +14115,7 @@ const MentionsPlugin = memo$2(({ contextWindowSizeInTokens, openExternalLink })
14115
14115
  {
14116
14116
  onQueryChange: updateQuery,
14117
14117
  onSelectOption,
14118
+ parent: mentionPortalContainer ?? void 0,
14118
14119
  onClose,
14119
14120
  onOpen,
14120
14121
  triggerFn: scanForMentionTriggerInLexicalInput,
@@ -14133,7 +14134,7 @@ const MentionsPlugin = memo$2(({ contextWindowSizeInTokens, openExternalLink })
14133
14134
  // max height of the visible menu. This ensures that the menu does not
14134
14135
  // flip orientation as the user is typing if it suddenly has less
14135
14136
  // results. It also makes the positioning less glitchy.
14136
- /* @__PURE__ */ jsx("div", { className: styles$s.popoverContainer, children: /* @__PURE__ */ jsx("div", { "data-at-mention-menu": "", className: clsx$1(styles$s.popoverDimensions), children: /* @__PURE__ */ jsx("div", { className: styles$s.popover, children: /* @__PURE__ */ jsx(
14137
+ /* @__PURE__ */ jsx("div", { className: styles$t.popoverContainer, children: /* @__PURE__ */ jsx("div", { "data-at-mention-menu": "", className: clsx$1(styles$t.popoverDimensions), children: /* @__PURE__ */ jsx("div", { className: styles$t.popover, children: /* @__PURE__ */ jsx(
14137
14138
  MentionMenu,
14138
14139
  {
14139
14140
  params,
@@ -14256,12 +14257,13 @@ const BaseEditor = ({
14256
14257
  contentEditableClassName,
14257
14258
  "aria-label": ariaLabel,
14258
14259
  onEnterKey,
14259
- openExternalLink
14260
+ openExternalLink,
14261
+ mentionPortalContainer
14260
14262
  }) => {
14261
14263
  const initialConfig = useMemo$1(
14262
14264
  () => ({
14263
14265
  namespace: "BaseEditor",
14264
- theme: { paragraph: styles$w.themeParagraph },
14266
+ theme: { paragraph: styles$x.themeParagraph },
14265
14267
  onError: (error2) => console.error(error2),
14266
14268
  editorState: initialEditorState !== null ? JSON.stringify(initialEditorState) : void 0,
14267
14269
  editable: !disabled2,
@@ -14269,18 +14271,18 @@ const BaseEditor = ({
14269
14271
  }),
14270
14272
  []
14271
14273
  );
14272
- return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("div", { className: styles$w.editor, children: /* @__PURE__ */ jsxs(p$7, { initialConfig, children: [
14274
+ return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("div", { className: styles$x.editor, children: /* @__PURE__ */ jsxs(p$7, { initialConfig, children: [
14273
14275
  /* @__PURE__ */ jsx(
14274
14276
  h,
14275
14277
  {
14276
14278
  contentEditable: /* @__PURE__ */ jsx(
14277
14279
  x$4,
14278
14280
  {
14279
- className: clsx$1(styles$w.contentEditable, contentEditableClassName),
14281
+ className: clsx$1(styles$x.contentEditable, contentEditableClassName),
14280
14282
  ariaLabel
14281
14283
  }
14282
14284
  ),
14283
- placeholder: /* @__PURE__ */ jsx("div", { className: styles$w.placeholder, children: placeholder2 }),
14285
+ placeholder: /* @__PURE__ */ jsx("div", { "data-editor-placeholder": true, className: styles$x.placeholder, children: placeholder2 }),
14284
14286
  ErrorBoundary: a$2
14285
14287
  }
14286
14288
  ),
@@ -14296,6 +14298,7 @@ const BaseEditor = ({
14296
14298
  /* @__PURE__ */ jsx(
14297
14299
  MentionsPlugin,
14298
14300
  {
14301
+ mentionPortalContainer,
14299
14302
  contextWindowSizeInTokens,
14300
14303
  openExternalLink
14301
14304
  }
@@ -14309,7 +14312,7 @@ const BaseEditor = ({
14309
14312
  const editor$3 = "_editor_pujow_6";
14310
14313
  const seamless$1 = "_seamless_pujow_16";
14311
14314
  const disabled$2 = "_disabled_pujow_36";
14312
- const styles$q = {
14315
+ const styles$r = {
14313
14316
  editor: editor$3,
14314
14317
  seamless: seamless$1,
14315
14318
  disabled: disabled$2
@@ -14462,6 +14465,7 @@ const PromptEditor$1 = ({
14462
14465
  disabled: disabled2,
14463
14466
  editorRef: ref,
14464
14467
  onEnterKey,
14468
+ mentionPortalContainer,
14465
14469
  openExternalLink
14466
14470
  }) => {
14467
14471
  const editorRef = useRef$1(null);
@@ -14653,9 +14657,9 @@ const PromptEditor$1 = ({
14653
14657
  return /* @__PURE__ */ jsx(
14654
14658
  BaseEditor,
14655
14659
  {
14656
- className: clsx$1(styles$q.editor, editorClassName, {
14657
- [styles$q.disabled]: disabled2,
14658
- [styles$q.seamless]: seamless2
14660
+ className: clsx$1(styles$r.editor, editorClassName, {
14661
+ [styles$r.disabled]: disabled2,
14662
+ [styles$r.seamless]: seamless2
14659
14663
  }),
14660
14664
  contentEditableClassName,
14661
14665
  initialEditorState: (initialEditorState == null ? void 0 : initialEditorState.lexicalEditorState) ?? null,
@@ -14667,7 +14671,8 @@ const PromptEditor$1 = ({
14667
14671
  disabled: disabled2,
14668
14672
  "aria-label": "Chat message",
14669
14673
  onEnterKey,
14670
- openExternalLink
14674
+ openExternalLink,
14675
+ mentionPortalContainer
14671
14676
  }
14672
14677
  );
14673
14678
  };
@@ -14724,7 +14729,7 @@ const editor$2 = "_editor_xv2pe_6";
14724
14729
  const input = "_input_xv2pe_20";
14725
14730
  const seamless = "_seamless_xv2pe_24";
14726
14731
  const disabled$1 = "_disabled_xv2pe_44";
14727
- const styles$p = {
14732
+ const styles$q = {
14728
14733
  editor: editor$2,
14729
14734
  input,
14730
14735
  seamless,
@@ -30126,7 +30131,7 @@ new InputRule(/"$/, "”");
30126
30131
  new InputRule(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/, "‘");
30127
30132
  new InputRule(/'$/, "’");
30128
30133
  const atMention = "_atMention_1krkf_1";
30129
- const styles$o = {
30134
+ const styles$p = {
30130
30135
  atMention
30131
30136
  };
30132
30137
  const AT_MENTION_TRIGGER_CHARACTER = "@";
@@ -30156,7 +30161,7 @@ function createAtMentionPlugin() {
30156
30161
  // The current cursor position is after the '@' character
30157
30162
  position2 - 1,
30158
30163
  position2,
30159
- { class: styles$o.atMention },
30164
+ { class: styles$p.atMention },
30160
30165
  // This is necessary so that mapping changes will 'grow' the decoration, which
30161
30166
  // also acts as marker for the mention value
30162
30167
  { inclusiveEnd: true }
@@ -33712,7 +33717,7 @@ function useInteractions(propsList) {
33712
33717
  }
33713
33718
  const popoverDimensions = "_popover-dimensions_17xxk_1";
33714
33719
  const menu = "_menu_17xxk_5";
33715
- const styles$n = {
33720
+ const styles$o = {
33716
33721
  popoverDimensions,
33717
33722
  menu
33718
33723
  };
@@ -33799,7 +33804,7 @@ const MentionsMenu = ({
33799
33804
  container2.current = node2;
33800
33805
  refs.setFloating(node2);
33801
33806
  },
33802
- className: clsx$1(styles$n.menu, styles$n.popoverDimensions, menuClass),
33807
+ className: clsx$1(styles$o.menu, styles$o.popoverDimensions, menuClass),
33803
33808
  onMouseDown: handleMouseDown,
33804
33809
  onClick: handleClick,
33805
33810
  style: floatingStyles,
@@ -34043,7 +34048,7 @@ var m$1 = reactDomExports;
34043
34048
  const mention = "_mention_1l0qj_1";
34044
34049
  const mentionFocused = "_mention--focused_1l0qj_1";
34045
34050
  const isTooLargeOrIgnored = "_is-too-large-or-ignored_1l0qj_30";
34046
- const styles$m = {
34051
+ const styles$n = {
34047
34052
  mention,
34048
34053
  mentionFocused,
34049
34054
  isTooLargeOrIgnored
@@ -34055,8 +34060,8 @@ class MentionView {
34055
34060
  var _a2;
34056
34061
  const item2 = node2.attrs.item;
34057
34062
  this.dom = document.createElement("span");
34058
- this.dom.className = clsx$1(styles$m.mention, {
34059
- [styles$m.isTooLargeOrIngore]: item2.isTooLarge || item2.isIgnored
34063
+ this.dom.className = clsx$1(styles$n.mention, {
34064
+ [styles$n.isTooLargeOrIngore]: item2.isTooLarge || item2.isIgnored
34060
34065
  });
34061
34066
  this.root = createRoot(this.dom);
34062
34067
  this.root.render(/* @__PURE__ */ jsx(MentionChip, { item: item2, children: ((_a2 = node2.content.firstChild) == null ? void 0 : _a2.text) ?? "" }));
@@ -34065,10 +34070,10 @@ class MentionView {
34065
34070
  return true;
34066
34071
  }
34067
34072
  selectNode() {
34068
- this.dom.classList.add(styles$m.mentionFocused);
34073
+ this.dom.classList.add(styles$n.mentionFocused);
34069
34074
  }
34070
34075
  deselectNode() {
34071
- this.dom.classList.remove(styles$m.mentionFocused);
34076
+ this.dom.classList.remove(styles$n.mentionFocused);
34072
34077
  }
34073
34078
  destroy() {
34074
34079
  window.queueMicrotask(() => this.root.unmount());
@@ -34615,13 +34620,13 @@ const PromptEditor = ({
34615
34620
  return /* @__PURE__ */ jsxs(
34616
34621
  "div",
34617
34622
  {
34618
- className: clsx$1(styles$p.editor, editorClassName, {
34619
- [styles$p.disabled]: disabled2,
34620
- [styles$p.seamless]: seamless2
34623
+ className: clsx$1(styles$q.editor, editorClassName, {
34624
+ [styles$q.disabled]: disabled2,
34625
+ [styles$q.seamless]: seamless2
34621
34626
  }),
34622
34627
  "data-lexical-editor": "true",
34623
34628
  children: [
34624
- /* @__PURE__ */ jsx("div", { className: clsx$1(styles$p.input, contentEditableClassName), ref: api2.ref }),
34629
+ /* @__PURE__ */ jsx("div", { className: clsx$1(styles$q.input, contentEditableClassName), ref: api2.ref }),
34625
34630
  show && /* @__PURE__ */ jsx(
34626
34631
  MentionsMenu,
34627
34632
  {
@@ -34657,7 +34662,7 @@ function getItemsHeading(parentItem, query) {
34657
34662
  {
34658
34663
  className: clsx$1(
34659
34664
  "tw-text-xs tw-rounded tw-px-2 tw-text-foreground",
34660
- styles$p.experimental
34665
+ styles$q.experimental
34661
34666
  ),
34662
34667
  children: "Experimental"
34663
34668
  }
@@ -36447,6 +36452,14 @@ const $a093c7e1ec25a057$export$be92b6f5f03c0fe9 = $a093c7e1ec25a057$export$28c66
36447
36452
  const $a093c7e1ec25a057$export$41fb9f06171c75f4 = $a093c7e1ec25a057$export$8c610744efcf8a1d;
36448
36453
  const $a093c7e1ec25a057$export$602eac185826482c = $a093c7e1ec25a057$export$7b36b8f925ab7497;
36449
36454
  const $a093c7e1ec25a057$export$7c6e2c02157bb7d2 = $a093c7e1ec25a057$export$e9003e2be37ec060;
36455
+ const DEFAULT_UI_CONFIGURATION = {
36456
+ portalContainer: null
36457
+ };
36458
+ const UIConfigurationContext = createContext(DEFAULT_UI_CONFIGURATION);
36459
+ const UIConfigurationProvider = ({ value, children: children2 }) => /* @__PURE__ */ jsx(UIConfigurationContext.Provider, { value: value ?? DEFAULT_UI_CONFIGURATION, children: children2 });
36460
+ function useUIConfiguration() {
36461
+ return useContext(UIConfigurationContext);
36462
+ }
36450
36463
  const CLASS_PART_SEPARATOR = "-";
36451
36464
  function createClassUtils(config) {
36452
36465
  const classMap = createClassMap(config);
@@ -38935,8 +38948,8 @@ const TooltipProvider = $a093c7e1ec25a057$export$2881499e37b75b9a;
38935
38948
  const Tooltip = $a093c7e1ec25a057$export$be92b6f5f03c0fe9;
38936
38949
  const TooltipTrigger = $a093c7e1ec25a057$export$41fb9f06171c75f4;
38937
38950
  const TooltipContent = React$2.forwardRef(({ portal, className, sideOffset = 4, ...props }, ref) => {
38938
- const Portal = portal ? $a093c7e1ec25a057$export$602eac185826482c : React$2.Fragment;
38939
- return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
38951
+ const { portalContainer } = useUIConfiguration();
38952
+ const content2 = /* @__PURE__ */ jsx(
38940
38953
  $a093c7e1ec25a057$export$7c6e2c02157bb7d2,
38941
38954
  {
38942
38955
  ref,
@@ -38948,7 +38961,8 @@ const TooltipContent = React$2.forwardRef(({ portal, className, sideOffset = 4,
38948
38961
  ...props,
38949
38962
  children: props.children
38950
38963
  }
38951
- ) });
38964
+ );
38965
+ return portal ? /* @__PURE__ */ jsx($a093c7e1ec25a057$export$602eac185826482c, { container: portalContainer, children: content2 }) : content2;
38952
38966
  });
38953
38967
  TooltipContent.displayName = $a093c7e1ec25a057$export$7c6e2c02157bb7d2.displayName;
38954
38968
  function r$1(e2) {
@@ -40602,7 +40616,7 @@ const CommandInput = React$2.forwardRef(({ className, ...props }, ref) => /* @__
40602
40616
  {
40603
40617
  ref,
40604
40618
  className: cn(
40605
- "tw-flex tw-w-full tw-border-solid tw-border tw-border-transparent tw-text-md tw-leading-none placeholder:tw-text-muted-foreground disabled:tw-cursor-not-allowed disabled:tw-opacity-50 focus:tw-outline-none",
40619
+ "tw-flex tw-w-full tw-border-border tw-border-solid tw-border tw-text-md tw-leading-none placeholder:tw-text-muted-foreground disabled:tw-cursor-not-allowed disabled:tw-opacity-50 focus:tw-outline-none",
40606
40620
  className
40607
40621
  ),
40608
40622
  inputMode: "search",
@@ -40808,7 +40822,7 @@ const outerContainer = "_outer-container_eh1dt_1";
40808
40822
  const errorContainer = "_error-container_eh1dt_8";
40809
40823
  const error$1 = "_error_eh1dt_8";
40810
40824
  const closeBtn = "_close-btn_eh1dt_26";
40811
- const styles$l = {
40825
+ const styles$m = {
40812
40826
  outerContainer,
40813
40827
  errorContainer,
40814
40828
  error: error$1,
@@ -41696,7 +41710,7 @@ memo$2(
41696
41710
  }
41697
41711
  );
41698
41712
  const chatDisabled = "_chat-disabled_rc7no_1";
41699
- const styles$k = {
41713
+ const styles$l = {
41700
41714
  chatDisabled
41701
41715
  };
41702
41716
  class SpanManager {
@@ -71522,7 +71536,7 @@ const attributionIconFound = "_attribution-icon-found_36jko_137";
71522
71536
  const codiconLoading = "_codicon-loading_36jko_146";
71523
71537
  const spin$1 = "_spin_36jko_1";
71524
71538
  const content = "_content_36jko_162";
71525
- const styles$j = {
71539
+ const styles$k = {
71526
71540
  wrapper,
71527
71541
  buttonsContainer,
71528
71542
  leftInfo,
@@ -71548,7 +71562,7 @@ const styles$j = {
71548
71562
  content
71549
71563
  };
71550
71564
  const spin = "_spin_56lwz_7";
71551
- const styles$i = {
71565
+ const styles$j = {
71552
71566
  spin
71553
71567
  };
71554
71568
  const SaveCodeBlockIcon = (
@@ -71648,7 +71662,7 @@ const SyncSpinIcon = (
71648
71662
  /* @__PURE__ */ jsx(
71649
71663
  "svg",
71650
71664
  {
71651
- className: styles$i.spin,
71665
+ className: styles$j.spin,
71652
71666
  role: "img",
71653
71667
  width: "16",
71654
71668
  height: "16",
@@ -71714,7 +71728,7 @@ const RefreshIcon = /* @__PURE__ */ jsx("i", { className: "codicon codicon-refre
71714
71728
  const CopyButton = ({
71715
71729
  text: text2,
71716
71730
  onCopy,
71717
- className = styles$j.button,
71731
+ className = styles$k.button,
71718
71732
  showLabel = true,
71719
71733
  title: title2 = "Copy Code",
71720
71734
  label = "Copy",
@@ -71737,7 +71751,7 @@ const CopyButton = ({
71737
71751
  }, [onCopy, text2, label, customIcon]);
71738
71752
  return /* @__PURE__ */ jsxs(Tooltip, { children: [
71739
71753
  /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className, onClick: handleClick, children: [
71740
- /* @__PURE__ */ jsx("div", { className: styles$j.iconContainer, children: icon2 }),
71754
+ /* @__PURE__ */ jsx("div", { className: styles$k.iconContainer, children: icon2 }),
71741
71755
  showLabel && /* @__PURE__ */ jsx("span", { className: "tw-hidden xs:tw-block", children: currentLabel })
71742
71756
  ] }) }),
71743
71757
  /* @__PURE__ */ jsx(TooltipContent, { children: title2 })
@@ -71763,7 +71777,7 @@ function createEditButtonsBasic(preText, copyButtonOnSubmit, insertButtonOnSubmi
71763
71777
  }
71764
71778
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
71765
71779
  /* @__PURE__ */ jsx(CopyButton, { text: preText, onCopy: copyButtonOnSubmit }),
71766
- insertButtonOnSubmit && /* @__PURE__ */ jsxs("div", { className: styles$j.insertButtons, children: [
71780
+ insertButtonOnSubmit && /* @__PURE__ */ jsxs("div", { className: styles$k.insertButtons, children: [
71767
71781
  createInsertButton(preText, insertButtonOnSubmit),
71768
71782
  createSaveButton(preText, insertButtonOnSubmit)
71769
71783
  ] }),
@@ -71787,13 +71801,13 @@ function createAdditionsDeletions({
71787
71801
  const { additions, deletions } = getLineChanges(preText);
71788
71802
  const hasAdditionsDeletions = hasEditIntent && (additions >= 0 || deletions >= 0);
71789
71803
  return /* @__PURE__ */ jsx("div", { children: hasAdditionsDeletions && /* @__PURE__ */ jsxs(Fragment$1, { children: [
71790
- /* @__PURE__ */ jsxs("span", { className: clsx$1(styles$j.addition, styles$j.stats), children: [
71804
+ /* @__PURE__ */ jsxs("span", { className: clsx$1(styles$k.addition, styles$k.stats), children: [
71791
71805
  "+",
71792
71806
  additions
71793
71807
  ] }),
71794
71808
  ",",
71795
71809
  " ",
71796
- /* @__PURE__ */ jsxs("span", { className: styles$j.deletion, children: [
71810
+ /* @__PURE__ */ jsxs("span", { className: styles$k.deletion, children: [
71797
71811
  "-",
71798
71812
  deletions
71799
71813
  ] })
@@ -71833,10 +71847,10 @@ function createInsertButton(preText, insertButtonOnSubmit) {
71833
71847
  "button",
71834
71848
  {
71835
71849
  type: "button",
71836
- className: styles$j.button,
71850
+ className: styles$k.button,
71837
71851
  onClick: () => insertButtonOnSubmit == null ? void 0 : insertButtonOnSubmit(preText, false),
71838
71852
  children: [
71839
- /* @__PURE__ */ jsx("div", { className: styles$j.iconContainer, children: InsertCodeBlockIcon }),
71853
+ /* @__PURE__ */ jsx("div", { className: styles$k.iconContainer, children: InsertCodeBlockIcon }),
71840
71854
  /* @__PURE__ */ jsx("span", { className: "tw-hidden xs:tw-block", children: "Insert" })
71841
71855
  ]
71842
71856
  }
@@ -71850,10 +71864,10 @@ function createSaveButton(preText, insertButtonOnSubmit) {
71850
71864
  "button",
71851
71865
  {
71852
71866
  type: "button",
71853
- className: styles$j.button,
71867
+ className: styles$k.button,
71854
71868
  onClick: () => insertButtonOnSubmit == null ? void 0 : insertButtonOnSubmit(preText, true),
71855
71869
  children: [
71856
- /* @__PURE__ */ jsx("div", { className: styles$j.iconContainer, children: SaveCodeBlockIcon }),
71870
+ /* @__PURE__ */ jsx("div", { className: styles$k.iconContainer, children: SaveCodeBlockIcon }),
71857
71871
  /* @__PURE__ */ jsx("span", { className: "tw-hidden xs:tw-block", children: "Save" })
71858
71872
  ]
71859
71873
  }
@@ -71881,8 +71895,8 @@ function createApplyButton(onSmartApply, smartApplyState) {
71881
71895
  break;
71882
71896
  }
71883
71897
  return /* @__PURE__ */ jsxs(Tooltip, { children: [
71884
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$j.button, onClick, disabled: disabled2, children: [
71885
- /* @__PURE__ */ jsx("div", { className: styles$j.iconContainer, children: icon2 }),
71898
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$k.button, onClick, disabled: disabled2, children: [
71899
+ /* @__PURE__ */ jsx("div", { className: styles$k.iconContainer, children: icon2 }),
71886
71900
  /* @__PURE__ */ jsx("span", { className: "tw-hidden xs:tw-block", children: label })
71887
71901
  ] }) }),
71888
71902
  /* @__PURE__ */ jsx(TooltipContent, { children: "Apply in Editor" })
@@ -71890,12 +71904,12 @@ function createApplyButton(onSmartApply, smartApplyState) {
71890
71904
  }
71891
71905
  function createExecuteButton(onExecute) {
71892
71906
  return /* @__PURE__ */ jsxs(Tooltip, { children: [
71893
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$j.button, onClick: onExecute, children: [
71907
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$k.button, onClick: onExecute, children: [
71894
71908
  /* @__PURE__ */ jsx(
71895
71909
  "div",
71896
71910
  {
71897
71911
  className: clsx$1(
71898
- styles$j.iconContainer,
71912
+ styles$k.iconContainer,
71899
71913
  "tw-align-middle codicon codicon-terminal"
71900
71914
  )
71901
71915
  }
@@ -71907,8 +71921,8 @@ function createExecuteButton(onExecute) {
71907
71921
  }
71908
71922
  function createAcceptButton(id2, smartApply) {
71909
71923
  return /* @__PURE__ */ jsxs(Tooltip, { children: [
71910
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$j.button, onClick: () => smartApply.onAccept(id2), children: [
71911
- /* @__PURE__ */ jsx("div", { className: styles$j.iconContainer, children: TickIcon }),
71924
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$k.button, onClick: () => smartApply.onAccept(id2), children: [
71925
+ /* @__PURE__ */ jsx("div", { className: styles$k.iconContainer, children: TickIcon }),
71912
71926
  /* @__PURE__ */ jsx("span", { className: "tw-hidden xs:tw-block", children: "Accept" })
71913
71927
  ] }) }),
71914
71928
  /* @__PURE__ */ jsx(TooltipContent, { children: "Accept" })
@@ -71916,8 +71930,8 @@ function createAcceptButton(id2, smartApply) {
71916
71930
  }
71917
71931
  function createRejectButton(id2, smartApply) {
71918
71932
  return /* @__PURE__ */ jsxs(Tooltip, { children: [
71919
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$j.button, onClick: () => smartApply.onReject(id2), children: [
71920
- /* @__PURE__ */ jsx("div", { className: styles$j.iconContainer, children: CloseIcon }),
71933
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs("button", { type: "button", className: styles$k.button, onClick: () => smartApply.onReject(id2), children: [
71934
+ /* @__PURE__ */ jsx("div", { className: styles$k.iconContainer, children: CloseIcon }),
71921
71935
  /* @__PURE__ */ jsx("span", { className: "tw-hidden xs:tw-block", children: "Reject" })
71922
71936
  ] }) }),
71923
71937
  /* @__PURE__ */ jsx(TooltipContent, { children: "Reject" })
@@ -71947,7 +71961,7 @@ function createActionsDropdown(preText) {
71947
71961
  "button",
71948
71962
  {
71949
71963
  type: "button",
71950
- className: styles$j.button,
71964
+ className: styles$k.button,
71951
71965
  "aria-label": tooltip,
71952
71966
  "data-vscode-context": JSON.stringify(vscodeContext),
71953
71967
  onClick: handleClick,
@@ -71987,12 +72001,12 @@ function extractThinkContent(content2) {
71987
72001
  isThinking
71988
72002
  };
71989
72003
  }
71990
- const container$3 = "_container_zq4rk_15";
72004
+ const container$4 = "_container_zq4rk_15";
71991
72005
  const line$1 = "_line_zq4rk_22";
71992
72006
  const guardrailsChecking = "_guardrails-checking_zq4rk_30";
71993
72007
  const shimmer = "_shimmer_zq4rk_1";
71994
72008
  const modulestyles = {
71995
- container: container$3,
72009
+ container: container$4,
71996
72010
  line: line$1,
71997
72011
  guardrailsChecking,
71998
72012
  shimmer
@@ -72007,7 +72021,7 @@ const CodeBlockPlaceholder = ({
72007
72021
  "div",
72008
72022
  {
72009
72023
  className: clsx$1(
72010
- styles$j.content,
72024
+ styles$k.content,
72011
72025
  "tw-overflow-hidden tw-p-4",
72012
72026
  className,
72013
72027
  status2 === GuardrailsCheckStatus.GeneratingCode || status2 === GuardrailsCheckStatus.Checking ? modulestyles.guardrailsChecking : modulestyles.guardrailsChecked
@@ -72040,15 +72054,15 @@ const GuardrailsStatus = ({
72040
72054
  className
72041
72055
  );
72042
72056
  return /* @__PURE__ */ jsxs("div", { className: containerClasses, title: tooltip, "data-testid": "guardrails-status", children: [
72043
- status2 === GuardrailsCheckStatus.GeneratingCode && /* @__PURE__ */ jsxs("div", { className: styles$j.status, children: [
72044
- /* @__PURE__ */ jsx(Loader, { className: clsx$1("tw-animate-spin", styles$j.iconContainer), size: 14 }),
72045
- /* @__PURE__ */ jsx("span", { className: styles$j.fileNameContainer, children: "Generating code" })
72057
+ status2 === GuardrailsCheckStatus.GeneratingCode && /* @__PURE__ */ jsxs("div", { className: styles$k.status, children: [
72058
+ /* @__PURE__ */ jsx(Loader, { className: clsx$1("tw-animate-spin", styles$k.iconContainer), size: 14 }),
72059
+ /* @__PURE__ */ jsx("span", { className: styles$k.fileNameContainer, children: "Generating code" })
72046
72060
  ] }),
72047
- status2 === GuardrailsCheckStatus.Checking && /* @__PURE__ */ jsxs("div", { className: styles$j.status, children: [
72048
- /* @__PURE__ */ jsx(Loader, { className: clsx$1("tw-animate-spin", styles$j.iconContainer), size: 14 }),
72049
- /* @__PURE__ */ jsx("span", { className: styles$j.fileNameContainer, children: "Checking Guardrails" })
72061
+ status2 === GuardrailsCheckStatus.Checking && /* @__PURE__ */ jsxs("div", { className: styles$k.status, children: [
72062
+ /* @__PURE__ */ jsx(Loader, { className: clsx$1("tw-animate-spin", styles$k.iconContainer), size: 14 }),
72063
+ /* @__PURE__ */ jsx("span", { className: styles$k.fileNameContainer, children: "Checking Guardrails" })
72050
72064
  ] }),
72051
- status2 === GuardrailsCheckStatus.Success && /* @__PURE__ */ jsxs("div", { className: styles$j.status, title: filename, onAuxClick: onSuccessAuxClick, children: [
72065
+ status2 === GuardrailsCheckStatus.Success && /* @__PURE__ */ jsxs("div", { className: styles$k.status, title: filename, onAuxClick: onSuccessAuxClick, children: [
72052
72066
  /* @__PURE__ */ jsx(
72053
72067
  CircleCheckBig,
72054
72068
  {
@@ -72056,13 +72070,13 @@ const GuardrailsStatus = ({
72056
72070
  className: clsx$1(
72057
72071
  "tw-inline",
72058
72072
  "tw-text-[var(--vscode-gitDecoration-addedResourceForeground)]",
72059
- styles$j.iconContainer
72073
+ styles$k.iconContainer
72060
72074
  )
72061
72075
  }
72062
72076
  ),
72063
- filename && /* @__PURE__ */ jsx("span", { className: styles$j.fileNameContainer, children: filename.split("/").pop() })
72077
+ filename && /* @__PURE__ */ jsx("span", { className: styles$k.fileNameContainer, children: filename.split("/").pop() })
72064
72078
  ] }),
72065
- status2 === GuardrailsCheckStatus.Skipped && filename && /* @__PURE__ */ jsxs("div", { className: styles$j.status, title: filename, children: [
72079
+ status2 === GuardrailsCheckStatus.Skipped && filename && /* @__PURE__ */ jsxs("div", { className: styles$k.status, title: filename, children: [
72066
72080
  /* @__PURE__ */ jsx(
72067
72081
  File,
72068
72082
  {
@@ -72070,31 +72084,31 @@ const GuardrailsStatus = ({
72070
72084
  className: clsx$1(
72071
72085
  "tw-inline",
72072
72086
  "tw-text-[var(--vscode-gitDecoration-addedResourceForeground)]",
72073
- styles$j.iconContainer
72087
+ styles$k.iconContainer
72074
72088
  )
72075
72089
  }
72076
72090
  ),
72077
- /* @__PURE__ */ jsx("span", { className: styles$j.fileNameContainer, children: filename.split("/").pop() })
72091
+ /* @__PURE__ */ jsx("span", { className: styles$k.fileNameContainer, children: filename.split("/").pop() })
72078
72092
  ] }),
72079
- status2 === GuardrailsCheckStatus.Failed && /* @__PURE__ */ jsxs("div", { className: styles$j.status, children: [
72093
+ status2 === GuardrailsCheckStatus.Failed && /* @__PURE__ */ jsxs("div", { className: styles$k.status, children: [
72080
72094
  /* @__PURE__ */ jsx(
72081
72095
  TriangleAlert,
72082
72096
  {
72083
72097
  size: 14,
72084
- className: clsx$1(styles$j.attributionIconFound, styles$j.iconContainer)
72098
+ className: clsx$1(styles$k.attributionIconFound, styles$k.iconContainer)
72085
72099
  }
72086
72100
  ),
72087
- /* @__PURE__ */ jsx("span", { className: styles$j.fileNameContainer, children: "Guardrails: Match found" })
72101
+ /* @__PURE__ */ jsx("span", { className: styles$k.fileNameContainer, children: "Guardrails: Match found" })
72088
72102
  ] }),
72089
- status2 === GuardrailsCheckStatus.Error && /* @__PURE__ */ jsxs("div", { className: styles$j.status, children: [
72103
+ status2 === GuardrailsCheckStatus.Error && /* @__PURE__ */ jsxs("div", { className: styles$k.status, children: [
72090
72104
  /* @__PURE__ */ jsx(
72091
72105
  TriangleAlert,
72092
72106
  {
72093
72107
  size: 14,
72094
- className: clsx$1(styles$j.attributionIconUnavailable, styles$j.iconContainer)
72108
+ className: clsx$1(styles$k.attributionIconUnavailable, styles$k.iconContainer)
72095
72109
  }
72096
72110
  ),
72097
- /* @__PURE__ */ jsx("span", { className: styles$j.fileNameContainer, children: "Guardrails API Error" })
72111
+ /* @__PURE__ */ jsx("span", { className: styles$k.fileNameContainer, children: "Guardrails API Error" })
72098
72112
  ] }),
72099
72113
  children2
72100
72114
  ] });
@@ -72281,18 +72295,18 @@ const GuardrailsApplicator = ({
72281
72295
  status: guardrailsResult.status,
72282
72296
  filename: fileName,
72283
72297
  tooltip,
72284
- className: styles$j.metadataContainer,
72298
+ className: styles$k.metadataContainer,
72285
72299
  onSuccessAuxClick,
72286
72300
  children: [
72287
72301
  guardrailsResult.status === GuardrailsCheckStatus.Error && /* @__PURE__ */ jsxs(
72288
72302
  "button",
72289
72303
  {
72290
- className: styles$j.button,
72304
+ className: styles$k.button,
72291
72305
  type: "button",
72292
72306
  onClick: handleRetry,
72293
72307
  title: "Retry Guardrails check",
72294
72308
  children: [
72295
- /* @__PURE__ */ jsx("div", { className: styles$j.iconContainer, children: /* @__PURE__ */ jsx(RefreshCw, { size: 14 }) }),
72309
+ /* @__PURE__ */ jsx("div", { className: styles$k.iconContainer, children: /* @__PURE__ */ jsx(RefreshCw, { size: 14 }) }),
72296
72310
  /* @__PURE__ */ jsx("span", { className: "tw-hidden xs:tw-block", children: "Retry" })
72297
72311
  ]
72298
72312
  }
@@ -72303,12 +72317,12 @@ const GuardrailsApplicator = ({
72303
72317
  guardrailsResult.status === GuardrailsCheckStatus.Failed && !isMessageLoading && /* @__PURE__ */ jsxs(
72304
72318
  "button",
72305
72319
  {
72306
- className: styles$j.button,
72320
+ className: styles$k.button,
72307
72321
  type: "button",
72308
72322
  onClick: handleRegenerate,
72309
72323
  title: "Try regenerating code",
72310
72324
  children: [
72311
- /* @__PURE__ */ jsx("div", { className: styles$j.iconContainer, children: /* @__PURE__ */ jsx(RefreshCw, { size: 14 }) }),
72325
+ /* @__PURE__ */ jsx("div", { className: styles$k.iconContainer, children: /* @__PURE__ */ jsx(RefreshCw, { size: 14 }) }),
72312
72326
  /* @__PURE__ */ jsx("span", { className: "tw-hidden xs:tw-block", children: "Regenerate" })
72313
72327
  ]
72314
72328
  }
@@ -72391,11 +72405,11 @@ const RichCodeBlock = ({
72391
72405
  const onExecuteThisScript = useCallback(() => {
72392
72406
  onExecute == null ? void 0 : onExecute(plainCode);
72393
72407
  }, [onExecute, plainCode]);
72394
- const additionsDeletions = smartApply ? /* @__PURE__ */ jsx("div", { className: styles$j.buttonContainer, children: createAdditionsDeletions({
72408
+ const additionsDeletions = smartApply ? /* @__PURE__ */ jsx("div", { className: styles$k.buttonContainer, children: createAdditionsDeletions({
72395
72409
  hasEditIntent,
72396
72410
  preText: plainCode
72397
72411
  }) }) : void 0;
72398
- const actionButtons2 = /* @__PURE__ */ jsx("div", { className: styles$j.actionButtons, children: isCodeComplete && createEditButtons({
72412
+ const actionButtons2 = /* @__PURE__ */ jsx("div", { className: styles$k.actionButtons, children: isCodeComplete && createEditButtons({
72399
72413
  isVSCode: config.clientCapabilities.isVSCode,
72400
72414
  copyOnly: config.clientCapabilities.codeCopyOnlyAction === "enabled",
72401
72415
  preText: plainCode,
@@ -72426,10 +72440,10 @@ const RichCodeBlock = ({
72426
72440
  /* @__PURE__ */ jsx(CodeBlockPlaceholder, { text: plainCode, status: guardrailsStatus })
72427
72441
  ) : (
72428
72442
  // Otherwise show the actual code with syntax highlighting
72429
- /* @__PURE__ */ jsx("pre", { className: styles$j.content, children: children2 })
72443
+ /* @__PURE__ */ jsx("pre", { className: styles$k.content, children: children2 })
72430
72444
  ),
72431
72445
  additionsDeletions,
72432
- /* @__PURE__ */ jsx("div", { className: styles$j.buttonsContainer, children: /* @__PURE__ */ jsxs("div", { className: styles$j.buttons, children: [
72446
+ /* @__PURE__ */ jsx("div", { className: styles$k.buttonsContainer, children: /* @__PURE__ */ jsxs("div", { className: styles$k.buttons, children: [
72433
72447
  showCode && actionButtons2,
72434
72448
  guardrailsStatusDisplay
72435
72449
  ] }) })
@@ -80596,7 +80610,7 @@ var Trigger2 = AccordionTrigger$1;
80596
80610
  var Content2 = AccordionContent$1;
80597
80611
  const accordionTrigger = "_accordion-trigger_12003_1";
80598
80612
  const accordionTriggerChevron = "_accordion-trigger-chevron_12003_11";
80599
- const styles$h = {
80613
+ const styles$i = {
80600
80614
  accordionTrigger,
80601
80615
  accordionTriggerChevron
80602
80616
  };
@@ -80607,7 +80621,7 @@ const AccordionTrigger = React$2.forwardRef(({ className, children: children2, .
80607
80621
  Trigger2,
80608
80622
  {
80609
80623
  ref,
80610
- className: clsx$1(styles$h.accordionTrigger, className),
80624
+ className: clsx$1(styles$i.accordionTrigger, className),
80611
80625
  ...props,
80612
80626
  children: [
80613
80627
  children2,
@@ -80616,7 +80630,7 @@ const AccordionTrigger = React$2.forwardRef(({ className, children: children2, .
80616
80630
  {
80617
80631
  className: cn(
80618
80632
  "tw-h-8 tw-w-8 tw-text-muted-foreground",
80619
- styles$h.accordionTriggerChevron
80633
+ styles$i.accordionTriggerChevron
80620
80634
  )
80621
80635
  }
80622
80636
  )
@@ -80798,7 +80812,7 @@ const ChatMessageContent = memo$2(
80798
80812
  onRegenerate,
80799
80813
  regeneratingCodeBlocks,
80800
80814
  smartApply,
80801
- className: clsx$1(styles$j.content, className),
80815
+ className: clsx$1(styles$k.content, className),
80802
80816
  hasEditIntent: (humanMessage == null ? void 0 : humanMessage.intent) === "edit",
80803
80817
  chatCodeHighlightingEnabled
80804
80818
  }
@@ -80820,7 +80834,7 @@ const banner = "_banner_1sixu_62";
80820
80834
  const requestError = "_request-error_1sixu_136";
80821
80835
  const requestErrorTitle = "_request-error-title_1sixu_149";
80822
80836
  const errorContent = "_error-content_1sixu_153";
80823
- const styles$g = {
80837
+ const styles$h = {
80824
80838
  errorItem,
80825
80839
  icon,
80826
80840
  body,
@@ -80854,9 +80868,9 @@ const RequestErrorItem = ({ error: error2, humanMessage }) => {
80854
80868
  }
80855
80869
  }
80856
80870
  ] : [];
80857
- return /* @__PURE__ */ jsxs("div", { className: styles$g.requestError, children: [
80858
- /* @__PURE__ */ jsxs("div", { className: styles$g.errorContent, children: [
80859
- /* @__PURE__ */ jsx("span", { className: styles$g.requestErrorTitle, children: "Request Failed: " }),
80871
+ return /* @__PURE__ */ jsxs("div", { className: styles$h.requestError, children: [
80872
+ /* @__PURE__ */ jsxs("div", { className: styles$h.errorContent, children: [
80873
+ /* @__PURE__ */ jsx("span", { className: styles$h.requestErrorTitle, children: "Request Failed: " }),
80860
80874
  errorMessage
80861
80875
  ] }),
80862
80876
  actions2.length > 0 && /* @__PURE__ */ jsx("menu", { className: "tw-flex tw-gap-2 tw-text-sm tw-text-muted-foreground", children: /* @__PURE__ */ jsx("div", { className: "tw-flex tw-flex-wrap tw-items-center tw-gap-x-4 tw-gap-y-2", children: /* @__PURE__ */ jsx("ul", { className: "tw-whitespace-nowrap tw-flex tw-gap-2 tw-flex-wrap", children: actions2.map(({ label, tooltip, onClick }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
@@ -80893,7 +80907,7 @@ const RateLimitErrorItem = ({ error: error2, postMessage }) => {
80893
80907
  if (fallbackToFlash) {
80894
80908
  ctaText = "Usage limit of premium models reached, switching the model to Gemini Flash.";
80895
80909
  }
80896
- return /* @__PURE__ */ jsx("div", { className: styles$g.errorItem, children: /* @__PURE__ */ jsxs("div", { className: styles$g.body, children: [
80910
+ return /* @__PURE__ */ jsx("div", { className: styles$h.errorItem, children: /* @__PURE__ */ jsxs("div", { className: styles$h.body, children: [
80897
80911
  /* @__PURE__ */ jsxs("header", { children: [
80898
80912
  /* @__PURE__ */ jsx("h1", { children: ctaText }),
80899
80913
  /* @__PURE__ */ jsxs("p", { children: [
@@ -80901,7 +80915,7 @@ const RateLimitErrorItem = ({ error: error2, postMessage }) => {
80901
80915
  fallbackToFlash && " You can continue using Gemini Flash, or other standard models."
80902
80916
  ] })
80903
80917
  ] }),
80904
- /* @__PURE__ */ jsx("div", { className: styles$g.actions, children: error2.feature !== "Agentic Chat" && /* @__PURE__ */ jsx(
80918
+ /* @__PURE__ */ jsx("div", { className: styles$h.actions, children: error2.feature !== "Agentic Chat" && /* @__PURE__ */ jsx(
80905
80919
  Button,
80906
80920
  {
80907
80921
  type: "button",
@@ -80910,7 +80924,7 @@ const RateLimitErrorItem = ({ error: error2, postMessage }) => {
80910
80924
  children: "Learn More"
80911
80925
  }
80912
80926
  ) }),
80913
- error2.retryMessage && /* @__PURE__ */ jsx("p", { className: styles$g.retryMessage, children: error2.retryMessage })
80927
+ error2.retryMessage && /* @__PURE__ */ jsx("p", { className: styles$h.retryMessage, children: error2.retryMessage })
80914
80928
  ] }) });
80915
80929
  };
80916
80930
  const TokenUsageDisplay = ({ tokenUsage }) => {
@@ -80949,7 +80963,7 @@ const BaseMessageCell = ({ cellAction, content: content2, contentClassName, foot
80949
80963
  }
80950
80964
  );
80951
80965
  const stepContainer = "_step-container_1xbw7_1";
80952
- const styles$f = {
80966
+ const styles$g = {
80953
80967
  stepContainer
80954
80968
  };
80955
80969
  const SubMessageCell = ({ piece, guardrails, onRegenerate, regeneratingCodeBlocks }) => {
@@ -80965,7 +80979,7 @@ const SubMessageCell = ({ piece, guardrails, onRegenerate, regeneratingCodeBlock
80965
80979
  regeneratingCodeBlocks
80966
80980
  }
80967
80981
  ),
80968
- piece.step && /* @__PURE__ */ jsxs("div", { className: `${styles$f.stepContainer} tw-flex tw-items-center tw-gap-2 tw-w-fit`, children: [
80982
+ piece.step && /* @__PURE__ */ jsxs("div", { className: `${styles$g.stepContainer} tw-flex tw-items-center tw-gap-2 tw-w-fit`, children: [
80969
80983
  /* @__PURE__ */ jsx("div", { className: "tw-self-start tw-mt-1", children: /* @__PURE__ */ jsx(Wrench, { className: "tw-w-8 tw-h-8" }) }),
80970
80984
  /* @__PURE__ */ jsx("div", { children: piece.step.content })
80971
80985
  ] })
@@ -81047,7 +81061,7 @@ const AssistantMessageCell = memo$2(
81047
81061
  messageIntent === "chat" && /* @__PURE__ */ jsx(
81048
81062
  "div",
81049
81063
  {
81050
- className: `tw-flex tw-items-center tw-justify-end tw-gap-4 ${styles$j.buttonsContainer}`,
81064
+ className: `tw-flex tw-items-center tw-justify-end tw-gap-4 ${styles$k.buttonsContainer}`,
81051
81065
  children: /* @__PURE__ */ jsx(
81052
81066
  CopyButton,
81053
81067
  {
@@ -81218,15 +81232,15 @@ const LinkOpenerProvider = ({ vscodeAPI, children: children2 }) => {
81218
81232
  function useLinkOpener() {
81219
81233
  return useContext(LinkOpenerContext);
81220
81234
  }
81221
- const container$2 = "_container_1eiqs_6";
81235
+ const container$3 = "_container_1eiqs_6";
81222
81236
  const editor$1 = "_editor_1eiqs_17";
81223
- const toolbar$1 = "_toolbar_1eiqs_23";
81237
+ const toolbar = "_toolbar_1eiqs_23";
81224
81238
  const focused$1 = "_focused_1eiqs_28";
81225
81239
  const editorContentEditable$1 = "_editor-content-editable_1eiqs_30";
81226
- const styles$e = {
81227
- container: container$2,
81240
+ const styles$f = {
81241
+ container: container$3,
81228
81242
  editor: editor$1,
81229
- toolbar: toolbar$1,
81243
+ toolbar,
81230
81244
  focused: focused$1,
81231
81245
  editorContentEditable: editorContentEditable$1
81232
81246
  };
@@ -81632,16 +81646,17 @@ const $cb5cc270b50c6fcd$export$41fb9f06171c75f4 = $cb5cc270b50c6fcd$export$7dacb
81632
81646
  const $cb5cc270b50c6fcd$export$602eac185826482c = $cb5cc270b50c6fcd$export$dd679ffb4362d2d4;
81633
81647
  const $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2 = $cb5cc270b50c6fcd$export$d7e1f420b25549ff;
81634
81648
  const popover = "_popover_1ah8d_2";
81635
- const styles$d = {
81649
+ const styles$e = {
81636
81650
  popover
81637
81651
  };
81638
81652
  const Popover = $cb5cc270b50c6fcd$export$be92b6f5f03c0fe9;
81639
81653
  const PopoverTrigger = $cb5cc270b50c6fcd$export$41fb9f06171c75f4;
81640
81654
  const PopoverContent = React$2.forwardRef(({ className, align = "start", sideOffset = 5, ...props }, ref) => {
81641
81655
  const portalRef = React$2.useRef(null);
81656
+ const { portalContainer } = useUIConfiguration();
81642
81657
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
81643
81658
  /* @__PURE__ */ jsx("div", { ref: portalRef, className: "empty:tw-hidden" }),
81644
- portalRef.current && /* @__PURE__ */ jsx($cb5cc270b50c6fcd$export$602eac185826482c, { container: portalRef.current, children: /* @__PURE__ */ jsx(
81659
+ portalRef.current && /* @__PURE__ */ jsx($cb5cc270b50c6fcd$export$602eac185826482c, { container: portalContainer ?? portalRef.current, children: /* @__PURE__ */ jsx(
81645
81660
  $cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,
81646
81661
  {
81647
81662
  ref,
@@ -81650,7 +81665,7 @@ const PopoverContent = React$2.forwardRef(({ className, align = "start", sideOff
81650
81665
  className: cn(
81651
81666
  "tw-z-50 tw-w-72 tw-rounded-md tw-border tw-border-border tw-bg-popover tw-p-4 tw-text-popover-foreground tw-outline-none",
81652
81667
  className,
81653
- styles$d.popover
81668
+ styles$e.popover
81654
81669
  ),
81655
81670
  ...props
81656
81671
  }
@@ -81796,6 +81811,7 @@ const ToolbarPopoverItem = ({
81796
81811
  PopoverContent,
81797
81812
  {
81798
81813
  align: "start",
81814
+ collisionPadding: 8,
81799
81815
  onKeyDown: onKeyDownInPopoverContent,
81800
81816
  ref: popoverContentRef,
81801
81817
  ...popoverContentProps,
@@ -81813,7 +81829,7 @@ const disabled = "_disabled_k71kd_27";
81813
81829
  const modelIcon = "_model-icon_k71kd_31";
81814
81830
  const rightIcon = "_right-icon_k71kd_35";
81815
81831
  const badge = "_badge_k71kd_39";
81816
- const styles$c = {
81832
+ const styles$d = {
81817
81833
  chatModelPopover,
81818
81834
  modelTitleWithIcon,
81819
81835
  modelName,
@@ -81940,7 +81956,7 @@ const ModelSelectField = ({
81940
81956
  loop: true,
81941
81957
  defaultValue: value,
81942
81958
  tabIndex: 0,
81943
- className: `focus:tw-outline-none ${styles$c.chatModelPopover}`,
81959
+ className: `focus:tw-outline-none ${styles$d.chatModelPopover}`,
81944
81960
  "data-testid": "chat-model-popover",
81945
81961
  children: [
81946
81962
  intent === "agentic" && /* @__PURE__ */ jsx("div", { className: "tw-pl-5 tw-pr-3 tw-py-1.5 tw-text-sm tw-text-foreground tw-flex tw-justify-center", children: /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-items-start tw-gap-2 tw-bg-muted tw-px-2 tw-py-0.5 tw-rounded", children: [
@@ -81978,14 +81994,14 @@ const ModelSelectField = ({
81978
81994
  href: "https://sourcegraph.com/docs/cody/clients/install-vscode#supported-llm-models",
81979
81995
  target: "_blank",
81980
81996
  rel: "noreferrer",
81981
- className: styles$c.modelTitleWithIcon,
81997
+ className: styles$d.modelTitleWithIcon,
81982
81998
  children: [
81983
- /* @__PURE__ */ jsxs("span", { className: styles$c.modelIcon, children: [
81999
+ /* @__PURE__ */ jsxs("span", { className: styles$d.modelIcon, children: [
81984
82000
  /* @__PURE__ */ jsx(BookOpen, { size: 16, strokeWidth: 2 }),
81985
82001
  " "
81986
82002
  ] }),
81987
- /* @__PURE__ */ jsx("span", { className: styles$c.modelName, children: "Documentation" }),
81988
- /* @__PURE__ */ jsx("span", { className: styles$c.rightIcon, children: /* @__PURE__ */ jsx(
82003
+ /* @__PURE__ */ jsx("span", { className: styles$d.modelName, children: "Documentation" }),
82004
+ /* @__PURE__ */ jsx("span", { className: styles$d.rightIcon, children: /* @__PURE__ */ jsx(
81989
82005
  ExternalLink,
81990
82006
  {
81991
82007
  size: 16,
@@ -82058,17 +82074,17 @@ const ModelTitleWithIcon = ({ model, showIcon, modelAvailability: modelAvailabil
82058
82074
  return /* @__PURE__ */ jsxs(
82059
82075
  "span",
82060
82076
  {
82061
- className: clsx$1(styles$c.modelTitleWithIcon, {
82062
- [styles$c.disabled]: isDisabled
82077
+ className: clsx$1(styles$d.modelTitleWithIcon, {
82078
+ [styles$d.disabled]: isDisabled
82063
82079
  }),
82064
82080
  children: [
82065
- showIcon ? model.id.includes(DeepCodyAgentID) ? /* @__PURE__ */ jsx(Brain, { size: 16, className: styles$c.modelIcon }) : /* @__PURE__ */ jsx(ChatModelIcon, { model: model.provider, className: styles$c.modelIcon }) : null,
82066
- /* @__PURE__ */ jsx("span", { className: clsx$1("tw-flex-grow", styles$c.modelName), children: model.title }),
82081
+ showIcon ? model.id.includes(DeepCodyAgentID) ? /* @__PURE__ */ jsx(Brain, { size: 16, className: styles$d.modelIcon }) : /* @__PURE__ */ jsx(ChatModelIcon, { model: model.provider, className: styles$d.modelIcon }) : null,
82082
+ /* @__PURE__ */ jsx("span", { className: clsx$1("tw-flex-grow", styles$d.modelName), children: model.title }),
82067
82083
  modelBadge && /* @__PURE__ */ jsx(
82068
82084
  Badge,
82069
82085
  {
82070
82086
  variant: "secondary",
82071
- className: clsx$1(styles$c.badge, {
82087
+ className: clsx$1(styles$d.badge, {
82072
82088
  "tw-opacity-75": modelAvailability2 === "needs-cody-pro"
82073
82089
  }),
82074
82090
  children: modelBadge
@@ -82126,7 +82142,7 @@ const useDebounce = (value, delay2) => {
82126
82142
  };
82127
82143
  const userAvatar = "_user-avatar_vhaw6_1";
82128
82144
  const sourcegraphGradientBorder = "_sourcegraph-gradient-border_vhaw6_11";
82129
- const styles$b = {
82145
+ const styles$c = {
82130
82146
  userAvatar,
82131
82147
  sourcegraphGradientBorder
82132
82148
  };
@@ -82145,7 +82161,7 @@ const UserAvatar = ({
82145
82161
  className
82146
82162
  }
82147
82163
  );
82148
- return sourcegraphGradientBorder2 ? /* @__PURE__ */ jsx("div", { className: clsx$1(styles$b.sourcegraphGradientBorder, "tw-inline-flex", className), children: inner }) : inner;
82164
+ return sourcegraphGradientBorder2 ? /* @__PURE__ */ jsx("div", { className: clsx$1(styles$c.sourcegraphGradientBorder, "tw-inline-flex", className), children: inner }) : inner;
82149
82165
  };
82150
82166
  const InnerUserAvatar = ({
82151
82167
  user,
@@ -82168,7 +82184,7 @@ const InnerUserAvatar = ({
82168
82184
  return /* @__PURE__ */ jsx(
82169
82185
  "img",
82170
82186
  {
82171
- className: clsx$1(styles$b.userAvatar, className),
82187
+ className: clsx$1(styles$c.userAvatar, className),
82172
82188
  src: url,
82173
82189
  role: "presentation",
82174
82190
  title: title2,
@@ -82183,9 +82199,9 @@ const InnerUserAvatar = ({
82183
82199
  "div",
82184
82200
  {
82185
82201
  title: title2,
82186
- className: clsx$1(styles$b.userAvatar, className),
82202
+ className: clsx$1(styles$c.userAvatar, className),
82187
82203
  style: { width: `${size2}px`, height: `${size2}px`, fontSize: `${size2 / 3}px` },
82188
- children: /* @__PURE__ */ jsx("span", { className: styles$b.initials, children: getInitials((user == null ? void 0 : user.displayName) || (user == null ? void 0 : user.username) || "") })
82204
+ children: /* @__PURE__ */ jsx("span", { className: styles$c.initials, children: getInitials((user == null ? void 0 : user.displayName) || (user == null ? void 0 : user.username) || "") })
82189
82205
  }
82190
82206
  );
82191
82207
  };
@@ -82209,7 +82225,7 @@ const prompt = "_prompt_1lclp_18";
82209
82225
  const promptContent = "_prompt--content_1lclp_1";
82210
82226
  const promptTitle = "_prompt--title_1lclp_1";
82211
82227
  const promptName = "_prompt--name_1lclp_1";
82212
- const styles$a = {
82228
+ const styles$b = {
82213
82229
  item,
82214
82230
  itemIndicator,
82215
82231
  promptAvatar,
@@ -82231,7 +82247,7 @@ const ActionItem = (props) => {
82231
82247
  {
82232
82248
  value: commandRowValue(action),
82233
82249
  disabled: isDisabled,
82234
- className: clsx$1(className, styles$a.item),
82250
+ className: clsx$1(className, styles$b.item),
82235
82251
  tooltip: isDisabled ? "Edit-like action is not supported in current read-only environment" : void 0,
82236
82252
  onSelect,
82237
82253
  children: action.actionType === "prompt" ? /* @__PURE__ */ jsx(ActionPrompt, { prompt: action }) : /* @__PURE__ */ jsx(ActionCommand, { command: action })
@@ -82240,30 +82256,30 @@ const ActionItem = (props) => {
82240
82256
  };
82241
82257
  const ActionPrompt = (props) => {
82242
82258
  const { prompt: prompt2 } = props;
82243
- return /* @__PURE__ */ jsxs("div", { className: styles$a.prompt, children: [
82259
+ return /* @__PURE__ */ jsxs("div", { className: styles$b.prompt, children: [
82244
82260
  prompt2.createdBy && /* @__PURE__ */ jsx(
82245
82261
  UserAvatar,
82246
82262
  {
82247
82263
  size: ACTION_ITEM_AVATAR_SIZE,
82248
82264
  user: { ...prompt2.createdBy, endpoint: "" },
82249
- className: styles$a.promptAvatar
82265
+ className: styles$b.promptAvatar
82250
82266
  }
82251
82267
  ),
82252
- !prompt2.createdBy && /* @__PURE__ */ jsx("div", { className: styles$a.promptAvatar, children: /* @__PURE__ */ jsx(PencilRuler, { size: 16, strokeWidth: 1.5, className: styles$a.promptIcon }) }),
82253
- /* @__PURE__ */ jsxs("div", { className: styles$a.promptContent, children: [
82254
- /* @__PURE__ */ jsxs("div", { className: styles$a.promptTitle, children: [
82255
- /* @__PURE__ */ jsx("strong", { className: styles$a.promptName, children: prompt2.name }),
82268
+ !prompt2.createdBy && /* @__PURE__ */ jsx("div", { className: styles$b.promptAvatar, children: /* @__PURE__ */ jsx(PencilRuler, { size: 16, strokeWidth: 1.5, className: styles$b.promptIcon }) }),
82269
+ /* @__PURE__ */ jsxs("div", { className: styles$b.promptContent, children: [
82270
+ /* @__PURE__ */ jsxs("div", { className: styles$b.promptTitle, children: [
82271
+ /* @__PURE__ */ jsx("strong", { className: styles$b.promptName, children: prompt2.name }),
82256
82272
  prompt2.draft && /* @__PURE__ */ jsx(Badge, { variant: "secondary", className: "tw-text-xxs tw-mt-0.5", children: "Draft" }),
82257
82273
  prompt2.recommended && /* @__PURE__ */ jsxs(Tooltip, { children: [
82258
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Pin, { size: 12, className: styles$a.promptIcon }) }),
82274
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Pin, { size: 12, className: styles$b.promptIcon }) }),
82259
82275
  /* @__PURE__ */ jsx(TooltipContent, { children: "This prompt was recommended by your admin" })
82260
82276
  ] }),
82261
82277
  prompt2.mode !== "CHAT" && /* @__PURE__ */ jsxs(Tooltip, { children: [
82262
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Pencil, { size: 12, className: styles$a.promptIcon }) }),
82278
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(Pencil, { size: 12, className: styles$b.promptIcon }) }),
82263
82279
  /* @__PURE__ */ jsx(TooltipContent, { children: "This is an edit prompt" })
82264
82280
  ] })
82265
82281
  ] }),
82266
- /* @__PURE__ */ jsx("span", { className: styles$a.promptDescription, children: prompt2.description ?? "(No description provided)" })
82282
+ /* @__PURE__ */ jsx("span", { className: styles$b.promptDescription, children: prompt2.description ?? "(No description provided)" })
82267
82283
  ] })
82268
82284
  ] });
82269
82285
  };
@@ -82285,11 +82301,11 @@ const ActionCommand = (props) => {
82285
82301
  const { command } = props;
82286
82302
  const Icon2 = COMMAND_ICONS[command.key] ?? PencilRuler;
82287
82303
  const description2 = command.type !== "default" ? command.description : COMMAND_DESCRIPTIONS[command.key];
82288
- return /* @__PURE__ */ jsxs("div", { className: styles$a.prompt, children: [
82289
- /* @__PURE__ */ jsx("div", { className: styles$a.promptAvatar, children: /* @__PURE__ */ jsx(Icon2, { size: 16, strokeWidth: 1.5, className: styles$a.promptIcon }) }),
82290
- /* @__PURE__ */ jsxs("div", { className: styles$a.promptContent, children: [
82291
- /* @__PURE__ */ jsxs("div", { className: styles$a.promptTitle, children: [
82292
- /* @__PURE__ */ jsx("strong", { className: styles$a.promptName, children: command.type === "default" ? command.description : command.key }),
82304
+ return /* @__PURE__ */ jsxs("div", { className: styles$b.prompt, children: [
82305
+ /* @__PURE__ */ jsx("div", { className: styles$b.promptAvatar, children: /* @__PURE__ */ jsx(Icon2, { size: 16, strokeWidth: 1.5, className: styles$b.promptIcon }) }),
82306
+ /* @__PURE__ */ jsxs("div", { className: styles$b.promptContent, children: [
82307
+ /* @__PURE__ */ jsxs("div", { className: styles$b.promptTitle, children: [
82308
+ /* @__PURE__ */ jsx("strong", { className: styles$b.promptName, children: command.type === "default" ? command.description : command.key }),
82293
82309
  command.type !== "default" && /* @__PURE__ */ jsx(
82294
82310
  Badge,
82295
82311
  {
@@ -82299,7 +82315,7 @@ const ActionCommand = (props) => {
82299
82315
  }
82300
82316
  )
82301
82317
  ] }),
82302
- /* @__PURE__ */ jsx("span", { className: styles$a.promptDescription, children: description2 ?? "(No description provided)" })
82318
+ /* @__PURE__ */ jsx("span", { className: styles$b.promptDescription, children: description2 ?? "(No description provided)" })
82303
82319
  ] })
82304
82320
  ] });
82305
82321
  };
@@ -82309,7 +82325,7 @@ const listInputContainer = "_list--input-container_mvyfp_1";
82309
82325
  const listInput = "_list--input_mvyfp_1";
82310
82326
  const listChips = "_list-chips_mvyfp_1";
82311
82327
  const listItem = "_list--item_mvyfp_41";
82312
- const styles$9 = {
82328
+ const styles$a = {
82313
82329
  list,
82314
82330
  listInputContainer,
82315
82331
  listInput,
@@ -82454,19 +82470,19 @@ const PromptList = (props) => {
82454
82470
  tabIndex: 0,
82455
82471
  shouldFilter: false,
82456
82472
  defaultValue: "xxx-no-item",
82457
- className: clsx$1(className, styles$9.list, {
82458
- [styles$9.listChips]: appearanceMode === "chips-list"
82473
+ className: clsx$1(className, styles$a.list, {
82474
+ [styles$a.listChips]: appearanceMode === "chips-list"
82459
82475
  }),
82460
82476
  disablePointerSelection: true,
82461
82477
  children: /* @__PURE__ */ jsxs(CommandList, { className, children: [
82462
- showSearch && /* @__PURE__ */ jsx("div", { className: clsx$1(inputPaddingClass, inputClassName, styles$9.listInputContainer), children: /* @__PURE__ */ jsx(
82478
+ showSearch && /* @__PURE__ */ jsx("div", { className: clsx$1(inputPaddingClass, inputClassName, styles$a.listInputContainer), children: /* @__PURE__ */ jsx(
82463
82479
  CommandInput,
82464
82480
  {
82465
82481
  value: query,
82466
82482
  onValueChange: setQuery,
82467
82483
  placeholder: "Search...",
82468
82484
  autoFocus: true,
82469
- className: styles$9.listInput
82485
+ className: styles$a.listInput
82470
82486
  }
82471
82487
  ) }),
82472
82488
  !result && !error2 && /* @__PURE__ */ jsx(CommandLoading, { className: itemPaddingClass, children: "Loading..." }),
@@ -82490,7 +82506,7 @@ const PromptList = (props) => {
82490
82506
  {
82491
82507
  action,
82492
82508
  onSelect,
82493
- className: clsx$1(itemPaddingClass, styles$9.listItem)
82509
+ className: clsx$1(itemPaddingClass, styles$a.listItem)
82494
82510
  },
82495
82511
  commandRowValue(action)
82496
82512
  )),
@@ -82779,7 +82795,7 @@ const PromptSelectField = ({ onSelect, onCloseByEscape, className, __storybook__
82779
82795
  "aria-label": "Insert prompt",
82780
82796
  popoverContent: (close2) => /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-flex-col tw-max-h-[500px] tw-overflow-auto tw-relative", children: [
82781
82797
  /* @__PURE__ */ jsx("div", { className: "tw-flex tw-flex-row tw-gap-4 tw-px-2 tw-py-3 tw-border-b tw-border-border tw-mb-1", children: /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-justify-start", children: [
82782
- /* @__PURE__ */ jsx("div", { className: "tw-w-1/2", children: /* @__PURE__ */ jsx(
82798
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
82783
82799
  PromptOwnerFilter,
82784
82800
  {
82785
82801
  value: ownerFilterValue,
@@ -82789,7 +82805,7 @@ const PromptSelectField = ({ onSelect, onCloseByEscape, className, __storybook__
82789
82805
  userId: userId && !userIdError ? userId : void 0
82790
82806
  }
82791
82807
  ) }),
82792
- /* @__PURE__ */ jsx("div", { className: "tw-w-1/2", children: /* @__PURE__ */ jsx(
82808
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
82793
82809
  PromptTagsFilter,
82794
82810
  {
82795
82811
  selectedTagId,
@@ -82816,25 +82832,17 @@ const PromptSelectField = ({ onSelect, onCloseByEscape, className, __storybook__
82816
82832
  promptFilters
82817
82833
  }
82818
82834
  ),
82819
- /* @__PURE__ */ jsx("div", { className: "tw-sticky tw-bottom-0 tw-w-full tw-bg-popover tw-py-2 tw-px-3 tw-border-t tw-border-border", children: /* @__PURE__ */ jsx(
82835
+ /* @__PURE__ */ jsx("div", { className: "tw-sticky tw-bottom-0 tw-w-full tw-bg-popover tw-py-2 tw-px-3 tw-border-t tw-border-border", children: /* @__PURE__ */ jsxs(
82820
82836
  "a",
82821
82837
  {
82822
82838
  href: promptLibraryUrl,
82823
82839
  target: "_blank",
82824
82840
  rel: "noopener noreferrer",
82825
- className: "tw-w-full",
82826
- children: /* @__PURE__ */ jsxs(
82827
- Button,
82828
- {
82829
- type: "button",
82830
- variant: "link",
82831
- className: "tw-w-full tw-justify-center tw-text-sm tw-text-muted-foreground",
82832
- children: [
82833
- "Explore Prompt Library",
82834
- /* @__PURE__ */ jsx(ExternalLink, { className: "tw-ml-1 tw-size-6" })
82835
- ]
82836
- }
82837
- )
82841
+ className: "tw-w-full tw-flex tw-items-center tw-p-2 tw-gap-2 tw-justify-center tw-align-middle tw-text-sm tw-underline-offset-4 hover:tw-underline hover:tw-text-link-hover tw-text-muted-foreground",
82842
+ children: [
82843
+ "Explore Prompt Library",
82844
+ /* @__PURE__ */ jsx(ExternalLink, { className: "tw-ml-1 tw-size-6" })
82845
+ ]
82838
82846
  }
82839
82847
  ) })
82840
82848
  ] }),
@@ -83390,6 +83398,7 @@ const HumanMessageEditor = ({
83390
83398
  }) => {
83391
83399
  var _a2, _b, _c;
83392
83400
  const telemetryRecorder = useTelemetryRecorder();
83401
+ const { portalContainer } = useUIConfiguration();
83393
83402
  const editorRef = useRef$1(null);
83394
83403
  useImperativeHandle(parentEditorRef, () => editorRef.current);
83395
83404
  const [isEmptyEditorValue, setIsEmptyEditorValue] = useState$1(
@@ -83631,10 +83640,10 @@ const HumanMessageEditor = ({
83631
83640
  "div",
83632
83641
  {
83633
83642
  className: clsx$1(
83634
- styles$e.container,
83643
+ styles$f.container,
83635
83644
  {
83636
- [styles$e.sent]: isSent,
83637
- [styles$e.focused]: focused2
83645
+ [styles$f.sent]: isSent,
83646
+ [styles$f.focused]: focused2
83638
83647
  },
83639
83648
  "tw-transition",
83640
83649
  className
@@ -83657,9 +83666,10 @@ const HumanMessageEditor = ({
83657
83666
  editorRef,
83658
83667
  disabled: disabled2,
83659
83668
  contextWindowSizeInTokens,
83660
- editorClassName: styles$e.editor,
83661
- contentEditableClassName: styles$e.editorContentEditable,
83662
- openExternalLink
83669
+ editorClassName: styles$f.editor,
83670
+ contentEditableClassName: styles$f.editorContentEditable,
83671
+ openExternalLink,
83672
+ mentionPortalContainer: portalContainer
83663
83673
  }
83664
83674
  ),
83665
83675
  !disabled2 && /* @__PURE__ */ jsx(
@@ -83672,7 +83682,7 @@ const HumanMessageEditor = ({
83672
83682
  onGapClick,
83673
83683
  focusEditor,
83674
83684
  hidden: !focused2 && isSent,
83675
- className: styles$e.toolbar,
83685
+ className: styles$f.toolbar,
83676
83686
  intent: selectedIntent,
83677
83687
  extensionAPI,
83678
83688
  onMediaUpload,
@@ -83750,8 +83760,12 @@ const HumanMessageCellContent = memo$2((props) => {
83750
83760
  }
83751
83761
  );
83752
83762
  });
83763
+ const container$2 = "_container_bgbsm_1";
83764
+ const styles$9 = {
83765
+ container: container$2
83766
+ };
83753
83767
  const ScrollDown = (props) => {
83754
- return /* @__PURE__ */ jsx("div", { className: "tw-relative tw-left-1/2 tw--translate-x-1/2 tw-z-50 tw-w-fit tw-h-0 tw--top-8", children: /* @__PURE__ */ jsxs(
83768
+ return /* @__PURE__ */ jsx("div", { className: styles$9.container, children: /* @__PURE__ */ jsxs(
83755
83769
  Button,
83756
83770
  {
83757
83771
  variant: "outline",
@@ -86894,7 +86908,7 @@ const Chat = ({
86894
86908
  }, []);
86895
86909
  const [activeChatContext, setActiveChatContext] = useState$1();
86896
86910
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
86897
- !chatEnabled && /* @__PURE__ */ jsx("div", { className: styles$k.chatDisabled, children: "Cody chat is disabled by your Sourcegraph site administrator" }),
86911
+ !chatEnabled && /* @__PURE__ */ jsx("div", { className: styles$l.chatDisabled, children: "Cody chat is disabled by your Sourcegraph site administrator" }),
86898
86912
  /* @__PURE__ */ jsx(
86899
86913
  Transcript,
86900
86914
  {
@@ -86951,15 +86965,15 @@ const StorageWarningBanner = ({ extensionAPI, vscodeAPI }) => {
86951
86965
  return /* @__PURE__ */ jsxs(
86952
86966
  "div",
86953
86967
  {
86954
- className: `${styles$g.errorItem} tw-bg-gray-500/10 tw-border-l-4 tw-border-blue-500 tw-relative`,
86968
+ className: `${styles$h.errorItem} tw-bg-gray-500/10 tw-border-l-4 tw-border-blue-500 tw-relative`,
86955
86969
  children: [
86956
- /* @__PURE__ */ jsx("div", { className: styles$g.icon, children: /* @__PURE__ */ jsx(TriangleAlert, { className: "tw-h-6 tw-w-6 tw-text-blue-600" }) }),
86957
- /* @__PURE__ */ jsxs("div", { className: styles$g.body, children: [
86970
+ /* @__PURE__ */ jsx("div", { className: styles$h.icon, children: /* @__PURE__ */ jsx(TriangleAlert, { className: "tw-h-6 tw-w-6 tw-text-blue-600" }) }),
86971
+ /* @__PURE__ */ jsxs("div", { className: styles$h.body, children: [
86958
86972
  /* @__PURE__ */ jsxs("header", { children: [
86959
86973
  /* @__PURE__ */ jsx("h1", { className: "tw-text-blue-500", children: "Large Chat History Detected" }),
86960
86974
  /* @__PURE__ */ jsx("p", { className: "tw-text-gray-500", children: "Your large chat history is being loaded into memory, which may slow down Cody's performance. To improve performance, select the options below to export your chat history to save a backup, then clear it to free up memory. You can also go to the history page to perform these actions." })
86961
86975
  ] }),
86962
- /* @__PURE__ */ jsxs("div", { className: `${styles$g.actions} tw-flex tw-gap-3 tw-flex-wrap`, children: [
86976
+ /* @__PURE__ */ jsxs("div", { className: `${styles$h.actions} tw-flex tw-gap-3 tw-flex-wrap`, children: [
86963
86977
  /* @__PURE__ */ jsx(
86964
86978
  Button,
86965
86979
  {
@@ -88303,6 +88317,8 @@ function getCreateNewChatCommand(options) {
88303
88317
  return IDE === CodyIDE.Web ? "cody.chat.new" : webviewType === "sidebar" || !multipleWebviewsEnabled ? "cody.chat.newPanel" : "cody.chat.newEditorPanel";
88304
88318
  }
88305
88319
  const HISTORY_ITEMS_PER_PAGE = 20;
88320
+ const SEARCH_TIMEOUT_MS = 3e3;
88321
+ const SEARCH_CHUNK_SIZE = 100;
88306
88322
  const initialUIState = {
88307
88323
  searchText: "",
88308
88324
  visibleItems: HISTORY_ITEMS_PER_PAGE,
@@ -88322,7 +88338,7 @@ const HistoryTab = (props) => {
88322
88338
  "div",
88323
88339
  {
88324
88340
  className: clsx$1(
88325
- "tw-flex tw-flex-col tw-justify-center tw-overflow-hidden tw-h-full tw-w-full tw-m-4",
88341
+ "tw-flex tw-flex-col tw-justify-center tw-overflow-hidden tw-h-full tw-w-full",
88326
88342
  {
88327
88343
  "tw-items-center": !chats
88328
88344
  }
@@ -88344,20 +88360,74 @@ const HistoryTabWithData = ({
88344
88360
  const observerRef = useRef$1(null);
88345
88361
  const loadingRef = useRef$1(null);
88346
88362
  const renameInputRef = useRef$1(null);
88347
- const nonEmptyChats = useMemo$1(() => chats.filter((c2) => {
88348
- var _a2;
88349
- return (_a2 = c2 == null ? void 0 : c2.firstHumanMessageText) == null ? void 0 : _a2.length;
88350
- }), [chats]);
88351
- const filteredChats = useMemo$1(() => {
88352
- if (!uiState.searchText.trim()) return nonEmptyChats;
88353
- const searchTerm = uiState.searchText.toLowerCase();
88354
- return nonEmptyChats.filter(
88355
- (chat2) => {
88356
- var _a2, _b;
88357
- return ((_a2 = chat2.chatTitle) == null ? void 0 : _a2.toLowerCase().includes(searchTerm)) || ((_b = chat2.firstHumanMessageText) == null ? void 0 : _b.toLowerCase().includes(searchTerm));
88363
+ const nonEmptyChats = useMemo$1(
88364
+ () => chats.filter((c2) => {
88365
+ var _a2, _b;
88366
+ return ((_a2 = c2 == null ? void 0 : c2.chatTitle) == null ? void 0 : _a2.length) || ((_b = c2 == null ? void 0 : c2.firstHumanMessageText) == null ? void 0 : _b.length);
88367
+ }),
88368
+ [chats]
88369
+ );
88370
+ const [filteredChats, setFilteredChats] = useState$1([]);
88371
+ const [isSearching, setIsSearching] = useState$1(false);
88372
+ const [searchTimedOut, setSearchTimedOut] = useState$1(false);
88373
+ const [debouncedSearchText, setDebouncedSearchText] = useState$1("");
88374
+ useEffect$2(() => {
88375
+ const id2 = window.setTimeout(() => {
88376
+ setDebouncedSearchText(uiState.searchText);
88377
+ }, 150);
88378
+ return () => clearTimeout(id2);
88379
+ }, [uiState.searchText]);
88380
+ useEffect$2(() => {
88381
+ if (!debouncedSearchText.trim()) {
88382
+ setFilteredChats(nonEmptyChats);
88383
+ setIsSearching(false);
88384
+ setSearchTimedOut(false);
88385
+ return;
88386
+ }
88387
+ const searchTerm = debouncedSearchText.toLowerCase();
88388
+ const results = [];
88389
+ const startTime = Date.now();
88390
+ let currentIndex = 0;
88391
+ let aborted = false;
88392
+ const timeoutIds = [];
88393
+ setIsSearching(true);
88394
+ setSearchTimedOut(false);
88395
+ const processChunk = () => {
88396
+ var _a2, _b;
88397
+ if (aborted) return;
88398
+ const elapsed = Date.now() - startTime;
88399
+ if (elapsed > SEARCH_TIMEOUT_MS) {
88400
+ setFilteredChats(results);
88401
+ setIsSearching(false);
88402
+ setSearchTimedOut(true);
88403
+ return;
88358
88404
  }
88359
- );
88360
- }, [nonEmptyChats, uiState.searchText]);
88405
+ const endIndex = Math.min(currentIndex + SEARCH_CHUNK_SIZE, nonEmptyChats.length);
88406
+ for (let i = currentIndex; i < endIndex; i++) {
88407
+ const chat2 = nonEmptyChats[i];
88408
+ const matches3 = chat2.searchableText !== void 0 ? chat2.searchableText.includes(searchTerm) : ((_a2 = chat2.chatTitle) == null ? void 0 : _a2.toLowerCase().includes(searchTerm)) || ((_b = chat2.firstHumanMessageText) == null ? void 0 : _b.toLowerCase().includes(searchTerm));
88409
+ if (matches3) {
88410
+ results.push(chat2);
88411
+ }
88412
+ }
88413
+ currentIndex = endIndex;
88414
+ if (currentIndex < nonEmptyChats.length) {
88415
+ const id2 = window.setTimeout(processChunk, 0);
88416
+ timeoutIds.push(id2);
88417
+ } else {
88418
+ setFilteredChats(results);
88419
+ setIsSearching(false);
88420
+ setSearchTimedOut(false);
88421
+ }
88422
+ };
88423
+ processChunk();
88424
+ return () => {
88425
+ aborted = true;
88426
+ for (const id2 of timeoutIds) {
88427
+ clearTimeout(id2);
88428
+ }
88429
+ };
88430
+ }, [nonEmptyChats, debouncedSearchText]);
88361
88431
  const displayedChats = useMemo$1(
88362
88432
  () => filteredChats.slice(0, uiState.visibleItems),
88363
88433
  [filteredChats, uiState.visibleItems]
@@ -88598,6 +88668,11 @@ const HistoryTabWithData = ({
88598
88668
  }
88599
88669
  ) }),
88600
88670
  /* @__PURE__ */ jsxs(CommandList, { className: "tw-flex-1 tw-overflow-y-auto tw-m-2", children: [
88671
+ isSearching && /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-justify-center tw-items-center tw-py-4", children: [
88672
+ /* @__PURE__ */ jsx(LoadingDots, {}),
88673
+ /* @__PURE__ */ jsx("span", { className: "tw-ml-2 tw-text-sm tw-text-muted-foreground", children: "Searching..." })
88674
+ ] }),
88675
+ searchTimedOut && /* @__PURE__ */ jsx("div", { className: "tw-text-center tw-py-2 tw-text-sm tw-text-muted-foreground", children: "Search timed out. Showing partial results." }),
88601
88676
  displayedChats.map((chat2) => {
88602
88677
  const id2 = chat2.lastInteractionTimestamp;
88603
88678
  const lastMessage = chat2.firstHumanMessageText;
@@ -88608,27 +88683,27 @@ const HistoryTabWithData = ({
88608
88683
  return /* @__PURE__ */ jsxs(
88609
88684
  CommandItem,
88610
88685
  {
88611
- className: `tw-text-left tw-truncate tw-w-full tw-rounded-md tw-text-sm ${styles$4.historyItem} tw-overflow-hidden tw-text-sidebar-foreground tw-align-baseline`,
88686
+ className: `tw-text-left tw-truncate tw-w-full tw-gap-2 tw-rounded-md tw-text-sm ${styles$4.historyItem} tw-overflow-hidden tw-text-sidebar-foreground tw-align-baseline`,
88612
88687
  onSelect: () => vscodeAPI.postMessage({ command: "restoreHistory", chatID: id2 }),
88613
88688
  title: chat2.model,
88614
88689
  children: [
88615
88690
  /* @__PURE__ */ jsxs("div", { className: "tw-truncate tw-w-full tw-flex tw-flex-col tw-gap-2", children: [
88616
- /* @__PURE__ */ jsx("div", { children: isRenaming ? /* @__PURE__ */ jsx(
88691
+ /* @__PURE__ */ jsx("div", { className: "tw-truncate", children: isRenaming ? /* @__PURE__ */ jsx(
88617
88692
  "input",
88618
88693
  {
88619
88694
  ref: renameInputRef,
88620
88695
  type: "text",
88621
88696
  value: uiState.renameInputValue,
88622
- onChange: (e2) => updateUIState({ renameInputValue: e2.target.value }),
88623
88697
  onKeyDown: (e2) => {
88624
88698
  if (e2.key === "Enter") handleRenameSubmit(e2, id2);
88625
88699
  else if (e2.key === "Escape") cancelRename();
88626
88700
  },
88701
+ onChange: (e2) => updateUIState({ renameInputValue: e2.target.value }),
88627
88702
  className: "tw-w-full tw-bg-input-background tw-text-input-foreground tw-border tw-border-border tw-rounded tw-px-2 tw-py-1 tw-text-sm",
88628
88703
  onClick: (e2) => e2.stopPropagation()
88629
88704
  }
88630
88705
  ) : mode !== IntentEnum.Chat ? `[${mode}] ${chatTitle}` : chatTitle }),
88631
- /* @__PURE__ */ jsx("div", { className: "tw-text-left tw-text-muted-foreground", children: timestamp })
88706
+ /* @__PURE__ */ jsx("div", { className: "tw-truncate tw-text-left tw-text-muted-foreground", children: timestamp })
88632
88707
  ] }),
88633
88708
  isRenaming ? /* @__PURE__ */ jsx(
88634
88709
  Button,
@@ -88636,12 +88711,12 @@ const HistoryTabWithData = ({
88636
88711
  variant: "outline",
88637
88712
  title: "Enter to confirm or Escape to cancel",
88638
88713
  "aria-label": "rename-history-submit-button",
88639
- className: styles$4.deleteButton,
88714
+ className: `${styles$4.deleteButton} tw-self-start`,
88640
88715
  onClick: (e2) => handleRenameSubmit(e2, id2),
88641
88716
  onKeyDown: (e2) => handleRenameSubmit(e2, id2),
88642
88717
  children: /* @__PURE__ */ jsx(Check, { className: "tw-w-8 tw-h-8", size: 16, strokeWidth: "1.25" })
88643
88718
  }
88644
- ) : /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-gap-2", children: [
88719
+ ) : /* @__PURE__ */ jsxs("div", { className: "tw-flex tw-gap-2 tw-self-start", children: [
88645
88720
  /* @__PURE__ */ jsx(
88646
88721
  Button,
88647
88722
  {
@@ -89211,17 +89286,17 @@ const UserMenu = ({
89211
89286
  );
89212
89287
  };
89213
89288
  const USER_MENU_AVATAR_SIZE = 16;
89214
- const tabsRoot = "_tabs-root_hvph1_10";
89215
- const tabsContainer = "_tabs-container_hvph1_17";
89216
- const tabs = "_tabs_hvph1_10";
89217
- const subTabs = "_sub-tabs_hvph1_40";
89218
- const tabActionLabel = "_tab-action-label_hvph1_56";
89219
- const tabsRootCodyWeb = "_tabs-root--cody-web_hvph1_68";
89220
- const dialogOverlay = "_dialog-overlay_hvph1_1";
89221
- const dialogContent = "_dialog-content_hvph1_1";
89222
- const dialogTitle = "_dialog-title_hvph1_1";
89223
- const dialogDescription = "_dialog-description_hvph1_1";
89224
- const dialogFooter = "_dialog-footer_hvph1_1";
89289
+ const tabsRoot = "_tabs-root_xz9m6_10";
89290
+ const tabsContainer = "_tabs-container_xz9m6_17";
89291
+ const tabs = "_tabs_xz9m6_10";
89292
+ const subTabs = "_sub-tabs_xz9m6_40";
89293
+ const tabActionLabel = "_tab-action-label_xz9m6_56";
89294
+ const tabsRootCodyWeb = "_tabs-root--cody-web_xz9m6_68";
89295
+ const dialogOverlay = "_dialog-overlay_xz9m6_1";
89296
+ const dialogContent = "_dialog-content_xz9m6_1";
89297
+ const dialogTitle = "_dialog-title_xz9m6_1";
89298
+ const dialogDescription = "_dialog-description_xz9m6_1";
89299
+ const dialogFooter = "_dialog-footer_xz9m6_1";
89225
89300
  const styles$3 = {
89226
89301
  tabsRoot,
89227
89302
  tabsContainer,
@@ -89377,6 +89452,7 @@ const ActionButtonWithConfirmation = (props) => {
89377
89452
  dialogDescription: dialogDescription2
89378
89453
  } = props;
89379
89454
  const [state, setState] = useState$1(false);
89455
+ const { portalContainer } = useUIConfiguration();
89380
89456
  return /* @__PURE__ */ jsxs($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, { open: state, onOpenChange: setState, children: [
89381
89457
  /* @__PURE__ */ jsx(
89382
89458
  TabButton,
@@ -89390,7 +89466,7 @@ const ActionButtonWithConfirmation = (props) => {
89390
89466
  onClick: () => setState(true)
89391
89467
  }
89392
89468
  ),
89393
- /* @__PURE__ */ jsxs($5d3850c4d0b4e6c7$export$602eac185826482c, { children: [
89469
+ /* @__PURE__ */ jsxs($5d3850c4d0b4e6c7$export$602eac185826482c, { container: portalContainer, children: [
89394
89470
  /* @__PURE__ */ jsx($5d3850c4d0b4e6c7$export$c6fdb837b070b4ff, { className: styles$3.dialogOverlay }),
89395
89471
  /* @__PURE__ */ jsxs($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2, { className: styles$3.dialogContent, "data-cody-ui-dialog": true, children: [
89396
89472
  /* @__PURE__ */ jsx($5d3850c4d0b4e6c7$export$f99233281efd08a0, { className: styles$3.dialogTitle, children: dialogTitle2 }),
@@ -89573,7 +89649,7 @@ const CodyPanel = ({
89573
89649
  defaultValue: View.Chat,
89574
89650
  value: view,
89575
89651
  orientation: "vertical",
89576
- className: styles$l.outerContainer,
89652
+ className: styles$m.outerContainer,
89577
89653
  children: [
89578
89654
  /* @__PURE__ */ jsx(Notices, { instanceNotices }),
89579
89655
  config.webviewType !== "editor" && /* @__PURE__ */ jsx(
@@ -89633,15 +89709,15 @@ const ErrorBanner = ({ errors, setErrors, vscodeAPI }) => {
89633
89709
  const extensionAPI = useExtensionAPI();
89634
89710
  return /* @__PURE__ */ jsx(StorageWarningBanner, { extensionAPI, vscodeAPI });
89635
89711
  }
89636
- return /* @__PURE__ */ jsx("div", { className: styles$l.errorContainer, children: errors.map((error2, i) => (
89712
+ return /* @__PURE__ */ jsx("div", { className: styles$m.errorContainer, children: errors.map((error2, i) => (
89637
89713
  // biome-ignore lint/suspicious/noArrayIndexKey: error strings might not be unique, so we have no natural id
89638
- /* @__PURE__ */ jsxs("div", { className: styles$l.error, children: [
89714
+ /* @__PURE__ */ jsxs("div", { className: styles$m.error, children: [
89639
89715
  /* @__PURE__ */ jsx("span", { children: error2 }),
89640
89716
  /* @__PURE__ */ jsx(
89641
89717
  "button",
89642
89718
  {
89643
89719
  type: "button",
89644
- className: styles$l.closeBtn,
89720
+ className: styles$m.closeBtn,
89645
89721
  onClick: () => setErrors(errors.filter((e2) => e2 !== error2)),
89646
89722
  children: "×"
89647
89723
  }
@@ -89678,7 +89754,8 @@ function getAppWrappers({
89678
89754
  telemetryRecorder,
89679
89755
  config,
89680
89756
  clientConfig,
89681
- staticDefaultContext
89757
+ staticDefaultContext,
89758
+ uiConfiguration
89682
89759
  }) {
89683
89760
  return [
89684
89761
  {
@@ -89700,6 +89777,10 @@ function getAppWrappers({
89700
89777
  {
89701
89778
  component: LinkOpenerProvider,
89702
89779
  props: { vscodeAPI }
89780
+ },
89781
+ {
89782
+ component: UIConfigurationProvider,
89783
+ props: { value: uiConfiguration }
89703
89784
  }
89704
89785
  ];
89705
89786
  }
@@ -90004,6 +90085,7 @@ const CodyWebChat = ({
90004
90085
  agentConfig,
90005
90086
  initialContext,
90006
90087
  className,
90088
+ portalContainer,
90007
90089
  onExternalApiReady,
90008
90090
  controller,
90009
90091
  viewType
@@ -90032,6 +90114,7 @@ const CodyWebChat = ({
90032
90114
  vscodeAPI: agent2.vscodeAPI,
90033
90115
  initialContext,
90034
90116
  className: styles$2.container,
90117
+ portalContainer,
90035
90118
  onExternalApiReady,
90036
90119
  webview: viewType === "page" ? "editor" : "sidebar",
90037
90120
  controller
@@ -90043,6 +90126,7 @@ const CodyWebPanel = (props) => {
90043
90126
  vscodeAPI,
90044
90127
  initialContext: initialContextData,
90045
90128
  className,
90129
+ portalContainer,
90046
90130
  onExternalApiReady,
90047
90131
  webview,
90048
90132
  controller
@@ -90074,7 +90158,7 @@ const CodyWebPanel = (props) => {
90074
90158
  break;
90075
90159
  case "history.download": {
90076
90160
  if (extensionApiRef.current) {
90077
- downloadChatHistory(extensionApiRef.current);
90161
+ void downloadChatHistory(extensionApiRef.current);
90078
90162
  }
90079
90163
  break;
90080
90164
  }
@@ -90229,9 +90313,10 @@ const CodyWebPanel = (props) => {
90229
90313
  telemetryRecorder,
90230
90314
  config,
90231
90315
  clientConfig,
90232
- staticDefaultContext
90316
+ staticDefaultContext,
90317
+ uiConfiguration: { portalContainer }
90233
90318
  }),
90234
- [vscodeAPI, telemetryRecorder, config, clientConfig, staticDefaultContext]
90319
+ [vscodeAPI, telemetryRecorder, config, clientConfig, staticDefaultContext, portalContainer]
90235
90320
  );
90236
90321
  const CONTEXT_MENTIONS_SETTINGS = useMemo$1(() => {
90237
90322
  const { repository } = initialContextData ?? {};
@@ -90290,17 +90375,15 @@ const CodyWebPanel = (props) => {
90290
90375
  }
90291
90376
  ) }) }) });
90292
90377
  };
90293
- const root = "_root_n2nil_6";
90294
- const container = "_container_n2nil_14";
90295
- const editor = "_editor_n2nil_28";
90296
- const toolbar = "_toolbar_n2nil_34";
90297
- const focused = "_focused_n2nil_39";
90298
- const editorContentEditable = "_editor-content-editable_n2nil_41";
90378
+ const root = "_root_65pir_1";
90379
+ const container = "_container_65pir_11";
90380
+ const editor = "_editor_65pir_25";
90381
+ const focused = "_focused_65pir_31";
90382
+ const editorContentEditable = "_editor-content-editable_65pir_32";
90299
90383
  const styles = {
90300
90384
  root,
90301
90385
  container,
90302
90386
  editor,
90303
- toolbar,
90304
90387
  focused,
90305
90388
  editorContentEditable
90306
90389
  };
@@ -90314,6 +90397,7 @@ const CodyPromptTemplate = ({
90314
90397
  disabled: disabled2,
90315
90398
  initialEditorState,
90316
90399
  placeholder: placeholder2,
90400
+ portalContainer,
90317
90401
  onEditorApiReady
90318
90402
  }) => {
90319
90403
  const agent2 = useCodyWebAgent(agentConfig);
@@ -90334,6 +90418,7 @@ const CodyPromptTemplate = ({
90334
90418
  return /* @__PURE__ */ jsx(AppWrapper, { children: /* @__PURE__ */ jsx("div", { className: classNames(className, styles.root), children: /* @__PURE__ */ jsx(
90335
90419
  CodyPromptTemplatePanel,
90336
90420
  {
90421
+ portalContainer,
90337
90422
  vscodeAPI: agent2.vscodeAPI,
90338
90423
  className: styles.container,
90339
90424
  disabled: disabled2,
@@ -90344,7 +90429,15 @@ const CodyPromptTemplate = ({
90344
90429
  ) }) });
90345
90430
  };
90346
90431
  const CodyPromptTemplatePanel = (props) => {
90347
- const { vscodeAPI, className, disabled: disabled2, initialEditorState, placeholder: placeholder2, onEditorApiReady } = props;
90432
+ const {
90433
+ vscodeAPI,
90434
+ className,
90435
+ disabled: disabled2,
90436
+ initialEditorState,
90437
+ placeholder: placeholder2,
90438
+ portalContainer,
90439
+ onEditorApiReady
90440
+ } = props;
90348
90441
  const dispatchClientAction = useClientActionDispatcher();
90349
90442
  const [clientConfig, setClientConfig] = useState$1(null);
90350
90443
  const editorRef = useRef$1(null);
@@ -90377,9 +90470,10 @@ const CodyPromptTemplatePanel = (props) => {
90377
90470
  telemetryRecorder,
90378
90471
  config: null,
90379
90472
  clientConfig,
90380
- staticDefaultContext
90473
+ staticDefaultContext,
90474
+ uiConfiguration: { portalContainer }
90381
90475
  }),
90382
- [vscodeAPI, telemetryRecorder, clientConfig, staticDefaultContext]
90476
+ [vscodeAPI, telemetryRecorder, clientConfig, staticDefaultContext, portalContainer]
90383
90477
  );
90384
90478
  const CONTEXT_MENTIONS_SETTINGS = useMemo$1(() => {
90385
90479
  return {
@@ -90402,7 +90496,8 @@ const CodyPromptTemplatePanel = (props) => {
90402
90496
  contextWindowSizeInTokens: 4096,
90403
90497
  editorClassName: styles.editor,
90404
90498
  contentEditableClassName: styles.editorContentEditable,
90405
- openExternalLink
90499
+ openExternalLink,
90500
+ mentionPortalContainer: portalContainer
90406
90501
  }
90407
90502
  ) }) }) });
90408
90503
  };