@bikdotai/bik-component-library 0.0.871 → 0.0.872

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js +5 -5
  2. package/dist/cjs/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  3. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +5 -5
  4. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/MentionPicker.js +27 -27
  6. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  7. package/dist/cjs/components/agent-builder/components/SelectableListSection.js +6 -6
  8. package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
  9. package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
  10. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
  11. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
  12. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  13. package/dist/cjs/components/agent-builder/utils/sourceGrouping.js +2 -0
  14. package/dist/cjs/components/agent-builder/utils/sourceGrouping.js.map +1 -0
  15. package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
  16. package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -1
  17. package/dist/cjs/components/agent-builder/utils/toolActions.js +1 -1
  18. package/dist/cjs/components/agent-builder/utils/toolActions.js.map +1 -1
  19. package/dist/cjs/icons/Social/Channels/Aftership.js +2 -0
  20. package/dist/cjs/icons/Social/Channels/Aftership.js.map +1 -0
  21. package/dist/cjs/icons/Social/Channels/Attentive.js +2 -0
  22. package/dist/cjs/icons/Social/Channels/Attentive.js.map +1 -0
  23. package/dist/cjs/icons/Social/Channels/Freshdesk.js +2 -0
  24. package/dist/cjs/icons/Social/Channels/Freshdesk.js.map +1 -0
  25. package/dist/cjs/icons/Social/Channels/GoogleSheets.js +2 -0
  26. package/dist/cjs/icons/Social/Channels/GoogleSheets.js.map +1 -0
  27. package/dist/cjs/icons/Social/Channels/Klavyio.js +2 -0
  28. package/dist/cjs/icons/Social/Channels/Klavyio.js.map +1 -0
  29. package/dist/cjs/icons/Social/Channels/Kustomer.js +2 -0
  30. package/dist/cjs/icons/Social/Channels/Kustomer.js.map +1 -0
  31. package/dist/cjs/icons/Social/Channels/Mailchimp.js +2 -0
  32. package/dist/cjs/icons/Social/Channels/Mailchimp.js.map +1 -0
  33. package/dist/cjs/icons/Social/Channels/OmniSend.js +2 -0
  34. package/dist/cjs/icons/Social/Channels/OmniSend.js.map +1 -0
  35. package/dist/cjs/icons/Social/Channels/Segment.js +2 -0
  36. package/dist/cjs/icons/Social/Channels/Segment.js.map +1 -0
  37. package/dist/cjs/icons/Social/Channels/ShipBob.js +2 -0
  38. package/dist/cjs/icons/Social/Channels/ShipBob.js.map +1 -0
  39. package/dist/cjs/icons/Social/Channels/Skio.js +1 -1
  40. package/dist/cjs/icons/Social/Channels/Skio.js.map +1 -1
  41. package/dist/cjs/icons/index.js +1 -1
  42. package/dist/esm/components/agent-builder/__fixtures__/integrationCatalog.d.ts +17 -0
  43. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js +104 -96
  44. package/dist/esm/components/agent-builder/components/ConfigToolPanel.js.map +1 -1
  45. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +256 -242
  46. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  47. package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +0 -10
  48. package/dist/esm/components/agent-builder/components/MentionPicker.js +201 -199
  49. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  50. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +9 -0
  51. package/dist/esm/components/agent-builder/components/SelectableListSection.js +213 -188
  52. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  53. package/dist/esm/components/agent-builder/constants/tools.d.ts +46 -22
  54. package/dist/esm/components/agent-builder/constants/tools.js +86 -35
  55. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  56. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +289 -279
  57. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  58. package/dist/esm/components/agent-builder/utils/sourceGrouping.d.ts +39 -0
  59. package/dist/esm/components/agent-builder/utils/sourceGrouping.js +14 -0
  60. package/dist/esm/components/agent-builder/utils/sourceGrouping.js.map +1 -0
  61. package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +6 -4
  62. package/dist/esm/components/agent-builder/utils/sourceIcons.js +64 -33
  63. package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
  64. package/dist/esm/components/agent-builder/utils/toolActions.d.ts +11 -6
  65. package/dist/esm/components/agent-builder/utils/toolActions.js +23 -16
  66. package/dist/esm/components/agent-builder/utils/toolActions.js.map +1 -1
  67. package/dist/esm/icons/Social/Channels/Aftership.d.ts +6 -0
  68. package/dist/esm/icons/Social/Channels/Aftership.js +47 -0
  69. package/dist/esm/icons/Social/Channels/Aftership.js.map +1 -0
  70. package/dist/esm/icons/Social/Channels/Attentive.d.ts +6 -0
  71. package/dist/esm/icons/Social/Channels/Attentive.js +54 -0
  72. package/dist/esm/icons/Social/Channels/Attentive.js.map +1 -0
  73. package/dist/esm/icons/Social/Channels/Freshdesk.d.ts +6 -0
  74. package/dist/esm/icons/Social/Channels/Freshdesk.js +47 -0
  75. package/dist/esm/icons/Social/Channels/Freshdesk.js.map +1 -0
  76. package/dist/esm/icons/Social/Channels/GoogleSheets.d.ts +6 -0
  77. package/dist/esm/icons/Social/Channels/GoogleSheets.js +53 -0
  78. package/dist/esm/icons/Social/Channels/GoogleSheets.js.map +1 -0
  79. package/dist/esm/icons/Social/Channels/Klavyio.d.ts +6 -0
  80. package/dist/esm/icons/Social/Channels/Klavyio.js +47 -0
  81. package/dist/esm/icons/Social/Channels/Klavyio.js.map +1 -0
  82. package/dist/esm/icons/Social/Channels/Kustomer.d.ts +6 -0
  83. package/dist/esm/icons/Social/Channels/Kustomer.js +68 -0
  84. package/dist/esm/icons/Social/Channels/Kustomer.js.map +1 -0
  85. package/dist/esm/icons/Social/Channels/Mailchimp.d.ts +6 -0
  86. package/dist/esm/icons/Social/Channels/Mailchimp.js +31 -0
  87. package/dist/esm/icons/Social/Channels/Mailchimp.js.map +1 -0
  88. package/dist/esm/icons/Social/Channels/OmniSend.d.ts +6 -0
  89. package/dist/esm/icons/Social/Channels/OmniSend.js +47 -0
  90. package/dist/esm/icons/Social/Channels/OmniSend.js.map +1 -0
  91. package/dist/esm/icons/Social/Channels/Segment.d.ts +6 -0
  92. package/dist/esm/icons/Social/Channels/Segment.js +53 -0
  93. package/dist/esm/icons/Social/Channels/Segment.js.map +1 -0
  94. package/dist/esm/icons/Social/Channels/ShipBob.d.ts +6 -0
  95. package/dist/esm/icons/Social/Channels/ShipBob.js +28 -0
  96. package/dist/esm/icons/Social/Channels/ShipBob.js.map +1 -0
  97. package/dist/esm/icons/Social/Channels/Skio.js +41 -19
  98. package/dist/esm/icons/Social/Channels/Skio.js.map +1 -1
  99. package/dist/esm/icons/Social/Channels/Zendesk.d.ts +6 -0
  100. package/dist/esm/icons/Social/Channels/index.d.ts +10 -0
  101. package/dist/esm/icons/index.d.ts +26 -25
  102. package/dist/esm/icons/index.js +658 -638
  103. package/dist/esm/icons/index.js.map +1 -1
  104. package/package.json +1 -1
