@botonic/plugin-flow-builder 0.57.0-rslib-esm.1 → 0.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (906) hide show
  1. package/README.md +1 -1
  2. package/lib/cjs/action/ai-agent-from-user-input.d.ts +3 -0
  3. package/lib/cjs/action/ai-agent-from-user-input.js +38 -0
  4. package/lib/cjs/action/ai-agent-from-user-input.js.map +1 -0
  5. package/lib/cjs/action/context.d.ts +11 -0
  6. package/lib/cjs/action/context.js +17 -0
  7. package/lib/cjs/action/context.js.map +1 -0
  8. package/lib/cjs/action/fallback.d.ts +3 -0
  9. package/lib/cjs/action/fallback.js +36 -0
  10. package/lib/cjs/action/fallback.js.map +1 -0
  11. package/lib/cjs/action/first-interaction.d.ts +3 -0
  12. package/lib/cjs/action/first-interaction.js +93 -0
  13. package/lib/cjs/action/first-interaction.js.map +1 -0
  14. package/lib/cjs/action/get-contents.d.ts +3 -0
  15. package/lib/cjs/action/get-contents.js +44 -0
  16. package/lib/cjs/action/get-contents.js.map +1 -0
  17. package/lib/cjs/action/index.d.ts +25 -0
  18. package/lib/cjs/action/index.js +95 -0
  19. package/lib/cjs/action/index.js.map +1 -0
  20. package/lib/cjs/action/payload.d.ts +3 -0
  21. package/lib/cjs/action/payload.js +74 -0
  22. package/lib/cjs/action/payload.js.map +1 -0
  23. package/lib/cjs/api.d.ts +45 -0
  24. package/lib/cjs/api.js +227 -0
  25. package/lib/cjs/api.js.map +1 -0
  26. package/lib/cjs/bot-context-manager.d.ts +17 -0
  27. package/lib/cjs/bot-context-manager.js +93 -0
  28. package/lib/cjs/bot-context-manager.js.map +1 -0
  29. package/lib/cjs/constants.d.ts +14 -0
  30. package/lib/cjs/constants.js +20 -0
  31. package/lib/cjs/constants.js.map +1 -0
  32. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
  33. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js +12 -0
  34. package/lib/cjs/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
  35. package/lib/cjs/content-fields/content-fields-base.d.ts +20 -0
  36. package/lib/cjs/content-fields/content-fields-base.js +74 -0
  37. package/lib/cjs/content-fields/content-fields-base.js.map +1 -0
  38. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
  39. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
  40. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
  41. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
  42. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
  43. package/lib/cjs/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
  44. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
  45. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
  46. package/lib/cjs/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
  47. package/lib/cjs/content-fields/flow-ai-agent-base.d.ts +25 -0
  48. package/lib/cjs/content-fields/flow-ai-agent-base.js +97 -0
  49. package/lib/cjs/content-fields/flow-ai-agent-base.js.map +1 -0
  50. package/lib/cjs/content-fields/flow-ai-agent-router.d.ts +21 -0
  51. package/lib/cjs/content-fields/flow-ai-agent-router.js +126 -0
  52. package/lib/cjs/content-fields/flow-ai-agent-router.js.map +1 -0
  53. package/lib/cjs/content-fields/flow-ai-agent.d.ts +17 -0
  54. package/lib/cjs/content-fields/flow-ai-agent.js +65 -0
  55. package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -0
  56. package/lib/cjs/content-fields/flow-bot-action.d.ts +14 -0
  57. package/lib/cjs/content-fields/flow-bot-action.js +45 -0
  58. package/lib/cjs/content-fields/flow-bot-action.js.map +1 -0
  59. package/lib/cjs/content-fields/flow-button.d.ts +31 -0
  60. package/lib/cjs/content-fields/flow-button.js +86 -0
  61. package/lib/cjs/content-fields/flow-button.js.map +1 -0
  62. package/lib/cjs/content-fields/flow-capture-user-input.d.ts +14 -0
  63. package/lib/cjs/content-fields/flow-capture-user-input.js +45 -0
  64. package/lib/cjs/content-fields/flow-capture-user-input.js.map +1 -0
  65. package/lib/cjs/content-fields/flow-carousel.d.ts +22 -0
  66. package/lib/cjs/content-fields/flow-carousel.js +152 -0
  67. package/lib/cjs/content-fields/flow-carousel.js.map +1 -0
  68. package/lib/cjs/content-fields/flow-channel-conditional.d.ts +14 -0
  69. package/lib/cjs/content-fields/flow-channel-conditional.js +57 -0
  70. package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -0
  71. package/lib/cjs/content-fields/flow-contact-reasons-conditional.d.ts +14 -0
  72. package/lib/cjs/content-fields/flow-contact-reasons-conditional.js +65 -0
  73. package/lib/cjs/content-fields/flow-contact-reasons-conditional.js.map +1 -0
  74. package/lib/cjs/content-fields/flow-country-conditional.d.ts +13 -0
  75. package/lib/cjs/content-fields/flow-country-conditional.js +59 -0
  76. package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -0
  77. package/lib/cjs/content-fields/flow-custom-conditional.d.ts +17 -0
  78. package/lib/cjs/content-fields/flow-custom-conditional.js +89 -0
  79. package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -0
  80. package/lib/cjs/content-fields/flow-do-nothing.d.ts +9 -0
  81. package/lib/cjs/content-fields/flow-do-nothing.js +27 -0
  82. package/lib/cjs/content-fields/flow-do-nothing.js.map +1 -0
  83. package/lib/cjs/content-fields/flow-element.d.ts +22 -0
  84. package/lib/cjs/content-fields/flow-element.js +50 -0
  85. package/lib/cjs/content-fields/flow-element.js.map +1 -0
  86. package/lib/cjs/content-fields/flow-go-to-flow.d.ts +13 -0
  87. package/lib/cjs/content-fields/flow-go-to-flow.js +51 -0
  88. package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -0
  89. package/lib/cjs/content-fields/flow-handoff.d.ts +23 -0
  90. package/lib/cjs/content-fields/flow-handoff.js +104 -0
  91. package/lib/cjs/content-fields/flow-handoff.js.map +1 -0
  92. package/lib/cjs/content-fields/flow-image.d.ts +10 -0
  93. package/lib/cjs/content-fields/flow-image.js +33 -0
  94. package/lib/cjs/content-fields/flow-image.js.map +1 -0
  95. package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +30 -0
  96. package/lib/cjs/content-fields/flow-queue-status-conditional.js +95 -0
  97. package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -0
  98. package/lib/cjs/content-fields/flow-rating.d.ts +15 -0
  99. package/lib/cjs/content-fields/flow-rating.js +66 -0
  100. package/lib/cjs/content-fields/flow-rating.js.map +1 -0
  101. package/lib/cjs/content-fields/flow-text.d.ts +15 -0
  102. package/lib/cjs/content-fields/flow-text.js +60 -0
  103. package/lib/cjs/content-fields/flow-text.js.map +1 -0
  104. package/lib/cjs/content-fields/flow-video.d.ts +10 -0
  105. package/lib/cjs/content-fields/flow-video.js +33 -0
  106. package/lib/cjs/content-fields/flow-video.js.map +1 -0
  107. package/lib/cjs/content-fields/flow-webview.d.ts +16 -0
  108. package/lib/cjs/content-fields/flow-webview.js +78 -0
  109. package/lib/cjs/content-fields/flow-webview.js.map +1 -0
  110. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +21 -0
  111. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +92 -0
  112. package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
  113. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.d.ts +11 -0
  114. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js +46 -0
  115. package/lib/cjs/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
  116. package/lib/cjs/content-fields/flow-whatsapp-template.d.ts +37 -0
  117. package/lib/cjs/content-fields/flow-whatsapp-template.js +264 -0
  118. package/lib/cjs/content-fields/flow-whatsapp-template.js.map +1 -0
  119. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.d.ts +21 -0
  120. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js +3 -0
  121. package/lib/cjs/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
  122. package/lib/cjs/content-fields/hubtype-fields/ai-agent.d.ts +25 -0
  123. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js +3 -0
  124. package/lib/cjs/content-fields/hubtype-fields/ai-agent.js.map +1 -0
  125. package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +10 -0
  126. package/lib/cjs/content-fields/hubtype-fields/bot-action.js +3 -0
  127. package/lib/cjs/content-fields/hubtype-fields/bot-action.js.map +1 -0
  128. package/lib/cjs/content-fields/hubtype-fields/button.d.ts +8 -0
  129. package/lib/cjs/content-fields/hubtype-fields/button.js +3 -0
  130. package/lib/cjs/content-fields/hubtype-fields/button.js.map +1 -0
  131. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
  132. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js +12 -0
  133. package/lib/cjs/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
  134. package/lib/cjs/content-fields/hubtype-fields/carousel.d.ts +17 -0
  135. package/lib/cjs/content-fields/hubtype-fields/carousel.js +3 -0
  136. package/lib/cjs/content-fields/hubtype-fields/carousel.js.map +1 -0
  137. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
  138. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +3 -0
  139. package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
  140. package/lib/cjs/content-fields/hubtype-fields/common.d.ts +83 -0
  141. package/lib/cjs/content-fields/hubtype-fields/common.js +3 -0
  142. package/lib/cjs/content-fields/hubtype-fields/common.js.map +1 -0
  143. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +16 -0
  144. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
  145. package/lib/cjs/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
  146. package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
  147. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +3 -0
  148. package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +1 -0
  149. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
  150. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
  151. package/lib/cjs/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
  152. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
  153. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +3 -0
  154. package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
  155. package/lib/cjs/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
  156. package/lib/cjs/content-fields/hubtype-fields/do-nothing.js +3 -0
  157. package/lib/cjs/content-fields/hubtype-fields/do-nothing.js.map +1 -0
  158. package/lib/cjs/content-fields/hubtype-fields/fallback.d.ts +9 -0
  159. package/lib/cjs/content-fields/hubtype-fields/fallback.js +3 -0
  160. package/lib/cjs/content-fields/hubtype-fields/fallback.js.map +1 -0
  161. package/lib/cjs/content-fields/hubtype-fields/function.d.ts +30 -0
  162. package/lib/cjs/content-fields/hubtype-fields/function.js +11 -0
  163. package/lib/cjs/content-fields/hubtype-fields/function.js.map +1 -0
  164. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
  165. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js +3 -0
  166. package/lib/cjs/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
  167. package/lib/cjs/content-fields/hubtype-fields/handoff.d.ts +21 -0
  168. package/lib/cjs/content-fields/hubtype-fields/handoff.js +10 -0
  169. package/lib/cjs/content-fields/hubtype-fields/handoff.js.map +1 -0
  170. package/lib/cjs/content-fields/hubtype-fields/image.d.ts +8 -0
  171. package/lib/cjs/content-fields/hubtype-fields/image.js +3 -0
  172. package/lib/cjs/content-fields/hubtype-fields/image.js.map +1 -0
  173. package/lib/cjs/content-fields/hubtype-fields/index.d.ts +28 -0
  174. package/lib/cjs/content-fields/hubtype-fields/index.js +32 -0
  175. package/lib/cjs/content-fields/hubtype-fields/index.js.map +1 -0
  176. package/lib/cjs/content-fields/hubtype-fields/keyword.d.ts +9 -0
  177. package/lib/cjs/content-fields/hubtype-fields/keyword.js +3 -0
  178. package/lib/cjs/content-fields/hubtype-fields/keyword.js.map +1 -0
  179. package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +33 -0
  180. package/lib/cjs/content-fields/hubtype-fields/node-types.js +40 -0
  181. package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -0
  182. package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +28 -0
  183. package/lib/cjs/content-fields/hubtype-fields/nodes.js +3 -0
  184. package/lib/cjs/content-fields/hubtype-fields/nodes.js.map +1 -0
  185. package/lib/cjs/content-fields/hubtype-fields/payload.d.ts +8 -0
  186. package/lib/cjs/content-fields/hubtype-fields/payload.js +3 -0
  187. package/lib/cjs/content-fields/hubtype-fields/payload.js.map +1 -0
  188. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
  189. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
  190. package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
  191. package/lib/cjs/content-fields/hubtype-fields/rating.d.ts +23 -0
  192. package/lib/cjs/content-fields/hubtype-fields/rating.js +9 -0
  193. package/lib/cjs/content-fields/hubtype-fields/rating.js.map +1 -0
  194. package/lib/cjs/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
  195. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js +3 -0
  196. package/lib/cjs/content-fields/hubtype-fields/smart-intent.js.map +1 -0
  197. package/lib/cjs/content-fields/hubtype-fields/text.d.ts +11 -0
  198. package/lib/cjs/content-fields/hubtype-fields/text.js +3 -0
  199. package/lib/cjs/content-fields/hubtype-fields/text.js.map +1 -0
  200. package/lib/cjs/content-fields/hubtype-fields/url.d.ts +8 -0
  201. package/lib/cjs/content-fields/hubtype-fields/url.js +3 -0
  202. package/lib/cjs/content-fields/hubtype-fields/url.js.map +1 -0
  203. package/lib/cjs/content-fields/hubtype-fields/video.d.ts +8 -0
  204. package/lib/cjs/content-fields/hubtype-fields/video.js +3 -0
  205. package/lib/cjs/content-fields/hubtype-fields/video.js.map +1 -0
  206. package/lib/cjs/content-fields/hubtype-fields/webview.d.ts +17 -0
  207. package/lib/cjs/content-fields/hubtype-fields/webview.js +3 -0
  208. package/lib/cjs/content-fields/hubtype-fields/webview.js.map +1 -0
  209. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
  210. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
  211. package/lib/cjs/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
  212. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
  213. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
  214. package/lib/cjs/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
  215. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
  216. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
  217. package/lib/cjs/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
  218. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
  219. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js +9 -0
  220. package/lib/cjs/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
  221. package/lib/cjs/content-fields/index.d.ts +27 -0
  222. package/lib/cjs/content-fields/index.js +56 -0
  223. package/lib/cjs/content-fields/index.js.map +1 -0
  224. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
  225. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
  226. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
  227. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
  228. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
  229. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
  230. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
  231. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
  232. package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
  233. package/lib/cjs/content-fields/whatsapp-button-list/index.d.ts +3 -0
  234. package/lib/cjs/content-fields/whatsapp-button-list/index.js +10 -0
  235. package/lib/cjs/content-fields/whatsapp-button-list/index.js.map +1 -0
  236. package/lib/cjs/filters/index.d.ts +12 -0
  237. package/lib/cjs/filters/index.js +17 -0
  238. package/lib/cjs/filters/index.js.map +1 -0
  239. package/lib/cjs/flow-factory.d.ts +12 -0
  240. package/lib/cjs/flow-factory.js +73 -0
  241. package/lib/cjs/flow-factory.js.map +1 -0
  242. package/lib/cjs/functions/index.d.ts +11 -0
  243. package/lib/cjs/functions/index.js +49 -0
  244. package/lib/cjs/functions/index.js.map +1 -0
  245. package/lib/cjs/index.d.ts +42 -0
  246. package/lib/cjs/index.js +142 -0
  247. package/lib/cjs/index.js.map +1 -0
  248. package/lib/cjs/services/hubtype-queues-api.js +26 -0
  249. package/lib/cjs/services/hubtype-queues-api.js.map +1 -0
  250. package/lib/cjs/structured-output/flow-builder-content.js +15 -0
  251. package/lib/cjs/structured-output/flow-builder-content.js.map +1 -0
  252. package/lib/cjs/tracking.d.ts +16 -0
  253. package/lib/cjs/tracking.js +71 -0
  254. package/lib/cjs/tracking.js.map +1 -0
  255. package/lib/cjs/types.d.ts +62 -0
  256. package/lib/cjs/types.js +14 -0
  257. package/lib/cjs/types.js.map +1 -0
  258. package/lib/cjs/user-input/capture-user-input-api.d.ts +21 -0
  259. package/lib/cjs/user-input/capture-user-input-api.js +88 -0
  260. package/lib/cjs/user-input/capture-user-input-api.js.map +1 -0
  261. package/lib/cjs/user-input/index.d.ts +4 -0
  262. package/lib/cjs/user-input/index.js +37 -0
  263. package/lib/cjs/user-input/index.js.map +1 -0
  264. package/lib/cjs/user-input/keyword.d.ts +27 -0
  265. package/lib/cjs/user-input/keyword.js +84 -0
  266. package/lib/cjs/user-input/keyword.js.map +1 -0
  267. package/lib/cjs/user-input/smart-intent.d.ts +24 -0
  268. package/lib/cjs/user-input/smart-intent.js +89 -0
  269. package/lib/cjs/user-input/smart-intent.js.map +1 -0
  270. package/lib/cjs/utils/ai-agent.d.ts +11 -0
  271. package/lib/cjs/utils/ai-agent.js +28 -0
  272. package/lib/cjs/utils/ai-agent.js.map +1 -0
  273. package/lib/cjs/utils/authentication.js +21 -0
  274. package/lib/cjs/utils/authentication.js.map +1 -0
  275. package/lib/cjs/utils/flow-locale.js +79 -0
  276. package/lib/cjs/utils/flow-locale.js.map +1 -0
  277. package/lib/cjs/utils/get-flow-builder-plugin.d.ts +3 -0
  278. package/lib/cjs/utils/get-flow-builder-plugin.js +16 -0
  279. package/lib/cjs/utils/get-flow-builder-plugin.js.map +1 -0
  280. package/lib/cjs/utils/hubtype-assistant-content.d.ts +13 -0
  281. package/lib/cjs/utils/hubtype-assistant-content.js +184 -0
  282. package/lib/cjs/utils/hubtype-assistant-content.js.map +1 -0
  283. package/lib/cjs/utils/input.js +35 -0
  284. package/lib/cjs/utils/input.js.map +1 -0
  285. package/lib/cjs/webview/contents-context.d.ts +2 -0
  286. package/lib/cjs/webview/contents-context.js +12 -0
  287. package/lib/cjs/webview/contents-context.js.map +1 -0
  288. package/lib/cjs/webview/index.d.ts +3 -0
  289. package/lib/cjs/webview/index.js +10 -0
  290. package/lib/cjs/webview/index.js.map +1 -0
  291. package/lib/cjs/webview/types.d.ts +47 -0
  292. package/lib/cjs/webview/types.js +9 -0
  293. package/lib/cjs/webview/types.js.map +1 -0
  294. package/lib/cjs/webview/use-webview-contents.d.ts +2 -0
  295. package/lib/cjs/webview/use-webview-contents.js +83 -0
  296. package/lib/cjs/webview/use-webview-contents.js.map +1 -0
  297. package/lib/esm/action/ai-agent-from-user-input.d.ts +3 -0
  298. package/lib/esm/action/ai-agent-from-user-input.js +38 -0
  299. package/lib/esm/action/ai-agent-from-user-input.js.map +1 -0
  300. package/lib/esm/action/context.d.ts +11 -0
  301. package/lib/esm/action/context.js +17 -0
  302. package/lib/esm/action/context.js.map +1 -0
  303. package/lib/esm/action/fallback.d.ts +3 -0
  304. package/lib/esm/action/fallback.js +36 -0
  305. package/lib/esm/action/fallback.js.map +1 -0
  306. package/lib/esm/action/first-interaction.d.ts +3 -0
  307. package/lib/esm/action/first-interaction.js +93 -0
  308. package/lib/esm/action/first-interaction.js.map +1 -0
  309. package/lib/esm/action/get-contents.d.ts +3 -0
  310. package/lib/esm/action/get-contents.js +44 -0
  311. package/lib/esm/action/get-contents.js.map +1 -0
  312. package/lib/esm/action/index.d.ts +25 -0
  313. package/lib/esm/action/index.js +95 -0
  314. package/lib/esm/action/index.js.map +1 -0
  315. package/lib/esm/action/payload.d.ts +3 -0
  316. package/lib/esm/action/payload.js +74 -0
  317. package/lib/esm/action/payload.js.map +1 -0
  318. package/lib/esm/api.d.ts +45 -0
  319. package/lib/esm/api.js +227 -0
  320. package/lib/esm/api.js.map +1 -0
  321. package/lib/esm/bot-context-manager.d.ts +17 -0
  322. package/lib/esm/bot-context-manager.js +93 -0
  323. package/lib/esm/bot-context-manager.js.map +1 -0
  324. package/lib/esm/constants.d.ts +14 -0
  325. package/lib/esm/constants.js +20 -0
  326. package/lib/esm/constants.js.map +1 -0
  327. package/lib/esm/content-fields/contact-reasons-conditional-matcher.d.ts +4 -0
  328. package/lib/esm/content-fields/contact-reasons-conditional-matcher.js +12 -0
  329. package/lib/esm/content-fields/contact-reasons-conditional-matcher.js.map +1 -0
  330. package/lib/esm/content-fields/content-fields-base.d.ts +20 -0
  331. package/lib/esm/content-fields/content-fields-base.js +74 -0
  332. package/lib/esm/content-fields/content-fields-base.js.map +1 -0
  333. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +15 -0
  334. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +71 -0
  335. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +1 -0
  336. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +9 -0
  337. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js +58 -0
  338. package/lib/esm/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +1 -0
  339. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +17 -0
  340. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js +79 -0
  341. package/lib/esm/content-fields/custom-conditional/flow-custom-condition-v2.js.map +1 -0
  342. package/lib/esm/content-fields/flow-ai-agent-base.d.ts +25 -0
  343. package/lib/esm/content-fields/flow-ai-agent-base.js +97 -0
  344. package/lib/esm/content-fields/flow-ai-agent-base.js.map +1 -0
  345. package/lib/esm/content-fields/flow-ai-agent-router.d.ts +21 -0
  346. package/lib/esm/content-fields/flow-ai-agent-router.js +126 -0
  347. package/lib/esm/content-fields/flow-ai-agent-router.js.map +1 -0
  348. package/lib/esm/content-fields/flow-ai-agent.d.ts +17 -0
  349. package/lib/esm/content-fields/flow-ai-agent.js +65 -0
  350. package/lib/esm/content-fields/flow-ai-agent.js.map +1 -0
  351. package/lib/esm/content-fields/flow-bot-action.d.ts +14 -0
  352. package/lib/esm/content-fields/flow-bot-action.js +45 -0
  353. package/lib/esm/content-fields/flow-bot-action.js.map +1 -0
  354. package/lib/esm/content-fields/flow-button.d.ts +31 -0
  355. package/lib/esm/content-fields/flow-button.js +86 -0
  356. package/lib/esm/content-fields/flow-button.js.map +1 -0
  357. package/lib/esm/content-fields/flow-capture-user-input.d.ts +14 -0
  358. package/lib/esm/content-fields/flow-capture-user-input.js +45 -0
  359. package/lib/esm/content-fields/flow-capture-user-input.js.map +1 -0
  360. package/lib/esm/content-fields/flow-carousel.d.ts +22 -0
  361. package/lib/esm/content-fields/flow-carousel.js +152 -0
  362. package/lib/esm/content-fields/flow-carousel.js.map +1 -0
  363. package/lib/esm/content-fields/flow-channel-conditional.d.ts +14 -0
  364. package/lib/esm/content-fields/flow-channel-conditional.js +57 -0
  365. package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -0
  366. package/lib/esm/content-fields/flow-contact-reasons-conditional.d.ts +14 -0
  367. package/lib/esm/content-fields/flow-contact-reasons-conditional.js +65 -0
  368. package/lib/esm/content-fields/flow-contact-reasons-conditional.js.map +1 -0
  369. package/lib/esm/content-fields/flow-country-conditional.d.ts +13 -0
  370. package/lib/esm/content-fields/flow-country-conditional.js +59 -0
  371. package/lib/esm/content-fields/flow-country-conditional.js.map +1 -0
  372. package/lib/esm/content-fields/flow-custom-conditional.d.ts +17 -0
  373. package/lib/esm/content-fields/flow-custom-conditional.js +89 -0
  374. package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -0
  375. package/lib/esm/content-fields/flow-do-nothing.d.ts +9 -0
  376. package/lib/esm/content-fields/flow-do-nothing.js +27 -0
  377. package/lib/esm/content-fields/flow-do-nothing.js.map +1 -0
  378. package/lib/esm/content-fields/flow-element.d.ts +22 -0
  379. package/lib/esm/content-fields/flow-element.js +50 -0
  380. package/lib/esm/content-fields/flow-element.js.map +1 -0
  381. package/lib/esm/content-fields/flow-go-to-flow.d.ts +13 -0
  382. package/lib/esm/content-fields/flow-go-to-flow.js +51 -0
  383. package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -0
  384. package/lib/esm/content-fields/flow-handoff.d.ts +23 -0
  385. package/lib/esm/content-fields/flow-handoff.js +104 -0
  386. package/lib/esm/content-fields/flow-handoff.js.map +1 -0
  387. package/lib/esm/content-fields/flow-image.d.ts +10 -0
  388. package/lib/esm/content-fields/flow-image.js +33 -0
  389. package/lib/esm/content-fields/flow-image.js.map +1 -0
  390. package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +30 -0
  391. package/lib/esm/content-fields/flow-queue-status-conditional.js +95 -0
  392. package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -0
  393. package/lib/esm/content-fields/flow-rating.d.ts +15 -0
  394. package/lib/esm/content-fields/flow-rating.js +66 -0
  395. package/lib/esm/content-fields/flow-rating.js.map +1 -0
  396. package/lib/esm/content-fields/flow-text.d.ts +15 -0
  397. package/lib/esm/content-fields/flow-text.js +60 -0
  398. package/lib/esm/content-fields/flow-text.js.map +1 -0
  399. package/lib/esm/content-fields/flow-video.d.ts +10 -0
  400. package/lib/esm/content-fields/flow-video.js +33 -0
  401. package/lib/esm/content-fields/flow-video.js.map +1 -0
  402. package/lib/esm/content-fields/flow-webview.d.ts +16 -0
  403. package/lib/esm/content-fields/flow-webview.js +78 -0
  404. package/lib/esm/content-fields/flow-webview.js.map +1 -0
  405. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +21 -0
  406. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +92 -0
  407. package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -0
  408. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.d.ts +11 -0
  409. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js +46 -0
  410. package/lib/esm/content-fields/flow-whatsapp-request-contact-info.js.map +1 -0
  411. package/lib/esm/content-fields/flow-whatsapp-template.d.ts +37 -0
  412. package/lib/esm/content-fields/flow-whatsapp-template.js +264 -0
  413. package/lib/esm/content-fields/flow-whatsapp-template.js.map +1 -0
  414. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.d.ts +21 -0
  415. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js +3 -0
  416. package/lib/esm/content-fields/hubtype-fields/ai-agent-router.js.map +1 -0
  417. package/lib/esm/content-fields/hubtype-fields/ai-agent.d.ts +25 -0
  418. package/lib/esm/content-fields/hubtype-fields/ai-agent.js +3 -0
  419. package/lib/esm/content-fields/hubtype-fields/ai-agent.js.map +1 -0
  420. package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +10 -0
  421. package/lib/esm/content-fields/hubtype-fields/bot-action.js +3 -0
  422. package/lib/esm/content-fields/hubtype-fields/bot-action.js.map +1 -0
  423. package/lib/esm/content-fields/hubtype-fields/button.d.ts +8 -0
  424. package/lib/esm/content-fields/hubtype-fields/button.js +3 -0
  425. package/lib/esm/content-fields/hubtype-fields/button.js.map +1 -0
  426. package/lib/esm/content-fields/hubtype-fields/capture-user-input.d.ts +19 -0
  427. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js +12 -0
  428. package/lib/esm/content-fields/hubtype-fields/capture-user-input.js.map +1 -0
  429. package/lib/esm/content-fields/hubtype-fields/carousel.d.ts +17 -0
  430. package/lib/esm/content-fields/hubtype-fields/carousel.js +3 -0
  431. package/lib/esm/content-fields/hubtype-fields/carousel.js.map +1 -0
  432. package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
  433. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +3 -0
  434. package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
  435. package/lib/esm/content-fields/hubtype-fields/common.d.ts +83 -0
  436. package/lib/esm/content-fields/hubtype-fields/common.js +3 -0
  437. package/lib/esm/content-fields/hubtype-fields/common.js.map +1 -0
  438. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.d.ts +16 -0
  439. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js +3 -0
  440. package/lib/esm/content-fields/hubtype-fields/contact-reasons-conditional.js.map +1 -0
  441. package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
  442. package/lib/esm/content-fields/hubtype-fields/country-conditional.js +3 -0
  443. package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +1 -0
  444. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.d.ts +56 -0
  445. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js +36 -0
  446. package/lib/esm/content-fields/hubtype-fields/custom-conditional-v2.js.map +1 -0
  447. package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
  448. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +3 -0
  449. package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
  450. package/lib/esm/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
  451. package/lib/esm/content-fields/hubtype-fields/do-nothing.js +3 -0
  452. package/lib/esm/content-fields/hubtype-fields/do-nothing.js.map +1 -0
  453. package/lib/esm/content-fields/hubtype-fields/fallback.d.ts +9 -0
  454. package/lib/esm/content-fields/hubtype-fields/fallback.js +3 -0
  455. package/lib/esm/content-fields/hubtype-fields/fallback.js.map +1 -0
  456. package/lib/esm/content-fields/hubtype-fields/function.d.ts +30 -0
  457. package/lib/esm/content-fields/hubtype-fields/function.js +11 -0
  458. package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -0
  459. package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +9 -0
  460. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +3 -0
  461. package/lib/esm/content-fields/hubtype-fields/go-to-flow.js.map +1 -0
  462. package/lib/esm/content-fields/hubtype-fields/handoff.d.ts +21 -0
  463. package/lib/esm/content-fields/hubtype-fields/handoff.js +10 -0
  464. package/lib/esm/content-fields/hubtype-fields/handoff.js.map +1 -0
  465. package/lib/esm/content-fields/hubtype-fields/image.d.ts +8 -0
  466. package/lib/esm/content-fields/hubtype-fields/image.js +3 -0
  467. package/lib/esm/content-fields/hubtype-fields/image.js.map +1 -0
  468. package/lib/esm/content-fields/hubtype-fields/index.d.ts +28 -0
  469. package/lib/esm/content-fields/hubtype-fields/index.js +32 -0
  470. package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -0
  471. package/lib/esm/content-fields/hubtype-fields/keyword.d.ts +9 -0
  472. package/lib/esm/content-fields/hubtype-fields/keyword.js +3 -0
  473. package/lib/esm/content-fields/hubtype-fields/keyword.js.map +1 -0
  474. package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +33 -0
  475. package/lib/esm/content-fields/hubtype-fields/node-types.js +40 -0
  476. package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -0
  477. package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +28 -0
  478. package/lib/esm/content-fields/hubtype-fields/nodes.js +3 -0
  479. package/lib/esm/content-fields/hubtype-fields/nodes.js.map +1 -0
  480. package/lib/esm/content-fields/hubtype-fields/payload.d.ts +8 -0
  481. package/lib/esm/content-fields/hubtype-fields/payload.js +3 -0
  482. package/lib/esm/content-fields/hubtype-fields/payload.js.map +1 -0
  483. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
  484. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
  485. package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
  486. package/lib/esm/content-fields/hubtype-fields/rating.d.ts +23 -0
  487. package/lib/esm/content-fields/hubtype-fields/rating.js +9 -0
  488. package/lib/esm/content-fields/hubtype-fields/rating.js.map +1 -0
  489. package/lib/esm/content-fields/hubtype-fields/smart-intent.d.ts +12 -0
  490. package/lib/esm/content-fields/hubtype-fields/smart-intent.js +3 -0
  491. package/lib/esm/content-fields/hubtype-fields/smart-intent.js.map +1 -0
  492. package/lib/esm/content-fields/hubtype-fields/text.d.ts +11 -0
  493. package/lib/esm/content-fields/hubtype-fields/text.js +3 -0
  494. package/lib/esm/content-fields/hubtype-fields/text.js.map +1 -0
  495. package/lib/esm/content-fields/hubtype-fields/url.d.ts +8 -0
  496. package/lib/esm/content-fields/hubtype-fields/url.js +3 -0
  497. package/lib/esm/content-fields/hubtype-fields/url.js.map +1 -0
  498. package/lib/esm/content-fields/hubtype-fields/video.d.ts +8 -0
  499. package/lib/esm/content-fields/hubtype-fields/video.js +3 -0
  500. package/lib/esm/content-fields/hubtype-fields/video.js.map +1 -0
  501. package/lib/esm/content-fields/hubtype-fields/webview.d.ts +17 -0
  502. package/lib/esm/content-fields/hubtype-fields/webview.js +3 -0
  503. package/lib/esm/content-fields/hubtype-fields/webview.js.map +1 -0
  504. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.d.ts +21 -0
  505. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +3 -0
  506. package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js.map +1 -0
  507. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +17 -0
  508. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js +3 -0
  509. package/lib/esm/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +1 -0
  510. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +10 -0
  511. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js +3 -0
  512. package/lib/esm/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +1 -0
  513. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.d.ts +96 -0
  514. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js +9 -0
  515. package/lib/esm/content-fields/hubtype-fields/whatsapp-template.js.map +1 -0
  516. package/lib/esm/content-fields/index.d.ts +27 -0
  517. package/lib/esm/content-fields/index.js +56 -0
  518. package/lib/esm/content-fields/index.js.map +1 -0
  519. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +14 -0
  520. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +41 -0
  521. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -0
  522. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +13 -0
  523. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +36 -0
  524. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -0
  525. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +14 -0
  526. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +46 -0
  527. package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -0
  528. package/lib/esm/content-fields/whatsapp-button-list/index.d.ts +3 -0
  529. package/lib/esm/content-fields/whatsapp-button-list/index.js +10 -0
  530. package/lib/esm/content-fields/whatsapp-button-list/index.js.map +1 -0
  531. package/lib/esm/filters/index.d.ts +12 -0
  532. package/lib/esm/filters/index.js +17 -0
  533. package/lib/esm/filters/index.js.map +1 -0
  534. package/lib/esm/flow-factory.d.ts +12 -0
  535. package/lib/esm/flow-factory.js +73 -0
  536. package/lib/esm/flow-factory.js.map +1 -0
  537. package/lib/esm/functions/index.d.ts +11 -0
  538. package/lib/esm/functions/index.js +49 -0
  539. package/lib/esm/functions/index.js.map +1 -0
  540. package/lib/esm/index.d.ts +42 -0
  541. package/lib/esm/index.js +142 -0
  542. package/lib/esm/index.js.map +1 -0
  543. package/lib/esm/services/hubtype-queues-api.d.ts +14 -0
  544. package/lib/esm/services/hubtype-queues-api.js +26 -0
  545. package/lib/esm/services/hubtype-queues-api.js.map +1 -0
  546. package/lib/esm/structured-output/flow-builder-content.d.ts +13 -0
  547. package/lib/esm/structured-output/flow-builder-content.js +15 -0
  548. package/lib/esm/structured-output/flow-builder-content.js.map +1 -0
  549. package/lib/esm/tracking.d.ts +16 -0
  550. package/lib/esm/tracking.js +71 -0
  551. package/lib/esm/tracking.js.map +1 -0
  552. package/lib/esm/types.d.ts +62 -0
  553. package/lib/esm/types.js +14 -0
  554. package/lib/esm/types.js.map +1 -0
  555. package/lib/esm/user-input/capture-user-input-api.d.ts +21 -0
  556. package/lib/esm/user-input/capture-user-input-api.js +88 -0
  557. package/lib/esm/user-input/capture-user-input-api.js.map +1 -0
  558. package/lib/esm/user-input/index.d.ts +4 -0
  559. package/lib/esm/user-input/index.js +37 -0
  560. package/lib/esm/user-input/index.js.map +1 -0
  561. package/lib/esm/user-input/keyword.d.ts +27 -0
  562. package/lib/esm/user-input/keyword.js +84 -0
  563. package/lib/esm/user-input/keyword.js.map +1 -0
  564. package/lib/esm/user-input/smart-intent.d.ts +24 -0
  565. package/lib/esm/user-input/smart-intent.js +89 -0
  566. package/lib/esm/user-input/smart-intent.js.map +1 -0
  567. package/lib/esm/utils/ai-agent.d.ts +11 -0
  568. package/lib/esm/utils/ai-agent.js +28 -0
  569. package/lib/esm/utils/ai-agent.js.map +1 -0
  570. package/lib/esm/utils/authentication.d.ts +2 -0
  571. package/lib/esm/utils/authentication.js +21 -0
  572. package/lib/esm/utils/authentication.js.map +1 -0
  573. package/lib/esm/utils/flow-locale.d.ts +22 -0
  574. package/lib/esm/utils/flow-locale.js +79 -0
  575. package/lib/esm/utils/flow-locale.js.map +1 -0
  576. package/lib/esm/utils/get-flow-builder-plugin.d.ts +3 -0
  577. package/lib/esm/utils/get-flow-builder-plugin.js +16 -0
  578. package/lib/esm/utils/get-flow-builder-plugin.js.map +1 -0
  579. package/lib/esm/utils/hubtype-assistant-content.d.ts +13 -0
  580. package/lib/esm/utils/hubtype-assistant-content.js +184 -0
  581. package/lib/esm/utils/hubtype-assistant-content.js.map +1 -0
  582. package/lib/esm/utils/input.d.ts +6 -0
  583. package/lib/esm/utils/input.js +35 -0
  584. package/lib/esm/utils/input.js.map +1 -0
  585. package/lib/esm/webview/contents-context.d.ts +2 -0
  586. package/lib/esm/webview/contents-context.js +12 -0
  587. package/lib/esm/webview/contents-context.js.map +1 -0
  588. package/lib/esm/webview/index.d.ts +3 -0
  589. package/lib/esm/webview/index.js +10 -0
  590. package/lib/esm/webview/index.js.map +1 -0
  591. package/lib/esm/webview/types.d.ts +47 -0
  592. package/lib/esm/webview/types.js +9 -0
  593. package/lib/esm/webview/types.js.map +1 -0
  594. package/lib/esm/webview/use-webview-contents.d.ts +2 -0
  595. package/lib/esm/webview/use-webview-contents.js +83 -0
  596. package/lib/esm/webview/use-webview-contents.js.map +1 -0
  597. package/package.json +9 -11
  598. package/src/action/ai-agent-from-user-input.ts +7 -0
  599. package/src/action/first-interaction.ts +6 -0
  600. package/src/action/get-contents.ts +17 -2
  601. package/src/action/index.tsx +7 -0
  602. package/src/api.ts +52 -15
  603. package/src/bot-context-manager.ts +153 -0
  604. package/src/constants.ts +2 -1
  605. package/src/content-fields/contact-reasons-conditional-matcher.ts +24 -0
  606. package/src/content-fields/flow-ai-agent-base.tsx +12 -1
  607. package/src/content-fields/flow-ai-agent-router.tsx +1 -0
  608. package/src/content-fields/flow-ai-agent.tsx +1 -0
  609. package/src/content-fields/flow-contact-reasons-conditional.tsx +90 -0
  610. package/src/content-fields/flow-do-nothing.tsx +29 -0
  611. package/src/content-fields/flow-handoff.tsx +54 -7
  612. package/src/content-fields/flow-whatsapp-request-contact-info.tsx +19 -1
  613. package/src/content-fields/hubtype-fields/contact-reasons-conditional.ts +18 -0
  614. package/src/content-fields/hubtype-fields/do-nothing.ts +7 -0
  615. package/src/content-fields/hubtype-fields/handoff.ts +17 -1
  616. package/src/content-fields/hubtype-fields/index.ts +1 -0
  617. package/src/content-fields/hubtype-fields/node-types.ts +2 -0
  618. package/src/content-fields/hubtype-fields/nodes.ts +4 -0
  619. package/src/content-fields/hubtype-fields/whatsapp-request-contact-info.ts +2 -0
  620. package/src/content-fields/index.ts +6 -0
  621. package/src/flow-factory.ts +11 -0
  622. package/src/index.ts +26 -88
  623. package/src/types.ts +1 -2
  624. package/src/utils/hubtype-assistant-content.ts +14 -0
  625. package/lib/action/ai-agent-from-user-input.d.ts +0 -3
  626. package/lib/action/ai-agent-from-user-input.js +0 -35
  627. package/lib/action/ai-agent-from-user-input.js.map +0 -1
  628. package/lib/action/context.d.ts +0 -11
  629. package/lib/action/context.js +0 -20
  630. package/lib/action/context.js.map +0 -1
  631. package/lib/action/fallback.d.ts +0 -3
  632. package/lib/action/fallback.js +0 -41
  633. package/lib/action/fallback.js.map +0 -1
  634. package/lib/action/first-interaction.d.ts +0 -3
  635. package/lib/action/first-interaction.js +0 -100
  636. package/lib/action/first-interaction.js.map +0 -1
  637. package/lib/action/get-contents.d.ts +0 -3
  638. package/lib/action/get-contents.js +0 -56
  639. package/lib/action/get-contents.js.map +0 -1
  640. package/lib/action/index.d.ts +0 -25
  641. package/lib/action/index.js +0 -126
  642. package/lib/action/index.js.map +0 -1
  643. package/lib/action/payload.d.ts +0 -3
  644. package/lib/action/payload.js +0 -78
  645. package/lib/action/payload.js.map +0 -1
  646. package/lib/api.d.ts +0 -40
  647. package/lib/api.js +0 -216
  648. package/lib/api.js.map +0 -1
  649. package/lib/constants.d.ts +0 -13
  650. package/lib/constants.js +0 -17
  651. package/lib/constants.js.map +0 -1
  652. package/lib/content-fields/content-fields-base.d.ts +0 -20
  653. package/lib/content-fields/content-fields-base.js +0 -78
  654. package/lib/content-fields/content-fields-base.js.map +0 -1
  655. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.d.ts +0 -15
  656. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js +0 -73
  657. package/lib/content-fields/custom-conditional/custom-conditional-v2-evaluators.js.map +0 -1
  658. package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.d.ts +0 -9
  659. package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js +0 -58
  660. package/lib/content-fields/custom-conditional/custom-conditional-v2-resolver.js.map +0 -1
  661. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.d.ts +0 -17
  662. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js +0 -94
  663. package/lib/content-fields/custom-conditional/flow-custom-condition-v2.js.map +0 -1
  664. package/lib/content-fields/flow-ai-agent-base.d.ts +0 -25
  665. package/lib/content-fields/flow-ai-agent-base.js +0 -100
  666. package/lib/content-fields/flow-ai-agent-base.js.map +0 -1
  667. package/lib/content-fields/flow-ai-agent-router.d.ts +0 -21
  668. package/lib/content-fields/flow-ai-agent-router.js +0 -136
  669. package/lib/content-fields/flow-ai-agent-router.js.map +0 -1
  670. package/lib/content-fields/flow-ai-agent.d.ts +0 -17
  671. package/lib/content-fields/flow-ai-agent.js +0 -75
  672. package/lib/content-fields/flow-ai-agent.js.map +0 -1
  673. package/lib/content-fields/flow-bot-action.d.ts +0 -14
  674. package/lib/content-fields/flow-bot-action.js +0 -53
  675. package/lib/content-fields/flow-bot-action.js.map +0 -1
  676. package/lib/content-fields/flow-button.d.ts +0 -31
  677. package/lib/content-fields/flow-button.js +0 -105
  678. package/lib/content-fields/flow-button.js.map +0 -1
  679. package/lib/content-fields/flow-capture-user-input.d.ts +0 -14
  680. package/lib/content-fields/flow-capture-user-input.js +0 -46
  681. package/lib/content-fields/flow-capture-user-input.js.map +0 -1
  682. package/lib/content-fields/flow-carousel.d.ts +0 -22
  683. package/lib/content-fields/flow-carousel.js +0 -193
  684. package/lib/content-fields/flow-carousel.js.map +0 -1
  685. package/lib/content-fields/flow-channel-conditional.d.ts +0 -14
  686. package/lib/content-fields/flow-channel-conditional.js +0 -61
  687. package/lib/content-fields/flow-channel-conditional.js.map +0 -1
  688. package/lib/content-fields/flow-country-conditional.d.ts +0 -13
  689. package/lib/content-fields/flow-country-conditional.js +0 -64
  690. package/lib/content-fields/flow-country-conditional.js.map +0 -1
  691. package/lib/content-fields/flow-custom-conditional.d.ts +0 -17
  692. package/lib/content-fields/flow-custom-conditional.js +0 -87
  693. package/lib/content-fields/flow-custom-conditional.js.map +0 -1
  694. package/lib/content-fields/flow-element.d.ts +0 -22
  695. package/lib/content-fields/flow-element.js +0 -67
  696. package/lib/content-fields/flow-element.js.map +0 -1
  697. package/lib/content-fields/flow-go-to-flow.d.ts +0 -13
  698. package/lib/content-fields/flow-go-to-flow.js +0 -56
  699. package/lib/content-fields/flow-go-to-flow.js.map +0 -1
  700. package/lib/content-fields/flow-handoff.d.ts +0 -17
  701. package/lib/content-fields/flow-handoff.js +0 -79
  702. package/lib/content-fields/flow-handoff.js.map +0 -1
  703. package/lib/content-fields/flow-image.d.ts +0 -10
  704. package/lib/content-fields/flow-image.js +0 -42
  705. package/lib/content-fields/flow-image.js.map +0 -1
  706. package/lib/content-fields/flow-queue-status-conditional.d.ts +0 -30
  707. package/lib/content-fields/flow-queue-status-conditional.js +0 -100
  708. package/lib/content-fields/flow-queue-status-conditional.js.map +0 -1
  709. package/lib/content-fields/flow-rating.d.ts +0 -15
  710. package/lib/content-fields/flow-rating.js +0 -88
  711. package/lib/content-fields/flow-rating.js.map +0 -1
  712. package/lib/content-fields/flow-text.d.ts +0 -15
  713. package/lib/content-fields/flow-text.js +0 -82
  714. package/lib/content-fields/flow-text.js.map +0 -1
  715. package/lib/content-fields/flow-video.d.ts +0 -10
  716. package/lib/content-fields/flow-video.js +0 -42
  717. package/lib/content-fields/flow-video.js.map +0 -1
  718. package/lib/content-fields/flow-webview.d.ts +0 -16
  719. package/lib/content-fields/flow-webview.js +0 -81
  720. package/lib/content-fields/flow-webview.js.map +0 -1
  721. package/lib/content-fields/flow-whatsapp-cta-url-button.d.ts +0 -21
  722. package/lib/content-fields/flow-whatsapp-cta-url-button.js +0 -131
  723. package/lib/content-fields/flow-whatsapp-cta-url-button.js.map +0 -1
  724. package/lib/content-fields/flow-whatsapp-request-contact-info.d.ts +0 -10
  725. package/lib/content-fields/flow-whatsapp-request-contact-info.js +0 -51
  726. package/lib/content-fields/flow-whatsapp-request-contact-info.js.map +0 -1
  727. package/lib/content-fields/flow-whatsapp-template.d.ts +0 -37
  728. package/lib/content-fields/flow-whatsapp-template.js +0 -281
  729. package/lib/content-fields/flow-whatsapp-template.js.map +0 -1
  730. package/lib/content-fields/hubtype-fields/ai-agent-router.d.ts +0 -21
  731. package/lib/content-fields/hubtype-fields/ai-agent-router.js +0 -4
  732. package/lib/content-fields/hubtype-fields/ai-agent-router.js.map +0 -1
  733. package/lib/content-fields/hubtype-fields/ai-agent.d.ts +0 -25
  734. package/lib/content-fields/hubtype-fields/ai-agent.js +0 -4
  735. package/lib/content-fields/hubtype-fields/ai-agent.js.map +0 -1
  736. package/lib/content-fields/hubtype-fields/bot-action.d.ts +0 -10
  737. package/lib/content-fields/hubtype-fields/bot-action.js +0 -4
  738. package/lib/content-fields/hubtype-fields/bot-action.js.map +0 -1
  739. package/lib/content-fields/hubtype-fields/button.d.ts +0 -8
  740. package/lib/content-fields/hubtype-fields/button.js +0 -4
  741. package/lib/content-fields/hubtype-fields/button.js.map +0 -1
  742. package/lib/content-fields/hubtype-fields/capture-user-input.d.ts +0 -19
  743. package/lib/content-fields/hubtype-fields/capture-user-input.js +0 -12
  744. package/lib/content-fields/hubtype-fields/capture-user-input.js.map +0 -1
  745. package/lib/content-fields/hubtype-fields/carousel.d.ts +0 -17
  746. package/lib/content-fields/hubtype-fields/carousel.js +0 -4
  747. package/lib/content-fields/hubtype-fields/carousel.js.map +0 -1
  748. package/lib/content-fields/hubtype-fields/channel-conditional.d.ts +0 -10
  749. package/lib/content-fields/hubtype-fields/channel-conditional.js +0 -4
  750. package/lib/content-fields/hubtype-fields/channel-conditional.js.map +0 -1
  751. package/lib/content-fields/hubtype-fields/common.d.ts +0 -83
  752. package/lib/content-fields/hubtype-fields/common.js +0 -4
  753. package/lib/content-fields/hubtype-fields/common.js.map +0 -1
  754. package/lib/content-fields/hubtype-fields/country-conditional.d.ts +0 -10
  755. package/lib/content-fields/hubtype-fields/country-conditional.js +0 -4
  756. package/lib/content-fields/hubtype-fields/country-conditional.js.map +0 -1
  757. package/lib/content-fields/hubtype-fields/custom-conditional-v2.d.ts +0 -56
  758. package/lib/content-fields/hubtype-fields/custom-conditional-v2.js +0 -36
  759. package/lib/content-fields/hubtype-fields/custom-conditional-v2.js.map +0 -1
  760. package/lib/content-fields/hubtype-fields/custom-conditional.d.ts +0 -11
  761. package/lib/content-fields/hubtype-fields/custom-conditional.js +0 -4
  762. package/lib/content-fields/hubtype-fields/custom-conditional.js.map +0 -1
  763. package/lib/content-fields/hubtype-fields/fallback.d.ts +0 -9
  764. package/lib/content-fields/hubtype-fields/fallback.js +0 -4
  765. package/lib/content-fields/hubtype-fields/fallback.js.map +0 -1
  766. package/lib/content-fields/hubtype-fields/function.d.ts +0 -30
  767. package/lib/content-fields/hubtype-fields/function.js +0 -11
  768. package/lib/content-fields/hubtype-fields/function.js.map +0 -1
  769. package/lib/content-fields/hubtype-fields/go-to-flow.d.ts +0 -9
  770. package/lib/content-fields/hubtype-fields/go-to-flow.js +0 -4
  771. package/lib/content-fields/hubtype-fields/go-to-flow.js.map +0 -1
  772. package/lib/content-fields/hubtype-fields/handoff.d.ts +0 -11
  773. package/lib/content-fields/hubtype-fields/handoff.js +0 -4
  774. package/lib/content-fields/hubtype-fields/handoff.js.map +0 -1
  775. package/lib/content-fields/hubtype-fields/image.d.ts +0 -8
  776. package/lib/content-fields/hubtype-fields/image.js +0 -4
  777. package/lib/content-fields/hubtype-fields/image.js.map +0 -1
  778. package/lib/content-fields/hubtype-fields/index.d.ts +0 -27
  779. package/lib/content-fields/hubtype-fields/index.js +0 -57
  780. package/lib/content-fields/hubtype-fields/index.js.map +0 -1
  781. package/lib/content-fields/hubtype-fields/keyword.d.ts +0 -9
  782. package/lib/content-fields/hubtype-fields/keyword.js +0 -4
  783. package/lib/content-fields/hubtype-fields/keyword.js.map +0 -1
  784. package/lib/content-fields/hubtype-fields/node-types.d.ts +0 -31
  785. package/lib/content-fields/hubtype-fields/node-types.js +0 -38
  786. package/lib/content-fields/hubtype-fields/node-types.js.map +0 -1
  787. package/lib/content-fields/hubtype-fields/nodes.d.ts +0 -26
  788. package/lib/content-fields/hubtype-fields/nodes.js +0 -4
  789. package/lib/content-fields/hubtype-fields/nodes.js.map +0 -1
  790. package/lib/content-fields/hubtype-fields/payload.d.ts +0 -8
  791. package/lib/content-fields/hubtype-fields/payload.js +0 -4
  792. package/lib/content-fields/hubtype-fields/payload.js.map +0 -1
  793. package/lib/content-fields/hubtype-fields/queue-status-conditional.d.ts +0 -25
  794. package/lib/content-fields/hubtype-fields/queue-status-conditional.js +0 -4
  795. package/lib/content-fields/hubtype-fields/queue-status-conditional.js.map +0 -1
  796. package/lib/content-fields/hubtype-fields/rating.d.ts +0 -23
  797. package/lib/content-fields/hubtype-fields/rating.js +0 -9
  798. package/lib/content-fields/hubtype-fields/rating.js.map +0 -1
  799. package/lib/content-fields/hubtype-fields/smart-intent.d.ts +0 -12
  800. package/lib/content-fields/hubtype-fields/smart-intent.js +0 -4
  801. package/lib/content-fields/hubtype-fields/smart-intent.js.map +0 -1
  802. package/lib/content-fields/hubtype-fields/text.d.ts +0 -11
  803. package/lib/content-fields/hubtype-fields/text.js +0 -4
  804. package/lib/content-fields/hubtype-fields/text.js.map +0 -1
  805. package/lib/content-fields/hubtype-fields/url.d.ts +0 -8
  806. package/lib/content-fields/hubtype-fields/url.js +0 -4
  807. package/lib/content-fields/hubtype-fields/url.js.map +0 -1
  808. package/lib/content-fields/hubtype-fields/video.d.ts +0 -8
  809. package/lib/content-fields/hubtype-fields/video.js +0 -4
  810. package/lib/content-fields/hubtype-fields/video.js.map +0 -1
  811. package/lib/content-fields/hubtype-fields/webview.d.ts +0 -17
  812. package/lib/content-fields/hubtype-fields/webview.js +0 -4
  813. package/lib/content-fields/hubtype-fields/webview.js.map +0 -1
  814. package/lib/content-fields/hubtype-fields/whatsapp-button-list.d.ts +0 -21
  815. package/lib/content-fields/hubtype-fields/whatsapp-button-list.js +0 -4
  816. package/lib/content-fields/hubtype-fields/whatsapp-button-list.js.map +0 -1
  817. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.d.ts +0 -17
  818. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js +0 -4
  819. package/lib/content-fields/hubtype-fields/whatsapp-cta-url-button.js.map +0 -1
  820. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.d.ts +0 -8
  821. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js +0 -4
  822. package/lib/content-fields/hubtype-fields/whatsapp-request-contact-info.js.map +0 -1
  823. package/lib/content-fields/hubtype-fields/whatsapp-template.d.ts +0 -96
  824. package/lib/content-fields/hubtype-fields/whatsapp-template.js +0 -9
  825. package/lib/content-fields/hubtype-fields/whatsapp-template.js.map +0 -1
  826. package/lib/content-fields/index.d.ts +0 -25
  827. package/lib/content-fields/index.js +0 -73
  828. package/lib/content-fields/index.js.map +0 -1
  829. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +0 -14
  830. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +0 -43
  831. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +0 -1
  832. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +0 -13
  833. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +0 -41
  834. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +0 -1
  835. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +0 -14
  836. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +0 -66
  837. package/lib/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +0 -1
  838. package/lib/content-fields/whatsapp-button-list/index.d.ts +0 -3
  839. package/lib/content-fields/whatsapp-button-list/index.js +0 -12
  840. package/lib/content-fields/whatsapp-button-list/index.js.map +0 -1
  841. package/lib/filters/index.d.ts +0 -12
  842. package/lib/filters/index.js +0 -16
  843. package/lib/filters/index.js.map +0 -1
  844. package/lib/flow-factory.d.ts +0 -12
  845. package/lib/flow-factory.js +0 -75
  846. package/lib/flow-factory.js.map +0 -1
  847. package/lib/functions/index.d.ts +0 -11
  848. package/lib/functions/index.js +0 -55
  849. package/lib/functions/index.js.map +0 -1
  850. package/lib/index.d.ts +0 -45
  851. package/lib/index.js +0 -195
  852. package/lib/index.js.map +0 -1
  853. package/lib/services/hubtype-queues-api.js +0 -26
  854. package/lib/services/hubtype-queues-api.js.map +0 -1
  855. package/lib/structured-output/flow-builder-content.js +0 -16
  856. package/lib/structured-output/flow-builder-content.js.map +0 -1
  857. package/lib/tracking.d.ts +0 -16
  858. package/lib/tracking.js +0 -77
  859. package/lib/tracking.js.map +0 -1
  860. package/lib/types.d.ts +0 -62
  861. package/lib/types.js +0 -14
  862. package/lib/types.js.map +0 -1
  863. package/lib/user-input/capture-user-input-api.d.ts +0 -21
  864. package/lib/user-input/capture-user-input-api.js +0 -99
  865. package/lib/user-input/capture-user-input-api.js.map +0 -1
  866. package/lib/user-input/index.d.ts +0 -4
  867. package/lib/user-input/index.js +0 -46
  868. package/lib/user-input/index.js.map +0 -1
  869. package/lib/user-input/keyword.d.ts +0 -27
  870. package/lib/user-input/keyword.js +0 -89
  871. package/lib/user-input/keyword.js.map +0 -1
  872. package/lib/user-input/smart-intent.d.ts +0 -24
  873. package/lib/user-input/smart-intent.js +0 -93
  874. package/lib/user-input/smart-intent.js.map +0 -1
  875. package/lib/utils/ai-agent.d.ts +0 -11
  876. package/lib/utils/ai-agent.js +0 -33
  877. package/lib/utils/ai-agent.js.map +0 -1
  878. package/lib/utils/authentication.js +0 -24
  879. package/lib/utils/authentication.js.map +0 -1
  880. package/lib/utils/flow-locale.js +0 -75
  881. package/lib/utils/flow-locale.js.map +0 -1
  882. package/lib/utils/get-flow-builder-plugin.d.ts +0 -3
  883. package/lib/utils/get-flow-builder-plugin.js +0 -16
  884. package/lib/utils/get-flow-builder-plugin.js.map +0 -1
  885. package/lib/utils/hubtype-assistant-content.d.ts +0 -12
  886. package/lib/utils/hubtype-assistant-content.js +0 -187
  887. package/lib/utils/hubtype-assistant-content.js.map +0 -1
  888. package/lib/utils/input.js +0 -37
  889. package/lib/utils/input.js.map +0 -1
  890. package/lib/webview/contents-context.d.ts +0 -2
  891. package/lib/webview/contents-context.js +0 -14
  892. package/lib/webview/contents-context.js.map +0 -1
  893. package/lib/webview/index.d.ts +0 -3
  894. package/lib/webview/index.js +0 -11
  895. package/lib/webview/index.js.map +0 -1
  896. package/lib/webview/types.d.ts +0 -47
  897. package/lib/webview/types.js +0 -9
  898. package/lib/webview/types.js.map +0 -1
  899. package/lib/webview/use-webview-contents.d.ts +0 -2
  900. package/lib/webview/use-webview-contents.js +0 -90
  901. package/lib/webview/use-webview-contents.js.map +0 -1
  902. /package/lib/{services → cjs/services}/hubtype-queues-api.d.ts +0 -0
  903. /package/lib/{structured-output → cjs/structured-output}/flow-builder-content.d.ts +0 -0
  904. /package/lib/{utils → cjs/utils}/authentication.d.ts +0 -0
  905. /package/lib/{utils → cjs/utils}/flow-locale.d.ts +0 -0
  906. /package/lib/{utils → cjs/utils}/input.d.ts +0 -0
