@hhgtech/hhg-components 1.29.466 → 1.29.468

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 (561) hide show
  1. package/build/{InputDate-e70acc77.js → InputDate-5b0b7869.js} +5 -5
  2. package/build/{LastPeriod-5867fee1.js → LastPeriod-85ca707d.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-17e1a76b.js → MobileBottomNavigationIcon-19d196c9.js} +3 -3
  4. package/build/{Spinner-d0cc8fa5.js → Spinner-39b4a549.js} +1 -1
  5. package/build/{WhatsApp-6f4fc737.js → WhatsApp-cf792749.js} +1 -1
  6. package/build/adapters.js +20 -20
  7. package/build/atoms.js +50 -50
  8. package/build/babyGrowth.js +86 -86
  9. package/build/cache.js +2 -2
  10. package/build/care.js +18 -18
  11. package/build/careBookingSearchBar.js +14 -14
  12. package/build/careBookingSearchBarV2.js +15 -15
  13. package/build/components.js +104 -104
  14. package/build/{constants-ddcab12d.js → constants-00963ab7.js} +1 -1
  15. package/build/constants.js +3 -3
  16. package/build/constantsDomainLocales.js +1 -1
  17. package/build/constantsRiskScreener.js +2 -2
  18. package/build/constantsSite.js +2 -2
  19. package/build/{core-dadd4f4a.js → core-d51c7c39.js} +1 -1
  20. package/build/{dataTransform-90672d8d.js → dataTransform-4ea49764.js} +1 -1
  21. package/build/ecom.js +5 -5
  22. package/build/{editor-2fe9217a.js → editor-56306bcc.js} +11 -11
  23. package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
  24. package/build/embeddedHeathToolCards_babyPoop.js +22 -22
  25. package/build/embeddedHeathToolCards_babyVaccine.js +24 -24
  26. package/build/embeddedHeathToolCards_bmi_bmi.js +27 -27
  27. package/build/embeddedHeathToolCards_bmrBmr.js +27 -27
  28. package/build/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  29. package/build/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  30. package/build/embeddedHeathToolCards_pwg_pwg.js +28 -28
  31. package/build/embeddedHeathToolCards_targetHeartRate.js +29 -29
  32. package/build/esm/{InputDate-2c2b1b09.js → InputDate-674d51bc.js} +5 -5
  33. package/build/esm/{LastPeriod-9beea85d.js → LastPeriod-81c8962f.js} +1 -1
  34. package/build/esm/{MobileBottomNavigationIcon-277d76ce.js → MobileBottomNavigationIcon-eb8c0470.js} +3 -3
  35. package/build/esm/{Spinner-8c75f1f9.js → Spinner-2b1edded.js} +1 -1
  36. package/build/esm/{WhatsApp-a9a0a55a.js → WhatsApp-a3e8b9df.js} +1 -1
  37. package/build/esm/adapters.js +20 -20
  38. package/build/esm/atoms.js +50 -50
  39. package/build/esm/babyGrowth.js +86 -86
  40. package/build/esm/cache.js +2 -2
  41. package/build/esm/care.js +18 -18
  42. package/build/esm/careBookingSearchBar.js +14 -14
  43. package/build/esm/careBookingSearchBarV2.js +15 -15
  44. package/build/esm/components.js +104 -104
  45. package/build/esm/{constants-df832955.js → constants-2434775c.js} +1 -1
  46. package/build/esm/constants.js +3 -3
  47. package/build/esm/constantsDomainLocales.js +1 -1
  48. package/build/esm/constantsRiskScreener.js +2 -2
  49. package/build/esm/constantsSite.js +2 -2
  50. package/build/esm/{core-d5bae5d9.js → core-9b0e22c3.js} +1 -1
  51. package/build/esm/{dataTransform-d298685f.js → dataTransform-d85e8f2f.js} +1 -1
  52. package/build/esm/ecom.js +5 -5
  53. package/build/esm/{editor-a21d9cfd.js → editor-371e66a1.js} +11 -11
  54. package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
  55. package/build/esm/embeddedHeathToolCards_babyPoop.js +22 -22
  56. package/build/esm/embeddedHeathToolCards_babyVaccine.js +24 -24
  57. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +27 -27
  58. package/build/esm/embeddedHeathToolCards_bmrBmr.js +27 -27
  59. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +24 -24
  60. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +24 -24
  61. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +28 -28
  62. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +29 -29
  63. package/build/esm/footer.js +22 -22
  64. package/build/esm/gAssets.js +2 -2
  65. package/build/esm/{healthTools-1b5b5451.js → healthTools-eef0631c.js} +1 -1
  66. package/build/esm/healthToolsCardWrapper.js +20 -20
  67. package/build/esm/healthToolsForm.js +35 -35
  68. package/build/esm/hooks.js +13 -13
  69. package/build/esm/i18n.js +2 -2
  70. package/build/esm/i18nV2.js +2 -2
  71. package/build/esm/{index-3b771893.js → index-01dc5712.js} +7 -7
  72. package/build/esm/{index-0a4144b7.js → index-02e24bd2.js} +22 -22
  73. package/build/esm/{index-ca376c56.js → index-07a73a38.js} +26 -26
  74. package/build/esm/{index-8a013ad3.js → index-0997f55f.js} +16 -16
  75. package/build/esm/{index-136683b2.js → index-140d47ba.js} +2 -2
  76. package/build/esm/{index-dde08a10.js → index-16304953.js} +16 -16
  77. package/build/esm/{index-8f818d72.js → index-171896a4.js} +3 -3
  78. package/build/esm/{index-68c04725.js → index-17cf690f.js} +5 -5
  79. package/build/esm/{index-fb30766c.js → index-1a149548.js} +6 -6
  80. package/build/esm/{index-73f9be90.js → index-1aad9e57.js} +2 -2
  81. package/build/esm/{index-25c22c1b.js → index-1bd5d939.js} +2 -2
  82. package/build/esm/{index-88c526ed.js → index-1c8fd9e1.js} +13 -13
  83. package/build/esm/{index-b0dbc99c.js → index-1d00e35b.js} +7 -7
  84. package/build/esm/{index-4b450e38.js → index-204ac58f.js} +2 -2
  85. package/build/esm/{index-699f0bdf.js → index-20e54bdd.js} +6 -6
  86. package/build/esm/{index-3e6fbc5a.js → index-2883f8be.js} +1 -1
  87. package/build/esm/{index-5c628cb2.js → index-2c4d2b8a.js} +15 -15
  88. package/build/esm/{index-3d04d623.js → index-360724d6.js} +32 -32
  89. package/build/esm/{index-88dccdb3.js → index-3625e45c.js} +3 -3
  90. package/build/esm/{index-392f40b3.js → index-3972ecae.js} +2 -2
  91. package/build/esm/{index-74339fad.js → index-399f9f30.js} +19 -19
  92. package/build/esm/{index-bbfee5ad.js → index-3ac57b95.js} +18 -18
  93. package/build/esm/{index-595210b1.js → index-4061d1ab.js} +2 -2
  94. package/build/esm/{index-dd8b7d47.js → index-479346aa.js} +1 -1
  95. package/build/esm/{index-abfe3e21.js → index-47e8beb4.js} +2 -2
  96. package/build/esm/{index-d4cf169f.js → index-4ec86380.js} +14 -14
  97. package/build/esm/{index-d412b3c3.js → index-5e6925f7.js} +2 -2
  98. package/build/esm/{index-5559754a.js → index-6090eace.js} +16 -16
  99. package/build/esm/{index-86870a10.js → index-6717cc50.js} +8 -8
  100. package/build/esm/{index-0d971837.js → index-68594694.js} +2 -2
  101. package/build/esm/{index-1dbbe6d5.js → index-6eeb7603.js} +21 -21
  102. package/build/esm/{index-4013eaa3.js → index-727d98b6.js} +6 -6
  103. package/build/esm/{index-8216e56c.js → index-737fb420.js} +30 -30
  104. package/build/esm/{index-3374e7b1.js → index-77ab7e37.js} +8 -8
  105. package/build/esm/{index-f9e2b47f.js → index-77c20a53.js} +32 -32
  106. package/build/esm/{index-3399cd2a.js → index-781aea50.js} +2 -2
  107. package/build/esm/{index-98213123.js → index-862e18fe.js} +2 -2
  108. package/build/esm/{index-c8c4aa51.js → index-902514bf.js} +3 -3
  109. package/build/esm/{index-fe6df7a2.js → index-94044c22.js} +1 -1
  110. package/build/esm/{index-d226eaaa.js → index-9a15feee.js} +21 -21
  111. package/build/esm/{index-dc0149ee.js → index-9e688f4f.js} +13 -13
  112. package/build/esm/{index-4c191d11.js → index-a30cde2d.js} +3 -3
  113. package/build/esm/{index-bdbe6967.js → index-a390c8de.js} +2 -2
  114. package/build/esm/{index-9b4f0b1d.js → index-a9155f3e.js} +18 -18
  115. package/build/esm/{index-120e358a.js → index-ad6ec073.js} +10 -10
  116. package/build/esm/{index-08533d82.js → index-b92ceb5a.js} +2 -2
  117. package/build/esm/{index-4780df46.js → index-bed0d242.js} +14 -14
  118. package/build/esm/{index-260cc3c9.js → index-ca959e2f.js} +4 -4
  119. package/build/esm/{index-fdbaf1fb.js → index-ce19a7b9.js} +14 -14
  120. package/build/esm/{index-d4f88116.js → index-cf676a41.js} +1 -1
  121. package/build/esm/{index-f21ec37c.js → index-cfc50adf.js} +11 -11
  122. package/build/esm/{index-463df4ad.js → index-d2d1a986.js} +1 -1
  123. package/build/esm/{index-e74e0658.js → index-d63aad6a.js} +14 -14
  124. package/build/esm/{index-9d7f1ca1.js → index-d971338a.js} +3 -3
  125. package/build/esm/{index-c6e6d189.js → index-da6b104e.js} +2 -2
  126. package/build/esm/{index-4f5a71c7.js → index-dd4ecad7.js} +1 -1
  127. package/build/esm/{index-0d92ba9a.js → index-ddf56a22.js} +2 -2
  128. package/build/esm/{index-3190f846.js → index-e166b086.js} +2 -2
  129. package/build/esm/{index-3eb05239.js → index-e16c3867.js} +1 -1
  130. package/build/esm/{index-e878f0d7.js → index-e2800d29.js} +3 -3
  131. package/build/esm/{index-c9b2cfce.js → index-e6fe2975.js} +17 -17
  132. package/build/esm/{index-6d11403b.js → index-e7d6f8e6.js} +25 -25
  133. package/build/esm/{index-ad1f0aaf.js → index-ea77c224.js} +3 -3
  134. package/build/esm/{index-be0d4ed0.js → index-eeeaa36e.js} +16 -16
  135. package/build/esm/{index-c293c8fb.js → index-ef16cd72.js} +4 -4
  136. package/build/esm/index-f0960e58.js +16 -0
  137. package/build/esm/{index-dea18302.js → index-f696b62a.js} +3 -3
  138. package/build/esm/{index-da5c545f.js → index-f6d3a3a5.js} +15 -15
  139. package/build/esm/{index-27ca7d13.js → index-f7695557.js} +6 -6
  140. package/build/esm/{index-7b1f23ee.js → index-f9929bd8.js} +5 -5
  141. package/build/esm/{index-8e7532c6.js → index-fa7858bf.js} +9 -9
  142. package/build/esm/{index-aa33e4df.js → index-fd37a14c.js} +2 -2
  143. package/build/esm/index.js +124 -124
  144. package/build/esm/{labelSorting-bbd7acc7.js → labelSorting-b9bf74c1.js} +4 -4
  145. package/build/esm/lead.js +35 -35
  146. package/build/esm/{logoIcon-d6f88f9e.js → logoIcon-f5d7d4d4.js} +2 -2
  147. package/build/esm/mantine.js +29 -38
  148. package/build/esm/misc.js +19 -19
  149. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  150. package/build/esm/miscGetSocialList.js +8 -8
  151. package/build/esm/miscScreenSizeContext.js +1 -1
  152. package/build/esm/mobileBottomNavigation.js +5 -5
  153. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  154. package/build/esm/molecules.js +78 -78
  155. package/build/esm/moleculesArticleCard.js +6 -6
  156. package/build/esm/moleculesArticleCardV2.js +17 -17
  157. package/build/esm/navigation.js +47 -47
  158. package/build/esm/navigationLogoutPopup.js +11 -11
  159. package/build/esm/navigationProfileButton.js +27 -27
  160. package/build/esm/onboardingV2.js +30 -30
  161. package/build/esm/organisms.js +57 -57
  162. package/build/esm/{post-64d0b34b.js → post-ba544b00.js} +2 -2
  163. package/build/esm/profileNavigation.js +20 -20
  164. package/build/esm/progressBar.js +1 -1
  165. package/build/esm/pwg.js +23 -23
  166. package/build/esm/ssoV2.js +31 -40
  167. package/build/esm/{store-7e6152fe.js → store-0fa17a2f.js} +3 -3
  168. package/build/esm/subot/hooks/useVerifyPhoneNumber.d.ts +1 -0
  169. package/build/esm/subot/index.d.ts +1 -0
  170. package/build/esm/subot/subotInline/index.d.ts +4 -0
  171. package/build/esm/subot/subotInline/index.styled.d.ts +67 -0
  172. package/build/esm/subot/subotInline/subotInline.config.d.ts +37 -0
  173. package/build/esm/subot/subotInline/subotInlineAction/index.d.ts +25 -0
  174. package/build/esm/subot/subotInline/subotInlineAction/subotInlineAction.d.ts +4 -0
  175. package/build/esm/subot/subotInline/subotInlineAction/subotInlineAction.styled.d.ts +54 -0
  176. package/build/esm/subot/subotInline/subotInlineFooter.d.ts +17 -0
  177. package/build/esm/subot/subotInline/subotInlineHeader.d.ts +3 -0
  178. package/build/esm/subot/subotInline/subotInlineIntent/index.d.ts +100 -0
  179. package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntent.d.ts +4 -0
  180. package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntent.styled.d.ts +159 -0
  181. package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntentFinal.d.ts +4 -0
  182. package/build/esm/subot/subotInline/subotInlineNode/SubotInlineNodeResultPoll.d.ts +4 -0
  183. package/build/esm/subot/subotInline/subotInlineNode/index.d.ts +15 -0
  184. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNode.d.ts +5 -0
  185. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNode.styled.d.ts +74 -0
  186. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeFinal.d.ts +4 -0
  187. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeFinalThankYou.d.ts +4 -0
  188. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeForm.d.ts +4 -0
  189. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeImage.d.ts +4 -0
  190. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeMultiple.d.ts +4 -0
  191. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeOTP.d.ts +4 -0
  192. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodePoll.d.ts +4 -0
  193. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeRating.d.ts +4 -0
  194. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeReaction.d.ts +4 -0
  195. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeReview.d.ts +4 -0
  196. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeSSO.d.ts +4 -0
  197. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeStart.d.ts +4 -0
  198. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeText.d.ts +4 -0
  199. package/build/esm/subot.js +3235 -107
  200. package/build/esm/surveyOrPremiumBanner.js +34 -34
  201. package/build/esm/surveyQuestionCard.js +11 -11
  202. package/build/esm/{surveyThankyouCard-b6c188aa.js → surveyThankyouCard-06be20f7.js} +5 -5
  203. package/build/esm/together/togetherComponentGlobalContext.d.ts +2 -0
  204. package/build/esm/together.js +57 -57
  205. package/build/esm/togetherApiUtils.js +4 -4
  206. package/build/esm/togetherAtoms.js +31 -31
  207. package/build/esm/togetherComponentGlobalContext.js +4 -4
  208. package/build/esm/togetherMolecules.js +52 -52
  209. package/build/esm/togetherMoleculesCardAuthor.js +29 -29
  210. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  211. package/build/esm/togetherMoleculesProfileDetail.js +40 -40
  212. package/build/esm/togetherOrganisms.js +51 -51
  213. package/build/esm/togetherRichTextEditor.js +18 -18
  214. package/build/esm/togetherShareBox.js +10 -10
  215. package/build/esm/{translationsProvider-74153448.js → translationsProvider-d114f026.js} +1 -1
  216. package/build/esm/{treePopoverMenu-ddc0053c.js → treePopoverMenu-49bc209a.js} +19 -19
  217. package/build/esm/types.js +2 -2
  218. package/build/esm/{useHealthToolCache-ae2a3dc6.js → useHealthToolCache-d2343d8e.js} +1 -1
  219. package/build/esm/{usePhoneValidator-47041515.js → usePhoneValidator-d107fed0.js} +5 -5
  220. package/build/esm/{usePlacesAutocomplete-80b189f5.js → usePlacesAutocomplete-a97ea834.js} +1 -1
  221. package/build/esm/useTogetherAuthRequiredAction.js +10 -10
  222. package/build/esm/{utils-05914d00.js → utils-1a0d3e3f.js} +2 -2
  223. package/build/esm/{utils-a39dad82.js → utils-1ae0050a.js} +5 -5
  224. package/build/esm/{utils-5c6865d6.js → utils-46cabd5d.js} +2 -2
  225. package/build/esm/{utils-7cf3558c.js → utils-e7f04f97.js} +3 -3
  226. package/build/esm/vaccination.js +22 -22
  227. package/build/footer.js +22 -22
  228. package/build/gAssets.js +2 -2
  229. package/build/{healthTools-35af34c9.js → healthTools-3c04e345.js} +1 -1
  230. package/build/healthToolsCardWrapper.js +20 -20
  231. package/build/healthToolsForm.js +35 -35
  232. package/build/hooks.js +13 -13
  233. package/build/i18n.js +2 -2
  234. package/build/i18nV2.js +1 -1
  235. package/build/{index-6d82ab0a.js → index-04d41ab4.js} +8 -8
  236. package/build/{index-cb6c1748.js → index-05723ab5.js} +1 -1
  237. package/build/{index-94b57174.js → index-077a4fab.js} +7 -7
  238. package/build/{index-4f1c3443.js → index-07f3c30a.js} +15 -15
  239. package/build/{index-e4936498.js → index-0a50fc6b.js} +14 -14
  240. package/build/{index-32c5ef69.js → index-0cf8bbeb.js} +1 -1
  241. package/build/{index-c49207d9.js → index-0fd5579a.js} +16 -16
  242. package/build/{index-13851065.js → index-11a12f89.js} +3 -3
  243. package/build/{index-380e82df.js → index-19a22b44.js} +30 -30
  244. package/build/{index-b7621273.js → index-205826e2.js} +2 -2
  245. package/build/{index-57ddbeec.js → index-2471b40f.js} +6 -6
  246. package/build/{index-2c52a052.js → index-2d11df17.js} +32 -32
  247. package/build/{index-52ce0dfd.js → index-2e9bd898.js} +2 -2
  248. package/build/{index-1f6dccfa.js → index-2fa70019.js} +16 -16
  249. package/build/{index-12032c21.js → index-342eca14.js} +2 -2
  250. package/build/{index-9ed26d27.js → index-3602ebf0.js} +16 -16
  251. package/build/{index-ca0fb58c.js → index-36f62452.js} +17 -17
  252. package/build/{index-b69c6eca.js → index-388253d1.js} +6 -6
  253. package/build/{index-e9a8a838.js → index-38e030e6.js} +7 -7
  254. package/build/{index-5beef217.js → index-3a76667d.js} +21 -21
  255. package/build/{index-21b29d0c.js → index-4d7fc80d.js} +15 -15
  256. package/build/{index-af395e5b.js → index-4f3435fc.js} +3 -3
  257. package/build/{index-e55a659f.js → index-51f4e3b5.js} +2 -2
  258. package/build/{index-babe1b4e.js → index-5a20dc9e.js} +2 -2
  259. package/build/{index-642eb08e.js → index-5afbd571.js} +2 -2
  260. package/build/{index-fd7528f1.js → index-61472b8c.js} +3 -3
  261. package/build/{index-f74c7b14.js → index-659205b1.js} +25 -25
  262. package/build/{index-16cc210a.js → index-67413132.js} +11 -11
  263. package/build/{index-b9b24208.js → index-678a33dc.js} +13 -13
  264. package/build/{index-ed593392.js → index-7472dad9.js} +1 -1
  265. package/build/{index-91282115.js → index-77756576.js} +3 -3
  266. package/build/{index-f01f082b.js → index-79a1730b.js} +2 -2
  267. package/build/{index-632236ab.js → index-7a583b85.js} +4 -4
  268. package/build/{index-61ffc47b.js → index-7a6ee5df.js} +3 -3
  269. package/build/{index-5339795b.js → index-7af34776.js} +26 -26
  270. package/build/{index-3a9624ee.js → index-7af76903.js} +1 -1
  271. package/build/{index-1049e07e.js → index-7cdf960a.js} +3 -3
  272. package/build/{index-cbc730a2.js → index-8297a2e4.js} +1 -1
  273. package/build/{index-2ca8ae23.js → index-85dcd98c.js} +21 -21
  274. package/build/{index-3d6a2d40.js → index-877971fd.js} +2 -2
  275. package/build/index-877ae476.js +22 -0
  276. package/build/{index-8ed6133c.js → index-88b540c9.js} +5 -5
  277. package/build/{index-260d1a0e.js → index-8cb64760.js} +9 -9
  278. package/build/{index-6b28eb0e.js → index-905c4fcb.js} +1 -1
  279. package/build/{index-da6185a7.js → index-95527ec4.js} +2 -2
  280. package/build/{index-289c9062.js → index-980a4ab4.js} +14 -14
  281. package/build/{index-39630033.js → index-987fea6e.js} +6 -6
  282. package/build/{index-ce429548.js → index-9d7812ef.js} +3 -3
  283. package/build/{index-3d68ec34.js → index-9d9bb81f.js} +1 -1
  284. package/build/{index-6a6f32e8.js → index-9eb1a7fd.js} +22 -22
  285. package/build/{index-c99734e8.js → index-a79e5836.js} +19 -19
  286. package/build/{index-6dd6f021.js → index-a8c9a918.js} +13 -13
  287. package/build/{index-2f4aaffc.js → index-ad251600.js} +10 -10
  288. package/build/{index-0245e8f9.js → index-ad8c501c.js} +18 -18
  289. package/build/{index-c1cca229.js → index-ad9e947d.js} +18 -18
  290. package/build/{index-5648fc1a.js → index-b3ca538b.js} +2 -2
  291. package/build/{index-fab2f2ad.js → index-c41708b0.js} +2 -2
  292. package/build/{index-8b29eb73.js → index-c776db1f.js} +6 -6
  293. package/build/{index-190410b7.js → index-c78f1989.js} +2 -2
  294. package/build/{index-0b5946c5.js → index-cee337ec.js} +4 -4
  295. package/build/{index-3681d558.js → index-d0256457.js} +2 -2
  296. package/build/{index-49f78013.js → index-d3798ea7.js} +5 -5
  297. package/build/{index-1ab83ca2.js → index-d694b920.js} +14 -14
  298. package/build/{index-04b0e956.js → index-d74ac2da.js} +16 -16
  299. package/build/{index-8b37d8f1.js → index-d8a6447e.js} +2 -2
  300. package/build/{index-2dbf13a2.js → index-e16a9b23.js} +14 -14
  301. package/build/{index-bc451055.js → index-e1e09f51.js} +3 -3
  302. package/build/{index-889c3a6c.js → index-e410ee95.js} +2 -2
  303. package/build/{index-13dcdd20.js → index-f6abc75d.js} +8 -8
  304. package/build/{index-51ef306e.js → index-f880f6ef.js} +2 -2
  305. package/build/{index-0557e081.js → index-fb160a9f.js} +32 -32
  306. package/build/{index-e5544bc0.js → index-fd6de04f.js} +2 -2
  307. package/build/index.js +124 -124
  308. package/build/{labelSorting-413e9178.js → labelSorting-88436817.js} +4 -4
  309. package/build/lead.js +35 -35
  310. package/build/{logoIcon-13dcc5e6.js → logoIcon-cdc5219e.js} +2 -2
  311. package/build/mantine.js +40 -48
  312. package/build/misc.js +19 -19
  313. package/build/miscGetDynamicHealthTool.js +4 -4
  314. package/build/miscGetSocialList.js +8 -8
  315. package/build/miscScreenSizeContext.js +1 -1
  316. package/build/mobileBottomNavigation.js +5 -5
  317. package/build/mobileBottomNavigationIcon.js +5 -5
  318. package/build/molecules.js +78 -78
  319. package/build/moleculesArticleCard.js +6 -6
  320. package/build/moleculesArticleCardV2.js +17 -17
  321. package/build/navigation.js +47 -47
  322. package/build/navigationLogoutPopup.js +11 -11
  323. package/build/navigationProfileButton.js +27 -27
  324. package/build/onboardingV2.js +29 -29
  325. package/build/organisms.js +57 -57
  326. package/build/{post-0bbe8a22.js → post-a9ebeee7.js} +2 -2
  327. package/build/profileNavigation.js +20 -20
  328. package/build/progressBar.js +1 -1
  329. package/build/pwg.js +23 -23
  330. package/build/ssoV2.js +29 -38
  331. package/build/{store-0c2eef06.js → store-d25421b6.js} +3 -3
  332. package/build/subot/hooks/useVerifyPhoneNumber.d.ts +1 -0
  333. package/build/subot/index.d.ts +1 -0
  334. package/build/subot/subotInline/index.d.ts +4 -0
  335. package/build/subot/subotInline/index.styled.d.ts +67 -0
  336. package/build/subot/subotInline/subotInline.config.d.ts +37 -0
  337. package/build/subot/subotInline/subotInlineAction/index.d.ts +25 -0
  338. package/build/subot/subotInline/subotInlineAction/subotInlineAction.d.ts +4 -0
  339. package/build/subot/subotInline/subotInlineAction/subotInlineAction.styled.d.ts +54 -0
  340. package/build/subot/subotInline/subotInlineFooter.d.ts +17 -0
  341. package/build/subot/subotInline/subotInlineHeader.d.ts +3 -0
  342. package/build/subot/subotInline/subotInlineIntent/index.d.ts +100 -0
  343. package/build/subot/subotInline/subotInlineIntent/subotInlineIntent.d.ts +4 -0
  344. package/build/subot/subotInline/subotInlineIntent/subotInlineIntent.styled.d.ts +159 -0
  345. package/build/subot/subotInline/subotInlineIntent/subotInlineIntentFinal.d.ts +4 -0
  346. package/build/subot/subotInline/subotInlineNode/SubotInlineNodeResultPoll.d.ts +4 -0
  347. package/build/subot/subotInline/subotInlineNode/index.d.ts +15 -0
  348. package/build/subot/subotInline/subotInlineNode/subotInlineNode.d.ts +5 -0
  349. package/build/subot/subotInline/subotInlineNode/subotInlineNode.styled.d.ts +74 -0
  350. package/build/subot/subotInline/subotInlineNode/subotInlineNodeFinal.d.ts +4 -0
  351. package/build/subot/subotInline/subotInlineNode/subotInlineNodeFinalThankYou.d.ts +4 -0
  352. package/build/subot/subotInline/subotInlineNode/subotInlineNodeForm.d.ts +4 -0
  353. package/build/subot/subotInline/subotInlineNode/subotInlineNodeImage.d.ts +4 -0
  354. package/build/subot/subotInline/subotInlineNode/subotInlineNodeMultiple.d.ts +4 -0
  355. package/build/subot/subotInline/subotInlineNode/subotInlineNodeOTP.d.ts +4 -0
  356. package/build/subot/subotInline/subotInlineNode/subotInlineNodePoll.d.ts +4 -0
  357. package/build/subot/subotInline/subotInlineNode/subotInlineNodeRating.d.ts +4 -0
  358. package/build/subot/subotInline/subotInlineNode/subotInlineNodeReaction.d.ts +4 -0
  359. package/build/subot/subotInline/subotInlineNode/subotInlineNodeReview.d.ts +4 -0
  360. package/build/subot/subotInline/subotInlineNode/subotInlineNodeSSO.d.ts +4 -0
  361. package/build/subot/subotInline/subotInlineNode/subotInlineNodeStart.d.ts +4 -0
  362. package/build/subot/subotInline/subotInlineNode/subotInlineNodeText.d.ts +4 -0
  363. package/build/subot.js +3250 -110
  364. package/build/surveyOrPremiumBanner.js +34 -34
  365. package/build/surveyQuestionCard.js +11 -11
  366. package/build/{surveyThankyouCard-d2b87b5c.js → surveyThankyouCard-f8b13eae.js} +5 -5
  367. package/build/together/togetherComponentGlobalContext.d.ts +2 -0
  368. package/build/together.js +57 -57
  369. package/build/togetherApiUtils.js +4 -4
  370. package/build/togetherAtoms.js +31 -31
  371. package/build/togetherComponentGlobalContext.js +4 -4
  372. package/build/togetherMolecules.js +52 -52
  373. package/build/togetherMoleculesCardAuthor.js +29 -29
  374. package/build/togetherMoleculesPostImagePreview.js +11 -11
  375. package/build/togetherMoleculesProfileDetail.js +40 -40
  376. package/build/togetherOrganisms.js +51 -51
  377. package/build/togetherRichTextEditor.js +18 -18
  378. package/build/togetherShareBox.js +10 -10
  379. package/build/{translationsProvider-6369fef2.js → translationsProvider-a8753567.js} +1 -1
  380. package/build/{treePopoverMenu-11c47155.js → treePopoverMenu-7b840f8f.js} +19 -19
  381. package/build/types.js +2 -2
  382. package/build/{useHealthToolCache-ec2fae49.js → useHealthToolCache-4aa4c2eb.js} +1 -1
  383. package/build/{usePhoneValidator-c9e99f1b.js → usePhoneValidator-162c1bd3.js} +5 -5
  384. package/build/{usePlacesAutocomplete-01a7b0c2.js → usePlacesAutocomplete-48c44c61.js} +1 -1
  385. package/build/useTogetherAuthRequiredAction.js +10 -10
  386. package/build/{utils-6cda81da.js → utils-14b8061a.js} +2 -2
  387. package/build/{utils-64b537e9.js → utils-2985e713.js} +3 -3
  388. package/build/{utils-6cfe5b6c.js → utils-c0555488.js} +5 -5
  389. package/build/{utils-bbd04320.js → utils-dbbca708.js} +2 -2
  390. package/build/vaccination.js +22 -22
  391. package/package.json +3 -1
  392. /package/build/{BMI_BOYS.percentile.monthly-23d89cf4.js → BMI_BOYS.percentile.monthly-cfe10adf.js} +0 -0
  393. /package/build/{BMI_BOYS.percentile.weekly-b2d66b6b.js → BMI_BOYS.percentile.weekly-aa6dd26a.js} +0 -0
  394. /package/build/{BMI_BOYS.percentile.yearly-acd4f12c.js → BMI_BOYS.percentile.yearly-e19db864.js} +0 -0
  395. /package/build/{BMI_BOYS.zscore.monthly-4c241e07.js → BMI_BOYS.zscore.monthly-8f72c0a2.js} +0 -0
  396. /package/build/{BMI_BOYS.zscore.weekly-8c0c1d3d.js → BMI_BOYS.zscore.weekly-a8ad71f2.js} +0 -0
  397. /package/build/{BMI_BOYS.zscore.yearly-819f3208.js → BMI_BOYS.zscore.yearly-5bf15f7b.js} +0 -0
  398. /package/build/{BMI_GIRLS.percentile.monthly-13667059.js → BMI_GIRLS.percentile.monthly-5fdb43fc.js} +0 -0
  399. /package/build/{BMI_GIRLS.percentile.weekly-0e596dee.js → BMI_GIRLS.percentile.weekly-d30d3a9e.js} +0 -0
  400. /package/build/{BMI_GIRLS.percentile.yearly-171cca8f.js → BMI_GIRLS.percentile.yearly-530310a2.js} +0 -0
  401. /package/build/{BMI_GIRLS.zscore.monthly-78ac823c.js → BMI_GIRLS.zscore.monthly-5e825905.js} +0 -0
  402. /package/build/{BMI_GIRLS.zscore.weekly-7a2136ae.js → BMI_GIRLS.zscore.weekly-fd89311a.js} +0 -0
  403. /package/build/{BMI_GIRLS.zscore.yearly-4a4a0606.js → BMI_GIRLS.zscore.yearly-ce62584e.js} +0 -0
  404. /package/build/{ChevronDown-636c2bd1.js → ChevronDown-6091b7e4.js} +0 -0
  405. /package/build/{Close-ec1c15b0.js → Close-e4737e4c.js} +0 -0
  406. /package/build/{Google-f0cad204.js → Google-9e9ff8cf.js} +0 -0
  407. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-14e4bd7b.js → HEAD CIRCUM_BOYS.percentile.monthly-bc79ded9.js} +0 -0
  408. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-346947cc.js → HEAD CIRCUM_BOYS.percentile.weekly-641ebc32.js} +0 -0
  409. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-b9fb215c.js → HEAD CIRCUM_BOYS.percentile.yearly-bc5c3cbd.js} +0 -0
  410. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-3e80ea4e.js → HEAD CIRCUM_BOYS.zscore.monthly-8fc9d0a4.js} +0 -0
  411. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-523a21f8.js → HEAD CIRCUM_BOYS.zscore.weekly-b5748305.js} +0 -0
  412. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-a763c30b.js → HEAD CIRCUM_BOYS.zscore.yearly-de74110c.js} +0 -0
  413. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-339528ec.js → HEAD CIRCUM_GIRLS.percentile.monthly-eaac45d8.js} +0 -0
  414. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-8c1de779.js → HEAD CIRCUM_GIRLS.percentile.weekly-7e1c5c89.js} +0 -0
  415. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-357895b3.js → HEAD CIRCUM_GIRLS.percentile.yearly-6dd59ab4.js} +0 -0
  416. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-844ef23a.js → HEAD CIRCUM_GIRLS.zscore.monthly-2252fc27.js} +0 -0
  417. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-2b44834e.js → HEAD CIRCUM_GIRLS.zscore.weekly-40179ef7.js} +0 -0
  418. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-4af4e16d.js → HEAD CIRCUM_GIRLS.zscore.yearly-e5ff32cb.js} +0 -0
  419. /package/build/{HEIGHT_BOYS.percentile.monthly-9e1c2598.js → HEIGHT_BOYS.percentile.monthly-2a93c4c4.js} +0 -0
  420. /package/build/{HEIGHT_BOYS.percentile.weekly-c1a82eed.js → HEIGHT_BOYS.percentile.weekly-e19d54b6.js} +0 -0
  421. /package/build/{HEIGHT_BOYS.percentile.yearly-f30a2d31.js → HEIGHT_BOYS.percentile.yearly-72f7eab0.js} +0 -0
  422. /package/build/{HEIGHT_BOYS.zscore.monthly-50b2c07b.js → HEIGHT_BOYS.zscore.monthly-76b9ab92.js} +0 -0
  423. /package/build/{HEIGHT_BOYS.zscore.weekly-8a178859.js → HEIGHT_BOYS.zscore.weekly-dc436e5e.js} +0 -0
  424. /package/build/{HEIGHT_BOYS.zscore.yearly-7414fe3f.js → HEIGHT_BOYS.zscore.yearly-e0910a2b.js} +0 -0
  425. /package/build/{HEIGHT_GIRLS.percentile.monthly-f8e91c0d.js → HEIGHT_GIRLS.percentile.monthly-a02ec78e.js} +0 -0
  426. /package/build/{HEIGHT_GIRLS.percentile.weekly-78b4747b.js → HEIGHT_GIRLS.percentile.weekly-040243b7.js} +0 -0
  427. /package/build/{HEIGHT_GIRLS.percentile.yearly-e823de7e.js → HEIGHT_GIRLS.percentile.yearly-9583c101.js} +0 -0
  428. /package/build/{HEIGHT_GIRLS.zscore.monthly-0baafd6d.js → HEIGHT_GIRLS.zscore.monthly-cbebfb9c.js} +0 -0
  429. /package/build/{HEIGHT_GIRLS.zscore.weekly-52913973.js → HEIGHT_GIRLS.zscore.weekly-dc4560ae.js} +0 -0
  430. /package/build/{HEIGHT_GIRLS.zscore.yearly-a71174ee.js → HEIGHT_GIRLS.zscore.yearly-5abb3c9d.js} +0 -0
  431. /package/build/{Locale-bfce9a0f.js → Locale-adb54541.js} +0 -0
  432. /package/build/{Visible-bcc7a7b4.js → Visible-93fd30d7.js} +0 -0
  433. /package/build/{WEIGHT_BOYS.percentile.monthly-8969908b.js → WEIGHT_BOYS.percentile.monthly-e3260ef5.js} +0 -0
  434. /package/build/{WEIGHT_BOYS.percentile.weekly-140286ba.js → WEIGHT_BOYS.percentile.weekly-06ef57e1.js} +0 -0
  435. /package/build/{WEIGHT_BOYS.percentile.yearly-9034e074.js → WEIGHT_BOYS.percentile.yearly-568aa9b3.js} +0 -0
  436. /package/build/{WEIGHT_BOYS.zscore.monthly-06b0e2c3.js → WEIGHT_BOYS.zscore.monthly-9d6cf07f.js} +0 -0
  437. /package/build/{WEIGHT_BOYS.zscore.weekly-2a5b1936.js → WEIGHT_BOYS.zscore.weekly-60a1a5bc.js} +0 -0
  438. /package/build/{WEIGHT_BOYS.zscore.yearly-0eb9f725.js → WEIGHT_BOYS.zscore.yearly-8896a16d.js} +0 -0
  439. /package/build/{WEIGHT_GIRLS.percentile.monthly-42738dbb.js → WEIGHT_GIRLS.percentile.monthly-e088a3c1.js} +0 -0
  440. /package/build/{WEIGHT_GIRLS.percentile.weekly-c5f5e65b.js → WEIGHT_GIRLS.percentile.weekly-79cb95fb.js} +0 -0
  441. /package/build/{WEIGHT_GIRLS.percentile.yearly-2dcf4aa1.js → WEIGHT_GIRLS.percentile.yearly-4843049f.js} +0 -0
  442. /package/build/{WEIGHT_GIRLS.zscore.monthly-8e7cebf0.js → WEIGHT_GIRLS.zscore.monthly-d23879be.js} +0 -0
  443. /package/build/{WEIGHT_GIRLS.zscore.weekly-bf88b151.js → WEIGHT_GIRLS.zscore.weekly-ef1e1985.js} +0 -0
  444. /package/build/{WEIGHT_GIRLS.zscore.yearly-7c4a45b0.js → WEIGHT_GIRLS.zscore.yearly-cd203302.js} +0 -0
  445. /package/build/{ageGenerate-d86459c6.js → ageGenerate-22f5970f.js} +0 -0
  446. /package/build/{animation-2ed3d3bf.js → animation-8a1fcd94.js} +0 -0
  447. /package/build/{constants-fb557268.js → constants-092d4d1a.js} +0 -0
  448. /package/build/{constants-94ef9343.js → constants-1b1c9c6d.js} +0 -0
  449. /package/build/{constants-7914a581.js → constants-50e0caf4.js} +0 -0
  450. /package/build/{context-4903b694.js → context-cd231d7c.js} +0 -0
  451. /package/build/{dataTransform-c9e110ce.js → dataTransform-9a7e0a08.js} +0 -0
  452. /package/build/esm/{BMI_BOYS.percentile.monthly-42bd841c.js → BMI_BOYS.percentile.monthly-98f315dc.js} +0 -0
  453. /package/build/esm/{BMI_BOYS.percentile.weekly-6aa2a26a.js → BMI_BOYS.percentile.weekly-07a49dcd.js} +0 -0
  454. /package/build/esm/{BMI_BOYS.percentile.yearly-76bf8a6e.js → BMI_BOYS.percentile.yearly-da86a04a.js} +0 -0
  455. /package/build/esm/{BMI_BOYS.zscore.monthly-64736c26.js → BMI_BOYS.zscore.monthly-dfa7f8aa.js} +0 -0
  456. /package/build/esm/{BMI_BOYS.zscore.weekly-7473100d.js → BMI_BOYS.zscore.weekly-60530fdf.js} +0 -0
  457. /package/build/esm/{BMI_BOYS.zscore.yearly-7b2ad510.js → BMI_BOYS.zscore.yearly-3b388ba3.js} +0 -0
  458. /package/build/esm/{BMI_GIRLS.percentile.monthly-9706a399.js → BMI_GIRLS.percentile.monthly-ff857b9f.js} +0 -0
  459. /package/build/esm/{BMI_GIRLS.percentile.weekly-ce545edb.js → BMI_GIRLS.percentile.weekly-298da26d.js} +0 -0
  460. /package/build/esm/{BMI_GIRLS.percentile.yearly-1863f7e1.js → BMI_GIRLS.percentile.yearly-dd7d67db.js} +0 -0
  461. /package/build/esm/{BMI_GIRLS.zscore.monthly-9586d434.js → BMI_GIRLS.zscore.monthly-85b8d515.js} +0 -0
  462. /package/build/esm/{BMI_GIRLS.zscore.weekly-b4f4b7aa.js → BMI_GIRLS.zscore.weekly-47271ecd.js} +0 -0
  463. /package/build/esm/{BMI_GIRLS.zscore.yearly-43516f75.js → BMI_GIRLS.zscore.yearly-f252c248.js} +0 -0
  464. /package/build/esm/{ChevronDown-44d0ce34.js → ChevronDown-fd9876ba.js} +0 -0
  465. /package/build/esm/{Close-28d29720.js → Close-27562735.js} +0 -0
  466. /package/build/esm/{Google-164b7e6d.js → Google-fe69296d.js} +0 -0
  467. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-a8f95d0f.js → HEAD CIRCUM_BOYS.percentile.monthly-39009b17.js} +0 -0
  468. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-0e3d3361.js → HEAD CIRCUM_BOYS.percentile.weekly-bed7c9bc.js} +0 -0
  469. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-c6435ef2.js → HEAD CIRCUM_BOYS.percentile.yearly-d26503ce.js} +0 -0
  470. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-a0c85b90.js → HEAD CIRCUM_BOYS.zscore.monthly-d2e7da92.js} +0 -0
  471. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-7f181973.js → HEAD CIRCUM_BOYS.zscore.weekly-d0a8dd51.js} +0 -0
  472. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-8f50f1ba.js → HEAD CIRCUM_BOYS.zscore.yearly-391043e0.js} +0 -0
  473. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-623a60dc.js → HEAD CIRCUM_GIRLS.percentile.monthly-304456db.js} +0 -0
  474. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-7164f719.js → HEAD CIRCUM_GIRLS.percentile.weekly-3b667a41.js} +0 -0
  475. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-d089bdac.js → HEAD CIRCUM_GIRLS.percentile.yearly-f161a50c.js} +0 -0
  476. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-b79f2d83.js → HEAD CIRCUM_GIRLS.zscore.monthly-9a663095.js} +0 -0
  477. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-ebc776af.js → HEAD CIRCUM_GIRLS.zscore.weekly-b0a08b06.js} +0 -0
  478. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-e2480d86.js → HEAD CIRCUM_GIRLS.zscore.yearly-5ecd34c9.js} +0 -0
  479. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-33570c5b.js → HEIGHT_BOYS.percentile.monthly-13994e53.js} +0 -0
  480. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-21b64512.js → HEIGHT_BOYS.percentile.weekly-f4d4418d.js} +0 -0
  481. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-4c8a41b1.js → HEIGHT_BOYS.percentile.yearly-f6e8f5a9.js} +0 -0
  482. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-c125b85d.js → HEIGHT_BOYS.zscore.monthly-506c74dc.js} +0 -0
  483. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-bb91e39b.js → HEIGHT_BOYS.zscore.weekly-2a63fb3b.js} +0 -0
  484. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-20b542cc.js → HEIGHT_BOYS.zscore.yearly-929bfe3d.js} +0 -0
  485. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-a0696265.js → HEIGHT_GIRLS.percentile.monthly-c30c96ba.js} +0 -0
  486. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-843e1f60.js → HEIGHT_GIRLS.percentile.weekly-c4363b6d.js} +0 -0
  487. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-b1d733f0.js → HEIGHT_GIRLS.percentile.yearly-4bc3cd01.js} +0 -0
  488. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-8a6dd4ed.js → HEIGHT_GIRLS.zscore.monthly-98b91a75.js} +0 -0
  489. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-85f48e4a.js → HEIGHT_GIRLS.zscore.weekly-e50ef1e4.js} +0 -0
  490. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-911629a6.js → HEIGHT_GIRLS.zscore.yearly-3cf085f9.js} +0 -0
  491. /package/build/esm/{Locale-d7ad85b1.js → Locale-96eccf11.js} +0 -0
  492. /package/build/esm/{Visible-a2f53fd9.js → Visible-8efffb9f.js} +0 -0
  493. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-e66a5875.js → WEIGHT_BOYS.percentile.monthly-061df07a.js} +0 -0
  494. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-4a45b693.js → WEIGHT_BOYS.percentile.weekly-01bdbed1.js} +0 -0
  495. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-ef81065c.js → WEIGHT_BOYS.percentile.yearly-3bdc4fd9.js} +0 -0
  496. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-fab58d6e.js → WEIGHT_BOYS.zscore.monthly-e109d278.js} +0 -0
  497. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-ca801150.js → WEIGHT_BOYS.zscore.weekly-ec6f89e2.js} +0 -0
  498. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-67c4c30f.js → WEIGHT_BOYS.zscore.yearly-cdee15ff.js} +0 -0
  499. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-868f1bf9.js → WEIGHT_GIRLS.percentile.monthly-c1866c19.js} +0 -0
  500. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-0f3b84e4.js → WEIGHT_GIRLS.percentile.weekly-a69ba565.js} +0 -0
  501. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-a038d604.js → WEIGHT_GIRLS.percentile.yearly-b8b22c54.js} +0 -0
  502. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-8089964a.js → WEIGHT_GIRLS.zscore.monthly-a6523c4d.js} +0 -0
  503. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-c3bc040a.js → WEIGHT_GIRLS.zscore.weekly-66cca237.js} +0 -0
  504. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-2bdb66af.js → WEIGHT_GIRLS.zscore.yearly-9f43f944.js} +0 -0
  505. /package/build/esm/{ageGenerate-8e206381.js → ageGenerate-d7e4d843.js} +0 -0
  506. /package/build/esm/{animation-e29f4451.js → animation-671e9bbc.js} +0 -0
  507. /package/build/esm/{constants-aa9c44cf.js → constants-21a69015.js} +0 -0
  508. /package/build/esm/{constants-93973f8e.js → constants-d5568084.js} +0 -0
  509. /package/build/esm/{constants-54c24e53.js → constants-d8d08898.js} +0 -0
  510. /package/build/esm/{context-fb17b0a6.js → context-67ee0400.js} +0 -0
  511. /package/build/esm/{dataTransform-7ee2f88f.js → dataTransform-88dbcdc3.js} +0 -0
  512. /package/build/esm/{index-5730d5a3.js → index-3e720c29.js} +0 -0
  513. /package/build/esm/{index-3cea6216.js → index-53f7d1de.js} +0 -0
  514. /package/build/esm/{index-84bbf54d.js → index-7868f723.js} +0 -0
  515. /package/build/esm/{index-a21be2a6.js → index-7cfa47da.js} +0 -0
  516. /package/build/esm/{index-fd169521.js → index-d23b50a5.js} +0 -0
  517. /package/build/esm/{index-81c8be96.js → index-d281d58d.js} +0 -0
  518. /package/build/esm/{index-5cfb086e.js → index-e8ea7ecf.js} +0 -0
  519. /package/build/esm/{index-2c1f2d96.js → index-e9c36fc6.js} +0 -0
  520. /package/build/esm/{index-f9888234.js → index-eea5bd87.js} +0 -0
  521. /package/build/esm/{index.styles-4c520e34.js → index.styles-33599bb2.js} +0 -0
  522. /package/build/esm/{localizeNumberFormat-fca0ac30.js → localizeNumberFormat-65bb9e5b.js} +0 -0
  523. /package/build/esm/{normalizeLink-451358d0.js → normalizeLink-56bd7631.js} +0 -0
  524. /package/build/esm/{number-23b4c526.js → number-73f95484.js} +0 -0
  525. /package/build/esm/{paths-2258c3fa.js → paths-53623c78.js} +0 -0
  526. /package/build/esm/{shared-3fa9ed6b.js → shared-fa3b4de0.js} +0 -0
  527. /package/build/esm/{translationsContext-73a8b4c5.js → translationsContext-722bb06b.js} +0 -0
  528. /package/build/esm/{tslib.es6-9f0003b1.js → tslib.es6-5468ce84.js} +0 -0
  529. /package/build/esm/{types-27c9bb18.js → types-b4100f79.js} +0 -0
  530. /package/build/esm/{types-188fb1b2.js → types-ce76b019.js} +0 -0
  531. /package/build/esm/{useIsInit-ea1c03b5.js → useIsInit-82c116f9.js} +0 -0
  532. /package/build/esm/{useOutsideClick-4884186e.js → useOutsideClick-edc7b6aa.js} +0 -0
  533. /package/build/esm/{useScrollbarSize-a3ef4851.js → useScrollbarSize-30002fe6.js} +0 -0
  534. /package/build/esm/{useUniqueId-e99fd50a.js → useUniqueId-499108b8.js} +0 -0
  535. /package/build/esm/{utils-9d5cd2d7.js → utils-46350ee7.js} +0 -0
  536. /package/build/esm/{utils-13979d17.js → utils-e2fce4a3.js} +0 -0
  537. /package/build/{index-8d69fb44.js → index-014cb7de.js} +0 -0
  538. /package/build/{index-877791f0.js → index-0e3f3775.js} +0 -0
  539. /package/build/{index-b8b9589e.js → index-124bbf78.js} +0 -0
  540. /package/build/{index-835939d1.js → index-18a655df.js} +0 -0
  541. /package/build/{index-9dc6710d.js → index-27cd0701.js} +0 -0
  542. /package/build/{index-ca0d53e8.js → index-38a57b00.js} +0 -0
  543. /package/build/{index-898c4c16.js → index-3c49d0ea.js} +0 -0
  544. /package/build/{index-cd18b56e.js → index-bd043671.js} +0 -0
  545. /package/build/{index-f5b060bc.js → index-fb10314e.js} +0 -0
  546. /package/build/{index.styles-eeed0d30.js → index.styles-00bcf270.js} +0 -0
  547. /package/build/{localizeNumberFormat-ae9a8a3f.js → localizeNumberFormat-d013c3f5.js} +0 -0
  548. /package/build/{normalizeLink-c6a93575.js → normalizeLink-55ad3060.js} +0 -0
  549. /package/build/{number-9e40d5e0.js → number-d092c18b.js} +0 -0
  550. /package/build/{paths-2574a242.js → paths-a3c75613.js} +0 -0
  551. /package/build/{shared-030fa40a.js → shared-121fdc4f.js} +0 -0
  552. /package/build/{translationsContext-7bb7652b.js → translationsContext-2aabf91a.js} +0 -0
  553. /package/build/{tslib.es6-0308af32.js → tslib.es6-53aa24cc.js} +0 -0
  554. /package/build/{types-c548eabb.js → types-0a1e6d6f.js} +0 -0
  555. /package/build/{types-0bcf084c.js → types-1ee3c83f.js} +0 -0
  556. /package/build/{useIsInit-37cd9898.js → useIsInit-884f8482.js} +0 -0
  557. /package/build/{useOutsideClick-5c0f96ef.js → useOutsideClick-ba975b17.js} +0 -0
  558. /package/build/{useScrollbarSize-99557716.js → useScrollbarSize-226886f5.js} +0 -0
  559. /package/build/{useUniqueId-3d22060c.js → useUniqueId-6009302a.js} +0 -0
  560. /package/build/{utils-e04b7c12.js → utils-9ec33919.js} +0 -0
  561. /package/build/{utils-0a289366.js → utils-ab620ae4.js} +0 -0