@@ -1,262 +1,264 @@
1
- import { jsxs as x, jsx as c, Fragment as ce } from "react/jsx-runtime";
1
+ import { jsxs as x, jsx as a, Fragment as ce } from "react/jsx-runtime";
2
2
  import se from "../../../assets/icons/chevronRight.svg.js";
3
3
  import de from "../../../assets/icons/searchIcon.svg.js";
4
4
  import ue from "../../../icons/Arrows/Normal arrows/ArrowLeft.js";
5
- import { useState as z, useMemo as I, useEffect as j, useRef as he } from "react";
6
- import u from "styled-components";
5
+ import { useState as D, useMemo as I, useEffect as V, useRef as he } from "react";
6
+ import h from "styled-components";
7
7
  import { TitleSmall as pe, BodySecondary as fe, BodyCaption as ge } from "../../TypographyStyle.js";
8
8
  import { COLORS as o } from "../../../constants/Theme.js";
9
9
  import { PickerType as be } from "../../variable-picker-v3/model.js";
10
- import { CATEGORIES as me, MORE_INTEGRATIONS_KEY as v, isMoreIntegrationSource as q, toolSourceRank as Y, MORE_INTEGRATIONS_LABEL as te, isIntegrationSource as ke, CONFIG_TOOL_SOURCES as xe, MORE_INTEGRATIONS_RANK as ve } from "../constants/tools.js";
11
- import { toolSourceLabel as H } from "../utils/mentionSerialization.js";
12
- import { renderSourceIcon as re, sourceIcon as D } from "../utils/sourceIcons.js";
13
- import we from "../../../icons/Informational/Identity/PuzzlePiece.js";
14
- import { VariablePicker as ye } from "../../variable-picker-v3/VariablePicker.js";
15
- import ne from "../../../icons/Informational/Common UI/Shield.js";
16
- const oe = {
17
- Icon: we,
18
- w: 20,
19
- h: 20
20
- }, b = (s) => s.meta, A = (s) => b(s)?.plainLabel ?? s.label, Ie = "__bik_create_subagent__", Ze = ({
21
- items: s,
22
- onSelect: C,
23
- registerKeyHandler: $,
24
- onClose: w,
10
+ import { CATEGORIES as me, INTEGRATIONS_KEY as k, toolSourceRank as xe, INTEGRATIONS_LABEL as Z, isIntegrationSource as ke, CONFIG_TOOL_SOURCES as ve, INTEGRATIONS_RANK as ye } from "../constants/tools.js";
11
+ import { toolSourceLabel as j } from "../utils/mentionSerialization.js";
12
+ import { partitionSources as we, isUnconnectedSource as Ie } from "../utils/sourceGrouping.js";
13
+ import { INTEGRATIONS_ICON as ee, renderSourceIcon as te, sourceIcon as M } from "../utils/sourceIcons.js";
14
+ import { VariablePicker as Re } from "../../variable-picker-v3/VariablePicker.js";
15
+ import re from "../../../icons/Informational/Common UI/Shield.js";
16
+ const g = (c) => c.meta, A = (c) => g(c)?.plainLabel ?? c.label, Se = "__bik_create_subagent__", Ae = 5, nt = ({
17
+ items: c,
18
+ onSelect: E,
19
+ registerKeyHandler: C,
20
+ onClose: v,
25
21
  onCreateSubAgent: R,
26
- initialSource: J,
22
+ initialSource: H,
27
23
  toolActions: y,
28
- integrationStatus: K,
29
- onConnectIntegration: Q,
24
+ integrationStatus: $,
25
+ onConnectIntegration: K,
30
26
  appLabel: B,
31
27
  variablesData: G,
32
- onSelectVariable: F
28
+ onSelectVariable: U
33
29
  }) => {
34
- const [ie, O] = z(null), [i, S] = z(J ?? null), [T, m] = z(-1), [E, W] = z(""), k = I(
35
- () => s.filter((e) => b(e)?.kind === "tool"),
36
- [s]
37
- ), L = I(
38
- () => s.filter((e) => b(e)?.kind === "subagent"),
39
- [s]
40
- ), U = I(() => {
30
+ const [ne, T] = D(null), [i, S] = D(H ?? null), [L, b] = D(-1), [w, W] = D(""), m = I(
31
+ () => c.filter((e) => g(e)?.kind === "tool"),
32
+ [c]
33
+ ), O = I(
34
+ () => c.filter((e) => g(e)?.kind === "subagent"),
35
+ [c]
36
+ ), F = I(() => {
41
37
  const e = [];
42
- return k.forEach((n) => {
43
- const f = b(n)?.source ?? "other";
44
- e.includes(f) || e.push(f);
38
+ return m.forEach((n) => {
39
+ const t = g(n)?.source ?? "other";
40
+ e.includes(t) || e.push(t);
45
41
  }), e;
46
- }, [k]), V = I(
47
- () => new Map(
48
- (y ?? []).map((e) => [e.source, e])
49
- ),
50
- [y]
51
- ), _ = I(
52
- () => me.filter((e) => e.key === "tool" ? k.length > 0 || (y?.length ?? 0) > 0 : e.key === "variable" ? (G?.length ?? 0) > 0 && !!F : L.length > 0 || !!R),
42
+ }, [m]), _ = I(() => {
43
+ const e = /* @__PURE__ */ new Map();
44
+ return (y ?? []).forEach((n) => {
45
+ const t = e.get(n.source);
46
+ t ? t.push(n) : e.set(n.source, [n]);
47
+ }), e;
48
+ }, [y]), N = I(
49
+ () => me.filter((e) => e.key === "tool" ? m.length > 0 || (y?.length ?? 0) > 0 : e.key === "variable" ? (G?.length ?? 0) > 0 && !!U : O.length > 0 || !!R),
53
50
  [
54
- k.length,
55
- L.length,
51
+ m.length,
52
+ O.length,
56
53
  R,
57
54
  y?.length,
58
55
  G?.length,
59
- F
56
+ U
60
57
  ]
61
- ), P = _.length === 1 ? _[0].key : null, a = ie ?? P, h = a ? a === "subagent" ? (
58
+ ), P = N.length === 1 ? N[0].key : null, l = ne ?? P, p = l ? l === "subagent" ? (
62
59
  // Always titled — with a back arrow only when the category chooser is above.
63
60
  {
64
61
  title: "Sub-agent",
65
- onBack: P ? void 0 : () => O(null)
62
+ onBack: P ? void 0 : () => T(null)
66
63
  }
67
- ) : a === "variable" ? {
64
+ ) : l === "variable" ? {
68
65
  title: "Variables",
69
- onBack: P ? void 0 : () => O(null)
70
- } : i === v ? {
71
- title: te,
66
+ onBack: P ? void 0 : () => T(null)
67
+ } : i === k ? {
68
+ title: Z,
72
69
  onBack: () => S(null),
73
- icon: oe
70
+ icon: ee
74
71
  } : i ? {
75
- title: H(i, B),
72
+ title: j(i, B),
76
73
  // Deep-linked to a source (opened from a right-panel source button):
77
- // that source IS the root, so no back arrow. Otherwise back returns to
78
- // the "More Integrations" umbrella for a vendor that lives under it,
79
- // else to the source chooser.
80
- onBack: J ? void 0 : () => S(
81
- q(i) ? v : null
74
+ // that source IS the root, so no back arrow. Otherwise back returns
75
+ // where the row was: the "Integrations" umbrella for a source the store
76
+ // hasn't connected, else the source chooser.
77
+ onBack: H ? void 0 : () => S(
78
+ Ie(i, $) ? k : null
82
79
  ),
83
- icon: D(i)
80
+ icon: M(i)
84
81
  } : (
85
82
  // Always titled — matches the Sub-agent header; back arrow only when the
86
83
  // category chooser is above (i.e. not the sole category).
87
84
  {
88
85
  title: "Tools",
89
- onBack: P ? void 0 : () => O(null)
86
+ onBack: P ? void 0 : () => T(null)
90
87
  }
91
- ) : null, d = I(() => {
92
- if (!a)
93
- return _.map((r) => ({
94
- id: r.key,
95
- label: r.label,
88
+ ) : null, s = I(() => {
89
+ if (!l)
90
+ return N.map((t) => ({
91
+ id: t.key,
92
+ label: t.label,
96
93
  drillsIn: !0,
97
94
  onActivate: () => {
98
- O(r.key), S(null);
95
+ T(t.key), S(null);
99
96
  }
100
97
  }));
101
- if (a === "subagent") {
102
- const r = E.trim().toLowerCase(), p = L.filter((g) => !r || A(g).toLowerCase().includes(r)).map((g) => ({
103
- id: String(g.id),
104
- label: A(g),
98
+ if (l === "subagent") {
99
+ const t = w.trim().toLowerCase(), f = O.filter((u) => !t || A(u).toLowerCase().includes(t)).map((u) => ({
100
+ id: String(u.id),
101
+ label: A(u),
105
102
  drillsIn: !1,
106
- onActivate: () => C(g)
103
+ onActivate: () => E(u)
107
104
  }));
108
- return R && p.push({
109
- id: Ie,
105
+ return R && f.push({
106
+ id: Se,
110
107
  label: "Create new",
111
108
  drillsIn: !1,
112
109
  isCreate: !0,
113
110
  onActivate: () => {
114
- w?.(), R();
111
+ v?.(), R();
115
112
  }
116
- }), p;
113
+ }), f;
117
114
  }
118
- if (a === "variable")
115
+ if (l === "variable")
119
116
  return [];
120
- if (!i || i === v) {
121
- const r = (y ?? []).map((t) => t.source).filter((t) => !U.includes(t)), p = [...U, ...r], g = (t) => {
122
- const l = V.get(t);
123
- if ((l !== void 0 ? l.connected : K?.[t]) === !1)
117
+ if (!i || i === k) {
118
+ const t = Array.from(
119
+ new Set((y ?? []).map((r) => r.source))
120
+ ).filter((r) => !F.includes(r)), f = [...F, ...t], u = (r) => {
121
+ const d = _.get(r)?.[0];
122
+ if ((d !== void 0 ? d.connected : $?.[r]) === !1)
124
123
  return {
125
- id: t,
126
- label: H(t, B),
124
+ id: r,
125
+ label: j(r, B),
127
126
  drillsIn: !1,
128
- icon: D(t) ?? l?.icon,
127
+ icon: M(r) ?? d?.icon,
129
128
  rightLabel: "Connect",
130
129
  onActivate: () => {
131
- w?.(), l?.onConnect ? l.onConnect() : Q?.(t);
130
+ v?.(), d?.onConnect ? d.onConnect() : K?.(r);
132
131
  }
133
132
  };
134
- const ee = k.filter(
135
- (N) => (b(N)?.source ?? "other") === t
136
- );
137
- if (ee.length + (l ? 1 : 0) === 1 && !(l === void 0 && ke(t))) {
138
- const N = D(t) ?? l?.icon;
139
- if (l)
133
+ const X = m.filter(
134
+ (q) => (g(q)?.source ?? "other") === r
135
+ ), ae = (_.get(r) ?? []).length;
136
+ if (X.length + ae === 1 && !(d === void 0 && ke(r))) {
137
+ const q = M(r) ?? d?.icon;
138
+ if (d)
140
139
  return {
141
- id: t,
142
- label: l.label,
140
+ id: r,
141
+ label: d.label,
143
142
  drillsIn: !1,
144
- icon: N,
143
+ icon: q,
145
144
  onActivate: () => {
146
- w?.(), l.onSelect();
145
+ v?.(), d.onSelect();
147
146
  }
148
147
  };
149
- const M = ee[0];
148
+ const z = X[0];
150
149
  return {
151
- id: String(M.id),
152
- label: A(M),
150
+ id: String(z.id),
151
+ label: A(z),
153
152
  drillsIn: !1,
154
- icon: N,
155
- authRequired: b(M)?.authRequired,
156
- onActivate: () => C(M)
153
+ icon: q,
154
+ authRequired: g(z)?.authRequired,
155
+ onActivate: () => E(z)
157
156
  };
158
157
  }
159
158
  return {
160
- id: t,
161
- label: H(t, B),
159
+ id: r,
160
+ label: j(r, B),
162
161
  drillsIn: !0,
163
- icon: D(t) ?? l?.icon,
164
- onActivate: () => S(t)
162
+ icon: M(r) ?? d?.icon,
163
+ onActivate: () => S(r)
165
164
  };
166
- };
167
- if (i === v)
168
- return p.filter((t) => q(t)).sort((t, l) => Y(t) - Y(l)).map(g);
169
- const Z = p.filter((t) => !q(t)).map((t) => ({ row: g(t), rank: Y(t) }));
170
- return p.some((t) => q(t)) && Z.push({
171
- rank: ve,
165
+ }, { outside: le, inside: J } = we(f, $);
166
+ if (i === k)
167
+ return J.map(u);
168
+ const Q = le.map(
169
+ (r) => ({ row: u(r), rank: xe(r) })
170
+ );
171
+ return J.length > 0 && Q.push({
172
+ rank: ye,
172
173
  row: {
173
- id: v,
174
- label: te,
174
+ id: k,
175
+ label: Z,
175
176
  drillsIn: !0,
176
- icon: oe,
177
- onActivate: () => S(v)
177
+ icon: ee,
178
+ onActivate: () => S(k)
178
179
  }
179
- }), Z.sort((t, l) => t.rank - l.rank).map((t) => t.row);
180
+ }), Q.sort((r, d) => r.rank - d.rank).map((r) => r.row);
180
181
  }
181
- const e = E.trim().toLowerCase(), n = k.filter((r) => (b(r)?.source ?? "other") === i).filter((r) => !e || A(r).toLowerCase().includes(e)).map((r) => ({
182
- id: String(r.id),
183
- label: A(r),
182
+ const e = w.trim().toLowerCase(), n = m.filter((t) => (g(t)?.source ?? "other") === i).filter((t) => !e || A(t).toLowerCase().includes(e)).map((t) => ({
183
+ id: String(t.id),
184
+ label: A(t),
184
185
  drillsIn: !1,
185
- authRequired: b(r)?.authRequired,
186
- onActivate: () => C(r)
187
- })), f = V.get(i);
188
- if (f) {
189
- const r = i in xe;
186
+ authRequired: g(t)?.authRequired,
187
+ onActivate: () => E(t)
188
+ }));
189
+ return (_.get(i) ?? []).forEach((t) => {
190
+ const f = i in ve;
190
191
  n.push({
191
- id: `create:${i}`,
192
- label: f.label,
192
+ // A source with several config tools gets one row each, so the key
193
+ // carries the tool it opens.
194
+ id: `create:${i}:${t.toolKey ?? ""}`,
195
+ label: t.label,
193
196
  drillsIn: !1,
194
- isCreate: !r,
197
+ isCreate: !f,
195
198
  onActivate: () => {
196
- w?.(), f.onSelect();
199
+ v?.(), t.onSelect();
197
200
  }
198
201
  });
199
- }
200
- return n;
202
+ }), n;
201
203
  }, [
202
- a,
203
- _,
204
+ l,
205
+ N,
204
206
  i,
205
- E,
206
- k,
207
- L,
208
- U,
209
- C,
210
207
  w,
208
+ m,
209
+ O,
210
+ F,
211
+ E,
212
+ v,
211
213
  R,
212
214
  y,
213
- V,
215
+ _,
216
+ $,
214
217
  K,
215
- Q,
216
218
  B
217
219
  ]);
218
- j(() => m(-1), [a, i, E, s]), j(() => W(""), [a, i]);
219
- const X = he({ rows: d, activeIndex: T, header: h });
220
- X.current = { rows: d, activeIndex: T, header: h }, j(() => {
221
- if ($)
222
- return $((e) => {
223
- const { rows: n, activeIndex: f, header: r } = X.current;
220
+ V(() => b(-1), [l, i, w, c]), V(() => W(""), [l, i]);
221
+ const Y = he({ rows: s, activeIndex: L, header: p });
222
+ Y.current = { rows: s, activeIndex: L, header: p }, V(() => {
223
+ if (C)
224
+ return C((e) => {
225
+ const { rows: n, activeIndex: t, header: f } = Y.current;
224
226
  if (!n.length && e.key !== "ArrowLeft")
225
227
  return !1;
226
228
  switch (e.key) {
227
229
  case "ArrowDown":
228
- return m((p) => (p + 1) % n.length), !0;
230
+ return b((u) => (u + 1) % n.length), !0;
229
231
  case "ArrowUp":
230
- return m((p) => (p + n.length - 1) % n.length), !0;
232
+ return b((u) => (u + n.length - 1) % n.length), !0;
231
233
  case "ArrowRight":
232
234
  case "Enter":
233
- return (n[f] ?? n[0])?.onActivate(), !0;
235
+ return (n[t] ?? n[0])?.onActivate(), !0;
234
236
  case "ArrowLeft":
235
- return r?.onBack ? (r.onBack(), !0) : !1;
237
+ return f?.onBack ? (f.onBack(), !0) : !1;
236
238
  default:
237
239
  return !1;
238
240
  }
239
- }), () => $(null);
240
- }, [$]);
241
- const le = a ? d.length && !d[0].drillsIn ? "items" : "sources" : "categories", ae = a === "tool" && !!i && i !== v || a === "subagent";
241
+ }), () => C(null);
242
+ }, [C]);
243
+ const oe = l ? s.length && !s[0].drillsIn ? "items" : "sources" : "categories", ie = (l === "tool" && !!i && i !== k || l === "subagent") && (s.length >= Ae || w.trim().length > 0);
242
244
  return /* @__PURE__ */ x(
243
- Re,
245
+ Ee,
244
246
  {
245
- className: `bik-mention-picker bik-mention-picker--${le}`,
246
- $fixedHeight: a === "variable",
247
+ className: `bik-mention-picker bik-mention-picker--${oe}`,
248
+ $fixedHeight: l === "variable",
247
249
  children: [
248
- h && /* @__PURE__ */ x(
249
- _e,
250
+ p && /* @__PURE__ */ x(
251
+ qe,
250
252
  {
251
253
  type: "button",
252
- onClick: h.onBack,
253
- disabled: !h.onBack,
254
+ onClick: p.onBack,
255
+ disabled: !p.onBack,
254
256
  style: {
255
257
  background: o.surface.subdued,
256
- cursor: h.onBack ? "pointer" : "default"
258
+ cursor: p.onBack ? "pointer" : "default"
257
259
  },
258
260
  children: [
259
- h.onBack && /* @__PURE__ */ c(
261
+ p.onBack && /* @__PURE__ */ a(
260
262
  ue,
261
263
  {
262
264
  width: 20,
@@ -264,16 +266,16 @@ const oe = {
264
266
  color: o.content.primary
265
267
  }
266
268
  ),
267
- h.icon && re(h.icon),
269
+ p.icon && te(p.icon),
268
270
  /* @__PURE__ */ x(pe, { children: [
269
271
  " ",
270
- h.title
272
+ p.title
271
273
  ] })
272
274
  ]
273
275
  }
274
276
  ),
275
- ae && /* @__PURE__ */ x(Ae, { children: [
276
- /* @__PURE__ */ c(
277
+ ie && /* @__PURE__ */ x(Be, { children: [
278
+ /* @__PURE__ */ a(
277
279
  de,
278
280
  {
279
281
  width: 20,
@@ -281,84 +283,84 @@ const oe = {
281
283
  color: o.content.placeholder
282
284
  }
283
285
  ),
284
- /* @__PURE__ */ c(
285
- Ce,
286
+ /* @__PURE__ */ a(
287
+ Te,
286
288
  {
287
289
  autoFocus: !0,
288
- value: E,
290
+ value: w,
289
291
  placeholder: "Search",
290
292
  "data-test": "mention-picker-search",
291
293
  onChange: (e) => W(e.target.value),
292
294
  onKeyDown: (e) => {
293
- d.length && (e.key === "ArrowDown" ? (e.preventDefault(), m((n) => (n + 1) % d.length)) : e.key === "ArrowUp" ? (e.preventDefault(), m((n) => (n + d.length - 1) % d.length)) : e.key === "Enter" && (e.preventDefault(), (d[T] ?? d[0])?.onActivate()));
295
+ s.length && (e.key === "ArrowDown" ? (e.preventDefault(), b((n) => (n + 1) % s.length)) : e.key === "ArrowUp" ? (e.preventDefault(), b((n) => (n + s.length - 1) % s.length)) : e.key === "Enter" && (e.preventDefault(), (s[L] ?? s[0])?.onActivate()));
294
296
  }
295
297
  }
296
298
  )
297
299
  ] }),
298
- a === "variable" ? (
300
+ l === "variable" ? (
299
301
  // Shared variable catalog, embedded as this drill-in view. The fill
300
302
  // wrapper hands it the remaining card height, so ITS search bar stays
301
303
  // fixed and only the variable list below scrolls. Selecting a
302
304
  // variable dismisses the menu FIRST (strips the typed "@" + query),
303
305
  // then hands the variable up to insert its `{{token}}` at the cursor.
304
- /* @__PURE__ */ c(Ee, { children: /* @__PURE__ */ c(
305
- ye,
306
+ /* @__PURE__ */ a($e, { children: /* @__PURE__ */ a(
307
+ Re,
306
308
  {
307
309
  type: be.EMBEDDED,
308
310
  data: G ?? [],
309
311
  showRecommendedBar: !0,
310
312
  skipDefaultVariableContent: !0,
311
313
  onSelect: (e) => {
312
- w?.(), F?.(e);
314
+ v?.(), U?.(e);
313
315
  }
314
316
  }
315
317
  ) })
316
- ) : d.length === 0 ? /* @__PURE__ */ c(Pe, { children: a === "subagent" ? null : "No tools available" }) : /* @__PURE__ */ c(Se, { children: d.map((e, n) => /* @__PURE__ */ c(
317
- $e,
318
+ ) : s.length === 0 ? /* @__PURE__ */ a(ze, { children: l === "subagent" ? null : "No tools available" }) : /* @__PURE__ */ a(Ce, { children: s.map((e, n) => /* @__PURE__ */ a(
319
+ Le,
318
320
  {
319
321
  type: "button",
320
- $active: n === T,
321
- onMouseEnter: () => m(n),
322
- onMouseLeave: () => m(-1),
322
+ $active: n === L,
323
+ onMouseEnter: () => b(n),
324
+ onMouseLeave: () => b(-1),
323
325
  onClick: e.onActivate,
324
- children: e.isCreate ? /* @__PURE__ */ c(Le, { children: e.label }) : /* @__PURE__ */ x(ce, { children: [
325
- /* @__PURE__ */ x(Be, { children: [
326
- re(e.icon),
327
- /* @__PURE__ */ c(fe, { color: o.content.primary, children: e.label }),
328
- e.authRequired && /* @__PURE__ */ c(
329
- ne,
326
+ children: e.isCreate ? /* @__PURE__ */ a(Pe, { children: e.label }) : /* @__PURE__ */ x(ce, { children: [
327
+ /* @__PURE__ */ x(Oe, { children: [
328
+ te(e.icon),
329
+ /* @__PURE__ */ a(fe, { color: o.content.primary, children: e.label }),
330
+ e.authRequired && /* @__PURE__ */ a(
331
+ re,
330
332
  {
331
333
  size: 14,
332
334
  "aria-label": "Requires customer verification"
333
335
  }
334
336
  )
335
337
  ] }),
336
- e.rightLabel ? /* @__PURE__ */ c(Te, { children: e.rightLabel }) : e.drillsIn && /* @__PURE__ */ c(se, { width: 12, height: 12 })
338
+ e.rightLabel ? /* @__PURE__ */ a(Ne, { children: e.rightLabel }) : e.drillsIn && /* @__PURE__ */ a(se, { width: 12, height: 12 })
337
339
  ] })
338
340
  },
339
341
  e.id
340
342
  )) }),
341
- d.some((e) => e.authRequired) && /* @__PURE__ */ x(Oe, { children: [
342
- /* @__PURE__ */ c(ne, { size: 16 }),
343
- /* @__PURE__ */ c(ge, { color: o.content.secondary, children: "Requires customer verification" })
343
+ s.some((e) => e.authRequired) && /* @__PURE__ */ x(_e, { children: [
344
+ /* @__PURE__ */ a(re, { size: 16 }),
345
+ /* @__PURE__ */ a(ge, { color: o.content.secondary, children: "Requires customer verification" })
344
346
  ] })
345
347
  ]
346
348
  }
347
349
  );
348
- }, Re = u.div`
350
+ }, Ee = h.div`
349
351
  display: flex;
350
352
  flex-direction: column;
351
353
  min-width: 240px;
352
354
  /* Variables view is 45px taller: that is what the embedded picker's "Only
353
355
  Recommended" bar costs, so the variable list keeps the room it had before
354
356
  the bar was turned on (VariablePicker's calculateHeight subtracts it). */
355
- ${(s) => s.$fixedHeight ? "height: 346px;" : "max-height: 301px;"}
357
+ ${(c) => c.$fixedHeight ? "height: 346px;" : "max-height: 301px;"}
356
358
  overflow: hidden;
357
359
  background: ${o.surface.standard};
358
360
  border: 1px solid ${o.stroke.primary};
359
361
  border-radius: 4px;
360
362
  box-shadow: 0px -2px 8px 0px #0000001f;
361
- `, Se = u.div`
363
+ `, Ce = h.div`
362
364
  flex: 1 1 auto;
363
365
  min-height: 0;
364
366
  overflow-y: auto;
@@ -367,7 +369,7 @@ const oe = {
367
369
  &::-webkit-scrollbar {
368
370
  display: none;
369
371
  }
370
- `, Ee = u.div`
372
+ `, $e = h.div`
371
373
  flex: 1 1 auto;
372
374
  min-height: 0;
373
375
 
@@ -382,14 +384,14 @@ const oe = {
382
384
  *::-webkit-scrollbar {
383
385
  display: none;
384
386
  }
385
- `, Ae = u.div`
387
+ `, Be = h.div`
386
388
  display: flex;
387
389
  align-items: center;
388
390
  gap: 8px;
389
391
  padding: 10px 12px;
390
392
  flex-shrink: 0;
391
393
  border-bottom: 1px solid ${o.stroke.primary};
392
- `, Ce = u.input`
394
+ `, Te = h.input`
393
395
  flex: 1;
394
396
  min-width: 0;
395
397
  border: none;
@@ -402,7 +404,7 @@ const oe = {
402
404
  &::placeholder {
403
405
  color: ${o.content.placeholder};
404
406
  }
405
- `, $e = u.button`
407
+ `, Le = h.button`
406
408
  display: flex;
407
409
  justify-content: space-between;
408
410
  align-items: center;
@@ -417,39 +419,39 @@ const oe = {
417
419
  flex-shrink: 0;
418
420
  border: none;
419
421
  border-bottom: 1px solid ${o.stroke.primary};
420
- background: ${(s) => s.$active ? o.surface.subdued : "transparent"};
422
+ background: ${(c) => c.$active ? o.surface.subdued : "transparent"};
421
423
  cursor: pointer;
422
424
  text-align: left;
423
425
 
424
426
  &:hover {
425
427
  background: ${o.surface.hovered};
426
428
  }
427
- `, Be = u.div`
429
+ `, Oe = h.div`
428
430
  display: flex;
429
431
  align-items: center;
430
432
  gap: 12px;
431
433
  min-width: 0;
432
- `, Oe = u.div`
434
+ `, _e = h.div`
433
435
  display: flex;
434
436
  align-items: center;
435
437
  gap: 6px;
436
438
  padding: 8px 12px;
437
439
  border-top: 1px solid ${o.stroke.primary};
438
- `, Te = u.span`
440
+ `, Ne = h.span`
439
441
  flex-shrink: 0;
440
442
  color: ${o.content.brand};
441
443
  font-family: Inter;
442
444
  font-size: 14px;
443
445
  font-weight: 600;
444
446
  white-space: nowrap;
445
- `, Le = u.div`
447
+ `, Pe = h.div`
446
448
  width: 100%;
447
449
  text-align: center;
448
450
  color: ${o.content.brand};
449
451
  font-family: Inter;
450
452
  font-size: 14px;
451
453
  font-weight: 600;
452
- `, _e = u.button`
454
+ `, qe = h.button`
453
455
  display: flex;
454
456
  align-items: center;
455
457
  padding: 12px 16px;
@@ -464,13 +466,13 @@ const oe = {
464
466
  box-sizing: border-box;
465
467
  flex-shrink: 0;
466
468
  gap: 4px;
467
- `, Pe = u.div`
469
+ `, ze = h.div`
468
470
  padding: 12px 10px;
469
471
  font-family: Inter;
470
472
  font-size: 13px;
471
473
  color: ${o.content.secondary};
472
474
  `;
473
475
  export {
474
- Ze as MentionPicker
476
+ nt as MentionPicker
475
477
  };
476
478
  //# sourceMappingURL=MentionPicker.js.map