@@ -1,136 +0,0 @@
1
- import { AiAgentType, EventAction } from "@botonic/core";
2
- import { FlowBuilderContentSchema } from "../structured-output/flow-builder-content.js";
3
- import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../tracking.js";
4
- import { getFlowBuilderPlugin } from "../utils/get-flow-builder-plugin.js";
5
- import { FlowAiAgent } from "./flow-ai-agent.js";
6
- import { FlowAiAgentBase } from "./flow-ai-agent-base.js";
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
- class FlowAiAgentRouter extends FlowAiAgentBase {
21
- static fromHubtypeCMS(component, botContext) {
22
- const newAiAgentRouter = new FlowAiAgentRouter(component.id);
23
- newAiAgentRouter.code = component.code;
24
- newAiAgentRouter.name = component.content.name;
25
- newAiAgentRouter.instructions = newAiAgentRouter.replaceVariables(component.content.instructions, botContext);
26
- newAiAgentRouter.model = component.content.model;
27
- newAiAgentRouter.verbosity = component.content.verbosity;
28
- newAiAgentRouter.availableSpecialists = FlowAiAgentRouter.getAvailableSpecialistsFromHubtypeCMS(component, botContext);
29
- newAiAgentRouter.inputGuardrailRules = component.content.input_guardrail_rules || [];
30
- return newAiAgentRouter;
31
- }
32
- static getAvailableSpecialistsFromHubtypeCMS(component, botContext) {
33
- const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
34
- const cmsApi = flowBuilderPlugin.cmsApi;
35
- return component.content.available_specialists.map((agentSlot, index)=>{
36
- const aiAgentSpecialistNode = cmsApi.getNodeById(agentSlot.target.id);
37
- const specialist = FlowAiAgent.fromHubtypeCMS(aiAgentSpecialistNode, botContext);
38
- const specialistName = FlowAiAgentRouter.specialistAgentBaseName(agentSlot.name, index);
39
- const specialistDescription = specialist.replaceVariables(agentSlot.description || `Transfer to ${specialistName}`, botContext);
40
- return {
41
- agent: specialist,
42
- description: specialistDescription,
43
- name: `transfer_to_${specialistName}`
44
- };
45
- });
46
- }
47
- static specialistAgentBaseName(name, index) {
48
- return name?.trim().toLowerCase().replace(/ /g, '_') || `ai_agent_${index}`;
49
- }
50
- async getAIAgentResponse(botContext, previousContents) {
51
- const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
52
- const aiAgentResponse = await flowBuilderPlugin.getAiAgentResponse?.(botContext, {
53
- type: AiAgentType.Router,
54
- name: this.name,
55
- instructions: this.instructions,
56
- model: this.model,
57
- verbosity: this.verbosity,
58
- specialists: this.availableSpecialists.map(({ agent, description, name })=>({
59
- type: AiAgentType.Specialist,
60
- name,
61
- description,
62
- instructions: agent.instructions,
63
- model: agent.model,
64
- verbosity: agent.verbosity,
65
- activeTools: agent.activeTools ?? [],
66
- inputGuardrailRules: this.getActiveInputGuardrailRules(agent.inputGuardrailRules),
67
- sourceIds: agent.sources?.map((s)=>s.id) ?? []
68
- })),
69
- inputGuardrailRules: this.getActiveInputGuardrailRules(this.inputGuardrailRules),
70
- outputMessagesSchemas: [
71
- FlowBuilderContentSchema
72
- ],
73
- previousHubtypeMessages: this.getPreviousHubtypeContents(previousContents)
74
- });
75
- return aiAgentResponse;
76
- }
77
- async trackAiAgentResponse(botContext) {
78
- const isTransferredToSpecialist = this.aiAgentResponse?.isTransferredToSpecialist ?? false;
79
- await this.trackAIAgentRouterEvent(botContext, isTransferredToSpecialist);
80
- if (isTransferredToSpecialist) {
81
- await this.trackAIAgentSpecialistEvent(botContext);
82
- }
83
- }
84
- async trackAIAgentRouterEvent(botContext, isTransferredToSpecialist) {
85
- const { flowThreadId, flowId, flowName, flowNodeId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
86
- const routerEvent = {
87
- action: EventAction.AiAgentRouter,
88
- flowThreadId,
89
- flowId,
90
- flowName,
91
- flowNodeId,
92
- flowNodeContentId: this.name,
93
- flowNodeIsMeaningful: true,
94
- memoryLength: this.aiAgentResponse?.memoryLength ?? 0,
95
- inputMessageId: botContext.input.message_id,
96
- exit: this.aiAgentResponse?.exit ?? true,
97
- error: this.aiAgentResponse?.error ?? false,
98
- inputGuardrailsTriggered: this.aiAgentResponse?.inputGuardrailsTriggered ?? [],
99
- outputGuardrailsTriggered: this.aiAgentResponse?.outputGuardrailsTriggered ?? [],
100
- startingAgentName: this.aiAgentResponse?.startingAgentName || this.name,
101
- lastAgentName: this.aiAgentResponse?.lastAgentName || this.name,
102
- availableSpecialists: this.aiAgentResponse?.availableSpecialists ?? [],
103
- isTransferredToSpecialist
104
- };
105
- const { action, ...routerEventArgs } = routerEvent;
106
- await trackEvent(botContext, action, routerEventArgs);
107
- }
108
- async trackAIAgentSpecialistEvent(botContext) {
109
- const { flowThreadId, flowId, flowName, flowNodeId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
110
- const specialistEvent = {
111
- action: EventAction.AiAgent,
112
- flowThreadId,
113
- flowId,
114
- flowName,
115
- flowNodeId,
116
- flowNodeContentId: this.aiAgentResponse?.lastAgentName ?? '',
117
- flowNodeIsMeaningful: true,
118
- toolsExecuted: this.aiAgentResponse?.toolsExecuted ?? [],
119
- memoryLength: this.aiAgentResponse?.memoryLength ?? 0,
120
- inputMessageId: botContext.input.message_id,
121
- exit: this.aiAgentResponse?.exit ?? true,
122
- error: this.aiAgentResponse?.error ?? false,
123
- inputGuardrailsTriggered: [],
124
- outputGuardrailsTriggered: this.aiAgentResponse?.outputGuardrailsTriggered ?? []
125
- };
126
- const { action, ...specialistEventArgs } = specialistEvent;
127
- await trackEvent(botContext, action, specialistEventArgs);
128
- }
129
- constructor(...args){
130
- super(...args), this.availableSpecialists = [];
131
- }
132
- }
133
-
134
- export { FlowAiAgentRouter };
135
-
136
- //# sourceMappingURL=flow-ai-agent-router.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-fields/flow-ai-agent-router.js","sources":["../../src/content-fields/flow-ai-agent-router.tsx"],"sourcesContent":["import {\n AiAgentType,\n type BotContext,\n EventAction,\n type EventAiAgent,\n type EventAiAgentRouter,\n type InferenceResponse,\n} from '@botonic/core'\nimport {\n type FlowBuilderContentMessage,\n FlowBuilderContentSchema,\n} from '../structured-output/flow-builder-content'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { FlowAiAgent } from './flow-ai-agent'\nimport { FlowAiAgentBase } from './flow-ai-agent-base'\nimport type { HtAiAgentNode, HtAiAgentRouterNode } from './hubtype-fields'\nimport type { FlowContent } from './index'\n\nexport interface AvailableSpecialists {\n agent: FlowAiAgent\n description: string\n name: string\n}\n\nexport class FlowAiAgentRouter extends FlowAiAgentBase {\n public availableSpecialists: AvailableSpecialists[] = []\n\n static fromHubtypeCMS(\n component: HtAiAgentRouterNode,\n botContext: BotContext\n ): FlowAiAgentRouter {\n const newAiAgentRouter = new FlowAiAgentRouter(component.id)\n newAiAgentRouter.code = component.code\n newAiAgentRouter.name = component.content.name\n newAiAgentRouter.instructions = newAiAgentRouter.replaceVariables(\n component.content.instructions,\n botContext\n )\n newAiAgentRouter.model = component.content.model\n newAiAgentRouter.verbosity = component.content.verbosity\n newAiAgentRouter.availableSpecialists =\n FlowAiAgentRouter.getAvailableSpecialistsFromHubtypeCMS(\n component,\n botContext\n )\n newAiAgentRouter.inputGuardrailRules =\n component.content.input_guardrail_rules || []\n return newAiAgentRouter\n }\n\n private static getAvailableSpecialistsFromHubtypeCMS(\n component: HtAiAgentRouterNode,\n botContext: BotContext\n ): AvailableSpecialists[] {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n\n return component.content.available_specialists.map((agentSlot, index) => {\n const aiAgentSpecialistNode = cmsApi.getNodeById<HtAiAgentNode>(\n agentSlot.target.id\n )\n const specialist = FlowAiAgent.fromHubtypeCMS(\n aiAgentSpecialistNode,\n botContext\n )\n const specialistName = FlowAiAgentRouter.specialistAgentBaseName(\n agentSlot.name,\n index\n )\n const specialistDescription = specialist.replaceVariables(\n agentSlot.description || `Transfer to ${specialistName}`,\n botContext\n )\n\n return {\n agent: specialist,\n description: specialistDescription,\n name: `transfer_to_${specialistName}`,\n }\n })\n }\n\n private static specialistAgentBaseName(\n name: string | undefined,\n index: number\n ): string {\n return name?.trim().toLowerCase().replace(/ /g, '_') || `ai_agent_${index}`\n }\n\n async getAIAgentResponse(\n botContext: BotContext,\n previousContents?: FlowContent[]\n ): Promise<InferenceResponse<FlowBuilderContentMessage> | undefined> {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const aiAgentResponse = await flowBuilderPlugin.getAiAgentResponse?.(\n botContext,\n {\n type: AiAgentType.Router,\n name: this.name,\n instructions: this.instructions,\n model: this.model,\n verbosity: this.verbosity,\n specialists: this.availableSpecialists.map(\n ({ agent, description, name }) => ({\n type: AiAgentType.Specialist,\n name,\n description,\n instructions: agent.instructions,\n model: agent.model,\n verbosity: agent.verbosity,\n activeTools: agent.activeTools ?? [],\n inputGuardrailRules: this.getActiveInputGuardrailRules(\n agent.inputGuardrailRules\n ),\n sourceIds: agent.sources?.map(s => s.id) ?? [],\n })\n ),\n inputGuardrailRules: this.getActiveInputGuardrailRules(\n this.inputGuardrailRules\n ),\n outputMessagesSchemas: [FlowBuilderContentSchema],\n previousHubtypeMessages:\n this.getPreviousHubtypeContents(previousContents),\n }\n )\n\n return aiAgentResponse\n }\n\n async trackAiAgentResponse(botContext: BotContext) {\n const isTransferredToSpecialist =\n this.aiAgentResponse?.isTransferredToSpecialist ?? false\n\n await this.trackAIAgentRouterEvent(botContext, isTransferredToSpecialist)\n\n if (isTransferredToSpecialist) {\n await this.trackAIAgentSpecialistEvent(botContext)\n }\n }\n\n private async trackAIAgentRouterEvent(\n botContext: BotContext,\n isTransferredToSpecialist: boolean\n ) {\n const { flowThreadId, flowId, flowName, flowNodeId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n\n const routerEvent: EventAiAgentRouter = {\n action: EventAction.AiAgentRouter,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId: this.name,\n flowNodeIsMeaningful: true,\n memoryLength: this.aiAgentResponse?.memoryLength ?? 0,\n inputMessageId: botContext.input.message_id!,\n exit: this.aiAgentResponse?.exit ?? true,\n error: this.aiAgentResponse?.error ?? false,\n inputGuardrailsTriggered:\n this.aiAgentResponse?.inputGuardrailsTriggered ?? [],\n outputGuardrailsTriggered:\n this.aiAgentResponse?.outputGuardrailsTriggered ?? [],\n startingAgentName: this.aiAgentResponse?.startingAgentName || this.name,\n lastAgentName: this.aiAgentResponse?.lastAgentName || this.name,\n availableSpecialists: this.aiAgentResponse?.availableSpecialists ?? [],\n isTransferredToSpecialist,\n }\n const { action, ...routerEventArgs } = routerEvent\n await trackEvent(botContext, action, routerEventArgs)\n }\n\n private async trackAIAgentSpecialistEvent(botContext: BotContext) {\n const { flowThreadId, flowId, flowName, flowNodeId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n\n const specialistEvent: EventAiAgent = {\n action: EventAction.AiAgent,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId: this.aiAgentResponse?.lastAgentName ?? '',\n flowNodeIsMeaningful: true,\n toolsExecuted: this.aiAgentResponse?.toolsExecuted ?? [],\n memoryLength: this.aiAgentResponse?.memoryLength ?? 0,\n inputMessageId: botContext.input.message_id!,\n exit: this.aiAgentResponse?.exit ?? true,\n error: this.aiAgentResponse?.error ?? false,\n inputGuardrailsTriggered: [],\n outputGuardrailsTriggered:\n this.aiAgentResponse?.outputGuardrailsTriggered ?? [],\n }\n const { action, ...specialistEventArgs } = specialistEvent\n await trackEvent(botContext, action, specialistEventArgs)\n }\n}\n"],"names":["AiAgentType","EventAction","FlowBuilderContentSchema","getCommonFlowContentEventArgsForContentId","trackEvent","getFlowBuilderPlugin","FlowAiAgent","FlowAiAgentBase","FlowAiAgentRouter","component","botContext","newAiAgentRouter","flowBuilderPlugin","cmsApi","agentSlot","index","aiAgentSpecialistNode","specialist","specialistName","specialistDescription","name","previousContents","aiAgentResponse","agent","description","s","isTransferredToSpecialist","flowThreadId","flowId","flowName","flowNodeId","routerEvent","action","routerEventArgs","specialistEvent","specialistEventArgs"],"mappings":"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"}
@@ -1,17 +0,0 @@
1
- import { type BotContext, type InferenceResponse } from '@botonic/core';
2
- import { type FlowBuilderContentMessage } from '../structured-output/flow-builder-content.js';
3
- import { FlowAiAgentBase } from './flow-ai-agent-base.js';
4
- import type { HtAiAgentNode } from './hubtype-fields/ai-agent.js';
5
- import type { FlowContent } from './index.js';
6
- export declare class FlowAiAgent extends FlowAiAgentBase {
7
- activeTools?: {
8
- name: string;
9
- }[];
10
- sources?: {
11
- id: string;
12
- name: string;
13
- }[];
14
- static fromHubtypeCMS(component: HtAiAgentNode, botContext: BotContext): FlowAiAgent;
15
- getAIAgentResponse(botContext: BotContext, previousContents?: FlowContent[]): Promise<InferenceResponse<FlowBuilderContentMessage> | undefined>;
16
- trackAiAgentResponse(botContext: BotContext): Promise<void>;
17
- }
@@ -1,75 +0,0 @@
1
- import { AiAgentType, EventAction } from "@botonic/core";
2
- import { FlowBuilderContentSchema } from "../structured-output/flow-builder-content.js";
3
- import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../tracking.js";
4
- import { getFlowBuilderPlugin } from "../utils/get-flow-builder-plugin.js";
5
- import { FlowAiAgentBase } from "./flow-ai-agent-base.js";
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
- class FlowAiAgent extends FlowAiAgentBase {
18
- static fromHubtypeCMS(component, botContext) {
19
- const newAiAgent = new FlowAiAgent(component.id);
20
- newAiAgent.code = component.code;
21
- newAiAgent.name = component.content.name;
22
- newAiAgent.instructions = newAiAgent.replaceVariables(component.content.instructions, botContext);
23
- newAiAgent.model = component.content.model;
24
- newAiAgent.verbosity = component.content.verbosity;
25
- newAiAgent.activeTools = component.content.active_tools;
26
- newAiAgent.inputGuardrailRules = component.content.input_guardrail_rules || [];
27
- newAiAgent.sources = component.content.sources;
28
- newAiAgent.followUp = component.follow_up;
29
- return newAiAgent;
30
- }
31
- async getAIAgentResponse(botContext, previousContents) {
32
- const activeInputGuardrailRules = this.getActiveInputGuardrailRules(this.inputGuardrailRules);
33
- const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
34
- const aiAgentResponse = await flowBuilderPlugin.getAiAgentResponse?.(botContext, {
35
- type: AiAgentType.Specialist,
36
- name: this.name,
37
- instructions: this.instructions,
38
- model: this.model,
39
- verbosity: this.verbosity,
40
- activeTools: this.activeTools ?? [],
41
- inputGuardrailRules: activeInputGuardrailRules,
42
- sourceIds: this.sources?.map((source)=>source.id) ?? [],
43
- outputMessagesSchemas: [
44
- FlowBuilderContentSchema
45
- ],
46
- previousHubtypeMessages: this.getPreviousHubtypeContents(previousContents)
47
- });
48
- return aiAgentResponse;
49
- }
50
- async trackAiAgentResponse(botContext) {
51
- const { flowThreadId, flowId, flowName, flowNodeId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
52
- const event = {
53
- action: EventAction.AiAgent,
54
- flowThreadId: flowThreadId,
55
- flowId: flowId,
56
- flowName: flowName,
57
- flowNodeId: flowNodeId,
58
- flowNodeContentId: this.name,
59
- flowNodeIsMeaningful: true,
60
- toolsExecuted: this.aiAgentResponse?.toolsExecuted ?? [],
61
- memoryLength: this.aiAgentResponse?.memoryLength ?? 0,
62
- inputMessageId: botContext.input.message_id,
63
- exit: this.aiAgentResponse?.exit ?? true,
64
- inputGuardrailsTriggered: this.aiAgentResponse?.inputGuardrailsTriggered ?? [],
65
- outputGuardrailsTriggered: [],
66
- error: this.aiAgentResponse?.error ?? false
67
- };
68
- const { action, ...eventArgs } = event;
69
- await trackEvent(botContext, action, eventArgs);
70
- }
71
- }
72
-
73
- export { FlowAiAgent };
74
-
75
- //# sourceMappingURL=flow-ai-agent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-fields/flow-ai-agent.js","sources":["../../src/content-fields/flow-ai-agent.tsx"],"sourcesContent":["import {\n AiAgentType,\n type BotContext,\n EventAction,\n type EventAiAgent,\n type InferenceResponse,\n} from '@botonic/core'\nimport {\n type FlowBuilderContentMessage,\n FlowBuilderContentSchema,\n} from '../structured-output/flow-builder-content'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { FlowAiAgentBase } from './flow-ai-agent-base'\nimport type { HtAiAgentNode } from './hubtype-fields/ai-agent'\nimport type { FlowContent } from './index'\n\nexport class FlowAiAgent extends FlowAiAgentBase {\n public activeTools?: { name: string }[]\n public sources?: { id: string; name: string }[]\n\n static fromHubtypeCMS(\n component: HtAiAgentNode,\n botContext: BotContext\n ): FlowAiAgent {\n const newAiAgent = new FlowAiAgent(component.id)\n newAiAgent.code = component.code\n newAiAgent.name = component.content.name\n newAiAgent.instructions = newAiAgent.replaceVariables(\n component.content.instructions,\n botContext\n )\n newAiAgent.model = component.content.model\n newAiAgent.verbosity = component.content.verbosity\n newAiAgent.activeTools = component.content.active_tools\n newAiAgent.inputGuardrailRules =\n component.content.input_guardrail_rules || []\n newAiAgent.sources = component.content.sources\n newAiAgent.followUp = component.follow_up\n\n return newAiAgent\n }\n\n async getAIAgentResponse(\n botContext: BotContext,\n previousContents?: FlowContent[]\n ): Promise<InferenceResponse<FlowBuilderContentMessage> | undefined> {\n const activeInputGuardrailRules = this.getActiveInputGuardrailRules(\n this.inputGuardrailRules\n )\n\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n\n const aiAgentResponse = await flowBuilderPlugin.getAiAgentResponse?.(\n botContext,\n {\n type: AiAgentType.Specialist,\n name: this.name,\n instructions: this.instructions,\n model: this.model,\n verbosity: this.verbosity,\n activeTools: this.activeTools ?? [],\n inputGuardrailRules: activeInputGuardrailRules,\n sourceIds: this.sources?.map(source => source.id) ?? [],\n outputMessagesSchemas: [FlowBuilderContentSchema],\n previousHubtypeMessages:\n this.getPreviousHubtypeContents(previousContents),\n }\n )\n\n return aiAgentResponse\n }\n\n async trackAiAgentResponse(botContext: BotContext) {\n const { flowThreadId, flowId, flowName, flowNodeId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n\n const event: EventAiAgent = {\n action: EventAction.AiAgent,\n flowThreadId: flowThreadId,\n flowId: flowId,\n flowName: flowName,\n flowNodeId: flowNodeId,\n flowNodeContentId: this.name,\n flowNodeIsMeaningful: true,\n toolsExecuted: this.aiAgentResponse?.toolsExecuted ?? [],\n memoryLength: this.aiAgentResponse?.memoryLength ?? 0,\n inputMessageId: botContext.input.message_id!,\n exit: this.aiAgentResponse?.exit ?? true,\n inputGuardrailsTriggered:\n this.aiAgentResponse?.inputGuardrailsTriggered ?? [],\n outputGuardrailsTriggered: [], //aiAgentResponse.outputGuardrailsTriggered,\n error: this.aiAgentResponse?.error ?? false,\n }\n const { action, ...eventArgs } = event\n\n await trackEvent(botContext, action, eventArgs)\n }\n}\n"],"names":["AiAgentType","EventAction","FlowBuilderContentSchema","getCommonFlowContentEventArgsForContentId","trackEvent","getFlowBuilderPlugin","FlowAiAgentBase","FlowAiAgent","component","botContext","newAiAgent","previousContents","activeInputGuardrailRules","flowBuilderPlugin","aiAgentResponse","source","flowThreadId","flowId","flowName","flowNodeId","event","action","eventArgs"],"mappings":";;;;;;;;;;;AAMsB;AAI4B;AAI9B;AACmD;AACjB;AAI/C,MAAMO,WAAWA,SAASD,eAAeA;IAI9C,OAAO,eACLE,SAAwB,EACxBC,UAAsB,EACT;QACb,MAAMC,aAAa,IAAIH,WAAWA,CAACC,UAAU,EAAE;QAC/CE,WAAW,IAAI,GAAGF,UAAU,IAAI;QAChCE,WAAW,IAAI,GAAGF,UAAU,OAAO,CAAC,IAAI;QACxCE,WAAW,YAAY,GAAGA,WAAW,gBAAgB,CACnDF,UAAU,OAAO,CAAC,YAAY,EAC9BC;QAEFC,WAAW,KAAK,GAAGF,UAAU,OAAO,CAAC,KAAK;QAC1CE,WAAW,SAAS,GAAGF,UAAU,OAAO,CAAC,SAAS;QAClDE,WAAW,WAAW,GAAGF,UAAU,OAAO,CAAC,YAAY;QACvDE,WAAW,mBAAmB,GAC5BF,UAAU,OAAO,CAAC,qBAAqB,IAAI,EAAE;QAC/CE,WAAW,OAAO,GAAGF,UAAU,OAAO,CAAC,OAAO;QAC9CE,WAAW,QAAQ,GAAGF,UAAU,SAAS;QAEzC,OAAOE;IACT;IAEA,MAAM,mBACJD,UAAsB,EACtBE,gBAAgC,EACmC;QACnE,MAAMC,4BAA4B,IAAI,CAAC,4BAA4B,CACjE,IAAI,CAAC,mBAAmB;QAG1B,MAAMC,oBAAoBR,oBAAoBA,CAACI,WAAW,OAAO;QAEjE,MAAMK,kBAAkB,MAAMD,kBAAkB,kBAAkB,GAChEJ,YACA;YACE,MAAMT,sBAAsB;YAC5B,MAAM,IAAI,CAAC,IAAI;YACf,cAAc,IAAI,CAAC,YAAY;YAC/B,OAAO,IAAI,CAAC,KAAK;YACjB,WAAW,IAAI,CAAC,SAAS;YACzB,aAAa,IAAI,CAAC,WAAW,IAAI,EAAE;YACnC,qBAAqBY;YACrB,WAAW,IAAI,CAAC,OAAO,EAAE,IAAIG,CAAAA,SAAUA,OAAO,EAAE,KAAK,EAAE;YACvD,uBAAuB;gBAACb,wBAAwBA;aAAC;YACjD,yBACE,IAAI,CAAC,0BAA0B,CAACS;QACpC;QAGF,OAAOG;IACT;IAEA,MAAM,qBAAqBL,UAAsB,EAAE;QACjD,MAAM,EAAEO,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAE,GAClDhB,yCAAyCA,CAACM,YAAY,IAAI,CAAC,EAAE;QAE/D,MAAMW,QAAsB;YAC1B,QAAQnB,mBAAmB;YAC3B,cAAce;YACd,QAAQC;YACR,UAAUC;YACV,YAAYC;YACZ,mBAAmB,IAAI,CAAC,IAAI;YAC5B,sBAAsB;YACtB,eAAe,IAAI,CAAC,eAAe,EAAE,iBAAiB,EAAE;YACxD,cAAc,IAAI,CAAC,eAAe,EAAE,gBAAgB;YACpD,gBAAgBV,WAAW,KAAK,CAAC,UAAU;YAC3C,MAAM,IAAI,CAAC,eAAe,EAAE,QAAQ;YACpC,0BACE,IAAI,CAAC,eAAe,EAAE,4BAA4B,EAAE;YACtD,2BAA2B,EAAE;YAC7B,OAAO,IAAI,CAAC,eAAe,EAAE,SAAS;QACxC;QACA,MAAM,EAAEY,MAAM,EAAE,GAAGC,WAAW,GAAGF;QAEjC,MAAMhB,UAAUA,CAACK,YAAYY,QAAQC;IACvC;AACF"}
@@ -1,14 +0,0 @@
1
- import { type BotContext } from '@botonic/core';
2
- import type { ActionRequest } from '@botonic/react';
3
- import type { FlowBuilderApi } from '../api.js';
4
- import { ContentFieldsBase } from './content-fields-base.js';
5
- import type { HtBotActionNode } from './hubtype-fields/index.js';
6
- export declare class FlowBotAction extends ContentFieldsBase {
7
- code: string;
8
- payload: string;
9
- static fromHubtypeCMS(cmsBotAction: HtBotActionNode, cmsApi: FlowBuilderApi): FlowBotAction;
10
- trackFlow(botContext: BotContext): Promise<void>;
11
- doBotAction(botContext: ActionRequest): void;
12
- processContent(botContext: BotContext): Promise<void>;
13
- toBotonic(): JSX.Element;
14
- }
@@ -1,53 +0,0 @@
1
- import { Fragment, jsx } from "react/jsx-runtime";
2
- import { BotonicAction, EventAction } from "@botonic/core";
3
- import { getCommonFlowContentEventArgsForContentId, trackEvent } from "../tracking.js";
4
- import { ContentFieldsBase } from "./content-fields-base.js";
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
- class FlowBotAction extends ContentFieldsBase {
15
- static fromHubtypeCMS(cmsBotAction, cmsApi) {
16
- const newBotAction = new FlowBotAction(cmsBotAction.id);
17
- newBotAction.code = cmsBotAction.code;
18
- newBotAction.payload = cmsApi.createPayloadWithParams(cmsBotAction);
19
- newBotAction.followUp = cmsBotAction.follow_up;
20
- return newBotAction;
21
- }
22
- async trackFlow(botContext) {
23
- const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = getCommonFlowContentEventArgsForContentId(botContext, this.id);
24
- const eventBotAction = {
25
- action: EventAction.BotAction,
26
- flowThreadId,
27
- flowId,
28
- flowName,
29
- flowNodeId,
30
- flowNodeContentId,
31
- flowNodeIsMeaningful: false,
32
- payload: this.payload
33
- };
34
- const { action, ...eventArgs } = eventBotAction;
35
- await trackEvent(botContext, action, eventArgs);
36
- }
37
- doBotAction(botContext) {
38
- botContext.session._botonic_action = `${BotonicAction.Redirect}:${this.payload}`;
39
- }
40
- async processContent(botContext) {
41
- await this.filterContent(botContext, this);
42
- this.doBotAction(botContext);
43
- await this.trackFlow(botContext);
44
- return;
45
- }
46
- toBotonic() {
47
- return /*#__PURE__*/ jsx(Fragment, {});
48
- }
49
- }
50
-
51
- export { FlowBotAction };
52
-
53
- //# sourceMappingURL=flow-bot-action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-fields/flow-bot-action.js","sources":["../../src/content-fields/flow-bot-action.tsx"],"sourcesContent":["import {\n type BotContext,\n BotonicAction,\n EventAction,\n type EventBotAction,\n} from '@botonic/core'\nimport type { ActionRequest } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport {\n getCommonFlowContentEventArgsForContentId,\n trackEvent,\n} from '../tracking'\nimport { ContentFieldsBase } from './content-fields-base'\nimport type { HtBotActionNode } from './hubtype-fields'\n\nexport class FlowBotAction extends ContentFieldsBase {\n public code: string\n public payload: string\n\n static fromHubtypeCMS(\n cmsBotAction: HtBotActionNode,\n cmsApi: FlowBuilderApi\n ): FlowBotAction {\n const newBotAction = new FlowBotAction(cmsBotAction.id)\n newBotAction.code = cmsBotAction.code\n newBotAction.payload = cmsApi.createPayloadWithParams(cmsBotAction)\n newBotAction.followUp = cmsBotAction.follow_up\n\n return newBotAction\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } =\n getCommonFlowContentEventArgsForContentId(botContext, this.id)\n const eventBotAction: EventBotAction = {\n action: EventAction.BotAction,\n flowThreadId,\n flowId,\n flowName,\n flowNodeId,\n flowNodeContentId,\n flowNodeIsMeaningful: false,\n payload: this.payload,\n }\n const { action, ...eventArgs } = eventBotAction\n await trackEvent(botContext, action, eventArgs)\n }\n\n doBotAction(botContext: ActionRequest): void {\n botContext.session._botonic_action = `${BotonicAction.Redirect}:${this.payload}`\n }\n\n async processContent(botContext: BotContext): Promise<void> {\n await this.filterContent(botContext, this)\n this.doBotAction(botContext)\n await this.trackFlow(botContext)\n return\n }\n\n toBotonic(): JSX.Element {\n return <></>\n }\n}\n"],"names":["BotonicAction","EventAction","getCommonFlowContentEventArgsForContentId","trackEvent","ContentFieldsBase","FlowBotAction","cmsBotAction","cmsApi","newBotAction","botContext","flowThreadId","flowId","flowName","flowNodeId","flowNodeContentId","eventBotAction","action","eventArgs"],"mappings":";;;;;;;;;;AAKsB;AAOF;AACqC;AAGlD,MAAMK,aAAaA,SAASD,iBAAiBA;IAIlD,OAAO,eACLE,YAA6B,EAC7BC,MAAsB,EACP;QACf,MAAMC,eAAe,IAAIH,aAAaA,CAACC,aAAa,EAAE;QACtDE,aAAa,IAAI,GAAGF,aAAa,IAAI;QACrCE,aAAa,OAAO,GAAGD,OAAO,uBAAuB,CAACD;QACtDE,aAAa,QAAQ,GAAGF,aAAa,SAAS;QAE9C,OAAOE;IACT;IAEA,MAAM,UAAUC,UAAsB,EAAiB;QACrD,MAAM,EAAEC,YAAY,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAE,GACrEZ,yCAAyCA,CAACO,YAAY,IAAI,CAAC,EAAE;QAC/D,MAAMM,iBAAiC;YACrC,QAAQd,qBAAqB;YAC7BS;YACAC;YACAC;YACAC;YACAC;YACA,sBAAsB;YACtB,SAAS,IAAI,CAAC,OAAO;QACvB;QACA,MAAM,EAAEE,MAAM,EAAE,GAAGC,WAAW,GAAGF;QACjC,MAAMZ,UAAUA,CAACM,YAAYO,QAAQC;IACvC;IAEA,YAAYR,UAAyB,EAAQ;QAC3CA,WAAW,OAAO,CAAC,eAAe,GAAG,GAAGT,sBAAsB,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE;IAClF;IAEA,MAAM,eAAeS,UAAsB,EAAiB;QAC1D,MAAM,IAAI,CAAC,aAAa,CAACA,YAAY,IAAI;QACzC,IAAI,CAAC,WAAW,CAACA;QACjB,MAAM,IAAI,CAAC,SAAS,CAACA;QACrB;IACF;IAEA,YAAyB;QACvB,qBAAO;IACT;AACF"}
@@ -1,31 +0,0 @@
1
- import type { BotContext } from '@botonic/core';
2
- import { type Webview } from '@botonic/react';
3
- import type { FlowBuilderApi } from '../api.js';
4
- import { ContentFieldsBase } from './content-fields-base.js';
5
- import { FlowWebview } from './flow-webview.js';
6
- import { type HtButton, HtButtonStyle } from './hubtype-fields/index.js';
7
- import type { HtRatingButton } from './hubtype-fields/rating.js';
8
- export declare class FlowButton extends ContentFieldsBase {
9
- text: string;
10
- url?: string;
11
- payload?: string;
12
- target?: string;
13
- webview?: Webview;
14
- flowWebview?: FlowWebview;
15
- params?: Record<string, string>;
16
- static fromHubtypeCMS(cmsButton: HtButton, locale: string, cmsApi: FlowBuilderApi, botContext: BotContext): FlowButton;
17
- static fromAIAgent(button: {
18
- id: string;
19
- text: string;
20
- payload?: string;
21
- url?: string;
22
- target?: string;
23
- }): FlowButton;
24
- static fromRating(button: HtRatingButton): FlowButton;
25
- static getUrlId(cmsButton: HtButton, locale: string): string | undefined;
26
- static getTargetWebview(cmsApi: FlowBuilderApi, targetId: string): FlowWebview | undefined;
27
- trackFlow(botContext: BotContext): Promise<void>;
28
- processContent(): Promise<void>;
29
- renderButton(buttonIndex: number, buttonStyle?: HtButtonStyle): JSX.Element;
30
- private getButtonPayload;
31
- }
@@ -1,105 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Button, Reply } from "@botonic/react";
3
- import { SOURCE_INFO_SEPARATOR } from "../constants.js";
4
- import { ContentFieldsBase } from "./content-fields-base.js";
5
- import { FlowWebview } from "./flow-webview.js";
6
- import { HtButtonStyle, HtNodeWithContentType } from "./hubtype-fields/index.js";
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
- class FlowButton extends ContentFieldsBase {
21
- static fromHubtypeCMS(cmsButton, locale, cmsApi, botContext) {
22
- const urlId = FlowButton.getUrlId(cmsButton, locale);
23
- const newButton = new FlowButton(cmsButton.id);
24
- newButton.text = FlowButton.getTextByLocale(locale, cmsButton.text);
25
- if (cmsButton.target) {
26
- const webview = FlowButton.getTargetWebview(cmsApi, cmsButton.target.id);
27
- if (webview) {
28
- newButton.flowWebview = webview;
29
- newButton.webview = {
30
- name: webview.webviewComponentName
31
- };
32
- newButton.params = webview.getParams(botContext);
33
- } else {
34
- newButton.payload = cmsApi.getPayload(cmsButton.target);
35
- }
36
- }
37
- if (cmsButton.url && urlId) {
38
- const urlNode = cmsApi.getNodeById(urlId);
39
- newButton.url = urlNode.content.url;
40
- }
41
- return newButton;
42
- }
43
- static fromAIAgent(button) {
44
- const newButton = new FlowButton(button.id);
45
- newButton.text = button.text;
46
- if (button.url) {
47
- newButton.url = button.url;
48
- newButton.target = button.target;
49
- } else {
50
- newButton.payload = button.payload;
51
- }
52
- return newButton;
53
- }
54
- static fromRating(button) {
55
- const newButton = new FlowButton(button.id);
56
- newButton.text = button.text;
57
- newButton.payload = button.payload;
58
- newButton.target = button.target?.id;
59
- return newButton;
60
- }
61
- static getUrlId(cmsButton, locale) {
62
- return cmsButton.url.find((url)=>url.locale === locale)?.id;
63
- }
64
- static getTargetWebview(cmsApi, targetId) {
65
- const targetNode = cmsApi.getNodeById(targetId);
66
- if (targetNode.type !== HtNodeWithContentType.WEBVIEW) {
67
- return undefined;
68
- }
69
- return FlowWebview.fromHubtypeCMS(targetNode);
70
- }
71
- async trackFlow(botContext) {
72
- if (this.flowWebview) {
73
- await this.flowWebview.trackFlow(botContext);
74
- }
75
- }
76
- async processContent() {
77
- return;
78
- }
79
- renderButton(buttonIndex, buttonStyle) {
80
- if (buttonStyle === HtButtonStyle.QUICK_REPLY) {
81
- return /*#__PURE__*/ jsx(Reply, {
82
- payload: this.getButtonPayload(buttonIndex),
83
- children: this.text
84
- }, this.id);
85
- }
86
- return /*#__PURE__*/ jsx(Button, {
87
- url: this.url,
88
- payload: this.getButtonPayload(buttonIndex),
89
- target: this.target,
90
- webview: this.webview,
91
- params: this.params,
92
- children: this.text
93
- }, this.id);
94
- }
95
- getButtonPayload(buttonIndex) {
96
- return this.payload ? `${this.payload}${SOURCE_INFO_SEPARATOR}${buttonIndex}` : undefined;
97
- }
98
- constructor(...args){
99
- super(...args), this.text = '';
100
- }
101
- }
102
-
103
- export { FlowButton };
104
-
105
- //# sourceMappingURL=flow-button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-fields/flow-button.js","sources":["../../src/content-fields/flow-button.tsx"],"sourcesContent":["import type { BotContext } from '@botonic/core'\nimport { Button, Reply, type Webview } from '@botonic/react'\n\nimport type { FlowBuilderApi } from '../api'\nimport { SOURCE_INFO_SEPARATOR } from '../constants'\nimport { ContentFieldsBase } from './content-fields-base'\nimport { FlowWebview } from './flow-webview'\nimport {\n type HtButton,\n HtButtonStyle,\n HtNodeWithContentType,\n type HtUrlNode,\n} from './hubtype-fields'\nimport type { HtRatingButton } from './hubtype-fields/rating'\n\nexport class FlowButton extends ContentFieldsBase {\n public text = ''\n public url?: string\n public payload?: string\n public target?: string\n public webview?: Webview\n public flowWebview?: FlowWebview // Used for tracking\n public params?: Record<string, string>\n\n static fromHubtypeCMS(\n cmsButton: HtButton,\n locale: string,\n cmsApi: FlowBuilderApi,\n botContext: BotContext\n ): FlowButton {\n const urlId = FlowButton.getUrlId(cmsButton, locale)\n\n const newButton = new FlowButton(cmsButton.id)\n newButton.text = FlowButton.getTextByLocale(locale, cmsButton.text)\n if (cmsButton.target) {\n const webview = FlowButton.getTargetWebview(cmsApi, cmsButton.target.id)\n if (webview) {\n newButton.flowWebview = webview\n newButton.webview = { name: webview.webviewComponentName }\n newButton.params = webview.getParams(botContext)\n } else {\n newButton.payload = cmsApi.getPayload(cmsButton.target)\n }\n }\n\n if (cmsButton.url && urlId) {\n const urlNode = cmsApi.getNodeById<HtUrlNode>(urlId)\n newButton.url = urlNode.content.url\n }\n\n return newButton\n }\n\n static fromAIAgent(button: {\n id: string\n text: string\n payload?: string\n url?: string\n target?: string\n }): FlowButton {\n const newButton = new FlowButton(button.id)\n newButton.text = button.text\n if (button.url) {\n newButton.url = button.url\n newButton.target = button.target\n } else {\n newButton.payload = button.payload\n }\n return newButton\n }\n\n static fromRating(button: HtRatingButton): FlowButton {\n const newButton = new FlowButton(button.id)\n newButton.text = button.text\n newButton.payload = button.payload\n newButton.target = button.target?.id\n return newButton\n }\n\n static getUrlId(cmsButton: HtButton, locale: string): string | undefined {\n return cmsButton.url.find(url => url.locale === locale)?.id\n }\n\n static getTargetWebview(\n cmsApi: FlowBuilderApi,\n targetId: string\n ): FlowWebview | undefined {\n const targetNode = cmsApi.getNodeById(targetId)\n if (targetNode.type !== HtNodeWithContentType.WEBVIEW) {\n return undefined\n }\n return FlowWebview.fromHubtypeCMS(targetNode)\n }\n\n async trackFlow(botContext: BotContext): Promise<void> {\n if (this.flowWebview) {\n await this.flowWebview.trackFlow(botContext)\n }\n }\n\n async processContent(): Promise<void> {\n return\n }\n\n renderButton(buttonIndex: number, buttonStyle?: HtButtonStyle): JSX.Element {\n if (buttonStyle === HtButtonStyle.QUICK_REPLY) {\n return (\n <Reply key={this.id} payload={this.getButtonPayload(buttonIndex)}>\n {this.text}\n </Reply>\n )\n }\n\n return (\n <Button\n key={this.id}\n url={this.url}\n payload={this.getButtonPayload(buttonIndex)}\n target={this.target}\n webview={this.webview}\n params={this.params}\n >\n {this.text}\n </Button>\n )\n }\n\n private getButtonPayload(buttonIndex: number): string | undefined {\n return this.payload\n ? `${this.payload}${SOURCE_INFO_SEPARATOR}${buttonIndex}`\n : undefined\n }\n}\n"],"names":["Button","Reply","SOURCE_INFO_SEPARATOR","ContentFieldsBase","FlowWebview","HtButtonStyle","HtNodeWithContentType","FlowButton","cmsButton","locale","cmsApi","botContext","urlId","newButton","webview","urlNode","button","url","targetId","targetNode","undefined","buttonIndex","buttonStyle"],"mappings":"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"}
@@ -1,14 +0,0 @@
1
- import type { BotContext } from '@botonic/core';
2
- import { ContentFieldsBase } from './content-fields-base.js';
3
- import { HtAiValidationType, type HtCaptureUserInputNode } from './hubtype-fields/capture-user-input.js';
4
- export declare class FlowCaptureUserInput extends ContentFieldsBase {
5
- fieldName: string;
6
- aiValidationType: HtAiValidationType;
7
- aiValidationInstructions: string;
8
- captureSuccessId: string;
9
- captureFailId: string;
10
- static fromHubtypeCMS(cmsText: HtCaptureUserInputNode): FlowCaptureUserInput;
11
- trackFlow(_botContext: BotContext): Promise<void>;
12
- processContent(): Promise<void>;
13
- toBotonic(botContext: BotContext): JSX.Element;
14
- }
@@ -1,46 +0,0 @@
1
- import { Fragment, jsx } from "react/jsx-runtime";
2
- import { getFlowBuilderPlugin } from "../utils/get-flow-builder-plugin.js";
3
- import { ContentFieldsBase } from "./content-fields-base.js";
4
- import { HtAiValidationType } from "./hubtype-fields/capture-user-input.js";
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
- class FlowCaptureUserInput extends ContentFieldsBase {
15
- static fromHubtypeCMS(cmsText) {
16
- const newCaptureUserInput = new FlowCaptureUserInput(cmsText.id);
17
- newCaptureUserInput.code = cmsText.code;
18
- newCaptureUserInput.fieldName = cmsText.content.field_name;
19
- newCaptureUserInput.aiValidationType = cmsText.content.ai_validation_type || HtAiValidationType.NONE;
20
- newCaptureUserInput.aiValidationInstructions = cmsText.content.ai_validation_instructions || '';
21
- newCaptureUserInput.captureSuccessId = cmsText.content.capture_success.id;
22
- newCaptureUserInput.captureFailId = cmsText.content.capture_fail.id;
23
- newCaptureUserInput.followUp = undefined;
24
- return newCaptureUserInput;
25
- }
26
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
27
- async trackFlow(_botContext) {
28
- return;
29
- }
30
- async processContent() {
31
- return;
32
- }
33
- toBotonic(botContext) {
34
- const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins);
35
- const cmsApi = flowBuilderPlugin.cmsApi;
36
- cmsApi.setCaptureUserInputId(this.id);
37
- return /*#__PURE__*/ jsx(Fragment, {});
38
- }
39
- constructor(...args){
40
- super(...args), this.fieldName = '', this.aiValidationType = HtAiValidationType.NONE, this.aiValidationInstructions = '', this.captureSuccessId = '', this.captureFailId = '';
41
- }
42
- }
43
-
44
- export { FlowCaptureUserInput };
45
-
46
- //# sourceMappingURL=flow-capture-user-input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-fields/flow-capture-user-input.js","sources":["../../src/content-fields/flow-capture-user-input.tsx"],"sourcesContent":["import type { BotContext } from '@botonic/core'\n\nimport { getFlowBuilderPlugin } from '../utils/get-flow-builder-plugin'\nimport { ContentFieldsBase } from './content-fields-base'\nimport {\n HtAiValidationType,\n type HtCaptureUserInputNode,\n} from './hubtype-fields/capture-user-input'\n\nexport class FlowCaptureUserInput extends ContentFieldsBase {\n public fieldName = ''\n public aiValidationType = HtAiValidationType.NONE\n public aiValidationInstructions = ''\n public captureSuccessId = ''\n public captureFailId = ''\n\n static fromHubtypeCMS(cmsText: HtCaptureUserInputNode): FlowCaptureUserInput {\n const newCaptureUserInput = new FlowCaptureUserInput(cmsText.id)\n newCaptureUserInput.code = cmsText.code\n newCaptureUserInput.fieldName = cmsText.content.field_name\n newCaptureUserInput.aiValidationType =\n cmsText.content.ai_validation_type || HtAiValidationType.NONE\n newCaptureUserInput.aiValidationInstructions =\n cmsText.content.ai_validation_instructions || ''\n newCaptureUserInput.captureSuccessId = cmsText.content.capture_success.id\n newCaptureUserInput.captureFailId = cmsText.content.capture_fail.id\n newCaptureUserInput.followUp = undefined\n\n return newCaptureUserInput\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async trackFlow(_botContext: BotContext): Promise<void> {\n return\n }\n\n async processContent(): Promise<void> {\n return\n }\n\n toBotonic(botContext: BotContext): JSX.Element {\n const flowBuilderPlugin = getFlowBuilderPlugin(botContext.plugins)\n const cmsApi = flowBuilderPlugin.cmsApi\n cmsApi.setCaptureUserInputId(this.id)\n\n return <></>\n }\n}\n"],"names":["getFlowBuilderPlugin","ContentFieldsBase","HtAiValidationType","FlowCaptureUserInput","cmsText","newCaptureUserInput","undefined","_botContext","botContext","flowBuilderPlugin","cmsApi"],"mappings":";;;;;;;;;;AAEuE;AACd;AAIb;AAErC,MAAMG,oBAAoBA,SAASF,iBAAiBA;IAOzD,OAAO,eAAeG,OAA+B,EAAwB;QAC3E,MAAMC,sBAAsB,IAAIF,oBAAoBA,CAACC,QAAQ,EAAE;QAC/DC,oBAAoB,IAAI,GAAGD,QAAQ,IAAI;QACvCC,oBAAoB,SAAS,GAAGD,QAAQ,OAAO,CAAC,UAAU;QAC1DC,oBAAoB,gBAAgB,GAClCD,QAAQ,OAAO,CAAC,kBAAkB,IAAIF,uBAAuB;QAC/DG,oBAAoB,wBAAwB,GAC1CD,QAAQ,OAAO,CAAC,0BAA0B,IAAI;QAChDC,oBAAoB,gBAAgB,GAAGD,QAAQ,OAAO,CAAC,eAAe,CAAC,EAAE;QACzEC,oBAAoB,aAAa,GAAGD,QAAQ,OAAO,CAAC,YAAY,CAAC,EAAE;QACnEC,oBAAoB,QAAQ,GAAGC;QAE/B,OAAOD;IACT;IAEA,6DAA6D;IAC7D,MAAM,UAAUE,WAAuB,EAAiB;QACtD;IACF;IAEA,MAAM,iBAAgC;QACpC;IACF;IAEA,UAAUC,UAAsB,EAAe;QAC7C,MAAMC,oBAAoBT,oBAAoBA,CAACQ,WAAW,OAAO;QACjE,MAAME,SAASD,kBAAkB,MAAM;QACvCC,OAAO,qBAAqB,CAAC,IAAI,CAAC,EAAE;QAEpC,qBAAO;IACT;;QArCK,qBACE,YAAY,SACZ,mBAAmBR,uBAAuB,OAC1C,2BAA2B,SAC3B,mBAAmB,SACnB,gBAAgB;;AAiCzB"}
@@ -1,22 +0,0 @@
1
- import { type BotContext, type CarouselMessage } from '@botonic/core';
2
- import { type ActionRequest } from '@botonic/react';
3
- import type { FlowBuilderApi } from '../api.js';
4
- import { ContentFieldsBase } from './content-fields-base.js';
5
- import { FlowElement } from './flow-element.js';
6
- import type { HtCarouselNode } from './hubtype-fields/index.js';
7
- export declare class FlowCarousel extends ContentFieldsBase {
8
- whatsappText: string;
9
- elements: FlowElement[];
10
- static fromHubtypeCMS(component: HtCarouselNode, locale: string, cmsApi: FlowBuilderApi, botContext: BotContext): FlowCarousel;
11
- trackFlow(request: ActionRequest): Promise<void>;
12
- static areElementsValidForWhatsapp: (carouselMessage: CarouselMessage) => boolean;
13
- static generateWhatsappElementText(element: {
14
- title: string;
15
- subtitle?: string;
16
- }): string;
17
- private static createCardsFromElements;
18
- static fromAIAgent(id: string, carouselMessage: CarouselMessage, botContext: ActionRequest): JSX.Element;
19
- private toCarouselMessage;
20
- processContent(botContext: BotContext): Promise<void>;
21
- toBotonic(botContext: BotContext): JSX.Element;
22
- }