package/build/subot.js CHANGED
@@ -3,77 +3,92 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var index$2 = require('./index-6b28eb0e.js');
7
- var tslib_es6 = require('./tslib.es6-0308af32.js');
8
- var index$3 = require('./index-3681d558.js');
6
+ var index$2 = require('./index-905c4fcb.js');
7
+ var tslib_es6 = require('./tslib.es6-53aa24cc.js');
8
+ var index$3 = require('./index-d0256457.js');
9
9
  var Cookies = require('js-cookie');
10
10
  var fd = require('fastdom');
11
11
  var fastdomPromised = require('fastdom/extensions/fastdom-promised');
12
- var togetherComponentGlobalContext = require('./utils-64b537e9.js');
12
+ var togetherComponentGlobalContext = require('./utils-2985e713.js');
13
13
  var formatString = require('string-format');
14
- var index$1 = require('./index-1049e07e.js');
14
+ var index$1 = require('./index-7cdf960a.js');
15
15
  var dayjs = require('dayjs');
16
16
  var constantsDomainLocales = require('./constantsDomainLocales.js');
17
17
  var classNames = require('classnames');
18
- var index$b = require('./index-898c4c16.js');
19
- var index$a = require('./index-e55a659f.js');
18
+ var index$b = require('./index-3c49d0ea.js');
19
+ var index$a = require('./index-51f4e3b5.js');
20
20
  var framerMotion = require('framer-motion');
21
21
  var styled = require('@emotion/styled');
22
- var utils = require('./utils-0a289366.js');
23
- var index$4 = require('./index-af395e5b.js');
22
+ var utils = require('./utils-ab620ae4.js');
23
+ var index$4 = require('./index-4f3435fc.js');
24
24
  var remarkable = require('remarkable');
25
25
  var other = require('@hhgtech/icons/other');
26
26
  var reactIntersectionObserver = require('react-intersection-observer');
27
27
  var core = require('@mantine/core');
28
- var index$5 = require('./index-f5b060bc.js');
28
+ var index$5 = require('./index-fb10314e.js');
29
29
  var isSameOrBefore = require('dayjs/plugin/isSameOrBefore');
30
- var constants = require('./constants-fb557268.js');
30
+ var constants = require('./constants-092d4d1a.js');
31
31
  var uuid = require('uuid');
32
- var index$6 = require('./index-52ce0dfd.js');
32
+ var index$6 = require('./index-2e9bd898.js');
33
33
  var miscTheme = require('./miscTheme.js');
34
34
  var constantsIsProduction = require('./constantsIsProduction.js');
35
- var index$7 = require('./index-13dcdd20.js');
35
+ var index$7 = require('./index-f6abc75d.js');
36
36
  require('@mantine/dates');
37
- require('./index-6d82ab0a.js');
38
- require('./index-877791f0.js');
39
- require('./index.styles-eeed0d30.js');
40
- require('./translationsContext-7bb7652b.js');
37
+ require('./index-04d41ab4.js');
38
+ require('./index-0e3f3775.js');
39
+ require('./index.styles-00bcf270.js');
40
+ require('./translationsContext-2aabf91a.js');
41
41
  require('@mantine/hooks');
42
- require('./index-13851065.js');
42
+ require('./index-11a12f89.js');
43
43
  var isEmpty = require('lodash/isEmpty');
44
44
  var reactHookForm = require('react-hook-form');
45
45
  var PhoneInputBase = require('react-phone-number-input');
46
46
  var api = require('@react-google-maps/api');
47
- var usePlacesAutocomplete = require('./usePlacesAutocomplete-01a7b0c2.js');
47
+ var usePlacesAutocomplete = require('./usePlacesAutocomplete-48c44c61.js');
48
48
  var miscDefaultClassWrapper = require('./miscDefaultClassWrapper.js');
49
- var Locale = require('./Locale-bfce9a0f.js');
50
- var InputDate = require('./InputDate-e70acc77.js');
51
- var index$8 = require('./index-12032c21.js');
52
- var index$9 = require('./index-8d69fb44.js');
53
- var store = require('./store-0c2eef06.js');
54
- var utils$1 = require('./utils-6cfe5b6c.js');
49
+ var Locale = require('./Locale-adb54541.js');
50
+ var InputDate = require('./InputDate-5b0b7869.js');
51
+ var index$8 = require('./index-342eca14.js');
52
+ var index$9 = require('./index-014cb7de.js');
53
+ var store = require('./store-d25421b6.js');
54
+ var utils$1 = require('./utils-c0555488.js');
55
+ var index$c = require('./index-877ae476.js');
56
+ var CheckboxIcon = require('public/images/checkbox.svg');
57
+ var CheckIcon = require('public/svg/check.svg');
58
+ var DislikeIcon = require('public/svg/dislike-article.svg');
59
+ var LikeIcon = require('public/svg/like-article.svg');
60
+ var StarRatings = require('react-star-ratings');
61
+ var LeftArrowIcon = require('public/svg/arrow-left.svg');
62
+ var RightArrowIcon = require('public/svg/arrow-right.svg');
63
+ var moleculesArticleCard = require('./moleculesArticleCard.js');
64
+ var ChevronRight$2 = require('public/images/chevronRightActive.svg');
65
+ var RotateLeftSvg = require('public/svg/rotate-left.svg');
66
+ var ArrowDown = require('public/svg/arrow-down.svg');
67
+ var ArrowUp = require('public/svg/arrow-up.svg');
68
+ var index$d = require('./index-678a33dc.js');
69
+ var index$e = require('./index-c41708b0.js');
55
70
  require('date-fns/locale');
56
71
  require('./constantsSite.js');
57
72
  require('./constantsRiskScreener.js');
58
- require('./index-9dc6710d.js');
73
+ require('./index-27cd0701.js');
59
74
  require('./miscCookieHelper.js');
60
75
  require('slugify');
61
76
  require('./togetherApiPaths.js');
62
- require('./index-bc451055.js');
63
- require('./WhatsApp-6f4fc737.js');
64
- require('./Spinner-d0cc8fa5.js');
65
- require('./index-cbc730a2.js');
66
- require('./shared-030fa40a.js');
67
- require('./index-889c3a6c.js');
77
+ require('./index-e1e09f51.js');
78
+ require('./WhatsApp-cf792749.js');
79
+ require('./Spinner-39b4a549.js');
80
+ require('./index-8297a2e4.js');
81
+ require('./shared-121fdc4f.js');
82
+ require('./index-e410ee95.js');
68
83
  require('@mantine/carousel');
69
- require('./useUniqueId-3d22060c.js');
84
+ require('./useUniqueId-6009302a.js');
70
85
  require('@emotion/react');
71
86
  require('@hhgtech/icons/core');
72
87
  require('@mantine/notifications');
73
88
  require('zustand');
74
- require('./index-0b5946c5.js');
75
- require('./normalizeLink-c6a93575.js');
76
- require('./healthTools-35af34c9.js');
89
+ require('./index-cee337ec.js');
90
+ require('./normalizeLink-55ad3060.js');
91
+ require('./healthTools-3c04e345.js');
77
92
 
78
93
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
79
94
 
@@ -88,6 +103,17 @@ var styled__default = /*#__PURE__*/_interopDefault(styled);
88
103
  var isSameOrBefore__default = /*#__PURE__*/_interopDefault(isSameOrBefore);
89
104
  var isEmpty__default = /*#__PURE__*/_interopDefault(isEmpty);
90
105
  var PhoneInputBase__default = /*#__PURE__*/_interopDefault(PhoneInputBase);
106
+ var CheckboxIcon__default = /*#__PURE__*/_interopDefault(CheckboxIcon);
107
+ var CheckIcon__default = /*#__PURE__*/_interopDefault(CheckIcon);
108
+ var DislikeIcon__default = /*#__PURE__*/_interopDefault(DislikeIcon);
109
+ var LikeIcon__default = /*#__PURE__*/_interopDefault(LikeIcon);
110
+ var StarRatings__default = /*#__PURE__*/_interopDefault(StarRatings);
111
+ var LeftArrowIcon__default = /*#__PURE__*/_interopDefault(LeftArrowIcon);
112
+ var RightArrowIcon__default = /*#__PURE__*/_interopDefault(RightArrowIcon);
113
+ var ChevronRight__default = /*#__PURE__*/_interopDefault(ChevronRight$2);
114
+ var RotateLeftSvg__default = /*#__PURE__*/_interopDefault(RotateLeftSvg);
115
+ var ArrowDown__default = /*#__PURE__*/_interopDefault(ArrowDown);
116
+ var ArrowUp__default = /*#__PURE__*/_interopDefault(ArrowUp);
91
117
 
92
118
  // extend fastdom
93
119
  const fastdom = fd__default["default"].extend(fastdomPromised__default["default"]);
@@ -169,7 +195,7 @@ const getSubotApiPath = (path, params) => {
169
195
  return apiUrl + formatString__default["default"](path, Object.assign({}, params));
170
196
  };
171
197
  /** inline message */
172
- const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
198
+ const subotInlineMessage$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
173
199
  try {
174
200
  return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_MESSAGE), 'POST', {
175
201
  data,
@@ -177,7 +203,7 @@ const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0,
177
203
  }
178
204
  catch (error) { }
179
205
  });
180
- const computeExtraSettingsForBot = (data) => {
206
+ const computeExtraSettingsForBot$1 = (data) => {
181
207
  var _a;
182
208
  if ((data === null || data === void 0 ? void 0 : data._status) === 1 && ((_a = data === null || data === void 0 ? void 0 : data._data) === null || _a === void 0 ? void 0 : _a.extra_settings)) {
183
209
  try {
@@ -200,11 +226,11 @@ const computeExtraSettingsForBot = (data) => {
200
226
  return data;
201
227
  };
202
228
  /** inline first node */
203
- const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
229
+ const subotInlineFirstNode$1 = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
204
230
  try {
205
231
  const data = yield CachedSystem.withCached('SubotInlineFirstNode/' + id, () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
206
232
  const response = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_FIRST_NODE) + `/${id}`, 'GET');
207
- computeExtraSettingsForBot(response);
233
+ computeExtraSettingsForBot$1(response);
208
234
  return response;
209
235
  }));
210
236
  return data;
@@ -214,7 +240,7 @@ const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0,
214
240
  }
