@bikdotai/bik-component-library 0.0.866 → 0.0.867

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 (137) hide show
  1. package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
  2. package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
  3. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +151 -29
  4. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js +2 -0
  6. package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js.map +1 -0
  7. package/dist/cjs/components/agent-builder/components/ChannelsSection.js +2 -0
  8. package/dist/cjs/components/agent-builder/components/ChannelsSection.js.map +1 -0
  9. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +5 -5
  10. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  11. package/dist/cjs/components/agent-builder/components/GoLiveModal.js +1 -1
  12. package/dist/cjs/components/agent-builder/components/GoLiveModal.js.map +1 -1
  13. package/dist/cjs/components/agent-builder/components/MentionEditor.js +2 -2
  14. package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
  15. package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
  16. package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
  17. package/dist/cjs/components/agent-builder/components/MentionPicker.js +13 -13
  18. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  19. package/dist/cjs/components/agent-builder/components/SelectableListSection.js +3 -3
  20. package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
  21. package/dist/cjs/components/agent-builder/constants/channels.js +2 -0
  22. package/dist/cjs/components/agent-builder/constants/channels.js.map +1 -0
  23. package/dist/cjs/components/agent-builder/constants/steps.js +1 -1
  24. package/dist/cjs/components/agent-builder/constants/steps.js.map +1 -1
  25. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
  26. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  27. package/dist/cjs/components/agent-builder/steps/Step1About.js +1 -1
  28. package/dist/cjs/components/agent-builder/steps/Step1About.js.map +1 -1
  29. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +2 -2
  30. package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  31. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
  32. package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  33. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
  34. package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  35. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +2 -2
  36. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  37. package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
  38. package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -1
  39. package/dist/cjs/icons/Social/Channels/ManifestGlass.js +2 -0
  40. package/dist/cjs/icons/Social/Channels/ManifestGlass.js.map +1 -0
  41. package/dist/cjs/icons/Social/Channels/ShipStation.js +2 -0
  42. package/dist/cjs/icons/Social/Channels/ShipStation.js.map +1 -0
  43. package/dist/cjs/icons/Social/Channels/Skio.js +2 -0
  44. package/dist/cjs/icons/Social/Channels/Skio.js.map +1 -0
  45. package/dist/cjs/icons/index.js +1 -1
  46. package/dist/cjs/index.js +1 -1
  47. package/dist/esm/components/agent-builder/AgentBuilder.js +103 -97
  48. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  49. package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +76 -0
  50. package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +68 -0
  51. package/dist/esm/components/agent-builder/AgentBuilder.styled.js +224 -59
  52. package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  53. package/dist/esm/components/agent-builder/components/ChannelSelectModal.d.ts +26 -0
  54. package/dist/esm/components/agent-builder/components/ChannelSelectModal.js +121 -0
  55. package/dist/esm/components/agent-builder/components/ChannelSelectModal.js.map +1 -0
  56. package/dist/esm/components/agent-builder/components/ChannelsSection.d.ts +10 -0
  57. package/dist/esm/components/agent-builder/components/ChannelsSection.js +183 -0
  58. package/dist/esm/components/agent-builder/components/ChannelsSection.js.map +1 -0
  59. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +135 -132
  60. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  61. package/dist/esm/components/agent-builder/components/GoLiveModal.js +12 -12
  62. package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
  63. package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +2 -0
  64. package/dist/esm/components/agent-builder/components/MentionEditor.js +47 -45
  65. package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
  66. package/dist/esm/components/agent-builder/components/MentionField.js +52 -51
  67. package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
  68. package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +5 -0
  69. package/dist/esm/components/agent-builder/components/MentionPicker.js +134 -132
  70. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  71. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +2 -0
  72. package/dist/esm/components/agent-builder/components/SelectableListSection.js +48 -46
  73. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  74. package/dist/esm/components/agent-builder/constants/channels.d.ts +56 -0
  75. package/dist/esm/components/agent-builder/constants/channels.js +41 -0
  76. package/dist/esm/components/agent-builder/constants/channels.js.map +1 -0
  77. package/dist/esm/components/agent-builder/constants/steps.d.ts +31 -1
  78. package/dist/esm/components/agent-builder/constants/steps.js +15 -6
  79. package/dist/esm/components/agent-builder/constants/steps.js.map +1 -1
  80. package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +13 -1
  81. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +157 -148
  82. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  83. package/dist/esm/components/agent-builder/index.d.ts +5 -2
  84. package/dist/esm/components/agent-builder/steps/Step1About.js +15 -13
  85. package/dist/esm/components/agent-builder/steps/Step1About.js.map +1 -1
  86. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +55 -48
  87. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  88. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +158 -157
  89. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  90. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.d.ts +11 -0
  91. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +127 -23
  92. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  93. package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +10 -3
  94. package/dist/esm/components/agent-builder/utils/mentionSerialization.js +31 -23
  95. package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  96. package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +7 -5
  97. package/dist/esm/components/agent-builder/utils/sourceIcons.js +26 -26
  98. package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
  99. package/dist/esm/icons/Social/Channels/ManifestGlass.d.ts +6 -0
  100. package/dist/esm/icons/Social/Channels/ManifestGlass.js +252 -0
  101. package/dist/esm/icons/Social/Channels/ManifestGlass.js.map +1 -0
  102. package/dist/esm/icons/Social/Channels/ShipStation.d.ts +6 -0
  103. package/dist/esm/icons/Social/Channels/ShipStation.js +31 -0
  104. package/dist/esm/icons/Social/Channels/ShipStation.js.map +1 -0
  105. package/dist/esm/icons/Social/Channels/Skio.d.ts +6 -0
  106. package/dist/{cjs/assets/icons/Skio.svg.js → esm/icons/Social/Channels/Skio.js} +31 -2
  107. package/dist/esm/icons/Social/Channels/Skio.js.map +1 -0
  108. package/dist/esm/icons/Social/Channels/index.d.ts +3 -0
  109. package/dist/esm/icons/index.d.ts +25 -25
  110. package/dist/esm/icons/index.js +330 -324
  111. package/dist/esm/icons/index.js.map +1 -1
  112. package/dist/esm/index.js +671 -663
  113. package/dist/esm/index.js.map +1 -1
  114. package/package.json +1 -1
  115. package/dist/cjs/assets/icons/BigCommerce.svg.js +0 -2
  116. package/dist/cjs/assets/icons/BigCommerce.svg.js.map +0 -1
  117. package/dist/cjs/assets/icons/Gorgias.svg.js +0 -2
  118. package/dist/cjs/assets/icons/Gorgias.svg.js.map +0 -1
  119. package/dist/cjs/assets/icons/ManifestGlass.svg.js +0 -2
  120. package/dist/cjs/assets/icons/ManifestGlass.svg.js.map +0 -1
  121. package/dist/cjs/assets/icons/ShipStation.svg.js +0 -2
  122. package/dist/cjs/assets/icons/ShipStation.svg.js.map +0 -1
  123. package/dist/cjs/assets/icons/Shopify.svg.js +0 -2
  124. package/dist/cjs/assets/icons/Shopify.svg.js.map +0 -1
  125. package/dist/cjs/assets/icons/Skio.svg.js.map +0 -1
  126. package/dist/esm/assets/icons/BigCommerce.svg.js +0 -6
  127. package/dist/esm/assets/icons/BigCommerce.svg.js.map +0 -1
  128. package/dist/esm/assets/icons/Gorgias.svg.js +0 -6
  129. package/dist/esm/assets/icons/Gorgias.svg.js.map +0 -1
  130. package/dist/esm/assets/icons/ManifestGlass.svg.js +0 -6
  131. package/dist/esm/assets/icons/ManifestGlass.svg.js.map +0 -1
  132. package/dist/esm/assets/icons/ShipStation.svg.js +0 -6
  133. package/dist/esm/assets/icons/ShipStation.svg.js.map +0 -1
  134. package/dist/esm/assets/icons/Shopify.svg.js +0 -6
  135. package/dist/esm/assets/icons/Shopify.svg.js.map +0 -1
  136. package/dist/esm/assets/icons/Skio.svg.js +0 -6
  137. package/dist/esm/assets/icons/Skio.svg.js.map +0 -1
