@bikdotai/bik-component-library 0.0.865-beta.2 → 0.0.865-beta.4

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 (126) 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 +174 -42
  4. package/dist/cjs/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/AgentStateModal.js +2 -0
  6. package/dist/cjs/components/agent-builder/components/AgentStateModal.js.map +1 -0
  7. package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js +2 -0
  8. package/dist/cjs/components/agent-builder/components/ChannelSelectModal.js.map +1 -0
  9. package/dist/cjs/components/agent-builder/components/ChannelsSection.js +2 -0
  10. package/dist/cjs/components/agent-builder/components/ChannelsSection.js.map +1 -0
  11. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.js +5 -5
  12. package/dist/cjs/components/agent-builder/components/CreateSubAgentPanel.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 +4 -4
  36. package/dist/cjs/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  37. package/dist/cjs/components/agent-listing/AgentTableRow.js +1 -1
  38. package/dist/cjs/components/agent-listing/AgentTableRow.js.map +1 -1
  39. package/dist/cjs/components/button/Button.js +1 -1
  40. package/dist/cjs/components/button/Button.js.map +1 -1
  41. package/dist/cjs/components/button/Button.styled.js +2 -2
  42. package/dist/cjs/components/button/Button.styled.js.map +1 -1
  43. package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
  44. package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
  45. package/dist/cjs/components/tag/Tag.js +1 -1
  46. package/dist/cjs/components/tag/Tag.js.map +1 -1
  47. package/dist/cjs/components/tag/Tag.styled.js +4 -4
  48. package/dist/cjs/components/tag/Tag.styled.js.map +1 -1
  49. package/dist/cjs/components/tag/model.js.map +1 -1
  50. package/dist/cjs/icons/BIK AI specific/WandSparkles.js +1 -1
  51. package/dist/cjs/icons/BIK AI specific/WandSparkles.js.map +1 -1
  52. package/dist/cjs/index.js +1 -1
  53. package/dist/esm/components/agent-builder/AgentBuilder.js +105 -99
  54. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  55. package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +76 -0
  56. package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +91 -0
  57. package/dist/esm/components/agent-builder/AgentBuilder.styled.js +271 -93
  58. package/dist/esm/components/agent-builder/AgentBuilder.styled.js.map +1 -1
  59. package/dist/esm/components/agent-builder/components/AgentStateModal.d.ts +47 -0
  60. package/dist/esm/components/agent-builder/components/AgentStateModal.js +82 -0
  61. package/dist/esm/components/agent-builder/components/AgentStateModal.js.map +1 -0
  62. package/dist/esm/components/agent-builder/components/ChannelSelectModal.d.ts +26 -0
  63. package/dist/esm/components/agent-builder/components/ChannelSelectModal.js +121 -0
  64. package/dist/esm/components/agent-builder/components/ChannelSelectModal.js.map +1 -0
  65. package/dist/esm/components/agent-builder/components/ChannelsSection.d.ts +10 -0
  66. package/dist/esm/components/agent-builder/components/ChannelsSection.js +183 -0
  67. package/dist/esm/components/agent-builder/components/ChannelsSection.js.map +1 -0
  68. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js +135 -132
  69. package/dist/esm/components/agent-builder/components/CreateSubAgentPanel.js.map +1 -1
  70. package/dist/esm/components/agent-builder/components/MentionEditor.d.ts +2 -0
  71. package/dist/esm/components/agent-builder/components/MentionEditor.js +47 -45
  72. package/dist/esm/components/agent-builder/components/MentionEditor.js.map +1 -1
  73. package/dist/esm/components/agent-builder/components/MentionField.js +52 -51
  74. package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
  75. package/dist/esm/components/agent-builder/components/MentionPicker.d.ts +5 -0
  76. package/dist/esm/components/agent-builder/components/MentionPicker.js +134 -132
  77. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  78. package/dist/esm/components/agent-builder/components/SelectableListSection.d.ts +2 -0
  79. package/dist/esm/components/agent-builder/components/SelectableListSection.js +58 -63
  80. package/dist/esm/components/agent-builder/components/SelectableListSection.js.map +1 -1
  81. package/dist/esm/components/agent-builder/constants/channels.d.ts +56 -0
  82. package/dist/esm/components/agent-builder/constants/channels.js +41 -0
  83. package/dist/esm/components/agent-builder/constants/channels.js.map +1 -0
  84. package/dist/esm/components/agent-builder/constants/steps.d.ts +31 -1
  85. package/dist/esm/components/agent-builder/constants/steps.js +15 -6
  86. package/dist/esm/components/agent-builder/constants/steps.js.map +1 -1
  87. package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +13 -1
  88. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +192 -175
  89. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  90. package/dist/esm/components/agent-builder/index.d.ts +7 -2
  91. package/dist/esm/components/agent-builder/steps/Step1About.js +15 -13
  92. package/dist/esm/components/agent-builder/steps/Step1About.js.map +1 -1
  93. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js +54 -49
  94. package/dist/esm/components/agent-builder/steps/Step2WhenItStepsIn.js.map +1 -1
  95. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js +158 -157
  96. package/dist/esm/components/agent-builder/steps/Step3HowItResponds.js.map +1 -1
  97. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.d.ts +11 -0
  98. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js +127 -23
  99. package/dist/esm/components/agent-builder/steps/Step4HandoverRules.js.map +1 -1
  100. package/dist/esm/components/agent-builder/utils/mentionSerialization.d.ts +7 -2
  101. package/dist/esm/components/agent-builder/utils/mentionSerialization.js +2 -2
  102. package/dist/esm/components/agent-builder/utils/mentionSerialization.js.map +1 -1
  103. package/dist/esm/components/agent-listing/AgentTableRow.js +71 -38
  104. package/dist/esm/components/agent-listing/AgentTableRow.js.map +1 -1
  105. package/dist/esm/components/button/Button.js +19 -21
  106. package/dist/esm/components/button/Button.js.map +1 -1
  107. package/dist/esm/components/button/Button.styled.d.ts +0 -1
  108. package/dist/esm/components/button/Button.styled.js +5 -5
  109. package/dist/esm/components/button/Button.styled.js.map +1 -1
  110. package/dist/esm/components/button/model.d.ts +0 -5
  111. package/dist/esm/components/dropdown-button/DropdownButton.d.ts +0 -5
  112. package/dist/esm/components/dropdown-button/DropdownButton.js +3 -4
  113. package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
  114. package/dist/esm/components/tag/Tag.d.ts +1 -1
  115. package/dist/esm/components/tag/Tag.js +41 -48
  116. package/dist/esm/components/tag/Tag.js.map +1 -1
  117. package/dist/esm/components/tag/Tag.styled.d.ts +0 -3
  118. package/dist/esm/components/tag/Tag.styled.js +9 -6
  119. package/dist/esm/components/tag/Tag.styled.js.map +1 -1
  120. package/dist/esm/components/tag/model.d.ts +0 -11
  121. package/dist/esm/components/tag/model.js.map +1 -1
  122. package/dist/esm/icons/BIK AI specific/WandSparkles.js +1 -1
  123. package/dist/esm/icons/BIK AI specific/WandSparkles.js.map +1 -1
  124. package/dist/esm/index.js +644 -634
  125. package/dist/esm/index.js.map +1 -1
  126. package/package.json +1 -1
