@hhgtech/hhg-components 1.29.479 → 1.29.480-beta-1

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 (595) hide show
  1. package/build/{InputDate-be9169ce.js → InputDate-d158bc4e.js} +5 -5
  2. package/build/{LastPeriod-3d557a2e.js → LastPeriod-43e2cc54.js} +1 -1
  3. package/build/{MobileBottomNavigationIcon-8fe6c73e.js → MobileBottomNavigationIcon-f10c7508.js} +3 -3
  4. package/build/{Spinner-6aea0c99.js → Spinner-15aff8d4.js} +1 -1
  5. package/build/{WhatsApp-d1ab9b81.js → WhatsApp-0b4c61b8.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/atoms/imageUpload/ImageUpload.types.d.ts +1 -1
  14. package/build/components/molecules/index.d.ts +1 -0
  15. package/build/components/molecules/toolBannerCard/index.d.ts +2 -1
  16. package/build/components/molecules/toolBannerCard/index.styles.d.ts +1 -0
  17. package/build/components.js +105 -104
  18. package/build/{constants-0761efa6.js → constants-06373310.js} +1 -1
  19. package/build/constants.js +3 -3
  20. package/build/constantsDomainLocales.js +1 -1
  21. package/build/constantsRiskScreener.js +2 -2
  22. package/build/constantsSite.js +2 -2
  23. package/build/{core-d08f2001.js → core-2c3af43c.js} +1 -1
  24. package/build/{dataTransform-03414911.js → dataTransform-11f990c2.js} +1 -1
  25. package/build/ecom.js +5 -5
  26. package/build/{editor-484a6c02.js → editor-7df07f31.js} +11 -11
  27. package/build/embeddedHeathToolCards_babyGrowth.js +25 -25
  28. package/build/embeddedHeathToolCards_babyPoop.js +23 -23
  29. package/build/embeddedHeathToolCards_babyVaccine.js +25 -25
  30. package/build/embeddedHeathToolCards_bmi_bmi.js +30 -30
  31. package/build/embeddedHeathToolCards_bmrBmr.js +28 -28
  32. package/build/embeddedHeathToolCards_dueDate_dueDate.js +25 -25
  33. package/build/embeddedHeathToolCards_ovulation_ovulation.js +25 -25
  34. package/build/embeddedHeathToolCards_pwg_pwg.js +29 -29
  35. package/build/embeddedHeathToolCards_targetHeartRate.js +30 -30
  36. package/build/esm/{InputDate-57a69392.js → InputDate-c7afe06e.js} +5 -5
  37. package/build/esm/{LastPeriod-a071aa21.js → LastPeriod-fd4f910c.js} +1 -1
  38. package/build/esm/{MobileBottomNavigationIcon-aaffa084.js → MobileBottomNavigationIcon-b60beecb.js} +3 -3
  39. package/build/esm/{Spinner-ea28eb4e.js → Spinner-49e6bba1.js} +1 -1
  40. package/build/esm/{WhatsApp-4e9864fc.js → WhatsApp-1737ea92.js} +1 -1
  41. package/build/esm/adapters.js +20 -20
  42. package/build/esm/atoms.js +50 -50
  43. package/build/esm/babyGrowth.js +86 -86
  44. package/build/esm/cache.js +2 -2
  45. package/build/esm/care.js +18 -18
  46. package/build/esm/careBookingSearchBar.js +14 -14
  47. package/build/esm/careBookingSearchBarV2.js +15 -15
  48. package/build/esm/components/atoms/imageUpload/ImageUpload.types.d.ts +1 -1
  49. package/build/esm/components/molecules/index.d.ts +1 -0
  50. package/build/esm/components/molecules/toolBannerCard/index.d.ts +2 -1
  51. package/build/esm/components/molecules/toolBannerCard/index.styles.d.ts +1 -0
  52. package/build/esm/components.js +104 -104
  53. package/build/esm/{constants-caf7f401.js → constants-9472a3e8.js} +1 -1
  54. package/build/esm/constants.js +3 -3
  55. package/build/esm/constantsDomainLocales.js +1 -1
  56. package/build/esm/constantsRiskScreener.js +2 -2
  57. package/build/esm/constantsSite.js +2 -2
  58. package/build/esm/{core-b3c608fe.js → core-5343cd24.js} +1 -1
  59. package/build/esm/{dataTransform-3515d696.js → dataTransform-27a2998c.js} +1 -1
  60. package/build/esm/ecom.js +5 -5
  61. package/build/esm/{editor-523fc10a.js → editor-f7e2180e.js} +11 -11
  62. package/build/esm/embeddedHeathToolCards_babyGrowth.js +25 -25
  63. package/build/esm/embeddedHeathToolCards_babyPoop.js +23 -23
  64. package/build/esm/embeddedHeathToolCards_babyVaccine.js +25 -25
  65. package/build/esm/embeddedHeathToolCards_bmi_bmi.js +30 -30
  66. package/build/esm/embeddedHeathToolCards_bmrBmr.js +28 -28
  67. package/build/esm/embeddedHeathToolCards_dueDate_dueDate.js +25 -25
  68. package/build/esm/embeddedHeathToolCards_ovulation_ovulation.js +25 -25
  69. package/build/esm/embeddedHeathToolCards_pwg_pwg.js +29 -29
  70. package/build/esm/embeddedHeathToolCards_targetHeartRate.js +30 -30
  71. package/build/esm/footer.js +22 -22
  72. package/build/esm/gAssets.js +2 -2
  73. package/build/esm/{healthTools-8e429882.js → healthTools-fcf3ed62.js} +1 -1
  74. package/build/esm/healthToolsCardWrapper.js +21 -21
  75. package/build/esm/healthToolsForm.js +35 -35
  76. package/build/esm/hooks.js +13 -13
  77. package/build/esm/i18n.js +2 -2
  78. package/build/esm/i18nV2.js +2 -2
  79. package/build/esm/{index-f02fdc64.js → index-08b748d9.js} +13 -13
  80. package/build/esm/{index-996abb43.js → index-1afa495f.js} +5 -5
  81. package/build/esm/{index-cb22faf0.js → index-1f2b4eae.js} +16 -16
  82. package/build/esm/{index-511acc18.js → index-213f4801.js} +1 -1
  83. package/build/esm/{index-fd5244fd.js → index-22e5ac4e.js} +16 -16
  84. package/build/esm/{index-98f46d65.js → index-280b0a3b.js} +5 -5
  85. package/build/esm/{index-b91a508d.js → index-2c6e4730.js} +17 -17
  86. package/build/esm/{index-8de94389.js → index-2c8b91f3.js} +16 -16
  87. package/build/esm/{index-ab4817a2.js → index-2f94f586.js} +14 -14
  88. package/build/esm/{index-b1db253e.js → index-3f99777e.js} +3 -3
  89. package/build/esm/{index-64b297f0.js → index-42c8616e.js} +4 -4
  90. package/build/esm/{index-8917cd74.js → index-43283d7d.js} +13 -13
  91. package/build/esm/{index-60e3d1e4.js → index-46e01ad8.js} +2 -2
  92. package/build/esm/{index-1c2cdacf.js → index-49010cee.js} +2 -2
  93. package/build/esm/{index-d53b5d64.js → index-4917810c.js} +21 -19
  94. package/build/esm/{index-20432f4d.js → index-53d23197.js} +21 -21
  95. package/build/esm/{index-53c0c15c.js → index-561d81a0.js} +15 -15
  96. package/build/esm/{index-45f2a2ff.js → index-56222c40.js} +6 -6
  97. package/build/esm/{index-2b1fb52f.js → index-584bb04d.js} +2 -2
  98. package/build/esm/{index-fff4f6bc.js → index-5a3c605d.js} +2 -2
  99. package/build/esm/{index-a5fd40a5.js → index-5b44cc22.js} +14 -14
  100. package/build/esm/{index-951beea9.js → index-5c562bc7.js} +3 -3
  101. package/build/esm/{index-721b2e05.js → index-5fdf0fc7.js} +3 -3
  102. package/build/esm/{index-a9dca53e.js → index-61dd2567.js} +6 -6
  103. package/build/esm/{index-3ac6d865.js → index-65c6cf70.js} +1 -1
  104. package/build/esm/{index-c9cb43ad.js → index-664006ba.js} +19 -19
  105. package/build/esm/{index-5d2245db.js → index-6a57a6dd.js} +3 -3
  106. package/build/esm/{index-52b97545.js → index-6debe34a.js} +2 -2
  107. package/build/esm/{index-73d5e63f.js → index-722556b5.js} +2 -2
  108. package/build/esm/{index-0e912e3d.js → index-75f15a53.js} +10 -10
  109. package/build/esm/{index-edc0ac81.js → index-768151fa.js} +2 -2
  110. package/build/esm/{index-cbee7a4c.js → index-7f7053a8.js} +32 -32
  111. package/build/esm/{index-f6e7941f.js → index-8119be96.js} +7 -7
  112. package/build/esm/{index-f05c70f1.js → index-86cc3cc7.js} +2 -2
  113. package/build/esm/{index-edc629c4.js → index-8b589c6c.js} +2 -2
  114. package/build/esm/{index-d14dcfff.js → index-8b90aade.js} +26 -26
  115. package/build/esm/{index-fef013de.js → index-8b9ac9c8.js} +3 -3
  116. package/build/esm/{index-f4b041dc.js → index-8f66eb8d.js} +2 -2
  117. package/build/esm/{index-08971f1f.js → index-904ab29f.js} +25 -25
  118. package/build/esm/{index-56150381.js → index-9376ca20.js} +15 -15
  119. package/build/esm/{index-964f9e56.js → index-972dc587.js} +1 -1
  120. package/build/esm/{index-dcfca694.js → index-9bacf266.js} +1 -1
  121. package/build/esm/{index-6dacf78c.js → index-9cad0276.js} +22 -22
  122. package/build/esm/{index-4872bbe7.js → index-9d570802.js} +3 -3
  123. package/build/esm/{index-6f8dbe22.js → index-a3859f7d.js} +1 -1
  124. package/build/esm/{index-c6b73aab.js → index-a6f36fca.js} +4 -4
  125. package/build/esm/{index-b28a3ef4.js → index-aa3c701a.js} +21 -21
  126. package/build/esm/{index-403c2a28.js → index-abcfe180.js} +18 -18
  127. package/build/esm/{index-c40d00ff.js → index-b216181e.js} +32 -32
  128. package/build/esm/{index-9d64f5f1.js → index-b3877ccd.js} +2 -2
  129. package/build/esm/{index-ce252ef8.js → index-b45be35b.js} +9 -9
  130. package/build/esm/{index-6ed392f4.js → index-bcb4f5ca.js} +18 -18
  131. package/build/esm/{index-5cb939c4.js → index-c4767e99.js} +30 -30
  132. package/build/esm/{index-149a4bcb.js → index-c6e6304d.js} +3 -3
  133. package/build/esm/{index-567dc818.js → index-c7220d78.js} +14 -14
  134. package/build/esm/{index-31c51745.js → index-c91b3f0c.js} +24 -16
  135. package/build/esm/{index-54ebeb31.js → index-cb27e7bc.js} +2 -2
  136. package/build/esm/{index-54fe9407.js → index-d5e5f756.js} +2 -2
  137. package/build/esm/{index-0bfcb7a7.js → index-d930067d.js} +8 -8
  138. package/build/esm/{index-afe9a4e2.js → index-dc5cc783.js} +2 -2
  139. package/build/esm/{index-5266aa5a.js → index-dedc22cb.js} +3 -3
  140. package/build/esm/{index-d1783286.js → index-e16300cd.js} +7 -7
  141. package/build/esm/{index-a9699ec7.js → index-e4f827a1.js} +1 -1
  142. package/build/esm/{index-b9d5c802.js → index-e53e6952.js} +16 -16
  143. package/build/esm/{index-ce445296.js → index-ef0f0c3d.js} +2 -2
  144. package/build/esm/{index-e8949828.js → index-efc6e879.js} +2 -2
  145. package/build/esm/{index-d8f453a0.js → index-f4894e84.js} +2 -2
  146. package/build/esm/{index-ab69f10d.js → index-f52961c9.js} +6 -6
  147. package/build/esm/{index-ad488b88.js → index-f827c03e.js} +6 -6
  148. package/build/esm/{index-9dfc29f3.js → index-f9d633c2.js} +11 -11
  149. package/build/esm/{index-8f1de26c.js → index-fc0aaebc.js} +1 -1
  150. package/build/esm/index.js +124 -124
  151. package/build/esm/{labelSorting-0fd4918a.js → labelSorting-b440189f.js} +4 -4
  152. package/build/esm/lead.js +35 -35
  153. package/build/esm/{logoIcon-62836f8c.js → logoIcon-02eba59c.js} +2 -2
  154. package/build/esm/mantine.js +38 -29
  155. package/build/esm/misc.js +19 -19
  156. package/build/esm/miscGetDynamicHealthTool.js +4 -4
  157. package/build/esm/miscGetSocialList.js +8 -8
  158. package/build/esm/miscScreenSizeContext.js +1 -1
  159. package/build/esm/mobileBottomNavigation.js +5 -5
  160. package/build/esm/mobileBottomNavigationIcon.js +5 -5
  161. package/build/esm/molecules.js +78 -78
  162. package/build/esm/moleculesArticleCard.js +6 -6
  163. package/build/esm/moleculesArticleCardV2.js +17 -17
  164. package/build/esm/navigation.js +47 -47
  165. package/build/esm/navigationLogoutPopup.js +11 -11
  166. package/build/esm/navigationProfileButton.js +27 -27
  167. package/build/esm/onboardingV2.js +30 -30
  168. package/build/esm/organisms.js +57 -57
  169. package/build/esm/{post-ab57e2b0.js → post-3ab28edc.js} +2 -2
  170. package/build/esm/profileNavigation.js +20 -20
  171. package/build/esm/progressBar.js +1 -1
  172. package/build/esm/pwg.js +23 -23
  173. package/build/esm/ssoV2.js +40 -33
  174. package/build/esm/{store-f42a8f4f.js → store-4279a82a.js} +3 -3
  175. package/build/esm/subot/index.d.ts +0 -1
  176. package/build/esm/subot/subotInlineRevamp/context.d.ts +1 -1
  177. package/build/esm/subot/subotInlineRevamp/types.d.ts +0 -2
  178. package/build/esm/subot.js +112 -3266
  179. package/build/esm/surveyOrPremiumBanner.js +34 -34
  180. package/build/esm/surveyQuestionCard.js +11 -11
  181. package/build/esm/{surveyThankyouCard-ac2abcb9.js → surveyThankyouCard-cc6d97ad.js} +5 -5
  182. package/build/esm/together/togetherComponentGlobalContext.d.ts +0 -2
  183. package/build/esm/together.js +57 -57
  184. package/build/esm/togetherApiUtils.js +4 -4
  185. package/build/esm/togetherAtoms.js +31 -31
  186. package/build/esm/togetherComponentGlobalContext.js +4 -4
  187. package/build/esm/togetherMolecules.js +52 -52
  188. package/build/esm/togetherMoleculesCardAuthor.js +29 -29
  189. package/build/esm/togetherMoleculesPostImagePreview.js +11 -11
  190. package/build/esm/togetherMoleculesProfileDetail.js +40 -40
  191. package/build/esm/togetherOrganisms.js +51 -51
  192. package/build/esm/togetherRichTextEditor.js +18 -18
  193. package/build/esm/togetherShareBox.js +10 -10
  194. package/build/esm/{translationsProvider-bc7bb19e.js → translationsProvider-b3906c55.js} +1 -1
  195. package/build/esm/{treePopoverMenu-81ce88c8.js → treePopoverMenu-64b815db.js} +19 -19
  196. package/build/esm/types.js +2 -2
  197. package/build/esm/{useHealthToolCache-e7a8f1c0.js → useHealthToolCache-7a07e506.js} +1 -1
  198. package/build/esm/{usePhoneValidator-847efa33.js → usePhoneValidator-7965267d.js} +5 -5
  199. package/build/esm/{usePlacesAutocomplete-4840df17.js → usePlacesAutocomplete-dacf815b.js} +1 -1
  200. package/build/esm/useTogetherAuthRequiredAction.js +10 -10
  201. package/build/esm/{utils-a3da270b.js → utils-40fae116.js} +2 -2
  202. package/build/esm/{utils-729cdc67.js → utils-9ccad345.js} +2 -2
  203. package/build/esm/{utils-6d192108.js → utils-a5a71a6a.js} +5 -5
  204. package/build/esm/{utils-b0048afb.js → utils-c3fa1c36.js} +3 -3
  205. package/build/esm/vaccination.js +22 -22
  206. package/build/footer.js +22 -22
  207. package/build/gAssets.js +2 -2
  208. package/build/{healthTools-cc7f7bd4.js → healthTools-ccd56fee.js} +1 -1
  209. package/build/healthToolsCardWrapper.js +21 -21
  210. package/build/healthToolsForm.js +35 -35
  211. package/build/hooks.js +13 -13
  212. package/build/i18n.js +2 -2
  213. package/build/i18nV2.js +1 -1
  214. package/build/{index-27fd0818.js → index-015d8df4.js} +26 -26
  215. package/build/{index-91155464.js → index-097109e4.js} +18 -18
  216. package/build/{index-067172d3.js → index-0a600778.js} +2 -2
  217. package/build/{index-bb708ad9.js → index-0cbc8e14.js} +2 -2
  218. package/build/{index-39a1078b.js → index-0d8a1288.js} +10 -10
  219. package/build/{index-0ed32cef.js → index-0e1c1ea3.js} +3 -3
  220. package/build/{index-66b2d679.js → index-13832879.js} +13 -13
  221. package/build/{index-d931c8ba.js → index-16a22b24.js} +24 -16
  222. package/build/{index-7c828549.js → index-16de00ea.js} +16 -16
  223. package/build/{index-44db8cd9.js → index-185a0844.js} +2 -2
  224. package/build/{index-680feff3.js → index-1bb1c894.js} +16 -16
  225. package/build/{index-b5e6bc91.js → index-20a92497.js} +4 -4
  226. package/build/{index-75e5e9d7.js → index-219c0ee4.js} +2 -2
  227. package/build/{index-892b0d64.js → index-2618fd79.js} +1 -1
  228. package/build/{index-1789c0a7.js → index-2ee7b9db.js} +32 -32
  229. package/build/{index-b398bc9b.js → index-31cb68a3.js} +30 -30
  230. package/build/{index-a9708d5f.js → index-33d2e571.js} +2 -2
  231. package/build/{index-c9a430e6.js → index-3500ac3f.js} +15 -15
  232. package/build/{index-43ad56ee.js → index-35229a7e.js} +2 -2
  233. package/build/{index-fb6d43fc.js → index-3a51ec3d.js} +11 -11
  234. package/build/{index-a3558ddc.js → index-41571984.js} +2 -2
  235. package/build/{index-678a9150.js → index-48cd6eef.js} +25 -25
  236. package/build/{index-f55b3ea6.js → index-4a89e0f6.js} +19 -19
  237. package/build/{index-b4cd31c0.js → index-4d463a04.js} +3 -3
  238. package/build/{index-95009a2e.js → index-4f0a5b11.js} +21 -21
  239. package/build/{index-36de050c.js → index-53d5cb37.js} +14 -14
  240. package/build/{index-4cb982a4.js → index-55054438.js} +2 -2
  241. package/build/{index-9d2837ac.js → index-566fbe6a.js} +3 -3
  242. package/build/{index-b04d6383.js → index-57c25707.js} +32 -32
  243. package/build/{index-fe4eb025.js → index-5d787993.js} +22 -22
  244. package/build/{index-67239715.js → index-61871988.js} +1 -1
  245. package/build/{index-49773cab.js → index-6b3d5c92.js} +4 -4
  246. package/build/{index-e6b98c89.js → index-6bef99e9.js} +2 -2
  247. package/build/{index-1c277235.js → index-6d732b5d.js} +16 -16
  248. package/build/{index-b1d04c64.js → index-72a68b8d.js} +2 -2
  249. package/build/{index-ed8c76cc.js → index-7bf8ef88.js} +3 -3
  250. package/build/{index-2a5e38df.js → index-7e06711d.js} +2 -2
  251. package/build/{index-2962cc0c.js → index-8082f5c3.js} +14 -14
  252. package/build/{index-ddecc6c2.js → index-88478773.js} +5 -5
  253. package/build/{index-00b2f88c.js → index-88c922e9.js} +1 -1
  254. package/build/{index-e0d8430c.js → index-8c51bc2a.js} +3 -3
  255. package/build/{index-4dfbf5c1.js → index-8c6f33a0.js} +15 -15
  256. package/build/{index-e646ade7.js → index-8e173c21.js} +8 -8
  257. package/build/{index-9fba8aa7.js → index-91b90c2c.js} +7 -7
  258. package/build/{index-ef085c19.js → index-92a6e9a3.js} +21 -21
  259. package/build/{index-925601e8.js → index-988256f0.js} +3 -3
  260. package/build/{index-359a62d0.js → index-9d03e100.js} +21 -18
  261. package/build/{index-4d6cb97d.js → index-a05cfb79.js} +2 -2
  262. package/build/{index-49e6fbd6.js → index-a1690241.js} +1 -1
  263. package/build/{index-f833dfe5.js → index-a1f27506.js} +14 -14
  264. package/build/{index-94e9e3fc.js → index-a5a251f2.js} +2 -2
  265. package/build/{index-720333cf.js → index-acf7e6e6.js} +6 -6
  266. package/build/{index-9019438a.js → index-b01da559.js} +3 -3
  267. package/build/{index-45e04c31.js → index-b0e8f8c0.js} +2 -2
  268. package/build/{index-d3e457cc.js → index-b30bf9af.js} +17 -17
  269. package/build/{index-79aff4ce.js → index-be21f9fa.js} +3 -3
  270. package/build/{index-21980f75.js → index-cb226aa5.js} +9 -9
  271. package/build/{index-93d73819.js → index-cb616ac8.js} +6 -6
  272. package/build/{index-52af3f0e.js → index-cba20e24.js} +13 -13
  273. package/build/{index-09368a70.js → index-cd639ef4.js} +1 -1
  274. package/build/{index-ad5280b0.js → index-d9a0b352.js} +1 -1
  275. package/build/{index-15560934.js → index-e3df463b.js} +16 -16
  276. package/build/{index-06330a74.js → index-e47587c7.js} +18 -18
  277. package/build/{index-1668bfe3.js → index-e65d687b.js} +1 -1
  278. package/build/{index-79c961b8.js → index-ef2d8114.js} +6 -6
  279. package/build/{index-d60f0838.js → index-efdb9925.js} +7 -7
  280. package/build/{index-4654b42b.js → index-f3467a43.js} +6 -6
  281. package/build/{index-31a876ea.js → index-f4e669e3.js} +5 -5
  282. package/build/{index-4dea3a2d.js → index-f5a32102.js} +2 -2
  283. package/build/{index-d57d1d00.js → index-fd97f12e.js} +2 -2
  284. package/build/{index-b2a7156e.js → index-ff164c96.js} +2 -2
  285. package/build/index.js +125 -124
  286. package/build/{labelSorting-196e884d.js → labelSorting-0a10639c.js} +4 -4
  287. package/build/lead.js +35 -35
  288. package/build/{logoIcon-cc0bb30f.js → logoIcon-34ff722d.js} +2 -2
  289. package/build/mantine.js +48 -40
  290. package/build/misc.js +19 -19
  291. package/build/miscGetDynamicHealthTool.js +4 -4
  292. package/build/miscGetSocialList.js +8 -8
  293. package/build/miscScreenSizeContext.js +1 -1
  294. package/build/mobileBottomNavigation.js +5 -5
  295. package/build/mobileBottomNavigationIcon.js +5 -5
  296. package/build/molecules.js +79 -78
  297. package/build/moleculesArticleCard.js +6 -6
  298. package/build/moleculesArticleCardV2.js +17 -17
  299. package/build/navigation.js +47 -47
  300. package/build/navigationLogoutPopup.js +11 -11
  301. package/build/navigationProfileButton.js +27 -27
  302. package/build/onboardingV2.js +29 -29
  303. package/build/organisms.js +57 -57
  304. package/build/{post-001ae8e8.js → post-bbe835b7.js} +2 -2
  305. package/build/profileNavigation.js +20 -20
  306. package/build/progressBar.js +1 -1
  307. package/build/pwg.js +23 -23
  308. package/build/ssoV2.js +39 -32
  309. package/build/{store-2da70e72.js → store-87a5078f.js} +3 -3
  310. package/build/subot/index.d.ts +0 -1
  311. package/build/subot/subotInlineRevamp/context.d.ts +1 -1
  312. package/build/subot/subotInlineRevamp/types.d.ts +0 -2
  313. package/build/subot.js +113 -3269
  314. package/build/surveyOrPremiumBanner.js +34 -34
  315. package/build/surveyQuestionCard.js +11 -11
  316. package/build/{surveyThankyouCard-6956aa3d.js → surveyThankyouCard-d5c3d763.js} +5 -5
  317. package/build/together/togetherComponentGlobalContext.d.ts +0 -2
  318. package/build/together.js +57 -57
  319. package/build/togetherApiUtils.js +4 -4
  320. package/build/togetherAtoms.js +31 -31
  321. package/build/togetherComponentGlobalContext.js +4 -4
  322. package/build/togetherMolecules.js +52 -52
  323. package/build/togetherMoleculesCardAuthor.js +29 -29
  324. package/build/togetherMoleculesPostImagePreview.js +11 -11
  325. package/build/togetherMoleculesProfileDetail.js +40 -40
  326. package/build/togetherOrganisms.js +51 -51
  327. package/build/togetherRichTextEditor.js +18 -18
  328. package/build/togetherShareBox.js +10 -10
  329. package/build/{translationsProvider-43219c08.js → translationsProvider-b852d070.js} +1 -1
  330. package/build/{treePopoverMenu-4e62e518.js → treePopoverMenu-38ec7824.js} +19 -19
  331. package/build/types.js +2 -2
  332. package/build/{useHealthToolCache-3827bd4e.js → useHealthToolCache-9abe8e95.js} +1 -1
  333. package/build/{usePhoneValidator-817754ff.js → usePhoneValidator-244464fd.js} +5 -5
  334. package/build/{usePlacesAutocomplete-e639f288.js → usePlacesAutocomplete-fc2c2088.js} +1 -1
  335. package/build/useTogetherAuthRequiredAction.js +10 -10
  336. package/build/{utils-26b1e1e7.js → utils-5e96bc42.js} +3 -3
  337. package/build/{utils-6085ecda.js → utils-9e5d8888.js} +2 -2
  338. package/build/{utils-43d539c6.js → utils-cbaa2696.js} +2 -2
  339. package/build/{utils-5f75acd6.js → utils-e4e8962e.js} +5 -5
  340. package/build/vaccination.js +22 -22
  341. package/package.json +2 -4
  342. package/build/esm/index-7813ad6b.js +0 -16
  343. package/build/esm/subot/hooks/useVerifyPhoneNumber.d.ts +0 -1
  344. package/build/esm/subot/subotInline/assets/arrow-down.d.ts +0 -3
  345. package/build/esm/subot/subotInline/assets/arrow-left.d.ts +0 -3
  346. package/build/esm/subot/subotInline/assets/arrow-right.d.ts +0 -3
  347. package/build/esm/subot/subotInline/assets/arrow-up.d.ts +0 -3
  348. package/build/esm/subot/subotInline/assets/check.d.ts +0 -3
  349. package/build/esm/subot/subotInline/assets/checkbox.d.ts +0 -3
  350. package/build/esm/subot/subotInline/assets/chevronRightActive.d.ts +0 -3
  351. package/build/esm/subot/subotInline/assets/dislike-article.d.ts +0 -3
  352. package/build/esm/subot/subotInline/assets/index.d.ts +0 -10
  353. package/build/esm/subot/subotInline/assets/like-article.d.ts +0 -3
  354. package/build/esm/subot/subotInline/assets/rotate-left.d.ts +0 -3
  355. package/build/esm/subot/subotInline/index.d.ts +0 -4
  356. package/build/esm/subot/subotInline/index.styled.d.ts +0 -67
  357. package/build/esm/subot/subotInline/subotInline.config.d.ts +0 -38
  358. package/build/esm/subot/subotInline/subotInlineAction/index.d.ts +0 -25
  359. package/build/esm/subot/subotInline/subotInlineAction/subotInlineAction.d.ts +0 -4
  360. package/build/esm/subot/subotInline/subotInlineAction/subotInlineAction.styled.d.ts +0 -54
  361. package/build/esm/subot/subotInline/subotInlineFooter.d.ts +0 -17
  362. package/build/esm/subot/subotInline/subotInlineHeader.d.ts +0 -3
  363. package/build/esm/subot/subotInline/subotInlineIntent/index.d.ts +0 -100
  364. package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntent.d.ts +0 -4
  365. package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntent.styled.d.ts +0 -159
  366. package/build/esm/subot/subotInline/subotInlineIntent/subotInlineIntentFinal.d.ts +0 -4
  367. package/build/esm/subot/subotInline/subotInlineNode/SubotInlineNodeResultPoll.d.ts +0 -4
  368. package/build/esm/subot/subotInline/subotInlineNode/index.d.ts +0 -15
  369. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNode.d.ts +0 -5
  370. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNode.styled.d.ts +0 -74
  371. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeFinal.d.ts +0 -4
  372. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeFinalThankYou.d.ts +0 -4
  373. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeForm.d.ts +0 -4
  374. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeImage.d.ts +0 -4
  375. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeMultiple.d.ts +0 -4
  376. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeOTP.d.ts +0 -4
  377. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodePoll.d.ts +0 -4
  378. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeRating.d.ts +0 -4
  379. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeReaction.d.ts +0 -4
  380. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeReview.d.ts +0 -4
  381. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeSSO.d.ts +0 -4
  382. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeStart.d.ts +0 -4
  383. package/build/esm/subot/subotInline/subotInlineNode/subotInlineNodeText.d.ts +0 -4
  384. package/build/index-1d96712d.js +0 -22
  385. package/build/subot/hooks/useVerifyPhoneNumber.d.ts +0 -1
  386. package/build/subot/subotInline/assets/arrow-down.d.ts +0 -3
  387. package/build/subot/subotInline/assets/arrow-left.d.ts +0 -3
  388. package/build/subot/subotInline/assets/arrow-right.d.ts +0 -3
  389. package/build/subot/subotInline/assets/arrow-up.d.ts +0 -3
  390. package/build/subot/subotInline/assets/check.d.ts +0 -3
  391. package/build/subot/subotInline/assets/checkbox.d.ts +0 -3
  392. package/build/subot/subotInline/assets/chevronRightActive.d.ts +0 -3
  393. package/build/subot/subotInline/assets/dislike-article.d.ts +0 -3
  394. package/build/subot/subotInline/assets/index.d.ts +0 -10
  395. package/build/subot/subotInline/assets/like-article.d.ts +0 -3
  396. package/build/subot/subotInline/assets/rotate-left.d.ts +0 -3
  397. package/build/subot/subotInline/index.d.ts +0 -4
  398. package/build/subot/subotInline/index.styled.d.ts +0 -67
  399. package/build/subot/subotInline/subotInline.config.d.ts +0 -38
  400. package/build/subot/subotInline/subotInlineAction/index.d.ts +0 -25
  401. package/build/subot/subotInline/subotInlineAction/subotInlineAction.d.ts +0 -4
  402. package/build/subot/subotInline/subotInlineAction/subotInlineAction.styled.d.ts +0 -54
  403. package/build/subot/subotInline/subotInlineFooter.d.ts +0 -17
  404. package/build/subot/subotInline/subotInlineHeader.d.ts +0 -3
  405. package/build/subot/subotInline/subotInlineIntent/index.d.ts +0 -100
  406. package/build/subot/subotInline/subotInlineIntent/subotInlineIntent.d.ts +0 -4
  407. package/build/subot/subotInline/subotInlineIntent/subotInlineIntent.styled.d.ts +0 -159
  408. package/build/subot/subotInline/subotInlineIntent/subotInlineIntentFinal.d.ts +0 -4
  409. package/build/subot/subotInline/subotInlineNode/SubotInlineNodeResultPoll.d.ts +0 -4
  410. package/build/subot/subotInline/subotInlineNode/index.d.ts +0 -15
  411. package/build/subot/subotInline/subotInlineNode/subotInlineNode.d.ts +0 -5
  412. package/build/subot/subotInline/subotInlineNode/subotInlineNode.styled.d.ts +0 -74
  413. package/build/subot/subotInline/subotInlineNode/subotInlineNodeFinal.d.ts +0 -4
  414. package/build/subot/subotInline/subotInlineNode/subotInlineNodeFinalThankYou.d.ts +0 -4
  415. package/build/subot/subotInline/subotInlineNode/subotInlineNodeForm.d.ts +0 -4
  416. package/build/subot/subotInline/subotInlineNode/subotInlineNodeImage.d.ts +0 -4
  417. package/build/subot/subotInline/subotInlineNode/subotInlineNodeMultiple.d.ts +0 -4
  418. package/build/subot/subotInline/subotInlineNode/subotInlineNodeOTP.d.ts +0 -4
  419. package/build/subot/subotInline/subotInlineNode/subotInlineNodePoll.d.ts +0 -4
  420. package/build/subot/subotInline/subotInlineNode/subotInlineNodeRating.d.ts +0 -4
  421. package/build/subot/subotInline/subotInlineNode/subotInlineNodeReaction.d.ts +0 -4
  422. package/build/subot/subotInline/subotInlineNode/subotInlineNodeReview.d.ts +0 -4
  423. package/build/subot/subotInline/subotInlineNode/subotInlineNodeSSO.d.ts +0 -4
  424. package/build/subot/subotInline/subotInlineNode/subotInlineNodeStart.d.ts +0 -4
  425. package/build/subot/subotInline/subotInlineNode/subotInlineNodeText.d.ts +0 -4
  426. /package/build/{BMI_BOYS.percentile.monthly-60f82506.js → BMI_BOYS.percentile.monthly-6b31557e.js} +0 -0
  427. /package/build/{BMI_BOYS.percentile.weekly-23b197c8.js → BMI_BOYS.percentile.weekly-978f2d7d.js} +0 -0
  428. /package/build/{BMI_BOYS.percentile.yearly-e4436868.js → BMI_BOYS.percentile.yearly-e829f962.js} +0 -0
  429. /package/build/{BMI_BOYS.zscore.monthly-22433c7c.js → BMI_BOYS.zscore.monthly-213f96ad.js} +0 -0
  430. /package/build/{BMI_BOYS.zscore.weekly-b673727e.js → BMI_BOYS.zscore.weekly-b6db0a53.js} +0 -0
  431. /package/build/{BMI_BOYS.zscore.yearly-bcfedde8.js → BMI_BOYS.zscore.yearly-ee505a09.js} +0 -0
  432. /package/build/{BMI_GIRLS.percentile.monthly-084a291a.js → BMI_GIRLS.percentile.monthly-3e3b72fe.js} +0 -0
  433. /package/build/{BMI_GIRLS.percentile.weekly-bb187a30.js → BMI_GIRLS.percentile.weekly-c953d8d4.js} +0 -0
  434. /package/build/{BMI_GIRLS.percentile.yearly-cdc1ba56.js → BMI_GIRLS.percentile.yearly-59725d0f.js} +0 -0
  435. /package/build/{BMI_GIRLS.zscore.monthly-44c22eb5.js → BMI_GIRLS.zscore.monthly-b79d105e.js} +0 -0
  436. /package/build/{BMI_GIRLS.zscore.weekly-10d64352.js → BMI_GIRLS.zscore.weekly-44b6c00a.js} +0 -0
  437. /package/build/{BMI_GIRLS.zscore.yearly-68eee873.js → BMI_GIRLS.zscore.yearly-39c7714b.js} +0 -0
  438. /package/build/{ChevronDown-8175a512.js → ChevronDown-5b13538e.js} +0 -0
  439. /package/build/{Close-095c959d.js → Close-37600026.js} +0 -0
  440. /package/build/{Google-670a4950.js → Google-1da35685.js} +0 -0
  441. /package/build/{HEAD CIRCUM_BOYS.percentile.monthly-8a5aa874.js → HEAD CIRCUM_BOYS.percentile.monthly-0efa0492.js} +0 -0
  442. /package/build/{HEAD CIRCUM_BOYS.percentile.weekly-7127b69d.js → HEAD CIRCUM_BOYS.percentile.weekly-ee06afe8.js} +0 -0
  443. /package/build/{HEAD CIRCUM_BOYS.percentile.yearly-239cd74a.js → HEAD CIRCUM_BOYS.percentile.yearly-5e0c8746.js} +0 -0
  444. /package/build/{HEAD CIRCUM_BOYS.zscore.monthly-4c28fb5f.js → HEAD CIRCUM_BOYS.zscore.monthly-6dc514c0.js} +0 -0
  445. /package/build/{HEAD CIRCUM_BOYS.zscore.weekly-2e8039b5.js → HEAD CIRCUM_BOYS.zscore.weekly-9b5a704e.js} +0 -0
  446. /package/build/{HEAD CIRCUM_BOYS.zscore.yearly-373b0a2b.js → HEAD CIRCUM_BOYS.zscore.yearly-6cb50ffc.js} +0 -0
  447. /package/build/{HEAD CIRCUM_GIRLS.percentile.monthly-990957b1.js → HEAD CIRCUM_GIRLS.percentile.monthly-cdb93c7e.js} +0 -0
  448. /package/build/{HEAD CIRCUM_GIRLS.percentile.weekly-7cdc62b1.js → HEAD CIRCUM_GIRLS.percentile.weekly-605c07aa.js} +0 -0
  449. /package/build/{HEAD CIRCUM_GIRLS.percentile.yearly-a136734e.js → HEAD CIRCUM_GIRLS.percentile.yearly-4f6df473.js} +0 -0
  450. /package/build/{HEAD CIRCUM_GIRLS.zscore.monthly-e956ce03.js → HEAD CIRCUM_GIRLS.zscore.monthly-14b5d499.js} +0 -0
  451. /package/build/{HEAD CIRCUM_GIRLS.zscore.weekly-21abfcbf.js → HEAD CIRCUM_GIRLS.zscore.weekly-4a869ab8.js} +0 -0
  452. /package/build/{HEAD CIRCUM_GIRLS.zscore.yearly-16055c63.js → HEAD CIRCUM_GIRLS.zscore.yearly-b66cc8ae.js} +0 -0
  453. /package/build/{HEIGHT_BOYS.percentile.monthly-ee154519.js → HEIGHT_BOYS.percentile.monthly-da57f20d.js} +0 -0
  454. /package/build/{HEIGHT_BOYS.percentile.weekly-8e114bac.js → HEIGHT_BOYS.percentile.weekly-e02783b8.js} +0 -0
  455. /package/build/{HEIGHT_BOYS.percentile.yearly-02efa845.js → HEIGHT_BOYS.percentile.yearly-52b9f922.js} +0 -0
  456. /package/build/{HEIGHT_BOYS.zscore.monthly-c33564be.js → HEIGHT_BOYS.zscore.monthly-e7f988b0.js} +0 -0
  457. /package/build/{HEIGHT_BOYS.zscore.weekly-98e0f1ff.js → HEIGHT_BOYS.zscore.weekly-d5cf3e0c.js} +0 -0
  458. /package/build/{HEIGHT_BOYS.zscore.yearly-395a2760.js → HEIGHT_BOYS.zscore.yearly-e100ba9f.js} +0 -0
  459. /package/build/{HEIGHT_GIRLS.percentile.monthly-8ae75147.js → HEIGHT_GIRLS.percentile.monthly-de5fe181.js} +0 -0
  460. /package/build/{HEIGHT_GIRLS.percentile.weekly-b14734fd.js → HEIGHT_GIRLS.percentile.weekly-8f812859.js} +0 -0
  461. /package/build/{HEIGHT_GIRLS.percentile.yearly-c689b064.js → HEIGHT_GIRLS.percentile.yearly-01cdc98e.js} +0 -0
  462. /package/build/{HEIGHT_GIRLS.zscore.monthly-0fa70fae.js → HEIGHT_GIRLS.zscore.monthly-645b4643.js} +0 -0
  463. /package/build/{HEIGHT_GIRLS.zscore.weekly-64f0ba61.js → HEIGHT_GIRLS.zscore.weekly-0a42e395.js} +0 -0
  464. /package/build/{HEIGHT_GIRLS.zscore.yearly-9c8810f1.js → HEIGHT_GIRLS.zscore.yearly-2c7a0e47.js} +0 -0
  465. /package/build/{Locale-a5daca00.js → Locale-ec6930da.js} +0 -0
  466. /package/build/{Visible-d13603fc.js → Visible-0f3e8cb0.js} +0 -0
  467. /package/build/{WEIGHT_BOYS.percentile.monthly-14cba298.js → WEIGHT_BOYS.percentile.monthly-b1b634ac.js} +0 -0
  468. /package/build/{WEIGHT_BOYS.percentile.weekly-28c8f3a2.js → WEIGHT_BOYS.percentile.weekly-c62ecd15.js} +0 -0
  469. /package/build/{WEIGHT_BOYS.percentile.yearly-2d97dad0.js → WEIGHT_BOYS.percentile.yearly-70a4135e.js} +0 -0
  470. /package/build/{WEIGHT_BOYS.zscore.monthly-5fc5d222.js → WEIGHT_BOYS.zscore.monthly-c4974073.js} +0 -0
  471. /package/build/{WEIGHT_BOYS.zscore.weekly-d8f812f3.js → WEIGHT_BOYS.zscore.weekly-602e2a98.js} +0 -0
  472. /package/build/{WEIGHT_BOYS.zscore.yearly-e21c2a9e.js → WEIGHT_BOYS.zscore.yearly-8217903b.js} +0 -0
  473. /package/build/{WEIGHT_GIRLS.percentile.monthly-eef966d0.js → WEIGHT_GIRLS.percentile.monthly-87394741.js} +0 -0
  474. /package/build/{WEIGHT_GIRLS.percentile.weekly-d88f468e.js → WEIGHT_GIRLS.percentile.weekly-a4a9669e.js} +0 -0
  475. /package/build/{WEIGHT_GIRLS.percentile.yearly-1b945ede.js → WEIGHT_GIRLS.percentile.yearly-9880623f.js} +0 -0
  476. /package/build/{WEIGHT_GIRLS.zscore.monthly-d3af3c1c.js → WEIGHT_GIRLS.zscore.monthly-2bd8a394.js} +0 -0
  477. /package/build/{WEIGHT_GIRLS.zscore.weekly-f1e4016a.js → WEIGHT_GIRLS.zscore.weekly-7b4399bc.js} +0 -0
  478. /package/build/{WEIGHT_GIRLS.zscore.yearly-08a22511.js → WEIGHT_GIRLS.zscore.yearly-0e23783b.js} +0 -0
  479. /package/build/{ageGenerate-3c092a37.js → ageGenerate-1169c87d.js} +0 -0
  480. /package/build/{animation-67178362.js → animation-c590f2df.js} +0 -0
  481. /package/build/{constants-e78d9b7b.js → constants-5a9d0603.js} +0 -0
  482. /package/build/{constants-4ef6dfa0.js → constants-bdfa27f7.js} +0 -0
  483. /package/build/{constants-c2154b85.js → constants-f0d2b8d5.js} +0 -0
  484. /package/build/{context-93fff98d.js → context-9a0d030c.js} +0 -0
  485. /package/build/{dataTransform-67532806.js → dataTransform-0fa9b2ac.js} +0 -0
  486. /package/build/esm/{BMI_BOYS.percentile.monthly-28da0759.js → BMI_BOYS.percentile.monthly-ef81b628.js} +0 -0
  487. /package/build/esm/{BMI_BOYS.percentile.weekly-94b74fe0.js → BMI_BOYS.percentile.weekly-43e2b140.js} +0 -0
  488. /package/build/esm/{BMI_BOYS.percentile.yearly-a74739c3.js → BMI_BOYS.percentile.yearly-4c0b7de4.js} +0 -0
  489. /package/build/esm/{BMI_BOYS.zscore.monthly-4ae2749c.js → BMI_BOYS.zscore.monthly-2b356da0.js} +0 -0
  490. /package/build/esm/{BMI_BOYS.zscore.weekly-be62c289.js → BMI_BOYS.zscore.weekly-588f6a2a.js} +0 -0
  491. /package/build/esm/{BMI_BOYS.zscore.yearly-cc58dd36.js → BMI_BOYS.zscore.yearly-e55a2144.js} +0 -0
  492. /package/build/esm/{BMI_GIRLS.percentile.monthly-85db6204.js → BMI_GIRLS.percentile.monthly-1866bec6.js} +0 -0
  493. /package/build/esm/{BMI_GIRLS.percentile.weekly-bbfc8553.js → BMI_GIRLS.percentile.weekly-3435bd85.js} +0 -0
  494. /package/build/esm/{BMI_GIRLS.percentile.yearly-1ca96066.js → BMI_GIRLS.percentile.yearly-8c118b3f.js} +0 -0
  495. /package/build/esm/{BMI_GIRLS.zscore.monthly-e241cc71.js → BMI_GIRLS.zscore.monthly-c515a3e4.js} +0 -0
  496. /package/build/esm/{BMI_GIRLS.zscore.weekly-3bca2df2.js → BMI_GIRLS.zscore.weekly-0876207d.js} +0 -0
  497. /package/build/esm/{BMI_GIRLS.zscore.yearly-6247e40e.js → BMI_GIRLS.zscore.yearly-8cac09b0.js} +0 -0
  498. /package/build/esm/{ChevronDown-d69481e3.js → ChevronDown-acca4caa.js} +0 -0
  499. /package/build/esm/{Close-df872805.js → Close-5a2afe8f.js} +0 -0
  500. /package/build/esm/{Google-4efa8d07.js → Google-400a74df.js} +0 -0
  501. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.monthly-eef3df92.js → HEAD CIRCUM_BOYS.percentile.monthly-906c9922.js} +0 -0
  502. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.weekly-329a07bc.js → HEAD CIRCUM_BOYS.percentile.weekly-891072b3.js} +0 -0
  503. /package/build/esm/{HEAD CIRCUM_BOYS.percentile.yearly-d807202b.js → HEAD CIRCUM_BOYS.percentile.yearly-cb1c4dc7.js} +0 -0
  504. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.monthly-a06300c1.js → HEAD CIRCUM_BOYS.zscore.monthly-f497d9ed.js} +0 -0
  505. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.weekly-a613c40d.js → HEAD CIRCUM_BOYS.zscore.weekly-a946edc1.js} +0 -0
  506. /package/build/esm/{HEAD CIRCUM_BOYS.zscore.yearly-5b3c7de7.js → HEAD CIRCUM_BOYS.zscore.yearly-22d27c38.js} +0 -0
  507. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.monthly-89107295.js → HEAD CIRCUM_GIRLS.percentile.monthly-6555943c.js} +0 -0
  508. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.weekly-c94fd8cd.js → HEAD CIRCUM_GIRLS.percentile.weekly-822011e4.js} +0 -0
  509. /package/build/esm/{HEAD CIRCUM_GIRLS.percentile.yearly-a6f5f015.js → HEAD CIRCUM_GIRLS.percentile.yearly-0c1358c2.js} +0 -0
  510. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.monthly-46a7f7b8.js → HEAD CIRCUM_GIRLS.zscore.monthly-f144fde0.js} +0 -0
  511. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.weekly-4ade540d.js → HEAD CIRCUM_GIRLS.zscore.weekly-417585ad.js} +0 -0
  512. /package/build/esm/{HEAD CIRCUM_GIRLS.zscore.yearly-770c541b.js → HEAD CIRCUM_GIRLS.zscore.yearly-35b6dd6c.js} +0 -0
  513. /package/build/esm/{HEIGHT_BOYS.percentile.monthly-475fb44d.js → HEIGHT_BOYS.percentile.monthly-b5134d44.js} +0 -0
  514. /package/build/esm/{HEIGHT_BOYS.percentile.weekly-104ce815.js → HEIGHT_BOYS.percentile.weekly-c387850f.js} +0 -0
  515. /package/build/esm/{HEIGHT_BOYS.percentile.yearly-ec88d3e9.js → HEIGHT_BOYS.percentile.yearly-a6b85401.js} +0 -0
  516. /package/build/esm/{HEIGHT_BOYS.zscore.monthly-3d5047a4.js → HEIGHT_BOYS.zscore.monthly-a7c902a8.js} +0 -0
  517. /package/build/esm/{HEIGHT_BOYS.zscore.weekly-7c977165.js → HEIGHT_BOYS.zscore.weekly-2f856f37.js} +0 -0
  518. /package/build/esm/{HEIGHT_BOYS.zscore.yearly-0a4bcc2d.js → HEIGHT_BOYS.zscore.yearly-f712a6f1.js} +0 -0
  519. /package/build/esm/{HEIGHT_GIRLS.percentile.monthly-135ab51a.js → HEIGHT_GIRLS.percentile.monthly-dcddaa1f.js} +0 -0
  520. /package/build/esm/{HEIGHT_GIRLS.percentile.weekly-3a1a6c7e.js → HEIGHT_GIRLS.percentile.weekly-37305420.js} +0 -0
  521. /package/build/esm/{HEIGHT_GIRLS.percentile.yearly-41523300.js → HEIGHT_GIRLS.percentile.yearly-026df0c0.js} +0 -0
  522. /package/build/esm/{HEIGHT_GIRLS.zscore.monthly-1c28c9d9.js → HEIGHT_GIRLS.zscore.monthly-8eaa85fc.js} +0 -0
  523. /package/build/esm/{HEIGHT_GIRLS.zscore.weekly-e4ba684a.js → HEIGHT_GIRLS.zscore.weekly-b92eac6d.js} +0 -0
  524. /package/build/esm/{HEIGHT_GIRLS.zscore.yearly-0e9cfc16.js → HEIGHT_GIRLS.zscore.yearly-3c88d4de.js} +0 -0
  525. /package/build/esm/{Locale-7ac6b152.js → Locale-b3c0ef4e.js} +0 -0
  526. /package/build/esm/{Visible-d8bd14a6.js → Visible-c62ca4eb.js} +0 -0
  527. /package/build/esm/{WEIGHT_BOYS.percentile.monthly-a5afbefd.js → WEIGHT_BOYS.percentile.monthly-b6edc37d.js} +0 -0
  528. /package/build/esm/{WEIGHT_BOYS.percentile.weekly-ac6f45bd.js → WEIGHT_BOYS.percentile.weekly-b67ed8aa.js} +0 -0
  529. /package/build/esm/{WEIGHT_BOYS.percentile.yearly-595c4f59.js → WEIGHT_BOYS.percentile.yearly-895fbc86.js} +0 -0
  530. /package/build/esm/{WEIGHT_BOYS.zscore.monthly-6601385d.js → WEIGHT_BOYS.zscore.monthly-1dfae056.js} +0 -0
  531. /package/build/esm/{WEIGHT_BOYS.zscore.weekly-6891ac30.js → WEIGHT_BOYS.zscore.weekly-32a73bc2.js} +0 -0
  532. /package/build/esm/{WEIGHT_BOYS.zscore.yearly-902f9c7f.js → WEIGHT_BOYS.zscore.yearly-2d226348.js} +0 -0
  533. /package/build/esm/{WEIGHT_GIRLS.percentile.monthly-46ecd4af.js → WEIGHT_GIRLS.percentile.monthly-c01a8296.js} +0 -0
  534. /package/build/esm/{WEIGHT_GIRLS.percentile.weekly-d1def9ae.js → WEIGHT_GIRLS.percentile.weekly-a57c604e.js} +0 -0
  535. /package/build/esm/{WEIGHT_GIRLS.percentile.yearly-6838811a.js → WEIGHT_GIRLS.percentile.yearly-27ca8230.js} +0 -0
  536. /package/build/esm/{WEIGHT_GIRLS.zscore.monthly-bd4a3321.js → WEIGHT_GIRLS.zscore.monthly-e6c08d9a.js} +0 -0
  537. /package/build/esm/{WEIGHT_GIRLS.zscore.weekly-ecbbce6a.js → WEIGHT_GIRLS.zscore.weekly-85c92281.js} +0 -0
  538. /package/build/esm/{WEIGHT_GIRLS.zscore.yearly-2e2ca313.js → WEIGHT_GIRLS.zscore.yearly-41a30f2c.js} +0 -0
  539. /package/build/esm/{ageGenerate-3cb2df4f.js → ageGenerate-ccd2e560.js} +0 -0
  540. /package/build/esm/{animation-1341b658.js → animation-76720a50.js} +0 -0
  541. /package/build/esm/{constants-f0540747.js → constants-3a147059.js} +0 -0
  542. /package/build/esm/{constants-394cd914.js → constants-7ef9402f.js} +0 -0
  543. /package/build/esm/{constants-4f19ceae.js → constants-da6dfd4d.js} +0 -0
  544. /package/build/esm/{context-e94fed67.js → context-2f409304.js} +0 -0
  545. /package/build/esm/{dataTransform-dd2ab291.js → dataTransform-a141a5b6.js} +0 -0
  546. /package/build/esm/{index-7d49f9d1.js → index-28c66fc1.js} +0 -0
  547. /package/build/esm/{index-db50baaf.js → index-30693067.js} +0 -0
  548. /package/build/esm/{index-e1c3e0e1.js → index-4ab96c95.js} +0 -0
  549. /package/build/esm/{index-98563c40.js → index-5a33a2af.js} +0 -0
  550. /package/build/esm/{index-423b816a.js → index-7cd1ff1c.js} +0 -0
  551. /package/build/esm/{index-be118f66.js → index-871a20be.js} +0 -0
  552. /package/build/esm/{index-9dccf86b.js → index-b3494961.js} +0 -0
  553. /package/build/esm/{index-e5b066b3.js → index-b52757bc.js} +0 -0
  554. /package/build/esm/{index-b5773a59.js → index-c0f625f9.js} +0 -0
  555. /package/build/esm/{index.styles-c89285e1.js → index.styles-dd14e23b.js} +0 -0
  556. /package/build/esm/{localizeNumberFormat-976aeebe.js → localizeNumberFormat-8cd4af1a.js} +0 -0
  557. /package/build/esm/{normalizeLink-10a7a278.js → normalizeLink-1c482bf9.js} +0 -0
  558. /package/build/esm/{number-f69b056a.js → number-25072852.js} +0 -0
  559. /package/build/esm/{paths-94499eed.js → paths-d7ff4026.js} +0 -0
  560. /package/build/esm/{shared-b9242dd5.js → shared-d5039f06.js} +0 -0
  561. /package/build/esm/{translationsContext-76d53c58.js → translationsContext-f1586547.js} +0 -0
  562. /package/build/esm/{tslib.es6-e6b0683d.js → tslib.es6-71c95f0d.js} +0 -0
  563. /package/build/esm/{types-0cb0eea6.js → types-bfc769b5.js} +0 -0
  564. /package/build/esm/{types-5b5cacb1.js → types-f1fa72fe.js} +0 -0
  565. /package/build/esm/{useIsInit-9f2f7310.js → useIsInit-8f570916.js} +0 -0
  566. /package/build/esm/{useOutsideClick-1255b7f7.js → useOutsideClick-ca9ef36d.js} +0 -0
  567. /package/build/esm/{useScrollbarSize-158e1a00.js → useScrollbarSize-d4943a3b.js} +0 -0
  568. /package/build/esm/{useUniqueId-168a619f.js → useUniqueId-82cda08a.js} +0 -0
  569. /package/build/esm/{utils-68c1eb3a.js → utils-468ff2e1.js} +0 -0
  570. /package/build/esm/{utils-de10a3e8.js → utils-829640ef.js} +0 -0
  571. /package/build/{index-957cfd5c.js → index-090b99aa.js} +0 -0
  572. /package/build/{index-b62d7c4a.js → index-24dc470e.js} +0 -0
  573. /package/build/{index-bebe6a05.js → index-4717a069.js} +0 -0
  574. /package/build/{index-a75ae137.js → index-48b4adf3.js} +0 -0
  575. /package/build/{index-d4709e01.js → index-5bf9d4bf.js} +0 -0
  576. /package/build/{index-b3cd56c7.js → index-addaddb1.js} +0 -0
  577. /package/build/{index-05782999.js → index-bf822d11.js} +0 -0
  578. /package/build/{index-8407cd7d.js → index-c5ec058c.js} +0 -0
  579. /package/build/{index-69ab8d15.js → index-fc2db4ec.js} +0 -0
  580. /package/build/{index.styles-f1394320.js → index.styles-1ee5d7a8.js} +0 -0
  581. /package/build/{localizeNumberFormat-09b5428f.js → localizeNumberFormat-d908f487.js} +0 -0
  582. /package/build/{normalizeLink-ec8ac102.js → normalizeLink-f20c5fb5.js} +0 -0
  583. /package/build/{number-a8c62be6.js → number-aaf0af8f.js} +0 -0
  584. /package/build/{paths-c6110d53.js → paths-33a43575.js} +0 -0
  585. /package/build/{shared-d42d1601.js → shared-d6f36907.js} +0 -0
  586. /package/build/{translationsContext-ad084ebd.js → translationsContext-5c1324f6.js} +0 -0
  587. /package/build/{tslib.es6-03808ff2.js → tslib.es6-d626472f.js} +0 -0
  588. /package/build/{types-6447ed9f.js → types-2ea35542.js} +0 -0
  589. /package/build/{types-2d6ad927.js → types-3cd9ff53.js} +0 -0
  590. /package/build/{useIsInit-7cf4eb5e.js → useIsInit-89c96446.js} +0 -0
  591. /package/build/{useOutsideClick-6435892c.js → useOutsideClick-df34268e.js} +0 -0
  592. /package/build/{useScrollbarSize-c115bb9f.js → useScrollbarSize-26e14b83.js} +0 -0
  593. /package/build/{useUniqueId-24756171.js → useUniqueId-146e6830.js} +0 -0
  594. /package/build/{utils-c1f041a3.js → utils-08fcfbf3.js} +0 -0
  595. /package/build/{utils-e79a17a6.js → utils-ff87015d.js} +0 -0