215
241
  });
216
242
  /** inline click */
217
- const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
243
+ const subotInlineClick$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
218
244
  try {
219
245
  return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_CLICK), 'POST', {
220
246
  data,
@@ -223,7 +249,7 @@ const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, f
223
249
  catch (error) { }
224
250
  });
225
251
  /** inline impression */
226
- const subotInlineImpression = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
252
+ const subotInlineImpression$1 = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
227
253
  try {
228
254
  return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_IMPRESSION), 'POST', {
229
255
  data,
@@ -822,7 +848,7 @@ const detectToSkipNodeStart = (botItem, currentActiveId, currentListNodes) => {
822
848
  return [currentActiveId, currentListNodes];
823
849
  };
824
850
 
825
- const SubotInlineContext = React.createContext({
851
+ const SubotInlineContext$1 = React.createContext({
826
852
  activeId: '',
827
853
  params: {},
828
854
  listNodes: [],
@@ -935,7 +961,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
935
961
  let newActiveId = '';
936
962
  let nodes = [];
937
963
  setLoading(true);
938
- const resFirst = yield subotInlineFirstNode(params.bot_id);
964
+ const resFirst = yield subotInlineFirstNode$1(params.bot_id);
939
965
  if ((resFirst === null || resFirst === void 0 ? void 0 : resFirst._status) === 1) {
940
966
  newActiveId = resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.id.toString();
941
967
  nodes.push(resFirst === null || resFirst === void 0 ? void 0 : resFirst._data, resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.first_node);
@@ -953,7 +979,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
953
979
  if (previousState &&
954
980
  previousState.params.action_id &&
955
981
  previousState.params.action_value) {
956
- const resResultInline = yield subotInlineMessage(previousState.params);
982
+ const resResultInline = yield subotInlineMessage$1(previousState.params);
957
983
  if ((resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._status) === 1 && (resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node)) {
958
984
  newActiveId = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node.id;
959
985
  nodes = previousState.listNodes;
@@ -1022,7 +1048,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
1022
1048
  const onNext = React.useCallback((messageParams) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
1023
1049
  if (messageParams === null || messageParams === void 0 ? void 0 : messageParams.node_id) {
1024
1050
  const newMessage = Object.assign(Object.assign({}, messageParams), getCurrentTotalDynamicScore(listNodes, activeId, messageParams.action_id));
1025
- const res = yield subotInlineMessage(newMessage);
1051
+ const res = yield subotInlineMessage$1(newMessage);
1026
1052
  setLoading(false);
1027
1053
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
1028
1054
  const _b = res === null || res === void 0 ? void 0 : res._data, { node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
@@ -1170,7 +1196,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
1170
1196
  if (!listNodes.length) {
1171
1197
  return null;
1172
1198
  }
1173
- return (React__default["default"].createElement(SubotInlineContext.Provider, { value: value },
1199
+ return (React__default["default"].createElement(SubotInlineContext$1.Provider, { value: value },
1174
1200
  React__default["default"].createElement("div", { ref: ref }, children)));
1175
1201
  };
1176
1202
 
@@ -1674,7 +1700,7 @@ const Container$u = () => {
1674
1700
  var _a, _b, _c;
1675
1701
  const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
1676
1702
  const currentUrl = useCurrentUrl();
1677
- const { listNodes, activeId, isShowFooter, onNext, onPrev, params, onStartOver, loading, } = React.useContext(SubotInlineContext);
1703
+ const { listNodes, activeId, isShowFooter, onNext, onPrev, params, onStartOver, loading, } = React.useContext(SubotInlineContext$1);
1678
1704
  const { value } = React.useContext(NodeContext);
1679
1705
  const validation = useValidationMultiOption();
1680
1706
  const botItem = listNodes[0];
@@ -2066,7 +2092,7 @@ const Container$s = ({ node, onClickStart }) => {
2066
2092
  const refImpression = React.useRef(false);
2067
2093
  const { ref, inView } = reactIntersectionObserver.useInView();
2068
2094
  const currentUrl = useCurrentUrl();
2069
- const { params, getParams, onNext, setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
2095
+ const { params, getParams, onNext, setIsShowFooter, listNodes } = React.useContext(SubotInlineContext$1);
2070
2096
  const botItem = listNodes[0];
2071
2097
  const botType = (_a = botItem === null || botItem === void 0 ? void 0 : botItem.extra_settings) === null || _a === void 0 ? void 0 : _a.subot_type;
2072
2098
  React.useMemo(() => {
@@ -2076,14 +2102,14 @@ const Container$s = ({ node, onClickStart }) => {
2076
2102
  if (!inView || refImpression.current) {
2077
2103
  return;
2078
2104
  }
2079
- subotInlineImpression(getParams());
2105
+ subotInlineImpression$1(getParams());
2080
2106
  refImpression.current = true;
2081
2107
  }, [inView]);
2082
2108
  const handleClickStart = () => {
2083
2109
  // 1. Tracking Event Click
2084
2110
  const params = getParams();
2085
2111
  params.device_id = index$1.checkMobile(window.navigator.userAgent) ? 2 : 1;
2086
- subotInlineClick(params);
2112
+ subotInlineClick$1(params);
2087
2113
  // 2. Call API to fetch next node
2088
2114
  onNext();
2089
2115
  onClickStart === null || onClickStart === void 0 ? void 0 : onClickStart();
@@ -2362,7 +2388,7 @@ const handleFrisoRedirecition = (listNode) => {
2362
2388
 
2363
2389
  const Container$r = ({ intent }) => {
2364
2390
  var _a;
2365
- const { listNodes } = React.useContext(SubotInlineContext);
2391
+ const { listNodes } = React.useContext(SubotInlineContext$1);
2366
2392
  const handleOnClick = () => {
2367
2393
  var _a;
2368
2394
  if ((_a = intent.url) === null || _a === void 0 ? void 0 : _a.includes('{{.frisoRedirectUrl}}')) {
@@ -2418,7 +2444,7 @@ const Container$q = ({ intent }) => {
2418
2444
  Container$q.displayName = 'SubotInlineIntentBotImage';
2419
2445
 
2420
2446
  const Container$p = ({ intent, indexNumber }) => {
2421
- const { listNodes } = React.useContext(SubotInlineContext);
2447
+ const { listNodes } = React.useContext(SubotInlineContext$1);
2422
2448
  const isShowLabel = ![index$2.NodeIntentType.SSO_INTENT].includes(intent === null || intent === void 0 ? void 0 : intent.type);
2423
2449
  const isText = [
2424
2450
  index$2.NodeIntentType.BOT_TEXT,
@@ -2452,7 +2478,7 @@ Container$p.displayName = 'SubotInlineIntentBotTitle';
2452
2478
 
2453
2479
  const Container$o = ({ intent }) => {
2454
2480
  const currentUrl = useCurrentUrl();
2455
- const { listNodes, activeId, params } = React.useContext(SubotInlineContext);
2481
+ const { listNodes, activeId, params } = React.useContext(SubotInlineContext$1);
2456
2482
  const foundNode = listNodes.find((n) => n.id == activeId);
2457
2483
  if (!intent.label || !foundNode) {
2458
2484
  return null;
@@ -2793,7 +2819,7 @@ const StyledWrap$e = styled__default["default"].div `
2793
2819
  `;
2794
2820
 
2795
2821
  const Container$k = ({ intent }) => {
2796
- const { listNodes } = React.useContext(SubotInlineContext);
2822
+ const { listNodes } = React.useContext(SubotInlineContext$1);
2797
2823
  if (!(intent === null || intent === void 0 ? void 0 : intent.label)) {
2798
2824
  return null;
2799
2825
  }
@@ -2854,15 +2880,15 @@ const Container$j = ({ intent }) => {
2854
2880
  };
2855
2881
  Container$j.displayName = 'SubotInlineIntentSSO';
2856
2882
 
2857
- var _a$1;
2858
- const SubotInlineIntentCol = styled__default["default"].div `
2883
+ var _a$2;
2884
+ const SubotInlineIntentCol$1 = styled__default["default"].div `
2859
2885
  width: ${({ width }) => width || '100%'};
2860
2886
  padding: 4px;
2861
2887
  ${utils.MediaQueries.mbDown} {
2862
2888
  width: 100%;
2863
2889
  }
2864
2890
  `;
2865
- const SubotInlineIntentUrlContainer = styled__default["default"].div `
2891
+ const SubotInlineIntentUrlContainer$1 = styled__default["default"].div `
2866
2892
  display: flex;
2867
2893
  .feature {
2868
2894
  width: 30%;
@@ -2890,7 +2916,7 @@ const SubotInlineIntentUrlContainer = styled__default["default"].div `
2890
2916
  margin-left: 10px;
2891
2917
  line-height: 1.5;
2892
2918
  a {
2893
- color: ${((_a$1 = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _a$1 === void 0 ? void 0 : _a$1.gray800) || '#262626'};
2919
+ color: ${((_a$2 = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _a$2 === void 0 ? void 0 : _a$2.gray800) || '#262626'};
2894
2920
  text-decoration: none;
2895
2921
  }
2896
2922
  }
@@ -2900,8 +2926,8 @@ const Container$i = ({ intent, }) => {
2900
2926
  const article = React.useMemo(() => intent.label.includes('{')
2901
2927
  ? JSON.parse(intent.label)
2902
2928
  : {}, [intent.label]);
2903
- return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol, null,
2904
- React__default["default"].createElement(SubotInlineIntentUrlContainer, null,
2929
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol$1, null,
2930
+ React__default["default"].createElement(SubotInlineIntentUrlContainer$1, null,
2905
2931
  React__default["default"].createElement("div", { className: "feature" },
2906
2932
  React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature-wrapper" },
2907
2933
  React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title, className: "feature-img" }))),
@@ -2938,7 +2964,7 @@ const SubotInlineIntentBaseTarget = {
2938
2964
  /** intents fake for sso block */
2939
2965
  [index$2.NodeIntentType.SSO_INTENT]: Container$j,
2940
2966
  };
2941
- const SubotInlineIntentBase = new Proxy(SubotInlineIntentBaseTarget, {
2967
+ const SubotInlineIntentBase$1 = new Proxy(SubotInlineIntentBaseTarget, {
2942
2968
  get(_, prop) {
2943
2969
  const UnknowComponent = () => {
2944
2970
  if (constantsIsProduction.isProduction)
@@ -2965,7 +2991,7 @@ const Container$h = ({ intents: intentsProp, indexNumber, }) => {
2965
2991
  const intentType = (intent === null || intent === void 0 ? void 0 : intent.type) || '';
2966
2992
  if (excludeIntents.includes(intentType))
2967
2993
  return null;
2968
- const NodeIntent = SubotInlineIntentBase[intentType];
2994
+ const NodeIntent = SubotInlineIntentBase$1[intentType];
2969
2995
  return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
2970
2996
  })))));
2971
2997
  };
@@ -2973,7 +2999,7 @@ Container$h.displayName = 'SubotInlineIntent';
2973
2999
 
2974
3000
  const Container$g = ({ node }) => {
2975
3001
  var _a, _b;
2976
- const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
3002
+ const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext$1);
2977
3003
  const botItem = listNodes[0];
2978
3004
  React.useMemo(() => {
2979
3005
  setIsShowFooter(true);
@@ -3164,7 +3190,7 @@ const SubInlineIntent = ({ subIntents }) => {
3164
3190
  React__default["default"].createElement(ChevronDown, { className: "si-chevron-down" })),
3165
3191
  React__default["default"].createElement(framerMotion.motion.div, { className: "si-sub-intent-expand", animate: isShow ? { height: 'auto' } : { height: 0 }, transition: { duration: 0.3 }, "data-show": isShow }, restSubIntents.map((intent) => {
3166
3192
  const intentType = (intent === null || intent === void 0 ? void 0 : intent.type) || '';
3167
- const NodeIntent = SubotInlineIntentBase[intentType];
3193
+ const NodeIntent = SubotInlineIntentBase$1[intentType];
3168
3194
  return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
3169
3195
  }))));
3170
3196
  };
@@ -3175,7 +3201,7 @@ const Container$f = ({ node }) => {
3175
3201
  // const isMobile = useGetIsMobile(true)
3176
3202
  const refMainIntents = React.useRef(null);
3177
3203
  const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
3178
- const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext);
3204
+ const { setIsShowFooter, listNodes } = React.useContext(SubotInlineContext$1);
3179
3205
  const [isShowMore, setIsShowMore] = React.useState(false);
3180
3206
  React.useEffect(() => {
3181
3207
  var _a;
@@ -3280,11 +3306,11 @@ const Container$f = ({ node }) => {
3280
3306
  defaultMessage: 'See more',
3281
3307
  }))),
3282
3308
  React__default["default"].createElement("div", { className: "wrap-main-button-intent" }, (_a = [...mainButtonIntents, ...bookingButtonIntents]) === null || _a === void 0 ? void 0 : _a.map((intent) => {
3283
- const NodeIntent = SubotInlineIntentBase[intent.type || ''];
3309
+ const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
3284
3310
  return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
3285
3311
  })),
3286
3312
  (suggestedServiceIntents === null || suggestedServiceIntents === void 0 ? void 0 : suggestedServiceIntents.length) > 0 && (React__default["default"].createElement("div", null, suggestedServiceIntents.map((intent) => {
3287
- const NodeIntent = SubotInlineIntentBase[intent.type || ''];
3313
+ const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
3288
3314
  return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
3289
3315
  }))),
3290
3316
  (relatedArticleIntents === null || relatedArticleIntents === void 0 ? void 0 : relatedArticleIntents.length) > 0 && (React__default["default"].createElement("div", { style: { marginTop: 24 } },
@@ -3293,7 +3319,7 @@ const Container$f = ({ node }) => {
3293
3319
  defaultMessage: 'Related Articles',
3294
3320
  })),
3295
3321
  React__default["default"].createElement("div", { style: { padding: '8px 0' } }, relatedArticleIntents.map((intent) => {
3296
- const NodeIntent = SubotInlineIntentBase[intent.type || ''];
3322
+ const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
3297
3323
  return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
3298
3324
  })))),
3299
3325
  React__default["default"].createElement(SubInlineIntent, { subIntents: subIntents })));
@@ -3307,7 +3333,7 @@ const StyledWrap$b = styled__default["default"].div `
3307
3333
  `;
3308
3334
 
3309
3335
  const Container$e = ({ node }) => {
3310
- const { params, onNext, setIsShowFooter } = React.useContext(SubotInlineContext);
3336
+ const { params, onNext, setIsShowFooter } = React.useContext(SubotInlineContext$1);
3311
3337
  React.useMemo(() => {
3312
3338
  setIsShowFooter(true);
3313
3339
  }, []);
@@ -3719,7 +3745,7 @@ const CountDown = ({ onFinish, onClick, isFinished, resendLabel, className }, re
3719
3745
  };
3720
3746
  var CountDown$1 = React.forwardRef(CountDown);
3721
3747
 
3722
- styled__default["default"].div `
3748
+ const StyledUserInfoFormContainer$1 = styled__default["default"].div `
3723
3749
  margin: 0 auto;
3724
3750
  background: #f7f9fc;
3725
3751
  border-radius: ${miscTheme.theme.borderRadius};
@@ -4651,7 +4677,7 @@ const OTP_VERIFIED_MSG_CODE = {
4651
4677
  },
4652
4678
  };
4653
4679
 
4654
- var _a, _b, _c, _d, _e;
4680
+ var _a$1, _b$1, _c$1, _d$1, _e$1;
4655
4681
  const StyledPhoneCode = styled__default["default"].div `
4656
4682
  display: flex;
4657
4683
  align-items: center;
@@ -4663,21 +4689,21 @@ const StyledPhoneCode = styled__default["default"].div `
4663
4689
  border-radius: 2px;
4664
4690
  }
4665
4691
  > div {
4666
- color: ${((_a = miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.gray800) || ''};
4692
+ color: ${((_a$1 = miscTheme.theme.colors) === null || _a$1 === void 0 ? void 0 : _a$1.gray800) || ''};
4667
4693
  white-space: nowrap;
4668
4694
  }
4669
4695
  `;
4670
4696
  styled__default["default"](PhoneInputBase__default["default"]) `
4671
4697
  display: flex;
4672
- border: 1px solid ${((_b = miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.gray200) || ''};
4698
+ border: 1px solid ${((_b$1 = miscTheme.theme.colors) === null || _b$1 === void 0 ? void 0 : _b$1.gray200) || ''};
4673
4699
  border-radius: ${miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.borderRadius};
4674
4700
  .PhoneInputCountry {
4675
4701
  position: relative;
4676
4702
  padding: 12px 8px 12px 16px;
4677
- border-right: 1px solid ${((_c = miscTheme.theme.colors) === null || _c === void 0 ? void 0 : _c.gray200) || ''};
4678
- background-color: ${((_d = miscTheme.theme.colors) === null || _d === void 0 ? void 0 : _d.gray100) || ''};
4703
+ border-right: 1px solid ${((_c$1 = miscTheme.theme.colors) === null || _c$1 === void 0 ? void 0 : _c$1.gray200) || ''};
4704
+ background-color: ${((_d$1 = miscTheme.theme.colors) === null || _d$1 === void 0 ? void 0 : _d$1.gray100) || ''};
4679
4705
  border-radius: 6px 0 0 6px;
4680
- color: ${((_e = miscTheme.theme.colors) === null || _e === void 0 ? void 0 : _e.gray800) || ''};
4706
+ color: ${((_e$1 = miscTheme.theme.colors) === null || _e$1 === void 0 ? void 0 : _e$1.gray800) || ''};
4681
4707
  .PhoneInputCountrySelect {
4682
4708
  position: absolute;
4683
4709
  top: 0;
@@ -5514,14 +5540,14 @@ const StyledWrap$a = styled__default["default"].div `
5514
5540
  const Container$d = ({ node, indexNumber }) => {
5515
5541
  var _a;
5516
5542
  const locale = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.locale;
5517
- const { params, listNodes, activeId, onSubmit, setIsShowFooter } = React.useContext(SubotInlineContext);
5543
+ const { params, listNodes, activeId, onSubmit, setIsShowFooter } = React.useContext(SubotInlineContext$1);
5518
5544
  React.useMemo(() => {
5519
5545
  setIsShowFooter(true);
5520
5546
  }, []);
5521
5547
  const handleSubmit = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
5522
5548
  checkSyncDataOnFrisoCampaign(listNodes[0], data.form_submit_meta);
5523
5549
  const _message = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node._message), data), getCurrentTotalDynamicScore(listNodes, activeId, data.action_id, data.form_submit_meta)), { node_id: node.id });
5524
- const res = yield subotInlineMessage(_message);
5550
+ const res = yield subotInlineMessage$1(_message);
5525
5551
  // asking
5526
5552
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
5527
5553
  const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
@@ -5686,7 +5712,7 @@ const StyledWrap$7 = styled__default["default"].div `
5686
5712
  `;
5687
5713
  const Container$c = ({ action, active, onChange, htmlType, }) => {
5688
5714
  const currentUrl = useCurrentUrl();
5689
- const { params } = React.useContext(SubotInlineContext);
5715
+ const { params } = React.useContext(SubotInlineContext$1);
5690
5716
  return (React__default["default"].createElement(StyledWrap$7, { className: "si-action-img-choice", onClick: () => onChange && onChange(action), active: !!active, "data-event-category": "Service Connection", "data-event-action": "Risk Screening Answer Click", "data-event-label": currentUrl, "data-bot-id": params.bot_id },
5691
5717
  React__default["default"].createElement("div", { className: "si-action-image-wrap" },
5692
5718
  React__default["default"].createElement("img", { loading: "lazy", src: action === null || action === void 0 ? void 0 : action.url, alt: action === null || action === void 0 ? void 0 : action.label })),
@@ -5702,7 +5728,7 @@ const StyledWrap$6 = styled__default["default"].div `
5702
5728
  `;
5703
5729
  const Container$b = ({ action, onChange }) => {
5704
5730
  const currentUrl = useCurrentUrl();
5705
- const { params, activeId } = React.useContext(SubotInlineContext);
5731
+ const { params, activeId } = React.useContext(SubotInlineContext$1);
5706
5732
  return (React__default["default"].createElement(StyledWrap$6, null,
5707
5733
  React__default["default"].createElement(index$4.Button, { onClick: () => onChange && onChange(action), size: "lg", "data-event-category": "Service Connection", "data-event-action": "Risk Screening Sign Up for Result", "data-event-label": currentUrl, "data-bot-id": params.bot_id, "data-event-question-id": activeId, styles: {
5708
5734
  root: {
@@ -5764,7 +5790,7 @@ const Container$a = ({ action, onChange, active, htmlType, formSubmitMeta, }) =>
5764
5790
  const currentUrl = useCurrentUrl();
5765
5791
  const inputRef = React.useRef(null);
5766
5792
  const [otherText, setOtherText] = React.useState('');
5767
- const { params } = React.useContext(SubotInlineContext);
5793
+ const { params } = React.useContext(SubotInlineContext$1);
5768
5794
  const isActionPollWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
5769
5795
  const isActionSelectWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
5770
5796
  isActionPollWithOther;
@@ -5848,7 +5874,7 @@ const SubotInlineActionBaseTarget = {
5848
5874
  // [NodeActionType.RESULT_BUTTON]: SubotInlineActionTextChoice,
5849
5875
  // [NodeActionType.POLL_RESULT]: SubotInlinePollResult,
5850
5876
  };
5851
- const SubotInlineActionBase = new Proxy(SubotInlineActionBaseTarget, {
5877
+ const SubotInlineActionBase$1 = new Proxy(SubotInlineActionBaseTarget, {
5852
5878
  get(_, prop) {
5853
5879
  const UnknowComponent = () => {
5854
5880
  if (constantsIsProduction.isProduction)
@@ -5879,14 +5905,14 @@ const Container$7 = ({ actions, value, onChange, htmlType, node_type, formSubmit
5879
5905
  const actionType = action.type;
5880
5906
  if (excludeActions.includes(actionType))
5881
5907
  return null;
5882
- const NodeAction = SubotInlineActionBase[action.type];
5908
+ const NodeAction = SubotInlineActionBase$1[action.type];
5883
5909
  return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: onChange, active: value === null || value === void 0 ? void 0 : value.includes(action.id), htmlType: htmlType, formSubmitMeta: formSubmitMeta })));
5884
5910
  })));
5885
5911
  };
5886
5912
  Container$7.displayName = 'SubotInlineAction';
5887
5913
 
5888
5914
  const Container$6 = ({ node, indexNumber }) => {
5889
- const { params, listNodes, activeId, onSubmit, setIsShowFooter, setLoading } = React.useContext(SubotInlineContext);
5915
+ const { params, listNodes, activeId, onSubmit, setIsShowFooter, setLoading } = React.useContext(SubotInlineContext$1);
5890
5916
  const { value, setValue } = React.useContext(NodeContext);
5891
5917
  React.useMemo(() => {
5892
5918
  setIsShowFooter(true);
@@ -5901,7 +5927,7 @@ const Container$6 = ({ node, indexNumber }) => {
5901
5927
  setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
5902
5928
  const newParams = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(listNodes, activeId, action.id));
5903
5929
  setLoading(true);
5904
- const res = yield subotInlineMessage(newParams);
5930
+ const res = yield subotInlineMessage$1(newParams);
5905
5931
  setLoading(false);
5906
5932
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
5907
5933
  const _a = res === null || res === void 0 ? void 0 : res._data, { node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
@@ -5926,7 +5952,7 @@ const StyledWrap$3 = styled__default["default"].div `
5926
5952
 
5927
5953
  const Container$5 = ({ node, indexNumber }) => {
5928
5954
  var _a;
5929
- const { setIsShowFooter, onChange } = React.useContext(SubotInlineContext);
5955
+ const { setIsShowFooter, onChange } = React.useContext(SubotInlineContext$1);
5930
5956
  const { value, setValue } = React.useContext(NodeContext);
5931
5957
  React.useMemo(() => {
5932
5958
  setIsShowFooter(true);
@@ -6038,7 +6064,7 @@ const StyledWrap$2 = styled__default["default"].div `
6038
6064
  `;
6039
6065
 
6040
6066
  const Container$4 = ({ node, indexNumber }) => {
6041
- const { onChange, setIsShowFooter } = React.useContext(SubotInlineContext);
6067
+ const { onChange, setIsShowFooter } = React.useContext(SubotInlineContext$1);
6042
6068
  const { value, setValue } = React.useContext(NodeContext);
6043
6069
  const descriptionNode = useDescriptionPollNode({ node });
6044
6070
  React.useMemo(() => {
@@ -6113,7 +6139,7 @@ const StyledWrap$1 = styled__default["default"].div ``;
6113
6139
  const Container$3 = ({ node }) => {
6114
6140
  const refIsTrigger = React.useRef(false);
6115
6141
  const { formatMessage: f, data: { userInfo }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
6116
- const { params, setIsShowFooter, listNodes, activeId } = React.useContext(SubotInlineContext);
6142
+ const { params, setIsShowFooter, listNodes, activeId } = React.useContext(SubotInlineContext$1);
6117
6143
  React.useMemo(() => {
6118
6144
  setIsShowFooter(true);
6119
6145
  }, []);
@@ -6175,7 +6201,7 @@ const StyledWrap = styled__default["default"].div `
6175
6201
  `;
6176
6202
 
6177
6203
  const Container$2 = ({ node, indexNumber }) => {
6178
- const { params, onSubmit, setIsShowFooter, listNodes, activeId, setLoading, onChange, } = React.useContext(SubotInlineContext);
6204
+ const { params, onSubmit, setIsShowFooter, listNodes, activeId, setLoading, onChange, } = React.useContext(SubotInlineContext$1);
6179
6205
  const { value, setValue } = React.useContext(NodeContext);
6180
6206
  React.useMemo(() => {
6181
6207
  setIsShowFooter(true);
@@ -6191,7 +6217,7 @@ const Container$2 = ({ node, indexNumber }) => {
6191
6217
  const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
6192
6218
  const newParams = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: undefined }), getCurrentTotalDynamicScore(listNodes, activeId, action.id));
6193
6219
  setLoading(true);
6194
- const res = yield subotInlineMessage(newParams);
6220
+ const res = yield subotInlineMessage$1(newParams);
6195
6221
  setLoading(false);
6196
6222
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
6197
6223
  const _a = res === null || res === void 0 ? void 0 : res._data, { node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
@@ -6239,7 +6265,7 @@ const SubotInlineNodeBaseTarget = {
6239
6265
  // RESULT_RATING = 12,
6240
6266
  // RESULT_REACTION = 13,
6241
6267
  };
6242
- const SubotInlineNodeBase = new Proxy(SubotInlineNodeBaseTarget, {
6268
+ const SubotInlineNodeBase$1 = new Proxy(SubotInlineNodeBaseTarget, {
6243
6269
  get(_, prop) {
6244
6270
  const UnknowComponent = () => {
6245
6271
  if (constantsIsProduction.isProduction)
@@ -6254,7 +6280,7 @@ const SubotInlineNodeBase = new Proxy(SubotInlineNodeBaseTarget, {
6254
6280
 
6255
6281
  const Container$1 = ({ onClickStart }) => {
6256
6282
  var _a;
6257
- const { listNodes, activeId, isDisabledAnimationOnMobile } = React.useContext(SubotInlineContext);
6283
+ const { listNodes, activeId, isDisabledAnimationOnMobile } = React.useContext(SubotInlineContext$1);
6258
6284
  const foundIdx = React.useMemo(() => {
6259
6285
  return listNodes.findIndex((n) => n.id == activeId);
6260
6286
  }, [listNodes, activeId]);
@@ -6275,10 +6301,10 @@ const Container$1 = ({ onClickStart }) => {
6275
6301
  const nodeType = index$2.NodeType[node.type].valueOf();
6276
6302
  const nodeTypeSSO = (_a = index$2.NodePosition[node.position]) === null || _a === void 0 ? void 0 : _a.valueOf();
6277
6303
  let NodeComponent = node.position === index$2.NodePosition.SSO
6278
- ? SubotInlineNodeBase[nodeTypeSSO]
6279
- : SubotInlineNodeBase[nodeType];
6304
+ ? SubotInlineNodeBase$1[nodeTypeSSO]
6305
+ : SubotInlineNodeBase$1[nodeType];
6280
6306
  if (node.is_multi_select && node.type !== index$2.NodeType.POLL) {
6281
- NodeComponent = SubotInlineNodeBase['MULTIPLE'];
6307
+ NodeComponent = SubotInlineNodeBase$1['MULTIPLE'];
6282
6308
  }
6283
6309
  return (React__default["default"].createElement(framerMotion.motion.div, { key: node.id, initial: { opacity: 1, y: -300 }, animate: { opacity: 1, y: 0 }, transition: {
6284
6310
  y: { type: 'spring', stiffness: 300, damping: 30 },
@@ -6316,7 +6342,7 @@ const View = ({ loading, backgroundImage, isShowFooter, isFullContainer, isDisab
6316
6342
  backgroundRepeat: 'no-repeat',
6317
6343
  backgroundPosition: 'center',
6318
6344
  }), [backgroundImage]);
6319
- const { isMobile, locale } = React.useContext(SubotInlineContext);
6345
+ const { isMobile, locale } = React.useContext(SubotInlineContext$1);
6320
6346
  const [isDisplayFullMobile, setIsDisplayFullMobile] = React.useState(false);
6321
6347
  React.useEffect(() => {
6322
6348
  if (isDisplayFullMobile) {
@@ -6379,7 +6405,7 @@ const ViewWithMemo = React.memo(View);
6379
6405
  ViewWithMemo.displayName = 'SubotInlineRevampView';
6380
6406
 
6381
6407
  const Container = () => {
6382
- const { loading, listNodes, isShowFooter, activeId, isFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, bgImgFullContainer, typeFormProps, } = React.useContext(SubotInlineContext);
6408
+ const { loading, listNodes, isShowFooter, activeId, isFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, bgImgFullContainer, typeFormProps, } = React.useContext(SubotInlineContext$1);
6383
6409
  const backgroundImage = React.useMemo(() => {
6384
6410
  var _a, _b;
6385
6411
  const foundNode = listNodes.find((n) => n.id == activeId);
@@ -6436,6 +6462,3118 @@ const SubotInlineRevampWithTheme = (props) => {
6436
6462
  return (React__default["default"].createElement(ContainerWithProvider, Object.assign({}, props, { primaryColor: (_b = (_a = botData.extra_settings) === null || _a === void 0 ? void 0 : _a.inline_styles) === null || _b === void 0 ? void 0 : _b.primary_color, textColor: (_d = (_c = botData.extra_settings) === null || _c === void 0 ? void 0 : _c.inline_styles) === null || _d === void 0 ? void 0 : _d.text_color, textButtonColor: (_f = (_e = botData.extra_settings) === null || _e === void 0 ? void 0 : _e.inline_styles) === null || _f === void 0 ? void 0 : _f.text_button_color, bgColor: (_h = (_g = botData.extra_settings) === null || _g === void 0 ? void 0 : _g.inline_styles) === null || _h === void 0 ? void 0 : _h.container_bg_color, bgContentColor: (_k = (_j = botData.extra_settings) === null || _j === void 0 ? void 0 : _j.inline_styles) === null || _k === void 0 ? void 0 : _k.content_bg_color, bgImgFullContainer: (_m = (_l = botData.extra_settings) === null || _l === void 0 ? void 0 : _l.inline_styles) === null || _m === void 0 ? void 0 : _m.container_bg_image })));
6437
6463
  };
6438
6464
 
6465
+ const SubotInlineContext = React.createContext({
6466
+ activeId: '',
6467
+ params: {},
6468
+ nodes: [],
6469
+ getParams: () => ({}),
6470
+ trackingCommonInline: {},
6471
+ });
6472
+ /** inline click */
6473
+ const subotInlineClick = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
6474
+ try {
6475
+ return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_CLICK), 'POST', {
6476
+ data,
6477
+ });
6478
+ }
6479
+ catch (error) { }
6480
+ });
6481
+ /** inline impression */
6482
+ const subotInlineImpression = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
6483
+ try {
6484
+ return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_IMPRESSION), 'POST', {
6485
+ data,
6486
+ });
6487
+ }
6488
+ catch (error) { }
6489
+ });
6490
+ /** inline message */
6491
+ const subotInlineMessage = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
6492
+ try {
6493
+ return yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_MESSAGE), 'POST', {
6494
+ data,
6495
+ });
6496
+ }
6497
+ catch (error) { }
6498
+ });
6499
+ const computeExtraSettingsForBot = (data) => {
6500
+ var _a;
6501
+ if ((data === null || data === void 0 ? void 0 : data._status) === 1 && ((_a = data === null || data === void 0 ? void 0 : data._data) === null || _a === void 0 ? void 0 : _a.extra_settings)) {
6502
+ try {
6503
+ const extraSettingsObj = JSON.parse(data._data.extra_settings);
6504
+ if (typeof extraSettingsObj === 'object') {
6505
+ data._data.extra_settings = extraSettingsObj;
6506
+ }
6507
+ else {
6508
+ data._data.extra_settings = {
6509
+ sync_data_friso_campaign: false,
6510
+ };
6511
+ }
6512
+ }
6513
+ catch (err) {
6514
+ data._data.extra_settings = {
6515
+ sync_data_friso_campaign: false,
6516
+ };
6517
+ }
6518
+ }
6519
+ return data;
6520
+ };
6521
+ /** inline first node */
6522
+ const subotInlineFirstNode = (id) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
6523
+ try {
6524
+ const data = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.GET_INLINE_FIRST_NODE) + `/${id}`, 'GET');
6525
+ computeExtraSettingsForBot(data);
6526
+ return data;
6527
+ }
6528
+ catch (error) { }
6529
+ });
6530
+
6531
+ const SubotInlineFormContainer = styled__default["default"].div `
6532
+ margin-top: 2rem;
6533
+ .form {
6534
+ background-color: ${miscTheme.theme.colors.white || '#fff'};
6535
+ }
6536
+ `;
6537
+ const SubotInlineIntentContainer = styled__default["default"].div ``;
6538
+ const SubotInlineActionContainer = styled__default["default"].div `
6539
+ margin-top: 1.25rem;
6540
+ `;
6541
+ const SubotInlineReviewContainer = styled__default["default"].div `
6542
+ margin-bottom: 1rem;
6543
+ `;
6544
+ const SubotInlineDescription$1 = styled__default["default"].div `
6545
+ font-weight: 400;
6546
+ font-size: 16px;
6547
+ line-height: 24px;
6548
+ color: #595959;
6549
+ font-style: italic;
6550
+ `;
6551
+ const SubotInlineFinalButton = styled__default["default"](index$8.Button) `
6552
+ position: relative;
6553
+ min-width: 180px;
6554
+ svg {
6555
+ path {
6556
+ stroke: currentColor;
6557
+ }
6558
+ }
6559
+ &:hover {
6560
+ svg {
6561
+ path {
6562
+ stroke: currentColor;
6563
+ }
6564
+ }
6565
+ }
6566
+ `;
6567
+ const SubotInlineFinalMoreContainer = styled__default["default"].div `
6568
+ display: flex;
6569
+ align-items: center;
6570
+ justify-content: center;
6571
+ `;
6572
+ const SubotInlineFinalWrapper = styled__default["default"].div `
6573
+ position: relative;
6574
+ overflow: ${({ isMore }) => (isMore ? 'unset' : 'hidden')};
6575
+ max-height: ${({ maxHeight }) => (maxHeight ? maxHeight + 'px' : 'auto')};
6576
+ margin-bottom: 8px;
6577
+ transition: 0.25s all linear;
6578
+ &:before {
6579
+ position: absolute;
6580
+ z-index: 1;
6581
+ top: 50%;
6582
+ right: 0;
6583
+ bottom: 0;
6584
+ left: 0;
6585
+ background-image: linear-gradient(
6586
+ to top,
6587
+ ${miscTheme.theme.colors.neutral50 || '#F7F9FC'} 0%,
6588
+ transparent 100%
6589
+ );
6590
+ content: '';
6591
+ pointer-events: none;
6592
+ ${({ isMore }) => isMore && `opacity: 0;`}
6593
+ }
6594
+ `;
6595
+ const SubotInlineFinalContainer = styled__default["default"].div `
6596
+ position: relative;
6597
+ padding: 32px 32px 16px;
6598
+ background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
6599
+ border-radius: ${miscTheme.theme.borderRadius};
6600
+ ${utils.MediaQueries.tdDown} {
6601
+ padding: 24px 24px 16px;
6602
+ }
6603
+ ${utils.MediaQueries.mbDown} {
6604
+ padding: 16px;
6605
+ border-radius: 0px;
6606
+ }
6607
+ `;
6608
+ const SubotInlineWrapper$1 = styled__default["default"].div `
6609
+ padding: 12px 32px 32px;
6610
+ ${utils.MediaQueries.tdDown} {
6611
+ padding: 12px 24px 24px;
6612
+ }
6613
+ ${utils.MediaQueries.mbDown} {
6614
+ padding: 12px 16px 16px;
6615
+ }
6616
+ `;
6617
+ const SubotInlineContainer$1 = styled__default["default"].div `
6618
+ border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
6619
+ background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
6620
+ border-radius: ${miscTheme.theme.borderRadius};
6621
+ ${utils.MediaQueries.mbDown} {
6622
+ border: none;
6623
+ }
6624
+ `;
6625
+
6626
+ var _a, _b, _c, _d, _e, _f, _g;
6627
+ const SubotInlineButtonReaction = styled__default["default"].div `
6628
+ display: flex;
6629
+ align-items: center;
6630
+ justify-content: center;
6631
+ padding: 12px 24px;
6632
+ border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
6633
+ background-color: ${miscTheme.theme.colors.white || 'white'};
6634
+ border-radius: 32px;
6635
+ cursor: pointer;
6636
+ transition: 0.25s all linear;
6637
+ svg {
6638
+ height: 16px;
6639
+ margin-right: 3px;
6640
+ }
6641
+ &:hover {
6642
+ background-color: ${miscTheme.theme.colors.neutral100};
6643
+ }
6644
+ &.active {
6645
+ background-color: ${miscTheme.theme.colors.primaryActive};
6646
+ color: ${miscTheme.theme.colors.white || '#fff'};
6647
+ svg {
6648
+ stroke: ${miscTheme.theme.colors.white || '#fff'};
6649
+ }
6650
+ }
6651
+ `;
6652
+ const SubotInlineButtonReview = styled__default["default"].div `
6653
+ padding: 12px 24px;
6654
+ border: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
6655
+ background-color: ${miscTheme.theme.colors.white || 'white'};
6656
+ border-radius: 32px;
6657
+ cursor: pointer;
6658
+ transition: 0.25s all linear;
6659
+ &.active {
6660
+ background-color: ${(_a = miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.primaryActive};
6661
+ color: ${miscTheme.theme.colors.white || '#fff'};
6662
+ svg {
6663
+ stroke: ${miscTheme.theme.colors.white || '#fff'};
6664
+ }
6665
+ }
6666
+ `;
6667
+ const SubotInlineActionText = styled__default["default"].div `
6668
+ display: flex;
6669
+ align-items: center;
6670
+ padding: 16px 24px;
6671
+ border: 1px solid
6672
+ ${({ active }) => active
6673
+ ? miscTheme.theme.colors.primaryBase || '#2685F1'
6674
+ : miscTheme.theme.colors.white || '#fff'};
6675
+ background-color: ${miscTheme.theme.colors.white || '#fff'};
6676
+ border-radius: ${miscTheme.theme.borderRadius};
6677
+ cursor: pointer;
6678
+ transition: 0.25s all linear;
6679
+ .label {
6680
+ flex: 1;
6681
+ }
6682
+ .icon {
6683
+ position: relative;
6684
+ z-index: 0;
6685
+ display: flex;
6686
+ width: 24px;
6687
+ height: 24px;
6688
+ align-items: center;
6689
+ justify-content: center;
6690
+ padding: 1px;
6691
+ transition: 0.2s linear all;
6692
+ .icon-checkbox {
6693
+ width: 100%;
6694
+ height: 100%;
6695
+ opacity: 0;
6696
+ ${({ active }) => active && `opacity: 1`};
6697
+ transition: 0.25s all linear;
6698
+ }
6699
+ &:before {
6700
+ position: absolute;
6701
+ top: 50%;
6702
+ left: 50%;
6703
+ width: 22px;
6704
+ height: 22px;
6705
+ border: 2px solid
6706
+ ${({ active }) => active
6707
+ ? miscTheme.theme.colors.primaryBase || '#2685F1'
6708
+ : miscTheme.theme.colors.gray600 || '#595959'};
6709
+ border-radius: 50%;
6710
+ content: '';
6711
+ transform: translate(-50%, -50%);
6712
+ transition: 0.25s all linear;
6713
+ }
6714
+ &:after {
6715
+ position: absolute;
6716
+ z-index: -1;
6717
+ top: 50%;
6718
+ left: 50%;
6719
+ width: 10px;
6720
+ height: 10px;
6721
+ background-color: ${miscTheme.theme.colors.primaryBase || '#2685F1'};
6722
+ border-radius: 50%;
6723
+ content: '';
6724
+ opacity: 0;
6725
+ ${({ active }) => active && `opacity: 1`};
6726
+ transform: translate(-50%, -50%);
6727
+ transition: 0.25s all linear;
6728
+ }
6729
+ }
6730
+ &:hover {
6731
+ border-color: ${((_b = miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.primaryBase) || '#2685F1'};
6732
+ .icon {
6733
+ &:before {
6734
+ border-color: ${((_c = miscTheme.theme.colors) === null || _c === void 0 ? void 0 : _c.primaryBase) || '#2685F1'};
6735
+ transition: 0.2s linear all;
6736
+ }
6737
+ }
6738
+ }
6739
+ ${utils.MediaQueries.tdDown} {
6740
+ padding: 16px 20px;
6741
+ }
6742
+ `;
6743
+ const SubotInlineActionImage = styled__default["default"](SubotInlineActionText) `
6744
+ position: relative;
6745
+ flex-wrap: wrap;
6746
+ padding: 16px;
6747
+ background-color: ${((_d = miscTheme.theme.colors) === null || _d === void 0 ? void 0 : _d.white) || '#fff'};
6748
+ .image-container {
6749
+ position: relative;
6750
+ overflow: hidden;
6751
+ width: 100%;
6752
+ padding-top: 67%;
6753
+ border-radius: 10px;
6754
+ .image {
6755
+ position: absolute;
6756
+ top: 50%;
6757
+ left: 50%;
6758
+ width: 100%;
6759
+ min-width: 100%;
6760
+ height: auto;
6761
+ min-height: 100%;
6762
+ transform: translate(-50%, -50%);
6763
+ }
6764
+ }
6765
+ .label {
6766
+ margin-top: 16px;
6767
+ }
6768
+ .icon {
6769
+ position: absolute;
6770
+ top: 1.75rem;
6771
+ right: 1.75rem;
6772
+ &:before {
6773
+ z-index: -1;
6774
+ background-color: #fff;
6775
+ }
6776
+ }
6777
+ ${utils.MediaQueries.tdDown} {
6778
+ padding: 12px;
6779
+ .label {
6780
+ margin-top: 12px;
6781
+ }
6782
+ .icon {
6783
+ top: 1.3rem;
6784
+ right: 1.3rem;
6785
+ }
6786
+ }
6787
+ ${utils.MediaQueries.tdDown} {
6788
+ padding: 8px;
6789
+ .label {
6790
+ margin-top: 8px;
6791
+ }
6792
+ .icon {
6793
+ top: 0.9rem;
6794
+ right: 0.9rem;
6795
+ }
6796
+ }
6797
+ `;
6798
+ const SubotInlineActionRatingStartContainer = styled__default["default"].div `
6799
+ display: flex;
6800
+ align-items: center;
6801
+ justify-content: flex-start;
6802
+ ${utils.MediaQueries.tdDown} {
6803
+ justify-content: center;
6804
+ }
6805
+ `;
6806
+ const SubotInlineActionRatingDescriptionContainer = styled__default["default"].div `
6807
+ textarea {
6808
+ background-color: ${((_e = miscTheme.theme.colors) === null || _e === void 0 ? void 0 : _e.white) || '#fff'};
6809
+ }
6810
+ `;
6811
+ const SubotInlineActionPollResult = styled__default["default"].div `
6812
+ margin-top: 20px;
6813
+ color: ${((_f = miscTheme.theme.colors) === null || _f === void 0 ? void 0 : _f.gray500) || '#737373'};
6814
+ font-weight: 600;
6815
+ `;
6816
+ const SubotInlineActionPollChoiceResult = styled__default["default"].div `
6817
+ position: relative;
6818
+ z-index: 0;
6819
+ display: flex;
6820
+ overflow: hidden;
6821
+ align-items: center;
6822
+ padding: 16px 20px;
6823
+ border-radius: ${miscTheme.theme.borderRadius};
6824
+ .number {
6825
+ width: 32px;
6826
+ margin-right: 14px;
6827
+ font-weight: 600;
6828
+ }
6829
+ .content {
6830
+ flex: 1;
6831
+ }
6832
+ .icon {
6833
+ width: 16px;
6834
+ margin-left: 8px;
6835
+ }
6836
+ &:before {
6837
+ position: absolute;
6838
+ z-index: -1;
6839
+ top: 0;
6840
+ right: ${({ percent }) => (percent ? `${100 - percent}%` : '100%')};
6841
+ bottom: 0;
6842
+ left: 0;
6843
+ background-color: ${({ is_chosen }) => is_chosen
6844
+ ? miscTheme.theme.colors.primary50 || '#E3F2FF'
6845
+ : miscTheme.theme.colors.neutral100 || '#E4E8EC'};
6846
+ content: '';
6847
+ transition: 0.3s all linear;
6848
+ }
6849
+ &:after {
6850
+ position: absolute;
6851
+ z-index: -2;
6852
+ top: 0;
6853
+ right: 0;
6854
+ bottom: 0;
6855
+ left: 0;
6856
+ background-color: ${((_g = miscTheme.theme.colors) === null || _g === void 0 ? void 0 : _g.white) || '#fff'};
6857
+ content: '';
6858
+ }
6859
+ ${utils.MediaQueries.mbDown} {
6860
+ padding: 6px 16px;
6861
+ }
6862
+ `;
6863
+ const SubotInlineActionItemContainer = styled__default["default"].div `
6864
+ width: ${({ width }) => width || '100%'};
6865
+ padding: 4px;
6866
+ &.item-image-container {
6867
+ padding: 16px;
6868
+ ${utils.MediaQueries.tdDown} {
6869
+ padding: 7.5px;
6870
+ }
6871
+ ${utils.MediaQueries.mbDown} {
6872
+ width: 50%;
6873
+ }
6874
+ }
6875
+ `;
6876
+ const SubotInlineActionListContainer = styled__default["default"].div `
6877
+ display: flex;
6878
+ flex-wrap: wrap;
6879
+ align-items: flex-start;
6880
+ justify-content: center;
6881
+ margin: -4px;
6882
+
6883
+ &.list-container {
6884
+ margin: -16px;
6885
+ ${utils.MediaQueries.tdDown} {
6886
+ margin: -7.5px;
6887
+ }
6888
+ }
6889
+
6890
+ &.review-container {
6891
+ margin: -8px;
6892
+ ${SubotInlineActionItemContainer} {
6893
+ padding: 8px;
6894
+ }
6895
+ }
6896
+ `;
6897
+
6898
+ const SubotInlineAction = ({ actions, value, onChange, htmlType, node_type, formSubmitMeta, }) => {
6899
+ const className = React.useMemo(() => {
6900
+ switch (node_type) {
6901
+ case index$2.NodeType.IMAGE:
6902
+ case index$2.NodeType.REACTION:
6903
+ return 'list-container';
6904
+ default:
6905
+ return '';
6906
+ }
6907
+ }, [node_type]);
6908
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, actions && !!(actions === null || actions === void 0 ? void 0 : actions.length) && (React__default["default"].createElement(SubotInlineActionListContainer, { className: className }, actions === null || actions === void 0 ? void 0 : actions.map((action) => {
6909
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
6910
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: onChange, active: value === null || value === void 0 ? void 0 : value.includes(action.id), htmlType: htmlType, formSubmitMeta: formSubmitMeta })));
6911
+ })))));
6912
+ };
6913
+
6914
+ const ButtonStyled = styled__default["default"](index$8.Button) `
6915
+ &:disabled {
6916
+ background-color: rgb(242, 242, 242);
6917
+ color: rgb(140, 140, 140);
6918
+
6919
+ &:hover {
6920
+ border: 0;
6921
+ }
6922
+ }
6923
+ svg {
6924
+ path {
6925
+ stroke: currentColor;
6926
+ }
6927
+ }
6928
+ `;
6929
+ const ButtonBackStyled = styled__default["default"](ButtonStyled) `
6930
+ &:disabled {
6931
+ background-color: rgb(242, 242, 242);
6932
+ color: rgb(140, 140, 140);
6933
+ &:hover {
6934
+ border: 0;
6935
+ }
6936
+ }
6937
+ svg {
6938
+ path {
6939
+ stroke: currentColor;
6940
+ }
6941
+ }
6942
+ `;
6943
+ const SubotInlineFooterStyled = styled__default["default"].div `
6944
+ display: flex;
6945
+ align-items: center;
6946
+ justify-content: flex-end;
6947
+ padding: 16px 32px;
6948
+ border-top: 4px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
6949
+ ${ButtonStyled} {
6950
+ + ${ButtonStyled} {
6951
+ margin-left: 8px;
6952
+ }
6953
+ }
6954
+ ${utils.MediaQueries.tdDown} {
6955
+ padding: 12px 24px;
6956
+ }
6957
+ ${utils.MediaQueries.mbDown} {
6958
+ padding: 12px 16px;
6959
+ }
6960
+ `;
6961
+
6962
+ const SubotInlineActionTextChoice = ({ action, onChange, active, htmlType, formSubmitMeta, }) => {
6963
+ const { trackingCommonInline } = React.useContext(SubotInlineContext);
6964
+ const inputRef = React.useRef(null);
6965
+ const [otherText, setOtherText] = React.useState('');
6966
+ const isActionPollWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
6967
+ const isActionSelectWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
6968
+ isActionPollWithOther;
6969
+ const onChangeTextArea = (evt) => {
6970
+ setOtherText(evt.target.value);
6971
+ if (isActionSelectWithOther) {
6972
+ onChange === null || onChange === void 0 ? void 0 : onChange(action, [
6973
+ {
6974
+ key: KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD,
6975
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type] || 'text',
6976
+ value: evt.target.value,
6977
+ action_id: action.id,
6978
+ },
6979
+ ]);
6980
+ }
6981
+ };
6982
+ React.useEffect(() => {
6983
+ var _a, _b;
6984
+ if (active) {
6985
+ setOtherText(((_a = formSubmitMeta === null || formSubmitMeta === void 0 ? void 0 : formSubmitMeta.find((f) => f.key === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD)) === null || _a === void 0 ? void 0 : _a.value) || '');
6986
+ (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
6987
+ }
6988
+ }, [active, formSubmitMeta]);
6989
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
6990
+ React__default["default"].createElement(SubotInlineActionText, Object.assign({ active: !!active, onClick: () => onChange === null || onChange === void 0 ? void 0 : onChange(action), className: "pointer-event-child-none" }, trackingCommonInline, { "data-response-id": action === null || action === void 0 ? void 0 : action.id, "data-event-action": "Answer Click" }),
6991
+ React__default["default"].createElement("div", { className: "label" },
6992
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label)),
6993
+ React__default["default"].createElement("div", { className: "icon" }, htmlType === 'checkbox' && (React__default["default"].createElement(CheckboxIcon__default["default"], { className: "icon-checkbox", viewBox: "0 0 22 22" })))),
6994
+ isActionSelectWithOther && active && (React__default["default"].createElement(core.Box, { mt: "6px", style: { textAlign: 'right' } },
6995
+ React__default["default"].createElement(core.Textarea, { ref: inputRef, placeholder: action === null || action === void 0 ? void 0 : action.label, styles: {
6996
+ input: {
6997
+ paddingLeft: '24px',
6998
+ paddingRight: '24px',
6999
+ boxShadow: 'none',
7000
+ ':focus': { boxShadow: 'none' },
7001
+ },
7002
+ }, value: otherText, onChange: onChangeTextArea, maxLength: 360 })))));
7003
+ };
7004
+ const SubotInlineActionImageChoice = ({ action, onChange, active, htmlType, }) => {
7005
+ const { trackingCommonInline } = React.useContext(SubotInlineContext);
7006
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "45%", className: 'item-image-container' },
7007
+ React__default["default"].createElement(SubotInlineActionImage, Object.assign({ onClick: () => onChange && onChange(action), active: !!active }, trackingCommonInline, { "data-response-id": action === null || action === void 0 ? void 0 : action.id, "data-event-action": "Answer Click" }),
7008
+ React__default["default"].createElement("div", { className: "image-container" },
7009
+ React__default["default"].createElement("img", { loading: "lazy", src: action === null || action === void 0 ? void 0 : action.url, alt: action === null || action === void 0 ? void 0 : action.label, className: "image" })),
7010
+ (action === null || action === void 0 ? void 0 : action.label) && (React__default["default"].createElement("div", { className: "label" },
7011
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))),
7012
+ React__default["default"].createElement("div", { className: "icon" }, htmlType === 'checkbox' && (React__default["default"].createElement(CheckboxIcon__default["default"], { className: "icon-checkbox", viewBox: "0 0 22 22" }))))));
7013
+ };
7014
+ const SubotInlineActionSSO = ({ action, onChange, }) => {
7015
+ const { trackingCommonInline } = React.useContext(SubotInlineContext);
7016
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "50%", style: { alignSelf: 'center' } },
7017
+ React__default["default"].createElement(ButtonStyled, Object.assign({ onClick: () => onChange && onChange(action), size: "lg", isBlock: true }, trackingCommonInline, { className: "pointer-event-child-none", "data-event-action": "Login Click", "data-response-id": action === null || action === void 0 ? void 0 : action.id }),
7018
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7019
+ };
7020
+ const SubotInlinePollChoice = ({ active, action, onChange, htmlType, node_type, }) => {
7021
+ const handleOnChange = (action) => {
7022
+ if (action)
7023
+ onChange &&
7024
+ onChange({
7025
+ key: (action === null || action === void 0 ? void 0 : action.key) || '',
7026
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7027
+ value: '',
7028
+ action_id: action === null || action === void 0 ? void 0 : action.id,
7029
+ });
7030
+ };
7031
+ if (node_type === index$2.NodeType.RESULT_POLL)
7032
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7033
+ React__default["default"].createElement(SubotInlineActionPollChoiceResult, { percent: (action === null || action === void 0 ? void 0 : action.percent) || 0, is_chosen: action === null || action === void 0 ? void 0 : action.is_chosen },
7034
+ React__default["default"].createElement("div", { className: "number" }, action === null || action === void 0 ? void 0 :
7035
+ action.percent,
7036
+ "%"),
7037
+ React__default["default"].createElement("div", { className: "content" }, action === null || action === void 0 ? void 0 : action.label),
7038
+ React__default["default"].createElement("div", { className: "icon" }, (action === null || action === void 0 ? void 0 : action.is_chosen) && React__default["default"].createElement(CheckIcon__default["default"], { viewBox: "0 0 16 16" })))));
7039
+ return (React__default["default"].createElement(SubotInlineActionTextChoice, { active: !!active, action: action, onChange: handleOnChange, htmlType: htmlType }));
7040
+ };
7041
+ const SubotInlinePollChoiceImage = ({ active, action, onChange, htmlType, node_type, }) => {
7042
+ const handleOnChange = (action) => {
7043
+ if (action)
7044
+ onChange &&
7045
+ onChange({
7046
+ key: action === null || action === void 0 ? void 0 : action.key,
7047
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7048
+ value: '',
7049
+ action_id: action === null || action === void 0 ? void 0 : action.id,
7050
+ });
7051
+ };
7052
+ if (node_type === index$2.NodeType.RESULT_POLL)
7053
+ // TODO: Update layout result poll image
7054
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7055
+ React__default["default"].createElement(SubotInlineActionPollChoiceResult, { percent: (action === null || action === void 0 ? void 0 : action.percent) || 0, is_chosen: action === null || action === void 0 ? void 0 : action.is_chosen },
7056
+ React__default["default"].createElement("div", { className: "number" }, action === null || action === void 0 ? void 0 :
7057
+ action.percent,
7058
+ "%"),
7059
+ React__default["default"].createElement("div", { className: "content" }, action === null || action === void 0 ? void 0 : action.label),
7060
+ React__default["default"].createElement("div", { className: "icon" }, (action === null || action === void 0 ? void 0 : action.is_chosen) && React__default["default"].createElement(CheckIcon__default["default"], { viewBox: "0 0 16 16" })))));
7061
+ return (React__default["default"].createElement(SubotInlineActionImageChoice, { active: !!active, action: action, onChange: handleOnChange, htmlType: htmlType }));
7062
+ };
7063
+ const SubotInlineRatingStar = ({ action, value, onChange, }) => {
7064
+ var _a, _b;
7065
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7066
+ React__default["default"].createElement(SubotInlineActionRatingStartContainer, null,
7067
+ React__default["default"].createElement(StarRatings__default["default"], { rating: value && typeof value !== 'string' && (value === null || value === void 0 ? void 0 : value.value)
7068
+ ? parseInt(value === null || value === void 0 ? void 0 : value.value)
7069
+ : 0, changeRating: (star) => {
7070
+ const _value = {
7071
+ key: action === null || action === void 0 ? void 0 : action.key,
7072
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7073
+ value: star.toString(),
7074
+ action_id: action === null || action === void 0 ? void 0 : action.id,
7075
+ };
7076
+ onChange && onChange(_value);
7077
+ }, starHoverColor: (_a = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _a === void 0 ? void 0 : _a.yellow600, starRatedColor: (_b = miscTheme.theme === null || miscTheme.theme === void 0 ? void 0 : miscTheme.theme.colors) === null || _b === void 0 ? void 0 : _b.yellow600, starDimension: "48" }))));
7078
+ };
7079
+ const SubotInlineTextArea = ({ action, value, onChange, }) => {
7080
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7081
+ React__default["default"].createElement(SubotInlineActionRatingDescriptionContainer, null,
7082
+ React__default["default"].createElement(index$c.TextArea, { placeholder: action === null || action === void 0 ? void 0 : action.label, value: value && typeof value !== 'string' && (value === null || value === void 0 ? void 0 : value.value)
7083
+ ? value === null || value === void 0 ? void 0 : value.value
7084
+ : '', onChange: (evt) => {
7085
+ const _value = {
7086
+ key: action === null || action === void 0 ? void 0 : action.key,
7087
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7088
+ value: evt.target.value,
7089
+ action_id: action === null || action === void 0 ? void 0 : action.id,
7090
+ };
7091
+ onChange && onChange(_value);
7092
+ } }))));
7093
+ };
7094
+ const SubotInlineLikeChoice = ({ action, active, onChange, }) => {
7095
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "40%", className: 'item-image-container' },
7096
+ React__default["default"].createElement(SubotInlineButtonReaction, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange && onChange(action) },
7097
+ React__default["default"].createElement(LikeIcon__default["default"], { viewBox: "0 0 24 24" }),
7098
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7099
+ };
7100
+ const SubotInlineDislikeChoice = ({ action, active, onChange, }) => {
7101
+ return (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "40%", className: 'item-image-container' },
7102
+ React__default["default"].createElement(SubotInlineButtonReaction, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange && onChange(action) },
7103
+ React__default["default"].createElement(DislikeIcon__default["default"], { viewBox: "0 0 24 24" }),
7104
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7105
+ };
7106
+ const SubotInlineReviewChoice = ({ active, action, onChange, }) => (React__default["default"].createElement(SubotInlineActionItemContainer, { width: "auto", className: "review-choice" },
7107
+ React__default["default"].createElement(SubotInlineButtonReview, { className: classNames__default["default"](!!active && 'active'), onClick: () => onChange &&
7108
+ onChange({
7109
+ key: action === null || action === void 0 ? void 0 : action.key,
7110
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7111
+ value: '',
7112
+ action_id: action === null || action === void 0 ? void 0 : action.id,
7113
+ }) },
7114
+ React__default["default"].createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7115
+ const SubotInlinePollResult = ({ action, }) => (React__default["default"].createElement(SubotInlineActionItemContainer, null,
7116
+ React__default["default"].createElement(SubotInlineActionPollResult, null, action === null || action === void 0 ? void 0 : action.label)));
7117
+ const SubotInlineActionBase = {
7118
+ 'user-image': SubotInlineActionImageChoice,
7119
+ [index$2.NodeActionType.USER_CHOICE_TEXT]: SubotInlineActionTextChoice,
7120
+ [index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT]: SubotInlineActionTextChoice,
7121
+ [index$2.NodeActionType.USER_CHOICE_IMAGE]: SubotInlineActionImageChoice,
7122
+ [index$2.NodeActionType.ACTION_SSO_REDIRECT]: SubotInlineActionSSO,
7123
+ [index$2.NodeActionType.POLL_CHOICE]: SubotInlinePollChoice,
7124
+ [index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT]: SubotInlineActionTextChoice,
7125
+ [index$2.NodeActionType.POLL_CHOICE_IMAGE]: SubotInlinePollChoiceImage,
7126
+ [index$2.NodeActionType.RATING_STAR]: SubotInlineRatingStar,
7127
+ [index$2.NodeActionType.RATING_DESCRIPTION]: SubotInlineTextArea,
7128
+ [index$2.NodeActionType.LIKE_CHOICE]: SubotInlineLikeChoice,
7129
+ [index$2.NodeActionType.DISLIKE_CHOICE]: SubotInlineDislikeChoice,
7130
+ [index$2.NodeActionType.REVIEW_CHOICE]: SubotInlineReviewChoice,
7131
+ [index$2.NodeActionType.REVIEW_DESCRIPTION]: SubotInlineTextArea,
7132
+ [index$2.NodeActionType.RESULT_BUTTON]: SubotInlineActionTextChoice,
7133
+ [index$2.NodeActionType.POLL_RESULT]: SubotInlinePollResult,
7134
+ };
7135
+
7136
+ const SubotInlineFooter = ({ onBack, onNext: onSubmit, hideBack, hideNext, nextText, backProps, nextProps, }) => {
7137
+ var _a, _b, _c;
7138
+ const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
7139
+ const { nodes: listNodes, activeId, params, onNext, trackingCommonInline, } = React.useContext(SubotInlineContext);
7140
+ const nodeMessage = listNodes.find((nodeItem) => nodeItem.id == activeId);
7141
+ const actionNextChoice = (_a = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage.actions) === null || _a === void 0 ? void 0 : _a.find((act) => act.type === index$2.NodeActionType.USER_CHOICE_NEXT);
7142
+ const handleNextChoice = () => {
7143
+ if (nodeMessage && actionNextChoice) {
7144
+ const nextValue = {
7145
+ node_id: nodeMessage.id,
7146
+ action_id: actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.id,
7147
+ action_value: actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.key,
7148
+ };
7149
+ onNext === null || onNext === void 0 ? void 0 : onNext(Object.assign(Object.assign(Object.assign({}, params), nextValue), nodeMessage._message));
7150
+ }
7151
+ };
7152
+ const actionSubmitMultiple = (_b = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage.actions) === null || _b === void 0 ? void 0 : _b.find((act) => act.type === index$2.NodeActionType.ACTION_MULTIPLE_BUTTON);
7153
+ return (React__default["default"].createElement(SubotInlineFooterStyled, null,
7154
+ !hideBack && (React__default["default"].createElement(ButtonBackStyled, Object.assign({ size: "md", color: "secondary", onClick: onBack }, backProps, { className: classNames__default["default"]('pointer-event-child-none', backProps === null || backProps === void 0 ? void 0 : backProps.className) }, trackingCommonInline, { "data-event-action": "Back Click" }),
7155
+ React__default["default"].createElement(LeftArrowIcon__default["default"], { style: { marginRight: 10 } }),
7156
+ f({
7157
+ id: 'riskScreener.back',
7158
+ defaultMessage: 'Back',
7159
+ }))),
7160
+ !hideNext && (React__default["default"].createElement(ButtonStyled, Object.assign({ size: "md", color: "primary", onClick: actionNextChoice ? handleNextChoice : onSubmit }, nextProps, { className: classNames__default["default"]('pointer-event-child-none', nextProps === null || nextProps === void 0 ? void 0 : nextProps.className) }, trackingCommonInline, { "data-event-action": "Answer Click", "data-response-id": (actionSubmitMultiple === null || actionSubmitMultiple === void 0 ? void 0 : actionSubmitMultiple.id) ||
7161
+ (actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.id) ||
7162
+ ((_c = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage._message) === null || _c === void 0 ? void 0 : _c.action_id) }),
7163
+ !nextText
7164
+ ? f({
7165
+ id: 'riskScreener.next',
7166
+ defaultMessage: 'Next',
7167
+ })
7168
+ : nextText,
7169
+ React__default["default"].createElement(RightArrowIcon__default["default"], { style: { marginLeft: 10 } })))));
7170
+ };
7171
+ var SubotInlineFooter$1 = React.memo(SubotInlineFooter);
7172
+
7173
+ const SubotInlineHeadline = styled__default["default"].h4 `
7174
+ padding: 32px 0px 12px;
7175
+ border-bottom: 1px solid ${miscTheme.theme.colors.neutral100 || '#E4E8EC'};
7176
+ margin: 0px 32px;
7177
+ color: ${miscTheme.theme.colors.gray500 || '#737373'};
7178
+ font-size: 14px;
7179
+ font-weight: 700;
7180
+ line-height: 1.5;
7181
+ ${utils.MediaQueries.tdDown} {
7182
+ padding: 24px 0px 12px;
7183
+ margin: 0px 24px;
7184
+ }
7185
+ ${utils.MediaQueries.mbDown} {
7186
+ padding: 16px 0px 12px;
7187
+ margin: 0px 16px;
7188
+ }
7189
+ `;
7190
+ const SubotInlineHeader = () => {
7191
+ const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
7192
+ const { nodes } = React.useContext(SubotInlineContext);
7193
+ const headline = React.useMemo(() => { var _a; return (_a = nodes[0]) === null || _a === void 0 ? void 0 : _a.inline_headline; }, [nodes]);
7194
+ return (React__default["default"].createElement(SubotInlineHeadline, null, headline ||
7195
+ f({
7196
+ id: 'subotInline.quote',
7197
+ defaultMessage: 'HAVE TIME FOR A QUICK QUESTION?',
7198
+ })));
7199
+ };
7200
+ var SubotInlineHeader$1 = React.memo(SubotInlineHeader);
7201
+
7202
+ const SubotInlineIntentTitle = styled__default["default"].h3 `
7203
+ margin-bottom: 0px;
7204
+ font-size: 22px;
7205
+ font-weight: bold;
7206
+ line-height: 1.45;
7207
+ ${utils.MediaQueries.tdDown} {
7208
+ font-size: 20px;
7209
+ }
7210
+ `;
7211
+ const SubotInlineRecalculateButton = styled__default["default"](index$8.Button) `
7212
+ &.bot-recalculate {
7213
+ svg {
7214
+ path {
7215
+ stroke: ${miscTheme.theme.colors.primaryBase || '#2685F1'} !important;
7216
+ }
7217
+ }
7218
+ &:hover {
7219
+ svg {
7220
+ path {
7221
+ stroke: #fff !important;
7222
+ }
7223
+ }
7224
+ }
7225
+ }
7226
+ `;
7227
+ const SubotInlineIntentButton = styled__default["default"](index$8.Button) `
7228
+ border: 2px solid transparent;
7229
+ `;
7230
+ const SubotInlineItemIcon = styled__default["default"].div `
7231
+ display: flex;
7232
+ padding-top: 10px;
7233
+ padding-bottom: 10px;
7234
+ .icon {
7235
+ width: 64px;
7236
+ height: 64px;
7237
+ margin-right: 16px;
7238
+ object-fit: contain;
7239
+ object-position: center;
7240
+ }
7241
+ .content {
7242
+ flex: 1;
7243
+ .title {
7244
+ margin-top: 0;
7245
+ margin-bottom: 0;
7246
+ font-size: inherit;
7247
+ font-weight: 700;
7248
+ line-height: 1.4;
7249
+ }
7250
+ .description {
7251
+ color: ${miscTheme.theme.colors.gray700 || '#404040'};
7252
+ line-height: 1.4;
7253
+ }
7254
+ }
7255
+ ${utils.MediaQueries.mbDown} {
7256
+ .icon {
7257
+ width: 47px;
7258
+ height: 47px;
7259
+ margin-right: 16px;
7260
+ }
7261
+ .content {
7262
+ .title {
7263
+ font-size: 14px;
7264
+ }
7265
+ .description {
7266
+ font-size: 14px;
7267
+ }
7268
+ }
7269
+ }
7270
+ `;
7271
+ styled__default["default"](index$8.Button) ``;
7272
+ const SubotInlineIntentFirstTextWrapper = styled__default["default"].div `
7273
+ display: flex;
7274
+ align-items: flex-start;
7275
+ color: ${miscTheme.theme.colors.gray800 || '#262626'};
7276
+ font-size: 22px;
7277
+ font-weight: 700;
7278
+ letter-space: -0.6px;
7279
+ line-height: 1.45;
7280
+ .number {
7281
+ margin-right: 3px;
7282
+ }
7283
+ .title {
7284
+ flex: 1;
7285
+ }
7286
+ ${utils.MediaQueries.tdDown} {
7287
+ font-size: 20px;
7288
+ }
7289
+ ${utils.MediaQueries.mbDown} {
7290
+ font-size: 18px;
7291
+ }
7292
+ `;
7293
+ const SubotInlineIntentFirstImageWrapper = styled__default["default"].div `
7294
+ display: flex;
7295
+ justify-content: center;
7296
+ `;
7297
+ const SubotInlineIntentFirstTextContainer = styled__default["default"].div ``;
7298
+ const SubotInlineIntentTextContainer = styled__default["default"].div `
7299
+ padding: 12px 16px;
7300
+ border: 1px solid ${miscTheme.theme.colors.gray200 || '#D9D9D9'};
7301
+ background-color: ${miscTheme.theme.colors.white || '#fff'};
7302
+ border-radius: ${miscTheme.theme.borderRadius};
7303
+ line-height: 1.5;
7304
+ `;
7305
+ const SubotInlineIntentImageContainer = styled__default["default"].div `
7306
+ border: ${miscTheme.theme.colors.gray200 || '#D9D9D9'};
7307
+ background-color: ${miscTheme.theme.colors.white || '#FFF'};
7308
+ border-radius: ${miscTheme.theme.borderRadius};
7309
+ .intent-img {
7310
+ border-radius: ${miscTheme.theme.borderRadius};
7311
+ &.has-label {
7312
+ border-bottom-left-radius: 0px;
7313
+ border-bottom-right-radius: 0px;
7314
+ }
7315
+ }
7316
+ .intent-img-label {
7317
+ padding: 5px 10px;
7318
+ font-size: 0.8em;
7319
+ font-style: italic;
7320
+ font-weight: 400;
7321
+ }
7322
+ `;
7323
+ const SubotInlineIntentUrlContainer = styled__default["default"].div `
7324
+ display: flex;
7325
+ .feature {
7326
+ width: 30%;
7327
+ .feature-wrapper {
7328
+ position: relative;
7329
+ display: block;
7330
+ overflow: hidden;
7331
+ width: 100%;
7332
+ padding-top: 66%;
7333
+ border-radius: ${miscTheme.theme.borderRadius};
7334
+ .feature-img {
7335
+ position: absolute;
7336
+ top: 50%;
7337
+ left: 50%;
7338
+ width: 100%;
7339
+ min-width: 100%;
7340
+ height: auto;
7341
+ min-height: 100%;
7342
+ transform: translate(-50%, -50%);
7343
+ }
7344
+ }
7345
+ }
7346
+ .body {
7347
+ flex: 1;
7348
+ margin-left: 10px;
7349
+ line-height: 1.5;
7350
+ a {
7351
+ color: ${miscTheme.theme.colors.gray800 || '#262626'};
7352
+ text-decoration: none;
7353
+ }
7354
+ }
7355
+ `;
7356
+ const SubotInlineIntentRiskScreenerContainer = styled__default["default"].div `
7357
+ display: flex;
7358
+ align-items: center;
7359
+ justify-content: space-between;
7360
+ padding: 20px 40px 20px 16px;
7361
+ background-color: #fff;
7362
+ border-radius: ${miscTheme.theme.borderRadius};
7363
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 2px rgba(0, 0, 0, 0.06),
7364
+ 0px 0px 1px rgba(0, 0, 0, 0.04);
7365
+ .feature {
7366
+ display: block;
7367
+ overflow: hidden;
7368
+ width: 72px;
7369
+ height: 72px;
7370
+ margin-right: 16px;
7371
+ border-radius: ${miscTheme.theme.borderRadius};
7372
+ img {
7373
+ width: 100%;
7374
+ height: 100%;
7375
+ object-fit: cover;
7376
+ object-position: center;
7377
+ }
7378
+ }
7379
+ .title-container {
7380
+ display: flex;
7381
+ flex: 1;
7382
+ align-items: center;
7383
+ justify-content: space-between;
7384
+ a {
7385
+ font-size: 16px;
7386
+ line-height: 1.5em;
7387
+ text-decoration: none;
7388
+ .title {
7389
+ padding: 0;
7390
+ color: #262626;
7391
+ font-size: inherit;
7392
+ line-height: inherit;
7393
+ }
7394
+ &.link {
7395
+ display: flex;
7396
+ align-items: center;
7397
+ justify-content: center;
7398
+ margin-left: 20px;
7399
+ color: #2d87f3;
7400
+ font-weight: 700;
7401
+ }
7402
+ }
7403
+ }
7404
+ @media screen and (max-width: 769px) {
7405
+ padding: 16px 12px;
7406
+ .feature {
7407
+ width: 50px;
7408
+ height: 50px;
7409
+ }
7410
+ .title-container {
7411
+ a {
7412
+ font-size: 13px;
7413
+ line-height: 20px;
7414
+ &.link {
7415
+ margin-left: 10px;
7416
+ }
7417
+ }
7418
+ }
7419
+ }
7420
+ `;
7421
+ const SubotInlineIntentFinalButtonContainer = styled__default["default"].div `
7422
+ display: flex;
7423
+ align-items: center;
7424
+ justify-content: center;
7425
+ `;
7426
+ styled__default["default"].div `
7427
+ padding: 16px;
7428
+ margin-top: 32px;
7429
+ margin-bottom: 32px;
7430
+ background-color: ${miscTheme.theme.colors.primary50 || ''};
7431
+ border-radius: ${miscTheme.theme.borderRadius};
7432
+ .item-grid {
7433
+ > div {
7434
+ box-shadow: none;
7435
+ }
7436
+ }
7437
+ .lp--affiliate-product {
7438
+ .arrow-left {
7439
+ left: -20px;
7440
+ }
7441
+ .arrow-right {
7442
+ right: -16px;
7443
+ }
7444
+ }
7445
+ .bullet-nav {
7446
+ bottom: -10px;
7447
+ }
7448
+ `;
7449
+ const SubotInlineIntentFinalCol = styled__default["default"].div `
7450
+ width: ${({ width }) => width || '100%'};
7451
+ padding: 8px;
7452
+ ${utils.MediaQueries.mbDown} {
7453
+ width: 100%;
7454
+ }
7455
+ `;
7456
+ const SubotInlineIntentFinalRow = styled__default["default"].div `
7457
+ display: flex;
7458
+ flex-wrap: wrap;
7459
+ align-items: flex-start;
7460
+ justify-content: center;
7461
+ margin: 0 -8px;
7462
+ `;
7463
+ const SubotInlineIntentCol = styled__default["default"].div `
7464
+ width: ${({ width }) => width || '100%'};
7465
+ padding: 4px;
7466
+ ${utils.MediaQueries.mbDown} {
7467
+ width: 100%;
7468
+ }
7469
+ `;
7470
+ const SubotInlineIntentRow = styled__default["default"].div `
7471
+ display: flex;
7472
+ flex-wrap: wrap;
7473
+ align-items: flex-start;
7474
+ justify-content: center;
7475
+ margin: 0 -4px;
7476
+ `;
7477
+ const SubotInlineIntentList = styled__default["default"].div `
7478
+ margin-top: 20px;
7479
+ `;
7480
+
7481
+ const SubotInlineIntent = ({ intents, indexNumber, }) => {
7482
+ var _a, _b;
7483
+ const title = React.useMemo(() => {
7484
+ const _title = intents && intents[0];
7485
+ if (_title)
7486
+ return _title;
7487
+ return null;
7488
+ }, []);
7489
+ if (!intents.length)
7490
+ return React__default["default"].createElement(SubotInlineIntentBotTitle, { indexNumber: indexNumber });
7491
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
7492
+ title && (React__default["default"].createElement(SubotInlineIntentBotTitle, { intent: title, indexNumber: indexNumber })),
7493
+ !!((_a = intents.slice(1)) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineIntentList, null,
7494
+ React__default["default"].createElement(SubotInlineIntentRow, null, (_b = intents.slice(1)) === null || _b === void 0 ? void 0 : _b.map((intent) => {
7495
+ const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
7496
+ return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
7497
+ }))))));
7498
+ };
7499
+
7500
+ const SubotInlineIntentFinal = ({ intents: intentsProps, }) => {
7501
+ const intents = React.useMemo(() => {
7502
+ const mainIntents = [];
7503
+ const subIntents = [];
7504
+ const rest = [];
7505
+ intentsProps === null || intentsProps === void 0 ? void 0 : intentsProps.map((intent) => {
7506
+ switch (intent === null || intent === void 0 ? void 0 : intent.type) {
7507
+ case index$2.NodeIntentType.BOT_MAIN_IMAGE:
7508
+ mainIntents.push(intent);
7509
+ break;
7510
+ case index$2.NodeIntentType.BOT_MAIN_TITLE:
7511
+ mainIntents.push(intent);
7512
+ break;
7513
+ case index$2.NodeIntentType.BOT_MAIN_BODY:
7514
+ mainIntents.push(intent);
7515
+ break;
7516
+ case index$2.NodeIntentType.BOT_MAIN_BUTTON:
7517
+ mainIntents.push(intent);
7518
+ break;
7519
+ case index$2.NodeIntentType.BOT_RECALCULATE:
7520
+ mainIntents.push(intent);
7521
+ break;
7522
+ case index$2.NodeIntentType.BOT_SUB_TITLE:
7523
+ subIntents.push(intent);
7524
+ break;
7525
+ case index$2.NodeIntentType.BOT_SUB_BODY:
7526
+ subIntents.push(intent);
7527
+ break;
7528
+ default:
7529
+ rest.push(intent);
7530
+ break;
7531
+ }
7532
+ });
7533
+ return {
7534
+ mainIntents,
7535
+ subIntents,
7536
+ intents: rest,
7537
+ };
7538
+ }, []);
7539
+ if (!(intentsProps === null || intentsProps === void 0 ? void 0 : intentsProps.length)) {
7540
+ return null;
7541
+ }
7542
+ function renderIntent(intent) {
7543
+ const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
7544
+ if (!NodeIntent) {
7545
+ return null;
7546
+ }
7547
+ return React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
7548
+ }
7549
+ return (React__default["default"].createElement(SubotInlineIntentRow, null,
7550
+ React__default["default"].createElement(SubotInlineIntentCol, null,
7551
+ React__default["default"].createElement(SubotInlineIntentFinalRow, null,
7552
+ intents.mainIntents.map(renderIntent),
7553
+ intents.subIntents.map(renderIntent),
7554
+ intents.intents.map(renderIntent)))));
7555
+ };
7556
+
7557
+ /*******************************************************************************/
7558
+ /*************************** NodeIntentType: 'bot-text' ************************/
7559
+ //#region
7560
+ const SubotInlineIntentBotText = ({ intent, }) => {
7561
+ if (!(intent === null || intent === void 0 ? void 0 : intent.label))
7562
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7563
+ return (React__default["default"].createElement(SubotInlineIntentCol, null,
7564
+ React__default["default"].createElement(SubotInlineIntentTextContainer, null,
7565
+ React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
7566
+ };
7567
+ //#endregion
7568
+ /*************************** END - NodeIntentType: 'bot-text' ******************/
7569
+ /*******************************************************************************/
7570
+ /*******************************************************************************/
7571
+ /*************************** NodeIntentType: 'bot-image' ***********************/
7572
+ //#region
7573
+ const SubotInlineIntentBotImage = ({ intent, }) => {
7574
+ if (!intent.url)
7575
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7576
+ const isObject = (() => {
7577
+ try {
7578
+ return Boolean(JSON.parse((intent === null || intent === void 0 ? void 0 : intent.label) || ''));
7579
+ }
7580
+ catch (err) {
7581
+ return false;
7582
+ }
7583
+ })();
7584
+ return (React__default["default"].createElement(SubotInlineIntentCol, { width: "50%" },
7585
+ React__default["default"].createElement(SubotInlineIntentImageContainer, null,
7586
+ React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
7587
+ isObject && (React__default["default"].createElement("h4", { className: "intent-img-label" },
7588
+ React__default["default"].createElement(Markdown, null, intent.label))))));
7589
+ };
7590
+ //#endregion
7591
+ /*************************** END - NodeIntentType: 'bot-image' *****************/
7592
+ /*******************************************************************************/
7593
+ /*******************************************************************************/
7594
+ /*************************** NodeIntentType: 'bot-button' **********************/
7595
+ //#region
7596
+ const SubotInlineIntentBotButton = ({ intent, }) => {
7597
+ const { trackingCommonInline } = React.useContext(SubotInlineContext);
7598
+ const handleOnClick = () => {
7599
+ window.location.href = intent.url;
7600
+ };
7601
+ if (!(intent === null || intent === void 0 ? void 0 : intent.label))
7602
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7603
+ return (React__default["default"].createElement(SubotInlineIntentCol, { width: "60%" },
7604
+ React__default["default"].createElement(SubotInlineIntentButton, Object.assign({ size: "lg", color: "primary", onClick: handleOnClick, isBlock: true }, trackingCommonInline, { "data-event-action": "Click CTA", "data-response-id": intent.id }),
7605
+ React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
7606
+ };
7607
+ //#endregion
7608
+ /*************************** END - NodeIntentType: 'bot-button' ****************/
7609
+ /*******************************************************************************/
7610
+ /*******************************************************************************/
7611
+ /*************************** NodeIntentType: 'bot-url' *************************/
7612
+ //#region
7613
+ const SubotInlineIntentUrl = ({ intent, }) => {
7614
+ const article = React.useMemo(() => intent.label.includes('{')
7615
+ ? JSON.parse(intent.label)
7616
+ : {}, [intent.label]);
7617
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, !!Object.keys(article).length && (React__default["default"].createElement(SubotInlineIntentCol, null,
7618
+ React__default["default"].createElement(SubotInlineIntentUrlContainer, null,
7619
+ React__default["default"].createElement("div", { className: "feature" },
7620
+ React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature-wrapper" },
7621
+ React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title, className: "feature-img" }))),
7622
+ React__default["default"].createElement("div", { className: "body" },
7623
+ React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url },
7624
+ React__default["default"].createElement("h5", { className: "title" },
7625
+ React__default["default"].createElement(Markdown, null, article === null || article === void 0 ? void 0 : article.title)))))))));
7626
+ };
7627
+ //#endregion
7628
+ /*************************** END - NodeIntentType: 'bot-url' *******************/
7629
+ /*******************************************************************************/
7630
+ /*******************************************************************************/
7631
+ /*************************** NodeIntentType: 'sso-intent' *************************/
7632
+ //#region
7633
+ const SubotInlineIntentSSO = ({ intent, }) => {
7634
+ const info = (() => {
7635
+ try {
7636
+ return (intent === null || intent === void 0 ? void 0 : intent.label) ? JSON.parse(intent === null || intent === void 0 ? void 0 : intent.label) : {};
7637
+ }
7638
+ catch (err) {
7639
+ return {};
7640
+ }
7641
+ })();
7642
+ if (!info || !info.title)
7643
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7644
+ return (React__default["default"].createElement(SubotInlineIntentCol, null,
7645
+ React__default["default"].createElement(SubotInlineItemIcon, null,
7646
+ React__default["default"].createElement("img", { loading: "lazy", src: intent === null || intent === void 0 ? void 0 : intent.url, className: "icon", alt: "" }),
7647
+ React__default["default"].createElement("div", { className: "content" },
7648
+ React__default["default"].createElement("h3", { className: "title" }, info.title),
7649
+ React__default["default"].createElement("div", { className: "description" }, info === null || info === void 0 ? void 0 : info.description)))));
7650
+ };
7651
+ //#endregion
7652
+ /*************************** END - NodeIntentType: 'sso-intent' *******************/
7653
+ /*******************************************************************************/
7654
+ /*******************************************************************************/
7655
+ /*************************** NodeIntentType: 'bot-title' ***********************/
7656
+ //#region
7657
+ const SubotInlineIntentBotTitle = ({ intent, indexNumber, }) => {
7658
+ const isShowLabel = ![index$2.NodeIntentType.SSO_INTENT].includes(intent === null || intent === void 0 ? void 0 : intent.type);
7659
+ return (React__default["default"].createElement(SubotInlineIntentFirstTextContainer, null,
7660
+ React__default["default"].createElement(SubotInlineIntentFirstTextWrapper, null,
7661
+ indexNumber && (React__default["default"].createElement("div", { className: "number" },
7662
+ indexNumber < 10 ? `0${indexNumber}` : indexNumber,
7663
+ ".")),
7664
+ isShowLabel &&
7665
+ intent &&
7666
+ [index$2.NodeIntentType.BOT_TEXT, index$2.NodeIntentType.BOT_BUTTON].includes(intent === null || intent === void 0 ? void 0 : intent.type) && React__default["default"].createElement(Markdown, { className: "title" }, intent.label)),
7667
+ intent &&
7668
+ [index$2.NodeIntentType.BOT_IMAGE].includes(intent === null || intent === void 0 ? void 0 : intent.type) && (React__default["default"].createElement(SubotInlineIntentFirstImageWrapper, null,
7669
+ React__default["default"].createElement(SubotInlineIntentBotImage, { intent: intent })))));
7670
+ };
7671
+ //#endregion
7672
+ /*************************** END - NodeIntentType: 'bot-title' *****************/
7673
+ /*******************************************************************************/
7674
+ /*******************************************************************************/
7675
+ /*************************** NodeIntentType: 'bot-main-title' ******************/
7676
+ //#region
7677
+ const SubotInlineIntentBotMainTitle = ({ intent, }) => {
7678
+ if (!intent.label ||
7679
+ intent.label === 'Sub title' ||
7680
+ intent.label === 'Main title') {
7681
+ return null;
7682
+ }
7683
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7684
+ React__default["default"].createElement(SubotInlineIntentTitle, null,
7685
+ React__default["default"].createElement(Markdown, null, intent.label))));
7686
+ };
7687
+ //#endregion
7688
+ /*************************** END - NodeIntentType: 'bot-main-title' ************/
7689
+ /*******************************************************************************/
7690
+ /*******************************************************************************/
7691
+ /*************************** NodeIntentType: 'bot-main-image' ******************/
7692
+ //#region
7693
+ const SubotInlineIntentBotMainImage = ({ intent, }) => {
7694
+ if (!intent.url)
7695
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7696
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7697
+ React__default["default"].createElement(SubotInlineIntentImageContainer, null,
7698
+ React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
7699
+ intent.label && (React__default["default"].createElement("h4", { className: "intent-img-label" },
7700
+ React__default["default"].createElement(Markdown, null, intent.label))))));
7701
+ };
7702
+ //#endregion
7703
+ /*************************** END - NodeIntentType: 'bot-main-image' ************/
7704
+ /*******************************************************************************/
7705
+ /*******************************************************************************/
7706
+ /*************************** NodeIntentType: 'bot-main-body' ******************/
7707
+ //#region
7708
+ const SubotInlineIntentBotMainBody = ({ intent, }) => {
7709
+ if (!intent.label ||
7710
+ intent.label === 'Main body' ||
7711
+ intent.label === 'Sub body') {
7712
+ return null;
7713
+ }
7714
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7715
+ React__default["default"].createElement("div", { className: "intents__item markdown" },
7716
+ React__default["default"].createElement(Markdown, null, intent.label))));
7717
+ };
7718
+ //#endregion
7719
+ /*************************** END - NodeIntentType: 'bot-main-body' ************/
7720
+ /*******************************************************************************/
7721
+ /*******************************************************************************/
7722
+ /*************************** NodeIntentType: 'bot-main-button' *****************/
7723
+ //#region
7724
+ const SubotInlineIntentBotMainButton = ({ intent, }) => {
7725
+ const { trackingCommonInline } = React.useContext(SubotInlineContext);
7726
+ const handleOnClick = () => {
7727
+ window.location.href = intent.url;
7728
+ };
7729
+ if (!intent.label)
7730
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7731
+ return (React__default["default"].createElement(SubotInlineIntentCol, { width: "auto" },
7732
+ React__default["default"].createElement(SubotInlineIntentFinalButtonContainer, null,
7733
+ React__default["default"].createElement(SubotInlineIntentButton, Object.assign({ size: "lg", color: "primary", onClick: handleOnClick, className: "pointer-event-child-none" }, trackingCommonInline, { "data-event-action": "Click CTA", "data-response-id": intent.id }),
7734
+ React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label)))));
7735
+ };
7736
+ //#endregion
7737
+ /*************************** END - NodeIntentType: 'bot-main-button' ***********/
7738
+ /*******************************************************************************/
7739
+ /*******************************************************************************/
7740
+ /*************************** NodeIntentType: 'bot-recalculate' *****************/
7741
+ //#region
7742
+ const SubotInlineIntentBotRecalculate = ({ intent }) => {
7743
+ const { onReset } = React.useContext(SubotInlineContext);
7744
+ const handleOnClick = () => {
7745
+ onReset && onReset();
7746
+ };
7747
+ if (!(intent === null || intent === void 0 ? void 0 : intent.label))
7748
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7749
+ return (React__default["default"].createElement(SubotInlineIntentCol, { width: "auto", style: { justifyContent: 'center', display: 'flex' } },
7750
+ React__default["default"].createElement(SubotInlineRecalculateButton, { size: "lg", color: "secondary", onClick: handleOnClick, icon: React__default["default"].createElement(RotateLeftSvg__default["default"], null), className: "bot-recalculate" },
7751
+ React__default["default"].createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
7752
+ };
7753
+ //#endregion
7754
+ /*************************** END - NodeIntentType: 'bot-recalculate' ***********/
7755
+ /*******************************************************************************/
7756
+ /*******************************************************************************/
7757
+ /*************************** NodeIntentType: 'bot-risk-screener' ***************/
7758
+ //#region
7759
+ const SubotInlineIntentBotRiskScreener = ({ intent }) => {
7760
+ const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
7761
+ const article = React.useMemo(() => {
7762
+ if (intent.label && intent.label.includes('{')) {
7763
+ return JSON.parse(intent.label);
7764
+ }
7765
+ return {};
7766
+ }, [intent, intent === null || intent === void 0 ? void 0 : intent.label]);
7767
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, !!(article === null || article === void 0 ? void 0 : article.title) && !!(article === null || article === void 0 ? void 0 : article.thumbnail) && !!(article === null || article === void 0 ? void 0 : article.url) && (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7768
+ React__default["default"].createElement(SubotInlineIntentRiskScreenerContainer, null,
7769
+ React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature" },
7770
+ React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title })),
7771
+ React__default["default"].createElement("div", { className: "title-container" },
7772
+ React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url },
7773
+ React__default["default"].createElement("h5", { className: "title" }, article === null || article === void 0 ? void 0 : article.title)),
7774
+ React__default["default"].createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "link" },
7775
+ f({
7776
+ id: 'riskScreener.start',
7777
+ defaultMessage: 'Start',
7778
+ }),
7779
+ React__default["default"].createElement(ChevronRight__default["default"], { style: { marginLeft: 10 } }))))))));
7780
+ };
7781
+ //#endregion
7782
+ /*************************** END - NodeIntentType: 'bot-risk-screener' *********/
7783
+ /*******************************************************************************/
7784
+ /*******************************************************************************/
7785
+ /*************************** NodeIntentType: 'bot-related-article' *************/
7786
+ //#region
7787
+ const SubotInlineIntentBotRelatedArticle = ({ intent }) => {
7788
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
7789
+ const article = React.useMemo(() => {
7790
+ if (intent.label && intent.label.includes('{')) {
7791
+ const _article = JSON.parse(intent.label);
7792
+ if (_article.meta) {
7793
+ const tmp = {};
7794
+ _article.meta.map(({ key, value }) => {
7795
+ if (key && value)
7796
+ tmp[key] = value;
7797
+ });
7798
+ _article.meta = Object.assign({}, tmp);
7799
+ }
7800
+ return Object.assign({}, _article);
7801
+ }
7802
+ return {};
7803
+ }, [intent, intent === null || intent === void 0 ? void 0 : intent.label]);
7804
+ return (React__default["default"].createElement(React__default["default"].Fragment, null, !!(article === null || article === void 0 ? void 0 : article.title) &&
7805
+ !!(article === null || article === void 0 ? void 0 : article.thumbnail) &&
7806
+ !!(article === null || article === void 0 ? void 0 : article.url) &&
7807
+ !!(article === null || article === void 0 ? void 0 : article.meta) &&
7808
+ !!((_a = article === null || article === void 0 ? void 0 : article.meta) === null || _a === void 0 ? void 0 : _a.post_modified) &&
7809
+ !!((_b = article === null || article === void 0 ? void 0 : article.meta) === null || _b === void 0 ? void 0 : _b.reviewed_display_name) &&
7810
+ !!((_c = article === null || article === void 0 ? void 0 : article.meta) === null || _c === void 0 ? void 0 : _c.reviewed_url) &&
7811
+ !!((_d = article === null || article === void 0 ? void 0 : article.meta) === null || _d === void 0 ? void 0 : _d.reviewed_avatar_thumbnail) &&
7812
+ !!((_e = article === null || article === void 0 ? void 0 : article.meta) === null || _e === void 0 ? void 0 : _e.category_url) &&
7813
+ !!((_f = article === null || article === void 0 ? void 0 : article.meta) === null || _f === void 0 ? void 0 : _f.category_name) && (React__default["default"].createElement(SubotInlineIntentFinalCol, { width: "40%" },
7814
+ React__default["default"].createElement(moleculesArticleCard.ArticleCard, { title: article === null || article === void 0 ? void 0 : article.title, uploadTime: dayjs__default["default"]((_g = article === null || article === void 0 ? void 0 : article.meta) === null || _g === void 0 ? void 0 : _g.post_modified).format('DD/MM/YYYY'), authorName: (_h = article === null || article === void 0 ? void 0 : article.meta) === null || _h === void 0 ? void 0 : _h.reviewed_display_name, authorLink: (_j = article === null || article === void 0 ? void 0 : article.meta) === null || _j === void 0 ? void 0 : _j.reviewed_url, avatarImg: React__default["default"].createElement("img", { loading: "lazy", src: (_k = article === null || article === void 0 ? void 0 : article.meta) === null || _k === void 0 ? void 0 : _k.reviewed_avatar_thumbnail, alt: (_l = article === null || article === void 0 ? void 0 : article.meta) === null || _l === void 0 ? void 0 : _l.reviewed_display_name }), categoryLink: (_m = article === null || article === void 0 ? void 0 : article.meta) === null || _m === void 0 ? void 0 : _m.category_url, categoryName: (_o = article === null || article === void 0 ? void 0 : article.meta) === null || _o === void 0 ? void 0 : _o.category_name, banner: React__default["default"].createElement("img", { loading: "lazy", src: article === null || article === void 0 ? void 0 : article.thumbnail, alt: article === null || article === void 0 ? void 0 : article.title }), text: "", size: "sm", direction: "vertical" })))));
7815
+ };
7816
+ //#endregion
7817
+ /*************************** END - NodeIntentType: 'bot-related-article' *******/
7818
+ /*******************************************************************************/
7819
+ /*******************************************************************************/
7820
+ /*************************** NodeIntentType: 'thank-you-image' *****************/
7821
+ //#region
7822
+ const SubotInlineIntentThankYouImage = ({ intent, }) => {
7823
+ if (!intent.url)
7824
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7825
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7826
+ React__default["default"].createElement(SubotInlineIntentImageContainer, null,
7827
+ React__default["default"].createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
7828
+ intent.label && (React__default["default"].createElement("h4", { className: "intent-img-label" },
7829
+ React__default["default"].createElement(Markdown, null, intent.label))))));
7830
+ };
7831
+ //#endregion
7832
+ /*************************** END - NodeIntentType: 'thank-you-image' ***********/
7833
+ /*******************************************************************************/
7834
+ /*******************************************************************************/
7835
+ /*************************** NodeIntentType: 'thank-you-title' *****************/
7836
+ //#region
7837
+ const SubotInlineIntentThankYouTitle = ({ intent, }) => {
7838
+ if (!intent.label)
7839
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7840
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7841
+ React__default["default"].createElement(SubotInlineIntentTitle, null,
7842
+ React__default["default"].createElement(Markdown, null, intent.label))));
7843
+ };
7844
+ //#endregion
7845
+ /*************************** END - NodeIntentType: 'thank-you-title' ***********/
7846
+ /*******************************************************************************/
7847
+ /*******************************************************************************/
7848
+ /*************************** NodeIntentType: 'thank-you-body' ******************/
7849
+ //#region
7850
+ const SubotInlineIntentThankYouBody = ({ intent, }) => {
7851
+ if (!intent.label)
7852
+ return React__default["default"].createElement(React__default["default"].Fragment, null);
7853
+ return (React__default["default"].createElement(SubotInlineIntentFinalCol, null,
7854
+ React__default["default"].createElement("div", { className: "intents__item markdown" },
7855
+ React__default["default"].createElement(Markdown, null, intent.label))));
7856
+ };
7857
+ //#endregion
7858
+ /*************************** END - NodeIntentType: 'thank-you-body' ************/
7859
+ /*******************************************************************************/
7860
+ const SubotInlineIntentBase = {
7861
+ [index$2.NodeIntentType.BOT_TEXT]: SubotInlineIntentBotText,
7862
+ [index$2.NodeIntentType.BOT_IMAGE]: SubotInlineIntentBotImage,
7863
+ [index$2.NodeIntentType.BOT_BUTTON]: SubotInlineIntentBotButton,
7864
+ [index$2.NodeIntentType.BOT_URL]: SubotInlineIntentUrl,
7865
+ [index$2.NodeIntentType.BOT_RECALCULATE]: SubotInlineIntentBotRecalculate,
7866
+ [index$2.NodeIntentType.BOT_MAIN_TITLE]: SubotInlineIntentBotMainTitle,
7867
+ [index$2.NodeIntentType.BOT_MAIN_IMAGE]: SubotInlineIntentBotMainImage,
7868
+ [index$2.NodeIntentType.BOT_MAIN_BODY]: SubotInlineIntentBotMainBody,
7869
+ [index$2.NodeIntentType.BOT_MAIN_BUTTON]: SubotInlineIntentBotMainButton,
7870
+ [index$2.NodeIntentType.BOT_SUB_TITLE]: SubotInlineIntentBotMainTitle,
7871
+ [index$2.NodeIntentType.BOT_SUB_BODY]: SubotInlineIntentBotMainBody,
7872
+ [index$2.NodeIntentType.BOT_LANDING_PAGE_URL]: SubotInlineIntentBotText,
7873
+ [index$2.NodeIntentType.BOT_LANDING_PAGE_BUTTON]: SubotInlineIntentBotText,
7874
+ [index$2.NodeIntentType.BOT_RISK_SCREEN]: SubotInlineIntentBotRiskScreener,
7875
+ [index$2.NodeIntentType.BOT_RELATED_ARTICLE]: SubotInlineIntentBotRelatedArticle,
7876
+ [index$2.NodeIntentType.THANK_YOU_IMAGE]: SubotInlineIntentThankYouImage,
7877
+ [index$2.NodeIntentType.THANK_YOU_TITLE]: SubotInlineIntentThankYouTitle,
7878
+ [index$2.NodeIntentType.THANK_YOU_BODY]: SubotInlineIntentThankYouBody,
7879
+ /** intents fake for sso block */
7880
+ [index$2.NodeIntentType.SSO_INTENT]: SubotInlineIntentSSO,
7881
+ };
7882
+
7883
+ /***************** type: TEXT, IMAGE ***************/
7884
+ const SubotInlineNode = ({ node, indexNumber, }) => {
7885
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
7886
+ const { params, onChange, onSubmit, onPrev, onNext, nodes, activeId } = React.useContext(SubotInlineContext);
7887
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
7888
+ const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
7889
+ const _message = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(nodes, activeId, action.id));
7890
+ delete _message.form_submit_meta;
7891
+ const res = yield subotInlineMessage(_message);
7892
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
7893
+ const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
7894
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
7895
+ delete _nextNode._message.form_submit_meta;
7896
+ onSubmit && onSubmit(_nextNode, _message);
7897
+ }
7898
+ });
7899
+ const handleOnChange = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
7900
+ if (!action)
7901
+ return;
7902
+ const actionWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
7903
+ (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
7904
+ const newValue = Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: formSubmitMeta });
7905
+ if (actionWithOther) {
7906
+ setValue(newValue);
7907
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
7908
+ return;
7909
+ }
7910
+ delete newValue.form_submit_meta;
7911
+ setValue(newValue);
7912
+ handleOnChangeNormal(action);
7913
+ });
7914
+ const handleOnNext = () => {
7915
+ const newMessage = JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value)));
7916
+ if ((value === null || value === void 0 ? void 0 : value.action_id) &&
7917
+ (value === null || value === void 0 ? void 0 : value.action_value) === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD) {
7918
+ onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
7919
+ return;
7920
+ }
7921
+ if (!(value === null || value === void 0 ? void 0 : value.action_id) || !(value === null || value === void 0 ? void 0 : value.action_value)) {
7922
+ pushNotifications({
7923
+ title: '',
7924
+ message: f({
7925
+ id: 'multiSelectError.required',
7926
+ defaultMessage: `There is no answer!`,
7927
+ }),
7928
+ type: 'warning', // "success" | "danger" | "info" | "warning"
7929
+ });
7930
+ }
7931
+ else {
7932
+ delete newMessage.form_submit_meta;
7933
+ onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
7934
+ }
7935
+ };
7936
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
7937
+ React__default["default"].createElement(SubotInlineHeader$1, null),
7938
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
7939
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
7940
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
7941
+ React__default["default"].createElement(SubotInlineActionContainer, null,
7942
+ React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange, formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
7943
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
7944
+ };
7945
+
7946
+ const SubotInlineNodeFinal = ({ node, }) => {
7947
+ var _a, _b;
7948
+ const fixHeight = 350;
7949
+ const { nodes } = React.useContext(SubotInlineContext);
7950
+ const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
7951
+ const flag = React.useRef(null);
7952
+ const wrapper = React.useRef(null);
7953
+ const [height, setHeight] = React.useState(fixHeight);
7954
+ const [showMore, setShowMore] = React.useState(true);
7955
+ const [isMore, setIsMore] = React.useState(false);
7956
+ const handleOnClick = React.useCallback(() => {
7957
+ fastdom.measure(() => {
7958
+ var _a;
7959
+ if (wrapper.current) {
7960
+ const wrapperHeight = (_a = wrapper.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
7961
+ if (height && height < wrapperHeight) {
7962
+ setHeight(wrapperHeight);
7963
+ setIsMore(true);
7964
+ }
7965
+ else {
7966
+ setHeight(fixHeight);
7967
+ setIsMore(false);
7968
+ }
7969
+ flag.current &&
7970
+ flag.current.scrollIntoView({
7971
+ behavior: 'smooth',
7972
+ block: 'start',
7973
+ inline: 'start',
7974
+ });
7975
+ }
7976
+ });
7977
+ }, [height]);
7978
+ React.useLayoutEffect(() => {
7979
+ fastdom.measure(() => {
7980
+ if (wrapper.current) {
7981
+ setTimeout(() => {
7982
+ var _a;
7983
+ const wrapperHeight = (_a = wrapper.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
7984
+ if (wrapperHeight && height > wrapperHeight) {
7985
+ setShowMore(false);
7986
+ setIsMore(false);
7987
+ }
7988
+ }, 400);
7989
+ }
7990
+ });
7991
+ }, []);
7992
+ const botItem = nodes[0];
7993
+ const botType = (_a = botItem === null || botItem === void 0 ? void 0 : botItem.extra_settings) === null || _a === void 0 ? void 0 : _a.subot_type;
7994
+ const suggestedServiceIntents = React.useMemo(() => {
7995
+ var _a;
7996
+ return (((_a = node === null || node === void 0 ? void 0 : node.intents) === null || _a === void 0 ? void 0 : _a.filter((i) => i.type === index$2.NodeIntentType.BOT_SUGGESTED_SERVICE)) || []);
7997
+ }, []);
7998
+ return (React__default["default"].createElement(SubotInlineFinalContainer, null,
7999
+ React__default["default"].createElement("div", { ref: flag, className: "hhg-flag", style: {
8000
+ position: 'absolute',
8001
+ top: -100,
8002
+ left: 0,
8003
+ pointerEvents: 'none',
8004
+ } }),
8005
+ React__default["default"].createElement(SubotInlineFinalWrapper, { maxHeight: height, isMore: isMore },
8006
+ React__default["default"].createElement("div", { ref: wrapper },
8007
+ React__default["default"].createElement(SubotInlineIntentFinal, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [] }),
8008
+ suggestedServiceIntents.length > 0 && (React__default["default"].createElement("div", null, suggestedServiceIntents.map((intent) => {
8009
+ const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
8010
+ return (NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent }));
8011
+ }))))),
8012
+ showMore && (React__default["default"].createElement(SubotInlineFinalMoreContainer, null,
8013
+ React__default["default"].createElement(SubotInlineFinalButton, { size: "md", color: "secondary", onClick: handleOnClick }, !isMore ? (React__default["default"].createElement(React__default["default"].Fragment, null,
8014
+ f({ id: 'subotInline.showMore', defaultMessage: 'Show more' }),
8015
+ React__default["default"].createElement(ArrowDown__default["default"], { style: { marginLeft: 10 } }))) : (React__default["default"].createElement(React__default["default"].Fragment, null,
8016
+ f({ id: 'subotInline.showLess', defaultMessage: 'Show less' }),
8017
+ React__default["default"].createElement(ArrowUp__default["default"], { style: { marginLeft: 10 } })))))),
8018
+ botType === index$2.SubotType.voucherAcuvue && (React__default["default"].createElement(SubotInlineVoucherLeftUI, { clientId: (_b = botItem.extra_settings) === null || _b === void 0 ? void 0 : _b.client_id, voucherAnswers: extractVoucherAnswers(nodes, botItem) }))));
8019
+ };
8020
+
8021
+ const SubotInlineResultButton = styled__default["default"].span `
8022
+ display: inline-block;
8023
+ margin-top: 20px;
8024
+ color: ${miscTheme.theme.colors.primaryBase || '#2D87F3'};
8025
+ cursor: pointer;
8026
+ transition: 0.3 all ease;
8027
+ &:hover {
8028
+ color: ${miscTheme.theme.colors.primaryHover || '#2D87F3'};
8029
+ }
8030
+ ${utils.MediaQueries.tdDown} {
8031
+ margin-top: 16px;
8032
+ }
8033
+ ${utils.MediaQueries.mbDown} {
8034
+ margin-top: 12px;
8035
+ }
8036
+ `;
8037
+ const SubotInlineWrapper = styled__default["default"].div `
8038
+ max-width: 430px;
8039
+ margin-right: auto;
8040
+ margin-left: auto;
8041
+ `;
8042
+ const SubotInlineContainer = styled__default["default"].div `
8043
+ padding: 44px 16px 32px;
8044
+ background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
8045
+ border-radius: ${miscTheme.theme.borderRadius};
8046
+ position: relative;
8047
+ text-align: center;
8048
+ ${utils.MediaQueries.tdDown} {
8049
+ padding: 36px 16px 24px;
8050
+ }
8051
+ ${utils.MediaQueries.mbDown} {
8052
+ padding: 16px;
8053
+ border-radius: 0px;
8054
+ }
8055
+ `;
8056
+ const SubotInlineNodeFinalThankYou = ({ node, }) => {
8057
+ var _a;
8058
+ const { params, onNext } = React.useContext(SubotInlineContext);
8059
+ const resultButton = React.useMemo(() => {
8060
+ var _a;
8061
+ const _resultButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.RESULT_BUTTON);
8062
+ if (_resultButton)
8063
+ return _resultButton;
8064
+ return null;
8065
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8066
+ const handleOnNext = React.useCallback(() => {
8067
+ onNext &&
8068
+ onNext(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), { action_id: resultButton === null || resultButton === void 0 ? void 0 : resultButton.id, action_value: resultButton === null || resultButton === void 0 ? void 0 : resultButton.key }));
8069
+ }, [resultButton]);
8070
+ return (React__default["default"].createElement(SubotInlineContainer, null,
8071
+ React__default["default"].createElement(SubotInlineWrapper, null, (_a = node === null || node === void 0 ? void 0 : node.intents) === null || _a === void 0 ? void 0 :
8072
+ _a.map((intent) => {
8073
+ const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
8074
+ return NodeIntent && React__default["default"].createElement(NodeIntent, { key: intent.id, intent: intent });
8075
+ }),
8076
+ resultButton && (React__default["default"].createElement(SubotInlineResultButton, { onClick: handleOnNext }, resultButton === null || resultButton === void 0 ? void 0 : resultButton.label)))));
8077
+ };
8078
+
8079
+ const SubotInlineNodeForm = ({ node, indexNumber, }) => {
8080
+ var _a;
8081
+ const { data: { locale }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8082
+ const { params, onPrev, onSubmit, trackingCommonInline, nodes, activeId } = React.useContext(SubotInlineContext);
8083
+ const handleSubmit = (data) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8084
+ const res = yield subotInlineMessage(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node._message), data), getCurrentTotalDynamicScore(nodes, activeId, data.action_id, data.form_submit_meta)));
8085
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8086
+ const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
8087
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8088
+ onSubmit && onSubmit(_nextNode, Object.assign(Object.assign({}, node._message), data));
8089
+ }
8090
+ });
8091
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8092
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8093
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8094
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8095
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8096
+ React__default["default"].createElement(SubotInlineFormContainer, null,
8097
+ React__default["default"].createElement(UserInfoForm, { botId: params.bot_id, nodeId: String(node === null || node === void 0 ? void 0 : node.id), className: "form", actions: (node === null || node === void 0 ? void 0 : node.actions) || [], formSubmitMeta: ((_a = node === null || node === void 0 ? void 0 : node._message) === null || _a === void 0 ? void 0 : _a.form_submit_meta) || null, callBack: handleSubmit, countryCode: (locale === null || locale === void 0 ? void 0 : locale.split('-')[1]) || 'PH', trackingSubmitBtn: Object.assign(Object.assign({}, trackingCommonInline), { 'data-event-action': 'Submit' }) }))),
8098
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
8099
+ };
8100
+
8101
+ const SubotInlineNodeImage = ({ node, indexNumber, }) => {
8102
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8103
+ const { params, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
8104
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8105
+ const handleOnChange = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8106
+ if (action) {
8107
+ setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
8108
+ const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
8109
+ const res = yield subotInlineMessage(_message);
8110
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8111
+ const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
8112
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8113
+ onSubmit && onSubmit(_nextNode, _message);
8114
+ }
8115
+ }
8116
+ });
8117
+ const handleOnNext = () => {
8118
+ var _a;
8119
+ if (!(node === null || node === void 0 ? void 0 : node._message) || !((_a = node._message) === null || _a === void 0 ? void 0 : _a.action_id)) {
8120
+ pushNotifications({
8121
+ title: '',
8122
+ message: f({
8123
+ id: 'multiSelectError.required',
8124
+ defaultMessage: `There is no answer!`,
8125
+ }),
8126
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8127
+ });
8128
+ }
8129
+ else {
8130
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8131
+ }
8132
+ };
8133
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8134
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8135
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8136
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8137
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8138
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8139
+ React__default["default"].createElement(SubotInlineAction, { node_type: node === null || node === void 0 ? void 0 : node.type, value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange }))),
8140
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
8141
+ };
8142
+
8143
+ const SubotInlineNodeMultiple = ({ node, indexNumber, }) => {
8144
+ const { params, onChange, onPrev, onNext } = React.useContext(SubotInlineContext);
8145
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8146
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8147
+ const submitButton = React.useMemo(() => {
8148
+ var _a;
8149
+ const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.ACTION_MULTIPLE_BUTTON);
8150
+ if (_submitButton)
8151
+ return _submitButton;
8152
+ return null;
8153
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8154
+ const activeActions = React.useMemo(() => {
8155
+ if (value === null || value === void 0 ? void 0 : value.selected_actions) {
8156
+ return Object.keys(value === null || value === void 0 ? void 0 : value.selected_actions);
8157
+ }
8158
+ return [];
8159
+ }, [value, value === null || value === void 0 ? void 0 : value.selected_actions]);
8160
+ const validateSelectActions = (selected_actions, callBack) => {
8161
+ const activeActions = Object.keys(selected_actions);
8162
+ if (!activeActions.length) {
8163
+ pushNotifications({
8164
+ title: '',
8165
+ message: f({
8166
+ id: 'multiSelectError.required',
8167
+ defaultMessage: `There is no answer!`,
8168
+ }),
8169
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8170
+ });
8171
+ return;
8172
+ }
8173
+ else if ((node === null || node === void 0 ? void 0 : node.multi_select_option) === index$2.NodeMultipleOptions.RANGE &&
8174
+ activeActions.length < (node === null || node === void 0 ? void 0 : node.from)) {
8175
+ pushNotifications({
8176
+ title: '',
8177
+ message: f({
8178
+ id: 'multiSelectError.range',
8179
+ defaultMessage: 'You must choose from {from} to {to} answers (Ex: You must choose from 3 to 5 answers)',
8180
+ }, {
8181
+ from: node.from,
8182
+ to: node.to,
8183
+ }),
8184
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8185
+ });
8186
+ return;
8187
+ }
8188
+ else if ((node === null || node === void 0 ? void 0 : node.multi_select_option) === index$2.NodeMultipleOptions.EXACT_NUMBER &&
8189
+ activeActions.length !== (node === null || node === void 0 ? void 0 : node.from)) {
8190
+ pushNotifications({
8191
+ message: f({
8192
+ id: 'multiSelectError.exactNumber',
8193
+ defaultMessage: 'You must choose {from} answers.',
8194
+ }, {
8195
+ from: node.from,
8196
+ }),
8197
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8198
+ });
8199
+ return;
8200
+ }
8201
+ else {
8202
+ callBack();
8203
+ }
8204
+ };
8205
+ const handleOnClick = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8206
+ var _a, _b;
8207
+ if (action) {
8208
+ const _value = JSON.parse(JSON.stringify(Object.assign(Object.assign({}, value), { action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, selected_actions: Object.assign({}, value === null || value === void 0 ? void 0 : value.selected_actions) })));
8209
+ if ((action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT ||
8210
+ (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT) {
8211
+ const isExistedPoll = (_value === null || _value === void 0 ? void 0 : _value.selected_actions) && action.id in _value.selected_actions;
8212
+ if (isExistedPoll) {
8213
+ if (formSubmitMeta) {
8214
+ _value.form_submit_meta = formSubmitMeta;
8215
+ }
8216
+ else {
8217
+ delete _value.form_submit_meta;
8218
+ (_a = _value.selected_actions) === null || _a === void 0 ? true : delete _a[action.id];
8219
+ }
8220
+ }
8221
+ else {
8222
+ if (action === null || action === void 0 ? void 0 : action.id) {
8223
+ _value.selected_actions = Object.assign(Object.assign({}, _value.selected_actions), { [action.id]: action.key || '' });
8224
+ }
8225
+ }
8226
+ setValue(_value);
8227
+ onChange === null || onChange === void 0 ? void 0 : onChange(_value);
8228
+ return;
8229
+ }
8230
+ if (!((_b = _value.selected_actions) === null || _b === void 0 ? void 0 : _b[action.id])) {
8231
+ _value.selected_actions = Object.assign(Object.assign({}, _value.selected_actions), { [action.id]: action.key || '' });
8232
+ onChange && onChange(_value);
8233
+ setValue(_value);
8234
+ return;
8235
+ }
8236
+ if (_value.selected_actions[action.id]) {
8237
+ delete _value.selected_actions[action.id];
8238
+ onChange && onChange(_value);
8239
+ setValue(_value);
8240
+ return;
8241
+ }
8242
+ }
8243
+ });
8244
+ const handleOnNext = React.useCallback(() => {
8245
+ validateSelectActions((value === null || value === void 0 ? void 0 : value.selected_actions) || {}, () => {
8246
+ onNext &&
8247
+ onNext(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value), { node_id: node.id }));
8248
+ });
8249
+ }, [value, value === null || value === void 0 ? void 0 : value.selected_actions, onNext]);
8250
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8251
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8252
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8253
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8254
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8255
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8256
+ React__default["default"].createElement(SubotInlineAction, { value: activeActions, actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnClick, htmlType: "checkbox", formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
8257
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8258
+ };
8259
+
8260
+ const OTPInfoForm = ({ className, style, actions, countryCode, phoneNumber, areaCode,
8261
+ // verified,
8262
+ callBack, }) => {
8263
+ const countRef = React.useRef();
8264
+ const [isFinishedCountDown, setIsFinishedCountDown] = React.useState(false);
8265
+ const [isLoading, setIsLoading] = React.useState(false);
8266
+ const [isLoadingVerify, setIsLoadingVerify] = React.useState(false);
8267
+ const [sentOTP, setSentOTP] = React.useState(false);
8268
+ const { register, formState: { errors }, control, trigger, getValues, setValue, } = reactHookForm.useForm();
8269
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8270
+ // useEffect(() => {
8271
+ // const actionPhone = actions.find(
8272
+ // (action) => action.type === NodeActionType.USER_SUBMIT_PHONE,
8273
+ // )
8274
+ // actionPhone?.key && setValue(actionPhone.key, '+84343261825')
8275
+ // setSentOTP(true)
8276
+ // }, [])
8277
+ // const placeholderPhone = useMemo(() => {
8278
+ // return actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_PHONE)
8279
+ // ?.label
8280
+ // }, [actions])
8281
+ // const placeholderOtp = useMemo(() => {
8282
+ // return actions.find(
8283
+ // ({ type }) => type === NodeActionType.USER_SUBMIT_NUMBER,
8284
+ // )?.label
8285
+ // }, [actions])
8286
+ // const labelBtnSendOtp = 'Gửi mã OTP'
8287
+ // const labelBtnVerifyOtp = useMemo(() => {
8288
+ // return (
8289
+ // actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_SEND)
8290
+ // ?.label || 'Xác minh mã OTP'
8291
+ // )
8292
+ // }, [actions])
8293
+ // const labelBtnResendOtp = useMemo(() => {
8294
+ // return (
8295
+ // actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_RESEND)
8296
+ // ?.label || 'Gửi lại mã OTP'
8297
+ // )
8298
+ // }, [actions])
8299
+ const handleSendOTP = (event) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8300
+ var _a;
8301
+ event.preventDefault();
8302
+ const data = getValues();
8303
+ const parsedPhone = PhoneInputBase.parsePhoneNumber(data.phone || '');
8304
+ if (!(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.nationalNumber) || !(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.countryCallingCode)) {
8305
+ return;
8306
+ }
8307
+ setIsLoading(true);
8308
+ try {
8309
+ const result = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.POST_SEND_OTP), 'POST', {
8310
+ data: {
8311
+ phone_number: parsedPhone.nationalNumber,
8312
+ area_code: `+${parsedPhone.countryCallingCode}`,
8313
+ },
8314
+ });
8315
+ setIsLoading(false);
8316
+ if ((result === null || result === void 0 ? void 0 : result._status) === 1) {
8317
+ if (sentOTP) {
8318
+ setIsFinishedCountDown(false);
8319
+ countRef.current.reset();
8320
+ }
8321
+ setSentOTP(true);
8322
+ setTimeout(() => {
8323
+ const input = document.querySelector('.input-otp-code');
8324
+ if (input) {
8325
+ input.focus();
8326
+ input.scrollIntoView({ block: 'center' });
8327
+ }
8328
+ }, 100);
8329
+ return;
8330
+ }
8331
+ if ((result === null || result === void 0 ? void 0 : result._status) === 0 &&
8332
+ ((_a = result === null || result === void 0 ? void 0 : result._messages) === null || _a === void 0 ? void 0 : _a[0]) === 'This phone number was verified') {
8333
+ // const { _messages } = result
8334
+ if (countRef.current) {
8335
+ countRef.current.cancel();
8336
+ }
8337
+ pushNotifications({
8338
+ title: '',
8339
+ message: 'Số điện thoại này đã được xác minh.',
8340
+ type: 'success',
8341
+ });
8342
+ const action = actions.find((action) => action.type === index$2.NodeActionType.USER_SUBMIT_SEND);
8343
+ action && callBack(action, data.phone);
8344
+ return;
8345
+ }
8346
+ throw new Error();
8347
+ }
8348
+ catch (error) {
8349
+ setIsLoading(false);
8350
+ if (countRef.current) {
8351
+ countRef.current.cancel();
8352
+ }
8353
+ showMessageSomethingWrong();
8354
+ }
8355
+ });
8356
+ const handleOnVerify = (event, action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8357
+ event.preventDefault();
8358
+ setIsLoadingVerify(true);
8359
+ yield trigger();
8360
+ if (isEmpty__default["default"](errors)) {
8361
+ const data = getValues();
8362
+ const { number } = data;
8363
+ const parsedPhone = PhoneInputBase.parsePhoneNumber(data.phone || '');
8364
+ if (!(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.nationalNumber) || !(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.countryCallingCode)) {
8365
+ return;
8366
+ }
8367
+ try {
8368
+ const result = yield togetherComponentGlobalContext.callApi(getSubotApiPath(PATHS$1.POST_VERIFY_OTP), 'POST', {
8369
+ data: {
8370
+ phone_number: parsedPhone.nationalNumber,
8371
+ area_code: `+${parsedPhone.countryCallingCode}`,
8372
+ code: number,
8373
+ },
8374
+ });
8375
+ setIsLoadingVerify(false);
8376
+ if ((result === null || result === void 0 ? void 0 : result._status) === 1) {
8377
+ pushNotifications({
8378
+ title: '',
8379
+ message: f({ id: 'subot.verifyOTP.success.message' }),
8380
+ type: 'success',
8381
+ });
8382
+ callBack(action, data.phone);
8383
+ return;
8384
+ }
8385
+ throw new Error();
8386
+ }
8387
+ catch (error) {
8388
+ pushNotifications({
8389
+ title: '',
8390
+ message: f({ id: 'validation.error.validOTP' }),
8391
+ type: 'danger',
8392
+ });
8393
+ setIsLoadingVerify(false);
8394
+ }
8395
+ }
8396
+ else {
8397
+ setIsLoadingVerify(false);
8398
+ }
8399
+ });
8400
+ const showMessageSomethingWrong = () => {
8401
+ pushNotifications({
8402
+ title: '',
8403
+ message: f({ id: 'notification.comment.somethingWrong' }),
8404
+ type: 'danger',
8405
+ });
8406
+ };
8407
+ const renderFormInput = (action) => {
8408
+ if (!action.key) {
8409
+ return null;
8410
+ }
8411
+ switch (action.type) {
8412
+ case index$2.NodeActionType.USER_SUBMIT_PHONE:
8413
+ return (React__default["default"].createElement("div", { className: "input-row", key: action.id },
8414
+ React__default["default"].createElement("label", { htmlFor: action.key }, action.label),
8415
+ React__default["default"].createElement(reactHookForm.Controller, { name: action.key, control: control, rules: {
8416
+ required: true,
8417
+ validate: (value) => PhoneInputBase.isPossiblePhoneNumber(value),
8418
+ }, render: ({ field: { onChange, value } }) => {
8419
+ const disabledPhone = (!isFinishedCountDown && sentOTP) || isLoading;
8420
+ return (React__default["default"].createElement(StyleWrapperPhoneInput, null,
8421
+ React__default["default"].createElement(PhoneInputWithCode, { value: value, defaultValue: phoneNumber, onChange: onChange, defaultCountry: countryCode, id: action.id, className: `input-row ${action.id}`, name: action.key, disabled: disabledPhone, flagComponent: FlagComponent, placeholder: action.label }),
8422
+ disabledPhone && (React__default["default"].createElement(IconEdit, { viewBox: "0 0 24 24", className: "icon-edit-phone", onClick: () => {
8423
+ var _a;
8424
+ onChange('');
8425
+ setSentOTP(false);
8426
+ setIsLoadingVerify(false);
8427
+ (_a = countRef.current) === null || _a === void 0 ? void 0 : _a.cancel();
8428
+ } })),
8429
+ action.key && errors[action.key] && (React__default["default"].createElement("p", { className: "error-message" }, f({
8430
+ id: 'validation.error.validNumber',
8431
+ defaultMessage: 'Please enter a valid number.',
8432
+ }))),
8433
+ React__default["default"].createElement("div", { className: "submit-btn-row", key: action.id },
8434
+ React__default["default"].createElement(index$8.Button, { className: "submit-btn", size: "lg", onClick: handleSendOTP, isDisabled: (!isFinishedCountDown && sentOTP) || isLoading, isLoading: isLoading }, sentOTP ? (React__default["default"].createElement(CountDown$1, { ref: countRef, isFinished: isFinishedCountDown, onFinish: setIsFinishedCountDown })) : (React__default["default"].createElement("span", null, f({
8435
+ id: 'subot.sendOTP.button',
8436
+ defaultMessage: 'Send OTP',
8437
+ })))))));
8438
+ } })));
8439
+ case index$2.NodeActionType.USER_SUBMIT_NUMBER:
8440
+ if (!sentOTP) {
8441
+ return '';
8442
+ }
8443
+ return (React__default["default"].createElement("div", { className: "input-row", key: action.id },
8444
+ React__default["default"].createElement("label", { htmlFor: action.key }, action.label),
8445
+ React__default["default"].createElement("input", Object.assign({ type: "tel", id: action.id, placeholder: action.label }, register(action.key, {
8446
+ required: true,
8447
+ pattern: /^[0-9]{0,6}$/,
8448
+ }), { className: "input-otp-code" })),
8449
+ errors[action.key] && (React__default["default"].createElement("p", { className: "error-message" }, f({
8450
+ id: 'validation.error.validOTP',
8451
+ defaultMessage: 'Invalid OTP provided',
8452
+ })))));
8453
+ default:
8454
+ return '';
8455
+ }
8456
+ };
8457
+ const renderFormSubmitAndTerms = (action) => {
8458
+ switch (action.type) {
8459
+ case index$2.NodeActionType.USER_SUBMIT_SEND:
8460
+ if (!sentOTP)
8461
+ return '';
8462
+ return (React__default["default"].createElement("div", { className: "submit-btn-row", key: action.id },
8463
+ React__default["default"].createElement(index$8.Button, { className: "submit-btn", size: "lg", isDisabled: isLoadingVerify, isLoading: isLoadingVerify, onClick: (event) => handleOnVerify(event, action) }, action.label)));
8464
+ default:
8465
+ return '';
8466
+ }
8467
+ };
8468
+ React.useEffect(() => {
8469
+ if (phoneNumber) {
8470
+ const action = actions.find((action) => action.type === index$2.NodeActionType.USER_SUBMIT_PHONE);
8471
+ if (action && action.key) {
8472
+ setValue(action.key, `+${areaCode}${phoneNumber}`);
8473
+ }
8474
+ }
8475
+ }, [phoneNumber, areaCode]);
8476
+ return (React__default["default"].createElement(StyledUserInfoFormContainer$1, { className: className, style: style },
8477
+ React__default["default"].createElement("form", { className: "user-info-form" },
8478
+ actions.map((action) => renderFormInput(action)),
8479
+ actions.map((action) => renderFormSubmitAndTerms(action)))));
8480
+ };
8481
+
8482
+ const useVerifyPhoneNumber = () => {
8483
+ const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
8484
+ const [verifiedPhone, setVerifiedPhone] = React.useState(false);
8485
+ React.useEffect(() => {
8486
+ if (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone) {
8487
+ if (userInfo.phone_verified_at && userInfo.verify_phone_code) {
8488
+ setVerifiedPhone(true);
8489
+ }
8490
+ }
8491
+ }, [userInfo]);
8492
+ return verifiedPhone;
8493
+ };
8494
+
8495
+ const SubotInlineNodeOTP = ({ node, indexNumber, }) => {
8496
+ const { params, onPrev, onNext } = React.useContext(SubotInlineContext);
8497
+ const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
8498
+ const locale = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.locale;
8499
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8500
+ const verifiedPhone = useVerifyPhoneNumber();
8501
+ const handleOnVerify = (action, phoneNumber) => {
8502
+ var _a;
8503
+ const actionPhone = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.USER_SUBMIT_PHONE);
8504
+ if (!action || !actionPhone) {
8505
+ return;
8506
+ }
8507
+ const form_submit_meta = [
8508
+ {
8509
+ key: String(actionPhone.key),
8510
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[index$2.NodeActionType.USER_SUBMIT_PHONE],
8511
+ value: phoneNumber,
8512
+ },
8513
+ ];
8514
+ const newValue = Object.assign(Object.assign({}, value), { form_submit_meta, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
8515
+ setValue(newValue);
8516
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), newValue), node === null || node === void 0 ? void 0 : node._message));
8517
+ };
8518
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8519
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8520
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8521
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8522
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8523
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8524
+ React__default["default"].createElement(OTPInfoForm, { phoneNumber: userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone, verified: verifiedPhone, areaCode: userInfo === null || userInfo === void 0 ? void 0 : userInfo.area_code, callBack: handleOnVerify, actions: (node === null || node === void 0 ? void 0 : node.actions) || [], countryCode: (locale === null || locale === void 0 ? void 0 : locale.split('-')[1]) || 'PH' }))),
8525
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
8526
+ };
8527
+
8528
+ // Poll Message
8529
+ // {
8530
+ // form_meta: [
8531
+ // { key: "poll4", control: "formmeta", value: "", action_id: "action.id" },
8532
+ // { key: "poll2", control: "formmeta", value: "", action_id: "action.id" },
8533
+ // { key: "poll3", control: "formmeta", value: "", action_id: "action.id" },
8534
+ // { key: 'attribite-description', control:"formmeta-description", value: '', action_id: "action.id"}
8535
+ // ],
8536
+ // action_id: "button_id",
8537
+ // action_value: "button_attribute"
8538
+ // }
8539
+ const SubotInlineNodePoll = ({ node, indexNumber, }) => {
8540
+ var _a, _b;
8541
+ const { params, onChange, onPrev, onNext } = React.useContext(SubotInlineContext);
8542
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8543
+ const validation = useValidationMultiOption();
8544
+ const descriptionNode = useDescriptionPollNode({ node });
8545
+ const submitButton = React.useMemo(() => {
8546
+ var _a;
8547
+ const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.POLL_BUTTON);
8548
+ if (_submitButton)
8549
+ return _submitButton;
8550
+ return null;
8551
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8552
+ const handleOnChange = (action, formSubmitMeta) => {
8553
+ var _a, _b, _c, _d, _e, _f, _g;
8554
+ const newValue = JSON.parse(JSON.stringify(Object.assign(Object.assign({}, value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: [...((value === null || value === void 0 ? void 0 : value.form_submit_meta) || [])] })));
8555
+ if ((action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT ||
8556
+ (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT) {
8557
+ const isExistedPoll = (_a = newValue.form_submit_meta) === null || _a === void 0 ? void 0 : _a.some(({ action_id }) => action_id === action.id);
8558
+ if (isExistedPoll) {
8559
+ newValue.form_submit_meta =
8560
+ typeof formSubmitMeta === 'undefined'
8561
+ ? (_b = newValue.form_submit_meta) === null || _b === void 0 ? void 0 : _b.filter(({ action_id }) => action_id !== action.id)
8562
+ : (_c = newValue.form_submit_meta) === null || _c === void 0 ? void 0 : _c.filter(({ action_id }) => action_id !== action.id).concat(formSubmitMeta);
8563
+ }
8564
+ else {
8565
+ newValue.form_submit_meta = (_d = newValue.form_submit_meta) === null || _d === void 0 ? void 0 : _d.concat([
8566
+ {
8567
+ key: action === null || action === void 0 ? void 0 : action.key,
8568
+ control: index$2.ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type] || 'text',
8569
+ value: '',
8570
+ action_id: action === null || action === void 0 ? void 0 : action.id,
8571
+ },
8572
+ ]);
8573
+ }
8574
+ setValue(newValue);
8575
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8576
+ return;
8577
+ }
8578
+ const isPoll = (_e = newValue.form_submit_meta) === null || _e === void 0 ? void 0 : _e.some(({ action_id }) => action_id === (action === null || action === void 0 ? void 0 : action.action_id));
8579
+ if (isPoll) {
8580
+ newValue.form_submit_meta = (_f = newValue.form_submit_meta) === null || _f === void 0 ? void 0 : _f.filter(({ action_id }) => action_id !== (action === null || action === void 0 ? void 0 : action.action_id));
8581
+ }
8582
+ else {
8583
+ newValue.form_submit_meta = (_g = newValue.form_submit_meta) === null || _g === void 0 ? void 0 : _g.concat([action]);
8584
+ }
8585
+ setValue(newValue);
8586
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8587
+ };
8588
+ const activeActions = React.useMemo(() => {
8589
+ if (value === null || value === void 0 ? void 0 : value.form_submit_meta) {
8590
+ return value === null || value === void 0 ? void 0 : value.form_submit_meta.map(({ action_id }) => action_id);
8591
+ }
8592
+ return [];
8593
+ }, [value, value === null || value === void 0 ? void 0 : value.form_submit_meta]);
8594
+ const handleOnNext = () => {
8595
+ const tmp = {};
8596
+ if (value.form_submit_meta && value.form_submit_meta.length) {
8597
+ tmp[node.id] = value.form_submit_meta.map((_v) => _v.action_id);
8598
+ }
8599
+ const newValue = Object.assign(Object.assign({}, value), { current_polls: tmp });
8600
+ validation.validateSelectActions(activeActions, node, () => {
8601
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), newValue));
8602
+ });
8603
+ };
8604
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8605
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8606
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8607
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8608
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8609
+ React__default["default"].createElement(SubotInlineDescription$1, null, descriptionNode),
8610
+ React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.POLL_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
8611
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8612
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, active: activeActions.includes(action.id), action: action, onChange: handleOnChange, htmlType: "checkbox", formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta })));
8613
+ }))))),
8614
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8615
+ };
8616
+
8617
+ // Rating Message
8618
+ // {
8619
+ // form_meta: [
8620
+ // { key: "action.key", control: "star", value: "", action_id: 'action.id' },
8621
+ // { key: 'action.key', control: "text", value: '', action_id: 'action.id' }
8622
+ // ],
8623
+ // action_id: "button_id",
8624
+ // action_value: "button_attribute"
8625
+ // }
8626
+ const SubotInlineNodeRating = ({ node, indexNumber, }) => {
8627
+ var _a, _b;
8628
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8629
+ const { params, onChange, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
8630
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8631
+ const [isSubmit, setIsSubmit] = React.useState(false);
8632
+ const ratingStarValue = React.useMemo(() => {
8633
+ var _a;
8634
+ const _ratingStar = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === index$2.NodeActionType.RATING_STAR);
8635
+ if (value.form_submit_meta && _ratingStar) {
8636
+ const formIndex = value === null || value === void 0 ? void 0 : value.form_submit_meta.findIndex(({ action_id }) => action_id === (_ratingStar === null || _ratingStar === void 0 ? void 0 : _ratingStar.id));
8637
+ if (formIndex !== -1)
8638
+ return parseInt(value === null || value === void 0 ? void 0 : value.form_submit_meta[formIndex].value);
8639
+ }
8640
+ return 0;
8641
+ }, [value === null || value === void 0 ? void 0 : value.form_submit_meta]);
8642
+ const submitButton = React.useMemo(() => {
8643
+ var _a;
8644
+ const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.RATING_BUTTON);
8645
+ if (_submitButton)
8646
+ return _submitButton;
8647
+ return null;
8648
+ }, []);
8649
+ const handleOnChange = (formValue) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8650
+ if (formValue) {
8651
+ const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
8652
+ ? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
8653
+ : [] });
8654
+ const tmpFormSubmitMeta = [
8655
+ ..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
8656
+ ];
8657
+ const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
8658
+ if (formUpdateIndex !== -1)
8659
+ tmpFormSubmitMeta[formUpdateIndex] = Object.assign({}, formValue);
8660
+ else
8661
+ tmpFormSubmitMeta.push(formValue);
8662
+ _message.form_submit_meta = [...tmpFormSubmitMeta];
8663
+ setValue(_message);
8664
+ onChange && onChange(_message);
8665
+ }
8666
+ });
8667
+ const handleOnNext = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8668
+ if (!value.form_submit_meta || ratingStarValue === 0) {
8669
+ pushNotifications({
8670
+ title: '',
8671
+ message: f({
8672
+ id: 'multiSelectError.required',
8673
+ defaultMessage: `There is no answer!`,
8674
+ }),
8675
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8676
+ });
8677
+ return;
8678
+ }
8679
+ if (!isSubmit) {
8680
+ const _message = Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value);
8681
+ const res = yield subotInlineMessage(_message);
8682
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8683
+ const _c = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _c, restData = tslib_es6.__rest(_c, ["node"]);
8684
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8685
+ onSubmit && onSubmit(_nextNode, _message);
8686
+ setIsSubmit(true);
8687
+ }
8688
+ }
8689
+ else {
8690
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8691
+ }
8692
+ });
8693
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8694
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8695
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8696
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8697
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8698
+ React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.RATING_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
8699
+ var _a;
8700
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8701
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnChange, value: (value &&
8702
+ (value === null || value === void 0 ? void 0 : value.form_submit_meta) &&
8703
+ ((_a = value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) })));
8704
+ }))))),
8705
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8706
+ };
8707
+
8708
+ const SubotInlineNodeReaction = ({ node, indexNumber, }) => {
8709
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8710
+ const { params, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
8711
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8712
+ const handleOnChange = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8713
+ if (action) {
8714
+ setValue(Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }));
8715
+ const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key });
8716
+ const res = yield subotInlineMessage(_message);
8717
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8718
+ const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
8719
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8720
+ onSubmit && onSubmit(_nextNode, _message);
8721
+ }
8722
+ }
8723
+ });
8724
+ const handleOnNext = () => {
8725
+ var _a;
8726
+ if (!(node === null || node === void 0 ? void 0 : node._message) || !((_a = node._message) === null || _a === void 0 ? void 0 : _a.action_id)) {
8727
+ pushNotifications({
8728
+ title: '',
8729
+ message: f({
8730
+ id: 'multiSelectError.required',
8731
+ defaultMessage: `There is no answer!`,
8732
+ }),
8733
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8734
+ });
8735
+ }
8736
+ else {
8737
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8738
+ }
8739
+ };
8740
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8741
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8742
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8743
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8744
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8745
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8746
+ React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: (node === null || node === void 0 ? void 0 : node.actions) || [], onChange: handleOnChange }))),
8747
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
8748
+ };
8749
+
8750
+ const SubotInlineNodeResultPoll = ({ node, }) => {
8751
+ var _a, _b;
8752
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8753
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8754
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8755
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8756
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [] })),
8757
+ React__default["default"].createElement(SubotInlineActionContainer, null, (node === null || node === void 0 ? void 0 : node.actions) && !!((_a = node.actions) === null || _a === void 0 ? void 0 : _a.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== index$2.NodeActionType.POLL_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
8758
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8759
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, htmlType: "checkbox", node_type: node === null || node === void 0 ? void 0 : node.type })));
8760
+ })))))));
8761
+ };
8762
+
8763
+ // Review Message
8764
+ // {
8765
+ // form_meta: [
8766
+ // { key: "review1", control: "formmeta", value: '', action_id: "action.id" },
8767
+ // { key: "review2", control: "formmeta", value: '', action_id: "action.id" },
8768
+ // { key: "review3", control: "formmeta", value: "" },
8769
+ // { key: "review4", control: "formmeta", value: "" },
8770
+ // { key: "review5", control: "formmeta", value: "" },
8771
+ // {key: 'attribite-description', control:"formmeta-description", value: ''}
8772
+ // ],
8773
+ // action_id: "button_id",
8774
+ // action_value: "button_attribute"
8775
+ // }
8776
+ const SubotInlineNodeReview = ({ node, indexNumber, }) => {
8777
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8778
+ const { params, onChange, onSubmit, onPrev, onNext } = React.useContext(SubotInlineContext);
8779
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8780
+ const [isSubmit, setIsSubmit] = React.useState(false);
8781
+ const reviewChoices = React.useMemo(() => {
8782
+ var _a;
8783
+ return ((_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.filter(({ type }) => type === index$2.NodeActionType.REVIEW_CHOICE)) || [];
8784
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8785
+ const reviewDescriptions = React.useMemo(() => {
8786
+ var _a;
8787
+ return ((_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.filter(({ type }) => type === index$2.NodeActionType.REVIEW_DESCRIPTION)) || [];
8788
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8789
+ const submitButton = React.useMemo(() => {
8790
+ var _a;
8791
+ const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == index$2.NodeActionType.REVIEW_BUTTON);
8792
+ if (_submitButton)
8793
+ return _submitButton;
8794
+ return null;
8795
+ }, [node === null || node === void 0 ? void 0 : node.actions]);
8796
+ const activeActions = React.useMemo(() => {
8797
+ if (value === null || value === void 0 ? void 0 : value.form_submit_meta) {
8798
+ return value === null || value === void 0 ? void 0 : value.form_submit_meta.map(({ action_id }) => action_id).filter((action_id) => !!(reviewChoices === null || reviewChoices === void 0 ? void 0 : reviewChoices.map(({ id }) => id).includes(action_id)));
8799
+ }
8800
+ return [];
8801
+ }, [value, value === null || value === void 0 ? void 0 : value.form_submit_meta]);
8802
+ const handleOnClick = (formValue) => {
8803
+ if (formValue) {
8804
+ const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
8805
+ ? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
8806
+ : [] });
8807
+ let tmpFormSubmitMeta = [
8808
+ ..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
8809
+ ];
8810
+ const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
8811
+ if (formUpdateIndex !== -1)
8812
+ tmpFormSubmitMeta = [
8813
+ ...tmpFormSubmitMeta.slice(0, formUpdateIndex),
8814
+ ...tmpFormSubmitMeta.slice(formUpdateIndex + 1),
8815
+ ];
8816
+ else
8817
+ tmpFormSubmitMeta.push(formValue);
8818
+ _message.form_submit_meta = [...tmpFormSubmitMeta];
8819
+ setValue(_message);
8820
+ setIsSubmit(false);
8821
+ onChange && onChange(_message);
8822
+ }
8823
+ };
8824
+ const handleOnChange = (formValue) => {
8825
+ if (formValue) {
8826
+ const _message = Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: submitButton === null || submitButton === void 0 ? void 0 : submitButton.id, action_value: submitButton === null || submitButton === void 0 ? void 0 : submitButton.key, form_submit_meta: (value === null || value === void 0 ? void 0 : value.form_submit_meta)
8827
+ ? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
8828
+ : [] });
8829
+ const tmpFormSubmitMeta = [
8830
+ ..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
8831
+ ];
8832
+ const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
8833
+ if (formUpdateIndex !== -1)
8834
+ tmpFormSubmitMeta[formUpdateIndex] = Object.assign({}, formValue);
8835
+ else
8836
+ tmpFormSubmitMeta.push(formValue);
8837
+ _message.form_submit_meta = [...tmpFormSubmitMeta];
8838
+ setValue(_message);
8839
+ setIsSubmit(false);
8840
+ onChange && onChange(_message);
8841
+ }
8842
+ };
8843
+ const handleOnNext = () => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8844
+ var _a;
8845
+ if (!((_a = node === null || node === void 0 ? void 0 : node._message) === null || _a === void 0 ? void 0 : _a.form_submit_meta) || !activeActions.length) {
8846
+ pushNotifications({
8847
+ title: '',
8848
+ message: f({
8849
+ id: 'multiSelectError.required',
8850
+ defaultMessage: `There is no answer!`,
8851
+ }),
8852
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8853
+ });
8854
+ return;
8855
+ }
8856
+ if (!isSubmit) {
8857
+ const _message = Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value);
8858
+ const res = yield subotInlineMessage(_message);
8859
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8860
+ const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = tslib_es6.__rest(_b, ["node"]);
8861
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8862
+ onSubmit && onSubmit(_nextNode, _message);
8863
+ setIsSubmit(true);
8864
+ }
8865
+ }
8866
+ else {
8867
+ onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8868
+ }
8869
+ });
8870
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8871
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8872
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8873
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8874
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8875
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8876
+ !!reviewChoices.length && (React__default["default"].createElement(SubotInlineReviewContainer, null,
8877
+ React__default["default"].createElement(SubotInlineActionListContainer, { className: "review-container" }, reviewChoices.map((action) => {
8878
+ var _a;
8879
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8880
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnClick, active: (value &&
8881
+ !!((_a = value === null || value === void 0 ? void 0 : value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) ||
8882
+ false })));
8883
+ })))),
8884
+ !!(reviewDescriptions === null || reviewDescriptions === void 0 ? void 0 : reviewDescriptions.length) && (React__default["default"].createElement(SubotInlineActionListContainer, null, reviewDescriptions.map((action) => {
8885
+ var _a;
8886
+ const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8887
+ return (NodeAction && (React__default["default"].createElement(NodeAction, { key: action.id, action: action, onChange: handleOnChange, value: (value &&
8888
+ (value === null || value === void 0 ? void 0 : value.form_submit_meta) &&
8889
+ ((_a = value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) })));
8890
+ }))))),
8891
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8892
+ };
8893
+
8894
+ const SubotInlineNodeSSO = ({ node, indexNumber, }) => {
8895
+ const refIsTrigger = React.useRef(false);
8896
+ const { params, onPrev, nodes, activeId, userInfo } = React.useContext(SubotInlineContext);
8897
+ React.useEffect(() => {
8898
+ var _a;
8899
+ const actionSSO = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find((act) => act.type === index$2.NodeActionType.ACTION_SSO_REDIRECT);
8900
+ if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) && actionSSO && !refIsTrigger.current) {
8901
+ refIsTrigger.current = true;
8902
+ handleOnChange(actionSSO);
8903
+ }
8904
+ }, [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
8905
+ const { formatMessage: f } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8906
+ const handleOnChange = (action) => {
8907
+ if (action && action.type === index$2.NodeActionType.ACTION_SSO_REDIRECT) {
8908
+ const currentState = {
8909
+ params: Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, mode: 'inline' }),
8910
+ listNodes: nodes,
8911
+ activeId,
8912
+ createdAt: new Date().getTime(),
8913
+ botId: params.bot_id,
8914
+ };
8915
+ localStorage.setItem(STATE_SUBOT_INLINE_KEY, JSON.stringify(currentState));
8916
+ const urlObj = utils$1.getURLwithSSOTracking(window.location.href, {
8917
+ botItem: nodes[0],
8918
+ });
8919
+ urlObj.searchParams.set('bot_id', String(params.bot_id));
8920
+ urlObj.searchParams.set('mode', 'inline');
8921
+ urlObj.searchParams.set('source', 'subot-inline');
8922
+ const returnUrl = urlObj.href;
8923
+ if (store.IS_SSOV2_ENABLED()) {
8924
+ store.useSSOV2Store.getState().triggerLogin({
8925
+ returnUrl,
8926
+ source: `subot-inline`,
8927
+ });
8928
+ }
8929
+ else {
8930
+ window.location.href = `${index$3.SSO_URL}?returnUrl=${encodeURIComponent(returnUrl)}`;
8931
+ }
8932
+ }
8933
+ };
8934
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8935
+ React__default["default"].createElement(SubotInlineHeader$1, null),
8936
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
8937
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
8938
+ React__default["default"].createElement(SubotInlineIntent, { intents: [
8939
+ ...((node === null || node === void 0 ? void 0 : node.intents) || []),
8940
+ ...index$1.ssoIntents(f),
8941
+ ], indexNumber: indexNumber })),
8942
+ React__default["default"].createElement(SubotInlineActionContainer, null,
8943
+ React__default["default"].createElement(SubotInlineAction, { actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange }))),
8944
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
8945
+ };
8946
+
8947
+ const SubotInlineNodeText = ({ node, indexNumber, }) => {
8948
+ const { formatMessage: f, action: { pushNotifications }, } = React.useContext(togetherComponentGlobalContext.TogetherComponentGlobalContext);
8949
+ const { nodes, activeId, params, onSubmit, onPrev, onNext, onChange } = React.useContext(SubotInlineContext);
8950
+ const [value, setValue] = React.useState((node === null || node === void 0 ? void 0 : node._message) || {});
8951
+ const handleOnChangeNormal = (action) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8952
+ const _message = Object.assign(Object.assign(Object.assign(Object.assign({}, params), value), { node_id: node.id, action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key }), getCurrentTotalDynamicScore(nodes, activeId, action.id));
8953
+ delete _message.form_submit_meta;
8954
+ const res = yield subotInlineMessage(_message);
8955
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8956
+ const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
8957
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8958
+ onSubmit && onSubmit(_nextNode, _message);
8959
+ }
8960
+ });
8961
+ const handleOnChange = (action, formSubmitMeta) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
8962
+ if (!action)
8963
+ return;
8964
+ const actionWithOther = (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
8965
+ (action === null || action === void 0 ? void 0 : action.type) === index$2.NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
8966
+ const newValue = Object.assign(Object.assign({}, value), { action_id: action === null || action === void 0 ? void 0 : action.id, action_value: action === null || action === void 0 ? void 0 : action.key, form_submit_meta: formSubmitMeta });
8967
+ if (actionWithOther) {
8968
+ setValue(newValue);
8969
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8970
+ return;
8971
+ }
8972
+ delete newValue.form_submit_meta;
8973
+ setValue(newValue);
8974
+ handleOnChangeNormal(action);
8975
+ });
8976
+ const handleOnNext = () => {
8977
+ const newMessage = JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value)));
8978
+ if ((value === null || value === void 0 ? void 0 : value.action_id) &&
8979
+ (value === null || value === void 0 ? void 0 : value.action_value) === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD) {
8980
+ onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
8981
+ return;
8982
+ }
8983
+ if (!(value === null || value === void 0 ? void 0 : value.action_id) || !(value === null || value === void 0 ? void 0 : value.action_value)) {
8984
+ pushNotifications({
8985
+ title: '',
8986
+ message: f({
8987
+ id: 'multiSelectError.required',
8988
+ defaultMessage: `There is no answer!`,
8989
+ }),
8990
+ type: 'warning', // "success" | "danger" | "info" | "warning"
8991
+ });
8992
+ }
8993
+ else {
8994
+ delete newMessage.form_submit_meta;
8995
+ onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
8996
+ }
8997
+ };
8998
+ return (React__default["default"].createElement(SubotInlineContainer$1, null,
8999
+ React__default["default"].createElement(SubotInlineHeader$1, null),
9000
+ React__default["default"].createElement(SubotInlineWrapper$1, null,
9001
+ React__default["default"].createElement(SubotInlineIntentContainer, null,
9002
+ React__default["default"].createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
9003
+ React__default["default"].createElement(SubotInlineActionContainer, null,
9004
+ React__default["default"].createElement(SubotInlineAction, { value: (value === null || value === void 0 ? void 0 : value.action_id) ? [value === null || value === void 0 ? void 0 : value.action_id] : [], actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange, formSubmitMeta: value === null || value === void 0 ? void 0 : value.form_submit_meta }))),
9005
+ React__default["default"].createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
9006
+ };
9007
+
9008
+ const SubotInlineNodeBase = {
9009
+ TEXT: SubotInlineNodeText,
9010
+ IMAGE: SubotInlineNodeImage,
9011
+ FORM: SubotInlineNodeForm,
9012
+ CONDITION: SubotInlineNode,
9013
+ FINAL_STANDARD: SubotInlineNodeFinal,
9014
+ FINAL: SubotInlineNodeFinal,
9015
+ FINAL_THANK_YOU: SubotInlineNodeFinalThankYou,
9016
+ SSO: SubotInlineNodeSSO,
9017
+ MULTIPLE: SubotInlineNodeMultiple,
9018
+ POLL: SubotInlineNodePoll,
9019
+ RATING: SubotInlineNodeRating,
9020
+ REACTION: SubotInlineNodeReaction,
9021
+ REVIEW: SubotInlineNodeReview,
9022
+ RESULT_POLL: SubotInlineNodeResultPoll,
9023
+ OTP: SubotInlineNodeOTP,
9024
+ // RESULT_RATING = 12,
9025
+ // RESULT_REACTION = 13,
9026
+ };
9027
+
9028
+ const SubotInlineButton = styled__default["default"](index$8.Button) `
9029
+ margin-top: 24px;
9030
+ ${utils.MediaQueries.mbUp} {
9031
+ margin-top: 16px;
9032
+ }
9033
+ `;
9034
+ const SubotInlineDescription = styled__default["default"].div `
9035
+ margin-top: 24px;
9036
+ `;
9037
+ const SubotInlineReview = styled__default["default"](index$d.Text) `
9038
+ text-align: center;
9039
+ ${utils.MediaQueries.mbUp} {
9040
+ text-align: left;
9041
+ }
9042
+ `;
9043
+ const SubotInlineTitle = styled__default["default"](index$e.Heading) `
9044
+ text-align: center;
9045
+ margin-bottom: 8px;
9046
+
9047
+ ${utils.MediaQueries.mbUp} {
9048
+ margin-bottom: 0;
9049
+ text-align: left;
9050
+ }
9051
+ `;
9052
+ const SubotInlineImage = styled__default["default"].div `
9053
+ background-color: #ffffff;
9054
+ border-radius: 50%;
9055
+ width: 120px;
9056
+ height: 120px;
9057
+ object-fit: contain;
9058
+ overflow: hidden;
9059
+ flex-shrink: 0;
9060
+
9061
+ img {
9062
+ width: 100%;
9063
+ height: 100%;
9064
+ object-fit: cover;
9065
+ }
9066
+ `;
9067
+ const SubotInlineContent = styled__default["default"].div `
9068
+ flex-grow: 1;
9069
+ ${utils.MediaQueries.tdDown} {
9070
+ width: 100%;
9071
+ margin-left: 0;
9072
+ }
9073
+ `;
9074
+ const SubotInlineStartWrapper = styled__default["default"].div `
9075
+ position: relative;
9076
+ display: flex;
9077
+ gap: 24px;
9078
+ ${utils.MediaQueries.mbDown} {
9079
+ flex-wrap: wrap;
9080
+ justify-content: center;
9081
+ }
9082
+ `;
9083
+ const SubotInlineStartContainer = styled__default["default"].div `
9084
+ position: relative;
9085
+ overflow: hidden;
9086
+ background-color: ${miscTheme.theme.colors.primary50};
9087
+ padding: 32px;
9088
+ border-radius: ${miscTheme.theme.borderRadius};
9089
+ background-image: url('/images/subot-bg-transparent.png');
9090
+ background-size: contain;
9091
+ background-repeat: repeat-y;
9092
+ ${utils.MediaQueries.mbDown} {
9093
+ padding: 24px;
9094
+ }
9095
+ `;
9096
+ const SubotInlineNodeStart = ({ node, setLoading, }) => {
9097
+ const startRef = React.useRef({
9098
+ impress: false,
9099
+ });
9100
+ const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
9101
+ const { params, onNext, trackingCommonInline, isMobile } = React.useContext(SubotInlineContext);
9102
+ const handleOnClick = (isCountClick = true) => () => {
9103
+ if (isCountClick) {
9104
+ const queryParams = {
9105
+ cookie_id: params.cookie_id,
9106
+ window_id: params.window_id,
9107
+ bot_id: params.bot_id,
9108
+ title_url: params.title_url,
9109
+ url: params.url,
9110
+ gtm_id: params.gtm_id,
9111
+ ga_client_id: params.ga_client_id,
9112
+ device_id: index$1.checkMobile(window.navigator.userAgent) ? 2 : 1,
9113
+ account_id: params.account_id || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || null,
9114
+ };
9115
+ subotInlineClick(queryParams);
9116
+ }
9117
+ onNext && onNext();
9118
+ };
9119
+ React.useEffect(() => {
9120
+ const inViewport = (element, callback, options = {}) => {
9121
+ if (!!window.IntersectionObserver && !startRef.current.impress) {
9122
+ const observer = new IntersectionObserver((entries, observer) => {
9123
+ entries.forEach((entry) => callback(entry, observer));
9124
+ }, options);
9125
+ observer.observe(element);
9126
+ }
9127
+ };
9128
+ const eventScrollImpress = () => {
9129
+ if (startRef.current.element) {
9130
+ inViewport(startRef.current.element, (element, observer) => {
9131
+ /** Not in viewport */
9132
+ if (!element.isIntersecting) {
9133
+ if (startRef.current.impress) {
9134
+ startRef.current.impress = false;
9135
+ }
9136
+ return;
9137
+ }
9138
+ if (!startRef.current.impress) {
9139
+ startRef.current.impress = true;
9140
+ if (startRef.current.debounce) {
9141
+ clearTimeout(startRef.current.debounce);
9142
+ }
9143
+ if (!(node === null || node === void 0 ? void 0 : node.inline_start_button)) {
9144
+ setLoading(true);
9145
+ }
9146
+ startRef.current.debounce = setTimeout(() => {
9147
+ const queryParams = {
9148
+ cookie_id: params.cookie_id,
9149
+ window_id: params.window_id,
9150
+ bot_id: params.bot_id,
9151
+ title_url: params.title_url,
9152
+ url: params.url,
9153
+ gtm_id: params.gtm_id,
9154
+ ga_client_id: params.ga_client_id,
9155
+ device_id: index$1.checkMobile(window.navigator.userAgent) ? 2 : 1,
9156
+ account_id: params.account_id || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || null,
9157
+ };
9158
+ queryParams && subotInlineImpression(queryParams);
9159
+ /** Auto skip the starting node in the case
9160
+ * CTA Start value is not contributed on Subot Admin */
9161
+ if (!(node === null || node === void 0 ? void 0 : node.inline_start_button)) {
9162
+ handleOnClick(false)();
9163
+ }
9164
+ }, 400);
9165
+ startRef.current.element &&
9166
+ (observer === null || observer === void 0 ? void 0 : observer.unobserve(startRef.current.element));
9167
+ }
9168
+ }, {
9169
+ rootMargin: '1000px',
9170
+ });
9171
+ }
9172
+ };
9173
+ eventScrollImpress();
9174
+ window.addEventListener('scroll', eventScrollImpress, { passive: true });
9175
+ return () => window.removeEventListener('scroll', eventScrollImpress);
9176
+ }, [onNext]);
9177
+ if (!node)
9178
+ return null;
9179
+ return (React__default["default"].createElement(SubotInlineStartContainer, null,
9180
+ React__default["default"].createElement(SubotInlineStartWrapper, { ref: (ref) => (startRef.current.element = ref) },
9181
+ node.inline_image && (React__default["default"].createElement(SubotInlineImage, null,
9182
+ React__default["default"].createElement("img", { loading: "lazy", src: node.inline_image, alt: "" }))),
9183
+ React__default["default"].createElement(SubotInlineContent, null,
9184
+ node.inline_title || node.inline_headline ? (React__default["default"].createElement(SubotInlineTitle, { tag: "h3", fontWeight: "bold", color: miscTheme.theme.colors.secondaryBase },
9185
+ React__default["default"].createElement(Markdown, null, node.inline_title || node.inline_headline))) : null,
9186
+ node.inline_review && (React__default["default"].createElement(SubotInlineReview, { size: "s4", color: miscTheme.theme.colors.gray600,
9187
+ // fix error html, div is not allowed as child of p
9188
+ as: 'div' },
9189
+ React__default["default"].createElement(Markdown, null, node.inline_review))),
9190
+ node.inline_start_button && (React__default["default"].createElement(SubotInlineButton, Object.assign({ size: "md", isBlock: isMobile, onClick: handleOnClick(true), className: "pointer-event-child-none" }, trackingCommonInline, { "data-event-action": "Start" }), node.inline_start_button)))),
9191
+ React__default["default"].createElement(SubotInlineDescription, null,
9192
+ React__default["default"].createElement(Markdown, null, node.inline_description))));
9193
+ };
9194
+
9195
+ const SubotInlineLoading = styled__default["default"].div `
9196
+ position: absolute;
9197
+ z-index: 2;
9198
+ top: 0;
9199
+ right: 0;
9200
+ bottom: 0;
9201
+ left: 0;
9202
+ display: flex;
9203
+ flex-direction: column;
9204
+ align-items: center;
9205
+ justify-content: center;
9206
+ color: ${miscTheme.theme.colors.gray800};
9207
+ opacity: 0;
9208
+ pointer-events: none;
9209
+ &:before {
9210
+ position: absolute;
9211
+ z-index: -1;
9212
+ top: 0;
9213
+ right: 0;
9214
+ bottom: 0;
9215
+ left: 0;
9216
+ background-color: ${miscTheme.theme.colors.neutral50 || '#F7F9FC'};
9217
+ content: '';
9218
+ opacity: 1;
9219
+ }
9220
+ ${({ isLoading }) => isLoading && ` opacity: 1; pointer-events: auto; `};
9221
+ `;
9222
+ const SubotInlineLoadingContainer = styled__default["default"].div `
9223
+ position: relative;
9224
+ z-index: 1;
9225
+ line-height: 1.5;
9226
+ transition: 0.25s all linear;
9227
+ margin-block: 16px;
9228
+ content-visibility: auto;
9229
+ contain-intrinsic-size: 500px;
9230
+ &.hhg-subot-style {
9231
+ min-height: 100px;
9232
+ }
9233
+ ${utils.MediaQueries.mbDown} {
9234
+ margin-right: -1rem;
9235
+ margin-left: -1rem;
9236
+ }
9237
+ `;
9238
+ const SubotInline = ({ id, isMobile, articleLink }) => {
9239
+ const currentUrl = useCurrentUrl();
9240
+ const refAccountIdFromLogs = React.useRef(null);
9241
+ const flag = React.useRef(null);
9242
+ const [loading, setLoading] = React.useState(true);
9243
+ const [state, setState] = React.useState({
9244
+ activeId: '',
9245
+ params: {},
9246
+ nodes: [],
9247
+ getParams: () => ({}),
9248
+ });
9249
+ const userInfo = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.userInfo;
9250
+ const currentNode = React.useMemo(() => {
9251
+ return state.nodes.find((n) => n.id == state.activeId);
9252
+ }, [state.nodes, state.activeId]);
9253
+ const trackingCommonInline = React.useMemo(() => ({
9254
+ 'data-event-category': 'Subot',
9255
+ 'data-event-label': currentUrl,
9256
+ 'data-bot-id': state.params.bot_id,
9257
+ 'data-bot-type': 'Inline',
9258
+ 'data-question-id': typeof (currentNode === null || currentNode === void 0 ? void 0 : currentNode.id) === 'string' ? currentNode === null || currentNode === void 0 ? void 0 : currentNode.id : null,
9259
+ }), [currentNode, currentUrl, state.params.bot_id]);
9260
+ /** Get Params */
9261
+ const getParams = React.useCallback(() => {
9262
+ var _a, _b, _c, _d;
9263
+ const gaData = window.gaData;
9264
+ const _url = window.location.origin +
9265
+ index$3.basePath +
9266
+ (togetherComponentGlobalContext.GlobalData.locale === 'tl-PH'
9267
+ ? articleLink.replace('fil/', '')
9268
+ : articleLink);
9269
+ const params = {
9270
+ bot_id: id,
9271
+ account_id: ((_a = index$1.getUserInfoFromCookie()) === null || _a === void 0 ? void 0 : _a.id) || null,
9272
+ action_id: '',
9273
+ action_value: '',
9274
+ cookie_id: index$1.getSubotCookieId((_c = (_b = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.router) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.cookie_id),
9275
+ current_score: 0,
9276
+ current_keys: [],
9277
+ current_selected: [],
9278
+ form_submit_meta: [],
9279
+ gtm_id: gaData ? Object.keys(gaData)[0] : '',
9280
+ ga_client_id: Cookies__default["default"].get('_ga') || '',
9281
+ is_new: false,
9282
+ mode: 'inline',
9283
+ node_id: '',
9284
+ selected_actions: {},
9285
+ title_url: document.title || '',
9286
+ // url: _url,
9287
+ // Keep this commnent line to test on local
9288
+ url: _url
9289
+ .replace('http://localhost', 'https://discover.hellobacsi.com')
9290
+ .replace('dev.', 'discover.'),
9291
+ window_id: index$1.getWindowId(),
9292
+ };
9293
+ return index$1.overrideParamsByQuery(params, (_d = togetherComponentGlobalContext.GlobalData === null || togetherComponentGlobalContext.GlobalData === void 0 ? void 0 : togetherComponentGlobalContext.GlobalData.router) === null || _d === void 0 ? void 0 : _d.query);
9294
+ }, []);
9295
+ const elementScrollIntoView = () => {
9296
+ flag.current &&
9297
+ flag.current.scrollIntoView({
9298
+ behavior: 'smooth',
9299
+ block: 'start',
9300
+ inline: 'start',
9301
+ });
9302
+ };
9303
+ const onChange = (message) => {
9304
+ setState((state) => {
9305
+ var _a;
9306
+ if (message && (message === null || message === void 0 ? void 0 : message.node_id) && (message === null || message === void 0 ? void 0 : message.node_id) == (state === null || state === void 0 ? void 0 : state.activeId)) {
9307
+ const nodeActiveIndex = state.nodes.findIndex(({ id }) => id == (state === null || state === void 0 ? void 0 : state.activeId));
9308
+ if (nodeActiveIndex !== -1) {
9309
+ const tmpNode = Object.assign(Object.assign({}, state.nodes[nodeActiveIndex]), { _message: Object.assign(Object.assign({}, (_a = state.nodes[nodeActiveIndex]) === null || _a === void 0 ? void 0 : _a._message), message) });
9310
+ state.nodes[nodeActiveIndex] = tmpNode;
9311
+ }
9312
+ }
9313
+ return Object.assign({}, state);
9314
+ });
9315
+ };
9316
+ const onSubmit = (nextNode, message) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
9317
+ /**
9318
+ * Skip the OTP Node if user's phone number is verified.
9319
+ */
9320
+ // if (nextNode) {
9321
+ // const isNextNodeOTP = nextNode.type === NodeType.OTP
9322
+ // if (isNextNodeOTP && verifiedPhone) {
9323
+ // const actionOTPSubmit = nextNode.actions?.find(
9324
+ // (action) => action.type === NodeActionType.USER_SUBMIT_SEND,
9325
+ // )
9326
+ // const blockOTPMessage: SubotMessage = {
9327
+ // ...state.params,
9328
+ // node_id: nextNode.id,
9329
+ // action_id: actionOTPSubmit?.id,
9330
+ // action_value: actionOTPSubmit?.key,
9331
+ // }
9332
+ // const res = await subotInlineMessage(blockOTPMessage)
9333
+ // if (res?._status === 1) {
9334
+ // const { node: _node, ...restData } = res?._data
9335
+ // const nextNodeAfterOTP = {
9336
+ // ..._node,
9337
+ // _message: { ...restData, node_id: _node.id },
9338
+ // }
9339
+ // onSubmit && onSubmit(nextNodeAfterOTP, message)
9340
+ // return
9341
+ // }
9342
+ // pushNotifications({
9343
+ // title: '',
9344
+ // message: f({ id: 'notification.comment.somethingWrong' }),
9345
+ // type: 'danger',
9346
+ // })
9347
+ // return
9348
+ // }
9349
+ // }
9350
+ const _state = Object.assign(Object.assign({}, state), { nodes: [...state.nodes] });
9351
+ if (message && (message === null || message === void 0 ? void 0 : message.node_id)) {
9352
+ const updateNodeIndex = _state.nodes.findIndex(({ id }) => id == message.node_id);
9353
+ if (updateNodeIndex !== -1) {
9354
+ _state.nodes[updateNodeIndex]._message = Object.assign(Object.assign({}, _state.nodes[updateNodeIndex]._message), message);
9355
+ _state.nodes = [..._state.nodes.slice(0, updateNodeIndex + 1)];
9356
+ }
9357
+ }
9358
+ setLoading(true);
9359
+ if (nextNode) {
9360
+ const nextNodeFindIndex = _state.nodes.findIndex(({ id }) => id == (nextNode === null || nextNode === void 0 ? void 0 : nextNode.id));
9361
+ if (nextNodeFindIndex === -1) {
9362
+ _state.nodes = [..._state.nodes, Object.assign({}, nextNode)];
9363
+ }
9364
+ else {
9365
+ const tmpNode = Object.assign(Object.assign(Object.assign({}, _state.nodes[nextNodeFindIndex]), nextNode), { _message: Object.assign(Object.assign({}, _state.nodes[nextNodeFindIndex]._message), nextNode === null || nextNode === void 0 ? void 0 : nextNode._message) });
9366
+ _state.nodes = [
9367
+ ..._state.nodes.slice(0, nextNodeFindIndex),
9368
+ Object.assign({}, tmpNode),
9369
+ ..._state.nodes.slice(nextNodeFindIndex + 1),
9370
+ ];
9371
+ }
9372
+ _state.activeId = nextNode.id;
9373
+ }
9374
+ setTimeout(() => {
9375
+ setState(_state);
9376
+ setLoading(false);
9377
+ _state.activeId &&
9378
+ saveSubotInlineLogs({
9379
+ nodes: _state.nodes,
9380
+ activeId: _state.activeId,
9381
+ params: _state.params,
9382
+ accountIdFromLogs: refAccountIdFromLogs.current,
9383
+ });
9384
+ }, 250);
9385
+ elementScrollIntoView();
9386
+ });
9387
+ const onPrev = () => {
9388
+ var _a;
9389
+ const _state = Object.assign({}, state);
9390
+ const nodeActiveIndex = (_a = _state === null || _state === void 0 ? void 0 : _state.nodes) === null || _a === void 0 ? void 0 : _a.findIndex(({ id }) => id == (_state === null || _state === void 0 ? void 0 : _state.activeId));
9391
+ if (nodeActiveIndex && nodeActiveIndex !== -1 && nodeActiveIndex > 1) {
9392
+ const prevNode = _state.nodes[nodeActiveIndex - 1];
9393
+ if (prevNode)
9394
+ _state.activeId = prevNode.id;
9395
+ }
9396
+ elementScrollIntoView();
9397
+ setState(Object.assign({}, _state));
9398
+ _state.activeId &&
9399
+ saveSubotInlineLogs({
9400
+ nodes: _state.nodes,
9401
+ activeId: _state.activeId,
9402
+ params: _state.params,
9403
+ accountIdFromLogs: refAccountIdFromLogs.current,
9404
+ });
9405
+ };
9406
+ const onNext = (message) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
9407
+ if (message && (message === null || message === void 0 ? void 0 : message.node_id)) {
9408
+ const newMessage = Object.assign(Object.assign({}, message), getCurrentTotalDynamicScore(state.nodes, state.activeId, message.action_id));
9409
+ const res = yield subotInlineMessage(newMessage);
9410
+ setLoading(false);
9411
+ if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
9412
+ const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = tslib_es6.__rest(_a, ["node"]);
9413
+ const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
9414
+ const nextNodeFindIndex = state.nodes.findIndex(({ id }) => id === _nextNode.id);
9415
+ if (nextNodeFindIndex !== -1) {
9416
+ onSubmit(_nextNode);
9417
+ }
9418
+ else {
9419
+ onSubmit(_nextNode, message);
9420
+ }
9421
+ return;
9422
+ }
9423
+ }
9424
+ const nodeActive = state.nodes.find(({ id }) => id == (state === null || state === void 0 ? void 0 : state.activeId));
9425
+ if (nodeActive && !nodeActive.hasOwnProperty('type')) {
9426
+ setLoading(true);
9427
+ if (state.nodes[0].id == (state === null || state === void 0 ? void 0 : state.activeId)) {
9428
+ // elementScrollIntoView()
9429
+ setTimeout(() => {
9430
+ setState(Object.assign(Object.assign({}, state), { activeId: state.nodes[1].id.toString() }));
9431
+ setLoading(false);
9432
+ saveSubotInlineLogs({
9433
+ nodes: state.nodes,
9434
+ activeId: state.nodes[1].id.toString(),
9435
+ params: getParams(),
9436
+ accountIdFromLogs: refAccountIdFromLogs.current,
9437
+ });
9438
+ }, 250);
9439
+ }
9440
+ }
9441
+ });
9442
+ const onReset = () => {
9443
+ setLoading(true);
9444
+ setState((state) => {
9445
+ state.nodes = state.nodes.slice(0, 2);
9446
+ state.nodes[1] = Object.assign(Object.assign({}, state.nodes[1]), { _message: undefined });
9447
+ state.activeId = state.nodes[0].id.toString();
9448
+ return Object.assign({}, state);
9449
+ });
9450
+ setTimeout(() => {
9451
+ setLoading(false);
9452
+ }, 250);
9453
+ elementScrollIntoView();
9454
+ };
9455
+ const getFirstAPI = (params) => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
9456
+ var _b;
9457
+ if ((params === null || params === void 0 ? void 0 : params.url) && (params === null || params === void 0 ? void 0 : params.bot_id)) {
9458
+ let activeId = '';
9459
+ let nodes = [];
9460
+ setLoading(true);
9461
+ const resFirst = yield subotInlineFirstNode(params.bot_id);
9462
+ if ((resFirst === null || resFirst === void 0 ? void 0 : resFirst._status) === 1) {
9463
+ activeId = resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.id.toString();
9464
+ nodes.push(resFirst === null || resFirst === void 0 ? void 0 : resFirst._data, resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.first_node);
9465
+ }
9466
+ const subotLogs = yield getSubotInlineLogs(nodes[0]);
9467
+ if (subotLogs) {
9468
+ const lastNode = subotLogs.nodes[subotLogs.nodes.length - 1];
9469
+ const isComplete = [
9470
+ index$2.NodeType.FINAL,
9471
+ index$2.NodeType.FINAL_THANK_YOU,
9472
+ index$2.NodeType.FINAL_STANDARD,
9473
+ ].includes(lastNode.type);
9474
+ if (!isComplete) {
9475
+ nodes = subotLogs.nodes;
9476
+ activeId = subotLogs.activeId;
9477
+ refAccountIdFromLogs.current = ((_b = subotLogs.params) === null || _b === void 0 ? void 0 : _b.account_id) || 0;
9478
+ }
9479
+ }
9480
+ /** [Subot Inline] Show result page after redirect from SSO */
9481
+ const previousState = getPreviousStateFromStorage(params.bot_id, {
9482
+ getParams,
9483
+ });
9484
+ if (previousState &&
9485
+ previousState.params.action_id &&
9486
+ previousState.params.action_value) {
9487
+ const resResultInline = yield subotInlineMessage(previousState.params);
9488
+ if ((resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._status) === 1 && (resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node)) {
9489
+ activeId = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node.id;
9490
+ nodes = previousState.listNodes;
9491
+ nodes[nodes.length - 1] = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node;
9492
+ saveSubotInlineLogs({
9493
+ nodes,
9494
+ activeId: activeId,
9495
+ params: previousState.params,
9496
+ accountIdFromLogs: refAccountIdFromLogs.current,
9497
+ });
9498
+ setTimeout(() => {
9499
+ elementScrollIntoView();
9500
+ }, 100);
9501
+ }
9502
+ }
9503
+ const newParams = (previousState === null || previousState === void 0 ? void 0 : previousState.params) || (subotLogs === null || subotLogs === void 0 ? void 0 : subotLogs.params) || params;
9504
+ const _state = Object.assign(Object.assign({}, state), { params: newParams, activeId, nodes: nodes });
9505
+ setLoading(false);
9506
+ setState(_state);
9507
+ }
9508
+ });
9509
+ React.useEffect(() => {
9510
+ var _a;
9511
+ if (!!((_a = state === null || state === void 0 ? void 0 : state.nodes) === null || _a === void 0 ? void 0 : _a.length)) {
9512
+ console.log('Subot Already Loaded');
9513
+ return () => undefined;
9514
+ }
9515
+ if (!Cookies__default["default"].get(index$3.GA_TOKEN_COOKIE)) {
9516
+ index$1.checkUntilFinished({
9517
+ condition: () => Boolean(Cookies__default["default"].get(index$3.GA_TOKEN_COOKIE)),
9518
+ finished: () => {
9519
+ const params = getParams();
9520
+ getFirstAPI(params);
9521
+ },
9522
+ });
9523
+ }
9524
+ else {
9525
+ const params = getParams();
9526
+ getFirstAPI(params);
9527
+ }
9528
+ }, []);
9529
+ if (state.nodes.length && !state.nodes[0].inline_active) {
9530
+ return null;
9531
+ }
9532
+ return (React__default["default"].createElement(SubotInlineContext.Provider, { value: Object.assign(Object.assign({}, state), { isMobile,
9533
+ getParams,
9534
+ onChange,
9535
+ onSubmit,
9536
+ onPrev,
9537
+ onNext,
9538
+ onReset,
9539
+ trackingCommonInline,
9540
+ userInfo }) },
9541
+ React__default["default"].createElement(SubotInlineLoadingContainer, { className: classNames__default["default"]('hhg-subot', `hhg-subot-${id}`, !!state.nodes.length && 'hhg-subot-style') }, !!state.nodes.length && (React__default["default"].createElement(React__default["default"].Fragment, null,
9542
+ React__default["default"].createElement("div", { ref: flag, className: "hhg-flag", style: {
9543
+ position: 'absolute',
9544
+ top: -150,
9545
+ left: 0,
9546
+ pointerEvents: 'none',
9547
+ } }),
9548
+ React__default["default"].createElement(SubotInlineLoading, { isLoading: !!loading },
9549
+ React__default["default"].createElement(index$a.Loading, null),
9550
+ "Verifying..."),
9551
+ state.nodes.map((node, index) => {
9552
+ if (node.id.toString() === (state === null || state === void 0 ? void 0 : state.activeId)) {
9553
+ if (node.hasOwnProperty('type')) {
9554
+ let NodeComponent;
9555
+ switch (node === null || node === void 0 ? void 0 : node.position) {
9556
+ case index$2.NodePosition.SSO:
9557
+ NodeComponent =
9558
+ SubotInlineNodeBase[index$2.NodePosition[node === null || node === void 0 ? void 0 : node.position].valueOf()];
9559
+ break;
9560
+ default:
9561
+ NodeComponent =
9562
+ SubotInlineNodeBase[index$2.NodeType[node === null || node === void 0 ? void 0 : node.type].valueOf()];
9563
+ }
9564
+ if (node.is_multi_select &&
9565
+ node.type !== index$2.NodeType.POLL)
9566
+ NodeComponent = SubotInlineNodeBase['MULTIPLE'];
9567
+ return (NodeComponent && (React__default["default"].createElement(NodeComponent, { key: index.toString(), indexNumber: index, node: node })));
9568
+ }
9569
+ else {
9570
+ return (React__default["default"].createElement(SubotInlineNodeStart, { key: index.toString(), node: node, setLoading: setLoading }));
9571
+ }
9572
+ }
9573
+ return null;
9574
+ }))))));
9575
+ };
9576
+
6439
9577
  // subot.sendOTP.button