@@ -1,27 +1,28 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import { SectionBodyWrap as m } from "../AgentBuilder.styled.js";
3
3
  import { AiTextArea as l } from "../components/AiTextArea.js";
4
- import { StepSectionHeader as p } from "../components/StepSectionHeader.js";
4
+ import { ChannelsSection as p } from "../components/ChannelsSection.js";
5
+ import { StepSectionHeader as s } from "../components/StepSectionHeader.js";
5
6
  import { STEP_DEFINITIONS as d } from "../constants/steps.js";
6
- import { useAgentBuilderContext as s } from "../context/AgentBuilderContext.js";
7
- import { Input as c } from "../../input/Input.js";
8
- const o = d[0], b = () => {
9
- const { value: i, updateField: a, charLimits: n } = s();
7
+ import { useAgentBuilderContext as c } from "../context/AgentBuilderContext.js";
8
+ import { Input as h } from "../../input/Input.js";
9
+ const o = d[0], v = () => {
10
+ const { value: i, updateField: n, charLimits: a } = c();
10
11
  return /* @__PURE__ */ r("div", { className: "bik-agent-step bik-agent-step--about", children: [
11
- /* @__PURE__ */ e(p, { title: o.title, helper: o.helper }),
12
+ /* @__PURE__ */ e(s, { title: o.title, helper: o.helper }),
12
13
  /* @__PURE__ */ r(m, { children: [
13
14
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
14
- c,
15
+ h,
15
16
  {
16
17
  "data-test": "agent-name",
17
18
  labelText: "Agent name",
18
19
  labelTextBold: !0,
19
20
  placeholder: "Enter agent name",
20
21
  value: i.name,
21
- maxCharLimit: n.name,
22
+ maxCharLimit: a.name,
22
23
  maxCharLimitPosition: "TOP",
23
24
  maxCharStyle: { fontSize: 12, lineHeight: "16px" },
24
- onChangeText: (t) => a("name", t)
25
+ onChangeText: (t) => n("name", t)
25
26
  }
26
27
  ) }),
27
28
  /* @__PURE__ */ e(
@@ -30,16 +31,17 @@ const o = d[0], b = () => {
30
31
  "data-test": "agent-description",
31
32
  label: "What it does",
32
33
  value: i.description,
33
- onChange: (t) => a("description", t),
34
- maxLength: n.description,
34
+ onChange: (t) => n("description", t),
35
+ maxLength: a.description,
35
36
  placeholder: "Enter description",
36
37
  minHeight: "200px"
37
38
  }
38
- )
39
+ ),
40
+ /* @__PURE__ */ e(p, {})
39
41
  ] })
40
42
  ] });