@@ -1,81 +1,76 @@
1
- import React__default, { createContext, useContext, useRef, useState, useEffect, useCallback, useMemo, forwardRef, useImperativeHandle, memo, useLayoutEffect } from 'react';
2
- import { d as NodeType, E as ELEMENT_CONTROL_INPUT_TYPE, f as NodeActionType, c as NodePosition, e as NodeFinalTypes, g as NodeMultipleOptions, N as NodeIntentType, F as FULL_KEY_ADDRESS, C as COMMON_DATE_TRANSLATE_KEY, h as SubotType } from './index-964f9e56.js';
3
- import { a as __awaiter, _ as __rest } from './tslib.es6-e6b0683d.js';
4
- import { b as basePath, G as GA_TOKEN_COOKIE, A as API_DATE_FORMAT, I as ISO_FORMAT, j as SSO_URL } from './index-54ebeb31.js';
1
+ import React__default, { createContext, useContext, useRef, useState, useEffect, useCallback, useMemo, forwardRef, useImperativeHandle, memo } from 'react';
2
+ import { d as NodeType, E as ELEMENT_CONTROL_INPUT_TYPE, f as NodeActionType, c as NodePosition, e as NodeFinalTypes, g as NodeMultipleOptions, N as NodeIntentType, F as FULL_KEY_ADDRESS, C as COMMON_DATE_TRANSLATE_KEY } from './index-972dc587.js';
3
+ import { a as __awaiter, _ as __rest } from './tslib.es6-71c95f0d.js';
4
+ import { b as basePath, G as GA_TOKEN_COOKIE, A as API_DATE_FORMAT, I as ISO_FORMAT, j as SSO_URL } from './index-cb27e7bc.js';
5
5
  import Cookies from 'js-cookie';
6
6
  import fd from 'fastdom';
7
7
  import fastdomPromised from 'fastdom/extensions/fastdom-promised';
8
- import { G as GlobalData, c as callApi, u as locale, T as TogetherComponentGlobalContext } from './utils-b0048afb.js';
8
+ import { G as GlobalData, c as callApi, u as locale, T as TogetherComponentGlobalContext } from './utils-c3fa1c36.js';
9
9
  import formatString from 'string-format';
10
- import { a as getUserIdFromCookie, b as getSubotCookieId, c as getUserInfoFromCookie, d as getWindowId, o as overrideParamsByQuery, e as checkUntilFinished, g as getHelloSitesUrl, f as checkMobile, h as clickAndOpenInNewTab, i as formatUrlWithEncrypedGa, T as TIME_RESET_RESEND_OTP, j as isFakeEmail, s as ssoIntents, k as getHhgIdFromCookie } from './index-5d2245db.js';
11
- export { T as TIME_RESET_RESEND_OTP, f as checkMobile, e as checkUntilFinished, h as clickAndOpenInNewTab, i as formatUrlWithEncrypedGa, g as getHelloSitesUrl, k as getHhgIdFromCookie, b as getSubotCookieId, a as getUserIdFromCookie, c as getUserInfoFromCookie, d as getWindowId, j as isFakeEmail, o as overrideParamsByQuery, s as ssoIntents } from './index-5d2245db.js';
10
+ import { a as getUserIdFromCookie, b as getSubotCookieId, c as getUserInfoFromCookie, d as getWindowId, o as overrideParamsByQuery, e as checkUntilFinished, g as getHelloSitesUrl, f as checkMobile, h as clickAndOpenInNewTab, i as formatUrlWithEncrypedGa, T as TIME_RESET_RESEND_OTP, j as isFakeEmail, s as ssoIntents, k as getHhgIdFromCookie } from './index-6a57a6dd.js';
11
+ export { T as TIME_RESET_RESEND_OTP, f as checkMobile, e as checkUntilFinished, h as clickAndOpenInNewTab, i as formatUrlWithEncrypedGa, g as getHelloSitesUrl, k as getHhgIdFromCookie, b as getSubotCookieId, a as getUserIdFromCookie, c as getUserInfoFromCookie, d as getWindowId, j as isFakeEmail, o as overrideParamsByQuery, s as ssoIntents } from './index-6a57a6dd.js';
12
12
  import dayjs from 'dayjs';
13
13
  import { MAP_DOMAIN_BY_LOCALE, domainLocales } from './constantsDomainLocales.js';
14
14
  import classNames from 'classnames';
15
- import { C as Container$w } from './index-423b816a.js';
16
- import { L as Loading } from './index-54fe9407.js';
15
+ import { C as Container$w } from './index-7cd1ff1c.js';
16
+ import { L as Loading } from './index-d5e5f756.js';
17
17
  import { motion } from 'framer-motion';
18
18
  import styled from '@emotion/styled';
19
- import { M as MediaQueries } from './utils-68c1eb3a.js';
20
- import { B as Button } from './index-149a4bcb.js';
19
+ import { M as MediaQueries } from './utils-468ff2e1.js';
20
+ import { B as Button } from './index-c6e6304d.js';
21
21
  import { Remarkable } from 'remarkable';
22
- import { ArrowRight as ArrowRight$1 } from '@hhgtech/icons/other';
22
+ import { ArrowRight } from '@hhgtech/icons/other';
23
23
  import { useInView } from 'react-intersection-observer';
24
24
  import { Box, Textarea } from '@mantine/core';
25
- import { C as CommonGAssets } from './index-e1c3e0e1.js';
25
+ import { C as CommonGAssets } from './index-4ab96c95.js';
26
26
  import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
27
- import { d as LEAD_TOKEN_COOKIE } from './constants-4f19ceae.js';
27
+ import { d as LEAD_TOKEN_COOKIE } from './constants-da6dfd4d.js';
28
28
  import { v4 } from 'uuid';
29
- import { T as Text } from './index-d8f453a0.js';
29
+ import { T as Text } from './index-f4894e84.js';
30
30
  import { theme } from './miscTheme.js';
