@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.
- package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js +151 -29
- package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js +2 -0
- package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/ChannelsSection.js +2 -0
- package/dist/cjs/components/agent-builder/components/ChannelsSection.js.map +1 -0
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +5 -5
- package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/GoLiveModal.js +1 -1
- package/dist/cjs/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionEditor.js +2 -2
- package/dist/cjs/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
- package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/MentionPicker.js +13 -13
- package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js +3 -3
- package/dist/cjs/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/cjs/components/agent-builder/constants/channels.js +2 -0
- package/dist/cjs/components/agent-builder/constants/channels.js.map +1 -0
- package/dist/cjs/components/agent-builder/constants/steps.js +1 -1
- package/dist/cjs/components/agent-builder/constants/steps.js.map +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
- package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step1About.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step1About.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js +2 -2
- package/dist/cjs/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js +1 -1
- package/dist/cjs/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js +2 -2
- package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/cjs/components/agent-builder/utils/sourceIcons.js +1 -1
- package/dist/cjs/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/cjs/icons/Social/Channels/ManifestGlass.js +2 -0
- package/dist/cjs/icons/Social/Channels/ManifestGlass.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/ShipStation.js +2 -0
- package/dist/cjs/icons/Social/Channels/ShipStation.js.map +1 -0
- package/dist/cjs/icons/Social/Channels/Skio.js +2 -0
- package/dist/cjs/icons/Social/Channels/Skio.js.map +1 -0
- package/dist/cjs/icons/index.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.js +103 -97
- package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
- package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +76 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +68 -0
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js +224 -59
- package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
- package/dist/esm/components/agent-builder/components/ChannelSelectModal.d.ts +26 -0
- package/dist/esm/components/agent-builder/components/ChannelSelectModal.js +121 -0
- package/dist/esm/components/agent-builder/components/ChannelSelectModal.js.map +1 -0
- package/dist/esm/components/agent-builder/components/ChannelsSection.d.ts +10 -0
- package/dist/esm/components/agent-builder/components/ChannelsSection.js +183 -0
- package/dist/esm/components/agent-builder/components/ChannelsSection.js.map +1 -0
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +135 -132
- package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
- package/dist/esm/components/agent-builder/components/GoLiveModal.js +12 -12
- package/dist/esm/components/agent-builder/components/GoLiveModal.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +2 -0
- package/dist/esm/components/agent-builder/components/MentionEditor.js +47 -45
- package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionField.js +52 -51
- package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
- package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +5 -0
- package/dist/esm/components/agent-builder/components/MentionPicker.js +134 -132
- package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
- package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +2 -0
- package/dist/esm/components/agent-builder/components/SelectableListSection.js +48 -46
- package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
- package/dist/esm/components/agent-builder/constants/channels.d.ts +56 -0
- package/dist/esm/components/agent-builder/constants/channels.js +41 -0
- package/dist/esm/components/agent-builder/constants/channels.js.map +1 -0
- package/dist/esm/components/agent-builder/constants/steps.d.ts +31 -1
- package/dist/esm/components/agent-builder/constants/steps.js +15 -6
- package/dist/esm/components/agent-builder/constants/steps.js.map +1 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +13 -1
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +157 -148
- package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
- package/dist/esm/components/agent-builder/index.d.ts +5 -2
- package/dist/esm/components/agent-builder/steps/Step1About.js +15 -13
- package/dist/esm/components/agent-builder/steps/Step1About.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +55 -48
- package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +158 -157
- package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.d.ts +11 -0
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +127 -23
- package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +10 -3
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js +31 -23
- package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
- package/dist/esm/components/agent-builder/utils/sourceIcons.d.ts +7 -5
- package/dist/esm/components/agent-builder/utils/sourceIcons.js +26 -26
- package/dist/esm/components/agent-builder/utils/sourceIcons.js.map +1 -1
- package/dist/esm/icons/Social/Channels/ManifestGlass.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/ManifestGlass.js +252 -0
- package/dist/esm/icons/Social/Channels/ManifestGlass.js.map +1 -0
- package/dist/esm/icons/Social/Channels/ShipStation.d.ts +6 -0
- package/dist/esm/icons/Social/Channels/ShipStation.js +31 -0
- package/dist/esm/icons/Social/Channels/ShipStation.js.map +1 -0
- package/dist/esm/icons/Social/Channels/Skio.d.ts +6 -0
- package/dist/{cjs/assets/icons/Skio.svg.js → esm/icons/Social/Channels/Skio.js} +31 -2
- package/dist/esm/icons/Social/Channels/Skio.js.map +1 -0
- package/dist/esm/icons/Social/Channels/index.d.ts +3 -0
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/icons/index.js +330 -324
- package/dist/esm/icons/index.js.map +1 -1
- package/dist/esm/index.js +671 -663
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/assets/icons/BigCommerce.svg.js +0 -2
- package/dist/cjs/assets/icons/BigCommerce.svg.js.map +0 -1
- package/dist/cjs/assets/icons/Gorgias.svg.js +0 -2
- package/dist/cjs/assets/icons/Gorgias.svg.js.map +0 -1
- package/dist/cjs/assets/icons/ManifestGlass.svg.js +0 -2
- package/dist/cjs/assets/icons/ManifestGlass.svg.js.map +0 -1
- package/dist/cjs/assets/icons/ShipStation.svg.js +0 -2
- package/dist/cjs/assets/icons/ShipStation.svg.js.map +0 -1
- package/dist/cjs/assets/icons/Shopify.svg.js +0 -2
- package/dist/cjs/assets/icons/Shopify.svg.js.map +0 -1
- package/dist/cjs/assets/icons/Skio.svg.js.map +0 -1
- package/dist/esm/assets/icons/BigCommerce.svg.js +0 -6
- package/dist/esm/assets/icons/BigCommerce.svg.js.map +0 -1
- package/dist/esm/assets/icons/Gorgias.svg.js +0 -6
- package/dist/esm/assets/icons/Gorgias.svg.js.map +0 -1
- package/dist/esm/assets/icons/ManifestGlass.svg.js +0 -6
- package/dist/esm/assets/icons/ManifestGlass.svg.js.map +0 -1
- package/dist/esm/assets/icons/ShipStation.svg.js +0 -6
- package/dist/esm/assets/icons/ShipStation.svg.js.map +0 -1
- package/dist/esm/assets/icons/Shopify.svg.js +0 -6
- package/dist/esm/assets/icons/Shopify.svg.js.map +0 -1
- package/dist/esm/assets/icons/Skio.svg.js +0 -6
- package/dist/esm/assets/icons/Skio.svg.js.map +0 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsxs as o, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { DropdownPopover as
|
|
6
|
-
import { RadioButton as
|
|
7
|
-
import { TitleSmall as
|
|
8
|
-
import { BASE_COLORS as
|
|
9
|
-
import { SectionBodyWrap as
|
|
10
|
-
import { AiTextArea as
|
|
2
|
+
import x from "../../../assets/icons/cross.svg.js";
|
|
3
|
+
import w from "../../../assets/icons/plus.svg.js";
|
|
4
|
+
import k from "styled-components";
|
|
5
|
+
import { DropdownPopover as A } from "../../dropdown/DropdownPopover/index.js";
|
|
6
|
+
import { RadioButton as u } from "../../radioButton/RadioButton.js";
|
|
7
|
+
import { TitleSmall as l, BodyCaption as d } from "../../TypographyStyle.js";
|
|
8
|
+
import { BASE_COLORS as g, COLORS as r } from "../../../constants/Theme.js";
|
|
9
|
+
import { SectionBodyWrap as B, CardRow as L, RadioCard as f, RadioCardText as v, FieldBlock as O, ChipWrap as R } from "../AgentBuilder.styled.js";
|
|
10
|
+
import { AiTextArea as E } from "../components/AiTextArea.js";
|
|
11
11
|
import { StepSectionHeader as D } from "../components/StepSectionHeader.js";
|
|
12
|
-
import {
|
|
13
|
-
import { useAgentBuilderContext as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
import { STEP_DEFINITION_TEMPLATES as P, resolveAppToken as $ } from "../constants/steps.js";
|
|
13
|
+
import { useAgentBuilderContext as F } from "../context/AgentBuilderContext.js";
|
|
14
|
+
import { appTypeLabel as W } from "../utils/mentionSerialization.js";
|
|
15
|
+
import { Button as y } from "../../button/Button.js";
|
|
16
|
+
import { unwrapDropdownValue as j } from "../../dropdown/utils.js";
|
|
17
|
+
const b = P[1], ot = () => {
|
|
18
|
+
const { value: T, patch: a, availableIntents: m, charLimits: C, applicationType: S } = F(), { trigger: e } = T, c = W(S), s = (t) => a({ trigger: { ...e, mode: t } }), _ = (t) => {
|
|
18
19
|
e.intents.includes(t) || a({
|
|
19
20
|
trigger: { ...e, intents: [...e.intents, t] }
|
|
20
21
|
});
|
|
@@ -23,11 +24,17 @@ const y = L[1], Y = () => {
|
|
|
23
24
|
...e,
|
|
24
25
|
intents: e.intents.filter((i) => i !== t)
|
|
25
26
|
}
|
|
26
|
-
}),
|
|
27
|
+
}), p = (t) => m.find((i) => i.value === t)?.label ?? t, h = m.filter((t) => !e.intents.includes(t.value)).map((t) => ({ label: t.label, value: t.value }));
|
|
27
28
|
return /* @__PURE__ */ o("div", { children: [
|
|
28
|
-
/* @__PURE__ */ n(
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
/* @__PURE__ */ n(
|
|
30
|
+
D,
|
|
31
|
+
{
|
|
32
|
+
title: b.title,
|
|
33
|
+
helper: $(b.helper, c)
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ o(B, { children: [
|
|
37
|
+
/* @__PURE__ */ o(L, { children: [
|
|
31
38
|
/* @__PURE__ */ o(
|
|
32
39
|
f,
|
|
33
40
|
{
|
|
@@ -36,17 +43,17 @@ const y = L[1], Y = () => {
|
|
|
36
43
|
onClick: () => s("manifest_intent"),
|
|
37
44
|
children: [
|
|
38
45
|
/* @__PURE__ */ n(
|
|
39
|
-
|
|
46
|
+
u,
|
|
40
47
|
{
|
|
41
48
|
isActive: e.mode === "manifest_intent",
|
|
42
49
|
onValueChange: () => s("manifest_intent"),
|
|
43
50
|
skipSelectingOff: !0,
|
|
44
|
-
activeColor:
|
|
51
|
+
activeColor: g.brand[800]
|
|
45
52
|
}
|
|
46
53
|
),
|
|
47
|
-
/* @__PURE__ */ o(
|
|
48
|
-
/* @__PURE__ */ n(
|
|
49
|
-
/* @__PURE__ */ n(
|
|
54
|
+
/* @__PURE__ */ o(v, { children: [
|
|
55
|
+
/* @__PURE__ */ n(l, { color: r.content.primary, children: `${c} intent` }),
|
|
56
|
+
/* @__PURE__ */ n(d, { color: r.content.secondary, children: `${c}'s AI classifier routes conversations automatically — no keywords needed.` })
|
|
50
57
|
] })
|
|
51
58
|
]
|
|
52
59
|
}
|
|
@@ -59,67 +66,67 @@ const y = L[1], Y = () => {
|
|
|
59
66
|
onClick: () => s("custom_intent"),
|
|
60
67
|
children: [
|
|
61
68
|
/* @__PURE__ */ n(
|
|
62
|
-
|
|
69
|
+
u,
|
|
63
70
|
{
|
|
64
71
|
isActive: e.mode === "custom_intent",
|
|
65
72
|
onValueChange: () => s("custom_intent"),
|
|
66
73
|
skipSelectingOff: !0,
|
|
67
|
-
activeColor:
|
|
74
|
+
activeColor: g.brand[800]
|
|
68
75
|
}
|
|
69
76
|
),
|
|
70
|
-
/* @__PURE__ */ o(
|
|
71
|
-
/* @__PURE__ */ n(
|
|
72
|
-
/* @__PURE__ */ n(
|
|
77
|
+
/* @__PURE__ */ o(v, { children: [
|
|
78
|
+
/* @__PURE__ */ n(l, { color: r.content.primary, children: "Custom intent" }),
|
|
79
|
+
/* @__PURE__ */ n(d, { color: r.content.secondary, children: "Define your own trigger — use exact phrases or describe the customer's intent." })
|
|
73
80
|
] })
|
|
74
81
|
]
|
|
75
82
|
}
|
|
76
83
|
)
|
|
77
84
|
] }),
|
|
78
|
-
e.mode === "manifest_intent" ? /* @__PURE__ */ o(
|
|
79
|
-
/* @__PURE__ */ n(
|
|
80
|
-
e.intents.length > 0 && /* @__PURE__ */ n(
|
|
81
|
-
|
|
85
|
+
e.mode === "manifest_intent" ? /* @__PURE__ */ o(O, { children: [
|
|
86
|
+
/* @__PURE__ */ n(l, { color: r.content.primary, children: "If customer talks about" }),
|
|
87
|
+
e.intents.length > 0 && /* @__PURE__ */ n(R, { children: e.intents.map((t) => /* @__PURE__ */ n(
|
|
88
|
+
y,
|
|
82
89
|
{
|
|
83
90
|
"data-test": `intent-chip-${t}`,
|
|
84
91
|
size: "chip",
|
|
85
92
|
buttonType: "tertiaryGray",
|
|
86
|
-
buttonText:
|
|
87
|
-
TrailingIcon:
|
|
88
|
-
"aria-label": `Remove ${
|
|
93
|
+
buttonText: p(t),
|
|
94
|
+
TrailingIcon: x,
|
|
95
|
+
"aria-label": `Remove ${p(t)}`,
|
|
89
96
|
onClick: () => I(t)
|
|
90
97
|
},
|
|
91
98
|
t
|
|
92
99
|
)) }),
|
|
93
|
-
|
|
100
|
+
h.length > 0 && // Dashed "+ Intent" button on its own row under the chips;
|
|
94
101
|
// clicking it opens the intent list directly — no intermediate
|
|
95
102
|
// select input.
|
|
96
|
-
/* @__PURE__ */ n(
|
|
97
|
-
|
|
103
|
+
/* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(
|
|
104
|
+
A,
|
|
98
105
|
{
|
|
99
106
|
"data-test": "intent-add-dropdown",
|
|
100
107
|
isSearchable: !0,
|
|
101
108
|
width: "200px",
|
|
102
109
|
placement: "bottom-start",
|
|
103
|
-
options:
|
|
110
|
+
options: h,
|
|
104
111
|
onSelect: (t) => {
|
|
105
|
-
const i =
|
|
106
|
-
i &&
|
|
112
|
+
const i = j(t);
|
|
113
|
+
i && _(i);
|
|
107
114
|
},
|
|
108
115
|
children: /* @__PURE__ */ n(
|
|
109
|
-
|
|
116
|
+
y,
|
|
110
117
|
{
|
|
111
118
|
"data-test": "intent-add-button",
|
|
112
119
|
buttonType: "dashBold",
|
|
113
120
|
size: "medium",
|
|
114
|
-
LeadingIcon:
|
|
121
|
+
LeadingIcon: w,
|
|
115
122
|
buttonText: "Intent"
|
|
116
123
|
}
|
|
117
124
|
)
|
|
118
125
|
}
|
|
119
126
|
) }),
|
|
120
|
-
/* @__PURE__ */ n(
|
|
127
|
+
/* @__PURE__ */ n(d, { color: r.content.secondary, children: "This agent takes over from your main assistant when this intent is detected. The changeover is automatic when you go live." })
|
|
121
128
|
] }) : /* @__PURE__ */ n(
|
|
122
|
-
|
|
129
|
+
E,
|
|
123
130
|
{
|
|
124
131
|
"data-test": "custom-intent",
|
|
125
132
|
label: "Describe the trigger",
|
|
@@ -132,10 +139,10 @@ const y = L[1], Y = () => {
|
|
|
132
139
|
)
|
|
133
140
|
] })
|
|
134
141
|
] });
|
|
135
|
-
},
|
|
142
|
+
}, z = k.div`
|
|
136
143
|
display: flex;
|
|
137
144
|
`;
|
|
138
145
|
export {
|
|
139
|
-
|
|
146
|
+
ot as Step2WhenItStepsIn
|
|
140
147
|
};
|
|
141
148
|
//# sourceMappingURL=Step2WhenItStepsIn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Step2WhenItStepsIn.js","sources":["../../../../../src/components/agent-builder/steps/Step2WhenItStepsIn.tsx"],"sourcesContent":["import CrossIcon from '@src/assets/icons/cross.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { unwrapDropdownValue } from '@src/components/dropdown';\nimport { DropdownPopover } from '@src/components/dropdown/DropdownPopover';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { RadioButton } from '@src/components/radioButton/RadioButton';\nimport { BodyCaption, TitleSmall } from '@src/components/TypographyStyle';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\nimport { TriggerMode } from '../AgentBuilder.model';\nimport {\n\tCardRow,\n\tChipWrap,\n\tFieldBlock,\n\tRadioCard,\n\tRadioCardText,\n\tSectionBodyWrap,\n} from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { STEP_DEFINITIONS } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\n\nconst STEP = STEP_DEFINITIONS[1];\n\nexport const Step2WhenItStepsIn: React.FC = () => {\n\tconst { value, patch, availableIntents, charLimits } =\n\t\tuseAgentBuilderContext();\n\tconst { trigger } = value;\n\n\t// Only the mode changes here. The modes are mutually exclusive on save, but the\n\t// unselected one's data is kept until the merchant leaves this step (see\n\t// `triggerForSelectedMode` in AgentBuilderContext) — so toggling the radio to\n\t// compare the two options doesn't delete what they already picked or typed.\n\tconst setMode = (mode: TriggerMode) =>\n\t\tpatch({ trigger: { ...trigger, mode } });\n\n\tconst addIntent = (intentValue: string) => {\n\t\tif (!trigger.intents.includes(intentValue)) {\n\t\t\tpatch({\n\t\t\t\ttrigger: { ...trigger, intents: [...trigger.intents, intentValue] },\n\t\t\t});\n\t\t}\n\t};\n\n\tconst removeIntent = (intentValue: string) =>\n\t\tpatch({\n\t\t\ttrigger: {\n\t\t\t\t...trigger,\n\t\t\t\tintents: trigger.intents.filter((i) => i !== intentValue),\n\t\t\t},\n\t\t});\n\n\tconst labelFor = (v: string) =>\n\t\tavailableIntents.find((o) => o.value === v)?.label ?? v;\n\n\tconst remainingOptions: SingleOption[] = availableIntents\n\t\t.filter((o) => !trigger.intents.includes(o.value))\n\t\t.map((o) => ({ label: o.label, value: o.value }));\n\n\treturn (\n\t\t<div>\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<CardRow>\n\t\t\t\t\t<RadioCard\n\t\t\t\t\t\tdata-test=\"trigger-mode-manifest\"\n\t\t\t\t\t\tselected={trigger.mode === 'manifest_intent'}\n\t\t\t\t\t\tonClick={() => setMode('manifest_intent')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\tisActive={trigger.mode === 'manifest_intent'}\n\t\t\t\t\t\t\tonValueChange={() => setMode('manifest_intent')}\n\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\tManifest intent\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\tManifest's AI classifier routes conversations automatically\n\t\t\t\t\t\t\t\t— no keywords needed.\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t</RadioCard>\n\n\t\t\t\t\t<RadioCard\n\t\t\t\t\t\tdata-test=\"trigger-mode-custom\"\n\t\t\t\t\t\tselected={trigger.mode === 'custom_intent'}\n\t\t\t\t\t\tonClick={() => setMode('custom_intent')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\tisActive={trigger.mode === 'custom_intent'}\n\t\t\t\t\t\t\tonValueChange={() => setMode('custom_intent')}\n\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\tCustom intent\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\tDefine your own trigger — use exact phrases or describe the\n\t\t\t\t\t\t\t\tcustomer's intent.\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t</RadioCard>\n\t\t\t\t</CardRow>\n\n\t\t\t\t{trigger.mode === 'manifest_intent' ? (\n\t\t\t\t\t<FieldBlock>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\tIf customer talks about\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t{trigger.intents.length > 0 && (\n\t\t\t\t\t\t\t<ChipWrap>\n\t\t\t\t\t\t\t\t{trigger.intents.map((intent) => (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tkey={intent}\n\t\t\t\t\t\t\t\t\t\tdata-test={`intent-chip-${intent}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"chip\"\n\t\t\t\t\t\t\t\t\t\tbuttonType=\"tertiaryGray\"\n\t\t\t\t\t\t\t\t\t\tbuttonText={labelFor(intent)}\n\t\t\t\t\t\t\t\t\t\tTrailingIcon={CrossIcon}\n\t\t\t\t\t\t\t\t\t\taria-label={`Remove ${labelFor(intent)}`}\n\t\t\t\t\t\t\t\t\t\tonClick={() => removeIntent(intent)}\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</ChipWrap>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{remainingOptions.length > 0 && (\n\t\t\t\t\t\t\t// Dashed \"+ Intent\" button on its own row under the chips;\n\t\t\t\t\t\t\t// clicking it opens the intent list directly — no intermediate\n\t\t\t\t\t\t\t// select input.\n\t\t\t\t\t\t\t<AddIntentRow>\n\t\t\t\t\t\t\t\t<DropdownPopover\n\t\t\t\t\t\t\t\t\tdata-test=\"intent-add-dropdown\"\n\t\t\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\t\t\twidth=\"200px\"\n\t\t\t\t\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\t\t\t\t\toptions={remainingOptions}\n\t\t\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\t\t\t\t\taddIntent(v);\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>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tdata-test=\"intent-add-button\"\n\t\t\t\t\t\t\t\t\t\tbuttonType=\"dashBold\"\n\t\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\t\t\t\t\tbuttonText=\"Intent\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</DropdownPopover>\n\t\t\t\t\t\t\t</AddIntentRow>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\tThis agent takes over from your main assistant when this intent is\n\t\t\t\t\t\t\tdetected. The changeover is automatic when you go live.\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t</FieldBlock>\n\t\t\t\t) : (\n\t\t\t\t\t<AiTextArea\n\t\t\t\t\t\tdata-test=\"custom-intent\"\n\t\t\t\t\t\tlabel=\"Describe the trigger\"\n\t\t\t\t\t\tvalue={trigger.custom_intent ?? ''}\n\t\t\t\t\t\tonChange={(text) =>\n\t\t\t\t\t\t\tpatch({ trigger: { ...trigger, custom_intent: text } })\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmaxLength={charLimits.custom_intent}\n\t\t\t\t\t\tplaceholder=\"e.g. The customer wants to cancel an order they placed.\"\n\t\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n\n// Keeps the dashed \"+ Intent\" button at its natural width on its own row.\nconst AddIntentRow = styled.div`\n\tdisplay: flex;\n`;\n"],"names":["STEP","STEP_DEFINITIONS","Step2WhenItStepsIn","value","patch","availableIntents","charLimits","useAgentBuilderContext","trigger","setMode","mode","addIntent","intentValue","removeIntent","labelFor","v","o","remainingOptions","jsx","StepSectionHeader","SectionBodyWrap","jsxs","CardRow","RadioCard","RadioButton","BASE_COLORS","RadioCardText","TitleSmall","COLORS","BodyCaption","FieldBlock","ChipWrap","intent","Button","CrossIcon","AddIntentRow","DropdownPopover","opt","unwrapDropdownValue","PlusIcon","AiTextArea","text","styled"],"mappings":";;;;;;;;;;;;;;;AAyBA,MAAMA,IAAOC,EAAiB,CAAC,GAElBC,IAA+B,MAAM;AACjD,QAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,kBAAAC,GAAkB,YAAAC,EAAA,IACvCC,EAAA,GACK,EAAE,SAAAC,MAAYL,GAMdM,IAAU,CAACC,MAChBN,EAAM,EAAE,SAAS,EAAE,GAAGI,GAAS,MAAAE,EAAA,GAAQ,GAElCC,IAAY,CAACC,MAAwB;AAC1C,IAAKJ,EAAQ,QAAQ,SAASI,CAAW,KACxCR,EAAM;AAAA,MACL,SAAS,EAAE,GAAGI,GAAS,SAAS,CAAC,GAAGA,EAAQ,SAASI,CAAW,EAAA;AAAA,IAAE,CAClE;AAAA,EAEH,GAEMC,IAAe,CAACD,MACrBR,EAAM;AAAA,IACL,SAAS;AAAA,MACR,GAAGI;AAAA,MACH,SAASA,EAAQ,QAAQ,OAAO,CA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;AAClB,oBAAMtB,IAAIuB,EAAoBD,CAAG;AACjC,cAAItB,KACHJ,EAAUI,CAAC;AAAA,YAEb;AAAA,YAEA,UAAA,gBAAAG;AAAA,cAACe;AAAA,cAAA;AAAA,gBACA,aAAU;AAAA,gBACV,YAAW;AAAA,gBACX,MAAK;AAAA,gBACL,aAAaM;AAAAA,gBACb,YAAW;AAAA,cAAA;AAAA,YAAA;AAAA,UACZ;AAAA,QAAA,GAEF;AAAA,0BAEAV,GAAA,EAAY,OAAOD,EAAO,QAAQ,WAAW,UAAA,6HAAA,CAG9C;AAAA,MAAA,EAAA,CACD,IAEA,gBAAAV;AAAA,QAACsB;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,OAAM;AAAA,UACN,OAAOhC,EAAQ,iBAAiB;AAAA,UAChC,UAAU,CAACiC,MACVrC,EAAM,EAAE,SAAS,EAAE,GAAGI,GAAS,eAAeiC,EAAA,GAAQ;AAAA,UAEvD,WAAWnC,EAAW;AAAA,UACtB,aAAY;AAAA,UACZ,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACX,EAAA,CAEF;AAAA,EAAA,GACD;AAEF,GAGM6B,IAAeO,EAAO;AAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"Step2WhenItStepsIn.js","sources":["../../../../../src/components/agent-builder/steps/Step2WhenItStepsIn.tsx"],"sourcesContent":["import CrossIcon from '@src/assets/icons/cross.svg';\nimport PlusIcon from '@src/assets/icons/plus.svg';\nimport React from 'react';\nimport styled from 'styled-components';\nimport { Button } from '@src/components/button';\nimport { unwrapDropdownValue } from '@src/components/dropdown';\nimport { DropdownPopover } from '@src/components/dropdown/DropdownPopover';\nimport { SingleOption } from '@src/components/dropdown/type';\nimport { RadioButton } from '@src/components/radioButton/RadioButton';\nimport { BodyCaption, TitleSmall } from '@src/components/TypographyStyle';\nimport { BASE_COLORS, COLORS } from '@src/constants/Theme';\nimport { TriggerMode } from '../AgentBuilder.model';\nimport {\n\tCardRow,\n\tChipWrap,\n\tFieldBlock,\n\tRadioCard,\n\tRadioCardText,\n\tSectionBodyWrap,\n} from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { resolveAppToken, STEP_DEFINITION_TEMPLATES } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\nimport { appTypeLabel } from '../utils/mentionSerialization';\n\nconst STEP = STEP_DEFINITION_TEMPLATES[1];\n\nexport const Step2WhenItStepsIn: React.FC = () => {\n\tconst { value, patch, availableIntents, charLimits, applicationType } =\n\t\tuseAgentBuilderContext();\n\tconst { trigger } = value;\n\n\t// The first trigger mode is the host product's own intent classifier, so it's\n\t// named after whichever product the merchant is in — \"Manifest intent\" in\n\t// Manifest, \"BIK intent\" in BIK. `trigger.mode` stays `'manifest_intent'`:\n\t// it's a bik-models TriggerMode the backend keys off, not a label.\n\tconst appLabel = appTypeLabel(applicationType);\n\n\t// Only the mode changes here. The modes are mutually exclusive on save, but the\n\t// unselected one's data is kept until the merchant leaves this step (see\n\t// `triggerForSelectedMode` in AgentBuilderContext) — so toggling the radio to\n\t// compare the two options doesn't delete what they already picked or typed.\n\tconst setMode = (mode: TriggerMode) =>\n\t\tpatch({ trigger: { ...trigger, mode } });\n\n\tconst addIntent = (intentValue: string) => {\n\t\tif (!trigger.intents.includes(intentValue)) {\n\t\t\tpatch({\n\t\t\t\ttrigger: { ...trigger, intents: [...trigger.intents, intentValue] },\n\t\t\t});\n\t\t}\n\t};\n\n\tconst removeIntent = (intentValue: string) =>\n\t\tpatch({\n\t\t\ttrigger: {\n\t\t\t\t...trigger,\n\t\t\t\tintents: trigger.intents.filter((i) => i !== intentValue),\n\t\t\t},\n\t\t});\n\n\tconst labelFor = (v: string) =>\n\t\tavailableIntents.find((o) => o.value === v)?.label ?? v;\n\n\tconst remainingOptions: SingleOption[] = availableIntents\n\t\t.filter((o) => !trigger.intents.includes(o.value))\n\t\t.map((o) => ({ label: o.label, value: o.value }));\n\n\treturn (\n\t\t<div>\n\t\t\t<StepSectionHeader\n\t\t\t\ttitle={STEP.title}\n\t\t\t\thelper={resolveAppToken(STEP.helper, appLabel)}\n\t\t\t/>\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<CardRow>\n\t\t\t\t\t<RadioCard\n\t\t\t\t\t\tdata-test=\"trigger-mode-manifest\"\n\t\t\t\t\t\tselected={trigger.mode === 'manifest_intent'}\n\t\t\t\t\t\tonClick={() => setMode('manifest_intent')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\tisActive={trigger.mode === 'manifest_intent'}\n\t\t\t\t\t\t\tonValueChange={() => setMode('manifest_intent')}\n\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\t{`${appLabel} intent`}\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t{`${appLabel}'s AI classifier routes conversations automatically — no keywords needed.`}\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t</RadioCard>\n\n\t\t\t\t\t<RadioCard\n\t\t\t\t\t\tdata-test=\"trigger-mode-custom\"\n\t\t\t\t\t\tselected={trigger.mode === 'custom_intent'}\n\t\t\t\t\t\tonClick={() => setMode('custom_intent')}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RadioButton\n\t\t\t\t\t\t\tisActive={trigger.mode === 'custom_intent'}\n\t\t\t\t\t\t\tonValueChange={() => setMode('custom_intent')}\n\t\t\t\t\t\t\tskipSelectingOff\n\t\t\t\t\t\t\tactiveColor={BASE_COLORS.brand['800']}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RadioCardText>\n\t\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\t\tCustom intent\n\t\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\tDefine your own trigger — use exact phrases or describe the\n\t\t\t\t\t\t\t\tcustomer's intent.\n\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t</RadioCardText>\n\t\t\t\t\t</RadioCard>\n\t\t\t\t</CardRow>\n\n\t\t\t\t{trigger.mode === 'manifest_intent' ? (\n\t\t\t\t\t<FieldBlock>\n\t\t\t\t\t\t<TitleSmall color={COLORS.content.primary}>\n\t\t\t\t\t\t\tIf customer talks about\n\t\t\t\t\t\t</TitleSmall>\n\t\t\t\t\t\t{trigger.intents.length > 0 && (\n\t\t\t\t\t\t\t<ChipWrap>\n\t\t\t\t\t\t\t\t{trigger.intents.map((intent) => (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tkey={intent}\n\t\t\t\t\t\t\t\t\t\tdata-test={`intent-chip-${intent}`}\n\t\t\t\t\t\t\t\t\t\tsize=\"chip\"\n\t\t\t\t\t\t\t\t\t\tbuttonType=\"tertiaryGray\"\n\t\t\t\t\t\t\t\t\t\tbuttonText={labelFor(intent)}\n\t\t\t\t\t\t\t\t\t\tTrailingIcon={CrossIcon}\n\t\t\t\t\t\t\t\t\t\taria-label={`Remove ${labelFor(intent)}`}\n\t\t\t\t\t\t\t\t\t\tonClick={() => removeIntent(intent)}\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</ChipWrap>\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{remainingOptions.length > 0 && (\n\t\t\t\t\t\t\t// Dashed \"+ Intent\" button on its own row under the chips;\n\t\t\t\t\t\t\t// clicking it opens the intent list directly — no intermediate\n\t\t\t\t\t\t\t// select input.\n\t\t\t\t\t\t\t<AddIntentRow>\n\t\t\t\t\t\t\t\t<DropdownPopover\n\t\t\t\t\t\t\t\t\tdata-test=\"intent-add-dropdown\"\n\t\t\t\t\t\t\t\t\tisSearchable\n\t\t\t\t\t\t\t\t\twidth=\"200px\"\n\t\t\t\t\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\t\t\t\t\toptions={remainingOptions}\n\t\t\t\t\t\t\t\t\tonSelect={(opt) => {\n\t\t\t\t\t\t\t\t\t\tconst v = unwrapDropdownValue(opt);\n\t\t\t\t\t\t\t\t\t\tif (v) {\n\t\t\t\t\t\t\t\t\t\t\taddIntent(v);\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>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tdata-test=\"intent-add-button\"\n\t\t\t\t\t\t\t\t\t\tbuttonType=\"dashBold\"\n\t\t\t\t\t\t\t\t\t\tsize=\"medium\"\n\t\t\t\t\t\t\t\t\t\tLeadingIcon={PlusIcon}\n\t\t\t\t\t\t\t\t\t\tbuttonText=\"Intent\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</DropdownPopover>\n\t\t\t\t\t\t\t</AddIntentRow>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\tThis agent takes over from your main assistant when this intent is\n\t\t\t\t\t\t\tdetected. The changeover is automatic when you go live.\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t</FieldBlock>\n\t\t\t\t) : (\n\t\t\t\t\t<AiTextArea\n\t\t\t\t\t\tdata-test=\"custom-intent\"\n\t\t\t\t\t\tlabel=\"Describe the trigger\"\n\t\t\t\t\t\tvalue={trigger.custom_intent ?? ''}\n\t\t\t\t\t\tonChange={(text) =>\n\t\t\t\t\t\t\tpatch({ trigger: { ...trigger, custom_intent: text } })\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmaxLength={charLimits.custom_intent}\n\t\t\t\t\t\tplaceholder=\"e.g. The customer wants to cancel an order they placed.\"\n\t\t\t\t\t\tminHeight=\"120px\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n\n// Keeps the dashed \"+ Intent\" button at its natural width on its own row.\nconst AddIntentRow = styled.div`\n\tdisplay: flex;\n`;\n"],"names":["STEP","STEP_DEFINITION_TEMPLATES","Step2WhenItStepsIn","value","patch","availableIntents","charLimits","applicationType","useAgentBuilderContext","trigger","appLabel","appTypeLabel","setMode","mode","addIntent","intentValue","removeIntent","labelFor","v","o","remainingOptions","jsx","StepSectionHeader","resolveAppToken","SectionBodyWrap","jsxs","CardRow","RadioCard","RadioButton","BASE_COLORS","RadioCardText","TitleSmall","COLORS","BodyCaption","FieldBlock","ChipWrap","intent","Button","CrossIcon","AddIntentRow","DropdownPopover","opt","unwrapDropdownValue","PlusIcon","AiTextArea","text","styled"],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAMA,IAAOC,EAA0B,CAAC,GAE3BC,KAA+B,MAAM;AACjD,QAAM,EAAE,OAAAC,GAAO,OAAAC,GAAO,kBAAAC,GAAkB,YAAAC,GAAY,iBAAAC,EAAA,IACnDC,EAAA,GACK,EAAE,SAAAC,MAAYN,GAMdO,IAAWC,EAAaJ,CAAe,GAMvCK,IAAU,CAACC,MAChBT,EAAM,EAAE,SAAS,EAAE,GAAGK,GAAS,MAAAI,EAAA,GAAQ,GAElCC,IAAY,CAACC,MAAwB;AAC1C,IAAKN,EAAQ,QAAQ,SAASM,CAAW,KACxCX,EAAM;AAAA,MACL,SAAS,EAAE,GAAGK,GAAS,SAAS,CAAC,GAAGA,EAAQ,SAASM,CAAW,EAAA;AAAA,IAAE,CAClE;AAAA,EAEH,GAEMC,IAAe,CAACD,MACrBX,EAAM;AAAA,IACL,SAAS;AAAA,MACR,GAAGK;AAAA,MACH,SAASA,EAAQ,QAA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