41
43
  };
42
44
  export {
43
- b as Step1About
45
+ v as Step1About
44
46
  };
45
47
  //# sourceMappingURL=Step1About.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Step1About.js","sources":["../../../../../src/components/agent-builder/steps/Step1About.tsx"],"sourcesContent":["import React from 'react';\nimport { Input } from '@src/components/input';\nimport { SectionBodyWrap } 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[0];\n\nexport const Step1About: React.FC = () => {\n\tconst { value, updateField, charLimits } = useAgentBuilderContext();\n\n\treturn (\n\t\t<div className=\"bik-agent-step bik-agent-step--about\">\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<div>\n\t\t\t\t\t<Input\n\t\t\t\t\t\tdata-test=\"agent-name\"\n\t\t\t\t\t\tlabelText=\"Agent name\"\n\t\t\t\t\t\tlabelTextBold\n\t\t\t\t\t\tplaceholder=\"Enter agent name\"\n\t\t\t\t\t\tvalue={value.name}\n\t\t\t\t\t\tmaxCharLimit={charLimits.name}\n\t\t\t\t\t\tmaxCharLimitPosition=\"TOP\"\n\t\t\t\t\t\tmaxCharStyle={{ fontSize: 12, lineHeight: '16px' }}\n\t\t\t\t\t\tonChangeText={(text) => updateField('name', text)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t<AiTextArea\n\t\t\t\t\tdata-test=\"agent-description\"\n\t\t\t\t\tlabel=\"What it does\"\n\t\t\t\t\tvalue={value.description}\n\t\t\t\t\tonChange={(text) => updateField('description', text)}\n\t\t\t\t\tmaxLength={charLimits.description}\n\t\t\t\t\tplaceholder=\"Enter description\"\n\t\t\t\t\tminHeight=\"200px\"\n\t\t\t\t/>\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n"],"names":["STEP","STEP_DEFINITIONS","Step1About","value","updateField","charLimits","useAgentBuilderContext","jsxs","jsx","StepSectionHeader","SectionBodyWrap","Input","text","AiTextArea"],"mappings":";;;;;;;AAQA,MAAMA,IAAOC,EAAiB,CAAC,GAElBC,IAAuB,MAAM;AACzC,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,YAAAC,EAAA,IAAeC,EAAA;AAE3C,SACC,gBAAAC,EAAC,OAAA,EAAI,WAAU,wCACd,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAkB,OAAOT,EAAK,OAAO,QAAQA,EAAK,QAAQ;AAAA,sBAE1DU,GAAA,EACA,UAAA;AAAA,MAAA,gBAAAF,EAAC,OAAA,EACA,UAAA,gBAAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,WAAU;AAAA,UACV,eAAa;AAAA,UACb,aAAY;AAAA,UACZ,OAAOR,EAAM;AAAA,UACb,cAAcE,EAAW;AAAA,UACzB,sBAAqB;AAAA,UACrB,cAAc,EAAE,UAAU,IAAI,YAAY,OAAA;AAAA,UAC1C,cAAc,CAACO,MAASR,EAAY,QAAQQ,CAAI;AAAA,QAAA;AAAA,MAAA,GAElD;AAAA,MAEA,gBAAAJ;AAAA,QAACK;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,OAAM;AAAA,UACN,OAAOV,EAAM;AAAA,UACb,UAAU,CAACS,MAASR,EAAY,eAAeQ,CAAI;AAAA,UACnD,WAAWP,EAAW;AAAA,UACtB,aAAY;AAAA,UACZ,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACX,EAAA,CACD;AAAA,EAAA,GACD;AAEF;"}