31
31
  import { isProduction } from './constantsIsProduction.js';
32
- import { S as Select } from './index-d53b5d64.js';
32
+ import { S as Select } from './index-4917810c.js';
33
33
  import '@mantine/dates';
34
- import './index-0bfcb7a7.js';
35
- import './index-7d49f9d1.js';
36
- import './index.styles-c89285e1.js';
37
- import './translationsContext-76d53c58.js';
34
+ import './index-d930067d.js';
35
+ import './index-28c66fc1.js';
36
+ import './index.styles-dd14e23b.js';
37
+ import './translationsContext-f1586547.js';
38
38
  import '@mantine/hooks';
39
- import './index-fef013de.js';
39
+ import './index-8b9ac9c8.js';
40
40
  import isEmpty from 'lodash/isEmpty';
41
41
  import { Controller, useForm } from 'react-hook-form';
42
42
  import PhoneInputBase, { getCountryCallingCode, isPossiblePhoneNumber, parsePhoneNumber } from 'react-phone-number-input';
43
43
  import { LoadScript } from '@react-google-maps/api';
44
- import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY, a as GOOGLE_API_LANGUAGE } from './usePlacesAutocomplete-4840df17.js';
44
+ import { u as usePlacesAutocomplete, G as GOOGLE_API_KEY, a as GOOGLE_API_LANGUAGE } from './usePlacesAutocomplete-dacf815b.js';
45
45
  import { setDefaultClass } from './miscDefaultClassWrapper.js';
46
- import { L as LOCALE } from './Locale-7ac6b152.js';
47
- import { I as InputDate } from './InputDate-57a69392.js';
48
- import { B as Button$1 } from './index-73d5e63f.js';
49
- import { D as Dropdown } from './index-e5b066b3.js';
50
- import { u as useSSOV2Store, I as IS_SSOV2_ENABLED } from './store-f42a8f4f.js';
51
- import { g as getURLwithSSOTracking } from './utils-6d192108.js';
52
- import { T as TextArea } from './index-7813ad6b.js';
53
- import StarRatings from 'react-star-ratings';
54
- import { ArticleCard } from './moleculesArticleCard.js';
55
- import { T as Text$1 } from './index-f02fdc64.js';
56
- import { H as Heading } from './index-2b1fb52f.js';
46
+ import { L as LOCALE } from './Locale-b3c0ef4e.js';
47
+ import { I as InputDate } from './InputDate-c7afe06e.js';
48
+ import { B as Button$1 } from './index-722556b5.js';
49
+ import { D as Dropdown } from './index-b52757bc.js';
50
+ import { u as useSSOV2Store, I as IS_SSOV2_ENABLED } from './store-4279a82a.js';
51
+ import { g as getURLwithSSOTracking } from './utils-a5a71a6a.js';
57
52
  import 'date-fns/locale';
58
53
  import './constantsSite.js';
59
54
  import './constantsRiskScreener.js';
60
- import './index-b5773a59.js';
55
+ import './index-c0f625f9.js';
61
56
  import './miscCookieHelper.js';
62
57
  import 'slugify';
63
58
  import './togetherApiPaths.js';
64
- import './index-5266aa5a.js';
65
- import './WhatsApp-4e9864fc.js';
66
- import './Spinner-ea28eb4e.js';
67
- import './index-dcfca694.js';
68
- import './shared-b9242dd5.js';
69
- import './index-9d64f5f1.js';
59
+ import './index-dedc22cb.js';
60
+ import './WhatsApp-1737ea92.js';
61
+ import './Spinner-49e6bba1.js';
62
+ import './index-9bacf266.js';
63
+ import './shared-d5039f06.js';
64
+ import './index-b3877ccd.js';
70
65
  import '@mantine/carousel';
71
- import './useUniqueId-168a619f.js';
66
+ import './useUniqueId-82cda08a.js';
72
67
  import '@emotion/react';
73
68
  import '@hhgtech/icons/core';
74
69
  import '@mantine/notifications';
75
70
  import 'zustand';
76
- import './index-c6b73aab.js';
77
- import './normalizeLink-10a7a278.js';
78
- import './healthTools-8e429882.js';
71
+ import './index-a6f36fca.js';
72
+ import './normalizeLink-1c482bf9.js';
73
+ import './healthTools-fcf3ed62.js';
79
74
 
80
75
  // extend fastdom
81
76
  const fastdom = fd.extend(fastdomPromised);
@@ -157,7 +152,7 @@ const getSubotApiPath = (path, params) => {
157
152
  return apiUrl + formatString(path, Object.assign({}, params));
158
153
  };
159
154
  /** inline message */