@@ -0,0 +1,121 @@
1
+ import { jsx as t, jsxs as a } from "react/jsx-runtime";
2
+ import x from "../../../assets/icons/RedirectToNew.svg.js";
3
+ import { useState as S, useEffect as b } from "react";
4
+ import { BodySecondary as p, TitleSmall as C } from "../../TypographyStyle.js";
5
+ import { COLORS as l } from "../../../constants/Theme.js";
6
+ import { ChannelPickerBody as k, ChannelPickerList as T, ChannelPickerRow as z, CHECKBOX_SLOT as B, ChannelPickerAccount as L, ChannelGlyph as N, ChannelsLink as v } from "../AgentBuilder.styled.js";
7
+ import { channelPresentation as w, isAccountDisconnected as P } from "../constants/channels.js";
8
+ import { StyledModal as O } from "../../modals/styledModal.js";
9
+ import { CheckBox as $ } from "../../checkBox/CheckBox.js";
10
+ import { Tag as A } from "../../tag/Tag.js";
11
+ const D = ({
12
+ channel: n,
13
+ selectedIds: r,
14
+ onClose: c,
15
+ onApply: g,
16
+ onManageChannels: d
17
+ }) => {
18
+ const [h, s] = S(r);
19
+ if (b(() => {
20
+ n && s(r);
21
+ }, [n]), !n)
22
+ return null;
23
+ const { Icon: m, tint: y, accountsNoun: i } = w(
24
+ n.type,
25
+ n.label
26
+ ), f = (e) => s(
27
+ (o) => o.includes(e) ? o.filter((u) => u !== e) : [...o, e]
28
+ );
29
+ return /* @__PURE__ */ t(
30
+ O,
31
+ {
32
+ "data-test": "agent-channel-select-modal",
33
+ open: !0,
34
+ onClose: c,
35
+ width: "640px",
36
+ headingTitle: "Select channels to activate",
37
+ headingSubtitle: `Select the ${i} on which you need this agent enabled on.`,
38
+ modalHeaderStyles: { padding: "24px", boxSizing: "border-box" },
39
+ modalBodyStyles: { boxSizing: "border-box" },
40
+ footerContainerStyle: { padding: "20px 24px", boxSizing: "border-box" },
41
+ footerLeftCustomElement: d ? /* @__PURE__ */ a(
42
+ v,
43
+ {
44
+ "data-test": "agent-channel-management-link",
45
+ type: "button",
46
+ onClick: d,
47
+ style: { fontSize: 14, lineHeight: "20px", fontWeight: 600 },
48
+ children: [
49
+ "Channel management",
50
+ /* @__PURE__ */ t(x, { width: 16, height: 16 })
51
+ ]
52
+ }
53
+ ) : void 0,
54
+ secondaryButton: {
55
+ "data-test": "agent-channel-cancel",
56
+ buttonType: "tertiaryGray",
57
+ size: "small",
58
+ buttonText: "Cancel",
59
+ onClick: c
60
+ },
61
+ primaryButton: {
62
+ "data-test": "agent-channel-apply",
63
+ buttonType: "primary",
64
+ size: "small",
65
+ buttonText: "Apply",
66
+ onClick: () => g(h)
67
+ },
68
+ children: /* @__PURE__ */ a(k, { children: [
69
+ /* @__PURE__ */ t(p, { color: l.content.secondary, children: `Select from available ${i}` }),
70
+ /* @__PURE__ */ a(T, { children: [
71
+ n.accounts.map((e) => {
72
+ const o = P(e);
73
+ return /* @__PURE__ */ a(
74
+ z,
75
+ {
76
+ "data-test": `agent-channel-account-${e.channelId}`,
77
+ children: [
78
+ /* @__PURE__ */ t(
79
+ $,
80
+ {
81
+ isChecked: h.includes(e.channelId),
82
+ ariaLabel: e.channelName,
83
+ value: e.channelId,
84
+ onValueChange: () => f(e.channelId),
85
+ style: B
86
+ }
87
+ ),
88
+ /* @__PURE__ */ a(L, { children: [
89
+ /* @__PURE__ */ t(N, { tint: y, children: m && /* @__PURE__ */ t(m, { size: 16 }) }),
90
+ /* @__PURE__ */ t(C, { color: l.content.primary, children: e.channelName }),
91
+ o && // NOT `size="small"`: that renders through BodyTiny, which
92
+ // is 10px AND has no font-family, so it falls back to the
93
+ // browser serif. The default reads as 12px Inter — Figma's
94
+ // body-caption, same as every other chip.
95
+ /* @__PURE__ */ t(
96
+ A,
97
+ {
98
+ tagText: "Disconnected",
99
+ type: "negative",
100
+ variant: "regular",
101
+ height: 20,
102
+ padding: "2px 8px"
103
+ }
104
+ )
105
+ ] })
106
+ ]
107
+ },
108
+ e.channelId
109
+ );
110
+ }),
111
+ n.accounts.length === 0 && /* @__PURE__ */ t(p, { color: l.content.placeholder, children: `No ${i} are connected to this store yet.` })
112
+ ] })
113
+ ] })
114
+ }
115
+ );
116
+ };
117
+ D.displayName = "ChannelSelectModal";
118
+ export {
119
+ D as ChannelSelectModal
120
+ };
121
+ //# sourceMappingURL=ChannelSelectModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChannelSelectModal.js","sources":["../../../../../src/components/agent-builder/components/ChannelSelectModal.tsx"],"sourcesContent":["import RedirectIcon from '@src/assets/icons/RedirectToNew.svg';\nimport React, { useEffect, useState } from 'react';\nimport { CheckBox } from '@src/components/checkBox';\nimport { StyledModal } from '@src/components/modals';\nimport { Tag } from '@src/components/tag';\nimport { BodySecondary, TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport type { AgentChannel } from '../AgentBuilder.model';\nimport {\n\tChannelGlyph,\n\tChannelPickerAccount,\n\tChannelPickerBody,\n\tChannelPickerList,\n\tChannelPickerRow,\n\tChannelsLink,\n\tCHECKBOX_SLOT,\n} from '../AgentBuilder.styled';\nimport {\n\tchannelPresentation,\n\tisAccountDisconnected,\n} from '../constants/channels';\n\ninterface ChannelSelectModalProps {\n\t/** The channel being edited. `null` closes the modal. */\n\tchannel: AgentChannel | null;\n\t/** Currently activated backend channel ids for this channel. */\n\tselectedIds: string[];\n\tonClose: () => void;\n\t/** Apply — commits the draft selection as backend channel ids. */\n\tonApply: (channelIds: string[]) => void;\n\t/** Footer \"Channel management\" link. Omit to hide it. */\n\tonManageChannels?: () => void;\n}\n\n/**\n * Per-channel account picker, opened from a channel row's edit button.\n *\n * The selection is a LOCAL draft until Apply — the design gives the merchant a\n * Cancel, so toggling here must not reach the agent value until they commit.\n *\n * A disconnected account stays selectable and stays selected: the merchant may\n * be mid-reconnect, and quietly removing it from their agent would hide the\n * problem rather than surface it. It's labelled instead, and the row it came\n * from carries the alert.\n */\nexport const ChannelSelectModal: React.FC<ChannelSelectModalProps> = ({\n\tchannel,\n\tselectedIds,\n\tonClose,\n\tonApply,\n\tonManageChannels,\n}) => {\n\tconst [draft, setDraft] = useState<string[]>(selectedIds);\n\n\t// Re-seed whenever the modal opens (or reopens for a different channel), so a\n\t// cancelled edit doesn't leak into the next one.\n\tuseEffect(() => {\n\t\tif (channel) {\n\t\t\tsetDraft(selectedIds);\n\t\t}\n\t\t// `selectedIds` is intentionally read only at open time — the draft owns it\n\t\t// from then until Apply.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [channel]);\n\n\tif (!channel) {\n\t\treturn null;\n\t}\n\n\tconst { Icon, tint, accountsNoun } = channelPresentation(\n\t\tchannel.type,\n\t\tchannel.label,\n\t);\n\n\tconst toggle = (channelId: string) =>\n\t\tsetDraft((prev) =>\n\t\t\tprev.includes(channelId)\n\t\t\t\t? prev.filter((id) => id !== channelId)\n\t\t\t\t: [...prev, channelId],\n\t\t);\n\n\treturn (\n\t\t<StyledModal\n\t\t\tdata-test=\"agent-channel-select-modal\"\n\t\t\topen\n\t\t\tonClose={onClose}\n\t\t\twidth=\"640px\"\n\t\t\theadingTitle=\"Select channels to activate\"\n\t\t\theadingSubtitle={`Select the ${accountsNoun} on which you need this agent enabled on.`}\n\t\t\t// This repo has no global `box-sizing: border-box`, so StyledModal's\n\t\t\t// `width: 100%` + 24px side padding resolves to 688px inside its 640px\n\t\t\t// `overflow: hidden` wrapper — clipping the right 48px, and with it the\n\t\t\t// primary button. Border-box on each section is the fix that doesn't\n\t\t\t// touch the shared modal.\n\t\t\tmodalHeaderStyles={{ padding: '24px', boxSizing: 'border-box' }}\n\t\t\tmodalBodyStyles={{ boxSizing: 'border-box' }}\n\t\t\tfooterContainerStyle={{ padding: '20px 24px', boxSizing: 'border-box' }}\n\t\t\tfooterLeftCustomElement={\n\t\t\t\tonManageChannels ? (\n\t\t\t\t\t<ChannelsLink\n\t\t\t\t\t\tdata-test=\"agent-channel-management-link\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={onManageChannels}\n\t\t\t\t\t\tstyle={{ fontSize: 14, lineHeight: '20px', fontWeight: 600 }}\n\t\t\t\t\t>\n\t\t\t\t\t\tChannel management\n\t\t\t\t\t\t<RedirectIcon width={16} height={16} />\n\t\t\t\t\t</ChannelsLink>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t\tsecondaryButton={{\n\t\t\t\t'data-test': 'agent-channel-cancel',\n\t\t\t\tbuttonType: 'tertiaryGray',\n\t\t\t\tsize: 'small',\n\t\t\t\tbuttonText: 'Cancel',\n\t\t\t\tonClick: onClose,\n\t\t\t}}\n\t\t\tprimaryButton={{\n\t\t\t\t'data-test': 'agent-channel-apply',\n\t\t\t\tbuttonType: 'primary',\n\t\t\t\tsize: 'small',\n\t\t\t\tbuttonText: 'Apply',\n\t\t\t\tonClick: () => onApply(draft),\n\t\t\t}}\n\t\t>\n\t\t\t<ChannelPickerBody>\n\t\t\t\t<BodySecondary color={COLORS.content.secondary}>\n\t\t\t\t\t{`Select from available ${accountsNoun}`}\n\t\t\t\t</BodySecondary>\n\n\t\t\t\t<ChannelPickerList>\n\t\t\t\t\t{channel.accounts.map((account) => {\n\t\t\t\t\t\tconst disconnected = isAccountDisconnected(account);\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<ChannelPickerRow\n\t\t\t\t\t\t\t\tkey={account.channelId}\n\t\t\t\t\t\t\t\tdata-test={`agent-channel-account-${account.channelId}`}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CheckBox\n\t\t\t\t\t\t\t\t\tisChecked={draft.includes(account.channelId)}\n\t\t\t\t\t\t\t\t\tariaLabel={account.channelName}\n\t\t\t\t\t\t\t\t\tvalue={account.channelId}\n\t\t\t\t\t\t\t\t\tonValueChange={() => toggle(account.channelId)}\n\t\t\t\t\t\t\t\t\tstyle={CHECKBOX_SLOT}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<ChannelPickerAccount>\n\t\t\t\t\t\t\t\t\t<ChannelGlyph tint={tint}>\n\t\t\t\t\t\t\t\t\t\t{Icon && <Icon size={16} />}\n\t\t\t\t\t\t\t\t\t</ChannelGlyph>\n\t\t\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t\t\t{account.channelName}\n\t\t\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t\t\t{disconnected && (\n\t\t\t\t\t\t\t\t\t\t// NOT `size=\"small\"`: that renders through BodyTiny, which\n\t\t\t\t\t\t\t\t\t\t// is 10px AND has no font-family, so it falls back to the\n\t\t\t\t\t\t\t\t\t\t// browser serif. The default reads as 12px Inter — Figma's\n\t\t\t\t\t\t\t\t\t\t// body-caption, same as every other chip.\n\t\t\t\t\t\t\t\t\t\t<Tag\n\t\t\t\t\t\t\t\t\t\t\ttagText=\"Disconnected\"\n\t\t\t\t\t\t\t\t\t\t\ttype=\"negative\"\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"regular\"\n\t\t\t\t\t\t\t\t\t\t\theight={20}\n\t\t\t\t\t\t\t\t\t\t\tpadding=\"2px 8px\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</ChannelPickerAccount>\n\t\t\t\t\t\t\t</ChannelPickerRow>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\n\t\t\t\t\t{channel.accounts.length === 0 && (\n\t\t\t\t\t\t<BodySecondary color={COLORS.content.placeholder}>\n\t\t\t\t\t\t\t{`No ${accountsNoun} are connected to this store yet.`}\n\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t)}\n\t\t\t\t</ChannelPickerList>\n\t\t\t</ChannelPickerBody>\n\t\t</StyledModal>\n\t);\n};\n\nChannelSelectModal.displayName = 'ChannelSelectModal';\n\nexport type { ChannelSelectModalProps };\n"],"names":["ChannelSelectModal","channel","selectedIds","onClose","onApply","onManageChannels","draft","setDraft","useState","useEffect","Icon","tint","accountsNoun","channelPresentation","toggle","channelId","prev","id","jsx","StyledModal","jsxs","ChannelsLink","RedirectIcon","ChannelPickerBody","BodySecondary","COLORS","ChannelPickerList","account","disconnected","isAccountDisconnected","ChannelPickerRow","CheckBox","CHECKB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QAAQ;AAAA,wBACR,SAAQ;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACT,EAAA,CAEF;AAAA,gBAAA;AAAA,cAAA;AAAA,cA9BKT,EAAQ;AAAA,YAAA;AAAA,UAiChB,CAAC;AAAA,UAEA1B,EAAQ,SAAS,WAAW,KAC5B,gBAAAiB,EAACM,GAAA,EAAc,OAAOC,EAAO,QAAQ,aACnC,UAAA,MAAMb,CAAY,oCAAA,CACpB;AAAA,QAAA,EAAA,CAEF;AAAA,MAAA,EAAA,CACD;AAAA,IAAA;AAAA,EAAA;AAGH;AAEAZ,EAAmB,cAAc;"}
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Step 1's "Channels to activate it on" — one card per connected channel, each
4
+ * with a select-all checkbox, the accounts it covers as chips, and an edit
5
+ * button that opens the per-account picker.
6
+ *
7
+ * Renders nothing when the consumer passes no `availableChannels`, so a host
8
+ * that hasn't wired channels up yet sees the step exactly as it was.
9
+ */
10
+ export declare const ChannelsSection: React.FC;
@@ -0,0 +1,183 @@
1
+ import { jsxs as d, jsx as n, Fragment as E } from "react/jsx-runtime";
2
+ import w from "../../../assets/icons/edit.svg.js";
3
+ import A from "../../../assets/icons/errorInfo.svg.js";
4
+ import { useState as M, useMemo as N } from "react";
5
+ import { TitleSmall as v } from "../../TypographyStyle.js";
6
+ import { COLORS as T } from "../../../constants/Theme.js";
7
+ import { ChannelsSectionRoot as B, ChannelCard as L, ChannelRow as O, ChannelRowMain as R, CHECKBOX_SLOT as k, ChannelIdentity as P, ChannelGlyph as j, ChannelChips as D, ChipTooltipTarget as f } from "../AgentBuilder.styled.js";
8
+ import { channelPresentation as _, selectedAccounts as z, isAccountDisconnected as S } from "../constants/channels.js";
9
+ import { useAgentBuilderContext as F } from "../context/AgentBuilderContext.js";
10
+ import { ChannelSelectModal as H } from "./ChannelSelectModal.js";
11
+ import { CheckBox as V } from "../../checkBox/CheckBox.js";
12
+ import { Tooltip as I } from "../../tooltips/Tooltip.js";
13
+ import { Tag as C } from "../../tag/Tag.js";
14
+ import { IconButton as X } from "../../icon-button/IconButton.js";
15
+ const b = 3, G = (e) => [
16
+ ...e.filter(S),
17
+ ...e.filter((i) => !S(i))
18
+ ], K = () => {
19
+ const { value: e, updateField: i, availableChannels: r, onManageChannels: p } = F(), [a, c] = M(null), m = N(() => {
20
+ const t = /* @__PURE__ */ new Map();
21
+ return (e.channels ?? []).forEach((l) => t.set(l.type, l.channelIds)), t;
22
+ }, [e.channels]);
23
+ if (!r || r.length === 0)
24
+ return null;
25
+ const g = (t, l) => {
26
+ const h = (e.channels ?? []).filter((u) => u.type !== t);
27
+ i(
28
+ "channels",
29
+ l.length > 0 ? [...h, { type: t, channelIds: l }] : h
30
+ );
31
+ }, o = r.find((t) => t.type === a) ?? null;
32
+ return /* @__PURE__ */ d(B, { children: [
33
+ /* @__PURE__ */ n(v, { color: T.content.primary, children: "Channels to activate it on" }),
34
+ r.map((t) => /* @__PURE__ */ n(
35
+ U,
36
+ {
37
+ channel: t,
38
+ selectedIds: m.get(t.type) ?? [],
39
+ onSelectionChange: (l) => g(t.type, l),
40
+ onEdit: () => c(t.type)
41
+ },
42
+ String(t.type)
43
+ )),
44
+ /* @__PURE__ */ n(
45
+ H,
46
+ {
47
+ channel: o,
48
+ selectedIds: o ? m.get(o.type) ?? [] : [],
49
+ onClose: () => c(null),
50
+ onApply: (t) => {
51
+ o && g(o.type, t), c(null);
52
+ },
53
+ onManageChannels: p && o ? () => p(o.type) : void 0
54
+ }
55
+ )
56
+ ] });
57
+ };
58
+ K.displayName = "ChannelsSection";
59
+ const U = ({
60
+ channel: e,
61
+ selectedIds: i,
62
+ onSelectionChange: r,
63
+ onEdit: p
64
+ }) => {
65
+ const { label: a, Icon: c, tint: m, accountsNoun: g } = _(
66
+ e.type,
67
+ e.label
68
+ ), o = e.accounts.length === 0, t = z(e, i), l = !o && t.length === e.accounts.length, h = t.length > 0 && !l, u = G(t.length > 0 ? t : e.accounts), x = u.slice(0, b), y = u.slice(b), $ = () => r(
69
+ l ? [] : e.accounts.map((s) => s.channelId)
70
+ );
71
+ return /* @__PURE__ */ n(
72
+ L,
73
+ {
74
+ "data-test": `agent-channel-${e.type}`,
75
+ role: "group",
76
+ "aria-label": a,
77
+ children: /* @__PURE__ */ d(O, { children: [
78
+ /* @__PURE__ */ d(R, { children: [
79
+ /* @__PURE__ */ n(
80
+ V,
81
+ {
82
+ isChecked: l || h,
83
+ isPartiallyChecked: h,
84
+ isDisabled: o,
85
+ ariaLabel: a,
86
+ onValueChange: $,
87
+ style: k
88
+ }
89
+ ),
90
+ /* @__PURE__ */ d(P, { children: [
91
+ /* @__PURE__ */ n(j, { tint: m, children: c && /* @__PURE__ */ n(c, { size: 16 }) }),
92
+ /* @__PURE__ */ n(v, { color: T.content.primary, children: a })
93
+ ] }),
94
+ /* @__PURE__ */ n(D, { children: o ? /* @__PURE__ */ n(
95
+ I,
96
+ {
97
+ body: `No ${g} are connected to this store yet. Connect one from channel management to activate this agent on ${a}.`,
98
+ placement: "top",
99
+ children: /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n(
100
+ C,
101
+ {
102
+ tagText: "Disabled",
103
+ type: "neutral",
104
+ variant: "regular",
105
+ height: 24,
106
+ cursor: "default"
107
+ }
108
+ ) })
109
+ }
110
+ ) : /* @__PURE__ */ d(E, { children: [
111
+ x.map((s) => /* @__PURE__ */ n(
112
+ q,
113
+ {
114
+ account: s,
115
+ channelLabel: a
116
+ },
117
+ s.channelId
118
+ )),
119
+ y.length > 0 && /* @__PURE__ */ n(
120
+ I,
121
+ {
122
+ body: y.map((s) => s.channelName).join(", "),
123
+ placement: "top",
124
+ children: /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n(
125
+ C,
126
+ {
127
+ tagText: `+${y.length}`,
128
+ type: "purple",
129
+ variant: "regular",
130
+ height: 24,
131
+ cursor: "default"
132
+ }
133
+ ) })
134
+ }
135
+ )
136
+ ] }) })
137
+ ] }),
138
+ /* @__PURE__ */ n(
139
+ X,
140
+ {
141
+ "data-test": `agent-channel-${e.type}-edit`,
142
+ "aria-label": `Edit ${a} channels`,
143
+ Icon: w,
144
+ size: "xs",
145
+ iconPadding: 4,
146
+ disabled: o,
147
+ onClick: p
148
+ }
149
+ )
150
+ ] })
151
+ }
152
+ );
153
+ }, q = ({ account: e, channelLabel: i }) => S(e) ? /* @__PURE__ */ n(
154
+ I,
155
+ {
156
+ body: `${e.channelName} is disconnected. This agent won't run on it until you reconnect it from ${i} channel management.`,
157
+ placement: "top",
158
+ children: /* @__PURE__ */ n(f, { children: /* @__PURE__ */ n(
159
+ C,
160
+ {
161
+ tagText: e.channelName,
162
+ type: "negative",
163
+ variant: "regular",
164
+ height: 24,
165
+ LeadingIcon: A,
166
+ leadingIconId: `channel-error-${e.channelId}`,
167
+ cursor: "default"
168
+ }
169
+ ) })
170
+ }
171
+ ) : /* @__PURE__ */ n(
172
+ C,
173
+ {
174
+ tagText: e.channelName,
175
+ type: "purple",
176
+ variant: "regular",
177
+ height: 24
178
+ }
179
+ );
180
+ export {
181
+ K as ChannelsSection
182
+ };
183
+ //# sourceMappingURL=ChannelsSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChannelsSection.js","sources":["../../../../../src/components/agent-builder/components/ChannelsSection.tsx"],"sourcesContent":["import EditIcon from '@src/assets/icons/edit.svg';\nimport ErrorInfoIcon from '@src/assets/icons/errorInfo.svg';\nimport React, { useMemo, useState } from 'react';\nimport { CheckBox } from '@src/components/checkBox';\nimport { IconButton } from '@src/components/icon-button';\nimport { Tag } from '@src/components/tag';\nimport { Tooltip } from '@src/components/tooltips';\nimport { TitleSmall } from '@src/components/TypographyStyle';\nimport { COLORS } from '@src/constants/Theme';\nimport type {\n\tAgentChannel,\n\tAgentChannelAccount,\n\tAgentChannelType,\n} from '../AgentBuilder.model';\nimport {\n\tChannelCard,\n\tChannelChips,\n\tChannelGlyph,\n\tChannelIdentity,\n\tChannelRow,\n\tChannelRowMain,\n\tChannelsSectionRoot,\n\tCHECKBOX_SLOT,\n\tChipTooltipTarget,\n} from '../AgentBuilder.styled';\nimport {\n\tchannelPresentation,\n\tisAccountDisconnected,\n\tselectedAccounts,\n} from '../constants/channels';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\nimport { ChannelSelectModal } from './ChannelSelectModal';\n\n/**\n * How many account chips a row shows before collapsing the rest into \"+N\". The\n * design draws three; without a cap a store with a dozen numbers pushes the row\n * well past its 48px height.\n */\nconst MAX_VISIBLE_CHIPS = 3;\n\n/**\n * Chips for a row: disconnected accounts first so a cap can never hide the very\n * thing the merchant needs to act on, then the rest in their original order.\n */\nconst chipOrder = (accounts: AgentChannelAccount[]): AgentChannelAccount[] => [\n\t...accounts.filter(isAccountDisconnected),\n\t...accounts.filter((a) => !isAccountDisconnected(a)),\n];\n\n/**\n * Step 1's \"Channels to activate it on\" — one card per connected channel, each\n * with a select-all checkbox, the accounts it covers as chips, and an edit\n * button that opens the per-account picker.\n *\n * Renders nothing when the consumer passes no `availableChannels`, so a host\n * that hasn't wired channels up yet sees the step exactly as it was.\n */\nexport const ChannelsSection: React.FC = () => {\n\tconst { value, updateField, availableChannels, onManageChannels } =\n\t\tuseAgentBuilderContext();\n\n\t// Which channel's picker is open (by type); null = closed.\n\tconst [editingType, setEditingType] = useState<AgentChannelType | null>(null);\n\n\t// Selection is stored as a list; index it once so each row is a lookup.\n\tconst selectionByType = useMemo(() => {\n\t\tconst map = new Map<AgentChannelType, string[]>();\n\t\t(value.channels ?? []).forEach((c) => map.set(c.type, c.channelIds));\n\t\treturn map;\n\t}, [value.channels]);\n\n\tif (!availableChannels || availableChannels.length === 0) {\n\t\treturn null;\n\t}\n\n\tconst setSelection = (type: AgentChannelType, channelIds: string[]) => {\n\t\tconst rest = (value.channels ?? []).filter((c) => c.type !== type);\n\t\t// An empty selection drops the channel entirely rather than persisting a\n\t\t// `{ type, channelIds: [] }` no-op the backend would have to filter out.\n\t\tupdateField(\n\t\t\t'channels',\n\t\t\tchannelIds.length > 0 ? [...rest, { type, channelIds }] : rest,\n\t\t);\n\t};\n\n\tconst editingChannel =\n\t\tavailableChannels.find((c) => c.type === editingType) ?? null;\n\n\treturn (\n\t\t<ChannelsSectionRoot>\n\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\tChannels to activate it on\n\t\t\t</TitleSmall>\n\n\t\t\t{availableChannels.map((channel) => (\n\t\t\t\t<ChannelCardRow\n\t\t\t\t\tkey={String(channel.type)}\n\t\t\t\t\tchannel={channel}\n\t\t\t\t\tselectedIds={selectionByType.get(channel.type) ?? []}\n\t\t\t\t\tonSelectionChange={(ids) => setSelection(channel.type, ids)}\n\t\t\t\t\tonEdit={() => setEditingType(channel.type)}\n\t\t\t\t/>\n\t\t\t))}\n\n\t\t\t<ChannelSelectModal\n\t\t\t\tchannel={editingChannel}\n\t\t\t\tselectedIds={\n\t\t\t\t\teditingChannel ? selectionByType.get(editingChannel.type) ?? [] : []\n\t\t\t\t}\n\t\t\t\tonClose={() => setEditingType(null)}\n\t\t\t\tonApply={(ids) => {\n\t\t\t\t\tif (editingChannel) {\n\t\t\t\t\t\tsetSelection(editingChannel.type, ids);\n\t\t\t\t\t}\n\t\t\t\t\tsetEditingType(null);\n\t\t\t\t}}\n\t\t\t\tonManageChannels={\n\t\t\t\t\tonManageChannels && editingChannel\n\t\t\t\t\t\t? () => onManageChannels(editingChannel.type)\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t/>\n\t\t</ChannelsSectionRoot>\n\t);\n};\n\nChannelsSection.displayName = 'ChannelsSection';\n\ninterface ChannelCardRowProps {\n\tchannel: AgentChannel;\n\tselectedIds: string[];\n\tonSelectionChange: (channelIds: string[]) => void;\n\tonEdit: () => void;\n}\n\nconst ChannelCardRow: React.FC<ChannelCardRowProps> = ({\n\tchannel,\n\tselectedIds,\n\tonSelectionChange,\n\tonEdit,\n}) => {\n\tconst { label, Icon, tint, accountsNoun } = channelPresentation(\n\t\tchannel.type,\n\t\tchannel.label,\n\t);\n\n\t/**\n\t * Zero state — the store supports this channel but has nothing connected\n\t * under it. Nothing on the row is actionable, so the checkbox and the edit\n\t * button are both inert and a \"Disabled\" chip stands in for the accounts.\n\t */\n\tconst isUnavailable = channel.accounts.length === 0;\n\n\tconst selected = selectedAccounts(channel, selectedIds);\n\tconst allSelected =\n\t\t!isUnavailable && selected.length === channel.accounts.length;\n\tconst someSelected = selected.length > 0 && !allSelected;\n\n\t// With nothing picked yet the row shows the store's inventory — that's the\n\t// state the design draws, and it tells the merchant what's on offer. Once\n\t// they've picked, the chips narrow to what the agent actually runs on.\n\tconst shown = chipOrder(selected.length > 0 ? selected : channel.accounts);\n\tconst visible = shown.slice(0, MAX_VISIBLE_CHIPS);\n\tconst overflow = shown.slice(MAX_VISIBLE_CHIPS);\n\n\tconst toggleAll = () =>\n\t\tonSelectionChange(\n\t\t\tallSelected ? [] : channel.accounts.map((a) => a.channelId),\n\t\t);\n\n\treturn (\n\t\t<ChannelCard\n\t\t\tdata-test={`agent-channel-${channel.type}`}\n\t\t\t// A card groups a channel's checkbox, chips and edit button; naming the\n\t\t\t// group lets assistive tech (and tests) address one channel at a time.\n\t\t\trole=\"group\"\n\t\t\taria-label={label}\n\t\t>\n\t\t\t<ChannelRow>\n\t\t\t\t<ChannelRowMain>\n\t\t\t\t\t<CheckBox\n\t\t\t\t\t\tisChecked={allSelected || someSelected}\n\t\t\t\t\t\tisPartiallyChecked={someSelected}\n\t\t\t\t\t\tisDisabled={isUnavailable}\n\t\t\t\t\t\tariaLabel={label}\n\t\t\t\t\t\tonValueChange={toggleAll}\n\t\t\t\t\t\tstyle={CHECKBOX_SLOT}\n\t\t\t\t\t/>\n\t\t\t\t\t<ChannelIdentity>\n\t\t\t\t\t\t<ChannelGlyph tint={tint}>\n\t\t\t\t\t\t\t{Icon && <Icon size={16} />}\n\t\t\t\t\t\t</ChannelGlyph>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>{label}</TitleSmall>\n\t\t\t\t\t</ChannelIdentity>\n\n\t\t\t\t\t<ChannelChips>\n\t\t\t\t\t\t{isUnavailable ? (\n\t\t\t\t\t\t\t<Tooltip\n\t\t\t\t\t\t\t\tbody={`No ${accountsNoun} are connected to this store yet. Connect one from channel management to activate this agent on ${label}.`}\n\t\t\t\t\t\t\t\tplacement=\"top\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ChipTooltipTarget>\n\t\t\t\t\t\t\t\t\t<Tag\n\t\t\t\t\t\t\t\t\t\ttagText=\"Disabled\"\n\t\t\t\t\t\t\t\t\t\ttype=\"neutral\"\n\t\t\t\t\t\t\t\t\t\tvariant=\"regular\"\n\t\t\t\t\t\t\t\t\t\theight={24}\n\t\t\t\t\t\t\t\t\t\tcursor=\"default\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ChipTooltipTarget>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t{visible.map((account) => (\n\t\t\t\t\t\t\t\t\t<AccountChip\n\t\t\t\t\t\t\t\t\t\tkey={account.channelId}\n\t\t\t\t\t\t\t\t\t\taccount={account}\n\t\t\t\t\t\t\t\t\t\tchannelLabel={label}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t{overflow.length > 0 && (\n\t\t\t\t\t\t\t\t\t<Tooltip\n\t\t\t\t\t\t\t\t\t\tbody={overflow.map((a) => a.channelName).join(', ')}\n\t\t\t\t\t\t\t\t\t\tplacement=\"top\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ChipTooltipTarget>\n\t\t\t\t\t\t\t\t\t\t\t<Tag\n\t\t\t\t\t\t\t\t\t\t\t\ttagText={`+${overflow.length}`}\n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"purple\"\n\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"regular\"\n\t\t\t\t\t\t\t\t\t\t\t\theight={24}\n\t\t\t\t\t\t\t\t\t\t\t\tcursor=\"default\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</ChipTooltipTarget>\n\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ChannelChips>\n\t\t\t\t</ChannelRowMain>\n\n\t\t\t\t<IconButton\n\t\t\t\t\tdata-test={`agent-channel-${channel.type}-edit`}\n\t\t\t\t\taria-label={`Edit ${label} channels`}\n\t\t\t\t\tIcon={EditIcon}\n\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\ticonPadding={4}\n\t\t\t\t\tdisabled={isUnavailable}\n\t\t\t\t\tonClick={onEdit}\n\t\t\t\t/>\n\t\t\t</ChannelRow>\n\t\t</ChannelCard>\n\t);\n};\n\n/**\n * One account chip. A healthy account reads as a brand chip; a disconnected one\n * turns negative and gains the error glyph.\n *\n * The tooltip is NOT in the design — but a bare red chip tells the merchant\n * something is broken and nothing about what to do, so it names the account and\n * the fix.\n */\nconst AccountChip: React.FC<{\n\taccount: AgentChannelAccount;\n\tchannelLabel: string;\n}> = ({ account, channelLabel }) => {\n\tif (!isAccountDisconnected(account)) {\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\ttagText={account.channelName}\n\t\t\t\ttype=\"purple\"\n\t\t\t\tvariant=\"regular\"\n\t\t\t\theight={24}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Tooltip\n\t\t\tbody={`${account.channelName} is disconnected. This agent won't run on it until you reconnect it from ${channelLabel} channel management.`}\n\t\t\tplacement=\"top\"\n\t\t>\n\t\t\t<ChipTooltipTarget>\n\t\t\t\t<Tag\n\t\t\t\t\ttagText={account.channelName}\n\t\t\t\t\ttype=\"negative\"\n\t\t\t\t\tvariant=\"regular\"\n\t\t\t\t\theight={24}\n\t\t\t\t\tLeadingIcon={ErrorInfoIcon}\n\t\t\t\t\t// Tag doesn't spread rest props, so `data-test` would be dropped —\n\t\t\t\t\t// `leadingIconId` is the one hook it does put on the DOM, which gives\n\t\t\t\t\t// the error glyph a stable handle for tests and e2e.\n\t\t\t\t\tleadingIconId={`channel-error-${account.channelId}`}\n\t\t\t\t\tcursor=\"default\"\n\t\t\t\t/>\n\t\t\t</ChipTooltipTarget>\n\t\t</Tooltip>\n\t);\n};\n"],"names":["MAX_VISIBLE_CHIPS","chipOrder","accounts","isAccountDisconnected","a","ChannelsSection","value","updateField","availableChannels","onManageChannels","useAgentBuilderContext","editingType","setEditingType","useState","selectionByType","useMemo","map","c","setSelection","type","channelIds","rest","editingChannel","ChannelsSectionRoot","jsx","TitleSmall","COLORS","channel","ChannelCardRow","ids","ChannelSelectModal","selectedIds","onSelectionChange","onEdit","label","Icon","tint","accountsNoun","channelPresentation","isUnavailable","selected","selectedAccounts","allSelected","someSelected","shown","visible","overflow","toggleAll","ChannelCard","ChannelRow","jsxs","ChannelRowMain","CheckBox","CHECKBOX_SLOT","ChannelIdentity","ChannelGlyph","ChannelChips","Tooltip","ChipTooltipTarget","Tag","Fragment","account","AccountChip","IconButton","EditIcon","channelLabel","ErrorInfoIcon"],"mappings":";;;;;;;;;;;;;;AAsCA,MAAMA,IAAoB,GAMpBC,IAAY,CAACC,MAA2D;AAAA,EAC7E,GAAGA,EAAS,OAAOC,CAAqB;AAAA,EACxC,GAAGD,EAAS,OAAO,CAACE,MAAM,CAACD,EAAsBC,CAAC,CAAC;AACpD,GAUaC,IAA4B,MAAM;AAC9C,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,mBAAAC,GAAmB,kBAAAC,EAAA,IAC9CC,EAAA,GAGK,CAACC,GAAaC,CAAc,IAAIC,EAAkC,IAAI,GAGtEC,IAAkBC,EAAQ,MAAM;AACrC,UAAMC,wBAAU,IAAA;AAChB,YAACV,EAAM,YAAY,IAAI,QAAQ,CAACW,MAAMD,EAA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