1
+ {"version":3,"file":"Step1About.js","sources":["../../../../../src/components/agent-builder/steps/Step1About.tsx"],"sourcesContent":["import React from 'react';\nimport { Input } from '@src/components/input';\nimport { SectionBodyWrap } from '../AgentBuilder.styled';\nimport { AiTextArea } from '../components/AiTextArea';\nimport { ChannelsSection } from '../components/ChannelsSection';\nimport { StepSectionHeader } from '../components/StepSectionHeader';\nimport { STEP_DEFINITIONS } from '../constants/steps';\nimport { useAgentBuilderContext } from '../context/AgentBuilderContext';\n\nconst STEP = STEP_DEFINITIONS[0];\n\nexport const Step1About: React.FC = () => {\n\tconst { value, updateField, charLimits } = useAgentBuilderContext();\n\n\treturn (\n\t\t<div className=\"bik-agent-step bik-agent-step--about\">\n\t\t\t<StepSectionHeader title={STEP.title} helper={STEP.helper} />\n\n\t\t\t<SectionBodyWrap>\n\t\t\t\t<div>\n\t\t\t\t\t<Input\n\t\t\t\t\t\tdata-test=\"agent-name\"\n\t\t\t\t\t\tlabelText=\"Agent name\"\n\t\t\t\t\t\tlabelTextBold\n\t\t\t\t\t\tplaceholder=\"Enter agent name\"\n\t\t\t\t\t\tvalue={value.name}\n\t\t\t\t\t\tmaxCharLimit={charLimits.name}\n\t\t\t\t\t\tmaxCharLimitPosition=\"TOP\"\n\t\t\t\t\t\tmaxCharStyle={{ fontSize: 12, lineHeight: '16px' }}\n\t\t\t\t\t\tonChangeText={(text) => updateField('name', text)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t<AiTextArea\n\t\t\t\t\tdata-test=\"agent-description\"\n\t\t\t\t\tlabel=\"What it does\"\n\t\t\t\t\tvalue={value.description}\n\t\t\t\t\tonChange={(text) => updateField('description', text)}\n\t\t\t\t\tmaxLength={charLimits.description}\n\t\t\t\t\tplaceholder=\"Enter description\"\n\t\t\t\t\tminHeight=\"200px\"\n\t\t\t\t/>\n\n\t\t\t\t<ChannelsSection />\n\t\t\t</SectionBodyWrap>\n\t\t</div>\n\t);\n};\n"],"names":["STEP","STEP_DEFINITIONS","Step1About","value","updateField","charLimits","useAgentBuilderContext","jsxs","jsx","StepSectionHeader","SectionBodyWrap","Input","text","AiTextArea","ChannelsSection"],"mappings":";;;;;;;;AASA,MAAMA,IAAOC,EAAiB,CAAC,GAElBC,IAAuB,MAAM;AACzC,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,YAAAC,EAAA,IAAeC,EAAA;AAE3C,SACC,gBAAAC,EAAC,OAAA,EAAI,WAAU,wCACd,UAAA;AAAA,IAAA,gBAAAC,EAACC,KAAkB,OAAOT,EAAK,OAAO,QAAQA,EAAK,QAAQ;AAAA,sBAE1DU,GAAA,EACA,UAAA;AAAA,MAAA,gBAAAF,EAAC,OAAA,EACA,UAAA,gBAAAA;AAAA,QAACG;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,WAAU;AAAA,UACV,eAAa;AAAA,UACb,aAAY;AAAA,UACZ,OAAOR,EAAM;AAAA,UACb,cAAcE,EAAW;AAAA,UACzB,sBAAqB;AAAA,UACrB,cAAc,EAAE,UAAU,IAAI,YAAY,OAAA;AAAA,UAC1C,cAAc,CAACO,MAASR,EAAY,QAAQQ,CAAI;AAAA,QAAA;AAAA,MAAA,GAElD;AAAA,MAEA,gBAAAJ;AAAA,QAACK;AAAA,QAAA;AAAA,UACA,aAAU;AAAA,UACV,OAAM;AAAA,UACN,OAAOV,EAAM;AAAA,UACb,UAAU,CAACS,MAASR,EAAY,eAAeQ,CAAI;AAAA,UACnD,WAAWP,EAAW;AAAA,UACtB,aAAY;AAAA,UACZ,WAAU;AAAA,QAAA;AAAA,MAAA;AAAA,wBAGVS,GAAA,CAAA,CAAgB;AAAA,IAAA,EAAA,CAClB;AAAA,EAAA,GACD;AAEF;"}
@@ -1,35 +1,40 @@
1
1
  import { jsxs as o, jsx as n } from "react/jsx-runtime";