160
- const subotInlineMessage$1 = (data) => __awaiter(void 0, void 0, void 0, function* () {
155
+ const subotInlineMessage = (data) => __awaiter(void 0, void 0, void 0, function* () {
161
156
  try {
162
157
  return yield callApi(getSubotApiPath(PATHS$1.GET_INLINE_MESSAGE), 'POST', {
163
158
  data,
@@ -165,7 +160,7 @@ const subotInlineMessage$1 = (data) => __awaiter(void 0, void 0, void 0, functio
165
160
  }
166
161
  catch (error) { }
167
162
  });
168
- const computeExtraSettingsForBot$1 = (data) => {
163
+ const computeExtraSettingsForBot = (data) => {
169
164
  var _a;
170
165
  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)) {
171
166
  try {
@@ -188,11 +183,11 @@ const computeExtraSettingsForBot$1 = (data) => {
188
183
  return data;
189
184
  };
190
185
  /** inline first node */
191
- const subotInlineFirstNode$1 = (id) => __awaiter(void 0, void 0, void 0, function* () {
186
+ const subotInlineFirstNode = (id) => __awaiter(void 0, void 0, void 0, function* () {
192
187
  try {
193
188
  const data = yield CachedSystem.withCached('SubotInlineFirstNode/' + id, () => __awaiter(void 0, void 0, void 0, function* () {
194
189
  const response = yield callApi(getSubotApiPath(PATHS$1.GET_INLINE_FIRST_NODE) + `/${id}`, 'GET');
195
- computeExtraSettingsForBot$1(response);
190
+ computeExtraSettingsForBot(response);
196
191
  return response;
197
192
  }));
198
193
  return data;
@@ -202,7 +197,7 @@ const subotInlineFirstNode$1 = (id) => __awaiter(void 0, void 0, void 0, functio
202
197
  }
203
198
  });
204
199
  /** inline click */
205
- const subotInlineClick$1 = (data) => __awaiter(void 0, void 0, void 0, function* () {
200
+ const subotInlineClick = (data) => __awaiter(void 0, void 0, void 0, function* () {
206
201
  try {
207
202
  return yield callApi(getSubotApiPath(PATHS$1.GET_INLINE_CLICK), 'POST', {
208
203
  data,
@@ -211,7 +206,7 @@ const subotInlineClick$1 = (data) => __awaiter(void 0, void 0, void 0, function*
211
206
  catch (error) { }
212
207
  });
213
208
  /** inline impression */
214
- const subotInlineImpression$1 = (data) => __awaiter(void 0, void 0, void 0, function* () {
209
+ const subotInlineImpression = (data) => __awaiter(void 0, void 0, void 0, function* () {
215
210
  try {
216
211
  return yield callApi(getSubotApiPath(PATHS$1.GET_INLINE_IMPRESSION), 'POST', {
217
212
  data,
@@ -810,7 +805,7 @@ const detectToSkipNodeStart = (botItem, currentActiveId, currentListNodes) => {
810
805
  return [currentActiveId, currentListNodes];
811
806
  };
812
807
 
813
- const SubotInlineContext$1 = createContext({
808
+ const SubotInlineContext = createContext({
814
809
  activeId: '',
815
810
  params: {},
816
811
  listNodes: [],
@@ -826,7 +821,7 @@ const SubotInlineContext$1 = createContext({
826
821
  setLoading: () => null,
827
822
  userInfo: null,
828
823
  });
829
- const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer, bgColor: _bgColor, primaryColor: _primaryColor, textColor, textButtonColor, bgContentColor, bgImgFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, typeFormProps, customUrl, isMobile, locale, }) => {
824
+ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer, bgColor: _bgColor, primaryColor: _primaryColor, textColor, textButtonColor, bgContentColor, bgImgFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, typeFormProps, isMobile, locale, }) => {
830
825
  const { formatMessage: f, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
831
826
  const ref = useRef(null);
832
827
  // const { formatMessage: f } = useIntl()
@@ -873,7 +868,8 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
873
868
  /** Get Params */
874
869
  const getParams = useCallback(() => {
875
870
  const gaData = window.gaData;
876
- const url = (customUrl || window.location.origin + basePath) +
871
+ const url = window.location.origin +
872
+ basePath +
877
873
  ((GlobalData === null || GlobalData === void 0 ? void 0 : GlobalData.locale) === 'tl-PH'
878
874
  ? articleLink.replace('fil/', '')
879
875
  : articleLink);
@@ -922,7 +918,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
922
918
  let newActiveId = '';
923
919
  let nodes = [];
924
920
  setLoading(true);
925
- const resFirst = yield subotInlineFirstNode$1(params.bot_id);
921
+ const resFirst = yield subotInlineFirstNode(params.bot_id);
926
922
  if ((resFirst === null || resFirst === void 0 ? void 0 : resFirst._status) === 1) {
927
923
  newActiveId = resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.id.toString();
928
924
  nodes.push(resFirst === null || resFirst === void 0 ? void 0 : resFirst._data, resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.first_node);
@@ -940,7 +936,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
940
936
  if (previousState &&
941
937
  previousState.params.action_id &&
942
938
  previousState.params.action_value) {
943
- const resResultInline = yield subotInlineMessage$1(previousState.params);
939
+ const resResultInline = yield subotInlineMessage(previousState.params);
944
940
  if ((resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._status) === 1 && (resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node)) {
945
941
  newActiveId = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node.id;
946
942
  nodes = previousState.listNodes;
@@ -1009,7 +1005,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
1009
1005
  const onNext = useCallback((messageParams) => __awaiter(void 0, void 0, void 0, function* () {
1010
1006
  if (messageParams === null || messageParams === void 0 ? void 0 : messageParams.node_id) {
1011
1007
  const newMessage = Object.assign(Object.assign({}, messageParams), getCurrentTotalDynamicScore(listNodes, activeId, messageParams.action_id));
1012
- const res = yield subotInlineMessage$1(newMessage);
1008
+ const res = yield subotInlineMessage(newMessage);
1013
1009
  setLoading(false);
1014
1010
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
1015
1011
  const _b = res === null || res === void 0 ? void 0 : res._data, { node } = _b, restData = __rest(_b, ["node"]);
@@ -1157,7 +1153,7 @@ const SubotInlineProvider = ({ children, articleLink, subotId, isFullContainer,
1157
1153
  if (!listNodes.length) {
1158
1154
  return null;
1159
1155
  }
1160
- return (React__default.createElement(SubotInlineContext$1.Provider, { value: value },
1156
+ return (React__default.createElement(SubotInlineContext.Provider, { value: value },
1161
1157
  React__default.createElement("div", { ref: ref }, children)));
1162
1158
  };
1163
1159
 
@@ -1661,7 +1657,7 @@ const Container$u = () => {
1661
1657
  var _a, _b, _c;
1662
1658
  const { formatMessage: f, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
1663
1659
  const currentUrl = useCurrentUrl();
1664
- const { listNodes, activeId, isShowFooter, onNext, onPrev, params, onStartOver, loading, } = useContext(SubotInlineContext$1);
1660
+ const { listNodes, activeId, isShowFooter, onNext, onPrev, params, onStartOver, loading, } = useContext(SubotInlineContext);
1665
1661
  const { value } = useContext(NodeContext);
1666
1662
  const validation = useValidationMultiOption();
1667
1663
  const botItem = listNodes[0];
@@ -2053,7 +2049,7 @@ const Container$s = ({ node, onClickStart }) => {
2053
2049
  const refImpression = useRef(false);
2054
2050
  const { ref, inView } = useInView();
2055
2051
  const currentUrl = useCurrentUrl();
2056
- const { params, getParams, onNext, setIsShowFooter, listNodes } = useContext(SubotInlineContext$1);
2052
+ const { params, getParams, onNext, setIsShowFooter, listNodes } = useContext(SubotInlineContext);
2057
2053
  const botItem = listNodes[0];
2058
2054
  const botType = (_a = botItem === null || botItem === void 0 ? void 0 : botItem.extra_settings) === null || _a === void 0 ? void 0 : _a.subot_type;
2059
2055
  useMemo(() => {
@@ -2063,14 +2059,14 @@ const Container$s = ({ node, onClickStart }) => {
2063
2059
  if (!inView || refImpression.current) {
2064
2060
  return;
2065
2061
  }
2066
- subotInlineImpression$1(getParams());
2062
+ subotInlineImpression(getParams());
2067
2063
  refImpression.current = true;
2068
2064
  }, [inView]);
2069
2065
  const handleClickStart = () => {
2070
2066
  // 1. Tracking Event Click
2071
2067
  const params = getParams();
2072
2068
  params.device_id = checkMobile(window.navigator.userAgent) ? 2 : 1;
2073
- subotInlineClick$1(params);
2069
+ subotInlineClick(params);
2074
2070
  // 2. Call API to fetch next node
2075
2071
  onNext();
2076
2072
  onClickStart === null || onClickStart === void 0 ? void 0 : onClickStart();
@@ -2084,7 +2080,7 @@ const Container$s = ({ node, onClickStart }) => {
2084
2080
  email: '',
2085
2081
  voucherName: '',
2086
2082
  } })),
2087
- React__default.createElement(Button, { onClick: handleClickStart, "data-event-category": "Service Connection", "data-event-action": "Risk Screening Start", "data-event-label": currentUrl, "data-bot-id": params.bot_id, rightIcon: React__default.createElement(ArrowRight$1, { color: "var(--subot-inline-text-button-color, #fff)" }), styles: {
2083
+ React__default.createElement(Button, { onClick: handleClickStart, "data-event-category": "Service Connection", "data-event-action": "Risk Screening Start", "data-event-label": currentUrl, "data-bot-id": params.bot_id, rightIcon: React__default.createElement(ArrowRight, { color: "var(--subot-inline-text-button-color, #fff)" }), styles: {
2088
2084
  root: {
2089
2085
  backgroundColor: 'var(--subot-inline-primary-color) !important',
2090
2086
  '&:hover': {
@@ -2349,7 +2345,7 @@ const handleFrisoRedirecition = (listNode) => {
2349
2345
 
2350
2346
  const Container$r = ({ intent }) => {
2351
2347
  var _a;
2352
- const { listNodes } = useContext(SubotInlineContext$1);
2348
+ const { listNodes } = useContext(SubotInlineContext);
2353
2349
  const handleOnClick = () => {
2354
2350
  var _a;
2355
2351
  if ((_a = intent.url) === null || _a === void 0 ? void 0 : _a.includes('{{.frisoRedirectUrl}}')) {
@@ -2405,7 +2401,7 @@ const Container$q = ({ intent }) => {
2405
2401
  Container$q.displayName = 'SubotInlineIntentBotImage';
2406
2402
 
2407
2403
  const Container$p = ({ intent, indexNumber }) => {
2408
- const { listNodes } = useContext(SubotInlineContext$1);
2404
+ const { listNodes } = useContext(SubotInlineContext);
2409
2405
  const isShowLabel = ![NodeIntentType.SSO_INTENT].includes(intent === null || intent === void 0 ? void 0 : intent.type);
2410
2406
  const isText = [
2411
2407
  NodeIntentType.BOT_TEXT,
@@ -2439,7 +2435,7 @@ Container$p.displayName = 'SubotInlineIntentBotTitle';
2439
2435
 
2440
2436
  const Container$o = ({ intent }) => {
2441
2437
  const currentUrl = useCurrentUrl();
2442
- const { listNodes, activeId, params } = useContext(SubotInlineContext$1);
2438
+ const { listNodes, activeId, params } = useContext(SubotInlineContext);
2443
2439
  const foundNode = listNodes.find((n) => n.id == activeId);
2444
2440
  if (!intent.label || !foundNode) {
2445
2441
  return null;
@@ -2780,7 +2776,7 @@ const StyledWrap$e = styled.div `
2780
2776
  `;
2781
2777
 
2782
2778
  const Container$k = ({ intent }) => {
2783
- const { listNodes } = useContext(SubotInlineContext$1);
2779
+ const { listNodes } = useContext(SubotInlineContext);
2784
2780
  if (!(intent === null || intent === void 0 ? void 0 : intent.label)) {
2785
2781
  return null;
2786
2782
  }
@@ -2841,15 +2837,15 @@ const Container$j = ({ intent }) => {
2841
2837
  };
2842
2838
  Container$j.displayName = 'SubotInlineIntentSSO';
2843
2839
 
2844
- var _a$2;
2845
- const SubotInlineIntentCol$1 = styled.div `
2840
+ var _a$1;
2841
+ const SubotInlineIntentCol = styled.div `
2846
2842
  width: ${({ width }) => width || '100%'};
2847
2843
  padding: 4px;
2848
2844
  ${MediaQueries.mbDown} {
2849
2845
  width: 100%;
2850
2846
  }
2851
2847
  `;
2852
- const SubotInlineIntentUrlContainer$1 = styled.div `
2848
+ const SubotInlineIntentUrlContainer = styled.div `
2853
2849
  display: flex;
2854
2850
  .feature {
2855
2851
  width: 30%;
@@ -2877,7 +2873,7 @@ const SubotInlineIntentUrlContainer$1 = styled.div `
2877
2873
  margin-left: 10px;
2878
2874
  line-height: 1.5;
2879
2875
  a {
2880
- color: ${((_a$2 = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _a$2 === void 0 ? void 0 : _a$2.gray800) || '#262626'};
2876
+ color: ${((_a$1 = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _a$1 === void 0 ? void 0 : _a$1.gray800) || '#262626'};
2881
2877
  text-decoration: none;
2882
2878
  }
2883
2879
  }
@@ -2887,8 +2883,8 @@ const Container$i = ({ intent, }) => {
2887
2883
  const article = useMemo(() => intent.label.includes('{')
2888
2884
  ? JSON.parse(intent.label)
2889
2885
  : {}, [intent.label]);
2890
- return (React__default.createElement(React__default.Fragment, null, !!Object.keys(article).length && (React__default.createElement(SubotInlineIntentCol$1, null,
2891
- React__default.createElement(SubotInlineIntentUrlContainer$1, null,
2886
+ return (React__default.createElement(React__default.Fragment, null, !!Object.keys(article).length && (React__default.createElement(SubotInlineIntentCol, null,
2887
+ React__default.createElement(SubotInlineIntentUrlContainer, null,
2892
2888
  React__default.createElement("div", { className: "feature" },
2893
2889
  React__default.createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature-wrapper" },
2894
2890
  React__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" }))),
@@ -2925,7 +2921,7 @@ const SubotInlineIntentBaseTarget = {
2925
2921
  /** intents fake for sso block */
2926
2922
  [NodeIntentType.SSO_INTENT]: Container$j,
2927
2923
  };
2928
- const SubotInlineIntentBase$1 = new Proxy(SubotInlineIntentBaseTarget, {
2924
+ const SubotInlineIntentBase = new Proxy(SubotInlineIntentBaseTarget, {
2929
2925
  get(_, prop) {
2930
2926
  const UnknowComponent = () => {
2931
2927
  if (isProduction)
@@ -2952,7 +2948,7 @@ const Container$h = ({ intents: intentsProp, indexNumber, }) => {
2952
2948
  const intentType = (intent === null || intent === void 0 ? void 0 : intent.type) || '';
2953
2949
  if (excludeIntents.includes(intentType))
2954
2950
  return null;
2955
- const NodeIntent = SubotInlineIntentBase$1[intentType];
2951
+ const NodeIntent = SubotInlineIntentBase[intentType];
2956
2952
  return NodeIntent && React__default.createElement(NodeIntent, { key: intent.id, intent: intent });
2957
2953
  })))));
2958
2954
  };
@@ -2960,7 +2956,7 @@ Container$h.displayName = 'SubotInlineIntent';
2960
2956
 
2961
2957
  const Container$g = ({ node }) => {
2962
2958
  var _a, _b;
2963
- const { setIsShowFooter, listNodes } = useContext(SubotInlineContext$1);
2959
+ const { setIsShowFooter, listNodes } = useContext(SubotInlineContext);
2964
2960
  const botItem = listNodes[0];
2965
2961
  useMemo(() => {
2966
2962
  setIsShowFooter(true);
@@ -3151,7 +3147,7 @@ const SubInlineIntent = ({ subIntents }) => {
3151
3147
  React__default.createElement(ChevronDown, { className: "si-chevron-down" })),
3152
3148
  React__default.createElement(motion.div, { className: "si-sub-intent-expand", animate: isShow ? { height: 'auto' } : { height: 0 }, transition: { duration: 0.3 }, "data-show": isShow }, restSubIntents.map((intent) => {
3153
3149
  const intentType = (intent === null || intent === void 0 ? void 0 : intent.type) || '';
3154
- const NodeIntent = SubotInlineIntentBase$1[intentType];
3150
+ const NodeIntent = SubotInlineIntentBase[intentType];
3155
3151
  return NodeIntent && React__default.createElement(NodeIntent, { key: intent.id, intent: intent });
3156
3152
  }))));
3157
3153
  };
@@ -3162,7 +3158,7 @@ const Container$f = ({ node }) => {
3162
3158
  // const isMobile = useGetIsMobile(true)
3163
3159
  const refMainIntents = useRef(null);
3164
3160
  const { formatMessage: f } = useContext(TogetherComponentGlobalContext);
3165
- const { setIsShowFooter, listNodes } = useContext(SubotInlineContext$1);
3161
+ const { setIsShowFooter, listNodes } = useContext(SubotInlineContext);
3166
3162
  const [isShowMore, setIsShowMore] = useState(false);
3167
3163
  useEffect(() => {
3168
3164
  var _a;
@@ -3267,11 +3263,11 @@ const Container$f = ({ node }) => {
3267
3263
  defaultMessage: 'See more',
3268
3264
  }))),
3269
3265
  React__default.createElement("div", { className: "wrap-main-button-intent" }, (_a = [...mainButtonIntents, ...bookingButtonIntents]) === null || _a === void 0 ? void 0 : _a.map((intent) => {
3270
- const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
3266
+ const NodeIntent = SubotInlineIntentBase[intent.type || ''];
3271
3267
  return NodeIntent && React__default.createElement(NodeIntent, { key: intent.id, intent: intent });
3272
3268
  })),
3273
3269
  (suggestedServiceIntents === null || suggestedServiceIntents === void 0 ? void 0 : suggestedServiceIntents.length) > 0 && (React__default.createElement("div", null, suggestedServiceIntents.map((intent) => {
3274
- const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
3270
+ const NodeIntent = SubotInlineIntentBase[intent.type || ''];
3275
3271
  return NodeIntent && React__default.createElement(NodeIntent, { key: intent.id, intent: intent });
3276
3272
  }))),
3277
3273
  (relatedArticleIntents === null || relatedArticleIntents === void 0 ? void 0 : relatedArticleIntents.length) > 0 && (React__default.createElement("div", { style: { marginTop: 24 } },
@@ -3280,7 +3276,7 @@ const Container$f = ({ node }) => {
3280
3276
  defaultMessage: 'Related Articles',
3281
3277
  })),
3282
3278
  React__default.createElement("div", { style: { padding: '8px 0' } }, relatedArticleIntents.map((intent) => {
3283
- const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
3279
+ const NodeIntent = SubotInlineIntentBase[intent.type || ''];
3284
3280
  return (NodeIntent && React__default.createElement(NodeIntent, { key: intent.id, intent: intent }));
3285
3281
  })))),
3286
3282
  React__default.createElement(SubInlineIntent, { subIntents: subIntents })));
@@ -3294,7 +3290,7 @@ const StyledWrap$b = styled.div `
3294
3290
  `;
3295
3291
 
3296
3292
  const Container$e = ({ node }) => {
3297
- const { params, onNext, setIsShowFooter } = useContext(SubotInlineContext$1);
3293
+ const { params, onNext, setIsShowFooter } = useContext(SubotInlineContext);
3298
3294
  useMemo(() => {
3299
3295
  setIsShowFooter(true);
3300
3296
  }, []);
@@ -3706,7 +3702,7 @@ const CountDown = ({ onFinish, onClick, isFinished, resendLabel, className }, re
3706
3702
  };
3707
3703
  var CountDown$1 = forwardRef(CountDown);
3708
3704
 
3709
- const StyledUserInfoFormContainer$1 = styled.div `
3705
+ styled.div `
3710
3706
  margin: 0 auto;
3711
3707
  background: #f7f9fc;
3712
3708
  border-radius: ${theme.borderRadius};
@@ -4638,7 +4634,7 @@ const OTP_VERIFIED_MSG_CODE = {
4638
4634
  },
4639
4635
  };
4640
4636
 
4641
- var _a$1, _b$1, _c$1, _d$1, _e$1;
4637
+ var _a, _b, _c, _d, _e;
4642
4638
  const StyledPhoneCode = styled.div `
4643
4639
  display: flex;
4644
4640
  align-items: center;
@@ -4650,21 +4646,21 @@ const StyledPhoneCode = styled.div `
4650
4646
  border-radius: 2px;
4651
4647
  }
4652
4648
  > div {
4653
- color: ${((_a$1 = theme.colors) === null || _a$1 === void 0 ? void 0 : _a$1.gray800) || ''};
4649
+ color: ${((_a = theme.colors) === null || _a === void 0 ? void 0 : _a.gray800) || ''};
4654
4650
  white-space: nowrap;
4655
4651
  }
4656
4652
  `;
4657
4653
  styled(PhoneInputBase) `
4658
4654
  display: flex;
4659
- border: 1px solid ${((_b$1 = theme.colors) === null || _b$1 === void 0 ? void 0 : _b$1.gray200) || ''};
4655
+ border: 1px solid ${((_b = theme.colors) === null || _b === void 0 ? void 0 : _b.gray200) || ''};
4660
4656
  border-radius: ${theme === null || theme === void 0 ? void 0 : theme.borderRadius};
4661
4657
  .PhoneInputCountry {
4662
4658
  position: relative;
4663
4659
  padding: 12px 8px 12px 16px;
4664
- border-right: 1px solid ${((_c$1 = theme.colors) === null || _c$1 === void 0 ? void 0 : _c$1.gray200) || ''};
4665
- background-color: ${((_d$1 = theme.colors) === null || _d$1 === void 0 ? void 0 : _d$1.gray100) || ''};
4660
+ border-right: 1px solid ${((_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray200) || ''};
4661
+ background-color: ${((_d = theme.colors) === null || _d === void 0 ? void 0 : _d.gray100) || ''};
4666
4662
  border-radius: 6px 0 0 6px;
4667
- color: ${((_e$1 = theme.colors) === null || _e$1 === void 0 ? void 0 : _e$1.gray800) || ''};
4663
+ color: ${((_e = theme.colors) === null || _e === void 0 ? void 0 : _e.gray800) || ''};
4668
4664
  .PhoneInputCountrySelect {
4669
4665
  position: absolute;
4670
4666
  top: 0;
@@ -5501,14 +5497,14 @@ const StyledWrap$a = styled.div `
5501
5497
  const Container$d = ({ node, indexNumber }) => {
5502
5498
  var _a;
5503
5499
  const locale = GlobalData === null || GlobalData === void 0 ? void 0 : GlobalData.locale;
5504
- const { params, listNodes, activeId, onSubmit, setIsShowFooter } = useContext(SubotInlineContext$1);
5500
+ const { params, listNodes, activeId, onSubmit, setIsShowFooter } = useContext(SubotInlineContext);
5505
5501
  useMemo(() => {
5506
5502
  setIsShowFooter(true);
5507
5503
  }, []);
5508
5504
  const handleSubmit = (data) => __awaiter(void 0, void 0, void 0, function* () {
5509
5505
  checkSyncDataOnFrisoCampaign(listNodes[0], data.form_submit_meta);
5510
5506
  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 });
5511
- const res = yield subotInlineMessage$1(_message);
5507
+ const res = yield subotInlineMessage(_message);
5512
5508
  // asking
5513
5509
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
5514
5510
  const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = __rest(_b, ["node"]);
@@ -5673,7 +5669,7 @@ const StyledWrap$7 = styled.div `
5673
5669
  `;
5674
5670
  const Container$c = ({ action, active, onChange, htmlType, }) => {
5675
5671
  const currentUrl = useCurrentUrl();
5676
- const { params } = useContext(SubotInlineContext$1);
5672
+ const { params } = useContext(SubotInlineContext);
5677
5673
  return (React__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 },
5678
5674
  React__default.createElement("div", { className: "si-action-image-wrap" },
5679
5675
  React__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 })),
@@ -5689,7 +5685,7 @@ const StyledWrap$6 = styled.div `
5689
5685
  `;
5690
5686
  const Container$b = ({ action, onChange }) => {
5691
5687
  const currentUrl = useCurrentUrl();
5692
- const { params, activeId } = useContext(SubotInlineContext$1);
5688
+ const { params, activeId } = useContext(SubotInlineContext);
5693
5689
  return (React__default.createElement(StyledWrap$6, null,
5694
5690
  React__default.createElement(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: {
5695
5691
  root: {
@@ -5751,7 +5747,7 @@ const Container$a = ({ action, onChange, active, htmlType, formSubmitMeta, }) =>
5751
5747
  const currentUrl = useCurrentUrl();
5752
5748
  const inputRef = useRef(null);
5753
5749
  const [otherText, setOtherText] = useState('');
5754
- const { params } = useContext(SubotInlineContext$1);
5750
+ const { params } = useContext(SubotInlineContext);
5755
5751
  const isActionPollWithOther = (action === null || action === void 0 ? void 0 : action.type) === NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
5756
5752
  const isActionSelectWithOther = (action === null || action === void 0 ? void 0 : action.type) === NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
5757
5753
  isActionPollWithOther;
@@ -5835,7 +5831,7 @@ const SubotInlineActionBaseTarget = {
5835
5831
  // [NodeActionType.RESULT_BUTTON]: SubotInlineActionTextChoice,
5836
5832
  // [NodeActionType.POLL_RESULT]: SubotInlinePollResult,
5837
5833
  };
5838
- const SubotInlineActionBase$1 = new Proxy(SubotInlineActionBaseTarget, {
5834
+ const SubotInlineActionBase = new Proxy(SubotInlineActionBaseTarget, {
5839
5835
  get(_, prop) {
5840
5836
  const UnknowComponent = () => {
5841
5837
  if (isProduction)
@@ -5866,14 +5862,14 @@ const Container$7 = ({ actions, value, onChange, htmlType, node_type, formSubmit
5866
5862
  const actionType = action.type;
5867
5863
  if (excludeActions.includes(actionType))
5868
5864
  return null;
5869
- const NodeAction = SubotInlineActionBase$1[action.type];
5865
+ const NodeAction = SubotInlineActionBase[action.type];
5870
5866
  return (NodeAction && (React__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 })));
5871
5867
  })));
5872
5868
  };
5873
5869
  Container$7.displayName = 'SubotInlineAction';
5874
5870
 
5875
5871
  const Container$6 = ({ node, indexNumber }) => {
5876
- const { params, listNodes, activeId, onSubmit, setIsShowFooter, setLoading } = useContext(SubotInlineContext$1);
5872
+ const { params, listNodes, activeId, onSubmit, setIsShowFooter, setLoading } = useContext(SubotInlineContext);
5877
5873
  const { value, setValue } = useContext(NodeContext);
5878
5874
  useMemo(() => {
5879
5875
  setIsShowFooter(true);
@@ -5888,7 +5884,7 @@ const Container$6 = ({ node, indexNumber }) => {
5888
5884
  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 }));
5889
5885
  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));
5890
5886
  setLoading(true);
5891
- const res = yield subotInlineMessage$1(newParams);
5887
+ const res = yield subotInlineMessage(newParams);
5892
5888
  setLoading(false);
5893
5889
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
5894
5890
  const _a = res === null || res === void 0 ? void 0 : res._data, { node } = _a, restData = __rest(_a, ["node"]);
@@ -5913,7 +5909,7 @@ const StyledWrap$3 = styled.div `
5913
5909
 
5914
5910
  const Container$5 = ({ node, indexNumber }) => {
5915
5911
  var _a;
5916
- const { setIsShowFooter, onChange } = useContext(SubotInlineContext$1);
5912
+ const { setIsShowFooter, onChange } = useContext(SubotInlineContext);
5917
5913
  const { value, setValue } = useContext(NodeContext);
5918
5914
  useMemo(() => {
5919
5915
  setIsShowFooter(true);
@@ -6025,7 +6021,7 @@ const StyledWrap$2 = styled.div `
6025
6021
  `;
6026
6022
 
6027
6023
  const Container$4 = ({ node, indexNumber }) => {
6028
- const { onChange, setIsShowFooter } = useContext(SubotInlineContext$1);
6024
+ const { onChange, setIsShowFooter } = useContext(SubotInlineContext);
6029
6025
  const { value, setValue } = useContext(NodeContext);
6030
6026
  const descriptionNode = useDescriptionPollNode({ node });
6031
6027
  useMemo(() => {
@@ -6100,7 +6096,7 @@ const StyledWrap$1 = styled.div ``;
6100
6096
  const Container$3 = ({ node }) => {
6101
6097
  const refIsTrigger = useRef(false);
6102
6098
  const { formatMessage: f, data: { userInfo }, } = useContext(TogetherComponentGlobalContext);
6103
- const { params, setIsShowFooter, listNodes, activeId } = useContext(SubotInlineContext$1);
6099
+ const { params, setIsShowFooter, listNodes, activeId } = useContext(SubotInlineContext);
6104
6100
  useMemo(() => {
6105
6101
  setIsShowFooter(true);
6106
6102
  }, []);
@@ -6162,7 +6158,7 @@ const StyledWrap = styled.div `
6162
6158
  `;
6163
6159
 
6164
6160
  const Container$2 = ({ node, indexNumber }) => {
6165
- const { params, onSubmit, setIsShowFooter, listNodes, activeId, setLoading, onChange, } = useContext(SubotInlineContext$1);
6161
+ const { params, onSubmit, setIsShowFooter, listNodes, activeId, setLoading, onChange, } = useContext(SubotInlineContext);
6166
6162
  const { value, setValue } = useContext(NodeContext);
6167
6163
  useMemo(() => {
6168
6164
  setIsShowFooter(true);
@@ -6178,7 +6174,7 @@ const Container$2 = ({ node, indexNumber }) => {
6178
6174
  const handleOnChangeNormal = (action) => __awaiter(void 0, void 0, void 0, function* () {
6179
6175
  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));
6180
6176
  setLoading(true);
6181
- const res = yield subotInlineMessage$1(newParams);
6177
+ const res = yield subotInlineMessage(newParams);
6182
6178
  setLoading(false);
6183
6179
  if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
6184
6180
  const _a = res === null || res === void 0 ? void 0 : res._data, { node } = _a, restData = __rest(_a, ["node"]);
@@ -6226,7 +6222,7 @@ const SubotInlineNodeBaseTarget = {
6226
6222
  // RESULT_RATING = 12,
6227
6223
  // RESULT_REACTION = 13,
6228
6224
  };
6229
- const SubotInlineNodeBase$1 = new Proxy(SubotInlineNodeBaseTarget, {
6225
+ const SubotInlineNodeBase = new Proxy(SubotInlineNodeBaseTarget, {
6230
6226
  get(_, prop) {
6231
6227
  const UnknowComponent = () => {
6232
6228
  if (isProduction)
@@ -6241,7 +6237,7 @@ const SubotInlineNodeBase$1 = new Proxy(SubotInlineNodeBaseTarget, {
6241
6237
 
6242
6238
  const Container$1 = ({ onClickStart }) => {
6243
6239
  var _a;
6244
- const { listNodes, activeId, isDisabledAnimationOnMobile } = useContext(SubotInlineContext$1);
6240
+ const { listNodes, activeId, isDisabledAnimationOnMobile } = useContext(SubotInlineContext);
6245
6241
  const foundIdx = useMemo(() => {
6246
6242
  return listNodes.findIndex((n) => n.id == activeId);
6247
6243
  }, [listNodes, activeId]);
@@ -6262,10 +6258,10 @@ const Container$1 = ({ onClickStart }) => {
6262
6258
  const nodeType = NodeType[node.type].valueOf();
6263
6259
  const nodeTypeSSO = (_a = NodePosition[node.position]) === null || _a === void 0 ? void 0 : _a.valueOf();
6264
6260
  let NodeComponent = node.position === NodePosition.SSO
6265
- ? SubotInlineNodeBase$1[nodeTypeSSO]
6266
- : SubotInlineNodeBase$1[nodeType];
6261
+ ? SubotInlineNodeBase[nodeTypeSSO]
6262
+ : SubotInlineNodeBase[nodeType];
6267
6263
  if (node.is_multi_select && node.type !== NodeType.POLL) {
6268
- NodeComponent = SubotInlineNodeBase$1['MULTIPLE'];
6264
+ NodeComponent = SubotInlineNodeBase['MULTIPLE'];
6269
6265
  }
6270
6266
  return (React__default.createElement(motion.div, { key: node.id, initial: { opacity: 1, y: -300 }, animate: { opacity: 1, y: 0 }, transition: {
6271
6267
  y: { type: 'spring', stiffness: 300, damping: 30 },
@@ -6303,7 +6299,7 @@ const View = ({ loading, backgroundImage, isShowFooter, isFullContainer, isDisab
6303
6299
  backgroundRepeat: 'no-repeat',
6304
6300
  backgroundPosition: 'center',
6305
6301
  }), [backgroundImage]);
6306
- const { isMobile, locale } = useContext(SubotInlineContext$1);
6302
+ const { isMobile, locale } = useContext(SubotInlineContext);
6307
6303
  const [isDisplayFullMobile, setIsDisplayFullMobile] = useState(false);
6308
6304
  useEffect(() => {
6309
6305
  if (isDisplayFullMobile) {
@@ -6366,7 +6362,7 @@ const ViewWithMemo = memo(View);
6366
6362
  ViewWithMemo.displayName = 'SubotInlineRevampView';
6367
6363
 
6368
6364
  const Container = () => {
6369
- const { loading, listNodes, isShowFooter, activeId, isFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, bgImgFullContainer, typeFormProps, } = useContext(SubotInlineContext$1);
6365
+ const { loading, listNodes, isShowFooter, activeId, isFullContainer, isDisabledAnimationOnMobile, onCloseMobile, userInfo, bgImgFullContainer, typeFormProps, } = useContext(SubotInlineContext);
6370
6366
  const backgroundImage = useMemo(() => {
6371
6367
  var _a, _b;
6372
6368
  const foundNode = listNodes.find((n) => n.id == activeId);
@@ -6423,3155 +6419,6 @@ const SubotInlineRevampWithTheme = (props) => {
6423
6419
  return (React__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 })));
6424
6420
  };
6425
6421
 
6426
- const SubotInlineContext = createContext({
6427
- activeId: '',
6428
- params: {},
6429
- nodes: [],
6430
- getParams: () => ({}),
6431
- trackingCommonInline: {},
6432
- });
6433
- /** inline click */
6434
- const subotInlineClick = (data) => __awaiter(void 0, void 0, void 0, function* () {
6435
- try {
6436
- return yield callApi(getSubotApiPath(PATHS$1.GET_INLINE_CLICK), 'POST', {
6437
- data,
6438
- });
6439
- }
6440
- catch (error) { }
6441
- });
6442
- /** inline impression */
6443
- const subotInlineImpression = (data) => __awaiter(void 0, void 0, void 0, function* () {
6444
- try {
6445
- return yield callApi(getSubotApiPath(PATHS$1.GET_INLINE_IMPRESSION), 'POST', {
6446
- data,
6447
- });
6448
- }
6449
- catch (error) { }
6450
- });
6451
- /** inline message */
6452
- const subotInlineMessage = (data) => __awaiter(void 0, void 0, void 0, function* () {
6453
- try {
6454
- return yield callApi(getSubotApiPath(PATHS$1.GET_INLINE_MESSAGE), 'POST', {
6455
- data,
6456
- });
6457
- }
6458
- catch (error) { }
6459
- });
6460
- const computeExtraSettingsForBot = (data) => {
6461
- var _a;
6462
- 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)) {
6463
- try {
6464
- const extraSettingsObj = JSON.parse(data._data.extra_settings);
6465
- if (typeof extraSettingsObj === 'object') {
6466
- data._data.extra_settings = extraSettingsObj;
6467
- }
6468
- else {
6469
- data._data.extra_settings = {
6470
- sync_data_friso_campaign: false,
6471
- };
6472
- }
6473
- }
6474
- catch (err) {
6475
- data._data.extra_settings = {
6476
- sync_data_friso_campaign: false,
6477
- };
6478
- }
6479
- }
6480
- return data;
6481
- };
6482
- /** inline first node */
6483
- const subotInlineFirstNode = (id) => __awaiter(void 0, void 0, void 0, function* () {
6484
- try {
6485
- const data = yield callApi(getSubotApiPath(PATHS$1.GET_INLINE_FIRST_NODE) + `/${id}`, 'GET');
6486
- computeExtraSettingsForBot(data);
6487
- return data;
6488
- }
6489
- catch (error) { }
6490
- });
6491
-
6492
- const SubotInlineFormContainer = styled.div `
6493
- margin-top: 2rem;
6494
- .form {
6495
- background-color: ${theme.colors.white || '#fff'};
6496
- }
6497
- `;
6498
- const SubotInlineIntentContainer = styled.div ``;
6499
- const SubotInlineActionContainer = styled.div `
6500
- margin-top: 1.25rem;
6501
- `;
6502
- const SubotInlineReviewContainer = styled.div `
6503
- margin-bottom: 1rem;
6504
- `;
6505
- const SubotInlineDescription$1 = styled.div `
6506
- font-weight: 400;
6507
- font-size: 16px;
6508
- line-height: 24px;
6509
- color: #595959;
6510
- font-style: italic;
6511
- `;
6512
- const SubotInlineFinalButton = styled(Button$1) `
6513
- position: relative;
6514
- min-width: 180px;
6515
- svg {
6516
- path {
6517
- stroke: currentColor;
6518
- }
6519
- }
6520
- &:hover {
6521
- svg {
6522
- path {
6523
- stroke: currentColor;
6524
- }
6525
- }
6526
- }
6527
- `;
6528
- const SubotInlineFinalMoreContainer = styled.div `
6529
- display: flex;
6530
- align-items: center;
6531
- justify-content: center;
6532
- `;
6533
- const SubotInlineFinalWrapper = styled.div `
6534
- position: relative;
6535
- overflow: ${({ isMore }) => (isMore ? 'unset' : 'hidden')};
6536
- max-height: ${({ maxHeight }) => (maxHeight ? maxHeight + 'px' : 'auto')};
6537
- margin-bottom: 8px;
6538
- transition: 0.25s all linear;
6539
- &:before {
6540
- position: absolute;
6541
- z-index: 1;
6542
- top: 50%;
6543
- right: 0;
6544
- bottom: 0;
6545
- left: 0;
6546
- background-image: linear-gradient(
6547
- to top,
6548
- ${theme.colors.neutral50 || '#F7F9FC'} 0%,
6549
- transparent 100%
6550
- );
6551
- content: '';
6552
- pointer-events: none;
6553
- ${({ isMore }) => isMore && `opacity: 0;`}
6554
- }
6555
- `;
6556
- const SubotInlineFinalContainer = styled.div `
6557
- position: relative;
6558
- padding: 32px 32px 16px;
6559
- background-color: ${theme.colors.neutral50 || '#F7F9FC'};
6560
- border-radius: ${theme.borderRadius};
6561
- ${MediaQueries.tdDown} {
6562
- padding: 24px 24px 16px;
6563
- }
6564
- ${MediaQueries.mbDown} {
6565
- padding: 16px;
6566
- border-radius: 0px;
6567
- }
6568
- `;
6569
- const SubotInlineWrapper$1 = styled.div `
6570
- padding: 12px 32px 32px;
6571
- ${MediaQueries.tdDown} {
6572
- padding: 12px 24px 24px;
6573
- }
6574
- ${MediaQueries.mbDown} {
6575
- padding: 12px 16px 16px;
6576
- }
6577
- `;
6578
- const SubotInlineContainer$1 = styled.div `
6579
- border: 1px solid ${theme.colors.neutral100 || '#E4E8EC'};
6580
- background-color: ${theme.colors.neutral50 || '#F7F9FC'};
6581
- border-radius: ${theme.borderRadius};
6582
- ${MediaQueries.mbDown} {
6583
- border: none;
6584
- }
6585
- `;
6586
-
6587
- const CheckboxIcon = (props) => (React__default.createElement("svg", Object.assign({ width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6588
- React__default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11 21C16.5228 21 21 16.5228 21 11C21 5.47715 16.5228 1 11 1C5.47715 1 1 5.47715 1 11C1 16.5228 5.47715 21 11 21Z", fill: "#2D87F3", stroke: "#2D87F3", strokeWidth: "2" }),
6589
- React__default.createElement("path", { d: "M15.5714 8L9.67857 14L7 11.2727", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })));
6590
-
6591
- const CheckIcon = (props) => (React__default.createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6592
- React__default.createElement("path", { d: "M13.3346 4L6.0013 11.3333L2.66797 8", stroke: "#737373", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })));
6593
-
6594
- const LikeIcon = (props) => (React__default.createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6595
- React__default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.0521 5.70293L11.8834 2L12.6635 2.03149C12.6635 2.03149 13.5407 2.05593 14.4487 2.51311C15.3568 2.9703 16.375 4.04935 16.375 5.69552C16.375 6.76085 16.1102 7.83874 15.8458 8.67047H20.125C21.1497 8.67047 22 9.53063 22 10.5673V12.8847C22 13.1046 21.9497 13.3294 21.8462 13.533L18.6437 19.9571C18.3261 20.5939 17.6767 21 16.9701 21H8.875C7.85025 21 7 20.1398 7 19.1031V10.0579C7 9.50164 7.24299 8.97147 7.66284 8.61119L11.0521 5.70293ZM13.4432 4.15712C13.4125 4.15279 13.3784 4.14799 13.3263 4.1321L12.7422 6.73842L8.875 10.0579V19.1031H16.9701L20.125 12.7717V10.5673H13.0864L13.6357 9.25027C13.6357 9.25027 14.5 7.01241 14.5 5.69552C14.5 4.74112 14.1119 4.46257 13.6138 4.21176C13.5294 4.16929 13.4902 4.16376 13.4432 4.15712Z", fill: "#595959" }),
6596
- React__default.createElement("path", { d: "M2 10.5C2 9.672 2.672 9 3.5 9C4.328 9 5 9.672 5 10.5V19.5C5 20.328 4.328 21 3.5 21C2.672 21 2 20.328 2 19.5V10.5Z", fill: "#595959" })));
6597
-
6598
- const DislikeIcon = (props) => (React__default.createElement("svg", Object.assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6599
- React__default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.0521 17.2971L11.8834 21L12.6635 20.9685C12.6635 20.9685 13.5407 20.9441 14.4487 20.4869C15.3568 20.0297 16.375 18.9507 16.375 17.3045C16.375 16.2391 16.1102 15.1613 15.8458 14.3295H20.125C21.1497 14.3295 22 13.4694 22 12.4327V10.1153C22 9.89545 21.9497 9.6706 21.8462 9.467L18.6437 3.0429C18.3261 2.40607 17.6767 2 16.9701 2H8.875C7.85025 2 7 2.86016 7 3.89685V12.9421C7 13.4984 7.24299 14.0285 7.66284 14.3888L11.0521 17.2971ZM13.4432 18.8429C13.4125 18.8472 13.3784 18.852 13.3263 18.8679L12.7422 16.2616L8.875 12.9421V3.89685H16.9701L20.125 10.2283V12.4327H13.0864L13.6357 13.7497C13.6357 13.7497 14.5 15.9876 14.5 17.3045C14.5 18.2589 14.1119 18.5374 13.6138 18.7882C13.5294 18.8307 13.4902 18.8362 13.4432 18.8429Z", fill: "#595959" }),
6600
- React__default.createElement("path", { d: "M2 12.5C2 13.328 2.672 14 3.5 14C4.328 14 5 13.328 5 12.5V3.5C5 2.672 4.328 2 3.5 2C2.672 2 2 2.672 2 3.5V12.5Z", fill: "#595959" })));
6601
-
6602
- const ArrowDown = (props) => (React__default.createElement("svg", Object.assign({ width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6603
- React__default.createElement("path", { d: "M1 1L5 5L9 1", stroke: "#595959", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
6604
-
6605
- const ArrowLeft = (props) => (React__default.createElement("svg", Object.assign({ width: "7", height: "10", viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6606
- React__default.createElement("path", { d: "M5.5 9L1.5 5L5.5 1", stroke: "#2D87F3", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
6607
-
6608
- const ArrowRight = (props) => (React__default.createElement("svg", Object.assign({ width: "7", height: "10", viewBox: "0 0 7 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6609
- React__default.createElement("path", { d: "M1.5 9L5.5 5L1.5 1", stroke: "#2D87F3", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
6610
-
6611
- const ArrowUp = (props) => (React__default.createElement("svg", Object.assign({ width: "10", height: "6", viewBox: "0 0 10 6", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6612
- React__default.createElement("path", { d: "M1 5L5 1L9 5", stroke: "#FC5D9A", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })));
6613
-
6614
- const ChevronRightActive = (props) => (React__default.createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6615
- React__default.createElement("path", { d: "M6 12L10 8L6 4", stroke: "#2D87F3", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })));
6616
-
6617
- const RotateLeft = (props) => (React__default.createElement("svg", Object.assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
6618
- React__default.createElement("g", { clipPath: "url(#clip0)" },
6619
- React__default.createElement("path", { d: "M0.666626 2.6665V6.6665H4.66663", stroke: "#737373", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }),
6620
- React__default.createElement("path", { d: "M2.33996 10.0001C2.77222 11.227 3.59152 12.2802 4.6744 13.001C5.75728 13.7218 7.04508 14.0712 8.34377 13.9964C9.64246 13.9217 10.8817 13.4269 11.8747 12.5866C12.8677 11.7464 13.5608 10.6061 13.8494 9.3377C14.1381 8.06929 14.0067 6.74143 13.475 5.55419C12.9434 4.36696 12.0403 3.38466 10.9018 2.7553C9.76339 2.12595 8.45123 1.88364 7.16308 2.06487C5.87493 2.24611 4.68057 2.84108 3.75996 3.76013L0.666626 6.6668", stroke: "#737373", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" })),
6621
- React__default.createElement("defs", null,
6622
- React__default.createElement("clipPath", { id: "clip0" },
6623
- React__default.createElement("rect", { width: "16", height: "16", fill: "white" })))));
6624
-
6625
- var _a, _b, _c, _d, _e, _f, _g;
6626
- const SubotInlineButtonReaction = styled.div `
6627
- display: flex;
6628
- align-items: center;
6629
- justify-content: center;
6630
- padding: 12px 24px;
6631
- border: 1px solid ${theme.colors.neutral100 || '#E4E8EC'};
6632
- background-color: ${theme.colors.white || 'white'};
6633
- border-radius: 32px;
6634
- cursor: pointer;
6635
- transition: 0.25s all linear;
6636
- svg {
6637
- height: 16px;
6638
- margin-right: 3px;
6639
- }
6640
- &:hover {
6641
- background-color: ${theme.colors.neutral100};
6642
- }
6643
- &.active {
6644
- background-color: ${theme.colors.primaryActive};
6645
- color: ${theme.colors.white || '#fff'};
6646
- svg {
6647
- stroke: ${theme.colors.white || '#fff'};
6648
- }
6649
- }
6650
- `;
6651
- const SubotInlineButtonReview = styled.div `
6652
- padding: 12px 24px;
6653
- border: 1px solid ${theme.colors.neutral100 || '#E4E8EC'};
6654
- background-color: ${theme.colors.white || 'white'};
6655
- border-radius: 32px;
6656
- cursor: pointer;
6657
- transition: 0.25s all linear;
6658
- &.active {
6659
- background-color: ${(_a = theme.colors) === null || _a === void 0 ? void 0 : _a.primaryActive};
6660
- color: ${theme.colors.white || '#fff'};
6661
- svg {
6662
- stroke: ${theme.colors.white || '#fff'};
6663
- }
6664
- }
6665
- `;
6666
- const SubotInlineActionText = styled.div `
6667
- display: flex;
6668
- align-items: center;
6669
- padding: 16px 24px;
6670
- border: 1px solid
6671
- ${({ active }) => active
6672
- ? theme.colors.primaryBase || '#2685F1'
6673
- : theme.colors.white || '#fff'};
6674
- background-color: ${theme.colors.white || '#fff'};
6675
- border-radius: ${theme.borderRadius};
6676
- cursor: pointer;
6677
- transition: 0.25s all linear;
6678
- .label {
6679
- flex: 1;
6680
- }
6681
- .icon {
6682
- position: relative;
6683
- z-index: 0;
6684
- display: flex;
6685
- width: 24px;
6686
- height: 24px;
6687
- align-items: center;
6688
- justify-content: center;
6689
- padding: 1px;
6690
- transition: 0.2s linear all;
6691
- .icon-checkbox {
6692
- width: 100%;
6693
- height: 100%;
6694
- opacity: 0;
6695
- ${({ active }) => active && `opacity: 1`};
6696
- transition: 0.25s all linear;
6697
- }
6698
- &:before {
6699
- position: absolute;
6700
- top: 50%;
6701
- left: 50%;
6702
- width: 22px;
6703
- height: 22px;
6704
- border: 2px solid
6705
- ${({ active }) => active
6706
- ? theme.colors.primaryBase || '#2685F1'
6707
- : theme.colors.gray600 || '#595959'};
6708
- border-radius: 50%;
6709
- content: '';
6710
- transform: translate(-50%, -50%);
6711
- transition: 0.25s all linear;
6712
- }
6713
- &:after {
6714
- position: absolute;
6715
- z-index: -1;
6716
- top: 50%;
6717
- left: 50%;
6718
- width: 10px;
6719
- height: 10px;
6720
- background-color: ${theme.colors.primaryBase || '#2685F1'};
6721
- border-radius: 50%;
6722
- content: '';
6723
- opacity: 0;
6724
- ${({ active }) => active && `opacity: 1`};
6725
- transform: translate(-50%, -50%);
6726
- transition: 0.25s all linear;
6727
- }
6728
- }
6729
- &:hover {
6730
- border-color: ${((_b = theme.colors) === null || _b === void 0 ? void 0 : _b.primaryBase) || '#2685F1'};
6731
- .icon {
6732
- &:before {
6733
- border-color: ${((_c = theme.colors) === null || _c === void 0 ? void 0 : _c.primaryBase) || '#2685F1'};
6734
- transition: 0.2s linear all;
6735
- }
6736
- }
6737
- }
6738
- ${MediaQueries.tdDown} {
6739
- padding: 16px 20px;
6740
- }
6741
- `;
6742
- const SubotInlineActionImage = styled(SubotInlineActionText) `
6743
- position: relative;
6744
- flex-wrap: wrap;
6745
- padding: 16px;
6746
- background-color: ${((_d = theme.colors) === null || _d === void 0 ? void 0 : _d.white) || '#fff'};
6747
- .image-container {
6748
- position: relative;
6749
- overflow: hidden;
6750
- width: 100%;
6751
- padding-top: 67%;
6752
- border-radius: 10px;
6753
- .image {
6754
- position: absolute;
6755
- top: 50%;
6756
- left: 50%;
6757
- width: 100%;
6758
- min-width: 100%;
6759
- height: auto;
6760
- min-height: 100%;
6761
- transform: translate(-50%, -50%);
6762
- }
6763
- }
6764
- .label {
6765
- margin-top: 16px;
6766
- }
6767
- .icon {
6768
- position: absolute;
6769
- top: 1.75rem;
6770
- right: 1.75rem;
6771
- &:before {
6772
- z-index: -1;
6773
- background-color: #fff;
6774
- }
6775
- }
6776
- ${MediaQueries.tdDown} {
6777
- padding: 12px;
6778
- .label {
6779
- margin-top: 12px;
6780
- }
6781
- .icon {
6782
- top: 1.3rem;
6783
- right: 1.3rem;
6784
- }
6785
- }
6786
- ${MediaQueries.tdDown} {
6787
- padding: 8px;
6788
- .label {
6789
- margin-top: 8px;
6790
- }
6791
- .icon {
6792
- top: 0.9rem;
6793
- right: 0.9rem;
6794
- }
6795
- }
6796
- `;
6797
- const SubotInlineActionRatingStartContainer = styled.div `
6798
- display: flex;
6799
- align-items: center;
6800
- justify-content: flex-start;
6801
- ${MediaQueries.tdDown} {
6802
- justify-content: center;
6803
- }
6804
- `;
6805
- const SubotInlineActionRatingDescriptionContainer = styled.div `
6806
- textarea {
6807
- background-color: ${((_e = theme.colors) === null || _e === void 0 ? void 0 : _e.white) || '#fff'};
6808
- }
6809
- `;
6810
- const SubotInlineActionPollResult = styled.div `
6811
- margin-top: 20px;
6812
- color: ${((_f = theme.colors) === null || _f === void 0 ? void 0 : _f.gray500) || '#737373'};
6813
- font-weight: 600;
6814
- `;
6815
- const SubotInlineActionPollChoiceResult = styled.div `
6816
- position: relative;
6817
- z-index: 0;
6818
- display: flex;
6819
- overflow: hidden;
6820
- align-items: center;
6821
- padding: 16px 20px;
6822
- border-radius: ${theme.borderRadius};
6823
- .number {
6824
- width: 32px;
6825
- margin-right: 14px;
6826
- font-weight: 600;
6827
- }
6828
- .content {
6829
- flex: 1;
6830
- }
6831
- .icon {
6832
- width: 16px;
6833
- margin-left: 8px;
6834
- }
6835
- &:before {
6836
- position: absolute;
6837
- z-index: -1;
6838
- top: 0;
6839
- right: ${({ percent }) => (percent ? `${100 - percent}%` : '100%')};
6840
- bottom: 0;
6841
- left: 0;
6842
- background-color: ${({ is_chosen }) => is_chosen
6843
- ? theme.colors.primary50 || '#E3F2FF'
6844
- : theme.colors.neutral100 || '#E4E8EC'};
6845
- content: '';
6846
- transition: 0.3s all linear;
6847
- }
6848
- &:after {
6849
- position: absolute;
6850
- z-index: -2;
6851
- top: 0;
6852
- right: 0;
6853
- bottom: 0;
6854
- left: 0;
6855
- background-color: ${((_g = theme.colors) === null || _g === void 0 ? void 0 : _g.white) || '#fff'};
6856
- content: '';
6857
- }
6858
- ${MediaQueries.mbDown} {
6859
- padding: 6px 16px;
6860
- }
6861
- `;
6862
- const SubotInlineActionItemContainer = styled.div `
6863
- width: ${({ width }) => width || '100%'};
6864
- padding: 4px;
6865
- &.item-image-container {
6866
- padding: 16px;
6867
- ${MediaQueries.tdDown} {
6868
- padding: 7.5px;
6869
- }
6870
- ${MediaQueries.mbDown} {
6871
- width: 50%;
6872
- }
6873
- }
6874
- `;
6875
- const SubotInlineActionListContainer = styled.div `
6876
- display: flex;
6877
- flex-wrap: wrap;
6878
- align-items: flex-start;
6879
- justify-content: center;
6880
- margin: -4px;
6881
-
6882
- &.list-container {
6883
- margin: -16px;
6884
- ${MediaQueries.tdDown} {
6885
- margin: -7.5px;
6886
- }
6887
- }
6888
-
6889
- &.review-container {
6890
- margin: -8px;
6891
- > div {
6892
- padding: 8px;
6893
- }
6894
- }
6895
- `;
6896
-
6897
- const SubotInlineAction = ({ actions, value, onChange, htmlType, node_type, formSubmitMeta, }) => {
6898
- const className = useMemo(() => {
6899
- switch (node_type) {
6900
- case NodeType.IMAGE:
6901
- case NodeType.REACTION:
6902
- return 'list-container';
6903
- default:
6904
- return '';
6905
- }
6906
- }, [node_type]);
6907
- return (React__default.createElement(React__default.Fragment, null, actions && !!(actions === null || actions === void 0 ? void 0 : actions.length) && (React__default.createElement(SubotInlineActionListContainer, { className: className }, actions === null || actions === void 0 ? void 0 : actions.map((action) => {
6908
- const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
6909
- return (NodeAction && (React__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 })));
6910
- })))));
6911
- };
6912
-
6913
- const ButtonStyled = styled(Button$1) `
6914
- &:disabled {
6915
- background-color: rgb(242, 242, 242);
6916
- color: rgb(140, 140, 140);
6917
-
6918
- &:hover {
6919
- border: 0;
6920
- }
6921
- }
6922
- svg {
6923
- path {
6924
- stroke: currentColor;
6925
- }
6926
- }
6927
- `;
6928
- const ButtonBackStyled = styled(ButtonStyled) `
6929
- &:disabled {
6930
- background-color: rgb(242, 242, 242);
6931
- color: rgb(140, 140, 140);
6932
- &:hover {
6933
- border: 0;
6934
- }
6935
- }
6936
- svg {
6937
- path {
6938
- stroke: currentColor;
6939
- }
6940
- }
6941
- `;
6942
- const SubotInlineFooterStyled = styled.div `
6943
- display: flex;
6944
- align-items: center;
6945
- justify-content: flex-end;
6946
- padding: 16px 32px;
6947
- border-top: 4px solid ${theme.colors.neutral100 || '#E4E8EC'};
6948
- .mantine-Button-root {
6949
- + .mantine-Button-root {
6950
- margin-left: 8px;
6951
- }
6952
- }
6953
- ${MediaQueries.tdDown} {
6954
- padding: 12px 24px;
6955
- }
6956
- ${MediaQueries.mbDown} {
6957
- padding: 12px 16px;
6958
- }
6959
- `;
6960
-
6961
- const SubotInlineActionTextChoice = ({ action, onChange, active, htmlType, formSubmitMeta, }) => {
6962
- const { trackingCommonInline } = useContext(SubotInlineContext);
6963
- const inputRef = useRef(null);
6964
- const [otherText, setOtherText] = useState('');
6965
- const isActionPollWithOther = (action === null || action === void 0 ? void 0 : action.type) === NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
6966
- const isActionSelectWithOther = (action === null || action === void 0 ? void 0 : action.type) === NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
6967
- isActionPollWithOther;
6968
- const onChangeTextArea = (evt) => {
6969
- setOtherText(evt.target.value);
6970
- if (isActionSelectWithOther) {
6971
- onChange === null || onChange === void 0 ? void 0 : onChange(action, [
6972
- {
6973
- key: KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD,
6974
- control: ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type] || 'text',
6975
- value: evt.target.value,
6976
- action_id: action.id,
6977
- },
6978
- ]);
6979
- }
6980
- };
6981
- useEffect(() => {
6982
- var _a, _b;
6983
- if (active) {
6984
- 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) || '');
6985
- (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus();
6986
- }
6987
- }, [active, formSubmitMeta]);
6988
- return (React__default.createElement(SubotInlineActionItemContainer, null,
6989
- React__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" }),
6990
- React__default.createElement("div", { className: "label" },
6991
- React__default.createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label)),
6992
- React__default.createElement("div", { className: "icon" }, htmlType === 'checkbox' && (React__default.createElement(CheckboxIcon, { className: "icon-checkbox", viewBox: "0 0 22 22" })))),
6993
- isActionSelectWithOther && active && (React__default.createElement(Box, { mt: "6px", style: { textAlign: 'right' } },
6994
- React__default.createElement(Textarea, { ref: inputRef, placeholder: action === null || action === void 0 ? void 0 : action.label, styles: {
6995
- input: {
6996
- paddingLeft: '24px',
6997
- paddingRight: '24px',
6998
- boxShadow: 'none',
6999
- ':focus': { boxShadow: 'none' },
7000
- },
7001
- }, value: otherText, onChange: onChangeTextArea, maxLength: 360 })))));
7002
- };
7003
- const SubotInlineActionImageChoice = ({ action, onChange, active, htmlType, }) => {
7004
- const { trackingCommonInline } = useContext(SubotInlineContext);
7005
- return (React__default.createElement(SubotInlineActionItemContainer, { width: "45%", className: 'item-image-container' },
7006
- React__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" }),
7007
- React__default.createElement("div", { className: "image-container" },
7008
- React__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" })),
7009
- (action === null || action === void 0 ? void 0 : action.label) && (React__default.createElement("div", { className: "label" },
7010
- React__default.createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))),
7011
- React__default.createElement("div", { className: "icon" }, htmlType === 'checkbox' && (React__default.createElement(CheckboxIcon, { className: "icon-checkbox", viewBox: "0 0 22 22" }))))));
7012
- };
7013
- const SubotInlineActionSSO = ({ action, onChange, }) => {
7014
- const { trackingCommonInline } = useContext(SubotInlineContext);
7015
- return (React__default.createElement(SubotInlineActionItemContainer, { width: "50%", style: { alignSelf: 'center' } },
7016
- React__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 }),
7017
- React__default.createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7018
- };
7019
- const SubotInlinePollChoice = ({ active, action, onChange, htmlType, node_type, }) => {
7020
- const handleOnChange = (action) => {
7021
- if (action)
7022
- onChange &&
7023
- onChange({
7024
- key: (action === null || action === void 0 ? void 0 : action.key) || '',
7025
- control: ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7026
- value: '',
7027
- action_id: action === null || action === void 0 ? void 0 : action.id,
7028
- });
7029
- };
7030
- if (node_type === NodeType.RESULT_POLL)
7031
- return (React__default.createElement(SubotInlineActionItemContainer, null,
7032
- React__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 },
7033
- React__default.createElement("div", { className: "number" }, action === null || action === void 0 ? void 0 :
7034
- action.percent,
7035
- "%"),
7036
- React__default.createElement("div", { className: "content" }, action === null || action === void 0 ? void 0 : action.label),
7037
- React__default.createElement("div", { className: "icon" }, (action === null || action === void 0 ? void 0 : action.is_chosen) && React__default.createElement(CheckIcon, { viewBox: "0 0 16 16" })))));
7038
- return (React__default.createElement(SubotInlineActionTextChoice, { active: !!active, action: action, onChange: handleOnChange, htmlType: htmlType }));
7039
- };
7040
- const SubotInlinePollChoiceImage = ({ active, action, onChange, htmlType, node_type, }) => {
7041
- const handleOnChange = (action) => {
7042
- if (action)
7043
- onChange &&
7044
- onChange({
7045
- key: action === null || action === void 0 ? void 0 : action.key,
7046
- control: ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7047
- value: '',
7048
- action_id: action === null || action === void 0 ? void 0 : action.id,
7049
- });
7050
- };
7051
- if (node_type === NodeType.RESULT_POLL)
7052
- // TODO: Update layout result poll image
7053
- return (React__default.createElement(SubotInlineActionItemContainer, null,
7054
- React__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 },
7055
- React__default.createElement("div", { className: "number" }, action === null || action === void 0 ? void 0 :
7056
- action.percent,
7057
- "%"),
7058
- React__default.createElement("div", { className: "content" }, action === null || action === void 0 ? void 0 : action.label),
7059
- React__default.createElement("div", { className: "icon" }, (action === null || action === void 0 ? void 0 : action.is_chosen) && React__default.createElement(CheckIcon, { viewBox: "0 0 16 16" })))));
7060
- return (React__default.createElement(SubotInlineActionImageChoice, { active: !!active, action: action, onChange: handleOnChange, htmlType: htmlType }));
7061
- };
7062
- const SubotInlineRatingStar = ({ action, value, onChange, }) => {
7063
- var _a, _b;
7064
- return (React__default.createElement(SubotInlineActionItemContainer, null,
7065
- React__default.createElement(SubotInlineActionRatingStartContainer, null,
7066
- React__default.createElement(StarRatings, { rating: value && typeof value !== 'string' && (value === null || value === void 0 ? void 0 : value.value)
7067
- ? parseInt(value === null || value === void 0 ? void 0 : value.value)
7068
- : 0, changeRating: (star) => {
7069
- const _value = {
7070
- key: action === null || action === void 0 ? void 0 : action.key,
7071
- control: ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7072
- value: star.toString(),
7073
- action_id: action === null || action === void 0 ? void 0 : action.id,
7074
- };
7075
- onChange && onChange(_value);
7076
- }, starHoverColor: (_a = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _a === void 0 ? void 0 : _a.yellow600, starRatedColor: (_b = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _b === void 0 ? void 0 : _b.yellow600, starDimension: "48" }))));
7077
- };
7078
- const SubotInlineTextArea = ({ action, value, onChange, }) => {
7079
- return (React__default.createElement(SubotInlineActionItemContainer, null,
7080
- React__default.createElement(SubotInlineActionRatingDescriptionContainer, null,
7081
- React__default.createElement(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)
7082
- ? value === null || value === void 0 ? void 0 : value.value
7083
- : '', onChange: (evt) => {
7084
- const _value = {
7085
- key: action === null || action === void 0 ? void 0 : action.key,
7086
- control: ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7087
- value: evt.target.value,
7088
- action_id: action === null || action === void 0 ? void 0 : action.id,
7089
- };
7090
- onChange && onChange(_value);
7091
- } }))));
7092
- };
7093
- const SubotInlineLikeChoice = ({ action, active, onChange, }) => {
7094
- return (React__default.createElement(SubotInlineActionItemContainer, { width: "40%", className: 'item-image-container' },
7095
- React__default.createElement(SubotInlineButtonReaction, { className: classNames(!!active && 'active'), onClick: () => onChange && onChange(action) },
7096
- React__default.createElement(LikeIcon, { viewBox: "0 0 24 24" }),
7097
- React__default.createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7098
- };
7099
- const SubotInlineDislikeChoice = ({ action, active, onChange, }) => {
7100
- return (React__default.createElement(SubotInlineActionItemContainer, { width: "40%", className: 'item-image-container' },
7101
- React__default.createElement(SubotInlineButtonReaction, { className: classNames(!!active && 'active'), onClick: () => onChange && onChange(action) },
7102
- React__default.createElement(DislikeIcon, { viewBox: "0 0 24 24" }),
7103
- React__default.createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7104
- };
7105
- const SubotInlineReviewChoice = ({ active, action, onChange, }) => (React__default.createElement(SubotInlineActionItemContainer, { width: "auto", className: "review-choice" },
7106
- React__default.createElement(SubotInlineButtonReview, { className: classNames(!!active && 'active'), onClick: () => onChange &&
7107
- onChange({
7108
- key: action === null || action === void 0 ? void 0 : action.key,
7109
- control: ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type],
7110
- value: '',
7111
- action_id: action === null || action === void 0 ? void 0 : action.id,
7112
- }) },
7113
- React__default.createElement(Markdown, null, action === null || action === void 0 ? void 0 : action.label))));
7114
- const SubotInlinePollResult = ({ action, }) => (React__default.createElement(SubotInlineActionItemContainer, null,
7115
- React__default.createElement(SubotInlineActionPollResult, null, action === null || action === void 0 ? void 0 : action.label)));
7116
- const SubotInlineActionBase = {
7117
- 'user-image': SubotInlineActionImageChoice,
7118
- [NodeActionType.USER_CHOICE_TEXT]: SubotInlineActionTextChoice,
7119
- [NodeActionType.USER_CHOICE_TEXT_BY_INPUT]: SubotInlineActionTextChoice,
7120
- [NodeActionType.USER_CHOICE_IMAGE]: SubotInlineActionImageChoice,
7121
- [NodeActionType.ACTION_SSO_REDIRECT]: SubotInlineActionSSO,
7122
- [NodeActionType.POLL_CHOICE]: SubotInlinePollChoice,
7123
- [NodeActionType.POLL_CHOICE_TEXT_BY_INPUT]: SubotInlineActionTextChoice,
7124
- [NodeActionType.POLL_CHOICE_IMAGE]: SubotInlinePollChoiceImage,
7125
- [NodeActionType.RATING_STAR]: SubotInlineRatingStar,
7126
- [NodeActionType.RATING_DESCRIPTION]: SubotInlineTextArea,
7127
- [NodeActionType.LIKE_CHOICE]: SubotInlineLikeChoice,
7128
- [NodeActionType.DISLIKE_CHOICE]: SubotInlineDislikeChoice,
7129
- [NodeActionType.REVIEW_CHOICE]: SubotInlineReviewChoice,
7130
- [NodeActionType.REVIEW_DESCRIPTION]: SubotInlineTextArea,
7131
- [NodeActionType.RESULT_BUTTON]: SubotInlineActionTextChoice,
7132
- [NodeActionType.POLL_RESULT]: SubotInlinePollResult,
7133
- };
7134
-
7135
- const SubotInlineFooter = ({ onBack, onNext: onSubmit, hideBack, hideNext, nextText, backProps, nextProps, }) => {
7136
- var _a, _b, _c;
7137
- const { formatMessage: f } = useContext(TogetherComponentGlobalContext);
7138
- const { nodes: listNodes, activeId, params, onNext, trackingCommonInline, } = useContext(SubotInlineContext);
7139
- const nodeMessage = listNodes.find((nodeItem) => nodeItem.id == activeId);
7140
- const actionNextChoice = (_a = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage.actions) === null || _a === void 0 ? void 0 : _a.find((act) => act.type === NodeActionType.USER_CHOICE_NEXT);
7141
- const handleNextChoice = () => {
7142
- if (nodeMessage && actionNextChoice) {
7143
- const nextValue = {
7144
- node_id: nodeMessage.id,
7145
- action_id: actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.id,
7146
- action_value: actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.key,
7147
- };
7148
- onNext === null || onNext === void 0 ? void 0 : onNext(Object.assign(Object.assign(Object.assign({}, params), nextValue), nodeMessage._message));
7149
- }
7150
- };
7151
- const actionSubmitMultiple = (_b = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage.actions) === null || _b === void 0 ? void 0 : _b.find((act) => act.type === NodeActionType.ACTION_MULTIPLE_BUTTON);
7152
- return (React__default.createElement(SubotInlineFooterStyled, null,
7153
- !hideBack && (React__default.createElement(ButtonBackStyled, Object.assign({ size: "md", color: "secondary", onClick: onBack }, backProps, { className: classNames('pointer-event-child-none', backProps === null || backProps === void 0 ? void 0 : backProps.className) }, trackingCommonInline, { "data-event-action": "Back Click" }),
7154
- React__default.createElement(ArrowLeft, { style: { marginRight: 10 } }),
7155
- f({
7156
- id: 'riskScreener.back',
7157
- defaultMessage: 'Back',
7158
- }))),
7159
- !hideNext && (React__default.createElement(ButtonStyled, Object.assign({ size: "md", color: "primary", onClick: actionNextChoice ? handleNextChoice : onSubmit }, nextProps, { className: classNames('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) ||
7160
- (actionNextChoice === null || actionNextChoice === void 0 ? void 0 : actionNextChoice.id) ||
7161
- ((_c = nodeMessage === null || nodeMessage === void 0 ? void 0 : nodeMessage._message) === null || _c === void 0 ? void 0 : _c.action_id) }),
7162
- !nextText
7163
- ? f({
7164
- id: 'riskScreener.next',
7165
- defaultMessage: 'Next',
7166
- })
7167
- : nextText,
7168
- React__default.createElement(ArrowRight, { style: { marginLeft: 10 } })))));
7169
- };
7170
- var SubotInlineFooter$1 = memo(SubotInlineFooter);
7171
-
7172
- const SubotInlineHeadline = styled.h4 `
7173
- padding: 32px 0px 12px;
7174
- border-bottom: 1px solid ${theme.colors.neutral100 || '#E4E8EC'};
7175
- margin: 0px 32px;
7176
- color: ${theme.colors.gray500 || '#737373'};
7177
- font-size: 14px;
7178
- font-weight: 700;
7179
- line-height: 1.5;
7180
- ${MediaQueries.tdDown} {
7181
- padding: 24px 0px 12px;
7182
- margin: 0px 24px;
7183
- }
7184
- ${MediaQueries.mbDown} {
7185
- padding: 16px 0px 12px;
7186
- margin: 0px 16px;
7187
- }
7188
- `;
7189
- const SubotInlineHeader = () => {
7190
- const { formatMessage: f } = useContext(TogetherComponentGlobalContext);
7191
- const { nodes } = useContext(SubotInlineContext);
7192
- const headline = useMemo(() => { var _a; return (_a = nodes[0]) === null || _a === void 0 ? void 0 : _a.inline_headline; }, [nodes]);
7193
- return (React__default.createElement(SubotInlineHeadline, null, headline ||
7194
- f({
7195
- id: 'subotInline.quote',
7196
- defaultMessage: 'HAVE TIME FOR A QUICK QUESTION?',
7197
- })));
7198
- };
7199
- var SubotInlineHeader$1 = memo(SubotInlineHeader);
7200
-
7201
- const SubotInlineIntentTitle = styled.h3 `
7202
- margin-bottom: 0px;
7203
- font-size: 22px;
7204
- font-weight: bold;
7205
- line-height: 1.45;
7206
- ${MediaQueries.tdDown} {
7207
- font-size: 20px;
7208
- }
7209
- `;
7210
- const SubotInlineRecalculateButton = styled(Button$1) `
7211
- &.bot-recalculate {
7212
- svg {
7213
- path {
7214
- stroke: ${theme.colors.primaryBase || '#2685F1'} !important;
7215
- }
7216
- }
7217
- &:hover {
7218
- svg {
7219
- path {
7220
- stroke: #fff !important;
7221
- }
7222
- }
7223
- }
7224
- }
7225
- `;
7226
- const SubotInlineIntentButton = styled(Button$1) `
7227
- border: 2px solid transparent;
7228
- `;
7229
- const SubotInlineItemIcon = styled.div `
7230
- display: flex;
7231
- padding-top: 10px;
7232
- padding-bottom: 10px;
7233
- .icon {
7234
- width: 64px;
7235
- height: 64px;
7236
- margin-right: 16px;
7237
- object-fit: contain;
7238
- object-position: center;
7239
- }
7240
- .content {
7241
- flex: 1;
7242
- .title {
7243
- margin-top: 0;
7244
- margin-bottom: 0;
7245
- font-size: inherit;
7246
- font-weight: 700;
7247
- line-height: 1.4;
7248
- }
7249
- .description {
7250
- color: ${theme.colors.gray700 || '#404040'};
7251
- line-height: 1.4;
7252
- }
7253
- }
7254
- ${MediaQueries.mbDown} {
7255
- .icon {
7256
- width: 47px;
7257
- height: 47px;
7258
- margin-right: 16px;
7259
- }
7260
- .content {
7261
- .title {
7262
- font-size: 14px;
7263
- }
7264
- .description {
7265
- font-size: 14px;
7266
- }
7267
- }
7268
- }
7269
- `;
7270
- styled(Button$1) ``;
7271
- const SubotInlineIntentFirstTextWrapper = styled.div `
7272
- display: flex;
7273
- align-items: flex-start;
7274
- color: ${theme.colors.gray800 || '#262626'};
7275
- font-size: 22px;
7276
- font-weight: 700;
7277
- letter-space: -0.6px;
7278
- line-height: 1.45;
7279
- .number {
7280
- margin-right: 3px;
7281
- }
7282
- .title {
7283
- flex: 1;
7284
- }
7285
- ${MediaQueries.tdDown} {
7286
- font-size: 20px;
7287
- }
7288
- ${MediaQueries.mbDown} {
7289
- font-size: 18px;
7290
- }
7291
- `;
7292
- const SubotInlineIntentFirstImageWrapper = styled.div `
7293
- display: flex;
7294
- justify-content: center;
7295
- `;
7296
- const SubotInlineIntentFirstTextContainer = styled.div ``;
7297
- const SubotInlineIntentTextContainer = styled.div `
7298
- padding: 12px 16px;
7299
- border: 1px solid ${theme.colors.gray200 || '#D9D9D9'};
7300
- background-color: ${theme.colors.white || '#fff'};
7301
- border-radius: ${theme.borderRadius};
7302
- line-height: 1.5;
7303
- `;
7304
- const SubotInlineIntentImageContainer = styled.div `
7305
- border: ${theme.colors.gray200 || '#D9D9D9'};
7306
- background-color: ${theme.colors.white || '#FFF'};
7307
- border-radius: ${theme.borderRadius};
7308
- .intent-img {
7309
- border-radius: ${theme.borderRadius};
7310
- &.has-label {
7311
- border-bottom-left-radius: 0px;
7312
- border-bottom-right-radius: 0px;
7313
- }
7314
- }
7315
- .intent-img-label {
7316
- padding: 5px 10px;
7317
- font-size: 0.8em;
7318
- font-style: italic;
7319
- font-weight: 400;
7320
- }
7321
- `;
7322
- const SubotInlineIntentUrlContainer = styled.div `
7323
- display: flex;
7324
- .feature {
7325
- width: 30%;
7326
- .feature-wrapper {
7327
- position: relative;
7328
- display: block;
7329
- overflow: hidden;
7330
- width: 100%;
7331
- padding-top: 66%;
7332
- border-radius: ${theme.borderRadius};
7333
- .feature-img {
7334
- position: absolute;
7335
- top: 50%;
7336
- left: 50%;
7337
- width: 100%;
7338
- min-width: 100%;
7339
- height: auto;
7340
- min-height: 100%;
7341
- transform: translate(-50%, -50%);
7342
- }
7343
- }
7344
- }
7345
- .body {
7346
- flex: 1;
7347
- margin-left: 10px;
7348
- line-height: 1.5;
7349
- a {
7350
- color: ${theme.colors.gray800 || '#262626'};
7351
- text-decoration: none;
7352
- }
7353
- }
7354
- `;
7355
- const SubotInlineIntentRiskScreenerContainer = styled.div `
7356
- display: flex;
7357
- align-items: center;
7358
- justify-content: space-between;
7359
- padding: 20px 40px 20px 16px;
7360
- background-color: #fff;
7361
- border-radius: ${theme.borderRadius};
7362
- box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 0px 2px rgba(0, 0, 0, 0.06),
7363
- 0px 0px 1px rgba(0, 0, 0, 0.04);
7364
- .feature {
7365
- display: block;
7366
- overflow: hidden;
7367
- width: 72px;
7368
- height: 72px;
7369
- margin-right: 16px;
7370
- border-radius: ${theme.borderRadius};
7371
- img {
7372
- width: 100%;
7373
- height: 100%;
7374
- object-fit: cover;
7375
- object-position: center;
7376
- }
7377
- }
7378
- .title-container {
7379
- display: flex;
7380
- flex: 1;
7381
- align-items: center;
7382
- justify-content: space-between;
7383
- a {
7384
- font-size: 16px;
7385
- line-height: 1.5em;
7386
- text-decoration: none;
7387
- .title {
7388
- padding: 0;
7389
- color: #262626;
7390
- font-size: inherit;
7391
- line-height: inherit;
7392
- }
7393
- &.link {
7394
- display: flex;
7395
- align-items: center;
7396
- justify-content: center;
7397
- margin-left: 20px;
7398
- color: #2d87f3;
7399
- font-weight: 700;
7400
- }
7401
- }
7402
- }
7403
- @media screen and (max-width: 769px) {
7404
- padding: 16px 12px;
7405
- .feature {
7406
- width: 50px;
7407
- height: 50px;
7408
- }
7409
- .title-container {
7410
- a {
7411
- font-size: 13px;
7412
- line-height: 20px;
7413
- &.link {
7414
- margin-left: 10px;
7415
- }
7416
- }
7417
- }
7418
- }
7419
- `;
7420
- const SubotInlineIntentFinalButtonContainer = styled.div `
7421
- display: flex;
7422
- align-items: center;
7423
- justify-content: center;
7424
- `;
7425
- styled.div `
7426
- padding: 16px;
7427
- margin-top: 32px;
7428
- margin-bottom: 32px;
7429
- background-color: ${theme.colors.primary50 || ''};
7430
- border-radius: ${theme.borderRadius};
7431
- .item-grid {
7432
- > div {
7433
- box-shadow: none;
7434
- }
7435
- }
7436
- .lp--affiliate-product {
7437
- .arrow-left {
7438
- left: -20px;
7439
- }
7440
- .arrow-right {
7441
- right: -16px;
7442
- }
7443
- }
7444
- .bullet-nav {
7445
- bottom: -10px;
7446
- }
7447
- `;
7448
- const SubotInlineIntentFinalCol = styled.div `
7449
- width: ${({ width }) => width || '100%'};
7450
- padding: 8px;
7451
- ${MediaQueries.mbDown} {
7452
- width: 100%;
7453
- }
7454
- `;
7455
- const SubotInlineIntentFinalRow = styled.div `
7456
- display: flex;
7457
- flex-wrap: wrap;
7458
- align-items: flex-start;
7459
- justify-content: center;
7460
- margin: 0 -8px;
7461
- `;
7462
- const SubotInlineIntentCol = styled.div `
7463
- width: ${({ width }) => width || '100%'};
7464
- padding: 4px;
7465
- ${MediaQueries.mbDown} {
7466
- width: 100%;
7467
- }
7468
- `;
7469
- const SubotInlineIntentRow = styled.div `
7470
- display: flex;
7471
- flex-wrap: wrap;
7472
- align-items: flex-start;
7473
- justify-content: center;
7474
- margin: 0 -4px;
7475
- `;
7476
- const SubotInlineIntentList = styled.div `
7477
- margin-top: 20px;
7478
- `;
7479
-
7480
- const SubotInlineIntent = ({ intents, indexNumber, }) => {
7481
- var _a, _b;
7482
- const title = useMemo(() => {
7483
- const _title = intents && intents[0];
7484
- if (_title)
7485
- return _title;
7486
- return null;
7487
- }, []);
7488
- if (!intents.length)
7489
- return React__default.createElement(SubotInlineIntentBotTitle, { indexNumber: indexNumber });
7490
- return (React__default.createElement(React__default.Fragment, null,
7491
- title && (React__default.createElement(SubotInlineIntentBotTitle, { intent: title, indexNumber: indexNumber })),
7492
- !!((_a = intents.slice(1)) === null || _a === void 0 ? void 0 : _a.length) && (React__default.createElement(SubotInlineIntentList, null,
7493
- React__default.createElement(SubotInlineIntentRow, null, (_b = intents.slice(1)) === null || _b === void 0 ? void 0 : _b.map((intent) => {
7494
- const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
7495
- return (NodeIntent && React__default.createElement(NodeIntent, { key: intent.id, intent: intent }));
7496
- }))))));
7497
- };
7498
-
7499
- const SubotInlineIntentFinal = ({ intents: intentsProps, }) => {
7500
- const intents = useMemo(() => {
7501
- const mainIntents = [];
7502
- const subIntents = [];
7503
- const rest = [];
7504
- intentsProps === null || intentsProps === void 0 ? void 0 : intentsProps.map((intent) => {
7505
- switch (intent === null || intent === void 0 ? void 0 : intent.type) {
7506
- case NodeIntentType.BOT_MAIN_IMAGE:
7507
- mainIntents.push(intent);
7508
- break;
7509
- case NodeIntentType.BOT_MAIN_TITLE:
7510
- mainIntents.push(intent);
7511
- break;
7512
- case NodeIntentType.BOT_MAIN_BODY:
7513
- mainIntents.push(intent);
7514
- break;
7515
- case NodeIntentType.BOT_MAIN_BUTTON:
7516
- mainIntents.push(intent);
7517
- break;
7518
- case NodeIntentType.BOT_RECALCULATE:
7519
- mainIntents.push(intent);
7520
- break;
7521
- case NodeIntentType.BOT_SUB_TITLE:
7522
- subIntents.push(intent);
7523
- break;
7524
- case NodeIntentType.BOT_SUB_BODY:
7525
- subIntents.push(intent);
7526
- break;
7527
- default:
7528
- rest.push(intent);
7529
- break;
7530
- }
7531
- });
7532
- return {
7533
- mainIntents,
7534
- subIntents,
7535
- intents: rest,
7536
- };
7537
- }, []);
7538
- if (!(intentsProps === null || intentsProps === void 0 ? void 0 : intentsProps.length)) {
7539
- return null;
7540
- }
7541
- function renderIntent(intent) {
7542
- const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
7543
- if (!NodeIntent) {
7544
- return null;
7545
- }
7546
- return React__default.createElement(NodeIntent, { key: intent.id, intent: intent });
7547
- }
7548
- return (React__default.createElement(SubotInlineIntentRow, null,
7549
- React__default.createElement(SubotInlineIntentCol, null,
7550
- React__default.createElement(SubotInlineIntentFinalRow, null,
7551
- intents.mainIntents.map(renderIntent),
7552
- intents.subIntents.map(renderIntent),
7553
- intents.intents.map(renderIntent)))));
7554
- };
7555
-
7556
- /*******************************************************************************/
7557
- /*************************** NodeIntentType: 'bot-text' ************************/
7558
- //#region
7559
- const SubotInlineIntentBotText = ({ intent, }) => {
7560
- if (!(intent === null || intent === void 0 ? void 0 : intent.label))
7561
- return React__default.createElement(React__default.Fragment, null);
7562
- return (React__default.createElement(SubotInlineIntentCol, null,
7563
- React__default.createElement(SubotInlineIntentTextContainer, null,
7564
- React__default.createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
7565
- };
7566
- //#endregion
7567
- /*************************** END - NodeIntentType: 'bot-text' ******************/
7568
- /*******************************************************************************/
7569
- /*******************************************************************************/
7570
- /*************************** NodeIntentType: 'bot-image' ***********************/
7571
- //#region
7572
- const SubotInlineIntentBotImage = ({ intent, }) => {
7573
- if (!intent.url)
7574
- return React__default.createElement(React__default.Fragment, null);
7575
- const isObject = (() => {
7576
- try {
7577
- return Boolean(JSON.parse((intent === null || intent === void 0 ? void 0 : intent.label) || ''));
7578
- }
7579
- catch (err) {
7580
- return false;
7581
- }
7582
- })();
7583
- return (React__default.createElement(SubotInlineIntentCol, { width: "50%" },
7584
- React__default.createElement(SubotInlineIntentImageContainer, null,
7585
- React__default.createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
7586
- isObject && (React__default.createElement("h4", { className: "intent-img-label" },
7587
- React__default.createElement(Markdown, null, intent.label))))));
7588
- };
7589
- //#endregion
7590
- /*************************** END - NodeIntentType: 'bot-image' *****************/
7591
- /*******************************************************************************/
7592
- /*******************************************************************************/
7593
- /*************************** NodeIntentType: 'bot-button' **********************/
7594
- //#region
7595
- const SubotInlineIntentBotButton = ({ intent, }) => {
7596
- const { trackingCommonInline } = useContext(SubotInlineContext);
7597
- const handleOnClick = () => {
7598
- window.location.href = intent.url;
7599
- };
7600
- if (!(intent === null || intent === void 0 ? void 0 : intent.label))
7601
- return React__default.createElement(React__default.Fragment, null);
7602
- return (React__default.createElement(SubotInlineIntentCol, { width: "60%" },
7603
- React__default.createElement(SubotInlineIntentButton, Object.assign({ size: "lg", color: "primary", onClick: handleOnClick, isBlock: true }, trackingCommonInline, { "data-event-action": "Click CTA", "data-response-id": intent.id }),
7604
- React__default.createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
7605
- };
7606
- //#endregion
7607
- /*************************** END - NodeIntentType: 'bot-button' ****************/
7608
- /*******************************************************************************/
7609
- /*******************************************************************************/
7610
- /*************************** NodeIntentType: 'bot-url' *************************/
7611
- //#region
7612
- const SubotInlineIntentUrl = ({ intent, }) => {
7613
- const article = useMemo(() => intent.label.includes('{')
7614
- ? JSON.parse(intent.label)
7615
- : {}, [intent.label]);
7616
- return (React__default.createElement(React__default.Fragment, null, !!Object.keys(article).length && (React__default.createElement(SubotInlineIntentCol, null,
7617
- React__default.createElement(SubotInlineIntentUrlContainer, null,
7618
- React__default.createElement("div", { className: "feature" },
7619
- React__default.createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature-wrapper" },
7620
- React__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" }))),
7621
- React__default.createElement("div", { className: "body" },
7622
- React__default.createElement("a", { href: article === null || article === void 0 ? void 0 : article.url },
7623
- React__default.createElement("h5", { className: "title" },
7624
- React__default.createElement(Markdown, null, article === null || article === void 0 ? void 0 : article.title)))))))));
7625
- };
7626
- //#endregion
7627
- /*************************** END - NodeIntentType: 'bot-url' *******************/
7628
- /*******************************************************************************/
7629
- /*******************************************************************************/
7630
- /*************************** NodeIntentType: 'sso-intent' *************************/
7631
- //#region
7632
- const SubotInlineIntentSSO = ({ intent, }) => {
7633
- const info = (() => {
7634
- try {
7635
- return (intent === null || intent === void 0 ? void 0 : intent.label) ? JSON.parse(intent === null || intent === void 0 ? void 0 : intent.label) : {};
7636
- }
7637
- catch (err) {
7638
- return {};
7639
- }
7640
- })();
7641
- if (!info || !info.title)
7642
- return React__default.createElement(React__default.Fragment, null);
7643
- return (React__default.createElement(SubotInlineIntentCol, null,
7644
- React__default.createElement(SubotInlineItemIcon, null,
7645
- React__default.createElement("img", { loading: "lazy", src: intent === null || intent === void 0 ? void 0 : intent.url, className: "icon", alt: "" }),
7646
- React__default.createElement("div", { className: "content" },
7647
- React__default.createElement("h3", { className: "title" }, info.title),
7648
- React__default.createElement("div", { className: "description" }, info === null || info === void 0 ? void 0 : info.description)))));
7649
- };
7650
- //#endregion
7651
- /*************************** END - NodeIntentType: 'sso-intent' *******************/
7652
- /*******************************************************************************/
7653
- /*******************************************************************************/
7654
- /*************************** NodeIntentType: 'bot-title' ***********************/
7655
- //#region
7656
- const SubotInlineIntentBotTitle = ({ intent, indexNumber, }) => {
7657
- const isShowLabel = ![NodeIntentType.SSO_INTENT].includes(intent === null || intent === void 0 ? void 0 : intent.type);
7658
- return (React__default.createElement(SubotInlineIntentFirstTextContainer, null,
7659
- React__default.createElement(SubotInlineIntentFirstTextWrapper, null,
7660
- indexNumber && (React__default.createElement("div", { className: "number" },
7661
- indexNumber < 10 ? `0${indexNumber}` : indexNumber,
7662
- ".")),
7663
- isShowLabel &&
7664
- intent &&
7665
- [NodeIntentType.BOT_TEXT, NodeIntentType.BOT_BUTTON].includes(intent === null || intent === void 0 ? void 0 : intent.type) && React__default.createElement(Markdown, { className: "title" }, intent.label)),
7666
- intent &&
7667
- [NodeIntentType.BOT_IMAGE].includes(intent === null || intent === void 0 ? void 0 : intent.type) && (React__default.createElement(SubotInlineIntentFirstImageWrapper, null,
7668
- React__default.createElement(SubotInlineIntentBotImage, { intent: intent })))));
7669
- };
7670
- //#endregion
7671
- /*************************** END - NodeIntentType: 'bot-title' *****************/
7672
- /*******************************************************************************/
7673
- /*******************************************************************************/
7674
- /*************************** NodeIntentType: 'bot-main-title' ******************/
7675
- //#region
7676
- const SubotInlineIntentBotMainTitle = ({ intent, }) => {
7677
- if (!intent.label ||
7678
- intent.label === 'Sub title' ||
7679
- intent.label === 'Main title') {
7680
- return null;
7681
- }
7682
- return (React__default.createElement(SubotInlineIntentFinalCol, null,
7683
- React__default.createElement(SubotInlineIntentTitle, null,
7684
- React__default.createElement(Markdown, null, intent.label))));
7685
- };
7686
- //#endregion
7687
- /*************************** END - NodeIntentType: 'bot-main-title' ************/
7688
- /*******************************************************************************/
7689
- /*******************************************************************************/
7690
- /*************************** NodeIntentType: 'bot-main-image' ******************/
7691
- //#region
7692
- const SubotInlineIntentBotMainImage = ({ intent, }) => {
7693
- if (!intent.url)
7694
- return React__default.createElement(React__default.Fragment, null);
7695
- return (React__default.createElement(SubotInlineIntentFinalCol, null,
7696
- React__default.createElement(SubotInlineIntentImageContainer, null,
7697
- React__default.createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
7698
- intent.label && (React__default.createElement("h4", { className: "intent-img-label" },
7699
- React__default.createElement(Markdown, null, intent.label))))));
7700
- };
7701
- //#endregion
7702
- /*************************** END - NodeIntentType: 'bot-main-image' ************/
7703
- /*******************************************************************************/
7704
- /*******************************************************************************/
7705
- /*************************** NodeIntentType: 'bot-main-body' ******************/
7706
- //#region
7707
- const SubotInlineIntentBotMainBody = ({ intent, }) => {
7708
- if (!intent.label ||
7709
- intent.label === 'Main body' ||
7710
- intent.label === 'Sub body') {
7711
- return null;
7712
- }
7713
- return (React__default.createElement(SubotInlineIntentFinalCol, null,
7714
- React__default.createElement("div", { className: "intents__item markdown" },
7715
- React__default.createElement(Markdown, null, intent.label))));
7716
- };
7717
- //#endregion
7718
- /*************************** END - NodeIntentType: 'bot-main-body' ************/
7719
- /*******************************************************************************/
7720
- /*******************************************************************************/
7721
- /*************************** NodeIntentType: 'bot-main-button' *****************/
7722
- //#region
7723
- const SubotInlineIntentBotMainButton = ({ intent, }) => {
7724
- const { trackingCommonInline } = useContext(SubotInlineContext);
7725
- const handleOnClick = () => {
7726
- window.location.href = intent.url;
7727
- };
7728
- if (!intent.label)
7729
- return React__default.createElement(React__default.Fragment, null);
7730
- return (React__default.createElement(SubotInlineIntentCol, { width: "auto" },
7731
- React__default.createElement(SubotInlineIntentFinalButtonContainer, null,
7732
- React__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 }),
7733
- React__default.createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label)))));
7734
- };
7735
- //#endregion
7736
- /*************************** END - NodeIntentType: 'bot-main-button' ***********/
7737
- /*******************************************************************************/
7738
- /*******************************************************************************/
7739
- /*************************** NodeIntentType: 'bot-recalculate' *****************/
7740
- //#region
7741
- const SubotInlineIntentBotRecalculate = ({ intent }) => {
7742
- const { onReset } = useContext(SubotInlineContext);
7743
- const handleOnClick = () => {
7744
- onReset && onReset();
7745
- };
7746
- if (!(intent === null || intent === void 0 ? void 0 : intent.label))
7747
- return React__default.createElement(React__default.Fragment, null);
7748
- return (React__default.createElement(SubotInlineIntentCol, { width: "auto", style: { justifyContent: 'center', display: 'flex' } },
7749
- React__default.createElement(SubotInlineRecalculateButton, { size: "lg", color: "secondary", onClick: handleOnClick, icon: React__default.createElement(RotateLeft, null), className: "bot-recalculate" },
7750
- React__default.createElement(Markdown, null, intent === null || intent === void 0 ? void 0 : intent.label))));
7751
- };
7752
- //#endregion
7753
- /*************************** END - NodeIntentType: 'bot-recalculate' ***********/
7754
- /*******************************************************************************/
7755
- /*******************************************************************************/
7756
- /*************************** NodeIntentType: 'bot-risk-screener' ***************/
7757
- //#region
7758
- const SubotInlineIntentBotRiskScreener = ({ intent }) => {
7759
- const { formatMessage: f } = useContext(TogetherComponentGlobalContext);
7760
- const article = useMemo(() => {
7761
- if (intent.label && intent.label.includes('{')) {
7762
- return JSON.parse(intent.label);
7763
- }
7764
- return {};
7765
- }, [intent, intent === null || intent === void 0 ? void 0 : intent.label]);
7766
- return (React__default.createElement(React__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.createElement(SubotInlineIntentFinalCol, null,
7767
- React__default.createElement(SubotInlineIntentRiskScreenerContainer, null,
7768
- React__default.createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "feature" },
7769
- React__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 })),
7770
- React__default.createElement("div", { className: "title-container" },
7771
- React__default.createElement("a", { href: article === null || article === void 0 ? void 0 : article.url },
7772
- React__default.createElement("h5", { className: "title" }, article === null || article === void 0 ? void 0 : article.title)),
7773
- React__default.createElement("a", { href: article === null || article === void 0 ? void 0 : article.url, className: "link" },
7774
- f({
7775
- id: 'riskScreener.start',
7776
- defaultMessage: 'Start',
7777
- }),
7778
- React__default.createElement(ChevronRightActive, { style: { marginLeft: 10 } }))))))));
7779
- };
7780
- //#endregion
7781
- /*************************** END - NodeIntentType: 'bot-risk-screener' *********/
7782
- /*******************************************************************************/
7783
- /*******************************************************************************/
7784
- /*************************** NodeIntentType: 'bot-related-article' *************/
7785
- //#region
7786
- const SubotInlineIntentBotRelatedArticle = ({ intent }) => {
7787
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
7788
- const article = useMemo(() => {
7789
- if (intent.label && intent.label.includes('{')) {
7790
- const _article = JSON.parse(intent.label);
7791
- if (_article.meta) {
7792
- const tmp = {};
7793
- _article.meta.map(({ key, value }) => {
7794
- if (key && value)
7795
- tmp[key] = value;
7796
- });
7797
- _article.meta = Object.assign({}, tmp);
7798
- }
7799
- return Object.assign({}, _article);
7800
- }
7801
- return {};
7802
- }, [intent, intent === null || intent === void 0 ? void 0 : intent.label]);
7803
- return (React__default.createElement(React__default.Fragment, null, !!(article === null || article === void 0 ? void 0 : article.title) &&
7804
- !!(article === null || article === void 0 ? void 0 : article.thumbnail) &&
7805
- !!(article === null || article === void 0 ? void 0 : article.url) &&
7806
- !!(article === null || article === void 0 ? void 0 : article.meta) &&
7807
- !!((_a = article === null || article === void 0 ? void 0 : article.meta) === null || _a === void 0 ? void 0 : _a.post_modified) &&
7808
- !!((_b = article === null || article === void 0 ? void 0 : article.meta) === null || _b === void 0 ? void 0 : _b.reviewed_display_name) &&
7809
- !!((_c = article === null || article === void 0 ? void 0 : article.meta) === null || _c === void 0 ? void 0 : _c.reviewed_url) &&
7810
- !!((_d = article === null || article === void 0 ? void 0 : article.meta) === null || _d === void 0 ? void 0 : _d.reviewed_avatar_thumbnail) &&
7811
- !!((_e = article === null || article === void 0 ? void 0 : article.meta) === null || _e === void 0 ? void 0 : _e.category_url) &&
7812
- !!((_f = article === null || article === void 0 ? void 0 : article.meta) === null || _f === void 0 ? void 0 : _f.category_name) && (React__default.createElement(SubotInlineIntentFinalCol, { width: "40%" },
7813
- React__default.createElement(ArticleCard, { title: article === null || article === void 0 ? void 0 : article.title, uploadTime: dayjs((_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.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.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" })))));
7814
- };
7815
- //#endregion
7816
- /*************************** END - NodeIntentType: 'bot-related-article' *******/
7817
- /*******************************************************************************/
7818
- /*******************************************************************************/
7819
- /*************************** NodeIntentType: 'thank-you-image' *****************/
7820
- //#region
7821
- const SubotInlineIntentThankYouImage = ({ intent, }) => {
7822
- if (!intent.url)
7823
- return React__default.createElement(React__default.Fragment, null);
7824
- return (React__default.createElement(SubotInlineIntentFinalCol, null,
7825
- React__default.createElement(SubotInlineIntentImageContainer, null,
7826
- React__default.createElement("img", { loading: "lazy", src: intent.url, alt: intent.label, className: `intent-img ${intent.label && 'has-label'}` }),
7827
- intent.label && (React__default.createElement("h4", { className: "intent-img-label" },
7828
- React__default.createElement(Markdown, null, intent.label))))));
7829
- };
7830
- //#endregion
7831
- /*************************** END - NodeIntentType: 'thank-you-image' ***********/
7832
- /*******************************************************************************/
7833
- /*******************************************************************************/
7834
- /*************************** NodeIntentType: 'thank-you-title' *****************/
7835
- //#region
7836
- const SubotInlineIntentThankYouTitle = ({ intent, }) => {
7837
- if (!intent.label)
7838
- return React__default.createElement(React__default.Fragment, null);
7839
- return (React__default.createElement(SubotInlineIntentFinalCol, null,
7840
- React__default.createElement(SubotInlineIntentTitle, null,
7841
- React__default.createElement(Markdown, null, intent.label))));
7842
- };
7843
- //#endregion
7844
- /*************************** END - NodeIntentType: 'thank-you-title' ***********/
7845
- /*******************************************************************************/
7846
- /*******************************************************************************/
7847
- /*************************** NodeIntentType: 'thank-you-body' ******************/
7848
- //#region
7849
- const SubotInlineIntentThankYouBody = ({ intent, }) => {
7850
- if (!intent.label)
7851
- return React__default.createElement(React__default.Fragment, null);
7852
- return (React__default.createElement(SubotInlineIntentFinalCol, null,
7853
- React__default.createElement("div", { className: "intents__item markdown" },
7854
- React__default.createElement(Markdown, null, intent.label))));
7855
- };
7856
- //#endregion
7857
- /*************************** END - NodeIntentType: 'thank-you-body' ************/
7858
- /*******************************************************************************/
7859
- const SubotInlineIntentBase = {
7860
- [NodeIntentType.BOT_TEXT]: SubotInlineIntentBotText,
7861
- [NodeIntentType.BOT_IMAGE]: SubotInlineIntentBotImage,
7862
- [NodeIntentType.BOT_BUTTON]: SubotInlineIntentBotButton,
7863
- [NodeIntentType.BOT_URL]: SubotInlineIntentUrl,
7864
- [NodeIntentType.BOT_RECALCULATE]: SubotInlineIntentBotRecalculate,
7865
- [NodeIntentType.BOT_MAIN_TITLE]: SubotInlineIntentBotMainTitle,
7866
- [NodeIntentType.BOT_MAIN_IMAGE]: SubotInlineIntentBotMainImage,
7867
- [NodeIntentType.BOT_MAIN_BODY]: SubotInlineIntentBotMainBody,
7868
- [NodeIntentType.BOT_MAIN_BUTTON]: SubotInlineIntentBotMainButton,
7869
- [NodeIntentType.BOT_SUB_TITLE]: SubotInlineIntentBotMainTitle,
7870
- [NodeIntentType.BOT_SUB_BODY]: SubotInlineIntentBotMainBody,
7871
- [NodeIntentType.BOT_LANDING_PAGE_URL]: SubotInlineIntentBotText,
7872
- [NodeIntentType.BOT_LANDING_PAGE_BUTTON]: SubotInlineIntentBotText,
7873
- [NodeIntentType.BOT_RISK_SCREEN]: SubotInlineIntentBotRiskScreener,
7874
- [NodeIntentType.BOT_RELATED_ARTICLE]: SubotInlineIntentBotRelatedArticle,
7875
- [NodeIntentType.THANK_YOU_IMAGE]: SubotInlineIntentThankYouImage,
7876
- [NodeIntentType.THANK_YOU_TITLE]: SubotInlineIntentThankYouTitle,
7877
- [NodeIntentType.THANK_YOU_BODY]: SubotInlineIntentThankYouBody,
7878
- /** intents fake for sso block */
7879
- [NodeIntentType.SSO_INTENT]: SubotInlineIntentSSO,
7880
- };
7881
-
7882
- /***************** type: TEXT, IMAGE ***************/
7883
- const SubotInlineNode = ({ node, indexNumber, }) => {
7884
- const { formatMessage: f, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
7885
- const { params, onChange, onSubmit, onPrev, onNext, nodes, activeId } = useContext(SubotInlineContext);
7886
- const [value, setValue] = useState((node === null || node === void 0 ? void 0 : node._message) || {});
7887
- const handleOnChangeNormal = (action) => __awaiter(void 0, void 0, void 0, function* () {
7888
- 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));
7889
- delete _message.form_submit_meta;
7890
- const res = yield subotInlineMessage(_message);
7891
- if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
7892
- const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = __rest(_a, ["node"]);
7893
- const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
7894
- delete _nextNode._message.form_submit_meta;
7895
- onSubmit && onSubmit(_nextNode, _message);
7896
- }
7897
- });
7898
- const handleOnChange = (action, formSubmitMeta) => __awaiter(void 0, void 0, void 0, function* () {
7899
- if (!action)
7900
- return;
7901
- const actionWithOther = (action === null || action === void 0 ? void 0 : action.type) === NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
7902
- (action === null || action === void 0 ? void 0 : action.type) === NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
7903
- 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 });
7904
- if (actionWithOther) {
7905
- setValue(newValue);
7906
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
7907
- return;
7908
- }
7909
- delete newValue.form_submit_meta;
7910
- setValue(newValue);
7911
- handleOnChangeNormal(action);
7912
- });
7913
- const handleOnNext = () => {
7914
- const newMessage = JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value)));
7915
- if ((value === null || value === void 0 ? void 0 : value.action_id) &&
7916
- (value === null || value === void 0 ? void 0 : value.action_value) === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD) {
7917
- onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
7918
- return;
7919
- }
7920
- if (!(value === null || value === void 0 ? void 0 : value.action_id) || !(value === null || value === void 0 ? void 0 : value.action_value)) {
7921
- pushNotifications({
7922
- title: '',
7923
- message: f({
7924
- id: 'multiSelectError.required',
7925
- defaultMessage: `There is no answer!`,
7926
- }),
7927
- type: 'warning', // "success" | "danger" | "info" | "warning"
7928
- });
7929
- }
7930
- else {
7931
- delete newMessage.form_submit_meta;
7932
- onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
7933
- }
7934
- };
7935
- return (React__default.createElement(SubotInlineContainer$1, null,
7936
- React__default.createElement(SubotInlineHeader$1, null),
7937
- React__default.createElement(SubotInlineWrapper$1, null,
7938
- React__default.createElement(SubotInlineIntentContainer, null,
7939
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
7940
- React__default.createElement(SubotInlineActionContainer, null,
7941
- React__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 }))),
7942
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
7943
- };
7944
-
7945
- const SubotInlineNodeFinal = ({ node, }) => {
7946
- var _a, _b;
7947
- const fixHeight = 350;
7948
- const { nodes } = useContext(SubotInlineContext);
7949
- const { formatMessage: f } = useContext(TogetherComponentGlobalContext);
7950
- const flag = useRef(null);
7951
- const wrapper = useRef(null);
7952
- const [height, setHeight] = useState(fixHeight);
7953
- const [showMore, setShowMore] = useState(true);
7954
- const [isMore, setIsMore] = useState(false);
7955
- const handleOnClick = useCallback(() => {
7956
- fastdom.measure(() => {
7957
- var _a;
7958
- if (wrapper.current) {
7959
- const wrapperHeight = (_a = wrapper.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
7960
- if (height && height < wrapperHeight) {
7961
- setHeight(wrapperHeight);
7962
- setIsMore(true);
7963
- }
7964
- else {
7965
- setHeight(fixHeight);
7966
- setIsMore(false);
7967
- }
7968
- flag.current &&
7969
- flag.current.scrollIntoView({
7970
- behavior: 'smooth',
7971
- block: 'start',
7972
- inline: 'start',
7973
- });
7974
- }
7975
- });
7976
- }, [height]);
7977
- useLayoutEffect(() => {
7978
- fastdom.measure(() => {
7979
- if (wrapper.current) {
7980
- setTimeout(() => {
7981
- var _a;
7982
- const wrapperHeight = (_a = wrapper.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height;
7983
- if (wrapperHeight && height > wrapperHeight) {
7984
- setShowMore(false);
7985
- setIsMore(false);
7986
- }
7987
- }, 400);
7988
- }
7989
- });
7990
- }, []);
7991
- const botItem = nodes[0];
7992
- const botType = (_a = botItem === null || botItem === void 0 ? void 0 : botItem.extra_settings) === null || _a === void 0 ? void 0 : _a.subot_type;
7993
- const suggestedServiceIntents = useMemo(() => {
7994
- var _a;
7995
- return (((_a = node === null || node === void 0 ? void 0 : node.intents) === null || _a === void 0 ? void 0 : _a.filter((i) => i.type === NodeIntentType.BOT_SUGGESTED_SERVICE)) || []);
7996
- }, []);
7997
- return (React__default.createElement(SubotInlineFinalContainer, null,
7998
- React__default.createElement("div", { ref: flag, className: "hhg-flag", style: {
7999
- position: 'absolute',
8000
- top: -100,
8001
- left: 0,
8002
- pointerEvents: 'none',
8003
- } }),
8004
- React__default.createElement(SubotInlineFinalWrapper, { maxHeight: height, isMore: isMore },
8005
- React__default.createElement("div", { ref: wrapper },
8006
- React__default.createElement(SubotInlineIntentFinal, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [] }),
8007
- suggestedServiceIntents.length > 0 && (React__default.createElement("div", null, suggestedServiceIntents.map((intent) => {
8008
- const NodeIntent = SubotInlineIntentBase$1[intent.type || ''];
8009
- return (NodeIntent && React__default.createElement(NodeIntent, { key: intent.id, intent: intent }));
8010
- }))))),
8011
- showMore && (React__default.createElement(SubotInlineFinalMoreContainer, null,
8012
- React__default.createElement(SubotInlineFinalButton, { size: "md", color: "secondary", onClick: handleOnClick }, !isMore ? (React__default.createElement(React__default.Fragment, null,
8013
- f({ id: 'subotInline.showMore', defaultMessage: 'Show more' }),
8014
- React__default.createElement(ArrowDown, { style: { marginLeft: 10 } }))) : (React__default.createElement(React__default.Fragment, null,
8015
- f({ id: 'subotInline.showLess', defaultMessage: 'Show less' }),
8016
- React__default.createElement(ArrowUp, { style: { marginLeft: 10 } })))))),
8017
- botType === SubotType.voucherAcuvue && (React__default.createElement(SubotInlineVoucherLeftUI, { clientId: (_b = botItem.extra_settings) === null || _b === void 0 ? void 0 : _b.client_id, voucherAnswers: extractVoucherAnswers(nodes, botItem) }))));
8018
- };
8019
-
8020
- const SubotInlineResultButton = styled.span `
8021
- display: inline-block;
8022
- margin-top: 20px;
8023
- color: ${theme.colors.primaryBase || '#2D87F3'};
8024
- cursor: pointer;
8025
- transition: 0.3 all ease;
8026
- &:hover {
8027
- color: ${theme.colors.primaryHover || '#2D87F3'};
8028
- }
8029
- ${MediaQueries.tdDown} {
8030
- margin-top: 16px;
8031
- }
8032
- ${MediaQueries.mbDown} {
8033
- margin-top: 12px;
8034
- }
8035
- `;
8036
- const SubotInlineWrapper = styled.div `
8037
- max-width: 430px;
8038
- margin-right: auto;
8039
- margin-left: auto;
8040
- `;
8041
- const SubotInlineContainer = styled.div `
8042
- padding: 44px 16px 32px;
8043
- background-color: ${theme.colors.neutral50 || '#F7F9FC'};
8044
- border-radius: ${theme.borderRadius};
8045
- position: relative;
8046
- text-align: center;
8047
- ${MediaQueries.tdDown} {
8048
- padding: 36px 16px 24px;
8049
- }
8050
- ${MediaQueries.mbDown} {
8051
- padding: 16px;
8052
- border-radius: 0px;
8053
- }
8054
- `;
8055
- const SubotInlineNodeFinalThankYou = ({ node, }) => {
8056
- var _a;
8057
- const { params, onNext } = useContext(SubotInlineContext);
8058
- const resultButton = useMemo(() => {
8059
- var _a;
8060
- const _resultButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === NodeActionType.RESULT_BUTTON);
8061
- if (_resultButton)
8062
- return _resultButton;
8063
- return null;
8064
- }, [node === null || node === void 0 ? void 0 : node.actions]);
8065
- const handleOnNext = useCallback(() => {
8066
- onNext &&
8067
- 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 }));
8068
- }, [resultButton]);
8069
- return (React__default.createElement(SubotInlineContainer, null,
8070
- React__default.createElement(SubotInlineWrapper, null, (_a = node === null || node === void 0 ? void 0 : node.intents) === null || _a === void 0 ? void 0 :
8071
- _a.map((intent) => {
8072
- const NodeIntent = SubotInlineIntentBase[intent === null || intent === void 0 ? void 0 : intent.type];
8073
- return NodeIntent && React__default.createElement(NodeIntent, { key: intent.id, intent: intent });
8074
- }),
8075
- resultButton && (React__default.createElement(SubotInlineResultButton, { onClick: handleOnNext }, resultButton === null || resultButton === void 0 ? void 0 : resultButton.label)))));
8076
- };
8077
-
8078
- const SubotInlineNodeForm = ({ node, indexNumber, }) => {
8079
- var _a;
8080
- const { data: { locale }, } = useContext(TogetherComponentGlobalContext);
8081
- const { params, onPrev, onSubmit, trackingCommonInline, nodes, activeId } = useContext(SubotInlineContext);
8082
- const handleSubmit = (data) => __awaiter(void 0, void 0, void 0, function* () {
8083
- 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)));
8084
- if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8085
- const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = __rest(_b, ["node"]);
8086
- const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8087
- onSubmit && onSubmit(_nextNode, Object.assign(Object.assign({}, node._message), data));
8088
- }
8089
- });
8090
- return (React__default.createElement(SubotInlineContainer$1, null,
8091
- React__default.createElement(SubotInlineHeader$1, null),
8092
- React__default.createElement(SubotInlineWrapper$1, null,
8093
- React__default.createElement(SubotInlineIntentContainer, null,
8094
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8095
- React__default.createElement(SubotInlineFormContainer, null,
8096
- React__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' }) }))),
8097
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
8098
- };
8099
-
8100
- const SubotInlineNodeImage = ({ node, indexNumber, }) => {
8101
- const { formatMessage: f, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
8102
- const { params, onSubmit, onPrev, onNext } = useContext(SubotInlineContext);
8103
- const [value, setValue] = useState((node === null || node === void 0 ? void 0 : node._message) || {});
8104
- const handleOnChange = (action) => __awaiter(void 0, void 0, void 0, function* () {
8105
- if (action) {
8106
- 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 }));
8107
- 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 });
8108
- const res = yield subotInlineMessage(_message);
8109
- if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8110
- const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = __rest(_a, ["node"]);
8111
- const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8112
- onSubmit && onSubmit(_nextNode, _message);
8113
- }
8114
- }
8115
- });
8116
- const handleOnNext = () => {
8117
- var _a;
8118
- if (!(node === null || node === void 0 ? void 0 : node._message) || !((_a = node._message) === null || _a === void 0 ? void 0 : _a.action_id)) {
8119
- pushNotifications({
8120
- title: '',
8121
- message: f({
8122
- id: 'multiSelectError.required',
8123
- defaultMessage: `There is no answer!`,
8124
- }),
8125
- type: 'warning', // "success" | "danger" | "info" | "warning"
8126
- });
8127
- }
8128
- else {
8129
- onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8130
- }
8131
- };
8132
- return (React__default.createElement(SubotInlineContainer$1, null,
8133
- React__default.createElement(SubotInlineHeader$1, null),
8134
- React__default.createElement(SubotInlineWrapper$1, null,
8135
- React__default.createElement(SubotInlineIntentContainer, null,
8136
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8137
- React__default.createElement(SubotInlineActionContainer, null,
8138
- React__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 }))),
8139
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
8140
- };
8141
-
8142
- const SubotInlineNodeMultiple = ({ node, indexNumber, }) => {
8143
- const { params, onChange, onPrev, onNext } = useContext(SubotInlineContext);
8144
- const { formatMessage: f, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
8145
- const [value, setValue] = useState((node === null || node === void 0 ? void 0 : node._message) || {});
8146
- const submitButton = useMemo(() => {
8147
- var _a;
8148
- const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == NodeActionType.ACTION_MULTIPLE_BUTTON);
8149
- if (_submitButton)
8150
- return _submitButton;
8151
- return null;
8152
- }, [node === null || node === void 0 ? void 0 : node.actions]);
8153
- const activeActions = useMemo(() => {
8154
- if (value === null || value === void 0 ? void 0 : value.selected_actions) {
8155
- return Object.keys(value === null || value === void 0 ? void 0 : value.selected_actions);
8156
- }
8157
- return [];
8158
- }, [value, value === null || value === void 0 ? void 0 : value.selected_actions]);
8159
- const validateSelectActions = (selected_actions, callBack) => {
8160
- const activeActions = Object.keys(selected_actions);
8161
- if (!activeActions.length) {
8162
- pushNotifications({
8163
- title: '',
8164
- message: f({
8165
- id: 'multiSelectError.required',
8166
- defaultMessage: `There is no answer!`,
8167
- }),
8168
- type: 'warning', // "success" | "danger" | "info" | "warning"
8169
- });
8170
- return;
8171
- }
8172
- else if ((node === null || node === void 0 ? void 0 : node.multi_select_option) === NodeMultipleOptions.RANGE &&
8173
- activeActions.length < (node === null || node === void 0 ? void 0 : node.from)) {
8174
- pushNotifications({
8175
- title: '',
8176
- message: f({
8177
- id: 'multiSelectError.range',
8178
- defaultMessage: 'You must choose from {from} to {to} answers (Ex: You must choose from 3 to 5 answers)',
8179
- }, {
8180
- from: node.from,
8181
- to: node.to,
8182
- }),
8183
- type: 'warning', // "success" | "danger" | "info" | "warning"
8184
- });
8185
- return;
8186
- }
8187
- else if ((node === null || node === void 0 ? void 0 : node.multi_select_option) === NodeMultipleOptions.EXACT_NUMBER &&
8188
- activeActions.length !== (node === null || node === void 0 ? void 0 : node.from)) {
8189
- pushNotifications({
8190
- message: f({
8191
- id: 'multiSelectError.exactNumber',
8192
- defaultMessage: 'You must choose {from} answers.',
8193
- }, {
8194
- from: node.from,
8195
- }),
8196
- type: 'warning', // "success" | "danger" | "info" | "warning"
8197
- });
8198
- return;
8199
- }
8200
- else {
8201
- callBack();
8202
- }
8203
- };
8204
- const handleOnClick = (action, formSubmitMeta) => __awaiter(void 0, void 0, void 0, function* () {
8205
- var _a, _b;
8206
- if (action) {
8207
- 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) })));
8208
- if ((action === null || action === void 0 ? void 0 : action.type) === NodeActionType.POLL_CHOICE_TEXT_BY_INPUT ||
8209
- (action === null || action === void 0 ? void 0 : action.type) === NodeActionType.USER_CHOICE_TEXT_BY_INPUT) {
8210
- const isExistedPoll = (_value === null || _value === void 0 ? void 0 : _value.selected_actions) && action.id in _value.selected_actions;
8211
- if (isExistedPoll) {
8212
- if (formSubmitMeta) {
8213
- _value.form_submit_meta = formSubmitMeta;
8214
- }
8215
- else {
8216
- delete _value.form_submit_meta;
8217
- (_a = _value.selected_actions) === null || _a === void 0 ? true : delete _a[action.id];
8218
- }
8219
- }
8220
- else {
8221
- if (action === null || action === void 0 ? void 0 : action.id) {
8222
- _value.selected_actions = Object.assign(Object.assign({}, _value.selected_actions), { [action.id]: action.key || '' });
8223
- }
8224
- }
8225
- setValue(_value);
8226
- onChange === null || onChange === void 0 ? void 0 : onChange(_value);
8227
- return;
8228
- }
8229
- if (!((_b = _value.selected_actions) === null || _b === void 0 ? void 0 : _b[action.id])) {
8230
- _value.selected_actions = Object.assign(Object.assign({}, _value.selected_actions), { [action.id]: action.key || '' });
8231
- onChange && onChange(_value);
8232
- setValue(_value);
8233
- return;
8234
- }
8235
- if (_value.selected_actions[action.id]) {
8236
- delete _value.selected_actions[action.id];
8237
- onChange && onChange(_value);
8238
- setValue(_value);
8239
- return;
8240
- }
8241
- }
8242
- });
8243
- const handleOnNext = useCallback(() => {
8244
- validateSelectActions((value === null || value === void 0 ? void 0 : value.selected_actions) || {}, () => {
8245
- onNext &&
8246
- onNext(Object.assign(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value), { node_id: node.id }));
8247
- });
8248
- }, [value, value === null || value === void 0 ? void 0 : value.selected_actions, onNext]);
8249
- return (React__default.createElement(SubotInlineContainer$1, null,
8250
- React__default.createElement(SubotInlineHeader$1, null),
8251
- React__default.createElement(SubotInlineWrapper$1, null,
8252
- React__default.createElement(SubotInlineIntentContainer, null,
8253
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8254
- React__default.createElement(SubotInlineActionContainer, null,
8255
- React__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 }))),
8256
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8257
- };
8258
-
8259
- const OTPInfoForm = ({ className, style, actions, countryCode, phoneNumber, areaCode,
8260
- // verified,
8261
- callBack, }) => {
8262
- const countRef = useRef();
8263
- const [isFinishedCountDown, setIsFinishedCountDown] = useState(false);
8264
- const [isLoading, setIsLoading] = useState(false);
8265
- const [isLoadingVerify, setIsLoadingVerify] = useState(false);
8266
- const [sentOTP, setSentOTP] = useState(false);
8267
- const { register, formState: { errors }, control, trigger, getValues, setValue, } = useForm();
8268
- const { formatMessage: f, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
8269
- // useEffect(() => {
8270
- // const actionPhone = actions.find(
8271
- // (action) => action.type === NodeActionType.USER_SUBMIT_PHONE,
8272
- // )
8273
- // actionPhone?.key && setValue(actionPhone.key, '+84343261825')
8274
- // setSentOTP(true)
8275
- // }, [])
8276
- // const placeholderPhone = useMemo(() => {
8277
- // return actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_PHONE)
8278
- // ?.label
8279
- // }, [actions])
8280
- // const placeholderOtp = useMemo(() => {
8281
- // return actions.find(
8282
- // ({ type }) => type === NodeActionType.USER_SUBMIT_NUMBER,
8283
- // )?.label
8284
- // }, [actions])
8285
- // const labelBtnSendOtp = 'Gửi mã OTP'
8286
- // const labelBtnVerifyOtp = useMemo(() => {
8287
- // return (
8288
- // actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_SEND)
8289
- // ?.label || 'Xác minh mã OTP'
8290
- // )
8291
- // }, [actions])
8292
- // const labelBtnResendOtp = useMemo(() => {
8293
- // return (
8294
- // actions.find(({ type }) => type === NodeActionType.USER_SUBMIT_RESEND)
8295
- // ?.label || 'Gửi lại mã OTP'
8296
- // )
8297
- // }, [actions])
8298
- const handleSendOTP = (event) => __awaiter(void 0, void 0, void 0, function* () {
8299
- var _a;
8300
- event.preventDefault();
8301
- const data = getValues();
8302
- const parsedPhone = parsePhoneNumber(data.phone || '');
8303
- if (!(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.nationalNumber) || !(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.countryCallingCode)) {
8304
- return;
8305
- }
8306
- setIsLoading(true);
8307
- try {
8308
- const result = yield callApi(getSubotApiPath(PATHS$1.POST_SEND_OTP), 'POST', {
8309
- data: {
8310
- phone_number: parsedPhone.nationalNumber,
8311
- area_code: `+${parsedPhone.countryCallingCode}`,
8312
- },
8313
- });
8314
- setIsLoading(false);
8315
- if ((result === null || result === void 0 ? void 0 : result._status) === 1) {
8316
- if (sentOTP) {
8317
- setIsFinishedCountDown(false);
8318
- countRef.current.reset();
8319
- }
8320
- setSentOTP(true);
8321
- setTimeout(() => {
8322
- const input = document.querySelector('.input-otp-code');
8323
- if (input) {
8324
- input.focus();
8325
- input.scrollIntoView({ block: 'center' });
8326
- }
8327
- }, 100);
8328
- return;
8329
- }
8330
- if ((result === null || result === void 0 ? void 0 : result._status) === 0 &&
8331
- ((_a = result === null || result === void 0 ? void 0 : result._messages) === null || _a === void 0 ? void 0 : _a[0]) === 'This phone number was verified') {
8332
- // const { _messages } = result
8333
- if (countRef.current) {
8334
- countRef.current.cancel();
8335
- }
8336
- pushNotifications({
8337
- title: '',
8338
- message: 'Số điện thoại này đã được xác minh.',
8339
- type: 'success',
8340
- });
8341
- const action = actions.find((action) => action.type === NodeActionType.USER_SUBMIT_SEND);
8342
- action && callBack(action, data.phone);
8343
- return;
8344
- }
8345
- throw new Error();
8346
- }
8347
- catch (error) {
8348
- setIsLoading(false);
8349
- if (countRef.current) {
8350
- countRef.current.cancel();
8351
- }
8352
- showMessageSomethingWrong();
8353
- }
8354
- });
8355
- const handleOnVerify = (event, action) => __awaiter(void 0, void 0, void 0, function* () {
8356
- event.preventDefault();
8357
- setIsLoadingVerify(true);
8358
- yield trigger();
8359
- if (isEmpty(errors)) {
8360
- const data = getValues();
8361
- const { number } = data;
8362
- const parsedPhone = parsePhoneNumber(data.phone || '');
8363
- if (!(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.nationalNumber) || !(parsedPhone === null || parsedPhone === void 0 ? void 0 : parsedPhone.countryCallingCode)) {
8364
- return;
8365
- }
8366
- try {
8367
- const result = yield callApi(getSubotApiPath(PATHS$1.POST_VERIFY_OTP), 'POST', {
8368
- data: {
8369
- phone_number: parsedPhone.nationalNumber,
8370
- area_code: `+${parsedPhone.countryCallingCode}`,
8371
- code: number,
8372
- },
8373
- });
8374
- setIsLoadingVerify(false);
8375
- if ((result === null || result === void 0 ? void 0 : result._status) === 1) {
8376
- pushNotifications({
8377
- title: '',
8378
- message: f({ id: 'subot.verifyOTP.success.message' }),
8379
- type: 'success',
8380
- });
8381
- callBack(action, data.phone);
8382
- return;
8383
- }
8384
- throw new Error();
8385
- }
8386
- catch (error) {
8387
- pushNotifications({
8388
- title: '',
8389
- message: f({ id: 'validation.error.validOTP' }),
8390
- type: 'danger',
8391
- });
8392
- setIsLoadingVerify(false);
8393
- }
8394
- }
8395
- else {
8396
- setIsLoadingVerify(false);
8397
- }
8398
- });
8399
- const showMessageSomethingWrong = () => {
8400
- pushNotifications({
8401
- title: '',
8402
- message: f({ id: 'notification.comment.somethingWrong' }),
8403
- type: 'danger',
8404
- });
8405
- };
8406
- const renderFormInput = (action) => {
8407
- if (!action.key) {
8408
- return null;
8409
- }
8410
- switch (action.type) {
8411
- case NodeActionType.USER_SUBMIT_PHONE:
8412
- return (React__default.createElement("div", { className: "input-row", key: action.id },
8413
- React__default.createElement("label", { htmlFor: action.key }, action.label),
8414
- React__default.createElement(Controller, { name: action.key, control: control, rules: {
8415
- required: true,
8416
- validate: (value) => isPossiblePhoneNumber(value),
8417
- }, render: ({ field: { onChange, value } }) => {
8418
- const disabledPhone = (!isFinishedCountDown && sentOTP) || isLoading;
8419
- return (React__default.createElement(StyleWrapperPhoneInput, null,
8420
- React__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 }),
8421
- disabledPhone && (React__default.createElement(IconEdit, { viewBox: "0 0 24 24", className: "icon-edit-phone", onClick: () => {
8422
- var _a;
8423
- onChange('');
8424
- setSentOTP(false);
8425
- setIsLoadingVerify(false);
8426
- (_a = countRef.current) === null || _a === void 0 ? void 0 : _a.cancel();
8427
- } })),
8428
- action.key && errors[action.key] && (React__default.createElement("p", { className: "error-message" }, f({
8429
- id: 'validation.error.validNumber',
8430
- defaultMessage: 'Please enter a valid number.',
8431
- }))),
8432
- React__default.createElement("div", { className: "submit-btn-row", key: action.id },
8433
- React__default.createElement(Button$1, { className: "submit-btn", size: "lg", onClick: handleSendOTP, isDisabled: (!isFinishedCountDown && sentOTP) || isLoading, isLoading: isLoading }, sentOTP ? (React__default.createElement(CountDown$1, { ref: countRef, isFinished: isFinishedCountDown, onFinish: setIsFinishedCountDown })) : (React__default.createElement("span", null, f({
8434
- id: 'subot.sendOTP.button',
8435
- defaultMessage: 'Send OTP',
8436
- })))))));
8437
- } })));
8438
- case NodeActionType.USER_SUBMIT_NUMBER:
8439
- if (!sentOTP) {
8440
- return '';
8441
- }
8442
- return (React__default.createElement("div", { className: "input-row", key: action.id },
8443
- React__default.createElement("label", { htmlFor: action.key }, action.label),
8444
- React__default.createElement("input", Object.assign({ type: "tel", id: action.id, placeholder: action.label }, register(action.key, {
8445
- required: true,
8446
- pattern: /^[0-9]{0,6}$/,
8447
- }), { className: "input-otp-code" })),
8448
- errors[action.key] && (React__default.createElement("p", { className: "error-message" }, f({
8449
- id: 'validation.error.validOTP',
8450
- defaultMessage: 'Invalid OTP provided',
8451
- })))));
8452
- default:
8453
- return '';
8454
- }
8455
- };
8456
- const renderFormSubmitAndTerms = (action) => {
8457
- switch (action.type) {
8458
- case NodeActionType.USER_SUBMIT_SEND:
8459
- if (!sentOTP)
8460
- return '';
8461
- return (React__default.createElement("div", { className: "submit-btn-row", key: action.id },
8462
- React__default.createElement(Button$1, { className: "submit-btn", size: "lg", isDisabled: isLoadingVerify, isLoading: isLoadingVerify, onClick: (event) => handleOnVerify(event, action) }, action.label)));
8463
- default:
8464
- return '';
8465
- }
8466
- };
8467
- useEffect(() => {
8468
- if (phoneNumber) {
8469
- const action = actions.find((action) => action.type === NodeActionType.USER_SUBMIT_PHONE);
8470
- if (action && action.key) {
8471
- setValue(action.key, `+${areaCode}${phoneNumber}`);
8472
- }
8473
- }
8474
- }, [phoneNumber, areaCode]);
8475
- return (React__default.createElement(StyledUserInfoFormContainer$1, { className: className, style: style },
8476
- React__default.createElement("form", { className: "user-info-form" },
8477
- actions.map((action) => renderFormInput(action)),
8478
- actions.map((action) => renderFormSubmitAndTerms(action)))));
8479
- };
8480
-
8481
- const useVerifyPhoneNumber = () => {
8482
- const userInfo = GlobalData === null || GlobalData === void 0 ? void 0 : GlobalData.userInfo;
8483
- const [verifiedPhone, setVerifiedPhone] = useState(false);
8484
- useEffect(() => {
8485
- if (userInfo === null || userInfo === void 0 ? void 0 : userInfo.phone) {
8486
- if (userInfo.phone_verified_at && userInfo.verify_phone_code) {
8487
- setVerifiedPhone(true);
8488
- }
8489
- }
8490
- }, [userInfo]);
8491
- return verifiedPhone;
8492
- };
8493
-
8494
- const SubotInlineNodeOTP = ({ node, indexNumber, }) => {
8495
- const { params, onPrev, onNext } = useContext(SubotInlineContext);
8496
- const userInfo = GlobalData === null || GlobalData === void 0 ? void 0 : GlobalData.userInfo;
8497
- const locale = GlobalData === null || GlobalData === void 0 ? void 0 : GlobalData.locale;
8498
- const [value, setValue] = useState((node === null || node === void 0 ? void 0 : node._message) || {});
8499
- const verifiedPhone = useVerifyPhoneNumber();
8500
- const handleOnVerify = (action, phoneNumber) => {
8501
- var _a;
8502
- const actionPhone = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === NodeActionType.USER_SUBMIT_PHONE);
8503
- if (!action || !actionPhone) {
8504
- return;
8505
- }
8506
- const form_submit_meta = [
8507
- {
8508
- key: String(actionPhone.key),
8509
- control: ELEMENT_CONTROL_INPUT_TYPE[NodeActionType.USER_SUBMIT_PHONE],
8510
- value: phoneNumber,
8511
- },
8512
- ];
8513
- 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 });
8514
- setValue(newValue);
8515
- onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), newValue), node === null || node === void 0 ? void 0 : node._message));
8516
- };
8517
- return (React__default.createElement(SubotInlineContainer$1, null,
8518
- React__default.createElement(SubotInlineHeader$1, null),
8519
- React__default.createElement(SubotInlineWrapper$1, null,
8520
- React__default.createElement(SubotInlineIntentContainer, null,
8521
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8522
- React__default.createElement(SubotInlineActionContainer, null,
8523
- React__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' }))),
8524
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
8525
- };
8526
-
8527
- // Poll Message
8528
- // {
8529
- // form_meta: [
8530
- // { key: "poll4", control: "formmeta", value: "", action_id: "action.id" },
8531
- // { key: "poll2", control: "formmeta", value: "", action_id: "action.id" },
8532
- // { key: "poll3", control: "formmeta", value: "", action_id: "action.id" },
8533
- // { key: 'attribite-description', control:"formmeta-description", value: '', action_id: "action.id"}
8534
- // ],
8535
- // action_id: "button_id",
8536
- // action_value: "button_attribute"
8537
- // }
8538
- const SubotInlineNodePoll = ({ node, indexNumber, }) => {
8539
- var _a, _b;
8540
- const { params, onChange, onPrev, onNext } = useContext(SubotInlineContext);
8541
- const [value, setValue] = useState((node === null || node === void 0 ? void 0 : node._message) || {});
8542
- const validation = useValidationMultiOption();
8543
- const descriptionNode = useDescriptionPollNode({ node });
8544
- const submitButton = useMemo(() => {
8545
- var _a;
8546
- const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == NodeActionType.POLL_BUTTON);
8547
- if (_submitButton)
8548
- return _submitButton;
8549
- return null;
8550
- }, [node === null || node === void 0 ? void 0 : node.actions]);
8551
- const handleOnChange = (action, formSubmitMeta) => {
8552
- var _a, _b, _c, _d, _e, _f, _g;
8553
- 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) || [])] })));
8554
- if ((action === null || action === void 0 ? void 0 : action.type) === NodeActionType.POLL_CHOICE_TEXT_BY_INPUT ||
8555
- (action === null || action === void 0 ? void 0 : action.type) === NodeActionType.USER_CHOICE_TEXT_BY_INPUT) {
8556
- const isExistedPoll = (_a = newValue.form_submit_meta) === null || _a === void 0 ? void 0 : _a.some(({ action_id }) => action_id === action.id);
8557
- if (isExistedPoll) {
8558
- newValue.form_submit_meta =
8559
- typeof formSubmitMeta === 'undefined'
8560
- ? (_b = newValue.form_submit_meta) === null || _b === void 0 ? void 0 : _b.filter(({ action_id }) => action_id !== action.id)
8561
- : (_c = newValue.form_submit_meta) === null || _c === void 0 ? void 0 : _c.filter(({ action_id }) => action_id !== action.id).concat(formSubmitMeta);
8562
- }
8563
- else {
8564
- newValue.form_submit_meta = (_d = newValue.form_submit_meta) === null || _d === void 0 ? void 0 : _d.concat([
8565
- {
8566
- key: action === null || action === void 0 ? void 0 : action.key,
8567
- control: ELEMENT_CONTROL_INPUT_TYPE[action === null || action === void 0 ? void 0 : action.type] || 'text',
8568
- value: '',
8569
- action_id: action === null || action === void 0 ? void 0 : action.id,
8570
- },
8571
- ]);
8572
- }
8573
- setValue(newValue);
8574
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8575
- return;
8576
- }
8577
- 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));
8578
- if (isPoll) {
8579
- 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));
8580
- }
8581
- else {
8582
- newValue.form_submit_meta = (_g = newValue.form_submit_meta) === null || _g === void 0 ? void 0 : _g.concat([action]);
8583
- }
8584
- setValue(newValue);
8585
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8586
- };
8587
- const activeActions = useMemo(() => {
8588
- if (value === null || value === void 0 ? void 0 : value.form_submit_meta) {
8589
- return value === null || value === void 0 ? void 0 : value.form_submit_meta.map(({ action_id }) => action_id);
8590
- }
8591
- return [];
8592
- }, [value, value === null || value === void 0 ? void 0 : value.form_submit_meta]);
8593
- const handleOnNext = () => {
8594
- const tmp = {};
8595
- if (value.form_submit_meta && value.form_submit_meta.length) {
8596
- tmp[node.id] = value.form_submit_meta.map((_v) => _v.action_id);
8597
- }
8598
- const newValue = Object.assign(Object.assign({}, value), { current_polls: tmp });
8599
- validation.validateSelectActions(activeActions, node, () => {
8600
- onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), newValue));
8601
- });
8602
- };
8603
- return (React__default.createElement(SubotInlineContainer$1, null,
8604
- React__default.createElement(SubotInlineHeader$1, null),
8605
- React__default.createElement(SubotInlineWrapper$1, null,
8606
- React__default.createElement(SubotInlineIntentContainer, null,
8607
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8608
- React__default.createElement(SubotInlineDescription$1, null, descriptionNode),
8609
- React__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.createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== NodeActionType.POLL_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
8610
- const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8611
- return (NodeAction && (React__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 })));
8612
- }))))),
8613
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8614
- };
8615
-
8616
- // Rating Message
8617
- // {
8618
- // form_meta: [
8619
- // { key: "action.key", control: "star", value: "", action_id: 'action.id' },
8620
- // { key: 'action.key', control: "text", value: '', action_id: 'action.id' }
8621
- // ],
8622
- // action_id: "button_id",
8623
- // action_value: "button_attribute"
8624
- // }
8625
- const SubotInlineNodeRating = ({ node, indexNumber, }) => {
8626
- var _a, _b;
8627
- const { formatMessage: f, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
8628
- const { params, onChange, onSubmit, onPrev, onNext } = useContext(SubotInlineContext);
8629
- const [value, setValue] = useState((node === null || node === void 0 ? void 0 : node._message) || {});
8630
- const [isSubmit, setIsSubmit] = useState(false);
8631
- const ratingStarValue = useMemo(() => {
8632
- var _a;
8633
- const _ratingStar = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type === NodeActionType.RATING_STAR);
8634
- if (value.form_submit_meta && _ratingStar) {
8635
- 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));
8636
- if (formIndex !== -1)
8637
- return parseInt(value === null || value === void 0 ? void 0 : value.form_submit_meta[formIndex].value);
8638
- }
8639
- return 0;
8640
- }, [value === null || value === void 0 ? void 0 : value.form_submit_meta]);
8641
- const submitButton = useMemo(() => {
8642
- var _a;
8643
- const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == NodeActionType.RATING_BUTTON);
8644
- if (_submitButton)
8645
- return _submitButton;
8646
- return null;
8647
- }, []);
8648
- const handleOnChange = (formValue) => __awaiter(void 0, void 0, void 0, function* () {
8649
- if (formValue) {
8650
- 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)
8651
- ? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
8652
- : [] });
8653
- const tmpFormSubmitMeta = [
8654
- ..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
8655
- ];
8656
- const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
8657
- if (formUpdateIndex !== -1)
8658
- tmpFormSubmitMeta[formUpdateIndex] = Object.assign({}, formValue);
8659
- else
8660
- tmpFormSubmitMeta.push(formValue);
8661
- _message.form_submit_meta = [...tmpFormSubmitMeta];
8662
- setValue(_message);
8663
- onChange && onChange(_message);
8664
- }
8665
- });
8666
- const handleOnNext = () => __awaiter(void 0, void 0, void 0, function* () {
8667
- if (!value.form_submit_meta || ratingStarValue === 0) {
8668
- pushNotifications({
8669
- title: '',
8670
- message: f({
8671
- id: 'multiSelectError.required',
8672
- defaultMessage: `There is no answer!`,
8673
- }),
8674
- type: 'warning', // "success" | "danger" | "info" | "warning"
8675
- });
8676
- return;
8677
- }
8678
- if (!isSubmit) {
8679
- const _message = Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value);
8680
- const res = yield subotInlineMessage(_message);
8681
- if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8682
- const _c = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _c, restData = __rest(_c, ["node"]);
8683
- const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8684
- onSubmit && onSubmit(_nextNode, _message);
8685
- setIsSubmit(true);
8686
- }
8687
- }
8688
- else {
8689
- onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8690
- }
8691
- });
8692
- return (React__default.createElement(SubotInlineContainer$1, null,
8693
- React__default.createElement(SubotInlineHeader$1, null),
8694
- React__default.createElement(SubotInlineWrapper$1, null,
8695
- React__default.createElement(SubotInlineIntentContainer, null,
8696
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8697
- React__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.createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== NodeActionType.RATING_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
8698
- var _a;
8699
- const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8700
- return (NodeAction && (React__default.createElement(NodeAction, { key: action.id, action: action, onChange: handleOnChange, value: (value &&
8701
- (value === null || value === void 0 ? void 0 : value.form_submit_meta) &&
8702
- ((_a = value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) })));
8703
- }))))),
8704
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8705
- };
8706
-
8707
- const SubotInlineNodeReaction = ({ node, indexNumber, }) => {
8708
- const { formatMessage: f, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
8709
- const { params, onSubmit, onPrev, onNext } = useContext(SubotInlineContext);
8710
- const [value, setValue] = useState((node === null || node === void 0 ? void 0 : node._message) || {});
8711
- const handleOnChange = (action) => __awaiter(void 0, void 0, void 0, function* () {
8712
- if (action) {
8713
- 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 }));
8714
- 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 });
8715
- const res = yield subotInlineMessage(_message);
8716
- if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8717
- const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = __rest(_a, ["node"]);
8718
- const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8719
- onSubmit && onSubmit(_nextNode, _message);
8720
- }
8721
- }
8722
- });
8723
- const handleOnNext = () => {
8724
- var _a;
8725
- if (!(node === null || node === void 0 ? void 0 : node._message) || !((_a = node._message) === null || _a === void 0 ? void 0 : _a.action_id)) {
8726
- pushNotifications({
8727
- title: '',
8728
- message: f({
8729
- id: 'multiSelectError.required',
8730
- defaultMessage: `There is no answer!`,
8731
- }),
8732
- type: 'warning', // "success" | "danger" | "info" | "warning"
8733
- });
8734
- }
8735
- else {
8736
- onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8737
- }
8738
- };
8739
- return (React__default.createElement(SubotInlineContainer$1, null,
8740
- React__default.createElement(SubotInlineHeader$1, null),
8741
- React__default.createElement(SubotInlineWrapper$1, null,
8742
- React__default.createElement(SubotInlineIntentContainer, null,
8743
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8744
- React__default.createElement(SubotInlineActionContainer, null,
8745
- React__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 }))),
8746
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
8747
- };
8748
-
8749
- const SubotInlineNodeResultPoll = ({ node, }) => {
8750
- var _a, _b;
8751
- return (React__default.createElement(SubotInlineContainer$1, null,
8752
- React__default.createElement(SubotInlineHeader$1, null),
8753
- React__default.createElement(SubotInlineWrapper$1, null,
8754
- React__default.createElement(SubotInlineIntentContainer, null,
8755
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [] })),
8756
- React__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.createElement(SubotInlineActionListContainer, null, (_b = node === null || node === void 0 ? void 0 : node.actions.filter(({ type }) => type !== NodeActionType.POLL_BUTTON)) === null || _b === void 0 ? void 0 : _b.map((action) => {
8757
- const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8758
- return (NodeAction && (React__default.createElement(NodeAction, { key: action.id, action: action, htmlType: "checkbox", node_type: node === null || node === void 0 ? void 0 : node.type })));
8759
- })))))));
8760
- };
8761
-
8762
- // Review Message
8763
- // {
8764
- // form_meta: [
8765
- // { key: "review1", control: "formmeta", value: '', action_id: "action.id" },
8766
- // { key: "review2", control: "formmeta", value: '', action_id: "action.id" },
8767
- // { key: "review3", control: "formmeta", value: "" },
8768
- // { key: "review4", control: "formmeta", value: "" },
8769
- // { key: "review5", control: "formmeta", value: "" },
8770
- // {key: 'attribite-description', control:"formmeta-description", value: ''}
8771
- // ],
8772
- // action_id: "button_id",
8773
- // action_value: "button_attribute"
8774
- // }
8775
- const SubotInlineNodeReview = ({ node, indexNumber, }) => {
8776
- const { formatMessage: f, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
8777
- const { params, onChange, onSubmit, onPrev, onNext } = useContext(SubotInlineContext);
8778
- const [value, setValue] = useState((node === null || node === void 0 ? void 0 : node._message) || {});
8779
- const [isSubmit, setIsSubmit] = useState(false);
8780
- const reviewChoices = useMemo(() => {
8781
- var _a;
8782
- return ((_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.filter(({ type }) => type === NodeActionType.REVIEW_CHOICE)) || [];
8783
- }, [node === null || node === void 0 ? void 0 : node.actions]);
8784
- const reviewDescriptions = useMemo(() => {
8785
- var _a;
8786
- return ((_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.filter(({ type }) => type === NodeActionType.REVIEW_DESCRIPTION)) || [];
8787
- }, [node === null || node === void 0 ? void 0 : node.actions]);
8788
- const submitButton = useMemo(() => {
8789
- var _a;
8790
- const _submitButton = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find(({ type }) => type == NodeActionType.REVIEW_BUTTON);
8791
- if (_submitButton)
8792
- return _submitButton;
8793
- return null;
8794
- }, [node === null || node === void 0 ? void 0 : node.actions]);
8795
- const activeActions = useMemo(() => {
8796
- if (value === null || value === void 0 ? void 0 : value.form_submit_meta) {
8797
- 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)));
8798
- }
8799
- return [];
8800
- }, [value, value === null || value === void 0 ? void 0 : value.form_submit_meta]);
8801
- const handleOnClick = (formValue) => {
8802
- if (formValue) {
8803
- 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)
8804
- ? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
8805
- : [] });
8806
- let tmpFormSubmitMeta = [
8807
- ..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
8808
- ];
8809
- const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
8810
- if (formUpdateIndex !== -1)
8811
- tmpFormSubmitMeta = [
8812
- ...tmpFormSubmitMeta.slice(0, formUpdateIndex),
8813
- ...tmpFormSubmitMeta.slice(formUpdateIndex + 1),
8814
- ];
8815
- else
8816
- tmpFormSubmitMeta.push(formValue);
8817
- _message.form_submit_meta = [...tmpFormSubmitMeta];
8818
- setValue(_message);
8819
- setIsSubmit(false);
8820
- onChange && onChange(_message);
8821
- }
8822
- };
8823
- const handleOnChange = (formValue) => {
8824
- if (formValue) {
8825
- 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)
8826
- ? [...value === null || value === void 0 ? void 0 : value.form_submit_meta]
8827
- : [] });
8828
- const tmpFormSubmitMeta = [
8829
- ..._message === null || _message === void 0 ? void 0 : _message.form_submit_meta,
8830
- ];
8831
- const formUpdateIndex = tmpFormSubmitMeta.findIndex(({ action_id }) => action_id === formValue.action_id);
8832
- if (formUpdateIndex !== -1)
8833
- tmpFormSubmitMeta[formUpdateIndex] = Object.assign({}, formValue);
8834
- else
8835
- tmpFormSubmitMeta.push(formValue);
8836
- _message.form_submit_meta = [...tmpFormSubmitMeta];
8837
- setValue(_message);
8838
- setIsSubmit(false);
8839
- onChange && onChange(_message);
8840
- }
8841
- };
8842
- const handleOnNext = () => __awaiter(void 0, void 0, void 0, function* () {
8843
- var _a;
8844
- if (!((_a = node === null || node === void 0 ? void 0 : node._message) === null || _a === void 0 ? void 0 : _a.form_submit_meta) || !activeActions.length) {
8845
- pushNotifications({
8846
- title: '',
8847
- message: f({
8848
- id: 'multiSelectError.required',
8849
- defaultMessage: `There is no answer!`,
8850
- }),
8851
- type: 'warning', // "success" | "danger" | "info" | "warning"
8852
- });
8853
- return;
8854
- }
8855
- if (!isSubmit) {
8856
- const _message = Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value);
8857
- const res = yield subotInlineMessage(_message);
8858
- if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8859
- const _b = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _b, restData = __rest(_b, ["node"]);
8860
- const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8861
- onSubmit && onSubmit(_nextNode, _message);
8862
- setIsSubmit(true);
8863
- }
8864
- }
8865
- else {
8866
- onNext && onNext(Object.assign(Object.assign(Object.assign({}, params), value), node === null || node === void 0 ? void 0 : node._message));
8867
- }
8868
- });
8869
- return (React__default.createElement(SubotInlineContainer$1, null,
8870
- React__default.createElement(SubotInlineHeader$1, null),
8871
- React__default.createElement(SubotInlineWrapper$1, null,
8872
- React__default.createElement(SubotInlineIntentContainer, null,
8873
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
8874
- React__default.createElement(SubotInlineActionContainer, null,
8875
- !!reviewChoices.length && (React__default.createElement(SubotInlineReviewContainer, null,
8876
- React__default.createElement(SubotInlineActionListContainer, { className: "review-container" }, reviewChoices.map((action) => {
8877
- var _a;
8878
- const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8879
- return (NodeAction && (React__default.createElement(NodeAction, { key: action.id, action: action, onChange: handleOnClick, active: (value &&
8880
- !!((_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))) ||
8881
- false })));
8882
- })))),
8883
- !!(reviewDescriptions === null || reviewDescriptions === void 0 ? void 0 : reviewDescriptions.length) && (React__default.createElement(SubotInlineActionListContainer, null, reviewDescriptions.map((action) => {
8884
- var _a;
8885
- const NodeAction = SubotInlineActionBase[action === null || action === void 0 ? void 0 : action.type];
8886
- return (NodeAction && (React__default.createElement(NodeAction, { key: action.id, action: action, onChange: handleOnChange, value: (value &&
8887
- (value === null || value === void 0 ? void 0 : value.form_submit_meta) &&
8888
- ((_a = value.form_submit_meta) === null || _a === void 0 ? void 0 : _a.find(({ action_id }) => action_id === action.id))) })));
8889
- }))))),
8890
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, nextText: submitButton ? submitButton === null || submitButton === void 0 ? void 0 : submitButton.label : '', onNext: handleOnNext })));
8891
- };
8892
-
8893
- const SubotInlineNodeSSO = ({ node, indexNumber, }) => {
8894
- const refIsTrigger = useRef(false);
8895
- const { params, onPrev, nodes, activeId, userInfo } = useContext(SubotInlineContext);
8896
- useEffect(() => {
8897
- var _a;
8898
- const actionSSO = (_a = node === null || node === void 0 ? void 0 : node.actions) === null || _a === void 0 ? void 0 : _a.find((act) => act.type === NodeActionType.ACTION_SSO_REDIRECT);
8899
- if ((userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) && actionSSO && !refIsTrigger.current) {
8900
- refIsTrigger.current = true;
8901
- handleOnChange(actionSSO);
8902
- }
8903
- }, [userInfo === null || userInfo === void 0 ? void 0 : userInfo.id]);
8904
- const { formatMessage: f } = useContext(TogetherComponentGlobalContext);
8905
- const handleOnChange = (action) => {
8906
- if (action && action.type === NodeActionType.ACTION_SSO_REDIRECT) {
8907
- const currentState = {
8908
- 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' }),
8909
- listNodes: nodes,
8910
- activeId,
8911
- createdAt: new Date().getTime(),
8912
- botId: params.bot_id,
8913
- };
8914
- localStorage.setItem(STATE_SUBOT_INLINE_KEY, JSON.stringify(currentState));
8915
- const urlObj = getURLwithSSOTracking(window.location.href, {
8916
- botItem: nodes[0],
8917
- });
8918
- urlObj.searchParams.set('bot_id', String(params.bot_id));
8919
- urlObj.searchParams.set('mode', 'inline');
8920
- urlObj.searchParams.set('source', 'subot-inline');
8921
- const returnUrl = urlObj.href;
8922
- if (IS_SSOV2_ENABLED()) {
8923
- useSSOV2Store.getState().triggerLogin({
8924
- returnUrl,
8925
- source: `subot-inline`,
8926
- });
8927
- }
8928
- else {
8929
- window.location.href = `${SSO_URL}?returnUrl=${encodeURIComponent(returnUrl)}`;
8930
- }
8931
- }
8932
- };
8933
- return (React__default.createElement(SubotInlineContainer$1, null,
8934
- React__default.createElement(SubotInlineHeader$1, null),
8935
- React__default.createElement(SubotInlineWrapper$1, null,
8936
- React__default.createElement(SubotInlineIntentContainer, null,
8937
- React__default.createElement(SubotInlineIntent, { intents: [
8938
- ...((node === null || node === void 0 ? void 0 : node.intents) || []),
8939
- ...ssoIntents(f),
8940
- ], indexNumber: indexNumber })),
8941
- React__default.createElement(SubotInlineActionContainer, null,
8942
- React__default.createElement(SubotInlineAction, { actions: node === null || node === void 0 ? void 0 : node.actions, onChange: handleOnChange }))),
8943
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, hideNext: true })));
8944
- };
8945
-
8946
- const SubotInlineNodeText = ({ node, indexNumber, }) => {
8947
- const { formatMessage: f, action: { pushNotifications }, } = useContext(TogetherComponentGlobalContext);
8948
- const { nodes, activeId, params, onSubmit, onPrev, onNext, onChange } = useContext(SubotInlineContext);
8949
- const [value, setValue] = useState((node === null || node === void 0 ? void 0 : node._message) || {});
8950
- const handleOnChangeNormal = (action) => __awaiter(void 0, void 0, void 0, function* () {
8951
- 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));
8952
- delete _message.form_submit_meta;
8953
- const res = yield subotInlineMessage(_message);
8954
- if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
8955
- const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = __rest(_a, ["node"]);
8956
- const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
8957
- onSubmit && onSubmit(_nextNode, _message);
8958
- }
8959
- });
8960
- const handleOnChange = (action, formSubmitMeta) => __awaiter(void 0, void 0, void 0, function* () {
8961
- if (!action)
8962
- return;
8963
- const actionWithOther = (action === null || action === void 0 ? void 0 : action.type) === NodeActionType.USER_CHOICE_TEXT_BY_INPUT ||
8964
- (action === null || action === void 0 ? void 0 : action.type) === NodeActionType.POLL_CHOICE_TEXT_BY_INPUT;
8965
- 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 });
8966
- if (actionWithOther) {
8967
- setValue(newValue);
8968
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
8969
- return;
8970
- }
8971
- delete newValue.form_submit_meta;
8972
- setValue(newValue);
8973
- handleOnChangeNormal(action);
8974
- });
8975
- const handleOnNext = () => {
8976
- const newMessage = JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign({}, params), node === null || node === void 0 ? void 0 : node._message), value)));
8977
- if ((value === null || value === void 0 ? void 0 : value.action_id) &&
8978
- (value === null || value === void 0 ? void 0 : value.action_value) === KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD) {
8979
- onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
8980
- return;
8981
- }
8982
- if (!(value === null || value === void 0 ? void 0 : value.action_id) || !(value === null || value === void 0 ? void 0 : value.action_value)) {
8983
- pushNotifications({
8984
- title: '',
8985
- message: f({
8986
- id: 'multiSelectError.required',
8987
- defaultMessage: `There is no answer!`,
8988
- }),
8989
- type: 'warning', // "success" | "danger" | "info" | "warning"
8990
- });
8991
- }
8992
- else {
8993
- delete newMessage.form_submit_meta;
8994
- onNext === null || onNext === void 0 ? void 0 : onNext(newMessage);
8995
- }
8996
- };
8997
- return (React__default.createElement(SubotInlineContainer$1, null,
8998
- React__default.createElement(SubotInlineHeader$1, null),
8999
- React__default.createElement(SubotInlineWrapper$1, null,
9000
- React__default.createElement(SubotInlineIntentContainer, null,
9001
- React__default.createElement(SubotInlineIntent, { intents: (node === null || node === void 0 ? void 0 : node.intents) || [], indexNumber: indexNumber })),
9002
- React__default.createElement(SubotInlineActionContainer, null,
9003
- React__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 }))),
9004
- React__default.createElement(SubotInlineFooter$1, { onBack: () => onPrev && onPrev(), backProps: { isDisabled: !!(indexNumber === 1) }, onNext: handleOnNext })));
9005
- };
9006
-
9007
- const SubotInlineNodeBase = {
9008
- TEXT: SubotInlineNodeText,
9009
- IMAGE: SubotInlineNodeImage,
9010
- FORM: SubotInlineNodeForm,
9011
- CONDITION: SubotInlineNode,
9012
- FINAL_STANDARD: SubotInlineNodeFinal,
9013
- FINAL: SubotInlineNodeFinal,
9014
- FINAL_THANK_YOU: SubotInlineNodeFinalThankYou,
9015
- SSO: SubotInlineNodeSSO,
9016
- MULTIPLE: SubotInlineNodeMultiple,
9017
- POLL: SubotInlineNodePoll,
9018
- RATING: SubotInlineNodeRating,
9019
- REACTION: SubotInlineNodeReaction,
9020
- REVIEW: SubotInlineNodeReview,
9021
- RESULT_POLL: SubotInlineNodeResultPoll,
9022
- OTP: SubotInlineNodeOTP,
9023
- // RESULT_RATING = 12,
9024
- // RESULT_REACTION = 13,
9025
- };
9026
-
9027
- const SubotInlineButton = styled(Button$1) `
9028
- margin-top: 24px;
9029
- ${MediaQueries.mbUp} {
9030
- margin-top: 16px;
9031
- }
9032
- `;
9033
- const SubotInlineDescription = styled.div `
9034
- margin-top: 24px;
9035
- `;
9036
- const SubotInlineReview = styled(Text$1) `
9037
- text-align: center;
9038
- ${MediaQueries.mbUp} {
9039
- text-align: left;
9040
- }
9041
- `;
9042
- const SubotInlineTitle = styled(Heading) `
9043
- text-align: center;
9044
- margin-bottom: 8px;
9045
-
9046
- ${MediaQueries.mbUp} {
9047
- margin-bottom: 0;
9048
- text-align: left;
9049
- }
9050
- `;
9051
- const SubotInlineImage = styled.div `
9052
- background-color: #ffffff;
9053
- border-radius: 50%;
9054
- width: 120px;
9055
- height: 120px;
9056
- object-fit: contain;
9057
- overflow: hidden;
9058
- flex-shrink: 0;
9059
-
9060
- img {
9061
- width: 100%;
9062
- height: 100%;
9063
- object-fit: cover;
9064
- }
9065
- `;
9066
- const SubotInlineContent = styled.div `
9067
- flex-grow: 1;
9068
- ${MediaQueries.tdDown} {
9069
- width: 100%;
9070
- margin-left: 0;
9071
- }
9072
- `;
9073
- const SubotInlineStartWrapper = styled.div `
9074
- position: relative;
9075
- display: flex;
9076
- gap: 24px;
9077
- ${MediaQueries.mbDown} {
9078
- flex-wrap: wrap;
9079
- justify-content: center;
9080
- }
9081
- `;
9082
- const SubotInlineStartContainer = styled.div `
9083
- position: relative;
9084
- overflow: hidden;
9085
- background-color: ${theme.colors.primary50};
9086
- padding: 32px;
9087
- border-radius: ${theme.borderRadius};
9088
- background-image: url('/images/subot-bg-transparent.png');
9089
- background-size: contain;
9090
- background-repeat: repeat-y;
9091
- ${MediaQueries.mbDown} {
9092
- padding: 24px;
9093
- }
9094
- `;
9095
- const SubotInlineNodeStart = ({ node, setLoading, }) => {
9096
- const startRef = useRef({
9097
- impress: false,
9098
- });
9099
- const userInfo = GlobalData === null || GlobalData === void 0 ? void 0 : GlobalData.userInfo;
9100
- const { params, onNext, trackingCommonInline, isMobile } = useContext(SubotInlineContext);
9101
- const handleOnClick = (isCountClick = true) => () => {
9102
- if (isCountClick) {
9103
- const queryParams = {
9104
- cookie_id: params.cookie_id,
9105
- window_id: params.window_id,
9106
- bot_id: params.bot_id,
9107
- title_url: params.title_url,
9108
- url: params.url,
9109
- gtm_id: params.gtm_id,
9110
- ga_client_id: params.ga_client_id,
9111
- device_id: checkMobile(window.navigator.userAgent) ? 2 : 1,
9112
- account_id: params.account_id || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || null,
9113
- };
9114
- subotInlineClick(queryParams);
9115
- }
9116
- onNext && onNext();
9117
- };
9118
- useEffect(() => {
9119
- const inViewport = (element, callback, options = {}) => {
9120
- if (!!window.IntersectionObserver && !startRef.current.impress) {
9121
- const observer = new IntersectionObserver((entries, observer) => {
9122
- entries.forEach((entry) => callback(entry, observer));
9123
- }, options);
9124
- observer.observe(element);
9125
- }
9126
- };
9127
- const eventScrollImpress = () => {
9128
- if (startRef.current.element) {
9129
- inViewport(startRef.current.element, (element, observer) => {
9130
- /** Not in viewport */
9131
- if (!element.isIntersecting) {
9132
- if (startRef.current.impress) {
9133
- startRef.current.impress = false;
9134
- }
9135
- return;
9136
- }
9137
- if (!startRef.current.impress) {
9138
- startRef.current.impress = true;
9139
- if (startRef.current.debounce) {
9140
- clearTimeout(startRef.current.debounce);
9141
- }
9142
- if (!(node === null || node === void 0 ? void 0 : node.inline_start_button)) {
9143
- setLoading(true);
9144
- }
9145
- startRef.current.debounce = setTimeout(() => {
9146
- const queryParams = {
9147
- cookie_id: params.cookie_id,
9148
- window_id: params.window_id,
9149
- bot_id: params.bot_id,
9150
- title_url: params.title_url,
9151
- url: params.url,
9152
- gtm_id: params.gtm_id,
9153
- ga_client_id: params.ga_client_id,
9154
- device_id: checkMobile(window.navigator.userAgent) ? 2 : 1,
9155
- account_id: params.account_id || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.id) || null,
9156
- };
9157
- queryParams && subotInlineImpression(queryParams);
9158
- /** Auto skip the starting node in the case
9159
- * CTA Start value is not contributed on Subot Admin */
9160
- if (!(node === null || node === void 0 ? void 0 : node.inline_start_button)) {
9161
- handleOnClick(false)();
9162
- }
9163
- }, 400);
9164
- startRef.current.element &&
9165
- (observer === null || observer === void 0 ? void 0 : observer.unobserve(startRef.current.element));
9166
- }
9167
- }, {
9168
- rootMargin: '1000px',
9169
- });
9170
- }
9171
- };
9172
- eventScrollImpress();
9173
- window.addEventListener('scroll', eventScrollImpress, { passive: true });
9174
- return () => window.removeEventListener('scroll', eventScrollImpress);
9175
- }, [onNext]);
9176
- if (!node)
9177
- return null;
9178
- return (React__default.createElement(SubotInlineStartContainer, null,
9179
- React__default.createElement(SubotInlineStartWrapper, { ref: (ref) => (startRef.current.element = ref) },
9180
- node.inline_image && (React__default.createElement(SubotInlineImage, null,
9181
- React__default.createElement("img", { loading: "lazy", src: node.inline_image, alt: "" }))),
9182
- React__default.createElement(SubotInlineContent, null,
9183
- node.inline_title || node.inline_headline ? (React__default.createElement(SubotInlineTitle, { tag: "h3", fontWeight: "bold", color: theme.colors.secondaryBase },
9184
- React__default.createElement(Markdown, null, node.inline_title || node.inline_headline))) : null,
9185
- node.inline_review && (React__default.createElement(SubotInlineReview, { size: "s4", color: theme.colors.gray600,
9186
- // fix error html, div is not allowed as child of p
9187
- as: 'div' },
9188
- React__default.createElement(Markdown, null, node.inline_review))),
9189
- node.inline_start_button && (React__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)))),
9190
- React__default.createElement(SubotInlineDescription, null,
9191
- React__default.createElement(Markdown, null, node.inline_description))));
9192
- };
9193
-
9194
- const SubotInlineLoading = styled.div `
9195
- position: absolute;
9196
- z-index: 2;
9197
- top: 0;
9198
- right: 0;
9199
- bottom: 0;
9200
- left: 0;
9201
- display: flex;
9202
- flex-direction: column;
9203
- align-items: center;
9204
- justify-content: center;
9205
- color: ${theme.colors.gray800};
9206
- opacity: 0;
9207
- pointer-events: none;
9208
- &:before {
9209
- position: absolute;
9210
- z-index: -1;
9211
- top: 0;
9212
- right: 0;
9213
- bottom: 0;
9214
- left: 0;
9215
- background-color: ${theme.colors.neutral50 || '#F7F9FC'};
9216
- content: '';
9217
- opacity: 1;
9218
- }
9219
- ${({ isLoading }) => isLoading && ` opacity: 1; pointer-events: auto; `};
9220
- `;
9221
- const SubotInlineLoadingContainer = styled.div `
9222
- position: relative;
9223
- z-index: 1;
9224
- line-height: 1.5;
9225
- transition: 0.25s all linear;
9226
- margin-block: 16px;
9227
- content-visibility: auto;
9228
- contain-intrinsic-size: 500px;
9229
- &.hhg-subot-style {
9230
- min-height: 100px;
9231
- }
9232
- ${MediaQueries.mbDown} {
9233
- margin-right: -1rem;
9234
- margin-left: -1rem;
9235
- }
9236
- `;
9237
- const SubotInline = ({ id, isMobile, articleLink, customUrl, }) => {
9238
- const currentUrl = useCurrentUrl();
9239
- const refAccountIdFromLogs = useRef(null);
9240
- const flag = useRef(null);
9241
- const [loading, setLoading] = useState(true);
9242
- const [state, setState] = useState({
9243
- activeId: '',
9244
- params: {},
9245
- nodes: [],
9246
- getParams: () => ({}),
9247
- });
9248
- const userInfo = GlobalData === null || GlobalData === void 0 ? void 0 : GlobalData.userInfo;
9249
- const currentNode = useMemo(() => {
9250
- return state.nodes.find((n) => n.id == state.activeId);
9251
- }, [state.nodes, state.activeId]);
9252
- const trackingCommonInline = useMemo(() => ({
9253
- 'data-event-category': 'Subot',
9254
- 'data-event-label': currentUrl,
9255
- 'data-bot-id': state.params.bot_id,
9256
- 'data-bot-type': 'Inline',
9257
- 'data-question-id': typeof (currentNode === null || currentNode === void 0 ? void 0 : currentNode.id) === 'string' ? currentNode === null || currentNode === void 0 ? void 0 : currentNode.id : null,
9258
- }), [currentNode, currentUrl, state.params.bot_id]);
9259
- /** Get Params */
9260
- const getParams = useCallback(() => {
9261
- var _a, _b, _c, _d;
9262
- const gaData = window.gaData;
9263
- const _url = (customUrl || window.location.origin + basePath) +
9264
- (GlobalData.locale === 'tl-PH'
9265
- ? articleLink.replace('fil/', '')
9266
- : articleLink);
9267
- const params = {
9268
- bot_id: id,
9269
- account_id: ((_a = getUserInfoFromCookie()) === null || _a === void 0 ? void 0 : _a.id) || null,
9270
- action_id: '',
9271
- action_value: '',
9272
- cookie_id: getSubotCookieId((_c = (_b = GlobalData === null || GlobalData === void 0 ? void 0 : GlobalData.router) === null || _b === void 0 ? void 0 : _b.query) === null || _c === void 0 ? void 0 : _c.cookie_id),
9273
- current_score: 0,
9274
- current_keys: [],
9275
- current_selected: [],
9276
- form_submit_meta: [],
9277
- gtm_id: gaData ? Object.keys(gaData)[0] : '',
9278
- ga_client_id: Cookies.get('_ga') || '',
9279
- is_new: false,
9280
- mode: 'inline',
9281
- node_id: '',
9282
- selected_actions: {},
9283
- title_url: document.title || '',
9284
- // url: _url,
9285
- // Keep this commnent line to test on local
9286
- url: _url
9287
- .replace('http://localhost', 'https://discover.hellobacsi.com')
9288
- .replace('dev.', 'discover.'),
9289
- window_id: getWindowId(),
9290
- };
9291
- return overrideParamsByQuery(params, (_d = GlobalData === null || GlobalData === void 0 ? void 0 : GlobalData.router) === null || _d === void 0 ? void 0 : _d.query);
9292
- }, []);
9293
- const elementScrollIntoView = () => {
9294
- flag.current &&
9295
- flag.current.scrollIntoView({
9296
- behavior: 'smooth',
9297
- block: 'start',
9298
- inline: 'start',
9299
- });
9300
- };
9301
- const onChange = (message) => {
9302
- setState((state) => {
9303
- var _a;
9304
- 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)) {
9305
- const nodeActiveIndex = state.nodes.findIndex(({ id }) => id == (state === null || state === void 0 ? void 0 : state.activeId));
9306
- if (nodeActiveIndex !== -1) {
9307
- 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) });
9308
- state.nodes[nodeActiveIndex] = tmpNode;
9309
- }
9310
- }
9311
- return Object.assign({}, state);
9312
- });
9313
- };
9314
- const onSubmit = (nextNode, message) => __awaiter(void 0, void 0, void 0, function* () {
9315
- /**
9316
- * Skip the OTP Node if user's phone number is verified.
9317
- */
9318
- // if (nextNode) {
9319
- // const isNextNodeOTP = nextNode.type === NodeType.OTP
9320
- // if (isNextNodeOTP && verifiedPhone) {
9321
- // const actionOTPSubmit = nextNode.actions?.find(
9322
- // (action) => action.type === NodeActionType.USER_SUBMIT_SEND,
9323
- // )
9324
- // const blockOTPMessage: SubotMessage = {
9325
- // ...state.params,
9326
- // node_id: nextNode.id,
9327
- // action_id: actionOTPSubmit?.id,
9328
- // action_value: actionOTPSubmit?.key,
9329
- // }
9330
- // const res = await subotInlineMessage(blockOTPMessage)
9331
- // if (res?._status === 1) {
9332
- // const { node: _node, ...restData } = res?._data
9333
- // const nextNodeAfterOTP = {
9334
- // ..._node,
9335
- // _message: { ...restData, node_id: _node.id },
9336
- // }
9337
- // onSubmit && onSubmit(nextNodeAfterOTP, message)
9338
- // return
9339
- // }
9340
- // pushNotifications({
9341
- // title: '',
9342
- // message: f({ id: 'notification.comment.somethingWrong' }),
9343
- // type: 'danger',
9344
- // })
9345
- // return
9346
- // }
9347
- // }
9348
- const _state = Object.assign(Object.assign({}, state), { nodes: [...state.nodes] });
9349
- if (message && (message === null || message === void 0 ? void 0 : message.node_id)) {
9350
- const updateNodeIndex = _state.nodes.findIndex(({ id }) => id == message.node_id);
9351
- if (updateNodeIndex !== -1) {
9352
- _state.nodes[updateNodeIndex]._message = Object.assign(Object.assign({}, _state.nodes[updateNodeIndex]._message), message);
9353
- _state.nodes = [..._state.nodes.slice(0, updateNodeIndex + 1)];
9354
- }
9355
- }
9356
- setLoading(true);
9357
- if (nextNode) {
9358
- const nextNodeFindIndex = _state.nodes.findIndex(({ id }) => id == (nextNode === null || nextNode === void 0 ? void 0 : nextNode.id));
9359
- if (nextNodeFindIndex === -1) {
9360
- _state.nodes = [..._state.nodes, Object.assign({}, nextNode)];
9361
- }
9362
- else {
9363
- 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) });
9364
- _state.nodes = [
9365
- ..._state.nodes.slice(0, nextNodeFindIndex),
9366
- Object.assign({}, tmpNode),
9367
- ..._state.nodes.slice(nextNodeFindIndex + 1),
9368
- ];
9369
- }
9370
- _state.activeId = nextNode.id;
9371
- }
9372
- setTimeout(() => {
9373
- setState(_state);
9374
- setLoading(false);
9375
- _state.activeId &&
9376
- saveSubotInlineLogs({
9377
- nodes: _state.nodes,
9378
- activeId: _state.activeId,
9379
- params: _state.params,
9380
- accountIdFromLogs: refAccountIdFromLogs.current,
9381
- });
9382
- }, 250);
9383
- elementScrollIntoView();
9384
- });
9385
- const onPrev = () => {
9386
- var _a;
9387
- const _state = Object.assign({}, state);
9388
- 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));
9389
- if (nodeActiveIndex && nodeActiveIndex !== -1 && nodeActiveIndex > 1) {
9390
- const prevNode = _state.nodes[nodeActiveIndex - 1];
9391
- if (prevNode)
9392
- _state.activeId = prevNode.id;
9393
- }
9394
- elementScrollIntoView();
9395
- setState(Object.assign({}, _state));
9396
- _state.activeId &&
9397
- saveSubotInlineLogs({
9398
- nodes: _state.nodes,
9399
- activeId: _state.activeId,
9400
- params: _state.params,
9401
- accountIdFromLogs: refAccountIdFromLogs.current,
9402
- });
9403
- };
9404
- const onNext = (message) => __awaiter(void 0, void 0, void 0, function* () {
9405
- if (message && (message === null || message === void 0 ? void 0 : message.node_id)) {
9406
- const newMessage = Object.assign(Object.assign({}, message), getCurrentTotalDynamicScore(state.nodes, state.activeId, message.action_id));
9407
- const res = yield subotInlineMessage(newMessage);
9408
- setLoading(false);
9409
- if ((res === null || res === void 0 ? void 0 : res._status) === 1) {
9410
- const _a = res === null || res === void 0 ? void 0 : res._data, { node: _node } = _a, restData = __rest(_a, ["node"]);
9411
- const _nextNode = Object.assign(Object.assign({}, _node), { _message: Object.assign(Object.assign({}, restData), { node_id: _node.id }) });
9412
- const nextNodeFindIndex = state.nodes.findIndex(({ id }) => id === _nextNode.id);
9413
- if (nextNodeFindIndex !== -1) {
9414
- onSubmit(_nextNode);
9415
- }
9416
- else {
9417
- onSubmit(_nextNode, message);
9418
- }
9419
- return;
9420
- }
9421
- }
9422
- const nodeActive = state.nodes.find(({ id }) => id == (state === null || state === void 0 ? void 0 : state.activeId));
9423
- if (nodeActive && !nodeActive.hasOwnProperty('type')) {
9424
- setLoading(true);
9425
- if (state.nodes[0].id == (state === null || state === void 0 ? void 0 : state.activeId)) {
9426
- // elementScrollIntoView()
9427
- setTimeout(() => {
9428
- setState(Object.assign(Object.assign({}, state), { activeId: state.nodes[1].id.toString() }));
9429
- setLoading(false);
9430
- saveSubotInlineLogs({
9431
- nodes: state.nodes,
9432
- activeId: state.nodes[1].id.toString(),
9433
- params: getParams(),
9434
- accountIdFromLogs: refAccountIdFromLogs.current,
9435
- });
9436
- }, 250);
9437
- }
9438
- }
9439
- });
9440
- const onReset = () => {
9441
- setLoading(true);
9442
- setState((state) => {
9443
- state.nodes = state.nodes.slice(0, 2);
9444
- state.nodes[1] = Object.assign(Object.assign({}, state.nodes[1]), { _message: undefined });
9445
- state.activeId = state.nodes[0].id.toString();
9446
- return Object.assign({}, state);
9447
- });
9448
- setTimeout(() => {
9449
- setLoading(false);
9450
- }, 250);
9451
- elementScrollIntoView();
9452
- };
9453
- const getFirstAPI = (params) => __awaiter(void 0, void 0, void 0, function* () {
9454
- var _b;
9455
- if ((params === null || params === void 0 ? void 0 : params.url) && (params === null || params === void 0 ? void 0 : params.bot_id)) {
9456
- let activeId = '';
9457
- let nodes = [];
9458
- setLoading(true);
9459
- const resFirst = yield subotInlineFirstNode(params.bot_id);
9460
- if ((resFirst === null || resFirst === void 0 ? void 0 : resFirst._status) === 1) {
9461
- activeId = resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.id.toString();
9462
- nodes.push(resFirst === null || resFirst === void 0 ? void 0 : resFirst._data, resFirst === null || resFirst === void 0 ? void 0 : resFirst._data.first_node);
9463
- }
9464
- const subotLogs = yield getSubotInlineLogs(nodes[0]);
9465
- if (subotLogs) {
9466
- const lastNode = subotLogs.nodes[subotLogs.nodes.length - 1];
9467
- const isComplete = [
9468
- NodeType.FINAL,
9469
- NodeType.FINAL_THANK_YOU,
9470
- NodeType.FINAL_STANDARD,
9471
- ].includes(lastNode.type);
9472
- if (!isComplete) {
9473
- nodes = subotLogs.nodes;
9474
- activeId = subotLogs.activeId;
9475
- refAccountIdFromLogs.current = ((_b = subotLogs.params) === null || _b === void 0 ? void 0 : _b.account_id) || 0;
9476
- }
9477
- }
9478
- /** [Subot Inline] Show result page after redirect from SSO */
9479
- const previousState = getPreviousStateFromStorage(params.bot_id, {
9480
- getParams,
9481
- });
9482
- if (previousState &&
9483
- previousState.params.action_id &&
9484
- previousState.params.action_value) {
9485
- const resResultInline = yield subotInlineMessage(previousState.params);
9486
- if ((resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._status) === 1 && (resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node)) {
9487
- activeId = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node.id;
9488
- nodes = previousState.listNodes;
9489
- nodes[nodes.length - 1] = resResultInline === null || resResultInline === void 0 ? void 0 : resResultInline._data.node;
9490
- saveSubotInlineLogs({
9491
- nodes,
9492
- activeId: activeId,
9493
- params: previousState.params,
9494
- accountIdFromLogs: refAccountIdFromLogs.current,
9495
- });
9496
- setTimeout(() => {
9497
- elementScrollIntoView();
9498
- }, 100);
9499
- }
9500
- }
9501
- const newParams = (previousState === null || previousState === void 0 ? void 0 : previousState.params) || (subotLogs === null || subotLogs === void 0 ? void 0 : subotLogs.params) || params;
9502
- const _state = Object.assign(Object.assign({}, state), { params: newParams, activeId, nodes: nodes });
9503
- setLoading(false);
9504
- setState(_state);
9505
- }
9506
- });
9507
- useEffect(() => {
9508
- var _a;
9509
- if (!!((_a = state === null || state === void 0 ? void 0 : state.nodes) === null || _a === void 0 ? void 0 : _a.length)) {
9510
- console.log('Subot Already Loaded');
9511
- return () => undefined;
9512
- }
9513
- if (!Cookies.get(GA_TOKEN_COOKIE)) {
9514
- checkUntilFinished({
9515
- condition: () => Boolean(Cookies.get(GA_TOKEN_COOKIE)),
9516
- finished: () => {
9517
- const params = getParams();
9518
- getFirstAPI(params);
9519
- },
9520
- });
9521
- }
9522
- else {
9523
- const params = getParams();
9524
- getFirstAPI(params);
9525
- }
9526
- }, []);
9527
- if (state.nodes.length && !state.nodes[0].inline_active) {
9528
- return null;
9529
- }
9530
- return (React__default.createElement(SubotInlineContext.Provider, { value: Object.assign(Object.assign({}, state), { isMobile,
9531
- getParams,
9532
- onChange,
9533
- onSubmit,
9534
- onPrev,
9535
- onNext,
9536
- onReset,
9537
- trackingCommonInline,
9538
- userInfo }) },
9539
- React__default.createElement(SubotInlineLoadingContainer, { className: classNames('hhg-subot', `hhg-subot-${id}`, !!state.nodes.length && 'hhg-subot-style') }, !!state.nodes.length && (React__default.createElement(React__default.Fragment, null,
9540
- React__default.createElement("div", { ref: flag, className: "hhg-flag", style: {
9541
- position: 'absolute',
9542
- top: -150,
9543
- left: 0,
9544
- pointerEvents: 'none',
9545
- } }),
9546
- React__default.createElement(SubotInlineLoading, { isLoading: !!loading },
9547
- React__default.createElement(Loading, null),
9548
- "Verifying..."),
9549
- state.nodes.map((node, index) => {
9550
- if (node.id.toString() === (state === null || state === void 0 ? void 0 : state.activeId)) {
9551
- if (node.hasOwnProperty('type')) {
9552
- let NodeComponent;
9553
- switch (node === null || node === void 0 ? void 0 : node.position) {
9554
- case NodePosition.SSO:
9555
- NodeComponent =
9556
- SubotInlineNodeBase[NodePosition[node === null || node === void 0 ? void 0 : node.position].valueOf()];
9557
- break;
9558
- default:
9559
- NodeComponent =
9560
- SubotInlineNodeBase[NodeType[node === null || node === void 0 ? void 0 : node.type].valueOf()];
9561
- }
9562
- if (node.is_multi_select &&
9563
- node.type !== NodeType.POLL)
9564
- NodeComponent = SubotInlineNodeBase['MULTIPLE'];
9565
- return (NodeComponent && (React__default.createElement(NodeComponent, { key: index.toString(), indexNumber: index, node: node })));
9566
- }
9567
- else {
9568
- return (React__default.createElement(SubotInlineNodeStart, { key: index.toString(), node: node, setLoading: setLoading }));
9569
- }
9570
- }
9571
- return null;
9572
- }))))));
9573
- };
9574
-
9575
6422
  // subot.sendOTP.button
9576
6423
  // subot.resendOTP.button
9577
6424
  // subot.verifyOTP.button
@@ -9611,7 +6458,6 @@ var index = /*#__PURE__*/Object.freeze({
9611
6458
  Markdown: Markdown,
9612
6459
  hexRgb: hexRgb,
9613
6460
  SubotInlineVoucherLeftUI: SubotInlineVoucherLeftUI,
9614
- SubotInline: SubotInline,
9615
6461
  overrideParamsByQuery: overrideParamsByQuery,
9616
6462
  ssoIntents: ssoIntents,
9617
6463
  checkUntilFinished: checkUntilFinished,
@@ -9627,11 +6473,11 @@ var index = /*#__PURE__*/Object.freeze({
9627
6473
  isFakeEmail: isFakeEmail,
9628
6474
  formatUrlWithEncrypedGa: formatUrlWithEncrypedGa,
9629
6475
  getSubotApiPath: getSubotApiPath,
9630
- subotInlineMessage: subotInlineMessage$1,
9631
- computeExtraSettingsForBot: computeExtraSettingsForBot$1,
9632
- subotInlineFirstNode: subotInlineFirstNode$1,
9633
- subotInlineClick: subotInlineClick$1,
9634
- subotInlineImpression: subotInlineImpression$1,
6476
+ subotInlineMessage: subotInlineMessage,
6477
+ computeExtraSettingsForBot: computeExtraSettingsForBot,
6478
+ subotInlineFirstNode: subotInlineFirstNode,
6479
+ subotInlineClick: subotInlineClick,
6480
+ subotInlineImpression: subotInlineImpression,
9635
6481
  PATHS: PATHS$1,
9636
6482
  getPreviousStateFromStorage: getPreviousStateFromStorage,
9637
6483
  getSubotInlineLogs: getSubotInlineLogs,
@@ -9642,7 +6488,7 @@ var index = /*#__PURE__*/Object.freeze({
9642
6488
  detectToSkipNodeStart: detectToSkipNodeStart,
9643
6489
  KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD: KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD,
9644
6490
  SubotInlineIntentBaseTarget: SubotInlineIntentBaseTarget,
9645
- SubotInlineIntentBase: SubotInlineIntentBase$1,
6491
+ SubotInlineIntentBase: SubotInlineIntentBase,
9646
6492
  checkSyncDataOnFrisoCampaign: checkSyncDataOnFrisoCampaign,
9647
6493
  handleFrisoRedirecition: handleFrisoRedirecition,
9648
6494
  getDynamicScore: getDynamicScore,
@@ -9650,4 +6496,4 @@ var index = /*#__PURE__*/Object.freeze({
9650
6496
  replaceTextWithVariables: replaceTextWithVariables
9651
6497
  });
9652
6498
 
9653
- export { KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD, Markdown, PATHS$1 as PATHS, SubotInline, SubotInlineIntentBase$1 as SubotInlineIntentBase, SubotInlineIntentBaseTarget, SubotInlineRevampWithTheme, SubotInlineVoucherLeftUI, UserInfoForm, checkSyncDataOnFrisoCampaign, computeExtraSettingsForBot$1 as computeExtraSettingsForBot, ContainerWithProvider as default, detectToSkipNodeStart, extractUnifiedAnswers, extractVoucherAnswers, getColorWithOpacity, getCurrentTotalDynamicScore, getDynamicScore, getPreviousStateFromStorage, getSubotApiPath, getSubotInlineLogs, handleFrisoRedirecition, hexRgb, replaceTextWithVariables, saveSubotInlineLogs, subotInlineClick$1 as subotInlineClick, subotInlineFirstNode$1 as subotInlineFirstNode, subotInlineImpression$1 as subotInlineImpression, subotInlineMessage$1 as subotInlineMessage };
6499
+ export { KEY_OF_TEXT_CHOICE_WITH_OTHER_FIELD, Markdown, PATHS$1 as PATHS, SubotInlineIntentBase, SubotInlineIntentBaseTarget, SubotInlineRevampWithTheme, SubotInlineVoucherLeftUI, UserInfoForm, checkSyncDataOnFrisoCampaign, computeExtraSettingsForBot, ContainerWithProvider as default, detectToSkipNodeStart, extractUnifiedAnswers, extractVoucherAnswers, getColorWithOpacity, getCurrentTotalDynamicScore, getDynamicScore, getPreviousStateFromStorage, getSubotApiPath, getSubotInlineLogs, handleFrisoRedirecition, hexRgb, replaceTextWithVariables, saveSubotInlineLogs, subotInlineClick, subotInlineFirstNode, subotInlineImpression, subotInlineMessage };