6440
9578
  // subot.resendOTP.button
6441
9579
  // subot.verifyOTP.button
@@ -6475,6 +9613,7 @@ var index = /*#__PURE__*/Object.freeze({
6475
9613
  Markdown: Markdown,
6476
9614
  hexRgb: hexRgb,
6477
9615
  SubotInlineVoucherLeftUI: SubotInlineVoucherLeftUI,
9616
+ SubotInline: SubotInline,
6478
9617
  overrideParamsByQuery: index$1.overrideParamsByQuery,
6479
9618
  ssoIntents: index$1.ssoIntents,
6480
9619
  checkUntilFinished: index$1.checkUntilFinished,
@@ -6490,11 +9629,11 @@ var index = /*#__PURE__*/Object.freeze({
6490
9629
  isFakeEmail: index$1.isFakeEmail,
6491
9630
  formatUrlWithEncrypedGa: index$1.formatUrlWithEncrypedGa,
6492
9631
  getSubotApiPath: getSubotApiPath,
6493
- subotInlineMessage: subotInlineMessage,
6494
- computeExtraSettingsForBot: computeExtraSettingsForBot,
6495
- subotInlineFirstNode: subotInlineFirstNode,
6496
- subotInlineClick: subotInlineClick,
6497
- subotInlineImpression: subotInlineImpression,
9632
+ subotInlineMessage: subotInlineMessage$1,
9633
+ computeExtraSettingsForBot: computeExtraSettingsForBot$1,
9634
+ subotInlineFirstNode: subotInlineFirstNode$1,
9635
+ subotInlineClick: subotInlineClick$1,
9636
+ subotInlineImpression: subotInlineImpression$1,
6498
9637
  PATHS: PATHS$1,
6499
9638
  getPreviousStateFromStorage: getPreviousStateFromStorage,
6500
9639
  getSubotInlineLogs: getSubotInlineLogs,
@@ -6505,7 +9644,7 @@ var index = /*#__PURE__*/Object.freeze({
6505
9644
  detectToSkipNodeStart: detectToSkipNodeStart,
6506
9645
  KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD: KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD,
6507
9646
  SubotInlineIntentBaseTarget: SubotInlineIntentBaseTarget,
6508
- SubotInlineIntentBase: SubotInlineIntentBase,
9647
+ SubotInlineIntentBase: SubotInlineIntentBase$1,
6509
9648
  checkSyncDataOnFrisoCampaign: checkSyncDataOnFrisoCampaign,
6510
9649
  handleFrisoRedirecition: handleFrisoRedirecition,
6511
9650
  getDynamicScore: getDynamicScore,
@@ -6530,13 +9669,14 @@ exports.ssoIntents = index$1.ssoIntents;
6530
9669
  exports.KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD = KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD;
6531
9670
  exports.Markdown = Markdown;
6532
9671
  exports.PATHS = PATHS$1;
6533
- exports.SubotInlineIntentBase = SubotInlineIntentBase;
9672
+ exports.SubotInline = SubotInline;
9673
+ exports.SubotInlineIntentBase = SubotInlineIntentBase$1;
6534
9674
  exports.SubotInlineIntentBaseTarget = SubotInlineIntentBaseTarget;
6535
9675
  exports.SubotInlineRevampWithTheme = SubotInlineRevampWithTheme;
6536
9676
  exports.SubotInlineVoucherLeftUI = SubotInlineVoucherLeftUI;
6537
9677
  exports.UserInfoForm = UserInfoForm;
6538
9678
  exports.checkSyncDataOnFrisoCampaign = checkSyncDataOnFrisoCampaign;
6539
- exports.computeExtraSettingsForBot = computeExtraSettingsForBot;
9679
+ exports.computeExtraSettingsForBot = computeExtraSettingsForBot$1;
6540
9680
  exports["default"] = ContainerWithProvider;
6541
9681
  exports.detectToSkipNodeStart = detectToSkipNodeStart;
6542
9682
  exports.extractUnifiedAnswers = extractUnifiedAnswers;
@@ -6551,7 +9691,7 @@ exports.handleFrisoRedirecition = handleFrisoRedirecition;
6551
9691
  exports.hexRgb = hexRgb;
6552
9692
  exports.replaceTextWithVariables = replaceTextWithVariables;
6553
9693
  exports.saveSubotInlineLogs = saveSubotInlineLogs;
6554
- exports.subotInlineClick = subotInlineClick;
6555
- exports.subotInlineFirstNode = subotInlineFirstNode;
6556
- exports.subotInlineImpression = subotInlineImpression;
6557
- exports.subotInlineMessage = subotInlineMessage;
9694
+ exports.subotInlineClick = subotInlineClick$1;
9695
+ exports.subotInlineFirstNode = subotInlineFirstNode$1;
9696
+ exports.subotInlineImpression = subotInlineImpression$1;
9697
+ exports.subotInlineMessage = subotInlineMessage$1;