2
- import I from "../../../assets/icons/cross.svg.js";
3
- import T from "../../../assets/icons/plus.svg.js";
4
- import x from "styled-components";
5
- import { DropdownPopover as w } from "../../dropdown/DropdownPopover/index.js";
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
6
  import { RadioButton as u } from "../../radioButton/RadioButton.js";
7
- import { TitleSmall as c, BodyCaption as l } from "../../TypographyStyle.js";
8
- import { BASE_COLORS as h, COLORS as r } from "../../../constants/Theme.js";
9
- import { SectionBodyWrap as k, CardRow as A, RadioCard as f, RadioCardText as g, FieldBlock as B, ChipWrap as O } from "../AgentBuilder.styled.js";
10
- import { AiTextArea as R } from "../components/AiTextArea.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 { STEP_DEFINITIONS as L } from "../constants/steps.js";
13
- import { useAgentBuilderContext as E } from "../context/AgentBuilderContext.js";
14
- import { Button as v } from "../../button/Button.js";
15
- import { unwrapDropdownValue as P } from "../../dropdown/utils.js";
16
- const y = L[1], Y = () => {
17
- const { value: b, patch: a, availableIntents: d, charLimits: C } = E(), { trigger: e } = b, s = (t) => a({
18
- trigger: t === "manifest_intent" ? { ...e, mode: t, custom_intent: "" } : { ...e, mode: t, intents: [] }
19
- }), S = (t) => {
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) => {
20
19
  e.intents.includes(t) || a({
21
20
  trigger: { ...e, intents: [...e.intents, t] }
22
21
  });
23
- }, _ = (t) => a({
22
+ }, I = (t) => a({
24
23
  trigger: {
25
24
  ...e,
26
25
  intents: e.intents.filter((i) => i !== t)
27
26
  }
28
- }), m = (t) => d.find((i) => i.value === t)?.label ?? t, p = d.filter((t) => !e.intents.includes(t.value)).map((t) => ({ label: t.label, value: t.value }));
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 }));
29
28
  return /* @__PURE__ */ o("div", { children: [
30
- /* @__PURE__ */ n(D, { title: y.title, helper: y.helper }),
31
- /* @__PURE__ */ o(k, { children: [
32
- /* @__PURE__ */ o(A, { children: [
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: [
33
38
  /* @__PURE__ */ o(
34
39
  f,
35
40
  {
@@ -43,12 +48,12 @@ const y = L[1], Y = () => {
43
48
  isActive: e.mode === "manifest_intent",
44
49
  onValueChange: () => s("manifest_intent"),
45
50
  skipSelectingOff: !0,
46
- activeColor: h.brand[800]
51
+ activeColor: g.brand[800]
47
52
  }
48
53
  ),
49
- /* @__PURE__ */ o(g, { children: [
50
- /* @__PURE__ */ n(c, { color: r.content.primary, children: "Manifest intent" }),
51
- /* @__PURE__ */ n(l, { color: r.content.secondary, children: "Manifest's AI classifier routes conversations automatically — no keywords needed." })
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.` })
52
57
  ] })
53
58
  ]
54
59
  }
@@ -66,62 +71,62 @@ const y = L[1], Y = () => {
66
71
  isActive: e.mode === "custom_intent",
67
72
  onValueChange: () => s("custom_intent"),
68
73
  skipSelectingOff: !0,
69
- activeColor: h.brand[800]
74
+ activeColor: g.brand[800]
70
75
  }
71
76
  ),
72
- /* @__PURE__ */ o(g, { children: [
73
- /* @__PURE__ */ n(c, { color: r.content.primary, children: "Custom intent" }),
74
- /* @__PURE__ */ n(l, { color: r.content.secondary, children: "Define your own trigger — use exact phrases or describe the customer's intent." })
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." })
75
80
  ] })
76
81
  ]
77
82
  }
78
83
  )
79
84
  ] }),
80
- e.mode === "manifest_intent" ? /* @__PURE__ */ o(B, { children: [
81
- /* @__PURE__ */ n(c, { color: r.content.primary, children: "If customer talks about" }),
82
- e.intents.length > 0 && /* @__PURE__ */ n(O, { children: e.intents.map((t) => /* @__PURE__ */ n(
83
- v,
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,
84
89
  {
85
90
  "data-test": `intent-chip-${t}`,
86
91
  size: "chip",
87
92
  buttonType: "tertiaryGray",
88
- buttonText: m(t),
89
- TrailingIcon: I,
90
- "aria-label": `Remove ${m(t)}`,
91
- onClick: () => _(t)
93
+ buttonText: p(t),
94
+ TrailingIcon: x,
95
+ "aria-label": `Remove ${p(t)}`,
96
+ onClick: () => I(t)
92
97
  },
93
98
  t
94
99
  )) }),
95
- p.length > 0 && // Dashed "+ Intent" button on its own row under the chips;
100
+ h.length > 0 && // Dashed "+ Intent" button on its own row under the chips;
96
101
  // clicking it opens the intent list directly — no intermediate
97
102
  // select input.
98
- /* @__PURE__ */ n(F, { children: /* @__PURE__ */ n(
99
- w,
103
+ /* @__PURE__ */ n(z, { children: /* @__PURE__ */ n(
104
+ A,
100
105
  {
101
106
  "data-test": "intent-add-dropdown",
102
107
  isSearchable: !0,
103
108
  width: "200px",
104
109
  placement: "bottom-start",
105
- options: p,
110
+ options: h,
106
111
  onSelect: (t) => {
107
- const i = P(t);
108
- i && S(i);
112
+ const i = j(t);
113
+ i && _(i);
109
114
  },
110
115
  children: /* @__PURE__ */ n(
111
- v,
116
+ y,
112
117
  {
113
118
  "data-test": "intent-add-button",
114
119
  buttonType: "dashBold",
115
120
  size: "medium",
116
- LeadingIcon: T,
121
+ LeadingIcon: w,
117
122
  buttonText: "Intent"
118
123
  }
119
124
  )
120
125
  }
121
126
  ) }),
122
- /* @__PURE__ */ n(l, { 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." })
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." })
123
128
  ] }) : /* @__PURE__ */ n(
124
- R,
129
+ E,
125
130
  {
126
131
  "data-test": "custom-intent",
127
132
  label: "Describe the trigger",
@@ -134,10 +139,10 @@ const y = L[1], Y = () => {
134
139
  )
135
140
  ] })
136
141
  ] });
137
- }, F = x.div`
142
+ }, z = k.div`
138
143
  display: flex;
139
144
  `;
140
145
  export {
141
- Y as Step2WhenItStepsIn
146
+ ot as Step2WhenItStepsIn
142
147
  };
143
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// The two modes are mutually exclusive, so switching clears the other mode's\n\t// data — otherwise both manifest intents AND a custom intent get saved.\n\tconst setMode = (mode: TriggerMode) =>\n\t\tpatch({\n\t\t\ttrigger:\n\t\t\t\tmode === 'manifest_intent'\n\t\t\t\t\t? { ...trigger, mode, custom_intent: '' }\n\t\t\t\t\t: { ...trigger, mode, intents: [] },\n\t\t});\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&apos;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&apos;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,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;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&apos;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,IAAO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